+
    NV-j¶#  ã                  ó  € R t ^ RIHt ^ RIHt ^ RIHtHt ^ RIH	t	H
t
HtHt ^ RIt^RIHt ]	'       d   ^ RIHt  ! R R	4      t ! R
 R]RR7      t]! R4      t ]! RR7       ! R R]
],          4      4       t ! R R]
],          4      tR# )aü  
class Ruler

Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and
[[MarkdownIt#inline]] to manage sequences of functions (rules):

- keep rules in defined order
- assign the name to each rule
- enable/disable rules
- add/replace rules
- allow assign rules to additional named chains (in the same)
- caching lists of active rules

You will not need use this class directly until write plugins. For simple
rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and
[[MarkdownIt.use]].
)Úannotations)ÚIterable)Ú	dataclassÚfield)ÚTYPE_CHECKINGÚGenericÚ	TypedDictÚTypeVarN)ÚEnvType)Ú
MarkdownItc                  óx   € ] tR t^ tR R lt]R R l4       t]P                  R R l4       t]R R l4       tR	t	R
# )Ú	StateBasec               ó$   € V ^8„  d   QhRRRRRR/# )é   ÚsrcÚstrÚmdr   Úenvr
   © )Úformats   "Úb/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/markdown_it/ruler.pyÚ__annotate__ÚStateBase.__annotate__!   s!   € ÷ ñ ˜Cð  Zð °gñ ó    c                	ó*   € Wn         W0n        W n        R # ©N)r   r   r   )Úselfr   r   r   s   &&&&r   Ú__init__ÚStateBase.__init__!   s   € ØŒØŒØŽr   c               ó   € V ^8„  d   QhRR/# )r   Úreturnr   r   )r   s   "r   r   r   '   s   € ÷ ñ �Sñ r   c                	ó   € V P                   # r   )Ú_src©r   s   &r   r   ÚStateBase.src&   s   € à�y‰yÐr   c               ó    € V ^8„  d   QhRRRR/# )r   Úvaluer   r    ÚNoner   )r   s   "r   r   r   +   s   € ÷ 9ñ 9˜ð 9 ñ 9r   c                	ó    € Wn         R V n        R # r   )r"   Ú_srcCharCode)r   r&   s   &&r   r   r$   *   s   € àŒ	Ø48ˆÖr   c               ó   € V ^8„  d   QhRR/# )r   r    ztuple[int, ...]r   )r   s   "r   r   r   0   s   € ÷ !ñ !˜_ñ !r   c                	óú   € \         P                  ! R \        ^R7       V P                  fF   \        ;QJ d    . R V P
                   4       F  NK  	  5M! R V P
                   4       4      V n        V P                  # )z?StateBase.srcCharCode is deprecated. Use StateBase.src instead.)Ú
stacklevelc              3  ó8   "  € T F  p\        V4      x € K  	  R # 5ir   )Úord)Ú.0Úcs   & r   Ú	<genexpr>Ú(StateBase.srcCharCode.<locals>.<genexpr>7   s   é € Ð%@±i°¤c¨!§f f³iùs   ‚)ÚwarningsÚwarnÚDeprecationWarningr)   Útupler"   r#   s   &r   ÚsrcCharCodeÚStateBase.srcCharCode/   sZ   € ä�ŠØMÜØõ	
ð
 ×ÑÒ$ß %¤Ñ%@°d·i²iÓ%@§¡Ñ%@°d·i²iÓ%@Ó @ˆDÔØ× Ñ Ð r   )r"   r)   r   r   r   N)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   Úpropertyr   Úsetterr7   Ú__static_attributes__r   r   r   r   r       sG   † õð
 ôó ðð 	‡Z�Zô9ó ð9ð ô!ó ô!r   r   c                  ó"   € ] tR t^;t$ R]R&   RtR# )ÚRuleOptionsTypeú	list[str]Úaltr   N)r9   r:   r;   r<   Ú__annotations__r?   r   r   r   rA   rA   ;   s   ‡ Ø	‡Nr   rA   F)ÚtotalÚ
