+
    :1jN                      a  0 t $ R t^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIH	t	 ^ RI
HtHtHtHtHtHtHtHt ^ RIH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!H"t" ^RI#H$t$ ^RI%H&t' ^RI%H(t(H)t)H*t* ^RI+H,t, ^RI-H.t.H/t/H0t0H1t1H2t2H3t3 ]'       d   ^ RI4H5t5H6t6 ^ RIH7t7 ]	! ]84      t9]Pt                  ! R4      t;R]<R&   R].! 4       R]1! 4       R]3! R4      R]3! R4      R]3! R4      /t= ! R R]P|                  R7      t?R R lt@R R  ltA ! R! R"]?4      tB ! R# R$]?4      tC ! R% R&]?4      tD ! R' R(]?4      tE ! R) R*]?4      tF ! R+ R,]?4      tG ! R- R.]?4      tHR/]BR0]BR1]BR2]BR3]BR4]CR5]CR6]DR7]ER8]FR9]G/tIR:]<R;&   R<]H/tJR= tKR# )>aN  Conda activate and deactivate logic.

Implementation for all shell interface logic exposed via
`conda shell.* [activate|deactivate|reactivate|hook|commands]`. This includes a custom argument
parser, an abstract shell class, and special path handling for Windows.

See conda.cli.main.main_sourced for the entry point into this module.
)annotationsN)	getLogger)abspathbasenamedirnameexists
expanduser
expandvarsisdirjoin)Path)TYPE_CHECKING)CONDA_PACKAGE_ROOT)Utf8NamedTemporaryFile)CONDA_ENV_VARS_UNSET_VARPACKAGE_ENV_VARS_DIRPREFIX_STATE_FILERESERVED_ENV_VARS)contextlocate_prefix_by_name)on_win)path_identity)paths_equalunix_path_to_winwin_path_to_unix)json)ActivateHelpArgumentErrorCondaValueErrorDeactivateHelpEnvironmentLocationNotFoundGenericHelp)CallableIterable)Anyz#^(/[A-Za-z]/|/cygdrive/[A-Za-z]/).*zre.Pattern[str]_MSYS2_CYGWIN_PREFIX_REactivate
deactivatehookcommands
reactivatec                     ] tR t^Mt$ R]R&   R]R&   R]R&   R]R&   R]R&    R]R	&   R]R
&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   RFR R lltRGR ltR tR tR t	R t
RFR R lltR 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. ltR/ tR0 R1 ltR2 R3 ltR4 R5 ltR6 tR7 tR8 tR9 tRFR: ltRFR; ltRFR< ltR= t R> t!R? t"R@ t#RA t$RB t%RC RD lt&REt'R# )H
_Activatorstrpathsep_joinsepzDCallable[[str | Iterable[str] | None], str | tuple[str, ...] | None]path_conversionscript_extension
str | Nonetempfile_extensioncommand_joinunset_var_tmplexport_var_tmplpath_var_tmplset_var_tmplrun_script_tmplzPath | Nonehook_source_pathboolinline_hook_sourceneeds_line_ending_fixNc                   V ^8  d   QhRR/# )   	argumentszIterable[str] | None )formats   ".lib/python3.14/site-packages/conda/activate.py__annotate___Activator.__annotate__z   s     N N"6 N    c                	@    Vf
   R V n        R # \        V4      V n        R # N)tuple_raw_arguments)selfr@   s   &&rC   __init___Activator.__init__z   s    &/&7dU9=MrF   c                t   . p/ pVP                  4        F   w  rVVf   VP                  V4       K  WdV&   K"  	  V'       dg   \        P                  P                  4        FC  w  rVVf   VP                  V4       K  RV9   g   RV9   d   V P	                  V4      WE&   K?  WdV&   KE  	  MVP                  \        P                  4       \        P                  '       dQ   VP                  4        UUu/ uF  w  rVVP                  4       VbK  	  pppV Uu. uF  qUP                  4       NK  	  ppWC3# u uppi u upi )aV  
:param export_metavars: whether to export `conda_exe_vars` meta variables.
:param kwargs: environment variables to export.
    .. if you pass and set any other variable to None, then it
    emits it to the dict with a value of None.

:return: A dict of env vars to export ordered the same way as kwargs.
    And a list of env vars to unset.
/\)itemsappendr   conda_exe_vars_dictr0   extendenvvars_force_uppercaseupper)rK   export_metavarskwargs
unset_varsexport_varsnamevalues   &&,    rC   get_export_unset_vars _Activator.get_export_unset_vars}   s    
 "<<>KD}!!$'$)D!	 * &::@@B=%%d+E\TU](,(<(<U(CK%(-%  C g99: ***BMBSBSBUVBU;44::<.BUKV3=>:4**,:J>&& W>s   /D/D5c                	   . VOR N5pV P                   P                  V4      p\        '       d(   V P                  \        8X  d   VP                  RR4      pVf   V# V'       d=   \        RVRR7      ;_uu_ 4       pVP                  V4       RRR4       VP                  # \        4       h  + '       g   i     XP                  # ; i) z

Nw+Fsuffixdelete)
r4   r   r   r0   r   replacer   writer[   NotImplementedError)rK   r)   extcontenttfs   &&&  rC   	_finalize_Activator._finalize   s    "X?r?##((2 6d**.>>oofd3G;N'SGG2! H 77N%'' HG 77Ns   :B**C	c                	    V P                   '       d   V P                  V P                  4      pMV P                  V P                  4      pV P	                  V P                  V4      V P                  4      # rH   )stackbuild_stackenv_name_or_prefixbuild_activaterl   _yield_commandsr3   )rK   builder_results   & rC   r&   _Activator.activate   s^    :::!--d.E.EFN!001H1HIN~~  0$2I2I
 	
