
    i|              
      L   d Z ddlmZ ddlmZmZmZmZmZm	Z	m
Z
 ddlmZ ddlmZmZmZmZmZmZmZ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" ervddl#m$Z$ ddl%m&Z'm(Z)m*Z+m,Z-m.Z/m0Z1m2Z3m4Z5m6Z7m8Z9m:Z;m<Z=m>Z?m@ZAmBZCmDZEmFZGmHZImJZKmLZMmNZOmPZQmRZS ddlTmUZU ddlVmWZW ddlXmYZY e
d         ZZe
d         Z[e
eZe[dddddddf	         Z\e
e-eMeQf         Z]dZ^ G d d          Z& G d d          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&          Z0 G d& d'          Za G d( de&          Z4 G d) de&          Z@ G d* de&          Zb G d+ d,e          ZD G d- d.          Z> G d/ de&          Z8 G d0 de&          Z: G d1 d2e&          Z< G d3 d4e&          Zc G d5 d6e&          ZF G d7 d8e&          ZH G d9 d:e&          ZJ G d; d<e_          ZL G d= d>e&          ZN G d? d@e_          ZP G dA dBe&          ZRdKdLdJZddCS )Ma:  
The MIT License (MIT)

Copyright (c) 2015-present Rapptz

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
    )annotations)ClassVarListLiteralOptionalTYPE_CHECKINGTupleUnion   )
AssetMixin)try_enumComponentTypeButtonStyle	TextStyleChannelTypeSelectDefaultValueTypeSeparatorSpacingMediaItemLoadingState)AttachmentFlags)Colour)File)	get_slotsMISSING_get_as_snowflake)PartialEmoji	_EmojiTag)Self)	ComponentButtonComponent
SelectMenuSelectOption	ActionRow	TextInputSelectDefaultValuesSectionComponentTextComponentMediaGalleryComponentFileComponentSeparatorComponentMediaGalleryItemThumbnailComponentContainerComponentUnfurledMediaItemLabelComponentFileUploadComponentRadioGroupComponentRadioGroupOptionCheckboxGroupComponentCheckboxGroupOptionCheckboxComponent)Emoji)	Snowflake)ConnectionState)Buttonr    r#   TextDisplayr"   r%   r+   r'   r(   r   )r   r"   r8   r    r!   r#   SelectDefaultValuer%   r+   r-   r*   r'   r(   r%   	Containerr9   r)   r.   r/   r0   r2   r4   r1   r3   c                  l    e Zd ZU dZdZded<   ded<   dd	Zedd            Ze	dd            Z
ddZdS )r   a.  Represents a Discord Bot UI Kit Component.

    The components supported by Discord are:

    - :class:`ActionRow`
    - :class:`Button`
    - :class:`SelectMenu`
    - :class:`TextInput`
    - :class:`SectionComponent`
    - :class:`TextDisplay`
    - :class:`ThumbnailComponent`
    - :class:`MediaGalleryComponent`
    - :class:`FileComponent`
    - :class:`SeparatorComponent`
    - :class:`Container`
    - :class:`LabelComponent`
    - :class:`FileUploadComponent`

    This class is abstract and cannot be instantiated.

    .. versionadded:: 2.0
     Tuple[str, ...]	__slots__ClassVar[Tuple[str, ...]]__repr_info__returnstrc                v     d                      fd j        D                       }d j        j         d| dS )N c              3  B   K   | ]}| d t          |          V  dS =Ngetattr.0keyselfs     Y/home/ubuntu/.hermes/hermes-agent/venv/lib/python3.11/site-packages/discord/components.py	<genexpr>z%Component.__repr__.<locals>.<genexpr>   ;      WWSC88'$"4"488WWWWWW    <>joinrA   	__class____name__rN   attrss   ` rO   __repr__zComponent.__repr__   J    WWWWDDVWWWWW54>*55U5555rR   r   c                    t           z.:class:`ComponentType`: The type of component.NotImplementedErrorrN   s    rO   typezComponent.type   s
     "!rR   r   c                    |                      |           }t          |           D ],}	 ||         }t          |||           # t          $ r Y )w xY w|S N)__new__r   setattrKeyError)clskwargsrN   slotvalues        rO   _raw_constructzComponent._raw_construct   sv    {{3cNN 	+ 	+D+t dE****     s   A
AAComponentPayloadc                    t           rd   r_   ra   s    rO   to_dictzComponent.to_dict   s    !!rR   NrB   rC   )rB   r   rB   r   )rB   rm   )rX   
__module____qualname____doc__r?   __annotations__r[   propertyrb   classmethodrl   ro   r=   rR   rO   r   r      s          . "$I####,,,,6 6 6 6 " " " X" 	 	 	 [	" " " " " "rR   c                  z    e Zd ZU dZdZded<   dZded<   eddd	ddZddZ	ddZ
edd            ZddZd dZdS )!
BaseOptionzRepresents a base option for components that have options.

    This currently implements:

    - :class:`SelectOption`
    - :class:`RadioGroupOption`
    - :class:`CheckboxGroupOption`

    .. versionadded:: 2.7
    labelrk   descriptiondefaultr>   r?   r@   rA   NF)rk   r|   r}   r{   rC   rk   r|   Optional[str]r}   boolrB   Nonec               T    || _         |t          u r|n|| _        || _        || _        d S rd   )r{   r   rk   r|   r}   )rN   r{   rk   r|   r}   s        rO   __init__zBaseOption.__init__   s3      
