File: D:/Python311/Lib/site-packages/pip/_vendor/rich/__pycache__/emoji.cpython-311.pyc
�
�mi? � � � d dl Z d dlmZmZmZmZ ddlmZ ddlm Z ddl
mZ ddlm
Z
ddlmZ er
dd lmZmZmZ ed
Z G d� de� � Z G d
� de� � Zedk r�d dl Z d dlmZ d dlmZ ed�� � Z ed� e e
j � � � � D � � d�� � Ze� e� � ee j � � dk r$e�! e j d � � dS dS dS )� N)�
TYPE_CHECKING�Optional�Union�Literal� )�JupyterMixin)�Segment)�Style)�EMOJI��_emoji_replace)�Console�ConsoleOptions�RenderResult)�emoji�textc � � e Zd ZdZdS )�NoEmojizNo emoji by that name.N)�__name__�
__module__�__qualname__�__doc__� � �8D:\Python311\Lib\site-packages\pip/_vendor/rich/emoji.pyr r s � � � � � � � � � r r c � � e Zd Zg d�Zddd�Z ddedeeef d ee d
dfd�Z
eded
efd
�� � Zd
efd�Z
d
efd�Z dd�ZdS )�Emoji)�name�style�_char�variantu ︎u ️)r r �noneNr r r! �returnc �� � || _ || _ || _ t | | _ n # t
$ r t
d|��� � �w xY w|�+| xj | j � |d� � z
c_ dS dS )z�A single emoji character.
Args:
name (str): Name of emoji.
style (Union[str, Style], optional): Optional style. Defaults to None.
Raises:
NoEmoji: If the emoji doesn't exist.
zNo emoji called N� ) r r r! r r �KeyErrorr �VARIANTS�get)�selfr r r! s r �__init__zEmoji.__init__ s� � � �� ���
���� 7��t��D�J�J��� 7� 7� 7��5�T�5�5�6�6�6� 7����� 9��J�J�$�-�+�+�G�R�8�8�8�J�J�J�J� 9� 9s �* �Ar c � � t |� � S )z�Replace emoji markup with corresponding unicode characters.
Args:
text (str): A string with emojis codes, e.g. "Hello :smiley:!"
Returns:
str: A string with emoji codes replaces with actual emoji.
r )�clsr s r �replacez
Emoji.replace4 s � � �d�#�#�#r c � � d| j �d�S )Nz<emoji �>)r �r) s r �__repr__zEmoji.__repr__@ s � �'���'�'�'�'r c � � | j S �N)r r0 s r �__str__z
Emoji.__str__C s
� ��z�r �consoler �optionsr r c # �h K � t | j |� | j � � � � V � d S r3 )r r � get_styler )r) r5 r6 s r �__rich_console__zEmoji.__rich_console__F s6 � � � � �d�j�'�"3�"3�D�J�"?�"?�@�@�@�@�@�@�@r )r"