
    ?OOf                    F   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 G d	 d
e      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e G d d             Ze G d d             Z G d dej,                        Ze G d d             Z	 dN	 	 	 	 	 dOdZdPd Z	 dN	 	 	 dQd!Z	 	 	 	 	 	 	 dR	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dSd"Z	 	 dT	 	 	 	 	 	 	 dUd#Z	 	 	 	 dVd$Z	 	 	 	 dWd%Z	 	 	 	 dXd&Z 	 	 	 	 dYd'Z!	 	 	 	 dZd(Z"dPd)Z#	 	 	 	 d[d*Z$	 	 	 	 d\d+Z%	 dN	 	 	 	 	 d]d,Z&	 dN	 	 	 d^d-Z'	 	 dT	 	 	 	 	 	 	 	 	 d_d.Z(	 	 	 	 d`d/Z)	 	 	 	 dad0Z*	 	 	 	 	 	 dbd1Z+	 dN	 	 	 	 	 dcd2Z,	 	 	 	 ddd3Z-	 	 	 	 	 de	 	 	 	 	 	 	 	 	 	 	 	 	 dfd4Z.	 dN	 	 	 	 	 dgd5Z/	 	 	 	 dhd6Z0	 	 	 	 did7Z1	 	 	 	 djd8Z2	 	 dT	 	 	 	 	 	 	 	 	 dkd9Z3	 	 	 	 dld:Z4	 	 	 	 	 	 	 	 	 	 dmd;Z5	 	 dT	 	 	 	 	 dnd<Z6dPd=Z7	 dN	 	 	 dod>Z8 ed?      e G d@ dA                    Z9 edB      e G dC dD                    Z: edE      e G dF dG                    Z; edH      e G dI dJ                    Z< edK      e G dL dM                    Z=y)p    )annotations   )event_classT_JSON_DICT)	dataclassN)runtimec                  <     e Zd ZdZddZedd       Z fdZ xZS )BreakpointIdz 
    Breakpoint identifier.
    c                    | S N selfs    q/var/www/premiumrankchecker/venv/lib/python3.12/site-packages/selenium/webdriver/common/devtools/v125/debugger.pyto_jsonzBreakpointId.to_json           c                     | |      S r   r   clsjsons     r   	from_jsonzBreakpointId.from_json       4yr   c                >    dj                  t        | 	               S )NzBreakpointId({})formatsuper__repr__r   	__class__s    r   r   zBreakpointId.__repr__   s    !(()9);<<r   returnstr)r   r#   r"   r
   	__name__
__module____qualname____doc__r   classmethodr   r   __classcell__r    s   @r   r
   r
      s+      = =r   r
   c                  <     e Zd ZdZddZedd       Z fdZ xZS )CallFrameIdz 
    Call frame identifier.
    c                    | S r   r   r   s    r   r   zCallFrameId.to_json"   r   r   c                     | |      S r   r   r   s     r   r   zCallFrameId.from_json%   r   r   c                >    dj                  t        | 	               S )NzCallFrameId({})r   r   s    r   r   zCallFrameId.__repr__)   s     ''(8(:;;r   r!   )r   r#   r"   r-   r$   r+   s   @r   r-   r-      s+      < <r   r-   c                  J    e Zd ZU dZded<   ded<   dZded<   d	 Zed
        Zy)Location&
    Location in the source code.
    runtime.ScriptId	script_idintline_numberNtyping.Optional[int]column_numberc                    t               }| j                  j                         |d<   | j                  |d<   | j                  | j                  |d<   |S )NscriptId
lineNumbercolumnNumber)dictr5   r   r7   r9   r   r   s     r   r   zLocation.to_json;   sQ    v>>113Z!--\)#'#5#5D r   c                     | t         j                  j                  |d         t        |d         d|v rt        |d               S d       S )Nr;   r<   r=   )r5   r7   r9   )r   ScriptIdr   r6   r   s     r   r   zLocation.from_jsonC   sZ    &&00j1ABD./7E7M#d>23
 	
 TX
 	
r   )	r%   r&   r'   r(   __annotations__r9   r   r)   r   r   r   r   r2   r2   -   s=        +/M'. 
 
r   r2   c                  <    e Zd ZU dZded<   ded<   d Zed        Zy)ScriptPositionr3   r6   r7   r9   c                V    t               }| j                  |d<   | j                  |d<   |S )Nr<   r=   )r>   r7   r9   r?   s     r   r   zScriptPosition.to_jsonU   s.    v!--\#11^r   c                F     | t        |d         t        |d               S )Nr<   r=   )r7   r9   )r6   r   s     r   r   zScriptPosition.from_json[   s)    D./d>23
 	
r   Nr%   r&   r'   r(   rB   r   r)   r   r   r   r   rD   rD   L   s.      
 
r   rD   c                  F    e Zd ZU dZded<   ded<   ded<   d Zed        Zy	)
LocationRangez+
    Location range within one script.
    r4   r5   rD   startendc                    t               }| j                  j                         |d<   | j                  j                         |d<   | j                  j                         |d<   |S )Nr;   rJ   rK   )r>   r5   r   rJ   rK   r?   s     r   r   zLocationRange.to_jsonn   sQ    v>>113Z

