2026-07-20 16:05:17 +00:00
// Module ID: 852
2026-07-24 07:16:23 +00:00
// Function ID: 9498
2026-07-20 16:05:17 +00:00
// Name: _makeInternalError
2026-07-23 10:11:24 +00:00
// Dependencies: [57, 5, 6, 7, 77, 853, 854, 814, 800, 801, 851, 856, 861, 807, 804, 822, 863, 839, 840, 834, 846, 825, 833, 864, 813, 808, 849, 865, 866, 835, 796, 823]
2026-07-20 16:05:17 +00:00
// Module 852 (_makeInternalError)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray" ;
import asyncGeneratorStep from "makePromiseBuffer" ;
import _classCallCheck from "createTransport" ;
import _defineProperties from "dsnFromString" ;
import _defineProperty from "_defineProperty" ;
2026-07-20 16:05:17 +00:00
function _makeInternalError ( message ) {
2026-07-23 10:11:24 +00:00
return _defineProperty ( { message } , closure _7 , true ) ;
2026-07-20 16:05:17 +00:00
}
function _makeDoNotSendEventError ( message ) {
2026-07-23 10:11:24 +00:00
return _defineProperty ( { message } , closure _8 , true ) ;
2026-07-20 16:05:17 +00:00
}
function _isInternalError ( arg0 ) {
let tmp2 = ! tmp ;
if ( ! ! arg0 ) {
tmp2 = "object" === typeof arg0 ;
}
if ( tmp2 ) {
tmp2 = closure _7 in arg0 ;
}
return tmp2 ;
}
function _isDoNotSendEventError ( arg0 ) {
let tmp2 = ! tmp ;
if ( ! ! arg0 ) {
tmp2 = "object" === typeof arg0 ;
}
if ( tmp2 ) {
tmp2 = closure _8 in arg0 ;
}
return tmp2 ;
}
function setupWeightBasedFlushing ( on ) {
2026-07-23 10:11:24 +00:00
let closure _0 = on ;
let closure _1 = arg3 ;
2026-07-20 16:05:17 +00:00
let closure _2 = arg4 ;
2026-07-23 10:11:24 +00:00
let c4 = 0 ;
let c5 = false ;
2026-07-20 16:05:17 +00:00
on . on ( arg2 , ( ) => {
2026-07-23 10:11:24 +00:00
let c4 = 0 ;
2026-07-20 16:05:17 +00:00
clearTimeout ( closure _3 ) ;
2026-07-23 10:11:24 +00:00
let c5 = false ;
2026-07-20 16:05:17 +00:00
} ) ;
on . on ( arg1 , ( arg0 ) => {
2026-07-23 10:11:24 +00:00
const sum = c4 + callback ( arg0 ) ;
c4 = sum ;
2026-07-20 16:05:17 +00:00
if ( sum >= 800000 ) {
2026-07-23 10:11:24 +00:00
callback2 ( closure _0 ) ;
} else if ( ! c5 ) {
c5 = true ;
2026-07-20 16:05:17 +00:00
const _setTimeout = setTimeout ;
const timeout = setTimeout ( ( ) => {
2026-07-23 10:11:24 +00:00
outer1 _2 ( outer1 _0 ) ;
2026-07-20 16:05:17 +00:00
} , 5000 ) ;
}
} ) ;
on . on ( "flush" , ( ) => {
2026-07-23 10:11:24 +00:00
callback2 ( closure _0 ) ;
2026-07-20 16:05:17 +00:00
} ) ;
}
function getDataCategoryByType ( arg0 ) {
let str = arg0 ;
let str2 = "replay" ;
if ( "replay_event" !== arg0 ) {
if ( ! str ) {
str = "error" ;
}
str2 = str ;
}
return str2 ;
}
function isErrorEvent ( type ) {
return undefined === type . type ;
}
function isTransactionEvent ( type ) {
return "transaction" === type . type ;
}
function estimateMetricSizeInBytes ( name ) {
let num = 0 ;
if ( name . name ) {
num = 2 * name . name . length ;
}
return num + 8 + estimateAttributesSizeInBytes ( name . attributes ) ;
}
function estimateLogSizeInBytes ( message ) {
let num = 0 ;
if ( message . message ) {
num = 2 * message . message . length ;
}
return num + estimateAttributesSizeInBytes ( message . attributes ) ;
}
function estimateAttributesSizeInBytes ( attributes ) {
if ( attributes ) {
2026-07-23 10:11:24 +00:00
let c0 = 0 ;
2026-07-20 16:05:17 +00:00
const _Object = Object ;
const values = Object . values ( attributes ) ;
const item = values . forEach ( ( arg0 ) => {
if ( Array . isArray ( arg0 ) ) {
2026-07-23 10:11:24 +00:00
closure _0 = closure _0 + arg0 . length * outer1 _20 ( arg0 [ 0 ] ) ;
2026-07-20 16:05:17 +00:00
} else {
if ( obj . isPrimitive ( arg0 ) ) {
2026-07-23 10:11:24 +00:00
closure _0 = tmp3 + outer1 _20 ( arg0 ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
closure _0 = tmp3 + 100 ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
obj = v0 ( outer1 _1 [ 14 ] ) ;
2026-07-20 16:05:17 +00:00
}
} ) ;
2026-07-23 10:11:24 +00:00
return c0 ;
2026-07-20 16:05:17 +00:00
} else {
return 0 ;
}
}
function estimatePrimitiveSizeInBytes ( arg0 ) {
if ( "string" === typeof arg0 ) {
let num = 2 * arg0 . length ;
} else {
num = 8 ;
if ( "number" !== tmp ) {
let num2 = 0 ;
if ( "boolean" === tmp ) {
num2 = 4 ;
}
num = num2 ;
}
}
return num ;
}
Object . defineProperty ( exports , Symbol . toStringTag , { value : "Module" } ) ;
let closure _7 = Symbol . for ( "SentryInternalError" ) ;
let closure _8 = Symbol . for ( "SentryDoNotSendEventError" ) ;
2026-07-23 10:11:24 +00:00
export const Client = ( ( ) => {
2026-07-20 16:05:17 +00:00
class Client {
constructor ( arg0 ) {
self = this ;
tmp = Client ( this , Client ) ;
this . _options = arg0 ;
this . _integrations = { } ;
this . _numProcessing = 0 ;
this . _outcomes = { } ;
this . _hooks = { } ;
this . _eventProcessors = [ ] ;
2026-07-24 07:16:23 +00:00
obj = f9558 ( f9553 [ 5 ] ) ;
2026-07-20 16:05:17 +00:00
transportOptions = arg0 . transportOptions ;
bufferSize = undefined ;
if ( null != transportOptions ) {
bufferSize = transportOptions . bufferSize ;
}
if ( null == bufferSize ) {
2026-07-24 07:16:23 +00:00
tmp3 = f9558 ;
tmp4 = f9553 ;
2026-07-20 16:05:17 +00:00
num = 6 ;
2026-07-24 07:16:23 +00:00
bufferSize = f9558 ( f9553 [ 6 ] ) . DEFAULT _TRANSPORT _BUFFER _SIZE ;
2026-07-20 16:05:17 +00:00
}
self . _promiseBuffer = obj . makePromiseBuffer ( bufferSize ) ;
2026-07-24 07:16:23 +00:00
tmp5 = f9558 ;
tmp6 = f9553 ;
2026-07-20 16:05:17 +00:00
if ( arg0 . dsn ) {
num4 = 7 ;
tmp5Result = tmp5 ( tmp6 [ 7 ] ) ;
self . _dsn = tmp5Result . makeDsn ( arg0 . dsn ) ;
} else {
num2 = 8 ;
if ( tmp5 ( tmp6 [ 8 ] ) . DEBUG _BUILD ) {
2026-07-24 07:16:23 +00:00
tmp7 = f9558 ;
tmp8 = f9553 ;
2026-07-20 16:05:17 +00:00
num3 = 9 ;
2026-07-24 07:16:23 +00:00
debug = f9558 ( f9553 [ 9 ] ) . debug ;
2026-07-20 16:05:17 +00:00
str = "No DSN provided, client will not send events." ;
warnResult = debug . warn ( "No DSN provided, client will not send events." ) ;
}
}
if ( self . _dsn ) {
2026-07-24 07:16:23 +00:00
tmp10 = f9558 ;
tmp11 = f9553 ;
2026-07-20 16:05:17 +00:00
num5 = 10 ;
2026-07-24 07:16:23 +00:00
obj3 = f9558 ( f9553 [ 10 ] ) ;
2026-07-20 16:05:17 +00:00
sdk = undefined ;
if ( arg0 . _metadata ) {
sdk = arg0 . _metadata . sdk ;
}
tmp14 = globalThis ;
_Object = Object ;
obj = { } ;
obj . tunnel = self . _options . tunnel ;
recordDroppedEvent = self . recordDroppedEvent ;
envelopeEndpointWithUrlEncodedAuth = obj3 . getEnvelopeEndpointWithUrlEncodedAuth ( self . _dsn , arg0 . tunnel , sdk ) ;
obj . recordDroppedEvent = recordDroppedEvent . bind ( self ) ;
obj1 = { } ;
obj1 . url = envelopeEndpointWithUrlEncodedAuth ;
self . _transport = arg0 . transport ( Object . assign ( obj , arg0 . transportOptions , obj1 ) ) ;
}
enableLogs = self . _options . enableLogs ;
if ( null == enableLogs ) {
_experiments = self . _options . _experiments ;
enableLogs = undefined ;
if ( null != _experiments ) {
enableLogs = _experiments . enableLogs ;
}
}
self . _options . enableLogs = enableLogs ;
if ( self . _options . enableLogs ) {
2026-07-23 10:11:24 +00:00
tmp16 = outer1 _13 ;
tmp17 = outer1 _18 ;
2026-07-24 07:16:23 +00:00
tmp18 = f9558 ;
tmp19 = f9553 ;
2026-07-20 16:05:17 +00:00
num6 = 11 ;
str2 = "afterCaptureLog" ;
str3 = "flushLogs" ;
tmp20 = self ;
2026-07-24 07:16:23 +00:00
tmp21 = outer1 _13 ( self , "afterCaptureLog" , "flushLogs" , outer1 _18 , f9558 ( f9553 [ 11 ] ) . _INTERNAL _flushLogsBuffer ) ;
2026-07-20 16:05:17 +00:00
}
enableMetrics = self . _options . enableMetrics ;
if ( null == enableMetrics ) {
_experiments2 = self . _options . _experiments ;
enableMetrics = undefined ;
if ( null != _experiments2 ) {
enableMetrics = _experiments2 . enableMetrics ;
}
}
tmp23 = null == enableMetrics || enableMetrics ;
if ( tmp23 ) {
2026-07-23 10:11:24 +00:00
tmp24 = outer1 _13 ;
tmp25 = outer1 _17 ;
2026-07-24 07:16:23 +00:00
tmp26 = f9558 ;
tmp27 = f9553 ;
2026-07-20 16:05:17 +00:00
num7 = 12 ;
str4 = "afterCaptureMetric" ;
str5 = "flushMetrics" ;
tmp28 = self ;
2026-07-24 07:16:23 +00:00
tmp29 = outer1 _13 ( self , "afterCaptureMetric" , "flushMetrics" , outer1 _17 , f9558 ( f9553 [ 12 ] ) . _INTERNAL _flushMetricsBuffer ) ;
2026-07-20 16:05:17 +00:00
}
return ;
}
}
let obj = {
key : "captureException" ,
value : function captureException ( arg0 , arg1 , arg2 ) {
2026-07-23 10:11:24 +00:00
let self = this ;
2026-07-20 16:05:17 +00:00
const callback = arg0 ;
2026-07-23 10:11:24 +00:00
const dependencyMap = arg2 ;
self = this ;
let obj = callback ( 807 ) ;
2026-07-20 16:05:17 +00:00
const uuid4Result = obj . uuid4 ( ) ;
if ( obj2 . checkOrSetAlreadyCaught ( arg0 ) ) {
2026-07-23 10:11:24 +00:00
if ( callback ( 800 ) . DEBUG _BUILD ) {
const debug = callback ( 801 ) . debug ;
2026-07-20 16:05:17 +00:00
debug . log ( "Not capturing exception because it's already been captured." ) ;
}
return uuid4Result ;
} else {
const _Object = Object ;
obj = { event _id : uuid4Result } ;
const merged = Object . assign ( obj , arg1 ) ;
self . _process ( ( ) => {
2026-07-23 10:11:24 +00:00
const eventFromExceptionResult = self . eventFromException ( closure _0 , merged ) ;
return self . eventFromException ( closure _0 , merged ) . then ( ( arg0 ) => outer1 _2 . _captureEvent ( arg0 , outer1 _3 , outer1 _1 ) ) . then ( ( arg0 ) => arg0 ) ;
2026-07-20 16:05:17 +00:00
} , "error" ) ;
return merged . event _id ;
}
2026-07-23 10:11:24 +00:00
obj2 = callback ( 807 ) ;
2026-07-20 16:05:17 +00:00
}
} ;
2026-07-23 10:11:24 +00:00
let items = [ obj , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ] ;
2026-07-20 16:05:17 +00:00
obj = {
key : "captureMessage" ,
value : function captureMessage ( arg0 , arg1 , arg2 , arg3 ) {
2026-07-23 10:11:24 +00:00
let self = this ;
2026-07-20 16:05:17 +00:00
const callback = arg3 ;
2026-07-23 10:11:24 +00:00
self = this ;
const obj = { event _id : callback ( 807 ) . uuid4 ( ) } ;
2026-07-20 16:05:17 +00:00
const merged = Object . assign ( obj , arg2 ) ;
2026-07-23 10:11:24 +00:00
const obj2 = callback ( 807 ) ;
2026-07-20 16:05:17 +00:00
let StringResult = arg0 ;
if ( ! obj3 . isParameterizedString ( arg0 ) ) {
const _String = String ;
StringResult = String ( arg0 ) ;
}
2026-07-23 10:11:24 +00:00
obj3 = callback ( 804 ) ;
const isPrimitiveResult = callback ( 804 ) . isPrimitive ( arg0 ) ;
2026-07-20 16:05:17 +00:00
if ( isPrimitiveResult ) {
let eventFromMessageResult = self . eventFromMessage ( StringResult , arg1 , merged ) ;
} else {
eventFromMessageResult = self . eventFromException ( arg0 , merged ) ;
}
let closure _3 = eventFromMessageResult ;
let str = "error" ;
if ( isPrimitiveResult ) {
str = "unknown" ;
}
2026-07-23 10:11:24 +00:00
self . _process ( ( ) => eventFromMessageResult . then ( ( arg0 ) => outer1 _1 . _captureEvent ( arg0 , outer1 _2 , outer1 _0 ) ) , str ) ;
2026-07-20 16:05:17 +00:00
return merged . event _id ;
}
} ;
items [ 1 ] = obj ;
obj = {
key : "captureEvent" ,
value : function captureEvent ( sdkProcessingMetadata , originalException ) {
2026-07-23 10:11:24 +00:00
let Client ;
let closure _5 ;
let self = this ;
2026-07-20 16:05:17 +00:00
const callback = sdkProcessingMetadata ;
2026-07-23 10:11:24 +00:00
const dependencyMap = arg2 ;
self = this ;
const uuid4Result = callback ( 807 ) . uuid4 ( ) ;
2026-07-20 16:05:17 +00:00
if ( null != originalException ) {
if ( originalException . originalException ) {
if ( obj2 . checkOrSetAlreadyCaught ( originalException . originalException ) ) {
2026-07-23 10:11:24 +00:00
if ( callback ( 800 ) . DEBUG _BUILD ) {
const debug = callback ( 801 ) . debug ;
2026-07-20 16:05:17 +00:00
debug . log ( "Not capturing exception because it's already been captured." ) ;
}
return uuid4Result ;
}
2026-07-23 10:11:24 +00:00
obj2 = callback ( 807 ) ;
2026-07-20 16:05:17 +00:00
}
}
const merged = Object . assign ( { event _id : uuid4Result } , originalException ) ;
2026-07-23 10:11:24 +00:00
( { capturedSpanScope : Client , capturedSpanIsolationScope : closure _5 } = sdkProcessingMetadata . sdkProcessingMetadata || { } ) ;
2026-07-20 16:05:17 +00:00
self . _process ( ( ) => {
let tmp4 = closure _4 ;
if ( ! closure _4 ) {
2026-07-23 10:11:24 +00:00
tmp4 = closure _1 ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
return self . _captureEvent ( closure _0 , merged , tmp4 , closure _5 ) ;
} , outer1 _14 ( sdkProcessingMetadata . type ) ) ;
2026-07-20 16:05:17 +00:00
return merged . event _id ;
}
} ;
items [ 2 ] = obj ;
items [ 3 ] = {
key : "captureSession" ,
value : function captureSession ( arg0 ) {
this . sendSession ( arg0 ) ;
2026-07-23 10:11:24 +00:00
callback ( 822 ) . updateSession ( arg0 , { init : false } ) ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 4 ] = {
key : "getDsn" ,
value : function getDsn ( ) {
return this . _dsn ;
}
} ;
items [ 5 ] = {
key : "getOptions" ,
value : function getOptions ( ) {
return this . _options ;
}
} ;
items [ 6 ] = {
key : "getSdkMetadata" ,
value : function getSdkMetadata ( ) {
return this . _options . _metadata ;
}
} ;
items [ 7 ] = {
key : "getTransport" ,
value : function getTransport ( ) {
return this . _transport ;
}
} ;
const obj6 = { key : "flush" } ;
2026-07-23 10:11:24 +00:00
asyncGeneratorStep = asyncGeneratorStep ( async function ( arg0 ) {
2026-07-20 16:05:17 +00:00
const self = this ;
const _transport = self . _transport ;
if ( _transport ) {
self . emit ( "flush" ) ;
const tmp2 = yield self . _isClientDoneProcessing ( arg0 ) ;
let tmp3 = tmp2 ;
if ( tmp2 ) {
tmp3 = yield _transport . flush ( arg0 ) ;
}
return tmp3 ;
} else {
return true ;
}
} ) ;
obj6 . value = function flush ( arg0 ) {
2026-07-23 10:11:24 +00:00
return callback3 ( ... arguments ) ;
2026-07-20 16:05:17 +00:00
} ;
items [ 8 ] = obj6 ;
2026-07-23 10:11:24 +00:00
let obj7 = { key : "close" } ;
let closure _2 = asyncGeneratorStep ( async function ( arg0 ) {
2026-07-20 16:05:17 +00:00
const self = this ;
self . getOptions ( ) . enabled = false ;
self . emit ( "close" ) ;
return yield self . flush ( arg0 ) ;
} ) ;
obj7 . value = function close ( arg0 ) {
2026-07-23 10:11:24 +00:00
return callback2 ( ... arguments ) ;
2026-07-20 16:05:17 +00:00
} ;
items [ 9 ] = obj7 ;
items [ 10 ] = {
key : "getEventProcessors" ,
value : function getEventProcessors ( ) {
return this . _eventProcessors ;
}
} ;
items [ 11 ] = {
key : "addEventProcessor" ,
value : function addEventProcessor ( arg0 ) {
const _eventProcessors = this . _eventProcessors ;
_eventProcessors . push ( arg0 ) ;
}
} ;
items [ 12 ] = {
key : "init" ,
value : function init ( ) {
const self = this ;
let _isEnabledResult = this . _isEnabled ( ) ;
if ( ! _isEnabledResult ) {
const integrations = self . _options . integrations ;
_isEnabledResult = integrations . some ( ( name ) => {
name = name . name ;
return name . startsWith ( "Spotlight" ) ;
} ) ;
}
if ( _isEnabledResult ) {
self . _setupIntegrations ( ) ;
}
}
} ;
items [ 13 ] = {
key : "getIntegrationByName" ,
value : function getIntegrationByName ( arg0 ) {
return this . _integrations [ arg0 ] ;
}
} ;
items [ 14 ] = {
key : "addIntegration" ,
value : function addIntegration ( arg0 ) {
2026-07-23 10:11:24 +00:00
callback ( 863 ) . setupIntegration ( this , arg0 , this . _integrations ) ;
2026-07-20 16:05:17 +00:00
if ( ! this . _integrations [ arg0 . name ] ) {
const items = [ arg0 ] ;
2026-07-23 10:11:24 +00:00
const result = callback ( 863 ) . afterSetupIntegrations ( this , items ) ;
const obj2 = callback ( 863 ) ;
2026-07-20 16:05:17 +00:00
}
}
} ;
items [ 15 ] = {
key : "sendEvent" ,
value : function sendEvent ( arg0 ) {
2026-07-23 10:11:24 +00:00
let self = this ;
2026-07-20 16:05:17 +00:00
const callback = arg0 ;
2026-07-23 10:11:24 +00:00
self = this ;
2026-07-20 16:05:17 +00:00
if ( arguments . length > 1 ) {
if ( undefined !== arguments [ 1 ] ) {
let obj = arguments [ 1 ] ;
}
self . emit ( "beforeSendEvent" , arg0 , obj ) ;
2026-07-23 10:11:24 +00:00
const obj2 = callback ( 839 ) ;
2026-07-20 16:05:17 +00:00
let eventEnvelope = obj2 . createEventEnvelope ( arg0 , self . _dsn , self . _options . _metadata , self . _options . tunnel ) ;
const tmp7 = obj . attachments || [ ] ;
const tmp9 = tmp7 [ Symbol . iterator ] ( ) ;
while ( tmp9 !== undefined ) {
let tmp12 = callback ;
2026-07-23 10:11:24 +00:00
let tmp13 = dependencyMap ;
let obj3 = callback ( 840 ) ;
2026-07-20 16:05:17 +00:00
let tmp14 = eventEnvelope ;
2026-07-23 10:11:24 +00:00
let obj4 = callback ( 840 ) ;
2026-07-20 16:05:17 +00:00
eventEnvelope = obj3 . addItemToEnvelope ( eventEnvelope , obj4 . createAttachmentEnvelopeItem ( tmp10 ) ) ;
2026-07-23 10:11:24 +00:00
continue ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
self . sendEnvelope ( eventEnvelope ) . then ( ( arg0 ) => self . emit ( "afterSendEvent" , closure _0 , arg0 ) ) ;
2026-07-20 16:05:17 +00:00
}
obj = { } ;
}
} ;
items [ 16 ] = {
key : "sendSession" ,
value : function sendSession ( attrs ) {
let environment ;
let release ;
const self = this ;
( { release , environment } = this . _options ) ;
if ( undefined === environment ) {
2026-07-23 10:11:24 +00:00
environment = callback ( 834 ) . DEFAULT _ENVIRONMENT ;
2026-07-20 16:05:17 +00:00
}
if ( "aggregates" in attrs ) {
const tmp8 = attrs . attrs || { } ;
if ( ! tmp8 . release ) {
if ( ! release ) {
2026-07-23 10:11:24 +00:00
if ( callback ( 800 ) . DEBUG _BUILD ) {
const debug2 = callback ( 801 ) . debug ;
2026-07-20 16:05:17 +00:00
debug2 . warn ( "Discarded session because of missing or non-string release" ) ;
}
}
}
tmp8 . release = tmp8 . release || release ;
tmp8 . environment = tmp8 . environment || environment ;
attrs . attrs = tmp8 ;
} else {
if ( ! attrs . release ) {
if ( ! release ) {
2026-07-23 10:11:24 +00:00
if ( callback ( 800 ) . DEBUG _BUILD ) {
const debug = callback ( 801 ) . debug ;
2026-07-20 16:05:17 +00:00
debug . warn ( "Discarded session because of missing or non-string release" ) ;
}
}
}
attrs . release = attrs . release || release ;
attrs . environment = attrs . environment || environment ;
}
self . emit ( "beforeSendSession" , attrs ) ;
2026-07-23 10:11:24 +00:00
self . sendEnvelope ( callback ( 839 ) . createSessionEnvelope ( attrs , self . _dsn , self . _options . _metadata , self . _options . tunnel ) ) ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 17 ] = {
key : "recordDroppedEvent" ,
value : function recordDroppedEvent ( arg0 , arg1 ) {
const self = this ;
let num = 1 ;
if ( arguments . length > 2 ) {
num = 1 ;
if ( undefined !== arguments [ 2 ] ) {
num = arguments [ 2 ] ;
}
}
if ( self . _options . sendClientReports ) {
const _HermesInternal = HermesInternal ;
const combined = "" + arg0 + ":" + arg1 ;
2026-07-23 10:11:24 +00:00
if ( callback ( 800 ) . DEBUG _BUILD ) {
const debug = callback ( 801 ) . debug ;
2026-07-20 16:05:17 +00:00
let str3 = "" ;
if ( num > 1 ) {
const _HermesInternal2 = HermesInternal ;
str3 = " (" + num + " times)" ;
}
const _HermesInternal3 = HermesInternal ;
debug . log ( "Recording outcome: \"" + combined + "\"" + str3 ) ;
}
let num4 = self . _outcomes [ combined ] ;
if ( ! num4 ) {
num4 = 0 ;
}
self . _outcomes [ combined ] = num4 + num ;
}
}
} ;
items [ 18 ] = {
key : "on" ,
value : function on ( arg0 , arg1 ) {
let closure _0 = arg1 ;
let set = this . _hooks [ arg0 ] ;
if ( ! set ) {
const _Set = Set ;
set = new Set ( ) ;
}
this . _hooks [ arg0 ] = set ;
function uniqueCallback ( ) {
2026-07-23 10:11:24 +00:00
return callback ( ... arguments ) ;
2026-07-20 16:05:17 +00:00
}
set . add ( uniqueCallback ) ;
return ( ) => {
set . delete ( uniqueCallback ) ;
} ;
}
} ;
items [ 19 ] = {
key : "emit" ,
value : function emit ( arg0 ) {
const length = arguments . length ;
let num = 0 ;
if ( length > 1 ) {
num = length - 1 ;
}
const array = new Array ( num ) ;
for ( let num2 = 1 ; num2 < length ; num2 = num2 + 1 ) {
array [ num2 - 1 ] = arguments [ num2 ] ;
}
2026-07-23 10:11:24 +00:00
if ( this . _hooks [ arg0 ] ) {
2026-07-20 16:05:17 +00:00
const item = arr . forEach ( ( apply ) => apply . apply ( undefined , array ) ) ;
}
}
} ;
const obj18 = { key : "sendEnvelope" } ;
2026-07-23 10:11:24 +00:00
let closure _1 = asyncGeneratorStep ( async function ( arg0 ) {
2026-07-20 16:05:17 +00:00
const self = this ;
self . emit ( "beforeEnvelope" , arg0 ) ;
if ( self . _isEnabled ( ) ) {
if ( self . _transport ) {
const _transport = self . _transport ;
return yield _transport . send ( arg0 ) ;
}
}
2026-07-23 10:11:24 +00:00
if ( callback ( 800 ) . DEBUG _BUILD ) {
const debug = callback ( 801 ) . debug ;
2026-07-20 16:05:17 +00:00
debug . error ( "Transport disabled" ) ;
}
return { } ;
} ) ;
obj18 . value = function sendEnvelope ( arg0 ) {
2026-07-23 10:11:24 +00:00
return dependencyMap ( ... arguments ) ;
2026-07-20 16:05:17 +00:00
} ;
items [ 20 ] = obj18 ;
items [ 21 ] = {
key : "_setupIntegrations" ,
value : function _setupIntegrations ( ) {
const integrations = this . _options . integrations ;
2026-07-23 10:11:24 +00:00
this . _integrations = callback ( 863 ) . setupIntegrations ( this , integrations ) ;
const obj = callback ( 863 ) ;
const result = callback ( 863 ) . afterSetupIntegrations ( this , integrations ) ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 22 ] = {
key : "_updateSessionFromEvent" ,
value : function _updateSessionFromEvent ( status , level ) {
const self = this ;
let flag = "fatal" === level . level ;
const exception = level . exception ;
let values ;
if ( null != exception ) {
values = exception . values ;
}
let flag2 = false ;
if ( values ) {
flag = false ;
const iter = values [ Symbol . iterator ] ( ) ;
flag2 = true ;
while ( iter !== undefined ) {
let mechanism = iter . next ( ) . mechanism ;
let handled ;
if ( null != mechanism ) {
let tmp6 = mechanism ;
handled = tmp4 . handled ;
}
if ( false === handled ) {
flag = true ;
iter . return ( ) ;
flag2 = true ;
2026-07-23 10:11:24 +00:00
break ;
2026-07-20 16:05:17 +00:00
}
break ;
}
}
let tmp7 = "ok" === status . status ;
let tmp8 = tmp7 ;
if ( tmp7 ) {
tmp8 = 0 === status . errors ;
}
if ( ! tmp8 ) {
if ( tmp7 ) {
tmp7 = flag ;
}
tmp8 = tmp7 ;
}
if ( tmp8 ) {
2026-07-23 10:11:24 +00:00
let obj = callback ( 822 ) ;
2026-07-20 16:05:17 +00:00
let tmp12 = flag ;
if ( flag ) {
obj = { status : "crashed" } ;
tmp12 = obj ;
}
obj = { } ;
let errors = status . errors ;
if ( ! errors ) {
if ( ! flag2 ) {
flag2 = flag ;
}
errors = Number ( flag2 ) ;
}
obj . errors = errors ;
obj . updateSession ( status , Object . assign ( { } , tmp12 , obj ) ) ;
self . captureSession ( status ) ;
}
}
} ;
const obj21 = { key : "_isClientDoneProcessing" } ;
2026-07-23 10:11:24 +00:00
let closure _0 = asyncGeneratorStep ( async ( arg0 ) => {
2026-07-20 16:05:17 +00:00
let num = 0 ;
if ( ! arg0 ) {
yield new Promise ( ( arg0 ) => setTimeout ( arg0 , 1 ) ) ;
while ( true ) {
if ( ! tmp . _numProcessing ) {
break ;
} else {
let sum = num + 1 ;
num = sum ;
if ( ! arg0 ) {
continue ;
} else {
num = sum ;
}
continue ;
}
}
} else {
num = 0 ;
}
return false ;
} ) ;
obj21 . value = function _isClientDoneProcessing ( arg0 ) {
return callback ( ... arguments ) ;
} ;
items [ 23 ] = obj21 ;
items [ 24 ] = {
key : "_isEnabled" ,
value : function _isEnabled ( ) {
let tmp = false !== this . getOptions ( ) . enabled ;
if ( tmp ) {
tmp = undefined !== this . _transport ;
}
return tmp ;
}
} ;
items [ 25 ] = {
key : "_prepareEvent" ,
value : function _prepareEvent ( type , integrations , arg2 , setLastEventId ) {
2026-07-23 10:11:24 +00:00
let self = this ;
2026-07-20 16:05:17 +00:00
const callback = integrations ;
2026-07-23 10:11:24 +00:00
const dependencyMap = arg2 ;
self = this ;
2026-07-20 16:05:17 +00:00
const options = this . getOptions ( ) ;
const keys = Object . keys ( this . _integrations ) ;
let length = ! integrations . integrations ;
if ( length ) {
length = null != keys ;
}
if ( length ) {
length = keys . length ;
}
if ( length ) {
integrations . integrations = keys ;
}
self . emit ( "preprocessEvent" , type , integrations ) ;
if ( ! type . type ) {
let event _id = type . event _id ;
if ( ! event _id ) {
event _id = integrations . event _id ;
}
setLastEventId . setLastEventId ( event _id ) ;
}
2026-07-23 10:11:24 +00:00
let obj = callback ( 846 ) ;
return callback ( 846 ) . prepareEvent ( options , type , integrations , arg2 , self , setLastEventId ) . then ( ( contexts ) => {
2026-07-20 16:05:17 +00:00
if ( null === contexts ) {
return contexts ;
} else {
2026-07-23 10:11:24 +00:00
self . emit ( "postprocessEvent" , contexts , integrations ) ;
2026-07-20 16:05:17 +00:00
const _Object = Object ;
2026-07-23 10:11:24 +00:00
let obj = { trace : integrations ( 825 ) . getTraceContextFromScope ( dependencyMap ) } ;
2026-07-20 16:05:17 +00:00
contexts . contexts = Object . assign ( obj , contexts . contexts ) ;
2026-07-23 10:11:24 +00:00
const obj2 = integrations ( 825 ) ;
2026-07-20 16:05:17 +00:00
const _Object2 = Object ;
2026-07-23 10:11:24 +00:00
obj = { dynamicSamplingContext : integrations ( 833 ) . getDynamicSamplingContextFromScope ( self , dependencyMap ) } ;
2026-07-20 16:05:17 +00:00
contexts . sdkProcessingMetadata = Object . assign ( obj , contexts . sdkProcessingMetadata ) ;
return contexts ;
}
} ) ;
}
} ;
items [ 26 ] = {
key : "_captureEvent" ,
value : function _captureEvent ( message ) {
const self = this ;
if ( arguments . length > 1 ) {
if ( undefined !== arguments [ 1 ] ) {
let obj = arguments [ 1 ] ;
}
if ( arguments . length > 2 ) {
if ( undefined !== arguments [ 2 ] ) {
let currentScope = arguments [ 2 ] ;
}
if ( arguments . length > 3 ) {
if ( undefined !== arguments [ 3 ] ) {
let isolationScope = arguments [ 3 ] ;
}
2026-07-23 10:11:24 +00:00
let DEBUG _BUILD = callback ( 800 ) . DEBUG _BUILD ;
2026-07-20 16:05:17 +00:00
if ( DEBUG _BUILD ) {
2026-07-23 10:11:24 +00:00
DEBUG _BUILD = outer1 _15 ( message ) ;
2026-07-20 16:05:17 +00:00
}
if ( DEBUG _BUILD ) {
2026-07-23 10:11:24 +00:00
let debug = callback ( 801 ) . debug ;
const obj4 = callback ( 864 ) ;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal ;
2026-07-23 10:11:24 +00:00
debug . log ( "Captured error event `" + callback ( 864 ) . getPossibleEventMessages ( message ) [ 0 ] || "<unknown>" + "`" ) ;
const tmp12 = callback ( 864 ) . getPossibleEventMessages ( message ) [ 0 ] || "<unknown>" ;
2026-07-20 16:05:17 +00:00
}
return self . _processEvent ( message , obj , currentScope , isolationScope ) . then ( ( event _id ) => event _id . event _id , ( message ) => {
2026-07-23 10:11:24 +00:00
if ( callback ( 800 ) . DEBUG _BUILD ) {
if ( outer2 _12 ( message ) ) {
const debug2 = callback ( 801 ) . debug ;
2026-07-20 16:05:17 +00:00
debug2 . log ( message . message ) ;
} else {
2026-07-23 10:11:24 +00:00
const debug = callback ( 801 ) . debug ;
2026-07-20 16:05:17 +00:00
const warn = debug . warn ;
if ( tmp3 ) {
warn ( message . message ) ;
} else {
warn ( message ) ;
}
2026-07-23 10:11:24 +00:00
tmp3 = outer2 _11 ( message ) ;
2026-07-20 16:05:17 +00:00
}
}
} ) ;
}
2026-07-23 10:11:24 +00:00
isolationScope = callback ( 825 ) . getIsolationScope ( ) ;
const obj3 = callback ( 825 ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
currentScope = callback ( 825 ) . getCurrentScope ( ) ;
const obj2 = callback ( 825 ) ;
2026-07-20 16:05:17 +00:00
}
obj = { } ;
}
} ;
items [ 27 ] = {
key : "_processEvent" ,
value : function _processEvent ( type ) {
2026-07-23 10:11:24 +00:00
let self = this ;
let callback = type ;
const dependencyMap = arg1 ;
2026-07-20 16:05:17 +00:00
let closure _2 = arg2 ;
let closure _3 = arg3 ;
2026-07-23 10:11:24 +00:00
self = this ;
2026-07-20 16:05:17 +00:00
const options = this . getOptions ( ) ;
const sampleRate = options . sampleRate ;
2026-07-23 10:11:24 +00:00
let closure _6 = outer1 _16 ( type ) ;
const tmp2 = outer1 _15 ( type ) ;
let closure _7 = tmp2 ;
2026-07-20 16:05:17 +00:00
let closure _8 = "before send for type `" + type . type || "error" + "`" ;
if ( undefined !== sampleRate ) {
2026-07-23 10:11:24 +00:00
const parseSampleRateResult = callback ( 813 ) . parseSampleRate ( sampleRate ) ;
let obj = callback ( 813 ) ;
2026-07-20 16:05:17 +00:00
}
if ( tmp2 ) {
if ( "number" === typeof parseSampleRateResult ) {
if ( obj2 . safeMathRandom ( ) > parseSampleRateResult ) {
self . recordDroppedEvent ( "sample_rate" , "error" ) ;
2026-07-23 10:11:24 +00:00
let _HermesInternal = HermesInternal ;
return callback ( 849 ) . rejectedSyncPromise ( outer1 _10 ( "Discarding event because it's not included in the random sample (sampling rate = " + sampleRate + ")" ) ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
obj2 = callback ( 808 ) ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
let closure _9 = outer1 _14 ( type . type ) ;
2026-07-20 16:05:17 +00:00
const _prepareEventResult = self . _prepareEvent ( type , arg1 , arg2 , arg3 ) ;
2026-07-23 10:11:24 +00:00
let tmp3 = type . type || "error" ;
2026-07-20 16:05:17 +00:00
const nextPromise = self . _prepareEvent ( type , arg1 , arg2 , arg3 ) . then ( ( sdkProcessingMetadata ) => {
let beforeSend ;
let beforeSendSpan ;
let beforeSendTransaction ;
let ignoreSpans ;
if ( null === sdkProcessingMetadata ) {
self . recordDroppedEvent ( "event_processor" , closure _9 ) ;
2026-07-23 10:11:24 +00:00
throw outer2 _10 ( "An event processor returned `null`, will not send event." ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
if ( closure _1 . data ) {
if ( true === closure _1 . data . _ _sentry _ _ ) {
2026-07-20 16:05:17 +00:00
return sdkProcessingMetadata ;
}
}
let obj = self ;
( { beforeSend , beforeSendTransaction , beforeSendSpan , ignoreSpans } = options ) ;
2026-07-23 10:11:24 +00:00
if ( outer2 _15 ( sdkProcessingMetadata ) ) {
2026-07-20 16:05:17 +00:00
if ( beforeSend ) {
let beforeSendResult = beforeSend ( sdkProcessingMetadata , tmp3 ) ;
}
2026-07-23 10:11:24 +00:00
return ( function _validateBeforeSendResult ( beforeSendResult , closure _8 ) {
const callback = closure _8 ;
2026-07-20 16:05:17 +00:00
const combined = "" + closure _8 + " must return `null` or a valid event." ;
if ( obj . isThenable ( beforeSendResult ) ) {
return beforeSendResult . then ( ( arg0 ) => {
if ( ! obj . isPlainObject ( arg0 ) ) {
if ( null !== arg0 ) {
2026-07-23 10:11:24 +00:00
throw outer4 _9 ( combined ) ;
2026-07-20 16:05:17 +00:00
}
}
return arg0 ;
2026-07-23 10:11:24 +00:00
} , ( rejected ) => {
throw outer4 _9 ( "" + closure _0 + " rejected with " + rejected ) ;
2026-07-20 16:05:17 +00:00
} ) ;
} else {
if ( ! obj2 . isPlainObject ( beforeSendResult ) ) {
if ( null !== beforeSendResult ) {
2026-07-23 10:11:24 +00:00
throw outer3 _9 ( combined ) ;
2026-07-20 16:05:17 +00:00
}
}
return beforeSendResult ;
}
2026-07-23 10:11:24 +00:00
obj = callback ( 804 ) ;
} ) ( beforeSendResult , closure _8 ) ;
2026-07-20 16:05:17 +00:00
}
let tmp6 = sdkProcessingMetadata ;
2026-07-23 10:11:24 +00:00
if ( outer2 _16 ( sdkProcessingMetadata ) ) {
2026-07-20 16:05:17 +00:00
if ( beforeSendSpan ) {
2026-07-23 10:11:24 +00:00
const result = type ( closure _1 [ 28 ] ) . convertTransactionEventToSpanJson ( sdkProcessingMetadata ) ;
2026-07-20 16:05:17 +00:00
if ( null != ignoreSpans ) {
if ( ignoreSpans . length ) {
beforeSendResult = null ;
2026-07-23 10:11:24 +00:00
const obj3 = type ( closure _1 [ 29 ] ) ;
2026-07-20 16:05:17 +00:00
}
}
let mergeResult = sdkProcessingMetadata ;
if ( beforeSendSpan ) {
const beforeSendSpanResult = beforeSendSpan ( result ) ;
if ( beforeSendSpanResult ) {
let tmp23Result = tmp23 ( tmp24 [ 31 ] ) ;
tmp23Result = tmp23 ( tmp24 [ 28 ] ) ;
mergeResult = tmp23Result . merge ( sdkProcessingMetadata , tmp23Result . convertSpanJsonToTransactionEvent ( beforeSendSpanResult ) ) ;
} else {
tmp23 ( tmp24 [ 30 ] ) . showSpanDropWarning ( ) ;
mergeResult = sdkProcessingMetadata ;
const tmp23Result1 = tmp23 ( tmp24 [ 30 ] ) ;
}
}
let tmp9 = mergeResult ;
if ( mergeResult . spans ) {
const items = [ ] ;
const spans = mergeResult . spans ;
const iter = spans [ Symbol . iterator ] ( ) ;
const nextResult = iter . next ( ) ;
while ( iter !== undefined ) {
let tmp67 = nextResult ;
let tmp68 = ignoreSpans ;
if ( null != ignoreSpans ) {
let tmp30 = ignoreSpans ;
if ( ignoreSpans . length ) {
2026-07-23 10:11:24 +00:00
let tmp31 = type ;
let tmp32 = closure _1 ;
let obj7 = type ( closure _1 [ 29 ] ) ;
2026-07-20 16:05:17 +00:00
let tmp33 = nextResult ;
let tmp34 = ignoreSpans ;
if ( obj7 . shouldIgnoreSpan ( tmp67 , ignoreSpans ) ) {
2026-07-23 10:11:24 +00:00
let tmp52 = type ;
let tmp53 = closure _1 ;
let obj9 = type ( closure _1 [ 29 ] ) ;
2026-07-20 16:05:17 +00:00
let tmp54 = spans ;
let tmp55 = nextResult ;
let reparentChildSpansResult = obj9 . reparentChildSpans ( tmp26 , tmp67 ) ;
2026-07-23 10:11:24 +00:00
continue ;
2026-07-20 16:05:17 +00:00
}
}
}
let tmp35 = beforeSendSpan ;
if ( beforeSendSpan ) {
let tmp39 = beforeSendSpan ;
let tmp40 = nextResult ;
let beforeSendSpanResult1 = beforeSendSpan ( tmp67 ) ;
if ( beforeSendSpanResult1 ) {
let tmp49 = items ;
let tmp50 = beforeSendSpanResult1 ;
let arr = items . push ( tmp42 ) ;
} else {
2026-07-23 10:11:24 +00:00
let tmp43 = type ;
let tmp44 = closure _1 ;
let obj8 = type ( closure _1 [ 30 ] ) ;
2026-07-20 16:05:17 +00:00
let showSpanDropWarningResult1 = obj8 . showSpanDropWarning ( ) ;
let tmp46 = items ;
let tmp47 = nextResult ;
arr = items . push ( tmp67 ) ;
}
} else {
let tmp36 = items ;
let tmp37 = nextResult ;
let arr1 = items . push ( tmp67 ) ;
}
}
const diff = mergeResult . spans . length - items . length ;
if ( diff ) {
obj . recordDroppedEvent ( "before_send" , "span" , diff ) ;
}
mergeResult . spans = items ;
tmp9 = mergeResult ;
2026-07-23 10:11:24 +00:00
tmp26 = spans ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const obj2 = type ( closure _1 [ 28 ] ) ;
2026-07-20 16:05:17 +00:00
} else {
tmp9 = sdkProcessingMetadata ;
}
tmp6 = tmp9 ;
if ( beforeSendTransaction ) {
if ( tmp9 . spans ) {
const _Object = Object ;
obj = { spanCountBeforeProcessing : tmp9 . spans . length } ;
tmp9 . sdkProcessingMetadata = Object . assign ( { } , sdkProcessingMetadata . sdkProcessingMetadata , obj ) ;
}
beforeSendResult = beforeSendTransaction ( tmp9 , tmp3 ) ;
}
}
beforeSendResult = tmp6 ;
}
} ) ;
return self . _prepareEvent ( type , arg1 , arg2 , arg3 ) . then ( ( sdkProcessingMetadata ) => {
let beforeSend ;
let beforeSendSpan ;
let beforeSendTransaction ;
let ignoreSpans ;
if ( null === sdkProcessingMetadata ) {
self . recordDroppedEvent ( "event_processor" , closure _9 ) ;
2026-07-23 10:11:24 +00:00
throw outer2 _10 ( "An event processor returned `null`, will not send event." ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
if ( closure _1 . data ) {
if ( true === closure _1 . data . _ _sentry _ _ ) {
2026-07-20 16:05:17 +00:00
return sdkProcessingMetadata ;
}
}
let obj = self ;
( { beforeSend , beforeSendTransaction , beforeSendSpan , ignoreSpans } = options ) ;
2026-07-23 10:11:24 +00:00
if ( outer2 _15 ( sdkProcessingMetadata ) ) {
2026-07-20 16:05:17 +00:00
if ( beforeSend ) {
let beforeSendResult = beforeSend ( sdkProcessingMetadata , tmp3 ) ;
}
2026-07-23 10:11:24 +00:00
return ( function _validateBeforeSendResult ( beforeSendResult , closure _8 ) {
const callback = closure _8 ;
2026-07-20 16:05:17 +00:00
const combined = "" + closure _8 + " must return `null` or a valid event." ;
if ( obj . isThenable ( beforeSendResult ) ) {
return beforeSendResult . then ( ( arg0 ) => {
if ( ! obj . isPlainObject ( arg0 ) ) {
if ( null !== arg0 ) {
2026-07-23 10:11:24 +00:00
throw outer4 _9 ( combined ) ;
2026-07-20 16:05:17 +00:00
}
}
return arg0 ;
2026-07-23 10:11:24 +00:00
} , ( rejected ) => {
throw outer4 _9 ( "" + closure _0 + " rejected with " + rejected ) ;
2026-07-20 16:05:17 +00:00
} ) ;
} else {
if ( ! obj2 . isPlainObject ( beforeSendResult ) ) {
if ( null !== beforeSendResult ) {
2026-07-23 10:11:24 +00:00
throw outer3 _9 ( combined ) ;
2026-07-20 16:05:17 +00:00
}
}
return beforeSendResult ;
}
2026-07-23 10:11:24 +00:00
obj = callback ( 804 ) ;
} ) ( beforeSendResult , closure _8 ) ;
2026-07-20 16:05:17 +00:00
}
let tmp6 = sdkProcessingMetadata ;
2026-07-23 10:11:24 +00:00
if ( outer2 _16 ( sdkProcessingMetadata ) ) {
2026-07-20 16:05:17 +00:00
if ( beforeSendSpan ) {
2026-07-23 10:11:24 +00:00
const result = type ( closure _1 [ 28 ] ) . convertTransactionEventToSpanJson ( sdkProcessingMetadata ) ;
2026-07-20 16:05:17 +00:00
if ( null != ignoreSpans ) {
if ( ignoreSpans . length ) {
beforeSendResult = null ;
2026-07-23 10:11:24 +00:00
const obj3 = type ( closure _1 [ 29 ] ) ;
2026-07-20 16:05:17 +00:00
}
}
let mergeResult = sdkProcessingMetadata ;
if ( beforeSendSpan ) {
const beforeSendSpanResult = beforeSendSpan ( result ) ;
if ( beforeSendSpanResult ) {
let tmp23Result = tmp23 ( tmp24 [ 31 ] ) ;
tmp23Result = tmp23 ( tmp24 [ 28 ] ) ;
mergeResult = tmp23Result . merge ( sdkProcessingMetadata , tmp23Result . convertSpanJsonToTransactionEvent ( beforeSendSpanResult ) ) ;
} else {
tmp23 ( tmp24 [ 30 ] ) . showSpanDropWarning ( ) ;
mergeResult = sdkProcessingMetadata ;
const tmp23Result1 = tmp23 ( tmp24 [ 30 ] ) ;
}
}
let tmp9 = mergeResult ;
if ( mergeResult . spans ) {
const items = [ ] ;
const spans = mergeResult . spans ;
const iter = spans [ Symbol . iterator ] ( ) ;
const nextResult = iter . next ( ) ;
while ( iter !== undefined ) {
let tmp67 = nextResult ;
let tmp68 = ignoreSpans ;
if ( null != ignoreSpans ) {
let tmp30 = ignoreSpans ;
if ( ignoreSpans . length ) {
2026-07-23 10:11:24 +00:00
let tmp31 = type ;
let tmp32 = closure _1 ;
let obj7 = type ( closure _1 [ 29 ] ) ;
2026-07-20 16:05:17 +00:00
let tmp33 = nextResult ;
let tmp34 = ignoreSpans ;
if ( obj7 . shouldIgnoreSpan ( tmp67 , ignoreSpans ) ) {
2026-07-23 10:11:24 +00:00
let tmp52 = type ;
let tmp53 = closure _1 ;
let obj9 = type ( closure _1 [ 29 ] ) ;
2026-07-20 16:05:17 +00:00
let tmp54 = spans ;
let tmp55 = nextResult ;
let reparentChildSpansResult = obj9 . reparentChildSpans ( tmp26 , tmp67 ) ;
2026-07-23 10:11:24 +00:00
continue ;
2026-07-20 16:05:17 +00:00
}
}
}
let tmp35 = beforeSendSpan ;
if ( beforeSendSpan ) {
let tmp39 = beforeSendSpan ;
let tmp40 = nextResult ;
let beforeSendSpanResult1 = beforeSendSpan ( tmp67 ) ;
if ( beforeSendSpanResult1 ) {
let tmp49 = items ;
let tmp50 = beforeSendSpanResult1 ;
let arr = items . push ( tmp42 ) ;
} else {
2026-07-23 10:11:24 +00:00
let tmp43 = type ;
let tmp44 = closure _1 ;
let obj8 = type ( closure _1 [ 30 ] ) ;
2026-07-20 16:05:17 +00:00
let showSpanDropWarningResult1 = obj8 . showSpanDropWarning ( ) ;
let tmp46 = items ;
let tmp47 = nextResult ;
arr = items . push ( tmp67 ) ;
}
} else {
let tmp36 = items ;
let tmp37 = nextResult ;
let arr1 = items . push ( tmp67 ) ;
}
}
const diff = mergeResult . spans . length - items . length ;
if ( diff ) {
obj . recordDroppedEvent ( "before_send" , "span" , diff ) ;
}
mergeResult . spans = items ;
tmp9 = mergeResult ;
2026-07-23 10:11:24 +00:00
tmp26 = spans ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const obj2 = type ( closure _1 [ 28 ] ) ;
2026-07-20 16:05:17 +00:00
} else {
tmp9 = sdkProcessingMetadata ;
}
tmp6 = tmp9 ;
if ( beforeSendTransaction ) {
if ( tmp9 . spans ) {
const _Object = Object ;
obj = { spanCountBeforeProcessing : tmp9 . spans . length } ;
tmp9 . sdkProcessingMetadata = Object . assign ( { } , sdkProcessingMetadata . sdkProcessingMetadata , obj ) ;
}
beforeSendResult = beforeSendTransaction ( tmp9 , tmp3 ) ;
}
}
beforeSendResult = tmp6 ;
}
} ) . then ( ( sdkProcessingMetadata ) => {
if ( null === sdkProcessingMetadata ) {
self . recordDroppedEvent ( "before_send" , closure _9 ) ;
if ( closure _6 ) {
2026-07-23 10:11:24 +00:00
self . recordDroppedEvent ( "before_send" , "span" , 1 + type . spans || [ ] . length ) ;
const arr = type . spans || [ ] ;
2026-07-20 16:05:17 +00:00
}
const _HermesInternal = HermesInternal ;
2026-07-23 10:11:24 +00:00
throw outer2 _10 ( "" + closure _8 + " returned `null`, will not send event." ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
session = session . getSession ( ) ;
2026-07-20 16:05:17 +00:00
if ( ! session ) {
2026-07-23 10:11:24 +00:00
session = session2 . getSession ( ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let tmp3 = closure _7 ;
if ( closure _7 ) {
2026-07-20 16:05:17 +00:00
tmp3 = session ;
}
if ( tmp3 ) {
const result = self . _updateSessionFromEvent ( session , sdkProcessingMetadata ) ;
}
if ( closure _6 ) {
sdkProcessingMetadata = sdkProcessingMetadata . sdkProcessingMetadata ;
let num ;
if ( null != sdkProcessingMetadata ) {
num = sdkProcessingMetadata . spanCountBeforeProcessing ;
}
if ( ! num ) {
num = 0 ;
}
let num3 = 0 ;
if ( sdkProcessingMetadata . spans ) {
num3 = sdkProcessingMetadata . spans . length ;
}
const diff = num - num3 ;
if ( diff > 0 ) {
self . recordDroppedEvent ( "before_send" , "span" , diff ) ;
}
}
const transaction _info = sdkProcessingMetadata . transaction _info ;
if ( closure _6 ) {
if ( transaction _info ) {
2026-07-23 10:11:24 +00:00
if ( sdkProcessingMetadata . transaction !== type . transaction ) {
2026-07-20 16:05:17 +00:00
const _Object = Object ;
const obj = { source : "custom" } ;
sdkProcessingMetadata . transaction _info = Object . assign ( { } , transaction _info , obj ) ;
}
}
}
2026-07-23 10:11:24 +00:00
self . sendEvent ( sdkProcessingMetadata , closure _1 ) ;
2026-07-20 16:05:17 +00:00
return sdkProcessingMetadata ;
}
} ) . then ( null , ( originalException ) => {
2026-07-23 10:11:24 +00:00
if ( ! outer2 _12 ( originalException ) ) {
if ( ! outer2 _11 ( originalException ) ) {
let obj = { mechanism : { handled : false , type : "internal" } } ;
2026-07-20 16:05:17 +00:00
obj = { _ _sentry _ _ : true } ;
obj . data = obj ;
obj . originalException = originalException ;
self . captureException ( originalException , obj ) ;
const _HermesInternal = HermesInternal ;
2026-07-23 10:11:24 +00:00
throw outer2 _9 ( "Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: " + originalException ) ;
2026-07-20 16:05:17 +00:00
}
}
throw originalException ;
} ) ;
}
} ;
items [ 28 ] = {
key : "_process" ,
value : function _process ( arg0 , arg1 ) {
let closure _0 = arg1 ;
2026-07-23 10:11:24 +00:00
const self = this ;
2026-07-20 16:05:17 +00:00
this . _numProcessing = this . _numProcessing + 1 ;
const _promiseBuffer = this . _promiseBuffer ;
_promiseBuffer . add ( arg0 ) . then ( ( arg0 ) => {
self . _numProcessing = self . _numProcessing - 1 ;
return arg0 ;
} , ( arg0 ) => {
self . _numProcessing = self . _numProcessing - 1 ;
2026-07-23 10:11:24 +00:00
if ( arg0 === callback ( _self [ 5 ] ) . SENTRY _BUFFER _FULL _ERROR ) {
self . recordDroppedEvent ( "queue_overflow" , callback ) ;
2026-07-20 16:05:17 +00:00
}
return arg0 ;
} ) ;
}
} ;
items [ 29 ] = {
key : "_clearOutcomes" ,
value : function _clearOutcomes ( ) {
this . _outcomes = { } ;
const entries = Object . entries ( this . _outcomes ) ;
return entries . map ( ( arg0 ) => {
const tmp = callback ( arg0 , 2 ) ;
const tmp2 = callback ( tmp [ 0 ] . split ( ":" ) , 2 ) ;
return { reason : tmp2 [ 0 ] , category : tmp2 [ 1 ] , quantity : tmp [ 1 ] } ;
} ) ;
}
} ;
items [ 30 ] = {
key : "_flushOutcomes" ,
value : function _flushOutcomes ( ) {
const self = this ;
2026-07-23 10:11:24 +00:00
if ( callback ( 800 ) . DEBUG _BUILD ) {
const debug = callback ( 801 ) . debug ;
2026-07-20 16:05:17 +00:00
debug . log ( "Flushing outcomes..." ) ;
}
const _clearOutcomesResult = self . _clearOutcomes ( ) ;
if ( 0 !== _clearOutcomesResult . length ) {
2026-07-23 10:11:24 +00:00
const DEBUG _BUILD = callback ( 800 ) . DEBUG _BUILD ;
2026-07-20 16:05:17 +00:00
if ( self . _dsn ) {
if ( DEBUG _BUILD ) {
2026-07-23 10:11:24 +00:00
const debug4 = callback ( 801 ) . debug ;
2026-07-20 16:05:17 +00:00
debug4 . log ( "Sending outcomes:" , _clearOutcomesResult ) ;
}
let tunnel = self . _options . tunnel ;
if ( tunnel ) {
2026-07-23 10:11:24 +00:00
tunnel = callback ( 814 ) . dsnToString ( self . _dsn ) ;
const obj2 = callback ( 814 ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
self . sendEnvelope ( callback ( 865 ) . createClientReportEnvelope ( _clearOutcomesResult , tunnel ) ) ;
const obj = callback ( 865 ) ;
2026-07-20 16:05:17 +00:00
} else if ( DEBUG _BUILD ) {
2026-07-23 10:11:24 +00:00
const debug3 = callback ( 801 ) . debug ;
2026-07-20 16:05:17 +00:00
debug3 . log ( "No dsn provided, will not send outcomes" ) ;
}
2026-07-23 10:11:24 +00:00
} else if ( callback ( 800 ) . DEBUG _BUILD ) {
const debug2 = callback ( 801 ) . debug ;
2026-07-20 16:05:17 +00:00
debug2 . log ( "No outcomes to send" ) ;
}
}
} ;
2026-07-23 10:11:24 +00:00
return _defineProperties ( Client , items ) ;
} ) ( ) ;