+
     hd4  c                   s"   ^ RI t ^ RI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.tR tR t]P"                  t R t ! R R	4      t ! R
 R4      t ! R R]]]P,                  4      t ! R R]4      tRR lt ! R R4      tR# )i    N)text_encoding)
TranslatorPathc                sD    \         P                  ! \        V 4      ^R4      # )z
Given a path with elements separated by
posixpath.sep, generate all parents of that path.

>>> list(_parents('b/d'))
['b']
>>> list(_parents('/b/d/'))
['/b']
>>> list(_parents('b/d/f/'))
['b/d', 'b']
>>> list(_parents('b'))
[]
>>> list(_parents(''))
[]
N)	itertoolsZislice	_ancestry)path   &E/usr/lib/python3.14/site-packages/setuptools/_vendor/zipp/__init__.py_parentsr      s      IdOQ55    c              #  s   "   V P                  \        P                  4      p V '       d6   V \        P                  8w  d   V x  \        P                  ! V 4      w  rK;  R# R# 5i)a  
Given a path with elements separated by
posixpath.sep, generate all elements of that path

>>> list(_ancestry('b/d'))
['b/d', 'b']
>>> list(_ancestry('/b/d/'))
['/b/d', '/b']
>>> list(_ancestry('b/d/f/'))
['b/d/f', 'b/d', 'b']
>>> list(_ancestry('b'))
['b']
>>> list(_ancestry(''))
[]
N)rstrip	posixpathsepsplit)r   Ztail   & r   r   r   %   sE       ;;y}}%D
49==(
__T*
d )$s
   'A!7A!c                sV    \         P                  ! \        V4      P                  V 4      # )zN
Return items in minuend not in subtrahend, retaining order
with O(1) lookup.
)r   ZfilterfalsesetZ__contains__)ZminuendZ
subtrahend   &&r   _differencer   ?   s!    
   Z!=!=wGGr	   c                   sH   a a ] tR t^Gt oRtV 3R ltR tV 3R ltRtVt	V ;t
