Ë
    †jFQ  ã                   óþ   — d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZmZmZ dd	lmZmZ dd
lmZ erddlmZ  G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Zy)z:This module contains classes related to gifs sent by bots.é    )ÚSequence)ÚTYPE_CHECKING)ÚChat)ÚSticker)ÚMessageEntity)ÚTelegramObject)Úde_json_optionalÚde_list_optionalÚparse_sequence_arg)Úparse_message_entitiesÚparse_message_entity)ÚJSONDict)ÚBotc            
       óD   ‡ — e Zd ZdZdZddœdededededz  fˆ fd	„Zˆ xZS )
ÚGiftBackgrounda  This object describes the background of a gift.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal if their :attr:`center_color`, :attr:`edge_color` and :attr:`text_color` are
    equal.

    .. versionadded:: 22.6

    Args:
        center_color (:obj:`int`): Center color of the background in RGB format.
        edge_color (:obj:`int`): Edge color of the background in RGB format.
        text_color (:obj:`int`): Text color of the background in RGB format.

    Attributes:
        center_color (:obj:`int`): Center color of the background in RGB format.
        edge_color (:obj:`int`): Edge color of the background in RGB format.
        text_color (:obj:`int`): Text color of the background in RGB format.

    )Úcenter_colorÚ
edge_colorÚ
text_colorN©Ú
api_kwargsr   r   r   r   c                óÀ   •— t         ‰| �  |¬«       || _        || _        || _        | j                  | j                  | j                  f| _        | j                  «        y ©Nr   )ÚsuperÚ__init__r   r   r   Ú	_id_attrsÚ_freeze)Úselfr   r   r   r   Ú	__class__s        €úN/var/www/html/datingFans/myenv/lib/python3.12/site-packages/telegram/_gifts.pyr   zGiftBackground.__init__@   sX   ø€ ô 	‰Ñ JÐÔ/Ø!-ˆÔØ)ˆŒØ)ˆŒð ×ÑØ�O‰OØ�O‰Oð
ˆŒð 	�‰�ó    )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__Úintr   r   Ú__classcell__©r   s   @r   r   r   %   sH   ø„ ñð(€Ið '+òàðð ðð ð	ð ˜t‘O÷ñ r    r   c                   óâ   ‡ — e Zd ZdZdZ	 	 	 	 	 	 	 	 	 	 dddœdededededz  d	edz  d
edz  dedz  dedz  dedz  de	dz  de
dz  de
dz  dedz  dedz  fˆ fd„Zeddedddd fˆ fd„«       Zˆ xZS )ÚGiftak  This object represents a gift that can be sent by the bot.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal if their :attr:`id` is equal.

    .. versionadded:: 21.8

    Args:
        id (:obj:`str`): Unique identifier of the gift.
        sticker (:class:`~telegram.Sticker`): The sticker that represents the gift.
        star_count (:obj:`int`): The number of Telegram Stars that must be paid to send the
            sticker.
        total_count (:obj:`int`, optional): The total number of the gifts of this type that can be
            sent by all users; for limited gifts only.
        remaining_count (:obj:`int`, optional): The number of remaining gifts of this type that can
            be sent by all users; for limited gifts only.
        upgrade_star_count (:obj:`int`, optional): The number of Telegram Stars that must be paid
            to upgrade the gift to a unique one.

            .. versionadded:: 21.10
        publisher_chat (:class:`telegram.Chat`, optional): Information about the chat that
            published the gift.

            .. versionadded:: 22.4
        personal_total_count (:obj:`int`, optional): The total number of gifts of this type that
            can be sent by the bot; for limited gifts only.

            .. versionadded:: 22.6
        personal_remaining_count (:obj:`int`, optional): The number of remaining gifts of this type
            that can be sent by the bot; for limited gifts only.

            .. versionadded:: 22.6
        background (:class:`GiftBackground`, optional): Background of the gift.

            .. versionadded:: 22.6
        is_premium (:obj:`bool`, optional): :obj:`True`, if the gift can only be purchased by
            Telegram Premium subscribers.

            .. versionadded:: 22.6
        has_colors (:obj:`bool`, optional): :obj:`True`, if the gift can be used (after being
            upgraded) to customize a user's appearance.

            .. versionadded:: 22.6
        unique_gift_variant_count (:obj:`int`, optional): The total number of different unique
            gifts that can be obtained by upgrading the gift.

            .. versionadded:: 22.6

    Attributes:
        id (:obj:`str`): Unique identifier of the gift.
        sticker (:class:`~telegram.Sticker`): The sticker that represents the gift.
        star_count (:obj:`int`): The number of Telegram Stars that must be paid to send the
            sticker.
        total_count (:obj:`int`): Optional. The total number of the gifts of this type that can be
            sent by all users; for limited gifts only.
        remaining_count (:obj:`int`): Optional. The number of remaining gifts of this type that can
            be sent by all users; for limited gifts only.
        upgrade_star_count (:obj:`int`): Optional. The number of Telegram Stars that must be paid
            to upgrade the gift to a unique one.

            .. versionadded:: 21.10
        publisher_chat (:class:`telegram.Chat`): Optional. Information about the chat that
            published the gift.

            .. versionadded:: 22.4
        personal_total_count (:obj:`int`): Optional. The total number of gifts of this type that
            can be sent by the bot; for limited gifts only.

            .. versionadded:: 22.6
        personal_remaining_count (:obj:`int`): Optional. The number of remaining gifts of this type
            that can be sent by the bot; for limited gifts only.

            .. versionadded:: 22.6
        background (:class:`GiftBackground`): Optional. Background of the gift.

            .. versionadded:: 22.6
        is_premium (:obj:`bool`): Optional. :obj:`True`, if the gift can only be purchased by
            Telegram Premium subscribers.

            .. versionadded:: 22.6
        has_colors (:obj:`bool`): Optional. :obj:`True`, if the gift can be used (after being
            upgraded) to customize a user's appearance.

            .. versionadded:: 22.6
        unique_gift_variant_count (:obj:`int`): Optional. The total number of different unique
            gifts that can be obtained by upgrading the gift.

            .. versionadded:: 22.6

    )Ú
