Ë
    úmxiø  ã                  óŒ   — U d dl mZ d dlmZmZ d dlZd dlmZ d dlmZ d dl	m
Z
 d dlmZ  ee«      Zded	<   dd
„Zdd„Zdd„Zy)é    )Úannotations)ÚAnyÚFinalN)Úconfig)Úget_dg_singleton_instance)Ú	exception)Ú
get_loggerr   Ú_LOGGERc                ó  ‡— ddl mŠ ddlm}  G ˆfd„d|«      }ddlm} ||_        ddlm}  |dd	d
dd¬«      }|j                  |j                  j                  t        | «      | | j                  d
ddddt        g¬«	      «       y )Nr   )ÚBox)ÚPanelc                  ó6   •‡ — e Zd Z	 d	 	 	 	 	 	 	 dˆˆ fd„Zˆ xZS )ú0_print_rich_exception.<locals>.ConfigurablePanelc                ó<   •— t        ‰| �  ||�|n ‰d«      fi |¤Ž y )NuP   â”€â”€â”€â”€
    
â”€â”€â”€â”€
    
â”€â”€â”€â”€
â”€â”€â”€â”€
    
â”€â”€â”€â”€
)ÚsuperÚ__init__)ÚselfÚ
renderableÚboxÚkwargsr   Ú	__class__s       €€úK/home/htdocs/ttos/venv/lib/python3.12/site-packages/streamlit/error_util.pyr   z9_print_rich_exception.<locals>.ConfigurablePanel.__init__"   s2   ø€ ô ‰GÑØà�?ñ áÐsÓtñ	ð
 óó    )N)r   r   r   z
Box | Noner   r   ÚreturnÚNone)Ú__name__Ú
__module__Ú__qualname__r   Ú__classcell__)r   r   s   @€r   ÚConfigurablePanelr   !   s8   ù„ ð #ð	àð	ð ð	ð ð		ð
 ÷	ò 	r   r    )Ú	traceback)ÚConsoleÚ256TéX   Fé   )Úcolor_systemÚforce_terminalÚwidthÚno_colorÚtab_sizeéd   é   )r(   Úshow_localsÚ
max_framesÚ	word_wrapÚextra_linesÚsuppress)Úrich.boxr   Ú
rich.panelr   Úrichr!   Úrich.consoler"   ÚprintÚ	TracebackÚfrom_exceptionÚtypeÚ__traceback__Ú	streamlit)Úer   r    Úrich_tracebackr"   Úconsoler   s         @r   Ú_print_rich_exceptionr?      sŒ   ø€ ÝÝ ö˜Eô õ 1à,€NÔõ %áØØØØØô€Gð ‡M�MØ× Ñ ×/Ñ/Ü�‹GØØ�O‰OØØØØØÜ�[ð 	0ó 
	
õr   c                ó\   — t        «       j                  }t        j                  || d¬«       y)z#Show the exception on the frontend.T)Úis_uncaught_app_exceptionN)r   Úmain_dgr   Ú
_exception)ÚexÚmain_delta_generators     r   Ú_show_exceptionrF   O   s$   € ä4Ó6×>Ñ>ÐÜ×ÑÐ-¨rÈTÖRr   c                ó¸   — d}t        j                  d«      r	 t        | «       d}|st        j                  d| ¬«       t        | «       y# t        $ r d}Y Œ2w xY w)zìHandle an exception that originated from a user app.

    By default, we show exceptions directly in the browser. However,
    if the user has disabled client error details, we display a generic
    warning in the frontend instead.
    Fzlogger.enableRichTzUncaught app execution)Úexc_infoN)r   Ú
get_optionr?   Ú	Exceptionr
   ÚerrorrF   )rD   Úerror_loggeds     r   Úhandle_uncaught_app_exceptionrM   U   sb   € ð €Lä×ÑÐ,Ô-ð
	!ô " "Ô%ØˆLñ ä�‰Ð.¸ˆÔ<ä�BÕøô ò 	!ð !ŠLð		!ús   ™A ÁAÁA)r<   ÚBaseExceptionr   r   )rD   rN   r   r   )Ú
__future__r   Útypingr   r   r;   r   Ú$streamlit.delta_generator_singletonsr   Ústreamlit.elementsr   Ústreamlit.loggerr	   r   r
   Ú__annotations__r?   rF   rM   © r   r   ú<module>rV      s<   ðö #ç ã Ý Ý JÝ (Ý 'á˜HÓ%€ˆÓ %ó0ófSôr   