
    g|                    d   d dl mZ ddlmZmZ d dlmZ d dlZd dlZddl	m
Z
 ddl	mZ ddl	mZ e G d	 d
             Ze G d d             Ze G d d             Ze G d d             Ze G d d             Z G d de      Z G d de      Ze G d d             Ze G d d             Ze G d d             Z G d de      Ze G d d              Ze G d! d"             Ze G d# d$             Ze G d% d&             Zd+d'Zd+d(Z	 	 	 d,	 	 	 	 	 	 	 	 	 d-d)Z 	 	 	 	 d.	 	 	 	 	 	 	 	 	 	 	 d/d*Z!y)0    )annotations   )event_classT_JSON_DICT)	dataclassN)dom)dom_debugger)pagec                     e Zd ZU dZded<   ded<   ded<   ded<   d	Zd
ed<   d	Zd
ed<   d	Zded<   d	Zded<   d	Z	ded<   d	Z
ded<   d	Zded<   d	Zded<   d	Zd
ed<   d	Zd
ed<   d	Zd
ed<   d	Zd
ed<   d	Zd
ed<   d	Zd
ed<   d	Zded<   d	Zded<   d	Zd ed!<   d	Zd"ed#<   d	Zded$<   d	Zd%ed&<   d	Zd
ed'<   d	Zd
ed(<   d	Zd)ed*<   d	Zd)ed+<   d, Zed-        Zy	).DOMNodez!
    A Node in the DOM tree.
    int	node_typestr	node_name
node_valuezdom.BackendNodeIdbackend_node_idNtyping.Optional[str]
text_valueinput_valuetyping.Optional[bool]input_checkedoption_selected!typing.Optional[typing.List[int]]child_node_indexesz'typing.Optional[typing.List[NameValue]]
attributespseudo_element_indexestyping.Optional[int]layout_node_indexdocument_urlbase_urlcontent_languagedocument_encoding	public_id	system_idztyping.Optional[page.FrameId]frame_idcontent_document_indexztyping.Optional[dom.PseudoType]pseudo_typez#typing.Optional[dom.ShadowRootType]shadow_root_typeis_clickablez8typing.Optional[typing.List[dom_debugger.EventListener]]event_listenerscurrent_source_url
origin_urltyping.Optional[float]scroll_offset_xscroll_offset_yc                   t               }| j                  |d<   | j                  |d<   | j                  |d<   | j                  j                         |d<   | j                  | j                  |d<   | j                  | j                  |d<   | j                  | j                  |d<   | j                  | j                  |d<   | j                  | j                  D cg c]  }| c}|d	<   | j                  +| j                  D cg c]  }|j                          c}|d
<   | j                  | j                  D cg c]  }| c}|d<   | j                  | j                  |d<   | j                  | j                  |d<   | j                  | j                  |d<   | j                   | j                   |d<   | j"                  | j"                  |d<   | j$                  | j$                  |d<   | j&                  | j&                  |d<   | j(                  | j(                  j                         |d<   | j*                  | j*                  |d<   | j,                  | j,                  j                         |d<   | j.                  | j.                  j                         |d<   | j0                  | j0                  |d<   | j2                  +| j2                  D cg c]  }|j                          c}|d<   | j4                  | j4                  |d<   | j6                  | j6                  |d<   | j8                  | j8                  |d<   | j:                  | j:                  |d<   |S c c}w c c}w c c}w c c}w )NnodeTypenodeName	nodeValuebackendNodeId	textValue
inputValueinputCheckedoptionSelectedchildNodeIndexesr   pseudoElementIndexeslayoutNodeIndexdocumentURLbaseURLcontentLanguagedocumentEncodingpublicIdsystemIdframeIdcontentDocumentIndex
pseudoTypeshadowRootTypeisClickableeventListenerscurrentSourceURL	originURLscrollOffsetXscrollOffsetY)dictr   r   r   r   to_jsonr   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r.   r/   selfjsonis      g/var/www/html/venv/lib/python3.12/site-packages/selenium/webdriver/common/devtools/v129/dom_snapshot.pyrM   zDOMNode.to_jsono   sC   v>>Z>>Z OO[ $ 4 4 < < >_??& $D'!%!1!1D)#'#5#5D +%)%9%9D!""".373J3J'Ka'KD#$??&7;!G!!))+!GD&&27;7R7R+S!A+SD'(!!-&*&<&<D"#("&"3"3D==$"mmDO  ,&*&;&;D"#!!-'+'='=D#$>>%#~~D>>%#~~D==$"mm335DO&&2+/+F+FD'('!%!1!1!9!9!;D  ,%)%:%:%B%B%DD!"("&"3"3D+;?;O;O%Paaiik%PD!""".'+'>'>D#$??& $D+$($8$8D!+$($8$8D!O (L!G+S4 &Qs   	MM";	M'M,c                    | d8i dt        |d         dt        |d         dt        |d         dt        j                  j	                  |d         d	d
|v rt        |d
         nd dd|v rt        |d         nd dd|v rt        |d         nd dd|v rt        |d         nd dd|v r|d   D cg c]  }t        |       c}nd dd|v r&|d   D cg c]  }t        j	                  |       c}nd dd|v r|d   D cg c]  }t        |       c}nd dd|v rt        |d         nd dd|v rt        |d         nd dd|v rt        |d         nd dd|v rt        |d         nd dd|v rt        |d         nd d d!|v rt        |d!         nd d"d#|v rt        |d#         nd d$d%|v r"t        j                  j	                  |d%         nd d&d'|v rt        |d'         nd d(d)|v r"t        j                  j	                  |d)         nd d*d+|v r"t        j                  j	                  |d+         nd d,d-|v rt        |d-         nd d.d/|v r0|d/   D cg c]!  }t        j                  j	                  |      # c}nd d0d1|v rt        |d1         nd d2d3|v rt        |d3         nd d4d5|v rt        |d5         nd d6d7|v rt        |d7         S d S c c}w c c}w c c}w c c}w )9Nr   r1   r   r2   r   r3   r   r4   r   r5   r   r6   r   r7   r   r8   r   r9   r   r   r:   r   r;   r   r<   r    r=   r!   r>   r"   r?   r#   r@   r$   rA   r%   rB   r&   rC   r'   rD   r(   rE   r)   rF   r*   rG   r+   rH   r,   rI   r.   rJ   r/   rK    )r   r   r   BackendNodeId	from_jsonbool	NameValuer
   FrameId
