@better-auth-ui/heroui 1.6.20 → 1.6.22
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/index.js +295 -295
- package/dist/plugins.js +908 -918
- package/package.json +10 -10
- package/src/components/auth/additional-field.tsx +11 -9
- package/src/components/auth/organization/create-organization-dialog.tsx +8 -2
- package/src/components/auth/organization/organization-invitations.tsx +10 -33
- package/src/components/auth/organization/organization-members.tsx +6 -29
- package/src/components/auth/sign-in.tsx +6 -6
- package/src/components/auth/theme/appearance.tsx +6 -6
- package/src/components/auth/username/sign-in-username.tsx +6 -6
package/dist/plugins.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { a as e, r as t, t as n } from "./user-view--47tVtJ3.js";
|
|
3
3
|
import { authMutationKeys as r, authQueryKeys as i, createAuthPlugin as a, fileToBase64 as o } from "@better-auth-ui/core";
|
|
4
|
-
import { ThemePreviewDark as s, ThemePreviewLight as c, ThemePreviewSystem as l, useAcceptInvitation as u, useActiveOrganization as d, useAddPasskey as f, useAuth as p, useAuthPlugin as m, useAuthenticate as h, useCancelInvitation as g, useCheckSlug as _, useCreateApiKey as v, useCreateOrganization as y, useDeleteApiKey as b, useDeleteOrganization as x, useDeletePasskey as S, useDeleteUser as C, useFetchOptions as
|
|
5
|
-
import { ArrowRightArrowLeft as
|
|
6
|
-
import { AlertDialog as
|
|
7
|
-
import { useEffect as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { useIsMutating as
|
|
10
|
-
import { apiKeyPlugin as
|
|
11
|
-
import { buttonVariants as
|
|
12
|
-
import { useDebouncer as
|
|
4
|
+
import { ThemePreviewDark as s, ThemePreviewLight as c, ThemePreviewSystem as l, useAcceptInvitation as u, useActiveOrganization as d, useAddPasskey as f, useAuth as p, useAuthPlugin as m, useAuthenticate as h, useCancelInvitation as g, useCheckSlug as _, useCreateApiKey as v, useCreateOrganization as y, useDeleteApiKey as b, useDeleteOrganization as x, useDeletePasskey as S, useDeleteUser as C, useFetchOptions as w, useHasPermission as T, useInviteMember as ee, useIsUsernameAvailable as te, useLeaveOrganization as ne, useListAccounts as re, useListApiKeys as ie, useListDeviceSessions as ae, useListOrganizationInvitations as oe, useListOrganizationMembers as se, useListOrganizations as ce, useListPasskeys as le, useListUserInvitations as ue, useRejectInvitation as de, useRemoveMember as fe, useRevokeMultiSession as pe, useSendVerificationEmail as me, useSession as E, useSetActiveOrganization as he, useSetActiveSession as ge, useSignInEmail as _e, useSignInMagicLink as ve, useSignInPasskey as ye, useSignInUsername as be, useUpdateMemberRole as xe, useUpdateOrganization as Se, useUser as Ce } from "@better-auth-ui/react";
|
|
5
|
+
import { ArrowRightArrowLeft as we, ArrowRightFromSquare as Te, Briefcase as Ee, Check as De, ChevronsExpandVertical as Oe, CirclePlus as ke, Clock as Ae, CloudArrowUpIn as je, Copy as Me, Display as Ne, Ellipsis as Pe, Envelope as Fe, Fingerprint as Ie, Funnel as Le, Gear as Re, Key as ze, Lock as Be, Moon as Ve, Palette as He, PaperPlane as Ue, Pencil as We, Person as Ge, PersonPlus as Ke, Sun as qe, TrashBin as Je, TriangleExclamation as Ye, Xmark as D } from "@gravity-ui/icons";
|
|
6
|
+
import { AlertDialog as O, Avatar as Xe, Button as k, Card as A, Checkbox as Ze, Chip as j, Description as Qe, Dropdown as M, EmptyState as $e, FieldError as N, Form as P, Input as F, InputGroup as I, Label as L, Link as et, ListBox as tt, Radio as R, RadioGroup as nt, SearchField as z, Select as rt, Skeleton as B, Spinner as V, Table as H, Tabs as U, TextField as W, cn as G, toast as K, useIsHydrated as it } from "@heroui/react";
|
|
7
|
+
import { useEffect as at, useMemo as ot, useRef as st, useState as q } from "react";
|
|
8
|
+
import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
|
|
9
|
+
import { useIsMutating as Z, useQueryClient as ct } from "@tanstack/react-query";
|
|
10
|
+
import { apiKeyPlugin as lt, deleteUserPlugin as ut, magicLinkPlugin as dt, multiSessionPlugin as ft, organizationPlugin as pt, passkeyPlugin as mt, themePlugin as ht, usernamePlugin as gt } from "@better-auth-ui/core/plugins";
|
|
11
|
+
import { buttonVariants as _t } from "@heroui/styles";
|
|
12
|
+
import { useDebouncer as vt } from "@tanstack/react-pacer";
|
|
13
13
|
//#region src/components/auth/api-key/organization-api-keys.tsx
|
|
14
|
-
function
|
|
15
|
-
let { authClient: n } = p(), { data: r } =
|
|
16
|
-
return o?.members.some((e) => e.role === "owner" && e.userId === r?.user.id) ? /* @__PURE__ */
|
|
14
|
+
function yt({ className: e, variant: t }) {
|
|
15
|
+
let { authClient: n } = p(), { data: r } = E(n), { data: i, isPending: a } = d(n), { data: o } = se(n);
|
|
16
|
+
return o?.members.some((e) => e.role === "owner" && e.userId === r?.user.id) ? /* @__PURE__ */ Y(Dt, {
|
|
17
17
|
className: e,
|
|
18
18
|
variant: t,
|
|
19
19
|
organizationId: i?.id,
|
|
@@ -22,55 +22,55 @@ function xt({ className: e, variant: t }) {
|
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/lib/auth/api-key-plugin.ts
|
|
25
|
-
var
|
|
26
|
-
let t =
|
|
25
|
+
var bt = a(lt.id, (e = {}) => {
|
|
26
|
+
let t = lt(e);
|
|
27
27
|
return {
|
|
28
28
|
...t,
|
|
29
|
-
securityCards: [
|
|
30
|
-
...t.organization ? { organizationCards: [
|
|
29
|
+
securityCards: [Dt],
|
|
30
|
+
...t.organization ? { organizationCards: [yt] } : {}
|
|
31
31
|
};
|
|
32
32
|
});
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region src/components/auth/api-key/delete-api-key-dialog.tsx
|
|
35
|
-
function
|
|
36
|
-
let { authClient: i, localization: a } = p(), { localization: o } = m(
|
|
37
|
-
return /* @__PURE__ */
|
|
35
|
+
function xt({ isOpen: e, onOpenChange: t, apiKey: n, organizationId: r }) {
|
|
36
|
+
let { authClient: i, localization: a } = p(), { localization: o } = m(bt), s = `${n.start}${"*".repeat(16)}`, { mutate: c, isPending: l } = b(i, { onSuccess: () => t(!1) });
|
|
37
|
+
return /* @__PURE__ */ Y(O.Backdrop, {
|
|
38
38
|
isOpen: e,
|
|
39
39
|
onOpenChange: t,
|
|
40
|
-
children: /* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ X(O.Dialog, { children: [
|
|
41
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
42
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
43
43
|
status: "danger",
|
|
44
|
-
children: /* @__PURE__ */
|
|
45
|
-
}), /* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
44
|
+
children: /* @__PURE__ */ Y(ze, {})
|
|
45
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: o.deleteApiKey })] }),
|
|
46
|
+
/* @__PURE__ */ X(O.Body, {
|
|
47
47
|
className: "flex flex-col gap-4 overflow-visible",
|
|
48
|
-
children: [/* @__PURE__ */
|
|
48
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
49
49
|
className: "text-muted text-sm",
|
|
50
50
|
children: o.deleteApiKeyWarning
|
|
51
|
-
}), /* @__PURE__ */
|
|
51
|
+
}), /* @__PURE__ */ X(W, {
|
|
52
52
|
value: s,
|
|
53
53
|
className: "font-mono text-xs",
|
|
54
54
|
variant: "secondary",
|
|
55
|
-
children: [/* @__PURE__ */
|
|
55
|
+
children: [/* @__PURE__ */ Y(L, { children: n.name || o.apiKey }), /* @__PURE__ */ Y(F, {
|
|
56
56
|
readOnly: !0,
|
|
57
57
|
className: "font-mono text-xs"
|
|
58
58
|
})]
|
|
59
59
|
})]
|
|
60
60
|
}),
|
|
61
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ X(O.Footer, { children: [/* @__PURE__ */ Y(k, {
|
|
62
62
|
slot: "close",
|
|
63
63
|
variant: "tertiary",
|
|
64
64
|
isDisabled: l,
|
|
65
65
|
children: a.settings.cancel
|
|
66
|
-
}), /* @__PURE__ */
|
|
66
|
+
}), /* @__PURE__ */ X(k, {
|
|
67
67
|
variant: "danger",
|
|
68
68
|
onPress: () => c({
|
|
69
69
|
keyId: n.id,
|
|
70
70
|
...r ? { configId: "organization" } : {}
|
|
71
71
|
}),
|
|
72
72
|
isPending: l,
|
|
73
|
-
children: [l && /* @__PURE__ */
|
|
73
|
+
children: [l && /* @__PURE__ */ Y(V, {
|
|
74
74
|
color: "current",
|
|
75
75
|
size: "sm"
|
|
76
76
|
}), o.deleteApiKey]
|
|
@@ -80,27 +80,27 @@ function Ct({ isOpen: e, onOpenChange: t, apiKey: n, organizationId: r }) {
|
|
|
80
80
|
}
|
|
81
81
|
//#endregion
|
|
82
82
|
//#region src/components/auth/api-key/api-key.tsx
|
|
83
|
-
function
|
|
84
|
-
let { localization: r } = p(), { localization: i } = m(
|
|
85
|
-
return /* @__PURE__ */
|
|
83
|
+
function St({ apiKey: e, hideDelete: t, organizationId: n }) {
|
|
84
|
+
let { localization: r } = p(), { localization: i } = m(bt), [a, o] = q(!1), s = `${e.start}${"*".repeat(16)}`;
|
|
85
|
+
return /* @__PURE__ */ X("div", {
|
|
86
86
|
className: "flex items-center gap-3",
|
|
87
87
|
children: [
|
|
88
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ Y("div", {
|
|
89
89
|
className: "flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-secondary",
|
|
90
|
-
children: /* @__PURE__ */
|
|
90
|
+
children: /* @__PURE__ */ Y(ze, { className: "size-4.5" })
|
|
91
91
|
}),
|
|
92
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ X("div", {
|
|
93
93
|
className: "flex flex-col min-w-0",
|
|
94
94
|
children: [
|
|
95
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ Y("span", {
|
|
96
96
|
className: "text-sm font-medium leading-tight truncate",
|
|
97
97
|
children: e.name || i.apiKey
|
|
98
98
|
}),
|
|
99
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ Y("span", {
|
|
100
100
|
className: "text-xs text-muted font-mono truncate",
|
|
101
101
|
children: s
|
|
102
102
|
}),
|
|
103
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ Y("span", {
|
|
104
104
|
className: "text-xs text-muted",
|
|
105
105
|
children: new Date(e.createdAt).toLocaleString(void 0, {
|
|
106
106
|
dateStyle: "medium",
|
|
@@ -109,14 +109,14 @@ function wt({ apiKey: e, hideDelete: t, organizationId: n }) {
|
|
|
109
109
|
})
|
|
110
110
|
]
|
|
111
111
|
}),
|
|
112
|
-
!t && /* @__PURE__ */
|
|
112
|
+
!t && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ X(k, {
|
|
113
113
|
className: "ml-auto shrink-0",
|
|
114
114
|
variant: "outline",
|
|
115
115
|
size: "sm",
|
|
116
116
|
onPress: () => o(!0),
|
|
117
117
|
"aria-label": i.deleteApiKey,
|
|
118
|
-
children: [/* @__PURE__ */
|
|
119
|
-
}), /* @__PURE__ */
|
|
118
|
+
children: [/* @__PURE__ */ Y(D, {}), r.settings.delete]
|
|
119
|
+
}), /* @__PURE__ */ Y(xt, {
|
|
120
120
|
isOpen: a,
|
|
121
121
|
onOpenChange: o,
|
|
122
122
|
apiKey: e,
|
|
@@ -127,17 +127,17 @@ function wt({ apiKey: e, hideDelete: t, organizationId: n }) {
|
|
|
127
127
|
}
|
|
128
128
|
//#endregion
|
|
129
129
|
//#region src/components/auth/api-key/api-key-skeleton.tsx
|
|
130
|
-
function
|
|
131
|
-
return /* @__PURE__ */
|
|
130
|
+
function Ct() {
|
|
131
|
+
return /* @__PURE__ */ Y("div", {
|
|
132
132
|
className: "flex items-center justify-between",
|
|
133
|
-
children: /* @__PURE__ */
|
|
133
|
+
children: /* @__PURE__ */ X("div", {
|
|
134
134
|
className: "flex items-center gap-3",
|
|
135
|
-
children: [/* @__PURE__ */
|
|
135
|
+
children: [/* @__PURE__ */ Y(B, { className: "size-10 rounded-xl" }), /* @__PURE__ */ X("div", {
|
|
136
136
|
className: "flex flex-col gap-1",
|
|
137
137
|
children: [
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ Y(B, { className: "h-4 w-28 rounded-lg" }),
|
|
139
|
+
/* @__PURE__ */ Y(B, { className: "h-3 w-36 rounded-lg" }),
|
|
140
|
+
/* @__PURE__ */ Y(B, { className: "h-3 w-32 rounded-lg" })
|
|
141
141
|
]
|
|
142
142
|
})]
|
|
143
143
|
})
|
|
@@ -145,26 +145,26 @@ function Tt() {
|
|
|
145
145
|
}
|
|
146
146
|
//#endregion
|
|
147
147
|
//#region src/components/auth/api-key/api-keys-empty.tsx
|
|
148
|
-
function
|
|
149
|
-
let { localization: n } = m(
|
|
150
|
-
return /* @__PURE__ */
|
|
148
|
+
function wt({ onCreatePress: e, hideCreate: t }) {
|
|
149
|
+
let { localization: n } = m(bt);
|
|
150
|
+
return /* @__PURE__ */ X("div", {
|
|
151
151
|
className: "flex flex-col items-center justify-center gap-4",
|
|
152
152
|
children: [
|
|
153
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ Y("div", {
|
|
154
154
|
className: "flex size-10 items-center justify-center rounded-xl bg-surface-secondary",
|
|
155
|
-
children: /* @__PURE__ */
|
|
155
|
+
children: /* @__PURE__ */ Y(ze, { className: "size-4.5" })
|
|
156
156
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ X("div", {
|
|
158
158
|
className: "flex flex-col items-center justify-center gap-1 text-center",
|
|
159
|
-
children: [/* @__PURE__ */
|
|
159
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
160
160
|
className: "text-sm font-semibold",
|
|
161
161
|
children: n.noApiKeys
|
|
162
|
-
}), /* @__PURE__ */
|
|
162
|
+
}), /* @__PURE__ */ Y("p", {
|
|
163
163
|
className: "text-muted text-xs",
|
|
164
164
|
children: n.apiKeysDescription
|
|
165
165
|
})]
|
|
166
166
|
}),
|
|
167
|
-
!t && /* @__PURE__ */
|
|
167
|
+
!t && /* @__PURE__ */ Y(k, {
|
|
168
168
|
size: "sm",
|
|
169
169
|
onPress: e,
|
|
170
170
|
children: n.createApiKey
|
|
@@ -174,33 +174,33 @@ function Et({ onCreatePress: e, hideCreate: t }) {
|
|
|
174
174
|
}
|
|
175
175
|
//#endregion
|
|
176
176
|
//#region src/components/auth/api-key/new-api-key-dialog.tsx
|
|
177
|
-
function
|
|
178
|
-
let { localization: i } = p(), { localization: a } = m(
|
|
179
|
-
return /* @__PURE__ */
|
|
177
|
+
function Tt({ isOpen: e, onOpenChange: t, name: n, secretKey: r }) {
|
|
178
|
+
let { localization: i } = p(), { localization: a } = m(bt), [o, s] = q(!1);
|
|
179
|
+
return /* @__PURE__ */ Y(O.Backdrop, {
|
|
180
180
|
isOpen: e,
|
|
181
181
|
onOpenChange: t,
|
|
182
|
-
children: /* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
182
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ X(O.Dialog, { children: [
|
|
183
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
184
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
185
185
|
status: "warning",
|
|
186
|
-
children: /* @__PURE__ */
|
|
187
|
-
}), /* @__PURE__ */
|
|
188
|
-
/* @__PURE__ */
|
|
186
|
+
children: /* @__PURE__ */ Y(ze, {})
|
|
187
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: a.newApiKey })] }),
|
|
188
|
+
/* @__PURE__ */ X(O.Body, {
|
|
189
189
|
className: "flex flex-col gap-4 overflow-visible",
|
|
190
|
-
children: [/* @__PURE__ */
|
|
190
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
191
191
|
className: "text-muted text-sm",
|
|
192
192
|
children: a.newApiKeyWarning
|
|
193
|
-
}), /* @__PURE__ */
|
|
193
|
+
}), /* @__PURE__ */ X(W, {
|
|
194
194
|
value: r ?? "",
|
|
195
195
|
className: "font-mono text-xs",
|
|
196
|
-
children: [/* @__PURE__ */
|
|
196
|
+
children: [/* @__PURE__ */ Y(L, { children: n || a.apiKey }), /* @__PURE__ */ X(I, {
|
|
197
197
|
variant: "secondary",
|
|
198
|
-
children: [/* @__PURE__ */
|
|
198
|
+
children: [/* @__PURE__ */ Y(I.Input, {
|
|
199
199
|
readOnly: !0,
|
|
200
200
|
className: "font-mono text-xs"
|
|
201
|
-
}), /* @__PURE__ */
|
|
201
|
+
}), /* @__PURE__ */ Y(I.Suffix, {
|
|
202
202
|
className: "px-0",
|
|
203
|
-
children: /* @__PURE__ */
|
|
203
|
+
children: /* @__PURE__ */ Y(k, {
|
|
204
204
|
isIconOnly: !0,
|
|
205
205
|
"aria-label": i.settings.copyToClipboard,
|
|
206
206
|
size: "sm",
|
|
@@ -209,16 +209,16 @@ function Dt({ isOpen: e, onOpenChange: t, name: n, secretKey: r }) {
|
|
|
209
209
|
if (r) try {
|
|
210
210
|
await navigator.clipboard.writeText(r), s(!0), setTimeout(() => s(!1), 1500);
|
|
211
211
|
} catch (e) {
|
|
212
|
-
|
|
212
|
+
K.danger(e instanceof Error ? e.message : String(e));
|
|
213
213
|
}
|
|
214
214
|
},
|
|
215
|
-
children:
|
|
215
|
+
children: Y(o ? De : Me, {})
|
|
216
216
|
})
|
|
217
217
|
})]
|
|
218
218
|
})]
|
|
219
219
|
})]
|
|
220
220
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ Y(O.Footer, { children: /* @__PURE__ */ Y(k, {
|
|
222
222
|
slot: "close",
|
|
223
223
|
children: a.dismissNewKey
|
|
224
224
|
}) })
|
|
@@ -227,14 +227,14 @@ function Dt({ isOpen: e, onOpenChange: t, name: n, secretKey: r }) {
|
|
|
227
227
|
}
|
|
228
228
|
//#endregion
|
|
229
229
|
//#region src/components/auth/api-key/create-api-key-dialog.tsx
|
|
230
|
-
function
|
|
231
|
-
let { authClient: r, localization: i } = p(), { localization: a } = m(
|
|
230
|
+
function Et({ isOpen: e, onOpenChange: t, organizationId: n }) {
|
|
231
|
+
let { authClient: r, localization: i } = p(), { localization: a } = m(bt), { mutate: o, isPending: s } = v(r), [c, l] = q(!1), [u, d] = q(null), [f, h] = q(null), g = (e) => {
|
|
232
232
|
e || (d(null), h(null)), t(e);
|
|
233
233
|
};
|
|
234
|
-
return /* @__PURE__ */
|
|
234
|
+
return /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(O.Backdrop, {
|
|
235
235
|
isOpen: e,
|
|
236
236
|
onOpenChange: g,
|
|
237
|
-
children: /* @__PURE__ */
|
|
237
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ Y(O.Dialog, { children: /* @__PURE__ */ X(P, {
|
|
238
238
|
onSubmit: (e) => {
|
|
239
239
|
e.preventDefault();
|
|
240
240
|
let t = new FormData(e.target).get("name")?.trim();
|
|
@@ -249,48 +249,48 @@ function Ot({ isOpen: e, onOpenChange: t, organizationId: n }) {
|
|
|
249
249
|
} });
|
|
250
250
|
},
|
|
251
251
|
children: [
|
|
252
|
-
/* @__PURE__ */
|
|
253
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
253
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
254
254
|
status: "default",
|
|
255
|
-
children: /* @__PURE__ */
|
|
256
|
-
}), /* @__PURE__ */
|
|
257
|
-
/* @__PURE__ */
|
|
255
|
+
children: /* @__PURE__ */ Y(ze, {})
|
|
256
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: a.createApiKey })] }),
|
|
257
|
+
/* @__PURE__ */ X(O.Body, {
|
|
258
258
|
className: "overflow-visible",
|
|
259
|
-
children: [/* @__PURE__ */
|
|
259
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
260
260
|
className: "text-muted text-sm",
|
|
261
261
|
children: a.apiKeysDescription
|
|
262
|
-
}), /* @__PURE__ */
|
|
262
|
+
}), /* @__PURE__ */ X(W, {
|
|
263
263
|
className: "mt-4",
|
|
264
264
|
id: "name",
|
|
265
265
|
name: "name",
|
|
266
266
|
isDisabled: s,
|
|
267
267
|
children: [
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ Y(L, { children: a.name }),
|
|
269
|
+
/* @__PURE__ */ Y(F, {
|
|
270
270
|
autoFocus: !0,
|
|
271
271
|
placeholder: i.settings.optional,
|
|
272
272
|
variant: "secondary"
|
|
273
273
|
}),
|
|
274
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ Y(N, {})
|
|
275
275
|
]
|
|
276
276
|
})]
|
|
277
277
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ X(O.Footer, { children: [/* @__PURE__ */ Y(k, {
|
|
279
279
|
slot: "close",
|
|
280
280
|
variant: "tertiary",
|
|
281
281
|
isDisabled: s,
|
|
282
282
|
children: i.settings.cancel
|
|
283
|
-
}), /* @__PURE__ */
|
|
283
|
+
}), /* @__PURE__ */ X(k, {
|
|
284
284
|
type: "submit",
|
|
285
285
|
isPending: s,
|
|
286
|
-
children: [s && /* @__PURE__ */
|
|
286
|
+
children: [s && /* @__PURE__ */ Y(V, {
|
|
287
287
|
color: "current",
|
|
288
288
|
size: "sm"
|
|
289
289
|
}), a.createApiKey]
|
|
290
290
|
})] })
|
|
291
291
|
]
|
|
292
292
|
}) }) })
|
|
293
|
-
}), /* @__PURE__ */
|
|
293
|
+
}), /* @__PURE__ */ Y(Tt, {
|
|
294
294
|
isOpen: c,
|
|
295
295
|
onOpenChange: l,
|
|
296
296
|
secretKey: f,
|
|
@@ -299,23 +299,23 @@ function Ot({ isOpen: e, onOpenChange: t, organizationId: n }) {
|
|
|
299
299
|
}
|
|
300
300
|
//#endregion
|
|
301
301
|
//#region src/components/auth/api-key/api-keys.tsx
|
|
302
|
-
function
|
|
303
|
-
let { authClient: o } = p(), { localization: s } = m(
|
|
302
|
+
function Dt({ className: e, variant: t, organizationId: n, isPending: r, hideCreate: i, hideDelete: a }) {
|
|
303
|
+
let { authClient: o } = p(), { localization: s } = m(bt), { data: c, isPending: l } = ie(o, {
|
|
304
304
|
enabled: !r,
|
|
305
305
|
...n ? { query: {
|
|
306
306
|
organizationId: n,
|
|
307
307
|
configId: "organization"
|
|
308
308
|
} } : {}
|
|
309
|
-
}), u = r || l, [d, f] =
|
|
310
|
-
return /* @__PURE__ */
|
|
311
|
-
className:
|
|
309
|
+
}), u = r || l, [d, f] = q(!1);
|
|
310
|
+
return /* @__PURE__ */ X("div", {
|
|
311
|
+
className: G("flex flex-col gap-3", e),
|
|
312
312
|
children: [
|
|
313
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ X("div", {
|
|
314
314
|
className: "flex items-end justify-between gap-3",
|
|
315
|
-
children: [/* @__PURE__ */
|
|
315
|
+
children: [/* @__PURE__ */ Y("h2", {
|
|
316
316
|
className: "text-sm font-semibold truncate",
|
|
317
317
|
children: s.apiKeys
|
|
318
|
-
}), !i && /* @__PURE__ */
|
|
318
|
+
}), !i && /* @__PURE__ */ Y(k, {
|
|
319
319
|
className: "shrink-0",
|
|
320
320
|
size: "sm",
|
|
321
321
|
isDisabled: u,
|
|
@@ -323,18 +323,18 @@ function kt({ className: e, variant: t, organizationId: n, isPending: r, hideCre
|
|
|
323
323
|
children: s.createApiKey
|
|
324
324
|
})]
|
|
325
325
|
}),
|
|
326
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ Y(A, {
|
|
327
327
|
variant: t,
|
|
328
|
-
children: /* @__PURE__ */
|
|
328
|
+
children: /* @__PURE__ */ Y(A.Content, { children: u ? /* @__PURE__ */ Y(Ct, {}) : c?.apiKeys.length ? c?.apiKeys.map((e, t) => /* @__PURE__ */ X("div", { children: [t > 0 && /* @__PURE__ */ Y("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ Y(St, {
|
|
329
329
|
apiKey: e,
|
|
330
330
|
hideDelete: a,
|
|
331
331
|
organizationId: n
|
|
332
|
-
})] }, e.id)) : /* @__PURE__ */
|
|
332
|
+
})] }, e.id)) : /* @__PURE__ */ Y(wt, {
|
|
333
333
|
onCreatePress: () => f(!0),
|
|
334
334
|
hideCreate: i
|
|
335
335
|
}) })
|
|
336
336
|
}),
|
|
337
|
-
!i && /* @__PURE__ */
|
|
337
|
+
!i && /* @__PURE__ */ Y(Et, {
|
|
338
338
|
isOpen: d,
|
|
339
339
|
onOpenChange: f,
|
|
340
340
|
organizationId: n
|
|
@@ -344,58 +344,58 @@ function kt({ className: e, variant: t, organizationId: n, isPending: r, hideCre
|
|
|
344
344
|
}
|
|
345
345
|
//#endregion
|
|
346
346
|
//#region src/lib/auth/delete-user-plugin.ts
|
|
347
|
-
var
|
|
348
|
-
...
|
|
349
|
-
securityCards: [
|
|
347
|
+
var Ot = a(ut.id, (e = {}) => ({
|
|
348
|
+
...ut(e),
|
|
349
|
+
securityCards: [At]
|
|
350
350
|
}));
|
|
351
351
|
//#endregion
|
|
352
352
|
//#region src/components/auth/delete-user/delete-account.tsx
|
|
353
|
-
function
|
|
354
|
-
let { authClient: r, basePaths: a, localization: o, navigate: s, viewPaths: c } = p(), { localization: l, sendDeleteAccountVerification: u } = m(
|
|
353
|
+
function kt({ className: e, variant: t, ...n }) {
|
|
354
|
+
let { authClient: r, basePaths: a, localization: o, navigate: s, viewPaths: c } = p(), { localization: l, sendDeleteAccountVerification: u } = m(Ot), { data: d } = re(r), f = ct(), [h, g] = q(!1), [_, v] = q(""), y = d?.some((e) => e.providerId === "credential"), b = !u && y, { mutate: x, isPending: S } = C(r), w = (e) => {
|
|
355
355
|
g(e), v("");
|
|
356
|
-
},
|
|
356
|
+
}, T = async (e) => {
|
|
357
357
|
e.preventDefault(), x({ ...b ? { password: _ } : {} }, { onSuccess: () => {
|
|
358
|
-
g(!1), v(""), u ?
|
|
358
|
+
g(!1), v(""), u ? K.success(l.deleteUserVerificationSent) : (K.success(l.deleteUserSuccess), f.removeQueries({ queryKey: i.all }), s({
|
|
359
359
|
to: `${a.auth}/${c.auth.signIn}`,
|
|
360
360
|
replace: !0
|
|
361
361
|
}));
|
|
362
362
|
} });
|
|
363
363
|
};
|
|
364
|
-
return /* @__PURE__ */
|
|
364
|
+
return /* @__PURE__ */ Y(A, {
|
|
365
365
|
className: e,
|
|
366
366
|
variant: t,
|
|
367
367
|
...n,
|
|
368
|
-
children: /* @__PURE__ */
|
|
368
|
+
children: /* @__PURE__ */ X(A.Content, {
|
|
369
369
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
370
|
-
children: [/* @__PURE__ */
|
|
370
|
+
children: [/* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("p", {
|
|
371
371
|
className: "text-sm font-medium leading-tight",
|
|
372
372
|
children: l.deleteAccount
|
|
373
|
-
}), /* @__PURE__ */
|
|
373
|
+
}), /* @__PURE__ */ Y("p", {
|
|
374
374
|
className: "text-muted text-xs mt-0.5",
|
|
375
375
|
children: l.deleteAccountDescription
|
|
376
|
-
})] }), /* @__PURE__ */
|
|
376
|
+
})] }), /* @__PURE__ */ X(O, { children: [/* @__PURE__ */ Y(k, {
|
|
377
377
|
isDisabled: !d,
|
|
378
378
|
size: "sm",
|
|
379
379
|
variant: "danger-soft",
|
|
380
380
|
onPress: () => g(!0),
|
|
381
381
|
children: l.deleteAccount
|
|
382
|
-
}), /* @__PURE__ */
|
|
382
|
+
}), /* @__PURE__ */ Y(O.Backdrop, {
|
|
383
383
|
isOpen: h,
|
|
384
|
-
onOpenChange:
|
|
385
|
-
children: /* @__PURE__ */
|
|
386
|
-
onSubmit:
|
|
384
|
+
onOpenChange: w,
|
|
385
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ Y(O.Dialog, { children: /* @__PURE__ */ X(P, {
|
|
386
|
+
onSubmit: T,
|
|
387
387
|
children: [
|
|
388
|
-
/* @__PURE__ */
|
|
389
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
389
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
390
390
|
status: "danger",
|
|
391
|
-
children: /* @__PURE__ */
|
|
392
|
-
}), /* @__PURE__ */
|
|
393
|
-
/* @__PURE__ */
|
|
391
|
+
children: /* @__PURE__ */ Y(Ye, {})
|
|
392
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: l.deleteAccount })] }),
|
|
393
|
+
/* @__PURE__ */ X(O.Body, {
|
|
394
394
|
className: "overflow-visible",
|
|
395
|
-
children: [/* @__PURE__ */
|
|
395
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
396
396
|
className: "text-muted text-sm",
|
|
397
397
|
children: l.deleteAccountDescription
|
|
398
|
-
}), b && /* @__PURE__ */
|
|
398
|
+
}), b && /* @__PURE__ */ X(W, {
|
|
399
399
|
className: "mt-4",
|
|
400
400
|
name: "password",
|
|
401
401
|
type: "password",
|
|
@@ -403,27 +403,27 @@ function jt({ className: e, variant: t, ...n }) {
|
|
|
403
403
|
value: _,
|
|
404
404
|
onChange: v,
|
|
405
405
|
children: [
|
|
406
|
-
/* @__PURE__ */
|
|
407
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ Y(L, { children: o.auth.password }),
|
|
407
|
+
/* @__PURE__ */ Y(F, {
|
|
408
408
|
autoComplete: "current-password",
|
|
409
409
|
placeholder: o.auth.passwordPlaceholder,
|
|
410
410
|
required: !0,
|
|
411
411
|
variant: "secondary"
|
|
412
412
|
}),
|
|
413
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ Y(N, {})
|
|
414
414
|
]
|
|
415
415
|
})]
|
|
416
416
|
}),
|
|
417
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ X(O.Footer, { children: [/* @__PURE__ */ Y(k, {
|
|
418
418
|
slot: "close",
|
|
419
419
|
variant: "tertiary",
|
|
420
420
|
isDisabled: S,
|
|
421
421
|
children: o.settings.cancel
|
|
422
|
-
}), /* @__PURE__ */
|
|
422
|
+
}), /* @__PURE__ */ X(k, {
|
|
423
423
|
type: "submit",
|
|
424
424
|
variant: "danger",
|
|
425
425
|
isPending: S,
|
|
426
|
-
children: [S && /* @__PURE__ */
|
|
426
|
+
children: [S && /* @__PURE__ */ Y(V, {
|
|
427
427
|
color: "current",
|
|
428
428
|
size: "sm"
|
|
429
429
|
}), l.deleteAccount]
|
|
@@ -436,63 +436,63 @@ function jt({ className: e, variant: t, ...n }) {
|
|
|
436
436
|
}
|
|
437
437
|
//#endregion
|
|
438
438
|
//#region src/components/auth/delete-user/danger-zone.tsx
|
|
439
|
-
function
|
|
439
|
+
function At({ className: e, variant: t, ...n }) {
|
|
440
440
|
let { localization: r } = p();
|
|
441
|
-
return /* @__PURE__ */
|
|
442
|
-
className:
|
|
441
|
+
return /* @__PURE__ */ X("div", {
|
|
442
|
+
className: G("flex w-full flex-col", e),
|
|
443
443
|
...n,
|
|
444
|
-
children: [/* @__PURE__ */
|
|
445
|
-
className:
|
|
444
|
+
children: [/* @__PURE__ */ Y("h2", {
|
|
445
|
+
className: G("text-sm font-semibold mb-3 text-danger"),
|
|
446
446
|
children: r.settings.dangerZone
|
|
447
|
-
}), /* @__PURE__ */
|
|
447
|
+
}), /* @__PURE__ */ Y(kt, { variant: t })]
|
|
448
448
|
});
|
|
449
449
|
}
|
|
450
450
|
//#endregion
|
|
451
451
|
//#region src/components/auth/magic-link/magic-link-button.tsx
|
|
452
|
-
function
|
|
453
|
-
let { basePaths: t, emailAndPassword: n, viewPaths: i, localization: a } = p(), o =
|
|
454
|
-
return l && !n?.enabled ? null : /* @__PURE__ */
|
|
452
|
+
function jt({ view: e }) {
|
|
453
|
+
let { basePaths: t, emailAndPassword: n, viewPaths: i, localization: a } = p(), o = Z({ mutationKey: r.signIn.all }) + Z({ mutationKey: r.signUp.all }) > 0, { localization: s, viewPaths: c } = m(Mt), l = e === "magicLink";
|
|
454
|
+
return l && !n?.enabled ? null : /* @__PURE__ */ X(et, {
|
|
455
455
|
href: `${t.auth}/${l ? i.auth.signIn : c.auth.magicLink}`,
|
|
456
456
|
isDisabled: o,
|
|
457
|
-
className:
|
|
458
|
-
children: [
|
|
457
|
+
className: G(_t({ variant: "tertiary" }), "w-full gap-2", o && "status-disabled"),
|
|
458
|
+
children: [Y(l ? Be : Fe, {}), a.auth.continueWith.replace("{{provider}}", l ? a.auth.password : s.magicLink)]
|
|
459
459
|
});
|
|
460
460
|
}
|
|
461
461
|
//#endregion
|
|
462
462
|
//#region src/lib/auth/magic-link-plugin.ts
|
|
463
|
-
var
|
|
464
|
-
...
|
|
465
|
-
authButtons: [
|
|
466
|
-
views: { auth: { magicLink:
|
|
467
|
-
fallbackViews: { auth: { signIn:
|
|
463
|
+
var Mt = a(dt.id, (e = {}) => ({
|
|
464
|
+
...dt(e),
|
|
465
|
+
authButtons: [jt],
|
|
466
|
+
views: { auth: { magicLink: Nt } },
|
|
467
|
+
fallbackViews: { auth: { signIn: Nt } }
|
|
468
468
|
}));
|
|
469
469
|
//#endregion
|
|
470
470
|
//#region src/components/auth/magic-link/magic-link.tsx
|
|
471
|
-
function
|
|
472
|
-
let { authClient: s, basePaths: c, baseURL: l, emailAndPassword: u, localization: d, plugins: f, redirectTo: h, socialProviders: g, viewPaths: _ } = p(), { localization: v } = m(
|
|
473
|
-
b(""),
|
|
474
|
-
} }), C =
|
|
471
|
+
function Nt({ className: n, socialLayout: i, socialPosition: a = "bottom", variant: o }) {
|
|
472
|
+
let { authClient: s, basePaths: c, baseURL: l, emailAndPassword: u, localization: d, plugins: f, redirectTo: h, socialProviders: g, viewPaths: _ } = p(), { localization: v } = m(Mt), [y, b] = q(""), { mutate: x, isPending: S } = ve(s, { onSuccess: () => {
|
|
473
|
+
b(""), K.success(v.magicLinkSent);
|
|
474
|
+
} }), C = Z({ mutationKey: r.signIn.all }) + Z({ mutationKey: r.signUp.all }) > 0, w = (e) => {
|
|
475
475
|
e.preventDefault(), x({
|
|
476
476
|
email: y,
|
|
477
477
|
callbackURL: `${l}${h}`
|
|
478
478
|
});
|
|
479
|
-
},
|
|
480
|
-
return /* @__PURE__ */
|
|
481
|
-
className:
|
|
479
|
+
}, T = !!g?.length;
|
|
480
|
+
return /* @__PURE__ */ X(A, {
|
|
481
|
+
className: G("w-full max-w-sm gap-4 md:p-6", n),
|
|
482
482
|
variant: o,
|
|
483
483
|
children: [
|
|
484
|
-
/* @__PURE__ */
|
|
484
|
+
/* @__PURE__ */ Y(A.Header, { children: /* @__PURE__ */ Y(A.Title, {
|
|
485
485
|
className: "text-xl font-semibold mb-1",
|
|
486
486
|
children: d.auth.signIn
|
|
487
487
|
}) }),
|
|
488
|
-
/* @__PURE__ */
|
|
488
|
+
/* @__PURE__ */ X(A.Content, {
|
|
489
489
|
className: "gap-4",
|
|
490
490
|
children: [
|
|
491
|
-
a === "top" && /* @__PURE__ */
|
|
492
|
-
/* @__PURE__ */
|
|
493
|
-
onSubmit:
|
|
491
|
+
a === "top" && /* @__PURE__ */ X(J, { children: [!!g?.length && /* @__PURE__ */ Y(t, { socialLayout: i }), T && /* @__PURE__ */ Y(e, { children: d.auth.or })] }),
|
|
492
|
+
/* @__PURE__ */ X(P, {
|
|
493
|
+
onSubmit: w,
|
|
494
494
|
className: "flex flex-col gap-4",
|
|
495
|
-
children: [/* @__PURE__ */
|
|
495
|
+
children: [/* @__PURE__ */ X(W, {
|
|
496
496
|
name: "email",
|
|
497
497
|
type: "email",
|
|
498
498
|
autoComplete: "email",
|
|
@@ -500,38 +500,38 @@ function Ft({ className: n, socialLayout: i, socialPosition: a = "bottom", varia
|
|
|
500
500
|
value: y,
|
|
501
501
|
onChange: b,
|
|
502
502
|
children: [
|
|
503
|
-
/* @__PURE__ */
|
|
504
|
-
/* @__PURE__ */
|
|
503
|
+
/* @__PURE__ */ Y(L, { children: d.auth.email }),
|
|
504
|
+
/* @__PURE__ */ Y(F, {
|
|
505
505
|
placeholder: d.auth.emailPlaceholder,
|
|
506
506
|
required: !0,
|
|
507
507
|
variant: o === "transparent" ? "primary" : "secondary"
|
|
508
508
|
}),
|
|
509
|
-
/* @__PURE__ */
|
|
509
|
+
/* @__PURE__ */ Y(N, {})
|
|
510
510
|
]
|
|
511
|
-
}), /* @__PURE__ */
|
|
511
|
+
}), /* @__PURE__ */ X("div", {
|
|
512
512
|
className: "flex flex-col gap-3",
|
|
513
|
-
children: [/* @__PURE__ */
|
|
513
|
+
children: [/* @__PURE__ */ X(k, {
|
|
514
514
|
type: "submit",
|
|
515
515
|
className: "w-full",
|
|
516
516
|
isPending: C,
|
|
517
|
-
children: [S && /* @__PURE__ */
|
|
517
|
+
children: [S && /* @__PURE__ */ Y(V, {
|
|
518
518
|
color: "current",
|
|
519
519
|
size: "sm"
|
|
520
520
|
}), v.sendMagicLink]
|
|
521
|
-
}), f.flatMap((e) => (e.authButtons ?? []).map((t, n) => /* @__PURE__ */
|
|
521
|
+
}), f.flatMap((e) => (e.authButtons ?? []).map((t, n) => /* @__PURE__ */ Y(t, { view: "magicLink" }, `${e.id}-${n.toString()}`)))]
|
|
522
522
|
})]
|
|
523
523
|
}),
|
|
524
|
-
a === "bottom" && /* @__PURE__ */
|
|
524
|
+
a === "bottom" && /* @__PURE__ */ X(J, { children: [T && /* @__PURE__ */ Y(e, { children: d.auth.or }), !!g?.length && /* @__PURE__ */ Y(t, { socialLayout: i })] })
|
|
525
525
|
]
|
|
526
526
|
}),
|
|
527
|
-
u?.enabled && /* @__PURE__ */
|
|
527
|
+
u?.enabled && /* @__PURE__ */ Y(A.Footer, {
|
|
528
528
|
className: "flex-col gap-3",
|
|
529
|
-
children: /* @__PURE__ */
|
|
529
|
+
children: /* @__PURE__ */ X(Qe, {
|
|
530
530
|
className: "text-sm",
|
|
531
531
|
children: [
|
|
532
532
|
d.auth.needToCreateAnAccount,
|
|
533
533
|
" ",
|
|
534
|
-
/* @__PURE__ */
|
|
534
|
+
/* @__PURE__ */ Y(et, {
|
|
535
535
|
href: `${c.auth}/${_.auth.signUp}`,
|
|
536
536
|
className: "text-accent no-underline hover:underline decoration-accent-hover",
|
|
537
537
|
children: d.auth.signUp
|
|
@@ -544,8 +544,8 @@ function Ft({ className: n, socialLayout: i, socialPosition: a = "bottom", varia
|
|
|
544
544
|
}
|
|
545
545
|
//#endregion
|
|
546
546
|
//#region src/components/auth/multi-session/manage-accounts.tsx
|
|
547
|
-
function
|
|
548
|
-
let { authClient: r } = p(), { localization: i } = m(
|
|
547
|
+
function Pt({ className: e, variant: t, ...n }) {
|
|
548
|
+
let { authClient: r } = p(), { localization: i } = m(Rt), { data: a } = E(r), { data: o, isPending: s } = ae(r), c = o?.filter((e) => e.session.id !== a?.session.id), l = [{
|
|
549
549
|
key: a?.session.id ?? "current",
|
|
550
550
|
deviceSession: s ? null : a,
|
|
551
551
|
isPending: s
|
|
@@ -554,16 +554,16 @@ function It({ className: e, variant: t, ...n }) {
|
|
|
554
554
|
deviceSession: e,
|
|
555
555
|
isPending: !1
|
|
556
556
|
})) ?? []];
|
|
557
|
-
return /* @__PURE__ */
|
|
558
|
-
className:
|
|
557
|
+
return /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("h2", {
|
|
558
|
+
className: G("text-sm font-semibold mb-3"),
|
|
559
559
|
children: i.manageAccounts
|
|
560
|
-
}), /* @__PURE__ */
|
|
561
|
-
className:
|
|
560
|
+
}), /* @__PURE__ */ Y(A, {
|
|
561
|
+
className: G(e),
|
|
562
562
|
variant: t,
|
|
563
563
|
...n,
|
|
564
|
-
children: /* @__PURE__ */
|
|
564
|
+
children: /* @__PURE__ */ Y(A.Content, {
|
|
565
565
|
className: "gap-0",
|
|
566
|
-
children: l.map((e, t) => /* @__PURE__ */
|
|
566
|
+
children: l.map((e, t) => /* @__PURE__ */ X("div", { children: [t > 0 && /* @__PURE__ */ Y("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ Y(zt, {
|
|
567
567
|
deviceSession: e.deviceSession,
|
|
568
568
|
isPending: e.isPending
|
|
569
569
|
})] }, e.key))
|
|
@@ -572,16 +572,16 @@ function It({ className: e, variant: t, ...n }) {
|
|
|
572
572
|
}
|
|
573
573
|
//#endregion
|
|
574
574
|
//#region src/components/auth/multi-session/switch-account-submenu-item.tsx
|
|
575
|
-
function
|
|
576
|
-
let { authClient: r } = p(), { mutate: i, isPending: a } =
|
|
577
|
-
return /* @__PURE__ */
|
|
575
|
+
function Ft({ deviceSession: e, hideSubtitle: t }) {
|
|
576
|
+
let { authClient: r } = p(), { mutate: i, isPending: a } = ge(r, { onSuccess: () => window.scrollTo({ top: 0 }) });
|
|
577
|
+
return /* @__PURE__ */ X(M.Item, {
|
|
578
578
|
className: "px-2",
|
|
579
579
|
isDisabled: a,
|
|
580
580
|
onPress: () => i({ sessionToken: e.session.token }),
|
|
581
|
-
children: [/* @__PURE__ */
|
|
581
|
+
children: [/* @__PURE__ */ Y(n, {
|
|
582
582
|
user: e.user,
|
|
583
583
|
hideSubtitle: t
|
|
584
|
-
}), a && /* @__PURE__ */
|
|
584
|
+
}), a && /* @__PURE__ */ Y(V, {
|
|
585
585
|
color: "current",
|
|
586
586
|
size: "sm",
|
|
587
587
|
className: "ml-auto"
|
|
@@ -590,106 +590,106 @@ function Lt({ deviceSession: e, hideSubtitle: t }) {
|
|
|
590
590
|
}
|
|
591
591
|
//#endregion
|
|
592
592
|
//#region src/components/auth/multi-session/switch-account-submenu-content.tsx
|
|
593
|
-
function
|
|
594
|
-
let { authClient: t, basePaths: r, viewPaths: i } = p(), { localization: a } = m(
|
|
595
|
-
return /* @__PURE__ */
|
|
593
|
+
function It({ hideSubtitle: e }) {
|
|
594
|
+
let { authClient: t, basePaths: r, viewPaths: i } = p(), { localization: a } = m(Rt), { data: o } = E(t), { data: s, isPending: c } = ae(t);
|
|
595
|
+
return /* @__PURE__ */ Y(M.Popover, {
|
|
596
596
|
className: "min-w-40 md:min-w-56 max-w-[48svw]",
|
|
597
|
-
children: /* @__PURE__ */
|
|
598
|
-
/* @__PURE__ */
|
|
597
|
+
children: /* @__PURE__ */ X(M.Menu, { children: [
|
|
598
|
+
/* @__PURE__ */ X(M.Item, {
|
|
599
599
|
className: "px-2",
|
|
600
|
-
children: [/* @__PURE__ */
|
|
600
|
+
children: [/* @__PURE__ */ Y(n, {
|
|
601
601
|
isPending: c,
|
|
602
602
|
hideSubtitle: e
|
|
603
|
-
}), !c && /* @__PURE__ */
|
|
603
|
+
}), !c && /* @__PURE__ */ Y(De, { className: "ml-auto" })]
|
|
604
604
|
}),
|
|
605
|
-
s?.filter((e) => e.session.id !== o?.session?.id).map((t) => /* @__PURE__ */
|
|
605
|
+
s?.filter((e) => e.session.id !== o?.session?.id).map((t) => /* @__PURE__ */ Y(Ft, {
|
|
606
606
|
deviceSession: t,
|
|
607
607
|
hideSubtitle: e
|
|
608
608
|
}, t.session.id)),
|
|
609
|
-
/* @__PURE__ */
|
|
609
|
+
/* @__PURE__ */ X(M.Item, {
|
|
610
610
|
textValue: a.addAccount,
|
|
611
611
|
href: `${r.auth}/${i.auth.signIn}`,
|
|
612
|
-
children: [/* @__PURE__ */
|
|
612
|
+
children: [/* @__PURE__ */ Y(ke, { className: "text-muted" }), /* @__PURE__ */ Y(L, { children: a.addAccount })]
|
|
613
613
|
})
|
|
614
614
|
] })
|
|
615
615
|
});
|
|
616
616
|
}
|
|
617
617
|
//#endregion
|
|
618
618
|
//#region src/components/auth/multi-session/switch-account-submenu.tsx
|
|
619
|
-
function
|
|
620
|
-
let { authClient: n } = p(), { data: r } =
|
|
621
|
-
return r ? /* @__PURE__ */
|
|
619
|
+
function Lt({ className: e, hideSubtitle: t }) {
|
|
620
|
+
let { authClient: n } = p(), { data: r } = E(n), { localization: i } = m(Rt);
|
|
621
|
+
return r ? /* @__PURE__ */ X(M.SubmenuTrigger, { children: [/* @__PURE__ */ X(M.Item, {
|
|
622
622
|
className: e,
|
|
623
623
|
textValue: i.switchAccount,
|
|
624
624
|
children: [
|
|
625
|
-
/* @__PURE__ */
|
|
626
|
-
/* @__PURE__ */
|
|
627
|
-
/* @__PURE__ */
|
|
625
|
+
/* @__PURE__ */ Y(we, { className: "text-muted" }),
|
|
626
|
+
/* @__PURE__ */ Y(L, { children: i.switchAccount }),
|
|
627
|
+
/* @__PURE__ */ Y(M.SubmenuIndicator, {})
|
|
628
628
|
]
|
|
629
|
-
}), /* @__PURE__ */
|
|
629
|
+
}), /* @__PURE__ */ Y(M.Popover, {
|
|
630
630
|
className: "min-w-40 md:min-w-56 max-w-[48svw]",
|
|
631
|
-
children: /* @__PURE__ */
|
|
631
|
+
children: /* @__PURE__ */ Y(It, { hideSubtitle: t })
|
|
632
632
|
})] }) : null;
|
|
633
633
|
}
|
|
634
634
|
//#endregion
|
|
635
635
|
//#region src/lib/auth/multi-session-plugin.ts
|
|
636
|
-
var
|
|
637
|
-
...
|
|
638
|
-
accountCards: [
|
|
639
|
-
userMenuItems: [
|
|
636
|
+
var Rt = a(ft.id, (e = {}) => ({
|
|
637
|
+
...ft(e),
|
|
638
|
+
accountCards: [Pt],
|
|
639
|
+
userMenuItems: [Lt]
|
|
640
640
|
}));
|
|
641
641
|
//#endregion
|
|
642
642
|
//#region src/components/auth/multi-session/manage-account.tsx
|
|
643
|
-
function
|
|
644
|
-
let { authClient: r, localization: i } = p(), { localization: a } = m(
|
|
645
|
-
return /* @__PURE__ */
|
|
643
|
+
function zt({ deviceSession: e, isPending: t }) {
|
|
644
|
+
let { authClient: r, localization: i } = p(), { localization: a } = m(Rt), { data: o } = Ce(r), { mutate: s, isPending: c } = ge(r, { onSuccess: () => window.scrollTo({ top: 0 }) }), { mutate: l, isPending: u } = pe(r, { onSuccess: () => K.success(i.settings.revokeSessionSuccess) }), d = e?.session.userId === o?.id, f = c || u;
|
|
645
|
+
return /* @__PURE__ */ X("div", {
|
|
646
646
|
className: "flex items-center justify-between gap-3",
|
|
647
647
|
children: [
|
|
648
|
-
/* @__PURE__ */
|
|
648
|
+
/* @__PURE__ */ Y(n, {
|
|
649
649
|
user: e?.user,
|
|
650
650
|
isPending: t,
|
|
651
651
|
size: "md"
|
|
652
652
|
}),
|
|
653
|
-
e && d && /* @__PURE__ */
|
|
653
|
+
e && d && /* @__PURE__ */ X(k, {
|
|
654
654
|
className: "shrink-0",
|
|
655
655
|
variant: "outline",
|
|
656
656
|
size: "sm",
|
|
657
657
|
onPress: () => l({ sessionToken: e.session.token }),
|
|
658
658
|
isDisabled: f,
|
|
659
|
-
children: [u ? /* @__PURE__ */
|
|
659
|
+
children: [u ? /* @__PURE__ */ Y(V, {
|
|
660
660
|
color: "current",
|
|
661
661
|
size: "sm"
|
|
662
|
-
}) : /* @__PURE__ */
|
|
662
|
+
}) : /* @__PURE__ */ Y(Te, {}), i.auth.signOut]
|
|
663
663
|
}),
|
|
664
|
-
e && !d && /* @__PURE__ */
|
|
664
|
+
e && !d && /* @__PURE__ */ X(M, { children: [/* @__PURE__ */ Y(k, {
|
|
665
665
|
isIconOnly: !0,
|
|
666
666
|
variant: "ghost",
|
|
667
667
|
className: "shrink-0",
|
|
668
668
|
size: "sm",
|
|
669
669
|
isDisabled: f,
|
|
670
|
-
children: /* @__PURE__ */
|
|
671
|
-
}), /* @__PURE__ */
|
|
670
|
+
children: /* @__PURE__ */ Y(Pe, {})
|
|
671
|
+
}), /* @__PURE__ */ Y(M.Popover, { children: /* @__PURE__ */ X(M.Menu, { children: [/* @__PURE__ */ X(M.Item, {
|
|
672
672
|
textValue: a.switchAccount,
|
|
673
673
|
onAction: () => s({ sessionToken: e.session.token }),
|
|
674
|
-
children: [/* @__PURE__ */
|
|
675
|
-
}), /* @__PURE__ */
|
|
674
|
+
children: [/* @__PURE__ */ Y(we, { className: "text-muted" }), a.switchAccount]
|
|
675
|
+
}), /* @__PURE__ */ X(M.Item, {
|
|
676
676
|
textValue: i.auth.signOut,
|
|
677
677
|
onAction: () => l({ sessionToken: e.session.token }),
|
|
678
|
-
children: [/* @__PURE__ */
|
|
678
|
+
children: [/* @__PURE__ */ Y(Te, { className: "text-muted" }), i.auth.signOut]
|
|
679
679
|
})] }) })] })
|
|
680
680
|
]
|
|
681
681
|
});
|
|
682
682
|
}
|
|
683
683
|
//#endregion
|
|
684
684
|
//#region src/components/auth/organization/slug-field.tsx
|
|
685
|
-
function
|
|
685
|
+
function Bt(e) {
|
|
686
686
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-");
|
|
687
687
|
}
|
|
688
|
-
function
|
|
689
|
-
let { authClient: a, localization: o } = p(), { localization: s, checkSlug: c } = m(
|
|
688
|
+
function Vt({ value: e, onChange: t, currentSlug: n, variant: r, ...i }) {
|
|
689
|
+
let { authClient: a, localization: o } = p(), { localization: s, checkSlug: c } = m($), { mutate: l, data: u, error: d, reset: f } = _(a), h = vt((e) => {
|
|
690
690
|
!c || !e.trim() || e.trim() === n || l({ slug: e.trim() });
|
|
691
691
|
}, { wait: 500 });
|
|
692
|
-
|
|
692
|
+
at(() => {
|
|
693
693
|
c && (f(), h.maybeExecute(e));
|
|
694
694
|
}, [
|
|
695
695
|
c,
|
|
@@ -698,9 +698,9 @@ function Ut({ value: e, onChange: t, currentSlug: n, variant: r, ...i }) {
|
|
|
698
698
|
f
|
|
699
699
|
]);
|
|
700
700
|
let g = (e) => {
|
|
701
|
-
t(
|
|
701
|
+
t(Bt(e));
|
|
702
702
|
};
|
|
703
|
-
return /* @__PURE__ */
|
|
703
|
+
return /* @__PURE__ */ X(W, {
|
|
704
704
|
id: "slug",
|
|
705
705
|
name: "slug",
|
|
706
706
|
...i,
|
|
@@ -710,92 +710,94 @@ function Ut({ value: e, onChange: t, currentSlug: n, variant: r, ...i }) {
|
|
|
710
710
|
if (!e) return o.auth.fieldRequired;
|
|
711
711
|
},
|
|
712
712
|
children: [
|
|
713
|
-
/* @__PURE__ */
|
|
714
|
-
/* @__PURE__ */
|
|
713
|
+
/* @__PURE__ */ Y(L, { children: s.slug }),
|
|
714
|
+
/* @__PURE__ */ X(I, {
|
|
715
715
|
variant: r,
|
|
716
|
-
children: [/* @__PURE__ */
|
|
716
|
+
children: [/* @__PURE__ */ Y(I.Input, {
|
|
717
717
|
placeholder: s.slugPlaceholder,
|
|
718
718
|
required: !0
|
|
719
|
-
}), c && !!e.trim() && e.trim() !== n && /* @__PURE__ */
|
|
719
|
+
}), c && !!e.trim() && e.trim() !== n && /* @__PURE__ */ Y(I.Suffix, {
|
|
720
720
|
className: "px-2",
|
|
721
|
-
children: u?.status ? /* @__PURE__ */
|
|
721
|
+
children: u?.status ? /* @__PURE__ */ Y(De, { className: "text-success" }) : d ? /* @__PURE__ */ Y(D, { className: "text-danger" }) : /* @__PURE__ */ Y(V, {
|
|
722
722
|
size: "sm",
|
|
723
723
|
color: "current"
|
|
724
724
|
})
|
|
725
725
|
})]
|
|
726
726
|
}),
|
|
727
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ Y(N, {})
|
|
728
728
|
]
|
|
729
729
|
});
|
|
730
730
|
}
|
|
731
731
|
//#endregion
|
|
732
732
|
//#region src/components/auth/organization/create-organization-dialog.tsx
|
|
733
|
-
function
|
|
734
|
-
let { authClient: n, localization: r } = p(), { localization: i } = m(
|
|
735
|
-
return
|
|
736
|
-
e || (c(""), o(""));
|
|
737
|
-
}, [e]),
|
|
738
|
-
c(
|
|
739
|
-
}, [a]), /* @__PURE__ */
|
|
733
|
+
function Ht({ isOpen: e, onOpenChange: t }) {
|
|
734
|
+
let { authClient: n, localization: r } = p(), { localization: i } = m($), [a, o] = q(""), [s, c] = q(""), [l, u] = q(!1), { mutate: d, isPending: f } = y(n, { onSuccess: () => t(!1) });
|
|
735
|
+
return at(() => {
|
|
736
|
+
e || (c(""), o(""), u(!1));
|
|
737
|
+
}, [e]), at(() => {
|
|
738
|
+
l || c(Bt(a));
|
|
739
|
+
}, [a, l]), /* @__PURE__ */ Y(O.Backdrop, {
|
|
740
740
|
isOpen: e,
|
|
741
741
|
onOpenChange: t,
|
|
742
|
-
children: /* @__PURE__ */
|
|
742
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ Y(O.Dialog, { children: /* @__PURE__ */ X(P, {
|
|
743
743
|
onSubmit: (e) => {
|
|
744
|
-
e.preventDefault(),
|
|
744
|
+
e.preventDefault(), d({
|
|
745
745
|
name: a,
|
|
746
746
|
slug: s
|
|
747
747
|
});
|
|
748
748
|
},
|
|
749
749
|
children: [
|
|
750
|
-
/* @__PURE__ */
|
|
751
|
-
/* @__PURE__ */
|
|
750
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
751
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
752
752
|
status: "default",
|
|
753
|
-
children: /* @__PURE__ */
|
|
754
|
-
}), /* @__PURE__ */
|
|
755
|
-
/* @__PURE__ */
|
|
753
|
+
children: /* @__PURE__ */ Y(Ee, {})
|
|
754
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: i.createOrganization })] }),
|
|
755
|
+
/* @__PURE__ */ X(O.Body, {
|
|
756
756
|
className: "flex flex-col gap-4 overflow-visible",
|
|
757
757
|
children: [
|
|
758
|
-
/* @__PURE__ */
|
|
758
|
+
/* @__PURE__ */ Y("p", {
|
|
759
759
|
className: "text-muted text-sm",
|
|
760
760
|
children: i.organizationsDescription
|
|
761
761
|
}),
|
|
762
|
-
/* @__PURE__ */
|
|
762
|
+
/* @__PURE__ */ X(W, {
|
|
763
763
|
id: "name",
|
|
764
764
|
name: "name",
|
|
765
|
-
isDisabled:
|
|
765
|
+
isDisabled: f,
|
|
766
766
|
value: a,
|
|
767
767
|
onChange: o,
|
|
768
768
|
validate: (e) => {
|
|
769
769
|
if (!e) return r.auth.fieldRequired;
|
|
770
770
|
},
|
|
771
771
|
children: [
|
|
772
|
-
/* @__PURE__ */
|
|
773
|
-
/* @__PURE__ */
|
|
772
|
+
/* @__PURE__ */ Y(L, { children: i.name }),
|
|
773
|
+
/* @__PURE__ */ Y(F, {
|
|
774
774
|
required: !0,
|
|
775
775
|
autoFocus: !0,
|
|
776
776
|
placeholder: i.namePlaceholder,
|
|
777
777
|
variant: "secondary"
|
|
778
778
|
}),
|
|
779
|
-
/* @__PURE__ */
|
|
779
|
+
/* @__PURE__ */ Y(N, {})
|
|
780
780
|
]
|
|
781
781
|
}),
|
|
782
|
-
/* @__PURE__ */
|
|
782
|
+
/* @__PURE__ */ Y(Vt, {
|
|
783
783
|
value: s,
|
|
784
|
-
onChange:
|
|
785
|
-
|
|
784
|
+
onChange: (e) => {
|
|
785
|
+
c(e), u(!0);
|
|
786
|
+
},
|
|
787
|
+
isDisabled: f,
|
|
786
788
|
variant: "secondary"
|
|
787
789
|
})
|
|
788
790
|
]
|
|
789
791
|
}),
|
|
790
|
-
/* @__PURE__ */
|
|
792
|
+
/* @__PURE__ */ X(O.Footer, { children: [/* @__PURE__ */ Y(k, {
|
|
791
793
|
slot: "close",
|
|
792
794
|
variant: "tertiary",
|
|
793
|
-
isDisabled:
|
|
795
|
+
isDisabled: f,
|
|
794
796
|
children: r.settings.cancel
|
|
795
|
-
}), /* @__PURE__ */
|
|
797
|
+
}), /* @__PURE__ */ X(k, {
|
|
796
798
|
type: "submit",
|
|
797
|
-
isPending:
|
|
798
|
-
children: [
|
|
799
|
+
isPending: f,
|
|
800
|
+
children: [f && /* @__PURE__ */ Y(V, {
|
|
799
801
|
color: "current",
|
|
800
802
|
size: "sm"
|
|
801
803
|
}), i.createOrganization]
|
|
@@ -806,75 +808,75 @@ function Wt({ isOpen: e, onOpenChange: t }) {
|
|
|
806
808
|
}
|
|
807
809
|
//#endregion
|
|
808
810
|
//#region src/components/auth/organization/organization-logo.tsx
|
|
809
|
-
function
|
|
810
|
-
if (n && !r) return /* @__PURE__ */
|
|
811
|
-
className:
|
|
811
|
+
function Ut({ className: e, fallback: t, isPending: n, organization: r, size: i = "sm", style: a, ...o }) {
|
|
812
|
+
if (n && !r) return /* @__PURE__ */ Y(B, {
|
|
813
|
+
className: G("rounded-full", i === "sm" ? "size-8" : i === "md" ? "size-10" : "size-12", e),
|
|
812
814
|
style: a
|
|
813
815
|
});
|
|
814
816
|
let s = r?.name?.slice(0, 2).toUpperCase();
|
|
815
|
-
return /* @__PURE__ */
|
|
817
|
+
return /* @__PURE__ */ X(Xe, {
|
|
816
818
|
size: i,
|
|
817
|
-
className:
|
|
819
|
+
className: G("rounded-full", e),
|
|
818
820
|
style: a,
|
|
819
821
|
...o,
|
|
820
|
-
children: [/* @__PURE__ */
|
|
822
|
+
children: [/* @__PURE__ */ Y(Xe.Image, {
|
|
821
823
|
alt: r?.name ?? "Organization",
|
|
822
824
|
src: r?.logo ?? void 0
|
|
823
|
-
}), /* @__PURE__ */
|
|
824
|
-
className:
|
|
825
|
+
}), /* @__PURE__ */ Y(Xe.Fallback, {
|
|
826
|
+
className: G(i === "lg" ? "text-xl" : i === "md" ? "text-base" : "text-sm"),
|
|
825
827
|
delayMs: r?.logo ? 600 : void 0,
|
|
826
|
-
children: t || s || /* @__PURE__ */
|
|
828
|
+
children: t || s || /* @__PURE__ */ Y(Ee, { className: "size-4" })
|
|
827
829
|
})]
|
|
828
830
|
});
|
|
829
831
|
}
|
|
830
832
|
//#endregion
|
|
831
833
|
//#region src/components/auth/organization/organization-view-skeleton.tsx
|
|
832
|
-
function
|
|
833
|
-
return /* @__PURE__ */
|
|
834
|
-
className:
|
|
834
|
+
function Wt({ className: e, hideSlug: t, size: n = "md", ...r }) {
|
|
835
|
+
return /* @__PURE__ */ X("div", {
|
|
836
|
+
className: G("flex min-w-0 items-center gap-2", e),
|
|
835
837
|
...r,
|
|
836
|
-
children: [/* @__PURE__ */
|
|
838
|
+
children: [/* @__PURE__ */ Y(Ut, {
|
|
837
839
|
isPending: !0,
|
|
838
840
|
className: n === "sm" ? "size-5" : void 0,
|
|
839
841
|
size: n === "lg" ? "md" : "sm"
|
|
840
|
-
}), /* @__PURE__ */
|
|
842
|
+
}), /* @__PURE__ */ X("div", {
|
|
841
843
|
className: "flex flex-col min-w-0 gap-1",
|
|
842
|
-
children: [/* @__PURE__ */
|
|
844
|
+
children: [/* @__PURE__ */ Y(B, { className: "h-3.5 w-20 rounded-lg" }), !t && /* @__PURE__ */ Y(B, { className: "h-3 w-28 rounded-lg mt-[0.5px] mb-0.5" })]
|
|
843
845
|
})]
|
|
844
846
|
});
|
|
845
847
|
}
|
|
846
848
|
//#endregion
|
|
847
849
|
//#region src/components/auth/organization/organization-view.tsx
|
|
848
|
-
function
|
|
849
|
-
let { authClient: s } = p(), { roles: c } = m(
|
|
850
|
+
function Q({ className: e, isPending: t, size: n = "md", hideSlug: r, hideRole: i, organization: a, ...o }) {
|
|
851
|
+
let { authClient: s } = p(), { roles: c } = m($), { data: l } = E(s), { data: u, isPending: f } = d(s, { enabled: !a && !t }), h = a ?? u, { data: g, isPending: _ } = se(s, {
|
|
850
852
|
query: { organizationId: h?.id },
|
|
851
853
|
enabled: !!h?.id && !i
|
|
852
854
|
}), v = g?.members?.find((e) => e.userId === l?.user.id);
|
|
853
|
-
return t || !a && f || !i && h?.id && _ ? /* @__PURE__ */
|
|
855
|
+
return t || !a && f || !i && h?.id && _ ? /* @__PURE__ */ Y(Wt, {
|
|
854
856
|
className: e,
|
|
855
857
|
hideSlug: r,
|
|
856
858
|
size: n,
|
|
857
859
|
...o
|
|
858
|
-
}) : /* @__PURE__ */
|
|
859
|
-
className:
|
|
860
|
+
}) : /* @__PURE__ */ X("div", {
|
|
861
|
+
className: G("flex min-w-0 items-center gap-2", e),
|
|
860
862
|
...o,
|
|
861
|
-
children: [/* @__PURE__ */
|
|
863
|
+
children: [/* @__PURE__ */ Y(Ut, {
|
|
862
864
|
organization: h,
|
|
863
865
|
className: n === "sm" ? "size-5 [&>span]:text-xs" : void 0,
|
|
864
866
|
size: n === "lg" ? "md" : "sm"
|
|
865
|
-
}), /* @__PURE__ */
|
|
867
|
+
}), /* @__PURE__ */ X("div", {
|
|
866
868
|
className: "flex flex-col min-w-0",
|
|
867
|
-
children: [/* @__PURE__ */
|
|
869
|
+
children: [/* @__PURE__ */ X("div", {
|
|
868
870
|
className: "flex min-w-0 items-center gap-2",
|
|
869
|
-
children: [/* @__PURE__ */
|
|
871
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
870
872
|
className: "text-foreground text-sm font-medium truncate leading-tight",
|
|
871
873
|
children: h?.name
|
|
872
|
-
}), !i && !!v && /* @__PURE__ */
|
|
874
|
+
}), !i && !!v && /* @__PURE__ */ Y(j, {
|
|
873
875
|
className: "shrink-0 -my-0.5",
|
|
874
876
|
size: "sm",
|
|
875
877
|
children: c?.[v.role] ?? v.role
|
|
876
878
|
})]
|
|
877
|
-
}), !r && /* @__PURE__ */
|
|
879
|
+
}), !r && /* @__PURE__ */ Y("p", {
|
|
878
880
|
className: "text-muted text-xs truncate overflow-x-hidden font-mono leading-tight",
|
|
879
881
|
children: h?.slug
|
|
880
882
|
})]
|
|
@@ -883,51 +885,51 @@ function Z({ className: e, isPending: t, size: n = "md", hideSlug: r, hideRole:
|
|
|
883
885
|
}
|
|
884
886
|
//#endregion
|
|
885
887
|
//#region src/components/auth/organization/organization-row.tsx
|
|
886
|
-
function
|
|
887
|
-
let { authClient: t, basePaths: n, navigate: r } = p(), { localization: i, viewPaths: a, slug: o } = m(
|
|
888
|
+
function Gt({ organization: e }) {
|
|
889
|
+
let { authClient: t, basePaths: n, navigate: r } = p(), { localization: i, viewPaths: a, slug: o } = m($), { mutate: s, isPending: c } = he(t, { onSuccess: () => {
|
|
888
890
|
r({ to: `${n.organization}/${a.organization.settings}` });
|
|
889
891
|
} });
|
|
890
892
|
function l() {
|
|
891
893
|
o === void 0 ? s({ organizationId: e.id }) : r({ to: `${n.organization}/${e.slug}/${a.organization.settings}` });
|
|
892
894
|
}
|
|
893
|
-
return /* @__PURE__ */
|
|
895
|
+
return /* @__PURE__ */ X("div", {
|
|
894
896
|
className: "flex items-center gap-3",
|
|
895
|
-
children: [/* @__PURE__ */
|
|
897
|
+
children: [/* @__PURE__ */ Y(Q, { organization: e }), /* @__PURE__ */ X(k, {
|
|
896
898
|
className: "ml-auto shrink-0",
|
|
897
899
|
variant: "outline",
|
|
898
900
|
size: "sm",
|
|
899
901
|
isPending: c,
|
|
900
902
|
onPress: l,
|
|
901
903
|
"aria-label": i.manage,
|
|
902
|
-
children: [c ? /* @__PURE__ */
|
|
904
|
+
children: [c ? /* @__PURE__ */ Y(V, {
|
|
903
905
|
color: "current",
|
|
904
906
|
size: "sm"
|
|
905
|
-
}) : /* @__PURE__ */
|
|
907
|
+
}) : /* @__PURE__ */ Y(Re, {}), i.manage]
|
|
906
908
|
})]
|
|
907
909
|
});
|
|
908
910
|
}
|
|
909
911
|
//#endregion
|
|
910
912
|
//#region src/components/auth/organization/organizations-empty.tsx
|
|
911
|
-
function
|
|
912
|
-
let { localization: t } = m(
|
|
913
|
-
return /* @__PURE__ */
|
|
913
|
+
function Kt({ onCreatePress: e }) {
|
|
914
|
+
let { localization: t } = m($);
|
|
915
|
+
return /* @__PURE__ */ X($e, {
|
|
914
916
|
className: "flex flex-col items-center gap-4 text-center",
|
|
915
917
|
children: [
|
|
916
|
-
/* @__PURE__ */
|
|
918
|
+
/* @__PURE__ */ Y("div", {
|
|
917
919
|
className: "flex size-12 items-center justify-center rounded-full bg-surface-secondary",
|
|
918
|
-
children: /* @__PURE__ */
|
|
920
|
+
children: /* @__PURE__ */ Y(Ee, { className: "size-5" })
|
|
919
921
|
}),
|
|
920
|
-
/* @__PURE__ */
|
|
922
|
+
/* @__PURE__ */ X("div", {
|
|
921
923
|
className: "flex flex-col gap-2",
|
|
922
|
-
children: [/* @__PURE__ */
|
|
924
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
923
925
|
className: "text-sm font-semibold text-foreground",
|
|
924
926
|
children: t.noOrganizations
|
|
925
|
-
}), /* @__PURE__ */
|
|
927
|
+
}), /* @__PURE__ */ Y("span", {
|
|
926
928
|
className: "text-sm text-muted",
|
|
927
929
|
children: t.organizationsDescription
|
|
928
930
|
})]
|
|
929
931
|
}),
|
|
930
|
-
/* @__PURE__ */
|
|
932
|
+
/* @__PURE__ */ Y(k, {
|
|
931
933
|
size: "sm",
|
|
932
934
|
onPress: e,
|
|
933
935
|
children: t.createOrganization
|
|
@@ -937,57 +939,57 @@ function Jt({ onCreatePress: e }) {
|
|
|
937
939
|
}
|
|
938
940
|
//#endregion
|
|
939
941
|
//#region src/components/auth/organization/organizations.tsx
|
|
940
|
-
function
|
|
941
|
-
let { authClient: t } = p(), { localization: n } = m(
|
|
942
|
-
return /* @__PURE__ */
|
|
942
|
+
function qt({ variant: e }) {
|
|
943
|
+
let { authClient: t } = p(), { localization: n } = m($), [r, i] = q(!1), { data: a, isPending: o } = ce(t);
|
|
944
|
+
return /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ X("div", {
|
|
943
945
|
className: "flex flex-col gap-3",
|
|
944
|
-
children: [/* @__PURE__ */
|
|
946
|
+
children: [/* @__PURE__ */ X("div", {
|
|
945
947
|
className: "flex items-end justify-between gap-3",
|
|
946
|
-
children: [/* @__PURE__ */
|
|
948
|
+
children: [/* @__PURE__ */ Y("h2", {
|
|
947
949
|
className: "truncate text-sm font-semibold",
|
|
948
950
|
children: n.organizations
|
|
949
|
-
}), /* @__PURE__ */
|
|
951
|
+
}), /* @__PURE__ */ Y(k, {
|
|
950
952
|
className: "shrink-0",
|
|
951
953
|
size: "sm",
|
|
952
954
|
isDisabled: o,
|
|
953
955
|
onPress: () => i(!0),
|
|
954
956
|
children: n.createOrganization
|
|
955
957
|
})]
|
|
956
|
-
}), /* @__PURE__ */
|
|
958
|
+
}), /* @__PURE__ */ Y(A, {
|
|
957
959
|
variant: e,
|
|
958
|
-
children: /* @__PURE__ */
|
|
960
|
+
children: /* @__PURE__ */ Y(A.Content, {
|
|
959
961
|
className: "gap-0",
|
|
960
|
-
children: o ? /* @__PURE__ */
|
|
962
|
+
children: o ? /* @__PURE__ */ Y(Wt, {}) : a?.length ? a.map((e, t) => /* @__PURE__ */ X("div", { children: [t > 0 && /* @__PURE__ */ Y("div", { className: "-mx-4 my-4 border-b border-dashed" }), /* @__PURE__ */ Y(Gt, { organization: e })] }, e.id)) : /* @__PURE__ */ Y(Kt, { onCreatePress: () => i(!0) })
|
|
961
963
|
})
|
|
962
964
|
})]
|
|
963
|
-
}), /* @__PURE__ */
|
|
965
|
+
}), /* @__PURE__ */ Y(Ht, {
|
|
964
966
|
isOpen: r,
|
|
965
967
|
onOpenChange: i
|
|
966
968
|
})] });
|
|
967
969
|
}
|
|
968
970
|
//#endregion
|
|
969
971
|
//#region src/components/auth/organization/user-invitation-row.tsx
|
|
970
|
-
function
|
|
971
|
-
let { authClient: t } = p(), { localization: n, roles: r } = m(
|
|
972
|
-
return /* @__PURE__ */
|
|
972
|
+
function Jt({ invitation: e }) {
|
|
973
|
+
let { authClient: t } = p(), { localization: n, roles: r } = m($), { mutate: i, isPending: a } = u(t), { mutate: o, isPending: s } = de(t);
|
|
974
|
+
return /* @__PURE__ */ X("div", {
|
|
973
975
|
className: "flex items-center gap-3",
|
|
974
976
|
children: [
|
|
975
|
-
/* @__PURE__ */
|
|
977
|
+
/* @__PURE__ */ Y("div", {
|
|
976
978
|
className: "flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-secondary",
|
|
977
|
-
children: /* @__PURE__ */
|
|
979
|
+
children: /* @__PURE__ */ Y(Ae, { className: "size-4.5" })
|
|
978
980
|
}),
|
|
979
|
-
/* @__PURE__ */
|
|
981
|
+
/* @__PURE__ */ X("div", {
|
|
980
982
|
className: "flex flex-col",
|
|
981
|
-
children: [/* @__PURE__ */
|
|
983
|
+
children: [/* @__PURE__ */ X("div", {
|
|
982
984
|
className: "flex items-center gap-1.5",
|
|
983
|
-
children: [/* @__PURE__ */
|
|
985
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
984
986
|
className: "truncate text-sm font-medium leading-tight",
|
|
985
987
|
children: e.organizationName
|
|
986
|
-
}), /* @__PURE__ */
|
|
988
|
+
}), /* @__PURE__ */ Y(j, {
|
|
987
989
|
size: "sm",
|
|
988
990
|
children: r?.[e.role] ?? e.role
|
|
989
991
|
})]
|
|
990
|
-
}), /* @__PURE__ */
|
|
992
|
+
}), /* @__PURE__ */ Y("span", {
|
|
991
993
|
className: "truncate text-muted text-xs",
|
|
992
994
|
children: new Date(e.createdAt).toLocaleString(void 0, {
|
|
993
995
|
dateStyle: "medium",
|
|
@@ -995,19 +997,19 @@ function Xt({ invitation: e }) {
|
|
|
995
997
|
})
|
|
996
998
|
})]
|
|
997
999
|
}),
|
|
998
|
-
/* @__PURE__ */
|
|
1000
|
+
/* @__PURE__ */ X("div", {
|
|
999
1001
|
className: "ml-auto flex shrink-0 items-center gap-2",
|
|
1000
|
-
children: [/* @__PURE__ */
|
|
1002
|
+
children: [/* @__PURE__ */ X(k, {
|
|
1001
1003
|
variant: "outline",
|
|
1002
1004
|
size: "sm",
|
|
1003
1005
|
isPending: a,
|
|
1004
1006
|
isDisabled: s,
|
|
1005
1007
|
onPress: () => i({ invitationId: e.id }),
|
|
1006
|
-
children: [a ? /* @__PURE__ */
|
|
1008
|
+
children: [a ? /* @__PURE__ */ Y(V, {
|
|
1007
1009
|
color: "current",
|
|
1008
1010
|
size: "sm"
|
|
1009
|
-
}) : /* @__PURE__ */
|
|
1010
|
-
}), /* @__PURE__ */
|
|
1011
|
+
}) : /* @__PURE__ */ Y(De, {}), n.accept]
|
|
1012
|
+
}), /* @__PURE__ */ Y(k, {
|
|
1011
1013
|
variant: "danger-soft",
|
|
1012
1014
|
size: "sm",
|
|
1013
1015
|
isIconOnly: !0,
|
|
@@ -1015,10 +1017,10 @@ function Xt({ invitation: e }) {
|
|
|
1015
1017
|
isDisabled: a,
|
|
1016
1018
|
onPress: () => o({ invitationId: e.id }),
|
|
1017
1019
|
"aria-label": n.rejectInvitation,
|
|
1018
|
-
children: s ? /* @__PURE__ */
|
|
1020
|
+
children: s ? /* @__PURE__ */ Y(V, {
|
|
1019
1021
|
color: "current",
|
|
1020
1022
|
size: "sm"
|
|
1021
|
-
}) : /* @__PURE__ */
|
|
1023
|
+
}) : /* @__PURE__ */ Y(D, {})
|
|
1022
1024
|
})]
|
|
1023
1025
|
})
|
|
1024
1026
|
]
|
|
@@ -1026,30 +1028,30 @@ function Xt({ invitation: e }) {
|
|
|
1026
1028
|
}
|
|
1027
1029
|
//#endregion
|
|
1028
1030
|
//#region src/components/auth/organization/user-invitation-row-skeleton.tsx
|
|
1029
|
-
function
|
|
1030
|
-
return /* @__PURE__ */
|
|
1031
|
+
function Yt() {
|
|
1032
|
+
return /* @__PURE__ */ X("div", {
|
|
1031
1033
|
className: "flex items-center gap-3",
|
|
1032
|
-
children: [/* @__PURE__ */
|
|
1034
|
+
children: [/* @__PURE__ */ Y(B, { className: "size-10 shrink-0 rounded-xl" }), /* @__PURE__ */ X("div", {
|
|
1033
1035
|
className: "flex flex-col gap-1",
|
|
1034
|
-
children: [/* @__PURE__ */
|
|
1036
|
+
children: [/* @__PURE__ */ Y(B, { className: "h-4 w-40 rounded-lg" }), /* @__PURE__ */ Y(B, { className: "h-3 w-28 rounded-lg" })]
|
|
1035
1037
|
})]
|
|
1036
1038
|
});
|
|
1037
1039
|
}
|
|
1038
1040
|
//#endregion
|
|
1039
1041
|
//#region src/components/auth/organization/user-invitations-empty.tsx
|
|
1040
|
-
function
|
|
1041
|
-
let { localization: e } = m(
|
|
1042
|
-
return /* @__PURE__ */
|
|
1042
|
+
function Xt() {
|
|
1043
|
+
let { localization: e } = m($);
|
|
1044
|
+
return /* @__PURE__ */ X($e, {
|
|
1043
1045
|
className: "flex flex-col items-center gap-4 text-center",
|
|
1044
|
-
children: [/* @__PURE__ */
|
|
1046
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
1045
1047
|
className: "flex size-12 items-center justify-center rounded-full bg-surface-secondary",
|
|
1046
|
-
children: /* @__PURE__ */
|
|
1047
|
-
}), /* @__PURE__ */
|
|
1048
|
+
children: /* @__PURE__ */ Y(Ue, { className: "size-5" })
|
|
1049
|
+
}), /* @__PURE__ */ X("div", {
|
|
1048
1050
|
className: "flex flex-col gap-2",
|
|
1049
|
-
children: [/* @__PURE__ */
|
|
1051
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
1050
1052
|
className: "text-sm font-semibold text-foreground",
|
|
1051
1053
|
children: e.noInvitations
|
|
1052
|
-
}), /* @__PURE__ */
|
|
1054
|
+
}), /* @__PURE__ */ Y("span", {
|
|
1053
1055
|
className: "text-sm text-muted",
|
|
1054
1056
|
children: e.userInvitationsEmptyDescription
|
|
1055
1057
|
})]
|
|
@@ -1058,46 +1060,46 @@ function Qt() {
|
|
|
1058
1060
|
}
|
|
1059
1061
|
//#endregion
|
|
1060
1062
|
//#region src/components/auth/organization/user-invitations.tsx
|
|
1061
|
-
function
|
|
1062
|
-
let { authClient: t } = p(), { localization: n } = m(
|
|
1063
|
-
return /* @__PURE__ */
|
|
1063
|
+
function Zt({ variant: e }) {
|
|
1064
|
+
let { authClient: t } = p(), { localization: n } = m($), { data: r, isPending: i } = ue(t);
|
|
1065
|
+
return /* @__PURE__ */ X("div", {
|
|
1064
1066
|
className: "flex flex-col gap-3",
|
|
1065
|
-
children: [/* @__PURE__ */
|
|
1067
|
+
children: [/* @__PURE__ */ Y("h2", {
|
|
1066
1068
|
className: "truncate text-sm font-semibold",
|
|
1067
1069
|
children: n.invitations
|
|
1068
|
-
}), /* @__PURE__ */
|
|
1070
|
+
}), /* @__PURE__ */ Y(A, {
|
|
1069
1071
|
variant: e,
|
|
1070
|
-
children: /* @__PURE__ */
|
|
1072
|
+
children: /* @__PURE__ */ Y(A.Content, { children: i ? /* @__PURE__ */ Y(Yt, {}) : r?.length ? r?.map((e, t) => /* @__PURE__ */ X("div", { children: [t > 0 && /* @__PURE__ */ Y("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ Y(Jt, { invitation: e })] }, e.id)) : /* @__PURE__ */ Y(Xt, {}) })
|
|
1071
1073
|
})]
|
|
1072
1074
|
});
|
|
1073
1075
|
}
|
|
1074
1076
|
//#endregion
|
|
1075
1077
|
//#region src/components/auth/organization/organizations-settings.tsx
|
|
1076
|
-
function
|
|
1077
|
-
return /* @__PURE__ */
|
|
1078
|
-
className:
|
|
1078
|
+
function Qt({ className: e, variant: t, ...n }) {
|
|
1079
|
+
return /* @__PURE__ */ X("div", {
|
|
1080
|
+
className: G("flex w-full flex-col gap-4 md:gap-6", e),
|
|
1079
1081
|
...n,
|
|
1080
|
-
children: [/* @__PURE__ */
|
|
1082
|
+
children: [/* @__PURE__ */ Y(qt, { variant: t }), /* @__PURE__ */ Y(Zt, { variant: t })]
|
|
1081
1083
|
});
|
|
1082
1084
|
}
|
|
1083
1085
|
//#endregion
|
|
1084
1086
|
//#region src/lib/auth/organization-plugin.tsx
|
|
1085
|
-
var
|
|
1086
|
-
let t =
|
|
1087
|
+
var $ = a(pt.id, (e = {}) => {
|
|
1088
|
+
let t = pt(e);
|
|
1087
1089
|
return {
|
|
1088
1090
|
...t,
|
|
1089
1091
|
localization: t.localization,
|
|
1090
1092
|
settingsTabs: [{
|
|
1091
1093
|
view: "organizations",
|
|
1092
|
-
label: /* @__PURE__ */
|
|
1093
|
-
component:
|
|
1094
|
+
label: /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(Ee, { className: "text-muted" }), t.localization.organizations] }),
|
|
1095
|
+
component: Qt
|
|
1094
1096
|
}]
|
|
1095
1097
|
};
|
|
1096
1098
|
});
|
|
1097
1099
|
//#endregion
|
|
1098
1100
|
//#region src/components/auth/organization/change-organization-logo.tsx
|
|
1099
|
-
function
|
|
1100
|
-
let { authClient: t } = p(), { logo: n, localization: r } = m(
|
|
1101
|
+
function $t({ className: e }) {
|
|
1102
|
+
let { authClient: t } = p(), { logo: n, localization: r } = m($), { data: i, isPending: a } = d(t), { mutate: s, isPending: c } = Se(t), l = st(null), [u, f] = q(!1), [h, g] = q(!1), _ = c || u || h;
|
|
1101
1103
|
async function v(e) {
|
|
1102
1104
|
let t = e.target.files?.[0];
|
|
1103
1105
|
if (!(!t || !i)) {
|
|
@@ -1105,11 +1107,11 @@ function tn({ className: e }) {
|
|
|
1105
1107
|
try {
|
|
1106
1108
|
let e = await n.resize?.(t, n.size, n.extension) || t;
|
|
1107
1109
|
s({ data: { logo: await n.upload?.(e) || await o(e) } }, {
|
|
1108
|
-
onSuccess: () =>
|
|
1110
|
+
onSuccess: () => K.success(r.logoChangedSuccess),
|
|
1109
1111
|
onSettled: () => f(!1)
|
|
1110
1112
|
});
|
|
1111
1113
|
} catch (e) {
|
|
1112
|
-
f(!1), e instanceof Error &&
|
|
1114
|
+
f(!1), e instanceof Error && K.danger(e.message);
|
|
1113
1115
|
}
|
|
1114
1116
|
}
|
|
1115
1117
|
}
|
|
@@ -1117,64 +1119,64 @@ function tn({ className: e }) {
|
|
|
1117
1119
|
let e = i?.logo;
|
|
1118
1120
|
s({ data: { logo: "" } }, { onSuccess: async () => {
|
|
1119
1121
|
if (!e) {
|
|
1120
|
-
|
|
1122
|
+
K.success(r.logoDeletedSuccess);
|
|
1121
1123
|
return;
|
|
1122
1124
|
}
|
|
1123
1125
|
g(!0);
|
|
1124
1126
|
try {
|
|
1125
|
-
await n.delete?.(e),
|
|
1127
|
+
await n.delete?.(e), K.success(r.logoDeletedSuccess);
|
|
1126
1128
|
} catch (e) {
|
|
1127
|
-
e instanceof Error &&
|
|
1129
|
+
e instanceof Error && K.danger(e.message);
|
|
1128
1130
|
} finally {
|
|
1129
1131
|
g(!1);
|
|
1130
1132
|
}
|
|
1131
1133
|
} });
|
|
1132
1134
|
}
|
|
1133
|
-
return n.enabled ? /* @__PURE__ */
|
|
1134
|
-
className:
|
|
1135
|
+
return n.enabled ? /* @__PURE__ */ X("div", {
|
|
1136
|
+
className: G("flex flex-col gap-1", e),
|
|
1135
1137
|
children: [
|
|
1136
|
-
/* @__PURE__ */
|
|
1138
|
+
/* @__PURE__ */ Y(L, {
|
|
1137
1139
|
isDisabled: !i,
|
|
1138
1140
|
children: r.logo
|
|
1139
1141
|
}),
|
|
1140
|
-
/* @__PURE__ */
|
|
1142
|
+
/* @__PURE__ */ Y("input", {
|
|
1141
1143
|
ref: l,
|
|
1142
1144
|
type: "file",
|
|
1143
1145
|
accept: "image/*",
|
|
1144
1146
|
className: "hidden",
|
|
1145
1147
|
onChange: v
|
|
1146
1148
|
}),
|
|
1147
|
-
/* @__PURE__ */
|
|
1149
|
+
/* @__PURE__ */ X("div", {
|
|
1148
1150
|
className: "flex items-center gap-4",
|
|
1149
|
-
children: [/* @__PURE__ */
|
|
1151
|
+
children: [/* @__PURE__ */ Y(k, {
|
|
1150
1152
|
type: "button",
|
|
1151
1153
|
isIconOnly: !0,
|
|
1152
1154
|
variant: "ghost",
|
|
1153
1155
|
className: "p-0 h-auto w-auto rounded-full",
|
|
1154
1156
|
isDisabled: !i || _,
|
|
1155
1157
|
onPress: () => l.current?.click(),
|
|
1156
|
-
children: /* @__PURE__ */
|
|
1158
|
+
children: /* @__PURE__ */ Y(Ut, {
|
|
1157
1159
|
size: "lg",
|
|
1158
1160
|
isPending: a,
|
|
1159
1161
|
organization: i
|
|
1160
1162
|
})
|
|
1161
|
-
}), /* @__PURE__ */
|
|
1163
|
+
}), /* @__PURE__ */ X(M, { children: [/* @__PURE__ */ X(k, {
|
|
1162
1164
|
isDisabled: !i || _,
|
|
1163
1165
|
size: "sm",
|
|
1164
1166
|
variant: "secondary",
|
|
1165
|
-
children: [_ && /* @__PURE__ */
|
|
1166
|
-
}), /* @__PURE__ */
|
|
1167
|
+
children: [_ && /* @__PURE__ */ Y(V, { size: "sm" }), r.changeLogo]
|
|
1168
|
+
}), /* @__PURE__ */ Y(M.Popover, {
|
|
1167
1169
|
className: "min-w-fit",
|
|
1168
|
-
children: /* @__PURE__ */
|
|
1170
|
+
children: /* @__PURE__ */ X(M.Menu, { children: [/* @__PURE__ */ X(M.Item, {
|
|
1169
1171
|
textValue: r.uploadLogo,
|
|
1170
1172
|
onAction: () => l.current?.click(),
|
|
1171
|
-
children: [/* @__PURE__ */
|
|
1172
|
-
}), /* @__PURE__ */
|
|
1173
|
+
children: [/* @__PURE__ */ Y(je, { className: "text-muted" }), /* @__PURE__ */ Y(L, { children: r.uploadLogo })]
|
|
1174
|
+
}), /* @__PURE__ */ X(M.Item, {
|
|
1173
1175
|
textValue: r.deleteLogo,
|
|
1174
1176
|
isDisabled: !i?.logo,
|
|
1175
1177
|
onAction: y,
|
|
1176
1178
|
variant: "danger",
|
|
1177
|
-
children: [/* @__PURE__ */
|
|
1179
|
+
children: [/* @__PURE__ */ Y(Je, { className: "text-danger" }), /* @__PURE__ */ Y(L, { children: r.deleteLogo })]
|
|
1178
1180
|
})] })
|
|
1179
1181
|
})] })]
|
|
1180
1182
|
})
|
|
@@ -1183,9 +1185,9 @@ function tn({ className: e }) {
|
|
|
1183
1185
|
}
|
|
1184
1186
|
//#endregion
|
|
1185
1187
|
//#region src/components/auth/organization/delete-organization-dialog.tsx
|
|
1186
|
-
function
|
|
1187
|
-
let { authClient: r, basePaths: i, localization: a, navigate: o } = p(), { localization: s, viewPaths: c } = m(
|
|
1188
|
-
t(!1),
|
|
1188
|
+
function en({ isOpen: e, onOpenChange: t, organization: n }) {
|
|
1189
|
+
let { authClient: r, basePaths: i, localization: a, navigate: o } = p(), { localization: s, viewPaths: c } = m($), { mutate: l, isPending: u } = x(r, { onSuccess: () => {
|
|
1190
|
+
t(!1), K.success(s.organizationDeleted), o({
|
|
1189
1191
|
to: `${i.settings}/${c.settings.organizations}`,
|
|
1190
1192
|
replace: !0
|
|
1191
1193
|
});
|
|
@@ -1193,40 +1195,40 @@ function nn({ isOpen: e, onOpenChange: t, organization: n }) {
|
|
|
1193
1195
|
function d(e) {
|
|
1194
1196
|
e.preventDefault(), l({ organizationId: n.id });
|
|
1195
1197
|
}
|
|
1196
|
-
return /* @__PURE__ */
|
|
1198
|
+
return /* @__PURE__ */ Y(O.Backdrop, {
|
|
1197
1199
|
isOpen: e,
|
|
1198
1200
|
onOpenChange: t,
|
|
1199
|
-
children: /* @__PURE__ */
|
|
1201
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ Y(O.Dialog, { children: /* @__PURE__ */ X(P, {
|
|
1200
1202
|
onSubmit: d,
|
|
1201
1203
|
children: [
|
|
1202
|
-
/* @__PURE__ */
|
|
1203
|
-
/* @__PURE__ */
|
|
1204
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
1205
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
1204
1206
|
status: "danger",
|
|
1205
|
-
children: /* @__PURE__ */
|
|
1206
|
-
}), /* @__PURE__ */
|
|
1207
|
-
/* @__PURE__ */
|
|
1207
|
+
children: /* @__PURE__ */ Y(Ye, {})
|
|
1208
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: s.deleteOrganization })] }),
|
|
1209
|
+
/* @__PURE__ */ X(O.Body, {
|
|
1208
1210
|
className: "flex flex-col gap-4 overflow-visible",
|
|
1209
|
-
children: [/* @__PURE__ */
|
|
1211
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
1210
1212
|
className: "text-muted text-sm",
|
|
1211
1213
|
children: s.deleteOrganizationDescription
|
|
1212
|
-
}), /* @__PURE__ */
|
|
1214
|
+
}), /* @__PURE__ */ Y(A, {
|
|
1213
1215
|
variant: "secondary",
|
|
1214
|
-
children: /* @__PURE__ */
|
|
1216
|
+
children: /* @__PURE__ */ Y(A.Content, { children: /* @__PURE__ */ Y(Q, {
|
|
1215
1217
|
organization: n,
|
|
1216
1218
|
hideRole: !0
|
|
1217
1219
|
}) })
|
|
1218
1220
|
})]
|
|
1219
1221
|
}),
|
|
1220
|
-
/* @__PURE__ */
|
|
1222
|
+
/* @__PURE__ */ X(O.Footer, { children: [/* @__PURE__ */ Y(k, {
|
|
1221
1223
|
slot: "close",
|
|
1222
1224
|
variant: "tertiary",
|
|
1223
1225
|
isDisabled: u,
|
|
1224
1226
|
children: a.settings.cancel
|
|
1225
|
-
}), /* @__PURE__ */
|
|
1227
|
+
}), /* @__PURE__ */ X(k, {
|
|
1226
1228
|
type: "submit",
|
|
1227
1229
|
variant: "danger",
|
|
1228
1230
|
isPending: u,
|
|
1229
|
-
children: [u && /* @__PURE__ */
|
|
1231
|
+
children: [u && /* @__PURE__ */ Y(V, {
|
|
1230
1232
|
color: "current",
|
|
1231
1233
|
size: "sm"
|
|
1232
1234
|
}), s.deleteOrganization]
|
|
@@ -1237,34 +1239,34 @@ function nn({ isOpen: e, onOpenChange: t, organization: n }) {
|
|
|
1237
1239
|
}
|
|
1238
1240
|
//#endregion
|
|
1239
1241
|
//#region src/components/auth/organization/delete-organization-skeleton.tsx
|
|
1240
|
-
function
|
|
1241
|
-
return /* @__PURE__ */
|
|
1242
|
+
function tn() {
|
|
1243
|
+
return /* @__PURE__ */ X("div", {
|
|
1242
1244
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
1243
|
-
children: [/* @__PURE__ */
|
|
1245
|
+
children: [/* @__PURE__ */ X("div", {
|
|
1244
1246
|
className: "flex flex-col gap-1",
|
|
1245
|
-
children: [/* @__PURE__ */
|
|
1246
|
-
}), /* @__PURE__ */
|
|
1247
|
+
children: [/* @__PURE__ */ Y(B, { className: "h-3.5 w-40 rounded-lg" }), /* @__PURE__ */ Y(B, { className: "h-3 w-64 rounded-lg" })]
|
|
1248
|
+
}), /* @__PURE__ */ Y(B, { className: "h-8 w-36 shrink-0 rounded-full" })]
|
|
1247
1249
|
});
|
|
1248
1250
|
}
|
|
1249
1251
|
//#endregion
|
|
1250
1252
|
//#region src/components/auth/organization/delete-organization.tsx
|
|
1251
|
-
function
|
|
1252
|
-
let { authClient: e } = p(), { localization: t } = m(
|
|
1253
|
-
return i ? /* @__PURE__ */
|
|
1253
|
+
function nn() {
|
|
1254
|
+
let { authClient: e } = p(), { localization: t } = m($), { data: n } = d(e), { data: r, isPending: i } = T(e, { permissions: { organization: ["delete"] } }), [a, o] = q(!1);
|
|
1255
|
+
return i ? /* @__PURE__ */ Y(tn, {}) : r?.success ? /* @__PURE__ */ X("div", {
|
|
1254
1256
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
1255
|
-
children: [/* @__PURE__ */
|
|
1257
|
+
children: [/* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("p", {
|
|
1256
1258
|
className: "text-sm font-medium leading-tight",
|
|
1257
1259
|
children: t.deleteOrganization
|
|
1258
|
-
}), /* @__PURE__ */
|
|
1260
|
+
}), /* @__PURE__ */ Y("p", {
|
|
1259
1261
|
className: "text-muted mt-0.5 text-xs",
|
|
1260
1262
|
children: t.deleteOrganizationDescription
|
|
1261
|
-
})] }), /* @__PURE__ */
|
|
1263
|
+
})] }), /* @__PURE__ */ X(O, { children: [/* @__PURE__ */ Y(k, {
|
|
1262
1264
|
isDisabled: !n,
|
|
1263
1265
|
size: "sm",
|
|
1264
1266
|
variant: "danger-soft",
|
|
1265
1267
|
onPress: () => o(!0),
|
|
1266
1268
|
children: t.deleteOrganization
|
|
1267
|
-
}), n && /* @__PURE__ */
|
|
1269
|
+
}), n && /* @__PURE__ */ Y(en, {
|
|
1268
1270
|
isOpen: a,
|
|
1269
1271
|
onOpenChange: o,
|
|
1270
1272
|
organization: n
|
|
@@ -1273,22 +1275,22 @@ function an() {
|
|
|
1273
1275
|
}
|
|
1274
1276
|
//#endregion
|
|
1275
1277
|
//#region src/components/auth/organization/invite-member-dialog.tsx
|
|
1276
|
-
var
|
|
1277
|
-
function
|
|
1278
|
-
let { authClient: n, localization: r } = p(), { localization: i, roles: a } = m(
|
|
1279
|
-
|
|
1278
|
+
var rn = (e) => e.includes("member") ? "member" : e.at(-1) ?? "";
|
|
1279
|
+
function an({ isOpen: e, onOpenChange: t }) {
|
|
1280
|
+
let { authClient: n, localization: r } = p(), { localization: i, roles: a } = m($), [o, s] = q(() => rn(Object.keys(a)));
|
|
1281
|
+
at(() => {
|
|
1280
1282
|
s((e) => {
|
|
1281
1283
|
let t = Object.keys(a);
|
|
1282
|
-
return t.includes(e) ? e :
|
|
1284
|
+
return t.includes(e) ? e : rn(t);
|
|
1283
1285
|
});
|
|
1284
1286
|
}, [a]);
|
|
1285
|
-
let { mutate: c, isPending: l } =
|
|
1286
|
-
t(!1),
|
|
1287
|
+
let { mutate: c, isPending: l } = ee(n, { onSuccess: () => {
|
|
1288
|
+
t(!1), K.success(i.inviteMemberSuccess);
|
|
1287
1289
|
} }), u = Object.keys(a).includes(o);
|
|
1288
|
-
return /* @__PURE__ */
|
|
1290
|
+
return /* @__PURE__ */ Y(O.Backdrop, {
|
|
1289
1291
|
isOpen: e,
|
|
1290
1292
|
onOpenChange: t,
|
|
1291
|
-
children: /* @__PURE__ */
|
|
1293
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ Y(O.Dialog, { children: /* @__PURE__ */ X(P, {
|
|
1292
1294
|
onSubmit: (e) => {
|
|
1293
1295
|
e.preventDefault(), u && c({
|
|
1294
1296
|
email: new FormData(e.target).get("email").trim(),
|
|
@@ -1296,19 +1298,19 @@ function sn({ isOpen: e, onOpenChange: t }) {
|
|
|
1296
1298
|
});
|
|
1297
1299
|
},
|
|
1298
1300
|
children: [
|
|
1299
|
-
/* @__PURE__ */
|
|
1300
|
-
/* @__PURE__ */
|
|
1301
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
1302
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
1301
1303
|
status: "default",
|
|
1302
|
-
children: /* @__PURE__ */
|
|
1303
|
-
}), /* @__PURE__ */
|
|
1304
|
-
/* @__PURE__ */
|
|
1304
|
+
children: /* @__PURE__ */ Y(Ke, {})
|
|
1305
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: i.inviteMember })] }),
|
|
1306
|
+
/* @__PURE__ */ X(O.Body, {
|
|
1305
1307
|
className: "flex flex-col gap-4 overflow-visible",
|
|
1306
1308
|
children: [
|
|
1307
|
-
/* @__PURE__ */
|
|
1309
|
+
/* @__PURE__ */ Y("p", {
|
|
1308
1310
|
className: "text-muted text-sm",
|
|
1309
1311
|
children: i.inviteMemberDescription
|
|
1310
1312
|
}),
|
|
1311
|
-
/* @__PURE__ */
|
|
1313
|
+
/* @__PURE__ */ X(W, {
|
|
1312
1314
|
id: "email",
|
|
1313
1315
|
name: "email",
|
|
1314
1316
|
type: "email",
|
|
@@ -1318,17 +1320,17 @@ function sn({ isOpen: e, onOpenChange: t }) {
|
|
|
1318
1320
|
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)) return r.auth.invalidEmail;
|
|
1319
1321
|
},
|
|
1320
1322
|
children: [
|
|
1321
|
-
/* @__PURE__ */
|
|
1322
|
-
/* @__PURE__ */
|
|
1323
|
+
/* @__PURE__ */ Y(L, { children: r.auth.email }),
|
|
1324
|
+
/* @__PURE__ */ Y(F, {
|
|
1323
1325
|
autoFocus: !0,
|
|
1324
1326
|
placeholder: r.auth.email,
|
|
1325
1327
|
variant: "secondary",
|
|
1326
1328
|
required: !0
|
|
1327
1329
|
}),
|
|
1328
|
-
/* @__PURE__ */
|
|
1330
|
+
/* @__PURE__ */ Y(N, {})
|
|
1329
1331
|
]
|
|
1330
1332
|
}),
|
|
1331
|
-
/* @__PURE__ */
|
|
1333
|
+
/* @__PURE__ */ X(rt, {
|
|
1332
1334
|
name: "role",
|
|
1333
1335
|
value: o,
|
|
1334
1336
|
onChange: (e) => {
|
|
@@ -1338,28 +1340,28 @@ function sn({ isOpen: e, onOpenChange: t }) {
|
|
|
1338
1340
|
variant: "secondary",
|
|
1339
1341
|
fullWidth: !0,
|
|
1340
1342
|
children: [
|
|
1341
|
-
/* @__PURE__ */
|
|
1342
|
-
/* @__PURE__ */
|
|
1343
|
-
/* @__PURE__ */
|
|
1343
|
+
/* @__PURE__ */ Y(L, { children: i.role }),
|
|
1344
|
+
/* @__PURE__ */ X(rt.Trigger, { children: [/* @__PURE__ */ Y(rt.Value, {}), /* @__PURE__ */ Y(rt.Indicator, {})] }),
|
|
1345
|
+
/* @__PURE__ */ Y(rt.Popover, { children: /* @__PURE__ */ Y(tt, { children: Object.entries(a).map(([e, t]) => /* @__PURE__ */ X(tt.Item, {
|
|
1344
1346
|
id: e,
|
|
1345
1347
|
textValue: t,
|
|
1346
|
-
children: [t, /* @__PURE__ */
|
|
1348
|
+
children: [t, /* @__PURE__ */ Y(tt.ItemIndicator, {})]
|
|
1347
1349
|
}, e)) }) }),
|
|
1348
|
-
/* @__PURE__ */
|
|
1350
|
+
/* @__PURE__ */ Y(N, {})
|
|
1349
1351
|
]
|
|
1350
1352
|
})
|
|
1351
1353
|
]
|
|
1352
1354
|
}),
|
|
1353
|
-
/* @__PURE__ */
|
|
1355
|
+
/* @__PURE__ */ X(O.Footer, { children: [/* @__PURE__ */ Y(k, {
|
|
1354
1356
|
slot: "close",
|
|
1355
1357
|
variant: "tertiary",
|
|
1356
1358
|
isDisabled: l,
|
|
1357
1359
|
children: r.settings.cancel
|
|
1358
|
-
}), /* @__PURE__ */
|
|
1360
|
+
}), /* @__PURE__ */ X(k, {
|
|
1359
1361
|
type: "submit",
|
|
1360
1362
|
isPending: l,
|
|
1361
1363
|
isDisabled: !u,
|
|
1362
|
-
children: [l && /* @__PURE__ */
|
|
1364
|
+
children: [l && /* @__PURE__ */ Y(V, {
|
|
1363
1365
|
color: "current",
|
|
1364
1366
|
size: "sm"
|
|
1365
1367
|
}), i.inviteMember]
|
|
@@ -1370,45 +1372,45 @@ function sn({ isOpen: e, onOpenChange: t }) {
|
|
|
1370
1372
|
}
|
|
1371
1373
|
//#endregion
|
|
1372
1374
|
//#region src/components/auth/organization/leave-organization-dialog.tsx
|
|
1373
|
-
function
|
|
1374
|
-
let { authClient: r, basePaths: i, localization: a, navigate: o } = p(), { localization: s, viewPaths: c } = m(
|
|
1375
|
-
t(!1),
|
|
1375
|
+
function on({ isOpen: e, onOpenChange: t, organization: n }) {
|
|
1376
|
+
let { authClient: r, basePaths: i, localization: a, navigate: o } = p(), { localization: s, viewPaths: c } = m($), { mutate: l, isPending: u } = ne(r, { onSuccess: () => {
|
|
1377
|
+
t(!1), K.success(s.leftOrganization), o({
|
|
1376
1378
|
to: `${i.settings}/${c.settings.organizations}`,
|
|
1377
1379
|
replace: !0
|
|
1378
1380
|
});
|
|
1379
1381
|
} });
|
|
1380
|
-
return /* @__PURE__ */
|
|
1382
|
+
return /* @__PURE__ */ Y(O.Backdrop, {
|
|
1381
1383
|
isOpen: e,
|
|
1382
1384
|
onOpenChange: t,
|
|
1383
|
-
children: /* @__PURE__ */
|
|
1384
|
-
/* @__PURE__ */
|
|
1385
|
-
/* @__PURE__ */
|
|
1385
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ X(O.Dialog, { children: [
|
|
1386
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
1387
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
1386
1388
|
status: "danger",
|
|
1387
|
-
children: /* @__PURE__ */
|
|
1388
|
-
}), /* @__PURE__ */
|
|
1389
|
-
/* @__PURE__ */
|
|
1389
|
+
children: /* @__PURE__ */ Y(Te, {})
|
|
1390
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: s.leaveOrganization })] }),
|
|
1391
|
+
/* @__PURE__ */ X(O.Body, {
|
|
1390
1392
|
className: "flex flex-col gap-4 overflow-visible",
|
|
1391
|
-
children: [/* @__PURE__ */
|
|
1393
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
1392
1394
|
className: "text-muted text-sm",
|
|
1393
1395
|
children: s.leaveOrganizationDescription
|
|
1394
|
-
}), /* @__PURE__ */
|
|
1396
|
+
}), /* @__PURE__ */ Y(A, {
|
|
1395
1397
|
variant: "secondary",
|
|
1396
|
-
children: /* @__PURE__ */
|
|
1398
|
+
children: /* @__PURE__ */ Y(A.Content, { children: /* @__PURE__ */ Y(Q, {
|
|
1397
1399
|
organization: n,
|
|
1398
1400
|
hideRole: !0
|
|
1399
1401
|
}) })
|
|
1400
1402
|
})]
|
|
1401
1403
|
}),
|
|
1402
|
-
/* @__PURE__ */
|
|
1404
|
+
/* @__PURE__ */ X(O.Footer, { children: [/* @__PURE__ */ Y(k, {
|
|
1403
1405
|
slot: "close",
|
|
1404
1406
|
variant: "tertiary",
|
|
1405
1407
|
isDisabled: u,
|
|
1406
1408
|
children: a.settings.cancel
|
|
1407
|
-
}), /* @__PURE__ */
|
|
1409
|
+
}), /* @__PURE__ */ X(k, {
|
|
1408
1410
|
variant: "danger",
|
|
1409
1411
|
isPending: u,
|
|
1410
1412
|
onPress: () => l({ organizationId: n.id }),
|
|
1411
|
-
children: [u && /* @__PURE__ */
|
|
1413
|
+
children: [u && /* @__PURE__ */ Y(V, {
|
|
1412
1414
|
color: "current",
|
|
1413
1415
|
size: "sm"
|
|
1414
1416
|
}), s.leaveOrganization]
|
|
@@ -1418,23 +1420,23 @@ function cn({ isOpen: e, onOpenChange: t, organization: n }) {
|
|
|
1418
1420
|
}
|
|
1419
1421
|
//#endregion
|
|
1420
1422
|
//#region src/components/auth/organization/leave-organization.tsx
|
|
1421
|
-
function
|
|
1422
|
-
let { authClient: e } = p(), { localization: t } = m(
|
|
1423
|
-
return /* @__PURE__ */
|
|
1423
|
+
function sn() {
|
|
1424
|
+
let { authClient: e } = p(), { localization: t } = m($), { data: n } = d(e), [r, i] = q(!1);
|
|
1425
|
+
return /* @__PURE__ */ X("div", {
|
|
1424
1426
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
1425
|
-
children: [/* @__PURE__ */
|
|
1427
|
+
children: [/* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("p", {
|
|
1426
1428
|
className: "text-sm font-medium leading-tight",
|
|
1427
1429
|
children: t.leaveOrganization
|
|
1428
|
-
}), /* @__PURE__ */
|
|
1430
|
+
}), /* @__PURE__ */ Y("p", {
|
|
1429
1431
|
className: "text-muted mt-0.5 text-xs",
|
|
1430
1432
|
children: t.leaveOrganizationDescription
|
|
1431
|
-
})] }), /* @__PURE__ */
|
|
1433
|
+
})] }), /* @__PURE__ */ X(O, { children: [/* @__PURE__ */ Y(k, {
|
|
1432
1434
|
isDisabled: !n,
|
|
1433
1435
|
size: "sm",
|
|
1434
1436
|
variant: "danger-soft",
|
|
1435
1437
|
onPress: () => i(!0),
|
|
1436
1438
|
children: t.leaveOrganization
|
|
1437
|
-
}), n && /* @__PURE__ */
|
|
1439
|
+
}), n && /* @__PURE__ */ Y(on, {
|
|
1438
1440
|
isOpen: r,
|
|
1439
1441
|
onOpenChange: i,
|
|
1440
1442
|
organization: n
|
|
@@ -1443,80 +1445,80 @@ function ln() {
|
|
|
1443
1445
|
}
|
|
1444
1446
|
//#endregion
|
|
1445
1447
|
//#region src/components/auth/organization/organization-invitation-row-skeleton.tsx
|
|
1446
|
-
function
|
|
1447
|
-
return /* @__PURE__ */
|
|
1448
|
-
/* @__PURE__ */
|
|
1449
|
-
/* @__PURE__ */
|
|
1450
|
-
/* @__PURE__ */
|
|
1451
|
-
/* @__PURE__ */
|
|
1452
|
-
/* @__PURE__ */
|
|
1448
|
+
function cn() {
|
|
1449
|
+
return /* @__PURE__ */ X(H.Row, { children: [
|
|
1450
|
+
/* @__PURE__ */ Y(H.Cell, { children: /* @__PURE__ */ Y(B, { className: "h-4 w-48 rounded-lg" }) }),
|
|
1451
|
+
/* @__PURE__ */ Y(H.Cell, { children: /* @__PURE__ */ Y(B, { className: "h-4 w-36 rounded-lg" }) }),
|
|
1452
|
+
/* @__PURE__ */ Y(H.Cell, { children: /* @__PURE__ */ Y(B, { className: "h-4 w-16 rounded-lg" }) }),
|
|
1453
|
+
/* @__PURE__ */ Y(H.Cell, { children: /* @__PURE__ */ Y(B, { className: "h-4 w-14 rounded-full" }) }),
|
|
1454
|
+
/* @__PURE__ */ Y(H.Cell, {})
|
|
1453
1455
|
] });
|
|
1454
1456
|
}
|
|
1455
1457
|
//#endregion
|
|
1456
1458
|
//#region src/components/auth/organization/organization-invitation-row.tsx
|
|
1457
|
-
function
|
|
1458
|
-
let { authClient: t } = p(), { localization: n, roles: r } = m(
|
|
1459
|
-
return a ? /* @__PURE__ */
|
|
1460
|
-
/* @__PURE__ */
|
|
1459
|
+
function ln({ invitation: e }) {
|
|
1460
|
+
let { authClient: t } = p(), { localization: n, roles: r } = m($), { data: i, isPending: a } = T(t, { permissions: { invitation: ["cancel"] } }), { mutate: o, isPending: s } = g(t), c = r?.[e.role] ?? e.role, l = n[e.status] ?? e.status, u = e.status === "pending" ? "warning" : e.status === "accepted" ? "success" : e.status === "rejected" ? "danger" : "default";
|
|
1461
|
+
return a ? /* @__PURE__ */ Y(cn, {}) : /* @__PURE__ */ X(H.Row, { children: [
|
|
1462
|
+
/* @__PURE__ */ Y(H.Cell, {
|
|
1461
1463
|
className: "font-medium text-sm",
|
|
1462
1464
|
children: e.email
|
|
1463
1465
|
}),
|
|
1464
|
-
/* @__PURE__ */
|
|
1466
|
+
/* @__PURE__ */ Y(H.Cell, {
|
|
1465
1467
|
className: "text-muted text-xs tabular-nums whitespace-nowrap",
|
|
1466
1468
|
children: new Date(e.createdAt).toLocaleString(void 0, {
|
|
1467
1469
|
dateStyle: "short",
|
|
1468
1470
|
timeStyle: "short"
|
|
1469
1471
|
})
|
|
1470
1472
|
}),
|
|
1471
|
-
/* @__PURE__ */
|
|
1473
|
+
/* @__PURE__ */ Y(H.Cell, {
|
|
1472
1474
|
className: "text-sm",
|
|
1473
1475
|
children: c
|
|
1474
1476
|
}),
|
|
1475
|
-
/* @__PURE__ */
|
|
1477
|
+
/* @__PURE__ */ Y(H.Cell, {
|
|
1476
1478
|
className: "text-sm",
|
|
1477
|
-
children: /* @__PURE__ */
|
|
1479
|
+
children: /* @__PURE__ */ Y(j, {
|
|
1478
1480
|
color: u,
|
|
1479
1481
|
size: "sm",
|
|
1480
1482
|
variant: "soft",
|
|
1481
1483
|
children: l
|
|
1482
1484
|
})
|
|
1483
1485
|
}),
|
|
1484
|
-
/* @__PURE__ */
|
|
1486
|
+
/* @__PURE__ */ Y(H.Cell, {
|
|
1485
1487
|
className: "text-end",
|
|
1486
|
-
children: i?.success && e.status === "pending" && /* @__PURE__ */
|
|
1488
|
+
children: i?.success && e.status === "pending" && /* @__PURE__ */ Y(k, {
|
|
1487
1489
|
isIconOnly: !0,
|
|
1488
1490
|
size: "sm",
|
|
1489
1491
|
variant: "danger-soft",
|
|
1490
1492
|
isPending: s,
|
|
1491
1493
|
onPress: () => o({ invitationId: e.id }),
|
|
1492
1494
|
"aria-label": n.cancelInvitation,
|
|
1493
|
-
children: s ? /* @__PURE__ */
|
|
1495
|
+
children: s ? /* @__PURE__ */ Y(V, {
|
|
1494
1496
|
color: "current",
|
|
1495
1497
|
size: "sm"
|
|
1496
|
-
}) : /* @__PURE__ */
|
|
1498
|
+
}) : /* @__PURE__ */ Y(D, {})
|
|
1497
1499
|
})
|
|
1498
1500
|
})
|
|
1499
1501
|
] });
|
|
1500
1502
|
}
|
|
1501
1503
|
//#endregion
|
|
1502
1504
|
//#region src/components/auth/organization/organization-invitations-empty.tsx
|
|
1503
|
-
function
|
|
1504
|
-
let { localization: t } = m(
|
|
1505
|
-
return /* @__PURE__ */
|
|
1505
|
+
function un({ onInvitePress: e }) {
|
|
1506
|
+
let { localization: t } = m($);
|
|
1507
|
+
return /* @__PURE__ */ X($e, {
|
|
1506
1508
|
className: "flex flex-col items-center gap-4 text-center p-4",
|
|
1507
1509
|
children: [
|
|
1508
|
-
/* @__PURE__ */
|
|
1509
|
-
/* @__PURE__ */
|
|
1510
|
+
/* @__PURE__ */ Y(Ue, { className: "size-6 text-muted" }),
|
|
1511
|
+
/* @__PURE__ */ X("div", {
|
|
1510
1512
|
className: "flex flex-col gap-2",
|
|
1511
|
-
children: [/* @__PURE__ */
|
|
1513
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
1512
1514
|
className: "text-sm font-semibold text-foreground",
|
|
1513
1515
|
children: t.noInvitations
|
|
1514
|
-
}), /* @__PURE__ */
|
|
1516
|
+
}), /* @__PURE__ */ Y("span", {
|
|
1515
1517
|
className: "text-sm text-muted",
|
|
1516
1518
|
children: t.organizationInvitationsEmptyDescription
|
|
1517
1519
|
})]
|
|
1518
1520
|
}),
|
|
1519
|
-
/* @__PURE__ */
|
|
1521
|
+
/* @__PURE__ */ Y(k, {
|
|
1520
1522
|
size: "sm",
|
|
1521
1523
|
onPress: e,
|
|
1522
1524
|
children: t.inviteMember
|
|
@@ -1526,256 +1528,250 @@ function fn({ onInvitePress: e }) {
|
|
|
1526
1528
|
}
|
|
1527
1529
|
//#endregion
|
|
1528
1530
|
//#region src/components/auth/organization/organization-invitations.tsx
|
|
1529
|
-
function
|
|
1530
|
-
let { authClient: n, localization: r } = p(), { localization: i, roles: a } = m(
|
|
1531
|
+
function dn({ className: e, ...t }) {
|
|
1532
|
+
let { authClient: n, localization: r } = p(), { localization: i, roles: a } = m($), { data: o, isPending: s } = oe(n), { isPending: c } = T(n, { permissions: { invitation: ["cancel"] } }), l = s || c, [u, d] = q(), [f, h] = q("all"), [g, _] = q("all"), [v, y] = q(""), b = ot(() => o?.filter((e) => (f === "all" || e.role === f) && (g === "all" || e.status === g) && e.email.toLowerCase().includes(v.toLowerCase())), [
|
|
1531
1533
|
v,
|
|
1532
1534
|
o,
|
|
1533
1535
|
f,
|
|
1534
1536
|
g
|
|
1535
|
-
]), x =
|
|
1537
|
+
]), x = ot(() => !u || !b ? b : [...b].sort((e, t) => {
|
|
1536
1538
|
let n = u.column, r = 0;
|
|
1537
1539
|
return r = n === "createdAt" ? new Date(e.createdAt).getTime() - new Date(t.createdAt).getTime() : String(e[n]).localeCompare(String(t[n])), u.direction === "descending" && (r *= -1), r;
|
|
1538
|
-
}), [u, b]), [S, C] =
|
|
1539
|
-
return /* @__PURE__ */
|
|
1540
|
-
className:
|
|
1540
|
+
}), [u, b]), [S, C] = q(!1);
|
|
1541
|
+
return /* @__PURE__ */ X("div", {
|
|
1542
|
+
className: G("flex flex-col gap-3", e),
|
|
1541
1543
|
...t,
|
|
1542
1544
|
children: [
|
|
1543
|
-
/* @__PURE__ */
|
|
1545
|
+
/* @__PURE__ */ Y("h3", {
|
|
1544
1546
|
className: "truncate text-sm font-semibold",
|
|
1545
1547
|
children: i.invitations
|
|
1546
1548
|
}),
|
|
1547
|
-
/* @__PURE__ */
|
|
1549
|
+
/* @__PURE__ */ X("div", {
|
|
1548
1550
|
className: "flex flex-col gap-4",
|
|
1549
1551
|
children: [
|
|
1550
|
-
/* @__PURE__ */
|
|
1552
|
+
/* @__PURE__ */ X("div", {
|
|
1551
1553
|
className: "flex items-center gap-3",
|
|
1552
1554
|
children: [
|
|
1553
|
-
/* @__PURE__ */
|
|
1555
|
+
/* @__PURE__ */ Y(z, {
|
|
1554
1556
|
className: "min-w-0",
|
|
1555
1557
|
"aria-label": i.search,
|
|
1556
1558
|
value: v,
|
|
1557
1559
|
onChange: y,
|
|
1558
1560
|
isDisabled: l,
|
|
1559
|
-
children: /* @__PURE__ */
|
|
1560
|
-
/* @__PURE__ */
|
|
1561
|
-
/* @__PURE__ */
|
|
1561
|
+
children: /* @__PURE__ */ X(z.Group, { children: [
|
|
1562
|
+
/* @__PURE__ */ Y(z.SearchIcon, {}),
|
|
1563
|
+
/* @__PURE__ */ Y(z.Input, {
|
|
1562
1564
|
placeholder: i.search,
|
|
1563
1565
|
className: "sm:w-[200px]"
|
|
1564
1566
|
}),
|
|
1565
|
-
/* @__PURE__ */
|
|
1567
|
+
/* @__PURE__ */ Y(z.ClearButton, {})
|
|
1566
1568
|
] })
|
|
1567
1569
|
}),
|
|
1568
|
-
/* @__PURE__ */
|
|
1570
|
+
/* @__PURE__ */ X(M, { children: [/* @__PURE__ */ X(k, {
|
|
1569
1571
|
size: "sm",
|
|
1570
1572
|
variant: "secondary",
|
|
1571
1573
|
isDisabled: l,
|
|
1572
|
-
children: [/* @__PURE__ */
|
|
1573
|
-
}), /* @__PURE__ */
|
|
1574
|
+
children: [/* @__PURE__ */ Y(Le, {}), i.role]
|
|
1575
|
+
}), /* @__PURE__ */ Y(M.Popover, { children: /* @__PURE__ */ X(M.Menu, {
|
|
1574
1576
|
selectionMode: "single",
|
|
1575
1577
|
selectedKeys: new Set([f]),
|
|
1576
1578
|
onSelectionChange: (e) => {
|
|
1577
1579
|
let t = [...e][0];
|
|
1578
1580
|
h(t ?? "all");
|
|
1579
1581
|
},
|
|
1580
|
-
children: [/* @__PURE__ */
|
|
1582
|
+
children: [/* @__PURE__ */ X(M.Item, {
|
|
1581
1583
|
id: "all",
|
|
1582
1584
|
textValue: i.all,
|
|
1583
|
-
children: [/* @__PURE__ */
|
|
1584
|
-
}), Object.entries(a).map(([e, t]) => /* @__PURE__ */
|
|
1585
|
+
children: [/* @__PURE__ */ Y(L, { children: i.all }), /* @__PURE__ */ Y(M.ItemIndicator, {})]
|
|
1586
|
+
}), Object.entries(a).map(([e, t]) => /* @__PURE__ */ X(M.Item, {
|
|
1585
1587
|
id: e,
|
|
1586
1588
|
textValue: t,
|
|
1587
|
-
children: [/* @__PURE__ */
|
|
1589
|
+
children: [/* @__PURE__ */ Y(L, { children: t }), /* @__PURE__ */ Y(M.ItemIndicator, {})]
|
|
1588
1590
|
}, e))]
|
|
1589
1591
|
}) })] }),
|
|
1590
|
-
/* @__PURE__ */
|
|
1592
|
+
/* @__PURE__ */ X(M, { children: [/* @__PURE__ */ X(k, {
|
|
1591
1593
|
size: "sm",
|
|
1592
1594
|
variant: "secondary",
|
|
1593
1595
|
isDisabled: l,
|
|
1594
|
-
children: [/* @__PURE__ */
|
|
1595
|
-
}), /* @__PURE__ */
|
|
1596
|
+
children: [/* @__PURE__ */ Y(Le, {}), i.status]
|
|
1597
|
+
}), /* @__PURE__ */ Y(M.Popover, { children: /* @__PURE__ */ X(M.Menu, {
|
|
1596
1598
|
selectionMode: "single",
|
|
1597
1599
|
selectedKeys: new Set([g]),
|
|
1598
1600
|
onSelectionChange: (e) => {
|
|
1599
1601
|
let t = [...e][0];
|
|
1600
1602
|
_(t ?? "all");
|
|
1601
1603
|
},
|
|
1602
|
-
children: [/* @__PURE__ */
|
|
1604
|
+
children: [/* @__PURE__ */ X(M.Item, {
|
|
1603
1605
|
id: "all",
|
|
1604
1606
|
textValue: i.all,
|
|
1605
|
-
children: [/* @__PURE__ */
|
|
1607
|
+
children: [/* @__PURE__ */ Y(L, { children: i.all }), /* @__PURE__ */ Y(M.ItemIndicator, {})]
|
|
1606
1608
|
}), [
|
|
1607
1609
|
"pending",
|
|
1608
1610
|
"accepted",
|
|
1609
1611
|
"rejected",
|
|
1610
1612
|
"canceled"
|
|
1611
|
-
].map((e) => /* @__PURE__ */
|
|
1613
|
+
].map((e) => /* @__PURE__ */ X(M.Item, {
|
|
1612
1614
|
id: e,
|
|
1613
1615
|
textValue: i[e] ?? e,
|
|
1614
|
-
children: [/* @__PURE__ */
|
|
1616
|
+
children: [/* @__PURE__ */ Y(L, { children: i[e] ?? e }), /* @__PURE__ */ Y(M.ItemIndicator, {})]
|
|
1615
1617
|
}, e))]
|
|
1616
1618
|
}) })] })
|
|
1617
1619
|
]
|
|
1618
1620
|
}),
|
|
1619
|
-
(f !== "all" || g !== "all") && /* @__PURE__ */
|
|
1621
|
+
(f !== "all" || g !== "all") && /* @__PURE__ */ X("div", {
|
|
1620
1622
|
className: "flex flex-wrap gap-2",
|
|
1621
|
-
children: [f !== "all" && /* @__PURE__ */
|
|
1623
|
+
children: [f !== "all" && /* @__PURE__ */ X(j, {
|
|
1622
1624
|
size: "sm",
|
|
1623
1625
|
variant: "secondary",
|
|
1624
1626
|
className: "w-fit",
|
|
1625
|
-
children: [/* @__PURE__ */
|
|
1627
|
+
children: [/* @__PURE__ */ X(j.Label, { children: [
|
|
1626
1628
|
i.role,
|
|
1627
1629
|
":",
|
|
1628
1630
|
" ",
|
|
1629
|
-
/* @__PURE__ */
|
|
1631
|
+
/* @__PURE__ */ Y("span", {
|
|
1630
1632
|
className: "capitalize",
|
|
1631
1633
|
children: a?.[f] ?? f
|
|
1632
1634
|
})
|
|
1633
|
-
] }), /* @__PURE__ */
|
|
1635
|
+
] }), /* @__PURE__ */ Y("button", {
|
|
1634
1636
|
type: "button",
|
|
1635
1637
|
"aria-label": i.clear,
|
|
1636
1638
|
className: "text-muted hover:text-foreground inline-flex cursor-pointer items-center",
|
|
1637
1639
|
onClick: () => h("all"),
|
|
1638
|
-
children: /* @__PURE__ */
|
|
1640
|
+
children: /* @__PURE__ */ Y(D, { className: "size-3" })
|
|
1639
1641
|
})]
|
|
1640
|
-
}), g !== "all" && /* @__PURE__ */
|
|
1642
|
+
}), g !== "all" && /* @__PURE__ */ X(j, {
|
|
1641
1643
|
size: "sm",
|
|
1642
1644
|
variant: "secondary",
|
|
1643
1645
|
className: "w-fit",
|
|
1644
|
-
children: [/* @__PURE__ */
|
|
1646
|
+
children: [/* @__PURE__ */ X(j.Label, { children: [
|
|
1645
1647
|
i.status,
|
|
1646
1648
|
":",
|
|
1647
1649
|
" ",
|
|
1648
1650
|
i[g] ?? g
|
|
1649
|
-
] }), /* @__PURE__ */
|
|
1651
|
+
] }), /* @__PURE__ */ Y("button", {
|
|
1650
1652
|
type: "button",
|
|
1651
1653
|
"aria-label": i.clear,
|
|
1652
1654
|
className: "text-muted hover:text-foreground inline-flex cursor-pointer items-center",
|
|
1653
1655
|
onClick: () => _("all"),
|
|
1654
|
-
children: /* @__PURE__ */
|
|
1656
|
+
children: /* @__PURE__ */ Y(D, { className: "size-3" })
|
|
1655
1657
|
})]
|
|
1656
1658
|
})]
|
|
1657
1659
|
}),
|
|
1658
|
-
/* @__PURE__ */
|
|
1660
|
+
/* @__PURE__ */ Y(H, { children: /* @__PURE__ */ Y(H.ScrollContainer, { children: /* @__PURE__ */ X(H.Content, {
|
|
1659
1661
|
"aria-label": i.invitations,
|
|
1660
1662
|
sortDescriptor: u,
|
|
1661
1663
|
onSortChange: (e) => {
|
|
1662
1664
|
d(u?.column === e.column && e.direction === "ascending" ? void 0 : e);
|
|
1663
1665
|
},
|
|
1664
|
-
children: [/* @__PURE__ */
|
|
1665
|
-
/* @__PURE__ */
|
|
1666
|
+
children: [/* @__PURE__ */ X(H.Header, { children: [
|
|
1667
|
+
/* @__PURE__ */ Y(H.Column, {
|
|
1666
1668
|
allowsSorting: !0,
|
|
1667
1669
|
isRowHeader: !0,
|
|
1668
1670
|
id: "email",
|
|
1669
|
-
children: ({ sortDirection: e }) => /* @__PURE__ */
|
|
1671
|
+
children: ({ sortDirection: e }) => /* @__PURE__ */ Y(H.SortableColumnHeader, {
|
|
1670
1672
|
sortDirection: e,
|
|
1671
1673
|
children: r.auth.email
|
|
1672
1674
|
})
|
|
1673
1675
|
}),
|
|
1674
|
-
/* @__PURE__ */
|
|
1676
|
+
/* @__PURE__ */ Y(H.Column, {
|
|
1675
1677
|
allowsSorting: !0,
|
|
1676
1678
|
id: "createdAt",
|
|
1677
|
-
children: ({ sortDirection: e }) => /* @__PURE__ */
|
|
1679
|
+
children: ({ sortDirection: e }) => /* @__PURE__ */ Y(H.SortableColumnHeader, {
|
|
1678
1680
|
sortDirection: e,
|
|
1679
1681
|
children: i.invitedAt
|
|
1680
1682
|
})
|
|
1681
1683
|
}),
|
|
1682
|
-
/* @__PURE__ */
|
|
1684
|
+
/* @__PURE__ */ Y(H.Column, {
|
|
1683
1685
|
allowsSorting: !0,
|
|
1684
1686
|
id: "role",
|
|
1685
|
-
children: ({ sortDirection: e }) => /* @__PURE__ */
|
|
1687
|
+
children: ({ sortDirection: e }) => /* @__PURE__ */ Y(H.SortableColumnHeader, {
|
|
1686
1688
|
sortDirection: e,
|
|
1687
1689
|
children: i.role
|
|
1688
1690
|
})
|
|
1689
1691
|
}),
|
|
1690
|
-
/* @__PURE__ */
|
|
1692
|
+
/* @__PURE__ */ Y(H.Column, {
|
|
1691
1693
|
allowsSorting: !0,
|
|
1692
1694
|
id: "status",
|
|
1693
|
-
children: ({ sortDirection: e }) => /* @__PURE__ */
|
|
1695
|
+
children: ({ sortDirection: e }) => /* @__PURE__ */ Y(H.SortableColumnHeader, {
|
|
1694
1696
|
sortDirection: e,
|
|
1695
1697
|
children: i.status
|
|
1696
1698
|
})
|
|
1697
1699
|
}),
|
|
1698
|
-
/* @__PURE__ */
|
|
1700
|
+
/* @__PURE__ */ Y(H.Column, {
|
|
1699
1701
|
className: "text-end",
|
|
1700
1702
|
children: i.actions
|
|
1701
1703
|
})
|
|
1702
|
-
] }), /* @__PURE__ */
|
|
1703
|
-
renderEmptyState: () => /* @__PURE__ */
|
|
1704
|
-
children: l ? /* @__PURE__ */
|
|
1704
|
+
] }), /* @__PURE__ */ Y(H.Body, {
|
|
1705
|
+
renderEmptyState: () => /* @__PURE__ */ Y(un, { onInvitePress: () => C(!0) }),
|
|
1706
|
+
children: l ? /* @__PURE__ */ Y(cn, {}) : x?.map((e) => /* @__PURE__ */ Y(ln, { invitation: e }, e.id))
|
|
1705
1707
|
})]
|
|
1706
1708
|
}) }) })
|
|
1707
1709
|
]
|
|
1708
1710
|
}),
|
|
1709
|
-
/* @__PURE__ */
|
|
1711
|
+
/* @__PURE__ */ Y(an, {
|
|
1710
1712
|
isOpen: S,
|
|
1711
1713
|
onOpenChange: C
|
|
1712
1714
|
})
|
|
1713
1715
|
]
|
|
1714
1716
|
});
|
|
1715
1717
|
}
|
|
1716
|
-
function mn({ children: e, sortDirection: t }) {
|
|
1717
|
-
return /* @__PURE__ */ Y("span", {
|
|
1718
|
-
className: "flex items-center justify-between",
|
|
1719
|
-
children: [e, !!t && /* @__PURE__ */ J(ke, { className: W("size-3 transform transition-transform duration-100 ease-out", t === "descending" ? "rotate-180" : "") })]
|
|
1720
|
-
});
|
|
1721
|
-
}
|
|
1722
1718
|
//#endregion
|
|
1723
1719
|
//#region src/components/auth/organization/organization-member-row-skeleton.tsx
|
|
1724
|
-
function
|
|
1725
|
-
return /* @__PURE__ */
|
|
1726
|
-
/* @__PURE__ */
|
|
1727
|
-
/* @__PURE__ */
|
|
1728
|
-
/* @__PURE__ */
|
|
1720
|
+
function fn() {
|
|
1721
|
+
return /* @__PURE__ */ X(H.Row, { children: [
|
|
1722
|
+
/* @__PURE__ */ Y(H.Cell, { children: /* @__PURE__ */ Y(n, { isPending: !0 }) }),
|
|
1723
|
+
/* @__PURE__ */ Y(H.Cell, { children: /* @__PURE__ */ Y(B, { className: "h-4 w-18 rounded-lg" }) }),
|
|
1724
|
+
/* @__PURE__ */ Y(H.Cell, {
|
|
1729
1725
|
className: "flex justify-end",
|
|
1730
|
-
children: /* @__PURE__ */
|
|
1726
|
+
children: /* @__PURE__ */ Y(B, { className: "size-8 rounded-full" })
|
|
1731
1727
|
})
|
|
1732
1728
|
] });
|
|
1733
1729
|
}
|
|
1734
1730
|
//#endregion
|
|
1735
1731
|
//#region src/components/auth/organization/remove-member-dialog.tsx
|
|
1736
|
-
function
|
|
1737
|
-
let { authClient: i, localization: a } = p(), { localization: o, roles: s } = m(
|
|
1738
|
-
t(!1),
|
|
1732
|
+
function pn({ isOpen: e, onOpenChange: t, member: r }) {
|
|
1733
|
+
let { authClient: i, localization: a } = p(), { localization: o, roles: s } = m($), { mutate: c, isPending: l } = fe(i, { onSuccess: () => {
|
|
1734
|
+
t(!1), K.success(o.memberRemoved);
|
|
1739
1735
|
} });
|
|
1740
|
-
return /* @__PURE__ */
|
|
1736
|
+
return /* @__PURE__ */ Y(O.Backdrop, {
|
|
1741
1737
|
isOpen: e,
|
|
1742
1738
|
onOpenChange: t,
|
|
1743
|
-
children: /* @__PURE__ */
|
|
1744
|
-
/* @__PURE__ */
|
|
1745
|
-
/* @__PURE__ */
|
|
1739
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ X(O.Dialog, { children: [
|
|
1740
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
1741
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
1746
1742
|
status: "danger",
|
|
1747
|
-
children: /* @__PURE__ */
|
|
1748
|
-
}), /* @__PURE__ */
|
|
1749
|
-
/* @__PURE__ */
|
|
1743
|
+
children: /* @__PURE__ */ Y(Je, {})
|
|
1744
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: o.removeMember })] }),
|
|
1745
|
+
/* @__PURE__ */ X(O.Body, {
|
|
1750
1746
|
className: "flex flex-col gap-4 overflow-visible",
|
|
1751
|
-
children: [/* @__PURE__ */
|
|
1747
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
1752
1748
|
className: "text-muted text-sm",
|
|
1753
1749
|
children: o.removeMemberWarning
|
|
1754
|
-
}), /* @__PURE__ */
|
|
1750
|
+
}), /* @__PURE__ */ Y(A, {
|
|
1755
1751
|
variant: "secondary",
|
|
1756
|
-
children: /* @__PURE__ */
|
|
1752
|
+
children: /* @__PURE__ */ X(A.Content, {
|
|
1757
1753
|
className: "justify-between flex-row items-center gap-2",
|
|
1758
|
-
children: [/* @__PURE__ */
|
|
1754
|
+
children: [/* @__PURE__ */ Y(n, { user: r.user }), /* @__PURE__ */ Y(j, {
|
|
1759
1755
|
size: "sm",
|
|
1760
1756
|
variant: "tertiary",
|
|
1761
|
-
children: /* @__PURE__ */
|
|
1757
|
+
children: /* @__PURE__ */ Y(j.Label, { children: s?.[r.role] ?? r.role })
|
|
1762
1758
|
})]
|
|
1763
1759
|
})
|
|
1764
1760
|
})]
|
|
1765
1761
|
}),
|
|
1766
|
-
/* @__PURE__ */
|
|
1762
|
+
/* @__PURE__ */ X(O.Footer, { children: [/* @__PURE__ */ Y(k, {
|
|
1767
1763
|
slot: "close",
|
|
1768
1764
|
variant: "tertiary",
|
|
1769
1765
|
isDisabled: l,
|
|
1770
1766
|
children: a.settings.cancel
|
|
1771
|
-
}), /* @__PURE__ */
|
|
1767
|
+
}), /* @__PURE__ */ X(k, {
|
|
1772
1768
|
variant: "danger",
|
|
1773
1769
|
isPending: l,
|
|
1774
1770
|
onPress: () => c({
|
|
1775
1771
|
memberIdOrEmail: r.id,
|
|
1776
1772
|
organizationId: r.organizationId
|
|
1777
1773
|
}),
|
|
1778
|
-
children: [l && /* @__PURE__ */
|
|
1774
|
+
children: [l && /* @__PURE__ */ Y(V, {
|
|
1779
1775
|
color: "current",
|
|
1780
1776
|
size: "sm"
|
|
1781
1777
|
}), o.removeMember]
|
|
@@ -1785,54 +1781,54 @@ function gn({ isOpen: e, onOpenChange: t, member: r }) {
|
|
|
1785
1781
|
}
|
|
1786
1782
|
//#endregion
|
|
1787
1783
|
//#region src/components/auth/organization/organization-member-row.tsx
|
|
1788
|
-
function
|
|
1789
|
-
let { authClient: i } = p(), { localization: a, roles: o } = m(
|
|
1790
|
-
return f ? /* @__PURE__ */
|
|
1791
|
-
/* @__PURE__ */
|
|
1792
|
-
/* @__PURE__ */
|
|
1793
|
-
/* @__PURE__ */
|
|
1784
|
+
function mn({ member: e, isOwner: t, organization: r }) {
|
|
1785
|
+
let { authClient: i } = p(), { localization: a, roles: o } = m($), { data: s } = E(i), { data: c, isPending: l } = T(i, { permissions: { member: ["update"] } }), { data: u, isPending: d } = T(i, { permissions: { member: ["delete"] } }), f = l || d, { mutate: h, isPending: g } = xe(i, { onSuccess: () => K.success(a.memberRoleUpdated) }), _ = o?.[e.role] ?? e.role, v = Object.entries(o).filter(([e]) => t || e !== "owner"), y = s?.user.id === e.userId, [b, x] = q(!1), [S, C] = q(!1);
|
|
1786
|
+
return f ? /* @__PURE__ */ Y(fn, {}) : /* @__PURE__ */ X(H.Row, { children: [
|
|
1787
|
+
/* @__PURE__ */ Y(H.Cell, { children: /* @__PURE__ */ Y(n, { user: e.user }) }),
|
|
1788
|
+
/* @__PURE__ */ Y(H.Cell, { children: _ }),
|
|
1789
|
+
/* @__PURE__ */ X(H.Cell, { children: [/* @__PURE__ */ X("div", {
|
|
1794
1790
|
className: "flex items-center justify-end gap-1",
|
|
1795
|
-
children: [c?.success && /* @__PURE__ */
|
|
1791
|
+
children: [c?.success && /* @__PURE__ */ X(M, { children: [/* @__PURE__ */ Y(k, {
|
|
1796
1792
|
isIconOnly: !0,
|
|
1797
1793
|
size: "sm",
|
|
1798
1794
|
variant: "tertiary",
|
|
1799
1795
|
isDisabled: g,
|
|
1800
1796
|
"aria-label": a.changeMemberRole,
|
|
1801
|
-
children: g ? /* @__PURE__ */
|
|
1797
|
+
children: g ? /* @__PURE__ */ Y(V, {
|
|
1802
1798
|
color: "current",
|
|
1803
1799
|
size: "sm"
|
|
1804
|
-
}) : /* @__PURE__ */
|
|
1805
|
-
}), /* @__PURE__ */
|
|
1800
|
+
}) : /* @__PURE__ */ Y(We, {})
|
|
1801
|
+
}), /* @__PURE__ */ Y(M.Popover, {
|
|
1806
1802
|
className: "min-w-fit",
|
|
1807
|
-
children: /* @__PURE__ */
|
|
1803
|
+
children: /* @__PURE__ */ Y(M.Menu, { children: v.map(([t, n]) => /* @__PURE__ */ Y(M.Item, {
|
|
1808
1804
|
textValue: n,
|
|
1809
1805
|
isDisabled: e.role === t,
|
|
1810
1806
|
onAction: () => h({
|
|
1811
1807
|
memberId: e.id,
|
|
1812
1808
|
role: t
|
|
1813
1809
|
}),
|
|
1814
|
-
children: /* @__PURE__ */
|
|
1810
|
+
children: /* @__PURE__ */ Y(L, { children: n })
|
|
1815
1811
|
}, t)) })
|
|
1816
|
-
})] }), y ? /* @__PURE__ */
|
|
1812
|
+
})] }), y ? /* @__PURE__ */ Y(k, {
|
|
1817
1813
|
isIconOnly: !0,
|
|
1818
1814
|
size: "sm",
|
|
1819
1815
|
variant: "danger-soft",
|
|
1820
1816
|
"aria-label": a.leaveOrganization,
|
|
1821
1817
|
onPress: () => C(!0),
|
|
1822
|
-
children: /* @__PURE__ */
|
|
1823
|
-
}) : u?.success && /* @__PURE__ */
|
|
1818
|
+
children: /* @__PURE__ */ Y(Te, {})
|
|
1819
|
+
}) : u?.success && /* @__PURE__ */ Y(k, {
|
|
1824
1820
|
isIconOnly: !0,
|
|
1825
1821
|
size: "sm",
|
|
1826
1822
|
variant: "danger-soft",
|
|
1827
1823
|
"aria-label": a.removeMember,
|
|
1828
1824
|
onPress: () => x(!0),
|
|
1829
|
-
children: /* @__PURE__ */
|
|
1825
|
+
children: /* @__PURE__ */ Y(Je, {})
|
|
1830
1826
|
})]
|
|
1831
|
-
}), y && r ? /* @__PURE__ */
|
|
1827
|
+
}), y && r ? /* @__PURE__ */ Y(on, {
|
|
1832
1828
|
isOpen: S,
|
|
1833
1829
|
onOpenChange: C,
|
|
1834
1830
|
organization: r
|
|
1835
|
-
}) : u?.success && /* @__PURE__ */
|
|
1831
|
+
}) : u?.success && /* @__PURE__ */ Y(pn, {
|
|
1836
1832
|
isOpen: b,
|
|
1837
1833
|
onOpenChange: x,
|
|
1838
1834
|
member: e
|
|
@@ -1841,179 +1837,173 @@ function _n({ member: e, isOwner: t, organization: r }) {
|
|
|
1841
1837
|
}
|
|
1842
1838
|
//#endregion
|
|
1843
1839
|
//#region src/components/auth/organization/organization-members.tsx
|
|
1844
|
-
function
|
|
1845
|
-
let { authClient: n } = p(), { localization: r, roles: i } = m(
|
|
1840
|
+
function hn({ className: e, ...t }) {
|
|
1841
|
+
let { authClient: n } = p(), { localization: r, roles: i } = m($), { data: a } = E(n), { data: o, isPending: s } = d(n), { data: c, isPending: l } = se(n), { isPending: u } = T(n, { permissions: { member: ["update"] } }), { isPending: f } = T(n, { permissions: { member: ["delete"] } }), h = s || l || u || f, [g, _] = q(), [v, y] = q("all"), [b, x] = q(""), S = ot(() => c?.members.filter((e) => (v === "all" || e.role === v) && (e.user.name.toLowerCase().includes(b.toLowerCase()) || e.user.email.toLowerCase().includes(b.toLowerCase()))), [
|
|
1846
1842
|
b,
|
|
1847
1843
|
c?.members,
|
|
1848
1844
|
v
|
|
1849
|
-
]), C =
|
|
1845
|
+
]), C = ot(() => !g || !S ? S : [...S].sort((e, t) => {
|
|
1850
1846
|
let n = g.column, r = n === "user" ? e.user.name || e.user.email : String(e[n]), i = n === "user" ? t.user.name || t.user.email : String(t[n]), a = r.localeCompare(i);
|
|
1851
1847
|
return g.direction === "descending" && (a *= -1), a;
|
|
1852
|
-
}), [g, S]), [
|
|
1853
|
-
return /* @__PURE__ */
|
|
1854
|
-
className:
|
|
1848
|
+
}), [g, S]), [w, ee] = q(!1), te = c?.members.some((e) => e.role === "owner" && e.userId === a?.user.id);
|
|
1849
|
+
return /* @__PURE__ */ X("div", {
|
|
1850
|
+
className: G("flex flex-col gap-3", e),
|
|
1855
1851
|
...t,
|
|
1856
1852
|
children: [
|
|
1857
|
-
/* @__PURE__ */
|
|
1853
|
+
/* @__PURE__ */ X("div", {
|
|
1858
1854
|
className: "flex items-end justify-between gap-3",
|
|
1859
|
-
children: [/* @__PURE__ */
|
|
1855
|
+
children: [/* @__PURE__ */ Y("h3", {
|
|
1860
1856
|
className: "truncate text-sm font-semibold",
|
|
1861
1857
|
children: r.members
|
|
1862
|
-
}), /* @__PURE__ */
|
|
1858
|
+
}), /* @__PURE__ */ Y(k, {
|
|
1863
1859
|
className: "shrink-0",
|
|
1864
1860
|
size: "sm",
|
|
1865
1861
|
isDisabled: h,
|
|
1866
|
-
onPress: () =>
|
|
1862
|
+
onPress: () => ee(!0),
|
|
1867
1863
|
children: r.inviteMember
|
|
1868
1864
|
})]
|
|
1869
1865
|
}),
|
|
1870
|
-
/* @__PURE__ */
|
|
1866
|
+
/* @__PURE__ */ X("div", {
|
|
1871
1867
|
className: "flex flex-col gap-4",
|
|
1872
1868
|
children: [
|
|
1873
|
-
/* @__PURE__ */
|
|
1869
|
+
/* @__PURE__ */ X("div", {
|
|
1874
1870
|
className: "flex items-center gap-3",
|
|
1875
|
-
children: [/* @__PURE__ */
|
|
1871
|
+
children: [/* @__PURE__ */ Y(z, {
|
|
1876
1872
|
className: "min-w-0",
|
|
1877
1873
|
"aria-label": r.search,
|
|
1878
1874
|
value: b,
|
|
1879
1875
|
onChange: x,
|
|
1880
1876
|
isDisabled: h,
|
|
1881
|
-
children: /* @__PURE__ */
|
|
1882
|
-
/* @__PURE__ */
|
|
1883
|
-
/* @__PURE__ */
|
|
1877
|
+
children: /* @__PURE__ */ X(z.Group, { children: [
|
|
1878
|
+
/* @__PURE__ */ Y(z.SearchIcon, {}),
|
|
1879
|
+
/* @__PURE__ */ Y(z.Input, {
|
|
1884
1880
|
placeholder: r.search,
|
|
1885
1881
|
className: "sm:w-[200px]"
|
|
1886
1882
|
}),
|
|
1887
|
-
/* @__PURE__ */
|
|
1883
|
+
/* @__PURE__ */ Y(z.ClearButton, {})
|
|
1888
1884
|
] })
|
|
1889
|
-
}), /* @__PURE__ */
|
|
1885
|
+
}), /* @__PURE__ */ X(M, { children: [/* @__PURE__ */ X(k, {
|
|
1890
1886
|
size: "sm",
|
|
1891
1887
|
variant: "secondary",
|
|
1892
1888
|
isDisabled: h,
|
|
1893
|
-
children: [/* @__PURE__ */
|
|
1894
|
-
}), /* @__PURE__ */
|
|
1889
|
+
children: [/* @__PURE__ */ Y(Le, {}), r.role]
|
|
1890
|
+
}), /* @__PURE__ */ Y(M.Popover, { children: /* @__PURE__ */ X(M.Menu, {
|
|
1895
1891
|
selectionMode: "single",
|
|
1896
1892
|
selectedKeys: new Set([v]),
|
|
1897
1893
|
onSelectionChange: (e) => {
|
|
1898
1894
|
let t = [...e][0];
|
|
1899
1895
|
y(t ?? "all");
|
|
1900
1896
|
},
|
|
1901
|
-
children: [/* @__PURE__ */
|
|
1897
|
+
children: [/* @__PURE__ */ X(M.Item, {
|
|
1902
1898
|
id: "all",
|
|
1903
1899
|
textValue: r.all,
|
|
1904
|
-
children: [/* @__PURE__ */
|
|
1905
|
-
}), Object.entries(i).map(([e, t]) => /* @__PURE__ */
|
|
1900
|
+
children: [/* @__PURE__ */ Y(L, { children: r.all }), /* @__PURE__ */ Y(M.ItemIndicator, {})]
|
|
1901
|
+
}), Object.entries(i).map(([e, t]) => /* @__PURE__ */ X(M.Item, {
|
|
1906
1902
|
id: e,
|
|
1907
1903
|
textValue: t,
|
|
1908
|
-
children: [/* @__PURE__ */
|
|
1904
|
+
children: [/* @__PURE__ */ Y(L, { children: t }), /* @__PURE__ */ Y(M.ItemIndicator, {})]
|
|
1909
1905
|
}, e))]
|
|
1910
1906
|
}) })] })]
|
|
1911
1907
|
}),
|
|
1912
|
-
v !== "all" && /* @__PURE__ */
|
|
1908
|
+
v !== "all" && /* @__PURE__ */ X(j, {
|
|
1913
1909
|
size: "sm",
|
|
1914
1910
|
variant: "secondary",
|
|
1915
1911
|
className: "w-fit",
|
|
1916
|
-
children: [/* @__PURE__ */
|
|
1912
|
+
children: [/* @__PURE__ */ X(j.Label, { children: [
|
|
1917
1913
|
r.role,
|
|
1918
1914
|
":",
|
|
1919
1915
|
" ",
|
|
1920
|
-
/* @__PURE__ */
|
|
1916
|
+
/* @__PURE__ */ Y("span", {
|
|
1921
1917
|
className: "capitalize",
|
|
1922
1918
|
children: i?.[v] ?? v
|
|
1923
1919
|
})
|
|
1924
|
-
] }), /* @__PURE__ */
|
|
1920
|
+
] }), /* @__PURE__ */ Y("button", {
|
|
1925
1921
|
type: "button",
|
|
1926
1922
|
"aria-label": r.clear,
|
|
1927
1923
|
className: "text-muted hover:text-foreground inline-flex cursor-pointer items-center",
|
|
1928
1924
|
onClick: () => y("all"),
|
|
1929
|
-
children: /* @__PURE__ */
|
|
1925
|
+
children: /* @__PURE__ */ Y(D, { className: "size-3" })
|
|
1930
1926
|
})]
|
|
1931
1927
|
}),
|
|
1932
|
-
/* @__PURE__ */
|
|
1928
|
+
/* @__PURE__ */ Y(H, { children: /* @__PURE__ */ Y(H.ScrollContainer, { children: /* @__PURE__ */ X(H.Content, {
|
|
1933
1929
|
"aria-label": r.members,
|
|
1934
1930
|
sortDescriptor: g,
|
|
1935
1931
|
onSortChange: (e) => {
|
|
1936
1932
|
_(g?.column === e.column && e.direction === "ascending" ? void 0 : e);
|
|
1937
1933
|
},
|
|
1938
|
-
children: [/* @__PURE__ */
|
|
1939
|
-
/* @__PURE__ */
|
|
1934
|
+
children: [/* @__PURE__ */ X(H.Header, { children: [
|
|
1935
|
+
/* @__PURE__ */ Y(H.Column, {
|
|
1940
1936
|
allowsSorting: !0,
|
|
1941
1937
|
isRowHeader: !0,
|
|
1942
1938
|
id: "user",
|
|
1943
|
-
children: ({ sortDirection: e }) => /* @__PURE__ */
|
|
1939
|
+
children: ({ sortDirection: e }) => /* @__PURE__ */ Y(H.SortableColumnHeader, {
|
|
1944
1940
|
sortDirection: e,
|
|
1945
1941
|
children: r.member
|
|
1946
1942
|
})
|
|
1947
1943
|
}),
|
|
1948
|
-
/* @__PURE__ */
|
|
1944
|
+
/* @__PURE__ */ Y(H.Column, {
|
|
1949
1945
|
allowsSorting: !0,
|
|
1950
1946
|
id: "role",
|
|
1951
|
-
children: ({ sortDirection: e }) => /* @__PURE__ */
|
|
1947
|
+
children: ({ sortDirection: e }) => /* @__PURE__ */ Y(H.SortableColumnHeader, {
|
|
1952
1948
|
sortDirection: e,
|
|
1953
1949
|
children: r.role
|
|
1954
1950
|
})
|
|
1955
1951
|
}),
|
|
1956
|
-
/* @__PURE__ */
|
|
1952
|
+
/* @__PURE__ */ Y(H.Column, {
|
|
1957
1953
|
className: "text-end",
|
|
1958
1954
|
children: r.actions
|
|
1959
1955
|
})
|
|
1960
|
-
] }), /* @__PURE__ */
|
|
1956
|
+
] }), /* @__PURE__ */ Y(H.Body, { children: h ? /* @__PURE__ */ Y(fn, {}) : !!o && C?.map((e) => /* @__PURE__ */ Y(mn, {
|
|
1961
1957
|
member: e,
|
|
1962
|
-
isOwner:
|
|
1958
|
+
isOwner: te,
|
|
1963
1959
|
organization: o
|
|
1964
1960
|
}, e.id)) })]
|
|
1965
1961
|
}) }) })
|
|
1966
1962
|
]
|
|
1967
1963
|
}),
|
|
1968
|
-
/* @__PURE__ */
|
|
1969
|
-
isOpen:
|
|
1970
|
-
onOpenChange:
|
|
1964
|
+
/* @__PURE__ */ Y(an, {
|
|
1965
|
+
isOpen: w,
|
|
1966
|
+
onOpenChange: ee
|
|
1971
1967
|
})
|
|
1972
1968
|
]
|
|
1973
1969
|
});
|
|
1974
1970
|
}
|
|
1975
|
-
function yn({ children: e, sortDirection: t }) {
|
|
1976
|
-
return /* @__PURE__ */ Y("span", {
|
|
1977
|
-
className: "flex items-center justify-between",
|
|
1978
|
-
children: [e, !!t && /* @__PURE__ */ J(ke, { className: W("size-3 transform transition-transform duration-100 ease-out", t === "descending" ? "rotate-180" : "") })]
|
|
1979
|
-
});
|
|
1980
|
-
}
|
|
1981
1971
|
//#endregion
|
|
1982
1972
|
//#region src/components/auth/organization/organization-people.tsx
|
|
1983
|
-
function
|
|
1984
|
-
return /* @__PURE__ */
|
|
1985
|
-
className:
|
|
1973
|
+
function gn({ className: e, ...t }) {
|
|
1974
|
+
return /* @__PURE__ */ X("div", {
|
|
1975
|
+
className: G("flex flex-col gap-4 md:gap-6", e),
|
|
1986
1976
|
...t,
|
|
1987
|
-
children: [/* @__PURE__ */
|
|
1977
|
+
children: [/* @__PURE__ */ Y(hn, {}), /* @__PURE__ */ Y(dn, {})]
|
|
1988
1978
|
});
|
|
1989
1979
|
}
|
|
1990
1980
|
//#endregion
|
|
1991
1981
|
//#region src/components/auth/organization/organization-danger-zone.tsx
|
|
1992
|
-
function
|
|
1993
|
-
let { authClient: r, localization: i } = p(), { data: a, isPending: o } =
|
|
1994
|
-
return /* @__PURE__ */
|
|
1995
|
-
className:
|
|
1982
|
+
function _n({ className: e, variant: t, ...n }) {
|
|
1983
|
+
let { authClient: r, localization: i } = p(), { data: a, isPending: o } = T(r, { permissions: { organization: ["delete"] } }), s = !!a?.success;
|
|
1984
|
+
return /* @__PURE__ */ X("div", {
|
|
1985
|
+
className: G("flex w-full flex-col", e),
|
|
1996
1986
|
...n,
|
|
1997
|
-
children: [/* @__PURE__ */
|
|
1998
|
-
className:
|
|
1987
|
+
children: [/* @__PURE__ */ Y("h2", {
|
|
1988
|
+
className: G("mb-3 text-sm font-semibold text-danger"),
|
|
1999
1989
|
children: i.settings.dangerZone
|
|
2000
|
-
}), /* @__PURE__ */
|
|
1990
|
+
}), /* @__PURE__ */ Y(A, {
|
|
2001
1991
|
variant: t,
|
|
2002
|
-
children: /* @__PURE__ */
|
|
1992
|
+
children: /* @__PURE__ */ Y(A.Content, {
|
|
2003
1993
|
className: "gap-0",
|
|
2004
|
-
children: o ? /* @__PURE__ */
|
|
1994
|
+
children: o ? /* @__PURE__ */ Y(tn, {}) : /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(sn, {}), s && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ Y(nn, {})] })] })
|
|
2005
1995
|
})
|
|
2006
1996
|
})]
|
|
2007
1997
|
});
|
|
2008
1998
|
}
|
|
2009
1999
|
//#endregion
|
|
2010
2000
|
//#region src/components/auth/organization/organization-profile.tsx
|
|
2011
|
-
function
|
|
2012
|
-
let { authClient: r, localization: i } = p(), { localization: a } = m(
|
|
2013
|
-
|
|
2001
|
+
function vn({ className: e, variant: t, ...n }) {
|
|
2002
|
+
let { authClient: r, localization: i } = p(), { localization: a } = m($), { data: o } = d(r), [s, c] = q(o?.slug ?? "");
|
|
2003
|
+
at(() => {
|
|
2014
2004
|
c(o?.slug ?? "");
|
|
2015
2005
|
}, [o?.slug]);
|
|
2016
|
-
let { mutate: l, isPending: u } =
|
|
2006
|
+
let { mutate: l, isPending: u } = Se(r, { onSuccess: () => K.success(a.organizationUpdatedSuccess) });
|
|
2017
2007
|
function f(e) {
|
|
2018
2008
|
e.preventDefault(), o && l({ data: {
|
|
2019
2009
|
name: new FormData(e.currentTarget).get("name"),
|
|
@@ -2021,51 +2011,51 @@ function Sn({ className: e, variant: t, ...n }) {
|
|
|
2021
2011
|
} });
|
|
2022
2012
|
}
|
|
2023
2013
|
let h = t === "transparent" ? "primary" : "secondary";
|
|
2024
|
-
return /* @__PURE__ */
|
|
2025
|
-
className:
|
|
2014
|
+
return /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("h2", {
|
|
2015
|
+
className: G("mb-3 text-sm font-semibold"),
|
|
2026
2016
|
children: a.organizationProfile
|
|
2027
|
-
}), /* @__PURE__ */
|
|
2028
|
-
className:
|
|
2017
|
+
}), /* @__PURE__ */ Y(A, {
|
|
2018
|
+
className: G(e),
|
|
2029
2019
|
variant: t,
|
|
2030
2020
|
...n,
|
|
2031
|
-
children: /* @__PURE__ */
|
|
2021
|
+
children: /* @__PURE__ */ Y(A.Content, { children: /* @__PURE__ */ X(P, {
|
|
2032
2022
|
onSubmit: f,
|
|
2033
2023
|
className: "flex flex-col gap-4",
|
|
2034
2024
|
children: [
|
|
2035
|
-
/* @__PURE__ */
|
|
2036
|
-
/* @__PURE__ */
|
|
2025
|
+
/* @__PURE__ */ Y($t, {}),
|
|
2026
|
+
/* @__PURE__ */ X(W, {
|
|
2037
2027
|
name: "name",
|
|
2038
2028
|
defaultValue: o?.name,
|
|
2039
2029
|
isDisabled: u || !o,
|
|
2040
2030
|
children: [
|
|
2041
|
-
/* @__PURE__ */
|
|
2042
|
-
/* @__PURE__ */
|
|
2043
|
-
className:
|
|
2031
|
+
/* @__PURE__ */ Y(L, { children: a.name }),
|
|
2032
|
+
/* @__PURE__ */ Y(F, {
|
|
2033
|
+
className: G(!o && "hidden"),
|
|
2044
2034
|
autoComplete: "organization",
|
|
2045
2035
|
placeholder: a.namePlaceholder,
|
|
2046
2036
|
variant: h
|
|
2047
2037
|
}),
|
|
2048
|
-
!o && /* @__PURE__ */
|
|
2049
|
-
/* @__PURE__ */
|
|
2038
|
+
!o && /* @__PURE__ */ Y(B, { className: "h-10 w-full rounded-xl md:h-9" }),
|
|
2039
|
+
/* @__PURE__ */ Y(N, {})
|
|
2050
2040
|
]
|
|
2051
2041
|
}, `${o?.id}-${o?.name}-name`),
|
|
2052
|
-
o ? /* @__PURE__ */
|
|
2042
|
+
o ? /* @__PURE__ */ Y(Vt, {
|
|
2053
2043
|
value: s,
|
|
2054
2044
|
onChange: c,
|
|
2055
2045
|
currentSlug: o.slug,
|
|
2056
2046
|
isDisabled: u,
|
|
2057
2047
|
variant: h
|
|
2058
|
-
}) : /* @__PURE__ */
|
|
2048
|
+
}) : /* @__PURE__ */ X(W, {
|
|
2059
2049
|
isDisabled: !0,
|
|
2060
|
-
children: [/* @__PURE__ */
|
|
2050
|
+
children: [/* @__PURE__ */ Y(L, { children: a.slug }), /* @__PURE__ */ Y(B, { className: "h-10 w-full rounded-xl md:h-9" })]
|
|
2061
2051
|
}),
|
|
2062
|
-
/* @__PURE__ */
|
|
2052
|
+
/* @__PURE__ */ X(k, {
|
|
2063
2053
|
type: "submit",
|
|
2064
2054
|
isPending: u,
|
|
2065
2055
|
isDisabled: !o,
|
|
2066
2056
|
size: "sm",
|
|
2067
2057
|
className: "mt-1",
|
|
2068
|
-
children: [u && /* @__PURE__ */
|
|
2058
|
+
children: [u && /* @__PURE__ */ Y(V, {
|
|
2069
2059
|
color: "current",
|
|
2070
2060
|
size: "sm"
|
|
2071
2061
|
}), i.settings.saveChanges]
|
|
@@ -2076,26 +2066,26 @@ function Sn({ className: e, variant: t, ...n }) {
|
|
|
2076
2066
|
}
|
|
2077
2067
|
//#endregion
|
|
2078
2068
|
//#region src/components/auth/organization/organization-settings.tsx
|
|
2079
|
-
function
|
|
2069
|
+
function yn({ className: e, variant: t, ...n }) {
|
|
2080
2070
|
let { plugins: r } = p();
|
|
2081
|
-
return /* @__PURE__ */
|
|
2082
|
-
className:
|
|
2071
|
+
return /* @__PURE__ */ X("div", {
|
|
2072
|
+
className: G("flex flex-col gap-4 md:gap-6", e),
|
|
2083
2073
|
...n,
|
|
2084
2074
|
children: [
|
|
2085
|
-
/* @__PURE__ */
|
|
2086
|
-
r.flatMap((e) => e.organizationCards?.map((n, r) => /* @__PURE__ */
|
|
2087
|
-
/* @__PURE__ */
|
|
2075
|
+
/* @__PURE__ */ Y(vn, { variant: t }),
|
|
2076
|
+
r.flatMap((e) => e.organizationCards?.map((n, r) => /* @__PURE__ */ Y(n, { variant: t }, `${e.id}-${r.toString()}`))),
|
|
2077
|
+
/* @__PURE__ */ Y(_n, { variant: t })
|
|
2088
2078
|
]
|
|
2089
2079
|
});
|
|
2090
2080
|
}
|
|
2091
2081
|
//#endregion
|
|
2092
2082
|
//#region src/components/auth/organization/organization.tsx
|
|
2093
|
-
function
|
|
2083
|
+
function bn({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
|
|
2094
2084
|
if (!i && !n) throw Error("[Better Auth UI] Either `view` or `path` must be provided");
|
|
2095
2085
|
let { authClient: o, basePaths: s, localization: c, navigate: l } = p();
|
|
2096
2086
|
h(o);
|
|
2097
|
-
let { localization: u, viewPaths: f, slug: g } = m(
|
|
2098
|
-
|
|
2087
|
+
let { localization: u, viewPaths: f, slug: g } = m($), { data: _, isPending: v } = d(o);
|
|
2088
|
+
at(() => {
|
|
2099
2089
|
!v && !_ && l({
|
|
2100
2090
|
to: `${s.settings}/${f.settings?.organizations}`,
|
|
2101
2091
|
replace: !0
|
|
@@ -2107,7 +2097,7 @@ function wn({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
|
|
|
2107
2097
|
f.settings?.organizations,
|
|
2108
2098
|
_
|
|
2109
2099
|
]);
|
|
2110
|
-
let y =
|
|
2100
|
+
let y = ot(() => i || Object.entries(f.organization).find(([, e]) => e === n)?.[0], [
|
|
2111
2101
|
i,
|
|
2112
2102
|
n,
|
|
2113
2103
|
f.organization
|
|
@@ -2116,16 +2106,16 @@ function wn({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
|
|
|
2116
2106
|
let e = Object.values(f.organization).join(", ");
|
|
2117
2107
|
throw Error(`[Better Auth UI] Unknown organization path "${n}". Valid paths are: ${e}`);
|
|
2118
2108
|
}
|
|
2119
|
-
return !v && !_ ? null : /* @__PURE__ */
|
|
2120
|
-
className:
|
|
2109
|
+
return !v && !_ ? null : /* @__PURE__ */ X(U, {
|
|
2110
|
+
className: G(e),
|
|
2121
2111
|
orientation: "horizontal",
|
|
2122
2112
|
selectedKey: y,
|
|
2123
2113
|
...a,
|
|
2124
2114
|
children: [
|
|
2125
|
-
!t && /* @__PURE__ */
|
|
2115
|
+
!t && /* @__PURE__ */ Y(U.ListContainer, { children: /* @__PURE__ */ X(U.List, {
|
|
2126
2116
|
"aria-label": c.settings.settings,
|
|
2127
2117
|
className: "max-w-fit overflow-x-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
2128
|
-
children: [/* @__PURE__ */
|
|
2118
|
+
children: [/* @__PURE__ */ X(U.Tab, {
|
|
2129
2119
|
id: "settings",
|
|
2130
2120
|
href: g ? `${s.organization}/${g}/${f.organization.settings}` : `${s.organization}/${f.organization.settings}`,
|
|
2131
2121
|
className: "gap-2",
|
|
@@ -2134,11 +2124,11 @@ function wn({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
|
|
|
2134
2124
|
inline: "center"
|
|
2135
2125
|
}),
|
|
2136
2126
|
children: [
|
|
2137
|
-
/* @__PURE__ */
|
|
2127
|
+
/* @__PURE__ */ Y(Re, { className: "text-muted" }),
|
|
2138
2128
|
c.settings.settings,
|
|
2139
|
-
/* @__PURE__ */
|
|
2129
|
+
/* @__PURE__ */ Y(U.Indicator, {})
|
|
2140
2130
|
]
|
|
2141
|
-
}), /* @__PURE__ */
|
|
2131
|
+
}), /* @__PURE__ */ X(U.Tab, {
|
|
2142
2132
|
id: "people",
|
|
2143
2133
|
href: g ? `${s.organization}/${g}/${f.organization.people}` : `${s.organization}/${f.organization.people}`,
|
|
2144
2134
|
className: "gap-2",
|
|
@@ -2147,189 +2137,189 @@ function wn({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
|
|
|
2147
2137
|
inline: "center"
|
|
2148
2138
|
}),
|
|
2149
2139
|
children: [
|
|
2150
|
-
/* @__PURE__ */
|
|
2140
|
+
/* @__PURE__ */ Y(Ge, { className: "text-muted" }),
|
|
2151
2141
|
u.people,
|
|
2152
|
-
/* @__PURE__ */
|
|
2142
|
+
/* @__PURE__ */ Y(U.Indicator, {})
|
|
2153
2143
|
]
|
|
2154
2144
|
})]
|
|
2155
2145
|
}) }),
|
|
2156
|
-
/* @__PURE__ */
|
|
2146
|
+
/* @__PURE__ */ Y(U.Panel, {
|
|
2157
2147
|
id: "settings",
|
|
2158
2148
|
className: "px-0",
|
|
2159
|
-
children: /* @__PURE__ */
|
|
2149
|
+
children: /* @__PURE__ */ Y(yn, { variant: r })
|
|
2160
2150
|
}),
|
|
2161
|
-
/* @__PURE__ */
|
|
2151
|
+
/* @__PURE__ */ Y(U.Panel, {
|
|
2162
2152
|
id: "people",
|
|
2163
2153
|
className: "px-0",
|
|
2164
|
-
children: /* @__PURE__ */
|
|
2154
|
+
children: /* @__PURE__ */ Y(gn, {})
|
|
2165
2155
|
})
|
|
2166
2156
|
]
|
|
2167
2157
|
});
|
|
2168
2158
|
}
|
|
2169
2159
|
//#endregion
|
|
2170
2160
|
//#region src/components/auth/organization/organization-switcher.tsx
|
|
2171
|
-
function
|
|
2172
|
-
let { authClient: h, navigate: g, basePaths: _, localization: v, viewPaths: y } = p(), { data: b, isPending: x } =
|
|
2173
|
-
function
|
|
2174
|
-
o ? o(e) :
|
|
2161
|
+
function xn({ className: e, hideCreate: t, hidePersonal: r, hideSettings: i, hideSlug: a = !0, setActive: o, placement: s, variant: c = "ghost", size: l = "md", trigger: u, ...f }) {
|
|
2162
|
+
let { authClient: h, navigate: g, basePaths: _, localization: v, viewPaths: y } = p(), { data: b, isPending: x } = E(h), { localization: S, viewPaths: C, slug: w } = m($), { data: T, isPending: ee } = d(h), { data: te, isPending: ne } = ce(h), { mutate: re } = he(h), ie = x || !!b && (ne || ee), [ae, oe] = q(!1), [se, le] = q(!1);
|
|
2163
|
+
function ue(e) {
|
|
2164
|
+
o ? o(e) : w === void 0 ? re({ organizationId: e?.id ?? null }) : g({ to: e ? `${_.organization}/${e.slug}/${C.organization.settings}` : `${_.settings}/${y.settings.account}` });
|
|
2175
2165
|
}
|
|
2176
|
-
return /* @__PURE__ */
|
|
2177
|
-
isOpen:
|
|
2178
|
-
onOpenChange:
|
|
2179
|
-
children: [u ? /* @__PURE__ */
|
|
2166
|
+
return /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ X(M, {
|
|
2167
|
+
isOpen: se,
|
|
2168
|
+
onOpenChange: le,
|
|
2169
|
+
children: [u ? /* @__PURE__ */ Y(M.Trigger, { children: u }) : /* @__PURE__ */ X(k, {
|
|
2180
2170
|
variant: c,
|
|
2181
|
-
className:
|
|
2182
|
-
isDisabled: !b ||
|
|
2171
|
+
className: G("h-auto px-2 py-2 text-left", e),
|
|
2172
|
+
isDisabled: !b || ie,
|
|
2183
2173
|
"aria-label": S.organization,
|
|
2184
2174
|
...f,
|
|
2185
|
-
children: [
|
|
2175
|
+
children: [ie ? /* @__PURE__ */ Y(Q, {
|
|
2186
2176
|
size: l,
|
|
2187
2177
|
isPending: !0,
|
|
2188
2178
|
hideRole: !0,
|
|
2189
2179
|
hideSlug: a
|
|
2190
|
-
}) :
|
|
2180
|
+
}) : T ? /* @__PURE__ */ Y(Q, {
|
|
2191
2181
|
size: l,
|
|
2192
2182
|
hideRole: !0,
|
|
2193
2183
|
hideSlug: a
|
|
2194
|
-
}) : b && !r ? /* @__PURE__ */
|
|
2184
|
+
}) : b && !r ? /* @__PURE__ */ Y(n, {
|
|
2195
2185
|
size: l,
|
|
2196
2186
|
hideSubtitle: a
|
|
2197
|
-
}) : /* @__PURE__ */
|
|
2187
|
+
}) : /* @__PURE__ */ Y(Q, {
|
|
2198
2188
|
size: l,
|
|
2199
2189
|
hideRole: !0,
|
|
2200
2190
|
hideSlug: a,
|
|
2201
2191
|
organization: { name: S.organization }
|
|
2202
|
-
}), /* @__PURE__ */
|
|
2203
|
-
}), /* @__PURE__ */
|
|
2192
|
+
}), /* @__PURE__ */ Y(Oe, { className: "size-3 shrink-0 text-muted" })]
|
|
2193
|
+
}), /* @__PURE__ */ X(M.Popover, {
|
|
2204
2194
|
placement: s,
|
|
2205
2195
|
className: "max-w-svw",
|
|
2206
|
-
children: [
|
|
2196
|
+
children: [T ? /* @__PURE__ */ X("div", {
|
|
2207
2197
|
className: "flex items-center justify-between gap-4 px-4 pt-3",
|
|
2208
|
-
children: [/* @__PURE__ */
|
|
2198
|
+
children: [/* @__PURE__ */ Y(Q, {
|
|
2209
2199
|
hideRole: !0,
|
|
2210
2200
|
hideSlug: a,
|
|
2211
|
-
organization:
|
|
2212
|
-
}), !i && /* @__PURE__ */
|
|
2213
|
-
href:
|
|
2214
|
-
className:
|
|
2201
|
+
organization: T
|
|
2202
|
+
}), !i && /* @__PURE__ */ X(et, {
|
|
2203
|
+
href: w ? `${_.organization}/${w}/${C.organization.settings}` : `${_.organization}/${C.organization.settings}`,
|
|
2204
|
+
className: G(_t({
|
|
2215
2205
|
variant: "outline",
|
|
2216
2206
|
size: "sm"
|
|
2217
2207
|
}), "shrink-0 gap-2"),
|
|
2218
|
-
onPress: () =>
|
|
2219
|
-
children: [/* @__PURE__ */
|
|
2208
|
+
onPress: () => le(!1),
|
|
2209
|
+
children: [/* @__PURE__ */ Y(Re, { className: "text-muted" }), S.manage]
|
|
2220
2210
|
})]
|
|
2221
|
-
}) : !
|
|
2211
|
+
}) : !ie && b?.user && !r ? /* @__PURE__ */ X("div", {
|
|
2222
2212
|
className: "flex items-center justify-between gap-4 px-4 pt-3",
|
|
2223
|
-
children: [/* @__PURE__ */
|
|
2213
|
+
children: [/* @__PURE__ */ Y(n, { hideSubtitle: a }), !i && /* @__PURE__ */ X(et, {
|
|
2224
2214
|
href: `${_.settings}/${y.settings.account}`,
|
|
2225
|
-
className:
|
|
2215
|
+
className: G(_t({
|
|
2226
2216
|
variant: "outline",
|
|
2227
2217
|
size: "sm"
|
|
2228
2218
|
}), "shrink-0 gap-2"),
|
|
2229
|
-
onPress: () =>
|
|
2230
|
-
children: [/* @__PURE__ */
|
|
2219
|
+
onPress: () => le(!1),
|
|
2220
|
+
children: [/* @__PURE__ */ Y(Re, { className: "text-muted" }), v.settings.settings]
|
|
2231
2221
|
})]
|
|
2232
|
-
}) : null, /* @__PURE__ */
|
|
2233
|
-
!!
|
|
2222
|
+
}) : null, /* @__PURE__ */ X(M.Menu, { children: [
|
|
2223
|
+
!!T && !r && /* @__PURE__ */ Y(M.Item, {
|
|
2234
2224
|
textValue: S.personalAccount,
|
|
2235
|
-
onPress: () =>
|
|
2236
|
-
children: /* @__PURE__ */
|
|
2225
|
+
onPress: () => ue(null),
|
|
2226
|
+
children: /* @__PURE__ */ Y(n, { hideSubtitle: a })
|
|
2237
2227
|
}),
|
|
2238
|
-
|
|
2228
|
+
te?.filter((e) => e.id !== T?.id)?.map((e) => /* @__PURE__ */ Y(M.Item, {
|
|
2239
2229
|
textValue: e.name,
|
|
2240
|
-
onPress: () =>
|
|
2241
|
-
children: /* @__PURE__ */
|
|
2230
|
+
onPress: () => ue(e),
|
|
2231
|
+
children: /* @__PURE__ */ Y(Q, {
|
|
2242
2232
|
hideRole: !0,
|
|
2243
2233
|
hideSlug: a,
|
|
2244
2234
|
organization: e
|
|
2245
2235
|
})
|
|
2246
2236
|
}, e.id)),
|
|
2247
|
-
!t && /* @__PURE__ */
|
|
2237
|
+
!t && /* @__PURE__ */ X(M.Item, {
|
|
2248
2238
|
textValue: S.createOrganization,
|
|
2249
|
-
onPress: () =>
|
|
2250
|
-
children: [/* @__PURE__ */
|
|
2239
|
+
onPress: () => oe(!0),
|
|
2240
|
+
children: [/* @__PURE__ */ Y(ke, { className: "text-muted" }), /* @__PURE__ */ Y(L, { children: S.createOrganization })]
|
|
2251
2241
|
})
|
|
2252
2242
|
] })]
|
|
2253
2243
|
})]
|
|
2254
|
-
}), /* @__PURE__ */
|
|
2255
|
-
isOpen:
|
|
2256
|
-
onOpenChange:
|
|
2244
|
+
}), /* @__PURE__ */ Y(Ht, {
|
|
2245
|
+
isOpen: ae,
|
|
2246
|
+
onOpenChange: oe
|
|
2257
2247
|
})] });
|
|
2258
2248
|
}
|
|
2259
2249
|
//#endregion
|
|
2260
2250
|
//#region src/components/auth/passkey/passkey-button.tsx
|
|
2261
|
-
function
|
|
2262
|
-
let { authClient: t, localization: n, redirectTo: i, navigate: a } = p(), { localization: o } = m(
|
|
2263
|
-
return e === "signUp" ? null : /* @__PURE__ */
|
|
2251
|
+
function Sn({ view: e }) {
|
|
2252
|
+
let { authClient: t, localization: n, redirectTo: i, navigate: a } = p(), { localization: o } = m(Cn), { mutate: s, isPending: c } = ye(t, { onSuccess: () => a({ to: i }) }), l = Z({ mutationKey: r.signIn.all }) + Z({ mutationKey: r.signUp.all }) > 0;
|
|
2253
|
+
return e === "signUp" ? null : /* @__PURE__ */ X(k, {
|
|
2264
2254
|
className: "w-full",
|
|
2265
2255
|
variant: "tertiary",
|
|
2266
2256
|
isDisabled: l,
|
|
2267
2257
|
isPending: c,
|
|
2268
2258
|
onPress: () => s(),
|
|
2269
|
-
children: [c ? /* @__PURE__ */
|
|
2259
|
+
children: [c ? /* @__PURE__ */ Y(V, {
|
|
2270
2260
|
color: "current",
|
|
2271
2261
|
size: "sm"
|
|
2272
|
-
}) : /* @__PURE__ */
|
|
2262
|
+
}) : /* @__PURE__ */ Y(Ie, {}), n.auth.continueWith.replace("{{provider}}", o.passkey)]
|
|
2273
2263
|
});
|
|
2274
2264
|
}
|
|
2275
2265
|
//#endregion
|
|
2276
2266
|
//#region src/lib/auth/passkey-plugin.ts
|
|
2277
|
-
var
|
|
2278
|
-
...
|
|
2279
|
-
authButtons: [
|
|
2280
|
-
securityCards: [
|
|
2267
|
+
var Cn = a(mt.id, (e = {}) => ({
|
|
2268
|
+
...mt(e),
|
|
2269
|
+
authButtons: [Sn],
|
|
2270
|
+
securityCards: [kn]
|
|
2281
2271
|
}));
|
|
2282
2272
|
//#endregion
|
|
2283
2273
|
//#region src/components/auth/passkey/add-passkey-dialog.tsx
|
|
2284
|
-
function
|
|
2285
|
-
let { authClient: n, localization: r } = p(), { localization: i } = m(
|
|
2274
|
+
function wn({ isOpen: e, onOpenChange: t }) {
|
|
2275
|
+
let { authClient: n, localization: r } = p(), { localization: i } = m(Cn), { mutate: a, isPending: o } = f(n), s = (e) => {
|
|
2286
2276
|
t(e);
|
|
2287
2277
|
};
|
|
2288
|
-
return /* @__PURE__ */
|
|
2278
|
+
return /* @__PURE__ */ Y(O.Backdrop, {
|
|
2289
2279
|
isOpen: e,
|
|
2290
2280
|
onOpenChange: s,
|
|
2291
|
-
children: /* @__PURE__ */
|
|
2281
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ Y(O.Dialog, { children: /* @__PURE__ */ X(P, {
|
|
2292
2282
|
onSubmit: (e) => {
|
|
2293
2283
|
e.preventDefault();
|
|
2294
2284
|
let t = new FormData(e.target).get("name")?.trim();
|
|
2295
2285
|
a(t ? { name: t } : void 0, { onSuccess: () => s(!1) });
|
|
2296
2286
|
},
|
|
2297
2287
|
children: [
|
|
2298
|
-
/* @__PURE__ */
|
|
2299
|
-
/* @__PURE__ */
|
|
2288
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
2289
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
2300
2290
|
status: "default",
|
|
2301
|
-
children: /* @__PURE__ */
|
|
2302
|
-
}), /* @__PURE__ */
|
|
2303
|
-
/* @__PURE__ */
|
|
2291
|
+
children: /* @__PURE__ */ Y(Ie, {})
|
|
2292
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: i.addPasskey })] }),
|
|
2293
|
+
/* @__PURE__ */ X(O.Body, {
|
|
2304
2294
|
className: "overflow-visible",
|
|
2305
|
-
children: [/* @__PURE__ */
|
|
2295
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
2306
2296
|
className: "text-muted text-sm",
|
|
2307
2297
|
children: i.passkeysDescription
|
|
2308
|
-
}), /* @__PURE__ */
|
|
2298
|
+
}), /* @__PURE__ */ X(W, {
|
|
2309
2299
|
className: "mt-4",
|
|
2310
2300
|
id: "name",
|
|
2311
2301
|
name: "name",
|
|
2312
2302
|
isDisabled: o,
|
|
2313
2303
|
children: [
|
|
2314
|
-
/* @__PURE__ */
|
|
2315
|
-
/* @__PURE__ */
|
|
2304
|
+
/* @__PURE__ */ Y(L, { children: i.name }),
|
|
2305
|
+
/* @__PURE__ */ Y(F, {
|
|
2316
2306
|
autoFocus: !0,
|
|
2317
2307
|
placeholder: r.settings.optional,
|
|
2318
2308
|
variant: "secondary"
|
|
2319
2309
|
}),
|
|
2320
|
-
/* @__PURE__ */
|
|
2310
|
+
/* @__PURE__ */ Y(N, {})
|
|
2321
2311
|
]
|
|
2322
2312
|
})]
|
|
2323
2313
|
}),
|
|
2324
|
-
/* @__PURE__ */
|
|
2314
|
+
/* @__PURE__ */ X(O.Footer, { children: [/* @__PURE__ */ Y(k, {
|
|
2325
2315
|
slot: "close",
|
|
2326
2316
|
variant: "tertiary",
|
|
2327
2317
|
isDisabled: o,
|
|
2328
2318
|
children: r.settings.cancel
|
|
2329
|
-
}), /* @__PURE__ */
|
|
2319
|
+
}), /* @__PURE__ */ X(k, {
|
|
2330
2320
|
type: "submit",
|
|
2331
2321
|
isPending: o,
|
|
2332
|
-
children: [o && /* @__PURE__ */
|
|
2322
|
+
children: [o && /* @__PURE__ */ Y(V, {
|
|
2333
2323
|
color: "current",
|
|
2334
2324
|
size: "sm"
|
|
2335
2325
|
}), i.addPasskey]
|
|
@@ -2340,38 +2330,38 @@ function Dn({ isOpen: e, onOpenChange: t }) {
|
|
|
2340
2330
|
}
|
|
2341
2331
|
//#endregion
|
|
2342
2332
|
//#region src/components/auth/passkey/delete-passkey-dialog.tsx
|
|
2343
|
-
function
|
|
2344
|
-
let { authClient: r, localization: i } = p(), { localization: a } = m(
|
|
2345
|
-
return /* @__PURE__ */
|
|
2333
|
+
function Tn({ isOpen: e, onOpenChange: t, passkey: n }) {
|
|
2334
|
+
let { authClient: r, localization: i } = p(), { localization: a } = m(Cn), o = n.name || a.passkey, { mutate: s, isPending: c } = S(r, { onSuccess: () => t(!1) });
|
|
2335
|
+
return /* @__PURE__ */ Y(O.Backdrop, {
|
|
2346
2336
|
isOpen: e,
|
|
2347
2337
|
onOpenChange: t,
|
|
2348
|
-
children: /* @__PURE__ */
|
|
2349
|
-
/* @__PURE__ */
|
|
2350
|
-
/* @__PURE__ */
|
|
2338
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ X(O.Dialog, { children: [
|
|
2339
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
2340
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
2351
2341
|
status: "danger",
|
|
2352
|
-
children: /* @__PURE__ */
|
|
2353
|
-
}), /* @__PURE__ */
|
|
2354
|
-
/* @__PURE__ */
|
|
2342
|
+
children: /* @__PURE__ */ Y(Ie, {})
|
|
2343
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: a.deletePasskeyTitle })] }),
|
|
2344
|
+
/* @__PURE__ */ X(O.Body, {
|
|
2355
2345
|
className: "flex flex-col gap-4 overflow-visible",
|
|
2356
|
-
children: [/* @__PURE__ */
|
|
2346
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
2357
2347
|
className: "text-muted text-sm",
|
|
2358
2348
|
children: a.deletePasskeyWarning
|
|
2359
|
-
}), /* @__PURE__ */
|
|
2349
|
+
}), /* @__PURE__ */ X(W, {
|
|
2360
2350
|
value: o,
|
|
2361
2351
|
variant: "secondary",
|
|
2362
|
-
children: [/* @__PURE__ */
|
|
2352
|
+
children: [/* @__PURE__ */ Y(L, { children: n.name || a.passkey }), /* @__PURE__ */ Y(F, { readOnly: !0 })]
|
|
2363
2353
|
})]
|
|
2364
2354
|
}),
|
|
2365
|
-
/* @__PURE__ */
|
|
2355
|
+
/* @__PURE__ */ X(O.Footer, { children: [/* @__PURE__ */ Y(k, {
|
|
2366
2356
|
slot: "close",
|
|
2367
2357
|
variant: "tertiary",
|
|
2368
2358
|
isDisabled: c,
|
|
2369
2359
|
children: i.settings.cancel
|
|
2370
|
-
}), /* @__PURE__ */
|
|
2360
|
+
}), /* @__PURE__ */ X(k, {
|
|
2371
2361
|
variant: "danger",
|
|
2372
2362
|
onPress: () => s({ id: n.id }),
|
|
2373
2363
|
isPending: c,
|
|
2374
|
-
children: [c && /* @__PURE__ */
|
|
2364
|
+
children: [c && /* @__PURE__ */ Y(V, {
|
|
2375
2365
|
color: "current",
|
|
2376
2366
|
size: "sm"
|
|
2377
2367
|
}), a.deletePasskeyTitle]
|
|
@@ -2381,21 +2371,21 @@ function On({ isOpen: e, onOpenChange: t, passkey: n }) {
|
|
|
2381
2371
|
}
|
|
2382
2372
|
//#endregion
|
|
2383
2373
|
//#region src/components/auth/passkey/passkey.tsx
|
|
2384
|
-
function
|
|
2385
|
-
let { localization: t } = p(), { localization: n } = m(
|
|
2386
|
-
return /* @__PURE__ */
|
|
2374
|
+
function En({ passkey: e }) {
|
|
2375
|
+
let { localization: t } = p(), { localization: n } = m(Cn), [r, i] = q(!1), a = e.name || n.passkey;
|
|
2376
|
+
return /* @__PURE__ */ X("div", {
|
|
2387
2377
|
className: "flex items-center gap-3",
|
|
2388
2378
|
children: [
|
|
2389
|
-
/* @__PURE__ */
|
|
2379
|
+
/* @__PURE__ */ Y("div", {
|
|
2390
2380
|
className: "flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-secondary",
|
|
2391
|
-
children: /* @__PURE__ */
|
|
2381
|
+
children: /* @__PURE__ */ Y(Ie, { className: "size-4.5" })
|
|
2392
2382
|
}),
|
|
2393
|
-
/* @__PURE__ */
|
|
2383
|
+
/* @__PURE__ */ X("div", {
|
|
2394
2384
|
className: "flex min-w-0 flex-col",
|
|
2395
|
-
children: [/* @__PURE__ */
|
|
2385
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
2396
2386
|
className: "truncate text-sm font-medium leading-tight",
|
|
2397
2387
|
children: a
|
|
2398
|
-
}), /* @__PURE__ */
|
|
2388
|
+
}), /* @__PURE__ */ Y("span", {
|
|
2399
2389
|
className: "text-xs text-muted",
|
|
2400
2390
|
children: new Date(e.createdAt).toLocaleString(void 0, {
|
|
2401
2391
|
dateStyle: "medium",
|
|
@@ -2403,15 +2393,15 @@ function kn({ passkey: e }) {
|
|
|
2403
2393
|
})
|
|
2404
2394
|
})]
|
|
2405
2395
|
}),
|
|
2406
|
-
/* @__PURE__ */
|
|
2396
|
+
/* @__PURE__ */ X(k, {
|
|
2407
2397
|
className: "ml-auto shrink-0",
|
|
2408
2398
|
variant: "outline",
|
|
2409
2399
|
size: "sm",
|
|
2410
2400
|
onPress: () => i(!0),
|
|
2411
2401
|
"aria-label": n.deletePasskey.replace("{{name}}", a),
|
|
2412
|
-
children: [/* @__PURE__ */
|
|
2402
|
+
children: [/* @__PURE__ */ Y(D, {}), t.settings.delete]
|
|
2413
2403
|
}),
|
|
2414
|
-
/* @__PURE__ */
|
|
2404
|
+
/* @__PURE__ */ Y(Tn, {
|
|
2415
2405
|
isOpen: r,
|
|
2416
2406
|
onOpenChange: i,
|
|
2417
2407
|
passkey: e
|
|
@@ -2421,40 +2411,40 @@ function kn({ passkey: e }) {
|
|
|
2421
2411
|
}
|
|
2422
2412
|
//#endregion
|
|
2423
2413
|
//#region src/components/auth/passkey/passkey-skeleton.tsx
|
|
2424
|
-
function
|
|
2425
|
-
return /* @__PURE__ */
|
|
2414
|
+
function Dn() {
|
|
2415
|
+
return /* @__PURE__ */ Y("div", {
|
|
2426
2416
|
className: "flex items-center justify-between",
|
|
2427
|
-
children: /* @__PURE__ */
|
|
2417
|
+
children: /* @__PURE__ */ X("div", {
|
|
2428
2418
|
className: "flex items-center gap-3",
|
|
2429
|
-
children: [/* @__PURE__ */
|
|
2419
|
+
children: [/* @__PURE__ */ Y(B, { className: "size-10 rounded-xl" }), /* @__PURE__ */ X("div", {
|
|
2430
2420
|
className: "flex flex-col gap-1",
|
|
2431
|
-
children: [/* @__PURE__ */
|
|
2421
|
+
children: [/* @__PURE__ */ Y(B, { className: "h-4 w-28 rounded-lg" }), /* @__PURE__ */ Y(B, { className: "h-3 w-32 rounded-lg" })]
|
|
2432
2422
|
})]
|
|
2433
2423
|
})
|
|
2434
2424
|
});
|
|
2435
2425
|
}
|
|
2436
2426
|
//#endregion
|
|
2437
2427
|
//#region src/components/auth/passkey/passkeys-empty.tsx
|
|
2438
|
-
function
|
|
2439
|
-
let { localization: t } = m(
|
|
2440
|
-
return /* @__PURE__ */
|
|
2428
|
+
function On({ onAddPress: e }) {
|
|
2429
|
+
let { localization: t } = m(Cn);
|
|
2430
|
+
return /* @__PURE__ */ X("div", {
|
|
2441
2431
|
className: "flex flex-col items-center justify-center gap-4",
|
|
2442
2432
|
children: [
|
|
2443
|
-
/* @__PURE__ */
|
|
2433
|
+
/* @__PURE__ */ Y("div", {
|
|
2444
2434
|
className: "flex size-10 items-center justify-center rounded-xl bg-surface-secondary",
|
|
2445
|
-
children: /* @__PURE__ */
|
|
2435
|
+
children: /* @__PURE__ */ Y(Ie, { className: "size-4.5" })
|
|
2446
2436
|
}),
|
|
2447
|
-
/* @__PURE__ */
|
|
2437
|
+
/* @__PURE__ */ X("div", {
|
|
2448
2438
|
className: "flex flex-col items-center justify-center gap-1 text-center",
|
|
2449
|
-
children: [/* @__PURE__ */
|
|
2439
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
2450
2440
|
className: "text-sm font-semibold",
|
|
2451
2441
|
children: t.noPasskeys
|
|
2452
|
-
}), /* @__PURE__ */
|
|
2442
|
+
}), /* @__PURE__ */ Y("p", {
|
|
2453
2443
|
className: "text-muted text-xs",
|
|
2454
2444
|
children: t.passkeysDescription
|
|
2455
2445
|
})]
|
|
2456
2446
|
}),
|
|
2457
|
-
/* @__PURE__ */
|
|
2447
|
+
/* @__PURE__ */ Y(k, {
|
|
2458
2448
|
size: "sm",
|
|
2459
2449
|
onPress: e,
|
|
2460
2450
|
children: t.addPasskey
|
|
@@ -2464,17 +2454,17 @@ function jn({ onAddPress: e }) {
|
|
|
2464
2454
|
}
|
|
2465
2455
|
//#endregion
|
|
2466
2456
|
//#region src/components/auth/passkey/passkeys.tsx
|
|
2467
|
-
function
|
|
2468
|
-
let { authClient: r } = p(), { localization: i } = m(
|
|
2469
|
-
return /* @__PURE__ */
|
|
2470
|
-
className:
|
|
2457
|
+
function kn({ className: e, variant: t, ...n }) {
|
|
2458
|
+
let { authClient: r } = p(), { localization: i } = m(Cn), { data: a, isPending: o } = le(r), [s, c] = q(!1);
|
|
2459
|
+
return /* @__PURE__ */ X("div", {
|
|
2460
|
+
className: G("flex flex-col gap-3", e),
|
|
2471
2461
|
children: [
|
|
2472
|
-
/* @__PURE__ */
|
|
2462
|
+
/* @__PURE__ */ X("div", {
|
|
2473
2463
|
className: "flex items-end justify-between gap-3",
|
|
2474
|
-
children: [/* @__PURE__ */
|
|
2464
|
+
children: [/* @__PURE__ */ Y("h2", {
|
|
2475
2465
|
className: "text-sm font-semibold truncate",
|
|
2476
2466
|
children: i.passkeys
|
|
2477
|
-
}), /* @__PURE__ */
|
|
2467
|
+
}), /* @__PURE__ */ Y(k, {
|
|
2478
2468
|
className: "shrink-0",
|
|
2479
2469
|
size: "sm",
|
|
2480
2470
|
isDisabled: o,
|
|
@@ -2482,12 +2472,12 @@ function Mn({ className: e, variant: t, ...n }) {
|
|
|
2482
2472
|
children: i.addPasskey
|
|
2483
2473
|
})]
|
|
2484
2474
|
}),
|
|
2485
|
-
/* @__PURE__ */
|
|
2475
|
+
/* @__PURE__ */ Y(A, {
|
|
2486
2476
|
variant: t,
|
|
2487
2477
|
...n,
|
|
2488
|
-
children: /* @__PURE__ */
|
|
2478
|
+
children: /* @__PURE__ */ Y(A.Content, { children: o ? /* @__PURE__ */ Y(Dn, {}) : a?.length ? a.map((e, t) => /* @__PURE__ */ X("div", { children: [t > 0 && /* @__PURE__ */ Y("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ Y(En, { passkey: e })] }, e.id)) : /* @__PURE__ */ Y(On, { onAddPress: () => c(!0) }) })
|
|
2489
2479
|
}),
|
|
2490
|
-
/* @__PURE__ */
|
|
2480
|
+
/* @__PURE__ */ Y(wn, {
|
|
2491
2481
|
isOpen: s,
|
|
2492
2482
|
onOpenChange: c
|
|
2493
2483
|
})
|
|
@@ -2496,23 +2486,23 @@ function Mn({ className: e, variant: t, ...n }) {
|
|
|
2496
2486
|
}
|
|
2497
2487
|
//#endregion
|
|
2498
2488
|
//#region src/components/auth/theme/theme-toggle-item.tsx
|
|
2499
|
-
var
|
|
2500
|
-
function
|
|
2501
|
-
let { useTheme: e, localization: t } = m(
|
|
2502
|
-
return /* @__PURE__ */
|
|
2489
|
+
var An = "[role=\"tab\"][aria-selected=\"true\"]";
|
|
2490
|
+
function jn() {
|
|
2491
|
+
let { useTheme: e, localization: t } = m(Mn), { theme: n, setTheme: r, themes: i = [] } = e();
|
|
2492
|
+
return /* @__PURE__ */ X(M.Item, {
|
|
2503
2493
|
className: "py-1 pe-2",
|
|
2504
2494
|
onFocus: (e) => {
|
|
2505
|
-
e.target === e.currentTarget && e.currentTarget.querySelector(
|
|
2495
|
+
e.target === e.currentTarget && e.currentTarget.querySelector(An)?.focus({ preventScroll: !0 });
|
|
2506
2496
|
},
|
|
2507
2497
|
shouldCloseOnSelect: !1,
|
|
2508
2498
|
children: [
|
|
2509
|
-
/* @__PURE__ */
|
|
2510
|
-
/* @__PURE__ */
|
|
2511
|
-
/* @__PURE__ */
|
|
2499
|
+
/* @__PURE__ */ Y(He, { className: "text-muted" }),
|
|
2500
|
+
/* @__PURE__ */ Y(L, { children: t.theme }),
|
|
2501
|
+
/* @__PURE__ */ Y(U, {
|
|
2512
2502
|
className: "ml-auto",
|
|
2513
2503
|
selectedKey: n,
|
|
2514
2504
|
onSelectionChange: (e) => r(e),
|
|
2515
|
-
children: /* @__PURE__ */
|
|
2505
|
+
children: /* @__PURE__ */ Y(U.ListContainer, {
|
|
2516
2506
|
onKeyDown: (e) => {
|
|
2517
2507
|
if (e.key !== "ArrowUp" && e.key !== "ArrowDown") return;
|
|
2518
2508
|
let t = e.target;
|
|
@@ -2524,24 +2514,24 @@ function Pn() {
|
|
|
2524
2514
|
let o = i[e.key === "ArrowDown" ? a + 1 : a - 1];
|
|
2525
2515
|
o && (e.preventDefault(), o.focus());
|
|
2526
2516
|
},
|
|
2527
|
-
children: /* @__PURE__ */
|
|
2517
|
+
children: /* @__PURE__ */ X(U.List, {
|
|
2528
2518
|
"aria-label": t.theme,
|
|
2529
2519
|
className: "*:h-5 *:w-5 *:p-0",
|
|
2530
2520
|
children: [
|
|
2531
|
-
i.includes("system") && /* @__PURE__ */
|
|
2521
|
+
i.includes("system") && /* @__PURE__ */ X(U.Tab, {
|
|
2532
2522
|
id: "system",
|
|
2533
2523
|
"aria-label": t.system,
|
|
2534
|
-
children: [/* @__PURE__ */
|
|
2524
|
+
children: [/* @__PURE__ */ Y(Ne, { className: "size-3" }), /* @__PURE__ */ Y(U.Indicator, {})]
|
|
2535
2525
|
}),
|
|
2536
|
-
i.includes("light") && /* @__PURE__ */
|
|
2526
|
+
i.includes("light") && /* @__PURE__ */ X(U.Tab, {
|
|
2537
2527
|
id: "light",
|
|
2538
2528
|
"aria-label": t.light,
|
|
2539
|
-
children: [/* @__PURE__ */
|
|
2529
|
+
children: [/* @__PURE__ */ Y(qe, { className: "size-3" }), /* @__PURE__ */ Y(U.Indicator, {})]
|
|
2540
2530
|
}),
|
|
2541
|
-
i.includes("dark") && /* @__PURE__ */
|
|
2531
|
+
i.includes("dark") && /* @__PURE__ */ X(U.Tab, {
|
|
2542
2532
|
id: "dark",
|
|
2543
2533
|
"aria-label": t.dark,
|
|
2544
|
-
children: [/* @__PURE__ */
|
|
2534
|
+
children: [/* @__PURE__ */ Y(Ve, { className: "size-3" }), /* @__PURE__ */ Y(U.Indicator, {})]
|
|
2545
2535
|
})
|
|
2546
2536
|
]
|
|
2547
2537
|
})
|
|
@@ -2552,8 +2542,8 @@ function Pn() {
|
|
|
2552
2542
|
}
|
|
2553
2543
|
//#endregion
|
|
2554
2544
|
//#region src/lib/auth/theme-plugin.ts
|
|
2555
|
-
var
|
|
2556
|
-
let n =
|
|
2545
|
+
var Mn = a(ht.id, ({ useTheme: e, ...t }) => {
|
|
2546
|
+
let n = ht({
|
|
2557
2547
|
setTheme: () => {},
|
|
2558
2548
|
...t
|
|
2559
2549
|
});
|
|
@@ -2564,69 +2554,69 @@ var Fn = a(_t.id, ({ useTheme: e, ...t }) => {
|
|
|
2564
2554
|
setTheme: n.setTheme,
|
|
2565
2555
|
themes: n.themes
|
|
2566
2556
|
})),
|
|
2567
|
-
userMenuItems: [
|
|
2568
|
-
accountCards: [
|
|
2557
|
+
userMenuItems: [jn],
|
|
2558
|
+
accountCards: [Nn]
|
|
2569
2559
|
};
|
|
2570
2560
|
});
|
|
2571
2561
|
//#endregion
|
|
2572
2562
|
//#region src/components/auth/theme/appearance.tsx
|
|
2573
|
-
function
|
|
2574
|
-
let { useTheme: r, localization: i } = m(
|
|
2575
|
-
return /* @__PURE__ */
|
|
2576
|
-
className:
|
|
2563
|
+
function Nn({ className: e, variant: t, ...n }) {
|
|
2564
|
+
let { useTheme: r, localization: i } = m(Mn), { theme: a, setTheme: o, themes: u = [] } = r(), d = it();
|
|
2565
|
+
return /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("h2", {
|
|
2566
|
+
className: G("text-sm font-semibold mb-3"),
|
|
2577
2567
|
children: i.appearance
|
|
2578
|
-
}), /* @__PURE__ */
|
|
2579
|
-
className:
|
|
2568
|
+
}), /* @__PURE__ */ Y(A, {
|
|
2569
|
+
className: G("p-4 gap-4", e),
|
|
2580
2570
|
variant: t,
|
|
2581
2571
|
...n,
|
|
2582
|
-
children: /* @__PURE__ */
|
|
2572
|
+
children: /* @__PURE__ */ X(A.Content, { children: [/* @__PURE__ */ Y(L, { children: i.theme }), /* @__PURE__ */ Y(nt, {
|
|
2583
2573
|
variant: t === "transparent" ? "secondary" : "primary",
|
|
2584
2574
|
value: d ? a : "",
|
|
2585
2575
|
onChange: o,
|
|
2586
2576
|
isDisabled: !d || !a,
|
|
2587
|
-
children: /* @__PURE__ */
|
|
2577
|
+
children: /* @__PURE__ */ X("div", {
|
|
2588
2578
|
className: "grid gap-3 grid-cols-2 sm:grid-cols-3",
|
|
2589
2579
|
children: [
|
|
2590
|
-
u.includes("system") && /* @__PURE__ */
|
|
2580
|
+
u.includes("system") && /* @__PURE__ */ Y(R, {
|
|
2591
2581
|
value: "system",
|
|
2592
|
-
className:
|
|
2593
|
-
children: /* @__PURE__ */
|
|
2582
|
+
className: G("mt-0 px-4 pb-4 pt-3 rounded-xl", "border border-transparent data-[selected=true]:border-accent data-[selected=true]:bg-accent/10", "data-[focus-visible=true]:border-accent data-[focus-visible=true]:bg-accent/10", t === "transparent" ? "bg-surface" : "bg-surface-secondary"),
|
|
2583
|
+
children: /* @__PURE__ */ X(R.Content, {
|
|
2594
2584
|
className: "gap-2",
|
|
2595
|
-
children: [/* @__PURE__ */
|
|
2585
|
+
children: [/* @__PURE__ */ X("div", {
|
|
2596
2586
|
className: "flex gap-2 justify-between",
|
|
2597
|
-
children: [/* @__PURE__ */
|
|
2587
|
+
children: [/* @__PURE__ */ X("span", {
|
|
2598
2588
|
className: "flex gap-2 items-center",
|
|
2599
|
-
children: [/* @__PURE__ */
|
|
2600
|
-
}), /* @__PURE__ */
|
|
2601
|
-
}), /* @__PURE__ */
|
|
2589
|
+
children: [/* @__PURE__ */ Y(Ne, { className: "text-muted" }), i.system]
|
|
2590
|
+
}), /* @__PURE__ */ Y(R.Control, { children: /* @__PURE__ */ Y(R.Indicator, {}) })]
|
|
2591
|
+
}), /* @__PURE__ */ Y(l, { className: "w-full" })]
|
|
2602
2592
|
})
|
|
2603
2593
|
}),
|
|
2604
|
-
u.includes("light") && /* @__PURE__ */
|
|
2594
|
+
u.includes("light") && /* @__PURE__ */ Y(R, {
|
|
2605
2595
|
value: "light",
|
|
2606
|
-
className:
|
|
2607
|
-
children: /* @__PURE__ */
|
|
2596
|
+
className: G("mt-0 px-4 pb-4 pt-3 rounded-xl", "border border-transparent data-[selected=true]:border-accent data-[selected=true]:bg-accent/10", "data-[focus-visible=true]:border-accent data-[focus-visible=true]:bg-accent/10", t === "transparent" ? "bg-surface" : "bg-surface-secondary"),
|
|
2597
|
+
children: /* @__PURE__ */ X(R.Content, {
|
|
2608
2598
|
className: "gap-2",
|
|
2609
|
-
children: [/* @__PURE__ */
|
|
2599
|
+
children: [/* @__PURE__ */ X("div", {
|
|
2610
2600
|
className: "flex gap-2 justify-between",
|
|
2611
|
-
children: [/* @__PURE__ */
|
|
2601
|
+
children: [/* @__PURE__ */ X("span", {
|
|
2612
2602
|
className: "flex gap-2 items-center",
|
|
2613
|
-
children: [/* @__PURE__ */
|
|
2614
|
-
}), /* @__PURE__ */
|
|
2615
|
-
}), /* @__PURE__ */
|
|
2603
|
+
children: [/* @__PURE__ */ Y(qe, { className: "text-muted" }), i.light]
|
|
2604
|
+
}), /* @__PURE__ */ Y(R.Control, { children: /* @__PURE__ */ Y(R.Indicator, {}) })]
|
|
2605
|
+
}), /* @__PURE__ */ Y(c, { className: "w-full" })]
|
|
2616
2606
|
})
|
|
2617
2607
|
}),
|
|
2618
|
-
u.includes("dark") && /* @__PURE__ */
|
|
2608
|
+
u.includes("dark") && /* @__PURE__ */ Y(R, {
|
|
2619
2609
|
value: "dark",
|
|
2620
|
-
className:
|
|
2621
|
-
children: /* @__PURE__ */
|
|
2610
|
+
className: G("mt-0 px-4 pb-4 pt-3 rounded-xl", "border border-transparent data-[selected=true]:border-accent data-[selected=true]:bg-accent/10", "data-[focus-visible=true]:border-accent data-[focus-visible=true]:bg-accent/10", t === "transparent" ? "bg-surface" : "bg-surface-secondary"),
|
|
2611
|
+
children: /* @__PURE__ */ X(R.Content, {
|
|
2622
2612
|
className: "gap-2",
|
|
2623
|
-
children: [/* @__PURE__ */
|
|
2613
|
+
children: [/* @__PURE__ */ X("div", {
|
|
2624
2614
|
className: "flex gap-2 justify-between",
|
|
2625
|
-
children: [/* @__PURE__ */
|
|
2615
|
+
children: [/* @__PURE__ */ X("span", {
|
|
2626
2616
|
className: "flex gap-2 items-center",
|
|
2627
|
-
children: [/* @__PURE__ */
|
|
2628
|
-
}), /* @__PURE__ */
|
|
2629
|
-
}), /* @__PURE__ */
|
|
2617
|
+
children: [/* @__PURE__ */ Y(Ve, { className: "text-muted" }), i.dark]
|
|
2618
|
+
}), /* @__PURE__ */ Y(R.Control, { children: /* @__PURE__ */ Y(R.Indicator, {}) })]
|
|
2619
|
+
}), /* @__PURE__ */ Y(s, { className: "w-full" })]
|
|
2630
2620
|
})
|
|
2631
2621
|
})
|
|
2632
2622
|
]
|
|
@@ -2636,8 +2626,8 @@ function In({ className: e, variant: t, ...n }) {
|
|
|
2636
2626
|
}
|
|
2637
2627
|
//#endregion
|
|
2638
2628
|
//#region src/components/auth/username/username-field.tsx
|
|
2639
|
-
function
|
|
2640
|
-
let { authClient: i } = p(), { localization: a, minUsernameLength: o, maxUsernameLength: s, isUsernameAvailable: c } = m(
|
|
2629
|
+
function Pn({ name: e, field: t, isPending: n, variant: r }) {
|
|
2630
|
+
let { authClient: i } = p(), { localization: a, minUsernameLength: o, maxUsernameLength: s, isUsernameAvailable: c } = m(Fn), l = String(t.defaultValue ?? ""), [u, d] = q(l), { mutate: f, data: h, error: g, reset: _ } = te(i, { onError: () => {} }), v = vt((e) => {
|
|
2641
2631
|
let t = e.trim();
|
|
2642
2632
|
if (!t || t === l) {
|
|
2643
2633
|
_();
|
|
@@ -2649,7 +2639,7 @@ function Ln({ name: e, field: t, isPending: n, variant: r }) {
|
|
|
2649
2639
|
d(e), _(), c && v.maybeExecute(e);
|
|
2650
2640
|
}
|
|
2651
2641
|
let b = !!c && !!u.trim() && u.trim() !== l, { localization: x } = p();
|
|
2652
|
-
return /* @__PURE__ */
|
|
2642
|
+
return /* @__PURE__ */ X(W, {
|
|
2653
2643
|
name: e,
|
|
2654
2644
|
type: "text",
|
|
2655
2645
|
autoComplete: "username",
|
|
@@ -2665,117 +2655,117 @@ function Ln({ name: e, field: t, isPending: n, variant: r }) {
|
|
|
2665
2655
|
if (s && e.length > s) return x.auth.tooLong.replace("{{max}}", String(s));
|
|
2666
2656
|
},
|
|
2667
2657
|
children: [
|
|
2668
|
-
/* @__PURE__ */
|
|
2669
|
-
/* @__PURE__ */
|
|
2658
|
+
/* @__PURE__ */ Y(L, { children: t.label }),
|
|
2659
|
+
/* @__PURE__ */ X(I, {
|
|
2670
2660
|
variant: r === "transparent" ? "primary" : "secondary",
|
|
2671
|
-
children: [/* @__PURE__ */
|
|
2661
|
+
children: [/* @__PURE__ */ Y(I.Input, {
|
|
2672
2662
|
placeholder: t.placeholder,
|
|
2673
2663
|
required: t.required
|
|
2674
|
-
}), b && /* @__PURE__ */
|
|
2664
|
+
}), b && /* @__PURE__ */ Y(I.Suffix, {
|
|
2675
2665
|
"aria-label": h?.available ? a.usernameAvailable : h?.available === !1 ? a.usernameTaken : void 0,
|
|
2676
2666
|
className: "px-2",
|
|
2677
|
-
children: h?.available ? /* @__PURE__ */
|
|
2667
|
+
children: h?.available ? /* @__PURE__ */ Y(De, { className: "text-success" }) : g || h?.available === !1 ? /* @__PURE__ */ Y(D, { className: "text-danger" }) : /* @__PURE__ */ Y(V, {
|
|
2678
2668
|
size: "sm",
|
|
2679
2669
|
color: "current"
|
|
2680
2670
|
})
|
|
2681
2671
|
})]
|
|
2682
2672
|
}),
|
|
2683
|
-
/* @__PURE__ */
|
|
2673
|
+
/* @__PURE__ */ Y(N, {})
|
|
2684
2674
|
]
|
|
2685
2675
|
});
|
|
2686
2676
|
}
|
|
2687
2677
|
//#endregion
|
|
2688
2678
|
//#region src/lib/auth/username-plugin.tsx
|
|
2689
|
-
var
|
|
2690
|
-
let t =
|
|
2679
|
+
var Fn = a(gt.id, (e = {}) => {
|
|
2680
|
+
let t = gt(e);
|
|
2691
2681
|
return {
|
|
2692
2682
|
...t,
|
|
2693
2683
|
additionalFields: t.additionalFields?.map((e) => e.name === "username" ? {
|
|
2694
2684
|
...e,
|
|
2695
|
-
render:
|
|
2685
|
+
render: Pn
|
|
2696
2686
|
} : e),
|
|
2697
|
-
views: { auth: { signIn:
|
|
2687
|
+
views: { auth: { signIn: In } }
|
|
2698
2688
|
};
|
|
2699
2689
|
});
|
|
2700
2690
|
//#endregion
|
|
2701
2691
|
//#region src/components/auth/username/sign-in-username.tsx
|
|
2702
|
-
function
|
|
2703
|
-
let { authClient: s, basePaths: c, baseURL: l, emailAndPassword: u, localization: d, plugins: f, redirectTo: h, socialProviders: g, viewPaths: _, navigate: v } = p(), { fetchOptions: y, resetFetchOptions: b } =
|
|
2704
|
-
function
|
|
2692
|
+
function In({ className: n, socialLayout: i, socialPosition: a = "bottom", variant: o }) {
|
|
2693
|
+
let { authClient: s, basePaths: c, baseURL: l, emailAndPassword: u, localization: d, plugins: f, redirectTo: h, socialProviders: g, viewPaths: _, navigate: v } = p(), { fetchOptions: y, resetFetchOptions: b } = w(), { localization: x } = m(Fn), [S, C] = q(""), { mutate: T } = me(s, { onSuccess: () => K.success(d.auth.verificationEmailSent) });
|
|
2694
|
+
function ee(e) {
|
|
2705
2695
|
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
|
|
2706
2696
|
}
|
|
2707
|
-
let { mutate:
|
|
2697
|
+
let { mutate: te, isPending: ne } = _e(s, {
|
|
2708
2698
|
onError: (e, { email: t }) => {
|
|
2709
|
-
C(""), e.error?.code === "EMAIL_NOT_VERIFIED" &&
|
|
2699
|
+
C(""), e.error?.code === "EMAIL_NOT_VERIFIED" && K.danger(e.error?.message || e.message, { actionProps: {
|
|
2710
2700
|
children: d.auth.resend,
|
|
2711
|
-
onClick: () =>
|
|
2701
|
+
onClick: () => T({
|
|
2712
2702
|
email: t,
|
|
2713
2703
|
callbackURL: `${l}${h}`
|
|
2714
2704
|
})
|
|
2715
2705
|
} }), b();
|
|
2716
2706
|
},
|
|
2717
2707
|
onSuccess: () => v({ to: h })
|
|
2718
|
-
}), { mutate:
|
|
2708
|
+
}), { mutate: re, isPending: ie } = be(s, {
|
|
2719
2709
|
onError: () => {
|
|
2720
2710
|
C(""), b();
|
|
2721
2711
|
},
|
|
2722
2712
|
onSuccess: () => v({ to: h })
|
|
2723
|
-
}),
|
|
2713
|
+
}), ae = (e) => {
|
|
2724
2714
|
e.preventDefault();
|
|
2725
2715
|
let t = new FormData(e.currentTarget), n = t.get("email"), r = t.get("rememberMe") === "on";
|
|
2726
|
-
|
|
2716
|
+
ee(n) ? te({
|
|
2727
2717
|
email: n,
|
|
2728
2718
|
password: S,
|
|
2729
2719
|
...u?.rememberMe ? { rememberMe: r } : {},
|
|
2730
2720
|
fetchOptions: y
|
|
2731
|
-
}) :
|
|
2721
|
+
}) : re({
|
|
2732
2722
|
username: n,
|
|
2733
2723
|
password: S,
|
|
2734
2724
|
...u?.rememberMe ? { rememberMe: r } : {},
|
|
2735
2725
|
fetchOptions: y
|
|
2736
2726
|
});
|
|
2737
|
-
},
|
|
2738
|
-
return /* @__PURE__ */
|
|
2739
|
-
className:
|
|
2727
|
+
}, oe = Z({ mutationKey: r.signIn.all }) + Z({ mutationKey: r.signUp.all }) > 0, se = ne || ie, ce = f.find((e) => e.captchaComponent)?.captchaComponent, le = u?.enabled && !!g?.length;
|
|
2728
|
+
return /* @__PURE__ */ X(A, {
|
|
2729
|
+
className: G("w-full max-w-sm gap-4 md:p-6", n),
|
|
2740
2730
|
variant: o,
|
|
2741
2731
|
children: [
|
|
2742
|
-
/* @__PURE__ */
|
|
2732
|
+
/* @__PURE__ */ Y(A.Header, { children: /* @__PURE__ */ Y(A.Title, {
|
|
2743
2733
|
className: "text-xl font-semibold mb-1",
|
|
2744
2734
|
children: d.auth.signIn
|
|
2745
2735
|
}) }),
|
|
2746
|
-
/* @__PURE__ */
|
|
2736
|
+
/* @__PURE__ */ X(A.Content, {
|
|
2747
2737
|
className: "gap-4",
|
|
2748
2738
|
children: [
|
|
2749
|
-
a === "top" && /* @__PURE__ */
|
|
2750
|
-
u?.enabled && /* @__PURE__ */
|
|
2751
|
-
onSubmit:
|
|
2739
|
+
a === "top" && /* @__PURE__ */ X(J, { children: [!!g?.length && /* @__PURE__ */ Y(t, { socialLayout: i }), le && /* @__PURE__ */ Y(e, { children: d.auth.or })] }),
|
|
2740
|
+
u?.enabled && /* @__PURE__ */ X(P, {
|
|
2741
|
+
onSubmit: ae,
|
|
2752
2742
|
className: "flex flex-col gap-4",
|
|
2753
2743
|
children: [
|
|
2754
|
-
/* @__PURE__ */
|
|
2744
|
+
/* @__PURE__ */ X(W, {
|
|
2755
2745
|
name: "email",
|
|
2756
2746
|
type: "text",
|
|
2757
2747
|
autoComplete: "username email",
|
|
2758
|
-
isDisabled:
|
|
2748
|
+
isDisabled: oe,
|
|
2759
2749
|
validate: (e) => {
|
|
2760
2750
|
if (!e) return d.auth.fieldRequired;
|
|
2761
2751
|
},
|
|
2762
2752
|
children: [
|
|
2763
|
-
/* @__PURE__ */
|
|
2764
|
-
/* @__PURE__ */
|
|
2753
|
+
/* @__PURE__ */ Y(L, { children: x.username }),
|
|
2754
|
+
/* @__PURE__ */ Y(F, {
|
|
2765
2755
|
placeholder: x.usernameOrEmailPlaceholder,
|
|
2766
2756
|
variant: o === "transparent" ? "primary" : "secondary",
|
|
2767
2757
|
required: !0
|
|
2768
2758
|
}),
|
|
2769
|
-
/* @__PURE__ */
|
|
2759
|
+
/* @__PURE__ */ Y(N, {})
|
|
2770
2760
|
]
|
|
2771
2761
|
}),
|
|
2772
|
-
/* @__PURE__ */
|
|
2762
|
+
/* @__PURE__ */ X(W, {
|
|
2773
2763
|
minLength: u?.minPasswordLength,
|
|
2774
2764
|
maxLength: u?.maxPasswordLength,
|
|
2775
2765
|
name: "password",
|
|
2776
2766
|
type: "password",
|
|
2777
2767
|
autoComplete: "current-password",
|
|
2778
|
-
isDisabled:
|
|
2768
|
+
isDisabled: oe,
|
|
2779
2769
|
value: S,
|
|
2780
2770
|
onChange: C,
|
|
2781
2771
|
validate: (e) => {
|
|
@@ -2785,54 +2775,54 @@ function zn({ className: n, socialLayout: i, socialPosition: a = "bottom", varia
|
|
|
2785
2775
|
if (n && e.length > n) return d.auth.tooLong.replace("{{max}}", String(n));
|
|
2786
2776
|
},
|
|
2787
2777
|
children: [
|
|
2788
|
-
/* @__PURE__ */
|
|
2789
|
-
/* @__PURE__ */
|
|
2778
|
+
/* @__PURE__ */ Y(L, { children: d.auth.password }),
|
|
2779
|
+
/* @__PURE__ */ Y(F, {
|
|
2790
2780
|
placeholder: d.auth.passwordPlaceholder,
|
|
2791
2781
|
variant: o === "transparent" ? "primary" : "secondary",
|
|
2792
2782
|
required: !0
|
|
2793
2783
|
}),
|
|
2794
|
-
/* @__PURE__ */
|
|
2784
|
+
/* @__PURE__ */ Y(N, {})
|
|
2795
2785
|
]
|
|
2796
2786
|
}),
|
|
2797
|
-
u?.rememberMe && /* @__PURE__ */ Y(
|
|
2787
|
+
u?.rememberMe && /* @__PURE__ */ Y(Ze, {
|
|
2798
2788
|
name: "rememberMe",
|
|
2799
|
-
isDisabled:
|
|
2789
|
+
isDisabled: oe,
|
|
2800
2790
|
variant: o === "transparent" ? "primary" : "secondary",
|
|
2801
|
-
children:
|
|
2791
|
+
children: /* @__PURE__ */ X(Ze.Content, { children: [/* @__PURE__ */ Y(Ze.Control, { children: /* @__PURE__ */ Y(Ze.Indicator, {}) }), d.auth.rememberMe] })
|
|
2802
2792
|
}),
|
|
2803
|
-
|
|
2793
|
+
ce && /* @__PURE__ */ Y("div", {
|
|
2804
2794
|
className: "flex justify-center",
|
|
2805
|
-
children:
|
|
2795
|
+
children: ce
|
|
2806
2796
|
}),
|
|
2807
|
-
/* @__PURE__ */
|
|
2797
|
+
/* @__PURE__ */ X("div", {
|
|
2808
2798
|
className: "flex flex-col gap-3",
|
|
2809
|
-
children: [/* @__PURE__ */
|
|
2799
|
+
children: [/* @__PURE__ */ X(k, {
|
|
2810
2800
|
type: "submit",
|
|
2811
2801
|
className: "w-full",
|
|
2812
|
-
isPending:
|
|
2813
|
-
children: [
|
|
2802
|
+
isPending: se || oe,
|
|
2803
|
+
children: [se && /* @__PURE__ */ Y(V, {
|
|
2814
2804
|
color: "current",
|
|
2815
2805
|
size: "sm"
|
|
2816
2806
|
}), d.auth.signIn]
|
|
2817
|
-
}), f.flatMap((e) => e.authButtons?.map((t, n) => /* @__PURE__ */
|
|
2807
|
+
}), f.flatMap((e) => e.authButtons?.map((t, n) => /* @__PURE__ */ Y(t, { view: "signIn" }, `${e.id}-${n.toString()}`)))]
|
|
2818
2808
|
})
|
|
2819
2809
|
]
|
|
2820
2810
|
}),
|
|
2821
|
-
a === "bottom" && /* @__PURE__ */
|
|
2811
|
+
a === "bottom" && /* @__PURE__ */ X(J, { children: [le && /* @__PURE__ */ Y(e, { children: d.auth.or }), !!g?.length && /* @__PURE__ */ Y(t, { socialLayout: i })] })
|
|
2822
2812
|
]
|
|
2823
2813
|
}),
|
|
2824
|
-
/* @__PURE__ */
|
|
2814
|
+
/* @__PURE__ */ X(A.Footer, {
|
|
2825
2815
|
className: "flex-col gap-3",
|
|
2826
|
-
children: [u?.enabled && u?.forgotPassword && /* @__PURE__ */
|
|
2816
|
+
children: [u?.enabled && u?.forgotPassword && /* @__PURE__ */ Y(et, {
|
|
2827
2817
|
href: `${c.auth}/${_.auth.forgotPassword}`,
|
|
2828
|
-
className: "no-underline hover:underline",
|
|
2818
|
+
className: "text-sm no-underline hover:underline",
|
|
2829
2819
|
children: d.auth.forgotPasswordLink
|
|
2830
|
-
}), u?.enabled && /* @__PURE__ */
|
|
2820
|
+
}), u?.enabled && /* @__PURE__ */ X(Qe, {
|
|
2831
2821
|
className: "text-sm",
|
|
2832
2822
|
children: [
|
|
2833
2823
|
d.auth.needToCreateAnAccount,
|
|
2834
2824
|
" ",
|
|
2835
|
-
/* @__PURE__ */
|
|
2825
|
+
/* @__PURE__ */ Y(et, {
|
|
2836
2826
|
href: `${c.auth}/${_.auth.signUp}`,
|
|
2837
2827
|
className: "text-accent no-underline hover:underline decoration-accent-hover",
|
|
2838
2828
|
children: d.auth.signUp
|
|
@@ -2844,4 +2834,4 @@ function zn({ className: n, socialLayout: i, socialPosition: a = "bottom", varia
|
|
|
2844
2834
|
});
|
|
2845
2835
|
}
|
|
2846
2836
|
//#endregion
|
|
2847
|
-
export {
|
|
2837
|
+
export { Dt as ApiKeys, Nn as Appearance, $t as ChangeOrganizationLogo, Ht as CreateOrganizationDialog, At as DangerZone, kt as DeleteAccount, nn as DeleteOrganization, tn as DeleteOrganizationSkeleton, an as InviteMemberDialog, sn as LeaveOrganization, Nt as MagicLink, zt as ManageAccount, Pt as ManageAccounts, bn as Organization, yt as OrganizationApiKeys, _n as OrganizationDangerZone, dn as OrganizationInvitations, un as OrganizationInvitationsEmpty, Ut as OrganizationLogo, hn as OrganizationMembers, gn as OrganizationPeople, vn as OrganizationProfile, Gt as OrganizationRow, yn as OrganizationSettings, xn as OrganizationSwitcher, Q as OrganizationView, Wt as OrganizationViewSkeleton, qt as Organizations, Qt as OrganizationsSettings, kn as Passkeys, In as SignInUsername, Lt as SwitchAccountSubmenu, It as SwitchAccountSubmenuContent, Ft as SwitchAccountSubmenuItem, jn as ThemeToggleItem, Zt as UserInvitations, Pn as UsernameField, bt as apiKeyPlugin, Ot as deleteUserPlugin, Mt as magicLinkPlugin, Rt as multiSessionPlugin, $ as organizationPlugin, Cn as passkeyPlugin, Mn as themePlugin, Fn as usernamePlugin };
|