
    h                       S SK Jr  S SKrS SKrS SKrS SKrS SKrS SKrS SK	r	S SK
r
S SK
JrJrJrJrJrJr  SSKJrJrJrJr  SSKJr  SSKJr  \
R2                  " S5      r\	R6                  S	:  a  \rO " S
 S\5      r " S S\5      r " S S\SS9r 1 Skr!1 Skr"S1r#SFS jr$SGS jr%SHS jr&0 SS_SS_SS_SS_SS_S S!_S"S"_S#S$_S%S%_S&S&_S'S(_S)S*_S+S+_S,S-_S.S/_S0S0_S1S1_S2S3SS4S5S6S7S8S9S:S;S<S=S>.Er'\'RQ                  5        V Vs0 s H  u  pX_M	     snn r)SIS? jr*\+" 5       r,/ S@Qr-\S@   r.\/" / SAQ5      r0 " SB SC\\   5      r1 " SD SE5      r2gs  snn f )J    )annotationsN)AnyCallableGenericLiteral	TypedDictcast   )licensesrequirements
specifiersutils)version)NormalizedLicenseExpressionT)      c                  B    \ rS rSr% SrS\S'   S\S'   SS jrSS jrS	rg
)ExceptionGroup   zA minimal implementation of :external:exc:`ExceptionGroup` from Python 3.11.

If :external:exc:`ExceptionGroup` is already defined by Python itself,
that version is used instead.
strmessagelist[Exception]
exceptionsc                    Xl         X l        g N)r   r   )selfr   r   s      D/var/www/html/env/lib/python3.13/site-packages/packaging/metadata.py__init__ExceptionGroup.__init__)   s    "L(O    c                l    U R                   R                   SU R                  < SU R                  < S3$ )N(z, ))	__class____name__r   r   )r   s    r   __repr__ExceptionGroup.__repr__-   s1    nn--.a/?r$//ATTUVVr!   )r   r   N)r   r   r   r   returnNone)r)   r   )	r&   
__module____qualname____firstlineno____doc____annotations__r   r'   __static_attributes__ r!   r   r   r      s    	 ##	)	Wr!   r   c                  >   ^  \ rS rSr% SrS\S'    SU 4S jjrSrU =r$ )InvalidMetadata1   z'A metadata field contains invalid data.r   fieldc                0   > Xl         [        TU ]	  U5        g r   )r5   superr   )r   r5   r   r%   s      r   r   InvalidMetadata.__init__7   s    
!r!   )r5   )r5   r   r   r   r)   r*   )	r&   r+   r,   r-   r.   r/   r   r0   __classcell__)r%   s   @r   r3   r3   1   s    1J;" "r!   r3   c                  F   \ rS rSr% SrS\S'   S\S'   S\S'   S\S'   S\S	'   S\S
'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S '   S\S!'   S\S"'   S\S#'   S$rg%)&RawMetadata@   a  A dictionary of raw core metadata.

Each field in core metadata maps to a key of this dictionary (when data is
provided). The key is lower-case and underscores are used instead of dashes
compared to the equivalent core metadata field. Any core metadata field that
can be specified multiple times or can hold multiple values in a single
field have a key with a plural name. See :class:`Metadata` whose attributes
match the keys of this dictionary.

Core metadata fields that can be specified multiple times are stored as a
list or dict depending on which is appropriate for the field. Any fields
which hold multiple values in a single field are stored as a list.

