decord/source/modules/activities/useActivityShelfData.tsx

117 lines
4 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 11623
// Function ID: 11624
2026-07-20 16:05:17 +00:00
// Name: useActivityShelfData
2026-08-25 06:04:03 +00:00
// Dependencies: [19, 1922, 7734, 1390, 589, 5840, 1370, 10691, 500, 9689, 2]
2026-07-20 16:05:17 +00:00
// Exports: useActivityShelfData
2026-08-25 06:04:03 +00:00
// Module 11623 (useActivityShelfData)
2026-08-24 06:08:38 +00:00
import closure_3 from "noop" /* 19 */;
import closure_4 from "mergeGuildAvatar" /* 1922 */;
2026-08-25 06:04:03 +00:00
import closure_5 from "reset" /* 7734 */;
2026-08-24 06:08:38 +00:00
import closure_6 from "participantFromServer" /* 1390 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/activities/useActivityShelfData.tsx");
2026-07-20 16:05:17 +00:00
export const useActivityShelfData = function useActivityShelfData(guildId) {
2026-07-23 10:11:24 +00:00
const _require = guildId;
let items = [getCurrentUser];
const stateFromStores = _require(stateFromStoresArray[4]).useStateFromStores(items, getCurrentUser.getCurrentUser);
let obj = _require(stateFromStoresArray[4]);
2026-07-29 08:29:29 +00:00
let tmp = stateFromStoresArray;
2026-07-23 10:11:24 +00:00
const items1 = [memo1];
stateFromStoresArray = _require(stateFromStoresArray[4]).useStateFromStoresArray(items1, () => memo1.getShelfActivities(closure_0));
const obj2 = _require(stateFromStoresArray[4]);
const items2 = [memo];
const stateFromStores1 = _require(stateFromStoresArray[4]).useStateFromStores(items2, () => memo.testModeEmbeddedApplicationId);
let mapped = stateFromStoresArray.map((application_id) => application_id.application_id);
2026-07-29 08:29:29 +00:00
let tmp5 = mapped;
2026-07-20 16:05:17 +00:00
if (null != stateFromStores1) {
const items3 = [stateFromStores1];
HermesBuiltin.arraySpread(mapped, 1);
2026-07-29 08:29:29 +00:00
tmp5 = items3;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const tmp9 = stateFromStores(tmp[5])(tmp5);
getCurrentUser = tmp9;
const items4 = [tmp9];
2026-08-24 06:08:38 +00:00
memo = stateFromStores1.useMemo(() => closure_4.filter(guildId(stateFromStoresArray[6]).isNotNullish), items4);
2026-07-20 16:05:17 +00:00
const items5 = [memo, stateFromStores1];
2026-07-23 10:11:24 +00:00
memo1 = stateFromStores1.useMemo(() => {
2026-07-20 16:05:17 +00:00
if (null != stateFromStores1) {
if (memo.length > 0) {
2026-07-29 08:29:29 +00:00
if (tmp2[0].id === tmp) {
if (null != tmp2[0].embeddedActivityConfig) {
const obj = { activity: null, application: null };
obj[0] = tmp2[0].embeddedActivityConfig;
obj[1] = tmp2[0];
2026-07-20 16:05:17 +00:00
const items = [obj];
}
return [];
}
}
}
}, items5);
const items6 = [stateFromStoresArray, memo];
2026-07-23 10:11:24 +00:00
const memo2 = stateFromStores1.useMemo(() => {
2026-07-29 08:29:29 +00:00
const mapped = stateFromStoresArray.map((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
const found = closure_5.find((id) => id.id === application_id.application_id);
2026-07-20 16:05:17 +00:00
let tmp2 = null;
if (null != found) {
2026-07-29 08:29:29 +00:00
const obj = { activity: null, application: null };
obj[0] = arg0;
obj[1] = found;
2026-07-20 16:05:17 +00:00
tmp2 = obj;
}
return tmp2;
});
2026-07-23 10:11:24 +00:00
return mapped.filter(guildId(stateFromStoresArray[6]).isNotNullish);
2026-07-20 16:05:17 +00:00
}, items6);
let nsfwAllowed;
2026-07-29 08:29:29 +00:00
if (stateFromStores != null) {
2026-07-20 16:05:17 +00:00
nsfwAllowed = stateFromStores.nsfwAllowed;
}
const items7 = [nsfwAllowed, memo2, memo1];
2026-07-23 10:11:24 +00:00
return stateFromStores1.useMemo(() => {
const items = [...memo2];
2026-07-20 16:05:17 +00:00
const found = items.filter((activity) => {
let supported_platforms = activity.activity.supported_platforms;
2026-07-29 08:29:29 +00:00
if (supported_platforms == null) {
2026-07-20 16:05:17 +00:00
supported_platforms = [];
}
2026-08-25 06:04:03 +00:00
const tmp = lib(10691);
2026-07-29 08:29:29 +00:00
return supported_platforms.includes(tmp(callback(500).getOS()));
2026-07-20 16:05:17 +00:00
});
const found1 = found.filter((activity) => {
2026-07-29 08:29:29 +00:00
const requires_age_gate = activity.activity.requires_age_gate;
let tmp = !requires_age_gate;
if (requires_age_gate) {
2026-07-20 16:05:17 +00:00
let nsfwAllowed;
2026-07-29 08:29:29 +00:00
if (lib != null) {
nsfwAllowed = lib.nsfwAllowed;
2026-07-20 16:05:17 +00:00
}
tmp = true === nsfwAllowed;
}
if (!tmp) {
let nsfwAllowed1;
2026-07-29 08:29:29 +00:00
if (lib != null) {
nsfwAllowed1 = lib.nsfwAllowed;
2026-07-20 16:05:17 +00:00
}
tmp = null == nsfwAllowed1;
}
return tmp;
});
return found1.filter((application) => {
let nsfwAllowed;
2026-07-29 08:29:29 +00:00
if (lib != null) {
nsfwAllowed = lib.nsfwAllowed;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp2 = false === nsfwAllowed;
if (tmp2) {
2026-08-24 06:08:38 +00:00
tmp2 = closure_1_1(closure_1_2[9])(application.application.id);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return !tmp2;
2026-07-20 16:05:17 +00:00
});
}, items7);
};