#(G#3#3%%
*5$rR   c                v     d                      fd j        D                       }d j        j         d| dS )NrE   c              3  B   K   | ]}| d t          |          V  dS rG   rI   rK   s     rO   rP   z&BaseOption.__repr__.<locals>.<genexpr>   rQ   rR   rS   rT   rU   rY   s   ` rO   r[   zBaseOption.__repr__   r\   rR   c                :    | j         }| j        r| d| j         S |S )N
)r{   r|   rN   bases     rO   __str__zBaseOption.__str__   s0    z 	100d.000rR   dataOptionPayloadr   c           	          | |d         |d         |                     d          |                     dd                    S )Nr{   rk   r|   r}   Frz   )getrh   r   s     rO   	from_dictzBaseOption.from_dict   sI    sw-w-//HHY..	
 
 
 	
rR   c                R    | j         | j        | j        d}| j        r
| j        |d<   |S )N)r{   rk   r}   r|   )r{   rk   r}   r|   rN   payloads     rO   ro   zBaseOption.to_dict   s<    ZZ|"
 "
  	6%)%5GM"rR   c                Z    | j                             |                                           S rd   )rW   r   ro   ra   s    rO   copyzBaseOption.copy   s     ~''777rR   )
r{   rC   rk   rC   r|   r~   r}   r   rB   r   rp   )r   r   rB   r   )rB   r   rq   )rX   rr   rs   rt   r?   ru   rA   r   r   r[   r   rw   r   ro   r   r=   rR   rO   ry   ry      s         	 	 "NIMMMM/[M[[[[ %)% % % % % %6 6 6 6    
 
 
 [

 
 
 
8 8 8 8 8 8rR   ry   c                  X    e Zd ZU dZdZded<   eZded<   ddZedd            Z	ddZ
dS )r"   a  Represents a Discord Bot UI Kit Action Row.

    This is a component that holds up to 5 children components in a row.

    This inherits from :class:`Component`.

    .. versionadded:: 2.0

    Attributes
    ------------
    children: List[Union[:class:`Button`, :class:`SelectMenu`, :class:`TextInput`]]
        The children components that this holds, if any.
    id: Optional[:class:`int`]
        The ID of this component.

        .. versionadded:: 2.6
    )childrenidr>   r?   r@   rA   r   ActionRowPayloadrB   r   c                   |                     d          | _        g | _        |                     dg           D ]-}t          |          }|| j                            |           .d S )Nr   
components)r   r   r   _component_factoryappend)rN   r   component_data	components       rO   r   zActionRow.__init__  sk    !%$;="hh|R88 	0 	0N*>::I$$$Y///		0 	0rR   !Literal[ComponentType.action_row]c                    t           j        S r^   )r   
action_rowra   s    rO   rb   zActionRow.type       ''rR   c                d    | j         j        d | j        D             d}| j        
| j        |d<   |S )Nc                6    g | ]}|                                 S r=   ro   )rL   childs     rO   
<listcomp>z%ActionRow.to_dict.<locals>.<listcomp>"  s     FFFu5==??FFFrR   )rb   r   r   )rb   rk   r   r   r   s     rO   ro   zActionRow.to_dict  sB    IOFFFFF%
 %
 7 GGDMrR   N)r   r   rB   r   )rB   r   )rB   r   rX   rr   rs   rt   r?   ru   rA   r   rv   rb   ro   r=   rR   rO   r"   r"      s          $ "4I3333/8M88880 0 0 0 ( ( ( X(     rR   c                  X    e Zd ZU dZdZded<   eZded<   ddZedd            Z	ddZ
dS )r8   a+  Represents a button from the Discord Bot UI Kit.

    This inherits from :class:`Component`.

    .. note::

        The user constructible and usable type to create a button is :class:`discord.ui.Button`
        not this one.

    .. versionadded:: 2.0

    Attributes
    -----------
    style: :class:`.ButtonStyle`
        The style of the button.
    custom_id: Optional[:class:`str`]
        The ID of the button that gets received during an interaction.
        If this button is for a URL, it does not have a custom ID.
    url: Optional[:class:`str`]
        The URL this button sends you to.
    disabled: :class:`bool`
        Whether the button is disabled or not.
    label: Optional[:class:`str`]
        The label of the button, if any.
    emoji: Optional[:class:`PartialEmoji`]
        The emoji of the button, if available.
    sku_id: Optional[:class:`int`]
        The SKU ID this button sends you to, if available.

        .. versionadded:: 2.4
    id: Optional[:class:`int`]
        The ID of this component.

        .. versionadded:: 2.6
    )style	custom_idurldisabledr{   emojisku_idr   r>   r?   r@   rA   r   ButtonComponentPayloadrB   r   c               &   |                     d          | _        t          t          |d                   | _        |                     d          | _        |                     d          | _        |                     dd          | _        |                     d          | _        |  	 t          j
        |d                   | _        n# t          $ r
 d | _        Y nw xY w	 t          |d	                   | _        d S # t          $ r d | _        Y d S w xY w)
Nr   r   r   r   r   Fr{   r   r   )r   r   r   r   r   r   r   r   r{   r   r   r   rg   intr   rN   r   s     rO   r   zButton.__init__[  s   !%$"*;W"F"F
(,(=(="&((5//"hhz599$(HHW$5$5
*	%/W>>DJJ 	 	 	DJJJ		),T(^)<)<DKKK 	 	 	DKKKK	s$   'C CCC; ;DDLiteral[ComponentType.button]c                    t           j        S r^   )r   buttonra   s    rO   rb   zButton.typem  s     ##rR   c                :   d| j         j        | j        d}| j        
| j        |d<   | j        rt          | j                  |d<   | j        r
| j        |d<   | j        r
| j        |d<   | j        r
| j        |d<   | j	        r| j	        
                                |d<   |S )	N   )rb   r   r   r   r   r{   r   r   r   )r   rk   r   r   r   rC   r{   r   r   r   ro   r   s     rO   ro   zButton.to_dictr  s    Z%+
 +
 7 GGDM; 	1 #DK 0 0GH: 	*#zGG> 	2#'>GK 8 	&!XGEN: 	4#z1133GGrR   N)r   r   rB   r   )rB   r   )rB   r   r   r=   rR   rO   r8   r8   )  s         " "H	"I 	 	 	 	 09M8888   $ $ $ $ X$     rR   r8   c                  @    e Zd ZU dZdZded<   eZded<   ddZddZdS )r    a  Represents a select menu from the Discord Bot UI Kit.

    A select menu is functionally the same as a dropdown, however
    on mobile it renders a bit differently.

    .. note::

        The user constructible and usable type to create a select menu is
        :class:`discord.ui.Select` not this one.

    .. versionadded:: 2.0

    Attributes
    ------------
    type: :class:`ComponentType`
        The type of component.
    custom_id: Optional[:class:`str`]
        The ID of the select menu that gets received during an interaction.
    placeholder: Optional[:class:`str`]
        The placeholder text that is shown if nothing is selected, if any.
    min_values: :class:`int`
        The minimum number of items that must be chosen for this select menu.
        Defaults to 1 and must be between 0 and 25.
    max_values: :class:`int`
        The maximum number of items that must be chosen for this select menu.
        Defaults to 1 and must be between 1 and 25.
    options: List[:class:`SelectOption`]
        A list of options that can be selected in this menu.
    disabled: :class:`bool`
        Whether the select is disabled or not.
    channel_types: List[:class:`.ChannelType`]
        A list of channel types that are allowed to be chosen in this select menu.
    id: Optional[:class:`int`]
        The ID of this component.

        .. versionadded:: 2.6
    required: :class:`bool`
        Whether the select is required. Only applicable within modals.

        .. versionadded:: 2.6
    )rb   r   placeholder
min_values
max_valuesoptionsr   channel_typesdefault_valuesrequiredr   r>   r?   r@   rA   r   SelectMenuPayloadrB   r   c               ~   t          t          |d                   | _        |d         | _        |                    d          | _        |                    dd          | _        |                    dd          | _        |                    dd          | _        d	 |                    d
g           D             | _	        |                    dd          | _
        d |                    dg           D             | _        d |                    dg           D             | _        |                    d          | _        d S )Nrb   r   r   r   r   r   r   Fc                B    g | ]}t                               |          S r=   )r!   r   rL   options     rO   r   z'SelectMenu.__init__.<locals>.<listcomp>  s&    +q+q+qvL,B,B6,J,J+q+q+qrR   r   r   c                8    g | ]}t          t          |          S r=   )r   r   rL   ts     rO   r   z'SelectMenu.__init__.<locals>.<listcomp>  s"    0q0q0qa+q1I1I0q0q0qrR   r   c                B    g | ]}t                               |          S r=   )r:   r   )rL   ds     rO   r   z'SelectMenu.__init__.<locals>.<listcomp>  s4     9
 9
 9
01((++9
 9
 9
rR   r   r   )r   r   rb   r   r   r   r   r   r   r   r   r   r   r   r   s     rO   r   zSelectMenu.__init__  s$   #+M4<#H#H	";/*.((=*A*A#xxa88#xxa88"hhz599+q+qY]YaYabkmoYpYp+q+q+q"hhz5990q0qSWS[S[\kmoSpSp0q0q0q9
 9
59XX>NPR5S5S9
 9
 9
 "&$rR   c                D   | j         j        | j        | j        | j        | j        | j        d}| j        
| j        |d<   | j        r
| j        |d<   | j	        rd | j	        D             |d<   | j
        rd | j
        D             |d<   | j        rd | j        D             |d	<   |S )
N)rb   r   r   r   r   r   r   r   c                6    g | ]}|                                 S r=   r   )rL   ops     rO   r   z&SelectMenu.to_dict.<locals>.<listcomp>  s     !F!F!F2"**,,!F!F!FrR   r   c                    g | ]	}|j         
S r=   rk   r   s     rO   r   z&SelectMenu.to_dict.<locals>.<listcomp>  s    'L'L'LA'L'L'LrR   r   c                6    g | ]}|                                 S r=   r   )rL   vs     rO   r   z&SelectMenu.to_dict.<locals>.<listcomp>  s     (R(R(R(R(R(RrR   r   )rb   rk   r   r   r   r   r   r   r   r   r   r   r   s     rO   ro   zSelectMenu.to_dict  s    IO//&
 &
 7 GGDM 	6%)%5GM"< 	G!F!F!F!F!FGI 	M'L'L9K'L'L'LGO$ 	S(R(Rd>Q(R(R(RG$%rR   N)r   r   rB   r   )rB   r   )	rX   rr   rs   rt   r?   ru   rA   r   ro   r=   rR   rO   r    r      sw         ( (T"I     09M88880 0 0 0     rR   r    c                       e Zd ZU dZej        dz   Zded<   ej        dz   Zeddddd fdZ	ddZ
ed d            Zej        d!d            Zed"d            Zd# fdZ xZS )$r!   a  Represents a select menu's option.

    These can be created by users.

    .. versionadded:: 2.0

    Parameters
    -----------
    label: :class:`str`
        The label of the option. This is displayed to users.
        Can only be up to 100 characters.
    value: :class:`str`
        The value of the option. This is not displayed to users.
        If not provided when constructed then it defaults to the label.
        Can only be up to 100 characters.
    description: Optional[:class:`str`]
        An additional description of the option, if any.
        Can only be up to 100 characters.
    emoji: Optional[Union[:class:`str`, :class:`Emoji`, :class:`PartialEmoji`]]
        The emoji of the option, if available.
    default: :class:`bool`
        Whether this option is selected by default.

    Attributes
    -----------
    label: :class:`str`
        The label of the option. This is displayed to users.
    value: :class:`str`
        The value of the option. This is not displayed to users.
        If not provided when constructed then it defaults to the
        label.
    description: Optional[:class:`str`]
        An additional description of the option, if any.
    default: :class:`bool`
        Whether this option is selected by default.
    _emojir>   r?   )r   NF)rk   r|   r   r}   r{   rC   rk   r|   r~   r   )Optional[Union[str, Emoji, PartialEmoji]]r}   r   rB   r   c               `    t                                          ||||           || _        d S )Nrz   )superr   r   )rN   r{   rk   r|   r   r}   rW   s         rO   r   zSelectOption.__init__  s2     	uE{T[\\\


rR   c                l    | j         r| j          d| j         }n| j        }| j        r| d| j         S |S )NrE   r   )r   r{   r|   r   s     rO   r   zSelectOption.__str__%  sS    : 	j//4://DD:D 	100d.000rR   Optional[PartialEmoji]c                    | j         S )zHOptional[:class:`.PartialEmoji`]: The emoji of the option, if available.r   ra   s    rO   r   zSelectOption.emoji/       {rR   c                   |}t          |t                    rt          j        |          | _        d S t          |t
                    r|                                | _        d S t          d|j        j	         d          d | _        d S )Nz/expected str, Emoji, or PartialEmoji, received  instead)

