
    'i                        d Z ddlZddlmZ ddlmZmZmZm	Z	 ddl
mZ ddlmZ ddlmZmZ erddlmZ dd	lmZmZ  ed
      Zdee   dz  deedf   fdZe	d%d       Ze	deez  ej6                  z  dej6                  fd       Zdeez  ej6                  z  dz  dej6                  dz  fdZdedz  dee   dee   fdZ eded      Z eddd      Zere G d de             Z dedz  de!e   dddedz  fdZ"dedz  de!e   ddd e#d!   dedz  f
d"Z$de#e   dz  de!e   dddeedf   fd#Z%de#e   dz  de!e   ddd e#d!   deedf   f
d$Z&y)&a:  This module contains helper functions related to parsing arguments for classes and methods.

Warning:
    Contents of this module are intended to be used internally by the library and *not* by the
    user. Changes to this module are not considered breaking changes and may not be documented in
    the changelog.
    N)Sequence)TYPE_CHECKINGProtocolTypeVaroverload)LinkPreviewOptions)TelegramObject)JSONDictODVInput)type_check_only)BotFileCredentialsTargreturn.c                      | rt        |       S dS )zParses an optional sequence into a tuple

    Args:
        arg (:obj:`Sequence`): The sequence to parse.

    Returns:
        :obj:`Tuple`: The sequence converted to a tuple or an empty tuple.
     )tupler   s    i/home/obispo/Crisostomo_bridge/mision_env/lib/python3.12/site-packages/telegram/_utils/argumentparsing.pyparse_sequence_argr   +   s     5:$"$    c                      y Nr   r   s    r   to_timedeltar   7   s    %(r   c                      y r   r   r   s    r   r   r   ;   s    
 r   c                 f    | yt        | t        t        z        rt        j                  |       S | S )a  Parses an optional time period in seconds into a timedelta

    Args:
        arg (:obj:`int` | :class:`datetime.timedelta`, optional): The time period to parse.

    Returns:
        :obj:`timedelta`: The time period converted to a timedelta object or :obj:`None`.
    N)seconds)
isinstanceintfloatdtm	timedeltar   s    r   r   r   C   s.     {#sU{#}}S))Jr   disable_web_page_previewlink_preview_optionsc                 @    | r|rt        d      | t        |       }|S )zWrapper around warn_about_deprecated_arg_return_new_arg. Takes care of converting
    disable_web_page_preview to LinkPreviewOptions.
    zXParameters `disable_web_page_preview` and `link_preview_options` are mutually exclusive.)is_disabled)
ValueErrorr   )r$   r%   s     r   parse_lpo_and_dwppr)   S   s6      $8
 	

  +1>VWr   Tele_coT)bound	covariantTeleCrypto_coHasDecryptMethodc                       e Zd ZdZedee   deddded   def
d	       Z	edee   dee   ddded   de
ed
f   f
d       Zy)r.   r   clsdatabot
Bot | Nonecredentialsr   r   c                      y r   r   r0   r1   r2   r4   s       r   de_json_decryptedz"HasDecryptMethod.de_json_decryptedn   s      r   .c                      y r   r   r6   s       r   de_list_decryptedz"HasDecryptMethod.de_list_decryptedv   s     ),r   N)__name__
__module____qualname__	__slots__classmethodtyper-   r
   listr7   r   r9   r   r   r   r.   r.   j   s    			 m$	 	  	  /0		 
 	  
	  
	,m$	,x.	, 	, /0		,
 =#%&	, 
	,r   r1   r0   r2   r3   c                 ,    | y|j                  | |      S )z<Wrapper around TO.de_json that returns None if data is None.N)de_jsonr1   r0   r2   s      r   de_json_optionalrD      s     |;;tS!!r   r4   r   c                 .    | y|j                  | ||      S )zFWrapper around TO.de_json_decrypted that returns None if data is None.N)r7   r1   r0   r2   r4   s       r   de_json_decrypted_optionalrG      s!     |  sK88r   c                 ,    | y|j                  | |      S )zEWrapper around TO.de_list that returns an empty list if data is None.r   )de_listrC   s      r   de_list_optionalrJ      s     |;;tS!!r   c                 .    | y|j                  | ||      S )zOWrapper around TO.de_list_decrypted that returns an empty list if data is None.r   )r9   rF   s       r   de_list_decrypted_optionalrL      s!     |  sK88r   )r   Nr   N)'__doc__datetimer"   collections.abcr   typingr   r   r   r   telegram._linkpreviewoptionsr   telegram._telegramobjectr	   telegram._utils.typesr
   r   r   telegramr   r   r   r   r   r   r    r!   r#   boolr)   r*   r-   r.   r?   rD   r@   rG   rJ   rL   r   r   r   <module>rV      s8  &  $ = = ; 3 4&-CL	%HQK$. 	%5C= 	% 
 ( 
 ( 
ecmm# 	]]	 
cEkCMM1D8 S]]T=Q   "Tk AIJ\A]  ! $ )>T
B/ATR,8 , ,("
T/" $W"4@"t^"
9
T/
9	m	
9 

9 '(	
9
 T
9"
x.4
"&*7m":F"
7C<"
9
x.4

9	m	
9 

9 '(	
9
 =#
9r   