/* Metro module 6393; source: unknown; dependencies: [6374, 6375, 6394] */ import ClassCallCheck from './module-06374-ClassCallCheck.js'; /* Metro dependency 6374 */ import CreateClass from './module-06375-CreateClass.js'; /* Metro dependency 6375 */ function _fun50124(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#50124, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6571:6, offset: 0x01211b3e, size: 104 bytes, params: 8, frame: 18 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); exports.default = _fun50125(); function _fun50125() { // fn#50125, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6571:118, offset: 0x01211ba6, size: 147 bytes, params: 1, frame: 15 return CreateClass(ViewabilityHelper_50126, [{key: 'dispose', value: function() { this.timers.forEach(global.clearTimeout); }}, {key: 'updateViewableItems', value: value_50128}, {key: 'checkViewableIndicesChanges', value: function(a0) { var env0_0 = this; var value = a0.filter(_fun50132); var env0_1 = value; var value2 = value.filter(_fun50133); var value3 = this.lastReportedViewableIndices.filter(_fun50134); if (value2.length > 0 || value3.length > 0) { this.lastReportedViewableIndices = value; this.viewableIndicesChanged(value, value2, value3); } }}, {key: 'clearLastReportedViewableIndices', value: function() { this.lastReportedViewableIndices = []; }}, {key: 'isItemViewable', value: value_50136}]); function ViewabilityHelper_50126(a0, a1) { // fn#50126, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6571:139, offset: 0x01211c39, size: 117 bytes, params: 3, frame: 13 const value = environment.__proto__; env1_2(this, ViewabilityHelper_50126); this.possiblyViewableIndices = []; this.hasInteracted = false; this.viewableIndices = []; this.lastReportedViewableIndices = []; const Set = global.Set; this.timers = new Set(); this.viewabilityConfig = a0; this.viewableIndicesChanged = a1; } function value_50128(a0, a1, a2, a3, a4) { // fn#50128, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6571:498, offset: 0x01211ccd, size: 387 bytes, params: 6, frame: 17 var environment; var waitForInteraction; var r5; var value2; var Error; var value5; var multipleViewabilityThresholdTypesNotSupported; const env0_0 = a0; const env0_1 = a1; const env0_2 = a2; const env0_3 = a3; const value = undefined; if (value !== a4) { this.possiblyViewableIndices = a4; } let viewabilityConfig = this.viewabilityConfig; if ((viewabilityConfig == null ? value : viewabilityConfig.itemVisiblePercentThreshold) !== null) { viewabilityConfig = this.viewabilityConfig; if (value === (viewabilityConfig == null ? value : viewabilityConfig.itemVisiblePercentThreshold)) { viewabilityConfig = this.viewabilityConfig; waitForInteraction = viewabilityConfig == null ? value : viewabilityConfig.waitForInteraction; if (waitForInteraction == null) { value2 = this.possiblyViewableIndices.filter(_fun50129); this.viewableIndices = value2; viewabilityConfig = this.viewabilityConfig; r5 = (viewabilityConfig == null ? value : viewabilityConfig.minimumViewTime) ?? 250; if (r5 > 0) { this.timers.add(global.setTimeout(_fun50130, r5)); } else { this.checkViewableIndicesChanges(value2); } } else if (waitForInteraction) { if (this.hasInteracted) { value2 = this.possiblyViewableIndices.filter(_fun50129); this.viewableIndices = value2; viewabilityConfig = this.viewabilityConfig; r5 = (viewabilityConfig == null ? value : viewabilityConfig.minimumViewTime) ?? 250; if (r5 > 0) { this.timers.add(global.setTimeout(_fun50130, r5)); } else { this.checkViewableIndicesChanges(value2); } } } else { value2 = this.possiblyViewableIndices.filter(_fun50129); this.viewableIndices = value2; viewabilityConfig = this.viewabilityConfig; r5 = (viewabilityConfig == null ? value : viewabilityConfig.minimumViewTime) ?? 250; if (r5 > 0) { this.timers.add(global.setTimeout(_fun50130, r5)); } else { this.checkViewableIndicesChanges(value2); } } return value; } viewabilityConfig = this.viewabilityConfig; if ((viewabilityConfig == null ? value : viewabilityConfig.viewAreaCoveragePercentThreshold) === null) { viewabilityConfig = this.viewabilityConfig; waitForInteraction = viewabilityConfig == null ? value : viewabilityConfig.waitForInteraction; if (waitForInteraction == null) { value2 = this.possiblyViewableIndices.filter(_fun50129); this.viewableIndices = value2; viewabilityConfig = this.viewabilityConfig; r5 = (viewabilityConfig == null ? value : viewabilityConfig.minimumViewTime) ?? 250; if (r5 > 0) { this.timers.add(global.setTimeout(_fun50130, r5)); } else { this.checkViewableIndicesChanges(value2); } } else if (waitForInteraction) { if (this.hasInteracted) { value2 = this.possiblyViewableIndices.filter(_fun50129); this.viewableIndices = value2; viewabilityConfig = this.viewabilityConfig; r5 = (viewabilityConfig == null ? value : viewabilityConfig.minimumViewTime) ?? 250; if (r5 > 0) { this.timers.add(global.setTimeout(_fun50130, r5)); } else { this.checkViewableIndicesChanges(value2); } } } else { value2 = this.possiblyViewableIndices.filter(_fun50129); this.viewableIndices = value2; viewabilityConfig = this.viewabilityConfig; r5 = (viewabilityConfig == null ? value : viewabilityConfig.minimumViewTime) ?? 250; if (r5 > 0) { this.timers.add(global.setTimeout(_fun50130, r5)); } else { this.checkViewableIndicesChanges(value2); } } return value; } viewabilityConfig = this.viewabilityConfig; if (value !== (viewabilityConfig == null ? value : viewabilityConfig.viewAreaCoveragePercentThreshold)) { Error = global.Error; value5 = environment.__proto__; multipleViewabilityThresholdTypesNotSupported = (require(6394) /* metro dependency 6394 */).ErrorMessages.multipleViewabilityThresholdTypesNotSupported; throw new Error(); } } viewabilityConfig = this.viewabilityConfig; waitForInteraction = viewabilityConfig == null ? value : viewabilityConfig.waitForInteraction; if (waitForInteraction == null) { value2 = this.possiblyViewableIndices.filter(_fun50129); this.viewableIndices = value2; viewabilityConfig = this.viewabilityConfig; r5 = (viewabilityConfig == null ? value : viewabilityConfig.minimumViewTime) ?? 250; if (r5 > 0) { this.timers.add(global.setTimeout(_fun50130, r5)); } else { this.checkViewableIndicesChanges(value2); } } else if (waitForInteraction) { if (this.hasInteracted) { value2 = this.possiblyViewableIndices.filter(_fun50129); this.viewableIndices = value2; viewabilityConfig = this.viewabilityConfig; r5 = (viewabilityConfig == null ? value : viewabilityConfig.minimumViewTime) ?? 250; if (r5 > 0) { this.timers.add(global.setTimeout(_fun50130, r5)); } else { this.checkViewableIndicesChanges(value2); } } } else { value2 = this.possiblyViewableIndices.filter(_fun50129); this.viewableIndices = value2; viewabilityConfig = this.viewabilityConfig; r5 = (viewabilityConfig == null ? value : viewabilityConfig.minimumViewTime) ?? 250; if (r5 > 0) { this.timers.add(global.setTimeout(_fun50130, r5)); } else { this.checkViewableIndicesChanges(value2); } } return value; function _fun50129(a0) { // fn#50129, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6571:1173, offset: 0x01211e50, size: 104 bytes, params: 2, frame: 25 const binding = env0_4; const isItemViewable = binding.isItemViewable; const binding2 = env0_0; let viewabilityConfig = binding.viewabilityConfig; const value2 = undefined; const viewAreaCoveragePercentThreshold = viewabilityConfig == null ? value2 : viewabilityConfig.viewAreaCoveragePercentThreshold; viewabilityConfig = env0_4.viewabilityConfig; return Reflect.apply(isItemViewable, binding, [a0, binding2, require, importDefault, viewAreaCoveragePercentThreshold, viewabilityConfig == null ? value2 : viewabilityConfig.itemVisiblePercentThreshold, importAll]); } function _fun50130() { // fn#50130, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6571:1499, offset: 0x01211eb8, size: 46 bytes, params: 1, frame: 13 const binding = env0_4; binding.timers.delete(env0_6); binding.checkViewableIndicesChanges(env0_5); } } function value_50131(a0) { // fn#50131, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6571:1671, offset: 0x01211ee6, size: 116 bytes, params: 2, frame: 17 const value = a0.filter(_fun50132); const value2 = value.filter(_fun50133); const value3 = this.lastReportedViewableIndices.filter(_fun50134); if (value2.length > 0 || value3.length > 0) { this.lastReportedViewableIndices = value; this.viewableIndicesChanged(value, value2, value3); } function _fun50132(a0) { // fn#50132, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6571:1734, offset: 0x01211f5a, size: 28 bytes, params: 2, frame: 11 return env0_0.viewableIndices.includes(a0); } function _fun50133(a0) { // fn#50133, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6571:1798, offset: 0x01211f76, size: 31 bytes, params: 2, frame: 11 const lastReportedViewableIndices = env0_0.lastReportedViewableIndices; return !lastReportedViewableIndices.includes(a0); } function _fun50134(a0) { // fn#50134, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6571:1905, offset: 0x01211f95, size: 25 bytes, params: 2, frame: 11 const binding = env0_1; return !binding.includes(a0); } } } } function value_50136(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#50136, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6571:2197, offset: 0x01211fbf, size: 223 bytes, params: 8, frame: 18 const value = exports; const value2 = dependencyMap(global); if (value2 === undefined) { return false; } const value3 = (require ? value2.x : value2.y) - importDefault; let r1 = require ? value2.width : value2.height; const r4 = require ? importAll.width : importAll.height; let Math = global.Math; const value4 = Math.min(value3 + r1, r4); Math = global.Math; const max = Math.max; const value5 = 0; const value6 = value4 - Reflect.apply(max, Math, [value3, value5]); if (value6 === r1) { return true; } if (value5 === value6) { return false; } const value7 = module != null; r1 = value7 ? value6 / r4 : value6 / r1; return r1 >= (value7 ? 0.01 * module : 0.01 * (value ?? value5)); } global.__d(_fun50124, 6393, [6374, 6375, 6394]) /* metro module 6393, dependencies: [6374, 6375, 6394] */;