isinstancerC   r   from_strr   r   _to_partial	TypeErrorrW   rX   rN   rk   s     rO   r   zSelectOption.emoji4  s    %%% v*3E::E9-- v#//11 tRWRaRj t t tuuuDKKKrR   r   SelectOptionPayloadr   c           	         	 t          j        |d                   }n# t          $ r d }Y nw xY w | |d         |d         |                    d          |                    dd          |          S )Nr   r{   rk   r|   r}   F)r{   rk   r|   r}   r   )r   r   rg   r   )rh   r   r   s      rO   r   zSelectOption.from_dict@  s    	 *4=99EE 	 	 	EEE	 sw-w-//HHY..
 
 
 	
s    ,,c                    t                                                      }| j        r| j                                        |d<   |S )Nr   )r   ro   r   )rN   r   rW   s     rO   ro   zSelectOption.to_dictO  s=    ',ww'8'8: 	4#z1133GGrR   )r{   rC   rk   rC   r|   r~   r   r   r}   r   rB   r   rp   )rB   r   )rk   r   rB   r   )r   r   rB   r   )rB   r   )rX   rr   rs   rt   ry   r?   ru   rA   r   r   r   rv   r   setterrw   r   ro   __classcell__)rW   s   @rO   r!   r!     s        # #J ",!5!CICCCC,z9M %);?              X \	 	 	 \	 
 
 
 [
         rR   r!   c                  p    e Zd ZU dZdZded<   eZded<   ddZedd            Z	ddZ
edd            ZdS )r#   a  Represents a text input from the Discord Bot UI Kit.

    .. note::
        The user constructible and usable type to create a text input is
        :class:`discord.ui.TextInput` not this one.

    .. versionadded:: 2.0

    Attributes
    ------------
    custom_id: Optional[:class:`str`]
        The ID of the text input that gets received during an interaction.
    label: Optional[:class:`str`]
        The label to display above the text input.
    style: :class:`TextStyle`
        The style of the text input.
    placeholder: Optional[:class:`str`]
        The placeholder text to display when the text input is empty.
    value: Optional[:class:`str`]
        The default value of the text input.
    required: :class:`bool`
        Whether the text input is required.
    min_length: Optional[:class:`int`]
        The minimum length of the text input.
    max_length: Optional[:class:`int`]
        The maximum length of the text input.
    id: Optional[:class:`int`]
        The ID of this component.

        .. versionadded:: 2.6
    )	r   r{   r   r   rk   r   
min_length
max_lengthr   r>   r?   r@   rA   r   TextInputPayloadrB   r   c                  t          t          |d                   | _        |                    d          | _        |d         | _        |                    d          | _        |                    d          | _        |                    dd          | _        |                    d          | _	        |                    d	          | _
        |                    d
          | _        d S )Nr   r{   r   r   rk   r   Tr   r   r   )r   r   r   r   r{   r   r   rk   r   r   r   r   r   s     rO   r   zTextInput.__init__  s     (DM B B
$(HHW$5$5
";/*.((=*A*A$(HHW$5$5
"hhz488)-,)?)?)-,)?)?!%$rR   !Literal[ComponentType.text_input]c                    t           j        S r^   )r   
text_inputra   s    rO   rb   zTextInput.type  r   rR   c                   | j         j        | j        j        | j        | j        | j        d}| j        
| j        |d<   | j        r
| j        |d<   | j        r
| j        |d<   | j        r
| j        |d<   | j	        r
| j	        |d<   |S )N)rb   r   r{   r   r   r   r   rk   r   r   )
rb   rk   r   r{   r   r   r   r   r   r   r   s     rO   ro   zTextInput.to_dict  s    IOZ%Z%
 %
 7 GGDM 	6%)%5GM": 	*#zGG? 	4$(OGL!? 	4$(OGL!rR   r~   c                    | j         S )zqOptional[:class:`str`]: The default value of the text input.

        This is an alias to :attr:`value`.
        r   ra   s    rO   r}   zTextInput.default  s     zrR   N)r   r   rB   r   )rB   r   )rB   r   )rB   r~   )rX   rr   rs   rt   r?   ru   rA   r   rv   rb   ro   r}   r=   rR   rO   r#   r#   X  s          @