RuleFuncTvT)Úslotsc                  óR   € ] tR t^Ct$ R]R&   R]R&   ]! RR7      tR]R&   R	]R
&   RtR# )ÚRuler   ÚnameÚboolÚenabledF)ÚreprrF   ÚfnrB   rC   r   N)r9   r:   r;   r<   rD   r   rN   r?   r   r   r   rI   rI   C   s    ‡ à
ƒIØƒMÙ Ô&€Bˆ
Ó&Ø	‡Nr   rI   c                  óÒ   € ] tR t^KtR R ltR R ltR R ltRR R	 lltRR
 R lltRR R llt	RR R llt
RR R lltRR R lltRR R lltRR R lltR R ltR R ltRtR# ) ÚRulerc               ó   € V ^8„  d   QhRR/# ©r   r    r'   r   )r   s   "r   r   ÚRuler.__annotate__L   s   € ÷ Bñ B˜$ñ Br   c                	ó"   € . V n         R V n        R # r   )Ú	__rules__Ú	__cache__r#   s   &r   r   ÚRuler.__init__L   s   € à13ˆŒð >BˆŽr   c               ó    € V ^8„  d   QhRRRR/# )r   rJ   r   r    Úintr   )r   s   "r   r   rS   T   s   € ÷ ñ ˜Sð  Sñ r   c                ól   € \        V P                  4       F  w  r#VP                  V8X  g   K  Vu # 	  R# )zFind rule index by nameéÿÿÿÿ)Ú	enumeraterU   rJ   )r   rJ   ÚiÚrules   &&  r   Ú__find__ÚRuler.__find__T   s/   € ä  §¡Ö0‰GˆAØ�y‰y˜DÖ Ø’ñ 1ð ˆ	r   c               ó   € V ^8„  d   QhRR/# rR   r   )r   s   "r   r   rS   [   s   € ÷ 6ñ 6˜Tñ 6r   c                óº  € R0pV P                    F;  pVP                  '       g   K  VP                   F  pVP                  V4       K  	  K=  	  / V n        V F  p. V P                  V&   V P                    F]  pVP                  '       g   K  V'       d   WBP                  9  d   K1  V P                  V,          P                  VP                  4       K_  	  K�  	  R# )zBuild rules lookup cacheÚ N)rU   rL   rC   ÚaddrV   ÚappendrN   )r   Úchainsr^   rJ   Úchains   &    r   Ú__compile__ÚRuler.__compile__[   s¢   € à�ˆà—N”NˆDØ—<—<�<ÙØŸœ�Ø—
‘
˜4Ö ó !ñ #ð
 ˆŒÛˆEØ$&ˆD�N‰N˜5Ñ!ØŸœ�Ø—|—|�|Ùß˜e¯8©8Ô3ÙØ—‘˜uÕ%×,Ñ,¨T¯W©WÖ5ó 'ó r   Nc               ó(   € V ^8„  d   QhRRRRRRRR/# ©	r   ÚruleNamer   rN   rF   ÚoptionsúRuleOptionsType | Noner    r'   r   )r   s   "r   r   rS   n   s,   € ÷ ñ ØðØ!+ðØ6Lðà	ñr   c                óö   € V P                  V4      pT;'       g    / pVR8X  d   \        RV 24      hW P                  V,          n        VP	                  R. 4      V P                  V,          n        RV n        R# )zÎReplace rule by name with new function & options.

:param ruleName: rule name to replace.
:param fn: new rule function.
:param options: new rule options (not mandatory).
:raises: KeyError if name not found
úParser rule not found: rC   Nr[   )r_   ÚKeyErrorrU   rN   ÚgetrC   rV   )r   rl   rN   rm   Úindexs   &&&& r   ÚatÚRuler.atn   si   € ð —‘˜hÓ'ˆØ—-�-˜RˆØ�BŒ;ÜÐ4°X°JÐ?Ó@Ð@Ø#%�‰�uÕÔ Ø$+§K¡K°°rÓ$:ˆ�‰�uÕÔ!ØˆŽr   c          
     ó,   € V ^8„  d   QhRRRRRRRRRR	/# )
