@burdenoff/microfe-billing 2026.530.4 → 2026.531.2
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/modules/addons/pages/AddonDetailPage.js +85 -84
- package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonEditPage.js +176 -195
- package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +408 -206
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonsListPage.js +216 -215
- package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +7 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js +261 -0
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js.map +1 -0
- package/dist/billing/modules/checkout/components/index.js +1 -0
- package/dist/billing/modules/checkout/hooks/useCheckout.js +2 -0
- package/dist/billing/modules/checkout/hooks/useCheckout.js.map +1 -1
- package/dist/billing/modules/checkout/index.js +1 -0
- package/dist/billing/modules/checkout/pages/CheckoutPage.js +354 -340
- package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js +79 -78
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanEditPage.js +29 -20
- package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
- package/dist/generated/global-operations.js +8 -0
- package/dist/generated/global-operations.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,40 +5,50 @@ import { CurrencyPriceOverridesEditor as r } from "../../../shared/components/Cu
|
|
|
5
5
|
import "../../../shared/components/index.js";
|
|
6
6
|
import { PlanDuration as i } from "../../../shared/types/graphql.js";
|
|
7
7
|
import { isServerError as a } from "../../../shared/utils/error.js";
|
|
8
|
+
import { getPlanFeatureQuantity as o } from "../../../shared/utils/planFeatureQuantity.js";
|
|
8
9
|
import "../../../shared/utils/index.js";
|
|
9
|
-
import { useBillingPermissions as
|
|
10
|
-
import { useBillingNavigate as
|
|
11
|
-
import { useAddon as
|
|
10
|
+
import { useBillingPermissions as s } from "../../../hooks/useBillingPermissions.js";
|
|
11
|
+
import { useBillingNavigate as c } from "../../../hooks/useBillingNavigate.js";
|
|
12
|
+
import { useAddon as l, useAddonMutations as u } from "../hooks/useAddons.js";
|
|
12
13
|
import "../hooks/index.js";
|
|
13
|
-
import { useQuotas as
|
|
14
|
+
import { useQuotas as d } from "../../plans/hooks/useQuotas.js";
|
|
14
15
|
import "../../plans/hooks/index.js";
|
|
15
|
-
import { useEffect as
|
|
16
|
-
import { useParams as
|
|
17
|
-
import { Fragment as
|
|
18
|
-
import { useI18n as
|
|
16
|
+
import { useEffect as f, useState as p } from "react";
|
|
17
|
+
import { useParams as m } from "react-router-dom";
|
|
18
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
19
|
+
import { useI18n as v } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
19
20
|
//#region src/billing/modules/addons/pages/AddonEditPage.tsx
|
|
20
|
-
var
|
|
21
|
-
let { t:
|
|
22
|
-
let n =
|
|
21
|
+
var y = () => {
|
|
22
|
+
let { t: y } = v(), b = (e, t) => {
|
|
23
|
+
let n = y(e);
|
|
23
24
|
return n === e ? t : n;
|
|
24
|
-
}, { addonId:
|
|
25
|
-
if (
|
|
26
|
-
if (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
}, { addonId: x } = m(), S = c(), C = s(), { addon: w, isLoading: T, error: E, refetch: D } = l(x), { quotas: O, isLoading: k } = d({ onlyActive: !0 }), { updateAddon: A, isUpdating: j } = u(), [M, N] = p(""), [P, F] = p(""), [I, L] = p("USD"), [R, z] = p(i.MONTHLY), [B, V] = p(!0), [H, U] = p([]), [W, G] = p([]), [K, q] = p(null), [J, Y] = p(!1);
|
|
26
|
+
if (f(() => {
|
|
27
|
+
if (w) {
|
|
28
|
+
if (N(w.name ?? ""), F(String(w.price ?? "")), L(w.currency ?? "USD"), z(w.duration ?? i.MONTHLY), V(w.isActive ?? !0), w.currencyPrices && typeof w.currencyPrices == "object") {
|
|
29
|
+
let e = w.currencyPrices;
|
|
30
|
+
G(Object.entries(e).filter(([, e]) => typeof e == "number").map(([e, t]) => ({
|
|
31
|
+
currency: e,
|
|
32
|
+
amount: t
|
|
33
|
+
})));
|
|
34
|
+
}
|
|
35
|
+
if (w.features && w.features.length > 0) {
|
|
36
|
+
let e = [], t = /* @__PURE__ */ new Map();
|
|
37
|
+
for (let e of w.features) if (e.quota?.id) {
|
|
38
|
+
let n = e.quota.id, r = o(e);
|
|
39
|
+
t.set(n, (t.get(n) ?? 0) + r);
|
|
40
|
+
}
|
|
41
|
+
for (let [n, r] of t) e.push({
|
|
42
|
+
quotaId: n,
|
|
43
|
+
quantity: r
|
|
44
|
+
});
|
|
45
|
+
U(e);
|
|
31
46
|
}
|
|
32
|
-
for (let [n, r] of t) e.push({
|
|
33
|
-
quotaId: n,
|
|
34
|
-
quantity: r
|
|
35
|
-
});
|
|
36
|
-
H(e);
|
|
37
47
|
}
|
|
38
|
-
}, [
|
|
39
|
-
if (
|
|
48
|
+
}, [w]), !C.canManageAddons) return /* @__PURE__ */ g(e, { message: b("billing.addons.noEditPermission", "You don't have permission to edit addons.") });
|
|
49
|
+
if (T || k) return /* @__PURE__ */ _("div", {
|
|
40
50
|
className: "space-y-6 p-6",
|
|
41
|
-
children: [/* @__PURE__ */
|
|
51
|
+
children: [/* @__PURE__ */ g("div", { className: "h-8 w-48 bg-muted animate-pulse rounded" }), /* @__PURE__ */ g("div", {
|
|
42
52
|
className: "max-w-2xl space-y-4",
|
|
43
53
|
children: [
|
|
44
54
|
1,
|
|
@@ -46,269 +56,269 @@ var v = () => {
|
|
|
46
56
|
3,
|
|
47
57
|
4,
|
|
48
58
|
5
|
|
49
|
-
].map((e) => /* @__PURE__ */
|
|
59
|
+
].map((e) => /* @__PURE__ */ g("div", { className: "h-16 bg-muted animate-pulse rounded" }, e))
|
|
50
60
|
})]
|
|
51
61
|
});
|
|
52
|
-
if (
|
|
62
|
+
if (E && a(E)) return /* @__PURE__ */ g("div", {
|
|
53
63
|
className: "p-6",
|
|
54
|
-
children: /* @__PURE__ */
|
|
55
|
-
title:
|
|
56
|
-
message:
|
|
57
|
-
onRetry: () =>
|
|
64
|
+
children: /* @__PURE__ */ g(n, {
|
|
65
|
+
title: b("billing.addons.serverUnavailable", "Server Unavailable"),
|
|
66
|
+
message: b("billing.addons.serverUnavailableLoadAddon", "Unable to load addon. The server might be down or experiencing issues."),
|
|
67
|
+
onRetry: () => D(),
|
|
58
68
|
showRetry: !0
|
|
59
69
|
})
|
|
60
70
|
});
|
|
61
|
-
if (!
|
|
71
|
+
if (!w) return /* @__PURE__ */ g("div", {
|
|
62
72
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
63
|
-
children: /* @__PURE__ */
|
|
73
|
+
children: /* @__PURE__ */ _("div", {
|
|
64
74
|
className: "text-center space-y-4",
|
|
65
|
-
children: [/* @__PURE__ */
|
|
75
|
+
children: [/* @__PURE__ */ g("h2", {
|
|
66
76
|
className: "text-lg font-semibold text-foreground",
|
|
67
|
-
children:
|
|
68
|
-
}), /* @__PURE__ */
|
|
77
|
+
children: b("billing.addons.addonNotFound", "Addon not found")
|
|
78
|
+
}), /* @__PURE__ */ g("button", {
|
|
69
79
|
type: "button",
|
|
70
|
-
onClick: () =>
|
|
80
|
+
onClick: () => S("/addons"),
|
|
71
81
|
className: "px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90",
|
|
72
82
|
children: "Back to Addons"
|
|
73
83
|
})]
|
|
74
84
|
})
|
|
75
85
|
});
|
|
76
|
-
let
|
|
77
|
-
|
|
86
|
+
let X = () => {
|
|
87
|
+
U([{
|
|
78
88
|
quotaId: "",
|
|
79
89
|
quantity: 1
|
|
80
|
-
}, ...
|
|
81
|
-
},
|
|
82
|
-
H
|
|
83
|
-
},
|
|
84
|
-
let r = [...
|
|
85
|
-
t === "quotaId" ? r[e].quotaId = n : r[e].quantity = Number(n),
|
|
90
|
+
}, ...H]);
|
|
91
|
+
}, Z = (e) => {
|
|
92
|
+
U(H.filter((t, n) => n !== e));
|
|
93
|
+
}, Q = (e, t, n) => {
|
|
94
|
+
let r = [...H];
|
|
95
|
+
t === "quotaId" ? r[e].quotaId = n : r[e].quantity = Number(n), U(r);
|
|
86
96
|
};
|
|
87
|
-
return /* @__PURE__ */
|
|
97
|
+
return /* @__PURE__ */ _("div", {
|
|
88
98
|
className: "space-y-6 p-6",
|
|
89
|
-
children: [/* @__PURE__ */
|
|
90
|
-
title: `Edit Addon: ${
|
|
91
|
-
description:
|
|
92
|
-
}), /* @__PURE__ */
|
|
99
|
+
children: [/* @__PURE__ */ g(t, {
|
|
100
|
+
title: `Edit Addon: ${w.name}`,
|
|
101
|
+
description: b("billing.addons.editAddonDesc", "Update the addon details and quota allocations")
|
|
102
|
+
}), /* @__PURE__ */ _("form", {
|
|
93
103
|
onSubmit: async (e) => {
|
|
94
|
-
if (e.preventDefault(),
|
|
95
|
-
|
|
104
|
+
if (e.preventDefault(), q(null), Y(!1), !M.trim()) {
|
|
105
|
+
q("Addon name is required");
|
|
96
106
|
return;
|
|
97
107
|
}
|
|
98
|
-
if (!
|
|
99
|
-
|
|
108
|
+
if (!P || isNaN(Number(P)) || Number(P) < 0) {
|
|
109
|
+
q("Valid price is required");
|
|
100
110
|
return;
|
|
101
111
|
}
|
|
102
|
-
if (
|
|
103
|
-
|
|
112
|
+
if (H.length === 0) {
|
|
113
|
+
q("At least one quota is required");
|
|
104
114
|
return;
|
|
105
115
|
}
|
|
106
|
-
if (
|
|
107
|
-
|
|
116
|
+
if (H.filter((e) => e.quotaId === "").length > 0) {
|
|
117
|
+
q("Please select a quota for all allocations");
|
|
108
118
|
return;
|
|
109
119
|
}
|
|
110
120
|
let t = {
|
|
111
|
-
id:
|
|
112
|
-
name:
|
|
113
|
-
price: Number(
|
|
114
|
-
currency:
|
|
115
|
-
duration:
|
|
116
|
-
isActive:
|
|
117
|
-
quotas:
|
|
121
|
+
id: x,
|
|
122
|
+
name: M.trim(),
|
|
123
|
+
price: Number(P),
|
|
124
|
+
currency: I,
|
|
125
|
+
duration: R,
|
|
126
|
+
isActive: B,
|
|
127
|
+
quotas: H.map((e) => ({
|
|
118
128
|
quotaId: e.quotaId,
|
|
119
129
|
quantity: e.quantity
|
|
120
130
|
})),
|
|
121
|
-
...
|
|
131
|
+
...W.length > 0 ? { currencyPriceOverrides: W } : {}
|
|
122
132
|
};
|
|
123
133
|
try {
|
|
124
|
-
await
|
|
134
|
+
await A(t), Y(!0), setTimeout(() => S(`/addons/${x}`), 1500);
|
|
125
135
|
} catch (e) {
|
|
126
|
-
|
|
136
|
+
q(e instanceof Error ? e.message : "Failed to update addon");
|
|
127
137
|
}
|
|
128
138
|
},
|
|
129
139
|
className: "space-y-6",
|
|
130
140
|
children: [
|
|
131
|
-
|
|
141
|
+
K && /* @__PURE__ */ g("div", {
|
|
132
142
|
className: "p-4 bg-status-error-bg-subtle border border-border-subtle rounded-lg",
|
|
133
|
-
children: /* @__PURE__ */
|
|
143
|
+
children: /* @__PURE__ */ g("p", {
|
|
134
144
|
className: "text-sm text-status-error-text",
|
|
135
|
-
children:
|
|
145
|
+
children: K
|
|
136
146
|
})
|
|
137
147
|
}),
|
|
138
|
-
|
|
148
|
+
J && /* @__PURE__ */ g("div", {
|
|
139
149
|
className: "p-4 bg-status-success-bg-subtle border border-border-subtle rounded-lg",
|
|
140
|
-
children: /* @__PURE__ */
|
|
150
|
+
children: /* @__PURE__ */ g("p", {
|
|
141
151
|
className: "text-sm text-status-success-text",
|
|
142
|
-
children:
|
|
152
|
+
children: b("billing.addons.updateSuccess", "Addon updated successfully! Redirecting...")
|
|
143
153
|
})
|
|
144
154
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ _("div", {
|
|
146
156
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
147
|
-
children: [/* @__PURE__ */
|
|
157
|
+
children: [/* @__PURE__ */ _("div", {
|
|
148
158
|
className: "border border-border rounded-lg bg-card overflow-hidden h-fit",
|
|
149
|
-
children: [/* @__PURE__ */
|
|
159
|
+
children: [/* @__PURE__ */ g("div", {
|
|
150
160
|
className: "p-4 border-b border-border bg-muted/30",
|
|
151
|
-
children: /* @__PURE__ */
|
|
161
|
+
children: /* @__PURE__ */ g("h2", {
|
|
152
162
|
className: "font-semibold text-foreground",
|
|
153
|
-
children:
|
|
163
|
+
children: b("billing.addons.basicInfo", "Basic Information")
|
|
154
164
|
})
|
|
155
|
-
}), /* @__PURE__ */
|
|
165
|
+
}), /* @__PURE__ */ _("div", {
|
|
156
166
|
className: "p-4 space-y-4",
|
|
157
167
|
children: [
|
|
158
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
|
|
159
169
|
htmlFor: "name",
|
|
160
170
|
className: "block text-sm font-medium text-foreground mb-1",
|
|
161
|
-
children: [
|
|
162
|
-
}), /* @__PURE__ */
|
|
171
|
+
children: [b("billing.addons.addonNameLabel", "Addon Name"), " *"]
|
|
172
|
+
}), /* @__PURE__ */ g("input", {
|
|
163
173
|
id: "name",
|
|
164
174
|
type: "text",
|
|
165
|
-
value:
|
|
166
|
-
onChange: (e) =>
|
|
175
|
+
value: M,
|
|
176
|
+
onChange: (e) => N(e.target.value),
|
|
167
177
|
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary",
|
|
168
|
-
placeholder:
|
|
178
|
+
placeholder: b("billing.addons.addonNamePlaceholder", "e.g., Extra Storage"),
|
|
169
179
|
required: !0
|
|
170
180
|
})] }),
|
|
171
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ _("div", {
|
|
172
182
|
className: "grid grid-cols-2 gap-4",
|
|
173
|
-
children: [/* @__PURE__ */
|
|
183
|
+
children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
|
|
174
184
|
htmlFor: "price",
|
|
175
185
|
className: "block text-sm font-medium text-foreground mb-1",
|
|
176
|
-
children: [
|
|
177
|
-
}), /* @__PURE__ */
|
|
186
|
+
children: [b("billing.addons.priceLabel", "Price"), " *"]
|
|
187
|
+
}), /* @__PURE__ */ g("input", {
|
|
178
188
|
id: "price",
|
|
179
189
|
type: "number",
|
|
180
190
|
step: "0.01",
|
|
181
191
|
min: "0",
|
|
182
|
-
value:
|
|
183
|
-
onChange: (e) =>
|
|
192
|
+
value: P,
|
|
193
|
+
onChange: (e) => F(e.target.value),
|
|
184
194
|
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary",
|
|
185
195
|
placeholder: "9.99",
|
|
186
196
|
required: !0
|
|
187
|
-
})] }), /* @__PURE__ */
|
|
197
|
+
})] }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
|
|
188
198
|
htmlFor: "currency",
|
|
189
199
|
className: "block text-sm font-medium text-foreground mb-1",
|
|
190
|
-
children: [
|
|
191
|
-
}), /* @__PURE__ */
|
|
200
|
+
children: [b("billing.addons.currencyLabel", "Currency"), " *"]
|
|
201
|
+
}), /* @__PURE__ */ _("select", {
|
|
192
202
|
id: "currency",
|
|
193
|
-
value:
|
|
194
|
-
onChange: (e) =>
|
|
203
|
+
value: I,
|
|
204
|
+
onChange: (e) => L(e.target.value),
|
|
195
205
|
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary",
|
|
196
206
|
children: [
|
|
197
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ g("option", {
|
|
198
208
|
value: "USD",
|
|
199
209
|
children: "USD ($)"
|
|
200
210
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ g("option", {
|
|
202
212
|
value: "EUR",
|
|
203
213
|
children: "EUR"
|
|
204
214
|
}),
|
|
205
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ g("option", {
|
|
206
216
|
value: "GBP",
|
|
207
217
|
children: "GBP"
|
|
208
218
|
}),
|
|
209
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ g("option", {
|
|
210
220
|
value: "INR",
|
|
211
221
|
children: "INR"
|
|
212
222
|
}),
|
|
213
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ g("option", {
|
|
214
224
|
value: "AUD",
|
|
215
225
|
children: "AUD"
|
|
216
226
|
}),
|
|
217
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ g("option", {
|
|
218
228
|
value: "CAD",
|
|
219
229
|
children: "CAD"
|
|
220
230
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ g("option", {
|
|
222
232
|
value: "JPY",
|
|
223
233
|
children: "JPY"
|
|
224
234
|
}),
|
|
225
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ g("option", {
|
|
226
236
|
value: "SGD",
|
|
227
237
|
children: "SGD"
|
|
228
238
|
})
|
|
229
239
|
]
|
|
230
240
|
})] })]
|
|
231
241
|
}),
|
|
232
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
|
|
233
243
|
htmlFor: "duration",
|
|
234
244
|
className: "block text-sm font-medium text-foreground mb-1",
|
|
235
|
-
children: [
|
|
236
|
-
}), /* @__PURE__ */
|
|
245
|
+
children: [b("billing.addons.billingPeriodLabel", "Billing Period"), " *"]
|
|
246
|
+
}), /* @__PURE__ */ _("select", {
|
|
237
247
|
id: "duration",
|
|
238
|
-
value:
|
|
239
|
-
onChange: (e) =>
|
|
248
|
+
value: R,
|
|
249
|
+
onChange: (e) => z(e.target.value),
|
|
240
250
|
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary",
|
|
241
|
-
children: [/* @__PURE__ */
|
|
251
|
+
children: [/* @__PURE__ */ g("option", {
|
|
242
252
|
value: i.MONTHLY,
|
|
243
253
|
children: "Monthly"
|
|
244
|
-
}), /* @__PURE__ */
|
|
254
|
+
}), /* @__PURE__ */ g("option", {
|
|
245
255
|
value: i.YEARLY,
|
|
246
256
|
children: "Yearly"
|
|
247
257
|
})]
|
|
248
258
|
})] }),
|
|
249
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ _("div", {
|
|
250
260
|
className: "flex items-center gap-3",
|
|
251
|
-
children: [/* @__PURE__ */
|
|
261
|
+
children: [/* @__PURE__ */ g("input", {
|
|
252
262
|
id: "isActive",
|
|
253
263
|
type: "checkbox",
|
|
254
|
-
checked:
|
|
255
|
-
onChange: (e) =>
|
|
264
|
+
checked: B,
|
|
265
|
+
onChange: (e) => V(e.target.checked),
|
|
256
266
|
className: "size-4 rounded border-border text-primary focus:ring-primary"
|
|
257
|
-
}), /* @__PURE__ */
|
|
267
|
+
}), /* @__PURE__ */ g("label", {
|
|
258
268
|
htmlFor: "isActive",
|
|
259
269
|
className: "text-sm font-medium text-foreground",
|
|
260
|
-
children:
|
|
270
|
+
children: b("billing.addons.addonIsActive", "Addon is active")
|
|
261
271
|
})]
|
|
262
272
|
})
|
|
263
273
|
]
|
|
264
274
|
})]
|
|
265
|
-
}), /* @__PURE__ */
|
|
275
|
+
}), /* @__PURE__ */ _("div", {
|
|
266
276
|
className: "border border-border rounded-lg bg-card overflow-hidden h-fit",
|
|
267
|
-
children: [/* @__PURE__ */
|
|
277
|
+
children: [/* @__PURE__ */ _("div", {
|
|
268
278
|
className: "p-4 border-b border-border bg-muted/30 flex items-center justify-between",
|
|
269
|
-
children: [/* @__PURE__ */
|
|
279
|
+
children: [/* @__PURE__ */ g("h2", {
|
|
270
280
|
className: "font-semibold text-foreground",
|
|
271
|
-
children:
|
|
272
|
-
}), /* @__PURE__ */
|
|
281
|
+
children: b("billing.addons.quotaAllocations", "Quota Allocations")
|
|
282
|
+
}), /* @__PURE__ */ g("button", {
|
|
273
283
|
type: "button",
|
|
274
|
-
onClick:
|
|
284
|
+
onClick: X,
|
|
275
285
|
className: "px-3 py-1 text-sm font-medium text-primary hover:bg-primary/10 rounded-md transition-colors",
|
|
276
286
|
children: "+ Add Quota"
|
|
277
287
|
})]
|
|
278
|
-
}), /* @__PURE__ */
|
|
288
|
+
}), /* @__PURE__ */ g("div", {
|
|
279
289
|
className: "p-4 space-y-3",
|
|
280
|
-
children:
|
|
290
|
+
children: H.length === 0 ? /* @__PURE__ */ g("p", {
|
|
281
291
|
className: "text-sm text-muted-foreground",
|
|
282
|
-
children:
|
|
283
|
-
}) :
|
|
284
|
-
let n =
|
|
285
|
-
return /* @__PURE__ */
|
|
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", {
|
|
286
296
|
className: "p-3 border border-border rounded-lg bg-muted/20 space-y-3",
|
|
287
|
-
children: [/* @__PURE__ */
|
|
297
|
+
children: [/* @__PURE__ */ _("div", {
|
|
288
298
|
className: "flex items-center gap-3",
|
|
289
|
-
children: [/* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ _("select", {
|
|
290
300
|
value: e.quotaId,
|
|
291
|
-
onChange: (e) =>
|
|
301
|
+
onChange: (e) => Q(t, "quotaId", e.target.value),
|
|
292
302
|
className: `flex-1 px-3 py-2 border border-border rounded-md bg-background focus:outline-none focus:ring-2 focus:ring-primary ${e.quotaId === "" ? "text-muted-foreground" : "text-foreground"}`,
|
|
293
|
-
children: [/* @__PURE__ */
|
|
303
|
+
children: [/* @__PURE__ */ g("option", {
|
|
294
304
|
value: "",
|
|
295
305
|
disabled: !0,
|
|
296
|
-
children:
|
|
297
|
-
}),
|
|
306
|
+
children: b("billing.addons.selectQuota", "Select a quota...")
|
|
307
|
+
}), O.map((e) => /* @__PURE__ */ g("option", {
|
|
298
308
|
value: e.id,
|
|
299
309
|
children: e.name
|
|
300
310
|
}, e.id))]
|
|
301
|
-
}), /* @__PURE__ */
|
|
311
|
+
}), /* @__PURE__ */ g("button", {
|
|
302
312
|
type: "button",
|
|
303
|
-
onClick: () =>
|
|
313
|
+
onClick: () => Z(t),
|
|
304
314
|
className: "p-2 text-status-error-text hover:bg-status-error-bg-subtle rounded-md transition-colors",
|
|
305
315
|
title: "Remove quota",
|
|
306
|
-
children: /* @__PURE__ */
|
|
316
|
+
children: /* @__PURE__ */ g("svg", {
|
|
307
317
|
className: "size-5",
|
|
308
318
|
fill: "none",
|
|
309
319
|
viewBox: "0 0 24 24",
|
|
310
320
|
stroke: "currentColor",
|
|
311
|
-
children: /* @__PURE__ */
|
|
321
|
+
children: /* @__PURE__ */ g("path", {
|
|
312
322
|
strokeLinecap: "round",
|
|
313
323
|
strokeLinejoin: "round",
|
|
314
324
|
strokeWidth: 2,
|
|
@@ -316,52 +326,23 @@ var v = () => {
|
|
|
316
326
|
})
|
|
317
327
|
})
|
|
318
328
|
})]
|
|
319
|
-
}), n && /* @__PURE__ */
|
|
329
|
+
}), n && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
|
|
320
330
|
className: "flex items-center justify-between text-sm",
|
|
321
|
-
children: /* @__PURE__ */
|
|
322
|
-
className: "text-muted-foreground",
|
|
323
|
-
children: [
|
|
324
|
-
/* @__PURE__ */ g("span", {
|
|
325
|
-
className: "capitalize",
|
|
326
|
-
children: ["Type: ", a]
|
|
327
|
-
}),
|
|
328
|
-
/* @__PURE__ */ h("span", {
|
|
329
|
-
className: "mx-2",
|
|
330
|
-
children: "•"
|
|
331
|
-
}),
|
|
332
|
-
/* @__PURE__ */ g("span", { children: [
|
|
333
|
-
"Value per unit:",
|
|
334
|
-
" ",
|
|
335
|
-
/* @__PURE__ */ h("span", {
|
|
336
|
-
className: "font-medium text-foreground",
|
|
337
|
-
children: i.toLocaleString()
|
|
338
|
-
})
|
|
339
|
-
] })
|
|
340
|
-
]
|
|
331
|
+
children: /* @__PURE__ */ _("span", {
|
|
332
|
+
className: "capitalize text-muted-foreground",
|
|
333
|
+
children: ["Type: ", r]
|
|
341
334
|
})
|
|
342
|
-
}), /* @__PURE__ */
|
|
343
|
-
className: "flex items-center gap-
|
|
344
|
-
children: [/* @__PURE__ */
|
|
345
|
-
className: "
|
|
346
|
-
children: [
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
onChange: (e) => Z(t, "quantity", e.target.value),
|
|
354
|
-
className: "w-24 px-3 py-1.5 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary text-center"
|
|
355
|
-
})]
|
|
356
|
-
}), /* @__PURE__ */ g("div", {
|
|
357
|
-
className: "flex items-center gap-2 text-sm",
|
|
358
|
-
children: [/* @__PURE__ */ h("span", {
|
|
359
|
-
className: "text-muted-foreground",
|
|
360
|
-
children: "="
|
|
361
|
-
}), /* @__PURE__ */ g("span", {
|
|
362
|
-
className: "font-semibold text-status-success-text",
|
|
363
|
-
children: [o.toLocaleString(), " total"]
|
|
364
|
-
})]
|
|
335
|
+
}), /* @__PURE__ */ _("div", {
|
|
336
|
+
className: "flex items-center gap-2",
|
|
337
|
+
children: [/* @__PURE__ */ _("label", {
|
|
338
|
+
className: "text-sm text-muted-foreground",
|
|
339
|
+
children: [b("billing.addons.limit", "Limit"), ":"]
|
|
340
|
+
}), /* @__PURE__ */ g("input", {
|
|
341
|
+
type: "number",
|
|
342
|
+
min: "1",
|
|
343
|
+
value: e.quantity,
|
|
344
|
+
onChange: (e) => Q(t, "quantity", e.target.value),
|
|
345
|
+
className: "w-36 px-3 py-1.5 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary text-center"
|
|
365
346
|
})]
|
|
366
347
|
})] })]
|
|
367
348
|
}, t);
|
|
@@ -369,20 +350,20 @@ var v = () => {
|
|
|
369
350
|
})]
|
|
370
351
|
})]
|
|
371
352
|
}),
|
|
372
|
-
/* @__PURE__ */
|
|
373
|
-
overrides:
|
|
374
|
-
onChange:
|
|
353
|
+
/* @__PURE__ */ g(r, {
|
|
354
|
+
overrides: W,
|
|
355
|
+
onChange: G
|
|
375
356
|
}),
|
|
376
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ _("div", {
|
|
377
358
|
className: "flex items-center gap-3 pt-4",
|
|
378
|
-
children: [/* @__PURE__ */
|
|
359
|
+
children: [/* @__PURE__ */ g("button", {
|
|
379
360
|
type: "submit",
|
|
380
|
-
disabled:
|
|
361
|
+
disabled: j,
|
|
381
362
|
className: "px-6 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors disabled:opacity-50",
|
|
382
|
-
children:
|
|
383
|
-
}), /* @__PURE__ */
|
|
363
|
+
children: j ? b("billing.addons.saving", "Saving...") : b("billing.addons.saveChanges", "Save Changes")
|
|
364
|
+
}), /* @__PURE__ */ g("button", {
|
|
384
365
|
type: "button",
|
|
385
|
-
onClick: () =>
|
|
366
|
+
onClick: () => S(`/addons/${x}`),
|
|
386
367
|
className: "px-6 py-2 text-sm font-medium border border-border text-foreground rounded-md hover:bg-muted transition-colors",
|
|
387
368
|
children: "Cancel"
|
|
388
369
|
})]
|
|
@@ -392,6 +373,6 @@ var v = () => {
|
|
|
392
373
|
});
|
|
393
374
|
};
|
|
394
375
|
//#endregion
|
|
395
|
-
export {
|
|
376
|
+
export { y as AddonEditPage };
|
|
396
377
|
|
|
397
378
|
//# sourceMappingURL=AddonEditPage.js.map
|