decord/source/modules/quests/native/VideoQuestModal/VideoQuestTranscriptActionSheet.tsx

95 lines
3.5 KiB
TypeScript
Raw Normal View History

// Module ID: 15360
// Function ID: 15361
2026-07-20 16:05:17 +00:00
// Name: VideoQuestTranscriptActionSheet
// Dependencies: [19, 17, 7901, 21, 4722, 576, 1612, 11537, 11528, 7393, 7345, 1115, 6820, 5142, 4718, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 15360 (VideoQuestTranscriptActionSheet)
import nativeDefault from "native" /* 576 */;
import useSafeAreaInsetsDefault from "useSafeAreaInsets" /* 1612 */;
import QuestActionCreators from "QuestActionCreators" /* 11528 */;
import AssetUtils from "AssetUtils" /* 11537 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
require = fn;
const ActivityIndicator = fn(17).ActivityIndicator;
const VideoQuestUIStore = fn(7901);
({ FetchStatus: hasOwnProperty, useVideoQuestUIStore: metroRequire } = VideoQuestUIStore);
const jsxProd = fn(21);
({ jsx: closure_7, jsxs: closure_8 } = jsxProd);
const createStyles = fn(4722);
let obj2 = { content: { paddingBottom: nativeDefault.space.PX_8 }, loadingSpinner: { height: 100 } };
let closure_9 = createStyles.createStyles(obj2);
const size = fn(2);
const result = size.fileFinishedImporting("modules/quests/native/VideoQuestModal/VideoQuestTranscriptActionSheet.tsx");
2026-07-20 16:05:17 +00:00
export default function VideoQuestTranscriptActionSheet(quest) {
quest = quest.quest;
const tmp = closure_9();
const tmp2 = closure_6((transcript) => transcript.transcript);
2026-07-29 08:29:29 +00:00
importDefault = tmp2;
2026-07-23 10:11:24 +00:00
let items = [quest, tmp2];
const effect = noop.useEffect(() => {
const questAsset = AssetUtils.getQuestAsset(quest, AssetUtils.QuestAssetType.VIDEO_PLAYER_TRANSCRIPT, undefined, true);
2026-08-24 06:08:38 +00:00
let tmp6 = null == closure_1 || tmp5.questId !== tmp3.id;
2026-07-29 08:29:29 +00:00
if (!tmp6) {
tmp6 = tmp5.fetchStatus === constants.NONE;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp6) {
let tmp9 = tmp5.fetchStatus === constants.SUCCESS;
2026-07-20 16:05:17 +00:00
if (tmp9) {
let url;
2026-07-29 08:29:29 +00:00
if (questAsset != null) {
2026-07-20 16:05:17 +00:00
url = questAsset.url;
}
2026-07-29 08:29:29 +00:00
tmp9 = url !== tmp5.url;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp6 = tmp9;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp6) {
const videoTranscript = QuestActionCreators.fetchVideoTranscript(tmp3, true);
const tmpResult = QuestActionCreators;
2026-07-20 16:05:17 +00:00
}
}, items);
let text;
2026-07-29 08:29:29 +00:00
if (tmp2 != null) {
2026-07-20 16:05:17 +00:00
text = tmp2.text;
}
const items1 = [text];
const memo = noop.useMemo(() => {
2026-07-20 16:05:17 +00:00
let text;
2026-08-24 06:08:38 +00:00
if (closure_1 != null) {
2026-07-29 08:29:29 +00:00
text = tmp.text;
2026-07-20 16:05:17 +00:00
}
if (null == text) {
let items = [];
} else {
2026-07-29 08:29:29 +00:00
const parts = tmp.text.split("\n");
const mapped = parts.map((item) => item.trim());
items = mapped.filter((item) => item.length > 0);
2026-07-20 16:05:17 +00:00
}
return items;
}, items1);
const obj = { scrollable: true, header: null, children: null };
const obj2 = { title: null };
const intl = quest(1115).intl;
obj2.title = intl.string(quest(1115).t["1YS80z"]);
obj.header = closure_7(quest(7345).BottomSheetTitleHeader, obj2);
const obj3 = { contentContainerStyle: { paddingBottom: useSafeAreaInsetsDefault().bottom }, children: null };
const obj4 = { spacing: 16, style: tmp.content, children: null };
2026-07-20 16:05:17 +00:00
let fetchStatus;
2026-07-29 08:29:29 +00:00
if (tmp2 != null) {
2026-07-20 16:05:17 +00:00
fetchStatus = tmp2.fetchStatus;
}
2026-07-29 08:29:29 +00:00
let tmp7Result = fetchStatus === constants.FETCHING;
if (tmp7Result) {
const obj5 = { style: tmp.loadingSpinner, size: "large" };
tmp7Result = tmp7(ActivityIndicator, obj5);
2026-07-20 16:05:17 +00:00
}
const items2 = [tmp7Result, memo.length > 0 && memo.map((children, index) => closure_1_7(quest(dependencyMap[14]).Text, { variant: "heading-md/normal", color: "text-muted", children }, index))];
obj4.children = items2;
obj3.children = closure_8(quest(5142).Stack, obj4);
obj.children = closure_7(quest(6820).BottomSheetScrollView, obj3);
return closure_7(quest(7393).ActionSheet, obj);
2026-07-20 16:05:17 +00:00
};