
    `Kh                     ^   d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	m
Z
 d dlmZmZmZ d dlmZmZ d dlmZmZ d dlmZmZmZmZmZmZmZmZmZmZm Z m!Z! d dl"Z"d dl#m$Z$m%Z%m&Z&m'Z' d dl(m)Z) d	d
l*m+Z+m,Z,m-Z-m.Z.m/Z/ d	dl0m1Z1m2Z2m3Z3 d	dl4m5Z5 d	dl6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z< d	dl=m>Z> d	dl?m@Z@ d	dl,mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZK d	dl-mLZLmMZMmNZNmOZOmPZP d	dlQmRZR d	dlSmTZTmUZUmVZVmWZWmXZXmYZY erd dlZZZd dlZm[Z[ n	 d dlZZZd dlZm[Z[ dZ^erd	dl_m`Z` d	dlambZb d	dlcmdZd  e7d      Ze ej                  d      Zg ej                  d      ZhdeifdZj e"j                  ddd       G d  d!             Zl G d" d#e      Zm G d$ d%em      Zn G d& d'      ZoeZeZj                  epeo eqd      fZrn
ep eqd      fZrd(e!d)epeof   d*eep   d+ed)   d,ees   de!d)epeof   f
d-Zt eud.      Zv G d/ d0e      Zwd1eid2eidepfd3Zxd;d4e/j                  d5ezddfd6Z{ G d7 d8eD      Z| G d9 d:      Z}y# e\$ r dZZe]Z[Y $w xY w)<    N)Mapping)md5sha1sha256)MorselSimpleCookie)MappingProxyTypeTracebackType)TYPE_CHECKINGAnyCallableDictIterableListLiteral
NamedTupleOptionalTupleTypeUnion)CIMultiDictCIMultiDictProxy	MultiDictMultiDictProxy)URL   )hdrshelpershttp	multipartpayload)parse_cookie_headerparse_set_cookie_headers preserve_morsel_with_coded_value)AbstractStreamWriter)ClientConnectionErrorClientOSErrorClientResponseErrorContentTypeError
InvalidURLServerFingerprintMismatch
HAS_BROTLI)FormData)	_SENTINELBaseTimerContext	BasicAuthHeadersMixin	TimerNoopbasicauth_from_netrcnetrc_from_envnoopreifyset_exception
set_result)SERVER_SOFTWAREHttpVersionHttpVersion10HttpVersion11StreamWriter)StreamReader)DEFAULT_JSON_DECODERJSONDecoderLooseCookiesLooseHeadersQuery
RawHeaders)
SSLContext)ClientRequestClientResponseRequestInfoFingerprint)ClientSession)
Connection)TraceConnection closedz[^-!#$%&'*+.^_`|~0-9a-zA-Z]z!^application/(?:[\w.+-]+?\+)?jsonreturnc                      t         rdS dS )Nzgzip, deflate, brzgzip, deflater,        s/var/www/CtrlAgent-Voice-Telephony-Channel/python-server/venv/lib/python3.12/site-packages/aiohttp/client_reqrep.py_gen_default_accept_encodingrT   j   s    ",A/ArR   T)auto_attribsfrozenslotsc                   8    e Zd ZU ee   ed<   ded<   ee   ed<   y)ContentDispositiontypezMappingProxyType[str, str]
parametersfilenameN)__name__
__module____qualname__r   str__annotations__rQ   rR   rS   rY   rY   n   s    
3-,,smrR   rY   c                   6    e Zd ZU eed<   eed<   ded<   eed<   y)_RequestInfourlmethodCIMultiDictProxy[str]headersreal_urlN)r]   r^   r_   r   ra   r`   rQ   rR   rS   rc   rc   u   s    	HK$$MrR   rc   c                   ,    e Zd Zefdededddedd f
dZy)	rI   rd   re   rg   rf   rh   rO   c                 T    t         j                  | ||||t        u r|f      S |f      S )zuCreate a new RequestInfo instance.

        For backwards compatibility, the real_url parameter is optional.
        )tuple__new__r/   )clsrd   re   rg   rh   s        rS   rl   zRequestInfo.__new__~   s:     }}#vwx9/DS
 	
JRS
 	
rR   N)r]   r^   r_   r/   r   r`   rl   rQ   rR   rS   rI   rI   |   s<     "

 
 )	

 
 

rR   rI   c                   b    e Zd ZeeedZdeddfdZe	defd       Z
dej                  ddfdZy)	rJ   )          fingerprintrO   Nc                     t        |      }| j                  j                  |      }|st        d      |t        u s|t
        u rt        d      || _        || _        y )Nzfingerprint has invalid lengthz8md5 and sha1 are insecure and not supported. Use sha256.)lenHASHFUNC_BY_DIGESTLENget
ValueErrorr   r   	_hashfunc_fingerprint)selfrr   	digestlenhashfuncs       rS   __init__zFingerprint.__init__   sZ    $	--11)<=>>_D 0WXX!'rR   c                     | j                   S N)ry   rz   s    rS   rr   zFingerprint.fingerprint          rR   	transportc                 "   |j                  d      sy |j                  d      }|j                  d      }| j                  |      j                         }|| j                  k7  r,|j                  d      ^}}}t        | j                  |||      y )N
sslcontext
ssl_objectT)binary_formpeername)get_extra_infogetpeercertrx   digestry   r+   )rz   r   sslobjcertgothostport_s           rS   checkzFingerprint.check   s    ''5)),7!!d!3nnT"))+$###&55jAND$+D,=,=sD$OO $rR   )r]   r^   r_   r   r   r   ru   bytesr}   propertyrr   asyncio	Transportr   rQ   rR   rS   rJ   rJ      s]    (E (d ( !U ! !Pw00 PT PrR   rJ   sslrF   
verify_sslssl_contextrr   c                    | d} |/|s-t        j                  dt        d       | durt        d      d} |-t        j                  dt        d       | durt        d      |} |6t        j                  dt        d       | durt        d      t	        |      } t        | t              st        d	j                  |             | S )
NTz/verify_ssl is deprecated, use ssl=False instead   
stacklevelzNverify_ssl, ssl_context, fingerprint and ssl parameters are mutually exclusiveFz2ssl_context is deprecated, use ssl=context insteadzCfingerprint is deprecated, use ssl=Fingerprint(fingerprint) insteadzFssl should be SSLContext, bool, Fingerprint or None, got {!r} instead.)	warningswarnDeprecationWarningrw   rJ   
isinstanceSSL_ALLOWED_TYPES	TypeErrorformat)r   r   r   rr   s       rS   _merge_ssl_paramsr      s     {j=	

 d?4 
 C@	

 d?4 
 CQ	

 d?4 
 k*Cc,-  &s
 	
 JrR   )httpswssc                   x    e Zd ZU eed<   ee   ed<   eed<   ee	ee
