@carlonicora/nextjs-jsonapi 6.9.0 → 6.10.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.
Files changed (51) hide show
  1. package/dist/{BlockNoteEditor-WN73IHXR.mjs → BlockNoteEditor-GK3DRTOP.mjs} +49 -15
  2. package/dist/BlockNoteEditor-GK3DRTOP.mjs.map +1 -0
  3. package/dist/{BlockNoteEditor-XXH3VBZ7.js → BlockNoteEditor-YOKJOVV3.js} +64 -30
  4. package/dist/BlockNoteEditor-YOKJOVV3.js.map +1 -0
  5. package/dist/billing/index.js +436 -435
  6. package/dist/billing/index.js.map +1 -1
  7. package/dist/billing/index.mjs +8 -7
  8. package/dist/billing/index.mjs.map +1 -1
  9. package/dist/{chunk-ZCM4JLM7.js → chunk-4UFMLTL2.js} +73 -71
  10. package/dist/chunk-4UFMLTL2.js.map +1 -0
  11. package/dist/{chunk-Q4XLE3QO.mjs → chunk-THZAK7S3.mjs} +9 -7
  12. package/dist/{chunk-Q4XLE3QO.mjs.map → chunk-THZAK7S3.mjs.map} +1 -1
  13. package/dist/client/index.js +2 -2
  14. package/dist/client/index.mjs +1 -1
  15. package/dist/components/index.d.mts +12 -5
  16. package/dist/components/index.d.ts +12 -5
  17. package/dist/components/index.js +2 -2
  18. package/dist/components/index.mjs +1 -1
  19. package/dist/contexts/index.js +2 -2
  20. package/dist/contexts/index.mjs +1 -1
  21. package/dist/email-automations/index.js +58 -58
  22. package/dist/email-automations/index.mjs +1 -1
  23. package/dist/features/analytics/index.js +87 -87
  24. package/dist/features/analytics/index.mjs +1 -1
  25. package/dist/features/blog/index.js +93 -93
  26. package/dist/features/blog/index.mjs +1 -1
  27. package/dist/features/help/index.js +31 -31
  28. package/dist/features/help/index.mjs +1 -1
  29. package/dist/features/tokenusage/index.js +77 -77
  30. package/dist/features/tokenusage/index.mjs +1 -1
  31. package/messages/en.json +4 -2
  32. package/messages/it.json +4 -2
  33. package/package.json +1 -1
  34. package/src/components/editors/BlockNoteEditor.tsx +69 -14
  35. package/src/components/editors/__tests__/BlockNoteEditor.ai.spec.tsx +295 -0
  36. package/src/features/assistant/components/containers/AssistantPageContainer.tsx +20 -9
  37. package/src/features/assistant/components/containers/__tests__/AssistantPageContainer.spec.tsx +116 -0
  38. package/src/features/assistant/components/parts/AssistantThread.tsx +2 -1
  39. package/src/features/assistant-message/components/MessageItem.tsx +1 -1
  40. package/src/features/assistant-message/components/MessageList.tsx +1 -1
  41. package/src/features/assistant-message/components/parts/MessageSourcesContainer.tsx +1 -1
  42. package/src/features/assistant-message/components/parts/MessageSourcesPanel.tsx +1 -1
  43. package/src/features/assistant-message/components/parts/__tests__/MessageSourcesPanel.spec.tsx +17 -1
  44. package/src/features/assistant-message/components/parts/__tests__/SuggestedQuestionsTab.spec.tsx +22 -0
  45. package/src/features/assistant-message/components/parts/tabs/SuggestedQuestionsTab.tsx +5 -3
  46. package/src/features/billing/i18n-keys.ts +2 -0
  47. package/src/features/billing/stripe-subscription/components/widgets/ProrationPreview.tsx +1 -2
  48. package/src/features/billing/stripe-subscription/components/wizards/WizardStepReview.tsx +16 -5
  49. package/dist/BlockNoteEditor-WN73IHXR.mjs.map +0 -1
  50. package/dist/BlockNoteEditor-XXH3VBZ7.js.map +0 -1
  51. package/dist/chunk-ZCM4JLM7.js.map +0 -1
@@ -81,7 +81,7 @@
81
81
 
82
82
 
83
83
 
84
- var _chunkZCM4JLM7js = require('../chunk-ZCM4JLM7.js');
84
+ var _chunk4UFMLTL2js = require('../chunk-4UFMLTL2.js');
85
85
 
86
86
 
87
87
  var _chunkKRQRJA4Jjs = require('../chunk-KRQRJA4J.js');
@@ -159,43 +159,43 @@ function SubscriptionSummaryCard({
159
159
  onManageClick
160
160
  }) {
161
161
  const t = _nextintl.useTranslations.call(void 0, );
162
- const fmt = _chunkZCM4JLM7js.useBillingFormatOptions.call(void 0, );
162
+ const fmt = _chunk4UFMLTL2js.useBillingFormatOptions.call(void 0, );
163
163
  if (loading) {
164
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Card, { children: [
165
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
166
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardTitle, { children: t("billing.ui.subscriptions.title") }),
164
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Card, { children: [
165
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
166
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardTitle, { children: t("billing.ui.subscriptions.title") }),
167
167
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
168
168
  ] }),
169
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardContent, { children: [
170
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Skeleton, { className: "h-6 w-32 mb-2" }),
171
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Skeleton, { className: "h-4 w-24 mb-1" }),
172
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Skeleton, { className: "h-4 w-40" })
169
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardContent, { children: [
170
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Skeleton, { className: "h-6 w-32 mb-2" }),
171
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Skeleton, { className: "h-4 w-24 mb-1" }),
172
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Skeleton, { className: "h-4 w-40" })
173
173
  ] })
174
174
  ] });
175
175
  }
176
176
  if (error) {
177
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Card, { children: [
178
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
179
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardTitle, { children: t("billing.ui.subscriptions.title") }),
177
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Card, { children: [
178
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
179
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardTitle, { children: t("billing.ui.subscriptions.title") }),
180
180
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
181
181
  ] }),
182
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
182
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
183
183
  ] });
184
184
  }
185
185
  const activeSubscriptions = subscriptions.filter(
186
186
  (sub) => sub.status === "active" /* ACTIVE */ || sub.status === "trialing" /* TRIALING */ || sub.status === "past_due" /* PAST_DUE */
187
187
  );
188
188
  const primarySubscription = activeSubscriptions[0];
189
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
190
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
191
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardTitle, { children: t("billing.ui.subscriptions.title") }),
189
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
190
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
191
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardTitle, { children: t("billing.ui.subscriptions.title") }),
192
192
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-4 w-4 text-muted-foreground" })
193
193
  ] }),
194
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardContent, { children: !primarySubscription ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
194
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardContent, { children: !primarySubscription ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
195
195
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: t("billing.ui.cards.subscriptions.empty_title") }),
196
196
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: t("billing.ui.cards.subscriptions.empty_description") }),
197
197
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
198
- _chunkZCM4JLM7js.Button,
198
+ _chunk4UFMLTL2js.Button,
199
199
  {
200
200
  variant: "outline",
201
201
  size: "sm",
@@ -213,8 +213,8 @@ function SubscriptionSummaryCard({
213
213
  ] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
214
214
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
215
215
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: formatPlanName(primarySubscription, t("billing.ui.cards.subscriptions.fallback_name")) }),
216
- primarySubscription.status === "past_due" /* PAST_DUE */ ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: "softRed", children: t("billing.ui.cards.subscriptions.payment_failing") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
217
- _chunkZCM4JLM7js.Badge,
216
+ primarySubscription.status === "past_due" /* PAST_DUE */ ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Badge, { variant: "softRed", children: t("billing.ui.cards.subscriptions.payment_failing") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
217
+ _chunk4UFMLTL2js.Badge,
218
218
  {
219
219
  variant: primarySubscription.cancelAtPeriodEnd ? "secondary" : getStatusBadgeVariant(primarySubscription.status),
220
220
  children: primarySubscription.cancelAtPeriodEnd ? t("billing.ui.cards.subscriptions.canceling") : SUBSCRIPTION_STATUSES.includes(primarySubscription.status) ? t(`billing.ui.subscription_status.${primarySubscription.status}`) : primarySubscription.status
@@ -222,11 +222,11 @@ function SubscriptionSummaryCard({
222
222
  )
223
223
  ] }),
224
224
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: !_optionalChain([primarySubscription, 'access', _8 => _8.price, 'optionalAccess', _9 => _9.isTrial]) ? t("billing.ui.cards.subscriptions.ends_on", {
225
- date: _chunkZCM4JLM7js.formatDate.call(void 0, primarySubscription.currentPeriodEnd, fmt)
225
+ date: _chunk4UFMLTL2js.formatDate.call(void 0, primarySubscription.currentPeriodEnd, fmt)
226
226
  }) : primarySubscription.cancelAtPeriodEnd ? t("billing.ui.cards.subscriptions.cancels_on", {
227
- date: _chunkZCM4JLM7js.formatDate.call(void 0, primarySubscription.currentPeriodEnd, fmt)
227
+ date: _chunk4UFMLTL2js.formatDate.call(void 0, primarySubscription.currentPeriodEnd, fmt)
228
228
  }) : t("billing.ui.cards.subscriptions.renews_on", {
229
- date: _chunkZCM4JLM7js.formatDate.call(void 0, primarySubscription.currentPeriodEnd, fmt)
229
+ date: _chunk4UFMLTL2js.formatDate.call(void 0, primarySubscription.currentPeriodEnd, fmt)
230
230
  }) }),
231
231
  activeSubscriptions.length > 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: t("billing.ui.cards.subscriptions.more", { count: activeSubscriptions.length - 1 }) })
232
232
  ] }) })
@@ -260,37 +260,37 @@ function PaymentMethodSummaryCard({
260
260
  }) {
261
261
  const t = _nextintl.useTranslations.call(void 0, );
262
262
  if (loading) {
263
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Card, { children: [
264
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
265
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardTitle, { children: t("billing.ui.payment_method.title") }),
263
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Card, { children: [
264
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
265
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardTitle, { children: t("billing.ui.payment_method.title") }),
266
266
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
267
267
  ] }),
268
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardContent, { children: [
269
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Skeleton, { className: "h-6 w-32 mb-2" }),
270
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Skeleton, { className: "h-4 w-24" })
268
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardContent, { children: [
269
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Skeleton, { className: "h-6 w-32 mb-2" }),
270
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Skeleton, { className: "h-4 w-24" })
271
271
  ] })
272
272
  ] });
273
273
  }
274
274
  if (error) {
275
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Card, { children: [
276
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
277
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardTitle, { children: t("billing.ui.payment_method.title") }),
275
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Card, { children: [
276
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
277
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardTitle, { children: t("billing.ui.payment_method.title") }),
278
278
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
279
279
  ] }),
280
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
280
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
281
281
  ] });
282
282
  }
283
283
  const defaultMethod = paymentMethods.find((pm) => pm.id === defaultPaymentMethodId) || paymentMethods[0];
284
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
285
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
286
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardTitle, { children: t("billing.ui.payment_method.title") }),
284
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
285
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
286
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardTitle, { children: t("billing.ui.payment_method.title") }),
287
287
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-4 w-4 text-muted-foreground" })
288
288
  ] }),
289
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardContent, { children: paymentMethods.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
289
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardContent, { children: paymentMethods.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
290
290
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: t("billing.ui.cards.payment_method.empty_title") }),
291
291
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: t("billing.ui.cards.payment_method.empty_description") }),
292
292
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
293
- _chunkZCM4JLM7js.Button,
293
+ _chunk4UFMLTL2js.Button,
294
294
  {
295
295
  variant: "outline",
296
296
  size: "sm",
@@ -354,45 +354,45 @@ function CustomerInfoCard({ customer, loading, error }) {
354
354
  }
355
355
  }, "handlePortalClick");
356
356
  if (loading) {
357
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Card, { children: [
358
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
359
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardTitle, { children: t("billing.ui.cards.customer.title") }),
357
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Card, { children: [
358
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
359
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardTitle, { children: t("billing.ui.cards.customer.title") }),
360
360
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
361
361
  ] }),
362
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardContent, { children: [
363
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Skeleton, { className: "h-6 w-32 mb-2" }),
364
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Skeleton, { className: "h-4 w-48 mb-1" }),
365
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Skeleton, { className: "h-4 w-24" })
362
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardContent, { children: [
363
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Skeleton, { className: "h-6 w-32 mb-2" }),
364
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Skeleton, { className: "h-4 w-48 mb-1" }),
365
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Skeleton, { className: "h-4 w-24" })
366
366
  ] })
367
367
  ] });
368
368
  }
369
369
  if (error) {
370
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Card, { children: [
371
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
372
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardTitle, { children: t("billing.ui.cards.customer.title") }),
370
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Card, { children: [
371
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
372
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardTitle, { children: t("billing.ui.cards.customer.title") }),
373
373
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
374
374
  ] }),
375
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
375
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
376
376
  ] });
377
377
  }
378
378
  if (!customer) {
379
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Card, { children: [
380
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
381
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardTitle, { children: t("billing.ui.cards.customer.title") }),
379
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Card, { children: [
380
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
381
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardTitle, { children: t("billing.ui.cards.customer.title") }),
382
382
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
383
383
  ] }),
384
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardContent, { children: [
384
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardContent, { children: [
385
385
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: t("billing.ui.cards.customer.not_set_up") }),
386
386
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: t("billing.ui.cards.customer.not_set_up_description") })
387
387
  ] })
388
388
  ] });
389
389
  }
390
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Card, { children: [
391
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
392
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardTitle, { children: t("billing.ui.cards.customer.title") }),
390
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Card, { children: [
391
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
392
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardTitle, { children: t("billing.ui.cards.customer.title") }),
393
393
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.User, { className: "h-4 w-4 text-muted-foreground" })
394
394
  ] }),
395
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
395
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
396
396
  customer.name && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: customer.name }),
397
397
  customer.email && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: customer.email }),
398
398
  customer.balance !== void 0 && customer.balance !== 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-sm", children: [
@@ -402,7 +402,7 @@ function CustomerInfoCard({ customer, loading, error }) {
402
402
  ] }),
403
403
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: customer.balance < 0 ? "text-success" : "text-destructive", children: formatBalance(customer.balance, customer.currency, locale) })
404
404
  ] }),
405
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Button, { variant: "outline", size: "sm", className: "mt-2", onClick: handlePortalClick, disabled: portalLoading, children: [
405
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Button, { variant: "outline", size: "sm", className: "mt-2", onClick: handlePortalClick, disabled: portalLoading, children: [
406
406
  portalLoading ? t("common.loading") : t("billing.ui.cards.customer.manage_portal"),
407
407
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "h-4 w-4 ms-1" })
408
408
  ] })
@@ -440,46 +440,46 @@ function formatAmount(amount, currency, locale) {
440
440
  _chunk7QVYU63Ejs.__name.call(void 0, formatAmount, "formatAmount");
441
441
  function InvoicesSummaryCard({ invoices, loading, error, onViewAllClick }) {
442
442
  const t = _nextintl.useTranslations.call(void 0, );
443
- const fmt = _chunkZCM4JLM7js.useBillingFormatOptions.call(void 0, );
443
+ const fmt = _chunk4UFMLTL2js.useBillingFormatOptions.call(void 0, );
444
444
  if (loading) {
445
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Card, { children: [
446
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
447
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardTitle, { children: t("billing.ui.cards.invoices.title") }),
445
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Card, { children: [
446
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
447
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardTitle, { children: t("billing.ui.cards.invoices.title") }),
448
448
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
449
449
  ] }),
450
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardContent, { children: [
451
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Skeleton, { className: "h-6 w-24 mb-2" }),
452
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Skeleton, { className: "h-4 w-32 mb-1" }),
453
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Skeleton, { className: "h-4 w-20" })
450
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardContent, { children: [
451
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Skeleton, { className: "h-6 w-24 mb-2" }),
452
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Skeleton, { className: "h-4 w-32 mb-1" }),
453
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Skeleton, { className: "h-4 w-20" })
454
454
  ] })
455
455
  ] });
456
456
  }
457
457
  if (error) {
458
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Card, { children: [
459
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
460
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardTitle, { children: t("billing.ui.cards.invoices.title") }),
458
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Card, { children: [
459
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
460
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardTitle, { children: t("billing.ui.cards.invoices.title") }),
461
461
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
462
462
  ] }),
463
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
463
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
464
464
  ] });
465
465
  }
466
466
  const latestInvoice = _nullishCoalesce(invoices.find((inv) => inv.status !== "void" /* VOID */), () => ( invoices[0]));
467
467
  const paidInvoices = invoices.filter((inv) => inv.status === "paid" /* PAID */);
468
468
  const openInvoices = invoices.filter((inv) => inv.status === "open" /* OPEN */);
469
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewAllClick, children: [
470
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
471
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardTitle, { children: t("billing.ui.cards.invoices.title") }),
469
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewAllClick, children: [
470
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
471
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardTitle, { children: t("billing.ui.cards.invoices.title") }),
472
472
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ReceiptIcon, { className: "h-4 w-4 text-muted-foreground" })
473
473
  ] }),
474
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardContent, { children: invoices.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
474
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardContent, { children: invoices.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
475
475
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: t("billing.ui.invoices.empty_title") }),
476
476
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: t("billing.ui.cards.invoices.empty_description") })
477
477
  ] }) : latestInvoice ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
478
478
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
479
479
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold", children: formatAmount(latestInvoice.total, latestInvoice.currency, fmt.locale) }),
480
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: getStatusBadgeVariant2(latestInvoice.status), children: INVOICE_STATUSES.includes(latestInvoice.status) ? t(`billing.ui.invoice_status.${latestInvoice.status}`) : latestInvoice.status })
480
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Badge, { variant: getStatusBadgeVariant2(latestInvoice.status), children: INVOICE_STATUSES.includes(latestInvoice.status) ? t(`billing.ui.invoice_status.${latestInvoice.status}`) : latestInvoice.status })
481
481
  ] }),
482
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: latestInvoice.stripeInvoiceNumber || t("billing.ui.cards.invoices.invoice_from", { date: _chunkZCM4JLM7js.formatDate.call(void 0, latestInvoice.periodStart, fmt) }) }),
482
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: latestInvoice.stripeInvoiceNumber || t("billing.ui.cards.invoices.invoice_from", { date: _chunk4UFMLTL2js.formatDate.call(void 0, latestInvoice.periodStart, fmt) }) }),
483
483
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-4 text-xs text-muted-foreground", children: [
484
484
  paidInvoices.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: t("billing.ui.cards.invoices.paid_count", { count: paidInvoices.length }) }),
485
485
  openInvoices.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-warning", children: t("billing.ui.cards.invoices.open_count", { count: openInvoices.length }) }),
@@ -514,24 +514,24 @@ function BillingUsageSummaryCard({
514
514
  const t = _nextintl.useTranslations.call(void 0, );
515
515
  const locale = _chunkSQTXJPREjs.useI18nLocale.call(void 0, );
516
516
  if (loading) {
517
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Card, { children: [
518
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
519
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardTitle, { children: t("billing.ui.cards.usage.title") }),
517
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Card, { children: [
518
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
519
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardTitle, { children: t("billing.ui.cards.usage.title") }),
520
520
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
521
521
  ] }),
522
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardContent, { children: [
523
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Skeleton, { className: "h-6 w-24 mb-2" }),
524
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Skeleton, { className: "h-4 w-32" })
522
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardContent, { children: [
523
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Skeleton, { className: "h-6 w-24 mb-2" }),
524
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Skeleton, { className: "h-4 w-32" })
525
525
  ] })
526
526
  ] });
527
527
  }
528
528
  if (error) {
529
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Card, { children: [
530
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
531
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardTitle, { children: t("billing.ui.cards.usage.title") }),
529
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Card, { children: [
530
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
531
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardTitle, { children: t("billing.ui.cards.usage.title") }),
532
532
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
533
533
  ] }),
534
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
534
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) })
535
535
  ] });
536
536
  }
537
537
  const totalUsage = Object.values(summaries).reduce((acc, summary) => {
@@ -539,12 +539,12 @@ function BillingUsageSummaryCard({
539
539
  }, 0);
540
540
  const primaryMeter = meters.find((m) => _optionalChain([summaries, 'access', _17 => _17[m.id], 'optionalAccess', _18 => _18.aggregatedValue]));
541
541
  const primarySummary = primaryMeter ? summaries[primaryMeter.id] : null;
542
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewDetailsClick, children: [
543
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
544
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardTitle, { children: t("billing.ui.cards.usage.title") }),
542
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onViewDetailsClick, children: [
543
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
544
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardTitle, { children: t("billing.ui.cards.usage.title") }),
545
545
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Activity, { className: "h-4 w-4 text-muted-foreground" })
546
546
  ] }),
