+
    ÁFñj�L  ã                   ó4  € R 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Ht ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHtHt ^ RIHt ^ RIHtHtHtHtH t H!t!H"t"H#t# ^ RI$H%t% ]! RRR7      t&]! ]'RR7      t( ! R R]R,          ]PR                  4      t*R# )zEThis module contains an abstract class to make POST and GET requests.N)ÚAbstractAsyncContextManager)Ú
HTTPStatus)ÚTracebackType)ÚFinalÚTypeVarÚfinal)ÚDEFAULT_NONE)ÚDefaultValue)Ú
get_logger)ÚTextEncoding)ÚJSONDictÚODVInput)Ú__version__)Ú
BadRequestÚChatMigratedÚConflictÚ	ForbiddenÚInvalidTokenÚNetworkErrorÚ
RetryAfterÚTelegramError)ÚRequestDataÚRTÚBaseRequest)Úbound)Ú
class_namec                   óÒ  a € ] tR t^3t o RtRtR] R2t ]t	 V 3R lR lt
V 3R lR lt]]P                  V 3R lR	 l4       4       t]P                  V 3R
 lR l4       t]P                  V 3R lR l4       t]R]	]	]	]	3V 3R lR ll4       t]]	]	]	]	3V 3R lR ll4       tR]	]	]	]	3V 3R lR llt]V 3R lR l4       t]P                  R]	]	]	]	3V 3R lR ll4       tV 3R ltRtV tR# )r   aç  Abstract interface class that allows python-telegram-bot to make requests to the Bot API.
Can be implemented via different asyncio HTTP libraries. An implementation of this class
must implement all abstract methods and properties.

Instances of this class can be used as asyncio context managers, where

.. code:: python

    async with request_object:
        # code

is roughly equivalent to

.. code:: python

    try:
        await request_object.initialize()
        # code
    finally:
        await request_object.shutdown()

.. seealso:: :meth:`__aenter__` and :meth:`__aexit__`.

Tip:
    JSON encoding and decoding is done with the standard library's :mod:`json` by default.
    To use a custom library for this, you can override :meth:`parse_json_payload` and implement
    custom logic to encode the keys of :attr:`telegram.request.RequestData.parameters`.

.. seealso:: :wiki:`Architecture Overview <Architecture>`,
    :wiki:`Builder Pattern <Builder-Pattern>`

.. versionadded:: 20.0
zpython-telegram-bot vz" (https://python-telegram-bot.org)c                ó&   <€ V ^8„  d   QhRS[ RS[ /# )é   ÚselfÚreturn)r   )ÚformatÚ__classdict__s   "€ÚS/opt/hermes-site/venv/lib/python3.14/site-packages/telegram/request/_baserequest.pyÚ__annotate__ÚBaseRequest.__annotate__j   s   ø€ ÷ ñ ™rð ¡bñ ó    c              ƒ  ó–   "  €  V P                  4       G Rj  x€L
  V #  L  \         d    T P                  4       G Rj  x€L 
  h i ; i5i)z÷|async_context_manager| :meth:`initializes <initialize>` the Request.

Returns:
    The initialized Request instance.

Raises:
    :exc:`Exception`: If an exception is raised during initialization, :meth:`shutdown`
        is called in this case.
N)Ú
initializeÚ	ExceptionÚshutdown©r   s   &r#   Ú
__aenter__ÚBaseRequest.__aenter__j   sF   é € ð	Ø—/‘/Ó#×#Ð#ð ˆñ	 $øÜô 	Ø—-‘-“/×!Ñ!Øð	üs/   ‚A	„  —˜  œA	ž   A¾A¿AÁA	c                ój   <€ V ^8„  d   QhRS[ S[,          R,          RS[R,          RS[R,          RR/# )r   Úexc_typeNÚexc_valÚexc_tbr    )ÚtypeÚBaseExceptionr   )r!   r"   s   "€r#   r$   r%   {   sG   ø€ ÷ 	ñ 	á‘}Õ%¨Õ,ð	ñ  Õ%ð	ñ  Õ$ð		ð
 
