58 lines
2.6 KiB
TypeScript
58 lines
2.6 KiB
TypeScript
// Module ID: 4309
|
|
// Function ID: 4310
|
|
// Name: experiment
|
|
// Dependencies: [676, 4291, 4310, 2]
|
|
// Exports: getServerThemeEnabled, useServerThemeEnabled
|
|
|
|
// Module 4309 (experiment)
|
|
import set from "set" /* 2 */;
|
|
import ME from "ME" /* 676 */;
|
|
import apexExperiment from "apexExperiment" /* 4310 */;
|
|
import createExperiment from "createExperiment" /* 4291 */;
|
|
|
|
const EMPTY_STRING_SNOWFLAKE_ID = ME.EMPTY_STRING_SNOWFLAKE_ID;
|
|
const items = [{ id: 0, label: "Control", config: { enabled: false, inExperiment: true, gatesApex: false } }, { id: 1, label: "Enable Server Theme", config: { enabled: true, inExperiment: true, gatesApex: false } }];
|
|
let experiment = createExperiment.createExperiment({ kind: "guild", id: "2026-04_server_theme", label: "Server Theme", defaultConfig: { enabled: false, inExperiment: false, gatesApex: false }, treatments: items });
|
|
const result = set.fileFinishedImporting("modules/premium/powerups/experiments/ServerThemeExperiment.tsx");
|
|
|
|
export const ServerThemeExperiment = experiment;
|
|
export const getServerThemeEnabled = function getServerThemeEnabled(guildId, GuildPowerupsConstants) {
|
|
let obj = { guildId, location: GuildPowerupsConstants };
|
|
const currentConfig = experiment.getCurrentConfig(obj, { autoTrackExposure: false });
|
|
let enabled = currentConfig.enabled;
|
|
if (null != guildId) {
|
|
const ServerThemeApexShadowExperiment = apexExperiment.ServerThemeApexShadowExperiment;
|
|
obj = { guildId: null, location: null };
|
|
obj[0] = guildId;
|
|
obj[1] = GuildPowerupsConstants;
|
|
let config = ServerThemeApexShadowExperiment.getConfig(obj);
|
|
} else {
|
|
config = { enabled: false, gatesApex: false };
|
|
}
|
|
if (!currentConfig.inExperiment) {
|
|
enabled = config.gatesApex && tmp4;
|
|
const tmp5 = config.gatesApex && tmp4;
|
|
}
|
|
return enabled;
|
|
};
|
|
export const useServerThemeEnabled = function useServerThemeEnabled(guildId, useGuildPowerupNewPerkMarketingVersion) {
|
|
let obj = { guildId, location: useGuildPowerupNewPerkMarketingVersion };
|
|
experiment = experiment.useExperiment(obj, { autoTrackExposure: false });
|
|
let enabled = experiment.enabled;
|
|
const ServerThemeApexShadowExperiment = apexExperiment.ServerThemeApexShadowExperiment;
|
|
let tmp2 = guildId;
|
|
if (guildId == null) {
|
|
tmp2 = EMPTY_STRING_SNOWFLAKE_ID;
|
|
}
|
|
obj = { guildId: tmp2, location: useGuildPowerupNewPerkMarketingVersion };
|
|
const config = ServerThemeApexShadowExperiment.useConfig(obj);
|
|
if (!experiment.inExperiment) {
|
|
let tmp6 = null != guildId;
|
|
if (tmp6) {
|
|
tmp6 = tmp5 && tmp4;
|
|
const tmp7 = tmp5 && tmp4;
|
|
}
|
|
enabled = tmp6;
|
|
}
|
|
return enabled;
|
|
};
|