@better-auth-ui/heroui 1.6.26 → 1.6.28

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 CHANGED
@@ -1,33 +1,32 @@
1
1
  "use client";
2
- import { a as e, i as t, n, r, t as i } from "./user-view--47tVtJ3.js";
3
- import { authMutationKeys as a, authQueryKeys as o, fileToBase64 as s, getEmailProviderLink as c, getProviderName as l, parseAdditionalFieldValue as u, resolveInputType as d } from "@better-auth-ui/core";
4
- import { AuthProvider as f, providerIcons as p, useAccountInfo as m, useAuth as h, useAuthenticate as g, useChangeEmail as _, useChangePassword as v, useFetchOptions as y, useLinkSocial as b, useListAccounts as x, useListSessions as ee, useRequestPasswordReset as S, useResetPassword as te, useRevokeSession as C, useSendVerificationEmail as ne, useSession as w, useSignInEmail as T, useSignOut as re, useSignUpEmail as ie, useUnlinkAccount as ae, useUpdateUser as oe } from "@better-auth-ui/react";
5
- import { ArrowRightFromSquare as E, ArrowRightToSquare as se, ArrowUpRightFromSquare as ce, Check as le, ChevronsExpandVertical as ue, CloudArrowUpIn as de, Copy as fe, Display as pe, Eye as D, EyeSlash as O, Gear as me, Link as he, LinkSlash as ge, Person as _e, PersonPlus as ve, PlugConnection as ye, Shield as be, Smartphone as xe, TrashBin as Se, Xmark as Ce } from "@gravity-ui/icons";
6
- import { Button as k, Calendar as A, Card as j, Checkbox as M, Chip as we, ComboBox as Te, DateField as Ee, DatePicker as De, Description as N, Dropdown as P, FieldError as F, Fieldset as I, Form as L, Input as R, InputGroup as z, Label as B, Link as V, ListBox as H, NumberField as Oe, RouterProvider as ke, Select as Ae, Skeleton as U, Slider as je, Spinner as W, Switch as Me, Tabs as G, TextArea as Ne, TextField as K, TimeField as Pe, cn as q, toast as J, useIsHydrated as Fe } from "@heroui/react";
7
- import { fromDate as Ie, getLocalTimeZone as Le, parseDate as Re, parseDateTime as ze, toCalendarDate as Be, toCalendarDateTime as Ve } from "@internationalized/date";
8
- import { isValidElement as He, useEffect as Y, useMemo as Ue, useRef as We, useState as X } from "react";
2
+ import { a as e, i as t, n, o as r, r as i, t as a } from "./user-view-CxSDufx_.js";
3
+ import { authMutationKeys as o, authQueryKeys as s, fileToBase64 as c, getProviderName as l, parseAdditionalFieldValue as u, resolveInputType as d } from "@better-auth-ui/core";
4
+ import { AuthProvider as f, providerIcons as p, useAccountInfo as m, useAuth as h, useAuthenticate as g, useChangeEmail as _, useChangePassword as v, useFetchOptions as y, useLinkSocial as b, useListAccounts as x, useListSessions as S, useRequestPasswordReset as C, useResetPassword as ee, useRevokeSession as w, useSendVerificationEmail as te, useSession as T, useSignInEmail as ne, useSignOut as re, useSignUpEmail as ie, useUnlinkAccount as ae, useUpdateUser as oe } from "@better-auth-ui/react";
5
+ import { ArrowRightFromSquare as E, ArrowRightToSquare as se, Check as ce, ChevronsExpandVertical as le, CloudArrowUpIn as ue, Copy as de, Display as fe, Eye as D, EyeSlash as O, Gear as pe, Link as me, LinkSlash as he, Person as ge, PersonPlus as _e, PlugConnection as ve, Shield as ye, Smartphone as be, TrashBin as xe, Xmark as Se } from "@gravity-ui/icons";
6
+ import { Button as k, Calendar as A, Card as j, Checkbox as M, Chip as Ce, ComboBox as we, DateField as Te, DatePicker as Ee, Description as N, Dropdown as P, FieldError as F, Fieldset as I, Form as L, Input as R, InputGroup as z, Label as B, Link as V, ListBox as H, NumberField as De, RouterProvider as Oe, Select as ke, Skeleton as U, Slider as Ae, Spinner as W, Switch as je, Tabs as G, TextArea as Me, TextField as K, TimeField as Ne, cn as q, toast as J, useIsHydrated as Pe } from "@heroui/react";
7
+ import { fromDate as Fe, getLocalTimeZone as Ie, parseDate as Le, parseDateTime as Re, toCalendarDate as ze, toCalendarDateTime as Be } from "@internationalized/date";
8
+ import { isValidElement as Ve, useEffect as Y, useMemo as He, useRef as Ue, useState as X } from "react";
9
9
  import { Fragment as Z, jsx as Q, jsxs as $ } from "react/jsx-runtime";
10
- import { matchMutation as Ge, matchQuery as Ke, useIsMutating as qe, useQueryClient as Je } from "@tanstack/react-query";
11
- import { buttonVariants as Ye } from "@heroui/styles";
12
- import Xe from "bowser";
10
+ import { matchMutation as We, matchQuery as Ge, useIsMutating as Ke, useQueryClient as qe } from "@tanstack/react-query";
11
+ import Je from "bowser";
13
12
  //#region src/components/auth/additional-field.tsx
