decord/source/1128__captureAppStart.js

605 lines
28 KiB
JavaScript
Raw Normal View History

2026-07-20 16:05:17 +00:00
// Module ID: 1128
2026-07-24 07:16:23 +00:00
// Function ID: 12857
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;
}
};