@burdenoff/microfe-billing 2026.825.2 → 2026.826.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.
@@ -6,51 +6,55 @@ import "../../../shared/ui/index.js";
6
6
  import { useBillingEventEmitter as i } from "../../../hooks/useBillingEventEmitter.js";
7
7
  import { useBillingAccountSelection as a } from "../../../hooks/useBillingAccountSelection.js";
8
8
  import { PricingModel as o } from "../../../shared/types/graphql.js";
9
- import { formatBytes as s, formatCurrency as c, formatDate as l, formatPercentage as u, formatPlanDuration as d, formatSubscriptionStatus as ee } from "../../../shared/utils/format.js";
10
- import { getQuotaProgressColor as f, getSubscriptionStatusColor as te } from "../../../shared/utils/status.js";
11
- import { useBillingPermissions as ne } from "../../../hooks/useBillingPermissions.js";
12
- import { useGetDefaultBillingAccountDashboardQuery as p } from "../../../../generated/global-operations.js";
13
- import { useBillingNavigate as re } from "../../../hooks/useBillingNavigate.js";
9
+ import { formatBytes as s, formatCurrency as c, formatDate as l, formatPercentage as u, formatPlanDuration as d, formatSubscriptionStatus as f } from "../../../shared/utils/format.js";
10
+ import { getQuotaProgressColor as p, getSubscriptionStatusColor as ee } from "../../../shared/utils/status.js";
11
+ import { useBillingPermissions as te } from "../../../hooks/useBillingPermissions.js";
12
+ import { useGetDefaultBillingAccountDashboardQuery as ne, useGetPlanQuery as re } from "../../../../generated/global-operations.js";
13
+ import { useBillingNavigate as ie } from "../../../hooks/useBillingNavigate.js";
14
14
  import { withBillingAccountId as m } from "../../../shared/utils/navigation.js";
15
- import { useWorkspaceQuotaOverview as ie } from "../../usage/hooks/useUsage.js";
16
- import { WorkspaceQuotaAssignmentModal as h } from "../../checkout/components/WorkspaceQuotaAssignmentModal.js";
17
- import { useSubscription as g, useSubscriptionMutations as ae } from "../hooks/useSubscriptions.js";
15
+ import { useWorkspaceQuotaOverview as h } from "../../usage/hooks/useUsage.js";
16
+ import { WorkspaceQuotaAssignmentModal as ae, isWorkspaceScopedQuota as oe } from "../../checkout/components/WorkspaceQuotaAssignmentModal.js";
17
+ import { useSubscription as se, useSubscriptionMutations as ce } from "../hooks/useSubscriptions.js";
18
18
  import "../hooks/index.js";
19
- import { ManageSeatsModal as oe } from "../components/ManageSeatsModal.js";
20
- import { useState as _ } from "react";
21
- import { useParams as se } from "react-router";
22
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
23
- import { useI18n as b } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
24
- import { CTAOverflowMenu as ce, EmphasisPanel as le, NextSteps as ue, PagePurpose as x } from "@burdenoff/fe-libs/ui";
19
+ import { ManageSeatsModal as le } from "../components/ManageSeatsModal.js";
20
+ import { useState as g } from "react";
21
+ import { useParams as ue } from "react-router";
22
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
23
+ import { useI18n as de } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
24
+ import { CTAOverflowMenu as fe, EmphasisPanel as y, NextSteps as b, PagePurpose as pe } from "@burdenoff/fe-libs/ui";
25
25
  //#region src/billing/modules/subscriptions/pages/SubscriptionDetailPage.tsx
26
- function S(e, t) {
26
+ function x(e, t) {
27
27
  if (t?.displayName && typeof t.displayName == "string") return t.displayName;
28
28
  if (t?.label && typeof t.label == "string") return t.label;
29
29
  let n = e.split(".");
30
30
  return (n.length > 1 ? n.slice(1) : n).map((e) => e.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase())).join(" ");
31
31
  }
