Ë
    cQbj¹ø  ã                  óô  — d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddlZddlmZ ddlmZmZ ddlmZ ddlmZmZ ddlmZ dd	lmZmZmZ dd
lmZ ddlmZm Z m!Z!m"Z"m#Z# ddl$m%Z% ddl&m'Z' ddl(m)Z) ddl*m+Z+ ddl,m-Z- ddl.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5 ddl6m7Z7 ddl8m9Z9 ddl:m;Z;m<Z< ddl=m>Z> ddl?m@Z@ ddlAmBZB ddlCmDZD ddlEmFZF ddlGmHZHmIZI ddlJmKZK ddlLmMZM dd lNmOZO dd!lPmQZQ dd"lRmSZS dd#lTmUZU dd$lVmWZW dd%lXmYZY dd&lZm[Z[ da\d7d'„Z]d8d(„Z^	 d9	 	 	 	 	 	 	 	 	 	 	 d:d)„Z_d;d*„Z`er dd+lambZb dd,lcmdZd dd-lemfZf dd.lgmhZh dd/limjZjmkZk d0„ Zld1„ Zm G d2„ d3e¬4«      Zn G d5„ d6en«      Zoy)<zThe WebDriver implementation.é    )ÚannotationsN)ÚABCMeta)Ú	b64decodeÚurlsafe_b64encode)Ú	Generator)ÚasynccontextmanagerÚcontextmanager)Úimport_module)ÚTYPE_CHECKINGÚAnyÚcast)ÚSelf)ÚInvalidArgumentExceptionÚJavascriptExceptionÚNoSuchCookieExceptionÚNoSuchElementExceptionÚWebDriverException)ÚBrowser)ÚBrowsingContext)Ú	Emulation)ÚInput)ÚNetwork)ÚPermissions)ÚScript)ÚSession)ÚStorage)ÚWebExtension)ÚBy)Ú
ArgOptionsÚBaseOptions)ÚBidiConnection)ÚClientConfig)ÚCommand)ÚErrorHandler)ÚFedCM)ÚFileDetectorÚLocalFileDetector)ÚLocatorConverter)ÚMobile)ÚRemoteConnection)Ú	ScriptKey)Ú
ShadowRoot)ÚSwitchTo)Ú
WebElement)ÚWebSocketConnection)Ú
RelativeByc                 ó(   — t         st        d«      a y y )Nz"selenium.webdriver.common.bidi.cdp)Úcdpr
   © ó    úV/var/www/html/venv/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.pyÚ
import_cdpr6   P   s   € åÜÐ@ÓA‰ð r4   c                óz   — t        j                  | «      } i }| j                  «       D ]
  \  }}|||<   Œ di g|dœiS )a~  Makes a W3C alwaysMatch capabilities object.

    Filters out capability names that are not in the W3C spec. Spec-compliant
    drivers will reject requests containing unknown capability names.

    Moves the Firefox profile, if present, from the old location to the new Firefox
    options object.

    Args:
        caps: A dictionary of capabilities requested by the caller.
    Úcapabilities)Ú
firstMatchÚalwaysMatch)ÚcopyÚdeepcopyÚitems)ÚcapsÚalways_matchÚkÚvs       r5   Ú_create_capsrB   V   sK   € ô �=‰=˜Ó€DØ€LØ—
‘
“ò ‰ˆˆ1Øˆ�QŠðà¨B¨4ÀÑMÐNÐNr4   c                ó|  — t        |t        «      r#|xs t        |¬«      }||_        t	        |¬«      }| j                  d«      }|dk(  r	ddlm} |}n.|dv r	ddlm	} |}n!|d	k(  r	dd
l
m}	 |	}n|dv r	ddlm}
 |
}nt        }t        |d«      r#|j                  r|j                  j                  }n|} |||||¬«      S )N)Úremote_server_addr)Úclient_configÚbrowserNameÚchromer   )ÚChromeRemoteConnection©ÚMicrosoftEdgeÚwebview2)ÚEdgeRemoteConnectionÚfirefox)ÚFirefoxRemoteConnection)ÚsafarizSafari Technology Preview)ÚSafariRemoteConnectionrE   )rD   Ú
keep_aliveÚignore_proxyrE   )Ú
isinstanceÚstrr"   rD   r*   ÚgetÚ+selenium.webdriver.chrome.remote_connectionrH   Ú)selenium.webdriver.edge.remote_connectionrL   Ú,selenium.webdriver.firefox.remote_connectionrN   Ú+selenium.webdriver.safari.remote_connectionrP   ÚhasattrrE   )r8   Úcommand_executorrQ   Úignore_local_proxyrE   Úbrowser_namerH   ÚhandlerrL   rN   rP   rD   s               r5   Úget_remote_connectionr_   i   sÎ   € ô Ð"¤CÔ(Ø%ÒZ¬ÐIYÔ)ZˆØ+;ˆÔ(Ü+¸-ÔHÐà×#Ñ# MÓ2€Là�xÒÝVà(‰Ø	Ð6Ñ	6ÝRà&‰Ø	˜Ò	"ÝXà)‰Ø	Ð@Ñ	@ÝVà(‰ä"ˆäÐ Ô1Ð6F×6TÒ6TØ-×;Ñ;×NÑNÑà-ÐáØ-ØØ'Ø#ô	ð r4   c                óð  — di i}g }| D ]!  }|j                  |j                  «       «       Œ# t        |«      }i }t        |«      D ]n  }|}|dz   |k  sŒ||   j	                  «       }|D ]I  }	|	||dz      j	                  «       v sŒ||   |	   ||dz      |	   k(  sŒ1|j                  |	||   |	   i«       ŒK Œp i }
|j                  «       D ]
  \  }}||
|<   Œ |D ]  }|
D ]  }||= Œ Œ |
|d   d<   ||d   d<   |S )Nr8   é   r:   r9   )ÚappendÚto_capabilitiesÚlenÚrangeÚkeysÚupdater=   )Úoptionsr8   ÚoptsÚoptÚ	opts_sizeÚsamesiesÚiÚ	min_indexÚ
first_keysÚkysÚalwaysr@   rA   Úopt_dicts                 r5   Úcreate_matchesrs   —   sW  € Ø$2°BÐ#7€LØ€DØò +ˆØ�‰�C×'Ñ'Ó)Õ*ð+ä�D“	€IØ€Hô �9Óò EˆØˆ	Øˆq‰5�9ÓØ˜i™×-Ñ-Ó/ˆJà!ò E�Ø˜$˜q 1™u™+×*Ñ*Ó,Ò,Ø˜I‘ sÑ+¨t°A¸±E©{¸3Ñ/?Ó?Ø Ÿ™¨¨d°9©o¸cÑ.BÐ(CÕDñEðEð €FØ—‘Ó ò ‰ˆˆ1ØˆˆqŠ	ðð ò ˆØò 	ˆAØ˜‘ñ	ðð 39€L�Ñ  Ñ/Ø15€L�Ñ  Ñ.àÐr4   ©ÚAPIRequestContext©ÚDialog)ÚPrintOptions©ÚTimeouts)Ú
CredentialÚVirtualAuthenticatorOptionsc                óB   ‡ — t        j                  ‰ «      ˆ fd„«       }|S )Nc                óh   •— | j                   d   j                  «       dvsJ d«       ‚ ‰| g|¢­i |¤ŽS )NrF   )rM   rO   z4This only currently works in Chromium based browsers)r>   Úlower©ÚselfÚargsÚkwargsÚfuncs      €r5   Úwrapperz1_required_chromium_based_browser.<locals>.wrapperÂ   sE   ø€ à�y‰y˜Ñ'×-Ñ-Ó/Ð7LÑLð 	
ØBó	
ÐLñ �DÐ*˜4Ò* 6Ñ*Ð*r4   )Ú	functoolsÚwraps©r„   r…   s   ` r5   Ú _required_chromium_based_browserr‰   Á   s%   ø€ Ü‡_�_�TÓó+ó ð+ð €Nr4   c                óT   ‡ — t        j                  ‰ «      t        ˆ fd„«       «       }|S )Nc                óJ   •— | j                   st        d«      ‚ ‰| g|¢­i |¤ŽS )Nz9This function requires a virtual authenticator to be set.)Úvirtual_authenticator_idÚ
ValueErrorr€   s      €r5   r…   z0_required_virtual_authenticator.<locals>.wrapperÍ   s/   ø€ ð ×,Ò,ÜÐXÓYÐYÙ�DÐ*˜4Ò* 6Ñ*Ð*r4   )r†   r‡   r‰   rˆ   s   ` r5   Ú_required_virtual_authenticatorrŽ   Ì   s-   ø€ Ü‡_�_�TÓÜ%ó+ó &ó ð+ð
 €Nr4   c                  ó   — e Zd ZdZy)ÚBaseWebDriverz«Abstract Base Class for all Webdriver subtypes.

    ABC's allow custom implementations of Webdriver to be registered so
    that isinstance type checks will succeed.
    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r3   r4   r5   r�   r�   ×   s   „ òr4   r�   )Ú	metaclassc                  óR  — e Zd ZdZeZeZ	 	 	 	 	 	 	 dc	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddd„Zded„Z	dfd„Z
	 	 	 	 	 	 dgd„Zed„ «       Zedhd„«       Zeded	„«       Zdid
