Files
discord-decomp/sources/modules/gateway/ActionBatcher.tsx
T
2026-07-27 16:20:00 +03:00

199 lines
7.1 KiB
TypeScript

/* Metro module 12504; source: modules/gateway/ActionBatcher.tsx; dependencies: [6, 7, 694, 2] */
function _fun95269(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#95269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12694:6, offset: 0x02137a41, size: 166 bytes, params: 8, frame: 18
const _arrayLikeToArray_95272 = 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 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 */;
let value = _fun95273();
value.batchers = [];
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/gateway/ActionBatcher.tsx');
exports.default = value;
}
function _createForOfIteratorHelperLoose_95270(a0, a1) { // fn#95270, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12694:120, offset: 0x02137ae7, size: 372 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 _fun95271;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_95272(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_95272(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_95272(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun95271;
}
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 _fun95273() { // fn#95273, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12694:1036, offset: 0x02137c5b, size: 85 bytes, params: 1, frame: 16
return env0_3(ActionBatcher, [{key: 'flush', value: value_95276}], [{key: 'flush', value: value_95278}]);
}
function ActionBatcher(a0, a1, a2) { // fn#95274, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12694:1047, offset: 0x02137cb0, size: 95 bytes, params: 4, frame: 14
const env0_1 = a1;
env1_2(this, ActionBatcher);
this.socket = a0;
this.action = null;
this.shouldFlush = a2;
this.add = add_95275;
ActionBatcher.batchers.push(this);
}
function value_95276() { // fn#95276, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12694:1269, offset: 0x02137d32, size: 87 bytes, params: 1, frame: 13
var environment;
var value;
const action = this.action;
this.action = null;
if (action != null) {
value = environment.__proto__;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value = value.dispatch(action);
value.catch(_fun95277);
}
}
function value_95278(a0, a1) { // fn#95278, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12694:1448, offset: 0x02137db9, size: 116 bytes, params: 3, frame: 19
var r2;
var r8;
var r1;
var value3;
var action;
var value4;
var value5;
var shouldFlush2;
var value6;
let value = environment.__proto__;
value = _createForOfIteratorHelperLoose_95270(ActionBatcher.batchers);
const value2 = value();
let done = value2.done;
if (!done) {
r2 = value2;
while (true) {
value3 = r2.value;
action = value3.action;
value4 = action != null;
if (value4) {
value5 = a0 == null;
if (value5) {
r8 = value5;
continue;
}
shouldFlush2 = value3.shouldFlush(a0, a1);
r8 = shouldFlush2;
r1 = r8;
} else {
r1 = value4;
}
if (!r1) {
continue;
}
value3.flush();
value6 = value();
done = value6.done;
if (done) {
break;
}
r2 = value6;
continue;
}
}
}
function ActionBatcherAdd(a0) { // fn#95275, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12694:1158, owner: ActionBatcher.add, offset: 0x02137d0f, size: 35 bytes, params: 2, frame: 14
const binding = env0_0;
binding.action = require(binding.action, a0);
}
function _fun95277(a0) { // fn#95277, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12694:1351, offset: 0x02137d89, size: 48 bytes, params: 2, frame: 13
return env0_0.socket.resetSocketAndClearCacheOnError({error: a0, action: action.type});
}