/* Metro module 4878; source: modules/app_analytics/clickstream/Clickstream.tsx; dependencies: [57, 1226, 4294, 21, 683, 4879, 2] */ import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */ import AuthenticationStore from '../../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */ import RTCConnectionStore from '../../../stores/RTCConnectionStore.tsx'; /* Metro dependency 4294 */ import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ function _fun42756(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#42756, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5056:6, offset: 0x01141949, size: 230 bytes, params: 8, frame: 21 const env0_0 = require; const _arrayLikeToArray_42759 = function(a0, a1) { var r0; var r1; var r2; var value3; var length; var value5; var value = undefined; var value2 = value == null; reducibleJoin2: while (true) { if (value2) { r0 = value2; break reducibleJoin2; } value3 = value > a0.length; r0 = value3; break reducibleJoin2; } reducibleJoin4: while (true) { if (r0) { length = a0.length; r1 = length; break reducibleJoin4; } r1 = value; break reducibleJoin4; } value = (0, global.Array)(r1); var value4 = 0; if (value4 < r1) { r2 = value4; reducibleLoop5: while (true) { value[r2] = a0[r2]; value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1; if (value5 < r1) { r2 = value5; continue reducibleLoop5; } break reducibleLoop5; } } return value; }; const drainClickstream2 = drainClickstream; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const Map = global.Map; const map = new Map(); (FileImportTrackerModule).fileFinishedImporting('modules/app_analytics/clickstream/Clickstream.tsx'); exports.trackClickstream = trackClickstream; exports.drainClickstream = drainClickstream2; function _createForOfIteratorHelperLoose_42757(a0, a1) { // fn#42757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5056:130, offset: 0x01141a2f, size: 370 bytes, params: 3, frame: 20 var r6; var r9; var r5; var value3; var regexp; const env0_0 = a0; const Symbol = global.Symbol; let value = typeof Symbol !== 'undefined'; let r1 = value && a0[global.Symbol.iterator]; r1 = !r1 ? a0['@@iterator'] : r1; if (r1) { value = r1.call(a0); return value.next.bind(value); } const Array = global.Array; if (Array.isArray(a0)) { if (r1) { } return _fun42758; } value = undefined; if (a0) { if (typeof a0 === 'string') { value = _arrayLikeToArray_42759(a0, value); r5 = value; } else { value3 = ({}).toString.call(a0).slice(8, -1); r6 = value3 === 'Object' && a0.constructor; r9 = r6 ? a0.constructor.name : value3; if (r9 === 'Map') { r6 = global.Array.from(a0); } else if (r9 === 'Set') { r6 = global.Array.from(a0); } else if (r9 === 'Arguments') { value = _arrayLikeToArray_42759(a0, value); r6 = value; } else { regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', ''); if (regexp.test(r9)) { value = _arrayLikeToArray_42759(a0, value); r6 = value; } else { r6 = value; } } r5 = r6; } } else { r5 = value; } if (r5) { if (r5) { } return _fun42758; } const TypeError = global.TypeError; throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'); function _fun42758() { // fn#42758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5056:701, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5 return env0_1 >= env0_0.length ? {done: true} : {done: false, value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]}; } } function isClickstreamEnabled() { // fn#42760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5056:1059, offset: 0x01141ba1, size: 107 bytes, params: 1, frame: 14 var defaultImport; var extractTimestamp; var authenticationStoreBinding; var value2; const value = a0; if (!(value !== undefined) || value) { defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */; extractTimestamp = defaultImport.extractTimestamp; authenticationStoreBinding = AuthenticationStore; value2 = Reflect.apply(extractTimestamp, defaultImport, [authenticationStoreBinding.getId()]); if (value2 !== env0_7) { drainClickstream(false); env0_7 = value2; } } return env0_7 % 10 === 0; } function drainClickstream() { // fn#42761, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5056:1192, offset: 0x01141c0c, size: 191 bytes, params: 1, frame: 24 var r3; var value2; var value3; var done; var value4; var value5; var property; var property2; var defaultImport; var track; var moduleValue; var getClickstreamDrainEvent; var value6; let value = a0; reducibleJoin2: while (true) { if (value !== undefined) { r3 = value; break reducibleJoin2; } value = true; r3 = value; break reducibleJoin2; } if (isClickstreamEnabled(r3)) { value2 = _createForOfIteratorHelperLoose_42757(env0_6); value3 = value2(); done = value3.done; if (!done) { r3 = value3; reducibleLoop5: while (true) { value4 = r3.value; value5 = Module00057(value4, 2); property = value5[0]; property2 = value5[1]; defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */; track = defaultImport.track; moduleValue = require(4879) /* metro dependency 4879: ClickstreamEvents */; getClickstreamDrainEvent = moduleValue.getClickstreamDrainEvent; Reflect.apply(track, defaultImport, [property, Reflect.apply(getClickstreamDrainEvent, moduleValue, [property, property2])]); value6 = value2(); done = value6.done; if (done) { break reducibleLoop5; } r3 = value6; continue reducibleLoop5; } } env0_6.clear(); } else { env0_6.clear(); } } function trackClickstream(a0, a1) { // fn#42762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5056:1537, offset: 0x01141ccb, size: 154 bytes, params: 3, frame: 16 var binding; var value2; var push; var object; var Date; var value3; var date; if (isClickstreamEnabled()) { binding = env0_6; if (!binding.has(a0)) { env0_6.set(a0, []); } binding = env0_6; value2 = binding.get(a0); if (value2 != null) { push = value2.push; object = {}; Date = global.Date; value3 = Object.create(Date.prototype, {constructor: {value: Date}}); date = new Date(); object.timestamp = date instanceof Object ? date : value3; object.rtc_state = RTCConnectionStore.getState(); copyDataProperties(object, a1, value3); Reflect.apply(push, value2, [object]); } } } } global.__d(_fun42756, 4878, [57, 1226, 4294, 21, 683, 4879, 2]) /* metro module 4878, dependencies: [57, 1226, 4294, 21, 683, 4879, 2] */;