Ë
    `§1hI  ã                   óþ   — d Z ddlZddlmZmZmZmZ ddlmZ ddl	m
Z
 ej                  efZdefd„Zddeeeedf   d	ee   dee   fd
„Zded	edefd„Zdd	edee   defd„Zd	eeef   defd„Zdee   dee   fd„Zy)zThe Utils methods.é    N)ÚIterableÚListÚOptionalÚUnion)ÚAnyKey)ÚKeysÚreturnc                  óô   — t        j                   t         j                  t         j                  «      } | j                  d«       | j	                  d«       | j                  «       d   }| j                  «        |S )z%Determines a free port using sockets.)z	127.0.0.1r   é   é   )ÚsocketÚAF_INETÚSOCK_STREAMÚbindÚlistenÚgetsocknameÚclose)Úfree_socketÚports     ú]/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/selenium/webdriver/common/utils.pyÚ	free_portr      s]   € ä—-‘-¤§¡´×0BÑ0BÓC€KØ×ÑÐ%Ô&Ø×Ñ�qÔØ×'Ñ'Ó)¨!Ñ,€DØ×ÑÔØ€Kó    Úhostr   c                 ó   — 	 t        j                  | d«      }d}|D ]V  \  }}}}}d}|rt        ||d   «      }|r|t         j                  k(  r|d   c S |sŒ;|rŒ>|t         j
                  k(  sŒR|d   }ŒX |S # t         j                  $ r Y yw xY w)a€  Resolve a hostname to an IP, preferring IPv4 addresses.

    We prefer IPv4 so that we don't change behavior from previous IPv4-only
    implementations, and because some drivers (e.g., FirefoxDriver) do not
    support IPv6 connections.

    If the optional port number is provided, only IPs that listen on the given
    port are considered.

    :Args:
        - host - A hostname.
        - port - Optional port number.

    :Returns:
        A single IP address, as a string. If any IPv4 address is found, one is
        returned. Otherwise, if any IPv6 address is found, one is returned. If
        neither, then None is returned.
    NTr   )r   ÚgetaddrinfoÚgaierrorÚis_connectabler   ÚAF_INET6)r   r   Ú	addrinfosÚipÚfamilyÚ_ÚsockaddrÚconnectables           r   Úfind_connectable_ipr%   &   s¢   € ð&Ü×&Ñ& t¨TÓ2ˆ	ð 
€BØ%.ò Ñ!ˆ��1�a˜ØˆÙÜ(¨¨x¸©{Ó;ˆKá˜6¤V§^¡^Ò3Ø˜A‘;ÒÚšr f´·±Ó&?Ø˜!‘‰Bðð €Iøô �?‰?ò Ùðús   ‚A7 Á7BÂBc                 óJ   — d| v r| j                  d«      sd| › d|› �S | › d|› �S )zùJoins a hostname and port together.

    This is a minimal implementation intended to cope with IPv6 literals. For
    example, _join_host_port('::1', 80) == '[::1]:80'.

    :Args:
        - host - A hostname.
        - port - An integer port.
    ú:ú[z]:)Ú
startswith)r   r   s     r   Újoin_host_portr*   K   s:   € ð ˆd�{˜4Ÿ?™?¨3Ô/Ø�4�&˜˜4˜&Ð!Ð!ØˆV�1�T�FÐÐr   c                 ót  — d}	 t        j                  || fd«      }d}|r0	 |j                  t         j                  «       |j                  «        |S # t        $ r d}Y ŒAw xY w# t
        $ r Y Œ.w xY w# |rA	 |j                  t         j                  «       n# t
        $ r Y nw xY w|j                  «        w w xY w)zsTries to connect to the server at port to see if it is running.

    :Args:
     - port - The port to connect.
    Nr   TF)r   Úcreate_connectionÚ_is_connectable_exceptionsÚshutdownÚ	SHUT_RDWRÚ	Exceptionr   )r   r   Úsocket_Úresults       r   r   r   Z   s¿   € ð €GðÜ×*Ñ*¨D°$¨<¸Ó;ˆØˆñ ðØ× Ñ ¤×!1Ñ!1Ô2ð �M‰MŒOØ€Møô &ò ØŠðûô ò Ùðûñ ðØ× Ñ ¤×!1Ñ!1Õ2øÜò Ùðúà�M‰M�Oð úsX   „A ¡A# ÁA ÁA2 ÁA Á A2 Á#	A/Á.A/Á2B7Á6BÂB7Â	B"ÂB7Â!B"Â"B7c                 ó~   — ddl m} 	 |j                  d| › d�«      }|j                  «       dk(  S # t        $ r Y yw xY w)z¢Tries to connect to the HTTP server at /status path and specified port
    to see if it responds successfully.

    :Args:
     - port - The port to connect.
    r   )Úrequestzhttp://127.0.0.1:z/statuséÈ   F)Úurllibr4   ÚurlopenÚgetcoder0   )r   Úurl_requestÚress      r   Úis_url_connectabler;   p   sI   € õ .ðØ×!Ñ!Ð$5°d°V¸7Ð"CÓDˆØ�{‰{‹} Ñ#Ð#øÜò Ùðús   ˆ'0 °	<»<Úvaluec                 óà   — g }| D ]f  }t        |t        «      r|j                  |«       Œ%t        |t        t        f«      r|j                  t        |«      «       ŒV|j                  |«       Œh |S )z7Processes the values that will be typed in the element.)Ú
isinstancer   ÚappendÚintÚfloatÚextendÚstr)r<   Ú
charactersÚvals      r   Úkeys_to_typingrF   €   sd   € à€JØò #ˆÜ�cœ4Ô à×Ñ˜cÕ"Ü˜œc¤5˜\Ô*Ø×Ñœc #›hÕ'à×Ñ˜cÕ"ð#ð Ðr   )N)Ú	localhost)Ú__doc__r   Útypingr   r   r   r   Úselenium.typesr   Úselenium.webdriver.common.keysr   ÚerrorÚConnectionResetErrorr-   r@   r   rC   ÚbytesÚ	bytearrayr%   r*   Úboolr   r;   rF   © r   r   ú<module>rR      sÙ   ðñ" ã ß 2Ó 2å !Ý /à$Ÿl™lÐ,@ÐAÐ ð�3ó ñ"˜e C¨°	¸4Ð$?Ñ@ð "ÈÐQTÉð "ÐaiÐjmÑanó "ðJ˜ð  Cð ¨Có ñ˜ð  H¨S¡Mð ÀDó ð,˜U 3¨ 8™_ð °ó ð ˜( 6Ñ*ð ¨t°C©yô r   