@burdenoff/microfe-billing 2026.625.4 → 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/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
|
@@ -10,8 +10,9 @@ import { useMemo as u, useState as d } from "react";
|
|
|
10
10
|
import { Minus as f, Plus as p, ShoppingCart as m, Trash2 as h, X as g } from "lucide-react";
|
|
11
11
|
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
12
12
|
import { useI18n as b } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
13
|
+
import { IllustratedEmptyState as x, PagePurpose as S } from "@burdenoff/fe-libs/ui";
|
|
13
14
|
//#region src/billing/modules/addons/pages/AddonsListPage.tsx
|
|
14
|
-
function
|
|
15
|
+
function C(e) {
|
|
15
16
|
let t = /* @__PURE__ */ new Map();
|
|
16
17
|
for (let n of e) {
|
|
17
18
|
if (!n.quota) continue;
|
|
@@ -24,7 +25,7 @@ function x(e) {
|
|
|
24
25
|
}
|
|
25
26
|
return Array.from(t.values());
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function w(e, t = "USD") {
|
|
28
29
|
if (e.currencyPrices && typeof e.currencyPrices == "object") {
|
|
29
30
|
let n = e.currencyPrices;
|
|
30
31
|
if (n[t]) return {
|
|
@@ -37,11 +38,11 @@ function S(e, t = "USD") {
|
|
|
37
38
|
currency: e.currency || "USD"
|
|
38
39
|
};
|
|
39
40
|
}
|
|
40
|
-
var
|
|
41
|
+
var T = () => {
|
|
41
42
|
let { t: e } = b(), t = (t, n) => {
|
|
42
43
|
let r = e(t);
|
|
43
44
|
return r === t ? n : r;
|
|
44
|
-
}, n = o(), r = i(), { addons: u, isLoading: f, error: p, refetch: m } = c(), { toggleAddon: h, isToggling: g } = s(), { addToCart: _, removeFromCart:
|
|
45
|
+
}, n = o(), r = i(), { addons: u, isLoading: f, error: p, refetch: m } = c(), { toggleAddon: h, isToggling: g } = s(), { addToCart: _, removeFromCart: C, updateQuantity: w, isInCart: T, getCartItem: k } = a(), [A, j] = d("grid"), [M, N] = d(!1), [P, F] = d("all"), I = l();
|
|
45
46
|
if (!r.canViewAddons) return /* @__PURE__ */ v("div", {
|
|
46
47
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
47
48
|
children: /* @__PURE__ */ y("div", {
|
|
@@ -73,15 +74,15 @@ var C = () => {
|
|
|
73
74
|
]
|
|
74
75
|
})
|
|
75
76
|
});
|
|
76
|
-
let
|
|
77
|
+
let L = u.filter((e) => !(!M && !e.isActive || P !== "all" && e.duration !== P)), R = async (e) => {
|
|
77
78
|
if (r.canManageAddons) try {
|
|
78
79
|
await h(e.id, !e.isActive), await m();
|
|
79
80
|
} catch (e) {
|
|
80
81
|
console.error("Failed to toggle addon:", e);
|
|
81
82
|
}
|
|
82
|
-
},
|
|
83
|
+
}, z = (e) => {
|
|
83
84
|
n(`/addons/${e.id}`);
|
|
84
|
-
},
|
|
85
|
+
}, B = (e) => {
|
|
85
86
|
n(`/addons/${e.id}/edit`);
|
|
86
87
|
};
|
|
87
88
|
return f && u.length === 0 ? /* @__PURE__ */ y("div", {
|
|
@@ -149,13 +150,20 @@ var C = () => {
|
|
|
149
150
|
children: [
|
|
150
151
|
/* @__PURE__ */ y("div", {
|
|
151
152
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
152
|
-
children: [/* @__PURE__ */ y("div", { children: [
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
153
|
+
children: [/* @__PURE__ */ y("div", { children: [
|
|
154
|
+
/* @__PURE__ */ v("h1", {
|
|
155
|
+
className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
|
|
156
|
+
children: t("billing.addons.title", "Addons")
|
|
157
|
+
}),
|
|
158
|
+
/* @__PURE__ */ v("p", {
|
|
159
|
+
className: "text-sm text-text-muted mt-1",
|
|
160
|
+
children: t("billing.addons.subtitle", "Enhance your subscription with additional features")
|
|
161
|
+
}),
|
|
162
|
+
/* @__PURE__ */ v(S, {
|
|
163
|
+
className: "mt-3",
|
|
164
|
+
children: t("billing.addons.listPurpose", "Manage the catalog of add-ons customers can buy alongside their subscriptions — including inactive ones. Create new add-ons, edit their price and the quotas they grant, and activate or deactivate them to control availability.")
|
|
165
|
+
})
|
|
166
|
+
] }), r.canManageAddons && /* @__PURE__ */ y("button", {
|
|
159
167
|
type: "button",
|
|
160
168
|
onClick: () => n("/addons/new"),
|
|
161
169
|
className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors",
|
|
@@ -181,20 +189,20 @@ var C = () => {
|
|
|
181
189
|
children: [
|
|
182
190
|
/* @__PURE__ */ v("button", {
|
|
183
191
|
type: "button",
|
|
184
|
-
onClick: () =>
|
|
185
|
-
className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${
|
|
192
|
+
onClick: () => F("all"),
|
|
193
|
+
className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${P === "all" ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-muted hover:text-text-primary"}`,
|
|
186
194
|
children: "All"
|
|
187
195
|
}),
|
|
188
196
|
/* @__PURE__ */ v("button", {
|
|
189
197
|
type: "button",
|
|
190
|
-
onClick: () =>
|
|
191
|
-
className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${
|
|
198
|
+
onClick: () => F("monthly"),
|
|
199
|
+
className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${P === "monthly" ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-muted hover:text-text-primary"}`,
|
|
192
200
|
children: "Monthly"
|
|
193
201
|
}),
|
|
194
202
|
/* @__PURE__ */ v("button", {
|
|
195
203
|
type: "button",
|
|
196
|
-
onClick: () =>
|
|
197
|
-
className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${
|
|
204
|
+
onClick: () => F("yearly"),
|
|
205
|
+
className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${P === "yearly" ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-muted hover:text-text-primary"}`,
|
|
198
206
|
children: "Yearly"
|
|
199
207
|
})
|
|
200
208
|
]
|
|
@@ -203,8 +211,8 @@ var C = () => {
|
|
|
203
211
|
className: "flex items-center gap-2 text-sm cursor-pointer",
|
|
204
212
|
children: [/* @__PURE__ */ v("input", {
|
|
205
213
|
type: "checkbox",
|
|
206
|
-
checked:
|
|
207
|
-
onChange: (e) =>
|
|
214
|
+
checked: M,
|
|
215
|
+
onChange: (e) => N(e.target.checked),
|
|
208
216
|
className: "size-4 rounded border-border-subtle text-text-link focus:ring-[var(--color-focus-ring)]"
|
|
209
217
|
}), /* @__PURE__ */ v("span", {
|
|
210
218
|
className: "text-text-muted",
|
|
@@ -215,8 +223,8 @@ var C = () => {
|
|
|
215
223
|
className: "ml-auto inline-flex rounded-lg border border-border-subtle p-1 bg-bg-sunken/50",
|
|
216
224
|
children: [/* @__PURE__ */ v("button", {
|
|
217
225
|
type: "button",
|
|
218
|
-
onClick: () =>
|
|
219
|
-
className: `p-1.5 rounded-md transition-colors ${
|
|
226
|
+
onClick: () => j("grid"),
|
|
227
|
+
className: `p-1.5 rounded-md transition-colors ${A === "grid" ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-muted hover:text-text-primary"}`,
|
|
220
228
|
title: "Grid view",
|
|
221
229
|
children: /* @__PURE__ */ v("svg", {
|
|
222
230
|
className: "size-4",
|
|
@@ -232,8 +240,8 @@ var C = () => {
|
|
|
232
240
|
})
|
|
233
241
|
}), /* @__PURE__ */ v("button", {
|
|
234
242
|
type: "button",
|
|
235
|
-
onClick: () =>
|
|
236
|
-
className: `p-1.5 rounded-md transition-colors ${
|
|
243
|
+
onClick: () => j("list"),
|
|
244
|
+
className: `p-1.5 rounded-md transition-colors ${A === "list" ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-muted hover:text-text-primary"}`,
|
|
237
245
|
title: "List view",
|
|
238
246
|
children: /* @__PURE__ */ v("svg", {
|
|
239
247
|
className: "size-4",
|
|
@@ -251,83 +259,60 @@ var C = () => {
|
|
|
251
259
|
})
|
|
252
260
|
]
|
|
253
261
|
}),
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
strokeLinecap: "round",
|
|
266
|
-
strokeLinejoin: "round",
|
|
267
|
-
strokeWidth: 2,
|
|
268
|
-
d: "M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"
|
|
269
|
-
})
|
|
270
|
-
})
|
|
271
|
-
}),
|
|
272
|
-
/* @__PURE__ */ v("h3", {
|
|
273
|
-
className: "text-lg font-medium text-text-primary",
|
|
274
|
-
children: t("billing.addons.noAddonsFound", "No addons found")
|
|
275
|
-
}),
|
|
276
|
-
/* @__PURE__ */ v("p", {
|
|
277
|
-
className: "text-sm text-text-muted mt-1",
|
|
278
|
-
children: A ? t("billing.addons.noAddonsFiltered", "No addons match your current filters.") : t("billing.addons.noActiveAddons", "There are no active addons available.")
|
|
279
|
-
}),
|
|
280
|
-
r.canManageAddons && /* @__PURE__ */ v("button", {
|
|
281
|
-
type: "button",
|
|
282
|
-
onClick: () => n("/addons/new"),
|
|
283
|
-
className: "mt-4 px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors",
|
|
284
|
-
children: t("billing.addons.createFirstAddon", "Create your first addon")
|
|
285
|
-
})
|
|
286
|
-
]
|
|
287
|
-
}) : O === "grid" ? /* @__PURE__ */ v("div", {
|
|
262
|
+
L.length === 0 ? /* @__PURE__ */ v(x, {
|
|
263
|
+
illustration: "empty-data",
|
|
264
|
+
title: t("billing.addons.noAddonsFound", "No addons found"),
|
|
265
|
+
description: M ? t("billing.addons.noAddonsFiltered", "No addons match your current filters.") : t("billing.addons.noActiveAddons", "There are no active addons available."),
|
|
266
|
+
action: r.canManageAddons ? /* @__PURE__ */ v("button", {
|
|
267
|
+
type: "button",
|
|
268
|
+
onClick: () => n("/addons/new"),
|
|
269
|
+
className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors",
|
|
270
|
+
children: t("billing.addons.createFirstAddon", "Create your first addon")
|
|
271
|
+
}) : void 0
|
|
272
|
+
}) : A === "grid" ? /* @__PURE__ */ v("div", {
|
|
288
273
|
className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",
|
|
289
|
-
children:
|
|
290
|
-
let t =
|
|
291
|
-
return /* @__PURE__ */ v(
|
|
274
|
+
children: L.map((e) => {
|
|
275
|
+
let t = k(e.id);
|
|
276
|
+
return /* @__PURE__ */ v(E, {
|
|
292
277
|
addon: e,
|
|
293
|
-
onView:
|
|
294
|
-
onEdit:
|
|
295
|
-
onToggle:
|
|
278
|
+
onView: z,
|
|
279
|
+
onEdit: B,
|
|
280
|
+
onToggle: R,
|
|
296
281
|
canManage: r.canManageAddons,
|
|
297
282
|
isToggling: g,
|
|
298
|
-
isInCart:
|
|
283
|
+
isInCart: T(e.id),
|
|
299
284
|
cartQuantity: t?.quantity || 0,
|
|
300
285
|
onAddToCart: _,
|
|
301
|
-
onUpdateQuantity:
|
|
302
|
-
onRemoveFromCart:
|
|
303
|
-
displayCurrency:
|
|
286
|
+
onUpdateQuantity: w,
|
|
287
|
+
onRemoveFromCart: C,
|
|
288
|
+
displayCurrency: I
|
|
304
289
|
}, e.id);
|
|
305
290
|
})
|
|
306
291
|
}) : /* @__PURE__ */ v("div", {
|
|
307
292
|
className: "space-y-3",
|
|
308
|
-
children:
|
|
309
|
-
let t =
|
|
310
|
-
return /* @__PURE__ */ v(
|
|
293
|
+
children: L.map((e) => {
|
|
294
|
+
let t = k(e.id);
|
|
295
|
+
return /* @__PURE__ */ v(D, {
|
|
311
296
|
addon: e,
|
|
312
|
-
onView:
|
|
313
|
-
onEdit:
|
|
314
|
-
onToggle:
|
|
297
|
+
onView: z,
|
|
298
|
+
onEdit: B,
|
|
299
|
+
onToggle: R,
|
|
315
300
|
canManage: r.canManageAddons,
|
|
316
301
|
isToggling: g,
|
|
317
|
-
isInCart:
|
|
302
|
+
isInCart: T(e.id),
|
|
318
303
|
cartQuantity: t?.quantity || 0,
|
|
319
304
|
onAddToCart: _,
|
|
320
|
-
onUpdateQuantity:
|
|
321
|
-
onRemoveFromCart:
|
|
322
|
-
displayCurrency:
|
|
305
|
+
onUpdateQuantity: w,
|
|
306
|
+
onRemoveFromCart: C,
|
|
307
|
+
displayCurrency: I
|
|
323
308
|
}, e.id);
|
|
324
309
|
})
|
|
325
310
|
}),
|
|
326
|
-
/* @__PURE__ */ v(
|
|
311
|
+
/* @__PURE__ */ v(O, { displayCurrency: I })
|
|
327
312
|
]
|
|
328
313
|
});
|
|
329
|
-
},
|
|
330
|
-
let
|
|
314
|
+
}, E = ({ addon: r, onView: i, onEdit: a, onToggle: o, canManage: s, displayCurrency: c, isToggling: l, isInCart: d, cartQuantity: g, onAddToCart: _, onUpdateQuantity: b, onRemoveFromCart: x }) => {
|
|
315
|
+
let S = u(() => C(r.features || []), [r.features]);
|
|
331
316
|
return /* @__PURE__ */ y("div", {
|
|
332
317
|
className: `relative border rounded-card p-6 shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:border-border-strong hover:shadow-[var(--shadow-elevation-2)] flex flex-col h-full ${r.isActive ? d ? "border-action-primary-bg bg-[var(--color-accent-soft)]" : "border-border-subtle bg-bg-surface" : "border-dashed border-text-muted/30 bg-bg-sunken/30"}`,
|
|
333
318
|
children: [
|
|
@@ -373,7 +358,7 @@ var C = () => {
|
|
|
373
358
|
children: [/* @__PURE__ */ v("span", {
|
|
374
359
|
className: "text-2xl font-bold text-text-primary",
|
|
375
360
|
children: (() => {
|
|
376
|
-
let { price: t, currency: n } =
|
|
361
|
+
let { price: t, currency: n } = w(r, c);
|
|
377
362
|
return e(t, n);
|
|
378
363
|
})()
|
|
379
364
|
}), /* @__PURE__ */ y("span", {
|
|
@@ -381,9 +366,9 @@ var C = () => {
|
|
|
381
366
|
children: ["/ ", t(r.duration)]
|
|
382
367
|
})]
|
|
383
368
|
}),
|
|
384
|
-
|
|
369
|
+
S.length > 0 && /* @__PURE__ */ y("ul", {
|
|
385
370
|
className: "space-y-2 mb-4",
|
|
386
|
-
children: [
|
|
371
|
+
children: [S.slice(0, 4).map((e) => /* @__PURE__ */ y("li", {
|
|
387
372
|
className: "flex items-center justify-between text-sm",
|
|
388
373
|
children: [/* @__PURE__ */ y("div", {
|
|
389
374
|
className: "flex items-center gap-2",
|
|
@@ -406,11 +391,11 @@ var C = () => {
|
|
|
406
391
|
className: "font-medium text-text-primary",
|
|
407
392
|
children: e.totalValue.toLocaleString()
|
|
408
393
|
})]
|
|
409
|
-
}, e.quotaId)),
|
|
394
|
+
}, e.quotaId)), S.length > 4 && /* @__PURE__ */ y("li", {
|
|
410
395
|
className: "text-sm text-text-muted pl-6",
|
|
411
396
|
children: [
|
|
412
397
|
"+",
|
|
413
|
-
|
|
398
|
+
S.length - 4,
|
|
414
399
|
" more quotas"
|
|
415
400
|
]
|
|
416
401
|
})]
|
|
@@ -442,7 +427,7 @@ var C = () => {
|
|
|
442
427
|
]
|
|
443
428
|
}), /* @__PURE__ */ v("button", {
|
|
444
429
|
type: "button",
|
|
445
|
-
onClick: () =>
|
|
430
|
+
onClick: () => x(r.id),
|
|
446
431
|
className: "p-1.5 rounded text-status-error-text hover:bg-status-error-bg-subtle transition-colors",
|
|
447
432
|
title: "Remove from cart",
|
|
448
433
|
children: /* @__PURE__ */ v(h, { className: "size-4" })
|
|
@@ -478,8 +463,8 @@ var C = () => {
|
|
|
478
463
|
})
|
|
479
464
|
]
|
|
480
465
|
});
|
|
481
|
-
},
|
|
482
|
-
let
|
|
466
|
+
}, D = ({ addon: n, onView: r, onEdit: i, onToggle: a, canManage: o, displayCurrency: s, isToggling: c, isInCart: l, cartQuantity: d, onAddToCart: g, onUpdateQuantity: b, onRemoveFromCart: x }) => {
|
|
467
|
+
let S = u(() => C(n.features || []), [n.features]);
|
|
483
468
|
return /* @__PURE__ */ y("div", {
|
|
484
469
|
className: `flex items-center gap-4 p-4 border rounded-card shadow-[var(--shadow-elevation-1)] transition-all duration-200 hover:border-border-strong hover:shadow-[var(--shadow-elevation-2)] ${n.isActive ? l ? "border-action-primary-bg bg-[var(--color-accent-soft)]" : "border-border-subtle bg-bg-surface" : "border-dashed border-text-muted/30 bg-bg-sunken/30"}`,
|
|
485
470
|
children: [
|
|
@@ -523,9 +508,9 @@ var C = () => {
|
|
|
523
508
|
}), /* @__PURE__ */ y("p", {
|
|
524
509
|
className: "text-sm text-text-muted",
|
|
525
510
|
children: [
|
|
526
|
-
|
|
511
|
+
S.length,
|
|
527
512
|
" quota",
|
|
528
|
-
|
|
513
|
+
S.length === 1 ? "" : "s"
|
|
529
514
|
]
|
|
530
515
|
})]
|
|
531
516
|
}),
|
|
@@ -534,7 +519,7 @@ var C = () => {
|
|
|
534
519
|
children: [/* @__PURE__ */ v("div", {
|
|
535
520
|
className: "font-semibold text-text-primary",
|
|
536
521
|
children: (() => {
|
|
537
|
-
let { price: t, currency: r } =
|
|
522
|
+
let { price: t, currency: r } = w(n, s);
|
|
538
523
|
return e(t, r);
|
|
539
524
|
})()
|
|
540
525
|
}), /* @__PURE__ */ y("div", {
|
|
@@ -563,7 +548,7 @@ var C = () => {
|
|
|
563
548
|
}),
|
|
564
549
|
/* @__PURE__ */ v("button", {
|
|
565
550
|
type: "button",
|
|
566
|
-
onClick: () =>
|
|
551
|
+
onClick: () => x(n.id),
|
|
567
552
|
className: "p-1.5 rounded text-status-error-text hover:bg-status-error-bg-subtle transition-colors ml-1",
|
|
568
553
|
title: "Remove from cart",
|
|
569
554
|
children: /* @__PURE__ */ v(h, { className: "size-4" })
|
|
@@ -597,7 +582,7 @@ var C = () => {
|
|
|
597
582
|
})
|
|
598
583
|
]
|
|
599
584
|
});
|
|
600
|
-
},
|
|
585
|
+
}, O = ({ displayCurrency: n }) => {
|
|
601
586
|
let r = o(), { items: i, isCartOpen: s, toggleCart: c, closeCart: l, removeFromCart: u, updateQuantity: d, clearCart: b } = a(), x = i.reduce((e, t) => e + t.quantity, 0);
|
|
602
587
|
return i.length === 0 && !s ? null : /* @__PURE__ */ y(_, { children: [!s && i.length > 0 && /* @__PURE__ */ y("button", {
|
|
603
588
|
type: "button",
|
|
@@ -616,7 +601,7 @@ var C = () => {
|
|
|
616
601
|
/* @__PURE__ */ v("span", {
|
|
617
602
|
className: "px-2 py-0.5 bg-[var(--color-accent-soft)] rounded-full text-sm",
|
|
618
603
|
children: e(i.reduce((e, { addon: t, quantity: r }) => {
|
|
619
|
-
let { price: i } =
|
|
604
|
+
let { price: i } = w(t, n);
|
|
620
605
|
return e + i * r;
|
|
621
606
|
}, 0), n)
|
|
622
607
|
})
|
|
@@ -684,7 +669,7 @@ var C = () => {
|
|
|
684
669
|
className: "text-sm text-text-muted",
|
|
685
670
|
children: [
|
|
686
671
|
(() => {
|
|
687
|
-
let { price: t, currency: i } =
|
|
672
|
+
let { price: t, currency: i } = w(r, n);
|
|
688
673
|
return e(t, i);
|
|
689
674
|
})(),
|
|
690
675
|
" ",
|
|
@@ -719,7 +704,7 @@ var C = () => {
|
|
|
719
704
|
children: /* @__PURE__ */ v("p", {
|
|
720
705
|
className: "font-medium text-text-primary",
|
|
721
706
|
children: (() => {
|
|
722
|
-
let { price: t, currency: a } =
|
|
707
|
+
let { price: t, currency: a } = w(r, n);
|
|
723
708
|
return e(t * i, a);
|
|
724
709
|
})()
|
|
725
710
|
})
|
|
@@ -743,7 +728,7 @@ var C = () => {
|
|
|
743
728
|
}), /* @__PURE__ */ v("span", {
|
|
744
729
|
className: "text-text-primary",
|
|
745
730
|
children: e(i.reduce((e, { addon: t, quantity: r }) => {
|
|
746
|
-
let { price: i } =
|
|
731
|
+
let { price: i } = w(t, n);
|
|
747
732
|
return e + i * r;
|
|
748
733
|
}, 0), n)
|
|
749
734
|
})]
|
|
@@ -769,6 +754,6 @@ var C = () => {
|
|
|
769
754
|
})] });
|
|
770
755
|
};
|
|
771
756
|
//#endregion
|
|
772
|
-
export {
|
|
757
|
+
export { T as AddonsListPage };
|
|
773
758
|
|
|
774
759
|
//# sourceMappingURL=AddonsListPage.js.map
|