
    ;eE                         	 g d Z ddlZddlZdZdZdZg dZg dZdddddd	d
ddd
dddddZd Z	d Z
d Zd Zd Z G d d          Z G d de          ZdS ))	mktime_tz	parsedateparsedate_tzquote    N  z, )janfebmaraprmayjunjulaugsepoctnovdecjanuaryfebruarymarchaprilr   junejulyaugust	septemberoctobernovemberdecember)montuewedthufrisatsunipiiiiDi)UTUTCGMTZASTADTESTEDTCSTCDTMSTMDTPSTPDTc                 b    	 t          |           }|sd S |d         d|d<   t          |          S )N	   r   )_parsedate_tztuple)dataress     '/usr/lib/python3.11/email/_parseaddr.pyr   r   -   sA     

C 
1v~A::    c           
         	 | sd S |                                  } | sd S | d                             d          s!| d                                         t          v r| d= n7| d                             d          }|dk    r| d         |dz   d          | d<   t          |           dk    r;| d                              d          }t          |          dk    r|| dd          z   } t          |           dk    rm| d         }|                    d          }|dk    r|                    d          }|dk    r|d |         ||d          g| dd <   n|                     d	           t          |           d
k     rd S | d d
         } | \  }}}}}|r|r|sd S |                                }|t          vr!||                                }}|t          vrd S t          	                    |          dz   }|dk    r|dz  }|d         dk    r
|d d         }|                    d          }|dk    r||}}|d         dk    r|d d         }|sd S |d         
                                s||}}|d         dk    r
|d d         }|                     d          }t          |          dk    r|\  }	}
d}nt          |          dk    r|\  }	}
}nqt          |          dk    r\d|d         v rR|d                              d          }t          |          dk    r|\  }	}
d}nt          |          dk    r|\  }	}
}nd S d S 	 t          |          }t          |          }t          |	          }	t          |
          }
t          |          }n# t          $ r Y d S w xY w|dk     r|dk    r|dz  }n|dz  }d }|                                }|t          v rt          |         }n>	 t          |          }n# t          $ r Y nw xY w|dk    r|                    d          rd }|r"|dk     rd}| }nd}||dz  dz  |dz  dz  z   z  }||||	|
|ddd|g
S )Nr   ,      -   +r         :   0.d   D   il  i  i  <   )splitendswithlower	_daynamesrfindlenfindappend_monthnamesindexisdigitint
ValueErrorupper
_timezones
startswith)r9   istuffsddmmyytmtzthhtmmtsstzoffsettzsigns                 r;   r7   r7   9   s     t::<<D t Aw $Q9 < <GGGMM#661gacddmDG
4yyA~~Qc""u::??48#D
4yyA~~GFF3KK77sAq55"1"qu~DHHKKOOO
4yy1}}t8DRRR 2 " t	B	RXXZZB[  4			2			"B	Bww
b	"v}}W
A1uuRB	"v}}W 	4a5==?? RB	"v}}W	#B
2ww!||
c	RAc33	RA#A,,U[[r77a<<JS#CCWW\\ OS#ss4tWWWW#hh#hh#hh   tt 
Cxx77$JBB $JBH	B	Zb>	2wwHH 	 	 	D	Q;;2==--;H Ja<<F yHHFx}d2hnb5HHIBS#q!R::s%   7AN 
NNO) )
O65O6c                 d    	 t          |           }t          |t                    r
|d d         S |S )Nr6   )r   
isinstancer8   r9   ts     r;   r   r      s6    0TA!U !ur<   c                     	 | d         t          j        | d d         dz             S t          j        |           }|| d         z
  S )Nr6      )rD   )timemktimecalendartimegmrm   s     r;   r   r      sH    OAw{48e+,,,OD!!47{r<   c                 X    	 |                      dd                               dd          S )N\z\\"z\")replace)strs    r;   r   r      s-     ;;tV$$,,S%888r<   c                   b    e Zd Z	 d Zd Zd Zd Zd Zd Zd Z	dd	Z
d
 Zd Zd ZddZd ZdS )AddrlistClassc                     	 d| _         d| _        d| _        d| _        | j        | j        z   | _        | j         | j        z   | j        z   | _        | j                            dd          | _        || _        g | _	        d S )Nz()<>@,:;."[]r   z 	z