rF   c                	t    V P                  V P                  V P                  4       4      V P                  4      # rH   )rl   rs   build_deactivater3   rK   s   &rC   r'   _Activator.deactivate   2    ~~  !6!6!894;R;R
 	
rF   c                	t    V P                  V P                  V P                  4       4      V P                  4      # rH   )rl   rs   build_reactivater3   rx   s   &rC   r*   _Activator.reactivate   rz   rF   c                    V ^8  d   QhRRRR/# )r?   auto_activatezbool | Nonereturnr-   rA   )rB   s   "rC   rD   rE      s     " "+ " "rF   c                	B   . pV P                  4       ;p'       d   VP                  V4       V P                  '       di   V P                  '       d+   VP                  V P                  P	                  4       4       M,VP                  V P
                  V P                  ,          4       Vf   \        P                  '       g	   V'       d$   VP                  R\        P                   R24       V P                  4       pVe   VP                  V4       RP                  V4      # )Nzconda activate 'z'
ra   )_hook_preamblerR   r:   r<   	read_textr9   r   r   default_activation_env_hook_postambler   )rK   r   builderpreamble	postambles   &&   rC   r(   _Activator.hook   s    **,,8,NN8$   &&&t44>>@At33d6K6KKL W%:%:%:mNN-g.L.L-MSQR((*	 NN9%yy!!rF   c                	    V P                  4        \        P                  P                  V P                  4       \        W P                  4      ! 4       p\        P                  P                  V P                  4       V# rH   )_parse_and_set_argsr   plugin_managerinvoke_pre_commandscommandgetattrinvoke_post_commands)rK   responses   & rC   execute_Activator.execute   sV      " 	224<<@4.033DLLArF   c                    V ^8  d   QhRRRR/# )r?   keyr-   r   rA   )rB   s   "rC   rD   rE      s     ) )c )c )rF   c                	(    V P                   V,          # rH   )r5   )rK   r   s   &&rC   template_unset_var_Activator.template_unset_var   s    ""S((rF   c               $    V ^8  d   QhRRRRRR/# r?   r   r-   r\   r   rA   )rB   s   "rC   rD   rE      s!     3 3s 33 33 3rF   c                	*    V P                   W3,          # rH   )r6   rK   r   r\   s   &&&rC   template_export_var_Activator.template_export_var   s    ##sl22rF   c               $    V ^8  d   QhRRRRRR/# r   rA   )rB   s   "rC   rD   rE      s!     1 1S 1 1 1rF   c                	*    V P                   W3,          # rH   )r7   r   s   &&&rC   template_path_var_Activator.template_path_var   s    !!SL00rF   c               $    V ^8  d   QhRRRRRR/# r   rA   )rB   s   "rC   rD   rE      s!     0 0C 0 0 0rF   c                	*    V P                   W3,          # rH   )r8   r   s   &&&rC   template_set_var_Activator.template_set_var   s      C<//rF   c                    V ^8  d   QhRRRR/# )r?   scriptr-   r   rA   )rB   s   "rC   rD   rE      s     - -# -# -rF   c                	(    V P                   V,          # rH   )r9   )rK   r   s   &&rC   template_run_script_Activator.template_run_script   s    ##f,,rF   c                   V ^8  d   QhRR/# r?   r   r2   rA   )rB   s   "rC   rD   rE      s      
 rF   c                	   . p\         P                  P                  4        F  w  r#Vf#   VP                  V P	                  V4      4       K+  RR0P                  V4      '       d#   VP                  V P                  W#4      4       Kf  VP                  V P                  W#4      4       K  	  V'       d-   V P                  P                  V4      V P                  ,           # R # )NrO   rP   )
r   rS   rQ   rR   r   intersectionr   r   r4   r   )rK   resultr   r\   s   &   rC   r   _Activator._hook_preamble   s    !55;;=JC}d55c:;t))%00d44S@Ad66sBC > $$))&1D4E4EEErF   c                   V ^8  d   QhRR/# r   rA   )rB   s   "rC   rD   rE      s       rF   c                	    R # rH   rA   rx   s   &rC   r   _Activator._hook_postamble   s    rF   c                   V ^8  d   QhRR/# r?   r   NonerA   )rB   s   "rC   rD   rE     s     < <T <rF   c                	  aa	 V P                   ;'       g    R .vopRo	\        ;QJ d    . V	3R lV 4       F  NK  	  5M! V	3R lV 4       4      p\        V4      \        V4      8g  p\        V3R lV 4       4      pS\        9  d+   \        RS'       d   RS R2,           4      hR,           4      hV'       d   \        S,          hSP                  R4      '       g   SR8X  d     VP                  R	4      pWE R
\        n	        SR8X  Ed	   \        P                  ;'       d"    \        P                  \        P                  8*  V n         VP                  R4      p VP                  R4      pV^ 8  d   V^ 8  d   \        RS,           4      hV^ 8  d
   R
V n        WF V^ 8  d
   RV n        WG \        V4      ^8  d*   \        SR,           \        V4      ,           R,           4      hV'       d   V^ ,          V n        M/\        P                   V n        MV'       d   \        S RV R24      hSV n        R #   \         d    R\        n	         ELKi ; i  \         d    Rp ELi ; i  \         d    Rp EL	i ; i)Nc              3  8   <"   T F  qS9  g   K  Vx  K  	  R # 5irH   rA   ).0arg