r   Ú
beforeNamer   rl   rN   rF   rm   rn   r    r'   r   )r   s   "r   r   rS   €   s<   € ÷ ñ àðð ðð ð	ð
 (ðð 
ñr   c                óþ   € V P                  V4      pT;'       g    / pVR8X  d   \        RV 24      hV P                  P                  V\        \
        ,          ! VRW4P                  R. 4      4      4       RV n        R# )a  Add new rule to chain before one with given name.

:param beforeName: new rule will be added before this one.
:param ruleName: new rule will be added before this one.
:param fn: new rule function.
:param options: new rule options (not mandatory).
:raises: KeyError if name not found
rp   TrC   Nr[   ©r_   rq   rU   ÚinsertrI   rF   rr   rV   )r   rw   rl   rN   rm   rs   s   &&&&& r   ÚbeforeÚRuler.before€   sp   € ð —‘˜jÓ)ˆØ—-�-˜RˆØ�BŒ;ÜÐ4°Z°LÐAÓBÐBØ�‰×ÑØ”4œ
Ö# H¨d°B¿¹ÀEÈ2Ó8NÓOô	
ð ˆŽr   c          
     ó,   € V ^8„  d   QhRRRRRRRRRR	/# )
r   Ú	afterNamer   rl   rN   rF   rm   rn   r    r'   r   )r   s   "r   r   rS   ˜   s<   € ÷ ñ àðð ðð ð	ð
 (ðð 
ñr   c                ó  € V P                  V4      pT;'       g    / pVR8X  d   \        RV 24      hV P                  P                  V^,           \        \
        ,          ! VRW4P                  R. 4      4      4       RV n        R# )a  Add new rule to chain after one with given name.

:param afterName: new rule will be added after this one.
:param ruleName: new rule will be added after this one.
:param fn: new rule function.
:param options: new rule options (not mandatory).
:raises: KeyError if name not found
rp   TrC   Nr[   ry   )r   r~   rl   rN   rm   rs   s   &&&&& r   ÚafterÚRuler.after˜   st   € ð —‘˜iÓ(ˆØ—-�-˜RˆØ�BŒ;ÜÐ4°Y°KÐ@ÓAÐAØ�‰×ÑØ�A�I”tœJÖ'¨°$¸¿K¹KÈÈrÓ<RÓSô	
ð ˆŽr   c               ó(   € V ^8„  d   QhRRRRRRRR/# rk   r   )r   s   "r   r   rS   °   s,   € ÷ ñ ØðØ!+ðØ6Lðà	ñr   c                ó¬   € V P                   P                  \        \        ,          ! TRY#;'       g    / P	                  R. 4      4      4       RV n        R# )z²Push new rule to the end of chain.

:param ruleName: new rule will be added to the end of chain.
:param fn: new rule function.
:param options: new rule options (not mandatory).

TrC   N)rU   re   rI   rF   rr   rV   )r   rl   rN   rm   s   &&&&r   ÚpushÚ
Ruler.push°   sC   € ð 	�‰×ÑÜ”Ö˜X t¨R·-°-¸R×1DÑ1DÀUÈBÓ1OÓPô	
ð ˆŽr   c               ó$   € V ^8„  d   QhRRRRRR/# ©r   Únameszstr | Iterable[str]ÚignoreInvalidrK   r    rB   r   )r   s   "r   r   rS   ¿   ó$   € ÷ ñ Ø(ðØ9=ðà	ñr   c                ó,  € \        V\        4      '       d   V.p. pV Fk  pV P                  V4      pV^ 8  d   V'       d   K%  V^ 8  d   V'       g   \        RV 24      hRV P                  V,          n        VP                  V4       Km  	  RV n        V# )zèEnable rules with given names.

:param names: name or list of rule names to enable.
:param ignoreInvalid: ignore errors when rule not found
:raises: KeyError if name not found and not ignoreInvalid
:return: list of found rule names
ú!Rules manager: invalid rule name TN©Ú
isinstancer   r_   rq   rU   rL   re   rV   ©r   rˆ   r‰   ÚresultrJ   Úidxs   &&&   r   ÚenableÚRuler.enable¿   sˆ   € ô �eœS×!Ò!Ø�GˆEØˆÛˆDØ—-‘- Ó%ˆCØ�a”Ÿ]ÙØ�a”§ÜÐ!BÀ4À&ÐIÓJÐJØ*.ˆD�N‰N˜3ÕÔ'Ø�M‰M˜$Öñ ð ˆŒØˆr   c               ó$   € V ^8„  d   QhRRRRRR/# r‡   r   )r   s   "r   r   rS   ×   s$   € ÷ 1ñ 1Ø(ð1Ø9=ð1à	ñ1r   c                óŠ   € \        V\        4      '       d   V.pV P                   F
  pRVn        K  	  V P	                  W4      # )a  Enable rules with given names, and disable everything else.

