+
    i2                       R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
Ht ^ RI	Ht ^ RIHt ^ RIHtHtHtHt ^ RIHt ]P,                  ! ]4      t]],           t ^ RIt]],          t ^ RIt]],          tR
 R ltR R ltR R lt R R lt!R R lt"R R lt#R R lt$R"R R llt%R R lt&R R lt'R R lt(R#R  R! llt)R#   ] d    ]P9                  R4        Lvi ; i  ] d    ]P9                  R	4        Li ; i)$zUtilities related archives.)annotationsN)Iterable)ZipInfo)InstallationError)BZ2_EXTENSIONSTAR_EXTENSIONSXZ_EXTENSIONSZIP_EXTENSIONS)
ensure_dirzbz2 module is not availablezlzma module is not availablec                   V ^8  d   QhRR/#    returnint )formats   "c/Users/ahmad/.openclaw/workspace/venv/lib/python3.14/site-packages/pip/_internal/utils/unpacking.py__annotate__r   -   s      s     c                 ^    \         P                  ! ^ 4      p \         P                  ! V 4       V # )zBGet the current umask which involves having to set it temporarily.)osumask)masks    r   current_umaskr   -   s    88A;DHHTNKr   c                    V ^8  d   QhRRRR/# )r   pathstrr   z	list[str]r   )r   s   "r   r   r   4   s     	 	C 	I 	r   c                   V P                  R 4      P                  R4      p R V 9   dF   RV 9   d&   V P                  R 4      V P                  R4      8  g   RV 9  d   V P                  R ^4      # RV 9   d   V P                  R^4      # V R.# )/\ )lstripfindsplitr   s   &r   split_leading_dirr%   4   sz    ;;s""4(D
d{	$))C.499T?:t4?Ozz#q!!	zz$""bzr   c                    V ^8  d   QhRRRR/# )r   pathszIterable[str]r   boolr   )r   s   "r   r   r   @   s      = T r   c                n    RpV  F,  p\        V4      w  r4V'       g    R# Vf   TpK#  W18w  g   K+   R# 	  R# )zuReturns true if all the paths have the same leading path name
(i.e., everything is in one subdirectory in an archive)NFT)r%   )r'   common_prefixr   prefixrests   &    r   has_leading_dirr-   @   s>     M(.""M$  r   c               $    V ^8  d   QhRRRRRR/# )r   	directoryr   targetr   r(   r   )r   s   "r   r   r   O   s!     # #3 # # #r   c                    \         P                  P                  V 4      p\         P                  P                  V4      p\         P                  P                  W#.4      pWB8H  # )zD
Return true if the absolute path of target is within the directory
)r   r   abspath
commonpath)r/   r0   abs_directory
abs_targetr+   s   &&   r   is_within_directoryr6   O   sH     GGOOI.M(JWW ;<F""r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   Z   s     , ,3 ,r   c                 4    R \        4       ( ,          ^I,          # )i  )r   r   r   r   !_get_default_mode_plus_executabler9   Z   s    MO##e++r   c                    V ^8  d   QhRRRR/# )r   r   r   r   Noner   )r   s   "r   r   r   ^   s     8 8S 8T 8r   c                D    \         P                  ! V \        4       4       R# )zl
Make file present at path have execute for user/group/world
(chmod +x) is no-op on windows per python docs
N)r   chmodr9   r$   s   &r   2set_extracted_file_to_default_mode_plus_executabler>   ^   s    
 HHT467r   c                    V ^8  d   QhRRRR/# )r   infor   r   r(   r   )r   s   "r   r   r   f   s     > > >T >r   c                    V P                   ^,	          p\        T;'       d(    \        P                  ! V4      ;'       d
    V^I,          4      # )   )external_attrr(   statS_ISREG)r@   modes   & r   zip_item_is_executablerG   f   s<    #D <<d+<<u==r   c               (    V ^8  d   QhRRRRRRRR/# )r   filenamer   locationflattenr(   r   r;   r   )r   s   "r   r   r   m   s(     + + + +d +d +r   c                    \        V4       \        V R4      p \        P                  ! VRR7      p\	        VP                  4       4      ;'       d    TpVP                  4        EF;  pVP                  pTpV'       d   \        V4      ^,          p\        P                  P                  W4      p\        P                  P                  V4      p	\        W4      '       g   Rp
\        V
P                  WV4      4      hVP!                  R4      '       d   \        V4       K  \        V	4       VP                  V4      p \        VR4      ;_uu_ 4       p\"        P$                  ! W4       RRR4       VP'                  4        \)        V4      '       d   \+        V4       EK;  EK>  	  VP'                  4        R#   + '       g   i     LV; i  TP'                  4        \)        T4      '       d   \+        T4       i i ; i  TP'                  4        i ; i)a  
Unzip the file (with path `filename`) to the destination `location`.  All
files are written based on system defaults and umask (i.e. permissions are
not preserved), except that regular file members with any execute
permissions (user, group, or world) have "chmod +x" applied after being
written. Note that for windows, any execute changes using os.chmod are
no-ops per the python docs.
rbT)
allowZip64zQThe zip file ({}) has a file ({}) trying to install outside target directory ({})wbN)r   r   )r
   openzipfileZipFiler-   namelistinfolistrI   r%   r   r   joindirnamer6   r   r   endswithshutilcopyfileobjcloserG   r>   )rI   rJ   rK   zipfpzipleadingr@   namefndirmessagefpdestfps   &&&          r   
