o
    N,hC{                  
   @   sf  d dl Z d dlmZ d dlmZmZmZmZmZ d dl	m
Z
mZmZmZmZ d dlmZ d dlmZmZ 	 edZedZeeef Zd	ed
eegef fddZd	ed
eegef fddZdeeef d
eegef fddZded
eegef fddZded
eegef fddZded
eegef fddZded
eegef fddZ deeef d
eegeed ef f fddZ!ded
eegeed ef f fd d!Z"dYded#ed
eed ef fd$d%Z#deeef d
eege$e f fd&d'Z%deeef d
eege$e f fd(d)Z&deeef d
eegee$e ed f f fd*d+Z'deeef d,ed
eegef fd-d.Z(deeef d,ed
eegef fd/d0Z)deeef d1ed,ed
eegef fd2d3Z*deeeef eef d
eegef fd4d5Z+deeeeef f d
eegeeef f fd6d7Z,deeeeef f d
eegeeef f fd8d9Z-d:eeeeef f d
eegeed ef f fd;d<Z.ded
eegef fd=d>Z/ded
eegef fd?d@Z0deeef d
eegef fdAdBZ1dedCed
eegef fdDdEZ2deeef dCed
eegef fdFdGZ3dHe4d
eegef fdIdJZ5dKe$e d
eegef fdLdMZ6d
eegeeed f f fdNdOZ7deeef d1ed
eegef fdPdQZ8dReegef d
eegeed ef f fdSdTZ9dReegeeed f f d
eegee$e ed f f fdUdVZ:dReegef d
eegef fdWdXZ;dS )Z    N)Iterable)AnyCallableLiteralTypeVarUnion)NoAlertPresentExceptionNoSuchElementExceptionNoSuchFrameExceptionStaleElementReferenceExceptionWebDriverException)Alert)	WebDriver
WebElementDTtitlereturnc                       dt f fdd}|S )zAn expectation for checking the title of a page.

    Parameters:
    -----------
    title : str
        The expected title, which must be an exact match.

    Returns:
    -------
    boolean : True if the title matches, False otherwise.
    driverc                    s
   | j  kS Nr   r   r    z/var/www/www-root/data/www/bot.pdev.uz/venv/lib/python3.10/site-packages/selenium/webdriver/support/expected_conditions.py
