
    ,h2                    
   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
 ddl	mZ e G d d	             Ze G d
 d             Ze G d d             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d&dZ	 	 	 d)	 	 	 	 	 	 	 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 ed#      e G d$ d%                    Zy)-    )annotations   )event_classT_JSON_DICT)	dataclassN)debugger)runtimec                  t    e Zd ZU dZded<   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)ProfileNodezY
    Profile node. Holds callsite information, execution statistics and child nodes.
    intid_zruntime.CallFrame
call_frameNztyping.Optional[int]	hit_count!typing.Optional[typing.List[int]]childrentyping.Optional[str]deopt_reasonz.typing.Optional[typing.List[PositionTickInfo]]position_ticksc                   t               }| j                  |d<   | j                  j                         |d<   | j                  | j                  |d<   | j
                  | j
                  D cg c]  }| c}|d<   | j                  | j                  |d<   | j                  +| j                  D cg c]  }|j                          c}|d<   |S c c}w c c}w )Nid	callFramehitCountr   deoptReasonpositionTicks)dictr   r   to_jsonr   r   r   r   selfjsonis      r/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/selenium/webdriver/common/devtools/v135/profiler.pyr   zProfileNode.to_json(   s    vXXT
 OO335[>>%#~~D==$+/==9a9D("&"3"3D*:>:M:M$NQQYY[$ND!  : %Os   ,	C0Cc                p    | t        |d         t        j                  j                  |d         d|v rt        |d         nd d|v r|d   D cg c]  }t        |       c}nd d|v rt	        |d         nd d|v r+|d   D cg c]  }t
        j                  |       c}      S d       S c c}w c c}w )Nr   r   r   r   r   r   )r   r   r   r   r   r   )r   r	   	CallFrame	from_jsonstrPositionTickInfoclsr   r    s      r!   r$   zProfileNode.from_json6   s    DJ((2243DE/9T/Ac$z*+t;E;Md:&67c!f7SW5Bd5JT-01PT]lpt]t4CXYa,66q9Y
 	
 {
 	
 8Ys   B.B3)__name__
__module____qualname____doc____annotations__r   r   r   r   r   classmethodr$        r!   r   r      se     
H "! '+I#* 37H/6 *.L&- FJNBI 
 
r0   r   c                  b    e Zd ZU dZded<   ded<   ded<   dZded	<   dZded
<   d Zed        Z	y)Profilez
    Profile.
    ztyping.List[ProfileNode]nodesfloat
start_timeend_timeNr   samplestime_deltasc                n   t               }| j                  D cg c]  }|j                          c}|d<   | j                  |d<   | j                  |d<   | j
                  | j
                  D cg c]  }| c}|d<   | j                  | j                  D cg c]  }| c}|d<   |S c c}w c c}w c c}w )Nr3   	startTimeendTimer7   
timeDeltas)r   r3   r   r5   r6   r7   r8   r   s      r!   r   zProfile.to_jsonW   s    v.2jj99W OO[--Y<<#*.,,7Qq7DO'-1-=-=!>!!>D : 8!>s   B(.	B-	B2c                <    | |d   D cg c]  }t         j                  |       c}t        |d         t        |d         d|v r|d   D cg c]  }t        |       c}nd d|v r!|d   D cg c]  }t        |       c}      S d       S c c}w c c}w c c}w )Nr3   r:   r;   r7   r<   )r3   r5   r6   r7   r8   )r   r$   r4   r   r'   s      r!   r$   zProfile.from_jsonb   s    59']C;((+CT+./4	?+9Bd9JT)_5SV5PT@LPT@Tl);<AQ<
 	

 [_
 	
C 6<s   BB.B)
r)   r*   r+   r,   r-   r7   r8   r   r.   r$   r/   r0   r!   r2   r2   B   sQ     $#  O 26G.5 6:K29	 
 
r0   r2   c                  <    e Zd ZU dZded<   ded<   d Zed        Zy)r&   zP
    Specifies a number of samples attributed to a certain source position.
    r   lineticksc                V    t               }| j                  |d<   | j                  |d<   |S )Nr?   r@   )r   r?   r@   r   r   s     r!   r   zPositionTickInfo.to_jsonx   s(    vyyV

Wr0   c                F     | t        |d         t        |d               S )Nr?   r@   )r?   r@   r   r(   r   s     r!   r$   zPositionTickInfo.from_json~   s'    T&\"d7m$
 	
r0   Nr)   r*   r+   r,   r-   r   r.   r$   r/   r0   r!   r&   r&   m   s.     I J 
 
