Ë
    S>{i¥k  ã                   ó’  — d dl Z d dlZd dlmZ d dlmZmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZ d dlmZmZmZmZmZ d d	lmZ d d
lmZmZ d dlmZmZmZmZ d dlm Z  e rkd dl!m"Z" d dl!m#Z# d dl!m$Z$ d dl!m%Z% d dl!m&Z& d dl!m'Z' d dl!m(Z( d dl!m)Z) d dl!m*Z* d dl!m+Z+ d dl!m,Z, d dl!m-Z- d dl.m/Z/ d dlm0Z0m1Z1m2Z2m3Z3m4Z4 d dlm5Z5  e+d«      Z6nd„ Z, ed«      Z7d„ Z8d „ Z9 G d!„ d"e:«      Z;d#„ Z<d$„ Z=d dlm Z  e r G d%„ d&e5e;«      Z>n d'„ «       Z> G d(„ d)e?«      Z@ G d*„ d+e:«      ZA G d,„ d- ee@«      «      ZB eB«       ZCe7j‰                  eC«       y).é    N)Úcontextmanager)Údatetime_utcnowÚwith_metaclass)ÚINSTRUMENTER©ÚScope)ÚClient)ÚProfile)ÚNoOpSpanÚSpanÚTransactionÚBAGGAGE_HEADER_NAMEÚSENTRY_TRACE_HEADER_NAME)ÚSession)Úhas_tracing_enabledÚnormalize_incoming_data)Úexc_info_from_errorÚevent_from_exceptionÚloggerÚ
ContextVar)ÚTYPE_CHECKING)ÚUnion)ÚAny)ÚOptional)ÚTuple)ÚDict)ÚList)ÚCallable)Ú	Generator)ÚType)ÚTypeVar)Úoverload)ÚContextManager)ÚIntegration)ÚEventÚHintÚ
BreadcrumbÚBreadcrumbHintÚExcInfo)ÚClientConstructorÚTc                 ó   — | S ©N© )Úxs    úL/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/sentry_sdk/hub.pyr"   r"   =   s   € àˆó    Úsentry_current_hubc                 óü   — |r|rt        d«      ‚|�=t        j                  | «      }t        |«      r
 ||«       |S |j                  |«       |S |r)t        j                  | «      } |j                  di |¤Ž |S | }|S )Nzcannot provide scope and kwargsr.   )Ú	TypeErrorÚcopyÚcallableÚupdate_from_scopeÚupdate_from_kwargs)ÚbaseÚscope_changeÚscope_kwargsÚfinal_scopes       r0   Ú_update_scoper=   E   s�   € á™ÜÐ9Ó:Ð:ØÐÜ—i‘i “oˆÜ�LÔ!Ù˜Ô%ð Ðð ×)Ñ)¨,Ô7ð Ðñ 