547
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardContent, { children: meters.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
547
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardContent, { children: meters.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
548
548
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xl font-bold text-muted-foreground", children: t("billing.ui.cards.usage.no_meters") }),
549
549
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-muted-foreground", children: t("billing.ui.cards.usage.no_meters_description") })
550
550
  ] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
@@ -655,7 +655,7 @@ function PaymentMethodForm({
655
655
  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: t("billing.ui.payment_form.loading") }) });
656
656
  }
657
657
  if (!setupIntent && error) {
658
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Alert, { variant: "destructive", className: "bg-red-50 border-red-200", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.AlertDescription, { children: error }) });
658
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Alert, { variant: "destructive", className: "bg-red-50 border-red-200", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.AlertDescription, { children: error }) });
659
659
  }
660
660
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: handleSubmit, className: "flex flex-col gap-y-4", children: [
661
661
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rounded-md border border-gray-300 p-3", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -679,19 +679,19 @@ function PaymentMethodForm({
679
679
  ) }),
680
680
  !alwaysSetDefault && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
681
681
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
682
- _chunkZCM4JLM7js.Checkbox,
682
+ _chunk4UFMLTL2js.Checkbox,
683
683
  {
684
684
  id: "setAsDefault",
685
685
  checked: setAsDefault,
686
686
  onCheckedChange: (checked) => setSetAsDefault(!!checked)
687
687
  }
688
688
  ),
689
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Label, { htmlFor: "setAsDefault", className: "cursor-pointer font-normal", children: t("billing.ui.payment_form.set_default") })
689
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Label, { htmlFor: "setAsDefault", className: "cursor-pointer font-normal", children: t("billing.ui.payment_form.set_default") })
690
690
  ] }),
691
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Alert, { variant: "destructive", className: "bg-red-50 border-red-200", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.AlertDescription, { children: error }) }),
691
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Alert, { variant: "destructive", className: "bg-red-50 border-red-200", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.AlertDescription, { children: error }) }),
692
692
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-x-2", children: [
693
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { type: "button", variant: "outline", onClick: onCancel, disabled: isSubmitting || isLoading, children: t("ui.buttons.cancel") }),
694
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { type: "submit", disabled: !stripe || isSubmitting || isLoading, children: isSubmitting ? t("billing.ui.wizard.review.processing") : t("billing.ui.cards.payment_method.add_card") })
693
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { type: "button", variant: "outline", onClick: onCancel, disabled: isSubmitting || isLoading, children: t("ui.buttons.cancel") }),
694
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { type: "submit", disabled: !stripe || isSubmitting || isLoading, children: isSubmitting ? t("billing.ui.wizard.review.processing") : t("billing.ui.cards.payment_method.add_card") })
695
695
  ] })
696
696
  ] });
697
697
  }
@@ -708,10 +708,10 @@ function PaymentMethodEditor({ open, onOpenChange, onSuccess }) {
708
708
  const handleCancel = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
709
709
  onOpenChange(false);
710
710
  }, "handleCancel");
711
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.DialogContent, { className: "max-w-md", children: [
712
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.DialogHeader, { children: [
713
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DialogTitle, { children: t("billing.ui.payment_methods.add") }),
714
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DialogDescription, { children: t("billing.ui.payment_methods.add_description") })
711
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.DialogContent, { className: "max-w-md", children: [
712
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.DialogHeader, { children: [
713
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.DialogTitle, { children: t("billing.ui.payment_methods.add") }),
714
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.DialogDescription, { children: t("billing.ui.payment_methods.add_description") })
715
715
  ] }),
716
716
  open && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodForm, { onSuccess: handleSuccess, onCancel: handleCancel })
717
717
  ] }) });
@@ -774,16 +774,16 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
774
774
  }
775
775
  }, "handleRemove");
776
776
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
777
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Card, { className: "relative", children: [
778
- isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: "softGreen", className: "absolute end-2 top-2", children: t("billing.ui.payment_methods.default") }),
779
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardHeader, { className: "flex flex-row items-center justify-between pb-2", children: [
777
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Card, { className: "relative", children: [
778
+ isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Badge, { variant: "softGreen", className: "absolute end-2 top-2", children: t("billing.ui.payment_methods.default") }),
779
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardHeader, { className: "flex flex-row items-center justify-between pb-2", children: [
780
780
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
781
781
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-2xl", children: brandIcon }),
782
782
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium capitalize", children: brand })
783
783
  ] }),
784
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.DropdownMenu, { children: [
785
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DropdownMenuTrigger, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
786
- _chunkZCM4JLM7js.Button,
784
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.DropdownMenu, { children: [
785
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.DropdownMenuTrigger, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
786
+ _chunk4UFMLTL2js.Button,
787
787
  {
788
788
  render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {}),
789
789
  nativeButton: false,
@@ -794,10 +794,10 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
794
794
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.MoreVertical, { className: "h-4 w-4" })
795
795
  }
796
796
  ) }),
797
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.DropdownMenuContent, { align: "end", children: [
798
- !isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DropdownMenuItem, { onClick: handleSetDefault, disabled: loading, children: t("billing.ui.payment_methods.set_default") }),
797
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.DropdownMenuContent, { align: "end", children: [
798
+ !isDefault && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.DropdownMenuItem, { onClick: handleSetDefault, disabled: loading, children: t("billing.ui.payment_methods.set_default") }),
799
799
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
800
- _chunkZCM4JLM7js.DropdownMenuItem,
800
+ _chunk4UFMLTL2js.DropdownMenuItem,
801
801
  {
802
802
  onClick: () => setShowRemoveDialog(true),
803
803
  disabled: loading,
@@ -808,7 +808,7 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
808
808
  ] })
809
809
  ] })
810
810
  ] }),
811
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-1", children: [
811
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-1", children: [
812
812
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-lg font-semibold", children: [
813
813
  "\u2022\u2022\u2022\u2022 ",
814
814
  last4
@@ -816,17 +816,17 @@ function PaymentMethodCard({ paymentMethod, onUpdate }) {
816
816
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: t("billing.ui.payment_method.expires", { date: `${String(expMonth).padStart(2, "0")}/${expYear}` }) })
817
817
  ] }) })
818
818
  ] }),
819
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.AlertDialog, { open: showRemoveDialog, onOpenChange: setShowRemoveDialog, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.AlertDialogContent, { children: [
820
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.AlertDialogHeader, { children: [
821
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.AlertDialogTitle, { children: t("billing.ui.payment_methods.remove_title") }),
822
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.AlertDialogDescription, { children: [
819
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.AlertDialog, { open: showRemoveDialog, onOpenChange: setShowRemoveDialog, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.AlertDialogContent, { children: [
820
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.AlertDialogHeader, { children: [
821
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.AlertDialogTitle, { children: t("billing.ui.payment_methods.remove_title") }),
822
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.AlertDialogDescription, { children: [
823
823
  t("billing.ui.payment_methods.remove_description"),
824
824
  isDefault && ` ${t("billing.ui.payment_methods.remove_default_warning")}`
825
825
  ] })
826
826
  ] }),
827
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.AlertDialogFooter, { children: [
828
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.AlertDialogCancel, { disabled: loading, children: t("ui.buttons.cancel") }),
829
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.AlertDialogAction, { onClick: handleRemove, disabled: loading, className: "bg-red-600 hover:bg-red-700", children: loading ? t("billing.ui.payment_methods.removing") : t("ui.buttons.remove") })
827
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.AlertDialogFooter, { children: [
828
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.AlertDialogCancel, { disabled: loading, children: t("ui.buttons.cancel") }),
829
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.AlertDialogAction, { onClick: handleRemove, disabled: loading, className: "bg-red-600 hover:bg-red-700", children: loading ? t("billing.ui.payment_methods.removing") : t("ui.buttons.remove") })
830
830
  ] })
831
831
  ] }) })
832
832
  ] });
@@ -870,14 +870,14 @@ function PaymentMethodsContainer() {
870
870
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8" }),
871
871
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: t("billing.ui.payment_methods.title") })
872
872
  ] }),
873
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { onClick: () => setShowAddPaymentMethod(true), children: t("billing.ui.payment_methods.add") })
873
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { onClick: () => setShowAddPaymentMethod(true), children: t("billing.ui.payment_methods.add") })
874
874
  ] }),
875
875
  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: [
876
876
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-16 w-16 text-muted-foreground" }),
877
877
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
878
878
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "mb-2 text-sm font-medium", children: t("billing.ui.payment_methods.empty_title") }),
879
879
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "mb-4 text-muted-foreground", children: t("billing.ui.payment_methods.empty_description") }),
880
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { onClick: () => setShowAddPaymentMethod(true), children: t("billing.ui.payment_methods.add_first") })
880
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { onClick: () => setShowAddPaymentMethod(true), children: t("billing.ui.payment_methods.add_first") })
881
881
  ] })
882
882
  ] }),
883
883
  paymentMethods.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodsList, { paymentMethods, onUpdate: loadPaymentMethods }),
@@ -933,7 +933,7 @@ var statusConfig = {
933
933
  function InvoiceStatusBadge({ status }) {
934
934
  const t = _nextintl.useTranslations.call(void 0, );
935
935
  const config = statusConfig[status] || statusConfig["draft" /* DRAFT */];
936
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: config.variant, children: t(config.label) });
936
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Badge, { variant: config.variant, children: t(config.label) });
937
937
  }
938
938
  _chunk7QVYU63Ejs.__name.call(void 0, InvoiceStatusBadge, "InvoiceStatusBadge");
939
939
 
@@ -946,7 +946,7 @@ function InvoiceDetails({
946
946
  onInvoiceChange: _onInvoiceChange
947
947
  }) {
948
948
  const t = _nextintl.useTranslations.call(void 0, );
949
- const fmt = _chunkZCM4JLM7js.useBillingFormatOptions.call(void 0, );
949
+ const fmt = _chunk4UFMLTL2js.useBillingFormatOptions.call(void 0, );
950
950
  const handleDownloadPDF = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
951
951
  if (invoice.stripePdfUrl) {
952
952
  window.open(invoice.stripePdfUrl, "_blank");
@@ -966,10 +966,10 @@ function InvoiceDetails({
966
966
  return invoice.stripeInvoiceId.slice(-8);
967
967
  }, "getInvoiceNumber");
968
968
  const productName = _optionalChain([invoice, 'access', _29 => _29.subscription, 'optionalAccess', _30 => _30.price, 'optionalAccess', _31 => _31.product, 'optionalAccess', _32 => _32.name]) || t("billing.ui.cards.subscriptions.fallback_name");
969
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.DialogContent, { className: "max-w-2xl", children: [
970
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.DialogHeader, { children: [
971
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DialogTitle, { children: t("billing.ui.invoice.title", { number: getInvoiceNumber() }) }),
972
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DialogDescription, { children: _chunkZCM4JLM7js.formatDate.call(void 0, invoice.periodStart, fmt) })
969
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.DialogContent, { className: "max-w-2xl", children: [
970
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.DialogHeader, { children: [
971
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.DialogTitle, { children: t("billing.ui.invoice.title", { number: getInvoiceNumber() }) }),
972
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.DialogDescription, { children: _chunk4UFMLTL2js.formatDate.call(void 0, invoice.periodStart, fmt) })
973
973
  ] }),
974
974
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
975
975
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-3", children: [
@@ -980,18 +980,18 @@ function InvoiceDetails({
980
980
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
981
981
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.ui.invoice.billing_period") }),
982
982
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-sm", children: [
983
- _chunkZCM4JLM7js.formatDate.call(void 0, invoice.periodStart, fmt),
983
+ _chunk4UFMLTL2js.formatDate.call(void 0, invoice.periodStart, fmt),
984
984
  " - ",
985
- _chunkZCM4JLM7js.formatDate.call(void 0, invoice.periodEnd, fmt)
985
+ _chunk4UFMLTL2js.formatDate.call(void 0, invoice.periodEnd, fmt)
986
986
  ] })
987
987
  ] }),
988
988
  invoice.dueDate && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
989
989
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.ui.invoice.due_date") }),
990
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm", children: _chunkZCM4JLM7js.formatDate.call(void 0, invoice.dueDate, fmt) })
990
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm", children: _chunk4UFMLTL2js.formatDate.call(void 0, invoice.dueDate, fmt) })
991
991
  ] }),
992
992
  invoice.paidAt && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
993
993
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.ui.invoice.paid_date") }),
994
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm", children: _chunkZCM4JLM7js.formatDate.call(void 0, invoice.paidAt, fmt) })
994
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm", children: _chunk4UFMLTL2js.formatDate.call(void 0, invoice.paidAt, fmt) })
995
995
  ] }),
996
996
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
997
997
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.ui.invoice.attempt_count") }),
@@ -1034,15 +1034,15 @@ function InvoiceDetails({
1034
1034
  ] })
1035
1035
  ] }),
1036
1036
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap gap-2 pt-4 border-t", children: [
1037
- invoice.stripePdfUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Button, { variant: "outline", onClick: handleDownloadPDF, children: [
1037
+ invoice.stripePdfUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Button, { variant: "outline", onClick: handleDownloadPDF, children: [
1038
1038
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Download, { className: "me-2 h-4 w-4" }),
1039
1039
  t("billing.ui.invoice.download_pdf")
1040
1040
  ] }),
1041
- invoice.status === "open" /* OPEN */ && invoice.attempted && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Button, { variant: "default", onClick: handleRetryPayment, children: [
1041
+ invoice.status === "open" /* OPEN */ && invoice.attempted && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Button, { variant: "default", onClick: handleRetryPayment, children: [
1042
1042
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RefreshCw, { className: "me-2 h-4 w-4" }),
1043
1043
  t("billing.ui.invoice.retry_payment")
1044
1044
  ] }),
1045
- invoice.stripeHostedInvoiceUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Button, { variant: "outline", onClick: handleViewInStripe, children: [
1045
+ invoice.stripeHostedInvoiceUrl && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Button, { variant: "outline", onClick: handleViewInStripe, children: [
1046
1046
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { className: "me-2 h-4 w-4" }),
1047
1047
  t("billing.ui.invoice.view_in_stripe")
1048
1048
  ] })
@@ -1056,7 +1056,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, InvoiceDetails, "InvoiceDetails");
1056
1056
 
1057
1057
  function InvoicesList({ invoices, onInvoicesChange }) {
1058
1058
  const t = _nextintl.useTranslations.call(void 0, );
1059
- const fmt = _chunkZCM4JLM7js.useBillingFormatOptions.call(void 0, );
1059
+ const fmt = _chunk4UFMLTL2js.useBillingFormatOptions.call(void 0, );
1060
1060
  const [selectedInvoice, setSelectedInvoice] = _react.useState.call(void 0, null);
1061
1061
  const handleRowClick = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (invoice) => {
1062
1062
  setSelectedInvoice(invoice);
@@ -1068,30 +1068,30 @@ function InvoicesList({ invoices, onInvoicesChange }) {
1068
1068
  return invoice.stripeInvoiceId.slice(-8);
1069
1069
  }, "getInvoiceNumber");
1070
1070
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1071
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Table, { children: [
1072
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.TableRow, { children: [
1073
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableHead, { children: t("billing.ui.columns.invoice_number") }),
1074
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableHead, { children: t("billing.ui.columns.date") }),
1075
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableHead, { children: t("billing.ui.columns.status") }),
1076
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableHead, { className: "text-end", children: t("billing.ui.columns.amount") }),
1077
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableHead, { children: t("billing.ui.columns.period") })
1071
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Table, { children: [
1072
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.TableRow, { children: [
1073
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableHead, { children: t("billing.ui.columns.invoice_number") }),
1074
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableHead, { children: t("billing.ui.columns.date") }),
1075
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableHead, { children: t("billing.ui.columns.status") }),
1076
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableHead, { className: "text-end", children: t("billing.ui.columns.amount") }),
1077
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableHead, { children: t("billing.ui.columns.period") })
1078
1078
  ] }) }),
1079
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableBody, { children: invoices.map((invoice) => {
1079
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableBody, { children: invoices.map((invoice) => {
1080
1080
  const invoiceNumber = getInvoiceNumber(invoice);
1081
- const date = _chunkZCM4JLM7js.formatDate.call(void 0, invoice.periodStart, fmt);
1081
+ const date = _chunk4UFMLTL2js.formatDate.call(void 0, invoice.periodStart, fmt);
1082
1082
  const amount = _chunkSQTXJPREjs.formatCurrency.call(void 0, invoice.total, invoice.currency, fmt);
1083
- const period = `${_chunkZCM4JLM7js.formatDate.call(void 0, invoice.periodStart, fmt)} - ${_chunkZCM4JLM7js.formatDate.call(void 0, invoice.periodEnd, fmt)}`;
1083
+ const period = `${_chunk4UFMLTL2js.formatDate.call(void 0, invoice.periodStart, fmt)} - ${_chunk4UFMLTL2js.formatDate.call(void 0, invoice.periodEnd, fmt)}`;
1084
1084
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1085
- _chunkZCM4JLM7js.TableRow,
1085
+ _chunk4UFMLTL2js.TableRow,
1086
1086
  {
1087
1087
  onClick: () => handleRowClick(invoice),
1088
1088
  className: "cursor-pointer hover:bg-muted/50",
1089
1089
  children: [
1090
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableCell, { className: "font-medium", children: invoiceNumber }),
1091
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableCell, { className: "text-muted-foreground text-xs", children: date }),
1092
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableCell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InvoiceStatusBadge, { status: invoice.status }) }),
1093
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableCell, { className: "text-end font-medium", children: amount }),
1094
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableCell, { className: "text-muted-foreground text-xs", children: period })
1090
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableCell, { className: "font-medium", children: invoiceNumber }),
1091
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableCell, { className: "text-muted-foreground text-xs", children: date }),
1092
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableCell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InvoiceStatusBadge, { status: invoice.status }) }),
1093
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableCell, { className: "text-end font-medium", children: amount }),
1094
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableCell, { className: "text-muted-foreground text-xs", children: period })
1095
1095
  ]
1096
1096
  },
1097
1097
  invoice.id
@@ -1141,12 +1141,12 @@ function InvoicesContainer() {
1141
1141
  setStatusFilter(value);
1142
1142
  }, "handleFilterChange");
1143
1143
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-4", children: [
1144
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Tabs, { value: statusFilter, onValueChange: handleFilterChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.TabsList, { children: [
1145
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TabsTrigger, { value: "all", children: t("billing.ui.invoices.filter_all") }),
1146
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TabsTrigger, { value: "paid" /* PAID */, children: t("billing.ui.invoice_status.paid") }),
1147
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TabsTrigger, { value: "open" /* OPEN */, children: t("billing.ui.invoice_status.open") }),
1148
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TabsTrigger, { value: "void" /* VOID */, children: t("billing.ui.invoice_status.void") }),
1149
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TabsTrigger, { value: "uncollectible" /* UNCOLLECTIBLE */, children: t("billing.ui.invoice_status.uncollectible") })
1144
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Tabs, { value: statusFilter, onValueChange: handleFilterChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.TabsList, { children: [
1145
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TabsTrigger, { value: "all", children: t("billing.ui.invoices.filter_all") }),
1146
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TabsTrigger, { value: "paid" /* PAID */, children: t("billing.ui.invoice_status.paid") }),
1147
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TabsTrigger, { value: "open" /* OPEN */, children: t("billing.ui.invoice_status.open") }),
1148
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TabsTrigger, { value: "void" /* VOID */, children: t("billing.ui.invoice_status.void") }),
1149
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TabsTrigger, { value: "uncollectible" /* UNCOLLECTIBLE */, children: t("billing.ui.invoice_status.uncollectible") })
1150
1150
  ] }) }),
1151
1151
  loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-center py-8 text-muted-foreground", children: t("billing.ui.invoices.loading") }),
