decord/source/modules/app_analytics/clickstream/Clickstream.tsx

87 lines
2.7 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 5062
// Function ID: 5063
2026-07-29 08:29:29 +00:00
// Name: isClickstreamEnabled
2026-08-24 06:08:38 +00:00
// Dependencies: [32, 1218, 4544, 11, 5063, 698, 5064, 2]
2026-07-20 16:05:17 +00:00
// Exports: trackClickstream
2026-08-24 06:08:38 +00:00
// Module 5062 (isClickstreamEnabled)
import DISCORD_EPOCHDefault from "DISCORD_EPOCH" /* 11 */;
import expandEventPropertiesDefault from "expandEventProperties" /* 698 */;
import clickstreamExperimentEnabled from "clickstreamExperimentEnabled" /* 5063 */;
import getClickstreamDrainEvent from "getClickstreamDrainEvent" /* 5064 */;
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "fetchFingerprint" /* 1218 */;
import closure_5 from "createRTCConnection" /* 4544 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function isClickstreamEnabled(flag) {
if (flag === undefined) {
flag = true;
}
if (flag) {
2026-08-24 06:08:38 +00:00
const extractTimestampResult = DISCORD_EPOCHDefault.extractTimestamp(store.getId());
2026-07-23 10:11:24 +00:00
if (extractTimestampResult !== c7) {
2026-07-20 16:05:17 +00:00
drainClickstream(false);
2026-07-23 10:11:24 +00:00
c7 = extractTimestampResult;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const obj = DISCORD_EPOCHDefault;
closure_8 = clickstreamExperimentEnabled.clickstreamExperimentEnabled();
const obj2 = clickstreamExperimentEnabled;
2026-07-20 16:05:17 +00:00
}
return closure_8;
}
function drainClickstream(flag) {
if (flag === undefined) {
flag = true;
}
if (isClickstreamEnabled(flag)) {
2026-07-29 08:29:29 +00:00
const tmp3 = obj[Symbol.iterator]();
while (tmp3 !== undefined) {
let tmp7 = callback;
let tmp8 = callback(tmp5, 2);
let first = tmp8[0];
let tmp10 = importDefault;
let tmp11 = dependencyMap;
2026-08-24 06:08:38 +00:00
let obj2 = expandEventPropertiesDefault;
2026-07-29 08:29:29 +00:00
let tmp12 = require;
2026-08-24 06:08:38 +00:00
let obj3 = getClickstreamDrainEvent;
2026-07-29 08:29:29 +00:00
let trackResult = obj2.track(first, obj3.getClickstreamDrainEvent(first, tmp8[1]));
continue;
2026-07-20 16:05:17 +00:00
}
map.clear();
} else {
2026-07-29 08:29:29 +00:00
obj.clear();
2026-07-20 16:05:17 +00:00
}
}
const map = new Map();
2026-07-23 10:11:24 +00:00
let c7 = -1;
let c8 = false;
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/app_analytics/clickstream/Clickstream.tsx");
2026-07-20 16:05:17 +00:00
export const trackClickstream = function trackClickstream(GUILD_VIEWED_CLICKSTREAM, arg1) {
2026-08-24 06:08:38 +00:00
let obj = DISCORD_EPOCHDefault;
2026-07-29 08:29:29 +00:00
const extractTimestampResult = obj.extractTimestamp(store.getId());
if (extractTimestampResult !== c7) {
drainClickstream(false);
c7 = extractTimestampResult;
}
2026-08-24 06:08:38 +00:00
const result = clickstreamExperimentEnabled.clickstreamExperimentEnabled();
c8 = result;
2026-07-29 08:29:29 +00:00
if (result) {
2026-07-20 16:05:17 +00:00
if (!map.has(GUILD_VIEWED_CLICKSTREAM)) {
2026-07-29 08:29:29 +00:00
const result1 = obj3.set(GUILD_VIEWED_CLICKSTREAM, []);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const value = obj3.get(GUILD_VIEWED_CLICKSTREAM);
if (value != null) {
obj = { timestamp: null, rtc_state: null };
2026-07-20 16:05:17 +00:00
const _Date = Date;
const date = new Date();
2026-07-29 08:29:29 +00:00
obj[0] = date;
obj[1] = state.getState();
2026-07-20 16:05:17 +00:00
const merged = Object.assign(arg1);
value.push(obj);
}
}
};
export { drainClickstream };