backgroundÚ
has_colorsÚidÚ
is_premiumÚpersonal_remaining_countÚpersonal_total_countÚpublisher_chatÚremaining_countÚ
star_countÚstickerÚtotal_countÚunique_gift_variant_countÚupgrade_star_countNr   r-   r4   r3   r5   r2   r7   r1   r0   r/   r+   r.   r,   r6   r   c                ó   •— t         ‰| �  |¬«       || _        || _        || _        || _        || _        || _        || _        || _	        |	| _
        |
| _        || _        || _        || _        | j                  f| _        | j!                  «        y r   )r   r   r-   r4   r3   r5   r2   r7   r1   r0   r/   r+   r.   r,   r6   r   r   )r   r-   r4   r3   r5   r2   r7   r1   r0   r/   r+   r.   r,   r6   r   r   s                  €r   r   zGift.__init__Â   s�   ø€ ô$ 	‰Ñ JÐÔ/ØˆŒØ 'ˆŒØ)ˆŒØ'2ˆÔØ+:ˆÔØ.@ˆÔØ+9ˆÔØ0DˆÔ!Ø4LˆÔ%Ø1;ˆŒØ'1ˆŒØ'1ˆŒØ5NˆÔ&àŸ'™'˜ˆŒà�‰�r    ÚdataÚbotú
Bot | NoneÚreturnc                 ó  •— | j                  |«      }t        |j                  d«      t        |«      |d<   t        |j                  d«      t        |«      |d<   t        |j                  d«      t
        |«      |d<   t        ‰| �  ||¬«      S )ú,See :meth:`telegram.TelegramObject.de_json`.r4   r1   r+   ©r9   r:   )Ú_parse_datar	   Úgetr   r   r   r   Úde_json©Úclsr9   r:   r   s      €r   rB   zGift.de_jsonç   s}   ø€ ð �‰˜tÓ$ˆä*¨4¯8©8°IÓ+>ÄÈÓMˆˆY‰Ü!1°$·(±(Ð;KÓ2LÌdÐTWÓ!XˆÐÑÜ-¨d¯h©h°|Ó.DÄnÐVYÓZˆˆ\ÑÜ‰w‰ D¨cˆÓ2Ð2r    )
NNNNNNNNNN©N)r!   r"   r#   r$   r%   Ústrr   r&   r   r   Úboolr   r   ÚclassmethodrB   r'   r(   s   @r   r*   r*   V   s!  ø„ ñYðv€Ið* #'Ø&*Ø)-Ø&*Ø+/Ø/3Ø,0Ø"&Ø"&Ø04ð#ð  '+ò!#àð#ð ð#ð ð	#ð
 ˜4‘Zð#ð ˜t™ð#ð   $™Jð#ð ˜t™ð#ð " D™jð#ð #&¨¡*ð#ð # TÑ)ð#ð ˜4‘Kð#ð ˜4‘Kð#ð $'¨¡:ð#ð  ˜t‘Oõ!#ðJ ñ3˜8ð 3¨,ð 3À&ô 3ó ô3r    r*   c                   óf   ‡ — e Zd ZdZdZddœdee   dedz  fˆ fd„Ze	dded	d
