@burdenoff/microfe-billing 2026.625.3 → 2026.625.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billing/lib/native-purchases.js +2 -44
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +192 -187
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonCreatePage.js +322 -317
- package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonDetailPage.js +190 -185
- package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonEditPage.js +297 -292
- package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +60 -75
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonsListPage.js +86 -101
- package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -1
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +124 -121
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js +103 -111
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +196 -160
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +58 -73
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +65 -75
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/RefundsPage.js +399 -399
- package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js +49 -48
- package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.js +144 -151
- package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.js +430 -425
- package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js +121 -93
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CouponsListPage.js +154 -152
- package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js +467 -462
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/EditCouponPage.js +294 -286
- package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js +123 -117
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +43 -42
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +192 -207
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditsPage.js +40 -56
- package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
- package/dist/billing/modules/dashboard/pages/OverviewPage.js +128 -121
- package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js +165 -180
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.js +103 -100
- package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +175 -175
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +96 -96
- package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +42 -40
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +45 -38
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanCreatePage.js +339 -334
- package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanDetailPage.js +80 -74
- package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanEditPage.js +342 -337
- package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js +38 -53
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansListPage.js +60 -75
- package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -1
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +242 -237
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
- package/dist/billing/modules/promotions/pages/PromotionsListPage.js +29 -39
- package/dist/billing/modules/promotions/pages/PromotionsListPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaPage.js +1 -0
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +299 -294
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +191 -186
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +308 -303
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +57 -78
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/SettingsPage.js +79 -78
- package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +15 -13
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +338 -299
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +82 -103
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +59 -54
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
- package/dist/billing/modules/usage/pages/UsagePage.js +172 -215
- package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
- package/package.json +2 -2
- package/dist/billing/lib/native-purchases.js.map +0 -1
|
@@ -17,24 +17,25 @@ import { useEffect as f, useState as p } from "react";
|
|
|
17
17
|
import { useParams as m } from "react-router-dom";
|
|
18
18
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
19
19
|
import { useI18n as v } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
20
|
+
import { PagePurpose as y } from "@burdenoff/fe-libs/ui";
|
|
20
21
|
//#region src/billing/modules/addons/pages/AddonEditPage.tsx
|
|
21
|
-
var
|
|
22
|
-
let { t:
|
|
23
|
-
let n =
|
|
22
|
+
var b = () => {
|
|
23
|
+
let { t: b } = v(), x = (e, t) => {
|
|
24
|
+
let n = b(e);
|
|
24
25
|
return n === e ? t : n;
|
|
25
|
-
}, { addonId:
|
|
26
|
+
}, { addonId: S } = m(), C = c(), w = s(), { addon: T, isLoading: E, error: D, refetch: O } = l(S), { quotas: k, isLoading: A } = d({ onlyActive: !0 }), { updateAddon: j, isUpdating: M } = u(), [N, P] = p(""), [F, I] = p(""), [L, R] = p("USD"), [z, B] = p(i.MONTHLY), [V, H] = p(!0), [U, W] = p([]), [G, K] = p([]), [q, J] = p(null), [Y, X] = p(!1);
|
|
26
27
|
if (f(() => {
|
|
27
|
-
if (
|
|
28
|
-
if (
|
|
29
|
-
let e =
|
|
30
|
-
|
|
28
|
+
if (T) {
|
|
29
|
+
if (P(T.name ?? ""), I(String(T.price ?? "")), R(T.currency ?? "USD"), B(T.duration ?? i.MONTHLY), H(T.isActive ?? !0), T.currencyPrices && typeof T.currencyPrices == "object") {
|
|
30
|
+
let e = T.currencyPrices;
|
|
31
|
+
K(Object.entries(e).filter(([, e]) => typeof e == "number").map(([e, t]) => ({
|
|
31
32
|
currency: e,
|
|
32
33
|
amount: t
|
|
33
34
|
})));
|
|
34
35
|
}
|
|
35
|
-
if (
|
|
36
|
+
if (T.features && T.features.length > 0) {
|
|
36
37
|
let e = [], t = /* @__PURE__ */ new Map();
|
|
37
|
-
for (let e of
|
|
38
|
+
for (let e of T.features) if (e.quota?.id) {
|
|
38
39
|
let n = e.quota.id, r = o(e);
|
|
39
40
|
t.set(n, (t.get(n) ?? 0) + r);
|
|
40
41
|
}
|
|
@@ -42,11 +43,11 @@ var y = () => {
|
|
|
42
43
|
quotaId: n,
|
|
43
44
|
quantity: r
|
|
44
45
|
});
|
|
45
|
-
|
|
46
|
+
W(e);
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
|
-
}, [
|
|
49
|
-
if (
|
|
49
|
+
}, [T]), !w.canManageAddons) return /* @__PURE__ */ g(e, { message: x("billing.addons.noEditPermission", "You don't have permission to edit addons.") });
|
|
50
|
+
if (E || A) return /* @__PURE__ */ _("div", {
|
|
50
51
|
className: "space-y-6 p-6",
|
|
51
52
|
children: [/* @__PURE__ */ g("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ g("div", {
|
|
52
53
|
className: "max-w-2xl space-y-4",
|
|
@@ -59,320 +60,324 @@ var y = () => {
|
|
|
59
60
|
].map((e) => /* @__PURE__ */ g("div", { className: "h-16 bg-bg-sunken animate-pulse rounded" }, e))
|
|
60
61
|
})]
|
|
61
62
|
});
|
|
62
|
-
if (
|
|
63
|
+
if (D && a(D)) return /* @__PURE__ */ g("div", {
|
|
63
64
|
className: "p-6",
|
|
64
65
|
children: /* @__PURE__ */ g(n, {
|
|
65
|
-
title:
|
|
66
|
-
message:
|
|
67
|
-
onRetry: () =>
|
|
66
|
+
title: x("billing.addons.serverUnavailable", "Server Unavailable"),
|
|
67
|
+
message: x("billing.addons.serverUnavailableLoadAddon", "Unable to load addon. The server might be down or experiencing issues."),
|
|
68
|
+
onRetry: () => O(),
|
|
68
69
|
showRetry: !0
|
|
69
70
|
})
|
|
70
71
|
});
|
|
71
|
-
if (!
|
|
72
|
+
if (!T) return /* @__PURE__ */ g("div", {
|
|
72
73
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
73
74
|
children: /* @__PURE__ */ _("div", {
|
|
74
75
|
className: "text-center space-y-4",
|
|
75
76
|
children: [/* @__PURE__ */ g("h2", {
|
|
76
77
|
className: "text-lg font-semibold text-text-primary",
|
|
77
|
-
children:
|
|
78
|
+
children: x("billing.addons.addonNotFound", "Addon not found")
|
|
78
79
|
}), /* @__PURE__ */ g("button", {
|
|
79
80
|
type: "button",
|
|
80
|
-
onClick: () =>
|
|
81
|
+
onClick: () => C("/addons"),
|
|
81
82
|
className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover",
|
|
82
83
|
children: "Back to Addons"
|
|
83
84
|
})]
|
|
84
85
|
})
|
|
85
86
|
});
|
|
86
|
-
let
|
|
87
|
-
|
|
87
|
+
let Z = () => {
|
|
88
|
+
W([{
|
|
88
89
|
quotaId: "",
|
|
89
90
|
quantity: 1
|
|
90
|
-
}, ...
|
|
91
|
-
},
|
|
92
|
-
U
|
|
93
|
-
},
|
|
94
|
-
let r = [...
|
|
95
|
-
t === "quotaId" ? r[e].quotaId = n : r[e].quantity = Number(n),
|
|
91
|
+
}, ...U]);
|
|
92
|
+
}, Q = (e) => {
|
|
93
|
+
W(U.filter((t, n) => n !== e));
|
|
94
|
+
}, $ = (e, t, n) => {
|
|
95
|
+
let r = [...U];
|
|
96
|
+
t === "quotaId" ? r[e].quotaId = n : r[e].quantity = Number(n), W(r);
|
|
96
97
|
};
|
|
97
98
|
return /* @__PURE__ */ _("div", {
|
|
98
99
|
className: "space-y-6 p-6",
|
|
99
|
-
children: [
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
id: "name",
|
|
174
|
-
type: "text",
|
|
175
|
-
value: M,
|
|
176
|
-
onChange: (e) => N(e.target.value),
|
|
177
|
-
className: "w-full px-3 py-2 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
178
|
-
placeholder: b("billing.addons.addonNamePlaceholder", "e.g., Extra Storage"),
|
|
179
|
-
required: !0
|
|
180
|
-
})] }),
|
|
181
|
-
/* @__PURE__ */ _("div", {
|
|
182
|
-
className: "grid grid-cols-2 gap-4",
|
|
183
|
-
children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
|
|
184
|
-
htmlFor: "price",
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ g(t, {
|
|
102
|
+
title: `Edit Addon: ${T.name}`,
|
|
103
|
+
description: x("billing.addons.editAddonDesc", "Update the addon details and quota allocations")
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ g(y, { children: x("billing.addons.editPurpose", "Update this add-on's price, currency overrides and the quotas it grants. Changes affect new purchases; existing add-on subscriptions keep what they already bought.") }),
|
|
106
|
+
/* @__PURE__ */ _("form", {
|
|
107
|
+
onSubmit: async (e) => {
|
|
108
|
+
if (e.preventDefault(), J(null), X(!1), !N.trim()) {
|
|
109
|
+
J("Addon name is required");
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (!F || isNaN(Number(F)) || Number(F) < 0) {
|
|
113
|
+
J("Valid price is required");
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (U.length === 0) {
|
|
117
|
+
J("At least one quota is required");
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (U.filter((e) => e.quotaId === "").length > 0) {
|
|
121
|
+
J("Please select a quota for all allocations");
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
let t = {
|
|
125
|
+
id: S,
|
|
126
|
+
name: N.trim(),
|
|
127
|
+
price: Number(F),
|
|
128
|
+
currency: L,
|
|
129
|
+
duration: z,
|
|
130
|
+
isActive: V,
|
|
131
|
+
quotas: U.map((e) => ({
|
|
132
|
+
quotaId: e.quotaId,
|
|
133
|
+
quantity: e.quantity
|
|
134
|
+
})),
|
|
135
|
+
...G.length > 0 ? { currencyPriceOverrides: G } : {}
|
|
136
|
+
};
|
|
137
|
+
try {
|
|
138
|
+
await j(t), X(!0), setTimeout(() => C(`/addons/${S}`), 1500);
|
|
139
|
+
} catch (e) {
|
|
140
|
+
J(e instanceof Error ? e.message : "Failed to update addon");
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
className: "space-y-6",
|
|
144
|
+
children: [
|
|
145
|
+
q && /* @__PURE__ */ g("div", {
|
|
146
|
+
className: "p-4 bg-status-error-bg-subtle border border-border-subtle rounded-lg",
|
|
147
|
+
children: /* @__PURE__ */ g("p", {
|
|
148
|
+
className: "text-sm text-status-error-text",
|
|
149
|
+
children: q
|
|
150
|
+
})
|
|
151
|
+
}),
|
|
152
|
+
Y && /* @__PURE__ */ g("div", {
|
|
153
|
+
className: "p-4 bg-status-success-bg-subtle border border-border-subtle rounded-lg",
|
|
154
|
+
children: /* @__PURE__ */ g("p", {
|
|
155
|
+
className: "text-sm text-status-success-text",
|
|
156
|
+
children: x("billing.addons.updateSuccess", "Addon updated successfully! Redirecting...")
|
|
157
|
+
})
|
|
158
|
+
}),
|
|
159
|
+
/* @__PURE__ */ _("div", {
|
|
160
|
+
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
161
|
+
children: [/* @__PURE__ */ _("div", {
|
|
162
|
+
className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
|
|
163
|
+
children: [/* @__PURE__ */ g("div", {
|
|
164
|
+
className: "p-4 border-b border-border-subtle bg-bg-sunken/30",
|
|
165
|
+
children: /* @__PURE__ */ g("h2", {
|
|
166
|
+
className: "font-semibold text-text-primary",
|
|
167
|
+
children: x("billing.addons.basicInfo", "Basic Information")
|
|
168
|
+
})
|
|
169
|
+
}), /* @__PURE__ */ _("div", {
|
|
170
|
+
className: "p-4 space-y-4",
|
|
171
|
+
children: [
|
|
172
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
|
|
173
|
+
htmlFor: "name",
|
|
185
174
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
186
|
-
children: [
|
|
175
|
+
children: [x("billing.addons.addonNameLabel", "Addon Name"), " *"]
|
|
187
176
|
}), /* @__PURE__ */ g("input", {
|
|
188
|
-
id: "
|
|
189
|
-
type: "
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
value: P,
|
|
193
|
-
onChange: (e) => F(e.target.value),
|
|
177
|
+
id: "name",
|
|
178
|
+
type: "text",
|
|
179
|
+
value: N,
|
|
180
|
+
onChange: (e) => P(e.target.value),
|
|
194
181
|
className: "w-full px-3 py-2 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
195
|
-
placeholder: "
|
|
182
|
+
placeholder: x("billing.addons.addonNamePlaceholder", "e.g., Extra Storage"),
|
|
196
183
|
required: !0
|
|
197
|
-
})] }),
|
|
198
|
-
|
|
184
|
+
})] }),
|
|
185
|
+
/* @__PURE__ */ _("div", {
|
|
186
|
+
className: "grid grid-cols-2 gap-4",
|
|
187
|
+
children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
|
|
188
|
+
htmlFor: "price",
|
|
189
|
+
className: "block text-sm font-medium text-text-primary mb-1",
|
|
190
|
+
children: [x("billing.addons.priceLabel", "Price"), " *"]
|
|
191
|
+
}), /* @__PURE__ */ g("input", {
|
|
192
|
+
id: "price",
|
|
193
|
+
type: "number",
|
|
194
|
+
step: "0.01",
|
|
195
|
+
min: "0",
|
|
196
|
+
value: F,
|
|
197
|
+
onChange: (e) => I(e.target.value),
|
|
198
|
+
className: "w-full px-3 py-2 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
199
|
+
placeholder: "9.99",
|
|
200
|
+
required: !0
|
|
201
|
+
})] }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
|
|
202
|
+
htmlFor: "currency",
|
|
203
|
+
className: "block text-sm font-medium text-text-primary mb-1",
|
|
204
|
+
children: [x("billing.addons.currencyLabel", "Currency"), " *"]
|
|
205
|
+
}), /* @__PURE__ */ _("select", {
|
|
206
|
+
id: "currency",
|
|
207
|
+
value: L,
|
|
208
|
+
onChange: (e) => R(e.target.value),
|
|
209
|
+
className: "w-full px-3 py-2 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
210
|
+
children: [
|
|
211
|
+
/* @__PURE__ */ g("option", {
|
|
212
|
+
value: "USD",
|
|
213
|
+
children: "USD ($)"
|
|
214
|
+
}),
|
|
215
|
+
/* @__PURE__ */ g("option", {
|
|
216
|
+
value: "EUR",
|
|
217
|
+
children: "EUR"
|
|
218
|
+
}),
|
|
219
|
+
/* @__PURE__ */ g("option", {
|
|
220
|
+
value: "GBP",
|
|
221
|
+
children: "GBP"
|
|
222
|
+
}),
|
|
223
|
+
/* @__PURE__ */ g("option", {
|
|
224
|
+
value: "INR",
|
|
225
|
+
children: "INR"
|
|
226
|
+
}),
|
|
227
|
+
/* @__PURE__ */ g("option", {
|
|
228
|
+
value: "AUD",
|
|
229
|
+
children: "AUD"
|
|
230
|
+
}),
|
|
231
|
+
/* @__PURE__ */ g("option", {
|
|
232
|
+
value: "CAD",
|
|
233
|
+
children: "CAD"
|
|
234
|
+
}),
|
|
235
|
+
/* @__PURE__ */ g("option", {
|
|
236
|
+
value: "JPY",
|
|
237
|
+
children: "JPY"
|
|
238
|
+
}),
|
|
239
|
+
/* @__PURE__ */ g("option", {
|
|
240
|
+
value: "SGD",
|
|
241
|
+
children: "SGD"
|
|
242
|
+
})
|
|
243
|
+
]
|
|
244
|
+
})] })]
|
|
245
|
+
}),
|
|
246
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
|
|
247
|
+
htmlFor: "duration",
|
|
199
248
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
200
|
-
children: [
|
|
249
|
+
children: [x("billing.addons.billingPeriodLabel", "Billing Period"), " *"]
|
|
201
250
|
}), /* @__PURE__ */ _("select", {
|
|
202
|
-
id: "
|
|
203
|
-
value:
|
|
204
|
-
onChange: (e) =>
|
|
251
|
+
id: "duration",
|
|
252
|
+
value: z,
|
|
253
|
+
onChange: (e) => B(e.target.value),
|
|
205
254
|
className: "w-full px-3 py-2 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
206
|
-
children: [
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
/* @__PURE__ */ g("option", {
|
|
216
|
-
value: "GBP",
|
|
217
|
-
children: "GBP"
|
|
218
|
-
}),
|
|
219
|
-
/* @__PURE__ */ g("option", {
|
|
220
|
-
value: "INR",
|
|
221
|
-
children: "INR"
|
|
222
|
-
}),
|
|
223
|
-
/* @__PURE__ */ g("option", {
|
|
224
|
-
value: "AUD",
|
|
225
|
-
children: "AUD"
|
|
226
|
-
}),
|
|
227
|
-
/* @__PURE__ */ g("option", {
|
|
228
|
-
value: "CAD",
|
|
229
|
-
children: "CAD"
|
|
230
|
-
}),
|
|
231
|
-
/* @__PURE__ */ g("option", {
|
|
232
|
-
value: "JPY",
|
|
233
|
-
children: "JPY"
|
|
234
|
-
}),
|
|
235
|
-
/* @__PURE__ */ g("option", {
|
|
236
|
-
value: "SGD",
|
|
237
|
-
children: "SGD"
|
|
238
|
-
})
|
|
239
|
-
]
|
|
240
|
-
})] })]
|
|
241
|
-
}),
|
|
242
|
-
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
|
|
243
|
-
htmlFor: "duration",
|
|
244
|
-
className: "block text-sm font-medium text-text-primary mb-1",
|
|
245
|
-
children: [b("billing.addons.billingPeriodLabel", "Billing Period"), " *"]
|
|
246
|
-
}), /* @__PURE__ */ _("select", {
|
|
247
|
-
id: "duration",
|
|
248
|
-
value: R,
|
|
249
|
-
onChange: (e) => z(e.target.value),
|
|
250
|
-
className: "w-full px-3 py-2 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
251
|
-
children: [/* @__PURE__ */ g("option", {
|
|
252
|
-
value: i.MONTHLY,
|
|
253
|
-
children: "Monthly"
|
|
254
|
-
}), /* @__PURE__ */ g("option", {
|
|
255
|
-
value: i.YEARLY,
|
|
256
|
-
children: "Yearly"
|
|
257
|
-
})]
|
|
258
|
-
})] }),
|
|
259
|
-
/* @__PURE__ */ _("div", {
|
|
260
|
-
className: "flex items-center gap-3",
|
|
261
|
-
children: [/* @__PURE__ */ g("input", {
|
|
262
|
-
id: "isActive",
|
|
263
|
-
type: "checkbox",
|
|
264
|
-
checked: B,
|
|
265
|
-
onChange: (e) => V(e.target.checked),
|
|
266
|
-
className: "size-4 rounded border-border-subtle text-text-link focus:ring-[var(--color-focus-ring)]"
|
|
267
|
-
}), /* @__PURE__ */ g("label", {
|
|
268
|
-
htmlFor: "isActive",
|
|
269
|
-
className: "text-sm font-medium text-text-primary",
|
|
270
|
-
children: b("billing.addons.addonIsActive", "Addon is active")
|
|
271
|
-
})]
|
|
272
|
-
})
|
|
273
|
-
]
|
|
274
|
-
})]
|
|
275
|
-
}), /* @__PURE__ */ _("div", {
|
|
276
|
-
className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
|
|
277
|
-
children: [/* @__PURE__ */ _("div", {
|
|
278
|
-
className: "p-4 border-b border-border-subtle bg-bg-sunken/30 flex items-center justify-between",
|
|
279
|
-
children: [/* @__PURE__ */ g("h2", {
|
|
280
|
-
className: "font-semibold text-text-primary",
|
|
281
|
-
children: b("billing.addons.quotaAllocations", "Quota Allocations")
|
|
282
|
-
}), /* @__PURE__ */ g("button", {
|
|
283
|
-
type: "button",
|
|
284
|
-
onClick: X,
|
|
285
|
-
className: "px-3 py-1 text-sm font-medium text-text-link hover:bg-[var(--color-accent-soft)] rounded-md transition-colors",
|
|
286
|
-
children: "+ Add Quota"
|
|
287
|
-
})]
|
|
288
|
-
}), /* @__PURE__ */ g("div", {
|
|
289
|
-
className: "p-4 space-y-3",
|
|
290
|
-
children: H.length === 0 ? /* @__PURE__ */ g("p", {
|
|
291
|
-
className: "text-sm text-text-muted",
|
|
292
|
-
children: b("billing.addons.noQuotasAllocated", "No quotas allocated. Click \"Add Quota\" to add one.")
|
|
293
|
-
}) : H.map((e, t) => {
|
|
294
|
-
let n = O.find((t) => t.id === e.quotaId), r = n?.limits?.type ?? "unknown";
|
|
295
|
-
return /* @__PURE__ */ _("div", {
|
|
296
|
-
className: "p-3 border border-border-subtle rounded-lg bg-bg-sunken/20 space-y-3",
|
|
297
|
-
children: [/* @__PURE__ */ _("div", {
|
|
255
|
+
children: [/* @__PURE__ */ g("option", {
|
|
256
|
+
value: i.MONTHLY,
|
|
257
|
+
children: "Monthly"
|
|
258
|
+
}), /* @__PURE__ */ g("option", {
|
|
259
|
+
value: i.YEARLY,
|
|
260
|
+
children: "Yearly"
|
|
261
|
+
})]
|
|
262
|
+
})] }),
|
|
263
|
+
/* @__PURE__ */ _("div", {
|
|
298
264
|
className: "flex items-center gap-3",
|
|
299
|
-
children: [/* @__PURE__ */
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
265
|
+
children: [/* @__PURE__ */ g("input", {
|
|
266
|
+
id: "isActive",
|
|
267
|
+
type: "checkbox",
|
|
268
|
+
checked: V,
|
|
269
|
+
onChange: (e) => H(e.target.checked),
|
|
270
|
+
className: "size-4 rounded border-border-subtle text-text-link focus:ring-[var(--color-focus-ring)]"
|
|
271
|
+
}), /* @__PURE__ */ g("label", {
|
|
272
|
+
htmlFor: "isActive",
|
|
273
|
+
className: "text-sm font-medium text-text-primary",
|
|
274
|
+
children: x("billing.addons.addonIsActive", "Addon is active")
|
|
275
|
+
})]
|
|
276
|
+
})
|
|
277
|
+
]
|
|
278
|
+
})]
|
|
279
|
+
}), /* @__PURE__ */ _("div", {
|
|
280
|
+
className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
|
|
281
|
+
children: [/* @__PURE__ */ _("div", {
|
|
282
|
+
className: "p-4 border-b border-border-subtle bg-bg-sunken/30 flex items-center justify-between",
|
|
283
|
+
children: [/* @__PURE__ */ g("h2", {
|
|
284
|
+
className: "font-semibold text-text-primary",
|
|
285
|
+
children: x("billing.addons.quotaAllocations", "Quota Allocations")
|
|
286
|
+
}), /* @__PURE__ */ g("button", {
|
|
287
|
+
type: "button",
|
|
288
|
+
onClick: Z,
|
|
289
|
+
className: "px-3 py-1 text-sm font-medium text-text-link hover:bg-[var(--color-accent-soft)] rounded-md transition-colors",
|
|
290
|
+
children: "+ Add Quota"
|
|
291
|
+
})]
|
|
292
|
+
}), /* @__PURE__ */ g("div", {
|
|
293
|
+
className: "p-4 space-y-3",
|
|
294
|
+
children: U.length === 0 ? /* @__PURE__ */ g("p", {
|
|
295
|
+
className: "text-sm text-text-muted",
|
|
296
|
+
children: x("billing.addons.noQuotasAllocated", "No quotas allocated. Click \"Add Quota\" to add one.")
|
|
297
|
+
}) : U.map((e, t) => {
|
|
298
|
+
let n = k.find((t) => t.id === e.quotaId), r = n?.limits?.type ?? "unknown";
|
|
299
|
+
return /* @__PURE__ */ _("div", {
|
|
300
|
+
className: "p-3 border border-border-subtle rounded-lg bg-bg-sunken/20 space-y-3",
|
|
301
|
+
children: [/* @__PURE__ */ _("div", {
|
|
302
|
+
className: "flex items-center gap-3",
|
|
303
|
+
children: [/* @__PURE__ */ _("select", {
|
|
304
|
+
value: e.quotaId,
|
|
305
|
+
onChange: (e) => $(t, "quotaId", e.target.value),
|
|
306
|
+
className: `flex-1 px-3 py-2 border border-border-subtle rounded-input bg-bg-surface focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] ${e.quotaId === "" ? "text-text-muted" : "text-text-primary"}`,
|
|
307
|
+
children: [/* @__PURE__ */ g("option", {
|
|
308
|
+
value: "",
|
|
309
|
+
disabled: !0,
|
|
310
|
+
children: x("billing.addons.selectQuota", "Select a quota...")
|
|
311
|
+
}), k.map((e) => /* @__PURE__ */ g("option", {
|
|
312
|
+
value: e.id,
|
|
313
|
+
children: e.name
|
|
314
|
+
}, e.id))]
|
|
315
|
+
}), /* @__PURE__ */ g("button", {
|
|
316
|
+
type: "button",
|
|
317
|
+
onClick: () => Q(t),
|
|
318
|
+
className: "p-2 text-status-error-text hover:bg-status-error-bg-subtle rounded-md transition-colors",
|
|
319
|
+
title: "Remove quota",
|
|
320
|
+
children: /* @__PURE__ */ g("svg", {
|
|
321
|
+
className: "size-5",
|
|
322
|
+
fill: "none",
|
|
323
|
+
viewBox: "0 0 24 24",
|
|
324
|
+
stroke: "currentColor",
|
|
325
|
+
children: /* @__PURE__ */ g("path", {
|
|
326
|
+
strokeLinecap: "round",
|
|
327
|
+
strokeLinejoin: "round",
|
|
328
|
+
strokeWidth: 2,
|
|
329
|
+
d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"
|
|
330
|
+
})
|
|
326
331
|
})
|
|
332
|
+
})]
|
|
333
|
+
}), n && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
|
|
334
|
+
className: "flex items-center justify-between text-sm",
|
|
335
|
+
children: /* @__PURE__ */ _("span", {
|
|
336
|
+
className: "capitalize text-text-muted",
|
|
337
|
+
children: ["Type: ", r]
|
|
327
338
|
})
|
|
328
|
-
})
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
})
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
onChange: (e) => Q(t, "quantity", e.target.value),
|
|
345
|
-
className: "w-36 px-3 py-1.5 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] text-center"
|
|
346
|
-
})]
|
|
347
|
-
})] })]
|
|
348
|
-
}, t);
|
|
349
|
-
})
|
|
339
|
+
}), /* @__PURE__ */ _("div", {
|
|
340
|
+
className: "flex items-center gap-2",
|
|
341
|
+
children: [/* @__PURE__ */ _("label", {
|
|
342
|
+
className: "text-sm text-text-muted",
|
|
343
|
+
children: [x("billing.addons.limit", "Limit"), ":"]
|
|
344
|
+
}), /* @__PURE__ */ g("input", {
|
|
345
|
+
type: "number",
|
|
346
|
+
min: "1",
|
|
347
|
+
value: e.quantity,
|
|
348
|
+
onChange: (e) => $(t, "quantity", e.target.value),
|
|
349
|
+
className: "w-36 px-3 py-1.5 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] text-center"
|
|
350
|
+
})]
|
|
351
|
+
})] })]
|
|
352
|
+
}, t);
|
|
353
|
+
})
|
|
354
|
+
})]
|
|
350
355
|
})]
|
|
351
|
-
})
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
})
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
356
|
+
}),
|
|
357
|
+
/* @__PURE__ */ g(r, {
|
|
358
|
+
overrides: G,
|
|
359
|
+
onChange: K
|
|
360
|
+
}),
|
|
361
|
+
/* @__PURE__ */ _("div", {
|
|
362
|
+
className: "flex items-center gap-3 pt-4",
|
|
363
|
+
children: [/* @__PURE__ */ g("button", {
|
|
364
|
+
type: "submit",
|
|
365
|
+
disabled: M,
|
|
366
|
+
className: "px-6 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors disabled:opacity-50",
|
|
367
|
+
children: M ? x("billing.addons.saving", "Saving...") : x("billing.addons.saveChanges", "Save Changes")
|
|
368
|
+
}), /* @__PURE__ */ g("button", {
|
|
369
|
+
type: "button",
|
|
370
|
+
onClick: () => C(`/addons/${S}`),
|
|
371
|
+
className: "px-6 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
|
|
372
|
+
children: "Cancel"
|
|
373
|
+
})]
|
|
374
|
+
})
|
|
375
|
+
]
|
|
376
|
+
})
|
|
377
|
+
]
|
|
373
378
|
});
|
|
374
379
|
};
|
|
375
380
|
//#endregion
|
|
376
|
-
export {
|
|
381
|
+
export { b as AddonEditPage };
|
|
377
382
|
|
|
378
383
|
//# sourceMappingURL=AddonEditPage.js.map
|