/* Metro module 7549; source: components_native/premium/PremiumBillingInfo.tsx; dependencies: [57, 31, 27, 661, 33, 4501, 697, 3815, 6766, 1244, 3802, 7545, 6771, 6789, 7022, 4573, 2] */ import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */ import Native from '../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */ import AnalyticsLocation from '../../modules/app_analytics/AnalyticsLocation.tsx'; /* Metro dependency 6789 */ import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactNativeModule from '../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */ import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */ import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */ import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */ import * as TextModule from '../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */ import * as PremiumManagementUtilsModule from '../../modules/premium/native/utils/PremiumManagementUtils.tsx'; /* Metro dependency 7022 */ import * as PremiumSubscriptionInvoiceModule from '../../modules/premium/PremiumSubscriptionInvoice.tsx'; /* Metro dependency 7545 */ function _fun60690(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#60690, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7727:6, offset: 0x0170a5ad, size: 351 bytes, params: 8, frame: 25 const env0_0 = require; const GoogleManagementLink2 = GoogleManagementLink; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); ReactModule; let value = ConstantsModule; const env0_5 = value.SubscriptionStatusTypes; const USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING = value.USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING; value = require(33) /* metro dependency 33 */; const env0_6 = value.jsx; const env0_7 = value.jsxs; value = require(4501) /* metro dependency 4501: createStyles */; const createStyles = value.createStyles; object = {}; object.title = {paddingHorizontal: USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING}; object.externalSubtext = {marginTop: 8, paddingHorizontal: USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING}; const BACKGROUND_SURFACE_HIGH = (Native).colors.BACKGROUND_SURFACE_HIGH; object.billingContainer = {'backgroundColor': null, 'padding': 16, 'marginTop': 8, backgroundColor: BACKGROUND_SURFACE_HIGH}; object.billingRenewalInfo = {marginTop: 4}; object.billingManageGoogle = {marginTop: 8}; const env0_8 = Reflect.apply(createStyles, value, [object]); (FileImportTrackerModule).fileFinishedImporting('components_native/premium/PremiumBillingInfo.tsx'); exports.default = PremiumBillingInfo; exports.GoogleManagementLink = GoogleManagementLink2; function GoogleManagementLink({style, subscription}) { // fn#60691, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7727:511, offset: 0x0170a70c, size: 232 bytes, params: 2, frame: 22 var r0; var TextWithIOSLinkWorkaround; var intl; var format; var property; var value; if ((require(3815) /* metro dependency 3815: BillingPlatformUtils */).isGooglePlayBillingSupported()) { if (subscription.isPurchasedViaGoogle) { TextWithIOSLinkWorkaround = (require(6766) /* metro dependency 6766: TextWithIOSLinkWorkaround */).TextWithIOSLinkWorkaround; var textWithIOSLinkWorkaroundProps = {'style': null, 'variant': 'text-sm/medium', 'color': 'text-link', style: [style]}; intl = (require(1244) /* metro dependency 1244: indexNative */).intl; format = intl.format; property = (require(1244) /* metro dependency 1244: indexNative */).t['9NPc+O']; value = require(3802) /* metro dependency 3802: PremiumUtils */; value = ( {Reflect.apply(format, intl, [property, {onClick: value.getExternalSubscriptionMethodUrl(subscription.paymentGateway, 'SUBSCRIPTION_MANAGEMENT')}])} ); r0 = value; } else { r0 = null; } } else { r0 = null; } return r0; } function PremiumBillingInfo({style, subscription}) { // fn#60692, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7727:886, offset: 0x0170a7f4, size: 700 bytes, params: 2, frame: 32 const styles = useStyles(); const useFetchSubscriptionInvoicePreview = PremiumSubscriptionInvoiceModule.useFetchSubscriptionInvoicePreview; const object = {'subscriptionId': null, 'renewal': true, 'applyEntitlements': true}; object.subscriptionId = subscription.id; object.analyticsLocations = (importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)(); const PREMIUM_BILLING_INFO = (AnalyticsLocation).PREMIUM_BILLING_INFO; object.analyticsLocation = PREMIUM_BILLING_INFO; const value2 = Reflect.apply(useFetchSubscriptionInvoicePreview, PremiumSubscriptionInvoiceModule, [object]); const property = Module00057(value2, 1)[0]; const useGetSubscriptionInvoice = PremiumSubscriptionInvoiceModule.useGetSubscriptionInvoice; const status = subscription.status; const PAST_DUE = SubscriptionStatusTypes.PAST_DUE; const property2 = Module00057(Reflect.apply(useGetSubscriptionInvoice, PremiumSubscriptionInvoiceModule, [{subscriptionId: subscription.id, preventFetch: status !== PAST_DUE}]), 1)[0]; if (property == null) { return null; } const externalManagementMessage = (PremiumManagementUtilsModule).getExternalManagementMessage(subscription, {shouldAllowExternalManagement: true}); const Text = (TextModule).Text; const intl = (IndexNativeModule).intl; let string = intl.string; const Sb6wI1 = (IndexNativeModule).t.Sb6wI1; const items3 = [ {Reflect.apply(string, intl, [Sb6wI1])} , ]; string = intl.string; const KXQjfc = (IndexNativeModule).t.KXQjfc; const items2 = [ {Reflect.apply(string, intl, [KXQjfc])} , ]; items2[1] = ( {(require(3802) /* metro dependency 3802: PremiumUtils */).getBillingInformationString(subscription, property, property2)} ); items2[2] = ; items3[1] = ( {items2} ); items3[2] = ( externalManagementMessage != null ? ( {externalManagementMessage} ) : null ); return ( {items3} ); } } global.__d(_fun60690, 7549, [57, 31, 27, 661, 33, 4501, 697, 3815, 6766, 1244, 3802, 7545, 6771, 6789, 7022, 4573, 2]) /* metro module 7549, dependencies: [57, 31, 27, 661, 33, 4501, 697, 3815, 6766, 1244, 3802, 7545, 6771, 6789, 7022, 4573, 2] */;