unzip_filerd   m   s~    x4 E ooe5!#,,.1==gLLND==DB&t,Q/h+B''//"%C&x444  (xX(NOO{{;''23 XXd^Ob$6**26 ( HHJ-d33J2N 45 #: 	 ( HHJ-d33J2N 4 	s<   D#G; =G	F6(G	04G; 6GG		/G88G; ;Hc               $    V ^8  d   QhRRRRRR/# )r   rI   r   rJ   r   r;   r   )r   s   "r   r   r      s&     ] ] ] ] ]r   c                |  a aaa \        S4       S P                  4       P                  R4      '       g&   S P                  4       P                  R4      '       d   RpMS P                  4       P                  \        4      '       d   RpMlS P                  4       P                  \        4      '       d   RpM@S P                  4       P                  R4      '       d   RpM\
        P                  RS 4       R	p\        P                  ! S VR
R7      p \        VP                  4        Uu. uF  qDP                  NK  	  up4      p \        P                  o\        4       oV'       dr   VP                  4        F]  p\        VP                  4      w  rgWtn        VP                  4       '       g   K8  \        VP                   4      w  rW8X  g   KW  Wn        K_  	  R VVV V3R llp
VP#                  SV
R7       VP)                  4        R# u upi   \$         d    \'        S SY54        L1i ; i  TP)                  4        i ; i)a  
Untar the file (with path `filename`) to the destination `location`.
All files are written based on system defaults and umask (i.e. permissions
are not preserved), except that regular file members with any execute
permissions (user, group, or world) have "chmod +x" applied on top of the
default.  Note that for windows, any execute changes using os.chmod are
no-ops per the python docs.
z.gzz.tgzzr:gzzr:bz2zr:xzz.tarrz-Cannot determine compression type for file %szr:*zutf-8)encodingc               $    V ^8  d   QhRRRRRR/# )r   membertarfile.TarInfor   r   r   r   )r   s   "r   r    untar_file.<locals>.__annotate__   s!     % %? %# %/ %r   c                  < V P                   p  S! V S4      p T P                  4       '       d   T^I,          '       d
   ST n         T # RT n         T #   \        P                   d8    \        P                  R ,          R9   d   \        P
                  ! T S4      p  Lh i ; i  \        P                   d#   pRp\        TP                  ST4      4      hRp?ii ; i):N   Nz%Invalid member in the tar file {}: {}N>   rn   	      rn   
      rn         )
rF   tarfileLinkOutsideDestinationErrorsysversion_info
tar_filterTarErrorr   r   isfile)	rj   r   	orig_modeexcra   data_filterdefault_mode_plus_executablerI   rJ   s	   &&   r   
pip_filteruntar_file.<locals>.pip_filter   s    "KK	"!,VX!>2 ==??y5'8'8">FK  #'FKA #>> "++B/ 4  &-%7%7%IF!" '' 	EG ,$ 		s0   	A ABB BB C4CC)filterN)r
   lowerrW   r   r   loggerwarningrx   rP   r-   
getmembersr^   r   r9   r%   islnklinkname
extractallAttributeError_untar_without_filterrZ   )rI   rJ   rF   tarrj   r]   	name_lead	name_restlnk_leadlnk_restr   r   r   s   ff         @@r   
untar_filer      s    x~~  ''8>>+;+D+DV+L+L			"	">	2	2			"	"=	1	1			"	"6	*	*;	
 
