/* Metro module 15754; source: modules/jank_stats/native/JankStatsManager.android.tsx; dependencies: [6, 7, 15, 17, 18, 661, 15755, 683, 4884, 4860, 2] */ import ClassCallCheck from '../../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */ import CreateClass from '../../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */ import PossibleConstructorReturn from '../../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */ import Module00017 from '../../../by-id/module-00017.js'; /* Metro dependency 17 */ import Inherits from '../../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */ import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */ function _fun120975(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#120975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15962:6, offset: 0x0253bc1c, size: 262 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ConstantsModule; const env0_8 = value.AppStates; const env0_9 = value.AnalyticEvents; value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */; value = _fun120979(value); value = new value(); (FileImportTrackerModule).fileFinishedImporting('modules/jank_stats/native/JankStatsManager.android.tsx'); exports.default = value; function _isNativeReflectConstruct_120976() { // fn#120976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15962:191, offset: 0x0253bd22, size: 98 bytes, params: 1, frame: 18 var Boolean; var prototype; var valueOf; var call; var Reflect; var construct; var closure; var value; var error; try { Boolean = global.Boolean; prototype = Boolean.prototype; valueOf = prototype.valueOf; call = valueOf.call; Reflect = global.Reflect; construct = Reflect.construct; Boolean = global.Boolean; closure = function() { }; value = Reflect.apply(construct, Reflect, [Boolean, [], closure]); value = Reflect.apply(call, valueOf, [value]); var result = !value; } catch (error) { } return (_isNativeReflectConstruct_120976_isNativeReflectConstruct = function() { return !!result; })(); } function _fun120979(a0) { // fn#120979, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15962:394, offset: 0x0253bd84, size: 147 bytes, params: 2, frame: 16 const JankStatsManager2 = JankStatsManager; Inherits(JankStatsManager2, a0); return CreateClass(JankStatsManager2, [{key: 'handleAppStateUpdate', value: value_120983}, {key: 'handleConnectionOpenSupplemental', value: function() { var env0_0 = this; global.setTimeout(_fun120985, 0); }}, {key: 'scheduleReport', value: function() { var env0_0 = this; if (this._timeoutId == null) { this._isScheduledReportSent = false; this._timeoutId = global.setTimeout(_fun120987, 300000); } }}, {key: 'sendReport', value: value_120988}]); function JankStatsManager(a0) { // fn#120980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15962:406, offset: 0x0253be17, size: 188 bytes, params: 2, frame: 20 var r0; var Reflect; let value = copyRestArgs(0, undefined); let binding = env1_3; binding(this, JankStatsManager); const items2 = []; arraySpread(items2, value, 0, items2); value = env1_6(JankStatsManager); binding = env1_5; if (_isNativeReflectConstruct_120976()) { Reflect = global.Reflect; value = Reflect.construct(value, items2, env1_6(this).constructor); r0 = value; } else { value = value.apply(this, items2); r0 = value; } value = binding(this, r0); value._timeoutId = null; value._isScheduledReportSent = false; value._isStartup = true; value.actions = {APP_STATE_UPDATE: APP_STATE_UPDATE_120981, CONNECTION_OPEN_SUPPLEMENTAL: CONNECTION_OPEN_SUPPLEMENTAL_120982}; return value; function JankStatsManagerAPP_STATE_UPDATE(a0) { // fn#120981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15962:730, owner: JankStatsManager.APP_STATE_UPDATE, offset: 0x0253bed3, size: 25 bytes, params: 2, frame: 11 env0_0.handleAppStateUpdate(a0); } function JankStatsManagerCONNECTION_OPEN_SUPPLEMENTAL() { // fn#120982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15962:790, owner: JankStatsManager.CONNECTION_OPEN_SUPPLEMENTAL, offset: 0x0253beec, size: 21 bytes, params: 1, frame: 9 env0_0.handleConnectionOpenSupplemental(); } } function value_120983({state}) { // fn#120983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15962:919, offset: 0x0253bf01, size: 123 bytes, params: 2, frame: 12 const value = environment.__proto__; const ACTIVE = AppStates.ACTIVE; if (state !== ACTIVE) { if (!(state !== AppStates.BACKGROUND || this._isScheduledReportSent)) { global.clearTimeout(this._timeoutId); this._timeoutId = null; this.sendReport('background'); } } else if (this._isStartup) { if (!(state !== AppStates.BACKGROUND || this._isScheduledReportSent)) { global.clearTimeout(this._timeoutId); this._timeoutId = null; this.sendReport('background'); } } else { this.scheduleReport(); } } function value_120984() { // fn#120984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15962:1169, offset: 0x0253bf7c, size: 36 bytes, params: 1, frame: 13 global.setTimeout(_fun120985, 0); function _fun120985() { // fn#120985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15962:1192, offset: 0x0253bfa0, size: 46 bytes, params: 1, frame: 11 const binding = env0_0; binding.sendReport('startup'); binding._isStartup = false; binding.scheduleReport(); } } function value_120986() { // fn#120986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15962:1300, offset: 0x0253bfce, size: 68 bytes, params: 1, frame: 14 if (this._timeoutId == null) { this._isScheduledReportSent = false; this._timeoutId = global.setTimeout(_fun120987, 300000); } function _fun120987() { // fn#120987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15962:1394, offset: 0x0253c012, size: 96 bytes, params: 1, frame: 14 const binding = env0_0; binding._timeoutId = null; binding.sendReport('timer'); binding._isScheduledReportSent = true; const value = environment.__proto__.__proto__; if ((importDefault(15755) /* metro dependency 15755: NativeJankStatsModule */) != null) { (importDefault(15755) /* metro dependency 15755: NativeJankStatsModule */).stopTracking(); } } } function value_120988(a0) { // fn#120988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15962:1548, offset: 0x0253c072, size: 226 bytes, params: 2, frame: 18 var defaultImport3; var track; var ANDROID_JANK_STATS; var object; let value = environment.__proto__; const value2 = undefined; const r5 = importDefault(dependencyMap[6]) == null ? value2 : importDefault(dependencyMap[6]).requestReport(); if (r5 != null && r5.totalFrameCount !== 0) { defaultImport3 = importDefault(dependencyMap[7]); track = defaultImport3.track; ANDROID_JANK_STATS = AnalyticEvents.ANDROID_JANK_STATS; object = {}; value = require(dependencyMap[8]); copyDataProperties(object, value.getDeviceMetadata(), dependencyMap); object['version'] = 1; object['total_frame_count'] = r5.totalFrameCount; object['jank_frame_count'] = r5.jankFrameCount; object['trigger'] = a0; Reflect.apply(track, defaultImport3, [ANDROID_JANK_STATS, object]); } return value2; } } } global.__d(_fun120975, 15754, [6, 7, 15, 17, 18, 661, 15755, 683, 4884, 4860, 2]) /* metro module 15754, dependencies: [6, 7, 15, 17, 18, 661, 15755, 683, 4884, 4860, 2] */;