/* Metro module 9494; source: modules/quests/EarnedDecisionRoundtripTracker.tsx; dependencies: [6, 7, 4401, 661, 4873, 683, 7071, 4876, 2] */ function _fun74105(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74105, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9680:6, offset: 0x01d80ac7, size: 207 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_3 = importDefault(6) /* metro dependency 6 */; const env0_4 = importDefault(7) /* metro dependency 7 */; const networkStore = importDefault(4401) /* metro dependency 4401: NetworkStore */; const env0_6 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents; let value = _fun74107(); value = new value(); (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/EarnedDecisionRoundtripTracker.tsx'); exports.default = value; } function trackRoundtrip_74106(a0) { // fn#74106, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9680:151, offset: 0x01d80b96, size: 355 bytes, params: 2, frame: 22 var r10; var apiResponseTimestamp; var signalStrength; var defaultImport; var track; var EARNED_DECISION_ROUNDTRIP; var object2; const Math = global.Math; let value = Math.random(); if (!(value > 0.1)) { apiResponseTimestamp = a0.apiResponseTimestamp; value = null; r10 = value == apiResponseTimestamp ? value : a0.apiResponseTimestamp - a0.initialSendTimestamp; signalStrength = require(dependencyMap[4]).getSignalStrength(); defaultImport = importDefault(dependencyMap[5]); track = defaultImport.track; EARNED_DECISION_ROUNDTRIP = AnalyticEvents.EARNED_DECISION_ROUNDTRIP; object2 = {}; copyDataProperties(object2, importDefault(dependencyMap[6])(), dependencyMap); object2['endpoint'] = a0.endpoint; object2['was_successful'] = a0.wasSuccessful; object2['api_latency_ms'] = r10; object2['mobile_network_type'] = NetworkStore.getType(); value = value != signalStrength; copyDataProperties(object2, value && ({mobile_signal_strength_level: signalStrength}), dependencyMap); object2['caller_source'] = a0.callerSource; object2['request_id'] = a0.requestId; object2['fetched_at'] = a0.fetchedAt; value = require(dependencyMap[7]); value = value.isForegrounded(); object2['is_foregrounded'] = value; Reflect.apply(track, defaultImport, [EARNED_DECISION_ROUNDTRIP, object2]); } } function _fun74107() { // fn#74107, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9680:648, offset: 0x01d80cf9, size: 86 bytes, params: 1, frame: 15 return env0_4(EarnedDecisionRoundtripTracker, [{key: 'recordEarnedRequestAttempt', value: function(a0, a1) { var env0_0 = this; var env0_1 = a0; var object = {'initialSendTimestamp': null, 'endpoint': '/quests/earned-decision', 'apiResponseTimestamp': null, 'wasSuccessful': false, 'callerSource': null, 'requestId': null, 'fetchedAt': null}; object.initialSendTimestamp = global.Date.now(); object.callerSource = a1; this.pendingRequests.set(a0, object); global.setTimeout(_fun74110, 30000); }}, {key: 'recordEarnedRequestApiResponse', value: value_74111}]); } function value_74109(a0, a1) { // fn#74109, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9680:822, offset: 0x01d80d4f, size: 108 bytes, params: 3, frame: 16 const env0_1 = a0; const object2 = {'initialSendTimestamp': null, 'endpoint': '/quests/earned-decision', 'apiResponseTimestamp': null, 'wasSuccessful': false, 'callerSource': null, 'requestId': null, 'fetchedAt': null}; const Date = global.Date; object2.initialSendTimestamp = Date.now(); object2.callerSource = a1; this.pendingRequests.set(a0, object2); global.setTimeout(_fun74110, 30000); } function value_74111(a0, {wasSuccessful, requestId, fetchedAt}) { // fn#74111, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9680:1193, offset: 0x01d80e06, size: 158 bytes, params: 3, frame: 19 var value2; var trackRoundtrip_74106Binding; var object2; requestId = requestId === undefined ? null : requestId; fetchedAt = fetchedAt === undefined ? null : fetchedAt; let value = this.pendingRequests.get(a0); if (value != null) { value2 = environment.__proto__; trackRoundtrip_74106Binding = trackRoundtrip_74106; object2 = {}; copyDataProperties(object2, value, undefined); value = global.Date.now(); object2['apiResponseTimestamp'] = value; object2['wasSuccessful'] = wasSuccessful; object2['requestId'] = requestId; object2['fetchedAt'] = fetchedAt; trackRoundtrip_74106Binding(object2); this.pendingRequests.delete(a0); } } function _fun74110() { // fn#74110, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9680:1041, offset: 0x01d80dbb, size: 75 bytes, params: 1, frame: 12 var value3; const value2 = env0_0.pendingRequests.get(env0_1); if (value2 != null) { value3 = environment.__proto__.__proto__; trackRoundtrip_74106(value2); env0_0.pendingRequests.delete(env0_1); } }