**,Whh&&(Ur   c                     | t         j                  j                  |d         t        j                  |d         t        j                  |d               S )Nr;   rJ   rK   )r5   rJ   rK   )r   rA   r   rD   r   s     r   r   zLocationRange.from_jsonu   sL    &&00j1AB **4=9((e5
 	
r   NrG   r   r   r   rI   rI   c   s4      	 
 
r   rI   c                      e Zd ZU dZded<   ded<   ded<   ded<   d	ed
<   ded<   dZded<   dZded<   dZded<   d Ze	d        Z
y)	CallFramezJ
    JavaScript call frame. Array of call frames form the call stack.
    r-   call_frame_idr#   function_namer2   locationurlztyping.List[Scope]scope_chainruntime.RemoteObjectthisNtyping.Optional[Location]function_locationz%typing.Optional[runtime.RemoteObject]return_valuetyping.Optional[bool]can_be_restartedc                >   t               }| j                  j                         |d<   | j                  |d<   | j                  j                         |d<   | j
                  |d<   | j                  D cg c]  }|j                          c}|d<   | j                  j                         |d<   | j                  | j                  j                         |d<   | j                  | j                  j                         |d<   | j                  | j                  |d	<   |S c c}w )
NcallFrameIdfunctionNamerR   rS   
scopeChainrV   functionLocationreturnValuecanBeRestarted)r>   rP   r   rQ   rR   rS   rT   rV   rX   rY   r[   r   r   is      r   r   zCallFrame.to_json   s    v"0088:]#11^==002ZhhU373C3CDaaiikD\yy((*V!!-'+'='='E'E'GD#$("&"3"3";";"=D  ,%)%:%:D!" Es   1Dc                    | t         j                  |d         t        |d         t        j                  |d         t        |d         |d   D cg c]  }t        j                  |       c}t
        j                  j                  |d         d|v rt        j                  |d         nd d|v r"t
        j                  j                  |d         nd d	|v rt        |d	         
	      S d 
	      S c c}w )Nr]   r^   rR   rS   r_   rV   r`   ra   rb   )	rP   rQ   rR   rS   rT   rV   rX   rY   r[   )r-   r   r#   r2   Scoper   RemoteObjectboolr   r   rd   s      r   r   zCallFrame.from_json   s    %//]0CDd>23''Z(89DK 59,5GH+H%%//V=N`dhNhh006H1IJnrP]aePe--77]8KLko=MQU=UT$'7"89

 
	
 \`

 
	

 Is   C3)r%   r&   r'   r(   rB   rX   rY   r[   r   r)   r   r   r   r   rO   rO   ~   sx       
 
H $#  4807 ;?L7> /3+2  
 
r   rO   c                  f    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e	d        Z
y)rf   z
    Scope description.
    r#   type_rU   object_Ntyping.Optional[str]namerW   start_locationend_locationc                L   t               }| j                  |d<   | j                  j                         |d<   | j                  | j                  |d<   | j
                  | j
                  j                         |d<   | j                  | j                  j                         |d<   |S )Ntypeobjectrn   startLocationendLocation)r>   rk   rl   r   rn   ro   rp   r?   s     r   r   zScope.to_json   s    vzzV--/X99 99DL*$($7$7$?$?$AD!("&"3"3";";"=Dr   c           
         | t        |d         t        j                  j                  |d         d|v rt        |d         nd d|v rt        j                  |d         nd d|v rt        j                  |d               S d       S )Nrr   rs   rn   rt   ru   )rk   rl   rn   ro   rp   )r#   r   rg   r   r2   r   s     r   r   zScope.from_json   s    d6l#((224>B&,nT&\"$HW[_H_8--d?.CDeiDQUYDY++D,?@
 	

 `d
 	
r   )r%   r&   r'   r(   rB   rn   ro   rp   r   r)   r   r   r   r   rf   rf      sT     J
 "!!%D
% 15N-4 /3L+2
 
 
r   rf   c                  <    e Zd ZU dZded<   ded<   d Zed        Zy)	SearchMatchz$
    Search match for resource.
    floatr7   r#   line_contentc                V    t               }| j                  |d<   | j                  |d<   |S )Nr<   lineContent)r>   r7   rz   r?   s     r   r   zSearchMatch.to_json   s.    v!--\"//]r   c                F     | t        |d         t        |d               S )Nr<   r|   )r7   rz   )ry   r#   r   s     r   r   zSearchMatch.from_json   s)    d<01T-01
 	
r   NrG   r   r   r   rx   rx      s0       
 
r   rx   c                  T    e Zd ZU ded<   ded<   dZded<   dZded	<   d
 Zed        Zy)BreakLocationr4   r5   r6   r7   Nr8   r9   rm   rk   c                    t               }| j                  j                         |d<   | j                  |d<   | j                  | j                  |d<   | j
                  | j
                  |d<   |S )Nr;   r<   r=   rr   )r>   r5   r   r7   r9   rk   r?   s     r   r   zBreakLocation.to_json  sh    v>>113Z!--\)#'#5#5D ::!::DLr   c           	          | t         j                  j                  |d         t        |d         d|v rt        |d         nd d|v rt	        |d               S d       S )Nr;   r<   r=   rr   )r5   r7   r9   rk   )r   rA   r   r6   r#   r   s     r   r   zBreakLocation.from_json  sn    &&00j1ABD./7E7M#d>23SW'-~#d6l#	
 	
 <@	
 	
r   )	r%   r&   r'   rB   r9   rk   r   r)   r   r   r   r   r   r     sC        +/M'."&E& 
 
r   r   c                  8    e Zd ZU ded<   ded<   d Zed        Zy)WasmDisassemblyChunktyping.List[str]linesztyping.List[int]bytecode_offsetsc                    t               }| j                  D cg c]  }| c}|d<   | j                  D cg c]  }| c}|d<   |S c c}w c c}w )Nr   bytecodeOffsets)r>   r   r   rc   s      r   r   zWasmDisassemblyChunk.to_json0  sJ    v$(JJ/q/W.2.C.C"D1"D 0"Ds
   	A	Ac           	          | |d   D cg c]  }t        |       c}|d   D cg c]  }t        |       c}      S c c}w c c}w )Nr   r   )r   r   )r#   r6   ri   s      r   r   zWasmDisassemblyChunk.from_json6  sC    #'=1a3q61.23D.EFc!fF
 	