:param names: name or list of rule names to enable.
:param ignoreInvalid: ignore errors when rule not found
:raises: KeyError if name not found and not ignoreInvalid
:return: list of found rule names
F)rŽ   r   rU   rL   r’   )r   rˆ   r‰   r^   s   &&& r   Ú
enableOnlyÚRuler.enableOnly×   s<   € ô �eœS×!Ò!Ø�GˆEØ—N”NˆDØ ˆDŽLñ #à�{‰{˜5Ó0Ð0r   c               ó$   € V ^8„  d   QhRRRRRR/# r‡   r   )r   s   "r   r   rS   ç   rŠ   r   c                ó,  € \        V\        4      '       d   V.p. pV Fk  pV P                  V4      pV^ 8  d   V'       d   K%  V^ 8  d   V'       g   \        RV 24      hRV P                  V,          n        VP                  V4       Km  	  RV n        V# )zéDisable rules with given names.

:param names: name or list of rule names to enable.
:param ignoreInvalid: ignore errors when rule not found
:raises: KeyError if name not found and not ignoreInvalid
:return: list of found rule names
rŒ   FNr�   r�   s   &&&   r   ÚdisableÚRuler.disableç   sˆ   € ô �eœS×!Ò!Ø�GˆEØˆÛˆDØ—-‘- Ó%ˆCØ�a”Ÿ]ÙØ�a”§ÜÐ!BÀ4À&ÐIÓJÐJØ*/ˆD�N‰N˜3ÕÔ'Ø�M‰M˜$Öñ ð ˆŒØˆr   c               ó    € V ^8„  d   QhRRRR/# )r   Ú	chainNamer   r    zlist[RuleFuncTv]r   )r   s   "r   r   rS   ÿ   s   € ÷ 7ñ 7 #ð 7Ð/?ñ 7r   c                óª   € V P                   f!   V P                  4        V P                   f   Q hV P                   P                  V. 4      ;'       g    . # )a  Return array of active functions (rules) for given chain name.
It analyzes rules configuration, compiles caches if not exists and returns result.

Default chain name is `''` (empty string). It can't be skipped.
That's done intentionally, to keep signature monomorphic for high speed.

)rV   rh   rr   )r   r�   s   &&r   ÚgetRulesÚRuler.getRulesÿ   sI   € ð �>‰>Ò!Ø×ÑÔØ—>‘>Ò-Ð-Ð-à�~‰~×!Ñ! )¨RÓ0×6Ð6°BÐ6r   c               ó   € V ^8„  d   QhRR/# ©r   r    rB   r   )r   s   "r   r   rS     s   € ÷ 0ñ 0˜yñ 0r   c                óV   € V P                    Uu. uF  qP                  NK  	  up# u upi )z Return all available rule names.)rU   rJ   ©r   Úrs   & r   Úget_all_rulesÚRuler.get_all_rules  s    € à $§¢Ó/¡˜1—”¡Ñ/Ð/ùÒ/s   �&c               ó   € V ^8„  d   QhRR/# r¢   r   )r   s   "r   r   rS     s   € ÷ =ñ = )ñ =r   c                ó~   € V P                    Uu. uF"  qP                  '       g   K  VP                  NK$  	  up# u upi )zReturn the active rule names.)rU   rL   rJ   r¤   s   & r   Úget_active_rulesÚRuler.get_active_rules  s(   € à $§¢Ó<¡˜1·)µ)”�—”¡Ñ<Ð<ùÒ<s   �:§:)rV   rU   r   )F)rc   )r9   r:   r;   r<   r   r_   rh   rt   r{   r€   r„   r’   r–   rš   rŸ   r¦   rª   r?   r   r   r   rP   rP   K   sI   † õBõõ6÷&÷$÷0÷0÷÷01÷ ÷07õ0÷=ñ =r   rP   )Ú__doc__Ú
__future__r   Úcollections.abcr   Údataclassesr   r   Útypingr   r   r   r	   r3   Úutilsr
   Úmarkdown_itr   r   rA   rF   rI   rP   r   r   r   Ú<module>r³      s†   ðñõ$ #å $ß (ß =Ó =Û å çÝ&÷!ñ !ô6�i uõ ñ �\Ó"€
Ø Fñ �Ôôˆ7�:Õó ó ðôH=ˆG�JÕö H=r   