„Zdid„Zdjd„Zd„ Zdkd„Zd„ Zdld„Z	 dm	 	 	 	 	 dnd„Zdod„Zeded„«       Zdmdpd„Zdqd„Zdrd„Zdsd„Zdsd„Zeded„«       Z eded„«       Z!did„Z"did„Z#eded„«       Z$edrd„«       Z%did„Z&did „Z'did!„Z(dmdtd"„Z)edud#„«       Z*did$„Z+did%„Z,did&„Z-dvd'„Z.dwd(„Z/did)„Z0did*„Z1did+„Z2dxd,„Z3dxd-„Z4dxd.„Z5edyd/„«       Z6e6jn                  did0„«       Z6e8jr                  dfdzd1„Z:e8jr                  dfd{d2„Z;ed|d3„«       Z<d}d4„Z=d}d5„Z>d~d6„Z?ded7„Z@dd€d8„ZAdd�d9„ZBdd‚d:„ZCdd|d;„ZDd€d<„ZEd|d=„ZFdƒd|d>„ZGed„d?„«       ZHeHjn                  did@„«       ZHed|dA„«       ZIeIjn                  didB„«       ZId…dC„ZJeKdD„ «       ZLed†dE„«       ZMdidF„ZNed‡dG„«       ZOedˆdH„«       ZPed‰dI„«       ZQedŠdJ„«       ZRed‹dK„«       ZSedŒdL„«       ZTed�dM„«       ZUedŽdN„«       ZVed�dO„«       ZWed�dP„«       ZXdQ„ ZYd‘dR„ZZed’dS„«       Z[e\didT„«       Z]e\d“dU„«       Z^e\d”dV„«       Z_e\d•dW„«       Z`e\didX„«       Zae\d–dY„«       Zbd—dZ„Zcd˜d[„Zddid\„Zedmd™d]„Zfedšd^„«       Zged}d_„«       Zhdid`„Zied›da„«       Zjdœdb„Zky)�Ú	WebDriveraÞ  Control a browser by sending commands to a remote WebDriver server.

    This class expects the remote server to be running the WebDriver wire protocol
    as defined at https://www.selenium.dev/documentation/legacy/json_wire_protocol/.

    Attributes:
    -----------
    session_id - String ID of the browser session started and controlled by this WebDriver.
    capabilities - Dictionary of effective capabilities of this browser session as returned
        by the remote server. See https://www.selenium.dev/documentation/legacy/desired_capabilities/
    command_executor : str or remote_connection.RemoteConnection object used to execute commands.
    error_handler - errorhandler.ErrorHandler object used to handle errors.
    Nc                ó<  — |€t        d«      ‚t        |t        «      rt        |«      }d}	n|j	                  «       }|j
                  }	|| _        t        | j                  t        t        f«      rt        ||||	|¬«      | _        d| _
        d| _        i | _        i | _        t        «       | _        t!        | «      | _        t%        | «      | _        |xs
 t)        «       | _        |xs
 t-        «       | _        |xs | j0                  | _        d| _        | j5                  «        | j7                  |«       t9        | «      | _        d| _        d| _        d| _         d| _!        d| _"        d| _#        d| _$        d| _%        d| _&        d| _'        d| _(        d| _)        d| _*        y)aã  Create a new driver instance that issues commands using the WebDriver protocol.

        Args:
            command_executor: Either a string representing the URL of the remote
                server or a custom remote_connection.RemoteConnection object.
                Defaults to 'http://127.0.0.1:4444/wd/hub'.
            keep_alive: (Deprecated) Whether to configure
                remote_connection.RemoteConnection to use HTTP keep-alive.
                Defaults to True.
            file_detector: Pass a custom file detector object during
                instantiation. If None, the default LocalFileDetector() will be
                used.
            options: Instance of a driver options.Options class.
            locator_converter: Custom locator converter to use. Defaults to None.
            web_element_cls: Custom class to use for web elements. Defaults to
                WebElement.
            client_config: Custom client configuration to use. Defaults to None.
        Nz`missing 1 required keyword-only argument: 'options' (instance of driver `options.Options` class)F)r[   rQ   r\   rE   T)+Ú	TypeErrorrS   Úlistrs   rc   Ú_ignore_local_proxyr[   rT   Úbytesr_   Ú
_is_remoteÚ
session_idr>   Úpinned_scriptsr$   Úerror_handlerr-   Ú
_switch_tor)   Ú_mobiler'   Úfile_detectorr(   Úlocator_converterÚ_web_element_clsÚ_authenticator_idÚstart_clientÚstart_sessionr%   Ú_fedcmÚ_websocket_connectionÚ_scriptÚ_networkÚ_browserÚ_bidi_sessionÚ_browsing_contextÚ_storageÚ_webextensionÚ_permissionsÚ
_emulationÚ_inputÚ_requestÚ	_devtools)
r�   r[   rQ   r£   rh   r¤   Úweb_element_clsrE   r8   r›   s
             r5   Ú__init__zWebDriver.__init__ñ   sˆ  € ð8 ˆ?ÜØróð ô ˜¤Ô&Ü)¨'Ó2ˆLØ"'Ñà"×2Ñ2Ó4ˆLØ")×"=Ñ"=ÐØ 0ˆÔÜ�d×+Ñ+¬c´5¨\Ô:Ü$9ØØ!1Ø%Ø#6Ø+ô%ˆDÔ!ð ˆŒØ&*ˆŒØ$&ˆŒ	Ø.0ˆÔÜ)›^ˆÔÜ" 4›.ˆŒÜ˜d“|ˆŒØ*ÒAÔ.?Ó.AˆÔØ!2Ò!HÔ6FÓ6HˆÔØ /Ò H°4×3HÑ3HˆÔØ!%ˆÔØ×ÑÔØ×Ñ˜<Ô(Ü˜D“kˆŒàAEˆÔ"Ø&*ˆŒØ(,ˆŒØ(,ˆŒØ-1ˆÔØ9=ˆÔØ(,ˆŒØ26ˆÔØ04ˆÔØ,0ˆŒØ$(ˆŒØ26ˆŒØ%)ˆ�r4   c                óz   — dt        | «      j                  › dt        | «      j                  › d| j                  › d�S )Nú<ú.z (session="z")>)Útyper’   r‘   rž   ©r�   s    r5   Ú__repr__zWebDriver.__repr__=  s9   € Ø”4˜“:×(Ñ(Ð)¨¬4°«:×+>Ñ+>Ð*?¸{È4Ï?É?ÐJ[Ð[^Ð_Ð_r4   c                ó   — | S ©Nr3   r½   s    r5   Ú	__enter__zWebDriver.__enter__@  s   € Øˆr4   c                ó$   — | j                  «        y rÀ   )Úquit)r�   Úexc_typeÚexcÚ	tracebacks       r5   Ú__exit__zWebDriver.__exit__C  s   € ð 	�	‰	�r4   c              /  óª   K  — d}t        | j                  |«      s| j                  } ||i |¤Ž| _        	 d–— |r|| _        yy# |r|| _        w w xY w­w)aB  Override the current file detector temporarily within a limited context.

        Ensures the original file detector is set after exiting the context.

        Args:
            file_detector_class: Class of the desired file detector. If the
                class is different from the current file_detector, then the
                class is instantiated with args and kwargs and used as a file
                detector during the duration of the context manager.
            *args: Optional arguments that get passed to the file detector class
                during instantiation.
            **kwargs: Keyword arguments, passed the same way as args.

        Example:
            ```
            with webdriver.file_detector_context(UselessFileDetector):
                someinput.send_keys("/etc/hosts")
            ````
        N)rS   r£   )r�   Úfile_detector_classr‚   rƒ   Úlast_detectors        r5   Úfile_detector_contextzWebDriver.file_detector_contextK  sc   è ø€ ð* ˆÜ˜$×,Ñ,Ð.AÔBØ ×.Ñ.ˆMÙ!4°dÐ!E¸fÑ!EˆDÔð	3ÛáØ%2�Õ"ð ø‰}Ø%2�Õ"ð üs   ‚2AµA ¹AÁAÁAc                ó   — | j                   S rÀ   )r¢   r½   s    r5   ÚmobilezWebDriver.mobilej  s   € à�|‰|Ðr4   c                óR   — d| j                   v r| j                   d   S t        d«      ‚)z=Returns the name of the underlying browser for this instance.rF   z1browserName not specified in session capabilities)r>   ÚKeyErrorr½   s    r5   ÚnamezWebDriver.namen  s+   € ð ˜DŸI™IÑ%Ø—9‘9˜]Ñ+Ð+ÜÐJÓKÐKr4   c                 ó   — y)zxCalled before starting a new session.

        This method may be overridden to define custom startup behavior.
        Nr3   r½   s    r5   r§   zWebDriver.start_clientu  s   € ð
 	r4   c                 ó   — y)z‚Called after executing a quit command.

        This method may be overridden to define custom shutdown
        behavior.
        Nr3   r½   s    r5   Ústop_clientzWebDriver.stop_client|  s   € ð 	r4   c                ó:  — t        |«      }	 | j                  t        j                  |«      d   }|j	                  d«      | _        |j	                  d«      | _        y# t        $ r4 t        | d«      r&| j                  �| j                  j                  «        ‚ w xY w)z•Creates a new session with the desired capabilities.

        Args:
            capabilities: A capabilities dict to start the session with.
        ÚvalueÚ	sessionIdr8   ÚserviceN)rB   Úexecuter#   ÚNEW_SESSIONrU   rž   r>   Ú	ExceptionrZ   r×   Ústop)r�   r8   r>   Úresponses       r5   r¨   zWebDriver.start_session„  sƒ   € ô ˜LÓ)ˆð	Ø—|‘|¤G×$7Ñ$7¸Ó>¸wÑGˆHØ&Ÿl™l¨;Ó7ˆDŒOØ Ÿ™ ^Ó4ˆD�IøÜò 	Ü�t˜YÔ'¨D¯L©LÐ,DØ—‘×!Ñ!Ô#Øð	ús   �AA Á=Bc                ó`  ‡ — t        |t        «      r0i }|j                  «       D ]  \  }}‰ j                  |«      ||<   Œ |S t        |‰ j                  «      rd|j
                  iS t        |‰ j                  «      rd|j
                  iS t        |t        «      rt        ˆ fd„|D «       «      S |S )Nú#element-6066-11e4-a52e-4f735466cecfú"shadow-6066-11e4-a52e-4f735466cecfc              3  ó@   •K  — | ]  }‰j                  |«      –— Œ y ­wrÀ   )Ú_wrap_value©Ú.0Úitemr�   s     €r5   ú	<genexpr>z(WebDriver._wrap_value.<locals>.<genexpr>Ÿ  s   øè ø€ ÒA°4˜×(Ñ(¨×.ÑAùó   ƒ)rS   Údictr=   rá   r¥   ÚidÚ_shadowroot_clsrš   )r�   rÕ   Ú	convertedÚkeyÚvals   `    r5   rá   zWebDriver._wrap_value”  s£   ø€ Ü�eœTÔ"ØˆIØ!ŸK™K›Mò 7‘��SØ!%×!1Ñ!1°#Ó!6�	˜#’ð7àÐÜ�e˜T×2Ñ2Ô3Ø9¸5¿8¹8ÐDÐDÜ�e˜T×1Ñ1Ô2Ø8¸%¿(¹(ÐCÐCÜ�eœTÔ"ÜÓA¸5ÔAÓAÐAØˆr4   c                ó&   — | j                  | |«      S )z6Creates a web element with the specified `element_id`.)r¥   )r�   Ú