_predicate8      
ztitle_is.<locals>._predicater   r   r   r   r   r   title_is+      r   c                    r   )a  An expectation for checking that the title contains a case-sensitive
    substring.

    Parameters:
    -----------
    title : str
        The fragment of title expected.

    Returns:
    -------
    boolean : True when the title matches, False otherwise.
    r   c                    
    | j v S r   r   r   r   r   r   r   L   r   z"title_contains.<locals>._predicater   r   r   r   r   title_contains>      r"   locatorc                    r   )az  An expectation for checking that an element is present on the DOM of a
    page. This does not necessarily mean that the element is visible.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the element.

    Returns:
    -------
    WebElement : The WebElement once it is located.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> element = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.NAME, "q")))
    r   c                    
   | j   S r   )find_elementr   r$   r   r   r   g   r   z/presence_of_element_located.<locals>._predicateWebDriverOrWebElementr$   r   r   r'   r   presence_of_element_locatedR      r+   urlc                    r   )a  An expectation for checking that the current url contains a case-
    sensitive substring.

    Parameters:
    -----------
    url : str
        The fragment of url expected.

    Returns:
    -------
    boolean : True when the url matches, False otherwise.
    r   c                    r!   r   current_urlr   r-   r   r   r   {   r   z url_contains.<locals>._predicater   r-   r   r   r0   r   url_containsm   r#   r2   patternc                    r   )aQ  An expectation for checking the current url.

    Parameters:
    -----------
    pattern : str
        The pattern to match with the current url.

    Returns:
    -------
    boolean : True when the pattern matches, False otherwise.

    Notes:
    ------
    More powerful than url_contains, as it allows for regular expressions.
    r   c                    s   t  | jd uS r   )researchr/   r   r3   r   r   r         zurl_matches.<locals>._predicater   )r3   r   r   r6   r   url_matches   s   r8   c                    r   )zAn expectation for checking the current url.

    Parameters:
    -----------
    url : str
        The expected url, which must be an exact match.

    Returns:
    -------
    boolean : True when the url matches, False otherwise.
    r   c                    s
    | j kS r   r.   r   r0   r   r   r      r   zurl_to_be.<locals>._predicater   r1   r   r0   r   	url_to_be   r    r9   c                    r   )a  An expectation for checking the current url is different than a given
    string.

    Parameters:
    -----------
    url : str
        The expected url, which must not be an exact match.

    Returns:
    -------
    boolean : True when the url does not match, False otherwise
    r   c                    s
    | j kS r   r.   r   r0   r   r   r      r   zurl_changes.<locals>._predicater   r1   r   r0   r   url_changes   r#   r:   Fc                    r   )a  An expectation for checking that an element is present on the DOM of a
    page and visible. Visibility means that the element is not only displayed
    but also has a height and width that is greater than 0.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the element.

    Returns:
    -------
    WebElement : The WebElement once it is located and visible.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> element = WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.NAME, "q")))
    r   c                    s&   zt | j  W S  ty   Y dS w NF)_element_if_visibler&   r   r   r'   r   r   r      s
   z1visibility_of_element_located.<locals>._predicater(   r*   r   r'   r   visibility_of_element_located   s   r=   elementc                        fdd}|S )a1  An expectation for checking that an element, known to be present on the
    DOM of a page, is visible.

    Parameters:
    -----------
    element : WebElement
        The WebElement to check.

    Returns:
    -------
    WebElement : The WebElement once it is visible.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> element = WebDriverWait(driver, 10).until(EC.visibility_of(driver.find_element(By.NAME, "q")))

    Notes:
    ------
    Visibility means that the element is not only displayed but also has
    a height and width that is greater than 0. element is the WebElement
    returns the (same) WebElement once it is visible
    c                    s   t  S r   r<   _r>   r   r   r         z!visibility_of.<locals>._predicater   r>   r   r   rC   r   visibility_of   s   rF   T
visibilityc                 C   s   |   |kr| S dS )a|  An expectation for checking that an element, known to be present on the
    DOM of a page, is of the expected visibility.

    Parameters:
    -----------
    element : WebElement
        The WebElement to check.
    visibility : bool
        The expected visibility of the element.

    Returns:
    -------
    WebElement : The WebElement once it is visible or not visible.
    F)is_displayed)r>   rG   r   r   r   r<     s   r<   c                    r   )ag  An expectation for checking that there is at least one element present
    on a web page.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the element.

    Returns:
    -------
    List[WebElement] : The list of WebElements once they are located.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> elements = WebDriverWait(driver, 10).until(EC.presence_of_all_elements_located((By.CLASS_NAME, "foo")))
    r   c                    r%   r   find_elementsr   r'   r   r   r   (  r   z4presence_of_all_elements_located.<locals>._predicater(   r*   r   r'   r    presence_of_all_elements_located  r,   rK   c                    r   )au  An expectation for checking that there is at least one element visible
    on a web page.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the element.

    Returns:
    -------
    List[WebElement] : The list of WebElements once they are located and visible.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> elements = WebDriverWait(driver, 10).until(EC.visibility_of_any_elements_located((By.CLASS_NAME, "foo")))
    r   c                    s   dd | j   D S )Nc                 S   s   g | ]}t |r|qS r   r@   ).0r>   r   r   r   
<listcomp>D  s    zJvisibility_of_any_elements_located.<locals>._predicate.<locals>.<listcomp>rI   r   r'   r   r   r   C  s   z6visibility_of_any_elements_located.<locals>._predicater(   r*   r   r'   r   "visibility_of_any_elements_located.  r,   rN   c                    r   )a  An expectation for checking that all elements are present on the DOM of
    a page and visible. Visibility means that the elements are not only
    displayed but also has a height and width that is greater than 0.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the elements.

    Returns:
    -------
    List[WebElement] : The list of WebElements once they are located and visible.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> elements = WebDriverWait(driver, 10).until(EC.visibility_of_all_elements_located((By.CLASS_NAME, "foo")))
    r   c                    sD   z| j   }|D ]}t|ddr W dS q|W S  ty!   Y dS w )NFrG   )rJ   r<   r   )r   elementsr>   r'   r   r   r   a  s   
z6visibility_of_all_elements_located.<locals>._predicater(   r*   r   r'   r   "visibility_of_all_elements_locatedI  s   
rQ   text_c                       dt f fdd}|S )a  An expectation for checking if the given text is present in the
    specified element.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the element.
    text_ : str
        The text to be present in the element.

    Returns:
    -------
    boolean : True when the text is present, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_text_in_element = WebDriverWait(driver, 10).until(
            EC.text_to_be_present_in_element((By.CLASS_NAME, "foo"), "bar")
        )
    r   c                    s,   z| j   j}|v W S  ty   Y dS w r;   )r&   textr   r   element_textr$   rR   r   r   r     s   
