+
    j,i*                       ^ 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 ]'       d   ^ RIHt ^ RIHt . ROt]	]]]3,          ]]]]].R	3,          3,          3,          t]],          t]'       d   ^ R
IHt  ! R R]4      t]	]R]]. ]3,          R3,          tRR R lltR R lt ! R R]4      t ! R R4      tR R ltR# )    )annotations)TYPE_CHECKINGAnyCallableIterableListTupleUnioncast)
MouseEvent)Protocol)NotImplementedOrNoneMagicFormattedTextTemplateFormattedTextr   )	TypeGuardc                  &    ] tR t^#tRtR R ltRtR# )r   zQ
Any object that implements ``__pt_formatted_text__`` represents formatted
text.
c                   V ^8  d   QhRR/#    returnStyleAndTextTuples )formats   "D/usr/lib/python3/dist-packages/prompt_toolkit/formatted_text/base.py__annotate__MagicFormattedText.__annotate__)   s    BB+=B    c                	    R # Nr   selfs   &r   __pt_formatted_text__(MagicFormattedText.__pt_formatted_text__)   s    sr   r   N)__name__
__module____qualname____firstlineno____doc__r#   __static_attributes__r   r   r   r   r   #   s    	
 	CBr   Nc               (    V ^8  d   QhRRRRRRRR/# )	r   valueAnyFormattedTextstylestrauto_convertboolr   r   r   )r   s   "r   r   r   6   s,     2% 2%2%$'2%<@2%2%r   c           	     "   V f   . pM\        V \        4      '       d   RV 3.pM\        V \        4      '       d   T pMn\        V R4      '       d   \	        RV 4      P                  4       pMA\        V 4      '       d   \        V ! 4       VR7      # V'       d   RV  3.pM\        RV : 24      hV'       d6   \	        \        V UUu. uF  vrEVR,           V,           .VO5NK  	  upp4      p\        V\        4      '       d   V# \        V4      # u uppi )aH  
Convert the given value (which can be formatted text) into a list of text
fragments. (Which is the canonical form of formatted text.) The outcome is
always a `FormattedText` instance, which is a list of (style, text) tuples.

It can take a plain text string, an `HTML` or `ANSI` object, anything that
implements `__pt_formatted_text__` or a callable that takes no arguments and
returns one of those.

:param style: An additional style string which is applied to all text
    fragments.
:param auto_convert: If `True`, also accept other types, and convert them
    to a string first.
 r#   r   )r.   z[No formatted text. Expecting a unicode object, HTML, ANSI or a FormattedText instance. Got  )
isinstancer/   listhasattrr   r#   callableto_formatted_text
ValueErrorr   r   )r,   r.   r0   result
item_stylerests   &&&   r   r9   r9   6   s    & }	E3		u+	E4	 	 	/	0	0*E2HHJ	% 66	%"#;;@)E
 	
 HNO3D:eckJ&..O
 &-((V$$ Ps   Dc                    V ^8  d   QhRRRR/# )r   r,   objectr   zTypeGuard[AnyFormattedText]r   )r   s   "r   r   r   k   s      V (C r   c                    \        V 4      '       d   R# \        V \        \        34      '       d   R# \	        V R4      '       d   R# R# )z
Check whether the input is valid formatted text (for use in assert
statements).
In case of a callable, it doesn't check the return type.
Tr#   F)r8   r5   r/   r6   r7   )r,   s   &r   is_formatted_textrA   k   s8     %#t%%u-..r   c                  >   a  ] tR t^ztRtR R ltR V 3R lltRtV ;t# )r   zv
A list of ``(style, text)`` tuples.

(In some situations, this can also be ``(style, text, mouse_handler)``
tuples.)
c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   FormattedText.__annotate__   s      '9 r   c                	    V # r    r   r!   s   &r   r#   #FormattedText.__pt_formatted_text__   s    r   c                   V ^8  d   QhRR/# )r   r   r/   r   )r   s   "r   r   rD      s     6 6# 6r   c                	(   < R \         SV `  4        R2# )zFormattedText())super__repr__)r"   	__class__s   &r   rK   FormattedText.__repr__   s     0 23155r   r   )	r%   r&   r'   r(   r)   r#   rK   r*   __classcell__)rL   s   @r   r   r   z   s    6 6r   c                  2    ] tR t^tRtR R ltR R ltRtR# )r   z
Template for string interpolation with formatted text.

Example::

    Template(' ... {} ... ').format(HTML(...))

:param text: Plain text.
c                    V ^8  d   QhRRRR/# )r   textr/   r   Noner   )r   s   "r   r   Template.__annotate__   s      S T r   c                	$    R V9  g   Q hWn         R# )z{0}NrQ   )r"   rQ   s   &&r   __init__Template.__init__   s    D   	r   c                    V ^8  d   QhRRRR/# )r   valuesr-   r   r   )r   s   "r   r   rS      s      . 3C r   c                	   a a R  V V3R llpV# )c                   V ^8  d   QhRR/# r   r   r-   r   )r   s   "r   r   %Template.format.<locals>.__annotate__   s     
	 
	, 
	r   c                 N  < SP                   P                  R 4      p \        V 4      ^,
          \        S4      8X  g   Q h\        4       p\	        V S4       F2  w  r#VP                  RV34       VP                  \        V4      4       K4  	  VP                  RV R,          34       V# )z{}r3   )rQ   splitlenr   zipappendextendr9   )partsr;   partvalr"   rY   s       r   
get_result#Template.format.<locals>.get_result   s    IIOOD)Eu:>S[000"_F /	r4j)/45 0 MM2uRy/*Mr   r   )r"   rY   rh   s   fj r   r   Template.format   s    
	 
	 r   rU   N)r%   r&   r'   r(   r)   rV   r   r*   r   r   r   r   r      s     r   c                    V ^8  d   QhRRRR/# )r   itemszIterable[AnyFormattedText]r   r-   r   )r   s   "r   r   r      s     ! ! : !?O !r   c                   a  R V 3R llpV# )z@
Merge (Concatenate) several pieces of formatted text together.
c                   V ^8  d   QhRR/# r\   r   )r   s   "r   r   *merge_formatted_text.<locals>.__annotate__   s      #3 r   c                 b   < \        4       p S F  pV P                  \        V4      4       K  	  V # r    )r   rd   r9   )r;   irl   s     r   _merge_formatted_text3merge_formatted_text.<locals>._merge_formatted_text   s+    AMM+A./ r   r   )rl   rr   s   f r   merge_formatted_textrt      s    
  ! r   )	OneStyleAndTextTupler   r   r-   r9   rA   r   rt   r   )r3   F)
__future__r   typingr   r   r   r   r   r	   r
   r   prompt_toolkit.mouse_eventsr   typing_extensionsr   'prompt_toolkit.key_binding.key_bindingsr   __all__r/   ru   r   r   r   r-   r9   rA   r   r   rt   r   r   r   <module>r|      s    " S S S 2*L
 	#s(OU3Xzl<R.R%SSTT 
 ./  +CX C RW
 2%j6& 6 >!r   