
    (ph1                        % S r SSKJr  SSKJr  SSKJrJrJrJ	r	J
r
Jr  SSKrSSKJr  \(       a  SSKJr  SSKJr  SS	KJrJr  S
\S'    SSKr " S S\5      rg! \ a    Sr\R0                  " S5         N(f = f)a,  Integration code for CSS selectors using `Soup Sieve <https://facelessuser.github.io/soupsieve/>`_ (pypi: ``soupsieve``).

Acquire a `CSS` object through the `element.Tag.css` attribute of
the starting point of your CSS selector, or (if you want to run a
selector against the entire document) of the `BeautifulSoup` object
itself.

The main advantage of doing this instead of using ``soupsieve``
functions is that you don't need to keep passing the `element.Tag` to be
selected against, since the `CSS` object is permanently scoped to that
`element.Tag`.

    )annotations)
ModuleType)AnycastIterableIteratorOptionalTYPE_CHECKINGN)_NamespaceMapping)	SoupSieve)element)	ResultSetTagOptional[ModuleType]	soupsievezEThe soupsieve package is not installed. CSS selectors cannot be used.c                  X   \ rS rSrSrSSS jjrSS jr      SS jrSS jr  S         SS jjr	  S         SS	 jjr
   S           SS
 jjr   S           SS jjr  S         SS jjr  S         SS jjr  S         SS jjrSrg)CSS,   at  A proxy object against the ``soupsieve`` library, to simplify its
CSS selector API.

You don't need to instantiate this class yourself; instead, use
`element.Tag.css`.

:param tag: All CSS selectors run by this object will use this as
    their starting point.

:param api: An optional drop-in replacement for the ``soupsieve`` module,
    intended for use in unit tests.
Nc                J    Uc  [         nUc  [        S5      eX l        Xl        g )NzLCannot execute CSS selectors because the soupsieve package is not installed.)r   NotImplementedErrorapitag)selfr   r   s      :/var/www/html/venv/lib/python3.13/site-packages/bs4/css.py__init__CSS.__init__:   s-    ;C;%^      c                x    [         c  [        S5      e[        [        U R                  R                  U5      5      $ )zEscape a CSS identifier.

This is a simple wrapper around `soupsieve.escape() <https://facelessuser.github.io/soupsieve/api/#soupsieveescape>`_. See the
documentation for that function for more information.
zMCannot escape CSS identifiers because the soupsieve package is not installed.)r   r   r   strr   escape)r   idents     r   r    
CSS.escapeD   s6     %_  C/00r   c                    [        X R                  R                  5      (       d  Uc  U R                  R                  nU$ )z%Normalize a dictionary of namespaces.)
isinstancer   r   r   _namespaces)r   nsselects      r   _nsCSS._nsP   s3     &(("4"455"* %%B	r   c                     SSK Jn  U" SU5      $ )a  Normalize a list of results to a py:class:`ResultSet`.

A py:class:`ResultSet` is more consistent with the rest of
Beautiful Soup's API, and :py:meth:`ResultSet.__getattr__` has
a helpful error message if you try to treat a list of results
as a single result (a common mistake).
r   )r   N)bs4r   )r   resultsr   s      r   _rsCSS._rs[   s     	"w''r   c                \    U R                   R                  " XR                  X!5      U40 UD6$ )a  Pre-compile a selector and return the compiled object.

:param selector: A CSS selector.

:param namespaces: A dictionary mapping namespace prefixes
   used in the CSS selector to namespace URIs. By default,
   Beautiful Soup will use the prefixes it encountered while
   parsing the document.

:param flags: Flags to be passed into Soup Sieve's
    `soupsieve.compile() <https://facelessuser.github.io/soupsieve/api/#soupsievecompile>`_ method.

:param kwargs: Keyword arguments to be passed into Soup Sieve's
   `soupsieve.compile() <https://facelessuser.github.io/soupsieve/api/#soupsievecompile>`_ method.

