decord/source/modules/premium/powerups/utils/getBoostLifecyclePhase.tsx

49 lines
1.5 KiB
TypeScript
Raw Normal View History

2026-08-08 06:10:11 +00:00
// Module ID: 11939
// Function ID: 11940
2026-07-20 16:05:17 +00:00
// Name: BOOST_EXPIRING_DISPLAY_WINDOW_DAYS
2026-07-29 08:29:29 +00:00
// Dependencies: [11, 2]
2026-07-20 16:05:17 +00:00
// Exports: getBoostLifecycleInfo, getBoostLifecycleTimestamp
2026-08-08 06:10:11 +00:00
// Module 11939 (BOOST_EXPIRING_DISPLAY_WINDOW_DAYS)
2026-07-29 08:29:29 +00:00
let c2 = 259200000;
2026-07-23 10:11:24 +00:00
const result = require("set").fileFinishedImporting("modules/premium/powerups/utils/getBoostLifecyclePhase.tsx");
2026-07-20 16:05:17 +00:00
export const BOOST_EXPIRING_DISPLAY_WINDOW_DAYS = 3;
export const BOOST_EXPIRING_DISPLAY_WINDOW_MS = 259200000;
2026-08-04 21:03:28 +00:00
export const getBoostLifecycleInfo = function getBoostLifecycleInfo(ended, closure_3) {
2026-07-20 16:05:17 +00:00
if (!ended.ended) {
if (null != ended.endsAt) {
const endsAt = ended.endsAt;
2026-07-29 08:29:29 +00:00
return { phase: "expired" };
2026-07-20 16:05:17 +00:00
}
if (null != ended.endsAt) {
const endsAt2 = ended.endsAt;
2026-08-04 21:03:28 +00:00
if (endsAt2.getTime() - closure_3 <= c2) {
2026-07-29 08:29:29 +00:00
let obj = { phase: "expiring", endsAt: null };
obj[1] = ended.endsAt;
2026-07-20 16:05:17 +00:00
}
}
obj = { phase: "gave" };
}
};
export const getBoostLifecycleTimestamp = function getBoostLifecycleTimestamp(id, boostLifecycleInfo) {
const phase = boostLifecycleInfo.phase;
if ("gave" === phase) {
2026-07-29 08:29:29 +00:00
return importDefault(11).extractTimestamp(id.id);
2026-07-20 16:05:17 +00:00
} else if ("expiring" === phase) {
const endsAt2 = boostLifecycleInfo.endsAt;
2026-07-29 08:29:29 +00:00
return endsAt2.getTime() - c2;
2026-07-20 16:05:17 +00:00
} else if ("expired" === phase) {
const endsAt = id.endsAt;
let time;
2026-07-29 08:29:29 +00:00
if (endsAt != null) {
2026-07-20 16:05:17 +00:00
time = endsAt.getTime();
}
2026-07-29 08:29:29 +00:00
if (time == null) {
time = importDefault(11).extractTimestamp(id.id);
const obj = importDefault(11);
2026-07-20 16:05:17 +00:00
}
return time;
}
};