+
    	iI                         ^ RI t ^ RIHt ^ RIHt ^ RIHt ^RIHt ^RIH	t	 ] P                  ! R4      P                  tRR lt ! R	 R
4      tR tR tR# )    N)urlparse)	parse_nth)ascii_lower)parser)SelectorErrorz	[^ 	
]+c                j    \         P                  ! W4       Uu. uF  p\        V4      NK  	  up# u upi )ab  Compile a (comma-separated) list of selectors.

:param input:
    A string, or an iterable of tinycss2 component values such as
    the :attr:`tinycss2.ast.QualifiedRule.prelude` of a style rule.
:param namespaces:
    A optional dictionary of all `namespace prefix declarations
    <http://www.w3.org/TR/selectors/#nsdecl>`_ in scope for this selector.
    Keys are namespace prefixes as strings, or ``None`` for the default
    namespace.
    Values are namespace URLs as strings.
    If omitted, assume that no prefix is declared.
:returns:
    A list of opaque :class:`compiler.CompiledSelector` objects.

)r   parseCompiledSelector)input
namespacesselectors   && Y/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/cssselect2/compiler.pycompile_selector_listr      s-    " 8>||E7VW7V8X&7VWWWs   0c                   *   a  ] tR t^"t o RtR tRtV tR# )r
   z&Abstract representation of a selector.c                   \        VP                  4      pVR 8H  V n        R\        R\        R\
        /p\        RV,           V/ 4      V n        VP                  V n        VP                  V n	        RV n
        RV n        RV n        RV n        RV n        RV n        VP                  p\!        V\"        P$                  4      '       d   VP&                  pVP(                   EF  p\!        V\"        P*                  4      '       d   VP,                  V n
        K7  \!        V\"        P.                  4      '       d   VP                  V n        Kj  \!        V\"        P0                  4      '       d%   VP                  V n        VP                  V n        K  \!        V\"        P2                  4      '       d   VP                  V n        K  \!        V\"        P4                  4      '       g   EK  VP6                  R8X  g   EK  RV n        EK"  	  R# )	0split_whitespacer   r   zlambda el: NFlangT)_compile_nodeparsed_treenever_matchesr   r   r   evaltestspecificitypseudo_elementid
class_name
local_namelower_local_name	namespacerequires_lang_attr
isinstancer   CombinedSelectorrightsimple_selectors
IDSelectoridentClassSelectorLocalNameSelectorNamespaceSelectorAttributeSelectorname)selfparsed_selectorsourceeval_globalsnodesimple_selectors   &&    r   __init__CompiledSelector.__init__$   s   ::;#s] 0;

 /rB	*66-<< $"'**dF3344::D#44O/6+<+<==)//OV-A-ABB"1"<"<OV-E-EFF"1"<"<(7(H(H%OV-E-EFF!0!:!:OV-E-EFF"''61.2D+  5    )
r   r   r   r   r    r   r   r!   r   r   N)__name__
__module____qualname____firstlineno____doc__r3   __static_attributes____classdictcell__)__classdict__s   @r   r
   r
   "   s     0!3 !3r5   r
   c           
     
   \        V \        P                  4      '       Ed
   \        V P                  4      pVR8X  d   R# VR8X  d?   V P
                  R9   d   RpMV P
                  R9   d   RpM\        R	V P
                  4      hV P
                  R8X  d   R
V R2pM^V P
                  R8X  d   RV R2pMFV P
                  R8X  d   RV R2pM.V P
                  R8X  d   R
V R2pM\        R	V P
                  4      h\        V P                  4      pVR8X  d   R# VR8X  d   V# RV RV R2# \        V \        P                  4      '       d   V P                   U u. uF  p \        V 4      NK  	  up  Uu. uF  pVR8w  g   K  VNK  	  pp\        V4      ^8X  d
   V^ ,          # RV9   d   R# V'       d   RP                  R V 4       4      # R# \        V \        P                  4      '       dn   V P                   U u. uF  p \        V P                  4      NK  	  up  Uu. uF  pVR8w  g   K  VNK  	  ppV'       g   R# RRP                  R V 4       4       R2# \        V \        P                  4      '       d   . pV P                   F  p\        VP                   P                  4      pVR8X  d   K+  VP
                  R8X  d   RpM;VP
                  R8X  d   RpM'VP
                  R8X  d   RpMVP
                  R8X  d   RpVP#                  RV RX R24       K  	  RP                  V4      # \        V \        P$                  \        P&                  34      '       dj   V P                   U u. uF  p \        V P                  4      NK  	  up  Uu. uF  pVR8w  g   K  VNK  	  ppV'       g   R# RP                  R V 4       4      # \        V \        P(                  4      '       dK   V P*                  V P,                  8X  d   R V P,                  : 2# R!V P*                  : R"V P,                  : R2# \        V \        P.                  4      '       d   R#V P0                  : 2# \        V \        P2                  4      '       d   V P4                  : R$2# \        V \        P6                  4      '       d   R%V P8                  : 2# \        V \        P:                  4      '       Ede   V P0                  EeP   V P0                  '       d   V P<                  V P>                  8X  d'   \A        R&V P0                   R'V P<                   24      p	MR&V P0                   R'V P>                   2p