Ü—i‘i “oˆØ&ˆ×&Ñ&Ñ6¨Ò6ð Ðð ˆØÐr1   c                  óZ   — t         j                  j                  } | sy| j                  d   S )NFÚsend_default_pii)ÚHubÚcurrentÚclientÚoptions)rB   s    r0   Ú_should_send_default_piirD   W   s'   € ä�[‰[×Ñ€FÙØØ�>‰>Ð,Ñ-Ð-r1   c                   ó   — e Zd Zd„ Zd„ Zd„ Zy)Ú
_InitGuardc                 ó   — || _         y r-   )Ú_client)ÚselfrB   s     r0   Ú__init__z_InitGuard.__init__`   s	   € àˆ�r1   c                 ó   — | S r-   r.   ©rI   s    r0   Ú	__enter__z_InitGuard.__enter__d   s   € àˆr1   c                 óB   — | j                   }|�|j                  «        y y r-   )rH   Úclose)rI   Úexc_typeÚ	exc_valueÚtbÚcs        r0   Ú__exit__z_InitGuard.__exit__h   s   € à�L‰LˆØˆ=Ø�G‰G�Ið r1   N©Ú__name__Ú
__module__Ú__qualname__rJ   rM   rT   r.   r1   r0   rF   rF   _   s   „ òòór1   rF   c                  ó°   — t         j                  d d } | dk(  s| dk(  r9t        j                  d dj                  | Ž «       t        j                  d«       y y )Né   )é   é   )r[   é   z1sentry-sdk 2.0.0 will drop support for Python %s.z{}.{}zQPlease upgrade to the latest version to continue receiving upgrades and bugfixes.)ÚsysÚversion_infor   ÚwarningÚformat)Úversions    r0   Ú_check_python_deprecationsrc   o   sV   € ä×Ñ˜r Ð"€Gà�&Ò˜G vÒ-Ü�‰Ø?ØˆG�N‰N˜GÐ$ô	
ô 	�‰Ø_õ	
ð .r1   c                  ó„   — t        | i |¤Ž}t        j                  j                  |«       t	        «        t        |«      }|S )zsInitializes the SDK and optionally integrations.

    This takes the same arguments as the client constructor.
    )r	   r@   rA   Úbind_clientrc   rF   )ÚargsÚkwargsrB   Úrvs       r0   Ú_initri   }   s:   € ô �TÐ$˜VÑ$€FÜ‡K�K×Ñ˜FÔ#ÜÔ Ü	�FÓ	€BØ€Ir1   c                   ó   — e Zd Zy)ÚinitN)rV   rW   rX   r.   r1   r0   rk   rk   “   s   „ Ør1   rk   c                  ó   — t         S r-   )ri   r.   r1   r0   ú<lambda>rm   ›   s   € ”E€ r1   c                   ó,   — e Zd Zed„ «       Zed„ «       Zy)ÚHubMetac                 ó|   — t         j                  d«      }|€$t        t        «      }t         j	                  |«       |S )z(Returns the current instance of the hub.N)Ú_localÚgetr@   Ú
GLOBAL_HUBÚset)Úclsrh   s     r0   rA   zHubMeta.currentŸ   s0   € ô �Z‰Z˜ÓˆØˆ:Ü”Z“ˆBÜ�J‰J�rŒNØˆ	r1   c                 ó   — t         S )z%Returns the main instance of the hub.)rs   )ru   s    r0   ÚmainzHubMeta.main©   s
   € ô Ðr1   N)rV   rW   rX   ÚpropertyrA   rw   r.   r1   r0   ro   ro   ž   s(   „ Øñó ðð ñó ñr1   ro   c                   ó   — e Zd Zd„ Zd„ Zd„ Zy)Ú_ScopeManagerc                 ón   — || _         t        |j                  «      | _        |j                  d   | _        y ©Néÿÿÿÿ)Ú_hubÚlenÚ_stackÚ_original_lenÚ_layer)rI   Úhubs     r0   rJ   z_ScopeManager.__init__±   s(   € àˆŒ	Ü  §¡›_ˆÔØ—j‘j ‘nˆ�r1   c                 ó,   — | j                   d   }|€J ‚|S )Né   )r‚   )rI   Úscopes     r0   rM   z_ScopeManager.__enter__·   s    € à—‘˜A‘ˆØÐ Ð Ð Øˆr1   c                 ó¼  — t        | j                  j                  «      }|| j                  k  r$t	        j
                  d| j                  |z
  «       y || j                  kD  rEt	        j                  d|| j                  z
  | j                  j                  | j                  d  «       | j                  j                  | j                  dz
     }| j                  j                  | j                  dz
  d …= |d   | j                  d   k7  r(t	        j
                  d|d   | j                  d   «       y |d   | j                  d   k7  rd}t	        j                  |«       y y )Nz1Scope popped too soon. Popped %s scopes too many.zLeaked %s scopes: %sr…   z2Wrong scope found. Meant to pop %s, but popped %s.r   zÛinit() called inside of pushed scope. This might be entirely legitimate but usually occurs when initializing the SDK inside a request handler or task/job function. Try to initialize the SDK as early as possible instead.)r   r~   r€   r�   r   Úerrorr`   r‚   )rI   rP   rQ   rR   Úcurrent_lenÚlayerr`   s          r0   rT   z_ScopeManager.__exit__½   s5  € ä˜$Ÿ)™)×*Ñ*Ó+ˆØ˜×+Ñ+Ò+Ü�L‰LØCØ×"Ñ" [Ñ0ôð Ø˜4×-Ñ-Ò-Ü�N‰NØ&Ø˜d×0Ñ0Ñ0Ø—	‘	× Ñ  ×!3Ñ!3Ð!5Ð6ôð —	‘	× Ñ  ×!3Ñ!3°aÑ!7Ñ8ˆØ�I‰I×Ñ˜T×/Ñ/°!Ñ3Ñ5Ð6à�‰8�t—{‘{ 1‘~Ò%Ü�L‰LØDØ�a‘Ø—‘˜A‘õð
 �1‰X˜Ÿ™ Q™Ò'ð4ð ô �N‰N˜7Õ#ð (r1   NrU   r.   r1   r0   rz   rz   °   s   „ ò%òó $r1   rz   c                   óˆ  — e Zd ZdZdZerdZdZ	 	 d$d„Zd„ Z	d„ Z
d„ Zd„ Zed„ «       Zed	„ «       Zd
„ Zd„ Zd$d„Zd$d„Zd$d„Zd„ Zd$d„Zdej0                  fd„Zdej0                  fd„Zd%d„Ze	 d&d„«       Zed„ «       Z	 	 d'd„Zd„ Ze	 d&d„«       Zed„ «       Z	 	 d'd„Z	 d(d„Z d„ Z!d„ Z"d„ Z#	 	 d$d„Z$d „ Z%d!„ Z&d&d"„Z'd&d#„Z(y))r@   zýThe hub wraps the concurrency management of the SDK.  Each thread has
    its own hub but the hub might transfer with the flow of execution if
    context vars are available.

    If the hub is used with a with statement it's temporarily activated.
    Nc                 óÈ   — t        |t        «      r,|}|j                  d   \  }}|€t        j                  |«      }n|}|€
t	        «       }||fg| _        d | _        g | _        y r|   )Ú
isinstancer@   r€   r5   r   Ú_last_event_idÚ	_old_hubs)rI   Úclient_or_hubr†   rƒ   rB   Úother_scopes         r0   rJ   zHub.__init__ð   sf   € ô �m¤SÔ)ØˆCØ"%§*¡*¨R¡.ÑˆF�KØˆ}ÜŸ	™	 +Ó.‘à"ˆFØˆ=Ü“GˆEà �Ð'ˆŒØ"ˆÔØˆ�r1   c                 ó‚   — | j                   j                  t        j                  «       t        j                  | «       | S r-   )r�   Úappendr@   rA   rq   rt   rL   s    r0   rM   zHub.__enter__  s)   € à�‰×ÑœcŸk™kÔ*Ü�
‰
�4ÔØˆr1   c                 ób   — | j                   j                  «       }t        j                  |«       y r-   )r�   Úpoprq   rt   )rI   rP   rQ   rR   Úolds        r0   rT   zHub.__exit__
  s!   € ð �n‰n× Ñ Ó"ˆÜ�
‰
�3�r1   c                 ó@   — | 5   |«       cddd«       S # 1 sw Y   yxY w)z~Runs a callback in the context of the hub.  Alternatively the
        with statement can be used on the hub directly.
        Nr.   ©rI   Úcallbacks     r0   ÚrunzHub.run  s!   € ð ñ 	Ù“:÷	÷ 	ò 	ús   ƒ”c                 óÎ   — t        |t        «      r|}n$|j                  �|j                  }nt        d«      ‚| j                  }|� |j
                  j                  |«      }|�|S yy)a  Returns the integration for this hub by name or class.  If there
        is no client bound or the client does not have that integration
        then `None` is returned.

        If the return value is not `None` the hub is guaranteed to have a
        client attached.
        NzIntegration has no name)r�   ÚstrÚ
identifierÚ
ValueErrorrB   Úintegrationsrr   )rI   Úname_or_classÚintegration_namerB   rh   s        r0   Úget_integrationzHub.get_integration  sr   € ô �m¤SÔ)Ø,ÑØ×%Ñ%Ð1Ø,×7Ñ7ÑäÐ6Ó7Ð7à—‘ˆØÐØ×$Ñ$×(Ñ(Ð)9Ó:ˆBØˆ~Ø�	ð ð r1   c                 ó&   — | j                   d   d   S )z&Returns the current client on the hub.r}   r   ©r€   rL   s    r0   rB   z
Hub.client6  ó   € ð �{‰{˜2‰˜qÑ!Ð!r1   c                 ó&   — | j                   d   d   S )z%Returns the current scope on the hub.r}   r…   r¤   rL   s    r0   r†   z	Hub.scope<  r¥   r1   c                 ó   — | j                   S )zReturns the last event ID.)rŽ   rL   s    r0   Úlast_event_idzHub.last_event_idB  s   € ð ×"Ñ"Ð"r1   c                 óJ   — | j                   d   }||d   f| j                   d<   y)zBinds a new client to the hub.r}   r…   Nr¤   )rI   ÚnewÚtops      r0   re   zHub.bind_clientG  s&   € ð
 �k‰k˜"‰oˆØ  A¡˜-ˆ�‰�BŠr1   c                 ó®   — | j                   d   \  }}t        |||«      }|�4|j                  d«      dk(  }|j                  |||«      }|�	|s|| _        |S y)zÛ
        Captures an event.

        Alias of :py:meth:`sentry_sdk.Client.capture_event`.

        :param scope_args: For supported `**scope_args` see
            :py:meth:`sentry_sdk.Scope.update_from_kwargs`.
        r}   NÚtypeÚtransaction)r€   r=   rr   Úcapture_eventrŽ   )	rI   ÚeventÚhintr†   Ú
scope_argsrB   Ú	top_scopeÚis_transactionrh   s	            r0   r¯   zHub.capture_eventO  sh   € ð !ŸK™K¨™OÑˆ�	Ü˜i¨°
Ó;ˆØÐØ"ŸY™Y vÓ.°-Ñ?ˆNØ×%Ñ% e¨T°5Ó9ˆBØˆ~¡nØ&(�Ô#ØˆIØr1   c                 óT   — | j                   €y|€d} | j                  ||dœfd|i|¤ŽS )aç  
        Captures a message.

        :param message: The string to send as the message.

        :param level: If no level is provided, the default level is `info`.

        :param scope: An optional :py:class:`sentry_sdk.Scope` to use.

        :param scope_args: For supported `**scope_args` see
            :py:meth:`sentry_sdk.Scope.update_from_kwargs`.

        :returns: An `event_id` if the SDK decided to send the event (see :py:meth:`sentry_sdk.Client.capture_event`).
        NÚinfo)ÚmessageÚlevelr†   )rB   r¯   )rI   r·   r¸   r†   r²   s        r0   Úcapture_messagezHub.capture_messagec  sH   € ð  �;‰;ÐØØˆ=ØˆEØ!ˆt×!Ñ!Ø¨%Ñ0ñ
Ø8=ð
ØAKñ
ð 	
r1   c                 ó*  — | j                   }|€y|�t        |«      }nt        j                  «       }t	        ||j
                  ¬«      \  }}	  | j                  |f||dœ|¤ŽS # t        $ r& | j                  t        j                  «       «       Y yw xY w)ah  Captures an exception.

        :param error: An exception to catch. If `None`, `sys.exc_info()` will be used.

        :param scope_args: For supported `**scope_args` see
            :py:meth:`sentry_sdk.Scope.update_from_kwargs`.

        :returns: An `event_id` if the SDK decided to send the event (see :py:meth:`sentry_sdk.Client.capture_event`).
        N)Úclient_options)r±   r†   )	rB   r   r^   Úexc_infor   rC   r¯   Ú	ExceptionÚ_capture_internal_exception)rI   rˆ   r†   r²   rB   r¼   r°   r±   s           r0   Úcapture_exceptionzHub.capture_exception{  sŽ   € ð —‘ˆØˆ>ØØÐÜ*¨5Ó1‰Hä—|‘|“~ˆHä*¨8ÀFÇNÁNÔS‰ˆˆtð	=Ø%�4×%Ñ% eÐR°$¸eÑRÀzÑRÐRøÜò 	=Ø×,Ñ,¬S¯\©\«^Õ<àð	=ús   ÁA# Á#,BÂBc                 ó2   — t        j                  d|¬«       y)z¯
        Capture an exception that is likely caused by a bug in the SDK
        itself.

        These exceptions do not end up in Sentry and are just logged instead.
        zInternal error in sentry_sdk)r¼   N)r   rˆ   )rI   r¼   s     r0   r¾   zHub._capture_internal_exception–  s   € ô 	�‰Ð3¸hÖGr1   c                 ó’  — | j                   d   \  }}|€t        j                  d«       yt        |xs d«      }|j	                  |«       |syt        |xs d«      }|j                  d«      €t        «       |d<   |j                  d«      €d|d<   |j                  d   � |j                  d   ||«      }n|}|�|j                  j                  |«       nt        j                  d	|«       |j                  d
   }t        |j                  «      |kD  r4|j                  j                  «        t        |j                  «      |kD  rŒ3yy)a  
        Adds a breadcrumb.

        :param crumb: Dictionary with the data as the sentry v7/v8 protocol expects.

        :param hint: An optional value that can be used by `before_breadcrumb`
            to customize the breadcrumbs that are emitted.
        r}   Nz*Dropped breadcrumb because no client boundr.   Ú	timestampr­   ÚdefaultÚbefore_breadcrumbz)before breadcrumb dropped breadcrumb (%s)Úmax_breadcrumbs)r€   r   r¶   ÚdictÚupdaterr   r   rC   Ú_breadcrumbsr“   r   Úpopleft)rI   Úcrumbr±   rg   rB   r†   Ú	new_crumbrÅ   s           r0   Úadd_breadcrumbzHub.add_breadcrumb¢  s+  € ð Ÿ™ B™‰ˆ�Øˆ>Ü�K‰KÐDÔEØä�U’[˜bÓ!ˆØ�‰�VÔÙØä�D’J˜BÓˆà�9‰9�[Ó!Ð)Ü!0Ó!2ˆE�+ÑØ�9‰9�VÓÐ$Ø%ˆE�&‰Mà�>‰>Ð-Ñ.Ð:Ø;˜Ÿ™Ð':Ñ;¸EÀ4ÓH‰IàˆIàÐ Ø×Ñ×%Ñ% iÕ0ä�K‰KÐCÀUÔKà Ÿ.™.Ð):Ñ;ˆÜ�%×$Ñ$Ó%¨Ò7Ø×Ñ×&Ñ&Ô(ô �%×$Ñ$Ó%¨Õ7r1   c                 ó°  — | j                   xr | j                   j                  d   }||k7  r
t        «       S t        |t        «      sd|v rvd}t        |t        «      r&t        j                  |«       | j                  |«      S d|v r:t        j                  |«       |j                  d«      } | j                  dd|i|¤ŽS |�d}t        j                  |«       |S |j                  d| «       | j                  j                  }|� |j                  di |¤Ž}|S d|vr/| j                  «       }	|	r|	j                  d	«      d
   nd}
|
�|
|d<   t        di |¤ŽS )a“  
        Start a span whose parent is the currently active span or transaction, if any.

        The return value is a :py:class:`sentry_sdk.tracing.Span` instance,
        typically used as a context manager to start and stop timing in a `with`
        block.

        Only spans contained in a transaction are sent to Sentry. Most
        integrations start a transaction at the appropriate time, for example
        for every incoming HTTP request. Use
        :py:meth:`sentry_sdk.start_transaction` to start a new transaction when
        one is not already in progress.

        For supported `**kwargs` see :py:class:`sentry_sdk.tracing.Span`.
        Úinstrumenterr®   zcDeprecated: use start_transaction to start transactions and Transaction.start_child to start spans.ÚnameNz]Deprecated: passing a span into `start_span` is deprecated and will be removed in the future.rƒ   Útrace_idú-r   r.   )rB   rC   r   r�   r   r   r`   Ústart_transactionr•   Ú
