624 lines
37 KiB
TypeScript
624 lines
37 KiB
TypeScript
/* Metro module 10383; source: modules/premium/native/gifting/PremiumGiftPlanSelect.tsx; dependencies: [57, 31, 27, 7670, 7261, 1880, 661, 33, 4501, 697, 674, 1484, 1585, 1478, 7669, 4559, 5286, 566, 10384, 7633, 7635, 10382, 10386, 10389, 9625, 4017, 1305, 4504, 10396, 6789, 10397, 10431, 7725, 1244, 5312, 5475, 10455, 4589, 5314, 4573, 2] */
|
|
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import Native from '../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import UseWindowDimensionsNative from '../../../screen/useWindowDimensions.native.tsx'; /* Metro dependency 1478 */
|
|
import UseSafeAreaInsetsNative from '../../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
|
|
import PromotionsStore from '../../promotions/PromotionsStore.tsx'; /* Metro dependency 7261 */
|
|
import GiftingBadgeExperiment from '../../gifting/experiments/GiftingBadgeExperiment.tsx'; /* Metro dependency 7633 */
|
|
import BadgeDirectoryStore from '../../../badges/BadgeDirectoryStore.tsx'; /* Metro dependency 7670 */
|
|
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 ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as NativeModule from '../../../../design/void/native.tsx'; /* Metro dependency 1305 */
|
|
import * as UseNavigationNativeModule from '../../../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */
|
|
import * as PremiumConstantsModule from '../../PremiumConstants.tsx'; /* Metro dependency 1880 */
|
|
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 TimingModule from '../../../../design/animation/reanimated/timing/timing.tsx'; /* Metro dependency 4504 */
|
|
import * as UseIsScreenReaderEnabledNativeModule from '../../../a11y/native/useIsScreenReaderEnabled.native.tsx'; /* Metro dependency 4559 */
|
|
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as NativeGiftContextModule from '../../../payments/native/NativeGiftContext.tsx'; /* Metro dependency 7669 */
|
|
import * as PremiumGiftModalModule from './PremiumGiftModal.tsx'; /* Metro dependency 10382 */
|
|
import * as UseSelectPremiumGiftModule from '../hooks/useSelectPremiumGift.tsx'; /* Metro dependency 10384 */
|
|
|
|
function _fun80427(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80427, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:6, offset: 0x01e7a3bf, size: 393 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_5 = value.ActivityIndicator;
|
|
const env0_6 = value.Pressable;
|
|
const env0_7 = value.View;
|
|
const env0_8 = value.ScrollView;
|
|
const PremiumTypes = (PremiumConstantsModule).PremiumTypes;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_12 = value.jsx;
|
|
const env0_13 = value.jsxs;
|
|
const env0_14 = value.Fragment;
|
|
const TIER_2 = PremiumTypes.TIER_2;
|
|
object = [TIER_2];
|
|
const TIER_0 = PremiumTypes.TIER_0;
|
|
object[1] = TIER_0;
|
|
const env0_16 = (CreateStylesModule).createStyles(_fun80428);
|
|
object = {code: 'function PremiumGiftPlanSelectTsx1(){const{STANDARD_EASING,withTiming,carouselVisibility}=this.__closure;const animationSettings={easing:STANDARD_EASING,duration:500};return{opacity:withTiming(carouselVisibility.get()?1:0,animationSettings),transform:[{translateY:withTiming(carouselVisibility.get()?0:100,animationSettings)}]};}'};
|
|
object = {code: 'function PremiumGiftPlanSelectTsx2(value,index){const{lastItemIndex,leftOffset,centerOffset,rightOffset,carouselStep}=this.__closure;const activeIndex=index-value;const leftT=Math.max(0,Math.min(1,activeIndex));const rightT=Math.max(0,Math.min(1,activeIndex-(lastItemIndex-1)));const offset=leftOffset+leftT*(centerOffset-leftOffset)+rightT*(rightOffset-centerOffset);return{transform:[{translateX:value*carouselStep+offset}]};}'};
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftPlanSelect.tsx');
|
|
exports.default = PremiumGiftPlanSelect;
|
|
function _fun80428(a0, a1, a2) { // fn#80428, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:349, offset: 0x01e7a548, size: 701 bytes, params: 4, frame: 22
|
|
const object = {};
|
|
let BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object.container = {flex: 1, backgroundColor: BACKGROUND_BASE_LOW};
|
|
object.headerBackground = {position: 'absolute', width: a0, height: 0.1 * a1, top: a1 / 1.75 - 0.1 * a1};
|
|
BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object.headerBackgroundColor = {color: BACKGROUND_BASE_LOW};
|
|
object.headerImageContainer = {position: 'absolute', width: a0, height: a1 / 1.75};
|
|
object.headerImage = {width: a0};
|
|
const object7 = {width: a0};
|
|
object7.backgroundColor = (importDefault(674) /* metro dependency 674 */)('#000000').alpha(0.8).hex();
|
|
object.headerOverlay = object7;
|
|
object.avatar = {alignSelf: 'center'};
|
|
const object9 = {textAlign: 'center'};
|
|
let space = (importDefault(697) /* metro dependency 697: native */).space;
|
|
object9.marginTop = a2 ? space.PX_16 : space.PX_12;
|
|
let PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object9.marginHorizontal = PX_24;
|
|
object.title = object9;
|
|
const object10 = {textAlign: 'center'};
|
|
space = (importDefault(697) /* metro dependency 697: native */).space;
|
|
object10.marginTop = a2 ? space.PX_16 : space.PX_12;
|
|
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object10.marginHorizontal = PX_24;
|
|
object.description = object10;
|
|
space = (importDefault(697) /* metro dependency 697: native */).space;
|
|
object.carousel = {marginTop: a2 ? space.PX_16 : space.PX_32};
|
|
const object11 = {};
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object11.paddingTop = PX_16;
|
|
const PX_48 = (importDefault(697) /* metro dependency 697: native */).space.PX_48;
|
|
object11.paddingBottom = PX_48;
|
|
object.dmGiftingContent = object11;
|
|
object.loadingContainer = {'flex': 1, 'alignItems': 'center', 'justifyContent': 'center'};
|
|
object.closeButtonContainer = {'position': 'absolute', 'top': 0, 'left': 0, 'zIndex': 1};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.closeButton = {padding: PX_16};
|
|
object.closeButtonIcon = {'width': 24, 'height': 24, 'tintColor': 'white'};
|
|
const object12 = {};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object12.marginTop = PX_16;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object12.marginHorizontal = PX_16;
|
|
object.badgeBanner = object12;
|
|
return object;
|
|
}
|
|
|
|
function PremiumGiftPlanSelect({shouldUseDMWishlistGiftingDesign, isLoadingWishlist}) { // fn#80429, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:2346, offset: 0x01e7a805, size: 3448 bytes, params: 2, frame: 61
|
|
var object7;
|
|
var r33;
|
|
var r40;
|
|
var r42;
|
|
var r36;
|
|
var r17;
|
|
var r16;
|
|
var r0;
|
|
var jsxRuntimeEnv0_14Binding;
|
|
var items2;
|
|
var object3;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var FastImage;
|
|
var headerImageContainer;
|
|
var object;
|
|
var object2;
|
|
var value39;
|
|
var Avatar;
|
|
var AvatarSizes;
|
|
var items6;
|
|
const Text = (TextModule).Text;
|
|
var jsxRuntimeEnv0_14Binding2;
|
|
var defaultImport6;
|
|
var items9;
|
|
var defaultImport8;
|
|
let value = undefined;
|
|
const env0_17 = value;
|
|
const value3 = (UseNavigationNativeModule).useNavigation();
|
|
const {top, bottom} = (UseSafeAreaInsetsNative)();
|
|
const {width, height} = (UseWindowDimensionsNative)();
|
|
const {recipientUser, claimableRewards,
|
|
onClose} = (NativeGiftContextModule).useNativeGiftContext();
|
|
const value7 = (UseIsScreenReaderEnabledNativeModule).useIsScreenReaderEnabled();
|
|
(require(5286) /* metro dependency 5286: useNavigatorBackPressHandlerNative */).useNavigatorBackPressHandler(function() {
|
|
onClose();
|
|
return true;
|
|
});
|
|
const value8 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([PromotionsStore],
|
|
function() {
|
|
return PromotionsStore.getGiftPromotionRewardSkuIds();
|
|
});
|
|
const value9 = (UseSelectPremiumGiftModule).useSelectPremiumGift('PremiumGiftPlanSelect');
|
|
const env0_3 = value9;
|
|
const defaultImport = GiftingBadgeExperiment;
|
|
const useConfig = defaultImport.useConfig;
|
|
const enabled = Reflect.apply(useConfig, defaultImport, [{location: 'PremiumGiftPlanSelect'}]).enabled;
|
|
const {nextTier,
|
|
giftsToNextTier} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([BadgeDirectoryStore],
|
|
function() {
|
|
var object = {};
|
|
var badgeDirectoryStoreBinding = BadgeDirectoryStore;
|
|
object.nextTier = badgeDirectoryStoreBinding.getNextTier(require(dependencyMap[20]).BadgeId.GIFTING);
|
|
object.giftsToNextTier = badgeDirectoryStoreBinding.getRemainingToNextTier(require(dependencyMap[20]).BadgeId.GIFTING);
|
|
return object;
|
|
});
|
|
const r10 = enabled && nextTier != null;
|
|
const env0_4 = r10;
|
|
const styles = useStyles(width, height, r10);
|
|
let binding = env0_4;
|
|
let useState = binding.useState;
|
|
const value12 = Reflect.apply(useState, binding, [0]);
|
|
const binding2 = env0_3;
|
|
const value13 = binding2(value12, 2);
|
|
const property = value13[0];
|
|
const property2 = value13[1];
|
|
useState = binding.useState;
|
|
const value15 = binding2(Reflect.apply(useState, binding, [false]), 2);
|
|
const property3 = value15[0];
|
|
const env0_7 = value15[1];
|
|
binding.useEffect(_fun80433, [value3]);
|
|
useState = binding.useState;
|
|
const value17 = binding2(Reflect.apply(useState, binding, [null]), 2);
|
|
const property4 = value17[0];
|
|
const property5 = value17[1];
|
|
const value18 = binding.useRef([]);
|
|
binding.useEffect(_fun80436, [shouldUseDMWishlistGiftingDesign]);
|
|
let useCallback = binding.useCallback;
|
|
const value19 = Reflect.apply(useCallback, binding, [_fun80437, [property5]]);
|
|
let closure = function() {
|
|
importDefault(dependencyMap[22])();
|
|
};
|
|
const value20 = binding.useCallback(closure, []);
|
|
const value21 = 0.86 * width;
|
|
const value22 = binding.useCallback(function(a0) {
|
|
var value = a1;
|
|
var env0_0 = a0;
|
|
var env0_1 = (value !== undefined ? value : {forScreenReader: false}).forScreenReader;
|
|
return _fun80440;
|
|
}, [value9, value21, value18, value19, property4, property, claimableRewards]);
|
|
const r8 = (require(9625) /* metro dependency 9625: useIsWindowSmall */).useIsWindowSmall() || claimableRewards != null && claimableRewards.length > 0 ? 'smallCompact' : 'compact';
|
|
binding = env0_4;
|
|
const value28 = binding.useMemo(_fun80444, [value22, r8]);
|
|
const value29 = binding.useMemo(_fun80445, [value22]);
|
|
const value30 = (ReanimatedRexportModule).useSharedValue(false);
|
|
const env0_15 = value30;
|
|
binding.useEffect(_fun80446, [value30, property4]);
|
|
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
|
|
closure = pe;
|
|
object7 = {};
|
|
const STANDARD_EASING = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING;
|
|
object7.STANDARD_EASING = STANDARD_EASING;
|
|
object7.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
|
|
object7.carouselVisibility = value30;
|
|
closure.__closure = object7;
|
|
closure.__workletHash = 2946262965957;
|
|
closure.__initData = env0_17;
|
|
const value31 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
|
|
const value32 = binding.useMemo(_fun80448, [styles]);
|
|
const value33 = value21 + 16;
|
|
const value34 = env0_15.length - 1;
|
|
const value35 = (width - value21) / 2;
|
|
const env0_18 = value35;
|
|
const value36 = width - value21 - 16;
|
|
useCallback = binding.useCallback;
|
|
closure = PremiumGiftPlanSelectSe;
|
|
closure.__closure = {lastItemIndex: value34, leftOffset: 16, centerOffset: value35, rightOffset: value36,
|
|
carouselStep: value33};
|
|
closure.__workletHash = 8954351954675;
|
|
closure.__initData = env0_18;
|
|
const value37 = Reflect.apply(useCallback, binding, [closure, [value33, value34, 16, value35, value36]]);
|
|
if (isLoadingWishlist) {
|
|
r0 = (
|
|
<View style={[styles.container, styles.loadingContainer]}>
|
|
<ActivityIndicator size="large" />
|
|
</View>
|
|
);
|
|
} else if (shouldUseDMWishlistGiftingDesign) {
|
|
var viewBindingProps = {style: styles.container};
|
|
var scrollViewBindingProps = {contentContainerStyle: {paddingBottom: bottom}};
|
|
items9 = [
|
|
r10 && <View style={styles.badgeBanner}><Pressable onPress={value20} accessibilityRole="button">{((Component) => <Component giftsToNextTier={giftsToNextTier} nextTierName={nextTier.name ?? ''} nextTierIcon={nextTier.simple_icon_url} analyticsLocation={(importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).PREMIUM_GIFT_PLAN_SELECTION} />)(importDefault(10396) /* metro dependency 10396: GiftingBadgeProgressBanner */)}</Pressable></View>,
|
|
|
|
|
|
];
|
|
var viewBinding3Props = {style: styles.dmGiftingContent};
|
|
if (value8.length === 0) {
|
|
if (value7) {
|
|
r17 = (
|
|
<ScrollView
|
|
horizontal
|
|
showsHorizontalScrollIndicator={false}
|
|
contentContainerStyle={{'gap': 16, 'paddingHorizontal': 16}}
|
|
>
|
|
{env0_15.map(_fun80450)}
|
|
</ScrollView>
|
|
);
|
|
} else {
|
|
defaultImport8 = importDefault(10397) /* metro dependency 10397 */;
|
|
binding = env0_15;
|
|
r17 = ((Component) => <Component style={value31} data={binding} renderItem={value28} width={width} windowSize={binding.length} height={(property4 ?? 1) + 2 * (importDefault(697) /* metro dependency 697: native */).space.PX_8} onConfigurePanGesture={function(a0) {
|
|
a0.activeOffsetX([-10, 10]);
|
|
}} loop={false} scrollAnimationDuration={200} customAnimation={value37} onSnapToItem={property2} />)(defaultImport8);
|
|
}
|
|
r16 = r17;
|
|
} else if (value === claimableRewards) {
|
|
r16 = null;
|
|
} else {
|
|
if (value7) {
|
|
r17 = (
|
|
<ScrollView
|
|
horizontal
|
|
showsHorizontalScrollIndicator={false}
|
|
contentContainerStyle={{'gap': 16, 'paddingHorizontal': 16}}
|
|
>
|
|
{env0_15.map(_fun80450)}
|
|
</ScrollView>
|
|
);
|
|
} else {
|
|
defaultImport8 = importDefault(10397) /* metro dependency 10397 */;
|
|
binding = env0_15;
|
|
r17 = ((Component) => <Component style={value31} data={binding} renderItem={value28} width={width} windowSize={binding.length} height={(property4 ?? 1) + 2 * (importDefault(697) /* metro dependency 697: native */).space.PX_8} onConfigurePanGesture={onConfigurePanGesture_80451} loop={false} scrollAnimationDuration={200} customAnimation={value37} onSnapToItem={property2} />)(defaultImport8);
|
|
}
|
|
r16 = r17;
|
|
}
|
|
items9[1] = (
|
|
<View {...viewBinding3Props}>
|
|
{r16}
|
|
</View>
|
|
);
|
|
items9[2] = recipientUser != null && ((PremiumGiftWishlistBanner) => <PremiumGiftWishlistBanner giftRecipient={recipientUser} />)((require(10431) /* metro dependency 10431: PremiumGiftWishlistBanner */).PremiumGiftWishlistBanner);
|
|
value = (
|
|
<View {...viewBindingProps}>
|
|
<ScrollView {...scrollViewBindingProps}>
|
|
{items9}
|
|
</ScrollView>
|
|
</View>
|
|
);
|
|
r0 = value;
|
|
} else {
|
|
jsxRuntimeEnv0_14Binding = jsxRuntimeEnv0_14;
|
|
items2 = [
|
|
property3 && ((Component) => <Component animated barStyle="light-content" />)(importDefault(7725) /* metro dependency 7725: StatusBarAndroid */),
|
|
|
|
|
|
];
|
|
items2[1] = (
|
|
<Pressable
|
|
style={[styles.closeButtonContainer, {paddingTop: top}]}
|
|
onPress={onClose}
|
|
accessibilityRole="button"
|
|
accessibilityLabel={intl.string(t.cpT0Cq)}
|
|
>
|
|
<View style={styles.closeButton}>
|
|
{((XSmallIcon) => <XSmallIcon size="md" style={styles.closeButtonIcon} />)((require(5312) /* metro dependency 5312: XSmallIcon */).XSmallIcon)}
|
|
</View>
|
|
</Pressable>
|
|
);
|
|
FastImage = importDefault(5475) /* metro dependency 5475: FastImage */;
|
|
headerImageContainer = styles.headerImageContainer;
|
|
items2[2] = (
|
|
<FastImage
|
|
resizeMode="cover"
|
|
style={[headerImageContainer, styles.headerImage]}
|
|
source={importDefault(10455) /* metro dependency 10455 */}
|
|
/>
|
|
);
|
|
headerImageContainer = styles.headerImageContainer;
|
|
items2[3] = <View style={[headerImageContainer, styles.headerOverlay]} />;
|
|
items2[4] = ((Component) => <Component style={styles.headerBackground} start={VerticalGradient.START} end={VerticalGradient.END} colors={value32} />)(importDefault(4589) /* metro dependency 4589 */);
|
|
var scrollViewBindingProps = {contentContainerStyle: {paddingBottom: bottom}};
|
|
object = {};
|
|
object2 = {};
|
|
object2.paddingTop = top + (require(5314) /* metro dependency 5314: NavigatorConstantsNative */).NAV_BAR_HEIGHT;
|
|
object.style = [object2];
|
|
value39 = recipientUser != null;
|
|
if (value39) {
|
|
Avatar = (require(1305) /* metro dependency 1305: native */).Avatar;
|
|
var avatarProps = {style: styles.avatar, guildId: value};
|
|
AvatarSizes = (require(1305) /* metro dependency 1305: native */).AvatarSizes;
|
|
avatarProps.size = r10 ? AvatarSizes.LARGE_48 : AvatarSizes.XLARGE;
|
|
avatarProps.user = recipientUser;
|
|
r33 = <Avatar {...avatarProps} />;
|
|
} else {
|
|
r33 = value39;
|
|
}
|
|
items6 = [r33];
|
|
var textProps = {style: styles.title};
|
|
r40 = recipientUser != null ? 'heading-xl/extrabold' : 'heading-xxl/extrabold';
|
|
textProps.variant = r40;
|
|
textProps.color = 'always-white';
|
|
r40 = recipientUser != null ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.m5ggvH,
|
|
|
|
{username: recipientUser.globalName ?? recipientUser.username}) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.dqQgZv);
|
|
items6[1] = (
|
|
<Text {...textProps}>
|
|
{r40}
|
|
</Text>
|
|
);
|
|
items6[2] = (
|
|
<Text
|
|
style={styles.description}
|
|
variant="heading-sm/medium"
|
|
color="always-white"
|
|
>
|
|
{intl.string(t['30qzrd'])}
|
|
</Text>
|
|
);
|
|
r33 = r10 && <Pressable style={styles.badgeBanner} onPress={value20} accessibilityRole="button">{((Component) => <Component giftsToNextTier={giftsToNextTier} nextTierName={nextTier.name ?? ''} nextTierIcon={nextTier.simple_icon_url} analyticsLocation={(importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).PREMIUM_GIFT_PLAN_SELECTION} />)(importDefault(10396) /* metro dependency 10396: GiftingBadgeProgressBanner */)}</Pressable>;
|
|
items6[3] = r33;
|
|
if (value8.length === 0) {
|
|
if (value7) {
|
|
r36 = (
|
|
<ScrollView
|
|
horizontal
|
|
showsHorizontalScrollIndicator={false}
|
|
style={styles.carousel}
|
|
contentContainerStyle={{'gap': 16, 'paddingHorizontal': 16}}
|
|
>
|
|
{env0_15.map(_fun80452)}
|
|
</ScrollView>
|
|
);
|
|
} else {
|
|
jsxRuntimeEnv0_14Binding2 = jsxRuntimeEnv0_14;
|
|
defaultImport6 = importDefault(10397) /* metro dependency 10397 */;
|
|
var defaultImport6Props = {style: [styles.carousel, value31], data: env0_15};
|
|
r42 = r10 ? value28 : value29;
|
|
defaultImport6Props.renderItem = r42;
|
|
defaultImport6Props.width = width;
|
|
r42 = property4 != null ? property4 + 2 * (importDefault(697) /* metro dependency 697: native */).space.PX_8 : value;
|
|
defaultImport6Props.height = r42;
|
|
defaultImport6Props.onConfigurePanGesture = onConfigurePanGesture;
|
|
defaultImport6Props.loop = false;
|
|
defaultImport6Props.scrollAnimationDuration = 200;
|
|
r42 = r10 ? value37 : value;
|
|
defaultImport6Props.customAnimation = r42;
|
|
defaultImport6Props.mode = 'parallax';
|
|
defaultImport6Props.modeConfig = {'parallaxScrollingScale': 1, 'parallaxScrollingOffset': 40};
|
|
defaultImport6Props.onSnapToItem = property2;
|
|
r36 = (
|
|
<>
|
|
{((Component) => <Component {...defaultImport6Props} />)(defaultImport6)}
|
|
{((CarouselPagination) => <CarouselPagination numberOfItems={env0_15.length} currentIndex={property} />)((require(1305) /* metro dependency 1305: native */).CarouselPagination)}
|
|
</>
|
|
);
|
|
}
|
|
r33 = r36;
|
|
} else if (value === claimableRewards) {
|
|
r33 = null;
|
|
} else {
|
|
if (value7) {
|
|
r36 = (
|
|
<ScrollView
|
|
horizontal
|
|
showsHorizontalScrollIndicator={false}
|
|
style={styles.carousel}
|
|
contentContainerStyle={{'gap': 16, 'paddingHorizontal': 16}}
|
|
>
|
|
{env0_15.map(_fun80452)}
|
|
</ScrollView>
|
|
);
|
|
} else {
|
|
jsxRuntimeEnv0_14Binding2 = jsxRuntimeEnv0_14;
|
|
defaultImport6 = importDefault(10397) /* metro dependency 10397 */;
|
|
var defaultImport6Props = {style: [styles.carousel, value31], data: env0_15};
|
|
r42 = r10 ? value28 : value29;
|
|
defaultImport6Props.renderItem = r42;
|
|
defaultImport6Props.width = width;
|
|
r42 = property4 != null ? property4 + 2 * (importDefault(697) /* metro dependency 697: native */).space.PX_8 : value;
|
|
defaultImport6Props.height = r42;
|
|
defaultImport6Props.onConfigurePanGesture = onConfigurePanGesture;
|
|
defaultImport6Props.loop = false;
|
|
defaultImport6Props.scrollAnimationDuration = 200;
|
|
r42 = r10 ? value37 : value;
|
|
defaultImport6Props.customAnimation = r42;
|
|
defaultImport6Props.mode = 'parallax';
|
|
defaultImport6Props.modeConfig = {'parallaxScrollingScale': 1, 'parallaxScrollingOffset': 40};
|
|
defaultImport6Props.onSnapToItem = property2;
|
|
r36 = (
|
|
<>
|
|
{((Component) => <Component {...defaultImport6Props} />)(defaultImport6)}
|
|
{((CarouselPagination) => <CarouselPagination numberOfItems={env0_15.length} currentIndex={property} />)((require(1305) /* metro dependency 1305: native */).CarouselPagination)}
|
|
</>
|
|
);
|
|
}
|
|
r33 = r36;
|
|
}
|
|
items6[4] = r33;
|
|
items2[5] = (
|
|
<ScrollView {...scrollViewBindingProps}>
|
|
<View {...object}>
|
|
{items6}
|
|
</View>
|
|
</ScrollView>
|
|
);
|
|
value = (
|
|
<>
|
|
{items2}
|
|
</>
|
|
);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
function _fun80433() { // fn#80433, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:3235, offset: 0x01e7b5f2, size: 45 bytes, params: 1, frame: 14
|
|
const env0_0Binding = env0_0.addListener('state', _fun80434);
|
|
return _fun80435;
|
|
function _fun80434() { // fn#80434, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:3269, offset: 0x01e7b61f, size: 89 bytes, params: 1, frame: 13
|
|
let binding = env1_0;
|
|
const state = binding.getState();
|
|
const property = state.routes[state.index];
|
|
binding = env1_7;
|
|
const name = property.name;
|
|
const PremiumGiftScreens = (PremiumGiftModalModule).PremiumGiftScreens;
|
|
const PLAN_SELECT = PremiumGiftScreens.PLAN_SELECT;
|
|
binding(name === PLAN_SELECT);
|
|
}
|
|
|
|
function _fun80435() { // fn#80435, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:3375, offset: 0x01e7b678, size: 34 bytes, params: 1, frame: 13
|
|
env1_0.removeListener('state', env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun80436() { // fn#80436, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:3498, offset: 0x01e7b69a, size: 32 bytes, params: 1, frame: 11
|
|
env0_10.current = [];
|
|
env0_9(null);
|
|
}
|
|
|
|
function _fun80437() { // fn#80437, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:3555, offset: 0x01e7b6ba, size: 116 bytes, params: 1, frame: 17
|
|
var Math;
|
|
var max;
|
|
var items2;
|
|
var value3;
|
|
var Number;
|
|
let current = env0_10.current;
|
|
if (current.length >= env1_15.length) {
|
|
Math = global.Math;
|
|
max = Math.max;
|
|
current = env0_10.current;
|
|
items2 = [];
|
|
arraySpread(items2, current, 0, undefined);
|
|
value3 = apply(max, items2, Math, undefined);
|
|
Number = global.Number;
|
|
if (!Number.isNaN(value3)) {
|
|
env0_9(value3);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun80439(a0) { // fn#80439, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:3721, offset: 0x01e7b74d, size: 49 bytes, params: 2, frame: 4
|
|
const value = a1;
|
|
const env0_0 = a0;
|
|
const env0_1 = (value !== undefined ? value : {forScreenReader: false}).forScreenReader;
|
|
return _fun80440;
|
|
function _fun80440({item, index}) { // fn#80440, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:3767, offset: 0x01e7b77e, size: 303 bytes, params: 2, frame: 24
|
|
var environment;
|
|
const item2 = item;
|
|
const value = environment.__proto__.__proto__;
|
|
const r2 = forScreenReader ? Pressable : View;
|
|
const r2Props = {accessible: forScreenReader || undefined,
|
|
accessibilityRole: forScreenReader ? 'button' : undefined, onPress: forScreenReader ? _fun80441 : undefined};
|
|
const PX_8 = (Native).space.PX_8;
|
|
r2Props.style = {paddingVertical: PX_8};
|
|
return ((Component) => <Component {...r2Props}>{((Component) => <Component premiumType={item} variant={item2} onPress={onPress_80442} style={{height: env1_8 ?? undefined,
|
|
width: env1_12,
|
|
alignSelf: item2 !== 'default' ? undefined : 'center'}} onLayout={onLayout_80443} claimableRewards={claimableRewards} isSelected={env1_6 === index} key={index} />)(importDefault(10389) /* metro dependency 10389: PremiumGiftFeaturesCard */)}</Component>)(r2);
|
|
function _fun80441() { // fn#80441, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:3877, offset: 0x01e7b8ad, size: 23 bytes, params: 1, frame: 11
|
|
return env2_3(item);
|
|
}
|
|
|
|
function onPress_80442() { // fn#80442, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:3989, offset: 0x01e7b8ad, size: 23 bytes, params: 1, frame: 11
|
|
return env2_3(item);
|
|
}
|
|
|
|
function onLayout_80443({nativeEvent}) { // fn#80443, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:4090, offset: 0x01e7b8c4, size: 109 bytes, params: 2, frame: 18
|
|
var value2;
|
|
var current;
|
|
var indexBinding;
|
|
var Math;
|
|
const height = nativeEvent.layout.height;
|
|
if (height > 0) {
|
|
value2 = environment.__proto__.__proto__;
|
|
current = env2_10.current;
|
|
indexBinding = index;
|
|
Math = global.Math;
|
|
current[indexBinding] = Math.max(height, env2_10.current[indexBinding] ?? 0);
|
|
env2_11();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun80444() { // fn#80444, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:4365, offset: 0x01e7b931, size: 20 bytes, params: 1, frame: 11
|
|
return env0_13(env0_14);
|
|
}
|
|
|
|
function _fun80445() { // fn#80445, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:4400, offset: 0x01e7b945, size: 20 bytes, params: 1, frame: 11
|
|
return env0_13('default');
|
|
}
|
|
|
|
function _fun80446() { // fn#80446, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:4469, offset: 0x01e7b959, size: 31 bytes, params: 1, frame: 12
|
|
env0_15.set(env0_8 != null);
|
|
}
|
|
|
|
function pe() { // fn#80447, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:4549, owner: PremiumGiftPlanSelect.pe, offset: 0x01e7b978, size: 171 bytes, params: 1, frame: 20
|
|
const object = {};
|
|
let value = environment.__proto__;
|
|
const STANDARD_EASING = (NativeModule).STANDARD_EASING;
|
|
object.easing = STANDARD_EASING;
|
|
object.duration = 500;
|
|
const object2 = {};
|
|
const withTiming = TimingModule.withTiming;
|
|
const value3 = env0_15.get();
|
|
const value4 = 0;
|
|
object2.opacity = Reflect.apply(withTiming, TimingModule, [value3 ? 1 : value4, object]);
|
|
const object3 = {};
|
|
value = TimingModule;
|
|
object3.translateY = value.withTiming(env0_15.get() ? value4 : 100, object);
|
|
object2.transform = [object3];
|
|
return object2;
|
|
}
|
|
|
|
function _fun80448() { // fn#80448, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:4902, offset: 0x01e7ba23, size: 138 bytes, params: 1, frame: 16
|
|
let value = environment.__proto__;
|
|
value = importDefault(674) /* metro dependency 674 */;
|
|
value = value(styles.headerBackgroundColor.color);
|
|
value = value.alpha(0);
|
|
value = value.hex();
|
|
const items2 = [value];
|
|
value = importDefault(674) /* metro dependency 674 */;
|
|
value = value(styles.headerBackgroundColor.color);
|
|
value = value.alpha(1);
|
|
items2[1] = value.hex();
|
|
return items2;
|
|
}
|
|
|
|
function PremiumGiftPlanSelectSe(a0, a1) { // fn#80449, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:5090, owner: PremiumGiftPlanSelect.Se, offset: 0x01e7baad, size: 174 bytes, params: 3, frame: 20
|
|
let value = a1 - a0;
|
|
let Math = global.Math;
|
|
let max = Math.max;
|
|
const Math2 = global.Math;
|
|
const value3 = Reflect.apply(max, Math, [0, Math2.min(1, value)]);
|
|
Math = global.Math;
|
|
max = Math.max;
|
|
const Math3 = global.Math;
|
|
value = Reflect.apply(max, Math, [0, Math3.min(1, value - (env0_17 - 1))]);
|
|
const value5 = a0 * env0_16;
|
|
const value6 = value3 * (env0_18 - 16);
|
|
value *= env0_19 - env0_18;
|
|
return {transform: [{translateX: value5 + (16 + value6 + value)}]};
|
|
}
|
|
|
|
function _fun80450(a0, a1) { // fn#80450, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:6007, offset: 0x01e7bb5b, size: 51 bytes, params: 3, frame: 13
|
|
return env0_13(env0_14, {forScreenReader: true})({item: a0, index: a1});
|
|
}
|
|
|
|
function _fun80452(a0, a1) { // fn#80452, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:7978, offset: 0x01e7bbb5, size: 62 bytes, params: 3, frame: 13
|
|
return env0_13(env0_4 ? env0_14 : 'default', {forScreenReader: true})({item: a0, index: a1});
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function PremiumGiftPlanSelectOnConfigurePanGesture(a0) { // fn#80451, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:6200, owner: PremiumGiftPlanSelect.onConfigurePanGesture, offset: 0x01e7bb8e, size: 39 bytes, params: 2, frame: 12
|
|
a0.activeOffsetX([-10, 10]);
|
|
}
|
|
|
|
function PremiumGiftPlanSelectOnConfigurePanGesture_80453(a0) { // fn#80453, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10569:8199, owner: PremiumGiftPlanSelect.onConfigurePanGesture, offset: 0x01e7bb8e, size: 39 bytes, params: 2, frame: 12
|
|
a0.activeOffsetX([-10, 10]);
|
|
}
|
|
|
|
global.__d(_fun80427, 10383, [57, 31, 27, 7670, 7261, 1880, 661, 33, 4501, 697, 674, 1484, 1585, 1478, 7669, 4559,
|
|
5286, 566, 10384, 7633, 7635, 10382, 10386, 10389, 9625, 4017, 1305, 4504, 10396, 6789, 10397, 10431, 7725,
|
|
1244, 5312, 5475, 10455, 4589, 5314, 4573,
|
|
2]) /* metro module 10383, dependencies: [57, 31, 27, 7670, 7261, 1880, 661, 33, 4501, 697, 674, 1484, 1585, 1478, 7669, 4559, 5286, 566, 10384, 7633, 7635, 10382, 10386, 10389, 9625, 4017, 1305, 4504, 10396, 6789, 10397, 10431, 7725, 1244, 5312, 5475, 10455, 4589, 5314, 4573, 2] */;
|