+
    Ĝi'                        R t . RO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 ]]3tRR ltRR ltRR ltR t]P(                  ! R	]P*                  4      P,                  t ! R
 R4      tR tR t ^ RIHt ]P(                  ! R4      P<                  t ]  R t#R#   ] d    ^ RIHtHtH	t	H
t
HtHt ]t Li ; i  ] d
    ^ RIHt  LRi ; i  ]! d    ]"t  LBi ; i)z5External interface to the BeautifulSoup HTML parser.
N)etreehtml)BeautifulSoupTagCommentProcessingInstructionNavigableStringDeclarationDoctype)r   r   r   r   r   r	   c                    \        WV3/ VB # )a  Parse a string of HTML data into an Element tree using the
BeautifulSoup parser.

Returns the root ``<html>`` Element of the tree.

You can pass a different BeautifulSoup parser through the
`beautifulsoup` keyword, and a diffent Element factory function
through the `makeelement` keyword.  By default, the standard
``BeautifulSoup`` class and the default factory of `lxml.html` are
used.
)_parse)databeautifulsoupmakeelementbsargss   &&&,]/Users/mibo/.openclaw/workspace/.venv-ak/lib/python3.14/site-packages/lxml/html/soupparser.py
fromstringr      s     ${=f==    c                    \        V R4      '       g   \        V 4      p \        WV3/ VB p\        P                  ! V4      # )aA  Parse a file into an ElemenTree using the BeautifulSoup parser.

You can pass a different BeautifulSoup parser through the
`beautifulsoup` keyword, and a diffent Element factory function
through the `makeelement` keyword.  By default, the standard
``BeautifulSoup`` class and the default factory of `lxml.html` are
used.
read)hasattropenr   r   ElementTree)filer   r   r   roots   &&&, r   parser   $   s<     4  Dz${=f=DT""r   c                p    \        W4      pVP                  4       pV F  pVP                  V4       K  	  V# )zConvert a BeautifulSoup tree to a list of Element trees.

Returns a list instead of a single root Element to support
HTML-like soup with more than one root element.

You can pass a different Element factory through the `makeelement`
keyword.
)_convert_treegetchildrenremove)beautiful_soup_treer   r   childrenchilds   &&   r   convert_treer#   3   s8     ,:D!HE Or   c                 *   Vf   \         p\        VR4      '       d   RV9  d   RVR&   \        VR4      '       d   RV9  d   RVR&   V! V 3/ VB p\        WB4      p\        V4      ^8X  d"   V^ ,          P                  R8X  d
   V^ ,          # RVn        V# )NHTML_ENTITIESconvertEntitiesr   DEFAULT_BUILDER_FEATURESfeatureszhtml.parser)r   r   r   lentag)sourcer   r   r   treer   s   &&&,  r   r   r   E   s    %}o..F*(.F$%}899V#!.F:*6*D+D
4yA~$q'++/AwDHKr   z`(?:\s|[<!])*DOCTYPE\s*HTML(?:\s+PUBLIC)?(?:\s+(\'[^\']*\'|"[^"]*"))?(?:\s+(\'[^\']*\'|"[^"]*"))?c                   ,   a  ] tR t^^t o R tR tRtV tR# )
_PseudoTagc                .    R V n         . V n        Wn        R# )r   N)nameattrscontents)selfr2   s   &&r   __init___PseudoTag.__init__`   s    	
 r   c                6    V P                   P                  4       # N)r2   __iter__)r3   s   &r   r8   _PseudoTag.__iter__e   s    }}%%''r   )r1   r2   r0   N)__name__