1Fs	   ?A
N)r%   r&   r'   rB   r   r)   r   r   r   r   r   r   (  s+      '& 
 
r   r   c                  .    e Zd ZdZdZdZd Zed        Zy)ScriptLanguagez,
    Enum of possible script languages.
    
JavaScriptWebAssemblyc                    | j                   S r   )valuer   s    r   r   zScriptLanguage.to_jsonE  s    zzr   c                     | |      S r   r   r   s     r   r   zScriptLanguage.from_jsonH  r   r   N)	r%   r&   r'   r(   JAVA_SCRIPTWEB_ASSEMBLYr   r)   r   r   r   r   r   r   >  s,     K L  r   r   c                  @    e Zd ZU dZded<   dZded<   d Zed        Zy)	DebugSymbolsz4
    Debug symbols available for a wasm script.
    r#   rk   Nrm   external_urlc                n    t               }| j                  |d<   | j                  | j                  |d<   |S )Nrr   externalURL)r>   rk   r   r?   s     r   r   zDebugSymbols.to_jsonX  s7    vzzV("&"3"3Dr   c                \     | t        |d         d|v rt        |d               S d       S )Nrr   r   )rk   r   )r#   r   s     r   r   zDebugSymbols.from_json_  s<    d6l#5Bd5JT-01
 	
PT
 	
r   )	r%   r&   r'   r(   rB   r   r   r)   r   r   r   r   r   r   M  s4     J *.L&- 
 
r   r   c              #  f   K   t               }| j                         |d<   |||d<   d|d}|}yw)z
    Continues execution until specific location is reached.

    :param location: Location to continue to.
    :param target_call_frames: *(Optional)*
    rR   NtargetCallFrameszDebugger.continueToLocationmethodparamsr>   r   )rR   target_call_framesr   cmd_dictr   s        r   continue_to_locationr   g  sI      &F!))+F:%%7!"/H >Ds   /1c               #     K   ddi} | }yw)z+
    Disables debugger for given page.
    r   zDebugger.disableNr   r   r   s     r   disabler   |       
 	$H >D   
c              #     K   t               }| | |d<   d|d}|}t        j                  j                  |d         S w)a  
    Enables debugger for the given page. Clients should not assume that the debugging has been
    enabled until the result for this command is received.

    :param max_scripts_cache_size: **(EXPERIMENTAL)** *(Optional)* The maximum size in bytes of collected scripts (not referenced by other heap objects) the debugger can hold. Puts no limit if parameter is omitted.
    :returns: Unique identifier of the debugger.
    maxScriptsCacheSizezDebugger.enabler   
debuggerId)r>   r   UniqueDebuggerIdr   )max_scripts_cache_sizer   r   r   s       r   enabler     sR      &F)(>$%#H >D##--d<.@AAs   =?c	              #  t  K   t               }	| j                         |	d<   ||	d<   |||	d<   |||	d<   |||	d<   |||	d<   |||	d<   |||	d	<   ||j                         |	d
<   d|	d}
|
}t        j                  j	                  |d         d|v r#t        j
                  j	                  |d         fS dfS w)a$  
    Evaluates expression on a given call frame.

    :param call_frame_id: Call frame identifier to evaluate on.
    :param expression: Expression to evaluate.
    :param object_group: *(Optional)* String object group name to put result into (allows rapid releasing resulting object handles using ```releaseObjectGroup````).
    :param include_command_line_api: *(Optional)* Specifies whether command line API should be available to the evaluated expression, defaults to false.
    :param silent: *(Optional)* In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides ````setPauseOnException``` state.
    :param return_by_value: *(Optional)* Whether the result is expected to be a JSON object that should be sent by value.
    :param generate_preview: **(EXPERIMENTAL)** *(Optional)* Whether preview should be generated for the result.
    :param throw_on_side_effect: *(Optional)* Whether to throw an exception if side effect cannot be ruled out during evaluation.
    :param timeout: **(EXPERIMENTAL)** *(Optional)* Terminate execution after timing out (number of milliseconds).
    :returns: A tuple with the following items:

        0. **result** - Object wrapper for the evaluation result.
        1. **exceptionDetails** - *(Optional)* Exception details.
    r]   
expressionNobjectGroupincludeCommandLineAPIsilentreturnByValuegeneratePreviewthrowOnSideEffecttimeoutzDebugger.evaluateOnCallFramer   resultexceptionDetails)r>   r   r   rg   r   ExceptionDetails)rP   r   object_groupinclude_command_line_apir   return_by_valuegenerate_previewthrow_on_side_effectr   r   r   r   s               r   evaluate_on_call_framer     s    8 &F)113F=%F< ,}+*B&'!x""1#$4 !'&:"##OO-y0H >D&&tH~6HZ^bHb  **40B+CD hl s   B6B8c              #     K   t               }| j                         |d<   ||j                         |d<   |||d<   d|d}|}|d   D cg c]  }t        j                  |       c}S c c}w w)a  
    Returns possible locations for breakpoint. scriptId in start and end range locations should be
    the same.

    :param start: Start of range to search possible breakpoint locations in.
    :param end: *(Optional)* End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range.
    :param restrict_to_function: *(Optional)* Only consider locations which are in the same (non-nested) function as start.
    :returns: List of the possible breakpoint locations.
    rJ   rK   restrictToFunctionzDebugger.getPossibleBreakpointsr   	locations)r>   r   r   r   )rJ   rK   restrict_to_functionr   r   r   rd   s          r   get_possible_breakpointsr     s}      &FmmoF7O
