Ë
    ,Œ:j]  ã                   ó8  — d dl Z d dlZddlmZmZ ddlmZ ddlmZ e j                  r-d dl
Z
d dlZe j                  e
j                  ej                  f   Ze j                  ee j                   f   Ze j$                  g e j&                  e   f   Ze j$                  e j                  ee j                   f   ge j*                  d   f   Ze j$                  e j                  ee j                   f   eege j*                  d   f   Zdd„Z G d	„ d
e«      Z G d„ de«      Zy)é    Né   )ÚRequestÚResponse)ÚAsyncByteStreamé   )ÚAsyncBaseTransport)NNNc                  ó„   — t        j                  «       dk(  rdd l}  | j                  «       S dd l} |j                  «       S )NÚtrior   )ÚsniffioÚcurrent_async_libraryr
   ÚEventÚasyncio)r
   r   s     úX/var/www/html/tokenscope/api/venv/lib/python3.12/site-packages/httpx/_transports/asgi.pyÚcreate_eventr      s5   € Ü×$Ñ$Ó&¨&Ò0Ûàˆt�z‰z‹|Ðãàˆw�}‰}‹Ðó    c                   ó\   — e Zd Zdej                  e   ddfd„Zdej                  e   fd„Zy)ÚASGIResponseStreamÚbodyÚreturnNc                 ó   — || _         y ©N)Ú_body)Úselfr   s     r   Ú__init__zASGIResponseStream.__init__'   s	   € Øˆ�
r   c                óH   K  — dj                  | j                  «      ­–— y ­w)Nr   )Újoinr   )r   s    r   Ú	__aiter__zASGIResponseStream.__aiter__*   s   è ø€ Ø�h‰h�t—z‘zÓ"Ô"ùs   ‚ ")	Ú__name__Ú
__module__Ú__qualname__ÚtypingÚListÚbytesr   ÚAsyncIteratorr   © r   r   r   r   &   s5   „ ð˜VŸ[™[¨Ñ/ð °Dó ð# ×!5Ñ!5°eÑ!<ô #r   r   c                   ób   — e Zd ZdZ	 	 	 ddedededej                  ee	f   ddf
d„Z
d	edefd
„Zy)ÚASGITransporta  
    A custom AsyncTransport that handles sending requests directly to an ASGI app.
    The simplest way to use this functionality is to use the `app` argument.

    ```
    client = httpx.AsyncClient(app=app)
    ```

    Alternatively, you can setup the transport instance explicitly.
    This allows you to include any additional configuration arguments specific
    to the ASGITransport class:

    ```
    transport = httpx.ASGITransport(
        app=app,
        root_path="/submount",
        client=("1.2.3.4", 123)
    )
    client = httpx.AsyncClient(transport=transport)
    ```

    Arguments:

    * `app` - The ASGI application.
    * `raise_app_exceptions` - Boolean indicating if exceptions in the application
       should be raised. Default to `True`. Can be set to `False` for use cases
       such as testing the content of a client 500 response.
    * `root_path` - The root path on which the ASGI application should be mounted.
    * `client` - A two-tuple indicating the client IP and port of incoming requests.
    ```
    ÚappÚraise_app_exceptionsÚ	root_pathÚclientr   Nc                 ó<   — || _         || _        || _        || _        y r   )r(   r)   r*   r+   )r   r(   r)   r*   r+   s        r   r   zASGITransport.__init__O   s!   € ð ˆŒØ$8ˆÔ!Ø"ˆŒØˆ�r   Úrequestc              ƒ   óJ  ‡‡‡	‡
‡‡‡‡K  — t        ‰j                  t        «      sJ ‚dddid‰j                  ‰j                  j
                  D ��cg c]  \  }}|j                  «       |f‘Œ c}}‰j                  j                  ‰j                  j                  ‰j                  j                  ‰j                  j                  ‰j                  j                  ‰j                  j                  f| j                  | j                  dœ}‰j                  j!                  «       Š	dŠ
d Šd Šg ŠdŠt#        «       Šdt$        j&                  t(        t$        j*                  f   fˆ	ˆ
ˆfd„}d	t$        j&                  t(        t$        j*                  f   dd fˆˆˆˆˆˆfd
„}	 | j-                  |||«      ƒ d {  –—†  ‰j5                  «       sJ ‚‰€J ‚‰€J ‚t7        ‰«      }t9        ‰‰|¬«      S c c}}w 7 Œ=# t.        $ r( | j0                  r‚ ‰j3                  «        ‰€dŠ‰€i ŠY Œkw xY w­w)NÚhttpÚversionz3.0z1.1)ÚtypeÚasgiÚhttp_versionÚmethodÚheadersÚschemeÚpathÚraw_pathÚquery_stringÚserverr+   r*   Fr   c               “   ó¼   •K  — ‰r‰j                  «       ƒ d {  –—†  ddiS 	 ‰j                  «       ƒ d {  –—† } d| ddœS 7 Œ'7 Œ# t        $ r dŠddddœcY S w xY w­w)Nr1   zhttp.disconnectTzhttp.requestr   F)r1   r   Ú	more_body)ÚwaitÚ	__anext__ÚStopAsyncIteration)r   Úrequest_body_chunksÚrequest_completeÚresponse_completes    €€€r   Úreceivez3ASGITransport.handle_async_request.<locals>.receive~   s~   øè ø€ ñ  Ø'×,Ñ,Ó.×.Ð.ØÐ 1Ð2Ð2ðQØ0×:Ñ:Ó<×<�ð +°DÀtÑLÐLð /øð =ùÜ%ò QØ#'Ð Ø .¸È%ÑPÒPðQüsA   ƒA™AšA£A ¶A·A »AÁA ÁAÁAÁAÁAÚmessagec              “   óB  •K  — | d   dk(  r‰rJ ‚| d   Š| j                  dg «      ŠdŠy | d   dk(  rl‰j                  «       rJ ‚| j                  dd«      }| j                  d	d
«      }|r ‰j                  dk7  r‰j                  |«       |s‰j	                  «        y y y ­w)Nr1   zhttp.response.startÚstatusr5   Tzhttp.response.bodyr   r   r<   FÚHEAD)ÚgetÚis_setr4   ÚappendÚset)	rD   r   r<   Ú
body_partsr-   rB   Úresponse_headersÚresponse_startedÚstatus_codes	      €€€€€€r   Úsendz0ASGITransport.handle_async_request.<locals>.sendŒ   s´   øè ø€ ð �v‰Ð"7Ò7Ù+Ð+Ð+à% hÑ/�Ø#*§;¡;¨y¸"Ó#=Ð Ø#'Ñ à˜‘Ð$8Ò8Ø,×3Ñ3Ô5Ð5Ð5Ø—{‘{ 6¨3Ó/�Ø#ŸK™K¨°UÓ;�	á˜GŸN™N¨fÒ4Ø×%Ñ% dÔ+á Ø%×)Ñ)Õ+ð !ð 9ùs   ƒBBiô  )r5   Ústream)Ú
isinstancerQ   r   r4   r5   ÚrawÚlowerÚurlr6   r7   r8   ÚqueryÚhostÚportr+   r*   r   r   r!   ÚDictÚstrÚAnyr(   Ú	Exceptionr)   rK   rI   r   r   )r   r-   ÚkÚvÚscoperC   rP   rQ   rL   r@   rA   rB   rM   rN   rO   s    `      @@@@@@@r   Úhandle_async_requestz"ASGITransport.handle_async_request[   sî  ÿè ø€ ô ˜'Ÿ.™.¬/Ô:Ð:Ð:ð Ø Ð&Ø!Ø—n‘nØ5<·_±_×5HÑ5H×I©6¨A¨q˜Ÿ™› AšÓIØ—k‘k×(Ñ(Ø—K‘K×$Ñ$ØŸ™×,Ñ,Ø#ŸK™K×-Ñ-Ø—{‘{×'Ñ'¨¯©×)9Ñ)9Ð:Ø—k‘kØŸ™ñ
ˆð  &Ÿn™n×6Ñ6Ó8ÐØ Ðð ˆØÐØˆ
Ø ÐÜ(›NÐð	MœvŸ{™{¬3´·
±
¨?Ñ;÷ 	Mð	,¤§¡¬C´·±¨OÑ <ð 	,À÷ 	,ò 	,ð*
	&Ø—(‘(˜5 '¨4Ó0×0Ð0ð !×'Ñ'Ô)Ð)Ð)ØÐ&Ð&Ð&ØÐ+Ð+Ð+ä# JÓ/ˆä˜Ð-=ÀfÔMÐMùóY Jðv 1ùÜò 	&Ø×(Ò(Øà×!Ñ!Ô#ØÐ"Ø!�ØÐ'Ø#%Ð ùð	&üsI   ŠAH#ÁG'Á,D,H#ÆG/ Æ/G-Æ0G/ Æ49H#Ç-G/ Ç/.H ÈH#ÈH È H#)TÚ )z	127.0.0.1é{   )r   r   r    Ú__doc__Ú_ASGIAppÚboolrZ   r!   ÚTupleÚintr   r   r   r`   r%   r   r   r'   r'   .   sr   „ ñðF &*ØØ);ñ
àð
ð #ð
ð ð	
ð
 —‘˜S #˜XÑ&ð
ð 
ó
ðXNàðXNð 
ôXNr   r'   )r   r   )r!   r   Ú_modelsr   r   Ú_typesr   Úbaser   ÚTYPE_CHECKINGr   r
   ÚUnionr   rY   rZ   r[   Ú_MessageÚCallableÚ	AwaitableÚ_ReceiveÚ	CoroutineÚ_Sendrd   r   r   r'   r%   r   r   ú<module>rs      s  ðÛ ã ç 'Ý $Ý $à	×ÒÛãà�L‰L˜Ÿ™¨¯
©
Ð2Ñ3€Eð �;‰;�s˜FŸJ™J�Ñ'€Ø�?‰?˜2˜v×/Ñ/°Ñ9Ð9Ñ:€Ø�‰Ø‡[�[��f—j‘j�Ñ!Ð" F×$4Ñ$4Ð5EÑ$FÐFñ	€ð �?‰?Ø‡[�[��f—j‘j�Ñ! 8¨UÐ3°V×5EÑ5EÐFVÑ5WÐWñ€ó
ô#˜ô #ôENÐ&õ ENr   