Files
2026-07-28 01:06:53 +03:00

91 lines
4.6 KiB
JavaScript

/* Metro module 6379; source: unknown; dependencies: [6374, 6375] */
import ClassCallCheck from './module-06374-ClassCallCheck.js'; /* Metro dependency 6374 */
import CreateClass from './module-06375-CreateClass.js'; /* Metro dependency 6375 */
function _fun49974(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#49974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6557:6, offset: 0x0120e5a7, size: 112 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = _fun49975();
const value2 = _fun49980();
exports.AverageWindow = value;
exports.MultiTypeAverageWindow = value2;
function _fun49975() { // fn#49975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6557:118, offset: 0x0120e617, size: 101 bytes, params: 1, frame: 15
return CreateClass(AverageWindow, [{key: 'currentValue', get: function() {
return this.currentAverage;
}}, {key: 'addValue', value: function(a0) {
var r1;
var value = this.getNextIndex();
var property = this.inputValues[value];
r1 = property === undefined ? this.currentCount + 1 : this.currentCount;
this.inputValues[value] = a0;
this.currentAverage = this.currentAverage * (this.currentCount / r1) + (a0 - (property ?? 0)) / r1;
this.currentCount = r1;
}}, {key: 'getNextIndex', value: function() {
var nextIndex = this.nextIndex;
this.nextIndex = (this.nextIndex + 1) % this.inputValues.length;
return nextIndex;
}}]);
function AverageWindow(a0, a1) { // fn#49976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6557:139, offset: 0x0120e67c, size: 149 bytes, params: 3, frame: 18
const value = a1;
env1_0(this, AverageWindow);
const value4 = 0;
this.nextIndex = value4;
const Array = global.Array;
const Math = global.Math;
const value5 = 1;
const value6 = Math.max(value5, a0);
const value7 = Object.create(Array.prototype, {constructor: {value: Array}});
const array = new Array(value6);
this.inputValues = array instanceof Object ? array : value7;
this.currentAverage = value ?? value4;
this.currentCount = value !== undefined ? value5 : value4;
this.nextIndex = this.currentCount;
this.inputValues[value4] = value;
}
}
function _fun49980() { // fn#49980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6557:854, offset: 0x0120e7c4, size: 101 bytes, params: 1, frame: 15
return CreateClass(MultiTypeAverageWindow, [{key: 'addValue', value: value_49982}, {key: 'getCurrentValue',
value: function(a0) {
var r1;
r1 = this.averageWindows.get(a0)?.currentValue;
r1 = r1 ?? this.defaultValue;
return r1 ?? 0;
}}, {key: 'reset', value: function() {
this.averageWindows.clear();
}}]);
function MultiTypeAverageWindow(a0, a1) { // fn#49981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6557:875, offset: 0x0120e829, size: 79 bytes, params: 3, frame: 13
const value = environment.__proto__;
env1_0(this, MultiTypeAverageWindow);
const Map = global.Map;
this.averageWindows = new Map();
this.windowSize = a0;
this.defaultValue = a1;
}
function value_49982(a0, a1) { // fn#49982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6557:1034, offset: 0x0120e878, size: 96 bytes, params: 3, frame: 15
var r2;
var binding;
var windowSize;
var binding2;
let value = this.averageWindows.get(a1);
if (value) {
r2 = value;
} else {
value = environment.__proto__;
binding = env1_2;
windowSize = this.windowSize;
binding2 = new binding();
this.averageWindows.set(a1, binding2);
r2 = binding2;
}
r2.addValue(a0);
}
}
}
global.__d(_fun49974, 6379, [6374, 6375]) /* metro module 6379, dependencies: [6374, 6375] */;