+
    4j                        R t ^ RIHt ^ RIt^ RIt^ RIt^ RIHtH	t	 ^ RI
t
^ RIt^RIHtHtHtHt ^RIHtHtHtHtHtHt ]'       d   ^ RIHt R.t ! R R	4      t ! R
 R4      tR# )z/httpx-based async HTTP transport for nab-index.)annotationsN)TYPE_CHECKINGAny)MAX_REDIRECTSMAX_RETRIESRETRY_STATUSES
next_delay)DEFAULT_HEADERSContentDecodingError	HttpErroraccepts_gzipdecode_bodyraise_for_error_status)MappingHttpxAsyncTransportc                      ] tR t^tRtRtR R lt]R R l4       t]R R l4       t	]R R	 l4       t
]R
 R l4       t]R R l4       tR R ltR R ltRtR# )_HttpxResponseaf  Adapter that gives an httpx response the HttpResponse shape.

The body is fetched undecoded, and decoded by the transport when the
request asked for gzip (see :func:`~nab_index.transport.decode_body`),
so it is carried here rather than read from the httpx response.

``raise_for_status`` follows the shared 4xx/5xx rule; httpx's own raises
on every non-2xx.
c               $    V ^8  d   QhRRRRRR/# )   responsezhttpx.ResponsecontentbytesreturnNone )formats   "q/home/user/pdf2html-billing-ledger-validate/.venv/lib/python3.14/site-packages/nab_index/httpx_async_transport.py__annotate___HttpxResponse.__annotate__,   s!          %  D      c                	    Wn         W n        R # N)	_response_content)selfr   r   s   &&&r   __init___HttpxResponse.__init__,   s    !r   c                   V ^8  d   QhRR/# )r   r   intr   )r   s   "r   r   r   1   s     * *S *r   c                	.    V P                   P                  # r!   )r"   status_coder$   s   &r   r*   _HttpxResponse.status_code0   s    ~~)))r   c                   V ^8  d   QhRR/# r   r   strr   )r   s   "r   r   r   5   s     ' 'S 'r   c                	@    \        V P                  P                  4      # r!   )r/   r"   urlr+   s   &r   r1   _HttpxResponse.url4   s    4>>%%&&r   c                   V ^8  d   QhRR/# )r   r   zMapping[str, str]r   )r   s   "r   r   r   9   s     & &* &r   c                	.    V P                   P                  # r!   )r"   headersr+   s   &r   r5   _HttpxResponse.headers8   s    ~~%%%r   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r   =   s       r   c                	    V P                   # r!   )r#   r+   s   &r   r   _HttpxResponse.content<   s    }}r   c                   V ^8  d   QhRR/# r.   r   )r   s   "r   r   r   A   s     - -c -r   c                	8    V P                   P                  R 4      # )zutf-8)r#   decoder+   s   &r   text_HttpxResponse.text@   s    }}##G,,r   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r   D   s     * *c *r   c                	B    \         P                  ! V P                  4      # r!   )_jsonloadsr#   r+   s   &r   json_HttpxResponse.jsonD   s    {{4==))r   c                   V ^8  d   QhRR/# r   r   r   r   )r   s   "r   r   r   G   s     E E$ Er   c                	Z    \        V P                  P                  V P                  4       R # r!   )r   r"   r*   r1   r+   s   &r   raise_for_status_HttpxResponse.raise_for_statusG   s    t~~99488Dr   )r#   r"   N)__name__
__module____qualname____firstlineno____doc__	__slots__r%   propertyr*   r1   r5   r   r=   rC   rH   __static_attributes__r   r   r   r   r      s     *I  * * ' ' & &   - -*E Er   r   c                  N    ] tR t^KtRtRR/R R lltRR/R R	 lltR
 R ltRtR# )r   z]Async HTTP transport using httpx.

HTTP/2 is enabled by default for connection multiplexing.
http2Tc                    V ^8  d   QhRRRR/# )r   rS   boolr   r   r   )r   s   "r   r    HttpxAsyncTransport.__annotate__Q   s     	
 	
 	
 	