PseudoTypeShadowRootTyper	   EventListenerfloatclsrP   rQ   s      rR   rV   zDOMNode.from_json   s    
$z*+
$z*+
 4,-
  --77_8MN	

 2=1Ds4,-$
 4@43GD./T
 9G$8N$tN34TX
 =MPT<TD&6!78Z^
 N`cgMg5G0HI1AImq
 P\_cOc\8JK1	++A.Kim
 VlosUsD9O4P#QqCF#Qy}
 ?PSW>Wc$'8"9:]a
 6Cd5JT-01PT
 .7$->Si)D
 >ORV=VS&7!89\`
  @RUY?Yc$'9":;_c!
" 0:T/Ac$z*+t#
$ 0:T/Ac$z*+t%
& AJT@QT\\++DO<W['
( I_bfHf3t,B'C#Dlp)
* IUX\H\00l1CDbf+
, VfimUmS//99$?O:PQsw-
. 7Dt6Kd=12QU/
0 jz  ~B  jBdScNde\77AA!De  HL1
2 ASVZ@Zs4(:#;<`d3
4 2=1Ds4,-$5
6 =Lt<SE$"78Y]7
8 =Lt<SE$"789
 	
8 Z^9
 	
  JK#Q fs   5K#K(K- &K2) __name__
__module____qualname____doc____annotations__r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r.   r/   rM   classmethodrV   rT       rR   r   r      s    N N O '& (,J$+ )-K%, ,0M(/ .2O*1 =A9@ ;?J7> AE=D /3+2 *.L&- &*H") .2*1 /3+2 '+I#* '+I#* /3H+2 4807 48K07 =A9@
 +/L'. QUOMT 04,3 (,J$+ /3O+2.2O+26p 
 
rf   r   c                  F    e Zd ZU dZded<   ded<   ded<   d Zed        Zy	)
InlineTextBoxz
    Details of post layout rendered text positions. The exact layout should not be regarded as
    stable and may change between versions.
    dom.Rectbounding_boxr   start_character_indexnum_charactersc                    t               }| j                  j                         |d<   | j                  |d<   | j                  |d<   |S )NboundingBoxstartCharacterIndexnumCharacters)rL   rj   rM   rk   rl   rO   rP   s     rR   rM   zInlineTextBox.to_json   sH    v"//779]&*&@&@"# $ 3 3_rf   c                     | t         j                  j                  |d         t        |d         t        |d               S )Nrn   ro   rp   )rj   rk   rl   )r   RectrV   r   r_   rP   s     rR   rV   zInlineTextBox.from_json   sA    ++D,?@"%d+@&A"BtO45
 	
