ó
    F\hª!  ã                   ó4  • 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QrSr\R                  R                  S5      (       a  SrO\R                  " 5       r " S S\5      r\ R                  S 5       rS	 rSS
 jr  SS jrS rSS jr\S:X  a  \" 5         gg)é    N)ÚZipAppErrorÚcreate_archiveÚget_interpreterz8# -*- coding: utf-8 -*-
import {module}
{module}.{fn}()
Úwinúutf-8c                   ó   • \ rS rSrSrg)r   é!   © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__static_attributes__r
   ó    Ú/usr/lib/python3.13/zipapp.pyr   r   !   s   † Úr   r   c              #   ó²   #   • [        U [        [        R                  45      (       a  [	        X5       nUv •  S S S 5        g U v •  g ! , (       d  f       g = f7f©N)Ú
isinstanceÚstrÚosÚPathLikeÚopen)ÚarchiveÚmodeÚfs      r   Ú_maybe_openr   %   sA   é € ä�'œC¤§¡Ð-×.Ñ.Ü�'Ô  AØŠG÷ !Ð ð ‹÷ !Õ üs   ‚1A³A¸AÁ
AÁAc                 ól   • U(       a-  SUR                  [        5      -   S-   nU R                  U5        gg)zWrite a shebang line.ó   #!ó   
N)ÚencodeÚshebang_encodingÚwrite)r   ÚinterpreterÚshebangs      r   Ú_write_file_prefixr%   .   s1   € æØ˜+×,Ñ,Ô-=Ó>Ñ>ÀÑFˆØ	�‰�Õð r   c                 ó  • [        U S5       nUR                  S5      nUS:X  a  SnUR                  5         [        US5       n[        XR5        UR	                  U5        [
        R                  " X55        SSS5        SSS5        U(       a]  [        U[        5      (       aG  [        R                  " U[        R                  " U5      R                  [        R                  -  5        ggg! , (       d  f       N{= f! , (       d  f       N„= f)z8Copy an application archive, modifying the shebang line.Úrbé   r   r   ÚwbN)r   ÚreadÚreadliner%   r"   ÚshutilÚcopyfileobjr   r   r   ÚchmodÚstatÚst_modeÚS_IEXEC)r   Únew_archiver#   ÚsrcÚfirst_2Údsts         r   Ú_copy_archiver6   5   s½   € ä	�W˜dÔ	# sð —(‘(˜1“+ˆØ�eÓàˆGØ�L‰LŒNä˜ dÔ+¨sÜ˜sÔ0ð �I‰I�gÔÜ×Ò˜sÔ(÷ ,÷ 
$ö" ”z +¬s×3Ñ3Ü
�Š�œbŸgšg kÓ2×:Ñ:¼T¿\¹\ÑIÕJð 4€{÷ ,Õ+ú÷ 
$Õ	#ús#   �6C<Á3C+Á6C<Ã+
C9	Ã5C<Ã<
D
c                 ó:  • Sn[        U S5      (       a  [        U S5      (       a  SnO-[        R                  " U 5      n U R                  5       (       a  SnU(       a  [	        XU5        gU R                  5       (       d  [        S5      eU S-  R                  5       nU(       a  U(       a  [        S5      eU(       d  U(       d  [        S	5      eSnU(       a‹  UR                  S
5      u  pšn[        S U	R                  S5       5       5      n[        S UR                  S5       5       5      nU
S
:X  a  U(       a  U(       d  [        SU-   5      e[        R                  X›S9nUc  U R                  S5      nO'[        US5      (       d  [        R                  " U5      n[        U R                  S5      5      nX;   a  [        SU S35      e[        US5       n[!        Xò5        U(       a  ["        R$                  O["        R&                  n["        R(                  " USUS9 nU HF  nUR+                  U 5      nUb  U" U5      (       d  M&  UR-                  UUR/                  5       5        MH     U(       a!  UR1                  SUR3                  S5      5        SSS5        SSS5        U(       aM  [        US5      (       d;  UR5                  UR7                  5       R8                  [6        R:                  -  5        ggg! , (       d  f       Nk= f! , (       d  f       Nt= f)a*  Create an application archive from SOURCE.

The SOURCE can be the name of a directory, or a filename or a file-like
object referring to an existing archive.

The content of SOURCE is packed into an application archive in TARGET,
which can be a filename or a file-like object.  If SOURCE is a directory,
TARGET can be omitted and will default to the name of SOURCE with .pyz
appended.

The created application archive will have a shebang line specifying
that it should run with INTERPRETER (there will be no shebang line if
INTERPRETER is None), and a __main__.py which runs MAIN (if MAIN is
not specified, an existing __main__.py will be used).  It is an error
to specify MAIN for anything other than a directory source with no
__main__.py, and it is an error to omit MAIN if the directory has no
__main__.py.
Fr*   r+   TNzSource does not existz__main__.pyz8Cannot specify entry point if the source has __main__.pyzArchive has no entry pointÚ:c              3   ó@   #   • U  H  oR                  5       v •  M     g 7fr   ©Úisidentifier©Ú.0Úparts     r   Ú	<genexpr>Ú!create_archive.<locals>.<genexpr>{   s   é € ÐD²^¨T×&Ñ&×(Ð(²^ùó   ‚Ú.c              3   ó@   #   • U  H  oR                  5       v •  M     g 7fr   r:   r<   s     r   r?   r@   |   s   é € ÐB²M¨D×%Ñ%×'Ð'²MùrA   zInvalid entry point: )ÚmoduleÚfnz.pyzr"   Ú*zThe target archive z$ overwrites one of the source files.r)   Úw)Úcompressionr   )ÚhasattrÚpathlibÚPathÚis_filer6   Úexistsr   Ú	partitionÚallÚsplitÚMAIN_TEMPLATEÚformatÚwith_suffixÚsortedÚrglobr   r%   ÚzipfileÚZIP_DEFLATEDÚ
ZIP_STOREDÚZipFileÚrelative_tor"   Úas_posixÚwritestrr    r.   r/   r0   r1   )ÚsourceÚtargetr#   ÚmainÚfilterÚ
compressedÚsource_is_fileÚhas_mainÚmain_pyÚmodÚseprE   Úmod_okÚfn_okÚfiles_to_addÚfdrH   ÚzÚchildÚarcnames                       r   r   r   L   s}  € ð* €NÜˆv�v×Ñ¤7¨6°:×#>Ñ#>Ø‰ä—’˜fÓ%ˆØ�>‰>×ÑØ!ˆNæÜ�f kÔ2Øð �=‰=�?‰?ÜÐ1Ó2Ð2Ø˜Ñ&×/Ñ/Ó1€HÞ–ÜØFóHð 	Hæ–HÜÐ6Ó7Ð7à€GÞà—~‘~ cÓ*‰ˆ�"ÜÑD°S·Y±Y¸s´^ÓDÓDˆÜÑB°B·H±H¸S´MÓBÓBˆØ�s“
žv®%ÜÐ5¸Ñ<Ó=Ð=Ü×&Ñ&¨cÐ&Ð9ˆà�~Ø×#Ñ# FÓ+‰Ü�V˜W×%Ñ%Ü—’˜fÓ%ˆô
 ˜&Ÿ,™, sÓ+Ó,€Lð  ÓÜØ! & Ð)MÐNóPð 	Pô 
�V˜TÔ	" bÜ˜2Ô+Þ/9”w×+Ò+Ü×)Ñ)ð 	ä�_Š_˜R °+Ò>À!Û%�Ø×+Ñ+¨FÓ3�Ø‘>¡V¨G§_£_Ø—G‘G˜E 7×#3Ñ#3Ó#5Ö6ñ &ö Ø—
‘
˜=¨'¯.©.¸Ó*AÔB÷ ?÷	 
#ö œ7 6¨7×3Ñ3Ø�‰�V—[‘[“]×*Ñ*¬T¯\©\Ñ9Õ:ð 4€{÷ ?Õ>ú÷	 
#Õ	"ús,   ÇA	LÈ!%K;É
AK;ÊLË;
L		ÌLÌ
Lc                 óð   • [        U S5       nUR                  S5      S:X  a:  UR                  5       R                  5       R	                  [
        5      sS S S 5        $  S S S 5        g ! , (       d  f       g = f)Nr'   r(   r   )r   r*   r+   ÚstripÚdecoder!   )r   r   s     r   r   r   ­   sS   € Ü	�W˜dÔ	# qØ�6‰6�!‹9˜ÓØ—:‘:“<×%Ñ%Ó'×.Ñ.Ô/?Ó@÷ 
$Ñ	#Ø÷ 
$×	#Ö	#ús   �AA'Á'
A5c                 ób  • SSK nUR                  5       nUR                  SSSSS9  UR                  SSSS	S9  UR                  S
SSSS9  UR                  SSSSS9  UR                  SSSSS9  UR                  SSS9  UR                  U 5      n U R                  (       a‡  [
        R                  R                  U R                  5      (       d  [        S5      e[        U R                  5      n[        SR                  U=(       d    S5      5        [        R                  " S5        [
        R                  R                  U R                  5      (       a›  U R                  bg  [
        R                  R!                  U R                  5      (       aD  [
        R                  R#                  U R                  U R                  5      (       a  [        S5      eU R$                  (       a  [        S5      e['        U R                  U R                  U R(                  U R$                  U R*                  S9  g)zÎRun the zipapp command line interface.

The ARGS parameter lets you specify the argument list directly.
Omitting ARGS (or setting it to None) works as for argparse, using
sys.argv[1:] as the argument list.
r   Nz--outputz-ozAThe name of the output archive. Required if SOURCE is an archive.)ÚdefaultÚhelpz--pythonz-pzEThe name of the Python interpreter to use (default: no shebang line).z--mainz-mzLThe main function of the application (default: use an existing __main__.py).z
--compressz-cÚ
store_truezQCompress files with the deflate method. Files are stored uncompressed by default.)Úactionrs   z--infoFz)Display the interpreter from the archive.)rr   ru   rs   r]   z'Source directory (or existing archive).)rs   z%Can only get info for an archive filezInterpreter: {}z<none>z-In-place editing of archives is not supportedz,Cannot change the main function when copying)r#   r_   ra   )ÚargparseÚArgumentParserÚadd_argumentÚ
parse_argsÚinfor   ÚpathÚisfiler]   Ú
SystemExitr   ÚprintrR   ÚsysÚexitÚoutputrM   Úsamefiler_   r   ÚpythonÚcompress)Úargsrv   Úparserr#   s       r   r_   r_   ³   sÖ  € ó à×$Ñ$Ó&€FØ
×Ñ˜
 D°$ð5ð ñ 6ð ×Ñ˜
 D°$ð/ð ñ 0ð ×Ñ˜ $°ð;ð ñ <ð ×Ñ˜ d°<ð=ð ñ >ð ×Ñ˜¨%¸Ø<ð ñ >à
×Ñ˜Ø:ð ñ <ð ×Ñ˜TÓ"€Dð ‡y‡yÜ�w‰w�~‰~˜dŸk™k×*Ñ*ÜÐDÓEÐEÜ% d§k¡kÓ2ˆÜÐ×&Ñ& {×'>°hÓ?Ô@Ü�Š�Œä	‡w�w‡~�~�d—k‘k×"Ñ"Ø�;‰;Ñ¤2§7¡7§>¡>°$·+±+×#>Ñ#>Ü#%§7¡7×#3Ñ#3°D·K±KÀÇÁ×#MÑ#MÜÐLÓMÐMØ�9�9ÜÐKÓLÐLä�4—;‘; §¡Ø#Ÿ{™{°·±Ø"Ÿm™mó-r   Ú__main__r   )NNNNF)Ú
contextlibr   rJ   r,   r/   r   rV   Ú__all__rQ   ÚplatformÚ
startswithr!   ÚgetfilesystemencodingÚ
ValueErrorr   Úcontextmanagerr   r%   r6   r   r   r_   r   r
   r   r   Ú<module>r�      s´   ðÛ Û 	Û Û Û Û 
Û â
>€ð€ð ‡<�<×Ñ˜5×!Ñ!ØÑà×0Ò0Ó2Ðô	�*ô 	ð ×Ññó ðòôKð. @DØ+0ô^;òBAô.-ðb ˆzÓÙ…Fð r   