
    /_i                     L    d dl mZ  G d d      Z G d d      Z G d d      Zy)	    command_builderc                   &    e Zd ZdZdZdZdZeeehZy)UserPromptHandlerTypez3Represents the behavior of the user prompt handler.acceptdismissignoreN)__name__
__module____qualname____doc__ACCEPTDISMISSIGNOREVALID_TYPES     e/var/www/html/land_sniper/venv/lib/python3.12/site-packages/selenium/webdriver/common/bidi/session.pyr   r      s     =FGF7F+Kr   r   c                   x    e Zd ZdZ	 	 	 	 	 	 ddedz  dedz  dedz  dedz  dedz  dedz  fd	Zd
eeef   fdZy)UserPromptHandlerz8Represents the configuration of the user prompt handler.Nalertbefore_unloadconfirmdefaultfilepromptc           	          d|fd|fd|fd|fd|fd|ffD ]<  \  }}|	|t         j                  vst        d| d	| d
t         j                          || _        || _        || _        || _        || _        || _        y)a  Initialize UserPromptHandler.

        Args:
            alert: Handler type for alert prompts.
            before_unload: Handler type for beforeUnload prompts.
            confirm: Handler type for confirm prompts.
            default: Default handler type for all prompts.
            file: Handler type for file picker prompts.
            prompt: Handler type for prompt dialogs.

        Raises:
            ValueError: If any handler type is not valid.
        r   r   r   r   r   r   NzInvalid z handler type: z. Must be one of )	r   r   
ValueErrorr   r   r   r   r   r   )	selfr   r   r   r   r   r   
field_namevalues	            r   __init__zUserPromptHandler.__init__#   s    . em,  TNv"
 	J  U2G2S2S%S zl/%@QRgRsRsQtu 	 
*	r   returnc                 t    ddddddd}i }|j                         D ]  \  }}t        | |      }||||<    |S )zConvert the UserPromptHandler to a dictionary for BiDi protocol.

        Returns:
            Dictionary representation suitable for BiDi protocol.
        r   beforeUnloadr   r   r   r   )r   r   r   r   r   r   )itemsgetattr)r   field_mappingresult	attr_namedict_keyr!   s         r   to_dictzUserPromptHandler.to_dictM   sd     +  
 #0#6#6#8 	)IxD),E #(x 	) r   )NNNNNN)r
   r   r   r   strr"   dictr,   r   r   r   r   r       s    B !$(""!(Tz( Tz( t	(
 t( Dj( d
(Tc3h r   r   c                   0    e Zd Zd ZdddZdddZd Zy)Sessionc                     || _         y )N)conn)r   r2   s     r   r"   zSession.__init__e   s	    	r   N)browsing_contextsc                8    d|i}|g }|r||d<   t        d|      S )NeventsbrowsingContextszsession.subscriber   r   r3   r5   paramss       r   	subscribezSession.subscribeh   s8    f
 $ "):F%&2F;;r   c                8    d|i}|g }|r||d<   t        d|      S )Nr5   r6   zsession.unsubscriber   r7   s       r   unsubscribezSession.unsubscriber   s8    f
 $ "):F%&4f==r   c                 P    t        di       }| j                  j                  |      S )aP  The session.status command returns information about the remote end's readiness.

        Returns information about the remote end's readiness to create new sessions
        and may include implementation-specific metadata.

        Returns:
            Dictionary containing the ready state (bool), message (str) and metadata.
        zsession.status)r   r2   execute)r   cmds     r   statuszSession.status|   s&     .3yy  %%r   )r
   r   r   r"   r9   r;   r?   r   r   r   r0   r0   d   s      48 < 6: >
&r   r0   N)%selenium.webdriver.common.bidi.commonr   r   r   r0   r   r   r   <module>rA      s,   & B, ,A AH"& "&r   