f   ed<   ee   ed<   ee   ed<   ee   ed<   y)	ConnectionKeyr   r   is_sslr   proxy
proxy_authproxy_headers_hashN)r]   r^   r_   r`   ra   r   intboolr   rF   rJ   r   r1   rQ   rR   rS   r   r      sI     I
3-L	z4,	--C=## %rR   r   response_content_typeexpected_content_typec                 B    |dk(  rt         j                  |       d uS || v S )Napplication/json)json_rematch)r   r   s     rS   _is_expected_content_typer      s.      22}}234?? $999rR   r!   r   c                 p    | j                   s*| j                  st        j                  dt        |       yyy)zWarn if the payload is not closed.

    Callers must check that the body is a Payload before calling this method.

    Args:
        payload: The payload to check
        stacklevel: Stack level for the warning (default 2 for direct callers)
    zThe previous request body contains unclosed resources. Use await request.update_body() instead of setting request.body directly to properly close resources and avoid leaks.r   N)	autocloseconsumedr   r   ResourceWarning)r!   r   s     rS   _warn_if_unclosed_payloadr     s7     W%5%5D !	
 &6rR   c                      e Zd ZU dZee   ed<   dZeed<   dZ	ee
   ed<   dZeed<   dZee   ed<   dZee
   ed<   dZed	   ed
<   dZeed<   dZed   ed<   dZee   ed<   dZeee
df      ed<   dZed   ed<   dZeej8                     ed<   dZed   ed<   dZdZdZ d Z!e"d ege
f   ed<   dZ#ed   ed<   de
de$ddd ed   d!e%d"e&d#e'd$   d%e(jR                  d&dd'dfd(Z*dYd)e+d'dfd*Z,e-d'ed   fd+       Z.e.j^                  ded   d'dfd,       Z.e-d'efd-       Z0e0j^                  d.ed'dfd/       Z0e1d'e$fd0       Z2e1d'e$fd1       Z3e1d'e$fd2       Z4e1d'e
fd3       Z5e1dZd4       Z6e1d'efd5       Z7e1d'e&fd6       Z8e1d'ee9   fd7       Z:e;fd8e<d'dfd9Z=d'e
fd:Z>e-d'ed   fd;       Z?e1d'ed	   fd<       Z@e1d[d=       ZAd\d>ZBd]d?ZCe-d'eDfd@       ZEd]dAZFd'e<fdBZGe-d'eDfdC       ZHd]dDZId]dEZJd]dFZKd]dGZLd]dHZMd]dIZNd'efdJZOd'e
fdKZPd^dLee
   dMe
d'e
fdNZQdeRdOdPdLee
   dQeSdRee
   d'e<fdSZTd_dTZUdUeeVeW      dVeeW   dWeeX   d'dfdXZYy)`rH   Nversionstatusreasoncontent_body_headersrQ   )rH   ._history_raw_headersrL   _connection_cookies._raw_cookie_headerszasyncio.Future[bool]	_continue_source_tracebackrK   _sessionTFc                       y)Nutf-8rQ   )r   s    rS   <lambda>zClientResponse.<lambda>4  s    rR   _resolve_charsetasyncio.Task[None]_ClientResponse__writerre   rd   writerzOptional[asyncio.Task[None]]continue100timerrequest_infotracesrM   loopsessionrO   c                   t        |      t        u sJ || _        || _        |j                  r|j                  d       n|| _        ||| _        ||| _        || _	        ||n	t               | _        i | _        || _        || _        |	|	| _        |	j                   | _        |j#                         r.t%        j&                  t)        j*                  d            | _        y y )Nr   )rZ   r   re   	_real_urlraw_fragmentwith_fragment_url_writerr   _request_infor3   _timer_cache_traces_loopr   r   	get_debug	tracebackextract_stacksys	_getframer   )
rz   re   rd   r   r   r   r   r   r   r   s
             rS   r}   zClientResponse.__init__8  s     CyC/2/?/?C%%d+S	!DL"(DN)$0eik&(
 #DM$+$<$<D!>>%.%<%<S]]1=M%ND" rR   r   c                     d | _         y r   r   rz   r   s     rS   __reset_writerzClientResponse.__reset_writer_  	    rR   c                     | j                   S )zThe writer task for streaming data.

        _writer is only provided for backwards compatibility
        for subclasses that may need to access it.
        r   r   s    rS   r   zClientResponse._writerb  s     }}rR   c                     | j                   %| j                   j                  | j                         || _         |y|j                         rd| _         y|j	                  | j                         y)z'Set the writer task for streaming data.N)r   remove_done_callback_ClientResponse__reset_writerdoneadd_done_callbackrz   r   s     rS   r   zClientResponse._writerk  sY     ==$MM..t/B/BC>;;= DM$$T%8%89rR   c                     | j                   \| j                  At               }|j                  t	        | j                               || _         | j                   S t               | _         | j                   S r   )r   r   r   updater#   rz   cookiess     rS   r   zClientResponse.cookiesy  sa    == ''3&. 78P8PQR ' }} !-}}rR   r   c                 p    || _         |r&t        d |j                         D              | _        y d | _        y )Nc              3   <   K   | ]  }|j                           y wr   )OutputString).0morsels     rS   	<genexpr>z)ClientResponse.cookies.<locals>.<genexpr>  s      -*0##%-s   )r   rk   valuesr   r   s     rS   r   zClientResponse.cookies  s7    ', -4;NN4D- (D$ (,D$rR   c                     | j                   S r   )r   r   s    rS   rd   zClientResponse.url      yyrR   c                 R    t        j                  dt        d       | j                  S )NzDeprecated, use .url #1654   r   )r   r   r   r   r   s    rS   url_objzClientResponse.url_obj  s    24FSTUyyrR   c                     | j                   S r   )r   r   s    rS   rh   zClientResponse.real_url  s    ~~rR   c                 ^    | j                   j                  J | j                   j                  S r   )r   r   r   s    rS   r   zClientResponse.host  s$    yy~~)))yy~~rR   c                     | j                   S r   )r   r   s    rS   rg   zClientResponse.headers      }}rR   c                     | j                   S r   )r   r   s    rS   raw_headerszClientResponse.raw_headers  r   rR   c                     | j                   S r   )r   r   s    rS   r   zClientResponse.request_info  s    !!!rR   c                     | j                   j                  t        j                        }|y t	        j
                  |      \  }}t        |      }t	        j                  |      }t        |||      S r   )	r   rv   r   CONTENT_DISPOSITIONr    parse_content_dispositionr	   content_disposition_filenamerY   )rz   rawdisposition_type
