@burdenoff/microfe-billing 2026.830.1 → 2026.830.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/BillingRoot.js +56 -59
- package/dist/billing/BillingRoot.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +163 -168
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/dashboard/pages/OverviewPage.js +251 -254
- package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansListPage.js +179 -185
- package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/SettingsPage.js +285 -289
- package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +191 -198
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
- package/dist/billing/shared/components/AccessDenied.js +12 -15
- package/dist/billing/shared/components/AccessDenied.js.map +1 -1
- package/dist/billing/shared/components/ActorIdentity.js +34 -33
- package/dist/billing/shared/components/ActorIdentity.js.map +1 -1
- package/dist/billing/shared/components/ServerError.js +27 -30
- package/dist/billing/shared/components/ServerError.js.map +1 -1
- package/dist/billing/shared/hooks/index.js +1 -0
- package/dist/billing/shared/hooks/useTr.js +14 -0
- package/dist/billing/shared/hooks/useTr.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,248 +1,248 @@
|
|
|
1
1
|
import { useBilling as e } from "../../../providers/BillingProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useTr as t } from "../../../shared/hooks/useTr.js";
|
|
3
|
+
import { AccessDenied as n } from "../../../shared/components/AccessDenied.js";
|
|
4
|
+
import { PageHeader as ee } from "../../../shared/components/PageHeader.js";
|
|
4
5
|
import "../../../shared/components/index.js";
|
|
5
|
-
import { useBillingEventEmitter as
|
|
6
|
-
import { directBillingGraphqlRequest as
|
|
6
|
+
import { useBillingEventEmitter as te } from "../../../hooks/useBillingEventEmitter.js";
|
|
7
|
+
import { directBillingGraphqlRequest as r } from "../../../shared/utils/directBillingGraphql.js";
|
|
7
8
|
import "../../../shared/utils/index.js";
|
|
8
|
-
import { useBillingPermissions as
|
|
9
|
-
import { ArchiveBillingAccountSettingsDocument as
|
|
10
|
-
import { useCallback as
|
|
11
|
-
import { Fragment as
|
|
12
|
-
import {
|
|
13
|
-
import { AlertDialog as de, AlertDialogAction as fe, AlertDialogCancel as pe, AlertDialogContent as me, AlertDialogDescription as he, AlertDialogFooter as ge, AlertDialogHeader as _e, AlertDialogTitle as l, OptionalFields as u, PagePurpose as ve } from "@burdenoff/fe-libs/ui";
|
|
9
|
+
import { useBillingPermissions as i } from "../../../hooks/useBillingPermissions.js";
|
|
10
|
+
import { ArchiveBillingAccountSettingsDocument as ne, useGetBillingAccountSettingsQuery as re, useGetBillingAccountsSettingsQuery as ie, useGetDefaultBillingAccountSettingsQuery as ae, useSetDefaultBillingAccountSettingsMutation as a, useUpdateBillingAccountSettingsMutation as oe } from "../../../../generated/global-operations.js";
|
|
11
|
+
import { useCallback as o, useEffect as se, useMemo as s, useState as c } from "react";
|
|
12
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
13
|
+
import { AlertDialog as ce, AlertDialogAction as le, AlertDialogCancel as ue, AlertDialogContent as de, AlertDialogDescription as fe, AlertDialogFooter as pe, AlertDialogHeader as me, AlertDialogTitle as f, OptionalFields as he, PagePurpose as ge } from "@burdenoff/fe-libs/ui";
|
|
14
14
|
//#region src/billing/modules/settings/pages/SettingsPage.tsx
|
|
15
|
-
var
|
|
15
|
+
var _e = () => {
|
|
16
16
|
if (!(typeof window > "u")) return new URLSearchParams(window.location.search).get("billingAccountId") || void 0;
|
|
17
|
-
},
|
|
18
|
-
let {
|
|
19
|
-
let n = d(e);
|
|
20
|
-
return n === e ? t : n;
|
|
21
|
-
}, p = ne(), { apiGatewayUrl: m, authToken: h, orgId: g } = e(), { emit: _ } = ee(), [v, y] = a(ye), [b, x] = a(!1), [S, C] = a(!1), [w, T] = a(!1), [be, E] = a(!1), [D, O] = a(null), [xe, k] = a(!1), [A, j] = a(!1), [M, N] = a(!1), [P, F] = a({
|
|
17
|
+
}, p = () => {
|
|
18
|
+
let p = t(), m = i(), { apiGatewayUrl: h, authToken: g, orgId: _ } = e(), { emit: v } = te(), [y, b] = c(_e), [x, S] = c(!1), [C, w] = c(!1), [T, E] = c(!1), [ve, D] = c(!1), [O, k] = c(null), [ye, A] = c(!1), [j, M] = c(!1), [N, P] = c(!1), [F, I] = c({
|
|
22
19
|
name: "",
|
|
23
20
|
email: "",
|
|
24
21
|
billingEmail: "",
|
|
25
22
|
currency: "USD",
|
|
26
23
|
taxId: "",
|
|
27
24
|
isDefault: !1
|
|
28
|
-
}), { data:
|
|
29
|
-
variables: { id:
|
|
30
|
-
skip: !
|
|
31
|
-
}),
|
|
32
|
-
if (
|
|
33
|
-
if (
|
|
34
|
-
let e =
|
|
25
|
+
}), { data: L, loading: be, refetch: R } = ie({}), z = s(() => L?.getBillingAccountsByOrg || [], [L?.getBillingAccountsByOrg]), { data: xe, loading: Se, refetch: B } = ae({}), V = xe?.getDefaultBillingAccount || null, { data: Ce, loading: H, refetch: U } = re({
|
|
26
|
+
variables: { id: y },
|
|
27
|
+
skip: !y
|
|
28
|
+
}), W = Ce?.getBillingAccount || null, [G] = oe(), [K] = a(), q = s(() => {
|
|
29
|
+
if (y) {
|
|
30
|
+
if (W) return W;
|
|
31
|
+
let e = z.find((e) => e.id === y);
|
|
35
32
|
if (e) return e;
|
|
36
|
-
if (
|
|
33
|
+
if (H) return null;
|
|
37
34
|
}
|
|
38
|
-
return
|
|
35
|
+
return V;
|
|
39
36
|
}, [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
]),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
name:
|
|
49
|
-
email:
|
|
50
|
-
billingEmail:
|
|
51
|
-
currency:
|
|
52
|
-
taxId:
|
|
53
|
-
isDefault:
|
|
37
|
+
y,
|
|
38
|
+
W,
|
|
39
|
+
z,
|
|
40
|
+
H,
|
|
41
|
+
V
|
|
42
|
+
]), we = be || Se || y && H;
|
|
43
|
+
se(() => {
|
|
44
|
+
q && I({
|
|
45
|
+
name: q.name || "",
|
|
46
|
+
email: q.email || "",
|
|
47
|
+
billingEmail: q.billingEmail || "",
|
|
48
|
+
currency: q.currency || "USD",
|
|
49
|
+
taxId: q.taxId || "",
|
|
50
|
+
isDefault: q.isDefault || !1
|
|
54
51
|
});
|
|
55
|
-
}, [
|
|
56
|
-
let
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
|
|
52
|
+
}, [q]);
|
|
53
|
+
let Te = (e) => {
|
|
54
|
+
b(e.id), S(!1), A(!1), k(null);
|
|
55
|
+
}, J = (e, t) => {
|
|
56
|
+
I((n) => ({
|
|
60
57
|
...n,
|
|
61
58
|
[e]: t
|
|
62
|
-
})),
|
|
63
|
-
},
|
|
64
|
-
if (
|
|
65
|
-
|
|
59
|
+
})), A(!1), k(null);
|
|
60
|
+
}, Y = s(() => z.find((e) => e.isDefault) || null, [z]), Ee = s(() => q ? F.name !== (q.name || "") || F.email !== (q.email || "") || F.billingEmail !== (q.billingEmail || "") || F.currency !== (q.currency || "USD") || F.taxId !== (q.taxId || "") || F.isDefault !== (q.isDefault || !1) : !1, [F, q]), X = F.isDefault && !q?.isDefault, Z = X && Y && Y.id !== q?.id, Q = o(async () => {
|
|
61
|
+
if (q?.id) {
|
|
62
|
+
w(!0), k(null), A(!1), M(!1), P(!1);
|
|
66
63
|
try {
|
|
67
|
-
await
|
|
68
|
-
id:
|
|
69
|
-
name:
|
|
70
|
-
email:
|
|
71
|
-
billingEmail:
|
|
72
|
-
currency:
|
|
73
|
-
taxId:
|
|
74
|
-
} } }),
|
|
64
|
+
await G({ variables: { input: {
|
|
65
|
+
id: q.id,
|
|
66
|
+
name: F.name,
|
|
67
|
+
email: F.email,
|
|
68
|
+
billingEmail: F.billingEmail || null,
|
|
69
|
+
currency: F.currency,
|
|
70
|
+
taxId: F.taxId || null
|
|
71
|
+
} } }), v("billing.billing_account.updated", {
|
|
75
72
|
route: "/billing/settings",
|
|
76
|
-
entityId:
|
|
73
|
+
entityId: q.id,
|
|
77
74
|
source: "settings"
|
|
78
|
-
}), X && (await
|
|
79
|
-
variables: { id:
|
|
75
|
+
}), X && (await K({
|
|
76
|
+
variables: { id: q.id },
|
|
80
77
|
refetchQueries: ["GetBillingAccountsByTenant", "GetDefaultBillingAccount"]
|
|
81
|
-
}),
|
|
78
|
+
}), v("billing.billing_account.updated", {
|
|
82
79
|
route: "/billing/settings",
|
|
83
|
-
entityId:
|
|
80
|
+
entityId: q.id,
|
|
84
81
|
source: "settings.default"
|
|
85
|
-
})),
|
|
82
|
+
})), y ? await U() : await B(), A(!0), setTimeout(() => A(!1), 3e3);
|
|
86
83
|
} catch (e) {
|
|
87
|
-
|
|
84
|
+
k(e instanceof Error ? e.message : "Failed to save changes");
|
|
88
85
|
} finally {
|
|
89
|
-
|
|
86
|
+
w(!1);
|
|
90
87
|
}
|
|
91
88
|
}
|
|
92
89
|
}, [
|
|
93
|
-
|
|
94
|
-
|
|
90
|
+
q?.id,
|
|
91
|
+
F,
|
|
95
92
|
X,
|
|
96
|
-
W,
|
|
97
93
|
G,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
94
|
+
K,
|
|
95
|
+
y,
|
|
96
|
+
U,
|
|
97
|
+
B,
|
|
98
|
+
v
|
|
99
|
+
]), De = o(() => {
|
|
100
|
+
q?.id && (Z ? (P(!0), M(!0)) : Q());
|
|
104
101
|
}, [
|
|
105
|
-
|
|
102
|
+
q?.id,
|
|
106
103
|
Z,
|
|
107
104
|
Q
|
|
108
|
-
]), $ =
|
|
109
|
-
|
|
110
|
-
|
|
105
|
+
]), $ = s(() => q ? z.find((e) => e.id !== q.id && e.isActive) : void 0, [q, z]), Oe = q ? q.isDefault ? $ ? p("billing.settings.archiveDefaultConfirm", "Archive {{accountName}}? {{replacementName}} will become the default account.", {
|
|
106
|
+
accountName: q.name,
|
|
107
|
+
replacementName: $.name
|
|
108
|
+
}) : p("billing.settings.archiveDefaultNoReplacementConfirm", "Archive {{accountName}}? No replacement default account is available.", { accountName: q.name }) : p("billing.settings.archiveConfirm", "Archive {{accountName}}?", { accountName: q.name }) : "", ke = o(async () => {
|
|
109
|
+
if (!(!q?.id || !q.isActive)) {
|
|
110
|
+
E(!0), k(null), A(!1);
|
|
111
111
|
try {
|
|
112
|
-
await
|
|
113
|
-
apiGatewayUrl:
|
|
114
|
-
authToken:
|
|
115
|
-
orgId:
|
|
116
|
-
query:
|
|
112
|
+
await r({
|
|
113
|
+
apiGatewayUrl: h,
|
|
114
|
+
authToken: g,
|
|
115
|
+
orgId: _,
|
|
116
|
+
query: ne,
|
|
117
117
|
variables: {
|
|
118
|
-
id:
|
|
118
|
+
id: q.id,
|
|
119
119
|
reason: "Archived from billing settings",
|
|
120
|
-
replacementDefaultBillingAccountId:
|
|
120
|
+
replacementDefaultBillingAccountId: q.isDefault ? $?.id ?? null : null
|
|
121
121
|
}
|
|
122
|
-
}),
|
|
122
|
+
}), v("billing.billing_account.archived", {
|
|
123
123
|
route: "/billing/settings",
|
|
124
|
-
entityId:
|
|
124
|
+
entityId: q.id,
|
|
125
125
|
source: "settings"
|
|
126
|
-
}), await Promise.all([
|
|
126
|
+
}), await Promise.all([R(), B()]), b($?.id), A(!0), setTimeout(() => A(!1), 3e3);
|
|
127
127
|
} catch (e) {
|
|
128
|
-
|
|
128
|
+
k(e instanceof Error ? e.message : "Failed to archive billing account");
|
|
129
129
|
} finally {
|
|
130
|
-
|
|
130
|
+
E(!1);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
}, [
|
|
134
|
-
m,
|
|
135
134
|
h,
|
|
136
|
-
K,
|
|
137
|
-
$,
|
|
138
135
|
g,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
_
|
|
136
|
+
q,
|
|
137
|
+
$,
|
|
138
|
+
_,
|
|
139
|
+
R,
|
|
140
|
+
B,
|
|
141
|
+
v
|
|
142
142
|
]);
|
|
143
|
-
return
|
|
143
|
+
return m.canManageBillingAccount ? we && !q ? /* @__PURE__ */ d("div", {
|
|
144
144
|
className: "space-y-6 p-6",
|
|
145
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ u("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ u("div", {
|
|
146
146
|
className: "border border-border-subtle rounded-lg p-6 space-y-4",
|
|
147
147
|
children: [
|
|
148
148
|
1,
|
|
149
149
|
2,
|
|
150
150
|
3
|
|
151
|
-
].map((e) => /* @__PURE__ */
|
|
151
|
+
].map((e) => /* @__PURE__ */ u("div", { className: "h-10 bg-bg-sunken animate-pulse rounded" }, e))
|
|
152
152
|
})]
|
|
153
|
-
}) : /* @__PURE__ */
|
|
153
|
+
}) : /* @__PURE__ */ d("div", {
|
|
154
154
|
className: "space-y-6 p-6",
|
|
155
155
|
children: [
|
|
156
|
-
/* @__PURE__ */
|
|
157
|
-
title:
|
|
158
|
-
description:
|
|
156
|
+
/* @__PURE__ */ u(ee, {
|
|
157
|
+
title: p("billing.settings.billingSettings", "Billing Settings"),
|
|
158
|
+
description: p("billing.settings.description", "Manage your billing account configuration")
|
|
159
159
|
}),
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
|
|
160
|
+
/* @__PURE__ */ u(ge, { children: p("billing.settings.purpose", "Configure how a billing account behaves — its name and contact details, default currency, tax information and whether it's your default account. Changes here affect how invoices are generated and which account new purchases bill to.") }),
|
|
161
|
+
z.length > 1 && /* @__PURE__ */ d("div", {
|
|
162
162
|
className: "relative",
|
|
163
|
-
children: [/* @__PURE__ */
|
|
163
|
+
children: [/* @__PURE__ */ d("button", {
|
|
164
164
|
type: "button",
|
|
165
|
-
onClick: () =>
|
|
165
|
+
onClick: () => S(!x),
|
|
166
166
|
className: "w-full sm:w-auto flex items-center justify-between gap-3 px-4 py-3 border border-border-subtle rounded-lg bg-bg-surface hover:bg-bg-sunken/50 transition-colors",
|
|
167
|
-
children: [/* @__PURE__ */
|
|
167
|
+
children: [/* @__PURE__ */ d("div", {
|
|
168
168
|
className: "flex items-center gap-3",
|
|
169
|
-
children: [/* @__PURE__ */
|
|
169
|
+
children: [/* @__PURE__ */ u("div", {
|
|
170
170
|
className: "size-8 rounded-lg bg-action-primary-bg/10 flex items-center justify-center",
|
|
171
|
-
children: /* @__PURE__ */
|
|
171
|
+
children: /* @__PURE__ */ u("svg", {
|
|
172
172
|
className: "size-4 text-primary",
|
|
173
173
|
fill: "none",
|
|
174
174
|
viewBox: "0 0 24 24",
|
|
175
175
|
stroke: "currentColor",
|
|
176
|
-
children: /* @__PURE__ */
|
|
176
|
+
children: /* @__PURE__ */ u("path", {
|
|
177
177
|
strokeLinecap: "round",
|
|
178
178
|
strokeLinejoin: "round",
|
|
179
179
|
strokeWidth: 2,
|
|
180
180
|
d: "M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"
|
|
181
181
|
})
|
|
182
182
|
})
|
|
183
|
-
}), /* @__PURE__ */
|
|
183
|
+
}), /* @__PURE__ */ d("div", {
|
|
184
184
|
className: "text-left",
|
|
185
|
-
children: [/* @__PURE__ */
|
|
185
|
+
children: [/* @__PURE__ */ u("p", {
|
|
186
186
|
className: "text-sm font-medium text-text-primary",
|
|
187
|
-
children:
|
|
188
|
-
}), /* @__PURE__ */
|
|
187
|
+
children: q?.name || p("billing.settings.selectAccount", "Select Account")
|
|
188
|
+
}), /* @__PURE__ */ u("p", {
|
|
189
189
|
className: "text-xs text-text-secondary",
|
|
190
|
-
children:
|
|
190
|
+
children: q?.email
|
|
191
191
|
})]
|
|
192
192
|
})]
|
|
193
|
-
}), /* @__PURE__ */
|
|
194
|
-
className: `size-4 text-text-secondary transition-transform ${
|
|
193
|
+
}), /* @__PURE__ */ u("svg", {
|
|
194
|
+
className: `size-4 text-text-secondary transition-transform ${x ? "rotate-180" : ""}`,
|
|
195
195
|
fill: "none",
|
|
196
196
|
viewBox: "0 0 24 24",
|
|
197
197
|
stroke: "currentColor",
|
|
198
|
-
children: /* @__PURE__ */
|
|
198
|
+
children: /* @__PURE__ */ u("path", {
|
|
199
199
|
strokeLinecap: "round",
|
|
200
200
|
strokeLinejoin: "round",
|
|
201
201
|
strokeWidth: 2,
|
|
202
202
|
d: "M19 9l-7 7-7-7"
|
|
203
203
|
})
|
|
204
204
|
})]
|
|
205
|
-
}),
|
|
205
|
+
}), x && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", {
|
|
206
206
|
className: "fixed inset-0 z-10",
|
|
207
|
-
onClick: () =>
|
|
208
|
-
}), /* @__PURE__ */
|
|
207
|
+
onClick: () => S(!1)
|
|
208
|
+
}), /* @__PURE__ */ u("div", {
|
|
209
209
|
className: "absolute top-full left-0 right-0 sm:right-auto mt-1 w-full sm:w-80 bg-popover border border-border-subtle rounded-lg shadow-lg z-20 py-1 max-h-60 overflow-y-auto",
|
|
210
|
-
children:
|
|
210
|
+
children: z.map((e) => /* @__PURE__ */ d("button", {
|
|
211
211
|
type: "button",
|
|
212
|
-
onClick: () =>
|
|
212
|
+
onClick: () => Te(e),
|
|
213
213
|
className: "w-full flex items-center justify-between gap-3 px-4 py-3 hover:bg-bg-sunken transition-colors",
|
|
214
|
-
children: [/* @__PURE__ */
|
|
214
|
+
children: [/* @__PURE__ */ d("div", {
|
|
215
215
|
className: "flex items-center gap-3 min-w-0",
|
|
216
|
-
children: [/* @__PURE__ */
|
|
216
|
+
children: [/* @__PURE__ */ u("div", {
|
|
217
217
|
className: "size-8 rounded-lg bg-bg-sunken flex items-center justify-center flex-shrink-0",
|
|
218
|
-
children: /* @__PURE__ */
|
|
218
|
+
children: /* @__PURE__ */ u("svg", {
|
|
219
219
|
className: "size-4 text-text-secondary",
|
|
220
220
|
fill: "none",
|
|
221
221
|
viewBox: "0 0 24 24",
|
|
222
222
|
stroke: "currentColor",
|
|
223
|
-
children: /* @__PURE__ */
|
|
223
|
+
children: /* @__PURE__ */ u("path", {
|
|
224
224
|
strokeLinecap: "round",
|
|
225
225
|
strokeLinejoin: "round",
|
|
226
226
|
strokeWidth: 2,
|
|
227
227
|
d: "M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"
|
|
228
228
|
})
|
|
229
229
|
})
|
|
230
|
-
}), /* @__PURE__ */
|
|
230
|
+
}), /* @__PURE__ */ d("div", {
|
|
231
231
|
className: "text-left min-w-0",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
232
|
+
children: [/* @__PURE__ */ u("p", {
|
|
233
233
|
className: "text-sm font-medium text-text-primary truncate",
|
|
234
234
|
children: e.name
|
|
235
|
-
}), /* @__PURE__ */
|
|
235
|
+
}), /* @__PURE__ */ u("p", {
|
|
236
236
|
className: "text-xs text-text-secondary truncate",
|
|
237
237
|
children: e.email
|
|
238
238
|
})]
|
|
239
239
|
})]
|
|
240
|
-
}),
|
|
240
|
+
}), q?.id === e.id && /* @__PURE__ */ u("svg", {
|
|
241
241
|
className: "size-4 text-primary flex-shrink-0",
|
|
242
242
|
fill: "none",
|
|
243
243
|
viewBox: "0 0 24 24",
|
|
244
244
|
stroke: "currentColor",
|
|
245
|
-
children: /* @__PURE__ */
|
|
245
|
+
children: /* @__PURE__ */ u("path", {
|
|
246
246
|
strokeLinecap: "round",
|
|
247
247
|
strokeLinejoin: "round",
|
|
248
248
|
strokeWidth: 2,
|
|
@@ -252,397 +252,393 @@ var ye = () => {
|
|
|
252
252
|
}, e.id))
|
|
253
253
|
})] })]
|
|
254
254
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ d("div", {
|
|
256
256
|
className: "border border-border-subtle rounded-lg bg-bg-surface",
|
|
257
|
-
children: [/* @__PURE__ */
|
|
257
|
+
children: [/* @__PURE__ */ u("div", {
|
|
258
258
|
className: "p-6 border-b border-border-subtle",
|
|
259
|
-
children: /* @__PURE__ */
|
|
259
|
+
children: /* @__PURE__ */ d("div", {
|
|
260
260
|
className: "flex items-center justify-between",
|
|
261
|
-
children: [/* @__PURE__ */
|
|
261
|
+
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h2", {
|
|
262
262
|
className: "text-lg font-semibold text-text-primary",
|
|
263
|
-
children:
|
|
264
|
-
}), /* @__PURE__ */
|
|
263
|
+
children: p("billing.settings.accountInfo", "Account Information")
|
|
264
|
+
}), /* @__PURE__ */ u("p", {
|
|
265
265
|
className: "text-sm text-text-secondary mt-1",
|
|
266
|
-
children:
|
|
267
|
-
})] }),
|
|
266
|
+
children: p("billing.settings.accountInfoDescription", "Update your billing contact details and tax information")
|
|
267
|
+
})] }), q?.isDefault && /* @__PURE__ */ d("span", {
|
|
268
268
|
className: "inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium bg-action-primary-bg/10 text-primary rounded-full",
|
|
269
|
-
children: [/* @__PURE__ */
|
|
269
|
+
children: [/* @__PURE__ */ u("svg", {
|
|
270
270
|
className: "size-3",
|
|
271
271
|
fill: "currentColor",
|
|
272
272
|
viewBox: "0 0 20 20",
|
|
273
|
-
children: /* @__PURE__ */
|
|
273
|
+
children: /* @__PURE__ */ u("path", {
|
|
274
274
|
fillRule: "evenodd",
|
|
275
275
|
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
|
|
276
276
|
clipRule: "evenodd"
|
|
277
277
|
})
|
|
278
|
-
}),
|
|
278
|
+
}), p("billing.settings.defaultAccount", "Default Account")]
|
|
279
279
|
})]
|
|
280
280
|
})
|
|
281
|
-
}), /* @__PURE__ */
|
|
281
|
+
}), /* @__PURE__ */ d("div", {
|
|
282
282
|
className: "p-6 space-y-6",
|
|
283
283
|
children: [
|
|
284
|
-
|
|
284
|
+
q && /* @__PURE__ */ d("div", {
|
|
285
285
|
className: "grid grid-cols-2 sm:grid-cols-4 gap-4 text-sm pb-4 border-b border-border-subtle",
|
|
286
286
|
children: [
|
|
287
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("p", {
|
|
288
288
|
className: "text-text-secondary",
|
|
289
|
-
children:
|
|
290
|
-
}), /* @__PURE__ */
|
|
291
|
-
className: `font-medium ${
|
|
292
|
-
children:
|
|
289
|
+
children: p("billing.settings.status", "Status")
|
|
290
|
+
}), /* @__PURE__ */ u("p", {
|
|
291
|
+
className: `font-medium ${q.isActive ? "text-status-success-text" : "text-status-error-text"}`,
|
|
292
|
+
children: q.isActive ? p("billing.settings.active", "Active") : p("billing.settings.inactive", "Inactive")
|
|
293
293
|
})] }),
|
|
294
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("p", {
|
|
295
295
|
className: "text-text-secondary",
|
|
296
|
-
children:
|
|
297
|
-
}), /* @__PURE__ */
|
|
296
|
+
children: p("billing.settings.creditBalance", "Credit Balance")
|
|
297
|
+
}), /* @__PURE__ */ d("p", {
|
|
298
298
|
className: "font-medium text-text-primary",
|
|
299
|
-
children: [
|
|
299
|
+
children: [
|
|
300
|
+
(q.creditAmount || 0).toLocaleString(),
|
|
301
|
+
" ",
|
|
302
|
+
p("billing.common.credits", "Credits")
|
|
303
|
+
]
|
|
300
304
|
})] }),
|
|
301
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("p", {
|
|
302
306
|
className: "text-text-secondary",
|
|
303
|
-
children:
|
|
304
|
-
}), /* @__PURE__ */
|
|
307
|
+
children: p("billing.settings.accountId", "Account ID")
|
|
308
|
+
}), /* @__PURE__ */ u("p", {
|
|
305
309
|
className: "font-mono text-xs text-text-primary truncate",
|
|
306
|
-
title:
|
|
307
|
-
children:
|
|
310
|
+
title: q.id,
|
|
311
|
+
children: q.id
|
|
308
312
|
})] }),
|
|
309
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("p", {
|
|
310
314
|
className: "text-text-secondary",
|
|
311
|
-
children:
|
|
312
|
-
}), /* @__PURE__ */
|
|
315
|
+
children: p("billing.settings.created", "Created")
|
|
316
|
+
}), /* @__PURE__ */ u("p", {
|
|
313
317
|
className: "font-medium text-text-primary",
|
|
314
|
-
children:
|
|
318
|
+
children: q.createdAt ? new Date(q.createdAt).toLocaleDateString() : p("billing.settings.notAvailable", "N/A")
|
|
315
319
|
})] })
|
|
316
320
|
]
|
|
317
321
|
}),
|
|
318
|
-
/* @__PURE__ */
|
|
322
|
+
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h3", {
|
|
319
323
|
className: "text-sm font-medium text-text-primary mb-4",
|
|
320
|
-
children:
|
|
321
|
-
}), /* @__PURE__ */
|
|
324
|
+
children: p("billing.settings.contactDetails", "Contact Details")
|
|
325
|
+
}), /* @__PURE__ */ d("div", {
|
|
322
326
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
323
|
-
children: [/* @__PURE__ */
|
|
327
|
+
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
|
|
324
328
|
htmlFor: "billing-account-name",
|
|
325
329
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
326
330
|
children: [
|
|
327
|
-
|
|
331
|
+
p("billing.settings.accountName", "Account Name"),
|
|
328
332
|
" ",
|
|
329
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ u("span", {
|
|
330
334
|
className: "text-status-error-text",
|
|
331
335
|
children: "*"
|
|
332
336
|
})
|
|
333
337
|
]
|
|
334
|
-
}), /* @__PURE__ */
|
|
338
|
+
}), /* @__PURE__ */ u("input", {
|
|
335
339
|
id: "billing-account-name",
|
|
336
340
|
type: "text",
|
|
337
|
-
value:
|
|
338
|
-
onChange: (e) =>
|
|
341
|
+
value: F.name,
|
|
342
|
+
onChange: (e) => J("name", e.target.value),
|
|
339
343
|
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"
|
|
340
|
-
})] }), /* @__PURE__ */
|
|
344
|
+
})] }), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
|
|
341
345
|
htmlFor: "billing-account-email",
|
|
342
346
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
343
347
|
children: [
|
|
344
|
-
|
|
348
|
+
p("billing.settings.email", "Email"),
|
|
345
349
|
" ",
|
|
346
|
-
/* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ u("span", {
|
|
347
351
|
className: "text-status-error-text",
|
|
348
352
|
children: "*"
|
|
349
353
|
})
|
|
350
354
|
]
|
|
351
|
-
}), /* @__PURE__ */
|
|
355
|
+
}), /* @__PURE__ */ u("input", {
|
|
352
356
|
id: "billing-account-email",
|
|
353
357
|
type: "email",
|
|
354
|
-
value:
|
|
355
|
-
onChange: (e) =>
|
|
358
|
+
value: F.email,
|
|
359
|
+
onChange: (e) => J("email", e.target.value),
|
|
356
360
|
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"
|
|
357
361
|
})] })]
|
|
358
362
|
})] }),
|
|
359
|
-
/* @__PURE__ */
|
|
360
|
-
title:
|
|
361
|
-
description:
|
|
362
|
-
children: /* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ u(he, {
|
|
364
|
+
title: p("billing.settings.advancedTitle", "Advanced settings"),
|
|
365
|
+
description: p("billing.settings.advancedDescription", "Billing email override, currency, and tax identification."),
|
|
366
|
+
children: /* @__PURE__ */ d("div", {
|
|
363
367
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
364
368
|
children: [
|
|
365
|
-
/* @__PURE__ */
|
|
366
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ d("div", { children: [
|
|
370
|
+
/* @__PURE__ */ u("label", {
|
|
367
371
|
htmlFor: "billing-account-billing-email",
|
|
368
372
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
369
|
-
children:
|
|
373
|
+
children: p("billing.settings.billingEmail", "Billing Email")
|
|
370
374
|
}),
|
|
371
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ u("input", {
|
|
372
376
|
id: "billing-account-billing-email",
|
|
373
377
|
type: "email",
|
|
374
|
-
value:
|
|
375
|
-
onChange: (e) =>
|
|
376
|
-
placeholder:
|
|
378
|
+
value: F.billingEmail,
|
|
379
|
+
onChange: (e) => J("billingEmail", e.target.value),
|
|
380
|
+
placeholder: p("billing.settings.billingEmailPlaceholder", "Optional - defaults to account email"),
|
|
377
381
|
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"
|
|
378
382
|
}),
|
|
379
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ u("p", {
|
|
380
384
|
className: "text-xs text-text-secondary mt-1",
|
|
381
|
-
children:
|
|
385
|
+
children: p("billing.settings.billingEmailHelp", "Invoices will be sent to this email if provided")
|
|
382
386
|
})
|
|
383
387
|
] }),
|
|
384
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
|
|
385
389
|
htmlFor: "billing-account-currency",
|
|
386
390
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
387
|
-
children:
|
|
388
|
-
}), /* @__PURE__ */
|
|
391
|
+
children: p("billing.settings.currency", "Currency")
|
|
392
|
+
}), /* @__PURE__ */ d("select", {
|
|
389
393
|
id: "billing-account-currency",
|
|
390
|
-
value:
|
|
391
|
-
onChange: (e) =>
|
|
394
|
+
value: F.currency,
|
|
395
|
+
onChange: (e) => J("currency", e.target.value),
|
|
392
396
|
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",
|
|
393
397
|
children: [
|
|
394
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ u("option", {
|
|
395
399
|
value: "USD",
|
|
396
400
|
children: "USD - US Dollar"
|
|
397
401
|
}),
|
|
398
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ u("option", {
|
|
399
403
|
value: "EUR",
|
|
400
404
|
children: "EUR - Euro"
|
|
401
405
|
}),
|
|
402
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ u("option", {
|
|
403
407
|
value: "GBP",
|
|
404
408
|
children: "GBP - British Pound"
|
|
405
409
|
}),
|
|
406
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ u("option", {
|
|
407
411
|
value: "INR",
|
|
408
412
|
children: "INR - Indian Rupee"
|
|
409
413
|
})
|
|
410
414
|
]
|
|
411
415
|
})] }),
|
|
412
|
-
/* @__PURE__ */
|
|
416
|
+
/* @__PURE__ */ d("div", {
|
|
413
417
|
className: "sm:col-span-2 max-w-md",
|
|
414
418
|
children: [
|
|
415
|
-
/* @__PURE__ */
|
|
419
|
+
/* @__PURE__ */ u("label", {
|
|
416
420
|
htmlFor: "billing-account-tax-id",
|
|
417
421
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
418
|
-
children:
|
|
422
|
+
children: p("billing.settings.taxId", "Tax ID / VAT Number")
|
|
419
423
|
}),
|
|
420
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ u("input", {
|
|
421
425
|
id: "billing-account-tax-id",
|
|
422
426
|
type: "text",
|
|
423
|
-
value:
|
|
424
|
-
onChange: (e) =>
|
|
425
|
-
placeholder:
|
|
427
|
+
value: F.taxId,
|
|
428
|
+
onChange: (e) => J("taxId", e.target.value),
|
|
429
|
+
placeholder: p("billing.settings.taxIdPlaceholder", "Enter your tax identification number"),
|
|
426
430
|
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"
|
|
427
431
|
}),
|
|
428
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ u("p", {
|
|
429
433
|
className: "text-xs text-text-secondary mt-1",
|
|
430
|
-
children:
|
|
434
|
+
children: p("billing.settings.taxIdHelp", "Used for invoices and tax compliance (e.g., GST, VAT number)")
|
|
431
435
|
})
|
|
432
436
|
]
|
|
433
437
|
})
|
|
434
438
|
]
|
|
435
439
|
})
|
|
436
440
|
}),
|
|
437
|
-
|
|
441
|
+
q?.isActive && z.length > 1 && /* @__PURE__ */ u("div", {
|
|
438
442
|
className: "pt-4 border-t border-border-subtle",
|
|
439
|
-
children: /* @__PURE__ */
|
|
443
|
+
children: /* @__PURE__ */ d("div", {
|
|
440
444
|
className: "flex items-start gap-3",
|
|
441
|
-
children: [/* @__PURE__ */
|
|
445
|
+
children: [/* @__PURE__ */ u("div", {
|
|
442
446
|
className: "flex items-center h-6",
|
|
443
|
-
children: /* @__PURE__ */
|
|
447
|
+
children: /* @__PURE__ */ u("input", {
|
|
444
448
|
type: "checkbox",
|
|
445
449
|
id: "isDefault",
|
|
446
|
-
checked:
|
|
447
|
-
onChange: (e) =>
|
|
450
|
+
checked: F.isDefault,
|
|
451
|
+
onChange: (e) => I((t) => ({
|
|
448
452
|
...t,
|
|
449
453
|
isDefault: e.target.checked
|
|
450
454
|
})),
|
|
451
|
-
disabled:
|
|
455
|
+
disabled: q?.isDefault,
|
|
452
456
|
className: "size-4 rounded border-border-subtle text-primary focus:ring-primary focus:ring-offset-0 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
453
457
|
})
|
|
454
|
-
}), /* @__PURE__ */
|
|
458
|
+
}), /* @__PURE__ */ d("div", {
|
|
455
459
|
className: "flex-1",
|
|
456
|
-
children: [/* @__PURE__ */
|
|
460
|
+
children: [/* @__PURE__ */ u("label", {
|
|
457
461
|
htmlFor: "isDefault",
|
|
458
462
|
className: "text-sm font-medium text-text-primary cursor-pointer",
|
|
459
|
-
children:
|
|
460
|
-
}), /* @__PURE__ */
|
|
463
|
+
children: p("billing.settings.setDefault", "Set as default billing account")
|
|
464
|
+
}), /* @__PURE__ */ u("p", {
|
|
461
465
|
className: "text-xs text-text-secondary mt-0.5",
|
|
462
|
-
children:
|
|
466
|
+
children: q?.isDefault ? p("billing.settings.currentDefaultDescription", "This is currently your default billing account") : p("billing.settings.makePrimaryDescription", "Make this your primary billing account for new subscriptions")
|
|
463
467
|
})]
|
|
464
468
|
})]
|
|
465
469
|
})
|
|
466
470
|
}),
|
|
467
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ d("div", {
|
|
468
472
|
className: "pt-4 border-t border-border-subtle flex items-center justify-between",
|
|
469
|
-
children: [/* @__PURE__ */
|
|
473
|
+
children: [/* @__PURE__ */ d("div", {
|
|
470
474
|
className: "flex items-center gap-2",
|
|
471
|
-
children: [
|
|
475
|
+
children: [ye && /* @__PURE__ */ d("div", {
|
|
472
476
|
className: "flex items-center gap-2 text-sm text-status-success-text",
|
|
473
|
-
children: [/* @__PURE__ */
|
|
477
|
+
children: [/* @__PURE__ */ u("svg", {
|
|
474
478
|
className: "size-4",
|
|
475
479
|
fill: "none",
|
|
476
480
|
viewBox: "0 0 24 24",
|
|
477
481
|
stroke: "currentColor",
|
|
478
|
-
children: /* @__PURE__ */
|
|
482
|
+
children: /* @__PURE__ */ u("path", {
|
|
479
483
|
strokeLinecap: "round",
|
|
480
484
|
strokeLinejoin: "round",
|
|
481
485
|
strokeWidth: 2,
|
|
482
486
|
d: "M5 13l4 4L19 7"
|
|
483
487
|
})
|
|
484
|
-
}),
|
|
485
|
-
}),
|
|
488
|
+
}), p("billing.settings.saveSuccess", "Changes saved successfully")]
|
|
489
|
+
}), O && /* @__PURE__ */ d("div", {
|
|
486
490
|
className: "flex items-center gap-2 text-sm text-status-error-text",
|
|
487
|
-
children: [/* @__PURE__ */
|
|
491
|
+
children: [/* @__PURE__ */ u("svg", {
|
|
488
492
|
className: "size-4",
|
|
489
493
|
fill: "none",
|
|
490
494
|
viewBox: "0 0 24 24",
|
|
491
495
|
stroke: "currentColor",
|
|
492
|
-
children: /* @__PURE__ */
|
|
496
|
+
children: /* @__PURE__ */ u("path", {
|
|
493
497
|
strokeLinecap: "round",
|
|
494
498
|
strokeLinejoin: "round",
|
|
495
499
|
strokeWidth: 2,
|
|
496
500
|
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"
|
|
497
501
|
})
|
|
498
|
-
}),
|
|
502
|
+
}), O]
|
|
499
503
|
})]
|
|
500
|
-
}), /* @__PURE__ */
|
|
504
|
+
}), /* @__PURE__ */ d("div", {
|
|
501
505
|
className: "flex items-center gap-3",
|
|
502
|
-
children: [
|
|
506
|
+
children: [m.canArchiveBillingAccount && q?.isActive ? /* @__PURE__ */ u("button", {
|
|
503
507
|
type: "button",
|
|
504
|
-
onClick: () =>
|
|
505
|
-
disabled:
|
|
508
|
+
onClick: () => D(!0),
|
|
509
|
+
disabled: C || T,
|
|
506
510
|
className: "px-4 py-2 text-sm font-medium border border-border-subtle text-status-error-text rounded-md hover:bg-status-error-bg-subtle disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
507
|
-
children:
|
|
508
|
-
}) : null, /* @__PURE__ */
|
|
511
|
+
children: T ? p("billing.settings.archiving", "Archiving...") : p("billing.settings.archiveAccount", "Archive Account")
|
|
512
|
+
}) : null, /* @__PURE__ */ d("button", {
|
|
509
513
|
type: "button",
|
|
510
|
-
onClick:
|
|
511
|
-
disabled: !
|
|
514
|
+
onClick: De,
|
|
515
|
+
disabled: !Ee || C || T || !F.name || !F.email,
|
|
512
516
|
className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center gap-2",
|
|
513
|
-
children: [
|
|
517
|
+
children: [C && /* @__PURE__ */ d("svg", {
|
|
514
518
|
className: "size-4 animate-spin",
|
|
515
519
|
fill: "none",
|
|
516
520
|
viewBox: "0 0 24 24",
|
|
517
|
-
children: [/* @__PURE__ */
|
|
521
|
+
children: [/* @__PURE__ */ u("circle", {
|
|
518
522
|
className: "opacity-25",
|
|
519
523
|
cx: "12",
|
|
520
524
|
cy: "12",
|
|
521
525
|
r: "10",
|
|
522
526
|
stroke: "currentColor",
|
|
523
527
|
strokeWidth: "4"
|
|
524
|
-
}), /* @__PURE__ */
|
|
528
|
+
}), /* @__PURE__ */ u("path", {
|
|
525
529
|
className: "opacity-75",
|
|
526
530
|
fill: "currentColor",
|
|
527
531
|
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
528
532
|
})]
|
|
529
|
-
}),
|
|
533
|
+
}), C ? p("billing.common.saving", "Saving...") : p("billing.common.saveChanges", "Save Changes")]
|
|
530
534
|
})]
|
|
531
535
|
})]
|
|
532
536
|
})
|
|
533
537
|
]
|
|
534
538
|
})]
|
|
535
539
|
}),
|
|
536
|
-
|
|
540
|
+
j && N && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", {
|
|
537
541
|
className: "fixed inset-0 bg-overlay-scrim z-40",
|
|
538
542
|
onClick: () => {
|
|
539
|
-
|
|
543
|
+
C || (M(!1), P(!1), I((e) => ({
|
|
540
544
|
...e,
|
|
541
|
-
isDefault:
|
|
545
|
+
isDefault: q?.isDefault || !1
|
|
542
546
|
})));
|
|
543
547
|
}
|
|
544
|
-
}), /* @__PURE__ */
|
|
548
|
+
}), /* @__PURE__ */ u("div", {
|
|
545
549
|
className: "fixed inset-0 flex items-center justify-center z-50 p-4",
|
|
546
|
-
children: /* @__PURE__ */
|
|
550
|
+
children: /* @__PURE__ */ d("div", {
|
|
547
551
|
className: "bg-bg-surface border border-border-subtle rounded-lg shadow-xl max-w-md w-full p-6",
|
|
548
552
|
children: [
|
|
549
|
-
/* @__PURE__ */
|
|
553
|
+
/* @__PURE__ */ u("h3", {
|
|
550
554
|
className: "text-lg font-semibold text-text-primary mb-2",
|
|
551
|
-
children: "Confirm Default Account Change"
|
|
555
|
+
children: p("billing.settings.confirmDefaultTitle", "Confirm Default Account Change")
|
|
552
556
|
}),
|
|
553
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ u("p", {
|
|
554
558
|
className: "text-sm text-text-secondary mb-4",
|
|
555
|
-
children:
|
|
556
|
-
"You are about to set",
|
|
557
|
-
" ",
|
|
558
|
-
/* @__PURE__ */ s("strong", {
|
|
559
|
-
className: "text-text-primary",
|
|
560
|
-
children: K?.name
|
|
561
|
-
}),
|
|
562
|
-
" as your default billing account and save your changes."
|
|
563
|
-
]
|
|
559
|
+
children: p("billing.settings.confirmDefaultDescription", "You are about to set {{accountName}} as your default billing account and save your changes.", { accountName: q?.name ?? "" })
|
|
564
560
|
}),
|
|
565
|
-
|
|
561
|
+
Y && Y.id !== q?.id && /* @__PURE__ */ u("div", {
|
|
566
562
|
className: "mb-4 p-3 bg-status-warning-bg-subtle border border-border-subtle rounded-md",
|
|
567
|
-
children: /* @__PURE__ */
|
|
563
|
+
children: /* @__PURE__ */ d("div", {
|
|
568
564
|
className: "flex items-start gap-2",
|
|
569
|
-
children: [/* @__PURE__ */
|
|
565
|
+
children: [/* @__PURE__ */ u("svg", {
|
|
570
566
|
className: "size-5 text-status-warning-text flex-shrink-0 mt-0.5",
|
|
571
567
|
fill: "none",
|
|
572
568
|
viewBox: "0 0 24 24",
|
|
573
569
|
stroke: "currentColor",
|
|
574
|
-
children: /* @__PURE__ */
|
|
570
|
+
children: /* @__PURE__ */ u("path", {
|
|
575
571
|
strokeLinecap: "round",
|
|
576
572
|
strokeLinejoin: "round",
|
|
577
573
|
strokeWidth: 2,
|
|
578
574
|
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"
|
|
579
575
|
})
|
|
580
|
-
}), /* @__PURE__ */
|
|
576
|
+
}), /* @__PURE__ */ d("div", {
|
|
581
577
|
className: "text-sm",
|
|
582
|
-
children: [/* @__PURE__ */
|
|
578
|
+
children: [/* @__PURE__ */ u("p", {
|
|
583
579
|
className: "font-medium text-status-warning-text",
|
|
584
|
-
children: "Current default will change"
|
|
585
|
-
}), /* @__PURE__ */
|
|
580
|
+
children: p("billing.settings.currentDefaultWillChange", "Current default will change")
|
|
581
|
+
}), /* @__PURE__ */ u("p", {
|
|
586
582
|
className: "text-status-warning-text mt-0.5",
|
|
587
|
-
children:
|
|
583
|
+
children: p("billing.settings.currentDefaultWillChangeDescription", "{{accountName}} will no longer be the default account.", { accountName: Y.name })
|
|
588
584
|
})]
|
|
589
585
|
})]
|
|
590
586
|
})
|
|
591
587
|
}),
|
|
592
|
-
/* @__PURE__ */
|
|
588
|
+
/* @__PURE__ */ d("div", {
|
|
593
589
|
className: "flex justify-end gap-3",
|
|
594
|
-
children: [/* @__PURE__ */
|
|
590
|
+
children: [/* @__PURE__ */ u("button", {
|
|
595
591
|
type: "button",
|
|
596
592
|
onClick: () => {
|
|
597
|
-
|
|
593
|
+
M(!1), P(!1), I((e) => ({
|
|
598
594
|
...e,
|
|
599
|
-
isDefault:
|
|
595
|
+
isDefault: q?.isDefault || !1
|
|
600
596
|
}));
|
|
601
597
|
},
|
|
602
|
-
disabled:
|
|
598
|
+
disabled: C,
|
|
603
599
|
className: "px-4 py-2 text-sm font-medium text-text-primary border border-border-subtle rounded-md hover:bg-bg-sunken transition-colors disabled:opacity-50",
|
|
604
|
-
children: "Cancel"
|
|
605
|
-
}), /* @__PURE__ */
|
|
600
|
+
children: p("billing.common.cancel", "Cancel")
|
|
601
|
+
}), /* @__PURE__ */ d("button", {
|
|
606
602
|
type: "button",
|
|
607
603
|
onClick: Q,
|
|
608
|
-
disabled:
|
|
604
|
+
disabled: C,
|
|
609
605
|
className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg/90 disabled:opacity-50 transition-colors flex items-center gap-2",
|
|
610
|
-
children: [
|
|
606
|
+
children: [C && /* @__PURE__ */ d("svg", {
|
|
611
607
|
className: "size-4 animate-spin",
|
|
612
608
|
fill: "none",
|
|
613
609
|
viewBox: "0 0 24 24",
|
|
614
|
-
children: [/* @__PURE__ */
|
|
610
|
+
children: [/* @__PURE__ */ u("circle", {
|
|
615
611
|
className: "opacity-25",
|
|
616
612
|
cx: "12",
|
|
617
613
|
cy: "12",
|
|
618
614
|
r: "10",
|
|
619
615
|
stroke: "currentColor",
|
|
620
616
|
strokeWidth: "4"
|
|
621
|
-
}), /* @__PURE__ */
|
|
617
|
+
}), /* @__PURE__ */ u("path", {
|
|
622
618
|
className: "opacity-75",
|
|
623
619
|
fill: "currentColor",
|
|
624
620
|
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
625
621
|
})]
|
|
626
|
-
}),
|
|
622
|
+
}), C ? p("billing.common.saving", "Saving...") : p("billing.common.saveChanges", "Save Changes")]
|
|
627
623
|
})]
|
|
628
624
|
})
|
|
629
625
|
]
|
|
630
626
|
})
|
|
631
627
|
})] }),
|
|
632
|
-
/* @__PURE__ */
|
|
633
|
-
open:
|
|
634
|
-
onOpenChange:
|
|
635
|
-
children: /* @__PURE__ */
|
|
628
|
+
/* @__PURE__ */ u(ce, {
|
|
629
|
+
open: ve,
|
|
630
|
+
onOpenChange: D,
|
|
631
|
+
children: /* @__PURE__ */ d(de, { children: [/* @__PURE__ */ d(me, { children: [/* @__PURE__ */ u(f, { children: p("billing.settings.archiveDialogTitle", "Archive billing account?") }), /* @__PURE__ */ u(fe, { children: Oe })] }), /* @__PURE__ */ d(pe, { children: [/* @__PURE__ */ u(ue, { children: p("billing.common.cancel", "Cancel") }), /* @__PURE__ */ u(le, {
|
|
636
632
|
onClick: () => {
|
|
637
|
-
|
|
633
|
+
D(!1), ke();
|
|
638
634
|
},
|
|
639
|
-
children: "Archive Account"
|
|
635
|
+
children: p("billing.settings.archiveAccount", "Archive Account")
|
|
640
636
|
})] })] })
|
|
641
637
|
})
|
|
642
638
|
]
|
|
643
|
-
}) : /* @__PURE__ */
|
|
639
|
+
}) : /* @__PURE__ */ u(n, { message: p("billing.settings.noManagePermission", "You don't have permission to manage billing settings.") });
|
|
644
640
|
};
|
|
645
641
|
//#endregion
|
|
646
|
-
export {
|
|
642
|
+
export { p as SettingsPage };
|
|
647
643
|
|
|
648
644
|
//# sourceMappingURL=SettingsPage.js.map
|