
    ;Si                     @    d dl Z ddlmZmZ ddlmZmZ  G d d      Zy)    N   )utilshints)typescustomc                   &    e Zd Ze	 	 	 	 dd       Zy)ButtonMethodsc                    | y	 | j                   dk(  r| S 	 t        j                  |       s| gg} n| rt        j                  | d         s| g} d}d}d}d}d}d}d}g }| D ]G  }	g }
|	D ]  }t	        |t
        j                        r|j                  |j                  }|j                  |j                  }|j                  |j                  }|j                  |j                  }|j                  |j                  }|j                  }n&t	        |t
        j                        r|j                  }t
        j                  j                  |      }||z  }|| z  }|j                   dk(  s|
j                  |        |
s$|j                  t!        j"                  |
             J |r|rt%        d      |rt!        j&                  |      S t!        j(                  ||||||      S # t        $ r Y w xY w)aq  
        Builds a :tl:`ReplyInlineMarkup` or :tl:`ReplyKeyboardMarkup` for
        the given buttons.

        Does nothing if either no buttons are provided or the provided
        argument is already a reply markup.

        You should consider using this method if you are going to reuse
        the markup very often. Otherwise, it is not necessary.

        This method is **not** asynchronous (don't use ``await`` on it).

        Arguments
            buttons (`hints.MarkupLike`):
                The button, list of buttons, array of buttons or markup
                to convert into a markup.

        Example
            .. code-block:: python

                from telethon import Button

                markup = client.build_reply_markup(Button.inline('hi'))
                # later
                await client.send_message(chat, 'click me', buttons=markup)
        Nl   E r   Fitz)You cannot mix inline with normal buttons)rowsresize
single_use	selective
persistentplaceholder)SUBCLASS_OF_IDAttributeErrorr   is_list_like
isinstancer   Buttonr   r   r   r   r   buttonMessageButton
_is_inlineappendr   KeyboardButtonRow
ValueErrorReplyInlineMarkupReplyKeyboardMarkup)buttons	is_inline	is_normalr   r   r   r   r   r   rowcurrentr   inlines                \/var/www/OnlineNewsSite/project/venv/lib/python3.12/site-packages/telethon/client/buttons.pybuild_reply_markupz ButtonMethods.build_reply_markup   s   < ?	%%3 4
 !!'*ykG 2 271: >iG		
	
 	>CG +ffmm4}}0!'((4%+%6%6
''3$*$4$4	((4%+%6%6
))5&,&8&8#]]F(<(<=#]]F11&9V#	Z'	((I5NN6*-+0 E33G<=7	>: HII**400((!!#
 	
e  		s   G, ,	G98G9N)r   z!typing.Optional[hints.MarkupLike]returnz&typing.Optional[types.TypeReplyMarkup])__name__
__module____qualname__staticmethodr%        r$   r	   r	      s(    \
8\
	1\
 \
r,   r	   )typing r   r   tlr   r   r	   r+   r,   r$   <module>r0      s      ^
 ^
r,   