@burdenoff/microfe-billing 2026.1116.1 → 2026.1119.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/billing/modules/addons/pages/AddonCreatePage.js +143 -143
  2. package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
  3. package/dist/billing/modules/addons/pages/AddonEditPage.js +170 -170
  4. package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
  5. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +148 -148
  6. package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
  7. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +115 -115
  8. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js.map +1 -1
  9. package/dist/billing/modules/billing/pages/InvoicesListPage.js +136 -136
  10. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
  11. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +129 -129
  12. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js.map +1 -1
  13. package/dist/billing/modules/billing/pages/RefundsPage.js +325 -325
  14. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  15. package/dist/billing/modules/billing/pages/UserRefundsPage.js +149 -149
  16. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  17. package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js +99 -98
  18. package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js.map +1 -1
  19. package/dist/billing/modules/checkout/components/StoreShippingSection.js +125 -124
  20. package/dist/billing/modules/checkout/components/StoreShippingSection.js.map +1 -1
  21. package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js +61 -60
  22. package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js.map +1 -1
  23. package/dist/billing/modules/coupons/pages/CouponsListPage.js +177 -177
  24. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
  25. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +231 -231
  26. package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
  27. package/dist/billing/modules/coupons/pages/EditCouponPage.js +139 -139
  28. package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -1
  29. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +54 -54
  30. package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
  31. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +65 -65
  32. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
  33. package/dist/billing/modules/credits/pages/CreditsPage.js +95 -95
  34. package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
  35. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js +232 -231
  36. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js.map +1 -1
  37. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +328 -328
  38. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  39. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +57 -57
  40. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
  41. package/dist/billing/modules/earnings/pages/EarningsPage.js +53 -53
  42. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  43. package/dist/billing/modules/earnings/pages/PayoutsPage.js +100 -100
  44. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  45. package/dist/billing/modules/plans/pages/PlanCreatePage.js +150 -150
  46. package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
  47. package/dist/billing/modules/plans/pages/PlanEditPage.js +125 -125
  48. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  49. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +113 -113
  50. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
  51. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +132 -132
  52. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
  53. package/dist/billing/modules/settings/pages/SettingsPage.js +101 -101
  54. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  55. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +125 -125
  56. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  57. package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js +51 -50
  58. package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js.map +1 -1
  59. package/dist/billing/modules/usage/pages/UsagePage.js +107 -107
  60. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  61. package/dist/billing/shared/components/GeoPricingOverridesEditor.js +1 -0
  62. package/package.json +2 -2
@@ -14,79 +14,79 @@ import { useIsFluidgridsVariant as m } from "../../../hooks/useBillingVariant.js
14
14
  import { useTr as h } from "../../../shared/hooks/useTr.js";
15
15
  import { nativeConfirm as g, nativeImpact as _, nativeNotify as v } from "../../../../utils/nativeBridge.js";
16
16
  import { useCallback as y, useEffect as b, useMemo as x, useRef as S, useState as C } from "react";
17
- import { IllustratedEmptyState as w, PagePurpose as T } from "@burdenoff/fe-libs/ui";
18
- import { RotateCcw as E } from "lucide-react";
19
- import { useSearchParams as D } from "react-router";
20
- import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
17
+ import { IllustratedEmptyState as w, PagePurpose as T, ThemedSelect as E } from "@burdenoff/fe-libs/ui";
18
+ import { RotateCcw as D } from "lucide-react";
19
+ import { useSearchParams as O } from "react-router";
20
+ import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
21
21
  // src/billing/modules/billing/pages/InvoicesListPage.tsx