setdefaultr†   ÚspanÚstart_childÚget_traceparentÚsplitr   )rI   rÔ   rÎ   rg   Úconfiguration_instrumenterÚdeprecation_msgrÏ   Úactive_spanÚnew_child_spanÚtraceparentrÐ   s              r0   Ú
start_spanzHub.start_spanË  s_  € ð" &*§[¡[Ò%X°T·[±[×5HÑ5HÈÑ5XÐ"àÐ5Ò5Ü“:Ðô �dœKÔ(¨M¸VÑ,Cð:ð ô
 ˜$¤Ô,Ü—‘˜Ô/Ø×-Ñ-¨dÓ3Ð3à Ñ&Ü—‘˜Ô/Ø—z‘z -Ó0�Ø-�t×-Ñ-ÑB°4ÐB¸6ÑBÐBð ÐØ}ˆOÜ�N‰N˜?Ô+ØˆKà×Ñ˜% Ô&à—j‘j—o‘oˆØÐ"Ø4˜[×4Ñ4Ñ>°vÑ>ˆNØ!Ð!ð
 ˜VÑ#Ø×.Ñ.Ó0ˆKÙ4?�{×(Ñ(¨Ó-¨aÒ0ÀTˆHØÐ#Ø%-��zÑ"ä‰~�f‰~Ðr1   c                 óB  — | j                   xr | j                   j                  d   }||k7  r