1152
1152
  !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: [
@@ -1188,7 +1188,7 @@ function CancelSubscriptionDialog({
1188
1188
  onSuccess
1189
1189
  }) {
1190
1190
  const t = _nextintl.useTranslations.call(void 0, );
1191
- const fmt = _chunkZCM4JLM7js.useBillingFormatOptions.call(void 0, );
1191
+ const fmt = _chunk4UFMLTL2js.useBillingFormatOptions.call(void 0, );
1192
1192
  const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
1193
1193
  const form = _reacthookform.useForm.call(void 0, {
1194
1194
  resolver: _zod.zodResolver.call(void 0, formSchema),
@@ -1211,16 +1211,16 @@ function CancelSubscriptionDialog({
1211
1211
  setIsSubmitting(false);
1212
1212
  }
1213
1213
  }, "onSubmit");
1214
- const periodEndDate = _chunkZCM4JLM7js.formatDate.call(void 0, subscription.currentPeriodEnd, fmt);
1215
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.DialogContent, { className: "max-w-md", children: [
1216
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.DialogHeader, { children: [
1217
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DialogTitle, { children: t("billing.ui.subscription.cancel.title") }),
1218
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DialogDescription, { children: t("billing.ui.subscription.cancel.description") })
1214
+ const periodEndDate = _chunk4UFMLTL2js.formatDate.call(void 0, subscription.currentPeriodEnd, fmt);
1215
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.DialogContent, { className: "max-w-md", children: [
1216
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.DialogHeader, { children: [
1217
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.DialogTitle, { children: t("billing.ui.subscription.cancel.title") }),
1218
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.DialogDescription, { children: t("billing.ui.subscription.cancel.description") })
1219
1219
  ] }),
1220
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-col gap-y-4", children: [
1220
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-col gap-y-4", children: [
1221
1221
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-primary/10 border-primary/30 text-foreground rounded-lg border p-3 text-sm", children: t("billing.ui.subscription.cancel.remains_active", { date: periodEndDate }) }),
1222
1222
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1223
- _chunkZCM4JLM7js.FormTextarea,
1223
+ _chunk4UFMLTL2js.FormTextarea,
1224
1224
  {
1225
1225
  form,
1226
1226
  id: "reason",
@@ -1230,8 +1230,8 @@ function CancelSubscriptionDialog({
1230
1230
  }
1231
1231
  ),
1232
1232
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-x-2 justify-end pt-2", children: [
1233
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { type: "button", variant: "outline", onClick: () => onOpenChange(false), disabled: isSubmitting, children: t("billing.ui.subscription.cancel.keep") }),
1234
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { type: "submit", variant: "destructive", disabled: isSubmitting, children: isSubmitting ? t("billing.ui.subscription.cancel.canceling") : t("billing.ui.subscription.cancel.confirm") })
1233
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { type: "button", variant: "outline", onClick: () => onOpenChange(false), disabled: isSubmitting, children: t("billing.ui.subscription.cancel.keep") }),
1234
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { type: "submit", variant: "destructive", disabled: isSubmitting, children: isSubmitting ? t("billing.ui.subscription.cancel.canceling") : t("billing.ui.subscription.cancel.confirm") })
1235
1235
  ] })
1236
1236
  ] }) })
1237
1237
  ] }) });
@@ -1282,7 +1282,7 @@ var cancelingConfig = {
1282
1282
  function SubscriptionStatusBadge({ status, cancelAtPeriodEnd }) {
1283
1283
  const t = _nextintl.useTranslations.call(void 0, );
1284
1284
  const config = cancelAtPeriodEnd ? cancelingConfig : statusConfig2[status] || statusConfig2["canceled" /* CANCELED */];
1285
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: config.variant, children: t(config.label) });
1285
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Badge, { variant: config.variant, children: t(config.label) });
1286
1286
  }
1287
1287
  _chunk7QVYU63Ejs.__name.call(void 0, SubscriptionStatusBadge, "SubscriptionStatusBadge");
1288
1288
 
@@ -1321,7 +1321,7 @@ function SubscriptionDetails({
1321
1321
  renderCancelDialog
1322
1322
  }) {
1323
1323
  const t = _nextintl.useTranslations.call(void 0, );
1324
- const fmt = _chunkZCM4JLM7js.useBillingFormatOptions.call(void 0, );
1324
+ const fmt = _chunk4UFMLTL2js.useBillingFormatOptions.call(void 0, );
1325
1325
  const [showCancel, setShowCancel] = _react.useState.call(void 0, false);
1326
1326
  const handleManageViaPortal = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
1327
1327
  try {
@@ -1333,10 +1333,10 @@ function SubscriptionDetails({
1333
1333
  }, "handleManageViaPortal");
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, _chunkZCM4JLM7js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.DialogContent, { className: "max-w-2xl", children: [
1337
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.DialogHeader, { children: [
1338
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DialogTitle, { children: t("billing.ui.subscription.details_title") }),
1339
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DialogDescription, { children: t("billing.ui.subscription.details_description") })
1336
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.DialogContent, { className: "max-w-2xl", children: [
1337
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.DialogHeader, { children: [
1338
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.DialogTitle, { children: t("billing.ui.subscription.details_title") }),
1339
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.DialogDescription, { children: t("billing.ui.subscription.details_description") })
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: [
@@ -1362,22 +1362,22 @@ function SubscriptionDetails({
1362
1362
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-2", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
1363
1363
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.ui.subscription.current_period") }),
1364
1364
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "text-sm", children: [
1365
- _chunkZCM4JLM7js.formatDate.call(void 0, subscription.currentPeriodStart, fmt),
1365
+ _chunk4UFMLTL2js.formatDate.call(void 0, subscription.currentPeriodStart, fmt),
1366
1366
  " - ",
1367
- _chunkZCM4JLM7js.formatDate.call(void 0, subscription.currentPeriodEnd, fmt)
1367
+ _chunk4UFMLTL2js.formatDate.call(void 0, subscription.currentPeriodEnd, fmt)
1368
1368
  ] })
1369
1369
  ] }) }),
1370
1370
  subscription.trialEnd && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between", children: [
1371
1371
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.ui.subscription.trial_ends") }),
1372
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children: _chunkZCM4JLM7js.formatDate.call(void 0, subscription.trialEnd, fmt) })
1372
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children: _chunk4UFMLTL2js.formatDate.call(void 0, subscription.trialEnd, fmt) })
1373
1373
  ] }),
1374
1374
  subscription.cancelAtPeriodEnd && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-warning/15 border-warning/30 rounded-lg border p-3", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-warning text-xs/relaxed", children: t("billing.ui.subscription.cancel_at_period_end", {
1375
- date: _chunkZCM4JLM7js.formatDate.call(void 0, subscription.currentPeriodEnd, fmt)
1375
+ date: _chunk4UFMLTL2js.formatDate.call(void 0, subscription.currentPeriodEnd, fmt)
1376
1376
  }) }) }),
1377
1377
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap gap-2 pt-4 border-t", children: [
1378
- onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { variant: "default", onClick: () => onChangePlan(subscription), children: t("billing.ui.subscription.change_plan") }),
1379
- canCancel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { variant: "destructive", onClick: () => setShowCancel(true), children: t("ui.buttons.cancel") }),
1380
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { variant: "outline", onClick: handleManageViaPortal, children: t("billing.ui.subscription.manage_portal") })
1378
+ onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { variant: "default", onClick: () => onChangePlan(subscription), children: t("billing.ui.subscription.change_plan") }),
1379
+ canCancel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { variant: "destructive", onClick: () => setShowCancel(true), children: t("ui.buttons.cancel") }),
1380
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { variant: "outline", onClick: handleManageViaPortal, children: t("billing.ui.subscription.manage_portal") })
1381
1381
  ] })
1382
1382
  ] })
1383
1383
  ] }) }),
@@ -1437,46 +1437,46 @@ function SubscriptionsList({
1437
1437
  renderCancelDialog
1438
1438
  }) {
1439
1439
  const t = _nextintl.useTranslations.call(void 0, );
1440
- const fmt = _chunkZCM4JLM7js.useBillingFormatOptions.call(void 0, );
1440
+ const fmt = _chunk4UFMLTL2js.useBillingFormatOptions.call(void 0, );
1441
1441
  const [selectedSub, setSelectedSub] = _react.useState.call(void 0, null);
1442
1442
  const handleRowClick = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (subscription) => {
1443
1443
  setSelectedSub(subscription);
1444
1444
  }, "handleRowClick");
1445
1445
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1446
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Table, { children: [
1447
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.TableRow, { children: [
1448
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableHead, { children: t("billing.ui.columns.status") }),
1449
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableHead, { children: t("billing.ui.columns.plan") }),
1450
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableHead, { children: t("billing.ui.columns.period") }),
1451
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableHead, { className: "text-end", children: t("billing.ui.columns.amount") }),
1452
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableHead, { className: "text-end", children: t("billing.ui.columns.actions") })
1446
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border rounded-lg overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Table, { children: [
1447
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.TableRow, { children: [
1448
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableHead, { children: t("billing.ui.columns.status") }),
1449
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableHead, { children: t("billing.ui.columns.plan") }),
1450
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableHead, { children: t("billing.ui.columns.period") }),
1451
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableHead, { className: "text-end", children: t("billing.ui.columns.amount") }),
1452
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableHead, { className: "text-end", children: t("billing.ui.columns.actions") })
1453
1453
  ] }) }),
1454
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableBody, { children: subscriptions.map((subscription) => {
1454
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableBody, { children: subscriptions.map((subscription) => {
1455
1455
  const price = subscription.price;
1456
1456
  const amount = _optionalChain([price, 'optionalAccess', _42 => _42.unitAmount]) ? _chunkSQTXJPREjs.formatCurrency.call(void 0, price.unitAmount, price.currency, fmt) : "0";
1457
- const discountedAmount = price ? _chunkZCM4JLM7js.applyDiscount.call(void 0, price.unitAmount, _chunkZCM4JLM7js.subscriptionDiscount.call(void 0, subscription)) : null;
1458
- const period = `${_chunkZCM4JLM7js.formatDate.call(void 0, subscription.currentPeriodStart, fmt)} - ${_chunkZCM4JLM7js.formatDate.call(void 0, subscription.currentPeriodEnd, fmt)}`;
1457
+ const discountedAmount = price ? _chunk4UFMLTL2js.applyDiscount.call(void 0, price.unitAmount, _chunk4UFMLTL2js.subscriptionDiscount.call(void 0, subscription)) : null;
1458
+ const period = `${_chunk4UFMLTL2js.formatDate.call(void 0, subscription.currentPeriodStart, fmt)} - ${_chunk4UFMLTL2js.formatDate.call(void 0, subscription.currentPeriodEnd, fmt)}`;
1459
1459
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1460
- _chunkZCM4JLM7js.TableRow,
1460
+ _chunk4UFMLTL2js.TableRow,
1461
1461
  {
1462
1462
  onClick: () => handleRowClick(subscription),
1463
1463
  className: "cursor-pointer hover:bg-muted/50",
1464
1464
  children: [
1465
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableCell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1465
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableCell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1466
1466
  SubscriptionStatusBadge,
1467
1467
  {
1468
1468
  status: subscription.status,
1469
1469
  cancelAtPeriodEnd: subscription.cancelAtPeriodEnd
1470
1470
  }
1471
1471
  ) }),
1472
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableCell, { className: "font-medium", children: formatPlanName3(price, t) }),
1473
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableCell, { className: "text-muted-foreground text-sm", children: period }),
1474
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableCell, { className: "text-end font-medium", children: discountedAmount !== null && price ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1472
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableCell, { className: "font-medium", children: formatPlanName3(price, t) }),
1473
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableCell, { className: "text-muted-foreground text-sm", children: period }),
1474
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableCell, { className: "text-end font-medium", children: discountedAmount !== null && price ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1475
1475
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-through text-muted-foreground me-2", children: amount }),
1476
1476
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success", children: _chunkSQTXJPREjs.formatCurrency.call(void 0, discountedAmount, price.currency, fmt) })
1477
1477
  ] }) : amount }),
1478
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableCell, { className: "text-end", children: (subscription.status === "active" /* ACTIVE */ || subscription.status === "trialing" /* TRIALING */) && onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1479
- _chunkZCM4JLM7js.Button,
1478
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableCell, { className: "text-end", children: (subscription.status === "active" /* ACTIVE */ || subscription.status === "trialing" /* TRIALING */) && onChangePlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1479
+ _chunk4UFMLTL2js.Button,
1480
1480
  {
1481
1481
  size: "sm",
1482
1482
  variant: "outline",
@@ -1559,7 +1559,7 @@ function SubscriptionsContainer({
1559
1559
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CreditCard, { className: "h-8 w-8" }),
1560
1560
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: t("billing.ui.subscriptions.title") })
1561
1561
  ] }),
1562
- subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { onClick: () => _optionalChain([onOpenWizard, 'optionalCall', _44 => _44()]), children: hasActiveRecurringSubscription ? t("billing.ui.subscriptions.purchase_addons") : t("billing.ui.subscriptions.subscribe") })
1562
+ subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { onClick: () => _optionalChain([onOpenWizard, 'optionalCall', _44 => _44()]), children: hasActiveRecurringSubscription ? t("billing.ui.subscriptions.purchase_addons") : t("billing.ui.subscriptions.subscribe") })
1563
1563
  ] }),
1564
1564
  criticalSubscriptions.map((subscription) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BillingAlertBanner, { subscription }, subscription.id)),
1565
1565
  subscriptions.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center py-12 space-y-4", children: [
@@ -1567,7 +1567,7 @@ function SubscriptionsContainer({
1567
1567
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
1568
1568
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium mb-2", children: t("billing.ui.subscriptions.empty_title") }),
1569
1569
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground mb-6", children: t("billing.ui.subscriptions.empty_description") }),
1570
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { onClick: () => _optionalChain([onOpenWizard, 'optionalCall', _45 => _45()]), children: t("billing.ui.subscriptions.subscribe") })
1570
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { onClick: () => _optionalChain([onOpenWizard, 'optionalCall', _45 => _45()]), children: t("billing.ui.subscriptions.subscribe") })
1571
1571
  ] })
1572
1572
  ] }),
1573
1573
  subscriptions.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -1591,9 +1591,9 @@ function IntervalToggle({ value, onChange, hasMonthly, hasYearly }) {
1591
1591
  if (!hasMonthly || !hasYearly) {
1592
1592
  return null;
1593
1593
  }
1594
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Tabs, { value, onValueChange: (v) => onChange(v), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.TabsList, { children: [
1595
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TabsTrigger, { value: "month", children: t("billing.admin.prices.interval.month") }),
1596
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TabsTrigger, { value: "year", children: t("billing.admin.prices.interval.year") })
1594
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Tabs, { value, onValueChange: (v) => onChange(v), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.TabsList, { children: [
1595
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TabsTrigger, { value: "month", children: t("billing.admin.prices.interval.month") }),
1596
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TabsTrigger, { value: "year", children: t("billing.admin.prices.interval.year") })
1597
1597
  ] }) });
1598
1598
  }
1599
1599
  _chunk7QVYU63Ejs.__name.call(void 0, IntervalToggle, "IntervalToggle");
@@ -1611,7 +1611,7 @@ function PricingCard({
1611
1611
  onSelect
1612
1612
  }) {
1613
1613
  const t = _nextintl.useTranslations.call(void 0, );
1614
- const fmt = _chunkZCM4JLM7js.useBillingFormatOptions.call(void 0, );
1614
+ const fmt = _chunk4UFMLTL2js.useBillingFormatOptions.call(void 0, );
1615
1615
  const description = price.description || price.nickname || t("billing.ui.pricing.standard");
1616
1616
  const features = price.features || [];
1617
1617
  const formattedPrice = _chunkSQTXJPREjs.formatCurrency.call(void 0, price.unitAmount, price.currency, fmt);
@@ -1628,7 +1628,7 @@ function PricingCard({
1628
1628
  }
1629
1629
  }, "handleClick");
1630
1630
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1631
- _chunkZCM4JLM7js.Card,
1631
+ _chunk4UFMLTL2js.Card,
1632
1632
  {
1633
1633
  role: "radio",
1634
1634
  "aria-checked": isSelected,
@@ -1646,9 +1646,9 @@ function PricingCard({
1646
1646
  isLoading && "pointer-events-none"
1647
1647
  ),
1648
1648
  children: [
1649
- isCurrentPlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: "secondary", className: "absolute top-2 end-2", children: t("billing.ui.pricing.current") }),
1650
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardHeader, { className: "pb-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium", children: description }) }),
1651
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardContent, { className: "pb-4 grow", children: [
1649
+ isCurrentPlan && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Badge, { variant: "secondary", className: "absolute top-2 end-2", children: t("billing.ui.pricing.current") }),
1650
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardHeader, { className: "pb-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium", children: description }) }),
1651
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardContent, { className: "pb-4 grow", children: [
1652
1652
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mb-4", children: [
1653
1653
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-3xl font-bold", children: formattedPrice }),
1654
1654
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground ms-1", children: interval })
@@ -1658,8 +1658,8 @@ function PricingCard({
1658
1658
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm text-muted-foreground", children: feature })
1659
1659
  ] }, index)) })
1660
1660
  ] }),
1661
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardFooter, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1662
- _chunkZCM4JLM7js.Button,
1661
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardFooter, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1662
+ _chunk4UFMLTL2js.Button,
1663
1663
  {
1664
1664
  variant: isCurrentPlan ? "secondary" : isSelected ? "default" : "outline",
1665
1665
  className: "w-full",
@@ -1692,7 +1692,7 @@ function ProductPricingRow({
1692
1692
  return null;
1693
1693
  }
1694
1694
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-3", children: [
1695
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.SectionHeader, { children: product.name }),
1695
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.SectionHeader, { children: product.name }),
1696
1696
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1697
1697
  "div",
