@burdenoff/microfe-billing 2026.1109.1 → 2026.1112.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 (25) hide show
  1. package/dist/billing/BillingUserRoutes.js +202 -188
  2. package/dist/billing/BillingUserRoutes.js.map +1 -1
  3. package/dist/billing/hooks/useBillingVariant.d.ts +6 -0
  4. package/dist/billing/hooks/useBillingVariant.js +8 -0
  5. package/dist/billing/hooks/useBillingVariant.js.map +1 -0
  6. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +169 -140
  7. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
  8. package/dist/billing/modules/billing/pages/InvoicesListPage.js +191 -156
  9. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
  10. package/dist/billing/modules/billing/pages/UserRefundsPage.js +160 -157
  11. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  12. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +4 -1
  13. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  14. package/dist/billing/providers/BillingProvider.js +16 -15
  15. package/dist/billing/providers/BillingProvider.js.map +1 -1
  16. package/dist/billing/shared/components/MoneyActionDialog.d.ts +27 -0
  17. package/dist/billing/shared/components/MoneyActionDialog.js +53 -0
  18. package/dist/billing/shared/components/MoneyActionDialog.js.map +1 -0
  19. package/dist/billing/shared/components/index.d.ts +1 -0
  20. package/dist/billing/shared/components/index.js +2 -1
  21. package/dist/billing/shared/utils/accessRules.d.ts +16 -0
  22. package/dist/billing/shared/utils/accessRules.js +10 -0
  23. package/dist/billing/shared/utils/accessRules.js.map +1 -0
  24. package/dist/billing/types/index.d.ts +6 -0
  25. package/package.json +1 -1
@@ -1,53 +1,56 @@
1
1
  import { useBillingNavigate as e } from "../../../hooks/useBillingNavigate.js";
2
- import { useBilling as t } from "../../../providers/BillingProvider.js";
3
- import { useBillingAccountSelection as n } from "../../../hooks/useBillingAccountSelection.js";
4
- import { useInvoice as r, useInvoiceMutations as i } from "../hooks/useInvoices.js";
5
- import { useBillingPermissions as a } from "../../../hooks/useBillingPermissions.js";
6
- import { useGetDefaultBillingAccountDashboardQuery as o } from "../../../../generated/global-operations.js";
7
- import { formatCurrency as s, formatDate as c, formatInvoiceNumber as l, formatInvoiceStatus as u } from "../../../shared/utils/format.js";
8
- import { withBillingAccountId as d } from "../../../shared/utils/navigation.js";
9
- import { getInvoiceStatusColor as f, getStatusBadgeClasses as p } from "../../../shared/utils/status.js";
2
+ import { MoneyActionDialog as t } from "../../../shared/components/MoneyActionDialog.js";
3
+ import { useBilling as n } from "../../../providers/BillingProvider.js";
4
+ import { useBillingAccountSelection as r } from "../../../hooks/useBillingAccountSelection.js";
5
+ import { useInvoice as i, useInvoiceMutations as a } from "../hooks/useInvoices.js";
6
+ import { useBillingPermissions as ee } from "../../../hooks/useBillingPermissions.js";
7
+ import { useIsFluidgridsVariant as o } from "../../../hooks/useBillingVariant.js";
8
+ import "../../../shared/components/index.js";
9
+ import { useGetDefaultBillingAccountDashboardQuery as s } from "../../../../generated/global-operations.js";
10
+ import { formatCurrency as c, formatDate as l, formatInvoiceNumber as u, formatInvoiceStatus as d } from "../../../shared/utils/format.js";
11
+ import { withBillingAccountId as f } from "../../../shared/utils/navigation.js";
12
+ import { getInvoiceStatusColor as te, getStatusBadgeClasses as p } from "../../../shared/utils/status.js";
10
13
  import { useState as m } from "react";
11
14
  import { useParams as h } from "react-router";
12
15
  import { jsx as g, jsxs as _ } from "react/jsx-runtime";
13
16
  import { useI18n as v } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
14
- import { EmphasisPanel as y, NextSteps as b, PagePurpose as x, ResponsiveTable as S } from "@burdenoff/fe-libs/ui";
17
+ import { EmphasisPanel as y, NextSteps as b, PagePurpose as x, ResponsiveTable as ne } from "@burdenoff/fe-libs/ui";
15
18
  // src/billing/modules/billing/pages/InvoiceDetailPage.tsx