u'';#$3H >D04[0AB1M##A&BBBs   A
A0A+(A0c              #     K   t               }| j                         |d<   d|d}|}t        |d         d|v rt        |d         fS dfS w)a&  
    Returns source for the script with given id.

    :param script_id: Id of the script to get source for.
    :returns: A tuple with the following items:

        0. **scriptSource** - Script source (empty in case of Wasm bytecode).
        1. **bytecode** - *(Optional)* Wasm bytecode.
    r;   zDebugger.getScriptSourcer   scriptSourcebytecodeNr>   r   r#   r5   r   r   r   s       r   get_script_sourcer     sp      &F"**,F:,H >DD !!+t!3D 9= s   A
Ac              #    K   t               }| j                         |d<   d|d}|}d|v rt        |d         ndt        |d         |d   D cg c]  }t        |       c}t        j                  |d         fS c c}w w)	a9  


    **EXPERIMENTAL**

    :param script_id: Id of the script to disassemble
    :returns: A tuple with the following items:

        0. **streamId** - *(Optional)* For large modules, return a stream from which additional chunks of disassembly can be read successively.
        1. **totalNumberOfLines** - The total number of lines in the disassembly text.
        2. **functionBodyOffsets** - The offsets of all function bodies, in the format [start1, end1, start2, end2, ...] where all ends are exclusive.
        3. **chunk** - The first chunk of disassembly.
    r;   zDebugger.disassembleWasmModuler   streamIdNtotalNumberOfLinesfunctionBodyOffsetschunk)r>   r   r#   r6   r   r   )r5   r   r   r   rd   s        r   disassemble_wasm_moduler     s       &F"**,F:2H >D!+t!3DD%&'345AQ5&&tG}5	  	6s   ABA=" Bc              #  j   K   t               }| |d<   d|d}|}t        j                  |d         S w)a`  
    Disassemble the next chunk of lines for the module corresponding to the
    stream. If disassembly is complete, this API will invalidate the streamId
    and return an empty chunk. Any subsequent calls for the now invalid stream
    will return errors.

    **EXPERIMENTAL**

    :param stream_id:
    :returns: The next chunk of disassembly.
    r   z!Debugger.nextWasmDisassemblyChunkr   r   )r>   r   r   )	stream_idr   r   r   s       r   next_wasm_disassembly_chunkr   '  sD      &F"F:5H >D))$w-88   13c              #  r   K   t               }| j                         |d<   d|d}|}t        |d         S w)z
    This command is deprecated. Use getScriptSource instead.

    :param script_id: Id of the Wasm script to get source for.
    :returns: Script source.
    r;   zDebugger.getWasmBytecoder   r   r   r   s       r   get_wasm_bytecoder   ?  sH      &F"**,F:,H >DtJ  s   57c              #     K   t               }| j                         |d<   d|d}|}t        j                  j	                  |d         S w)z{
    Returns stack trace with given ``stackTraceId``.

    **EXPERIMENTAL**

    :param stack_trace_id:
    :returns: 
    stackTraceIdzDebugger.getStackTracer   
stackTrace)r>   r   r   
StackTracer   )stack_trace_idr   r   r   s       r   get_stack_tracer   R  sT      &F+335F>*H >D''\(:;;s   A	Ac               #     K   ddi} | }yw)z1
    Stops on the next JavaScript statement.
    r   zDebugger.pauseNr   r   s     r   pauser   g  s     
 	"H >Dr   c              #  X   K   t               }| j                         |d<   d|d}|}yw)z


    **EXPERIMENTAL**

    :param parent_stack_trace_id: Debugger will pause when async call with given stack trace is started.
    parentStackTraceIdzDebugger.pauseOnAsyncCallr   Nr   )parent_stack_trace_idr   r   r   s       r   pause_on_async_callr   q  s9      &F#8#@#@#BF -H >D   (*c              #  X   K   t               }| j                         |d<   d|d}|}yw)zC
    Removes JavaScript breakpoint.

    :param breakpoint_id:
    breakpointIdzDebugger.removeBreakpointr   Nr   )breakpoint_idr   r   r   s       r   remove_breakpointr     s8      &F*224F>-H >Dr   c              #  Z  K   t               }| j                         |d<   |||d<   d|d}|}|d   D cg c]  }t        j                  |       c}d|v r"t        j
                  j                  |d         ndd|v r#t        j                  j                  |d         fS dfS c c}w w)	a  
    Restarts particular call frame from the beginning. The old, deprecated
    behavior of ``restartFrame`` is to stay paused and allow further CDP commands
    after a restart was scheduled. This can cause problems with restarting, so
    we now continue execution immediatly after it has been scheduled until we
    reach the beginning of the restarted frame.

    To stay back-wards compatible, ``restartFrame`` now expects a ``mode``
    parameter to be present. If the ``mode`` parameter is missing, ``restartFrame``
    errors out.

    The various return values are deprecated and ``callFrames`` is always empty.
    Use the call frames from the ``Debugger#paused`` events instead, that fires
    once V8 pauses at the beginning of the restarted function.

    :param call_frame_id: Call frame identifier to evaluate on.
    :param mode: **(EXPERIMENTAL)** *(Optional)* The ```mode```` parameter must be present and set to 'StepInto', otherwise ````restartFrame``` will error out.
    :returns: A tuple with the following items:

        0. **callFrames** - New stack trace.
        1. **asyncStackTrace** - *(Optional)* Async stack trace, if any.
        2. **asyncStackTraceId** - *(Optional)* Async stack trace, if any.
    r]   NmodezDebugger.restartFramer   
