+
    i#%                       ^ RI Ht ^ RIt^ RIt^ RIt^ RIHt ^ RIH	t	 ^ RI
Ht ^ RIHtHt ^RIHtHt ^RIHt ^R	IHt ^R
IHt ]P0                  '       d	   ^RIHtHt ]P8                  ! ]4      t]	 ! R R4      4       t ! R R]4      t R# )    )annotationsN)contextmanager)	dataclass)HTTPException)BytesIOIOBase)InvalidHeaderTimeoutError)BaseHTTPResponse)Retry)EmscriptenRequest)BaseHTTPConnectionBaseHTTPSConnectionc                  @    ] tR t^t$ R]R&   R]R&   R]R&   R]R&   R	tR
# )EmscriptenResponseintstatus_codezdict[str, str]headerszIOBase | bytesbodyr   request N)__name__
__module____qualname____firstlineno____annotations____static_attributes__r       i/Users/ahmad/.openclaw/workspace/venv/lib/python3.14/site-packages/urllib3/contrib/emscripten/response.pyr   r      s    
r   r   c                  `  a  ] tR t^tR"R V 3R lllt]R R l4       t]P                  R R l4       t]R R l4       t]R	 R
 l4       t	]	P                  R R l4       t	R#R R llt
R R ltR$R R lltR"R R lltR R ltR R lt]R R l4       tR R ltR R lt]R R  l4       tR!tV ;t# )%EmscriptenHttpResponseWrapperc               $    V ^8  d   QhRRRRRR/# )   internal_responser   url
str | None
connection/BaseHTTPConnection | BaseHTTPSConnection | Noner   )formats   "r   __annotate__*EmscriptenHttpResponseWrapper.__annotate__   s)     ' '-' ' D	'r   c           
     	   < R V n         R V n        Wn        W n        W0n        RV n        \        SV `  VP                  VP                  V^ RRRR7       V P                  V P                  P                  P                  4      V n        RV n        R # )NFzHTTP/? T)r   statusrequest_urlversionversion_stringreasondecode_content)_pool_body	_response_url_connection_closedsuper__init__r   r   _init_lengthr   methodlength_remaininglength_is_certain)selfr$   r%   r'   	__class__s   &&&&r   r;   &EmscriptenHttpResponseWrapper.__init__   s     

*	%%--$00# 	 	
 !% 1 1$..2H2H2O2O P!&r   c                   V ^8  d   QhRR/# )r#   returnr&   r   )r)   s   "r   r*   r+   8   s      Z r   c                	    V P                   # Nr7   r@   s   &r   r%   !EmscriptenHttpResponseWrapper.url7   s    yyr   c                    V ^8  d   QhRRRR/# )r#   r%   r&   rD   Noner   )r)   s   "r   r*   r+   <   s      z d r   c                	    Wn         R # rF   rG   )r@   r%   s   &&r   r%   rI   ;   s    	r   c                   V ^8  d   QhRR/# )r#   rD   r(   r   )r)   s   "r   r*   r+   @   s        K  r   c                	    V P                   # rF   )r8   rH   s   &r   r'   (EmscriptenHttpResponseWrapper.connection?   s    r   c                   V ^8  d   QhRR/# )r#   rD   Retry | Noner   )r)   s   "r   r*   r+   D   s       r   c                	    V P                   # rF   _retriesrH   s   &r   retries%EmscriptenHttpResponseWrapper.retriesC   s    }}r   c                    V ^8  d   QhRRRR/# )r#   rU   rQ   rD   rK   r   )r)   s   "r   r*   r+   H   s        |    r   c                	    Wn         R # rF   rS   )r@   rU   s   &&r   rU   rV   G   s	      r   c               $    V ^8  d   QhRRRRRR/# r#   amt
int | Noner3   bool | NonerD   ztyping.Generator[bytes]r   )r)   s   "r   r*   r+   L   s$      7B	 r   c              #  P   "    V P                  WR7      pV'       d   Vx  K!  R# 5i)a  
A generator wrapper for the read() method. A call will block until
``amt`` bytes have been read from the connection or until the
connection is closed.

