o
    6h                      @   s   d dl mZmZmZ d dlZddlmZmZ ddlm	Z	m
Z
mZmZmZ ddlmZ er5d dlZejjZneZddddddddddd
d	eeef d
ee dedee dee dee dee dee dee dee dee defddZdS )    )OptionalUnionTYPE_CHECKINGN   )EmailSyntaxErrorValidatedEmail)split_emailvalidate_email_local_partvalidate_email_domain_namevalidate_email_domain_literalvalidate_email_length)CASE_INSENSITIVE_MAILBOX_NAMESF)
allow_smtputf8allow_empty_localallow_quoted_localallow_domain_literalallow_display_namecheck_deliverabilitytest_environmentglobally_deliverabletimeoutdns_resolveremailr   r   r   r   r   r   r   r   r   r   returnc      
   !   
   C   s8  ddl m}m}m}m}m}m}m}m} |du r|}|du r |}|du r&|}|du r,|}|du r2|}|du r8|}|du r>|}|	du rH|
du rH|}	t	| t
sfz| d} W n tye } ztd|d}~ww t| \}}}}t }|su|nd| d d | |_||_t||||d}|d	 |_|d
 |_|d |_td|j}||jkrz
t||||d W n ty } z	tdt
| |d}~ww ||_|r|std|jdur|j tv r|jdur|j |_|j |_d}t|dkrtd|dr'|dr't|dd }|std|d |_|d |_|d |_ d}nt!|||d}|d |_|d |_|jd |j |_"|jsZ|jsMt#d|jpRdd |j |_$nd|_$t%| |durm|smtd|r|s|rx|S ddl&m'} ||j|j|	|
}|(d} | dur| |_)|(d |_*|S )!z
    Given an email address, and some options, returns a ValidatedEmail instance
    with information about the address if it is valid or, if the address is not
    valid, raises an EmailNotValidError. This is the main function of the module.
    r   )ALLOW_SMTPUTF8ALLOW_QUOTED_LOCALALLOW_DOMAIN_LITERALALLOW_DISPLAY_NAMEGLOBALLY_DELIVERABLECHECK_DELIVERABILITYTEST_ENVIRONMENTDEFAULT_TIMEOUTNasciiz%The email address is not valid ASCII."@)r   r   quoted_local_part
local_partascii_local_partsmtputf8NFCzAfter Unicode normalization: z7Quoting the part before the @-sign is not allowed here.Fr   z)There must be something after the @-sign.[]z<A bracketed IP address after the @-sign is not allowed here.domaindomain_addressT)r   r   ascii_domainzMissing ASCII domain. zRA display name and angle brackets around the email address are not permitted here.)validate_email_deliverabilitymxmx_fallback_type)+r0   r   r   r   r   r   r   r    r!   
isinstancestrdecode
ValueErrorr   r   r   originaldisplay_namer	   r&   r'   r(   unicodedata	normalizelowerr   len
startswithendswithr   r-   r/   r.   r
   
normalized	Exceptionascii_emailr   deliverabilityr1   getr2   r3   )!r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   er9   r&   domain_partis_quoted_local_partretlocal_part_infonormalized_local_partis_domain_literaldomain_literal_infodomain_name_infor1   deliverability_infor2    rO   r/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/email_validator/validate_email.pyvalidate_email   s   (

	















rQ   )typingr   r   r   r:   exceptions_typesr   r   syntaxr   r	   r
   r   r   rfc_constantsr   dns.resolverdnsresolverResolver	_Resolverobjectr5   bytesboolintrQ   rO   rO   rO   rP   <module>   sX    

	
