
    YPi                        d Z ddlZddlZddlmZmZ  ed      Z ed      Z edej                        Z
dee
   d	ed
edee
eef   fdZ G d deej                        Z G d dej                        Z G d deej                        Zy)a  This module contains helper functions related to enums.

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)TypeVarUnion_A_B_Enum)boundenum_clsvaluedefaultreturnc                 6    	  | |      S # t         $ r |cY S w xY w)zTries to call ``enum_cls(value)`` to convert the value into an enumeration member.
    If that fails, the ``default`` is returned.
    )
ValueError)r	   r
   r   s      J/root/twitch_bot/venv/lib/python3.12/site-packages/telegram/_utils/enum.py
get_memberr   $   s%     s   
 c                   ,    e Zd ZdZdZdefdZdefdZy)
StringEnumzHelper class for string enums where ``str(member)`` prints the value, but ``repr(member)``
    gives ``EnumName.MEMBER_NAME``.
     r   c                 P    d| j                   j                   d| j                   dS N<.>	__class____name__nameselfs    r   __repr__zStringEnum.__repr__8   &    4>>**+1TYYKq99    c                 ,    t         j                  |       S N)str__str__r   s    r   r%   zStringEnum.__str__;   s    {{4  r!   Nr   
__module____qualname____doc__	__slots__r$   r   r%   r   r!   r   r   r   1   s&     I:# :! !r!   r   c                   L    e Zd ZdZdZdefdZej                  dk  rdefdZ	yy)IntEnumzHelper class for int enums where ``str(member)`` prints the value, but ``repr(member)``
    gives ``EnumName.MEMBER_NAME``.
    r   r   c                 P    d| j                   j                   d| j                   dS r   r   r   s    r   r   zIntEnum.__repr__G   r    r!   )      c                 ,    t        | j                        S r#   r$   r
   r   s    r   r%   zIntEnum.__str__L   s    tzz?"r!   N)
r   r'   r(   r)   r*   r$   r   sysversion_infor%   r   r!   r   r,   r,   @   s;     I:# : '!	#S 	# "r!   r,   c                   ,    e Zd ZdZdZdefdZdefdZy)	FloatEnumzHelper class for float enums where ``str(member)`` prints the value, but ``repr(member)``
    gives ``EnumName.MEMBER_NAME``.
    r   r   c                 P    d| j                   j                   d| j                   dS r   r   r   s    r   r   zFloatEnum.__repr__W   r    r!   c                 ,    t        | j                        S r#   r1   r   s    r   r%   zFloatEnum.__str__Z   s    4::r!   Nr&   r   r!   r   r5   r5   P   s&     I:# : r!   r5   )r)   enum_enumr2   typingr   r   r   r   Enumr   typer   r$   r   r,   floatr5   r   r!   r   <module>r>      s   &  
 !T]T]uzz*e R " ubRT}AU !ejj !#emm # uzz r!   