+
     2i(  c                  s  a  0 t $ ^ RIHt ^ RIHtHtHtHtHtH	t	H
t
Ht ^ RIHt ^ RIHt ]
'       d   ^ RIHt  ! R R]4      t ! R R	]4      t ! R
 R]4      t]! ]P*                  R7      ]P,                  R&   ]! ]P.                  RRR7      ]P,                  R&   ]! ]P*                  RRR7      ]P,                  R&   ]! ]P0                  R7      ]P,                  R&   ]! RR7      ]P,                  R&   ]! ]P*                  R7      ]P,                  R&   ]! ]P0                  R7      ]P,                  R&   ]! RR7      ]P,                  R&   ]].]3,          tR]R&   ]]]3,          tR# )i    )annotations)CallableDictIterableOptionalSetTupleTYPE_CHECKINGUnion)	TypeAlias)EntitySubstitution)_AttributeValuec                  s    ] tR t^
t$ RtRtR]R&   RtR]R&   ]! ]	! RR.4      R	7      t
R
]R&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   R R ltR"R R lltR R ltR R ltR R  ltR!tR# )#	Formattera  Describes a strategy to use when outputting a parse tree to a string.

Some parts of this strategy come from the distinction between
HTML4, HTML5, and XML. Others are configurable by the user.

Formatters are passed in as the `formatter` argument to methods
like `bs4.element.Tag.encode`. Most people won't need to
think about formatters, and most people who need to think about
them can pass in one of these predefined strings as `formatter`
rather than making a new Formatter object:

For HTML documents:
 * 'html' - HTML entity substitution for generic HTML documents. (default)
 * 'html5' - HTML entity substitution for HTML5 documents, as
             well as some optimizations in the way tags are rendered.
 * 'html5-4.12.0' - The version of the 'html5' formatter used prior to
                    Beautiful Soup 4.13.0.
 * 'minimal' - Only make the substitutions necessary to guarantee
               valid HTML.
 * None - Do not perform any substitution. This will be faster
          but may result in invalid markup.

For XML documents:
 * 'html' - Entity substitution for XHTML documents.
 * 'minimal' - Only make the substitutions necessary to guarantee
               valid XML. (default)
 * None - Do not perform any substitution. This will be faster
          but may result in invalid markup.

htmlstrHTMLZxmlXMLZscriptZstyle)cdata_containing_tagszDict[str, Set[str]]HTML_DEFAULTSOptional[str]language%Optional[_EntitySubstitutionFunction]entity_substitutionvoid_element_close_prefixSet[str]r   indentboolempty_attributes_are_booleansc               s(    V ^8  d   QhRRRRRRRR/# )   r   r   valueOptional[Set[str]]kwargreturnr    Zformat   "2/usr/lib/python3.14/site-packages/bs4/formatter.py__annotate__Formatter.__annotate__B   s,     ) ))$6)?B)	)    c                	sh    Ve   V# WP                   8X  d   \        4       # V P                  V,          # )N)r   setr   )selfr   r   r   s   &&&&r$   _defaultZFormatter._defaultB   s5     Lxx 5L !!%((r'   Nc               s0    V ^8  d   QhRRRRRRRRR	R
RR/# )r   r   r   r   r   r   r   r   r   r   r   r   Union[int, str]r!   r"   r#   r$   r%   r&   O   sG     9! 9!9! C9! $'	9!
  29! (,9! 9!r'   c                sD   T;'       g    V P                   V n        W n        W0n        V P	                  V P                  VR4      V n        WPn        Vf   ^ p\        V\        4      '       d   V^ 8  d   ^ pRV,          pM\        V\        4      '       d   TpMRpWpn
        R# )a  Constructor.

:param language: This should be `Formatter.XML` if you are formatting
   XML markup and `Formatter.HTML` if you are formatting HTML markup.

:param entity_substitution: A function to call to replace special
   characters with XML/HTML entities. For examples, see
   bs4.dammit.EntitySubstitution.substitute_html and substitute_xml.
:param void_element_close_prefix: By default, void elements
   are represented as <tag/> (XML rules) rather than <tag>
   (HTML rules). To get <tag>, pass in the empty string.
:param cdata_containing_tags: The set of tags that are defined
   as containing CDATA in this dialect. For example, in HTML,
   <script> and <style> tags are defined as containing CDATA,
   and their contents should not be formatted.
:param empty_attributes_are_booleans: If this is set to true,
  then attributes whose values are sent to the empty string
  will be treated as `HTML boolean
  attributes<https://dev.w3.org/html5/spec-LC/common-microsyntaxes.html#boolean-attributes>`_. (Attributes
  whose value is None are always rendered this way.)
:param indent: If indent is a non-negative integer or string,
    then the contents of elements will be indented
    appropriately when pretty-printing. An indent level of 0,
    negative, or "" will only insert newlines. Using a
    positive integer indent indents that many spaces per
    level. If indent is a string (such as "\t"), that string
    is used to indent each level. The default behavior is to
    indent one space per level.

r   NZ )r   r   r   r   r*   r   r   
isinstanceZintr   r   )r)   r   r   r   r   r   r   Z
indent_strs   &&&&&&& r$   __init__ZFormatter.__init__O   s    N !--DII#6 )B&%)]]MM02I&
" .K*>Ffc""zvJ$$JJ r'   c                    V ^8  d   QhRRRR/# )r   nsr   r    r!   r"   r#   r$   r%   r&      s     , ,S ,S ,r'   c                s    V P                   '       g   V# ^RIHp \        W4      '       d6   VP                  e(   VP                  P
                  V P                  9   d   V# V P                  V4      # )zProcess a string that needs to undergo entity substitution.