rf   Nr`   ra   rb   rc   rd   rM   re   rV   rT   rf   rR   rh   rh      s8    
    
 
rf   rh   c                      e Zd ZU dZded<   ded<   dZded<   dZd	ed
<   dZded<   dZded<   dZ	ded<   d Z
ed        Zy)LayoutTreeNodezD
    Details of an element in the DOM tree with a LayoutObject.
    r   dom_node_indexri   rj   Nr   layout_textz+typing.Optional[typing.List[InlineTextBox]]inline_text_nodesr   style_indexpaint_orderr   is_stacking_contextc                   t               }| j                  |d<   | j                  j                         |d<   | j                  | j                  |d<   | j
                  +| j
                  D cg c]  }|j                          c}|d<   | j                  | j                  |d<   | j                  | j                  |d<   | j                  | j                  |d<   |S c c}w )NdomNodeIndexrn   
layoutTextinlineTextNodes
styleIndex
paintOrderisStackingContext)	rL   rx   rj   rM   ry   rz   r{   r|   r}   rN   s      rR   rM   zLayoutTreeNode.to_json  s    v#22^"//779]'!%!1!1D!!-<@<R<R&Sqqyy{&SD"#'!%!1!1D'!%!1!1D##/(,(@(@D$% 'Ts   ,Cc                p    | t        |d         t        j                  j                  |d         d|v rt	        |d         nd d|v r&|d   D cg c]  }t
        j                  |       c}nd d|v rt        |d         nd d|v rt        |d         nd d|v rt        |d               S d       S c c}w )	Nr   rn   r   r   r   r   r   )rx   rj   ry   rz   r{   r|   r}   )r   r   rs   rV   r   rh   rW   r^   s      rR   rV   zLayoutTreeNode.from_json  s    tN34++D,?@3?43GD./T_ptx_x4HYCZ[a}66q9[  C3?43GD./T3?43GD./TCVZ^C^T*=%> ?
 	
 ei
 	
 \s   B3)r`   ra   rb   rc   rd   ry   rz   r{   r|   r}   rM   re   rV   rT   rf   rR   rw   rw      su       )-K%, FJBI )-K%,
 )-K%, 26.5  	
 	
rf   rw   c                  2    e Zd ZU dZded<   d Zed        Zy)ComputedStylezQ
    A subset of the full ComputedStyle as defined by the request whitelist.
    ztyping.List[NameValue]
propertiesc                z    t               }| j                  D cg c]  }|j                          c}|d<   |S c c}w )Nr   )rL   r   rM   rN   s      rR   rM   zComputedStyle.to_json+  s3    v37??CaaiikC\ Ds   8c                f     | |d   D cg c]  }t         j                  |       c}      S c c}w )Nr   )r   )rX   rV   r^   s      rR   rV   zComputedStyle.from_json0  s0    8<\8JK1	++A.K
 	
Ks   .Nru   rT   rf   rR   r   r   #  s(     '&
 
 
rf   r   c                  <    e Zd ZU dZded<   ded<   d Zed        Zy)rX   z
    A name/value pair.
    r   namevaluec                V    t               }| j                  |d<   | j                  |d<   |S )Nr   r   )rL   r   r   rq   s     rR   rM   zNameValue.to_jsonB  s(    vyyV

Wrf   c                F     | t        |d         t        |d               S )Nr   r   )r   r   )r   rt   s     rR   rV   zNameValue.from_jsonH  s'    T&\"d7m$
 	
rf   Nru   rT   rf   rR   rX   rX   7  s.     I J 
 
