@burdenoff/microfe-billing 2026.625.3 → 2026.625.5

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 (98) hide show
  1. package/dist/billing/lib/native-purchases.js +2 -44
  2. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +192 -187
  3. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -1
  4. package/dist/billing/modules/addons/pages/AddonCreatePage.js +322 -317
  5. package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
  6. package/dist/billing/modules/addons/pages/AddonDetailPage.js +190 -185
  7. package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -1
  8. package/dist/billing/modules/addons/pages/AddonEditPage.js +297 -292
  9. package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
  10. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +60 -75
  11. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
  12. package/dist/billing/modules/addons/pages/AddonsListPage.js +86 -101
  13. package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -1
  14. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +124 -121
  15. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
  16. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +103 -111
  17. package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
  18. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +196 -160
  19. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
  20. package/dist/billing/modules/billing/pages/InvoicesListPage.js +58 -73
  21. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
  22. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +65 -75
  23. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
  24. package/dist/billing/modules/billing/pages/RefundsPage.js +399 -399
  25. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  26. package/dist/billing/modules/billing/pages/TransactionsPage.js +49 -48
  27. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
  28. package/dist/billing/modules/billing/pages/UserRefundsPage.js +144 -151
  29. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  30. package/dist/billing/modules/checkout/pages/CheckoutPage.js +430 -425
  31. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
  32. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +121 -93
  33. package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
  34. package/dist/billing/modules/coupons/pages/CouponsListPage.js +154 -152
  35. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
  36. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +467 -462
  37. package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
  38. package/dist/billing/modules/coupons/pages/EditCouponPage.js +294 -286
  39. package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -1
  40. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +123 -117
  41. package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
  42. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +43 -42
  43. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -1
  44. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +192 -207
  45. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
  46. package/dist/billing/modules/credits/pages/CreditsPage.js +40 -56
  47. package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
  48. package/dist/billing/modules/dashboard/pages/OverviewPage.js +128 -121
  49. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
  50. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +165 -180
  51. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  52. package/dist/billing/modules/earnings/pages/EarningsPage.js +103 -100
  53. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  54. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +175 -175
  55. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  56. package/dist/billing/modules/earnings/pages/PayoutsPage.js +96 -96
  57. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  58. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +42 -40
  59. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
  60. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +45 -38
  61. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -1
  62. package/dist/billing/modules/plans/pages/PlanCreatePage.js +339 -334
  63. package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
  64. package/dist/billing/modules/plans/pages/PlanDetailPage.js +80 -74
  65. package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -1
  66. package/dist/billing/modules/plans/pages/PlanEditPage.js +342 -337
  67. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  68. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +38 -53
  69. package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
  70. package/dist/billing/modules/plans/pages/PlansListPage.js +60 -75
  71. package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -1
  72. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +242 -237
  73. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
  74. package/dist/billing/modules/promotions/pages/PromotionsListPage.js +29 -39
  75. package/dist/billing/modules/promotions/pages/PromotionsListPage.js.map +1 -1
  76. package/dist/billing/modules/quota/pages/QuotaPage.js +1 -0
  77. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +299 -294
  78. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
  79. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +191 -186
  80. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js.map +1 -1
  81. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +308 -303
  82. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
  83. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +57 -78
  84. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js.map +1 -1
  85. package/dist/billing/modules/settings/pages/SettingsPage.js +79 -78
  86. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  87. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +15 -13
  88. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  89. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +338 -299
  90. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
  91. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +82 -103
  92. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
  93. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +59 -54
  94. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
  95. package/dist/billing/modules/usage/pages/UsagePage.js +172 -215
  96. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  97. package/package.json +2 -2
  98. package/dist/billing/lib/native-purchases.js.map +0 -1
@@ -24,110 +24,110 @@ import { useCallback as a, useEffect as o, useState as s } from "react";
24
24
  import { Activity as he, ArrowRight as ge, Building2 as c, Check as l, ChevronDown as _e, Coins as ve, Crown as ye, Loader2 as be, Plus as u, Receipt as xe, RefreshCw as Se, Sparkles as Ce, Wallet as d } from "lucide-react";
25
25
  import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
26
26
  import { useI18n as we } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
