199 lines
11 KiB
TypeScript
199 lines
11 KiB
TypeScript
/* Metro module 7023; source: modules/payments/native/utils/BillingStandaloneNativeUtils.tsx; dependencies: [4095, 661, 3, 4247, 7024, 1581, 676, 3853, 2] */
|
|
import Logger from '../../../debug/Logger.tsx'; /* Metro dependency 3 */
|
|
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as MetaQuestUtilsAndroidModule from '../../../device/MetaQuestUtils.android.tsx'; /* Metro dependency 1581 */
|
|
import * as PaymentConstantsModule from '../../PaymentConstants.tsx'; /* Metro dependency 4095 */
|
|
import * as BillingStandaloneUtilsModule from '../../utils/BillingStandaloneUtils.tsx'; /* Metro dependency 7024 */
|
|
|
|
function _fun55652(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#55652, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7201:6, offset: 0x013ad0c0, size: 217 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = Logger;
|
|
value = new value('BillingStandaloneNativeUtils');
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/payments/native/utils/BillingStandaloneNativeUtils.tsx');
|
|
exports.goToStandalonePremiumCheckoutFromMobileApp = goToStandalonePremiumCheckoutFromMobileApp;
|
|
exports.goToStandaloneNitroManagementFromMobileApp = goToStandaloneNitroManagementFromMobileApp;
|
|
exports.goToStandaloneGuildBoostCheckoutFromMobileApp = goToStandaloneGuildBoostCheckoutFromMobileApp;
|
|
function emitMWRCSentryErrorOnFailure(a0, a1, a2) { // fn#55653, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7201:220, offset: 0x013ad199, size: 332 bytes, params: 4, frame: 23
|
|
var r4;
|
|
var r5;
|
|
var r72;
|
|
var item3;
|
|
var value3;
|
|
var value4;
|
|
var binding;
|
|
var error;
|
|
var value5;
|
|
var property;
|
|
var moduleValue;
|
|
var captureMobileWebRedirectCheckoutSentryError;
|
|
var Error;
|
|
var prototype;
|
|
var value6;
|
|
var value7;
|
|
var object;
|
|
var moduleValue2;
|
|
var value8;
|
|
var value9;
|
|
const iterator = a0[Symbol.iterator]();
|
|
const iterator2 = iterator.next;
|
|
let item2 = Reflect.apply(iterator2, iterator, []);
|
|
let item = item2.value;
|
|
item2 = item2.done ? undefined : iterator;
|
|
const value = undefined;
|
|
const value2 = item2 === value;
|
|
const r7 = value2 ? value : item;
|
|
if (value2) {
|
|
r4 = item2;
|
|
r5 = value2;
|
|
r72 = value;
|
|
} else {
|
|
item3 = Reflect.apply(iterator2, item2, []);
|
|
item = item3.value;
|
|
item3 = item3.done ? undefined : item2;
|
|
value3 = item3 === value;
|
|
if (value3) {
|
|
r4 = item3;
|
|
r5 = value3;
|
|
r72 = value;
|
|
} else {
|
|
r4 = item3;
|
|
r5 = value3;
|
|
r72 = item;
|
|
}
|
|
}
|
|
if (!r5) {
|
|
r4.return();
|
|
}
|
|
const object3 = {destination_url: r72, load_id: a2};
|
|
try {
|
|
value4 = environment;
|
|
binding = env0_5;
|
|
error = binding.error;
|
|
value5 = 'Failed to open mobile web popout to ' + r72 + ', error response: ';
|
|
Reflect.apply(error, binding, [value5, r7]);
|
|
property = dependencyMap[3];
|
|
moduleValue = require(property);
|
|
captureMobileWebRedirectCheckoutSentryError = moduleValue.captureMobileWebRedirectCheckoutSentryError;
|
|
Error = global.Error;
|
|
prototype = Error.prototype;
|
|
value6 = Object.create(prototype, {constructor: {value: Error}});
|
|
error = new Error('Mobile web redirect checkout mobile app to web popout failed');
|
|
value7 = error instanceof Object ? error : value6;
|
|
object = {failure_response: r7};
|
|
copyDataProperties(object, object3, undefined);
|
|
Reflect.apply(captureMobileWebRedirectCheckoutSentryError, moduleValue, [value7, a1, {extra: object}]);
|
|
} catch (error) {
|
|
moduleValue2 = require(dependencyMap[3]);
|
|
captureMobileWebRedirectCheckoutSentryError = moduleValue2.captureMobileWebRedirectCheckoutSentryError;
|
|
Error = global.Error;
|
|
prototype = Error.prototype;
|
|
value8 = Object.create(prototype, {constructor: {value: Error}});
|
|
error = new Error('Mobile web redirect checkout mobile app to web popout failed');
|
|
value9 = error instanceof Object ? error : value8;
|
|
Reflect.apply(captureMobileWebRedirectCheckoutSentryError, moduleValue2, [value9, a1, {extra: object3}]);
|
|
}
|
|
return value;
|
|
}
|
|
|
|
function goToStandalonePremiumCheckoutFromMobileApp(a0, a1, a2, a3) { // fn#55654, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7201:744, offset: 0x013ad2e5, size: 189 bytes, params: 5, frame: 19
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const env0_2 = a2;
|
|
const env0_3 = a3;
|
|
const goToStandalonePremiumCheckout = BillingStandaloneUtilsModule.goToStandalonePremiumCheckout;
|
|
const isMetaQuest2 = (MetaQuestUtilsAndroidModule).isMetaQuest();
|
|
const object = {};
|
|
copyDataProperties(object, a1, undefined);
|
|
if (isMetaQuest2) {
|
|
object['flowType'] = CustomCheckoutFlow.META_QUEST_WEB_REDIRECT_CHECKOUT;
|
|
} else {
|
|
object['deepLinkType'] = (require(676) /* metro dependency 676: ConstantsIOS */).LinkingTypes.MOBILE_WEB_REDIRECT_CHECKOUT;
|
|
}
|
|
return Reflect.apply(goToStandalonePremiumCheckout, BillingStandaloneUtilsModule, [object, _fun55655, _fun55656]);
|
|
function _fun55655(a0, a1) { // fn#55655, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7201:994, offset: 0x013ad3a2, size: 96 bytes, params: 3, frame: 15
|
|
const searchParams = a1.searchParams;
|
|
searchParams.append('handoff_token', a0.body.handoff_token);
|
|
let value = environment.__proto__;
|
|
value = importDefault(3853) /* metro dependency 3853: Linking */;
|
|
value.openURLExternally(a1.href);
|
|
importDefault(a0, a1);
|
|
}
|
|
|
|
function _fun55656(a0) { // fn#55656, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7201:1106, offset: 0x013ad402, size: 73 bytes, params: 2, frame: 17
|
|
const value = copyRestArgs(0, undefined);
|
|
const emitMWRCSentryErrorOnFailureBinding = emitMWRCSentryErrorOnFailure;
|
|
emitMWRCSentryErrorOnFailureBinding(value, env0_0, require.loadId);
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, emitMWRCSentryErrorOnFailureBinding);
|
|
apply(importAll, items2, undefined, emitMWRCSentryErrorOnFailureBinding);
|
|
}
|
|
|
|
}
|
|
|
|
function goToStandaloneNitroManagementFromMobileApp(a0, {loadId}, a2, a3) { // fn#55657, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7201:1216, offset: 0x013ad44b, size: 183 bytes, params: 5, frame: 21
|
|
const env0_0 = a0;
|
|
const env0_2 = a2;
|
|
const env0_3 = a3;
|
|
return BillingStandaloneUtilsModule.goToBillingStandalonePageWithHandoff((require(1581) /* metro dependency 1581: MetaQuestUtilsAndroid */).isMetaQuest() ? Routes.BILLING_MANAGE_SUBSCRIPTION_WITH_FLOW_TYPE(CustomCheckoutFlow.META_QUEST_WEB_REDIRECT_CHECKOUT,
|
|
loadId) : Routes.BILLING_MANAGE_SUBSCRIPTION_WITH_DEEP_LINK((require(676) /* metro dependency 676: ConstantsIOS */).LinkingTypes.MOBILE_WEB_REDIRECT_CHECKOUT,
|
|
loadId), _fun55658, _fun55659);
|
|
function _fun55658(a0, a1) { // fn#55658, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7201:1542, offset: 0x013ad3a2, size: 96 bytes, params: 3, frame: 15
|
|
const searchParams = a1.searchParams;
|
|
searchParams.append('handoff_token', a0.body.handoff_token);
|
|
let value = environment.__proto__;
|
|
value = importDefault(3853) /* metro dependency 3853: Linking */;
|
|
value.openURLExternally(a1.href);
|
|
importDefault(a0, a1);
|
|
}
|
|
|
|
function _fun55659(a0) { // fn#55659, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7201:1654, offset: 0x013ad502, size: 67 bytes, params: 2, frame: 17
|
|
const value = copyRestArgs(0, undefined);
|
|
const emitMWRCSentryErrorOnFailureBinding = emitMWRCSentryErrorOnFailure;
|
|
emitMWRCSentryErrorOnFailureBinding(value, env0_0, loadId);
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, emitMWRCSentryErrorOnFailureBinding);
|
|
apply(importAll, items2, undefined, emitMWRCSentryErrorOnFailureBinding);
|
|
}
|
|
|
|
}
|
|
|
|
function goToStandaloneGuildBoostCheckoutFromMobileApp(a0, a1, a2, a3, a4) { // fn#55660, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7201:1760, offset: 0x013ad545, size: 218 bytes, params: 6, frame: 20
|
|
const env0_0 = a0;
|
|
const env0_1 = a2;
|
|
const env0_2 = a3;
|
|
const env0_3 = a4;
|
|
const value2 = undefined;
|
|
const MOBILE_WEB_REDIRECT_CHECKOUT = MetaQuestUtilsAndroidModule.isMetaQuest() ? value2 : (require(676) /* metro dependency 676: ConstantsIOS */).LinkingTypes.MOBILE_WEB_REDIRECT_CHECKOUT;
|
|
const META_QUEST_WEB_REDIRECT_CHECKOUT = MetaQuestUtilsAndroidModule.isMetaQuest() ? CustomCheckoutFlow.META_QUEST_WEB_REDIRECT_CHECKOUT : value2;
|
|
return BillingStandaloneUtilsModule.goToBillingStandalonePageWithHandoff(Routes.BILLING_STANDALONE_GUILD_BOOST_CHECKOUT_PAGE(a1,
|
|
MOBILE_WEB_REDIRECT_CHECKOUT, a2, META_QUEST_WEB_REDIRECT_CHECKOUT), _fun55661, _fun55662);
|
|
function _fun55661(a0, a1) { // fn#55661, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7201:2086, offset: 0x013ad3a2, size: 96 bytes, params: 3, frame: 15
|
|
const searchParams = a1.searchParams;
|
|
searchParams.append('handoff_token', a0.body.handoff_token);
|
|
let value = environment.__proto__;
|
|
value = importDefault(3853) /* metro dependency 3853: Linking */;
|
|
value.openURLExternally(a1.href);
|
|
importAll(a0, a1);
|
|
}
|
|
|
|
function _fun55662(a0) { // fn#55662, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7201:2198, offset: 0x013ad502, size: 67 bytes, params: 2, frame: 17
|
|
const value = copyRestArgs(0, undefined);
|
|
const emitMWRCSentryErrorOnFailureBinding = emitMWRCSentryErrorOnFailure;
|
|
let binding = env0_0;
|
|
emitMWRCSentryErrorOnFailureBinding(value, binding, importDefault);
|
|
binding = env0_3;
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, emitMWRCSentryErrorOnFailureBinding);
|
|
apply(binding, items2, undefined, emitMWRCSentryErrorOnFailureBinding);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun55652, 7023, [4095, 661, 3, 4247, 7024, 1581, 676, 3853,
|
|
2]) /* metro module 7023, dependencies: [4095, 661, 3, 4247, 7024, 1581, 676, 3853, 2] */;
|