Ë
    GU hÛ   ã                  ó&  — U d dl mZ d dlZd dlZd dlmZ d dlmZ ddlm	Z	 ddl
mZ ej                  rd d	lmZ d
Z eg d¢«      ZdZ	 	 d dlZedz  Z	 d dlmZ edz  Z G d„ de«      Zej6                  Zded<   ej<                  eef   Z h d£Z!	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Z"	 	 	 	 	 	 dd„Z#dd„Z$ G d„ dejJ                  «      Z&	 	 	 	 	 	 	 	 dd„Z'y# e$ r d dlZY Œ•w xY w# e$ r Y Œ›w xY w# e$ r 	 d dlZedz  Zn# e$ r Y nw xY wY Œ°w xY w) é    )ÚannotationsN)Ú	b64encode)ÚEnumé   )ÚUnrewindableBodyErroré   )Úto_bytes)ÚFinalz@@@SKIP_HEADER@@@)úaccept-encodingÚhostú
user-agentzgzip,deflatez,br)Úzstdz,zstdc                  ó   — e Zd ZdZy)Ú_TYPE_FAILEDTELLr   N)Ú__name__Ú
__module__Ú__qualname__Útoken© ó    úL/var/www/timesheet/venv/lib/python3.12/site-packages/urllib3/util/request.pyr   r   /   s   „ Ø�Er   r   zFinal[_TYPE_FAILEDTELL]Ú_FAILEDTELL>   ÚGETÚHEADÚTRACEÚDELETEÚCONNECTÚOPTIONSc                ót  — i }|r>t        |t        «      rn(t        |t        «      rdj                  |«      }nt        }||d<   |r||d<   | rd|d<   |r.dt        |j                  d«      «      j                  «       › �|d<   |r.dt        |j                  d«      «      j                  «       › �|d	<   |rd
|d<   |S )ad  
    Shortcuts for generating request headers.

    :param keep_alive:
        If ``True``, adds 'connection: keep-alive' header.

    :param accept_encoding:
        Can be a boolean, list, or string.
        ``True`` translates to 'gzip,deflate'.  If the dependencies for
        Brotli (either the ``brotli`` or ``brotlicffi`` package) and/or Zstandard
        (the ``zstandard`` package) algorithms are installed, then their encodings are
        included in the string ('br' and 'zstd', respectively).
        List will get joined by comma.
        String will be used as provided.

    :param user_agent:
        String representing the user-agent you want, such as
        "python-urllib3/0.6"

    :param basic_auth:
        Colon-separated username:password string for 'authorization: basic ...'
        auth header.

    :param proxy_basic_auth:
        Colon-separated username:password string for 'proxy-authorization: basic ...'
        auth header.

    :param disable_cache:
        If ``True``, adds 'cache-control: no-cache' header.

    Example:

    .. code-block:: python

        import urllib3

        print(urllib3.util.make_headers(keep_alive=True, user_agent="Batman/1.0"))
        # {'connection': 'keep-alive', 'user-agent': 'Batman/1.0'}
        print(urllib3.util.make_headers(accept_encoding=True))
        # {'accept-encoding': 'gzip,deflate'}
    ú,r   r   z
keep-aliveÚ
connectionzBasic zlatin-1Úauthorizationzproxy-authorizationzno-cachezcache-control)Ú
isinstanceÚstrÚlistÚjoinÚACCEPT_ENCODINGr   ÚencodeÚdecode)Ú
keep_aliveÚaccept_encodingÚ
user_agentÚ
basic_authÚproxy_basic_authÚdisable_cacheÚheaderss          r   Úmake_headersr1   ?   sÖ   € ðb !€GÙÜ�o¤sÔ+ØÜ˜¬Ô.Ø!Ÿh™h Ó7‰Oä-ˆOØ%4ˆÐ!Ñ"áØ *ˆ�ÑáØ ,ˆ�Ñáà”Y˜z×0Ñ0°Ó;Ó<×CÑCÓEÐFÐGð 	�Ñ ñ à”YÐ/×6Ñ6°yÓAÓB×IÑIÓKÐLÐMð 	Ð%Ñ&ñ Ø#-ˆ�Ñ à€Nr   c                ó’   — |�t        | |«       |S t        | dd«      �	 | j                  «       }|S |S # t        $ r
 t        }Y |S w xY w)z
    If a position is provided, move file to that point.
    Otherwise, we'll attempt to record a position for future use.
    NÚtell)Úrewind_bodyÚgetattrr3   ÚOSErrorr   )ÚbodyÚposs     r   Úset_file_positionr9   �   sc   € ð €Ü�D˜#Ôð €Jô 
��v˜tÓ	$Ð	0ð	Ø—)‘)“+ˆCð €Jˆ3€Jøô ò 	ô ‰Cà€Jð	ús   Ÿ3 ³AÁAc                óä   — t        | dd«      }|�t        |t        «      r
	  ||«       y|t
        u rt	        d«      ‚t        dt        |«      › d�«      ‚# t        $ r}t	        d«      |‚d}~ww xY w)zæ
    Attempt to rewind body to a certain position.
    Primarily used for request redirects and retries.

    :param body:
        File-like object that supports seek.

    :param int pos:
        Position to seek to in file.
    ÚseekNzAAn error occurred when rewinding request body for redirect/retry.zRUnable to record file position for rewinding request body during a redirect/retry.z1body_pos must be of type integer, instead it was ú.)r5   r#   Úintr6   r   r   Ú