# )InitializedStatez7
Mix-in to save the initialization state for pickling.
c                s@   < Wn         W n        \        SV `  ! V/ VB  R # N)_InitializedState__args_InitializedState__kwargssuper__init__)selfargskwargs	__class__s   &*,r   r   ZInitializedState.__init__L   s    $)&)r	   c                s2    V P                   V P                  3# r   )r   r   r   r   r   __getstate__ZInitializedState.__getstate__Q   s    {{DMM))r	   c                s0   < Vw  r#\         SV `  ! V/ VB  R # r   )r   r   )r   Zstater   r   r   s   &&  r   __setstate__ZInitializedState.__setstate__T   s    $)&)r	   )Z__argsZ__kwargs)__name__
__module____qualname____firstlineno____doc__r   r   r   __static_attributes____classdictcell____classcell__r   __classdict__   @@r   r   r   G   s     *
** *r	   r   c                   sF   a a ] tR t^Yt oRtV 3R lt]R 4       tRtVt	V ;t
# )SanitizedNamesz/
ZipFile mix-in to ensure names are sanitized.
c                sZ   < \        \        V P                  \        SV `  4       4      4      # r   )listmap	_sanitizer   namelistr   r      &r   r.   ZSanitizedNames.namelist^   s!    C(8(:;<<r	   c                s6   R p\         P                  ! RRV \         P                  R7      pVP                  RR4      pVP	                  R4      pRP                  \        W4      4      pV'       g   \        R4      hVRV P                  R4      ,          ,           # )aa  
Ensure a relative path with posix separators and no dot names.

Modeled after
https://github.com/python/cpython/blob/bcc1be39cb1d04ad9fc0bd1b9193d3972835a57c/Lib/zipfile/__init__.py#L1799-L1813
but provides consistent cross-platform behavior.

>>> san = SanitizedNames._sanitize
>>> san('/foo/bar')
'foo/bar'
>>> san('//foo.txt')
'foo.txt'
>>> san('foo/.././bar.txt')
'foo/bar.txt'
>>> san('foo../.bar.txt')
'foo../.bar.txt'
>>> san('\\foo\\bar.txt')
'foo/bar.txt'
>>> san('D:\\foo.txt')
'D/foo.txt'
>>> san('\\\\server\\share\\file.txt')
'server/share/file.txt'
>>> san('\\\\?\\GLOBALROOT\\Volume3')
'?/GLOBALROOT/Volume3'
>>> san('\\\\.\\PhysicalDrive1\\root')
'PhysicalDrive1/root'

Retain any trailing slash.
>>> san('abc/')
'abc/'

Raises a ValueError if the result is empty.
>>> san('../..')
Traceback (most recent call last):
...
ValueError: Empty filename
c                 s     T ;'       d    V R9  # )..>   Z.r1    )Zpartr   r   allowedZ)SanitizedNames._sanitize.<locals>.allowed   s    33D33r	   z	^([A-Z]):z\1)ZflagsZ\/zEmpty filename)	reZsubZ
IGNORECASEZreplacer   joinfilter
ValueErrorendswith)namer3   ZbareZcleanZpartsZjoineds   &     r   r-   ZSanitizedNames._sanitizea   s{    P	4
 vvk5$bmmDT3'C &01-..dmmC0000r	   r2   )r   r    r!   r"   r#   r.   staticmethodr-   r$   r%   r&   r'   r)   r   r*   r*   Y   s(     = 21 21 21r	   r*   c                   s   a a ] tR t^t oRt]R 4       tV 3R ltR tR t	V 3R lt
]R 4       t]V3R lR	 l4       tR
tVtV ;t# )CompleteDirsa  
A ZipFile subclass that ensures that implied directories
are always included in the namelist.

>>> list(CompleteDirs._implied_dirs(['foo/bar.txt', 'foo/bar/baz.txt']))
['foo/', 'foo/bar/']
>>> list(CompleteDirs._implied_dirs(['foo/bar.txt', 'foo/bar/baz.txt', 'foo/bar/']))
['foo/']
c                s    \         P                  P                  \        \        V 4      4      pR  V 4       p\        \        W 4      4      # )c              3   sN   "   T F  q\         P                  ,           x  K  	  R # 5ir   )r   r   ).0Zpr   r   	<genexpr>Z-CompleteDirs._implied_dirs.<locals>.<genexpr>   s     6gy}}$$gs   #%)r   ZchainZfrom_iterabler,   r   _deduper   )namesZparentsZas_dirs   &  r   _implied_dirsZCompleteDirs._implied_dirs   s7    ////He0DE6g6{7233r	   c                sb   < \         SV `  4       pV\        V P                  V4      4      ,           # r   )r   r.   r+   rB   )r   r@   r   s   & r   r.   ZCompleteDirs.namelist   s+     "tD..u5666r	   c                s4    \        V P                  4       4      # r   )r   r.   r   r   r   	_name_setZCompleteDirs._name_set   s    4==?##r	   c                sl    V P                  4       pVR,           pW9  ;'       d    W29   pV'       d   V# T# )z`
If the name represents a directory, return that name
as a directory (with the trailing slash).
r4   )rC   )r   r:   r@   dirnameZ	dir_matchs   &&   r   resolve_dirZCompleteDirs.resolve_dir   s9    
  *%::'*:	#w--r	   c                s   <  \         SV `  V4      #   \         dG    TP                  R4      '       d   YP	                  4       9  d   h \
        P                  ! TR7      u # i ; i)z&