14
- function Ze(e) {
15
- if (e instanceof Date) return Be(Ie(e, Le()));
13
+ function Ye(e) {
14
+ if (e instanceof Date) return ze(Fe(e, Ie()));
16
15
  if (typeof e == "string") try {
17
- return Re(e.slice(0, 10));
16
+ return Le(e.slice(0, 10));
18
17
  } catch {
19
18
  return;
20
19
  }
21
20
  }
22
- function Qe(e) {
23
- if (e instanceof Date) return Ve(Ie(e, Le()));
21
+ function Xe(e) {
22
+ if (e instanceof Date) return Be(Fe(e, Ie()));
24
23
  if (typeof e == "string") try {
25
- return ze(e.replace(/(Z|[+-]\d{2}:?\d{2})$/, ""));
24
+ return Re(e.replace(/(Z|[+-]\d{2}:?\d{2})$/, ""));
26
25
  } catch {
27
26
  return;
28
27
  }
29
28
  }
30
- function $e({ getValue: e, isDisabled: t }) {
29
+ function Ze({ getValue: e, isDisabled: t }) {
31
30
  let { localization: n } = h(), [r, i] = X(!1);
32
31
  async function a() {
33
32
  let t = e();
@@ -44,10 +43,10 @@ function $e({ getValue: e, isDisabled: t }) {
44
43
  variant: "ghost",
45
44
  isDisabled: t,
46
45
  onPress: a,
47
- children: Q(r ? le : fe, { className: "size-4" })
46
+ children: Q(r ? ce : de, { className: "size-4" })
48
47
  });
49
48
  }
50
- function et({ name: e, field: t, isPending: n, variant: r }) {
49
+ function Qe({ name: e, field: t, isPending: n, variant: r }) {
51
50
  let { localization: i } = h(), a = d(t), o = r === "transparent" ? "primary" : "secondary";
52
51
  if (t.render) {
53
52
  let i = t.render;
@@ -70,7 +69,7 @@ function et({ name: e, field: t, isPending: n, variant: r }) {
70
69
  isReadOnly: t.readOnly,
71
70
  children: [
72
71
  /* @__PURE__ */ Q(B, { children: t.label }),
73
- /* @__PURE__ */ Q(Ne, {
72
+ /* @__PURE__ */ Q(Me, {
74
73
  placeholder: t.placeholder,
75
74
  required: t.required,
76
75
  variant: o
@@ -80,7 +79,7 @@ function et({ name: e, field: t, isPending: n, variant: r }) {
80
79
  });
81
80
  if (a === "number") {
82
81
  let r = t.formatOptions?.maximumFractionDigits;
83
- return /* @__PURE__ */ $(Oe, {
82
+ return /* @__PURE__ */ $(De, {
84
83
  name: e,
85
84
  defaultValue: typeof t.defaultValue == "number" ? t.defaultValue : t.defaultValue != null && t.defaultValue !== "" ? Number(t.defaultValue) : void 0,
86
85
  minValue: t.min,
@@ -92,13 +91,13 @@ function et({ name: e, field: t, isPending: n, variant: r }) {
92
91
  variant: o,
93
92
  children: [
94
93
  /* @__PURE__ */ Q(B, { children: t.label }),
95
- /* @__PURE__ */ $(Oe.Group, { children: [
96
- /* @__PURE__ */ Q(Oe.DecrementButton, {}),
97
- /* @__PURE__ */ Q(Oe.Input, {
94
+ /* @__PURE__ */ $(De.Group, { children: [
95
+ /* @__PURE__ */ Q(De.DecrementButton, {}),
96
+ /* @__PURE__ */ Q(De.Input, {
98
97
  placeholder: t.placeholder,
99
98
  required: t.required
100
99
  }),
101
- /* @__PURE__ */ Q(Oe.IncrementButton, {})
100
+ /* @__PURE__ */ Q(De.IncrementButton, {})
102
101
  ] }),
103
102
  /* @__PURE__ */ Q(F, {})
104
103
  ]
@@ -106,7 +105,7 @@ function et({ name: e, field: t, isPending: n, variant: r }) {
106
105
  }
107
106
  if (a === "slider") {
108
107
  let r = t.formatOptions?.maximumFractionDigits;
109
- return /* @__PURE__ */ $(je, {
108
+ return /* @__PURE__ */ $(Ae, {
110
109
  defaultValue: typeof t.defaultValue == "number" ? t.defaultValue : t.defaultValue == null ? void 0 : Number(t.defaultValue),
111
110
  minValue: t.min ?? 0,
112
111
  maxValue: t.max ?? 100,
@@ -116,16 +115,16 @@ function et({ name: e, field: t, isPending: n, variant: r }) {
116
115
  className: "flex flex-col gap-2",
117
116
  children: [/* @__PURE__ */ $("div", {
118
117
  className: "flex items-center justify-between gap-2",
119
- children: [/* @__PURE__ */ Q(B, { children: t.label }), /* @__PURE__ */ Q(je.Output, { className: "text-sm text-muted" })]
120
- }), /* @__PURE__ */ $(je.Track, { children: [/* @__PURE__ */ Q(je.Fill, {}), /* @__PURE__ */ Q(je.Thumb, { name: e })] })]
118
+ children: [/* @__PURE__ */ Q(B, { children: t.label }), /* @__PURE__ */ Q(Ae.Output, { className: "text-sm text-muted" })]
119
+ }), /* @__PURE__ */ $(Ae.Track, { children: [/* @__PURE__ */ Q(Ae.Fill, {}), /* @__PURE__ */ Q(Ae.Thumb, { name: e })] })]
121
120
  });
122
121
  }
123
- if (a === "switch") return /* @__PURE__ */ Q(Me, {
122
+ if (a === "switch") return /* @__PURE__ */ Q(je, {
124
123
  name: e,
125
124
  defaultSelected: t.defaultValue === !0 || t.defaultValue === "true",
126
125
  isDisabled: n,
127
126
  isReadOnly: t.readOnly,
128
- children: /* @__PURE__ */ $(Me.Content, { children: [/* @__PURE__ */ Q(Me.Control, { children: /* @__PURE__ */ Q(Me.Thumb, {}) }), t.label] })
127
+ children: /* @__PURE__ */ $(je.Content, { children: [/* @__PURE__ */ Q(je.Control, { children: /* @__PURE__ */ Q(je.Thumb, {}) }), t.label] })
129
128
  });
130
129
  if (a === "checkbox") return /* @__PURE__ */ Q(M, {
131
130
  name: e,
@@ -136,7 +135,7 @@ function et({ name: e, field: t, isPending: n, variant: r }) {
136
135
  variant: o,
137
136
  children: /* @__PURE__ */ $(M.Content, { children: [/* @__PURE__ */ Q(M.Control, { children: /* @__PURE__ */ Q(M.Indicator, {}) }), t.label] })
138
137
  });
139
- if (a === "select") return /* @__PURE__ */ $(Ae, {
138
+ if (a === "select") return /* @__PURE__ */ $(ke, {
140
139
  className: "[&[data-required=true]>.label]:after:content-none",
141
140
  name: e,
142
141
  defaultValue: t.defaultValue == null ? void 0 : String(t.defaultValue),
@@ -147,8 +146,8 @@ function et({ name: e, field: t, isPending: n, variant: r }) {
147
146
  fullWidth: !0,
148
147
  children: [
149
148
  /* @__PURE__ */ Q(B, { children: t.label }),
150
- /* @__PURE__ */ $(Ae.Trigger, { children: [/* @__PURE__ */ Q(Ae.Value, {}), /* @__PURE__ */ Q(Ae.Indicator, {})] }),
151
- /* @__PURE__ */ Q(Ae.Popover, { children: /* @__PURE__ */ Q(H, { children: t.options?.map((e) => /* @__PURE__ */ $(H.Item, {
149
+ /* @__PURE__ */ $(ke.Trigger, { children: [/* @__PURE__ */ Q(ke.Value, {}), /* @__PURE__ */ Q(ke.Indicator, {})] }),
150
+ /* @__PURE__ */ Q(ke.Popover, { children: /* @__PURE__ */ Q(H, { children: t.options?.map((e) => /* @__PURE__ */ $(H.Item, {
152
151
  id: e.value,
153
152
  textValue: typeof e.label == "string" ? e.label : e.value,
154
153
  children: [e.label, /* @__PURE__ */ Q(H.ItemIndicator, {})]
@@ -156,7 +155,7 @@ function et({ name: e, field: t, isPending: n, variant: r }) {
156
155
  /* @__PURE__ */ Q(F, {})
157
156
  ]
158
157
  });
159
- if (a === "combobox") return /* @__PURE__ */ $(Te, {
158
+ if (a === "combobox") return /* @__PURE__ */ $(we, {
160
159
  className: "[&[data-required=true]>.label]:after:content-none",
161
160
  name: e,
162
161
  defaultSelectedKey: t.defaultValue == null ? void 0 : String(t.defaultValue),
@@ -167,8 +166,8 @@ function et({ name: e, field: t, isPending: n, variant: r }) {
167
166
  fullWidth: !0,
168
167
  children: [
169
168
  /* @__PURE__ */ Q(B, { children: t.label }),
170
- /* @__PURE__ */ $(Te.InputGroup, { children: [/* @__PURE__ */ Q(R, { placeholder: t.placeholder }), /* @__PURE__ */ Q(Te.Trigger, {})] }),
171
- /* @__PURE__ */ Q(Te.Popover, { children: /* @__PURE__ */ Q(H, { children: t.options?.map((e) => /* @__PURE__ */ $(H.Item, {
169
+ /* @__PURE__ */ $(we.InputGroup, { children: [/* @__PURE__ */ Q(R, { placeholder: t.placeholder }), /* @__PURE__ */ Q(we.Trigger, {})] }),
170
+ /* @__PURE__ */ Q(we.Popover, { children: /* @__PURE__ */ Q(H, { children: t.options?.map((e) => /* @__PURE__ */ $(H.Item, {
172
171
  id: e.value,
173
172
  textValue: typeof e.label == "string" ? e.label : e.value,
174
173
  children: [e.label, /* @__PURE__ */ Q(H.ItemIndicator, {})]
@@ -178,23 +177,23 @@ function et({ name: e, field: t, isPending: n, variant: r }) {
178
177
  });
179
178
  if (a === "date" || a === "datetime") {
180
179
  let r = a === "datetime";
181
- return /* @__PURE__ */ Q(De, {
180
+ return /* @__PURE__ */ Q(Ee, {
182
181
  className: "w-full [&[data-required=true]>.label]:after:content-none",
183
182
  name: e,
184
- defaultValue: r ? Qe(t.defaultValue) : Ze(t.defaultValue),
183
+ defaultValue: r ? Xe(t.defaultValue) : Ye(t.defaultValue),
185
184
  granularity: r ? "minute" : "day",
186
185
  isDisabled: n,
187
186
  isReadOnly: t.readOnly,
188
187
  isRequired: t.required,
189
188
  children: ({ state: n }) => /* @__PURE__ */ $(Z, { children: [
190
189
  /* @__PURE__ */ Q(B, { children: t.label }),
191
- /* @__PURE__ */ $(Ee.Group, {
190
+ /* @__PURE__ */ $(Te.Group, {
192
191
  variant: o,
193
192
  fullWidth: !0,
194
- children: [/* @__PURE__ */ Q(Ee.Input, { children: (e) => /* @__PURE__ */ Q(Ee.Segment, { segment: e }) }), /* @__PURE__ */ Q(Ee.Suffix, { children: /* @__PURE__ */ Q(De.Trigger, { children: /* @__PURE__ */ Q(De.TriggerIndicator, {}) }) })]
193
+ children: [/* @__PURE__ */ Q(Te.Input, { children: (e) => /* @__PURE__ */ Q(Te.Segment, { segment: e }) }), /* @__PURE__ */ Q(Te.Suffix, { children: /* @__PURE__ */ Q(Ee.Trigger, { children: /* @__PURE__ */ Q(Ee.TriggerIndicator, {}) }) })]
195
194
  }),
196
195
  /* @__PURE__ */ Q(F, {}),
197
- /* @__PURE__ */ $(De.Popover, {
196
+ /* @__PURE__ */ $(Ee.Popover, {
198
197
  className: "flex flex-col gap-3",
199
198
  children: [/* @__PURE__ */ $(A, {
200
199
  "aria-label": typeof t.label == "string" ? t.label : e,
@@ -209,14 +208,14 @@ function et({ name: e, field: t, isPending: n, variant: r }) {
209
208
  ]
210
209
  }), r && /* @__PURE__ */ $("div", {
211
210
  className: "flex items-center justify-between",
212
- children: [/* @__PURE__ */ Q(B, { children: i.settings.time }), /* @__PURE__ */ Q(Pe, {
211
+ children: [/* @__PURE__ */ Q(B, { children: i.settings.time }), /* @__PURE__ */ Q(Ne, {
213
212
  "aria-label": i.settings.time,
214
213
  granularity: "minute",
215
214
  value: n.timeValue,
216
215
  onChange: (e) => n.setTimeValue(e),
217
- children: /* @__PURE__ */ Q(Pe.Group, {
216
+ children: /* @__PURE__ */ Q(Ne.Group, {
218
217
  variant: "secondary",
219
- children: /* @__PURE__ */ Q(Pe.Input, { children: (e) => /* @__PURE__ */ Q(Pe.Segment, { segment: e }) })
218
+ children: /* @__PURE__ */ Q(Ne.Input, { children: (e) => /* @__PURE__ */ Q(Ne.Segment, { segment: e }) })
220
219
  })
221
220
  })]
222
221
  })]
@@ -224,15 +223,15 @@ function et({ name: e, field: t, isPending: n, variant: r }) {
224
223
  ] })
225
224
  });
226
225
  }
227
- return /* @__PURE__ */ Q(tt, {
226
+ return /* @__PURE__ */ Q($e, {
228
227
  name: e,
229
228
  field: t,
230
229
  isPending: n,
231
230
  variant: r
232
231
  });
233
232
  }
234
- function tt({ name: e, field: t, isPending: n, variant: r }) {
235
- let i = We(null), a = r === "transparent" ? "primary" : "secondary", o = t.prefix != null, s = t.suffix != null || t.copyable, c = t.type === "number", l = t.formatOptions?.maximumFractionDigits, u = c ? "number" : void 0, d = c ? l ? "decimal" : "numeric" : void 0, f = l ? 1 / 10 ** l : void 0;
233
+ function $e({ name: e, field: t, isPending: n, variant: r }) {
234
+ let i = Ue(null), a = r === "transparent" ? "primary" : "secondary", o = t.prefix != null, s = t.suffix != null || t.copyable, c = t.type === "number", l = t.formatOptions?.maximumFractionDigits, u = c ? "number" : void 0, d = c ? l ? "decimal" : "numeric" : void 0, f = l ? 1 / 10 ** l : void 0;
236
235
  return o || s ? /* @__PURE__ */ $(K, {
237
236
  name: e,
238
237
  defaultValue: t.defaultValue == null ? void 0 : String(t.defaultValue),
@@ -254,7 +253,7 @@ function tt({ name: e, field: t, isPending: n, variant: r }) {
254
253
  }),
255
254
  t.copyable ? /* @__PURE__ */ Q(z.Suffix, {
256
255
  className: "px-0",
257
- children: /* @__PURE__ */ Q($e, {
256
+ children: /* @__PURE__ */ Q(Ze, {
258
257
  getValue: () => i.current?.value,
259
258
  isDisabled: n
260
259
  })
@@ -283,14 +282,54 @@ function tt({ name: e, field: t, isPending: n, variant: r }) {
283
282
  });
284
283
  }
285
284
  //#endregion
285
+ //#region src/components/auth/reset-link-sent.tsx
286
+ var et = "better-auth-ui.reset-link-sent";
287
+ function tt({ className: e, variant: t }) {
288
+ let { basePaths: n, localization: i, viewPaths: a } = h(), [o, s] = X(Pe() && sessionStorage.getItem("better-auth-ui.reset-link-sent") || "");
289
+ return Y(() => {
290
+ s(sessionStorage.getItem("better-auth-ui.reset-link-sent") ?? "");
291
+ }, []), /* @__PURE__ */ $(j, {
292
+ className: q("w-full max-w-sm gap-4 md:p-6", e),
293
+ variant: t,
294
+ children: [
295
+ /* @__PURE__ */ Q(j.Header, { children: /* @__PURE__ */ Q(j.Title, {
296
+ className: "text-xl font-semibold mb-1",
297
+ children: i.auth.checkYourEmailTitle
298
+ }) }),
299
+ /* @__PURE__ */ $(j.Content, {
300
+ className: "gap-4",
301
+ children: [/* @__PURE__ */ Q(N, {
302
+ className: "text-sm",
303
+ children: o ? i.auth.resetLinkSentTo.replace("{{email}}", o) : i.auth.passwordResetEmailSent
304
+ }), o && /* @__PURE__ */ Q(r, { email: o })]
305
+ }),
306
+ /* @__PURE__ */ Q(j.Footer, {
307
+ className: "flex-col gap-3",
308
+ children: /* @__PURE__ */ $(N, {
309
+ className: "text-sm",
310
+ children: [
311
+ i.auth.rememberYourPassword,
312
+ " ",
313
+ /* @__PURE__ */ Q(V, {
314
+ href: `${n.auth}/${a.auth.signIn}`,
315
+ className: "text-accent no-underline hover:underline decoration-accent-hover",
316
+ children: i.auth.signIn
317
+ })
318
+ ]
319
+ })
320
+ })
321
+ ]
322
+ });
323
+ }
324
+ //#endregion
286
325
  //#region src/components/auth/forgot-password.tsx
287
326
  function nt({ className: e, variant: t }) {
288
- let { authClient: n, baseURL: r, basePaths: i, localization: a, viewPaths: o, navigate: s, plugins: c } = h(), { fetchOptions: l, resetFetchOptions: u } = y(), { mutate: d, isPending: f } = S(n, {
327
+ let { authClient: n, baseURL: r, basePaths: i, localization: a, viewPaths: o, navigate: s, plugins: c } = h(), { fetchOptions: l, resetFetchOptions: u } = y(), { mutate: d, isPending: f } = C(n, {
289
328
  onError: () => {
290
329
  u();
291
330
  },
292
- onSuccess: () => {
293
- J.success(a.auth.passwordResetEmailSent), s({ to: `${i.auth}/${o.auth.signIn}` });
331
+ onSuccess: (e, { email: t }) => {
332
+ sessionStorage.setItem(et, t), s({ to: `${i.auth}/${o.auth.resetLinkSent}` });
294
333
  }
295
334
  });
296
335
  function p(e) {
@@ -374,7 +413,7 @@ function nt({ className: e, variant: t }) {
374
413
  //#endregion
375
414
  //#region src/components/auth/reset-password.tsx
376
415
  function rt({ className: e, variant: t }) {
377
- let { authClient: n, basePaths: r, emailAndPassword: i, localization: a, viewPaths: o, navigate: s } = h(), { mutate: c, isPending: l } = te(n, { onSuccess: () => {
416
+ let { authClient: n, basePaths: r, emailAndPassword: i, localization: a, viewPaths: o, navigate: s } = h(), { mutate: c, isPending: l } = ee(n, { onSuccess: () => {
378
417
  J.success(a.auth.passwordResetSuccess), s({ to: `${r.auth}/${o.auth.signIn}` });
379
418
  } }), [u, d] = X(!1), [f, p] = X(!1);
380
419
  Y(() => {
@@ -525,25 +564,25 @@ function rt({ className: e, variant: t }) {
525
564
  }
526
565
  //#endregion
527
566
  //#region src/components/auth/sign-in.tsx
528
- function it({ className: t, socialLayout: n, socialPosition: i = "bottom", variant: o }) {
529
- let { authClient: s, basePaths: c, emailAndPassword: l, localization: u, plugins: d, redirectTo: f, socialProviders: p, viewPaths: m, navigate: g } = h(), { fetchOptions: _, resetFetchOptions: v } = y(), [b, x] = X(""), { mutate: ee, isPending: S } = T(s, {
567
+ function it({ className: t, socialLayout: n, socialPosition: r = "bottom", variant: a }) {
568
+ let { authClient: s, basePaths: c, emailAndPassword: l, localization: u, plugins: d, redirectTo: f, socialProviders: p, viewPaths: m, navigate: g } = h(), { fetchOptions: _, resetFetchOptions: v } = y(), [b, x] = X(""), { mutate: S, isPending: C } = ne(s, {
530
569
  onError: (e, { email: t }) => {
531
570
  x(""), e.error?.code === "EMAIL_NOT_VERIFIED" && (sessionStorage.setItem("better-auth-ui.verify-email", t), g({ to: `${c.auth}/${m.auth.verifyEmail}` })), v();
532
571
  },
533
572
  onSuccess: () => g({ to: f })
534
- }), te = (e) => {
573
+ }), ee = (e) => {
535
574
  e.preventDefault();
536
575
  let t = new FormData(e.currentTarget), n = t.get("email"), r = t.get("rememberMe") === "on";
537
- ee({
576
+ S({
538
577
  email: n,
539
578
  password: b,
540
579
  ...l?.rememberMe ? { rememberMe: r } : {},
541
580
  fetchOptions: _
542
581
  });
543
- }, C = qe({ mutationKey: a.signIn.all }) + qe({ mutationKey: a.signUp.all }) > 0, ne = d.find((e) => e.captchaComponent)?.captchaComponent, w = l?.enabled && !!p?.length;
582
+ }, w = Ke({ mutationKey: o.signIn.all }) + Ke({ mutationKey: o.signUp.all }) > 0, te = d.find((e) => e.captchaComponent)?.captchaComponent, T = l?.enabled && !!p?.length;
544
583
  return /* @__PURE__ */ $(j, {
545
584
  className: q("w-full max-w-sm gap-4 md:p-6", t),
546
- variant: o,
585
+ variant: a,
547
586
  children: [
548
587
  /* @__PURE__ */ Q(j.Header, { children: /* @__PURE__ */ Q(j.Title, {
549
588
  className: "text-xl font-semibold mb-1",
@@ -552,16 +591,16 @@ function it({ className: t, socialLayout: n, socialPosition: i = "bottom", varia
552
591
  /* @__PURE__ */ $(j.Content, {
553
592
  className: "gap-4",
554
593
  children: [
555
- i === "top" && /* @__PURE__ */ $(Z, { children: [!!p?.length && /* @__PURE__ */ Q(r, { socialLayout: n }), w && /* @__PURE__ */ Q(e, { children: u.auth.or })] }),
594
+ r === "top" && /* @__PURE__ */ $(Z, { children: [!!p?.length && /* @__PURE__ */ Q(i, { socialLayout: n }), T && /* @__PURE__ */ Q(e, { children: u.auth.or })] }),
556
595
  l?.enabled && /* @__PURE__ */ $(L, {
557
- onSubmit: te,
596
+ onSubmit: ee,
558
597
  className: "flex flex-col gap-4",
559
598
  children: [
560
599
  /* @__PURE__ */ $(K, {
561
600
  name: "email",
562
601
  type: "email",
563
602
  autoComplete: "email",
564
- isDisabled: C,
603
+ isDisabled: w,
565
604
  validate: (e) => {
566
605
  if (!e) return u.auth.fieldRequired;
567
606
  if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)) return u.auth.invalidEmail;
@@ -570,7 +609,7 @@ function it({ className: t, socialLayout: n, socialPosition: i = "bottom", varia
570
609
  /* @__PURE__ */ Q(B, { children: u.auth.email }),
571
610
  /* @__PURE__ */ Q(R, {
572
611
  placeholder: u.auth.emailPlaceholder,
573
- variant: o === "transparent" ? "primary" : "secondary",
612
+ variant: a === "transparent" ? "primary" : "secondary",
574
613
  required: !0
575
614
  }),
576
615
  /* @__PURE__ */ Q(F, {})
@@ -582,7 +621,7 @@ function it({ className: t, socialLayout: n, socialPosition: i = "bottom", varia
582
621
  name: "password",
583
622
  type: "password",
584
623
  autoComplete: "current-password",
585
- isDisabled: C,
624
+ isDisabled: w,
586
625
  value: b,
587
626
  onChange: x,
588
627
  validate: (e) => {
@@ -595,7 +634,7 @@ function it({ className: t, socialLayout: n, socialPosition: i = "bottom", varia
595
634
  /* @__PURE__ */ Q(B, { children: u.auth.password }),
596
635
  /* @__PURE__ */ Q(R, {
597
636
  placeholder: u.auth.passwordPlaceholder,
598
- variant: o === "transparent" ? "primary" : "secondary",
637
+ variant: a === "transparent" ? "primary" : "secondary",
599
638
  required: !0
600
639
  }),
601
640
  /* @__PURE__ */ Q(F, {})
@@ -603,21 +642,21 @@ function it({ className: t, socialLayout: n, socialPosition: i = "bottom", varia
603
642
  }),
604
643
  l?.rememberMe && /* @__PURE__ */ Q(M, {
605
644
  name: "rememberMe",
606
- isDisabled: C,
607
- variant: o === "transparent" ? "primary" : "secondary",
645
+ isDisabled: w,
646
+ variant: a === "transparent" ? "primary" : "secondary",
608
647
  children: /* @__PURE__ */ $(M.Content, { children: [/* @__PURE__ */ Q(M.Control, { children: /* @__PURE__ */ Q(M.Indicator, {}) }), u.auth.rememberMe] })
609
648
  }),
610
- ne && /* @__PURE__ */ Q("div", {
649
+ te && /* @__PURE__ */ Q("div", {
611
650
  className: "flex justify-center",
612
- children: ne
651
+ children: te
613
652
  }),
614
653
  /* @__PURE__ */ $("div", {
615
654
  className: "flex flex-col gap-3",
616
655
  children: [/* @__PURE__ */ $(k, {
617
656
  type: "submit",
618
657
  className: "w-full",
619
- isPending: C,
620
- children: [S && /* @__PURE__ */ Q(W, {
658
+ isPending: w,
659
+ children: [C && /* @__PURE__ */ Q(W, {
621
660
  color: "current",
622
661
  size: "sm"
623
662
  }), u.auth.signIn]
@@ -625,7 +664,7 @@ function it({ className: t, socialLayout: n, socialPosition: i = "bottom", varia
625
664
  })
626
665
  ]
627
666
  }),
628
- i === "bottom" && /* @__PURE__ */ $(Z, { children: [w && /* @__PURE__ */ Q(e, { children: u.auth.or }), !!p?.length && /* @__PURE__ */ Q(r, { socialLayout: n })] })
667
+ r === "bottom" && /* @__PURE__ */ $(Z, { children: [T && /* @__PURE__ */ Q(e, { children: u.auth.or }), !!p?.length && /* @__PURE__ */ Q(i, { socialLayout: n })] })
629
668
  ]
630
669
  }),
631
670
  /* @__PURE__ */ $(j.Footer, {
@@ -664,7 +703,7 @@ function at({ className: e }) {
664
703
  to: `${n.auth}/${i.auth.signIn}`,
665
704
  replace: !0
666
705
  })
667
- }), o = We(!1);
706
+ }), o = Ue(!1);
668
707
  return Y(() => {
669
708
  o.current || (o.current = !0, a());
670
709
  }, [a]), /* @__PURE__ */ Q(W, {
@@ -674,19 +713,19 @@ function at({ className: e }) {
674
713
  }
675
714
  //#endregion
676
715
  //#region src/components/auth/sign-up.tsx
677
- function ot({ className: t, socialLayout: n, socialPosition: i = "bottom", variant: o }) {
678
- let { additionalFields: s, authClient: c, basePaths: l, emailAndPassword: d, localization: f, plugins: p, redirectTo: m, socialProviders: g, viewPaths: _, navigate: v } = h(), { fetchOptions: b, resetFetchOptions: x } = y(), [ee, S] = X(""), [te, C] = X(""), { mutate: ne, isPending: w } = ie(c, {
716
+ function ot({ className: t, socialLayout: n, socialPosition: r = "bottom", variant: a }) {
717
+ let { additionalFields: s, authClient: c, basePaths: l, emailAndPassword: d, localization: f, plugins: p, redirectTo: m, socialProviders: g, viewPaths: _, navigate: v } = h(), { fetchOptions: b, resetFetchOptions: x } = y(), [S, C] = X(""), [ee, w] = X(""), { mutate: te, isPending: T } = ie(c, {
679
718
  onError: () => {
680
- S(""), C(""), x();
719
+ C(""), w(""), x();
681
720
  },
682
721
  onSuccess: (e, { email: t }) => {
683
722
  d?.requireEmailVerification ? (sessionStorage.setItem("better-auth-ui.verify-email", t), v({ to: `${l.auth}/${_.auth.verifyEmail}` })) : v({ to: m });
684
723
  }
685
- }), [T, re] = X(!1), [ae, oe] = X(!1), E = qe({ mutationKey: a.signIn.all }) + qe({ mutationKey: a.signUp.all }) > 0, se = p.find((e) => e.captchaComponent)?.captchaComponent, ce = async (e) => {
724
+ }), [ne, re] = X(!1), [ae, oe] = X(!1), E = Ke({ mutationKey: o.signIn.all }) + Ke({ mutationKey: o.signUp.all }) > 0, se = p.find((e) => e.captchaComponent)?.captchaComponent, ce = async (e) => {
686
725
  e.preventDefault();
687
726
  let t = new FormData(e.currentTarget), n = t.get("name") ?? "", r = t.get("email");
688
- if (d?.confirmPassword && ee !== te) {
689
- J.danger(f.auth.passwordsDoNotMatch), S(""), C("");
727
+ if (d?.confirmPassword && S !== ee) {
728
+ J.danger(f.auth.passwordsDoNotMatch), C(""), w("");
690
729
  return;
691
730
  }
692
731
  let i = {};
@@ -701,17 +740,17 @@ function ot({ className: t, socialLayout: n, socialPosition: i = "bottom", varia
701
740
  }
702
741
  n !== void 0 && (i[e.name] = n);
703
742
  }
704
- ne({
743
+ te({
705
744
  name: n,
706
745
  email: r,
707
- password: ee,
746
+ password: S,
708
747
  ...i,
709
748
  fetchOptions: b
710
749
  });
711
750
  }, le = d?.enabled && !!g?.length;
712
751
  return /* @__PURE__ */ $(j, {
713
752
  className: q("w-full max-w-sm gap-4 md:p-6", t),
714
- variant: o,
753
+ variant: a,
715
754
  children: [
716
755
  /* @__PURE__ */ Q(j.Header, { children: /* @__PURE__ */ Q(j.Title, {
717
756
  className: "text-xl font-semibold mb-1",
@@ -720,7 +759,7 @@ function ot({ className: t, socialLayout: n, socialPosition: i = "bottom", varia
720
759
  /* @__PURE__ */ $(j.Content, {
721
760
  className: "gap-4",
722
761
  children: [
723
- i === "top" && /* @__PURE__ */ $(Z, { children: [!!g?.length && /* @__PURE__ */ Q(r, { socialLayout: n }), le && /* @__PURE__ */ Q(e, { children: f.auth.or })] }),
762
+ r === "top" && /* @__PURE__ */ $(Z, { children: [!!g?.length && /* @__PURE__ */ Q(i, { socialLayout: n }), le && /* @__PURE__ */ Q(e, { children: f.auth.or })] }),
724
763
  d?.enabled && /* @__PURE__ */ $(L, {
725
764
  onSubmit: ce,
726
765
  className: "flex flex-col gap-4",
@@ -738,7 +777,7 @@ function ot({ className: t, socialLayout: n, socialPosition: i = "bottom", varia
738
777
  /* @__PURE__ */ Q(R, {
739
778
  placeholder: f.auth.namePlaceholder,
740
779
  required: !0,
741
- variant: o === "transparent" ? "primary" : "secondary"
780
+ variant: a === "transparent" ? "primary" : "secondary"
742
781
  }),
743
782
  /* @__PURE__ */ Q(F, {})
744
783
  ]
@@ -757,16 +796,16 @@ function ot({ className: t, socialLayout: n, socialPosition: i = "bottom", varia
757
796
  /* @__PURE__ */ Q(R, {
758
797
  placeholder: f.auth.emailPlaceholder,
759
798
  required: !0,
760
- variant: o === "transparent" ? "primary" : "secondary"
799
+ variant: a === "transparent" ? "primary" : "secondary"
761
800
  }),
762
801
  /* @__PURE__ */ Q(F, {})
763
802
  ]
764
803
  }),
765
- s?.map((e) => e.signUp === "above" && /* @__PURE__ */ Q(et, {
804
+ s?.map((e) => e.signUp === "above" && /* @__PURE__ */ Q(Qe, {
766
805
  name: e.name,
767
806
  field: e,
768
807
  isPending: E,
769
- variant: o
808
+ variant: a
770
809
  }, e.name)),
771
810
  /* @__PURE__ */ $(K, {
772
811
  minLength: d?.minPasswordLength,
@@ -774,8 +813,8 @@ function ot({ className: t, socialLayout: n, socialPosition: i = "bottom", varia
774
813
  name: "password",
775
814
  autoComplete: "new-password",
776
815
  isDisabled: E,
777
- value: ee,
778
- onChange: S,
816
+ value: S,
817
+ onChange: C,
779
818
  validate: (e) => {
780
819
  if (!e) return f.auth.fieldRequired;
781
820
  let t = d?.minPasswordLength, n = d?.maxPasswordLength;
@@ -785,22 +824,22 @@ function ot({ className: t, socialLayout: n, socialPosition: i = "bottom", varia
785
824
  children: [
786
825
  /* @__PURE__ */ Q(B, { children: f.auth.password }),
787
826
  /* @__PURE__ */ $(z, {
788
- variant: o === "transparent" ? "primary" : "secondary",
827
+ variant: a === "transparent" ? "primary" : "secondary",
789
828
  children: [/* @__PURE__ */ Q(z.Input, {
790
829
  placeholder: f.auth.passwordPlaceholder,
791
- type: T ? "text" : "password",
830
+ type: ne ? "text" : "password",
792
831
  name: "password",
793
832
  required: !0
794
833
  }), /* @__PURE__ */ Q(z.Suffix, {
795
834
  className: "px-0",
796
835
  children: /* @__PURE__ */ Q(k, {
797
836
  isIconOnly: !0,
798
- "aria-label": T ? f.auth.hidePassword : f.auth.showPassword,
837
+ "aria-label": ne ? f.auth.hidePassword : f.auth.showPassword,
799
838
  size: "sm",
800
839
  variant: "ghost",
801
- onPress: () => re(!T),
840
+ onPress: () => re(!ne),
802
841
  isDisabled: E,
803
- children: Q(T ? O : D, {})
842
+ children: Q(ne ? O : D, {})
804
843
  })
805
844
  })]
806
845
  }),
@@ -813,8 +852,8 @@ function ot({ className: t, socialLayout: n, socialPosition: i = "bottom", varia
813
852
  name: "confirmPassword",
814
853
  autoComplete: "new-password",
815
854
  isDisabled: E,
816
- value: te,
817
- onChange: C,
855
+ value: ee,
856
+ onChange: w,
818
857
  validate: (e) => {
819
858
  if (!e) return f.auth.fieldRequired;
820
859
  let t = d?.minPasswordLength, n = d?.maxPasswordLength;
@@ -824,7 +863,7 @@ function ot({ className: t, socialLayout: n, socialPosition: i = "bottom", varia
824
863
  children: [
825
864
  /* @__PURE__ */ Q(B, { children: f.auth.confirmPassword }),
826
865
  /* @__PURE__ */ $(z, {
827
- variant: o === "transparent" ? "primary" : "secondary",
866
+ variant: a === "transparent" ? "primary" : "secondary",
828
867
  children: [/* @__PURE__ */ Q(z.Input, {
829
868
  name: "confirmPassword",
830
869
  placeholder: f.auth.confirmPasswordPlaceholder,
@@ -846,11 +885,11 @@ function ot({ className: t, socialLayout: n, socialPosition: i = "bottom", varia
846
885
  /* @__PURE__ */ Q(F, {})
847
886
  ]
848
887
  }),
849
- s?.map((e) => e.signUp && e.signUp !== "above" && /* @__PURE__ */ Q(et, {
888
+ s?.map((e) => e.signUp && e.signUp !== "above" && /* @__PURE__ */ Q(Qe, {
850
889
  name: e.name,
851
890
  field: e,
852
891
  isPending: E,
853
- variant: o
892
+ variant: a
854
893
  }, e.name)),
855
894
  se && /* @__PURE__ */ Q("div", {
856
895
  className: "flex justify-center",
@@ -862,7 +901,7 @@ function ot({ className: t, socialLayout: n, socialPosition: i = "bottom", varia
862
901
  type: "submit",
863
902
  className: "w-full",
864
903
  isPending: E,
865
- children: [w && /* @__PURE__ */ Q(W, {
904
+ children: [T && /* @__PURE__ */ Q(W, {
866
905
  color: "current",
867
906
  size: "sm"
868
907
  }), f.auth.signUp]
@@ -870,7 +909,7 @@ function ot({ className: t, socialLayout: n, socialPosition: i = "bottom", varia
870
909
  })
871
910
  ]
872
911
  }),
873
- i === "bottom" && /* @__PURE__ */ $(Z, { children: [le && /* @__PURE__ */ Q(e, { children: f.auth.or }), !!g?.length && /* @__PURE__ */ Q(r, { socialLayout: n })] })
912
+ r === "bottom" && /* @__PURE__ */ $(Z, { children: [le && /* @__PURE__ */ Q(e, { children: f.auth.or }), !!g?.length && /* @__PURE__ */ Q(i, { socialLayout: n })] })
874
913
  ]
875
914
  }),
876
915
  /* @__PURE__ */ Q(j.Footer, {
@@ -892,42 +931,21 @@ function ot({ className: t, socialLayout: n, socialPosition: i = "bottom", varia
892
931
  });
893
932
  }
894
933
  //#endregion
895
- //#region src/components/auth/open-email-button.tsx
896
- function st({ email: e, className: t }) {
897
- let { localization: n } = h(), r = c(e);
898
- return r ? /* @__PURE__ */ $(V, {
899
- href: r.loginUrl,
900
- target: "_blank",
901
- rel: "noopener noreferrer",
902
- className: q(Ye({ variant: "primary" }), "w-full gap-2", t),
903
- children: [n.auth.openEmailProvider.replace("{{provider}}", r.companyProvider), /* @__PURE__ */ Q(ce, { className: "size-3" })]
904
- }) : null;
905
- }
906
- //#endregion
907
934
  //#region src/components/auth/verify-email.tsx
908
- var ct = 60;
909
- function lt({ className: e, variant: t }) {
910
- let { authClient: n, basePaths: r, baseURL: i, localization: a, navigate: o, redirectTo: s, viewPaths: c } = h(), [l, u] = X(Fe() && sessionStorage.getItem("better-auth-ui.verify-email") || ""), [d, f] = X(ct);
935
+ var st = 60;
936
+ function ct({ className: e, variant: t }) {
937
+ let { authClient: n, basePaths: i, baseURL: a, localization: o, redirectTo: s, viewPaths: c } = h(), [l, u] = X(Pe() && sessionStorage.getItem("better-auth-ui.verify-email") || ""), [d, f] = X(st);
911
938
  Y(() => {
912
- let e = sessionStorage.getItem("better-auth-ui.verify-email");
913
- if (!e) {
914
- o({ to: `${r.auth}/${c.auth.signIn}` });
915
- return;
916
- }
917
- u(e);
918
- }, [
919
- r.auth,
920
- o,
921
- c.auth.signIn
922
- ]), Y(() => {
923
- if (d <= 0) return;
939
+ u(sessionStorage.getItem("better-auth-ui.verify-email") ?? "");
940
+ }, []), Y(() => {
941
+ if (d <= 0 || !l) return;
924
942
  let e = setInterval(() => {
925
943
  f((e) => e > 0 ? e - 1 : 0);
926
944
  }, 1e3);
927
945
  return () => clearInterval(e);
928
- }, [d]);
929
- let { mutate: p, isPending: m } = ne(n, { onSuccess: () => {
930
- J.success(a.auth.verificationEmailSent), f(ct);
946
+ }, [d, l]);
947
+ let { mutate: p, isPending: m } = te(n, { onSuccess: () => {
948
+ J.success(o.auth.verificationEmailSent), f(st);
931
949
  } }), g = d > 0;
932
950
  return /* @__PURE__ */ $(j, {
933
951
  className: q("w-full max-w-sm gap-4 md:p-6", e),
@@ -935,28 +953,28 @@ function lt({ className: e, variant: t }) {
935
953
  children: [
936
954
  /* @__PURE__ */ Q(j.Header, { children: /* @__PURE__ */ Q(j.Title, {
937
955
  className: "text-xl font-semibold mb-1",
938
- children: a.auth.verifyEmail
956
+ children: o.auth.verifyEmail
939
957
  }) }),
940
958
  /* @__PURE__ */ $(j.Content, {
941
959
  className: "gap-4",
942
960
  children: [/* @__PURE__ */ Q(N, {
943
961
  className: "text-sm",
944
- children: a.auth.checkYourEmail
945
- }), /* @__PURE__ */ $("div", {
962
+ children: o.auth.checkYourEmail
963
+ }), l && /* @__PURE__ */ $("div", {
946
964
  className: "flex flex-col gap-3",
947
- children: [/* @__PURE__ */ Q(st, { email: l }), /* @__PURE__ */ $(k, {
965
+ children: [/* @__PURE__ */ Q(r, { email: l }), /* @__PURE__ */ $(k, {
948
966
  className: "w-full",
949
967
  variant: "tertiary",
950
968
  isDisabled: !l || g || m,
951
969
  isPending: m,
952
970
  onPress: () => p({
953
971
  email: l,
954
- callbackURL: `${i}${s}`
972
+ callbackURL: `${a}${s}`
955
973
  }),
956
974
  children: [m && /* @__PURE__ */ Q(W, {
957
975
  color: "current",
958
976
  size: "sm"
959
- }), g ? a.auth.resendIn.replace("{{seconds}}", String(d)) : a.auth.resend]
977
+ }), g ? o.auth.resendIn.replace("{{seconds}}", String(d)) : o.auth.resend]
960
978
  })]
961
979
  })]
962
980
  }),
@@ -965,12 +983,12 @@ function lt({ className: e, variant: t }) {
965
983
  children: /* @__PURE__ */ $(N, {
966
984
  className: "text-sm",
967
985
  children: [
968
- a.auth.alreadyVerifiedYourEmail,
986
+ o.auth.alreadyVerifiedYourEmail,
969
987
  " ",
970
988
  /* @__PURE__ */ Q(V, {
971
- href: `${r.auth}/${c.auth.signIn}`,
989
+ href: `${i.auth}/${c.auth.signIn}`,
972
990
  className: "text-accent no-underline hover:underline decoration-accent-hover",
973
- children: a.auth.signIn
991
+ children: o.auth.signIn
974
992
  })
975
993
  ]
976
994
  })
@@ -980,22 +998,24 @@ function lt({ className: e, variant: t }) {
980
998
  }
981
999
  //#endregion
982
1000
  //#region src/components/auth/auth.tsx
983
- var ut = [
1001
+ var lt = [
984
1002
  "signUp",
985
1003
  "forgotPassword",
986
- "resetPassword"
987
- ], dt = {
1004
+ "resetPassword",
1005
+ "resetLinkSent"
1006
+ ], ut = {
988
1007
  signIn: it,
989
1008
  signOut: at,
990
1009
  signUp: ot,
991
1010
  forgotPassword: nt,
992
1011
  resetPassword: rt,
993
- verifyEmail: lt
1012
+ resetLinkSent: tt,
1013
+ verifyEmail: ct
994
1014
  };
995
- function ft({ className: e, path: t, socialLayout: n, socialPosition: r, variant: i, view: a }) {
1015
+ function dt({ className: e, path: t, socialLayout: n, socialPosition: r, variant: i, view: a }) {
996
1016
  let { basePaths: o, emailAndPassword: s, plugins: c, viewPaths: l, navigate: u } = h();
997
1017
  if (!a && !t) throw Error("[Better Auth UI] Either `view` or `path` must be provided");
998
- let d = a || Object.keys(l.auth).find((e) => l.auth[e] === t), f = !s?.enabled && d && ut.includes(d);
1018
+ let d = a || Object.keys(l.auth).find((e) => l.auth[e] === t), f = !s?.enabled && d && lt.includes(d);
999
1019
  if (Y(() => {
1000
1020
  f && u({
1001
1021
  to: `${o.auth}/${l.auth.signIn}`,
@@ -1027,8 +1047,8 @@ function ft({ className: e, path: t, socialLayout: n, socialPosition: r, variant
1027
1047
  variant: i
1028
1048
  });
1029
1049
  }
1030
- let p = d ? dt[d] : void 0;
1031
- if (!p) throw Error(`[Better Auth UI] Unknown view "${d}". Valid views are: ${Object.keys(dt).join(", ")}`);
1050
+ let p = d ? ut[d] : void 0;
1051
+ if (!p) throw Error(`[Better Auth UI] Unknown view "${d}". Valid views are: ${Object.keys(ut).join(", ")}`);
1032
1052
  return /* @__PURE__ */ Q(p, {
1033
1053
  className: e,
1034
1054
  socialLayout: n,
@@ -1038,18 +1058,18 @@ function ft({ className: e, path: t, socialLayout: n, socialPosition: r, variant
1038
1058
  }
1039
1059
  //#endregion
1040
1060
  //#region src/components/auth/error-toaster.tsx
1041
- function pt() {
1042
- let e = Je();
1061
+ function ft() {
1062
+ let e = qe();
1043
1063
  return Y(() => {
1044
1064
  let t = e.getQueryCache(), n = t.config.onError;
1045
1065
  t.config.onError = (e, t) => {
1046
- if (n?.(e, t), !Ke({ queryKey: o.all }, t)) return;
1066
+ if (n?.(e, t), !Ge({ queryKey: s.all }, t)) return;
1047
1067
  let r = e;
1048
1068
  r?.error?.code !== "EMAIL_NOT_VERIFIED" && r?.error && J.danger(r.error.message);
1049
1069
  };
1050
1070
  let r = e.getMutationCache(), i = r.config.onError;
1051
- return r.config.onError = (e, t, n, r, o) => {
1052
- if (i?.(e, t, n, r, o), !Ge({ mutationKey: a.all }, r)) return;
1071
+ return r.config.onError = (e, t, n, r, a) => {
1072
+ if (i?.(e, t, n, r, a), !We({ mutationKey: o.all }, r)) return;
1053
1073
  let s = e;
1054
1074
  s.error?.code !== "EMAIL_NOT_VERIFIED" && J.danger(s.error?.message || s.message);
1055
1075
  }, () => {
@@ -1059,20 +1079,20 @@ function pt() {
1059
1079
  }
1060
1080
  //#endregion
1061
1081
  //#region src/components/auth/auth-provider.tsx
1062
- function mt({ children: e, navigate: t, ...n }) {
1082
+ function pt({ children: e, navigate: t, ...n }) {
1063
1083
  return /* @__PURE__ */ Q(f, {
1064
1084
  navigate: t,
1065
1085
  ...n,
1066
- children: /* @__PURE__ */ $(ke, {
1086
+ children: /* @__PURE__ */ $(Oe, {
1067
1087
  navigate: (e) => t({ to: e }),
1068
- children: [e, /* @__PURE__ */ Q(pt, {})]
1088
+ children: [e, /* @__PURE__ */ Q(ft, {})]
1069
1089
  })
1070
1090
  });
1071
1091
  }
1072
1092
  //#endregion
1073
1093
  //#region src/components/auth/settings/account/change-email.tsx
1074
- function ht({ className: e, variant: t, ...n }) {
1075
- let { authClient: r, localization: i, baseURL: a, viewPaths: o } = h(), { data: s } = w(r), { mutate: c, isPending: l } = _(r, { onSuccess: () => J.success(i.settings.changeEmailSuccess) });
1094
+ function mt({ className: e, variant: t, ...n }) {
1095
+ let { authClient: r, localization: i, baseURL: a, viewPaths: o } = h(), { data: s } = T(r), { mutate: c, isPending: l } = _(r, { onSuccess: () => J.success(i.settings.changeEmailSuccess) });
1076
1096
  function u(e) {
1077
1097
  e.preventDefault(), c({
1078
1098
  newEmail: new FormData(e.currentTarget).get("email"),
@@ -1121,15 +1141,15 @@ function ht({ className: e, variant: t, ...n }) {
1121
1141
  }
1122
1142
  //#endregion
1123
1143
  //#region src/components/auth/settings/account/change-avatar.tsx
1124
- function gt({ className: e }) {
1125
- let { authClient: t, localization: r, avatar: i } = h(), { data: a } = w(t), { mutate: o, isPending: c } = oe(t), l = We(null), [u, d] = X(!1), [f, p] = X(!1), m = c || u || f;
1144
+ function ht({ className: e }) {
1145
+ let { authClient: t, localization: r, avatar: i } = h(), { data: a } = T(t), { mutate: o, isPending: s } = oe(t), l = Ue(null), [u, d] = X(!1), [f, p] = X(!1), m = s || u || f;
1126
1146
  async function g(e) {
1127
1147
  let t = e.target.files?.[0];
1128
1148
  if (t) {
1129
1149
  e.target.value = "", d(!0);
1130
1150
  try {
1131
1151
  let e = await i.resize?.(t, i.size, i.extension) || t;
1132
- o({ image: await i.upload?.(e) || await s(e) }, { onSuccess: () => J.success(r.settings.avatarChangedSuccess) });
1152
+ o({ image: await i.upload?.(e) || await c(e) }, { onSuccess: () => J.success(r.settings.avatarChangedSuccess) });
1133
1153
  } catch (e) {
1134
1154
  e instanceof Error && J.danger(e.message);
1135
1155
  }
@@ -1187,13 +1207,13 @@ function gt({ className: e }) {
1187
1207
  children: /* @__PURE__ */ $(P.Menu, { children: [/* @__PURE__ */ $(P.Item, {
1188
1208
  textValue: r.settings.uploadAvatar,
1189
1209
  onAction: () => l.current?.click(),
1190
- children: [/* @__PURE__ */ Q(de, { className: "text-muted" }), /* @__PURE__ */ Q(B, { children: r.settings.uploadAvatar })]
1210
+ children: [/* @__PURE__ */ Q(ue, { className: "text-muted" }), /* @__PURE__ */ Q(B, { children: r.settings.uploadAvatar })]
1191
1211
  }), /* @__PURE__ */ $(P.Item, {
1192
1212
  textValue: r.settings.deleteAvatar,
1193
1213
  isDisabled: !a?.user.image,
1194
1214
  onAction: _,
1195
1215
  variant: "danger",
1196
- children: [/* @__PURE__ */ Q(Se, { className: "text-danger" }), /* @__PURE__ */ Q(B, { children: r.settings.deleteAvatar })]
1216
+ children: [/* @__PURE__ */ Q(xe, { className: "text-danger" }), /* @__PURE__ */ Q(B, { children: r.settings.deleteAvatar })]
1197
1217
  })] })
1198
1218
  })] })]
1199
1219
  })
@@ -1202,8 +1222,8 @@ function gt({ className: e }) {
1202
1222
  }
1203
1223
  //#endregion
1204
1224
  //#region src/components/auth/settings/account/user-profile.tsx
1205
- function _t({ className: e, variant: t, ...n }) {
1206
- let { additionalFields: r, authClient: i, localization: a } = h(), { data: o } = w(i), { mutate: s, isPending: c } = oe(i, { onSuccess: () => J.success(a.settings.profileUpdatedSuccess) });
1225
+ function gt({ className: e, variant: t, ...n }) {
1226
+ let { additionalFields: r, authClient: i, localization: a } = h(), { data: o } = T(i), { mutate: s, isPending: c } = oe(i, { onSuccess: () => J.success(a.settings.profileUpdatedSuccess) });
1207
1227
  async function l(e) {
1208
1228
  e.preventDefault();
1209
1229
  let t = new FormData(e.currentTarget), n = t.get("name"), i = {};
@@ -1234,7 +1254,7 @@ function _t({ className: e, variant: t, ...n }) {
1234
1254
  onSubmit: l,
1235
1255
  className: "flex flex-col gap-4",
1236
1256
  children: [
1237
- /* @__PURE__ */ Q(gt, {}),
1257
+ /* @__PURE__ */ Q(ht, {}),
1238
1258
  /* @__PURE__ */ $(K, {
1239
1259
  name: "name",
1240
1260
  defaultValue: o?.user.name,
@@ -1254,7 +1274,7 @@ function _t({ className: e, variant: t, ...n }) {
1254
1274
  r?.filter((e) => e.profile !== !1).map((e) => {
1255
1275
  if (!o) return e.inputType === "hidden" ? null : /* @__PURE__ */ Q(U, { className: "h-10 md:h-9 w-full rounded-xl" }, e.name);
1256
1276
  let n = o.user[e.name], r = `${o.user.id}-${e.name}-${n instanceof Date ? n.toISOString() : String(n ?? "")}`;
1257
- return /* @__PURE__ */ Q(et, {
1277
+ return /* @__PURE__ */ Q(Qe, {
1258
1278
  name: e.name,
1259
1279
  field: {
1260
1280
  ...e,
@@ -1281,21 +1301,21 @@ function _t({ className: e, variant: t, ...n }) {
1281
1301
  }
1282
1302
  //#endregion
1283
1303
  //#region src/components/auth/settings/account/account-settings.tsx
1284
- function vt({ className: e, variant: t, ...n }) {
1304
+ function _t({ className: e, variant: t, ...n }) {
1285
1305
  let { emailAndPassword: r, plugins: i } = h(), a = i.some((e) => e.id === "magicLink");
1286
1306
  return /* @__PURE__ */ $("div", {
1287
1307
  className: q("flex w-full flex-col gap-4 md:gap-6", e),
1288
1308
  ...n,
1289
1309
  children: [
1290
- /* @__PURE__ */ Q(_t, { variant: t }),
1291
- (r?.enabled || a) && /* @__PURE__ */ Q(ht, { variant: t }),
1310
+ /* @__PURE__ */ Q(gt, { variant: t }),
1311
+ (r?.enabled || a) && /* @__PURE__ */ Q(mt, { variant: t }),
1292
1312
  i.flatMap((e) => e.accountCards?.map((n, r) => /* @__PURE__ */ Q(n, { variant: t }, `${e.id}-${r.toString()}`)))
1293
1313
  ]
1294
1314
  });
1295
1315
  }
1296
1316
  //#endregion
1297
1317
  //#region src/components/auth/settings/security/active-session.tsx
1298
- function yt(e) {
1318
+ function vt(e) {
1299
1319
  let t = Math.floor((Date.now() - e.getTime()) / 1e3), n = new Intl.RelativeTimeFormat(void 0, { numeric: "auto" });
1300
1320
  for (let [e, r] of [
1301
1321
  ["year", 31536e3],
@@ -1308,27 +1328,27 @@ function yt(e) {
1308
1328
  ]) if (t >= r) return n.format(-Math.floor(t / r), e);
1309
1329
  return n.format(0, "second");
1310
1330
  }
1311
- function bt({ activeSession: e }) {
1312
- let { authClient: t, basePaths: n, localization: r, viewPaths: i, navigate: a } = h(), { data: o } = w(t, { refetchOnMount: !1 }), { mutate: s, isPending: c } = C(t, { onSuccess: () => J.success(r.settings.revokeSessionSuccess) }), l = e.token === o?.session.token, u = Xe.parse(e.userAgent || "");
1331
+ function yt({ activeSession: e }) {
1332
+ let { authClient: t, basePaths: n, localization: r, viewPaths: i, navigate: a } = h(), { data: o } = T(t, { refetchOnMount: !1 }), { mutate: s, isPending: c } = w(t, { onSuccess: () => J.success(r.settings.revokeSessionSuccess) }), l = e.token === o?.session.token, u = Je.parse(e.userAgent || "");
1313
1333
  return /* @__PURE__ */ $("div", {
1314
1334
  className: "flex items-center gap-3",
1315
1335
  children: [
1316
1336
  /* @__PURE__ */ Q("div", {
1317
1337
  className: "flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-secondary",
1318
- children: u.platform.type === "mobile" || u.platform.type === "tablet" ? /* @__PURE__ */ Q(xe, { className: "size-4.5" }) : /* @__PURE__ */ Q(pe, { className: "size-4.5" })
1338
+ children: u.platform.type === "mobile" || u.platform.type === "tablet" ? /* @__PURE__ */ Q(be, { className: "size-4.5" }) : /* @__PURE__ */ Q(fe, { className: "size-4.5" })
1319
1339
  }),
1320
1340
  /* @__PURE__ */ $("div", {
1321
1341
  className: "flex flex-col min-w-0",
1322
1342
  children: [/* @__PURE__ */ $("span", {
1323
1343
  className: "text-sm font-medium truncate",
1324
1344
  children: [u.browser.name || "Unknown Browser", u.os.name ? `, ${u.os.name}` : ""]
1325
- }), l ? /* @__PURE__ */ Q(we, {
1345
+ }), l ? /* @__PURE__ */ Q(Ce, {
1326
1346
  color: "accent",
1327
1347
  size: "sm",
1328
1348
  children: r.settings.currentSession
1329
1349
  }) : e.createdAt && /* @__PURE__ */ Q("span", {
1330
1350
  className: "text-xs text-muted capitalize",
1331
- children: yt(e.createdAt)
1351
+ children: vt(e.createdAt)
1332
1352
  })]
1333
1353
  }),
1334
1354
  /* @__PURE__ */ $(k, {
@@ -1341,15 +1361,15 @@ function bt({ activeSession: e }) {
1341
1361
  children: [c ? /* @__PURE__ */ Q(W, {
1342
1362
  color: "current",
1343
1363
  size: "sm"
1344
- }) : Q(l ? E : Ce, {}), l ? r.auth.signOut : r.settings.revoke]
1364
+ }) : Q(l ? E : Se, {}), l ? r.auth.signOut : r.settings.revoke]
1345
1365
  })
1346
1366
  ]
1347
1367
  });
1348
1368
  }
1349
1369
  //#endregion
1350
1370
  //#region src/components/auth/settings/security/active-sessions.tsx
1351
- function xt({ className: e, variant: t, ...n }) {
1352
- let { authClient: r, localization: i } = h(), { data: a } = w(r), { data: o, isPending: s } = ee(r), c = o && [...o].sort((e, t) => e.id === a?.session.id ? -1 : +(t.id === a?.session.id));
1371
+ function bt({ className: e, variant: t, ...n }) {
1372
+ let { authClient: r, localization: i } = h(), { data: a } = T(r), { data: o, isPending: s } = S(r), c = o && [...o].sort((e, t) => e.id === a?.session.id ? -1 : +(t.id === a?.session.id));
1353
1373
  return /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q("h2", {
1354
1374
  className: q("text-sm font-semibold mb-3"),
1355
1375
  children: i.settings.activeSessions
@@ -1359,11 +1379,11 @@ function xt({ className: e, variant: t, ...n }) {
1359
1379
  ...n,
1360
1380
  children: /* @__PURE__ */ Q(j.Content, {
1361
1381
  className: "gap-0",
1362
- children: s ? /* @__PURE__ */ Q(St, {}) : c?.map((e, t) => /* @__PURE__ */ $("div", { children: [t > 0 && /* @__PURE__ */ Q("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ Q(bt, { activeSession: e })] }, e.id))
1382
+ children: s ? /* @__PURE__ */ Q(xt, {}) : c?.map((e, t) => /* @__PURE__ */ $("div", { children: [t > 0 && /* @__PURE__ */ Q("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ Q(yt, { activeSession: e })] }, e.id))
1363
1383
  })
1364
1384
  })] });
1365
1385
  }
1366
- function St() {
1386
+ function xt() {
1367
1387
  return /* @__PURE__ */ Q("div", {
1368
1388
  className: "flex items-center justify-between",
1369
1389
  children: /* @__PURE__ */ $("div", {
@@ -1377,13 +1397,13 @@ function St() {
1377
1397
  }
1378
1398
  //#endregion
1379
1399
  //#region src/components/auth/settings/security/change-password.tsx
1380
- function Ct({ className: e, variant: t, ...n }) {
1381
- let { authClient: r, emailAndPassword: i, localization: a } = h(), { data: o } = w(r), { data: s, isPending: c } = x(r), l = s?.some((e) => e.providerId === "credential");
1382
- return !c && !l ? /* @__PURE__ */ Q(wt, {
1400
+ function St({ className: e, variant: t, ...n }) {
1401
+ let { authClient: r, emailAndPassword: i, localization: a } = h(), { data: o } = T(r), { data: s, isPending: c } = x(r), l = s?.some((e) => e.providerId === "credential");
1402
+ return !c && !l ? /* @__PURE__ */ Q(Ct, {
1383
1403
  className: e,
1384
1404
  variant: t,
1385
1405
  ...n
1386
- }) : /* @__PURE__ */ Q(Tt, {
1406
+ }) : /* @__PURE__ */ Q(wt, {
1387
1407
  className: e,
1388
1408
  variant: t,
1389
1409
  emailAndPassword: i,
@@ -1392,21 +1412,23 @@ function Ct({ className: e, variant: t, ...n }) {
1392
1412
  ...n
1393
1413
  });
1394
1414
  }
1395
- function wt({ className: e, variant: t, ...n }) {
1396
- let { authClient: r, localization: i, plugins: a } = h(), { data: o } = w(r), { fetchOptions: s, resetFetchOptions: c } = y(), { mutate: l, isPending: u } = S(r, {
1415
+ function Ct({ className: e, variant: t, ...n }) {
1416
+ let { authClient: i, localization: a, plugins: o } = h(), { data: s } = T(i), { fetchOptions: c, resetFetchOptions: l } = y(), [u, d] = X(""), { mutate: f, isPending: p } = C(i, {
1397
1417
  onError: () => {
1398
- c();
1418
+ l();
1399
1419
  },
1400
- onSuccess: () => J.success(i.auth.passwordResetEmailSent)
1401
- }), d = a.find((e) => e.captchaComponent)?.captchaComponent, f = () => {
1402
- o?.user.email && l({
1403
- email: o.user.email,
1404
- fetchOptions: s
1420
+ onSuccess: (e, { email: t }) => {
1421
+ d(t);
1422
+ }
1423
+ }), m = o.find((e) => e.captchaComponent)?.captchaComponent, g = () => {
1424
+ s?.user.email && f({
1425
+ email: s.user.email,
1426
+ fetchOptions: c
1405
1427
  });
1406
1428
  };
1407
1429
  return /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q("h2", {
1408
1430
  className: q("text-sm font-semibold mb-3"),
1409
- children: i.settings.changePassword
1431
+ children: a.settings.changePassword
1410
1432
  }), /* @__PURE__ */ Q(j, {
1411
1433
  className: q(e),
1412
1434
  variant: t,
@@ -1415,27 +1437,37 @@ function wt({ className: e, variant: t, ...n }) {
1415
1437
  className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
1416
1438
  children: [/* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q("p", {
1417
1439
  className: "text-sm font-medium leading-tight",
1418
- children: i.settings.setPassword
1440
+ children: a.settings.setPassword
1419
1441
  }), /* @__PURE__ */ Q("p", {
1420
1442
  className: "text-muted text-xs mt-0.5",
1421
- children: i.settings.setPasswordDescription
1422
- })] }), /* @__PURE__ */ $("div", {
1443
+ children: a.settings.setPasswordDescription
1444
+ })] }), u ? /* @__PURE__ */ $("div", {
1445
+ className: "flex flex-col gap-3 items-start sm:items-end",
1446
+ children: [/* @__PURE__ */ Q("p", {
1447
+ className: "text-sm",
1448
+ role: "status",
1449
+ children: a.auth.resetLinkSentTo.replace("{{email}}", u)
1450
+ }), /* @__PURE__ */ Q(r, {
1451
+ email: u,
1452
+ className: "w-auto"
1453
+ })]
1454
+ }) : /* @__PURE__ */ $("div", {
1423
1455
  className: "flex flex-col gap-3 items-start sm:items-end",
1424
- children: [d && /* @__PURE__ */ Q("div", { children: d }), /* @__PURE__ */ $(k, {
1456
+ children: [m && /* @__PURE__ */ Q("div", { children: m }), /* @__PURE__ */ $(k, {
1425
1457
  size: "sm",
1426
- isPending: u,
1427
- isDisabled: !o?.user.email,
1428
- onPress: f,
1429
- children: [u && /* @__PURE__ */ Q(W, {
1458
+ isPending: p,
1459
+ isDisabled: !s?.user.email,
1460
+ onPress: g,
1461
+ children: [p && /* @__PURE__ */ Q(W, {
1430
1462
  color: "current",
1431
1463
  size: "sm"
1432
- }), i.auth.sendResetLink]
1464
+ }), a.auth.sendResetLink]
1433
1465
  })]
1434
1466
  })]
1435
1467
  })
1436
1468
  })] });
1437
1469
  }
1438
- function Tt({ className: e, variant: t, emailAndPassword: n, localization: r, session: i, ...a }) {
1470
+ function wt({ className: e, variant: t, emailAndPassword: n, localization: r, session: i, ...a }) {
1439
1471
  let { authClient: o } = h(), [s, c] = X(""), [l, u] = X(""), [d, f] = X(""), { mutate: p, isPending: m } = v(o, {
1440
1472
  onError: () => {
1441
1473
  c(""), u(""), f("");
@@ -1571,14 +1603,14 @@ function Tt({ className: e, variant: t, emailAndPassword: n, localization: r, se
1571
1603
  }
1572
1604
  //#endregion
1573
1605
  //#region src/components/auth/settings/security/linked-account.tsx
1574
- function Et({ account: e, provider: t }) {
1606
+ function Tt({ account: e, provider: t }) {
1575
1607
  let { authClient: n, baseURL: r, localization: i } = h(), { data: a, isPending: o } = m(n, { query: { accountId: e?.accountId } }), { mutate: s, isPending: c } = b(n), { mutate: u, isPending: d } = ae(n, { onSuccess: () => J.success(i.settings.accountUnlinked) }), f = p[t], g = l(t), _ = a?.data?.login || a?.data?.username || a?.user?.email || a?.user?.name || e?.accountId;
1576
1608
  return /* @__PURE__ */ $("div", {
1577
1609
  className: "flex items-center gap-3",
1578
1610
  children: [
1579
1611
  /* @__PURE__ */ Q("div", {
1580
1612
  className: q("flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-secondary"),
1581
- children: Q(f || ye, { className: "size-4.5" })
1613
+ children: Q(f || ve, { className: "size-4.5" })
1582
1614
  }),
1583
1615
  /* @__PURE__ */ $("div", {
1584
1616
  className: "flex flex-col min-w-0",
@@ -1600,7 +1632,7 @@ function Et({ account: e, provider: t }) {
1600
1632
  children: [d ? /* @__PURE__ */ Q(W, {
1601
1633
  color: "current",
1602
1634
  size: "sm"
1603
- }) : /* @__PURE__ */ Q(ge, {}), i.settings.unlinkProvider.replace("{{provider}}", "").trim()]
1635
+ }) : /* @__PURE__ */ Q(he, {}), i.settings.unlinkProvider.replace("{{provider}}", "").trim()]
1604
1636
  }) : /* @__PURE__ */ $(k, {
1605
1637
  className: "ml-auto shrink-0",
1606
1638
  variant: "outline",
@@ -1614,14 +1646,14 @@ function Et({ account: e, provider: t }) {
1614
1646
  children: [c ? /* @__PURE__ */ Q(W, {
1615
1647
  color: "current",
1616
1648
  size: "sm"
1617
- }) : /* @__PURE__ */ Q(he, {}), i.settings.link]
1649
+ }) : /* @__PURE__ */ Q(me, {}), i.settings.link]
1618
1650
  })
1619
1651
  ]
1620
1652
  });
1621
1653
  }
1622
1654
  //#endregion
1623
1655
  //#region src/components/auth/settings/security/linked-accounts.tsx
1624
- function Dt({ className: e, variant: t, ...n }) {
1656
+ function Et({ className: e, variant: t, ...n }) {
1625
1657
  let { authClient: r, localization: i, multipleAccountsPerProvider: a, socialProviders: o } = h(), { data: s, isPending: c } = x(r), l = s?.filter((e) => e.providerId !== "credential"), u = new Set(l?.map((e) => e.providerId)), d = a === !1 ? o?.filter((e) => !u.has(e)) : o, f = [...l?.map((e) => ({
1626
1658
  key: e.id,
1627
1659
  account: e,
@@ -1640,14 +1672,14 @@ function Dt({ className: e, variant: t, ...n }) {
1640
1672
  ...n,
1641
1673
  children: /* @__PURE__ */ Q(j.Content, {
1642
1674
  className: "gap-0",
1643
- children: c ? o?.map((e, t) => /* @__PURE__ */ $("div", { children: [t > 0 && /* @__PURE__ */ Q("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ Q(Ot, {})] }, e)) : f.map((e, t) => /* @__PURE__ */ $("div", { children: [t > 0 && /* @__PURE__ */ Q("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ Q(Et, {
1675
+ children: c ? o?.map((e, t) => /* @__PURE__ */ $("div", { children: [t > 0 && /* @__PURE__ */ Q("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ Q(Dt, {})] }, e)) : f.map((e, t) => /* @__PURE__ */ $("div", { children: [t > 0 && /* @__PURE__ */ Q("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ Q(Tt, {
1644
1676
  account: e.account,
1645
1677
  provider: e.provider
1646
1678
  })] }, e.key))
1647
1679
  })
1648
1680
  })] });
1649
1681
  }
1650
- function Ot() {
1682
+ function Dt() {
1651
1683
  return /* @__PURE__ */ Q("div", {
1652
1684
  className: "flex items-center justify-between",
1653
1685
  children: /* @__PURE__ */ $("div", {
@@ -1661,26 +1693,26 @@ function Ot() {
1661
1693
  }
1662
1694
  //#endregion
1663
1695
  //#region src/components/auth/settings/security/security-settings.tsx
1664
- function kt({ className: e, variant: t, ...n }) {
1696
+ function Ot({ className: e, variant: t, ...n }) {
1665
1697
  let { emailAndPassword: r, plugins: i, socialProviders: a } = h();
1666
1698
  return /* @__PURE__ */ $("div", {
1667
1699
  className: q("flex w-full flex-col gap-4 md:gap-6", e),
1668
1700
  ...n,
1669
1701
  children: [
1670
- r?.enabled && /* @__PURE__ */ Q(Ct, { variant: t }),
1671
- !!a?.length && /* @__PURE__ */ Q(Dt, { variant: t }),
1672
- /* @__PURE__ */ Q(xt, { variant: t }),
1702
+ r?.enabled && /* @__PURE__ */ Q(St, { variant: t }),
1703
+ !!a?.length && /* @__PURE__ */ Q(Et, { variant: t }),
1704
+ /* @__PURE__ */ Q(bt, { variant: t }),
1673
1705
  i.flatMap((e) => e.securityCards?.map((n, r) => /* @__PURE__ */ Q(n, { variant: t }, `${e.id}-${r.toString()}`)))
1674
1706
  ]
1675
1707
  });
1676
1708
  }
1677
1709
  //#endregion
1678
1710
  //#region src/components/auth/settings/settings.tsx
1679
- function At({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
1711
+ function kt({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
1680
1712
  if (!i && !n) throw Error("[Better Auth UI] Either `view` or `path` must be provided");
1681
1713
  let { authClient: o, basePaths: s, localization: c, viewPaths: l, plugins: u } = h();
1682
1714
  g(o);
1683
- let d = Ue(() => {
1715
+ let d = He(() => {
1684
1716
  if (i) return i;
1685
1717
  if (n) return [l.settings, ...u.map((e) => e.viewPaths?.settings)].flatMap((e) => Object.entries(e ?? {})).find(([, e]) => e === n)?.[0];
1686
1718
  }, [
@@ -1712,7 +1744,7 @@ function At({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
1712
1744
  inline: "center"
1713
1745
  }),
1714
1746
  children: [
1715
- /* @__PURE__ */ Q(_e, { className: "text-muted" }),
1747
+ /* @__PURE__ */ Q(ge, { className: "text-muted" }),
1716
1748
  c.settings.account,
1717
1749
  /* @__PURE__ */ Q(G.Indicator, {})
1718
1750
  ]
@@ -1726,7 +1758,7 @@ function At({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
1726
1758
  inline: "center"
1727
1759
  }),
1728
1760
  children: [
1729
- /* @__PURE__ */ Q(be, { className: "text-muted" }),
1761
+ /* @__PURE__ */ Q(ye, { className: "text-muted" }),
1730
1762
  c.settings.security,
1731
1763
  /* @__PURE__ */ Q(G.Indicator, {})
1732
1764
  ]
@@ -1746,12 +1778,12 @@ function At({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
1746
1778
  /* @__PURE__ */ Q(G.Panel, {
1747
1779
  id: "account",
1748
1780
  className: "px-0",
1749
- children: /* @__PURE__ */ Q(vt, { variant: r })
1781
+ children: /* @__PURE__ */ Q(_t, { variant: r })
1750
1782
  }),
1751
1783
  /* @__PURE__ */ Q(G.Panel, {
1752
1784
  id: "security",
1753
1785
  className: "px-0",
1754
- children: /* @__PURE__ */ Q(kt, { variant: r })
1786
+ children: /* @__PURE__ */ Q(Ot, { variant: r })
1755
1787
  }),
1756
1788
  u.flatMap((e) => e.settingsTabs?.map((t, n) => /* @__PURE__ */ Q(G.Panel, {
1757
1789
  id: t.view,
@@ -1763,8 +1795,8 @@ function At({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
1763
1795
  }
1764
1796
  //#endregion
1765
1797
  //#region src/components/auth/user/user-button.tsx
1766
- function jt(e, t) {
1767
- if (He(e)) return e;
1798
+ function At(e, t) {
1799
+ if (Ve(e)) return e;
1768
1800
  let { label: n, href: r, icon: i, variant: a } = e;
1769
1801
  return /* @__PURE__ */ $(P.Item, {
1770
1802
  href: r,
@@ -1773,39 +1805,39 @@ function jt(e, t) {
1773
1805
  children: [i, /* @__PURE__ */ Q(B, { children: n })]
1774
1806
  }, t);
1775
1807
  }
1776
- function Mt({ className: e, placement: t, size: r = "default", variant: a = "ghost", links: o, hideSettings: s, hideSubtitle: c }) {
1777
- let { authClient: l, basePaths: u, viewPaths: d, localization: f, plugins: p } = h(), { data: m, isPending: g } = w(l), _ = p.flatMap((e) => e.userMenuItems?.map((t, n) => /* @__PURE__ */ Q(t, { hideSubtitle: c }, `${e.id}-${n.toString()}`)) ?? []), v = o?.flatMap((e, t) => {
1778
- if (!He(e)) {
1808
+ function jt({ className: e, placement: t, size: r = "default", variant: i = "ghost", links: o, hideSettings: s, hideSubtitle: c }) {
1809
+ let { authClient: l, basePaths: u, viewPaths: d, localization: f, plugins: p } = h(), { data: m, isPending: g } = T(l), _ = p.flatMap((e) => e.userMenuItems?.map((t, n) => /* @__PURE__ */ Q(t, { hideSubtitle: c }, `${e.id}-${n.toString()}`)) ?? []), v = o?.flatMap((e, t) => {
1810
+ if (!Ve(e)) {
1779
1811
  let t = e.visibility ?? "always";
1780
1812
  if (t === "authenticated" && !m || t === "unauthenticated" && m) return [];
1781
1813
  }
1782
- return [jt(e, `user-button-link-${t.toString()}`)];
1814
+ return [At(e, `user-button-link-${t.toString()}`)];
1783
1815
  });
1784
1816
  return /* @__PURE__ */ $(P, { children: [r === "icon" ? /* @__PURE__ */ Q(P.Trigger, {
1785
1817
  className: q("rounded-full"),
1786
1818
  children: /* @__PURE__ */ Q(n, { className: e })
1787
1819
  }) : /* @__PURE__ */ $(k, {
1788
- variant: a,
1820
+ variant: i,
1789
1821
  className: q("h-auto font-normal justify-start px-2 py-2 text-left", e),
1790
- children: [m || g ? /* @__PURE__ */ Q(i, {
1822
+ children: [m || g ? /* @__PURE__ */ Q(a, {
1791
1823
  isPending: g,
1792
1824
  hideSubtitle: c
1793
1825
  }) : /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ Q(n, {}), /* @__PURE__ */ Q("p", {
1794
1826
  className: "text-sm font-medium",
1795
1827
  children: f.auth.account
1796
- })] }), /* @__PURE__ */ Q(ue, { className: "ml-auto size-3 text-muted" })]
1828
+ })] }), /* @__PURE__ */ Q(le, { className: "ml-auto size-3 text-muted" })]
1797
1829
  }), /* @__PURE__ */ $(P.Popover, {
1798
1830
  placement: t,
1799
1831
  className: "min-w-40 md:min-w-56 max-w-[48svw]",
1800
1832
  children: [m && /* @__PURE__ */ Q("div", {
1801
1833
  className: "px-3 pt-3 pb-1",
1802
- children: /* @__PURE__ */ Q(i, { hideSubtitle: c })
1834
+ children: /* @__PURE__ */ Q(a, { hideSubtitle: c })
1803
1835
  }), /* @__PURE__ */ Q(P.Menu, { children: m ? /* @__PURE__ */ $(Z, { children: [
1804
1836
  v,
1805
1837
  !s && /* @__PURE__ */ $(P.Item, {
1806
1838
  textValue: f.settings.settings,
1807
1839
  href: `${u.settings}/${d.settings.account}`,
1808
- children: [/* @__PURE__ */ Q(me, { className: "text-muted" }), /* @__PURE__ */ Q(B, { children: f.settings.settings })]
1840
+ children: [/* @__PURE__ */ Q(pe, { className: "text-muted" }), /* @__PURE__ */ Q(B, { children: f.settings.settings })]
1809
1841
  }),
1810
1842
  _,
1811
1843
  /* @__PURE__ */ $(P.Item, {
@@ -1824,11 +1856,11 @@ function Mt({ className: e, placement: t, size: r = "default", variant: a = "gho
1824
1856
  /* @__PURE__ */ $(P.Item, {
1825
1857
  textValue: f.auth.signUp,
1826
1858
  href: `${u.auth}/${d.auth.signUp}`,
1827
- children: [/* @__PURE__ */ Q(ve, { className: "text-muted" }), /* @__PURE__ */ Q(B, { children: f.auth.signUp })]
1859
+ children: [/* @__PURE__ */ Q(_e, { className: "text-muted" }), /* @__PURE__ */ Q(B, { children: f.auth.signUp })]
1828
1860
  }),
1829
1861
  _
1830
1862
  ] }) })]
1831
1863
  })] });
1832
1864
  }
1833
1865
  //#endregion
1834
- export { vt as AccountSettings, xt as ActiveSessions, et as AdditionalField, ft as Auth, mt as AuthProvider, ht as ChangeEmail, Ct as ChangePassword, nt as ForgotPassword, Dt as LinkedAccounts, st as OpenEmailButton, t as ProviderButton, r as ProviderButtons, rt as ResetPassword, kt as SecuritySettings, At as Settings, it as SignIn, at as SignOut, ot as SignUp, n as UserAvatar, Mt as UserButton, _t as UserProfile, i as UserView, lt as VerifyEmail };
1866
+ export { _t as AccountSettings, bt as ActiveSessions, Qe as AdditionalField, dt as Auth, pt as AuthProvider, mt as ChangeEmail, St as ChangePassword, nt as ForgotPassword, Et as LinkedAccounts, r as OpenEmailButton, t as ProviderButton, i as ProviderButtons, et as RESET_LINK_SENT_STORAGE_KEY, tt as ResetLinkSent, rt as ResetPassword, Ot as SecuritySettings, kt as Settings, it as SignIn, at as SignOut, ot as SignUp, n as UserAvatar, jt as UserButton, gt as UserProfile, a as UserView, ct as VerifyEmail };