153 lines
8.1 KiB
TypeScript
153 lines
8.1 KiB
TypeScript
/* Metro module 1219; source: modules/telemetry_ring/native/TelemetryRingLifecycle.tsx; dependencies: [6, 7, 15, 17, 18, 1220, 1878, 7030, 661, 12833, 12835, 5256, 694, 4561, 2] */
|
|
function _fun13567(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#13567, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1346:6, offset: 0x00def12a, size: 292 bytes, params: 8, frame: 19
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_3 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_4 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_5 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_6 = importDefault(18) /* metro dependency 18 */;
|
|
const apexExperimentStore = importDefault(1220) /* metro dependency 1220: ApexExperimentStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const appStateStore = importDefault(7030) /* metro dependency 7030: AppStateStore */;
|
|
const env0_10 = (require(661) /* metro dependency 661: Constants */).AppStates;
|
|
let value = importDefault(4561) /* metro dependency 4561: LifecycleManager */;
|
|
value = _fun13571(value);
|
|
value = new value();
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/telemetry_ring/native/TelemetryRingLifecycle.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_13568() { // fn#13568, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1346:198, offset: 0x00def24e, size: 94 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_13568_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun13571(a0) { // fn#13571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1346:401, offset: 0x00def2ac, size: 114 bytes, params: 2, frame: 16
|
|
const closure = TelemetryRingLifecycleImpl;
|
|
env0_6(closure, a0);
|
|
return env0_3(closure, [{key: '_updateZoomedInExport', value: value_13575}, {key: '_initialize',
|
|
value: value_13576}, {key: '_terminate', value: value_13578}]);
|
|
}
|
|
|
|
function TelemetryRingLifecycleImpl(a0) { // fn#13572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1346:413, offset: 0x00def31e, size: 170 bytes, params: 2, frame: 20
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let binding = env1_2;
|
|
binding(this, TelemetryRingLifecycleImpl);
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, items2);
|
|
value = env1_5(TelemetryRingLifecycleImpl);
|
|
binding = env1_4;
|
|
if (_isNativeReflectConstruct_13568()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value, items2, env1_5(this).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value.apply(this, items2);
|
|
r0 = value;
|
|
}
|
|
value = binding(this, r0);
|
|
value._initialized = false;
|
|
value._experimentUnsubscribe = null;
|
|
value._handleEligibilityChange = _handleEligibilityChange;
|
|
value._handleLogout = _handleLogout;
|
|
return value;
|
|
}
|
|
|
|
function value_13575() { // fn#13575, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1346:945, offset: 0x00def418, size: 176 bytes, params: 1, frame: 14
|
|
const value = environment.__proto__;
|
|
const state = AppStateStore.getState();
|
|
let ACTIVE = AppStates.ACTIVE;
|
|
(importDefault(5256) /* metro dependency 5256: ProcessUtilsNative */).setShouldCollectHermesInstrumentedStats(state === ACTIVE && (importDefault(12835) /* metro dependency 12835: ZoomedInTelemetry */).shouldRun());
|
|
ACTIVE = AppStates.ACTIVE;
|
|
if (state === ACTIVE) {
|
|
(importDefault(12835) /* metro dependency 12835: ZoomedInTelemetry */).start();
|
|
} else {
|
|
(importDefault(12835) /* metro dependency 12835: ZoomedInTelemetry */).stop();
|
|
}
|
|
}
|
|
|
|
function value_13576() { // fn#13576, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1346:1137, offset: 0x00def4c8, size: 186 bytes, params: 1, frame: 19
|
|
var environment;
|
|
var value;
|
|
var defaultImport;
|
|
var addChangeListener;
|
|
var _handleEligibilityChange;
|
|
if (!this._initialized) {
|
|
this._initialized = true;
|
|
value = environment.__proto__;
|
|
defaultImport = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
defaultImport.subscribe('LOGOUT', this._handleLogout);
|
|
addChangeListener = AppStateStore.addChangeListener;
|
|
_handleEligibilityChange = this._handleEligibilityChange;
|
|
Reflect.apply(addChangeListener, AppStateStore, [_handleEligibilityChange]);
|
|
addChangeListener = UserStore.addChangeListener;
|
|
_handleEligibilityChange = this._handleEligibilityChange;
|
|
Reflect.apply(addChangeListener, UserStore, [_handleEligibilityChange]);
|
|
addChangeListener = ApexExperimentStore.addChangeListener;
|
|
_handleEligibilityChange = this._handleEligibilityChange;
|
|
Reflect.apply(addChangeListener, ApexExperimentStore, [_handleEligibilityChange]);
|
|
this._experimentUnsubscribe = _experimentUnsubscribe;
|
|
value = importDefault(12835) /* metro dependency 12835: ZoomedInTelemetry */;
|
|
value.initialize();
|
|
this._updateZoomedInExport();
|
|
}
|
|
}
|
|
|
|
function value_13578() { // fn#13578, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1346:1556, offset: 0x00def5a5, size: 183 bytes, params: 1, frame: 16
|
|
const value = environment.__proto__;
|
|
const defaultImport = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
defaultImport.unsubscribe('LOGOUT', this._handleLogout);
|
|
AppStateStore.removeChangeListener(this._handleEligibilityChange);
|
|
UserStore.removeChangeListener(this._handleEligibilityChange);
|
|
if (this._experimentUnsubscribe != null) {
|
|
this._experimentUnsubscribe();
|
|
this._experimentUnsubscribe = null;
|
|
}
|
|
(importDefault(12835) /* metro dependency 12835: ZoomedInTelemetry */).stop();
|
|
(importDefault(5256) /* metro dependency 5256: ProcessUtilsNative */).setShouldCollectHermesInstrumentedStats(false);
|
|
this._initialized = false;
|
|
}
|
|
|
|
function _handleEligibilityChange() { // fn#13573, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1346:752, owner: TelemetryRingLifecycleImpl._handleEligibilityChange, offset: 0x00def3c8, size: 21 bytes, params: 1, frame: 9
|
|
env0_0._updateZoomedInExport();
|
|
}
|
|
|
|
function TelemetryRingLifecycleImpl_handleLogout() { // fn#13574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1346:800, owner: TelemetryRingLifecycleImpl._handleLogout, offset: 0x00def3dd, size: 59 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__.__proto__;
|
|
(importDefault(12833) /* metro dependency 12833: TelemetryRingNativeAndroid */).clear();
|
|
(importDefault(12835) /* metro dependency 12835: ZoomedInTelemetry */).reset();
|
|
}
|
|
|
|
function value_13576_experimentUnsubscribe() { // fn#13577, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1346:1418, owner: value_13576._experimentUnsubscribe, offset: 0x00def582, size: 35 bytes, params: 1, frame: 11
|
|
ApexExperimentStore.removeChangeListener(env0_0._handleEligibilityChange);
|
|
}
|
|
|