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