+
    i^                    `  a  0 t $ ^ RIHt ^ RIt^ RIt^ RIt^ RIHtHt ^RI	H
t
HtHtHtHtHtHtHtHt ^RIHtHt ^RIHt ^RIHtHtHtHtHt ]'       d   ^ RIHtH t H!t! ^R	I"H#t#H$t$ ^R
I%H&t& Rt'R](R&   R R lt) ! R R]]]
]3,          4      t* ! R R]]]
]3,          4      t+R R lt,R# )    )annotationsN)TYPE_CHECKINGGeneric)	CTKTRTDirectedGraphIterableViewIteratorMappingRequirementInformationStatebuild_iter_view)AbstractResolverResult)	Criterion)InconsistentCandidateRequirementsConflictedResolutionImpossibleResolutionTooDeepResolverException)
CollectionIterableMapping)AbstractProvider
Preference)BaseReporterg?float_OPTIMISTIC_BACKJUMPING_RATIOc                    V ^8  d   QhRRRR/# )   stateState[RT, CT, KT]returnResult[RT, CT, KT] )formats   "r/home/wkmabra/.openclaw/workspace/venv/lib/python3.14/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py__annotate__r(   &   s      * /A     c                   V P                   pVP                  4        UUu/ uF  w  r#\        V4      VbK  	  pppR V\        R 4      &   \        4       pVP	                  R 4       R 0pV P
                  P                  4        F  w  rx\        V P
                  WtV4      '       g   K$  Wu9  d   VP	                  V4       VP                  4        F>  p	 V\        V	4      ,          p
Y9  d   TP	                  T
4       TP                  Y4       K@  	  K  	  \        VP                  4        UUu/ uF  w  r#W&9   g   K  W#bK  	  uppVV P
                  R7      # u uppi   \         d     K  i ; iu uppi )N)mappinggraphcriteria)r+   itemsidr	   addr-   _has_route_to_rootiter_parentKeyErrorconnectr   )r!   r+   kvall_keysr,   	connectedkey	criterionppkeys   &          r'   _build_resultr=   &   s4   mmG;B==?%K?41beQh?H%KHRX&3oE	IIdO!%I....0!%..#KKIIcN&&(A1  		$MM$$ ) 1 ")--/D/$!Q^/D + &L   Es#   EE)
E+
8E+
E('E(c                      ] tR t^DtRtR R lt]R R l4       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 R ltR R ltR R ltR R ltR R ltR tR!# )"
ResolutionzStateful resolution object.

This is designed as a one-off object that holds information to kick start
the resolution process, and holds the results afterwards.
c               $    V ^8  d   QhRRRRRR/# )r    providerzAbstractProvider[RT, CT, KT]reporterzBaseReporter[RT, CT, KT]r#   Noner%   )r&   s   "r'   r(   Resolution.__annotate__K   s(     8 8.8 +8 
	8r)   c                	^    Wn         W n        . V n        \        V n        R V n        R V n        R # N)_p_r_statesr   _optimistic_backjumping_ratio_save_states_optimistic_start_round)selfrA   rB   s   &&&r'   __init__Resolution.__init__K   s0    
 02 .K*<@37$r)   c                   V ^8  d   QhRR/# )r    r#   r"   r%   )r&   s   "r'   r(   rD   Z   s     1 1( 1r)   c                	h     V P                   R,          #   \         d   p\        R4      ThRp?ii ; i)   r!   N)rI   
IndexErrorAttributeError)rM   es   & r'   r!   Resolution.stateY   s3    	1<<## 	1 )q0	1s    1,1c                   V ^8  d   QhRR/# r    r#   rC   r%   )r&   s   "r'   r(   rD   `   s     # # #r)   c                    V P                   R,          p\        VP                  P                  4       VP                  P                  4       VP
                  R,          R7      pV P                   P                  V4       R# )zqPush a new state into history.