Supplement getinfo for implied dirs.
r4   filename)r   getinfoZKeyErrorr9   rC   zipfileZZipInfo)r   r:   r   s   &&r   rH   ZCompleteDirs.getinfo   sS    	27?4(( 	2==%%^^5E)E??D11	2s    !A#,A#"A#c                s    \        V\        4      '       d   V# \        V\        P                  4      '       g	   V ! V4      # RVP                  9  d   \        p Wn        V# )zT
Given a source (filename or zipfile), return an
appropriate CompleteDirs subclass.
r)Z
isinstancer<   rI   ZipFilemoder   )clsZsourcer   r   makeZCompleteDirs.make   sO     fl++M&'//22v; fkk!Cr	   c                sN   < V ^8  d   QhRS[ P                  RS[ P                  /# )i   zfZreturn)rI   rK   )formatr(   s   "r   Z__annotate__ZCompleteDirs.__annotate__   s#       GOO r	   c                sv    V P                  VP                  4       4       F  pVP                  VR4       K  	  V# )zq
Given a writable zip file zf, inject directory entries for
any directories implied by the presence of children.
r	   )rB   r.   Zwritestr)rM   rO   r:   s   && r   injectZCompleteDirs.inject   s2     %%bkkm4DKKc" 5	r	   r2   )r   r    r!   r"   r#   r;   rB   r.   rC   rE   rH   ZclassmethodrN   rQ   r$   r%   r&   r'   r)   r   r<   r<      s_      4 4
7$.	2  $   r	   r<   c                   sB   a a ] tR t^t oRtV 3R ltV 3R ltRtVtV ;t	# )
FastLookupzJ
ZipFile subclass to ensure implicit
dirs exist and are resolved rapidly.
c                   < \         P                  ! \        4      ;_uu_ 4        V P                  uuR R R 4       #   + '       g   i     M; i\        ST `  4       T n        T P                  # r   )
contextlibsuppressAttributeErrorZ_FastLookup__namesr   r.   r/   r0   r   r.   ZFastLookup.namelist   sC      00<< 1000w')||	   ;A	c                rS   r   )rT   rU   rV   Z_FastLookup__lookupr   rC   r/   r0   r   rC   ZFastLookup._name_set   sC      00== 1000)+}}rW   )Z__lookupZ__names)
r   r    r!   r"   r#   r.   rC   r$   r%   r&   r'   r)   r   rR   rR      s     
 r	   rR   c                 sh    \         P                  P                  R 8H  p^V,           p\        W4      W3# )Zpypy)sysZimplementationr:   r    )encodingr   r   Zis_pypyZstack_level   &*,  r   _extract_text_encodingr[      s1      %%/Gg+K/==r	   c                   s  a  ] tR t^t o RtRtR!R ltR tR tR"RR/R llt	R	 t
]R
 4       t]R 4       t]R 4       t]R 4       t]R 4       tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t ] t!]R 4       t"R t#V t$R# )#r   u  
A :class:`importlib.resources.abc.Traversable` interface for zip files.

Implements many of the features users enjoy from
:class:`pathlib.Path`.

Consider a zip file with this structure::

    .
    ├── a.txt
    └── b
        ├── c.txt
        └── d
            └── e.txt

>>> data = io.BytesIO()
>>> zf = zipfile.ZipFile(data, 'w')
>>> zf.writestr('a.txt', 'content of a')
>>> zf.writestr('b/c.txt', 'content of c')
>>> zf.writestr('b/d/e.txt', 'content of e')
>>> zf.filename = 'mem/abcde.zip'

Path accepts the zipfile object itself or a filename

>>> path = Path(zf)

From there, several path operations are available.

Directory iteration (including the zip file itself):

>>> a, b = path.iterdir()
>>> a
Path('mem/abcde.zip', 'a.txt')
>>> b
Path('mem/abcde.zip', 'b/')

name property:

>>> b.name
'b'

join with divide operator:

>>> c = b / 'c.txt'
>>> c
Path('mem/abcde.zip', 'b/c.txt')
>>> c.name
'c.txt'

Read text:

>>> c.read_text(encoding='utf-8')
'content of c'

existence:

>>> c.exists()
True
>>> (b / 'missing.txt').exists()
False

Coercion to string:

>>> import os
>>> str(c).replace(os.sep, posixpath.sep)
'mem/abcde.zip/b/c.txt'

At the root, ``name``, ``filename``, and ``parent``
resolve to the zipfile.

>>> str(path)
'mem/abcde.zip/'
>>> path.name
'abcde.zip'
>>> path.filename == pathlib.Path('mem/abcde.zip')
True
>>> str(path.parent)
'mem'

If the zipfile has no filename, such ﻿attributes are not
valid and accessing them will raise an Exception.

>>> zf.filename = None
>>> path.name
Traceback (most recent call last):
...
TypeError: ...

>>> path.filename
Traceback (most recent call last):
...
TypeError: ...