16
- var C = () => {
17
- let { t: C } = v(), w = (e, t) => {
18
- let n = C(e);
19
+ var S = () => {
20
+ let { t: S } = v(), C = (e, t) => {
21
+ let n = S(e);
19
22
  return n === e ? t : n;
20
- }, { invoiceId: T } = h(), E = e(), { orgId: D } = t(), O = a(), { selectedAccountId: k } = n({
21
- orgId: D,
23
+ }, { invoiceId: w } = h(), T = e(), { orgId: E } = n(), D = ee(), { selectedAccountId: O } = r({
24
+ orgId: E,
22
25
  syncFromUrl: !0,
23
26
  urlParamName: "billingAccountId"
24
- }), { data: A } = o({ fetchPolicy: "cache-first" }), j = k ?? A?.getDefaultBillingAccount?.id ?? void 0, { invoice: M, isLoading: N, error: P, refetch: F } = r(T, j), { payInvoice: I, voidInvoice: L, isPaying: R, isVoiding: z } = i(), B = A?.getDefaultBillingAccount?.defaultPaymentMethod, [V, H] = m(null), U = async () => {
25
- if (M) {
26
- if (!B) H("Add and set a default payment method before paying this invoice.");
27
- else if (!j) H("No billing account context");
28
- else {
29
- H(null);
30
- try {
31
- await I(M.id, B, j), await F();
32
- } catch (e) {
33
- H(e instanceof Error ? e.message : "Failed to pay invoice");
34
- }
35
- }
27
+ }), { data: k } = s({ fetchPolicy: "cache-first" }), A = O ?? k?.getDefaultBillingAccount?.id ?? void 0, { invoice: j, isLoading: re, error: M, refetch: N } = i(w, A), { payInvoice: P, voidInvoice: F, isPaying: I, isVoiding: L } = a(), R = k?.getDefaultBillingAccount?.defaultPaymentMethod, [z, B] = m(null), V = o(), [H, U] = m(null), W = async () => {
28
+ if (!j) return !1;
29
+ if (!R) return B("Add and set a default payment method before paying this invoice."), !1;
30
+ if (!A) return B("No billing account context"), !1;
31
+ B(null);
32
+ try {
33
+ return await P(j.id, R, A), await N(), !0;
34
+ } catch (e) {
35
+ return B(e instanceof Error ? e.message : "Failed to pay invoice"), !1;
36
36
  }
37
- }, W = async () => {
38
- if (M) {
39
- if (!j) H("No billing account context");
40
- else {
41
- H(null);
42
- try {
43
- await L(M.id, j), await F();
44
- } catch (e) {
45
- H(e instanceof Error ? e.message : "Failed to void invoice");
46
- }
47
- }
37
+ }, G = async () => {
38
+ if (!j) return !1;
39
+ if (!A) return B("No billing account context"), !1;
40
+ B(null);
41
+ try {
42
+ return await F(j.id, A), await N(), !0;
43
+ } catch (e) {
44
+ return B(e instanceof Error ? e.message : "Failed to void invoice"), !1;
48
45
  }
46
+ }, K = () => {
47
+ B(null), V ? U("pay") : W();
48
+ }, q = () => {
49
+ B(null), U("void");
50
+ }, J = async () => {
51
+ (H === "pay" ? await W() : await G()) && U(null);
49
52
  };
50
- if (!O.canViewInvoices) return /* @__PURE__ */ g("div", {
53
+ if (!D.canViewInvoices) return /* @__PURE__ */ g("div", {
51
54
  className: "flex items-center justify-center h-full min-h-[400px]",
52
55
  children: /* @__PURE__ */ _("div", {
53
56
  className: "text-center space-y-2",
@@ -69,16 +72,16 @@ var C = () => {
69
72
  }),
70
73
  /* @__PURE__ */ g("h2", {
71
74
  className: "text-lg font-semibold text-text-primary",
72
- children: w("billing.accessDenied.title", "Access Denied")
75
+ children: C("billing.accessDenied.title", "Access Denied")
73
76
  }),
74
77
  /* @__PURE__ */ g("p", {
75
78
  className: "text-sm text-text-secondary max-w-sm",
76
- children: w("billing.invoices.noViewPermission", "You don't have permission to view invoices.")
79
+ children: C("billing.invoices.noViewPermission", "You don't have permission to view invoices.")
77
80
  })
78
81
  ]
79
82
  })
80
83
  });
81
- if (N) return /* @__PURE__ */ _("div", {
84
+ if (re) return /* @__PURE__ */ _("div", {
82
85
  className: "space-y-6 px-6 lg:px-8 py-6",
83
86
  children: [/* @__PURE__ */ _("div", {
84
87
  className: "flex items-center gap-4",
@@ -130,7 +133,7 @@ var C = () => {
130
133
  })]
131
134
  })]
132
135
  });
133
- if (P || !M) return /* @__PURE__ */ g("div", {
136
+ if (M || !j) return /* @__PURE__ */ g("div", {
134
137
  className: "flex items-center justify-center h-full min-h-[400px]",
135
138
  children: /* @__PURE__ */ _("div", {
136
139
  className: "text-center space-y-4",
@@ -152,22 +155,22 @@ var C = () => {
152
155
  }),
153
156
  /* @__PURE__ */ g("h2", {
154
157
  className: "text-lg font-semibold text-text-primary",
155
- children: w("billing.invoices.invoiceNotFound", "Invoice not found")
158
+ children: C("billing.invoices.invoiceNotFound", "Invoice not found")
156
159
  }),
157
160
  /* @__PURE__ */ g("p", {
158
161
  className: "text-sm text-text-secondary",
159
- children: P?.message || w("billing.invoices.invoiceNotFoundMessage", "The invoice you are looking for does not exist.")
162
+ children: M?.message || C("billing.invoices.invoiceNotFoundMessage", "The invoice you are looking for does not exist.")
160
163
  }),
161
164
  /* @__PURE__ */ _("div", {
162
165
  className: "flex items-center justify-center gap-3",
163
166
  children: [/* @__PURE__ */ g("button", {
164
167
  type: "button",
165
- onClick: () => F(),
168
+ onClick: () => N(),
166
169
  className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors",
167
170
  children: "Try Again"
168
171
  }), /* @__PURE__ */ g("button", {
169
172
  type: "button",
170
- onClick: () => E(d("/invoices", j)),
173
+ onClick: () => T(f("/invoices", A)),
171
174
  className: "px-4 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
172
175
  children: "Back to Invoices"
173
176
  })]
@@ -175,7 +178,7 @@ var C = () => {
175
178
  ]
176
179
  })
177
180
  });
178
- let G = f(M.status), K = M.status === "OPEN", q = M.status === "DRAFT", J = M.items || [], Y = M.total - M.amountPaid, X = M.metadata?.invoicePdfBackupUrl, Z = [
181
+ let Y = te(j.status), X = j.status === "OPEN", ie = j.status === "DRAFT", Z = j.items || [], Q = j.total - j.amountPaid, $ = j.metadata?.invoicePdfBackupUrl, ae = [
179
182
  {
180
183
  key: "description",
181
184
  header: "Description",
@@ -199,7 +202,7 @@ var C = () => {
199
202
  cellClassName: "text-right",
200
203
  cell: (e) => /* @__PURE__ */ g("span", {
201
204
  className: "tabular-nums",
202
- children: s(e.unitPrice, M.currency)
205
+ children: c(e.unitPrice, j.currency)
203
206
  })
204
207
  },
205
208
  {
@@ -209,39 +212,39 @@ var C = () => {
209
212
  cellClassName: "text-right font-medium",
210
213
  cell: (e) => /* @__PURE__ */ g("span", {
211
214
  className: "tabular-nums",
212
- children: s(e.amount, M.currency)
215
+ children: c(e.amount, j.currency)
213
216
  })
214
217
  }
215
- ], Q = [
216
- ...K && O.canPayInvoice ? [{
218
+ ], oe = [
219
+ ...X && D.canPayInvoice ? [{
217
220
  id: "pay",
218
221
  label: "Pay this invoice",
219
- description: B ? "Settle the outstanding amount with your default payment method." : "Add a default payment method first, then pay.",
220
- onClick: U
222
+ description: R ? "Settle the outstanding amount with your default payment method." : "Add a default payment method first, then pay.",
223
+ onClick: K
221
224
  }] : [],
222
- ...M.pdfUrl ? [{
225
+ ...j.pdfUrl ? [{
223
226
  id: "download",
224
227
  label: "Download the PDF",
225
228
  description: "Save a copy of this invoice for your records.",
226
- href: M.pdfUrl
229
+ href: j.pdfUrl
227
230
  }] : [],
228
- ...X ? [{
231
+ ...$ ? [{
229
232
  id: "download-backup",
230
233
  label: "Download the PDF (backup copy)",
231
234
  description: "Our own stored copy — works even if the link above ever breaks.",
232
- href: X
235
+ href: $
233
236
  }] : [],
234
- ...M.subscription ? [{
237
+ ...j.subscription ? [{
235
238
  id: "view-subscription",
236
239
  label: "View the related subscription",
237
240
  description: "See the plan and quotas this invoice billed for.",
238
- onClick: () => E(d(`/subscriptions/${M.subscription.id}`, j))
241
+ onClick: () => T(f(`/subscriptions/${j.subscription.id}`, A))
239
242
  }] : [],
240
243
  {
241
244
  id: "request-refund",
242
245
  label: "Have an issue? Request a refund",
243
246
  description: "Raise a refund request for a charge on this account.",
244
- onClick: () => E(d("/refunds", j))
247
+ onClick: () => T(f("/refunds", A))
245
248
  }
246
249
  ];
247
250
  return /* @__PURE__ */ _("div", {
@@ -253,7 +256,7 @@ var C = () => {
253
256
  className: "flex items-start gap-4",
254
257
  children: [/* @__PURE__ */ g("button", {
255
258
  type: "button",
256
- onClick: () => E(d("/invoices", j)),
259
+ onClick: () => T(f("/invoices", A)),
257
260
  className: "p-2 -ml-2 text-text-secondary hover:text-text-primary hover:bg-bg-sunken rounded-button transition-colors",
258
261
  children: /* @__PURE__ */ g("svg", {
259
262
  className: "size-5",
@@ -272,71 +275,97 @@ var C = () => {
272
275
  className: "flex items-center gap-3",
273
276
  children: [/* @__PURE__ */ _("h1", {
274
277
  className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
275
- children: ["Invoice ", l(M.invoiceNumber)]
278
+ children: ["Invoice ", u(j.invoiceNumber)]
276
279
  }), /* @__PURE__ */ g("span", {
277
- className: `px-2 py-1 text-xs font-medium rounded ${p(G)}`,
278
- children: u(M.status)
280
+ className: `px-2 py-1 text-xs font-medium rounded ${p(Y)}`,
281
+ children: d(j.status)
279
282
  })]
280
283
  }),
281
284
  /* @__PURE__ */ _("p", {
282
285
  className: "text-sm text-text-secondary mt-1",
283
286
  children: [
284
287
  "Created ",
285
- c(M.createdAt, "short"),
286
- M.dueDate && ` · Due ${c(M.dueDate, "short")}`
288
+ l(j.createdAt, "short"),
289
+ j.dueDate && ` · Due ${l(j.dueDate, "short")}`
287
290
  ]
288
291
  }),
289
292
  /* @__PURE__ */ g(x, {
290
293
  className: "mt-3",
291
- children: w("billing.invoices.detailPurpose", "The full breakdown of a single invoice — its line items, taxes, what has been paid and what is still due. Use it to download the PDF, pay an outstanding balance, jump to the subscription it covers, or raise a refund.")
294
+ children: C("billing.invoices.detailPurpose", "The full breakdown of a single invoice — its line items, taxes, what has been paid and what is still due. Use it to download the PDF, pay an outstanding balance, jump to the subscription it covers, or raise a refund.")
292
295
  })
293
296
  ] })]
294
297
  }), /* @__PURE__ */ _("div", {
295
298
  className: "flex items-center gap-2 flex-wrap",
296
299
  children: [
297
- M.pdfUrl && /* @__PURE__ */ g("a", {
298
- href: M.pdfUrl,
300
+ j.pdfUrl && /* @__PURE__ */ g("a", {
301
+ href: j.pdfUrl,
299
302
  target: "_blank",
300
303
  rel: "noopener noreferrer",
301
304
  className: "px-4 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
302
305
  children: "Download PDF"
303
306
  }),
304
- X && /* @__PURE__ */ g("a", {
305
- href: X,
307
+ $ && /* @__PURE__ */ g("a", {
308
+ href: $,
306
309
  target: "_blank",
307
310
  rel: "noopener noreferrer",
308
311
  className: "px-4 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
309
312
  children: "Download PDF (backup)"
310
313
  }),
311
- M.invoiceUrl && /* @__PURE__ */ g("a", {
312
- href: M.invoiceUrl,
314
+ j.invoiceUrl && /* @__PURE__ */ g("a", {
315
+ href: j.invoiceUrl,
313
316
  target: "_blank",
314
317
  rel: "noopener noreferrer",
315
318
  className: "px-4 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
316
319
  children: "View on Portal"
317
320
  }),
318
- K && O.canPayInvoice && /* @__PURE__ */ g("button", {
321
+ X && D.canPayInvoice && /* @__PURE__ */ g("button", {
319
322
  type: "button",
320
- onClick: U,
321
- disabled: R || !B,
323
+ onClick: K,
324
+ disabled: I || !R,
322
325
  className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors disabled:opacity-50",
323
- children: B ? R ? "Processing..." : "Pay Invoice" : "Default Payment Method Required"
326
+ children: R ? I ? "Processing..." : "Pay Invoice" : "Default Payment Method Required"
324
327
  }),
325
- (K || q) && O.canVoidInvoice && /* @__PURE__ */ g("button", {
328
+ (X || ie) && D.canVoidInvoice && /* @__PURE__ */ g("button", {
326
329
  type: "button",
327
- onClick: W,
328
- disabled: z,
330
+ onClick: q,
331
+ disabled: L,
329
332
  className: "px-4 py-2 text-sm font-medium border border-border-subtle text-status-error-text rounded-button hover:bg-status-error-bg-subtle transition-colors disabled:opacity-50",
330
- children: z ? w("billing.invoices.voiding", "Voiding...") : w("billing.invoices.voidInvoice", "Void Invoice")
333
+ children: L ? C("billing.invoices.voiding", "Voiding...") : C("billing.invoices.voidInvoice", "Void Invoice")
331
334
  })
332
335
  ]
333
336
  })]
334
337
  }),
335
- V && /* @__PURE__ */ g("div", {
338
+ /* @__PURE__ */ g(t, {
339
+ open: H !== null,
340
+ tone: H === "void" ? "danger" : "primary",
341
+ title: H === "void" ? C("billing.invoices.voidReview.title", "Void this invoice?") : C("billing.invoices.payReview.title", "Review and pay"),
342
+ description: H === "void" ? C("billing.invoices.voidReview.description", "The invoice is cancelled and can no longer be paid. This cannot be undone.") : C("billing.invoices.payReview.description", "Your default card is charged as soon as you confirm."),
343
+ details: [
344
+ {
345
+ label: C("billing.invoices.payReview.invoice", "Invoice"),
346
+ value: u(j.invoiceNumber)
347
+ },
348
+ ...H === "pay" ? [{
349
+ label: C("billing.invoices.payReview.card", "Paid with"),
350
+ value: C("billing.invoices.payReview.defaultCard", "Your default card")
351
+ }] : [],
352
+ {
353
+ label: C("billing.invoices.payReview.amount", "Amount"),
354
+ value: c(j.total, j.currency)
355
+ }
356
+ ],
357
+ confirmLabel: H === "void" ? C("billing.invoices.voidReview.confirm", "Void invoice") : C("billing.invoices.payReview.confirm", "Pay {{amount}}").replace("{{amount}}", c(j.total, j.currency)),
358
+ busyLabel: H === "void" ? C("billing.invoices.voiding", "Voiding...") : C("billing.common.paying", "Paying…"),
359
+ isBusy: H === "void" ? L : I,
360
+ error: z,
361
+ onConfirm: () => void J(),
362
+ onCancel: () => U(null)
363
+ }),
364
+ z && H === null && /* @__PURE__ */ g("div", {
336
365
  className: "p-3 bg-status-error-bg-subtle border border-status-error-border rounded-button",
337
366
  children: /* @__PURE__ */ g("p", {
338
367
  className: "text-sm text-status-error-text",
339
- children: V
368
+ children: z
340
369
  })
341
370
  }),
342
371
  /* @__PURE__ */ _("div", {
@@ -352,23 +381,23 @@ var C = () => {
352
381
  children: /* @__PURE__ */ _("h2", {
353
382
  className: "text-lg font-semibold text-text-primary",
354
383
  children: [
355
- w("billing.invoices.lineItems", "Line Items"),
384
+ C("billing.invoices.lineItems", "Line Items"),
356
385
  " (",
357
- J.length,
386
+ Z.length,
358
387
  ")"
359
388
  ]
360
389
  })
361
390
  }),
362
- J.length === 0 ? /* @__PURE__ */ g("div", {
391
+ Z.length === 0 ? /* @__PURE__ */ g("div", {
363
392
  className: "p-6",
364
393
  children: /* @__PURE__ */ g("p", {
365
394
  className: "text-sm text-text-secondary",
366
- children: w("billing.invoices.noLineItems", "No line items on this invoice.")
395
+ children: C("billing.invoices.noLineItems", "No line items on this invoice.")
367
396
  })
368
- }) : /* @__PURE__ */ g(S, {
369
- data: J,
397
+ }) : /* @__PURE__ */ g(ne, {
398
+ data: Z,
370
399
  rowKey: (e) => e.id,
371
- columns: Z
400
+ columns: ae
372
401
  }),
373
402
  /* @__PURE__ */ g("div", {
374
403
  className: "border-t border-border-subtle p-4",
@@ -379,50 +408,50 @@ var C = () => {
379
408
  className: "flex items-center justify-between text-sm",
380
409
  children: [/* @__PURE__ */ g("span", {
381
410
  className: "text-text-secondary",
382
- children: w("billing.invoices.subtotal", "Subtotal")
411
+ children: C("billing.invoices.subtotal", "Subtotal")
383
412
  }), /* @__PURE__ */ g("span", {
384
413
  className: "text-text-primary",
385
- children: s(M.subtotal, M.currency)
414
+ children: c(j.subtotal, j.currency)
386
415
  })]
387
416
  }),
388
417
  /* @__PURE__ */ _("div", {
389
418
  className: "flex items-center justify-between text-sm",
390
419
  children: [/* @__PURE__ */ g("span", {
391
420
  className: "text-text-secondary",
392
- children: w("billing.invoices.tax", "Tax")
421
+ children: C("billing.invoices.tax", "Tax")
393
422
  }), /* @__PURE__ */ g("span", {
394
423
  className: "text-text-primary",
395
- children: s(M.tax, M.currency)
424
+ children: c(j.tax, j.currency)
396
425
  })]
397
426
  }),
398
427
  /* @__PURE__ */ _("div", {
399
428
  className: "flex items-center justify-between text-sm font-semibold border-t border-border-subtle pt-2",
400
429
  children: [/* @__PURE__ */ g("span", {
401
430
  className: "text-text-primary",
402
- children: w("billing.invoices.total", "Total")
431
+ children: C("billing.invoices.total", "Total")
403
432
  }), /* @__PURE__ */ g("span", {
404
433
  className: "text-text-primary",
405
- children: s(M.total, M.currency)
434
+ children: c(j.total, j.currency)
406
435
  })]
407
436
  }),
408
- M.amountPaid > 0 && /* @__PURE__ */ _("div", {
437
+ j.amountPaid > 0 && /* @__PURE__ */ _("div", {
409
438
  className: "flex items-center justify-between text-sm",
410
439
  children: [/* @__PURE__ */ g("span", {
411
440
  className: "text-text-secondary",
412
- children: w("billing.invoices.amountPaid", "Amount Paid")
441
+ children: C("billing.invoices.amountPaid", "Amount Paid")
413
442
  }), /* @__PURE__ */ _("span", {
414
443
  className: "text-status-success-text",
415
- children: ["-", s(M.amountPaid, M.currency)]
444
+ children: ["-", c(j.amountPaid, j.currency)]
416
445
  })]
417
446
  }),
418
- Y > 0 && /* @__PURE__ */ _("div", {
447
+ Q > 0 && /* @__PURE__ */ _("div", {
419
448
  className: "flex items-center justify-between text-sm font-semibold border-t border-border-subtle pt-2",
420
449
  children: [/* @__PURE__ */ g("span", {
421
450
  className: "text-text-primary",
422
- children: w("billing.invoices.amountDue", "Amount Due")
451
+ children: C("billing.invoices.amountDue", "Amount Due")
423
452
  }), /* @__PURE__ */ g("span", {
424
453
  className: "text-status-warning-text",
425
- children: s(Y, M.currency)
454
+ children: c(Q, j.currency)
426
455
  })]
427
456
  })
428
457
  ]
@@ -430,13 +459,13 @@ var C = () => {
430
459
  })
431
460
  ]
432
461
  }),
433
- M.subscription && /* @__PURE__ */ _("div", {
462
+ j.subscription && /* @__PURE__ */ _("div", {
434
463
  className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 overflow-hidden",
435
464
  children: [/* @__PURE__ */ g("div", {
436
465
  className: "p-6 border-b border-border-subtle bg-bg-sunken",
437
466
  children: /* @__PURE__ */ g("h2", {
438
467
  className: "text-lg font-semibold text-text-primary",
439
- children: w("billing.invoices.subscription", "Subscription")
468
+ children: C("billing.invoices.subscription", "Subscription")
440
469
  })
441
470
  }), /* @__PURE__ */ g("div", {
442
471
  className: "p-6 space-y-4",
@@ -444,7 +473,7 @@ var C = () => {
444
473
  className: "flex items-center justify-between",
445
474
  children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
446
475
  className: "font-medium text-text-primary",
447
- children: M.subscription.plan?.name || "Unknown Plan"
476
+ children: j.subscription.plan?.name || "Unknown Plan"
448
477
  }), /* @__PURE__ */ _("p", {
449
478
  className: "text-sm text-text-secondary mt-0.5",
450
479
  children: [
@@ -452,25 +481,25 @@ var C = () => {
452
481
  " ",
453
482
  /* @__PURE__ */ g("span", {
454
483
  className: "font-mono text-xs",
455
- children: M.subscription.id
484
+ children: j.subscription.id
456
485
  })
457
486
  ]
458
487
  })] }), /* @__PURE__ */ g("button", {
459
488
  type: "button",
460
- onClick: () => E(d(`/subscriptions/${M.subscription.id}`, j)),
489
+ onClick: () => T(f(`/subscriptions/${j.subscription.id}`, A)),
461
490
  className: "px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-sunken rounded-button transition-colors",
462
491
  children: "View"
463
492
  })]
464
493
  })
465
494
  })]
466
495
  }),
467
- M.payment && /* @__PURE__ */ _("div", {
496
+ j.payment && /* @__PURE__ */ _("div", {
468
497
  className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 overflow-hidden",
469
498
  children: [/* @__PURE__ */ g("div", {
470
499
  className: "p-6 border-b border-border-subtle bg-bg-sunken",
471
500
  children: /* @__PURE__ */ g("h2", {
472
501
  className: "text-lg font-semibold text-text-primary",
473
- children: w("billing.invoices.payment", "Payment")
502
+ children: C("billing.invoices.payment", "Payment")
474
503
  })
475
504
  }), /* @__PURE__ */ g("div", {
476
505
  className: "p-6",
@@ -482,42 +511,42 @@ var C = () => {
482
511
  children: "Payment ID"
483
512
  }), /* @__PURE__ */ g("p", {
484
513
  className: "font-mono text-sm text-text-primary mt-0.5 break-all",
485
- children: M.payment.id
514
+ children: j.payment.id
486
515
  })] }),
487
516
  /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
488
517
  className: "text-sm text-text-secondary",
489
518
  children: "Amount"
490
519
  }), /* @__PURE__ */ g("p", {
491
520
  className: "text-sm text-text-primary mt-0.5",
492
- children: s(M.payment.amount, M.payment.currency)
521
+ children: c(j.payment.amount, j.payment.currency)
493
522
  })] }),
494
523
  /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
495
524
  className: "text-sm text-text-secondary",
496
525
  children: "Status"
497
526
  }), /* @__PURE__ */ g("p", {
498
527
  className: "text-sm text-text-primary mt-0.5 capitalize",
499
- children: M.payment.status.toLowerCase()
528
+ children: j.payment.status.toLowerCase()
500
529
  })] }),
501
530
  /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
502
531
  className: "text-sm text-text-secondary",
503
532
  children: "Method"
504
533
  }), /* @__PURE__ */ g("p", {
505
534
  className: "text-sm text-text-primary mt-0.5 capitalize",
506
- children: M.payment.method.toLowerCase().replace(/_/g, " ")
535
+ children: j.payment.method.toLowerCase().replace(/_/g, " ")
507
536
  })] }),
508
- M.payment.provider && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
537
+ j.payment.provider && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
509
538
  className: "text-sm text-text-secondary",
510
539
  children: "Provider"
511
540
  }), /* @__PURE__ */ g("p", {
512
541
  className: "text-sm text-text-primary mt-0.5 capitalize",
513
- children: M.payment.provider
542
+ children: j.payment.provider
514
543
  })] }),
515
- M.payment.paidAt && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
544
+ j.payment.paidAt && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
516
545
  className: "text-sm text-text-secondary",
517
546
  children: "Paid At"
518
547
  }), /* @__PURE__ */ g("p", {
519
548
  className: "text-sm text-text-primary mt-0.5",
520
- children: c(M.payment.paidAt, "short")
549
+ children: l(j.payment.paidAt, "short")
521
550
  })] })
522
551
  ]
523
552
  })
@@ -529,7 +558,7 @@ var C = () => {
529
558
  children: [
530
559
  /* @__PURE__ */ g(b, {
531
560
  storageKey: "billing-invoice-detail",
532
- steps: Q
561
+ steps: oe
533
562
  }),
534
563
  /* @__PURE__ */ _("div", {
535
564
  className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 overflow-hidden",
@@ -537,7 +566,7 @@ var C = () => {
537
566
  className: "p-6 border-b border-border-subtle bg-bg-sunken",
538
567
  children: /* @__PURE__ */ g("h2", {
539
568
  className: "text-lg font-semibold text-text-primary",
540
- children: w("billing.invoices.details", "Details")
569
+ children: C("billing.invoices.details", "Details")
541
570
  })
542
571
  }), /* @__PURE__ */ _("div", {
543
572
  className: "p-6 space-y-4",
@@ -547,56 +576,56 @@ var C = () => {
547
576
  children: "Invoice ID"
548
577
  }), /* @__PURE__ */ g("p", {
549
578
  className: "font-mono text-sm text-text-primary mt-0.5 break-all",
550
- children: M.id
579
+ children: j.id
551
580
  })] }),
552
581
  /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
553
582
  className: "text-sm text-text-secondary",
554
583
  children: "Invoice Number"
555
584
  }), /* @__PURE__ */ g("p", {
556
585
  className: "text-sm text-text-primary mt-0.5",
557
- children: l(M.invoiceNumber)
586
+ children: u(j.invoiceNumber)
558
587
  })] }),
