@burdenoff/microfe-billing 2026.912.6 → 2026.914.1
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/BillingAdminRoutes.js +100 -74
- package/dist/billing/BillingAdminRoutes.js.map +1 -1
- package/dist/billing/modules/billing/hooks/useRefunds.js.map +1 -1
- package/dist/billing/modules/billing/index.js +5 -4
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +90 -87
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js +240 -0
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js.map +1 -0
- package/dist/billing/modules/billing/pages/RefundsPage.js +116 -108
- package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/index.js +1 -0
- package/dist/billing/modules/checkout/components/OrderSummary.js +22 -19
- package/dist/billing/modules/checkout/components/OrderSummary.js.map +1 -1
- package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js.map +1 -1
- package/dist/billing/modules/checkout/hooks/useCheckout.js +174 -157
- package/dist/billing/modules/checkout/hooks/useCheckout.js.map +1 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.js +189 -182
- package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +293 -274
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js +140 -250
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js.map +1 -1
- package/dist/billing/modules/earnings/api.js +79 -42
- package/dist/billing/modules/earnings/api.js.map +1 -1
- package/dist/billing/modules/earnings/index.js +4 -3
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +103 -310
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +545 -0
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -0
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +246 -196
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js +44 -28
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +317 -270
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +153 -150
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +1 -1
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
- package/dist/billing/modules/usage/hooks/useUsage.js +74 -48
- package/dist/billing/modules/usage/hooks/useUsage.js.map +1 -1
- package/dist/generated/global-operations.js +221 -183
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.js.map +1 -1
- package/dist/node_modules/sonner/dist/index.js +163 -0
- package/dist/node_modules/sonner/dist/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -11,56 +11,59 @@ import { withBillingAccountId as d } from "../../../shared/utils/navigation.js";
|
|
|
11
11
|
import { useBillingAccounts as f, usePaginatedSubscriptions as p } from "../hooks/useSubscriptions.js";
|
|
12
12
|
import "../hooks/index.js";
|
|
13
13
|
import { useEffect as m, useRef as h, useState as g } from "react";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import { useSearchParams as _ } from "react-router";
|
|
15
|
+
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
16
|
+
import { EmphasisPanel as x, IllustratedEmptyState as S, PagePurpose as C } from "@burdenoff/fe-libs/ui";
|
|
16
17
|
//#region src/billing/modules/subscriptions/pages/SubscriptionsListPage.tsx
|
|
17
|
-
var
|
|
18
|
-
let n = t(), i = u(), a = l(), { orgId: o } = e(), { billingAccounts:
|
|
18
|
+
var w = ["expired", "upgraded"], T = 10, E = () => {
|
|
19
|
+
let n = t(), i = u(), a = l(), { orgId: o } = e(), [s, c] = _(), { billingAccounts: E, isLoading: O } = f(), { selectedAccountId: k, setSelectedAccountId: A } = r({
|
|
19
20
|
orgId: o,
|
|
20
|
-
billingAccounts:
|
|
21
|
+
billingAccounts: E,
|
|
21
22
|
syncFromUrl: !0,
|
|
22
23
|
urlParamName: "billingAccountId"
|
|
23
|
-
}), [
|
|
24
|
-
m(() => (clearTimeout(
|
|
25
|
-
F
|
|
26
|
-
}, 400), () => clearTimeout(
|
|
27
|
-
let { subscriptions:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
|
|
24
|
+
}), [j, M] = g(!1), [N, P] = g("all"), [F, I] = g(""), [L, R] = g(""), [z, B] = g(1), V = h(void 0);
|
|
25
|
+
m(() => (clearTimeout(V.current), V.current = setTimeout(() => {
|
|
26
|
+
R(F), B(1);
|
|
27
|
+
}, 400), () => clearTimeout(V.current)), [F]);
|
|
28
|
+
let { subscriptions: H, activeSubscriptions: U, totalCount: W, totalPages: G, isLoading: K, error: q, refetch: J } = p(k ?? void 0, z, T, L || void 0), Y = E.find((e) => e.id === k), X = (e) => {
|
|
29
|
+
A(e.id);
|
|
30
|
+
let t = new URLSearchParams(s);
|
|
31
|
+
t.set("billingAccountId", e.id), c(t, { replace: !0 }), M(!1), B(1);
|
|
32
|
+
}, Z = (e) => {
|
|
33
|
+
B(e);
|
|
34
|
+
}, Q = H.filter((e) => N === "all" ? !0 : N === "inactive" ? w.includes(e.status) : e.status === N), $ = O || K;
|
|
35
|
+
return a.canViewSubscriptions ? $ && !Y ? /* @__PURE__ */ b("div", {
|
|
33
36
|
className: "space-y-6 p-6",
|
|
34
|
-
children: [/* @__PURE__ */
|
|
37
|
+
children: [/* @__PURE__ */ y("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ y("div", {
|
|
35
38
|
className: "space-y-4",
|
|
36
39
|
children: [
|
|
37
40
|
1,
|
|
38
41
|
2,
|
|
39
42
|
3
|
|
40
|
-
].map((e) => /* @__PURE__ */
|
|
43
|
+
].map((e) => /* @__PURE__ */ y("div", {
|
|
41
44
|
className: "border border-border-subtle rounded-lg p-6",
|
|
42
|
-
children: /* @__PURE__ */
|
|
45
|
+
children: /* @__PURE__ */ b("div", {
|
|
43
46
|
className: "flex items-center gap-4",
|
|
44
|
-
children: [/* @__PURE__ */
|
|
47
|
+
children: [/* @__PURE__ */ y("div", { className: "size-12 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ b("div", {
|
|
45
48
|
className: "flex-1 space-y-2",
|
|
46
|
-
children: [/* @__PURE__ */
|
|
49
|
+
children: [/* @__PURE__ */ y("div", { className: "h-5 w-32 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ y("div", { className: "h-4 w-48 bg-bg-sunken animate-pulse rounded" })]
|
|
47
50
|
})]
|
|
48
51
|
})
|
|
49
52
|
}, e))
|
|
50
53
|
})]
|
|
51
|
-
}) :
|
|
54
|
+
}) : q ? /* @__PURE__ */ y("div", {
|
|
52
55
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
53
|
-
children: /* @__PURE__ */
|
|
56
|
+
children: /* @__PURE__ */ b("div", {
|
|
54
57
|
className: "text-center space-y-4",
|
|
55
58
|
children: [
|
|
56
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ y("div", {
|
|
57
60
|
className: "size-12 mx-auto rounded-full bg-status-error-bg-subtle flex items-center justify-center",
|
|
58
|
-
children: /* @__PURE__ */
|
|
61
|
+
children: /* @__PURE__ */ y("svg", {
|
|
59
62
|
className: "size-6 text-status-error-text",
|
|
60
63
|
fill: "none",
|
|
61
64
|
viewBox: "0 0 24 24",
|
|
62
65
|
stroke: "currentColor",
|
|
63
|
-
children: /* @__PURE__ */
|
|
66
|
+
children: /* @__PURE__ */ y("path", {
|
|
64
67
|
strokeLinecap: "round",
|
|
65
68
|
strokeLinejoin: "round",
|
|
66
69
|
strokeWidth: 2,
|
|
@@ -68,50 +71,50 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
|
|
|
68
71
|
})
|
|
69
72
|
})
|
|
70
73
|
}),
|
|
71
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ y("h2", {
|
|
72
75
|
className: "text-lg font-semibold text-text-primary",
|
|
73
76
|
children: n("billing.subscriptions.failedToLoad", "Failed to load subscriptions")
|
|
74
77
|
}),
|
|
75
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ y("p", {
|
|
76
79
|
className: "text-sm text-text-secondary",
|
|
77
|
-
children:
|
|
80
|
+
children: q.message
|
|
78
81
|
}),
|
|
79
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ y("button", {
|
|
80
83
|
type: "button",
|
|
81
|
-
onClick: () =>
|
|
84
|
+
onClick: () => J(),
|
|
82
85
|
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",
|
|
83
86
|
children: n("billing.common.tryAgain", "Try Again")
|
|
84
87
|
})
|
|
85
88
|
]
|
|
86
89
|
})
|
|
87
|
-
}) : /* @__PURE__ */
|
|
90
|
+
}) : /* @__PURE__ */ b("div", {
|
|
88
91
|
className: "space-y-6 px-6 lg:px-8 py-6",
|
|
89
92
|
children: [
|
|
90
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ b("div", {
|
|
91
94
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
92
|
-
children: [/* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
95
|
+
children: [/* @__PURE__ */ b("div", { children: [
|
|
96
|
+
/* @__PURE__ */ y("h1", {
|
|
94
97
|
className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
|
|
95
98
|
children: n("billing.subscriptions.title", "Subscriptions")
|
|
96
99
|
}),
|
|
97
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ y("p", {
|
|
98
101
|
className: "text-sm text-text-secondary mt-1",
|
|
99
102
|
children: n("billing.subscriptions.subtitle", "Manage your active and past subscriptions")
|
|
100
103
|
}),
|
|
101
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ y(C, {
|
|
102
105
|
className: "mt-3",
|
|
103
106
|
children: n("billing.subscriptions.purpose", "See every plan a billing account is subscribed to — active, canceled and expired — in one place. Use it to review what you are paying for, when each plan renews or ends, upgrade or cancel a subscription, and start a new one by browsing plans.")
|
|
104
107
|
})
|
|
105
|
-
] }), a.canCreateSubscription && /* @__PURE__ */
|
|
108
|
+
] }), a.canCreateSubscription && /* @__PURE__ */ b("button", {
|
|
106
109
|
type: "button",
|
|
107
110
|
onClick: () => i("/plans"),
|
|
108
111
|
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 duration-200",
|
|
109
|
-
children: [/* @__PURE__ */
|
|
112
|
+
children: [/* @__PURE__ */ y("svg", {
|
|
110
113
|
className: "size-4",
|
|
111
114
|
fill: "none",
|
|
112
115
|
viewBox: "0 0 24 24",
|
|
113
116
|
stroke: "currentColor",
|
|
114
|
-
children: /* @__PURE__ */
|
|
117
|
+
children: /* @__PURE__ */ y("path", {
|
|
115
118
|
strokeLinecap: "round",
|
|
116
119
|
strokeLinejoin: "round",
|
|
117
120
|
strokeWidth: 2,
|
|
@@ -120,91 +123,91 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
|
|
|
120
123
|
}), n("billing.subscriptions.newSubscription", "New Subscription")]
|
|
121
124
|
})]
|
|
122
125
|
}),
|
|
123
|
-
|
|
126
|
+
E.length > 1 && /* @__PURE__ */ b("div", {
|
|
124
127
|
className: "relative",
|
|
125
|
-
children: [/* @__PURE__ */
|
|
128
|
+
children: [/* @__PURE__ */ b("button", {
|
|
126
129
|
type: "button",
|
|
127
|
-
onClick: () =>
|
|
130
|
+
onClick: () => M(!j),
|
|
128
131
|
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",
|
|
129
|
-
children: [/* @__PURE__ */
|
|
132
|
+
children: [/* @__PURE__ */ b("div", {
|
|
130
133
|
className: "flex items-center gap-3",
|
|
131
|
-
children: [/* @__PURE__ */
|
|
134
|
+
children: [/* @__PURE__ */ y("div", {
|
|
132
135
|
className: "size-9 rounded-lg bg-[var(--color-accent-soft)] flex items-center justify-center",
|
|
133
|
-
children: /* @__PURE__ */
|
|
136
|
+
children: /* @__PURE__ */ y("svg", {
|
|
134
137
|
className: "size-4 text-text-link",
|
|
135
138
|
fill: "none",
|
|
136
139
|
viewBox: "0 0 24 24",
|
|
137
140
|
stroke: "currentColor",
|
|
138
|
-
children: /* @__PURE__ */
|
|
141
|
+
children: /* @__PURE__ */ y("path", {
|
|
139
142
|
strokeLinecap: "round",
|
|
140
143
|
strokeLinejoin: "round",
|
|
141
144
|
strokeWidth: 2,
|
|
142
145
|
d: "M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"
|
|
143
146
|
})
|
|
144
147
|
})
|
|
145
|
-
}), /* @__PURE__ */
|
|
148
|
+
}), /* @__PURE__ */ b("div", {
|
|
146
149
|
className: "text-left",
|
|
147
|
-
children: [/* @__PURE__ */
|
|
150
|
+
children: [/* @__PURE__ */ y("p", {
|
|
148
151
|
className: "text-sm font-medium text-text-primary",
|
|
149
|
-
children:
|
|
150
|
-
}), /* @__PURE__ */
|
|
152
|
+
children: Y?.name || n("billing.subscriptions.selectAccount", "Select Account")
|
|
153
|
+
}), /* @__PURE__ */ y("p", {
|
|
151
154
|
className: "text-xs text-text-secondary",
|
|
152
|
-
children:
|
|
155
|
+
children: Y?.email
|
|
153
156
|
})]
|
|
154
157
|
})]
|
|
155
|
-
}), /* @__PURE__ */
|
|
156
|
-
className: `size-4 text-text-secondary transition-transform ${
|
|
158
|
+
}), /* @__PURE__ */ y("svg", {
|
|
159
|
+
className: `size-4 text-text-secondary transition-transform ${j ? "rotate-180" : ""}`,
|
|
157
160
|
fill: "none",
|
|
158
161
|
viewBox: "0 0 24 24",
|
|
159
162
|
stroke: "currentColor",
|
|
160
|
-
children: /* @__PURE__ */
|
|
163
|
+
children: /* @__PURE__ */ y("path", {
|
|
161
164
|
strokeLinecap: "round",
|
|
162
165
|
strokeLinejoin: "round",
|
|
163
166
|
strokeWidth: 2,
|
|
164
167
|
d: "M19 9l-7 7-7-7"
|
|
165
168
|
})
|
|
166
169
|
})]
|
|
167
|
-
}),
|
|
170
|
+
}), j && /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("div", {
|
|
168
171
|
className: "fixed inset-0 z-10",
|
|
169
|
-
onClick: () =>
|
|
170
|
-
}), /* @__PURE__ */
|
|
172
|
+
onClick: () => M(!1)
|
|
173
|
+
}), /* @__PURE__ */ y("div", {
|
|
171
174
|
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",
|
|
172
|
-
children:
|
|
175
|
+
children: E.map((e) => /* @__PURE__ */ b("button", {
|
|
173
176
|
type: "button",
|
|
174
|
-
onClick: () =>
|
|
177
|
+
onClick: () => X(e),
|
|
175
178
|
className: "w-full flex items-center justify-between gap-3 px-4 py-3 hover:bg-bg-sunken transition-colors",
|
|
176
|
-
children: [/* @__PURE__ */
|
|
179
|
+
children: [/* @__PURE__ */ b("div", {
|
|
177
180
|
className: "flex items-center gap-3 min-w-0",
|
|
178
|
-
children: [/* @__PURE__ */
|
|
181
|
+
children: [/* @__PURE__ */ y("div", {
|
|
179
182
|
className: "size-9 rounded-lg bg-bg-sunken flex items-center justify-center flex-shrink-0",
|
|
180
|
-
children: /* @__PURE__ */
|
|
183
|
+
children: /* @__PURE__ */ y("svg", {
|
|
181
184
|
className: "size-4 text-text-secondary",
|
|
182
185
|
fill: "none",
|
|
183
186
|
viewBox: "0 0 24 24",
|
|
184
187
|
stroke: "currentColor",
|
|
185
|
-
children: /* @__PURE__ */
|
|
188
|
+
children: /* @__PURE__ */ y("path", {
|
|
186
189
|
strokeLinecap: "round",
|
|
187
190
|
strokeLinejoin: "round",
|
|
188
191
|
strokeWidth: 2,
|
|
189
192
|
d: "M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"
|
|
190
193
|
})
|
|
191
194
|
})
|
|
192
|
-
}), /* @__PURE__ */
|
|
195
|
+
}), /* @__PURE__ */ b("div", {
|
|
193
196
|
className: "text-left min-w-0",
|
|
194
|
-
children: [/* @__PURE__ */
|
|
197
|
+
children: [/* @__PURE__ */ y("p", {
|
|
195
198
|
className: "text-sm font-medium text-text-primary truncate",
|
|
196
199
|
children: e.name
|
|
197
|
-
}), /* @__PURE__ */
|
|
200
|
+
}), /* @__PURE__ */ y("p", {
|
|
198
201
|
className: "text-xs text-text-secondary truncate",
|
|
199
202
|
children: e.email
|
|
200
203
|
})]
|
|
201
204
|
})]
|
|
202
|
-
}),
|
|
205
|
+
}), Y?.id === e.id && /* @__PURE__ */ y("svg", {
|
|
203
206
|
className: "size-4 text-text-link flex-shrink-0",
|
|
204
207
|
fill: "none",
|
|
205
208
|
viewBox: "0 0 24 24",
|
|
206
209
|
stroke: "currentColor",
|
|
207
|
-
children: /* @__PURE__ */
|
|
210
|
+
children: /* @__PURE__ */ y("path", {
|
|
208
211
|
strokeLinecap: "round",
|
|
209
212
|
strokeLinejoin: "round",
|
|
210
213
|
strokeWidth: 2,
|
|
@@ -214,32 +217,32 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
|
|
|
214
217
|
}, e.id))
|
|
215
218
|
})] })]
|
|
216
219
|
}),
|
|
217
|
-
|
|
220
|
+
Y && /* @__PURE__ */ y(x, {
|
|
218
221
|
className: "p-5",
|
|
219
|
-
children: /* @__PURE__ */
|
|
222
|
+
children: /* @__PURE__ */ b("div", {
|
|
220
223
|
className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
|
|
221
224
|
children: [
|
|
222
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
223
226
|
className: "text-sm text-text-secondary",
|
|
224
227
|
children: n("billing.subscriptions.account", "Account")
|
|
225
|
-
}), /* @__PURE__ */
|
|
228
|
+
}), /* @__PURE__ */ y("p", {
|
|
226
229
|
className: "text-lg font-semibold text-text-primary mt-1",
|
|
227
|
-
children:
|
|
230
|
+
children: Y.name
|
|
228
231
|
})] }),
|
|
229
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
230
233
|
className: "text-sm text-text-secondary",
|
|
231
234
|
children: n("billing.subscriptions.activeSubscriptions", "Active Subscriptions")
|
|
232
|
-
}), /* @__PURE__ */
|
|
235
|
+
}), /* @__PURE__ */ y("p", {
|
|
233
236
|
className: "text-lg font-semibold tabular-nums text-status-success-text mt-1",
|
|
234
|
-
children:
|
|
237
|
+
children: U.length
|
|
235
238
|
})] }),
|
|
236
|
-
/* @__PURE__ */
|
|
239
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
237
240
|
className: "text-sm text-text-secondary",
|
|
238
241
|
children: n("billing.subscriptions.creditBalance", "Credit Balance")
|
|
239
|
-
}), /* @__PURE__ */
|
|
242
|
+
}), /* @__PURE__ */ b("p", {
|
|
240
243
|
className: "text-lg font-semibold tabular-nums text-text-primary mt-1",
|
|
241
244
|
children: [
|
|
242
|
-
(
|
|
245
|
+
(Y.creditAmount || 0).toLocaleString(),
|
|
243
246
|
" ",
|
|
244
247
|
n("billing.common.credits", "Credits")
|
|
245
248
|
]
|
|
@@ -247,85 +250,85 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
|
|
|
247
250
|
]
|
|
248
251
|
})
|
|
249
252
|
}),
|
|
250
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ b("div", {
|
|
251
254
|
className: "flex flex-col sm:flex-row flex-wrap items-stretch sm:items-center gap-3 sm:gap-4 pb-4 border-b border-border-subtle",
|
|
252
255
|
children: [
|
|
253
|
-
/* @__PURE__ */
|
|
256
|
+
/* @__PURE__ */ y("div", {
|
|
254
257
|
className: "inline-flex rounded-lg border border-border-subtle p-1 bg-bg-sunken flex-wrap",
|
|
255
258
|
children: [
|
|
256
259
|
"all",
|
|
257
260
|
"active",
|
|
258
261
|
"canceled",
|
|
259
262
|
"inactive"
|
|
260
|
-
].map((e) => /* @__PURE__ */
|
|
263
|
+
].map((e) => /* @__PURE__ */ y("button", {
|
|
261
264
|
type: "button",
|
|
262
|
-
onClick: () =>
|
|
263
|
-
className: `px-3 py-1.5 text-sm font-medium rounded-button transition-colors capitalize ${
|
|
265
|
+
onClick: () => P(e),
|
|
266
|
+
className: `px-3 py-1.5 text-sm font-medium rounded-button transition-colors capitalize ${N === e ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-secondary hover:text-text-primary"}`,
|
|
264
267
|
children: e === "all" ? n("billing.subscriptions.statusAll", "All") : e === "active" ? n("billing.subscriptions.statusActive", "Active") : e === "canceled" ? n("billing.subscriptions.statusCanceled", "Canceled") : n("billing.subscriptions.statusInactive", "Inactive")
|
|
265
268
|
}, e))
|
|
266
269
|
}),
|
|
267
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ b("div", {
|
|
268
271
|
className: "relative flex-1 min-w-0 w-full sm:max-w-md",
|
|
269
|
-
children: [/* @__PURE__ */
|
|
272
|
+
children: [/* @__PURE__ */ y("svg", {
|
|
270
273
|
className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-text-secondary",
|
|
271
274
|
fill: "none",
|
|
272
275
|
viewBox: "0 0 24 24",
|
|
273
276
|
stroke: "currentColor",
|
|
274
|
-
children: /* @__PURE__ */
|
|
277
|
+
children: /* @__PURE__ */ y("path", {
|
|
275
278
|
strokeLinecap: "round",
|
|
276
279
|
strokeLinejoin: "round",
|
|
277
280
|
strokeWidth: 2,
|
|
278
281
|
d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
|
|
279
282
|
})
|
|
280
|
-
}), /* @__PURE__ */
|
|
283
|
+
}), /* @__PURE__ */ y("input", {
|
|
281
284
|
type: "text",
|
|
282
285
|
placeholder: n("billing.subscriptions.searchPlaceholder", "Search subscriptions..."),
|
|
283
|
-
value:
|
|
284
|
-
onChange: (e) =>
|
|
286
|
+
value: F,
|
|
287
|
+
onChange: (e) => I(e.target.value),
|
|
285
288
|
className: "w-full pl-[3.25rem] pr-4 py-2 text-sm border border-border-subtle rounded-button bg-bg-surface text-text-primary placeholder:text-text-placeholder focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:border-transparent"
|
|
286
289
|
})]
|
|
287
290
|
}),
|
|
288
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ y("div", {
|
|
289
292
|
className: "text-sm text-text-secondary",
|
|
290
293
|
children: n("billing.subscriptions.totalCount", "{{count}} subscription{{plural}} total", {
|
|
291
|
-
count:
|
|
292
|
-
plural:
|
|
294
|
+
count: W,
|
|
295
|
+
plural: W === 1 ? "" : "s"
|
|
293
296
|
})
|
|
294
297
|
})
|
|
295
298
|
]
|
|
296
299
|
}),
|
|
297
|
-
|
|
298
|
-
illustration:
|
|
300
|
+
Q.length === 0 ? /* @__PURE__ */ y(S, {
|
|
301
|
+
illustration: N !== "all" || L ? "empty-search" : "empty-data",
|
|
299
302
|
title: n("billing.subscriptions.noSubscriptionsFound", "No subscriptions found"),
|
|
300
|
-
description:
|
|
301
|
-
action: a.canCreateSubscription &&
|
|
303
|
+
description: N !== "all" || L ? n("billing.subscriptions.noSubscriptionsMatchFilters", "No subscriptions match your filters.") : n("billing.subscriptions.noSubscriptionsYet", "You don't have any subscriptions yet."),
|
|
304
|
+
action: a.canCreateSubscription && N === "all" && !L ? /* @__PURE__ */ y("button", {
|
|
302
305
|
type: "button",
|
|
303
306
|
onClick: () => i("/plans"),
|
|
304
307
|
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 duration-200",
|
|
305
308
|
children: n("billing.subscriptions.browsePlans", "Browse Plans")
|
|
306
309
|
}) : void 0
|
|
307
|
-
}) : /* @__PURE__ */
|
|
310
|
+
}) : /* @__PURE__ */ y("div", {
|
|
308
311
|
className: "space-y-4",
|
|
309
|
-
children:
|
|
312
|
+
children: Q.map((e) => /* @__PURE__ */ y(D, {
|
|
310
313
|
subscription: e,
|
|
311
314
|
onView: () => i(d(`/subscriptions/${e.id}`, e.billingAccountId)),
|
|
312
315
|
canCancel: a.canCancelSubscription
|
|
313
316
|
}, e.id))
|
|
314
317
|
}),
|
|
315
|
-
|
|
318
|
+
G > 1 && /* @__PURE__ */ b("div", {
|
|
316
319
|
className: "flex items-center justify-center gap-2 pt-4",
|
|
317
320
|
children: [
|
|
318
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ y("button", {
|
|
319
322
|
type: "button",
|
|
320
|
-
onClick: () =>
|
|
321
|
-
disabled:
|
|
323
|
+
onClick: () => Z(z - 1),
|
|
324
|
+
disabled: z === 1,
|
|
322
325
|
className: "px-3 py-1.5 text-sm border border-border-subtle rounded-button disabled:opacity-50 disabled:cursor-not-allowed hover:bg-bg-sunken transition-colors",
|
|
323
|
-
children: /* @__PURE__ */
|
|
326
|
+
children: /* @__PURE__ */ y("svg", {
|
|
324
327
|
className: "size-4",
|
|
325
328
|
fill: "none",
|
|
326
329
|
viewBox: "0 0 24 24",
|
|
327
330
|
stroke: "currentColor",
|
|
328
|
-
children: /* @__PURE__ */
|
|
331
|
+
children: /* @__PURE__ */ y("path", {
|
|
329
332
|
strokeLinecap: "round",
|
|
330
333
|
strokeLinejoin: "round",
|
|
331
334
|
strokeWidth: 2,
|
|
@@ -333,32 +336,32 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
|
|
|
333
336
|
})
|
|
334
337
|
})
|
|
335
338
|
}),
|
|
336
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ y("div", {
|
|
337
340
|
className: "flex items-center gap-1",
|
|
338
|
-
children: Array.from({ length:
|
|
339
|
-
let t = e === 1 || e ===
|
|
340
|
-
return n || r ? /* @__PURE__ */
|
|
341
|
+
children: Array.from({ length: G }, (e, t) => t + 1).map((e) => {
|
|
342
|
+
let t = e === 1 || e === G || Math.abs(e - z) <= 1, n = e === z - 2 && z > 3, r = e === z + 2 && z < G - 2;
|
|
343
|
+
return n || r ? /* @__PURE__ */ y("span", {
|
|
341
344
|
className: "px-2 text-text-secondary",
|
|
342
345
|
children: "..."
|
|
343
|
-
}, e) : t ? /* @__PURE__ */
|
|
346
|
+
}, e) : t ? /* @__PURE__ */ y("button", {
|
|
344
347
|
type: "button",
|
|
345
|
-
onClick: () =>
|
|
346
|
-
className: `px-3 py-1.5 text-sm rounded-button transition-colors ${e ===
|
|
348
|
+
onClick: () => Z(e),
|
|
349
|
+
className: `px-3 py-1.5 text-sm rounded-button transition-colors ${e === z ? "bg-action-primary-bg text-action-primary-text" : "border border-border-subtle hover:bg-bg-sunken"}`,
|
|
347
350
|
children: e
|
|
348
351
|
}, e) : null;
|
|
349
352
|
})
|
|
350
353
|
}),
|
|
351
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ y("button", {
|
|
352
355
|
type: "button",
|
|
353
|
-
onClick: () =>
|
|
354
|
-
disabled:
|
|
356
|
+
onClick: () => Z(z + 1),
|
|
357
|
+
disabled: z === G,
|
|
355
358
|
className: "px-3 py-1.5 text-sm border border-border-subtle rounded-button disabled:opacity-50 disabled:cursor-not-allowed hover:bg-bg-sunken transition-colors",
|
|
356
|
-
children: /* @__PURE__ */
|
|
359
|
+
children: /* @__PURE__ */ y("svg", {
|
|
357
360
|
className: "size-4",
|
|
358
361
|
fill: "none",
|
|
359
362
|
viewBox: "0 0 24 24",
|
|
360
363
|
stroke: "currentColor",
|
|
361
|
-
children: /* @__PURE__ */
|
|
364
|
+
children: /* @__PURE__ */ y("path", {
|
|
362
365
|
strokeLinecap: "round",
|
|
363
366
|
strokeLinejoin: "round",
|
|
364
367
|
strokeWidth: 2,
|
|
@@ -369,19 +372,19 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
|
|
|
369
372
|
]
|
|
370
373
|
})
|
|
371
374
|
]
|
|
372
|
-
}) : /* @__PURE__ */
|
|
375
|
+
}) : /* @__PURE__ */ y("div", {
|
|
373
376
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
374
|
-
children: /* @__PURE__ */
|
|
377
|
+
children: /* @__PURE__ */ b("div", {
|
|
375
378
|
className: "text-center space-y-2",
|
|
376
379
|
children: [
|
|
377
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ y("div", {
|
|
378
381
|
className: "size-12 mx-auto rounded-full bg-bg-sunken flex items-center justify-center",
|
|
379
|
-
children: /* @__PURE__ */
|
|
382
|
+
children: /* @__PURE__ */ y("svg", {
|
|
380
383
|
className: "size-6 text-text-secondary",
|
|
381
384
|
fill: "none",
|
|
382
385
|
viewBox: "0 0 24 24",
|
|
383
386
|
stroke: "currentColor",
|
|
384
|
-
children: /* @__PURE__ */
|
|
387
|
+
children: /* @__PURE__ */ y("path", {
|
|
385
388
|
strokeLinecap: "round",
|
|
386
389
|
strokeLinejoin: "round",
|
|
387
390
|
strokeWidth: 2,
|
|
@@ -389,36 +392,36 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
|
|
|
389
392
|
})
|
|
390
393
|
})
|
|
391
394
|
}),
|
|
392
|
-
/* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ y("h2", {
|
|
393
396
|
className: "text-lg font-semibold text-text-primary",
|
|
394
397
|
children: n("billing.accessDenied.title", "Access Denied")
|
|
395
398
|
}),
|
|
396
|
-
/* @__PURE__ */
|
|
399
|
+
/* @__PURE__ */ y("p", {
|
|
397
400
|
className: "text-sm text-text-secondary max-w-sm",
|
|
398
401
|
children: n("billing.subscriptions.noViewPermission", "You don't have permission to view subscriptions.")
|
|
399
402
|
})
|
|
400
403
|
]
|
|
401
404
|
})
|
|
402
405
|
});
|
|
403
|
-
},
|
|
406
|
+
}, D = ({ subscription: e, onView: r, canCancel: l }) => {
|
|
404
407
|
let u = t(), d = e.plan, f = c(e.status), p = e.status === "active", m = new Date(e.endDate), h = /* @__PURE__ */ new Date(), g = Math.max(0, Math.ceil((m.getTime() - h.getTime()) / (1e3 * 60 * 60 * 24)));
|
|
405
|
-
return /* @__PURE__ */
|
|
408
|
+
return /* @__PURE__ */ y("div", {
|
|
406
409
|
className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 hover:border-border-strong hover:shadow-elevation-2 transition-all duration-200 cursor-pointer",
|
|
407
410
|
onClick: r,
|
|
408
|
-
children: /* @__PURE__ */
|
|
411
|
+
children: /* @__PURE__ */ b("div", {
|
|
409
412
|
className: "p-5",
|
|
410
413
|
children: [
|
|
411
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ b("div", {
|
|
412
415
|
className: "flex flex-col sm:flex-row sm:items-center gap-4",
|
|
413
416
|
children: [
|
|
414
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ y("div", {
|
|
415
418
|
className: "size-12 rounded-lg bg-[var(--color-accent-soft)] flex items-center justify-center shrink-0",
|
|
416
|
-
children: /* @__PURE__ */
|
|
419
|
+
children: /* @__PURE__ */ y("svg", {
|
|
417
420
|
className: "size-6 text-text-link",
|
|
418
421
|
fill: "none",
|
|
419
422
|
viewBox: "0 0 24 24",
|
|
420
423
|
stroke: "currentColor",
|
|
421
|
-
children: /* @__PURE__ */
|
|
424
|
+
children: /* @__PURE__ */ y("path", {
|
|
422
425
|
strokeLinecap: "round",
|
|
423
426
|
strokeLinejoin: "round",
|
|
424
427
|
strokeWidth: 2,
|
|
@@ -426,51 +429,51 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
|
|
|
426
429
|
})
|
|
427
430
|
})
|
|
428
431
|
}),
|
|
429
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ b("div", {
|
|
430
433
|
className: "flex-1 min-w-0",
|
|
431
|
-
children: [/* @__PURE__ */
|
|
434
|
+
children: [/* @__PURE__ */ b("div", {
|
|
432
435
|
className: "flex items-center gap-2 flex-wrap",
|
|
433
|
-
children: [/* @__PURE__ */
|
|
436
|
+
children: [/* @__PURE__ */ y("h3", {
|
|
434
437
|
className: "font-semibold text-text-primary",
|
|
435
438
|
children: d?.name || u("billing.common.unknownPlan", "Unknown Plan")
|
|
436
|
-
}), /* @__PURE__ */
|
|
439
|
+
}), /* @__PURE__ */ y(n, {
|
|
437
440
|
status: f,
|
|
438
441
|
dot: !0,
|
|
439
442
|
pulse: p,
|
|
440
443
|
children: s(e.status)
|
|
441
444
|
})]
|
|
442
|
-
}), /* @__PURE__ */
|
|
445
|
+
}), /* @__PURE__ */ b("div", {
|
|
443
446
|
className: "flex items-center gap-4 mt-1 text-sm text-text-secondary",
|
|
444
447
|
children: [
|
|
445
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ b("span", { children: [
|
|
446
449
|
d ? i(d.price, d.currency) : "—",
|
|
447
450
|
" /",
|
|
448
451
|
" ",
|
|
449
452
|
d ? o(d.duration) : "—"
|
|
450
453
|
] }),
|
|
451
|
-
/* @__PURE__ */
|
|
454
|
+
/* @__PURE__ */ y("span", {
|
|
452
455
|
className: "hidden sm:inline",
|
|
453
456
|
children: "•"
|
|
454
457
|
}),
|
|
455
|
-
/* @__PURE__ */
|
|
458
|
+
/* @__PURE__ */ y("span", {
|
|
456
459
|
className: "hidden sm:inline",
|
|
457
460
|
children: u("billing.subscriptions.started", "Started {{date}}", { date: a(e.startDate, "short") })
|
|
458
461
|
})
|
|
459
462
|
]
|
|
460
463
|
})]
|
|
461
464
|
}),
|
|
462
|
-
/* @__PURE__ */
|
|
465
|
+
/* @__PURE__ */ b("div", {
|
|
463
466
|
className: "flex items-center gap-4",
|
|
464
|
-
children: [p && /* @__PURE__ */
|
|
467
|
+
children: [p && /* @__PURE__ */ b("div", {
|
|
465
468
|
className: "text-right",
|
|
466
|
-
children: [/* @__PURE__ */
|
|
469
|
+
children: [/* @__PURE__ */ y("p", {
|
|
467
470
|
className: "text-sm font-medium text-text-primary",
|
|
468
471
|
children: u("billing.subscriptions.daysRemaining", "{{count}} days", { count: g })
|
|
469
|
-
}), /* @__PURE__ */
|
|
472
|
+
}), /* @__PURE__ */ y("p", {
|
|
470
473
|
className: "text-xs text-text-secondary",
|
|
471
474
|
children: u("billing.subscriptions.remaining", "remaining")
|
|
472
475
|
})]
|
|
473
|
-
}), /* @__PURE__ */
|
|
476
|
+
}), /* @__PURE__ */ y("button", {
|
|
474
477
|
type: "button",
|
|
475
478
|
onClick: (e) => {
|
|
476
479
|
e.stopPropagation(), r();
|
|
@@ -481,9 +484,9 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
|
|
|
481
484
|
})
|
|
482
485
|
]
|
|
483
486
|
}),
|
|
484
|
-
e.addonSubscriptions && e.addonSubscriptions.length > 0 && /* @__PURE__ */
|
|
487
|
+
e.addonSubscriptions && e.addonSubscriptions.length > 0 && /* @__PURE__ */ y("div", {
|
|
485
488
|
className: "mt-4 pt-4 border-t border-border-subtle",
|
|
486
|
-
children: /* @__PURE__ */
|
|
489
|
+
children: /* @__PURE__ */ y("p", {
|
|
487
490
|
className: "text-sm text-text-secondary",
|
|
488
491
|
children: u("billing.subscriptions.addonsAttached", "{{count}} addon{{plural}} attached", {
|
|
489
492
|
count: e.addonSubscriptions.length,
|
|
@@ -491,11 +494,11 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
|
|
|
491
494
|
})
|
|
492
495
|
})
|
|
493
496
|
}),
|
|
494
|
-
e.canceledAt && /* @__PURE__ */
|
|
497
|
+
e.canceledAt && /* @__PURE__ */ y("div", {
|
|
495
498
|
className: "mt-4 pt-4 border-t border-border-subtle",
|
|
496
|
-
children: /* @__PURE__ */
|
|
499
|
+
children: /* @__PURE__ */ b("p", {
|
|
497
500
|
className: "text-sm text-text-secondary",
|
|
498
|
-
children: [u("billing.subscriptions.canceledOn", "Canceled on {{date}}", { date: a(e.canceledAt) }), e.cancellationReason && /* @__PURE__ */
|
|
501
|
+
children: [u("billing.subscriptions.canceledOn", "Canceled on {{date}}", { date: a(e.canceledAt) }), e.cancellationReason && /* @__PURE__ */ b("span", { children: [": ", e.cancellationReason] })]
|
|
499
502
|
})
|
|
500
503
|
})
|
|
501
504
|
]
|
|
@@ -503,6 +506,6 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
|
|
|
503
506
|
});
|
|
504
507
|
};
|
|
505
508
|
//#endregion
|
|
506
|
-
export {
|
|
509
|
+
export { E as SubscriptionsListPage };
|
|
507
510
|
|
|
508
511
|
//# sourceMappingURL=SubscriptionsListPage.js.map
|