callFramesasyncStackTraceasyncStackTraceId)r>   r   rO   r   r   r   StackTraceId)rP   r   r   r   r   rd   s         r   restart_framer     s     6 &F)113F=v)H >D)-l);<A		Q	<ARVZAZ$$T*;%<=`dEX\`E`&&t,?'@A  gk <s   5B+B&AB+c              #  @   K   t               }| | |d<   d|d}|}yw)a  
    Resumes JavaScript execution.

    :param terminate_on_resume: *(Optional)* Set to true to terminate execution upon resuming execution. In contrast to Runtime.terminateExecution, this will allows to execute further JavaScript (i.e. via evaluation) until execution of the paused code is actually resumed, at which point termination is triggered. If execution is currently not paused, this parameter has no effect.
    NterminateOnResumezDebugger.resumer   r>   )terminate_on_resumer   r   r   s       r   resumer     s6      &F&&9"##H >Ds   c              #     K   t               }| j                         |d<   ||d<   |||d<   |||d<   d|d}|}|d   D cg c]  }t        j                  |       c}S c c}w w)aR  
    Searches for given string in script content.

    :param script_id: Id of the script to search in.
    :param query: String to search for.
    :param case_sensitive: *(Optional)* If true, search is case sensitive.
    :param is_regex: *(Optional)* If true, treats string parameter as regex.
    :returns: List of search matches.
    r;   querycaseSensitiveisRegexzDebugger.searchInContentr   r   )r>   r   rx   r   )r5   r   case_sensitiveis_regexr   r   r   rd   s           r   search_in_contentr     s      &F"**,F:F7O!"0$y,H >D.28n=K!!!$===s   AA'A"A'c              #  <   K   t               }| |d<   d|d}|}yw)z
    Enables or disables async call stacks tracking.

    :param max_depth: Maximum depth of async call stacks. Setting to ```0``` will effectively disable collecting async call stacks (default).
    maxDepthzDebugger.setAsyncCallStackDepthr   Nr   )	max_depthr   r   r   s       r   set_async_call_stack_depthr     s/      &F"F:3H >D   c              #  b   K   t               }| D cg c]  }| c}|d<   d|d}|}yc c}w w)a  
    Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in
    scripts with url matching one of the patterns. VM will try to leave blackboxed script by
    performing 'step in' several times, finally resorting to 'step out' if unsuccessful.

    **EXPERIMENTAL**

    :param patterns: Array of regexps that will be used to check script url for blackbox state.
    patternszDebugger.setBlackboxPatternsr   Nr   )r   r   rd   r   r   s        r   set_blackbox_patternsr    s?      &F%-.!.F:0H >D /s   /	*/c              #     K   t               }| j                         |d<   |D cg c]  }|j                          c}|d<   d|d}|}yc c}w w)a  
    Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted
    scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
    Positions array contains positions where blackbox state is changed. First interval isn't
    blackboxed. Array should be sorted.

    **EXPERIMENTAL**

    :param script_id: Id of the script.
    :param positions:
    r;   	positionszDebugger.setBlackboxedRangesr   Nr   )r5   r  r   rd   r   r   s         r   set_blackboxed_rangesr    sX      &F"**,F:09:1199;:F;0H >D ;s   "AAAc              #     K   t               }| j                         |d<   |||d<   d|d}|}t        j                  |d         t        j                  |d         fS w)a  
    Sets JavaScript breakpoint at a given location.

    :param location: Location to set breakpoint in.
    :param condition: *(Optional)* Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.
    :returns: A tuple with the following items:

        0. **breakpointId** - Id of the created breakpoint for further reference.
        1. **actualLocation** - Location this breakpoint resolved into.
    rR   	conditionzDebugger.setBreakpointr   r   actualLocation)r>   r   r
   r   r2   )rR   r  r   r   r   s        r   set_breakpointr  /  sy      &F!))+F:'{*H >DtN344 012 s   AA c              #  j   K   t               }| |d<   d|d}|}t        j                  |d         S w)z
    Sets instrumentation breakpoint.

    :param instrumentation: Instrumentation name.
    :returns: Id of the created breakpoint for further reference.
    instrumentationz%Debugger.setInstrumentationBreakpointr   r   )r>   r
   r   )r
  r   r   r   s       r   set_instrumentation_breakpointr  L  sF      &F /F9H >D!!$~"677r   c              #    K   t               }| |d<   |||d<   |||d<   |||d<   |||d<   |||d<   d|d}|}t        j                  |d	         |d
   D 	cg c]  }	t        j                  |	       c}	fS c c}	w w)a  
    Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this
    command is issued, all existing parsed scripts will have breakpoints resolved and returned in
    ``locations`` property. Further matching script parsing will result in subsequent
    ``breakpointResolved`` events issued. This logical breakpoint will survive page reloads.

    :param line_number: Line number to set breakpoint at.
    :param url: *(Optional)* URL of the resources to set breakpoint on.
    :param url_regex: *(Optional)* Regex pattern for the URLs of the resources to set breakpoints on. Either ```url```` or ````urlRegex``` must be specified.
    :param script_hash: *(Optional)* Script hash of the resources to set breakpoint on.
    :param column_number: *(Optional)* Offset in the line to set breakpoint at.
    :param condition: *(Optional)* Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.
    :returns: A tuple with the following items:

        0. **breakpointId** - Id of the created breakpoint for further reference.
        1. **locations** - List of the locations this breakpoint resolved into upon addition.
    r<   rS   urlRegex
scriptHashr=   r  zDebugger.setBreakpointByUrlr   r   r   )r>   r
   r   r2   )
r7   rS   	url_regexscript_hashr9   r  r   r   r   rd   s
             r   set_breakpoint_by_urlr  _  s     2 &F&F<