"I 
 
 
 
 09M8888	0 	0 	0 	0 ( ( ( X(   4    X  rR   r#   c                      e Zd ZdZddZedd	            Zej        dd            ZddZe	dd            Z
d dZe	d!d            Ze	d"d            Ze	d#d            ZdS )$r:   a*  Represents a select menu's default value.

    These can be created by users.

    .. versionadded:: 2.4

    Parameters
    -----------
    id: :class:`int`
        The id of a role, user, or channel.
    type: :class:`SelectDefaultValueType`
        The type of value that ``id`` represents.
    r   r   rb   r   rB   r   c               "    || _         || _        d S rd   )r   _type)rN   r   rb   s      rO   r   zSelectDefaultValue.__init__  s     -1


rR   c                    | j         S )zJ:class:`SelectDefaultValueType`: The type of value that ``id`` represents.)r   ra   s    rO   rb   zSelectDefaultValue.type  s     zrR   rk   c                x    t          |t                    st          d|j        j         d          || _        d S )Nz*expected SelectDefaultValueType, received r   )r   r   r   rW   rX   r   r   s     rO   rb   zSelectDefaultValue.type  s@    %!788 	mkIakkklll


rR   rC   c                (    d| j         d| j        dS )Nz<SelectDefaultValue id=z type=rT   r   rb   ra   s    rO   r[   zSelectDefaultValue.__repr__  s    HHH$)HHHHrR   r   SelectDefaultValuesPayloadc                Z     | |d         t          t          |d                             S )Nr   rb   r   )r   r   r   s     rO   r   zSelectDefaultValue.from_dict  s4    sDz0$v,??
 
 
 	
rR   c                *    | j         | j        j        dS )Nr   )r   r   rk   ra   s    rO   ro   zSelectDefaultValue.to_dict  s    'J$
 
 	
rR   channelr6   r   c               :     | |j         t          j                  S )a|  Creates a :class:`SelectDefaultValue` with the type set to :attr:`~SelectDefaultValueType.channel`.

        Parameters
        -----------
        channel: :class:`~discord.abc.Snowflake`
            The channel to create the default value for.

        Returns
        --------
        :class:`SelectDefaultValue`
            The default value created with the channel.
        r   )r   r   r   )rh   r   s     rO   from_channelzSelectDefaultValue.from_channel  s(     sz'/
 
 
 	
rR   rolec               :     | |j         t          j                  S )ap  Creates a :class:`SelectDefaultValue` with the type set to :attr:`~SelectDefaultValueType.role`.

        Parameters
        -----------
        role: :class:`~discord.abc.Snowflake`
            The role to create the default value for.

        Returns
        --------
        :class:`SelectDefaultValue`
            The default value created with the role.
        r   )r   r   r   )rh   r   s     rO   	from_rolezSelectDefaultValue.from_role  (     sw',
 
 
 	
rR   userc               :     | |j         t          j                  S )ap  Creates a :class:`SelectDefaultValue` with the type set to :attr:`~SelectDefaultValueType.user`.

        Parameters
        -----------
        user: :class:`~discord.abc.Snowflake`
            The user to create the default value for.

        Returns
        --------
        :class:`SelectDefaultValue`
            The default value created with the user.
        r   )r   r   r  )rh   r  s     rO   	from_userzSelectDefaultValue.from_user  r  rR   N)r   r   rb   r   rB   r   )rB   r   )rk   r   rB   r   rp   )r   r   rB   r:   )rB   r   )r   r6   rB   r   )r   r6   rB   r   )r  r6   rB   r   )rX   rr   rs   rt   r   rv   rb   r   r[   rw   r   ro   r   r  r  r=   rR   rO   r:   r:     s         2 2 2 2    X 
[   [I I I I 
 
 
 [

 
 
 
 
 
 
 [
$ 
 
 
 [
$ 
 
 
 [
 
 
rR   r:   c                  B    e Zd ZdZdZeZdd	Zedd            ZddZ	dS )r%   a  Represents a section from the Discord Bot UI Kit.

    This inherits from :class:`Component`.

    .. note::

        The user constructible and usable type to create a section is :class:`discord.ui.Section`
        not this one.

    .. versionadded:: 2.6

    Attributes
    ----------
    children: List[:class:`TextDisplay`]
        The components on this section.
    accessory: :class:`Component`
        The section accessory.
    id: Optional[:class:`int`]
        The ID of this component.
    )r   	accessoryr   r   SectionComponentPayloadstateOptional[ConnectionState]rB   r   c                    g | _         t          |d         |          | _        |                    d          | _        |d         D ].}t          ||          }|| j                             |           /d S )Nr  r   r   )r   r   r  r   r   r   )rN   r   r	  r   r   s        rO   r   zSectionComponent.__init__F  sz    46$6tK7H%$P$P!%$"<0 	0 	0N*>5AAI$$$Y///	0 	0rR   Literal[ComponentType.section]c                    t           j        S rd   )r   sectionra   s    rO   rb   zSectionComponent.typeP  s    $$rR   c                    | j         j        d | j        D             | j                                        d}| j        
| j        |d<   |S )Nc                6    g | ]}|                                 S r=   r   rL   cs     rO   r   z,SectionComponent.to_dict.<locals>.<listcomp>W       >>>1199;;>>>rR   )rb   r   r  r   )rb   rk   r   r  ro   r   r   s     rO   ro   zSectionComponent.to_dictT  sS    IO>>>>>//11,
 ,
 7 GGDMrR   N)r   r  r	  r
  rB   r   )rB   r  )rB   r  
rX   rr   rs   rt   r?   rA   r   rv   rb   ro   r=   rR   rO   r%   r%   (  st         *I M0 0 0 0 % % % X%
 
 
 
 
 
rR   c                  B    e Zd ZdZdZeZdd	Zedd            ZddZ	dS )r+   ag  Represents a Thumbnail from the Discord Bot UI Kit.

    This inherits from :class:`Component`.

    .. note::

        The user constructible and usable type to create a thumbnail is :class:`discord.ui.Thumbnail`
        not this one.

    .. versionadded:: 2.6

    Attributes
    ----------
    media: :class:`UnfurledMediaItem`
        The media for this thumbnail.
    description: Optional[:class:`str`]
        The description shown within this thumbnail.
    spoiler: :class:`bool`
        Whether this thumbnail is flagged as a spoiler.
    id: Optional[:class:`int`]
        The ID of this component.
    )mediaspoilerr|   r   r   ThumbnailComponentPayloadr	  r
  rB   r   c                    t                               |d         |          | _        |                    d          | _        |                    dd          | _        |                    d          | _        d S )Nr  r|   r  Fr   )r-   
_from_datar  r   r|   r  r   rN   r   r	  s      rO   r   zThumbnailComponent.__init__  s^    
 ):(D(DT']TY(Z(Z
*.((=*A*A!XXi77!%$rR    Literal[ComponentType.thumbnail]c                    t           j        S rd   )r   	thumbnailra   s    rO   rb   zThumbnailComponent.type      &&rR   c                    | j                                         | j        | j        | j        j        d}| j        
| j        |d<   |S )N)r  r|   r  rb   r   )r  ro   r|   r  rb   rk   r   r   s     rO   ro   zThumbnailComponent.to_dict  sK    Z''))+|IO	
 
 7 GGDMrR   N)r   r  r	  r
  rB   r   )rB   r  )rB   r  r  r=   rR   rO   r+   r+   a  st         .I M0 0 0 0 ' ' ' X'     rR   c                  B    e Zd ZdZdZeZddZedd	            Zdd
