decord/alpha/source/modules/checkpoint/CheckpointMessageComponentUtils.tsx
github-actions 72019a2d0c chore: update source for alpha 348.4
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5014.js (118.4 MB)
2026-09-25 08:38:05 +00:00

62 lines
2.5 KiB
TypeScript

// Module ID: 5074
// Function ID: 5075
// Name: checkpoint/CheckpointMessageComponentUtils
// Dependencies: [5054, 5075, 1978, 1115, 3004, 2]
// Exports: getCheckpointDataFromMessage, getCheckpointLabel, transformCheckpoint2026CardComponent, transformCheckpoint2026CardToRowGeneratedComponent
// Module 5074 (checkpoint/CheckpointMessageComponentUtils)
import util from "util" /* 1115 */;
import Server from "Server" /* 1978 */;
import _modDef3004 from "module_3004" /* 3004 */;
import CheckpointConstants from "CheckpointConstants" /* 5054 */;
import size from "module_2" /* 2 */;
const CheckpointVersions = CheckpointConstants.CheckpointVersions;
const result = size.fileFinishedImporting("modules/checkpoint/CheckpointMessageComponentUtils.tsx");
export const transformCheckpoint2026CardComponent = function transformCheckpoint2026CardComponent(checkpoint_data) {
let tmp = null;
if (obj.getIsCheckpointEnabled("transformCheckpoint2026CardComponent")) {
let tmp3 = null;
if (null != checkpoint_data.character) {
const obj2 = { version: checkpoint_data.version, character: null };
const obj3 = { base: checkpoint_data.character.base, shoes: checkpoint_data.character.shoes, outfit: checkpoint_data.character.outfit, face: checkpoint_data.character.face, hat: checkpoint_data.character.hat, wearable: checkpoint_data.character.wearable, aura: checkpoint_data.character.aura };
obj2.character = obj3;
tmp3 = obj2;
}
tmp = tmp3;
}
return tmp;
};
export const transformCheckpoint2026CardToRowGeneratedComponent = function transformCheckpoint2026CardToRowGeneratedComponent(checkpointData) {
const obj = {};
const merged = Object.assign(checkpointData);
if (null != checkpointData.character) {
const character = checkpointData.character;
let items = [];
} else {
items = [];
}
obj.characterLayerUrls = items;
return obj;
};
export const getCheckpointDataFromMessage = function getCheckpointDataFromMessage(contentMessage) {
const first = contentMessage.components[0];
let checkpointData = null;
if (null != first) {
checkpointData = null;
if (first.type === Server.ComponentType.CHECKPOINT_CARD) {
checkpointData = first.checkpointData;
}
}
return checkpointData;
};
export const getCheckpointLabel = function getCheckpointLabel(checkpointDataFromMessage) {
if (CheckpointVersions.V2025 === checkpointDataFromMessage.version) {
const intl = util.intl;
return intl.string(_modDef3004.goiR2u);
} else {
const V2026 = tmp.V2026;
return null;
}
};