Ë
    bQbjž+  ã                  óØ  — d dl mZ d dlmZmZ d dlmZ d dlmZ 	 	 	 	 	 	 d"d„Z		 d#	 	 	 	 	 	 	 d$d„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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«      Ze G d„ d«      «       Z G d „ d!«      Zy)%é    )Úannotations)Ú	dataclassÚfield)ÚAny)Úcommand_builderc                óD   — | du rd|�t        |«      dœS ddœS | du rddiS y)aa  Transform download parameters into download_behavior object.

    Args:
        allowed: Whether downloads are allowed
        destination_folder: Destination folder for downloads (accepts str or
            pathlib.Path; will be coerced to str)

    Returns:
        Dictionary representing the download_behavior object, or None if allowed is None
    TÚallowedN)ÚtypeÚdestinationFolderFr
   Údenied)Ústr)r	   Údestination_folders     úY/var/www/html/venv/lib/python3.12/site-packages/selenium/webdriver/common/bidi/browser.pyÚtransform_download_paramsr      sR   € ð �$�àð =OÐ<Z¤Ð%7Ó!8ñ	
ð 	
ð aeñ	
ð 	
ð 
�EÑ	Ø˜Ð!Ð!àó    Nc                óJ   — | du r|st        d«      ‚| du r|rt        d«      ‚yy)a  Validate download behavior parameters.

    Args:
        allowed: Whether downloads are allowed
        destination_folder: Destination folder for downloads
        user_contexts: Optional list of user contexts

    Raises:
        ValueError: If parameters are invalid
    Tz0destination_folder is required when allowed=TrueFz<destination_folder should not be provided when allowed=FalseN)Ú
ValueError©r	   r   Úuser_contextss      r   Úvalidate_download_behaviorr   )   s9   € ð �$�Ñ1ÜÐKÓLÐLØ�%ÑÑ.ÜÐWÓXÐXð /Ð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„ Zd„ Zd„ Zd„ Zd„ Zd„ Zy)ÚClientWindowInfozClientWindowInfo.Núbool | NoneÚactiveú
Any | NoneÚclient_windowÚheightÚstateÚwidthÚxÚyc                ó   — | j                   S )zGet the client window ID.)r   ©Úselfs    r   Úget_client_windowz"ClientWindowInfo.get_client_windowJ   s   € à×!Ñ!Ð!r   c                ó   — | j                   S )zGet the client window state.)r   r#   s    r   Ú	get_statezClientWindowInfo.get_stateN   ó   € à�z‰zÐr   c                ó   — | j                   S )zGet the client window width.)r   r#   s    r   Ú	get_widthzClientWindowInfo.get_widthR   r(   r   c                ó   — | j                   S )zGet the client window height.)r   r#   s    r   Ú
get_heightzClientWindowInfo.get_heightV   ó   € à�{‰{Ðr   c                ó   — | j                   S )z%Check if the client window is active.)r   r#   s    r   Ú	is_activezClientWindowInfo.is_activeZ   r-   r   c                ó   — | j                   S )z!Get the client window X position.)r    r#   s    r   Úget_xzClientWindowInfo.get_x^   ó   € à�v‰vˆr   c                ó   — | j                   S )z!Get the client window Y position.)r!   r#   s    r   Úget_yzClientWindowInfo.get_yb   r2   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__annotations__r   r   r   r   r    r!   r%   r'   r*   r,   r/   r1   r4   © r   r   r   r   >   sn   … áà€FˆKÓØ $€M�:Ó$Ø€FˆJÓØ€Eˆ:ÓØ€Eˆ:ÓØ€A€zÓØ€A€zÓò"òòòòòór   r   c                  ó    — e Zd ZU dZdZded<   y)ÚUserContextInfozUserContextInfo.Nr   Úuser_context©r5   r6   r7   r8   r=   r9   r:   r   r   r<   r<   h   s   … áà#€L�*Ô#r   r<   c                  ó<   — e Zd ZU dZdZded<   dZded<   dZded<   y)ÚCreateUserContextParameterszCreateUserContextParameters.Nr   Úaccept_insecure_certsr   ÚproxyÚunhandled_prompt_behavior)r5   r6   r7   r8   rA   r9   rB   rC   r:   r   r   r@   r@   o   s%   … á&à)-Ð˜;Ó-Ø€Eˆ:ÓØ,0Ð˜zÔ0r   r@   c                  ó.   — e Zd ZU dZ ee¬«      Zded<   y)ÚGetClientWindowsResultzGetClientWindowsResult.©Údefault_factoryú	list[Any]Úclient_windowsN)r5   r6   r7   r8   r   ÚlistrI   r9   r:   r   r   rE   rE   x   s   … á!á %°dÔ ;€N�IÔ;r   rE   c                  ó.   — e Zd ZU dZ ee¬«      Zded<   y)ÚGetUserContextsResultzGetUserContextsResult.rF   rH   r   N)r5   r6   r7   r8   r   rJ   r   r9   r:   r   r   rL   rL      s   … á á$°TÔ:€M�9Ô:r   rL   c                  ó    — e Zd ZU dZdZded<   y)ÚRemoveUserContextParameterszRemoveUserContextParameters.Nr   r=   r>   r:   r   r   rN   rN   †   s   … á&à#€L�*Ô#r   rN   c                  óh   — e Zd ZU dZ 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<   y)ÚClientWindowRectStatezClientWindowRectState.ÚnormalF©ÚdefaultÚinitr   r   Nr   r   r   r    r!   )r5   r6   r7   r8   r   r   r9   r   r   r    r!   r:   r   r   rP   rP   �   s>   … á á˜x¨eÔ4€Eˆ3Ó4Ø€Eˆ:ÓØ€FˆJÓØ€A€zÓØ€A€zÔr   rP   c                  ó<   — e Zd ZU dZdZded<    ee¬«      Zded<   y)ÚSetDownloadBehaviorParameterszSetDownloadBehaviorParameters.Nr   Údownload_behaviorrF   rH   r   )	r5   r6   r7   r8   rW   r9   r   rJ   r   r:   r   r   rV   rV   ˜   s   … á(à$(Ð�zÓ(Ù$°TÔ:€M�9Ô:r   rV   c                  ó>   — e Zd ZU dZ edd¬«      Zded<   dZded	<   y)
ÚDownloadBehaviorAllowedzDownloadBehaviorAllowed.r	   FrR   r   r
   Nú