u&z*| !.~'{/H >DtN34(,[(9:1		A	: :s   ABA<8	Bc              #     K   t               }| j                         |d<   |||d<   d|d}|}t        j                  |d         S w)a  
    Sets JavaScript breakpoint before each call to the given function.
    If another function was created from the same source as a given one,
    calling it will also trigger the breakpoint.

    **EXPERIMENTAL**

    :param object_id: Function object id.
    :param condition: *(Optional)* Expression to use as a breakpoint condition. When specified, debugger will stop on the breakpoint if this expression evaluates to true.
    :returns: Id of the created breakpoint for further reference.
    objectIdr  z$Debugger.setBreakpointOnFunctionCallr   r   )r>   r   r
   r   )	object_idr  r   r   r   s        r   set_breakpoint_on_function_callr    s^      &F"**,F:'{8H >D!!$~"677s   AAc              #  <   K   t               }| |d<   d|d}|}yw)zz
    Activates / deactivates all breakpoints on the page.

    :param active: New value for breakpoints active state.
    activezDebugger.setBreakpointsActiver   Nr   )r  r   r   r   s       r   set_breakpoints_activer    s/      &FF81H >Dr   c              #  <   K   t               }| |d<   d|d}|}yw)z
    Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions,
    or caught exceptions, no exceptions. Initial pause on exceptions state is ``none``.

    :param state: Pause on exceptions mode.
    statezDebugger.setPauseOnExceptionsr   Nr   )r  r   r   r   s       r   set_pause_on_exceptionsr    s.      &FF7O1H >Dr   c              #  X   K   t               }| j                         |d<   d|d}|}yw)z
    Changes return value in top frame. Available only at return break position.

    **EXPERIMENTAL**

    :param new_value: New return value.
    newValuezDebugger.setReturnValuer   Nr   )	new_valuer   r   r   s       r   set_return_valuer    s8      &F"**,F:+H >Dr   c           	   #    K   t               }| j                         |d<   ||d<   |||d<   |||d<   d|d}|}d|v r&|d   D cg c]  }t        j                  |       c}ndd	|v rt	        |d	         ndd
|v r"t
        j                  j                  |d
         ndd|v r"t
        j                  j                  |d         ndt        |d         d|v r#t
        j                  j                  |d         fS dfS c c}w w)aT  
    Edits JavaScript source live.

    In general, functions that are currently on the stack can not be edited with
    a single exception: If the edited function is the top-most stack frame and
    that is the only activation of that function on the stack. In this case
    the live edit will be successful and a ``Debugger.restartFrame`` for the
    top-most function is automatically triggered.

    :param script_id: Id of the script to edit.
    :param script_source: New content of the script.
    :param dry_run: *(Optional)* If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code.
    :param allow_top_frame_editing: **(EXPERIMENTAL)** *(Optional)* If true, then ```scriptSource```` is allowed to change the function on top of the stack as long as the top-most stack frame is the only activation of that function.
    :returns: A tuple with the following items:

        0. **callFrames** - *(Optional)* New stack trace in case editing has happened while VM was stopped.
        1. **stackChanged** - *(Optional)* Whether current call stack  was modified after applying the changes.
        2. **asyncStackTrace** - *(Optional)* Async stack trace, if any.
        3. **asyncStackTraceId** - *(Optional)* Async stack trace, if any.
        4. **status** - Whether the operation was successful or not. Only `` Ok`` denotes a successful live edit while the other enum variants denote why the live edit failed.
        5. **exceptionDetails** - *(Optional)* Exception details if any. Only present when `` status`` is `` CompileError`.
    r;   r   NdryRunallowTopFrameEditingzDebugger.setScriptSourcer   r   stackChangedr   r   statusr   )
