
    ch
0                       % S SK Jr  S SKrS SKrS SKJrJrJrJrJ	r	  S SK
Jr  S SKJr  S SKJr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KJr  \" \5      r S\!S'   Sr"S\!S'    " S S5      r#\" S5        S         SS jj5       r$  S         SS jjr%S S jr&S!S jr'S"S jr(    S#S jr)\" S5      r*      S$S jr+g)%    )annotationsN)TYPE_CHECKINGCallableFinalTypeVarcast)config)validate_width)MarkdownFormattedExceptionStreamlitAPIWarning)
get_logger)	Exception)WidthConfig)gather_metrics)get_script_run_ctx)DeltaGenerator)WidthWithoutContentr   _LOGGERzThis app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you're on Streamlit Cloud, click on 'Manage app' in the lower right of your app). _GENERIC_UNCAUGHT_EXCEPTION_TEXTc                  X    \ rS rSr\" S5       S     SS jj5       r\S	S j5       rSrg)
ExceptionMixin0   	exceptionc                *    [        U R                  XS9$ )a  Display an exception.

When accessing the app through ``localhost``, in the lower-right corner
of the exception, Streamlit displays links to Google and ChatGPT that
are prefilled with the contents of the exception message.

Parameters
----------
exception : Exception
    The exception to display.
width : "stretch" or int
    The width of the exception element. This can be one of the following:

    - ``"stretch"`` (default): The width of the element matches the
      width of the parent container.
    - An integer specifying the width in pixels: The element has a
      fixed width. If the specified width is greater than the width of
      the parent container, the width of the element matches the width
      of the parent container.

Example
-------
>>> import streamlit as st
>>>
>>> e = RuntimeError("This is an exception of type RuntimeError")
>>> st.exception(e)