t        «       S |j                  di «      }|€|j	                  d| «       t        di |¤Ž}|j                  «       |j                  dœ}|j                  |«       |j                  |¬«       t        || ¬«      }|j                  |¬«       |j                  rL| j                   xr( | j                   j                  d   j                  d«      xs d	}|j                  |¬
«       |S )aá  
        Start and return a transaction.

        Start an existing transaction if given, otherwise create and start a new
        transaction with kwargs.

        This is the entry point to manual tracing instrumentation.

        A tree structure can be built by adding child spans to the transaction,
        and child spans to other spans. To start a new child span within the
        transaction or any span, call the respective `.start_child()` method.

        Every child span must be finished before the transaction is finished,
        otherwise the unfinished spans are discarded.

        When used as context managers, spans and transactions are automatically
        finished at the end of the `with` block. If not using context managers,
        call the `.finish()` method.

        When the transaction is finished, it will be sent to Sentry with all its
        finished child spans.

        For supported `**kwargs` see :py:class:`sentry_sdk.tracing.Transaction`.
        rÎ   Úcustom_sampling_contextrƒ   )Útransaction_contextÚparent_sampled)Úsampling_context)rƒ   Ú_experimentsÚ	max_spansiè  )Úmaxlenr.   )rB   rC   r   r•   rÓ   r   Úto_jsonrá   rÇ   Ú_set_initial_sampling_decisionr
   Úsampledrr   Úinit_span_recorder)	rI   r®   rÎ   rg   rØ   rß   râ   Úprofilerä   s	            r0   rÒ   zHub.start_transaction  s!  € ð8 &*§[¡[Ò%X°T·[±[×5HÑ5HÈÑ5XÐ"àÐ5Ò5Ü“:Ðà"(§*¡*Ð-FÈÓ"KÐð ÐØ×Ñ˜e TÔ*Ü%Ñ/¨Ñ/ˆKð
 $/×#6Ñ#6Ó#8Ø)×8Ñ8ñ
Ðð 	×ÑÐ 7Ô8Ø×2Ñ2ÐDTÐ2ÔUä˜+¨4Ô0ˆØ×.Ñ.Ð@PÐ.ÔQð ×Òà—‘ÒT §¡× 3Ñ 3°NÑ C× GÑ GÈÓ Tòàð ð ×*Ñ*°)Ð*Ô<àÐr1   c                 ó¶   — | j                  «       5 }|j                  |«       ddd«       t        j                  t	        |«      |||¬«      }|S # 1 sw Y   Œ-xY w)ze
        Sets the propagation context from environment or headers and returns a transaction.
        N)ÚoprÏ   Úsource)Úconfigure_scopeÚgenerate_propagation_contextr   Úcontinue_from_headersr   )rI   Úenviron_or_headersrì   rÏ   rí   r†   r®   s          r0   Úcontinue_tracezHub.continue_traceK  sf   € ð
 ×!Ñ!Ó#ð 	C uØ×.Ñ.Ð/AÔB÷	Cô "×7Ñ7Ü#Ð$6Ó7ØØØô	
