
    'h3                        S SK JrJrJr  S SKJr   " S S5      r " S S5      r " S S5      r " S	 S
5      r	 " S S5      r
 " S S5      r " S S5      r " S S5      r " S S5      r " S S5      r " S S5      r " S S5      rg)    )AnyOptionalUnion)command_builderc                   (    \ rS rSrSrSrSrSrSrSr	g)	SameSite   z5Represents the possible same site values for cookies.strictlaxnonedefault N)
__name__
__module____qualname____firstlineno____doc__STRICTLAXNONEDEFAULT__static_attributes__r       o/var/www/home/psychics-availability/venv/lib/python3.13/site-packages/selenium/webdriver/common/bidi/storage.pyr   r      s    ?F
CDGr   r   c                   @    \ rS rSrSrSrSrS\S\4S jrS\	4S	 jr
S
rg)
BytesValue    zRepresents a bytes value.base64stringtypevaluec                     Xl         X l        g Nr    r!   )selfr    r!   s      r   __init__BytesValue.__init__&   s    	
r   returnc                 4    U R                   U R                  S.$ )ztConverts the BytesValue to a dictionary.

Returns:
-------
    Dict: A dictionary representation of the BytesValue.
r$   r$   r%   s    r   to_dictBytesValue.to_dict*   s     		DJJ77r   r$   N)r   r   r   r   r   TYPE_BASE64TYPE_STRINGstrr&   dictr+   r   r   r   r   r   r       s.    #KKS  8 8r   r   c                       \ rS rSrSr      SS\S\S\S\\   S\\   S	\\	   S
\\	   S\\   S\\   4S jjr
\S\SS 4S j5       rSrg)Cookie4   zRepresents a cookie.Nnamer!   domainpathsize	http_onlysecure	same_siteexpiryc
                 p    Xl         X l        X0l        X@l        XPl        X`l        Xpl        Xl        Xl        g r#   	r4   r!   r5   r6   r7   r8   r9   r:   r;   
r%   r4   r!   r5   r6   r7   r8   r9   r:   r;   s
             r   r&   Cookie.__init__7   1     	
		""r   datar(   c                    UR                  S5      nU(       d  [        S5      eUR                  S5      nU(       d  [        S5      e[        UR                  S0 5      R                  S5      UR                  S0 5      R                  S5      5      nU " [        U5      U[        U5      UR                  S5      UR                  S5      UR                  S	5      UR                  S
5      UR                  S5      UR                  S5      S9	$ )zCreates a Cookie instance from a dictionary.

Parameters:
-----------
    data: A dictionary containing the cookie information.

Returns:
-------
    Cookie: A new instance of Cookie.
r4   z$name is required and cannot be emptyr5   z&domain is required and cannot be emptyr!   r    r6   r7   httpOnlyr9   sameSiter;   r=   )get
ValueErrorr   r/   )clsrA   r4   r5   r!   s        r   	from_dictCookie.from_dictM   s     xxCDD(#EFF488GR044V<dhhwPR>S>W>WX_>`aTv;&!&!hhz*88H%hhz*88H%

 
	
r   	r5   r;   r8   r4   r6   r:   r9   r7   r!   )NNNNNN)r   r   r   r   r   r/   r   r   intboolr&   classmethodr0   rH   r   r   r   r   r2   r2   4   s     #"$(!%#' $  	
 sm sm D>  C= , 
T 
h 
 