ñ	r&   c              ƒ  óB   "  € V P                  4       G Rj  x€L
  R#  L5i)zB|async_context_manager| :meth:`shuts down <shutdown>` the Request.N)r*   )r   r/   r0   r1   s   &&&&r#   Ú	__aexit__ÚBaseRequest.__aexit__{   s   é € ð �m‰m‹o×Ôùs   ‚–—c                ó.   <€ V ^8„  d   QhRS[ R,          /# ©r   r    N)Úfloat)r!   r"   s   "€r#   r$   r%   ˆ   s   ø€ ÷ ñ ™e d�lñ r&   c                ó   € R# )a¦  This property must return the default read timeout in seconds used by this class.
More precisely, the returned value should be the one used when
:paramref:`post.read_timeout` of :meth:post` is not passed/equal to :attr:`DEFAULT_NONE`.

.. versionadded:: 20.7
.. versionchanged:: 22.0
    This property is now required to be implemented by subclasses.

Returns:
    :obj:`float` | :obj:`None`: The read timeout in seconds.
N© r+   s   &r#   Úread_timeoutÚBaseRequest.read_timeout†   s   ‚ r&   c                ó   <€ V ^8„  d   QhRR/# r8   r;   )r!   r"   s   "€r#   r$   r%   –   s   ø€ ÷ Zñ Z $ñ Zr&   c              ƒ  ó   "  € R# 5i)zKInitialize resources used by this class. Must be implemented by a subclass.Nr;   r+   s   &r#   r(   ÚBaseRequest.initialize•   ó   é ‚ ùó   ‚c                ó   <€ V ^8„  d   QhRR/# r8   r;   )r!   r"   s   "€r#   r$   r%   š   s   ø€ ÷ \ñ \ ñ \r&   c              ƒ  ó   "  € R# 5i)zMStop & clear resources used by this class. Must be implemented by a subclass.Nr;   r+   s   &r#   r*   ÚBaseRequest.shutdown™   rA   rB   Nc                óÂ   <€ V ^8„  d   QhRS[ RS[R,          RS[S[,          RS[S[,          RS[S[,          RS[S[,          RS[S[S[,          ,          S[,          /# )	r   ÚurlÚrequest_dataNr<   Úwrite_timeoutÚconnect_timeoutÚpool_timeoutr    )Ústrr   r   r9   r   ÚlistÚbool)r!   r"   s   "€r#   r$   r%   ž   st   ø€ ÷ 4#ñ 4#áð4#ñ " DÕ(ð4#ñ ™u•oð	4#ñ
  ¡•ð4#ñ "¡%�ð4#ñ ™u•oð4#ñ 
‘D™•NÕ	"¡TÕ	)ñ4#r&   c           
   ƒ  ó‚   "  € V P                  VRVVVVVR7      G Rj  x€L
 pV P                  V4      pVR,          #  L5i)a�  Makes a request to the Bot API handles the return code and parses the answer.

Warning:
    This method will be called by the methods of :class:`telegram.Bot` and should *not* be
    called manually.

Args:
    url (:obj:`str`): The URL to request.
    request_data (:class:`telegram.request.RequestData`, optional): An object containing
        information about parameters and files to upload for the request.
    read_timeout (:obj:`float` | :obj:`None`, optional): If passed, specifies the maximum
        amount of time (in seconds) to wait for a response from Telegram's server instead
        of the time specified during creating of this object. Defaults to
        :attr:`DEFAULT_NONE`.
    write_timeout (:obj:`float` | :obj:`None`, optional): If passed, specifies the maximum
        amount of time (in seconds) to wait for a write operation to complete (in terms of
        a network socket; i.e. POSTing a request or uploading a file) instead of the time
        specified during creating of this object. Defaults to :attr:`DEFAULT_NONE`.
    connect_timeout (:obj:`float` | :obj:`None`, optional): If passed, specifies the
        maximum amount of time (in seconds) to wait for a connection attempt to a server
        to succeed instead of the time specified during creating of this object. Defaults
        to :attr:`DEFAULT_NONE`.
    pool_timeout (:obj:`float` | :obj:`None`, optional): If passed, specifies the maximum
        amount of time (in seconds) to wait for a connection to become available instead
        of the time specified during creating of this object. Defaults to
        :attr:`DEFAULT_NONE`.

Returns:
  The JSON response of the Bot API.

ÚPOST©rG   ÚmethodrH   r<   rI   rJ   rK   NÚresult)Ú_request_wrapperÚparse_json_payload)	r   rG   rH   r<   rI   rJ   rK   rS   Ú	json_datas	   &&&&&&&  r#   ÚpostÚBaseRequest.post�   s[   é € ðR ×,Ñ,ØØØ%Ø%Ø'Ø+Ø%ð -ó 
÷ 
ˆð ×+Ñ+¨FÓ3ˆ	ð ˜Õ"Ð"ñ
ùs   ‚?ž=Ÿ?c                ó~   <€ V ^8„  d   QhRS[ RS[S[,          RS[S[,          RS[S[,          RS[S[,          RS[/# )r   rG   r<   rI   rJ   rK   r    )rL   r   r9   Úbytes)r!   r"   s   "€r#   r$   r%   Õ   sW   ø€ ÷ ,
ñ ,
áð,
ñ ™u•oð,
ñ  ¡•ð	,
ñ
 "¡%�ð,
ñ ™u•oð,
ñ 
ñ,
r&   c           	   ƒ  óL   "  € V P                  VRVVVVR7      G Rj  x€L
 #  L5i)aÞ  Retrieve the contents of a file by its URL.

Warning:
    This method will be called by the methods of :class:`telegram.Bot` and should *not* be
    called manually.

Args:
    url (:obj:`str`): The web location we want to retrieve.
    read_timeout (:obj:`float` | :obj:`None`, optional): If passed, specifies the maximum
        amount of time (in seconds) to wait for a response from Telegram's server instead
        of the time specified during creating of this object. Defaults to
        :attr:`DEFAULT_NONE`.
    write_timeout (:obj:`float` | :obj:`None`, optional): If passed, specifies the maximum
        amount of time (in seconds) to wait for a write operation to complete (in terms of
        a network socket; i.e. POSTing a request or uploading a file) instead of the time
        specified during creating of this object. Defaults to :attr:`DEFAULT_NONE`.
    connect_timeout (:obj:`float` | :obj:`None`, optional): If passed, specifies the
        maximum amount of time (in seconds) to wait for a connection attempt to a server
        to succeed instead of the time specified during creating of this object. Defaults
        to :attr:`DEFAULT_NONE`.
    pool_timeout (:obj:`float` | :obj:`None`, optional): If passed, specifies the maximum
        amount of time (in seconds) to wait for a connection to become available instead
        of the time specified during creating of this object. Defaults to
        :attr:`DEFAULT_NONE`.

Returns:
    :obj:`bytes`: The files contents.

ÚGET)rG   rR   r<   rI   rJ   rK   N)rT   )r   rG   r<   rI   rJ   rK   s   &&&&&&r#   ÚretrieveÚBaseRequest.retrieveÔ   s<   é € ðL ×*Ñ*ØØØ%Ø'Ø+Ø%ð +ó 
÷ 
ð 	
ñ 
ùs   ‚$�"ž$c                ó˜   <€ V ^8„  d   QhRS[ RS[ RS[R,          RS[S[,          RS[S[,          RS[S[,          RS[S[,          R	S[/# ©
r   rG   rR   rH   Nr<   rI   rJ   rK   r    )rL   r   r   r9   rZ   )r!   r"   s   "€r#   r$   r%     sz   ø€ ÷ tñ táðtñ ðtñ " DÕ(ð	tñ
 ™u•oðtñ  ¡•ðtñ "¡%�ðtñ ™u•oðtñ 
ñtr&   c           
   ƒ  ó€  "  €  V P                  VVVVVVVR7      G Rj  x€L
 w  r‰\        P
                  Tu;8:  d
   R8:  d    T	#   \	        T4      P                   RT R2pRp T P                  T	4      pTP                  R4      ;'       g    TpTP                  R	4      pT'       dU   TP                  R
4      pT'       d   \        T4      hTP                  R4      pT'       d   \        T4      hTRT 2,          pT\        P                  8X  d   \        T4      pMŸT\        P                  \        P                  39   d   \!        T4      pMnT\        P"                  8X  d   \%        T4      pMMT\        P&                  8X  d   \)        T4      pM,T\        P*                  8X  d   \        T4      pM\        T4      pT'       d   TThTh EL­  \         d    h \         d   p
\        RT
: 24      T
hRp
?
ii ; i  \         d    RT R2p EL®i ; i  \         d   p
TRT	: R2,          pT
p Rp
?
EL7Rp
?
ii ; i5i)aÕ  Wraps the real implementation request method.

Performs the following tasks:
* Handle the various HTTP response codes.
* Parse the Telegram server response.

Args:
    url (:obj:`str`): The URL to request.
    method (:obj:`str`): HTTP method (i.e. 'POST', 'GET', etc.).
    request_data (:class:`telegram.request.RequestData`, optional): An object containing
        information about parameters and files to upload for the request.
    read_timeout (:obj:`float` | :obj:`None`, optional): If passed, specifies the maximum
        amount of time (in seconds) to wait for a response from Telegram's server instead
        of the time specified during creating of this object. Defaults to
        :attr:`DEFAULT_NONE`.
    write_timeout (:obj:`float` | :obj:`None`, optional): If passed, specifies the maximum
        amount of time (in seconds) to wait for a write operation to complete (in terms of
        a network socket; i.e. POSTing a request or uploading a file) instead of the time
        specified during creating of this object. Defaults to :attr:`DEFAULT_NONE`.
    connect_timeout (:obj:`float` | :obj:`None`, optional): If passed, specifies the
        maximum amount of time (in seconds) to wait for a connection attempt to a server
        to succeed instead of the time specified during creating of this object. Defaults
        to :attr:`DEFAULT_NONE`.
    pool_timeout (:obj:`float` | :obj:`None`, optional): If passed, specifies the maximum
        amount of time (in seconds) to wait for a connection to become available instead
        of the time specified during creating of this object. Defaults to
        :attr:`DEFAULT_NONE`.

Returns:
    bytes: The payload part of the HTTP server response.

Raises:
    TelegramError

rQ   Nz&Unknown error in HTTP implementation: i+  z (Ú)zUnknown HTTPError (ÚdescriptionÚ
parametersÚmigrate_to_chat_idÚretry_afterz4. The server response contained unknown parameters: z. Parsing the server response z failed)Ú
do_requestr   r)   r   r   ÚOKÚphraseÚ
ValueErrorrU   Úgetr   r   Ú	FORBIDDENr   Ú	NOT_FOUNDÚUNAUTHORIZEDr   ÚBAD_REQUESTr   ÚCONFLICTr   ÚBAD_GATEWAY)r   rG   rR   rH   r<   rI   rJ   rK   ÚcodeÚpayloadÚexcÚmessageÚparsing_exceptionÚresponse_datard   re   rf   Ú	exceptions   &&&&&&&&          r#   rT   ÚBaseRequest._request_wrapper  s<  é € ðZ	ZØ"&§/¡/ØØØ)Ø)Ø+Ø /Ø)ð #2ó #÷ ‰MˆDô �=‰=˜DÖ' CÕ'ð ˆNð (ð
	4Ü# DÓ)×0Ñ0Ð1°°D°6¸Ð;ˆGð 37Ðð	_Ø ×3Ñ3°GÓ<ˆMð
 $×'Ñ'¨Ó6×AÐA¸'ˆGð '×*Ñ*¨<Ó8ˆJßØ%/§^¡^Ð4HÓ%IÐ"ß%Ü&Ð'9Ó:Ð:Ø(Ÿn™n¨]Ó;�ßÜ$ [Ó1Ð1àÐQÐR\ÐQ]Ð^Õ^�à”:×'Ñ'Ô'Ü'0°Ó'9‰IØ”j×*Ñ*¬J×,CÑ,CÐDÔDô % WÓ-‰IØ”Z×+Ñ+Ô+Ü" 7Ó+‰IØ”Z×(Ñ(Ô(Ü  Ó)‰IØ”Z×+Ñ+Ô+Ü$ WÓ-‰Iä$ WÓ-ˆIçØÐ!2Ð2ØˆòMøô ô 	ØÜô 	ZÜÐ!GÈÁwÐOÓPÐVYÐYûð	Zûô ô 	4Ø+¨D¨6°Ð3‹Gð	4ûô ô 	$ØÐ7¸±{À'ÐJÕJˆGØ #Öûð	$üsª   ‚H>„G ŸG G ¦!H>ÁG= Á#H>Á&H Á7H>ÂH>Â+H>Ã#H>Ã(CH>ÇH>ÇG ÇG:Ç$G:Ç%G5Ç5G:Ç:H>Ç=HÈH>ÈHÈH>ÈH;È H6È0H>È6H;È;H>c                ó&   <€ V ^8„  d   QhRS[ RS[/# )r   rs   r    )rZ   r   )r!   r"   s   "€r#   r$   r%   z  s   ø€ ÷ Dñ D¡Eð D©hñ Dr&   c                óÚ   € V P                  \        P                  R4      p \        P                  ! V4      #   \
         d(   p\        P                  RT4       \        R4      ThRp?ii ; i)aÄ  Parse the JSON returned from Telegram.

Tip:
    By default, this method uses the standard library's :func:`json.loads` and
    ``errors="replace"`` in :meth:`bytes.decode`.
    You can override it to customize either of these behaviors.

Args:
    payload (:obj:`bytes`): The UTF-8 encoded JSON payload as returned by Telegram.

Returns:
    dict: A JSON parsed as Python dict with results.

Raises:
    TelegramError: If loading the JSON data failed
Úreplacez$Can not load invalid JSON data: "%s"zInvalid server responseN)	Údecoder   ÚUTF_8ÚjsonÚloadsrj   Ú_LOGGERrx   r   )rs   Ú	decoded_srt   s   &  r#   rU   ÚBaseRequest.parse_json_payloady  s`   € ð$ —N‘N¤<×#5Ñ#5°yÓAˆ	ð	DÜ—:’:˜iÓ(Ð(øÜô 	DÜ×ÑÐDÀiÔPÜÐ 9Ó:ÀÐCûð	Dús   ¢8 ¸A*Á"A%Á%A*c                ó®   <€ V ^8„  d   QhRS[ RS[ RS[R,          RS[S[,          RS[S[,          RS[S[,          RS[S[,          R	S[S[S[3,          /# r`   )rL   r   r   r9   ÚtupleÚintrZ   )r!   r"   s   "€r#   r$   r%   “  sy   ø€ ÷ )ñ )áð)ñ ð)ñ " DÕ(ð	)ñ
 ™u•oð)ñ  ¡•ð)ñ "¡%�ð)ñ ™u•oð)ñ 