27
- import { AuroraBackground as h, Button as Te, CTAOverflowMenu as Ee, GlassCard as De, GradientText as g, IllustratedEmptyState as Oe } from "@burdenoff/fe-libs/ui";
27
+ import { AuroraBackground as h, Button as Te, CTAOverflowMenu as Ee, GlassCard as De, GradientText as g, IllustratedEmptyState as Oe, PagePurpose as ke } from "@burdenoff/fe-libs/ui";
28
28
  //#region src/billing/modules/dashboard/pages/OverviewPage.tsx
29
29
  var _ = () => {
30
30
  let { t: _ } = we(), v = (e, t) => {
31
31
  let n = _(e);
32
32
  return n === e ? t : n;
33
- }, { navigate: y, basePath: b, orgId: x, productId: ke } = e(), S = ae(), { emit: C } = te(), [w, Ae] = s(() => ne(x)), [T, E] = s(!1), [D, O] = s(null), [k, A] = s(!1), [je, Me] = s(!1), [j, M] = s(0), [N, P] = s(!1), { billingAccounts: F, currentAccount: I, paymentMethods: L, activeSubscriptions: R, hasActiveSubscription: z, recommendedAddons: Ne, isLoading: B, error: V, refetchAll: H } = se(w, ke), U = I?.id, Pe = B, W = a((e) => {
34
- Ae(e), re(x, e);
35
- }, [x]), { addToCart: G, isInCart: K, getCartItem: q, updateQuantity: J, removeFromCart: Y } = pe(), { createBillingAccount: X, setBillingAddress: Fe, setDefaultPaymentMethod: Ie, deletePaymentMethod: Le, isCreatingAccount: Re } = oe();
33
+ }, { navigate: y, basePath: b, orgId: x, productId: Ae } = e(), S = ae(), { emit: C } = te(), [w, je] = s(() => ne(x)), [T, E] = s(!1), [D, O] = s(null), [k, A] = s(!1), [Me, j] = s(!1), [M, N] = s(0), [P, F] = s(!1), { billingAccounts: I, currentAccount: L, paymentMethods: R, activeSubscriptions: z, hasActiveSubscription: B, recommendedAddons: Ne, isLoading: V, error: H, refetchAll: U } = se(w, Ae), W = L?.id, Pe = V, G = a((e) => {
34
+ je(e), re(x, e);
35
+ }, [x]), { addToCart: K, isInCart: q, getCartItem: J, updateQuantity: Y, removeFromCart: X } = pe(), { createBillingAccount: Fe, setBillingAddress: Ie, setDefaultPaymentMethod: Le, deletePaymentMethod: Re, isCreatingAccount: ze } = oe();
36
36
  o(() => {
37
- M(0), P(!1);
38
- }, [U, R.length]), o(() => {
39
- w && F.length > 0 && (F.some((e) => e.id === w) || W(null));
37
+ N(0), F(!1);
38
+ }, [W, z.length]), o(() => {
39
+ w && I.length > 0 && (I.some((e) => e.id === w) || G(null));
40
40
  }, [
41
- F,
41
+ I,
42
42
  w,
43
- W
43
+ G
44
44
  ]), o(() => {
45
- !w && F.length > 0 && W((F.find((e) => e.isDefault) ?? F[0]).id);
45
+ !w && I.length > 0 && G((I.find((e) => e.isDefault) ?? I[0]).id);
46
46
  }, [
47
- F,
47
+ I,
48
48
  w,
49
- W
49
+ G
50
50
  ]);
