@carlonicora/nextjs-jsonapi 1.29.0 → 1.29.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/{BlockNoteEditor-YBVEOPV4.js → BlockNoteEditor-7BDLLHRA.js} +6 -6
- package/dist/{BlockNoteEditor-YBVEOPV4.js.map → BlockNoteEditor-7BDLLHRA.js.map} +1 -1
- package/dist/{BlockNoteEditor-ZM4YPXHO.mjs → BlockNoteEditor-F5KCNLVF.mjs} +2 -2
- package/dist/billing/index.js +291 -291
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-3X7EEFMN.js → chunk-7M7NPKOF.js} +4 -4
- package/dist/{chunk-3X7EEFMN.js.map → chunk-7M7NPKOF.js.map} +1 -1
- package/dist/{chunk-UCD5CUE4.mjs → chunk-YLSLXQ3O.mjs} +4 -4
- package/dist/{chunk-UCD5CUE4.mjs.map → chunk-YLSLXQ3O.mjs.map} +1 -1
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/contexts/index.js +2 -2
- package/dist/contexts/index.mjs +1 -1
- package/package.json +1 -1
- package/src/components/pages/PageContentContainer.tsx +2 -2
- /package/dist/{BlockNoteEditor-ZM4YPXHO.mjs.map → BlockNoteEditor-F5KCNLVF.mjs.map} +0 -0
package/dist/billing/index.js
CHANGED
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
var
|
|
50
|
+
var _chunk7M7NPKOFjs = require('../chunk-7M7NPKOF.js');
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
|
|
@@ -120,41 +120,41 @@ function SubscriptionSummaryCard({
|
|
|
120
120
|
onManageClick
|
|
121
121
|
}) {
|
|
122
122
|
if (loading) {
|
|
123
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
124
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
125
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
123
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Card, { children: [
|
|
124
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
125
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardTitle, { className: "text-sm font-medium", children: "Subscriptions" }),
|
|
126
126
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
127
127
|
] }),
|
|
128
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
129
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
130
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
131
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
128
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardContent, { children: [
|
|
129
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
130
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Skeleton, { className: "h-4 w-24 mb-1" }),
|
|
131
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Skeleton, { className: "h-4 w-40" })
|
|
132
132
|
] })
|
|
133
133
|
] });
|
|
134
134
|
}
|
|
135
135
|
if (error) {
|
|
136
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
137
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
138
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
136
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Card, { children: [
|
|
137
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
138
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardTitle, { className: "text-sm font-medium", children: "Subscriptions" }),
|
|
139
139
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
140
140
|
] }),
|
|
141
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
141
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-destructive", children: error }) })
|
|
142
142
|
] });
|
|
143
143
|
}
|
|
144
144
|
const activeSubscriptions = subscriptions.filter(
|
|
145
145
|
(sub) => sub.status === "active" /* ACTIVE */ || sub.status === "trialing" /* TRIALING */
|
|
146
146
|
);
|
|
147
147
|
const primarySubscription = activeSubscriptions[0];
|
|
148
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
149
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
150
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
148
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
|
|
149
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
150
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardTitle, { className: "text-sm font-medium", children: "Subscriptions" }),
|
|
151
151
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
|
|
152
152
|
] }),
|
|
153
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
153
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardContent, { children: subscriptions.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
154
154
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No active plan" }),
|
|
155
155
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Subscribe to get started" }),
|
|
156
156
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
157
|
-
|
|
157
|
+
_chunk7M7NPKOFjs.Button,
|
|
158
158
|
{
|
|
159
159
|
variant: "outline",
|
|
160
160
|
size: "sm",
|
|
@@ -172,7 +172,7 @@ function SubscriptionSummaryCard({
|
|
|
172
172
|
] }) : primarySubscription ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
173
173
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
174
174
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: formatPlanName(primarySubscription) }),
|
|
175
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
175
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Badge, { variant: primarySubscription.cancelAtPeriodEnd ? "secondary" : getStatusBadgeVariant(primarySubscription.status), children: primarySubscription.cancelAtPeriodEnd ? "Canceling" : primarySubscription.status })
|
|
176
176
|
] }),
|
|
177
177
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-sm text-muted-foreground", children: [
|
|
178
178
|
formatPrice(_optionalChain([primarySubscription, 'access', _10 => _10.price, 'optionalAccess', _11 => _11.unitAmount]), _optionalChain([primarySubscription, 'access', _12 => _12.price, 'optionalAccess', _13 => _13.currency])),
|
|
@@ -216,36 +216,36 @@ function PaymentMethodSummaryCard({
|
|
|
216
216
|
onManageClick
|
|
217
217
|
}) {
|
|
218
218
|
if (loading) {
|
|
219
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
220
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
221
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
219
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Card, { children: [
|
|
220
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
221
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardTitle, { className: "text-sm font-medium", children: "Payment Method" }),
|
|
222
222
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
223
223
|
] }),
|
|
224
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
225
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
226
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
224
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardContent, { children: [
|
|
225
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
226
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Skeleton, { className: "h-4 w-24" })
|
|
227
227
|
] })
|
|
228
228
|
] });
|
|
229
229
|
}
|
|
230
230
|
if (error) {
|
|
231
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
232
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
233
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
231
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Card, { children: [
|
|
232
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
233
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardTitle, { className: "text-sm font-medium", children: "Payment Method" }),
|
|
234
234
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
235
235
|
] }),
|
|
236
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
236
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-destructive", children: error }) })
|
|
237
237
|
] });
|
|
238
238
|
}
|
|
239
239
|
const defaultMethod = paymentMethods.find((pm) => pm.id === defaultPaymentMethodId) || paymentMethods[0];
|
|
240
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
241
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
242
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
240
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
|
|
241
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
242
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardTitle, { className: "text-sm font-medium", children: "Payment Method" }),
|
|
243
243
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
|
|
244
244
|
] }),
|
|
245
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
245
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardContent, { children: paymentMethods.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
246
246
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No payment method" }),
|
|
247
247
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Add a card to enable subscriptions" }),
|
|
248
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
248
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Button, { variant: "outline", size: "sm", className: "mt-2", onClick: (e) => {
|
|
249
249
|
e.stopPropagation();
|
|
250
250
|
onManageClick();
|
|
251
251
|
}, children: [
|
|
@@ -310,52 +310,52 @@ function CustomerInfoCard({ customer, loading, error }) {
|
|
|
310
310
|
}
|
|
311
311
|
}, "handlePortalClick");
|
|
312
312
|
if (loading) {
|
|
313
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
314
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
315
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
313
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Card, { children: [
|
|
314
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
315
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardTitle, { className: "text-sm font-medium", children: "Billing Account" }),
|
|
316
316
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
317
317
|
] }),
|
|
318
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
319
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
320
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
321
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
318
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardContent, { children: [
|
|
319
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Skeleton, { className: "h-6 w-32 mb-2" }),
|
|
320
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Skeleton, { className: "h-4 w-48 mb-1" }),
|
|
321
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Skeleton, { className: "h-4 w-24" })
|
|
322
322
|
] })
|
|
323
323
|
] });
|
|
324
324
|
}
|
|
325
325
|
if (error) {
|
|
326
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
327
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
328
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
326
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Card, { children: [
|
|
327
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
328
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardTitle, { className: "text-sm font-medium", children: "Billing Account" }),
|
|
329
329
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
330
330
|
] }),
|
|
331
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
331
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-destructive", children: error }) })
|
|
332
332
|
] });
|
|
333
333
|
}
|
|
334
334
|
if (!customer) {
|
|
335
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
336
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
337
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
335
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Card, { children: [
|
|
336
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
337
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardTitle, { className: "text-sm font-medium", children: "Billing Account" }),
|
|
338
338
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
339
339
|
] }),
|
|
340
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
340
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardContent, { children: [
|
|
341
341
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "Not set up" }),
|
|
342
342
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Billing account will be created when you subscribe" })
|
|
343
343
|
] })
|
|
344
344
|
] });
|
|
345
345
|
}
|
|
346
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
347
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
348
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
346
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Card, { children: [
|
|
347
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
348
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardTitle, { className: "text-sm font-medium", children: "Billing Account" }),
|
|
349
349
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
|
|
350
350
|
] }),
|
|
351
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
351
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
352
352
|
customer.name && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: customer.name }),
|
|
353
353
|
customer.email && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: customer.email }),
|
|
354
354
|
customer.balance !== void 0 && customer.balance !== 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-sm", children: [
|
|
355
355
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground", children: "Credit Balance: " }),
|
|
356
356
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: customer.balance < 0 ? "text-green-600" : "text-destructive", children: formatBalance(customer.balance, customer.currency) })
|
|
357
357
|
] }),
|
|
358
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
358
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Button, { variant: "outline", size: "sm", className: "mt-2", onClick: handlePortalClick, disabled: portalLoading, children: [
|
|
359
359
|
portalLoading ? "Loading..." : "Manage in Stripe Portal",
|
|
360
360
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "h-4 w-4 ml-1" })
|
|
361
361
|
] })
|
|
@@ -399,42 +399,42 @@ function formatAmount(amount, currency) {
|
|
|
399
399
|
_chunk7QVYU63Ejs.__name.call(void 0, formatAmount, "formatAmount");
|
|
400
400
|
function InvoicesSummaryCard({ invoices, loading, error, onViewAllClick }) {
|
|
401
401
|
if (loading) {
|
|
402
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
403
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
404
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
402
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Card, { children: [
|
|
403
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
404
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardTitle, { className: "text-sm font-medium", children: "Recent Invoices" }),
|
|
405
405
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
406
406
|
] }),
|
|
407
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
408
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
409
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
410
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
407
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardContent, { children: [
|
|
408
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Skeleton, { className: "h-6 w-24 mb-2" }),
|
|
409
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Skeleton, { className: "h-4 w-32 mb-1" }),
|
|
410
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Skeleton, { className: "h-4 w-20" })
|
|
411
411
|
] })
|
|
412
412
|
] });
|
|
413
413
|
}
|
|
414
414
|
if (error) {
|
|
415
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
416
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
417
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
415
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Card, { children: [
|
|
416
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
417
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardTitle, { className: "text-sm font-medium", children: "Recent Invoices" }),
|
|
418
418
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
419
419
|
] }),
|
|
420
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
420
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-destructive", children: error }) })
|
|
421
421
|
] });
|
|
422
422
|
}
|
|
423
423
|
const latestInvoice = invoices[0];
|
|
424
424
|
const paidInvoices = invoices.filter((inv) => inv.status === "paid" /* PAID */);
|
|
425
425
|
const openInvoices = invoices.filter((inv) => inv.status === "open" /* OPEN */);
|
|
426
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
427
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
428
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
426
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewAllClick, children: [
|
|
427
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
428
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardTitle, { className: "text-sm font-medium", children: "Recent Invoices" }),
|
|
429
429
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
|
|
430
430
|
] }),
|
|
431
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
431
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardContent, { children: invoices.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
432
432
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No invoices yet" }),
|
|
433
433
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "Invoices will appear after your first billing cycle" })
|
|
434
434
|
] }) : latestInvoice ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
435
435
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
436
436
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: formatAmount(latestInvoice.total, latestInvoice.currency) }),
|
|
437
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
437
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Badge, { variant: getStatusBadgeVariant2(latestInvoice.status), children: latestInvoice.status })
|
|
438
438
|
] }),
|
|
439
439
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: latestInvoice.stripeInvoiceNumber || `Invoice from ${formatDate2(latestInvoice.periodStart)}` }),
|
|
440
440
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-4 text-xs text-muted-foreground", children: [
|
|
@@ -474,24 +474,24 @@ function BillingUsageSummaryCard({
|
|
|
474
474
|
onViewDetailsClick
|
|
475
475
|
}) {
|
|
476
476
|
if (loading) {
|
|
477
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
478
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
479
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
477
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Card, { children: [
|
|
478
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
479
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardTitle, { className: "text-sm font-medium", children: "Usage This Month" }),
|
|
480
480
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
481
481
|
] }),
|
|
482
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
483
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
484
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
482
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardContent, { children: [
|
|
483
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Skeleton, { className: "h-6 w-24 mb-2" }),
|
|
484
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Skeleton, { className: "h-4 w-32" })
|
|
485
485
|
] })
|
|
486
486
|
] });
|
|
487
487
|
}
|
|
488
488
|
if (error) {
|
|
489
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
490
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
491
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
489
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Card, { children: [
|
|
490
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
491
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardTitle, { className: "text-sm font-medium", children: "Usage This Month" }),
|
|
492
492
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
493
493
|
] }),
|
|
494
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
494
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-destructive", children: error }) })
|
|
495
495
|
] });
|
|
496
496
|
}
|
|
497
497
|
const totalUsage = Object.values(summaries).reduce((acc, summary) => {
|
|
@@ -499,12 +499,12 @@ function BillingUsageSummaryCard({
|
|
|
499
499
|
}, 0);
|
|
500
500
|
const primaryMeter = meters.find((m) => _optionalChain([summaries, 'access', _23 => _23[m.id], 'optionalAccess', _24 => _24.aggregatedValue]));
|
|
501
501
|
const primarySummary = primaryMeter ? summaries[primaryMeter.id] : null;
|
|
502
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
503
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
504
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
502
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewDetailsClick, children: [
|
|
503
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
504
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardTitle, { className: "text-sm font-medium", children: "Usage This Month" }),
|
|
505
505
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
|
|
506
506
|
] }),
|
|
507
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
507
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardContent, { children: meters.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
508
508
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: "No meters" }),
|
|
509
509
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: "No usage meters are configured" })
|
|
510
510
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
@@ -610,7 +610,7 @@ function PaymentMethodForm({ onSuccess, onCancel, isLoading = false }) {
|
|
|
610
610
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground", children: "Loading payment form..." }) });
|
|
611
611
|
}
|
|
612
612
|
if (!setupIntent && error) {
|
|
613
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
613
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Alert, { variant: "destructive", className: "bg-red-50 border-red-200", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.AlertDescription, { children: error }) });
|
|
614
614
|
}
|
|
615
615
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: handleSubmit, className: "flex flex-col gap-y-4", children: [
|
|
616
616
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rounded-md border border-gray-300 p-3", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -634,19 +634,19 @@ function PaymentMethodForm({ onSuccess, onCancel, isLoading = false }) {
|
|
|
634
634
|
) }),
|
|
635
635
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
636
636
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
637
|
-
|
|
637
|
+
_chunk7M7NPKOFjs.Checkbox,
|
|
638
638
|
{
|
|
639
639
|
id: "setAsDefault",
|
|
640
640
|
checked: setAsDefault,
|
|
641
641
|
onCheckedChange: (checked) => setSetAsDefault(!!checked)
|
|
642
642
|
}
|
|
643
643
|
),
|
|
644
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
644
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Label, { htmlFor: "setAsDefault", className: "text-sm font-normal", children: "Set as default payment method" })
|
|
645
645
|
] }),
|
|
646
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
646
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Alert, { variant: "destructive", className: "bg-red-50 border-red-200", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.AlertDescription, { children: error }) }),
|
|
647
647
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-x-2", children: [
|
|
648
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
649
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
648
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { type: "button", variant: "outline", onClick: onCancel, disabled: isSubmitting || isLoading, children: "Cancel" }),
|
|
649
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { type: "submit", disabled: !stripe || isSubmitting || isLoading, children: isSubmitting ? "Processing..." : "Add Card" })
|
|
650
650
|
] })
|
|
651
651
|
] });
|
|
652
652
|
}
|
|
@@ -662,10 +662,10 @@ function PaymentMethodEditor({ open, onOpenChange, onSuccess }) {
|
|
|
662
662
|
const handleCancel = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
663
663
|
onOpenChange(false);
|
|
664
664
|
}, "handleCancel");
|
|
665
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
666
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
667
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
668
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
665
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.DialogContent, { className: "max-w-md", children: [
|
|
666
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.DialogHeader, { children: [
|
|
667
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.DialogTitle, { children: "Add Payment Method" }),
|
|
668
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.DialogDescription, { children: "Add a new payment method to your account. Your card information is securely processed by Stripe." })
|
|
669
669
|
] }),
|
|
670
670
|
open && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
671
671
|
PaymentMethodForm,
|
|
@@ -732,22 +732,22 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
732
732
|
}
|
|
733
733
|
}, "handleRemove");
|
|
734
734
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
735
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
736
|
-
isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
737
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
735
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Card, { className: "relative", children: [
|
|
736
|
+
isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Badge, { className: "absolute right-2 top-2 bg-green-100 text-green-800 hover:bg-green-100", children: "Default" }),
|
|
737
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardHeader, { className: "flex flex-row items-center justify-between pb-2", children: [
|
|
738
738
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
739
739
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-2xl", children: brandIcon }),
|
|
740
740
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium capitalize", children: brand })
|
|
741
741
|
] }),
|
|
742
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
743
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
744
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
745
|
-
!isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
746
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
742
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.DropdownMenu, { children: [
|
|
743
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.DropdownMenuTrigger, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {}), nativeButton: false, variant: "ghost", size: "sm", disabled: loading, className: "h-8 w-8 p-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.MoreVertical, { className: "h-4 w-4" }) }) }),
|
|
744
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.DropdownMenuContent, { align: "end", children: [
|
|
745
|
+
!isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.DropdownMenuItem, { onClick: handleSetDefault, disabled: loading, children: "Set as Default" }),
|
|
746
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.DropdownMenuItem, { onClick: () => setShowRemoveDialog(true), disabled: loading, className: "text-red-600", children: "Remove" })
|
|
747
747
|
] })
|
|
748
748
|
] })
|
|
749
749
|
] }),
|
|
750
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
750
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-1", children: [
|
|
751
751
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-lg font-semibold", children: [
|
|
752
752
|
"\u2022\u2022\u2022\u2022 ",
|
|
753
753
|
last4
|
|
@@ -760,17 +760,17 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
|
|
|
760
760
|
] })
|
|
761
761
|
] }) })
|
|
762
762
|
] }),
|
|
763
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
764
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
765
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
766
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
763
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.AlertDialog, { open: showRemoveDialog, onOpenChange: setShowRemoveDialog, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.AlertDialogContent, { children: [
|
|
764
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.AlertDialogHeader, { children: [
|
|
765
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.AlertDialogTitle, { children: "Remove Payment Method" }),
|
|
766
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.AlertDialogDescription, { children: [
|
|
767
767
|
"Are you sure you want to remove this payment method? This action cannot be undone.",
|
|
768
768
|
isDefault && " This is your default payment method."
|
|
769
769
|
] })
|
|
770
770
|
] }),
|
|
771
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
772
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
773
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
771
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.AlertDialogFooter, { children: [
|
|
772
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.AlertDialogCancel, { disabled: loading, children: "Cancel" }),
|
|
773
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.AlertDialogAction, { onClick: handleRemove, disabled: loading, className: "bg-red-600 hover:bg-red-700", children: loading ? "Removing..." : "Remove" })
|
|
774
774
|
] })
|
|
775
775
|
] }) })
|
|
776
776
|
] });
|
|
@@ -813,14 +813,14 @@ function PaymentMethodsContainer() {
|
|
|
813
813
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8" }),
|
|
814
814
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-3xl font-bold", children: "Payment Methods" })
|
|
815
815
|
] }),
|
|
816
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
816
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { onClick: () => setShowAddPaymentMethod(true), children: "Add Payment Method" })
|
|
817
817
|
] }),
|
|
818
818
|
paymentMethods.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center gap-y-4 rounded-lg border-2 border-dashed border-gray-300 bg-muted/50 p-12", children: [
|
|
819
819
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-16 w-16 text-muted-foreground" }),
|
|
820
820
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
821
821
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "mb-2 text-xl font-semibold", children: "No payment methods" }),
|
|
822
822
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "mb-4 text-muted-foreground", children: "Add a payment method to enable subscriptions and secure checkout." }),
|
|
823
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
823
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { onClick: () => setShowAddPaymentMethod(true), children: "Add Your First Card" })
|
|
824
824
|
] })
|
|
825
825
|
] }),
|
|
826
826
|
paymentMethods.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodsList, { paymentMethods, onUpdate: loadPaymentMethods }),
|
|
@@ -944,13 +944,13 @@ function InvoiceDetails({ invoice, open, onOpenChange, onInvoiceChange }) {
|
|
|
944
944
|
return invoice.stripeInvoiceId.slice(-8);
|
|
945
945
|
}, "getInvoiceNumber");
|
|
946
946
|
const productName = _optionalChain([invoice, 'access', _35 => _35.subscription, 'optionalAccess', _36 => _36.price, 'optionalAccess', _37 => _37.product, 'optionalAccess', _38 => _38.name]) || "Subscription";
|
|
947
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
948
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
949
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
947
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.DialogContent, { className: "max-w-2xl", children: [
|
|
948
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.DialogHeader, { children: [
|
|
949
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.DialogTitle, { children: [
|
|
950
950
|
"Invoice ",
|
|
951
951
|
getInvoiceNumber()
|
|
952
952
|
] }),
|
|
953
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
953
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.DialogDescription, { children: formatDate3(invoice.periodStart) })
|
|
954
954
|
] }),
|
|
955
955
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
956
956
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-3", children: [
|
|
@@ -1015,15 +1015,15 @@ function InvoiceDetails({ invoice, open, onOpenChange, onInvoiceChange }) {
|
|
|
1015
1015
|
] })
|
|
1016
1016
|
] }),
|
|
1017
1017
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap gap-2 pt-4 border-t", children: [
|
|
1018
|
-
invoice.stripePdfUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1018
|
+
invoice.stripePdfUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Button, { variant: "outline", onClick: handleDownloadPDF, children: [
|
|
1019
1019
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Download, { className: "mr-2 h-4 w-4" }),
|
|
1020
1020
|
"Download PDF"
|
|
1021
1021
|
] }),
|
|
1022
|
-
invoice.status === "open" /* OPEN */ && invoice.attempted && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1022
|
+
invoice.status === "open" /* OPEN */ && invoice.attempted && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Button, { variant: "default", onClick: handleRetryPayment, children: [
|
|
1023
1023
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RefreshCw, { className: "mr-2 h-4 w-4" }),
|
|
1024
1024
|
"Retry Payment"
|
|
1025
1025
|
] }),
|
|
1026
|
-
invoice.stripeHostedInvoiceUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1026
|
+
invoice.stripeHostedInvoiceUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Button, { variant: "outline", onClick: handleViewInStripe, children: [
|
|
1027
1027
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "mr-2 h-4 w-4" }),
|
|
1028
1028
|
"View in Stripe"
|
|
1029
1029
|
] })
|
|
@@ -1047,30 +1047,30 @@ function InvoicesList({ invoices, onInvoicesChange }) {
|
|
|
1047
1047
|
return invoice.stripeInvoiceId.slice(-8);
|
|
1048
1048
|
}, "getInvoiceNumber");
|
|
1049
1049
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1050
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-hidden", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1051
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1052
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1053
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1054
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1055
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1056
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1050
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-hidden", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Table, { children: [
|
|
1051
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.TableRow, { children: [
|
|
1052
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableHead, { children: "Invoice #" }),
|
|
1053
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableHead, { children: "Date" }),
|
|
1054
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableHead, { children: "Status" }),
|
|
1055
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableHead, { className: "text-right", children: "Amount" }),
|
|
1056
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableHead, { children: "Period" })
|
|
1057
1057
|
] }) }),
|
|
1058
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1058
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableBody, { children: invoices.map((invoice) => {
|
|
1059
1059
|
const invoiceNumber = getInvoiceNumber(invoice);
|
|
1060
1060
|
const date = formatDate3(invoice.periodStart);
|
|
1061
1061
|
const amount = formatCurrency(invoice.total, invoice.currency);
|
|
1062
1062
|
const period = `${formatDate3(invoice.periodStart)} - ${formatDate3(invoice.periodEnd)}`;
|
|
1063
1063
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1064
|
-
|
|
1064
|
+
_chunk7M7NPKOFjs.TableRow,
|
|
1065
1065
|
{
|
|
1066
1066
|
onClick: () => handleRowClick(invoice),
|
|
1067
1067
|
className: "cursor-pointer hover:bg-muted/50",
|
|
1068
1068
|
children: [
|
|
1069
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1070
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1071
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1072
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1073
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1069
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableCell, { className: "font-medium", children: invoiceNumber }),
|
|
1070
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableCell, { className: "text-muted-foreground text-sm", children: date }),
|
|
1071
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableCell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InvoiceStatusBadge, { status: invoice.status }) }),
|
|
1072
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableCell, { className: "text-right font-medium", children: amount }),
|
|
1073
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableCell, { className: "text-muted-foreground text-sm", children: period })
|
|
1074
1074
|
]
|
|
1075
1075
|
},
|
|
1076
1076
|
invoice.id
|
|
@@ -1119,12 +1119,12 @@ function InvoicesContainer() {
|
|
|
1119
1119
|
setStatusFilter(value);
|
|
1120
1120
|
}, "handleFilterChange");
|
|
1121
1121
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-4", children: [
|
|
1122
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1123
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1124
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1125
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1126
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1127
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1122
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Tabs, { value: statusFilter, onValueChange: handleFilterChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.TabsList, { children: [
|
|
1123
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TabsTrigger, { value: "all", children: "All" }),
|
|
1124
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TabsTrigger, { value: "paid" /* PAID */, children: "Paid" }),
|
|
1125
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TabsTrigger, { value: "open" /* OPEN */, children: "Open" }),
|
|
1126
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TabsTrigger, { value: "void" /* VOID */, children: "Void" }),
|
|
1127
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TabsTrigger, { value: "uncollectible" /* UNCOLLECTIBLE */, children: "Uncollectible" })
|
|
1128
1128
|
] }) }),
|
|
1129
1129
|
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-center py-8 text-muted-foreground", children: "Loading invoices..." }),
|
|
1130
1130
|
!loading && invoices.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "border border-dashed border-gray-300 rounded-lg p-8 text-center", children: [
|
|
@@ -1187,20 +1187,20 @@ function CancelSubscriptionDialog({
|
|
|
1187
1187
|
}
|
|
1188
1188
|
}, "onSubmit");
|
|
1189
1189
|
const periodEndDate = formatDate3(subscription.currentPeriodEnd);
|
|
1190
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1191
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1192
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1193
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1190
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.DialogContent, { className: "max-w-md", children: [
|
|
1191
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.DialogHeader, { children: [
|
|
1192
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.DialogTitle, { children: "Cancel Subscription" }),
|
|
1193
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.DialogDescription, { children: "Are you sure you want to cancel this subscription? This action cannot be undone." })
|
|
1194
1194
|
] }),
|
|
1195
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1196
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1195
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-col gap-y-4", children: [
|
|
1196
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.FormCheckbox, { form, id: "cancelImmediately", name: "Cancel Immediately" }),
|
|
1197
1197
|
cancelImmediately ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-red-50 border border-red-200 rounded-lg p-3 text-sm text-red-800", children: "Your subscription will be canceled immediately and you will lose access right away." }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-3 text-sm text-blue-800", children: [
|
|
1198
1198
|
"Your subscription will remain active until ",
|
|
1199
1199
|
periodEndDate,
|
|
1200
1200
|
". You can continue using the service until then."
|
|
1201
1201
|
] }),
|
|
1202
1202
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1203
|
-
|
|
1203
|
+
_chunk7M7NPKOFjs.FormTextarea,
|
|
1204
1204
|
{
|
|
1205
1205
|
form,
|
|
1206
1206
|
id: "reason",
|
|
@@ -1210,8 +1210,8 @@ function CancelSubscriptionDialog({
|
|
|
1210
1210
|
}
|
|
1211
1211
|
),
|
|
1212
1212
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-x-2 justify-end pt-2", children: [
|
|
1213
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1214
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1213
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { type: "button", variant: "outline", onClick: () => onOpenChange(false), disabled: isSubmitting, children: "Keep Subscription" }),
|
|
1214
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { type: "submit", variant: "destructive", disabled: isSubmitting, children: isSubmitting ? "Canceling..." : "Confirm Cancellation" })
|
|
1215
1215
|
] })
|
|
1216
1216
|
] }) })
|
|
1217
1217
|
] }) });
|
|
@@ -1333,10 +1333,10 @@ function SubscriptionDetails({
|
|
|
1333
1333
|
const canResume = subscription.status === "paused" /* PAUSED */;
|
|
1334
1334
|
const canCancel = subscription.status === "active" /* ACTIVE */ || subscription.status === "trialing" /* TRIALING */ || subscription.status === "paused" /* PAUSED */;
|
|
1335
1335
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1336
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1337
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1338
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1339
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1336
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.DialogContent, { className: "max-w-2xl", children: [
|
|
1337
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.DialogHeader, { children: [
|
|
1338
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.DialogTitle, { children: "Subscription Details" }),
|
|
1339
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.DialogDescription, { children: "View and manage your subscription" })
|
|
1340
1340
|
] }),
|
|
1341
1341
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
|
|
1342
1342
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-3", children: [
|
|
@@ -1372,11 +1372,11 @@ function SubscriptionDetails({
|
|
|
1372
1372
|
"."
|
|
1373
1373
|
] }) }),
|
|
1374
1374
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap gap-2 pt-4 border-t", children: [
|
|
1375
|
-
onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1376
|
-
canPause && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1377
|
-
canResume && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1378
|
-
canCancel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1379
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1375
|
+
onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { variant: "default", onClick: () => onChangePlan(subscription), children: "Change Plan" }),
|
|
1376
|
+
canPause && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { variant: "outline", onClick: handlePause, disabled: isProcessing, children: isProcessing ? "Pausing..." : "Pause" }),
|
|
1377
|
+
canResume && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { variant: "outline", onClick: handleResume, disabled: isProcessing, children: isProcessing ? "Resuming..." : "Resume" }),
|
|
1378
|
+
canCancel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { variant: "destructive", onClick: () => setShowCancel(true), children: "Cancel" }),
|
|
1379
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { variant: "outline", onClick: handleManageViaPortal, children: "Manage via Portal" })
|
|
1380
1380
|
] })
|
|
1381
1381
|
] })
|
|
1382
1382
|
] }) }),
|
|
@@ -1423,27 +1423,27 @@ function SubscriptionsList({ subscriptions, onSubscriptionsChange, onChangePlan
|
|
|
1423
1423
|
setSelectedSub(subscription);
|
|
1424
1424
|
}, "handleRowClick");
|
|
1425
1425
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1426
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-hidden", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1427
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1428
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1429
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1430
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1431
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1426
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-hidden", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Table, { children: [
|
|
1427
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.TableRow, { children: [
|
|
1428
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableHead, { children: "Status" }),
|
|
1429
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableHead, { children: "Plan" }),
|
|
1430
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableHead, { children: "Period" }),
|
|
1431
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableHead, { className: "text-right", children: "Amount" })
|
|
1432
1432
|
] }) }),
|
|
1433
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1433
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableBody, { children: subscriptions.map((subscription) => {
|
|
1434
1434
|
const price = subscription.price;
|
|
1435
1435
|
const amount = _optionalChain([price, 'optionalAccess', _48 => _48.unitAmount]) ? formatCurrency(price.unitAmount, price.currency) : "N/A";
|
|
1436
1436
|
const period = `${formatDate3(subscription.currentPeriodStart)} - ${formatDate3(subscription.currentPeriodEnd)}`;
|
|
1437
1437
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1438
|
-
|
|
1438
|
+
_chunk7M7NPKOFjs.TableRow,
|
|
1439
1439
|
{
|
|
1440
1440
|
onClick: () => handleRowClick(subscription),
|
|
1441
1441
|
className: "cursor-pointer hover:bg-muted/50",
|
|
1442
1442
|
children: [
|
|
1443
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1444
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1445
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1446
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1443
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableCell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SubscriptionStatusBadge, { status: subscription.status, cancelAtPeriodEnd: subscription.cancelAtPeriodEnd }) }),
|
|
1444
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableCell, { className: "font-medium", children: formatPlanName3(price) }),
|
|
1445
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableCell, { className: "text-muted-foreground text-sm", children: period }),
|
|
1446
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableCell, { className: "text-right font-medium", children: amount })
|
|
1447
1447
|
]
|
|
1448
1448
|
},
|
|
1449
1449
|
subscription.id
|
|
@@ -1501,7 +1501,7 @@ function SubscriptionsContainer({ onOpenWizard }) {
|
|
|
1501
1501
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8" }),
|
|
1502
1502
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-3xl font-bold", children: "Subscriptions" })
|
|
1503
1503
|
] }),
|
|
1504
|
-
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1504
|
+
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { onClick: () => _optionalChain([onOpenWizard, 'optionalCall', _49 => _49()]), children: "Subscribe to a Plan" })
|
|
1505
1505
|
] }),
|
|
1506
1506
|
criticalSubscriptions.map((subscription) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BillingAlertBanner, { subscription }, subscription.id)),
|
|
1507
1507
|
subscriptions.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center py-12 space-y-4", children: [
|
|
@@ -1509,7 +1509,7 @@ function SubscriptionsContainer({ onOpenWizard }) {
|
|
|
1509
1509
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
1510
1510
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-xl font-semibold mb-2", children: "No Active Subscriptions" }),
|
|
1511
1511
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground mb-6", children: "Choose a subscription plan to get started with our services." }),
|
|
1512
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1512
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { onClick: () => _optionalChain([onOpenWizard, 'optionalCall', _50 => _50()]), children: "Subscribe to a Plan" })
|
|
1513
1513
|
] })
|
|
1514
1514
|
] }),
|
|
1515
1515
|
subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1530,9 +1530,9 @@ function IntervalToggle({ value, onChange, hasMonthly, hasYearly }) {
|
|
|
1530
1530
|
if (!hasMonthly || !hasYearly) {
|
|
1531
1531
|
return null;
|
|
1532
1532
|
}
|
|
1533
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1534
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1535
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1533
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Tabs, { value, onValueChange: (v) => onChange(v), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.TabsList, { children: [
|
|
1534
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TabsTrigger, { value: "month", children: "Monthly" }),
|
|
1535
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TabsTrigger, { value: "year", children: "Yearly" })
|
|
1536
1536
|
] }) });
|
|
1537
1537
|
}
|
|
1538
1538
|
_chunk7QVYU63Ejs.__name.call(void 0, IntervalToggle, "IntervalToggle");
|
|
@@ -1557,7 +1557,7 @@ function PricingCard({ price, isCurrentPlan = false, isSelected = false, isDisab
|
|
|
1557
1557
|
}
|
|
1558
1558
|
}, "handleClick");
|
|
1559
1559
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1560
|
-
|
|
1560
|
+
_chunk7M7NPKOFjs.Card,
|
|
1561
1561
|
{
|
|
1562
1562
|
role: "radio",
|
|
1563
1563
|
"aria-checked": isSelected,
|
|
@@ -1575,9 +1575,9 @@ function PricingCard({ price, isCurrentPlan = false, isSelected = false, isDisab
|
|
|
1575
1575
|
isLoading && "pointer-events-none"
|
|
1576
1576
|
),
|
|
1577
1577
|
children: [
|
|
1578
|
-
isCurrentPlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1579
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1580
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1578
|
+
isCurrentPlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Badge, { variant: "secondary", className: "absolute top-2 right-2", children: "Current" }),
|
|
1579
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardHeader, { className: "pb-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "font-semibold text-lg", children: description }) }),
|
|
1580
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardContent, { className: "pb-4 grow", children: [
|
|
1581
1581
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mb-4", children: [
|
|
1582
1582
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-3xl font-bold", children: formattedPrice }),
|
|
1583
1583
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground ml-1", children: interval })
|
|
@@ -1587,8 +1587,8 @@ function PricingCard({ price, isCurrentPlan = false, isSelected = false, isDisab
|
|
|
1587
1587
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-muted-foreground", children: feature })
|
|
1588
1588
|
] }, index)) })
|
|
1589
1589
|
] }),
|
|
1590
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1591
|
-
|
|
1590
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardFooter, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1591
|
+
_chunk7M7NPKOFjs.Button,
|
|
1592
1592
|
{
|
|
1593
1593
|
variant: isCurrentPlan ? "secondary" : isSelected ? "default" : "outline",
|
|
1594
1594
|
className: "w-full",
|
|
@@ -1711,15 +1711,15 @@ function ProductPricingList({
|
|
|
1711
1711
|
_chunk7QVYU63Ejs.__name.call(void 0, ProductPricingList, "ProductPricingList");
|
|
1712
1712
|
function ProductPricingListSkeleton() {
|
|
1713
1713
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-6", children: [1, 2].map((rowIndex) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-3", children: [
|
|
1714
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1714
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Skeleton, { className: "h-6 w-32" }),
|
|
1715
1715
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4", children: [1, 2, 3].map((cardIndex) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "p-4 rounded-lg border animate-pulse space-y-3", children: [
|
|
1716
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1717
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1716
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Skeleton, { className: "h-6 w-24" }),
|
|
1717
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Skeleton, { className: "h-8 w-32" }),
|
|
1718
1718
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
1719
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1720
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1719
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Skeleton, { className: "h-4 w-full" }),
|
|
1720
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Skeleton, { className: "h-4 w-3/4" })
|
|
1721
1721
|
] }),
|
|
1722
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1722
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Skeleton, { className: "h-10 w-full" })
|
|
1723
1723
|
] }, cardIndex)) })
|
|
1724
1724
|
] }, rowIndex)) });
|
|
1725
1725
|
}
|
|
@@ -1774,8 +1774,8 @@ function SubscriptionConfirmation({ price, isLoading, onConfirm, onCancel }) {
|
|
|
1774
1774
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: feature })
|
|
1775
1775
|
] }, index)) }),
|
|
1776
1776
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-3 pt-2 border-t border-accent/30", children: [
|
|
1777
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1778
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1777
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { variant: "outline", onClick: onCancel, disabled: isLoading, children: "Cancel" }),
|
|
1778
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { onClick: onConfirm, disabled: isLoading, children: isLoading ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1779
1779
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-4 w-4 animate-spin mr-2" }),
|
|
1780
1780
|
"Processing..."
|
|
1781
1781
|
] }) : "Subscribe" })
|
|
@@ -2053,7 +2053,7 @@ function WizardStepPlanSelection({
|
|
|
2053
2053
|
onSelectPrice: handleSelectPrice
|
|
2054
2054
|
}
|
|
2055
2055
|
),
|
|
2056
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex justify-end pt-4 border-t", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2056
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex justify-end pt-4 border-t", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { onClick: onNext, disabled: !selectedPrice || isProcessing, children: isProcessing ? "Loading..." : "Next: Review" }) })
|
|
2057
2057
|
] });
|
|
2058
2058
|
}
|
|
2059
2059
|
_chunk7QVYU63Ejs.__name.call(void 0, WizardStepPlanSelection, "WizardStepPlanSelection");
|
|
@@ -2108,16 +2108,16 @@ function WizardStepReview({
|
|
|
2108
2108
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h4", { className: "font-medium", children: "Payment Method" }),
|
|
2109
2109
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: hasPaymentMethod ? "A payment method is on file" : "No payment method on file" })
|
|
2110
2110
|
] }),
|
|
2111
|
-
!hasPaymentMethod && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2111
|
+
!hasPaymentMethod && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { variant: "outline", onClick: onAddPaymentMethod, children: "Add Payment Method" })
|
|
2112
2112
|
] }) }),
|
|
2113
|
-
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2113
|
+
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Alert, { variant: "destructive", children: [
|
|
2114
2114
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.AlertCircle, { className: "h-4 w-4" }),
|
|
2115
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2115
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.AlertDescription, { children: error })
|
|
2116
2116
|
] }),
|
|
2117
2117
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between pt-4 border-t", children: [
|
|
2118
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2118
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { variant: "outline", onClick: onBack, disabled: isProcessing, children: "Back" }),
|
|
2119
2119
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2120
|
-
|
|
2120
|
+
_chunk7M7NPKOFjs.Button,
|
|
2121
2121
|
{
|
|
2122
2122
|
onClick: hasPaymentMethod ? onConfirm : onAddPaymentMethod,
|
|
2123
2123
|
disabled: isProcessing,
|
|
@@ -2185,10 +2185,10 @@ function SubscriptionWizard({
|
|
|
2185
2185
|
}, [open, actions.reset]);
|
|
2186
2186
|
const dialogTitle = subscription ? "Change Subscription Plan" : "Subscribe to a Plan";
|
|
2187
2187
|
const dialogDescription = subscription ? "Select a new plan for your subscription" : "Choose a subscription plan to get started";
|
|
2188
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2189
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2190
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2191
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2188
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.DialogContent, { className: "max-w-2xl", children: [
|
|
2189
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.DialogHeader, { children: [
|
|
2190
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.DialogTitle, { children: dialogTitle }),
|
|
2191
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.DialogDescription, { children: dialogDescription })
|
|
2192
2192
|
] }),
|
|
2193
2193
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, WizardProgressIndicator, { currentStep: state.step }),
|
|
2194
2194
|
state.step === "plan-selection" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2264,15 +2264,15 @@ function UsageSummaryCard({ meter, summary }) {
|
|
|
2264
2264
|
const progressWidth = percentage !== null ? Math.min(percentage, 100) : 0;
|
|
2265
2265
|
const displayName = meter.displayName || meter.eventName;
|
|
2266
2266
|
const hasLimit = limit !== null && limit !== void 0;
|
|
2267
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2268
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2267
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Card, { children: [
|
|
2268
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardHeader, { className: "flex flex-row items-center gap-x-3 pb-3", children: [
|
|
2269
2269
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-blue-100 text-blue-600", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-5 w-5" }) }),
|
|
2270
2270
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
|
|
2271
2271
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "font-semibold", children: displayName }),
|
|
2272
2272
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-gray-500", children: meter.id })
|
|
2273
2273
|
] })
|
|
2274
2274
|
] }),
|
|
2275
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2275
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardContent, { className: "flex flex-col gap-y-4", children: [
|
|
2276
2276
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
2277
2277
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-3xl font-bold", children: currentUsage.toLocaleString() }),
|
|
2278
2278
|
hasLimit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-sm text-gray-500", children: [
|
|
@@ -2400,21 +2400,21 @@ function UsageHistoryTable({ usageRecords }) {
|
|
|
2400
2400
|
}
|
|
2401
2401
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
2402
2402
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: "text-xl font-semibold", children: "Usage History" }),
|
|
2403
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-hidden rounded-lg border", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2404
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2405
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2406
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2407
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2408
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2403
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-hidden rounded-lg border", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Table, { children: [
|
|
2404
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.TableRow, { children: [
|
|
2405
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableHead, { children: "Date & Time" }),
|
|
2406
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableHead, { children: "Meter Event" }),
|
|
2407
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableHead, { className: "text-right", children: "Quantity" }),
|
|
2408
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableHead, { children: "Event ID" })
|
|
2409
2409
|
] }) }),
|
|
2410
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2410
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableBody, { children: usageRecords.map((record) => {
|
|
2411
2411
|
const dateTime = formatDateTime(record.timestamp);
|
|
2412
2412
|
const quantity = record.quantity.toLocaleString();
|
|
2413
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2414
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2415
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2416
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2417
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2413
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.TableRow, { children: [
|
|
2414
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableCell, { className: "font-medium", children: dateTime }),
|
|
2415
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableCell, { className: "text-muted-foreground", children: record.meterEventName }),
|
|
2416
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableCell, { className: "text-right font-medium", children: quantity }),
|
|
2417
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.TableCell, { className: "text-muted-foreground text-sm font-mono", children: record.stripeEventId })
|
|
2418
2418
|
] }, record.id);
|
|
2419
2419
|
}) })
|
|
2420
2420
|
] }) })
|
|
@@ -2431,8 +2431,8 @@ function BillingDetailModal({
|
|
|
2431
2431
|
children,
|
|
2432
2432
|
className
|
|
2433
2433
|
}) {
|
|
2434
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2435
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2434
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.DialogContent, { className: _nullishCoalesce(className, () => ( "max-w-4xl max-h-[90vh] overflow-y-auto")), children: [
|
|
2435
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.DialogHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.DialogTitle, { children: title }) }),
|
|
2436
2436
|
children
|
|
2437
2437
|
] }) });
|
|
2438
2438
|
}
|
|
@@ -2449,7 +2449,7 @@ function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }) {
|
|
|
2449
2449
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "font-semibold text-red-900", children: "Payment Failed" }),
|
|
2450
2450
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-red-700 mt-1", children: "Your last payment failed. Please update your payment method to avoid service interruption." })
|
|
2451
2451
|
] }),
|
|
2452
|
-
onUpdatePayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2452
|
+
onUpdatePayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { variant: "outline", size: "sm", onClick: onUpdatePayment, className: "border-red-300 text-red-700", children: "Update Payment Method" })
|
|
2453
2453
|
] });
|
|
2454
2454
|
}
|
|
2455
2455
|
if (subscription.status === "trialing" /* TRIALING */ && subscription.trialEnd) {
|
|
@@ -2469,7 +2469,7 @@ function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }) {
|
|
|
2469
2469
|
". Add a payment method to continue your subscription."
|
|
2470
2470
|
] })
|
|
2471
2471
|
] }),
|
|
2472
|
-
onAddPayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2472
|
+
onAddPayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { variant: "outline", size: "sm", onClick: onAddPayment, className: "border-yellow-300 text-yellow-700", children: "Add Payment Method" })
|
|
2473
2473
|
] });
|
|
2474
2474
|
}
|
|
2475
2475
|
}
|
|
@@ -2693,18 +2693,18 @@ function BillingDashboardContainer() {
|
|
|
2693
2693
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-8 w-8" }),
|
|
2694
2694
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-3xl font-bold", children: "Billing" })
|
|
2695
2695
|
] }),
|
|
2696
|
-
isInitialLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2697
|
-
noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2698
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2696
|
+
isInitialLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardContent, { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-8 w-8 animate-spin text-muted-foreground" }) }) }),
|
|
2697
|
+
noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Card, { children: [
|
|
2698
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.CardHeader, { className: "text-center", children: [
|
|
2699
2699
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8 text-primary" }) }),
|
|
2700
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2701
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2700
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardTitle, { children: "Set Up Billing" }),
|
|
2701
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardDescription, { children: "Your company doesn't have a billing account yet. Set one up to manage subscriptions, payment methods, and view invoices." })
|
|
2702
2702
|
] }),
|
|
2703
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2703
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardContent, { className: "flex justify-center pb-8", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { onClick: handleCreateCustomer, disabled: creatingCustomer, size: "lg", children: creatingCustomer ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2704
2704
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
2705
2705
|
"Setting up..."
|
|
2706
2706
|
] }) : "Set Up Billing Account" }) }),
|
|
2707
|
-
errors.customer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2707
|
+
errors.customer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CardContent, { className: "pt-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-center text-sm text-destructive", children: errors.customer }) })
|
|
2708
2708
|
] }),
|
|
2709
2709
|
!noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2710
2710
|
criticalSubscriptions.map((subscription) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2982,10 +2982,10 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
2982
2982
|
{ id: "licensed", text: "Licensed (per unit)" },
|
|
2983
2983
|
{ id: "metered", text: "Metered (usage-based)" }
|
|
2984
2984
|
];
|
|
2985
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2986
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2987
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2988
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2985
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.DialogContent, { className: "max-w-2xl", children: [
|
|
2986
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.DialogHeader, { children: [
|
|
2987
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.DialogTitle, { children: isEditMode ? "Edit Price" : "Create Price" }),
|
|
2988
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.DialogDescription, { children: isEditMode ? "Update the price details. Note: Only nickname and active status can be changed." : "Create a new price for this product" })
|
|
2989
2989
|
] }),
|
|
2990
2990
|
isEditMode && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4 flex gap-x-3", children: [
|
|
2991
2991
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.AlertCircle, { className: "h-5 w-5 text-blue-600 flex-shrink-0 mt-0.5" }),
|
|
@@ -2994,10 +2994,10 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
2994
2994
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { children: "Due to Stripe's architecture, only the nickname and active status can be modified after creation. To change amount, currency, or billing interval, create a new price." })
|
|
2995
2995
|
] })
|
|
2996
2996
|
] }),
|
|
2997
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2997
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-col gap-y-4", children: [
|
|
2998
2998
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-2 gap-x-4", children: [
|
|
2999
2999
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3000
|
-
|
|
3000
|
+
_chunk7M7NPKOFjs.FormInput,
|
|
3001
3001
|
{
|
|
3002
3002
|
form,
|
|
3003
3003
|
id: "unitAmount",
|
|
@@ -3007,10 +3007,10 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3007
3007
|
isRequired: true
|
|
3008
3008
|
}
|
|
3009
3009
|
),
|
|
3010
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3010
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.FormSelect, { form, id: "currency", name: "Currency", values: currencyOptions, disabled: isEditMode })
|
|
3011
3011
|
] }),
|
|
3012
3012
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3013
|
-
|
|
3013
|
+
_chunk7M7NPKOFjs.FormSelect,
|
|
3014
3014
|
{
|
|
3015
3015
|
form,
|
|
3016
3016
|
id: "interval",
|
|
@@ -3021,7 +3021,7 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3021
3021
|
),
|
|
3022
3022
|
isRecurring && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-2 gap-x-4", children: [
|
|
3023
3023
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3024
|
-
|
|
3024
|
+
_chunk7M7NPKOFjs.FormInput,
|
|
3025
3025
|
{
|
|
3026
3026
|
form,
|
|
3027
3027
|
id: "intervalCount",
|
|
@@ -3032,7 +3032,7 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3032
3032
|
}
|
|
3033
3033
|
),
|
|
3034
3034
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3035
|
-
|
|
3035
|
+
_chunk7M7NPKOFjs.FormSelect,
|
|
3036
3036
|
{
|
|
3037
3037
|
form,
|
|
3038
3038
|
id: "usageType",
|
|
@@ -3043,7 +3043,7 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3043
3043
|
)
|
|
3044
3044
|
] }),
|
|
3045
3045
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3046
|
-
|
|
3046
|
+
_chunk7M7NPKOFjs.FormInput,
|
|
3047
3047
|
{
|
|
3048
3048
|
form,
|
|
3049
3049
|
id: "nickname",
|
|
@@ -3052,7 +3052,7 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3052
3052
|
}
|
|
3053
3053
|
),
|
|
3054
3054
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3055
|
-
|
|
3055
|
+
_chunk7M7NPKOFjs.FormTextarea,
|
|
3056
3056
|
{
|
|
3057
3057
|
form,
|
|
3058
3058
|
id: "description",
|
|
@@ -3061,13 +3061,13 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3061
3061
|
className: "min-h-24"
|
|
3062
3062
|
}
|
|
3063
3063
|
),
|
|
3064
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3064
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.FormInput, { form, id: "token", name: "Token (optional)", placeholder: "Enter token value" }),
|
|
3065
3065
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
3066
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3066
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Label, { children: "Features (optional)" }),
|
|
3067
3067
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
3068
3068
|
form.watch("features").map((_, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-2", children: [
|
|
3069
3069
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3070
|
-
|
|
3070
|
+
_chunk7M7NPKOFjs.Input,
|
|
3071
3071
|
{
|
|
3072
3072
|
...form.register(`features.${index}`),
|
|
3073
3073
|
placeholder: `Feature ${index + 1}`,
|
|
@@ -3075,7 +3075,7 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3075
3075
|
}
|
|
3076
3076
|
),
|
|
3077
3077
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3078
|
-
|
|
3078
|
+
_chunk7M7NPKOFjs.Button,
|
|
3079
3079
|
{
|
|
3080
3080
|
type: "button",
|
|
3081
3081
|
variant: "outline",
|
|
@@ -3092,7 +3092,7 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3092
3092
|
)
|
|
3093
3093
|
] }, index)),
|
|
3094
3094
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3095
|
-
|
|
3095
|
+
_chunk7M7NPKOFjs.Button,
|
|
3096
3096
|
{
|
|
3097
3097
|
type: "button",
|
|
3098
3098
|
variant: "outline",
|
|
@@ -3110,8 +3110,8 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3110
3110
|
)
|
|
3111
3111
|
] })
|
|
3112
3112
|
] }),
|
|
3113
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3114
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3113
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.FormCheckbox, { form, id: "active", name: "Active" }),
|
|
3114
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CommonEditorButtons, { isEdit: isEditMode, form, disabled: isSubmitting, setOpen: onOpenChange })
|
|
3115
3115
|
] }) })
|
|
3116
3116
|
] }) });
|
|
3117
3117
|
}
|
|
@@ -3197,12 +3197,12 @@ function PricesList({ productId, onPricesChange }) {
|
|
|
3197
3197
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-4", children: [
|
|
3198
3198
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-between mb-4", children: [
|
|
3199
3199
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h4", { className: "text-lg font-semibold", children: "Prices" }),
|
|
3200
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3200
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { size: "sm", onClick: () => setShowCreatePrice(true), children: "Add Price" })
|
|
3201
3201
|
] }),
|
|
3202
3202
|
prices.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-background flex flex-col items-center justify-center gap-y-3 rounded-lg border border-dashed p-8", children: [
|
|
3203
3203
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.DollarSign, { className: "text-muted-foreground h-12 w-12" }),
|
|
3204
3204
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-sm", children: "No prices yet. Add a price to enable subscriptions." }),
|
|
3205
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3205
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { size: "sm", onClick: () => setShowCreatePrice(true), children: "Add Price" })
|
|
3206
3206
|
] }),
|
|
3207
3207
|
prices.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: prices.map((price) => {
|
|
3208
3208
|
const isArchiving = archivingPriceId === price.id;
|
|
@@ -3211,9 +3211,9 @@ function PricesList({ productId, onPricesChange }) {
|
|
|
3211
3211
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-start justify-between mb-3", children: [
|
|
3212
3212
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.DollarSign, { className: "h-5 w-5 text-primary" }),
|
|
3213
3213
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-1", children: [
|
|
3214
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3214
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { variant: "ghost", size: "sm", onClick: () => setEditingPrice(price), className: "h-8 w-8 p-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Edit, { className: "h-4 w-4" }) }),
|
|
3215
3215
|
price.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3216
|
-
|
|
3216
|
+
_chunk7M7NPKOFjs.Button,
|
|
3217
3217
|
{
|
|
3218
3218
|
variant: "ghost",
|
|
3219
3219
|
size: "sm",
|
|
@@ -3223,7 +3223,7 @@ function PricesList({ productId, onPricesChange }) {
|
|
|
3223
3223
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Archive, { className: "h-4 w-4" })
|
|
3224
3224
|
}
|
|
3225
3225
|
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3226
|
-
|
|
3226
|
+
_chunk7M7NPKOFjs.Button,
|
|
3227
3227
|
{
|
|
3228
3228
|
variant: "ghost",
|
|
3229
3229
|
size: "sm",
|
|
@@ -3274,20 +3274,20 @@ function PricesList({ productId, onPricesChange }) {
|
|
|
3274
3274
|
}
|
|
3275
3275
|
}
|
|
3276
3276
|
),
|
|
3277
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3278
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3279
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3280
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3277
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.AlertDialog, { open: !!priceToArchive, onOpenChange: (open) => !open && setPriceToArchive(null), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.AlertDialogContent, { children: [
|
|
3278
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.AlertDialogHeader, { children: [
|
|
3279
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.AlertDialogTitle, { children: "Archive Price" }),
|
|
3280
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.AlertDialogDescription, { children: [
|
|
3281
3281
|
"Are you sure you want to archive the price for",
|
|
3282
3282
|
" ",
|
|
3283
3283
|
priceToArchive && `${formatCurrency(priceToArchive.unitAmount, priceToArchive.currency)} ${formatInterval2(priceToArchive)}`,
|
|
3284
3284
|
"? This will prevent new subscriptions but existing ones will continue."
|
|
3285
3285
|
] })
|
|
3286
3286
|
] }),
|
|
3287
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3288
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3287
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.AlertDialogFooter, { children: [
|
|
3288
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.AlertDialogCancel, { disabled: !!archivingPriceId, children: "Cancel" }),
|
|
3289
3289
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3290
|
-
|
|
3290
|
+
_chunk7M7NPKOFjs.AlertDialogAction,
|
|
3291
3291
|
{
|
|
3292
3292
|
onClick: handleArchive,
|
|
3293
3293
|
disabled: !!archivingPriceId,
|
|
@@ -3297,20 +3297,20 @@ function PricesList({ productId, onPricesChange }) {
|
|
|
3297
3297
|
)
|
|
3298
3298
|
] })
|
|
3299
3299
|
] }) }),
|
|
3300
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3301
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3302
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3303
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3300
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.AlertDialog, { open: !!priceToReactivate, onOpenChange: (open) => !open && setPriceToReactivate(null), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.AlertDialogContent, { children: [
|
|
3301
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.AlertDialogHeader, { children: [
|
|
3302
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.AlertDialogTitle, { children: "Reactivate Price" }),
|
|
3303
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.AlertDialogDescription, { children: [
|
|
3304
3304
|
"Are you sure you want to reactivate the price for",
|
|
3305
3305
|
" ",
|
|
3306
3306
|
priceToReactivate && `${formatCurrency(priceToReactivate.unitAmount, priceToReactivate.currency)} ${formatInterval2(priceToReactivate)}`,
|
|
3307
3307
|
"? This will allow new subscriptions again."
|
|
3308
3308
|
] })
|
|
3309
3309
|
] }),
|
|
3310
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3311
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3310
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.AlertDialogFooter, { children: [
|
|
3311
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.AlertDialogCancel, { disabled: !!reactivatingPriceId, children: "Cancel" }),
|
|
3312
3312
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3313
|
-
|
|
3313
|
+
_chunk7M7NPKOFjs.AlertDialogAction,
|
|
3314
3314
|
{
|
|
3315
3315
|
onClick: handleReactivate,
|
|
3316
3316
|
disabled: !!reactivatingPriceId,
|
|
@@ -3376,15 +3376,15 @@ function ProductEditor({ product, open, onOpenChange, onSuccess }) {
|
|
|
3376
3376
|
setIsSubmitting(false);
|
|
3377
3377
|
}
|
|
3378
3378
|
}, "onSubmit");
|
|
3379
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3380
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3381
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3382
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3379
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.DialogContent, { className: "max-w-2xl", children: [
|
|
3380
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.DialogHeader, { children: [
|
|
3381
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.DialogTitle, { children: product ? "Edit Product" : "Create Product" }),
|
|
3382
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.DialogDescription, { children: product ? `Update the details for ${product.name}` : "Create a new product to offer to your customers" })
|
|
3383
3383
|
] }),
|
|
3384
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3385
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3384
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-col gap-y-4", children: [
|
|
3385
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.FormInput, { form, id: "name", name: "Product Name", placeholder: "Enter product name", isRequired: true }),
|
|
3386
3386
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3387
|
-
|
|
3387
|
+
_chunk7M7NPKOFjs.FormTextarea,
|
|
3388
3388
|
{
|
|
3389
3389
|
form,
|
|
3390
3390
|
id: "description",
|
|
@@ -3393,8 +3393,8 @@ function ProductEditor({ product, open, onOpenChange, onSuccess }) {
|
|
|
3393
3393
|
className: "min-h-32"
|
|
3394
3394
|
}
|
|
3395
3395
|
),
|
|
3396
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3397
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3396
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.FormCheckbox, { form, id: "active", name: "Active" }),
|
|
3397
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.CommonEditorButtons, { isEdit: !!product, form, disabled: isSubmitting, setOpen: onOpenChange })
|
|
3398
3398
|
] }) })
|
|
3399
3399
|
] }) });
|
|
3400
3400
|
}
|
|
@@ -3461,12 +3461,12 @@ function ProductsList({ products, onProductsChange }) {
|
|
|
3461
3461
|
] })
|
|
3462
3462
|
] }),
|
|
3463
3463
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
|
|
3464
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3464
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.Button, { variant: "outline", size: "sm", onClick: () => setEditingProduct(product), children: [
|
|
3465
3465
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Edit, { className: "h-4 w-4 mr-1" }),
|
|
3466
3466
|
"Edit"
|
|
3467
3467
|
] }),
|
|
3468
3468
|
product.active ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3469
|
-
|
|
3469
|
+
_chunk7M7NPKOFjs.Button,
|
|
3470
3470
|
{
|
|
3471
3471
|
variant: "outline",
|
|
3472
3472
|
size: "sm",
|
|
@@ -3478,7 +3478,7 @@ function ProductsList({ products, onProductsChange }) {
|
|
|
3478
3478
|
]
|
|
3479
3479
|
}
|
|
3480
3480
|
) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3481
|
-
|
|
3481
|
+
_chunk7M7NPKOFjs.Button,
|
|
3482
3482
|
{
|
|
3483
3483
|
variant: "outline",
|
|
3484
3484
|
size: "sm",
|
|
@@ -3490,7 +3490,7 @@ function ProductsList({ products, onProductsChange }) {
|
|
|
3490
3490
|
]
|
|
3491
3491
|
}
|
|
3492
3492
|
),
|
|
3493
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3493
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { variant: "ghost", size: "sm", onClick: () => toggleExpand(product.id), children: isExpanded ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ChevronUp, { className: "h-5 w-5" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ChevronDown, { className: "h-5 w-5" }) })
|
|
3494
3494
|
] })
|
|
3495
3495
|
] }),
|
|
3496
3496
|
isExpanded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border-t bg-muted/30 p-6", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PricesList, { productId: product.id, onPricesChange: onProductsChange }) })
|
|
@@ -3508,19 +3508,19 @@ function ProductsList({ products, onProductsChange }) {
|
|
|
3508
3508
|
}
|
|
3509
3509
|
}
|
|
3510
3510
|
),
|
|
3511
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3512
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3513
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3514
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3511
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.AlertDialog, { open: !!productToArchive, onOpenChange: (open) => !open && setProductToArchive(null), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.AlertDialogContent, { children: [
|
|
3512
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.AlertDialogHeader, { children: [
|
|
3513
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.AlertDialogTitle, { children: "Archive Product" }),
|
|
3514
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.AlertDialogDescription, { children: [
|
|
3515
3515
|
'Are you sure you want to archive "',
|
|
3516
3516
|
_optionalChain([productToArchive, 'optionalAccess', _144 => _144.name]),
|
|
3517
3517
|
'"? This will deactivate it and it will no longer be available for new subscriptions.'
|
|
3518
3518
|
] })
|
|
3519
3519
|
] }),
|
|
3520
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3521
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3520
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.AlertDialogFooter, { children: [
|
|
3521
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.AlertDialogCancel, { disabled: !!archivingProductId, children: "Cancel" }),
|
|
3522
3522
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3523
|
-
|
|
3523
|
+
_chunk7M7NPKOFjs.AlertDialogAction,
|
|
3524
3524
|
{
|
|
3525
3525
|
onClick: handleArchive,
|
|
3526
3526
|
disabled: !!archivingProductId,
|
|
@@ -3530,19 +3530,19 @@ function ProductsList({ products, onProductsChange }) {
|
|
|
3530
3530
|
)
|
|
3531
3531
|
] })
|
|
3532
3532
|
] }) }),
|
|
3533
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3534
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3535
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3536
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3533
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.AlertDialog, { open: !!productToReactivate, onOpenChange: (open) => !open && setProductToReactivate(null), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.AlertDialogContent, { children: [
|
|
3534
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.AlertDialogHeader, { children: [
|
|
3535
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.AlertDialogTitle, { children: "Reactivate Product" }),
|
|
3536
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.AlertDialogDescription, { children: [
|
|
3537
3537
|
'Are you sure you want to reactivate "',
|
|
3538
3538
|
_optionalChain([productToReactivate, 'optionalAccess', _145 => _145.name]),
|
|
3539
3539
|
'"? This will make it available for new subscriptions again.'
|
|
3540
3540
|
] })
|
|
3541
3541
|
] }),
|
|
3542
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3543
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3542
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk7M7NPKOFjs.AlertDialogFooter, { children: [
|
|
3543
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.AlertDialogCancel, { disabled: !!reactivatingProductId, children: "Cancel" }),
|
|
3544
3544
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3545
|
-
|
|
3545
|
+
_chunk7M7NPKOFjs.AlertDialogAction,
|
|
3546
3546
|
{
|
|
3547
3547
|
onClick: handleReactivate,
|
|
3548
3548
|
disabled: !!reactivatingProductId,
|
|
@@ -3559,7 +3559,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductsList, "ProductsList");
|
|
|
3559
3559
|
// src/features/billing/stripe-product/components/containers/ProductsAdminContainer.tsx
|
|
3560
3560
|
|
|
3561
3561
|
function ProductsAdminContainer() {
|
|
3562
|
-
const { hasRole } =
|
|
3562
|
+
const { hasRole } = _chunk7M7NPKOFjs.useCurrentUserContext.call(void 0, );
|
|
3563
3563
|
const [products, setProducts] = _react.useState.call(void 0, []);
|
|
3564
3564
|
const [loading, setLoading] = _react.useState.call(void 0, true);
|
|
3565
3565
|
const [showCreateProduct, setShowCreateProduct] = _react.useState.call(void 0, false);
|
|
@@ -3589,14 +3589,14 @@ function ProductsAdminContainer() {
|
|
|
3589
3589
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Package, { className: "h-8 w-8" }),
|
|
3590
3590
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-3xl font-bold", children: "Product & Price Management" })
|
|
3591
3591
|
] }),
|
|
3592
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3592
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { onClick: () => setShowCreateProduct(true), children: "Create Product" })
|
|
3593
3593
|
] }),
|
|
3594
3594
|
products.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-muted/50 flex flex-col items-center justify-center gap-y-4 rounded-lg border-2 border-dashed p-12", children: [
|
|
3595
3595
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Package, { className: "text-muted-foreground h-16 w-16" }),
|
|
3596
3596
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
|
|
3597
3597
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "mb-2 text-xl font-semibold", children: "No products yet" }),
|
|
3598
3598
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground mb-4", children: "Create your first product to start offering subscriptions to your customers." }),
|
|
3599
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3599
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7M7NPKOFjs.Button, { onClick: () => setShowCreateProduct(true), children: "Create Your First Product" })
|
|
3600
3600
|
] })
|
|
3601
3601
|
] }),
|
|
3602
3602
|
products.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductsList, { products, onProductsChange: loadProducts }),
|