HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberPanel/lib64/python3.10/site-packages/starlette/__pycache__/routing.cpython-310.pyc
o

�h���@sddlmZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddlm
Z
ddlmZddl
mZddlmZmZddlmZddlmZmZdd	lmZmZmZdd
lmZddlmZddlm Z dd
l!m"Z"m#Z#m$Z$ddl%m&Z&m'Z'm(Z(m)Z)m*Z*ddl+m,Z,m-Z-Gdd�de.�Z/Gdd�de�Z0dIdd�Z1dJdd�Z2dKd d!�Z3dLd%d&�Z4dMd-d.�Z5e�6d/�Z7dNd1d2�Z8Gd3d4�d4�Z9Gd5d6�d6e9�Z:Gd7d8�d8e9�Z;Gd9d:�d:e9�Z<Gd;d<�d<e9�Z=e�>d=�Z?Gd>d?�d?ej@e?�ZAdOdCdD�ZBGdEdF�dF�ZCGdGdH�dH�ZDdS)P�)�annotationsN)�asynccontextmanager)�Enum)�wrap_app_handling_exceptions)�get_route_path�is_async_callable)�run_in_threadpool)�CONVERTOR_TYPES�	Convertor)�URL�Headers�URLPath)�
HTTPException)�
Middleware)�Request)�PlainTextResponse�RedirectResponse�Response)�ASGIApp�Lifespan�Receive�Scope�Send)�	WebSocket�WebSocketClosecs"eZdZdZd
�fdd	�Z�ZS)�NoMatchFoundz}
    Raised by `.url_for(name, **path_params)` and `.url_path_for(name, **path_params)`
    if no matching route exists.
    �name�str�path_params�dict[str, typing.Any]�return�Nonecs0d�t|����}t��d|�d|�d��dS)N�, zNo route exists for name "z" and params "z".)�join�list�keys�super�__init__)�selfrr�params��	__class__��G/usr/local/CyberPanel/lib/python3.10/site-packages/starlette/routing.pyr'!szNoMatchFound.__init__)rrrrr r!)�__name__�
__module__�__qualname__�__doc__r'�
__classcell__r,r,r*r-rsrc@seZdZdZdZdZdS)�Matchr��N)r.r/r0�NONE�PARTIAL�FULLr,r,r,r-r3&sr3�obj�
typing.Anyr �boolcCs4t�dt�t|tj�r|j}t|tj�st�|�S)z~
    Correctly determines if an object is a coroutine function,
    including those wrapped in functools.partial objects.
    zViscoroutinefunction_or_partial is deprecated, and will be removed in a future release.)	�warnings�warn�DeprecationWarning�
isinstance�	functools�partial�func�inspect�iscoroutinefunction)r9r,r,r-�iscoroutinefunction_or_partial,s��
rErB�Atyping.Callable[[Request], typing.Awaitable[Response] | Response]rcs*t|�r|nt�t|��d�fd	d
�}|S)
zi
    Takes a function or coroutine `func(request) -> response`,
    and returns an ASGI application.
    �scoper�receiver�sendrr r!c�s:�t|||��d��fd	d
�}t|��|||�IdHdS)NrGrrHrrIrr r!c�s&����IdH}||||�IdHdS�Nr,)rGrHrI�response)�f�requestr,r-�appHs�z*request_response.<locals>.app.<locals>.app�rGrrHrrIrr r!)rr�rGrHrIrN�rL)rMr-rNEs�zrequest_response.<locals>.appNrO)rr@rAr�rBrNr,rQr-�request_response:s�	rS�4typing.Callable[[WebSocket], typing.Awaitable[None]]csd�fd	d
�}|S)
zM
    Takes a coroutine `func(session)`, and returns an ASGI application.
    rGrrHrrIrr r!c�s<�t|||d��d��fd