51
- let Z = R[j] || R[0] || null, Q = a((e) => {
51
+ let Z = z[M] || z[0] || null, Q = a((e) => {
52
52
  let t = e;
53
53
  b && b !== "/" && (t = `${b.endsWith("/") ? b.slice(0, -1) : b}${e.startsWith("/") ? e : `/${e}`}`), y(t);
54
- }, [y, b]), ze = a(async (e, t) => {
54
+ }, [y, b]), Be = a(async (e, t) => {
55
55
  O(null);
56
56
  try {
57
- let n = await X(e);
58
- t && n.id && await Fe({
57
+ let n = await Fe(e);
58
+ t && n.id && await Ie({
59
59
  billingAccountId: n.id,
60
60
  ...t
61
- }), E(!1), W(n.id), C("billing.billing_account.created", {
61
+ }), E(!1), G(n.id), C("billing.billing_account.created", {
62
62
  route: "/billing/overview",
63
63
  entityId: n.id,
64
64
  source: "overview"
65
- }), await H();
65
+ }), await U();
66
66
  } catch (e) {
67
67
  O(e instanceof Error ? e.message : "Failed to create billing account");
68
68
  }
69
69
  }, [
70
- X,
71
- C,
72
- H,
73
70
  Fe,
74
- W
75
- ]), Be = a(() => {
76
- Me(!0);
71
+ C,
72
+ U,
73
+ Ie,
74
+ G
75
+ ]), Ve = a(() => {
76
+ j(!0);
77
77
  }, []), $ = a(async () => {
78
- await H();
79
- }, [H]), Ve = a(async () => {
78
+ await U();
79
+ }, [U]), He = a(async () => {
80
80
  C("billing.payment_method.added", {
81
81
  route: "/billing/overview",
82
- entityId: U,
82
+ entityId: W,
83
83
  source: "overview"
84
84
  }), await $();
85
85
  }, [
86
- U,
86
+ W,
87
87
  C,
88
88
  $
89
- ]), He = a(async (e) => {
90
- U && (await Ie(e, U), C("billing.payment_method.default_set", {
89
+ ]), Ue = a(async (e) => {
90
+ W && (await Le(e, W), C("billing.payment_method.default_set", {
91
91
  route: "/billing/overview",
92
92
  entityId: e,
93
93
  source: "overview"
94
94
  }), await $());
95
95
  }, [
96
- U,
96
+ W,
97
97
  C,
98
- Ie,
98
+ Le,
99
99
  $
100
- ]), Ue = a(async (e) => {
101
- U && (await Le(e, U), C("billing.payment_method.deleted", {
100
+ ]), We = a(async (e) => {
101
+ W && (await Re(e, W), C("billing.payment_method.deleted", {
102
102
  route: "/billing/overview",
103
103
  entityId: e,
104
104
  source: "overview"
105
105
  }), await $());
106
106
  }, [
107
- U,
108
- Le,
107
+ W,
108
+ Re,
109
109
  C,
110
110
  $
111
- ]), We = a((e) => {
112
- W(e.id), A(!1);
113
- }, [W]), Ge = a(async () => {
114
- await H();
115
- }, [H]), Ke = a((e) => {
116
- G(e);
117
- }, [G]), qe = a((e) => K(e), [K]), Je = a((e) => q(e)?.quantity || 0, [q]), Ye = a((e, t) => {
118
- t <= 0 ? Y(e) : J(e, t);
119
- }, [J, Y]), Xe = a((e) => {
120
- Y(e);
121
- }, [Y]);
122
- return S.canViewBillingAccount ? V && ie(V) && !B ? /* @__PURE__ */ p("div", {
111
+ ]), Ge = a((e) => {
112
+ G(e.id), A(!1);
113
+ }, [G]), Ke = a(async () => {
114
+ await U();
115
+ }, [U]), qe = a((e) => {
116
+ K(e);
117
+ }, [K]), Je = a((e) => q(e), [q]), Ye = a((e) => J(e)?.quantity || 0, [J]), Xe = a((e, t) => {
118
+ t <= 0 ? X(e) : Y(e, t);
119
+ }, [Y, X]), Ze = a((e) => {
120
+ X(e);
121
+ }, [X]);
122
+ return S.canViewBillingAccount ? H && ie(H) && !V ? /* @__PURE__ */ p("div", {
123
123
  className: "p-6",
124
124
  children: /* @__PURE__ */ p(ee, {
125
125
  title: "Server Unavailable",
126
126
  message: "Unable to load billing overview. The server might be down or experiencing issues.",
127
- onRetry: Ge,
127
+ onRetry: Ke,
128
128
  showRetry: !0
129
129
  })
130
- }) : B && !I ? /* @__PURE__ */ p("div", {
130
+ }) : V && !L ? /* @__PURE__ */ p("div", {
131
131
  className: "flex items-center justify-center min-h-[400px]",
132
132
  children: /* @__PURE__ */ m("div", {
133
133
  className: "flex flex-col items-center gap-3",
@@ -136,7 +136,7 @@ var _ = () => {
136
136
  children: v("billing.overview.loadingInfo", "Loading billing information...")
137
137
  })]
138
138
  })
139
- }) : !B && F.length === 0 ? /* @__PURE__ */ m("div", {
139
+ }) : !V && I.length === 0 ? /* @__PURE__ */ m("div", {
140
140
  className: "px-6 lg:px-8 py-6",
141
141
  children: [
142
142
  /* @__PURE__ */ m("header", {
@@ -169,8 +169,8 @@ var _ = () => {
169
169
  onClose: () => {
170
170
  E(!1), O(null);
171
171
  },
172
- onSubmit: ze,
173
- isSubmitting: Re,
172
+ onSubmit: Be,
173
+ isSubmitting: ze,
174
174
  error: D
175
175
  })
176
176
  ]
@@ -181,15 +181,22 @@ var _ = () => {
181
181
  className: "relative overflow-hidden rounded-card flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",
182
182
  children: [
183
183
  /* @__PURE__ */ p(h, { intensity: "subtle" }),
184
- /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h1", {
185
- className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
186
- children: /* @__PURE__ */ p(g, { children: v("billing.overview.title", "Billing Overview") })
187
- }), /* @__PURE__ */ p("p", {
188
- className: "text-sm text-text-secondary mt-1",
189
- children: v("billing.overview.description", "Manage your billing accounts, subscriptions, and payment methods")
190
- })] }),
184
+ /* @__PURE__ */ m("div", { children: [
185
+ /* @__PURE__ */ p("h1", {
186
+ className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
187
+ children: /* @__PURE__ */ p(g, { children: v("billing.overview.title", "Billing Overview") })
188
+ }),
189
+ /* @__PURE__ */ p("p", {
190
+ className: "text-sm text-text-secondary mt-1",
191
+ children: v("billing.overview.description", "Manage your billing accounts, subscriptions, and payment methods")
192
+ }),
193
+ /* @__PURE__ */ p(ke, {
194
+ className: "mt-3",
195
+ children: v("billing.overview.purpose", "Your billing home base — see your current plan, credit balance and payment methods at a glance, and jump to transactions, usage, credits or new plans. Start here to understand what you are paying for and manage it.")
196
+ })
197
+ ] }),
191
198
  /* @__PURE__ */ p(Ee, {
192
- primary: S.canManageBillingAccount && F.length > 0 ? {
199
+ primary: S.canManageBillingAccount && I.length > 0 ? {
193
200
  label: v("billing.overview.newAccount", "New Account"),
194
201
  onSelect: () => E(!0),
195
202
  icon: /* @__PURE__ */ p(u, { className: "size-4" })
@@ -197,14 +204,14 @@ var _ = () => {
197
204
  actions: [{
198
205
  label: v("billing.overview.refresh", "Refresh"),
199
206
  onSelect: () => {
200
- Ge();
207
+ Ke();
201
208
  },
202
- icon: /* @__PURE__ */ p(Se, { className: `size-4 ${B ? "animate-spin" : ""}` })
209
+ icon: /* @__PURE__ */ p(Se, { className: `size-4 ${V ? "animate-spin" : ""}` })
203
210
  }]
204
211
  })
205
212
  ]
206
213
  }),
207
- F.length > 1 && /* @__PURE__ */ m("div", {
214
+ I.length > 1 && /* @__PURE__ */ m("div", {
208
215
  className: "relative",
209
216
  "data-tour": "billing-overview-account-selector",
210
217
  children: [/* @__PURE__ */ m("button", {
@@ -220,10 +227,10 @@ var _ = () => {
220
227
  className: "text-left",
221
228
  children: [/* @__PURE__ */ p("p", {
222
229
  className: "text-sm font-medium text-text-primary",
223
- children: I?.name || v("billing.overview.selectAccount", "Select Account")
230
+ children: L?.name || v("billing.overview.selectAccount", "Select Account")
224
231
  }), /* @__PURE__ */ p("p", {
225
232
  className: "text-xs text-text-secondary",
226
- children: I?.email
233
+ children: L?.email
227
234
  })]
228
235
  })]
229
236
  }), /* @__PURE__ */ p(_e, { className: `size-4 text-text-muted transition-transform ${k ? "rotate-180" : ""}` })]
@@ -232,9 +239,9 @@ var _ = () => {
232
239
  onClick: () => A(!1)
233
240
  }), /* @__PURE__ */ p("div", {
234
241
  className: "absolute top-full left-0 right-0 sm:right-auto mt-1 w-full sm:w-80 bg-bg-elevated border border-border-seam rounded-card shadow-elevation-3 z-20 py-1 max-h-60 overflow-y-auto",
235
- children: F.map((e) => /* @__PURE__ */ m("button", {
242
+ children: I.map((e) => /* @__PURE__ */ m("button", {
236
243
  type: "button",
237
- onClick: () => We(e),
244
+ onClick: () => Ge(e),
238
245
  className: "w-full flex items-center justify-between gap-3 px-4 py-3 hover:bg-bg-sunken transition-colors",
239
246
  children: [/* @__PURE__ */ m("div", {
240
247
  className: "flex items-center gap-3 min-w-0",
@@ -251,32 +258,32 @@ var _ = () => {
251
258
  children: e.email
252
259
  })]
253
260
  })]
254
- }), I?.id === e.id && /* @__PURE__ */ p(l, { className: "size-4 text-text-link flex-shrink-0" })]
261
+ }), L?.id === e.id && /* @__PURE__ */ p(l, { className: "size-4 text-text-link flex-shrink-0" })]
255
262
  }, e.id))
256
263
  })] })]