ˆð Ð÷	Cð 	Cús   ‘AÁAc                  ó   — y r-   r.   r˜   s     r0   Ú
push_scopezHub.push_scope[  ó   € ð
 	r1   c                  ó   — y r-   r.   r˜   s     r0   rô   zHub.push_scopeb  rõ   r1   c                 ó(  — |�"| j                  «       5 } ||«       ddd«       y| j                  d   \  }}t        j                  |«      }|r|j                  «        ||f}| j                  j	                  |«       t        | «      S # 1 sw Y   yxY w)a.  
        Pushes a new layer on the scope stack.

        :param callback: If provided, this method pushes a scope, calls
            `callback`, and pops the scope again.

        :returns: If no `callback` is provided, a context manager that should
            be used to pop the scope again.
        Nr}   )rô   r€   r5   rï   r“   rz   )rI   r™   rò   r†   rB   Ú	new_scopeÚ	new_layers          r0   rô   zHub.push_scopei  sˆ   € ð ÐØ—‘Ó"ð   eÙ˜”÷ ààŸ™ B™‰ˆ�ä—I‘I˜eÓ$ˆ	áØ×2Ñ2Ô4à˜YÐ'ˆ	Ø�‰×Ñ˜9Ô%ä˜TÓ"Ð"÷ àús   “	BÂBc                 ó`   — | j                   j                  «       }| j                   sJ d«       ‚|S )z{
        Pops a scope layer from the stack.

        Try to use the context manager :py:meth:`push_scope` instead.
        z"stack must have at least one layer)r€   r•   )rI   rh   s     r0   Úpop_scope_unsafezHub.pop_scope_unsafe‰  s+   € ð �[‰[�_‰_ÓˆØ�{Š{Ð@Ð@Ó@ˆ{Øˆ	r1   c                  ó   — y r-   r.   r˜   s     r0   rî   zHub.configure_scope”  rõ   r1   c                  ó   — y r-   r.   r˜   s     r0   rî   zHub.configure_scope›  rõ   r1   c                 ó”   ‡‡— | j                   d   \  ŠŠ|r‰j                  «        |�‰� |‰«       yt        ˆˆfd„«       } |«       S )zÛ
        Reconfigures the scope.

        :param callback: If provided, call the callback with the current scope.

        :returns: If no callback is provided, returns a context manager that returns the scope.
        r}   Nc               3   ó4   •K  — ‰ �‰–— y t        «       –— y ­wr-   r   )rB   r†   s   €€r0   Úinnerz"Hub.configure_scope.<locals>.inner¼  s   øè ø€ ð Ð!Ø“ä“g“ùs   ƒ)r€   rï   r   )rI   r™   rò   r   rB   r†   s       @@r0   rî   zHub.configure_scope¢  sV   ù€ ð Ÿ™ B™‰ˆ�áØ×.Ñ.Ô0àÐØÐ!Ù˜”àä	ô	ó 
