/* Metro module 1107; source: unknown; dependencies: [1108, 1109, 1080, 826, 1036, 1110] */ import * as Module00826Module from './module-00826.js'; /* Metro dependency 826 */ import * as Module01036Module from './module-01036.js'; /* Metro dependency 1036 */ import * as DEBUG_BUILDModule from './module-01080-DEBUG_BUILD.js'; /* Metro dependency 1080 */ import * as UIProfilerModule from './module-01108-UIProfiler.js'; /* Metro dependency 1108 */ import * as Module01109Module from './module-01109.js'; /* Metro dependency 1109 */ function _fun12384(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#12384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1234:6, offset: 0x00dc8bd2, size: 101 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; const defineProperty = Object.defineProperty; const Symbol = global.Symbol; Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]); exports.browserProfilingIntegration = (require(826) /* metro dependency 826 */).defineIntegration(function() { return {name: 'BrowserProfiling', setup: _fun12386, processEvent: _fun12392}; }); function _browserProfilingIntegration() { // fn#12385, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1234:124, offset: 0x00dc8c37, size: 36 bytes, params: 1, frame: 3 return {name: 'BrowserProfiling', setup: setup_12386, processEvent: processEvent_12392}; function _browserProfilingIntegrationSetup(a0) { // fn#12386, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1234:201, owner: _browserProfilingIntegration.setup, offset: 0x00dc8c5b, size: 856 bytes, params: 2, frame: 23 var r3; var r5; var profileLifecycle; const DEBUG_BUILD = (DEBUG_BUILDModule).DEBUG_BUILD; const debug = (require(826) /* metro dependency 826 */).debug; var activeSpan; var moduleValue6; var moduleValue7; const WINDOW = (Module01036Module).WINDOW; let value = a0.getOptions(); const UIProfiler = (UIProfilerModule).UIProfiler; const uIProfiler = new UIProfiler(); const moduleValue = require(1109) /* metro dependency 1109 */; if (!(moduleValue.hasLegacyProfiling(value) || value.profileLifecycle)) { value.profileLifecycle = 'manual'; } const moduleValue2 = moduleValue; if (moduleValue2.hasLegacyProfiling(value)) { if (value.profilesSampleRate) { activeSpan = (require(826) /* metro dependency 826 */).getActiveSpan(); r5 = activeSpan && (require(826) /* metro dependency 826 */).getRootSpan(activeSpan); r3 = moduleValue.hasLegacyProfiling(value) && value.profileSessionSampleRate !== undefined; r3 = r3 && DEBUG_BUILD; if (r3) { debug.warn('[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled.'); } moduleValue6 = require(1109) /* metro dependency 1109 */; if (moduleValue6.hasLegacyProfiling(value)) { if (r5) { value = require(1109) /* metro dependency 1109 */; value = value.isAutomatedPageLoadSpan(r5); r3 = value; } else { r3 = r5; } if (r3) { value = require(1109) /* metro dependency 1109 */; value = value.shouldProfileSpanLegacy(r5); r3 = value; } if (r3) { (require(1110) /* metro dependency 1110 */).startProfileForSpan(r5); } a0.on('spanStart', _fun12387); a0.on('beforeEnvelope', _fun12388); return undefined; } profileLifecycle = value.profileLifecycle; a0.on('startUIProfiler', _fun12389); a0.on('stopUIProfiler', _fun12390); if (profileLifecycle === 'manual') { uIProfiler.initialize(a0); return undefined; } if (profileLifecycle !== 'trace') { return undefined; } moduleValue7 = require(826) /* metro dependency 826 */; if (moduleValue7.hasSpansEnabled(value)) { uIProfiler.initialize(a0); if (r5) { uIProfiler.notifyRootSpanActive(r5); } WINDOW.setTimeout(_fun12391, 0); return undefined; } if (DEBUG_BUILD) { debug.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing."); } return undefined; } if (DEBUG_BUILD) { debug.log('[Profiling] Profiling disabled, no profiling options found.'); } } else { activeSpan = (require(826) /* metro dependency 826 */).getActiveSpan(); r5 = activeSpan && (require(826) /* metro dependency 826 */).getRootSpan(activeSpan); r3 = (require(1109) /* metro dependency 1109 */).hasLegacyProfiling(value) && value.profileSessionSampleRate !== undefined; r3 = r3 && DEBUG_BUILD; if (r3) { debug.warn('[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled.'); } moduleValue6 = require(1109) /* metro dependency 1109 */; if (moduleValue6.hasLegacyProfiling(value)) { if (r5) { value = require(1109) /* metro dependency 1109 */; value = value.isAutomatedPageLoadSpan(r5); r3 = value; } else { r3 = r5; } if (r3) { value = require(1109) /* metro dependency 1109 */; value = value.shouldProfileSpanLegacy(r5); r3 = value; } if (r3) { (require(1110) /* metro dependency 1110 */).startProfileForSpan(r5); } a0.on('spanStart', _fun12387); a0.on('beforeEnvelope', _fun12388); return undefined; } profileLifecycle = value.profileLifecycle; a0.on('startUIProfiler', _fun12389); a0.on('stopUIProfiler', _fun12390); if (profileLifecycle === 'manual') { uIProfiler.initialize(a0); return undefined; } if (profileLifecycle !== 'trace') { return undefined; } moduleValue7 = require(826) /* metro dependency 826 */; if (moduleValue7.hasSpansEnabled(value)) { uIProfiler.initialize(a0); if (r5) { uIProfiler.notifyRootSpanActive(r5); } WINDOW.setTimeout(_fun12391, 0); return undefined; } if (DEBUG_BUILD) { debug.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing."); } } function _fun12387(a0) { // fn#12387, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1234:901, offset: 0x00dc8fb3, size: 113 bytes, params: 2, frame: 15 const value = environment.__proto__.__proto__; const getRootSpan = Module00826Module.getRootSpan; if (a0 === Reflect.apply(getRootSpan, Module00826Module, [a0]) && (require(1109) /* metro dependency 1109 */).shouldProfileSpanLegacy(a0)) { (require(1110) /* metro dependency 1110 */).startProfileForSpan(a0); } } function _fun12388(a0) { // fn#12388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1234:1034, offset: 0x00dc9024, size: 664 bytes, params: 2, frame: 39 var r6; var contexts; var profile_id; var start_timestamp; var r22; var value; var value2; var moduleValue; var getActiveProfilesCount; var moduleValue2; var findProfiledTransactionsFromEnvelope; var profiledTransactionsFromEnvelope; var length; var items2; var iterator; var iterator2; var item; var item2; var value3; var value4; var profile; var value5; var value6; var value7; var value8; var property; var moduleValue3; var DEBUG_BUILD; var moduleValue4; var debug; var log; var moduleValue5; var moduleValue6; var value9; var moduleValue7; var takeProfileFromGlobalCache; var value10; var moduleValue8; var moduleValue9; var HermesInternal; var concat; var value11; var moduleValue10; var createProfilingEvent; var profilingEvent; var push; var error; var moduleValue11; var addProfilesToEnvelope; exceptionSkip105: while (true) { exceptionLanding105: while (true) { value = undefined; value2 = environment.__proto__.__proto__; moduleValue = require(dependencyMap[1]); getActiveProfilesCount = moduleValue.getActiveProfilesCount; if (Reflect.apply(getActiveProfilesCount, moduleValue, [])) { moduleValue2 = require(dependencyMap[1]); findProfiledTransactionsFromEnvelope = moduleValue2.findProfiledTransactionsFromEnvelope; profiledTransactionsFromEnvelope = Reflect.apply(findProfiledTransactionsFromEnvelope, moduleValue2, [a0]); length = profiledTransactionsFromEnvelope.length; if (length) { items2 = []; iterator = profiledTransactionsFromEnvelope[Symbol.iterator](); iterator2 = iterator.next; r6 = iterator; while (true) { item2 = Reflect.apply(iterator2, r6, []); item = item2.value; item2 = item2.done ? undefined : r6; if (item2 === value) { break; } try { value3 = item == null; } catch (error) { break exceptionLanding105; } if (value3) { contexts = value; continue; } try { contexts = item.contexts; } catch (error) { break exceptionLanding105; } try { value4 = contexts == null; } catch (error) { break exceptionLanding105; } if (value4) { profile_id = value; continue; } try { profile = contexts.profile; } catch (error) { break exceptionLanding105; } try { value5 = profile == null; } catch (error) { break exceptionLanding105; } if (value5) { profile_id = value; continue; } try { profile_id = profile.profile_id; } catch (error) { break exceptionLanding105; } try { value6 = contexts == null; } catch (error) { break exceptionLanding105; } if (value6) { start_timestamp = value; continue; } try { profile = contexts.profile; } catch (error) { break exceptionLanding105; } try { value7 = profile == null; } catch (error) { break exceptionLanding105; } if (value7) { start_timestamp = value; continue; } try { start_timestamp = profile.start_timestamp; } catch (error) { break exceptionLanding105; } try { value8 = typeof profile_id === 'string'; } catch (error) { break exceptionLanding105; } if (value8) { if (profile_id) { try { value9 = contexts != null; } catch (error) { break exceptionLanding105; } if (!value9) { r22 = value9; continue; } try { profile = contexts.profile; } catch (error) { break exceptionLanding105; } r22 = profile; if (!r22) { continue; } try { delete contexts.profile; } catch (error) { break exceptionLanding105; } try { } catch (error) { break exceptionLanding105; } try { } catch (error) { break exceptionLanding105; } try { property = dependencyMap[1]; } catch (error) { break exceptionLanding105; } try { moduleValue7 = require(property); } catch (error) { break exceptionLanding105; } try { takeProfileFromGlobalCache = moduleValue7.takeProfileFromGlobalCache; } catch (error) { break exceptionLanding105; } try { value10 = Reflect.apply(takeProfileFromGlobalCache, moduleValue7, [profile_id]); } catch (error) { break exceptionLanding105; } try { } catch (error) { break exceptionLanding105; } try { } catch (error) { break exceptionLanding105; } if (value10) { try { property = dependencyMap[1]; } catch (error) { break exceptionLanding105; } try { moduleValue10 = require(property); } catch (error) { break exceptionLanding105; } try { createProfilingEvent = moduleValue10.createProfilingEvent; } catch (error) { break exceptionLanding105; } try { profilingEvent = Reflect.apply(createProfilingEvent, moduleValue10, [profile_id, start_timestamp, value10, item]); } catch (error) { break exceptionLanding105; } if (!profilingEvent) { r6 = item2; continue; } try { push = items2.push; } catch (error) { break exceptionLanding105; } try { Reflect.apply(push, items2, [profilingEvent]); } catch (error) { break exceptionLanding105; } r6 = item2; } else { try { property = dependencyMap[2]; } catch (error) { break exceptionLanding105; } try { moduleValue8 = require(property); } catch (error) { break exceptionLanding105; } try { DEBUG_BUILD = moduleValue8.DEBUG_BUILD; } catch (error) { break exceptionLanding105; } if (!DEBUG_BUILD) { r6 = item2; continue; } try { } catch (error) { break exceptionLanding105; } try { } catch (error) { break exceptionLanding105; } try { property = dependencyMap[3]; } catch (error) { break exceptionLanding105; } try { moduleValue9 = require(property); } catch (error) { break exceptionLanding105; } try { debug = moduleValue9.debug; } catch (error) { break exceptionLanding105; } try { log = debug.log; } catch (error) { break exceptionLanding105; } try { HermesInternal = global.HermesInternal; } catch (error) { break exceptionLanding105; } try { concat = HermesInternal.concat; } catch (error) { break exceptionLanding105; } try { value11 = '[Profiling] Could not retrieve profile for span: ' + profile_id; } catch (error) { break exceptionLanding105; } try { Reflect.apply(log, debug, [value11]); } catch (error) { break exceptionLanding105; } r6 = item2; } } else { try { } catch (error) { break exceptionLanding105; } try { } catch (error) { break exceptionLanding105; } try { property = dependencyMap[2]; } catch (error) { break exceptionLanding105; } try { moduleValue5 = require(property); } catch (error) { break exceptionLanding105; } try { DEBUG_BUILD = moduleValue5.DEBUG_BUILD; } catch (error) { break exceptionLanding105; } if (!DEBUG_BUILD) { r6 = item2; continue; } try { } catch (error) { break exceptionLanding105; } try { } catch (error) { break exceptionLanding105; } try { property = dependencyMap[3]; } catch (error) { break exceptionLanding105; } try { moduleValue6 = require(property); } catch (error) { break exceptionLanding105; } try { debug = moduleValue6.debug; } catch (error) { break exceptionLanding105; } try { log = debug.log; } catch (error) { break exceptionLanding105; } try { Reflect.apply(log, debug, ['[Profiling] cannot find profile for a span without a profile context']); } catch (error) { break exceptionLanding105; } r6 = item2; } } else { try { } catch (error) { break exceptionLanding105; } try { } catch (error) { break exceptionLanding105; } try { property = dependencyMap[2]; } catch (error) { break exceptionLanding105; } try { moduleValue3 = require(property); } catch (error) { break exceptionLanding105; } try { DEBUG_BUILD = moduleValue3.DEBUG_BUILD; } catch (error) { break exceptionLanding105; } if (!DEBUG_BUILD) { r6 = item2; continue; } try { } catch (error) { break exceptionLanding105; } try { } catch (error) { break exceptionLanding105; } try { property = dependencyMap[3]; } catch (error) { break exceptionLanding105; } try { moduleValue4 = require(property); } catch (error) { break exceptionLanding105; } try { debug = moduleValue4.debug; } catch (error) { break exceptionLanding105; } try { log = debug.log; } catch (error) { break exceptionLanding105; } try { Reflect.apply(log, debug, ['[Profiling] cannot find profile for a span without a profile context']); } catch (error) { break exceptionLanding105; } r6 = item2; } } moduleValue11 = require(dependencyMap[1]); addProfilesToEnvelope = moduleValue11.addProfilesToEnvelope; Reflect.apply(addProfilesToEnvelope, moduleValue11, [a0, items2]); break; } break; } return value; break exceptionSkip105; } try { item2.return(); } catch { } throw error; break exceptionSkip105; } } function _fun12389() { // fn#12389, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1234:1920, offset: 0x00dc92bc, size: 18 bytes, params: 1, frame: 9 return env0_0.start(); } function _fun12390() { // fn#12390, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1234:1974, offset: 0x00dc92ce, size: 19 bytes, params: 1, frame: 9 return env0_0.stop(); } function _fun12391() { // fn#12391, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1234:2348, offset: 0x00dc92e1, size: 92 bytes, params: 1, frame: 14 var r3; let value = environment.__proto__.__proto__; const activeSpan = (require(826) /* metro dependency 826 */).getActiveSpan(); if (activeSpan) { value = require(826) /* metro dependency 826 */; value = value.getRootSpan(activeSpan); r3 = value; } else { r3 = activeSpan; } if (r3) { env0_0.notifyRootSpanActive(r3); } } } function _browserProfilingIntegrationProcessEvent(a0) { // fn#12392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1234:2574, owner: _browserProfilingIntegration.processEvent, offset: 0x00dc933d, size: 41 bytes, params: 2, frame: 11 const value = environment.__proto__; return (Module01109Module).attachProfiledThreadToEvent(a0); } } } global.__d(_fun12384, 1107, [1108, 1109, 1080, 826, 1036, 1110]) /* metro module 1107, dependencies: [1108, 1109, 1080, 826, 1036, 1110] */;