§
    ¬eîiÅ  ã                   óŒ   — d Z ddlmZ ddlmZ ddlmZ dededefd„Z	 dded
ee         dee         d	z  de	eef         fd„Z
d	S )a.  This module contains auxiliary functionality for parsing MessageEntity objects.

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.
é    )ÚSequence)ÚMessageEntity)ÚTextEncodingÚtextÚentityÚreturnc                 óÂ   — |                       t          j        ¦  «        }||j        dz  |j        |j        z   dz  …         }|                     t          j        ¦  «        S )a%  Returns the text from a given :class:`telegram.MessageEntity`.

    Args:
        text (:obj:`str`): The text to extract the entity from.
        entity (:class:`telegram.MessageEntity`): The entity to extract the text from.

    Returns:
        :obj:`str`: The text of the given entity.
    é   )Úencoder   Ú	UTF_16_LEÚoffsetÚlengthÚdecode)r   r   Úentity_texts      ú\/home/div/.hermes/hermes-agent/venv/lib/python3.11/site-packages/telegram/_utils/entities.pyÚparse_message_entityr   !   sT   € ð —+’+�lÔ4Ñ5Ô5€KØ˜fœm¨aÑ/°6´=À6Ä=Ñ3PÐTUÑ2UÐUÔV€Kà×Ò�lÔ4Ñ5Ô5Ð5ó    NÚentitiesÚtypesc                 ó@   ‡ ‡— ‰€t           j        Šˆ ˆfd„|D ¦   «         S )aS  
    Returns a :obj:`dict` that maps :class:`telegram.MessageEntity` to :obj:`str`.
    It contains entities filtered by their ``type`` attribute as
    the key, and the text that each entity belongs to as the value of the :obj:`dict`.

    Args:
        text (:obj:`str`): The text to extract the entity from.
        entities (list[:class:`telegram.MessageEntity`]): The entities to extract the text from.
        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.
    Nc                 óD   •— i | ]}|j         ‰v ¯|t          ‰|¦  «        “ŒS © )Útyper   )Ú.0r   r   r   s     €€r   ú
<dictcomp>z*parse_message_entities.<locals>.<dictcomp>G   s:   ø€ ð ð ð Ø7=ÈVÌ[Ð\aÐMaÐMaˆÕ$ T¨6Ñ2Ô2ÐMaÐMaÐMar   )r   Ú	ALL_TYPES)r   r   r   s   ` `r   Úparse_message_entitiesr   1   sC   øø€ ð& €}ÝÔ'ˆðð ð ð ð ØAIðñ ô ð r   )N)Ú__doc__Úcollections.abcr   Útelegram._messageentityr   Útelegram._utils.stringsr   Ústrr   Údictr   r   r   r   ú<module>r$      sÒ   ðð&ð ð %Ð $Ð $Ð $Ð $Ð $à 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0ð6˜sð 6¨Mð 6¸cð 6ð 6ð 6ð 6ð" QUðð Ø
ðØ! -Ô0ðØ9AÀ#¼ÈÑ9Mðà	ˆ-˜Ð
Ôðð ð ð ð ð r   