r0   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)	CoverageRangez+
    Coverage data for a source range.
    r   start_offset
end_offsetcountc                t    t               }| j                  |d<   | j                  |d<   | j                  |d<   |S )NstartOffset	endOffsetrK   )r   rI   rJ   rK   rB   s     r!   r   zCoverageRange.to_json   s9    v"//] OO[

Wr0   c                `     | t        |d         t        |d         t        |d               S )NrM   rN   rK   )rI   rJ   rK   rD   rE   s     r!   r$   zCoverageRange.from_json   s5    T-014,-d7m$
 	
r0   NrF   r/   r0   r!   rH   rH      s6      O J 
 
r0   rH   c                  F    e Zd ZU dZded<   ded<   ded<   d Zed	        Zy
)FunctionCoveragez2
    Coverage data for a JavaScript function.
    r%   function_nameztyping.List[CoverageRange]rangesboolis_block_coveragec                    t               }| j                  |d<   | j                  D cg c]  }|j                          c}|d<   | j                  |d<   |S c c}w )NfunctionNamerS   isBlockCoverage)r   rR   rS   r   rU   r   s      r!   r   zFunctionCoverage.to_json   sR    v#11^/3{{;!!))+;X"&"8"8 <s   Ac           	          | t        |d         |d   D cg c]  }t        j                  |       c}t        |d               S c c}w )NrW   rS   rX   )rR   rS   rU   )r%   rH   r$   rT   r'   s      r!   r$   zFunctionCoverage.from_json   sJ    d>238<XG1M++A.G"4(9#:;
 	
Gs   A
NrF   r/   r0   r!   rQ   rQ      s8      '&  
 
r0   rQ   c                  F    e Zd ZU dZded<   ded<   ded<   d Zed	        Zy
)ScriptCoveragez0
    Coverage data for a JavaScript script.
    zruntime.ScriptId	script_idr%   urlztyping.List[FunctionCoverage]	functionsc                    t               }| j                  j                         |d<   | j                  |d<   | j                  D cg c]  }|j                          c}|d<   |S c c}w )NscriptIdr]   r^   )r   r\   r   r]   r^   r   s      r!   r   zScriptCoverage.to_json   sW    v>>113ZhhU26..AQQYY[A[ Bs   A$c           
          | t         j                  j                  |d         t        |d         |d   D cg c]  }t        j                  |       c}      S c c}w )Nr`   r]   r^   )r\   r]   r^   )r	   ScriptIdr$   r%   rQ   r'   s      r!   r$   zScriptCoverage.from_json   sY    &&00j1ABDK >B;>OP'11!4P
 	
 Qs   ANrF   r/   r0   r!   r[   r[      s7       
H -, 
 
r0   r[   c               #     K   ddi} | }y w)NmethodzProfiler.disabler/   cmd_dictr   s     r!   disablerg      s      	$H >D   
c               #     K   ddi} | }y w)Nrd   zProfiler.enabler/   re   s     r!   enablerj      s      	#H >Drh   c               #  p   K   ddi} | }|d   D cg c]  }t         j                  |       c}S c c}w w)z
    Collect coverage data for the current isolate. The coverage data may be incomplete due to
    garbage collection.

    :returns: Coverage data for the current isolate.
    rd   zProfiler.getBestEffortCoverageresult)r[   r$   rf   r   r    s      r!   get_best_effort_coveragern      sA      	2H >D15h@AN$$Q'@@@s   616c              #  <   K   t               }| |d<   d|d}|}yw)z
    Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.

    :param interval: New sampling interval in microseconds.
    intervalzProfiler.setSamplingIntervalrd   paramsN)r   )rp   rr   rf   r   s       r!   set_sampling_intervalrs      s/      &F!F:0H >Ds   c               #     K   ddi} | }y w)Nrd   zProfiler.startr/   re   s     r!   startru     s      	"H >Drh   c              #  v   K   t               }| | |d<   |||d<   |||d<   d|d}|}t        |d         S w)aW  
    Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code
    coverage may be incomplete. Enabling prevents running optimized code and resets execution
    counters.

    :param call_count: *(Optional)* Collect accurate call counts beyond simple 'covered' or 'not covered'.
    :param detailed: *(Optional)* Collect block-based coverage.
    :param allow_triggered_updates: *(Optional)* Allow the backend to send updates on its own initiative
    :returns: Monotonically increasing time (in seconds) when the coverage update was taken in the backend.
    	callCountdetailedallowTriggeredUpdateszProfiler.startPreciseCoveragerq   	timestamp)r   r4   )
