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