params_dctparamsr\   s         rS   content_dispositionz"ClientResponse.content_disposition  sd    mm 8 89;'0'J'J3'O$*!*-99&A!"2FHEErR   	_warningsc                 v   | j                   ry | j                  | j                  j                          | j                          | j                  j                         r[d| i} |j                  d| t        fi | | dd}| j                  r| j                  |d<   | j                  j                  |       y y y )NsourcezUnclosed response zUnclosed response)client_responsemessagesource_traceback)
_closedr   release_cleanup_writerr   r   r   r   r   call_exception_handler)rz   r  kwargscontexts       rS   __del__zClientResponse.__del__  s    <<'$$&  "zz##%"D)	!3D8<oXQWX.2?RS))262H2HG./

11': &	 (rR   c                 f   t        j                         }t        | j                        }| j                  r,| j                  j                  dd      j                  d      }nd}t        dj                  || j                  |      |       t        | j                  |       |j                         S )NasciibackslashreplaceNonez<ClientResponse({}) [{} {}]>)file)ioStringIOr`   rd   r   encodedecodeprintr   r   rg   getvalue)rz   outascii_encodable_urlascii_encodable_reasons       rS   __repr__zClientResponse.__repr__  s    kkm!$((m;;%)[[%7%7+&fWo # &,"*11#T[[2H 		
 	dll%||~rR   c                     | j                   S r   )r   r   s    rS   
connectionzClientResponse.connection  s    rR   c                     | j                   S )z2A sequence of of responses, if redirects occurred.)r   r   s    rS   historyzClientResponse.history  s     }}rR   c           	         dj                  | j                  j                  dg             }|st        t	                     S t	               }t        j                  d|      D ]  }t        j                  d|      }||j                         \  }}|j                  d      dd  }t	               }|D ]Q  }	t        j                  d|	t
        j                        }|+|j                         \  }
}}}|j                  |
|       S |j                  d|      }
|j                  d	| j                  j                  t        |                   |j                  t        |
      t        |              t        |      S )
Nz, linkz	,(?=\s*<)z\s*<(.*)>(.*);r   z%^\s*(\S*)\s*=\s*(['\"]?)(.*?)(\2)\s*$relrd   )joinrg   getallr   r   resplitr   groupsMaddrv   rd   r   r`   )rz   	links_strlinksvalr   rd   
params_strr  r4  paramkeyr   values                rS   r?  zClientResponse.links  s@   IIdll11&"=>	!)+..<EK88L)4 	6CHH-s3E}#llnOC%%c*12.F/8{D %!I5RTRVRVW=#(<<> Qqe$% ((5#&CHHUDHHMM#c(34IIc#ht 45/	62 e$$rR   c           	        K   d| _         |j                  | _        || _        | j                  5  	 	 | j                  }|j                          d{   \  }}|j                  dk  s|j                  dkD  s|j                  dk(  rn*| j                  t        | j                  d       d| _        	 ddd        j                   | j"                         j$                  | _        |j                  | _        |j(                  | _        |j                  | _        |j,                  | _        || _        | j                  j3                  t4        j6                  d      x}rt9        |      | _        | S 7 # t        j                  $ rH}t        | j                  | j                  |j                  |j                  |j                        |d}~ww xY w# 1 sw Y   !xY ww)	zStart response processing.FTNr   r  rg   d      e   rQ   )r  protocol	_protocolr   r   readr   HttpProcessingErrorr(   r   r2  coder  rg   r   r9   on_eof_response_eofr   r   r   r   r  r   r   r8  r   
SET_COOKIErk   r   )rz   r0  rJ  r  r!   exccookie_hdrss          rS   startzClientResponse.start	  s    #,,%[[ 	*
#~~H-5]]_'<$GW <<#%);w||s?R>>-t~~t4%)DN'  !	*. 	t))* llnn  #//  ,,--doorBB;B',['9D$I (=// -))"xx # # 	* 	*sT   ,GGE2E/E2AG1B>G/E22GAGGGGGc                     | j                   ry | j                  xr | j                  j                  }||j                  ry d| _         | j	                          | j                          y NT)r  r   rJ  upgradedr  _release_connection)rz   rJ  s     rS   rP  zClientResponse._response_eof:  sZ    << ##A(8(8(A(AH$5$5  "rR   c                     | j                   S r   )r  r   s    rS   closedzClientResponse.closedG  s    ||rR   c                    | j                   s| j                          d| _        | j                  | j                  j	                         ry | j                          | j                  "| j                  j                          d | _        y y rV  )	_released_notify_contentr  r   	is_closedr  r   closer   s    rS   r_  zClientResponse.closeK  so    ~~  "::!5!5!7'""$#D (rR   c                     | j                   s| j                          d| _        | j                          | j	                          t               S rV  )r\  r]  r  r  rX  r6   r   s    rS   r  zClientResponse.releaseX  s;    ~~  "  "vrR   c                      d| j                   kD  S )zReturns ``True`` if ``status`` is less than ``400``, ``False`` if not.

        This is **not** a check for ``200 OK`` but a check that the response
        status is under 400.
        i  )r   r   s    rS   okzClientResponse.okb  s     T[[  rR   c                     | j                   sl| j                  J | j                  s| j                          t	        | j
                  | j                  | j                  | j                  | j                        y )NrF  )	rb  r   _in_contextr  r(   r   r2  r   rg   r   s    rS   raise_for_statuszClientResponse.raise_for_statusk  sd    ww;;*** ##%!!{{  rR   c                       j                   M j                  " j                   j                          d  _         y  j                  j                   fd       y y )Nc                 $    j                         S r   )rX  )frz   s    rS   r   z4ClientResponse._release_connection.<locals>.<lambda>  s    $:R:R:T rR   )r   r   r  r   r   s   `rS   rX  z"ClientResponse._release_connection}  sK    '}}$  ((*#' //0TU (rR   c                   K   | j                   	 | j                    d {    | j                          y 7 # t        j                  $ r= t        j                  dk\  r't        j
                         x}r|j                         r Y bw xY wwN)r      )r   r   CancelledErrorr   version_infocurrent_task