257
264
  }),
258
- I && /* @__PURE__ */ m("div", {
265
+ L && /* @__PURE__ */ m("div", {
259
266
  className: "grid grid-cols-1 xs:grid-cols-2 sm:grid-cols-4 gap-3 sm:gap-4",
260
267
  "data-tour": "billing-overview-stats-row",
261
268
  children: [
262
269
  /* @__PURE__ */ p(n, {
263
270
  label: v("billing.overview.stats.creditBalance", "Credit Balance"),
264
- value: `${(I.creditAmount || 0).toLocaleString()} Credits`,
271
+ value: `${(L.creditAmount || 0).toLocaleString()} Credits`,
265
272
  icon: /* @__PURE__ */ p(d, { className: "size-5" })
266
273
  }),
267
274
  /* @__PURE__ */ p(n, {
268
275
  label: v("billing.overview.stats.activePlans", "Active Plans"),
269
- value: R.length > 0 ? R.length === 1 ? R[0]?.plan?.name || "1 Plan" : `${R.length} ${v("billing.overview.stats.plansSuffix", "Plans")}` : v("billing.overview.stats.none", "None"),
276
+ value: z.length > 0 ? z.length === 1 ? z[0]?.plan?.name || "1 Plan" : `${z.length} ${v("billing.overview.stats.plansSuffix", "Plans")}` : v("billing.overview.stats.none", "None"),
270
277
  icon: /* @__PURE__ */ p(Se, { className: "size-5" })
271
278
  }),
272
279
  /* @__PURE__ */ p(n, {
273
280
  label: v("billing.overview.stats.paymentMethods", "Payment Methods"),
274
- value: L.length,
281
+ value: R.length,
275
282
  icon: /* @__PURE__ */ p(c, { className: "size-5" })
276
283
  }),
277
284
  /* @__PURE__ */ p(n, {
278
285
  label: v("billing.overview.stats.paymentCurrency", "Payment Currency"),
279
- value: I.currency || "USD",
286
+ value: L.currency || "USD",
280
287
  icon: /* @__PURE__ */ p(c, { className: "size-5" })
281
288
  })
282
289
  ]
@@ -286,21 +293,21 @@ var _ = () => {
286
293
  children: [/* @__PURE__ */ m("div", {
287
294
  className: "lg:col-span-2 space-y-6",
288
295
  children: [
289
- I && /* @__PURE__ */ p(ce, {
296
+ L && /* @__PURE__ */ p(ce, {
290
297
  dataTour: "billing-overview-billing-account-card",
291
- account: I,
292
- isDefault: I.isDefault ?? !1,
293
- onEdit: () => I && Q(`/settings?billingAccountId=${I.id}`),
294
- onViewTransactions: () => Q(`/transactions/${I.id}`),
295
- onViewCreditTransactions: () => Q(`/creditTransactions/${I.id}`)
298
+ account: L,
299
+ isDefault: L.isDefault ?? !1,
300
+ onEdit: () => L && Q(`/settings?billingAccountId=${L.id}`),
301
+ onViewTransactions: () => Q(`/transactions/${L.id}`),
302
+ onViewCreditTransactions: () => Q(`/creditTransactions/${L.id}`)
296
303
  }),
297
304
  /* @__PURE__ */ m("div", {
298
305
  className: "space-y-3",
299
- children: [R.length > 1 && /* @__PURE__ */ m("div", {
306
+ children: [z.length > 1 && /* @__PURE__ */ m("div", {
300
307
  className: "relative",
301
308
  children: [/* @__PURE__ */ m("button", {
302
309
  type: "button",
303
- onClick: () => P(!N),
310
+ onClick: () => F(!P),
304
311
  className: "w-full sm:w-auto flex items-center justify-between gap-3 px-4 py-3 border border-border-seam rounded-card bg-bg-surface hover:bg-bg-sunken hover:border-border-strong transition-all duration-200",
305
312
  children: [/* @__PURE__ */ m("div", {
306
313
  className: "flex items-center gap-3",
@@ -322,22 +329,22 @@ var _ = () => {
322
329
  }), /* @__PURE__ */ m("p", {
323
330
  className: "text-xs text-text-secondary",
324
331
  children: [
325
- R.length,
332
+ z.length,
326
333
  " ",
327
334
  v("billing.overview.activeSubscriptions", "active subscriptions")
328
335
  ]
329
336
  })]
330
337
  })]
331
- }), /* @__PURE__ */ p(_e, { className: `size-4 text-text-muted transition-transform ${N ? "rotate-180" : ""}` })]
332
- }), N && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", {
338
+ }), /* @__PURE__ */ p(_e, { className: `size-4 text-text-muted transition-transform ${P ? "rotate-180" : ""}` })]
339
+ }), P && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", {
333
340
  className: "fixed inset-0 z-10",
334
- onClick: () => P(!1)
341
+ onClick: () => F(!1)
335
342
  }), /* @__PURE__ */ p("div", {
336
343
  className: "absolute top-full left-0 right-0 sm:right-auto mt-1 w-full sm:w-80 bg-bg-elevated border border-border-seam rounded-card shadow-elevation-3 z-20 py-1 max-h-60 overflow-y-auto",
337
- children: R.map((e, t) => /* @__PURE__ */ m("button", {
344
+ children: z.map((e, t) => /* @__PURE__ */ m("button", {
338
345
  type: "button",
339
346
  onClick: () => {
340
- M(t), P(!1);
347
+ N(t), F(!1);
341
348
  },
342
349
  className: "w-full flex items-center justify-between gap-3 px-4 py-3 hover:bg-bg-sunken transition-colors",
343
350
  children: [/* @__PURE__ */ m("div", {
@@ -362,26 +369,26 @@ var _ = () => {
362
369
  ]
363
370
  })]
364
371
  })]
365
- }), j === t && /* @__PURE__ */ p(l, { className: "size-4 text-text-link flex-shrink-0" })]
372
+ }), M === t && /* @__PURE__ */ p(l, { className: "size-4 text-text-link flex-shrink-0" })]
366
373
  }, e.id))
367
374
  })] })]
