Files
2026-07-28 01:06:53 +03:00

354 lines
21 KiB
TypeScript

/* Metro module 13629; source: modules/quests/native/VideoQuestModal/VideoQuestModalContentCompleted.tsx; dependencies: [31, 27, 33, 4501, 697, 13597, 9495, 9513, 13627, 13593, 7589, 4017, 4577, 7114, 9212, 9505, 7717, 13573, 6618, 4572, 4573, 1244, 13618, 8141, 13619, 1305, 5278, 10234, 5475, 4578, 9798, 2] */
import ReanimatedNativeView from '../../../core/native/ReanimatedNativeView.tsx'; /* Metro dependency 8141 */
import VideoQuestModalCloseButton from './VideoQuestModalCloseButton.tsx'; /* Metro dependency 13618 */
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 ReanimatedRexportModule from '../../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import * as CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as StackNativeModule from '../../../../design/components/Stack/native/Stack.native.tsx'; /* Metro dependency 4572 */
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as SpringModule from '../../../../design/animation/reanimated/spring/spring.tsx'; /* Metro dependency 4577 */
import * as ButtonNativeModule from '../../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
import * as PressablesModule from '../../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
import * as SafeAreaViewModule from '../../../../components_native/common/SafeAreaView.tsx'; /* Metro dependency 6618 */
import * as QuestUtilsModule from '../../utils/QuestUtils.tsx'; /* Metro dependency 7114 */
import * as DeviceOrientationModule from '../../../device/native/DeviceOrientation.tsx'; /* Metro dependency 7717 */
import * as ContentImpressionTrackerHooksModule from '../../lib/analytics/ContentImpressionTrackerHooks.tsx'; /* Metro dependency 9513 */
import * as RetryIconModule from '../../../../design/components/Icon/native/redesign/generated/RetryIcon.tsx'; /* Metro dependency 10234 */
import * as QuestDockGestureContextModule from '../QuestDock/QuestDockGestureContext.tsx'; /* Metro dependency 13573 */
import * as QuestBottomSheetFooterModule from '../QuestBottomSheet/QuestBottomSheetFooter.tsx'; /* Metro dependency 13593 */
import * as VideoQuestModalContextModule from './VideoQuestModalContext.tsx'; /* Metro dependency 13597 */
import * as UseVideoQuestClickCtaAndMaybeCloseModalModule from './useVideoQuestClickCtaAndMaybeCloseModal.tsx'; /* Metro dependency 13627 */
function _fun104081(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#104081, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13826:6, offset: 0x02283a77, size: 589 bytes, params: 8, frame: 26
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactModule;
const env0_8 = {'mass': 1.9, 'damping': 18, 'stiffness': 80, 'overshootClamping': false};
const createStyles = CreateStylesModule.createStyles;
object = {wrapper: {'flexGrow': 1, 'flexShrink': 1}, headerContentCopy: {'flexGrow': 1, 'flexShrink': 1}};
object.closeButton = {opacity: 0.5};
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.content = {padding: PX_16};
object.contentRewardsAnimatedWrapper = {flex: 1};
object.contentRewardsWrapper = {flex: 1};
object.contentRewards = {alignItems: 'center'};
object.contentRewardsCopy = {textAlign: 'center'};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.contentEndCardHeader = {marginBottom: PX_16};
object.contentEndCardHeaderCopy = {'flexGrow': 1, 'flexShrink': 1};
const object6 = {borderTopWidth: 1};
const BORDER_STRONG = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_STRONG;
object6.borderTopColor = BORDER_STRONG;
let PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object6.paddingTop = PX_24;
object.contentEndCard = object6;
const object7 = {height: 210};
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object7.marginBottom = PX_24;
object7.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xl;
object.image = object7;
const object8 = {flexGrow: 0};
object8.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
object.ctaPrimary = object8;
const env0_9 = Reflect.apply(createStyles, CreateStylesModule, [object]);
object = {code: 'function VideoQuestModalContentCompletedTsx1(){const{withDelay,ANIMATION_DELAY,withSpring,isComponentMounted,ANIMATED_CONTENT_SPRING_CONFIG,interpolate,ANIMATED_CONTENT_OFFSET_Y}=this.__closure;return{opacity:withDelay(ANIMATION_DELAY,withSpring(isComponentMounted.get(),ANIMATED_CONTENT_SPRING_CONFIG)),transform:[{translateY:withDelay(ANIMATION_DELAY,withSpring(interpolate(isComponentMounted.get(),[0,1],[ANIMATED_CONTENT_OFFSET_Y,0]),ANIMATED_CONTENT_SPRING_CONFIG))}]};}'};
value = value.memo(VideoQuestModalContentCompleted);
(FileImportTrackerModule).fileFinishedImporting('modules/quests/native/VideoQuestModal/VideoQuestModalContentCompleted.tsx');
exports.default = value;
function VideoQuestModalContentCompleted({onClose, onRestartVideo, sourceQuestContent}) { // fn#104082, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13826:1402, offset: 0x02283cc4, size: 2510 bytes, params: 2, frame: 49
var r14;
var r10;
var items5;
var string;
var ShinyButton;
var object2;
const styles = useStyles();
const useVideoQuestModalContext = VideoQuestModalContextModule.useVideoQuestModalContext;
const quest = Reflect.apply(useVideoQuestModalContext, VideoQuestModalContextModule, []).quest;
let binding = env0_3;
const value3 = binding.useMemo(_fun104083, [quest]);
const value5 = (UseVideoQuestClickCtaAndMaybeCloseModalModule).useVideoQuestClickCtaAndMaybeCloseModal({quest: quest,
onClose: onClose, sourceQuestContent: sourceQuestContent,
impressionId: (ContentImpressionTrackerHooksModule).useQuestImpressionId()});
const useQuestRewardClaimHandler = QuestBottomSheetFooterModule.useQuestRewardClaimHandler;
object = {quest: quest};
object.onSuccess = (importDefault(7589) /* metro dependency 7589: ProductPurchaseSuccessActionCreators */).close;
object.sourceQuestContent = sourceQuestContent;
const {isLoading, isClaiming, claim} = Reflect.apply(useQuestRewardClaimHandler, QuestBottomSheetFooterModule,
[object]);
const userStatus = quest.userStatus;
const value7 = userStatus?.claimedAt != null;
const value8 = (ReanimatedRexportModule).useSharedValue(0);
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
const VideoQuestModalContentCompletedT2 = VideoQuestModalContentCompletedT;
VideoQuestModalContentCompletedT2.__closure = {withDelay: ReanimatedRexportModule.withDelay, ANIMATION_DELAY: 125,
withSpring: (require(4577) /* metro dependency 4577: spring */).withSpring, isComponentMounted: value8,
ANIMATED_CONTENT_SPRING_CONFIG: env0_8, interpolate: ReanimatedRexportModule.interpolate,
ANIMATED_CONTENT_OFFSET_Y: 75};
VideoQuestModalContentCompletedT2.__workletHash = 2704439293952;
VideoQuestModalContentCompletedT2.__initData = env0_10;
const value9 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [VideoQuestModalContentCompletedT2]);
binding = env0_3;
binding.useEffect(_fun104085, [value8]);
const isShareableQuest2 = QuestUtilsModule.isShareableQuest(quest.config);
const value10 = binding.useCallback(_fun104086, [isShareableQuest2, quest.id]);
binding.useLayoutEffect(_fun104087, []);
const useContext = binding.useContext;
const QuestDockGestureContext = (QuestDockGestureContextModule).QuestDockGestureContext;
const windowDimensions = Reflect.apply(useContext, binding, [QuestDockGestureContext]).windowDimensions;
let get = windowDimensions.get;
const value11 = Reflect.apply(get, windowDimensions, []).height < 800;
get = windowDimensions.get;
const value12 = Reflect.apply(get, windowDimensions, []).height < 760;
const SafeAreaPaddingView = (SafeAreaViewModule).SafeAreaPaddingView;
const Stack = (StackNativeModule).Stack;
const Text = (TextModule).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const formatToPlainString = intl.formatToPlainString;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const EAYZAr = t.EAYZAr;
const items2 = [
<Stack
align="center"
direction="horizontal"
justify="space-between"
style={styles.content}
>
<Text
variant="heading-sm/semibold"
color="text-subtle"
style={styles.headerContentCopy}
>
{Reflect.apply(formatToPlainString, intl, [EAYZAr, {questName: quest.config.messages.questName}])}
</Text>
{((Component) => <Component onClose={onClose} style={styles.closeButton} />)(VideoQuestModalCloseButton)}
</Stack>,
];
const items3 = [styles.contentRewardsAnimatedWrapper, value9];
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
const items4 = [styles.content];
items4[1] = styles.contentRewardsWrapper;
if (isLoading) {
if (isClaiming) {
var viewBindingProps = {style: styles.contentRewards};
items5 = [
((Component) => <Component withQuestName={false} withRewardAvailableCopy={false} size={value12 ? 'md' : value11 ? 'md-lg' : 'lg'} withRewardTileAnimation />)(importDefault(13619) /* metro dependency 13619: VideoQuestModalReward */),
];
string = intl.string;
items5[1] = (
<Text
color="text-strong"
style={styles.contentRewardsCopy}
variant="heading-lg/semibold"
>
{value7 ? Reflect.apply(string, intl, [t['EMp8/M']]) : Reflect.apply(string, intl, [t.qyKLdg])}
</Text>
);
r14 = (
<View {...viewBindingProps}>
{items5}
</View>
);
} else {
r14 = <ActivityIndicator />;
}
} else {
var viewBindingProps = {style: styles.contentRewards};
items5 = [
((Component) => <Component withQuestName={false} withRewardAvailableCopy={false} size={value12 ? 'md' : value11 ? 'md-lg' : 'lg'} withRewardTileAnimation />)(importDefault(13619) /* metro dependency 13619: VideoQuestModalReward */),
];
string = intl.string;
items5[1] = (
<Text
color="text-strong"
style={styles.contentRewardsCopy}
variant="heading-lg/semibold"
>
{value7 ? Reflect.apply(string, intl, [t['EMp8/M']]) : Reflect.apply(string, intl, [t.qyKLdg])}
</Text>
);
r14 = (
<View {...viewBindingProps}>
{items5}
</View>
);
}
const items6 = [r14];
if (value7) {
r14 = !value7;
} else {
ShinyButton = (require(1305) /* metro dependency 1305: native */).ShinyButton;
r14 = (
<ShinyButton
loading={isClaiming}
onPress={claim}
style={styles.ctaPrimary}
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.cfY4PE)}
color={(require(1305) /* metro dependency 1305: native */).ButtonColors.GREY}
/>
);
}
items6[1] = r14;
items2[1] = (
<ReanimatedNativeView style={items3}>
<Stack
align="center"
justify="center"
spacing={PX_24}
style={items4}
>
{items6}
</Stack>
</ReanimatedNativeView>
);
const items7 = [styles.content];
items7[1] = styles.contentEndCard;
const Stack2 = (StackNativeModule).Stack;
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
const stack = (
<Stack2 spacing={PX_4} style={styles.contentEndCardHeaderCopy}>
<Text
variant="heading-md/semibold"
color="mobile-text-heading-primary"
accessibilityRole="header"
>
{quest.config.messages.gameTitle}
</Text>
<Text variant="text-sm/medium" color="text-subtle">
{quest.config.messages.gamePublisher}
</Text>
</Stack2>
);
const PressableOpacity = (PressablesModule).PressableOpacity;
string = intl.string;
const YsCuyF = (require(1244) /* metro dependency 1244: indexNative */).t.YsCuyF;
const RetryIcon = (RetryIconModule).RetryIcon;
const INTERACTIVE_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_DEFAULT;
const stack2 = (
<Stack
direction="horizontal"
justify="space-between"
style={styles.contentEndCardHeader}
>
{stack}
<PressableOpacity
accessibilityRole="button"
accessibilityLabel={Reflect.apply(string, intl, [YsCuyF])}
onPress={onRestartVideo}
>
<RetryIcon color={INTERACTIVE_TEXT_DEFAULT} />
</PressableOpacity>
</Stack>
);
const value28 = value3 != null;
if (value28) {
r10 = (
<PressableOpacity
accessibilityRole="button"
accessibilityLabel={intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.r8BzFT,
{gameTitle: quest.config.messages.gameTitle})}
onPress={value5}
>
{((Component) => <Component style={styles.image} source={{uri: value3.url}} resizeMode="cover" />)(importDefault(5475) /* metro dependency 5475: FastImage */)}
</PressableOpacity>
);
} else {
r10 = value28;
}
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
const Button = (ButtonNativeModule).Button;
items2[2] = (
<View style={items7}>
{stack2}
{r10}
<Stack
direction="horizontal"
spacing={PX_16}
align="center"
>
<Button
grow
onPress={value5}
text={(require(9505) /* metro dependency 9505: QuestCopyUtils */).getExternalCtaLabel(quest)}
/>
{isShareableQuest2 && <PressableOpacity accessibilityRole="button" accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Ej3B3Y)} onPress={value10}>{((ShareIcon) => <ShareIcon color={(importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_DEFAULT} />)((require(9798) /* metro dependency 9798: ShareIcon */).ShareIcon)}</PressableOpacity>}
</Stack>
</View>
);
return (
<SafeAreaPaddingView bottom style={styles.wrapper}>
{items2}
</SafeAreaPaddingView>
);
function _fun104083() { // fn#104083, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13826:1571, offset: 0x02284692, size: 75 bytes, params: 1, frame: 18
let value = environment.__proto__;
value = require(9495) /* metro dependency 9495: AssetUtils */;
const getQuestAsset = value.getQuestAsset;
const questBinding = quest;
const QuestAssetType = (require(9495) /* metro dependency 9495: AssetUtils */).QuestAssetType;
const VIDEO_PLAYER_THUMBNAIL = QuestAssetType.VIDEO_PLAYER_THUMBNAIL;
return Reflect.apply(getQuestAsset, value, [questBinding, VIDEO_PLAYER_THUMBNAIL, undefined, true]);
}
function VideoQuestModalContentCompletedT() { // fn#104084, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13826:2048, owner: VideoQuestModalContentCompleted.T, offset: 0x022846dd, size: 206 bytes, params: 1, frame: 24
const object = {};
let value = environment.__proto__;
let withDelay = ReanimatedRexportModule.withDelay;
let withSpring = SpringModule.withSpring;
let binding = env0_1;
const value3 = binding.get();
binding = env1_8;
object.opacity = Reflect.apply(withDelay, ReanimatedRexportModule, [125, Reflect.apply(withSpring, SpringModule,
[value3, binding])]);
const object2 = {};
value = ReanimatedRexportModule;
withDelay = value.withDelay;
withSpring = SpringModule.withSpring;
object2.translateY = Reflect.apply(withDelay, value, [125, Reflect.apply(withSpring, SpringModule,
[ReanimatedRexportModule.interpolate(env0_1.get(), [0, 1], [75, 0]), binding])]);
object.transform = [object2];
return object;
}
function _fun104085() { // fn#104085, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13826:2517, offset: 0x01b81401, size: 24 bytes, params: 1, frame: 11
env0_1.set(1);
}
function _fun104086() { // fn#104086, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13826:2597, offset: 0x022847ab, size: 95 bytes, params: 1, frame: 17
var value2;
var moduleValue;
var showShareActionSheet;
var moduleValue2;
if (env0_2) {
value2 = environment.__proto__;
moduleValue = require(9212) /* metro dependency 9212: showShareActionSheetAndroid */;
showShareActionSheet = moduleValue.showShareActionSheet;
moduleValue2 = require(9505) /* metro dependency 9505: QuestCopyUtils */;
Reflect.apply(showShareActionSheet, moduleValue, [{message: moduleValue2.getQuestUrl(quest.id)},
'Video Quest Modal']);
}
}
function _fun104087() { // fn#104087, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13826:2724, offset: 0x0228480a, size: 45 bytes, params: 1, frame: 14
const value = environment.__proto__;
(DeviceOrientationModule).lockOrientation('PORTRAIT', true);
}
}
}
global.__d(_fun104081, 13629, [31, 27, 33, 4501, 697, 13597, 9495, 9513, 13627, 13593, 7589, 4017, 4577, 7114, 9212,
9505, 7717, 13573, 6618, 4572, 4573, 1244, 13618, 8141, 13619, 1305, 5278, 10234, 5475, 4578, 9798,
2]) /* metro module 13629, dependencies: [31, 27, 33, 4501, 697, 13597, 9495, 9513, 13627, 13593, 7589, 4017, 4577, 7114, 9212, 9505, 7717, 13573, 6618, 4572, 4573, 1244, 13618, 8141, 13619, 1305, 5278, 10234, 5475, 4578, 9798, 2] */;