Z	dS )r9   a  Represents a text display from the Discord Bot UI Kit.

    This inherits from :class:`Component`.

    .. note::

        The user constructible and usable type to create a text display is
        :class:`discord.ui.TextDisplay` not this one.

    .. versionadded:: 2.6

    Attributes
    ----------
    content: :class:`str`
        The content that this display shows.
    id: Optional[:class:`int`]
        The ID of this component.
    )contentr   r   TextComponentPayloadrB   r   c                T    |d         | _         |                    d          | _        d S )Nr"  r   )r"  r   r   r   s     rO   r   zTextDisplay.__init__  s"     O!%$rR   #Literal[ComponentType.text_display]c                    t           j        S rd   )r   text_displayra   s    rO   rb   zTextDisplay.type  s    ))rR   c                P    | j         j        | j        d}| j        
| j        |d<   |S )N)rb   r"  r   )rb   rk   r"  r   r   s     rO   ro   zTextDisplay.to_dict  s4    IO|)
 )
 7 GGDMrR   N)r   r#  rB   r   )rB   r%  )rB   r#  r  r=   rR   rO   r9   r9     sr         & "IM0 0 0 0 * * * X*     rR   c                  d    e Zd ZdZdZddZedd	            Zedd            Z	ddZ
ddZd ZdS )r-   ax  Represents an unfurled media item.

    .. versionadded:: 2.6

    Parameters
    ----------
    url: :class:`str`
        The URL of this media item. This can be an arbitrary url or a reference to a local
        file uploaded as an attachment within the message, which can be accessed with the
        ``attachment://<filename>`` format.

    Attributes
    ----------
    url: :class:`str`
        The URL of this media item.
    proxy_url: Optional[:class:`str`]
        The proxy URL. This is a cached version of the :attr:`.url` in the
        case of images. When the message is deleted, this URL might be valid for a few minutes
        or not valid at all.
    height: Optional[:class:`int`]
        The media item's height, in pixels. Only applicable to images and videos.
    width: Optional[:class:`int`]
        The media item's width, in pixels. Only applicable to images and videos.
    content_type: Optional[:class:`str`]
        The media item's `media type <https://en.wikipedia.org/wiki/Media_type>`_
    placeholder: Optional[:class:`str`]
        The media item's placeholder.
    loading_state: Optional[:class:`MediaItemLoadingState`]
        The loading state of this media item.
    attachment_id: Optional[:class:`int`]
        The attachment id this media item points to, only available if the url points to a local file
        uploaded within the component message.
    