rf   rX   c                  <     e Zd ZdZddZedd       Z fdZ xZS )StringIndex3
    Index of the string in the strings table.
    c                    | S NrT   rO   s    rR   rM   zStringIndex.to_jsonT      rf   c                     | |      S r   rT   rt   s     rR   rV   zStringIndex.from_jsonW      4yrf   c                >    dj                  t        | 	               S )NzStringIndex({})formatsuper__repr__rO   	__class__s    rR   r   zStringIndex.__repr__[  s     ''(8(:;;rf   )returnr   )rP   r   r   r   	r`   ra   rb   rc   rM   re   rV   r   __classcell__r   s   @rR   r   r   P  s+      < <rf   r   c                  <     e Zd ZdZddZedd       Z fdZ xZS )ArrayOfStringsr   c                    | S r   rT   r   s    rR   rM   zArrayOfStrings.to_jsonc  r   rf   c                     | |      S r   rT   rt   s     rR   rV   zArrayOfStrings.from_jsonf  r   rf   c                >    dj                  t        | 	               S )NzArrayOfStrings({})r   r   s    rR   r   zArrayOfStrings.__repr__j  s    #**57+;+=>>rf   )r   typing.List[StringIndex])rP   r   r   r   r   r   s   @rR   r   r   _  s+      ? ?rf   r   c                  <    e Zd ZU dZded<   ded<   d Zed        Zy)	RareStringDataz2
    Data that is only present on rare nodes.
    typing.List[int]indexr   r   c                    t               }| j                  D cg c]  }| c}|d<   | j                  D cg c]  }|j                          c}|d<   |S c c}w c c}w Nr   r   )rL   r   r   rM   rN   s      rR   rM   zRareStringData.to_jsonw  sL    v$(JJ/q/W.2jj99W 09s
   	AAc           	          | |d   D cg c]  }t        |       c}|d   D cg c]  }t        j                  |       c}      S c c}w c c}w Nr   r   )r   r   )r   r   rV   r^   s      rR   rV   zRareStringData.from_json}  sH    #'=1a3q6159']C;((+C
 	
1Cs
   A	A
Nru   rT   rf   rR   r   r   n  s.     ## 
 
rf   r   c                  .    e Zd ZU ded<   d Zed        Zy)RareBooleanDatar   r   c                ^    t               }| j                  D cg c]  }| c}|d<   |S c c}w )Nr   )rL   r   rN   s      rR   rM   zRareBooleanData.to_json  s+    v$(JJ/q/W 0s   	*c                R     | |d   D cg c]  }t        |       c}      S c c}w )Nr   )r   r   r^   s      rR   rV   zRareBooleanData.from_json  s(    #'=1a3q61
 	
1s   $Nr`   ra   rb   rd   rM   re   rV   rT   rf   rR   r   r     s!    
 
 
rf   r   c                  8    e Zd ZU ded<   ded<   d Zed        Zy)RareIntegerDatar   r   r   c                    t               }| j                  D cg c]  }| c}|d<   | j                  D cg c]  }| c}|d<   |S c c}w c c}w r   )rL   r   r   rN   s      rR   rM   zRareIntegerData.to_json  sF    v$(JJ/q/W$(JJ/q/W 0/s
   	A	Ac           	          | |d   D cg c]  }t        |       c}|d   D cg c]  }t        |       c}      S c c}w c c}w r   r   r^   s      rR   rV   zRareIntegerData.from_json  sA    #'=1a3q61#'=1a3q61
 	
11s	   ?A
Nr   rT   rf   rR   r   r     s'     
 