This may be a string encountered in an attribute value or as
text.

:param ns: A string.
:return: The same string but with certain characters replaced by named
   or numeric entities.
)NavigableString)r   Zelementr0   r,   ZparentZnamer   )r)   r/   r0   s   && r$   
substituteZFormatter.substitute   s]     '''I, r++		%		$"<"<< I''++r'   c               r.   )r   r   r   r    r!   r"   r#   r$   r%   r&      s     & &S &S &r'   c                s$    V P                  V4      # )zProcess the value of an attribute.

:param ns: A string.
:return: A string with certain characters replaced by named
   or numeric entities.
)r1   )r)   r   s   &&r$   attribute_valueZFormatter.attribute_value   s     u%%r'   c               s     V ^8  d   QhRRRR/# )r   tagzbs4.element.Tagr    z/Iterable[Tuple[str, Optional[_AttributeValue]]]r!   r"   r#   r$   r%   r&      s     
 
"
	8
r'   c                s   a  VP                   f   . # \        VP                   P                  4       4      p\        V 3R lV 4       4      # )ax  Reorder a tag's attributes however you want.

By default, attributes are sorted alphabetically. This makes
behavior consistent between Python 2 and Python 3, and preserves
backwards compatibility with older versions of Beautiful Soup.

If `empty_attributes_are_booleans` is True, then
attributes whose values are set to the empty string will be
treated as boolean attributes.
c              3  sf   <"   T F&  w  rTSP                   '       d
   VR 8X  d   RMT3x  K(  	  R# 5i) N)r   )Z.0ZkZvr)   s   &  r$   Z	<genexpr>Z'Formatter.attributes.<locals>.<genexpr>   s2      
 ;;;RQPs   .1)ZattrsZlistitemsZsorted)r)   r3   r5   s   f& r$   
attributesZFormatter.attributes   sC     99I7;CIIOO<M7N 

 
 	
r'   )r   r   r   r   r   r   )NN/NF   )__name__
__module____qualname____firstlineno____doc__r   __annotations__r   Zdictr(   r   r*   r-   r1   r2   r6   __static_attributes__r!   r'   r$   r   r   
   s    @ D# C *.!8W"56*M&  >>""##K $(')9!v,.&
 
r'   r   c                  sF   a  ] tR t^t$ Rt/ tR]R&   RR V 3R llltRtV ;t	# )HTMLFormatterzA generic Formatter for HTML.z"Dict[Optional[str], HTMLFormatter]REGISTRYc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# r   r   r   r   r   r   r   r   r   r   r+   r!   r"   r#   r$   r%   ZHTMLFormatter.__annotate__   <     
 
B
 $'
  2	

 (,
 
r'   c           	     	N   < \         \        V `  V P                  VVVVVR 7       R# )r   N)superr@   r-   r   r)   r   r   r   r   r   	__class__   &&&&&&r$   r-   ZHTMLFormatter.__init__   s/     	mT+II%!) 	, 	
r'   r!   Nr7   NFr8   
r9   r:   r;   r<   r=   rA   r>   r-   r?   Z__classcell__rI      @r$   r@   r@      s     '35H05
 
 
r'   r@   c                  sF   a  ] tR t^t$ Rt/ tR]R&   RR V 3R llltRtV ;t	# )XMLFormatterzA generic Formatter for XML.z!Dict[Optional[str], XMLFormatter]rA   c          
     rB   rC   r!   r"   r#   r$   r%   ZXMLFormatter.__annotate__   rD   r'   c           	     	rE   rF   )rG   rO   r-   r   rH   rJ   r$   r-   ZXMLFormatter.__init__   s/     	lD*HH%!) 	+ 	
r'   r!   rK   rL   rM   rN   r$   rO   rO      s     &24H/4
 
 
r'   rO   )r   r   r4   T)r   r   r   Zhtml5z
html5-4.12ZminimalNr	   _EntitySubstitutionFunction)__conditional_annotations__Z
__future__r    Ztypingr   r   r   r   r   r   r   r   Ztyping_extensionsr	   Z
bs4.dammitr
   Zbs4._typingr   r   r@   rO   Zsubstitute_htmlrA   Zsubstitute_html5Zsubstitute_xmlr   rP   r>   Z_FormatterOrName)rQ   rN   r$   <module>rR      sj   " " W W W ' )+t
" t
n
I 
.
9 
0 "/*::"  v  #0*;; "&#  w 
 (5*:: "&(  | $
 %2*99%  y !  -F  t  ,*::!  f  $0*99$  i   +tD  d  *23%*)= Y = C( r'   