str | Noner   )r5   r6   r7   r8   r   r
   r9   r   r:   r   r   rY   rY       s!   … á"á˜i¨eÔ4€Dˆ#Ó4Ø%)Ð˜
Ô)r   rY   c                  ó0   — e Zd ZU dZ edd¬«      Zded<   y)ÚDownloadBehaviorDeniedzDownloadBehaviorDenied.r   FrR   r   r
   N)r5   r6   r7   r8   r   r
   r9   r:   r   r   r\   r\   ¨   s   … á!á˜h¨UÔ3€Dˆ#Ô3r   r\   c                  ó    — e Zd ZdZdZdZdZdZy)ÚClientWindowNamedStatez)Named states for a browser client window.Ú
fullscreenÚ	maximizedÚ	minimizedrQ   N)r5   r6   r7   r8   Ú
FULLSCREENÚ	MAXIMIZEDÚ	MINIMIZEDÚNORMALr:   r   r   r^   r^   ¯   s   „ Ù3à€JØ€IØ€IØ�Fr   r^   c                  ó.   — e Zd ZU dZdZded<   dZded<   y)ÚSetClientWindowStateParametersa  SetClientWindowStateParameters.

    The ``state`` field is required and must be either a named-state string
    (e.g. ``ClientWindowNamedState.MAXIMIZED``) or a
    :class:`ClientWindowRectState` instance.  ``client_window`` is the ID of
    the window to affect.
    Nr   r   r   )r5   r6   r7   r8   r   r9   r   r:   r   r   rg   rg   ·   s   … ñð !%€M�:Ó$Ø€Eˆ:Ôr   rg   c                  ó|   — e Zd ZdZdd„Zd„ Z	 	 	 d	 	 	 	 	 dd„Zd„ Zd„ Zddd„Z		 	 	 d	 	 	 	 	 dd	„Z
	 	 d	 	 	 dd
„Zy)ÚBrowserzWebDriver BiDi browser module.c                ó   — || _         y ©N)Ú_conn)r$   Úconns     r   Ú__init__zBrowser.__init__Ç   s	   € Øˆ�
r   c                ó°   — i }|j                  «       D ��ci c]  \  }}|€Œ	||“Œ }}}t        d|«      }| j                  j                  |«      }|S c c}}w )zExecute browser.closezbrowser.close)Úitemsr   rl   Úexecute)r$   ÚparamsÚkÚvÚcmdÚresults         r   ÚclosezBrowser.closeÊ   sY   € ð
ˆà#)§<¡<£>×C™4˜1˜a°Q±]�!�Q‘$ÐCˆÑCÜ˜o¨vÓ6ˆØ—‘×#Ñ# CÓ(ˆØˆùó Ds
   –