R&V P0                   R'V P<                   2pRV
: R"V: R2p	MSV P<                  V P>                  8X  d   \A        V P<                  4      p	M"V P>                  V P<                  rRV
: R"V: R2p	V PB                  pR(V	 R)2pV PD                  R*J d   VPG                  4       pVR+,          pV PH                  f   V	 R,2# V PH                  R-8X  d   V	 R.V R/V: 2# V PH                  R08X  d?   \        VPK                  4       4      ^8w  g   VPM                  4       V8w  d   R# V: R1V R2# V PH                  R28X  d   V	 R.V R/V: RV R3VR4,           : R2
# V PH                  R58X  d   V'       d
   V R3V: R2# R# V PH                  R68X  d   V'       d
   V R7V: R2# R# V PH                  R88X  d   V'       d	   V: R9V 2# R# \        R:V PH                  4      h\N        h\        V \        PP                  4      '       Ed   V P<                  R9   d3   \S        R=R>R;4      pVR?,          pV P<                  R<8X  d
   VR@,          pV# V P<                  RA8X  d6   \S        RBRCRDRERF4      p\S        RGRHRI4      p\S        R=R>R;4      pRV RJV RKV RL2# V P<                  RM8X  d&   \S        RBRCRDRERF4      p\S        RGRHRI4      pRV RNV RO2# V P<                  RP8X  d!   \S        RCRH4      p\S        RF4      pRV RQV RR2# V P<                  R9   d   R# V P<                  R9   d   RS# V P<                  RT8X  d   RU# V P<                  RV8X  d   RW# V P<                  RX8X  d    RY# V P<                  RZ8X  d    R[# V P<                  R\8X  d   R]# V P<                  R^8X  d    R_# V P<                  R`8X  d   Ra# \        RbV P<                  4      h\        V \        PT                  4      '       Ed   V P<                  Rc8X  Ed   . pV PV                   Uu. uF  pVPX                  R9  g   K  VNK  	  ppV'       d   VP[                  ^ 4      pVPX                  Rd8X  d   VP#                  VP\                  4       MAVPX                  Re8X  d&   VP#                  \_        VPB                  4      4       M\        Rf4      hV'       g   K  VP[                  ^ 4      pVPX                  Rd8w  g   K  VPB                  Rg8w  g   K  \        Rf4      hRP                  Rh V 4       4      # . p. pTpV PV                   F@  pVPX                  Rd8X  d   VPB                  Ri8X  d   VVJ d   TpK/  VP#                  V4       KB  	  V'       d   RP                  Rj \        P`                  ! V4       4       4      pV P<                  Rk8X  d   RlV R2pM^V P<                  Rm8X  d   RnV R2pMFV P<                  Ro8X  d   RpV Rq2pM.V P<                  Rr8X  d   RsV Rq2pM\        RbV P<                  4      hVRtV Ru2,          pMVVJ d   \        RvV P<                   Rw24      hV P<                  Rk8X  d   RxpMRV P<                  Rm8X  d   RypM>V P<                  Ro8X  d   RzpM*V P<                  Rr8X  d   R{pM\        RbV P<                  4      h\c        V4      pVf   \        RvV P<                   Rw24      hVw  ppV^,
          pV^ 8X  d	   RV R|V 2# R}V R~V RV R2# \e        \Y        V 4      V 4      hu up i u upi u up i u upi u up i u upi u upi )zReturn a boolean expression, as a Python source string.

When evaluated in a context where the `el` variable is an
:class:`cssselect2.tree.Element` object, tells whether the element is a
subject of `selector`.

