decord/alpha/source/modules/checkpoint/2025/CheckpointUtils.tsx

78 lines
2.7 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 5444
// Function ID: 5445
// Name: CheckpointUtils
2026-10-09 10:00:15 +00:00
// Dependencies: [5120, 5445, 1126, 5446, 5447, 5448, 5449, 5450, 5451, 5452, 5453, 5454, 5455, 2]
2026-07-20 16:05:17 +00:00
// Exports: getCardAssetUrl, getCheckpointPowerBarUnits, getVoiceDurationString
2026-10-09 10:00:15 +00:00
// Module 5444 (CheckpointUtils)
import TimeUtils from "TimeUtils" /* 5120 */;
import getTimestampString from "getTimestampString" /* 5445 */;
2026-10-08 09:57:35 +00:00
import _modDef5446 from "module_5446" /* 5446 */;
import _modDef5447 from "module_5447" /* 5447 */;
import _modDef5448 from "module_5448" /* 5448 */;
import _modDef5449 from "module_5449" /* 5449 */;
import _modDef5450 from "module_5450" /* 5450 */;
import _modDef5451 from "module_5451" /* 5451 */;
import _modDef5452 from "module_5452" /* 5452 */;
import _modDef5453 from "module_5453" /* 5453 */;
import _modDef5454 from "module_5454" /* 5454 */;
2026-10-09 10:00:15 +00:00
import _modDef5455 from "module_5455" /* 5455 */;
import size from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
const items = [TimeUtils.TimeUnits.HOURS, TimeUtils.TimeUnits.MINUTES];
const result = size.fileFinishedImporting("modules/checkpoint/2025/CheckpointUtils.tsx");
2026-07-20 16:05:17 +00:00
export const getVoiceDurationString = function getVoiceDurationString(rounded) {
2026-10-03 08:58:59 +00:00
let time;
let unit;
const obj = TimeUtils;
const timeAndUnit = obj.getTimeAndUnit(rounded, items);
2026-07-29 08:29:29 +00:00
({ time, unit } = timeAndUnit);
2026-10-03 08:58:59 +00:00
const obj2 = getTimestampString;
const time2 = obj2.getAbbreviatedFormatter();
2026-07-20 16:05:17 +00:00
if (null == time) {
2026-10-03 08:58:59 +00:00
const intl3 = tmp(1126).intl;
return intl3.formatToPlainString(time2.minutes, { minutes: 0 });
2026-07-20 16:05:17 +00:00
} else {
2026-10-03 08:58:59 +00:00
let formatToPlainStringResult;
2026-07-20 16:05:17 +00:00
const _Math = Math;
rounded = Math.round(time);
2026-10-03 08:58:59 +00:00
if (unit === TimeUtils.TimeUnits.HOURS) {
const intl2 = tmp(1126).intl;
const obj3 = { hours: rounded };
2026-10-03 08:58:59 +00:00
formatToPlainStringResult = intl2.formatToPlainString(time2.hours, obj3);
2026-07-20 16:05:17 +00:00
} else {
2026-10-03 08:58:59 +00:00
const intl = tmp(1126).intl;
const obj4 = { minutes: rounded };
formatToPlainStringResult = intl.formatToPlainString(time2.minutes, obj4);
2026-07-20 16:05:17 +00:00
}
return formatToPlainStringResult;
}
};
export const getCardAssetUrl = function getCardAssetUrl(cardId) {
if (0 === cardId) {
2026-10-08 09:57:35 +00:00
return _modDef5446;
2026-10-09 10:00:15 +00:00
} else if (1 === cardId) {
2026-10-08 09:57:35 +00:00
return _modDef5447;
2026-10-09 10:00:15 +00:00
} else if (2 === cardId) {
2026-10-08 09:57:35 +00:00
return _modDef5448;
2026-10-09 10:00:15 +00:00
} else if (3 === cardId) {
2026-10-08 09:57:35 +00:00
return _modDef5449;
2026-10-09 10:00:15 +00:00
} else if (4 === cardId) {
2026-10-08 09:57:35 +00:00
return _modDef5450;
2026-10-09 10:00:15 +00:00
} else if (5 === cardId) {
2026-10-08 09:57:35 +00:00
return _modDef5451;
2026-10-09 10:00:15 +00:00
} else if (6 === cardId) {
2026-10-08 09:57:35 +00:00
return _modDef5452;
2026-10-09 10:00:15 +00:00
} else if (7 === cardId) {
2026-10-08 09:57:35 +00:00
return _modDef5453;
2026-10-09 10:00:15 +00:00
} else if (8 === cardId) {
2026-10-08 09:57:35 +00:00
return _modDef5454;
2026-10-09 10:00:15 +00:00
} else {
return _modDef5455;
2026-07-20 16:05:17 +00:00
}
};
export const getCheckpointPowerBarUnits = function getCheckpointPowerBarUnits(powerLevelPercentile) {
return Math.min(Math.max(Math.round(powerLevelPercentile / 10), 1), 9);
2026-07-20 16:05:17 +00:00
};