decord/source/modules/virtual_currency/checkout/OrbCheckoutUtils.tsx

101 lines
4.7 KiB
TypeScript
Raw Normal View History

2026-07-24 07:16:23 +00:00
// Module ID: 5623
2026-07-27 11:26:19 +00:00
// Function ID: 48008
2026-07-20 16:05:17 +00:00
// Name: getOrbPriceFromPrices
2026-07-25 08:10:48 +00:00
// Dependencies: [653, 655, 5624, 1212, 5625, 3799, 2]
2026-07-20 16:05:17 +00:00
// Exports: getOrbCheckoutDisclaimerMessage, getOrbPriceFromPrices, resolveOrbCheckoutErrorMessage
2026-07-24 07:16:23 +00:00
// Module 5623 (getOrbPriceFromPrices)
2026-07-23 10:11:24 +00:00
import ME from "ME";
import { EXTERNAL_PRODUCT_SKU_IDS } from "items";
import { ConstraintReasonCode } from "ConstraintReasonCode";
let closure_2;
let closure_3;
let closure_4;
({ CurrencyCodes: closure_2, MarketingURLs: closure_3, PriceSetAssignmentPurchaseTypes: closure_4 } = ME);
const result = require("ConstraintReasonCode").fileFinishedImporting("modules/virtual_currency/checkout/OrbCheckoutUtils.tsx");
2026-07-20 16:05:17 +00:00
export const getOrbPriceFromPrices = function getOrbPriceFromPrices(prices, memo) {
if (memo) {
if (null != prices[closure_4.PREMIUM_TIER_2]) {
let tmp3 = prices[closure_4.PREMIUM_TIER_2];
}
let substr;
if (null != tmp3) {
const countryPrices = tmp3.countryPrices;
if (null != countryPrices) {
prices = countryPrices.prices;
if (null != prices) {
substr = prices.slice(0, 2);
}
}
}
if (null == substr) {
substr = [];
}
2026-07-23 10:11:24 +00:00
const found = substr.find((currency) => currency.currency === outer1_2.DISCORD_ORB);
2026-07-20 16:05:17 +00:00
let tmp7 = null;
if (null != found) {
tmp7 = found;
}
return tmp7;
}
tmp3 = prices[closure_4.DEFAULT];
};
export const getOrbCheckoutDisclaimerMessage = function getOrbCheckoutDisclaimerMessage(skuId) {
2026-07-23 10:11:24 +00:00
const intl = require(1212) /* getSystemLocale */.intl;
2026-07-20 16:05:17 +00:00
const obj = {};
2026-07-23 10:11:24 +00:00
const intl2 = require(1212) /* getSystemLocale */.intl;
obj.buyButtonLabel = intl2.string(require(1212) /* getSystemLocale */.t["zLch/S"]);
2026-07-20 16:05:17 +00:00
({ PAID_TERMS: obj.paidServiceTermURL, PAID_TERMS_VIRTUAL_GOODS: obj.virtualGoodsURL } = closure_3);
2026-07-23 10:11:24 +00:00
const intl3 = require(1212) /* getSystemLocale */.intl;
let stringResult = intl3.string(require(1212) /* getSystemLocale */.t["Sxed/G"]);
2026-07-20 16:05:17 +00:00
if (skuId === EXTERNAL_PRODUCT_SKU_IDS.ORB_PROFILE_BADGE) {
2026-07-23 10:11:24 +00:00
const intl5 = require(1212) /* getSystemLocale */.intl;
stringResult = intl5.string(require(1212) /* getSystemLocale */.t.APcKRo);
2026-07-20 16:05:17 +00:00
} else if (skuId === EXTERNAL_PRODUCT_SKU_IDS.FRACTIONAL_PREMIUM) {
2026-07-23 10:11:24 +00:00
const intl4 = require(1212) /* getSystemLocale */.intl;
stringResult = intl4.string(require(1212) /* getSystemLocale */.t.FhJ74j);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const items = [intl.format(require(1212) /* getSystemLocale */.t["5qdUrO"], obj), " ", stringResult];
2026-07-20 16:05:17 +00:00
return items;
};
export const resolveOrbCheckoutErrorMessage = function resolveOrbCheckoutErrorMessage(code) {
if (null == code) {
return null;
} else {
2026-07-24 07:16:23 +00:00
if (!(code instanceof require(5625) /* _callSuper */.OrderSigningFailedWithConstraintsError)) {
if (code instanceof require(5625) /* _callSuper */.OrderProcessingPendingError) {
2026-07-23 10:11:24 +00:00
const intl5 = require(1212) /* getSystemLocale */.intl;
let stringResult = intl5.string(require(1212) /* getSystemLocale */.t["2BmwgV"]);
2026-07-25 08:10:48 +00:00
} else if (code.code === require(3799) /* _isNativeReflectConstruct */.ErrorCodes.VIRTUAL_CURRENCY_INSUFFICIENT_BALANCE) {
2026-07-23 10:11:24 +00:00
const intl4 = require(1212) /* getSystemLocale */.intl;
stringResult = intl4.string(require(1212) /* getSystemLocale */.t.keFvXM);
2026-07-25 08:10:48 +00:00
} else if (code.code === require(3799) /* _isNativeReflectConstruct */.ErrorCodes.ALREADY_PURCHASED) {
2026-07-23 10:11:24 +00:00
const intl3 = require(1212) /* getSystemLocale */.intl;
stringResult = intl3.string(require(1212) /* getSystemLocale */.t.m371Mx);
2026-07-25 08:10:48 +00:00
} else if (code.code === require(3799) /* _isNativeReflectConstruct */.ErrorCodes.BILLING_ORDER_NOT_SIGNABLE) {
2026-07-23 10:11:24 +00:00
const intl2 = require(1212) /* getSystemLocale */.intl;
stringResult = intl2.string(require(1212) /* getSystemLocale */.t.ZHgEG7);
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
const intl = require(1212) /* getSystemLocale */.intl;
stringResult = intl.string(require(1212) /* getSystemLocale */.t.fqJZ11);
2026-07-20 16:05:17 +00:00
}
}
if (ConstraintReasonCode.INSUFFICIENT_ORB_BALANCE === arg1) {
2026-07-23 10:11:24 +00:00
const intl9 = require(1212) /* getSystemLocale */.intl;
let stringResult1 = intl9.string(require(1212) /* getSystemLocale */.t.keFvXM);
2026-07-20 16:05:17 +00:00
} else {
if (ConstraintReasonCode.SKU_ALREADY_OWNED === arg1) {
2026-07-23 10:11:24 +00:00
const intl8 = require(1212) /* getSystemLocale */.intl;
stringResult1 = intl8.string(require(1212) /* getSystemLocale */.t.m371Mx);
2026-07-20 16:05:17 +00:00
} else if (ConstraintReasonCode.BUNDLE_PARTIALLY_OWNED !== arg1) {
2026-07-23 10:11:24 +00:00
const intl6 = require(1212) /* getSystemLocale */.intl;
stringResult1 = intl6.string(require(1212) /* getSystemLocale */.t.fqJZ11);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const intl7 = require(1212) /* getSystemLocale */.intl;
stringResult1 = intl7.string(require(1212) /* getSystemLocale */.t.v9oC0p);
2026-07-20 16:05:17 +00:00
}
}
};