help_flagss   & rC   	<genexpr>1_Activator._parse_and_set_args.<locals>.<genexpr>  s     PYcZ:OccYs   
c              3  L   <"   T F  q'       g   K  VS8w  g   K  Vx  K  	  R # 5irH   rA   )r   r   r   s   & rC   r   r     s     U]ccccWncc]s   	$$
$zT'activate', 'deactivate', 'hook', 'commands', or 'reactivate' command must be given.z, not 'z'..r&   r(   z--devTFz--stackz
--no-stackz.cannot specify both --stack and --no-stack to z) does not accept more than one argument:
ra   z+ does not accept arguments
remainder_args: )z-hz--helpz/?)rJ   rI   lenlistBUILTIN_COMMANDSr   endswithindexr   dev
ValueError
auto_stackshlvlro   r-   rq   r   r   )
rK   r@   non_help_argshelp_requestedremainder_argsdev_idx	stack_idxno_stack_idxr   r   s
   &       @@rC   r   _Activator._parse_and_set_args  sc   "11;;dV)+
PYPPYPPY3}+==U]UU**)ELggYb,AW RUW  "7++J''7f+<#(..w7 #+"j  ++SSASAS0SDJ*00;	"-33LA A~,!"3#DwN  A~!
"-q "
"0>"Q&#BC.)*   *8*;'*1*H*H')GGWWYZ  U  $#$  	  "!"s6   %H5 
I I& 5III#"I#&I76I7c              #  	  "   \        VP                  R / 4      P                  4       4       F  w  r#V P                  W#4      x  K  	  VP                  RR4       F  pV P	                  V4      x  K  	  VP                  RR4       F  pV P                  V4      x  K  	  VP                  R/ 4      P                  4        F  w  r#V P                  W#4      x  K  	  VP                  R/ 4      P                  4        F  w  r#V P                  W#4      x  K  	  VP                  RR4       F  pV P	                  V4      x  K  	  R# 5i)export_pathdeactivate_scriptsrY   set_varsrZ   activate_scriptsNrA   )sortedgetrQ   r   r   r   r   )rK   	cmds_dictr   r\   r   s   &&   rC   rs   _Activator._yield_commandsA  s     }b!A!G!G!IJJC**366 K  mm$8"=F**622 > ==r2C))#.. 3 $--
B7==?JC''33 @ $--r:@@BJC**366 C  mm$6;F**622 <s   EEc                    V ^8  d   QhRRRR/# r?   rq   r-   r   dict[str, Any]rA   )rB   s   "rC   rD   rE   T  s     E E E ErF   c                	&    V P                  VR 4      # )F_build_activate_stackrK   rq   s   &&rC   rr   _Activator.build_activateT  s    ))*<eDDrF   c                    V ^8  d   QhRRRR/# r   rA   )rB   s   "rC   rD   rE   W  s     D Dc Dn DrF   c                	&    V P                  VR 4      # Tr   r   s   &&rC   rp   _Activator.build_stackW  s    ))*<dCCrF   c               $    V ^8  d   QhRRRRRR/# )r?   rq   r-   ro   r;   r   r   rA   )rB   s   "rC   rD   rE   Z  s-     [
 [
[
 [
 
	[
rF   c                	   V P                  V4      p\        \        P                  ! R R4      P	                  4       ;'       g    ^ 4      p\        P                  ! R4      pWS8X  d   V^ 8  d   V P                  4       # V P                  V4      pV^,           pV P                  V4      pV P                  W84      p	V P                  V4      P                  4        U
Uu/ uF  w  rV\        8w  g   K  WbK  	  pp
p\        V4      P                  \        P                  4      pV Uu. uF(  p\        P                  ! V4      W,          8w  g   K&  VNK*  	  ppV'       d:   \        R\         P"                  R7       \        RV 2\         P"                  R7       V F"  p
\        P                  ! V
4      VRV RV
 2&   K$  	  V^ 8X  dA   V P$                  ! RRV P'                  V P)                  V4      4      RVR VR	VR
V	/VB w  ppRpMV'       dM   V P$                  ! RRV P'                  V P)                  V4      4      RVR VR	VR
V	/VBRV 2VRV 2R/B w  ppRpMUV P$                  ! RRV P'                  V P+                  WS4      4      RVR VR	VR
V	/VBRV 2V/B w  ppV P-                  V4      p/ p\.        P0                  '       d   V P3                  VV	4       RVRVRVRVRV/# u upp
i u upi )CONDA_SHLVLr`   CONDA_PREFIXz=WARNING: overwriting environment variables set in the machinefilezoverwriting variable __CONDA_SHLVL__PATHCONDA_DEFAULT_ENVCONDA_PROMPT_MODIFIERCONDA_PREFIX_CONDA_STACKED_truerY   r   rZ   r   r   rA   )_resolve_prefixintosgetenvstripr|   _get_activate_scripts_default_env_prompt_modifier_get_environment_env_varsrQ   r   setr   environprintsysstderrr]   r.   _add_prefix_to_path_replace_prefix_in_path_get_deactivate_scriptsr   	changeps1_update_prompt)rK   rq   ro   prefixold_conda_shlvlold_conda_prefixr   conda_shlvlconda_default_envconda_prompt_modifierr[   r\   env_varsclobber_varsclobber_varoverwritten_clobber_varsrZ   rY   r   r   s   &&&                 rC   r    _Activator._build_activate_stackZ  s   
 %%&89 biir:@@BGGaH99^4 %/A*=((**55f=%) --f5 $ 5 5f P  $==fEKKM
M00 DKM 	 
 8}11"**=  ,$
+yy%)>> K+ 	! $

 $OZZ )*B)CD3::V DBD))D/H~o%6av>? ! a&*&@&@ '&&t'?'?'GH'#' (' #4	'
 '<' '#K "$&*&@&@ '&&t'?'?'GH'#' (' #4	'
 '<' ' $O#457G$[M2F'#K "$&*&@&@ '&&001AJ' $	'
 (' #4' '<' ' $O#457G'#K "&!=!=>N!O*?@ *; "4 0
 	
E
$
s   K#/K#$#K)K)c                	   R V n         \        P                  ! R4      p\        \        P                  ! RR4      P	                  4       ;'       g    ^ 4      pV'       d   V^8  d   RRR/ R/ RRRR/# V P                  V4      pV P                  V4      pV^,
          p/ pV^8X  dB   V P                  V P                  V4      4      pV P                  R	VR	R	R
7      w  rRp
RpRV/pEM7V^8:  d   \        R4      h\        P                  ! RV,          4      pV'       g   \        R4      hV P                  V4      pV P                  W4      p
V P                  V4      pRV,          \        P                  9   pRpRV,          .p	V'       d:   V P                  V P                  V4      4      pV	P                  RV,          4       M V P                  V P                  W4      4      pV P                  ! RRVRVRVRV
/VB w  ppV	V,          p	RV/pV P!                  V4      p\"        P$                  '       d   V P'                  Wj4       VP)                  4        Fv  p\        P                  ! RV RV 24      ;p'       d   VVV&   K.  \"        P*                  '       d"   V	P                  VP-                  4       4       Ke  V	P                  V4       Kx  	  RV	RVRVRVRVRV/# )Tr   r   r`   rY   r   rZ   r   r   N)r   r   r   r   r   z%'old_conda_shlvl' must be 2 or largerzCONDA_PREFIX_%dzThis should not happen! You may have non-consecutive `CONDA_PREFIX_<number> environment variables. Try restarting your shell and, if it persists, check your shell profile to see what may be adding a faulty CONDA_PREFIX_<number> environment variable.zCONDA_STACKED_%dr   r   r   r   r   rA   )_deactivater   r   r   r   r  r   r.   _remove_prefix_from_pathr]   r   r   r   r   rR   r  r   r   r  r  keysrU   rV   )rK   r
  r	  r   old_conda_environment_env_varsnew_conda_shlvlr   new_pathrZ   rY   r  r   r   
new_prefixr  new_conda_environment_env_varsold_prefix_stackedunset_vars2env_var
save_values   &                   rC   rw   _Activator.build_deactivate  s    99^4biir:@@BGGaH?Q#6 bBr$b"B  "99:JK)-)G)G*
& *A-a((--.>?H '+&@&@!+"&&*	 'A '#K %'!!!8,K!# !HII#4#FGJ B  !% 1 1* =$($9$9*$X!-1-K-KJ-W*!3o!E!SH+o=>J!,,112BC !!"4"FG,,001AN (,'A'A ('(+( #4( '<	(
 1($K +%J!8,K#99*E@ 6::<GYY7H''STTzT'1G$ 222%%gmmo6%%g. = *;; "4 0
 	
rF   c                	   R V n         \        P                  ! R4      p\        \        P                  ! RR4      P	                  4       ;'       g    ^ 4      pV'       d   V^8  d   R. R/ R/ RRRR/# \        P                  ! R	V P                  V4      4      pV P                  V P                  W4      4      p/ pV P                  W4      p\        P                  '       d   V P                  WV4       V P                  VVV P                  W4      R
7      w  rxRVRVRVRV P                  V4      RV P                  V4      /# )Tr   r   r`   rY   r   rZ   r   r   r   )r   r   r   rA   )_reactivater   r   r   r   r   r.   r  r   r   r  r  r]   r  r   )	rK   conda_prefixr  r  r  r   r  rZ   rY   s	   &        rC   r|   _Activator.build_reactivate  sI   yy0"))M26<<>CC!D{Q bBr$b"B  II!2!2<!@
 $$((D
  $ 5 5l V@"&"<"<#"&"7"7# #= #
 *; $">">|"L : :< H
 	
rF   c                	    R RRR/p\         P                  ! R\        P                  V9   d   V\        P                  ,          MR4      pVP	                  \         P
                  4      pV# )darwinz/usr/bin:/bin:/usr/sbin:/sbinwin32zcC:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\r   z/usr/bin)r   r   r  platformsplitpathsep)rK   clean_pathspath
path_splits   &   rC   _get_starting_path_list"_Activator._get_starting_path_listH  sa     5  ?	
 yy),)DK%*
 ZZ

