ó
    Ú°›jR#  ã                  óô  • S SK Jr  S SKrS SKrS SKJr  S SKJr  S SKJ	r	  S SKJ
r
  S SKJr  S SKJr  S S	KJr  S S
KJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr   S SKJ!r!  S SKJ"r"  S SKJ#r#  S SKJ$r%  S SKJ&r&  S SKJ'r'  S SKJ(r(  S SKJ)r)  S S KJ*r*  S S!K+J,r,  S S"K-J.r.  \
(       a  S S#KJ/r/  \" S$\/S%9r0SCS& jr1SDSES( jjr2SFS) jr3S'S*.SGS+ jjr4SCS, jr5SHS- jr6SIS. jr7SJS/ jr8SKS0 jr9S'S'S1S2.         SLS3 jjr:SMS4 jr;SNS5 jr<SOS6 jrSPSQS7 jjr=SRSSS8 jjr>STS9 jr?SUS: jr@SVS; jrASWS< jrBSXS= jrCSYS> jrDSZS? jrES[S@ jrFS\SA jrGS]SB jrHg)^é    )ÚannotationsN)ÚIterable)ÚMapping)ÚIO)ÚTYPE_CHECKING)ÚAny)ÚTypeVar)Úparse_rfc3339)Ú	Container)ÚUnexpectedCharError)ÚCUSTOM_ENCODERS©ÚAoT)ÚArray)ÚBool)ÚComment)ÚDate)ÚDateTime)Ú	DottedKey)ÚFloat)ÚInlineTable)ÚInteger)ÚItem)ÚKey)Ú	SingleKey)ÚString)Ú
StringType)ÚTable)ÚTime)ÚTrivia©Ú
Whitespace)Úitem)ÚParser©ÚTOMLDocument)ÚEncoderÚE)Úboundc                ó   • [        U 5      $ )z:
Parses a string into a TOMLDocument.