r   r2   c                       \ rS rSrSr         SS\\   S\\   S\\   S\\   S\\   S	\\	   S
\\	   S\\   S\\   4S jjr
S\\\4   4S jrSrg)CookieFiltero   z Represents a filter for cookies.Nr4   r!   r5   r6   r7   r8   r9   r:   r;   c
                 p    Xl         X l        X0l        X@l        XPl        X`l        Xpl        Xl        Xl        g r#   r=   r>   s
             r   r&   CookieFilter.__init__r   r@   r   r(   c                    0 nU R                   b  U R                   US'   U R                  b  U R                  R                  5       US'   U R                  b  U R                  US'   U R                  b  U R                  US'   U R
                  b  U R
                  US'   U R                  b  U R                  US'   U R                  b  U R                  US'   U R                  b  U R                  US'   U R                  b  U R                  US	'   U$ )
zxConverts the CookieFilter to a dictionary.

Returns:
-------
    Dict: A dictionary representation of the CookieFilter.
r4   r!   r5   r6   r7   rC   r9   rD   r;   )
r4   r!   r+   r5   r6   r7   r8   r9   r:   r;   r%   results     r   r+   CookieFilter.to_dict   s     "$99 !YYF6N::!"jj002F7O;;"#{{F899 !YYF6N99 !YYF6N>>%!%F:;;"#{{F8>>%!%F:;;"#{{F8r   rJ   )	NNNNNNNNN)r   r   r   r   r   r   r/   r   rK   rL   r&   r0   r   r+   r   r   r   r   rO   rO   o   s    * #&* $""$(!%#' $sm 
# 	
 sm sm D>  C= ,c3h r   rO   c                   V    \ rS rSrSrSS\\   S\\   4S jjr\S\	SS 4S	 j5       r
S
rg)PartitionKey   z#Represents a storage partition key.Nuser_contextsource_originc                     Xl         X l        g r#   rZ   r[   r%   rZ   r[   s      r   r&   PartitionKey.__init__   s    (*r   rA   r(   c                 L    U " UR                  S5      UR                  S5      S9$ )zCreates a PartitionKey instance from a dictionary.

Parameters:
-----------
    data: A dictionary containing the partition key information.

Returns:
-------
    PartitionKey: A new instance of PartitionKey.
userContextsourceOriginr]   )rE   )rG   rA   s     r   rH   PartitionKey.from_dict   s)     -0((>2
 	
r   )r[   rZ   NN)r   r   r   r   r   r   r/   r&   rM   r0   rH   r   r   r   r   rX   rX      sC    -+Xc] +(SV- + 
T 
n 
 
r   rX   c                   4    \ rS rSrSrS\4S jrS\4S jrSr	g)	"BrowsingContextPartitionDescriptor   z3Represents a browsing context partition descriptor.contextc                     SU l         Xl        g )Nrh   r    rh   )r%   rh   s     r   r&   +BrowsingContextPartitionDescriptor.__init__   s    	r   r(   c                 4    U R                   U R                  S.$ )zConverts the BrowsingContextPartitionDescriptor to a dictionary.

Returns:
-------
    Dict: A dictionary representation of the BrowsingContextPartitionDescriptor.
rj   rj   r*   s    r   r+   *BrowsingContextPartitionDescriptor.to_dict   s     		dll;;r   )rh   r    N)
r   r   r   r   r   r/   r&   r0   r+   r   r   r   r   rf   rf      s    = < <r   rf   c                   H    \ rS rSrSrS
S\\   S\\   4S jjrS\4S jr	S	r
g)StorageKeyPartitionDescriptor   z.Represents a storage key partition descriptor.NrZ   r[   c                 *    SU l         Xl        X l        g )N
storageKeyr    rZ   r[   r^   s      r   r&   &StorageKeyPartitionDescriptor.__init__   s     	(*r   r(   c                     SU R                   0nU R                  b  U R                  US'   U R                  b  U R                  US'   U$ )zConverts the StorageKeyPartitionDescriptor to a dictionary.

Returns:
-------
    Dict: A dictionary representation of the StorageKeyPartitionDescriptor.
r    ra   rb   rs   rT   s     r   r+   %StorageKeyPartitionDescriptor.to_dict   sO     $))$($($5$5F=!)%)%7%7F>"r   )r[   r    rZ   rd   )r   r   r   r   r   r   r/   r&   r0   r+   r   r   r   r   ro   ro      s-    8+Xc] +(SV- +
 r   ro   c                       \ rS rSrSr     SS\S\S\S\\   S\\   S	\\   S
\\   S\\	   4S jjr
S\\\4   4S jrSrg)PartialCookie   z(Represents a partial cookie for setting.Nr4   r!   r5   r6   r8   r9   r:   r;   c	                 d    Xl         X l        X0l        X@l        XPl        X`l        Xpl        Xl        g r#   )r4   r!   r5   r6   r8   r9   r:   r;   )	r%   r4   r!   r5   r6   r8   r9   r:   r;   s	            r   r&   PartialCookie.__init__   s,     	
	""r   r(   c                    U R                   U R                  R                  5       U R                  S.nU R                  b  U R                  US'   U R
                  b  U R
                  US'   U R                  b  U R                  US'   U R                  b  U R                  US'   U R                  b  U R                  US'   U$ )zzConverts the PartialCookie to a dictionary.

Returns:
-------
    Dict: A dictionary representation of the PartialCookie.
)r4   r!   r5   r6   rC   r9   rD   r;   )	r4   r!   r+   r5   r6   r8   r9   r:   r;   rT   s     r   r+   PartialCookie.to_dict   s     IIZZ'')kk"

 99 !YYF6N>>%!%F:;;"#{{F8>>%!%F:;;"#{{F8r   )r5   r;   r8   r4   r6   r:   r9   r!   )NNNNN)r   r   r   r   r   r/   r   r   rL   rK   r&   r0   r   r+   r   r   r   r   rx   rx      s    2 #$(!%#' $  	
 sm D>  C= (c3h r   rx   c                   L    \ rS rSrSrS\\   S\4S jr\	S\
SS 4S j5       rS	rg
)GetCookiesResulti  z.Represents the result of a getCookies command.cookiespartition_keyc                     Xl         X l        g r#   r   r   )r%   r   r   s      r   r&   GetCookiesResult.__init__  s    *r   rA   r(   c                     UR                  S/ 5       Vs/ s H  n[        R                  U5      PM     nn[        R                  UR                  S0 5      5      nU " X4S9$ s  snf )zCreates a GetCookiesResult instance from a dictionary.

Parameters:
-----------
    data: A dictionary containing the get cookies result information.