r   metadata_versionnamer   	list[str]	platformssummarydescriptionkeywords	home_pageauthorauthor_emaillicensesupported_platformsdownload_urlclassifiersrequiresprovides	obsoletes
maintainermaintainer_emailrequires_distprovides_distobsoletes_distrequires_pythonrequires_externaldict[str, str]project_urlsdescription_content_typeprovides_extradynamiclicense_expressionlicense_filesr1   N)r&   r+   r,   r-   r.   r/   r0   r1   r!   r   r;   r;   @   s      
ILLNKL #" O     "!  r!   r;   F)total>   r>   rE   rG   rA   r   rD   rN   rB   rF   rI   rS   rO   r=   rZ   rW   >   rY   rL   rK   rM   r@   rJ   r[   rQ   rP   rR   rX   rT   rH   rV   c                j    U R                  S5       Vs/ s H  oR                  5       PM     sn$ s  snf )zCSplit a string of comma-separated keywords into a list of keywords.,)splitstrip)dataks     r   _parse_keywordsrc      s&    #zz#/!GGI///s   0c                
   0 nU  Hu  nUR                  SS5       Vs/ s H  o3R                  5       PM     nnUR                  S/[        SS[	        U5      -
  5      -  5        Uu  pVXQ;   a  [        S5      eXaU'   Mw     U$ s  snf )z?Parse a list of label/URL string pairings separated by a comma.r^   r
    r      z duplicate labels in project urls)r_   r`   extendmaxlenKeyError)ra   urlspairppartslabelurls          r   _parse_project_urlsrq      s    D$ %)JJsA$67$6q$67bTSAE
N345 
= =>>UA D K! 8s   B c                ,   [        U[        5      (       a)  U R                  5       n[        U[        5      (       d   eU$ U R                  SS9n[        U[        5      (       d   e UR	                  SS5      $ ! [
         a  n[        S5      UeSnAff = f)zGet the body of the message.Tdecodeutf8strictzpayload in an invalid encodingN)
isinstancer   get_payloadbytesrt   UnicodeDecodeError
ValueError)msgsourcepayloadbpayloadexcs        r   _get_payloadr      s     &#//#'3'''' ??$?/(E****	H??6844! 	H=>CG	Hs   &A8 8
BBBrE   zauthor-emailrF   
classifierrJ   rB   zdescription-content-typerW   zdownload-urlrI   rY   z	home-pagerD   rC   rG   zlicense-expressionrZ   zlicense-filer[   rN   zmaintainer-emailrO   metadata-versionr=   r>   rM   rR   r@   rL   rQ   rX   rK   rP   rT   rS   rA   rH   r   )zobsoletes-distplatformzproject-urlrL   zprovides-distzprovides-extrarK   zrequires-distzrequires-externalzrequires-pythonrA   zsupported-platformr   c           	     0   0 n0 n[        U [        5      (       aE  [        R                  R	                  [        R
                  R                  S9R                  U 5      nOD[        R                  R                  [        R
                  R                  S9R                  U 5      n[        UR                  5       5       GH  nUR                  5       nUR                  U5      =(       d    / n/ nSnU H  n[        U[        R                  R                  [        45      (       d   e[        U[        R                  R                  5      (       a  / n	[        R                  R!                  U5       H,  u  p U
R#                  SS5        SnU	R'                  X45        M.     UR'                  [        [        R                  R)                  U	5      5      5        M  UR'                  U5        M     U(       d  XbU'   GM>  [*        R-                  U5      nUc  XbU'   GM]  U[.        ;   a  [1        U5      S:X  a
  US   X'   GM  U[2        ;   a  XaU'   GM  US	:X  a"  [1        U5      S:X  a  [5        US   5      X'   GM  US
:X  a   [7        U5      X'   GM  XbU'   GM      [;        X05      nU(       ag  SU;   aB  [=        [        UR?                  S5      5      nURA                  S/ 5      RC                  X/5        OSU;   a  US   R'                  U5        OXS'   [=        [J        U5      U4$ ! [$         a    SnSn GNf = f! [8         a	    XbU'    GM  f = f! [D         a?    URA                  S/ 5      R'                  URG                  [        U [H        5      S95         Nf = f)a  Parse a distribution's metadata stored as email headers (e.g. from ``METADATA``).

This function returns a two-item tuple of dicts. The first dict is of
recognized fields from the core metadata specification. Fields that can be
parsed and translated into Python's built-in types are converted
appropriately. All other fields are left as-is. Fields that are allowed to
appear multiple times are stored as lists.

The second dict contains all other fields from the metadata. This includes
any unrecognized fields. It also includes any fields which are expected to
be parsed into a built-in type but were not formatted appropriately. Finally,
any fields that are expected to appear only once but are repeated are
included in this dict.

)policyTru   rv   latin1Fr
   r   rC   rV   rB   rs   )&rw   r   emailparserParserr   compat32parsestrBytesParser
parsebytes	frozensetkeyslowerget_allheaderHeaderdecode_headerrt   rz   appendmake_header_EMAIL_TO_RAW_MAPPINGget_STRING_FIELDSri   _LIST_FIELDSrc   rq   rj   r   r	   pop
setdefaultrg   r{   rx   ry   r;   )ra   rawunparsedparsedr>   headersvaluevalid_encodinghchunksbinencodingraw_namer~   description_headers                  r   parse_emailr     s.     8:C%'H$$$ELL,A,A$BKKDQ))1F1F)GRRSWX
 &++-( zz|
 ..&,"  A a%,,"5"5s!;<<<< !U\\0011 :<%*\\%?%?%BMC*

684 $*MM3/2 &C S!9!9&!ABC QG P "TN(,,T2 #TN ~%#e*/!!HCM %!M #E
a+E!H5CM '' 3E : #TNi )t-v,  #%)#sww}/E%F"##M26=='1 (*'..w7%,M" S!8++Q . /#+)./J  '!&'  
M2.55ju&=>	

s7   4L!<L6M !L3	2L3	6M	M	ANN)1.01.11.22.12.2z2.32.4)r=   r>   r   c                     \ rS rSr% SrS\S'   S\S'   S\S'   SS	.   SS
 jjrSS jrSS jr S     SS jjr	S S jr
S!S jrS"S jrS!S jrS!S jrS#S jr    S$S jrS%S jr    S&S jr    S'S jrS#S jrSrg)(
_Validatori  a^  Validate a metadata field.

All _process_*() methods correspond to a core metadata field. The method is
called with the field's raw value. If the raw value is valid it is returned
in its "enriched" form (e.g. ``version.Version`` for the ``Version`` field).
If the raw value is invalid, :exc:`InvalidMetadata` is raised (with a cause
as appropriate).
r   r>   r   _MetadataVersionaddedr   r   c                   Xl         g r   r   )r   r   s     r   r   _Validator.__init__  s	    
 
r!   c                ,    X l         [        U   U l        g r   )r>   _RAW_TO_EMAIL_MAPPINGr   )r   _ownerr>   s      r   __set_name___Validator.__set_name__  s    	-d3r!   c                   UR                   nUR                  R                  U R                  5      nU R                  [        ;   d  Ub"   [        U SU R                   35      nU" U5      nXCU R                  '    UR                  U R                  	 [        [        U5      $ ! [         a     NBf = f! [         a     N,f = f)N	_process_)
__dict___rawr   r>   _REQUIRED_ATTRSgetattrAttributeErrorrj   r	   r   )r   instancer   cacher   	converters         r   __get___Validator.__get__  s     !!!!$)), 99'5+<)07	$))>U0V	 "%( dii	dii( Au~ "   		s$   
B! :B1 !
B.-B.1
B>=B>Nc           	         [        U R                  UR                  S[        U R                  5      05      5      nX#l        U$ )Nr5   )r3   r   
format_maprepr	__cause__)r   r|   causer   s       r   _invalid_metadata_Validator._invalid_metadata  s:     MM3>>7D4G*HI
 
r!   c                `    U[         ;  a  U R                  U< S35      e[        [        U5      $ )Nz  is not a valid metadata version)_VALID_METADATA_VERSIONSr   r	   r   r   r   s     r   _process_metadata_version$_Validator._process_metadata_version  s2    00((E94T)UVV$e,,r!   c                    U(       d  U R                  S5      e [        R                  " USS9  U$ ! [        R                   a  nU R                  U< S3US9UeS nAff = f)N{field} is a required fieldTvalidate is invalid for {field}r   )r   r   canonicalize_nameInvalidNamer   r   r   s      r   _process_name_Validator._process_name  ss    (()FGG	##ED9 L    	(()45S ) 	s   1 AAAc                    U(       d  U R                  S5      e [        R                  " U5      $ ! [        R                   a  nU R                  U< S3US9UeS nAff = f)Nr   r   r   )r   version_moduleparseInvalidVersionr   s      r   _process_version_Validator._process_version(  sk    (()FGG	!''..,, 	(()45S ) 	s   0 AAAc                4    SU;   a  U R                  S5      eU$ )z%Check the field contains no newlines.
z{field} must be a single line)r   r   s     r   _process_summary_Validator._process_summary2  s     5=(()HIIr!   c                
   1 Skn[         R                  R                  5       nXS'   UR                  5       R	                  5       US   R
                  pTXB;  d  XAR	                  5       ;  a!  U R                  S[        U5       SU< 35      eUR                  SS5      nUS:w  a  U R                  S[        U5       35      eSS	1nUR                  S
S5      nUS:X  a&  X;  a!  U R                  S[        U5       SU< 35      eU$ )N>   
text/plain
text/x-rsttext/markdownzcontent-typez{field} must be one of , not charsetzUTF-8z0{field} can only specify the UTF-8 charset, not GFM
CommonMarkvariantr   z(valid Markdown variants for {field} are )	r   r   EmailMessageget_content_typer   paramsr   listr   )	r   r   content_typesr   content_type
parametersr   markdown_variantsr   s	            r   !_process_description_content_type,_Validator._process_description_content_type8  s$   E--,,."' $$&,,.N#** ! ,KKM0Q((+D,?+@uiP  ..G4g((DT']OT  #L1..E2?*w/O((<TBS=T<U Vk#  r!   c                    [        [        R                  U5       H=  nUS;   a  U R                  U< S35      eU[        ;  d  M*  U R                  U< S35      e   [        [        [        R                  U5      5      $ )N>   r>   r   r   z" is not allowed as a dynamic fieldz is not a valid dynamic field)mapr   r   r   r   r   )r   r   dynamic_fields      r   _process_dynamic_Validator._process_dynamicX  s     E2M GG,,$''IJ  &;;,,$''DE  3 C		5)**r!   c                    / n U H'  nUR                  [        R                  " USS95        M)     U$ ! [        R                   a  nU R	                  W< S3US9UeS nAff = f)NTr   r   r   )r   r   r   r   r   )r   r   normalized_namesr>   r   s        r   _process_provides_extra"_Validator._process_provides_extrad  s|     	$ ''(?(?t(TU  $#    	(((34C ) 	s   -3 A!AA!c                     [         R                  " U5      $ ! [         R                   a  nU R                  U< S3US9UeS nAff = fNr   r   )r   SpecifierSetInvalidSpecifierr   r   s      r   _process_requires_python#_Validator._process_requires_pythons  sV    	**511** 	(()45S ) 	s    AAAc                    / n U H(  nUR                  [        R                  " U5      5        M*     U$ ! [        R                   a  nU R	                  W< S3US9UeS nAff = fr  )r   r   RequirementInvalidRequirementr   )r   r   reqsreqr   s        r   _process_requires_dist!_Validator._process_requires_dist{  sv     	L44S9:  K .. 	(('233 ) 	s   .4 A"AA"c                ~     [         R                  " U5      $ ! [         a  nU R                  U< S3US9UeS nAff = fr  )r   canonicalize_license_expressionr{   r   r   s      r   _process_license_expression&_Validator._process_license_expression  sP    	;;EBB 	(()45S ) 	s    
<7<c                   / nU H  nSU;   a  U R                  U< S35      eSU;   a  U R                  U< S35      e[        R                  " U5      R                  5       (       d)  [        R                  " U5      R                  5       (       a  U R                  U< S35      e[        R                  " U5      R                  5       U:w  a  U R                  U< S35      eUR                  U5        M     U$ )Nz..zD is invalid for {field}, parent directory indicators are not allowed*z/ is invalid for {field}, paths must be resolvedz/ is invalid for {field}, paths must be relativez5 is invalid for {field}, paths must use '/' delimiter)r   pathlibPurePosixPathis_absolutePureWindowsPathas_posixr   )r   r   pathspaths       r   _process_license_files!_Validator._process_license_files  s   Dt|,,h B B  d{,,hOP  %%d+7799**40<<>>,,hOP  &&t,5574?,,hUV  LL+ , r!   )r   r>   r   )r   r   r)   r*   )r   Metadatar>   r   r)   r*   )r   r"  r   ztype[Metadata]r)   r   r   )r|   r   r   zException | Noner)   r3   )r   r   r)   r   )r   r   r)   r   )r   r   r)   zversion_module.Version)r   r?   r)   r?   )r   r?   r)   zlist[utils.NormalizedName])r   r   r)   zspecifiers.SpecifierSet)r   r?   r)   zlist[requirements.Requirement])r   r   r)   z"NormalizedLicenseExpression | None)r&   r+   r,   r-   r.   r/   r   r   r   r   r   r   r   r   r   r   r  r
  r  r  r   r0   r1   r!   r   r   r     s     IM
 #(   
	48 37/	-@