ð	ñ ‹wˆr1   c                 óÈ   — | j                  «        | j                  d   \  }}t        |r|j                  d   nd|r|j                  d   nd|j                  |¬«      |_        y)zStarts a new session.r}   ÚreleaseNÚenvironment)r  r  ÚuserÚsession_mode)Úend_sessionr€   r   rC   Ú_userÚ_session)rI   r  rB   r†   s       r0   Ústart_sessionzHub.start_sessionÆ  sW   € ð
 	×ÑÔØŸ™ B™‰ˆ�Ü Ù17�F—N‘N 9Ò-¸TÙ9?˜Ÿ™ }Ò5ÀTØ—‘Ø%ô	
ˆ�r1   c                 ó°   — | j                   d   \  }}|j                  }d| j                  _        |�%|j                  «        |�|j	                  |«       yyy)z)Ends the current session if there is one.r}   N)r€   r  r†   rO   Úcapture_session)rI   rB   r†   Úsessions       r0   r  zHub.end_sessionÔ  sW   € ð Ÿ™ B™‰ˆ�Ø—.‘.ˆØ"ˆ�
‰
ÔàÐØ�M‰MŒOØÐ!Ø×&Ñ& wÕ/ð "ð r1   c                 óV   — | j                  «        | j                  d   \  }}d|_        y)zÀStops automatic session tracking.

        This temporarily session tracking for the current scope when called.
        To resume session tracking call `resume_auto_session_tracking`.
        r}   FN)r  r€   Ú_force_auto_session_tracking©rI   rB   r†   s      r0   Ústop_auto_session_trackingzHub.stop_auto_session_trackingà  s)   € ð 	×ÑÔØŸ™ B™‰ˆ�Ø-2ˆÕ*r1   c                 ó6   — | j                   d   \  }}d|_        y)z«Resumes automatic session tracking for the current scope if
        disabled earlier.  This requires that generally automatic session
        tracking is enabled.
        r}   N)r€   r  r  s      r0   Úresume_auto_session_trackingz Hub.resume_auto_session_trackingë  s   € ð Ÿ™ B™‰ˆ�Ø-1ˆÕ*r1   c                 óR   — | j                   d   \  }}|�|j                  ||¬«      S y)z>
        Alias for :py:meth:`sentry_sdk.Client.flush`
        r}   N)Útimeoutr™   )r€   Úflush)rI   r  r™   rB   r†   s        r0   r  z	Hub.flushô  s3   € ð Ÿ™ B™‰ˆ�ØÐØ—<‘<¨¸(�<ÓCÐCð r1   c                 ó   — | j                   �Yt        | j                   j                  «      r:| j                  j                  �$| j                  j                  j                  «       S | j                  j                  «       S )zX
        Returns the traceparent either from the active span or from the scope.
        )rB   r   rC   r†   rÔ   Úto_traceparentrÖ   rL   s    r0   rÖ   zHub.get_traceparent  sW   € ð
 �;‰;Ð"Ü" 4§;¡;×#6Ñ#6Ô7¸D¿J¹J¿O¹OÐ<WØ—z‘z—‘×5Ñ5Ó7Ð7à�z‰z×)Ñ)Ó+Ð+r1   c                 ó(  — | j                   �Zt        | j                   j                  «      r;| j                  j                  �%| j                  j                  j                  «       }n| j                  j                  «       }|�|j                  «       S y)zP
        Returns Baggage either from the active span or from the scope.
        N)rB   r   rC   r†   rÔ   Ú
