decord/source/modules/premium/powerups/hooks/useCanGuildPowerupBeToggled.tsx

81 lines
3 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 11752
// Function ID: 11753
2026-07-20 16:05:17 +00:00
// Name: useCanGuildPowerupBeToggled
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 4265, 4266, 589, 11717, 1236, 2368, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 11752 (useCanGuildPowerupBeToggled)
import usePowerupActiveStatusDefault from "usePowerupActiveStatus" /* 11717 */;
import closure_3 from "noop" /* 19 */;
import closure_4 from "calculateAppliedBoosts" /* 4265 */;
import { PowerupActiveStatusType } from "BoostedGuildTiers" /* 4266 */;
2026-07-20 16:05:17 +00:00
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/premium/powerups/hooks/useCanGuildPowerupBeToggled.tsx");
2026-07-20 16:05:17 +00:00
export default function useCanGuildPowerupBeToggled(arg0, arg1, arg2) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
importDefault = arg1;
dependencyMap = arg2;
const items = [closure_4];
const stateFromStores = _require(589).useStateFromStores(items, () => stateForGuild.getStateForGuild(closure_0));
const tmp2 = usePowerupActiveStatusDefault(arg0, arg1);
closure_4 = tmp2;
2026-07-20 16:05:17 +00:00
const items1 = [stateFromStores, , , , ];
({ skuId: arr2[1], dependencies: arr2[2] } = arg1);
items1[3] = arg2;
items1[4] = tmp2.type;
2026-07-23 10:11:24 +00:00
return stateFromStores.useMemo(() => {
2026-07-20 16:05:17 +00:00
if (null == stateFromStores) {
2026-07-29 08:29:29 +00:00
return { disabled: true, reason: "a" };
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
if (stateForGuild.type !== closure_1_5.LEVEL_ACTIVATED) {
if (stateForGuild.type !== tmp15.TIER_OVERRIDE_ACTIVATED) {
2026-07-29 08:29:29 +00:00
({ allPowerups, unlockedPowerups } = tmp);
2026-07-23 10:11:24 +00:00
if (dependencyMap) {
2026-07-20 16:05:17 +00:00
const _Object = Object;
const values = Object.values(unlockedPowerups);
const found = values.find((sku) => {
sku = sku.sku;
let dependent_sku_id;
2026-07-29 08:29:29 +00:00
if (sku != null) {
2026-07-20 16:05:17 +00:00
dependent_sku_id = sku.dependent_sku_id;
}
2026-07-29 08:29:29 +00:00
return dependent_sku_id === skuId.skuId;
2026-07-20 16:05:17 +00:00
});
let sku_id;
2026-07-29 08:29:29 +00:00
if (found != null) {
2026-07-20 16:05:17 +00:00
sku_id = found.sku_id;
}
let found1 = sku_id;
} else {
2026-07-23 10:11:24 +00:00
const dependencies = lib.dependencies;
2026-07-20 16:05:17 +00:00
found1 = dependencies.find((arg0) => null == unlockedPowerups[arg0]);
}
2026-07-29 08:29:29 +00:00
let obj = { disabled: null, reason: null };
obj[0] = null != found1;
2026-07-20 16:05:17 +00:00
let formatToPlainStringResult;
if (null != found1) {
if (null != allPowerups[found1]) {
2026-07-29 08:29:29 +00:00
const intl = callback(1236).intl;
2026-08-24 06:08:38 +00:00
const tmp11 = lib(2368);
2026-07-20 16:05:17 +00:00
let title;
2026-07-29 08:29:29 +00:00
if (allPowerups[found1] != null) {
title = tmp13.title;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { perk: null };
obj[0] = title;
formatToPlainStringResult = intl.formatToPlainString(dependencyMap ? tmp11.vCEBiS : tmp11["1B8AZr"], obj);
const tmp12 = dependencyMap ? tmp11.vCEBiS : tmp11["1B8AZr"];
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
obj[1] = formatToPlainStringResult;
2026-07-20 16:05:17 +00:00
return obj;
}
}
2026-07-29 08:29:29 +00:00
return { disabled: true, reason: "a" };
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp = stateFromStores;
2026-07-20 16:05:17 +00:00
}, items1);
};