decord/source/modules/premium/native/gifting/PremiumGiftDuration.tsx

137 lines
5.7 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 10003
// Function ID: 10004
2026-07-20 16:05:17 +00:00
// Name: PremiumGiftDurationButton
2026-08-05 07:35:12 +00:00
// Dependencies: [19, 17, 1876, 21, 4255, 712, 9500, 5300, 7752, 9930, 3973, 4251, 1236, 9502, 5583, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-05 07:35:12 +00:00
// Module 10003 (PremiumGiftDurationButton)
2026-07-29 08:29:29 +00:00
import noop from "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 createCacheKey from "createCacheKey";
2026-07-23 10:11:24 +00:00
2026-07-20 16:05:17 +00:00
let SubscriptionIntervalTypes;
2026-07-29 08:29:29 +00:00
let c5;
let error;
let metroImportAll;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function PremiumGiftDurationButton(arg0) {
let accessibilityRole;
let accessibilityState;
let planInterval;
let selected;
({ selected, planInterval } = arg0);
2026-07-29 08:29:29 +00:00
let setPlanInterval;
2026-08-05 07:35:12 +00:00
let obj = planInterval(9500);
2026-07-20 16:05:17 +00:00
const nativeGiftContext = obj.useNativeGiftContext();
2026-07-29 08:29:29 +00:00
setPlanInterval = nativeGiftContext.setPlanInterval;
const tmp4 = createCacheKey();
2026-07-20 16:05:17 +00:00
if (selected) {
2026-08-05 07:35:12 +00:00
let RowButton = tmp(5300).TableRow;
2026-07-20 16:05:17 +00:00
} else {
2026-08-05 07:35:12 +00:00
RowButton = tmp(7752).RowButton;
2026-07-20 16:05:17 +00:00
}
let combined = null;
if (planInterval === SubscriptionIntervalTypes.YEAR) {
const _HermesInternal = HermesInternal;
combined = "" + closure_5 + "%";
}
2026-07-29 08:29:29 +00:00
const tmp5 = SubscriptionIntervalTypes;
2026-08-05 07:35:12 +00:00
const tmp9 = setPlanInterval(9930)(nativeGiftContext.premiumType, planInterval);
const radioA11yNative = planInterval(3973).useRadioA11yNative({ selected });
2026-07-29 08:29:29 +00:00
const items = [tmp4.container, ];
2026-07-20 16:05:17 +00:00
({ accessibilityRole, accessibilityState } = radioA11yNative);
if (selected) {
2026-07-29 08:29:29 +00:00
selected = tmp4.containerSelected;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { style: items, children: null };
2026-07-20 16:05:17 +00:00
items[1] = selected;
2026-07-29 08:29:29 +00:00
obj = { style: tmp4.labelContainer, children: null };
if (planInterval === tmp5.MONTH) {
const intl2 = tmp(1236).intl;
let stringResult = intl2.string(tmp(1236).t.Mh9bTt);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const intl = tmp(1236).intl;
stringResult = intl.string(tmp(1236).t.DRgqMo);
2026-07-20 16:05:17 +00:00
}
2026-08-05 07:35:12 +00:00
const items1 = [closure_7(planInterval(4251).Text, { variant: "text-md/semibold", children: stringResult }), ];
2026-07-29 08:29:29 +00:00
let tmp11Result = null != combined;
if (tmp11Result) {
const obj1 = { style: null, children: null };
obj1[0] = tmp4.labelPromo;
const obj2 = { variant: "text-md/bold", color: "text-overlay-light", children: null };
const intl3 = tmp(1236).intl;
const obj3 = { discount: null };
obj3[0] = combined;
obj2[2] = intl3.formatToPlainString(tmp(1236).t.IAybsG, obj3).toUpperCase();
2026-08-05 07:35:12 +00:00
obj1[1] = tmp11(tmp(4251).Text, obj2);
2026-07-29 08:29:29 +00:00
tmp11Result = tmp11(tmp12, obj1);
const str3 = intl3.formatToPlainString(tmp(1236).t.IAybsG, obj3);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const tmp13 = closure_8;
2026-08-05 07:35:12 +00:00
const tmpResult = planInterval(3973);
2026-07-29 08:29:29 +00:00
items1[1] = tmp11Result;
obj[1] = items1;
obj[1] = closure_7(RowButton, {
label: closure_8(View, obj),
2026-08-05 07:35:12 +00:00
trailing: closure_7(planInterval(4251).Text, { variant: "text-md/semibold", children: tmp9 }),
2026-07-29 08:29:29 +00:00
onPress() {
setPlanInterval(planInterval);
},
arrow: false,
accessibilityRole,
accessibilityState,
start: true,
end: true
});
return closure_7(View, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
({ PREMIUM_YEARLY_DISCOUNT_PERCENT: c5, SubscriptionIntervalTypes } = GuildFeatures);
({ jsx: error, jsxs: metroImportAll } = jsxProd);
2026-07-23 10:11:24 +00:00
let items = [, ];
2026-07-20 16:05:17 +00:00
({ YEAR: arr[0], MONTH: arr[1] } = SubscriptionIntervalTypes);
2026-07-29 08:29:29 +00:00
createCacheKey = { container: null, containerSelected: null, labelContainer: null, labelPromo: null };
createCacheKey = { marginTop: require("Themes").space.PX_8 };
createCacheKey[0] = createCacheKey;
createCacheKey[1] = { borderColor: require("Themes").colors.BACKGROUND_BRAND, borderRadius: require("Themes").radii.lg, borderWidth: 2 };
createCacheKey[2] = { flexDirection: "row" };
let obj1 = { borderColor: require("Themes").colors.BACKGROUND_BRAND, borderRadius: require("Themes").radii.lg, borderWidth: 2 };
createCacheKey[3] = { marginStart: require("Themes").space.PX_8, backgroundColor: require("Themes").colors.STATUS_POSITIVE_BACKGROUND, paddingHorizontal: require("Themes").space.PX_8, borderRadius: require("Themes").radii.round };
createCacheKey = createCacheKey.createStyles(createCacheKey);
let obj3 = { durationContainer: null, durationTitle: null };
let obj2 = { marginStart: require("Themes").space.PX_8, backgroundColor: require("Themes").colors.STATUS_POSITIVE_BACKGROUND, paddingHorizontal: require("Themes").space.PX_8, borderRadius: require("Themes").radii.round };
obj3[0] = { marginHorizontal: require("Themes").space.PX_16 };
createCacheKey = { marginTop: require("Themes").space.PX_24 };
obj3[1] = createCacheKey;
let closure_12 = createCacheKey.createStyles(obj3);
const obj4 = { marginHorizontal: require("Themes").space.PX_16 };
2026-07-23 10:11:24 +00:00
const result = require("GuildFeatures").fileFinishedImporting("modules/premium/native/gifting/PremiumGiftDuration.tsx");
2026-07-20 16:05:17 +00:00
export default function PremiumGiftDuration() {
2026-07-23 10:11:24 +00:00
const tmp = callback3();
2026-08-05 07:35:12 +00:00
let obj = planInterval(9500);
2026-07-23 10:11:24 +00:00
planInterval = obj.useNativeGiftContext().planInterval;
2026-08-05 07:35:12 +00:00
const tmp2 = importDefault(5583)(importDefault(9502).useConfig({ location: "PremiumGiftDuration" }).monthlyDefaultSelected);
2026-07-23 10:11:24 +00:00
importDefault = tmp2;
let items = [tmp2];
2026-07-20 16:05:17 +00:00
const memo = React.useMemo(() => {
2026-07-23 10:11:24 +00:00
if (closure_1) {
2026-07-20 16:05:17 +00:00
const items = [];
HermesBuiltin.arraySpread(tmp, 0);
let reversed = items.reverse();
} else {
reversed = tmp;
}
return reversed;
}, items);
2026-07-29 08:29:29 +00:00
obj = { style: tmp.durationContainer, children: null };
obj = { style: tmp.durationTitle, variant: "text-sm/semibold", children: null };
const intl = planInterval(1236).intl;
obj[2] = intl.string(planInterval(1236).t["8XT6Nf"]);
2026-08-05 07:35:12 +00:00
const items1 = [callback(planInterval(4251).Text, obj), memo.map((planInterval) => outer1_7(outer1_11, { selected: planInterval === planInterval, planInterval }, arg1))];
2026-07-29 08:29:29 +00:00
obj[1] = items1;
2026-07-20 16:05:17 +00:00
return callback2(View, obj);
};