+
rF   c              #  	  "   \         '       Ed   VP                  V P                  4      x  . pR Fk  pV P                  P                  VRV34      p\        P                  V4      '       d   \        WA4      p\        V4      '       g   KZ  VP                  V4       Km  	  \        V4      ^8  dP   \        RV RV R2\        P                  R7       \        RV P                  V4       2\        P                  R7       V'       d)   V P                  P                  VRV^ ,          R34      x  V P                  P                  VRRR34      x  V P                  P                  VRR	R34      x  V P                  P                  VRR34      x  V P                  P                  VR
34      x  V P                  P                  VR34      x  R# V P                  P                  VR34      x  R# 5i)ucrt64Libraryz	WARNING: z: z1 MSYS2 envs exist: please check your dependenciesr   zWARNING: conda list -n binz	mingw-w64usrScriptsN)r1  clang64mingw64
clangarm64)r   rstripr/   r   r%   matchr   r
   rR   r   r   r  r  r   )rK   r  variantsvariantr,  s   &&   rC   _get_path_dirs_Activator._get_path_dirs]  s    6--)) HIxx}}fi%AB +0088+D9D;;OOG, J 8}q xr(3de -d.?.?.G-HI
 hhmmVYU$KLL((--K GHH((--E5 ABB((--E :;;((-- 344((--00((--00s   BG2A;G2C+G2c                	   V P                  V4      pVf*   \        V P                  V P                  4       4      4      pM\        V P                  V4      4      p\        \        P
                  ! RR4      P                  4       ;'       g    ^ 4      pV'       gv   \        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       g<   V P                  \        \        P                  R4      4      pVP                  ^ V4       \        V P                  V P                  V4      4      4      VR&   \        V4      # )Nr   r`   c              3  B   "   T F  qP                  R 4      x  K  	  R# 5i)condabinN)r   )r   ps   & rC   r   1_Activator._add_prefix_to_path.<locals>.<genexpr>  s     *U9a::j+A+A9s   TFrA  :    rD  N)r0   r   r.  r   r   r   r   anyr   r   r#  insertr=  rI   )rK   r  starting_path_dirs	path_listr	  condabin_dirs   &&&   rC   r  _Activator._add_prefix_to_path  s    %%f-%T11$2N2N2PQRIT112DEFI biir:@@BGGaHss*U9*Usss*U9*U'U'U//W5I5I:0VWLQ-d2243F3Fv3NOP	#YrF   c                	(    V P                  VR V4      # rH   )r  )rK   r  rG  s   &&&rC   r  #_Activator._remove_prefix_from_path  s    ++FD:LMMrF   c                	&   V P                  V4      pV P                  V4      pVf*   \        V P                  V P                  4       4      4      pM\        V P                  V4      4      pR pVe   \        V P	                  V4      4      pV! WF^ ,          4      pVf   ^ pM\        V4      ^,
          pR p	V	fJ   VR8  dC   V! WFV,          4      p	V	f%   \        RWh,           2\        P                  R7       V^,
          pKM  V P                  V P                  P                  \        P                  RR34      4      p
WI^,           ,          V
8X  d
   V	^,          p	WGV	^,           1 M^ pVe   \        V P	                  V4      4      WGV% \        V4      # )Nc                X    \        V 4       F  w  r#\        W14      '       g   K  Vu # 	  R # rH   )	enumerater   )paths	test_pathqr,  s   &&  rC   index_of_path9_Activator._replace_prefix_in_path.<locals>.index_of_path  s(    $U+t//H , rF   zDid not find path entry r   r2  r3  r   )r0   r   r.  rI   r=  r   r   r  r  r/   r   r  )rK   
old_prefixr  rG  rH  rS  prefix_dirs	first_idxprefix_dirs_idxlast_idxlibrary_bin_dirs   &&&&       rC   r  "_Activator._replace_prefix_in_path  s|   ))*5
))*5
%T11$2N2N2PQRIT112DEFI	 ! 3 3J ?@K%iQ@I 	"%k"2Q"6&?R+?,YO8TUH'6{7S6TU!$ '6&9O #'"6"6HHMM3::y%"@A# \*o=MH(Q,67I!-1$2E2Ej2Q-RI	*YrF   c                	    R # rH   rA   )rK   r   r  s   &&&rC   r  _Activator._update_prompt  s    rF   c                	    \        V\        P                  4      '       d   R # \        \	        V4      4      R8X  d   \        V4      # T# )baseenvs)r   r   root_prefixr   r   )rK   r  s   &&rC   r   _Activator._default_env  s8    vw2233#+GFO#<#FxRFRrF   c                	V   \         P                  '       Ed   . p. p\        \        P                  ! R R4      P                  4       4      p\        ^V^,           4       F  pWe8X  d(   V P                  \        P                  ! RR4      4      pM7V P                  \        P                  ! RV 2R4      P                  4       4      p\        \        P                  ! RV 2R4      P                  4       4      pVP                  V4       V'       g   V^ R pVP                  V4       K  	  \        V RR4      p	\        V RR4      p
V	'       de   V^ R pV^ R p\        \        P                  ! RV 2R4      P                  4       4      pV'       g!   V'       d   VP                  VR,          4       M4V
'       d   M+\        V R	R4      pV'       g   V^ R pVP                  V4       R
P                  VRRR1,          4      p\         P                  P                  VVV\        V4      R7      # R# )r   0r   r`   r   r   r  Fr"  ro   ,N)default_envstacked_envr  r[   r   )r   r  r   r   r   r9  ranger   r;   rR   r   r   
env_promptrB   r   )rK   r  r  	env_stackprompt_stack	old_shlvlienv_i	stacked_ir'   r*   stackedro   conda_stacked_envs   &&&           rC   r   _Activator._prompt_modifier  s   ILBIImS9@@BCI1i!m,> --bii.KLE --		M!"5r:AACE !^A3+?!D!K!K!MN	  ' #/"#5L##E* - !}e<J }e<J+Ab1%aO	ryy>))ErJQQST9 ''	"6gu5#/"#5L##$56 #dd); <%%,,--f%	 -   rF   c           	     	   aa V P                   o\        S4      ) o R  \        P                  ! \	        VRRR4      4       4       pT P                  \        TT3R lT 4       4      4      #   \
         d    Ru # i ; i)c              3  :   "   T F  pVP                   x  K  	  R # 5irH   r,  r   entrys   & rC   r   3_Activator._get_activate_scripts.<locals>.<genexpr>  s      SE 

S   etccondaz
activate.dc              3  >   <"   T F  qSR  S8X  g   K  Vx  K  	  R # 5irH   rA   r   rB  _script_extensionse_lens   & rC   r   rx    s     Gez5F'F11e   
rA   r1   r   r   scandirr   OSErrorr0   r   rK   r  rP  r~  r  s   && @@rC   r    _Activator._get_activate_scripts  s~     11'((	ZZVUG\(RSE ##GeGG
 	
  	I	s   )A* *A:9A:c           	     	   aa V P                   o\        S4      ) o R  \        P                  ! \	        VRRR4      4       4       pT P                  \        TT3R lT 4       RR7      4      #   \
         d    Ru # i ; i)c              3  :   "   T F  pVP                   x  K  	  R # 5irH   ru  rv  s   & rC   r   5_Activator._get_deactivate_scripts.<locals>.<genexpr>  s      UE 

Ury  rz  r{  zdeactivate.dc              3  >   <"   T F  qSR  S8X  g   K  Vx  K  	  R # 5irH   rA   r}  s   & rC   r   r    s     Hu!&'
6G(GAAur  T)reverserA   r  r  s   && @@rC   r  "_Activator._get_deactivate_scripts  s     11'((	ZZVUG^(TUE ##HuHRVW
 	
  	I	s   )A, ,A<;A<c                	   \        V\        4      p\        V\        4      p/ p\        V4      '       d}   \	        R  \
        P                  ! V4       4       4       FR  p\        V4      ;_uu_ 4       pVP                  \        P                  ! VP                  4       4      4       RRR4       KT  	  \        V4      '       d   \        V4      ;_uu_ 4       p\        P                  ! VP                  4       4      pVP                  R/ 4      pVP                  4        U	u. uF  qVP                  4       9   g   K  V	NK  	  p
p	V
 F=  p\        R\        P                   R7       \        RV R2\        P                   R7       K?  	  VP                  V4       RRR4       . p\"         F>  pW9   g   K  WM,          \$        8w  d   VP'                  V4       VP)                  V4       K@  	  V'       dI   RP                  V4      p\        RV R	V R
V RRP                  V4       R2	\        P                   R7       V#   + '       g   i     EK  ; iu up	i   + '       g   i     L; i)c              3  8   "   T F  qP                   x  K  	  R # 5irH   ru  rv  s   & rC   r   7_Activator._get_environment_env_vars.<locals>.<genexpr>&  s      +(Cu

(Cs   Nr  zbWARNING: duplicate env vars detected. Vars from the environment will overwrite those from packagesr   z	variable z duplicatedz, z<WARNING: the configured environment variable(s) for prefix 'z$' are reserved and will be ignored: zI.

Remove the invalid configuration with `conda env config vars unset -p  z`.
)r   r   r   r   r   r   r  openupdater   loadsreadr   r  r   r  r  r   r   rR   pop)rK   r  env_vars_filepkg_env_var_dirr  pkg_env_var_pathfprefix_stateprefix_state_env_varsevdup_varsdupcollect_reserved_varsreservedprint_reserved_varss   &&             rC   r   $_Activator._get_environment_env_vars  s   V%67v';< /""$* +(*

?(C+ %  *++qOODJJqvvx$89 ,+% -  m$$#zz!&&(3(4(8(8R(H%!)!02:O:T:T:V4VBB   $C= ZZ
 IcU+6SZZH $  56 %  !#)H#%)AA)00:X& * !"&)),A"BNvh W55H4I JXQsxx(=>?tE ZZ O ,++ %$s2   04H8A	II8I>AI8I
II"	c                    V ^8  d   QhRRRR/# r?   rq   r-   r   rA   )rB   s   "rC   rD   rE   R  s     	 	# 	# 	rF   c                    RV9   g   RV9   d5   \        V4      p\        \        VR4      4      '       g   \        V4      h V# \	        \        V4      4      pV# )z3Hook for shell-specific activation path validation.rP   rO   z
conda-meta)expandr
   r   r    r-   r   )rK   rq   r  s   && rC   r   _Activator._resolve_prefixR  sa     %%0B)B./Ffl3441&99 5  ./ABCFrF   )r  rJ   r"  r   rq   ro   rH   r   )(__name__
__module____qualname____firstlineno____annotations__rL   r]   rl   r&   r'   r*   r(   r   r   r   r   r   r   r   r   r   rs   rr   rp   r   rw   r|   r.  r=  r  r  r  r  r   r   r   r  r   r   __static_attributes__rA   rF   rC   r,   r,   M   s   . 	H  ""D!!N&'P($




" )310-<|3&ED[
zf
P'
R*)1V &N, \S
-^

1f	 	rF   r,   )	metaclassc                    V ^8  d   QhRRRR/# )r?   r,  r-   r   rA   )rB   s   "rC   rD   rD   ^  s     1 1 1 1rF   c                <    \        \        \        V 4      4      4      # rH   )r   r   r	   ru  s   &rC   r  r  ^  s    :j./00rF   c                    V ^8  d   QhRRRR/# )r?   rP  zstr | Iterable[str] | Noner   zstr | tuple[str, ...] | NonerA   )rB   s   "rC   rD   rD   b  s      B B%B!BrF   c           	         V f   R # \        V \        4      '       d   V P                  RR4      # \        V  Uu. uF  qP                  RR4      NK  	  up4      # u upi )NrP   rO   )
isinstancer-   rf   rI   )rP  r,  s   & rC   backslash_to_forwardslashr  b  sP     }	E3		}}T3''%@%$ll4-%@AA@s   Ac                      ] tR tRtRP                  tRt]! ]'       d   ]	M]
4      tRtRtRtRtRtR	t]'       d   R
M]tRt]'       d   RMRt]! ]RRRR4      tRtR tRtR# )PosixActivatorim  :rO   .shNra   Tzexport %s=''zexport %s='%s'zexport %s="$(cygpath '%s')"z%s='%s'z. "`cygpath '%s'`". "%s"shellrz  	profile.dzconda.shc                	0   \         P                  ! R R4      pRV9   d   R# \         P                  ! R4      pV'       d-   \        P                  ! \        P                  ! V4      RV4      pVP                  RR4      pVP                  R W#,           /4       R# )PS1r`   POWERLINE_COMMANDNr   'z'"'"')r   r   resubescaperf   r  )rK   r   r  ps1current_prompt_modifiers   &&&  rC   r  PosixActivator._update_prompt  sx    iir"#%"$)),C"D"&&#:;S#FC kk#y),2	
rF   rA   r  r  r  r  r   r.   r/   staticmethodr   r   _path_identityr0   r1   r3   r4   r=   r5   r6   r7   r8   r9   r   r   r:   r<   r  r  rA   rF   rC   r  r  m  s    88L
C"v#3>ROL  $N&O7=3?ML06,HO 
rF   r  c                      ] tR tRtRP                  tRt]! ]'       d   ]	M]
4      tRtRtRtRtRtR	t]'       d   R
M]tRt]'       d   RMRt]! ]RRRR4      tRtR tRtR# )CshActivatori  r  rO   z.cshN;
Tzunsetenv %szsetenv %s "%s"zsetenv %s "`cygpath '%s'`"zset %s='%s'zsource "`cygpath '%s'`"source "%s"r  rz  r  z	conda.cshFc                	    \         P                  ! R R4      p\         P                  ! R4      pV'       d-   \        P                  ! \        P                  ! V4      RV4      pVP                  R W#,           /4       R# )promptr`   r   N)r   r   r  r  r  r  rK   r   r  r  r  s   &&&  rC   r  CshActivator._update_prompt  s[    8R("$)),C"D"VVBII&=>VLF/8	
rF   rA   r  rA   rF   rC   r  r    s    88L
C"v#3>ROL "N&O6<2/M L5;1O 	
rF   r  c                      ] tR tRt]'       d   RP
                  MRP
                  tRt]! ]'       d   ]	M]