z1text_to_be_present_in_element.<locals>._predicater(   r$   rR   r   r   rW   r   text_to_be_present_in_elementn     rY   c                    rS   )a  An expectation for checking if the given text is present in the
    element's value.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the element.
    text_ : str
        The text to be present in the element's value.

    Returns:
    -------
    boolean : True when the text is present, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_text_in_element_value = WebDriverWait(driver, 10).until(
    ...     EC.text_to_be_present_in_element_value((By.CLASS_NAME, "foo"), "bar")
    ... )
    r   c                    s>   z| j   d}|d u rW dS |v W S  ty   Y dS w )NvalueFr&   get_attributer   rU   rW   r   r   r        
z7text_to_be_present_in_element_value.<locals>._predicater(   rX   r   rW   r   #text_to_be_present_in_element_value  s   	r_   
attribute_c                    s   dt f fdd}|S )a)  An expectation for checking if the given text is present in the
    element's attribute.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the element.
    attribute_ : str
        The attribute to check the text in.
    text_ : str
        The text to be present in the element's attribute.

    Returns:
    -------
    boolean : True when the text is present, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_text_in_element_attribute = WebDriverWait(driver, 10).until(
    ...     EC.text_to_be_present_in_element_attribute((By.CLASS_NAME, "foo"), "bar", "baz")
    ... )
    r   c                    s>   z| j   }|d u rW dS |v W S  ty   Y dS w r;   r\   rU   r`   r$   rR   r   r   r     r^   z;text_to_be_present_in_element_attribute.<locals>._predicater(   )r$   r`   rR   r   r   ra   r   'text_to_be_present_in_element_attribute  s   	rb   c                    r   )a  An expectation for checking whether the given frame is available to
    switch to.

    Parameters:
    -----------
    locator : Union[Tuple[str, str], str, WebElement]
        Used to find the frame.

    Returns:
    -------
    boolean : True when the frame is available, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it("frame_name"))

    Notes:
    ------
    If the frame is available it switches the given driver to the
    specified frame.
    r   c                    sT   zt  trt  ts| j| j   W dS | j  W dS  ty)   Y dS w )NTF)
isinstancer   str	switch_toframer&   r
   r   r'   r   r   r     s   z:frame_to_be_available_and_switch_to_it.<locals>._predicater   r*   r   r'   r   &frame_to_be_available_and_switch_to_it     
rg   c                    r   )a  An Expectation for checking that an element is either invisible or not
    present on the DOM.

    Parameters:
    -----------
    locator : Union[WebElement, Tuple[str, str]]
        Used to find the element.

    Returns:
    -------
    boolean : True when the element is invisible or not present, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_invisible = WebDriverWait(driver, 10).until(EC.invisibility_of_element_located((By.CLASS_NAME, "foo")))

    Notes:
    ------
    - In the case of NoSuchElement, returns true because the element is not
    present in DOM. The try block checks if the element is present but is
    invisible.
    - In the case of StaleElementReference, returns true because stale element
    reference implies that element is no longer visible.
    r   c              	      s@   z }t |ts| j| }t|ddW S  ttfy   Y dS w )NFrO   T)rc   r   r&   r<   r	   r   )r   targetr'   r   r   r   (  s   

z3invisibility_of_element_located.<locals>._predicater(   r*   r   r'   r   invisibility_of_element_located	  s   rj   c                 C   s   t | S )a  An Expectation for checking that an element is either invisible or not
    present on the DOM.

    Parameters:
    -----------
    element : Union[WebElement, Tuple[str, str]]
        Used to find the element.

    Returns:
    -------
    boolean : True when the element is invisible or not present, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_invisible_or_not_present = WebDriverWait(driver, 10).until(
    ...     EC.invisibility_of_element(driver.find_element(By.CLASS_NAME, "foo"))
    ... )
    )rj   rC   r   r   r   invisibility_of_element9  s   rk   markc                    r   )am  An Expectation for checking an element is visible and enabled such that
    you can click it.

    Parameters:
    -----------
    mark : Union[WebElement, Tuple[str, str]]
        Used to find the element.

    Returns:
    -------
    WebElement : The WebElement once it is located and clickable.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> element = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.CLASS_NAME, "foo")))
    r   c                    s8    }t |ts| j| }t|| }|r| r|S dS r;   )rc   r   r&   rF   