1698
1698
  {
@@ -1793,15 +1793,15 @@ function ProductPricingList({
1793
1793
  _chunk7QVYU63Ejs.__name.call(void 0, ProductPricingList, "ProductPricingList");
1794
1794
  function ProductPricingListSkeleton() {
1795
1795
  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: [
1796
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Skeleton, { className: "h-6 w-32" }),
1796
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Skeleton, { className: "h-6 w-32" }),
1797
1797
  /* @__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: [
1798
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Skeleton, { className: "h-6 w-24" }),
1799
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Skeleton, { className: "h-8 w-32" }),
1798
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Skeleton, { className: "h-6 w-24" }),
1799
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Skeleton, { className: "h-8 w-32" }),
1800
1800
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
1801
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Skeleton, { className: "h-4 w-full" }),
1802
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Skeleton, { className: "h-4 w-3/4" })
1801
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Skeleton, { className: "h-4 w-full" }),
1802
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Skeleton, { className: "h-4 w-3/4" })
1803
1803
  ] }),
1804
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Skeleton, { className: "h-10 w-full" })
1804
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Skeleton, { className: "h-10 w-full" })
1805
1805
  ] }, cardIndex)) })
1806
1806
  ] }, rowIndex)) });
1807
1807
  }
@@ -1812,7 +1812,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductPricingListSkeleton, "ProductPricing
1812
1812
 
1813
1813
  function ProrationPreview({ preview }) {
1814
1814
  const t = _nextintl.useTranslations.call(void 0, );
1815
- const fmt = _chunkZCM4JLM7js.useBillingFormatOptions.call(void 0, );
1815
+ const fmt = _chunk4UFMLTL2js.useBillingFormatOptions.call(void 0, );
1816
1816
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-primary/10 border-primary/30 rounded-lg border p-4", children: [
1817
1817
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h4", { className: "text-primary mb-3 font-semibold", children: t("billing.ui.proration.title") }),
1818
1818
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
@@ -1825,7 +1825,6 @@ function ProrationPreview({ preview }) {
1825
1825
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground", children: _chunkSQTXJPREjs.formatCurrency.call(void 0, preview.immediateCharge, preview.currency, fmt) })
1826
1826
  ] }) }),
1827
1827
  preview.lineItems.length > 0 && preview.lineItems[0].period && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-muted-foreground mt-2 text-xs", children: t("billing.ui.proration.next_invoice", {
1828
- date: _chunkZCM4JLM7js.formatDate.call(void 0, preview.lineItems[0].period.end, fmt),
1829
1828
  amount: _chunkSQTXJPREjs.formatCurrency.call(void 0, preview.amountDue, preview.currency, fmt)
1830
1829
  }) })
1831
1830
  ] })
@@ -1839,7 +1838,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProrationPreview, "ProrationPreview");
1839
1838
 
1840
1839
  function SubscriptionConfirmation({ price, isLoading, onConfirm, onCancel }) {
1841
1840
  const t = _nextintl.useTranslations.call(void 0, );
1842
- const fmt = _chunkZCM4JLM7js.useBillingFormatOptions.call(void 0, );
1841
+ const fmt = _chunk4UFMLTL2js.useBillingFormatOptions.call(void 0, );
1843
1842
  const productName = _optionalChain([price, 'access', _51 => _51.product, 'optionalAccess', _52 => _52.name]) || price.nickname || t("billing.ui.wizard.review.selected_plan");
1844
1843
  const productDescription = _optionalChain([price, 'access', _53 => _53.product, 'optionalAccess', _54 => _54.description]) || price.description;
1845
1844
  const features = price.features || [];
@@ -1859,8 +1858,8 @@ function SubscriptionConfirmation({ price, isLoading, onConfirm, onCancel }) {
1859
1858
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: feature })
1860
1859
  ] }, index)) }),
1861
1860
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-3 pt-2 border-t border-accent/30", children: [
1862
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { variant: "outline", onClick: onCancel, disabled: isLoading, children: t("ui.buttons.cancel") }),
1863
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { onClick: onConfirm, disabled: isLoading, children: isLoading ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1861
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { variant: "outline", onClick: onCancel, disabled: isLoading, children: t("ui.buttons.cancel") }),
1862
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { onClick: onConfirm, disabled: isLoading, children: isLoading ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1864
1863
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-4 w-4 animate-spin me-2" }),
1865
1864
  t("billing.ui.wizard.review.processing")
1866
1865
  ] }) : t("billing.ui.confirmation.subscribe") })
@@ -2398,7 +2397,7 @@ function WizardStepPlanSelection({
2398
2397
  onSelectPrice: handleSelectPrice
2399
2398
  }
2400
2399
  ),
2401
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex justify-end pt-4 border-t", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { onClick: onNext, disabled: !selectedPrice || isProcessing, children: isProcessing ? t("common.loading") : t("billing.ui.wizard.next_review") }) })
2400
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex justify-end pt-4 border-t", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { onClick: onNext, disabled: !selectedPrice || isProcessing, children: isProcessing ? t("common.loading") : t("billing.ui.wizard.next_review") }) })
2402
2401
  ] });
2403
2402
  }
2404
2403
  _chunk7QVYU63Ejs.__name.call(void 0, WizardStepPlanSelection, "WizardStepPlanSelection");
@@ -2468,7 +2467,7 @@ function PromoCodeInput({
2468
2467
  const codeInput = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
2469
2468
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-2", children: [
2470
2469
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2471
- _chunkZCM4JLM7js.Input,
2470
+ _chunk4UFMLTL2js.Input,
2472
2471
  {
2473
2472
  placeholder: t("billing.ui.promo_code.placeholder"),
2474
2473
  value: code,
@@ -2478,7 +2477,7 @@ function PromoCodeInput({
2478
2477
  className: "flex-1"
2479
2478
  }
2480
2479
  ),
2481
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { variant: "outline", onClick: handleApply, disabled: disabled || isValidating || !code.trim(), children: isValidating ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-4 w-4 animate-spin" }) : t("billing.ui.promo_code.apply") })
2480
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { variant: "outline", onClick: handleApply, disabled: disabled || isValidating || !code.trim(), children: isValidating ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-4 w-4 animate-spin" }) : t("billing.ui.promo_code.apply") })
2482
2481
  ] }),
2483
2482
  error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error })
2484
2483
  ] });
@@ -2507,7 +2506,7 @@ function PromoCodeInput({
2507
2506
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success text-sm", children: formatDiscount(appliedCode) })
2508
2507
  ] }),
2509
2508
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2510
- _chunkZCM4JLM7js.Button,
2509
+ _chunk4UFMLTL2js.Button,
2511
2510
  {
2512
2511
  variant: "ghost",
2513
2512
  size: "sm",
@@ -2555,7 +2554,7 @@ function WizardStepReview({
2555
2554
  isTrialUpgrade
2556
2555
  }) {
2557
2556
  const t = _nextintl.useTranslations.call(void 0, );
2558
- const fmt = _chunkZCM4JLM7js.useBillingFormatOptions.call(void 0, );
2557
+ const fmt = _chunk4UFMLTL2js.useBillingFormatOptions.call(void 0, );
2559
2558
  const [card, setCard] = _react.useState.call(void 0, null);
2560
2559
  _react.useEffect.call(void 0, () => {
2561
2560
  if (!hasPaymentMethod) {
@@ -2582,11 +2581,13 @@ function WizardStepReview({
2582
2581
  const interval = _optionalChain([price, 'access', _93 => _93.recurring, 'optionalAccess', _94 => _94.interval]) || "month";
2583
2582
  return interval === "year" ? t("billing.ui.wizard.review.interval_yearly") : t("billing.ui.wizard.review.interval_monthly");
2584
2583
  }, "formatInterval");
2585
- const codeDiscount = _chunkZCM4JLM7js.promotionCodeDiscount.call(void 0, promotionCode);
2586
- const carriedDiscount = isChangingPlan && !codeDiscount ? _chunkZCM4JLM7js.subscriptionDiscount.call(void 0, subscription) : null;
2584
+ const codeDiscount = _chunk4UFMLTL2js.promotionCodeDiscount.call(void 0, promotionCode);
2585
+ const carriedDiscount = isChangingPlan && !codeDiscount ? _chunk4UFMLTL2js.subscriptionDiscount.call(void 0, subscription) : null;
2587
2586
  const discount = _nullishCoalesce(codeDiscount, () => ( carriedDiscount));
2588
- const discountedPrice = _chunkZCM4JLM7js.applyDiscount.call(void 0, selectedPrice.unitAmount, discount);
2589
- const discountedImmediateCharge = _chunkZCM4JLM7js.applyDiscount.call(void 0, _optionalChain([prorationPreview, 'optionalAccess', _95 => _95.immediateCharge]), discount);
2587
+ const discountedPrice = _chunk4UFMLTL2js.applyDiscount.call(void 0, selectedPrice.unitAmount, discount);
2588
+ const discountedImmediateCharge = _chunk4UFMLTL2js.applyDiscount.call(void 0, _optionalChain([prorationPreview, 'optionalAccess', _95 => _95.immediateCharge]), discount);
2589
+ const isProrationCredit = !isTrialUpgrade && (_nullishCoalesce(_nullishCoalesce(discountedImmediateCharge, () => ( _optionalChain([prorationPreview, 'optionalAccess', _96 => _96.immediateCharge]))), () => ( 0))) < 0;
2590
+ const prorationAmount = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (amount) => isProrationCredit ? Math.abs(amount) : amount, "prorationAmount");
2590
2591
  const getDiscountDescription = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
2591
2592
  if (!discount) return null;
2592
2593
  if (discount.discountType === "percent_off") {
@@ -2599,17 +2600,17 @@ function WizardStepReview({
2599
2600
  const discountDescription = getDiscountDescription();
2600
2601
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
2601
2602
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-muted/50 rounded-lg p-4 space-y-3", children: [
2602
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.SectionHeader, { children: t("billing.ui.wizard.review.selected_plan") }),
2603
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.SectionHeader, { children: t("billing.ui.wizard.review.selected_plan") }),
2603
2604
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between items-center", children: [
2604
2605
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
2605
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-medium", children: _optionalChain([selectedPrice, 'access', _96 => _96.product, 'optionalAccess', _97 => _97.name]) }),
2606
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-medium", children: _optionalChain([selectedPrice, 'access', _97 => _97.product, 'optionalAccess', _98 => _98.name]) }),
2606
2607
  selectedPrice.nickname && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: selectedPrice.nickname })
2607
2608
  ] }),
2608
2609
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-end", children: [
2609
2610
  discountedPrice !== null ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
2610
2611
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground line-through", children: _chunkSQTXJPREjs.formatCurrency.call(void 0, selectedPrice.unitAmount || 0, selectedPrice.currency, fmt) }),
2611
2612
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-success text-lg font-semibold", children: _chunkSQTXJPREjs.formatCurrency.call(void 0, discountedPrice, selectedPrice.currency, fmt) }),
2612
- discountDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: "softGreen", children: discountDescription }),
2613
+ discountDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Badge, { variant: "softGreen", children: discountDescription }),
2613
2614
  carriedDiscount && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: t("billing.ui.wizard.review.discount_carries_over") })
2614
2615
  ] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-semibold text-lg", children: _chunkSQTXJPREjs.formatCurrency.call(void 0, selectedPrice.unitAmount || 0, selectedPrice.currency, fmt) }),
2615
2616
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: formatInterval2(selectedPrice) })
@@ -2622,13 +2623,13 @@ function WizardStepReview({
2622
2623
  className: `${isTrialUpgrade ? "bg-warning/15 border-warning/30" : "bg-primary/10 border-primary/30"} space-y-2 rounded-lg border p-4`,
2623
2624
  children: [
2624
2625
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h4", { className: `font-medium ${isTrialUpgrade ? "text-warning" : "text-primary"}`, children: isTrialUpgrade ? t("billing.ui.wizard.review.trial_upgrade") : t("billing.ui.wizard.review.proration_summary") }),
2625
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: `text-sm ${isTrialUpgrade ? "text-warning" : "text-foreground"}`, children: isTrialUpgrade ? discountedImmediateCharge !== null ? t("billing.ui.wizard.review.trial_upgrade_description_discounted") : t("billing.ui.wizard.review.trial_upgrade_description") : t("billing.ui.wizard.review.proration_description") }),
2626
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: `text-sm ${isTrialUpgrade ? "text-warning" : "text-foreground"}`, children: isTrialUpgrade ? discountedImmediateCharge !== null ? t("billing.ui.wizard.review.trial_upgrade_description_discounted") : t("billing.ui.wizard.review.trial_upgrade_description") : isProrationCredit ? t("billing.ui.wizard.review.proration_credit_description") : t("billing.ui.wizard.review.proration_description") }),
2626
2627
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between text-sm", children: [
2627
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `${isTrialUpgrade ? "text-warning" : "text-muted-foreground"}`, children: isTrialUpgrade ? t("billing.ui.wizard.review.charge_now") : t("billing.ui.wizard.review.due_now") }),
2628
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `${isTrialUpgrade ? "text-warning" : "text-muted-foreground"}`, children: isTrialUpgrade ? t("billing.ui.wizard.review.charge_now") : isProrationCredit ? t("billing.ui.wizard.review.credit_now") : t("billing.ui.wizard.review.due_now") }),
2628
2629
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `font-medium ${isTrialUpgrade ? "text-warning" : "text-foreground"}`, children: discountedImmediateCharge !== null ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
2629
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-through text-muted-foreground me-2", children: _chunkSQTXJPREjs.formatCurrency.call(void 0, prorationPreview.immediateCharge, prorationPreview.currency, fmt) }),
2630
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success", children: _chunkSQTXJPREjs.formatCurrency.call(void 0, discountedImmediateCharge, prorationPreview.currency, fmt) })
2631
- ] }) : _chunkSQTXJPREjs.formatCurrency.call(void 0, prorationPreview.immediateCharge, prorationPreview.currency, fmt) })
2630
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-through text-muted-foreground me-2", children: _chunkSQTXJPREjs.formatCurrency.call(void 0, prorationAmount(prorationPreview.immediateCharge), prorationPreview.currency, fmt) }),
2631
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success", children: _chunkSQTXJPREjs.formatCurrency.call(void 0, prorationAmount(discountedImmediateCharge), prorationPreview.currency, fmt) })
2632
+ ] }) : _chunkSQTXJPREjs.formatCurrency.call(void 0, prorationAmount(prorationPreview.immediateCharge), prorationPreview.currency, fmt) })
2632
2633
  ] })
2633
2634
  ]
2634
2635
  }
@@ -2652,15 +2653,15 @@ function WizardStepReview({
2652
2653
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h4", { className: "font-medium", children: t("billing.ui.payment_method.title") }),
2653
2654
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: hasPaymentMethod ? card ? t("billing.ui.wizard.review.card_on_file", { brand: card.brand, last4: card.last4 }) : t("billing.ui.wizard.review.payment_on_file") : t("billing.ui.wizard.review.no_payment_on_file") })
2654
2655
  ] }),
2655
- hasPaymentMethod ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { variant: "outline", onClick: onAddPaymentMethod, disabled: isProcessing, children: t("billing.ui.wizard.review.use_another_card") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { variant: "outline", onClick: onAddPaymentMethod, children: t("billing.ui.payment_methods.add") })
2656
+ hasPaymentMethod ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { variant: "outline", onClick: onAddPaymentMethod, disabled: isProcessing, children: t("billing.ui.wizard.review.use_another_card") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { variant: "outline", onClick: onAddPaymentMethod, children: t("billing.ui.payment_methods.add") })
2656
2657
  ] }) }),
2657
- error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Alert, { variant: "destructive", children: [
2658
+ error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Alert, { variant: "destructive", children: [
2658
2659
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.AlertCircle, { className: "h-4 w-4" }),
2659
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.AlertDescription, { children: error })
2660
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.AlertDescription, { children: error })
2660
2661
  ] }),
2661
2662
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between pt-4 border-t", children: [
2662
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { variant: "outline", onClick: onBack, disabled: isProcessing, children: t("billing.ui.wizard.back") }),
2663
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { onClick: hasPaymentMethod ? onConfirm : onAddPaymentMethod, disabled: isProcessing, children: isProcessing ? t("billing.ui.wizard.review.processing") : hasPaymentMethod ? isChangingPlan ? t("billing.ui.wizard.review.confirm_change") : t("billing.ui.wizard.review.subscribe_now") : t("billing.ui.payment_methods.add") })
2663
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { variant: "outline", onClick: onBack, disabled: isProcessing, children: t("billing.ui.wizard.back") }),
2664
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { onClick: hasPaymentMethod ? onConfirm : onAddPaymentMethod, disabled: isProcessing, children: isProcessing ? t("billing.ui.wizard.review.processing") : hasPaymentMethod ? isChangingPlan ? t("billing.ui.wizard.review.confirm_change") : t("billing.ui.wizard.review.subscribe_now") : t("billing.ui.payment_methods.add") })
2664
2665
  ] })
2665
2666
  ] });
2666
2667
  }
@@ -2673,7 +2674,7 @@ function WizardStepPaymentMethod({ onBack, onSuccess, isProcessing }) {
2673
2674
  const t = _nextintl.useTranslations.call(void 0, );
2674
2675
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6", children: [
2675
2676
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-center", children: [
2676
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.SectionHeader, { children: t("billing.ui.payment_methods.add") }),
2677
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.SectionHeader, { children: t("billing.ui.payment_methods.add") }),
2677
2678
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm text-muted-foreground", children: t("billing.ui.wizard.payment_description") })
2678
2679
  ] }),
2679
2680
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMethodForm, { onSuccess, onCancel: onBack, isLoading: isProcessing, alwaysSetDefault: true })
@@ -2716,10 +2717,10 @@ function SubscriptionWizard({
2716
2717
  const isChangePlanMode = !!subscription;
2717
2718
  const dialogTitle = subscription ? t("billing.ui.wizard.change_title") : isPurchasingAddons ? t("billing.ui.subscriptions.purchase_addons") : t("billing.ui.subscriptions.subscribe");
2718
2719
  const dialogDescription = subscription ? t("billing.ui.wizard.change_description") : isPurchasingAddons ? t("billing.ui.wizard.addons_description") : t("billing.ui.wizard.subscribe_description");
2719
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.DialogContent, { className: "max-w-2xl max-h-[90vh] overflow-y-auto", children: [
2720
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.DialogHeader, { children: [
2721
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DialogTitle, { children: dialogTitle }),
2722
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DialogDescription, { children: dialogDescription })
2720
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.DialogContent, { className: "max-w-2xl max-h-[90vh] overflow-y-auto", children: [
2721
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.DialogHeader, { children: [
2722
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.DialogTitle, { children: dialogTitle }),
2723
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.DialogDescription, { children: dialogDescription })
2723
2724
  ] }),
2724
2725
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WizardProgressIndicator, { currentStep: state.step }),
2725
2726
  state.step === "plan-selection" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -2727,7 +2728,7 @@ function SubscriptionWizard({
2727
2728
  {
2728
2729
  selectedPrice: state.selectedPrice,
2729
2730
  selectedInterval: state.selectedInterval,
2730
- currentPriceId: _optionalChain([subscription, 'optionalAccess', _98 => _98.price, 'optionalAccess', _99 => _99.id]),
2731
+ currentPriceId: _optionalChain([subscription, 'optionalAccess', _99 => _99.price, 'optionalAccess', _100 => _100.id]),
2731
2732
  hideRecurringPrices: isPurchasingAddons,
2732
2733
  hideOneTimePrices: isChangePlanMode,
2733
2734
  onSelectPrice: actions.selectPrice,
@@ -2798,23 +2799,23 @@ function formatDate2(date, { locale, t }) {
2798
2799
  _chunk7QVYU63Ejs.__name.call(void 0, formatDate2, "formatDate");
2799
2800
  function UsageSummaryCard({ meter, summary }) {
2800
2801
  const t = _nextintl.useTranslations.call(void 0, );
2801
- const fmt = _chunkZCM4JLM7js.useBillingFormatOptions.call(void 0, );
2802
- const currentUsage = _nullishCoalesce(_optionalChain([summary, 'optionalAccess', _100 => _100.aggregatedValue]), () => ( 0));
2802
+ const fmt = _chunk4UFMLTL2js.useBillingFormatOptions.call(void 0, );
2803
+ const currentUsage = _nullishCoalesce(_optionalChain([summary, 'optionalAccess', _101 => _101.aggregatedValue]), () => ( 0));
2803
2804
  const limit = meter.limit;
2804
2805
  const percentage = limit && limit > 0 ? currentUsage / limit * 100 : null;
2805
2806
  const progressColor = getProgressColor(percentage);
2806
2807
  const progressWidth = percentage !== null ? Math.min(percentage, 100) : 0;
2807
2808
  const displayName = meter.displayName || meter.eventName;
2808
2809
  const hasLimit = limit !== null && limit !== void 0;
2809
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Card, { children: [
2810
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardHeader, { className: "flex flex-row items-center gap-x-3 pb-3", children: [
2810
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Card, { children: [
2811
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardHeader, { className: "flex flex-row items-center gap-x-3 pb-3", children: [
2811
2812
  /* @__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" }) }),
2812
2813
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
2813
2814
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-medium", children: displayName }),
2814
2815
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-xs", children: meter.id })
2815
2816
  ] })
2816
2817
  ] }),
2817
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardContent, { className: "flex flex-col gap-y-4", children: [
2818
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardContent, { className: "flex flex-col gap-y-4", children: [
2818
2819
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
2819
2820
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-3xl font-bold", children: currentUsage.toLocaleString(fmt.locale) }),
2820
2821
  hasLimit && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-sm", children: t("billing.ui.usage.of_limit_used", { limit: limit.toLocaleString(fmt.locale) }) })
@@ -2857,7 +2858,7 @@ function UsageContainer() {
2857
2858
  try {
2858
2859
  const fetchedSubscriptions = await _chunkSQTXJPREjs.StripeSubscriptionService.listSubscriptions();
2859
2860
  setSubscriptions(fetchedSubscriptions);
2860
- const hasMeteredSubscriptions2 = fetchedSubscriptions.some((sub) => _optionalChain([sub, 'access', _101 => _101.price, 'optionalAccess', _102 => _102.recurring, 'optionalAccess', _103 => _103.usageType]) === "metered");
2861
+ const hasMeteredSubscriptions2 = fetchedSubscriptions.some((sub) => _optionalChain([sub, 'access', _102 => _102.price, 'optionalAccess', _103 => _103.recurring, 'optionalAccess', _104 => _104.usageType]) === "metered");
2861
2862
  if (!hasMeteredSubscriptions2) {
2862
2863
  setLoading(false);
2863
2864
  return;
@@ -2888,7 +2889,7 @@ function UsageContainer() {
2888
2889
  setLoading(false);
2889
2890
  }
2890
2891
  }, "loadUsageData");
2891
- const hasMeteredSubscriptions = subscriptions.some((sub) => _optionalChain([sub, 'access', _104 => _104.price, 'optionalAccess', _105 => _105.recurring, 'optionalAccess', _106 => _106.usageType]) === "metered");
2892
+ const hasMeteredSubscriptions = subscriptions.some((sub) => _optionalChain([sub, 'access', _105 => _105.price, 'optionalAccess', _106 => _106.recurring, 'optionalAccess', _107 => _107.usageType]) === "metered");
2892
2893
  if (!loading && !hasMeteredSubscriptions) {
2893
2894
  return null;
2894
2895
  }
@@ -2933,27 +2934,27 @@ function formatDateTime(date, { locale, t }) {
2933
2934
  _chunk7QVYU63Ejs.__name.call(void 0, formatDateTime, "formatDateTime");
2934
2935
  function UsageHistoryTable({ usageRecords }) {
2935
2936
  const t = _nextintl.useTranslations.call(void 0, );
2936
- const fmt = _chunkZCM4JLM7js.useBillingFormatOptions.call(void 0, );
2937
+ const fmt = _chunk4UFMLTL2js.useBillingFormatOptions.call(void 0, );
2937
2938
  if (usageRecords.length === 0) {
2938
2939
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rounded-lg border p-8 text-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground", children: t("billing.ui.usage.history_empty") }) });
2939
2940
  }
2940
2941
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
2941
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.SectionHeader, { level: 2, children: t("billing.ui.usage.history_title") }),
2942
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-clip rounded-lg border", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Table, { children: [
2943
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.TableRow, { children: [
2944
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableHead, { children: t("billing.ui.columns.date_time") }),
2945
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableHead, { children: t("billing.ui.columns.meter_event") }),
2946
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableHead, { className: "text-end", children: t("billing.ui.columns.quantity") }),
2947
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableHead, { children: t("billing.ui.columns.event_id") })
2942
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.SectionHeader, { level: 2, children: t("billing.ui.usage.history_title") }),
2943
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-clip rounded-lg border", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Table, { children: [
2944
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableHeader, { className: "bg-muted", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.TableRow, { children: [
2945
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableHead, { children: t("billing.ui.columns.date_time") }),
2946
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableHead, { children: t("billing.ui.columns.meter_event") }),
2947
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableHead, { className: "text-end", children: t("billing.ui.columns.quantity") }),
2948
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableHead, { children: t("billing.ui.columns.event_id") })
2948
2949
  ] }) }),
2949
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableBody, { children: usageRecords.map((record) => {
2950
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableBody, { children: usageRecords.map((record) => {
2950
2951
  const dateTime = formatDateTime(record.timestamp, fmt);
2951
2952
  const quantity = record.quantity.toLocaleString(fmt.locale);
2952
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.TableRow, { children: [
2953
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableCell, { className: "font-medium", children: dateTime }),
2954
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableCell, { className: "text-muted-foreground", children: record.meterEventName }),
2955
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableCell, { className: "text-end font-medium", children: quantity }),
2956
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.TableCell, { className: "text-muted-foreground text-sm tabular-nums", children: record.stripeEventId })
2953
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.TableRow, { children: [
2954
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableCell, { className: "font-medium", children: dateTime }),
2955
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableCell, { className: "text-muted-foreground", children: record.meterEventName }),
2956
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableCell, { className: "text-end font-medium", children: quantity }),
2957
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.TableCell, { className: "text-muted-foreground text-sm tabular-nums", children: record.stripeEventId })
2957
2958
  ] }, record.id);
2958
2959
  }) })
2959
2960
  ] }) })
@@ -2964,8 +2965,8 @@ _chunk7QVYU63Ejs.__name.call(void 0, UsageHistoryTable, "UsageHistoryTable");
2964
2965
  // src/features/billing/components/modals/BillingDetailModal.tsx
2965
2966
 
2966
2967
  function BillingDetailModal({ open, onOpenChange, title, children, className }) {
2967
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.DialogContent, { className: _nullishCoalesce(className, () => ( "max-w-4xl max-h-[90vh] overflow-y-auto")), children: [
2968
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DialogHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DialogTitle, { children: title }) }),
2968
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Dialog, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.DialogContent, { className: _nullishCoalesce(className, () => ( "max-w-4xl max-h-[90vh] overflow-y-auto")), children: [
2969
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.DialogHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.DialogTitle, { children: title }) }),
2969
2970
  children
2970
2971
  ] }) });
2971
2972
  }
@@ -2993,7 +2994,7 @@ function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }) {
2993
2994
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-destructive text-sm font-medium", children: t("billing.ui.alert.payment_failed_title") }),
2994
2995
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive mt-1 text-sm", children: t("billing.ui.alert.payment_failed_description") })
2995
2996
  ] }),
2996
- onUpdatePayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { variant: "outline", size: "sm", onClick: onUpdatePayment, className: "text-destructive border-red-300", children: t("billing.ui.alert.update_payment_method") })
2997
+ onUpdatePayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { variant: "outline", size: "sm", onClick: onUpdatePayment, className: "text-destructive border-red-300", children: t("billing.ui.alert.update_payment_method") })
2997
2998
  ] });
2998
2999
  }
2999
3000
  if (subscription.status === "trialing" /* TRIALING */ && subscription.trialEnd) {
@@ -3007,7 +3008,7 @@ function BillingAlertBanner({ subscription, onUpdatePayment, onAddPayment }) {
3007
3008
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-warning text-sm font-medium", children: t("billing.ui.alert.trial_ending_title") }),
3008
3009
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-warning mt-1 text-sm", children: t("billing.ui.alert.trial_ending_description", { count: daysRemaining }) })
3009
3010
  ] }),
3010
- onAddPayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { variant: "outline", size: "sm", onClick: onAddPayment, className: "text-warning border-yellow-300", children: t("billing.ui.payment_methods.add") })
3011
+ onAddPayment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { variant: "outline", size: "sm", onClick: onAddPayment, className: "text-warning border-yellow-300", children: t("billing.ui.payment_methods.add") })
3011
3012
  ] });