cancellingrX  rz   tasks     rS   _wait_releasedzClientResponse._wait_released  sy     ==$mm## 	  " $)) $$/!(!5!5!777)2   B
7 57 B
7 ABB
BB
c                 ^    | j                   | j                   j                          d | _        y r   )r   cancelr   r   s    rS   r  zClientResponse._cleanup_writer  s#    ==$MM  "rR   c                 n    | j                   }|r |j                         t        |t               d| _        y rV  )r   	exceptionr8   _CONNECTION_CLOSED_EXCEPTIONr\  )rz   r   s     rS   r]  zClientResponse._notify_content  s.    ,,w((*2'#?@rR   c                   K   | j                   	 | j                    d {    | j                          y 7 # t        j                  $ r= t        j                  dk\  r't        j
                         x}r|j                         r Y bw xY wwrj  )r   r   rl  r   rm  rn  ro  r  rp  s     rS   wait_for_closezClientResponse.wait_for_close  sv     ==$mm## 	 $)) $$/!(!5!5!777)rs  c                 *  K   | j                   s	 | j                  j                          d{   | _         | j                  D ];  }|j	                  | j
                  | j                  | j                          d{    = n| j                  rt        d      | j                  xr | j                  j                  }||j                  s| j                          d{    | j                   S 7 7 v# t        $ r | j                           w xY w7 2w)zRead response payload.NrN   )r   r   rL  r   send_response_chunk_receivedre   rd   BaseExceptionr_  r\  r&   r   rJ  rW  rr  )rz   tracerJ  s      rS   rL  zClientResponse.read  s     ::#'<<#4#4#66
!\\ E<<TXXtzz   ^^'(;<<##A(8(8(A(A8#4#4%%'''zz 7 ! 

 (sL   DC3 C/AC3 :C1;C3 ADDD/C3 1C3 3DDc                 >   | j                   j                  t        j                  d      j	                         }t        j                  |      }|j                  j                  d      }|rGt        j                  t        t              5  t        j                  |      j                  cd d d        S |j                  dk(  r|j                   dk(  s|j                   dk(  ry| j"                  t%        d      | j'                  | | j"                        S # 1 sw Y   jxY w)N charsetapplicationjsonrdapr   z7Cannot compute fallback encoding of a not yet read body)rg   rv   r   CONTENT_TYPElowerr   parse_mimetyper[   
contextlibsuppressLookupErrorrw   codecslookupnamerZ   subtyper   RuntimeErrorr   )rz   ctypemimetypeencodings       rS   get_encodingzClientResponse.get_encoding  s      !2!2B7==?))%0&&**95$$[*= 4}}X.334 4 ==M)&(*:*:f*D ::I  $$T4::664 4s   	DDr  errorsc                    K   | j                   | j                          d{    || j                         }| j                   j                  ||      S 7 3w)z!Read response payload and decode.N)r  )r   rL  r  r(  )rz   r  r  s      rS   textzClientResponse.text  sR     ::))+((*Hzz  & 99 s    AA4Ar   )r  loadscontent_typer  r  c                  K   | j                   | j                          d{    |r| j                  j                  t        j
                  d      j                         }t        ||      s;t        | j                  | j                  | j                  d|z  | j                        | j                   j                         }|sy|| j                         } ||j                  |            S 7 ˭w)zRead and decodes JSON response.Nr  z3Attempt to decode JSON with unexpected mimetype: %srF  )r   rL  rg   rv   r   r  r  r   r)   r   r2  r   stripr  r(  )rz   r  r  r  r  strippeds         rS   r  zClientResponse.json  s      ::))+LL$$T%6%6;AACE,ULA&%%LL;;MPUU LL  ::##%((*HX__X.//- s    C0C.CC0c                    K   d| _         | S wrV  )rd  r   s    rS   
__aenter__zClientResponse.__aenter__   s     s   
exc_typeexc_valexc_tbc                 n   K   d| _         | j                          | j                          d {    y 7 w)NF)rd  r  rz  )rz   r  r  r  s       rS   	__aexit__zClientResponse.__aexit__  s-      ! 	!!###s   +535r   )rO   rf   )rO   z/MultiDictProxy[MultiDictProxy[Union[str, URL]]])r0  rL   rO   rH   rO   N)Nstrict)rO   rH   )Zr]   r^   r_   r   r   r;   ra   r   r   r   r`   r   r?   r   r   r   r   r   r   r   rE   r   r   r   r   r   r   r   StackSummaryr   r  r\  rd  r   r   r   r   r0   rI   r   r   AbstractEventLoopr}   objectr   r   r   setterr   r7   rd   r  rh   r   rg   r  r   rY   r  r   r   r  r.  r0  r2  r?  rT  rP  r   rZ  r_  r  rb  re  rX  rr  r  r]  rz  rL  r  r  r@   rA   r  r  r   r}  r
   r  rQ   rR   rS   rH   rH     s    &*GXk")FC FHSM  G\ !E8E?!&*Hs#*-/He)*/#L*#*.K,'.'+Hh|$+59%S/2926Ix./6:>x	 6 67>*.Hh'. GIKASh 0%8#=>S/3Hh+,3%O%O %O
 /%O 45%O  %O "%O W%O ''%O !%O 