‰s‘EˆzÕ	ñ)r&   c              ƒ  ó   "  € R# 5i)a  Makes a request to the Bot API. Must be implemented by a subclass.

Warning:
    This method will be called by :meth:`post` and :meth:`retrieve`. It should *not* be
    called manually.

Args:
    url (:obj:`str`): The URL to request.
    method (:obj:`str`): HTTP method (i.e. ``'POST'``, ``'GET'``, etc.).
    request_data (:class:`telegram.request.RequestData`, optional): An object containing
        information about parameters and files to upload for the request.
    read_timeout (:obj:`float` | :obj:`None`, optional): If passed, specifies the maximum
        amount of time (in seconds) to wait for a response from Telegram's server instead
        of the time specified during creating of this object. Defaults to
        :attr:`DEFAULT_NONE`.
    write_timeout (:obj:`float` | :obj:`None`, optional): If passed, specifies the maximum
        amount of time (in seconds) to wait for a write operation to complete (in terms of
        a network socket; i.e. POSTing a request or uploading a file) instead of the time
        specified during creating of this object. Defaults to :attr:`DEFAULT_NONE`.
    connect_timeout (:obj:`float` | :obj:`None`, optional): If passed, specifies the
        maximum amount of time (in seconds) to wait for a connection attempt to a server
        to succeed instead of the time specified during creating of this object. Defaults
        to :attr:`DEFAULT_NONE`.
    pool_timeout (:obj:`float` | :obj:`None`, optional): If passed, specifies the maximum
        amount of time (in seconds) to wait for a connection to become available instead
        of the time specified during creating of this object. Defaults to
        :attr:`DEFAULT_NONE`.