ValueErrorÚtype)r7   Úbody_posÚ	body_seekÚes       r   r4   r4   ¤   s�   € ô ˜˜f dÓ+€IØÐ¤¨H´cÔ!:ð	Ù�hÕð
 
”[Ñ	 Ü#ð4ó
ð 	
ô
 Ø?ÄÀXÃÐ?OÈqÐQó
ð 	
øô ò 	Ü'ØSóàðûð	ús   ¡A Á	A/ÁA*Á*A/c                  ó"   — e Zd ZU ded<   ded<   y)ÚChunksAndContentLengthztyping.Iterable[bytes] | NoneÚchunksz
int | NoneÚcontent_lengthN)r   r   r   Ú__annotations__r   r   r   rD   rD   Â   s   … Ø)Ó)ØÔr   rD   c                ó¦  ‡ ‡— ‰ €d}|j                  «       t        vrd}nld}nit        ‰ t        t        f«      rt        ‰ «      f}t        |d   «      }n8t        ‰ d«      rdˆˆ fd„} |«       }d}n	 t        ‰ «      }‰ f}|j                  }t        ||¬«      S # t        $ r. 	 t        ‰ «      }d}n# t        $ r t        d‰ ›�«      d‚w xY wY ŒCw xY w)aR  Takes the HTTP request method, body, and blocksize and
    transforms them into an iterable of chunks to pass to
    socket.sendall() and an optional 'Content-Length' header.

    A 'Content-Length' of 'None' indicates the length of the body
    can't be determined so should use 'Transfer-Encoding: chunked'
    for framing instead.
    Nr   Úreadc               3  óš   •K  — t        ‰t        j                  «      } 	 ‰j                  ‰«      }|sy | r|j	                  d«      }|–— Œ,­w)Nzutf-8)r#   ÚioÚ
TextIOBaserI   r(   )r(   Ú	datablockÚ	blocksizer7   s     €€r   Úchunk_readablez&body_to_chunks.<locals>.chunk_readableè   sK   øè ø€ ä ¤b§m¡mÓ4ˆFØØ ŸI™I iÓ0�	Ù ØÙØ )× 0Ñ 0°Ó 9�IØ’ð ùs   ƒAAzO'body' must be a bytes-like object, file-like object, or iterable. Instead was )rE   rF   )Úreturnztyping.Iterable[bytes])ÚupperÚ_METHODS_NOT_EXPECTING_BODYr#   r$   Úbytesr	   ÚlenÚhasattrÚ
memoryviewÚnbytesÚ	TypeErrorÚiterrD   )r7   ÚmethodrN   rE   rF   rO   Úmvs   ` `    r   Úbody_to_chunksr\   Ç   sù   ù€ ð$ €|ØˆØ�<‰<‹>Ô!<Ñ<Ø‰Nà!‰Nô 
�Dœ3¤˜,Ô	'Ü˜4“.Ð"ˆÜ˜V A™Y›‰ô 
��vÔ	ö		 ñ  Ó!ˆØ‰ð	'ä˜DÓ!ˆBð �WˆFØŸY™YˆNä!¨ÀÔOÐOøô ò 		ðä˜d›�Ø!%‘øÜò Üð8Ø8<°xðAóð ððúñ ð			ús*   Á2B Â	CÂ#B1Â0CÂ1C
Ã
CÃC)NNNNNN)r*   úbool | Noner+   zbool | list[str] | str | Noner,   ú
str | Noner-   r^   r.   r^   r/   r]   rP   zdict[str, str])r7   z
typing.Anyr8   ú_TYPE_BODY_POSITION | NonerP   r_   )r7   ztyping.IO[typing.AnyStr]r@   Ú_TYPE_BODY_POSITIONrP   ÚNone)r7   ztyping.Any | NonerZ   r$   rN   r=   rP   rD   )(Ú
__future__r   rK   ÚtypingÚbase64r   Úenumr   Ú
exceptionsr   Úutilr	   ÚTYPE_CHECKINGr
   ÚSKIP_HEADERÚ	frozensetÚSKIPPABLE_HEADERSr'   Ú
brotlicffiÚ_unused_module_brotliÚImportErrorÚbrotliÚcompressionr   Ú_unused_module_zstdÚ	zstandardr   r   r   rG   ÚUnionr=   r`   rR   r1   r9   r4   Ú
NamedTuplerD   r\   r   r   r   ú<module>ru      sË  ðÞ "ã 	Û Ý Ý å .Ý à	×ÒÝð "€ÙÒGÓHÐ à €ðð/Û2ð �uÑ€Oðõð �wÑ€Oô�tô ð (8×'=Ñ'=€Ð$Ó =à—l‘l 3Ð(8Ð#8Ñ9Ð ò WÐ ð #Ø59Ø!Ø!Ø#'Ø!%ðNØðNà2ðNð ðNð ð	Nð
 !ðNð ðNð óNðbØ
ðØ5ðàóó(
ô<˜V×.Ñ.ô ð
CPØ
ðCPØ%(ðCPØ58ðCPàôCPøð] ò /Ý.ð/ûàò 	Ùð	ûð ò ðÛ/à˜7Ñ"‰øØò Ùðüðús`   Á
C ÁC2 Ã	C$Ã!C' Ã#C$Ã$C' Ã'C/Ã.C/Ã2DÃ8	DÄDÄD
ÄDÄ	D
Ä
DÄD