This new state will be used to hold resolution results of the next
coming round.
NNNr+   r-   backtrack_causesNrS   )rI   r   r+   copyr-   r]   append)rM   baser!   s   &  r'   _push_new_stateResolution._push_new_state`   s^     ||BLL%%']]'')!2215

 	E"r)   c               (    V ^8  d   QhRRRRRRRR/# )	r    r-   dict[KT, Criterion[RT, CT]]requirementr   parentz	CT | Noner#   rC   r%   )r&   s   "r'   r(   rD   n   s2     *) *)-*) *) 	*)
 
*)r)   c           
     	   V P                   P                  W#R 7       V P                  P                  VR7      pVP	                  V4      pV'       d   \        VP                  4      pM. pV P                  P                  V\        V\        P                  ! R4      WB./4      \        V\        P                  ! R4      WF/4      R7      pV'       d1   \        VP                  4      pVP                  \        W#4      4       M\        W#4      .p\        \!        V4      VVR7      pVP"                  '       g   \%        V4      hWQV&   R# ))re   rf   )requirement_or_candidateiter_requirementincompatibilities
identifierrequirementsrj   
candidatesinformationrj   N)rH   adding_requirementrG   identifygetlistrj   find_matchesr   operatormethodcaller
attrgetterrp   r_   r   r   r   ro   r   )	rM   r-   re   rf   rl   r:   rj   matchesrp   s	   &&&&     r'   _add_to_criteriaResolution._add_to_criterian   s'    	""{"JWW%%{%K
LL,	 $Y%@%@ A "''&&!(%%&89]+
 .##$78/ ' 
 y445K5kJK1+FGK&w/#/
	
 ###(33(r)   c               $    V ^8  d   QhRRRRRR/# )r    r-   rd   parentszCollection[KT]r#   rC   r%   )r&   s   "r'   r(   rD      s$      3>L	r)   c           
     D   V'       g   R# VP                  4        F|  w  r4\        VP                  VP                   Uu. uF?  pVP                  e-   V P
                  P                  VP                  4      V9  g   K=  VNKA  	  upVP                  4      W&   K~  	  R# u upi )a/  Remove information from parents of criteria.

Concretely, removes all values from each criterion's ``information``
field that have one of ``parents`` as provider of the requirement.

:param criteria: The criteria to update.
:param parents: Identifiers for which to remove information from all criteria.
N)r.   r   ro   rp   rf   rG   rr   rj   )rM   r-   r}   r9   r:   rp   s   &&&   r'   !_remove_information_from_criteria,Resolution._remove_information_from_criteria   s     &nn.NC%$$ (1'<'<'<#**277++K,>,>?wN	  K'< ++HM /s   :B=Bc                    V ^8  d   QhRRRR/# )r    namer   r#   r   r%   )r&   s   "r'   r(   rD      s     
 
B 
: 
r)   c                	Z   V P                   P                  VV P                  P                  \	        V P                  P
                  \        P                  ! R 4      4      \	        V P                  P
                  \        P                  ! R4      4      V P                  P                  R7      # )ro   rp   )rl   resolutionsro   rp   r]   )	rG   get_preferencer!   r+   r   r-   rv   rx   r]   )rM   r   s   &&r'   _get_preferenceResolution._get_preference   s    ww%%

**&

####L1 (

####M2 "ZZ88 & 
 	
r)   c               $    V ^8  d   QhRRRRRR/# )r    r   r   r:   zCriterion[RT, CT]r#   boolr%   )r&   s   "r'   r(   rD      s$     

 



#4

	