rJ   r   )
specialsposLWSCRFWSatomendsrx   
phraseendsfieldcommentlistselfr   s     r;   __init__zAddrlistClass.__init__   s|    	
 (8dg%047: -//R88
r<   c                    	 g }| j         t          | j                  k     r| j        | j                  | j        dz   v rJ| j        | j                  dvr%|                    | j        | j                             | xj         dz  c_         nD| j        | j                  dk    r-| j                            |                                            nn| j         t          | j                  k     t                              |          S )Nz
r?   ()	r~   rS   r   r   rU   r   
getcommentEMPTYSTRINGjoin)r   wslists     r;   gotonextzAddrlistClass.gotonext   s    4hTZ((z$(#tx&'888:dh'v55MM$*TX"6777ADH%,, ''(9(9:::: hTZ(( '''r<   c                     	 g }| j         t          | j                  k     rN|                                 }|r||z  }n|                    d           | j         t          | j                  k     N|S )N)r   r   )r~   rS   r   
getaddressrU   )r   resultads      r;   getaddrlistzAddrlistClass.getaddrlist   su    	 hTZ((""B ("h''' hTZ(( r<   c                    	 g | _         |                                  | j        }| j         }|                                 }|                                  g }| j        t	          | j                  k    r,|r(t                              | j                   |d         fg}n| j        | j                 dv rF|| _        || _         |                                 }t                              | j                   |fg}n| j        | j                 dk    rg }t	          | j                  }| xj        dz  c_        | j        t	          | j                  k     rz|                                  | j        |k     r'| j        | j                 dk    r| xj        dz  c_        n4|| 	                                z   }| j        t	          | j                  k     zn| j        | j                 dk    rx| 
                                }| j         r?t                              |          dz   d                    | j                   z   d	z   |fg}nrt                              |          |fg}nT|r)t                              | j                   |d         fg}n)| j        | j                 | j        v r| xj        dz  c_        |                                  | j        t	          | j                  k     r&| j        | j                 d