>>> path.parent
Traceback (most recent call last):
...
TypeError: ...

# workaround python/cpython#106763
>>> pass
z>{self.__class__.__name__}({self.root.filename!r}, {self.at!r})c                sF    \         P                  V4      V n        W n        R# )a   
Construct a Path from a ZipFile or filename.

Note: When the source is an existing ZipFile object,
its type (__class__) will be mutated to a
specialized type. If the caller wishes to retain the
original type, the caller should either create a
separate ZipFile object or pass a filename.
N)rR   rN   rootat)r   r\   r]   s   &&&r   r   ZPath.__init__e  s     OOD)	r	   c                s    V P                   VP                   Jd   \        # V P                  V P                  3VP                  VP                  38H  # )z=
>>> Path(zipfile.ZipFile(io.BytesIO(), 'w')) == 'foo'
False
)r   ZNotImplementedr\   r]   )r   otherr   r   __eq__ZPath.__eq__r  s?    
 >>0!!		477#

EHH'===r	   c                sD    \        V P                  V P                  34      # r   )Zhashr\   r]   r   r   r   __hash__ZPath.__hash__{  s    TYY())r	   pwdNc               s   V P                  4       '       d   \        V 4      hV^ ,          pV P                  4       '       g   VR8X  d   \        V 4      hV P                  P                  V P                  WRR7      pRV9   d   V'       g	   V'       d   \        R4      hV# \        V/ VB w  rsp\        P                  ! Wg.VO5/ VB # )z
Open this entry as text or binary following the semantics
of ``pathlib.Path.open()`` by passing arguments through
to io.TextIOWrapper().
rJ   )ra   Zbz*encoding args invalid for binary operation)is_dirZIsADirectoryErrorexistsZFileNotFoundErrorr\   openr]   r8   r[   ioZTextIOWrapper)r   rL   ra   r   r   Zzip_modeZstreamrY   s   &&$*,   r   rd   Z	Path.open~  s     ;;==#D))7{{}}S#D));$;v !MNNM!7!H!HB4B6BBr	   c                s~    \         P                  ! V P                  ;'       g    V P                  P                  4      # r   )pathlibPurePosixPathr]   r\   rG   r   r   r   _baseZ
Path._base  s)    $$TWW%B%B		0B0BCCr	   c                6    V P                  4       P                  # r   )rh   r:   r   r   r   r:   Z	Path.name      zz|   r	   c                ri   r   )rh   suffixr   r   r   rk   ZPath.suffix  s    zz|"""r	   c                ri   r   )rh   suffixesr   r   r   rl   ZPath.suffixes  s    zz|$$$r	   c                ri   r   )rh   stemr   r   r   rm   Z	Path.stem  rj   r	   c                s    \         P                  ! V P                  P                  4      P	                  V P
                  4      # r   )rf   r   r\   rG   joinpathr]   r   r   r   rG   ZPath.filename  s*    ||DII../88AAr	   c                s    \        V/ VB w  r1pV P                  ! R V.VO5/ VB ;_uu_ 4       pVP                  4       uuRRR4       #   + '       g   i     R# ; i)rJ   N)r[   rd   read)r   r   r   rY   strmrZ   r   	read_textZPath.read_text  sK    !7!H!HYYsH6t6v66$99; 7666s   A		A	c                s    V P                  R 4      ;_uu_ 4       pVP                  4       uuRRR4       #   + '       g   i     R# ; i)ZrbN)rd   ro   )r   rp   r   r   
read_bytesZPath.read_bytes  s&    YYt__99; ___s	   5A	c                s    \         P                  ! VP                  P                  R 4      4      V P                  P                  R 4      8H  # r4   )r   rD   r]   r
   )r   r   r   r   	_is_childZPath._is_child  s2      !459LLLr	   c                s:    V P                  V P                  V4      # r   )r   r\   )r   r]   r   r   _nextZ