559
- M.itemDescription && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
588
+ j.itemDescription && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
560
589
  className: "text-sm text-text-secondary",
561
590
  children: "Description"
562
591
  }), /* @__PURE__ */ g("p", {
563
592
  className: "text-sm text-text-primary mt-0.5",
564
- children: M.itemDescription
593
+ children: j.itemDescription
565
594
  })] }),
566
595
  /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
567
596
  className: "text-sm text-text-secondary",
568
597
  children: "Status"
569
598
  }), /* @__PURE__ */ g("span", {
570
- className: `inline-flex mt-0.5 px-2 py-1 text-xs font-medium rounded ${p(G)}`,
571
- children: u(M.status)
599
+ className: `inline-flex mt-0.5 px-2 py-1 text-xs font-medium rounded ${p(Y)}`,
600
+ children: d(j.status)
572
601
  })] }),
573
602
  /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
574
603
  className: "text-sm text-text-secondary",
575
604
  children: "Currency"
576
605
  }), /* @__PURE__ */ g("p", {
577
606
  className: "text-sm text-text-primary mt-0.5",
578
- children: M.currency
607
+ children: j.currency
579
608
  })] }),
580
609
  /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
581
610
  className: "text-sm text-text-secondary",
582
611
  children: "Total"
583
612
  }), /* @__PURE__ */ g("p", {
584
613
  className: "text-sm font-semibold text-text-primary mt-0.5",
585
- children: s(M.total, M.currency)
614
+ children: c(j.total, j.currency)
586
615
  })] }),