,,x
8CC!S^^=M"N=M6;;=M"NO
:	8!--K ,M+N( "nn.F+<V[[+I(I"+K||~~->v-O*#0.6O /% %N NN8JN7 			E #O  	D!(HcC	Dv 			sO   H) &H:H) H AH) ,H) )H) H) H&#H) %H&&H) )H;c               $    V ^8  d   QhRRRRRR/# )r   r   tarfile.TarFiletarinfork   r   r(   r   )r   s   "r   r   r      s"      / O PT r   c                R   \         P                  P                  \         P                  P                  VP                  4      VP
                  4      p\         P                  P                  V4      pVP                  RR4      p V P                  V4       R#   \         d     R# i ; i)zGCheck if the file pointed to by the symbolic link is in the tar archiver   r   TF)
r   r   rU   rV   r^   r   normpathreplace	getmemberKeyError)r   r   r   s   && r   is_symlink_target_in_tarr      sy    ww||BGGOOGLL97;K;KLHww)Hc*Hh s   B B&%B&c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   rI   r   rJ   r   r   r]   r(   r   r;   r   )r   s   "r   r   r   	  sH     BI BIBIBI 
BI 	BI
 
BIr   c                   VP                  4        EF  pVP                  pV'       d   \        V4      ^,          p\        P                  P                  W4      p\        W4      '       g   Rp\        VP                  WV4      4      hVP                  4       '       d   \        V4       K  VP                  4       '       dX   \        W$4      '       g2   Rp\        VP                  WP                  VP                  4      4      h VP                  WF4       EK   VP%                  V4      p	\        \        P                  P+                  T4      4       T	f   Q h\-        TR4      ;_uu_ 4       p
\.        P0                  ! Y4       RRR4       T	P3                  4        TP5                  YF4       TP6                  ^I,          '       g   EK  \9        T4       EK  	  R#   \         d/   p\         P#                  RT TP                  T4        Rp?EK  Rp?ii ; i  \&        \(        3 d/   p\         P#                  RT TP                  T4        Rp?EK?  Rp?ii ; i  + '       g   i     L; i)z/Fallback for Python without tarfile.data_filterzQThe tar file ({}) has a file ({}) trying to install outside target directory ({})z/In the tar file %s the member %s is invalid: %sNrO   )r   r^   r%   r   r   rU   r6   r   r   isdirr
   issymr   r   _extract_member	Exceptionr   r   extractfiler   r   rV   rP   rX   rY   rZ   utimerF   r>   )rI   rJ   r   r]   rj   r_   r   ra   r   rb   rc   s   &&&&       r   r   r   	  s    .."[["2&q)Bww||H)"8220  $GNN88$LMM<<>>t\\^^+C884  (NN8[[&//J ##F1__V, rwwt,->!>dD!!V""2. "HHJIIf#{{U""B4Hq #0  	 EKK	 	 n- 	 EKK	 	 "!s<   GH,IH%"HHI'"III(c               (    V ^8  d   QhRRRRRRRR/# )r   rI   r   rJ   content_typez
str | Noner   r;   r   )r   s   "r   r   r   N  s6     R RRR R 
	Rr   c                H   \         P                  P                  V 4      p VR 8X  gF   V P                  4       P	                  \
        4      '       g   \        P                  ! V 4      '       d$   \        WV P	                  R4      '       * R7       R# VR8X  g\   \        P                  ! V 4      '       g@   V P                  4       P	                  \        \        ,           \        ,           4      '       d   \        W4       R# \        P!                  RV VV4       \#        RV 24      h)zapplication/zipz.whl)rK   zapplication/x-gzipzZCannot unpack file %s (downloaded from %s, content-type: %s); cannot detect archive formatz#Cannot determine archive format of N)r   r   realpathr   rW   r	   rQ   
is_zipfilerd   rx   
is_tarfiler   r   r   r   r   criticalr   )rI   rJ   r   s   &&&r   unpack_filer   N  s    
 ww)H))>>$$^44h''883D3DV3L/LM,,h''>>$$^n%D}%TUU8& 	+	
  "EhZ PQQr   )T)N)*__doc__
__future__r   loggingr   rX   rD   rz   rx   rQ   collections.abcr   r   pip._internal.exceptionsr   pip._internal.utils.filetypesr   r   r   r	   pip._internal.utils.miscr
   	getLogger__name__r   SUPPORTED_EXTENSIONSbz2ImportErrordebuglzmar   r%   r-   r6   r9   r>   rG   rd   r   r   r   r   r   r   r   <module>r      s    ! "  	   
   $  6  0			8	$ &6 0N*1M)
	#,8>+\]@BIJR R[	  0
LL./0  1
LL/01s$   %C 3C, C)(C),DD