rf   r   c                  8     e Zd ZddZedd       Z fdZ xZS )	Rectanglec                    | S r   rT   r   s    rR   rM   zRectangle.to_json  r   rf   c                     | |      S r   rT   rt   s     rR   rV   zRectangle.from_json  r   rf   c                >    dj                  t        | 	               S )NzRectangle({})r   r   s    rR   r   zRectangle.__repr__  s    %%eg&6&899rf   )r   typing.List[float])rP   r   r   r   )r`   ra   rb   rM   re   rV   r   r   r   s   @rR   r   r     s&      : :rf   r   c                      e Zd ZU dZded<   ded<   ded<   ded<   ded<   ded<   ded	<   ded
<   ded<   ded<   ded<   dZded<   dZded<   dZded<   dZded<   d Z	e
d        Zy)DocumentSnapshotz
    Document snapshot.
    r   r   titler    r!   encoding_namer#   r$   r%   NodeTreeSnapshotnodesLayoutTreeSnapshotlayoutTextBoxSnapshot
text_boxesNr-   r.   r/   content_widthcontent_heightc                p   t               }| j                  j                         |d<   | j                  j                         |d<   | j                  j                         |d<   | j
                  j                         |d<   | j                  j                         |d<   | j                  j                         |d<   | j                  j                         |d<   | j                  j                         |d<   | j                  j                         |d	<   | j                  j                         |d
<   | j                  j                         |d<   | j                  | j                  |d<   | j                  | j                  |d<   | j                  | j                  |d<   | j                   | j                   |d<   |S )Nr<   r   r=   r>   encodingNamer@   rA   rB   r   r   	textBoxesrJ   rK   contentWidthcontentHeight)rL   r   rM   r   r    r!   r   r#   r$   r%   r   r   r   r.   r/   r   r   rq   s     rR   rM   zDocumentSnapshot.to_json  s}   v"//779]

**,W--//1Y"&"7"7"?"?"A#1199;^>>113Z>>113Z--//1Y

**,W,,.X OO335[+$($8$8D!+$($8$8D!)#'#5#5D *$($7$7D!rf   c                    | t         j                  |d         t         j                  |d         t         j                  |d         t         j                  |d         t         j                  |d         t         j                  |d         t         j                  |d         t         j                  |d         t        j                  |d	         t        j                  |d
         t        j                  |d         d|v rt        |d         nd d|v rt        |d         nd d|v rt        |d         nd d|v rt        |d               S d       S )Nr<   r   r=   r>   r   r@   rA   rB   r   r   r   rJ   rK   r   r   )r   r   r    r!   r   r#   r$   r%   r   r   r   r.   r/   r   r   )r   rV   r   r   r   r]   rt   s     rR   rV   zDocumentSnapshot.from_json  sF   $..tM/BC''W6 **4	?;(2248I3JK%//^0DE!++D,<=!++D,<= **4	?;",,T'];%//X?&00k1BC<Kt<SE$"78Y]<Kt<SE$"78Y]9G49O%^ 45UY;Jd;R5o!67
 	
 Y]
 	
rf   )r`   ra   rb   rc   rd   r.   r/   r   r   rM   re   rV   rT   rf   rR   r   r     s        "!         /3O+2 /3O+2 -1M)0 .2N*1. 
 
rf   r   c                     e Zd ZU dZdZded<   dZded<   dZded<   dZded	<   dZ	ded
<   dZ
ded<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<   d Zed        Zy)r   z!
    Table containing nodes.
    Nr   parent_indexr   ztyping.Optional[RareStringData]r(   )typing.Optional[typing.List[StringIndex]]r   r   z/typing.Optional[typing.List[dom.BackendNodeId]]r   z,typing.Optional[typing.List[ArrayOfStrings]]r   r   r   z typing.Optional[RareBooleanData]r   r   z typing.Optional[RareIntegerData]r&   r'   pseudo_identifierr)   r+   r,   c                8   t               }| j                  | j                  D cg c]  }| c}|d<   | j                  | j                  D cg c]  }| c}|d<   | j                  | j                  j	                         |d<   | j
                  +| j
                  D cg c]  }|j	                          c}|d<   | j                  +| j                  D cg c]  }|j	                          c}|d<   | j                  +| j                  D cg c]  }|j	                          c}|d<   | j                  +| j                  D cg c]  }|j	                          c}|d<   | j                  | j                  j	                         |d<   | j                  | j                  j	                         |d	<   | j                  | j                  j	                         |d