element_ids     r5   Úcreate_web_elementzWebDriver.create_web_element¢  s   € à×$Ñ$ T¨:Ó6Ð6r4   c                ó.  ‡ — t        |t        «      r_d|v r‰ j                  |d   «      S d|v r‰ j                  ‰ |d   «      S |j	                  «       D ]  \  }}‰ j                  |«      ||<   Œ |S t        |t        «      rt        ˆ fd„|D «       «      S |S )NrÞ   rß   c              3  ó@   •K  — | ]  }‰j                  |«      –— Œ y ­wrÀ   )Ú_unwrap_valuerâ   s     €r5   rå   z*WebDriver._unwrap_value.<locals>.<genexpr>°  s   øè ø€ ÒC°T˜×*Ñ*¨4×0ÑCùræ   )rS   rç   rï   ré   r=   rò   rš   )r�   rÕ   rë   rì   s   `   r5   rò   zWebDriver._unwrap_value¦  sŸ   ø€ Ü�eœTÔ"Ø4¸Ñ=Ø×.Ñ.¨uÐ5ZÑ/[Ó\Ð\Ø3°uÑ<Ø×+Ñ+¨D°%Ð8\Ñ2]Ó^Ð^Ø!ŸK™K›Mò 5‘��SØ!×/Ñ/°Ó4��c’
ð5àˆLÜ�eœTÔ"ÜÓC¸UÔCÓCÐCØˆr4   c                ó2   — | j                  d||dœ«      d   S )aŒ  Execute Chrome Devtools Protocol command and get returned result.

        The command and command args should follow chrome devtools protocol domains/commands:
          - https://chromedevtools.github.io/devtools-protocol/

        Args:
            cmd: Command name.
            cmd_args: Command args. Empty dict {} if there is no command args.

        Returns:
            A dict, empty dict {} if there is no result to return. To
            getResponseBody: {'base64Encoded': False, 'body': 'response body
            string'}

        Example:
            `driver.execute_cdp_cmd("Network.getResponseBody", {"requestId": requestId})`
        ÚexecuteCdpCommand)ÚcmdÚparamsrÕ   )rØ   )r�   rõ   Úcmd_argss      r5   Úexecute_cdp_cmdzWebDriver.execute_cdp_cmd³  s!   € ð$ �|‰|Ð/¸ÈÑ1QÓRÐSZÑ[Ð[r4   c                ó2  — t        j                  |«      rE| j                  s| j                  «        | j                  €J ‚| j                  j	                  |«      S | j                  |«      }| j                  r$|sd| j                  i}nd|vr| j                  |d<   t        t        | j                  «      j	                  ||«      }|rA| j                  j                  |«       | j                  |j                  dd«      «      |d<   |S dd| j                  dœS )aÎ  Sends a command to be executed by a command.CommandExecutor.

        Args:
            driver_command: The name of the command to execute as a string.
                Can also be a BiDi protocol command generator.
            params: A dictionary of named parameters to send with the command.
                Ignored when ``driver_command`` is a BiDi generator.

        Returns:
            The command's JSON response loaded into a dictionary object.
        NrÖ   rÕ   r   )ÚsuccessrÕ   rÖ   )ÚinspectÚisgeneratorrª   Ú_start_bidirØ   rá   rž   r   r*   r[   r    Úcheck_responserò   rU   )r�   Údriver_commandrö   rÜ   s       r5   rØ   zWebDriver.executeÇ  s  € ô" ×Ñ˜~Ô.ð ×-Ò-Ø× Ñ Ô"Ø×-Ñ-Ð9Ð9Ð9Ø×-Ñ-×5Ñ5°nÓEÐEð ×!Ñ! &Ó)ˆà�?Š?ÙØ% t§¡Ð7‘Ø FÑ*Ø&*§o¡o��{Ñ#äÔ(¨$×*?Ñ*?Ó@×HÑHÈÐY_Ó`ˆáØ×Ñ×-Ñ-¨hÔ7Ø $× 2Ñ 2°8·<±<ÀÈÓ3NÓ OˆH�WÑØˆOð  t¸$¿/¹/ÑJÐJr4   c                óH   — | j                  t        j                  d|i«       y)aŠ  Navigate the browser to the specified URL.

        The method does not return until the page is fully loaded (i.e. the
        onload event has fired) in the current window or tab.

        Args:
            url: The URL to be opened by the browser. Must include the protocol
                (e.g., http://, https://).

        Example:
            `driver.get("https://example.com")`
        ÚurlN)rØ   r#   ÚGET)r�   r  s     r5   rU   zWebDriver.getó  s   € ð 	�‰”W—[‘[ 5¨# ,Õ/r4   c                ó`   — | j                  t        j                  «      j                  dd«      S )z¼Returns the title of the current page.

        Example:
            ```
            element = driver.find_element(By.ID, "foo")
            print(element.title())
            ```
        rÕ   Ú )rØ   r#   Ú	GET_TITLErU   r½   s    r5   ÚtitlezWebDriver.title  s&   € ð �|‰|œG×-Ñ-Ó.×2Ñ2°7¸BÓ?Ð?r4   c                ó†   — t        j                  dt        d¬«       t        |«      }|| j                  |j
                  <   |S )a  Store a JavaScript script by a unique hashable ID for later execution.

        .. deprecated::
            Use ``driver.script.pin()`` instead, which uses the WebDriver BiDi protocol.

        Example:
            `script = "return document.getElementById('foo').value"`
        z9pin_script is deprecated, use driver.script.pin() insteadé   ©Ú
stacklevel)ÚwarningsÚwarnÚDeprecationWarningr+   rŸ   rè   )r�   ÚscriptÚ
script_keyÚscript_key_instances       r5   Ú
pin_scriptzWebDriver.pin_script  sC   € ô 	�‰ØGÜØõ	
ô
 (¨
Ó3ÐØ6<ˆ×ÑÐ/×2Ñ2Ñ3Ø"Ð"r4   c                óÚ   — t        j                  dt        d¬«       	 | j                  j	                  |j
                  «       y# t        $ r t        d|› d| j                  › �«      d‚w xY w)zÚRemove a pinned script from storage.

        .. deprecated::
            Use ``driver.script.unpin()`` instead, which uses the WebDriver BiDi protocol.

        Example:
            `driver.unpin(script_key)`
        z6unpin is deprecated, use driver.script.unpin() insteadr  r	  zNo script with key: z existed in N)r  r  r  rŸ   Úpoprè   rÏ   )r�   r  s     r5   ÚunpinzWebDriver.unpin   sk   € ô 	�‰ØDÜØõ	
ð
	kØ×Ñ×#Ñ# J§M¡MÕ2øÜò 	kÜÐ1°*°¸\È$×J]ÑJ]ÐI^Ð_Ó`ÐfjÐjð	kús   ž%A Á&A*c                ód   — t        j                  dt        d¬«       t        | j                  «      S )zöReturn a list of all pinned scripts.

        .. deprecated::
            Use ``driver.script.pin()`` to manage preload scripts via the WebDriver BiDi protocol.

        Example:
            `pinned_scripts = driver.get_pinned_scripts()`
        z[get_pinned_scripts is deprecated, use driver.script.pin() to manage preload scripts insteadr  r	  )r  r  r  rš   rŸ   r½   s    r5   Úget_pinned_scriptszWebDriver.get_pinned_scripts3  s,   € ô 	�‰ØiÜØõ	
ô
 �D×'Ñ'Ó(Ð(r4   c                óì   — t        |t        «      r	 | j                  |j                     }t        |«      }t        j                  }| j                  |||dœ«      d   S # t        $ r t        d«      ‚w xY w)a   Synchronously Executes JavaScript in the current window/frame.

        Args:
            script: The javascript to execute.
            *args: Any applicable arguments for your JavaScript.

        Example:
            ```
            id = "username"
            value = "test_user"
            driver.execute_script("document.getElementById(arguments[0]).value = arguments[1];", id, value)
            ```
        z Pinned script could not be found©r  r‚   rÕ   )
rS   r+   rŸ   rè   rÏ   r   rš   r#   ÚW3C_EXECUTE_SCRIPTrØ   ©r�   r  r‚   Úconverted_argsÚcommands        r5   Úexecute_scriptzWebDriver.execute_scriptC  sy   € ô �fœiÔ(ðNØ×,Ñ,¨V¯Y©YÑ7�ô ˜d›ˆÜ×,Ñ,ˆà�|‰|˜G°ÀÑ%OÓPÐQXÑYÐYøô ò NÜ)Ð*LÓMÐMðNús   ’A ÁA3c                óh   — t        |«      }t        j                  }| j                  |||dœ«      d   S )a¿  Asynchronously Executes JavaScript in the current window/frame.

        Args:
            script: The javascript to execute.
            *args: Any applicable arguments for your JavaScript.

        Example:
            ```
            script = "var callback = arguments[arguments.length - 1]; "
                "window.setTimeout(function(){ callback('timeout') }, 3000);"
            driver.execute_async_script(script)
            ```
        r  rÕ   )rš   r#   ÚW3C_EXECUTE_SCRIPT_ASYNCrØ   r  s        r5   Úexecute_async_scriptzWebDriver.execute_async_script\  s4   € ô ˜d›ˆÜ×2Ñ2ˆà�|‰|˜G°ÀÑ%OÓPÐQXÑYÐYr4   c                óF   — | j                  t        j                  «      d   S )z!Gets the URL of the current page.rÕ   )rØ   r#   ÚGET_CURRENT_URLr½   s    r5   Úcurrent_urlzWebDriver.current_urlo  ó   € ð �|‰|œG×3Ñ3Ó4°WÑ=Ð=r4   c                óF   — | j                  t        j                  «      d   S )z$Gets the source of the current page.rÕ   )rØ   r#   ÚGET_PAGE_SOURCEr½   s    r5   Úpage_sourcezWebDriver.page_sourcet  r$  r4   c                óB   — | j                  t        j                  «       y)zCloses the current window.N)rØ   r#   ÚCLOSEr½   s    r5   ÚclosezWebDriver.closey  s   € à�‰”W—]‘]Õ#r4   c                óD  — 	 | j                   �!| j                   j                  «        d| _         | j                  t        j                  «       | j
                  �!| j
                  j                  «        d| _        | j                  «        t        t        | j                  «      }|j                  «        y# | j
                  �!| j
                  j                  «        d| _        | j                  «        t        t        | j                  «      }|j                  «        w xY w)z4Quits the driver and closes every associated window.N)rª   r*  rØ   r#   ÚQUITrµ   ÚdisposerÓ   r   r*   r[   )r�   Úexecutors     r5   rÃ   zWebDriver.quit}  s×   € ð	ð ×)Ñ)Ð5Ø×*Ñ*×0Ñ0Ô2Ø-1�Ô*Ø�L‰LœŸ™Ô&à�}‰}Ð(Ø—‘×%Ñ%Ô'Ø $�”Ø×ÑÔÜÔ,¨d×.CÑ.CÓDˆHØ�N‰NÕøð �}‰}Ð(Ø—‘×%Ñ%Ô'Ø $�”Ø×ÑÔÜÔ,¨d×.CÑ.CÓDˆHØ�N‰NÕús   ‚AB6 Â6A)Dc                óF   — | j                  t        j                  «      d   S )z)Returns the handle of the current window.rÕ   )rØ   r#   ÚW3C_GET_CURRENT_WINDOW_HANDLEr½   s    r5   Úcurrent_window_handlezWebDriver.current_window_handleŽ  s   € ð �|‰|œG×AÑAÓBÀ7ÑKÐKr4   c                óF   — | j                  t        j                  «      d   S )z>Returns the handles of all windows within the current session.rÕ   )rØ   r#   ÚW3C_GET_WINDOW_HANDLESr½   s    r5   Úwindow_handleszWebDriver.window_handles“  s   € ð �|‰|œG×:Ñ:Ó;¸GÑDÐDr4   c                óH   — t         j                  }| j                  |d«       y)z5Maximizes the current window that webdriver is using.N)r#   ÚW3C_MAXIMIZE_WINDOWrØ   )r�   r  s     r5   Úmaximize_windowzWebDriver.maximize_window˜  s   € ä×-Ñ-ˆØ�‰�W˜dÕ#r4   c                óB   — | j                  t        j                  «       y)z<Invokes the window manager-specific 'full screen' operation.N)rØ   r#   ÚFULLSCREEN_WINDOWr½   s    r5   Úfullscreen_windowzWebDriver.fullscreen_window�  s   € à�‰”W×.Ñ.Õ/r4   c                óB   — | j                  t        j                  «       y)z9Invokes the window manager-specific 'minimize' operation.N)rØ   r#   ÚMINIMIZE_WINDOWr½   s    r5   Úminimize_windowzWebDriver.minimize_window¡  s   € à�‰”W×,Ñ,Õ-r4   c                óp   — i }|r|j                  «       }| j                  t        j                  |«      d   S )z‰Takes PDF of the current page.

        The driver makes a best effort to return a PDF based on the
        provided parameters.
        rÕ   )Úto_dictrØ   r#   Ú
