decord/source/modules/premium/native/renderPremiumButtonText.tsx

118 lines
4.1 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 12718
// Function ID: 12719
2026-07-20 16:05:17 +00:00
// Name: PremiumText
2026-08-05 07:35:12 +00:00
// Dependencies: [19, 17, 1876, 21, 4255, 4099, 712, 3901, 1236, 1297, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-05 07:35:12 +00:00
// Module 12718 (PremiumText)
2026-07-29 08:29:29 +00:00
import "noop";
2026-07-23 10:11:24 +00:00
import { View } from "get ActivityIndicator";
import GuildFeatures from "GuildFeatures";
import jsxProd from "jsxProd";
2026-07-29 08:29:29 +00:00
import createCacheKey from "createCacheKey";
import hexToRgba from "hexToRgba";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c4;
let c5;
2026-07-23 10:11:24 +00:00
let closure_6;
2026-07-29 08:29:29 +00:00
let error;
let metroImportAll;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function PremiumText(basePlanId) {
let isCurrentPlan;
let isGift;
let product;
let style;
let text;
({ style, isCurrentPlan, isGift, product, text } = basePlanId);
2026-07-29 08:29:29 +00:00
const tmp = createCacheKey();
2026-08-05 07:35:12 +00:00
let obj = importDefault(3901);
2026-07-20 16:05:17 +00:00
const intervalType = obj.getInterval(basePlanId.basePlanId).intervalType;
let combined = null;
if (intervalType === constants.YEAR) {
combined = null;
if (!isCurrentPlan) {
const _HermesInternal = HermesInternal;
combined = "-" + closure_4 + "%";
}
}
2026-07-29 08:29:29 +00:00
if (text != null) {
obj = { style: null, children: null };
obj[0] = tmp.premiumText;
obj = { style: null, numberOfLines: 1, accessibilityLabel: null, children: null };
obj[0] = style;
const intl3 = require(1236) /* getSystemLocale */.intl;
2026-07-20 16:05:17 +00:00
let title;
2026-07-29 08:29:29 +00:00
if (product != null) {
2026-07-20 16:05:17 +00:00
title = product.title;
}
2026-07-29 08:29:29 +00:00
const obj1 = { product: null, description: null };
obj1[0] = title;
obj1[1] = text;
obj[2] = intl3.formatToPlainString(require(1236) /* getSystemLocale */.t.E0lS2r, obj1);
obj[3] = text;
const items = [closure_7(require(1297) /* Button */.LegacyText, obj), ];
let tmp16Result = null;
2026-07-20 16:05:17 +00:00
if (null != combined) {
2026-07-29 08:29:29 +00:00
const obj2 = { style: null, children: null };
obj2[0] = tmp.discount;
const obj3 = { style: null, numberOfLines: 1, children: null };
obj3[0] = style;
obj3[2] = combined;
obj2[1] = tmp16(require(1297) /* Button */.LegacyText, obj3);
tmp16Result = tmp16(tmp15, obj2);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items[1] = tmp16Result;
obj[1] = items;
2026-07-24 07:16:23 +00:00
return closure_8(View, obj);
2026-07-20 16:05:17 +00:00
} else {
let priceString;
2026-07-29 08:29:29 +00:00
if (product != null) {
2026-07-20 16:05:17 +00:00
priceString = product.priceString;
}
2026-07-29 08:29:29 +00:00
if (priceString == null) {
2026-07-24 07:16:23 +00:00
priceString = closure_5;
2026-07-20 16:05:17 +00:00
}
if (intervalType !== constants.MONTH) {
2026-07-29 08:29:29 +00:00
const intl = require(1236) /* getSystemLocale */.intl;
const formatToPlainString = intl.formatToPlainString;
let t = require(1236) /* getSystemLocale */.t;
2026-07-20 16:05:17 +00:00
if (isGift) {
2026-07-29 08:29:29 +00:00
const obj4 = { price: null };
obj4[0] = priceString;
let formatToPlainStringResult = formatToPlainString(t.rm53bV, obj4);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const obj5 = { price: null };
obj5[0] = priceString;
formatToPlainStringResult = formatToPlainString(isCurrentPlan ? t.dFbQCa : t["rS8FA+"], obj5);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
const intl2 = require(1236) /* getSystemLocale */.intl;
const formatToPlainString2 = intl2.formatToPlainString;
t = require(1236) /* getSystemLocale */.t;
2026-07-20 16:05:17 +00:00
if (isGift) {
2026-07-29 08:29:29 +00:00
t = { price: null };
t[0] = priceString;
let formatToPlainString2Result = formatToPlainString2(t.FIjgMp, t);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const obj6 = { price: null };
obj6[0] = priceString;
formatToPlainString2Result = formatToPlainString2(isCurrentPlan ? t.V6iX43 : t.AbOLNu, obj6);
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
({ PREMIUM_YEARLY_DISCOUNT_PERCENT: c4, PRICE_PLACEHOLDER: c5, SubscriptionIntervalTypes: closure_6 } = GuildFeatures);
({ jsx: error, jsxs: metroImportAll } = jsxProd);
createCacheKey = { discount: null, premiumText: null };
createCacheKey = { borderWidth: 1, borderColor: null, borderRadius: 2, marginLeft: 4, paddingHorizontal: 2 };
createCacheKey[1] = hexToRgba.hexWithOpacity(require("Themes").unsafe_rawColors.WHITE, 0.3);
createCacheKey[0] = createCacheKey;
createCacheKey[1] = { flexDirection: "row" };
createCacheKey = createCacheKey.createStyles(createCacheKey);
2026-07-23 10:11:24 +00:00
const result = require("GuildFeatures").fileFinishedImporting("modules/premium/native/renderPremiumButtonText.tsx");
2026-07-20 16:05:17 +00:00
export default function renderPremiumText(arg0) {
const merged = Object.assign(arg0);
return callback(PremiumText, {});
};