/* Metro module 13596; source: modules/quests/native/VideoQuestModal/VideoQuestModal.tsx; dependencies: [57, 31, 27, 661, 33, 4501, 697, 13597, 7717, 7110, 13573, 8621, 4017, 4577, 1585, 8141, 13598, 6618, 13601, 13629, 9480, 9483, 10183, 6531, 10121, 2] */ import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */ import UseSafeAreaInsetsNative from '../../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */ import ReanimatedNativeView from '../../../core/native/ReanimatedNativeView.tsx'; /* Metro dependency 8141 */ import UseStateFromSharedValue from '../../../reanimated/native/useStateFromSharedValue.tsx'; /* Metro dependency 8621 */ import VideoQuestModalContext from './VideoQuestModalContext.tsx'; /* Metro dependency 13597 */ import QuestModalContentCloudBackground from '../QuestModalContentCloudBackground.tsx'; /* Metro dependency 13598 */ import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */ import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */ import * as JsxRuntimeModule from '../../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */ import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */ import * as ReanimatedRexportModule from '../../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */ import * as CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */ import * as SpringModule from '../../../../design/animation/reanimated/spring/spring.tsx'; /* Metro dependency 4577 */ import * as QuestTypesModule from '../../QuestTypes.tsx'; /* Metro dependency 6531 */ import * as SafeAreaViewModule from '../../../../components_native/common/SafeAreaView.tsx'; /* Metro dependency 6618 */ import * as DeviceOrientationModule from '../../../device/native/DeviceOrientation.tsx'; /* Metro dependency 7717 */ import * as QuestUtilsNativeModule from '../QuestUtils.native.tsx'; /* Metro dependency 9480 */ import * as QuestHooksModule from '../../hooks/QuestHooks.tsx'; /* Metro dependency 9483 */ import * as QuestContentImpressionTrackerNativeModule from '../QuestContentImpressionTracker.native.tsx'; /* Metro dependency 10183 */ import * as QuestDockGestureContextModule from '../QuestDock/QuestDockGestureContext.tsx'; /* Metro dependency 13573 */ import * as VideoQuestModalContextModule from './VideoQuestModalContext.tsx'; /* Metro dependency 13597 */ function _fun103329(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#103329, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13786:6, offset: 0x0226266f, size: 577 bytes, params: 8, frame: 29 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ReactModule; const StyleSheet = ReactNativeModule.StyleSheet; const env0_9 = {'mass': 1.9, 'damping': 18, 'stiffness': 80, 'overshootClamping': true}; object = {WATCH_VIDEO: 0}; object[0] = 'WATCH_VIDEO'; object.POST_WATCH_VIDEO = 1; object[1] = 'POST_WATCH_VIDEO'; const createStyles = CreateStylesModule.createStyles; const object2 = {wrapper: {'flexDirection': 'column', 'flexGrow': 1, 'flexShrink': 1, 'zIndex': 1}}; object2.contentWrapper = {flex: 1}; const object4 = {}; copyDataProperties(object4, StyleSheet.absoluteFillObject, undefined); object4['borderRadius'] = (importDefault(697) /* metro dependency 697: native */).radii.lg; const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST; object4['backgroundColor'] = BACKGROUND_BASE_LOWEST; object2.contentBackground = object4; object2.modalContentWrapper = {zIndex: 2}; const object6 = {}; copyDataProperties(object6, StyleSheet.absoluteFillObject, undefined); object6['borderRadius'] = (importDefault(697) /* metro dependency 697: native */).radii.lg; object6['flex'] = 1; object6['overflow'] = 'hidden'; object6['pointerEvents'] = 'none'; object6['zIndex'] = 1; object2.backgroundWrapper = object6; const env0_11 = Reflect.apply(createStyles, CreateStylesModule, [object2]); const env0_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)}]};}'}; const env0_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)};}'}; const env0_14 = value.memo(_fun103330); value = value.memo(VideoQuestModal); (FileImportTrackerModule).fileFinishedImporting('modules/quests/native/VideoQuestModal/VideoQuestModal.tsx'); exports.default = value; exports.VideoQuestModalSteps = object; function _fun103330({onClose, initialStep, sourceQuestContent}) { // fn#103330, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13786:1689, offset: 0x022628b0, size: 1314 bytes, params: 2, frame: 38 var r12; var value; const {quest, videoSessionId} = (VideoQuestModalContextModule).useVideoQuestModalContext(); const videoSessionId2 = videoSessionId; const userStatus = quest.userStatus; const value4 = userStatus?.completedAt != null; let binding = env0_4; let useState = binding.useState; const value5 = Reflect.apply(useState, binding, [initialStep ?? (value4 ? env0_10.POST_WATCH_VIDEO : env0_10.WATCH_VIDEO)]); binding = videoSessionId2; const value6 = binding(value5, 2); const property = value6[0]; const env0_6 = value6[1]; const binding3 = env0_4; useState = binding3.useState; const value9 = binding(Reflect.apply(useState, binding3, [false]), 2); const property2 = value9[0]; const env0_7 = value9[1]; const value10 = binding3.useCallback(_fun103331, [quest.id, videoSessionId, sourceQuestContent]); const useContext = binding3.useContext; const QuestDockGestureContext = (QuestDockGestureContextModule).QuestDockGestureContext; const windowDimensions = Reflect.apply(useContext, binding3, [QuestDockGestureContext]).windowDimensions; const styles = useStyles(); const height = (UseStateFromSharedValue)(windowDimensions).height; binding3.useLayoutEffect(_fun103332, [value4, initialStep]); let closure = _fun103333; const value11 = binding3.useCallback(closure, []); const value12 = binding3.useCallback(_fun103334, [value10]); const useSharedValue = ReanimatedRexportModule.useSharedValue; let POST_WATCH_VIDEO = env0_10.POST_WATCH_VIDEO; const value13 = Reflect.apply(useSharedValue, ReanimatedRexportModule, [property !== POST_WATCH_VIDEO ? 0 : 1]); const env0_9 = value13; let useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle; closure = M_103335; object = {withSpring: (require(4577) /* metro dependency 4577: spring */).withSpring, clamp: ReanimatedRexportModule.clamp, postWatchAnimationState: value13}; binding = env0_9; object.BACKGROUND_ENTRANCE_ANIMATION_SPRING_CONFIG = binding; object.interpolate = ReanimatedRexportModule.interpolate; object.CLOUDS_BACKGROUND_INVISIBLE_OFFSET_Y = -100; closure.__closure = object; closure.__workletHash = 11571705142399; closure.__initData = env0_12; const value14 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]); const value15 = (UseSafeAreaInsetsNative)(); var env0_10 = value15; useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle; closure = U_103336; closure.__closure = {withSpring: (require(4577) /* metro dependency 4577: spring */).withSpring, interpolate: ReanimatedRexportModule.interpolate, postWatchAnimationState: value13, safeAreaInsets: value15, BACKGROUND_ENTRANCE_ANIMATION_SPRING_CONFIG: binding}; closure.__workletHash = 9769051401109; closure.__initData = env0_13; const value16 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]); env0_4.useEffect(_fun103337, [value13, property]); const view = ( {((Component) => )(QuestModalContentCloudBackground)} ); const SafeAreaPaddingView = (SafeAreaViewModule).SafeAreaPaddingView; const items6 = [styles.wrapper]; items6[1] = {height: height}; const WATCH_VIDEO = env0_10.WATCH_VIDEO; const items7 = [ property === WATCH_VIDEO && ((Component) => )(importDefault(13601) /* metro dependency 13601: VideoQuestModalContentInProgress */), ]; POST_WATCH_VIDEO = env0_10.POST_WATCH_VIDEO; const value21 = property === POST_WATCH_VIDEO; if (value21) { value = importDefault(13629) /* metro dependency 13629: VideoQuestModalContentCompleted */; value = ((Component) => )(value); r12 = value; } else { r12 = value21; } items7[1] = r12; return ( {view} {items7} ); function _fun103331(a0) { // fn#103331, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13786:2018, offset: 0x02262dd2, size: 175 bytes, params: 2, frame: 17 const lockOrientation = DeviceOrientationModule.lockOrientation; if (a0) { Reflect.apply(lockOrientation, DeviceOrientationModule, ['LANDSCAPE', true]); } else { Reflect.apply(lockOrientation, DeviceOrientationModule, ['PORTRAIT', true]); } env0_7(a0); (require(7110) /* metro dependency 7110: AnalyticsActions */).trackQuestEvent({questId: quest.id, event: a0 ? AnalyticEvents.QUEST_VIDEO_FULLSCREEN_ENTERED : AnalyticEvents.QUEST_VIDEO_FULLSCREEN_EXITED, properties: {video_session_id: videoSessionId}, sourceQuestContent: sourceQuestContent}); } function _fun103332() { // fn#103332, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13786:2400, offset: 0x02262e81, size: 51 bytes, params: 1, frame: 12 var binding; if (result && initialStep == null) { binding = env0_6; value = environment.__proto__; binding(env1_10.POST_WATCH_VIDEO); } } function _fun103333() { // fn#103333, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13786:2473, offset: 0x02262eb4, size: 29 bytes, params: 1, frame: 11 const binding = env0_6; const WATCH_VIDEO = env1_10.WATCH_VIDEO; binding(WATCH_VIDEO); } function _fun103334() { // fn#103334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13786:2518, offset: 0x02262ed1, size: 40 bytes, params: 1, frame: 12 (0, JsxRuntimeModule.jsxs)(false); const binding = env0_6; const POST_WATCH_VIDEO = env1_10.POST_WATCH_VIDEO; binding(POST_WATCH_VIDEO); } function M_103335() { // fn#103335, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13786:2644, offset: 0x02262ef9, size: 196 bytes, params: 1, frame: 25 const object = {}; let value = environment.__proto__; let withSpring = SpringModule.withSpring; const clamp = ReanimatedRexportModule.clamp; let binding = env0_9; const value4 = Reflect.apply(clamp, ReanimatedRexportModule, [binding.get(), 0, 1]); binding = env1_9; object.opacity = Reflect.apply(withSpring, SpringModule, [value4, binding]); const object2 = {}; value = SpringModule; withSpring = value.withSpring; object2.translateY = Reflect.apply(withSpring, value, [ReanimatedRexportModule.interpolate(env0_9.get(), [0, 1], [-100, 0]), binding]); object.transform = [object2]; return object; } function U_103336() { // fn#103336, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13786:3110, offset: 0x02262fbd, size: 174 bytes, params: 1, frame: 25 const object = {}; let value = environment.__proto__; let withSpring = SpringModule.withSpring; const interpolate = ReanimatedRexportModule.interpolate; let binding = env0_9; let get = binding.get; const value4 = Reflect.apply(interpolate, ReanimatedRexportModule, [Reflect.apply(get, binding, []), [0, 1], [env0_10.top, 0]]); binding = env1_9; object.transform = [{translateY: Reflect.apply(withSpring, SpringModule, [value4, binding])}]; value = SpringModule; withSpring = value.withSpring; const binding2 = env0_9; get = binding2.get; object.opacity = Reflect.apply(withSpring, value, [Reflect.apply(get, binding2, []), binding]); return object; } function _fun103337() { // fn#103337, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13786:3486, offset: 0x0226306b, size: 47 bytes, params: 1, frame: 13 const binding = env0_9; const set = binding.set; const value = environment.__proto__; const POST_WATCH_VIDEO = env1_10.POST_WATCH_VIDEO; Reflect.apply(set, binding, [ReactNativeModule.View !== POST_WATCH_VIDEO ? 0 : 1]); } } function VideoQuestModal({questId, questContentPosition, onClose, videoSessionId, initialStep, sourceQuestContent}) { // fn#103338, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13786:4201, offset: 0x0226309a, size: 278 bytes, params: 2, frame: 22 const binding = sourceQuestContent; const useCallback = binding.useCallback; const value3 = (QuestHooksModule).useNonNullableQuest(questId, Reflect.apply(useCallback, binding, [_fun103339, [onClose]])); const value4 = binding.useMemo(_fun103340, [onClose, value3, videoSessionId, questContentPosition, initialStep, sourceQuestContent]); binding.useLayoutEffect(_fun103344, []); if (value3 == null || value4 == null) { return null; } else { const Modal = (require(10121) /* metro dependency 10121: ModalNative */).Modal; return ( ); } function _fun103339() { // fn#103339, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13786:4357, offset: 0x022631b0, size: 48 bytes, params: 1, frame: 11 const value = environment.__proto__; (QuestUtilsNativeModule).showQuestUnavailableAlert(); onClose(); } function _fun103340() { // fn#103340, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13786:4459, offset: 0x022631e0, size: 69 bytes, params: 1, frame: 5 const value = null; return value == ReactNativeModule.View ? value : {['watch_mobile_video_quest']: {fullscreen: true, headerLeft: function() { return null; }, render: render_103342}}; function render_103342() { // fn#103342, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13786:4523, offset: 0x02263225, size: 208 bytes, params: 1, frame: 22 const Provider = (VideoQuestModalContext).Provider; const object2 = {}; const binding = env1_5; object2.quest = binding; object2.videoSessionId = videoSessionId; const QuestDockGestureContextProvider = (QuestDockGestureContextModule).QuestDockGestureContextProvider; const QuestContentImpressionTrackerNative = (QuestContentImpressionTrackerNativeModule).QuestContentImpressionTrackerNative; const QuestContent = (QuestTypesModule).QuestContent; const VIDEO_MODAL_MOBILE = QuestContent.VIDEO_MODAL_MOBILE; return ( {children_103343} ); function render_103342Children() { // fn#103343, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13786:4835, owner: render_103342.children, offset: 0x022632f5, size: 53 bytes, params: 1, frame: 14 return ((Component) => )(env3_14); } } } function _fun103344() { // fn#103344, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13786:4956, offset: 0x0226332a, size: 60 bytes, params: 1, frame: 17 const value = environment.__proto__; (DeviceOrientationModule).lockOrientation('PORTRAIT', true); return (DeviceOrientationModule).restoreDefaultOrientation; } } } global.__d(_fun103329, 13596, [57, 31, 27, 661, 33, 4501, 697, 13597, 7717, 7110, 13573, 8621, 4017, 4577, 1585, 8141, 13598, 6618, 13601, 13629, 9480, 9483, 10183, 6531, 10121, 2]) /* metro module 13596, dependencies: [57, 31, 27, 661, 33, 4501, 697, 13597, 7717, 7110, 13573, 8621, 4017, 4577, 1585, 8141, 13598, 6618, 13601, 13629, 9480, 9483, 10183, 6531, 10121, 2] */;