4      t]'       d   RMRtRtRtR	tR
tRt]t]t]'       d   RMRt]! ]RR4      tRtR R ltRtR# )XonshActivatori  ;r  rO   .batr  Nra   Fz*try:
    del $%s
except KeyError:
    passz
$%s = '%s'z'source-cmd --suppress-skip-message "%s"z+source-bash --suppress-skip-message -n "%s"r  z	conda.xshTc               $    V ^8  d   QhRRRRRR/# r   rA   )rB   s   "rC   rD   XonshActivator.__annotate__  s&     G GS G G GrF   c                	H    V P                   WP                  V4      3,          # rH   )r7   r0   r   s   &&&rC   r    XonshActivator.template_path_var  s!    !!S*>*>u*E$FFFrF   rA   )r  r  r  r  r   r   r.   r/   r  r  r  r0   r1   r3   r4   r=   r5   r6   r7   r8   r9   r   r   r:   r<   r   r  rA   rF   rC   r  r    s    %388388L
C"%+!O
 "(vUL!DN"O#M"L  	2:  .EG GrF   r  c                     a  ] tR tRtRP                  tRt]! ]4      t	Rt
RtRtRtRtR	t]t]tR
tRtRtR tR R ltR V 3R lltRtV ;t# )CmdExeActivatori  r  rP   r  z.envra   Fz%s=z%s=%sz_CONDA_SCRIPT=%sNc                	    \         P                  ! R R4      p\         P                  ! R4      pV'       d-   \        P                  ! \        P                  ! V4      RV4      pW#,           VR &   R# )PROMPTr`   r   N)r   r   r  r  r  r  s   &&&  rC   r  CmdExeActivator._update_prompt  sN    8R("$)),C"D"VVBII&=>VLF2;rF   c                   V ^8  d   QhRR/# r   rA   )rB   s   "rC   rD   CmdExeActivator.__annotate__  s       rF   c                	    R # rH   rA   rx   s   &rC   r   CmdExeActivator._hook_preamble  s     	rF   c                    V ^8  d   QhRRRR/# r  rA   )rB   s   "rC   rD   r    s      # # rF   c                	\   < \         SV `  V4      pR \        V4      9   d   \        R4      hV# )^zrCannot activate environments with '^' in their path from cmd.exe.
Use PowerShell or a caret-free environment path.)superr   r-   r   )rK   rq   r  	__class__s   && rC   r   CmdExeActivator._resolve_prefix  s9    ();<#f+!C  rF   rA   )r  r  r  r  r   r.   r/   r  r  r0   r1   r3   r4   r=   r5   r6   r7   r8   r9   r:   r<   r  r   r   r  __classcell__r  s   @rC   r  r    sm    88L
C">2OL!
 NO#M"L(O<
 rF   r  c                      ] tR tRtRP                  tRt]! ]'       d   ]	M]
