
    ,h83                    :   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
  G d de      Ze G d	 d
             Z G d dej                        Z G d dej                        Z G d dej                        Z G d dej                        Zd!dZd"dZ	 	 	 	 d#dZ	 	 d$	 	 	 	 	 d%dZ	 	 	 	 	 	 	 	 	 d&	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d'dZ ed      e G 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)ioc                  <     e Zd ZdZddZedd       Z fdZ xZS )MemoryDumpConfigz[
    Configuration for memory dump. Used only when "memory-infra" category is enabled.
    c                    | S N selfs    q/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/selenium/webdriver/common/devtools/v136/tracing.pyto_jsonzMemoryDumpConfig.to_json   s        c                     | |      S r   r   clsjsons     r   	from_jsonzMemoryDumpConfig.from_json       4yr   c                >    dj                  t        | 	               S )NzMemoryDumpConfig({}))formatsuper__repr__)r   	__class__s    r   r   zMemoryDumpConfig.__repr__   s    %,,UW-=-?@@r   )returndict)r   r   r   r
   )	__name__
__module____qualname____doc__r   classmethodr   r   __classcell__)r   s   @r   r
   r
      s-      A Ar   r
   c                      e Zd ZU dZded<   dZded<   dZded<   dZded<   dZded	<   dZ	d
ed<   dZ
d
ed<   dZd
ed<   dZded<   d Zed        Zy)TraceConfigNtyping.Optional[str]record_modetyping.Optional[float]trace_buffer_size_in_kbtyping.Optional[bool]enable_samplingenable_systraceenable_argument_filterz!typing.Optional[typing.List[str]]included_categoriesexcluded_categoriessynthetic_delaysz!typing.Optional[MemoryDumpConfig]memory_dump_configc                   t               }| j                  | j                  |d<   | j                  | j                  |d<   | j                  | j                  |d<   | j                  | j                  |d<   | j
                  | j
                  |d<   | j                  | j                  D cg c]  }| c}|d<   | j                  | j                  D cg c]  }| c}|d<   | j                  | j                  D cg c]  }| c}|d<   | j                  | j                  j                         |d	<   |S c c}w c c}w c c}w )
N
recordModetraceBufferSizeInKbenableSamplingenableSystraceenableArgumentFilterincludedCategoriesexcludedCategoriessyntheticDelaysmemoryDumpConfig)r   r)   r+   r-   r.   r/   r0   r1   r2   r3   r   )r   r   is      r   r   zTraceConfig.to_json<   sH   v'!%!1!1D''3*.*F*FD&'+%)%9%9D!"+%)%9%9D!"&&2+/+F+FD'(##/595M5M)N!)ND%&##/595M5M)N!)ND%&  ,262G2G&HQq&HD"#"".'+'>'>'F'F'HD#$ *O)N&Hs   ,	D8	D=>	Ec                    | d|v rt        |d         nd d|v rt        |d         nd d|v rt        |d         nd d|v rt        |d         nd d|v rt        |d         nd d|v r|d   D cg c]  }t        |       c}nd d|v r|d   D cg c]  }t        |       c}nd d|v r|d   D cg c]  }t        |       c}nd d	|v rt        j	                  |d	         
	      S d 
	      S c c}w c c}w c c}w )Nr5   r6   r7   r8   r9   r:   r;   r<   r=   )	r)   r+   r-   r.   r/   r0   r1   r2   r3   )strfloatboolr
   r   r   r   r>   s      r   r   zTraceConfig.from_jsonR   s,   3?43GD./TJ_cgJgE$/D*E$Fmq<LPT<TD&6!78Z^<LPT<TD&6!78Z^I_cgIg4-C(D#EmqPdhlPl6J1K LAQ LrvPdhlPl6J1K LAQ LrvJ[_cJcd3D.EFc!fFimWimqWq/99$?Q:RS

 
	
 x|

 
	
 !M LFs   -C-C2/C7)r    r!   r"   r)   __annotations__r+   r-   r.   r/   r0   r1   r2   r3   r   r$   r   r   r   r   r'   r'      s     )-K%, 7;3: .2O*1 .2O*1 5918 >B:A >B:A ;?7> =A9@, 
 