3012
3013
  }
3013
3014
  }
@@ -3049,11 +3050,11 @@ function BillingDashboardContainer({ renderCancelDialog } = {}) {
3049
3050
  const [editingSubscription, setEditingSubscription] = _react.useState.call(void 0, null);
3050
3051
  const [pendingChangePlan, setPendingChangePlan] = _react.useState.call(void 0, false);
3051
3052
  const hasMeteredSubscriptions = _react.useCallback.call(void 0, () => {
3052
- return data.subscriptions.some((sub) => _optionalChain([sub, 'access', _107 => _107.price, 'optionalAccess', _108 => _108.recurring, 'optionalAccess', _109 => _109.usageType]) === "metered");
3053
+ return data.subscriptions.some((sub) => _optionalChain([sub, 'access', _108 => _108.price, 'optionalAccess', _109 => _109.recurring, 'optionalAccess', _110 => _110.usageType]) === "metered");
3053
3054
  }, [data.subscriptions]);
3054
3055
  const hasActiveRecurringSubscription = _react.useMemo.call(void 0, () => {
3055
3056
  return data.subscriptions.some(
3056
- (sub) => (sub.status === "active" /* ACTIVE */ || sub.status === "trialing" /* TRIALING */) && _optionalChain([sub, 'access', _110 => _110.price, 'optionalAccess', _111 => _111.priceType]) === "recurring"
3057
+ (sub) => (sub.status === "active" /* ACTIVE */ || sub.status === "trialing" /* TRIALING */) && _optionalChain([sub, 'access', _111 => _111.price, 'optionalAccess', _112 => _112.priceType]) === "recurring"
3057
3058
  );
3058
3059
  }, [data.subscriptions]);
3059
3060
  const fetchAllData = _react.useCallback.call(void 0, async () => {
@@ -3066,7 +3067,7 @@ function BillingDashboardContainer({ renderCancelDialog } = {}) {
3066
3067
  setNoCustomerExists(false);
3067
3068
  } catch (error) {
3068
3069
  console.error("[BillingDashboard] Failed to load customer:", error);
3069
- if (_optionalChain([error, 'optionalAccess', _112 => _112.status]) === 404) {
3070
+ if (_optionalChain([error, 'optionalAccess', _113 => _113.status]) === 404) {
3070
3071
  setNoCustomerExists(true);
3071
3072
  } else {
3072
3073
  setErrors((prev) => ({ ...prev, customer: "billing.ui.dashboard.errors.load_customer" }));
@@ -3124,7 +3125,7 @@ function BillingDashboardContainer({ renderCancelDialog } = {}) {
3124
3125
  }, "fetchInvoices");
3125
3126
  const [subscriptions] = await Promise.all([fetchSubscriptions(), fetchPaymentMethods(), fetchInvoices()]);
3126
3127
  const hasMetered = subscriptions.some(
3127
- (sub) => _optionalChain([sub, 'access', _113 => _113.price, 'optionalAccess', _114 => _114.recurring, 'optionalAccess', _115 => _115.usageType]) === "metered"
3128
+ (sub) => _optionalChain([sub, 'access', _114 => _114.price, 'optionalAccess', _115 => _115.recurring, 'optionalAccess', _116 => _116.usageType]) === "metered"
3128
3129
  );
3129
3130
  if (hasMetered) {
3130
3131
  await fetchUsageData();
@@ -3248,18 +3249,18 @@ function BillingDashboardContainer({ renderCancelDialog } = {}) {
3248
3249
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Wallet, { className: "h-8 w-8" }),
3249
3250
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "text-primary text-3xl font-semibold", children: t("billing.title") })
3250
3251
  ] }),
3251
- isInitialLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.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" }) }) }),
3252
- noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Card, { children: [
3253
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.CardHeader, { className: "text-center", children: [
3252
+ isInitialLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.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" }) }) }),
3253
+ noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Card, { children: [
3254
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.CardHeader, { className: "text-center", children: [
3254
3255
  /* @__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" }) }),
3255
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardTitle, { children: t("billing.ui.dashboard.setup_title") }),
3256
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardDescription, { children: t("billing.ui.dashboard.setup_description") })
3256
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardTitle, { children: t("billing.ui.dashboard.setup_title") }),
3257
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardDescription, { children: t("billing.ui.dashboard.setup_description") })
3257
3258
  ] }),
3258
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardContent, { className: "flex justify-center pb-8", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Button, { onClick: handleCreateCustomer, disabled: creatingCustomer, size: "lg", children: creatingCustomer ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
3259
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardContent, { className: "flex justify-center pb-8", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Button, { onClick: handleCreateCustomer, disabled: creatingCustomer, size: "lg", children: creatingCustomer ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
3259
3260
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "me-2 h-4 w-4 animate-spin" }),
3260
3261
  t("billing.ui.dashboard.setting_up")
3261
3262
  ] }) : t("billing.ui.dashboard.setup_button") }) }),
3262
- errors.customer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CardContent, { className: "pt-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-center text-destructive text-xs/relaxed", children: t(errors.customer) }) })
3263
+ errors.customer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CardContent, { className: "pt-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-center text-destructive text-xs/relaxed", children: t(errors.customer) }) })
3263
3264
  ] }),
3264
3265
  !noCustomerExists && !isInitialLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
3265
3266
  criticalSubscriptions.map((subscription) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -3291,7 +3292,7 @@ function BillingDashboardContainer({ renderCancelDialog } = {}) {
3291
3292
  PaymentMethodSummaryCard,
3292
3293
  {
3293
3294
  paymentMethods: data.paymentMethods,
3294
- defaultPaymentMethodId: _optionalChain([data, 'access', _116 => _116.customer, 'optionalAccess', _117 => _117.defaultPaymentMethodId]),
3295
+ defaultPaymentMethodId: _optionalChain([data, 'access', _117 => _117.customer, 'optionalAccess', _118 => _118.defaultPaymentMethodId]),
3295
3296
  loading: loading.paymentMethods,
3296
3297
  error: errors.paymentMethods ? t(errors.paymentMethods) : void 0,
3297
3298
  onManageClick: () => setActiveModal("payment-methods")
@@ -3395,7 +3396,7 @@ function getStripePromise(publishableKey) {
3395
3396
  if (!publishableKey) {
3396
3397
  return Promise.resolve(null);
3397
3398
  }
3398
- if (_optionalChain([stripePromiseCache, 'optionalAccess', _118 => _118.key]) === publishableKey) {
3399
+ if (_optionalChain([stripePromiseCache, 'optionalAccess', _119 => _119.key]) === publishableKey) {
3399
3400
  return stripePromiseCache.promise;
3400
3401
  }
3401
3402
  const promise = _stripejs.loadStripe.call(void 0, publishableKey);
@@ -3429,18 +3430,18 @@ _chunk7QVYU63Ejs.__name.call(void 0, isStripeConfigured, "isStripeConfigured");
3429
3430
 
3430
3431
  function PriceArchiver({ price }) {
3431
3432
  const t = _nextintl.useTranslations.call(void 0, );
3432
- const fmt = _chunkZCM4JLM7js.useBillingFormatOptions.call(void 0, );
3433
+ const fmt = _chunk4UFMLTL2js.useBillingFormatOptions.call(void 0, );
3433
3434
  const { archivePrice, restorePrice } = usePriceContext();
3434
3435
  const [open, setOpen] = _react.useState.call(void 0, false);
3435
3436
  const isArchived = !price.active;
3436
3437
  const scope = isArchived ? "restore" : "archive";
3437
3438
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
3438
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Button, { variant: "outline", size: "sm", onClick: () => setOpen(true), children: [
3439
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Button, { variant: "outline", size: "sm", onClick: () => setOpen(true), children: [
3439
3440
  isArchived ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RotateCcwIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ArchiveIcon, {}),
3440
3441
  t(`billing.admin.prices.${scope}.confirm`)
3441
3442
  ] }),
3442
3443
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3443
- _chunkZCM4JLM7js.ConfirmDialog,
3444
+ _chunk4UFMLTL2js.ConfirmDialog,
3444
3445
  {
3445
3446
  open,
3446
3447
  onOpenChange: setOpen,
@@ -3454,7 +3455,7 @@ function PriceArchiver({ price }) {
3454
3455
  if (isArchived) await restorePrice(price.id);
3455
3456
  else await archivePrice(price.id);
3456
3457
  } catch (error) {
3457
- _chunkZCM4JLM7js.errorToast.call(void 0, { title: t(`billing.admin.prices.${scope}.title`), error });
3458
+ _chunk4UFMLTL2js.errorToast.call(void 0, { title: t(`billing.admin.prices.${scope}.title`), error });
3458
3459
  throw error;
3459
3460
  }
3460
3461
  }
@@ -3486,12 +3487,12 @@ function PriceEditorInternal({
3486
3487
  onDialogOpenChange
3487
3488
  }) {
3488
3489
  const t = _nextintl.useTranslations.call(void 0, );
3489
- const fmt = _chunkZCM4JLM7js.useBillingFormatOptions.call(void 0, );
3490
+ const fmt = _chunk4UFMLTL2js.useBillingFormatOptions.call(void 0, );
3490
3491
  const router = _chunkSQTXJPREjs.useI18nRouter.call(void 0, );
3491
3492
  const { createPrice, updatePrice, productId: contextProductId } = usePriceContext();
3492
3493
  const [allFeatures, setAllFeatures] = _react.useState.call(void 0, []);
3493
3494
  const isEdit = !!price;
3494
- const targetProductId = _nullishCoalesce(_nullishCoalesce(productId, () => ( _optionalChain([price, 'optionalAccess', _119 => _119.product, 'optionalAccess', _120 => _120.id]))), () => ( contextProductId));
3495
+ const targetProductId = _nullishCoalesce(_nullishCoalesce(productId, () => ( _optionalChain([price, 'optionalAccess', _120 => _120.product, 'optionalAccess', _121 => _121.id]))), () => ( contextProductId));
3495
3496
  _react.useEffect.call(void 0, () => {
3496
3497
  const fetchFeatures = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
3497
3498
  setAllFeatures(await _chunkSQTXJPREjs.FeatureService.findMany({}));
@@ -3570,22 +3571,22 @@ function PriceEditorInternal({
3570
3571
  // `.toString()`, for the same reason the schema keeps the token
3571
3572
  // pipeline string-based: a seeded `0` must survive as "0" and not be
3572
3573
  // dropped as falsy.
3573
- token: _nullishCoalesce(_optionalChain([seed, 'access', _121 => _121.token, 'optionalAccess', _122 => _122.toString, 'call', _123 => _123()]), () => ( "")),
3574
+ token: _nullishCoalesce(_optionalChain([seed, 'access', _122 => _122.token, 'optionalAccess', _123 => _123.toString, 'call', _124 => _124()]), () => ( "")),
3574
3575
  featureIds: [.../* @__PURE__ */ new Set([...resolvePlatformFeatures(seed.platformFeatures).ids, ...coreFeatureIds])]
3575
3576
  };
3576
3577
  }
3577
3578
  return {
3578
- unitAmount: _optionalChain([price, 'optionalAccess', _124 => _124.unitAmount]) ? price.unitAmount / 100 : 0,
3579
- currency: _nullishCoalesce(_optionalChain([price, 'optionalAccess', _125 => _125.currency]), () => ( "usd")),
3580
- interval: _optionalChain([price, 'optionalAccess', _126 => _126.priceType]) === "one_time" ? "one_time" : _nullishCoalesce(_optionalChain([price, 'optionalAccess', _127 => _127.recurring, 'optionalAccess', _128 => _128.interval]), () => ( "month")),
3581
- intervalCount: _nullishCoalesce(_optionalChain([price, 'optionalAccess', _129 => _129.recurring, 'optionalAccess', _130 => _130.intervalCount]), () => ( 1)),
3582
- usageType: _nullishCoalesce(_optionalChain([price, 'optionalAccess', _131 => _131.recurring, 'optionalAccess', _132 => _132.usageType]), () => ( "licensed")),
3583
- nickname: _nullishCoalesce(_optionalChain([price, 'optionalAccess', _133 => _133.nickname]), () => ( "")),
3584
- isTrial: _nullishCoalesce(_optionalChain([price, 'optionalAccess', _134 => _134.isTrial]), () => ( false)),
3585
- description: _nullishCoalesce(_optionalChain([price, 'optionalAccess', _135 => _135.description]), () => ( "")),
3586
- features: _nullishCoalesce(_optionalChain([price, 'optionalAccess', _136 => _136.features]), () => ( [])),
3587
- token: _nullishCoalesce(_optionalChain([price, 'optionalAccess', _137 => _137.token, 'optionalAccess', _138 => _138.toString, 'call', _139 => _139()]), () => ( "")),
3588
- featureIds: [.../* @__PURE__ */ new Set([..._nullishCoalesce(_optionalChain([price, 'optionalAccess', _140 => _140.priceFeatures, 'optionalAccess', _141 => _141.map, 'call', _142 => _142((f) => f.id)]), () => ( [])), ...coreFeatureIds])]
3579
+ unitAmount: _optionalChain([price, 'optionalAccess', _125 => _125.unitAmount]) ? price.unitAmount / 100 : 0,
3580
+ currency: _nullishCoalesce(_optionalChain([price, 'optionalAccess', _126 => _126.currency]), () => ( "usd")),
3581
+ interval: _optionalChain([price, 'optionalAccess', _127 => _127.priceType]) === "one_time" ? "one_time" : _nullishCoalesce(_optionalChain([price, 'optionalAccess', _128 => _128.recurring, 'optionalAccess', _129 => _129.interval]), () => ( "month")),
3582
+ intervalCount: _nullishCoalesce(_optionalChain([price, 'optionalAccess', _130 => _130.recurring, 'optionalAccess', _131 => _131.intervalCount]), () => ( 1)),
3583
+ usageType: _nullishCoalesce(_optionalChain([price, 'optionalAccess', _132 => _132.recurring, 'optionalAccess', _133 => _133.usageType]), () => ( "licensed")),
3584
+ nickname: _nullishCoalesce(_optionalChain([price, 'optionalAccess', _134 => _134.nickname]), () => ( "")),
3585
+ isTrial: _nullishCoalesce(_optionalChain([price, 'optionalAccess', _135 => _135.isTrial]), () => ( false)),
3586
+ description: _nullishCoalesce(_optionalChain([price, 'optionalAccess', _136 => _136.description]), () => ( "")),
3587
+ features: _nullishCoalesce(_optionalChain([price, 'optionalAccess', _137 => _137.features]), () => ( [])),
3588
+ token: _nullishCoalesce(_optionalChain([price, 'optionalAccess', _138 => _138.token, 'optionalAccess', _139 => _139.toString, 'call', _140 => _140()]), () => ( "")),
3589
+ featureIds: [.../* @__PURE__ */ new Set([..._nullishCoalesce(_optionalChain([price, 'optionalAccess', _141 => _141.priceFeatures, 'optionalAccess', _142 => _142.map, 'call', _143 => _143((f) => f.id)]), () => ( [])), ...coreFeatureIds])]
3589
3590
  };
3590
3591
  }, [price, seed, allFeatures, resolvePlatformFeatures]);
3591
3592
  const form = _reacthookform.useForm.call(void 0, {
@@ -3628,7 +3629,7 @@ function PriceEditorInternal({
3628
3629
  { id: "metered", text: t("billing.admin.prices.usage.metered") }
3629
3630
  ];
3630
3631
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3631
- _chunkZCM4JLM7js.EditorSheet,
3632
+ _chunk4UFMLTL2js.EditorSheet,
3632
3633
  {
3633
3634
  form,
3634
3635
  entityType: t("billing.admin.prices.entity"),
@@ -3683,13 +3684,13 @@ function PriceEditorInternal({
3683
3684
  dialogOpen,
3684
3685
  onDialogOpenChange,
3685
3686
  children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
3686
- isEdit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Alert, { children: [
3687
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.AlertTitle, { children: t("billing.admin.prices.immutability.title") }),
3688
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.AlertDescription, { children: t("billing.admin.prices.immutability.description") })
3687
+ isEdit && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Alert, { children: [
3688
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.AlertTitle, { children: t("billing.admin.prices.immutability.title") }),
3689
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.AlertDescription, { children: t("billing.admin.prices.immutability.description") })
3689
3690
  ] }),
3690
3691
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-2 gap-x-4", children: [
3691
3692
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3692
- _chunkZCM4JLM7js.FormInput,
3693
+ _chunk4UFMLTL2js.FormInput,
3693
3694
  {
3694
3695
  form,
3695
3696
  id: "unitAmount",
@@ -3701,7 +3702,7 @@ function PriceEditorInternal({
3701
3702
  }
3702
3703
  ),
3703
3704
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3704
- _chunkZCM4JLM7js.FormSelect,
3705
+ _chunk4UFMLTL2js.FormSelect,
3705
3706
  {
3706
3707
  form,
3707
3708
  id: "currency",
@@ -3712,7 +3713,7 @@ function PriceEditorInternal({
3712
3713
  )
3713
3714
  ] }),
3714
3715
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3715
- _chunkZCM4JLM7js.FormSelect,
3716
+ _chunk4UFMLTL2js.FormSelect,
3716
3717
  {
3717
3718
  form,
3718
3719
  id: "interval",
@@ -3723,7 +3724,7 @@ function PriceEditorInternal({
3723
3724
  ),
3724
3725
  isRecurring && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-2 gap-x-4", children: [
3725
3726
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3726
- _chunkZCM4JLM7js.FormInput,
3727
+ _chunk4UFMLTL2js.FormInput,
3727
3728
  {
3728
3729
  form,
3729
3730
  id: "intervalCount",
@@ -3734,7 +3735,7 @@ function PriceEditorInternal({
3734
3735
  }
3735
3736
  ),
3736
3737
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3737
- _chunkZCM4JLM7js.FormSelect,
3738
+ _chunk4UFMLTL2js.FormSelect,
3738
3739
  {
3739
3740
  form,
3740
3741
  id: "usageType",
@@ -3745,7 +3746,7 @@ function PriceEditorInternal({
3745
3746
  )
3746
3747
  ] }),
3747
3748
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3748
- _chunkZCM4JLM7js.FormInput,
3749
+ _chunk4UFMLTL2js.FormInput,
3749
3750
  {
3750
3751
  form,
3751
3752
  id: "nickname",
@@ -3754,7 +3755,7 @@ function PriceEditorInternal({
3754
3755
  }
3755
3756
  ),
3756
3757
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3757
- _chunkZCM4JLM7js.FormTextarea,
3758
+ _chunk4UFMLTL2js.FormTextarea,
3758
3759
  {
3759
3760
  form,
3760
3761
  id: "description",
@@ -3764,7 +3765,7 @@ function PriceEditorInternal({
3764
3765
  }
3765
3766
  ),
3766
3767
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3767
- _chunkZCM4JLM7js.FormInput,
3768
+ _chunk4UFMLTL2js.FormInput,
3768
3769
  {
3769
3770
  form,
3770
3771
  id: "token",
@@ -3774,10 +3775,10 @@ function PriceEditorInternal({
3774
3775
  }
3775
3776
  ),
3776
3777
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-2", children: [
3777
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.FieldLabel, { children: t("billing.admin.prices.fields.features") }),
3778
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.FieldLabel, { children: t("billing.admin.prices.fields.features") }),
3778
3779
  form.watch("features").map((_, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-2", children: [
3779
3780
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3780
- _chunkZCM4JLM7js.Input,
3781
+ _chunk4UFMLTL2js.Input,
3781
3782
  {
3782
3783
  ...form.register(`features.${index}`),
3783
3784
  placeholder: t("billing.admin.prices.placeholders.feature", { index: index + 1 }),
@@ -3785,7 +3786,7 @@ function PriceEditorInternal({
3785
3786
  }
3786
3787
  ),
3787
3788
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3788
- _chunkZCM4JLM7js.Button,
3789
+ _chunk4UFMLTL2js.Button,
3789
3790
  {
3790
3791
  type: "button",
3791
3792
  variant: "outline",
@@ -3800,7 +3801,7 @@ function PriceEditorInternal({
3800
3801
  )
3801
3802
  ] }, index)),
3802
3803
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
3803
- _chunkZCM4JLM7js.Button,
3804
+ _chunk4UFMLTL2js.Button,
3804
3805
  {
3805
3806
  type: "button",
3806
3807
  variant: "outline",
@@ -3815,12 +3816,12 @@ function PriceEditorInternal({
3815
3816
  )
3816
3817
  ] }),
3817
3818
  isRecurring && allFeatures.length > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-y-2", children: [
3818
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.FieldLabel, { children: t("billing.admin.prices.fields.platformFeatures") }),
3819
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.FieldLabel, { children: t("billing.admin.prices.fields.platformFeatures") }),
3819
3820
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex max-h-48 flex-col gap-y-2 overflow-y-auto rounded-md border p-4", children: allFeatures.map((feature) => {
3820
3821
  const isChecked = form.watch("featureIds").includes(feature.id);
3821
3822
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-x-2", children: [
3822
3823
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3823
- _chunkZCM4JLM7js.Checkbox,
3824
+ _chunk4UFMLTL2js.Checkbox,
3824
3825
  {
3825
3826
  id: `feature-${feature.id}`,
3826
3827
  checked: isChecked,
@@ -3836,13 +3837,13 @@ function PriceEditorInternal({
3836
3837
  }
3837
3838
  }
3838
3839
  ),
3839
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.FieldLabel, { htmlFor: `feature-${feature.id}`, children: feature.name }),
3840
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.FieldLabel, { htmlFor: `feature-${feature.id}`, children: feature.name }),
3840
3841
  feature.isCore && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("billing.admin.prices.help.core") })
3841
3842
  ] }, feature.id);
3842
3843
  }) })
