decord/source/modules/experiments/ExperimentManager.tsx

84 lines
2.9 KiB
TypeScript
Raw Normal View History

2026-08-12 06:57:52 +00:00
// Module ID: 4266
// Function ID: 4267
2026-07-20 16:05:17 +00:00
// Name: trackExposureToExperiment
2026-08-12 06:57:52 +00:00
// Dependencies: [4258, 4259, 709, 2]
2026-07-20 16:05:17 +00:00
// Exports: overrideBucket, registerGuildExperiment, registerUserExperiment, trackExposureToExperiment
2026-08-12 06:57:52 +00:00
// Module 4266 (trackExposureToExperiment)
2026-07-29 08:29:29 +00:00
import getHash from "getHash";
import { registerExperiment } from "getHash";
2026-07-23 10:11:24 +00:00
import ExperimentBuckets from "ExperimentBuckets";
2026-07-20 16:05:17 +00:00
let ExposureTypes;
2026-07-29 08:29:29 +00:00
let c4;
({ ExperimentTypes: c4, ExposureTypes } = ExperimentBuckets);
2026-07-23 10:11:24 +00:00
let obj = { LEGACY: "legacy", APEX: "apex" };
const result = require("dispatcher").fileFinishedImporting("modules/experiments/ExperimentManager.tsx");
2026-07-20 16:05:17 +00:00
export const trackExposureToExperiment = function trackExposureToExperiment(id, descriptor, location) {
2026-07-29 08:29:29 +00:00
const obj = { experimentId: id, descriptor, location: null, location_stack: null, fingerprint: null, excluded: null, exposureType: null };
2026-07-20 16:05:17 +00:00
let _location;
2026-07-29 08:29:29 +00:00
if (location != null) {
2026-07-20 16:05:17 +00:00
_location = location.location;
}
2026-07-29 08:29:29 +00:00
obj[2] = _location;
2026-07-20 16:05:17 +00:00
let analyticsLocations;
2026-07-29 08:29:29 +00:00
if (location != null) {
2026-07-20 16:05:17 +00:00
analyticsLocations = location.analyticsLocations;
}
2026-07-29 08:29:29 +00:00
obj[3] = analyticsLocations;
2026-07-20 16:05:17 +00:00
let fingerprint;
2026-07-29 08:29:29 +00:00
if (location != null) {
2026-07-20 16:05:17 +00:00
fingerprint = location.fingerprint;
}
2026-07-29 08:29:29 +00:00
obj[4] = fingerprint;
2026-07-20 16:05:17 +00:00
let excluded;
2026-07-29 08:29:29 +00:00
if (location != null) {
2026-07-20 16:05:17 +00:00
excluded = location.excluded;
}
2026-07-29 08:29:29 +00:00
obj[5] = excluded;
2026-07-20 16:05:17 +00:00
let exposureType;
2026-07-29 08:29:29 +00:00
if (location != null) {
2026-07-20 16:05:17 +00:00
exposureType = location.exposureType;
}
2026-07-29 08:29:29 +00:00
obj[6] = exposureType;
getHash.trackExposure(obj);
2026-07-20 16:05:17 +00:00
};
export const registerUserExperiment = function registerUserExperiment(id) {
id = id.id;
registerExperiment({ experimentId: id, experimentType: constants.USER, title: id.title, description: id.description, buckets: id.buckets, commonTriggerPoint: id.commonTriggerPoint });
return { id };
};
export const registerGuildExperiment = function registerGuildExperiment(id) {
id = id.id;
registerExperiment({ experimentId: id, experimentType: constants.GUILD, title: id.title, description: id.description, buckets: id.buckets, commonTriggerPoint: id.commonTriggerPoint });
return { id };
};
export const ExperimentSystem = obj;
2026-07-29 08:29:29 +00:00
export const overrideBucket = function overrideBucket(system, closure_0, id) {
2026-07-20 16:05:17 +00:00
if (obj.LEGACY === system) {
2026-07-29 08:29:29 +00:00
obj = { type: "EXPERIMENT_OVERRIDE_BUCKET", experimentId: null, experimentBucket: null };
obj[1] = closure_0;
let tmp10 = null;
2026-07-20 16:05:17 +00:00
if (null != id) {
2026-07-29 08:29:29 +00:00
tmp10 = id;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[2] = tmp10;
importDefault(709).dispatch(obj);
const obj5 = importDefault(709);
} else if (tmp.APEX === system) {
2026-07-20 16:05:17 +00:00
if (null == id) {
2026-07-29 08:29:29 +00:00
obj = { type: "APEX_EXPERIMENT_OVERRIDE_DELETE", experimentName: null };
obj[1] = closure_0;
importDefault(709).dispatch(obj);
const obj3 = importDefault(709);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj = importDefault(709);
const obj1 = { type: "APEX_EXPERIMENT_OVERRIDE_CREATE", experimentName: null, variantId: null };
obj1[1] = closure_0;
obj1[2] = id;
2026-07-20 16:05:17 +00:00
obj.dispatch(obj1);
}
}
};