// Module ID: 10878 // Function ID: 10879 // Name: PremiumGiftFeaturesCard // Dependencies: [19, 17, 10793, 1373, 1085, 21, 576, 4636, 5605, 504, 10870, 9500, 10879, 10880, 8958, 9514, 9512, 4632, 1114, 9521, 5056, 10881, 4347, 5068, 10882, 1925, 2] // Module 10878 (PremiumGiftFeaturesCard) import initialize from "initialize" /* 504 */; import nativeDefault from "native" /* 576 */; import util from "util" /* 1114 */; import StringUtils from "StringUtils" /* 1925 */; import native from "native" /* 4347 */; import Text_Text from "Text/Text" /* 4632 */; import components_Button_Button from "components/Button/Button" /* 5056 */; import LinearGradientDefault from "LinearGradient" /* 5068 */; import TextStylesDefault from "TextStyles" /* 5605 */; import usePremiumFeaturesDefault from "usePremiumFeatures" /* 9500 */; import PremiumFeaturesLogoDefault from "PremiumFeaturesLogo" /* 9512 */; import PremiumFeaturesWumpusDefault from "PremiumFeaturesWumpus" /* 9514 */; import PremiumFeatureListDefault from "PremiumFeatureList" /* 9521 */; import MarketingComponentType from "MarketingComponentType" /* 10870 */; import usePremiumProductPricingStringDefault from "usePremiumProductPricingString" /* 10879 */; import useShouldShowGiftingPromotionDecoDefault from "useShouldShowGiftingPromotionDeco" /* 10880 */; import MarketingComponentHooks from "MarketingComponentHooks" /* 10881 */; import PremiumGiftPromotionDetailsDefault from "PremiumGiftPromotionDetails" /* 10882 */; import noop from "module_19" /* 19 */; import PromotionsStore from "PromotionsStore" /* 10793 */; require = fn; function PremiumGiftPlanSelectPromotionDetails(config) { config = config.config; ({ numClaimableRewards, isSelected, onPress } = config); const tmp = closure_15(config.isLargeSize); const themeAndReducedMotionAwareAssetUrl = MarketingComponentHooks.useThemeAndReducedMotionAwareAssetUrl(config.avatarAsset, true); const obj2 = { theme: constants3.DARK, children: null }; const obj3 = { style: tmp.promotionDetailsContainer, colors: [4294967102, 4294967053], children: null }; const tmp6 = closure_1_10; obj4 = { imageUrl: themeAndReducedMotionAwareAssetUrl, title: null, subtitle: null, subtitleColor: "text-default", shouldAnimate: null }; const tmp7 = LinearGradientDefault; const tmp8 = PremiumGiftPromotionDetailsDefault; if (obj5.isNullOrEmpty(config.header)) { const intl = tmp2(1114).intl; let header = intl.string(tmp2(1114).t.OEtqpm); } else { header = config.header; } obj4.title = header; obj5 = StringUtils; if (tmp2Result.isNullOrEmpty(config.mobileBody)) { const intl2 = tmp2(1114).intl; const obj6 = { availableCount: numClaimableRewards }; let mobileBody = intl2.formatToPlainString(tmp2(1114).t["2h5M+X"], obj6); } else { mobileBody = config.mobileBody; } obj4.subtitle = mobileBody; obj4.shouldAnimate = isSelected; const items = [React7(tmp8, obj4), ]; const obj7 = { variant: "primary-overlay", text: null, onPress: null }; const intl3 = tmp2(1114).intl; obj7.text = intl3.string(util.t.Ve9Ge6); obj7.onPress = onPress; items[1] = React7(components_Button_Button.Button, obj7); obj3.children = items; obj2.children = tmp6(tmp7, obj3); return React7(native.ThemeContextProvider, obj2); } const View = fn(17).View; const PremiumConstants = fn(1373); ({ PremiumTypes: hasOwnProperty, SubscriptionIntervalTypes: metroRequire } = PremiumConstants); const Constants = fn(1085); ({ Fonts: closure_7, ThemeTypes: closure_8 } = Constants); const jsxProd = fn(21); ({ jsx: closure_9, jsxs: c10 } = jsxProd); let obj = { default: { paddingVertical: nativeDefault.space.PX_8 }, compact: null, smallCompact: null }; let obj2 = { paddingVertical: nativeDefault.space.PX_8 }; obj.compact = { paddingVertical: nativeDefault.space.PX_4 }; obj.smallCompact = { paddingVertical: 2 }; let obj4 = { default: null, compact: null, smallCompact: null }; let obj3 = { paddingVertical: nativeDefault.space.PX_4 }; obj4.default = { marginTop: nativeDefault.space.PX_24 }; let obj5 = { marginTop: nativeDefault.space.PX_24 }; obj4.compact = { marginTop: nativeDefault.space.PX_12 }; let obj6 = { marginTop: nativeDefault.space.PX_12 }; obj4.smallCompact = { marginTop: nativeDefault.space.PX_8 }; let obj8 = { default: null, compact: null, smallCompact: null }; let obj7 = { marginTop: nativeDefault.space.PX_8 }; obj8.default = { marginTop: nativeDefault.space.PX_8 }; let obj9 = { marginTop: nativeDefault.space.PX_8 }; obj8.compact = { marginTop: nativeDefault.space.PX_12 }; const obj10 = { marginTop: nativeDefault.space.PX_12 }; obj8.smallCompact = { marginTop: nativeDefault.space.PX_8 }; const obj12 = { default: null, compact: null, smallCompact: null }; const obj11 = { marginTop: nativeDefault.space.PX_8 }; obj12.default = { marginTop: nativeDefault.space.PX_24 }; const obj13 = { marginTop: nativeDefault.space.PX_24 }; obj12.compact = { marginTop: nativeDefault.space.PX_12 }; const obj14 = { marginTop: nativeDefault.space.PX_12 }; obj12.smallCompact = { marginTop: nativeDefault.space.PX_8 }; const createStyles = fn(4636); let closure_15 = createStyles.createStyles(() => { obj = { card: null, logo: null, pricing: null, featureTitle: null, features: null, button: null, featureIcon: null, featureText: null, promotionDetailsContainer: null }; const merged = Object.assign(nativeDefault.shadows.SHADOW_LOW); obj.card = { justifyContent: "flex-start", borderRadius: nativeDefault.radii.sm, backgroundColor: nativeDefault.colors.BG_SURFACE_RAISED }; const obj2 = { justifyContent: "flex-start", borderRadius: nativeDefault.radii.sm, backgroundColor: nativeDefault.colors.BG_SURFACE_RAISED }; obj.logo = { marginTop: nativeDefault.space.PX_40, marginStart: nativeDefault.space.PX_24 }; const obj3 = { marginTop: nativeDefault.space.PX_40, marginStart: nativeDefault.space.PX_24 }; obj.pricing = { maxWidth: 140, marginStart: nativeDefault.space.PX_24 }; obj4 = { maxWidth: 140, marginStart: nativeDefault.space.PX_24 }; obj.featureTitle = { marginStart: nativeDefault.space.PX_24 }; const obj5 = { marginStart: nativeDefault.space.PX_24 }; obj.features = { marginTop: nativeDefault.space.PX_8, marginHorizontal: nativeDefault.space.PX_24 }; const obj6 = { marginTop: nativeDefault.space.PX_8, marginHorizontal: nativeDefault.space.PX_24 }; obj.button = { marginHorizontal: nativeDefault.space.PX_24, marginBottom: nativeDefault.space.PX_24 }; obj.featureIcon = { width: 24, height: 24 }; obj8 = {}; const obj7 = { marginHorizontal: nativeDefault.space.PX_24, marginBottom: nativeDefault.space.PX_24 }; const merged1 = Object.assign(TextStylesDefault(constants2.PRIMARY_NORMAL, nativeDefault.colors.WHITE, 16)); obj8.marginStart = -8; obj.featureText = obj8; obj.promotionDetailsContainer = { marginHorizontal: nativeDefault.space.PX_24, marginTop: nativeDefault.space.PX_20, marginBottom: nativeDefault.space.PX_32, padding: nativeDefault.space.PX_12, gap: nativeDefault.space.PX_12, borderRadius: nativeDefault.radii.sm }; return obj; }); const obj15 = { marginTop: nativeDefault.space.PX_8 }; const size = fn(2); const result = size.fileFinishedImporting("modules/premium/native/gifting/PremiumGiftFeaturesCard.tsx"); export default noop.memo(function PremiumGiftFeaturesCard(variant) { ({ premiumType, onPress, style, claimableRewards, isSelected } = variant); if (isSelected === undefined) { isSelected = true; } let str = variant.variant; if (str === undefined) { str = "default"; } const merged = Object.assign(variant, Object.assign({ premiumType: 0, onPress: 0, style: 0, claimableRewards: 0, isSelected: 0, variant: 0 })); obj = initialize; const items = [PromotionsStore]; const stateFromStores = obj.useStateFromStores(items, () => { marketingComponentByType = marketingComponentByType.getMarketingComponentByType(MarketingComponentType.MarketingComponentType.GIFT_PLAN_SELECTION_CARD_BANNER); let prop = null; if (null != marketingComponentByType) { prop = null; if ("giftPlanSelectionCardBanner" === marketingComponentByType.properties.properties.oneofKind) { prop = marketingComponentByType.properties.properties.giftPlanSelectionCardBanner; } } return prop; }); let tmp5 = null != claimableRewards; if (tmp5) { tmp5 = 1 === claimableRewards.length; } const tmp6 = closure_15(tmp5); const tmp8 = usePremiumFeaturesDefault(premiumType); const tmp9 = usePremiumProductPricingStringDefault(premiumType, constants.MONTH); let tmp11 = useShouldShowGiftingPromotionDecoDefault(premiumType) && null != claimableRewards; if (tmp11) { tmp11 = claimableRewards.length > 0; } const obj2 = { style: null, children: null }; const items1 = [tmp6.card, style]; obj2.style = items1; const obj3 = { premiumType, style: null }; const items2 = [tmp6.card, style]; obj3.style = items2; const tmp10 = usePremiumProductPricingStringDefault(premiumType, constants.YEAR); const tmp14 = closure_1_10; const merged1 = Object.assign(merged); const items3 = [React7(PremiumFeaturesWumpusDefault, { premiumType }), , , , , , ]; obj4 = { style: tmp6.logo, premiumType }; items3[1] = React7(PremiumFeaturesLogoDefault, obj4); const obj5 = { style: null, variant: "text-sm/medium", color: "text-overlay-light", children: null }; const items4 = [tmp6.pricing, obj8[str]]; obj5.style = items4; const intl = tmp2(1114).intl; obj5.children = intl.format(util.t.Ob6fwp, { monthlyPrice: tmp9, yearlyPrice: tmp10 }); items3[2] = React7(Text_Text.Text, obj5); const obj6 = { style: null, variant: "heading-sm/bold", color: "text-overlay-light", children: null }; const items5 = [tmp6.featureTitle, obj4[str]]; obj6.style = items5; const intl2 = tmp2(1114).intl; obj6.children = intl2.string(util.t.JgsVht); items3[3] = React7(Text_Text.Text, obj6); items3[4] = React7(PremiumFeatureListDefault, { style: tmp6.features, features: tmp8, iconStyle: tmp6.featureIcon, labelStyle: tmp6.featureText, rowStyle: obj[str] }); items3[5] = React7(View, { style: { flexGrow: 1 } }); if (tmp11) { if (null != stateFromStores) { if (premiumType === hasOwnProperty.TIER_2) { obj8 = { config: stateFromStores, numClaimableRewards: claimableRewards.length, isLargeSize: tmp5, isSelected, onPress }; let tmp12Result = tmp12(PremiumGiftPlanSelectPromotionDetails, obj8); } items3[6] = tmp12Result; obj3.children = items3; obj2.children = tmp14(tmp7Result, obj3); return tmp12(tmp13, obj2); } } const obj9 = { style: null, children: null }; const items6 = [tmp6.button, obj12[str]]; obj9.style = items6; if (premiumType === hasOwnProperty.TIER_0) { const intl4 = tmp2(1114).intl; let stringResult = intl4.string(tmp2(1114).t.rk4Uu8); } else { const intl3 = tmp2(1114).intl; stringResult = intl3.string(tmp2(1114).t.Ve9Ge6); } obj9.children = React7(components_Button_Button.Button, { variant: "primary-overlay", text: stringResult, onPress }); tmp12Result = tmp12(tmp13, obj9); });