r   	proxy_urlheightwidthcontent_type_flagsr   loading_stateattachment_id_stater   rC   rB   r   c                    || _         d | _        d | _        d | _        d | _        d| _        d | _        d | _        d | _        d | _	        d S )Nr   r*  )rN   r   s     rO   r   zUnfurledMediaItem.__init__  sP    (,%)$(
+/*.>B,015rR   r   c                4    t          j        | j                  S )z2:class:`AttachmentFlags`: This media item's flags.)r   _from_valuer/  ra   s    rO   flagszUnfurledMediaItem.flags  s     *4;777rR   r   UnfurledMediaItemPayloadr	  r
  c                T     | |d                   }|                     ||           |S Nr   )_update)rh   r   r	  rN   s       rO   r  zUnfurledMediaItem._from_data
  s.    s4;T5!!!rR   c                   |                     d          | _        |                     d          | _        |                     d          | _        |                     d          | _        |                     dd          | _        |                     d          | _        |                     d          }|t          t          |          | _	        t          |d	          | _        || _        d S )
Nr+  r,  r-  r.  r6  r   r   r0  r1  )r   r+  r,  r-  r.  r/  r   r   r   r0  r   r1  r2  )rN   r   r	  r0  s       rO   r:  zUnfurledMediaItem._update  s    +..hhx((XXg&&
 HH^44hhw**88M2211$!)*?!O!OD.t_EErR   c                    d| j          dS )Nz<UnfurledMediaItem url=rT   r   ra   s    rO   r[   zUnfurledMediaItem.__repr__  s    44444rR   c                    d| j         iS r9  r=  ra   s    rO   ro   zUnfurledMediaItem.to_dict!  s    48
 	
rR   N)r   rC   rB   r   )rB   r   )r   r7  r	  r
  )r   r7  r	  r
  rB   r   rp   )rX   rr   rs   rt   r?   r   rv   r6  rw   r  r:  r[   ro   r=   rR   rO   r-   r-     s           DI6 6 6 6 8 8 8 X8    [
   5 5 5 5
 
 
 
 
rR   r-   c                      e Zd ZdZdZeedddZddZed d            Z	e	j
        d!d            Z	ed"d            Zed#d            Zd$dZdS )%r*   a  Represents a :class:`MediaGalleryComponent` media item.

    .. versionadded:: 2.6

    Parameters
    ----------
    media: Union[:class:`str`, :class:`discord.File`, :class:`UnfurledMediaItem`]
        The media item data. This can be a string representing a local
        file uploaded as an attachment in the message, which can be accessed
        using the ``attachment://<filename>`` format, or an arbitrary url.
    description: Optional[:class:`str`]
        The description to show within this item. Up to 256 characters. Defaults
        to ``None``.
    spoiler: :class:`bool`
        Whether this item should be flagged as a spoiler.
    )_mediar|   r  r2  )r|   r  r  #Union[str, File, UnfurledMediaItem]r|   r~   r  r   rB   r   c                   || _         t          |t                    r |t          u r|j        }|t          u r|j        }|t          u rd n|| _        t          |          | _        d | _        d S rd   )r  r   r   r   r|   r  r   r2  )rN   r  r|   r  s       rO   r   zMediaGalleryItem.__init__@  sp     
eT"" 	(g%%#/'!!-2=2H2H$$k!']]15rR   rC   c                    d| j         dS )Nz<MediaGalleryItem media=rT   )r  ra   s    rO   r[   zMediaGalleryItem.__repr__S  s    9$*9999rR   r-   c                    | j         S )z3:class:`UnfurledMediaItem`: This item's media data.)r@  ra   s    rO   r  zMediaGalleryItem.mediaV  r   rR   rk   c                ,   t          |t                    rt          |          | _        d S t          |t                    r	|| _        d S t          |t                    rt          |j                  | _        d S t          d|j        j                   )Nz)Expected a str or UnfurledMediaItem, not )	r   rC   r-   r@  r   urir   rW   rX   r   s     rO   r  zMediaGalleryItem.media[  s    eS!! 	d+E22DKKK011 	dDKKKt$$ 	d+EI66DKKKbH`bbcccrR   r   MediaGalleryItemPayloadr	  r
  c                    |d         } | t                               ||          |                    d          |                    dd                    }||_        |S )Nr  r|   r  F)r  r|   r  )r-   r  r   r2  )rh   r   r	  r  rN   s        rO   r  zMediaGalleryItem._from_dataf  sb    Ws#..ue<<//HHY..
 
 

 rR   itemsList[MediaGalleryItemPayload]List[MediaGalleryItem]c                $      fd|D             S )Nc                <    g | ]}                     |          S r=   )r  )rL   itemrh   r	  s     rO   r   z2MediaGalleryItem._from_gallery.<locals>.<listcomp>w  s'    >>>tU++>>>rR   r=   )rh   rI  r	  s   ` `rO   _from_galleryzMediaGalleryItem._from_galleryq  s#     ?>>>>>>>>rR   c                j    | j                                         | j        d}| j        r
| j        |d<   |S )N)r  r  r|   )r  ro   r  r|   r   s     rO   ro   zMediaGalleryItem.to_dicty  sC    Z''))|,
 ,

  	6%)%5GM"rR   N)r  rA  r|   r~   r  r   rB   r   rp   )rB   r-   )rk   rA  rB   r   )r   rG  r	  r
  rB   r*   )rI  rJ  r	  r
  rB   rK  )rB   rG  )rX   rr   rs   rt   r?   r   r   r[   rv   r  r   rw   r  rO  ro   r=   rR   rO   r*   r*   '  s         "I &-6 6 6 6 6 6&: : : :    X \d d d \d    [ ? ? ? [?	 	 	 	 	 	rR   r*   c                  B    e Zd ZdZdZeZdd	Zedd            ZddZ	dS )r'   a  Represents a Media Gallery component from the Discord Bot UI Kit.

    This inherits from :class:`Component`.

    .. note::

        The user constructible and usable type for creating a media gallery is
        :class:`discord.ui.MediaGallery` not this one.

    .. versionadded:: 2.6

    Attributes
    ----------
    items: List[:class:`MediaGalleryItem`]
        The items this gallery has.
    id: Optional[:class:`int`]
        The ID of this component.
    )rI  r   r   MediaGalleryComponentPayloadr	  r
  rB   r   c                    t                               |d         |          | _        |                    d          | _        d S )NrI  r   )r*   rO  rI  r   r   r  s      rO   r   zMediaGalleryComponent.__init__  s4    -=-K-KDQXM[`-a-a
!%$rR   $Literal[ComponentType.media_gallery]c                    t           j        S rd   )r   media_galleryra   s    rO   rb   zMediaGalleryComponent.type  s    **rR   c                d    | j         j        d | j        D             d}| j        
| j        |d<   |S )Nc                6    g | ]}|                                 S r=   r   )rL   rN  s     rO   r   z1MediaGalleryComponent.to_dict.<locals>.<listcomp>  s     <<<dllnn<<<rR   )rb   rI  r   )rb   rk   rI  r   r   s     rO   ro   zMediaGalleryComponent.to_dict  sB    IO<<<<<1
 1
 7 GGDMrR   N)r   rR  r	  r
  rB   r   )rB   rT  )rB   rR  r  r=   rR   rO   r'   r'     sr         &  IM0 0 0 0 + + + X+     rR   c                  B    e Zd ZdZdZeZdd	Zedd            ZddZ	dS )r(   a  Represents a File component from the Discord Bot UI Kit.

    This inherits from :class:`Component`.

    .. note::

        The user constructible and usable type for create a file component is
        :class:`discord.ui.File` not this one.

    .. versionadded:: 2.6

    Attributes
    ----------
    media: :class:`UnfurledMediaItem`
        The unfurled attachment contents of the file.
    spoiler: :class:`bool`
        Whether this file is flagged as a spoiler.
    id: Optional[:class:`int`]
        The ID of this component.
    name: Optional[:class:`str`]
        The displayed file name, only available when received from the API.
    size: Optional[:class:`int`]
        The file size in MiB, only available when received from the API.
    )r  r  r   namesizer   FileComponentPayloadr	  r
  rB   r   c                $   t                               |d         |          | _        |                    dd          | _        |                    d          | _        |                    d          | _        |                    d          | _        d S )Nfiler  Fr   rZ  r[  )r-   r  r  r   r  r   rZ  r[  r  s      rO   r   zFileComponent.__init__  sn    (9(D(DT&\SX(Y(Y
!XXi77!%$#'88F#3#3	#'88F#3#3			rR   Literal[ComponentType.file]c                    t           j        S rd   )r   r^  ra   s    rO   rb   zFileComponent.type  s    !!rR   c                    | j         j        | j                                        | j        d}| j        
| j        |d<   |S )N)rb   r^  r  r   )rb   rk   r  ro   r  r   r   s     rO   ro   zFileComponent.to_dict  sE    IOJ&&((|)
 )

 7 GGDMrR   N)r   r\  r	  r
  rB   r   )rB   r_  )rB   r\  r  r=   rR   rO   r(   r(     st         2I M4 4 4 4 " " " X"     rR   c                  B    e Zd ZdZdZeZddZedd	            Zdd
Z	dS )r)   a  Represents a Separator from the Discord Bot UI Kit.

    This inherits from :class:`Component`.

    .. note::

        The user constructible and usable type for creating a separator is
        :class:`discord.ui.Separator` not this one.

    .. versionadded:: 2.6

    Attributes
    ----------
    spacing: :class:`SeparatorSpacing`
        The spacing size of the separator.
    visible: :class:`bool`
        Whether this separator is visible and shows a divider.
    id: Optional[:class:`int`]
        The ID of this component.
    )spacingvisibler   r   SeparatorComponentPayloadrB   r   c                    t          t          |                    dd                    | _        |                    dd          | _        |                    d          | _        d S )Nrc  r   dividerTr   )r   r   r   rc  rd  r   r   s     rO   r   zSeparatorComponent.__init__  sO     *22BDHHYXYDZDZ)[)[!XXi66!%$rR    Literal[ComponentType.separator]c                    t           j        S rd   )r   	separatorra   s    rO   rb   zSeparatorComponent.type  r  rR   c                f    | j         j        | j        | j        j        d}| j        
| j        |d<   |S )N)rb   rg  rc  r   )rb   rk   rd  rc  r   r   s     rO   ro   zSeparatorComponent.to_dict  s<    IO||).
 .

 7 GGDMrR   N)r   re  rB   r   )rB   rh  )rB   re  r  r=   rR   rO   r)   r)     st         *I M0 0 0 0 ' ' ' X'     rR   r)   c                  ^    e Zd ZdZdZdZdd
Zedd            ZeZ	edd            Z
ddZdS )r;   a  Represents a Container from the Discord Bot UI Kit.

    This inherits from :class:`Component`.

    .. note::

        The user constructible and usable type for creating a container is
        :class:`discord.ui.Container` not this one.

    .. versionadded:: 2.6

    Attributes
    ----------
    children: :class:`Component`
        This container's children.
    spoiler: :class:`bool`
        Whether this container is flagged as a spoiler.
    id: Optional[:class:`int`]
        The ID of this component.
    )r   r   r  _colour)r   r   r  accent_colourr   ContainerComponentPayloadr	  r
  rB   r   c                T   g | _         |                    d          | _        |d         D ].}t          ||          }|r| j                             |           /|                    dd          | _        |                    d          }d | _        |t          |          | _        d S d S )Nr   r   r  Faccent_color)r   r   r   r   r   r  rm  r   )rN   r   r	  r   compcolours         rO   r   zContainer.__init__B  s    )+!%$,' 	+ 	+E%eU33D +$$T***!XXi77.)))-!&>>DLLL rR   Optional[Colour]c                    | j         S )z9Optional[:class:`Colour`]: The container's accent colour.)rm  ra   s    rO   rn  zContainer.accent_colourS  s     |rR    Literal[ComponentType.container]c                    t           j        S rd   )r   	containerra   s    rO   rb   zContainer.typeZ  r  rR   c                    | j         j        | j        d | j        D             d}| j        
| j        |d<   | j        r| j        j        |d<   |S )Nc                6    g | ]}|                                 S r=   r   r  s     rO   r   z%Container.to_dict.<locals>.<listcomp>b  r  rR   )rb   r  r   r   rq  )rb   rk   r  r   r   rm  r   s     rO   ro   zContainer.to_dict^  s`    IO|>>>>>.
 .

 7 GGDM< 	9&*l&8GN#rR   N)r   ro  r	  r
  rB   r   )rB   rt  )rB   rv  )rB   ro  )rX   rr   rs   rt   r?   rA   r   rv   rn  rq  rb   ro   r=   rR   rO   r;   r;     s         *IM* * * *"    X !L' ' ' X'
 
 
 
 
 
rR   r;   c                  B    e Zd ZdZdZdZdd
Zedd            ZddZ	dS )r.   al  Represents a label component from the Discord Bot UI Kit.

    This inherits from :class:`Component`.

    .. note::

        The user constructible and usable type for creating a label is
        :class:`discord.ui.Label` not this one.

    .. versionadded:: 2.6

    Attributes
    ----------
    label: :class:`str`
        The label text to display.
    description: Optional[:class:`str`]
        The description text to display below the label, if any.
    component: :class:`Component`
        The component that this label is associated with.
    id: Optional[:class:`int`]
        The ID of this component.
    )r{   r|   r   r   )r{   r|   r   r   LabelComponentPayloadr	  r
  rB   r   c                    t          |d         |          | _        |d         | _        |                    d          | _        |                    d          | _        d S )Nr   r{   r   r|   )r   r   r{   r   r   r|   r  s      rO   r   zLabelComponent.__init__  sN    $6tK7H%$P$Pw-
!%$*.((=*A*ArR   Literal[ComponentType.label]c                    t           j        S rd   )r   r{   ra   s    rO   rb   zLabelComponent.type  s    ""rR   c                    | j         j        | j        | j                                        d}| j        r
| j        |d<   | j        
| j        |d<   |S )N)rb   r{   r   r|   r   )rb   rk   r{   r   ro   r|   r   r   s     rO   ro   zLabelComponent.to_dict  s]    IOZ//11*
 *

  	6%)%5GM"7 GGDMrR   N)r   r|  r	  r
  rB   r   )rB   r~  )rB   r|  r  r=   rR   rO   r.   r.   k  sx         .I :MB B B B # # # X#
 
 
 
 
 
rR   r.   c                  X    e Zd ZU dZdZded<   eZded<   ddZedd            Z	ddZ
dS )r/   a  Represents a file upload component from the Discord Bot UI Kit.

    This inherits from :class:`Component`.

    .. note::

        The user constructible and usable type for creating a file upload is
        :class:`discord.ui.FileUpload` not this one.

    .. versionadded:: 2.7

    Attributes
    ------------
    custom_id: Optional[:class:`str`]
        The ID of the component that gets received during an interaction.
    min_values: :class:`int`
        The minimum number of files that must be uploaded for this component.
        Defaults to 1 and must be between 0 and 10.
    max_values: :class:`int`
        The maximum number of files that must be uploaded for this component.
        Defaults to 1 and must be between 1 and 10.
    id: Optional[:class:`int`]
        The ID of this component.
    required: :class:`bool`
        Whether the component is required.
        Defaults to ``True``.
    )r   r   r   r   r   r>   r?   r@   rA   r   FileUploadComponentPayloadrB   r   c                   |d         | _         |                    dd          | _        |                    dd          | _        |                    dd          | _        |                    d          | _        d S )Nr   r   r   r   r   Tr   )r   r   r   r   r   r   r   s     rO   r   zFileUploadComponent.__init__  sb    ";/#xxa88#xxa88"hhz488!%$rR   "Literal[ComponentType.file_upload]c                    t           j        S r^   )r   file_uploadra   s    rO   rb   zFileUploadComponent.type       ((rR   c                t    | j         j        | j        | j        | j        | j        d}| j        
| j        |d<   |S )Nrb   r   r   r   r   r   )rb   rk   r   r   r   r   r   r   s     rO   ro   zFileUploadComponent.to_dict  sC    IO///
 /
 7 GGDMrR   N)r   r  rB   r   )rB   r  )rB   r  r   r=   rR   rO   r/   r/     s          8"I     09M88880 0 0 0 ) ) ) X)     rR   r/   c                  X    e Zd ZU dZdZded<   eZded<   ddZedd            Z	ddZ
dS )r0   a  Represents a radio group component from the Discord Bot UI Kit.

    This inherits from :class:`Component`.

    .. note::

        The user constructible and usable type for creating a radio group is
        :class:`discord.ui.RadioGroup` not this one.

    .. versionadded:: 2.7

    Attributes
    ------------
    custom_id: Optional[:class:`str`]
        The ID of the component that gets received during an interaction.
    id: Optional[:class:`int`]
        The ID of this component.
    required: :class:`bool`
        Whether the component is required.
        Defaults to ``True``.
    options: List[:class:`RadioGroupOption`]
        A list of options that can be selected in this group.
    )r   r   r   r   r>   r?   r@   rA   r   RadioGroupComponentPayloadrB   r   c                   |d         | _         |                    dd          | _        |                    d          | _        d |                    dg           D             | _        d S )Nr   r   Tr   c                B    g | ]}t                               |          S r=   )r1   r   r   s     rO   r   z0RadioGroupComponent.__init__.<locals>.<listcomp>  s(    /y/y/yW]0@0J0J60R0R/y/y/yrR   r   )r   r   r   r   r   r   s     rO   r   zRadioGroupComponent.__init__  s`    ";/"hhz488!%$/y/yaeaiaijsuwaxax/y/y/yrR   "Literal[ComponentType.radio_group]c                    t           j        S r^   )r   radio_groupra   s    rO   rb   zRadioGroupComponent.type  r  rR   c                    | j         j        | j        | j        d}| j        
| j        |d<   | j        rd | j        D             |d<   |S )N)rb   r   r   r   c                6    g | ]}|                                 S r=   r   r   s     rO   r   z/RadioGroupComponent.to_dict.<locals>.<listcomp>  "    !N!N!Nv&.."2"2!N!N!NrR   r   )rb   rk   r   r   r   r   r   s     rO   ro   zRadioGroupComponent.to_dict  s^    IO/
 /

 7 GGDM< 	O!N!N!N!N!NGIrR   N)r   r  rB   r   )rB   r  )rB   r  r   r=   rR   rO   r0   r0     s          0 "LIKKKK/8M8888z z z z ) ) ) X)     rR   r0   c                      e Zd ZdZdS )r1   aw  Represents a radio group's option

    These can be created by users.

    .. versionadded:: 2.7

    Parameters
    -----------
    label: :class:`str`
        The label of the option. This is displayed to users.
        Can only be up to 100 characters.
    value: :class:`str`
        The value of the option. This is not displayed to users.
        If not provided when constructed then it defaults to the label.
        Can only be up to 100 characters.
    description: Optional[:class:`str`]
        An additional description of the option, if any.
        Can only be up to 100 characters.
    default: :class:`bool`
        Whether this option is selected by default.

    Attributes
    -----------
    label: :class:`str`
        The label of the option. This is displayed to users.
    value: :class:`str`
        The value of the option. This is not displayed to users.
        If not provided when constructed then it defaults to the
        label.
    description: Optional[:class:`str`]
        An additional description of the option, if any.
    default: :class:`bool`
        Whether this option is selected by default.
    NrX   rr   rs   rt   r=   rR   rO   r1   r1             ! ! ! !rR   r1   c                  X    e Zd ZU dZdZded<   eZded<   ddZedd            Z	ddZ
dS )r2   a  Represents a checkbox group component from the Discord Bot UI Kit.

    This inherits from :class:`Component`.

    .. note::

        The user constructible and usable type for creating a checkbox group is
        :class:`discord.ui.CheckboxGroup` not this one.

    .. versionadded:: 2.7

    Attributes
    ------------
    custom_id: Optional[:class:`str`]
        The ID of the component that gets received during an interaction.
    id: Optional[:class:`int`]
        The ID of this component.
    required: :class:`bool`
        Whether the component is required.
        Defaults to ``True``.
    min_values: :class:`int`
        The minimum number of options that must be selected in this component.
        Must be between 0 and 10. Defaults to 0.
    max_values: :class:`int`
        The maximum number of options that can be selected in this component.
        Must be between 1 and 10. Defaults to 1.
    options: List[:class:`CheckboxGroupOption`]
        A list of options that can be selected in this group.
    )r   r   r   r   r   r   r>   r?   r@   rA   r   CheckboxGroupComponentPayloadrB   r   c               @   |d         | _         |                    dd          | _        |                    d          | _        |                    dd          | _        |                    dd          | _        d	 |                    d
g           D             | _        d S )Nr   r   Tr   r   r   r   r   c                B    g | ]}t                               |          S r=   )r3   r   r   s     rO   r   z3CheckboxGroupComponent.__init__.<locals>.<listcomp>h  s4     3
 3
 3
6<))&113
 3
 3
rR   r   )r   r   r   r   r   r   r   r   s     rO   r   zCheckboxGroupComponent.__init__b  s    ";/"hhz488!%$#xxa88#xxa883
 3
@DTV@W@W3
 3
 3
rR   %Literal[ComponentType.checkbox_group]c                    t           j        S r^   )r   checkbox_groupra   s    rO   rb   zCheckboxGroupComponent.typel  s     ++rR   c                    | j         j        | j        | j        | j        | j        d}| j        
| j        |d<   | j        rd | j        D             |d<   |S )Nr  r   c                6    g | ]}|                                 S r=   r   r   s     rO   r   z2CheckboxGroupComponent.to_dict.<locals>.<listcomp>|  r  rR   r   )rb   rk   r   r   r   r   r   r   r   s     rO   ro   zCheckboxGroupComponent.to_dictq  sh    IO//2
 2
 7 GGDM< 	O!N!N!N!N!NGIrR   N)r   r  rB   r   )rB   r  )rB   r  r   r=   rR   rO   r2   r2   ?  s          < "hIgggg/8M8888
 
 
 
 , , , X,     rR   r2   c                      e Zd ZdZdS )r3   az  Represents a checkbox group's option

    These can be created by users.

    .. versionadded:: 2.7

    Parameters
    -----------
    label: :class:`str`
        The label of the option. This is displayed to users.
        Can only be up to 100 characters.
    value: :class:`str`
        The value of the option. This is not displayed to users.
        If not provided when constructed then it defaults to the label.
        Can only be up to 100 characters.
    description: Optional[:class:`str`]
        An additional description of the option, if any.
        Can only be up to 100 characters.
    default: :class:`bool`
        Whether this option is selected by default.

    Attributes
    -----------
    label: :class:`str`
        The label of the option. This is displayed to users.
    value: :class:`str`
        The value of the option. This is not displayed to users.
        If not provided when constructed then it defaults to the
        label.
    description: Optional[:class:`str`]
        An additional description of the option, if any.
    default: :class:`bool`
        Whether this option is selected by default.
    Nr  r=   rR   rO   r3   r3     r  rR   r3   c                  X    e Zd ZU dZdZded<   eZded<   ddZedd            Z	ddZ
dS )r4   a8  Represents a checkbox component from the Discord Bot UI Kit.

    This inherits from :class:`Component`.

    .. note::

        The user constructible and usable type for creating a checkbox is
        :class:`discord.ui.Checkbox` not this one.

    .. versionadded:: 2.7

    Attributes
    ------------
    custom_id: Optional[:class:`str`]
        The ID of the component that gets received during an interaction.
    id: Optional[:class:`int`]
        The ID of this component.
    default: :class:`bool`
        Whether this checkbox is selected by default.
    )r   r}   r   r>   r?   r@   rA   r   CheckboxComponentPayloadrB   r   c                   |d         | _         |                    d          | _        |                    dd          | _        d S )Nr   r   r}   F)r   r   r   r}   r   s     rO   r   zCheckboxComponent.__init__  s8    ";/!%$!XXi77rR   Literal[ComponentType.checkbox]c                    t           j        S r^   )r   checkboxra   s    rO   rb   zCheckboxComponent.type  s     %%rR   c                \    | j         j        | j        | j        d}| j        
| j        |d<   |S )N)rb   r   r}   r   )rb   rk   r   r}   r   r   s     rO   ro   zCheckboxComponent.to_dict  s9    IO|-
 -

 7 GGDMrR   N)r   r  rB   r   )rB   r  )rB   r  r   r=   rR   rO   r4   r4     s          * "@I????/8M88888 8 8 8
 & & & X&	 	 	 	 	 	rR   r4   Nr   rm   r	  r
  rB   Optional[Component]c                n   | d         dk    rt          |           S | d         dk    rt          |           S | d         dk    rt          |           S | d         dv rt          |           S | d         dk    rt	          | |          S | d         dk    rt          |           S | d         dk    rt          | |          S | d         d	k    rt          | |          S | d         d
k    rt          | |          S | d         dk    rt          |           S | d         dk    rt          | |          S | d         dk    rt          | |          S | d         dk    rt          |           S | d         dk    rt          |           S | d         dk    rt          |           S | d         dk    rt          |           S d S )Nrb   r   r      )               	   
                                 )r"   r8   r#   r    r%   r9   r+   r'   r(   r)   r;   r.   r/   r0   r2   r4   )r   r	  s     rO   r   r     s   F|q	f		d||	f			f	(	($	f		e,,,	f		4   	f		!$...	f		$T5111	f		T5)))	f		!$'''	f		u%%%	f		dE***	f		"4(((	f		"4(((	f		%d+++	f		 &&& 
	rR   rd   )r   rm   r	  r
  rB   r  )ert   
__future__r   typingr   r   r   r   r   r	   r
   assetr   enumsr   r   r   r   r   r   r   r   r6  r   rs  r   r^  r   utilsr   r   r   partial_emojir   r   typing_extensionsr   types.componentsr   rm   r   r   r    r   r!   r   r"   r   r#   r   r$   r   r%   r  r&   r#  r'   rR  r(   r\  r)   re  r*   rG  r+   r  r,   ro  r-   r7  r.   r|  r/   r  r0   r  r1   RadioGroupOptionPayloadr2   r  r3   CheckboxGroupOptionPayloadr4   r  r   r5   abcr6   r	  r7   ActionRowChildComponentTypeSectionComponentTypeMessageComponentTyper   __all__ry   r8   r:   r9   r;   r   r=   rR   rO   <module>r     sr   0 # " " " " "                       	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 # " " " " "             8 8 8 8 8 8 8 8 8 8 2 2 2 2 2 2 2 2 .d&&&&&&                                                 4 &&&&&&"'(K"L / #	
 -/FHbbcM82" 2" 2" 2" 2" 2" 2" 2"j>8 >8 >8 >8 >8 >8 >8 >8B- - - - -	 - - -`b b b b bY b b bJ^ ^ ^ ^ ^ ^ ^ ^Bf f f f f: f f fR_ _ _ _ _	 _ _ _Dk
 k
 k
 k
 k
 k
 k
 k
\6 6 6 6 6y 6 6 6r: : : : : : : :z' ' ' ' ') ' ' 'T\
 \
 \
 \
 \

 \
 \
 \
~[ [ [ [ [ [ [ [|' ' ' ' 'I ' ' 'T7 7 7 7 7I 7 7 7t2 2 2 2 2 2 2 2jJ J J J J	 J J JZ5 5 5 5 5Y 5 5 5p> > > > >) > > >B3 3 3 3 3) 3 3 3l" " " " "z " " "J? ? ? ? ?Y ? ? ?D" " " " "* " " "J- - - - -	 - - -` '  '  '  '  '  '  'rR   