+$$ 
$$ 
(	+r!   r   c                  @   \ rS rSr% SrS\S'   \SS.S9S jj5       r\SS.S:S jj5       r\	" 5       r
S	\S
'    \	" 5       rS\S'    \	" 5       rS\S'    \	" SS9rS\S'    \	" 5       rS\S'    \	" SS9rS\S'    \	" 5       rS\S'    \	" 5       rS\S'    \	" SS9rS\S'    \	" 5       rS\S'    \	" 5       rS\S'    \	" SS9rS\S'    \	" 5       rS\S'    \	" 5       rS\S'    \	" S S9rS\S!'    \	" S S9rS\S"'    \	" 5       rS\S#'    \	" S$S9rS%\S&'    \	" S$S9rS\S''    \	" SS9rS\S('    \	" S S9rS)\S*'    \	" S S9rS+\S,'    \	" S S9r S\S-'    \	" S S9r!S.\S/'    \	" SS9r"S0\S1'    \	" S S9r#S\S2'    \	" S S9r$S\S3'    \	" SS9r%S\S4'    \	" SS9r&S\S5'    \	" SS9r'S\S6'   S7r(g8);r"  i  a6  Representation of distribution metadata.

Compared to :class:`RawMetadata`, this class provides objects representing
metadata fields instead of only using built-in types. Any invalid metadata
will cause :exc:`InvalidMetadata` to be raised (with a
:py:attr:`~BaseException.__cause__` attribute as appropriate).
r;   r   Tr   c          	        U " 5       nUR                  5       Ul        U(       a  / n UR                  n[        R	                  U5      n[        UR                  5      [        -  nUS1-  nU H{  n	 U(       ae   U R                  U	   R                  n
[        R	                  U
5      nUW:  a0  [        U	   n[        UU SU
 SU 35      nUR                  U5        Mp  [        X95        M}     U(       a  [        SU5      eU$ ! [
         a  nUR                  U5        Sn SnANSnAff = f! [         a%    [        U	SU	< 35      nUR                  U5         M  f = f! [
         a  nUR                  U5         SnAGM  SnAff = f)zCreate an instance from :class:`RawMetadata`.

If *validate* is true, all metadata will be validated. All exceptions
related to validation will be gathered and raised as an :class:`ExceptionGroup`.
Nr=   unrecognized field: z  introduced in metadata version r   zinvalid metadata)copyr   r=   r   indexr3   r   r   r   r   r   rj   r   r   r   )clsra   r   insr   r=   metadata_agemetadata_version_excfields_to_checkkeyfield_metadata_versionr   	field_ager5   s                 r   from_rawMetadata.from_raw  s    e99;*,J(#&#7#7 7==>NO (1OCO 233O&+'%58\\#5F5L5L2
 %=$B$B2%	 %|3$9#$>E"1 %#(')I#9":&AQ@R!T#C
 '--c2$C%/ '6 $%7DD
Q # (!!"67#' ("  ( %"1#9McW7U"VC&--c2$%" ' +%%c**+sZ   !D  0E8D*A	EE 
D'
D""D'*+EEEE
F&E>>Fc               :   [        U5      u  p4U(       aO  / nU H4  nU[        ;   a  U< S3nOSU< 3nUR                  [        Xg5      5        M6     U(       a  [	        SU5      e U R                  X2S9$ ! [         a  n[	        SUR                  5      SeSnAff = f)zParse metadata from email headers.

If *validate* is true, the metadata will be validated. All exceptions
related to validation will be gathered and raised as an :class:`ExceptionGroup`.
z has invalid datar%  r   r   zinvalid or unparsed metadataN)r   r   r   r3   r   r0  r   )	r(  ra   r   r   r   r   unparsed_keyr   	exc_groups	            r   
from_emailMetadata.from_email  s     $D)*,J (#88!- 00ABG 4\4DEG!!/,"HI !) $Z<<	<<<77 	 .	0D0D	s   %A4 4
B>BBz_Validator[_MetadataVersion]r=   z_Validator[str]r>   z"_Validator[version_module.Version]r   r   r   z_Validator[list[str] | None]rY   r@   r   rH   z_Validator[str | None]rA   rB   r   rW   rC   rD   rI   rE   rF   r   rN   rO   rG   r   z._Validator[NormalizedLicenseExpression | None]rZ   r[   rJ   z1_Validator[list[requirements.Requirement] | None]rP   z*_Validator[specifiers.SpecifierSet | None]rS   rT   z!_Validator[dict[str, str] | None]rV   z-_Validator[list[utils.NormalizedName] | None]rX   rQ   rR   rK   rL   rM   r1   N)ra   r;   r   boolr)   r"  )ra   bytes | strr   r7  r)   r"  ))r&   r+   r,   r-   r.   r/   classmethodr0  r5  r   r=   r>   r   rY   r@   rH   rA   rB   rW   rC   rD   rI   rE   rF   rN   rO   rG   rZ   r[   rJ   rP   rS   rT   rV   rX   rQ   rR   rK   rL   rM   r0   r1   r!   r   r"  r"    s    =A 6 6p ?C  6 6@\2A< 'LD/( 3=,G/>:,6-G) D.8lI+:08B8O5O:&0lG#2R*4,K'637A7N4NL-7\H*90(2I%41+5E+BL(B4%/\F"1.+5<L(74)3%)@J&@2/9/F,F8&0lG#2/ISJF  ;2<52IM/I40:0GK-G2GQHMD  6BLCO?  8 7Au6M3M96@u6ML3M3 EOENA  72<52IM/I53=E3JN0J6-7e-DH*D#-7e-DH*D#.8u.EI+E$r!   r"  )ra   r   r)   r?   )ra   r?   r)   rU   )r|   zemail.message.Messager}   r8  r)   r   )ra   r8  r)   z(tuple[RawMetadata, dict[str, list[str]]])3
__future__r   email.feedparserr   email.headeremail.messageemail.parseremail.policyr  systypingr   r   r   r   r   r	   re   r   r   r   r   r   r   r   TypeVarr   version_infor   	Exceptionr{   r3   r;   r   r   _DICT_FIELDSrc   rq   r   r   itemsr   r   object
_NOT_FOUNDr   r   r   r   r   r"  )r   r   s   00r   <module>rI     s1   "       
   8 7 ' 1
NN3 w#NW W$"j "E)5 EP$" 
0
%PH>hN - =	
  : N y  
 y . O , * *  F!" #$ '!$&$,(/= @ 7L6Q6Q6ST6S
6ST m,` X
 M JK CDT Tno% o%i Us   E