d�}t|��|||�IdHdS)
N)rHrIrGrrHrrIrr r!c�s����IdHdSrJr,)rGrHrI)rB�sessionr,r-rN\s�z+websocket_session.<locals>.app.<locals>.apprO)rrrP�rB)rUr-rNYs�zwebsocket_session.<locals>.appNrOr,rRr,rVr-�websocket_sessionQsrW�endpoint� typing.Callable[..., typing.Any]rcCst|d|jj�S)Nr.)�getattrr+r.)rXr,r,r-�get_namedsr[�path�param_convertors� dict[str, Convertor[typing.Any]]r�dict[str, str]�tuple[str, dict[str, str]]cCs^t|���D]$\}}d|d|vr*||}|�|�}|�d|d|�}|�|�q||fS)N�{�})r$�items�	to_string�replace�pop)r\r]r�key�value�	convertorr,r,r-�replace_paramshs

�rjz4{([a-zA-Z_][a-zA-Z0-9_]*)(:[a-zA-Z_][a-zA-Z0-9_]*)?}�Atuple[typing.Pattern[str], str, dict[str, Convertor[typing.Any]]]cCs�|�d�}d}d}t�}d}i}t�|�D]X}|�d�\}}	|	�d�}	|	tvs0Jd|	�d���t|	}
|t�|||�	���7}|d	|�d
|
j
�d�7}||||�	��7}|d|7}||vrf|�|�|
||<|��}q|r�d
�
t|��}t|�dkr�dnd}td|�d|�d|����|r�||d��d�d}
|t�|
�d7}n
|t�||d��d7}|||d�7}t�|�||fS)a*
    Given a path string, like: "/{username:str}",
    or a host string, like: "{subdomain}.mydomain.org", return a three-tuple
    of (regex, format, {param_name:convertor}).

    regex:      "/(?P<username>[^/]+)"
    format:     "/{username}"
    convertors: {"username": StringConvertor()}
    �/�^�rr�:zUnknown path convertor '�'z(?P<�>�)z{%s}r"r4�szDuplicated param name� z	 at path N�$)�
startswith�set�PARAM_REGEX�finditer�groups�lstripr	�re�escape�start�regex�add�endr#�sorted�len�
ValueError�split�compile)r\�is_host�
path_regex�path_format�duplicated_params�idxr]�match�
param_name�convertor_typeri�names�ending�hostnamer,r,r-�compile_pathzs:


r�c@s4eZdZddd�Zddd
�Zddd�Zddd�ZdS)�	BaseRouterGrr �tuple[Match, Scope]cC�t��rJ��NotImplementedError)r(rGr,r,r-�matches��zBaseRoute.matchesrrrr:r
cKr�rJr�)r(rrr,r,r-�url_path_for�r�zBaseRoute.url_path_forrHrrIrr!c�s�t��rJr��r(rGrHrIr,r,r-�handle�s�zBaseRoute.handlec�s��|�|�\}}|tjkr8|ddkr$tddd�}||||�IdHdS|ddkr6t�}||||�IdHdS|�|�|�|||�IdHdS)z�
        A route may be used in isolation as a stand-alone ASGI app.
        This is a somewhat contrived case, as they'll almost always be used
        within a Router, but could be useful for some tooling and minimal apps.
        �type�http�	Not Found���status_codeN�	websocket)r�r3r6rr�updater�)r(rGrHrIr��child_scoperK�websocket_closer,r,r-�__call__�s�
�
zBaseRoute.__call__N�rGrr r��rrrr:r r
rO)r.r/r0r�r�r�r�r,r,r,r-r���



r�c@sTeZdZddddd�d)dd�Zd*dd�Zd+dd�Zd,d"d#�Zd-d%d&�Zd.d'd(�ZdS)/�RouteNT)�methodsr�include_in_schema�
middlewarer\rrXrYr��list[str] | Noner�
str | Noner�r;r��"typing.Sequence[Middleware] | Noner r!cCs|�d�s	Jd��||_||_|durt|�n||_||_|}t|tj�r.|j	}t|tj�s%t
�|�s8t
�|�rEt
|�|_|durDdg}n||_|durct|�D]\}}	}
||jg|	�Ri|
��|_qP|durkd|_ndd�|D�|_d|jvr~|j�d�t|�\|_|_|_dS)Nrl� Routed paths must start with '/'�GETcSsh|]}|���qSr,)�upper)�.0�methodr,r,r-�	<setcomp>�sz!Route.__init__.<locals>.<setcomp>�HEAD)rvr\rXr[rr�r?r@rArBrC�
isfunction�ismethodrSrN�reversedr�r�r�r�r�r])r(r\rXr�rr�r��endpoint_handler�cls�args�kwargsr,r,r-r'�s0
�
�
zRoute.__init__rGrr�c	Cs�|ddkrPt|�}|j�|�}|rP|��}|��D]\}}|j|�|�||<qt|�di��}|�	|�|j
|d�}|jrK|d|jvrKtj
|fStj|fStjifS)Nr�r�r�rXrr�)rr�r��	groupdictrcr]�convert�dict�getr�rXr�r3r7r8r6�	r(rG�
route_pathr��matched_paramsrgrhrr�r,r,r-r��s



z
Route.matchesrr:r
cK�^t|���}t|j���}||jks||krt||��t|j|j|�\}}|r)J�t|dd�S)Nr��r\�protocol�rwr%r]rrrjr�r
�r(rr�seen_params�expected_paramsr\�remaining_paramsr,r,r-r��
zRoute.url_path_forrHrrIrc�sv�|jr/|d|jvr/dd�|j�i}d|vrtd|d��tdd|d�}||||�IdHdS|�|||�IdHdS)Nr��Allowr"rNi�)r��headerszMethod Not Allowed)r�r#rrrN)r(rGrHrIr�rKr,r,r-r�s�zRoute.handle�othercCs.t|t�o|j|jko|j|jko|j|jkSrJ)r?r�r\rXr��r(r�r,r,r-�__eq__"s

�
�
�zRoute.__eq__cCs@|jj}t|jp	g�}|j|j}}|�d|�d|�d|�d�S)N�(path=�, name=z
, methods=rr)r+r.r�r�r\r)r(�
class_namer�r\rr,r,r-�__repr__*szRoute.__repr__)r\rrXrYr�r�rr�r�r;r�r�r r!r�r�rO�r�r:r r;�r r�	r.r/r0r'r�r�r�r�r�r,r,r,r-r��s�
)


r�c@sPeZdZddd�d%d
d�Zd&dd�Zd'dd�Zd(dd�Zd)d!d"�Zd*d#d$�ZdS)+�WebSocketRouteN)rr�r\rrXrYrr�r�r�r r!c	Cs�|�d�s	Jd��||_||_|durt|�n||_|}t|tj�r+|j}t|tj�s"t	�
|�s5t	�|�r;t|�|_
n||_
|durYt|�D]\}}}||j
g|�Ri|��|_
qFt|�\|_|_|_dS)Nrlr�)rvr\rXr[rr?r@rArBrCr�r�rWrNr�r�r�r�r])	r(r\rXrr�r�r�r�r�r,r,r-r'2s�zWebSocketRoute.__init__rGrr�c	Cs�|ddkrAt|�}|j�|�}|rA|��}|��D]\}}|j|�|�||<qt|�di��}|�	|�|j
|d�}tj|fStj
ifS)Nr�r�rr�)rr�r�r�rcr]r�r�r�r�rXr3r8r6r�r,r,r-r�Os


zWebSocketRoute.matchesrr:r
cKr�)Nr�r�r�r�r,r,r-r�^r�zWebSocketRoute.url_path_forrHrrIrc���|�|||�IdHdSrJ�rNr�r,r,r-r�i��zWebSocketRoute.handler�r;cC�"t|t�o|j|jko|j|jkSrJ)r?r�r\rXr�r,r,r-r�l�"zWebSocketRoute.__eq__cCs|jj�d|j�d|j�d�S)Nr�r�rr)r+r.r\r�r(r,r,r-r�oszWebSocketRoute.__repr__)
r\rrXrYrr�r�r�r r!r�r�rOr�r�r�r,r,r,r-r�1s�



r�c@sdeZdZ			d*dd�d+dd�Zed,dd��Zd-dd�Zd.dd�Zd/d"d#�Zd0d&d'�Z	d1d(d)�Z
dS)2�MountN�r�r\rrN�ASGIApp | None�routes�!typing.Sequence[BaseRoute] | Nonerr�r�r�r r!c	Cs�|dks
|�d�s
Jd��|dus|dusJd��|�d�|_|dur'||_nt|d�|_|j|_|durLt|�D]\}}}||jg|�Ri|��|_q9||_t|jd�\|_	|_
|_dS)Nrnrlr�z0Either 'app=...', or 'routes=' must be specified)r�z/{path:path})rv�rstripr\�	_base_app�RouterrNr�rr�r�r�r])	r(r\rNr�rr�r�r�r�r,r,r-r'ts	zMount.__init__�list[BaseRoute]cC�t|jdg�S�Nr�)rZr�r�r,r,r-r���zMount.routesrGrr�cCs�|ddvr_|�dd�}t|�}|j�|�}|r_|��}|��D]\}}|j|�|�||<q d|�d�}|dt	|��}	t
|�di��}
|
�|�|
|�d|�||	|jd	�}t
j|fSt
jifS)
Nr��r�r��	root_pathrnrlr\r�
app_root_path)rr�r�rX)r�rr�r�r�rcr]r�rfr�r�r�rNr3r8r6)r(rGr�r�r�r�rgrh�remaining_path�matched_pathrr�r,r,r-r��s&

�

z
Mount.matchesrr:r
c
	Ks(|jdur)||jkr)d|vr)|d�d�|d<t|j|j|�\}}|s(t|d�Snf|jdus6|�|jd�r�|jdur>|}n|t|j�dd�}|�d�}d|d<t|j|j|�\}}|durd||d<|j	phgD]%}z|j
|fi|��}	t|�d�t|	�|	j
d�WSty�Yqiwt||��)Nr\rl)r\ror4rnr�)rr{rjr�r]r
rvr�r�r�r�r�rr�r)
r(rrr\r��remaining_name�
path_kwarg�path_prefix�route�urlr,r,r-r��s.
�

"�
zMount.url_path_forrHrrIrc�r�rJr�r�r,r,r-r��r�zMount.handler�r;cCr�rJ)r?r�r\rNr�r,r,r-r��r�zMount.__eq__cC�2|jj}|jpd}|�d|j�d|�d|j�d�S)Nrnr�r��, app=rr)r+r.rr\rN�r(r�rr,r,r-r���
 zMount.__repr__)NNN)r\rrNr�r�r�rr�r�r�r r!�r r�r�r�rOr�r��r.r/r0r'�propertyr�r�r�r�r�r�r,r,r,r-r�ss��

!