r   r'   c                  .    e Zd ZdZdZdZd Zed        Zy)StreamFormatz
    Data format of a trace. Can be either the legacy JSON format or the
    protocol buffer format. Note that the JSON format will be deprecated soon.
    r   protoc                    | j                   S r   valuer   s    r   r   zStreamFormat.to_jsoni       zzr   c                     | |      S r   r   r   s     r   r   zStreamFormat.from_jsonl   r   r   N)	r    r!   r"   r#   JSONPROTOr   r$   r   r   r   r   rF   rF   a   s,     DE  r   rF   c                  .    e Zd ZdZdZdZd Zed        Zy)StreamCompressionzB
    Compression type to use for traces returned via streams.
    nonegzipc                    | j                   S r   rI   r   s    r   r   zStreamCompression.to_jsonx   rK   r   c                     | |      S r   r   r   s     r   r   zStreamCompression.from_json{   r   r   N)	r    r!   r"   r#   NONEGZIPr   r$   r   r   r   r   rP   rP   q   s,     DD  r   rP   c                  2    e Zd ZdZdZdZdZd Zed        Z	y)MemoryDumpLevelOfDetailz
    Details exposed when memory request explicitly declared.
    Keep consistent with memory_dump_request_args.h and
    memory_instrumentation.mojom
    
backgroundlightdetailedc                    | j                   S r   rI   r   s    r   r   zMemoryDumpLevelOfDetail.to_json   rK   r   c                     | |      S r   r   r   s     r   r   z!MemoryDumpLevelOfDetail.from_json   r   r   N)
r    r!   r"   r#   
BACKGROUNDLIGHTDETAILEDr   r$   r   r   r   r   rX   rX      s1    
 JEH  r   rX   c                  2    e Zd ZdZdZdZdZd Zed        Z	y)TracingBackenda  
    Backend type to use for tracing. ``chrome`` uses the Chrome-integrated
    tracing service and is supported on all platforms. ``system`` is only
    supported on Chrome OS and uses the Perfetto system tracing service.
    ``auto`` chooses ``system`` when the perfettoConfig provided to Tracing.start
    specifies at least one non-Chrome data source; otherwise uses ``chrome``.
    autochromesystemc                    | j                   S r   rI   r   s    r   r   zTracingBackend.to_json   rK   r   c                     | |      S r   r   r   s     r   r   zTracingBackend.from_json   r   r   N)
r    r!   r"   r#   AUTOCHROMESYSTEMr   r$   r   r   r   r   rb   rb      s1     DFF  r   rb   c               #     K   ddi} | }yw)z'
    Stop trace events collection.
    methodzTracing.endNr   )cmd_dictr   s     r   endrn      s     
 	-H >Ds   
c               #  \   K   ddi} | }|d   D cg c]  }t        |       c}S c c}w w)zy
    Gets supported tracing categories.

    **EXPERIMENTAL**

    :returns: A list of supported tracing categories.
    rl   zTracing.getCategories
categories)r@   )rm   r   r>   s      r   get_categoriesrq      s;      	)H >D ./qCF///s   ,',c              #  <   K   t               }| |d<   d|d}|}yw)z~
    Record a clock sync marker in the trace.

    **EXPERIMENTAL**

    :param sync_id: The ID of this clock sync marker
    syncIdzTracing.recordClockSyncMarkerrl   paramsNr   )sync_idru   rm   r   s       r   record_clock_sync_markerrx      s/      &FF81H >Ds   c              #     K   t               }| | |d<   ||j                         |d<   d|d}|}t        |d         t        |d         fS w)a  
    Request a global memory dump.

    **EXPERIMENTAL**

    :param deterministic: *(Optional)* Enables more deterministic results by forcing garbage collection
    :param level_of_detail: *(Optional)* Specifies level of details in memory dump. Defaults to "detailed".
    :returns: A tuple with the following items:

        0. **dumpGuid** - GUID of the resulting global memory dump.
        1. **success** - True iff the global memory dump succeeded.
    deterministiclevelOfDetailzTracing.requestMemoryDumprt   dumpGuidsuccess)r   r   r@   rB   )rz   level_of_detailru   rm   r   s        r   request_memory_dumpr      sq       &F "/""1"9"9";-H >DDT)_ s   AAc	              #     K   t               }	| | |	d<   |||	d<   |||	d<   |||	d<   ||j                         |	d<   ||j                         |	d<   ||j                         |	d<   |||	d	<   ||j                         |	d
