decord/stable/source/modules/experiments/ExperimentManager.tsx

89 lines
3.1 KiB
TypeScript
Raw Permalink Normal View History

2026-10-06 22:12:49 +00:00
// Module ID: 4757
// Function ID: 4758
// Name: ExperimentManager
2026-10-06 22:12:49 +00:00
// Dependencies: [4752, 4753, 585, 2]
// Exports: overrideBucket, registerGuildExperiment, registerUserExperiment, trackExposureToExperiment
2026-10-06 22:12:49 +00:00
// Module 4757 (ExperimentManager)
import DispatcherDefault from "Dispatcher" /* 585 */;
import ExperimentStore2 from "ExperimentStore" /* 4752 */;
import ExperimentConstants from "ExperimentConstants" /* 4753 */;
import size from "module_2" /* 2 */;
2026-10-06 22:12:49 +00:00
const ExperimentStore = ExperimentStore2;
let ExposureTypes;
let closure_4;
const registerExperiment = ExperimentStore2.registerExperiment;
({ ExperimentTypes: closure_4, ExposureTypes } = ExperimentConstants);
const ExperimentSystem = { LEGACY: "legacy", APEX: "apex" };
const result = size.fileFinishedImporting("modules/experiments/ExperimentManager.tsx");
export const trackExposureToExperiment = function trackExposureToExperiment(id, descriptor, location) {
let _location;
2026-10-06 22:12:49 +00:00
let analyticsLocations;
let excluded;
let exposureType;
let fingerprint;
const obj = { experimentId: id, descriptor, location: _location, location_stack: analyticsLocations, fingerprint, excluded, exposureType };
_location = undefined;
const trackExposure = ExperimentStore.trackExposure;
if (location != null) {
_location = location.location;
}
2026-10-06 22:12:49 +00:00
analyticsLocations = undefined;
if (location != null) {
analyticsLocations = location.analyticsLocations;
}
2026-10-06 22:12:49 +00:00
fingerprint = undefined;
if (location != null) {
fingerprint = location.fingerprint;
}
2026-10-06 22:12:49 +00:00
excluded = undefined;
if (location != null) {
excluded = location.excluded;
}
2026-10-06 22:12:49 +00:00
exposureType = undefined;
if (location != null) {
exposureType = location.exposureType;
}
2026-10-06 22:12:49 +00:00
trackExposure(obj);
};
export const registerUserExperiment = function registerUserExperiment(id) {
id = id.id;
2026-10-06 22:12:49 +00:00
const obj = { experimentId: id, experimentType: constants.USER, title: id.title, description: id.description, buckets: id.buckets, commonTriggerPoint: id.commonTriggerPoint };
registerExperiment(obj);
return { id };
};
export const registerGuildExperiment = function registerGuildExperiment(id) {
id = id.id;
2026-10-06 22:12:49 +00:00
const obj = { experimentId: id, experimentType: constants.GUILD, title: id.title, description: id.description, buckets: id.buckets, commonTriggerPoint: id.commonTriggerPoint };
registerExperiment(obj);
return { id };
};
export { ExperimentSystem };
export const overrideBucket = function overrideBucket(system, map, id) {
2026-10-06 22:12:49 +00:00
let obj;
let tmp11;
if (obj.LEGACY === system) {
2026-10-06 22:12:49 +00:00
const obj2 = { type: "EXPERIMENT_OVERRIDE_BUCKET", experimentId: map, experimentBucket: tmp11 };
tmp11 = null;
const dispatch = DispatcherDefault.dispatch;
DispatcherDefault;
if (null != id) {
2026-10-06 22:12:49 +00:00
tmp11 = id;
}
2026-10-06 22:12:49 +00:00
dispatch(obj2);
} else if (tmp.APEX === system) {
if (null == id) {
const obj4 = { type: "APEX_EXPERIMENT_OVERRIDE_DELETE", experimentName: map };
2026-10-06 22:12:49 +00:00
const obj3 = DispatcherDefault;
obj3.dispatch(obj4);
} else {
obj = DispatcherDefault;
2026-10-06 22:12:49 +00:00
const obj5 = { type: "APEX_EXPERIMENT_OVERRIDE_CREATE", experimentName: map, variantId: id };
obj.dispatch(obj5);
}
}
};