Ë
    `§1hÇ  ã                   ól   — d dl mZmZ d dl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  G d„ d	«      Zy
)é    )ÚOptionalÚUnion)ÚNoSuchElementExceptionÚNoSuchFrameExceptionÚNoSuchWindowException)ÚAlert)ÚBy)Ú
WebElementé   )ÚCommandc                   ó¤   — e Zd Zdd„Zedefd„«       Zedefd„«       Zdd„Z	de
eeef   ddfd„Zdd	ee   ddfd
„Zdd„Zdeddfd„Zdeddfd„Zy)ÚSwitchToÚreturnNc                 ó8   — dd l }|j                  |«      | _        y )Nr   )ÚweakrefÚproxyÚ_driver)ÚselfÚdriverr   s      úa/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/selenium/webdriver/remote/switch_to.pyÚ__init__zSwitchTo.__init__   s   € Ûà—}‘} VÓ,ˆ�ó    c                 óZ   — | j                   j                  t        j                  «      d   S )z¡Returns the element with focus, or BODY if nothing has focus.

        :Usage:
            ::

                element = driver.switch_to.active_element
        Úvalue)r   Úexecuter   ÚW3C_GET_ACTIVE_ELEMENT©r   s    r   Úactive_elementzSwitchTo.active_element"   s$   € ð �|‰|×#Ñ#¤G×$BÑ$BÓCÀGÑLÐLr   c                 óH   — t        | j                  «      }|j                  }|S )z€Switches focus to an alert on the page.

        :Usage:
            ::

                alert = driver.switch_to.alert
        )r   r   Útext)r   ÚalertÚ_s      r   r!   zSwitchTo.alert-   s    € ô �d—l‘lÓ#ˆØ�J‰JˆØˆr   c                 ó\   — | j                   j                  t        j                  ddi«       y)zSwitch focus to the default frame.

        :Usage:
            ::

                driver.switch_to.default_content()
        ÚidN)r   r   r   ÚSWITCH_TO_FRAMEr   s    r   Údefault_contentzSwitchTo.default_content:   s"   € ð 	�‰×ÑœW×4Ñ4°t¸T°lÕCr   Úframe_referencec                 ó‚  — t        |t        «      r+	 | j                  j                  t        j
                  |«      }| j                  j                  t        j                  d|i«       y# t        $ rL 	 | j                  j                  t        j                  |«      }n# t        $ r}t        |«      |‚d}~ww xY wY Œ�w xY w)aï  Switches focus to the specified frame, by index, name, or
        webelement.

        :Args:
         - frame_reference: The name of the window to switch to, an integer representing the index,
                            or a webelement that is an (i)frame to switch to.

        :Usage:
            ::

                driver.switch_to.frame("frame_name")
                driver.switch_to.frame(1)
                driver.switch_to.frame(driver.find_elements(By.TAG_NAME, "iframe")[0])
        Nr$   )Ú
isinstanceÚstrr   Úfind_elementr	   ÚIDr   ÚNAMEr   r   r   r%   )r   r'   Úexcs      r   ÚframezSwitchTo.frameD   s¦   € ô �o¤sÔ+ðIØ"&§,¡,×";Ñ";¼B¿E¹EÀ?Ó"S�ð 	�‰×ÑœW×4Ñ4°t¸_Ð6MÕNøô *ò IðIØ&*§l¡l×&?Ñ&?ÄÇÁÈÓ&Y‘OøÜ-ò IÜ.¨Ó?ÀSÐHûðIúñ $ðIús5   ’*A) Á)	B>Á3*BÂB>Â	B8Â'B3Â3B8Â8B>Â=B>Ú	type_hintc                 óŠ   — | j                   j                  t        j                  d|i«      d   }| j	                  |d   «       y)a  Switches to a new top-level browsing context.

        The type hint can be one of "tab" or "window". If not specified the
        browser will automatically select it.

        :Usage:
            ::

                driver.switch_to.new_window("tab")
        Útyper   ÚhandleN)r   r   r   Ú
NEW_WINDOWÚ_w3c_window)r   r0   r   s      r   Ú
new_windowzSwitchTo.new_window^   s<   € ð —‘×$Ñ$¤W×%7Ñ%7¸&À)Ð9LÓMÈgÑVˆØ×Ñ˜˜x™Õ)r   c                 óV   — | j                   j                  t        j                  «       y)zàSwitches focus to the parent context. If the current context is the
        top level browsing context, the context remains unchanged.

        :Usage:
            ::

                driver.switch_to.parent_frame()
        N)r   r   r   ÚSWITCH_TO_PARENT_FRAMEr   s    r   Úparent_framezSwitchTo.parent_framel   s   € ð 	�‰×ÑœW×;Ñ;Õ<r   Úwindow_namec                 ó&   — | j                  |«       y)zßSwitches focus to the specified window.

        :Args:
         - window_name: The name or window handle of the window to switch to.

        :Usage:
            ::

                driver.switch_to.window("main")
        N)r5   )r   r:   s     r   ÚwindowzSwitchTo.windoww   s   € ð 	×Ñ˜Õ%r   c                 ó
  ‡ — ˆ fd„}	  ||«       y # t         $ rh ‰ j                  j                  }‰ j                  j                  }|D ]-  } ||«       ‰ j                  j	                  d«      }||k(  sŒ, Y y   ||«       ‚ w xY w)Nc                 ó^   •— ‰j                   j                  t        j                  d| i«       y )Nr3   )r   r   r   ÚSWITCH_TO_WINDOW)Úhr   s    €r   Úsend_handlez)SwitchTo._w3c_window.<locals>.send_handle…   s!   ø€ Ø�L‰L× Ñ ¤×!9Ñ!9¸HÀa¸=ÕIr   zreturn window.name)r   r   Úcurrent_window_handleÚwindow_handlesÚexecute_script)r   r:   rA   Úoriginal_handleÚhandlesr3   Úcurrent_names   `      r   r5   zSwitchTo._w3c_window„   s‡   ø€ ô	Jð	á˜Õ$øÜ$ò 
	à"Ÿl™l×@Ñ@ˆOØ—l‘l×1Ñ1ˆGØ!ò �Ù˜FÔ#Ø#Ÿ|™|×:Ñ:Ð;OÓP�Ø ,Ó.Úð	ñ
 ˜Ô(Øð
	ús   ˆ ‘A"BÁ4BÁ7B)r   N)N)Ú__name__Ú
__module__Ú__qualname__r   Úpropertyr
   r   r   r!   r&   r   r*   Úintr/   r   r6   r9   r<   r5   © r   r   r   r      sª   „ ó-ð
 ðM 
ò Mó ðMð ð
�uò 
ó ð
óDðO U¨3°°ZÐ+?Ñ%@ð OÀTó Oñ4* H¨S¡Mð *¸Tó *ó	=ð& #ð &¨$ó &ð sð ¨tô r   r   N)Útypingr   r   Úselenium.common.exceptionsr   r   r   Úselenium.webdriver.common.alertr   Úselenium.webdriver.common.byr	   Ú$selenium.webdriver.remote.webelementr
   Úcommandr   r   rM   r   r   ú<module>rT      s(   ð÷$ #ç jÑ jÝ 1Ý +Ý ;å ÷yò yr   