3843
3844
  ] }),
3844
3845
  isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3845
- _chunkZCM4JLM7js.FormCheckbox,
3846
+ _chunk4UFMLTL2js.FormCheckbox,
3846
3847
  {
3847
3848
  form,
3848
3849
  id: "isTrial",
@@ -3895,19 +3896,19 @@ var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
3895
3896
  productId: productIdProp
3896
3897
  }) => {
3897
3898
  const t = _nextintl.useTranslations.call(void 0, );
3898
- const fmt = _chunkZCM4JLM7js.useBillingFormatOptions.call(void 0, );
3899
- const generateUrl = _chunkZCM4JLM7js.usePageUrlGenerator.call(void 0, );
3900
- const { hasRole } = _chunkZCM4JLM7js.useCurrentUserContext.call(void 0, );
3899
+ const fmt = _chunk4UFMLTL2js.useBillingFormatOptions.call(void 0, );
3900
+ const generateUrl = _chunk4UFMLTL2js.usePageUrlGenerator.call(void 0, );
3901
+ const { hasRole } = _chunk4UFMLTL2js.useCurrentUserContext.call(void 0, );
3901
3902
  const [price, setPrice] = _react.useState.call(void 0,
3902
3903
  dehydratedPrice ? _chunkSQTXJPREjs.rehydrate.call(void 0, _chunkSQTXJPREjs.Modules.StripePrice, dehydratedPrice) : void 0
3903
3904
  );
3904
3905
  const [priceVersion, setPriceVersion] = _react.useState.call(void 0, 0);
3905
3906
  const refreshPrices = _react.useCallback.call(void 0, () => setPriceVersion((value2) => value2 + 1), []);
3906
- const productId = _nullishCoalesce(productIdProp, () => ( _optionalChain([price, 'optionalAccess', _143 => _143.product, 'optionalAccess', _144 => _144.id])));
3907
+ const productId = _nullishCoalesce(productIdProp, () => ( _optionalChain([price, 'optionalAccess', _144 => _144.product, 'optionalAccess', _145 => _145.id])));
3907
3908
  const reloadPrice = _react.useCallback.call(void 0, async () => {
3908
- if (!_optionalChain([price, 'optionalAccess', _145 => _145.id])) return;
3909
+ if (!_optionalChain([price, 'optionalAccess', _146 => _146.id])) return;
3909
3910
  setPrice(await _chunkSQTXJPREjs.StripePriceService.getPrice({ id: price.id }));
3910
- }, [_optionalChain([price, 'optionalAccess', _146 => _146.id])]);
3911
+ }, [_optionalChain([price, 'optionalAccess', _147 => _147.id])]);
3911
3912
  const createPrice = _react.useCallback.call(void 0,
3912
3913
  async (input) => {
3913
3914
  const saved = await _chunkSQTXJPREjs.StripePriceService.createPrice(input);
@@ -3927,23 +3928,23 @@ var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
3927
3928
  );
3928
3929
  const archivePrice = _react.useCallback.call(void 0,
3929
3930
  async (id) => {
3930
- const target = _nullishCoalesce(id, () => ( _optionalChain([price, 'optionalAccess', _147 => _147.id])));
3931
+ const target = _nullishCoalesce(id, () => ( _optionalChain([price, 'optionalAccess', _148 => _148.id])));
3931
3932
  if (!target) return;
3932
3933
  await _chunkSQTXJPREjs.StripePriceService.archivePrice({ id: target });
3933
3934
  await reloadPrice();
3934
3935
  refreshPrices();
3935
3936
  },
3936
- [_optionalChain([price, 'optionalAccess', _148 => _148.id]), reloadPrice, refreshPrices]
3937
+ [_optionalChain([price, 'optionalAccess', _149 => _149.id]), reloadPrice, refreshPrices]
3937
3938
  );
3938
3939
  const restorePrice = _react.useCallback.call(void 0,
3939
3940
  async (id) => {
3940
- const target = _nullishCoalesce(id, () => ( _optionalChain([price, 'optionalAccess', _149 => _149.id])));
3941
+ const target = _nullishCoalesce(id, () => ( _optionalChain([price, 'optionalAccess', _150 => _150.id])));
3941
3942
  if (!target) return;
3942
3943
  await _chunkSQTXJPREjs.StripePriceService.reactivatePrice({ id: target });
3943
3944
  await reloadPrice();
3944
3945
  refreshPrices();
3945
3946
  },
3946
- [_optionalChain([price, 'optionalAccess', _150 => _150.id]), reloadPrice, refreshPrices]
3947
+ [_optionalChain([price, 'optionalAccess', _151 => _151.id]), reloadPrice, refreshPrices]
3947
3948
  );
3948
3949
  const value = _react.useMemo.call(void 0,
3949
3950
  () => ({
@@ -3965,7 +3966,7 @@ var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
3965
3966
  const items = [
3966
3967
  { name: t("billing.admin.products.title"), href: generateUrl({ page: _chunkSQTXJPREjs.Modules.StripeProduct }) }
3967
3968
  ];
3968
- if (_optionalChain([price, 'optionalAccess', _151 => _151.product]))
3969
+ if (_optionalChain([price, 'optionalAccess', _152 => _152.product]))
3969
3970
  items.push({
3970
3971
  name: price.product.name,
3971
3972
  href: generateUrl({ page: _chunkSQTXJPREjs.Modules.StripeProduct, id: price.product.id })
@@ -3985,7 +3986,7 @@ var PriceProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
3985
3986
  }
3986
3987
  return response;
3987
3988
  }, "title");
3988
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceContext.Provider, { value, children }) });
3989
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceContext.Provider, { value, children }) });
3989
3990
  }, "PriceProvider");
3990
3991
  var usePriceContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => _nullishCoalesce(_react.useContext.call(void 0, PriceContext), () => ( defaultContextValue)), "usePriceContext");
3991
3992
 
@@ -4005,12 +4006,12 @@ function ProductArchiver({ product }) {
4005
4006
  const isArchived = !product.active;
4006
4007
  const scope = isArchived ? "restore" : "archive";
4007
4008
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
4008
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Button, { variant: "outline", size: "sm", onClick: () => setOpen(true), children: [
4009
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Button, { variant: "outline", size: "sm", onClick: () => setOpen(true), children: [
4009
4010
  isArchived ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RotateCcwIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ArchiveIcon, {}),
4010
4011
  t(`billing.admin.products.${scope}.confirm`)
4011
4012
  ] }),
4012
4013
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4013
- _chunkZCM4JLM7js.ConfirmDialog,
4014
+ _chunk4UFMLTL2js.ConfirmDialog,
4014
4015
  {
4015
4016
  open,
4016
4017
  onOpenChange: setOpen,
@@ -4024,7 +4025,7 @@ function ProductArchiver({ product }) {
4024
4025
  if (isArchived) await restoreProduct(product.id);
4025
4026
  else await archiveProduct(product.id);
4026
4027
  } catch (error) {
4027
- _chunkZCM4JLM7js.errorToast.call(void 0, { title: t(`billing.admin.products.${scope}.title`), error });
4028
+ _chunk4UFMLTL2js.errorToast.call(void 0, { title: t(`billing.admin.products.${scope}.title`), error });
4028
4029
  throw error;
4029
4030
  }
4030
4031
  }
@@ -4066,9 +4067,9 @@ function ProductEditorInternal({
4066
4067
  );
4067
4068
  const getDefaultValues = _react.useCallback.call(void 0,
4068
4069
  () => ({
4069
- id: _nullishCoalesce(_optionalChain([product, 'optionalAccess', _152 => _152.id]), () => ( _uuid.v4.call(void 0, ))),
4070
- name: _nullishCoalesce(_optionalChain([product, 'optionalAccess', _153 => _153.name]), () => ( "")),
4071
- description: _nullishCoalesce(_optionalChain([product, 'optionalAccess', _154 => _154.description]), () => ( ""))
4070
+ id: _nullishCoalesce(_optionalChain([product, 'optionalAccess', _153 => _153.id]), () => ( _uuid.v4.call(void 0, ))),
4071
+ name: _nullishCoalesce(_optionalChain([product, 'optionalAccess', _154 => _154.name]), () => ( "")),
4072
+ description: _nullishCoalesce(_optionalChain([product, 'optionalAccess', _155 => _155.description]), () => ( ""))
4072
4073
  }),
4073
4074
  [product]
4074
4075
  );
@@ -4077,11 +4078,11 @@ function ProductEditorInternal({
4077
4078
  defaultValues: getDefaultValues()
4078
4079
  });
4079
4080
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4080
- _chunkZCM4JLM7js.EditorSheet,
4081
+ _chunk4UFMLTL2js.EditorSheet,
4081
4082
  {
4082
4083
  form,
4083
4084
  entityType: t("billing.admin.products.entity"),
4084
- entityName: _optionalChain([product, 'optionalAccess', _155 => _155.name]),
4085
+ entityName: _optionalChain([product, 'optionalAccess', _156 => _156.name]),
4085
4086
  isEdit,
4086
4087
  module: _chunkSQTXJPREjs.Modules.StripeProduct,
4087
4088
  size: "md",
@@ -4100,7 +4101,7 @@ function ProductEditorInternal({
4100
4101
  onDialogOpenChange,
4101
4102
  children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
4102
4103
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4103
- _chunkZCM4JLM7js.FormInput,
4104
+ _chunk4UFMLTL2js.FormInput,
4104
4105
  {
4105
4106
  form,
4106
4107
  id: "name",
@@ -4110,7 +4111,7 @@ function ProductEditorInternal({
4110
4111
  }
4111
4112
  ),
4112
4113
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4113
- _chunkZCM4JLM7js.FormTextarea,
4114
+ _chunk4UFMLTL2js.FormTextarea,
4114
4115
  {
4115
4116
  form,
4116
4117
  id: "description",
@@ -4154,17 +4155,17 @@ var defaultContextValue2 = {
4154
4155
  };
4155
4156
  var ProductProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ children, dehydratedProduct, publishChrome = true }) => {
4156
4157
  const t = _nextintl.useTranslations.call(void 0, );
4157
- const generateUrl = _chunkZCM4JLM7js.usePageUrlGenerator.call(void 0, );
4158
- const { hasRole } = _chunkZCM4JLM7js.useCurrentUserContext.call(void 0, );
4158
+ const generateUrl = _chunk4UFMLTL2js.usePageUrlGenerator.call(void 0, );
4159
+ const { hasRole } = _chunk4UFMLTL2js.useCurrentUserContext.call(void 0, );
4159
4160
  const [product, setProduct] = _react.useState.call(void 0,
4160
4161
  dehydratedProduct ? _chunkSQTXJPREjs.rehydrate.call(void 0, _chunkSQTXJPREjs.Modules.StripeProduct, dehydratedProduct) : void 0
4161
4162
  );
4162
4163
  const [catalogueVersion, setCatalogueVersion] = _react.useState.call(void 0, 0);
4163
4164
  const refreshCatalogue = _react.useCallback.call(void 0, () => setCatalogueVersion((value2) => value2 + 1), []);
4164
4165
  const reloadProduct = _react.useCallback.call(void 0, async () => {
4165
- if (!_optionalChain([product, 'optionalAccess', _156 => _156.id])) return;
4166
+ if (!_optionalChain([product, 'optionalAccess', _157 => _157.id])) return;
4166
4167
  setProduct(await _chunkSQTXJPREjs.StripeProductService.getProduct({ id: product.id }));
4167
- }, [_optionalChain([product, 'optionalAccess', _157 => _157.id])]);
4168
+ }, [_optionalChain([product, 'optionalAccess', _158 => _158.id])]);
4168
4169
  const createProduct = _react.useCallback.call(void 0,
4169
4170
  async (input) => {
4170
4171
  const saved = await _chunkSQTXJPREjs.StripeProductService.createProduct(input);
@@ -4184,23 +4185,23 @@ var ProductProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ ch
4184
4185
  );
4185
4186
  const archiveProduct = _react.useCallback.call(void 0,
4186
4187
  async (id) => {
4187
- const target = _nullishCoalesce(id, () => ( _optionalChain([product, 'optionalAccess', _158 => _158.id])));
4188
+ const target = _nullishCoalesce(id, () => ( _optionalChain([product, 'optionalAccess', _159 => _159.id])));
4188
4189
  if (!target) return;
4189
4190
  await _chunkSQTXJPREjs.StripeProductService.archiveProduct({ id: target });
4190
4191
  await reloadProduct();
4191
4192
  refreshCatalogue();
4192
4193
  },
4193
- [_optionalChain([product, 'optionalAccess', _159 => _159.id]), reloadProduct, refreshCatalogue]
4194
+ [_optionalChain([product, 'optionalAccess', _160 => _160.id]), reloadProduct, refreshCatalogue]
4194
4195
  );
4195
4196
  const restoreProduct = _react.useCallback.call(void 0,
4196
4197
  async (id) => {
4197
- const target = _nullishCoalesce(id, () => ( _optionalChain([product, 'optionalAccess', _160 => _160.id])));
4198
+ const target = _nullishCoalesce(id, () => ( _optionalChain([product, 'optionalAccess', _161 => _161.id])));
4198
4199
  if (!target) return;
4199
4200
  await _chunkSQTXJPREjs.StripeProductService.reactivateProduct({ id: target });
4200
4201
  await reloadProduct();
4201
4202
  refreshCatalogue();
4202
4203
  },
4203
- [_optionalChain([product, 'optionalAccess', _161 => _161.id]), reloadProduct, refreshCatalogue]
4204
+ [_optionalChain([product, 'optionalAccess', _162 => _162.id]), reloadProduct, refreshCatalogue]
4204
4205
  );
4205
4206
  const value = _react.useMemo.call(void 0,
4206
4207
  () => ({
@@ -4249,7 +4250,7 @@ var ProductProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ ch
4249
4250
  }
4250
4251
  return response;
4251
4252
  }, "title");
4252
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductContext.Provider, { value, children }) });
4253
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductContext.Provider, { value, children }) });
4253
4254
  }, "ProductProvider");
4254
4255
  var useProductContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => _nullishCoalesce(_react.useContext.call(void 0, ProductContext), () => ( defaultContextValue2)), "useProductContext");
4255
4256
 
@@ -4258,83 +4259,83 @@ var useProductContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ()
4258
4259
 
4259
4260
  function PriceDetails() {
4260
4261
  const t = _nextintl.useTranslations.call(void 0, );
4261
- const fmt = _chunkZCM4JLM7js.useBillingFormatOptions.call(void 0, );
4262
- const generateUrl = _chunkZCM4JLM7js.usePageUrlGenerator.call(void 0, );
4262
+ const fmt = _chunk4UFMLTL2js.useBillingFormatOptions.call(void 0, );
4263
+ const generateUrl = _chunk4UFMLTL2js.usePageUrlGenerator.call(void 0, );
4263
4264
  const { price } = usePriceContext();
4264
4265
  if (!price) return null;
4265
4266
  const isRecurring = price.priceType === "recurring";
4266
4267
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-8", children: [
4267
4268
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
4268
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.SectionHeader, { children: t("billing.admin.prices.title") }),
4269
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.SectionHeader, { children: t("billing.admin.prices.title") }),
4269
4270
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
4270
4271
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4271
- _chunkZCM4JLM7js.DetailField,
4272
+ _chunk4UFMLTL2js.DetailField,
4272
4273
  {
4273
4274
  label: t("billing.admin.prices.fields.product"),
4274
- value: price.product ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Link, { href: generateUrl({ page: _chunkSQTXJPREjs.Modules.StripeProduct, id: price.product.id }), children: price.product.name }) : "\u2014"
4275
+ value: price.product ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Link, { href: generateUrl({ page: _chunkSQTXJPREjs.Modules.StripeProduct, id: price.product.id }), children: price.product.name }) : "\u2014"
4275
4276
  }