k    r| xj        dz  c_        |S )Nr   z.@rG   r?   ;<z (r   )r>   )r   r   r~   getphraselistrS   r   SPACEr   getaddrspecr   getrouteaddrr}   )r   oldposoldclplist
returnlistaddrspecfieldlen	routeaddrs           r;   r   zAddrlistClass.getaddress  s   % ""$$
8s4:&& H$zz$*:;;U1XFG
Z!T)) DH$D''))H ::d&677BCJJZ!S((J4:HHHMHH(S__,,8h&&4:dh+?3+F+FHHMHH'$//*;*;;
 (S__,, Z!S(())++I >$zz%0047"xx(899 :<? @AJL M

  %zz%00)<=

  $zz$*:;;U1XFG

DH%66A8c$*oo%%$*TX*>#*E*EHHMHHr<   c                    	 | j         | j                 dk    rd S d}| xj        dz  c_        |                                  d}| j        t          | j                   k     r|r|                                  d}n| j         | j                 dk    r| xj        dz  c_        n| j         | j                 dk    r| xj        dz  c_        d}nL| j         | j                 dk    r| xj        dz  c_        n%|                                 }| xj        dz  c_        n1|                                  | j        t          | j                   k     |S )	Nr   Fr?   r   >@TrG   )r   r~   r   rS   	getdomainr   )r   expectrouteadlists      r;   r   zAddrlistClass.getrouteaddrG  s?   	 :dh3&&FAhTZ((    #DH%,,ADH%,,A"DH%,,A))++AMMOOO! hTZ(($ r<   c                    	 g }|                                   | j        t          | j                  k     rzd}| j        | j                 dk    rX|r.|d                                         s|                                 |                    d           | xj        dz  c_        d}n| j        | j                 dk    r8|                    dt          |                                           z             nq| j        | j                 | j	        v r1|r.|d                                         s|                                 nr|                    | 
                                           |                                  }|r|r|                    |           | j        t          | j                  k     z| j        t          | j                  k    s| j        | j                 dk    rt                              |          S |                    d           | xj        dz  c_        |                                   |                                 }|st          S t                              |          |z   S )	NTrJ   rD   r?   Frw   z"%s"r   )r   r~   rS   r   strippoprU   r   getquoter   getatomr   r   r   )r   aslistpreserve_wswsdomains        r;   r   zAddrlistClass.getaddrspecg  s   *hTZ((Kz$(#s** !&*"2"2"4"4 !JJLLLc"""A#DH%,,fuT]]__'='==>>>>DH%66 !&*"2"2"4"4 !JJLLLdllnn---B "r "b!!!% hTZ((( 8s4:&&$*TX*>#*E*E##F+++cA!! 	 ''&00r<   c                 @   	 g }| j         t          | j                  k     rd| j        | j                  | j        v r| xj         dz  c_         n| j        | j                  dk    r-| j                            |                                            n| j        | j                  dk    r(|                    |                                            n| j        | j                  dk    r&| xj         dz  c_         |                    d           n^| j        | j                  dk    rt          S | j        | j                  | j	        v rnE|                    | 
                                           | j         t          | j                  k     dt                              |          S )Nr?   r   [rJ   r   )r~   rS   r   r   r   rU   r   getdomainliteralr   r   r   r   )r   sdlists     r;   r   zAddrlistClass.getdomain  sg   ;hTZ((z$(#tx//ADH%,, ''(9(9::::DH%,,d33556666DH%,,Ac""""DH%,, #"DH%66dllnn---# hTZ(($ '''r<   Tc                    	 | j         | j                 |k    rdS dg}d}| xj        dz  c_        | j        t          | j                   k     r|r(|                    | j         | j                            d}n| j         | j                 |v r| xj        dz  c_        n|r>| j         | j                 dk    r(|                    |                                            | j         | j                 dk    rd}n%|                    | j         | j                            | xj        dz  c_        | j        t          | j                   k     t
                              |          S )Nr   Fr?   r   rv   T)r   r~   rS   rU   r   r   r   )r   	begincharendcharsallowcommentsslistr   s         r;   getdelimitedzAddrlistClass.getdelimited  sN   	 :dh9,,2AhTZ(( 3TZ1222DH%11A 34:dh#73#>#>T__..///DH%--TZ1222HHMHH hTZ((  &&&r<   c                 2    	 |                      ddd          S )Nrw   z"Fr   r   s    r;   r   zAddrlistClass.getquote  s    ?  eU333r<   c                 2    	 |                      ddd          S )Nr   z)Tr   r   s    r;   r   zAddrlistClass.getcomment  s    E  eT222r<   c                 8    	 d|                      ddd          z  S )Nz[%s]r   z]Fr   r   s    r;   r   zAddrlistClass.getdomainliteral  s"    /))#ue<<<<r<   Nc                 X   	 dg}|| j         }| j        t          | j                  k     rg| j        | j                 |v rnR|                    | j        | j                            | xj        dz  c_        | j        t          | j                  k     gt
                              |          S )Nr   r?   )r   r~   rS   r   rU   r   r   )r   r   atomlists      r;   r   zAddrlistClass.getatom  s    	! 4}HhTZ((z$(#x//
48 4555HHMHH hTZ(( )))r<   c                 h   	 g }| j         t          | j                  k     r| j        | j                  | j        v r| xj         dz  c_         n| j        | j                  dk    r(|                    |                                            n| j        | j                  dk    r-| j                            |                                            nG| j        | j                  | j        v rnK|                    | 	                    | j                             | j         t          | j                  k     |S )Nr?   rw   r   )
r~   rS   r   r   rU   r   r   r   r   r   )r   r   s     r;   r   zAddrlistClass.getphraselist  s
   	 hTZ((z$(#tx//ADH%,,T]]__----DH%,, ''(9(9::::DH%88T\\$/::;;; hTZ(( r<   )TN)__name__
__module____qualname__r   r   r   r   r   r   r   r   r   r   r   r   r    r<   r;   r{   r{      s          &( ( (  9 9 9v  @$1 $1 $1L( ( (.#' #' #' #'J4 4 43 3 3= = =* * * *(    r<   r{   c                   :    e Zd Z	 d Zd Zd Zd Zd Zd Zd Z	dS )	AddressListc                     t                               | |           |r|                                 | _        d S g | _        d S r   )r{   r   r   addresslistr   s     r;   r   zAddressList.__init__  sH    tU+++ 	"#//11D!Dr<   c                 *    t          | j                  S r   )rS   r   r   s    r;   __len__zAddressList.__len__	  s    4#$$$r<   c                     t          d           }| j        d d          |_        |j        D ]%}|| j        vr|j                            |           &|S r   r   r   rU   r   othernewaddrxs       r;   __add__zAddressList.__add__  s`    d##".qqq1" 	. 	.A(((#**1---r<   c                 `    |j         D ]%}|| j         vr| j                             |           &| S r   )r   rU   r   r   r   s      r;   __iadd__zAddressList.__iadd__  s?    " 	+ 	+A((( ''***r<   c                 ~    t          d           }| j        D ]%}||j        vr|j                            |           &|S r   r   r   s       r;   __sub__zAddressList.__sub__  sL    d##! 	. 	.A)))#**1---r<   c                 `    |j         D ]%}|| j         v r| j                             |           &| S r   )r   remover   s      r;   __isub__zAddressList.__isub__$  s?    " 	+ 	+AD$$$ ''***r<   c                     | j         |         S r   )r   )r   rW   s     r;   __getitem__zAddressList.__getitem__+  s    &&r<   N)
r   r   r   r   r   r   r   r   r   r   r   r<   r;   r   r      s        J" " "% % %        ' ' ' ' 'r<   r   )__all__rq   rs   r   r   
COMMASPACErV   rQ   r\   r   r7   r   r   r   r{   r   r   r<   r;   <module>r      sI  
          
I I I
 >==	 AQA$$$$$ 

 
 
z; z; z;z    9 9 9k k k k k k k kZ	-' -' -' -' -'- -' -' -' -' -'r<   