368
375
  }), /* @__PURE__ */ p(ue, {
369
376
  dataTour: "billing-overview-active-subscription-card",
370
377
  subscription: Z,
371
- onViewDetails: () => Z && Q(i(`/subscriptions/${Z.id}`, Z.billingAccountId ?? I?.id)),
372
- onUpgrade: () => Z && Q(i(`/subscriptions/${Z.id}/upgrade`, Z.billingAccountId ?? I?.id)),
373
- onManage: () => I && Q(`/subscriptions?billingAccountId=${I.id}`),
378
+ onViewDetails: () => Z && Q(i(`/subscriptions/${Z.id}`, Z.billingAccountId ?? L?.id)),
379
+ onUpgrade: () => Z && Q(i(`/subscriptions/${Z.id}/upgrade`, Z.billingAccountId ?? L?.id)),
380
+ onManage: () => L && Q(`/subscriptions?billingAccountId=${L.id}`),
374
381
  onPurchasePlan: () => Q("/plans")
375
382
  })]
376
383
  }),
377
- I && /* @__PURE__ */ p(le, {
384
+ L && /* @__PURE__ */ p(le, {
378
385
  dataTour: "billing-overview-payment-methods-section",
379
- paymentMethods: L,
380
- billingAccountId: I.id,
381
- onAddPaymentMethod: Be,
382
- onSetDefault: He,
383
- onDelete: Ue,
384
- isLoading: B
386
+ paymentMethods: R,
387
+ billingAccountId: L.id,
388
+ onAddPaymentMethod: Ve,
389
+ onSetDefault: Ue,
390
+ onDelete: We,
391
+ isLoading: V
385
392
  })
386
393
  ]
387
394
  }), /* @__PURE__ */ m("div", {
@@ -397,8 +404,8 @@ var _ = () => {
397
404
  children: [
398
405
  /* @__PURE__ */ m("button", {
399
406
  type: "button",
400
- onClick: () => I && Q(`/transactions/${I.id}`),
401
- disabled: !I,
407
+ onClick: () => L && Q(`/transactions/${L.id}`),
408
+ disabled: !L,
402
409
  className: "w-full flex items-center gap-3 px-3 py-2.5 text-sm text-left text-text-primary hover:bg-bg-sunken rounded-button transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
403
410
  children: [/* @__PURE__ */ p("div", {
404
411
  className: "size-9 rounded-lg bg-status-info-bg-subtle flex items-center justify-center",
@@ -407,8 +414,8 @@ var _ = () => {
407
414
  }),
408
415
  /* @__PURE__ */ m("button", {
409
416
  type: "button",
410
- onClick: () => I && Q(`/creditTransactions/${I.id}`),
411
- disabled: !I,
417
+ onClick: () => L && Q(`/creditTransactions/${L.id}`),
418
+ disabled: !L,
412
419
  className: "w-full flex items-center gap-3 px-3 py-2.5 text-sm text-left text-text-primary hover:bg-bg-sunken rounded-button transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
413
420
  children: [/* @__PURE__ */ p("div", {
414
421
  className: "size-9 rounded-lg bg-status-warning-bg-subtle flex items-center justify-center",
@@ -426,8 +433,8 @@ var _ = () => {
426
433
  }),
427
434
  /* @__PURE__ */ m("button", {
428
435
  type: "button",
429
- onClick: () => I && Q(`/usage?billingAccountId=${I.id}`),
430
- disabled: !I,
436
+ onClick: () => L && Q(`/usage?billingAccountId=${L.id}`),
437
+ disabled: !L,
431
438
  className: "w-full flex items-center gap-3 px-3 py-2.5 text-sm text-left text-text-primary hover:bg-bg-sunken rounded-button transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
432
439
  children: [/* @__PURE__ */ p("div", {
433
440
  className: "size-9 rounded-lg bg-[var(--color-accent-soft)] flex items-center justify-center",
@@ -436,7 +443,7 @@ var _ = () => {
436
443
  })
437
444
  ]
438
445
  })]
439
- }), !z && /* @__PURE__ */ m(De, {
446
+ }), !B && /* @__PURE__ */ m(De, {
440
447
  treatment: "glass",
441
448
  glow: !0,
442
449
  className: "p-5",
@@ -464,15 +471,15 @@ var _ = () => {
464
471
  /* @__PURE__ */ p(de, {
465
472
  dataTour: "billing-overview-recommended-addons",
466
473
  addons: Ne,
467
- hasSubscription: z,
474
+ hasSubscription: B,
468
475
  onViewAddon: (e) => Q(`/addons/${e}`),
469
476
  onPurchaseAddon: (e) => Q(`/addons/${e}?action=purchase`),
470
477
  onViewAllAddons: () => Q("/addons"),
471
- onAddToCart: Ke,
472
- isInCart: qe,
473
- getCartQuantity: Je,
474
- onUpdateQuantity: Ye,
475
- onRemoveFromCart: Xe,
478
+ onAddToCart: qe,
479
+ isInCart: Je,
480
+ getCartQuantity: Ye,
481
+ onUpdateQuantity: Xe,
482
+ onRemoveFromCart: Ze,
476
483
  maxAddons: 3,
477
484
  isLoading: Pe
478
485
  }),
@@ -482,17 +489,17 @@ var _ = () => {
482
489
  onClose: () => {
483
490
  E(!1), O(null);
484
491
  },
485
- onSubmit: ze,
486
- isSubmitting: Re,
492
+ onSubmit: Be,
493
+ isSubmitting: ze,
487
494
  error: D
488
495
  }),
489
- I && /* @__PURE__ */ p(fe, {
490
- isOpen: je,
491
- onClose: () => Me(!1),
492
- billingAccountId: I.id,
493
- currency: I.currency,
494
- country: I.billingAddresses?.[0]?.country,
495
- onSuccess: Ve
496
+ L && /* @__PURE__ */ p(fe, {
497
+ isOpen: Me,
498
+ onClose: () => j(!1),
499
+ billingAccountId: L.id,
500
+ currency: L.currency,
501
+ country: L.billingAddresses?.[0]?.country,
502
+ onSuccess: He
496
503
  })
497
504
  ]
498
505
  }) : /* @__PURE__ */ p(t, { message: "You don't have permission to view billing information." });