A¡ANc                ób  — |rt        |d«      r|j                  «       }|rt        |d«      r|j                  «       }|||dœ}|j                  «       D ��ci c]  \  }}|€Œ	||“Œ }}}t        d|«      }| j                  j                  |«      }|rd|v r|j                  d«      }	|	S |S c c}}w )z!Execute browser.createUserContextÚto_bidi_dict)ÚacceptInsecureCertsrB   ÚunhandledPromptBehaviorzbrowser.createUserContextÚuserContext)Úhasattrry   rp   r   rl   rq   Úget)
r$   rA   rB   rC   rr   rs   rt   ru   rv   Ú	extracteds
             r   Úcreate_user_contextzBrowser.create_user_contextÓ   s½   € ñ ”W˜U NÔ3Ø×&Ñ&Ó(ˆEá$¬Ð1JÈNÔ)[Ø(A×(NÑ(NÓ(PÐ%ð $9ØØ'@ñ
ˆð
 $*§<¡<£>×C™4˜1˜a°Q±]�!�Q‘$ÐCˆÑCÜÐ9¸6ÓBˆØ—‘×#Ñ# CÓ(ˆÙ�m vÑ-ØŸ
™
 =Ó1ˆIØÐØˆùó Ds   Á
B+Á!B+c                ó  — i }|j                  «       D ��ci c]  \  }}|€Œ	||“Œ }}}t        d|«      }| j                  j                  |«      }|r¯d|v r«|j	                  dg «      }|D �cg c]�  }t        |t        «      r{t        |j	                  d«      |j	                  d«      |j	                  d«      |j	                  d«      |j	                  d«      |j	                  d«      |j	                  d	«      ¬
«      ‘Œ� c}S g S c c}}w c c}w )z Execute browser.getClientWindowszbrowser.getClientWindowsÚclientWindowsr   ÚclientWindowr   r   r   r    r!   )r   r   r   r   r   r    r!   )rp   r   rl   rq   r~   Ú
isinstanceÚdictr   ©r$   rr   rs   rt   ru   rv   rp   Úitems           r   Úget_client_windowszBrowser.get_client_windowsí   sû   € ð
ˆà#)§<¡<£>×C™4˜1˜a°Q±]�!�Q‘$ÐCˆÑCÜÐ8¸&ÓAˆØ—‘×#Ñ# CÓ(ˆÙ�o¨Ñ/Ø—J‘J˜°Ó3ˆEð "öð Ü˜d¤DÔ)ô !ØŸ8™8 HÓ-Ø"&§(¡(¨>Ó":ØŸ8™8 HÓ-ØŸ(™( 7Ó+ØŸ(™( 7Ó+Ø—h‘h˜s“mØ—h‘h˜s“möòð ð ˆ	ùó% Dùò
s   –
D¡DÁ,BD	c                óH  — i }|j                  «       D ��ci c]  \  }}|€Œ	||“Œ }}}t        d|«      }| j                  j                  |«      }|rEd|v rA|j	                  dg «      }|D �cg c]#  }t        |t        «      r|j	                  d«      ‘Œ% c}S g S c c}}w c c}w )zExecute browser.getUserContextszbrowser.getUserContextsÚuserContextsr|   )rp   r   rl   rq   r~   r„   r…   r†   s           r   Úget_user_contextszBrowser.get_user_contexts  s«   € ð
ˆà#)§<¡<£>×C™4˜1˜a°Q±]�!�Q‘$ÐCˆÑCÜÐ7¸Ó@ˆØ—‘×#Ñ# CÓ(ˆÙ�n¨Ñ.Ø—J‘J˜~¨rÓ2ˆEð "öàÜ˜d¤DÔ)ð —‘˜Õ'òð ð
 ˆ	ùó Dùò
s   –
B¡BÁ,(Bc                óÎ   — |€t        d«      ‚d|i}|j                  «       D ��ci c]  \  }}|€Œ	||“Œ }}}t        d|«      }| j                  j	                  |«      }|S c c}}w )z!Execute browser.removeUserContextz?remove_user_context() missing required argument: 'user_context'r|   zbrowser.removeUserContext)Ú	TypeErrorrp   r   rl   rq   )r$   r=   rr   rs   rt   ru   rv   s          r   Úremove_user_contextzBrowser.remove_user_context  su   € àÐÜÐ]Ó^Ð^ð ˜<ð
ˆð $*§<¡<£>×C™4˜1˜a°Q±]�!�Q‘$ÐCˆÑCÜÐ9¸6ÓBˆØ—‘×#Ñ# CÓ(ˆØˆùó Ds
   ¥