<   | j                  | j                  j	                         |d<   | j                  | j                  j	                         |d<   | j                  | j                  j	                         |d<   | j                  | j                  j	                         |d<   | j                   | j                   j	                         |d<   | j"                  | j"                  j	                         |d<   | j$                  | j$                  j	                         |d<   |S c c}w c c}w c c}w c c}w c c}w c c}w )NparentIndexr1   rE   r2   r3   r4   r   r5   r6   r7   r8   rC   rD   pseudoIdentifierrF   rH   rI   )rL   r   r   r(   rM   r   r   r   r   r   r   r   r   r&   r'   r   r)   r+   r,   rN   s      rR   rM   zNodeTreeSnapshot.to_jsonN  s   v(.2.?.?"@1"@D>>%+/>>:a:D  ,%)%:%:%B%B%DD!">>%59^^D		DD??&6:oo F FD+:>:N:N$OQQYY[$OD!??&7;!G!!))+!GD??& $ 7 7 9D'!%!1!1!9!9!;D)#'#5#5#=#=#?D +%)%9%9%A%A%CD!"&&2+/+F+F+N+N+PD'('!%!1!1!9!9!;D!!-'+'='='E'E'GD#$("&"3"3";";"=D"".'+'>'>'F'F'HD#$??& $ 7 7 9DC #A:  E F$O!Gs#   	K>	L LLLLc                     | d"i dd|v r|d   D cg c]  }t        |       c}nd dd|v r|d   D cg c]  }t        |       c}nd dd|v rt        j                  |d         nd dd|v r&|d   D cg c]  }t        j                  |       c}nd d	d
|v r&|d
   D cg c]  }t        j                  |       c}nd dd|v r0|d   D cg c]!  }t        j
                  j                  |      # c}nd dd|v r&|d   D cg c]  }t        j                  |       c}nd dd|v rt        j                  |d         nd dd|v rt        j                  |d         nd dd|v rt        j                  |d         nd dd|v rt        j                  |d         nd dd|v rt        j                  |d         nd dd|v rt        j                  |d         nd dd|v rt        j                  |d         nd dd|v rt        j                  |d         nd dd|v rt        j                  |d         nd d d!|v rt        j                  |d!         S d S c c}w c c}w c c}w c c}w c c}w c c}w )#Nr   r   r   r1   r(   rE   r   r2   r   r3   r   r4   r   r   r5   r   r6   r   r7   r   r8   r&   rC   r'   rD   r   r   r)   rF   r+   rH   r,   rI   rT   )	r   r   rV   r   r   rU   r   r   r   r^   s      rR   rV   zNodeTreeSnapshot.from_jsont  s    
BOSWBW$}*=>Q#a&>]a
<F$<NtJ'78!s1v8TX
 RbeiQi^55d;K6LMos
 OY\`N`j9IJA{,,Q/Jfj	

 Q\_cPc${:KLQ--a0Lim
 `orv_vT/EZ[S..88;[  }A
 UadhThT,=OP003Pnr
 GRUYFY~//[0AB_c
 IUX\H\00l1CDbf
 N\_cMc/33D4HIim
 RbeiQiO55d;K6LMos
 _ux|^|?#<#<TBX=Y#Z  CG
 IUX\H\00l1CDbf
 UgjnTnn66t<N7OPtx
 LY\`K`2243FGfj
  VhkoUo~77=O8PQuy!
" GRUYFY~//[0AB#
 	
" `d#
 	
>8JL[Ps"   I"I'6I,#I1&I6I;)r`   ra   rb   rc   r   rd   r   r(   r   r   r   r   r   r   r   r   r&   r'   r   r)   r+   r,   rM   re   rV   rT   rf   rR   r   r     s
    7;L3: 48I07 9=5< <@I8? =AJ9@ HLODK @DJ<C 37J/6 48K07 7;M3: 9=O5< @D<C 48K07 :>6=
 6:L29 ;?7> 37J/6$L 
 
rf   r   c                      e Zd ZU dZded<   ded<   ded<   ded	<   d
ed<   dZded<   dZded<   dZded<   dZded<   dZ	ded<   dZ
ded<   d Zed        Zy)r   zM
    Table of details of an element in the DOM tree with a LayoutObject.
    r   
node_indexztyping.List[ArrayOfStrings]stylestyping.List[Rectangle]boundsr   textr   stacking_contextsNr   paint_ordersz'typing.Optional[typing.List[Rectangle]]offset_rectsscroll_rectsclient_rectsr   blended_background_colorsz#typing.Optional[typing.List[float]]text_color_opacitiesc                P   t               }| j                  D cg c]  }| c}|d<   | j                  D cg c]  }|j                          c}|d<   | j                  D cg c]  }|j                          c}|d<   | j
                  D cg c]  }|j                          c}|d<   | j                  j                         |d<   | j                  | j                  D cg c]  }| c}|d<   | j                  +| j                  D cg c]  }|j                          c}|d<   | j                  +| j                  D cg c]  }|j                          c}|d<   | j                  +| j                  D cg c]  }|j                          c}|d	<   | j                  +| j                  D cg c]  }|j                          c}|d
