decord/source/modules/guild_role_subscriptions/useTrialIntervalOptions.tsx
github-actions ecf26fc058 chore: update source for alpha 347.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4823.js (118.4 MB)
2026-09-16 07:03:15 +00:00

59 lines
2 KiB
TypeScript

// Module ID: 15342
// Function ID: 15343
// Name: useTrialIntervalOptions
// Dependencies: [19, 15315, 1374, 1115, 15341, 2]
// Exports: default
// Module 15342 (useTrialIntervalOptions)
import noop from "module_19" /* 19 */;
const require = fn;
const TIER_TRIAL_INTERVALS = fn(15315).TIER_TRIAL_INTERVALS;
const SubscriptionIntervalTypes = fn(1374).SubscriptionIntervalTypes;
const size = fn(2);
const result = size.fileFinishedImporting("modules/guild_role_subscriptions/useTrialIntervalOptions.tsx");
export default function useTrialIntervalOptions(arg0) {
closure_0 = arg0;
const items = [arg0];
return noop.useMemo(() => {
const options = TIER_TRIAL_INTERVALS.map((value) => {
const obj = { value, label: null, isDefault: null };
if (value.interval === constants.DAY) {
if (7 === value.interval_count) {
const intl = closure_1_0(1115).intl;
const obj3 = { defaultLimit: closure_1_0(15341).formatPlanIntervalDuration(value) };
let formatToPlainStringResult = intl.formatToPlainString(closure_1_0(1115).t.XfSsr1, obj3);
const obj4 = closure_1_0(15341);
}
obj.label = formatToPlainStringResult;
let tmp5 = value.interval === tmp.DAY;
if (tmp5) {
tmp5 = 7 === value.interval_count;
}
obj.isDefault = tmp5;
return obj;
}
formatToPlainStringResult = closure_1_0(15341).formatPlanIntervalDuration(value);
});
let selectedOption = closure_0;
if (null != closure_0) {
const iter = options.find((value) => {
let tmp = null != value.value;
if (tmp) {
tmp = value.value.interval === closure_1_0.interval;
}
if (tmp) {
tmp = value.value.interval_count === closure_1_0.interval_count;
}
return tmp;
});
value = undefined;
if (iter != null) {
value = iter.value;
}
selectedOption = value;
}
return { options, selectedOption };
}, items);
};