decord/alpha/source/modules/design/PlaygroundAccessExperiment.tsx
github-actions 72019a2d0c chore: update source for alpha 348.4
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5014.js (118.4 MB)
2026-09-25 08:38:05 +00:00

67 lines
2.4 KiB
TypeScript

// Module ID: 10440
// Function ID: 10441
// Name: PlaygroundAccessExperiment
// Dependencies: [1372, 1434, 504, 2]
// Exports: getHasPlaygroundAccess, getPlaygroundAccessExperiment, useHasPlaygroundAccess, usePlaygroundAccessExperiment
// Module 10440 (PlaygroundAccessExperiment)
import initialize from "initialize" /* 504 */;
import UserStore from "UserStore" /* 1372 */;
require = fn;
const ApexExperiment = fn(1434);
const obj2 = { name: "2026-02-mana-playground-access", kind: "user", defaultConfig: { enabled: false }, variations: null };
const obj3 = { 1: null };
obj3[1] = { enabled: true };
obj2.variations = obj3;
const apexExperiment = ApexExperiment.createApexExperiment(obj2);
const size = fn(2);
const result = size.fileFinishedImporting("modules/design/PlaygroundAccessExperiment.tsx");
export default apexExperiment;
export const usePlaygroundAccessExperiment = function usePlaygroundAccessExperiment(design_systems_settings) {
return apexExperiment.useConfig({ location: design_systems_settings }).enabled;
};
export const getPlaygroundAccessExperiment = function getPlaygroundAccessExperiment(location) {
return apexExperiment.getConfig({ location }).enabled;
};
export const useHasPlaygroundAccess = function useHasPlaygroundAccess(location) {
const items = [UserStore];
const stateFromStores = initialize.useStateFromStores(items, () => currentUser.getCurrentUser());
let isStaffResult;
if (stateFromStores != null) {
isStaffResult = stateFromStores.isStaff();
}
let enabled = true === isStaffResult;
if (!enabled) {
let isStaffPersonalResult;
if (stateFromStores != null) {
isStaffPersonalResult = stateFromStores.isStaffPersonal();
}
enabled = true === isStaffPersonalResult;
}
if (!enabled) {
enabled = apexExperiment.useConfig(obj2).enabled;
}
return enabled;
};
export const getHasPlaygroundAccess = function getHasPlaygroundAccess(quickswitcher_action) {
const currentUser = UserStore.getCurrentUser();
let isStaffResult;
if (currentUser != null) {
isStaffResult = currentUser.isStaff();
}
let enabled = true === isStaffResult;
if (!enabled) {
let isStaffPersonalResult;
if (currentUser != null) {
isStaffPersonalResult = currentUser.isStaffPersonal();
}
enabled = true === isStaffPersonalResult;
}
if (!enabled) {
const obj = { location: quickswitcher_action };
enabled = apexExperiment.getConfig(obj).enabled;
}
return enabled;
};