
    m&phZ1                       S SK Jr  S SKrS SKrS SKJrJr  S SKJ	r	  S SK
Jr  S SKJr  S SKJr  S SKJr  S S	KJr  S S
KJr  S SKJr  S SKJr  SSKJr  SSKJr  SSKJr  SSK J!r!  \RD                  " S\RF                  5      r$\RD                  " S\RF                  5      r%\RD                  " S5      r&\RD                  " S5      r'\" SSS S9r(S\ 3r)S'S jr*S(S jr+S)S jr, " S S\S9r- " S  S!\-5      r. " S" S#\.5      r/ " S$ S%\-5      r0S*S& jr1g)+    )annotationsN)ABCMetaabstractmethod)defaultdict)Iterator)Message)Parser)EmailPolicy)iglob)Path)dedent)ZipFile   )__version__)generate_requirements)	parse_tag)	WheelFilez]
    (?P<name>.+?)-(?P<ver>.+?)
    (-(?P<pyver>py\d\.\d+)
     (-(?P<arch>.+?))?
    )?.egg$zL
    ^(?P<name>.+?)-(?P<ver>.+?)
    (-(?P<pyver>py\d\.\d+)
    )?.egg-info/z>\.(?P<platform>win32|win-amd64)(?:-(?P<pyver>py\d\.\d))?\.exe$z8\.(?P<abi>[a-z0-9]+)-(?P<platform>win32|win_amd64)\.pyd$TF)utf8mangle_from_max_line_lengthzwheel c                \   S n[        [        5      nU R                  5        Hb  nUR                  5       nU(       d  M  UR	                  S5      (       a  UR                  S5      (       a  USS nMO  X2   R                  U5        Md     [        U5       H  u  pVUR                  XV5        M     g )N[]   )	r   list
splitlinesstrip
startswithendswithappendr   
add_header)requiresmetadataextrarequirementslinekeyvalues          D/var/www/html/venv/lib/python3.13/site-packages/wheel/cli/convert.pyconvert_requiresr+   0   s    E0;D0AL##%zz|??3DMM#$6$62JE""4( & ,L9
C' :    c                $   [        5       R                  U 5      nUR                  5        H  u  p4UR                  5       nUS:X  a  M  US:X  ac  UR	                  5       nSR                  US   R                  5       [        SR                  USS  5      5      S45      nUR                  U5        M  US:X  a  UR                  SSU 35        M  US	:X  a  UR                  SS
U 35        M  UR                  X45        M     UR                  SS5        g )NUNKNOWNdescription
r   r   z	home-pagezProject-URLz
Homepage, zdownload-urlz
Download, zMetadata-Versionz2.4)r	   parsestritemslowerr   joinlstripr   set_payloadr"   replace_header)pkginfor$   parsed_messager(   r)   	key_lowerdescription_liness          r*   convert_pkg_infor<   B   s   X&&w/N$**,
IIK	I% % 0 0 2II%a(//1499%6qr%:;<E   '+%E7/CD.(E7/CD+) -, .6r,   c                n    [         R                  " SSU 5      R                  5       R                  SS5      $ )Nz[-_.]+-_)resubr3   replace)names    r*   	normalizerD   ]   s+    66)S$'--/77SAAr,   c                      \ rS rSr% S\S'   S\S'   SrS\S'   SrS\S'   S	rS\S
'   S\S'   \SS j5       r	\
SS j5       rSrg)ConvertSourcea   strrC   versionzpy2.py3pyvernoneabianyplatformr   r$   c                :    U R                    SU R                   S3$ )Nr>   
.dist-inforC   rI   selfs    r*   dist_info_dirConvertSource.dist_info_diri   s    ))Adll^:66r,   c                    g N rR   s    r*   generate_contentsConvertSource.generate_contentsm   s    r,   rX   N)returnrH   r[   zIterator[tuple[str, bytes]])__name__
__module____qualname____firstlineno____annotations__rJ   rL   rN   propertyrT   r   rY   __static_attributes__rX   r,   r*   rF   rF   a   sV    
ILE3CHc7 7  r,   rF   )	metaclassc                  (    \ rS rSrSS jrSS jrSrg)EggFileSourcer   c                   [         R                  UR                  5      =n(       d  [        SUR                   35      eXl        [        UR                  S5      5      U l        UR                  S5      U l        UR                  S5      =n(       a`  UR                  SS5      U l	        UR                  S5      =n(       a1  U R                  R                  SS	5      U l
        [        U5      U l        [        5       U l        g )
NzInvalid egg file name: rC   verrJ   . archpycp)egg_filename_rematchrC   
ValueErrorpathrD   grouprI   rB   rJ   rL   rN   r   r$   )rS   rr   rp   rJ   rl   s        r*   __init__EggFileSource.__init__s   s    (..tyy9996tyykBCC 	ekk&12	{{5)KK((5(sB/DJ{{6**t*::--dD9 )$	r,   c              #  t  #    [        U R                  S5       n[        UR                  5       5       H  nUR	                  S5      (       a  M  UR                  S5      (       a  US:X  a6  UR                  U5      R                  S5      n[        X0R                  5        OdUS:X  a6  UR                  U5      R                  S5      n[        X@R                  5        O(US:X  a"  U R                   S3UR                  U5      4v   M  X!R                  U5      4v   M     S S S 5        g ! , (       d  f       g = f7f)	Nr/z	EGG-INFO/zEGG-INFO/requires.txtutf-8zEGG-INFO/PKG-INFOzEGG-INFO/entry_points.txt/entry_points.txt)r   rr   sortednamelistr    r   readdecoder+   r$   r<   rT   )rS   zip_filefilenamer#   r8   s        r*   rY   EggFileSource.generate_contents   s    TYY$"8#4#4#67$$S)) &&{33#::#+==#:#A#A'#J(==A!%88"*--"9"@"@"I(--@!%@@#1122CD$MM(3 
  h 777/ 8 %$$s   D8DD'	D8'
D51D8rL   r$   rC   rr   rN   rJ   rI   Nrr   r   r\   )r]   r^   r_   r`   rt   rY   rc   rX   r,   r*   rf   rf   r   s    " 8r,   rf   c                      \ rS rSrSS jrSrg)EggDirectorySource   c              #  :  #    [         R                  " U R                  5       GHr  u  pn[        U5       GH[  n[	        X5      nUR
                  R                  S:X  a  UR                  S:X  a'  UR                  S5      n[        X`R                  5        OUR                  S:X  a  UR                  S5      n[        XpR                  5        U R                  R                  S5      =n(       a  [        U5      U l        U R                  R                  S5      =n	(       a  Xl        O1UR                  S:X  a!  U R                   S3UR                  5       4v   GM%  [!        UR#                  U R                  5      5      UR                  5       4v   GM^     GMu     g 7f)	NzEGG-INFOrequires.txtry   PKG-INFONameVersionentry_points.txtrz   )oswalkrr   r{   r   parentrC   	read_textr+   r$   r<   getrD   rI   rT   
read_bytesrH   relative_to)
rS   dirpathr?   	filenamesr   rr   r#   r8   rC   rI   s
             r*   rY   $EggDirectorySource.generate_contents   s=    %'WWTYY%7!G	"9-G.;;##z1yyN2#'>>'#:(==Aj0"&.."9(--@#'==#4#4V#<<4<(1$DI&*mm&7&7	&BB7B+2L&88#1122CD OO- 
  $**499568III/ . &8s   FFrQ   Nr\   )r]   r^   r_   r`   rY   rc   rX   r,   r*   r   r      s    Jr,   r   c                  ,    \ rS rSrSrSS jrSS jrSrg)	WininstFileSource   a  
Handles distributions created with ``bdist_wininst``.

The egginfo filename has the format::

    name-ver(-pyver)(-arch).egg-info

The installer filename has the format::

    name-ver.arch(-pyver).exe

Some things to note:

1. The installer filename is not definitive. An installer can be renamed
   and work perfectly well as an installer. So more reliable data should
   be used whenever possible.
2. The egg-info data should be preferred for the name and version, because
   these come straight from the distutils metadata, and are mandatory.
3. The pyver from the egg-info data should be ignored, as it is
   constructed from the version of Python used to build the installer,
   which is irrelevant - the installer filename is correct here (even to
   the point that when it's not there, any version is implied).
4. The architecture must be taken from the installer filename, as it is
   not included in the egg-info data.
5. Architecture-neutral installers still have an architecture because the
   installer format itself (being executable) is architecture-specific. We
   should therefore ignore the architecture if the content is pure-python.
c                   Xl         [        5       U l        [        R	                  UR
                  5      =n(       aN  [        UR                  S5      5      U l        UR                  S5      =n(       a  UR                  SS5      U l
        S=pE[        U R                   5       nUR                  5        GH  nUR                  SS5      u  pU(       d  [        R                  U5      =n(       ag  Sn[        UR                  S	5      5      U l        UR                  S
5      U l        UR                  S5      =n(       a  UR                  SS5      U l
        OQU(       dJ  ["        R	                  U5      =n(       a.  SnUR                  S5      U l        UR                  S5      U l        U(       d  M  U(       d  GM    O   S S S 5        g ! , (       d  f       g = f)NrN   rJ   rj   rk   Frx   r   TrC   ri   rL   )rr   r   r$   
wininst_researchrC   rD   rs   rN   rB   rJ   r   r|   splitegg_info_rerp   rI   pyd_rerL   )	rS   rr   rp   rJ   egg_info_found	pyd_foundr   r   prefixs	            r*   rt   WininstFileSource.__init__   sa   		 %%dii0050%ekk*&=>DMG,,u,"]]33
 &+*TYY8$--/#+>>#q#9 %K4E4Eh4O+O5+O%)N )%++f*= >DI#(;;u#5DL %G 44u4%*]]3%;
"x1H(H(H $I${{51DH$)KK
$;DM!>ii 0  s   "D	G/G9G
Gc              #  H  #    U R                    SU R                   S3nU R                    SU R                   S3n[        U R                  S5       n[	        UR                  5       5       GH  nUR                  S5      (       a  M  UR                  SS5      u  pV[        R                  U5      (       a  UR                  SS5      S   nUS:X  a6  UR                  U5      R                  S	5      n[        XR                  5        OZUS
:X  a6  UR                  U5      R                  S	5      n	[        XR                  5        OUS:X  a  U S3UR                  U5      4v   M  US:X  a  U SU 3nXcR                  U5      4v   GM     S S S 5        g ! , (       d  f       g = f7f)Nr>   rP   z.datarw   rx   r   r   r   ry   r   r   rz   SCRIPTSz	/scripts/)rC   rI   r   rr   r{   r|   r    r   r   r   rsplitr}   r~   r+   r$   r<   )
rS   rT   data_dirr   r   r   target_filenamebasenamer#   r8   s
             r*   rY   #WininstFileSource.generate_contents   ss    99+Qt||nJ?ii[$,,u5TYY$"8#4#4#67$$S)) +3..a*@'%%o66.55c1=bAH>1#+==#:#A#A'#J(==A!Z/"*--"9"@"@"I(--@!%77,o->?$MM(3 
 y()1
)O;L&MO &}}X'>>>7 8 %$$s   AF"D7F	F"
FF"r   Nr   r\   )r]   r^   r_   r`   __doc__rt   rY   rc   rX   r,   r*   r   r      s    :<?r,   r   c                   U  GHq  n[        U5       GH]  n[        U5      nUR                  S:X  a-  UR                  5       (       a  [	        U5      nO[        U5      nO[        U5      nU(       a  [        U S3SSS9  [        U5      UR                   SUR                   SUR                   SUR                   SUR                   S3
-  n[        US5       nUR                  5        H  u  pUR                  X5        M     UR                  UR                    S	3UR"                  R%                  [&        S
9R)                  S5      5        [+        5       nUR-                  SS5        UR-                  S[.        5        UR-                  S[1        UR                  S:H  5      R3                  5       5        [5        UR                   SUR                   SUR                   35      n[7        US S9 H  nUR-                  S[1        U5      5        M      UR                  UR                    S3UR%                  [&        S
9R)                  S5      5        S S S 5        U(       d  GMR  [        S5        GM`     GMt     g ! , (       d  f       N.= f)Nz.eggz...Trk   )flushendr>   z.whlwz	/METADATA)policyry   zWheel-Versionz1.0	GeneratorzRoot-Is-PurelibrM   c                    U R                   $ rW   )interpreter)tags    r*   <lambda>convert.<locals>.<lambda>A  s    r,   )r(   Tagz/WHEELOK)r   r   suffixis_dirr   rf   r   printrC   rI   rJ   rL   rN   r   rY   writestrrT   r$   	as_stringserialization_policyencoder   r"   	GENERATORrH   r3   r   r{   )filesdest_dirverbosepatarchiverr   source	dest_path	wheelfilename_or_zinfocontentswheel_messagetagsr   s                 r*   convertr     s0   SzG=D{{f$;;==,>t,DF*40F*40	oTr:X;;-q 0&,,qFOO$D*I 9c*i/5/G/G/I+M&&}? 0J ""++,I6OO--5I-JQQ !(	((%@((i@((%s6??e+C'D'J'J'L !FLL>6::,a?P!QR!$,GHC!,,UCH= I ""++,F3!++3G+HOO/ +< wda " $ +*s   E9I::
J)r#   rH   r$   r   r[   None)r8   rH   r$   r   )rC   rH   r[   rH   )r   z	list[str]r   rH   r   boolr[   r   )2
__future__r   os.pathr   r@   abcr   r   collectionsr   collections.abcr   email.messager   email.parserr	   email.policyr
   globr   pathlibr   textwrapr   zipfiler   rk   r   r$   r   vendored.packaging.tagsr   r   r   compileVERBOSEro   r   r   r   r   r   r+   r<   rD   rF   rf   r   r   r   rX   r,   r*   <module>r      s   "  	 ' # $ !  $      , / !**
 JJ jj JJ ZZE
 
O	P"	 
 [M"	($76Bg "*8M *8ZJ J:[? [?|2r,   