:param amt:
    How much of the content to read. The generator will return up to
    much data per iteration, but may return less. This is particularly
    likely when using compressed data. However, the empty string will
    never be returned.

:param decode_content:
    If True, will attempt to decode the body based on the
    'content-encoding' header.
)r[   r3   Nread)r@   r[   r3   datas   &&& r   stream$EmscriptenHttpResponseWrapper.streamL   s%     $ 999DD
s   $&c                    V ^8  d   QhRRRR/# )r#   request_methodr&   rD   r\   r   )r)   s   "r   r*   r+   f   s     # #: #* #r   c                	   V P                   P                  R 4      pVeg    VP                  R4       Uu0 uF  p\        V4      kK  	  pp\	        V4      ^8  d   \        RV,          4      hVP                  4       pV^ 8  d   RpMRpV P                  R9   g#   ^dV P                  u;8:  d   ^8  g
   M VR8X  d   ^ pV# u upi   \         d    Rp LKi ; i)zcontent-lengthN,z8Content-Length contained multiple unmatching values (%s)HEAD)   i0  )	r   getsplitr   lenr	   pop
ValueErrorr.   )r@   re   content_lengthvallengthslengths   &&    r   r<   *EmscriptenHttpResponseWrapper._init_lengthf   s    %)\\%5%56F%G%" 0>/C/CC/HI/H3s8/HIw<!#'13AB  ! A:!F F KK:%dkk'C''F1 J  s"   C B?4C ?C CCc               (    V ^8  d   QhRRRRRRRR/# )	r#   r[   r\   r3   r]   cache_contentboolrD   bytesr   )r)   s   "r   r*   r+      s2     #, #,#, $#, 	#,
 
#,r   c                	z   V P                   '       g_   V P                  eQ   \        V P                  P                  \        4      '       d)   V P                  P                  P
                  '       d   R# V P                  4       ;_uu_ 4        \        V P                  P                  \        4      '       gZ   \        V P                  P                  4      V n        RV n	        \        V P                  P                  4      V P                  n        Ve0   V^ 8  d)   RpV P                  P                  P                  V4      pM2V P                  P                  P                  4       pV'       d   W@n        V P                  e,   \        V P                  \        V4      ,
          ^ 4      V n        \        V4      ^ 8X  g$   V P                  '       d6   V P                  ^ 8X  d%   V P                  P                  P                  4        \        P                   ! \"        V4      uuR R R 4       #   + '       g   i     R # ; i)Nr   TF)r9   r6   
isinstancer   r   closed_error_catcherrl   r>   r?   r   r`   r5   maxclosetypingcastrw   )r@   r[   r3   ru   ra   s   &&&& r   r`   "EmscriptenHttpResponseWrapper.read   ss    LLL~~%4>>..77DNN<O<O<V<V<V  ""dnn116::(+DNN,?,?(@%)-&&-dnn.A.A&B#3!8 %~~**//4~~**//1 !%J$$0(+D,A,ACI,Mq(Q%4yA~&&&4+@+@A+E ##))+;;ud+- #"""s   C"H).A H)AH))H:	c               $    V ^8  d   QhRRRRRR/# rZ   r   )r)   s   "r   r*   r+      s(     
 

 $
 
!	
r   c              #  	N   "    V P                  W4      pV'       g   R# Vx  K"  5i)TNr_   )r@   r[   r3   rw   s   &&& r   read_chunked*EmscriptenHttpResponseWrapper.read_chunked   s#      IIc2EKs   #%c                   V ^8  d   QhRR/# r#   rD   rK   r   )r)   s   "r   r*   r+      s        d  r   c                	    V P                   '       d   V P                  '       g   R # V P                   P                  V P                  4       R V n        R # rF   )r4   r8   	_put_connrH   s   &r   release_conn*EmscriptenHttpResponseWrapper.release_conn   s9    zzz!1!1!1

T--.r   c                   V ^8  d   QhRR/# r   r   )r)   s   "r   r*   r+      s      D r   c                	&    V P                  4        R # rF   )r}   rH   s   &r   
drain_conn(EmscriptenHttpResponseWrapper.drain_conn   s    

r   c                   V ^8  d   QhRR/# )r#   rD   rw   r   )r)   s   "r   r*   r+      s     1 1e 1r   c                	b    V P                   '       d   V P                   # V P                  R R7      # )T)ru   )r5   r`   rH   s   &r   ra   "EmscriptenHttpResponseWrapper.data   s&    :::::994900r   c                   V ^8  d   QhRR/# )r#   rD   z
typing.Anyr   )r)   s   "r   r*   r+      s     ! !j !r   c                d    V P                   P                  R4      p\        P                  ! V4      # )al  
Deserializes the body of the HTTP response as a Python object.

