decord/alpha/source/modules/badges/BadgeIdResolution.tsx

51 lines
1.7 KiB
TypeScript
Raw Normal View History

2026-10-03 08:58:59 +00:00
// Module ID: 7864
// Function ID: 7865
// Name: BadgeIdResolution
2026-10-03 08:58:59 +00:00
// Dependencies: [7865, 7854, 7866, 7855, 7867, 2]
2026-09-02 09:53:35 +00:00
// Exports: isLegacyBadgeId, legacyBadgeIdToBadgeId, resolveProfileBadgeId, toProfileBadgeLegacyId
2026-07-20 16:05:17 +00:00
2026-10-03 08:58:59 +00:00
// Module 7864 (BadgeIdResolution)
import Constants from "Constants" /* 7854 */;
import BadgeId from "BadgeId" /* 7855 */;
import Constants2 from "Constants" /* 7865 */;
import LegacyBadgeIdMap from "LegacyBadgeIdMap" /* 7866 */;
import types from "types" /* 7867 */;
import size from "module_2" /* 2 */;
2026-07-20 16:05:17 +00:00
2026-10-03 08:58:59 +00:00
const DEFAULT_PREMIUM_BADGE_ID = Constants2.DEFAULT_PREMIUM_BADGE_ID;
const getBadgeName = Constants.getBadgeName;
2026-10-03 08:58:59 +00:00
const items = [BadgeId.BadgeId.PREMIUM_TENURE, DEFAULT_PREMIUM_BADGE_ID];
2026-09-02 09:53:35 +00:00
const items1 = [items, ];
const items2 = [BadgeId.BadgeId.ORB_PROFILE, types.OrbBadges.ORB_PROFILE_BADGE];
2026-09-02 09:53:35 +00:00
items1[1] = items2;
const map = new Map(items1);
const set = new Set(Object.values(LegacyBadgeIdMap.LEGACY_BADGE_ID_MAP));
const result = size.fileFinishedImporting("modules/badges/BadgeIdResolution.tsx");
2026-07-20 16:05:17 +00:00
export const legacyBadgeIdToBadgeId = function legacyBadgeIdToBadgeId(arg0) {
return LegacyBadgeIdMap.LEGACY_BADGE_ID_MAP[arg0];
2026-07-20 16:05:17 +00:00
};
export const resolveProfileBadgeId = function resolveProfileBadgeId(id) {
const tmp3 = LegacyBadgeIdMap.LEGACY_BADGE_ID_MAP[id];
2026-07-29 08:29:29 +00:00
if (null != tmp3) {
return tmp3;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
const tmp4 = BadgeId.BadgeId[id.toUpperCase(id)];
2026-07-20 16:05:17 +00:00
let tmp5;
2026-08-04 21:03:28 +00:00
if (typeof tmp4 === "number") {
2026-07-20 16:05:17 +00:00
tmp5 = tmp4;
}
return tmp5;
}
};
2026-09-02 09:53:35 +00:00
export const toProfileBadgeLegacyId = function toProfileBadgeLegacyId(badge_id) {
2026-10-03 08:58:59 +00:00
let value = map.get(badge_id);
2026-09-02 09:53:35 +00:00
if (value == null) {
value = getBadgeName(badge_id);
}
return value;
};
export const isLegacyBadgeId = function isLegacyBadgeId(badge_id) {
return set.has(badge_id);
2026-07-20 16:05:17 +00:00
};