decord/source/modules/billing/hooks/useSubscriptionPlansLoaded.tsx

75 lines
2.4 KiB
TypeScript
Raw Normal View History

// Module ID: 13606
// Function ID: 13607
// Name: useSubscriptionPlansLoaded
// Dependencies: [4383, 4385, 4386, 1374, 3, 504, 2]
2026-07-20 16:05:17 +00:00
// Exports: useSubscriptionPlansLoaded
// Module 13606 (useSubscriptionPlansLoaded)
import LoggerDefault from "Logger" /* 3 */;
import PaymentSourceStore from "PaymentSourceStore" /* 4383 */;
import SubscriptionPlanStore from "SubscriptionPlanStore" /* 4385 */;
import SubscriptionStore from "SubscriptionStore" /* 4386 */;
2026-07-23 10:11:24 +00:00
const require = fn;
function getSubscriptionPlansLoaded(items, items2) {
2026-07-29 08:29:29 +00:00
let tmp = items;
if (items === undefined) {
items = [];
2026-07-20 16:05:17 +00:00
HermesBuiltin.arraySpread(ACTIVE_PREMIUM_SKUS, 0);
tmp = items;
}
let tmp5 = items2;
if (items2 === undefined) {
const items1 = [PaymentSourceStore, SubscriptionPlanStore, SubscriptionStore];
2026-07-29 08:29:29 +00:00
tmp5 = items1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
[tmp9, obj, obj2] = tmp5;
({ paymentSourceIds, defaultPaymentSourceId } = tmp9);
2026-07-20 16:05:17 +00:00
const premiumTypeSubscription = obj2.getPremiumTypeSubscription();
let paymentSourceId;
2026-07-29 08:29:29 +00:00
if (premiumTypeSubscription != null) {
2026-07-20 16:05:17 +00:00
paymentSourceId = premiumTypeSubscription.paymentSourceId;
}
if (null != paymentSourceId) {
if (!obj.hasPaymentSourceForSKUIds(paymentSourceId, tmp)) {
return false;
}
}
if (null != defaultPaymentSourceId) {
if (!obj.hasPaymentSourceForSKUIds(defaultPaymentSourceId, tmp)) {
return false;
}
}
2026-07-29 08:29:29 +00:00
for (const item10046 of paymentSourceIds) {
if (obj.hasPaymentSourceForSKUIds(item10046, tmp)) {
continue;
} else {
obj3.return();
let flag3 = false;
return false;
2026-07-20 16:05:17 +00:00
}
}
return obj.isLoadedForSKUs(tmp);
}
const ACTIVE_PREMIUM_SKUS = fn(1374).ACTIVE_PREMIUM_SKUS;
new LoggerDefault("useSubscriptionPlansLoaded");
const size = fn(2);
const result = size.fileFinishedImporting("modules/billing/hooks/useSubscriptionPlansLoaded.tsx");
2026-07-20 16:05:17 +00:00
export const useSubscriptionPlansLoaded = function useSubscriptionPlansLoaded() {
let tmp = arg0;
if (arg0 === undefined) {
2026-07-23 10:11:24 +00:00
let items = [];
2026-07-20 16:05:17 +00:00
HermesBuiltin.arraySpread(ACTIVE_PREMIUM_SKUS, 0);
tmp = items;
}
2026-08-24 06:08:38 +00:00
items = tmp;
const items1 = [PaymentSourceStore, SubscriptionPlanStore, SubscriptionStore];
2026-07-20 16:05:17 +00:00
const items2 = [tmp];
return items(504).useStateFromStores(items1, () => {
items = [PaymentSourceStore, SubscriptionPlanStore, SubscriptionStore];
return getSubscriptionPlansLoaded(items, items);
2026-07-20 16:05:17 +00:00
}, items2);
};
export { getSubscriptionPlansLoaded };