The body of the HTTP response must be encoded using UTF-8, as per
`RFC 8529 Section 8.1 <https://www.rfc-editor.org/rfc/rfc8259#section-8.1>`_.

To use a custom JSON decoder pass the result of :attr:`HTTPResponse.data` to
your custom decoder instead.

If the body of the HTTP response is not decodable to UTF-8, a
`UnicodeDecodeError` will be raised. If the body of the HTTP response is not a
valid JSON document, a `json.JSONDecodeError` will be raised.

Read more :ref:`here <json_content>`.

:returns: The body of the HTTP response as a Python object.
zutf-8)ra   decode_jsonloads)r@   ra   s   & r   json"EmscriptenHttpResponseWrapper.json   s'    $ yy({{4  r   c                   V ^8  d   QhRR/# r   r   )r)   s   "r   r*   r+      s        t  r   c                	>   V P                   '       g   \        V P                  P                  \        4      '       d%   V P                  P                  P                  4        V P                  '       d"   V P                  P                  4        R V n        RV n         R # R # )NT)r9   ry   r6   r   r   r}   r8   rH   s   &r   r}   #EmscriptenHttpResponseWrapper.close   sj    |||$..--v66##))+  &&(#' DL r   c                   V ^8  d   QhRR/# )r#   rD   ztyping.Generator[None]r   )r)   s   "r   r*   r+      s     )( )( 6 )(r   c              #    "   ^RI HpHp Rp Rx  Rp T'       g   \        T P                  P                  \        4      '       dK   T P                  P                  P                  '       g%   T P                  P                  P                  4        T P                  4        R# \        T P                  P                  \        4      '       d;   T P                  P                  P                  '       d   T P                  4        R# R# R#   T d   p\        \	        T4      4      hRp?iT d   p\        \	        T4      4      hRp?ii ; i  T'       g   \        T P                  P                  \        4      '       dK   T P                  P                  P                  '       g%   T P                  P                  P                  4        T P                  4        i \        T P                  P                  \        4      '       d9   T P                  P                  P                  '       d   T P                  4        i i i ; i5i)z
Catch Emscripten specific exceptions thrown by fetch.py,
instead re-raising urllib3 variants, so that low-level exceptions
are not leaked in the high-level api.

On exit, release the connection back to the pool.
)_RequestError_TimeoutErrorFNT)fetchr   r   r
   strr   ry   r6   r   r   rz   r}   r   )r@   r   r   
clean_exites   &    r   r{   ,EmscriptenHttpResponseWrapper._error_catcher   s     	8
	( J  t~~22F;; NN//666NN''--/!!#
 t~~22F;;++222%%' 3 <+  	's1v&& 	(A''	(
  t~~22F;; NN//666NN''--/!!#
 t~~22F;;++222%%' 3 <sf   H>D	 H>AH>-BH>3H>	ED$$E-E.EEE
 
AH;#BH;(H;;H>)	r5   r9   r8   r4   r6   rT   r7   r?   r>   )NN)i   N)NNF)r   r   r   r   r;   propertyr%   setterr'   rU   rb   r<   r`   r   r   r   ra   r   r}   r   r{   r   __classcell__)rA   s   @r   r!   r!      s    ' '0   	ZZ        ^^   4#J#,J
  1 1!*  )( )(r   r!   )!
__future__r   r   r   loggingr~   
contextlibr   dataclassesr   http.clientr   ior   r   
exceptionsr	   r
   responser   
util.retryr   r   r   TYPE_CHECKING_base_connectionr   r   	getLoggerr   logr   r!   r   r   r   <module>r      sp    "    % ! 6  5 (  &	K!   w($4 w(r   