Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4943.js (118.4 MB)
125 lines
4.1 KiB
TypeScript
125 lines
4.1 KiB
TypeScript
// Module ID: 7459
|
|
// Function ID: 7460
|
|
// Name: GuildCapUpsellHooks
|
|
// Dependencies: [2067, 1376, 1078, 558, 568, 504, 7460, 4418, 2]
|
|
// Exports: hasIncreasedGuildCap, hideInlineGuildCapUpsell, isAtGuildCapAndNonPremium
|
|
|
|
// Module 7459 (GuildCapUpsellHooks)
|
|
import initialize from "initialize" /* 504 */;
|
|
import c from "c" /* 568 */;
|
|
import PremiumUtilsDefault from "PremiumUtils" /* 4418 */;
|
|
import HotspotStore2 from "HotspotStore" /* 7460 */;
|
|
import GuildStore from "GuildStore" /* 2067 */;
|
|
import UserStore from "UserStore" /* 1376 */;
|
|
|
|
require = fn;
|
|
const MAX_USER_GUILDS = fn(1078).MAX_USER_GUILDS;
|
|
const ReactCompilerGating = fn(558);
|
|
function hasIncreasedGuildCap(currentUser) {
|
|
let result = PremiumUtilsDefault.canUseIncreasedGuildCap(currentUser);
|
|
if (!result) {
|
|
let isStaffResult;
|
|
if (currentUser != null) {
|
|
isStaffResult = currentUser.isStaff();
|
|
}
|
|
result = true === isStaffResult;
|
|
}
|
|
return result;
|
|
}
|
|
const size = fn(2);
|
|
let result = size.fileFinishedImporting("modules/premium/GuildCapUpsellHooks.tsx");
|
|
|
|
export const useShouldShowInlineGuildCapUpsell = ReactCompilerGating.isReactCompilerEnabled() ? (() => {
|
|
const cResult = c.c(6);
|
|
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
const items = [GuildStore];
|
|
const fn = function n() {
|
|
return guildCount.getGuildCount() >= 95;
|
|
};
|
|
cResult[0] = items;
|
|
cResult[1] = fn;
|
|
tmp4 = items;
|
|
tmp5 = fn;
|
|
} else {
|
|
[tmp4, tmp5] = cResult;
|
|
}
|
|
let stateFromStores = initialize.useStateFromStores(tmp4, tmp5);
|
|
if (cResult[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
const items1 = [tmp(7460).HotspotStore];
|
|
const fn2 = function c() {
|
|
const HotspotStore = HotspotStore2.HotspotStore;
|
|
return HotspotStore.hasHotspot(HotspotStore2.HotspotLocations.GUILD_CAP_INLINE_UPSELL);
|
|
};
|
|
cResult[2] = items1;
|
|
cResult[3] = fn2;
|
|
let tmp9 = fn2;
|
|
let tmp8 = items1;
|
|
} else {
|
|
tmp8 = cResult[2];
|
|
tmp9 = cResult[3];
|
|
}
|
|
const tmpResult = initialize;
|
|
const stateFromStores1 = initialize.useStateFromStores(tmp8, tmp9);
|
|
if (cResult[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
const items2 = [UserStore];
|
|
class C {
|
|
constructor() {
|
|
obj = closure_1_1(closure_1_2[7]);
|
|
return !obj.isPremium(closure_1_4.getCurrentUser());
|
|
}
|
|
}
|
|
cResult[4] = items2;
|
|
cResult[5] = C;
|
|
let tmp12 = C;
|
|
let tmp11 = items2;
|
|
} else {
|
|
tmp11 = cResult[4];
|
|
tmp12 = cResult[5];
|
|
}
|
|
const tmpResult3 = initialize;
|
|
const stateFromStoresObject = initialize.useStateFromStoresObject(tmp11, tmp12);
|
|
if (stateFromStores) {
|
|
stateFromStores = stateFromStores1;
|
|
}
|
|
if (stateFromStores) {
|
|
stateFromStores = stateFromStoresObject;
|
|
}
|
|
return stateFromStores;
|
|
}) : (() => {
|
|
const items = [GuildStore];
|
|
let stateFromStores = initialize.useStateFromStores(items, () => guildCount.getGuildCount() >= 95);
|
|
const items1 = [HotspotStore2.HotspotStore];
|
|
const stateFromStores1 = initialize.useStateFromStores(items1, () => {
|
|
const HotspotStore = HotspotStore2.HotspotStore;
|
|
return HotspotStore.hasHotspot(HotspotStore2.HotspotLocations.GUILD_CAP_INLINE_UPSELL);
|
|
});
|
|
const items2 = [UserStore];
|
|
const stateFromStoresObject = initialize.useStateFromStoresObject(items2, () => !PremiumUtilsDefault.isPremium(currentUser.getCurrentUser()));
|
|
if (stateFromStores) {
|
|
stateFromStores = stateFromStores1;
|
|
}
|
|
if (stateFromStores) {
|
|
stateFromStores = stateFromStoresObject;
|
|
}
|
|
return stateFromStores;
|
|
});
|
|
export const hideInlineGuildCapUpsell = function hideInlineGuildCapUpsell() {
|
|
HotspotStore2.hideHotspot(HotspotStore2.HotspotLocations.GUILD_CAP_INLINE_UPSELL);
|
|
};
|
|
export { hasIncreasedGuildCap };
|
|
export const isAtGuildCapAndNonPremium = function isAtGuildCapAndNonPremium() {
|
|
let tmp = GuildStore.getGuildCount() >= MAX_USER_GUILDS;
|
|
if (tmp) {
|
|
const currentUser = UserStore.getCurrentUser();
|
|
let result = PremiumUtilsDefault.canUseIncreasedGuildCap(currentUser);
|
|
if (!result) {
|
|
let isStaffResult;
|
|
if (currentUser != null) {
|
|
isStaffResult = currentUser.isStaff();
|
|
}
|
|
result = true === isStaffResult;
|
|
}
|
|
tmp = !result;
|
|
}
|
|
return tmp;
|
|
};
|