decord/source/modules/premium/powerups/GuildPowerupsManager.tsx

123 lines
5.8 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 16681
// Function ID: 16682
2026-07-29 08:29:29 +00:00
// Name: handleSelectedGuildChange
2026-08-24 06:08:38 +00:00
// Dependencies: [1910, 4024, 4201, 4265, 5043, 1913, 4289, 4306, 4308, 4309, 11727, 11731, 15492, 4387, 4307, 11720, 11706, 4274, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 16681 (handleSelectedGuildChange)
import getFavoritesAwareGuildName from "getFavoritesAwareGuildName" /* 1913 */;
import initializeDefault from "initialize" /* 5043 */;
import getUnitIdDefault from "getUnitId" /* 11720 */;
import closure_3 from "createGuildRecordFromRust" /* 1910 */;
import closure_4 from "getUncachedChannelPermissions" /* 4024 */;
import closure_5 from "handleConnectionOpen" /* 4201 */;
import closure_6 from "calculateAppliedBoosts" /* 4265 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
initializeDefault;
2026-07-29 08:29:29 +00:00
class GuildPowerupsManager extends tmp2 {
constructor() {
applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
map = new Map();
2026-08-24 06:08:38 +00:00
applyArgumentsResult.stores = map.set(closure_5, applyArgumentsResult.handleSelectedGuildChange);
2026-07-29 08:29:29 +00:00
obj = { GUILD_POWERUP_ENTITLEMENTS_CREATE: handleEntitlementUpdate.bind(applyArgumentsResult), GUILD_POWERUP_ENTITLEMENTS_DELETE: handleEntitlementUpdate2.bind(applyArgumentsResult), GUILD_APPLIED_BOOSTS_UPDATE: handleAppliedBoostUpdate.bind(applyArgumentsResult) };
({ handleEntitlementUpdate, handleEntitlementUpdate: handleEntitlementUpdate2, handleAppliedBoostUpdate } = applyArgumentsResult);
applyArgumentsResult.actions = obj;
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
const prototype = GuildPowerupsManager.prototype;
prototype["handleSelectedGuildChange"] = function handleSelectedGuildChange() {
guildId = guildId.getGuildId();
if (null != guildId) {
if (!obj12.isFavoritesGuildId(guildId)) {
const guild = store.getGuild(guildId);
if (null != guild) {
2026-08-24 06:08:38 +00:00
const GameServerExperiment = tmp10(4289).GameServerExperiment;
2026-07-29 08:29:29 +00:00
let obj = { guildId: null, location: "GuildPowerupsManager" };
obj[0] = guild.id;
GameServerExperiment.trackExposure(obj);
2026-08-24 06:08:38 +00:00
const FileUpload250MbPowerupExperiment = tmp10(4306).FileUpload250MbPowerupExperiment;
2026-07-29 08:29:29 +00:00
obj = { guildId: null, location: "GuildPowerupsManager" };
obj[0] = guild.id;
FileUpload250MbPowerupExperiment.trackExposure(obj);
2026-08-24 06:08:38 +00:00
const ServerThemeExperiment = tmp10(4308).ServerThemeExperiment;
obj1 = { guildId: null, location: "GuildPowerupsManager" };
2026-07-29 08:29:29 +00:00
obj1[0] = guild.id;
ServerThemeExperiment.trackExposure(obj1);
2026-08-24 06:08:38 +00:00
const ServerThemeApexShadowExperiment = tmp10(4309).ServerThemeApexShadowExperiment;
2026-07-29 08:29:29 +00:00
const obj2 = { guildId: null, location: "GuildPowerupsManager" };
obj2[0] = guild.id;
const config = ServerThemeApexShadowExperiment.getConfig(obj2);
2026-08-24 06:08:38 +00:00
let tmp10Result = tmp10(4289);
2026-07-29 08:29:29 +00:00
if (tmp10Result.getGameServerEnabled(guild.id, "GuildPowerupsManager")) {
2026-08-24 06:08:38 +00:00
const GameServerPricingExperiment = tmp10(11727).GameServerPricingExperiment;
2026-07-29 08:29:29 +00:00
obj = { guildId: null, location: "GuildPowerupsManager" };
obj[0] = guild.id;
GameServerPricingExperiment.trackExposure(obj);
}
2026-08-24 06:08:38 +00:00
tmp10Result = tmp10(11731);
if (!tmp10Result.getHasAllocateBoostPermission(closure_4, guild)) {
let isCurrentUserEligibleForPowerupUpsells = tmp10(15492).getIsCurrentUserEligibleForPowerupUpsells();
let isMobile = tmp10(4387).isMobile;
2026-07-29 08:29:29 +00:00
if (isMobile) {
2026-08-24 06:08:38 +00:00
isMobile = tmp10(4308).getServerThemeEnabled(guildId, "GuildPowerupsManager");
const tmp10Result2 = tmp10(4308);
2026-07-29 08:29:29 +00:00
}
if (isMobile) {
2026-08-24 06:08:38 +00:00
isMobile = tmp10(15492).getIsCurrentUserEligibleForPowerupUpsells();
const tmp10Result3 = tmp10(15492);
2026-07-29 08:29:29 +00:00
}
if (isMobile) {
2026-08-24 06:08:38 +00:00
isMobile = tmp10(4307).getServerThemeUserEnabled("GuildPowerupsManager");
const tmp10Result4 = tmp10(4307);
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
let showCoachmark = tmp10(4387).isMobile;
2026-07-29 08:29:29 +00:00
if (showCoachmark) {
2026-08-24 06:08:38 +00:00
showCoachmark = tmp10(15492).getIsCurrentUserEligibleForPowerupUpsells();
const tmp10Result5 = tmp10(15492);
2026-07-29 08:29:29 +00:00
}
if (showCoachmark) {
2026-08-24 06:08:38 +00:00
showCoachmark = getUnitIdDefault.getConfig({ location: "GuildPowerupsManager" }).showCoachmark;
const obj8 = getUnitIdDefault;
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
if (tmp10(4387).isMobile) {
2026-07-29 08:29:29 +00:00
if (!isMobile) {
isMobile = showCoachmark;
}
isCurrentUserEligibleForPowerupUpsells = isMobile;
}
2026-08-24 06:08:38 +00:00
const tmp10Result1 = tmp10(15492);
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
if (closure_6.shouldFetchCatalogForGuild(guildId)) {
const powerupCatalogForGuild = tmp10(11706).fetchPowerupCatalogForGuild(guildId);
const tmp10Result6 = tmp10(11706);
2026-07-29 08:29:29 +00:00
}
if (obj9.shouldFetchPowerupsForGuild(guildId)) {
2026-08-24 06:08:38 +00:00
const guildBoostEntitlements = tmp10(11706).fetchGuildBoostEntitlements(guildId);
const tmp10Result7 = tmp10(11706);
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
obj9 = closure_6;
2026-07-29 08:29:29 +00:00
}
}
2026-08-24 06:08:38 +00:00
obj12 = getFavoritesAwareGuildName;
2026-07-29 08:29:29 +00:00
}
};
prototype["handleEntitlementUpdate"] = function handleEntitlementUpdate(guildId) {
this.refreshGuildPowerups(guildId.guildId);
};
prototype["handleAppliedBoostUpdate"] = function handleAppliedBoostUpdate(guildId) {
this.refreshGuildPowerups(guildId.guildId);
};
prototype["refreshGuildPowerups"] = function refreshGuildPowerups(guildId) {
2026-08-24 06:08:38 +00:00
if (true === obj.getHasAllocateBoostPermission(closure_4, store.getGuild(guildId))) {
let tmpResult = tmp(11706);
2026-07-29 08:29:29 +00:00
const guildBoostEntitlements = tmpResult.fetchGuildBoostEntitlements(guildId);
2026-08-24 06:08:38 +00:00
tmpResult = tmp(4274);
2026-08-04 21:03:28 +00:00
const appliedGuildBoostsForGuild = tmpResult.fetchAppliedGuildBoostsForGuild(guildId, { includeEnded: true });
2026-07-29 08:29:29 +00:00
}
};
const guildPowerupsManager = new GuildPowerupsManager();
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/premium/powerups/GuildPowerupsManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default guildPowerupsManager;