/* Metro module 3802; source: utils/PremiumUtils.tsx; dependencies: [57, 31, 3803, 1878, 3804, 3805, 3807, 3808, 661, 1880, 3816, 482, 3, 3817, 3814, 1900, 44, 1244, 2806, 3738, 3826, 3847, 5137, 3815, 12192, 672, 566, 8458, 4136, 12706, 5136, 1893, 1895, 7937, 2] */ function _fun29030(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#29030, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:6, offset: 0x00fb4eb3, size: 3033 bytes, params: 8, frame: 89 let env0_0 = require; const _arrayLikeToArray_29033 = function(a0, a1) { var r0; var r1; var r2; var value3; var length; var value5; var value = undefined; var value2 = value == null; reducibleJoin2: while (true) { if (value2) { r0 = value2; break reducibleJoin2; } value3 = value > a0.length; r0 = value3; break reducibleJoin2; } reducibleJoin4: while (true) { if (r0) { length = a0.length; r1 = length; break reducibleJoin4; } r1 = value; break reducibleJoin4; } value = (0, global.Array)(r1); var value4 = 0; if (value4 < r1) { r2 = value4; reducibleLoop5: while (true) { value[r2] = a0[r2]; value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1; if (value5 < r1) { r2 = value5; continue reducibleLoop5; } break reducibleLoop5; } } return value; }; const closure = function({items}) { return items.find(_fun29035); }; const closure2 = getDefaultPrice; const closure3 = function(a0, a1) { var r0; var object; var value = a0; if (a1 == null) { r0 = value; } else { object = {}; copyDataProperties(object, value, a1); value = global.Object.fromEntries(a1.map(_fun29038)); object['contextPlanPrices'] = value; r0 = object; } return r0; }; const closure4 = getPrice; const closure5 = experimentalGetPrices; const closure6 = experimentalGetPrice; const closure7 = function(a0) { return {amount: a0.amount, currency: a0.currency, exponent: a0.exponent}; }; const closure8 = getItemPlansTotalServerPrice; const closure9 = getInterval; const closure10 = getIntervalString; const closure11 = getIntervalStringAsNoun; const closure12 = getPremiumType; const closure13 = getDisplayName_29051; const closure14 = getTierDisplayNameByPlanId; const closure15 = getPlanDescription; const closure16 = getPremiumPlanOptions; const closure17 = getSkuIdForPlan; const closure18 = getNumPremiumGuildSubscriptions; const closure19 = subscriptionHasPremiumGuildPlan; const closure20 = isPremiumBaseSubscriptionPlan; const closure21 = function(a0) { return PREMIUM_GUILD_SUBSCRIPTION_PLANS.has(a0); }; const closure22 = getBillingGracePeriodDaysAndExpiresDate; const closure23 = getExpectedRenewalDate; const closure24 = getBillingInformationString; const closure25 = extendDateWithUnconsumedFractionalPremium; const closure26 = getUnactivatedFractionalPremiumDurationString; const closure27 = isSwitchingPlansDisabled; const closure28 = getSwitchingPlansDisabledMessage; const closure29 = isSubscriptionPrepaidPaymentSource; const closure30 = isPrepaidPaymentSource; const closure31 = function({renewalMutations, additionalPlans, status}) { var value2 = getNumPremiumGuildSubscriptions(additionalPlans); var value3 = null; return (value3 != renewalMutations ? getNumPremiumGuildSubscriptions(renewalMutations.additionalPlans) : value3) !== 0 || value2 === 0 ? status : SubscriptionStatusTypes.CANCELED; }; const closure32 = isPremiumGuildSubscriptionCanceled; const closure33 = getFormattedPriceForPlan; const closure34 = getPlanIdFromInvoice; const closure35 = getStatusFromInvoice; const closure36 = isBaseSubscriptionCanceled; const closure37 = isSubscriptionStatusFailedPayment; const closure38 = getFormattedPlanPriceFromInvoice; const closure39 = getPremiumGuildIntervalPrice; const closure40 = getBillingReviewSubheader; const closure41 = getIntervalForInvoice; const closure42 = getDefaultCurrency; const closure43 = formatTrialCtaIntervalDuration; const closure44 = getExternalSubscriptionMethodUrl; const closure45 = function(a0, a1) { var r5; var env0_0 = a0; var items = []; var property = a0.renewalMutations; var value = property == null; r5 = value ? undefined : property.items; r5 = r5 ?? a0.items; var value3 = r5.find(_fun29093); if (value3 != null) { items.push(value3); } property = items.push; var items2 = []; arraySpread(items2, a1, 0, value); apply(property, items2, items, value); return items.map(_fun29094); }; const closure46 = function(a0) { return a0.filter(_fun29096); }; const closure47 = getItemsWithUpsertedPlanIdForGroup; const closure48 = function(a0) { var value = null; return value == a0 ? value : a0.items.find(_fun29102); }; const closure49 = isBoostOnlySubscription; const closure50 = getPremiumSkuIdForSubscription; const closure51 = function(a0) { if (a0 != null) { var value2 = getPremiumPlanItem(a0); if (value2 != null) { return getPremiumType(value2.planId); } } }; const closure52 = function(a0) { var r0; var property; var value = a0 != null; if (value) { property = global.Date; value = property.now(); property = a0.createdAt; value -= property.getTime(); value = value < 2592000000; r0 = value; } else { r0 = value; } return r0; }; const closure53 = canUseQuestOrbMultiplier; const closure54 = canUseCollectibles; const closure55 = formatPriceString; const closure56 = function(a0) { return a0; }; const closure57 = function(a0) { return a0 != null && 'trial_id' in a0; }; const closure58 = function(a0) { return a0 != null && 'discountId' in a0; }; const closure59 = formatInterval; const closure60 = function(a0) { return a0 != null && !a0.isProvisional && !a0.bot; }; const closure61 = getUnactivatedFractionalPremiumHours; const closure62 = function(a0) { return a0.reduce(_fun29118, 0); }; const closure63 = getMonthlyPrice; const closure64 = calculateDiscountPercentageForYearlyPlan; const closure65 = getDaysSincePremium; const closure66 = getDaysRemainingUntilSubscriptionCurrentPeriodEnds; let Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_3 = importDefault(57) /* metro dependency 57 */; const env0_4 = importAll(31) /* metro dependency 31 */; const isNoneSubscription = (require(3803) /* metro dependency 3803: SubscriptionPlanRecord */).isNoneSubscription; const userStore = importDefault(1878) /* metro dependency 1878: UserStore */; const billingInfoStore = importDefault(3804) /* metro dependency 3804: BillingInfoStore */; const paymentSourceStore = importDefault(3805) /* metro dependency 3805: PaymentSourceStore */; const subscriptionPlanStore = importDefault(3807) /* metro dependency 3807: SubscriptionPlanStore */; const subscriptionStore = importDefault(3808) /* metro dependency 3808: SubscriptionStore */; let value = require(661) /* metro dependency 661: Constants */; const env0_11 = value.InvoiceStatusTypes; const env0_12 = value.PaymentGateways; const env0_13 = value.PriceSetAssignmentPurchaseTypes; const env0_14 = value.SubscriptionStatusTypes; value = require(1880) /* metro dependency 1880: PremiumConstants */; const env0_15 = value.DISCOUNTS; const env0_16 = value.ANNUAL_DISCOUNT_PERCENTAGE_FALLBACK; const env0_17 = value.DEFAULT_APPLE_GRACE_PERIOD_DAYS; const env0_18 = value.DEFAULT_GOOGLE_GRACE_PERIOD_DAYS; const env0_19 = value.DEFAULT_MAX_GRACE_PERIOD_DAYS; const env0_20 = value.DISCOUNT_DURATION_FALLBACK; const env0_21 = value.DISCOUNT_PERCENTAGE_FALLBACK; const env0_22 = value.DiscountUserUsageLimitIntervalTypes; const env0_23 = value.FRACTIONAL_PREMIUM_SKU_INTERVAL_COUNTS; const env0_24 = value.FractionalPremiumIntervalTypes; const env0_25 = value.FractionalPremiumStates; const env0_26 = value.MAX_ACCOUNT_HOLD_DAYS; const env0_27 = value.MAX_PAYMENT_PROCESSING_TIME_DAYS; const env0_28 = value.NUM_FREE_GUILD_BOOSTS_WITH_PREMIUM; const env0_29 = value.PAID_SUBSCRIPTION_MAX_BILLING_RETRY_DAYS; const env0_30 = value.PAID_SUBSCRIPTION_MAX_GRACE_PERIOD_DAYS; const env0_31 = value.PREMIUM_GUILD_SUBSCRIPTION_PLANS; const env0_32 = value.PREMIUM_PLANS; const env0_33 = value.PREMIUM_SKU_TO_MONTHLY_PLAN; const env0_34 = value.PREMIUM_TIER_2_PLANS; const env0_35 = value.PREMIUM_TIER_2_REVERSE_FOLLOWUP_TRIAL_ID; const env0_36 = value.PREMIUM_TIER_2_TRIAL_FOR_EVERYONE_TRIAL_ID; const env0_37 = value.PREMIUM_TYPE_DISPLAY_NAME; const env0_38 = value.PremiumSubscriptionSKUs; const env0_39 = value.PremiumTypes; const env0_40 = value.PremiumUserLimits; const env0_41 = value.SubscriptionIntervalTypes; const env0_42 = value.SubscriptionPlanInfo; const SubscriptionPlans = value.SubscriptionPlans; const env0_44 = value.TRIAL_FOR_EVERYONE_OFFER_EXPIRES_APPROACHING_THRESHOLD; const env0_45 = value.USER_PREMIUM_OFFER_EXPIRES_APPROACHING_4_DAY_THRESHOLD; const env0_46 = value.USER_PREMIUM_OFFER_EXPIRES_APPROACHING_7_DAY_THRESHOLD; const env0_47 = (require(3816) /* metro dependency 3816: PremiumGroupConstants */).getPremiumGroupProductName; value = require(482) /* metro dependency 482: Constants */; const env0_48 = value.CurrencyCodes; const env0_49 = value.PaymentGatewayToFriendlyName; const env0_50 = value.PREPAID_PAYMENT_SOURCES; const env0_51 = {'PAYMENT_SOURCE_MANAGEMENT': 'https://support.apple.com/HT201266', 'BILLING_HISTORY': 'https://support.apple.com/HT201266', 'SUBSCRIPTION_MANAGEMENT': 'https://support.apple.com/HT202039'}; const env0_52 = {'SUBSCRIPTION_MANAGEMENT': 'https://play.google.com/store/account/subscriptions', 'PAYMENT_SOURCE_MANAGEMENT': 'https://play.google.com/store/paymentmethods', 'BILLING_HISTORY': 'https://play.google.com/store/account/orderhistory'}; value = importDefault(3) /* metro dependency 3: Logger */; value = new value('PremiumUtils.tsx'); let object = {MID: 'mid', HIGH: 'high'}; const Set = global.Set; const NONE_MONTH = SubscriptionPlans.NONE_MONTH; const NONE_3_MONTH = SubscriptionPlans.NONE_3_MONTH; const NONE_6_MONTH = SubscriptionPlans.NONE_6_MONTH; const NONE_YEAR = SubscriptionPlans.NONE_YEAR; const PREMIUM_MONTH_TIER_0 = SubscriptionPlans.PREMIUM_MONTH_TIER_0; const PREMIUM_MONTH_TIER_1 = SubscriptionPlans.PREMIUM_MONTH_TIER_1; const PREMIUM_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_MONTH_TIER_2; const PREMIUM_YEAR_TIER_0 = SubscriptionPlans.PREMIUM_YEAR_TIER_0; const PREMIUM_YEAR_TIER_1 = SubscriptionPlans.PREMIUM_YEAR_TIER_1; const PREMIUM_YEAR_TIER_2 = SubscriptionPlans.PREMIUM_YEAR_TIER_2; const PREMIUM_3_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_3_MONTH_TIER_2; const PREMIUM_6_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_6_MONTH_TIER_2; const PREMIUM_GROUP_MONTH = SubscriptionPlans.PREMIUM_GROUP_MONTH; let set = new Set([NONE_MONTH, NONE_3_MONTH, NONE_6_MONTH, NONE_YEAR, PREMIUM_MONTH_TIER_0, PREMIUM_MONTH_TIER_1, PREMIUM_MONTH_TIER_2, PREMIUM_YEAR_TIER_0, PREMIUM_YEAR_TIER_1, PREMIUM_YEAR_TIER_2, PREMIUM_3_MONTH_TIER_2, PREMIUM_6_MONTH_TIER_2, PREMIUM_GROUP_MONTH]); Object = global.Object; const freeze = Object.freeze; const object4 = {isNewUser: closure52}; const isPremiumAtLeast = (require(1900) /* metro dependency 1900: PremiumTypeUtils */).isPremiumAtLeast; object4.isPremiumAtLeast = isPremiumAtLeast; const isPremium = (require(1900) /* metro dependency 1900: PremiumTypeUtils */).isPremium; object4.isPremium = isPremium; const isPremiumExactly = (require(1900) /* metro dependency 1900: PremiumTypeUtils */).isPremiumExactly; object4.isPremiumExactly = isPremiumExactly; object4.isPremiumEligible = closure60; object4.getPrice = closure4; object4.getDefaultPrice = closure2; object4.getInterval = closure9; object4.getIntervalString = closure10; object4.getIntervalStringAsNoun = closure11; object4.getPremiumType = closure12; object4.getTierDisplayNameByPlanId = closure14; object4.getDisplayName = closure13; object4.getPremiumPlanOptions = closure16; object4.formatInterval = closure59; object4.getPlanDescription = closure15; object4.isPremiumSku = isPremiumSku; object4.getIntervalMonths = getIntervalMonths; const getUserMaxFileSize = (require(7937) /* metro dependency 7937: PremiumFeatureUtils */).getUserMaxFileSize; object4.getUserMaxFileSize = getUserMaxFileSize; object4.getSkuIdForPlan = closure17; object4.getSkuIdForPremiumType = function(a0) { if (PremiumTypes.TIER_0 === a0) { return PremiumSubscriptionSKUs.TIER_0; } if (PremiumTypes.TIER_1 === a0) { return PremiumSubscriptionSKUs.TIER_1; } if (PremiumTypes.TIER_2 === a0) { return PremiumSubscriptionSKUs.TIER_2; } }; object4.getNumIncludedPremiumGuildSubscriptionSlots = function(a0) { return getPremiumType(a0) !== PremiumTypes.TIER_2 ? 0 : NUM_FREE_GUILD_BOOSTS_WITH_PREMIUM; }; object4.getBillingInformationString = closure24; object4.getExpectedRenewalDate = closure23; object4.extendDateWithUnconsumedFractionalPremium = closure25; object4.getUnactivatedFractionalPremiumDurationString = closure26; object4.isSwitchingPlansDisabled = closure27; object4.getSwitchingPlansDisabledMessage = closure28; object4.isNoneSubscription = isNoneSubscription; object4.getPlanIdFromInvoice = closure34; object4.getStatusFromInvoice = closure35; object4.isBaseSubscriptionCanceled = closure36; object4.getPremiumGuildIntervalPrice = closure39; object4.hasAccountCredit = function(a0) { var r0; var value = a0 != null; r0 = value && a0.size !== 0; if (r0) { value = global.Array.from(a0); value = value.some(_fun29128); r0 = value; } return r0; }; object4.hasUnconsumedGiftForSubscriptionPlan = function(a0, a1) { var r0; var env0_0 = a1; var value = a0 != null; r0 = value && a0.size !== 0 && a1 != null; if (r0) { value = global.Array.from(a0); value = value.some(_fun29130); r0 = value; } return r0; }; object4.getBillingReviewSubheader = closure40; object4.getIntervalForInvoice = closure41; object4.getPremiumPlanItem = closure; object4.getGuildBoostPlanItem = closure48; object4.isBoostOnlySubscription = closure49; object4.getPremiumSkuIdForSubscription = closure50; object4.getPremiumTypeFromSubscription = closure51; object4.getUnactivatedFractionalPremiumHours = closure61; object4.castPremiumSubscriptionAsSkuId = closure56; object4.calculateDiscountPercentageForYearlyPlan = closure64; object4.getDaysSincePremium = closure65; object4.getDaysRemainingUntilSubscriptionCurrentPeriodEnds = closure66; object4.canUseAnimatedEmojis = canUseAnimatedEmojis; object4.canUseEmojisEverywhere = canUseEmojisEverywhere; object4.canUseSoundboardEverywhere = canUseSoundboardEverywhere; object4.canUseCustomCallSounds = canUseCustomCallSounds; object4.canUploadLargeFiles = canUploadLargeFiles; object4.canUseBadges = canUseBadges; object4.canUseHighVideoUploadQuality = canUseHighVideoUploadQuality; object4.canEditDiscriminator = canEditDiscriminator; object4.hasBoostDiscount = hasBoostDiscount; object4.canUseAnimatedAvatar = canUseAnimatedAvatar; object4.canInstallPremiumApplications = canInstallPremiumApplications; object4.canUseIncreasedMessageLength = canUseIncreasedMessageLength; object4.canUseIncreasedGuildCap = canUseIncreasedGuildCap; object4.canRedeemPremiumPerks = canRedeemPremiumPerks; object4.canUsePremiumProfileCustomization = canUsePremiumProfileCustomization; object4.canUsePremiumAppIcons = canUsePremiumAppIcons; object4.canUsePremiumGuildMemberProfile = canUsePremiumGuildMemberProfile; object4.canUseClientThemes = canUseClientThemes; object4.canStreamQuality = canStreamQuality; object4.canUseQuestOrbMultiplier = closure53; object4.hasFreeBoosts = hasFreeBoosts; object4.canUseCustomStickersEverywhere = canUseCustomStickersEverywhere; object4.canUseCustomBackgrounds = canUseCustomBackgrounds; object4.canUseCollectibles = closure54; object4.canUseMonthlyOrbs = canUseMonthlyOrbs; object4.canUseShopDiscounts = canUseShopDiscounts; object4.canUseMoreQuestOrbs = canUseMoreQuestOrbs; object4.formatPriceString = closure55; object4.StreamQuality = object; set = Reflect.apply(freeze, Object, [object4]); (require(2) /* metro dependency 2 */).fileFinishedImporting('utils/PremiumUtils.tsx'); exports.default = set; exports.Branding = {BUNDLE: 'bundle', TIER_0: 'tier_0', TIER_1: 'tier_1', TIER_2: 'tier_2', PREMIUM_GUILD: 'premium_guild'}; exports.StreamQuality = object; exports.getPremiumBranding = getPremiumBranding; exports.getPremiumPlanItem = closure; exports.getDefaultPrice = closure2; exports.withContextPlanPrices = closure3; exports.usePlanSelectPriceState = usePlanSelectPriceState; exports.getPrice = closure4; exports.getCountryPrices = getCountryPrices; exports.experimentalGetPrices = closure5; exports.experimentalGetPrice = closure6; exports.getServerPriceFromClientPrice = closure7; exports.getItemPlansTotalServerPrice = closure8; exports.getSubscriptionWithNewPlansTotalServerPrice = getSubscriptionWithNewPlansTotalServerPrice; exports.getInterval = closure9; exports.getDiscountIntervalString = getDiscountIntervalString; exports.getIntervalString = closure10; exports.getIntervalStringAsNoun = closure11; exports.getPremiumType = closure12; exports.getDisplayName = closure13; exports.getDisplayNameFromSku = getDisplayNameFromSku; exports.getTierDisplayNameByPlanId = closure14; exports.getPremiumTypeDisplayName = getPremiumTypeDisplayName; exports.getPlanDescriptionFromInvoice = getPlanDescriptionFromInvoice; exports.getExternalPlanDisplayName = getExternalPlanDisplayName; exports.getPremiumPlanOptions = closure16; exports.getPlanIdForPremiumType = getPlanIdForPremiumType; exports.getNumPremiumGuildSubscriptions = closure18; exports.subscriptionHasPremiumGuildPlan = closure19; exports.isPremiumBaseSubscriptionPlan = closure20; exports.isPremiumGuildSubscriptionPlan = closure21; exports.isPremiumSubscriptionPlan = isPremiumSubscriptionPlan; exports.isPremiumGroupSubscriptionPlan = isPremiumGroupSubscriptionPlan; exports.getBillingGracePeriodDaysAndExpiresDate = closure22; exports.getExpectedRenewalDate = closure23; exports.getBillingInformationString = closure24; exports.extendDateWithUnconsumedFractionalPremium = closure25; exports.getUnactivatedFractionalPremiumDurationString = closure26; exports.isSwitchingPlansDisabled = closure27; exports.getSwitchingPlansDisabledMessage = closure28; exports.isSubscriptionPrepaidPaymentSource = closure29; exports.isPrepaidPaymentSource = closure30; exports.getCoercedPremiumGuildSubscriptionStatus = closure31; exports.isPremiumGuildSubscriptionCanceled = closure32; exports.getPremiumGuildHeaderDescription = getPremiumGuildHeaderDescription; exports.getFormattedPriceForPlan = closure33; exports.getFormattedRateForPlan = getFormattedRateForPlan; exports.getPlanIdFromInvoice = closure34; exports.getStatusFromInvoice = closure35; exports.isBaseSubscriptionCanceled = closure36; exports.isSubscriptionStatusFailedPayment = closure37; exports.getFormattedPlanPriceFromInvoice = closure38; exports.getPremiumGuildIntervalPrice = closure39; exports.getBillingReviewSubheader = closure40; exports.getIntervalForInvoice = closure41; exports.getDefaultCurrency = closure42; exports.formatTrialOfferIntervalDuration = formatTrialOfferIntervalDuration; exports.formatTrialCtaIntervalDuration = closure43; exports.formatTrialCtaIntervalDurationFromTrialOffer = formatTrialCtaIntervalDurationFromTrialOffer; exports.formatIntervalDuration = formatIntervalDuration; exports.getExternalSubscriptionMethodUrl = closure44; exports.hasPremiumSubscriptionToDisplay = hasPremiumSubscriptionToDisplay; exports.useHasPremiumSubscriptionToDisplay = useHasPremiumSubscriptionToDisplay; exports.getItemsFromNewAdditionalPlans = closure45; exports.getItemsWithoutPremiumPlanItem = closure46; exports.getItemsWithUpsertedPlanIdForGroup = closure47; exports.getItemsWithUpsertedPremiumPlanId = function(a0, a1) { return getItemsWithUpsertedPlanIdForGroup(a0, a1, 1, PREMIUM_PLANS); }; exports.getItemsWithUpsertedPremiumGuildPlan = function(a0, a1, a2) { return getItemsWithUpsertedPlanIdForGroup(a0, a2, a1, PREMIUM_GUILD_SUBSCRIPTION_PLANS); }; exports.coerceExistingItemsToNewItemInterval = coerceExistingItemsToNewItemInterval; exports.getMaxFileSizeForPremiumType = getMaxFileSizeForPremiumType; exports.getGuildBoostPlanItem = closure48; exports.isBoostOnlySubscription = closure49; exports.getPremiumSkuIdForSubscription = closure50; exports.getPremiumTypeFromSubscription = closure51; exports.isNewUser = closure52; exports.formatPriceString = closure55; exports.castPremiumSubscriptionAsSkuId = closure56; exports.getPremiumTypeFromPlanId = getPremiumTypeFromPlanId; exports.isNitroLockedState = function(a0) { return 'isNitroLocked' in a0; }; exports.isPremiumAtLeast = isPremiumAtLeast; exports.isPremiumAtMost = (require(1900) /* metro dependency 1900: PremiumTypeUtils */).isPremiumAtMost; exports.isPremium = isPremium; exports.isPremiumExactly = isPremiumExactly; exports.useHasTier2Premium = function() { return require(dependencyMap[15]).isPremiumExactly(require(dependencyMap[26]).useStateFromStores([UserStore], _fun29192), PremiumTypes.TIER_2); }; exports.getOfferNoticeThreshold = function(a0) { var trial_id; if (isTrialOffer(a0)) { trial_id = a0.trial_id; if (PREMIUM_TIER_2_REVERSE_FOLLOWUP_TRIAL_ID === trial_id) { return USER_PREMIUM_OFFER_EXPIRES_APPROACHING_4_DAY_THRESHOLD; } if (PREMIUM_TIER_2_TRIAL_FOR_EVERYONE_TRIAL_ID === trial_id) { return TRIAL_FOR_EVERYONE_OFFER_EXPIRES_APPROACHING_THRESHOLD; } return USER_PREMIUM_OFFER_EXPIRES_APPROACHING_7_DAY_THRESHOLD; } return isDiscountOffer(a0) ? USER_PREMIUM_OFFER_EXPIRES_APPROACHING_7_DAY_THRESHOLD : USER_PREMIUM_OFFER_EXPIRES_APPROACHING_7_DAY_THRESHOLD; }; exports.isTrialOffer = closure57; exports.isDiscountOffer = closure58; exports.formatInterval = closure59; exports.isPremiumEligible = closure60; exports.getFractionalPremiumUnitsHours = closure61; exports.getFractionalPremiumUnitsHoursFromSkuIds = closure62; exports.getMonthlyPrice = closure63; exports.getSavingsPercent = getSavingsPercent; exports.calculateMonthlyPriceEquivalentTotal = calculateMonthlyPriceEquivalentTotal; exports.calculateDiscountPercentageForYearlyPlan = closure64; exports.getDaysSincePremium = closure65; exports.getDaysRemainingUntilSubscriptionCurrentPeriodEnds = closure66; } function _createForOfIteratorHelperLoose_29031(a0, a1) { // fn#29031, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:1580, offset: 0x00fb5a8c, size: 370 bytes, params: 3, frame: 20 var r6; var r9; var r5; var value3; var regexp; const env0_0 = a0; const Symbol = global.Symbol; let value = typeof Symbol !== 'undefined'; let r1 = value && a0[global.Symbol.iterator]; r1 = !r1 ? a0['@@iterator'] : r1; if (r1) { value = r1.call(a0); return value.next.bind(value); } const Array = global.Array; if (Array.isArray(a0)) { if (r1) { } return _fun29032; } value = undefined; if (a0) { if (typeof a0 === 'string') { value = _arrayLikeToArray_29033(a0, value); r5 = value; } else { value3 = ({}).toString.call(a0).slice(8, -1); r6 = value3 === 'Object' && a0.constructor; r9 = r6 ? a0.constructor.name : value3; if (r9 === 'Map') { r6 = global.Array.from(a0); } else if (r9 === 'Set') { r6 = global.Array.from(a0); } else if (r9 === 'Arguments') { value = _arrayLikeToArray_29033(a0, value); r6 = value; } else { regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', ''); if (regexp.test(r9)) { value = _arrayLikeToArray_29033(a0, value); r6 = value; } else { r6 = value; } } r5 = r6; } } else { r5 = value; } if (r5) { if (r5) { } return _fun29032; } const TypeError = global.TypeError; throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'); } function getPremiumPlanItem({items}) { // fn#29034, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:3126, offset: 0x00fb5bfe, size: 29 bytes, params: 2, frame: 11 return items.find(function(a0) { return PREMIUM_PLANS.has(a0.planId); }); } function getDefaultPrice(a0) { // fn#29036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:3199, offset: 0x00fb5c37, size: 144 bytes, params: 2, frame: 23 const value = a1; const value2 = a2; const value3 = a3; const value4 = a4; const value5 = undefined; const r6 = value !== value5 ? value : false; const r5 = value2 !== value5 ? value2 : false; const r0 = value3 !== value5 ? value3 : value5; const r4 = !(value4 !== value5) || value4; let r7 = PaymentSourceStore.defaultPaymentSourceId ?? value5; const premiumTypeSubscription = SubscriptionStore.getPremiumTypeSubscription(); r7 = premiumTypeSubscription != null && premiumTypeSubscription.paymentSourceId != null ? premiumTypeSubscription.paymentSourceId : r7; return getPrice(a0, r6, r5, {paymentSourceId: r7, currency: r0}, r4); } function withContextPlanPrices(a0, a1) { // fn#29037, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:3448, offset: 0x00fb5cc7, size: 79 bytes, params: 3, frame: 16 var r0; var object2; var Object; let value = a0; if (a1 == null) { r0 = value; } else { object2 = {}; copyDataProperties(object2, value, a1); Object = global.Object; value = Object.fromEntries(a1.map(function(a0) { return [a0.id, a0.price]; })); object2['contextPlanPrices'] = value; r0 = object2; } return r0; } function getPrice(a0) { // fn#29039, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:3573, offset: 0x00fb5d32, size: 508 bytes, params: 2, frame: 26 var r9; var object2; var error; var captureBillingException; var value7; var object4; var experimentalGetPriceBinding; var value9; var object6; let value = a1; const value2 = a2; const value3 = a3; const value4 = a4; const r0 = value !== undefined ? value : false; const r4 = value2 !== undefined ? value2 : false; const r14 = value3 !== undefined ? value3 : {}; const r2 = !(value4 !== undefined) || value4; const paymentSourceId = r14.paymentSourceId; const currency = r14.currency; const contextPlanPrices = r14.contextPlanPrices; if (contextPlanPrices == null) { if (SubscriptionPlanStore.get(a0) != null) { r9 = r4 ? PriceSetAssignmentPurchaseTypes.GIFT : r0 ? PriceSetAssignmentPurchaseTypes.PREMIUM_TIER_1 : PriceSetAssignmentPurchaseTypes.DEFAULT; experimentalGetPriceBinding = experimentalGetPrice; object2 = {paymentSourceId: paymentSourceId, purchaseType: r9, currency: currency}; value9 = experimentalGetPriceBinding(a0, object2); if (value9 == null) { error = new global.Error("Couldn't find price"); if (r2) { value = require(3817) /* metro dependency 3817: BillingUtils */; captureBillingException = value.captureBillingException; object2 = {}; object2.extra = {paymentSourceId: paymentSourceId}; object6 = {}; object6.purchaseType = r9.toString(); object6.planId = a0; object6.currency = currency ?? 'unknown'; object2.tags = object6; Reflect.apply(captureBillingException, value, [error, object2]); } throw error; } return value9; } error = new global.Error('Plan not found'); if (r2) { value = require(3817) /* metro dependency 3817: BillingUtils */; captureBillingException = value.captureBillingException; object2 = {}; value7 = currency != null; object2.tags = {planId: a0, currency: value7 ? currency : 'unknown'}; object4 = {}; copyDataProperties(object4, r14, value7); object4['isGift'] = r4; object2.extra = object4; Reflect.apply(captureBillingException, value, [error, object2]); } throw error; } const property = contextPlanPrices[a0]; const r1 = currency != null && property != null && property.currency !== currency; if (property == null) { if (SubscriptionPlanStore.get(a0) != null) { r9 = r4 ? PriceSetAssignmentPurchaseTypes.GIFT : r0 ? PriceSetAssignmentPurchaseTypes.PREMIUM_TIER_1 : PriceSetAssignmentPurchaseTypes.DEFAULT; experimentalGetPriceBinding = experimentalGetPrice; object2 = {paymentSourceId: paymentSourceId, purchaseType: r9, currency: currency}; value9 = experimentalGetPriceBinding(a0, object2); if (value9 == null) { error = new global.Error("Couldn't find price"); if (r2) { value = require(3817) /* metro dependency 3817: BillingUtils */; captureBillingException = value.captureBillingException; object2 = {}; object2.extra = {paymentSourceId: paymentSourceId}; object6 = {}; object6.purchaseType = r9.toString(); object6.planId = a0; object6.currency = currency ?? 'unknown'; object2.tags = object6; Reflect.apply(captureBillingException, value, [error, object2]); } throw error; } return value9; } error = new global.Error('Plan not found'); if (r2) { value = require(3817) /* metro dependency 3817: BillingUtils */; captureBillingException = value.captureBillingException; object2 = {}; value7 = currency != null; object2.tags = {planId: a0, currency: value7 ? currency : 'unknown'}; object4 = {}; copyDataProperties(object4, r14, value7); object4['isGift'] = r4; object2.extra = object4; Reflect.apply(captureBillingException, value, [error, object2]); } throw error; } if (r1) { if (SubscriptionPlanStore.get(a0) != null) { r9 = r4 ? PriceSetAssignmentPurchaseTypes.GIFT : r0 ? PriceSetAssignmentPurchaseTypes.PREMIUM_TIER_1 : PriceSetAssignmentPurchaseTypes.DEFAULT; experimentalGetPriceBinding = experimentalGetPrice; object2 = {paymentSourceId: paymentSourceId, purchaseType: r9, currency: currency}; value9 = experimentalGetPriceBinding(a0, object2); if (value9 == null) { error = new global.Error("Couldn't find price"); if (r2) { value = require(3817) /* metro dependency 3817: BillingUtils */; captureBillingException = value.captureBillingException; object2 = {}; object2.extra = {paymentSourceId: paymentSourceId}; object6 = {}; object6.purchaseType = r9.toString(); object6.planId = a0; object6.currency = currency ?? 'unknown'; object2.tags = object6; Reflect.apply(captureBillingException, value, [error, object2]); } throw error; } return value9; } error = new global.Error('Plan not found'); if (r2) { value = require(3817) /* metro dependency 3817: BillingUtils */; captureBillingException = value.captureBillingException; object2 = {}; value7 = currency != null; object2.tags = {planId: a0, currency: value7 ? currency : 'unknown'}; object4 = {}; copyDataProperties(object4, r14, value7); object4['isGift'] = r4; object2.extra = object4; Reflect.apply(captureBillingException, value, [error, object2]); } throw error; } return {amount: property.amount, currency: property.currency, exponent: property.exponent, tax: 0, taxInclusive: false}; } function getPurchaseTypePrices(a0, a1) { // fn#29040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:4336, offset: 0x00fb5f2e, size: 354 bytes, params: 3, frame: 21 var binding; var info; var JSON; var stringify; var Object; var Error; var error; var captureBillingException; var object; var value; const value2 = SubscriptionPlanStore.get(a0); if (value2 == null) { error = new global.Error('Plan not found'); value = require(3817) /* metro dependency 3817: BillingUtils */; captureBillingException = value.captureBillingException; object = {planId: a0}; object.purchaseType = a1.toString(); Reflect.apply(captureBillingException, value, [error, {tags: object}]); throw error; } if (value2.prices == null) { Error = global.Error; value = 'No prices returned for ' + a0 + ', is your user in the experiment?'; throw new Error(); } const property = value2.prices[a1]; if (property == null) { binding = env0_53; info = binding.info; JSON = global.JSON; stringify = JSON.stringify; Object = global.Object; value = Reflect.apply(stringify, JSON, [Object.keys(value2.prices)]); Reflect.apply(info, binding, ['Purchase types: ' + value]); Error = global.Error; value = 'No prices returned for purchase type ' + a1 + ' for plan ' + a0; throw new Error(); } return property; } function experimentalGetPrices(a0) { // fn#29041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:4801, offset: 0x00fb6090, size: 507 bytes, params: 2, frame: 25 var object2; var binding; var info; var JSON; var stringify; var Object; var error; var moduleValue; var captureBillingException; var object4; var countryPrices; let value = a1; const r0 = value !== undefined ? value : {purchaseType: PriceSetAssignmentPurchaseTypes.DEFAULT}; const paymentSourceId = r0.paymentSourceId; const purchaseType = r0.purchaseType; const purchaseTypePrices = getPurchaseTypePrices(a0, purchaseType); if (paymentSourceId == null) { countryPrices = purchaseTypePrices.countryPrices; if (countryPrices.prices == null) { binding = env0_53; info = binding.info; JSON = global.JSON; stringify = JSON.stringify; countryPrices = purchaseTypePrices.countryPrices; Reflect.apply(info, binding, ['countryPrices: ' + Reflect.apply(stringify, JSON, [countryPrices])]); error = new global.Error('Missing prices for country'); value = require(3817) /* metro dependency 3817: BillingUtils */; captureBillingException = value.captureBillingException; countryPrices = purchaseTypePrices.countryPrices; Reflect.apply(captureBillingException, value, [error, {tags: {countryCode: countryPrices.countryCode, planId: a0}}]); throw error; } countryPrices = purchaseTypePrices.countryPrices; return countryPrices.prices; } const property = purchaseTypePrices.paymentSourcePrices[paymentSourceId]; if (property == null) { binding = env0_53; info = binding.info; JSON = global.JSON; stringify = JSON.stringify; Object = global.Object; Reflect.apply(info, binding, ['Payment sources IDs: ' + Reflect.apply(stringify, JSON, [Object.keys(purchaseTypePrices.paymentSourcePrices)])]); binding = env0_53; binding.info('prices: ' + property); error = new global.Error('Missing prices for payment source on subscription plan'); moduleValue = require(3817) /* metro dependency 3817: BillingUtils */; captureBillingException = moduleValue.captureBillingException; object2 = {}; object2.extra = {paymentSourceId: paymentSourceId}; object4 = {}; object4.purchaseType = purchaseType.toString(); object4.planId = a0; object2.tags = object4; Reflect.apply(captureBillingException, moduleValue, [error, object2]); countryPrices = purchaseTypePrices.countryPrices; if (countryPrices.prices == null) { binding = env0_53; info = binding.info; JSON = global.JSON; stringify = JSON.stringify; countryPrices = purchaseTypePrices.countryPrices; Reflect.apply(info, binding, ['countryPrices: ' + Reflect.apply(stringify, JSON, [countryPrices])]); error = new global.Error('Missing prices for country'); value = require(3817) /* metro dependency 3817: BillingUtils */; captureBillingException = value.captureBillingException; countryPrices = purchaseTypePrices.countryPrices; Reflect.apply(captureBillingException, value, [error, {tags: {countryCode: countryPrices.countryCode, planId: a0}}]); throw error; } countryPrices = purchaseTypePrices.countryPrices; return countryPrices.prices; } if (property.length === 0) { countryPrices = purchaseTypePrices.countryPrices; if (countryPrices.prices == null) { binding = env0_53; info = binding.info; JSON = global.JSON; stringify = JSON.stringify; countryPrices = purchaseTypePrices.countryPrices; Reflect.apply(info, binding, ['countryPrices: ' + Reflect.apply(stringify, JSON, [countryPrices])]); error = new global.Error('Missing prices for country'); value = require(3817) /* metro dependency 3817: BillingUtils */; captureBillingException = value.captureBillingException; countryPrices = purchaseTypePrices.countryPrices; Reflect.apply(captureBillingException, value, [error, {tags: {countryCode: countryPrices.countryCode, planId: a0}}]); throw error; } countryPrices = purchaseTypePrices.countryPrices; return countryPrices.prices; } return property; } function experimentalGetPrice(a0) { // fn#29042, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:5577, offset: 0x00fb628b, size: 232 bytes, params: 2, frame: 27 var r1; var value4; let value = a1; const value2 = undefined; let r0 = value !== value2 ? value : {purchaseType: PriceSetAssignmentPurchaseTypes.DEFAULT}; const paymentSourceId = r0.paymentSourceId; const purchaseType = r0.purchaseType; const currency = r0.currency; const value3 = experimentalGetPrices(a0, {paymentSourceId: paymentSourceId, purchaseType: purchaseType}); if (value3.length === 0) { env0_53.warn('No prices found for planId: ' + a0 + ', paymentSourceId: ' + paymentSourceId + ', purchaseType: ' + purchaseType); } if (currency != null) { value4 = value3.find(function({currency}) { return currency === currency.toLowerCase(); }); if (value4 != null) { r0 = value4; } else { if (paymentSourceId != null) { value = experimentalGetPrices(a0, {purchaseType: purchaseType}); value = value.find(_fun29044); r1 = value; } else { r1 = value2; } r0 = r1; } return r0; } return value3[0]; } function getItemPlansTotalServerPrice(a0, a1, a2) { // fn#29046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:6140, offset: 0x00fb63bb, size: 383 bytes, params: 4, frame: 27 var premiumType; var r4; var r11; var r14; var r12; var planId; var value6; var has; var value7; var value8; var getPriceBinding; var priceBinding; var getDefaultPriceBinding; var defaultPriceBinding; var amount; var amount2; var quantity; var value11; const object2 = {'currency': null, 'amount': 0, 'tax': 0, 'taxInclusive': false}; object2.currency = a1; const value2 = undefined; const baseSubscriptionItemForSubscriptionItems = (require(3814) /* metro dependency 3814: PremiumSubscription */).getBaseSubscriptionItemForSubscriptionItems(a0); if (baseSubscriptionItemForSubscriptionItems != null) { planId = baseSubscriptionItemForSubscriptionItems.planId; premiumType = SubscriptionPlanInfo[planId].premiumType; } else { premiumType = value2; } const premiumTypeUtilsModule = require(1900) /* metro dependency 1900: PremiumTypeUtils */; let isPremiumAtLeast = premiumTypeUtilsModule.isPremiumAtLeast; const TIER_0 = PremiumTypes.TIER_0; const isPremiumAtLeast2 = Reflect.apply(isPremiumAtLeast, premiumTypeUtilsModule, [premiumType, TIER_0]); const moduleValue3 = premiumTypeUtilsModule; isPremiumAtLeast = moduleValue3.isPremiumAtLeast; const TIER_2 = PremiumTypes.TIER_2; const isPremiumAtLeast3 = Reflect.apply(isPremiumAtLeast, moduleValue3, [premiumType, TIER_2]); const value4 = _createForOfIteratorHelperLoose_29031(a0); const value5 = value4(); let done = value5.done; if (!done) { r4 = value5; while (true) { value6 = r4.value; has = PREMIUM_GUILD_SUBSCRIPTION_PLANS.has; planId = value6.planId; if (Reflect.apply(has, PREMIUM_GUILD_SUBSCRIPTION_PLANS, [planId])) { r14 = isPremiumAtLeast3; } else { value7 = PREMIUM_PLANS.has(value6.planId); value8 = !value7; if (value7) { r11 = value8; continue; } r11 = isPremiumAtLeast2; continue; r14 = r11; } if (value2 === a2) { getDefaultPriceBinding = getDefaultPrice; planId = value6.planId; defaultPriceBinding = getDefaultPriceBinding(planId, r14, false, a1); r12 = defaultPriceBinding; } else { getPriceBinding = getPrice; planId = value6.planId; priceBinding = getPriceBinding(planId, r14, false, {paymentSourceId: a2, currency: a1}); r12 = priceBinding; } amount = object2.amount; amount2 = r12.amount; quantity = value6.quantity; object2.amount = amount + amount2 * quantity; value11 = value4(); done = value11.done; if (done) { break; } r4 = value11; continue; } } return getServerPriceFromClientPrice(object2); } function getInterval(a0) { // fn#29047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:6718, offset: 0x00fb653a, size: 130 bytes, params: 2, frame: 16 const property = SubscriptionPlanInfo[a0]; if (property != null) { return {intervalType: property.interval, intervalCount: property.intervalCount}; } const Error = global.Error; const error = new Error('Unsupported plan'); (require(3817) /* metro dependency 3817: BillingUtils */).captureBillingException(error, {tags: {planId: a0}}); throw error; } function getIntervalString(a0, a1, a2) { // fn#29048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:6925, offset: 0x00fb65bc, size: 839 bytes, params: 4, frame: 22 const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; const t = (require(1244) /* metro dependency 1244: indexNative */).t; var formatToPlainString; const intl2 = (require(1244) /* metro dependency 1244: indexNative */).intl; const intl3 = (require(1244) /* metro dependency 1244: indexNative */).intl; const value = a3; const value2 = a4; const value3 = a5; const r9 = value !== undefined ? value : 1; const r2 = value2 !== undefined ? value2 : false; let r3 = value3 !== undefined ? value3 : PremiumTypes.TIER_2; if (a1) { if (SubscriptionIntervalTypes.MONTH === a0) { formatToPlainString = intl.formatToPlainString; r3 = r3 === PremiumTypes.TIER_0 ? t.NPKsLz : t.poEovT; return r2 ? Reflect.apply(formatToPlainString, intl, [r3, {timeInterval: intl3.string(t.FPybU7)}]) : intl.string(t.Mh9bTt); } if (SubscriptionIntervalTypes.YEAR === a0) { return r2 ? intl.formatToPlainString(r3 === PremiumTypes.TIER_0 ? t.NPKsLz : t.poEovT, {timeInterval: intl2.string(t.tfqrhj)}) : intl.string(t.DRgqMo); } throw new global.Error('Unexpected interval'); } if (a2) { if (SubscriptionIntervalTypes.MONTH === a0) { formatToPlainString = intl.formatToPlainString; r3 = r3 === PremiumTypes.TIER_0 ? t.NPKsLz : t.poEovT; return r2 ? Reflect.apply(formatToPlainString, intl, [r3, {timeInterval: intl3.string(t.FPybU7)}]) : intl.string(t.Mh9bTt); } if (SubscriptionIntervalTypes.YEAR === a0) { return r2 ? intl.formatToPlainString(r3 === PremiumTypes.TIER_0 ? t.NPKsLz : t.poEovT, {timeInterval: intl2.string(t.tfqrhj)}) : intl.string(t.DRgqMo); } throw new global.Error('Unexpected interval'); } const MONTH = SubscriptionIntervalTypes.MONTH; if (MONTH === a0) { return r9 !== 1 ? intl.formatToPlainString(t['0UlZnH'], {intervalCount: r9}) : intl.string(t.DKzs96); } const YEAR = SubscriptionIntervalTypes.YEAR; if (YEAR === a0) { return intl.string(t['/Q4HRN']); } const Error = global.Error; throw new Error('Unexpected interval'); } function getIntervalStringAsNoun(a0) { // fn#29049, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:7741, offset: 0x00fb6903, size: 188 bytes, params: 2, frame: 15 const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; const t = (require(1244) /* metro dependency 1244: indexNative */).t; const MONTH = SubscriptionIntervalTypes.MONTH; if (MONTH === a0) { return intl.string(t.FPybU7); } const YEAR = SubscriptionIntervalTypes.YEAR; if (YEAR === a0) { return intl.string(t.tfqrhj); } const Error = global.Error; throw new Error('Unexpected interval'); } function getPremiumType(a0) { // fn#29050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:7958, offset: 0x00fb69bf, size: 112 bytes, params: 2, frame: 16 const property = SubscriptionPlanInfo[a0]; if (property != null) { return property.premiumType; } const Error = global.Error; const error = new Error('Unsupported plan'); (require(3817) /* metro dependency 3817: BillingUtils */).captureBillingException(error, {tags: {planId: a0}}); throw error; } function getDisplayName_29051(a0) { // fn#29051, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:8127, offset: 0x00fb6a2f, size: 1619 bytes, params: 2, frame: 22 var r2; var object2; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; var string; const t = (require(1244) /* metro dependency 1244: indexNative */).t; var property; var formatToPlainString; const value = a1; const value2 = a2; const r3 = value !== undefined ? value : false; let r0 = value2 !== undefined ? value2 : false; const PREMIUM_MONTH_TIER_0 = SubscriptionPlans.PREMIUM_MONTH_TIER_0; if (PREMIUM_MONTH_TIER_0 === a0) { r0 = r3 ? intl.format(t.TZXHNj, {duration: a3}) : r0 ? intl.string(t['81iAgs']) : intl.string(t['0efVPy']); return r0; } const PREMIUM_YEAR_TIER_0 = SubscriptionPlans.PREMIUM_YEAR_TIER_0; if (PREMIUM_YEAR_TIER_0 === a0) { return r3 ? intl.format(t.eqRhC7, {duration: a3}) : r0 ? intl.string(t.UvzqY1) : intl.string(t.eoVuBn); } const PREMIUM_MONTH_TIER_1 = SubscriptionPlans.PREMIUM_MONTH_TIER_1; if (PREMIUM_MONTH_TIER_1 === a0) { string = intl.string; return r0 ? Reflect.apply(string, intl, [t['g/dH5g']]) : Reflect.apply(string, intl, [t['7O6qSq']]); } const PREMIUM_YEAR_TIER_1 = SubscriptionPlans.PREMIUM_YEAR_TIER_1; if (PREMIUM_YEAR_TIER_1 === a0) { string = intl.string; return r0 ? Reflect.apply(string, intl, [t.pdZJaq]) : Reflect.apply(string, intl, [t.Md5xbi]); } const PREMIUM_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_MONTH_TIER_2; if (PREMIUM_MONTH_TIER_2 === a0) { return r3 ? intl.format(t.aI6QXz, {duration: a3}) : r0 ? intl.string(t.SmVbHc) : intl.string(t.FKYNC6); } const PREMIUM_GROUP_MONTH = SubscriptionPlans.PREMIUM_GROUP_MONTH; if (PREMIUM_GROUP_MONTH === a0) { if (r0) { r2 = intl.string(t.SmVbHc); } else { formatToPlainString = intl.formatToPlainString; property = (importDefault(2806) /* metro dependency 2806: PremiumGroupMessages */)['8bPDtb']; object2 = {}; object2.premiumGroupProductName = getPremiumGroupProductName(); r2 = Reflect.apply(formatToPlainString, intl, [property, object2]); } return r2; } const PREMIUM_YEAR_TIER_2 = SubscriptionPlans.PREMIUM_YEAR_TIER_2; if (PREMIUM_YEAR_TIER_2 === a0) { return r3 ? intl.format(t['1wBcPi'], {duration: a3}) : r0 ? intl.string(t.JIq4O1) : intl.string(t['cfu/5d']); } const PREMIUM_3_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_3_MONTH_TIER_2; if (PREMIUM_3_MONTH_TIER_2 === a0) { return intl.string(t.wCbINr); } const PREMIUM_6_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_6_MONTH_TIER_2; if (PREMIUM_6_MONTH_TIER_2 === a0) { return intl.string(t['e3/ArU']); } const PREMIUM_MONTH_GUILD = SubscriptionPlans.PREMIUM_MONTH_GUILD; if (PREMIUM_MONTH_GUILD === a0) { string = intl.string; return r0 ? Reflect.apply(string, intl, [t['6ZR3By']]) : Reflect.apply(string, intl, [t['h80cx/']]); } const PREMIUM_YEAR_GUILD = SubscriptionPlans.PREMIUM_YEAR_GUILD; if (PREMIUM_YEAR_GUILD === a0) { string = intl.string; return r0 ? Reflect.apply(string, intl, [t.YDpAzZ]) : Reflect.apply(string, intl, [t.ZHkls0]); } const PREMIUM_3_MONTH_GUILD = SubscriptionPlans.PREMIUM_3_MONTH_GUILD; if (PREMIUM_3_MONTH_GUILD === a0) { return intl.string(t.EZHHB6); } const PREMIUM_6_MONTH_GUILD = SubscriptionPlans.PREMIUM_6_MONTH_GUILD; if (PREMIUM_6_MONTH_GUILD === a0) { return intl.string(t.X2KDO2); } const PREMIUM_MONTH_LEGACY = SubscriptionPlans.PREMIUM_MONTH_LEGACY; if (PREMIUM_MONTH_LEGACY === a0) { return intl.string(t.PD6k79); } const PREMIUM_YEAR_LEGACY = SubscriptionPlans.PREMIUM_YEAR_LEGACY; if (PREMIUM_YEAR_LEGACY === a0) { return intl.string(t.LtJgTC); } const Error = global.Error; const error = new Error('Unsupported plan'); (require(3817) /* metro dependency 3817: BillingUtils */).captureBillingException(error, {tags: {planId: a0}}); throw error; } function getTierDisplayNameByPlanId(a0) { // fn#29052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:10122, offset: 0x00fb7082, size: 173 bytes, params: 2, frame: 18 const property = SubscriptionPlanInfo[a0]; const value2 = null; const premiumType = value2 == property ? undefined : property.premiumType; const r2 = value2 != premiumType ? PREMIUM_TYPE_DISPLAY_NAME[premiumType] : value2; if (value2 != r2) { return (require(1244) /* metro dependency 1244: indexNative */).intl.string(r2); } const Error = global.Error; const error = new Error('Unsupported plan'); (require(3817) /* metro dependency 3817: BillingUtils */).captureBillingException(error, {tags: {planId: a0}}); throw error; } function getPlanDescription({subscription, planId, price, includePremiumGuilds, hasDiscountApplied, activeDiscountInfo, renewalInvoiceWithoutEntitlementsPreview, renewalInvoiceWithEntitlementsPreview, hasFractionalPremiumWithSub, fractionalPremiumInfo}) { // fn#29053, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:10367, offset: 0x00fb712f, size: 3886 bytes, params: 2, frame: 35 var r0; var r8; var r13; var r23; var r15; var r18; var r17; var currentUser; const t = (require(1244) /* metro dependency 1244: indexNative */).t; var object2; var formatToPlainString; var z2oQtA; var moduleValue; var value34; var moduleValue2; var value36; var moduleValue3; var value38; let property = SubscriptionPlanInfo[planId]; const value4 = formatPriceString(getDefaultPrice(property.id), property.interval); let r4 = renewalInvoiceWithEntitlementsPreview != null && renewalInvoiceWithEntitlementsPreview.subtotal === 0; const isBaseSubscriptionCanceled2 = isBaseSubscriptionCanceled(subscription); if (isBaseSubscriptionCanceled2) { r8 = isBaseSubscriptionCanceled2; } else { r0 = subscription.paymentSourceId == null && !subscription.isPurchasedExternally; if (r0) { currentUser = UserStore.getCurrentUser(); r0 = !(currentUser != null && currentUser.hasFreePremium()); } r0 = r0 && !r4; r8 = r0; } r0 = price != null && subscription.paymentGateway == null; const status = subscription.status; const UNPAID = SubscriptionStatusTypes.UNPAID; const r10 = r8 ? SubscriptionStatusTypes.CANCELED : status === UNPAID && subscription.latestInvoice !== null && subscription.latestInvoice?.status === InvoiceStatusTypes.OPEN ? SubscriptionStatusTypes.UNPAID : subscription.status; r4 = renewalInvoiceWithoutEntitlementsPreview?.taxInclusive ?? subscription.latestInvoice?.taxInclusive; const r1 = r4 == null || r4; const value22 = NUM_FREE_GUILD_BOOSTS_WITH_PREMIUM + (includePremiumGuilds ? getNumPremiumGuildSubscriptions(subscription.additionalPlans) : 0); const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; r4 = r0 ? r1 ? intl.format(t['cd+hqB'], {price: price}) : intl.format(t.NUkcpF, {price: price}) : intl.string(t.zYx3Y6); let r9 = r0 ? r1 ? intl.format(t.VsKcFB, {price: price}) : intl.format(t.hJ5xEX, {price: price}) : intl.string(t['8rSipI']); let format = intl.format; let r11 = r0 ? r1 ? Reflect.apply(format, intl, [t['jRy6/J'], {price: price, num: value22}]) : Reflect.apply(format, intl, [t.tTNE8M, {price: price, num: value22}]) : Reflect.apply(format, intl, [t['U+z/HJ'], {num: value22}]); const PREMIUM_MONTH_TIER_0 = SubscriptionPlans.PREMIUM_MONTH_TIER_0; if (PREMIUM_MONTH_TIER_0 === planId) { if (SubscriptionStatusTypes.CANCELED === r10) { r0 = r0 ? r1 ? intl.format(t['USi/nc'], {price: price}) : intl.format(t['FS//l2'], {price: price}) : intl.string(t.JshLzq); return r0; } if (SubscriptionStatusTypes.ACCOUNT_HOLD === r10) { format = intl.format; return r0 ? r1 ? Reflect.apply(format, intl, [t['5mv+2i'], {price: price}]) : Reflect.apply(format, intl, [t.nkAEfZ, {price: price}]) : Reflect.apply(format, intl, [t.SsLIXS, {}]); } if (SubscriptionStatusTypes.UNPAID === r10) { return intl.format(t.cmkbFB, {}); } if (SubscriptionStatusTypes.PAUSE_PENDING === r10) { if (subscription.pauseEndsAt != null) { value38 = (importDefault(3738) /* metro dependency 3738 */)(subscription.pauseEndsAt); r11 = value38.diff(subscription.currentPeriodEnd, 'days'); } else { r11 = null; } return r11 != null ? intl.format(t.WUfOD5, {pauseDate: subscription.currentPeriodEnd, pauseDuration: r11}) : intl.format(t.VlWufv, {pauseDate: subscription.currentPeriodEnd}); } if (SubscriptionStatusTypes.PAUSED === r10) { r4 = !hasFractionalPremiumWithSub ? intl.format(t['6RTdZA'], {resumeDate: subscription.pauseEndsAt}) : r4; return r4; } if (SubscriptionStatusTypes.PAST_DUE === r10) { format = intl.format; property = t['d+0vwo']; object2 = {}; moduleValue3 = require(3826) /* metro dependency 3826: DateUtils */; object2.endDate = moduleValue3.dateFormat(getBillingGracePeriodDaysAndExpiresDate(subscription).expiresDate, 'LL'); object2.onClick = onClick_29054; return Reflect.apply(format, intl, [property, object2]); } return r4; } const PREMIUM_YEAR_TIER_0 = SubscriptionPlans.PREMIUM_YEAR_TIER_0; if (PREMIUM_YEAR_TIER_0 === planId) { if (SubscriptionStatusTypes.CANCELED === r10) { r0 = r0 ? r1 ? intl.format(t['USi/nc'], {price: price}) : intl.format(t['FS//l2'], {price: price}) : intl.string(t.JshLzq); return r0; } if (SubscriptionStatusTypes.ACCOUNT_HOLD === r10) { format = intl.format; return r0 ? r1 ? Reflect.apply(format, intl, [t['5mv+2i'], {price: price}]) : Reflect.apply(format, intl, [t.nkAEfZ, {price: price}]) : Reflect.apply(format, intl, [t.SsLIXS, {}]); } if (SubscriptionStatusTypes.UNPAID === r10) { return intl.format(t.cmkbFB, {}); } if (SubscriptionStatusTypes.PAUSE_PENDING === r10) { if (subscription.pauseEndsAt != null) { value38 = (importDefault(3738) /* metro dependency 3738 */)(subscription.pauseEndsAt); r11 = value38.diff(subscription.currentPeriodEnd, 'days'); } else { r11 = null; } return r11 != null ? intl.format(t.WUfOD5, {pauseDate: subscription.currentPeriodEnd, pauseDuration: r11}) : intl.format(t.VlWufv, {pauseDate: subscription.currentPeriodEnd}); } if (SubscriptionStatusTypes.PAUSED === r10) { r4 = !hasFractionalPremiumWithSub ? intl.format(t['6RTdZA'], {resumeDate: subscription.pauseEndsAt}) : r4; return r4; } if (SubscriptionStatusTypes.PAST_DUE === r10) { format = intl.format; property = t['d+0vwo']; object2 = {}; moduleValue3 = require(3826) /* metro dependency 3826: DateUtils */; object2.endDate = moduleValue3.dateFormat(getBillingGracePeriodDaysAndExpiresDate(subscription).expiresDate, 'LL'); object2.onClick = onClick_29054; return Reflect.apply(format, intl, [property, object2]); } return r4; } const PREMIUM_MONTH_TIER_1 = SubscriptionPlans.PREMIUM_MONTH_TIER_1; if (PREMIUM_MONTH_TIER_1 === planId) { if (SubscriptionStatusTypes.CANCELED === r10) { return r0 ? r1 ? intl.format(t.cXy8Bp, {price: price}) : intl.format(t['C/XsHt'], {price: price}) : intl.string(t.K6tYFa); } if (SubscriptionStatusTypes.ACCOUNT_HOLD === r10) { format = intl.format; return r0 ? r1 ? Reflect.apply(format, intl, [t.HBkIBi, {price: price}]) : Reflect.apply(format, intl, [t.ZsO1Sx, {price: price}]) : Reflect.apply(format, intl, [t['0+/WH7'], {}]); } if (SubscriptionStatusTypes.UNPAID === r10) { return intl.format(t.McIzwj, {}); } if (SubscriptionStatusTypes.PAUSE_PENDING === r10) { if (subscription.pauseEndsAt != null) { value36 = (importDefault(3738) /* metro dependency 3738 */)(subscription.pauseEndsAt); r17 = value36.diff(subscription.currentPeriodEnd, 'days'); } else { r17 = null; } return r17 != null ? intl.format(t.WUfOD5, {pauseDate: subscription.currentPeriodEnd, pauseDuration: r17}) : intl.format(t.VlWufv, {pauseDate: subscription.currentPeriodEnd}); } if (SubscriptionStatusTypes.PAUSED === r10) { r9 = !hasFractionalPremiumWithSub ? intl.format(t['6RTdZA'], {resumeDate: subscription.pauseEndsAt}) : r9; return r9; } if (SubscriptionStatusTypes.PAST_DUE === r10) { format = intl.format; property = t['d+0vwo']; object2 = {}; moduleValue2 = require(3826) /* metro dependency 3826: DateUtils */; object2.endDate = moduleValue2.dateFormat(getBillingGracePeriodDaysAndExpiresDate(subscription).expiresDate, 'LL'); object2.onClick = onClick_29055; return Reflect.apply(format, intl, [property, object2]); } return r9; } const PREMIUM_YEAR_TIER_1 = SubscriptionPlans.PREMIUM_YEAR_TIER_1; if (PREMIUM_YEAR_TIER_1 === planId) { if (SubscriptionStatusTypes.CANCELED === r10) { return r0 ? r1 ? intl.format(t.cXy8Bp, {price: price}) : intl.format(t['C/XsHt'], {price: price}) : intl.string(t.K6tYFa); } if (SubscriptionStatusTypes.ACCOUNT_HOLD === r10) { format = intl.format; return r0 ? r1 ? Reflect.apply(format, intl, [t.HBkIBi, {price: price}]) : Reflect.apply(format, intl, [t.ZsO1Sx, {price: price}]) : Reflect.apply(format, intl, [t['0+/WH7'], {}]); } if (SubscriptionStatusTypes.UNPAID === r10) { return intl.format(t.McIzwj, {}); } if (SubscriptionStatusTypes.PAUSE_PENDING === r10) { if (subscription.pauseEndsAt != null) { value36 = (importDefault(3738) /* metro dependency 3738 */)(subscription.pauseEndsAt); r17 = value36.diff(subscription.currentPeriodEnd, 'days'); } else { r17 = null; } return r17 != null ? intl.format(t.WUfOD5, {pauseDate: subscription.currentPeriodEnd, pauseDuration: r17}) : intl.format(t.VlWufv, {pauseDate: subscription.currentPeriodEnd}); } if (SubscriptionStatusTypes.PAUSED === r10) { r9 = !hasFractionalPremiumWithSub ? intl.format(t['6RTdZA'], {resumeDate: subscription.pauseEndsAt}) : r9; return r9; } if (SubscriptionStatusTypes.PAST_DUE === r10) { format = intl.format; property = t['d+0vwo']; object2 = {}; moduleValue2 = require(3826) /* metro dependency 3826: DateUtils */; object2.endDate = moduleValue2.dateFormat(getBillingGracePeriodDaysAndExpiresDate(subscription).expiresDate, 'LL'); object2.onClick = onClick_29055; return Reflect.apply(format, intl, [property, object2]); } return r9; } const PREMIUM_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_MONTH_TIER_2; if (PREMIUM_MONTH_TIER_2 === planId) { if (SubscriptionStatusTypes.CANCELED === r10) { format = intl.format; return r0 ? r1 ? Reflect.apply(format, intl, [t.xoFgRh, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.nXdbKo, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.EcSdRH, {num: value22}]); } if (SubscriptionStatusTypes.ACCOUNT_HOLD === r10) { format = intl.format; return r0 ? r1 ? Reflect.apply(format, intl, [t['5C/0QG'], {price: price, num: value22}]) : Reflect.apply(format, intl, [t.xfYkhu, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.ivjxcn, {num: value22}]); } if (SubscriptionStatusTypes.UNPAID === r10) { return intl.format(t['0HopYf'], {num: value22}); } if (SubscriptionStatusTypes.PAUSE_PENDING === r10) { if (subscription.pauseEndsAt != null) { value34 = (importDefault(3738) /* metro dependency 3738 */)(subscription.pauseEndsAt); r18 = value34.diff(subscription.currentPeriodEnd, 'days'); } else { r18 = null; } return r18 != null ? intl.format(t.WUfOD5, {pauseDate: subscription.currentPeriodEnd, pauseDuration: r18}) : intl.format(t.VlWufv, {pauseDate: subscription.currentPeriodEnd}); } if (SubscriptionStatusTypes.PAUSED === r10) { r11 = !hasFractionalPremiumWithSub ? intl.format(t['6RTdZA'], {resumeDate: subscription.pauseEndsAt}) : r11; return r11; } if (SubscriptionStatusTypes.BILLING_RETRY === r10) { format = intl.format; property = t['IlJ/HV']; object2 = {}; object2.endDate = (importDefault(3738) /* metro dependency 3738 */)(subscription.currentPeriodStart).add(PAID_SUBSCRIPTION_MAX_BILLING_RETRY_DAYS, 'days').toDate(); return Reflect.apply(format, intl, [property, object2]); } if (SubscriptionStatusTypes.PAST_DUE === r10) { format = intl.format; property = t['d+0vwo']; object2 = {}; moduleValue = require(3826) /* metro dependency 3826: DateUtils */; object2.endDate = moduleValue.dateFormat(getBillingGracePeriodDaysAndExpiresDate(subscription).expiresDate, 'LL'); object2.onClick = onClick_29056; return Reflect.apply(format, intl, [property, object2]); } if (hasDiscountApplied) { if (planId === SubscriptionPlans.PREMIUM_YEAR_TIER_2) { format = intl.format; z2oQtA = t.z2oQtA; object2 = {}; object2.percent = activeDiscountInfo?.percentage ?? ANNUAL_DISCOUNT_PERCENTAGE_FALLBACK; object2.regularPrice = value4; object2.renewalDate = getExpectedRenewalDate(subscription, fractionalPremiumInfo); r15 = Reflect.apply(format, intl, [z2oQtA, object2]); } else { formatToPlainString = intl.formatToPlainString; if (r1) { property = t['3ZiutU']; object2 = {}; r23 = activeDiscountInfo?.percentage ?? DISCOUNT_PERCENTAGE_FALLBACK; object2.percent = r23; object2.regularPrice = value4; r23 = activeDiscountInfo?.duration ?? DISCOUNT_DURATION_FALLBACK; object2.numMonths = r23; r15 = Reflect.apply(formatToPlainString, intl, [property, object2]); } else { property = t['G6+XOT']; object2 = {}; r23 = activeDiscountInfo?.percentage ?? DISCOUNT_PERCENTAGE_FALLBACK; object2.percent = r23; object2.regularPrice = value4; r23 = activeDiscountInfo?.duration ?? DISCOUNT_DURATION_FALLBACK; object2.numMonths = r23; r15 = Reflect.apply(formatToPlainString, intl, [property, object2]); } } r13 = r15; } else { r13 = r11; } return r13; } const PREMIUM_YEAR_TIER_2 = SubscriptionPlans.PREMIUM_YEAR_TIER_2; if (PREMIUM_YEAR_TIER_2 === planId) { if (SubscriptionStatusTypes.CANCELED === r10) { format = intl.format; return r0 ? r1 ? Reflect.apply(format, intl, [t.xoFgRh, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.nXdbKo, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.EcSdRH, {num: value22}]); } if (SubscriptionStatusTypes.ACCOUNT_HOLD === r10) { format = intl.format; return r0 ? r1 ? Reflect.apply(format, intl, [t['5C/0QG'], {price: price, num: value22}]) : Reflect.apply(format, intl, [t.xfYkhu, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.ivjxcn, {num: value22}]); } if (SubscriptionStatusTypes.UNPAID === r10) { return intl.format(t['0HopYf'], {num: value22}); } if (SubscriptionStatusTypes.PAUSE_PENDING === r10) { if (subscription.pauseEndsAt != null) { value34 = (importDefault(3738) /* metro dependency 3738 */)(subscription.pauseEndsAt); r18 = value34.diff(subscription.currentPeriodEnd, 'days'); } else { r18 = null; } return r18 != null ? intl.format(t.WUfOD5, {pauseDate: subscription.currentPeriodEnd, pauseDuration: r18}) : intl.format(t.VlWufv, {pauseDate: subscription.currentPeriodEnd}); } if (SubscriptionStatusTypes.PAUSED === r10) { r11 = !hasFractionalPremiumWithSub ? intl.format(t['6RTdZA'], {resumeDate: subscription.pauseEndsAt}) : r11; return r11; } if (SubscriptionStatusTypes.BILLING_RETRY === r10) { format = intl.format; property = t['IlJ/HV']; object2 = {}; object2.endDate = (importDefault(3738) /* metro dependency 3738 */)(subscription.currentPeriodStart).add(PAID_SUBSCRIPTION_MAX_BILLING_RETRY_DAYS, 'days').toDate(); return Reflect.apply(format, intl, [property, object2]); } if (SubscriptionStatusTypes.PAST_DUE === r10) { format = intl.format; property = t['d+0vwo']; object2 = {}; moduleValue = require(3826) /* metro dependency 3826: DateUtils */; object2.endDate = moduleValue.dateFormat(getBillingGracePeriodDaysAndExpiresDate(subscription).expiresDate, 'LL'); object2.onClick = onClick_29056; return Reflect.apply(format, intl, [property, object2]); } if (hasDiscountApplied) { if (planId === SubscriptionPlans.PREMIUM_YEAR_TIER_2) { format = intl.format; z2oQtA = t.z2oQtA; object2 = {}; object2.percent = activeDiscountInfo?.percentage ?? ANNUAL_DISCOUNT_PERCENTAGE_FALLBACK; object2.regularPrice = value4; object2.renewalDate = getExpectedRenewalDate(subscription, fractionalPremiumInfo); r15 = Reflect.apply(format, intl, [z2oQtA, object2]); } else { formatToPlainString = intl.formatToPlainString; if (r1) { property = t['3ZiutU']; object2 = {}; r23 = activeDiscountInfo?.percentage ?? DISCOUNT_PERCENTAGE_FALLBACK; object2.percent = r23; object2.regularPrice = value4; r23 = activeDiscountInfo?.duration ?? DISCOUNT_DURATION_FALLBACK; object2.numMonths = r23; r15 = Reflect.apply(formatToPlainString, intl, [property, object2]); } else { property = t['G6+XOT']; object2 = {}; r23 = activeDiscountInfo?.percentage ?? DISCOUNT_PERCENTAGE_FALLBACK; object2.percent = r23; object2.regularPrice = value4; r23 = activeDiscountInfo?.duration ?? DISCOUNT_DURATION_FALLBACK; object2.numMonths = r23; r15 = Reflect.apply(formatToPlainString, intl, [property, object2]); } } r13 = r15; } else { r13 = r11; } return r13; } const PREMIUM_3_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_3_MONTH_TIER_2; if (PREMIUM_3_MONTH_TIER_2 === planId) { if (SubscriptionStatusTypes.CANCELED === r10) { format = intl.format; return r0 ? r1 ? Reflect.apply(format, intl, [t.xoFgRh, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.nXdbKo, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.EcSdRH, {num: value22}]); } if (SubscriptionStatusTypes.ACCOUNT_HOLD === r10) { format = intl.format; return r0 ? r1 ? Reflect.apply(format, intl, [t['5C/0QG'], {price: price, num: value22}]) : Reflect.apply(format, intl, [t.xfYkhu, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.ivjxcn, {num: value22}]); } if (SubscriptionStatusTypes.UNPAID === r10) { return intl.format(t['0HopYf'], {num: value22}); } if (SubscriptionStatusTypes.PAUSE_PENDING === r10) { if (subscription.pauseEndsAt != null) { value34 = (importDefault(3738) /* metro dependency 3738 */)(subscription.pauseEndsAt); r18 = value34.diff(subscription.currentPeriodEnd, 'days'); } else { r18 = null; } return r18 != null ? intl.format(t.WUfOD5, {pauseDate: subscription.currentPeriodEnd, pauseDuration: r18}) : intl.format(t.VlWufv, {pauseDate: subscription.currentPeriodEnd}); } if (SubscriptionStatusTypes.PAUSED === r10) { r11 = !hasFractionalPremiumWithSub ? intl.format(t['6RTdZA'], {resumeDate: subscription.pauseEndsAt}) : r11; return r11; } if (SubscriptionStatusTypes.BILLING_RETRY === r10) { format = intl.format; property = t['IlJ/HV']; object2 = {}; object2.endDate = (importDefault(3738) /* metro dependency 3738 */)(subscription.currentPeriodStart).add(PAID_SUBSCRIPTION_MAX_BILLING_RETRY_DAYS, 'days').toDate(); return Reflect.apply(format, intl, [property, object2]); } if (SubscriptionStatusTypes.PAST_DUE === r10) { format = intl.format; property = t['d+0vwo']; object2 = {}; moduleValue = require(3826) /* metro dependency 3826: DateUtils */; object2.endDate = moduleValue.dateFormat(getBillingGracePeriodDaysAndExpiresDate(subscription).expiresDate, 'LL'); object2.onClick = onClick_29056; return Reflect.apply(format, intl, [property, object2]); } if (hasDiscountApplied) { if (planId === SubscriptionPlans.PREMIUM_YEAR_TIER_2) { format = intl.format; z2oQtA = t.z2oQtA; object2 = {}; object2.percent = activeDiscountInfo?.percentage ?? ANNUAL_DISCOUNT_PERCENTAGE_FALLBACK; object2.regularPrice = value4; object2.renewalDate = getExpectedRenewalDate(subscription, fractionalPremiumInfo); r15 = Reflect.apply(format, intl, [z2oQtA, object2]); } else { formatToPlainString = intl.formatToPlainString; if (r1) { property = t['3ZiutU']; object2 = {}; r23 = activeDiscountInfo?.percentage ?? DISCOUNT_PERCENTAGE_FALLBACK; object2.percent = r23; object2.regularPrice = value4; r23 = activeDiscountInfo?.duration ?? DISCOUNT_DURATION_FALLBACK; object2.numMonths = r23; r15 = Reflect.apply(formatToPlainString, intl, [property, object2]); } else { property = t['G6+XOT']; object2 = {}; r23 = activeDiscountInfo?.percentage ?? DISCOUNT_PERCENTAGE_FALLBACK; object2.percent = r23; object2.regularPrice = value4; r23 = activeDiscountInfo?.duration ?? DISCOUNT_DURATION_FALLBACK; object2.numMonths = r23; r15 = Reflect.apply(formatToPlainString, intl, [property, object2]); } } r13 = r15; } else { r13 = r11; } return r13; } const PREMIUM_6_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_6_MONTH_TIER_2; if (PREMIUM_6_MONTH_TIER_2 === planId) { if (SubscriptionStatusTypes.CANCELED === r10) { format = intl.format; return r0 ? r1 ? Reflect.apply(format, intl, [t.xoFgRh, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.nXdbKo, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.EcSdRH, {num: value22}]); } if (SubscriptionStatusTypes.ACCOUNT_HOLD === r10) { format = intl.format; return r0 ? r1 ? Reflect.apply(format, intl, [t['5C/0QG'], {price: price, num: value22}]) : Reflect.apply(format, intl, [t.xfYkhu, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.ivjxcn, {num: value22}]); } if (SubscriptionStatusTypes.UNPAID === r10) { return intl.format(t['0HopYf'], {num: value22}); } if (SubscriptionStatusTypes.PAUSE_PENDING === r10) { if (subscription.pauseEndsAt != null) { value34 = (importDefault(3738) /* metro dependency 3738 */)(subscription.pauseEndsAt); r18 = value34.diff(subscription.currentPeriodEnd, 'days'); } else { r18 = null; } return r18 != null ? intl.format(t.WUfOD5, {pauseDate: subscription.currentPeriodEnd, pauseDuration: r18}) : intl.format(t.VlWufv, {pauseDate: subscription.currentPeriodEnd}); } if (SubscriptionStatusTypes.PAUSED === r10) { r11 = !hasFractionalPremiumWithSub ? intl.format(t['6RTdZA'], {resumeDate: subscription.pauseEndsAt}) : r11; return r11; } if (SubscriptionStatusTypes.BILLING_RETRY === r10) { format = intl.format; property = t['IlJ/HV']; object2 = {}; object2.endDate = (importDefault(3738) /* metro dependency 3738 */)(subscription.currentPeriodStart).add(PAID_SUBSCRIPTION_MAX_BILLING_RETRY_DAYS, 'days').toDate(); return Reflect.apply(format, intl, [property, object2]); } if (SubscriptionStatusTypes.PAST_DUE === r10) { format = intl.format; property = t['d+0vwo']; object2 = {}; moduleValue = require(3826) /* metro dependency 3826: DateUtils */; object2.endDate = moduleValue.dateFormat(getBillingGracePeriodDaysAndExpiresDate(subscription).expiresDate, 'LL'); object2.onClick = onClick_29056; return Reflect.apply(format, intl, [property, object2]); } if (hasDiscountApplied) { if (planId === SubscriptionPlans.PREMIUM_YEAR_TIER_2) { format = intl.format; z2oQtA = t.z2oQtA; object2 = {}; object2.percent = activeDiscountInfo?.percentage ?? ANNUAL_DISCOUNT_PERCENTAGE_FALLBACK; object2.regularPrice = value4; object2.renewalDate = getExpectedRenewalDate(subscription, fractionalPremiumInfo); r15 = Reflect.apply(format, intl, [z2oQtA, object2]); } else { formatToPlainString = intl.formatToPlainString; if (r1) { property = t['3ZiutU']; object2 = {}; r23 = activeDiscountInfo?.percentage ?? DISCOUNT_PERCENTAGE_FALLBACK; object2.percent = r23; object2.regularPrice = value4; r23 = activeDiscountInfo?.duration ?? DISCOUNT_DURATION_FALLBACK; object2.numMonths = r23; r15 = Reflect.apply(formatToPlainString, intl, [property, object2]); } else { property = t['G6+XOT']; object2 = {}; r23 = activeDiscountInfo?.percentage ?? DISCOUNT_PERCENTAGE_FALLBACK; object2.percent = r23; object2.regularPrice = value4; r23 = activeDiscountInfo?.duration ?? DISCOUNT_DURATION_FALLBACK; object2.numMonths = r23; r15 = Reflect.apply(formatToPlainString, intl, [property, object2]); } } r13 = r15; } else { r13 = r11; } return r13; } const PREMIUM_GROUP_MONTH = SubscriptionPlans.PREMIUM_GROUP_MONTH; if (PREMIUM_GROUP_MONTH === planId) { if (SubscriptionStatusTypes.CANCELED === r10) { format = intl.format; return r0 ? r1 ? Reflect.apply(format, intl, [t.xoFgRh, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.nXdbKo, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.EcSdRH, {num: value22}]); } if (SubscriptionStatusTypes.ACCOUNT_HOLD === r10) { format = intl.format; return r0 ? r1 ? Reflect.apply(format, intl, [t['5C/0QG'], {price: price, num: value22}]) : Reflect.apply(format, intl, [t.xfYkhu, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.ivjxcn, {num: value22}]); } if (SubscriptionStatusTypes.UNPAID === r10) { return intl.format(t['0HopYf'], {num: value22}); } if (SubscriptionStatusTypes.PAUSE_PENDING === r10) { if (subscription.pauseEndsAt != null) { value34 = (importDefault(3738) /* metro dependency 3738 */)(subscription.pauseEndsAt); r18 = value34.diff(subscription.currentPeriodEnd, 'days'); } else { r18 = null; } return r18 != null ? intl.format(t.WUfOD5, {pauseDate: subscription.currentPeriodEnd, pauseDuration: r18}) : intl.format(t.VlWufv, {pauseDate: subscription.currentPeriodEnd}); } if (SubscriptionStatusTypes.PAUSED === r10) { r11 = !hasFractionalPremiumWithSub ? intl.format(t['6RTdZA'], {resumeDate: subscription.pauseEndsAt}) : r11; return r11; } if (SubscriptionStatusTypes.BILLING_RETRY === r10) { format = intl.format; property = t['IlJ/HV']; object2 = {}; object2.endDate = (importDefault(3738) /* metro dependency 3738 */)(subscription.currentPeriodStart).add(PAID_SUBSCRIPTION_MAX_BILLING_RETRY_DAYS, 'days').toDate(); return Reflect.apply(format, intl, [property, object2]); } if (SubscriptionStatusTypes.PAST_DUE === r10) { format = intl.format; property = t['d+0vwo']; object2 = {}; moduleValue = require(3826) /* metro dependency 3826: DateUtils */; object2.endDate = moduleValue.dateFormat(getBillingGracePeriodDaysAndExpiresDate(subscription).expiresDate, 'LL'); object2.onClick = onClick_29056; return Reflect.apply(format, intl, [property, object2]); } if (hasDiscountApplied) { if (planId === SubscriptionPlans.PREMIUM_YEAR_TIER_2) { format = intl.format; z2oQtA = t.z2oQtA; object2 = {}; object2.percent = activeDiscountInfo?.percentage ?? ANNUAL_DISCOUNT_PERCENTAGE_FALLBACK; object2.regularPrice = value4; object2.renewalDate = getExpectedRenewalDate(subscription, fractionalPremiumInfo); r15 = Reflect.apply(format, intl, [z2oQtA, object2]); } else { formatToPlainString = intl.formatToPlainString; if (r1) { property = t['3ZiutU']; object2 = {}; r23 = activeDiscountInfo?.percentage ?? DISCOUNT_PERCENTAGE_FALLBACK; object2.percent = r23; object2.regularPrice = value4; r23 = activeDiscountInfo?.duration ?? DISCOUNT_DURATION_FALLBACK; object2.numMonths = r23; r15 = Reflect.apply(formatToPlainString, intl, [property, object2]); } else { property = t['G6+XOT']; object2 = {}; r23 = activeDiscountInfo?.percentage ?? DISCOUNT_PERCENTAGE_FALLBACK; object2.percent = r23; object2.regularPrice = value4; r23 = activeDiscountInfo?.duration ?? DISCOUNT_DURATION_FALLBACK; object2.numMonths = r23; r15 = Reflect.apply(formatToPlainString, intl, [property, object2]); } } r13 = r15; } else { r13 = r11; } return r13; } const Error = global.Error; const value = 'Invalid planId ' + planId; const value32 = Object.create(Error.prototype, {constructor: {value: Error}}); const error = new Error(); throw error instanceof Object ? error : value32; } function getPremiumPlanOptions({skuId, isPremium, defaultPlanId}) { // fn#29057, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:15952, offset: 0x00fb8083, size: 311 bytes, params: 2, frame: 16 var r2; var items; var value; var Error; if (skuId != null) { if (isPremium) { value = undefined; r2 = value === defaultPlanId || skuId !== SubscriptionPlanInfo[defaultPlanId].skuId ? value : defaultPlanId; if (PremiumSubscriptionSKUs.TIER_0 === skuId) { items = [SubscriptionPlans.PREMIUM_YEAR_TIER_0, SubscriptionPlans.PREMIUM_MONTH_TIER_0]; if (value !== r2) { items.splice(items.indexOf(r2), 1); items.unshift(r2); } return items; } if (PremiumSubscriptionSKUs.TIER_1 === skuId) { items = [SubscriptionPlans.PREMIUM_MONTH_TIER_1]; if (value !== r2) { items.splice(items.indexOf(r2), 1); items.unshift(r2); } return items; } if (PremiumSubscriptionSKUs.TIER_2 === skuId) { items = [SubscriptionPlans.PREMIUM_YEAR_TIER_2, SubscriptionPlans.PREMIUM_MONTH_TIER_2]; if (value !== r2) { items.splice(items.indexOf(r2), 1); items.unshift(r2); } return items; } Error = global.Error; value = 'Unexpected SKU: ' + skuId; throw new Error(); } } return []; } function getSkuIdForPlan(a0) { // fn#29058, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:16406, offset: 0x00fb81ba, size: 111 bytes, params: 2, frame: 15 var error; const property = SubscriptionPlanInfo[a0]; if (property == null) { error = new global.Error('Unsupported plan'); (require(3817) /* metro dependency 3817: BillingUtils */).captureBillingException(error, {tags: {planId: a0}}); throw error; } return property.skuId; } function getNumPremiumGuildSubscriptions(a0) { // fn#29059, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:16571, offset: 0x00fb8229, size: 120 bytes, params: 2, frame: 16 const getPlanIdsForSkus = SubscriptionPlanStore.getPlanIdsForSkus; const GUILD = PremiumSubscriptionSKUs.GUILD; (importDefault(44) /* metro dependency 44 */)(Reflect.apply(getPlanIdsForSkus, SubscriptionPlanStore, [[GUILD]]) != null, 'Missing guildSubscriptionPlanIds'); const value = a0.find(_fun29060); return value != null ? value.quantity : 0; } function subscriptionHasPremiumGuildPlan({additionalPlans}) { // fn#29061, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:16777, offset: 0x00fb82bd, size: 31 bytes, params: 2, frame: 11 return getNumPremiumGuildSubscriptions(additionalPlans) > 0; } function isPremiumBaseSubscriptionPlan(a0) { // fn#29062, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:17161, offset: 0x00fb82dc, size: 22 bytes, params: 2, frame: 11 return env0_56.has(a0); } function getBillingGracePeriodDaysAndExpiresDate(a0) { // fn#29064, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:17279, offset: 0x00fb8308, size: 663 bytes, params: 2, frame: 20 var grace_period_expires_date; var r9; var r7; var metadata; var value; var object2; var defaultImport2; var value6; var defaultImport3; var defaultImport4; var value8; var defaultImport5; var value9; var value11; if (a0.isPurchasedViaApple) { metadata = a0.metadata; value = undefined; if ((metadata == null ? value : metadata.apple_grace_period_expires_date) != null) { value11 = (importDefault(3738) /* metro dependency 3738 */)(a0.metadata.apple_grace_period_expires_date); object2 = {}; value = importDefault(3738) /* metro dependency 3738 */; value = value.duration(value11.diff(a0.currentPeriodStart)); object2.days = value.days(); object2.expiresDate = value11; return object2; } if (a0.isPurchasedViaGoogle) { metadata = a0.metadata; value = undefined; if ((metadata == null ? value : metadata.google_grace_period_expires_date) == null) { if (a0.isPurchasedExternally) { r7 = a0.isPurchasedViaApple ? DEFAULT_APPLE_GRACE_PERIOD_DAYS : DEFAULT_GOOGLE_GRACE_PERIOD_DAYS; object2 = {days: r7}; value = importDefault(3738) /* metro dependency 3738 */; value = value(a0.currentPeriodStart); object2.expiresDate = value.add(r7, 'days'); return object2; } metadata = a0.metadata; value = undefined; grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date; if (grace_period_expires_date != null) { object2 = {}; defaultImport2 = importDefault(3738) /* metro dependency 3738 */; metadata = a0.metadata; grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date; value6 = defaultImport2(grace_period_expires_date); object2.days = value6.diff(a0.currentPeriodStart, 'days'); defaultImport3 = importDefault(3738) /* metro dependency 3738 */; metadata = a0.metadata; grace_period_expires_date = metadata.grace_period_expires_date; object2.expiresDate = defaultImport3(grace_period_expires_date); return object2; } r9 = a0.paymentSourceId == null ? DEFAULT_MAX_GRACE_PERIOD_DAYS : PAID_SUBSCRIPTION_MAX_GRACE_PERIOD_DAYS; object2 = {days: r9}; value = (importDefault(3738) /* metro dependency 3738 */)(a0.currentPeriodStart); object2.expiresDate = value.add(r9, 'days'); return object2; } metadata = a0.metadata; if ((metadata == null ? value : metadata.google_original_expires_date) != null) { defaultImport4 = importDefault(3738) /* metro dependency 3738 */; metadata = a0.metadata; value8 = defaultImport4(metadata.google_grace_period_expires_date); defaultImport5 = importDefault(3738) /* metro dependency 3738 */; metadata = a0.metadata; value9 = defaultImport5(metadata.google_original_expires_date); object2 = {}; value = importDefault(3738) /* metro dependency 3738 */; value = value.duration(value8.diff(value9)); object2.days = value.days(); object2.expiresDate = value8; return object2; } if (a0.isPurchasedExternally) { r7 = a0.isPurchasedViaApple ? DEFAULT_APPLE_GRACE_PERIOD_DAYS : DEFAULT_GOOGLE_GRACE_PERIOD_DAYS; object2 = {days: r7}; value = importDefault(3738) /* metro dependency 3738 */; value = value(a0.currentPeriodStart); object2.expiresDate = value.add(r7, 'days'); return object2; } metadata = a0.metadata; value = undefined; grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date; if (grace_period_expires_date != null) { object2 = {}; defaultImport2 = importDefault(3738) /* metro dependency 3738 */; metadata = a0.metadata; grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date; value6 = defaultImport2(grace_period_expires_date); object2.days = value6.diff(a0.currentPeriodStart, 'days'); defaultImport3 = importDefault(3738) /* metro dependency 3738 */; metadata = a0.metadata; grace_period_expires_date = metadata.grace_period_expires_date; object2.expiresDate = defaultImport3(grace_period_expires_date); return object2; } r9 = a0.paymentSourceId == null ? DEFAULT_MAX_GRACE_PERIOD_DAYS : PAID_SUBSCRIPTION_MAX_GRACE_PERIOD_DAYS; object2 = {days: r9}; value = (importDefault(3738) /* metro dependency 3738 */)(a0.currentPeriodStart); object2.expiresDate = value.add(r9, 'days'); return object2; } if (a0.isPurchasedExternally) { r7 = a0.isPurchasedViaApple ? DEFAULT_APPLE_GRACE_PERIOD_DAYS : DEFAULT_GOOGLE_GRACE_PERIOD_DAYS; object2 = {days: r7}; value = importDefault(3738) /* metro dependency 3738 */; value = value(a0.currentPeriodStart); object2.expiresDate = value.add(r7, 'days'); return object2; } metadata = a0.metadata; value = undefined; grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date; if (grace_period_expires_date != null) { object2 = {}; defaultImport2 = importDefault(3738) /* metro dependency 3738 */; metadata = a0.metadata; grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date; value6 = defaultImport2(grace_period_expires_date); object2.days = value6.diff(a0.currentPeriodStart, 'days'); defaultImport3 = importDefault(3738) /* metro dependency 3738 */; metadata = a0.metadata; grace_period_expires_date = metadata.grace_period_expires_date; object2.expiresDate = defaultImport3(grace_period_expires_date); return object2; } r9 = a0.paymentSourceId == null ? DEFAULT_MAX_GRACE_PERIOD_DAYS : PAID_SUBSCRIPTION_MAX_GRACE_PERIOD_DAYS; object2 = {days: r9}; value = (importDefault(3738) /* metro dependency 3738 */)(a0.currentPeriodStart); object2.expiresDate = value.add(r9, 'days'); } else { if (a0.isPurchasedViaGoogle) { metadata = a0.metadata; value = undefined; if ((metadata == null ? value : metadata.google_grace_period_expires_date) == null) { if (a0.isPurchasedExternally) { r7 = a0.isPurchasedViaApple ? DEFAULT_APPLE_GRACE_PERIOD_DAYS : DEFAULT_GOOGLE_GRACE_PERIOD_DAYS; object2 = {days: r7}; value = importDefault(3738) /* metro dependency 3738 */; value = value(a0.currentPeriodStart); object2.expiresDate = value.add(r7, 'days'); return object2; } metadata = a0.metadata; value = undefined; grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date; if (grace_period_expires_date != null) { object2 = {}; defaultImport2 = importDefault(3738) /* metro dependency 3738 */; metadata = a0.metadata; grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date; value6 = defaultImport2(grace_period_expires_date); object2.days = value6.diff(a0.currentPeriodStart, 'days'); defaultImport3 = importDefault(3738) /* metro dependency 3738 */; metadata = a0.metadata; grace_period_expires_date = metadata.grace_period_expires_date; object2.expiresDate = defaultImport3(grace_period_expires_date); return object2; } r9 = a0.paymentSourceId == null ? DEFAULT_MAX_GRACE_PERIOD_DAYS : PAID_SUBSCRIPTION_MAX_GRACE_PERIOD_DAYS; object2 = {days: r9}; value = (importDefault(3738) /* metro dependency 3738 */)(a0.currentPeriodStart); object2.expiresDate = value.add(r9, 'days'); return object2; } metadata = a0.metadata; if ((metadata == null ? value : metadata.google_original_expires_date) != null) { defaultImport4 = importDefault(3738) /* metro dependency 3738 */; metadata = a0.metadata; value8 = defaultImport4(metadata.google_grace_period_expires_date); defaultImport5 = importDefault(3738) /* metro dependency 3738 */; metadata = a0.metadata; value9 = defaultImport5(metadata.google_original_expires_date); object2 = {}; value = importDefault(3738) /* metro dependency 3738 */; value = value.duration(value8.diff(value9)); object2.days = value.days(); object2.expiresDate = value8; return object2; } if (a0.isPurchasedExternally) { r7 = a0.isPurchasedViaApple ? DEFAULT_APPLE_GRACE_PERIOD_DAYS : DEFAULT_GOOGLE_GRACE_PERIOD_DAYS; object2 = {days: r7}; value = importDefault(3738) /* metro dependency 3738 */; value = value(a0.currentPeriodStart); object2.expiresDate = value.add(r7, 'days'); return object2; } metadata = a0.metadata; value = undefined; grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date; if (grace_period_expires_date != null) { object2 = {}; defaultImport2 = importDefault(3738) /* metro dependency 3738 */; metadata = a0.metadata; grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date; value6 = defaultImport2(grace_period_expires_date); object2.days = value6.diff(a0.currentPeriodStart, 'days'); defaultImport3 = importDefault(3738) /* metro dependency 3738 */; metadata = a0.metadata; grace_period_expires_date = metadata.grace_period_expires_date; object2.expiresDate = defaultImport3(grace_period_expires_date); return object2; } r9 = a0.paymentSourceId == null ? DEFAULT_MAX_GRACE_PERIOD_DAYS : PAID_SUBSCRIPTION_MAX_GRACE_PERIOD_DAYS; object2 = {days: r9}; value = (importDefault(3738) /* metro dependency 3738 */)(a0.currentPeriodStart); object2.expiresDate = value.add(r9, 'days'); return object2; } if (a0.isPurchasedExternally) { r7 = a0.isPurchasedViaApple ? DEFAULT_APPLE_GRACE_PERIOD_DAYS : DEFAULT_GOOGLE_GRACE_PERIOD_DAYS; object2 = {days: r7}; value = importDefault(3738) /* metro dependency 3738 */; value = value(a0.currentPeriodStart); object2.expiresDate = value.add(r7, 'days'); return object2; } metadata = a0.metadata; value = undefined; grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date; if (grace_period_expires_date != null) { object2 = {}; defaultImport2 = importDefault(3738) /* metro dependency 3738 */; metadata = a0.metadata; grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date; value6 = defaultImport2(grace_period_expires_date); object2.days = value6.diff(a0.currentPeriodStart, 'days'); defaultImport3 = importDefault(3738) /* metro dependency 3738 */; metadata = a0.metadata; grace_period_expires_date = metadata.grace_period_expires_date; object2.expiresDate = defaultImport3(grace_period_expires_date); return object2; } r9 = a0.paymentSourceId == null ? DEFAULT_MAX_GRACE_PERIOD_DAYS : PAID_SUBSCRIPTION_MAX_GRACE_PERIOD_DAYS; object2 = {days: r9}; object2.expiresDate = (importDefault(3738) /* metro dependency 3738 */)(a0.currentPeriodStart).add(r9, 'days'); } return object2; } function getExpectedRenewalDate(a0, a1) { // fn#29065, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:18402, offset: 0x00fb859f, size: 93 bytes, params: 3, frame: 14 var r0; const Date = global.Date; let date = new Date(a0.currentPeriodEnd); let r2 = a1 == null || a0.isBoostOnly; r2 = !r2 ? a0.hasAnyPremiumGroup : r2; if (r2) { r0 = date; } else { date = extendDateWithUnconsumedFractionalPremium(date, a1.unactivatedUnits); r0 = date; } return r0; } function getBillingInformationString(a0, a1) { // fn#29066, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:18597, offset: 0x00fb85fc, size: 2520 bytes, params: 3, frame: 28 var r1; var r13; var r14; var object2; var status; var isPurchasedExternally; var Date; var subscriptionPeriodStart; var date; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; var format; const t = (require(1244) /* metro dependency 1244: indexNative */).t; var Q18lRK; const intl2 = (require(1244) /* metro dependency 1244: indexNative */).intl; var ZlWXgR; var paymentGateway; var getExternalSubscriptionMethodUrlBinding; var property; var EMTLOT; var expiresDate; var qEIzyi; var U2hb3W; const intl3 = (require(1244) /* metro dependency 1244: indexNative */).intl; const intl4 = (require(1244) /* metro dependency 1244: indexNative */).intl; let value = a1; const value2 = a2; const value3 = a3; const value4 = a4; const value5 = undefined; const r0 = value2 !== value5 ? value2 : null; const r6 = value3 !== value5 ? value3 : false; if (value4 !== value5) { r1 = value4; } else { object2 = {'isFractionalPremiumActive': false, 'fetched': true}; object2.fractionalState = FractionalPremiumStates.NONE; object2.startsAt = (importDefault(3738) /* metro dependency 3738 */)(0); object2.endsAt = (importDefault(3738) /* metro dependency 3738 */)(0); object2.currentEntitlementId = ''; object2.currentEntitlementEndsAt = (importDefault(3738) /* metro dependency 3738 */)(0); object2.unactivatedUnits = []; r1 = object2; } let r3 = r0 === null || a0.status !== SubscriptionStatusTypes.PAST_DUE ? value : r0; const priceUtilsModule = require(5137) /* metro dependency 5137: PriceUtils */; const formatPrice = priceUtilsModule.formatPrice; const r11 = r6 ? Reflect.apply(formatPrice, priceUtilsModule, [r3.invoiceItems.filter(function(a0) { return PREMIUM_TIER_2_PLANS.has(a0.subscriptionPlanId); }).map(_fun29068).reduce(_fun29069, 0), r3.currency]) : Reflect.apply(formatPrice, priceUtilsModule, [r3.total, r3.currency]); const currentUser = UserStore.getCurrentUser(); if (currentUser == null) { status = a0.status; if (status === SubscriptionStatusTypes.CANCELED) { return intl.format(t['Whp/qk'], {endDate: value.subscriptionPeriodStart}); } status = a0.status; if (status === SubscriptionStatusTypes.PAUSE_PENDING) { return intl.format(t.uBLUGU, {pauseDate: a0.currentPeriodEnd, resumeDate: a0.pauseEndsAt}); } status = a0.status; if (status === SubscriptionStatusTypes.PAUSED) { if (r1.fractionalState !== FractionalPremiumStates.NONE) { format = intl.format; Q18lRK = t.Q18lRK; object2 = {}; object2.renewalDate = r1.endsAt.toDate(); object2.price = r11; r3 = Reflect.apply(format, intl, [Q18lRK, object2]); } else { r3 = a0.pauseEndsAt == null ? r6 ? intl.format(t.KTYQCg, {planName: intl4.string(t.Ipxkog), price: r11}) : intl.string(t.fMz6Lg) : r6 ? intl.format(t.zcgtzf, {planName: intl3.string(t.Ipxkog), resumeDate: a0.pauseEndsAt, price: r11}) : intl.format(t['V8+l6k'], {resumeDate: a0.pauseEndsAt}); } return r3; } status = a0.status; if (status === SubscriptionStatusTypes.PAST_DUE) { expiresDate = getBillingGracePeriodDaysAndExpiresDate(a0).expiresDate; r3 = a0.isPurchasedViaGoogle && (a0.metadata == null ? value5 : a0.metadata.google_grace_period_expires_date) != null; if (r3) { value = importDefault(3738) /* metro dependency 3738 */; value = value(a0.metadata.google_grace_period_expires_date); r14 = value; } else { r14 = expiresDate; } r3 = a0.isPurchasedViaApple && (a0.metadata == null ? value5 : a0.metadata.apple_grace_period_expires_date) != null; if (r3) { value = importDefault(3738) /* metro dependency 3738 */; value = value(a0.metadata.apple_grace_period_expires_date); r14 = value; } isPurchasedExternally = a0.isPurchasedExternally; format = intl.format; if (isPurchasedExternally) { U2hb3W = t.U2hb3W; object2 = {}; object2.endDate = r14.toDate(); paymentGateway = a0.paymentGateway; object2.paymentGatewayName = PaymentGatewayToFriendlyName[paymentGateway]; getExternalSubscriptionMethodUrlBinding = getExternalSubscriptionMethodUrl; paymentGateway = a0.paymentGateway; object2.paymentSourceLink = getExternalSubscriptionMethodUrlBinding(paymentGateway, 'PAYMENT_SOURCE_MANAGEMENT'); r3 = Reflect.apply(format, intl, [U2hb3W, object2]); } else { qEIzyi = t.qEIzyi; object2 = {}; object2.endDate = r14.toDate(); object2.price = r11; r3 = Reflect.apply(format, intl, [qEIzyi, object2]); } return r3; } status = a0.status; if (status === SubscriptionStatusTypes.BILLING_RETRY) { format = intl.format; EMTLOT = t.EMTLOT; object2 = {}; value = importDefault(3738) /* metro dependency 3738 */; value = value(a0.currentPeriodStart); value = value.add(PAID_SUBSCRIPTION_MAX_BILLING_RETRY_DAYS, 'days'); object2.endDate = value.toDate(); object2.price = r11; return Reflect.apply(format, intl, [EMTLOT, object2]); } status = a0.status; if (status === SubscriptionStatusTypes.ACCOUNT_HOLD) { if (a0.isPurchasedViaGoogle) { value = require(3815) /* metro dependency 3815: BillingPlatformUtils */; if (value.isGooglePlayBillingSupported()) { format = intl.format; EMTLOT = t.EMTLOT; object2 = {}; value = importDefault(3738) /* metro dependency 3738 */; value = value(a0.currentPeriodStart); value = value.add(MAX_ACCOUNT_HOLD_DAYS, 'days'); object2.endDate = value.toDate(); object2.price = r11; value = Reflect.apply(format, intl, [EMTLOT, object2]); r3 = value; } else { format = intl.format; property = t['dtcxw+']; object2 = {}; value = importDefault(3738) /* metro dependency 3738 */; value = value(a0.currentPeriodStart); value = value.add(MAX_ACCOUNT_HOLD_DAYS, 'days'); object2.endDate = value.toDate(); paymentGateway = a0.paymentGateway; object2.paymentGatewayName = PaymentGatewayToFriendlyName[paymentGateway]; getExternalSubscriptionMethodUrlBinding = getExternalSubscriptionMethodUrl; paymentGateway = a0.paymentGateway; object2.paymentSourceLink = getExternalSubscriptionMethodUrlBinding(paymentGateway, 'PAYMENT_SOURCE_MANAGEMENT'); value = Reflect.apply(format, intl, [property, object2]); r3 = value; } } else { format = intl.format; EMTLOT = t.EMTLOT; object2 = {}; value = importDefault(3738) /* metro dependency 3738 */; value = value(a0.currentPeriodStart); value = value.add(MAX_ACCOUNT_HOLD_DAYS, 'days'); object2.endDate = value.toDate(); object2.price = r11; value = Reflect.apply(format, intl, [EMTLOT, object2]); r3 = value; } return r3; } if (isSubscriptionPrepaidPaymentSource(a0)) { return intl.format(t.awpB0C, {prepaidEndDate: a0.currentPeriodEnd}); } status = a0.status; if (status === SubscriptionStatusTypes.UNPAID) { return intl.format(t.CzTKom, {maxProcessingTimeInDays: MAX_PAYMENT_PROCESSING_TIME_DAYS}); } isPurchasedExternally = a0.isPurchasedExternally; if (isPurchasedExternally) { format = intl.format; ZlWXgR = t.ZlWXgR; object2 = {}; object2.renewalDate = value.subscriptionPeriodStart; paymentGateway = a0.paymentGateway; object2.paymentGatewayName = PaymentGatewayToFriendlyName[paymentGateway]; getExternalSubscriptionMethodUrlBinding = getExternalSubscriptionMethodUrl; paymentGateway = a0.paymentGateway; object2.subscriptionManagementLink = getExternalSubscriptionMethodUrlBinding(paymentGateway, 'SUBSCRIPTION_MANAGEMENT'); return Reflect.apply(format, intl, [ZlWXgR, object2]); } Date = global.Date; subscriptionPeriodStart = value.subscriptionPeriodStart; date = new Date(); r3 = a0.isBoostOnly || a0.hasAnyPremiumGroup; if (r3) { r13 = date; } else { date = extendDateWithUnconsumedFractionalPremium(date, r1.unactivatedUnits); r13 = date; } } else { if (currentUser.isOnReverseTrial()) { return intl.format(t['7ZS2m1'], {trialEnd: r1.currentEntitlementEndsAt != null ? r1.currentEntitlementEndsAt.toDate() : a0.currentPeriodEnd}); } status = a0.status; if (status === SubscriptionStatusTypes.CANCELED) { return intl.format(t['Whp/qk'], {endDate: value.subscriptionPeriodStart}); } status = a0.status; if (status === SubscriptionStatusTypes.PAUSE_PENDING) { return intl.format(t.uBLUGU, {pauseDate: a0.currentPeriodEnd, resumeDate: a0.pauseEndsAt}); } status = a0.status; if (status === SubscriptionStatusTypes.PAUSED) { if (r1.fractionalState !== FractionalPremiumStates.NONE) { format = intl.format; Q18lRK = t.Q18lRK; object2 = {}; object2.renewalDate = r1.endsAt.toDate(); object2.price = r11; r3 = Reflect.apply(format, intl, [Q18lRK, object2]); } else { r3 = a0.pauseEndsAt == null ? r6 ? intl.format(t.KTYQCg, {planName: intl4.string(t.Ipxkog), price: r11}) : intl.string(t.fMz6Lg) : r6 ? intl.format(t.zcgtzf, {planName: intl3.string(t.Ipxkog), resumeDate: a0.pauseEndsAt, price: r11}) : intl.format(t['V8+l6k'], {resumeDate: a0.pauseEndsAt}); } return r3; } status = a0.status; if (status === SubscriptionStatusTypes.PAST_DUE) { expiresDate = getBillingGracePeriodDaysAndExpiresDate(a0).expiresDate; r3 = a0.isPurchasedViaGoogle && (a0.metadata == null ? value5 : a0.metadata.google_grace_period_expires_date) != null; if (r3) { value = importDefault(3738) /* metro dependency 3738 */; value = value(a0.metadata.google_grace_period_expires_date); r14 = value; } else { r14 = expiresDate; } r3 = a0.isPurchasedViaApple && (a0.metadata == null ? value5 : a0.metadata.apple_grace_period_expires_date) != null; if (r3) { value = importDefault(3738) /* metro dependency 3738 */; value = value(a0.metadata.apple_grace_period_expires_date); r14 = value; } isPurchasedExternally = a0.isPurchasedExternally; format = intl.format; if (isPurchasedExternally) { U2hb3W = t.U2hb3W; object2 = {}; object2.endDate = r14.toDate(); paymentGateway = a0.paymentGateway; object2.paymentGatewayName = PaymentGatewayToFriendlyName[paymentGateway]; getExternalSubscriptionMethodUrlBinding = getExternalSubscriptionMethodUrl; paymentGateway = a0.paymentGateway; object2.paymentSourceLink = getExternalSubscriptionMethodUrlBinding(paymentGateway, 'PAYMENT_SOURCE_MANAGEMENT'); r3 = Reflect.apply(format, intl, [U2hb3W, object2]); } else { qEIzyi = t.qEIzyi; object2 = {}; object2.endDate = r14.toDate(); object2.price = r11; r3 = Reflect.apply(format, intl, [qEIzyi, object2]); } return r3; } status = a0.status; if (status === SubscriptionStatusTypes.BILLING_RETRY) { format = intl.format; EMTLOT = t.EMTLOT; object2 = {}; value = importDefault(3738) /* metro dependency 3738 */; value = value(a0.currentPeriodStart); value = value.add(PAID_SUBSCRIPTION_MAX_BILLING_RETRY_DAYS, 'days'); object2.endDate = value.toDate(); object2.price = r11; return Reflect.apply(format, intl, [EMTLOT, object2]); } status = a0.status; if (status === SubscriptionStatusTypes.ACCOUNT_HOLD) { if (a0.isPurchasedViaGoogle) { value = require(3815) /* metro dependency 3815: BillingPlatformUtils */; if (value.isGooglePlayBillingSupported()) { format = intl.format; EMTLOT = t.EMTLOT; object2 = {}; value = importDefault(3738) /* metro dependency 3738 */; value = value(a0.currentPeriodStart); value = value.add(MAX_ACCOUNT_HOLD_DAYS, 'days'); object2.endDate = value.toDate(); object2.price = r11; value = Reflect.apply(format, intl, [EMTLOT, object2]); r3 = value; } else { format = intl.format; property = t['dtcxw+']; object2 = {}; value = importDefault(3738) /* metro dependency 3738 */; value = value(a0.currentPeriodStart); value = value.add(MAX_ACCOUNT_HOLD_DAYS, 'days'); object2.endDate = value.toDate(); paymentGateway = a0.paymentGateway; object2.paymentGatewayName = PaymentGatewayToFriendlyName[paymentGateway]; getExternalSubscriptionMethodUrlBinding = getExternalSubscriptionMethodUrl; paymentGateway = a0.paymentGateway; object2.paymentSourceLink = getExternalSubscriptionMethodUrlBinding(paymentGateway, 'PAYMENT_SOURCE_MANAGEMENT'); value = Reflect.apply(format, intl, [property, object2]); r3 = value; } } else { format = intl.format; EMTLOT = t.EMTLOT; object2 = {}; value = importDefault(3738) /* metro dependency 3738 */; value = value(a0.currentPeriodStart); value = value.add(MAX_ACCOUNT_HOLD_DAYS, 'days'); object2.endDate = value.toDate(); object2.price = r11; value = Reflect.apply(format, intl, [EMTLOT, object2]); r3 = value; } return r3; } if (isSubscriptionPrepaidPaymentSource(a0)) { return intl.format(t.awpB0C, {prepaidEndDate: a0.currentPeriodEnd}); } status = a0.status; if (status === SubscriptionStatusTypes.UNPAID) { return intl.format(t.CzTKom, {maxProcessingTimeInDays: MAX_PAYMENT_PROCESSING_TIME_DAYS}); } if (a0.isPurchasedExternally) { format = intl.format; ZlWXgR = t.ZlWXgR; object2 = {}; object2.renewalDate = value.subscriptionPeriodStart; paymentGateway = a0.paymentGateway; object2.paymentGatewayName = PaymentGatewayToFriendlyName[paymentGateway]; getExternalSubscriptionMethodUrlBinding = getExternalSubscriptionMethodUrl; paymentGateway = a0.paymentGateway; object2.subscriptionManagementLink = getExternalSubscriptionMethodUrlBinding(paymentGateway, 'SUBSCRIPTION_MANAGEMENT'); return Reflect.apply(format, intl, [ZlWXgR, object2]); } Date = global.Date; subscriptionPeriodStart = value.subscriptionPeriodStart; date = new Date(); if (a0.isBoostOnly || a0.hasAnyPremiumGroup) { r13 = date; } else { date = extendDateWithUnconsumedFractionalPremium(date, r1.unactivatedUnits); r13 = date; } } format = intl.format; return r6 ? Reflect.apply(format, intl, [t.Vl3cED, {planName: intl2.string(t.Ipxkog), renewalDate: r13, price: r11}]) : Reflect.apply(format, intl, [t.Q18lRK, {renewalDate: r13, price: r11}]); } function extendDateWithUnconsumedFractionalPremium(a0, a1, a2, a3) { // fn#29070, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:22164, offset: 0x00fb9007, size: 171 bytes, params: 5, frame: 21 var r4; var r1; let value = a0; const value3 = undefined; value = (importDefault(3738) /* metro dependency 3738 */)(a3 ? value3 : value); if (a1.length > 0) { value = value.add(getUnactivatedFractionalPremiumHours(a1), 'hours'); r4 = value; } else { r4 = value; } if (a3) { r1 = r4; } else if (value3 === a2) { r1 = r4; } else { value = (importDefault(3738) /* metro dependency 3738 */)(); value = a2.diff(value, 'hours', true); if (value > 0) { value = r4.add(value, 'hours'); r1 = value; } else { r1 = r4; } } return r1.toDate(); } function getUnactivatedFractionalPremiumDurationString(a0) { // fn#29071, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:22428, offset: 0x00fb90b2, size: 245 bytes, params: 2, frame: 22 var object2; const t = (require(1244) /* metro dependency 1244: indexNative */).t; var moduleValue; var roundFPCountdownUnits; var moduleValue2; const unactivatedFractionalPremiumHours = getUnactivatedFractionalPremiumHours(a0.unactivatedUnits); if (unactivatedFractionalPremiumHours > 0) { if (a0.fractionalState === FractionalPremiumStates.NONE) { object2 = {}; object2.days = t.fYmirx; object2.hours = t['C3RO+g']; object2.minutes = t.r77oHc; moduleValue = require(12192) /* metro dependency 12192: useFPDurationLeft */; roundFPCountdownUnits = moduleValue.roundFPCountdownUnits; moduleValue2 = require(3826) /* metro dependency 3826: DateUtils */; return (require(3826) /* metro dependency 3826: DateUtils */).unitsAsStrings(Reflect.apply(roundFPCountdownUnits, moduleValue, [moduleValue2.diffAsUnits(0, unactivatedFractionalPremiumHours * (importDefault(672) /* metro dependency 672: Durations */).Millis.HOUR)]), object2); } } return ''; } function isSwitchingPlansDisabled(a0) { // fn#29072, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:22797, offset: 0x00fb91a7, size: 55 bytes, params: 2, frame: 4 let r0 = a0.renewalMutations != null || a0.trialEndsAt != null; r0 = !r0 ? a0.status === SubscriptionStatusTypes.PAST_DUE : r0; return r0; } function getSwitchingPlansDisabledMessage(a0) { // fn#29073, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:22910, offset: 0x00fb91de, size: 248 bytes, params: 2, frame: 18 const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; const t = (require(1244) /* metro dependency 1244: indexNative */).t; const renewalMutations = a0.renewalMutations; const value = null; let r0 = value != renewalMutations ? a0.renewalMutations.planId !== a0.planId ? intl.string(t['0rzJ4J']) : intl.string(t['9dLQ0/']) : value; r0 = value != a0.trialEndsAt ? intl.string(t.a9Mdb3) : r0; return r0; } function isSubscriptionPrepaidPaymentSource(a0) { // fn#29074, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:23199, offset: 0x00fb92d6, size: 40 bytes, params: 2, frame: 12 return a0.paymentSourceId != null && isPrepaidPaymentSource(a0.paymentSourceId); } function isPrepaidPaymentSource(a0) { // fn#29075, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:23320, offset: 0x00fb92fe, size: 61 bytes, params: 2, frame: 13 if (a0 == null) { return false; } const paymentSource = PaymentSourceStore.getPaymentSource(a0); return paymentSource != null && PREPAID_PAYMENT_SOURCES.has(paymentSource.type); } function isPremiumGuildSubscriptionCanceled(a0) { // fn#29077, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:23677, offset: 0x00fb9391, size: 63 bytes, params: 2, frame: 12 return a0.isPurchasedExternally ? a0.status === SubscriptionStatusTypes.CANCELED : getCoercedPremiumGuildSubscriptionStatus(a0) === SubscriptionStatusTypes.CANCELED; } function getFormattedPriceForPlan(a0, a1, a2) { // fn#29078, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:23834, offset: 0x00fb93d0, size: 221 bytes, params: 4, frame: 20 var r4; var r2; var getDefaultPriceBinding; var id; var getPriceBinding; var priceBinding; var error; let value = a3; if (value !== undefined) { r4 = value; } else { value = false; r4 = value; } if (a1 != null) { try { value = environment; getPriceBinding = getPrice; id = a0.id; priceBinding = getPriceBinding(id, false, r4, a1); r2 = priceBinding; } catch (error) { getDefaultPriceBinding = getDefaultPrice; id = a0.id; value = getDefaultPriceBinding(id, false, r4); r2 = value; } } else { r2 = getDefaultPrice(a0.id, false, r4); } const priceUtilsModule = require(5137) /* metro dependency 5137: PriceUtils */; const formatPrice = priceUtilsModule.formatPrice; const amount = r2.amount; let currency = r2.currency; const value3 = Reflect.apply(formatPrice, priceUtilsModule, [amount, currency]); currency = a0.currency; const USD = CurrencyCodes.USD; return currency !== USD && a2 === true ? value3.concat('*') : value3; } function getPlanIdFromInvoice(a0, a1) { // fn#29079, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:24101, offset: 0x00fb94ad, size: 195 bytes, params: 3, frame: 18 const planId = a0.planId; let status = a0.status; const CANCELED = SubscriptionStatusTypes.CANCELED; if (status === CANCELED) { return planId; } status = a0.status; const PAUSE_PENDING = SubscriptionStatusTypes.PAUSE_PENDING; if (status === PAUSE_PENDING) { return planId; } (importDefault(44) /* metro dependency 44 */)(a1 != null, 'Expected invoicePreview'); const value2 = a1.invoiceItems.find(function({subscriptionPlanId}) { return isPremiumBaseSubscriptionPlan(subscriptionPlanId); }); return value2 == null || isNoneSubscription(value2.subscriptionPlanId) ? a0.planId : a0.renewalMutations == null ? value2.subscriptionPlanId : a0.renewalMutations.planId !== a0.planId ? a0.planId : value2.subscriptionPlanId; } function getStatusFromInvoice(a0, a1) { // fn#29081, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:24481, offset: 0x00fb9589, size: 161 bytes, params: 3, frame: 17 const status = a0.status; const status2 = a0.status; const CANCELED = SubscriptionStatusTypes.CANCELED; if (status2 === CANCELED) { return status; } const status3 = a0.status; const PAUSE_PENDING = SubscriptionStatusTypes.PAUSE_PENDING; if (status3 === PAUSE_PENDING) { return status; } (importDefault(44) /* metro dependency 44 */)(a1 != null, 'Expected invoicePreview'); const value2 = a1.invoiceItems.find(function({subscriptionPlanId}) { return isPremiumBaseSubscriptionPlan(subscriptionPlanId); }); return value2 == null || isNoneSubscription(value2.subscriptionPlanId) ? SubscriptionStatusTypes.CANCELED : status; } function isBaseSubscriptionCanceled(a0) { // fn#29083, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:24784, offset: 0x00fb962a, size: 77 bytes, params: 2, frame: 14 var r1; var r0; const status = a0.status; const renewalMutations = a0.renewalMutations; const CANCELED = SubscriptionStatusTypes.CANCELED; const value2 = status === CANCELED; if (value2) { r0 = value2; } else { r1 = renewalMutations != null && isNoneSubscription(renewalMutations.planId); r1 = r1 && !a0.isPurchasedExternally; r0 = r1; } return r0; } function isSubscriptionStatusFailedPayment(a0) { // fn#29084, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:24929, offset: 0x00fb9677, size: 56 bytes, params: 2, frame: 4 const PAST_DUE = SubscriptionStatusTypes.PAST_DUE; let r0 = a0 === PAST_DUE || a0 === SubscriptionStatusTypes.ACCOUNT_HOLD; r0 = !r0 ? a0 === SubscriptionStatusTypes.BILLING_RETRY : r0; return r0; } function getFormattedPlanPriceFromInvoice(a0, a1, a2) { // fn#29085, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:25038, offset: 0x00fb96af, size: 175 bytes, params: 4, frame: 20 let value = a0.findInvoiceItemByPlanId(a2.id); const amount = value == null ? getPrice(a2.id, false, false, {paymentSourceId: a1.paymentSourceId, currency: a1.currency}).amount : value.amount; value = require(5137) /* metro dependency 5137: PriceUtils */; const formatRate = value.formatRate; const priceUtilsModule = require(5137) /* metro dependency 5137: PriceUtils */; return Reflect.apply(formatRate, value, [priceUtilsModule.formatPrice(amount, a0.currency), a2.interval, a2.intervalCount]); } function getPremiumGuildIntervalPrice(a0, a1, a2, a3) { // fn#29086, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:25320, offset: 0x00fb975e, size: 355 bytes, params: 5, frame: 20 var error; const r7 = a1 != null ? {paymentSourceId: a1, currency: a2} : {country: BillingInfoStore.ipCountryCodeWithFallback, currency: a2}; const value2 = SubscriptionPlanStore.get(a0); if (value2 == null) { error = new global.Error('Unsupported plan'); (require(3817) /* metro dependency 3817: BillingUtils */).captureBillingException(error, {tags: {planId: a0}}); throw error; } const getForSkuAndInterval = SubscriptionPlanStore.getForSkuAndInterval; const GUILD = PremiumSubscriptionSKUs.GUILD; const value3 = Reflect.apply(getForSkuAndInterval, SubscriptionPlanStore, [GUILD, value2.interval, value2.intervalCount]); if (value3 == null) { error = new global.Error('Unsupported plan'); (require(3817) /* metro dependency 3817: BillingUtils */).captureBillingException(error, {tags: {planId: a0}}); throw error; } const getPriceBinding = getPrice; const id = value3.id; let value = require(1900) /* metro dependency 1900: PremiumTypeUtils */; value = value.isPremium(a3); return getPriceBinding(id, value, false, r7); } function getBillingReviewSubheader(a0, a1, a2) { // fn#29087, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:25809, offset: 0x00fb98c1, size: 1555 bytes, params: 4, frame: 19 var error; var object2; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; var string; const t = (require(1244) /* metro dependency 1244: indexNative */).t; var formatToPlainString; var LwdrNi; const id = a1.id; if (a0 == null) { if (SubscriptionPlans.PREMIUM_MONTH_TIER_0 === id) { string = intl.string; return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t['/G3aKw']]); } if (SubscriptionPlans.PREMIUM_YEAR_TIER_0 === id) { string = intl.string; return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t['2eQpsL']]); } if (SubscriptionPlans.PREMIUM_MONTH_TIER_1 === id) { string = intl.string; return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t.gueLg5]); } if (SubscriptionPlans.PREMIUM_YEAR_TIER_1 === id) { string = intl.string; return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t['MhH/vW']]); } if (SubscriptionPlans.PREMIUM_MONTH_TIER_2 === id) { string = intl.string; return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t.LQVQIq]); } if (SubscriptionPlans.PREMIUM_GROUP_MONTH === id) { formatToPlainString = intl.formatToPlainString; LwdrNi = (importDefault(2806) /* metro dependency 2806: PremiumGroupMessages */).LwdrNi; object2 = {}; object2.premiumGroupProductName = getPremiumGroupProductName(); return Reflect.apply(formatToPlainString, intl, [LwdrNi, object2]); } if (SubscriptionPlans.PREMIUM_YEAR_TIER_2 === id) { string = intl.string; return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t['0nfg1x']]); } if (SubscriptionPlans.PREMIUM_3_MONTH_TIER_2 === id) { return intl.formatToPlainString(t.BCD4fT, {intervalCount: a1.intervalCount}); } if (SubscriptionPlans.PREMIUM_6_MONTH_TIER_2 === id) { return intl.formatToPlainString(t.BCD4fT, {intervalCount: a1.intervalCount}); } if (SubscriptionPlans.NONE_MONTH === id) { return intl.string(t.eUEeCt); } if (SubscriptionPlans.NONE_YEAR === id) { return intl.string(t.eUEeCt); } if (SubscriptionPlans.NONE_3_MONTH === id) { return intl.string(t.eUEeCt); } if (SubscriptionPlans.NONE_6_MONTH === id) { return intl.string(t.eUEeCt); } if (SubscriptionPlans.PREMIUM_MONTH_GUILD === id) { return intl.string(t.eUEeCt); } if (SubscriptionPlans.PREMIUM_YEAR_GUILD === id) { return intl.string(t.eUEeCt); } if (SubscriptionPlans.PREMIUM_3_MONTH_GUILD === id) { return intl.string(t.eUEeCt); } if (SubscriptionPlans.PREMIUM_6_MONTH_GUILD === id) { return intl.string(t.eUEeCt); } error = new global.Error('User is purchasing an unsupported plan'); (require(3817) /* metro dependency 3817: BillingUtils */).captureBillingException(error, {tags: {planId: id}}); throw error; } let PREMIUM_MONTH_TIER_0 = SubscriptionPlans.PREMIUM_MONTH_TIER_0; if (PREMIUM_MONTH_TIER_0 === id) { return intl.string(t['0ggVqN']); } let PREMIUM_YEAR_TIER_0 = SubscriptionPlans.PREMIUM_YEAR_TIER_0; if (PREMIUM_YEAR_TIER_0 === id) { return intl.string(t['jm+ZQw']); } let PREMIUM_MONTH_TIER_1 = SubscriptionPlans.PREMIUM_MONTH_TIER_1; if (PREMIUM_MONTH_TIER_1 === id) { return intl.string(t.uph4Jx); } let PREMIUM_YEAR_TIER_1 = SubscriptionPlans.PREMIUM_YEAR_TIER_1; if (PREMIUM_YEAR_TIER_1 === id) { return intl.string(t['D/l7Yt']); } let PREMIUM_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_MONTH_TIER_2; if (PREMIUM_MONTH_TIER_2 === id) { return intl.string(t['5l1MuV']); } let PREMIUM_GROUP_MONTH = SubscriptionPlans.PREMIUM_GROUP_MONTH; if (PREMIUM_GROUP_MONTH === id) { return intl.string(t['5l1MuV']); } let PREMIUM_YEAR_TIER_2 = SubscriptionPlans.PREMIUM_YEAR_TIER_2; if (PREMIUM_YEAR_TIER_2 === id) { return intl.string(t.G0mISV); } PREMIUM_MONTH_TIER_0 = SubscriptionPlans.PREMIUM_MONTH_TIER_0; if (PREMIUM_MONTH_TIER_0 === id) { string = intl.string; return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t['/G3aKw']]); } PREMIUM_YEAR_TIER_0 = SubscriptionPlans.PREMIUM_YEAR_TIER_0; if (PREMIUM_YEAR_TIER_0 === id) { string = intl.string; return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t['2eQpsL']]); } PREMIUM_MONTH_TIER_1 = SubscriptionPlans.PREMIUM_MONTH_TIER_1; if (PREMIUM_MONTH_TIER_1 === id) { string = intl.string; return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t.gueLg5]); } PREMIUM_YEAR_TIER_1 = SubscriptionPlans.PREMIUM_YEAR_TIER_1; if (PREMIUM_YEAR_TIER_1 === id) { string = intl.string; return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t['MhH/vW']]); } PREMIUM_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_MONTH_TIER_2; if (PREMIUM_MONTH_TIER_2 === id) { string = intl.string; return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t.LQVQIq]); } PREMIUM_GROUP_MONTH = SubscriptionPlans.PREMIUM_GROUP_MONTH; if (PREMIUM_GROUP_MONTH === id) { formatToPlainString = intl.formatToPlainString; LwdrNi = (importDefault(2806) /* metro dependency 2806: PremiumGroupMessages */).LwdrNi; object2 = {}; object2.premiumGroupProductName = getPremiumGroupProductName(); return Reflect.apply(formatToPlainString, intl, [LwdrNi, object2]); } PREMIUM_YEAR_TIER_2 = SubscriptionPlans.PREMIUM_YEAR_TIER_2; if (PREMIUM_YEAR_TIER_2 === id) { string = intl.string; return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t['0nfg1x']]); } const PREMIUM_3_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_3_MONTH_TIER_2; if (PREMIUM_3_MONTH_TIER_2 === id) { return intl.formatToPlainString(t.BCD4fT, {intervalCount: a1.intervalCount}); } const PREMIUM_6_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_6_MONTH_TIER_2; if (PREMIUM_6_MONTH_TIER_2 === id) { return intl.formatToPlainString(t.BCD4fT, {intervalCount: a1.intervalCount}); } const NONE_MONTH = SubscriptionPlans.NONE_MONTH; if (NONE_MONTH === id) { return intl.string(t.eUEeCt); } const NONE_YEAR = SubscriptionPlans.NONE_YEAR; if (NONE_YEAR === id) { return intl.string(t.eUEeCt); } const NONE_3_MONTH = SubscriptionPlans.NONE_3_MONTH; if (NONE_3_MONTH === id) { return intl.string(t.eUEeCt); } const NONE_6_MONTH = SubscriptionPlans.NONE_6_MONTH; if (NONE_6_MONTH === id) { return intl.string(t.eUEeCt); } const PREMIUM_MONTH_GUILD = SubscriptionPlans.PREMIUM_MONTH_GUILD; if (PREMIUM_MONTH_GUILD === id) { return intl.string(t.eUEeCt); } const PREMIUM_YEAR_GUILD = SubscriptionPlans.PREMIUM_YEAR_GUILD; if (PREMIUM_YEAR_GUILD === id) { return intl.string(t.eUEeCt); } const PREMIUM_3_MONTH_GUILD = SubscriptionPlans.PREMIUM_3_MONTH_GUILD; if (PREMIUM_3_MONTH_GUILD === id) { return intl.string(t.eUEeCt); } const PREMIUM_6_MONTH_GUILD = SubscriptionPlans.PREMIUM_6_MONTH_GUILD; if (PREMIUM_6_MONTH_GUILD === id) { return intl.string(t.eUEeCt); } const Error = global.Error; error = new Error('User is purchasing an unsupported plan'); (require(3817) /* metro dependency 3817: BillingUtils */).captureBillingException(error, {tags: {planId: id}}); throw error; } function getIntervalForInvoice({invoiceItems}) { // fn#29088, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:27752, offset: 0x00fb9ed4, size: 104 bytes, params: 2, frame: 14 const value2 = SubscriptionPlanStore.get(invoiceItems[0].subscriptionPlanId); (importDefault(44) /* metro dependency 44 */)(value2 != null, 'Missing subscriptionPlan'); return {intervalType: value2.interval, intervalCount: value2.intervalCount}; } function getDefaultCurrency() { // fn#29089, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:27948, offset: 0x00fb9f3c, size: 55 bytes, params: 1, frame: 17 var r0; var getDefaultPriceBinding; var PREMIUM_MONTH_TIER_2; var currency; var error; let value = environment; const USD = CurrencyCodes.USD; try { getDefaultPriceBinding = getDefaultPrice; PREMIUM_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_MONTH_TIER_2; value = getDefaultPriceBinding(PREMIUM_MONTH_TIER_2, false, false, undefined, false); currency = value.currency; r0 = currency; } catch (error) { r0 = USD; } return r0; } function formatTrialCtaIntervalDuration({intervalType, intervalCount}) { // fn#29090, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:28080, offset: 0x00fb9f73, size: 488 bytes, params: 2, frame: 20 const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; const t = (require(1244) /* metro dependency 1244: indexNative */).t; const r3 = intervalType !== undefined ? intervalType : SubscriptionIntervalTypes.MONTH; intervalCount = intervalCount === undefined ? 1 : intervalCount; const value3 = (require(5137) /* metro dependency 5137: PriceUtils */).formatPrice(0, getDefaultCurrency(), {'maximumFractionDigits': 0, 'minimumFractionDigits': 0}); const DAY = SubscriptionIntervalTypes.DAY; if (DAY === r3) { return intervalCount >= 7 && intervalCount % 7 === 0 ? intl.formatToPlainString(t.C6i5Jt, {weeks: intervalCount / 7, price: value3}) : intl.formatToPlainString(t.cR9ifw, {days: intervalCount, price: value3}); } const MONTH = SubscriptionIntervalTypes.MONTH; if (MONTH === r3) { return intl.formatToPlainString(t['8FZfNo'], {months: intervalCount, price: value3}); } const YEAR = SubscriptionIntervalTypes.YEAR; if (YEAR === r3) { return intl.formatToPlainString(t.xzAcST, {years: intervalCount, price: value3}); } const Error = global.Error; throw new Error('Unsupported interval duration.'); } function getExternalSubscriptionMethodUrl(a0, a1) { // fn#29091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:28706, offset: 0x00fba15b, size: 137 bytes, params: 3, frame: 14 const APPLE_PARTNER = PaymentGateways.APPLE_PARTNER; if (APPLE_PARTNER === a0) { return env0_51[a1]; } const APPLE_ADVANCED_COMMERCE = PaymentGateways.APPLE_ADVANCED_COMMERCE; if (APPLE_ADVANCED_COMMERCE === a0) { return env0_51[a1]; } const APPLE = PaymentGateways.APPLE; if (APPLE === a0) { return env0_51[a1]; } const GOOGLE = PaymentGateways.GOOGLE; if (GOOGLE === a0) { return env0_52[a1]; } const Error = global.Error; const value = 'Invalid external payment gateway ' + a0; const value2 = Object.create(Error.prototype, {constructor: {value: Error}}); const error = new Error(); throw error instanceof Object ? error : value2; } function getItemsFromNewAdditionalPlans(a0, a1) { // fn#29092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:28925, offset: 0x00fba1e4, size: 127 bytes, params: 3, frame: 17 const env0_0 = a0; const items2 = []; const renewalMutations = a0.renewalMutations; const value = renewalMutations == null; let items = value ? undefined : renewalMutations.items; items = items ?? a0.items; const value3 = items.find(function(a0) { return PREMIUM_PLANS.has(a0.planId); }); if (value3 != null) { items2.push(value3); } const push = items2.push; const items3 = []; arraySpread(items3, a1, 0, value); apply(push, items3, items2, value); return items2.map(_fun29094); } function getItemsWithoutPremiumPlanItem(a0) { // fn#29095, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:29264, offset: 0x00fba2d0, size: 22 bytes, params: 2, frame: 11 return a0.filter(function(a0) { return !PREMIUM_PLANS.has(a0.planId); }); } function getItemsWithUpsertedPlanIdForGroup(a0, a1, a2, a3) { // fn#29097, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:29346, offset: 0x00fba305, size: 263 bytes, params: 5, frame: 17 var items; var value; var object2; var renewalMutations; var value2; const env0_0 = a1; const env0_1 = a2; const env0_2 = a3; if (a3.has(a1)) { var env0_3 = false; renewalMutations = a0.renewalMutations; value = undefined; items = renewalMutations == null ? value : renewalMutations.items; items = items ?? a0.items; value = items.map(function(a0) { var r0; var object; var value = a0; if (importAll.has(value.planId)) { env0_3 = true; object = {}; copyDataProperties(object, value, importAll); object['quantity'] = importDefault; object['planId'] = require; r0 = object; } else { r0 = value; } return r0; }); if (!env0_3) { object2 = {planId: a1, quantity: a2}; value2 = a0.items.find(_fun29099); if (value2 != null) { object2.id = value2.id; } value.push(object2); } return value.filter(_fun29100); } const CheckoutError = (require(8458) /* metro dependency 8458: CheckoutError */).CheckoutError; throw new CheckoutError({message: 'Expected planId in group', extraSentryInformation: {newPlanId: a1, planGroup: a3}}); } function getGuildBoostPlanItem(a0) { // fn#29101, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:29818, offset: 0x00fba484, size: 38 bytes, params: 2, frame: 12 const value = null; return value == a0 ? value : a0.items.find(function(a0) { return PREMIUM_GUILD_SUBSCRIPTION_PLANS.has(a0.planId); }); } function isBoostOnlySubscription(a0) { // fn#29103, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:29907, offset: 0x00fba4c6, size: 53 bytes, params: 2, frame: 13 return a0 != null && getPremiumPlanItem(a0) == null && getGuildBoostPlanItem(a0) != null; } function getPremiumSkuIdForSubscription(a0) { // fn#29104, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:30019, offset: 0x00fba4fb, size: 59 bytes, params: 2, frame: 13 const value = null; const r1 = value != a0 ? getPremiumPlanItem(a0) : value; return value != r1 ? getSkuIdForPlan(r1.planId) : value; } function canUseQuestOrbMultiplier(a0) { // fn#29107, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:30354, offset: 0x00fba5a7, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const QUEST_ORB_MULTIPLIER = (require(12706) /* metro dependency 12706: ProductCatalog */).QUEST_ORB_MULTIPLIER; return Reflect.apply(canUserUse, value, [QUEST_ORB_MULTIPLIER, a0]); } function canUseCollectibles(a0) { // fn#29108, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:30453, offset: 0x00fba5e0, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const COLLECTIBLES = (require(12706) /* metro dependency 12706: ProductCatalog */).COLLECTIBLES; return Reflect.apply(canUserUse, value, [COLLECTIBLES, a0]); } function formatPriceString({amount, currency}, a1) { // fn#29109, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:30538, offset: 0x00fba619, size: 94 bytes, params: 3, frame: 16 return '' + (require(5137) /* metro dependency 5137: PriceUtils */).formatPrice(amount, currency) + '/' + getIntervalStringAsNoun(a1); } function formatInterval(a0) { // fn#29113, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:30823, offset: 0x00fba6a3, size: 207 bytes, params: 2, frame: 15 const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; const t = (require(1244) /* metro dependency 1244: indexNative */).t; const YEAR = SubscriptionIntervalTypes.YEAR; if (a0 === YEAR) { return intl.string(t.tfqrhj); } const MONTH = SubscriptionIntervalTypes.MONTH; if (a0 === MONTH) { return intl.string(t.FPybU7); } const Error = global.Error; const value = 'Invalid interval type: ' + a0; const value2 = Object.create(Error.prototype, {constructor: {value: Error}}); const error = new Error(); throw error instanceof Object ? error : value2; } function getFractionalPremiumUnitsHours(a0) { // fn#29115, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:31095, offset: 0x00fba795, size: 36 bytes, params: 2, frame: 12 return getFractionalPremiumUnitsHoursFromSkuIds(a0.map(function(a0) { return a0.skuId; })); } function getFractionalPremiumUnitsHoursFromSkuIds(a0) { // fn#29117, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:31207, offset: 0x00fba7c3, size: 26 bytes, params: 2, frame: 13 return a0.reduce(_fun29118, 0); } function getMonthlyPrice({subscriptionPlan, isGift, priceOptions = {}}) { // fn#29119, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:31385, offset: 0x00fba839, size: 83 bytes, params: 2, frame: 18 isGift = !(isGift === undefined) && isGift; const property = PREMIUM_SKU_TO_MONTHLY_PLAN[subscriptionPlan.skuId]; return property == null ? null : getPrice(property, false, isGift, priceOptions); } function calculateDiscountPercentageForYearlyPlan(a0) { // fn#29120, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:31518, offset: 0x00fba88c, size: 207 bytes, params: 2, frame: 21 var object2; var getMonthlyPriceBinding; var monthlyPriceBinding; var value4; var getPriceBinding; var id; var error; let value = a1; const value2 = a2; const r7 = value !== undefined ? value : false; const r6 = value2 !== undefined ? value2 : {}; const interval = a0.interval; const YEAR = SubscriptionIntervalTypes.YEAR; if (interval === YEAR) { try { getMonthlyPriceBinding = getMonthlyPrice; } catch (error) { return undefined; } try { object2 = {}; } catch (error) { return undefined; } try { object2.subscriptionPlan = a0; } catch (error) { return undefined; } try { object2.isGift = r7; } catch (error) { return undefined; } try { object2.priceOptions = r6; } catch (error) { return undefined; } try { monthlyPriceBinding = getMonthlyPriceBinding(object2); } catch (error) { return undefined; } try { value4 = monthlyPriceBinding == null; } catch (error) { return undefined; } if (value4) { return undefined; } try { getPriceBinding = getPrice; } catch (error) { return undefined; } try { id = a0.id; } catch (error) { return undefined; } try { value = getPriceBinding(id, false, r7, r6); } catch (error) { return undefined; } if (monthlyPriceBinding.amount !== 0) { value = value.amount / (12 * monthlyPriceBinding.amount); return global.Math.floor(100 * (1 - value)); } } } function getDaysSincePremium(a0) { // fn#29121, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:31814, offset: 0x00fba95b, size: 129 bytes, params: 2, frame: 19 var r0; var Math; var max; var moduleValue; var differenceInCalendarDays; var Date; var prototype; var value3; var date; var value4; var value5; let value = 0; if (a0 == null) { r0 = value; } else { Math = global.Math; max = Math.max; moduleValue = require(3826) /* metro dependency 3826: DateUtils */; differenceInCalendarDays = moduleValue.differenceInCalendarDays; Date = global.Date; prototype = Date.prototype; value3 = Object.create(prototype, {constructor: {value: Date}}); date = new Date(); value4 = date instanceof Object ? date : value3; Date = global.Date; prototype = Date.prototype; value5 = Object.create(prototype, {constructor: {value: Date}}); date = new Date(a0); value = Reflect.apply(max, Math, [Reflect.apply(differenceInCalendarDays, moduleValue, [value4, date instanceof Object ? date : value5]), value]); r0 = value; } return r0; } function getDaysRemainingUntilSubscriptionCurrentPeriodEnds({currentPeriodEnd}) { // fn#29122, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:31932, offset: 0x00fba9dc, size: 139 bytes, params: 2, frame: 19 const Math = global.Math; const max = Math.max; const Math2 = global.Math; const ceil = Math2.ceil; let value = require(3826) /* metro dependency 3826: DateUtils */; const differenceInDays = value.differenceInDays; let Date = global.Date; let date = new Date(currentPeriodEnd); Date = global.Date; const value4 = Object.create(Date.prototype, {constructor: {value: Date}}); date = new Date(); value = Reflect.apply(ceil, Math2, [Reflect.apply(differenceInDays, value, [date, date instanceof Object ? date : value4])]); return Reflect.apply(max, Math, [1, value]); } function isPremiumSku(a0) { // fn#29123, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:32684, offset: 0x00fbaa67, size: 56 bytes, params: 2, frame: 4 const TIER_0 = PremiumSubscriptionSKUs.TIER_0; let r0 = a0 === TIER_0 || a0 === PremiumSubscriptionSKUs.TIER_1; r0 = !r0 ? a0 === PremiumSubscriptionSKUs.TIER_2 : r0; return r0; } function getIntervalMonths(a0, a1) { // fn#29124, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:32776, offset: 0x00fbaa9f, size: 105 bytes, params: 3, frame: 15 const MONTH = SubscriptionIntervalTypes.MONTH; if (a0 === MONTH) { return a1; } const YEAR = SubscriptionIntervalTypes.YEAR; if (a0 === YEAR) { return 12 * a1; } const Error = global.Error; const value = '' + a0 + ' interval subscription period not implemented'; const value2 = Object.create(Error.prototype, {constructor: {value: Error}}); const error = new Error(); throw error instanceof Object ? error : value2; } function hasAccountCredit(a0) { // fn#29127, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:33937, offset: 0x00fbab87, size: 64 bytes, params: 2, frame: 12 let value = a0 != null; let r0 = value && a0.size !== 0; if (r0) { value = global.Array.from(a0); value = value.some(function({subscriptionPlanId, parentId, consumed}) { return subscriptionPlanId != null && parentId != null && !consumed; }); r0 = value; } return r0; } function hasUnconsumedGiftForSubscriptionPlan(a0, a1) { // fn#29129, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:34123, offset: 0x00fbabf1, size: 78 bytes, params: 3, frame: 15 const env0_0 = a1; let value = a0 != null; let r0 = value && a0.size !== 0 && a1 != null; if (r0) { value = global.Array.from(a0); value = value.some(_fun29130); r0 = value; } return r0; } function canUseAnimatedEmojis(a0) { // fn#29131, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:35035, offset: 0x00fbac77, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const ANIMATED_EMOJIS = (require(12706) /* metro dependency 12706: ProductCatalog */).ANIMATED_EMOJIS; return Reflect.apply(canUserUse, value, [ANIMATED_EMOJIS, a0]); } function canUseEmojisEverywhere(a0) { // fn#29132, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:35149, offset: 0x00fbacb0, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const EMOJIS_EVERYWHERE = (require(12706) /* metro dependency 12706: ProductCatalog */).EMOJIS_EVERYWHERE; return Reflect.apply(canUserUse, value, [EMOJIS_EVERYWHERE, a0]); } function canUseSoundboardEverywhere(a0) { // fn#29133, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:35271, offset: 0x00fbace9, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const SOUNDBOARD_EVERYWHERE = (require(12706) /* metro dependency 12706: ProductCatalog */).SOUNDBOARD_EVERYWHERE; return Reflect.apply(canUserUse, value, [SOUNDBOARD_EVERYWHERE, a0]); } function canUseCustomCallSounds(a0) { // fn#29134, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:35397, offset: 0x00fbad22, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const CUSTOM_CALL_SOUNDS = (require(12706) /* metro dependency 12706: ProductCatalog */).CUSTOM_CALL_SOUNDS; return Reflect.apply(canUserUse, value, [CUSTOM_CALL_SOUNDS, a0]); } function canUploadLargeFiles(a0) { // fn#29135, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:35513, offset: 0x00fbad5b, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const UPLOAD_LARGE_FILES = (require(12706) /* metro dependency 12706: ProductCatalog */).UPLOAD_LARGE_FILES; return Reflect.apply(canUserUse, value, [UPLOAD_LARGE_FILES, a0]); } function canUseBadges(a0) { // fn#29136, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:35619, offset: 0x00fbad94, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const PROFILE_BADGES = (require(12706) /* metro dependency 12706: ProductCatalog */).PROFILE_BADGES; return Reflect.apply(canUserUse, value, [PROFILE_BADGES, a0]); } function canUseHighVideoUploadQuality(a0) { // fn#29137, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:35730, offset: 0x00fbadcd, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const INCREASED_VIDEO_UPLOAD_QUALITY = (require(12706) /* metro dependency 12706: ProductCatalog */).INCREASED_VIDEO_UPLOAD_QUALITY; return Reflect.apply(canUserUse, value, [INCREASED_VIDEO_UPLOAD_QUALITY, a0]); } function canEditDiscriminator(a0) { // fn#29138, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:35865, offset: 0x00fbae06, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const CUSTOM_DISCRIMINATOR = (require(12706) /* metro dependency 12706: ProductCatalog */).CUSTOM_DISCRIMINATOR; return Reflect.apply(canUserUse, value, [CUSTOM_DISCRIMINATOR, a0]); } function hasBoostDiscount(a0) { // fn#29139, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:35978, offset: 0x00fbae3f, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const BOOST_DISCOUNT = (require(12706) /* metro dependency 12706: ProductCatalog */).BOOST_DISCOUNT; return Reflect.apply(canUserUse, value, [BOOST_DISCOUNT, a0]); } function canUseAnimatedAvatar(a0) { // fn#29140, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:36085, offset: 0x00fbae78, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const ANIMATED_AVATAR = (require(12706) /* metro dependency 12706: ProductCatalog */).ANIMATED_AVATAR; return Reflect.apply(canUserUse, value, [ANIMATED_AVATAR, a0]); } function canInstallPremiumApplications(a0) { // fn#29141, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:36206, offset: 0x00fbaeb1, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const INSTALL_PREMIUM_APPLICATIONS = (require(12706) /* metro dependency 12706: ProductCatalog */).INSTALL_PREMIUM_APPLICATIONS; return Reflect.apply(canUserUse, value, [INSTALL_PREMIUM_APPLICATIONS, a0]); } function canUseIncreasedMessageLength(a0) { // fn#29142, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:36348, offset: 0x00fbaeea, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const INCREASED_MESSAGE_LENGTH = (require(12706) /* metro dependency 12706: ProductCatalog */).INCREASED_MESSAGE_LENGTH; return Reflect.apply(canUserUse, value, [INCREASED_MESSAGE_LENGTH, a0]); } function canUseIncreasedGuildCap(a0) { // fn#29143, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:36480, offset: 0x00fbaf23, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const INCREASED_GUILD_LIMIT = (require(12706) /* metro dependency 12706: ProductCatalog */).INCREASED_GUILD_LIMIT; return Reflect.apply(canUserUse, value, [INCREASED_GUILD_LIMIT, a0]); } function canRedeemPremiumPerks(a0) { // fn#29144, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:36602, offset: 0x00fbaf5c, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const REDEEM_PREMIUM_PERKS = (require(12706) /* metro dependency 12706: ProductCatalog */).REDEEM_PREMIUM_PERKS; return Reflect.apply(canUserUse, value, [REDEEM_PREMIUM_PERKS, a0]); } function canUsePremiumProfileCustomization(a0) { // fn#29145, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:36733, offset: 0x00fbaf95, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const PROFILE_PREMIUM_FEATURES = (require(12706) /* metro dependency 12706: ProductCatalog */).PROFILE_PREMIUM_FEATURES; return Reflect.apply(canUserUse, value, [PROFILE_PREMIUM_FEATURES, a0]); } function canUsePremiumAppIcons(a0) { // fn#29146, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:36868, offset: 0x00fbafce, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const APP_ICONS = (require(12706) /* metro dependency 12706: ProductCatalog */).APP_ICONS; return Reflect.apply(canUserUse, value, [APP_ICONS, a0]); } function canUsePremiumGuildMemberProfile(a0) { // fn#29147, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:36986, offset: 0x00fbb007, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const PREMIUM_GUILD_MEMBER_PROFILE = (require(12706) /* metro dependency 12706: ProductCatalog */).PREMIUM_GUILD_MEMBER_PROFILE; return Reflect.apply(canUserUse, value, [PREMIUM_GUILD_MEMBER_PROFILE, a0]); } function canUseClientThemes(a0) { // fn#29148, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:37120, offset: 0x00fbb040, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const CLIENT_THEMES = (require(12706) /* metro dependency 12706: ProductCatalog */).CLIENT_THEMES; return Reflect.apply(canUserUse, value, [CLIENT_THEMES, a0]); } function canStreamQuality(a0, a1) { // fn#29149, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:37224, offset: 0x00fbb079, size: 125 bytes, params: 3, frame: 17 var r0; var value; const HIGH = env0_55.HIGH; if (a0 === HIGH) { value = require(12706) /* metro dependency 12706: ProductCatalog */; value = value.canUserUse((require(12706) /* metro dependency 12706: ProductCatalog */).STREAM_HIGH_QUALITY, a1); r0 = value; } else { value = require(12706) /* metro dependency 12706: ProductCatalog */; value = value.canUserUse((require(12706) /* metro dependency 12706: ProductCatalog */).STREAM_MID_QUALITY, a1); r0 = value; } return r0; } function hasFreeBoosts(a0) { // fn#29150, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:37446, offset: 0x00fbb0f6, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const FREE_BOOSTS = (require(12706) /* metro dependency 12706: ProductCatalog */).FREE_BOOSTS; return Reflect.apply(canUserUse, value, [FREE_BOOSTS, a0]); } function canUseCustomStickersEverywhere(a0) { // fn#29151, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:37557, offset: 0x00fbb12f, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const STICKERS_EVERYWHERE = (require(12706) /* metro dependency 12706: ProductCatalog */).STICKERS_EVERYWHERE; return Reflect.apply(canUserUse, value, [STICKERS_EVERYWHERE, a0]); } function canUseCustomBackgrounds(a0) { // fn#29152, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:37686, offset: 0x00fbb168, size: 57 bytes, params: 2, frame: 15 const value = require(12706) /* metro dependency 12706: ProductCatalog */; const canUserUse = value.canUserUse; const VIDEO_FILTER_ASSETS = (require(12706) /* metro dependency 12706: ProductCatalog */).VIDEO_FILTER_ASSETS; return Reflect.apply(canUserUse, value, [VIDEO_FILTER_ASSETS, a0]); } function canUseMonthlyOrbs(a0) { // fn#29153, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:37840, offset: 0x00fbb1a1, size: 135 bytes, params: 2, frame: 17 var r0; var moduleValue2; const value2 = undefined; const isCrepeEnabled = (require(5136) /* metro dependency 5136: CrepeExperiment */).getIsCrepeEnabled('canUseMonthlyOrbs'); if (isCrepeEnabled) { moduleValue2 = require(1893) /* metro dependency 1893: PerksStateUtils */; r0 = moduleValue2.hasPerk(a0 == null ? value2 : a0.perks, (require(1895) /* metro dependency 1895: user */).Perk.MONTHLY_ORBS); } else { r0 = !!isCrepeEnabled; } return r0; } function canUseShopDiscounts(a0) { // fn#29154, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:38019, offset: 0x00fbb228, size: 141 bytes, params: 2, frame: 19 var r0; var moduleValue2; const value2 = undefined; const isCrepeEnabled = (require(5136) /* metro dependency 5136: CrepeExperiment */).getIsCrepeEnabled('canUseShopDiscounts'); if (isCrepeEnabled) { moduleValue2 = require(1893) /* metro dependency 1893: PerksStateUtils */; r0 = moduleValue2.hasPerk(a0 == null ? value2 : a0.perks, (require(1895) /* metro dependency 1895: user */).Perk.SHOP_DISCOUNTS); } else { r0 = isCrepeEnabled; } r0 = !r0 ? canUseCollectibles(a0) : r0; return r0; } function canUseMoreQuestOrbs(a0) { // fn#29155, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:38226, offset: 0x00fbb2b5, size: 141 bytes, params: 2, frame: 19 var r0; var moduleValue2; const value2 = undefined; const isCrepeEnabled = (require(5136) /* metro dependency 5136: CrepeExperiment */).getIsCrepeEnabled('canUseMoreQuestOrbs'); if (isCrepeEnabled) { moduleValue2 = require(1893) /* metro dependency 1893: PerksStateUtils */; r0 = moduleValue2.hasPerk(a0 == null ? value2 : a0.perks, (require(1895) /* metro dependency 1895: user */).Perk.MORE_QUEST_ORBS); } else { r0 = isCrepeEnabled; } r0 = !r0 ? canUseQuestOrbMultiplier(a0) : r0; return r0; } function getPremiumBranding(a0) { // fn#29156, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:38608, offset: 0x00fbb342, size: 221 bytes, params: 2, frame: 13 const planId = a0.planId; return PREMIUM_PLANS.has(planId) && subscriptionHasPremiumGuildPlan(a0) ? env0_54.BUNDLE : planId === SubscriptionPlans.PREMIUM_MONTH_TIER_0 || planId === SubscriptionPlans.PREMIUM_YEAR_TIER_0 ? env0_54.TIER_0 : planId === SubscriptionPlans.PREMIUM_MONTH_TIER_1 || planId === SubscriptionPlans.PREMIUM_YEAR_TIER_1 ? env0_54.TIER_1 : planId === SubscriptionPlans.PREMIUM_MONTH_TIER_2 || planId === SubscriptionPlans.PREMIUM_YEAR_TIER_2 || (planId === SubscriptionPlans.PREMIUM_3_MONTH_TIER_2 || planId === SubscriptionPlans.PREMIUM_6_MONTH_TIER_2) ? env0_54.TIER_2 : env0_54.PREMIUM_GUILD; } function usePlanSelectPriceState(a0, a1, a2) { // fn#29157, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:39140, offset: 0x00fbb41f, size: 96 bytes, params: 4, frame: 17 const env0_0 = a0; const env0_1 = a1; const env0_2 = a2; const binding = env0_4; return binding.useMemo(_fun29159, [a0, a1, binding.useMemo(function() { var value2 = null; return value2 == require || value2 == require.checkoutContext || value2 == require.checkoutContext.available_plans ? value2 : require.checkoutContext.available_plans; }, [a1]), a2]); } function getCountryPrices(a0) { // fn#29160, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:39520, offset: 0x00fbb536, size: 46 bytes, params: 2, frame: 13 const value = a1; return getPurchaseTypePrices(a0, value !== undefined ? value : PriceSetAssignmentPurchaseTypes.DEFAULT).countryPrices; } function getSubscriptionWithNewPlansTotalServerPrice(a0, a1, a2, a3) { // fn#29161, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:39878, offset: 0x00fbb564, size: 110 bytes, params: 5, frame: 17 var r2; const value = a1; if (value !== null) { r2 = value; } else { (importDefault(44) /* metro dependency 44 */)(a0 !== null, "Subscription can't be null"); r2 = []; } return getItemPlansTotalServerPrice(a0 !== null ? getItemsFromNewAdditionalPlans(a0, r2) : getItemsWithoutPremiumPlanItem(r2), a2, a3); } function getDiscountIntervalString(a0) { // fn#29162, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:40184, offset: 0x00fbb5d2, size: 215 bytes, params: 2, frame: 15 const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; const t = (require(1244) /* metro dependency 1244: indexNative */).t; const MONTH = DiscountUserUsageLimitIntervalTypes.MONTH; if (MONTH === a0) { return intl.string(t.FPybU7); } const YEAR = DiscountUserUsageLimitIntervalTypes.YEAR; if (YEAR === a0) { return intl.string(t.tfqrhj); } const DAY = DiscountUserUsageLimitIntervalTypes.DAY; if (DAY !== a0) { DiscountUserUsageLimitIntervalTypes.WEEK; } const Error = global.Error; throw new Error('Unexpected interval'); } function getDisplayNameFromSku(a0) { // fn#29163, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:40613, offset: 0x00fbb6a9, size: 314 bytes, params: 2, frame: 16 const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; const t = (require(1244) /* metro dependency 1244: indexNative */).t; const TIER_0 = PremiumSubscriptionSKUs.TIER_0; if (TIER_0 === a0) { return intl.string(t['t9uG/o']); } const TIER_1 = PremiumSubscriptionSKUs.TIER_1; if (TIER_1 === a0) { return intl.string(t.FSOz78); } const TIER_2 = PremiumSubscriptionSKUs.TIER_2; if (TIER_2 === a0) { return intl.string(t.lG6a5x); } const Error = global.Error; const error = new Error('Unsupported sku'); (require(3817) /* metro dependency 3817: BillingUtils */).captureBillingException(error, {tags: {skuId: a0}}); throw error; } function getPremiumTypeDisplayName(a0) { // fn#29164, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:41035, offset: 0x00fbb7e3, size: 251 bytes, params: 2, frame: 17 const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; const t = (require(1244) /* metro dependency 1244: indexNative */).t; const value = a1; const r2 = value !== undefined ? value : false; const TIER_0 = PremiumTypes.TIER_0; if (TIER_0 === a0) { return r2 ? 'Basic' : intl.string(t['t9uG/o']); } const TIER_1 = PremiumTypes.TIER_1; if (TIER_1 === a0) { return r2 ? 'Classic' : intl.string(t.FSOz78); } const TIER_2 = PremiumTypes.TIER_2; if (TIER_2 === a0) { return intl.string(t.lG6a5x); } } function getPlanDescriptionFromInvoice({renewalInvoicePreview, renewalInvoiceWithEntitlementsPreview, subscription, planId, includePremiumGuilds, hasDiscountApplied, activeDiscountInfo, hasFractionalPremiumWithSub, fractionalPremiumInfo}) { // fn#29165, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:41338, offset: 0x00fbb8de, size: 211 bytes, params: 2, frame: 24 includePremiumGuilds = !(includePremiumGuilds === undefined) && includePremiumGuilds; hasDiscountApplied = !(hasDiscountApplied === undefined) && hasDiscountApplied; hasFractionalPremiumWithSub = !(hasFractionalPremiumWithSub === undefined) && hasFractionalPremiumWithSub; const value2 = SubscriptionPlanStore.get(planId); (importDefault(44) /* metro dependency 44 */)(value2 != null, 'Missing plan'); const getPlanDescriptionBinding = getPlanDescription; const object2 = {subscription: subscription}; object2.planId = value2.id; object2.price = getFormattedPlanPriceFromInvoice(renewalInvoicePreview, subscription, value2); object2.includePremiumGuilds = includePremiumGuilds; object2.hasDiscountApplied = hasDiscountApplied; object2.activeDiscountInfo = activeDiscountInfo; object2.renewalInvoiceWithoutEntitlementsPreview = renewalInvoicePreview; object2.renewalInvoiceWithEntitlementsPreview = renewalInvoiceWithEntitlementsPreview; object2.hasFractionalPremiumWithSub = hasFractionalPremiumWithSub; object2.fractionalPremiumInfo = fractionalPremiumInfo; return getPlanDescriptionBinding(object2); } function getExternalPlanDisplayName({planId, additionalPlans}) { // fn#29166, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:41980, offset: 0x00fbb9b1, size: 364 bytes, params: 2, frame: 21 const t = (require(1244) /* metro dependency 1244: indexNative */).t; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; const r5 = isNoneSubscription(planId) ? null : getDisplayName_29051(planId); const r10 = additionalPlans?.find(function({planId}) { return PREMIUM_GUILD_SUBSCRIPTION_PLANS.has(planId); }); planId = r10?.planId; const PREMIUM_MONTH_GUILD = SubscriptionPlans.PREMIUM_MONTH_GUILD; const Pi5yMJ = planId === PREMIUM_MONTH_GUILD ? t.Pi5yMJ : r10?.planId !== SubscriptionPlans.PREMIUM_YEAR_GUILD ? null : t.Pi5yMJ; const r4 = Pi5yMJ != null ? intl.formatToPlainString(Pi5yMJ, {num: r10?.quantity}) : undefined; if (r5 == null) { if (r5 != null) { return r5; } if (r4 != null) { return r4; } throw new global.Error('Subscription without premium or premium guild subscription'); } if (r4 != null) { return intl.formatToPlainString(t.FN5T9r, {premiumDescription: r5, premiumGuildDescription: r4}); } if (r5 != null) { return r5; } if (r4 != null) { return r4; } const Error = global.Error; throw new Error('Subscription without premium or premium guild subscription'); } function getPlanIdForPremiumType(a0, a1) { // fn#29168, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:42669, offset: 0x00fbbb39, size: 344 bytes, params: 3, frame: 15 var Error; const Set = global.Set; var value; const MONTH = SubscriptionIntervalTypes.MONTH; const YEAR = SubscriptionIntervalTypes.YEAR; const set = new Set([MONTH, YEAR]); if (set.has(a1)) { if (PremiumTypes.TIER_0 === a0) { return a1 === SubscriptionIntervalTypes.MONTH ? SubscriptionPlans.PREMIUM_MONTH_TIER_0 : SubscriptionPlans.PREMIUM_YEAR_TIER_0; } if (PremiumTypes.TIER_1 === a0) { return a1 === SubscriptionIntervalTypes.MONTH ? SubscriptionPlans.PREMIUM_MONTH_TIER_1 : SubscriptionPlans.PREMIUM_YEAR_TIER_1; } if (PremiumTypes.TIER_2 === a0) { return a1 === SubscriptionIntervalTypes.MONTH ? SubscriptionPlans.PREMIUM_MONTH_TIER_2 : SubscriptionPlans.PREMIUM_YEAR_TIER_2; } Error = global.Error; value = 'Unsupported premium type: ' + a0; throw new Error(); } Error = global.Error; value = 'Unsupported plan interval for premium type: ' + a1; const value4 = Object.create(Error.prototype, {constructor: {value: Error}}); const error = new Error(); throw error instanceof Object ? error : value4; } function isPremiumSubscriptionPlan(a0) { // fn#29169, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:43412, offset: 0x00fbbc91, size: 31 bytes, params: 2, frame: 13 return isPremiumBaseSubscriptionPlan(a0) || isPremiumGuildSubscriptionPlan(a0); } function isPremiumGroupSubscriptionPlan(a0) { // fn#29170, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:43561, offset: 0x00fbbcb0, size: 31 bytes, params: 2, frame: 3 return a0 != null && a0 === SubscriptionPlans.PREMIUM_GROUP_MONTH; } function getPremiumGuildHeaderDescription({subscription, user, price, renewalInvoicePreview, fractionalPremiumInfo}) { // fn#29171, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:44470, offset: 0x00fbbccf, size: 1555 bytes, params: 2, frame: 38 var r12; var r11; var r19; var r3; var value10; var moduleValue; var isPurchasedViaGoogle; var intl; var format; var t; var ijSDcI; var object2; var eDwrLA; var property; var moduleValue3; var oiRy7v; const planId = subscription.planId; const additionalPlans = subscription.additionalPlans; const renewalMutations = subscription.renewalMutations; var value; const value2 = SubscriptionPlanStore.get(planId); (importDefault(44) /* metro dependency 44 */)(value2 != null, 'Missing plan'); const numPremiumGuildSubscriptions = getNumPremiumGuildSubscriptions(additionalPlans); const r15 = renewalMutations?.additionalPlans == null ? numPremiumGuildSubscriptions : getNumPremiumGuildSubscriptions(renewalMutations.additionalPlans); const Math = global.Math; const value6 = Math.max(0, numPremiumGuildSubscriptions - r15); let r17 = r15 > 0 && value6 > 0; const value9 = getPremiumGuildIntervalPrice(subscription.planId, subscription.paymentSourceId, subscription.currency, user).amount * (r17 ? r15 : numPremiumGuildSubscriptions); if (renewalInvoicePreview == null) { r12 = value9; } else { value10 = renewalInvoicePreview.invoiceItems.find(function(a0) { return PREMIUM_GUILD_SUBSCRIPTION_PLANS.has(a0.subscriptionPlanId); }); r12 = value10 == null ? value9 : value10.amount; } if (price != null) { r11 = price; } else { moduleValue = require(5137) /* metro dependency 5137: PriceUtils */; r11 = moduleValue.formatPrice(r12, subscription.currency); } const r6 = renewalInvoicePreview?.taxInclusive ?? subscription.latestInvoice?.taxInclusive; let r0 = r6 == null || r6; if (isPremiumGuildSubscriptionCanceled(subscription)) { isPurchasedViaGoogle = subscription.isPurchasedViaGoogle; intl = (require(1244) /* metro dependency 1244: indexNative */).intl; format = intl.format; t = (require(1244) /* metro dependency 1244: indexNative */).t; if (isPurchasedViaGoogle) { r0 = Reflect.apply(format, intl, [t['3/WTrI'], {quantity: numPremiumGuildSubscriptions}]); } else if (r0) { property = t['0ozBSB']; object2 = {quantity: numPremiumGuildSubscriptions}; value = require(5137) /* metro dependency 5137: PriceUtils */; object2.rate = value.formatRate(r11, value2.interval, value2.intervalCount); value = Reflect.apply(format, intl, [property, object2]); r0 = value; } else { property = t['yjsv/s']; object2 = {quantity: numPremiumGuildSubscriptions}; value = require(5137) /* metro dependency 5137: PriceUtils */; object2.rate = value.formatRate(r11, value2.interval, value2.intervalCount); value = Reflect.apply(format, intl, [property, object2]); r0 = value; } return r0; } const status = subscription.status; const ACCOUNT_HOLD = SubscriptionStatusTypes.ACCOUNT_HOLD; if (ACCOUNT_HOLD === status) { isPurchasedViaGoogle = subscription.isPurchasedViaGoogle; intl = (require(1244) /* metro dependency 1244: indexNative */).intl; format = intl.format; t = (require(1244) /* metro dependency 1244: indexNative */).t; if (isPurchasedViaGoogle) { r3 = Reflect.apply(format, intl, [t.Nlf3nc, {quantity: numPremiumGuildSubscriptions, boostQuantity: numPremiumGuildSubscriptions}]); } else if (r0) { oiRy7v = t.oiRy7v; object2 = {quantity: numPremiumGuildSubscriptions, boostQuantity: numPremiumGuildSubscriptions}; value = require(5137) /* metro dependency 5137: PriceUtils */; object2.rate = value.formatRate(r11, value2.interval, value2.intervalCount); value = Reflect.apply(format, intl, [oiRy7v, object2]); r3 = value; } else { property = t['0QxOAi']; object2 = {quantity: numPremiumGuildSubscriptions, boostQuantity: numPremiumGuildSubscriptions}; value = require(5137) /* metro dependency 5137: PriceUtils */; object2.rate = value.formatRate(r11, value2.interval, value2.intervalCount); value = Reflect.apply(format, intl, [property, object2]); r3 = value; } return r3; } const PAUSE_PENDING = SubscriptionStatusTypes.PAUSE_PENDING; if (PAUSE_PENDING === status) { if (fractionalPremiumInfo == null) { intl = (require(1244) /* metro dependency 1244: indexNative */).intl; r3 = intl.format((require(1244) /* metro dependency 1244: indexNative */).t['5iud9s'], {quantity: numPremiumGuildSubscriptions}); } else if (fractionalPremiumInfo.isFractionalPremiumActive) { intl = (require(1244) /* metro dependency 1244: indexNative */).intl; r3 = intl.format((require(1244) /* metro dependency 1244: indexNative */).t['5iud9s'], {quantity: numPremiumGuildSubscriptions}); } else { intl = (require(1244) /* metro dependency 1244: indexNative */).intl; r3 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.CduWAm); } return r3; } const PAUSED = SubscriptionStatusTypes.PAUSED; if (PAUSED === status) { if (fractionalPremiumInfo == null) { intl = (require(1244) /* metro dependency 1244: indexNative */).intl; r3 = intl.format((require(1244) /* metro dependency 1244: indexNative */).t['5iud9s'], {quantity: numPremiumGuildSubscriptions}); } else if (fractionalPremiumInfo.isFractionalPremiumActive) { intl = (require(1244) /* metro dependency 1244: indexNative */).intl; r3 = intl.format((require(1244) /* metro dependency 1244: indexNative */).t['5iud9s'], {quantity: numPremiumGuildSubscriptions}); } else { intl = (require(1244) /* metro dependency 1244: indexNative */).intl; r3 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.CduWAm); } return r3; } const PAST_DUE = SubscriptionStatusTypes.PAST_DUE; if (PAST_DUE === status) { if (subscription.isBoostOnly) { intl = (require(1244) /* metro dependency 1244: indexNative */).intl; format = intl.format; property = (require(1244) /* metro dependency 1244: indexNative */).t['d+0vwo']; object2 = {}; moduleValue3 = require(3826) /* metro dependency 3826: DateUtils */; object2.endDate = moduleValue3.dateFormat(getBillingGracePeriodDaysAndExpiresDate(subscription).expiresDate, 'LL'); object2.onClick = onClick_29173; return Reflect.apply(format, intl, [property, object2]); } } isPurchasedViaGoogle = subscription.isPurchasedViaGoogle; const moduleValue2 = require(1244) /* metro dependency 1244: indexNative */; if (r17) { if (isPurchasedViaGoogle) { intl = moduleValue2.intl; return intl.format((require(1244) /* metro dependency 1244: indexNative */).t['krRy+d'], {activeQuantity: r15, pendingQuantity: value6}); } t = moduleValue2.t; r19 = r0 ? t['4nc7+E'] : t.BmaudS; intl = (require(1244) /* metro dependency 1244: indexNative */).intl; format = intl.format; object2 = {activeQuantity: r15, pendingQuantity: value6}; value = require(5137) /* metro dependency 5137: PriceUtils */; object2.rate = value.formatRate(r11, value2.interval, value2.intervalCount); return Reflect.apply(format, intl, [r19, object2]); } intl = moduleValue2.intl; format = intl.format; t = (require(1244) /* metro dependency 1244: indexNative */).t; if (isPurchasedViaGoogle) { r17 = Reflect.apply(format, intl, [t['5iud9s'], {quantity: numPremiumGuildSubscriptions}]); } else if (r0) { eDwrLA = t.eDwrLA; object2 = {quantity: numPremiumGuildSubscriptions}; value = require(5137) /* metro dependency 5137: PriceUtils */; object2.rate = value.formatRate(r11, value2.interval, value2.intervalCount); value = Reflect.apply(format, intl, [eDwrLA, object2]); r17 = value; } else { ijSDcI = t.ijSDcI; object2 = {quantity: numPremiumGuildSubscriptions}; value = require(5137) /* metro dependency 5137: PriceUtils */; object2.rate = value.formatRate(r11, value2.interval, value2.intervalCount); value = Reflect.apply(format, intl, [ijSDcI, object2]); r17 = value; } return r17; } function getFormattedRateForPlan(a0, a1, a2) { // fn#29174, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:47097, offset: 0x00fbc2fe, size: 72 bytes, params: 4, frame: 16 const formattedPriceForPlan = getFormattedPriceForPlan(a0, a1, a2); const value = require(5137) /* metro dependency 5137: PriceUtils */; return value.formatRate(formattedPriceForPlan, a0.interval, a0.intervalCount); } function formatTrialOfferIntervalDuration({intervalType, intervalCount, capitalize}) { // fn#29175, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:47771, offset: 0x00fbc346, size: 540 bytes, params: 2, frame: 20 const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; var formatToPlainString; const t = (require(1244) /* metro dependency 1244: indexNative */).t; const r3 = intervalType !== undefined ? intervalType : SubscriptionIntervalTypes.MONTH; intervalCount = intervalCount === undefined ? 1 : intervalCount; capitalize = !(capitalize === undefined) && capitalize; const DAY = SubscriptionIntervalTypes.DAY; if (DAY === r3) { return intervalCount >= 7 && intervalCount % 7 === 0 ? capitalize ? intl.formatToPlainString(t.fRNBRX, {weeks: intervalCount / 7}) : intl.formatToPlainString(t.EIpHEj, {weeks: intervalCount / 7}) : capitalize ? intl.formatToPlainString(t['6Cdzoy'], {days: intervalCount}) : intl.formatToPlainString(t['kbBj/h'], {days: intervalCount}); } const MONTH = SubscriptionIntervalTypes.MONTH; if (MONTH === r3) { formatToPlainString = intl.formatToPlainString; return capitalize ? Reflect.apply(formatToPlainString, intl, [t.x5MgxS, {months: intervalCount}]) : Reflect.apply(formatToPlainString, intl, [t['4SEnCZ'], {months: intervalCount}]); } const YEAR = SubscriptionIntervalTypes.YEAR; if (YEAR === r3) { formatToPlainString = intl.formatToPlainString; return capitalize ? Reflect.apply(formatToPlainString, intl, [t['h+63yl'], {years: intervalCount}]) : Reflect.apply(formatToPlainString, intl, [t['9DFiHk'], {years: intervalCount}]); } const Error = global.Error; throw new Error('Unsupported interval duration.'); } function formatTrialCtaIntervalDurationFromTrialOffer(a0, a1) { // fn#29176, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:48675, offset: 0x00fbc562, size: 86 bytes, params: 3, frame: 12 if (a0 != null) { var subscription_trial = a0.subscription_trial; if (subscription_trial == null) { return null; } subscription_trial = a0.subscription_trial; if (subscription_trial.sku_id === a1) { subscription_trial = a0.subscription_trial; return formatTrialCtaIntervalDuration({intervalType: subscription_trial.interval, intervalCount: subscription_trial.interval_count}); } } return null; } function formatIntervalDuration({intervalType, intervalCount, capitalize}) { // fn#29177, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:48970, offset: 0x00fbc5b8, size: 524 bytes, params: 2, frame: 20 const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; var formatToPlainString; const t = (require(1244) /* metro dependency 1244: indexNative */).t; const r3 = intervalType !== undefined ? intervalType : SubscriptionIntervalTypes.MONTH; intervalCount = intervalCount === undefined ? 1 : intervalCount; capitalize = !(capitalize === undefined) && capitalize; const DAY = SubscriptionIntervalTypes.DAY; if (DAY === r3) { return intervalCount >= 7 && intervalCount % 7 === 0 ? capitalize ? intl.formatToPlainString(t.iVZYyl, {weeks: intervalCount / 7}) : intl.formatToPlainString(t.EmoBD2, {weeks: intervalCount / 7}) : capitalize ? intl.formatToPlainString(t.jzH70Z, {days: intervalCount}) : intl.formatToPlainString(t['k2UNz+'], {days: intervalCount}); } const MONTH = SubscriptionIntervalTypes.MONTH; if (MONTH === r3) { formatToPlainString = intl.formatToPlainString; return capitalize ? Reflect.apply(formatToPlainString, intl, [t.erUSmA, {months: intervalCount}]) : Reflect.apply(formatToPlainString, intl, [t.kridzK, {months: intervalCount}]); } const YEAR = SubscriptionIntervalTypes.YEAR; if (YEAR === r3) { formatToPlainString = intl.formatToPlainString; return capitalize ? Reflect.apply(formatToPlainString, intl, [t.IfYQVC, {years: intervalCount}]) : Reflect.apply(formatToPlainString, intl, [t.PClsrw, {years: intervalCount}]); } const Error = global.Error; throw new Error('Unsupported interval duration.'); } function hasPremiumSubscriptionToDisplay(a0, a1) { // fn#29178, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:49843, offset: 0x00fbc7c4, size: 72 bytes, params: 3, frame: 14 return (require(1900) /* metro dependency 1900: PremiumTypeUtils */).isPremium(a0) || isSubscriptionStatusFailedPayment(a1?.status); } function useHasPremiumSubscriptionToDisplay() { // fn#29179, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:50019, offset: 0x00fbc80c, size: 145 bytes, params: 1, frame: 19 const value2 = undefined; const premiumTypeSubscription = (require(566) /* metro dependency 566: flux */).useStateFromStores([SubscriptionStore], function() { return SubscriptionStore.getPremiumTypeSubscription(); }); const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() { return UserStore.getCurrentUser(); }); return (require(1900) /* metro dependency 1900: PremiumTypeUtils */).isPremium(currentUser) || isSubscriptionStatusFailedPayment(premiumTypeSubscription == null ? value2 : premiumTypeSubscription.status); } function coerceExistingItemsToNewItemInterval(a0) { // fn#29184, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:50825, offset: 0x00fbc8fa, size: 136 bytes, params: 2, frame: 17 var r0; let value = a0; const r2 = value.find(function(a0) { return !('id' in a0); }) ?? value.find(function(a0) { return PREMIUM_PLANS.has(a0.planId); }); if (r2 == null) { r0 = value; } else { (importDefault(44) /* metro dependency 44 */)(SubscriptionPlanStore.get(r2.planId) != null, 'Missing plan'); value = value.map(_fun29187); r0 = value; } return r0; } function getMaxFileSizeForPremiumType(a0) { // fn#29188, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:51353, offset: 0x00fbca75, size: 105 bytes, params: 2, frame: 15 let value = a1; const r4 = value !== undefined ? value : {useSpace: true}; const fileSize = PremiumUserLimits[a0].fileSize; value = require(4136) /* metro dependency 4136: FileSizeUtils */; const formatSize = value.formatSize; const value2 = fileSize / 1024; const useSpace = r4.useSpace; return Reflect.apply(formatSize, value, [value2, {useKibibytes: true, useSpace: useSpace}]); } function getPremiumTypeFromPlanId(a0) { // fn#29189, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:51896, offset: 0x00fbcade, size: 270 bytes, params: 2, frame: 13 const PREMIUM_MONTH_TIER_0 = SubscriptionPlans.PREMIUM_MONTH_TIER_0; if (PREMIUM_MONTH_TIER_0 === a0) { return {premiumType: PremiumTypes.TIER_0, planInterval: SubscriptionIntervalTypes.MONTH}; } const PREMIUM_YEAR_TIER_0 = SubscriptionPlans.PREMIUM_YEAR_TIER_0; if (PREMIUM_YEAR_TIER_0 === a0) { return {premiumType: PremiumTypes.TIER_0, planInterval: SubscriptionIntervalTypes.YEAR}; } const PREMIUM_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_MONTH_TIER_2; if (PREMIUM_MONTH_TIER_2 === a0) { return {premiumType: PremiumTypes.TIER_2, planInterval: SubscriptionIntervalTypes.MONTH}; } const PREMIUM_GROUP_MONTH = SubscriptionPlans.PREMIUM_GROUP_MONTH; if (PREMIUM_GROUP_MONTH === a0) { return {premiumType: PremiumTypes.TIER_2, planInterval: SubscriptionIntervalTypes.MONTH}; } const PREMIUM_YEAR_TIER_2 = SubscriptionPlans.PREMIUM_YEAR_TIER_2; if (PREMIUM_YEAR_TIER_2 === a0) { return {premiumType: PremiumTypes.TIER_2, planInterval: SubscriptionIntervalTypes.YEAR}; } const Error = global.Error; const value = 'Unsupported gifting planId: ' + a0; const value2 = Object.create(Error.prototype, {constructor: {value: Error}}); const error = new Error(); throw error instanceof Object ? error : value2; } function useHasTier2Premium() { // fn#29191, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:52620, offset: 0x00fbcbf9, size: 91 bytes, params: 1, frame: 17 const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() { return UserStore.getCurrentUser(); }); const premiumTypeUtilsModule = require(1900) /* metro dependency 1900: PremiumTypeUtils */; const isPremiumExactly = premiumTypeUtilsModule.isPremiumExactly; const TIER_2 = PremiumTypes.TIER_2; return Reflect.apply(isPremiumExactly, premiumTypeUtilsModule, [currentUser, TIER_2]); } function getSavingsPercent({planId, isGift, priceOptions, subscriptionPlan}) { // fn#29194, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:53317, offset: 0x00fbcca0, size: 59 bytes, params: 2, frame: 16 return subscriptionPlan == null ? DISCOUNTS[planId] : calculateDiscountPercentageForYearlyPlan(subscriptionPlan, isGift, priceOptions); } function calculateMonthlyPriceEquivalentTotal({subscriptionPlan, isGift, priceOptions}) { // fn#29195, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:53522, offset: 0x00fbccdb, size: 189 bytes, params: 2, frame: 16 var monthlyPrice; isGift = !(isGift === undefined) && isGift; const r5 = priceOptions !== undefined ? priceOptions : {}; let interval = subscriptionPlan.interval; const DAY = SubscriptionIntervalTypes.DAY; if (interval === DAY) { return null; } interval = subscriptionPlan.interval; let MONTH = SubscriptionIntervalTypes.MONTH; if (interval !== MONTH) { monthlyPrice = getMonthlyPrice({subscriptionPlan: subscriptionPlan, isGift: isGift, priceOptions: r5}); if (monthlyPrice == null) { return null; } return monthlyPrice.amount * (subscriptionPlan.interval === SubscriptionIntervalTypes.MONTH ? subscriptionPlan.intervalCount : 12 * subscriptionPlan.intervalCount); } if (subscriptionPlan.intervalCount === 1) { return null; } monthlyPrice = getMonthlyPrice({subscriptionPlan: subscriptionPlan, isGift: isGift, priceOptions: r5}); if (monthlyPrice == null) { return null; } interval = subscriptionPlan.interval; MONTH = SubscriptionIntervalTypes.MONTH; return monthlyPrice.amount * (interval === MONTH ? subscriptionPlan.intervalCount : 12 * subscriptionPlan.intervalCount); } function getPlanDescriptionOnClick() { // fn#29054, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:12757, owner: getPlanDescription.onClick, offset: 0x00fb805d, size: 38 bytes, params: 1, frame: 11 const value = environment.__proto__; (importDefault(3847) /* metro dependency 3847: openURL */)('https://support.discord.com/hc/articles/23082866222871'); } function _fun29060({planId}) { // fn#29060, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:16719, offset: 0x00fb82a1, size: 28 bytes, params: 2, frame: 11 return env0_0.includes(planId); } function _fun29068(a0) { // fn#29068, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:18970, offset: 0x00fb8ff0, size: 11 bytes, params: 2, frame: 1 return a0.amount; } function _fun29069(a0, a1) { // fn#29069, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:18992, offset: 0x00fb8ffb, size: 12 bytes, params: 3, frame: 2 return a1 + a0; } function _fun29094(a0) { // fn#29094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:29124, offset: 0x00fba263, size: 109 bytes, params: 2, frame: 16 var value3; var planId; var planId2; var value4; let value = environment.__proto__; value = _createForOfIteratorHelperLoose_29031(env0_0.items); const value2 = value(); let done = value2.done; if (done) { return a0; } let r3 = value2; loopExit1: while (true) { value3 = r3.value; planId = a0.planId; planId2 = value3.planId; if (planId === planId2) { break loopExit1; } value4 = value(); done = value4.done; if (done) { return a0; } r3 = value4; continue; } const object2 = {}; copyDataProperties(object2, value3, planId); copyDataProperties(object2, a0, planId); return object2; } function _fun29099({planId}) { // fn#29099, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:29732, offset: 0x00fba45d, size: 22 bytes, params: 2, frame: 2 return planId === require; } function _fun29100({quantity}) { // fn#29100, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:29798, offset: 0x00fba473, size: 17 bytes, params: 2, frame: 2 return quantity !== 0; } function _fun29118(a0, a1) { // fn#29118, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:31277, offset: 0x00fba7dd, size: 92 bytes, params: 3, frame: 15 const value = environment.__proto__; const value2 = env1_3(FRACTIONAL_PREMIUM_SKU_INTERVAL_COUNTS[a1], 2); const property = value2[0]; const value3 = 1; const property2 = value2[value3]; const HOUR = FractionalPremiumIntervalTypes.HOUR; return a0 + (HOUR === property || FractionalPremiumIntervalTypes.DAY !== property ? value3 : 24) * property2; } function _fun29130({subscriptionPlanId, parentId, consumed}) { // fn#29130, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:34231, offset: 0x00fbac3f, size: 56 bytes, params: 2, frame: 6 return subscriptionPlanId != null && parentId != null && !consumed && subscriptionPlanId === require; } function _fun29159() { // fn#29159, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:39338, offset: 0x00fbb4cf, size: 103 bytes, params: 1, frame: 15 const object2 = {}; const value = environment.__proto__; const withContextPlanPricesBinding = withContextPlanPrices; const binding = env0_0; object2.priceOptions = withContextPlanPricesBinding(binding, env0_3); object2.planPricesLoading = binding.currency != null && require != null && require.currency !== env0_0.currency && importDefault == null; return object2; } function _fun29187(a0) { // fn#29187, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:51024, offset: 0x00fbc992, size: 227 bytes, params: 2, frame: 20 var value; if (a0 === env0_0) { return a0; } const value3 = SubscriptionPlanStore.get(a0.planId); (importDefault(44) /* metro dependency 44 */)(value3 != null, 'Missing plan'); if (env0_1.interval !== value3.interval) { value = SubscriptionPlanStore.getForSkuAndInterval(value3.skuId, env0_1.interval, env0_1.intervalCount); } else { if (env0_1.intervalCount === value3.intervalCount) { return a0; } value = SubscriptionPlanStore.getForSkuAndInterval(value3.skuId, env0_1.interval, env0_1.intervalCount); } (importDefault(44) /* metro dependency 44 */)(value != null, 'Missing planForInterval'); const object2 = {}; copyDataProperties(object2, a0, undefined); object2['planId'] = value.id; return object2; }