%ON $  "67   ^^:h';< : : :    ^^,| , , , S      #   c     !Z ! ! "k " " FX.@%A F F (0 ; ;D ; # $  H\2     45   !% !%F/b#   $  !D ! !$V#
E (7c 7.:8C= : :TW : #'1&80 3-0 	0
 sm0 
0B$4./$ -($ '	$
 
$rR   rH   c            0          e Zd ZU ej                  ej
                  ej                  ej                  hZej                  ej                  ej                  hZej                  e      j                  ej                  h      Zej                   dej"                   e       iZdZedej.                  f   ed<   dZdZdZed   ed<    e       ZdZdZ dZ!ed   ed<   dddddde"jF                  ddd	ddddddd
ddd	ddde$dede%dee&   dee'e$      de(dee)   dee*   de"jV                  dee$e,df   dee,   de,dee-j\                     dee/d      dee   dee*   dee0   ded   d ee1e,e2f   d!ee&   d"ee3d#      d$e,d%ee$   f.d&Z4dVd'e5d(dfd)Z6d(ee7   fd*Z8e9d(e:d   fd+       Z;e9d(ed   fd,       Z<e<jz                  dWd.       Z<d(e,fd/Z>e9d(ed0e,e2f   fd1       Z?e9d(e@fd2       ZAe9d(e$fd3       ZBe9d(ee7   fd4       ZCe9d(eej.                  eDd5   f   fd6       ZEeEjz                  d7e(d(dfd8       ZEe9d(eFfd9       ZGe9dXd:       ZHded(dfd;ZIdee"jV                  e$f   d(dfd<ZJdee&   d(dfd=ZKdee'e$      d(dfd>ZLdee)   d(dfd?ZMde(d(dfd@ZNdYdAZOdZdee*   d$e,d(dfdBZPd[dCe(dDe7d(dfdEZQdCe(d(dfdFZRdCe(d(dfdGZSdZdHe,d(dfdIZTdee   dee*   d!ee&   d(dfdJZUd-eVdKdLdMee7   d(dfdNZWd\dOZXdYdPZYdYdQZZde$dedRe[d(dfdSZ\de$deddTd(dfdUZ]y)]rG   z*/*Nr   r   _ClientRequest__writerGETzCIMultiDict[None]_skip_auto_headersFT)r  rg   skip_auto_headersdatar   authr   compresschunked	expect100r   response_classr   r   r   r   r   proxy_headersr   	trust_envserver_hostnamere   rd   r  rg   r  r  r   r  r   r  r  r  r   r  rH   r   r   r   r   rK   r   r  r   rM   r  r  c                   |t        j                         }t        j                  |      x}r t	        d|d|j                         d      t        |      t        u sJ |       |t        |      t        u sJ |       t        r|J || _	        |r|j                  |      }|| _        |j                  r|j                  d       n|| _        |j                         | _        || _        |
| _        || _        d | _        |t*        }n|}|| _        ||n	t/               | _        ||nd| _        || _        |j7                         r-t9        j:                  t=        j>                  d            | _         | jC                  |	       | jE                  |       | jG                  |       | jI                  |       | jK                  |       | jM                  |       | jO                  ||       | jQ                  |||       | jS                  |       || j                   | jT                  vr| jW                          | jY                  |       |g | _-        y || _-        y )Nz+Method cannot contain non-token characters z (found at least )Tr   ).r   get_event_loop_CONTAINS_CONTROL_CHAR_REsearchrw   grouprZ   r   r   r   extend_queryoriginal_urlr   r   rd   upperre   r  r  r   lengthrH   r  r3   r   _sslr  r   r   r   r   r   r   update_versionupdate_hostupdate_headersupdate_auto_headersupdate_cookiesupdate_content_encodingupdate_authupdate_proxyupdate_body_from_dataGET_METHODSupdate_transfer_encodingupdate_expect_continuer   )rz   re   rd   r  rg   r  r  r   r  r   r  r  r  r   r  r   r   r   r   r   r  r   r  r  r   real_response_classs                             rS   r}   zClientRequest.__init__6  s4   6 <))+D-44V<<5<=fZ H##(;;="316 
 CyC$$;#%,u,% &&&""6*C.1.>.>3$$T*Clln 	!"0"04G$0eik?C	.>>%.%<%<S]]1=M%ND"G$G$  !23G$$$T*y)%];""4(t{{$2B2BB))+##I.#^rrR   r   rO   c                     d | _         y r   r  r   s     rS   r   zClientRequest.__reset_writer  r   rR   c                     t         j                  | j                  vry| j                  t         j                     }	 t        |      S # t        $ r t	        d|       dw xY w)zExtract and validate Content-Length header value.

        Returns parsed Content-Length value or None if not set.
        Raises ValueError if header exists but cannot be parsed as an integer.
        NzInvalid Content-Length header: )r   CONTENT_LENGTHrg   r   rw   )rz   content_length_hdrs     rS   _get_content_lengthz!ClientRequest._get_content_length  sj     dll2!\\$*=*=>	)** 	12D1EF	s   
A A c                 2    | j                   xs
 t               S r   )r  r   r   s    rS   r  zClientRequest.skip_auto_headers  s    &&7+-7rR   c                     | j                   S r   r  r   s    rS   r   zClientRequest._writer  r  rR   r   c                     | j                   %| j                   j                  | j                         || _         |j                  | j                         y r   )r  r   _ClientRequest__reset_writerr   r   s     rS   r   zClientRequest._writer  s?    ==$MM..t/B/BC  !4!45rR   c                 :    | j                   j                  t        v S r   )rd   scheme_SSL_SCHEMESr   s    rS   r   zClientRequest.is_ssl  s    xx,..rR   rF   c                     | j                   S r   )r  r   s    rS   r   zClientRequest.ssl  r   rR   c           
      N   | j                   x}r#t        t        |j                                     }nd }| j                  }t        j                  t        |j                  xs d|j                  |j                  t        v | j                  | j                  | j                  |f      S )Nr  )r  hashrk   itemsrd   rl   r   raw_hostr   r  r  r  r   r   )rz   r  hrd   s       rS   connection_keyzClientRequest.connection_key  s     ...=.#E-*=*=*?$@AAAhh}}"