call_countrx   allow_triggered_updatesrr   rf   r   s         r!   start_precise_coverager}     sf      &F({%z**A&'1H >Dk"##s   79c               #  J   K   ddi} | }t         j                  |d         S w)z'


    :returns: Recorded profile.
    rd   zProfiler.stopprofile)r2   r$   re   s     r!   stopr   5  s2      	/H >DT)_--s   !#c               #     K   ddi} | }yw)z
    Disable precise code coverage. Disabling releases unnecessary execution count records and allows
    executing optimized code.
    rd   zProfiler.stopPreciseCoverageNr/   re   s     r!   stop_precise_coverager   B  s      	0H >Drh   c               #     K   ddi} | }|d   D cg c]  }t         j                  |       c}t        |d         fS c c}w w)ar  
    Collect coverage data for the current isolate, and resets execution counters. Precise code
    coverage needs to have started.

    :returns: A tuple with the following items:

        0. **result** - Coverage data for the current isolate.
        1. **timestamp** - Monotonically increasing time (in seconds) when the coverage update was taken in the backend.
    rd   zProfiler.takePreciseCoveragerl   rz   )r[   r$   r4   rm   s      r!   take_precise_coverager   M  sU      	0H >D.28n=	!	!!	$=d;  =s   A?AzProfiler.consoleProfileFinishedc                  H    e Zd ZU ded<   ded<   ded<   ded<   edd	       Zy
)ConsoleProfileFinishedr%   r   debugger.Locationlocationr2   r   r   titlec           	          | t        |d         t        j                  j                  |d         t        j                  |d         d|v rt        |d               S d       S )Nr   r   r   r   )r   r   r   r   )r%   r   Locationr$   r2   rE   s     r!   r$   z ConsoleProfileFinished.from_jsonk  sg    DJ&&00j1AB%%d9o6(/4#d7m$	
 	
 >B	
 	
r0   N)r   r   returnr   )r)   r*   r+   r-   r.   r$   r/   r0   r!   r   r   a  s-     
H
 
r0   r   zProfiler.consoleProfileStartedc                  B    e Zd ZU dZded<   ded<   ded<   ed
d       Zy	)ConsoleProfileStartedzR
    Sent when new profile recording is started using console.profile() call.
    r%   r   r   r   r   r   c                     | t        |d         t        j                  j                  |d         d|v rt        |d               S d       S )Nr   r   r   )r   r   r   )r%   r   r   r$   rE   s     r!   r$   zConsoleProfileStarted.from_json  sU    DJ&&00j1AB(/4#d7m$
 	
 >B
 	
r0   N)r   r   r   r   r)   r*   r+   r,   r-   r.   r$   r/   r0   r!   r   r   u  s,     
H
 
r0   r   z#Profiler.preciseCoverageDeltaUpdatec                  B    e Zd ZU dZded<   ded<   ded<   ed
d       Zy	)PreciseCoverageDeltaUpdateas  
    **EXPERIMENTAL**

    Reports coverage delta since the last poll (either from an event like this, or from
    ``takePreciseCoverage`` for the current isolate. May only be sent if precise code
    coverage has been started. This event can be trigged by the embedder to, for example,
    trigger collection of coverage data immediately at a certain point in time.
    r4   rz   r%   occasionztyping.List[ScriptCoverage]rl   c           
          | t        |d         t        |d         |d   D cg c]  }t        j                  |       c}      S c c}w )Nrz   r   rl   )rz   r   rl   )r4   r%   r[   r$   r'   s      r!   r$   z$PreciseCoverageDeltaUpdate.from_json  sL    D-.j)*9=hHAN,,Q/H
 	
 Is   AN)r   r   r   r   r   r/   r0   r!   r   r     s,     M''
 
r0   r   )r   0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])r   zGtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[ScriptCoverage]])rp   r   r   r   )NNN)r{   typing.Optional[bool]rx   r   r|   r   r   z1typing.Generator[T_JSON_DICT, T_JSON_DICT, float])r   z3typing.Generator[T_JSON_DICT, T_JSON_DICT, Profile])r   z\typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[typing.List[ScriptCoverage], float]])
__future__r   utilr   r   dataclassesr   enumtyping r   r	   r   r2   r&   rH   rQ   r[   rg   rj   rn   rs   ru   r}   r   r   r   r   r   r   r/   r0   r!   <module>r      s   # * !     .
 .
 .
b '
 '
 '
T 
 
 
0 
 
 
: 
 
 
: 
 
 
:A	7" -1*.9=$)$'$ "7$ 
9	$<
.( ./

 
  0
$ -.

 
  /
& 23

 
  4
r0   