Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4759.js (118.4 MB)
296 lines
13 KiB
TypeScript
296 lines
13 KiB
TypeScript
// Module ID: 15155
|
|
// Function ID: 15156
|
|
// Name: VideoQuestModal
|
|
// Dependencies: [32, 19, 17, 1074, 21, 4574, 576, 15156, 11816, 7732, 15126, 8295, 4310, 4988, 1611, 7087, 15157, 7137, 15160, 15187, 11798, 11515, 11809, 5461, 11959, 2]
|
|
|
|
// Module 15155 (VideoQuestModal)
|
|
import nativeDefault from "native" /* 576 */;
|
|
import ReanimatedRexport from "ReanimatedRexport" /* 4310 */;
|
|
import spring from "spring" /* 4988 */;
|
|
import AnalyticsActions from "AnalyticsActions" /* 7732 */;
|
|
import QuestUtils from "QuestUtils" /* 11798 */;
|
|
import applyOrientationLock2 from "applyOrientationLock" /* 11816 */;
|
|
import _slicedToArray from "module_32" /* 32 */;
|
|
import noop from "module_19" /* 19 */;
|
|
|
|
require = fn;
|
|
get_ActivityIndicator = fn(17);
|
|
({ View: hasOwnProperty, StyleSheet } = get_ActivityIndicator);
|
|
const AnalyticEvents = fn(1074).AnalyticEvents;
|
|
const jsxProd = fn(21);
|
|
({ jsx: closure_7, jsxs: closure_8 } = jsxProd);
|
|
let closure_9 = { mass: 1.9, damping: 18, stiffness: 80, overshootClamping: true };
|
|
const VideoQuestModalSteps = { WATCH_VIDEO: 0, [0]: "WATCH_VIDEO", POST_WATCH_VIDEO: 1, [1]: "POST_WATCH_VIDEO" };
|
|
const createStyles = fn(4574);
|
|
let obj2 = { root: { backgroundColor: nativeDefault.colors.BACKGROUND_SCRIM }, pillarboxed: { alignSelf: "center" }, wrapper: { flexDirection: "column", flexGrow: 1, flexShrink: 1, zIndex: 1 }, contentWrapper: { flex: 1 }, contentBackground: null, modalContentWrapper: null, backgroundWrapper: null };
|
|
let obj5 = {};
|
|
const merged = Object.assign(StyleSheet.absoluteFillObject);
|
|
obj5.borderRadius = nativeDefault.radii.lg;
|
|
obj5.backgroundColor = nativeDefault.colors.BACKGROUND_BASE_LOWEST;
|
|
obj2.contentBackground = obj5;
|
|
obj2.modalContentWrapper = { zIndex: 2 };
|
|
let obj6 = {};
|
|
const merged1 = Object.assign(StyleSheet.absoluteFillObject);
|
|
obj6.borderRadius = nativeDefault.radii.lg;
|
|
obj6.flex = 1;
|
|
obj6.overflow = "hidden";
|
|
obj6.pointerEvents = "none";
|
|
obj6.zIndex = 1;
|
|
obj2.backgroundWrapper = obj6;
|
|
let closure_11 = createStyles.createStyles(obj2);
|
|
let __initData = { 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)}]};}" };
|
|
const __initData2 = { 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 = noop.memo((sourceQuestContent) => {
|
|
({ onClose, initialStep } = sourceQuestContent);
|
|
sourceQuestContent = sourceQuestContent.sourceQuestContent;
|
|
const videoQuestModalContext = initialStep(quest[7]).useVideoQuestModalContext();
|
|
quest = videoQuestModalContext.quest;
|
|
const videoSessionId = videoQuestModalContext.videoSessionId;
|
|
const userStatus = quest.userStatus;
|
|
let completedAt;
|
|
if (userStatus != null) {
|
|
completedAt = userStatus.completedAt;
|
|
}
|
|
noop = tmp5;
|
|
if (initialStep != null) {
|
|
const tmp9 = videoSessionId(noop.useState(initialStep), 2);
|
|
const first = tmp9[0];
|
|
closure_6 = tmp9[1];
|
|
[tmp12, closure_7] = videoSessionId(obj2.useState(false), 2);
|
|
let items = [quest.id, videoSessionId, sourceQuestContent];
|
|
const setIsFullscreen = obj2.useCallback((arg0) => {
|
|
const applyOrientationLock = applyOrientationLock2.applyOrientationLock;
|
|
if (arg0) {
|
|
applyOrientationLock("LANDSCAPE");
|
|
} else {
|
|
applyOrientationLock("PORTRAIT");
|
|
}
|
|
closure_1_7(arg0);
|
|
const obj2 = { questId: quest.id, event: arg0 ? AnalyticEvents.QUEST_VIDEO_FULLSCREEN_ENTERED : AnalyticEvents.QUEST_VIDEO_FULLSCREEN_EXITED, properties: { video_session_id: videoSessionId }, sourceQuestContent };
|
|
AnalyticsActions.trackQuestEvent(obj2);
|
|
}, items);
|
|
const tmp15 = sharedValue();
|
|
const pillarboxed = tmp15;
|
|
const tmp17 = sourceQuestContent(tmp2[11])(obj2.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 = obj2.useMemo(() => {
|
|
let tmp2 = null;
|
|
if (null != bound) {
|
|
const items = [pillarboxed.pillarboxed, ];
|
|
const obj = { width: tmp };
|
|
items[1] = obj;
|
|
tmp2 = items;
|
|
}
|
|
return tmp2;
|
|
}, items1);
|
|
const layoutEffect = obj2.useLayoutEffect(() => {
|
|
let tmp = closure_4;
|
|
if (closure_4) {
|
|
tmp = null == initialStep;
|
|
}
|
|
if (tmp) {
|
|
closure_6(obj.POST_WATCH_VIDEO);
|
|
}
|
|
}, items2);
|
|
const items3 = [setIsFullscreen];
|
|
const callback1 = obj2.useCallback(() => {
|
|
closure_6(obj.WATCH_VIDEO);
|
|
}, []);
|
|
const callback2 = obj2.useCallback(() => {
|
|
callback(false);
|
|
closure_6(obj.POST_WATCH_VIDEO);
|
|
}, items3);
|
|
const tmp11 = videoSessionId(obj2.useState(false), 2);
|
|
let num3 = 0;
|
|
if (first === bound.POST_WATCH_VIDEO) {
|
|
num3 = 1;
|
|
}
|
|
sharedValue = tmp(tmp2[12]).useSharedValue(num3);
|
|
const tmpResult = tmp(tmp2[12]);
|
|
class L {
|
|
constructor() {
|
|
obj = { opacity: null, transform: null };
|
|
obj2 = closure_0(closure_2[13]);
|
|
obj3 = closure_0(closure_2[12]);
|
|
obj.opacity = obj2.withSpring(obj3.clamp(closure_11.get(), 0, 1), closure_9);
|
|
obj1 = { translateY: null };
|
|
obj5 = closure_0(closure_2[13]);
|
|
obj6 = closure_0(closure_2[12]);
|
|
obj1.translateY = obj5.withSpring(obj6.interpolate(closure_11.get(), [0, 1], [-100, 0]), closure_9);
|
|
items = [];
|
|
items[0] = obj1;
|
|
obj.transform = items;
|
|
return obj;
|
|
}
|
|
}
|
|
let obj3 = { withSpring: tmp(tmp2[13]).withSpring, clamp: tmp(tmp2[12]).clamp, postWatchAnimationState: sharedValue, BACKGROUND_ENTRANCE_ANIMATION_SPRING_CONFIG: pillarboxed, interpolate: tmp(tmp2[12]).interpolate, CLOUDS_BACKGROUND_INVISIBLE_OFFSET_Y: -100 };
|
|
L.__closure = obj3;
|
|
L.__workletHash = 11571705142399;
|
|
L.__initData = __initData;
|
|
const animatedStyle = tmp(tmp2[12]).useAnimatedStyle(L);
|
|
const tmp29 = sourceQuestContent(tmp2[14])();
|
|
__initData = tmp29;
|
|
const tmpResult3 = tmp(tmp2[12]);
|
|
class U {
|
|
constructor() {
|
|
obj = { transform: null, opacity: null };
|
|
obj1 = { translateY: null };
|
|
obj3 = closure_0(closure_2[13]);
|
|
obj4 = closure_0(closure_2[12]);
|
|
items = [, ];
|
|
items[0] = closure_12.top;
|
|
items[1] = 0;
|
|
obj1.translateY = obj3.withSpring(obj4.interpolate(closure_11.get(), [0, 1], items), closure_9);
|
|
items1 = [];
|
|
items1[0] = obj1;
|
|
obj.transform = items1;
|
|
obj5 = closure_0(closure_2[13]);
|
|
obj.opacity = obj5.withSpring(closure_11.get(), closure_9);
|
|
return obj;
|
|
}
|
|
}
|
|
let obj4 = { withSpring: tmp(tmp2[13]).withSpring, interpolate: tmp(tmp2[12]).interpolate, postWatchAnimationState: sharedValue, safeAreaInsets: tmp29, BACKGROUND_ENTRANCE_ANIMATION_SPRING_CONFIG: pillarboxed };
|
|
U.__closure = obj4;
|
|
U.__workletHash = 9769051401109;
|
|
U.__initData = __initData2;
|
|
const items4 = [sharedValue, first];
|
|
const animatedStyle1 = tmp(tmp2[12]).useAnimatedStyle(U);
|
|
const effect = obj2.useEffect(() => {
|
|
let num = 0;
|
|
if (first === obj.POST_WATCH_VIDEO) {
|
|
num = 1;
|
|
}
|
|
const result = sharedValue.set(num);
|
|
}, items4);
|
|
let obj5 = { style: tmp15.root, children: null };
|
|
const obj6 = { style: null, children: null };
|
|
const items5 = [tmp15.modalContentWrapper, memo];
|
|
obj6.style = items5;
|
|
const obj7 = { style: null, children: null };
|
|
const items6 = [tmp15.backgroundWrapper, ];
|
|
const obj8 = { height };
|
|
items6[1] = obj8;
|
|
obj7.style = items6;
|
|
const tmpResult4 = tmp(tmp2[12]);
|
|
const obj9 = { style: null };
|
|
const items7 = [tmp15.contentBackground, ];
|
|
const obj10 = { top: tmp29.top };
|
|
items7[1] = obj10;
|
|
obj9.style = items7;
|
|
const items8 = [closure_7(sourceQuestContent(tmp2[15]), obj9), , ];
|
|
const obj11 = { style: null };
|
|
const items9 = [tmp15.contentBackground, animatedStyle1];
|
|
obj11.style = items9;
|
|
items8[1] = closure_7(sourceQuestContent(tmp2[15]), obj11);
|
|
const obj12 = { style: animatedStyle, children: null };
|
|
const tmp16Result = sourceQuestContent(tmp2[15]);
|
|
obj12.children = closure_7(sourceQuestContent(tmp2[16]), { align: "top" });
|
|
items8[2] = closure_7(sourceQuestContent(tmp2[15]), obj12);
|
|
obj7.children = items8;
|
|
const items10 = [setIsFullscreen(first, obj7), ];
|
|
const obj13 = { top: true, style: null, children: null };
|
|
const items11 = [tmp15.wrapper, ];
|
|
const obj14 = { height };
|
|
items11[1] = obj14;
|
|
obj13.style = items11;
|
|
const obj15 = { style: tmp15.contentWrapper, children: null };
|
|
let tmp33Result = first === tmp24.WATCH_VIDEO;
|
|
if (tmp33Result) {
|
|
if (bound == null) {
|
|
bound = width;
|
|
}
|
|
const obj16 = { contentWidth: bound, isFullscreen: tmp12, onNavigateToPostWatchVideo: callback2, onClose, onEnd: callback2, setIsFullscreen, sourceQuestContent };
|
|
tmp33Result = tmp33(tmp16(tmp2[18]), obj16);
|
|
const tmp16Result4 = tmp16(tmp2[18]);
|
|
}
|
|
const items12 = [tmp33Result, ];
|
|
let tmp33Result2 = first === tmp24.POST_WATCH_VIDEO;
|
|
if (tmp33Result2) {
|
|
const obj17 = { onClose, onRestartVideo: callback1, sourceQuestContent };
|
|
tmp33Result2 = tmp33(tmp16(tmp2[19]), obj17);
|
|
}
|
|
items12[1] = tmp33Result2;
|
|
obj15.children = items12;
|
|
obj13.children = setIsFullscreen(first, obj15);
|
|
items10[1] = closure_7(tmp(tmp2[17]).SafeAreaPaddingView, obj13);
|
|
obj6.children = items10;
|
|
obj5.children = setIsFullscreen(tmp16Result, obj6);
|
|
return closure_7(first, obj5);
|
|
}
|
|
});
|
|
const watch_mobile_video_quest = "watch_mobile_video_quest";
|
|
let obj4 = { backgroundColor: nativeDefault.colors.BACKGROUND_SCRIM };
|
|
const size = fn(2);
|
|
let result = size.fileFinishedImporting("modules/quests/native/VideoQuestModal/VideoQuestModal.tsx");
|
|
|
|
export default noop.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];
|
|
const callback = sourceQuestContent.useCallback(() => {
|
|
const result = QuestUtils.showQuestUnavailableAlert();
|
|
onClose();
|
|
}, items);
|
|
const nonNullableQuest = questContentPosition(videoSessionId[21]).useNonNullableQuest(questContentPosition.questId, callback);
|
|
const items1 = [onClose, nonNullableQuest, videoSessionId, questContentPosition, initialStep, sourceQuestContent];
|
|
const memo = sourceQuestContent.useMemo(() => {
|
|
let tmp = null;
|
|
if (null != nonNullableQuest) {
|
|
let obj = {};
|
|
const obj2 = {
|
|
fullscreen: true,
|
|
headerLeft() {
|
|
return null;
|
|
},
|
|
render() {
|
|
const obj = { value: { quest: questOrQuests, videoSessionId }, children: null };
|
|
const obj3 = {
|
|
children: closure_2_7(questContentPosition(videoSessionId[22]).BillableAdPlacementImpressionTrackerNative, {
|
|
overrideVisibility: true,
|
|
questContent: questContentPosition(videoSessionId[23]).QuestContent.VIDEO_MODAL_MOBILE,
|
|
questOrQuests,
|
|
questContentPosition,
|
|
sourceQuestContent,
|
|
children() {
|
|
return closure_2_7(closure_2_14, { initialStep, onClose, sourceQuestContent });
|
|
}
|
|
})
|
|
};
|
|
obj.children = closure_2_7(questContentPosition(videoSessionId[10]).QuestDockGestureContextProvider, obj3);
|
|
return closure_2_7(onClose(videoSessionId[7]).Provider, obj);
|
|
}
|
|
};
|
|
obj[watch_mobile_video_quest] = obj2;
|
|
tmp = obj;
|
|
}
|
|
return tmp;
|
|
}, items1);
|
|
const layoutEffect = sourceQuestContent.useLayoutEffect(() => {
|
|
questContentPosition(videoSessionId[8]).applyOrientationLock("PORTRAIT");
|
|
return questContentPosition(videoSessionId[8]).restoreDefaultOrientationLock;
|
|
}, []);
|
|
let tmp7 = null;
|
|
if (null != nonNullableQuest) {
|
|
tmp7 = null;
|
|
if (null != memo) {
|
|
let obj2 = { hideTitle: true, initialRouteName: watch_mobile_video_quest, screens: memo };
|
|
tmp7 = closure_7(questContentPosition(videoSessionId[24]).Modal, obj2);
|
|
}
|
|
}
|
|
return tmp7;
|
|
});
|
|
export { VideoQuestModalSteps };
|