r)   c                	  a a  S P                   P                  V,          o\        ;QJ d.    TT 3R lTP	                  4        4       F  '       d   K   R # 	  R# ! TT 3R lTP	                  4        4       4      #   \         d     R # i ; i)Fc              3  ^   <"   T F"  pSP                   P                  VSR 7      x  K$  	  R# 5i)re   	candidateNrG   is_satisfied_by).0rcurrent_pinrM   s   & r'   	<genexpr>8Resolution._is_current_pin_satisfying.<locals>.<genexpr>   s/      
1 GG##[#II1   *-T)r!   r+   r3   allri   )rM   r   r:   r   s   f&&@r'   _is_current_pin_satisfying%Resolution._is_current_pin_satisfying   s    	**,,T2K s 
//1
ss 	
s 	
s 
//1
 
 	
  		s   A9 9BBc                    V ^8  d   QhRRRR/# )r    r   r   r#   rd   r%   )r&   s   "r'   r(   rD      s      r 6Q r)   c                	    V P                   P                  P                  4       pV P                  P	                  VR 7       F  pV P                  W#VR7       K  	  V# )r   rf   )r!   r-   r^   rG   get_dependenciesrz   )rM   r   r-   re   s   &&  r'   _get_updated_criteria Resolution._get_updated_criteria   sO    ::&&++-7733i3HK!!(	!J Ir)   c                    V ^8  d   QhRRRR/# )r    r   r   r#   list[Criterion[RT, CT]]r%   )r&   s   "r'   r(   rD      s     # #b #5L #r)   c                	&  a a S P                   P                  V,          p. pVP                   EF  o S P                  S4      p\        ;QJ d.    TT 3R lTP                  4        4       F  '       d   K   RM#	  RM! TT 3R lTP                  4        4       4      pT'       g   \        ST4      hS P
                  P                  SR7       S P                   P                  P                  T4       S P                   P                  P                  TR 4       SS P                   P                  T&   . u # 	  V#   \         dN   pS P
                  P                  TP                  S4       TP                  TP                  4        R p?EK]  R p?ii ; i)Nc              3  ^   <"   T F"  pSP                   P                  VSR 7      x  K$  	  R# 5ir   r   )r   r   r   rM   s   & r'   r   7Resolution._attempt_to_pin_criterion.<locals>.<genexpr>   s/      5A ''A'KK5r   FTr   )r!   r-   ro   r   r   rH   rejecting_candidater:   r_   r   ri   r   pinningupdater+   pop)rM   r   r:   causesr-   rV   	satisfiedr   s   f&     @r'   _attempt_to_pin_criterion$Resolution._attempt_to_pin_criterion   s6   JJ''-	*,"--I55i@  "335 "335 I +IyAAGGOOiO0JJ&&x0 JJ""4.'0DJJt$I7 .> 9 * ++AKKCakk*s   D88FAFFc                    V ^8  d   QhRRRR/# )r    incompatibilities_from_brokenzlist[tuple[KT, list[CT]]]r#   r   r%   )r&   s   "r'   r(   rD      s     ! !-F!	!r)   c                	p   V EF  w  r#V'       g   K   V P                   P                  V,          pT P                  P	                  T\        T P                   P                  \        P                  ! R 4      4      \        T P                   P                  \        P                  ! R4      Y#/4      R7      p\        T4      pT'       g    R# TP                  TP                  4       \        T\        TP                  4      TR7      T P                   P                  T&   EK  	  R#   \         d     EK1  i ; i)ri   rj   rk   Frn   T)r!   r-   r3   rG   ru   r   rv   rw   rx   r   extendrj   r   rt   rp   )rM   r   r5   rj   r:   ry   ro   s   &&     r'   _patch_criteriaResolution._patch_criteria   s   
 %B A$ JJ//2	 gg**,JJ''))*<= #2JJ''''(;<*# + G ,;7+CJ$$Y%@%@A%.% !6!67"3&DJJ"/ %B8 /  s   D%%D54D5c                   V ^8  d   QhRR/# rY   r%   )r&   s   "r'   r(   rD     s     
 
