@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.
Files changed (27) hide show
  1. package/dist/billing/modules/addons/pages/AddonDetailPage.js +85 -84
  2. package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -1
  3. package/dist/billing/modules/addons/pages/AddonEditPage.js +176 -195
  4. package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
  5. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +408 -206
  6. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
  7. package/dist/billing/modules/addons/pages/AddonsListPage.js +216 -215
  8. package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -1
  9. package/dist/billing/modules/billing/pages/InvoicesListPage.js +7 -1
  10. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
  11. package/dist/billing/modules/billing/pages/TransactionsPage.js +1 -1
  12. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
  13. package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js +261 -0
  14. package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js.map +1 -0
  15. package/dist/billing/modules/checkout/components/index.js +1 -0
  16. package/dist/billing/modules/checkout/hooks/useCheckout.js +2 -0
  17. package/dist/billing/modules/checkout/hooks/useCheckout.js.map +1 -1
  18. package/dist/billing/modules/checkout/index.js +1 -0
  19. package/dist/billing/modules/checkout/pages/CheckoutPage.js +354 -340
  20. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
  21. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js +79 -78
  22. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js.map +1 -1
  23. package/dist/billing/modules/plans/pages/PlanEditPage.js +29 -20
  24. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  25. package/dist/generated/global-operations.js +8 -0
  26. package/dist/generated/global-operations.js.map +1 -1
  27. 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 o } from "../../../hooks/useBillingPermissions.js";
10
- import { useBillingNavigate as s } from "../../../hooks/useBillingNavigate.js";
11
- import { useAddon as c, useAddonMutations as l } from "../hooks/useAddons.js";
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 u } from "../../plans/hooks/useQuotas.js";
14
+ import { useQuotas as d } from "../../plans/hooks/useQuotas.js";
14
15
  import "../../plans/hooks/index.js";
15
- import { useEffect as d, useState as f } from "react";
16
- import { useParams as p } from "react-router-dom";
17
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
18
- import { useI18n as _ } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
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 v = () => {
21
- let { t: v } = _(), y = (e, t) => {
22
- let n = v(e);
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: b } = p(), x = s(), S = o(), { addon: C, isLoading: w, error: T, refetch: E } = c(b), { quotas: D, isLoading: O } = u({ onlyActive: !0 }), { updateAddon: k, isUpdating: A } = l(), [j, M] = f(""), [N, P] = f(""), [F, I] = f("USD"), [L, R] = f(i.MONTHLY), [z, B] = f(!0), [V, H] = f([]), [U, W] = f([]), [G, K] = f(null), [q, J] = f(!1);
25
- if (d(() => {
26
- if (C && (M(C.name ?? ""), P(String(C.price ?? "")), I(C.currency ?? "USD"), R(C.duration ?? i.MONTHLY), B(C.isActive ?? !0), C.features && C.features.length > 0)) {
27
- let e = [], t = /* @__PURE__ */ new Map();
28
- for (let e of C.features) if (e.quota?.id) {
29
- let n = e.quota.id, r = e.quota.limits?.value ?? 1;
30
- t.set(n, (t.get(n) ?? 0) + r);
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
- }, [C]), !S.canManageAddons) return /* @__PURE__ */ h(e, { message: y("billing.addons.noEditPermission", "You don't have permission to edit addons.") });
39
- if (w || O) return /* @__PURE__ */ g("div", {
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__ */ h("div", { className: "h-8 w-48 bg-muted animate-pulse rounded" }), /* @__PURE__ */ h("div", {
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__ */ h("div", { className: "h-16 bg-muted animate-pulse rounded" }, e))
59
+ ].map((e) => /* @__PURE__ */ g("div", { className: "h-16 bg-muted animate-pulse rounded" }, e))
50
60
  })]
51
61
  });