587
616
  /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
588
617
  className: "text-sm text-text-secondary",
589
618
  children: "Amount Paid"
590
619
  }), /* @__PURE__ */ g("p", {
591
620
  className: "text-sm text-status-success-text mt-0.5",
592
- children: s(M.amountPaid, M.currency)
621
+ children: c(j.amountPaid, j.currency)
593
622
  })] }),
594
- Y > 0 && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
623
+ Q > 0 && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
595
624
  className: "text-sm text-text-secondary",
596
625
  children: "Amount Due"
597
626
  }), /* @__PURE__ */ g("p", {
598
627
  className: "text-sm font-semibold text-status-warning-text mt-0.5",
599
- children: s(Y, M.currency)
628
+ children: c(Q, j.currency)
600
629
  })] })
601
630
  ]
602
631
  })]
@@ -607,7 +636,7 @@ var C = () => {
607
636
  className: "p-6 border-b border-border-subtle bg-bg-sunken",
608
637
  children: /* @__PURE__ */ g("h2", {
609
638
  className: "text-lg font-semibold text-text-primary",
610
- children: w("billing.invoices.dates", "Dates")
639
+ children: C("billing.invoices.dates", "Dates")
611
640
  })
612
641
  }), /* @__PURE__ */ _("div", {
613
642
  className: "p-6 space-y-4",
@@ -617,28 +646,28 @@ var C = () => {
617
646
  children: "Created"
618
647
  }), /* @__PURE__ */ g("p", {
619
648
  className: "text-sm text-text-primary mt-0.5",
620
- children: c(M.createdAt)
649
+ children: l(j.createdAt)
621
650
  })] }),