r   c                   \         P                  ! VR\        \        P                  ! \
        P                  4      R7      V n        R# )zCreate a transport.T)rS   follow_redirectsmax_redirectsverifyN)httpxAsyncClientr   
truststore
SSLContextsslPROTOCOL_TLS_CLIENT_client)r$   rS   s   &$r   r%   HttpxAsyncTransport.__init__Q   s3    (( "'(()@)@A
r   r5   Nc               $    V ^8  d   QhRRRRRR/# )r   r1   r/   r5   zdict[str, str] | Noner   r   r   )r   s   "r   r   rV   \   s$     :' :':'$9:'	:'r   c          
     ~  "   \        \        4      pVe   VP                  V4       \        V4      p^ p  V P                  P                  RWR7      ;_uu_4       GRj  xL
 pRP                  VP                  4        Uu. u Rj  xL
 qwNK   L/ L	D
Mu upi up4      pRRR4      GRj  xL 
  M  + GRj  xL 
 '       g   i     M; iT'       d&   \        XXP                  P                  R4      4      MXp	XP                  \        9  d   \        Yi4      # T^,          pT\        8  d   \        Yi4      # \        YVP                  P                  R4      4      p
M  \         P"                  \         P$                  3 d   pRT RT 2p\'        T4      ThRp?i\         P(                  \*        3 d>   pT^,          pT\        8  d   RT RT 2p\'        T4      Th\        T4      p
 Rp?M*Rp?i\,         d   pRT RT 2p\'        T4      ThRp?ii ; i\.        P0                  ! T
4      G Rj  xL 
  EK	  5i)	a  Send a GET request, retrying a blip.

httpx has no retry machinery beyond reconnecting, so the shared policy
runs in this loop rather than in the client. The body is read raw and
decoded with ``decode_body``, so a truncated gzip stream is retried
instead of returned as if complete. ``headers`` overrides entries of
:data:`~nab_index.transport.DEFAULT_HEADERS`, so a caller can pass
:data:`~nab_index.transport.IDENTITY_HEADERS` to get the body
undecoded.
NGET)r5   r   zContent-EncodingzRetry-AfterzGET z	 failed: )dictr	   updater   ra   streamjoin	aiter_rawr   r5   getr*   r   r   r   r   r[   TooManyRedirectsUnsupportedProtocolr   	HTTPErrorr
   	Exceptionasynciosleep)r$   r1   r5   request_headersr<   failuresr   partrawr   delayexcmsgs   &&$          r   rk   HttpxAsyncTransport.get\   s      /""7+o.#R<<..3 /   ((8;M;M;O#P#P4D $Q#PQC        X%5%5%9%9:L%MN . ''~=)(<<A k))(<<"8-=-=-A-A--PQ3 **E,E,EF . SE3%0n#-OO%9: -Ak) Yse4C#C.c1"8, . SE3%0n#-.  --&&&s   3H=)E" B E" #B3BBBBBE" BBB3!E" ,B/-E" 3C	9B<:
C	C	E" 'E" >A$H="%HFH8H93G1,H=1H>H?HHH=4H75H=c                   V ^8  d   QhRR/# rF   r   )r   s   "r   r   rV      s     $ $d $r   c                V   "   V P                   P                  4       G Rj  xL
  R#  L5i)zClose the underlying client.N)ra   acloser+   s   &r   r|   HttpxAsyncTransport.aclose   s     ll!!###s   )'))ra   )	rJ   rK   rL   rM   rN   r%   rk   r|   rQ   r   r   r   r   r   K   s+    
	
 	
:'<@:'x$ $r   )rN   
__future__r   rp   rC   rA   r_   typingr   r   r[   r]   retryr   r   r   r   	transportr	   r
   r   r   r   r   collections.abcr   __all__r   r   r   r   r   <module>r      sZ    5 "   
 %   I I  ' 
)E )EXO$ O$r   