o
    Ñ·6i“  ã                   @   s   d dl mZ G dd„ dƒZdS )é    ©ÚAccountc                   @   s˜   e Zd ZdZdZdZddd„ZededB fdd	„ƒZ	edefd
d„ƒZ
ededB 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   úk/var/www/hoanhtaovolam_webdjango/env/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>2   s    z'Dialog.get_accounts.<locals>.<listcomp>)r   r   Úaccount_list)r	   Úaccountsr   r   r   Úget_accounts/   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   4   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!   8   ó   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   ÚpropertyÚstrr   r   r   Úlistr   r   Úintr   r!   r#   r   r   r   r   r      s    

r   N)Ú'selenium.webdriver.common.fedcm.accountr   r   r   r   r   r   Ú<module>   s   