Returns:
    tuple[:obj:`int`, :obj:`bytes`]: The HTTP return code & the payload part of the server
    response.
Nr;   )r   rG   rR   rH   r<   rI   rJ   rK   s   &&&&&&&&r#   rg   ÚBaseRequest.do_request’  rA   rB   c                ó`   <€ V ^8„  d   Qh/ S[ S[,          ;R&   S[ S[R,          ,          ;R&   # )r   Ú
USER_AGENTNr   )r   rL   r	   )r!   r"   s   "€r#   r$   r%   3   s1   ø‡ ‚ ñP ‘c•
Ñ`ñQ ñV ™ TÕ*Õ+Ñ;òW r&   r;   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú	__slots__Úptb_verrŠ   Ú_DEFAULT_NONEr   r,   r5   ÚpropertyÚabcÚabstractmethodr<   r(   r*   r   rW   r]   rT   ÚstaticmethodrU   rg   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__)r"   s   @r#   r   r   3   s]  ø‡ € ñ ðD €Ià4°W°IÐ=_Ð`€Jðà.;€Lð	÷ð ÷"	ð 	ð Ø×Ñ÷ó ó ðð 	×Ñ÷Zó ðZð 	×Ñ÷\ó ð\ð ð ,0Ø(4Ø)5Ø+7Ø(4÷4#ñ 4#ó ð4#ðl ð )5Ø)5Ø+7Ø(4÷,
ñ ,
ó ð,
ðd ,0Ø(4Ø)5Ø+7Ø(4÷tò tðl ÷Dó ðDð0 	×Ñð
 ,0Ø(4Ø)5Ø+7Ø(4÷)ñ )ó ð)÷A ƒ r&   )+r�   r”   r   Ú
contextlibr   Úhttpr   Útypesr   Útypingr   r   r   Útelegram._utils.defaultvaluer   r’   r	   Útelegram._utils.loggingr
   Útelegram._utils.stringsr   Útelegram._utils.typesr   r   Útelegram._versionr   r‘   Útelegram.errorr   r   r   r   r   r   r   r   Útelegram.request._requestdatar   r   r‹   r�   ÚABCr   r;   r&   r#   Ú<module>r¦      sy   ðñ& Lã 
Û Ý 2Ý Ý ß (Ñ (å FÝ 5Ý .Ý 0ß 4Ý 4÷	÷ 	ó 	õ 6áˆT˜Ô'€á
�X¨-Ô
8€ôIØ Õ.Ø‡G�GöIr&   