T 
r)   c           	        V P                   fq   V P                   Uu. uFR  p\        VP                  P	                  4       VP
                  P	                  4       VP                  R,          R7      NKT  	  upV n         R# R# u upi )zCSave states for potential rollback if optimistic backjumping fails.Nr[   r\   )rK   rI   r   r+   r^   r-   r]   )rM   ss   & r'   _save_stateResolution._save_state  sq    $ ! &A IINN,ZZ__.%&%7%7%:
 &!D %!s   ABc                   V ^8  d   QhRR/# rY   r%   )r&   s   "r'   r(   rD   *  s     % %$ %r)   c                l    RV n         V P                  '       d   V P                  V n        RV n        R# R# )z3Rollback states and disable optimistic backjumping.g        N)rJ   rK   rI   )rM   s   &r'   _rollback_statesResolution._rollback_states*  s0    -0*,,DL $D r)   c                    V ^8  d   QhRRRR/# )r    r   $list[RequirementInformation[RT, CT]]r#   r   r%   )r&   s   "r'   r(   rD   1  s     i i D i ir)   c                   \         P                  ! R V 4       R V 4       4      pV Uu0 uF  q0P                  P                  V4      kK  	  pp\	        V P
                  4      ^8  Ed   V P
                  R V P                  p  V P
                  P                  4       pVP                  P                  4       w  rgT P                  '       g   Yd9  d   MT P                  '       d%   T P                  f   Yd9  d   T P                  4        T P                  P!                  T4       Uu0 uF  qP                  P                  T4      kK  	  p	pT	P#                  T4      '       g   M;TP                  '       g   M(\	        T P
                  4      ^8:  g   EK  \        T4      hTP$                  P'                  4        U
Uu. uF  w  rT
\)        TP*                  4      3NK  	  pp
pTP-                  Yg.34       T P/                  4        T P1                  T4      pT'       g   EK  R# R# u upi   \        \        3 d    \        T4      Rhi ; iu upi u upp
i )ar  Perform backjumping.

When we enter here, the stack is like this::

    [ state Z ]
    [ state Y ]
    [ state X ]
    .... earlier states are irrelevant.

1. No pins worked for Z, so it does not have a pin.
2. We want to reset state Y to unpinned, and pin another candidate.
3. State X holds what state Y was before the pin, but does not
   have the incompatibility information gathered in state Y.

Each iteration of the loop will:

1.  Identify Z. The incompatibility is not always caused by the latest
    state. For example, given three requirements A, B and C, with
    dependencies A1, B1 and C1, where A1 and B1 are incompatible: the
    last state might be related to C, so we want to discard the
    previous state.
2.  Discard Z.
3.  Discard Y but remember its incompatibility information gathered
    previously, and the failure we're dealing with right now.
4.  Push a new state Y' based on X, and apply the incompatibility
    information from Y to Y'.
5a. If this causes Y' to conflict, we need to backtrack again. Make Y'
    the new Z and go back to step 2.
5b. If the incompatibilities apply cleanly, end backtracking.
c              3  X   "   T F   qP                   f   K  VP                   x  K"  	  R # 5irF   r   r   cs   & r'   r   'Resolution._backjump.<locals>.<genexpr>Q  s     >v!XQXXvs   **c              3  8   "   T F  qP                   x  K  	  R # 5irF   )re   r   s   & r'   r   r   R  s     +Fq]]Fs   TNFrS   )	itertoolschainrG   rr   lenrI   r!   r   r+   popitemrT   r3   r   rJ   rK   r   r   
isdisjointr-   r.   rt   rj   r_   ra   r   )rM   r   incompatible_reqsr   incompatible_depsbroken_stater   r   dcurrent_dependenciesr5   r6   r   successs   &&            r'   	_backjumpResolution._backjump1  s    > 09>v>+F+0
 ;LL:KQWW--a0:KL$,,1$R   ::LA#'<<#3#3#5L&2&:&:&B&B&DOD
 :::5 
 666))15$$& 261I1I)1T(1TAGG$$Q'1T % ( ,667HII
 $+++ t||$).v66 <H;P;P;V;V;X-;X41D,,-.;X * -
 *00$1DE  "**+HIG w M M #H- A.v6D@A.("-s   #H$6H) '#I