dd fˆ fd„«       Z
ˆ xZS )ÚGiftsav  This object represent a list of gifts.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal if their :attr:`gifts` are equal.

    .. versionadded:: 21.8

    Args:
        gifts (Sequence[:class:`Gift`]): The sequence of gifts.

    Attributes:
        gifts (tuple[:class:`Gift`]): The sequence of gifts.

    )ÚgiftsNr   rK   r   c                óŠ   •— t         ‰| �  |¬«       t        |«      | _        | j                  f| _        | j                  «        y r   )r   r   r   rK   r   r   )r   rK   r   r   s      €r   r   zGifts.__init__  s7   ø€ ô 	‰Ñ JÐÔ/Ü'9¸%Ó'@ˆŒ
àŸ*™*˜ˆŒà�‰�r    r9   r:   r;   r<   c                 óŽ   •— | j                  |«      }t        |j                  d«      t        |«      |d<   t        ‰| �  ||¬«      S )r>   rK   r?   )r@   r
   rA   r*   r   rB   rC   s      €r   rB   zGifts.de_json  sA   ø€ ð �‰˜tÓ$ˆä(¨¯©°'Ó):¼DÀ#ÓFˆˆW‰Ü‰w‰ D¨cˆÓ2Ð2r    rE   )r!   r"   r#   r$   r%   r   r*   r   r   rH   rB   r'   r(   s   @r   rJ   rJ   ò   s\   ø„ ñð €Ið '+ò	à˜‰~ðð ˜t‘Oõ	ð ñ3˜8ð 3¨,ð 3À'ô 3ó ô3r    rJ   c                   ó  ‡ — e Zd ZdZdZ	 	 	 	 	 	 	 	 	 dddœdededz  dedz  dedz  d	edz  d
edz  de	e
   dz  dedz  dedz  dedz  dedz  fˆ fd„Zeddedddd fˆ fd„«       Zde
defd„Zddee   dz  dee
ef   fd„Zˆ xZS )ÚGiftInfoa¿  Describes a service message about a regular gift that was sent or received.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal if their :attr:`gift` is equal.

    .. versionadded:: 22.1

    Args:
        gift (:class:`Gift`): Information about the gift.
        owned_gift_id (:obj:`str`, optional): Unique identifier of the received gift for the bot;
            only present for gifts received on behalf of business accounts.
        convert_star_count (:obj:`int`, optional) Number of Telegram Stars that can be claimed by
            the receiver by converting the gift; omitted if conversion to Telegram Stars
            is impossible.
        prepaid_upgrade_star_count (:obj:`int`, optional): Number of Telegram Stars that were
            prepaid for the ability to upgrade the gift.
        can_be_upgraded (:obj:`bool`, optional): :obj:`True`, if the gift can be upgraded
            to a unique gift.
        text (:obj:`str`, optional): Text of the message that was added to the gift.
        entities (Sequence[:class:`telegram.MessageEntity`], optional): Special entities that
            appear in the text.
        is_private (:obj:`bool`, optional): :obj:`True`, if the sender and gift text are
            shown only to the gift receiver; otherwise, everyone will be able to see them.
        is_upgrade_separate (:obj:`bool`, optional): :obj:`True`, if the gift's upgrade was
            purchased after the gift was sent.

            .. versionadded:: 22.6
        unique_gift_number (:obj:`int`, optional): Unique number reserved for this gift when
            upgraded. See the number field in :class:`~telegram.UniqueGift`.

            .. versionadded:: 22.6

    Attributes:
        gift (:class:`Gift`): Information about the gift.
        owned_gift_id (:obj:`str`): Optional. Unique identifier of the received gift for the bot;
            only present for gifts received on behalf of business accounts.
        convert_star_count (:obj:`int`): Optional. Number of Telegram Stars that can be claimed by
            the receiver by converting the gift; omitted if conversion to Telegram Stars
            is impossible.
        prepaid_upgrade_star_count (:obj:`int`): Optional. Number of Telegram Stars that were
            prepaid for the ability to upgrade the gift.
        can_be_upgraded (:obj:`bool`): Optional. :obj:`True`, if the gift can be upgraded
            to a unique gift.
        text (:obj:`str`): Optional. Text of the message that was added to the gift.
        entities (Sequence[:class:`telegram.MessageEntity`]): Optional. Special entities that
            appear in the text.
        is_private (:obj:`bool`): Optional. :obj:`True`, if the sender and gift text are
            shown only to the gift receiver; otherwise, everyone will be able to see them.
        is_upgrade_separate (:obj:`bool`): Optional. :obj:`True`, if the gift's upgrade was
            purchased after the gift was sent.

            .. versionadded:: 22.6
        unique_gift_number (:obj:`int`): Optional. Unique number reserved for this gift when
            upgraded. See the number field in :class:`~telegram.UniqueGift`.

            .. versionadded:: 22.6

    )
