
    <Bh"              
      f   S SK Jr  S SKrS SKrS SKrS SKrS SKJr  S SKJ	r	  SSK
Jr  \	(       a  SSKJr  S/S0S	 jjrS1S
 jrS2S jrS3S jr\R$                  " S\R&                  S9rS3S jr\R$                  " S\R&                  S9rS4S jr\R0                  " SSS\R$                  " S\R&                  S9SS9  \" SSSS9S3S j5       rS/S0S jjr\R$                  " S\R&                  S9rS3S jr\R0                  " SSS\SS9  \R0                  " SSS\S S9  \R$                  " S!\R&                  S9rS3S" jr\R0                  " SSS#\S$S9  \R0                  " SSS%\S&S9  \R$                  " S'\R&                  S9rS5S( jr \R0                  " SSS)\S*S9  \R0                  " SSS+\ S,S9  S6S- jr!S7S. jr"g)8    )annotationsN)partial)TYPE_CHECKING   )
deprecated   )PathTypec                  ^^^ [         R                  " U 5      n T(       a  [         R                  " T5      OSm[        R                  U ;   aG  [        R                  R                  UUU4S jU R                  [        R                  5      5       5      $ U (       d  U $ Sn[        R                  " U 5      (       d  U S;   a  T(       a\  [        R                  " U 5      nU S   S;   a  U[        R                  -  n[        T5      R                  [        U5      u  pCU(       a  Un U(       d  [        R                  [        U 5      u  pU(       d"  [        R!                  [#        [$        TS9U 5      n ['        U [        R                  5      $ )a  
A fallback implementation of `cygpath --unix`.

Args:
    path: The path to convert.
    prefix: The Windows style prefix directory to use for the conversion.
          If not provided, no checks for root paths will be made.
    cygdrive: Whether to use the Cygwin-style drive prefix.
Nc              3  T   >#    U  H  n[        UTT5      =m(       d  M  Tv   M     g 7fN)nt_to_posix).0path	convertedcygdriveprefixs     :lib/python3.13/site-packages/conda/common/path/_cygpath.py	<genexpr>nt_to_posix.<locals>.<genexpr>    s.      &
2(vx@@	@ I2s   (	(r   )zC:zc:z/\)r   )osfspathntpathpathsep	posixpathjoinsplitisabsnormpathsep_get_RE_WIN_ROOTsubn_to_unix_rootRE_WIN_MOUNT_to_unix_mountRE_WIN_DRIVEsubr   _to_unix_drive_resolve_path)r   r   r   subs	norm_pathr   s    ``  @r   r   r      s!    99T?D"(RYYvdF~~  %% &


6>>2&
 
 	
 " D ||DT\1-IBx5 VZZ'	.v6;;M9UOI  %**>4@JD ##GNX$NPTUDy}}--    c                \    [         R                  " U 5      n [         R                  " U S5      $ )NLibrary)r   r   r   )r   s    r   	_get_rootr/   V   s#    __V$F ;;vy))r,   c                    [        U 5      n[        R                  " S[        R                  " U5       S3[        R                  S9$ )Nz
        ^
        z)
        (?P<path>.*)?
        $
        flags)r/   recompileescapeVERBOSE)r   roots     r   r!   r!   d   sC    VD::		4 		 jj r,   c                6    U R                  S5      =(       d    S$ )Nr   /groupmatchs    r   r#   r#   q   s    ;;v%#%r,   zW
    ^
    [/\\]{2}(
        (?P<mount>[^/\\]+)
        (?P<path>.*)?
    )?
    $
    r1   c                x    U R                  S5      =(       d    SnU R                  S5      =(       d    SnSU U 3$ )Nmount r   //r:   r=   r?   r   s      r   r%   r%      s9    KK &BE;;v$"Dwtfr,   zB
    ^
    (?P<drive>[A-Za-z]):
    (?P<path>[/\\]+.*)?
    $
    c                    U R                  S5      R                  5       nU R                  S5      =(       d    SnU(       a  SOS SU U 3$ )Ndriver   r@   z	/cygdriver9   )r;   lower)r=   r   rD   r   s       r   r(   r(      sF    KK &&(E;;v$"D%k2.awtf==r,   z25.3z25.9RE_UNIXzZ
        (?P<drive>[A-Za-z]:)?
        (?P<path>[\/\\]+(?:[^:*?\"<>|;]+[\/\\]*)*)
        z6Use `conda.common.path._cygpath.RE_WIN_DRIVE` instead.)addendumz8Use `conda.common.path._cygpath._to_unix_drive` instead.c                    SU R                  S5      =(       d    SR                  5       U R                  S5      -   R                  SS5      R                  SS5      R                  SS5      R                  S5      -   $ )Nr9   rD   r@   r   \:rA   )r;   rE   replacerstripr<   s    r   translate_unixrM      sf     
++g

$"	+	+	-F0C	C	s		b		s		 r,   c                  ^ [         R                  " U 5      n T(       a  [         R                  " T5      OSm[        R                  U ;   aE  [        R                  R                  U4S jU R                  [        R                  5      5       5      $ U (       d  g[        R                  " U 5      (       a|  Sn[        R                  [        U 5      u  pU(       d  [        R                  [        U 5      u  pT(       a4  U(       d-  [        T5      n[        R                  [!        ["        US9U 5      n [%        U [        R&                  5      $ )a8  
A fallback implementation of `cygpath --windows`.

Args:
    path: The path to convert.
    prefix: The Windows style prefix directory to use for the conversion.
          If not provided, no checks for root paths will be made.
    cygdrive: Unused. Present to keep the signature consistent with `nt_to_posix`.
Nc              3  <   >#    U  H  n[        UT5      v   M     g 7fr   )posix_to_nt)r   r   r   s     r   r   posix_to_nt.<locals>.<genexpr>   s      #
2O$Kf%%2O   .r   )r7   )r   r   r   r   r   r   r   r   RE_UNIX_DRIVEr"   _to_win_driveRE_UNIX_MOUNT_to_win_mountr/   RE_UNIX_ROOTr'   r   _to_win_rootr)   r    )r   r   r   r*   r7   s    `   r   rP   rP      s     99T?D"(RYYvdFD ~~"" #
26**Y=N=N2O#
 
 	

 " t #''t<
 &++M4@JD $V$D##GLt$DdKDvzz**r,   zR
    ^
    (/cygdrive)?
    /(?P<drive>[A-Za-z])
    (/+(?P<path>.*)?)?
    $
    c                    U R                  S5      R                  5       nU R                  S5      =(       d    SnU SU 3$ )NrD   r   r@   z:\)r;   upper)r=   rD   r   s      r   rU   rU      s=    KK &&(E;;v$"DWCvr,   RE_DRIVEz7Use `conda.common.path._cygpath.RE_UNIX_DRIVE` instead.translation_drivez7Use `conda.common.path._cygpath._to_win_drive` instead.zS
    ^
    /{2}(
        (?P<mount>[^/]+)
        (?P<path>/+.*)?
    )?
    $
    c                x    U R                  S5      =(       d    SnU R                  S5      =(       d    SnSU U 3$ )Nr?   r@   r   z\\r:   rB   s      r   rW   rW     s9    KK &BE;;v$"D%r,   RE_MOUNTz7Use `conda.common.path._cygpath.RE_UNIX_MOUNT` instead.translation_mountz7Use `conda.common.path._cygpath._to_win_mount` instead.z#
    ^
    (?P<path>/.*)
    $
    c                0    U R                  S5      nU U 3$ )Nr   r:   )r=   r7   r   s      r   rY   rY   >  s    ;;vDVD6?r,   RE_ROOTz6Use `conda.common.path._cygpath.RE_UNIX_ROOT` instead.translation_rootz6Use `conda.common.path._cygpath._to_win_root` instead.c                    Sn[         R                  " SU 5      =n(       a  UR                  5       u  p [         R                  " U5      n[         R                  " SX5      [         R                  " SX5      -   $ )Nr@   z^([/\\]+)(.*)$z[/\\]z[/\\]+)r3   r=   groupsr5   r'   )r   r    leadingr=   s       r   r)   r)   S  sY    G*D11u1
))C.C66(C)BFF9c,HHHr,   c                V   ^ UR                  U4S jU R                  U5      5       5      $ )Nc              3  <   >#    U  H  n[        UT5      v   M     g 7fr   )r)   )r   r   r    s     r   r    resolve_paths.<locals>.<genexpr>\  s     R=QTdC00=QrR   )r   r   )pathsr   r    s     `r   resolve_pathsrk   [  s!    <<RU[[=QRRRr,   )F)r   r	   r   zPathType | Noner   boolreturnstr)r   rn   rm   rn   )r   rn   rm   z
re.Pattern)r=   re.Matchrm   rn   )r=   ro   r   rl   rm   rn   )r=   ro   r7   rn   rm   rn   )r   rn   r    rn   rm   rn   )rj   rn   r   rn   r    rn   rm   rn   )#
__future__r   r   r   r   r3   	functoolsr   typingr   deprecationsr   r@   r	   r   r/   r!   r#   r4   r6   r$   r%   r&   r(   constantrM   rP   rT   rU   rV   rW   rX   rY   r)   rk    r,   r   <module>rv      s   #  	  	    &A.H*
& zz **
 zz **>   

JJ	 jj F 

G

5+p 

 **	   

F   

F 

 **
    

F   

F zz
 **
   

E   

EISr,   