r>   r   rO   r   rh   r   r   r   r#   r   )r5   script_sourcedry_runallow_top_frame_editingr   r   r   rd   s           r   set_script_sourcer(    s8    8 &F"**,F:*F>"x*)@%&,H >D@LPT@Tl);<A		Q	<Z^&4&<T.!"$ARVZAZ$$T*;%<=`dEX\`E`&&t,?'@AfjDNHZ^bHb  **40B+CD  im <s   ADC?#B!Dc              #  <   K   t               }| |d<   d|d}|}yw)z
    Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).

    :param skip: New value for skip pauses state.
    skipzDebugger.setSkipAllPausesr   Nr   )r*  r   r   r   s       r   set_skip_all_pausesr+    s.      &FF6N-H >Dr   c              #     K   t               }| |d<   ||d<   |j                         |d<   |j                         |d<   d|d}|}yw)a  
    Changes value of variable in a callframe. Object-based scopes are not supported and must be
    mutated manually.

    :param scope_number: 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually.
    :param variable_name: Variable name.
    :param new_value: New variable value.
    :param call_frame_id: Id of callframe that holds variable.
    scopeNumbervariableNamer  r]   zDebugger.setVariableValuer   Nr   )scope_numbervariable_namer  rP   r   r   r   s          r   set_variable_valuer1  #  s_      &F(F=*F>"**,F:)113F=-H >Ds   AAc              #     K   t               }| | |d<   |!|D cg c]  }|j                          c}|d<   d|d}|}yc c}w w)aN  
    Steps into the function call.

    :param break_on_async_call: **(EXPERIMENTAL)** *(Optional)* Debugger will pause on the execution of the first async task which was scheduled before next pause.
    :param skip_list: **(EXPERIMENTAL)** *(Optional)* The skipList specifies location ranges that should be skipped on step into.
    NbreakOnAsyncCallskipListzDebugger.stepIntor   r   )break_on_async_call	skip_listr   rd   r   r   s         r   	step_intor7  >  s\      &F&%8!"3<=aaiik=z%H >D >s   AAAc               #     K   ddi} | }yw)z)
    Steps out of the function call.
    r   zDebugger.stepOutNr   r   s     r   step_outr9  T  r   r   c              #     K   t               }| !| D cg c]  }|j                          c}|d<   d|d}|}yc c}w w)z
    Steps over the statement.

    :param skip_list: **(EXPERIMENTAL)** *(Optional)* The skipList specifies location ranges that should be skipped on step over.
    Nr4  zDebugger.stepOverr   r   )r6  r   rd   r   r   s        r   	step_overr;  ^  sK      &F3<=aaiik=z%H >D >s   ?:?zDebugger.breakpointResolvedc                  8    e Zd ZU dZded<   ded<   edd       Zy)	BreakpointResolvedzM
    Fired when breakpoint is resolved to an actual script and location.
    r
   r   r2   rR   c                n     | t         j                  |d         t        j                  |d               S )Nr   rR   )r   rR   )r
   r   r2   r   s     r   r   zBreakpointResolved.from_json{  s5    &00n1EF''Z(89
 	
r   N)r   r   r"   r=  r%   r&   r'   r(   rB   r)   r   r   r   r   r=  r=  p  s'      
 
r   r=  zDebugger.pausedc                  j    e Zd ZU dZded<   ded<   ded<   ded	<   d
ed<   ded<   ded<   edd       Zy)Pausedzg
    Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
    ztyping.List[CallFrame]call_framesr#   reasontyping.Optional[dict]dataz!typing.Optional[typing.List[str]]hit_breakpoints#typing.Optional[runtime.StackTrace]async_stack_tracez%typing.Optional[runtime.StackTraceId]async_stack_trace_idasync_call_stack_trace_idc                    | |d   D cg c]  }t         j                  |       c}t        |d         d|v rt        |d         nd d|v r|d   D cg c]  }t        |       c}nd d|v r"t        j
                  j                  |d         nd d|v r"t        j                  j                  |d         nd d|v r't        j                  j                  |d               S d       S c c}w c c}w )	Nr   rC  rE  hitBreakpointsr   r   asyncCallStackTraceId)rB  rC  rE  rF  rH  rI  rJ  )rO   r   r#   r>   r   r   r   ri   s      r   r   zPaused.from_json  s   9=l9KLA,,Q/LtH~&'-~d6l#4HX\`H`T2B-CDSVDfjWhlpWpg00::4@Q;RSvz^quy^y!5!5!?!?EX@Y!Z  @Dg~  CG  hGg&:&:&D&DTJaEb&c
 	
 MQ
 	
L Es   C)C.N)r   r   r"   rA  r?  r   r   r   rA  rA    sD     ('K
66::??DD	
 	
r   rA  zDebugger.resumedc                  "    e Zd ZdZedd       Zy)Resumedz;
    Fired when the virtual machine resumed execution.
    c                     |        S r   r   r   s     r   r   zResumed.from_json  s     
 	
r   N)r   r   r"   rO  )r%   r&   r'   r(   r)   r   r   r   r   rO  rO    s    
 
 
r   rO  zDebugger.scriptFailedToParsec                      e Zd ZU dZded<   ded<   ded<   ded<   ded	<   ded
<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   edd       Zy) ScriptFailedToParsez?
    Fired when virtual machine fails to parse the script.
    r4   r5   r#   rS   r6   
start_linestart_columnend_line
end_columnruntime.ExecutionContextIdexecution_context_idhash_rD  execution_context_aux_datarm   source_map_urlrZ   has_source_url	is_moduler8   lengthrG  stack_tracecode_offset(typing.Optional[debugger.ScriptLanguage]script_languageembedder_namec           	         | d!i dt         j                  j                  |d         dt        |d         dt	        |d         dt	        |d         dt	        |d	         d
t	        |d         dt         j
                  j                  |d         dt        |d         dd|v rt        |d         nd dd|v rt        |d         nd dd|v rt        |d         nd dd|v rt        |d         nd dd|v rt	        |d         nd dd|v r"t         j                  j                  |d         nd dd|v rt	        |d         nd dd|v r"t        j                  j                  |d         nd dd |v rt        |d          S d S )"Nr5   r;   rS   rS  	startLinerT  startColumnrU  endLinerV  	endColumnrX  executionContextIdrY  hashrZ  executionContextAuxDatar[  sourceMapURLr\  hasSourceURLr]  isModuler^  r_  r   r`  
codeOffsetrb  scriptLanguagerc  embedderNamer   )r   rA   r   r#   r6   ExecutionContextIdr>   rh   r   debuggerr   r   s     r   r   zScriptFailedToParse.from_json  s    
&&00j1AB
DK 
 4,-
 T-01	

 i)
 4,-
 ")!;!;!E!EdK_F`!a
 d6l#
 QjmqPqtD1J,K'Lw{
 9G$8N3tN34TX
 :H49O4^ 45UY
 1;d0Bd4
+,
 +3d*:3tH~&
 MY\`L`**44T,5GHfj
 4@43GD./T
  ZjmqYqH33==dCS>TUw{!
" 8F7M#d>23#
 	
" TX#
 	
r   N)r   r   r"   rR  r?  r   r   r   rR  rR    s|      	HOMO44J 55(())$$  44%%==''
 
r   rR  zDebugger.scriptParsedc                      e Zd ZU dZded<   ded<   ded<   ded<   ded	<   ded
<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ed"d        Zy!)#ScriptParsedz
    Fired when virtual machine parses script. This event is also fired for all known and uncollected
    scripts upon enabling debugger.
    r4   r5   r#   rS   r6   rS  rT  rU  rV  rW  rX  rY  rD  rZ  rZ   is_live_editrm   r[  r\  r]  r8   r^  rG  r_  r`  ra  rb  z&typing.Optional[debugger.DebugSymbols]debug_symbolsrc  c           	         | d%i dt         j                  j                  |d         dt        |d         dt	        |d         dt	        |d         dt	        |d	         d