PRINT_PAGE)r�   Úprint_optionsrh   s      r5   Ú
print_pagezWebDriver.print_page¥  s6   € ð )+ˆÙØ#×+Ñ+Ó-ˆGà�|‰|œG×.Ñ.°Ó8¸ÑAÐAr4   c                ó   — | j                   S )aP  Return an object containing all options to switch focus into.

        Returns:
            An object containing all options to switch focus into.

        Examples:
            `element = driver.switch_to.active_element`
            `alert = driver.switch_to.alert`
            `driver.switch_to.default_content()`
            `driver.switch_to.frame("frame_name")`
            `driver.switch_to.frame(1)`
            `driver.switch_to.frame(driver.find_elements(By.TAG_NAME, "iframe")[0])`
            `driver.switch_to.parent_frame()`
            `driver.switch_to.window("main")`
        )r¡   r½   s    r5   Ú	switch_tozWebDriver.switch_to±  s   € ð" �‰Ðr4   c                óB   — | j                  t        j                  «       y)z.Goes one step backward in the browser history.N)rØ   r#   ÚGO_BACKr½   s    r5   ÚbackzWebDriver.backÅ  ó   € à�‰”W—_‘_Õ%r4   c                óB   — | j                  t        j                  «       y)z-Goes one step forward in the browser history.N)rØ   r#   Ú
GO_FORWARDr½   s    r5   ÚforwardzWebDriver.forwardÉ  s   € à�‰”W×'Ñ'Õ(r4   c                óB   — | j                  t        j                  «       y)zRefreshes the current page.N)rØ   r#   ÚREFRESHr½   s    r5   ÚrefreshzWebDriver.refreshÍ  rH  r4   c                óF   — | j                  t        j                  «      d   S )z¾Get all cookies visible to the current WebDriver instance.

        Returns:
            A list of dictionaries, corresponding to cookies visible in the
            current session.
        rÕ   )rØ   r#   ÚGET_ALL_COOKIESr½   s    r5   Úget_cookieszWebDriver.get_cookiesÑ  s   € ð �|‰|œG×3Ñ3Ó4°WÑ=Ð=r4   c                óä   — |r|j                  «       rt        d«      ‚t        j                  t        «      5  | j                  t        j                  d|i«      d   cddd«       S # 1 sw Y   yxY w)a  Get a single cookie by name (case-sensitive,).

        Returns:
             A cookie dictionary or None if not found.

        Raises:
            ValueError if the name is empty or whitespace.

        Example:
            `cookie = driver.get_cookie("my_cookie")`
        úCookie name cannot be emptyrÐ   rÕ   N)Úisspacer�   Ú
contextlibÚsuppressr   rØ   r#   Ú
GET_COOKIE©r�   rÐ   s     r5   Ú
get_cookiezWebDriver.get_cookieÚ  se   € ñ �t—|‘|”~ÜÐ:Ó;Ð;ä× Ñ Ô!6Ó7ñ 	MØ—<‘<¤× 2Ñ 2°V¸T°NÓCÀGÑL÷	M÷ 	Mñ 	Mð ús   ·%A&Á&A/c                ó‚   — |r|j                  «       rt        d«      ‚| j                  t        j                  d|i«       y)zÓDelete a single cookie with the given name (case-sensitive).

        Raises:
            ValueError if the name is empty or whitespace.

        Example:
            `driver.delete_cookie("my_cookie")`
        rS  rÐ   N)rT  r�   rØ   r#   ÚDELETE_COOKIErX  s     r5   Údelete_cookiezWebDriver.delete_cookieî  s3   € ñ �t—|‘|”~ÜÐ:Ó;Ð;à�‰”W×*Ñ*¨V°T¨NÕ;r4   c                óB   — | j                  t        j                  «       y)z/Delete all cookies in the scope of the session.N)rØ   r#   ÚDELETE_ALL_COOKIESr½   s    r5   Údelete_all_cookieszWebDriver.delete_all_cookiesý  s   € à�‰”W×/Ñ/Õ0r4   c                ó¨   — d|v r,|d   dv sJ ‚| j                  t        j                  d|i«       y| j                  t        j                  d|i«       y)aZ  Adds a cookie to your current session.

        Args:
            cookie_dict: A dictionary object, with required keys - "name" and
                "value"; Optional keys - "path", "domain", "secure", "httpOnly",
                "expiry", "sameSite".

        Examples:
            `driver.add_cookie({"name": "foo", "value": "bar"})`
            `driver.add_cookie({"name": "foo", "value": "bar", "path": "/"})`
            `driver.add_cookie({"name": "foo", "value": "bar", "path": "/", "secure": True})`
            `driver.add_cookie({"name": "foo", "value": "bar", "sameSite": "Strict"})`
        ÚsameSite)ÚStrictÚLaxÚNoneÚcookieN)rØ   r#   Ú
ADD_COOKIE)r�   Úcookie_dicts     r5   Ú
add_cookiezWebDriver.add_cookie  sR   € ð ˜Ñ$Ø˜zÑ*Ð.GÑGÐGÐGØ�L‰Lœ×+Ñ+¨h¸Ð-DÕEà�L‰Lœ×+Ñ+¨h¸Ð-DÕEr4   c           	     ór   — | j                  t        j                  dt        t	        |«      dz  «      i«       y)aÜ  Set a sticky implicit timeout for element location and command completion.

        This method sets a timeout that applies to all element location strategies
        for the duration of the session. It only needs to be called once per session.
        To set the timeout for asynchronous script execution, see set_script_timeout.

        Args:
            time_to_wait: Amount of time to wait (in seconds).

        Example:
            `driver.implicitly_wait(30)`
        Úimplicitéè  N©rØ   r#   ÚSET_TIMEOUTSÚintÚfloat©r�   Útime_to_waits     r5   Úimplicitly_waitzWebDriver.implicitly_wait  s-   € ð 	�‰”W×)Ñ)¨J¼¼EÀ,Ó<OÐRVÑ<VÓ8WÐ+XÕYr4   c           	     ór   — | j                  t        j                  dt        t	        |«      dz  «      i«       y)aK  Set the timeout for asynchronous script execution.

        This timeout specifies how long a script can run during an
        execute_async_script call before throwing an error.

        Args:
            time_to_wait: The amount of time to wait (in seconds).

        Example:
            `driver.set_script_timeout(30)`
        r  rk  Nrl  rp  s     r5   Úset_script_timeoutzWebDriver.set_script_timeout%  s-   € ð 	�‰”W×)Ñ)¨H´c¼%ÀÓ:MÐPTÑ:TÓ6UÐ+VÕWr4   c           	     óð   — 	 | j                  t        j                  dt        t	        |«      dz  «      i«       y# t
        $ r2 | j                  t        j                  t	        |«      dz  ddœ«       Y yw xY w)a,  Set the timeout for page load completion.

        This specifies how long to wait for a page load to complete before
        throwing an error.

        Args:
            time_to_wait: The amount of time to wait (in seconds).

        Example:
            `driver.set_page_load_timeout(30)`
        ÚpageLoadrk  z	page load)Úmsr¼   N)rØ   r#   rm  rn  ro  r   rp  s     r5   Úset_page_load_timeoutzWebDriver.set_page_load_timeout3  sf   € ð	Ø�L‰Lœ×-Ñ-°
¼CÄÀlÓ@SÐVZÑ@ZÓ<[Ð/\Õ]øÜ!ò 	Ø�L‰LÜ×$Ñ$Ü˜\Ó*¨TÑ1¸;ÑGöð	ús   ‚7: º8A5Á4A5c                óì   — ddl m} | j                  t        j                  «      d   }|j                  d«      dz  |d<   |j                  d«      dz  |d<   |j                  d	«      dz  |d	<    |d
i |¤ŽS )aŠ  Get all the timeouts that have been set on the current session.

        Returns:
            A named tuple with the following fields:
              - implicit_wait: The time to wait for elements to be found.
              - page_load: The time to wait for a page to load.
              - script: The time to wait for scripts to execute.

        Example:
            `driver.timeouts`
        r   ry   rÕ   rj  rk  Úimplicit_waitrv  Ú	page_loadr  r3   )Ú"selenium.webdriver.common.timeoutsrz   rØ   r#   ÚGET_TIMEOUTSr  )r�   rz   Útimeoutss      r5   r~  zWebDriver.timeoutsG  sw   € õ 	@à—<‘<¤× 4Ñ 4Ó5°gÑ>ˆØ$,§L¡L°Ó$<¸tÑ$Cˆ�Ñ!Ø (§¡¨ZÓ 8¸4Ñ ?ˆ�ÑØ%Ÿ\™\¨(Ó3°dÑ:ˆ�ÑÙÑ#˜(Ñ#Ð#r4   c                óf   — | j                  t        j                  |j                  «       «      d   }y)a  Set all timeouts for the session.

        This will override any previously set timeouts.

        Example:
            ```
            my_timeouts = Timeouts()
            my_timeouts.implicit_wait = 10
            driver.timeouts = my_timeouts
            ```
        rÕ   N)rØ   r#   rm  Ú_to_json)r�   r~  Ú_s      r5   r~  zWebDriver.timeouts\  s(   € ð �L‰Lœ×-Ñ-¨x×/@Ñ/@Ó/BÓCÀGÑL‰r4   c                ó  — | j                   j                  ||«      \  }}t        |t        «      r2| j	                  ||¬«      }|st        d|j                  › �«      ‚|d   S | j                  t        j                  ||dœ«      d   S )a7  Find an element given a By strategy and locator.

        Args:
            by: The locating strategy to use. Default is `By.ID`. Supported
                values include: By.ID, By.NAME, By.XPATH, By.CSS_SELECTOR,
                By.CLASS_NAME, By.TAG_NAME, By.LINK_TEXT, By.PARTIAL_LINK_TEXT,
                or RelativeBy.
            value: The locator value to use with the specified `by` strategy.

        Returns:
            The first matching WebElement found on the page.

        Example:
            `element = driver.find_element(By.ID, 'foo')`
        )ÚbyrÕ   z%Cannot locate relative element with: r   ©ÚusingrÕ   rÕ   )
r¤   ÚconvertrS   r0   Úfind_elementsr   ÚrootrØ   r#   ÚFIND_ELEMENT)r�   rƒ  rÕ   Úelementss       r5   Úfind_elementzWebDriver.find_elementk  s‰   € ð  ×*Ñ*×2Ñ2°2°uÓ=‰	ˆˆEä�bœ*Ô%Ø×)Ñ)¨R°uÐ)Ó=ˆHÙÜ,Ð/TÐUW×U\ÑU\ÐT]Ð-^Ó_Ð_Ø˜A‘;Ðà�|‰|œG×0Ñ0¸BÈÑ2OÓPÐQXÑYÐYr4   c                ó¼  — | j                   j                  ||«      \  }}t        |t        «      r„dj	                  t
        j                  d«      dd «      }t        j                  |d«      }|€t        d|› �«      ‚|j                  d«      }d|› d�}| j                  ||j                  «       «      S | j                  t        j                  ||d	œ«      d
   xs g S )aF  Find elements given a By strategy and locator.

        Args:
            by: The locating strategy to use. Default is `By.ID`. Supported
                values include: By.ID, By.NAME, By.XPATH, By.CSS_SELECTOR,
                By.CLASS_NAME, By.TAG_NAME, By.LINK_TEXT, By.PARTIAL_LINK_TEXT,
                or RelativeBy.
            value: The locator value to use with the specified `by` strategy.

        Returns:
            List of WebElements matching locator strategy found on the page.

        Example:
            `element = driver.find_elements(By.ID, 'foo')`
        r»   NéÿÿÿÿzfindElements.jsz*Could not find findElements.js in package Úutf8z/* findElements */return (z).apply(null, arguments);r„  rÕ   )r¤   r†  rS   r0   Újoinr‘   ÚsplitÚpkgutilÚget_dataÚFileNotFoundErrorÚdecoder  r?  rØ   r#   ÚFIND_ELEMENTS)r�   rƒ  rÕ   Ú_pkgÚraw_dataÚraw_functionÚfind_element_jss          r5   r‡  zWebDriver.find_elements…  sÖ   € ð  ×*Ñ*×2Ñ2°2°uÓ=‰	ˆˆEä�bœ*Ô%Ø—8‘8œHŸN™N¨3Ó/°°Ð4Ó5ˆDÜ×'Ñ'¨Ð.?Ó@ˆHØÐÜ'Ð*TÐUYÐTZÐ([Ó\Ð\Ø#Ÿ?™?¨6Ó2ˆLØ :¸<¸.ÐHaÐbˆOØ×&Ñ& ¸¿