4      tRtRtRtRtRtR	t]'       d   R
M]tRtRt]! ]RRRRR4      tRtRtR# )FishActivatori	  z" "rO   z.fishNr  Tzset -e %s || truezset -gx %s "%s"zset -gx %s (cygpath "%s")zset -g %s "%s"r  r  rz  fishzconf.dz
conda.fishrA   )r  r  r  r  r   r.   r/   r  r   r   r  r0   r1   r3   r4   r=   r5   r6   r7   r8   r9   r   r   r:   r<   r  rA   rF   rC   r  r  	  sy    ::L
C"v#3>ROL (N'O39/M#L#O rF   r  c                     a  ] tR tRt]'       d   RP
                  MRP
                  t]'       d   RMRt]! ]	4      t
RtRtRtR	tR
tRt]t]tRt]! ]RRR4      tRtR V 3R lltR R ltRtV ;t# )PowerShellActivatori#  r  r  rP   rO   z.ps1Nra   Fz$Env:%s = $nullz$Env:%s = "%s"r  r  rA  zconda-hook.ps1Tc                   V ^8  d   QhRR/# r?   r   r-   rA   )rB   s   "rC   rD    PowerShellActivator.__annotate__:  s     J J JrF   c                	x   < R \         P                   R2p\        SV `  4       V,           V P                  ,           # )z"$CondaModuleArgs = @{ChangePs1 = $})r   r  r  r   r4   )rK   module_argsr  s   & rC   r   "PowerShellActivator._hook_preamble:  s6    ;G<M<M;NbQw%'+58I8IIIrF   c                   V ^8  d   QhRR/# r  rA   )rB   s   "rC   rD   r  >  s     1 1 1rF   c                	    R # )zRemove-Variable CondaModuleArgsrA   rx   s   &rC   r   #PowerShellActivator._hook_postamble>  s    0rF   rA   )r  r  r  r  r   r   r.   r/   r  r  r0   r1   r3   r4   r=   r5   r6   r7   r8   r9   r   r   r:   r<   r   r   r  r  r  s   @rC   r  r  #  s    %388388L$cC">2OL!&N&O#M"LO	 J J1 1rF   r  c                  8    ] tR tRtRt]tRt]tR t	R t
R tRtR# )JSONFormatMixiniB  zPReturns the necessary values for activation as JSON, so that tools can use them.Nc                	"    \         P                  # rH   )r   rS   rx   s   &rC   r   JSONFormatMixin._hook_preambleI  s    ***rF   c                	X   / pV F  pVP                  V4       K  	  TpVf   \        P                  ! V^R7      # V'       dB   \        RVRR7      ;_uu_ 4       p\        P                  ! W4       R R R 4       VP
                  # \        4       h  + '       g   i     XP
                  # ; i)N)indentrb   Frc   )r  r   dumpsr   dumpr[   rh   )rK   r)   ri   merged_cmdsrk   s   &&&   rC   rl   JSONFormatMixin._finalizeL  s    EMM%   ;::hq11'SGG2 		(' H 77N%'' HG 77Ns   BB)	c              #  	x  "   VP                  R / 4      pVP                  R/ 4      pRV9   d7   VP                  R. 4      pVP                  VP                  R4      4       WBR&   RVRRVRVP                  RR4      RVP                  R	/ 4      /R
