/* Metro module 3817; source: utils/BillingUtils.tsx; dependencies: [5, 482, 3818, 1216, 507, 3824, 2] */ 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}); const env0_3 = importDefault(5) /* metro dependency 5 */; const env0_4 = (require(482) /* metro dependency 482: Constants */).PaymentGateways; (require(2) /* metro dependency 2 */).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 env0_3(_fun29522).apply(this, arguments); } 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 = importDefault(1216) /* metro dependency 1216: SentryUtilsNative */; const captureException = defaultImport.captureException; const object3 = {}; copyDataProperties(object3, a1, undefined); const object4 = {}; const value2 = a1 == null; copyDataProperties(object4, value2 ? value : a1.tags, value2); object4['app_context'] = 'billing'; object3['tags'] = object4; Reflect.apply(captureException, defaultImport, [a0, object3]); 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 = (require(507) /* metro dependency 507: HTTPUtils */).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 = importDefault(1216) /* metro dependency 1216: SentryUtilsNative */; const captureMessage = defaultImport.captureMessage; const object3 = {}; copyDataProperties(object3, a1, undefined); const object4 = {}; const value2 = a1 == null; copyDataProperties(object4, value2 ? value : a1.tags, value2); object4['app_context'] = 'billing'; object3['tags'] = object4; Reflect.apply(captureMessage, defaultImport, [a0, object3]); 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; } 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; }