
    gg                    :   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ddl	m
Z
 e G d d             Ze G d	 d
             Ze G d d             ZddZ	 	 	 	 ddZddZ	 	 	 	 ddZ ed      e G d d                    Z ed      e G d d                    Zy)    )annotations   )event_classT_JSON_DICT)	dataclassN)pagec                  F    e Zd ZU dZded<   ded<   ded<   d Zed        Zy	)
ApplicationCacheResourcez:
    Detailed application cache resource information.
    strurlintsizetype_c                t    t               }| j                  |d<   | j                  |d<   | j                  |d<   |S )Nr   r   type)dictr   r   r   selfjsons     k/var/www/html/venv/lib/python3.12/site-packages/selenium/webdriver/common/devtools/v85/application_cache.pyto_jsonz ApplicationCacheResource.to_json   s5    vhhUyyVzzV    c                `     | t        |d         t        |d         t        |d               S )Nr   r   r   )r   r   r   )r   r   clsr   s     r   	from_jsonz"ApplicationCacheResource.from_json$   s3    DK T&\"d6l#
 	
r   N__name__
__module____qualname____doc____annotations__r   classmethodr    r   r   r
   r
      s5     
H I J 
 
r   r
   c                  Z    e Zd ZU dZded<   ded<   ded<   ded<   ded	<   d
 Zed        Zy)ApplicationCachez1
    Detailed application cache information.
    r   manifest_urlfloatr   creation_timeupdate_timez%typing.List[ApplicationCacheResource]	resourcesc                    t               }| j                  |d<   | j                  |d<   | j                  |d<   | j                  |d<   | j
                  D cg c]  }|j                          c}|d<   |S c c}w )NmanifestURLr   creationTime
updateTimer+   )r   r'   r   r)   r*   r+   r   )r   r   is      r   r   zApplicationCache.to_jsonA   sp    v"//]yyV#11^!--\26..AQQYY[A[ Bs   A4c                     | t        |d         t        |d         t        |d         t        |d         |d   D cg c]  }t        j                  |       c}      S c c}w )Nr-   r   r.   r/   r+   )r'   r   r)   r*   r+   )r   r(   r
   r   )r   r   r0   s      r   r   zApplicationCache.from_jsonJ   sg    T-01tF|$^ 45d<01FJ;FWX/99!<X
 	

 Ys   A"Nr   r$   r   r   r&   r&   -   sG      K   54 
 
r   r&   c                  F    e Zd ZU dZded<   ded<   ded<   d Zed	        Zy
)FrameWithManifestz/
    Frame identifier - manifest URL pair.
    page.FrameIdframe_idr   r'   r   statusc                    t               }| j                  j                         |d<   | j                  |d<   | j                  |d<   |S )NframeIdr-   r6   )r   r5   r   r'   r6   r   s     r   r   zFrameWithManifest.to_jsonc   sA    v--//1Y"//]Xr   c                     | t         j                  j                  |d         t        |d         t	        |d               S Nr8   r-   r6   )r5   r'   r6   r   FrameIdr   r   r   r   s     r   r   zFrameWithManifest.from_jsonj   >    \\++DO<T-01tH~&
 	
r   Nr   r$   r   r   r3   r3   U   s7       K 
 
r   r3   c               #     K   ddi} | }yw)z9
    Enables application cache domain notifications.
    methodzApplicationCache.enableNr$   )cmd_dictr   s     r   enablerA   s   s     
 	+H >Ds   
c              #     K   t               }| j                         |d<   d|d}|}t        j                  |d         S w)a	  
    Returns relevant application cache data for the document in given frame.

    :param frame_id: Identifier of the frame containing document whose application cache is retrieved.
    :returns: Relevant application cache data for the document in given frame.
    r8   z,ApplicationCache.getApplicationCacheForFramer?   paramsapplicationCache)r   r   r&   r   r5   rD   r@   r   s       r   get_application_cache_for_framerG   }   sO      &F ((*F9@H >D%%d+=&>??s   ?Ac               #  p   K   ddi} | }|d   D cg c]  }t         j                  |       c}S c c}w w)a  
    Returns array of frame identifiers with manifest urls for each frame containing a document
    associated with some application cache.

    :returns: Array of frame identifiers with manifest urls for each frame containing a document associated with some application cache.
    r?   z'ApplicationCache.getFramesWithManifestsframeIds)r3   r   )r@   r   r0   s      r   get_frames_with_manifestsrJ      sC      	;H >D484DEq''*EEEs   616c              #  r   K   t               }| j                         |d<   d|d}|}t        |d         S w)z
    Returns manifest URL for document in the given frame.

    :param frame_id: Identifier of the frame containing document whose manifest is retrieved.
    :returns: Manifest URL for document in the given frame.
    r8   z$ApplicationCache.getManifestForFramerC   r-   )r   r   r   rF   s       r   get_manifest_for_framerL      sH      &F ((*F98H >DtM"##s   57z.ApplicationCache.applicationCacheStatusUpdatedc                  >    e Zd ZU ded<   ded<   ded<   ed	d       Zy)
ApplicationCacheStatusUpdatedr4   r5   r   r'   r   r6   c                     | t         j                  j                  |d         t        |d         t	        |d               S r:   r;   r   s     r   r   z'ApplicationCacheStatusUpdated.from_json   r=   r   N)r   r   returnrN   r   r   r    r"   r#   r   r$   r   r   rN   rN      s'     K
 
r   rN   z$ApplicationCache.networkStateUpdatedc                  *    e Zd ZU ded<   edd       Zy)NetworkStateUpdatedboolis_now_onlinec                ,     | t        |d               S )NisNowOnline)rU   )rT   r   s     r   r   zNetworkStateUpdated.from_json   s    tM23
 	
r   N)r   r   rP   rS   rQ   r$   r   r   rS   rS      s     
 
r   rS   )rP   z0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])r5   r4   rP   z<typing.Generator[T_JSON_DICT, T_JSON_DICT, ApplicationCache])rP   zJtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[FrameWithManifest]])r5   r4   rP   z/typing.Generator[T_JSON_DICT, T_JSON_DICT, str])
__future__r   utilr   r   dataclassesr   enumtyping r   r
   r&   r3   rA   rG   rJ   rL   rN   rS   r$   r   r   <module>r^      s    # * !    
 
 
: $
 $
 $
N 
 
 
:@@	C@&F$$	6$& =>

 
  ?
" 34

 
  5
r   