2026-07-20 16:05:17 +00:00
// Module ID: 1128
2026-07-25 08:10:48 +00:00
// Function ID: 12863
2026-07-20 16:05:17 +00:00
// Name: _captureAppStart
2026-07-23 10:11:24 +00:00
// Dependencies: [65, 794, 977, 1129, 1098, 1131, 1132, 1133, 1134, 1135, 1136]
2026-07-20 16:05:17 +00:00
// Exports: _clearRootComponentCreationTimestampMs, _setRootComponentCreationTimestampMs, appStartIntegration, captureAppStart
// Module 1128 (_captureAppStart)
2026-07-23 10:11:24 +00:00
import _toConsumableArray from "_toConsumableArray" ;
const require = arg1 ;
2026-07-20 16:05:17 +00:00
function _captureAppStart ( isManual ) {
2026-07-23 10:11:24 +00:00
isManual = isManual . isManual ;
2026-07-20 16:05:17 +00:00
return fn ( this , undefined , undefined , function * ( ) {
2026-07-23 10:11:24 +00:00
let obj = outer2 _0 ( isManual [ 1 ] ) ;
2026-07-20 16:05:17 +00:00
const client = obj . getClient ( ) ;
if ( client ) {
2026-07-23 10:11:24 +00:00
const outer2 _6 = outer1 _1 ;
2026-07-20 16:05:17 +00:00
let tmp9 = null ;
2026-07-23 10:11:24 +00:00
const result = 1000 * outer2 _0 ( isManual [ 1 ] ) . timestampInSeconds ( ) ;
if ( outer2 _0 ( isManual [ 2 ] ) . NATIVE . enableNative ) {
const NATIVE = outer2 _0 ( isManual [ 2 ] ) . NATIVE ;
2026-07-20 16:05:17 +00:00
const tmp12 = yield NATIVE . fetchNativeFrames ( ) ;
tmp9 = tmp12 ;
2026-07-23 10:11:24 +00:00
const debug2 = outer2 _0 ( isManual [ 1 ] ) . debug ;
2026-07-20 16:05:17 +00:00
debug2 . log ( "[AppStart] Captured end frames for app start." , tmp12 ) ;
}
while ( true ) {
2026-07-23 10:11:24 +00:00
let tmp16 = outer2 _9 ;
2026-07-20 16:05:17 +00:00
obj = { timestampMs : result , endFrames : tmp9 } ;
2026-07-23 10:11:24 +00:00
let tmp17 = outer2 _9 ( obj ) ;
let tmp18 = outer2 _4 ;
let integrationByName = client . getIntegrationByName ( outer2 _4 ) ;
let outer1 _0 = integrationByName ;
2026-07-20 16:05:17 +00:00
if ( null === integrationByName ) {
break ;
} else {
2026-07-23 10:11:24 +00:00
let tmp21 = outer1 _0 ;
if ( undefined === outer1 _0 ) {
2026-07-20 16:05:17 +00:00
break ;
} else {
2026-07-23 10:11:24 +00:00
let tmp22 = outer1 _0 ;
let result1 = outer1 _0 . captureStandaloneAppStart ( ) ;
break ;
2026-07-20 16:05:17 +00:00
}
}
let tmp23 = yield result1 ;
}
2026-07-23 10:11:24 +00:00
const obj3 = outer2 _0 ( isManual [ 1 ] ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
const debug = outer2 _0 ( isManual [ 1 ] ) . debug ;
2026-07-20 16:05:17 +00:00
debug . warn ( "[AppStart] Could not capture App Start, missing client." ) ;
}
} ) ;
}
function setRootComponentCreationTimestampMs ( arg0 ) {
let timestampMs ;
2026-07-23 10:11:24 +00:00
if ( null != _undefined ) {
timestampMs = _undefined . timestampMs ;
2026-07-20 16:05:17 +00:00
}
if ( timestampMs ) {
2026-07-23 10:11:24 +00:00
const debug = require ( 794 ) /* registerSpanErrorInstrumentation */ . debug ;
2026-07-20 16:05:17 +00:00
debug . warn ( "Setting Root component creation timestamp after app start end is set." ) ;
}
if ( closure _7 ) {
2026-07-23 10:11:24 +00:00
const debug2 = require ( 794 ) /* registerSpanErrorInstrumentation */ . debug ;
2026-07-20 16:05:17 +00:00
debug2 . warn ( "Overwriting already set root component creation timestamp." ) ;
}
closure _7 = arg0 ;
2026-07-23 10:11:24 +00:00
let c8 = true ;
2026-07-20 16:05:17 +00:00
}
function setSpanDurationAsMeasurementOnTransactionEvent ( measurements , arg1 , timestamp ) {
if ( timestamp . timestamp ) {
if ( timestamp . start _timestamp ) {
measurements . measurements = measurements . measurements || { } ;
const obj = { value : 1000 * ( timestamp . timestamp - timestamp . start _timestamp ) , unit : "millisecond" } ;
measurements . measurements [ arg1 ] = obj ;
}
}
2026-07-23 10:11:24 +00:00
const debug = require ( 794 ) /* registerSpanErrorInstrumentation */ . debug ;
2026-07-20 16:05:17 +00:00
debug . warn ( "Span is missing start or end timestamp. Cam not set measurement on transaction event." ) ;
}
let fn = this ;
if ( this ) {
fn = this . _ _awaiter ;
}
if ( ! fn ) {
fn = ( arg0 , arg1 , arg2 , arg3 ) => {
let _Promise = arg2 ;
2026-07-23 10:11:24 +00:00
let closure _0 = arg0 ;
let closure _1 = arg1 ;
let closure _3 = arg3 ;
2026-07-20 16:05:17 +00:00
if ( ! arg2 ) {
_Promise = Promise ;
}
_Promise = new _Promise ( ( arg0 , arg1 ) => {
2026-07-23 10:11:24 +00:00
let closure _0 = arg0 ;
let closure _1 = arg1 ;
2026-07-20 16:05:17 +00:00
function fulfilled ( arg0 ) {
step ( iter . next ( arg0 ) ) ;
}
2026-07-23 10:11:24 +00:00
let iter = function rejected ( arg0 ) {
2026-07-20 16:05:17 +00:00
step ( iter . throw ( arg0 ) ) ;
} ;
function step ( iter ) {
if ( iter . done ) {
2026-07-23 10:11:24 +00:00
callback ( iter . value ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
( function adopt ( value ) {
2026-07-20 16:05:17 +00:00
let tmp = value ;
2026-07-23 10:11:24 +00:00
let closure _0 = value ;
if ( ! ( value instanceof fulfilled ) ) {
const prototype = fulfilled . prototype ;
tmp = new fulfilled ( ( arg0 ) => {
arg0 ( closure _0 ) ;
2026-07-20 16:05:17 +00:00
} ) ;
}
return tmp ;
2026-07-23 10:11:24 +00:00
} ) ( iter . value ) . then ( fulfilled , iter ) ;
const promise = ( function adopt ( value ) {
2026-07-20 16:05:17 +00:00
let tmp = value ;
2026-07-23 10:11:24 +00:00
let closure _0 = value ;
if ( ! ( value instanceof fulfilled ) ) {
const prototype = fulfilled . prototype ;
tmp = new fulfilled ( ( arg0 ) => {
arg0 ( closure _0 ) ;
2026-07-20 16:05:17 +00:00
} ) ;
}
return tmp ;
2026-07-23 10:11:24 +00:00
} ) ( iter . value ) ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
let items = closure _1 ;
if ( ! closure _1 ) {
2026-07-20 16:05:17 +00:00
items = [ ] ;
}
2026-07-23 10:11:24 +00:00
iter = iter . apply ( closure _0 , items ) ;
2026-07-20 16:05:17 +00:00
step ( iter . next ( ) ) ;
} ) ;
return _Promise ;
} ;
}
2026-07-23 10:11:24 +00:00
const AppStart = "AppStart" ;
let c5 ;
let c6 = false ;
let c7 ;
let c8 = false ;
2026-07-20 16:05:17 +00:00
function _setAppStartEndData ( arg0 ) {
if ( closure _5 ) {
2026-07-23 10:11:24 +00:00
const debug = require ( 794 ) /* registerSpanErrorInstrumentation */ . debug ;
2026-07-20 16:05:17 +00:00
debug . warn ( "Overwriting already set app start end data." ) ;
}
closure _5 = arg0 ;
}
export const captureAppStart = function captureAppStart ( ) {
return _captureAppStart ( { isManual : true } ) ;
} ;
export { _captureAppStart } ;
export { setRootComponentCreationTimestampMs } ;
export const _setRootComponentCreationTimestampMs = function _setRootComponentCreationTimestampMs ( arg0 ) {
setRootComponentCreationTimestampMs ( arg0 ) ;
2026-07-23 10:11:24 +00:00
let c8 = false ;
2026-07-20 16:05:17 +00:00
} ;
export { _setAppStartEndData } ;
export function _clearRootComponentCreationTimestampMs ( ) {
2026-07-23 10:11:24 +00:00
let c7 ;
2026-07-20 16:05:17 +00:00
}
export const appStartIntegration = function appStartIntegration ( ) {
function attachAppStartToTransactionEvent ( arg0 ) {
let closure _0 = arg0 ;
return callback2 ( this , undefined , undefined , function * ( ) {
2026-07-23 10:11:24 +00:00
if ( ! outer2 _3 ) {
let warnResult2 = outer1 _0 ;
const contexts = outer1 _0 . contexts ;
const outer1 _1 = contexts ;
2026-07-20 16:05:17 +00:00
let trace ;
if ( null !== contexts ) {
2026-07-23 10:11:24 +00:00
if ( undefined !== outer1 _1 ) {
trace = outer1 _1 . trace ;
2026-07-20 16:05:17 +00:00
}
}
if ( trace ) {
2026-07-23 10:11:24 +00:00
if ( ! callback ) {
if ( outer2 _5 ) {
if ( outer2 _5 !== outer1 _0 . contexts . trace . span _id ) {
const debug3 = callback ( 794 ) . debug ;
2026-07-20 16:05:17 +00:00
debug3 . warn ( "[AppStart] First started active root span id does not match the transaction event span id. Can not attached app start." ) ;
}
} else {
2026-07-23 10:11:24 +00:00
const debug2 = callback ( 794 ) . debug ;
2026-07-20 16:05:17 +00:00
debug2 . warn ( "[AppStart] No first started active root span id recorded. Can not attach app start." ) ;
}
}
2026-07-23 10:11:24 +00:00
const NATIVE = callback ( 977 ) . NATIVE ;
2026-07-20 16:05:17 +00:00
const tmp21 = yield NATIVE . fetchNativeAppStart ( ) ;
if ( tmp21 ) {
if ( tmp21 . has _fetched ) {
2026-07-23 10:11:24 +00:00
warnResult2 = callback ;
warnResult2 = dependencyMap ;
const debug17 = callback ( 794 ) . debug ;
2026-07-20 16:05:17 +00:00
warnResult2 = debug17 . warn ( "[AppStart] Measured app start metrics were already reported from the native layer." ) ;
} else {
const app _start _timestamp _ms = tmp21 . app _start _timestamp _ms ;
if ( app _start _timestamp _ms ) {
let timestampMs ;
2026-07-23 10:11:24 +00:00
if ( null != c5 ) {
timestampMs = c5 . timestampMs ;
2026-07-20 16:05:17 +00:00
}
if ( ! timestampMs ) {
2026-07-23 10:11:24 +00:00
let obj = callback ( 1132 ) ;
2026-07-20 16:05:17 +00:00
timestampMs = obj . getBundleStartTimestampMs ( ) ;
}
if ( timestampMs ) {
2026-07-23 10:11:24 +00:00
if ( outer1 _0 . start _timestamp ) {
if ( app _start _timestamp _ms >= 1000 * outer1 _0 . start _timestamp - 60000 ) {
2026-07-20 16:05:17 +00:00
const diff = timestampMs - app _start _timestamp _ms ;
if ( diff >= 60000 ) {
2026-07-23 10:11:24 +00:00
warnResult2 = callback ;
warnResult2 = dependencyMap ;
const debug16 = callback ( 794 ) . debug ;
2026-07-20 16:05:17 +00:00
warnResult2 = debug16 . warn ( "[AppStart] App start duration is over a minute long, not adding app start span." ) ;
} else if ( diff < 0 ) {
2026-07-23 10:11:24 +00:00
warnResult2 = callback ;
warnResult2 = dependencyMap ;
const debug15 = callback ( 794 ) . debug ;
2026-07-20 16:05:17 +00:00
warnResult2 = debug15 . warn ( "[AppStart] Last recorded app start end timestamp is before the app start timestamp." , "This is usually caused by missing `Sentry.wrap(RootComponent)` call." ) ;
} else {
2026-07-23 10:11:24 +00:00
outer2 _3 = true ;
warnResult2 = outer1 _0 ;
let data = outer1 _0 . contexts . trace . data ;
2026-07-20 16:05:17 +00:00
if ( ! data ) {
data = { } ;
}
2026-07-23 10:11:24 +00:00
outer1 _0 . contexts . trace . data = data ;
outer1 _0 . contexts . trace . data [ callback ( 1133 ) . SEMANTIC _ATTRIBUTE _SENTRY _OP ] = callback ( 1131 ) . UI _LOAD ;
outer1 _0 . contexts . trace . op = callback ( 1131 ) . UI _LOAD ;
const tmp48 = callback ( 1134 ) ;
const tmp49 = recordFirstStartedActiveRootSpanId ? tmp48 . SPAN _ORIGIN _MANUAL _APP _START : tmp48 . SPAN _ORIGIN _AUTO _APP _START ;
outer1 _0 . contexts . trace . data [ callback ( 794 ) . SEMANTIC _ATTRIBUTE _SENTRY _ORIGIN ] = tmp49 ;
outer1 _0 . contexts . trace . origin = tmp49 ;
2026-07-20 16:05:17 +00:00
const result = app _start _timestamp _ms / 1000 ;
2026-07-23 10:11:24 +00:00
outer1 _0 . start _timestamp = result ;
outer1 _0 . spans = outer1 _0 . spans || [ ] ;
const spans = outer1 _0 . spans ;
let found = spans . find ( ( op ) => "ui.load.initial_display" === op . op ) ;
2026-07-20 16:05:17 +00:00
if ( found ) {
found . start _timestamp = result ;
2026-07-23 10:11:24 +00:00
outer3 _12 ( outer1 _0 , "time_to_initial_display" , found ) ;
2026-07-20 16:05:17 +00:00
}
const found1 = spans . find ( ( op ) => "ui.load.full_display" === op . op ) ;
if ( found1 ) {
found1 . start _timestamp = result ;
2026-07-23 10:11:24 +00:00
outer3 _12 ( outer1 _0 , "time_to_full_display" , found1 ) ;
2026-07-20 16:05:17 +00:00
}
const result1 = timestampMs / 1000 ;
2026-07-23 10:11:24 +00:00
let timestamp = outer1 _0 . timestamp ;
2026-07-20 16:05:17 +00:00
if ( timestamp ) {
2026-07-23 10:11:24 +00:00
timestamp = outer1 _0 . timestamp < result1 ;
2026-07-20 16:05:17 +00:00
}
if ( timestamp ) {
2026-07-23 10:11:24 +00:00
const debug8 = callback ( 794 ) . debug ;
2026-07-20 16:05:17 +00:00
debug8 . log ( "[AppStart] Transaction event timestamp is before app start end. Adjusting transaction event timestamp." ) ;
2026-07-23 10:11:24 +00:00
outer1 _0 . timestamp = result1 ;
2026-07-20 16:05:17 +00:00
}
if ( "cold" === tmp21 . type ) {
2026-07-23 10:11:24 +00:00
let APP _START _WARM = callback ( 1131 ) . APP _START _COLD ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
APP _START _WARM = callback ( 1131 ) . APP _START _WARM ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let obj2 = callback ( 1132 ) ;
2026-07-20 16:05:17 +00:00
obj = { op : APP _START _WARM } ;
let str12 = "Warm Start" ;
if ( "cold" === tmp21 . type ) {
str12 = "Cold Start" ;
}
obj . description = str12 ;
obj . start _timestamp = result ;
obj . timestamp = result1 ;
2026-07-23 10:11:24 +00:00
obj . trace _id = outer1 _0 . contexts . trace . trace _id ;
obj . parent _span _id = outer1 _0 . contexts . trace . span _id ;
2026-07-20 16:05:17 +00:00
obj . origin = tmp49 ;
const spanJSON = obj2 . createSpanJSON ( obj ) ;
let endFrames ;
2026-07-23 10:11:24 +00:00
if ( null != c5 ) {
endFrames = c5 . endFrames ;
2026-07-20 16:05:17 +00:00
}
if ( endFrames ) {
2026-07-23 10:11:24 +00:00
endFrames = c5 . endFrames ;
2026-07-20 16:05:17 +00:00
if ( endFrames . totalFrames <= 0 ) {
if ( endFrames . slowFrames <= 0 ) {
if ( endFrames . totalFrames <= 0 ) {
2026-07-23 10:11:24 +00:00
const debug10 = callback ( 794 ) . debug ;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal ;
debug10 . warn ( "[AppStart] Detected zero slow or frozen frames. Not adding measurements to spanId (" + spanJSON . span _id + ")." ) ;
}
}
}
spanJSON . data = spanJSON . data || { } ;
2026-07-23 10:11:24 +00:00
( { totalFrames : tmp77 . data [ "frames.total" ] , slowFrames : tmp77 . data [ "frames.slow" ] , frozenFrames : tmp77 . data [ "frames.frozen" ] } = endFrames ) ;
const debug9 = callback ( 794 ) . debug ;
2026-07-20 16:05:17 +00:00
obj = { spanId : spanJSON . span _id } ;
( { totalFrames : obj6 . total , slowFrames : obj6 . slow , frozenFrames : obj6 . frozen } = endFrames ) ;
obj . frameData = { } ;
debug9 . log ( "[AppStart] Attached frame data to span." , obj ) ;
2026-07-23 10:11:24 +00:00
let obj1 = { } ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let bundleStartTimestampMs = callback ( 1132 ) . getBundleStartTimestampMs ( ) ;
2026-07-20 16:05:17 +00:00
let childSpanJSON ;
if ( bundleStartTimestampMs ) {
const result2 = bundleStartTimestampMs / 1000 ;
if ( result2 < spanJSON . start _timestamp ) {
2026-07-23 10:11:24 +00:00
warnResult2 = callback ;
warnResult2 = dependencyMap ;
const debug12 = callback ( 794 ) . debug ;
2026-07-20 16:05:17 +00:00
warnResult2 = debug12 . warn ( "Bundle start timestamp is before the app start span start timestamp. Skipping JS execution span." ) ;
} else {
2026-07-23 10:11:24 +00:00
warnResult2 = callback ;
warnResult2 = dependencyMap ;
2026-07-20 16:05:17 +00:00
if ( tmp89 ) {
obj2 = { description : "JS Bundle Execution Before React Root" , start _timestamp : result2 , timestamp : tmp89 / 1000 } ;
2026-07-23 10:11:24 +00:00
const tmp99 = callback ( 1134 ) ;
obj2 . origin = attachAppStartToTransactionEvent ? tmp99 . SPAN _ORIGIN _MANUAL _APP _START : tmp99 . SPAN _ORIGIN _AUTO _APP _START ;
childSpanJSON = warnResult2 ( 1132 ) . createChildSpanJSON ( spanJSON , obj2 ) ;
const warnResult2Result = warnResult2 ( 1132 ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
const debug11 = warnResult2 ( 794 ) . debug ;
2026-07-20 16:05:17 +00:00
debug11 . warn ( "Missing the root component first constructor call timestamp." ) ;
2026-07-23 10:11:24 +00:00
let obj3 = { description : "JS Bundle Execution Start" , start _timestamp : result2 , timestamp : result2 , origin : warnResult2 ( 1134 ) . SPAN _ORIGIN _AUTO _APP _START } ;
childSpanJSON = warnResult2 ( 1132 ) . createChildSpanJSON ( spanJSON , obj3 ) ;
const warnResult2Result1 = warnResult2 ( 1132 ) ;
2026-07-20 16:05:17 +00:00
}
}
}
const items = [ spanJSON ] ;
2026-07-23 10:11:24 +00:00
warnResult2 = callback2 ;
2026-07-20 16:05:17 +00:00
if ( childSpanJSON ) {
const items1 = [ childSpanJSON ] ;
let items2 = items1 ;
} else {
items2 = [ ] ;
}
2026-07-23 10:11:24 +00:00
warnResult2 = callback2 ;
2026-07-20 16:05:17 +00:00
warnResult2 = warnResult2 ( items2 ) ;
2026-07-23 10:11:24 +00:00
warnResult2 = items . concat ( warnResult2 , callback2 ( ( function convertNativeSpansToSpanJSON ( spanJSON , spans ) {
let closure _0 = spanJSON ;
const found = spans . filter ( ( start _timestamp _ms ) => start _timestamp _ms . start _timestamp _ms / 1000 >= spanJSON . start _timestamp ) ;
2026-07-20 16:05:17 +00:00
return found . map ( ( description ) => {
let SPAN _ORIGIN _AUTO _APP _START = description ;
if ( "UIKit init" === description . description ) {
2026-07-23 10:11:24 +00:00
let obj = spanJSON ( 1136 ) ;
2026-07-20 16:05:17 +00:00
obj = 6 ;
2026-07-23 10:11:24 +00:00
const bundleStartTimestampMs = spanJSON ( 1132 ) . getBundleStartTimestampMs ( ) ;
2026-07-20 16:05:17 +00:00
if ( ! bundleStartTimestampMs ) {
2026-07-23 10:11:24 +00:00
obj = { description : "UIKit Init" , start _timestamp : SPAN _ORIGIN _AUTO _APP _START . start _timestamp _ms / 1000 , timestamp : SPAN _ORIGIN _AUTO _APP _START . end _timestamp _ms / 1000 , origin : spanJSON ( 1134 ) . SPAN _ORIGIN _AUTO _APP _START } ;
let childSpanJSON = spanJSON ( dependencyMap [ obj ] ) . createChildSpanJSON ( tmp3 , obj ) ;
2026-07-20 16:05:17 +00:00
obj . setMainThreadInfo ( childSpanJSON ) ;
2026-07-23 10:11:24 +00:00
const obj4 = spanJSON ( dependencyMap [ obj ] ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const obj3 = spanJSON ( 1132 ) ;
2026-07-20 16:05:17 +00:00
obj = { description : "UIKit Init to JS Exec Start" , start _timestamp : SPAN _ORIGIN _AUTO _APP _START . start _timestamp _ms / 1000 , timestamp : bundleStartTimestampMs / 1000 } ;
2026-07-23 10:11:24 +00:00
SPAN _ORIGIN _AUTO _APP _START = spanJSON ( 1134 ) . SPAN _ORIGIN _AUTO _APP _START ;
2026-07-20 16:05:17 +00:00
obj . origin = SPAN _ORIGIN _AUTO _APP _START ;
2026-07-23 10:11:24 +00:00
childSpanJSON = spanJSON ( dependencyMap [ obj ] ) . createChildSpanJSON ( tmp3 , obj ) ;
const obj6 = spanJSON ( dependencyMap [ obj ] ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
const obj7 = spanJSON ( 1136 ) ;
const obj1 = { description : SPAN _ORIGIN _AUTO _APP _START . description , start _timestamp : SPAN _ORIGIN _AUTO _APP _START . start _timestamp _ms / 1000 , timestamp : SPAN _ORIGIN _AUTO _APP _START . end _timestamp _ms / 1000 , origin : spanJSON ( 1134 ) . SPAN _ORIGIN _AUTO _APP _START } ;
return obj7 . setMainThreadInfo ( spanJSON ( 1132 ) . createChildSpanJSON ( spanJSON , obj1 ) ) ;
2026-07-20 16:05:17 +00:00
}
} ) ;
2026-07-23 10:11:24 +00:00
} ) ( spanJSON , tmp21 . spans ) ) ) ;
2026-07-20 16:05:17 +00:00
const push = spans . push ;
2026-07-23 10:11:24 +00:00
warnResult2 = push . apply ( spans , callback2 ( warnResult2 ) ) ;
warnResult2 = callback ;
warnResult2 = dependencyMap ;
const debug13 = callback ( 794 ) . debug ;
2026-07-20 16:05:17 +00:00
warnResult2 = globalThis ;
const _JSON = JSON ;
warnResult2 = debug13 . log ( "[AppStart] Added app start spans to transaction event." , JSON . stringify ( warnResult2 , undefined , 2 ) ) ;
if ( "cold" === tmp21 . type ) {
2026-07-23 10:11:24 +00:00
warnResult2 = callback ;
warnResult2 = dependencyMap ;
let APP _START _WARM2 = callback ( 1135 ) . APP _START _COLD ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
warnResult2 = callback ;
warnResult2 = dependencyMap ;
APP _START _WARM2 = callback ( 1135 ) . APP _START _WARM ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let obj4 = { value : diff , unit : "millisecond" } ;
let measurements = outer1 _0 . measurements ;
warnResult2 = outer1 _0 ;
2026-07-20 16:05:17 +00:00
if ( ! measurements ) {
measurements = { } ;
}
warnResult2 . measurements = measurements ;
2026-07-23 10:11:24 +00:00
warnResult2 = outer1 _0 ;
outer1 _0 . measurements [ APP _START _WARM2 ] = obj4 ;
warnResult2 = callback ;
warnResult2 = dependencyMap ;
const debug14 = callback ( 794 ) . debug ;
2026-07-20 16:05:17 +00:00
const _JSON2 = JSON ;
warnResult2 = debug14 . log ( "[AppStart] Added app start measurement to transaction event." , JSON . stringify ( obj4 , undefined , 2 ) ) ;
2026-07-23 10:11:24 +00:00
let obj7 = callback ( 1132 ) ;
const tmp50 = outer1 _0 ;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-23 10:11:24 +00:00
const debug7 = callback ( 794 ) . debug ;
2026-07-20 16:05:17 +00:00
debug7 . warn ( "[AppStart] App start timestamp is too far in the past to be used for app start span." ) ;
} else {
2026-07-23 10:11:24 +00:00
const debug6 = callback ( 794 ) . debug ;
2026-07-20 16:05:17 +00:00
debug6 . warn ( "[AppStart] Javascript failed to record app start end. `_setAppStartEndData` was not called nor could the bundle start be found." ) ;
}
} else {
2026-07-23 10:11:24 +00:00
const debug5 = callback ( 794 ) . debug ;
2026-07-20 16:05:17 +00:00
debug5 . warn ( "[AppStart] App start timestamp could not be loaded from the native layer." ) ;
}
}
} else {
2026-07-23 10:11:24 +00:00
const debug4 = callback ( 794 ) . debug ;
2026-07-20 16:05:17 +00:00
debug4 . warn ( "[AppStart] Failed to retrieve the app start metrics from the native layer." ) ;
}
} else {
2026-07-23 10:11:24 +00:00
const debug = callback ( 794 ) . debug ;
2026-07-20 16:05:17 +00:00
debug . warn ( "[AppStart] Transaction event is missing trace context. Can not attach app start." ) ;
}
}
} ) ;
}
if ( arguments . length > 0 ) {
if ( undefined !== arguments [ 0 ] ) {
const first = arguments [ 0 ] ;
}
const standalone = { } . standalone ;
let closure _0 = undefined !== standalone && standalone ;
2026-07-23 10:11:24 +00:00
let c1 ;
let c2 = true ;
let c3 = false ;
let c4 = false ;
let c5 ;
2026-07-20 16:05:17 +00:00
function recordFirstStartedActiveRootSpanId ( spanContext ) {
2026-07-23 10:11:24 +00:00
if ( ! c5 ) {
2026-07-20 16:05:17 +00:00
if ( obj . isRootSpan ( spanContext ) ) {
setFirstStartedActiveRootSpanId ( spanContext . spanContext ( ) . spanId ) ;
}
2026-07-23 10:11:24 +00:00
obj = callback ( _undefined [ 4 ] ) ;
2026-07-20 16:05:17 +00:00
}
}
function setFirstStartedActiveRootSpanId ( spanId ) {
let closure _5 = spanId ;
2026-07-23 10:11:24 +00:00
const debug = callback ( _undefined [ 1 ] ) . debug ;
2026-07-20 16:05:17 +00:00
debug . log ( "[AppStart] First started active root span id recorded." , closure _5 ) ;
}
2026-07-23 10:11:24 +00:00
let obj = {
name : c4 ,
2026-07-20 16:05:17 +00:00
setup ( getOptions ) {
let closure _1 = getOptions ;
if ( ! getOptions . getOptions ( ) . enableAppStartTracking ) {
2026-07-23 10:11:24 +00:00
let c2 = false ;
const debug = callback ( _undefined [ 1 ] ) . debug ;
2026-07-20 16:05:17 +00:00
debug . warn ( "[AppStart] App start tracking is disabled." ) ;
}
getOptions . on ( "spanStart" , recordFirstStartedActiveRootSpanId ) ;
} ,
afterAllSetup ( client ) {
2026-07-23 10:11:24 +00:00
if ( ! c4 ) {
c4 = true ;
const appRegistryIntegration = callback ( _undefined [ 3 ] ) . getAppRegistryIntegration ( client ) ;
2026-07-20 16:05:17 +00:00
if ( ! tmp5 ) {
appRegistryIntegration . onRunApplication ( ( ) => {
2026-07-23 10:11:24 +00:00
const debug = callback ( table [ 1 ] ) . debug ;
2026-07-20 16:05:17 +00:00
const log = debug . log ;
2026-07-23 10:11:24 +00:00
if ( outer1 _3 ) {
2026-07-20 16:05:17 +00:00
log ( "[AppStartIntegration] Resetting app start data flushed flag based on runApplication call." ) ;
2026-07-23 10:11:24 +00:00
outer1 _3 = false ;
let outer1 _5 ;
2026-07-20 16:05:17 +00:00
} else {
log ( "[AppStartIntegration] Waiting for initial app start was flush, before updating based on runApplication call." ) ;
}
} ) ;
}
2026-07-23 10:11:24 +00:00
const obj = callback ( _undefined [ 3 ] ) ;
tmp5 = null === appRegistryIntegration || undefined === appRegistryIntegration ;
2026-07-20 16:05:17 +00:00
}
} ,
processEvent ( arg0 ) {
let closure _0 = arg0 ;
return callback2 ( undefined , undefined , undefined , function * ( ) {
2026-07-23 10:11:24 +00:00
let tmp = ! outer2 _2 ;
if ( outer2 _2 ) {
tmp = closure _0 ;
2026-07-20 16:05:17 +00:00
}
if ( ! tmp ) {
2026-07-23 10:11:24 +00:00
tmp = "transaction" !== outer1 _0 . type ;
2026-07-20 16:05:17 +00:00
}
if ( tmp ) {
2026-07-23 10:11:24 +00:00
return outer1 _0 ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
return yield outer2 _8 ( outer1 _0 ) ;
2026-07-20 16:05:17 +00:00
}
} ) ;
} ,
captureStandaloneAppStart ( ) {
return callback2 ( this , undefined , undefined , function * ( ) {
2026-07-23 10:11:24 +00:00
if ( outer2 _1 ) {
const debug = callback ( 794 ) . debug ;
2026-07-20 16:05:17 +00:00
const log = debug . log ;
2026-07-23 10:11:24 +00:00
if ( outer2 _0 ) {
2026-07-20 16:05:17 +00:00
log ( "[AppStart] App start tracking standalone root span (transaction)." ) ;
let endFrames ;
2026-07-23 10:11:24 +00:00
if ( null != c5 ) {
endFrames = c5 . endFrames ;
2026-07-20 16:05:17 +00:00
}
if ( ! endFrames ) {
2026-07-23 10:11:24 +00:00
if ( callback ( 977 ) . NATIVE . enableNative ) {
const NATIVE = callback ( 977 ) . NATIVE ;
2026-07-20 16:05:17 +00:00
const tmp16 = yield NATIVE . fetchNativeFrames ( ) ;
2026-07-23 10:11:24 +00:00
const debug2 = callback ( 794 ) . debug ;
2026-07-20 16:05:17 +00:00
debug2 . log ( "[AppStart] Captured end frames for standalone app start." , tmp16 ) ;
let timestampMs ;
2026-07-23 10:11:24 +00:00
if ( null != c5 ) {
timestampMs = c5 . timestampMs ;
2026-07-20 16:05:17 +00:00
}
let result = timestampMs ;
if ( ! timestampMs ) {
2026-07-23 10:11:24 +00:00
let obj = callback ( 794 ) ;
2026-07-20 16:05:17 +00:00
result = 1000 * obj . timestampInSeconds ( ) ;
}
obj = { timestampMs : result , endFrames : tmp16 } ;
2026-07-23 10:11:24 +00:00
outer3 _9 ( obj ) ;
2026-07-20 16:05:17 +00:00
}
}
while ( true ) {
let tmp30 = callback ;
2026-07-23 10:11:24 +00:00
let tmp31 = dependencyMap ;
let obj3 = callback ( 794 ) ;
obj = { forceTransaction : true , name : "App Start" } ;
2026-07-20 16:05:17 +00:00
let num4 = 5 ;
2026-07-23 10:11:24 +00:00
obj . op = callback ( 1131 ) . UI _LOAD ;
2026-07-20 16:05:17 +00:00
let startInactiveSpanResult = obj3 . startInactiveSpan ( obj ) ;
2026-07-23 10:11:24 +00:00
if ( startInactiveSpanResult instanceof callback ( 794 ) . SentryNonRecordingSpan ) {
2026-07-20 16:05:17 +00:00
break ;
} else {
let tmp33 = callback ;
2026-07-23 10:11:24 +00:00
let tmp34 = dependencyMap ;
2026-07-20 16:05:17 +00:00
let num5 = 4 ;
2026-07-23 10:11:24 +00:00
let obj5 = callback ( 1098 ) ;
let obj6 = callback ( 794 ) ;
2026-07-20 16:05:17 +00:00
let setEndTimeValueResult = obj5 . setEndTimeValue ( startInactiveSpanResult , obj6 . timestampInSeconds ( ) ) ;
2026-07-23 10:11:24 +00:00
let tmp36 = outer2 _1 ;
2026-07-20 16:05:17 +00:00
let str5 = "spanEnd" ;
2026-07-23 10:11:24 +00:00
let emitResult = outer2 _1 . emit ( "spanEnd" , startInactiveSpanResult ) ;
let obj7 = callback ( 1098 ) ;
2026-07-20 16:05:17 +00:00
let result1 = obj7 . convertSpanToTransaction ( startInactiveSpanResult ) ;
if ( result1 ) {
2026-07-23 10:11:24 +00:00
let tmp42 = outer2 _8 ;
let tmp43 = yield outer2 _8 ( result1 ) ;
2026-07-20 16:05:17 +00:00
if ( ! result1 . spans ) {
break ;
} else {
let num6 = 0 ;
if ( 0 === result1 . spans . length ) {
break ;
} else {
let tmp44 = callback ;
2026-07-23 10:11:24 +00:00
let tmp45 = dependencyMap ;
let obj8 = callback ( 794 ) ;
2026-07-20 16:05:17 +00:00
let scope = obj8 . getCapturedScopesOnSpan ( startInactiveSpanResult ) . scope ;
if ( ! scope ) {
let tmp46 = callback ;
2026-07-23 10:11:24 +00:00
let tmp47 = dependencyMap ;
let obj9 = callback ( 794 ) ;
2026-07-20 16:05:17 +00:00
scope = obj9 . getCurrentScope ( ) ;
}
let captureEventResult = scope . captureEvent ( result1 ) ;
2026-07-23 10:11:24 +00:00
break ;
2026-07-20 16:05:17 +00:00
}
}
} else {
let tmp39 = callback ;
2026-07-23 10:11:24 +00:00
let tmp40 = dependencyMap ;
let debug3 = callback ( 794 ) . debug ;
2026-07-20 16:05:17 +00:00
let str6 = "[AppStart] Failed to convert App Start span to transaction." ;
let warnResult = debug3 . warn ( "[AppStart] Failed to convert App Start span to transaction." ) ;
2026-07-23 10:11:24 +00:00
break ;
2026-07-20 16:05:17 +00:00
}
break ;
}
break ;
}
} else {
log ( "[AppStart] App start tracking is enabled. App start will be added to the first transaction as a child span." ) ;
}
} else {
const _console = console ;
console . warn ( "[AppStart] Could not capture App Start, missing client, call `Sentry.init` first." ) ;
}
} ) ;
} ,
setFirstStartedActiveRootSpanId
} ;
return obj ;
}
} ;