<   | j                  | j                  D cg c]  }| c}|d<   |S c c}w c c}w c c}w c c}w c c}w c c}w c c}w c c}w c c}w c c}w )N	nodeIndexr   r   r   stackingContextspaintOrdersoffsetRectsscrollRectsclientRectsblendedBackgroundColorstextColorOpacities)rL   r   r   rM   r   r   r   r   r   r   r   r   r   rN   s      rR   rM   zLayoutTreeSnapshot.to_json  s   v(,81Q8[/3{{;!!))+;X/3{{;!!))+;X-1YY7		7V#'#9#9#A#A#C (.2.?.?"@1"@D(8<8I8I"J1199;"JD(8<8I8I"J1199;"JD(8<8I8I"J1199;"JD))5DHDbDb.cqqyy{.cD*+$$0595N5N)O!)OD%&# 9;;7 #A"J"J"J.c)Os:   	G6G;!H H 	H
	H H7H.H%	H#c                    | |d   D cg c]  }t        |       c}|d   D cg c]  }t        j                  |       c}|d   D cg c]  }t        j                  |       c}|d   D cg c]  }t        j                  |       c}t
        j                  |d         d|v r|d   D cg c]  }t        |       c}nd d|v r&|d   D cg c]  }t        j                  |       c}nd d|v r&|d   D cg c]  }t        j                  |       c}nd d	|v r&|d	   D cg c]  }t        j                  |       c}nd d