4276
4277
  ),
4277
4278
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4278
- _chunkZCM4JLM7js.DetailField,
4279
+ _chunk4UFMLTL2js.DetailField,
4279
4280
  {
4280
4281
  label: t("billing.admin.prices.fields.status"),
4281
4282
  value: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex flex-wrap items-center gap-1", children: [
4282
- price.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: "softGreen", children: t("billing.admin.prices.status.active") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: "softGray", children: t("billing.admin.prices.status.archived") }),
4283
- price.isTrial && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: "softBlue", children: t("billing.admin.prices.badge.trial") })
4283
+ price.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Badge, { variant: "softGreen", children: t("billing.admin.prices.status.active") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Badge, { variant: "softGray", children: t("billing.admin.prices.status.archived") }),
4284
+ price.isTrial && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Badge, { variant: "softBlue", children: t("billing.admin.prices.badge.trial") })
4284
4285
  ] })
4285
4286
  }
4286
4287
  ),
4287
4288
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4288
- _chunkZCM4JLM7js.DetailField,
4289
+ _chunk4UFMLTL2js.DetailField,
4289
4290
  {
4290
4291
  label: t("billing.admin.prices.fields.amount"),
4291
4292
  value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _chunkSQTXJPREjs.formatCurrency.call(void 0, price.unitAmount, price.currency, fmt) })
4292
4293
  }
4293
4294
  ),
4294
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DetailField, { label: t("billing.admin.prices.fields.currency"), value: price.currency.toUpperCase() }),
4295
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.DetailField, { label: t("billing.admin.prices.fields.currency"), value: price.currency.toUpperCase() }),
4295
4296
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4296
- _chunkZCM4JLM7js.DetailField,
4297
+ _chunk4UFMLTL2js.DetailField,
4297
4298
  {
4298
4299
  label: t("billing.admin.prices.fields.type"),
4299
4300
  value: isRecurring ? t("billing.admin.prices.type.recurring") : t("billing.admin.prices.type.oneTime")
4300
4301
  }
4301
4302
  ),
4302
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DetailField, { label: t("billing.admin.prices.fields.billing"), value: _chunkSQTXJPREjs.formatInterval.call(void 0, price, fmt) }),
4303
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.DetailField, { label: t("billing.admin.prices.fields.billing"), value: _chunkSQTXJPREjs.formatInterval.call(void 0, price, fmt) }),
4303
4304
  isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4304
- _chunkZCM4JLM7js.DetailField,
4305
+ _chunk4UFMLTL2js.DetailField,
4305
4306
  {
4306
4307
  label: t("billing.admin.prices.fields.intervalCount"),
4307
- value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _nullishCoalesce(_optionalChain([price, 'access', _162 => _162.recurring, 'optionalAccess', _163 => _163.intervalCount]), () => ( 1)) })
4308
+ value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _nullishCoalesce(_optionalChain([price, 'access', _163 => _163.recurring, 'optionalAccess', _164 => _164.intervalCount]), () => ( 1)) })
4308
4309
  }
4309
4310
  ),
4310
4311
  isRecurring && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4311
- _chunkZCM4JLM7js.DetailField,
4312
+ _chunk4UFMLTL2js.DetailField,
4312
4313
  {
4313
4314
  label: t("billing.admin.prices.fields.usageType"),
4314
- value: _optionalChain([price, 'access', _164 => _164.recurring, 'optionalAccess', _165 => _165.usageType]) === "metered" ? t("billing.admin.prices.usage.metered") : t("billing.admin.prices.usage.licensed")
4315
+ value: _optionalChain([price, 'access', _165 => _165.recurring, 'optionalAccess', _166 => _166.usageType]) === "metered" ? t("billing.admin.prices.usage.metered") : t("billing.admin.prices.usage.licensed")
4315
4316
  }
4316
4317
  )
4317
4318
  ] })
4318
4319
  ] }),
4319
4320
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
4320
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.SectionHeader, { children: t("billing.admin.prices.fields.platformFeatures") }),
4321
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.SectionHeader, { children: t("billing.admin.prices.fields.platformFeatures") }),
4321
4322
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
4322
4323
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4323
- _chunkZCM4JLM7js.DetailField,
4324
+ _chunk4UFMLTL2js.DetailField,
4324
4325
  {
4325
4326
  label: t("billing.admin.prices.fields.token"),
4326
4327
  value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _nullishCoalesce(price.token, () => ( "\u2014")) })
4327
4328
  }
4328
4329
  ),
4329
4330
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4330
- _chunkZCM4JLM7js.DetailField,
4331
+ _chunk4UFMLTL2js.DetailField,
4331
4332
  {
4332
4333
  label: t("billing.admin.prices.fields.stripeId"),
4333
4334
  value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: price.stripePriceId })
4334
4335
  }
4335
4336
  ),
4336
4337
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4337
- _chunkZCM4JLM7js.DetailField,
4338
+ _chunk4UFMLTL2js.DetailField,
4338
4339
  {
4339
4340
  label: t("billing.admin.prices.fields.description"),
4340
4341
  value: _nullishCoalesce(price.description, () => ( "\u2014")),
@@ -4342,7 +4343,7 @@ function PriceDetails() {
4342
4343
  }
4343
4344
  ),
4344
4345
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4345
- _chunkZCM4JLM7js.DetailField,
4346
+ _chunk4UFMLTL2js.DetailField,
4346
4347
  {
4347
4348
  label: t("billing.admin.prices.fields.features"),
4348
4349
  className: "md:col-span-2",
@@ -4350,11 +4351,11 @@ function PriceDetails() {
4350
4351
  }
4351
4352
  ),
4352
4353
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4353
- _chunkZCM4JLM7js.DetailField,
4354
+ _chunk4UFMLTL2js.DetailField,
4354
4355
  {
4355
4356
  label: t("billing.admin.prices.fields.platformFeatures"),
4356
4357
  className: "md:col-span-2",
4357
- value: price.priceFeatures.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "flex flex-wrap items-center gap-1", children: price.priceFeatures.map((feature) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: "softGray", children: feature.name }, feature.id)) }) : "\u2014"
4358
+ value: price.priceFeatures.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "flex flex-wrap items-center gap-1", children: price.priceFeatures.map((feature) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Badge, { variant: "softGray", children: feature.name }, feature.id)) }) : "\u2014"
4358
4359
  }
4359
4360
  )
4360
4361
  ] })
@@ -4368,7 +4369,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, PriceDetails, "PriceDetails");
4368
4369
  function PriceContainer() {
4369
4370
  const { price } = usePriceContext();
4370
4371
  if (!price) return null;
4371
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.RoundPageContainer, { module: _chunkSQTXJPREjs.Modules.StripePrice, id: price.id, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceDetails, {}) });
4372
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.RoundPageContainer, { module: _chunkSQTXJPREjs.Modules.StripePrice, id: price.id, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PriceDetails, {}) });
4372
4373
  }
4373
4374
  _chunk7QVYU63Ejs.__name.call(void 0, PriceContainer, "PriceContainer");
4374
4375
 
@@ -4412,25 +4413,25 @@ function priceToSeed(price) {
4412
4413
  const priceType = readOptional(() => price.priceType);
4413
4414
  const currency = readOptional(() => price.currency);
4414
4415
  const recurring = price.recurring;
4415
- const interval = priceType === "one_time" ? "one_time" : _nullishCoalesce(_optionalChain([recurring, 'optionalAccess', _166 => _166.interval]), () => ( "month"));
4416
+ const interval = priceType === "one_time" ? "one_time" : _nullishCoalesce(_optionalChain([recurring, 'optionalAccess', _167 => _167.interval]), () => ( "month"));
4416
4417
  const seed = {
4417
4418
  unitAmount: _nullishCoalesce(price.unitAmount, () => ( 0)),
4418
4419
  currency: _nullishCoalesce(currency, () => ( "usd")),
4419
4420
  interval
4420
4421
  };
4421
4422
  if (interval !== "one_time") {
4422
- if (typeof _optionalChain([recurring, 'optionalAccess', _167 => _167.intervalCount]) === "number") seed.intervalCount = recurring.intervalCount;
4423
- if (_optionalChain([recurring, 'optionalAccess', _168 => _168.usageType])) seed.usageType = recurring.usageType;
4423
+ if (typeof _optionalChain([recurring, 'optionalAccess', _168 => _168.intervalCount]) === "number") seed.intervalCount = recurring.intervalCount;
4424
+ if (_optionalChain([recurring, 'optionalAccess', _169 => _169.usageType])) seed.usageType = recurring.usageType;
4424
4425
  }
4425
- const nickname = _optionalChain([price, 'access', _169 => _169.nickname, 'optionalAccess', _170 => _170.trim, 'call', _171 => _171()]);
4426
+ const nickname = _optionalChain([price, 'access', _170 => _170.nickname, 'optionalAccess', _171 => _171.trim, 'call', _172 => _172()]);
4426
4427
  if (nickname) seed.nickname = nickname;
4427
- const description = _optionalChain([price, 'access', _172 => _172.description, 'optionalAccess', _173 => _173.trim, 'call', _174 => _174()]);
4428
+ const description = _optionalChain([price, 'access', _173 => _173.description, 'optionalAccess', _174 => _174.trim, 'call', _175 => _175()]);
4428
4429
  if (description) seed.description = description;
4429
4430
  const features = nonEmptyStrings(price.features);
4430
4431
  if (features.length > 0) seed.features = features;
4431
4432
  if (typeof price.token === "number" && !Number.isNaN(price.token)) seed.token = price.token;
4432
4433
  if (typeof price.isTrial === "boolean") seed.isTrial = price.isTrial;
4433
- const platformFeatures = nonEmptyStrings(_optionalChain([price, 'access', _175 => _175.priceFeatures, 'optionalAccess', _176 => _176.map, 'call', _177 => _177((feature) => feature.name)]));
4434
+ const platformFeatures = nonEmptyStrings(_optionalChain([price, 'access', _176 => _176.priceFeatures, 'optionalAccess', _177 => _177.map, 'call', _178 => _178((feature) => feature.name)]));
4434
4435
  if (platformFeatures.length > 0) seed.platformFeatures = platformFeatures;
4435
4436
  return seed;
4436
4437
  }
