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

48 lines
1.5 KiB
TypeScript
Raw Normal View History

2026-07-27 11:26:19 +00:00
// Module ID: 11610
// Function ID: 90198
2026-07-20 16:05:17 +00:00
// Name: BOOST_EXPIRING_DISPLAY_WINDOW_DAYS
2026-07-23 10:11:24 +00:00
// Dependencies: [21, 2]
2026-07-20 16:05:17 +00:00
// Exports: getBoostLifecycleInfo, getBoostLifecycleTimestamp
2026-07-27 11:26:19 +00:00
// Module 11610 (BOOST_EXPIRING_DISPLAY_WINDOW_DAYS)
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-07-23 10:11:24 +00:00
export const getBoostLifecycleInfo = function getBoostLifecycleInfo(ended, outer1_4) {
2026-07-20 16:05:17 +00:00
if (!ended.ended) {
if (null != ended.endsAt) {
const endsAt = ended.endsAt;
return obj;
}
if (null != ended.endsAt) {
const endsAt2 = ended.endsAt;
2026-07-23 10:11:24 +00:00
if (endsAt2.getTime() - outer1_4 <= 259200000) {
obj = { phase: "expiring", endsAt: ended.endsAt };
2026-07-20 16:05:17 +00:00
}
}
obj = { phase: "gave" };
}
obj = { phase: "expired" };
};
export const getBoostLifecycleTimestamp = function getBoostLifecycleTimestamp(id, boostLifecycleInfo) {
const phase = boostLifecycleInfo.phase;
if ("gave" === phase) {
2026-07-23 10:11:24 +00:00
return importDefault(21).extractTimestamp(id.id);
2026-07-20 16:05:17 +00:00
} else if ("expiring" === phase) {
const endsAt2 = boostLifecycleInfo.endsAt;
return endsAt2.getTime() - 259200000;
} else if ("expired" === phase) {
const endsAt = id.endsAt;
let time;
if (null != endsAt) {
time = endsAt.getTime();
}
if (null == time) {
2026-07-23 10:11:24 +00:00
time = importDefault(21).extractTimestamp(id.id);
const obj = importDefault(21);
2026-07-20 16:05:17 +00:00
}
return time;
}
};