t	        |d         dt         j
                  j                  |d         dt        |d         dd|v rt        |d         nd dd|v rt        |d         nd dd|v rt        |d         nd dd|v rt        |d         nd dd|v rt        |d         nd dd|v rt	        |d         nd dd|v r"t         j                  j                  |d         nd dd|v rt	        |d         nd dd |v r"t        j                  j                  |d          nd d!d"|v r"t        j                  j                  |d"         nd d#d$|v rt        |d$         S d S )&Nr5   r;   rS   rS  re  rT  rf  rU  rg  rV  rh  rX  ri  rY  rj  rZ  rk  rv  
isLiveEditr[  rl  r\  rm  r]  rn  r^  r_  r   r`  ro  rb  rp  rw  debugSymbolsrc  rq  r   )r   rA   r   r#   r6   rr  r>   rh   r   rs  r   r   r   s     r   r   zScriptParsed.from_json"  sU    
&&00j1AB
DK 
 4,-
 T-01	

 i)
 4,-
 ")!;!;!E!EdK_F`!a
 d6l#
 QjmqPqtD1J,K'Lw{
 6BT5Id<01t
 9G$8N3tN34TX
 :H49O4^ 45UY
 1;d0Bd4
+,
 +3d*:3tH~&
 MY\`L`**44T,5GHfj
  4@43GD./T!
" ZjmqYqH33==dCS>TUw{#
$ TbeiSi(//99$~:NOos%
& 8F7M#d>23'
 	
& TX'
 	
r   N)r   r   r"   ru  r?  r   r   r   ru  ru    s    
  	HOMO44J 55''(())$$  44%%==99''
 
r   ru  r   )rR   r2   r   rm   r"   0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])r"   r{  )r   ztyping.Optional[float]r"   zDtyping.Generator[T_JSON_DICT, T_JSON_DICT, runtime.UniqueDebuggerId])NNNNNNN)rP   r-   r   r#   r   rm   r   rZ   r   rZ   r   rZ   r   rZ   r   rZ   r   z"typing.Optional[runtime.TimeDelta]r"   zytyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[runtime.RemoteObject, typing.Optional[runtime.ExceptionDetails]]])NN)rJ   r2   rK   rW   r   rZ   r"   zFtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[BreakLocation]])r5   r4   r"   zStyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[str, typing.Optional[str]]])r5   r4   r"   z{typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[typing.Optional[str], int, typing.List[int], WasmDisassemblyChunk]])r   r#   r"   z@typing.Generator[T_JSON_DICT, T_JSON_DICT, WasmDisassemblyChunk])r5   r4   r"   z/typing.Generator[T_JSON_DICT, T_JSON_DICT, str])r   runtime.StackTraceIdr"   z>typing.Generator[T_JSON_DICT, T_JSON_DICT, runtime.StackTrace])r   r|  r"   r{  )r   r
   r"   r{  )rP   r-   r   rm   r"   ztyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[typing.List[CallFrame], typing.Optional[runtime.StackTrace], typing.Optional[runtime.StackTraceId]]])r   rZ   r"   r{  )
r5   r4   r   r#   r   rZ   r   rZ   r"   zDtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[SearchMatch]])r   r6   r"   r{  )r   r   r"   r{  )r5   r4   r  ztyping.List[ScriptPosition]r"   r{  )rR   r2   r  rm   r"   zPtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[BreakpointId, Location]])r
  r#   r"   8typing.Generator[T_JSON_DICT, T_JSON_DICT, BreakpointId])NNNNN)r7   r6   rS   rm   r  rm   r  rm   r9   r8   r  rm   r"   z]typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[BreakpointId, typing.List[Location]]])r  zruntime.RemoteObjectIdr  rm   r"   r}  )r  rh   r"   r{  )r  r#   r"   r{  )r  runtime.CallArgumentr"   r{  )
r5   r4   r%  r#   r&  rZ   r'  rZ   r"   ztyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[typing.Optional[typing.List[CallFrame]], typing.Optional[bool], typing.Optional[runtime.StackTrace], typing.Optional[runtime.StackTraceId], str, typing.Optional[runtime.ExceptionDetails]]])r*  rh   r"   r{  )
r/  r6   r0  r#   r  r~  rP   r-   r"   r{  )r5  rZ   r6  +typing.Optional[typing.List[LocationRange]]r"   r{  )r6  r  r"   r{  )>
__future__r   utilr   r   dataclassesr   enumtyping r   r#   r
   r-   r2   rD   rI   rO   rf   rx   r   r   Enumr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r  r  r(  r+  r1  r7  r9  r;  r=  rA  rO  rR  ru  r   r   r   <module>r     s   # * !   =3 =<# < 
 
 
< 
 
 
, 
 
 
4 @
 @
 @
F (
 (
 (
V 
 
 
0 
 
 
@ 
 
 
*TYY  
 
 
6 480 
8* :>B 6B	KB0 .2:>(,15266:6:5"55 +5 #8	5
 &5 /5 05 45 45 
A5t *.6:CC&C 4C 
N	C8#	Z2# 
C>99	G90!#!	6!&<,<	E<*3	7&#	7& &*("("( 
d(X 6:2	7* 15*.	>#>> .> (	>
 
L><	7""	7*#. 
86 +/' 
X:88	?8* %)*.,0.2*.--!- (- *	-
 ,- (- 
e-d +/8)8'8 
@86	7"	7$'	7, *.9=	/#// '/ "7	/
 
|/d	7" ( #	
 
88 6:AE2> 
8, BF>	7$ *+

 
  ,
" 

 
   
@  


 

  !

 +,
;
 ;
  -;
| $%
B
 B
  &B
r   