
    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j        z  dej        fd            Zdeez  ej        z  dz  dej        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&dS )&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          |           n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    _/Users/shanyulin/my-agent/.venv/lib/python3.11/site-packages/telegram/_utils/argumentparsing.pyparse_sequence_argr   +   s     $5:::"$    c                     d S Nr   r   s    r   to_timedeltar   7   s    %(Sr   c                     d S r   r   r   s    r   r   r   ;   s	    
 Cr   c                 r    | dS 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<     {t#sU{## *}S))))Jr   disable_web_page_previewlink_preview_optionsc                 P    | 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.N)is_disabled)
ValueErrorr   )r$   r%   s     r   parse_lpo_and_dwppr)   S   sK       
$8 

 
 	

  +1>VWW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dS )r.   r   clsdatabot
Bot | Nonecredentialsr   r   c                     d S r   r   r0   r1   r2   r4   s       r   de_json_decryptedz"HasDecryptMethod.de_json_decryptedn   s	      Cr   .c                     d S 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                 6    | dS |                     | |          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"     |t;;tS!!!r   r4   r   c                 8    | dS |                     | ||          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&     |t  sK888r   c                 6    | dS |                     | |          S )zEWrapper around TO.de_list that returns an empty list if data is None.Nr   )de_listrC   s      r   de_list_optionalrJ      s"     |r;;tS!!!r   c                 8    | dS |                     | ||          S )zOWrapper around TO.de_list_decrypted that returns an empty list if data is None.Nr   )r9   rF   s       r   de_list_decrypted_optionalrL      s&     |r  sK8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      s  &      $ $ $ $ $ $ = = = = = = = = = = = = ; ; ; ; ; ; 3 3 3 3 3 3 4 4 4 4 4 4 4 4 .&&&&&&--------GCLL	%HQK$. 	%5C= 	% 	% 	% 	% 
 ( ( ( 
 ( 
ecm# 	]	   
cEkCM1D8 S]T=Q      "Tk AIJ\A]  !       $ ')>T
B
B
B/ATRRR ,, , , , ,8 , , _,("
T/" $W"4@"t^" " " "
9
T/
9	m	
9 

9 '(	
9
 T
9 
9 
9 
9"
x.4
"&*7m":F"
7C<" " " "
9
x.4

9	m	
9 

9 '(	
9
 =#
9 
9 
9 
9 
9 
9r   