¹
»ÓEÐEð �|‰|œG×1Ñ1¸RÈ%Ñ3PÓQÐRYÑZÒ`Ð^`Ð`r4   c                ó   — | j                   S )z4Returns the drivers current capabilities being used.)r>   r½   s    r5   r8   zWebDriver.capabilities¤  s   € ð �y‰yÐr4   c                ó@  — t        |«      j                  «       j                  d«      st        j                  dt
        d¬«       | j                  «       }	 t        |d«      5 }|j                  |«       ddd«       ~y# 1 sw Y   ŒxY w# t        $ r Y ~yw xY w# ~w xY w)	až  Save a screenshot of the current window to a PNG image file.

        Returns:
            False if there is any IOError, else returns True. Use full paths in your filename.

        Args:
            filename: The full path you wish to save your screenshot to. This
                should end with a `.png` extension.

        Example:
            `driver.get_screenshot_as_file("./screenshots/foo.png")`
        z.pngz^name used for saved screenshot does not match file type. It should end with a `.png` extensionr  r	  ÚwbNFT)
rT   r   Úendswithr  r  ÚUserWarningÚget_screenshot_as_pngÚopenÚwriteÚOSError)r�   ÚfilenameÚpngÚfs       r5   Úget_screenshot_as_filez WebDriver.get_screenshot_as_file©  s—   € ô �8‹}×"Ñ"Ó$×-Ñ-¨fÔ5Ü�M‰MØpÜØõð
 ×(Ñ(Ó*ˆð	Ü�h Ó%ð ¨Ø—‘˜”÷ð
 Ø÷ð ûäò 	Øáð	ûñ ús<   ÁB
 Á"A>Á4B
 Á>BÂB
 Â
	BÂB ÂBÂB ÂBc                ó$   — | j                  |«      S )a—  Save a screenshot of the current window to a PNG image file.

        Returns:
            False if there is any IOError, else returns True. Use full paths in your filename.

        Args:
            filename: The full path you wish to save your screenshot to. This
                should end with a `.png` extension.

        Example:
            `driver.save_screenshot("./screenshots/foo.png")`
        )r¦  )r�   r£  s     r5   Úsave_screenshotzWebDriver.save_screenshotÆ  s   € ð ×*Ñ*¨8Ó4Ð4r4   c                óR   — t        | j                  «       j                  d«      «      S )zƒGets the screenshot of the current window as a binary data.

        Example:
            `driver.get_screenshot_as_png()`
        Úascii)r   Úget_screenshot_as_base64Úencoder½   s    r5   rŸ  zWebDriver.get_screenshot_as_pngÕ  s#   € ô ˜×6Ñ6Ó8×?Ñ?ÀÓHÓIÐIr4   c                óF   — | j                  t        j                  «      d   S )zÅGet a base64-encoded screenshot of the current window.

        This encoding is useful for embedding screenshots in HTML.

        Example:
            `driver.get_screenshot_as_base64()`
        rÕ   )rØ   r#   Ú
SCREENSHOTr½   s    r5   r«  z"WebDriver.get_screenshot_as_base64Ý  s   € ð �|‰|œG×.Ñ.Ó/°Ñ8Ð8r4   c                óp   — | j                  |«       | j                  t        |«      t        |«      ¬«       y)aY  Sets the width and height of the current window.

        Args:
            width: The width in pixels to set the window to.
            height: The height in pixels to set the window to.
            windowHandle: The handle of the window to resize. Default is "current".

        Example:
            `driver.set_window_size(800, 600)`
        ©ÚwidthÚheightN©Ú"_check_if_window_handle_is_currentÚset_window_rectrn  )r�   r±  r²  ÚwindowHandles       r5   Úset_window_sizezWebDriver.set_window_sizeç  s-   € ð 	×/Ñ/°Ô=Ø×Ñ¤3 u£:´c¸&³kÐÕBr4   c                ó¤   — | j                  |«       | j                  «       }|j                  dd«      r|d   }dD �ci c]  }|||   “Œ
 c}S c c}w )zrGets the width and height of the current window.

        Example:
            `driver.get_window_size()`
        rÕ   Nr°  )r´  Úget_window_rectrU   )r�   r¶  Úsizer@   s       r5   Úget_window_sizezWebDriver.get_window_sizeõ  sS   € ð 	×/Ñ/°Ô=Ø×#Ñ#Ó%ˆà�8‰8�G˜TÔ"Ø˜‘=ˆDà$7Ö8˜q��4˜‘7‘
Ò8Ð8ùÒ8s   ½Ac                ón   — | j                  |«       | j                  t        |«      t        |«      ¬«      S )ai  Sets the x,y position of the current window.

        Args:
            x: The x-coordinate in pixels to set the window position.
            y: The y-coordinate in pixels to set the window position.
            windowHandle: The handle of the window to reposition. Default is "current".

        Example:
            `driver.set_window_position(0, 0)`
        ©ÚxÚyr³  )r�   r¾  r¿  r¶  s       r5   Úset_window_positionzWebDriver.set_window_position  s0   € ð 	×/Ñ/°Ô=Ø×#Ñ#¤c¨!£f´°A³Ð#Ó7Ð7r4   c                óv   — | j                  |«       | j                  «       }dD �ci c]  }|||   “Œ
 c}S c c}w )zrGets the x,y position of the current window.

        Example:
            `driver.get_window_position()`
        r½  )r´  r¹  )r�   r¶  Úpositionr@   s       r5   Úget_window_positionzWebDriver.get_window_position  s<   € ð 	×/Ñ/°Ô=Ø×'Ñ'Ó)ˆà(2Ö3 1��8˜A‘;‘Ò3Ð3ùÒ3s   ¦6c                ó>   — |dk7  rt        j                  dd¬«       yy)z5Warns if the window handle is not equal to `current`.Úcurrentz?Only 'current' window is supported for W3C compatible browsers.r  r	  N)r  r  )r�   r¶  s     r5   r´  z,WebDriver._check_if_window_handle_is_current  s!   € à˜9Ò$Ü�M‰MØQØöð %r4   c                óF   — | j                  t        j                  «      d   S )zÀGet the window's position and size.

        Returns:
            x, y coordinates and height and width of the current window.

        Example:
            `driver.get_window_rect()`
        rÕ   )rØ   r#   ÚGET_WINDOW_RECTr½   s    r5   r¹  zWebDriver.get_window_rect$  s   € ð �|‰|œG×3Ñ3Ó4°WÑ=Ð=r4   c                óx   — |€|€|s|st        d«      ‚| j                  t        j                  ||||dœ«      d   S )aÔ  Set the window's position and size.

        Sets the x, y coordinates and height and width of the current window.
        This method is only supported for W3C compatible browsers; other browsers
        should use `set_window_position` and `set_window_size`.

        Example:
            `driver.set_window_rect(x=10, y=10)`
            `driver.set_window_rect(width=100, height=200)`
            `driver.set_window_rect(x=10, y=10, width=100, height=200)`
        z'x and y or height and width need values)r¾  r¿  r±  r²  rÕ   )r   rØ   r#   ÚSET_WINDOW_RECT)r�   r¾  r¿  r±  r²  s        r5   rµ  zWebDriver.set_window_rect/  sD   € ð ˆI˜!˜)©f¹UÜ*Ð+TÓUÐUà�|‰|œG×3Ñ3¸1À1ÈuÐ`fÑ5gÓhÐipÑqÐqr4   c                ó   — | j                   S rÀ   )Ú_file_detectorr½   s    r5   r£   zWebDriver.file_detector@  s   € à×"Ñ"Ð"r4   c                ób   — |st        d«      ‚t        |t        «      st        d«      ‚|| _        y)a  Set the file detector for keyboard input.

        By default, this is set to a file detector that does nothing.
        See FileDetector, LocalFileDetector, and UselessFileDetector.

        Args:
            detector: The detector to use. Must not be None.
        z,You may not set a file detector that is nullz+Detector has to be instance of FileDetectorN)r   rS   r&   rË  )r�   Údetectors     r5   r£   zWebDriver.file_detectorD  s1   € ñ Ü$Ð%SÓTÐTÜ˜(¤LÔ1Ü$Ð%RÓSÐSØ&ˆÕr4   c                óF   — | j                  t        j                  «      d   S )zuGets the current orientation of the device.

        Example:
            `orientation = driver.orientation`
        rÕ   )rØ   r#   ÚGET_SCREEN_ORIENTATIONr½   s    r5   ÚorientationzWebDriver.orientationT  s   € ð �|‰|œG×:Ñ:Ó;¸GÑDÐDr4   c                óŠ   — ddg}|j                  «       |v r#| j                  t        j                  d|i«       yt	        d«      ‚)z±Sets the current orientation of the device.

        Args:
            value: Orientation to set it to.

        Example:
            `driver.orientation = "landscape"`
        Ú	LANDSCAPEÚPORTRAITrÐ  z>You can only set the orientation to 'LANDSCAPE' and 'PORTRAIT'N)ÚupperrØ   r#   ÚSET_SCREEN_ORIENTATIONr   )r�   rÕ   Úallowed_valuess      r5   rÐ  zWebDriver.orientation]  sA   € ð & zÐ2ˆØ�;‰;‹=˜NÑ*Ø�L‰Lœ×7Ñ7¸-ÈÐ9OÕPä$Ð%eÓfÐfr4   c                ó¼  — t        «        | j                  j                  d«      rX| j                  j                  d«      }| j                  j                  d«      }|€t        d«      ‚|j	                  d«      d   }n| j                  «       \  }}|st        d«      ‚t        €t        d«      ‚t        j                  |«      | _        | j                  r| j                  | j                  fS | j                  d   j                  «       d	k(  rt        d
