+
    ~{Mj                       ^ RI Ht ^ RIHt ^ RIHtHt ^ RI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 ]'       d   ^ R
IHt Rt]P0                  ! ]4      P2                  tR R ltR R ltR R ltR R ltR R ltR# )    )annotations)TYPE_CHECKING)	TokenInfoTokenNotFoundError)context)
SubdirData)Channel)	MatchSpec)PackageRecord)CONFIG_STEP
LOGIN_STEPChannelGuideBox)Iterablez'https://repo.anaconda.cloud/repo/main-xc                   V ^8  d   QhRR/# )   returnbool )formats   "=lib/python3.14/site-packages/anaconda_channel_guide/plugin.py__annotate__r      s      d     c                 t     \         P                  ! 4       p V P                  '       * #   \         d     R# i ; i)zChecks if the user is authenticated via anaconda-auth.

Attempts to load the token. Returns False if no token
is found or if the token has expired.

:returns: True if the user has a valid (non-expired) token, False otherwise
F)r   loadexpiredr   )
token_infos    r   is_logged_inr      s4    ^^%
%%%% s   %( 77c                    V ^8  d   QhRRRR/# )r   channelsIterable[str]r   r   r   )r   s   "r   r   r   )   s     K K= KT Kr   c                    \         ;QJ d&    R T ;'       g    R 4       F  '       g   K   R# 	  R# ! R T ;'       g    R 4       4      # )zChecks if the main-x channel is configured in the user's conda setup.

:param channels: Channel names or URLs active for the current command
:returns: True if main-x is in the configured channels, False otherwise
c              3  8   "   T F  p\        V4      x  K  	  R # 5i)N)is_main_x_channel).0channels   & r   	<genexpr>'is_main_x_configured.<locals>.<genexpr>/   s     J.g )).s   TFr   )any)r   s   &r   is_main_x_configuredr)   )   s=     3J(..b.J33J3J3J(..b.JJJr   c                    V ^8  d   QhRRRR/# )r   r%   strr   r   r   )r   s   "r   r   r   2   s      s t r   c                `     \        V 4      P                  \        8H  #   \         d     R # i ; i)F)r	   canonical_nameMAIN_X_CHANNEL_NAME	Exception)r%   s   &r   r#   r#   2   s0    w..2EEE s    --c               $    V ^8  d   QhRRRRRR/# )r   packagesz)Iterable[MatchSpec | PackageRecord | str]subdirsr    r   r   r   )r   s   "r   r   r   9   s&     # #7## 
#r   c           	         . pV  Ff  p\        V\        4      '       d    R# \        V\        4      '       d   \        V4      MTpVP	                  R4      e    R# VP                  V4       Kh  	  \        P                  ! RR4      ;_uu_ 4        V F2  p\        P                  ! V\        .VR7      '       d   K)   RRR4       R# 	  RRR4       R#   + '       g   i     R# ; i  \         d     R# i ; i)a  Checks whether all of the given packages are available on the main-x channel.

Normalizes package specs before querying: version constraints are stripped
so we check by name only, and specs pinned to a non-main-x channel are
rejected immediately.

:param packages: Package specs to check (names, match specs, or records)
:returns: True if every package is available on main-x, False otherwise
Fr%   Nuse_index_cacheT)r   r2   )
isinstancer   r+   r
   get_exact_valueappendr   	_overrider   	query_allMAIN_X_CHANNEL_URLr/   )r1   r2   specspackagespecs   &&   r   is_available_on_main_xr>   9   s    G '=11)3GS)A)A9W%wD##I.:LL   0$77!++D<N;OY`aa  87 8  87   sL   C& 7C& 4C& 'C;C<C& CC& C#	C& #C& &C54C5c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   missing_packagesz%list[str | MatchSpec | PackageRecord]main_x_configuredr   authenticatedr2   r    r   zChannelGuideBox | Noner   )r   s   "r   r   r   _   s:     4 4;44 4 	4
 4r   c                    V '       g   R# V'       d   V'       d   R# \        W4      '       g   R# . pV'       g   VP                  \        4       V'       g   VP                  \        4       \	        W4      # )a  Handles a PackageNotFoundError by checking if missing packages
are available on main-x and guiding the user on what to do next.

:param missing_packages: List of package names that triggered the PNFE
:param main_x_configured: True if the main-x channel is already in the user's config
:param authenticated: True if the user is currently logged in
:param subdirs: List of subdirectories to check for availability
:returns: A ChannelGuideBox object if action is needed,
    None to fall through to default PNFE behavior
N)r>   r7   r   r   r   )r@   rA   rB   r2   stepss   &&&& r   handle_pnferE   _   sQ      *!"2<<EZ [!+33r   N) 
__future__r   typingr   anaconda_auth.tokenr   r   conda.base.contextr   conda.core.subdir_datar   conda.models.channelr	   conda.models.match_specr
   conda.models.recordsr   anaconda_channel_guide.boxr   r   r   collections.abcr   r:   from_urlr-   r.   r   r)   r#   r>   rE   r   r   r   <module>rQ      sj    "   = & - ( - .  ( ? &&'9:II K#L4r   