is_enabled)r   ri   r>   rl   r   r   r   m  s   

z+element_to_be_clickable.<locals>._predicater(   )rl   r   r   rn   r   element_to_be_clickableT  s   	ro   c                    r?   )aQ  Wait until an element is no longer attached to the DOM.

    Parameters:
    -----------
    element : WebElement
        The element to wait for.

    Returns:
    -------
    boolean : False if the element is still attached to the DOM, true otherwise.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_element_stale = WebDriverWait(driver, 10).until(EC.staleness_of(driver.find_element(By.CLASS_NAME, "foo")))
    c                    s$   z    W dS  ty   Y dS w NFT)rm   r   rA   rC   r   r   r     s   z staleness_of.<locals>._predicater   rE   r   rC   r   staleness_ofy  s   rq   c                    r?   )aZ  An expectation for checking the selection is selected.

    Parameters:
    -----------
    element : WebElement
        The WebElement to check.

    Returns:
    -------
    boolean : True if the element is selected, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_selected = WebDriverWait(driver, 10).until(EC.element_to_be_selected(driver.find_element(
            By.CLASS_NAME, "foo"))
        )
    c                    s      S r   is_selectedrA   rC   r   r   r     rD   z*element_to_be_selected.<locals>._predicater   rE   r   rC   r   element_to_be_selected  s   rt   c                    r   )aB  An expectation for the element to be located is selected.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the element.

    Returns:
    -------
    boolean : True if the element is selected, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_selected = WebDriverWait(driver, 10).until(EC.element_located_to_be_selected((By.CLASS_NAME, "foo")))
    r   c                    s   | j    S r   )r&   rs   r   r'   r   r   r        z2element_located_to_be_selected.<locals>._predicater(   r*   r   r'   r   element_located_to_be_selected  s   rv   rs   c                    s    fdd}|S )a  An expectation for checking if the given element is selected.

    Parameters:
    -----------
    element : WebElement
        The WebElement to check.
    is_selected : bool

    Returns:
    -------
    boolean : True if the element's selection state is the same as is_selected

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_selected = WebDriverWait(driver, 10).until(
    ...     EC.element_selection_state_to_be(driver.find_element(By.CLASS_NAME, "foo"), True)
    ... )
    c                    s      kS r   rr   rA   r>   rs   r   r   r     s   z1element_selection_state_to_be.<locals>._predicater   )r>   rs   r   r   rw   r   element_selection_state_to_be  s   rx   c                    rS   )a  An expectation to locate an element and check if the selection state
    specified is in that state.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the element.
    is_selected : bool

    Returns:
    -------
    boolean : True if the element's selection state is the same as is_selected

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_selected = WebDriverWait(driver, 10).until(EC.element_located_selection_state_to_be(
            (By.CLASS_NAME, "foo"), True)
        )
    r   c                    s.   z| j  }|  kW S  ty   Y dS w r;   )r&   rs   r   )r   r>   rs   r$   r   r   r     s   
z9element_located_selection_state_to_be.<locals>._predicater(   )r$   rs   r   r   ry   r   %element_located_selection_state_to_be  s   rz   num_windowsc                    r   )a  An expectation for the number of windows to be a certain value.

    Parameters:
    -----------
    num_windows : int
        The expected number of windows.

    Returns:
    -------
    boolean : True when the number of windows matches, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_number_of_windows = WebDriverWait(driver, 10).until(EC.number_of_windows_to_be(2))
    r   c                    s   t | j kS r   lenwindow_handlesr   r{   r   r   r   "  ru   z+number_of_windows_to_be.<locals>._predicater   )r{   r   r   r   r   number_of_windows_to_be  s   r   current_handlesc                    r   )aq  An expectation that a new window will be opened and have the number of
    windows handles increase.

    Parameters:
    -----------
    current_handles : List[str]
        The current window handles.

    Returns:
    -------
    boolean : True when a new window is opened, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.support.ui import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_new_window_opened = WebDriverWait(driver, 10).until(EC.new_window_is_opened(driver.window_handles))
    r   c                    s   t | jt  kS r   r|   r   r   r   r   r   =  r7   z(new_window_is_opened.<locals>._predicater   )r   r   r   r   r   new_window_is_opened(  r,   r   c                  C   s   dt fdd} | S )a  An expectation for checking if an alert is currently present and
    switching to it.

    Returns:
    -------
    Alert : The Alert once it is located.

    Example:
    --------
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> alert = WebDriverWait(driver, 10).until(EC.alert_is_present())

    Notes:
    ------
    If the alert is present it switches the given driver to it.
    r   c                 S   s    z| j jW S  ty   Y dS w r;   )re   alertr   r   r   r   r   r   V  s
   