32
- function C(e) {
32
+ function S(e) {
33
33
  return e === "DAILY" ? "Resets daily" : e === "MONTHLY" ? "Resets monthly" : "";
34
34
  }
35
- var w = () => {
36
- let { t: s } = b(), u = (e, t) => {
35
+ var C = () => {
36
+ let { t: s } = de(), u = (e, t) => {
37
37
  let n = s(e);
38
38
  return n === e ? t : n;
39
- }, { subscriptionId: f } = se(), S = re(), { emit: C } = i(), { orgId: w } = e(), T = ne(), { selectedAccountId: ge } = a({
40
- orgId: w,
39
+ }, { subscriptionId: p } = ue(), x = ie(), { emit: S } = i(), { orgId: C } = e(), w = te(), { selectedAccountId: ye } = a({
40
+ orgId: C,
41
41
  syncFromUrl: !0,
42
42
  urlParamName: "billingAccountId"
43
- }), { data: _e } = p({ fetchPolicy: "cache-first" }), E = ge ?? _e?.getDefaultBillingAccount?.id ?? void 0, { subscription: D, isLoading: ve, error: O, refetch: k } = g(f, E), { cancelSubscription: A, isCanceling: j, updateSubscriptionSeats: M, isUpdatingSeats: N } = ae(), { workspaceId: P } = e(), { overview: F, refetch: ye } = ie(P ?? void 0), [be, I] = _(!1), [xe, L] = _(!1), [Se, R] = _(!1), [z, B] = _(""), [V, H] = _(null), Ce = async () => {
44
- if (D) {
43
+ }), { data: be } = ne({ fetchPolicy: "cache-first" }), T = ye ?? be?.getDefaultBillingAccount?.id ?? void 0, { subscription: E, isLoading: D, error: O, refetch: k } = se(p, T), { cancelSubscription: A, isCanceling: j, updateSubscriptionSeats: M, isUpdatingSeats: N } = ce(), { workspaceId: P } = e(), { overview: F, refetch: xe } = h(P ?? void 0), { data: Se } = re({
44
+ variables: { id: E?.plan?.id ?? "" },
45
+ skip: !E?.plan?.id,
46
+ fetchPolicy: "cache-first"
47
+ }), [Ce, I] = g(!1), [we, L] = g(!1), [Te, R] = g(!1), [z, B] = g(""), [V, H] = g(null), Ee = async () => {
48
+ if (E) {
45
49
  H(null);
46
50
  try {
47
51
  await A({
48
- billingAccountId: E ?? D.billingAccountId,
49
- subscriptionId: D.id,
52
+ billingAccountId: T ?? E.billingAccountId,
53
+ subscriptionId: E.id,
50
54
  reason: z || "User requested cancellation"
51
- }), C("billing.subscription.cancelled", {
55
+ }), S("billing.subscription.cancelled", {
52
56
  route: "/billing/subscriptions",
53
- entityId: D.id,
57
+ entityId: E.id,
54
58
  source: "subscription-detail",
55
59
  reason: z || "User requested cancellation"
56
60
  }), I(!1), B(""), await k();
@@ -59,19 +63,19 @@ var w = () => {
59
63
  }
60
64
  }
61
65
  };
62
- if (!T.canViewSubscriptions) return /* @__PURE__ */ v("div", {
66
+ if (!w.canViewSubscriptions) return /* @__PURE__ */ _("div", {
63
67
  className: "flex items-center justify-center h-full min-h-[400px]",
64
- children: /* @__PURE__ */ y("div", {
68
+ children: /* @__PURE__ */ v("div", {
65
69
  className: "text-center space-y-2",
66
70
  children: [
67
- /* @__PURE__ */ v("div", {
71
+ /* @__PURE__ */ _("div", {
68
72
  className: "size-12 mx-auto rounded-full bg-[var(--color-accent-soft)] flex items-center justify-center",
69
- children: /* @__PURE__ */ v("svg", {
73
+ children: /* @__PURE__ */ _("svg", {
70
74
  className: "size-6 text-text-secondary",
71
75
  fill: "none",
72
76
  viewBox: "0 0 24 24",
73
77
  stroke: "currentColor",
74
- children: /* @__PURE__ */ v("path", {
78
+ children: /* @__PURE__ */ _("path", {
75
79
  strokeLinecap: "round",
76
80
  strokeLinejoin: "round",
77
81
  strokeWidth: 2,
@@ -79,46 +83,46 @@ var w = () => {
79
83
  })
80
84
  })
81
85
  }),
82
- /* @__PURE__ */ v("h2", {
86
+ /* @__PURE__ */ _("h2", {
83
87
  className: "text-lg font-semibold text-text-primary",
84
88
  children: "Access Denied"
85
89
  }),
86
- /* @__PURE__ */ v("p", {
90
+ /* @__PURE__ */ _("p", {
87
91
  className: "text-sm text-text-secondary max-w-sm",
88
92
  children: "You don't have permission to view this subscription."
89
93
  })
90
94
  ]
91
95
  })
92
96
  });
93
- if (ve) return /* @__PURE__ */ y("div", {
97
+ if (D) return /* @__PURE__ */ v("div", {
94
98
  className: "space-y-6 px-6 lg:px-8 py-6",
95
- children: [/* @__PURE__ */ y("div", {
99
+ children: [/* @__PURE__ */ v("div", {
96
100
  className: "flex items-center gap-4",
97
- children: [/* @__PURE__ */ v("div", { className: "size-10 bg-bg-sunken animate-pulse rounded-button" }), /* @__PURE__ */ v("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" })]
98
- }), /* @__PURE__ */ v("div", {
101
+ children: [/* @__PURE__ */ _("div", { className: "size-10 bg-bg-sunken animate-pulse rounded-button" }), /* @__PURE__ */ _("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" })]
102
+ }), /* @__PURE__ */ _("div", {
99
103
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
100
- children: /* @__PURE__ */ v("div", {
104
+ children: /* @__PURE__ */ _("div", {
101
105
  className: "lg:col-span-2 space-y-6",
102
- children: /* @__PURE__ */ y("div", {
106
+ children: /* @__PURE__ */ v("div", {
103
107
  className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 p-5 space-y-4",
104
- children: [/* @__PURE__ */ v("div", { className: "h-6 w-32 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ v("div", { className: "h-4 w-full bg-bg-sunken animate-pulse rounded" })]
108
+ children: [/* @__PURE__ */ _("div", { className: "h-6 w-32 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ _("div", { className: "h-4 w-full bg-bg-sunken animate-pulse rounded" })]
105
109
  })
106
110
  })
107
111
  })]
108
112
  });
109
- if (O || !D) return /* @__PURE__ */ v("div", {
113
+ if (O || !E) return /* @__PURE__ */ _("div", {
110
114
  className: "flex items-center justify-center h-full min-h-[400px]",
111
- children: /* @__PURE__ */ y("div", {
115
+ children: /* @__PURE__ */ v("div", {
112
116
  className: "text-center space-y-4",
113
117
  children: [
114
- /* @__PURE__ */ v("div", {
118
+ /* @__PURE__ */ _("div", {
115
119
  className: "size-12 mx-auto rounded-full bg-status-error-bg-subtle flex items-center justify-center",
116
- children: /* @__PURE__ */ v("svg", {
120
+ children: /* @__PURE__ */ _("svg", {
117
121
  className: "size-6 text-status-error-text",
118
122
  fill: "none",
119
123
  viewBox: "0 0 24 24",
120
124
  stroke: "currentColor",
121
- children: /* @__PURE__ */ v("path", {
125
+ children: /* @__PURE__ */ _("path", {
122
126
  strokeLinecap: "round",
123
127
  strokeLinejoin: "round",
124
128
  strokeWidth: 2,
@@ -126,29 +130,39 @@ var w = () => {
126
130
  })
127
131
  })
128
132
  }),
129
- /* @__PURE__ */ v("h2", {
133
+ /* @__PURE__ */ _("h2", {
130
134
  className: "text-lg font-semibold text-text-primary",
131
135
  children: u("billing.subscriptions.notFound", "Subscription not found")
132
136
  }),
133
- /* @__PURE__ */ v("p", {
137
+ /* @__PURE__ */ _("p", {
134
138
  className: "text-sm text-text-secondary",
135
139
  children: O?.message || "The subscription you are looking for does not exist."
136
140
  }),
137
- /* @__PURE__ */ v("button", {
141
+ /* @__PURE__ */ _("button", {
138
142
  type: "button",
139
- onClick: () => S(m("/subscriptions", E)),
143
+ onClick: () => x(m("/subscriptions", T)),
140
144
  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 duration-200",
141
145
  children: "Back to Subscriptions"
142
146
  })
143
147
  ]
144
148
  })
145
149
  });
146
- let U = D.plan, W = D.quotas || [], G = D.addonSubscriptions || [], K = D.transactions || [], q = D.history || [], we = te(D.status), J = D.status === "active", Y = F.filter((e) => e.assignment.subscriptionId === D.id && e.assignment.isActive), X = !!D.assignedWorkspaceId || Y.length > 0, Z = new Date(D.endDate), Te = new Date(D.startDate), Ee = /* @__PURE__ */ new Date(), Q = Math.ceil((Z.getTime() - Te.getTime()) / (1e3 * 60 * 60 * 24)), $ = Math.max(0, Math.ceil((Z.getTime() - Ee.getTime()) / (1e3 * 60 * 60 * 24))), De = Math.round((Q - $) / Q * 100), Oe = [
147
- ...J && T.canUpdateSubscription ? [{
150
+ let U = E.plan, W = E.quotas || [], G = E.addonSubscriptions || [], K = E.transactions || [], q = E.history || [], De = ee(E.status), J = E.status === "active", Y = F.filter((e) => e.assignment.subscriptionId === E.id && e.assignment.isActive), X = P ? (E.activatedWorkspaceIds?.includes(P) ?? !1) || Y.length > 0 : !1, Oe = (Se?.getPlan?.features ?? []).filter((e) => e != null).filter((e) => e.quota?.name && oe(e.quota.name)).map((e) => {
151
+ let t = e.quota?.limits, n = t && "value" in t ? Number(t.value) : null, r = t && "type" in t ? String(t.type) : "number";
152
+ return {
153
+ quotaName: e.quota.name,
154
+ productId: U?.productID ?? "platform",
155
+ limit: r === "number" ? n : null,
156
+ noLimit: r !== "number",
157
+ resetPeriod: "NEVER",
158
+ quotaMode: e.quota?.quotaType === "POOLED" ? "pooled" : "dedicated"
159
+ };
160
+ }), Z = new Date(E.endDate), ke = new Date(E.startDate), Ae = /* @__PURE__ */ new Date(), Q = Math.ceil((Z.getTime() - ke.getTime()) / (1e3 * 60 * 60 * 24)), $ = Math.max(0, Math.ceil((Z.getTime() - Ae.getTime()) / (1e3 * 60 * 60 * 24))), je = Math.round((Q - $) / Q * 100), Me = [
161
+ ...J && w.canUpdateSubscription ? [{
148
162
  id: "change-plan",
149
163
  label: "Review or change your plan",
150
164
  description: "Upgrade, downgrade, or compare what each tier includes.",
151
- onClick: () => S(m(`/subscriptions/${D.id}/upgrade`, E ?? D.billingAccountId))
165
+ onClick: () => x(m(`/subscriptions/${E.id}/upgrade`, T ?? E.billingAccountId))
152
166
  }] : [],
153
167
  ...J && P && !X ? [{
154
168
  id: "activate-workspace",
@@ -160,119 +174,119 @@ var w = () => {
160
174
  id: "track-usage",
161
175
  label: "Track your usage",
162
176
  description: "See how much of your included quota you have consumed.",
163
- onClick: () => S(m("/usage", E ?? D.billingAccountId))
177
+ onClick: () => x(m("/usage", T ?? E.billingAccountId))
164
178
  },
165
179
  {
166
180
  id: "view-invoices",
167
181
  label: "Review invoices & payments",
168
182
  description: "Check what has been billed for this subscription.",
169
- onClick: () => S(m("/invoices", E ?? D.billingAccountId))
183
+ onClick: () => x(m("/invoices", T ?? E.billingAccountId))
170
184
  }
171
185
  ];
172
- return /* @__PURE__ */ y("div", {
186
+ return /* @__PURE__ */ v("div", {
173
187
  className: "space-y-6 px-6 lg:px-8 py-6",
174
188
  children: [
175
- /* @__PURE__ */ y("div", {
189
+ /* @__PURE__ */ v("div", {
176
190
  className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
177
- children: [/* @__PURE__ */ y("div", {
191
+ children: [/* @__PURE__ */ v("div", {
178
192
  className: "flex items-start gap-4",
179
- children: [/* @__PURE__ */ v("button", {
193
+ children: [/* @__PURE__ */ _("button", {
180
194
  type: "button",
181
195
  "aria-label": "Back to subscriptions",
182
- onClick: () => S(m("/subscriptions", E)),
196
+ onClick: () => x(m("/subscriptions", T)),
183
197
  className: "p-2 -ml-2 text-text-secondary hover:text-text-primary hover:bg-bg-sunken rounded-button transition-colors duration-200",
184
- children: /* @__PURE__ */ v("svg", {
198
+ children: /* @__PURE__ */ _("svg", {
185
199
  className: "size-5",
186
200
  fill: "none",
187
201
  viewBox: "0 0 24 24",
188
202
  stroke: "currentColor",
189
- children: /* @__PURE__ */ v("path", {
203
+ children: /* @__PURE__ */ _("path", {
190
204
  strokeLinecap: "round",
191
205
  strokeLinejoin: "round",
192
206
  strokeWidth: 2,
193
207
  d: "M15 19l-7-7 7-7"
194
208
  })
195
209
  })
196
- }), /* @__PURE__ */ y("div", { children: [
197
- /* @__PURE__ */ y("div", {
210
+ }), /* @__PURE__ */ v("div", { children: [
211
+ /* @__PURE__ */ v("div", {
198
212
  className: "flex items-center gap-3 flex-wrap",
199
- children: [/* @__PURE__ */ v("h1", {
213
+ children: [/* @__PURE__ */ _("h1", {
200
214
  className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
201
215
  children: U?.name || "Subscription"
202
- }), /* @__PURE__ */ v(n, {
203
- status: we,
216
+ }), /* @__PURE__ */ _(n, {
217
+ status: De,
204
218
  dot: !0,
205
219
  pulse: J,
206
- children: ee(D.status)
220
+ children: f(E.status)
207
221
  })]
208
222
  }),
209
- /* @__PURE__ */ v("p", {
223
+ /* @__PURE__ */ _("p", {
210
224
  className: "text-sm text-text-secondary mt-1",
211
- children: U?.pricingModel === o.PER_SEAT && U.pricePerSeat ? `${c(U.pricePerSeat, U.currency)} / seat / ${d(U.duration)} · ${D.seatCount ?? U.minSeats ?? 1} seats = ${c(U.pricePerSeat * (D.seatCount ?? U.minSeats ?? 1), U.currency)} / ${d(U.duration)}` : U ? `${c(U.price, U.currency)} / ${d(U.duration)}` : "Unknown plan"
225
+ children: U?.pricingModel === o.PER_SEAT && U.pricePerSeat ? `${c(U.pricePerSeat, U.currency)} / seat / ${d(U.duration)} · ${E.seatCount ?? U.minSeats ?? 1} seats = ${c(U.pricePerSeat * (E.seatCount ?? U.minSeats ?? 1), U.currency)} / ${d(U.duration)}` : U ? `${c(U.price, U.currency)} / ${d(U.duration)}` : "Unknown plan"
212
226
  }),
213
- /* @__PURE__ */ v(x, {
227
+ /* @__PURE__ */ _(pe, {
214
228
  className: "mt-3",
215
229
  children: u("billing.subscriptions.detailPurpose", "Everything about this subscription in one view — its billing period, the quotas and add-ons it includes, recent charges and its full status history. Use it to track what you are getting, activate workspace quotas, change your plan, or cancel.")
216
230
  })
217
231
  ] })]
218
- }), /* @__PURE__ */ y("div", {
232
+ }), /* @__PURE__ */ v("div", {
219
233
  className: "flex items-center gap-2",
220
- children: [/* @__PURE__ */ v(ce, {
221
- primary: J && T.canUpdateSubscription ? {
234
+ children: [/* @__PURE__ */ _(fe, {
235
+ primary: J && w.canUpdateSubscription ? {
222
236
  label: "Change Plan",
223
- onSelect: () => S(m(`/subscriptions/${D.id}/upgrade`, E ?? D.billingAccountId))
237
+ onSelect: () => x(m(`/subscriptions/${E.id}/upgrade`, T ?? E.billingAccountId))
224
238
  } : void 0,
225
- actions: [...J && T.canUpdateSubscription && U?.pricingModel === o.PER_SEAT ? [{
239
+ actions: [...J && w.canUpdateSubscription && U?.pricingModel === o.PER_SEAT ? [{
226
240
  label: "Manage Seats",
227
241
  onSelect: () => L(!0)
228
- }] : [], ...J && T.canCancelSubscription && !D.canceledAt ? [{
242
+ }] : [], ...J && w.canCancelSubscription && !E.canceledAt ? [{
229
243
  label: j ? "Canceling…" : "Cancel Subscription",
230
244
  onSelect: () => I(!0),
231
245
  disabled: j,
232
246
  intent: "destructive"
233
247
  }] : []]
234
- }), D.canceledAt && /* @__PURE__ */ v("span", {
248
+ }), E.canceledAt && /* @__PURE__ */ _("span", {
235
249
  className: "px-4 py-2 text-sm font-medium text-status-warning-text bg-status-warning-bg-subtle rounded-button",
236
250
  children: "Cancellation Scheduled"
237
251
  })]
238
252
  })]
239
253
  }),
240
- /* @__PURE__ */ y("div", {
254
+ /* @__PURE__ */ v("div", {
241
255
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
242
- children: [/* @__PURE__ */ y("div", {
256
+ children: [/* @__PURE__ */ v("div", {
243
257
  className: "lg:col-span-2 space-y-6",
244
258
  children: [
245
- J && /* @__PURE__ */ y(le, {
259
+ J && /* @__PURE__ */ v(y, {
246
260
  className: "p-5",
247
- children: [/* @__PURE__ */ y("div", {
261
+ children: [/* @__PURE__ */ v("div", {
248
262
  className: "flex items-center justify-between mb-4",
249
- children: [/* @__PURE__ */ v("h2", {
263
+ children: [/* @__PURE__ */ _("h2", {
250
264
  className: "text-base font-semibold text-text-primary",
251
265
  children: "Current Period"
252
- }), /* @__PURE__ */ y("span", {
266
+ }), /* @__PURE__ */ v("span", {
253
267
  className: "text-sm text-text-secondary tabular-nums",
254
268
  children: [$, " days remaining"]
255
269
  })]
256
- }), /* @__PURE__ */ y("div", {
270
+ }), /* @__PURE__ */ v("div", {
257
271
  className: "space-y-2",
258
- children: [/* @__PURE__ */ v(r, {
259
- value: De,
272
+ children: [/* @__PURE__ */ _(r, {
273
+ value: je,
260
274
  status: "primary",
261
275
  size: "md",
262
276
  "aria-label": "Billing period progress"
263
- }), /* @__PURE__ */ y("div", {
277
+ }), /* @__PURE__ */ v("div", {
264
278
  className: "flex items-center justify-between text-sm text-text-secondary",
265
- children: [/* @__PURE__ */ v("span", { children: l(D.startDate, "short") }), /* @__PURE__ */ v("span", { children: l(D.endDate, "short") })]
279
+ children: [/* @__PURE__ */ _("span", { children: l(E.startDate, "short") }), /* @__PURE__ */ _("span", { children: l(E.endDate, "short") })]
266
280
  })]
267
281
  })]
268
282
  }),
269
- /* @__PURE__ */ y(t, {
283
+ /* @__PURE__ */ v(t, {
270
284
  className: "overflow-hidden",
271
- children: [/* @__PURE__ */ y("div", {
285
+ children: [/* @__PURE__ */ v("div", {
272
286
  className: "p-5 border-b border-border-subtle",
273
- children: [/* @__PURE__ */ y("h2", {
287
+ children: [/* @__PURE__ */ v("h2", {
274
288
  className: "text-base font-semibold text-text-primary",
275
- children: ["Plan Quotas", W.length > 0 && /* @__PURE__ */ y("span", {
289
+ children: ["Plan Quotas", W.length > 0 && /* @__PURE__ */ v("span", {
276
290
  className: "ml-2 text-sm font-normal text-text-muted tabular-nums",
277
291
  children: [
278
292
  "(",
@@ -280,84 +294,84 @@ var w = () => {
280
294
  ")"
281
295
  ]
282
296
  })]
283
- }), /* @__PURE__ */ v("p", {
297
+ }), /* @__PURE__ */ _("p", {
284
298
  className: "text-sm text-text-secondary mt-0.5",
285
299
  children: "Limits included in your plan"
286
300
  })]
287
- }), /* @__PURE__ */ v("div", {
301
+ }), /* @__PURE__ */ _("div", {
288
302
  className: "p-5",
289
- children: W.length === 0 ? /* @__PURE__ */ v("p", {
303
+ children: W.length === 0 ? /* @__PURE__ */ _("p", {
290
304
  className: "text-sm text-text-secondary",
291
305
  children: "No quotas assigned to this subscription."
292
- }) : /* @__PURE__ */ v("div", {
306
+ }) : /* @__PURE__ */ _("div", {
293
307
  className: "space-y-3",
294
- children: W.map((e) => /* @__PURE__ */ v(de, { quota: e }, e.id))
308
+ children: W.map((e) => /* @__PURE__ */ _(me, { quota: e }, e.id))
295
309
  })
296
310
  })]
297
311
  }),
298
- J && P && /* @__PURE__ */ y(t, {
312
+ J && P && /* @__PURE__ */ v(t, {
299
313
  className: "overflow-hidden",
300
314
  children: [
301
- /* @__PURE__ */ y("div", {
315
+ /* @__PURE__ */ v("div", {
302
316
  className: "p-5 border-b border-border-subtle flex items-center justify-between gap-4",
303
- children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h2", {
317
+ children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("h2", {
304
318
  className: "text-base font-semibold text-text-primary",
305
319
  children: "Workspace Quotas"
306
- }), /* @__PURE__ */ v("p", {
320
+ }), /* @__PURE__ */ _("p", {
307
321
  className: "text-sm text-text-secondary mt-0.5",
308
322
  children: "Active limits for your workspace"
309
- })] }), X ? /* @__PURE__ */ v(n, {
323
+ })] }), X ? /* @__PURE__ */ _(n, {
310
324
  status: "success",
311
325
  dot: !0,
312
326
  children: "Active"
313
- }) : /* @__PURE__ */ v("button", {
327
+ }) : /* @__PURE__ */ _("button", {
314
328
  type: "button",
315
329
  onClick: () => R(!0),
316
330
  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",
317
331
  children: "Activate for Workspace"
318
332
  })]
319
333
  }),
320
- /* @__PURE__ */ v("div", {
334
+ /* @__PURE__ */ _("div", {
321
335
  className: "p-5",
322
- children: X ? Y.length > 0 ? /* @__PURE__ */ v("div", {
336
+ children: X ? Y.length > 0 ? /* @__PURE__ */ _("div", {
323
337
  className: "space-y-3",
324
- children: Y.map((e) => /* @__PURE__ */ v(fe, { item: e }, e.assignment.id))
325
- }) : /* @__PURE__ */ y("p", {
338
+ children: Y.map((e) => /* @__PURE__ */ _(he, { item: e }, e.assignment.id))
339
+ }) : /* @__PURE__ */ v("p", {
326
340
  className: "text-sm text-text-secondary",
327
341
  children: [
328
342
  "Quotas are activated on workspace",
329
343
  " ",
330
- /* @__PURE__ */ v("span", {
344
+ /* @__PURE__ */ _("span", {
331
345
  className: "font-mono text-xs text-text-primary bg-bg-sunken/60 rounded px-1.5 py-0.5",
332
- children: D.assignedWorkspaceId
346
+ children: P
333
347
  }),
334
348
  ". Usage data will appear here once quotas are consumed."
335
349
  ]
336
- }) : /* @__PURE__ */ y("div", {
350
+ }) : /* @__PURE__ */ v("div", {
337
351
  className: "flex items-start gap-3",
338
- children: [/* @__PURE__ */ v("div", {
352
+ children: [/* @__PURE__ */ _("div", {
339
353
  className: "size-8 rounded-full bg-status-warning-bg-subtle flex items-center justify-center shrink-0 mt-0.5",
340
- children: /* @__PURE__ */ v("svg", {
354
+ children: /* @__PURE__ */ _("svg", {
341
355
  className: "size-4 text-status-warning-text",
342
356
  fill: "none",
343
357
  viewBox: "0 0 24 24",
344
358
  stroke: "currentColor",
345
- children: /* @__PURE__ */ v("path", {
359
+ children: /* @__PURE__ */ _("path", {
346
360
  strokeLinecap: "round",
347
361
  strokeLinejoin: "round",
348
362
  strokeWidth: 2,
349
363
  d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
350
364
  })
351
365
  })
352
- }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
366
+ }), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
353
367
  className: "text-sm font-medium text-text-primary",
354
368
  children: "Workspace quotas not activated yet"
355
- }), /* @__PURE__ */ y("p", {
369
+ }), /* @__PURE__ */ v("p", {
356
370
  className: "text-sm text-text-secondary mt-0.5",
357
371
  children: [
358
372
  "Click",
359
373
  " ",
360
- /* @__PURE__ */ v("button", {
374
+ /* @__PURE__ */ _("button", {
361
375
  type: "button",
362
376
  onClick: () => R(!0),
363
377
  className: "text-text-link hover:underline font-medium",
@@ -369,32 +383,32 @@ var w = () => {
369
383
  })] })]
370
384
  })
371
385
  }),
372
- Se && /* @__PURE__ */ v(h, {
373
- billingAccountId: E ?? D.billingAccountId,
374
- subscriptionId: D.id,
375
- quotas: [],
386
+ Te && /* @__PURE__ */ _(ae, {
387
+ billingAccountId: T ?? E.billingAccountId,
388
+ subscriptionId: E.id,
389
+ quotas: Oe,
376
390
  workspaces: [{
377
391
  id: P,
378
392
  name: "Current workspace"
379
393
  }],
380
394
  currentWorkspaceId: P,
381
395
  onAssigned: () => {
382
- R(!1), k(), ye();
396
+ R(!1), k(), xe();
383
397
  },
384
398
  onSkip: () => R(!1)
385
399
  })
386
400
  ]
387
401
  }),
388
- G.length > 0 && /* @__PURE__ */ y(t, {
402
+ G.length > 0 && /* @__PURE__ */ v(t, {
389
403
  className: "overflow-hidden",
390
- children: [/* @__PURE__ */ v("div", {
404
+ children: [/* @__PURE__ */ _("div", {
391
405
  className: "p-5 border-b border-border-subtle",
392
- children: /* @__PURE__ */ y("h2", {
406
+ children: /* @__PURE__ */ v("h2", {
393
407
  className: "text-base font-semibold text-text-primary",
394
408
  children: [
395
409
  "Addons",
396
410
  " ",
397
- /* @__PURE__ */ y("span", {
411
+ /* @__PURE__ */ v("span", {
398
412
  className: "text-sm font-normal text-text-muted tabular-nums",
399
413
  children: [
400
414
  "(",
@@ -404,31 +418,31 @@ var w = () => {
404
418
  })
405
419
  ]
406
420
  })
407
- }), /* @__PURE__ */ v("div", {
421
+ }), /* @__PURE__ */ _("div", {
408
422
  className: "p-5",
409
- children: /* @__PURE__ */ v("div", {
423
+ children: /* @__PURE__ */ _("div", {
410
424
  className: "space-y-3",
411
- children: G.map((e) => /* @__PURE__ */ v(pe, { addonSubscription: e }, e.id))
425
+ children: G.map((e) => /* @__PURE__ */ _(ge, { addonSubscription: e }, e.id))
412
426
  })
413
427
  })]
414
428
  }),
415
- K.length > 0 && /* @__PURE__ */ y(t, {
429
+ K.length > 0 && /* @__PURE__ */ v(t, {
416
430
  className: "overflow-hidden",
417
431
  children: [
418
- /* @__PURE__ */ v("div", {
432
+ /* @__PURE__ */ _("div", {
419
433
  className: "p-5 border-b border-border-subtle",
420
- children: /* @__PURE__ */ v("h2", {
434
+ children: /* @__PURE__ */ _("h2", {
421
435
  className: "text-base font-semibold text-text-primary",
422
436
  children: "Recent Transactions"
423
437
  })
424
438
  }),
425
- /* @__PURE__ */ v("div", {
439
+ /* @__PURE__ */ _("div", {
426
440
  className: "divide-y divide-border-subtle",
427
- children: K.slice(0, 5).map((e) => /* @__PURE__ */ v(me, { transaction: e }, e.id))
441
+ children: K.slice(0, 5).map((e) => /* @__PURE__ */ _(_e, { transaction: e }, e.id))
428
442
  }),
429
- K.length > 5 && /* @__PURE__ */ v("div", {
443
+ K.length > 5 && /* @__PURE__ */ _("div", {
430
444
  className: "p-4 text-center border-t border-border-subtle",
431
- children: /* @__PURE__ */ v("button", {
445
+ children: /* @__PURE__ */ _("button", {
432
446
  type: "button",
433
447
  className: "text-sm text-text-link hover:underline",
434
448
  children: "View all transactions"
@@ -437,147 +451,147 @@ var w = () => {
437
451
  ]
438
452
  })
439
453
  ]
440
- }), /* @__PURE__ */ y("div", {
454
+ }), /* @__PURE__ */ v("div", {
441
455
  className: "space-y-6 lg:sticky lg:top-6 lg:self-start",
442
456
  children: [
443
- /* @__PURE__ */ v(ue, {
457
+ /* @__PURE__ */ _(b, {
444
458
  storageKey: "billing-subscription-detail",
445
- steps: Oe
459
+ steps: Me
446
460
  }),
447
- /* @__PURE__ */ y(t, {
461
+ /* @__PURE__ */ v(t, {
448
462
  className: "overflow-hidden",
449
- children: [/* @__PURE__ */ v("div", {
463
+ children: [/* @__PURE__ */ _("div", {
450
464
  className: "p-5 border-b border-border-subtle",
451
- children: /* @__PURE__ */ v("h2", {
465
+ children: /* @__PURE__ */ _("h2", {
452
466
  className: "text-base font-semibold text-text-primary",
453
467
  children: "Details"
454
468
  })
455
- }), /* @__PURE__ */ y("div", {
469
+ }), /* @__PURE__ */ v("div", {
456
470
  className: "p-5 space-y-4",
457
471
  children: [
458
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
472
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
459
473
  className: "text-sm text-text-secondary",
460
474
  children: "Subscription ID"
461
- }), /* @__PURE__ */ v("p", {
475
+ }), /* @__PURE__ */ _("p", {
462
476
  className: "font-mono text-sm text-text-primary mt-0.5 break-all",
463
- children: D.id
477
+ children: E.id
464
478
  })] }),
465
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
479
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
466
480
  className: "text-sm text-text-secondary",
467
481
  children: "Plan"
468
- }), /* @__PURE__ */ v("p", {
482
+ }), /* @__PURE__ */ _("p", {
469
483
  className: "text-sm text-text-primary mt-0.5",
470
484
  children: U?.name || "Unknown"
471
485
  })] }),
472
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
486
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
473
487
  className: "text-sm text-text-secondary",
474
488
  children: "Billing Account"
475
- }), /* @__PURE__ */ v("p", {
489
+ }), /* @__PURE__ */ _("p", {
476
490
  className: "text-sm text-text-primary mt-0.5",
477
- children: D.billingAccount?.name || "Unknown"
491
+ children: E.billingAccount?.name || "Unknown"
478
492
  })] }),
479
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
493
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
480
494
  className: "text-sm text-text-secondary",
481
495
  children: "Start Date"
482
- }), /* @__PURE__ */ v("p", {
496
+ }), /* @__PURE__ */ _("p", {
483
497
  className: "text-sm text-text-primary mt-0.5",
484
- children: l(D.startDate)
498
+ children: l(E.startDate)
485
499
  })] }),
486
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
500
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
487
501
  className: "text-sm text-text-secondary",
488
502
  children: "End Date"
489
- }), /* @__PURE__ */ v("p", {
503
+ }), /* @__PURE__ */ _("p", {
490
504
  className: "text-sm text-text-primary mt-0.5",
491
- children: l(D.endDate)
505
+ children: l(E.endDate)
492
506
  })] }),
493
- D.nextBillingDate && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
507
+ E.nextBillingDate && /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
494
508
  className: "text-sm text-text-secondary",
495
509
  children: "Next Billing"
496
- }), /* @__PURE__ */ v("p", {
510
+ }), /* @__PURE__ */ _("p", {
497
511
  className: "text-sm text-text-primary mt-0.5",
498
- children: l(D.nextBillingDate)
512
+ children: l(E.nextBillingDate)
499
513
  })] }),
500
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
514
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
501
515
  className: "text-sm text-text-secondary",
502
516
  children: "Auto Renewal"
503
- }), /* @__PURE__ */ v("p", {
517
+ }), /* @__PURE__ */ _("p", {
504
518
  className: "text-sm text-text-primary mt-0.5",
505
- children: D.autoRenewal ? "Enabled" : "Disabled"
519
+ children: E.autoRenewal ? "Enabled" : "Disabled"
506
520
  })] }),
507
- D.paymentGateway && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
521
+ E.paymentGateway && /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
508
522
  className: "text-sm text-text-secondary",
509
523
  children: "Payment Gateway"
510
- }), /* @__PURE__ */ v("p", {
524
+ }), /* @__PURE__ */ _("p", {
511
525
  className: "text-sm text-text-primary mt-0.5 capitalize",
512
- children: D.paymentGateway
526
+ children: E.paymentGateway
513
527
  })] })
514
528
  ]
515
529
  })]
516
530
  }),
517
- q.length > 0 && /* @__PURE__ */ y(t, {
531
+ q.length > 0 && /* @__PURE__ */ v(t, {
518
532
  className: "overflow-hidden",
519
- children: [/* @__PURE__ */ v("div", {
533
+ children: [/* @__PURE__ */ _("div", {
520
534
  className: "p-5 border-b border-border-subtle",
521
- children: /* @__PURE__ */ v("h2", {
535
+ children: /* @__PURE__ */ _("h2", {
522
536
  className: "text-base font-semibold text-text-primary",
523
537
  children: "History"
524
538
  })
525
- }), /* @__PURE__ */ v("div", {
539
+ }), /* @__PURE__ */ _("div", {
526
540
  className: "p-5",
527
- children: /* @__PURE__ */ v("div", {
541
+ children: /* @__PURE__ */ _("div", {
528
542
  className: "space-y-3",
529
- children: q.slice(0, 5).map((e) => /* @__PURE__ */ v(he, { item: e }, e.id))
543
+ children: q.slice(0, 5).map((e) => /* @__PURE__ */ _(ve, { item: e }, e.id))
530
544
  })
531
545
  })]
532
546
  })
533
547
  ]
534
548
  })]
535
549
  }),
536
- xe && D && /* @__PURE__ */ v(oe, {
537
- subscription: D,
550
+ we && E && /* @__PURE__ */ _(le, {
551
+ subscription: E,
538
552
  onClose: () => L(!1),
539
553
  onConfirm: async (e) => {
540
554
  await M({
541
- subscriptionId: D.id,
555
+ subscriptionId: E.id,
542
556
  seatCount: e
543
557
  }), await k();
544
558
  },
545
559
  isLoading: N
546
560
  }),
547
- be && /* @__PURE__ */ y("div", {
561
+ Ce && /* @__PURE__ */ v("div", {
548
562
  className: "fixed inset-0 z-50 flex items-center justify-center",
549
- children: [/* @__PURE__ */ v("div", {
563
+ children: [/* @__PURE__ */ _("div", {
550
564
  className: "absolute inset-0 bg-overlay-scrim",
551
565
  onClick: () => I(!1)
552
- }), /* @__PURE__ */ y("div", {
566
+ }), /* @__PURE__ */ v("div", {
553
567
  className: "relative bg-bg-elevated border border-border-seam rounded-card shadow-[var(--shadow-elevation-4)] w-full max-w-md mx-4 p-6",
554
568
  role: "dialog",
555
569
  "aria-modal": "true",
556
570
  "aria-labelledby": "cancel-subscription-title",
557
571
  children: [
558
- /* @__PURE__ */ v("h3", {
572
+ /* @__PURE__ */ _("h3", {
559
573
  id: "cancel-subscription-title",
560
574
  className: "text-lg font-semibold text-text-primary mb-2",
561
575
  children: "Cancel Subscription"
562
576
  }),
563
- /* @__PURE__ */ y("p", {
577
+ /* @__PURE__ */ v("p", {
564
578
  className: "text-sm text-text-secondary mb-4",
565
579
  children: [
566
580
  "Are you sure you want to cancel this subscription? Your subscription will remain active until",
567
581
  " ",
568
- /* @__PURE__ */ v("span", {
582
+ /* @__PURE__ */ _("span", {
569
583
  className: "font-medium text-text-primary",
570
- children: l(D.endDate)
584
+ children: l(E.endDate)
571
585
  }),
572
586
  ", but will not renew automatically."
573
587
  ]
574
588
  }),
575
- /* @__PURE__ */ y("div", {
589
+ /* @__PURE__ */ v("div", {
576
590
  className: "mb-4",
577
- children: [/* @__PURE__ */ v("label", {
591
+ children: [/* @__PURE__ */ _("label", {
578
592
  className: "block text-sm font-medium text-text-primary mb-1",
579
593
  children: "Reason for cancellation (optional)"
580
- }), /* @__PURE__ */ v("textarea", {
594
+ }), /* @__PURE__ */ _("textarea", {
581
595
  value: z,
582
596
  onChange: (e) => B(e.target.value),
583
597
  placeholder: "Please share why you're canceling...",
@@ -585,25 +599,25 @@ var w = () => {
585
599
  rows: 3
586
600
  })]
587
601
  }),
588
- V && /* @__PURE__ */ v("div", {
602
+ V && /* @__PURE__ */ _("div", {
589
603
  className: "mb-4 p-3 bg-status-error-bg-subtle border border-status-error-border rounded-card",
590
- children: /* @__PURE__ */ v("p", {
604
+ children: /* @__PURE__ */ _("p", {
591
605
  className: "text-sm text-status-error-text",
592
606
  children: V
593
607
  })
594
608
  }),
595
- /* @__PURE__ */ y("div", {
609
+ /* @__PURE__ */ v("div", {
596
610
  className: "flex items-center justify-end gap-3",
597
- children: [/* @__PURE__ */ v("button", {
611
+ children: [/* @__PURE__ */ _("button", {
598
612
  type: "button",
599
613
  onClick: () => {
600
614
  I(!1), B(""), H(null);
601
615
  },
602
616
  className: "px-4 py-2 text-sm font-medium text-text-secondary hover:text-text-primary transition-colors",
603
617
  children: "Keep Subscription"
604
- }), /* @__PURE__ */ v("button", {
618
+ }), /* @__PURE__ */ _("button", {
605
619
  type: "button",
606
- onClick: Ce,
620
+ onClick: Ee,
607
621
  disabled: j,
608
622
  className: "px-4 py-2 text-sm font-medium bg-action-danger-bg text-action-danger-text rounded-button hover:bg-action-danger-bgHover transition-colors duration-200 disabled:opacity-50",
609
623
  children: j ? "Canceling..." : "Confirm Cancellation"
@@ -614,23 +628,23 @@ var w = () => {
614
628
  })
615
629
  ]
616
630
  });
617
- }, de = ({ quota: e }) => {
618
- let t = e.context, n = S(e.name, t), r = t?.description && typeof t.description == "string" ? t.description : null, i = e.limits?.value ?? 0, a = e.currentUsageSum ?? 0, o = i > 0 ? Math.min(100, a / i * 100) : 0, c = e.name.includes("bytes") || e.name.includes("storage"), d = e.quotaType === "POOLED";
619
- return /* @__PURE__ */ y("div", {
631
+ }, me = ({ quota: e }) => {
632
+ let t = e.context, n = x(e.name, t), r = t?.description && typeof t.description == "string" ? t.description : null, i = e.limits?.value ?? 0, a = e.currentUsageSum ?? 0, o = i > 0 ? Math.min(100, a / i * 100) : 0, c = e.name.includes("bytes") || e.name.includes("storage"), d = e.quotaType === "POOLED";
633
+ return /* @__PURE__ */ v("div", {
620
634
  className: "p-4 rounded-card border border-border-seam bg-bg-surface",
621
635
  children: [
622
- /* @__PURE__ */ y("div", {
636
+ /* @__PURE__ */ v("div", {
623
637
  className: "flex items-start justify-between gap-4 mb-2",
624
- children: [/* @__PURE__ */ y("div", {
638
+ children: [/* @__PURE__ */ v("div", {
625
639
  className: "min-w-0",
626
- children: [/* @__PURE__ */ v("p", {
640
+ children: [/* @__PURE__ */ _("p", {
627
641
  className: "font-medium text-text-primary truncate",
628
642
  children: n
629
- }), r && /* @__PURE__ */ v("p", {
643
+ }), r && /* @__PURE__ */ _("p", {
630
644
  className: "text-xs text-text-secondary mt-0.5 line-clamp-2",
631
645
  children: r
632
646
  })]
633
- }), /* @__PURE__ */ y("span", {
647
+ }), /* @__PURE__ */ v("span", {
634
648
  className: "text-sm font-medium text-text-primary shrink-0 tabular-nums",
635
649
  children: [
636
650
  c ? s(a) : a.toLocaleString(),
@@ -639,21 +653,21 @@ var w = () => {
639
653
  ]
640
654
  })]
641
655
  }),
642
- i > 0 && /* @__PURE__ */ v("div", {
656
+ i > 0 && /* @__PURE__ */ _("div", {
643
657
  className: "h-1.5 rounded-full bg-bg-sunken overflow-hidden mb-2",
644
- children: /* @__PURE__ */ v("div", {
645
- className: `h-full rounded-full transition-all duration-300 ${f(o)}`,
658
+ children: /* @__PURE__ */ _("div", {
659
+ className: `h-full rounded-full transition-all duration-300 ${p(o)}`,
646
660
  style: { width: `${o}%` }
647
661
  })
648
662
  }),
649
- /* @__PURE__ */ y("div", {
663
+ /* @__PURE__ */ v("div", {
650
664
  className: "flex items-center justify-between text-xs text-text-secondary",
651
- children: [/* @__PURE__ */ v("span", {
665
+ children: [/* @__PURE__ */ _("span", {
652
666
  className: "px-1.5 py-0.5 rounded bg-bg-sunken font-medium",
653
667
  children: d ? "Shared" : "Per Workspace"
654
- }), /* @__PURE__ */ y("div", {
668
+ }), /* @__PURE__ */ v("div", {
655
669
  className: "flex items-center gap-3",
656
- children: [e.endtime && /* @__PURE__ */ y("span", { children: ["Expires ", l(e.endtime, "short")] }), i > 0 && /* @__PURE__ */ y("span", {
670
+ children: [e.endtime && /* @__PURE__ */ v("span", { children: ["Expires ", l(e.endtime, "short")] }), i > 0 && /* @__PURE__ */ v("span", {
657
671
  className: o >= 90 ? "text-status-error-text font-medium" : o >= 70 ? "text-status-warning-text font-medium" : "",
658
672
  children: [u(o), " used"]
659
673
  })]
@@ -661,23 +675,23 @@ var w = () => {
661
675
  })
662
676
  ]
663
677
  });
664
- }, fe = ({ item: e }) => {
665
- let { assignment: t, effectiveUsed: n, usagePercentage: r } = e, i = S(t.quotaName), a = !t.noLimit && t.limit !== null, o = t.limit ?? 0, c = t.quotaName.includes("bytes") || t.quotaName.includes("storage"), d = C(t.resetPeriod);
666
- return /* @__PURE__ */ y("div", {
678
+ }, he = ({ item: e }) => {
679
+ let { assignment: t, effectiveUsed: n, usagePercentage: r } = e, i = x(t.quotaName), a = !t.noLimit && t.limit !== null, o = t.limit ?? 0, c = t.quotaName.includes("bytes") || t.quotaName.includes("storage"), d = S(t.resetPeriod);
680
+ return /* @__PURE__ */ v("div", {
667
681
  className: "p-4 rounded-card border border-border-seam bg-bg-surface",
668
682
  children: [
669
- /* @__PURE__ */ y("div", {
683
+ /* @__PURE__ */ v("div", {
670
684
  className: "flex items-start justify-between gap-4 mb-2",
671
- children: [/* @__PURE__ */ y("div", {
685
+ children: [/* @__PURE__ */ v("div", {
672
686
  className: "min-w-0",
673
- children: [/* @__PURE__ */ v("p", {
687
+ children: [/* @__PURE__ */ _("p", {
674
688
  className: "font-medium text-text-primary truncate",
675
689
  children: i
676
- }), /* @__PURE__ */ y("p", {
690
+ }), /* @__PURE__ */ v("p", {
677
691
  className: "text-xs text-text-secondary mt-0.5",
678
692
  children: [t.quotaMode === "pooled" ? "Pooled across workspaces" : "Dedicated", d && ` · ${d}`]
679
693
  })]
680
- }), /* @__PURE__ */ y("span", {
694
+ }), /* @__PURE__ */ v("span", {
681
695
  className: "text-sm font-medium text-text-primary shrink-0 tabular-nums",
682
696
  children: [
683
697
  c ? s(n) : n.toLocaleString(),
@@ -686,83 +700,83 @@ var w = () => {
686
700
  ]
687
701
  })]
688
702
  }),
689
- a && /* @__PURE__ */ v("div", {
703
+ a && /* @__PURE__ */ _("div", {
690
704
  className: "h-1.5 rounded-full bg-bg-sunken overflow-hidden mb-2",
691
- children: /* @__PURE__ */ v("div", {
692
- className: `h-full rounded-full transition-all duration-300 ${f(r)}`,
705
+ children: /* @__PURE__ */ _("div", {
706
+ className: `h-full rounded-full transition-all duration-300 ${p(r)}`,
693
707
  style: { width: `${Math.min(100, r)}%` }
694
708
  })
695
709
  }),
696
- /* @__PURE__ */ y("div", {
710
+ /* @__PURE__ */ v("div", {
697
711
  className: "flex items-center justify-between text-xs text-text-secondary",
698
- children: [/* @__PURE__ */ y("span", { children: ["Since ", l(t.createdAt, "short")] }), a && /* @__PURE__ */ y("span", {
712
+ children: [/* @__PURE__ */ v("span", { children: ["Since ", l(t.createdAt, "short")] }), a && /* @__PURE__ */ v("span", {
699
713
  className: r >= 90 ? "text-status-error-text font-medium" : r >= 70 ? "text-status-warning-text font-medium" : "",
700
714
  children: [u(r), " used"]
701
715
  })]
702
716
  })
703
717
  ]
704
718
  });
705
- }, pe = ({ addonSubscription: e }) => {
719
+ }, ge = ({ addonSubscription: e }) => {
706
720
  let t = e.addon;
707
- return /* @__PURE__ */ y("div", {
721
+ return /* @__PURE__ */ v("div", {
708
722
  className: "flex items-center justify-between p-3 rounded-card border border-border-seam bg-bg-sunken",
709
- children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
723
+ children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
710
724
  className: "font-medium text-text-primary",
711
725
  children: t?.name || "Unknown Addon"
712
- }), /* @__PURE__ */ y("p", {
726
+ }), /* @__PURE__ */ v("p", {
713
727
  className: "text-sm text-text-secondary",
714
728
  children: ["Qty: ", e.quantity]
715
- })] }), t && /* @__PURE__ */ v("p", {
729
+ })] }), t && /* @__PURE__ */ _("p", {
716
730
  className: "text-sm font-medium text-text-primary tabular-nums",
717
731
  children: c(t.price * e.quantity, t.currency)
718
732
  })]
719
733
  });
720
- }, me = ({ transaction: e }) => /* @__PURE__ */ y("div", {
734
+ }, _e = ({ transaction: e }) => /* @__PURE__ */ v("div", {
721
735
  className: "flex items-center justify-between px-5 py-4 hover:bg-bg-sunken transition-colors",
722
- children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
736
+ children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
723
737
  className: "font-medium text-text-primary capitalize",
724
738
  children: e.type
725
- }), /* @__PURE__ */ v("p", {
739
+ }), /* @__PURE__ */ _("p", {
726
740
  className: "text-sm text-text-secondary",
727
741
  children: l(e.createdAt, "short")
728
- })] }), /* @__PURE__ */ y("div", {
742
+ })] }), /* @__PURE__ */ v("div", {
729
743
  className: "text-right",
730
- children: [/* @__PURE__ */ y("p", {
744
+ children: [/* @__PURE__ */ v("p", {
731
745
  className: `font-medium tabular-nums ${e.type === "refund" ? "text-status-error-text" : "text-text-primary"}`,
732
746
  children: [e.type === "refund" ? "-" : "", c(e.amount, e.currency)]
733
- }), /* @__PURE__ */ v("p", {
747
+ }), /* @__PURE__ */ _("p", {
734
748
  className: "text-sm text-text-secondary capitalize",
735
749
  children: e.status
736
750
  })]
737
751
  })]
738
- }), he = ({ item: e }) => /* @__PURE__ */ y("div", {
752
+ }), ve = ({ item: e }) => /* @__PURE__ */ v("div", {
739
753
  className: "flex items-start gap-3",
740
- children: [/* @__PURE__ */ v("div", { className: "size-2 rounded-full bg-text-muted mt-2 shrink-0" }), /* @__PURE__ */ y("div", { children: [
741
- /* @__PURE__ */ y("p", {
754
+ children: [/* @__PURE__ */ _("div", { className: "size-2 rounded-full bg-text-muted mt-2 shrink-0" }), /* @__PURE__ */ v("div", { children: [
755
+ /* @__PURE__ */ v("p", {
742
756
  className: "text-sm text-text-primary",
743
757
  children: [
744
- /* @__PURE__ */ v("span", {
758
+ /* @__PURE__ */ _("span", {
745
759
  className: "capitalize",
746
760
  children: e.fromStatus
747
761
  }),
748
762
  " → ",
749
- /* @__PURE__ */ v("span", {
763
+ /* @__PURE__ */ _("span", {
750
764
  className: "capitalize font-medium",
751
765
  children: e.toStatus
752
766
  })
753
767
  ]
754
768
  }),
755
- e.reason && /* @__PURE__ */ v("p", {
769
+ e.reason && /* @__PURE__ */ _("p", {
756
770
  className: "text-xs text-text-secondary mt-0.5",
757
771
  children: e.reason
758
772
  }),
759
- /* @__PURE__ */ v("p", {
773
+ /* @__PURE__ */ _("p", {
760
774
  className: "text-xs text-text-secondary mt-0.5",
761
775
  children: l(e.createdAt, "short")
762
776
  })
763
777
  ] })]
764
778
  });
765
779
  //#endregion
766
- export { w as SubscriptionDetailPage };
780
+ export { C as SubscriptionDetailPage };
767
781
 
768
782
  //# sourceMappingURL=SubscriptionDetailPage.js.map