decord/source/modules/quests/VideoQuestUIStore.tsx

142 lines
4.7 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 7493
// Function ID: 7494
2026-07-20 16:05:17 +00:00
// Name: _toPropertyKey
2026-08-24 06:08:38 +00:00
// Dependencies: [109, 700, 4246, 7494, 705, 7495, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 7493 (_toPropertyKey)
import closure_3 from "_objectWithoutProperties" /* 109 */;
import identity from "identity" /* 700 */;
import createJSONStorage from "createJSONStorage" /* 4246 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-04 21:03:28 +00:00
function _toPropertyKey(obj) {
let StringResult = obj;
if (typeof obj === "object") {
StringResult = obj;
if (obj) {
2026-07-20 16:05:17 +00:00
const _Symbol = Symbol;
2026-08-04 21:03:28 +00:00
if (undefined !== obj[Symbol.toPrimitive]) {
2026-07-29 08:29:29 +00:00
const call = tmp3.call;
if (typeof call === "unknown") {
let callResult = tmp3("string");
} else {
2026-08-04 21:03:28 +00:00
callResult = call(obj, "string");
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
StringResult = callResult;
2026-08-04 21:03:28 +00:00
if (typeof callResult === "object") {
2026-07-20 16:05:17 +00:00
const _TypeError = TypeError;
const typeError = new TypeError("@@toPrimitive must return a primitive value.");
throw typeError;
}
} else {
const _String = String;
2026-08-04 21:03:28 +00:00
StringResult = String(obj);
2026-07-20 16:05:17 +00:00
}
}
}
let text = StringResult;
2026-08-04 21:03:28 +00:00
if (typeof StringResult !== "symbol") {
2026-07-20 16:05:17 +00:00
text = `${tmp}`;
}
return text;
}
let obj = { UNKNOWN: "UNKNOWN", NOT_STARTED: "NOT_STARTED", IN_PROGRESS: "IN_PROGRESS", COMPLETED: "COMPLETED" };
2026-07-29 08:29:29 +00:00
identity = identity.createWithEqualityFn();
obj = { name: "videoQuestUIState", storage: null, partialize: null, version: 0 };
2026-08-24 06:08:38 +00:00
obj[1] = createJSONStorage.createJSONStorage(() => importDefault(7495));
2026-07-29 08:29:29 +00:00
obj[2] = function partialize(volume) {
2026-07-20 16:05:17 +00:00
return { volume: volume.volume, muted: volume.muted, videoProgress: volume.videoProgress };
};
2026-07-29 08:29:29 +00:00
const withEqualityFnResult = identity(createJSONStorage.persist((arg0, arg1) => {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
closure_1 = arg1;
2026-07-29 08:29:29 +00:00
return {
2026-08-24 06:08:38 +00:00
volume: _require(7494).DEFAULT_VIDEO_VOLUME,
2026-07-23 10:11:24 +00:00
muted: false,
transcriptEnabled: false,
captionEnabled: false,
2026-07-20 16:05:17 +00:00
videoProgress: {},
2026-07-23 10:11:24 +00:00
transcript: null,
2026-07-20 16:05:17 +00:00
setVolume(arg0) {
2026-07-23 10:11:24 +00:00
const callback = arg0;
2026-08-24 06:08:38 +00:00
callback(closure_1_2[4]).batchUpdates(() => callback({ volume: callback }));
2026-07-20 16:05:17 +00:00
},
setMuted(arg0) {
2026-07-23 10:11:24 +00:00
const callback = arg0;
2026-08-24 06:08:38 +00:00
callback(closure_1_2[4]).batchUpdates(() => callback({ muted: callback }));
2026-07-20 16:05:17 +00:00
},
setVideoProgress(arg0, arg1, arg2) {
2026-07-23 10:11:24 +00:00
const callback = arg0;
const callback2 = arg1;
2026-08-24 06:08:38 +00:00
closure_2 = arg2;
2026-07-23 10:11:24 +00:00
const tmp = callback2().videoProgress[arg0];
2026-07-29 08:29:29 +00:00
let num;
if (tmp != null) {
num = tmp.maxTimestampSec;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (num == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
closure_3 = Math.max(num, arg1);
callback(closure_1_2[4]).batchUpdates(() => {
obj = { videoProgress: null };
2026-07-20 16:05:17 +00:00
obj = {};
2026-07-23 10:11:24 +00:00
const merged = Object.assign(callback2().videoProgress);
2026-08-24 06:08:38 +00:00
obj = { timestampSec: callback2, duration: closure_2, maxTimestampSec: closure_3 };
2026-07-23 10:11:24 +00:00
obj[callback] = obj;
2026-07-29 08:29:29 +00:00
obj[0] = obj;
2026-07-23 10:11:24 +00:00
return callback(obj);
2026-07-20 16:05:17 +00:00
});
},
setTranscriptEnabled(arg0) {
2026-07-23 10:11:24 +00:00
const callback = arg0;
2026-08-24 06:08:38 +00:00
callback(closure_1_2[4]).batchUpdates(() => callback({ transcriptEnabled: callback }));
2026-07-20 16:05:17 +00:00
},
setCaptionEnabled(arg0) {
2026-07-23 10:11:24 +00:00
const callback = arg0;
2026-08-24 06:08:38 +00:00
callback(closure_1_2[4]).batchUpdates(() => callback({ captionEnabled: callback }));
2026-07-20 16:05:17 +00:00
},
getVideoProgress(questId) {
2026-07-23 10:11:24 +00:00
return callback2().videoProgress[questId];
2026-07-20 16:05:17 +00:00
},
getVideoProgressState(arg0) {
2026-07-23 10:11:24 +00:00
const tmp = callback2().videoProgress[arg0];
2026-07-20 16:05:17 +00:00
if (null == tmp) {
2026-08-24 06:08:38 +00:00
let IN_PROGRESS = closure_1_5.UNKNOWN;
2026-07-20 16:05:17 +00:00
} else if (0 === tmp.timestampSec) {
2026-08-24 06:08:38 +00:00
IN_PROGRESS = closure_1_5.NOT_STARTED;
2026-07-20 16:05:17 +00:00
} else if (tmp.timestampSec >= tmp.duration) {
2026-08-24 06:08:38 +00:00
IN_PROGRESS = closure_1_5.COMPLETED;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
IN_PROGRESS = closure_1_5.IN_PROGRESS;
2026-07-20 16:05:17 +00:00
}
return IN_PROGRESS;
},
resetQuest(questId) {
2026-07-23 10:11:24 +00:00
const callback = questId;
2026-08-24 06:08:38 +00:00
callback(closure_1_2[4]).batchUpdates(() => {
2026-07-23 10:11:24 +00:00
const items = [questId];
2026-08-24 06:08:38 +00:00
questId({ videoProgress: closure_2_3(closure_1_1().videoProgress, items.map(closure_2_4)) });
2026-07-20 16:05:17 +00:00
});
},
clearState() {
2026-08-24 06:08:38 +00:00
callback(closure_1_2[4]).batchUpdates(() => {
2026-07-29 08:29:29 +00:00
callback({ videoProgress: {} });
2026-07-20 16:05:17 +00:00
});
},
setTranscriptAsset(arg0) {
2026-07-23 10:11:24 +00:00
const callback = arg0;
2026-08-24 06:08:38 +00:00
callback(closure_1_2[4]).batchUpdates(() => {
2026-07-23 10:11:24 +00:00
callback({ transcript: callback });
2026-07-20 16:05:17 +00:00
});
}
};
}, obj));
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/quests/VideoQuestUIStore.tsx");
2026-07-20 16:05:17 +00:00
export default withEqualityFnResult;
2026-07-23 10:11:24 +00:00
export const DEFAULT_VIDEO_PROGRESS = { timestampSec: 0, duration: 10, maxTimestampSec: 0 };
2026-07-20 16:05:17 +00:00
export const VideoProgressState = obj;
export const FetchStatus = { NONE: "NONE", FETCHING: "FETCHING", SUCCESS: "SUCCESS", FAILURE: "FAILURE" };
export const useVideoQuestUIStore = withEqualityFnResult;