z$alert_is_present.<locals>._predicater   )r   r   r   r   alert_is_presentC  s   r   c                    rS   )a  An expectation for checking if the given attribute is included in the
    specified element.

    Parameters:
    -----------
    locator : Tuple[str, str]
        Used to find the element.
    attribute_ : str
        The attribute to check.

    Returns:
    -------
    boolean : True when the attribute is included, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> is_attribute_in_element = WebDriverWait(driver, 10).until(
    ...     EC.element_attribute_to_include((By.CLASS_NAME, "foo"), "bar")
    ... )
    r   c                    s0   z| j   }|d uW S  ty   Y dS w r;   r\   )r   element_attributer`   r$   r   r   r   x  s   
z0element_attribute_to_include.<locals>._predicater(   )r$   r`   r   r   r   r   element_attribute_to_include_  rZ   r   expected_conditionsc                     r   )a0  An expectation that any of multiple expected conditions is true.

    Parameters:
    -----------
    expected_conditions : Callable[[D], T]
        The list of expected conditions to check.

    Returns:
    -------
    T : The result of the first matching condition, or False if none do.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> element = WebDriverWait(driver, 10).until(
    ... EC.any_of(EC.presence_of_element_located((By.NAME, "q"),
    ... EC.visibility_of_element_located((By.NAME, "q"))))

    Notes:
    ------
    Equivalent to a logical 'OR'. Returns results of the first matching
    condition, or False if none do.
    r   c              	      s:    D ]}z|| }|r|W   S W q t y   Y qw dS r;   r   r   expected_conditionresultr   r   r   any_of_condition  s   
z any_of.<locals>.any_of_conditionr   )r   r   r   r   r   any_of  rh   r   c                     r   )a  An expectation that all of multiple expected conditions is true.

    Parameters:
    -----------
    expected_conditions : Callable[[D], Union[T, Literal[False]]]
        The list of expected conditions to check.

    Returns:
    -------
    List[T] : The results of all the matching conditions, or False if any do not.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> elements = WebDriverWait(driver, 10).until(
    ... EC.all_of(EC.presence_of_element_located((By.NAME, "q"),
    ... EC.visibility_of_element_located((By.NAME, "q"))))

    Notes:
    ------
    Equivalent to a logical 'AND'.
    Returns: When any ExpectedCondition is not met: False.
    When all ExpectedConditions are met: A List with each ExpectedCondition's return value.
    r   c              	      sJ   g } D ]}z|| }|sW  dS | | W q ty"   Y  dS w |S r;   )appendr   )r   resultsr   r   r   r   r   all_of_condition  s   z all_of.<locals>.all_of_conditionr   )r   r   r   r   r   all_of  s   r   c                     r   )a  An expectation that none of 1 or multiple expected conditions is true.

    Parameters:
    -----------
    expected_conditions : Callable[[D], Any]
        The list of expected conditions to check.

    Returns:
    -------
    boolean : True if none of the conditions are true, False otherwise.

    Example:
    --------
    >>> from selenium.webdriver.common.by import By
    >>> from selenium.webdriver.support.ui import WebDriverWait
    >>> from selenium.webdriver.support import expected_conditions as EC
    >>> element = WebDriverWait(driver, 10).until(
    ... EC.none_of(EC.presence_of_element_located((By.NAME, "q"),
    ... EC.visibility_of_element_located((By.NAME, "q"))))

    Notes:
    ------
    Equivalent to a logical 'NOT-OR'. Returns a Boolean
    r   c              	      s8    D ]}z|| }|rW  dS W q t y   Y qw dS rp   r   r   r   r   r   none_of_condition  s   z"none_of.<locals>.none_of_conditionr   )r   r   r   r   r   none_of  s   
r   )T)<r4   collections.abcr   typingr   r   r   r   r   selenium.common.exceptionsr   r	   r
   r   r   selenium.webdriver.common.alertr   #selenium.webdriver.remote.webdriverr   r   r   r   r)   rd   boolr   r"   tupler+   r2   r8   r9   r:   r=   rF   r<   listrK   rN   rQ   rY   r_   rb   rg   rj   rk   ro   rq   rt   rv   rx   rz   intr   r   r   r   r   r   r   r   r   r   r   <module>   s   $

(!$!((

(%#

'

)
(
0

%$ 

$ $(2#(
*-