186 lines
9.9 KiB
JavaScript
186 lines
9.9 KiB
JavaScript
/* Metro module 1494; source: unknown; dependencies: [65, 29, 1495, 1493] */
|
|
import ObjectWithoutProperties from './module-00029-ObjectWithoutProperties.js'; /* Metro dependency 29 */
|
|
import Module00065 from './module-00065.js'; /* Metro dependency 65 */
|
|
import TabActions2 from './module-01495-TabActions.js'; /* Metro dependency 1495 */
|
|
import * as TabActionsModule from './module-01495-TabActions.js'; /* Metro dependency 1495 */
|
|
|
|
function _fun17018(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#17018, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1621:6, offset: 0x00e61ad0, size: 200 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const env0_3 = ['defaultStatus'];
|
|
let Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
Object = global.Object;
|
|
const assign = Object.assign;
|
|
const TabActions = (TabActionsModule).TabActions;
|
|
const value = Reflect.apply(assign, Object, [{}, TabActions, {openDrawer: function() {
|
|
return {type: 'OPEN_DRAWER'};
|
|
}, closeDrawer: function() {
|
|
return {type: 'CLOSE_DRAWER'};
|
|
}, toggleDrawer: function() {
|
|
return {type: 'TOGGLE_DRAWER'};
|
|
}}]);
|
|
exports.default = DrawerRouter;
|
|
exports.DrawerActions = value;
|
|
function DrawerRouter(a0) { // fn#17022, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1621:383, offset: 0x00e61bc2, size: 195 bytes, params: 2, frame: 17
|
|
const defaultStatus = a0.defaultStatus;
|
|
const env0_0 = defaultStatus === undefined ? 'closed' : defaultStatus;
|
|
const value3 = (TabActions2)(ObjectWithoutProperties(a0, env0_3));
|
|
const isDrawerInHistory = function(a0) {
|
|
var Boolean = global.Boolean;
|
|
return Boolean(a0.history?.some(_fun17024));
|
|
};
|
|
const removeDrawerFromHistory = function(a0) {
|
|
var r0;
|
|
var Object;
|
|
var object;
|
|
var value = a0;
|
|
if (isDrawerInHistory(value)) {
|
|
Object = global.Object;
|
|
object = {};
|
|
object.history = value.history.filter(_fun17027);
|
|
value = Object.assign({}, value, object);
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
};
|
|
let Object = global.Object;
|
|
return Object.assign({}, value3, {type: 'drawer', getInitialState: getInitialState_17029,
|
|
getRehydratedState: getRehydratedState, getStateForRouteFocus: getStateForRouteFocus,
|
|
getStateForAction: getStateForAction_17032, actionCreators: env0_6});
|
|
function isDrawerInHistory({history}) { // fn#17023, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1621:478, owner: DrawerRouter.isDrawerInHistory, offset: 0x00e61c85, size: 55 bytes, params: 2, frame: 14
|
|
const Boolean = global.Boolean;
|
|
return Boolean(history?.some(function(a0) {
|
|
return a0.type === 'drawer';
|
|
}));
|
|
}
|
|
|
|
function addDrawerToHistory(a0) { // fn#17025, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1621:607, owner: DrawerRouter.addDrawerToHistory, offset: 0x00e61cce, size: 125 bytes, params: 2, frame: 21
|
|
var r0;
|
|
var Object;
|
|
var assign;
|
|
var items2;
|
|
var concat;
|
|
var value3;
|
|
var value4;
|
|
var value5;
|
|
let value = a0;
|
|
if (isDrawerInHistory(value)) {
|
|
r0 = value;
|
|
} else {
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
items2 = [];
|
|
concat = items2.concat;
|
|
value3 = environment.__proto__;
|
|
value4 = env1_4(value.history);
|
|
value5 = 'open';
|
|
value = Reflect.apply(assign, Object, [{}, value, {history: Reflect.apply(concat, items2, [value4,
|
|
[{type: 'drawer',
|
|
status: value5 !== env0_0 ? value5 : 'closed'}]])}]);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function removeDrawerFromHistory(a0) { // fn#17026, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1621:761, owner: DrawerRouter.removeDrawerFromHistory, offset: 0x00e61d4b, size: 77 bytes, params: 2, frame: 18
|
|
var r0;
|
|
var Object;
|
|
var assign;
|
|
var object;
|
|
let value = a0;
|
|
if (isDrawerInHistory(value)) {
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
object = {};
|
|
object.history = value.history.filter(function(a0) {
|
|
return a0.type !== 'drawer';
|
|
});
|
|
value = Reflect.apply(assign, Object, [{}, value, object]);
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function DrawerRouterCloseDrawer(a0) { // fn#17028, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1621:901, owner: DrawerRouter.closeDrawer, offset: 0x00e61daa, size: 44 bytes, params: 2, frame: 12
|
|
return env0_0 === 'open' ? addDrawerToHistory(a0) : removeDrawerFromHistory(a0);
|
|
}
|
|
|
|
function DrawerRouterGetInitialState({routeNames, routeParamList, routeGetIdList}) { // fn#17029, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1621:1010, owner: DrawerRouter.getInitialState, offset: 0x00e61dd6, size: 165 bytes, params: 2, frame: 18
|
|
const initialState = env0_1.getInitialState({routeNames: routeNames, routeParamList: routeParamList,
|
|
routeGetIdList: routeGetIdList});
|
|
const Object = global.Object;
|
|
const assign = Object.assign;
|
|
object = {'default': null, 'stale': false, 'type': 'drawer'};
|
|
object.default = env0_0;
|
|
let value = environment.__proto__;
|
|
value = require(1493) /* metro dependency 1493 */;
|
|
value = value.nanoid();
|
|
object.key = 'drawer-' + value;
|
|
return Reflect.apply(assign, Object, [{}, initialState, object]);
|
|
}
|
|
|
|
function DrawerRouterGetRehydratedState(a0, {routeNames, routeParamList, routeGetIdList}) { // fn#17030, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1621:1280, owner: DrawerRouter.getRehydratedState, offset: 0x00e61e7b, size: 213 bytes, params: 3, frame: 20
|
|
if (a0.stale === false) {
|
|
return a0;
|
|
}
|
|
const rehydratedState = env0_1.getRehydratedState(a0, {routeNames: routeNames, routeParamList: routeParamList,
|
|
routeGetIdList: routeGetIdList});
|
|
const r5 = isDrawerInHistory(a0) ? addDrawerToHistory(removeDrawerFromHistory(rehydratedState)) : rehydratedState;
|
|
const Object = global.Object;
|
|
const assign = Object.assign;
|
|
object = {default: env0_0, type: 'drawer'};
|
|
let value = environment.__proto__;
|
|
value = require(1493) /* metro dependency 1493 */;
|
|
value = value.nanoid();
|
|
object.key = 'drawer-' + value;
|
|
return Reflect.apply(assign, Object, [{}, r5, object]);
|
|
}
|
|
|
|
function DrawerRouterGetStateForRouteFocus(a0, a1) { // fn#17031, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1621:1605, owner: DrawerRouter.getStateForRouteFocus, offset: 0x00e61f50, size: 38 bytes, params: 3, frame: 14
|
|
return DrawerRouterCloseDrawer(env0_1.getStateForRouteFocus(a0, a1));
|
|
}
|
|
|
|
function DrawerRouterGetStateForAction(a0, a1, a2) { // fn#17032, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1621:1707, owner: DrawerRouter.getStateForAction, offset: 0x00e61f76, size: 307 bytes, params: 4, frame: 17
|
|
var stateForAction;
|
|
const type = a1.type;
|
|
if (type === 'OPEN_DRAWER') {
|
|
return env0_0 === 'open' ? removeDrawerFromHistory(a0) : addDrawerToHistory(a0);
|
|
}
|
|
if (type === 'CLOSE_DRAWER') {
|
|
return DrawerRouterCloseDrawer(a0);
|
|
}
|
|
if (type === 'TOGGLE_DRAWER') {
|
|
return isDrawerInHistory(a0) ? removeDrawerFromHistory(a0) : addDrawerToHistory(a0);
|
|
}
|
|
if (type === 'JUMP_TO') {
|
|
stateForAction = env0_1.getStateForAction(a0, a1, a2);
|
|
return stateForAction == null || stateForAction.index === a0.index ? stateForAction : DrawerRouterCloseDrawer(stateForAction);
|
|
}
|
|
if (type === 'NAVIGATE') {
|
|
stateForAction = env0_1.getStateForAction(a0, a1, a2);
|
|
return stateForAction == null || stateForAction.index === a0.index ? stateForAction : DrawerRouterCloseDrawer(stateForAction);
|
|
}
|
|
if (type === 'GO_BACK') {
|
|
return isDrawerInHistory(a0) ? removeDrawerFromHistory(a0) : env0_1.getStateForAction(a0, a1, a2);
|
|
}
|
|
return env0_1.getStateForAction(a0, a1, a2);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun17024({type}) { // fn#17024, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1621:564, offset: 0x00e61cbc, size: 18 bytes, params: 2, frame: 2
|
|
return type === 'drawer';
|
|
}
|
|
|
|
function _fun17027({type}) { // fn#17027, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1621:855, offset: 0x00e61d98, size: 18 bytes, params: 2, frame: 2
|
|
return type !== 'drawer';
|
|
}
|
|
|
|
global.__d(_fun17018, 1494, [65, 29, 1495, 1493]) /* metro module 1494, dependencies: [65, 29, 1495, 1493] */;
|