<   d|	d}
|
}yw)a  
    Start trace events collection.

    :param categories: **(EXPERIMENTAL)** *(Optional)* Category/tag filter
    :param options: **(EXPERIMENTAL)** *(Optional)* Tracing options
    :param buffer_usage_reporting_interval: **(EXPERIMENTAL)** *(Optional)* If set, the agent will issue bufferUsage events at this interval, specified in milliseconds
    :param transfer_mode: *(Optional)* Whether to report trace events as series of dataCollected events or to save trace to a stream (defaults to ```ReportEvents````).
    :param stream_format: *(Optional)* Trace data format to use. This only applies when using ````ReturnAsStream```` transfer mode (defaults to ````json````).
    :param stream_compression: **(EXPERIMENTAL)** *(Optional)* Compression format to use. This only applies when using ````ReturnAsStream```` transfer mode (defaults to ````none````)
    :param trace_config: *(Optional)*
    :param perfetto_config: **(EXPERIMENTAL)** *(Optional)* Base64-encoded serialized perfetto.protos.TraceConfig protobuf message When specified, the parameters ````categories````, ````options````, ````traceConfig```` are ignored.
    :param tracing_backend: **(EXPERIMENTAL)** *(Optional)* Backend type (defaults to ````auto```)
    Nrp   optionsbufferUsageReportingIntervaltransferModestreamFormatstreamCompressiontraceConfigperfettoConfigtracingBackendzTracing.startrt   )r   r   )rp   r   buffer_usage_reporting_intervaltransfer_modestream_formatstream_compressiontrace_configperfetto_configtracing_backendru   rm   r   s               r   startr      s     0 &F)|#y&21P-. !.~ !.!6!6!8~%&8&@&@&B"# , 4 4 6}"#2 "#2#:#:#< !H >Ds   BBzTracing.bufferUsagec                  B    e Zd ZU dZded<   ded<   ded<   edd       Zy)	BufferUsagez
    **EXPERIMENTAL**


    r*   percent_fullevent_countrJ   c                     | d|v rt        |d         nd d|v rt        |d         nd d|v rt        |d               S d       S )NpercentFull
eventCountrJ   )r   r   rJ   )rA   r   s     r   r   zBufferUsage.from_json5  s_    7D7LtM23RV5AT5Id<01t*1T/%W&
 	
 @D
 	
r   N)r   r   r   r   r    r!   r"   r#   rD   r$   r   r   r   r   r   r   $  s/     )('' "!
 
r   r   zTracing.dataCollectedc                  .    e Zd ZU dZded<   edd       Zy)DataCollectedz
    **EXPERIMENTAL**

    Contains a bucket of collected trace events. When tracing is stopped collected events will be
    sent as a sequence of dataCollected events followed by tracingComplete event.
    ztyping.List[dict]rJ   c                R     | |d   D cg c]  }t        |       c}      S c c}w )NrJ   rI   rv   rC   s      r   r   zDataCollected.from_jsonI  s(    $(M2q472
 	
2s   $N)r   r   r   r   r   r   r   r   r   r   >  s!     
 
r   r   zTracing.tracingCompletec                  L    e Zd ZU dZded<   ded<   ded<   ded	<   edd
       Zy)TracingCompletez
    Signals that tracing is stopped and there is no trace buffers pending flush, all data were
    delivered via dataCollected events.
    rB   data_loss_occurredz typing.Optional[io.StreamHandle]streamtyping.Optional[StreamFormat]trace_format"typing.Optional[StreamCompression]r   c           	          | t        |d         d|v r"t        j                  j                  |d         nd d|v rt        j                  |d         nd d|v rt
        j                  |d               S d       S )NdataLossOccurredr   traceFormatr   )r   r   r   r   )rB   r   StreamHandler   rF   rP   r   s     r   r   zTracingComplete.from_jsona  s    #D);$<=@HD@P2??,,T(^<VZHUY]H]//]0CDcgYlptYt0::4@S;TU	
 	
 {	
 	
r   N)r   r   r   r   r   r   r   r   r   r   P  s3     ,,//::
 
r   r   )r   0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])r   z<typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[str]])rw   r@   r   r   )NN)rz   r,   r~   z(typing.Optional[MemoryDumpLevelOfDetail]r   zCtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[str, bool]])	NNNNNNNNN)rp   r(   r   r(   r   r*   r   r(   r   r   r   r   r   ztyping.Optional[TraceConfig]r   r(   r   ztyping.Optional[TracingBackend]r   r   )
__future__r   utilr   r   dataclassesr   enumtyping r   r   r
   r'   EnumrF   rP   rX   rb   rn   rq   rx   r   r   r   r   r   r   r   r   <module>r      s   # * !   At A ?
 ?
 ?
D499  		 dii $TYY (0	7( 04DH,A 
KB ,0(,BF.27;AE5904;?/(/%/ *@/ ,	/
 5/ ?/ 3/ ./ 9/ 
8/d "#

 
  $
0 $%

 
  &
  &'

 
  (
r   