«      ‚t        | j                  t        «      st        d«      ‚t        || j                  j                   j"                  | j                  j                   j$                  «      | _	        | j                  j'                  | j                  j(                  j+                  «       «      }|D ])  }|j,                  | j.                  k(  sŒ|j,                  } n | j                  j'                  | j                  j(                  j1                  d«      «      }|| j                  _        | j                  | j                  fS )Núse:cdpúse:cdpVersionz%CDP version not found in capabilitiesr»   r   ú2Unable to find url to connect to from capabilitieszCDP module not loadedrF   rM   zJCDP support for Firefox has been removed. Please switch to WebDriver BiDi.zDcommand_executor must be a RemoteConnection instance for CDP supportT)r6   r>   rU   r   r�  Ú_get_cdp_detailsr2   Úimport_devtoolsr¶   rª   r   ÚRuntimeErrorrS   r[   r*   r/   rE   Úwebsocket_timeoutÚwebsocket_intervalrØ   ÚtargetÚget_targetsÚ	target_idr1  Úattach_to_targetrž   )r�   Úws_urlÚcdp_versionÚversionÚtargetsrà  râ  Úsessions           r5   Ústart_devtoolszWebDriver.start_devtoolsm  sñ  € äŒØ�9‰9�=‰=˜Ô"Ø—Y‘Y—]‘] 8Ó,ˆFØŸ)™)Ÿ-™-¨Ó8ˆKØÐ"Ü(Ð)PÓQÐQØ!×'Ñ'¨Ó,¨QÑ/‰Gà"×3Ñ3Ó5‰OˆG�VáÜ$Ð%YÓZÐZäˆ;Ü$Ð%<Ó=Ð=ä×,Ñ,¨WÓ5ˆŒØ×%Ò%Ø—>‘> 4×#=Ñ#=Ð=Ð=Ø�9‰9�]Ñ#×)Ñ)Ó+¨yÒ8ÜÐkÓlÐlÜ˜$×/Ñ/Ô1AÔBÜ$Ð%kÓlÐlÜ%8ØØ×!Ñ!×/Ñ/×AÑAØ×!Ñ!×/Ñ/×BÑBó&
ˆÔ"ð
 ×,Ñ,×4Ñ4°T·^±^×5JÑ5J×5VÑ5VÓ5XÓYˆØò 	ˆFØ×Ñ 4×#=Ñ#=Ó=Ø"×,Ñ,�	Ùð	ð ×,Ñ,×4Ñ4°T·^±^×5JÑ5J×5[Ñ5[Ð\eÐgkÓ5lÓmˆØ07ˆ×"Ñ"Ô-Ø�~‰~˜t×9Ñ9Ð9Ð9r4   c               óÌ  K  — t        «        | j                  j                  d«      rI| j                  j                  d«      }| j                  j                  d«      j                  d«      d   }n| j	                  «       \  }}|st        d«      ‚t        j                  |«      }d }t        | j                  t        «      r | j                  j                  j                  }t        j                  ||¬«      4 ƒd {  –—† }|j                  |j                  j!                  «       «      ƒ d {  –—† }|D ])  }|j"                  | j$                  k(  sŒ|j"                  } n |j'                  «      4 ƒd {  –—† }	t)        |	t        |«      ­–— d d d «      ƒd {  –—†  d d d «      ƒd {  –—†  y 7 Œ²7 Œƒ7 Œ=7 Œ# 1 ƒd {  –—†7  sw Y   Œ+xY w7 Œ"# 1 ƒd {  –—†7  sw Y   y xY w­w)NrØ  rÙ  r»   r   rÚ  )Úmax_message_size)r6   r>   rU   r�  rÛ  r   r2   rÜ  rS   r[   r*   rE   Úwebsocket_max_message_sizeÚopen_cdprØ   rà  rá  râ  r1  Úopen_sessionr!   )
r�   rä  ræ  Údevtoolsrë  Úconnrç  rà  râ  rè  s
             r5   Úbidi_connectionzWebDriver.bidi_connection”  s—  è ø€ ô 	ŒØ�9‰9�=‰=˜Ô"Ø—Y‘Y—]‘] 8Ó,ˆFØ—i‘i—m‘m OÓ4×:Ñ:¸3Ó?ÀÑB‰Gà"×3Ñ3Ó5‰OˆG�VáÜ$Ð%YÓZÐZä×&Ñ& wÓ/ˆØÐÜ�d×+Ñ+Ô-=Ô>Ø#×4Ñ4×BÑB×]Ñ]ÐÜ—<‘< Ð9I�<ÓJ÷ 	=ð 	=ÈdØ ŸL™L¨¯©×)DÑ)DÓ)FÓG×GˆGØ!ò �Ø×#Ñ# t×'AÑ'AÓAØ &× 0Ñ 0�IÙðð ×(Ñ(¨Ó3÷ =ð =°wÜ$ W¬c°8Ó<Ó<÷=÷ =÷	=÷ 	=ñ 	=øØGøð
=øð =ø÷ =÷ =ñ =úð	=ø÷ 	=÷ 	=ñ 	=üs¨   ‚C;G$Ã=F0Ã>G$Ä-GÄ.F2Ä/"GÅ$GÅ6F4Å7GÅ:F8ÆGÆF6ÆGÆG$Æ*GÆ+G$Æ2GÆ4GÆ6GÆ8G
	Æ>GÆ?G
	ÇGÇG$ÇG!ÇGÇG!ÇG$c                ó    — | j                   s| j                  «        | j                  st        | j                   | «      | _        | j                  S rÀ   )rª   rý   r«   r   r½   s    r5   r  zWebDriver.script®  s<   € à×)Ò)Ø×ÑÔà�|Š|Ü! $×"<Ñ"<¸dÓCˆDŒLà�|‰|Ðr4   c                ón  — | j                   j                  d«      r| j                   j                  d«      }nt        d«      ‚t        | j                  t
        «      st        d«      ‚t        || j                  j                  j                  | j                  j                  j                  «      | _
        y )NÚwebSocketUrlrÚ  zEcommand_executor must be a RemoteConnection instance for BiDi support)r>   rU   r   rS   r[   r*   r/   rE   rÞ  rß  rª   )r�   rä  s     r5   rý   zWebDriver._start_bidi¸  s‡   € Ø�9‰9�=‰=˜Ô(Ø—Y‘Y—]‘] >Ó2‰Fä$Ð%YÓZÐZä˜$×/Ñ/Ô1AÔBÜ$Ð%lÓmÐmä%8ØØ×!Ñ!×/Ñ/×AÑAØ×!Ñ!×/Ñ/×BÑBó&
ˆÕ"r4   c                óî   — | j                   s| j                  «        | j                   €J ‚t        | d«      r| j                  €(| j                   €J ‚t	        | j                   «      | _        | j                  S )Nr¬   )rª   rý   rZ   r¬   r   r½   s    r5   ÚnetworkzWebDriver.networkÇ  sj   € à×)Ò)Ø×ÑÔà×)Ñ)Ð5Ð5Ð5Ü�t˜ZÔ(¨D¯M©MÐ,AØ×-Ñ-Ð9Ð9Ð9Ü# D×$>Ñ$>Ó?ˆDŒMà�}‰}Ðr4   c                óž   — | j                   s| j                  «        | j                  €t        | j                   «      | _        | j                  S )a¯  Returns a browser module object for BiDi browser commands.

        Returns:
            An object containing access to BiDi browser commands.

        Examples:
            `user_context = driver.browser.create_user_context()`
            `user_contexts = driver.browser.get_user_contexts()`
            `client_windows = driver.browser.get_client_windows()`
            `driver.browser.remove_user_context(user_context)`
        )rª   rý   r­   r   r½   s    r5   ÚbrowserzWebDriver.browserÓ  s?   € ð ×)Ò)Ø×ÑÔà�=‰=Ð Ü# D×$>Ñ$>Ó?ˆDŒMà�}‰}Ðr4   c                óž   — | j                   s| j                  «        | j                  €t        | j                   «      | _        | j                  S )zBReturns the BiDi session object for the current WebDriver session.)rª   rý   r®   r   r½   s    r5   Ú_sessionzWebDriver._sessionè  sD   € ð ×)Ò)Ø×ÑÔà×ÑÐ%Ü!(¨×)CÑ)CÓ!DˆDÔà×!Ñ!Ð!r4   c                óž   — | j                   s| j                  «        | j                  €t        | j                   «      | _        | j                  S )aó  Returns a browsing context module object for BiDi browsing context commands.

        Returns:
            An object containing access to BiDi browsing context commands.

        Examples:
            `context_id = driver.browsing_context.create(type="tab")`
            `driver.browsing_context.navigate(context=context_id, url="https://www.selenium.dev")`
            `driver.browsing_context.capture_screenshot(context=context_id)`
            `driver.browsing_context.close(context_id)`
        )rª   rý   r¯   r   r½   s    r5   Úbrowsing_contextzWebDriver.browsing_contextó  sD   € ð ×)Ò)Ø×ÑÔà×!Ñ!Ð)Ü%4°T×5OÑ5OÓ%PˆDÔ"à×%Ñ%Ð%r4   c                óº   — | j                   s| j                  «        | j                   €J ‚| j                  €t        | j                   «      | _        | j                  S )aU  Returns a storage module object for BiDi storage commands.

        Returns:
            An object containing access to BiDi storage commands.

        Examples:
            ```
            cookie_filter = CookieFilter(name="example")
            result = driver.storage.get_cookies(filter=cookie_filter)
            cookie=PartialCookie("name", BytesValue(BytesValue.TYPE_STRING, "value")
            driver.storage.set_cookie(cookie=cookie, "domain"))
            cookie_filter=CookieFilter(name="example")
            driver.storage.delete_cookies(filter=cookie_filter)
            ```
        )rª   rý   r°   r   r½   s    r5   ÚstoragezWebDriver.storage  sQ   € ð" ×)Ò)Ø×ÑÔà×)Ñ)Ð5Ð5Ð5Ø�=‰=Ð Ü# D×$>Ñ$>Ó?ˆDŒMà�}‰}Ðr4   c                óž   — | j                   s| j                  «        | j                  €t        | j                   «      | _        | j                  S )aã  Get a permissions module object for BiDi permissions commands.

        Returns:
            An object containing access to BiDi permissions commands.

        Examples:
            ```
            from selenium.webdriver.common.bidi.permissions import PermissionDescriptor, PermissionState

            descriptor = PermissionDescriptor("geolocation")
            driver.permissions.set_permission(descriptor, PermissionState.GRANTED, "https://example.com")
            ```
        )rª   rý   r²   r   r½   s    r5   ÚpermissionszWebDriver.permissions"  sD   € ð ×)Ò)Ø×ÑÔà×ÑÐ$Ü +¨D×,FÑ,FÓ GˆDÔà× Ñ Ð r4   c                óž   — | j                   s| j                  «        | j                  €t        | j                   «      | _        | j                  S )ay  Get a webextension module object for BiDi webextension commands.

        Returns:
            An object containing access to BiDi webextension commands.

        Examples:
            `extension_path = "/path/to/extension"`
            `extension_result = driver.webextension.install(path=extension_path)`
            `driver.webextension.uninstall(extension_result)`
        )rª   rý   r±   r   r½   s    r5   ÚwebextensionzWebDriver.webextension9  sD   € ð ×)Ò)Ø×ÑÔà×ÑÐ%Ü!-¨d×.HÑ.HÓ!IˆDÔà×!Ñ!Ð!r4   c                óº   — | j                   s| j                  «        | j                   €J ‚| j                  €t        | j                   «      | _        | j                  S )aÑ  Get an emulation module object for BiDi emulation commands.

        Returns:
            An object containing access to BiDi emulation commands.

        Examples:
            ```
            from selenium.webdriver.common.bidi.emulation import GeolocationCoordinates

            coordinates = GeolocationCoordinates(37.7749, -122.4194)
            driver.emulation.set_geolocation_override(coordinates=coordinates, contexts=[context_id])
            ```
        )rª   rý   r³   r   r½   s    r5   Ú	emulationzWebDriver.emulationM  sQ   € ð ×)Ò)Ø×ÑÔà×)Ñ)Ð5Ð5Ð5Ø�?‰?Ð"Ü'¨×(BÑ(BÓCˆDŒOà�‰Ðr4   c                óž   — | j                   s| j                  «        | j                  €t        | j                   «      | _        | j                  S )a7  Get an input module object for BiDi input commands.

        Returns:
            An object containing access to BiDi input commands.

        Examples:
            ```
            from selenium.webdriver.common.bidi.input import KeySourceActions, KeyDownAction, KeyUpAction

            actions = KeySourceActions(id="keyboard", actions=[KeyDownAction(value="a"), KeyUpAction(value="a")])
            driver.input.perform_actions(driver.current_window_handle, [actions])
            driver.input.release_actions(driver.current_window_handle)
            ```
        )rª   rý   r´   r   r½   s    r5   ÚinputzWebDriver.inpute  s?   € ð  ×)Ò)Ø×ÑÔà�;‰;ÐÜ × :Ñ :Ó;ˆDŒKà�{‰{Ðr4   c                óX   — | j                   €ddlm}  || «      | _         | j                   S )ai  Returns an APIRequestContext for making HTTP requests with browser cookie sync.

        Returns:
            An APIRequestContext instance bound to this driver.

        Examples:
            ```
            response = driver.request.get("https://api.example.com/data")
            assert response.ok
            data = response.json()
            ```
        r   rt   )rµ   Ú-selenium.webdriver.common.api_request_contextru   )r�   ru   s     r5   ÚrequestzWebDriver.request}  s'   € ð �=‰=Ð ÝWá-¨dÓ3ˆDŒMØ�}‰}Ðr4   c                ó|  — dd l }dd l}|j                  «       }	 | j                  j	                  d«      dk(  r+| j                  j	                  d«      j	                  d«      }nG| j                  j	                  d«      dv r*| j                  j	                  d«      j	                  d«      }|j                  d	d