Alias for parse().
)Úparse©Ústrings    ÚH/home/mande/repo/quber/.venv/lib/python3.13/site-packages/tomlkit/api.pyÚloadsr/   /   s   € ô �‹=Ðó    Fc                óˆ  • [        U [        [        [        45      (       a/  U(       d  U R	                  5       $ [        U SS9R	                  5       $ [        U [        5      (       a!  [        [        U 5      US9R	                  5       $  U R	                  5       $ ! [         a   nS[        U 5       S3n[        U5      UeSnAff = f)z%
Dumps a TOMLDocument into a string.
T)Ú
_sort_keysz.Expecting Mapping or TOML Table or Container, z givenN)Ú
isinstancer   r   r   Ú	as_stringr#   r   ÚdictÚAttributeErrorÚtypeÚ	TypeError)ÚdataÚ	sort_keysÚexÚmsgs       r.   Údumpsr=   8   s§   € ô �$œ¤¬YÐ7×8Ñ8ÞØ—>‘>Ó#Ð#ä�D TÑ*×4Ñ4Ó6Ð6ä�$œ× Ñ Ü”D˜“J¨9Ñ5×?Ñ?ÓAÐAð%ð
 �~‰~ÓÐøÜó %Ø>¼tÀD»z¸lÈ&ÐQˆÜ˜‹n "Ð$ûð%ús   ÂB Â
CÂ!B<Â<Cc                ó4   • [        U R                  5       5      $ )z-
Load toml document from a file-like object.
)r+   Úread)Úfps    r.   ÚloadrA   P   s   € ô �—‘“ÓÐr0   ©r:   c               ó4   • UR                  [        XS95        g)zì
Dump a TOMLDocument into a writable file stream.

:param data: a dict-like object to dump
:param sort_keys: if true, sort the keys in alphabetic order

:Example:

>>> with open("output.toml", "w") as fp:
...     tomlkit.dump(data, fp)
rB   N)Úwriter=   )r9   r@   r:   s      r.   ÚdumprE   W   s   € ð ‡H�HŒU�4Ñ-Õ.r0   c                ó4   • [        U 5      R                  5       $ )z/
Parses a string or bytes into a TOMLDocument.
)r$   r+   r,   s    r.   r+   r+   f   s   € ô �&‹>×ÑÓ!Ð!r0   c                 ó   • [        5       $ )z&
Returns a new TOMLDocument instance.
r%   © r0   r.   ÚdocumentrI   m   s   € ô ‹>Ðr0   c                ó*   • [        [        U 5      5      $ )z/Create an integer item from a number or string.)r#   Úint©Úraws    r.   ÚintegerrN   u   s   € ä”�C“‹>Ðr0   c                ó*   • [        [        U 5      5      $ )z-Create an float item from a number or string.)r#   ÚfloatrL   s    r.   Úfloat_rQ   z   s   € ä”�c“
ÓÐr0   c                óT   • [        [        U [        5      (       a	  U S:H  5      $ U 5      $ )z+Turn `true` or `false` into a boolean item.Útrue)r#   r3   ÚstrrL   s    r.   ÚbooleanrU      s%   € ä¤¨C´×!5Ñ!5��v‘Ó?Ð?¸3Ó?Ð?r0   T)ÚliteralÚ	multilineÚescapec               ó\   • [         R                  " X5      n[        R                  " XU5      $ )a  Create a string item.

By default, this function will create *single line basic* strings, but
boolean flags (e.g. ``literal=True`` and/or ``multiline=True``)
can be used for personalization.

For more information, please check the spec: `<https://toml.io/en/v1.0.0#string>`__.

Common escaping rules will be applied for basic strings.
This can be controlled by explicitly setting ``escape=False``.
Please note that, if you disable escaping, you will have to make sure that
the given strings don't contain any forbidden character or sequence.
)Ú_StringTypeÚselectr   Úfrom_raw)rM   rV   rW   rX   Útype_s        r.   r-   r-   „   s%   € ô( ×Ò˜wÓ2€EÜ�?Š?˜3 vÓ.Ð.r0   c                ó‚   • [        U 5      n[        U[        R                  5      (       d  [	        S5      e[        U5      $ )zCreate a TOML date.z!date() only accepts date strings.)r
   r3   Ú	_datetimeÚdateÚ
ValueErrorr#   ©rM   Úvalues     r.   r`   r`   œ   ó3   € ä˜#Ó€EÜ�eœYŸ^™^×,Ñ,ÜÐ<Ó=Ð=ä�‹;Ðr0   c                ó‚   • [        U 5      n[        U[        R                  5      (       d  [	        S5      e[        U5      $ )zCreate a TOML time.z!time() only accepts time strings.)r
   r3   r_   Útimera   r#   rb   s     r.   rf   rf   ¥   rd   r0   c                ó‚   • [        U 5      n[        U[        R                  5      (       d  [	        S5      e[        U5      $ )zCreate a TOML datetime.z)datetime() only accepts datetime strings.)r
   r3   r_   Údatetimera   r#   rb   s     r.   rh   rh   ®   s5   € ä˜#Ó€EÜ�eœY×/Ñ/×0Ñ0ÜÐDÓEÐEä�‹;Ðr0   c                ót   • [        U 5      n[        U[        5      (       d  [        S[	        U5       35      eU$ )zÇCreate an array item for its string representation.

:Example:

>>> array("[1, 2, 3]")  # Create from a string
[1, 2, 3]
>>> a = array()
>>> a.extend([1, 2, 3])  # Create from a list
>>> a
[1, 2, 3]
zExpected an array, got )rc   r3   r   ra   r7   )rM   Úvs     r.   Úarrayrk   ·   s6   € ô 	ˆc‹
€AÜ�aœ×ÑÜÐ2´4¸³7°)Ð<Ó=Ð=Ø€Hr0   c                ó>   • [        [        5       [        5       SU 5      $ )a  Create an empty table.

:param is_super_table: if true, the table is a super table

:Example:

>>> doc = document()
>>> foo = table(True)
>>> bar = table()
>>> bar.update({'x': 1})
>>> foo.append('bar', bar)
>>> doc.append('foo', foo)
>>> print(doc.as_string())
[foo.bar]
x = 1
F)r   r   r    )Úis_super_tables    r.   Útablern   É   s   € ô" ”“œf›h¨¨~Ó>Ð>r0   c                 ó8   • [        [        5       [        5       SS9$ )zŽCreate an inline table.

:Example:

>>> table = inline_table()
>>> table.update({'x': 1, 'y': 2})
>>> print(table.as_string())
{x = 1, y = 2}
T)Únew)r   r   r    rH   r0   r.   Úinline_tablerq   Ý   s   € ô ”y“{¤F£H°$Ñ7Ð7r0   c                 ó   • [        / 5      $ )z®Create an array of table.

:Example:

>>> doc = document()
>>> aot = aot()
>>> aot.append(item({'x': 1}))
>>> doc.append('foo', aot)
>>> print(doc.as_string())
[[foo]]
x = 1
r   rH   r0   r.   Úaotrs   ê   s   € ô ˆr‹7€Nr0   c                óÀ   • [        U [        5      (       a  [        U 5      $ U  Vs/ s H  n[        U5      PM     nn[        U5      S:X  a  US   $ [	        U5      $ s  snf )zîCreate a key from a string. When a list of string is given,
it will create a dotted key.

:Example:

>>> doc = document()
>>> doc.append(key('foo'), 1)
>>> doc.append(key(['bar', 'baz']), 2)
>>> print(doc.as_string())
foo = 1
bar.baz = 2
é   r   )r3   rT   r   Úlenr   )ÚkÚ_kÚkeyss      r.   Úkeyrz   ú   sV   € ô �!”S×ÑÜ˜‹|ÐÙ$%Ó&¢A˜bŒI�bŽM¡A€DÐ&Ü
ˆ4ƒy�Aƒ~Ø�A‰wˆÜ�T‹?Ðùò 's   ¥Ac                ó¢   • [        U 5      nUR                  5       nUR                  5       (       d  UR                  [        UR
                  S9eU$ )zyParse a simple value from a string.

:Example:

>>> value("1")
1
>>> value("true")
True
>>> value("[1, 2, 3]")
[1, 2, 3]
)Úchar)r$   Ú_parse_valueÚendÚparse_errorr   Ú_current)rM   Úparserrj   s      r.   rc   rc     sF   € ô �C‹[€FØ×ÑÓ€AØ�:‰:�<‰<Ø× Ñ Ô!4¸6¿?¹?Ð ÐKÐKØ€Hr0   c                ó4   • [        U 5      R                  5       $ )z[Parse a key-value pair from a string.

:Example:

>>> key_value("foo = 1")
(Key('foo'), 1)
)r$   Ú_parse_key_value©Úsrcs    r.   Ú	key_valuer†   "  s   € ô �#‹;×'Ñ'Ó)Ð)r0   c                ó   • [        U SS9$ )z"Create a whitespace from a string.T)Úfixedr!   r„   s    r.   Úwsr‰   -  s   € ä�c Ñ&Ð&r0   c                 ó   • [        S5      $ )zCreate a newline item.Ú
)r‰   rH   r0   r.   ÚnlrŒ   2  s   € äˆd‹8€Or0   c                óz   • U R                  S5      nSR                  S U 5       5      n[        [        SUS95      $ )z}Create a comment item.

A multiline string produces one ``#``-prefixed line per line so that the
result is still valid TOML.
r‹   c              3  ó<   #   • U  H  o(       a  S U 3OSv •  M     g7f)z# Ú#NrH   )Ú.0Úlines     r.   Ú	<genexpr>Úcomment.<locals>.<genexpr>>  s   é € ÐHÂ%¸$­˜2˜d˜V™°#Ô5Â%ùs   ‚z  )Ú
comment_wsÚcomment)ÚsplitÚjoinr   r    )r-   ÚlinesÚrendereds      r.   r•   r•   7  s8   € ð �L‰L˜Ó€EØ�y‰yÑHÁ%ÓHÓH€HÜ”6 T°8Ñ<Ó=Ð=r0   c                ó2   • [         R                  " U 5        U $ )aZ  Add a custom encoder, which should be a function that will be called
if the value can't otherwise be converted.

The encoder should return a TOMLKit item or raise a ``ConvertError``.

Example:
    @register_encoder
    def encode_custom_dict(obj, _parent=None, _sort_keys=False):
        if isinstance(obj, CustomDict):
            tbl = table()
            for key, value in obj.items():
                # Pass along parameters when encoding nested values
                tbl[key] = item(value, _parent=tbl, _sort_keys=_sort_keys)
            return tbl
        raise ConvertError("Not a CustomDict")
)r   Úappend©Úencoders    r.   Úregister_encoderrž   B  s   € ô" ×Ò˜7Ô#Ø€Nr0   c                ó˜   • [         R                  " [        5         [        R                  " U 5        SSS5        g! , (       d  f       g= f)zUnregister a custom encoder.N)Ú
contextlibÚsuppressra   r   Úremoverœ   s    r.   Úunregister_encoderr£   W  s*   € ä	×	Ò	œZÕ	(Ü×Ò˜wÔ'÷ 
)×	(Ö	(ús	   ›;»
A	)r-   zstr | bytesÚreturnr&   )F)r9   úMapping[str, Any]r:   Úboolr¤   rT   )r@   zIO[str] | IO[bytes]r¤   r&   )r9   r¥   r@   zIO[str]r:   r¦   r¤   ÚNone)r¤   r&   )rM   z	str | intr¤   r   )rM   zstr | floatr¤   r   )rM   z
str | boolr¤   r   )
rM   rT   rV   r¦   rW   r¦   rX   r¦   r¤   r   )rM   rT   r¤   r   )rM   rT   r¤   r   )rM   rT   r¤   r   )z[])rM   rT   r¤   r   )N)rm   zbool | Noner¤   r   )r¤   r   )r¤   r   )rw   zstr | Iterable[str]r¤   r   )rM   rT   r¤   Ú_Item)r…   rT   r¤   ztuple[Key, _Item])r…   rT   r¤   r"   )r¤   r"   )r-   rT   r¤   r   )r�   r(   r¤   r(   )r�   r'   r¤   r§   )IÚ
__future__r   r    rh   r_   Úcollections.abcr   r   Útypingr   r   r   r	   Útomlkit._utilsr
   Útomlkit.containerr   Útomlkit.exceptionsr   Útomlkit.itemsr   r   r   r   r   r   r   r   r   r   r   r   r¨   r   r   r   r   rZ   r   r   r    r"   r#   Útomlkit.parserr$   Útomlkit.toml_documentr&   r'   r(   r/   r=   rA   rE   r+   rI   rN   rQ   rU   r-   r`   rf   rk   rn   rq   rs   rz   rc   r†   r‰   rŒ   r•   rž   r£   rH   r0   r.   Ú<module>r²      sB  ðÝ "ã Û å $Ý #Ý Ý  Ý Ý å (Ý 'Ý 2Ý )Ý Ý Ý Ý !Ý Ý "Ý #Ý Ý %Ý !Ý 'Ý Ý #Ý  Ý 3Ý Ý Ý  Ý $Ý &Ý !Ý >ö Ý%á�˜7Ñ#€Aôö%ô0ð EJ÷ /ô"ôôô
ô
@ð ØØñ/Ø	ð/ð ð/ð ð	/ð
 ð/ð õ/ô0ôôöö$?ô(
8ôô ô*ô&*ô'ô
ô
>ôõ*(r0   