Path._next  s    ~~dii,,r	   c                sj    V P                   '       * ;'       g    V P                   P                  R 4      # rs   )r]   r9   r   r   r   rb   ZPath.is_dir  s%    77{33dgg..s33r	   c                s\    V P                  4       ;'       d    V P                  4       '       * # r   )rc   rb   r   r   r   is_fileZPath.is_file  s    {{}22T[[]!22r	   c                sP    V P                   V P                  P                  4       9   # r   )r]   r\   rC   r   r   r   rc   ZPath.exists  s    ww$))--///r	   c                s    V P                  4       '       g   \        R 4      h\        V P                  V P                  P                  4       4      p\        V P                  V4      # )zCan't listdir a file)rb   r8   r,   ru   r\   r.   r7   rt   )r   Zsubsr   r   iterdirZPath.iterdir  sG    {{}}3444::tyy1134dnnd++r	   c                s`    \         P                  ! V P                  4      P                  V4      # r   )rf   rg   r]   match)r   Zpath_patternr   r   rx   Z
Path.match  s"    $$TWW-33LAAr	   c                s    V P                   P                  V P                  4      pVP                  ^,	          p\        P
                  ! V4      # )z(
Return whether this path is a symlink.
)r\   rH   r]   Zexternal_attrstatZS_ISLNK)r   ZinforL   rA   r   
is_symlinkZPath.is_symlink  s;     yy  )!!R'||D!!r	   c                sj   V'       g   \        R V: 24      h\        P                  ! V P                  4      p\	        RR7      p\        P
                  ! W#P                  V4      ,           4      P                  pR V P                  P                   4       p\        V P                  \        WE4      4      # )zUnacceptable pattern: r4   )Zsepsc              3   s8   "   T F  qP                   x  K  	  R # 5ir   rF   )r=   Zdatar   r   r>   ZPath.glob.<locals>.<genexpr>  s     >+=4+=s   )r8   r5   Zescaper]   r   ZcompileZ	translateZ	fullmatchr\   Zfilelistr,   ru   r7   )r   patternZprefixZtrZmatchesr@   s   &&    r   globZ	Path.glob  s~    5g[ABB477#S!**Vll7&;;<FF>499+=+=>4::vg566r	   c                s*    V P                  R V 24      # )z**/)r|   )r   r{   r   r   rglobZ
Path.rglob  s    yy3wi))r	   c           	     sp    \         P                  ! \        V 4      \        VP                  ! V!  4      4      # r   )r   ZrelpathZstrrn   )r   r^   Zextras   &&*r   relative_toZPath.relative_to  s'      TC0F,GHHr	   c                sl    \         P                  ! V P                  P                  V P                  4      # r   )r   r6   r\   rG   r]   r   r   r   __str__ZPath.__str__  s!    ~~dii00$''::r	   c                s:    V P                   P                  V R 7      # )r   )_Path__reprrP   r   r   r   __repr__ZPath.__repr__  s    {{!!t!,,r	   c                s    \         P                  ! V P                  .VO5!  pV P                  V P                  P                  V4      4      # r   )r   r6   r]   ru   r\   rE   )r   r^   Znexts   &* r   rn   ZPath.joinpath  s7    ~~dgg..zz$))//566r	   c                s    V P                   '       g   V P                  P                  # \        P                  ! V P                   P                  R 4      4      pV'       d
   VR ,          pV P                  V4      # rs   )r]   rG   parentr   rD   r
   ru   )r   Z	parent_atr   r   r   ZPath.parent  sT    www=='''%%dggnnS&9:	Izz)$$r	   )r]   r\   )Z )rJ   )%r   r    r!   r"   r#   r   r   r_   r`   rd   rh   Zpropertyr:   rk   rl   rm   rG   rq   rr   rt   ru   rb   rv   rc   rw   rx   rz   r|   r}   r~   r   r   rn   Z__truediv__r   r$   r%   )r(   s   @r   r   r      s	    dL NF>*C C(D ! ! # # % % ! ! B B
M-430,B"7*I;-7 K% %r	   r   )re   r   rI   r   rT   rf   r5   ry   rX   Zcompat.py310r    r|   r   Z__all__r   r   ZdictZfromkeysr?   r   r   r*   rK   r<   rR   r[   r   r2   r	   r   <module>r      s    	      	  
 '  (6&+, -- /H* *$;1 ;1|H#^W__ HV &>y% y%r	   