<"I)Ic                    V ^8  d   QhRRRR/# )r    criteronr   r#   r   r%   )r&   s   "r'   r(   rD     s      R R/R	-Rr)   c           
         \        V UUu/ uF!  q"P                   F  p\        V4      VbK  	  K#  	  uppP                  4       4      # u uppi )z5Extract causes from list of criterion and deduplicate)rt   rp   r/   values)rM   r   r   is   &&  r'   _extract_causesResolution._extract_causes  s<     xGx!ARUAXUxGNNPQQGs   'A
c               $    V ^8  d   QhRRRRRR/# )r    rm   Iterable[RT]
max_roundsintr#   r"   r%   )r&   s   "r'   r(   rD     s'     N, N,L N,c N,FW N,r)   c                	
   V P                   '       d   \        R 4      hV P                  P                  4        \	        \
        P                  ! 4       / . R7      .V n         V F,  p V P                  V P                  P                  VRR7       K.  	  V P                  4        RpRp\        V4       EF(  pV P                  P!                  VR7       V P"                  '       dt   V P$                  ef   Vf?   Tp\'        W',
          V P"                  ,          4      pV^ 8:  d   V P)                  4        K  M#Ve    Wv,
          V8  d   V P)                  4        K  V P                  P                  P+                  4        UU	u. uF   w  rV P-                  W4      '       d   K  VNK"  	  p
pp	V
'       g5   V P                  P/                  V P                  R7       V P                  u # \1        V P                  P                  P3                  4       4      \1        V
4      ,
          p\5        V