to_baggageÚget_baggageÚ	serialize)rI   Úbaggages     r0   r  zHub.get_baggage  sn   € ð �K‰KÐ#Ü# D§K¡K×$7Ñ$7Ô8Ø—
‘
—‘Ð+à—j‘j—o‘o×0Ñ0Ó2‰Gà—j‘j×,Ñ,Ó.ˆGàÐØ×$Ñ$Ó&Ð&àr1   c              #   ó<  K  — | j                   d   d   }|xr |j                  d   }|sy|xs | j                  j                  }|r1t	        |j                  «      r|�|j                  «       D ]  }|–— Œ y| j                  j                  «       D ]  }|–— Œ y­w)zÆ
        Return HTTP headers which allow propagation of trace data. Data taken
        from the span representing the request, if available, or the current
        span on the scope if not.
        r}   r   Úpropagate_tracesN)r€   rC   r†   rÔ   r   Úiter_headers)rI   rÔ   rB   r  Úheaders        r0   Úiter_trace_propagation_headersz"Hub.iter_trace_propagation_headers  s›   è ø€ ð —‘˜R‘ Ñ#ˆØ!ÒH f§n¡nÐ5GÑ&HÐÙØàÒ&�t—z‘z—‘ˆáÔ)¨&¯.©.Ô9¸dÐ>NØ×+Ñ+Ó-ò �Ø“ñð Ÿ*™*×1Ñ1Ó3ò �Ø“ñùs   ‚BBc                 óÀ   — |�t        j                  d«       d}| j                  «       }|�|dt        ›d|›d�z  }| j	                  «       }|�|dt
        ›d|›d�z  }|S )z‚
        Return meta tags which should be injected into HTML templates
        to allow propagation of trace information.
        zaThe parameter `span` in trace_propagation_meta() is deprecated and will be removed in the future.Ú z<meta name="z" content="z">)r   r`   rÖ   r   r  r   )rI   rÔ   ÚmetaÚsentry_tracer  s        r0   Útrace_propagation_metazHub.trace_propagation_meta4  s{   € ð ÐÜ�N‰NØsôð ˆà×+Ñ+Ó-ˆØÐ#ÙÞ(Úðñ ˆDð
 ×"Ñ"Ó$ˆØÐÙÞ#Úðñ ˆDð
 ˆr1   )NN)NNNr-   )NT)Úapplication))rV   rW   rX   Ú__doc__r€   r   rA   rw   rJ   rM   rT   rš   r¢   rx   rB   r†   r¨   re   r¯   r¹   r¿   r¾   rÌ   r   ÚSENTRYrÝ   rÒ   rò   r"   rô   rû   rî   r	  r  r  r  r  rÖ   r  r!  r&  r.   r1   r0   r@   r@   à   si  „ ñð €Fñ ØˆØˆð Øóò(òòòð0 ñ"ó ð"ð
 ñ"ó ð"ò
#ò
(óó(
ó0ò6
Hó')ðR #°×1DÑ1Dó @ðF ¨\×-@Ñ-@ó<ó|ð  àòó ðð ñó ðð Øó#ò@	ð àòó ðð ñó ðð Øó"ðJ )ó
ò
0ò	3ò2ð ØóDò	,òó&ô*r1   r@   )Er5   r^   Ú
contextlibr   Úsentry_sdk._compatr   r   Úsentry_sdk.constsr   Úsentry_sdk.scoper   Úsentry_sdk.clientr	   Úsentry_sdk.profilerr
   Úsentry_sdk.tracingr   r   r   r   r   Úsentry_sdk.sessionr   Úsentry_sdk.tracing_utilsr   r   Úsentry_sdk.utilsr   r   r   r   Úsentry_sdk._typesr   Útypingr   r   r   r   r   r   r   r   r    r!   r"   r#   Úsentry_sdk.integrationsr$   r%   r&   r'   r(   r)   r*   r+   rq   r=   rD   ÚobjectrF   rc   ri   rk   r­   ro   rz   r@   rs   rt   r.   r1   r0   ú<module>r8     s  ðÛ Û 
å %ç >Ý *Ý "Ý $Ý '÷õ õ '÷÷
ó õ ,áÝÝÝÝÝÝÝÝ ÝÝÝÝ%å3÷õ õ 4á�‹�Aòñ
 
Ð(Ó	)€òò$.ô�ô ò 
ò
õ ,áôÐ  *õ ò Ó€Dôˆdô ô$-$�Fô -$ô`o	‰.˜Ó
!ô o	ñd ‹U€
Ø ‡
�
ˆ:Õ r1   