l*		


 	
rR   c                 :    | j                   j                  }|J |S r   )rd   r  )rz   rets     rS   r   zClientRequest.host  s     hh
rR   c                 .    | j                   j                  S r   )rd   r   r   s    rS   r   zClientRequest.port  s    xx}}rR   rR   c                 "    | j                   xs dS )zRequest body.rR   )r   r   s    rS   bodyzClientRequest.body  s     zz S rR   rD  c                     | j                   1t        | j                   d       | j                   j                          | j                  |       y)a  Set request body with warning for non-autoclose payloads.

        WARNING: This setter must be called from within an event loop and is not
        thread-safe. Setting body outside of an event loop may raise RuntimeError
        when closing file-based payloads.

        DEPRECATED: Direct assignment to body is deprecated and will be removed
        in a future version. Use await update_body() instead for proper resource
        management.
        Nr   r   )r   r   _close_update_body)rz   rD  s     rS   r  zClientRequest.body  s>     ::! &djjQ?
 JJ% rR   c                     t        | j                        }t        j                  t        | j
                  | j                  || j                  f      S r   )r   rg   rk   rl   rI   rd   re   r  )rz   rg   s     rS   r   zClientRequest.request_info  s?    )9$,,)G
 }}$((DKK$:K:KL
 	
rR   c                     | j                   S )zReturn the ClientSession instance.

        This property provides access to the ClientSession that initiated
        this request, allowing middleware to make additional requests
        using the same session.
        )r   r   s    rS   r   zClientRequest.session  s     }}rR   c                     |j                   st        |      |j                  s|j                  r8t	        j
                  |j                  xs d|j                  xs d      | _        yy)z8Update destination host, port and connection type (ssl).r  N)	r  r*   raw_userraw_passwordr   r1   userpasswordr  )rz   rd   s     rS   r  zClientRequest.update_host   sP     ||S/! <<3++))#((.b#,,:L"MDI ,rR   c                 <   t        |t              rd|j                  dd      D cg c]  }|j                          }}	 t	        j
                  t        |d         t        |d               }|| _        y|| _        yc c}w # t        $ r t        d|       dw xY w)zdConvert request version to two elements tuple.

        parser HTTP version '1.1' => (1, 1)
        .r   r   z#Can not parse http version number: N)	r   r`   r:  r  r   r;   r   rw   r   )rz   r   partvs       rS   r  zClientRequest.update_version
  s    
 gs#*1--Q*?@$@A@**3qt9c!A$i@
 w A   9'Cs   A=.B Bc                 |   t               | _        | j                  j                  }|J || j                  t        j
                  <   |syt        |t        t        t        f      r|j                         }|D ]C  \  }}|t        j                  v r|| j                  |<   (| j                  j                  ||       E y)zUpdate request headers.N)r   rg   rd   host_port_subcomponentr   HOSTr   dictr   r   r  HOST_ALLr=  )rz   rg   r   rC  rD  s        rS   r  zClientRequest.update_headers  s    )4 xx.. "&TYYgni@AmmoG! 	-JCdmm#$)S!  e,	-rR   c                    |Vt        d t        |      D              | _        | j                  j	                         }|j                  | j                         n| j                  }| j                  j                         D ]  \  }}||vs|| j                  |<    t        j                  |vr"t        | j                  t        j                  <   y y )Nc              3   $   K   | ]  }|d f 
 y wr   rQ   )r   hdrs     rS   r   z4ClientRequest.update_auto_headers.<locals>.<genexpr>4  s      2 #d2s   )r   sortedr  rg   copyextendDEFAULT_HEADERSr  r   
USER_AGENTr:   )rz   r  used_headersr  r@  s        rS   r  z!ClientRequest.update_auto_headers2  s    (&1 2'-.?'@2 'D#  <<,,.L 7 78  <<L,,224 	(HC,&$'S!	( ??,.,;DLL) /rR   c                 *   |syt               }t        j                  | j                  v r]|j	                  t        | j                  j                  t        j                  d                   | j                  t        j                  = t        |t              r|j                         }n|}|D ])  \  }}t        |t              rt        |      ||<   %|||<   + |j                  dd      j                         | j                  t        j                  <   y)zUpdate request cookies header.Nr  r5  )headersep)r   r   COOKIErg   r   r"   rv   r   r   r  r   r$   outputr  )rz   r   citer_cookiesr  rD  s         rS   r  zClientRequest.update_cookiesE  s    N;;$,,&HH()9)9$++r)JKLT[[)gw'"==?L"L' 	 KD%%(:5A$$	  %&HHBCH$@$F$F$HT[[!rR   c                 R   |sd| _         y| j                  j                  t        j                        r| j                   rt        d      y| j                   rPt        | j                   t              sd| _         | j                   | j                  t        j                  <   d| _        yy)zSet request content encoding.Nz9compress can not be set if Content-Encoding header is setdeflateT)	r  rg   rv   r   CONTENT_ENCODINGrw   r   r`   r  )rz   r  s     rS   r  z%ClientRequest.update_content_encoding]  s     DM<<D112}} O   ]]dmmS1 )26--DLL../DL	 rR   c                 N   | j                   j                  t        j                  d      j	                         }d|v r| j
                  rt        d      y| j
                  rEt        j                  | j                   v rt        d      d| j                   t        j                  <   yy)z!Analyze transfer-encoding header.r  r  zDchunked can not be set if "Transfer-Encoding: chunked" header is setz6chunked can not be set if Content-Length header is setN)rg   rv   r   TRANSFER_ENCODINGr  r  rw   r  )rz   tes     rS   r  z&ClientRequest.update_transfer_encodingo  s    \\d44b9??A?|| D   \\""dll2 L  4=DLL//0 rR   c                    || j                   }|d|rb| j                  j                  Lt               }t	        j
                  t              5  t        || j                  j                        }ddd       |yt        |t        j                        st        d      |j                         | j                  t        j                  <   y# 1 sw Y   ]xY w)zSet basic auth.Nz%BasicAuth() tuple is required instead)r  rd   r   r5   r  r  r  r4   r   r   r1   r   r'  rg   r   AUTHORIZATION)rz   r  r  	netrc_objs       rS   r  zClientRequest.update_auth  s    <99D<I$((--*C&(I$$[1 F+Itxx}}EF<$ 1 12CDD+/;;=T''(F Fs   !C		Cr  _stacklevelc                 f   | j                   t        | j                   |       |ed| _         | j                  | j                  vrE| j                  s9t
        j                  | j                  vrd| j                  t
        j                  <   yt        |t              r |       n|}	 t        j                  j                  |d      }|| _         | j                  sXt
        j                  | j                  vr<|j                  x}'t        |      | j                  t
        j                  <   nd| _        |j                  sJ | j                  }| j                   }|j                  j#                         D ]  \  }}	||v s|||v r|	||<    y# t        j                  $ r  t        |             }Y w xY w)zUpdate request body from data.Nr   0)dispositionT)r   r   re   r  r  r   r  rg   r   r.   r!   PAYLOAD_REGISTRYrv   r  sizer`   r  r  )
