@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
|
@@ -24,110 +24,110 @@ import { useCallback as a, useEffect as o, useState as s } from "react";
|
|
|
24
24
|
import { Activity as he, ArrowRight as ge, Building2 as c, Check as l, ChevronDown as _e, Coins as ve, Crown as ye, Loader2 as be, Plus as u, Receipt as xe, RefreshCw as Se, Sparkles as Ce, Wallet as d } from "lucide-react";
|
|
25
25
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
26
26
|
import { useI18n as we } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
27
|
-
import { AuroraBackground as h, Button as Te, CTAOverflowMenu as Ee, GlassCard as De, GradientText as g, IllustratedEmptyState as Oe } from "@burdenoff/fe-libs/ui";
|
|
27
|
+
import { AuroraBackground as h, Button as Te, CTAOverflowMenu as Ee, GlassCard as De, GradientText as g, IllustratedEmptyState as Oe, PagePurpose as ke } from "@burdenoff/fe-libs/ui";
|
|
28
28
|
//#region src/billing/modules/dashboard/pages/OverviewPage.tsx
|
|
29
29
|
var _ = () => {
|
|
30
30
|
let { t: _ } = we(), v = (e, t) => {
|
|
31
31
|
let n = _(e);
|
|
32
32
|
return n === e ? t : n;
|
|
33
|
-
}, { navigate: y, basePath: b, orgId: x, productId:
|
|
34
|
-
|
|
35
|
-
}, [x]), { addToCart:
|
|
33
|
+
}, { navigate: y, basePath: b, orgId: x, productId: Ae } = e(), S = ae(), { emit: C } = te(), [w, je] = s(() => ne(x)), [T, E] = s(!1), [D, O] = s(null), [k, A] = s(!1), [Me, j] = s(!1), [M, N] = s(0), [P, F] = s(!1), { billingAccounts: I, currentAccount: L, paymentMethods: R, activeSubscriptions: z, hasActiveSubscription: B, recommendedAddons: Ne, isLoading: V, error: H, refetchAll: U } = se(w, Ae), W = L?.id, Pe = V, G = a((e) => {
|
|
34
|
+
je(e), re(x, e);
|
|
35
|
+
}, [x]), { addToCart: K, isInCart: q, getCartItem: J, updateQuantity: Y, removeFromCart: X } = pe(), { createBillingAccount: Fe, setBillingAddress: Ie, setDefaultPaymentMethod: Le, deletePaymentMethod: Re, isCreatingAccount: ze } = oe();
|
|
36
36
|
o(() => {
|
|
37
|
-
|
|
38
|
-
}, [
|
|
39
|
-
w &&
|
|
37
|
+
N(0), F(!1);
|
|
38
|
+
}, [W, z.length]), o(() => {
|
|
39
|
+
w && I.length > 0 && (I.some((e) => e.id === w) || G(null));
|
|
40
40
|
}, [
|
|
41
|
-
|
|
41
|
+
I,
|
|
42
42
|
w,
|
|
43
|
-
|
|
43
|
+
G
|
|
44
44
|
]), o(() => {
|
|
45
|
-
!w &&
|
|
45
|
+
!w && I.length > 0 && G((I.find((e) => e.isDefault) ?? I[0]).id);
|
|
46
46
|
}, [
|
|
47
|
-
|
|
47
|
+
I,
|
|
48
48
|
w,
|
|
49
|
-
|
|
49
|
+
G
|
|
50
50
|
]);
|
|
51
|
-
let Z =
|
|
51
|
+
let Z = z[M] || z[0] || null, Q = a((e) => {
|
|
52
52
|
let t = e;
|
|
53
53
|
b && b !== "/" && (t = `${b.endsWith("/") ? b.slice(0, -1) : b}${e.startsWith("/") ? e : `/${e}`}`), y(t);
|
|
54
|
-
}, [y, b]),
|
|
54
|
+
}, [y, b]), Be = a(async (e, t) => {
|
|
55
55
|
O(null);
|
|
56
56
|
try {
|
|
57
|
-
let n = await
|
|
58
|
-
t && n.id && await
|
|
57
|
+
let n = await Fe(e);
|
|
58
|
+
t && n.id && await Ie({
|
|
59
59
|
billingAccountId: n.id,
|
|
60
60
|
...t
|
|
61
|
-
}), E(!1),
|
|
61
|
+
}), E(!1), G(n.id), C("billing.billing_account.created", {
|
|
62
62
|
route: "/billing/overview",
|
|
63
63
|
entityId: n.id,
|
|
64
64
|
source: "overview"
|
|
65
|
-
}), await
|
|
65
|
+
}), await U();
|
|
66
66
|
} catch (e) {
|
|
67
67
|
O(e instanceof Error ? e.message : "Failed to create billing account");
|
|
68
68
|
}
|
|
69
69
|
}, [
|
|
70
|
-
X,
|
|
71
|
-
C,
|
|
72
|
-
H,
|
|
73
70
|
Fe,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
71
|
+
C,
|
|
72
|
+
U,
|
|
73
|
+
Ie,
|
|
74
|
+
G
|
|
75
|
+
]), Ve = a(() => {
|
|
76
|
+
j(!0);
|
|
77
77
|
}, []), $ = a(async () => {
|
|
78
|
-
await
|
|
79
|
-
}, [
|
|
78
|
+
await U();
|
|
79
|
+
}, [U]), He = a(async () => {
|
|
80
80
|
C("billing.payment_method.added", {
|
|
81
81
|
route: "/billing/overview",
|
|
82
|
-
entityId:
|
|
82
|
+
entityId: W,
|
|
83
83
|
source: "overview"
|
|
84
84
|
}), await $();
|
|
85
85
|
}, [
|
|
86
|
-
|
|
86
|
+
W,
|
|
87
87
|
C,
|
|
88
88
|
$
|
|
89
|
-
]),
|
|
90
|
-
|
|
89
|
+
]), Ue = a(async (e) => {
|
|
90
|
+
W && (await Le(e, W), C("billing.payment_method.default_set", {
|
|
91
91
|
route: "/billing/overview",
|
|
92
92
|
entityId: e,
|
|
93
93
|
source: "overview"
|
|
94
94
|
}), await $());
|
|
95
95
|
}, [
|
|
96
|
-
|
|
96
|
+
W,
|
|
97
97
|
C,
|
|
98
|
-
|
|
98
|
+
Le,
|
|
99
99
|
$
|
|
100
|
-
]),
|
|
101
|
-
|
|
100
|
+
]), We = a(async (e) => {
|
|
101
|
+
W && (await Re(e, W), C("billing.payment_method.deleted", {
|
|
102
102
|
route: "/billing/overview",
|
|
103
103
|
entityId: e,
|
|
104
104
|
source: "overview"
|
|
105
105
|
}), await $());
|
|
106
106
|
}, [
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
W,
|
|
108
|
+
Re,
|
|
109
109
|
C,
|
|
110
110
|
$
|
|
111
|
-
]),
|
|
112
|
-
|
|
113
|
-
}, [
|
|
114
|
-
await
|
|
115
|
-
}, [
|
|
116
|
-
|
|
117
|
-
}, [
|
|
118
|
-
t <= 0 ?
|
|
119
|
-
}, [
|
|
120
|
-
|
|
121
|
-
}, [
|
|
122
|
-
return S.canViewBillingAccount ?
|
|
111
|
+
]), Ge = a((e) => {
|
|
112
|
+
G(e.id), A(!1);
|
|
113
|
+
}, [G]), Ke = a(async () => {
|
|
114
|
+
await U();
|
|
115
|
+
}, [U]), qe = a((e) => {
|
|
116
|
+
K(e);
|
|
117
|
+
}, [K]), Je = a((e) => q(e), [q]), Ye = a((e) => J(e)?.quantity || 0, [J]), Xe = a((e, t) => {
|
|
118
|
+
t <= 0 ? X(e) : Y(e, t);
|
|
119
|
+
}, [Y, X]), Ze = a((e) => {
|
|
120
|
+
X(e);
|
|
121
|
+
}, [X]);
|
|
122
|
+
return S.canViewBillingAccount ? H && ie(H) && !V ? /* @__PURE__ */ p("div", {
|
|
123
123
|
className: "p-6",
|
|
124
124
|
children: /* @__PURE__ */ p(ee, {
|
|
125
125
|
title: "Server Unavailable",
|
|
126
126
|
message: "Unable to load billing overview. The server might be down or experiencing issues.",
|
|
127
|
-
onRetry:
|
|
127
|
+
onRetry: Ke,
|
|
128
128
|
showRetry: !0
|
|
129
129
|
})
|
|
130
|
-
}) :
|
|
130
|
+
}) : V && !L ? /* @__PURE__ */ p("div", {
|
|
131
131
|
className: "flex items-center justify-center min-h-[400px]",
|
|
132
132
|
children: /* @__PURE__ */ m("div", {
|
|
133
133
|
className: "flex flex-col items-center gap-3",
|
|
@@ -136,7 +136,7 @@ var _ = () => {
|
|
|
136
136
|
children: v("billing.overview.loadingInfo", "Loading billing information...")
|
|
137
137
|
})]
|
|
138
138
|
})
|
|
139
|
-
}) : !
|
|
139
|
+
}) : !V && I.length === 0 ? /* @__PURE__ */ m("div", {
|
|
140
140
|
className: "px-6 lg:px-8 py-6",
|
|
141
141
|
children: [
|
|
142
142
|
/* @__PURE__ */ m("header", {
|
|
@@ -169,8 +169,8 @@ var _ = () => {
|
|
|
169
169
|
onClose: () => {
|
|
170
170
|
E(!1), O(null);
|
|
171
171
|
},
|
|
172
|
-
onSubmit:
|
|
173
|
-
isSubmitting:
|
|
172
|
+
onSubmit: Be,
|
|
173
|
+
isSubmitting: ze,
|
|
174
174
|
error: D
|
|
175
175
|
})
|
|
176
176
|
]
|
|
@@ -181,15 +181,22 @@ var _ = () => {
|
|
|
181
181
|
className: "relative overflow-hidden rounded-card flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",
|
|
182
182
|
children: [
|
|
183
183
|
/* @__PURE__ */ p(h, { intensity: "subtle" }),
|
|
184
|
-
/* @__PURE__ */ m("div", { children: [
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
184
|
+
/* @__PURE__ */ m("div", { children: [
|
|
185
|
+
/* @__PURE__ */ p("h1", {
|
|
186
|
+
className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
|
|
187
|
+
children: /* @__PURE__ */ p(g, { children: v("billing.overview.title", "Billing Overview") })
|
|
188
|
+
}),
|
|
189
|
+
/* @__PURE__ */ p("p", {
|
|
190
|
+
className: "text-sm text-text-secondary mt-1",
|
|
191
|
+
children: v("billing.overview.description", "Manage your billing accounts, subscriptions, and payment methods")
|
|
192
|
+
}),
|
|
193
|
+
/* @__PURE__ */ p(ke, {
|
|
194
|
+
className: "mt-3",
|
|
195
|
+
children: v("billing.overview.purpose", "Your billing home base — see your current plan, credit balance and payment methods at a glance, and jump to transactions, usage, credits or new plans. Start here to understand what you are paying for and manage it.")
|
|
196
|
+
})
|
|
197
|
+
] }),
|
|
191
198
|
/* @__PURE__ */ p(Ee, {
|
|
192
|
-
primary: S.canManageBillingAccount &&
|
|
199
|
+
primary: S.canManageBillingAccount && I.length > 0 ? {
|
|
193
200
|
label: v("billing.overview.newAccount", "New Account"),
|
|
194
201
|
onSelect: () => E(!0),
|
|
195
202
|
icon: /* @__PURE__ */ p(u, { className: "size-4" })
|
|
@@ -197,14 +204,14 @@ var _ = () => {
|
|
|
197
204
|
actions: [{
|
|
198
205
|
label: v("billing.overview.refresh", "Refresh"),
|
|
199
206
|
onSelect: () => {
|
|
200
|
-
|
|
207
|
+
Ke();
|
|
201
208
|
},
|
|
202
|
-
icon: /* @__PURE__ */ p(Se, { className: `size-4 ${
|
|
209
|
+
icon: /* @__PURE__ */ p(Se, { className: `size-4 ${V ? "animate-spin" : ""}` })
|
|
203
210
|
}]
|
|
204
211
|
})
|
|
205
212
|
]
|
|
206
213
|
}),
|
|
207
|
-
|
|
214
|
+
I.length > 1 && /* @__PURE__ */ m("div", {
|
|
208
215
|
className: "relative",
|
|
209
216
|
"data-tour": "billing-overview-account-selector",
|
|
210
217
|
children: [/* @__PURE__ */ m("button", {
|
|
@@ -220,10 +227,10 @@ var _ = () => {
|
|
|
220
227
|
className: "text-left",
|
|
221
228
|
children: [/* @__PURE__ */ p("p", {
|
|
222
229
|
className: "text-sm font-medium text-text-primary",
|
|
223
|
-
children:
|
|
230
|
+
children: L?.name || v("billing.overview.selectAccount", "Select Account")
|
|
224
231
|
}), /* @__PURE__ */ p("p", {
|
|
225
232
|
className: "text-xs text-text-secondary",
|
|
226
|
-
children:
|
|
233
|
+
children: L?.email
|
|
227
234
|
})]
|
|
228
235
|
})]
|
|
229
236
|
}), /* @__PURE__ */ p(_e, { className: `size-4 text-text-muted transition-transform ${k ? "rotate-180" : ""}` })]
|
|
@@ -232,9 +239,9 @@ var _ = () => {
|
|
|
232
239
|
onClick: () => A(!1)
|
|
233
240
|
}), /* @__PURE__ */ p("div", {
|
|
234
241
|
className: "absolute top-full left-0 right-0 sm:right-auto mt-1 w-full sm:w-80 bg-bg-elevated border border-border-seam rounded-card shadow-elevation-3 z-20 py-1 max-h-60 overflow-y-auto",
|
|
235
|
-
children:
|
|
242
|
+
children: I.map((e) => /* @__PURE__ */ m("button", {
|
|
236
243
|
type: "button",
|
|
237
|
-
onClick: () =>
|
|
244
|
+
onClick: () => Ge(e),
|
|
238
245
|
className: "w-full flex items-center justify-between gap-3 px-4 py-3 hover:bg-bg-sunken transition-colors",
|
|
239
246
|
children: [/* @__PURE__ */ m("div", {
|
|
240
247
|
className: "flex items-center gap-3 min-w-0",
|
|
@@ -251,32 +258,32 @@ var _ = () => {
|
|
|
251
258
|
children: e.email
|
|
252
259
|
})]
|
|
253
260
|
})]
|
|
254
|
-
}),
|
|
261
|
+
}), L?.id === e.id && /* @__PURE__ */ p(l, { className: "size-4 text-text-link flex-shrink-0" })]
|
|
255
262
|
}, e.id))
|
|
256
263
|
})] })]
|
|
257
264
|
}),
|
|
258
|
-
|
|
265
|
+
L && /* @__PURE__ */ m("div", {
|
|
259
266
|
className: "grid grid-cols-1 xs:grid-cols-2 sm:grid-cols-4 gap-3 sm:gap-4",
|
|
260
267
|
"data-tour": "billing-overview-stats-row",
|
|
261
268
|
children: [
|
|
262
269
|
/* @__PURE__ */ p(n, {
|
|
263
270
|
label: v("billing.overview.stats.creditBalance", "Credit Balance"),
|
|
264
|
-
value: `${(
|
|
271
|
+
value: `${(L.creditAmount || 0).toLocaleString()} Credits`,
|
|
265
272
|
icon: /* @__PURE__ */ p(d, { className: "size-5" })
|
|
266
273
|
}),
|
|
267
274
|
/* @__PURE__ */ p(n, {
|
|
268
275
|
label: v("billing.overview.stats.activePlans", "Active Plans"),
|
|
269
|
-
value:
|
|
276
|
+
value: z.length > 0 ? z.length === 1 ? z[0]?.plan?.name || "1 Plan" : `${z.length} ${v("billing.overview.stats.plansSuffix", "Plans")}` : v("billing.overview.stats.none", "None"),
|
|
270
277
|
icon: /* @__PURE__ */ p(Se, { className: "size-5" })
|
|
271
278
|
}),
|
|
272
279
|
/* @__PURE__ */ p(n, {
|
|
273
280
|
label: v("billing.overview.stats.paymentMethods", "Payment Methods"),
|
|
274
|
-
value:
|
|
281
|
+
value: R.length,
|
|
275
282
|
icon: /* @__PURE__ */ p(c, { className: "size-5" })
|
|
276
283
|
}),
|
|
277
284
|
/* @__PURE__ */ p(n, {
|
|
278
285
|
label: v("billing.overview.stats.paymentCurrency", "Payment Currency"),
|
|
279
|
-
value:
|
|
286
|
+
value: L.currency || "USD",
|
|
280
287
|
icon: /* @__PURE__ */ p(c, { className: "size-5" })
|
|
281
288
|
})
|
|
282
289
|
]
|
|
@@ -286,21 +293,21 @@ var _ = () => {
|
|
|
286
293
|
children: [/* @__PURE__ */ m("div", {
|
|
287
294
|
className: "lg:col-span-2 space-y-6",
|
|
288
295
|
children: [
|
|
289
|
-
|
|
296
|
+
L && /* @__PURE__ */ p(ce, {
|
|
290
297
|
dataTour: "billing-overview-billing-account-card",
|
|
291
|
-
account:
|
|
292
|
-
isDefault:
|
|
293
|
-
onEdit: () =>
|
|
294
|
-
onViewTransactions: () => Q(`/transactions/${
|
|
295
|
-
onViewCreditTransactions: () => Q(`/creditTransactions/${
|
|
298
|
+
account: L,
|
|
299
|
+
isDefault: L.isDefault ?? !1,
|
|
300
|
+
onEdit: () => L && Q(`/settings?billingAccountId=${L.id}`),
|
|
301
|
+
onViewTransactions: () => Q(`/transactions/${L.id}`),
|
|
302
|
+
onViewCreditTransactions: () => Q(`/creditTransactions/${L.id}`)
|
|
296
303
|
}),
|
|
297
304
|
/* @__PURE__ */ m("div", {
|
|
298
305
|
className: "space-y-3",
|
|
299
|
-
children: [
|
|
306
|
+
children: [z.length > 1 && /* @__PURE__ */ m("div", {
|
|
300
307
|
className: "relative",
|
|
301
308
|
children: [/* @__PURE__ */ m("button", {
|
|
302
309
|
type: "button",
|
|
303
|
-
onClick: () =>
|
|
310
|
+
onClick: () => F(!P),
|
|
304
311
|
className: "w-full sm:w-auto flex items-center justify-between gap-3 px-4 py-3 border border-border-seam rounded-card bg-bg-surface hover:bg-bg-sunken hover:border-border-strong transition-all duration-200",
|
|
305
312
|
children: [/* @__PURE__ */ m("div", {
|
|
306
313
|
className: "flex items-center gap-3",
|
|
@@ -322,22 +329,22 @@ var _ = () => {
|
|
|
322
329
|
}), /* @__PURE__ */ m("p", {
|
|
323
330
|
className: "text-xs text-text-secondary",
|
|
324
331
|
children: [
|
|
325
|
-
|
|
332
|
+
z.length,
|
|
326
333
|
" ",
|
|
327
334
|
v("billing.overview.activeSubscriptions", "active subscriptions")
|
|
328
335
|
]
|
|
329
336
|
})]
|
|
330
337
|
})]
|
|
331
|
-
}), /* @__PURE__ */ p(_e, { className: `size-4 text-text-muted transition-transform ${
|
|
332
|
-
}),
|
|
338
|
+
}), /* @__PURE__ */ p(_e, { className: `size-4 text-text-muted transition-transform ${P ? "rotate-180" : ""}` })]
|
|
339
|
+
}), P && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", {
|
|
333
340
|
className: "fixed inset-0 z-10",
|
|
334
|
-
onClick: () =>
|
|
341
|
+
onClick: () => F(!1)
|
|
335
342
|
}), /* @__PURE__ */ p("div", {
|
|
336
343
|
className: "absolute top-full left-0 right-0 sm:right-auto mt-1 w-full sm:w-80 bg-bg-elevated border border-border-seam rounded-card shadow-elevation-3 z-20 py-1 max-h-60 overflow-y-auto",
|
|
337
|
-
children:
|
|
344
|
+
children: z.map((e, t) => /* @__PURE__ */ m("button", {
|
|
338
345
|
type: "button",
|
|
339
346
|
onClick: () => {
|
|
340
|
-
|
|
347
|
+
N(t), F(!1);
|
|
341
348
|
},
|
|
342
349
|
className: "w-full flex items-center justify-between gap-3 px-4 py-3 hover:bg-bg-sunken transition-colors",
|
|
343
350
|
children: [/* @__PURE__ */ m("div", {
|
|
@@ -362,26 +369,26 @@ var _ = () => {
|
|
|
362
369
|
]
|
|
363
370
|
})]
|
|
364
371
|
})]
|
|
365
|
-
}),
|
|
372
|
+
}), M === t && /* @__PURE__ */ p(l, { className: "size-4 text-text-link flex-shrink-0" })]
|
|
366
373
|
}, e.id))
|
|
367
374
|
})] })]
|
|
368
375
|
}), /* @__PURE__ */ p(ue, {
|
|
369
376
|
dataTour: "billing-overview-active-subscription-card",
|
|
370
377
|
subscription: Z,
|
|
371
|
-
onViewDetails: () => Z && Q(i(`/subscriptions/${Z.id}`, Z.billingAccountId ??
|
|
372
|
-
onUpgrade: () => Z && Q(i(`/subscriptions/${Z.id}/upgrade`, Z.billingAccountId ??
|
|
373
|
-
onManage: () =>
|
|
378
|
+
onViewDetails: () => Z && Q(i(`/subscriptions/${Z.id}`, Z.billingAccountId ?? L?.id)),
|
|
379
|
+
onUpgrade: () => Z && Q(i(`/subscriptions/${Z.id}/upgrade`, Z.billingAccountId ?? L?.id)),
|
|
380
|
+
onManage: () => L && Q(`/subscriptions?billingAccountId=${L.id}`),
|
|
374
381
|
onPurchasePlan: () => Q("/plans")
|
|
375
382
|
})]
|
|
376
383
|
}),
|
|
377
|
-
|
|
384
|
+
L && /* @__PURE__ */ p(le, {
|
|
378
385
|
dataTour: "billing-overview-payment-methods-section",
|
|
379
|
-
paymentMethods:
|
|
380
|
-
billingAccountId:
|
|
381
|
-
onAddPaymentMethod:
|
|
382
|
-
onSetDefault:
|
|
383
|
-
onDelete:
|
|
384
|
-
isLoading:
|
|
386
|
+
paymentMethods: R,
|
|
387
|
+
billingAccountId: L.id,
|
|
388
|
+
onAddPaymentMethod: Ve,
|
|
389
|
+
onSetDefault: Ue,
|
|
390
|
+
onDelete: We,
|
|
391
|
+
isLoading: V
|
|
385
392
|
})
|
|
386
393
|
]
|
|
387
394
|
}), /* @__PURE__ */ m("div", {
|
|
@@ -397,8 +404,8 @@ var _ = () => {
|
|
|
397
404
|
children: [
|
|
398
405
|
/* @__PURE__ */ m("button", {
|
|
399
406
|
type: "button",
|
|
400
|
-
onClick: () =>
|
|
401
|
-
disabled: !
|
|
407
|
+
onClick: () => L && Q(`/transactions/${L.id}`),
|
|
408
|
+
disabled: !L,
|
|
402
409
|
className: "w-full flex items-center gap-3 px-3 py-2.5 text-sm text-left text-text-primary hover:bg-bg-sunken rounded-button transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
403
410
|
children: [/* @__PURE__ */ p("div", {
|
|
404
411
|
className: "size-9 rounded-lg bg-status-info-bg-subtle flex items-center justify-center",
|
|
@@ -407,8 +414,8 @@ var _ = () => {
|
|
|
407
414
|
}),
|
|
408
415
|
/* @__PURE__ */ m("button", {
|
|
409
416
|
type: "button",
|
|
410
|
-
onClick: () =>
|
|
411
|
-
disabled: !
|
|
417
|
+
onClick: () => L && Q(`/creditTransactions/${L.id}`),
|
|
418
|
+
disabled: !L,
|
|
412
419
|
className: "w-full flex items-center gap-3 px-3 py-2.5 text-sm text-left text-text-primary hover:bg-bg-sunken rounded-button transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
413
420
|
children: [/* @__PURE__ */ p("div", {
|
|
414
421
|
className: "size-9 rounded-lg bg-status-warning-bg-subtle flex items-center justify-center",
|
|
@@ -426,8 +433,8 @@ var _ = () => {
|
|
|
426
433
|
}),
|
|
427
434
|
/* @__PURE__ */ m("button", {
|
|
428
435
|
type: "button",
|
|
429
|
-
onClick: () =>
|
|
430
|
-
disabled: !
|
|
436
|
+
onClick: () => L && Q(`/usage?billingAccountId=${L.id}`),
|
|
437
|
+
disabled: !L,
|
|
431
438
|
className: "w-full flex items-center gap-3 px-3 py-2.5 text-sm text-left text-text-primary hover:bg-bg-sunken rounded-button transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
432
439
|
children: [/* @__PURE__ */ p("div", {
|
|
433
440
|
className: "size-9 rounded-lg bg-[var(--color-accent-soft)] flex items-center justify-center",
|
|
@@ -436,7 +443,7 @@ var _ = () => {
|
|
|
436
443
|
})
|
|
437
444
|
]
|
|
438
445
|
})]
|
|
439
|
-
}), !
|
|
446
|
+
}), !B && /* @__PURE__ */ m(De, {
|
|
440
447
|
treatment: "glass",
|
|
441
448
|
glow: !0,
|
|
442
449
|
className: "p-5",
|
|
@@ -464,15 +471,15 @@ var _ = () => {
|
|
|
464
471
|
/* @__PURE__ */ p(de, {
|
|
465
472
|
dataTour: "billing-overview-recommended-addons",
|
|
466
473
|
addons: Ne,
|
|
467
|
-
hasSubscription:
|
|
474
|
+
hasSubscription: B,
|
|
468
475
|
onViewAddon: (e) => Q(`/addons/${e}`),
|
|
469
476
|
onPurchaseAddon: (e) => Q(`/addons/${e}?action=purchase`),
|
|
470
477
|
onViewAllAddons: () => Q("/addons"),
|
|
471
|
-
onAddToCart:
|
|
472
|
-
isInCart:
|
|
473
|
-
getCartQuantity:
|
|
474
|
-
onUpdateQuantity:
|
|
475
|
-
onRemoveFromCart:
|
|
478
|
+
onAddToCart: qe,
|
|
479
|
+
isInCart: Je,
|
|
480
|
+
getCartQuantity: Ye,
|
|
481
|
+
onUpdateQuantity: Xe,
|
|
482
|
+
onRemoveFromCart: Ze,
|
|
476
483
|
maxAddons: 3,
|
|
477
484
|
isLoading: Pe
|
|
478
485
|
}),
|
|
@@ -482,17 +489,17 @@ var _ = () => {
|
|
|
482
489
|
onClose: () => {
|
|
483
490
|
E(!1), O(null);
|
|
484
491
|
},
|
|
485
|
-
onSubmit:
|
|
486
|
-
isSubmitting:
|
|
492
|
+
onSubmit: Be,
|
|
493
|
+
isSubmitting: ze,
|
|
487
494
|
error: D
|
|
488
495
|
}),
|
|
489
|
-
|
|
490
|
-
isOpen:
|
|
491
|
-
onClose: () =>
|
|
492
|
-
billingAccountId:
|
|
493
|
-
currency:
|
|
494
|
-
country:
|
|
495
|
-
onSuccess:
|
|
496
|
+
L && /* @__PURE__ */ p(fe, {
|
|
497
|
+
isOpen: Me,
|
|
498
|
+
onClose: () => j(!1),
|
|
499
|
+
billingAccountId: L.id,
|
|
500
|
+
currency: L.currency,
|
|
501
|
+
country: L.billingAddresses?.[0]?.country,
|
|
502
|
+
onSuccess: He
|
|
496
503
|
})
|
|
497
504
|
]
|
|
498
505
|
}) : /* @__PURE__ */ p(t, { message: "You don't have permission to view billing information." });
|