decord/source/modules/content_inventory/utils.tsx

573 lines
18 KiB
TypeScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 7914
// Function ID: 7915
2026-07-20 16:05:17 +00:00
// Name: calculateTimestampDurations
2026-07-29 08:29:29 +00:00
// Dependencies: [687, 11, 1236, 3771, 7915, 3414, 7909, 2]
// Exports: calculateActiveTimestampDurations, formatActiveA11yTimestamp, formatEntryTimestamp, getAggregateRange, getEntryDuration, getEpisodeBadgeText, getFullResurrectedBadgeText, getMarathonDescription, getResurrectedEntryLastPlayTime, getRichGameStateBadgeText, getStreakCount, getTrait, getTrendingType, isEntryActive, isEntryExpired, isEntryLive, isEntryMarathon, isEntryNew, isEntryRecent, isEntryTopGame, isValidStreak
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
// Module 7914 (calculateTimestampDurations)
2026-07-20 16:05:17 +00:00
function calculateTimestampDurations(end, now) {
const bound = Math.max(end - now, 0);
2026-07-29 08:29:29 +00:00
const result = bound / importDefault(687).Millis.SECOND;
const obj = { seconds: null, minutes: null, hours: null, days: null };
2026-07-20 16:05:17 +00:00
const rounded = Math.floor(result);
2026-07-29 08:29:29 +00:00
obj[0] = rounded % importDefault(687).Seconds.MINUTE;
const rounded1 = Math.floor(result / importDefault(687).Seconds.MINUTE);
obj[1] = rounded1 % importDefault(687).Seconds.MINUTE;
obj[2] = Math.floor(result / importDefault(687).Seconds.HOUR);
obj[3] = Math.floor(result / importDefault(687).Seconds.DAY);
2026-07-20 16:05:17 +00:00
return obj;
}
2026-07-29 08:29:29 +00:00
function formatActiveTimestamp(entry, now) {
let hours;
let minutes;
let end;
if ("end" in entry) {
end = entry.end;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let isCountDown = "isCountDown" in entry;
2026-07-20 16:05:17 +00:00
if (isCountDown) {
2026-07-29 08:29:29 +00:00
isCountDown = null != entry.isCountDown;
2026-07-20 16:05:17 +00:00
}
if (isCountDown) {
2026-07-29 08:29:29 +00:00
isCountDown = entry.isCountDown;
2026-07-20 16:05:17 +00:00
}
if (isCountDown) {
if (null != end) {
if (end > now) {
2026-07-29 08:29:29 +00:00
let tmp6Result = calculateTimestampDurations(end, now);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
({ minutes, hours } = tmp6Result);
let padStartResult = minutes;
if (hours > 0) {
const _String = String;
padStartResult = String(minutes).padStart(2, "0");
const StringResult = String(minutes);
}
const _String2 = String;
const padStartResult1 = String(tmp6Result.seconds).padStart(2, "0");
if (hours > 0) {
const _HermesInternal2 = HermesInternal;
let combined = "" + hours + ":" + padStartResult + ":" + padStartResult1;
} else {
const _HermesInternal = HermesInternal;
combined = "" + padStartResult + ":" + padStartResult1;
}
return combined;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
if ("id" in entry) {
let start = importDefault(11).extractTimestamp(entry.id);
const obj = importDefault(11);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
start = entry.start;
2026-07-20 16:05:17 +00:00
}
let bound = now;
if (null != end) {
bound = now;
if (!isCountDown) {
const _Math = Math;
bound = Math.min(end, now);
}
}
2026-07-29 08:29:29 +00:00
tmp6Result = calculateTimestampDurations(bound, start);
2026-07-20 16:05:17 +00:00
}
function formatTimestampToA11yLabel(hours) {
let minutes;
let seconds;
hours = hours.hours;
const items = [];
({ minutes, seconds } = hours);
if (hours > 0) {
2026-07-29 08:29:29 +00:00
const intl = require(1236) /* getSystemLocale */.intl;
const obj = { hours: null };
obj[0] = hours;
items.push(intl.formatToPlainString(require(1236) /* getSystemLocale */.t.xCjYxK, obj));
}
const intl2 = require(1236) /* getSystemLocale */.intl;
items.push(intl2.formatToPlainString(require(1236) /* getSystemLocale */.t.iXLF9W, { minutes }));
const intl3 = require(1236) /* getSystemLocale */.intl;
items.push(intl3.formatToPlainString(require(1236) /* getSystemLocale */.t.geSp4K, { seconds }));
2026-07-20 16:05:17 +00:00
return items.join(", ");
}
function formatEndedTimestamp(entry, arg1, timestamp, arg3) {
let obj = arg3;
if (arg3 === undefined) {
obj = {};
}
let formatSet = obj.formatSet;
if (formatSet === undefined) {
2026-07-29 08:29:29 +00:00
formatSet = closure_6;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj2 = importDefault(3771)(timestamp);
const tmp3 = importDefault(3771);
const diffResult = obj2.diff(tmp3(importDefault(11).extractTimestamp(entry.id)), "s");
2026-07-20 16:05:17 +00:00
const absolute = Math.abs(diffResult);
2026-07-29 08:29:29 +00:00
if (absolute < importDefault(687).Seconds.MINUTE) {
2026-07-20 16:05:17 +00:00
return formatSet.secondsAgo(diffResult);
2026-07-29 08:29:29 +00:00
} else if (absolute < tmp(687).Seconds.HOUR) {
2026-07-20 16:05:17 +00:00
const _Math5 = Math;
2026-07-29 08:29:29 +00:00
return formatSet.minutesAgo(Math.round(diffResult / tmp(687).Seconds.MINUTE));
} else if (absolute < 12 * tmp(687).Seconds.HOUR) {
2026-07-20 16:05:17 +00:00
const _Math4 = Math;
2026-07-29 08:29:29 +00:00
return formatSet.hoursAgo(Math.round(diffResult / tmp(687).Seconds.HOUR));
} else if (absolute < 9 * tmp(687).Seconds.DAY) {
2026-07-20 16:05:17 +00:00
const _Math3 = Math;
2026-07-29 08:29:29 +00:00
return formatSet.daysAgo(Math.round(diffResult / tmp(687).Seconds.DAY));
} else if (absolute < 4 * tmp(687).Seconds.WEEK) {
2026-07-20 16:05:17 +00:00
const _Math2 = Math;
2026-07-29 08:29:29 +00:00
return formatSet.weeksAgo(Math.round(diffResult / (7 * tmp(687).Seconds.DAY)));
2026-07-20 16:05:17 +00:00
} else {
const _Math = Math;
2026-07-29 08:29:29 +00:00
return formatSet.monthsAgo(Math.round(diffResult / tmp(687).Seconds.DAYS_30));
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj3 = importDefault(11);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let closure_6 = {
2026-07-20 16:05:17 +00:00
secondsAgo(count) {
2026-07-29 08:29:29 +00:00
const intl = require(1236) /* getSystemLocale */.intl;
return intl.formatToPlainString(require(1236) /* getSystemLocale */.t.EOrEJl, { count });
2026-07-20 16:05:17 +00:00
},
minutesAgo(count) {
2026-07-29 08:29:29 +00:00
const intl = require(1236) /* getSystemLocale */.intl;
return intl.formatToPlainString(require(1236) /* getSystemLocale */.t.LRNgHp, { count });
2026-07-20 16:05:17 +00:00
},
hoursAgo(count) {
2026-07-29 08:29:29 +00:00
const intl = require(1236) /* getSystemLocale */.intl;
return intl.formatToPlainString(require(1236) /* getSystemLocale */.t.raJpz3, { count });
2026-07-20 16:05:17 +00:00
},
daysAgo(count) {
2026-07-29 08:29:29 +00:00
const intl = require(1236) /* getSystemLocale */.intl;
return intl.formatToPlainString(require(1236) /* getSystemLocale */.t.KkvKhi, { count });
2026-07-20 16:05:17 +00:00
},
weeksAgo(count) {
2026-07-29 08:29:29 +00:00
const intl = require(1236) /* getSystemLocale */.intl;
return intl.formatToPlainString(require(1236) /* getSystemLocale */.t.sDtO6D, { count });
2026-07-20 16:05:17 +00:00
},
monthsAgo(count) {
2026-07-29 08:29:29 +00:00
const intl = require(1236) /* getSystemLocale */.intl;
return intl.formatToPlainString(require(1236) /* getSystemLocale */.t.ITymou, { count });
2026-07-20 16:05:17 +00:00
}
};
2026-07-23 10:11:24 +00:00
let result = require("getSystemLocale").fileFinishedImporting("modules/content_inventory/utils.tsx");
2026-07-20 16:05:17 +00:00
export { calculateTimestampDurations };
2026-07-29 08:29:29 +00:00
export const calculateActiveTimestampDurations = function calculateActiveTimestampDurations(end, now) {
end = undefined;
if ("end" in end) {
end = end.end;
}
let isCountDown = "isCountDown" in end;
if (isCountDown) {
isCountDown = null != end.isCountDown;
}
if (isCountDown) {
isCountDown = end.isCountDown;
}
if (isCountDown) {
if (null != end) {
if (end > now) {
return calculateTimestampDurations(end, now);
}
}
}
if ("id" in end) {
let start = importDefault(11).extractTimestamp(end.id);
const obj = importDefault(11);
} else {
start = end.start;
}
let bound = now;
if (null != end) {
bound = now;
if (!isCountDown) {
const _Math = Math;
bound = Math.min(end, now);
}
}
return calculateTimestampDurations(bound, start);
};
2026-07-20 16:05:17 +00:00
export { formatActiveTimestamp };
export { formatTimestampToA11yLabel };
export const formatActiveA11yTimestamp = function formatActiveA11yTimestamp(end, now) {
2026-07-29 08:29:29 +00:00
end = undefined;
if ("end" in end) {
end = end.end;
}
let isCountDown = "isCountDown" in end;
if (isCountDown) {
isCountDown = null != end.isCountDown;
}
if (isCountDown) {
isCountDown = end.isCountDown;
}
if (isCountDown) {
if (null != end) {
if (end > now) {
let tmp6Result = calculateTimestampDurations(end, now);
}
let obj = { hours: null, minutes: null, seconds: null };
({ hours: obj2[0], minutes: obj2[1], seconds: obj2[2] } = tmp6Result);
return formatTimestampToA11yLabel(obj);
}
}
if ("id" in end) {
obj = importDefault(11);
let start = obj.extractTimestamp(end.id);
} else {
start = end.start;
}
let bound = now;
if (null != end) {
bound = now;
if (!isCountDown) {
const _Math = Math;
bound = Math.min(end, now);
}
}
tmp6Result = calculateTimestampDurations(bound, start);
2026-07-20 16:05:17 +00:00
};
export const A11Y_FORMAT_SET = {
secondsAgo(count) {
2026-07-29 08:29:29 +00:00
const intl = require(1236) /* getSystemLocale */.intl;
return intl.formatToPlainString(require(1236) /* getSystemLocale */.t.jfUoRQ, { count });
2026-07-20 16:05:17 +00:00
},
minutesAgo(count) {
2026-07-29 08:29:29 +00:00
const intl = require(1236) /* getSystemLocale */.intl;
return intl.formatToPlainString(require(1236) /* getSystemLocale */.t.DmvRVO, { count });
2026-07-20 16:05:17 +00:00
},
hoursAgo(count) {
2026-07-29 08:29:29 +00:00
const intl = require(1236) /* getSystemLocale */.intl;
return intl.formatToPlainString(require(1236) /* getSystemLocale */.t.AfXezt, { count });
2026-07-20 16:05:17 +00:00
},
daysAgo(count) {
2026-07-29 08:29:29 +00:00
const intl = require(1236) /* getSystemLocale */.intl;
return intl.formatToPlainString(require(1236) /* getSystemLocale */.t.Lru1rV, { count });
2026-07-20 16:05:17 +00:00
},
weeksAgo(count) {
2026-07-29 08:29:29 +00:00
const intl = require(1236) /* getSystemLocale */.intl;
return intl.formatToPlainString(require(1236) /* getSystemLocale */.t["jovF+x"], { count });
2026-07-20 16:05:17 +00:00
},
monthsAgo(count) {
2026-07-29 08:29:29 +00:00
const intl = require(1236) /* getSystemLocale */.intl;
return intl.formatToPlainString(require(1236) /* getSystemLocale */.t.nmSbST, { count });
2026-07-20 16:05:17 +00:00
}
};
export { formatEndedTimestamp };
export const formatEntryTimestamp = function formatEntryTimestamp(contentInventoryEntry, locale, time, arg3) {
let timestamp = time;
if (time === undefined) {
const _Date = Date;
timestamp = Date.now();
}
2026-07-29 08:29:29 +00:00
let obj = arg3;
if (arg3 === undefined) {
2026-07-20 16:05:17 +00:00
obj = {};
}
2026-07-29 08:29:29 +00:00
IS_LIVE = IS_LIVE(7915).ContentInventoryTraitType.IS_LIVE;
const traits = contentInventoryEntry.traits;
const found = traits.find((type) => type.type === TRENDING_CONTENT);
let flag;
if (found != null) {
flag = found.is_live;
}
if (flag == null) {
flag = false;
}
if (flag) {
let tmp8 = formatActiveTimestamp(contentInventoryEntry, timestamp);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmp8 = formatEndedTimestamp(contentInventoryEntry, 0, timestamp, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp8;
};
export const getTrait = function getTrait(contentInventoryEntry, AGGREGATE_COUNT) {
let closure_0 = AGGREGATE_COUNT;
const traits = contentInventoryEntry.traits;
return traits.find((type) => type.type === TRENDING_CONTENT);
};
export const isEntryActive = function isEntryActive(entry) {
IS_LIVE = IS_LIVE(7915).ContentInventoryTraitType.IS_LIVE;
const traits = entry.traits;
const found = traits.find((type) => type.type === TRENDING_CONTENT);
let flag;
if (found != null) {
flag = found.is_live;
}
if (flag == null) {
flag = false;
}
return flag;
2026-07-20 16:05:17 +00:00
};
export const isEntryNew = function isEntryNew(entry) {
2026-07-29 08:29:29 +00:00
FIRST_TIME = FIRST_TIME(7915).ContentInventoryTraitType.FIRST_TIME;
const traits = entry.traits;
const found = traits.find((type) => type.type === TRENDING_CONTENT);
let flag;
if (found != null) {
flag = found.first_time;
}
if (flag == null) {
flag = false;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return flag;
2026-07-20 16:05:17 +00:00
};
export const isEntryRecent = function isEntryRecent(id) {
2026-07-29 08:29:29 +00:00
const obj = importDefault(11);
return importDefault(11).age(id.id) / importDefault(687).Millis.HOUR < 48;
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const isEntryExpired = function isEntryExpired(content) {
let tmp = null != content.expires_at;
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-07-29 08:29:29 +00:00
const _Date = Date;
const date = new Date(content.expires_at);
const _Date2 = Date;
const date1 = new Date();
tmp = date < date1;
2026-07-20 16:05:17 +00:00
}
return tmp;
};
2026-07-29 08:29:29 +00:00
export const isEntryLive = function isEntryLive(traits) {
IS_LIVE = IS_LIVE(7915).ContentInventoryTraitType.IS_LIVE;
traits = traits.traits;
const found = traits.find((type) => type.type === TRENDING_CONTENT);
let flag;
if (found != null) {
flag = found.is_live;
}
if (flag == null) {
flag = false;
}
if (flag) {
let tmp2 = null != traits.expires_at;
if (tmp2) {
const _Date = Date;
const date = new Date(traits.expires_at);
const _Date2 = Date;
const date1 = new Date();
tmp2 = date < date1;
}
flag = !tmp2;
}
return flag;
};
export const getEntryDuration = function getEntryDuration(contentInventoryEntry) {
DURATION_SECONDS = DURATION_SECONDS(7915).ContentInventoryTraitType.DURATION_SECONDS;
const traits = contentInventoryEntry.traits;
const found = traits.find((type) => type.type === TRENDING_CONTENT);
let duration_seconds;
if (found != null) {
duration_seconds = found.duration_seconds;
}
return duration_seconds;
};
export const getAggregateRange = function getAggregateRange(traits) {
AGGREGATE_RANGE = AGGREGATE_RANGE(7915).ContentInventoryTraitType.AGGREGATE_RANGE;
traits = traits.traits;
const found = traits.find((type) => type.type === TRENDING_CONTENT);
2026-07-20 16:05:17 +00:00
let range;
2026-07-29 08:29:29 +00:00
if (found != null) {
range = found.range;
2026-07-20 16:05:17 +00:00
}
return range;
};
export const isEntryMarathon = function isEntryMarathon(entry) {
2026-07-29 08:29:29 +00:00
MARATHON = MARATHON(7915).ContentInventoryTraitType.MARATHON;
const traits = entry.traits;
const found = traits.find((type) => type.type === TRENDING_CONTENT);
2026-07-20 16:05:17 +00:00
let marathon;
2026-07-29 08:29:29 +00:00
if (found != null) {
marathon = found.marathon;
2026-07-20 16:05:17 +00:00
}
return marathon;
};
export const getResurrectedEntryLastPlayTime = function getResurrectedEntryLastPlayTime(entry) {
2026-07-29 08:29:29 +00:00
RESURRECTED = RESURRECTED(7915).ContentInventoryTraitType.RESURRECTED;
const traits = entry.traits;
const found = traits.find((type) => type.type === TRENDING_CONTENT);
2026-07-20 16:05:17 +00:00
let prop;
2026-07-29 08:29:29 +00:00
if (found != null) {
prop = found.resurrected_last_played;
2026-07-20 16:05:17 +00:00
}
let date;
if (null != prop) {
const _Date = Date;
2026-07-29 08:29:29 +00:00
date = new Date(found.resurrected_last_played);
2026-07-20 16:05:17 +00:00
}
return date;
};
export const getFullResurrectedBadgeText = function getFullResurrectedBadgeText(start) {
2026-07-29 08:29:29 +00:00
let obj = require(3414);
obj = { start, end: null };
obj[1] = new Date();
2026-07-20 16:05:17 +00:00
const intervalToDurationResult = obj.intervalToDuration(obj);
const months = intervalToDurationResult.months;
let num = 0;
if (undefined !== months) {
num = months;
}
const weeks = intervalToDurationResult.weeks;
let num2 = 0;
if (undefined !== weeks) {
num2 = weeks;
}
const days = intervalToDurationResult.days;
let num3 = 0;
if (undefined !== days) {
num3 = days;
}
2026-07-29 08:29:29 +00:00
const intl = tmp(1236).intl;
obj = { months: num, weeks: null, days: null };
2026-07-20 16:05:17 +00:00
let num4 = 0;
if (num <= 0) {
num4 = num2;
}
2026-07-29 08:29:29 +00:00
obj[1] = num4;
2026-07-20 16:05:17 +00:00
let num5 = 0;
if (num <= 0) {
num5 = 0;
if (num2 <= 0) {
num5 = num3;
}
}
2026-07-29 08:29:29 +00:00
obj[2] = num5;
return intl.formatToPlainString(require(1236) /* getSystemLocale */.t.NXBtjF, obj);
2026-07-20 16:05:17 +00:00
};
export const getEpisodeBadgeText = function getEpisodeBadgeText(large_text) {
if (null != large_text) {
if ("" !== large_text) {
2026-07-29 08:29:29 +00:00
const match = /\w+ (\d+), \w+ (\d+)/.exec(large_text);
2026-07-20 16:05:17 +00:00
let formatToPlainStringResult = null;
if (null != match) {
2026-07-29 08:29:29 +00:00
const intl = require(1236) /* getSystemLocale */.intl;
const obj = { seasonNum: null, episodeNum: null };
obj[0] = match[1];
obj[1] = match[2];
formatToPlainStringResult = intl.formatToPlainString(require(1236) /* getSystemLocale */.t.ijVm6y, obj);
2026-07-20 16:05:17 +00:00
}
return formatToPlainStringResult;
}
}
return null;
};
export const getRichGameStateBadgeText = function getRichGameStateBadgeText(state, party) {
let first;
2026-07-29 08:29:29 +00:00
if (party != null) {
2026-07-20 16:05:17 +00:00
const size = party.size;
2026-07-29 08:29:29 +00:00
if (size != null) {
2026-07-20 16:05:17 +00:00
first = size[0];
}
}
let tmp2;
2026-07-29 08:29:29 +00:00
if (party != null) {
2026-07-20 16:05:17 +00:00
const size2 = party.size;
2026-07-29 08:29:29 +00:00
if (size2 != null) {
tmp2 = size2[1];
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
if (null != first) {
if (null != tmp2) {
if (first > 0) {
if (tmp2 > 0) {
const intl2 = require(1236) /* getSystemLocale */.intl;
let obj = { count: null, max: null };
obj[0] = first;
obj[1] = tmp2;
let formatToPlainStringResult = intl2.formatToPlainString(require(1236) /* getSystemLocale */.t.wmUSiy, obj);
2026-07-20 16:05:17 +00:00
}
if (null != formatToPlainStringResult) {
if (null != state) {
const _HermesInternal = HermesInternal;
let combined = "" + state + " (" + formatToPlainStringResult + ")";
}
return combined;
}
2026-07-29 08:29:29 +00:00
combined = state;
if (state == null) {
combined = formatToPlainStringResult;
2026-07-20 16:05:17 +00:00
}
}
}
}
2026-07-29 08:29:29 +00:00
let tmp3 = null != first;
if (tmp3) {
tmp3 = first > 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp3) {
const intl = require(1236) /* getSystemLocale */.intl;
obj = { count: null };
obj[0] = first;
formatToPlainStringResult = intl.formatToPlainString(require(1236) /* getSystemLocale */.t.UTYMsa, obj);
2026-07-20 16:05:17 +00:00
}
};
export const isEntryTopGame = function isEntryTopGame(contentInventoryEntry) {
2026-07-29 08:29:29 +00:00
return contentInventoryEntry.content_type === require(7909) /* ContentInventoryEntryType */.ContentInventoryEntryType.TOP_GAME;
};
export const getStreakCount = function getStreakCount(entry) {
STREAK_DAYS = STREAK_DAYS(7915).ContentInventoryTraitType.STREAK_DAYS;
const traits = entry.traits;
const found = traits.find((type) => type.type === TRENDING_CONTENT);
let streak_count_days;
if (found != null) {
streak_count_days = found.streak_count_days;
}
return streak_count_days;
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const isValidStreak = function isValidStreak(traits) {
STREAK_DAYS = STREAK_DAYS(7915).ContentInventoryTraitType.STREAK_DAYS;
traits = traits.traits;
const found = traits.find((type) => type.type === TRENDING_CONTENT);
let streak_count_days;
if (found != null) {
streak_count_days = found.streak_count_days;
}
if (null == streak_count_days) {
2026-07-20 16:05:17 +00:00
return false;
2026-07-29 08:29:29 +00:00
} else if (streak_count_days < 3) {
2026-07-20 16:05:17 +00:00
return false;
} else {
const _Date = Date;
2026-07-29 08:29:29 +00:00
const obj = importDefault(11);
const diff = Date.now() - importDefault(11).extractTimestamp(traits.id);
return diff <= 48 * importDefault(687).Millis.HOUR;
2026-07-20 16:05:17 +00:00
}
};
export const getMarathonDescription = function getMarathonDescription(entry) {
2026-07-29 08:29:29 +00:00
DURATION_SECONDS = DURATION_SECONDS(7915).ContentInventoryTraitType.DURATION_SECONDS;
const traits = entry.traits;
const found = traits.find((type) => type.type === TRENDING_CONTENT);
let duration_seconds;
if (found != null) {
duration_seconds = found.duration_seconds;
}
if (null == duration_seconds) {
2026-07-23 10:11:24 +00:00
return { text: null, tooltipText: null };
2026-07-20 16:05:17 +00:00
} else {
const _Math = Math;
2026-07-29 08:29:29 +00:00
const rounded = Math.round(duration_seconds / importDefault(687).Seconds.HOUR);
2026-07-20 16:05:17 +00:00
if (rounded <= 0) {
2026-07-23 10:11:24 +00:00
let obj = { text: null, tooltipText: null };
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj = { text: null, tooltipText: null };
const intl = tmp(1236).intl;
obj = { hours: null };
obj[0] = rounded;
obj[0] = intl.formatToPlainString(tmp(1236).t.vZaMem, obj);
const intl2 = tmp(1236).intl;
obj = { hours: null };
obj[0] = rounded;
obj[1] = intl2.formatToPlainString(tmp(1236).t.S5F485, obj);
2026-07-20 16:05:17 +00:00
}
return obj;
}
};
export const getTrendingType = function getTrendingType(entry) {
2026-07-29 08:29:29 +00:00
TRENDING_CONTENT = TRENDING_CONTENT(7915).ContentInventoryTraitType.TRENDING_CONTENT;
const traits = entry.traits;
const found = traits.find((type) => type.type === TRENDING_CONTENT);
2026-07-20 16:05:17 +00:00
let trending;
2026-07-29 08:29:29 +00:00
if (found != null) {
trending = found.trending;
2026-07-20 16:05:17 +00:00
}
return trending;
};