rz   r  r  maybe_payloadbody_payloadr  rg   skip_headersrC  rD  s
             rS   r  z#ClientRequest.update_body_from_data  s|   ::!%djj[I<DJ 4#3#33''t||;47T001 #-T8"<$	5"3377SW7XL "
|| 3 34<< G$)))647IT001# ####,,..&..446 	!JCg~,":sl?R GCL	! "" 	528M24L	5s   %!F
 
#F0/F0c                 t   t         j                  | j                  v r| j                  t         j                  = | j                  r7t         j                  | j                  v r| j                  t         j                  = | j                  |d       || j                  | j                  vr| j                          yy)z/Update request body after its already been set.   )r  N)	r   r  rg   r  r  r  re   r  r  rz   r  s     rS   r  zClientRequest._update_body  s     $,,.T001 <<D22dllBT334 	""4Q"7 t{{$2B2BB))+  CrR   c                    K   | j                   "| j                   j                          d{    | j                  |       y7 w)ac	  
        Update request body and close previous payload if needed.

        This method safely updates the request body by first closing any existing
        payload to prevent resource leaks, then setting the new body.

        IMPORTANT: Always use this method instead of setting request.body directly.
        Direct assignment to request.body will leak resources if the previous body
        contains file handles, streams, or other resources that need cleanup.

        Args:
            body: The new body content. Can be:
                - bytes/bytearray: Raw binary data
                - str: Text data (will be encoded using charset from Content-Type)
                - FormData: Form data that will be encoded as multipart/form-data
                - Payload: A pre-configured payload object
                - AsyncIterable: An async iterable of bytes chunks
                - File-like object: Will be read and sent as binary data
                - None: Clears the body

        Usage:
            # CORRECT: Use update_body
            await request.update_body(b"new request data")

            # WRONG: Don't set body directly
            # request.body = b"new request data"  # This will leak resources!

            # Update with form data
            form_data = FormData()
            form_data.add_field('field', 'value')
            await request.update_body(form_data)

            # Clear body
            await request.update_body(None)

        Note:
            This method is async because it may need to close file handles or
            other resources associated with the previous payload. Always await
            this method to ensure proper cleanup.

        Warning:
            Setting request.body directly is highly discouraged and can lead to:
            - Resource leaks (unclosed file handles, streams)
            - Memory leaks (unreleased buffers)
            - Unexpected behavior with streaming payloads

            It is not recommended to change the payload type in middleware. If the
            body was already set (e.g., as bytes), it's best to keep the same type
            rather than converting it (e.g., to str) as this may result in unexpected
            behavior.

        See Also:
            - update_body_from_data: Synchronous body update without cleanup
            - body property: Direct body access (STRONGLY DISCOURAGED)

        N)r   r_  r  r  s     rS   update_bodyzClientRequest.update_body  s<     t ::!**""$$$$ %s   *AAAexpectc                     |rd| j                   t        j                  <   nLt        j                  | j                   v r0| j                   t        j                     j                         dk(  rd}|r | j                  j                         | _        y y )Nz100-continueT)rg   r   EXPECTr  r   create_futurer   )rz   r"  s     rS   r  z$ClientRequest.update_expect_continue  sf    (6DLL%KK4<<'T[[)//1^CF!YY446DN rR   c                     || _         |d | _        d | _        y |r%t        |t        j
                        st        d      || _        |!t        |t        t        f      st        |      }|| _        y )Nz,proxy_auth must be None or BasicAuth() tuple)
r   r   r  r   r   r1   rw   r   r   r   )rz   r   r   r  s       rS   r  zClientRequest.update_proxy  sr     
="DO!%DjW5F5FGKLL$$ZI~6.
 (6M*rR   connrL   content_lengthc           
        K   | j                   <|j                          |j                          d{    | j                    d{    |j                  }|J 	 | j                  $| j                  j                  ||       d{    |j                          d{    |j                          y7 7 p7 17 # t        $ ri}|}|j                  duxs t        |t        j                         }|r#t        |j                  d| j                        }t        |||       Y d}~yd}~wt        j                   $ r |j#                           t$        $ r&}t        |t'        d|d|      |       Y d}~yd}~ww xY ww)a:  
        Write the request body to the connection stream.

        This method handles writing different types of request bodies:
        1. Payload objects (using their specialized write_with_length method)
        2. Bytes/bytearray objects
        3. Iterable body content

        Args:
            writer: The stream writer to write the body to
            conn: The connection being used for this request
            content_length: Optional maximum number of bytes to write from the body
                            (None means write the entire body)

        The method properly handles:
        - Waiting for 100-Continue responses if required
        - Content length constraints for chunked encoding
        - Error handling for network issues, cancellation, and other exceptions
        - Signaling EOF and timeout management

        Raises:
            ClientOSError: When there's an OS-level error writing the body
            ClientConnectionError: When there's a general connection error
            asyncio.CancelledError: When the operation is cancelled

        NzCan not write request body for z4Failed to send bytes into the underlying connection z: )r   send_headersdrainrJ  r   write_with_length	write_eofstart_timeoutOSErrorerrnor   r   TimeoutErrorr'   rd   r8   rl  r_  	Exceptionr&   )rz   r   r'  r(  rJ  underlying_excreraised_excexc_is_not_timeouts           rS   write_byteszClientRequest.write_bytes-  s    B >>%!,,.  ..  ==###'	% zz%jj226>JJJ< ""$$$""$Y !  K< %;  	B)L "0!5!5T!A " 4 4J F ","((5dhh]C 
 (L.AA%% 	JJL 	%Jir.!35  	s   0FB5FB7F+B= B9B= FB; F7F9B= ;F=	E?AD*%F*/E?E:5F:E??Fc                 r  K   | j                   t        j                  k(  r6| j                  j                  }|J | d| j                  j
                   }nH| j                  r&| j                         st        | j                        }n| j                  j                  }|j                  }|J t        || j                  | j                  r5t        j                  | j                   | j                   | j                        nd | j                  r5t        j                  | j"                  | j                   | j                        nd       }| j$                  r|j'                  | j$                         | j(                  |j+                          | j                   | j,                  v ra| j.                  t        j0                  | j.                  vr9t        j0                  | j2                  vrd| j2                  t        j0                  <   | j4                  }t        j6                  | j2                  vrc|j8                  j:                  r'|t<        k(  rDd| j2                  t        j6                  <   n&|t>        k(  rd| j2                  t        j6                  <   | j                    d| d|j@                   d|jB                   }|jE                  || j2                         d {    | jF                  s| jH                  |jJ                  r| jM                  ||| jO                               }tP        jR                  d	k\  r#tU        jV                  || j                  d
      }	n| j                  jY                  |      }	|	j[                         rd }	n*|	| _.        n"|j_                          |ja                          d }	| jb                  }