622
- M.dueDate && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
651
+ j.dueDate && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
623
652
  className: "text-sm text-text-secondary",
624
653
  children: "Due Date"
625
654
  }), /* @__PURE__ */ g("p", {
626
655
  className: "text-sm text-text-primary mt-0.5",
627
- children: c(M.dueDate)
656
+ children: l(j.dueDate)
628
657
  })] }),
629
- M.paidAt && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
658
+ j.paidAt && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
630
659
  className: "text-sm text-text-secondary",
631
660
  children: "Paid At"
632
661
  }), /* @__PURE__ */ g("p", {
633
662
  className: "text-sm text-text-primary mt-0.5",
634
- children: c(M.paidAt)
663
+ children: l(j.paidAt)
635
664
  })] }),
636
665
  /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
637
666
  className: "text-sm text-text-secondary",
638
667
  children: "Last Updated"
639
668
  }), /* @__PURE__ */ g("p", {
640
669
  className: "text-sm text-text-primary mt-0.5",
641
- children: c(M.updatedAt)
670
+ children: l(j.updatedAt)
642
671
  })] })
643
672
  ]
644
673
  })]
@@ -649,7 +678,7 @@ var C = () => {
649
678
  className: "p-6 border-b border-border-subtle bg-bg-sunken",
650
679
  children: /* @__PURE__ */ g("h2", {
651
680
  className: "text-lg font-semibold text-text-primary",
652
- children: w("billing.invoices.organization", "Organization")
681
+ children: C("billing.invoices.organization", "Organization")
653
682
  })
654
683
  }), /* @__PURE__ */ g("div", {
655
684
  className: "p-6 space-y-4",
@@ -658,7 +687,7 @@ var C = () => {
658
687
  children: "Organization ID"
659
688
  }), /* @__PURE__ */ g("p", {
660
689
  className: "font-mono text-sm text-text-primary mt-0.5 break-all",
661
- children: M.orgId
690
+ children: j.orgId
662
691
  })] })
663
692
  })]
664
693
  })
@@ -668,6 +697,6 @@ var C = () => {
668
697
  ]
669
698
  });
670
699
  };
671
- export { C as InvoiceDetailPage };
700
+ export { S as InvoiceDetailPage };
672
701
 
673
702
  //# sourceMappingURL=InvoiceDetailPage.js.map