__module____qualname____firstlineno__r4   r8   __static_attributes____classdictcell__)__classdict__s   @r   r.   r.   ^   s     !
( (r   r.   c                    Vf   \         P                  P                  pR ;r#R ;rE\        V 4       F  w  rg\	        V\
        4      '       dH   Vf   TpTpVf:   VP                  '       d&   VP                  P                  4       R8X  d   TpK\  K^  K`  Kb  Ve   Kh  \	        V\        4      '       g   K  TpK  	  Vf   . ;rV P                  p
M:V P                  R V pV P                  W#^,            p
V P                  V^,           R  p	Ve>   V
P                  V4      pV
R V VP                  ,           W^,           R  ,           Vn	        M\        V
4      p\        V4      pV! V4      pTp\        V4       F$  pV! V4      pVf   K  VP                  V4       TpK&  	  TpV	 F$  pV! V4      pVf   K  VP                  V4       TpK&  	  Ve}    VP!                  4       p\'        V4      pV'       g    V# VP)                  4       w  ppVP+                  4       P,                  pT;'       d    V^R Vn        T;'       d    V^R Vn        V#   \"         d    TP$                  p Li ; i)Nr   )r   html_parserr   	enumerate
isinstancer   r0   lower_DECLARATION_OR_DOCTYPEr2   indexr.   _init_node_convertersreversedaddpreviousaddnextoutput_readyAttributeErrorstring_parse_doctype_declarationgroupsgetroottreedocinfo	public_id
system_url)r    r   first_element_idxlast_element_idx	html_rootdeclarationiepre_root	post_rootrootsconvert_noderes_rootprev	converteddoctype_stringmatchexternal_idsys_urirS   s   &&                  r   r   r   i   sr   &&22 ,0/""I-.a ($%!  QVVV&0H	 1IV  Z3J%K%KK /  !!#,,&//0B1BC#,,->PQ?QR'001A!1C1DE	 KK	""2AY););;eaCDkI	 u%	(5L I&HDh O	 Y'D	   D O	 LL#D	  	0(557N +>:  O $)<<> K**,44G + A AAb0AG!(!:!:WQr]GO  	0(//N	0s   	I I I c                   a aaaa	a
a / o. oVV3R  lpVV3R lo	R	VV	3R lloR o
R oV! \         \        4      VVV V
3R l4       pV! \        4      R 4       pV! \        4      R 4       pV! \        4      V3R l4       pS# )
c                     <a  VVV 3R  lpV# )c                 F   < S F  pV SV&   SP                  V4       K  	  V # r7   )append)handlert
convertersordered_node_typestypess   & r   add5_init_node_converters.<locals>.converter.<locals>.add   s+     '
1"))!,  Nr    )ro   rp   rm   rn   s   j r   	converter(_init_node_converters.<locals>.converter   s    	
 
r   c                 R   < S F  p\        W4      '       g   K  SV,          u # 	  R # r7   )rE   )noderl   rm   rn   s   & r   find_best_converter2_init_node_converters.<locals>.find_best_converter   s'    #A$""!!}$ $ r   c                    <  S\        V 4      ,          pVf   R # V! W4      #   \         d    S! T 4      ;pS\        T 4      &    L1i ; ir7   )typeKeyError)bs_nodeparentrk   rm   rw   s   && r   r_   +_init_node_converters.<locals>.convert_node   sW    	O g/G ?w''	  	O2Eg2NNGjg/	Os   # !AAc                    \        V \        4      '       dR   / pV P                  4        F9  w  r#\        V\        4      '       d   R P	                  V4      p\        V4      W&   K;  	  V# V  UUu/ uF  w  r#V\        V4      bK  	  pppV# u uppi ) )rE   dictitemslistjoinunescape)bs_attrsattribskvs   &   r   	map_attrs(_init_node_converters.<locals>.map_attrs   s}    h%%G (a&&A%a[
 )  3;;($!q(1+~(G; <s   -B	c                     \        V 4      ^ 8X  d%   V P                  ;'       g    RV,           V n        R# V R,          P                  ;'       g    RV,           V R,          n        R# )     NrB   )r)   texttail)r}   r   s   &&r   append_text*_init_node_converters.<locals>.append_text   sF    v;!!;;,,"4FK%bz44"<F2JOr   c                 d  < V P                   pVe6   V'       d	   S
! V4      MR p\        P                  ! WP                  VR7      pM&V'       d	   S
! V4      M/ pS	! V P                  VR7      pV  F"  p S\	        V4      ,          pVe	   V! WT4       K$  	  V#   \
         d     Mi ; iS! YT4       KC  )N)attrib)r1   r   
SubElementr0   rz   r{   )r|   r}   r1   r   resr"   rk   r_   rm   r   r   s   &&     r   convert_tag*_init_node_converters.<locals>.convert_tag   s    */i&TG""6<<HC*/i&RGgll7;CE$T%[1 &E'  
   $s   3BB%$B%c                 \    \         P                  ! V 4      pVe   VP                  V4       V# r7   )r   HtmlCommentrj   r|   r}   r   s   && r   convert_comment._init_node_converters.<locals>.convert_comment  s)    w'MM#
r   c                     V P                  R 4      '       d   V RR p \        P                  ! V P                  R^4      !  pVe   VP	                  V4       V# )?Nr   rB   )endswithr   r   splitrj   r   s   && r   
convert_pi)_init_node_converters.<locals>.convert_pi  sR    C   crlG))7==a+@AMM#
r   c                 4   < Ve   S! V\        V 4      4       R # r7   )r   )r|   r}   r   s   &&r   convert_text+_init_node_converters.<locals>.convert_text  s     12r   r7   )r   r.   r   r   r   )r   rs   r   r   r   r   r   r_   rm   rw   r   rn   s   f     @@@@@@r   rI   rI      s    J( (	= sJ  , w  $% &   
 r   )name2codepointz&(\w+);c                 2    V '       g   R # R p\        W4      # )r   c                      \        \        V P                  ^4      ,          4      #   \         d    T P                  ^ 4      u # i ; i)   )unichrr   groupr{   )ms   &r   unescape_entity!unescape.<locals>.unescape_entity5  s<    	.455 	771:	s   $' AA)handle_entities)rO   r   s   & r   r   r   1  s    
 ?33r   )r   r   r#   )NNr7   )$__doc____all__relxmlr   r   bs4r   r   r   r   r   r	   r
   rG   ImportErrorr   r   r#   r   compile
IGNORECASErd   rP   r.   r   rI   html.entitiesr   htmlentitydefssubr   r   	NameErrorchrr   rr   r   r   <module>r      s   2 	 	*    +G4>#$$  ZZ$ MM	 5	 ( (Rj^F.,
 **Z(,,
	4G	  *  *	*j  .-.  Fs5   B 4B= C B:9B:=CC	CC