decord/source/1467_getRouteHistory.js

338 lines
11 KiB
JavaScript
Raw Normal View History

2026-07-20 16:05:17 +00:00
// Module ID: 1467
2026-07-25 08:10:48 +00:00
// Function ID: 17037
2026-07-20 16:05:17 +00:00
// Name: getRouteHistory
2026-07-23 10:11:24 +00:00
// Dependencies: [1464, 1465]
2026-07-20 16:05:17 +00:00
// Module 1467 (getRouteHistory)
2026-07-23 10:11:24 +00:00
const require = arg1;
const module = arg2;
let dependencyMap = arg6;
let obj = {
2026-07-20 16:05:17 +00:00
jumpTo(name, params) {
const payload = { name, params };
return { type: "JUMP_TO", payload };
}
};
function getRouteHistory(routes, index, arg2, arg3) {
let diff = index;
2026-07-23 10:11:24 +00:00
let closure_0 = arg3;
2026-07-20 16:05:17 +00:00
let obj = { type: "route", key: routes[index].key };
const items = [obj];
if ("order" === arg2) {
if (diff > 0) {
do {
obj = { type: "route", key: routes[diff - 1].key };
let arr = items.unshift(obj);
diff = diff - 1;
} while (diff > 0);
}
} else if ("firstRoute" === arg2) {
if (0 !== diff) {
obj = { type: "route", key: routes[0].key };
items.unshift(obj);
}
} else if ("initialRoute" === arg2) {
2026-07-23 10:11:24 +00:00
const findIndexResult = routes.findIndex((name) => name.name === closure_0);
2026-07-20 16:05:17 +00:00
let num = 0;
if (-1 !== findIndexResult) {
num = findIndexResult;
}
if (diff !== num) {
const obj1 = { type: "route", key: routes[num].key };
items.unshift(obj1);
}
}
return items;
}
function changeIndex(history, index) {
if ("history" === arg2) {
2026-07-23 10:11:24 +00:00
const key = history.routes[index].key;
2026-07-20 16:05:17 +00:00
history = history.history;
const found = history.filter((type) => {
let tmp = "route" === type.type;
if (tmp) {
tmp = type.key !== key;
}
return tmp;
});
2026-07-23 10:11:24 +00:00
let obj = { type: "route", key };
2026-07-20 16:05:17 +00:00
let combined = found.concat(obj);
} else {
combined = getRouteHistory(history.routes, index, arg2, arg3);
}
obj = { index, history: combined };
return Object.assign({}, history, obj);
}
arg5.default = function TabRouter(arg0) {
let backBehavior;
2026-07-23 10:11:24 +00:00
let require;
({ initialRouteName: require, backBehavior } = arg0);
2026-07-20 16:05:17 +00:00
let str = "firstRoute";
if (undefined !== backBehavior) {
str = backBehavior;
}
2026-07-23 10:11:24 +00:00
obj = {
2026-07-20 16:05:17 +00:00
type: "tab",
getInitialState(arg0) {
2026-07-23 10:11:24 +00:00
let closure_0;
2026-07-20 16:05:17 +00:00
let routeNames;
({ routeNames, routeParamList: closure_0 } = arg0);
let num = 0;
2026-07-23 10:11:24 +00:00
if (undefined !== closure_0) {
2026-07-20 16:05:17 +00:00
num = 0;
2026-07-23 10:11:24 +00:00
if (routeNames.includes(closure_0)) {
num = routeNames.indexOf(closure_0);
2026-07-20 16:05:17 +00:00
}
}
const mapped = routeNames.map((name) => {
2026-07-23 10:11:24 +00:00
const obj = { name, key: "" + name + "-" + outer2_0(outer2_2[1]).nanoid(), params: table[name] };
2026-07-20 16:05:17 +00:00
return obj;
});
2026-07-23 10:11:24 +00:00
let obj = { stale: false, type: "tab" };
const tmp4 = outer1_4(mapped, num, str, closure_0);
obj.key = "tab-" + outer1_0(outer1_2[1]).nanoid();
2026-07-20 16:05:17 +00:00
obj.index = num;
obj.routeNames = routeNames;
obj.history = tmp4;
obj.routes = mapped;
return obj;
},
getRehydratedState(stale) {
2026-07-23 10:11:24 +00:00
let closure_0;
2026-07-20 16:05:17 +00:00
let routeNames;
({ routeNames, routeParamList: closure_0 } = arg1);
2026-07-23 10:11:24 +00:00
let closure_1 = stale;
2026-07-20 16:05:17 +00:00
if (false === stale.stale) {
return stale;
} else {
const mapped = routeNames.map((name) => {
2026-07-23 10:11:24 +00:00
const dependencyMap = name;
const routes = stale.routes;
const found = routes.find((name) => name.name === closure_0);
2026-07-20 16:05:17 +00:00
const obj = { name };
if (found) {
if (found.name === name) {
if (found.key) {
let key = found.key;
}
obj.key = key;
2026-07-23 10:11:24 +00:00
if (undefined !== dependencyMap[name]) {
2026-07-20 16:05:17 +00:00
let params;
if (found) {
params = found.params;
}
2026-07-23 10:11:24 +00:00
params = Object.assign({}, dependencyMap[name], params);
2026-07-20 16:05:17 +00:00
} else if (found) {
params = found.params;
}
obj.params = params;
return tmp3({}, found, obj);
}
}
2026-07-23 10:11:24 +00:00
key = "" + name + "-" + outer2_0(outer2_2[1]).nanoid();
2026-07-20 16:05:17 +00:00
});
let index;
if (null != stale) {
index = stale.index;
}
let num2 = 0;
if (null != index) {
num2 = index;
}
let name;
if (null != stale.routes[num2]) {
name = tmp2.name;
}
const bound = Math.min(Math.max(routeNames.indexOf(name), 0), mapped.length - 1);
const history = stale.history;
let found;
if (null != history) {
2026-07-23 10:11:24 +00:00
found = history.filter((arg0) => {
let closure_0 = arg0;
return mapped.find((key) => key.key === key.key);
});
2026-07-20 16:05:17 +00:00
}
if (null == found) {
found = [];
}
2026-07-23 10:11:24 +00:00
let obj = { stale: false, type: "tab" };
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
2026-07-23 10:11:24 +00:00
obj.key = "tab-" + outer1_0(outer1_2[1]).nanoid();
2026-07-20 16:05:17 +00:00
obj.index = bound;
obj.routeNames = routeNames;
obj.history = found;
obj.routes = mapped;
2026-07-23 10:11:24 +00:00
return outer1_5(obj, bound, closure_1, closure_0);
2026-07-20 16:05:17 +00:00
}
},
getStateForRouteNamesChange(history) {
2026-07-23 10:11:24 +00:00
let closure_2;
2026-07-20 16:05:17 +00:00
let routeNames;
2026-07-23 10:11:24 +00:00
let str;
let closure_0 = history;
({ routeNames, routeParamList: str, routeKeyChanges: closure_2 } = arg1);
2026-07-20 16:05:17 +00:00
const mapped = routeNames.map((name) => {
2026-07-23 10:11:24 +00:00
const history = name;
const routes = history.routes;
2026-07-20 16:05:17 +00:00
let found = routes.find((name) => {
2026-07-23 10:11:24 +00:00
let tmp = name.name === closure_0;
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = !outer1_2.includes(name.name);
2026-07-20 16:05:17 +00:00
}
return tmp;
});
if (!found) {
const obj = { name };
const _HermesInternal = HermesInternal;
2026-07-23 10:11:24 +00:00
obj.key = "" + name + "-" + outer2_0(outer2_2[1]).nanoid();
obj.params = table[name];
2026-07-20 16:05:17 +00:00
found = obj;
2026-07-23 10:11:24 +00:00
const obj2 = outer2_0(outer2_2[1]);
2026-07-20 16:05:17 +00:00
}
return found;
});
const bound = Math.max(0, routeNames.indexOf(history.routes[history.index].name));
history = history.history;
2026-07-23 10:11:24 +00:00
let found = history.filter((type) => {
let closure_0 = type;
2026-07-20 16:05:17 +00:00
let found = "route" !== type.type;
if (!found) {
2026-07-23 10:11:24 +00:00
found = mapped.find((key) => key.key === type.key);
2026-07-20 16:05:17 +00:00
}
return found;
});
let tmp3 = found;
if (!found.length) {
2026-07-23 10:11:24 +00:00
tmp3 = outer1_4(mapped, bound, str, closure_0);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let obj = { history: tmp3, routeNames, routes: mapped, index: bound };
2026-07-20 16:05:17 +00:00
return Object.assign({}, history, obj);
},
getStateForRouteFocus(routes) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg1;
2026-07-20 16:05:17 +00:00
routes = routes.routes;
2026-07-23 10:11:24 +00:00
const findIndexResult = routes.findIndex((key) => key.key === closure_0);
2026-07-20 16:05:17 +00:00
let tmp2 = routes;
if (-1 !== findIndexResult) {
tmp2 = routes;
if (findIndexResult !== routes.index) {
2026-07-23 10:11:24 +00:00
tmp2 = outer1_5(routes, findIndexResult, str, closure_0);
2026-07-20 16:05:17 +00:00
}
}
return tmp2;
},
getStateForAction(history, type) {
2026-07-23 10:11:24 +00:00
let closure_2;
let str;
let closure_0 = type;
({ routeParamList: str, routeGetIdList: closure_2 } = arg2);
2026-07-20 16:05:17 +00:00
type = type.type;
if ("JUMP_TO" !== type) {
if ("NAVIGATE" !== type) {
if ("GO_BACK" === type) {
if (1 === history.history.length) {
return null;
} else {
const routes3 = history.routes;
const findIndexResult = routes3.findIndex((key) => key.key === key);
let merged = null;
if (-1 !== findIndexResult) {
2026-07-23 10:11:24 +00:00
let _Object = Object;
2026-07-20 16:05:17 +00:00
let obj = {};
history = history.history;
obj.history = history.slice(0, -1);
obj.index = findIndexResult;
merged = Object.assign({}, history, obj);
}
return merged;
}
} else {
2026-07-23 10:11:24 +00:00
obj = str(outer1_2[0]);
2026-07-20 16:05:17 +00:00
return obj.getStateForAction(history, type);
}
}
}
let findIndexResult1 = -1;
if ("NAVIGATE" === type.type) {
if (type.payload.key) {
const routes2 = history.routes;
2026-07-23 10:11:24 +00:00
findIndexResult1 = routes2.findIndex((key) => key.key === type.payload.key);
2026-07-20 16:05:17 +00:00
}
let tmp7 = null;
if (-1 !== findIndexResult1) {
2026-07-23 10:11:24 +00:00
let _Object2 = Object;
2026-07-20 16:05:17 +00:00
obj = {};
let routes = history.routes;
2026-07-23 10:11:24 +00:00
obj.routes = routes.map((params) => {
if (arg1 !== findIndexResult1) {
2026-07-20 16:05:17 +00:00
return params;
} else {
let tmp;
2026-07-23 10:11:24 +00:00
if (null != table[params.name]) {
2026-07-20 16:05:17 +00:00
let obj = { params: params.params };
tmp = tmp27(obj);
}
let tmp2;
2026-07-23 10:11:24 +00:00
if (null != table[params.name]) {
obj = { params: type.payload.params };
2026-07-20 16:05:17 +00:00
tmp2 = tmp27(obj);
}
if (tmp === tmp2) {
let key = params.key;
} else {
const _HermesInternal = HermesInternal;
2026-07-23 10:11:24 +00:00
key = "" + params.name + "-" + outer2_0(outer2_2[1]).nanoid();
const obj3 = outer2_0(outer2_2[1]);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ("NAVIGATE" === type.type) {
if (type.payload.merge) {
2026-07-20 16:05:17 +00:00
if (tmp4) {
2026-07-23 10:11:24 +00:00
if (undefined === type.payload.params) {
if (undefined === dependencyMap[params.name]) {
2026-07-20 16:05:17 +00:00
let params2 = params.params;
}
}
const _Object2 = Object;
const _Object3 = Object;
2026-07-23 10:11:24 +00:00
params2 = Object.assign({}, dependencyMap[params.name], params.params, type.payload.params);
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-23 10:11:24 +00:00
if (undefined !== dependencyMap[params.name]) {
2026-07-20 16:05:17 +00:00
const _Object = Object;
2026-07-23 10:11:24 +00:00
params = Object.assign({}, dependencyMap[params.name], type.payload.params);
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
params = type.payload.params;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ("NAVIGATE" === type.type) {
if (null != type.payload.path) {
let path = type.payload.path;
2026-07-20 16:05:17 +00:00
}
if (params !== params.params) {
const _Object4 = Object;
obj = { key, path, params };
let merged = Object.assign({}, params, obj);
} else {
merged = params;
}
return merged;
}
path = params.path;
}
});
2026-07-23 10:11:24 +00:00
tmp7 = outer1_5(Object.assign({}, history, obj), findIndexResult1, str, closure_0);
2026-07-20 16:05:17 +00:00
}
return tmp7;
}
routes = history.routes;
2026-07-23 10:11:24 +00:00
findIndexResult1 = routes.findIndex((name) => name.name === type.payload.name);
2026-07-20 16:05:17 +00:00
},
shouldActionChangeFocus(type) {
return "NAVIGATE" === type.type;
},
actionCreators: obj
};
2026-07-23 10:11:24 +00:00
return Object.assign({}, str(1464), obj);
2026-07-20 16:05:17 +00:00
};
arg5.TabActions = obj;