decord/source/modules/quests/native/QuestDock/QuestDockEnrolledBody.tsx

242 lines
11 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 14615
// Function ID: 14616
2026-07-20 16:05:17 +00:00
// Name: EnrolledBodyWatchTask
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 19, 17, 7491, 14513, 6753, 14515, 21, 4668, 712, 14519, 14516, 9032, 14511, 14544, 6756, 14541, 14540, 14542, 14537, 1629, 7514, 2]
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
// Module 14615 (EnrolledBodyWatchTask)
import ThemesDefault from "Themes" /* 712 */;
import useSafeAreaInsetsDefault from "useSafeAreaInsets" /* 1629 */;
import QuestsVisibleMessagesChangedSource from "QuestsVisibleMessagesChangedSource" /* 6756 */;
import QuestBottomSheet from "QuestBottomSheet" /* 14540 */;
import QuestBottomSheetHeaderDefault from "QuestBottomSheetHeader" /* 14541 */;
import useQuestRewardClaimHandlerDefault from "useQuestRewardClaimHandler" /* 14542 */;
import closure_3 from "asyncGeneratorStep" /* 5 */;
import importAllResult from "noop" /* 19 */;
import { View } from "get ActivityIndicator" /* 17 */;
import closure_6 from "initializeState" /* 7491 */;
import closure_7 from "QuestDockMode" /* 14513 */;
import QuestsExperimentLocations from "QuestsExperimentLocations" /* 6753 */;
import QUEST_DOCK_COLLAPSED_HEIGHT from "QUEST_DOCK_COLLAPSED_HEIGHT" /* 14515 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function EnrolledBodyWatchTask(quest) {
quest = quest.quest;
2026-07-29 08:29:29 +00:00
let tmp = callback3();
2026-08-15 05:55:55 +00:00
const context = hasWatchVideoOnMobileTasks.useContext(quest(questDockWrapperSpecs[10]).QuestDockExternalCoordinationContext);
2026-07-20 16:05:17 +00:00
const setRestingQuestDockMode = context.setRestingQuestDockMode;
2026-08-15 05:55:55 +00:00
questDockWrapperSpecs = hasWatchVideoOnMobileTasks.useContext(quest(questDockWrapperSpecs[11]).QuestDockGestureContext).questDockWrapperSpecs;
const tmp7 = setRestingQuestDockMode(questDockWrapperSpecs[12])(context.restingQuestDockMode);
2026-08-24 06:08:38 +00:00
closure_3 = tmp7;
2026-08-15 05:55:55 +00:00
let obj = quest(questDockWrapperSpecs[13]);
2026-07-23 10:11:24 +00:00
hasWatchVideoOnMobileTasks = obj.useHasWatchVideoOnMobileTasks(quest.config);
2026-08-15 05:55:55 +00:00
const items = [tmp7, questDockWrapperSpecs, quest.id, setRestingQuestDockMode, hasWatchVideoOnMobileTasks, ];
let userStatus = quest.userStatus;
let completedAt;
if (userStatus != null) {
completedAt = userStatus.completedAt;
}
items[5] = completedAt;
2026-07-23 10:11:24 +00:00
const effect = hasWatchVideoOnMobileTasks.useEffect(() => {
2026-07-20 16:05:17 +00:00
function _maybeOpenVideoQuestModal() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback(function*() {
if (c2 === 2) {
c2 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c2 = 2;
if (0 === v0) {
if (arg0 === 1) {
c2 = 3;
throw arg1;
} else if (arg0 === 2) {
c2 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
const callback = tmp2;
let tmp12 = c2.get().prevDeltaY < 0;
if (tmp12) {
2026-08-24 06:08:38 +00:00
tmp12 = closure_1_3 === closure_2_8.RESET_TO_PREVIOUS;
2026-08-15 05:55:55 +00:00
}
if (tmp12) {
2026-08-24 06:08:38 +00:00
tmp12 = closure_2_7.prevRestingQuestDockMode === closure_2_8.EXPANDED;
2026-07-29 08:29:29 +00:00
}
if (tmp12) {
2026-08-24 06:08:38 +00:00
const isQuestAccessSuspended = closure_2_6.isQuestAccessSuspended;
2026-08-15 05:55:55 +00:00
let tmp16 = !isQuestAccessSuspended;
if (isQuestAccessSuspended) {
2026-08-24 06:08:38 +00:00
const userStatus = closure_1_0.userStatus;
2026-08-15 05:55:55 +00:00
let completedAt;
if (userStatus != null) {
completedAt = userStatus.completedAt;
}
tmp16 = null != completedAt;
}
tmp12 = tmp16;
2026-07-29 08:29:29 +00:00
}
if (tmp12) {
2026-08-24 06:08:38 +00:00
obj1 = { questId: null, sourceQuestContent: null };
obj1[0] = closure_1_0.id;
obj1[1] = callback(closure_2_2[15]).QuestContent.QUEST_BAR_MOBILE;
2026-07-29 08:29:29 +00:00
v0 = 1;
c2 = 1;
const obj2 = { value: null, done: false };
2026-08-24 06:08:38 +00:00
obj2[0] = closure_2_1(closure_2_2[14])(obj1);
2026-07-29 08:29:29 +00:00
return obj2;
} else {
c2 = 3;
}
}
} else if (arg0 === 1) {
c2 = 3;
throw arg1;
} else if (arg0 !== 2) {
2026-08-24 06:08:38 +00:00
v0(closure_2_8.COLLAPSED);
2026-07-29 08:29:29 +00:00
}
c2 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
2026-08-15 05:55:55 +00:00
} catch (tmp25) {
2026-07-29 08:29:29 +00:00
c2 = tmp;
2026-08-15 05:55:55 +00:00
throw tmp25;
2026-07-29 08:29:29 +00:00
}
}
});
2026-08-24 06:08:38 +00:00
closure_0 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
if (hasWatchVideoOnMobileTasks) {
2026-07-23 10:11:24 +00:00
(function maybeOpenVideoQuestModal() {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _maybeOpenVideoQuestModal.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-23 10:11:24 +00:00
})();
2026-07-20 16:05:17 +00:00
}
}, items);
2026-07-29 08:29:29 +00:00
obj = { children: null };
obj = { style: tmp.headerWrapper, children: null };
2026-08-24 06:08:38 +00:00
obj1 = { quest, step: null, withActionSheet: true, location: null };
2026-08-15 05:55:55 +00:00
let tmp6Result = tmp6(tmp4[16]);
obj1[1] = quest(questDockWrapperSpecs[17]).QuestBottomSheetStep.TASK_STATUS;
2026-07-29 08:29:29 +00:00
obj1[3] = constants.QUESTS_BAR_MOBILE;
2026-08-15 05:55:55 +00:00
obj[1] = callback(tmp6Result, obj1);
2026-07-20 16:05:17 +00:00
const items1 = [callback(View, obj), , ];
2026-08-24 06:08:38 +00:00
let obj2 = { style: tmp.contentWrapper, children: callback(quest(questDockWrapperSpecs[17]).QuestBottomSheetContent, { quest, location: constants.QUESTS_BAR_MOBILE, step: quest(questDockWrapperSpecs[17]).QuestBottomSheetStep.TASK_STATUS, sourceQuestContent: quest(questDockWrapperSpecs[15]).QuestContent.QUEST_BAR_MOBILE }) };
2026-07-20 16:05:17 +00:00
items1[1] = callback(View, obj2);
2026-07-29 08:29:29 +00:00
const obj4 = { style: tmp.footerWrapper, children: null };
const obj5 = { quest, step: null, style: null, withSafeArea: false, sourceQuestContent: null };
2026-08-15 05:55:55 +00:00
tmp6Result = tmp6(tmp4[18]);
obj5[1] = quest(questDockWrapperSpecs[17]).QuestBottomSheetStep.TASK_STATUS;
2026-07-29 08:29:29 +00:00
obj5[2] = tmp.footer;
2026-08-15 05:55:55 +00:00
obj5[4] = quest(questDockWrapperSpecs[15]).QuestContent.QUEST_BAR_MOBILE;
obj4[1] = callback(tmp6Result, obj5);
2026-07-20 16:05:17 +00:00
items1[2] = callback(View, obj4);
2026-07-29 08:29:29 +00:00
obj[0] = items1;
2026-08-15 05:55:55 +00:00
return callback2(closure_13, obj);
2026-07-20 16:05:17 +00:00
}
function EnrolledBodyPlayStreamTask(quest) {
quest = quest.quest;
const tmp = callback3();
2026-08-24 06:08:38 +00:00
let obj = QuestBottomSheet;
obj = { quest, location: constants.QUESTS_BAR_MOBILE, sourceQuestContent: QuestsVisibleMessagesChangedSource.QuestContent.QUEST_BAR_MOBILE };
2026-07-20 16:05:17 +00:00
const enrolledQuestContentProps = obj.useEnrolledQuestContentProps(obj);
({ step, defibrillator, stepActions } = enrolledQuestContentProps);
2026-07-29 08:29:29 +00:00
obj = { children: null };
2026-07-20 16:05:17 +00:00
({ handleTaskSelect, showMicrophone } = enrolledQuestContentProps);
2026-08-24 06:08:38 +00:00
const items = [callback(View, { style: tmp.headerWrapper, children: callback(QuestBottomSheetHeaderDefault, obj2) }), , ];
2026-07-29 08:29:29 +00:00
const obj3 = { style: tmp.contentWrapper, children: null };
2026-08-24 06:08:38 +00:00
obj1 = { style: tmp.headerWrapper, children: callback(QuestBottomSheetHeaderDefault, obj2) };
obj3[1] = callback(QuestBottomSheet.QuestBottomSheetContent, { defibrillator, quest, handleTaskSelect, location: constants.QUESTS_BAR_MOBILE, showMicrophone, step, sourceQuestContent: QuestsVisibleMessagesChangedSource.QuestContent.QUEST_BAR_MOBILE });
2026-07-20 16:05:17 +00:00
items[1] = callback(View, obj3);
2026-07-29 08:29:29 +00:00
const obj5 = { style: tmp.footerWrapper, children: null };
const obj6 = { quest, step, isDefibrilating: defibrillator.isActive, onBack: stepActions.onBack, onDefib: defibrillator.start, onConnectConsoleNext: stepActions.onNext, style: tmp.footer, withSafeArea: false, sourceQuestContent: null };
2026-08-24 06:08:38 +00:00
const obj4 = { defibrillator, quest, handleTaskSelect, location: constants.QUESTS_BAR_MOBILE, showMicrophone, step, sourceQuestContent: QuestsVisibleMessagesChangedSource.QuestContent.QUEST_BAR_MOBILE };
obj6[8] = QuestsVisibleMessagesChangedSource.QuestContent.QUEST_BAR_MOBILE;
obj5[1] = callback(useQuestRewardClaimHandlerDefault, obj6);
2026-07-20 16:05:17 +00:00
items[2] = callback(View, obj5);
2026-07-29 08:29:29 +00:00
obj[0] = items;
2026-08-15 05:55:55 +00:00
return callback2(closure_13, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let c4 = importAllResult;
2026-08-24 06:08:38 +00:00
({ QuestDockMode: closure_8, QuestsExperimentLocations: c9 } = QuestsExperimentLocations);
2026-08-15 05:55:55 +00:00
({ QUEST_DOCK_EXPANDED_HEIGHT: c10, QUEST_DOCK_EXPANDED_PADDING_BOTTOM } = QUEST_DOCK_COLLAPSED_HEIGHT);
2026-07-29 08:29:29 +00:00
({ QUEST_DOCK_EXPANDED_PADDING_HORIZONTAL, QUEST_DOCK_EXPANDED_ENROLLED_PADDING_TOP } = QUEST_DOCK_COLLAPSED_HEIGHT);
2026-08-15 05:55:55 +00:00
({ jsx: closure_12, Fragment: map1, jsxs: closure_14 } = jsxProd);
2026-07-29 08:29:29 +00:00
let obj = { wrapper: { flexGrow: 0, flexShrink: 0, paddingBottom: QUEST_DOCK_EXPANDED_PADDING_BOTTOM, paddingTop: QUEST_DOCK_EXPANDED_ENROLLED_PADDING_TOP, paddingHorizontal: QUEST_DOCK_EXPANDED_PADDING_HORIZONTAL }, headerWrapper: null, contentWrapper: null, footer: null, footerWrapper: null };
2026-08-24 06:08:38 +00:00
obj = { marginBottom: ThemesDefault.space.PX_16 };
2026-07-29 08:29:29 +00:00
obj[1] = obj;
2026-08-24 06:08:38 +00:00
createCacheKey = { display: "flex", gap: ThemesDefault.space.PX_16, flexGrow: 0, flexShrink: 0 };
2026-07-29 08:29:29 +00:00
obj[2] = createCacheKey;
2026-08-24 06:08:38 +00:00
obj[3] = { marginTop: ThemesDefault.space.PX_16 };
2026-07-29 08:29:29 +00:00
obj[4] = { marginLeft: -1 * QUEST_DOCK_EXPANDED_PADDING_HORIZONTAL, marginRight: -1 * QUEST_DOCK_EXPANDED_PADDING_HORIZONTAL };
2026-08-15 05:55:55 +00:00
let closure_15 = createCacheKey.createStyles(obj);
2026-08-24 06:08:38 +00:00
let obj2 = { marginTop: ThemesDefault.space.PX_16 };
2026-07-29 08:29:29 +00:00
let obj3 = { marginLeft: -1 * QUEST_DOCK_EXPANDED_PADDING_HORIZONTAL, marginRight: -1 * QUEST_DOCK_EXPANDED_PADDING_HORIZONTAL };
2026-07-31 08:44:05 +00:00
const memoResult = importAllResult.memo(function QuestDockEnrolledBody() {
2026-08-24 06:08:38 +00:00
let obj = minExpandedContentHeight(14537);
2026-07-31 08:44:05 +00:00
const questCreative = obj.useQuestCreative();
2026-08-24 06:08:38 +00:00
minExpandedContentHeight = importAllResult.useContext(minExpandedContentHeight(14516).QuestDockGestureContext).minExpandedContentHeight;
2026-07-20 16:05:17 +00:00
const items = [minExpandedContentHeight];
const items1 = [minExpandedContentHeight];
const callback = importAllResult.useCallback((nativeEvent) => {
const height = nativeEvent.nativeEvent.layout.height;
if (minExpandedContentHeight.get() !== height) {
const result = minExpandedContentHeight.set(height);
}
}, items);
const effect = importAllResult.useEffect(() => () => {
2026-08-24 06:08:38 +00:00
if (closure_0.get() !== closure_1_10) {
2026-07-29 08:29:29 +00:00
const result = closure_0.set(tmp);
2026-07-20 16:05:17 +00:00
}
}, items1);
2026-07-31 08:44:05 +00:00
obj = { style: null, onLayout: null, children: null };
2026-07-20 16:05:17 +00:00
const items2 = [callback3().wrapper, ];
2026-08-24 06:08:38 +00:00
obj = { paddingBottom: Math.max(useSafeAreaInsetsDefault().bottom, QUEST_DOCK_EXPANDED_PADDING_BOTTOM) };
2026-07-20 16:05:17 +00:00
items2[1] = obj;
2026-07-29 08:29:29 +00:00
obj[0] = items2;
obj[1] = callback;
2026-07-31 08:44:05 +00:00
const tmp2 = callback3();
const tmp6 = View;
if (obj4.hasWatchVideoTasks(questCreative)) {
2026-08-24 06:08:38 +00:00
obj1 = { quest: null };
2026-07-31 08:44:05 +00:00
obj1[0] = questCreative;
let tmp5Result = tmp5(EnrolledBodyWatchTask, obj1);
} else {
const obj2 = { quest: null };
obj2[0] = questCreative;
tmp5Result = tmp5(EnrolledBodyPlayStreamTask, obj2);
2026-07-20 16:05:17 +00:00
}
2026-07-31 08:44:05 +00:00
obj[2] = tmp5Result;
2026-08-15 05:55:55 +00:00
return closure_12(tmp6, obj);
2026-07-20 16:05:17 +00:00
});
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/quests/native/QuestDock/QuestDockEnrolledBody.tsx");
2026-07-20 16:05:17 +00:00
export default memoResult;