Ë
    A²Xj.  ã                  óL   — d Z ddlmZ ddlZddlmZ ddlmZ d	d„Zd	d„Z	d
d„Z
y)ay  
This file includes code adapted from HTTPX's utility module
(https://github.com/encode/httpx/blob/336204f0121a9aefdebac5cacd81f912bafe8057/httpx/_utils.py).
We implement custom proxy handling to support configurations like `socket_options`,
which are not currently configurable through the HTTPX client.
For more context, see: https://github.com/encode/httpx/discussions/3514
é    )ÚannotationsN)ÚMapping)Ú
getproxiesc                ór   — 	 t        j                  | j                  d«      d   «       y# t        $ r Y yw xY w©NÚ/r   FT)Ú	ipaddressÚIPv4AddressÚsplitÚ	Exception©Úhostnames    ú]/var/www/html/content_generation/venv/lib/python3.12/site-packages/anthropic/_utils/_httpx.pyÚis_ipv4_hostnamer      ó<   € ðÜ×Ñ˜hŸn™n¨SÓ1°!Ñ4Ô5ð øô ò Ùðúó   ‚'* ª	6µ6c                ór   — 	 t        j                  | j                  d«      d   «       y# t        $ r Y yw xY wr   )r	   ÚIPv6Addressr   r   r   s    r   Úis_ipv6_hostnamer      r   r   c                 óÒ  — t        «       } i }dD ]*  }| j                  |«      sŒ| |   }d|v r|nd|› �||› d�<   Œ, | j                  dd«      j                  d«      D �cg c]  }|j                  «       ‘Œ }}|D ]e  }|dk(  ri c S |sŒd|v rd||<   Œt	        |«      r	d|d	|› �<   Œ-t        |«      r
d|d
|› d�<   ŒB|j                  «       dk(  r	d|d	|› �<   Œ^d|d|› �<   Œg |S c c}w )uô   
    Gets the proxy mappings based on environment variables.
    We use our own logic to parse these variables, as HTTPX
    doesnâ€™t allow full configuration of the underlying
    transport when proxies are set via environment variables.
    )ÚhttpÚhttpsÚallz://zhttp://ÚnoÚ Ú,Ú*Nzall://zall://[Ú]Ú	localhostzall://*)r   Úgetr   Ústripr   r   Úlower)Ú
proxy_infoÚmountsÚschemer   ÚhostÚno_proxy_hostss         r   Úget_environment_proxiesr(       s#  € ô “€JØ$&€Fã*ˆØ�>‰>˜&Õ!Ø! &Ñ)ˆHØ16¸(Ñ1B¡XÈ'ÐRZÐQ[ÐH\ˆF�f�X˜S�>Ò"ð +ð
 0:¯~©~¸dÀBÓ/G×/MÑ/MÈcÔ/RÓSÑ/R t�d—j‘j•lÐ/R€NÐSÛ"ˆØ�sŠ?ØŠIÚØ˜Ñ Ø#'��xÒ Ü! (Ô+Ø.2�˜ ˜zÐ*Ò+Ü! (Ô+Ø04�˜  
¨!Ð,Ò-Ø—‘Ó! [Ò0Ø.2�˜ ˜zÐ*Ò+à/3�˜  
Ð+Ò,ð #ð €Mùò! Ts   ÁC$)r   ÚstrÚreturnÚbool)r*   zMapping[str, str | None])Ú__doc__Ú
__future__r   r	   Útypingr   Úurllib.requestr   r   r   r(   © ó    r   Ú<module>r2      s'   ðñõ #ã Ý Ý %óóô r1   