4      ^8  d   \7        V P8                  P;                  V
V P                  P<                  \?        V P                  P                  \@        PB                  ! R4      4      \?        V P                  P                  \@        PB                  ! R4      4      V P                  PD                  R7      4      pMT
pV'       g   \        R	4      h\5        V4      ^8  d   \G        WPH                  R
7      pM	V^ ,          pV PK                  V4      pV'       d   V PM                  V4      pV P                  PO                  VR7        V PQ                  V4      p\S        V'       * ;'       d!    V P"                  ;'       d    V P$                  4      pT'       d$   T P$                  '       d   T P)                  4        MYP                  PD                  R&   X'       g    \        T P                  PD                  4      hMV P                  P                  P+                  4        UU	u0 uF(  w  rW9   g   K  V P-                  W4      '       d   K&  VkK*  	  ppp	V PU                  V P                  P                  V4       V P                  4        V P                  PW                  WpP                  R7       EK+  	  \Y        V4      h  \         d&   p\        TP                  P                  4      ThRp?ii ; iu up	pi   \         d,    T P"                  '       d   T P$                  '       d   Rp ELh i ; iu up	pi )zalready resolvedr\   Nr   )index)r!   ro   rp   )identifiersr   ro   rp   r]   z-narrow_requirement_selection returned 0 names)r9   )r   Tr[   )r   r!   )-rI   RuntimeErrorrH   startingr   collectionsOrderedDictrz   r!   r-   r   r   r:   rp   ra   rangestarting_roundrJ   rK   r   r   r.   r   endingsetkeysr   rt   rG   narrow_requirement_selectionr+   r   rv   rx   r]   minr   r   r   resolving_conflictsr   r   r   ending_roundr   )rM   rm   r   r   rV   optimistic_rounds_cutoff"optimistic_backjumping_start_roundround_indexr9   r:   unsatisfied_namessatisfied_namesnarrowed_unstatisfied_namesr   failure_criterionr   r   failed_optimistic_backjumpingnewly_unsatisfied_namess   &&&                r'   resolveResolution.resolve  s   <<<122 #//1!#
 AK%%djj&9&91T%J  	 04 9=* ,KGG"""5 111d6G6G6S5=9D6/2#1T5W5WW0, 014--/  5 .9#H34 --/  '+jj&9&9&?&?&A!&ANC66sF &A  ! %TZZ0zz! "$**"5"5":":"<=DU@VVO$%).2GG88$5$(JJ$6$6#2 JJ//$//=$ %4 JJ//$//>% *.)D)D 9 /+  /@+ /"#RSS ./!36<P<PQ215 $ > >t D --.?@ ++6+:"nnV4G 59# . . >>. . --51 1T5F5F5F))+5;JJ//2 #24::3N3NOO # +/***=*=*C*C*E+*E-  !;;CK C*E ( + 66JJ'')@ $$&GG  {** E_ -b  
++{ * K*1;;+B+BCJKD!l , 999d>O>O>O8<5	.+sT   %(S(<TT0T!
UU3U(T3 TT!U>UUU)rJ   rL   rG   rH   rK   rI   N)__name__
__module____qualname____firstlineno____doc__rN   propertyr!   ra   rz   r   r   r   r   r   r   r   r   r   r   r   __static_attributes__r%   r)   r'   r?   r?   D   sn    8 1 1#*)X6


#J!F
%iVRN, N,r)   r?   c                  .    ] tR tRtRt]tRR R lltRtR# )Resolveri3  z3The thing that performs the actual resolution work.c               $    V ^8  d   QhRRRRRR/# )r    rm   r   r   r   r#   r$   r%   )r&   s   "r'   r(   Resolver.__annotate__8  s(     "$ "$""$ "$ 
	"$r)   c                |    \        V P                  V P                  4      pVP                  WR7      p\	        V4      # )af  Take a collection of constraints, spit out the resolution result.

The return value is a representation to the final resolution result. It
is a tuple subclass with three public members:

* `mapping`: A dict of resolved candidates. Each key is an identifier
    of a requirement (as returned by the provider's `identify` method),
    and the value is the resolved candidate.
* `graph`: A `DirectedGraph` instance representing the dependency tree.
    The vertices are keys of `mapping`, and each edge represents *why*
    a particular package is included. A special vertex `None` is
    included to represent parents of user-supplied requirements.
* `criteria`: A dict of "criteria" that hold detailed information on
    how edges in the graph are derived. Each key is an identifier of a
    requirement, and the value is a `Criterion` instance.

The following exceptions may be raised if a resolution cannot be found:

* `ResolutionImpossible`: A resolution cannot be found for the given
    combination of requirements. The `causes` attribute of the
    exception is a list of (requirement, parent), giving the
    requirements that could not be satisfied.
* `ResolutionTooDeep`: The dependency tree is too deeply nested and
    the resolver gave up. This is usually caused by a circular
    dependency, but you can try to resolve this by increasing the
    `max_rounds` argument.
)r   )r?   rA   rB   r   r=   )rM   rm   r   
resolutionr!   s   &&&  r'   r   Resolver.resolve8  s7    @  t}}=
""<"GU##r)   r%   N)d   )	r   r   r   r   r   r   base_exceptionr   r   r%   r)   r'   r   r   3  s    =&N"$ "$r)   r   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r    r-   zMapping[KT, Criterion[RT, CT]]r9   z	KT | Noner7   zdict[int, KT | None]r8   zset[KT | None]r#   r   r%   )r&   s   "r'   r(   r(   ]  s:      ,	 # 	
 
r)   c                6   W9   d   R # W9  d   R# Vf   Q hW,          P                  4        FV  p V\        V4      ,          pYS9   d   TP                  T4        R # \	        YY#4      '       g   KD  TP                  T4        R # 	  R#   \         d     Kj  i ; i)TF)r2   r/   r3   r0   r1   )r-   r9   r7   r8   r;   r<   s   &&&&  r'   r1   r1   ]  s     
??]&&(	BqE?D MM#hhBBMM# )   		s   B		BB)-__conditional_annotations__
__future__r   r   r   rv   typingr   r   structsr   r   r   r	   r
   r   r   r   r   abstractr   r   r:   r   
exceptionsr   r   r   r   r   collections.abcr   r   r   	providersr   r   	reportersr   r   __annotations__r=   r?   r   r1   )r	  s   @r'   <module>r     s    " "    )
 
 
 /    ==8('* u *<l,R$ l,^'$B
+ '$Tr)   