Ë
    ¹ûàg*  ã                   ó0   — d Z ddlZddlmZ  G d„ d«      Zy)zT
A class for storing a tree graph. Primarily used for filter constructs in the
ORM.
é    N)Úmake_hashablec                   ót   — e Zd ZdZdZdd„Zedd„«       Zd„ Zd„ Z	d„ Z
e
Zd	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zy)ÚNodez±
    A single internal node in the tree graph. A Node should be viewed as a
    connection (the root) with the children being either leaf nodes or other
    Node instances.
    ÚDEFAULTNc                 óX   — |r|dd ng | _         |xs | j                  | _        || _        y)z@Construct a new Node. If no connector is given, use the default.N)ÚchildrenÚdefaultÚ	connectorÚnegated)Úselfr   r
   r   s       úO/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/django/utils/tree.pyÚ__init__zNode.__init__   s(   € á'/˜¡™°RˆŒØ"Ò2 d§l¡lˆŒØˆ�ó    c                 óJ   — t        ||xs | j                  |«      }| |_        |S )a  
        Create a new instance using Node() instead of __init__() as some
        subclasses, e.g. django.db.models.query_utils.Q, may implement a custom
        __init__() with a signature that conflicts with the one defined in
        Node.__init__().
        )r   r	   Ú	__class__)Úclsr   r
   r   Úobjs        r   ÚcreatezNode.create   s'   € ô �8˜YÒ5¨#¯+©+°wÓ?ˆØˆŒØˆ
r   c                 ó„   — | j                   rdnd}|| j                  dj                  d„ | j                  D «       «      fz  S )Nz(NOT (%s: %s))z(%s: %s)z, c              3   ó2   K  — | ]  }t        |«      –— Œ y ­w©N)Ústr)Ú.0Úcs     r   ú	<genexpr>zNode.__str__.<locals>.<genexpr>*   s   è ø€ Ò4SÀ´S¸·VÑ4Sùs   ‚)r   r
   Újoinr   )r   Útemplates     r   Ú__str__zNode.__str__(   s7   € Ø'+§|¢|Ñ#¸ˆØ˜4Ÿ>™>¨4¯9©9Ñ4SÀTÇ]Á]Ô4SÓ+SÐTÑTÐTr   c                 ó<   — d| j                   j                  ›d| ›d�S )Nú<z: ú>)r   Ú__name__©r   s    r   Ú__repr__zNode.__repr__,   s   � Ø!Ÿ^™^×4Ó4²dÐ;Ð;r   c                 óv   — | j                  | j                  | j                  ¬«      }| j                  |_        |S ©N)r
   r   )r   r
   r   r   )r   r   s     r   Ú__copy__zNode.__copy__/   s,   € Ø�k‰k D§N¡N¸D¿L¹LˆkÓIˆØ—}‘}ˆŒØˆ
r   c                 óž   — | j                  | j                  | j                  ¬«      }t        j                  | j
                  |«      |_        |S r&   )r   r
   r   ÚcopyÚdeepcopyr   )r   Úmemodictr   s      r   Ú__deepcopy__zNode.__deepcopy__6   s7   € Ø�k‰k D§N¡N¸D¿L¹LˆkÓIˆÜ—}‘} T§]¡]°HÓ=ˆŒØˆ
r   c                 ó,   — t        | j                  «      S )z,Return the number of children this node has.)Úlenr   r#   s    r   Ú__len__zNode.__len__;   s   € ä�4—=‘=Ó!Ð!r   c                 ó,   — t        | j                  «      S )z-Return whether or not this node has children.)Úboolr   r#   s    r   Ú__bool__zNode.__bool__?   s   € ä�D—M‘MÓ"Ð"r   c                 ó   — || j                   v S )z:Return True if 'other' is a direct child of this instance.)r   ©r   Úothers     r   Ú__contains__zNode.__contains__C   s   € à˜Ÿ™Ð%Ð%r   c                 óÖ   — | j                   |j                   k(  xrO | j                  |j                  k(  xr4 | j                  |j                  k(  xr | j                  |j                  k(  S r   )r   r
   r   r   r4   s     r   Ú__eq__zNode.__eq__G   sX   € à�N‰N˜eŸo™oÑ-ò 0Ø—‘ %§/¡/Ñ1ò0à—‘ §¡Ñ-ò0ð —‘ §¡Ñ/ð		
r   c                 ó†   — t        | j                  | j                  | j                  gt	        | j
                  «      ¢­«      S r   )Úhashr   r
   r   r   r   r#   s    r   Ú__hash__zNode.__hash__O   s<   € Üà—‘Ø—‘Ø—‘ðô ˜tŸ}™}Ó-ñ	ó
ð 	
r   c                 ó^  — | j                   |k7  r"| j                  «       }|| _         ||g| _        |S t        |t        «      rP|j
                  sD|j                   |k(  st        |«      dk(  r'| j                  j                  |j                  «       | S | j                  j                  |«       |S )a»  
        Combine this tree and the data represented by data using the
        connector conn_type. The combine is done by squashing the node other
        away if possible.

        This tree (self) will never be pushed to a child node of the
        combined tree, nor will the connector or negated properties change.

        Return a node which can be used in place of data regardless if the
        node other got squashed or not.
        é   )	r
   r)   r   Ú
isinstancer   r   r.   ÚextendÚappend)r   ÚdataÚ	conn_typer   s       r   ÚaddzNode.addY   s�   € ð �>‰>˜YÒ&Ø—)‘)“+ˆCØ&ˆDŒNØ  $˜KˆDŒMØˆKä�tœTÔ"Ø—L’LØ—‘ 9Ò,´°D³	¸Q²ð �M‰M× Ñ  §¡Ô/ØˆKð �M‰M× Ñ  Ô&ØˆKr   c                 ó(   — | j                    | _         y)z'Negate the sense of the root connector.N)r   r#   s    r   ÚnegatezNode.negate|   s   € àŸ<™<Ð'ˆ�r   )NNF)r"   Ú
__module__Ú__qualname__Ú__doc__r	   r   Úclassmethodr   r   r$   r'   r)   r,   r/   r2   r6   r8   r;   rC   rE   © r   r   r   r      sg   „ ñð €Góð ò	ó ð	òUò<òð
 €Dòò
"ò#ò&ò
ò
ò!óF(r   r   )rH   r)   Údjango.utils.hashabler   r   rJ   r   r   ú<module>rL      s   ðñó
 å /÷s(ò s(r   