@@ -4493,7 +4494,7 @@ function PricesList({ productId, fullWidth }) {
4493
4494
  const importInputRef = _react.useRef.call(void 0, null);
4494
4495
  const [seed, setSeed] = _react.useState.call(void 0, void 0);
4495
4496
  const [seedNonce, setSeedNonce] = _react.useState.call(void 0, 0);
4496
- const data = _chunkZCM4JLM7js.useDataListRetriever.call(void 0, {
4497
+ const data = _chunk4UFMLTL2js.useDataListRetriever.call(void 0, {
4497
4498
  retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkSQTXJPREjs.StripePriceService.listPrices({ ...params, productId }), "retriever"),
4498
4499
  retrieverParams: {},
4499
4500
  module: _chunkSQTXJPREjs.Modules.StripePrice
@@ -4523,7 +4524,7 @@ function PricesList({ productId, fullWidth }) {
4523
4524
  const onImportFileChange = _react.useCallback.call(void 0,
4524
4525
  async (event) => {
4525
4526
  const input = event.target;
4526
- const file = _optionalChain([input, 'access', _178 => _178.files, 'optionalAccess', _179 => _179[0]]);
4527
+ const file = _optionalChain([input, 'access', _179 => _179.files, 'optionalAccess', _180 => _180[0]]);
4527
4528
  input.value = "";
4528
4529
  if (!file) return;
4529
4530
  try {
@@ -4531,7 +4532,7 @@ function PricesList({ productId, fullWidth }) {
4531
4532
  openSeededEditor(transfer.price);
4532
4533
  } catch (error) {
4533
4534
  console.error("[PricesList] price import failed", error);
4534
- _chunkZCM4JLM7js.errorToast.call(void 0, {
4535
+ _chunk4UFMLTL2js.errorToast.call(void 0, {
4535
4536
  title: t("billing.admin.prices.import.errors.title"),
4536
4537
  error: t("billing.admin.prices.import.errors.invalid")
4537
4538
  });
@@ -4550,7 +4551,7 @@ function PricesList({ productId, fullWidth }) {
4550
4551
  "create-price"
4551
4552
  ),
4552
4553
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _react.Fragment, { children: [
4553
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCM4JLM7js.Button, { variant: "outline", size: "sm", type: "button", onClick: () => _optionalChain([importInputRef, 'access', _180 => _180.current, 'optionalAccess', _181 => _181.click, 'call', _182 => _182()]), children: [
4554
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4UFMLTL2js.Button, { variant: "outline", size: "sm", type: "button", onClick: () => _optionalChain([importInputRef, 'access', _181 => _181.current, 'optionalAccess', _182 => _182.click, 'call', _183 => _183()]), children: [
4554
4555
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.UploadIcon, {}),
4555
4556
  t("billing.admin.prices.actions.import")
4556
4557
  ] }),
@@ -4568,7 +4569,7 @@ function PricesList({ productId, fullWidth }) {
4568
4569
  ];
4569
4570
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
4570
4571
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4571
- _chunkZCM4JLM7js.ContentListTable,
4572
+ _chunk4UFMLTL2js.ContentListTable,
4572
4573
  {
4573
4574
  data,
4574
4575
  fields: [
@@ -4585,7 +4586,7 @@ function PricesList({ productId, fullWidth }) {
4585
4586
  fullWidth,
4586
4587
  title: t("billing.admin.prices.title"),
4587
4588
  emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4588
- _chunkZCM4JLM7js.EmptyState,
4589
+ _chunk4UFMLTL2js.EmptyState,
4589
4590
  {
4590
4591
  icon: _lucidereact.DollarSignIcon,
4591
4592
  title: t("billing.admin.prices.empty.title"),
@@ -4625,18 +4626,18 @@ function ProductDetails() {
4625
4626
  const { product } = useProductContext();
4626
4627
  if (!product) return null;
4627
4628
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
4628
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.SectionHeader, { children: t("billing.admin.products.tabs.details") }),
4629
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.SectionHeader, { children: t("billing.admin.products.tabs.details") }),
4629
4630
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
4630
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DetailField, { label: t("billing.admin.products.fields.name"), value: product.name }),
4631
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.DetailField, { label: t("billing.admin.products.fields.name"), value: product.name }),
4631
4632
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4632
- _chunkZCM4JLM7js.DetailField,
4633
+ _chunk4UFMLTL2js.DetailField,
4633
4634
  {
4634
4635
  label: t("billing.admin.products.fields.status"),
4635
- value: product.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: "softGreen", children: t("billing.admin.products.status.active") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: "softGray", children: t("billing.admin.products.status.archived") })
4636
+ value: product.active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Badge, { variant: "softGreen", children: t("billing.admin.products.status.active") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Badge, { variant: "softGray", children: t("billing.admin.products.status.archived") })
4636
4637
  }
4637
4638
  ),
4638
4639
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4639
- _chunkZCM4JLM7js.DetailField,
4640
+ _chunk4UFMLTL2js.DetailField,
4640
4641
  {
4641
4642
  label: t("billing.admin.products.fields.description"),
4642
4643
  value: _nullishCoalesce(product.description, () => ( "\u2014")),
@@ -4644,14 +4645,14 @@ function ProductDetails() {
4644
4645
  }
4645
4646
  ),
4646
4647
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4647
- _chunkZCM4JLM7js.DetailField,
4648
+ _chunk4UFMLTL2js.DetailField,
4648
4649
  {
4649
4650
  label: t("billing.admin.products.fields.prices"),
4650
4651
  value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: product.stripePrices.length })
4651
4652
  }
4652
4653
  ),
4653
4654
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4654
- _chunkZCM4JLM7js.DetailField,
4655
+ _chunk4UFMLTL2js.DetailField,
4655
4656
  {
4656
4657
  label: t("billing.admin.products.fields.stripeId"),
4657
4658
  value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: product.stripeProductId })
@@ -4669,7 +4670,7 @@ function ProductContainer() {
4669
4670
  const { product } = useProductContext();
4670
4671
  if (!product) return null;
4671
4672
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4672
- _chunkZCM4JLM7js.RoundPageContainer,
4673
+ _chunk4UFMLTL2js.RoundPageContainer,
4673
4674
  {
4674
4675
  module: _chunkSQTXJPREjs.Modules.StripeProduct,
4675
4676
  id: product.id,
@@ -4706,8 +4707,8 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductContainer, "ProductContainer");
4706
4707
 
4707
4708
  function CouponsList({ fullWidth } = {}) {
4708
4709
  const t = _nextintl.useTranslations.call(void 0, );
4709
- const { catalogueVersion } = _chunkZCM4JLM7js.useCouponContext.call(void 0, );
4710
- const data = _chunkZCM4JLM7js.useDataListRetriever.call(void 0, {
4710
+ const { catalogueVersion } = _chunk4UFMLTL2js.useCouponContext.call(void 0, );
4711
+ const data = _chunk4UFMLTL2js.useDataListRetriever.call(void 0, {
4711
4712
  retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkSQTXJPREjs.StripeCouponService.listCoupons(params), "retriever"),
4712
4713
  retrieverParams: {},
4713
4714
  module: _chunkSQTXJPREjs.Modules.StripeCoupon
@@ -4715,9 +4716,9 @@ function CouponsList({ fullWidth } = {}) {
4715
4716
  _react.useEffect.call(void 0, () => {
4716
4717
  if (catalogueVersion > 0) void data.refresh();
4717
4718
  }, [catalogueVersion]);
4718
- const functions = [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CouponEditor, {}, "create-coupon")];
4719
+ const functions = [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CouponEditor, {}, "create-coupon")];
4719
4720
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4720
- _chunkZCM4JLM7js.ContentListTable,
4721
+ _chunk4UFMLTL2js.ContentListTable,
4721
4722
  {
4722
4723
  data,
4723
4724
  fields: [
@@ -4732,7 +4733,7 @@ function CouponsList({ fullWidth } = {}) {
4732
4733
  fullWidth,
4733
4734
  title: t("billing.admin.coupons.title"),
4734
4735
  emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4735
- _chunkZCM4JLM7js.EmptyState,
4736
+ _chunk4UFMLTL2js.EmptyState,
4736
4737
  {
4737
4738
  icon: _lucidereact.TicketPercentIcon,
4738
4739
  title: t("billing.admin.coupons.empty.title"),
@@ -4752,7 +4753,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, CouponsList, "CouponsList");
4752
4753
  function ProductsList({ fullWidth } = {}) {
4753
4754
  const t = _nextintl.useTranslations.call(void 0, );
4754
4755
  const { catalogueVersion } = useProductContext();
4755
- const data = _chunkZCM4JLM7js.useDataListRetriever.call(void 0, {
4756
+ const data = _chunk4UFMLTL2js.useDataListRetriever.call(void 0, {
4756
4757
  retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkSQTXJPREjs.StripeProductService.listProducts(params), "retriever"),
4757
4758
  retrieverParams: {},
4758
4759
  module: _chunkSQTXJPREjs.Modules.StripeProduct
@@ -4762,7 +4763,7 @@ function ProductsList({ fullWidth } = {}) {
4762
4763
  }, [catalogueVersion]);
4763
4764
  const functions = [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductEditor, {}, "create-product")];
4764
4765
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4765
- _chunkZCM4JLM7js.ContentListTable,
4766
+ _chunk4UFMLTL2js.ContentListTable,
4766
4767
  {
4767
4768
  data,
4768
4769
  fields: ["name" /* name */, "status" /* status */, "prices" /* prices */],
@@ -4771,7 +4772,7 @@ function ProductsList({ fullWidth } = {}) {
4771
4772
  fullWidth,
4772
4773
  title: t("billing.admin.products.title"),
4773
4774
  emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4774
- _chunkZCM4JLM7js.EmptyState,
4775
+ _chunk4UFMLTL2js.EmptyState,
4775
4776
  {
4776
4777
  icon: _lucidereact.PackageIcon,
4777
4778
  title: t("billing.admin.products.empty.title"),
@@ -4787,8 +4788,8 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductsList, "ProductsList");
4787
4788
 
4788
4789
  function ProductsListContainer() {
4789
4790
  const t = _nextintl.useTranslations.call(void 0, );
4790
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductProvider, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CouponProvider, { publishChrome: false, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4791
- _chunkZCM4JLM7js.RoundPageContainer,
4791
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ProductProvider, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CouponProvider, { publishChrome: false, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4792
+ _chunk4UFMLTL2js.RoundPageContainer,
4792
4793
  {
4793
4794
  module: _chunkSQTXJPREjs.Modules.StripeProduct,
4794
4795
  tabs: [
@@ -4808,30 +4809,30 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductsListContainer, "ProductsListContain
4808
4809
 
4809
4810
  function CouponDetails() {
4810
4811
  const t = _nextintl.useTranslations.call(void 0, );
4811
- const fmt = _chunkZCM4JLM7js.useBillingFormatOptions.call(void 0, );
4812
- const { coupon } = _chunkZCM4JLM7js.useCouponContext.call(void 0, );
4812
+ const fmt = _chunk4UFMLTL2js.useBillingFormatOptions.call(void 0, );
4813
+ const { coupon } = _chunk4UFMLTL2js.useCouponContext.call(void 0, );
4813
4814
  if (!coupon) return null;
4814
4815
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
4815
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.SectionHeader, { children: t("billing.admin.products.tabs.details") }),
4816
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.SectionHeader, { children: t("billing.admin.products.tabs.details") }),
4816
4817
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-xs/relaxed", children: t("billing.admin.coupons.fixed_notice") }),
4817
4818
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
4818
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.DetailField, { label: t("billing.admin.coupons.fields.name"), value: coupon.name }),
4819
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.DetailField, { label: t("billing.admin.coupons.fields.name"), value: coupon.name }),
4819
4820
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4820
- _chunkZCM4JLM7js.DetailField,
4821
+ _chunk4UFMLTL2js.DetailField,
4821
4822
  {
4822
4823
  label: t("billing.admin.coupons.fields.status"),
4823
- value: coupon.valid ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: "softGreen", children: t("billing.admin.coupons.status.active") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.Badge, { variant: "softGray", children: t("billing.admin.coupons.status.ended") })
4824
+ value: coupon.valid ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Badge, { variant: "softGreen", children: t("billing.admin.coupons.status.active") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.Badge, { variant: "softGray", children: t("billing.admin.coupons.status.ended") })
4824
4825
  }
4825
4826
  ),
4826
4827
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4827
- _chunkZCM4JLM7js.DetailField,
4828
+ _chunk4UFMLTL2js.DetailField,
4828
4829
  {
4829
4830
  label: t("billing.admin.coupons.fields.discount"),
4830
4831
  value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: _chunkSQTXJPREjs.formatCouponDiscount.call(void 0, coupon, t, fmt) })
4831
4832
  }
4832
4833
  ),
4833
4834
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4834
- _chunkZCM4JLM7js.DetailField,
4835
+ _chunk4UFMLTL2js.DetailField,
4835
4836
  {
4836
4837
  label: t("billing.admin.coupons.fields.places"),
4837
4838
  value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: coupon.maxRedemptions !== void 0 ? t("billing.admin.coupons.places.limited", {
@@ -4841,21 +4842,21 @@ function CouponDetails() {
4841
4842
  }
4842
4843
  ),
4843
4844
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4844
- _chunkZCM4JLM7js.DetailField,
4845
+ _chunk4UFMLTL2js.DetailField,
4845
4846
  {
4846
4847
  label: t("billing.admin.coupons.fields.products"),
4847
4848
  value: coupon.stripeProductIds.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: coupon.stripeProductIds.join(", ") }) : t("billing.admin.coupons.all_products")
4848
4849
  }
4849
4850
  ),
4850
4851
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4851
- _chunkZCM4JLM7js.DetailField,
4852
+ _chunk4UFMLTL2js.DetailField,
4852
4853
  {
4853
4854
  label: t("billing.admin.coupons.fields.redeemBy"),
4854
- value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: coupon.redeemBy ? _chunkZCM4JLM7js.formatDate.call(void 0, coupon.redeemBy, fmt) : "\u2014" })
4855
+ value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: coupon.redeemBy ? _chunk4UFMLTL2js.formatDate.call(void 0, coupon.redeemBy, fmt) : "\u2014" })
4855
4856
  }
4856
4857
  ),
4857
4858
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4858
- _chunkZCM4JLM7js.DetailField,
4859
+ _chunk4UFMLTL2js.DetailField,
4859
4860
  {
4860
4861
  label: t("billing.admin.coupons.fields.stripeId"),
4861
4862
  value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tabular-nums", children: coupon.stripeCouponId })
@@ -4890,15 +4891,15 @@ function CouponCodeEditorInternal({
4890
4891
  }) {
4891
4892
  const t = _nextintl.useTranslations.call(void 0, );
4892
4893
  const router = _chunkSQTXJPREjs.useI18nRouter.call(void 0, );
4893
- const { createCode } = _chunkZCM4JLM7js.useCouponContext.call(void 0, );
4894
- const formSchema2 = _react.useMemo.call(void 0, () => _zod3.z.object({ id: _zod3.z.uuidv4() }).and(_chunkZCM4JLM7js.couponCodeSchema.call(void 0, t)), [t]);
4895
- const getDefaultValues = _react.useCallback.call(void 0, () => ({ id: _uuid.v4.call(void 0, ), ..._chunkZCM4JLM7js.couponCodeDefaults.call(void 0, ) }), []);
4894
+ const { createCode } = _chunk4UFMLTL2js.useCouponContext.call(void 0, );
4895
+ const formSchema2 = _react.useMemo.call(void 0, () => _zod3.z.object({ id: _zod3.z.uuidv4() }).and(_chunk4UFMLTL2js.couponCodeSchema.call(void 0, t)), [t]);
4896
+ const getDefaultValues = _react.useCallback.call(void 0, () => ({ id: _uuid.v4.call(void 0, ), ..._chunk4UFMLTL2js.couponCodeDefaults.call(void 0, ) }), []);
4896
4897
  const form = _reacthookform.useForm.call(void 0, {
4897
4898
  resolver: _zod.zodResolver.call(void 0, formSchema2),
4898
4899
  defaultValues: getDefaultValues()
4899
4900
  });
4900
4901
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4901
- _chunkZCM4JLM7js.EditorSheet,
4902
+ _chunk4UFMLTL2js.EditorSheet,
4902
4903
  {
4903
4904
  form,
4904
4905
  entityType: t("billing.admin.coupons.codes.entity"),
@@ -4908,14 +4909,14 @@ function CouponCodeEditorInternal({
4908
4909
  onSuccess: _nullishCoalesce(onSuccess, () => ( (() => {
4909
4910
  }))),
4910
4911
  onNavigate: (url) => router.push(url),
4911
- onSubmit: async (values) => await createCode({ id: values.id, couponId, ..._chunkZCM4JLM7js.toCouponCodeInput.call(void 0, values) }),
4912
+ onSubmit: async (values) => await createCode({ id: values.id, couponId, ..._chunk4UFMLTL2js.toCouponCodeInput.call(void 0, values) }),
4912
4913
  onReset: getDefaultValues,
4913
4914
  trigger,
4914
4915
  forceShow,
4915
4916
  onClose,
4916
4917
  dialogOpen,
4917
4918
  onDialogOpenChange,
4918
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCM4JLM7js.CouponCodeFields, { form })
4919
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4UFMLTL2js.CouponCodeFields, { form })
4919
4920
  }
4920
4921
  );
4921
4922
  }
@@ -4929,8 +4930,8 @@ _chunk7QVYU63Ejs.__name.call(void 0, CouponCodeEditor, "CouponCodeEditor");
4929
4930
 
4930
4931
  function CouponCodesList({ couponId }) {
4931
4932
  const t = _nextintl.useTranslations.call(void 0, );
4932
- const { catalogueVersion } = _chunkZCM4JLM7js.useCouponContext.call(void 0, );
4933
- const data = _chunkZCM4JLM7js.useDataListRetriever.call(void 0, {
4933
+ const { catalogueVersion } = _chunk4UFMLTL2js.useCouponContext.call(void 0, );
4934
+ const data = _chunk4UFMLTL2js.useDataListRetriever.call(void 0, {
4934
4935
  retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkSQTXJPREjs.StripeCouponCodeService.listByCoupon({ ...params, couponId }), "retriever"),
4935
4936
  retrieverParams: {},
4936
4937
  module: _chunkSQTXJPREjs.Modules.StripeCouponCode
@@ -4940,7 +4941,7 @@ function CouponCodesList({ couponId }) {
4940
4941
  }, [catalogueVersion]);
4941
4942
  const functions = [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CouponCodeEditor, { couponId }, "create-code")];
4942
4943
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4943
- _chunkZCM4JLM7js.ContentListTable,
4944
+ _chunk4UFMLTL2js.ContentListTable,
4944
4945
  {
4945
4946
  data,
4946
4947
  fields: [
@@ -4955,7 +4956,7 @@ function CouponCodesList({ couponId }) {
4955
4956
  functions,
4956
4957
  title: t("billing.admin.coupons.codes.title"),
4957
4958
  emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4958
- _chunkZCM4JLM7js.EmptyState,
4959
+ _chunk4UFMLTL2js.EmptyState,
4959
4960
  {
4960
4961
  icon: _lucidereact.TicketIcon,
4961
4962
  title: t("billing.admin.coupons.codes.empty.title"),
@@ -4971,12 +4972,12 @@ _chunk7QVYU63Ejs.__name.call(void 0, CouponCodesList, "CouponCodesList");
4971
4972
 
4972
4973
  function CouponContainer() {
4973
4974
  const t = _nextintl.useTranslations.call(void 0, );
4974
- const { coupon } = _chunkZCM4JLM7js.useCouponContext.call(void 0, );
4975
+ const { coupon } = _chunk4UFMLTL2js.useCouponContext.call(void 0, );
4975
4976
  if (!coupon) return null;
4976
4977
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4977
- _chunkZCM4JLM7js.RoundPageContainer,
4978
+ _chunk4UFMLTL2js.RoundPageContainer,
4978
4979
  {
4979
- module: _chunkZCM4JLM7js.couponPageModule.call(void 0, ),
4980
+ module: _chunk4UFMLTL2js.couponPageModule.call(void 0, ),
4980
4981
  id: coupon.id,
4981
4982
  tabs: [
4982
4983
  {
@@ -5083,5 +5084,5 @@ _chunk7QVYU63Ejs.__name.call(void 0, CouponContainer, "CouponContainer");
5083
5084
 
5084
5085
 
5085
5086
 
5086
- exports.BillingAlertBanner = BillingAlertBanner; exports.BillingDashboardContainer = BillingDashboardContainer; exports.BillingDetailModal = BillingDetailModal; exports.BillingUsageSummaryCard = BillingUsageSummaryCard; exports.CancelSubscriptionDialog = CancelSubscriptionDialog; exports.CouponCodeActions = _chunkZCM4JLM7js.CouponCodeActions; exports.CouponCodeEditor = CouponCodeEditor; exports.CouponCodeFields = _chunkZCM4JLM7js.CouponCodeFields; exports.CouponCodesList = CouponCodesList; exports.CouponContainer = CouponContainer; exports.CouponDetails = CouponDetails; exports.CouponEditor = _chunkZCM4JLM7js.CouponEditor; exports.CouponProvider = _chunkZCM4JLM7js.CouponProvider; exports.CouponRefresher = _chunkZCM4JLM7js.CouponRefresher; exports.CouponsList = CouponsList; exports.CustomerInfoCard = CustomerInfoCard; exports.IntervalToggle = IntervalToggle; exports.InvoiceDetails = InvoiceDetails; exports.InvoiceStatusBadge = InvoiceStatusBadge; exports.InvoicesContainer = InvoicesContainer; exports.InvoicesList = InvoicesList; exports.InvoicesSummaryCard = InvoicesSummaryCard; exports.PaymentMethodCard = PaymentMethodCard; exports.PaymentMethodEditor = PaymentMethodEditor; exports.PaymentMethodForm = PaymentMethodForm; exports.PaymentMethodSummaryCard = PaymentMethodSummaryCard; exports.PaymentMethodsContainer = PaymentMethodsContainer; exports.PaymentMethodsList = PaymentMethodsList; exports.PriceArchiver = PriceArchiver; exports.PriceContainer = PriceContainer; exports.PriceDetails = PriceDetails; exports.PriceEditor = PriceEditor; exports.PriceProvider = PriceProvider; exports.PricesList = PricesList; exports.PricingCard = PricingCard; exports.ProductArchiver = ProductArchiver; exports.ProductContainer = ProductContainer; exports.ProductDetails = ProductDetails; exports.ProductEditor = ProductEditor; exports.ProductPricingList = ProductPricingList; exports.ProductPricingRow = ProductPricingRow; exports.ProductProvider = ProductProvider; exports.ProductsList = ProductsList; exports.ProductsListContainer = ProductsListContainer; exports.PromoCodeInput = PromoCodeInput; exports.ProrationPreview = ProrationPreview; exports.StripeProvider = StripeProvider; exports.SubscriptionConfirmation = SubscriptionConfirmation; exports.SubscriptionDetails = SubscriptionDetails; exports.SubscriptionStatusBadge = SubscriptionStatusBadge; exports.SubscriptionSummaryCard = SubscriptionSummaryCard; exports.SubscriptionWizard = SubscriptionWizard; exports.SubscriptionsContainer = SubscriptionsContainer; exports.SubscriptionsList = SubscriptionsList; exports.UsageContainer = UsageContainer; exports.UsageHistoryTable = UsageHistoryTable; exports.UsageSummaryCard = UsageSummaryCard; exports.UsageSummaryCards = UsageSummaryCards; exports.WizardProgressIndicator = WizardProgressIndicator; exports.WizardStepPaymentMethod = WizardStepPaymentMethod; exports.WizardStepPlanSelection = WizardStepPlanSelection; exports.WizardStepReview = WizardStepReview; exports.applyDiscount = _chunkZCM4JLM7js.applyDiscount; exports.couponCodeDefaults = _chunkZCM4JLM7js.couponCodeDefaults; exports.couponCodeSchema = _chunkZCM4JLM7js.couponCodeSchema; exports.couponCurrencyOptions = _chunkZCM4JLM7js.couponCurrencyOptions; exports.formatCurrency = _chunkSQTXJPREjs.formatCurrency; exports.formatDate = _chunkZCM4JLM7js.formatDate; exports.formatFixed = _chunkSQTXJPREjs.formatFixed; exports.formatInterval = _chunkSQTXJPREjs.formatInterval; exports.isStripeConfigured = isStripeConfigured; exports.optionalDate = _chunkZCM4JLM7js.optionalDate; exports.optionalDecimal = _chunkZCM4JLM7js.optionalDecimal; exports.optionalPositiveInt = _chunkZCM4JLM7js.optionalPositiveInt; exports.parseOptionalDecimal = _chunkZCM4JLM7js.parseOptionalDecimal; exports.parseOptionalPositiveInt = _chunkZCM4JLM7js.parseOptionalPositiveInt; exports.priceLabel = priceLabel; exports.promotionCodeDiscount = _chunkZCM4JLM7js.promotionCodeDiscount; exports.subscriptionDiscount = _chunkZCM4JLM7js.subscriptionDiscount; exports.toCouponCodeInput = _chunkZCM4JLM7js.toCouponCodeInput; exports.useBillingFormatOptions = _chunkZCM4JLM7js.useBillingFormatOptions; exports.useCouponContext = _chunkZCM4JLM7js.useCouponContext; exports.usePriceContext = usePriceContext; exports.useProductContext = useProductContext;
5087
+ exports.BillingAlertBanner = BillingAlertBanner; exports.BillingDashboardContainer = BillingDashboardContainer; exports.BillingDetailModal = BillingDetailModal; exports.BillingUsageSummaryCard = BillingUsageSummaryCard; exports.CancelSubscriptionDialog = CancelSubscriptionDialog; exports.CouponCodeActions = _chunk4UFMLTL2js.CouponCodeActions; exports.CouponCodeEditor = CouponCodeEditor; exports.CouponCodeFields = _chunk4UFMLTL2js.CouponCodeFields; exports.CouponCodesList = CouponCodesList; exports.CouponContainer = CouponContainer; exports.CouponDetails = CouponDetails; exports.CouponEditor = _chunk4UFMLTL2js.CouponEditor; exports.CouponProvider = _chunk4UFMLTL2js.CouponProvider; exports.CouponRefresher = _chunk4UFMLTL2js.CouponRefresher; exports.CouponsList = CouponsList; exports.CustomerInfoCard = CustomerInfoCard; exports.IntervalToggle = IntervalToggle; exports.InvoiceDetails = InvoiceDetails; exports.InvoiceStatusBadge = InvoiceStatusBadge; exports.InvoicesContainer = InvoicesContainer; exports.InvoicesList = InvoicesList; exports.InvoicesSummaryCard = InvoicesSummaryCard; exports.PaymentMethodCard = PaymentMethodCard; exports.PaymentMethodEditor = PaymentMethodEditor; exports.PaymentMethodForm = PaymentMethodForm; exports.PaymentMethodSummaryCard = PaymentMethodSummaryCard; exports.PaymentMethodsContainer = PaymentMethodsContainer; exports.PaymentMethodsList = PaymentMethodsList; exports.PriceArchiver = PriceArchiver; exports.PriceContainer = PriceContainer; exports.PriceDetails = PriceDetails; exports.PriceEditor = PriceEditor; exports.PriceProvider = PriceProvider; exports.PricesList = PricesList; exports.PricingCard = PricingCard; exports.ProductArchiver = ProductArchiver; exports.ProductContainer = ProductContainer; exports.ProductDetails = ProductDetails; exports.ProductEditor = ProductEditor; exports.ProductPricingList = ProductPricingList; exports.ProductPricingRow = ProductPricingRow; exports.ProductProvider = ProductProvider; exports.ProductsList = ProductsList; exports.ProductsListContainer = ProductsListContainer; exports.PromoCodeInput = PromoCodeInput; exports.ProrationPreview = ProrationPreview; exports.StripeProvider = StripeProvider; exports.SubscriptionConfirmation = SubscriptionConfirmation; exports.SubscriptionDetails = SubscriptionDetails; exports.SubscriptionStatusBadge = SubscriptionStatusBadge; exports.SubscriptionSummaryCard = SubscriptionSummaryCard; exports.SubscriptionWizard = SubscriptionWizard; exports.SubscriptionsContainer = SubscriptionsContainer; exports.SubscriptionsList = SubscriptionsList; exports.UsageContainer = UsageContainer; exports.UsageHistoryTable = UsageHistoryTable; exports.UsageSummaryCard = UsageSummaryCard; exports.UsageSummaryCards = UsageSummaryCards; exports.WizardProgressIndicator = WizardProgressIndicator; exports.WizardStepPaymentMethod = WizardStepPaymentMethod; exports.WizardStepPlanSelection = WizardStepPlanSelection; exports.WizardStepReview = WizardStepReview; exports.applyDiscount = _chunk4UFMLTL2js.applyDiscount; exports.couponCodeDefaults = _chunk4UFMLTL2js.couponCodeDefaults; exports.couponCodeSchema = _chunk4UFMLTL2js.couponCodeSchema; exports.couponCurrencyOptions = _chunk4UFMLTL2js.couponCurrencyOptions; exports.formatCurrency = _chunkSQTXJPREjs.formatCurrency; exports.formatDate = _chunk4UFMLTL2js.formatDate; exports.formatFixed = _chunkSQTXJPREjs.formatFixed; exports.formatInterval = _chunkSQTXJPREjs.formatInterval; exports.isStripeConfigured = isStripeConfigured; exports.optionalDate = _chunk4UFMLTL2js.optionalDate; exports.optionalDecimal = _chunk4UFMLTL2js.optionalDecimal; exports.optionalPositiveInt = _chunk4UFMLTL2js.optionalPositiveInt; exports.parseOptionalDecimal = _chunk4UFMLTL2js.parseOptionalDecimal; exports.parseOptionalPositiveInt = _chunk4UFMLTL2js.parseOptionalPositiveInt; exports.priceLabel = priceLabel; exports.promotionCodeDiscount = _chunk4UFMLTL2js.promotionCodeDiscount; exports.subscriptionDiscount = _chunk4UFMLTL2js.subscriptionDiscount; exports.toCouponCodeInput = _chunk4UFMLTL2js.toCouponCodeInput; exports.useBillingFormatOptions = _chunk4UFMLTL2js.useBillingFormatOptions; exports.useCouponContext = _chunk4UFMLTL2js.useCouponContext; exports.usePriceContext = usePriceContext; exports.useProductContext = useProductContext;
5087
5088
  //# sourceMappingURL=index.js.map