Úcan_be_upgradedÚconvert_star_countÚentitiesÚgiftÚ
is_privateÚis_upgrade_separateÚowned_gift_idÚprepaid_upgrade_star_countÚtextÚunique_gift_numberNr   rS   rV   rQ   rW   rP   rX   rR   rT   rY   rU   r   c                ó  •— t         ‰| �  |¬«       || _        || _        || _        || _        || _        || _        t        |«      | _	        || _
        |	| _        |
| _        | j                  f| _        | j                  «        y r   )r   r   rS   rV   rQ   rW   rP   rX   r   rR   rT   rY   rU   r   r   )r   rS   rV   rQ   rW   rP   rX   rR   rT   rY   rU   r   r   s               €r   r   zGiftInfo.__init__c  s|   ø€ ô 	‰Ñ JÐÔ/àˆŒ	à)6ˆÔØ.@ˆÔØ6PˆÔ'Ø,;ˆÔØ $ˆŒ	Ü3EÀhÓ3OˆŒØ'1ˆŒØ.@ˆÔØ0CˆÔ àŸ)™)˜ˆŒà�‰�r    r9   r:   r;   r<   c                 óÔ   •— | j                  |«      }t        |j                  d«      t        |«      |d<   t	        |j                  d«      t
        |«      |d<   t        ‰| �  ||¬«      S )r>   rS   rR   r?   )r@   r	   rA   r*   r
   r   r   rB   rC   s      €r   rB   zGiftInfo.de_json„  s^   ø€ ð �‰˜tÓ$ˆä'¨¯©°Ó(8¼$ÀÓDˆˆV‰Ü+¨D¯H©H°ZÓ,@Ä-ÐQTÓUˆˆZÑä‰w‰ D¨cˆÓ2Ð2r    Úentityc                 ó\   — | j                   st        d«      ‚t        | j                   |«      S )aÔ  Returns the text in :attr:`text`
        from a given :class:`telegram.MessageEntity` of :attr:`entities`.

        Note:
            This method is present because Telegram calculates the offset and length in
            UTF-16 codepoint pairs, which some versions of Python don't handle automatically.
            (That is, you can't just slice ``Message.text`` with the offset and length.)

        Args:
            entity (:class:`telegram.MessageEntity`): The entity to extract the text from. It must
                be an entity that belongs to :attr:`entities`.

        Returns:
            :obj:`str`: The text of the given entity.

        Raises:
            RuntimeError: If the gift info has no text.

        úThis GiftInfo has no 'text'.)rX   ÚRuntimeErrorr   )r   r\   s     r   Úparse_entityzGiftInfo.parse_entityŽ  s(   € ð( �yŠyÜÐ=Ó>Ð>ä# D§I¡I¨vÓ6Ð6r    Útypesc                 ór   — | j                   st        d«      ‚t        | j                   | j                  |«      S )aO  
        Returns a :obj:`dict` that maps :class:`telegram.MessageEntity` to :obj:`str`.
        It contains entities from this gift info's text filtered by their ``type`` attribute as
        the key, and the text that each entity belongs to as the value of the :obj:`dict`.

        Note:
            This method should always be used instead of the :attr:`entities`
            attribute, since it calculates the correct substring from the message text based on
            UTF-16 codepoints. See :attr:`parse_entity` for more info.

        Args:
            types (list[:obj:`str`], optional): List of ``MessageEntity`` types as strings. If the
                    ``type`` attribute of an entity is contained in this list, it will be returned.
                    Defaults to :attr:`telegram.MessageEntity.ALL_TYPES`.

        Returns:
            dict[:class:`telegram.MessageEntity`, :obj:`str`]: A dictionary of entities mapped to
            the text that belongs to them, calculated based on UTF-16 codepoints.

        Raises:
            RuntimeError: If the gift info has no text.

        r^   )rX   r_   r   rR   )r   ra   s     r   Úparse_entitieszGiftInfo.parse_entities§  s.   € ð0 �yŠyÜÐ=Ó>Ð>ä% d§i¡i°·±ÀÓFÐFr    )	NNNNNNNNNrE   )r!   r"   r#   r$   r%   r*   rF   r&   rG   r   r   r   r   rH   rB   r`   ÚlistÚdictrc   r'   r(   s   @r   rO   rO     s=  ø„ ñ9ðv€Ið  %)Ø)-Ø15Ø'+ØØ37Ø"&Ø)-Ø+/ðð '+òàðð ˜T‘zðð   $™Jð	ð
 %(¨$¡Jðð  ™ðð �D‰jðð ˜=Ñ)¨DÑ0ðð ˜4‘Kðð   $™Jðð " D™[ðð ˜t‘OõðB ñ3˜8ð 3¨,ð 3À*ô 3ó ð3ð7 =ð 7°Só 7ñ2G D¨¡I°Ñ$4ð GÀÀ]ÐTWÐEWÑ@X÷ Gr    rO   c                   óL   ‡ — e Zd ZdZdZddœdedededed	ed
