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

325 lines
13 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 14545
// Function ID: 14546
2026-07-20 16:05:17 +00:00
// Name: VideoQuestModalSteps
2026-08-24 06:08:38 +00:00
// Dependencies: [32, 19, 17, 676, 21, 4668, 712, 14546, 11003, 7508, 14516, 9032, 4119, 4749, 1629, 8164, 14547, 6840, 14550, 14578, 10986, 10723, 10996, 6756, 11154, 2]
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
// Module 14545 (VideoQuestModalSteps)
import ThemesDefault from "Themes" /* 712 */;
import closure_3 from "_slicedToArray" /* 32 */;
import importAllResult from "noop" /* 19 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
import { AnalyticEvents } from "ME" /* 676 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
let c4 = importAllResult;
({ View: c5, StyleSheet } = get_ActivityIndicator);
2026-08-24 06:08:38 +00:00
({ jsx: error, jsxs: closure_8 } = jsxProd);
2026-07-23 10:11:24 +00:00
let closure_9 = { mass: 1.9, damping: 18, stiffness: 80, overshootClamping: true };
2026-07-20 16:05:17 +00:00
let obj = { WATCH_VIDEO: 0, [0]: "WATCH_VIDEO", POST_WATCH_VIDEO: 1, [1]: "POST_WATCH_VIDEO" };
2026-08-24 06:08:38 +00:00
obj = { root: { backgroundColor: ThemesDefault.colors.BACKGROUND_SCRIM }, pillarboxed: { alignSelf: "center" }, wrapper: { flexDirection: "column", flexGrow: 1, flexShrink: 1, zIndex: 1 }, contentWrapper: { flex: 1 }, contentBackground: null, modalContentWrapper: null, backgroundWrapper: null };
2026-07-29 08:29:29 +00:00
createCacheKey = {};
2026-08-12 06:57:52 +00:00
const merged = Object.assign(StyleSheet.absoluteFillObject);
2026-08-24 06:08:38 +00:00
createCacheKey.borderRadius = ThemesDefault.radii.lg;
createCacheKey.backgroundColor = ThemesDefault.colors.BACKGROUND_BASE_LOWEST;
2026-07-29 08:29:29 +00:00
obj[4] = createCacheKey;
2026-08-12 06:57:52 +00:00
obj[5] = { zIndex: 2 };
let obj3 = {};
const merged1 = Object.assign(StyleSheet.absoluteFillObject);
2026-08-24 06:08:38 +00:00
obj3.borderRadius = ThemesDefault.radii.lg;
2026-08-12 06:57:52 +00:00
obj3.flex = 1;
obj3.overflow = "hidden";
obj3.pointerEvents = "none";
obj3.zIndex = 1;
obj[6] = obj3;
2026-07-29 08:29:29 +00:00
let closure_11 = createCacheKey.createStyles(obj);
2026-07-20 16:05:17 +00:00
let closure_12 = { code: "function VideoQuestModalTsx1(){const{withSpring,clamp,postWatchAnimationState,BACKGROUND_ENTRANCE_ANIMATION_SPRING_CONFIG,interpolate,CLOUDS_BACKGROUND_INVISIBLE_OFFSET_Y}=this.__closure;return{opacity:withSpring(clamp(postWatchAnimationState.get(),0,1),BACKGROUND_ENTRANCE_ANIMATION_SPRING_CONFIG),transform:[{translateY:withSpring(interpolate(postWatchAnimationState.get(),[0,1],[CLOUDS_BACKGROUND_INVISIBLE_OFFSET_Y,0]),BACKGROUND_ENTRANCE_ANIMATION_SPRING_CONFIG)}]};}" };
let closure_13 = { code: "function VideoQuestModalTsx2(){const{withSpring,interpolate,postWatchAnimationState,safeAreaInsets,BACKGROUND_ENTRANCE_ANIMATION_SPRING_CONFIG}=this.__closure;return{transform:[{translateY:withSpring(interpolate(postWatchAnimationState.get(),[0,1],[safeAreaInsets.top,0]),BACKGROUND_ENTRANCE_ANIMATION_SPRING_CONFIG)}],opacity:withSpring(postWatchAnimationState.get(),BACKGROUND_ENTRANCE_ANIMATION_SPRING_CONFIG)};}" };
let closure_14 = importAllResult.memo((sourceQuestContent) => {
({ onClose, initialStep } = sourceQuestContent);
sourceQuestContent = sourceQuestContent.sourceQuestContent;
2026-08-24 06:08:38 +00:00
obj = initialStep(quest[7]);
2026-07-20 16:05:17 +00:00
const videoQuestModalContext = obj.useVideoQuestModalContext();
2026-07-23 10:11:24 +00:00
quest = videoQuestModalContext.quest;
2026-07-20 16:05:17 +00:00
const videoSessionId = videoQuestModalContext.videoSessionId;
const userStatus = quest.userStatus;
let completedAt;
2026-07-29 08:29:29 +00:00
if (userStatus != null) {
2026-07-20 16:05:17 +00:00
completedAt = userStatus.completedAt;
}
2026-08-24 06:08:38 +00:00
obj1 = importAllResult;
2026-07-29 08:29:29 +00:00
if (initialStep != null) {
const tmp9 = videoSessionId(importAllResult.useState(initialStep), 2);
const first = tmp9[0];
2026-08-24 06:08:38 +00:00
closure_6 = tmp9[1];
2026-08-12 06:57:52 +00:00
[tmp12, closure_7] = videoSessionId(obj1.useState(false), 2);
2026-07-23 10:11:24 +00:00
let items = [quest.id, videoSessionId, sourceQuestContent];
2026-08-12 06:57:52 +00:00
const callback = obj1.useCallback((arg0) => {
const applyOrientationLock = initialStep(quest[8]).applyOrientationLock;
2026-07-20 16:05:17 +00:00
if (arg0) {
2026-08-12 06:57:52 +00:00
applyOrientationLock("LANDSCAPE");
2026-07-20 16:05:17 +00:00
} else {
2026-08-12 06:57:52 +00:00
applyOrientationLock("PORTRAIT");
2026-07-20 16:05:17 +00:00
}
callback2(arg0);
2026-08-24 06:08:38 +00:00
obj = initialStep(quest[9]);
2026-07-20 16:05:17 +00:00
obj = { questId: quest.id, event: arg0 ? tmp5.QUEST_VIDEO_FULLSCREEN_ENTERED : tmp5.QUEST_VIDEO_FULLSCREEN_EXITED, properties: obj, sourceQuestContent };
obj = { video_session_id: videoSessionId };
obj.trackQuestEvent(obj);
}, items);
2026-08-12 06:57:52 +00:00
const tmp15 = sharedValue();
2026-08-24 06:08:38 +00:00
closure_9 = tmp15;
2026-08-12 06:57:52 +00:00
const tmp17 = sourceQuestContent(tmp2[11])(obj1.useContext(tmp(tmp2[10]).QuestDockGestureContext).windowDimensions);
({ width, height } = tmp17);
let bound = null;
if (tmp17.landscape) {
bound = null;
if (!tmp12) {
const _Math = Math;
const _Math2 = Math;
bound = Math.min(width, Math.floor(0.5625 * height));
}
}
let items1 = [bound, tmp15.pillarboxed];
const items2 = [tmp5, initialStep];
const memo = obj1.useMemo(() => {
let tmp2 = null;
if (null != bound) {
2026-08-24 06:08:38 +00:00
const items = [pillarboxed.pillarboxed, ];
obj = { width: null };
2026-08-12 06:57:52 +00:00
obj[0] = tmp;
items[1] = obj;
tmp2 = items;
}
return tmp2;
}, items1);
2026-07-29 08:29:29 +00:00
const layoutEffect = obj1.useLayoutEffect(() => {
2026-07-23 10:11:24 +00:00
let tmp = closure_4;
if (closure_4) {
2026-07-20 16:05:17 +00:00
tmp = null == initialStep;
}
if (tmp) {
2026-08-12 06:57:52 +00:00
callback(bound.POST_WATCH_VIDEO);
2026-07-20 16:05:17 +00:00
}
2026-08-12 06:57:52 +00:00
}, items2);
const items3 = [callback];
2026-07-29 08:29:29 +00:00
const callback1 = obj1.useCallback(() => {
2026-08-12 06:57:52 +00:00
callback(bound.WATCH_VIDEO);
2026-07-20 16:05:17 +00:00
}, []);
2026-08-12 06:57:52 +00:00
const callback2 = obj1.useCallback(() => {
2026-07-20 16:05:17 +00:00
callback(false);
2026-08-12 06:57:52 +00:00
callback(bound.POST_WATCH_VIDEO);
}, items3);
2026-07-29 08:29:29 +00:00
let tmpResult = tmp(tmp2[12]);
2026-08-12 06:57:52 +00:00
let num3 = 0;
if (first === bound.POST_WATCH_VIDEO) {
num3 = 1;
2026-07-20 16:05:17 +00:00
}
2026-08-12 06:57:52 +00:00
sharedValue = tmpResult.useSharedValue(num3);
2026-07-29 08:29:29 +00:00
tmpResult = tmp(tmp2[12]);
2026-08-12 06:57:52 +00:00
class L {
constructor() {
obj = { opacity: null, transform: null };
obj2 = initialStep(quest[13]);
obj3 = initialStep(quest[12]);
2026-08-24 06:08:38 +00:00
obj[0] = obj2.withSpring(obj3.clamp(closure_11.get(), 0, 1), closure_9);
2026-08-12 06:57:52 +00:00
obj = { translateY: null };
obj5 = initialStep(quest[13]);
obj6 = initialStep(quest[12]);
2026-08-24 06:08:38 +00:00
obj[0] = obj5.withSpring(obj6.interpolate(closure_11.get(), [0, 1], [-100, 0]), closure_9);
2026-08-12 06:57:52 +00:00
items = [];
items[0] = obj;
obj[1] = items;
return obj;
}
}
2026-07-29 08:29:29 +00:00
obj = { withSpring: null, clamp: null, postWatchAnimationState: null, BACKGROUND_ENTRANCE_ANIMATION_SPRING_CONFIG: null, interpolate: null, CLOUDS_BACKGROUND_INVISIBLE_OFFSET_Y: -100 };
obj[0] = tmp(tmp2[13]).withSpring;
obj[1] = tmp(tmp2[12]).clamp;
obj[2] = sharedValue;
2026-08-12 06:57:52 +00:00
obj[3] = closure_9;
2026-07-29 08:29:29 +00:00
obj[4] = tmp(tmp2[12]).interpolate;
2026-08-12 06:57:52 +00:00
L.__closure = obj;
L.__workletHash = 11571705142399;
L.__initData = closure_12;
const animatedStyle = tmpResult.useAnimatedStyle(L);
const tmp29 = sourceQuestContent(tmp2[14])();
closure_12 = tmp29;
const tmp11 = videoSessionId(obj1.useState(false), 2);
class U {
2026-07-20 16:05:17 +00:00
constructor() {
2026-07-29 08:29:29 +00:00
obj = { transform: null, opacity: null };
obj = { translateY: null };
2026-07-20 16:05:17 +00:00
obj3 = initialStep(quest[13]);
obj4 = initialStep(quest[12]);
items = [, ];
2026-08-12 06:57:52 +00:00
items[0] = closure_12.top;
2026-07-20 16:05:17 +00:00
items[1] = 0;
2026-08-24 06:08:38 +00:00
obj[0] = obj3.withSpring(obj4.interpolate(closure_11.get(), [0, 1], items), closure_9);
2026-07-20 16:05:17 +00:00
items1 = [];
items1[0] = obj;
2026-07-29 08:29:29 +00:00
obj[0] = items1;
2026-07-20 16:05:17 +00:00
obj5 = initialStep(quest[13]);
2026-08-24 06:08:38 +00:00
obj[1] = obj5.withSpring(closure_11.get(), closure_9);
2026-07-20 16:05:17 +00:00
return obj;
}
}
2026-07-29 08:29:29 +00:00
obj = { withSpring: null, interpolate: null, postWatchAnimationState: null, safeAreaInsets: null, BACKGROUND_ENTRANCE_ANIMATION_SPRING_CONFIG: null };
obj[0] = tmp(tmp2[13]).withSpring;
obj[1] = tmp(tmp2[12]).interpolate;
obj[2] = sharedValue;
2026-08-12 06:57:52 +00:00
obj[3] = tmp29;
obj[4] = closure_9;
U.__closure = obj;
U.__workletHash = 9769051401109;
U.__initData = closure_13;
const items4 = [sharedValue, first];
const animatedStyle1 = tmp(tmp2[12]).useAnimatedStyle(U);
2026-07-29 08:29:29 +00:00
const effect = obj1.useEffect(() => {
2026-07-20 16:05:17 +00:00
let num = 0;
2026-08-12 06:57:52 +00:00
if (first === bound.POST_WATCH_VIDEO) {
2026-07-20 16:05:17 +00:00
num = 1;
}
const result = sharedValue.set(num);
2026-08-12 06:57:52 +00:00
}, items4);
2026-07-29 08:29:29 +00:00
obj1 = { style: null, children: null };
2026-08-12 06:57:52 +00:00
obj1[0] = tmp15.root;
2026-07-29 08:29:29 +00:00
let obj2 = { style: null, children: null };
2026-08-12 06:57:52 +00:00
const items5 = [tmp15.modalContentWrapper, memo];
obj2[0] = items5;
let obj3 = { style: null, children: null };
const items6 = [tmp15.backgroundWrapper, ];
let obj4 = { height: null };
obj4[0] = height;
items6[1] = obj4;
obj3[0] = items6;
let tmp16Result = tmp16(tmp2[15]);
let obj5 = { style: null };
const items7 = [tmp15.contentBackground, ];
const obj6 = { top: null };
obj6[0] = tmp29.top;
items7[1] = obj6;
obj5[0] = items7;
const items8 = [callback(sourceQuestContent(tmp2[15]), obj5), , ];
const obj7 = { style: null };
const items9 = [tmp15.contentBackground, animatedStyle1];
obj7[0] = items9;
items8[1] = callback(sourceQuestContent(tmp2[15]), obj7);
const obj8 = { style: null, children: null };
obj8[0] = animatedStyle;
tmp16Result = tmp16(tmp2[15]);
obj8[1] = callback(sourceQuestContent(tmp2[16]), { align: "top" });
items8[2] = callback(tmp16Result, obj8);
obj3[1] = items8;
const items10 = [callback(first, obj3), ];
const obj9 = { top: true, style: null, children: null };
const items11 = [tmp15.wrapper, ];
const obj10 = { height: null };
obj10[0] = height;
items11[1] = obj10;
obj9[1] = items11;
const obj11 = { style: null, children: null };
obj11[0] = tmp15.contentWrapper;
let tmp33Result = first === tmp24.WATCH_VIDEO;
if (tmp33Result) {
if (bound == null) {
bound = width;
}
const obj12 = { contentWidth: null, isFullscreen: null, onNavigateToPostWatchVideo: null, onClose: null, onEnd: null, setIsFullscreen: null, sourceQuestContent: null };
obj12[0] = bound;
obj12[1] = tmp12;
obj12[2] = callback2;
obj12[3] = onClose;
obj12[4] = callback2;
obj12[5] = callback;
obj12[6] = sourceQuestContent;
tmp33Result = tmp33(tmp16(tmp2[18]), obj12);
const tmp16Result1 = tmp16(tmp2[18]);
2026-07-20 16:05:17 +00:00
}
2026-08-12 06:57:52 +00:00
const items12 = [tmp33Result, ];
tmp33Result = first === tmp24.POST_WATCH_VIDEO;
if (tmp33Result) {
const obj13 = { onClose: null, onRestartVideo: null, sourceQuestContent: null };
obj13[0] = onClose;
obj13[1] = callback1;
obj13[2] = sourceQuestContent;
tmp33Result = tmp33(tmp16(tmp2[19]), obj13);
2026-07-20 16:05:17 +00:00
}
2026-08-12 06:57:52 +00:00
items12[1] = tmp33Result;
obj11[1] = items12;
obj9[2] = callback(first, obj11);
items10[1] = callback(tmp(tmp2[17]).SafeAreaPaddingView, obj9);
obj2[1] = items10;
obj1[1] = callback(tmp16Result, obj2);
return callback(first, obj1);
2026-07-20 16:05:17 +00:00
}
});
2026-07-29 08:29:29 +00:00
const watch_mobile_video_quest = "watch_mobile_video_quest";
2026-08-24 06:08:38 +00:00
let obj1 = { backgroundColor: ThemesDefault.colors.BACKGROUND_SCRIM };
2026-07-20 16:05:17 +00:00
const memoResult = importAllResult.memo(function VideoQuestModal(questContentPosition) {
questContentPosition = questContentPosition.questContentPosition;
const onClose = questContentPosition.onClose;
const videoSessionId = questContentPosition.videoSessionId;
const initialStep = questContentPosition.initialStep;
const sourceQuestContent = questContentPosition.sourceQuestContent;
const items = [onClose];
2026-07-23 10:11:24 +00:00
const callback = sourceQuestContent.useCallback(() => {
2026-07-20 16:05:17 +00:00
const result = questContentPosition(videoSessionId[20]).showQuestUnavailableAlert();
onClose();
}, items);
2026-08-24 06:08:38 +00:00
obj = questContentPosition(videoSessionId[21]);
2026-07-20 16:05:17 +00:00
const nonNullableQuest = obj.useNonNullableQuest(questContentPosition.questId, callback);
const items1 = [onClose, nonNullableQuest, videoSessionId, questContentPosition, initialStep, sourceQuestContent];
2026-07-23 10:11:24 +00:00
const memo = sourceQuestContent.useMemo(() => {
2026-07-20 16:05:17 +00:00
let tmp = null;
if (null != nonNullableQuest) {
2026-08-24 06:08:38 +00:00
obj = {};
2026-07-29 08:29:29 +00:00
obj = { fullscreen: true, headerLeft: null, render: null };
obj[1] = function headerLeft() {
return null;
};
obj[2] = function render() {
obj = { value: obj, children: null };
obj = { quest: closure_5, videoSessionId: closure_2 };
2026-08-24 06:08:38 +00:00
obj = {
children: closure_1_7(closure_1_0(closure_1_2[22]).BillableAdPlacementImpressionTrackerNative, {
overrideVisibility: true,
questContent: closure_1_0(closure_1_2[23]).QuestContent.VIDEO_MODAL_MOBILE,
questOrQuests: closure_5,
questContentPosition: closure_0,
sourceQuestContent: closure_4,
children() {
return closure_1_7(closure_1_14, { initialStep: closure_3, onClose: closure_1, sourceQuestContent: closure_4 });
}
})
2026-07-29 08:29:29 +00:00
};
2026-08-24 06:08:38 +00:00
obj[1] = closure_1_7(closure_1_0(closure_1_2[10]).QuestDockGestureContextProvider, obj);
return closure_1_7(closure_1_1(closure_1_2[7]).Provider, obj);
2026-07-20 16:05:17 +00:00
};
2026-08-24 06:08:38 +00:00
obj[closure_1_15] = obj;
2026-07-20 16:05:17 +00:00
tmp = obj;
}
return tmp;
}, items1);
2026-07-23 10:11:24 +00:00
const layoutEffect = sourceQuestContent.useLayoutEffect(() => {
2026-08-12 06:57:52 +00:00
questContentPosition(videoSessionId[8]).applyOrientationLock("PORTRAIT");
return questContentPosition(videoSessionId[8]).restoreDefaultOrientationLock;
2026-07-20 16:05:17 +00:00
}, []);
2026-07-29 08:29:29 +00:00
let tmp7 = null;
2026-07-20 16:05:17 +00:00
if (null != nonNullableQuest) {
2026-07-29 08:29:29 +00:00
tmp7 = null;
2026-07-20 16:05:17 +00:00
if (null != memo) {
2026-07-29 08:29:29 +00:00
obj = { hideTitle: true, initialRouteName: null, screens: null };
obj[1] = watch_mobile_video_quest;
obj[2] = memo;
tmp7 = callback(questContentPosition(videoSessionId[24]).Modal, obj);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
return tmp7;
2026-07-20 16:05:17 +00:00
});
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/quests/native/VideoQuestModal/VideoQuestModal.tsx");
2026-07-20 16:05:17 +00:00
export default memoResult;
export const VideoQuestModalSteps = obj;