
    ]j                        d dl mZ ddlmZmZ d dlmZ d dlZd dlZ G d dej                        Z
	 	 	 	 	 	 ddZ	 d	 	 	 	 	 dd	Z	 	 	 	 dd
Z	 d	 	 	 	 	 	 	 ddZ	 	 	 	 	 	 	 	 ddZ	 	 	 	 	 	 ddZ	 	 	 	 	 	 	 	 ddZy)    )annotations   )event_classT_JSON_DICT)	dataclassNc                  6    e Zd ZdZdZdZdZdZd Ze	d        Z
y)	StorageAreaz
    Storage areas.
    sessionlocalsyncmanagedc                    | j                   S N)value)selfs    f/home/ubuntu/.local/lib/python3.12/site-packages/selenium/webdriver/common/devtools/v146/extensions.pyto_jsonzStorageArea.to_json   s    zz    c                     | |      S r    )clsjsons     r   	from_jsonzStorageArea.from_json   s    4yr   N)__name__
__module____qualname____doc__SESSIONLOCALSYNCMANAGEDr   classmethodr   r   r   r   r	   r	      s6     GEDG  r   r	   c              #  F   K   t               }| |d<   ||d<   d|d}|}yw)a)  
    Runs an extension default action.
    Available if the client is connected using the --remote-debugging-pipe
    flag and the --enable-unsafe-extension-debugging flag is set.

    :param id_: Extension id.
    :param target_id: A tab target ID to trigger the default extension action on.
    idtargetIdzExtensions.triggerActionmethodparamsNdict)id_	target_idr(   cmd_dictr   s        r   trigger_actionr.      s8      &FF4L"F:,H >Ds   !c              #  d   K   t               }| |d<   |||d<   d|d}|}t        |d         S w)a  
    Installs an unpacked extension from the filesystem similar to
    --load-extension CLI flags. Returns extension ID once the extension
    has been installed. Available if the client is connected using the
    --remote-debugging-pipe flag and the --enable-unsafe-extension-debugging
    flag is set.

    :param path: Absolute file path.
    :param enable_in_incognito: *(Optional)* Enable the extension in incognito
    :returns: Extension id.
    pathenableInIncognitozExtensions.loadUnpackedr&   r$   )r*   str)r0   enable_in_incognitor(   r-   r   s        r   load_unpackedr4   4   sM      &FF6N&&9"#+H >DtDz?s   .0c              #  <   K   t               }| |d<   d|d}|}yw)z
    Uninstalls an unpacked extension (others not supported) from the profile.
    Available if the client is connected using the --remote-debugging-pipe flag
    and the --enable-unsafe-extension-debugging.

    :param id_: Extension id.
    r$   zExtensions.uninstallr&   Nr)   )r+   r(   r-   r   s       r   	uninstallr6   O   s.      &FF4L(H >Ds   c              #     K   t               }| |d<   |j                         |d<   ||D cg c]  }| c}|d<   d|d}|}t        |d         S c c}w w)a(  
    Gets data from extension storage in the given ``storageArea``. If ``keys`` is
    specified, these are used to filter the result.

    :param id_: ID of extension.
    :param storage_area: StorageArea to retrieve data from.
    :param keys: *(Optional)* Keys to retrieve.
    :returns: 
    r$   storageAreakeyszExtensions.getStorageItemsr&   datar*   r   r+   storage_arear9   r(   ir-   r   s          r   get_storage_itemsr?   b   so      &FF4L(002F=%)*!*v.H >DV +s   )A	A"Ac              #     K   t               }| |d<   |j                         |d<   |D cg c]  }| c}|d<   d|d}|}yc c}w w)z
    Removes ``keys`` from extension storage in the given ``storageArea``.

    :param id_: ID of extension.
    :param storage_area: StorageArea to remove data from.
    :param keys: Keys to remove.
    r$   r8   r9   zExtensions.removeStorageItemsr&   Nr;   r<   s          r   remove_storage_itemsrA   }   sZ      &FF4L(002F=!%&Aa&F6N1H >D 's   'A	AAc              #  b   K   t               }| |d<   |j                         |d<   d|d}|}yw)z
    Clears extension storage in the given ``storageArea``.

    :param id_: ID of extension.
    :param storage_area: StorageArea to remove data from.
    r$   r8   zExtensions.clearStorageItemsr&   Nr;   )r+   r=   r(   r-   r   s        r   clear_storage_itemsrC      sA      &FF4L(002F=0H >Ds   -/c              #  l   K   t               }| |d<   |j                         |d<   ||d<   d|d}|}yw)a  
    Sets ``values`` in extension storage in the given ``storageArea``. The provided ``values``
    will be merged with existing values in the storage area.

    :param id_: ID of extension.
    :param storage_area: StorageArea to set data in.
    :param values: Values to set.
    r$   r8   valueszExtensions.setStorageItemsr&   Nr;   )r+   r=   rE   r(   r-   r   s         r   set_storage_itemsrF      sK      &FF4L(002F=F8.H >Ds   24)r+   r2   r,   r2   return0typing.Generator[T_JSON_DICT, T_JSON_DICT, None]r   )r0   r2   r3   ztyping.Optional[bool]rG   z/typing.Generator[T_JSON_DICT, T_JSON_DICT, str])r+   r2   rG   rH   )r+   r2   r=   r	   r9   z!typing.Optional[typing.List[str]]rG   z0typing.Generator[T_JSON_DICT, T_JSON_DICT, dict])r+   r2   r=   r	   r9   ztyping.List[str]rG   rH   )r+   r2   r=   r	   rG   rH   )r+   r2   r=   r	   rE   r*   rG   rH   )
__future__r   utilr   r   dataclassesr   enumtypingEnumr	   r.   r4   r6   r?   rA   rC   rF   r   r   r   <module>rO      s   # * !  $)) " 
80 6:2 
76	7, 37! 0 
8	6!  
8	.! 
8(!  
8	r   