edz  fˆ fd„Zˆ xZS )ÚAcceptedGiftTypesaÂ  This object describes the types of gifts that can be gifted to a user or a chat.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal if their :attr:`unlimited_gifts`, :attr:`limited_gifts`,
    :attr:`unique_gifts`, :attr:`premium_subscription` and :attr:`gifts_from_channels` are equal.

    .. versionadded:: 22.1
    .. versionchanged:: 22.6
        :attr:`gifts_from_channels` is now considered for equality checks.

    Args:
        unlimited_gifts (:class:`bool`): :obj:`True`, if unlimited regular gifts are accepted.
        limited_gifts (:class:`bool`): :obj:`True`, if limited regular gifts are accepted.
        unique_gifts (:class:`bool`): :obj:`True`, if unique gifts or gifts that can be upgraded
            to unique for free are accepted.
        premium_subscription (:class:`bool`): :obj:`True`, if a Telegram Premium subscription
            is accepted.
        gifts_from_channels (:obj:`bool`): :obj:`True`, if transfers of unique gifts from channels
            are accepted

            .. versionadded:: 22.6

    Attributes:
        unlimited_gifts (:class:`bool`): :obj:`True`, if unlimited regular gifts are accepted.
        limited_gifts (:class:`bool`): :obj:`True`, if limited regular gifts are accepted.
        unique_gifts (:class:`bool`): :obj:`True`, if unique gifts or gifts that can be upgraded
            to unique for free are accepted.
        premium_subscription (:class:`bool`): :obj:`True`, if a Telegram Premium subscription
            is accepted.
        gifts_from_channels (:obj:`bool`): :obj:`True`, if transfers of unique gifts from channels
            are accepted

            .. versionadded:: 22.6

    )Úgifts_from_channelsÚlimited_giftsÚpremium_subscriptionÚunique_giftsÚunlimited_giftsNr   rl   ri   rk   rj   rh   r   c                ó  •— t         ‰| �  |¬«       || _        || _        || _        || _        || _        | j                  | j                  | j                  | j
                  | j                  f| _        | j                  «        y r   )	r   r   rl   ri   rk   rj   rh   r   r   )r   rl   ri   rk   rj   rh   r   r   s          €r   r   zAcceptedGiftTypes.__init__ò  s€   ø€ ô 	‰Ñ JÐÔ/Ø%4ˆÔØ#0ˆÔØ".ˆÔØ*>ˆÔ!Ø)<ˆÔ ð × Ñ Ø×ÑØ×ÑØ×%Ñ%Ø×$Ñ$ð
ˆŒð 	�‰�r    )	r!   r"   r#   r$   r%   rG   r   r   r'   r(   s   @r   rg   rg   Å  s]   ø„ ñ"ðH€Ið  '+òàðð ðð ð	ð
 #ðð "ðð ˜t‘O÷ñ r    rg   N)r$   Úcollections.abcr   Útypingr   Útelegram._chatr   Útelegram._files.stickerr   Útelegram._messageentityr   Útelegram._telegramobjectr   Útelegram._utils.argumentparsingr	   r
   r   Útelegram._utils.entitiesr   r   Útelegram._utils.typesr   Útelegramr   r   r*   rJ   rO   rg   © r    r   ú<module>ry      sw   ðñ( Aå $Ý  å Ý +Ý 1Ý 3ß bÑ bß QÝ *áÝô.�^ô .ôbY3ˆ>ô Y3ôx%3ˆNô %3ôPhGˆ~ô hGôVF˜õ Fr    