RVP                  RR4      RVP                  RR4      //x  R# 5i)r   rZ   r   r,  varsexportunsetrY   r   r   scriptsr&   r   r'   r   NrA   )r   rT   r  )rK   r   r,  rZ   r  s   &&   rC   rs   JSONFormatMixin._yield_commands]  s      }}]B/mmM26[ xx+HOOKOOF34#L D+|R8y}}Z4
 IMM*<bAimm,@"E
 	
s   B8B:rA   )r  r  r  r  __doc__r   r.   r3   r4   r   rl   rs   r  rA   rF   rC   r  r  B  s$    ZLL+("
rF   r  posixashbashdashzshcshtcshxonshzcmd.exer  
powershellzdict[str, type[_Activator]]activator_mapr   c                    V P                  R4      pV^ ,          VR,          r2\        V,          .pV F  pVP                  \        V,          4       K!  	  \	        R\        \        V4      4      / 4      pV# )a  Dynamically construct the activator class.

Detect the base activator and any number of formatters (appended using '+' to the base name).
For example, `posix+json` (as in `conda shell.posix+json activate`) would use the
`PosixActivator` base class and add the `JSONFormatMixin`.
+:   NN	Activator)r)  r  rR   formatter_maptyperI   reversed)r  	shell_etc	activator
formattersbasesr  clss   &      rC   _build_activator_clsr     sg     C I%aL)B-z9%&E]1%&  {E(5/2B
7CJrF   )L__conditional_annotations__r	  
__future__r   abcr   r  r  loggingr   os.pathr   r   r   r   r   r	   r
   r   pathlibr   typingr   r`   r   auxlib.compatr   base.constantsr   r   r   r   base.contextr   r   common.compatr   common.pathr   r  r   r   r   common.serializer   
exceptionsr   r   r   r   r    r!   collections.abcr"   r#   r$   r  logcompiler%   r  r   ABCMetar,   r  r  r  r  r  r  r  r  r  r  r  r   )r!  s   @rC   <module>r3     s   # 
 	 	 
 	 	 	    ! 1  9 ! 8 H H "  2 +-::*,   ."
KJ'+l+ N3;; Nb1B*
Z *
Z#
: #
LGZ G<(j (VJ 41* 1>1
j 1
j ^	>
N
N	>	<
L^
M%.*  O
rF   