
    ,j                         d Z ddl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 erddlmZ ddlmZ dgZ G d de	      Zy	)
z4Module contains the class to create a secret prompt.    )TYPE_CHECKINGAnyCallableListOptionalTuple)InputPrompt)InquirerPyDefaultInquirerPyKeybindingsInquirerPyMessageInquirerPySessionResultInquirerPyStyleInquirerPyValidate)Input)OutputSecretPromptc            +           e Zd ZdZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddedee   dedededed	ed
e	dee
   dedeeegef      deeegef      dee   de	de	de	dedee   ded   ded   ddf* fdZdeeeef      f fdZ xZS )r   u  Create a text prompt which transforms the input to asterisks while typing.

    A wrapper class around :class:`~prompt_toolkit.shortcuts.PromptSession`.

    Args:
        message: The question to ask the user.
            Refer to :ref:`pages/dynamic:message` documentation for more details.
        style: An :class:`InquirerPyStyle` instance.
            Refer to :ref:`Style <pages/style:Alternate Syntax>` documentation for more details.
        vi_mode: Use vim keybinding for the prompt.
            Refer to :ref:`pages/kb:Keybindings` documentation for more details.
        default: Set the default text value of the prompt.
            Refer to :ref:`pages/dynamic:default` documentation for more details.
        qmark: Question mark symbol. Custom symbol that will be displayed infront of the question before its answered.
        amark: Answer mark symbol. Custom symbol that will be displayed infront of the question after its answered.
        instruction: Short instruction to display next to the question.
        long_instruction: Long instructions to display at the bottom of the prompt.
        validate: Add validation to user input.
            Refer to :ref:`pages/validator:Validator` documentation for more details.
        invalid_message: Error message to display when user input is invalid.
            Refer to :ref:`pages/validator:Validator` documentation for more details.
        transformer: A function which performs additional transformation on the value that gets printed to the terminal.
            Different than `filter` parameter, this is only visual effect and won’t affect the actual value returned by :meth:`~InquirerPy.base.simple.BaseSimplePrompt.execute`.
            Refer to :ref:`pages/dynamic:transformer` documentation for more details.
        filter: A function which performs additional transformation on the result.
            This affects the actual value returned by :meth:`~InquirerPy.base.simple.BaseSimplePrompt.execute`.
            Refer to :ref:`pages/dynamic:filter` documentation for more details.
        keybindings: Customise the builtin keybindings.
            Refer to :ref:`pages/kb:Keybindings` for more details.
        wrap_lines: Soft wrap question lines when question exceeds the terminal width.
        raise_keyboard_interrupt: Raise the :class:`KeyboardInterrupt` exception when `ctrl-c` is pressed. If false, the result
            will be `None` and the question is skiped.
        mandatory: Indicate if the prompt is mandatory. If True, then the question cannot be skipped.
        mandatory_message: Error message to show when user attempts to skip mandatory prompt.
        session_result: Used internally for :ref:`index:Classic Syntax (PyInquirer)`.
        input: Used internally and will be removed in future updates.
        output: Used internally and will be removed in future updates.

    Examples:
        >>> from InquirerPy import inquirer
        >>> result = inquirer.secret(message="Password:").execute()
        >>> print(f"Password: {result}")
        Password: asdf123
    Nmessagestyledefaultqmarkamarkinstructionlong_instructionvi_modevalidateinvalid_messagetransformerfilterkeybindings
wrap_linesraise_keyboard_interrupt	mandatorymandatory_messagesession_resultinputr   outputr   returnc                 N    t         |   |||||||||	|
d||||||||||       y )NT)r   r   r   r   r   r   r   r   r   r   is_passwordr   r   r    r!   r"   r#   r$   r%   r&   r'   )super__init__)selfr   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   	__class__s                        [/home/ubuntu/waydroid_script/venv/lib/python3.12/site-packages/InquirerPy/prompts/secret.pyr,   zSecretPrompt.__init__C   sV    . 	#-+##!%=/)+ 	 	
    c                     d| j                   rd| j                   z  ndf}d| j                  d   sdn.ddj                  | j                  d   D cg c]  }d c}      z  f}t        |   ||      S c c}w )	a;  Get message to display infront of the input buffer.

        Args:
            pre_answer: The formatted text to display before answering the question.
            post_answer: The formatted text to display after answering the question.

        Returns:
            Formatted text in list of tuple format.
        zclass:instructionz %s  zclass:answerresult z %s*)r   statusjoinr+   _get_prompt_message)r-   
pre_answer_post_answerr.   s       r/   r8   z SecretPrompt._get_prompt_messager   s      )-)9)9FT%%%s


 ;;x( t{{8/D!E!#!EFF	
 w*:{CC "Fs   	A3)Nr4   ?r<   r4   r4   FNzInvalid inputNNNTTTzMandatory promptNNN)__name__
__module____qualname____doc__r   r   r   r
   strboolr   r   r   r   r   r,   r   r   r8   __classcell__)r.   s   @r/   r   r      s|   +` ,0%' "15.6:157;)-!3<@#'%)+-
"-
 (-
 #	-

 -
 -
 -
 -
 -
 -.-
 -
 hucz23-
 3%*-.-
 34-
 -
  #'!-
" #-
$ %-
& !!89'-
(  )-
* "+-
, 
--
^DT%S/%: D Dr0   N)r@   typingr   r   r   r   r   r   InquirerPy.prompts.inputr	   InquirerPy.utilsr
   r   r   r   r   r   prompt_toolkit.input.baser   prompt_toolkit.output.baser   __all__r    r0   r/   <module>rK      s>    : F F 0  /1
qD; qDr0   