52
- if (T && a(T)) return /* @__PURE__ */ h("div", {
62
+ if (E && a(E)) return /* @__PURE__ */ g("div", {
53
63
  className: "p-6",
54
- children: /* @__PURE__ */ h(n, {
55
- title: y("billing.addons.serverUnavailable", "Server Unavailable"),
56
- message: y("billing.addons.serverUnavailableLoadAddon", "Unable to load addon. The server might be down or experiencing issues."),
57
- onRetry: () => E(),
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 (!C) return /* @__PURE__ */ h("div", {
71
+ if (!w) return /* @__PURE__ */ g("div", {
62
72
  className: "flex items-center justify-center h-full min-h-[400px]",
63
- children: /* @__PURE__ */ g("div", {
73
+ children: /* @__PURE__ */ _("div", {
64
74
  className: "text-center space-y-4",
65
- children: [/* @__PURE__ */ h("h2", {
75
+ children: [/* @__PURE__ */ g("h2", {
66
76
  className: "text-lg font-semibold text-foreground",
67
- children: y("billing.addons.addonNotFound", "Addon not found")
68
- }), /* @__PURE__ */ h("button", {
77
+ children: b("billing.addons.addonNotFound", "Addon not found")
78
+ }), /* @__PURE__ */ g("button", {
69
79
  type: "button",
70
- onClick: () => x("/addons"),
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 Y = () => {
77
- H([{
86
+ let X = () => {
87
+ U([{
78
88
  quotaId: "",
79
89
  quantity: 1
80
- }, ...V]);
81
- }, X = (e) => {
82
- H(V.filter((t, n) => n !== e));
83
- }, Z = (e, t, n) => {
84
- let r = [...V];
85
- t === "quotaId" ? r[e].quotaId = n : r[e].quantity = Number(n), H(r);
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__ */ g("div", {
97
+ return /* @__PURE__ */ _("div", {
88
98
  className: "space-y-6 p-6",
89
- children: [/* @__PURE__ */ h(t, {
90
- title: `Edit Addon: ${C.name}`,
91
- description: y("billing.addons.editAddonDesc", "Update the addon details and quota allocations")
92
- }), /* @__PURE__ */ g("form", {
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(), K(null), J(!1), !j.trim()) {
95
- K("Addon name is required");
104
+ if (e.preventDefault(), q(null), Y(!1), !M.trim()) {
105
+ q("Addon name is required");
96
106
  return;
97
107
  }
98
- if (!N || isNaN(Number(N)) || Number(N) < 0) {
99
- K("Valid price is required");
108
+ if (!P || isNaN(Number(P)) || Number(P) < 0) {
109
+ q("Valid price is required");
100
110
  return;
101
111
  }
102
- if (V.length === 0) {
103
- K("At least one quota is required");
112
+ if (H.length === 0) {
113
+ q("At least one quota is required");
104
114
  return;
105
115
  }
106
- if (V.filter((e) => e.quotaId === "").length > 0) {
107
- K("Please select a quota for all allocations");
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: b,
112
- name: j.trim(),
113
- price: Number(N),
114
- currency: F,
115
- duration: L,
116
- isActive: z,
117
- quotas: V.map((e) => ({
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
- ...U.length > 0 ? { currencyPriceOverrides: U } : {}
131
+ ...W.length > 0 ? { currencyPriceOverrides: W } : {}
122
132
  };
123
133
  try {
124
- await k(t), J(!0), setTimeout(() => x(`/addons/${b}`), 1500);
134
+ await A(t), Y(!0), setTimeout(() => S(`/addons/${x}`), 1500);
125
135
  } catch (e) {
126
- K(e instanceof Error ? e.message : "Failed to update addon");
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
- G && /* @__PURE__ */ h("div", {
141
+ K && /* @__PURE__ */ g("div", {
132
142
  className: "p-4 bg-status-error-bg-subtle border border-border-subtle rounded-lg",
133
- children: /* @__PURE__ */ h("p", {
143
+ children: /* @__PURE__ */ g("p", {
134
144
  className: "text-sm text-status-error-text",
135
- children: G
145
+ children: K
136
146
  })
137
147
  }),
138
- q && /* @__PURE__ */ h("div", {
148
+ J && /* @__PURE__ */ g("div", {
139
149
  className: "p-4 bg-status-success-bg-subtle border border-border-subtle rounded-lg",
140
- children: /* @__PURE__ */ h("p", {
150
+ children: /* @__PURE__ */ g("p", {
141
151
  className: "text-sm text-status-success-text",
142
- children: y("billing.addons.updateSuccess", "Addon updated successfully! Redirecting...")
152
+ children: b("billing.addons.updateSuccess", "Addon updated successfully! Redirecting...")
143
153
  })
144
154
  }),
145
- /* @__PURE__ */ g("div", {
155
+ /* @__PURE__ */ _("div", {
146
156
  className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
147
- children: [/* @__PURE__ */ g("div", {
157
+ children: [/* @__PURE__ */ _("div", {
148
158
  className: "border border-border rounded-lg bg-card overflow-hidden h-fit",
149
- children: [/* @__PURE__ */ h("div", {
159
+ children: [/* @__PURE__ */ g("div", {
150
160
  className: "p-4 border-b border-border bg-muted/30",
151
- children: /* @__PURE__ */ h("h2", {
161
+ children: /* @__PURE__ */ g("h2", {
152
162
  className: "font-semibold text-foreground",
153
- children: y("billing.addons.basicInfo", "Basic Information")
163
+ children: b("billing.addons.basicInfo", "Basic Information")
154
164
  })
155
- }), /* @__PURE__ */ g("div", {
165
+ }), /* @__PURE__ */ _("div", {
156
166
  className: "p-4 space-y-4",
157
167
  children: [
158
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
168
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
159
169
  htmlFor: "name",
160
170
  className: "block text-sm font-medium text-foreground mb-1",
161
- children: [y("billing.addons.addonNameLabel", "Addon Name"), " *"]
162
- }), /* @__PURE__ */ h("input", {
171
+ children: [b("billing.addons.addonNameLabel", "Addon Name"), " *"]
172
+ }), /* @__PURE__ */ g("input", {
163
173
  id: "name",
164
174
  type: "text",
165
- value: j,
166
- onChange: (e) => M(e.target.value),
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: y("billing.addons.addonNamePlaceholder", "e.g., Extra Storage"),
178
+ placeholder: b("billing.addons.addonNamePlaceholder", "e.g., Extra Storage"),
169
179
  required: !0
170
180
  })] }),
171
- /* @__PURE__ */ g("div", {
181
+ /* @__PURE__ */ _("div", {
172
182
  className: "grid grid-cols-2 gap-4",
173
- children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
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: [y("billing.addons.priceLabel", "Price"), " *"]
177
- }), /* @__PURE__ */ h("input", {
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: N,
183
- onChange: (e) => P(e.target.value),
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__ */ g("div", { children: [/* @__PURE__ */ g("label", {
197
+ })] }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
188
198
  htmlFor: "currency",
189
199
  className: "block text-sm font-medium text-foreground mb-1",
190
- children: [y("billing.addons.currencyLabel", "Currency"), " *"]
191
- }), /* @__PURE__ */ g("select", {
200
+ children: [b("billing.addons.currencyLabel", "Currency"), " *"]
201
+ }), /* @__PURE__ */ _("select", {
192
202
  id: "currency",
193
- value: F,
194
- onChange: (e) => I(e.target.value),
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__ */ h("option", {
207
+ /* @__PURE__ */ g("option", {
198
208
  value: "USD",
199
209
  children: "USD ($)"
200
210
  }),
201
- /* @__PURE__ */ h("option", {
211
+ /* @__PURE__ */ g("option", {
202
212
  value: "EUR",
203
213
  children: "EUR"
204
214
  }),
205
- /* @__PURE__ */ h("option", {
215
+ /* @__PURE__ */ g("option", {
206
216
  value: "GBP",
207
217
  children: "GBP"
208
218
  }),
209
- /* @__PURE__ */ h("option", {
219
+ /* @__PURE__ */ g("option", {
210
220
  value: "INR",
211
221
  children: "INR"
212
222
  }),
213
- /* @__PURE__ */ h("option", {
223
+ /* @__PURE__ */ g("option", {
214
224
  value: "AUD",
215
225
  children: "AUD"
216
226
  }),
217
- /* @__PURE__ */ h("option", {
227
+ /* @__PURE__ */ g("option", {
218
228
  value: "CAD",
219
229
  children: "CAD"
220
230
  }),
221
- /* @__PURE__ */ h("option", {
231
+ /* @__PURE__ */ g("option", {
222
232
  value: "JPY",
223
233
  children: "JPY"
224
234
  }),
225
- /* @__PURE__ */ h("option", {
235
+ /* @__PURE__ */ g("option", {
226
236
  value: "SGD",
227
237
  children: "SGD"
228
238
  })
229
239
  ]
230
240
  })] })]
231
241
  }),
232
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
242
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
233
243
  htmlFor: "duration",
234
244
  className: "block text-sm font-medium text-foreground mb-1",
235
- children: [y("billing.addons.billingPeriodLabel", "Billing Period"), " *"]
236
- }), /* @__PURE__ */ g("select", {
245
+ children: [b("billing.addons.billingPeriodLabel", "Billing Period"), " *"]
246
+ }), /* @__PURE__ */ _("select", {
237
247
  id: "duration",
238
- value: L,
239
- onChange: (e) => R(e.target.value),
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__ */ h("option", {
251
+ children: [/* @__PURE__ */ g("option", {
242
252
  value: i.MONTHLY,
243
253
  children: "Monthly"
244
- }), /* @__PURE__ */ h("option", {
254
+ }), /* @__PURE__ */ g("option", {
245
255
  value: i.YEARLY,
246
256
  children: "Yearly"
247
257
  })]
248
258
  })] }),
249
- /* @__PURE__ */ g("div", {
259
+ /* @__PURE__ */ _("div", {
250
260
  className: "flex items-center gap-3",
251
- children: [/* @__PURE__ */ h("input", {
261
+ children: [/* @__PURE__ */ g("input", {
252
262
  id: "isActive",
253
263
  type: "checkbox",
254
- checked: z,
255
- onChange: (e) => B(e.target.checked),
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__ */ h("label", {
267
+ }), /* @__PURE__ */ g("label", {
258
268
  htmlFor: "isActive",
259
269
  className: "text-sm font-medium text-foreground",
260
- children: y("billing.addons.addonIsActive", "Addon is active")
270
+ children: b("billing.addons.addonIsActive", "Addon is active")
261
271
  })]
262
272
  })
263
273
  ]
264
274
  })]
265
- }), /* @__PURE__ */ g("div", {
275
+ }), /* @__PURE__ */ _("div", {
266
276
  className: "border border-border rounded-lg bg-card overflow-hidden h-fit",
267
- children: [/* @__PURE__ */ g("div", {
277
+ children: [/* @__PURE__ */ _("div", {
268
278
  className: "p-4 border-b border-border bg-muted/30 flex items-center justify-between",
269
- children: [/* @__PURE__ */ h("h2", {
279
+ children: [/* @__PURE__ */ g("h2", {
270
280
  className: "font-semibold text-foreground",
271
- children: y("billing.addons.quotaAllocations", "Quota Allocations")
272
- }), /* @__PURE__ */ h("button", {
281
+ children: b("billing.addons.quotaAllocations", "Quota Allocations")
282
+ }), /* @__PURE__ */ g("button", {
273
283
  type: "button",
274
- onClick: Y,
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__ */ h("div", {
288
+ }), /* @__PURE__ */ g("div", {
279
289
  className: "p-4 space-y-3",
280
- children: V.length === 0 ? /* @__PURE__ */ h("p", {
290
+ children: H.length === 0 ? /* @__PURE__ */ g("p", {
281
291
  className: "text-sm text-muted-foreground",
282
- children: y("billing.addons.noQuotasAllocated", "No quotas allocated. Click \"Add Quota\" to add one.")
283
- }) : V.map((e, t) => {
284
- let n = D.find((t) => t.id === e.quotaId), r = n?.limits, i = r?.value ?? 0, a = r?.type ?? "unknown", o = i * e.quantity;
285
- return /* @__PURE__ */ g("div", {
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__ */ g("div", {
297
+ children: [/* @__PURE__ */ _("div", {
288
298
  className: "flex items-center gap-3",
289
- children: [/* @__PURE__ */ g("select", {
299
+ children: [/* @__PURE__ */ _("select", {
290
300
  value: e.quotaId,
291
- onChange: (e) => Z(t, "quotaId", e.target.value),
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__ */ h("option", {
303
+ children: [/* @__PURE__ */ g("option", {
294
304
  value: "",
295
305
  disabled: !0,
296
- children: y("billing.addons.selectQuota", "Select a quota...")
297
- }), D.map((e) => /* @__PURE__ */ h("option", {
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__ */ h("button", {
311
+ }), /* @__PURE__ */ g("button", {
302
312
  type: "button",
303
- onClick: () => X(t),
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__ */ h("svg", {
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__ */ h("path", {
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__ */ g(m, { children: [/* @__PURE__ */ h("div", {
329
+ }), n && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
320
330
  className: "flex items-center justify-between text-sm",
321
- children: /* @__PURE__ */ g("div", {
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__ */ g("div", {
343
- className: "flex items-center gap-4",
344
- children: [/* @__PURE__ */ g("div", {
345
- className: "flex items-center gap-2",
346
- children: [/* @__PURE__ */ g("label", {
347
- className: "text-sm text-muted-foreground",
348
- children: [y("billing.addons.quantity", "Quantity"), ":"]
349
- }), /* @__PURE__ */ h("input", {
350
- type: "number",
351
- min: "1",
352
- value: e.quantity,
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__ */ h(r, {
373
- overrides: U,
374
- onChange: W
353
+ /* @__PURE__ */ g(r, {
354
+ overrides: W,
355
+ onChange: G
375
356
  }),
376
- /* @__PURE__ */ g("div", {
357
+ /* @__PURE__ */ _("div", {
377
358
  className: "flex items-center gap-3 pt-4",
378
- children: [/* @__PURE__ */ h("button", {
359
+ children: [/* @__PURE__ */ g("button", {
379
360
  type: "submit",
380
- disabled: A,
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: A ? y("billing.addons.saving", "Saving...") : y("billing.addons.saveChanges", "Save Changes")
383
- }), /* @__PURE__ */ h("button", {
363
+ children: j ? b("billing.addons.saving", "Saving...") : b("billing.addons.saveChanges", "Save Changes")
364
+ }), /* @__PURE__ */ g("button", {
384
365
  type: "button",
385
- onClick: () => x(`/addons/${b}`),
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 { v as AddonEditPage };
376
+ export { y as AddonEditPage };
396
377
 
397
378
  //# sourceMappingURL=AddonEditPage.js.map