r�c@sXeZdZd%d&d
d�Zed'd
d��Zd(dd�Zd)dd�Zd*dd�Zd+d!d"�Z	d,d#d$�Z
dS)-�HostN�hostrrNrrr�r r!cCs<|�d�r	Jd��||_||_||_t|�\|_|_|_dS)NrlzHost must not start with '/')rvrrNrr��
host_regex�host_formatr])r(rrNrr,r,r-r'�s
z
Host.__init__r�cCr�r�)rZrNr�r,r,r-r��r�zHost.routesrGrr�c
Cs�|ddvrMt|d�}|�dd��d�d}|j�|�}|rM|��}|��D]\}}|j|�|�||<q&t	|�di��}|�
|�||jd	�}	tj
|	fStjifS)
Nr�r��rGrrnrorr)rrX)rr�r�rr�r�rcr]r�r�r�rNr3r8r6)
r(rGr�rr�r�rgrhrr�r,r,r-r��s



zHost.matchesrr:r
c		Ks�|jdur&||jkr&d|vr&|�d�}t|j|j|�\}}|s%t||d�SnQ|jdus3|�|jd�rw|jdur;|}n|t|j�dd�}t|j|j|�\}}|jpTgD]!}z|j	|fi|��}tt
|�|j|d�WStyvYqUwt||��)Nr\)r\rror4)r\r�r)
rrfrjrr]r
rvr�r�r�rr�r)	r(rrr\rr�r�r�r�r,r,r-r��s&
�
�
zHost.url_path_forrHrrIrc�r�rJr�r�r,r,r-r�	r�zHost.handler�r;cCr�rJ)r?rrrNr�r,r,r-r�r�zHost.__eq__cCr�)Nrnz(host=r�r�rr)r+r.rrrNr�r,r,r-r�r�z
Host.__repr__rJ�rrrNrrr�r r!r�r�r�rOr�r�r�r,r,r,r-r�s



r�_Tc@s*eZdZddd�Zddd�Zddd�ZdS)�_AsyncLiftContextManager�cm�typing.ContextManager[_T]cC�
||_dSrJ)�_cm)r(r	r,r,r-r'�
z!_AsyncLiftContextManager.__init__r rc�s�|j��SrJ)r�	__enter__r�r,r,r-�
__aenter__s�
z#_AsyncLiftContextManager.__aenter__�exc_type�type[BaseException] | None�	exc_value�BaseException | None�	traceback�types.TracebackType | None�bool | Nonec�s�|j�|||�SrJ)r�__exit__)r(rrrr,r,r-�	__aexit__s�z"_AsyncLiftContextManager.__aexit__N)r	r
)r r)rrrrrrr r)r.r/r0r'rrr,r,r,r-rs

