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

89 lines
3.7 KiB
JavaScript

/* Metro module 4035; source: unknown; dependencies: [4036, 4031] */
import * as Module04031Module from './module-04031.js'; /* Metro dependency 4031 */
function _fun33236(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#33236, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4193:6, offset: 0x0102a7e3, size: 88 bytes, params: 8, frame: 16
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const registerHost = function(a0, a1) {
if (!(a1 in a0)) {
a0[a1] = [];
}
return a0;
};
exports.reducer = reducer;
function removePortal(a0, a1, a2) { // fn#33238, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4193:155, offset: 0x0102a852, size: 186 bytes, params: 4, frame: 22
var index;
const env0_0 = a2;
if (a1 in a0) {
index = a0[a1].findIndex(function({name}) {
return name === importDefault;
});
if (index !== -1) {
a0[a1].splice(index, 1);
}
} else {
var moduleValue = require(4036) /* metro dependency 4036 */;
var print = moduleValue.print;
var object = {};
var name = reducer.name;
object.component = name;
name = removePortal.name;
object.method = name;
object.params = "Failed to remove portal '" + a2 + "', '" + a1 + "' was not registered!";
Reflect.apply(print, moduleValue, [object]);
}
return a0;
}
function reducer(a0, a1) { // fn#33240, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4193:413, offset: 0x0102a90c, size: 271 bytes, params: 3, frame: 20
const type = a1.type;
const Object = global.Object;
const value = Object.assign({}, a0);
const ACTIONS = (Module04031Module).ACTIONS;
const REGISTER_HOST = ACTIONS.REGISTER_HOST;
if (REGISTER_HOST === type) {
registerHost(value, a1.hostName);
return value;
}
const DEREGISTER_HOST = ACTIONS.DEREGISTER_HOST;
if (DEREGISTER_HOST === type) {
delete value[a1.hostName];
return value;
}
const ADD_UPDATE_PORTAL = ACTIONS.ADD_UPDATE_PORTAL;
if (ADD_UPDATE_PORTAL === type) {
addUpdatePortal(value, a1.hostName, a1.portalName, a1.node);
return value;
}
const REMOVE_PORTAL = ACTIONS.REMOVE_PORTAL;
if (REMOVE_PORTAL === type) {
removePortal(value, a1.hostName, a1.portalName);
return value;
}
return a0;
function addUpdatePortal(a0, a1, a2, a3) { // fn#33241, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4193:693, owner: reducer.addUpdatePortal, offset: 0x0102aa1b, size: 113 bytes, params: 5, frame: 17
var environment;
var value;
const env0_0 = a2;
if (!(a1 in a0)) {
value = environment.__proto__;
registerHost(a0, a1);
}
value = a0[a1].findIndex(function({name}) {
return name === importDefault;
});
if (value !== -1) {
a0[a1][value].node = a3;
} else {
a0[a1].push({name: a2, node: a3});
}
return a0;
}
}
}
global.__d(_fun33236, 4035, [4036, 4031]) /* metro module 4035, dependencies: [4036, 4031] */;