/* Metro module 3817; source: utils/BillingUtils.tsx; dependencies: [5, 482, 3818, 1216, 507, 3824, 2] */ import Module00005 from '../by-id/module-00005.js'; /* Metro dependency 5 */ import SentryUtilsNative from './SentryUtils.native.tsx'; /* Metro dependency 1216 */ import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ConstantsModule from '../external/discord_common/js/shared/Constants.tsx'; /* Metro dependency 482 */ import * as HTTPUtilsModule from '../external/discord_common/js/packages/http-utils/HTTPUtils.tsx'; /* Metro dependency 507 */ function _fun29519(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#29519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3944:6, offset: 0x00fc423d, size: 204 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); (FileImportTrackerModule).fileFinishedImporting('utils/BillingUtils.tsx'); exports.getLocalizedDisplayMonth = function(a0, a1) { var Date = global.Date; var value2 = new Date(); value2.setMonth(a0 - 1); return value2.toLocaleString(a1, {month: 'short'}); }; exports.createGatewayCheckoutContext = function() { return _createGatewayCheckoutContext.apply(this, arguments); }; exports.captureBillingException = captureBillingException; exports.isExpectedHttpClientError = isExpectedHttpClientError; exports.captureBillingMessage = captureBillingMessage; exports.calculateStandardizedUnits = calculateStandardizedUnits; function _createGatewayCheckoutContext() { // fn#29520, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3944:134, offset: 0x00fc4309, size: 48 bytes, params: 1, frame: 14 return Module00005(_fun29522).apply(this, arguments); function* _fun29522(a0) { // fn#29522, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3944:215, offset: 0x00fc4342, size: 118 bytes, params: 2, frame: 14 var paymentGateway; var value3; var value4; var value5; if (false) { return undefined; } value = null; if (value != a0) { paymentGateway = a0.paymentGateway; value3 = environment.__proto__.__proto__; if (paymentGateway !== env2_4.BRAINTREE) { return value; } value4 = env2_0(env2_2[2]); yield value4.collectDeviceData(); value5 = undefined; if (false) { return value5; } return value != value5 ? {braintree_device_data: value5} : value; } return value; } } function captureBillingException(a0, a1) { // fn#29525, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3944:754, offset: 0x00fc4405, size: 110 bytes, params: 3, frame: 17 const value = undefined; const defaultImport = SentryUtilsNative; const captureException = defaultImport.captureException; const object = {}; copyDataProperties(object, a1, undefined); const object2 = {}; const value2 = a1 == null; copyDataProperties(object2, value2 ? value : a1.tags, value2); object2['app_context'] = 'billing'; object['tags'] = object2; Reflect.apply(captureException, defaultImport, [a0, object]); return value; } function isExpectedHttpClientError(a0) { // fn#29526, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3944:911, offset: 0x00fc4473, size: 156 bytes, params: 2, frame: 14 var r1; const HTTPResponseError = (HTTPUtilsModule).HTTPResponseError; let r0 = a0 instanceof HTTPResponseError && a0.status >= 400 && a0.status < 500; if (!r0) { r1 = a0 instanceof (importDefault(3824) /* metro dependency 3824: BillingError */) && a0.status != null; r1 = r1 && a0.status >= 400; r1 = r1 && a0.status < 500; r0 = r1; } return r0; } function captureBillingMessage(a0, a1) { // fn#29527, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3944:1117, offset: 0x00fc450f, size: 110 bytes, params: 3, frame: 17 const value = undefined; const defaultImport = SentryUtilsNative; const captureMessage = defaultImport.captureMessage; const object = {}; copyDataProperties(object, a1, undefined); const object2 = {}; const value2 = a1 == null; copyDataProperties(object2, value2 ? value : a1.tags, value2); object2['app_context'] = 'billing'; object['tags'] = object2; Reflect.apply(captureMessage, defaultImport, [a0, object]); return value; } } function calculateStandardizedUnits(a0, a1) { // fn#29528, offset: 0x00fc457d, size: 182 bytes, params: 3, frame: 6 let value = a0 === 'P1M'; if ((value && a1 === 'P1Y') === true) { return 12; } if ((value && a1 === 'P6M') === true) { return 6; } if ((value && a1 === 'P3M') === true) { return 3; } value = a0 === 'P3M'; if ((value && a1 === 'P1Y') === true) { return 4; } if ((value && a1 === 'P6M') === true) { return 2; } if ((a0 === 'P6M' && a1 === 'P1Y') === true) { return 2; } return 1; } global.__d(_fun29519, 3817, [5, 482, 3818, 1216, 507, 3824, 2]) /* metro module 3817, dependencies: [5, 482, 3818, 1216, 507, 3824, 2] */;