r   1 >zel.parent is not None~+zel.previous is not NonezUnknown combinatorzany((z) for el in el.ancestors)znext(el is not None and (z) for el in [el.parent])z) for el in [el.previous])z!) for el in el.previous_siblings)(z) and ()z and c              3   .   "   T F  pR V R2x  K  	  R# 5irD   rE   N ).0els   & r   	<genexpr> _compile_node.<locals>.<genexpr>   s     DOb!B4q	O   znot (z or c              3   .   "   T F  pR V R2x  K  	  R# 5irG   rH   rI   exprs   & r   rK   rL      s     "K?4QtfA;?rM   zlist(el.iter_subtree())[1:]zel.iter_children()z!list(el.iter_next_siblings())[:1]zel.iter_next_siblings()z(any(z for el in ))c              3   .   "   T F  pR V R2x  K  	  R# 5irG   rH   rO   s   & r   rK   rL      s     C?4QtfA;?rM   zel.local_name == zel.local_name == (z if el.in_html_document else zel.namespace_url == z in el.classesz	el.id == {}zel.etree_element.get(z, "")Fz.lower()z in el.etree_element.attrib=z  in el.etree_element.attrib and z == z~=z in split_whitespace(z|=z.startswith(-z^=z$=z
.endswith(z*=z in zUnknown attribute operatorlink
local-linkaareaz. and el.etree_element.get("href") is not None z5and not urlparse(el.etree_element.get("href")).schemeenabledbuttonr   selecttextareaoptionoptgroupmenuitemfieldsetzS and el.etree_element.get("disabled") is None  and not el.in_disabled_fieldset) or(z3 and el.etree_element.get("disabled") is None) or (z. and el.etree_element.get("href") is not None)disabledzT and (el.etree_element.get("disabled") is not None  or el.in_disabled_fieldset)) or(z2 and el.etree_element.get("disabled") is not None)checkedz and el.etree_element.get("checked") is not None and  ascii_lower(el.etree_element.get("type", ""))   in ("checkbox", "radio")) or (z2 and el.etree_element.get("selected") is not None)zel.parent is Nonezfirst-childzel.index == 0z
last-childz&el.index + 1 == len(el.etree_siblings)zfirst-of-typezKall(s.tag != el.etree_element.tag    for s in el.etree_siblings[:el.index])zlast-of-typezOall(s.tag != el.etree_element.tag    for s in el.etree_siblings[el.index + 1:])z
only-childzlen(el.etree_siblings) == 1zonly-of-typez_all(s.tag != el.etree_element.tag or i == el.index    for i, s in enumerate(el.etree_siblings))emptyz0not (el.etree_children or el.etree_element.text)zUnknown pseudo-classr   r'   stringzInvalid arguments for :lang(),c              3   F   "   T F  pR V: RVR,           : R2x  K  	  R# 5i)zel.lang == z or el.lang.startswith(rV   rE   NrH   )rI   r   s   & r   rK   rL   H  s,      #!D dX%<dSj<LAN!s   !ofc              3   L   "   T F  p\        VP                  4      x  K  	  R # 5iN)r   r   )rI   r   s   & r   rK   rL   W  s&      $A$? "("6"677$?s   "$z	nth-childz)sum(1 for el in el.previous_siblings if (znth-last-childzBsum(1 for el in    tuple(el.iter_siblings())[el.index + 1:]   if (znth-of-typez@sum(1 for s in (      el for el in el.previous_siblings     if (z5))    if s.etree_element.tag == el.etree_element.tag)znth-last-of-typezYsum(1 for s in (      el for el in      tuple(el.iter_siblings())[el.index + 1:]     if (zif (z) else float("nan")zInvalid arguments for :z()zel.indexz%len(el.etree_siblings) - el.index - 1zPsum(1 for s in el.etree_siblings[:el.index]    if s.tag == el.etree_element.tag)zTsum(1 for s in el.etree_siblings[el.index + 1:]    if s.tag == el.etree_element.tag)z) == z/next(r == 0 and n >= 0    for n, r in [divmod((z) - , z)]))r@   rA   )rB   rC   )rW   zany-linkrX   )visitedhoveractivefocuszfocus-withinzfocus-visibletargetztarget-withincurrentpastfutureplayingpausedseeking	bufferingstalledmutedzvolume-lockedz
user-validzuser-invalidhost)rootscope)
whitespacecomment)3r"   r   r#   r   left
combinatorr   r$   CompoundSelectorr%   lenjoinNegationSelectorselector_listr   RelationalSelectorr   appendMatchesAnySelectorSpecificityAdjustmentSelectorr)   r   r   r*   r    r(   r   r&   r'   r+   r,   
lower_namereprvaluecase_sensitiveloweroperatorsplitstripNotImplementedErrorPseudoClassSelectorhtml_tag_eqFunctionalPseudoClassSelector	argumentstypepoplower_valuer   r	   r   	TypeError)r   left_insider   r$   rP   sub_expressionsrelative_selector
expressionelementskeyr   r,   r   attribute_valuer   r   grouprY   r_   langstokentokensnthr   current_listargumentcountresultbBs   &                             r   r   r   H   s    (F3344#HMM2#C""j0.$$
20#$8(:M:MNN   C';-'@AD  C'+K= 9) )    C'+K= 9+ +    C';-'HID 4h6I6IJJhnn-C<c\K ugWTF!,,	Hf55	6	6 !) 9 9; 9H h' 9;;T s{ D ; 	 
 1$"1%%O#<<DODDD	Hf55	6	6 !) 6 68 6H h223 688T s{ D 8 	 
 v{{"K?"KKLANN	Hf77	8	8!)!7!7&'8'A'A'M'MNJS  ++s28"--4/"--4>"--44""U:,k(2#NO "8 {{?++	H%%v'K'KM 
N 
N
 !) 6 68 6H h223 688T s{ D 8 	 
 {{C?CCC	Hf66	7	7$$(;(;;&x':':&=>> %X%>%>$A B//7/B/B.EQHI 
Hf66	7	7%h&8&8%;<<	Hf22	3	3%%(77	Hf//	0	08>>,--	Hf66	7	7)!!!==H$7$77H$6$6#7r(--IJC !3!3 4Bx7J7J6KLE 2 232hmm_EDeY&CD81MC==H$7$77x}}-C"*"5"5x}}4eY&CD81MCNNE 5cU%@O&&%/:-  (9::""c)e;&'tE967 ""d*u{{}-2ekkmu6LCN!9$9/9J!LN ""d*e;&'tE9D&'|US[3DAGH ""d*-.l5)1EE""d*@E'z%!<PKNP""d*<A%$&78JsJ#$@(BSBSTT%%	Hf88	9	9==>>sFF3DDDD}},OOK]]i''8ZCE
J
CEC0AE7 7 3DFG
 ]]j('8ZCE
J
CEE7 7LNO ]]i'4E *FE7 3 (LNO
 ]] ( ( ]]//&]]m+"]]l*;]]o-=> ]]n,AB ]]l*0]]n,@A ]]g%E 6FF	HfBB	C	C==F"E#+#5#5@#5%::%>> #5  @ 

1::(LL!2!23ZZ8+LLU[[!9:'(GHH6"JJqMEzzW,1C+,KLL;; #!# # # CML$..==G+$0F#s*'4 ##H- / || $A$*LL$?$A A ==K/CD6L ]]&66""&r+  ]]m3$$(6 *NN 
 ]]&88$ %)6 *NN  ((>NN4v%899=0'1(--CE E==K/&E]]&66CE]]m3@  ]]&88@  ((>NNs^F~#-hmm_B?A ADAq
 AAAv5'qc**005wd1#Rs#GH
 X11w; 8:8b@sB   q"2	q' q':q,	q1+q1,q6	q;q;r 6r c                     \        V 4      ^8X  d   RV ^ ,           2pRV ^ ,          : RV: R2# RP                  R V  4       4      pRP                  R V  4       4      pRV R	V R
2# )z;Generate expression testing equality with HTML local names.{http://www.w3.org/1999/xhtml}z((el.local_name == z7) if el.in_html_document else (el.etree_element.tag == rQ   rl   c              3   8   "   T F  p\        V4      x  K  	  R # 5irk   r   )rI   ns   & r   rK   html_tag_eq.<locals>.<genexpr>  s     7;a$q'';s   c              3   >   "   T F  p\        R V 24      x  K  	  R# 5i)r   Nr   )rI   r,   s   & r   rK   r     s'      %# 3D6:;;#s   z((el.local_name in (z9)) if el.in_html_document else (el.etree_element.tag in (z))))r   r   )local_namestagnamestagss   *   r   r   r     s    
;10Q0@A!+a.!3 4--0G27	8 		7;77yy %#% % #5' *..2V38	9r5   rk   )reurllib.parser   tinycss2.nthr   webencodingsr    r   r   compilefindallr   r   r
   r   r   rH   r5   r   <module>r      sK    	 ! " $  ! ::o.66 X(#3 #3LQ2h
9r5   