|v r&|d
   D cg c]  }t        j                  |       c}nd d|v r!|d   D cg c]  }t        |       c}      S d       S c c}w c c}w c c}w c c}w c c}w c c}w c c}w c c}w c c}w c c}w )Nr   r   r   r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   )r   r   rV   r   r   r   r]   r^   s      rR   rV   zLayoutTreeSnapshot.from_json  s   (,[(9:1A:9=hHAN,,Q/H48NCqI''*C48LAq+''*A-77=O8PQBOSWBW$}*=>Q#a&>]aR_cgRg$}:MNQ)--a0NmqR_cgRg$}:MNQ)--a0NmqR_cgRg$}:MNQ)--a0Nmq nG  KO  nONgIh&iA{'<'<Q'?&i  UYSgkoSoD9M4N!Oq%(!O
 	
 vz
 	
:HCA>NNN&i!Os:   FF"

F'/F,/F1F6;F;&G G<G
)r`   ra   rb   rc   rd   r   r   r   r   r   r   rM   re   rV   rT   rf   rR   r   r     s     !  (' #" #" '&
 7;L3: =AL9@ =AL9@ =AL9@ LPHO AE=D* 
 
rf   r   c                  P    e Zd ZU dZded<   ded<   ded<   ded<   d Zed	        Zy
)r   z
    Table of details of the post layout rendered text positions. The exact layout should not be regarded as
    stable and may change between versions.
    r   layout_indexr   r   startlengthc                F   t               }| j                  D cg c]  }| c}|d<   | j                  D cg c]  }|j                          c}|d<   | j                  D cg c]  }| c}|d<   | j
                  D cg c]  }| c}|d<   |S c c}w c c}w c c}w c c}w )NlayoutIndexr   r   r   )rL   r   r   rM   r   r   rN   s      rR   rM   zTextBoxSnapshot.to_json  s    v*.*;*;<Qq<]/3{{;!!))+;X$(JJ/q/W%)[[1!1X	 =;/1s   	BB!	B>	Bc                &    | |d   D cg c]  }t        |       c}|d   D cg c]  }t        j                  |       c}|d   D cg c]  }t        |       c}|d   D cg c]  }t        |       c}      S c c}w c c}w c c}w c c}w )Nr   r   r   r   )r   r   r   r   )r   r   rV   r^   s      rR   rV   zTextBoxSnapshot.from_json  s{    *.}*=>Q#a&>48NCqI''*C#'=1a3q61$(N3qCF3	
 	
>C13s   A?B

B	%BNru   rT   rf   rR   r   r     s@    
 #" #"   
 
rf   r   c               #     K   ddi} | }yw)z9
    Disables DOM snapshot agent for the given page.
    methodzDOMSnapshot.disableNrT   cmd_dictrP   s     rR   disabler     s     
 	'H >D   
c               #     K   ddi} | }yw)z8
    Enables DOM snapshot agent for the given page.
    r   zDOMSnapshot.enableNrT   r   s     rR   enabler  	  s     
 	&H >Dr   c              #    K   t               }| D cg c]  }| c}|d<   |||d<   |||d<   |||d<   d|d}|}|d   D cg c]  }t        j                  |       c}|d   D cg c]  }t        j                  |       c}|d	   D cg c]  }t        j                  |       c}fS c c}w c c}w c c}w c c}w w)
a?  
    Returns a document snapshot, including the full DOM tree of the root node (including iframes,
    template contents, and imported documents) in a flattened array, as well as layout and
    white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is
    flattened.

    :param computed_style_whitelist: Whitelist of computed styles to return.
    :param include_event_listeners: *(Optional)* Whether or not to retrieve details of DOM listeners (default false).
    :param include_paint_order: *(Optional)* Whether to determine and include the paint order index of LayoutTreeNodes (default false).
    :param include_user_agent_shadow_tree: *(Optional)* Whether to include UA shadow tree in the snapshot (default false).
    :returns: A tuple with the following items:

        0. **domNodes** - The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document.
        1. **layoutTreeNodes** - The nodes in the layout tree.
        2. **computedStyles** - Whitelisted ComputedStyle properties for each node in the layout tree.
    computedStyleWhitelistincludeEventListenersincludePaintOrderincludeUserAgentShadowTreezDOMSnapshot.getSnapshotr   paramsdomNodeslayoutTreeNodescomputedStyles)rL   r   rV   rw   r   )computed_style_whitelistinclude_event_listenersinclude_paint_orderinclude_user_agent_shadow_treer  rQ   r   rP   s           rR   get_snapshotr    s     , &F3K'La'LF#$**A&'&&9"#%1/M+,+H >D'+J'78!		1	8.23D.EF	!	!!	$F-12B-CD	 	 	#D  (M 	9FDs3   C	B/+CB4!	C*B9	CB>+Cc              #  0  K   t               }| D cg c]  }| c}|d<   |||d<   |||d<   |||d<   |||d<   d|d}|}|d   D cg c]  }t        j                  |       c}|d	   D cg c]  }t        |       c}fS c c}w c c}w c c}w w)
a  
    Returns a document snapshot, including the full DOM tree of the root node (including iframes,
    template contents, and imported documents) in a flattened array, as well as layout and
    white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is
    flattened.

    :param computed_styles: Whitelist of computed styles to return.
    :param include_paint_order: *(Optional)* Whether to include layout object paint orders into the snapshot.
    :param include_dom_rects: *(Optional)* Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot
    :param include_blended_background_colors: **(EXPERIMENTAL)** *(Optional)* Whether to include blended background colors in the snapshot (default: false). Blended background color is achieved by blending background colors of all elements that overlap with the current element.
    :param include_text_color_opacities: **(EXPERIMENTAL)** *(Optional)* Whether to include text color opacity in the snapshot (default: false). An element might have the opacity property set that affects the text color of the element. The final text color opacity is computed based on the opacity of all overlapping elements.
    :returns: A tuple with the following items:

        0. **documents** - The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document.
        1. **strings** - Shared string table that all string properties refer to with indexes.
    r  r  includeDOMRectsincludeBlendedBackgroundColorsincludeTextColorOpacitieszDOMSnapshot.captureSnapshotr  	documentsstrings)rL   r   rV   r   )	computed_stylesr  include_dom_rects!include_blended_background_colorsinclude_text_color_opacitiesr  rQ   r   rP   s	            rR   capture_snapshotr  =  s     . &F+:;a;F&&9"#$$5 !(43T/0#/.J*+/H >D04[0AB1		#	#A	&Bi)AQ)   < 	C)s'   B	B2BB(	B1BB)r   z0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])NNN)
r  typing.List[str]r  r   r  r   r  r   r   ztyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[typing.List[DOMNode], typing.List[LayoutTreeNode], typing.List[ComputedStyle]]])NNNN)r  r  r  r   r  r   r  r   r  r   r   zityping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[typing.List[DocumentSnapshot], typing.List[str]]])"
__future__r   utilr   r   dataclassesr   enumtyping r   r	   r
   r   rh   rw   r   rX   r   r   listr   r   r   r   r   r   r   r   r   r   r  r  r  rT   rf   rR   <module>r$     s   # * !      t
 t
 t
n 
 
 
@ 5
 5
 5
p 
 
 
& 
 
 
0<# <?T ? 
 
 
, 
 
 
 
 
 
&	: 	: Z
 Z
 Z
z t
 t
 t
n J
 J
 J
Z "
 "
 "
J :>59@D	'"2'!6' 3' )>	'
 
O'X 6:37CG>B)))2) 1) ,A	)
 '<) 
q)rf   