22
- var j = () => {
23
- let t = h(), i = m(), s = e(), c = a(), [l] = D(), p = l.get("billingAccountId") ?? void 0, { data: g } = o({ fetchPolicy: "cache-first" }), _ = x(() => g?.getBillingAccountsByOrg ?? [], [g]), { payInvoice: j, voidInvoice: N } = n(), [P, F] = C(null), [I, L] = C(null), [R, z] = C(p);
22
+ var M = () => {
23
+ let t = h(), i = m(), s = e(), c = a(), [l] = O(), p = l.get("billingAccountId") ?? void 0, { data: g } = o({ fetchPolicy: "cache-first" }), _ = x(() => g?.getBillingAccountsByOrg ?? [], [g]), { payInvoice: M, voidInvoice: P } = n(), [F, I] = C(null), [L, R] = C(null), [z, B] = C(p);
24
24
  b(() => {
25
- z(p);
25
+ B(p);
26
26
  }, [p]);
27
- let ee = x(() => (_.find((e) => e.isDefault) ?? _[0])?.id ?? void 0, [_]), B = R === void 0 ? ee ?? null : R, [V, H] = C("all"), [U, te] = C(""), [W, ne] = C(""), [G, K] = C(1), q = S(null);
27
+ let ee = x(() => (_.find((e) => e.isDefault) ?? _[0])?.id ?? void 0, [_]), V = z === void 0 ? ee ?? null : z, [H, te] = C("all"), [U, ne] = C(""), [W, re] = C(""), [G, K] = C(1), q = S(null);
28
28
  b(() => (q.current && clearTimeout(q.current), q.current = setTimeout(() => {
29
- ne(U), K(1);
29
+ re(U), K(1);
30
30
  }, 400), () => {
31
31
  q.current && clearTimeout(q.current);
32
32
  }), [U]);
33
33
  let { invoices: J, totalPages: Y, isLoading: X, error: Z, refetch: Q } = r({
34
- billingAccountId: B ?? void 0,
35
- status: V === "all" ? void 0 : V,
34
+ billingAccountId: V ?? void 0,
35
+ status: H === "all" ? void 0 : H,
36
36
  search: W || void 0,
37
37
  page: G,
38
38
  pageSize: 20
39
- }), re = y(async (e) => {
39
+ }), ie = y(async (e) => {
40
40
  let t = e.billingAccountId, n = t ? _.find((e) => e.id === t)?.defaultPaymentMethod : void 0;
41
- if (!t) F("No billing account context");
42
- else if (!n) F("Add and set a default payment method before paying this invoice.");
41
+ if (!t) I("No billing account context");
42
+ else if (!n) I("Add and set a default payment method before paying this invoice.");
43
43
  else {
44
- F(null), L({
44
+ I(null), R({
45
45
  invoiceId: e.id,
46
46
  action: "pay"
47
47
  });
48
48
  try {
49
- await j(e.id, n, t), await Q(), v("success");
49
+ await M(e.id, n, t), await Q(), v("success");
50
50
  } catch (e) {
51
- F(e instanceof Error ? e.message : "Failed to pay invoice"), v("error");
51
+ I(e instanceof Error ? e.message : "Failed to pay invoice"), v("error");
52
52
  } finally {
53
- L(null);
53
+ R(null);
54
54
  }
55
55
  }
56
56
  }, [
57
57
  _,
58
- j,
58
+ M,
59
59
  Q
60
- ]), ie = y(async (e) => {
60
+ ]), ae = y(async (e) => {
61
61
  let t = e.billingAccountId;
62
- if (!t) F("No billing account context");
62
+ if (!t) I("No billing account context");
63
63
  else {
64
- F(null), L({
64
+ I(null), R({
65
65
  invoiceId: e.id,
66
66
  action: "void"
67
67
  });
68
68
  try {
69
- await N(e.id, t), await Q(), v("success");
69
+ await P(e.id, t), await Q(), v("success");
70
70
  } catch (e) {
71
- F(e instanceof Error ? e.message : "Failed to void invoice"), v("error");
71
+ I(e instanceof Error ? e.message : "Failed to void invoice"), v("error");
72
72
  } finally {
73
- L(null);
73
+ R(null);
74
74
  }
75
75
  }
76
- }, [Q, N]);
77
- if (!c.canViewInvoices) return /* @__PURE__ */ k("div", {
76
+ }, [Q, P]);
77
+ if (!c.canViewInvoices) return /* @__PURE__ */ A("div", {
78
78
  className: "flex items-center justify-center h-full min-h-[400px]",
79
- children: /* @__PURE__ */ A("div", {
79
+ children: /* @__PURE__ */ j("div", {
80
80
  className: "text-center space-y-2",
81
81
  children: [
82
- /* @__PURE__ */ k("div", {
82
+ /* @__PURE__ */ A("div", {
83
83
  className: "size-12 mx-auto rounded-full bg-bg-sunken flex items-center justify-center",
84
- children: /* @__PURE__ */ k("svg", {
84
+ children: /* @__PURE__ */ A("svg", {
85
85
  className: "size-6 text-text-secondary",
86
86
  fill: "none",
87
87
  viewBox: "0 0 24 24",
88
88
  stroke: "currentColor",
89
- children: /* @__PURE__ */ k("path", {
89
+ children: /* @__PURE__ */ A("path", {
90
90
  strokeLinecap: "round",
91
91
  strokeLinejoin: "round",
92
92
  strokeWidth: 2,
@@ -94,20 +94,20 @@ var j = () => {
94
94
  })
95
95
  })
96
96
  }),
97
- /* @__PURE__ */ k("h2", {
97
+ /* @__PURE__ */ A("h2", {
98
98
  className: "text-lg font-semibold text-text-primary",
99
99
  children: t("billing.accessDenied.title", "Access Denied")
100
100
  }),
101
- /* @__PURE__ */ k("p", {
101
+ /* @__PURE__ */ A("p", {
102
102
  className: "text-sm text-text-secondary max-w-sm",
103
103
  children: t("billing.invoices.noViewPermission", "You don't have permission to view invoices.")
104
104
  })
105
105
  ]
106
106
  })
107
107
  });
108
- if (X && J.length === 0) return /* @__PURE__ */ A("div", {
108
+ if (X && J.length === 0) return /* @__PURE__ */ j("div", {
109
109
  className: "space-y-6 p-6",
110
- children: [/* @__PURE__ */ k("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ k("div", {
110
+ children: [/* @__PURE__ */ A("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ A("div", {
111
111
  className: "space-y-3",
112
112
  children: [
113
113
  1,
@@ -115,31 +115,31 @@ var j = () => {
115
115
  3,
116
116
  4,
117
117
  5
118
- ].map((e) => /* @__PURE__ */ k("div", {
118
+ ].map((e) => /* @__PURE__ */ A("div", {
119
119
  className: "border border-border-subtle rounded-lg p-4",
120
- children: /* @__PURE__ */ A("div", {
120
+ children: /* @__PURE__ */ j("div", {
121
121
  className: "flex items-center gap-4",
122
- children: [/* @__PURE__ */ k("div", { className: "size-10 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ A("div", {
122
+ children: [/* @__PURE__ */ A("div", { className: "size-10 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ j("div", {
123
123
  className: "flex-1 space-y-2",
124
- children: [/* @__PURE__ */ k("div", { className: "h-4 w-32 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ k("div", { className: "h-3 w-48 bg-bg-sunken animate-pulse rounded" })]
124
+ children: [/* @__PURE__ */ A("div", { className: "h-4 w-32 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ A("div", { className: "h-3 w-48 bg-bg-sunken animate-pulse rounded" })]
125
125
  })]
126
126
  })
127
127
  }, e))
128
128
  })]
129
129
  });
130
- if (Z) return /* @__PURE__ */ k("div", {
130
+ if (Z) return /* @__PURE__ */ A("div", {
131
131
  className: "flex items-center justify-center h-full min-h-[400px]",
132
- children: /* @__PURE__ */ A("div", {
132
+ children: /* @__PURE__ */ j("div", {
133
133
  className: "text-center space-y-4",
134
134
  children: [
135
- /* @__PURE__ */ k("div", {
135
+ /* @__PURE__ */ A("div", {
136
136
  className: "size-12 mx-auto rounded-full bg-status-error-bg-subtle flex items-center justify-center",
137
- children: /* @__PURE__ */ k("svg", {
137
+ children: /* @__PURE__ */ A("svg", {
138
138
  className: "size-6 text-status-error-text",
139
139
  fill: "none",
140
140
  viewBox: "0 0 24 24",
141
141
  stroke: "currentColor",
142
- children: /* @__PURE__ */ k("path", {
142
+ children: /* @__PURE__ */ A("path", {
143
143
  strokeLinecap: "round",
144
144
  strokeLinejoin: "round",
145
145
  strokeWidth: 2,
@@ -147,15 +147,15 @@ var j = () => {
147
147
  })
148
148
  })
149
149
  }),
150
- /* @__PURE__ */ k("h2", {
150
+ /* @__PURE__ */ A("h2", {
151
151
  className: "text-lg font-semibold text-text-primary",
152
152
  children: t("billing.invoices.failedToLoad", "Failed to load invoices")
153
153
  }),
154
- /* @__PURE__ */ k("p", {
154
+ /* @__PURE__ */ A("p", {
155
155
  className: "text-sm text-text-secondary",
156
156
  children: Z.message
157
157
  }),
158
- /* @__PURE__ */ k("button", {
158
+ /* @__PURE__ */ A("button", {
159
159
  type: "button",
160
160
  onClick: () => Q(),
161
161
  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",
@@ -164,66 +164,66 @@ var j = () => {
164
164
  ]
165
165
  })
166
166
  });
167
- let $ = _.length > 1 ? /* @__PURE__ */ A("div", {
167
+ let $ = _.length > 1 ? /* @__PURE__ */ j("div", {
168
168
  className: i ? "flex w-full min-w-0 items-center gap-2 sm:w-auto" : "flex items-center gap-2",
169
- children: [/* @__PURE__ */ k("label", {
169
+ children: [/* @__PURE__ */ A("label", {
170
170
  className: "text-sm text-text-secondary whitespace-nowrap",
171
171
  children: t("billing.invoices.billingAccountLabel", "Billing Account")
172
- }), /* @__PURE__ */ A("select", {
173
- value: B ?? "",
174
- onChange: (e) => z(e.target.value || null),
172
+ }), /* @__PURE__ */ j(E, {
173
+ value: V ?? "",
174
+ onChange: (e) => B(e.target.value || null),
175
175
  className: `${i ? "min-w-0 flex-1 truncate sm:max-w-xs sm:flex-none " : ""}text-sm border border-border-subtle rounded-button bg-bg-surface text-text-primary px-3 py-2 focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary`,
176
- children: [/* @__PURE__ */ k("option", {
176
+ children: [/* @__PURE__ */ A("option", {
177
177
  value: "",
178
178
  children: t("billing.invoices.allAccounts", "All Accounts")
179
- }), _.map((e) => /* @__PURE__ */ A("option", {
179
+ }), _.map((e) => /* @__PURE__ */ j("option", {
180
180
  value: e.id ?? "",
181
181
  children: [e.name ?? e.email ?? e.id, e.isDefault ? t("billing.invoices.defaultSuffix", " (Default)") : ""]
182
182
  }, e.id ?? ""))]
183
183
  })]
184
184
  }) : null;
185
- return /* @__PURE__ */ A("div", {
185
+ return /* @__PURE__ */ j("div", {
186
186
  className: "space-y-6 px-6 lg:px-8 py-6",
187
187
  children: [
188
- /* @__PURE__ */ A("div", {
188
+ /* @__PURE__ */ j("div", {
189
189
  className: i ? "flex flex-col gap-4 xl:flex-row xl:items-start xl:justify-between" : "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
190
- children: [/* @__PURE__ */ A("div", {
190
+ children: [/* @__PURE__ */ j("div", {
191
191
  className: i ? "min-w-0 xl:max-w-3xl" : void 0,
192
192
  children: [
193
- /* @__PURE__ */ k("h1", {
193
+ /* @__PURE__ */ A("h1", {
194
194
  className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
195
195
  children: t("billing.invoices.title", "Invoices")
196
196
  }),
197
- /* @__PURE__ */ k("p", {
197
+ /* @__PURE__ */ A("p", {
198
198
  className: "text-sm text-text-secondary mt-1",
199
199
  children: t("billing.invoices.subtitle", "View and manage your billing invoices")
200
200
  }),
201
- /* @__PURE__ */ k(T, {
201
+ /* @__PURE__ */ A(T, {
202
202
  className: "mt-3",
203
203
  children: t("billing.invoices.purpose", "A record of everything you have been billed for — subscriptions, add-ons and one-off charges. Open an invoice to see line items, download the PDF, pay an outstanding amount, or request a refund.")
204
204
  }),
205
- i && /* @__PURE__ */ k("div", {
205
+ i && /* @__PURE__ */ A("div", {
206
206
  className: "mt-4",
207
- children: /* @__PURE__ */ k(d, {
207
+ children: /* @__PURE__ */ A(d, {
208
208
  active: "invoices",
209
- billingAccountId: B
209
+ billingAccountId: V
210
210
  })
211
211
  })
212
212
  ]
213
- }), !i && /* @__PURE__ */ A("div", {
213
+ }), !i && /* @__PURE__ */ j("div", {
214
214
  className: "flex items-center gap-3",
215
- children: [/* @__PURE__ */ A("button", {
215
+ children: [/* @__PURE__ */ j("button", {
216
216
  type: "button",
217
217
  onClick: () => s("/refunds"),
218
218
  className: "inline-flex items-center gap-2 whitespace-nowrap px-3 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken hover:border-border-strong transition-all duration-200",
219
- children: [/* @__PURE__ */ k(E, { className: "size-4" }), t("billing.invoices.myRefunds", "My Refunds")]
219
+ children: [/* @__PURE__ */ A(D, { className: "size-4" }), t("billing.invoices.myRefunds", "My Refunds")]
220
220
  }), $]
221
221
  })]
222
222
  }),
223
- /* @__PURE__ */ A("div", {
223
+ /* @__PURE__ */ j("div", {
224
224
  className: "flex flex-wrap items-center gap-4 pb-4 border-b border-border-subtle",
225
225
  children: [
226
- /* @__PURE__ */ k("div", {
226
+ /* @__PURE__ */ A("div", {
227
227
  className: "inline-flex rounded-lg border border-border-subtle p-1 bg-bg-sunken flex-wrap",
228
228
  children: [
229
229
  "all",
@@ -231,122 +231,122 @@ var j = () => {
231
231
  "PAID",
232
232
  "DRAFT",
233
233
  "VOID"
234
- ].map((e) => /* @__PURE__ */ k("button", {
234
+ ].map((e) => /* @__PURE__ */ A("button", {
235
235
  type: "button",
236
236
  onClick: () => {
237
- H(e), K(1);
237
+ te(e), K(1);
238
238
  },
239
- className: `px-3 py-1.5 text-sm font-medium rounded-button transition-colors ${V === e ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-secondary hover:text-text-primary"}`,
239
+ className: `px-3 py-1.5 text-sm font-medium rounded-button transition-colors ${H === e ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-secondary hover:text-text-primary"}`,
240
240
  children: e === "all" ? "All" : u(e)
241
241
  }, e))
242
242
  }),
243
- /* @__PURE__ */ A("div", {
243
+ /* @__PURE__ */ j("div", {
244
244
  className: "relative flex-1 min-w-0 w-full sm:max-w-md",
245
- children: [/* @__PURE__ */ k("svg", {
245
+ children: [/* @__PURE__ */ A("svg", {
246
246
  className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-text-secondary",
247
247
  fill: "none",
248
248
  viewBox: "0 0 24 24",
249
249
  stroke: "currentColor",
250
- children: /* @__PURE__ */ k("path", {
250
+ children: /* @__PURE__ */ A("path", {
251
251
  strokeLinecap: "round",
252
252
  strokeLinejoin: "round",
253
253
  strokeWidth: 2,
254
254
  d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
255
255
  })
256
- }), /* @__PURE__ */ k("input", {
256
+ }), /* @__PURE__ */ A("input", {
257
257
  type: "text",
258
258
  placeholder: t("billing.invoices.searchPlaceholder", "Search by invoice number..."),
259
259
  value: U,
260
- onChange: (e) => te(e.target.value),
260
+ onChange: (e) => ne(e.target.value),
261
261
  className: "w-full pl-[3.25rem] pr-4 py-2 text-sm border border-border-subtle rounded-button bg-bg-surface text-text-primary placeholder:text-text-placeholder focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:border-transparent"
262
262
  })]
263
263
  }),
264
- i && $ ? /* @__PURE__ */ k("div", {
264
+ i && $ ? /* @__PURE__ */ A("div", {
265
265
  className: "w-full sm:ml-auto sm:w-auto",
266
266
  children: $
267
267
  }) : null
268
268
  ]
269
269
  }),
270
- P && /* @__PURE__ */ k("div", {
270
+ F && /* @__PURE__ */ A("div", {
271
271
  className: "rounded-button border border-status-error-border bg-status-error-bg-subtle p-3",
272
- children: /* @__PURE__ */ k("p", {
272
+ children: /* @__PURE__ */ A("p", {
273
273
  className: "text-sm text-status-error-text",
274
- children: P
274
+ children: F
275
275
  })
276
276
  }),
277
- !X && J.length === 0 ? /* @__PURE__ */ k(w, {
278
- illustration: V !== "all" || W ? "empty-search" : "empty-files",
277
+ !X && J.length === 0 ? /* @__PURE__ */ A(w, {
278
+ illustration: H !== "all" || W ? "empty-search" : "empty-files",
279
279
  title: t("billing.invoices.noInvoicesFound", "No invoices found"),
280
- description: V !== "all" || W ? t("billing.invoices.noInvoicesFiltered", "No invoices match your filters.") : t("billing.invoices.noInvoicesYet", "You don't have any invoices yet.")
281
- }) : /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("div", {
280
+ description: H !== "all" || W ? t("billing.invoices.noInvoicesFiltered", "No invoices match your filters.") : t("billing.invoices.noInvoicesYet", "You don't have any invoices yet.")
281
+ }) : /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A("div", {
282
282
  className: `border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 ${i ? "overflow-x-auto" : "overflow-hidden"}`,
283
- children: /* @__PURE__ */ A("table", {
283
+ children: /* @__PURE__ */ j("table", {
284
284
  className: "w-full",
285
- children: [/* @__PURE__ */ k("thead", {
285
+ children: [/* @__PURE__ */ A("thead", {
286
286
  className: "bg-bg-sunken",
287
- children: /* @__PURE__ */ A("tr", { children: [
288
- /* @__PURE__ */ k("th", {
287
+ children: /* @__PURE__ */ j("tr", { children: [
288
+ /* @__PURE__ */ A("th", {
289
289
  className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted",
290
290
  children: t("billing.invoices.invoice", "Invoice")
291
291
  }),
292
- /* @__PURE__ */ k("th", {
292
+ /* @__PURE__ */ A("th", {
293
293
  className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted",
294
294
  children: t("billing.common.status", "Status")
295
295
  }),
296
- !B && _.length > 1 && /* @__PURE__ */ k("th", {
296
+ !V && _.length > 1 && /* @__PURE__ */ A("th", {
297
297
  className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted hidden lg:table-cell",
298
298
  children: t("billing.common.account", "Account")
299
299
  }),
300
- /* @__PURE__ */ k("th", {
300
+ /* @__PURE__ */ A("th", {
301
301
  className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted hidden sm:table-cell",
302
302
  children: t("billing.common.date", "Date")
303
303
  }),
304
- /* @__PURE__ */ k("th", {
304
+ /* @__PURE__ */ A("th", {
305
305
  className: "text-left px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted hidden md:table-cell",
306
306
  children: t("billing.common.dueDate", "Due Date")
307
307
  }),
308
- /* @__PURE__ */ k("th", {
308
+ /* @__PURE__ */ A("th", {
309
309
  className: "text-right px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted",
310
310
  children: t("billing.common.amount", "Amount")
311
311
  }),
312
- /* @__PURE__ */ k("th", {
312
+ /* @__PURE__ */ A("th", {
313
313
  className: "text-right px-4 py-3 text-xs font-medium uppercase tracking-wide text-text-muted",
314
314
  children: t("billing.common.actions", "Actions")
315
315
  })
316
316
  ] })
317
- }), /* @__PURE__ */ k("tbody", {
317
+ }), /* @__PURE__ */ A("tbody", {
318
318
  className: "divide-y divide-border-subtle",
319
- children: J.map((e) => /* @__PURE__ */ k(M, {
319
+ children: J.map((e) => /* @__PURE__ */ A(N, {
320
320
  invoice: e,
321
321
  onView: () => s(f(`/invoices/${e.id}`, e.billingAccountId)),
322
322
  canPay: c.canPayInvoice,
323
323
  canVoid: c.canVoidInvoice,
324
- onPay: re,
325
- onVoid: ie,
326
- isProcessing: I?.invoiceId === e.id,
327
- processingAction: I?.invoiceId === e.id ? I.action : void 0,
328
- showAccount: !B && _.length > 1,
324
+ onPay: ie,
325
+ onVoid: ae,
326
+ isProcessing: L?.invoiceId === e.id,
327
+ processingAction: L?.invoiceId === e.id ? L.action : void 0,
328
+ showAccount: !V && _.length > 1,
329
329
  accountName: _.find((t) => t.id === e.billingAccountId)?.name ?? null
330
330
  }, e.id))
331
331
  })]
332
332
  })
333
- }), Y > 1 && /* @__PURE__ */ A("div", {
333
+ }), Y > 1 && /* @__PURE__ */ j("div", {
334
334
  className: "flex items-center justify-between pt-2",
335
- children: [/* @__PURE__ */ k("p", {
335
+ children: [/* @__PURE__ */ A("p", {
336
336
  className: "text-sm text-text-secondary",
337
337
  children: t("billing.common.pageOf", "Page {{page}} of {{totalPages}}", {
338
338
  page: G,
339
339
  totalPages: Y
340
340
  })
341
- }), /* @__PURE__ */ A("div", {
341
+ }), /* @__PURE__ */ j("div", {
342
342
  className: "flex items-center gap-2",
343
- children: [/* @__PURE__ */ k("button", {
343
+ children: [/* @__PURE__ */ A("button", {
344
344
  type: "button",
345
345
  onClick: () => K((e) => Math.max(1, e - 1)),
346
346
  disabled: G <= 1,
347
347
  className: "px-3 py-1.5 text-sm font-medium border border-border-subtle rounded-button bg-bg-surface text-text-primary hover:bg-bg-sunken disabled:opacity-40 disabled:cursor-not-allowed transition-colors",
348
348
  children: t("billing.common.previous", "Previous")
349
- }), /* @__PURE__ */ k("button", {
349
+ }), /* @__PURE__ */ A("button", {
350
350
  type: "button",
351
351
  onClick: () => K((e) => Math.min(Y, e + 1)),
352
352
  disabled: G >= Y,
@@ -357,8 +357,8 @@ var j = () => {
357
357
  })] })
358
358
  ]
359
359
  });
360
- }, M = ({ invoice: e, onView: n, onPay: r, onVoid: a, canPay: o, canVoid: d, isProcessing: f, processingAction: v, showAccount: y = !1, accountName: b }) => {
361
- let x = h(), S = m(), [w, T] = C(!1), [E, D] = C(!1), O = p(e.status), j = e.status === "OPEN", M = e.status === "DRAFT", N = async () => {
360
+ }, N = ({ invoice: e, onView: n, onPay: r, onVoid: a, canPay: o, canVoid: d, isProcessing: f, processingAction: v, showAccount: y = !1, accountName: b }) => {
361
+ let x = h(), S = m(), [w, T] = C(!1), [E, D] = C(!1), O = p(e.status), k = e.status === "OPEN", M = e.status === "DRAFT", N = async () => {
362
362
  _("medium");
363
363
  let t = await g({
364
364
  title: "Void invoice",
@@ -374,96 +374,96 @@ var j = () => {
374
374
  }, I = async () => {
375
375
  await a(e), T(!1);
376
376
  }, L = e.metadata?.invoicePdfBackupUrl;
377
- return /* @__PURE__ */ A("tr", {
377
+ return /* @__PURE__ */ j("tr", {
378
378
  className: "hover:bg-bg-sunken transition-colors",
379
379
  children: [
380
- /* @__PURE__ */ A("td", {
380
+ /* @__PURE__ */ j("td", {
381
381
  className: "p-4",
382
- children: [e.invoiceUrl ? /* @__PURE__ */ k("a", {
382
+ children: [e.invoiceUrl ? /* @__PURE__ */ A("a", {
383
383
  href: e.invoiceUrl,
384
384
  target: "_blank",
385
385
  rel: "noopener noreferrer",
386
386
  className: "font-medium text-text-primary hover:text-text-link transition-colors",
387
387
  children: l(e.invoiceNumber)
388
- }) : /* @__PURE__ */ k("button", {
388
+ }) : /* @__PURE__ */ A("button", {
389
389
  type: "button",
390
390
  onClick: n,
391
391
  className: "font-medium text-text-primary hover:text-text-link transition-colors",
392
392
  children: l(e.invoiceNumber)
393
- }), (e.itemDescription ?? e.subscription?.plan?.name) && /* @__PURE__ */ k("p", {
393
+ }), (e.itemDescription ?? e.subscription?.plan?.name) && /* @__PURE__ */ A("p", {
394
394
  className: "text-sm text-text-secondary mt-0.5",
395
395
  children: e.itemDescription ?? e.subscription?.plan?.name
396
396
  })]
397
397
  }),
398
- /* @__PURE__ */ k("td", {
398
+ /* @__PURE__ */ A("td", {
399
399
  className: "p-4",
400
- children: /* @__PURE__ */ k(t, {
400
+ children: /* @__PURE__ */ A(t, {
401
401
  status: O,
402
402
  dot: !0,
403
403
  children: u(e.status)
404
404
  })
405
405
  }),
406
- y && /* @__PURE__ */ k("td", {
406
+ y && /* @__PURE__ */ A("td", {
407
407
  className: "p-4 hidden lg:table-cell",
408
- children: b ? /* @__PURE__ */ k("span", {
408
+ children: b ? /* @__PURE__ */ A("span", {
409
409
  className: "inline-flex items-center px-2 py-0.5 text-xs font-medium rounded-full bg-bg-sunken text-text-secondary border border-border-subtle",
410
410
  children: b
411
- }) : /* @__PURE__ */ k("span", {
411
+ }) : /* @__PURE__ */ A("span", {
412
412
  className: "text-sm text-text-secondary",
413
413
  children: ", "
414
414
  })
415
415
  }),
416
- /* @__PURE__ */ k("td", {
416
+ /* @__PURE__ */ A("td", {
417
417
  className: "p-4 text-sm text-text-secondary hidden sm:table-cell",
418
418
  children: c(e.createdAt, "short")
419
419
  }),
420
- /* @__PURE__ */ k("td", {
420
+ /* @__PURE__ */ A("td", {
421
421
  className: "p-4 text-sm text-text-secondary hidden md:table-cell",
422
422
  children: e.dueDate ? c(e.dueDate, "short") : "—"
423
423
  }),
424
- /* @__PURE__ */ k("td", {
424
+ /* @__PURE__ */ A("td", {
425
425
  className: `p-4 text-right font-medium text-text-primary ${S ? "whitespace-nowrap" : ""}`,
426
426
  children: s(e.total, e.currency)
427
427
  }),
428
- /* @__PURE__ */ k("td", {
428
+ /* @__PURE__ */ A("td", {
429
429
  className: "p-4 text-right",
430
- children: /* @__PURE__ */ A("div", {
430
+ children: /* @__PURE__ */ j("div", {
431
431
  className: `relative flex items-center justify-end ${S ? "flex-wrap gap-1" : "gap-2"}`,
432
432
  children: [
433
- e.invoiceUrl ? /* @__PURE__ */ k("a", {
433
+ e.invoiceUrl ? /* @__PURE__ */ A("a", {
434
434
  href: e.invoiceUrl,
435
435
  target: "_blank",
436
436
  rel: "noopener noreferrer",
437
437
  className: "px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-sunken rounded-button transition-colors duration-200",
438
438
  children: x("billing.common.view", "View")
439
- }) : /* @__PURE__ */ k("button", {
439
+ }) : /* @__PURE__ */ A("button", {
440
440
  type: "button",
441
441
  onClick: n,
442
442
  className: "px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-sunken rounded-button transition-colors duration-200",
443
443
  children: x("billing.common.view", "View")
444
444
  }),
445
- e.pdfUrl && /* @__PURE__ */ k("a", {
445
+ e.pdfUrl && /* @__PURE__ */ A("a", {
446
446
  href: e.pdfUrl,
447
447
  target: "_blank",
448
448
  rel: "noopener noreferrer",
449
449
  className: "px-3 py-1.5 text-sm font-medium text-text-link hover:bg-[var(--color-accent-softHover)] rounded-button transition-colors duration-200",
450
450
  children: x("billing.common.pdf", "PDF")
451
451
  }),
452
- L && /* @__PURE__ */ k("a", {
452
+ L && /* @__PURE__ */ A("a", {
453
453
  href: L,
454
454
  target: "_blank",
455
455
  rel: "noopener noreferrer",
456
456
  className: "px-3 py-1.5 text-sm font-medium text-text-link hover:bg-[var(--color-accent-softHover)] rounded-button transition-colors duration-200",
457
457
  children: x("billing.common.pdfBackup", "PDF (backup)")
458
458
  }),
459
- j && o && /* @__PURE__ */ k("button", {
459
+ k && o && /* @__PURE__ */ A("button", {
460
460
  type: "button",
461
461
  onClick: P,
462
462
  disabled: f,
463
463
  className: "px-3 py-1.5 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors duration-200 disabled:cursor-not-allowed disabled:opacity-50",
464
464
  children: f && v === "pay" ? x("billing.common.paying", "Paying…") : x("billing.common.pay", "Pay")
465
465
  }),
466
- S && /* @__PURE__ */ k(i, {
466
+ S && /* @__PURE__ */ A(i, {
467
467
  open: E,
468
468
  title: x("billing.invoices.payReview.title", "Review and pay"),
469
469
  description: x("billing.invoices.payReview.description", "Your default card is charged as soon as you confirm."),
@@ -491,26 +491,26 @@ var j = () => {
491
491
  onConfirm: () => void F(),
492
492
  onCancel: () => D(!1)
493
493
  }),
494
- (j || M) && d && /* @__PURE__ */ k("button", {
494
+ (k || M) && d && /* @__PURE__ */ A("button", {
495
495
  type: "button",
496
496
  onClick: () => void N(),
497
497
  disabled: f,
498
498
  className: "px-3 py-1.5 text-sm font-medium text-status-error-text hover:bg-status-error-bg-subtle rounded-button transition-colors duration-200 disabled:cursor-not-allowed disabled:opacity-50",
499
499
  children: f && v === "void" ? x("billing.common.voiding", "Voiding…") : x("billing.common.void", "Void")
500
500
  }),
501
- w && /* @__PURE__ */ A("div", {
501
+ w && /* @__PURE__ */ j("div", {
502
502
  className: "absolute right-4 mt-12 z-10 w-64 rounded-card border border-status-error-border bg-bg-elevated p-3 text-left shadow-elevation-2",
503
- children: [/* @__PURE__ */ k("p", {
503
+ children: [/* @__PURE__ */ A("p", {
504
504
  className: "text-sm font-medium text-text-primary",
505
505
  children: "Void this invoice?"
506
- }), /* @__PURE__ */ A("div", {
506
+ }), /* @__PURE__ */ j("div", {
507
507
  className: "mt-3 flex justify-end gap-2",
508
- children: [/* @__PURE__ */ k("button", {
508
+ children: [/* @__PURE__ */ A("button", {
509
509
  type: "button",
510
510
  onClick: () => T(!1),
511
511
  className: "rounded-button border border-border-subtle bg-bg-surface px-2.5 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
512
512
  children: "Cancel"
513
- }), /* @__PURE__ */ k("button", {
513
+ }), /* @__PURE__ */ A("button", {
514
514
  type: "button",
515
515
  onClick: () => void I(),
516
516
  disabled: f,
@@ -525,6 +525,6 @@ var j = () => {
525
525
  ]
526
526
  });
527
527
  };
528
- export { j as InvoicesListPage };
528
+ export { M as InvoicesListPage };
529
529
 
530
530
  //# sourceMappingURL=InvoicesListPage.js.map