Returns:
-------
    GetCookiesResult: A new instance of GetCookiesResult.
r   partitionKeyr   )rE   r2   rH   rX   )rG   rA   cookier   r   s        r   rH   GetCookiesResult.from_dict  s\     ;?((9b:QR:Q6##F+:QR$..txx/KL7@@ Ss   A!r   N)r   r   r   r   r   listr2   rX   r&   rM   r0   rH   r   r   r   r   r   r     sC    8+V +\ + AT A&8 A Ar   r   c                   B    \ rS rSrSrS\4S jr\S\SS 4S j5       r	Sr
g	)
SetCookieResulti.  z-Represents the result of a setCookie command.r   c                     Xl         g r#   r   r%   r   s     r   r&   SetCookieResult.__init__1      *r   rA   r(   c                 X    [         R                  UR                  S0 5      5      nU " US9$ )zCreates a SetCookieResult instance from a dictionary.

Parameters:
-----------
    data: A dictionary containing the set cookie result information.

Returns:
-------
    SetCookieResult: A new instance of SetCookieResult.
r   r   rX   rH   rE   rG   rA   r   s      r   rH   SetCookieResult.from_dict4  *     %..txx/KL//r   r   Nr   r   r   r   r   rX   r&   rM   r0   rH   r   r   r   r   r   r   .  s4    7+l + 0T 0&7 0 0r   r   c                   B    \ rS rSrSrS\4S jr\S\SS 4S j5       r	Sr
g	)
DeleteCookiesResultiD  z1Represents the result of a deleteCookies command.r   c                     Xl         g r#   r   r   s     r   r&   DeleteCookiesResult.__init__G  r   r   rA   r(   c                 X    [         R                  UR                  S0 5      5      nU " US9$ )zCreates a DeleteCookiesResult instance from a dictionary.

Parameters:
-----------
    data: A dictionary containing the delete cookies result information.

Returns:
-------
    DeleteCookiesResult: A new instance of DeleteCookiesResult.
r   r   r   r   s      r   rH   DeleteCookiesResult.from_dictJ  r   r   r   Nr   r   r   r   r   r   D  s4    ;+l + 0T 0&; 0 0r   r   c                       \ rS rSrSrS r  SS\\   S\\\	\
4      S\4S jjr SS	\S\\\	\
4      S\4S
 jjr  SS\\   S\\\	\
4      S\4S jjrSrg)StorageiZ  z*BiDi implementation of the storage module.c                     Xl         g r#   conn)r%   r   s     r   r&   Storage.__init__]  s    	r   Nfilter	partitionr(   c                     0 nUb  UR                  5       US'   Ub  UR                  5       US'   U R                  R                  [        SU5      5      n[        R                  U5      $ )zRetrieves cookies that match the given parameters.

Parameters:
-----------
    filter: Optional filter to match cookies.
    partition: Optional partition descriptor.

Returns:
-------
    GetCookiesResult: The result of the get cookies command.
r   r   zstorage.getCookies)r+   r   executer   r   rH   r%   r   r   paramsrU   s        r   get_cookiesStorage.get_cookies`  sf      %~~/F8 "+"3"3"5F;""?3G#PQ))&11r   r   c                     SUR                  5       0nUb  UR                  5       US'   U R                  R                  [        SU5      5      n[        R                  U5      $ )zSets a cookie in the browser.

Parameters:
-----------
    cookie: The cookie to set.
    partition: Optional partition descriptor.

Returns:
-------
    SetCookieResult: The result of the set cookie command.
r   r   zstorage.setCookie)r+   r   r   r   r   rH   )r%   r   r   r   rU   s        r   
set_cookieStorage.set_cookiey  s[      FNN,- "+"3"3"5F;""?3F#OP((00r   c                     0 nUb  UR                  5       US'   Ub  UR                  5       US'   U R                  R                  [        SU5      5      n[        R                  U5      $ )a  Deletes cookies that match the given parameters.

Parameters:
-----------
    filter: Optional filter to match cookies to delete.
    partition: Optional partition descriptor.

Returns:
-------
    DeleteCookiesResult: The result of the delete cookies command.
r   r   zstorage.deleteCookies)r+   r   r   r   r   rH   r   s        r   delete_cookiesStorage.delete_cookies  sf      %~~/F8 "+"3"3"5F;""?3JF#ST",,V44r   r   rd   r#   )r   r   r   r   r   r&   r   rO   r   rf   ro   r   r   rx   r   r   r   r   r   r   r   r   r   r   Z  s    4
 *.hl2&2 E"DFc"cde2 
	28 im11 E"DFc"cde1 
	12 *.hl5&5 E"DFc"cde5 
	5 5r   r   N)typingr   r   r   %selenium.webdriver.common.bidi.commonr   r   r   r2   rO   rX   rf   ro   rx   r   r   r   r   r   r   r   <module>r      s   $ ( ' A 8 8(8
 8
v3 3l
 
2< <" .- -`A A00 0,0 0,M5 M5r   