:return: A precompiled selector object.
:rtype: soupsieve.SoupSieve
)r   compiler(   r   r'   
namespacesflagskwargss        r   r0   CSS.compileh   s)    2 xx(DeVvVVr   c                r    U R                   R                  " XR                  U R                  X!5      U40 UD6$ )aY  Perform a CSS selection operation on the current Tag and return the
first result, if any.

This uses the Soup Sieve library. For more information, see
that library's documentation for the `soupsieve.select_one() <https://facelessuser.github.io/soupsieve/api/#soupsieveselect_one>`_ method.

:param selector: A CSS selector.

:param namespaces: A dictionary mapping namespace prefixes
   used in the CSS selector to namespace URIs. By default,
   Beautiful Soup will use the prefixes it encountered while
   parsing the document.

:param flags: Flags to be passed into Soup Sieve's
    `soupsieve.select_one() <https://facelessuser.github.io/soupsieve/api/#soupsieveselect_one>`_ method.

:param kwargs: Keyword arguments to be passed into Soup Sieve's
   `soupsieve.select_one() <https://facelessuser.github.io/soupsieve/api/#soupsieveselect_one>`_ method.
)r   
select_oner   r(   r1   s        r   r7   CSS.select_one   s7    4 xx""HHdhhz:E
EK
 	
r   c           
         Uc  SnU R                  U R                  R                  " XR                  U R	                  X!5      X440 UD65      $ )aq  Perform a CSS selection operation on the current `element.Tag`.

This uses the Soup Sieve library. For more information, see
that library's documentation for the `soupsieve.select() <https://facelessuser.github.io/soupsieve/api/#soupsieveselect>`_ method.

:param selector: A CSS selector.

:param namespaces: A dictionary mapping namespace prefixes
    used in the CSS selector to namespace URIs. By default,
    Beautiful Soup will pass in the prefixes it encountered while
    parsing the document.

:param limit: After finding this number of results, stop looking.

:param flags: Flags to be passed into Soup Sieve's
    `soupsieve.select() <https://facelessuser.github.io/soupsieve/api/#soupsieveselect>`_ method.

:param kwargs: Keyword arguments to be passed into Soup Sieve's
   `soupsieve.select() <https://facelessuser.github.io/soupsieve/api/#soupsieveselect>`_ method.
r   )r-   r   r'   r   r(   r   r'   r2   limitr3   r4   s         r   r'   
CSS.select   sK    8 =ExxHHOO$((:">PV
 	
r   c                r    U R                   R                  " XR                  U R                  X!5      X440 UD6$ )a  Perform a CSS selection operation on the current `element.Tag`.

This uses the Soup Sieve library. For more information, see
that library's documentation for the `soupsieve.iselect()
<https://facelessuser.github.io/soupsieve/api/#soupsieveiselect>`_
method. It is the same as select(), but it returns a generator
instead of a list.

:param selector: A string containing a CSS selector.

:param namespaces: A dictionary mapping namespace prefixes
    used in the CSS selector to namespace URIs. By default,
    Beautiful Soup will pass in the prefixes it encountered while
    parsing the document.

:param limit: After finding this number of results, stop looking.

:param flags: Flags to be passed into Soup Sieve's
    `soupsieve.iselect() <https://facelessuser.github.io/soupsieve/api/#soupsieveiselect>`_ method.

:param kwargs: Keyword arguments to be passed into Soup Sieve's
   `soupsieve.iselect() <https://facelessuser.github.io/soupsieve/api/#soupsieveiselect>`_ method.
)r   iselectr   r(   r:   s         r   r>   CSS.iselect   s7    > xxHHdhhz:E
LR
 	
r   c                r    U R                   R                  " XR                  U R                  X!5      U40 UD6$ )aU  Find the `element.Tag` closest to this one that matches the given selector.

This uses the Soup Sieve library. For more information, see
that library's documentation for the `soupsieve.closest()
<https://facelessuser.github.io/soupsieve/api/#soupsieveclosest>`_
method.

:param selector: A string containing a CSS selector.

:param namespaces: A dictionary mapping namespace prefixes
    used in the CSS selector to namespace URIs. By default,
    Beautiful Soup will pass in the prefixes it encountered while
    parsing the document.

:param flags: Flags to be passed into Soup Sieve's
    `soupsieve.closest() <https://facelessuser.github.io/soupsieve/api/#soupsieveclosest>`_ method.

:param kwargs: Keyword arguments to be passed into Soup Sieve's
   `soupsieve.closest() <https://facelessuser.github.io/soupsieve/api/#soupsieveclosest>`_ method.

)r   closestr   r(   r1   s        r   rA   CSS.closest   s7    8 xxHHdhhz:E
EK
 	
r   c                    [        [        U R                  R                  " XR                  U R                  X!5      U40 UD65      $ )a7  Check whether or not this `element.Tag` matches the given CSS selector.

This uses the Soup Sieve library. For more information, see
that library's documentation for the `soupsieve.match()
<https://facelessuser.github.io/soupsieve/api/#soupsievematch>`_
method.

:param: a CSS selector.

:param namespaces: A dictionary mapping namespace prefixes
    used in the CSS selector to namespace URIs. By default,
    Beautiful Soup will pass in the prefixes it encountered while
    parsing the document.

:param flags: Flags to be passed into Soup Sieve's
    `soupsieve.match()
    <https://facelessuser.github.io/soupsieve/api/#soupsievematch>`_
    method.

:param kwargs: Keyword arguments to be passed into SoupSieve's
    `soupsieve.match()
    <https://facelessuser.github.io/soupsieve/api/#soupsievematch>`_
    method.
)r   boolr   matchr   r(   r1   s        r   rE   	CSS.match	  s@    > HHNN$((:">IO
 	
r   c           
         U R                  U R                  R                  " XR                  U R	                  X!5      U40 UD65      $ )a  Filter this `element.Tag`'s direct children based on the given CSS selector.

This uses the Soup Sieve library. It works the same way as
passing a `element.Tag` into that library's `soupsieve.filter()
<https://facelessuser.github.io/soupsieve/api/#soupsievefilter>`_
method. For more information, see the documentation for
`soupsieve.filter()
<https://facelessuser.github.io/soupsieve/api/#soupsievefilter>`_.

:param namespaces: A dictionary mapping namespace prefixes
    used in the CSS selector to namespace URIs. By default,
    Beautiful Soup will pass in the prefixes it encountered while
    parsing the document.

:param flags: Flags to be passed into Soup Sieve's
    `soupsieve.filter()
    <https://facelessuser.github.io/soupsieve/api/#soupsievefilter>`_
    method.

:param kwargs: Keyword arguments to be passed into SoupSieve's
    `soupsieve.filter()
    <https://facelessuser.github.io/soupsieve/api/#soupsievefilter>`_
    method.
)r-   r   filterr   r(   r1   s        r   rH   
CSS.filter/  sA    > xxHHOO$((:">IO
 	
r   )r   r   )N)r   zelement.Tagr   r   )r!   r   returnr   )r&   Optional[_NamespaceMapping]r'   r   rJ   rK   )r,   zIterable[Tag]rJ   zResultSet[Tag])Nr   )
r'   r   r2   rK   r3   intr4   r   rJ   r   )
r'   r   r2   rK   r3   rL   r4   r   rJ   zelement.Tag | None)Nr   r   )r'   r   r2   rK   r;   rL   r3   rL   r4   r   rJ   ResultSet[element.Tag])r'   r   r2   rK   r;   rL   r3   rL   r4   r   rJ   zIterator[element.Tag])
r'   r   r2   rK   r3   rL   r4   r   rJ   zOptional[element.Tag])
r'   r   r2   rK   r3   rL   r4   r   rJ   rD   )
r'   r   r2   rK   r3   rL   r4   r   rJ   rM   )__name__
__module____qualname____firstlineno____doc__r   r    r(   r-   r0   r7   r'   r>   rA   rE   rH   __static_attributes__ r   r   r   r   ,   s   
1	-	7:		$	(  37	WW 0W 	W
 W 
W< 37	

 0
 	

 
 

B 37#
#
 0#
 	#

 #
 #
 
 #
P 37!
!
 0!
 	!

 !
 !
 
!
L 37	

 0
 	

 
 

F 37	$
$
 0$
 	$

 $
 
$
R 37	#
#
 0#
 	#

 #
 
 #
 #
r   r   )rR   
__future__r   typesr   typingr   r   r   r   r	   r
   warningsbs4._typingr   r   r   r+   r   bs4.elementr   r   __annotations__ImportErrorwarnobjectr   rT   r   r   <module>r_      sq    #    )#* f
& f
  IMMOs   A A87A8