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