› d�«      }|j                  |j                  «      }|j	                  d«      }|j	                  d«      }dd l
}	|	j                  d|«      j                  d«      }
|
|fS # t
        $ r t        d«      ‚w xY w)Nr   rF   rG   zgoog:chromeOptionsÚdebuggerAddressrI   zms:edgeOptionszCan't get debugger address.r  zhttp://z/json/versionr   ÚwebSocketDebuggerUrlz
.*/(\d+)\.ra   )ÚjsonÚurllib3ÚPoolManagerr>   rU   ÚAttributeErrorr   r	  ÚloadsÚdataÚreÚsearchÚgroup)r�   r  r  ÚhttpÚdebugger_addressÚresr  Úbrowser_versionÚwebsocket_urlr  ræ  s              r5   rÛ  zWebDriver._get_cdp_details‘  s  € Ûãà×"Ñ"Ó$ˆð	DØ�y‰y�}‰}˜]Ó+¨xÒ7Ø#'§9¡9§=¡=Ð1EÓ#F×#JÑ#JÐK\Ó#]Ñ Ø—‘—‘˜}Ó-Ð1NÑNØ#'§9¡9§=¡=Ð1AÓ#B×#FÑ#FÐGXÓ#YÐ ð �l‰l˜5 GÐ,<Ð+=¸]Ð"KÓLˆØ�z‰z˜#Ÿ(™(Ó#ˆàŸ(™( 9Ó-ˆØŸ™Ð!7Ó8ˆãà—)‘)˜M¨?Ó;×AÑAÀ!ÓDˆà˜Ð%Ð%øô ò 	DÜ$Ð%BÓCÐCð	Dús   šBD& Ä&D;c                óp   — | j                  t        j                  |j                  «       «      d   | _        y)av  Adds a virtual authenticator with the given options.

        Example:
            ```
            from selenium.webdriver.common.virtual_authenticator import VirtualAuthenticatorOptions

            options = VirtualAuthenticatorOptions(protocol="u2f", transport="usb", device_id="myDevice123")
            driver.add_virtual_authenticator(options)
            ```
        rÕ   N)rØ   r#   ÚADD_VIRTUAL_AUTHENTICATORr?  r¦   )r�   rh   s     r5   Úadd_virtual_authenticatorz#WebDriver.add_virtual_authenticator¬  s-   € ð "&§¡¬g×.OÑ.OÐQX×Q`ÑQ`ÓQbÓ!cÐdkÑ!lˆÕr4   c                ó   — | j                   S )z,Returns the id of the virtual authenticator.)r¦   r½   s    r5   rŒ   z"WebDriver.virtual_authenticator_id¹  s   € ð ×%Ñ%Ð%r4   c                ój   — | j                  t        j                  d| j                  i«       d| _        y)zœRemoves a previously added virtual authenticator.

        The authenticator is no longer valid after removal, so no
        methods may be called.
        ÚauthenticatorIdN)rØ   r#   ÚREMOVE_VIRTUAL_AUTHENTICATORr¦   r½   s    r5   Úremove_virtual_authenticatorz&WebDriver.remove_virtual_authenticator¾  s1   € ð 	�‰Ü×0Ñ0Ø × 6Ñ 6Ð7ô	
ð "&ˆÕr4   c                ó€   — | j                  t        j                  i |j                  «       ¥d| j                  i¥«       y)a/  Injects a credential into the authenticator.

        Example:
            ```
            from selenium.webdriver.common.credential import Credential

            credential = Credential(id="user@example.com", password="aPassword")
            driver.add_credential(credential)
            ```
        r   N)rØ   r#   ÚADD_CREDENTIALr?  r¦   )r�   Ú
credentials     r5   Úadd_credentialzWebDriver.add_credentialË  s8   € ð 	�‰Ü×"Ñ"ØOˆz×!Ñ!Ó#ÐOÐ%6¸×8NÑ8NÑOõ	
r4   c                ó¶   — ddl m} | j                  t        j                  d| j
                  i«      }|d   D �cg c]  } |j                  |«      ‘Œ c}S c c}w )z;Returns the list of credentials owned by the authenticator.r   )r{   r   rÕ   )Ú/selenium.webdriver.common.virtual_authenticatorr{   rØ   r#   ÚGET_CREDENTIALSr¦   Ú	from_dict)r�   r{   Úcredential_datar%  s       r5   Úget_credentialszWebDriver.get_credentialsÜ  sS   € õ 	OàŸ,™,¤w×'>Ñ'>ÐARÐTX×TjÑTjÐ@kÓlˆØCRÐSZÑC[Ö\°ZÐ$�
×$Ñ$ ZÕ0Ò\Ð\ùÒ\s   ºAc                ó°   — t        |t        «      rt        |«      j                  «       }| j	                  t
        j                  || j                  dœ«       y)z®Removes a credential from the authenticator.

        Example:
            `credential_id = "user@example.com"`
            `driver.remove_credential(credential_id)`
        )ÚcredentialIdr   N)rS   Ú	bytearrayr   r”  rØ   r#   ÚREMOVE_CREDENTIALr¦   )r�   Úcredential_ids     r5   Úremove_credentialzWebDriver.remove_credentialä  sD   € ô �m¤YÔ/Ü-¨mÓ<×CÑCÓEˆMà�‰Ü×%Ñ%Ø*¸t×?UÑ?UÑVõ	
r4   c                ó\   — | j                  t        j                  d| j                  i«       y)z/Removes all credentials from the authenticator.r   N)rØ   r#   ÚREMOVE_ALL_CREDENTIALSr¦   r½   s    r5   Úremove_all_credentialsz WebDriver.remove_all_credentialsõ  s$   € ð 	�‰”W×3Ñ3Ð6GÈ×I_ÑI_Ð5`Õar4   c                ó^   — | j                  t        j                  | j                  |dœ«       y)a  Set whether the authenticator will simulate success or failure on user verification.

        Args:
            verified: True if the authenticator will pass user verification,
                False otherwise.

        Example:
            `driver.set_user_verified(True)`
        )r   ÚisUserVerifiedN)rØ   r#   ÚSET_USER_VERIFIEDr¦   )r�   Úverifieds     r5   Úset_user_verifiedzWebDriver.set_user_verifiedú  s'   € ð 	�‰Ü×%Ñ%Ø $× 6Ñ 6È(ÑSõ	
r4   c                ó~   — d| j                   vrt        d«      ‚| j                  t        j                  «      d   d   S )z9Retrieves the downloadable files as a list of file names.úse:downloadsEnabledúCYou must enable downloads in order to work with downloadable files.rÕ   Únames)r8   r   rØ   r#   ÚGET_DOWNLOADABLE_FILESr½   s    r5   Úget_downloadable_filesz WebDriver.get_downloadable_files
  s;   € à ¨×(9Ñ(9Ñ9Ü$Ð%jÓkÐkà�|‰|œG×:Ñ:Ó;¸GÑDÀWÑMÐMr4   c                óˆ  — d| j                   vrt        d«      ‚t        j                  j	                  |«      st        j
                  |«       | j                  t        j                  d|i«      d   d   }t        j                  «       5 }t        j                  j                  ||dz   «      }t        |d«      5 }|j                  t        j                  |«      «       ddd«       t!        j"                  |d	«      5 }|j%                  |«       ddd«       ddd«       y# 1 sw Y   ŒBxY w# 1 sw Y   ŒxY w# 1 sw Y   yxY w)
aE  Download a file with the specified file name to the target directory.

        Args:
            file_name: The name of the file to download.
            target_directory: The path to the directory to save the downloaded file.

        Example:
            `driver.download_file("example.zip", "/path/to/directory")`
        r<  r=  rÐ   rÕ   Úcontentsz.ziprœ  NÚr)r8   r   ÚosÚpathÚexistsÚmakedirsrØ   r#   ÚDOWNLOAD_FILEÚtempfileÚTemporaryDirectoryr�  r   r¡  Úbase64r   ÚzipfileÚZipFileÚ
