
    'h                     <    S SK Jr  S SKJr  S SKJr   " S S5      rg)    )Union)WebDriverException)command_builderc                   L    \ rS rSrSrS rS
S\4S jjrS\\	\4   SS4S jr
S	rg)WebExtension   z1
BiDi implementation of the webExtension module.
c                     Xl         g Nconn)selfr   s     t/var/www/home/psychics-availability/venv/lib/python3.13/site-packages/selenium/webdriver/common/bidi/webextension.py__init__WebExtension.__init__   s    	    Nreturnc                 H   [        S XU4 5       5      S:w  a  [        S5      eUb  SUS.nOUb  SUS.nOUb  SUS	.nS
W0n U R                  R                  [	        SU5      5      nU$ ! [
         a-  nS[        U5      ;   a  [        [        U5       S35      Uee SnAff = f)aZ  Installs a web extension in the remote end.

You must provide exactly one of the parameters.

Parameters:
-----------
    path: Path to an extension directory
    archive_path: Path to an extension archive file
    base64_value: Base64 encoded string of the extension archive

Returns:
-------
    Dict: A dictionary containing the extension ID.
c              3   (   #    U  H  oS Lv   M
     g 7fr
    ).0xs     r   	<genexpr>'WebExtension.install.<locals>.<genexpr>/   s     I&H}&Hs      zCExactly one of path, archive_path, or base64_value must be providedNpath)typer   archivePathbase64)r   valueextensionDatazwebExtension.installzMethod not availablez. If you are using Chrome or Edge, add '--enable-unsafe-extension-debugging' and '--remote-debugging-pipe' arguments or set options.enable_webextensions = True)sum
ValueErrorr   executer   r   str)r   r   archive_pathbase64_valueextension_dataparamsresultes           r   installWebExtension.install    s     It<&HIIQNbcc&,d;N%&3\JN%&.FN!>2		YY&&7Mv'VWFM! 	%Q/(1vh i i  	s   &A* *
B!4(BB!extension_id_or_resultc                     [        U[        5      (       a  UR                  S5      nOUnSU0nU R                  R	                  [        SU5      5        g)zUninstalls a web extension from the remote end.

Parameters:
-----------
    extension_id_or_result: Either the extension ID as a string or the result dictionary
                           from a previous install() call containing the extension ID.
	extensionzwebExtension.uninstallN)
isinstancedictgetr   r#   r   )r   r-   extension_idr(   s       r   	uninstallWebExtension.uninstallF   sK     ,d33155kBL1L|,		/*BFKLr   r   )NNN)__name__
__module____qualname____firstlineno____doc__r   r1   r+   r   r$   r4   __static_attributes__r   r   r   r   r      s8    $$ $LMc4i0@ MT Mr   r   N)typingr   selenium.common.exceptionsr   %selenium.webdriver.common.bidi.commonr   r   r   r   r   <module>r?      s   $  9 A<M <Mr   