.. output ::
    https://doc-status-exception.streamlit.app/
    height: 220px

)width)
_exceptiondg)selfr   r   s      oC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\streamlit/elements/exception.pyr   ExceptionMixin.exception1   s    H $''9::    c                    [        SU 5      $ )zGet our DeltaGenerator.r   )r   )r   s    r   r   ExceptionMixin.dgW   s     $d++r!    N)stretch)r   BaseExceptionr   r   returnr   )r'   r   )	__name__
__module____qualname____firstlineno__r   r   propertyr   __static_attributes__r$   r!   r   r   r   0   sI    K EN#;&#;/B#;	#; !#;J , ,r!   r   r   c                R    [        5       n[        XAX#5        U R                  SU5      $ )Nr   )ExceptionProtomarshall_enqueue)r   r   r   is_uncaught_app_exceptionexception_protos        r   r   r   ^   s'     %&O_J;;{O44r!   c                   [        U5        [        U[        5      n[        USS5      b  UR                  U l        O[        U5      R                  U l        [        U5      nU R                  R                  U5        [        U[        5      U l        [        5       n[        U[        5      (       a  X&l        OSUl        U R                   R#                  U5         [        U[$        5      (       a  ['        U5      U l        O%[+        U5      R-                  5       U l        X@l         U(       GaK  [8        R:                  " S5      nU[8        R<                  R>                  :H  =(       d    [8        R<                  RA                  U5      n	U	=(       dC    U[8        R<                  RB                  :H  =(       d    [8        R<                  RE                  U5      n
U
=(       d    U[8        R<                  RF                  :H  nU	(       d  [H        U l        U(       d  U RK                  S5        O;[+        [        U5      5      nURM                  S	S5      RM                  S
S5      U l        U
(       d  U RK                  S5        ggg! [0         aU  nSU l        [2        R5                  S[        U5      R                  USR7                  [        U5      5      5         SnAGNSnAff = f)a  Marshalls an Exception.proto message.

Parameters
----------
exception_proto : Exception.proto
    The Exception protobuf to fill out.

exception : BaseException
    The exception whose data we're extracting.

width : int or "stretch"
    The width of the exception display. Can be either an integer (pixels) or "stretch".
    Defaults to "stretch".

is_uncaught_app_exception: bool
    The exception originates from an uncaught error during script execution.
alternate_nameNT a*  

Streamlit was unable to parse the data from an exception in the user's script.
This is usually due to a bug in the Exception object itself. Here is some info
about that Exception object, so you can report a bug to the original author:

Exception type:
  %s

Problem:
  %s

Traceback:
%s

        
zclient.showErrorDetailstypez<class 'z'>stack_trace)'r
   
isinstancer   getattrr5   r8   r(   _get_stack_trace_str_listr9   extendWarning
is_warningr   intpixel_widthuse_stretchwidth_configCopyFromSyntaxError_format_syntax_error_messagemessagestrstripmessage_is_markdownr   r   warningjoinr	   
get_optionShowErrorDetailsConfigOptionsFULLis_true_variation
STACKTRACEis_false_variationTYPEr   
ClearFieldreplace)r3   r   r   r2   is_markdown_exceptionr9   rC   str_exceptionshow_error_detailsshow_message
show_trace	show_typetype_strs                r   r0   r0   j   s]   . 5&y2LM y*D1=(77#I77+I6K&&{3!+Iw!?O=L%#( #'   )),7"
i-- 'C9&MO#&))n&:&:&<O#2G/8 !#../HI &"F"F"K"KK 33EE" 	  !V%I%I%T%TT33FF" 	  O!V%I%I%N%NN 	
 &FO#&&v.4	?+H#+#3#3J#C#K#KDRT#UO &&}5 = !5  
 #%  O$$II/>?'	
 	
	
s   %I9  $I9 9
KA
KKc                J   U R                   (       a  U R                  b  S[        U R                  S-
  S5      -  OSnSU R                   SU R                   SU R                   R                  5        SU S[        U 5      R                   S	U R                   3$ [        U 5      $ )
zReturns a nicely formatted SyntaxError message that emulates
what the Python interpreter outputs.

For example:

> File "raven.py", line 3
>   st.write('Hello world!!'))
>                            ^
> SyntaxError: invalid syntax

    r   r6   zFile "z", line z
  z^
z: )
textoffsetmaxfilenamelinenorstripr8   r(   msgrH   )r   caret_indents     r   rF   rF      s     ~~2;2B2B2NC#i&&*A..TV 	
 Y''(1A1A0B C&&() *cI''(9==/;	
 y>r!   c                   Sn[        U [        5      (       a  U R                  nO1[        U S5      (       a   [        R
                  " U R                  5      nUc  S/nU$ [        U5      u  p4U(       a  [        R                  " U5      nO[        R                  " U5      nU Vs/ s H  oUR                  5       PM     nnU$ s  snf )a  Get the stack trace for the given exception.

Parameters
----------
exception : BaseException
    The exception to extract the traceback from

Returns
-------
tuple of two string lists
    The exception traceback as two lists of strings. The first represents the part
    of the stack trace the users don't typically want to see, containing internal
    Streamlit code. The second is whatever comes after the Streamlit stack trace,
    which is usually what the user wants.

N__traceback__zdCannot extract the stack trace for this exception. Try calling exception() within the `catch` block.)
r:   r   tacked_on_stackhasattr	traceback
extract_tbri    _split_internal_streamlit_framesformat_listrI   )r   extracted_tracebacktrace_str_listinternal_framesexternal_framesitems         r   r<   r<      s    " :>)011'77	O	,	,'2293J3JK "@
   ,L,
( &22?CN&22?CN3AB>4**,>B Cs   #C c                     [         R                  R                  [         R                  R                  U 5      U/5      nX!:H  $ ! [         a     gf = f)z/True if the given file is part of package_path.F)ospathcommonprefixrealpath
ValueError)filepackage_pathcommon_prefixs      r   _is_in_packager~   )  sN    ,,bgg.>.>t.Dl-ST
 ((	  s   >A 
AAc                   ^ [        5       nU(       d  / [        U 5      4$ [        R                  R	                  [        R                  R                  [        UR                  5      5      S5      m[        U U4S jS9$ )a  Split the traceback into a Streamlit-internal part and an external part.

The internal part is everything up to (but excluding) the first frame belonging to
the user's code. The external part is everything else.

So if the stack looks like this:

    1. Streamlit frame
    2. Pandas frame
    3. Altair frame
    4. Streamlit frame
    5. User frame
    6. User frame
    7. Streamlit frame
    8. Matplotlib frame

...then this should return 1-4 as the internal traceback and 5-8 as the external.

(Note that something like the example above is extremely unlikely to happen since
it's not like Altair is calling Streamlit code, but you get the idea.)
r6   c                0   > [        U R                  T5      $ )N)r~   rc   )tbr|   s    r   <lambda>2_split_internal_streamlit_frames.<locals>.<lambda>V  s    ~bkk<Hr!   )split_point)	r   listrv   rw   rL   ry   rH   main_script_parent_split_list)extracted_tbctxr|   s     @r   rn   rn   4  sa    2 
C4%%%77<< 0 0S5K5K1L MrRLH r!   Tc                    / n/ nSnU  HD  nU(       d  U" U5      (       a  SnU(       a  UR                  U5        M3  UR                  U5        MF     X#4$ )NFT)append)	orig_listr   beforeaftersaw_split_pointrt   s         r   r   r   ]  sT     FEO;t#4#4"OLLMM$  =r!   )r%   F)
r   r   r   r&   r   r   r2   boolr'   r   )
r3   r/   r   r&   r   r   r2   r   r'   None)r   rE   r'   rH   )r   r&   r'   z	list[str])r{   rH   r|   rH   r'   r   )r   ztraceback.StackSummaryr'   zAtuple[list[traceback.FrameSummary], list[traceback.FrameSummary]])r   zlist[T]r   zCallable[[T], bool]r'   ztuple[list[T], list[T]]),
__future__r   rv   rl   typingr   r   r   r   r   	streamlitr	   #streamlit.elements.lib.layout_utilsr
   streamlit.errorsr   r   streamlit.loggerr   streamlit.proto.Exception_pb2r   r/   streamlit.proto.WidthConfig_pb2r   streamlit.runtime.metrics_utilr   7streamlit.runtime.scriptrunner_utils.script_run_contextr   streamlit.delta_generatorr   r   r(   r   __annotations__r   r   r   r0   rF   r<   r~   rn   r   r   r$   r!   r   <module>r      sF   # 	  @ @  > ( E 7 9 V8GH% %
\ !% *, *,\  "+&+	555 5  $	5
 5 5 "+&+	s6#s6s6 s6  $	s6
 
s6l:)X)#(#F#L CL%8r!   