o
    M,öhµ  ã                   @   s*   d dl mZ d dlmZ G dd„ dƒZdS )é    )ÚOptional©ÚAccountc                   @   s˜   e Zd ZdZdZdZddd„Zedee	 fdd	„ƒZ
ede	fd
d„ƒZedee	 fdd„ƒZdee fdd„Zdeddfdd„Zddd„Zddd„ZdS )ÚDialogz6Represents a FedCM dialog that can be interacted with.ÚAccountChooserÚAutoReauthnÚreturnNc                 C   s
   || _ d S )N)Ú_driver)ÚselfÚdriver© r   úr/var/www/www-root/data/www/bot.pdev.uz/venv/lib/python3.10/site-packages/selenium/webdriver/common/fedcm/dialog.pyÚ__init__   s   
zDialog.__init__c                 C   ó
   | j jjS )z2Gets the type of the dialog currently being shown.)r	   ÚfedcmÚdialog_type©r
   r   r   r   Útype    ó   
zDialog.typec                 C   r   )zGets the title of the dialog.)r	   r   Útitler   r   r   r   r   %   r   zDialog.titlec                 C   s   | j jj}|r| d¡S dS )z Gets the subtitle of the dialog.ÚsubtitleN)r	   r   r   Úget)r
   Úresultr   r   r   r   *   s   
zDialog.subtitlec                 C   s   | j jj}dd„ |D ƒS )z.Gets the list of accounts shown in the dialog.c                 S   s   g | ]}t |ƒ‘qS r   r   )Ú.0Úaccountr   r   r   Ú
<listcomp>3   s    z'Dialog.get_accounts.<locals>.<listcomp>)r	   r   Úaccount_list)r
   Úaccountsr   r   r   Úget_accounts0   s   
zDialog.get_accountsÚindexc                 C   s   | j j |¡ dS )z,Selects an account from the dialog by index.N)r	   r   Úselect_account)r
   r   r   r   r   r    5   s   zDialog.select_accountc                 C   ó   | j j ¡  dS )z)Clicks the continue button in the dialog.N)r	   r   Úacceptr   r   r   r   r"   9   ó   zDialog.acceptc                 C   r!   )zCancels/dismisses the dialog.N)r	   r   Údismissr   r   r   r   r$   =   r#   zDialog.dismiss)r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚDIALOG_TYPE_ACCOUNT_LISTÚDIALOG_TYPE_AUTO_REAUTHr   Úpropertyr   Ústrr   r   r   Úlistr   r   Úintr    r"   r$   r   r   r   r   r      s    

r   N)Útypingr   Ú'selenium.webdriver.common.fedcm.accountr   r   r   r   r   r   Ú<module>   s   