
    @OOf                     8   U d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dlm
Z
 d dlmZ d dlZerd dlZd dlZ G d	 d
      Zi Zeeee   f   ed<   e G d de             Ze G d de             Ze G d de             Ze G d de             Zy)    N)Sequence)	dataclass)fields)is_dataclass)Any)ClassVar)TYPE_CHECKINGc                   H     e Zd ZU ee   ed<   dee   fdZ fdZ	d Z
 xZS )Hooknamereturnc                 t    g }t        |       D ]'  }|j                  t        | |j                               ) |S )N)r   appendgetattrr   )selfargsfields      P/var/www/premiumrankchecker/venv/lib/python3.12/site-packages/mitmproxy/hooks.pyr   z	Hook.args   s6    D\ 	3EKKejj12	3    c                 t    | t         u rt        d      t        |       st        d      t        |   |       S )Nz&Hook may not be instantiated directly.zSubclass is not a dataclass.)r   	TypeErrorr   super__new__)clsr   kwargs	__class__s      r   r   zHook.__new__   s9    $;DEEC :;;ws##r   c                    | j                   j                  dd       F| j                  j                  dd      }t	        j
                  dd|      j                         | _        | j                  t        v r@t        | j                     }t        j                  d| j                   d|  d| t               | j                  dk(  ry | t        | j                  <   t        j                  | _        t        j                  | _        y )	Nr   r    z(?!^)([A-Z]+)z_\1z"Two conflicting event classes for z: z and )__dict__get__name__replaceresublowerr   	all_hookswarningswarnRuntimeWarningobject__hash____eq__)r   r   r   others       r   __init_subclass__zHook.__init_subclass__"   s    <<FD)1<<''3Dvvovt<BBDCH88y chh'EMM4SXXJbU5'R 88r>!	#(( ]]
r   )r!   
__module____qualname__r   str__annotations__listr   r   r   r.   __classcell__)r   s   @r   r   r      s'    
3-d3i $#r   r   r&   c                   "    e Zd ZU dZee   ed<   y)ConfigureHookz
    Called when configuration changes. The updated argument is a
    set-like object containing the keys of all changed options. This
    event is called during startup with all options in the updated set.
    updatedN)r!   r/   r0   __doc__setr1   r2    r   r   r6   r6   9   s     Xr   r6   c                       e Zd ZdZy)DoneHooka  
    Called when the addon shuts down, either by being removed from
    the mitmproxy instance, or when mitmproxy itself shuts down. On
    shutdown, this event is called after the event loop is
    terminated, guaranteeing that it will be the final event an addon
    sees. Note that log handlers are shut down at this point, so
    calls to log functions will produce no output.
    Nr!   r/   r0   r8   r:   r   r   r<   r<   D   s    r   r<   c                       e Zd ZdZy)RunningHookz
    Called when the proxy is completely up and running. At this point,
    you can expect all addons to be loaded and all options to be set.
    Nr=   r:   r   r   r?   r?   P   s    r   r?   c                   J    e Zd ZU dZeej                  j                     ed<   y)
UpdateHookzp
    Update is called when one or more flow objects have been modified,
    usually from a different addon.
    flowsN)	r!   r/   r0   r8   r   	mitmproxyflowFlowr2   r:   r   r   rA   rA   X   s    
 INN''((r   rA   )r#   r'   collections.abcr   dataclassesr   r   r   typingr   r   r	   mitmproxy.flowrC   mitmproxy.addonmanagermitmproxy.logr   r&   dictr1   typer2   r6   r<   r?   rA   r:   r   r   <module>rN      s    	  $ !  $     !!# !#H $&	4T$Z  % D   t   $   ) ) )r   