o
    Ù­jÈ&  ã                   @   s  d dl mZmZmZ d dlZddlmZ ddlmZ ddl	m
Z
mZmZmZmZ ddlmZ er9d dlZejjZneZddddddddddddœd	eeef 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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_NAMES)Úallow_smtputf8Úallow_empty_localÚallow_quoted_localÚallow_domain_literalÚallow_display_nameÚstrictÚcheck_deliverabilityÚtest_environmentÚglobally_deliverableÚtimeoutÚdns_resolverÚemailr   r   r   r   r   r   r   r   r   r   r   Úreturnc         $   
   C   sˆ  ddl m}m}m}m}m}m}m}m}m	}m
} |du r|}|du r$|}|du r*|}|du r0|}|du r6|}|du r<|}|du rB|}|du rH|}|	du rN|}	|
du rX|du rX|}
t| tƒr^n"t| tƒr|z|  d¡} W n ty{ } ztdƒ|‚d}~ww tdƒ‚t| ƒ\}}}}|r�t d|¡}tƒ }|s—|nd| d d	 | |_||_t|||||d
�}|d |_|d |_|d |_t d|j¡}||jkrízt|||||d
� W n tyé } z	tdt|ƒ ƒ|‚d}~ww ||_|rõ|sõtdƒ‚|jdu�r|j ¡ tv �r|jdu�r|j ¡ |_|j ¡ |_d}t|ƒdk�r"tdƒ‚| d¡�rO|  d¡�rOt!|dd… ƒ}|�s=tdƒ‚|d |_"|d |_#|d |_$d}nt%|||	d�} | d |_"| d |_#|jd	 |j" |_&|j�s‚|j#�sut'dƒ‚|j�pzdd	 |j# |_(nd|_(t)|ƒ |du�r•|�s•tdƒ‚|�rÂ|�sÂ|�r |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_EMPTY_LOCALÚALLOW_QUOTED_LOCALÚALLOW_DOMAIN_LITERALÚALLOW_DISPLAY_NAMEÚSTRICTÚGLOBALLY_DELIVERABLEÚCHECK_DELIVERABILITYÚTEST_ENVIRONMENTÚDEFAULT_TIMEOUTNÚasciiz%The email address is not valid ASCII.zemail must be str or bytesÚNFCú"ú@)r   r   Úquoted_local_partr   Ú
local_partÚascii_local_partÚsmtputf8z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)/r3   r   r   r   r   r   r    r!   r"   r#   r$   Ú
isinstanceÚstrÚbytesÚdecodeÚ
ValueErrorr   Ú	TypeErrorr   ÚunicodedataÚ	normalizer   ÚoriginalÚdisplay_namer	   r*   r+   r,   Úlowerr   ÚlenÚ
startswithÚendswithr   r0   r2   r1   r
   Ú
normalizedÚ	ExceptionÚascii_emailr   Údeliverabilityr4   Úgetr5   r6   )$r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   Úer@   r*   Údomain_partÚis_quoted_local_partÚretÚlocal_part_infoÚnormalized_local_partÚis_domain_literalÚdomain_literal_infoÚdomain_name_infor4   Údeliverability_infor5   © rT   ú[/var/www/html/CropPilot/venv/lib/python3.10/site-packages/email_validator/validate_email.pyÚvalidate_email   sØ   0


€ÿ
ÿ
þþü




ü€ÿ




ÿ

rV   )Útypingr   r   r   r=   Ú
exceptionsr   Útypesr   Úsyntaxr   r	   r
   r   r   Úrfc_constantsr   Údns.resolverÚdnsÚresolverÚResolverÚ	_ResolverÚobjectr8   r9   ÚboolÚintrV   rT   rT   rT   rU   Ú<module>   s`    
ò
ÿüûúùø	÷
öõôóòñ