extractall)r�   Ú	file_nameÚtarget_directoryrB  Útmp_dirÚzip_fileÚfileÚzip_refs           r5   Údownload_filezWebDriver.download_file  s  € ð !¨×(9Ñ(9Ñ9Ü$Ð%jÓkÐkä�w‰w�~‰~Ð.Ô/Ü�K‰KÐ(Ô)à—<‘<¤× 5Ñ 5¸À	Ð7JÓKÈGÑTÐU_Ñ`ˆä×(Ñ(Ó*ð 	5¨gÜ—w‘w—|‘| G¨Y¸Ñ-?Ó@ˆHÜ�h Ó%ð 7¨Ø—
‘
œ6×+Ñ+¨HÓ5Ô6÷7ô —‘ ¨3Ó/ð 5°7Ø×"Ñ"Ð#3Ô4÷5÷	5ð 	5÷7ð 7ú÷5ð 5ú÷	5ð 	5ús<   Â
0D8Â:%D ÃD8Ã=D,ÄD8Ä D)	Ä%D8Ä,D5	Ä1D8Ä8Ec                ót   — d| j                   vrt        d«      ‚| j                  t        j                  «       y)zDeletes all downloadable files.r<  r=  N)r8   r   rØ   r#   ÚDELETE_DOWNLOADABLE_FILESr½   s    r5   Údelete_downloadable_filesz#WebDriver.delete_downloadable_files+  s.   € à ¨×(9Ñ(9Ñ9Ü$Ð%jÓkÐkà�‰”W×6Ñ6Õ7r4   c                ó^   — d|i}|r||d<   | j                  t        j                  |«      d   S )a.  Fire a custom session event to the remote server event bus.

        This allows test code to trigger server-side utilities that subscribe to
        the event bus.

        Args:
            event_type: The type of event (e.g., "test:failed", "log:collect", "marker:add").
            payload: Optional data to include with the event.

        Returns:
            A dictionary containing the response data including success status,
            event type, and timestamp.

        Raises:
            WebDriverException: If the event cannot be fired.

        Examples:
            Simple event::

                driver.fire_session_event("test:started")

            Event with payload::

                driver.fire_session_event("test:failed", {"testName": "LoginTest", "error": "Element not found"})
        Ú	eventTypeÚpayloadrÕ   )rØ   r#   ÚFIRE_SESSION_EVENT)r�   Ú
event_typer[  rö   s       r5   Úfire_session_eventzWebDriver.fire_session_event2  s7   € ð4 *5°jÐ(AˆÙØ 'ˆF�9ÑØ�|‰|œG×6Ñ6¸Ó?ÀÑHÐHr4   c                ó   — | j                   S )al  Get the Federated Credential Management (FedCM) dialog commands.

        Returns:
            An object providing access to all Federated Credential Management
            (FedCM) dialog commands.

        Examples:
            `driver.fedcm.title`
            `driver.fedcm.subtitle`
            `driver.fedcm.dialog_type`
            `driver.fedcm.account_list`
            `driver.fedcm.select_account(0)`
            `driver.fedcm.accept()`
            `driver.fedcm.dismiss()`
            `driver.fedcm.enable_delay()`
            `driver.fedcm.disable_delay()`
            `driver.fedcm.reset_cooldown()`
        )r©   r½   s    r5   ÚfedcmzWebDriver.fedcmQ  s   € ð( �{‰{Ðr4   c                óV   — | j                   j                  t        j                  d«      S )z8Returns whether the browser supports FedCM capabilities.F)r8   rU   r   ÚFEDCM_CAPABILITYr½   s    r5   Úsupports_fedcmzWebDriver.supports_fedcmg  s#   € ð × Ñ ×$Ñ$¤Z×%@Ñ%@À%ÓHÐHr4   c                ó2   — | j                   st        d«      ‚y)z.Raises an exception if FedCM is not supported.znThis browser does not support Federated Credential Management. Please ensure you're using a supported browser.N)rc  r   r½   s    r5   Ú_require_fedcm_supportz WebDriver._require_fedcm_supportl  s#   € à×"Ò"Ü$ðBóð ð #r4   c                ó>   — ddl m} | j                  «         || «      S )z0Returns the FedCM dialog object for interaction.r   rv   )Ú&selenium.webdriver.common.fedcm.dialogrw   re  )r�   rw   s     r5   ÚdialogzWebDriver.dialogt  s   € õ 	Bà×#Ñ#Ô%Ù�d‹|Ðr4   c                ó¨   ‡ ‡‡‡— ddl mŠ ddlmŠ ddlm} ‰ j                  «        |€‰f}dˆˆˆ fd„Š |‰ |||¬«      }|j                  ˆfd„«      S )	a®  Waits for and returns the FedCM dialog.

        Args:
            timeout: How long to wait for the dialog.
            poll_frequency: How frequently to poll.
            ignored_exceptions: Exceptions to ignore while waiting.

        Returns:
            The FedCM dialog object if found.

        Raises:
            TimeoutException: If dialog doesn't appear.
            WebDriverException: If FedCM not supported.
        r   )ÚNoAlertPresentExceptionrv   )ÚWebDriverWaitc                 óL   •— 	  ‰‰«      } | j                   r| S d S # ‰$ r Y y w xY wrÀ   )r¼   )rh  rw   rj  r�   s    €€€r5   Ú_check_fedcmz,WebDriver.fedcm_dialog.<locals>._check_fedcm”  s4   ø€ ðÙ ›�Ø!'§¢�vÐ6°$Ð6øØ*ò Ùðús   ƒ ™ ›#¢#)Úpoll_frequencyÚignored_exceptionsc                ó   •—  ‰«       S rÀ   r3   )r�  rm  s    €r5   ú<lambda>z(WebDriver.fedcm_dialog.<locals>.<lambda>¡  s	   ø€ ¡L£N€ r4   )ÚreturnzDialog | None)Úselenium.common.exceptionsrj  rg  rw   Úselenium.webdriver.support.waitrk  re  Úuntil)	r�   Útimeoutrn  ro  rk  Úwaitrw   rj  rm  s	   `     @@@r5   Úfedcm_dialogzWebDriver.fedcm_dialog|  sY   û€ õ 	GÝAÝAà×#Ñ#Ô%àÐ%Ø"9Ð!;Ð÷	ñ ØØØ)Ø1ô	
ˆð �z‰zÓ2Ó3Ð3r4   )zhttp://127.0.0.1:4444TNNNNN)r[   ústr | RemoteConnectionrQ   Úboolr£   zFileDetector | Nonerh   z&BaseOptions | list[BaseOptions] | Noner¤   zLocatorConverter | Noner·   ztype[WebElement] | NonerE   úClientConfig | Nonerr  rd  )rr  rT   )rr  r   )rÄ   ztype[BaseException] | NonerÅ   zBaseException | NonerÆ   ztypes.TracebackType | None)rr  r)   ©rr  rd  )r8   rç   rr  rd  )rî   rT   rr  r.   )rõ   rT   r÷   rç   rÀ   )rÿ   z)str | Generator[dict[str, Any], Any, Any]rö   zdict[str, Any] | Nonerr  r   )r  rT   rr  rd  )r  rT   rr  r+   )r  r+   rr  rd  )rr  z	list[str])r  rT   rr  r   )rA  zPrintOptions | Nonerr  rT   )rr  r-   )rr  z
list[dict])rr  údict | None)rq  ro  rr  rd  )rr  rz   )rƒ  ústr | RelativeByrÕ   ú
str | Nonerr  r.   )rƒ  r~  rÕ   r  rr  zlist[WebElement]©rr  rç   )rr  rz  )rr  rœ   )rÅ  )r¶  rT   rr  rd  )r¶  rT   rr  rç   )r¾  ro  r¿  ro  r¶  rT   rr  rç   )NNNN)rr  r&   )rr  ztuple[Any, WebSocketConnection])rr  r   )rr  r   )rr  r   )rr  r   )rr  r   )rr  r   )rr  r   )rr  r   )rr  r   )rr  r   )rr  ru   )rh   r|   rr  rd  )rr  r  )r%  r{   rr  rd  )rr  zlist[Credential])r1  zstr | bytearrayrr  rd  )r9  rz  rr  rd  )rr  rš   )rO  rT   rP  rT   rr  rd  )r]  rT   r[  r}  rr  rç   )rr  r%   )rr  rw   )é   g      à?N)lr‘   r’   r“   r”   r.   r¥   r,   ré   r¸   r¾   rÁ   rÇ   r	   rË   ÚpropertyrÍ   rÐ   r§   rÓ   r¨   rá   rï   rò   rø   rØ   rU   r  r  r  r  r  r   r#  r'  r*  rÃ   r1  r4  r7  r:  r=  rB  rD  rG  rK  rN  rQ  rY  r\  r_  rh  rr  rt  rx  r~  Úsetterr   ÚIDr‹  r‡  r8   r¦  r¨  rŸ  r«  r·  r»  rÀ  rÃ  r´  r¹  rµ  r£   rÐ  ré  r   rñ  r  rý   rö  rø  rú  rü  rþ  r   r  r  r  r	  rÛ  r  rŒ   rŽ   r"  r&  r,  r2  r5  r:  r@  rU  rX  r^  r`  rc  re  rh  rx  r3   r4   r5   r—   r—   ß   s,  „ ñð "ÐØ €Oð 4KØØ-1Ø:>Ø59Ø37Ø-1ðJ*à0ðJ*ð ðJ*ð +ð	J*ð
 8ðJ*ð 3ðJ*ð 1ðJ*ð +ðJ*ð 
óJ*óX`óðà,ðð "ðð .ó	ð ñ3ó ð3ð< òó ðð òLó ðLóóóò ó7òó\ð. )-ð*KàAð*Kð &ð*Kð 
ó	*KóX0ð ò	@ó ð	@ô#ó$kó&)ó Zó2Zð& ò>ó ð>ð ò>ó ð>ó$óð" òLó ðLð òEó ðEó$ó
0ó.ô
Bð òó ðó&&ó)ó&ó>óó(<ó1óFó*ZóXóð( ò$ó ð$ð( ‡_�_òMó ðMð 35·%±%ÈTô Zð4 46·5±5Èdô að> òó ðóó:5óJó9ôCô9ô8ô	4óó	>ôrð" ò#ó ð#ð ×Ñò'ó ð'ð òEó ðEð ×Ñògó ðgó%:ðN ñ=ó ð=ð2 òó ðó
ð ò	ó ð	ð òó ðð( ò"ó ð"ð ò&ó ð&ð( òó ðð2 ò!ó ð!ð, ò"ó ð"ð& òó ðð. òó ðð. òó ðò&&ó6mð ò&ó ð&ð %ò
&ó %ð
&ð %ò
ó %ð
ð  %ò]ó %ð]ð %ò
ó %ð
ð  %òbó %ðbð %ò
ó %ð
óNó5ó48ôIð> òó ðð* òIó ðIóð òó ðô%4r4   r—   r|  r€  rÀ   )r8   rç   r[   ry  rQ   rz  r\   rz  rE   r{  rr  r*   )rh   zlist[BaseOptions]rr  rç   )pr”   Ú
__future__r   rK  rU  r;   r†   rû   rD  r‘  rI  Útypesr  rL  Úabcr   r   r   Úcollections.abcr   r   r	   Ú	importlibr
   Útypingr   r   r   Útyping_extensionsr   rs  r   r   r   r   r   Ú&selenium.webdriver.common.bidi.browserr   Ú/selenium.webdriver.common.bidi.browsing_contextr   Ú(selenium.webdriver.common.bidi.emulationr   Ú$selenium.webdriver.common.bidi.inputr   Ú&selenium.webdriver.common.bidi.networkr   Ú*selenium.webdriver.common.bidi.permissionsr   Ú%selenium.webdriver.common.bidi.scriptr   Ú&selenium.webdriver.common.bidi.sessionr   Ú&selenium.webdriver.common.bidi.storager   Ú+selenium.webdriver.common.bidi.webextensionr   Úselenium.webdriver.common.byr   Ú!selenium.webdriver.common.optionsr   r    Ú)selenium.webdriver.remote.bidi_connectionr!   Ú'selenium.webdriver.remote.client_configr"   Ú!selenium.webdriver.remote.commandr#   Ú&selenium.webdriver.remote.errorhandlerr$   Úselenium.webdriver.remote.fedcmr%   Ú'selenium.webdriver.remote.file_detectorr&   r'   Ú+selenium.webdriver.remote.locator_converterr(   Ú selenium.webdriver.remote.mobiler)   Ú+selenium.webdriver.remote.remote_connectionr*   Ú$selenium.webdriver.remote.script_keyr+   Ú$selenium.webdriver.remote.shadowrootr,   Ú#selenium.webdriver.remote.switch_tor-   Ú$selenium.webdriver.remote.webelementr.   Ú.selenium.webdriver.remote.websocket_connectionr/   Ú+selenium.webdriver.support.relative_locatorr0   r2   r6   rB   r_   rs   r  ru   rg  rw   Ú,selenium.webdriver.common.print_page_optionsrx   r|  rz   r(  r{   r|   r‰   rŽ   r�   r—   r3   r4   r5   ú<module>r¨     s5  ðñ$ $å "ã Û Û Û Û Û 	Û Û Û Û Û Ý ß /Ý %ß :Ý #ß +Ñ +å "÷õ õ ;Ý KÝ >Ý 6Ý :Ý BÝ 8Ý :Ý :Ý DÝ +ß EÝ DÝ @Ý 5Ý ?Ý 1ß SÝ HÝ 3Ý HÝ :Ý ;Ý 8Ý ;Ý NÝ Bà
€óBóOð0 *.ð+Øð+à,ð+ð ð+ð ð	+ð
 'ð+ð ó+ó\ñD ÝOÝ=ÝIÝ;ßgòòô˜gõ ôB4�õ B4r4   