A!°A!c                óš   — t        |||¬«       t        ||«      }d|i}|�||d<   t        d|«      }| j                  j	                  |«      S )ah  Set the download behavior for the browser.

        Args:
            allowed: ``True`` to allow downloads, ``False`` to deny, or ``None``
                to reset to browser default (sends ``null`` to the protocol).
            destination_folder: Destination folder for downloads.  Required when
                ``allowed=True``.  Accepts a string or :class:`pathlib.Path`.
            user_contexts: Optional list of user context IDs.

        Raises:
            ValueError: If *allowed* is ``True`` and *destination_folder* is
                omitted, or ``False`` and *destination_folder* is provided.
        r   ÚdownloadBehaviorrŠ   zbrowser.setDownloadBehavior)r   r   r   rl   rq   )r$   r	   r   r   rW   rr   ru   s          r   Úset_download_behaviorzBrowser.set_download_behavior"  sd   € ô& 	#ØØ1Ø'õ	
ô
 6°gÐ?QÓRÐð +Ð,=Ð>ˆØÐ$Ø%2ˆF�>Ñ"ÜÐ;¸VÓDˆØ�z‰z×!Ñ! #Ó&Ð&r   c                ó  — |€t        d«      ‚|€t        d«      ‚|}t        |d«      r/|j                  j                  «       D ��ci c]
  \  }}|�||“Œ }}}||dœ}t	        d|«      }| j
                  j                  |«      S c c}}w )aÜ  Set the client window state.

        Args:
            client_window: The client window ID to apply the state to.
            state: The window state to set. Can be one of:
                - A string: "fullscreen", "maximized", "minimized", "normal"
                - A ClientWindowRectState object with width, height, x, y
                - A dict representing the state

        Raises:
            ValueError: If client_window is not provided or state is invalid.
        zclient_window is requiredzstate is requiredÚ__dataclass_fields__)rƒ   r   zbrowser.setClientWindowState)r   r}   Ú__dict__rp   r   rl   rq   )r$   r   r   Ústate_paramrs   rt   rr   ru   s           r   Úset_client_window_statezBrowser.set_client_window_stateB  sª   € ð" Ð ÜÐ8Ó9Ð9Øˆ=ÜÐ0Ó1Ð1ð ˆÜ�5Ð0Ô1ð "'§¡×!5Ñ!5Ó!7÷Ù˜˜AØ�=ð �1‘ðˆKñ ð *Ø ñ
ˆô Ð<¸fÓEˆØ�z‰z×!Ñ! #Ó&Ð&ùós   ÁB)ÚreturnÚNone)NNN)rA   r   rB   r   rC   r   rk   )r=   r   )r	   r   r   rZ   r   zlist[Any] | None)NN)r   r   r   r   )r5   r6   r7   r8   rn   rw   r€   rˆ   r‹   rŽ   r‘   r–   r:   r   r   ri   ri   Ä   s–   „ Ù(óòð .2Ø Ø04ð	à*ðð ðð $.ó	ò4ò0ô ð  $Ø)-Ø*.ð	'àð'ð 'ð'ð (ó	'ðD %)Ø ð$'à!ð$'ð ô$'r   ri   )r	   r   r   rZ   r—   zdict[str, Any] | Nonerk   )r	   r   r   rZ   r   r   r—   r˜   )Ú
__future__r   Údataclassesr   r   Útypingr   Ú%selenium.webdriver.common.bidi.commonr   r   r   r   r<   r@   rE   rL   rN   rP   rV   rY   r\   r^   rg   ri   r:   r   r   ú<module>r�      s�  ðõ #ç (Ý å AðØðà"ðð óð< !%ðYØðYà"ðYð ðYð 
ó	Yð* ÷%ð %ó ð%ðR ÷$ð $ó ð$ð ÷1ð 1ó ð1ð ÷<ð <ó ð<ð ÷;ð ;ó ð;ð ÷$ð $ó ð$ð ÷ð ó ðð ÷;ð ;ó ð;ð ÷*ð *ó ð*ð ÷4ð 4ó ð4÷ñ ð ÷
ð 
ó ð
÷b'ò b'r   