r�lifespan_context�Styping.Callable[[typing.Any], typing.Generator[typing.Any, typing.Any, typing.Any]]�Etyping.Callable[[typing.Any], typing.AsyncContextManager[typing.Any]]cs&t�|��t���d�fdd��}|S)NrNr:r �$_AsyncLiftContextManager[typing.Any]cst�|��SrJ)rr���cmgrr,r-�wrapper-sz+_wrap_gen_lifespan_context.<locals>.wrapper)rNr:r r)�
contextlib�contextmanagerr@�wraps)rrr,rr-�_wrap_gen_lifespan_context(s
r#c@s4eZdZddd�Zddd�Zddd�Zddd�ZdS)�_DefaultLifespan�routerr�cCrrJ)�_router)r(r%r,r,r-r'5r
z_DefaultLifespan.__init__r r!c���|j��IdHdSrJ)r&�startupr�r,r,r-r8��z_DefaultLifespan.__aenter__�exc_info�objectc�r'rJ)r&�shutdown)r(r*r,r,r-r;r)z_DefaultLifespan.__aexit__r(rrNcCs|SrJr,)r(rNr,r,r-r�>sz_DefaultLifespan.__call__N)r%r��r r!)r*r+r r!)r(rrNr+r r)r.r/r0r'rrr�r,r,r,r-r$4r�r$c@s�eZdZ						dPdd�dQdd�ZdRdd�ZdSd"d#�ZdTd$d%�ZdTd&d'�ZdRd(d)�ZdRd*d+�Z	dRd,d-�Z
dUd/d0�ZdVdWd5d6�ZdVdXd8d9�Z
			dYdZd?d@�Z	dVd[dBdC�Z			dYd\dEdF�ZdVd]dGdH�Zd^dLdM�Zd_dNdO�ZdS)`r�NTr�r�r��redirect_slashesr;�defaultr��
on_startup�7typing.Sequence[typing.Callable[[], typing.Any]] | None�on_shutdown�lifespan�Lifespan[typing.Any] | Noner�r�r r!cCs|durgnt|�|_||_|dur|jn||_|durgnt|�|_|dur)gnt|�|_|s2|r?t�dt	�|r?t�d�|durIt
|�|_n%t�
|�rZt�dt	�t|�|_nt�|�rkt�dt	�t|�|_n||_|j|_|r�t|�D]\}}	}
||jg|	�Ri|
��|_qxdSdS)Nz�The on_startup and on_shutdown parameters are deprecated, and they will be removed on version 1.0. Use the lifespan parameter instead. See more about it on https://www.starlette.io/lifespan/.z�The `lifespan` parameter cannot be used with `on_startup` or `on_shutdown`. Both `on_startup` and `on_shutdown` will be ignored.zjasync generator function lifespans are deprecated, use an @contextlib.asynccontextmanager function insteadzdgenerator function lifespans are deprecated, use an @contextlib.asynccontextmanager function instead)r$r�r.�	not_foundr/r0r2r<r=r>r$rrC�isasyncgenfunctionr�isgeneratorfunctionr#rN�middleware_stackr�)r(r�r.r/r0r2r3r�r�r�r�r,r,r-r'CsN
��
��
���zRouter.__init__rGrrHrrIrc�s^�|ddkrt�}||||�IdHdSd|vrtdd��tddd�}||||�IdHdS)Nr�r�rNr�r�r�)rrr)r(rGrHrIr�rKr,r,r-r5�s�
zRouter.not_foundrrrr:r
c	Ks@|jD]}z|j|fi|��WStyYqwt||��rJ)r�r�r)r(rrr�r,r,r-r��s
�
zRouter.url_path_forc��.�|jD]}t|�r|�IdHq|�qdS)z7
        Run any `.on_startup` event handlers.
        N)r0r�r(�handlerr,r,r-r(���
�zRouter.startupc�r9)z8
        Run any `.on_shutdown` event handlers.
        N)r2rr:r,r,r-r,�r<zRouter.shutdownc	�s�d}|�d�}|�IdHzE|�|�4IdH�/}|dur,d|vr%td��|d�|�|ddi�IdHd}|�IdHWd�IdHn1IdHsMwYWn#tyvt��}|rk|d	|d
��IdH�|d|d
��IdH�w|ddi�IdHdS)
z{
        Handle ASGI lifespan messages, which allows us to manage application
        startup and shutdown events.
        FrNN�statez:The server does not support "state" in the lifespan scope.r�zlifespan.startup.completeTzlifespan.shutdown.failed)r��messagezlifespan.startup.failedzlifespan.shutdown.complete)r�r�RuntimeErrorr��
BaseExceptionr�
format_exc)r(rGrHrI�startedrN�maybe_state�exc_textr,r,r-r3�s0�
(����zRouter.lifespanc�s�|�|||�IdHdS)z;
        The main entry point to the Router class.
        N)r8r�r,r,r-r��s�zRouter.__call__c
�s��|ddvs	J�d|vr||d<|ddkr#|�|||�IdHdSd}|jD]-}|�|�\}}|tjkrH|�|�|�|||�IdHdS|tjkrU|durU|}|}q(|durk|�|�|�|||�IdHdSt|�}	|ddkr�|j	r�|	dkr�t
|�}
|	�d�r�|
d�d�|
d<n|
dd|
d<|jD]&}|�|
�\}}|tj
kr�t|
d�}tt|�d	�}||||�IdHdSq�|�|||�IdHdS)
Nr�)r�r�r3r%r3r�rlr\r)r�)r3r�r�r3r8r�r�r7rr.r��endswithr�r6rrrr/)
r(rGrHrIrAr�r�r��
partial_scoper��redirect_scope�redirect_urlrKr,r,r-rN�sJ�


�




�z
Router.appr�cCst|t�o
|j|jkSrJ)r?r�r�r�r,r,r-r��sz
Router.__eq__r\rNrr�cC�t|||d�}|j�|�dS�N)rNr)r�r��append)r(r\rNrr�r,r,r-�mount�zRouter.mountrcCrIrJ)rr�rK)r(rrNrr�r,r,r-rrMzRouter.hostrXrFr�r�r�cCs"t|||||d�}|j�|�dS)N)rXr�rr�)r�r�rK)r(r\rXr�rr�r�r,r,r-�	add_route	s�zRouter.add_routerTcCrI)N)rXr)r�r�rK)r(r\rXrr�r,r,r-�add_websocket_routeszRouter.add_websocket_route�typing.Callablecs&t�dt�d�����fdd�}|S)	z�
        We no longer document this decorator style API, and its usage is discouraged.
        Instead you should use the following approach:

        >>> routes = [Route(path, endpoint=...), ...]
        >>> app = Starlette(routes=routes)
        z�The `route` decorator is deprecated, and will be removed in version 1.0.0.Refer to https://www.starlette.io/routing/#http-routing for the recommended approach.rBrPr cs�j�|���d�|S)N)r�rr�)rNrV�r�r�rr\r(r,r-�	decorator7s�zRouter.route.<locals>.decoratorN�rBrPr rP�r<r=r>)r(r\r�rr�rRr,rQr-r�#s�
zRouter.routecs"t�dt�d���fdd�}|S)	a
        We no longer document this decorator style API, and its usage is discouraged.
        Instead you should use the following approach:

        >>> routes = [WebSocketRoute(path, endpoint=...), ...]
        >>> app = Starlette(routes=routes)
        z�The `websocket_route` decorator is deprecated, and will be removed in version 1.0.0. Refer to https://www.starlette.io/routing/#websocket-routing for the recommended approach.rBrPr cs�j�|�d�|S)N)r)rOrV�rr\r(r,r-rRQsz)Router.websocket_route.<locals>.decoratorNrSrT)r(r\rrRr,rUr-�websocket_routeCs�zRouter.websocket_route�
event_typerB�typing.Callable[[], typing.Any]cCs4|dvsJ�|dkr|j�|�dS|j�|�dS)N)r(r,r()r0rKr2)r(rWrBr,r,r-�add_event_handlerWszRouter.add_event_handlercs t�dt�d��fdd�}|S)Nz�The `on_event` decorator is deprecated, and will be removed in version 1.0.0. Refer to https://www.starlette.io/lifespan/ for recommended approach.rBrPr cs���|�|SrJ)rYrV�rWr(r,r-rRfsz"Router.on_event.<locals>.decoratorrSrT)r(rWrRr,rZr-�on_event_s�zRouter.on_event)NTNNNN)r�r�r.r;r/r�r0r1r2r1r3r4r�r�r r!rOr�r-r�rJ)r\rrNrrr�r r!r)NNT)r\rrXrFr�r�rr�r�r;r r!)r\rrXrTrr�r r!)
r\rr�r�rr�r�r;r rP)r\rrr�r rP)rWrrBrXr r!)rWrr rP)r.r/r0r'r5r�r(r,r3r�rNr�rLrrNrOr�rVrYr[r,r,r,r-r�BsB��
=








2��� 
r�)r9r:r r;)rBrFr r)rBrTr r)rXrYr r)r\rr]r^rr_r r`)r\rr rk)rrr r)E�
__future__rr r@rCr|r�types�typingr<r�enumr�starlette._exception_handlerr�starlette._utilsrr�starlette.concurrencyr�starlette.convertorsr	r
�starlette.datastructuresrrr
�starlette.exceptionsr�starlette.middlewarer�starlette.requestsr�starlette.responsesrrr�starlette.typesrrrrr�starlette.websocketsrr�	Exceptionrr3rErSrWr[rjr�rxr�r�r�r�r�r�TypeVarr�AsyncContextManagerrr#r$r�r,r,r,r-�<module>sR






8aBd
>