/* Metro module 10389; source: modules/premium/native/gifting/PremiumGiftFeaturesCard.tsx; dependencies: [57, 31, 27, 7261, 1880, 482, 33, 697, 4501, 6597, 566, 7583, 10390, 7947, 10391, 7672, 10392, 5475, 7962, 10393, 7966, 7964, 4573, 1244, 7971, 4578, 2] */
function _fun80476(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80476, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10575:6, offset: 0x01e7c9a3, size: 684 bytes, params: 8, frame: 22
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
let value = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(27) /* metro dependency 27 */).View;
const promotionsStore = importDefault(7261) /* metro dependency 7261: PromotionsStore */;
const premiumConstantsModule = require(1880) /* metro dependency 1880: PremiumConstants */;
const env0_7 = premiumConstantsModule.PremiumTypes;
const env0_8 = premiumConstantsModule.SubscriptionIntervalTypes;
const env0_9 = (require(482) /* metro dependency 482: Constants */).Fonts;
const value3 = require(33) /* metro dependency 33 */;
const env0_10 = value3.jsx;
const env0_11 = value3.Fragment;
const env0_12 = value3.jsxs;
object2 = {};
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object2.default = {paddingVertical: PX_8};
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object2.compact = {paddingVertical: PX_4};
object2.smallCompact = {paddingVertical: 2};
object2 = {};
let PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object2.default = {marginTop: PX_24};
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object2.compact = {marginTop: PX_12};
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object2.smallCompact = {marginTop: PX_8};
object2 = {};
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object2.default = {marginTop: PX_8};
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object2.compact = {marginTop: PX_12};
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object2.smallCompact = {marginTop: PX_8};
object2 = {};
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object2.default = {marginTop: PX_24};
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object2.compact = {marginTop: PX_12};
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object2.smallCompact = {marginTop: PX_8};
const env0_17 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun80477);
value = value.memo(PremiumGiftFeaturesCard);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftFeaturesCard.tsx');
exports.default = value;
}
function _fun80477() { // fn#80477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10575:788, offset: 0x01e7cc4f, size: 652 bytes, params: 1, frame: 18
const object5 = {};
const object6 = {overflow: 'hidden'};
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object5.promotional = object6;
const object7 = {justifyContent: 'flex-start'};
object7.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
const BG_SURFACE_RAISED = (importDefault(697) /* metro dependency 697: native */).colors.BG_SURFACE_RAISED;
object7.backgroundColor = BG_SURFACE_RAISED;
const SHADOW_LOW = (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_LOW;
copyDataProperties(object7, SHADOW_LOW, undefined);
object5.card = object7;
const object8 = {};
const PX_40 = (importDefault(697) /* metro dependency 697: native */).space.PX_40;
object8.marginTop = PX_40;
let PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object8.marginStart = PX_24;
object5.logo = object8;
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object5.promotionalLogo = {marginTop: PX_24};
const PX_32 = (importDefault(697) /* metro dependency 697: native */).space.PX_32;
object5.promotionalLogoSingleLine = {marginTop: PX_32};
object5.promotionalLogoSmallCompact = {marginTop: 18};
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object5.pricing = {maxWidth: 140, marginStart: PX_24};
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object5.featureTitle = {marginStart: PX_24};
const object9 = {};
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object9.marginTop = PX_8;
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object9.marginHorizontal = PX_24;
object5.features = object9;
const object12 = {};
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object12.marginHorizontal = PX_24;
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object12.marginBottom = PX_24;
object5.button = object12;
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object5.promotionalButton = {marginTop: PX_12};
object5.featureIcon = {'width': 24, 'height': 24};
const object14 = {};
const defaultImport = importDefault(6597) /* metro dependency 6597: TextStyles */;
const PRIMARY_NORMAL = Fonts.PRIMARY_NORMAL;
const WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
copyDataProperties(object14, defaultImport(PRIMARY_NORMAL, WHITE, 16), undefined);
object14['marginStart'] = -8;
object5.featureText = object14;
object5.wumpusNoPrice = {'height': 75, 'right': 8};
object5.promotionalCardImage = {'position': 'absolute', 'top': 0, 'left': 0, 'right': 0, 'bottom': 0};
object5.promotionalBackground = {'position': 'absolute', 'height': 300, 'width': 150, 'right': 0};
return object5;
}
function PremiumGiftFeaturesCard(a0) { // fn#80478, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10575:1839, offset: 0x01e7cedb, size: 1919 bytes, params: 2, frame: 46
var r11;
var text;
var r8;
var jsxRuntimeEnv0_11Binding;
var items5;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var items10;
const premiumType = a0.premiumType;
const onPress = a0.onPress;
const style = a0.style;
const claimableRewards = a0.claimableRewards;
let isSelected = a0.isSelected;
const value = undefined;
isSelected = isSelected === value || isSelected;
let variant = a0.variant;
variant = variant === value ? 'default' : variant;
let object = {'premiumType': 0, 'onPress': 0, 'style': 0, 'claimableRewards': 0, 'isSelected': 0, 'variant': 0};
silentSetPrototypeOf(object, null, undefined);
const value4 = copyDataProperties({}, a0, object, undefined);
const value6 = (require(566) /* metro dependency 566: flux */).useStateFromStores([PromotionsStore], _fun80479);
const value7 = (require(10390) /* metro dependency 10390: MarketingComponentHooks */).useThemeAndReducedMotionAwareAssetUrl(value6 == null ? value : value6.cardAsset);
const value8 = (require(10390) /* metro dependency 10390: MarketingComponentHooks */).useThemeAndReducedMotionAwareAssetUrl(value6 == null ? value : value6.backgroundAsset);
const styles = useStyles(claimableRewards != null && claimableRewards.length === 1);
const value11 = (importDefault(7947) /* metro dependency 7947: usePremiumFeatures */)(premiumType);
const defaultImport = importDefault(10391) /* metro dependency 10391: usePremiumProductPricingString */;
const MONTH = SubscriptionIntervalTypes.MONTH;
const value12 = defaultImport(premiumType, MONTH);
const defaultImport2 = defaultImport;
const YEAR = SubscriptionIntervalTypes.YEAR;
const value13 = defaultImport2(premiumType, YEAR);
const {showGiftPrice,
useNewCopy} = (importDefault(7672) /* metro dependency 7672: NitroGiftPriceCopyExperiment */).useConfig({location: 'PremiumGiftFeaturesCard'});
let r13 = (importDefault(10392) /* metro dependency 10392: useShouldShowGiftingPromotionDeco */)(premiumType) && claimableRewards != null && claimableRewards.length > 0;
const r21 = r13 && value7 != null;
const binding = env0_4;
const value20 = env0_3(binding.useState(0), 2);
const property = value20[0];
const value21 = 1;
const env0_0 = value20[value21];
const value22 = binding.useCallback(_fun80480, []);
const items2 = [styles.card, style];
items2[2] = r13 && styles.promotional;
const r5 = r21 && ((Component) => )(importDefault(5475) /* metro dependency 5475: FastImage */);
const PremiumFeaturesBackground = importDefault(7962) /* metro dependency 7962: PremiumFeaturesBackground */;
const premiumFeaturesBackgroundProps = {premiumType: premiumType, opacity: r21 ? 0.82 : value21,
style: [styles.card, style, r13 && styles.promotional], ...value4};
if (r13) {
jsxRuntimeEnv0_11Binding = jsxRuntimeEnv0_11;
items5 = [value6 != null && ((Component) => )(importDefault(10393) /* metro dependency 10393: PremiumGiftPlanSelectPromotionalBanner */)];
items5[1] = value8 != null && ((Component) => )(importDefault(5475) /* metro dependency 5475: FastImage */);
r11 = <>{items5}>;
} else {
r11 = ((Component) => )(importDefault(7966) /* metro dependency 7966: PremiumFeaturesWumpus */);
}
object = [r11];
object[1] = ((Component) => )(importDefault(7964) /* metro dependency 7964: PremiumFeaturesLogo */);
if (showGiftPrice) {
if (useNewCopy) {
var textProps = {'style': null, 'variant': 'text-sm/medium', 'color': 'always-white',
style: [styles.pricing,
env0_15[variant]]};
items10 = [value12, ' '];
items10[2] = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.lVQycU);
text = {items10};
} else {
text = {intl.format((require(1244) /* metro dependency 1244: indexNative */).t.Ob6fwp,
{monthlyPrice: value12, yearlyPrice: value13})};
}
r8 = text;
} else {
r8 = showGiftPrice;
}
object[2] = r8;
const items11 = [styles.featureTitle, env0_14[variant]];
const string = intl.string;
const JgsVht = (require(1244) /* metro dependency 1244: indexNative */).t.JgsVht;
object[3] = {Reflect.apply(string, intl,
[JgsVht])};
object[4] = ((Component) => )(importDefault(7971) /* metro dependency 7971: PremiumFeatureList */);
object[5] = ;
const items12 = [styles.button, env0_16[variant]];
r13 = r13 && styles.promotionalButton;
items12[2] = r13;
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
const TIER_0 = PremiumTypes.TIER_0;
object[6] = ;
return (
{r5}
{object}
);
}
function _fun80479() { // fn#80479, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10575:2006, offset: 0x01e7d65a, size: 111 bytes, params: 1, frame: 13
var giftPlanSelectionCardBanner;
var properties;
let value = environment.__proto__;
const getMarketingComponentByType = PromotionsStore.getMarketingComponentByType;
const MarketingComponentType = (require(7583) /* metro dependency 7583: MarketingComponentType */).MarketingComponentType;
const GIFT_PLAN_SELECTION_CARD_BANNER = MarketingComponentType.GIFT_PLAN_SELECTION_CARD_BANNER;
value = Reflect.apply(getMarketingComponentByType, PromotionsStore, [GIFT_PLAN_SELECTION_CARD_BANNER]);
const value2 = null;
if (value2 == value) {
giftPlanSelectionCardBanner = value2;
} else {
properties = value.properties;
properties = properties.properties;
if (properties.oneofKind !== 'giftPlanSelectionCardBanner') {
giftPlanSelectionCardBanner = value2;
} else {
properties = value.properties;
properties = properties.properties;
giftPlanSelectionCardBanner = properties.giftPlanSelectionCardBanner;
}
}
return giftPlanSelectionCardBanner;
}