|
J  |
| j                   | jd                  |	| jH                  | jf                  | jh                  | j                  | j                  | jj                  	      | _6        | jl                  S 7 Zw)N:)on_chunk_senton_headers_sentzapplication/octet-streamr_  z
keep-alive z HTTP/r  )r      T)r   eager_start)r   r   r   r   r   r   r   )7re   r   METH_CONNECTrd   host_subcomponentr   r   r   r`   raw_path_qsrJ  r>   r   r   	functoolspartial_on_chunk_request_sent_on_headers_request_sentr  enable_compressionr  enable_chunkingPOST_METHODSr  r  rg   r   
CONNECTION
_connectorforce_closer=   r<   majorminorwrite_headersr   r   writing_pausedr6  r  r   rm  r   Taskcreate_taskr   r   r.  set_eofr  r  r   r   r   response)rz   r'  connect_hostpathrJ  r   r  status_linecororq  r  s              rS   sendzClientRequest.send  s?    
 ;;$+++8855L+++"^1TXX]]O4DZZtxx=D88''D==###II << !!$"="=t{{DHHU << !!$"?"?dhhW
 ==%%dmm4<<#""$ KK4,,,''/$$D,C,CC!!5.HDLL**+LL??$,,.**%4;DLL1m#0<T__- QtfF177)1QWWIF "";=== ::3x7N7N##FD$2J2J2LMD7* ||DtyydKyy,,T2yy{# ""$NND,,)))&KK++**<<MM

 }}K 	>s   KP7P4EP7c                   K   | j                   	 | j                    d {    y y 7 # t        j                  $ rA t        j                  dk\  r+t        j
                         x}r|j                         r Y y Y y Y y w xY wwrj  )r  r   rl  r   rm  rn  ro  rp  s     rS   r_  zClientRequest.close  s|     ==$mm## %#)) $$/!(!5!5!777) * 8 0s2   A?( &( A?( AA<5A?;A<<A?c                     | j                   a| j                  j                         s| j                   j                          | j                   j	                  | j
                         d | _         y y r   )r  r   r^  ru  r   r  r   s    rS   	terminatezClientRequest.terminate  sP    ==$99&&($$&MM..t/B/BC DM	 %rR   chunkc                 h   K   | j                   D ]  }|j                  |||       d {     y 7 wr   )r   send_request_chunk_sent)rz   re   rd   r[  r~  s        rS   rC  z$ClientRequest._on_chunk_request_sent  s6     \\ 	DE//UCCC	DC   &202zCIMultiDict[str]c                 h   K   | j                   D ]  }|j                  |||       d {     y 7 wr   )r   send_request_headers)rz   re   rd   rg   r~  s        rS   rD  z&ClientRequest._on_headers_request_sent  s8      \\ 	CE,,VS'BBB	CBr^  r   )r   r   rO   N)rO   rK   r  )F)r   )r'  rL   rO   rH   )^r]   r^   r_   r   METH_GET	METH_HEADMETH_OPTIONS
METH_TRACEr  
METH_PATCH	METH_POSTMETH_PUTrG  unionMETH_DELETEALL_METHODSACCEPTACCEPT_ENCODINGrT   r  r   r   r!   Payloadra   r  rR  r  r   r   rd   re   r   r  r   r=   r`   rD   rC   r   r   rB   r1   r;   r   r   r  r   r0   rF   rJ   r   r}   r  r  r   r  r   r   r  r   r  r   r   r   r  r   r   r   r  rI   r   r   r  r  r  r  r  r  r  r  r  r  r!  r  r  r%   r6  rW  r_  rZ  r   rC  rD  rQ   rR   rS   rG   rG     s   	K OOT^^T]]CL##L1779I9I8JKK 	U:<O +/E5w&'.DH/3Hh+,3 %CFI8<!45< *.59*.$($($6$6+/"&48;?#*.,0-14804*.)-3M8M8 M8
 M8 ,'M8 $HSM2M8 M8 ,'M8 y!M8 !!M8 T4(M8 $M8 M8 w001M8  !&6!78!M8" }#M8$ Y'%M8& ()'M8( /*)M8* :t[01+M8,  --M8. g'/M80 1M82 "#3M8^ $ Xc] " 8;t#4 8 8 "67   ^^6 6/ / U<{:;   
 
 
& c  
 hsm   !eGOOWS\9: ! !
 
[[!# !$ ! !. 
k 
 
  Ns Nt NeD,<,<c,A&B t -h|&< - -2<Xhsm5L <QU <&Ih|&< I I0 C  D  $=&9 3 9 9QU 9 '!# '!C '! '!R, , ,$< c < d < |
7T 
7d 
7+}+ Y'+  -	+
 
+,P%$P% P% !	P%
 
P%daF
!D3 DS D DSW DCC #C.@C	CrR   rG   )r  )~r   r  r  rA  r%  r9  r   r   r   collections.abcr   hashlibr   r   r   http.cookiesr   r   typesr	   r
   typingr   r   r   r   r   r   r   r   r   r   r   r   attr	multidictr   r   r   r   yarlr   r  r   r   r   r    r!   _cookie_helpersr"   r#   r$   abcr%   client_exceptionsr&   r'   r(   r)   r*   r+   compression_utilsr-   formdatar.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   streamsr?   typedefsr@   rA   rB   rC   rD   rE   r   rF   ImportErrorr  __all__clientrK   	connectorrL   tracingrM   rx  compiler  r   r`   rT   srY   rc   rI   rJ   r   rZ   r   r   r   	frozensetr  r   r   rm  r   r   rH   rG   rQ   rR   rS   <module>r     sq       	 	 
   # % % - 1     N N  5 5 
 &  *      "  " L %%  55HI &BJJ'EF 
"**9
:Bc B T$d3  4: 
, 
$P P@ ?{DJGtDz*4	|T;.	/44 ,'4 %	4
 <{*+4n )*	&J 	&::7::	:
w 
C 
PT 
&w$\ w$tkC kCw  
s   =
H 	H,+H,