@exegia/corpora-ui 0.6.0 → 0.7.0

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.
Files changed (29) hide show
  1. package/dist-lib/components/blocks/auth/__tests__/linked-accounts-block.test.d.ts +1 -0
  2. package/dist-lib/components/blocks/auth/__tests__/onboarding-block.test.d.ts +1 -0
  3. package/dist-lib/components/blocks/auth/__tests__/passkey-manager-block.test.d.ts +1 -0
  4. package/dist-lib/components/blocks/auth/__tests__/passkey-sign-in-block.test.d.ts +1 -0
  5. package/dist-lib/components/blocks/auth/__tests__/update-password-block.test.d.ts +1 -0
  6. package/dist-lib/components/blocks/auth/linked-accounts-block.d.ts +30 -0
  7. package/dist-lib/components/blocks/auth/onboarding/profile-step.d.ts +19 -0
  8. package/dist-lib/components/blocks/auth/onboarding-block.d.ts +69 -0
  9. package/dist-lib/components/blocks/auth/passkey-manager-block.d.ts +38 -0
  10. package/dist-lib/components/blocks/auth/passkey-sign-in-block.d.ts +27 -0
  11. package/dist-lib/components/blocks/auth/update-password-block.d.ts +28 -0
  12. package/dist-lib/components/composed/social-providers.d.ts +7 -0
  13. package/dist-lib/index.d.ts +5 -0
  14. package/dist-lib/index.js +1032 -312
  15. package/dist-lib/index.js.map +1 -1
  16. package/package.json +5 -1
  17. package/src/components/blocks/auth/__tests__/linked-accounts-block.test.tsx +110 -0
  18. package/src/components/blocks/auth/__tests__/onboarding-block.test.tsx +156 -0
  19. package/src/components/blocks/auth/__tests__/passkey-manager-block.test.tsx +131 -0
  20. package/src/components/blocks/auth/__tests__/passkey-sign-in-block.test.tsx +59 -0
  21. package/src/components/blocks/auth/__tests__/update-password-block.test.tsx +95 -0
  22. package/src/components/blocks/auth/linked-accounts-block.tsx +223 -0
  23. package/src/components/blocks/auth/onboarding/profile-step.tsx +227 -0
  24. package/src/components/blocks/auth/onboarding-block.tsx +240 -0
  25. package/src/components/blocks/auth/passkey-manager-block.tsx +334 -0
  26. package/src/components/blocks/auth/passkey-sign-in-block.tsx +81 -0
  27. package/src/components/blocks/auth/update-password-block.tsx +157 -0
  28. package/src/components/composed/social-providers.tsx +3 -2
  29. package/src/index.ts +5 -0
package/dist-lib/index.js CHANGED
@@ -3,26 +3,26 @@ import { useRender as t } from "@base-ui/react/use-render";
3
3
  import { cva as n } from "class-variance-authority";
4
4
  import { clsx as r } from "clsx";
5
5
  import { twMerge as i } from "tailwind-merge";
6
- import { ArrowLeftIcon as a, CheckIcon as o, EyeIcon as s, EyeOffIcon as c, Loader2Icon as l, MailIcon as u, SmartphoneIcon as d, XIcon as f } from "lucide-react";
7
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
8
- import * as g from "react";
9
- import { forwardRef as _, useCallback as v, useEffect as y, useId as b, useMemo as x, useRef as S, useState as C } from "react";
10
- import { Checkbox as w } from "@base-ui/react/checkbox";
11
- import { bind as T, play as E, play as D, setEnabled as O, setVolume as k, sounds as ee } from "cuelume";
12
- import { Field as A, Field as j } from "@base-ui/react/field";
6
+ import { ArrowLeftIcon as a, CheckIcon as o, EyeIcon as s, EyeOffIcon as c, FingerprintIcon as l, Loader2Icon as u, MailIcon as d, SmartphoneIcon as f, XIcon as p } from "lucide-react";
7
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
8
+ import * as _ from "react";
9
+ import { forwardRef as v, useCallback as y, useEffect as b, useId as x, useMemo as S, useRef as C, useState as w } from "react";
10
+ import { Checkbox as T } from "@base-ui/react/checkbox";
11
+ import { bind as E, play as D, play as O, setEnabled as k, setVolume as ee, sounds as A } from "cuelume";
12
+ import { Field as te, Field as j } from "@base-ui/react/field";
13
13
  import { Input as M } from "@base-ui/react/input";
14
14
  import { OTPField as N } from "@base-ui/react/otp-field";
15
- import { Separator as P } from "@base-ui/react/separator";
16
- import { AnimatePresence as F, MotionConfig as te, motion as I } from "motion/react";
17
- import { RiAppleFill as ne, RiGithubFill as re, RiGoogleFill as ie, RiTwitterXFill as ae } from "@remixicon/react";
15
+ import { Separator as ne } from "@base-ui/react/separator";
16
+ import { AnimatePresence as P, MotionConfig as F, motion as I } from "motion/react";
17
+ import { RiAppleFill as re, RiGithubFill as ie, RiGoogleFill as ae, RiTwitterXFill as oe } from "@remixicon/react";
18
18
  //#region src/lib/utils.ts
19
19
  function L(...e) {
20
20
  return i(r(e));
21
21
  }
22
22
  //#endregion
23
23
  //#region src/components/ui/spinner.tsx
24
- function oe({ className: e, ...t }) {
25
- return /* @__PURE__ */ m(l, {
24
+ function R({ className: e, ...t }) {
25
+ return /* @__PURE__ */ h(u, {
26
26
  "aria-label": "Loading",
27
27
  className: L("animate-spin", e),
28
28
  role: "status",
@@ -66,20 +66,20 @@ function de({ width: e, height: t, radius: n, bezel: r }) {
66
66
  function fe(e) {
67
67
  return (1 - (1 - e) ** 4) ** .25;
68
68
  }
69
- var pe = _(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .34, saturation: i = 1.28, className: a, style: o, children: s, ...c }, l) {
70
- let u = b(), d = x(() => `liquid-glass-${u.replace(/:/g, "")}`, [u]);
69
+ var pe = v(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .34, saturation: i = 1.28, className: a, style: o, children: s, ...c }, l) {
70
+ let u = x(), d = S(() => `liquid-glass-${u.replace(/:/g, "")}`, [u]);
71
71
  console.log(n);
72
- let f = S(null), g = v((e) => {
72
+ let f = C(null), p = y((e) => {
73
73
  f.current = e, typeof l == "function" ? l(e) : l && (l.current = e);
74
- }, [l]), [_, w] = C(null);
75
- y(() => {
74
+ }, [l]), [_, v] = w(null);
75
+ b(() => {
76
76
  let e = f.current;
77
77
  if (!e) return;
78
78
  let t = () => {
79
79
  let t = e.getBoundingClientRect(), n = Math.round(t.width), i = Math.round(t.height);
80
80
  if (!n || !i) return;
81
81
  let a = Number.parseFloat(getComputedStyle(e).borderTopLeftRadius), o = Math.min(Number.isFinite(a) ? a : Math.min(n, i) / 2, n / 2, i / 2);
82
- w((e) => e && e.width === n && e.height === i && e.radius === o && e.bezel === r ? e : {
82
+ v((e) => e && e.width === n && e.height === i && e.radius === o && e.bezel === r ? e : {
83
83
  width: n,
84
84
  height: i,
85
85
  radius: o,
@@ -90,13 +90,13 @@ var pe = _(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .3
90
90
  let n = new ResizeObserver(t);
91
91
  return n.observe(e), () => n.disconnect();
92
92
  }, [r]);
93
- let T = x(() => _ ? de(_) : "", [_]), [E, D] = C(!1);
94
- y(() => {
93
+ let T = S(() => _ ? de(_) : "", [_]), [E, D] = w(!1);
94
+ b(() => {
95
95
  D(ue());
96
96
  }, []);
97
97
  let O = E && T !== "", k = O ? `url(#${d}) blur(${e}px) saturate(${i})` : `blur(${e + 2}px) saturate(${i})`;
98
- return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ h("div", {
99
- ref: g,
98
+ return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g("div", {
99
+ ref: p,
100
100
  className: L("relative overflow-hidden rounded-full bg-white/[0.08]", a),
101
101
  style: {
102
102
  ...o,
@@ -104,7 +104,7 @@ var pe = _(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .3
104
104
  WebkitBackdropFilter: k
105
105
  },
106
106
  ...c,
107
- children: [s, /* @__PURE__ */ m("span", {
107
+ children: [s, /* @__PURE__ */ h("span", {
108
108
  "aria-hidden": !0,
109
109
  className: "pointer-events-none absolute inset-0 rounded-[inherit]",
110
110
  style: {
@@ -115,10 +115,10 @@ var pe = _(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .3
115
115
  mask: "linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0)"
116
116
  }
117
117
  })]
118
- }), O && /* @__PURE__ */ m("svg", {
118
+ }), O && /* @__PURE__ */ h("svg", {
119
119
  className: "absolute size-0 overflow-hidden",
120
120
  "aria-hidden": !0,
121
- children: /* @__PURE__ */ h("filter", {
121
+ children: /* @__PURE__ */ g("filter", {
122
122
  id: d,
123
123
  x: "0",
124
124
  y: "0",
@@ -126,7 +126,7 @@ var pe = _(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .3
126
126
  height: "100%",
127
127
  colorInterpolationFilters: "sRGB",
128
128
  children: [
129
- /* @__PURE__ */ m("feImage", {
129
+ /* @__PURE__ */ h("feImage", {
130
130
  href: T,
131
131
  x: "0",
132
132
  y: "0",
@@ -135,7 +135,7 @@ var pe = _(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .3
135
135
  preserveAspectRatio: "none",
136
136
  result: "map"
137
137
  }),
138
- /* @__PURE__ */ m("feDisplacementMap", {
138
+ /* @__PURE__ */ h("feDisplacementMap", {
139
139
  in: "SourceGraphic",
140
140
  in2: "map",
141
141
  scale: t,
@@ -143,7 +143,7 @@ var pe = _(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .3
143
143
  yChannelSelector: "G",
144
144
  result: "displaced"
145
145
  }),
146
- /* @__PURE__ */ m("feGaussianBlur", {
146
+ /* @__PURE__ */ h("feGaussianBlur", {
147
147
  in: "displaced",
148
148
  stdDeviation: "0.15"
149
149
  })
@@ -225,19 +225,19 @@ var pe = _(function({ blur: e = 2, refraction: t = 15, mapSize: n, bezel: r = .3
225
225
  }
226
226
  }
227
227
  });
228
- function R({ className: n, variant: r, size: i, render: a, children: o, loading: s = !1, disabled: c, glassVariant: l, sound: u = !0, ...d }) {
229
- let f = !!(s || c), g = a ? void 0 : "button", _ = r === "glass" ? l ?? "liquid-refract" : void 0, v = _ === "liquid-refract", y = (i ?? "default").startsWith("icon"), b = t({
228
+ function z({ className: n, variant: r, size: i, render: a, children: o, loading: s = !1, disabled: c, glassVariant: l, sound: u = !0, ...d }) {
229
+ let f = !!(s || c), p = a ? void 0 : "button", _ = r === "glass" ? l ?? "liquid-refract" : void 0, v = _ === "liquid-refract", y = (i ?? "default").startsWith("icon"), b = t({
230
230
  defaultTagName: "button",
231
231
  props: e({
232
- children: /* @__PURE__ */ h(p, { children: [
233
- !y && /* @__PURE__ */ m("span", {
232
+ children: /* @__PURE__ */ g(m, { children: [
233
+ !y && /* @__PURE__ */ h("span", {
234
234
  "aria-hidden": !s || void 0,
235
235
  "data-slot": "button-loading-indicator",
236
236
  className: L("pointer-events-none inline-flex shrink-0 items-center overflow-hidden transition-[max-width,margin-inline-start,opacity,filter] duration-300 ease-smooth-out motion-reduce:transition-none", s ? "max-w-6" : L("max-w-0 opacity-0 blur-[2px]", i === "xs" ? "-ms-1" : i === "sm" ? "-ms-1.5" : "-ms-2")),
237
- children: /* @__PURE__ */ m(oe, { className: s ? void 0 : "animate-none" })
237
+ children: /* @__PURE__ */ h(R, { className: s ? void 0 : "animate-none" })
238
238
  }),
239
239
  o,
240
- s && y && /* @__PURE__ */ m(oe, {
240
+ s && y && /* @__PURE__ */ h(R, {
241
241
  className: "pointer-events-none absolute",
242
242
  "data-slot": "button-loading-indicator"
243
243
  })
@@ -253,15 +253,15 @@ function R({ className: n, variant: r, size: i, render: a, children: o, loading:
253
253
  "data-glass-variant": _,
254
254
  "data-slot": "button",
255
255
  disabled: f,
256
- type: g
256
+ type: p
257
257
  }, d),
258
258
  render: a
259
259
  });
260
- return v ? /* @__PURE__ */ m(pe, { children: b }) : b;
260
+ return v ? /* @__PURE__ */ h(pe, { children: b }) : b;
261
261
  }
262
262
  //#endregion
263
263
  //#region src/components/ui/card.tsx
264
- function ge({ className: n, render: r, ...i }) {
264
+ function B({ className: n, render: r, ...i }) {
265
265
  return t({
266
266
  defaultTagName: "div",
267
267
  props: e({
@@ -271,7 +271,7 @@ function ge({ className: n, render: r, ...i }) {
271
271
  render: r
272
272
  });
273
273
  }
274
- function _e({ className: n, render: r, ...i }) {
274
+ function ge({ className: n, render: r, ...i }) {
275
275
  return t({
276
276
  defaultTagName: "div",
277
277
  props: e({
@@ -281,7 +281,7 @@ function _e({ className: n, render: r, ...i }) {
281
281
  render: r
282
282
  });
283
283
  }
284
- function ve({ className: n, render: r, ...i }) {
284
+ function _e({ className: n, render: r, ...i }) {
285
285
  return t({
286
286
  defaultTagName: "div",
287
287
  props: e({
@@ -291,7 +291,7 @@ function ve({ className: n, render: r, ...i }) {
291
291
  render: r
292
292
  });
293
293
  }
294
- function ye({ className: n, render: r, ...i }) {
294
+ function ve({ className: n, render: r, ...i }) {
295
295
  return t({
296
296
  defaultTagName: "div",
297
297
  props: e({
@@ -301,7 +301,7 @@ function ye({ className: n, render: r, ...i }) {
301
301
  render: r
302
302
  });
303
303
  }
304
- function be({ className: n, render: r, ...i }) {
304
+ function ye({ className: n, render: r, ...i }) {
305
305
  return t({
306
306
  defaultTagName: "div",
307
307
  props: e({
@@ -311,7 +311,7 @@ function be({ className: n, render: r, ...i }) {
311
311
  render: r
312
312
  });
313
313
  }
314
- function xe({ className: n, render: r, ...i }) {
314
+ function be({ className: n, render: r, ...i }) {
315
315
  return t({
316
316
  defaultTagName: "div",
317
317
  props: e({
@@ -321,7 +321,7 @@ function xe({ className: n, render: r, ...i }) {
321
321
  render: r
322
322
  });
323
323
  }
324
- function Se({ className: n, render: r, ...i }) {
324
+ function xe({ className: n, render: r, ...i }) {
325
325
  return t({
326
326
  defaultTagName: "div",
327
327
  props: e({
@@ -331,7 +331,7 @@ function Se({ className: n, render: r, ...i }) {
331
331
  render: r
332
332
  });
333
333
  }
334
- function Ce({ className: n, render: r, ...i }) {
334
+ function V({ className: n, render: r, ...i }) {
335
335
  return t({
336
336
  defaultTagName: "div",
337
337
  props: e({
@@ -341,7 +341,7 @@ function Ce({ className: n, render: r, ...i }) {
341
341
  render: r
342
342
  });
343
343
  }
344
- function we({ className: n, render: r, ...i }) {
344
+ function H({ className: n, render: r, ...i }) {
345
345
  return t({
346
346
  defaultTagName: "div",
347
347
  props: e({
@@ -351,7 +351,7 @@ function we({ className: n, render: r, ...i }) {
351
351
  render: r
352
352
  });
353
353
  }
354
- function Te({ className: n, render: r, ...i }) {
354
+ function Se({ className: n, render: r, ...i }) {
355
355
  return t({
356
356
  defaultTagName: "div",
357
357
  props: e({
@@ -361,7 +361,7 @@ function Te({ className: n, render: r, ...i }) {
361
361
  render: r
362
362
  });
363
363
  }
364
- function Ee({ className: n, render: r, ...i }) {
364
+ function Ce({ className: n, render: r, ...i }) {
365
365
  return t({
366
366
  defaultTagName: "div",
367
367
  props: e({
@@ -371,7 +371,7 @@ function Ee({ className: n, render: r, ...i }) {
371
371
  render: r
372
372
  });
373
373
  }
374
- function z({ className: n, render: r, ...i }) {
374
+ function U({ className: n, render: r, ...i }) {
375
375
  return t({
376
376
  defaultTagName: "div",
377
377
  props: e({
@@ -381,7 +381,7 @@ function z({ className: n, render: r, ...i }) {
381
381
  render: r
382
382
  });
383
383
  }
384
- function De({ className: n, render: r, ...i }) {
384
+ function we({ className: n, render: r, ...i }) {
385
385
  return t({
386
386
  defaultTagName: "div",
387
387
  props: e({
@@ -393,29 +393,29 @@ function De({ className: n, render: r, ...i }) {
393
393
  }
394
394
  //#endregion
395
395
  //#region src/lib/sound.ts
396
- var Oe = !1;
397
- function ke(e) {
398
- Oe = !0, T(e);
396
+ var Te = !1;
397
+ function Ee(e) {
398
+ Te = !0, E(e);
399
399
  }
400
- function B(e, t) {
401
- Oe && E(e, t);
400
+ function De(e, t) {
401
+ Te && D(e, t);
402
402
  }
403
403
  //#endregion
404
404
  //#region src/components/ui/checkbox.tsx
405
- function V({ className: e, sound: t = !0, onCheckedChange: n, ...r }) {
406
- return /* @__PURE__ */ m(w.Root, {
405
+ function Oe({ className: e, sound: t = !0, onCheckedChange: n, ...r }) {
406
+ return /* @__PURE__ */ h(T.Root, {
407
407
  onCheckedChange: (e, r) => {
408
- t && B("toggle"), n?.(e, r);
408
+ t && De("toggle"), n?.(e, r);
409
409
  },
410
410
  className: L("relative inline-flex size-4.5 shrink-0 cursor-pointer items-center justify-center rounded-[.25rem] border border-input bg-background not-dark:bg-clip-padding shadow-xs/5 outline-none ring-ring transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[3px] not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-background aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/48 data-disabled:cursor-not-allowed data-disabled:opacity-64 sm:size-4 dark:not-data-checked:bg-input/32 dark:aria-invalid:ring-destructive/24 dark:not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)] [[data-disabled],[data-checked],[aria-invalid]]:shadow-none", e),
411
411
  "data-slot": "checkbox",
412
412
  ...r,
413
- children: /* @__PURE__ */ m(w.Indicator, {
413
+ children: /* @__PURE__ */ h(T.Indicator, {
414
414
  className: "absolute -inset-px flex items-center justify-center rounded-[.25rem] text-primary-foreground data-unchecked:hidden data-checked:bg-primary data-indeterminate:text-foreground",
415
415
  "data-slot": "checkbox-indicator",
416
- render: (e, t) => /* @__PURE__ */ m("span", {
416
+ render: (e, t) => /* @__PURE__ */ h("span", {
417
417
  ...e,
418
- children: t.indeterminate ? /* @__PURE__ */ m("svg", {
418
+ children: t.indeterminate ? /* @__PURE__ */ h("svg", {
419
419
  "aria-hidden": "true",
420
420
  className: "size-3.5 sm:size-3",
421
421
  fill: "none",
@@ -427,8 +427,8 @@ function V({ className: e, sound: t = !0, onCheckedChange: n, ...r }) {
427
427
  viewBox: "0 0 24 24",
428
428
  width: "24",
429
429
  xmlns: "http://www.w3.org/2000/svg",
430
- children: /* @__PURE__ */ m("path", { d: "M5.252 12h13.496" })
431
- }) : /* @__PURE__ */ m("svg", {
430
+ children: /* @__PURE__ */ h("path", { d: "M5.252 12h13.496" })
431
+ }) : /* @__PURE__ */ h("svg", {
432
432
  "aria-hidden": "true",
433
433
  className: "size-3.5 sm:size-3",
434
434
  fill: "none",
@@ -440,7 +440,7 @@ function V({ className: e, sound: t = !0, onCheckedChange: n, ...r }) {
440
440
  viewBox: "0 0 24 24",
441
441
  width: "24",
442
442
  xmlns: "http://www.w3.org/2000/svg",
443
- children: /* @__PURE__ */ m("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })
443
+ children: /* @__PURE__ */ h("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })
444
444
  })
445
445
  })
446
446
  })
@@ -448,81 +448,81 @@ function V({ className: e, sound: t = !0, onCheckedChange: n, ...r }) {
448
448
  }
449
449
  //#endregion
450
450
  //#region src/components/ui/field.tsx
451
- function H({ className: e, ...t }) {
452
- return /* @__PURE__ */ m(j.Root, {
451
+ function W({ className: e, ...t }) {
452
+ return /* @__PURE__ */ h(j.Root, {
453
453
  className: L("flex flex-col items-start gap-2", e),
454
454
  "data-slot": "field",
455
455
  ...t
456
456
  });
457
457
  }
458
- function U({ className: e, ...t }) {
459
- return /* @__PURE__ */ m(j.Label, {
458
+ function G({ className: e, ...t }) {
459
+ return /* @__PURE__ */ h(j.Label, {
460
460
  className: L("inline-flex cursor-pointer items-center gap-2 font-medium text-base/4 text-foreground data-disabled:cursor-not-allowed data-disabled:opacity-64 sm:text-xs/3.5 ml-3", e),
461
461
  "data-slot": "field-label",
462
462
  ...t
463
463
  });
464
464
  }
465
- function Ae({ className: e, ...t }) {
466
- return /* @__PURE__ */ m(j.Item, {
465
+ function ke({ className: e, ...t }) {
466
+ return /* @__PURE__ */ h(j.Item, {
467
467
  className: L("flex", e),
468
468
  "data-slot": "field-item",
469
469
  ...t
470
470
  });
471
471
  }
472
- function je({ className: e, ...t }) {
473
- return /* @__PURE__ */ m(j.Description, {
472
+ function Ae({ className: e, ...t }) {
473
+ return /* @__PURE__ */ h(j.Description, {
474
474
  className: L("overflow-hidden text-muted-foreground text-xs transition-[height,opacity,filter,translate] duration-300 ease-smooth-out starting:h-0 starting:translate-y-1 starting:opacity-0 starting:blur-[2px] motion-reduce:transition-none", e),
475
475
  "data-slot": "field-description",
476
476
  ...t
477
477
  });
478
478
  }
479
- function Me({ className: e, ...t }) {
480
- return /* @__PURE__ */ m(j.Error, {
479
+ function je({ className: e, ...t }) {
480
+ return /* @__PURE__ */ h(j.Error, {
481
481
  className: L("overflow-hidden text-destructive-foreground text-xs transition-[height,opacity,filter,translate] duration-300 ease-smooth-out starting:h-0 starting:translate-y-1 starting:opacity-0 starting:blur-[2px] motion-reduce:transition-none", e),
482
482
  "data-slot": "field-error",
483
483
  ...t
484
484
  });
485
485
  }
486
- var Ne = j.Control, Pe = j.Validity;
486
+ var Me = j.Control, Ne = j.Validity;
487
487
  //#endregion
488
488
  //#region src/components/ui/frame.tsx
489
- function Fe({ className: e, ...t }) {
490
- return /* @__PURE__ */ m("div", {
489
+ function Pe({ className: e, ...t }) {
490
+ return /* @__PURE__ */ h("div", {
491
491
  className: L("relative flex flex-col rounded-2xl bg-muted/72 p-1", "*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-1", e),
492
492
  "data-slot": "frame",
493
493
  ...t
494
494
  });
495
495
  }
496
- function Ie({ className: e, ...t }) {
497
- return /* @__PURE__ */ m("div", {
496
+ function Fe({ className: e, ...t }) {
497
+ return /* @__PURE__ */ h("div", {
498
498
  className: L("relative rounded-xl border bg-background bg-clip-padding p-5 shadow-xs/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]", e),
499
499
  "data-slot": "frame-panel",
500
500
  ...t
501
501
  });
502
502
  }
503
- function Le({ className: e, ...t }) {
504
- return /* @__PURE__ */ m("header", {
503
+ function Ie({ className: e, ...t }) {
504
+ return /* @__PURE__ */ h("header", {
505
505
  className: L("flex flex-col px-5 py-4", e),
506
506
  "data-slot": "frame-panel-header",
507
507
  ...t
508
508
  });
509
509
  }
510
- function Re({ className: e, ...t }) {
511
- return /* @__PURE__ */ m("div", {
510
+ function Le({ className: e, ...t }) {
511
+ return /* @__PURE__ */ h("div", {
512
512
  className: L("font-semibold text-sm", e),
513
513
  "data-slot": "frame-panel-title",
514
514
  ...t
515
515
  });
516
516
  }
517
- function ze({ className: e, ...t }) {
518
- return /* @__PURE__ */ m("div", {
517
+ function Re({ className: e, ...t }) {
518
+ return /* @__PURE__ */ h("div", {
519
519
  className: L("text-muted-foreground text-sm", e),
520
520
  "data-slot": "frame-panel-description",
521
521
  ...t
522
522
  });
523
523
  }
524
- function Be({ className: e, ...t }) {
525
- return /* @__PURE__ */ m("footer", {
524
+ function ze({ className: e, ...t }) {
525
+ return /* @__PURE__ */ h("footer", {
526
526
  className: L("px-5 py-4", e),
527
527
  "data-slot": "frame-panel-footer",
528
528
  ...t
@@ -530,19 +530,19 @@ function Be({ className: e, ...t }) {
530
530
  }
531
531
  //#endregion
532
532
  //#region src/components/ui/input.tsx
533
- function W({ className: e, size: t = "default", unstyled: n = !1, nativeInput: r = !1, style: i, ...a }) {
533
+ function K({ className: e, size: t = "default", unstyled: n = !1, nativeInput: r = !1, style: i, ...a }) {
534
534
  let o = L("h-8.5 w-full min-w-0 rounded-[inherit] px-[calc(--spacing(3)-1px)] leading-8.5 outline-none [transition:background-color_5000000s_ease-in-out_0s,height_300ms_var(--ease-smooth-out),line-height_300ms_var(--ease-smooth-out),padding_300ms_var(--ease-smooth-out),font-size_300ms_var(--ease-smooth-out)] placeholder:text-muted-foreground/72 motion-reduce:[transition:background-color_5000000s_ease-in-out_0s] sm:h-7.5 sm:leading-7.5", t === "sm" && "h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5", t === "lg" && "h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5", a.type === "search" && "[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none", a.type === "file" && "text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm");
535
- return /* @__PURE__ */ m("span", {
535
+ return /* @__PURE__ */ h("span", {
536
536
  className: L(!n && "relative inline-flex w-full rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-[box-shadow,border-color] duration-150 ease-smooth-out has-aria-invalid:animate-input-shake motion-reduce:animate-none motion-reduce:transition-none before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-visible:border-ring has-autofill:bg-foreground/4 has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none has-focus-visible:ring-[3px] sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]", e) || void 0,
537
537
  "data-size": t,
538
538
  "data-slot": "input-control",
539
- children: r ? /* @__PURE__ */ m("input", {
539
+ children: r ? /* @__PURE__ */ h("input", {
540
540
  className: o,
541
541
  "data-slot": "input",
542
542
  size: typeof t == "number" ? t : void 0,
543
543
  style: typeof i == "function" ? void 0 : i,
544
544
  ...a
545
- }) : /* @__PURE__ */ m(M, {
545
+ }) : /* @__PURE__ */ h(M, {
546
546
  className: o,
547
547
  "data-slot": "input",
548
548
  size: typeof t == "number" ? t : void 0,
@@ -553,19 +553,19 @@ function W({ className: e, size: t = "default", unstyled: n = !1, nativeInput: r
553
553
  }
554
554
  //#endregion
555
555
  //#region src/components/ui/textarea.tsx
556
- function Ve({ className: t, size: n = "default", unstyled: r = !1, ref: i, ...a }) {
557
- return /* @__PURE__ */ m("span", {
556
+ function Be({ className: t, size: n = "default", unstyled: r = !1, ref: i, ...a }) {
557
+ return /* @__PURE__ */ h("span", {
558
558
  className: L(!r && "relative inline-flex w-full rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-visible:border-ring has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none has-focus-visible:ring-[3px] not-has-disabled:has-not-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] sm:text-sm dark:bg-input/32 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:has-not-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]", t) || void 0,
559
559
  "data-size": n,
560
560
  "data-slot": "textarea-control",
561
- children: /* @__PURE__ */ m(A.Control, {
561
+ children: /* @__PURE__ */ h(te.Control, {
562
562
  ref: i,
563
563
  value: a.value,
564
564
  defaultValue: a.defaultValue,
565
565
  disabled: a.disabled,
566
566
  id: a.id,
567
567
  name: a.name,
568
- render: (t) => /* @__PURE__ */ m("textarea", {
568
+ render: (t) => /* @__PURE__ */ h("textarea", {
569
569
  className: L("field-sizing-content min-h-17.5 w-full rounded-[inherit] px-[calc(--spacing(3)-1px)] py-[calc(--spacing(1.5)-1px)] outline-none max-sm:min-h-20.5", n === "sm" && "min-h-16.5 px-[calc(--spacing(2.5)-1px)] py-[calc(--spacing(1)-1px)] max-sm:min-h-19.5", n === "lg" && "min-h-18.5 py-[calc(--spacing(2)-1px)] max-sm:min-h-21.5"),
570
570
  "data-slot": "textarea",
571
571
  ...e(t, a)
@@ -575,7 +575,7 @@ function Ve({ className: t, size: n = "default", unstyled: r = !1, ref: i, ...a
575
575
  }
576
576
  //#endregion
577
577
  //#region src/components/ui/input-group.tsx
578
- var He = n("flex h-auto cursor-text select-none items-center justify-center gap-2 leading-none [&>kbd]:rounded-[calc(var(--radius)-5px)] in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 [&_svg]:-mx-0.5 not-has-[button]:**:[svg:not([class*='opacity-'])]:opacity-80", {
578
+ var Ve = n("flex h-auto cursor-text select-none items-center justify-center gap-2 leading-none [&>kbd]:rounded-[calc(var(--radius)-5px)] in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 [&_svg]:-mx-0.5 not-has-[button]:**:[svg:not([class*='opacity-'])]:opacity-80", {
579
579
  defaultVariants: { align: "inline-start" },
580
580
  variants: { align: {
581
581
  "block-end": "order-last w-full justify-start px-[calc(--spacing(3)-1px)] pb-[calc(--spacing(3)-1px)] [.border-t]:pt-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]",
@@ -584,17 +584,17 @@ var He = n("flex h-auto cursor-text select-none items-center justify-center gap-
584
584
  "inline-start": "order-first ps-[calc(--spacing(3)-1px)] has-[>:last-child[data-slot=badge]]:-ms-1.5 has-[>button]:-ms-2 has-[>kbd:last-child]:ms-[-0.35rem] [[data-size=sm]+&]:ps-[calc(--spacing(2.5)-1px)]"
585
585
  } }
586
586
  });
587
- function Ue({ className: e, ...t }) {
588
- return /* @__PURE__ */ m("div", {
587
+ function He({ className: e, ...t }) {
588
+ return /* @__PURE__ */ h("div", {
589
589
  className: L("relative inline-flex w-full min-w-0 items-center rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_1px_--theme(--color-black/4%)] has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/64 has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/16 has-[textarea]:h-auto has-data-[align=block-end]:h-auto has-data-[align=block-start]:h-auto has-data-[align=block-end]:flex-col has-data-[align=block-start]:flex-col has-[input:focus-visible,textarea:focus-visible]:border-ring has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/36 has-autofill:bg-foreground/4 has-[input:disabled,textarea:disabled]:opacity-64 has-[input:disabled,textarea:disabled,input:focus-visible,textarea:focus-visible,input[aria-invalid],textarea[aria-invalid]]:shadow-none has-[input:focus-visible,textarea:focus-visible]:ring-[3px] sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/24 dark:not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_-1px_--theme(--color-white/6%)] has-data-[align=inline-start]:**:[[data-size=sm]_input]:ps-1.5 has-data-[align=inline-end]:**:[[data-size=sm]_input]:pe-1.5 *:[[data-slot=input-control],[data-slot=textarea-control]]:contents *:[[data-slot=input-control],[data-slot=textarea-control]]:before:hidden has-[[data-align=block-start],[data-align=block-end]]:**:[input]:h-auto has-data-[align=inline-start]:**:[input]:ps-2 has-data-[align=inline-end]:**:[input]:pe-2 has-data-[align=block-end]:**:[input]:pt-1.5 has-data-[align=block-start]:**:[input]:pb-1.5 **:[textarea]:min-h-20.5 **:[textarea]:resize-none **:[textarea]:py-[calc(--spacing(3)-1px)] **:[textarea]:max-sm:min-h-23.5 **:[textarea_button]:rounded-[calc(var(--radius-md)-1px)]", e),
590
590
  "data-slot": "input-group",
591
591
  role: "group",
592
592
  ...t
593
593
  });
594
594
  }
595
- function We({ className: e, align: t = "inline-start", ...n }) {
596
- return /* @__PURE__ */ m("div", {
597
- className: L(He({ align: t }), e),
595
+ function Ue({ className: e, align: t = "inline-start", ...n }) {
596
+ return /* @__PURE__ */ h("div", {
597
+ className: L(Ve({ align: t }), e),
598
598
  "data-align": t,
599
599
  "data-slot": "input-group-addon",
600
600
  onMouseDown: (e) => {
@@ -606,21 +606,21 @@ function We({ className: e, align: t = "inline-start", ...n }) {
606
606
  ...n
607
607
  });
608
608
  }
609
- function Ge({ className: e, ...t }) {
610
- return /* @__PURE__ */ m("span", {
609
+ function We({ className: e, ...t }) {
610
+ return /* @__PURE__ */ h("span", {
611
611
  className: L("line-clamp-1 flex items-center gap-2 whitespace-nowrap text-muted-foreground leading-none in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:-mx-0.5", e),
612
612
  ...t
613
613
  });
614
614
  }
615
- function Ke({ className: e, ...t }) {
616
- return /* @__PURE__ */ m(W, {
615
+ function Ge({ className: e, ...t }) {
616
+ return /* @__PURE__ */ h(K, {
617
617
  className: e,
618
618
  unstyled: !0,
619
619
  ...t
620
620
  });
621
621
  }
622
- function qe({ className: e, ...t }) {
623
- return /* @__PURE__ */ m(Ve, {
622
+ function Ke({ className: e, ...t }) {
623
+ return /* @__PURE__ */ h(Be, {
624
624
  className: e,
625
625
  unstyled: !0,
626
626
  ...t
@@ -628,7 +628,7 @@ function qe({ className: e, ...t }) {
628
628
  }
629
629
  //#endregion
630
630
  //#region src/components/ui/label.tsx
631
- function Je({ className: n, render: r, sound: i = !1, ...a }) {
631
+ function qe({ className: n, render: r, sound: i = !1, ...a }) {
632
632
  return t({
633
633
  defaultTagName: "label",
634
634
  props: e({
@@ -641,8 +641,8 @@ function Je({ className: n, render: r, sound: i = !1, ...a }) {
641
641
  }
642
642
  //#endregion
643
643
  //#region src/components/ui/separator.tsx
644
- function G({ className: e, orientation: t = "horizontal", ...n }) {
645
- return /* @__PURE__ */ m(P, {
644
+ function Je({ className: e, orientation: t = "horizontal", ...n }) {
645
+ return /* @__PURE__ */ h(ne, {
646
646
  className: L("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:not-[[class^='h-']]:not-[[class*='_h-']]:self-stretch", e),
647
647
  "data-slot": "separator",
648
648
  orientation: t,
@@ -652,19 +652,19 @@ function G({ className: e, orientation: t = "horizontal", ...n }) {
652
652
  //#endregion
653
653
  //#region src/components/ui/otp-field.tsx
654
654
  function Ye({ className: e, size: t = "default", sound: n = !0, onValueChange: r, ...i }) {
655
- let a = g.useRef(String(i.value ?? i.defaultValue ?? "").length);
656
- return /* @__PURE__ */ m(N.Root, {
655
+ let a = _.useRef(String(i.value ?? i.defaultValue ?? "").length);
656
+ return /* @__PURE__ */ h(N.Root, {
657
657
  className: L("flex items-center gap-2 has-disabled:opacity-64 has-disabled:**:data-[slot=otp-field-input]:shadow-none has-disabled:**:data-[slot=otp-field-input]:before:shadow-none!", e),
658
658
  "data-size": t,
659
659
  "data-slot": "otp-field",
660
660
  onValueChange: (e, ...t) => {
661
- n && e.length > a.current && B("tick"), a.current = e.length, r?.(e, ...t);
661
+ n && e.length > a.current && De("tick"), a.current = e.length, r?.(e, ...t);
662
662
  },
663
663
  ...i
664
664
  });
665
665
  }
666
666
  function Xe({ className: e, ...t }) {
667
- return /* @__PURE__ */ m(N.Input, {
667
+ return /* @__PURE__ */ h(N.Input, {
668
668
  className: L("relative in-[[data-slot=otp-field][data-size=lg]]:size-10 size-9 min-w-0 rounded-lg border border-input bg-background not-dark:bg-clip-padding text-center in-[[data-slot=otp-field][data-size=lg]]:text-lg text-base text-foreground in-[[data-slot=otp-field][data-size=lg]]:leading-10 leading-9 shadow-xs/5 outline-none ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-focus-visible:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-visible:z-10 focus-visible:border-ring focus-visible:shadow-none focus-visible:ring-[3px] focus-visible:ring-ring/24 aria-invalid:border-destructive/36 aria-invalid:shadow-none aria-invalid:focus-visible:border-destructive/64 aria-invalid:focus-visible:ring-destructive/16 sm:in-[[data-slot=otp-field][data-size=lg]]:size-9 sm:size-8 sm:in-[[data-slot=otp-field][data-size=lg]]:text-base sm:text-sm sm:in-[[data-slot=otp-field][data-size=lg]]:leading-9 sm:leading-8 dark:bg-input/32 dark:aria-invalid:focus-visible:ring-destructive/24 dark:not-focus-visible:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]", e),
669
669
  "data-slot": "otp-field-input",
670
670
  spellCheck: !1,
@@ -672,7 +672,7 @@ function Xe({ className: e, ...t }) {
672
672
  });
673
673
  }
674
674
  function Ze({ className: e, ...t }) {
675
- return /* @__PURE__ */ m(N.Separator, { render: /* @__PURE__ */ m(G, {
675
+ return /* @__PURE__ */ h(N.Separator, { render: /* @__PURE__ */ h(Je, {
676
676
  className: L("rounded-full bg-input data-[orientation=horizontal]:h-0.5 data-[orientation=horizontal]:w-3", e),
677
677
  orientation: "horizontal",
678
678
  ...t
@@ -685,7 +685,7 @@ var Qe = [
685
685
  1,
686
686
  .36,
687
687
  1
688
- ], K = [
688
+ ], $e = [
689
689
  {
690
690
  regex: /.{8,}/,
691
691
  text: "At least 8 characters"
@@ -703,21 +703,21 @@ var Qe = [
703
703
  text: "At least 1 uppercase letter"
704
704
  }
705
705
  ];
706
- function $e(e) {
707
- return K.filter((t) => t.regex.test(e)).length;
706
+ function et(e) {
707
+ return $e.filter((t) => t.regex.test(e)).length;
708
708
  }
709
- var et = [
709
+ var tt = [
710
710
  "bg-border",
711
711
  "bg-red-500",
712
712
  "bg-orange-500",
713
713
  "bg-amber-500",
714
714
  "bg-emerald-500"
715
715
  ];
716
- function tt({ visibilityToggle: e = !0, showStrength: t = !1, sound: n = !0, className: r, value: i, defaultValue: a, onChange: l, ...u }) {
717
- let [d, p] = g.useState(!1), [_, v] = g.useState(String(a ?? "")), y = i === void 0 ? _ : String(i), b = $e(y);
718
- return /* @__PURE__ */ h("div", {
716
+ function q({ visibilityToggle: e = !0, showStrength: t = !1, sound: n = !0, className: r, value: i, defaultValue: a, onChange: l, ...u }) {
717
+ let [d, f] = _.useState(!1), [m, v] = _.useState(String(a ?? "")), y = i === void 0 ? m : String(i), b = et(y);
718
+ return /* @__PURE__ */ g("div", {
719
719
  className: L("flex w-full flex-col gap-3", r),
720
- children: [/* @__PURE__ */ h(Ue, { children: [/* @__PURE__ */ m(Ke, {
720
+ children: [/* @__PURE__ */ g(He, { children: [/* @__PURE__ */ h(Ge, {
721
721
  placeholder: "Enter your password",
722
722
  ...u,
723
723
  type: d ? "text" : "password",
@@ -725,20 +725,20 @@ function tt({ visibilityToggle: e = !0, showStrength: t = !1, sound: n = !0, cla
725
725
  onChange: (e) => {
726
726
  v(e.target.value), l?.(e);
727
727
  }
728
- }), e && /* @__PURE__ */ m(We, {
728
+ }), e && /* @__PURE__ */ h(Ue, {
729
729
  align: "inline-end",
730
- children: /* @__PURE__ */ m(R, {
730
+ children: /* @__PURE__ */ h(z, {
731
731
  "aria-label": d ? "Hide password" : "Show password",
732
732
  onClick: () => {
733
- n && B(d ? "droplet" : "bloom"), p((e) => !e);
733
+ n && De(d ? "droplet" : "bloom"), f((e) => !e);
734
734
  },
735
735
  size: "icon-xs",
736
736
  variant: "ghost",
737
737
  sound: !1,
738
- children: /* @__PURE__ */ m(F, {
738
+ children: /* @__PURE__ */ h(P, {
739
739
  mode: "wait",
740
740
  initial: !1,
741
- children: /* @__PURE__ */ m(I.span, {
741
+ children: /* @__PURE__ */ h(I.span, {
742
742
  className: "inline-flex",
743
743
  initial: {
744
744
  opacity: 0,
@@ -759,13 +759,13 @@ function tt({ visibilityToggle: e = !0, showStrength: t = !1, sound: n = !0, cla
759
759
  duration: .15,
760
760
  ease: Qe
761
761
  },
762
- children: m(d ? c : s, { "aria-hidden": "true" })
762
+ children: h(d ? c : s, { "aria-hidden": "true" })
763
763
  }, d ? "off" : "on")
764
764
  })
765
765
  })
766
- })] }), /* @__PURE__ */ m(F, {
766
+ })] }), /* @__PURE__ */ h(P, {
767
767
  initial: !1,
768
- children: t && /* @__PURE__ */ h(I.div, {
768
+ children: t && /* @__PURE__ */ g(I.div, {
769
769
  className: "flex flex-col gap-2 overflow-hidden",
770
770
  initial: {
771
771
  height: 0,
@@ -783,37 +783,37 @@ function tt({ visibilityToggle: e = !0, showStrength: t = !1, sound: n = !0, cla
783
783
  duration: .25,
784
784
  ease: Qe
785
785
  },
786
- children: [/* @__PURE__ */ m("div", {
786
+ children: [/* @__PURE__ */ h("div", {
787
787
  "aria-label": "Password strength",
788
788
  "aria-valuemax": 4,
789
789
  "aria-valuemin": 0,
790
790
  "aria-valuenow": b,
791
791
  className: "h-1 w-full overflow-hidden rounded-full bg-border",
792
792
  role: "progressbar",
793
- children: /* @__PURE__ */ m(I.div, {
794
- className: L("h-full rounded-full", et[b]),
793
+ children: /* @__PURE__ */ h(I.div, {
794
+ className: L("h-full rounded-full", tt[b]),
795
795
  animate: { width: `${b / 4 * 100}%` },
796
796
  transition: {
797
797
  duration: .4,
798
798
  ease: Qe
799
799
  }
800
800
  })
801
- }), /* @__PURE__ */ m("ul", {
801
+ }), /* @__PURE__ */ h("ul", {
802
802
  "aria-label": "Password requirements",
803
803
  className: "flex flex-col gap-1",
804
- children: K.map((e) => {
804
+ children: $e.map((e) => {
805
805
  let t = e.regex.test(y);
806
- return /* @__PURE__ */ h("li", {
806
+ return /* @__PURE__ */ g("li", {
807
807
  className: "flex items-center gap-2 text-xs",
808
- children: [t ? /* @__PURE__ */ m(o, {
808
+ children: [t ? /* @__PURE__ */ h(o, {
809
809
  "aria-hidden": "true",
810
810
  className: "size-3.5 text-emerald-500"
811
- }) : /* @__PURE__ */ m(f, {
811
+ }) : /* @__PURE__ */ h(p, {
812
812
  "aria-hidden": "true",
813
813
  className: "size-3.5 text-muted-foreground/80"
814
- }), /* @__PURE__ */ h("span", {
814
+ }), /* @__PURE__ */ g("span", {
815
815
  className: t ? "text-emerald-600" : "text-muted-foreground",
816
- children: [e.text, /* @__PURE__ */ m("span", {
816
+ children: [e.text, /* @__PURE__ */ h("span", {
817
817
  className: "sr-only",
818
818
  children: t ? " - met" : " - not met"
819
819
  })]
@@ -830,19 +830,19 @@ function tt({ visibilityToggle: e = !0, showStrength: t = !1, sound: n = !0, cla
830
830
  var nt = {
831
831
  google: {
832
832
  label: "Google",
833
- Icon: ie
833
+ Icon: ae
834
834
  },
835
835
  apple: {
836
836
  label: "Apple",
837
- Icon: ne
837
+ Icon: re
838
838
  },
839
839
  github: {
840
840
  label: "GitHub",
841
- Icon: re
841
+ Icon: ie
842
842
  },
843
843
  x: {
844
844
  label: "X",
845
- Icon: ae
845
+ Icon: oe
846
846
  }
847
847
  }, rt = {
848
848
  login: "Login with",
@@ -855,11 +855,11 @@ function it({ providers: e = [
855
855
  "github"
856
856
  ], action: t = "continue", layout: n = "stack", loadingProvider: r = null, disabled: i = !1, onSelect: a, className: o }) {
857
857
  let s = n === "row";
858
- return /* @__PURE__ */ m("div", {
858
+ return /* @__PURE__ */ h("div", {
859
859
  className: L("flex w-full gap-2", s ? "flex-row justify-center" : "flex-col", o),
860
860
  children: e.map((e) => {
861
861
  let { label: n, Icon: o } = nt[e];
862
- return /* @__PURE__ */ h(R, {
862
+ return /* @__PURE__ */ g(z, {
863
863
  variant: "outline",
864
864
  size: s ? "icon" : "default",
865
865
  className: s ? void 0 : "w-full",
@@ -867,7 +867,7 @@ function it({ providers: e = [
867
867
  loading: r === e,
868
868
  disabled: i || r !== null && r !== e,
869
869
  onClick: () => a?.(e),
870
- children: [/* @__PURE__ */ m(o, { "aria-hidden": "true" }), !s && /* @__PURE__ */ h("span", {
870
+ children: [/* @__PURE__ */ h(o, { "aria-hidden": "true" }), !s && /* @__PURE__ */ g("span", {
871
871
  className: "flex-1",
872
872
  children: [
873
873
  rt[t],
@@ -892,38 +892,38 @@ var at = {
892
892
  "--auth-accent-image": "linear-gradient(44deg in oklab, rgba(29,0,202,0.66) 3%, #3B0080 37%, rgba(36,0,72,0.86) 98%)",
893
893
  "--auth-accent-foreground": "oklch(0.985 0 0)"
894
894
  }
895
- }, ot = "border-transparent bg-[var(--auth-accent)] bg-[image:var(--auth-accent-image)] text-[var(--auth-accent-foreground)] shadow-none hover:bg-[var(--auth-accent)] hover:brightness-110 data-pressed:bg-[var(--auth-accent)] data-pressed:brightness-110 *:data-[slot=button-loading-indicator]:text-[var(--auth-accent-foreground)]", q = [
895
+ }, ot = "border-transparent bg-[var(--auth-accent)] bg-[image:var(--auth-accent-image)] text-[var(--auth-accent-foreground)] shadow-none hover:bg-[var(--auth-accent)] hover:brightness-110 data-pressed:bg-[var(--auth-accent)] data-pressed:brightness-110 *:data-[slot=button-loading-indicator]:text-[var(--auth-accent-foreground)]", J = [
896
896
  .22,
897
897
  1,
898
898
  .36,
899
899
  1
900
900
  ];
901
- function J({ title: e, description: t, children: n, footer: r, className: i, logo: a, accent: o }) {
902
- return /* @__PURE__ */ m(te, {
901
+ function Y({ title: e, description: t, children: n, footer: r, className: i, logo: a, accent: o }) {
902
+ return /* @__PURE__ */ h(F, {
903
903
  reducedMotion: "user",
904
- children: /* @__PURE__ */ m(Fe, {
904
+ children: /* @__PURE__ */ h(Pe, {
905
905
  className: L("w-full max-w-sm", i),
906
906
  "data-accent": o,
907
907
  style: o ? at[o] : void 0,
908
- children: /* @__PURE__ */ h(I.div, {
908
+ children: /* @__PURE__ */ g(I.div, {
909
909
  layout: !0,
910
910
  transition: {
911
911
  duration: .3,
912
- ease: q
912
+ ease: J
913
913
  },
914
914
  className: "flex flex-col",
915
- children: [/* @__PURE__ */ h(ge, { children: [/* @__PURE__ */ h(Ce, { children: [
916
- a && /* @__PURE__ */ m("div", {
915
+ children: [/* @__PURE__ */ g(B, { children: [/* @__PURE__ */ g(V, { children: [
916
+ a && /* @__PURE__ */ h("div", {
917
917
  className: "mb-1.5 flex items-center [&_img:not([class*='h-'])]:h-8 [&_img]:w-auto [&_svg:not([class*='size-'])]:size-8",
918
918
  "data-slot": "auth-logo",
919
919
  children: a
920
920
  }),
921
- /* @__PURE__ */ m(we, { children: e }),
922
- t && /* @__PURE__ */ m(Te, { children: t })
923
- ] }), /* @__PURE__ */ m(z, {
921
+ /* @__PURE__ */ h(H, { children: e }),
922
+ t && /* @__PURE__ */ h(Se, { children: t })
923
+ ] }), /* @__PURE__ */ h(U, {
924
924
  className: "overflow-hidden",
925
925
  children: n
926
- })] }), r && /* @__PURE__ */ m(Be, {
926
+ })] }), r && /* @__PURE__ */ h(ze, {
927
927
  className: "text-center text-sm text-muted-foreground",
928
928
  children: r
929
929
  })]
@@ -931,11 +931,11 @@ function J({ title: e, description: t, children: n, footer: r, className: i, log
931
931
  })
932
932
  });
933
933
  }
934
- function Y({ step: e, children: t, className: n }) {
935
- return /* @__PURE__ */ m(F, {
934
+ function X({ step: e, children: t, className: n }) {
935
+ return /* @__PURE__ */ h(P, {
936
936
  mode: "popLayout",
937
937
  initial: !1,
938
- children: /* @__PURE__ */ m(I.div, {
938
+ children: /* @__PURE__ */ h(I.div, {
939
939
  className: n,
940
940
  initial: {
941
941
  opacity: 0,
@@ -954,23 +954,23 @@ function Y({ step: e, children: t, className: n }) {
954
954
  },
955
955
  transition: {
956
956
  duration: .25,
957
- ease: q
957
+ ease: J
958
958
  },
959
959
  children: t
960
960
  }, e)
961
961
  });
962
962
  }
963
- function X({ show: e, children: t, className: n }) {
964
- let [r, i] = g.useState({
963
+ function Z({ show: e, children: t, className: n }) {
964
+ let [r, i] = _.useState({
965
965
  show: e,
966
966
  settled: e
967
967
  });
968
968
  return r.show !== e && i({
969
969
  show: e,
970
970
  settled: !1
971
- }), /* @__PURE__ */ m(F, {
971
+ }), /* @__PURE__ */ h(P, {
972
972
  initial: !1,
973
- children: e && /* @__PURE__ */ m(I.div, {
973
+ children: e && /* @__PURE__ */ h(I.div, {
974
974
  className: L(!r.settled && "overflow-hidden", n),
975
975
  initial: {
976
976
  height: 0,
@@ -992,7 +992,7 @@ function X({ show: e, children: t, className: n }) {
992
992
  },
993
993
  transition: {
994
994
  duration: .25,
995
- ease: q
995
+ ease: J
996
996
  },
997
997
  onAnimationComplete: () => i((e) => ({
998
998
  ...e,
@@ -1002,10 +1002,10 @@ function X({ show: e, children: t, className: n }) {
1002
1002
  })
1003
1003
  });
1004
1004
  }
1005
- function Z({ message: e }) {
1006
- return /* @__PURE__ */ m(F, {
1005
+ function Q({ message: e }) {
1006
+ return /* @__PURE__ */ h(P, {
1007
1007
  initial: !1,
1008
- children: e && /* @__PURE__ */ m(I.p, {
1008
+ children: e && /* @__PURE__ */ h(I.p, {
1009
1009
  role: "alert",
1010
1010
  className: "text-sm text-destructive-foreground",
1011
1011
  initial: {
@@ -1030,7 +1030,7 @@ function Z({ message: e }) {
1030
1030
  },
1031
1031
  transition: {
1032
1032
  duration: .25,
1033
- ease: q,
1033
+ ease: J,
1034
1034
  x: {
1035
1035
  duration: .4,
1036
1036
  ease: "easeInOut"
@@ -1040,11 +1040,11 @@ function Z({ message: e }) {
1040
1040
  }, e)
1041
1041
  });
1042
1042
  }
1043
- function Q({ title: e, description: t, children: n }) {
1044
- return /* @__PURE__ */ h("div", {
1043
+ function $({ title: e, description: t, children: n }) {
1044
+ return /* @__PURE__ */ g("div", {
1045
1045
  className: "flex flex-col items-center gap-3 py-4 text-center",
1046
1046
  children: [
1047
- /* @__PURE__ */ m(I.span, {
1047
+ /* @__PURE__ */ h(I.span, {
1048
1048
  className: "flex size-12 items-center justify-center rounded-full bg-emerald-500/12 text-emerald-600",
1049
1049
  initial: {
1050
1050
  scale: .6,
@@ -1056,9 +1056,9 @@ function Q({ title: e, description: t, children: n }) {
1056
1056
  },
1057
1057
  transition: {
1058
1058
  duration: .4,
1059
- ease: q
1059
+ ease: J
1060
1060
  },
1061
- children: /* @__PURE__ */ m("svg", {
1061
+ children: /* @__PURE__ */ h("svg", {
1062
1062
  "aria-hidden": "true",
1063
1063
  viewBox: "0 0 24 24",
1064
1064
  className: "size-6",
@@ -1067,24 +1067,24 @@ function Q({ title: e, description: t, children: n }) {
1067
1067
  strokeWidth: "2.5",
1068
1068
  strokeLinecap: "round",
1069
1069
  strokeLinejoin: "round",
1070
- children: /* @__PURE__ */ m(I.path, {
1070
+ children: /* @__PURE__ */ h(I.path, {
1071
1071
  d: "M4 12.5l5 5L20 6.5",
1072
1072
  initial: { pathLength: 0 },
1073
1073
  animate: { pathLength: 1 },
1074
1074
  transition: {
1075
1075
  duration: .4,
1076
1076
  delay: .15,
1077
- ease: q
1077
+ ease: J
1078
1078
  }
1079
1079
  })
1080
1080
  })
1081
1081
  }),
1082
- /* @__PURE__ */ h("div", {
1082
+ /* @__PURE__ */ g("div", {
1083
1083
  className: "flex flex-col gap-1",
1084
- children: [/* @__PURE__ */ m("p", {
1084
+ children: [/* @__PURE__ */ h("p", {
1085
1085
  className: "font-medium",
1086
1086
  children: e
1087
- }), t && /* @__PURE__ */ m("p", {
1087
+ }), t && /* @__PURE__ */ h("p", {
1088
1088
  className: "text-sm text-muted-foreground",
1089
1089
  children: t
1090
1090
  })]
@@ -1093,21 +1093,21 @@ function Q({ title: e, description: t, children: n }) {
1093
1093
  ]
1094
1094
  });
1095
1095
  }
1096
- function $({ label: e = "Or" }) {
1097
- return /* @__PURE__ */ h("div", {
1096
+ function st({ label: e = "Or" }) {
1097
+ return /* @__PURE__ */ g("div", {
1098
1098
  className: "flex items-center gap-3",
1099
1099
  children: [
1100
- /* @__PURE__ */ m(G, { className: "flex-1" }),
1101
- /* @__PURE__ */ m("span", {
1100
+ /* @__PURE__ */ h(Je, { className: "flex-1" }),
1101
+ /* @__PURE__ */ h("span", {
1102
1102
  className: "text-xs text-muted-foreground uppercase",
1103
1103
  children: e
1104
1104
  }),
1105
- /* @__PURE__ */ m(G, { className: "flex-1" })
1105
+ /* @__PURE__ */ h(Je, { className: "flex-1" })
1106
1106
  ]
1107
1107
  });
1108
1108
  }
1109
- function st(e, t) {
1110
- let [n, r] = g.useState({
1109
+ function ct(e, t) {
1110
+ let [n, r] = _.useState({
1111
1111
  restartKey: t,
1112
1112
  seconds: e,
1113
1113
  remaining: e
@@ -1116,7 +1116,7 @@ function st(e, t) {
1116
1116
  restartKey: t,
1117
1117
  seconds: e,
1118
1118
  remaining: e
1119
- }), g.useEffect(() => {
1119
+ }), _.useEffect(() => {
1120
1120
  if (e <= 0) return;
1121
1121
  let t = window.setInterval(() => {
1122
1122
  r((e) => e.remaining <= 0 ? e : {
@@ -1129,53 +1129,53 @@ function st(e, t) {
1129
1129
  }
1130
1130
  //#endregion
1131
1131
  //#region src/components/blocks/auth/code-auth-block.tsx
1132
- function ct({ channel: e = "email", logo: t, accent: n, destination: r, length: i = 6, autoSubmit: a = !0, resendSeconds: o = 30, onVerify: s, onResend: c, onBack: l }) {
1133
- let [f, _] = g.useState("idle"), [v, y] = g.useState(null), [b, x] = g.useState(""), [S, C] = g.useState(0), w = st(o, S), T = e === "sms" ? d : u, E = e === "sms" ? "phone" : "email", D = g.useCallback(async (e) => {
1134
- y(null), _("loading");
1132
+ function lt({ channel: e = "email", logo: t, accent: n, destination: r, length: i = 6, autoSubmit: a = !0, resendSeconds: o = 30, onVerify: s, onResend: c, onBack: l }) {
1133
+ let [u, p] = _.useState("idle"), [v, y] = _.useState(null), [b, x] = _.useState(""), [S, C] = _.useState(0), w = ct(o, S), T = e === "sms" ? f : d, E = e === "sms" ? "phone" : "email", D = _.useCallback(async (e) => {
1134
+ y(null), p("loading");
1135
1135
  try {
1136
- await s?.(e), _("success");
1136
+ await s?.(e), p("success");
1137
1137
  } catch (e) {
1138
- _("idle"), x(""), y(e instanceof Error ? e.message : "Invalid code.");
1138
+ p("idle"), x(""), y(e instanceof Error ? e.message : "Invalid code.");
1139
1139
  }
1140
1140
  }, [s]);
1141
1141
  function O(e) {
1142
- x(e), v && y(null), a && e.length === i && f === "idle" && D(e);
1142
+ x(e), v && y(null), a && e.length === i && u === "idle" && D(e);
1143
1143
  }
1144
1144
  async function k() {
1145
1145
  C((e) => e + 1), x(""), y(null), await c?.();
1146
1146
  }
1147
- return /* @__PURE__ */ m(J, {
1147
+ return /* @__PURE__ */ h(Y, {
1148
1148
  title: "Enter verification code",
1149
1149
  logo: t,
1150
1150
  accent: n,
1151
- description: /* @__PURE__ */ h("span", {
1151
+ description: /* @__PURE__ */ g("span", {
1152
1152
  className: "inline-flex items-center gap-1.5",
1153
- children: [/* @__PURE__ */ m(T, { className: "size-3.5 shrink-0" }), /* @__PURE__ */ h("span", { children: [
1153
+ children: [/* @__PURE__ */ h(T, { className: "size-3.5 shrink-0" }), /* @__PURE__ */ g("span", { children: [
1154
1154
  "We sent a ",
1155
1155
  i,
1156
1156
  "-digit code to your ",
1157
1157
  E,
1158
- r ? /* @__PURE__ */ h(p, { children: [" ", /* @__PURE__ */ m("span", {
1158
+ r ? /* @__PURE__ */ g(m, { children: [" ", /* @__PURE__ */ h("span", {
1159
1159
  className: "font-medium text-foreground",
1160
1160
  children: r
1161
1161
  })] }) : null,
1162
1162
  "."
1163
1163
  ] })]
1164
1164
  }),
1165
- footer: f !== "success" && /* @__PURE__ */ h(R, {
1165
+ footer: u !== "success" && /* @__PURE__ */ g(z, {
1166
1166
  variant: "link",
1167
1167
  onClick: l,
1168
1168
  children: ["Use a different ", E]
1169
1169
  }),
1170
- children: /* @__PURE__ */ m(Y, {
1171
- step: f === "success" ? "success" : "form",
1172
- children: f === "success" ? /* @__PURE__ */ m(Q, {
1170
+ children: /* @__PURE__ */ h(X, {
1171
+ step: u === "success" ? "success" : "form",
1172
+ children: u === "success" ? /* @__PURE__ */ h($, {
1173
1173
  title: "Verified",
1174
1174
  description: "Your identity has been confirmed."
1175
- }) : /* @__PURE__ */ h("div", {
1175
+ }) : /* @__PURE__ */ g("div", {
1176
1176
  className: "flex flex-col items-center gap-4",
1177
1177
  children: [
1178
- /* @__PURE__ */ m(I.div, {
1178
+ /* @__PURE__ */ h(I.div, {
1179
1179
  animate: v ? { x: [
1180
1180
  0,
1181
1181
  -8,
@@ -1188,42 +1188,42 @@ function ct({ channel: e = "email", logo: t, accent: n, destination: r, length:
1188
1188
  duration: .4,
1189
1189
  ease: "easeInOut"
1190
1190
  },
1191
- children: /* @__PURE__ */ m(Ye, {
1191
+ children: /* @__PURE__ */ h(Ye, {
1192
1192
  length: i,
1193
1193
  value: b,
1194
1194
  onValueChange: O,
1195
- disabled: f === "loading",
1196
- children: Array.from({ length: i }, (e, t) => /* @__PURE__ */ m(Xe, {
1195
+ disabled: u === "loading",
1196
+ children: Array.from({ length: i }, (e, t) => /* @__PURE__ */ h(Xe, {
1197
1197
  "aria-invalid": v ? !0 : void 0,
1198
1198
  "aria-label": `Digit ${t + 1} of ${i}`
1199
1199
  }, `slot-${t}`))
1200
1200
  })
1201
1201
  }, v ?? "steady"),
1202
- /* @__PURE__ */ m(Z, { message: v }),
1203
- !a && /* @__PURE__ */ m(R, {
1202
+ /* @__PURE__ */ h(Q, { message: v }),
1203
+ !a && /* @__PURE__ */ h(z, {
1204
1204
  className: L("w-full", n && "border-transparent bg-[var(--auth-accent)] bg-[image:var(--auth-accent-image)] text-[var(--auth-accent-foreground)] shadow-none hover:bg-[var(--auth-accent)] hover:brightness-110 data-pressed:bg-[var(--auth-accent)] data-pressed:brightness-110 *:data-[slot=button-loading-indicator]:text-[var(--auth-accent-foreground)]"),
1205
- loading: f === "loading",
1205
+ loading: u === "loading",
1206
1206
  disabled: b.length !== i,
1207
1207
  onClick: () => void D(b),
1208
1208
  children: "Verify"
1209
1209
  }),
1210
- /* @__PURE__ */ m(I.p, {
1210
+ /* @__PURE__ */ h(I.p, {
1211
1211
  layout: !0,
1212
1212
  transition: {
1213
1213
  duration: .25,
1214
- ease: q
1214
+ ease: J
1215
1215
  },
1216
1216
  className: "text-center text-sm text-muted-foreground",
1217
- children: w > 0 ? /* @__PURE__ */ h(p, { children: [
1217
+ children: w > 0 ? /* @__PURE__ */ g(m, { children: [
1218
1218
  "Resend code in",
1219
1219
  " ",
1220
- /* @__PURE__ */ h("span", {
1220
+ /* @__PURE__ */ g("span", {
1221
1221
  className: "font-medium tabular-nums text-foreground",
1222
1222
  children: [w, "s"]
1223
1223
  })
1224
- ] }) : /* @__PURE__ */ m(R, {
1224
+ ] }) : /* @__PURE__ */ h(z, {
1225
1225
  variant: "link",
1226
- disabled: f === "loading",
1226
+ disabled: u === "loading",
1227
1227
  onClick: () => void k(),
1228
1228
  children: "Resend code"
1229
1229
  })
@@ -1235,8 +1235,8 @@ function ct({ channel: e = "email", logo: t, accent: n, destination: r, length:
1235
1235
  }
1236
1236
  //#endregion
1237
1237
  //#region src/components/blocks/auth/forgot-password-block.tsx
1238
- function lt({ title: e = "Reset your password", logo: t, accent: n, description: r = "Enter your email and we will send you a reset link", onSubmit: i, onBackToLogin: o }) {
1239
- let s = g.useId(), [c, l] = g.useState("idle"), [u, d] = g.useState(null), [f, _] = g.useState("");
1238
+ function ut({ title: e = "Reset your password", logo: t, accent: n, description: r = "Enter your email and we will send you a reset link", onSubmit: i, onBackToLogin: o }) {
1239
+ let s = _.useId(), [c, l] = _.useState("idle"), [u, d] = _.useState(null), [f, p] = _.useState("");
1240
1240
  async function v(e) {
1241
1241
  e.preventDefault(), d(null), l("loading");
1242
1242
  try {
@@ -1245,46 +1245,46 @@ function lt({ title: e = "Reset your password", logo: t, accent: n, description:
1245
1245
  l("idle"), d(e instanceof Error ? e.message : "Unable to send reset link.");
1246
1246
  }
1247
1247
  }
1248
- return /* @__PURE__ */ m(J, {
1248
+ return /* @__PURE__ */ h(Y, {
1249
1249
  title: e,
1250
1250
  description: r,
1251
1251
  logo: t,
1252
1252
  accent: n,
1253
- footer: /* @__PURE__ */ h(R, {
1253
+ footer: /* @__PURE__ */ g(z, {
1254
1254
  variant: "link",
1255
1255
  className: "gap-1",
1256
1256
  onClick: o,
1257
- children: [/* @__PURE__ */ m(a, { className: "size-3.5" }), "Back to login"]
1257
+ children: [/* @__PURE__ */ h(a, { className: "size-3.5" }), "Back to login"]
1258
1258
  }),
1259
- children: /* @__PURE__ */ m(Y, {
1259
+ children: /* @__PURE__ */ h(X, {
1260
1260
  step: c === "success" ? "success" : "form",
1261
- children: c === "success" ? /* @__PURE__ */ m(Q, {
1261
+ children: c === "success" ? /* @__PURE__ */ h($, {
1262
1262
  title: "Check your inbox",
1263
- description: /* @__PURE__ */ h(p, { children: [
1263
+ description: /* @__PURE__ */ g(m, { children: [
1264
1264
  "We sent a password reset link to",
1265
1265
  " ",
1266
- /* @__PURE__ */ m("span", {
1266
+ /* @__PURE__ */ h("span", {
1267
1267
  className: "font-medium text-foreground",
1268
1268
  children: f
1269
1269
  }),
1270
1270
  "."
1271
1271
  ] }),
1272
- children: /* @__PURE__ */ m(R, {
1272
+ children: /* @__PURE__ */ h(z, {
1273
1273
  variant: "link",
1274
1274
  className: "text-xs sm:text-xs",
1275
1275
  onClick: () => l("idle"),
1276
1276
  children: "Use a different email"
1277
1277
  })
1278
- }) : /* @__PURE__ */ h("form", {
1278
+ }) : /* @__PURE__ */ g("form", {
1279
1279
  className: "flex flex-col gap-4",
1280
1280
  onSubmit: v,
1281
1281
  children: [
1282
- /* @__PURE__ */ h(H, {
1282
+ /* @__PURE__ */ g(W, {
1283
1283
  name: "email",
1284
- children: [/* @__PURE__ */ m(U, {
1284
+ children: [/* @__PURE__ */ h(G, {
1285
1285
  htmlFor: s,
1286
1286
  children: "Email"
1287
- }), /* @__PURE__ */ m(W, {
1287
+ }), /* @__PURE__ */ h(K, {
1288
1288
  id: s,
1289
1289
  name: "email",
1290
1290
  type: "email",
@@ -1293,11 +1293,11 @@ function lt({ title: e = "Reset your password", logo: t, accent: n, description:
1293
1293
  required: !0,
1294
1294
  disabled: c === "loading",
1295
1295
  value: f,
1296
- onChange: (e) => _(e.target.value)
1296
+ onChange: (e) => p(e.target.value)
1297
1297
  })]
1298
1298
  }),
1299
- /* @__PURE__ */ m(Z, { message: u }),
1300
- /* @__PURE__ */ m(R, {
1299
+ /* @__PURE__ */ h(Q, { message: u }),
1300
+ /* @__PURE__ */ h(z, {
1301
1301
  className: L("w-full", n && "border-transparent bg-[var(--auth-accent)] bg-[image:var(--auth-accent-image)] text-[var(--auth-accent-foreground)] shadow-none hover:bg-[var(--auth-accent)] hover:brightness-110 data-pressed:bg-[var(--auth-accent)] data-pressed:brightness-110 *:data-[slot=button-loading-indicator]:text-[var(--auth-accent-foreground)]"),
1302
1302
  type: "submit",
1303
1303
  loading: c === "loading",
@@ -1309,15 +1309,150 @@ function lt({ title: e = "Reset your password", logo: t, accent: n, description:
1309
1309
  });
1310
1310
  }
1311
1311
  //#endregion
1312
+ //#region src/components/blocks/auth/linked-accounts-block.tsx
1313
+ var dt = "This is your only way to sign in, so it can't be disconnected.";
1314
+ function ft({ title: e = "Connected accounts", description: t = "Manage the accounts you can use to sign in.", identities: n = [], providers: r = [
1315
+ "google",
1316
+ "apple",
1317
+ "github"
1318
+ ], loading: i = !1, onLink: a, onUnlink: o, className: s }) {
1319
+ let c = _.useId(), [l, u] = _.useState(null), [d, f] = _.useState(null), [p, m] = _.useState(null), v = new Set(n.map((e) => e.provider)), y = r.filter((e) => !v.has(e)), b = d !== null || p !== null, x = n.length <= 1;
1320
+ async function S(e) {
1321
+ if (!b) {
1322
+ u(null), f(e);
1323
+ try {
1324
+ await a?.(e);
1325
+ } catch (e) {
1326
+ u(e instanceof Error ? e.message : "Unable to connect account.");
1327
+ } finally {
1328
+ f(null);
1329
+ }
1330
+ }
1331
+ }
1332
+ async function C(e) {
1333
+ if (!(b || x)) {
1334
+ u(null), m(e);
1335
+ try {
1336
+ await o?.(e);
1337
+ } catch (e) {
1338
+ u(e instanceof Error ? e.message : "Unable to disconnect account.");
1339
+ } finally {
1340
+ m(null);
1341
+ }
1342
+ }
1343
+ }
1344
+ return /* @__PURE__ */ h(F, {
1345
+ reducedMotion: "user",
1346
+ children: /* @__PURE__ */ g(B, {
1347
+ className: L("w-full", s),
1348
+ "data-slot": "auth-block",
1349
+ children: [/* @__PURE__ */ g(V, { children: [/* @__PURE__ */ h(H, { children: e }), /* @__PURE__ */ h(Se, { children: t })] }), /* @__PURE__ */ h(U, { children: i ? /* @__PURE__ */ g("div", {
1350
+ className: "flex items-center gap-2 text-sm text-muted-foreground",
1351
+ children: [/* @__PURE__ */ h(R, { className: "size-4" }), "Loading connected accounts…"]
1352
+ }) : /* @__PURE__ */ g(I.div, {
1353
+ layout: !0,
1354
+ transition: {
1355
+ duration: .3,
1356
+ ease: J
1357
+ },
1358
+ className: "flex flex-col gap-3",
1359
+ children: [
1360
+ /* @__PURE__ */ h(Q, { message: l }),
1361
+ n.length > 0 ? /* @__PURE__ */ h("ul", {
1362
+ "aria-label": "Connected accounts",
1363
+ className: "flex flex-col gap-2",
1364
+ children: /* @__PURE__ */ h(P, {
1365
+ initial: !1,
1366
+ children: n.map((e, t) => {
1367
+ let { label: n, Icon: r } = nt[e.provider];
1368
+ return /* @__PURE__ */ g(I.li, {
1369
+ layout: !0,
1370
+ className: "flex items-center justify-between gap-3 rounded-lg border px-3 py-2",
1371
+ initial: {
1372
+ opacity: 0,
1373
+ y: -4
1374
+ },
1375
+ animate: {
1376
+ opacity: 1,
1377
+ y: 0
1378
+ },
1379
+ exit: {
1380
+ opacity: 0,
1381
+ y: -4
1382
+ },
1383
+ transition: {
1384
+ duration: .25,
1385
+ ease: J,
1386
+ delay: Math.min(t, 5) * .04
1387
+ },
1388
+ children: [/* @__PURE__ */ g("div", {
1389
+ className: "flex min-w-0 items-center gap-2.5",
1390
+ children: [/* @__PURE__ */ h(r, {
1391
+ "aria-hidden": "true",
1392
+ className: "size-4 text-muted-foreground"
1393
+ }), /* @__PURE__ */ g("div", {
1394
+ className: "flex min-w-0 flex-col",
1395
+ children: [/* @__PURE__ */ h("span", {
1396
+ className: "font-medium text-sm",
1397
+ children: n
1398
+ }), e.email && /* @__PURE__ */ h("span", {
1399
+ className: "truncate text-xs text-muted-foreground",
1400
+ children: e.email
1401
+ })]
1402
+ })]
1403
+ }), /* @__PURE__ */ h(z, {
1404
+ "aria-describedby": x ? c : void 0,
1405
+ "aria-label": `Disconnect ${n}`,
1406
+ size: "sm",
1407
+ type: "button",
1408
+ variant: "destructive-outline",
1409
+ disabled: b || x,
1410
+ loading: p === e.id,
1411
+ onClick: () => void C(e.id),
1412
+ children: "Disconnect"
1413
+ })]
1414
+ }, e.id);
1415
+ })
1416
+ })
1417
+ }) : /* @__PURE__ */ h("p", {
1418
+ className: "text-sm text-muted-foreground",
1419
+ children: "No sign-in methods connected yet."
1420
+ }),
1421
+ x && n.length > 0 && /* @__PURE__ */ h("p", {
1422
+ className: "text-xs text-muted-foreground",
1423
+ id: c,
1424
+ children: dt
1425
+ }),
1426
+ y.map((e) => {
1427
+ let { label: t, Icon: n } = nt[e];
1428
+ return /* @__PURE__ */ g(z, {
1429
+ className: "w-full",
1430
+ type: "button",
1431
+ variant: "outline",
1432
+ disabled: b,
1433
+ loading: d === e,
1434
+ onClick: () => void S(e),
1435
+ children: [/* @__PURE__ */ h(n, { "aria-hidden": "true" }), /* @__PURE__ */ g("span", {
1436
+ className: "flex-1",
1437
+ children: ["Connect ", t]
1438
+ })]
1439
+ }, e);
1440
+ })
1441
+ ]
1442
+ }) })]
1443
+ })
1444
+ });
1445
+ }
1446
+ //#endregion
1312
1447
  //#region src/components/blocks/auth/login-block.tsx
1313
- function ut({ title: e = "Login to your account", description: t = "Enter your email and password to login", logo: n, accent: r, providers: i = [
1448
+ function pt({ title: e = "Login to your account", description: t = "Enter your email and password to login", logo: n, accent: r, providers: i = [
1314
1449
  "google",
1315
1450
  "apple",
1316
1451
  "github"
1317
1452
  ], showRememberMe: a = !0, showForgotPassword: o = !0, onSubmit: s, onProviderSelect: c, onForgotPassword: l, onSignup: u }) {
1318
- let d = g.useId(), f = g.useId(), [_, v] = g.useState("idle"), [y, b] = g.useState(null), [x, S] = g.useState(null), [C, w] = g.useState(!1), [T, E] = g.useState(""), [D, O] = g.useState(!1), [k, ee] = g.useState(""), A = _ === "loading" || x !== null, j = k.trim().length > 0, M = D && j;
1319
- async function N(e) {
1320
- if (e.preventDefault(), !M) return;
1453
+ let d = _.useId(), f = _.useId(), [p, v] = _.useState("idle"), [y, b] = _.useState(null), [x, S] = _.useState(null), [C, w] = _.useState(!1), [T, E] = _.useState(""), [D, O] = _.useState(!1), [k, ee] = _.useState(""), A = p === "loading" || x !== null, te = k.trim().length > 0, j = D && te;
1454
+ async function M(e) {
1455
+ if (e.preventDefault(), !j) return;
1321
1456
  let t = new FormData(e.currentTarget);
1322
1457
  b(null), v("loading");
1323
1458
  try {
@@ -1330,7 +1465,7 @@ function ut({ title: e = "Login to your account", description: t = "Enter your e
1330
1465
  v("idle"), b(e instanceof Error ? e.message : "Unable to login.");
1331
1466
  }
1332
1467
  }
1333
- async function P(e) {
1468
+ async function N(e) {
1334
1469
  b(null), S(e);
1335
1470
  try {
1336
1471
  await c?.(e), v("success");
@@ -1340,37 +1475,37 @@ function ut({ title: e = "Login to your account", description: t = "Enter your e
1340
1475
  S(null);
1341
1476
  }
1342
1477
  }
1343
- return /* @__PURE__ */ m(J, {
1478
+ return /* @__PURE__ */ h(Y, {
1344
1479
  title: e,
1345
1480
  description: t,
1346
1481
  logo: n,
1347
1482
  accent: r,
1348
- footer: _ !== "success" && /* @__PURE__ */ h(p, { children: [
1483
+ footer: p !== "success" && /* @__PURE__ */ g(m, { children: [
1349
1484
  "Don't have an account?",
1350
1485
  " ",
1351
- /* @__PURE__ */ m(R, {
1486
+ /* @__PURE__ */ h(z, {
1352
1487
  variant: "link",
1353
1488
  onClick: u,
1354
1489
  children: "Sign up"
1355
1490
  })
1356
1491
  ] }),
1357
- children: /* @__PURE__ */ m(Y, {
1358
- step: _ === "success" ? "success" : "form",
1359
- children: _ === "success" ? /* @__PURE__ */ m(Q, {
1492
+ children: /* @__PURE__ */ h(X, {
1493
+ step: p === "success" ? "success" : "form",
1494
+ children: p === "success" ? /* @__PURE__ */ h($, {
1360
1495
  title: "Welcome back",
1361
1496
  description: "You are now logged in."
1362
- }) : /* @__PURE__ */ h("div", {
1497
+ }) : /* @__PURE__ */ g("div", {
1363
1498
  className: "flex flex-col gap-4",
1364
- children: [/* @__PURE__ */ h("form", {
1499
+ children: [/* @__PURE__ */ g("form", {
1365
1500
  className: "flex flex-col gap-4",
1366
- onSubmit: N,
1501
+ onSubmit: M,
1367
1502
  children: [
1368
- /* @__PURE__ */ h(H, {
1503
+ /* @__PURE__ */ g(W, {
1369
1504
  name: "email",
1370
- children: [/* @__PURE__ */ m(U, {
1505
+ children: [/* @__PURE__ */ h(G, {
1371
1506
  htmlFor: d,
1372
1507
  children: "Email"
1373
- }), /* @__PURE__ */ m(W, {
1508
+ }), /* @__PURE__ */ h(K, {
1374
1509
  id: d,
1375
1510
  "aria-label": "Email",
1376
1511
  name: "email",
@@ -1385,16 +1520,16 @@ function ut({ title: e = "Login to your account", description: t = "Enter your e
1385
1520
  }
1386
1521
  })]
1387
1522
  }),
1388
- /* @__PURE__ */ m(X, {
1523
+ /* @__PURE__ */ h(Z, {
1389
1524
  show: D,
1390
- children: /* @__PURE__ */ h(H, {
1525
+ children: /* @__PURE__ */ g(W, {
1391
1526
  name: "password",
1392
1527
  children: [
1393
- /* @__PURE__ */ m(U, {
1528
+ /* @__PURE__ */ h(G, {
1394
1529
  htmlFor: "password",
1395
1530
  children: "Password"
1396
1531
  }),
1397
- /* @__PURE__ */ m(tt, {
1532
+ /* @__PURE__ */ h(q, {
1398
1533
  id: "password",
1399
1534
  name: "password",
1400
1535
  autoComplete: "current-password",
@@ -1403,7 +1538,7 @@ function ut({ title: e = "Login to your account", description: t = "Enter your e
1403
1538
  value: k,
1404
1539
  onChange: (e) => ee(e.target.value)
1405
1540
  }),
1406
- o && /* @__PURE__ */ m(R, {
1541
+ o && /* @__PURE__ */ h(z, {
1407
1542
  variant: "link",
1408
1543
  type: "button",
1409
1544
  className: "self-end font-normal text-muted-foreground text-xs hover:text-foreground sm:text-xs",
@@ -1413,40 +1548,40 @@ function ut({ title: e = "Login to your account", description: t = "Enter your e
1413
1548
  ]
1414
1549
  })
1415
1550
  }),
1416
- a && /* @__PURE__ */ h("div", {
1551
+ a && /* @__PURE__ */ g("div", {
1417
1552
  className: "flex items-center gap-2",
1418
- children: [/* @__PURE__ */ m(V, {
1553
+ children: [/* @__PURE__ */ h(Oe, {
1419
1554
  id: f,
1420
1555
  checked: C,
1421
1556
  onCheckedChange: (e) => w(e),
1422
1557
  disabled: A
1423
- }), /* @__PURE__ */ m(Je, {
1558
+ }), /* @__PURE__ */ h(qe, {
1424
1559
  htmlFor: f,
1425
1560
  className: "font-normal",
1426
1561
  children: "Remember me"
1427
1562
  })]
1428
1563
  }),
1429
- /* @__PURE__ */ m(Z, { message: y }),
1430
- /* @__PURE__ */ m(X, {
1431
- show: M,
1432
- children: /* @__PURE__ */ m(R, {
1564
+ /* @__PURE__ */ h(Q, { message: y }),
1565
+ /* @__PURE__ */ h(Z, {
1566
+ show: j,
1567
+ children: /* @__PURE__ */ h(z, {
1433
1568
  className: L("w-full", r && "border-transparent bg-[var(--auth-accent)] bg-[image:var(--auth-accent-image)] text-[var(--auth-accent-foreground)] shadow-none hover:bg-[var(--auth-accent)] hover:brightness-110 data-pressed:bg-[var(--auth-accent)] data-pressed:brightness-110 *:data-[slot=button-loading-indicator]:text-[var(--auth-accent-foreground)]"),
1434
1569
  type: "submit",
1435
- loading: _ === "loading",
1570
+ loading: p === "loading",
1436
1571
  disabled: A,
1437
1572
  children: "Login"
1438
1573
  })
1439
1574
  })
1440
1575
  ]
1441
- }), i.length > 0 && /* @__PURE__ */ h(X, {
1442
- show: !M,
1576
+ }), i.length > 0 && /* @__PURE__ */ g(Z, {
1577
+ show: !j,
1443
1578
  className: "flex flex-col gap-4",
1444
- children: [/* @__PURE__ */ m($, { label: "Or continue with" }), /* @__PURE__ */ m(it, {
1579
+ children: [/* @__PURE__ */ h(st, { label: "Or continue with" }), /* @__PURE__ */ h(it, {
1445
1580
  providers: i,
1446
1581
  action: "login",
1447
1582
  loadingProvider: x,
1448
- disabled: _ === "loading",
1449
- onSelect: P
1583
+ disabled: p === "loading",
1584
+ onSelect: N
1450
1585
  })]
1451
1586
  })]
1452
1587
  })
@@ -1454,15 +1589,518 @@ function ut({ title: e = "Login to your account", description: t = "Enter your e
1454
1589
  });
1455
1590
  }
1456
1591
  //#endregion
1592
+ //#region src/components/blocks/auth/onboarding/profile-step.tsx
1593
+ function mt(e, t) {
1594
+ return e.kind === "checkbox" ? typeof t == "boolean" && t : typeof t == "string" ? t : "";
1595
+ }
1596
+ function ht(e, t) {
1597
+ let n = e.required === !0;
1598
+ if (e.kind === "checkbox") return n && t !== !0 ? `${e.label} is required` : null;
1599
+ let r = typeof t == "string" ? t.trim() : "";
1600
+ if (n && r.length === 0) return `${e.label} is required`;
1601
+ if (e.kind === "url" && r.length > 0) try {
1602
+ new URL(r);
1603
+ } catch {
1604
+ return "Enter a valid URL";
1605
+ }
1606
+ return e.kind === "select" && r.length > 0 && !e.options.map((e) => e.value).includes(r) ? `Choose a valid option for ${e.label}` : e.validate?.(r) ?? null;
1607
+ }
1608
+ function gt({ step: e, values: t, submitting: n = !1, submitLabel: r, onSubmit: i, onBack: a, onDraftChange: o }) {
1609
+ let s = _.useId(), [c, l] = _.useState(() => Object.fromEntries(e.fields.map((e) => [e.name, mt(e, t[e.name])]))), [u, d] = _.useState({});
1610
+ function f(e, t) {
1611
+ l((n) => ({
1612
+ ...n,
1613
+ [e]: t
1614
+ })), o?.(e, t), d((t) => t[e] ? {
1615
+ ...t,
1616
+ [e]: ""
1617
+ } : t);
1618
+ }
1619
+ async function p(t) {
1620
+ if (t.preventDefault(), n) return;
1621
+ let r = {};
1622
+ for (let t of e.fields) {
1623
+ let e = ht(t, c[t.name]);
1624
+ e && (r[t.name] = e);
1625
+ }
1626
+ if (Object.keys(r).length > 0) {
1627
+ d(r);
1628
+ return;
1629
+ }
1630
+ d({});
1631
+ let a = {};
1632
+ for (let t of e.fields) {
1633
+ let e = c[t.name];
1634
+ a[t.name] = typeof e == "string" ? e.trim() : e;
1635
+ }
1636
+ await i(a);
1637
+ }
1638
+ return /* @__PURE__ */ g("form", {
1639
+ className: "flex flex-col gap-4",
1640
+ noValidate: !0,
1641
+ onSubmit: p,
1642
+ children: [e.fields.map((e) => {
1643
+ let t = u[e.name] || void 0, r = `${s}-${e.name}`, i = c[e.name];
1644
+ return e.kind === "checkbox" ? /* @__PURE__ */ g(W, {
1645
+ name: e.name,
1646
+ invalid: !!t,
1647
+ className: "gap-1.5",
1648
+ children: [/* @__PURE__ */ g("div", {
1649
+ className: "flex items-center gap-2",
1650
+ children: [/* @__PURE__ */ h(Oe, {
1651
+ id: r,
1652
+ checked: i === !0,
1653
+ disabled: n,
1654
+ onCheckedChange: (t) => f(e.name, t)
1655
+ }), /* @__PURE__ */ h(qe, {
1656
+ htmlFor: r,
1657
+ className: "font-normal",
1658
+ children: e.label
1659
+ })]
1660
+ }), t && /* @__PURE__ */ h(je, {
1661
+ match: !0,
1662
+ children: t
1663
+ })]
1664
+ }, e.name) : /* @__PURE__ */ g(W, {
1665
+ name: e.name,
1666
+ invalid: !!t,
1667
+ children: [
1668
+ /* @__PURE__ */ h(G, {
1669
+ htmlFor: r,
1670
+ children: e.label
1671
+ }),
1672
+ e.kind === "textarea" ? /* @__PURE__ */ h(Be, {
1673
+ id: r,
1674
+ "aria-invalid": t ? !0 : void 0,
1675
+ disabled: n,
1676
+ placeholder: e.placeholder,
1677
+ value: String(i ?? ""),
1678
+ onChange: (t) => f(e.name, t.target.value)
1679
+ }) : e.kind === "select" ? /* @__PURE__ */ g("select", {
1680
+ id: r,
1681
+ "aria-invalid": t ? !0 : void 0,
1682
+ className: L("h-8.5 w-full rounded-lg border border-input bg-background px-[calc(--spacing(3)-1px)] text-base text-foreground shadow-xs/5 outline-none transition-[box-shadow,border-color] duration-150 ease-smooth-out focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/24 disabled:opacity-64 aria-invalid:border-destructive/36 sm:h-7.5 sm:text-sm dark:bg-input/32"),
1683
+ disabled: n,
1684
+ value: String(i ?? ""),
1685
+ onChange: (t) => f(e.name, t.target.value),
1686
+ children: [/* @__PURE__ */ h("option", {
1687
+ value: "",
1688
+ children: e.placeholder ?? "Choose an option"
1689
+ }), e.options.map((e) => /* @__PURE__ */ h("option", {
1690
+ value: e.value,
1691
+ children: e.label
1692
+ }, e.value))]
1693
+ }) : /* @__PURE__ */ h(K, {
1694
+ id: r,
1695
+ "aria-invalid": t ? !0 : void 0,
1696
+ disabled: n,
1697
+ placeholder: e.placeholder,
1698
+ type: e.kind === "url" ? "url" : "text",
1699
+ value: String(i ?? ""),
1700
+ onChange: (t) => f(e.name, t.target.value)
1701
+ }),
1702
+ t && /* @__PURE__ */ h(je, {
1703
+ match: !0,
1704
+ children: t
1705
+ })
1706
+ ]
1707
+ }, e.name);
1708
+ }), /* @__PURE__ */ g("div", {
1709
+ className: "flex gap-2",
1710
+ children: [a && /* @__PURE__ */ h(z, {
1711
+ type: "button",
1712
+ variant: "outline",
1713
+ disabled: n,
1714
+ onClick: a,
1715
+ children: "Back"
1716
+ }), /* @__PURE__ */ h(z, {
1717
+ className: "flex-1",
1718
+ type: "submit",
1719
+ loading: n,
1720
+ children: r
1721
+ })]
1722
+ })]
1723
+ });
1724
+ }
1725
+ //#endregion
1726
+ //#region src/components/blocks/auth/onboarding-block.tsx
1727
+ var _t = [{
1728
+ id: "profile",
1729
+ title: "Your profile",
1730
+ fields: [{
1731
+ kind: "text",
1732
+ name: "display_name",
1733
+ label: "Display name",
1734
+ required: !0
1735
+ }]
1736
+ }];
1737
+ function vt({ steps: e = _t, logo: t, accent: n, onStepSubmit: r, onComplete: i, showCompleteScreen: a = !0, className: o }) {
1738
+ let s = _.useRef(null), c = _.useRef({}), [l, u] = _.useState({}), [d, f] = _.useState(0), [p, m] = _.useState({}), [v, y] = _.useState("idle"), [b, x] = _.useState(null), S = v === "success", C = e[d], w = d >= e.length - 1;
1739
+ _.useEffect(() => {
1740
+ b || s.current?.focus();
1741
+ }, [
1742
+ d,
1743
+ S,
1744
+ b
1745
+ ]);
1746
+ async function T(e) {
1747
+ if (!C) return;
1748
+ let t = {
1749
+ ...p,
1750
+ ...e
1751
+ };
1752
+ x(null), y("loading");
1753
+ try {
1754
+ await r?.(C.id, e), w && await i?.(t), m(t), delete c.current[C.id], u({ ...c.current }), y(w ? "success" : "idle"), w || f((e) => e + 1);
1755
+ } catch (e) {
1756
+ y("idle"), x(e instanceof Error ? e.message : "Unable to save your profile.");
1757
+ }
1758
+ }
1759
+ return S && !a ? null : /* @__PURE__ */ h(Y, {
1760
+ title: S ? "You're all set" : C?.title ?? "Your profile",
1761
+ description: S ? void 0 : C?.description,
1762
+ logo: t,
1763
+ accent: n,
1764
+ className: o,
1765
+ children: /* @__PURE__ */ h(X, {
1766
+ step: S ? "done" : `step-${d}`,
1767
+ children: S ? /* @__PURE__ */ h($, {
1768
+ title: "Profile saved",
1769
+ description: "Your account is ready and your profile has been saved."
1770
+ }) : C ? /* @__PURE__ */ g("div", {
1771
+ className: "flex flex-col gap-4",
1772
+ children: [
1773
+ /* @__PURE__ */ h("nav", {
1774
+ "aria-label": "Onboarding progress",
1775
+ children: /* @__PURE__ */ h("ol", {
1776
+ className: "flex flex-wrap gap-x-3 gap-y-1 text-xs",
1777
+ children: e.map((e, t) => /* @__PURE__ */ g("li", {
1778
+ "aria-current": t === d ? "step" : void 0,
1779
+ className: L("text-muted-foreground", t === d && "font-medium text-foreground"),
1780
+ children: [e.title, t < d && /* @__PURE__ */ h("span", {
1781
+ className: "sr-only",
1782
+ children: " (completed)"
1783
+ })]
1784
+ }, e.id))
1785
+ })
1786
+ }),
1787
+ /* @__PURE__ */ h("h3", {
1788
+ ref: s,
1789
+ tabIndex: -1,
1790
+ className: "sr-only",
1791
+ children: C.title
1792
+ }),
1793
+ /* @__PURE__ */ h(Q, { message: b }),
1794
+ /* @__PURE__ */ h(gt, {
1795
+ step: C,
1796
+ values: {
1797
+ ...p,
1798
+ ...l[C.id]
1799
+ },
1800
+ submitting: v === "loading",
1801
+ submitLabel: w ? "Finish" : "Continue",
1802
+ onBack: d > 0 ? () => {
1803
+ x(null), u({ ...c.current }), f((e) => e - 1);
1804
+ } : void 0,
1805
+ onDraftChange: (e, t) => {
1806
+ c.current[C.id] = {
1807
+ ...c.current[C.id],
1808
+ [e]: t
1809
+ };
1810
+ },
1811
+ onSubmit: T
1812
+ }, C.id)
1813
+ ]
1814
+ }) : null
1815
+ })
1816
+ });
1817
+ }
1818
+ //#endregion
1819
+ //#region src/components/blocks/auth/passkey-manager-block.tsx
1820
+ var yt = 120, bt = "This is your last passkey. After deleting it you won't be able to sign in with a passkey until you register a new one.";
1821
+ function xt(e) {
1822
+ if (!e) return null;
1823
+ let t = new Date(e);
1824
+ return Number.isNaN(t.getTime()) ? null : t.toLocaleDateString();
1825
+ }
1826
+ function St({ title: e = "Passkeys", description: t = "Sign in without a password using your device's biometrics or security key.", passkeys: n = [], available: r = !0, loading: i = !1, onRegister: a, onRename: o, onDelete: s, className: c }) {
1827
+ let [l, u] = _.useState(null), [d, f] = _.useState(!1), [p, m] = _.useState(!1), [v, y] = _.useState(null), [b, x] = _.useState(""), [S, C] = _.useState(null), [w, T] = _.useState(null), E = n.length === 1;
1828
+ async function D(e) {
1829
+ if (d) return { ok: !1 };
1830
+ u(null), f(!0);
1831
+ try {
1832
+ return {
1833
+ ok: !0,
1834
+ result: await e()
1835
+ };
1836
+ } catch (e) {
1837
+ return u(e instanceof Error ? e.message : "Something went wrong."), { ok: !1 };
1838
+ } finally {
1839
+ f(!1);
1840
+ }
1841
+ }
1842
+ async function O() {
1843
+ m(!0), await D(() => a?.()), m(!1);
1844
+ }
1845
+ function k(e) {
1846
+ T(null), y(e.id), x(e.name ?? ""), C(null);
1847
+ }
1848
+ async function ee(e) {
1849
+ let t = b.trim();
1850
+ if (t.length < 1 || t.length > yt) {
1851
+ C(`Name must be between 1 and ${yt} characters.`);
1852
+ return;
1853
+ }
1854
+ (await D(() => o?.(e, t))).ok && (y(null), C(null));
1855
+ }
1856
+ async function A(e) {
1857
+ let t = await D(() => s?.(e));
1858
+ T(null), t.ok && v === e && y(null);
1859
+ }
1860
+ return /* @__PURE__ */ h(F, {
1861
+ reducedMotion: "user",
1862
+ children: /* @__PURE__ */ g(B, {
1863
+ className: L("w-full", c),
1864
+ "data-slot": "auth-block",
1865
+ children: [/* @__PURE__ */ g(V, { children: [/* @__PURE__ */ h(H, { children: e }), /* @__PURE__ */ h(Se, { children: t })] }), /* @__PURE__ */ h(U, { children: r ? i ? /* @__PURE__ */ g("div", {
1866
+ className: "flex items-center gap-2 text-sm text-muted-foreground",
1867
+ children: [/* @__PURE__ */ h(R, { className: "size-4" }), "Loading passkeys…"]
1868
+ }) : /* @__PURE__ */ g(I.div, {
1869
+ layout: !0,
1870
+ transition: {
1871
+ duration: .3,
1872
+ ease: J
1873
+ },
1874
+ className: "flex flex-col gap-3",
1875
+ children: [
1876
+ /* @__PURE__ */ h(Q, { message: l }),
1877
+ n.length > 0 ? /* @__PURE__ */ h("ul", {
1878
+ "aria-label": "Passkeys",
1879
+ className: "flex flex-col gap-2",
1880
+ children: /* @__PURE__ */ h(P, {
1881
+ initial: !1,
1882
+ children: n.map((e, t) => {
1883
+ let n = e.name ?? "Passkey", r = xt(e.createdAt), i = xt(e.lastUsedAt);
1884
+ return /* @__PURE__ */ g(I.li, {
1885
+ layout: !0,
1886
+ className: "flex flex-col gap-2 rounded-lg border px-3 py-2",
1887
+ initial: {
1888
+ opacity: 0,
1889
+ y: -4
1890
+ },
1891
+ animate: {
1892
+ opacity: 1,
1893
+ y: 0
1894
+ },
1895
+ exit: {
1896
+ opacity: 0,
1897
+ y: -4
1898
+ },
1899
+ transition: {
1900
+ duration: .25,
1901
+ ease: J,
1902
+ delay: Math.min(t, 5) * .04
1903
+ },
1904
+ children: [
1905
+ /* @__PURE__ */ g("div", {
1906
+ className: "flex items-center justify-between gap-3",
1907
+ children: [/* @__PURE__ */ g("div", {
1908
+ className: "flex min-w-0 flex-col",
1909
+ children: [/* @__PURE__ */ h("span", {
1910
+ className: "truncate font-medium text-sm",
1911
+ children: n
1912
+ }), /* @__PURE__ */ g("span", {
1913
+ className: "text-xs text-muted-foreground",
1914
+ children: [
1915
+ r ? `Added ${r}` : null,
1916
+ r && i ? " · " : null,
1917
+ i ? `Last used ${i}` : null
1918
+ ]
1919
+ })]
1920
+ }), /* @__PURE__ */ g("div", {
1921
+ className: "flex shrink-0 gap-2",
1922
+ children: [/* @__PURE__ */ h(z, {
1923
+ "aria-label": `Rename ${n}`,
1924
+ size: "sm",
1925
+ type: "button",
1926
+ variant: "outline",
1927
+ disabled: d,
1928
+ onClick: () => k(e),
1929
+ children: "Rename"
1930
+ }), /* @__PURE__ */ h(z, {
1931
+ "aria-label": `Delete ${n}`,
1932
+ size: "sm",
1933
+ type: "button",
1934
+ variant: "destructive-outline",
1935
+ disabled: d,
1936
+ onClick: () => {
1937
+ y(null), T(e.id);
1938
+ },
1939
+ children: "Delete"
1940
+ })]
1941
+ })]
1942
+ }),
1943
+ /* @__PURE__ */ h(Z, {
1944
+ show: v === e.id,
1945
+ children: /* @__PURE__ */ g("form", {
1946
+ className: "flex items-start gap-2 pt-1",
1947
+ onSubmit: (t) => {
1948
+ t.preventDefault(), ee(e.id);
1949
+ },
1950
+ children: [
1951
+ /* @__PURE__ */ g(W, {
1952
+ className: "min-w-0 grow",
1953
+ invalid: !!S,
1954
+ children: [
1955
+ /* @__PURE__ */ h(G, {
1956
+ className: "sr-only",
1957
+ children: "Passkey name"
1958
+ }),
1959
+ /* @__PURE__ */ h(K, {
1960
+ "aria-label": "Passkey name",
1961
+ "aria-invalid": S ? !0 : void 0,
1962
+ autoFocus: !0,
1963
+ disabled: d,
1964
+ maxLength: 121,
1965
+ value: b,
1966
+ onChange: (e) => x(e.target.value)
1967
+ }),
1968
+ S && /* @__PURE__ */ h(je, {
1969
+ match: !0,
1970
+ children: S
1971
+ })
1972
+ ]
1973
+ }),
1974
+ /* @__PURE__ */ h(z, {
1975
+ size: "sm",
1976
+ type: "submit",
1977
+ loading: d,
1978
+ children: "Save"
1979
+ }),
1980
+ /* @__PURE__ */ h(z, {
1981
+ size: "sm",
1982
+ type: "button",
1983
+ variant: "ghost",
1984
+ disabled: d,
1985
+ onClick: () => y(null),
1986
+ children: "Cancel"
1987
+ })
1988
+ ]
1989
+ })
1990
+ }),
1991
+ /* @__PURE__ */ h(Z, {
1992
+ show: w === e.id,
1993
+ children: /* @__PURE__ */ g("div", {
1994
+ className: "flex flex-col gap-2 rounded-lg bg-muted/50 p-2",
1995
+ role: "alertdialog",
1996
+ "aria-label": `Confirm deleting ${n}`,
1997
+ children: [
1998
+ /* @__PURE__ */ h("p", {
1999
+ className: "text-sm",
2000
+ children: "Delete this passkey? It can no longer be used to sign in."
2001
+ }),
2002
+ E && /* @__PURE__ */ h("p", {
2003
+ className: "text-xs text-destructive-foreground",
2004
+ children: bt
2005
+ }),
2006
+ /* @__PURE__ */ g("div", {
2007
+ className: "flex gap-2",
2008
+ children: [/* @__PURE__ */ h(z, {
2009
+ size: "sm",
2010
+ type: "button",
2011
+ variant: "destructive",
2012
+ loading: d,
2013
+ onClick: () => void A(e.id),
2014
+ children: "Delete passkey"
2015
+ }), /* @__PURE__ */ h(z, {
2016
+ size: "sm",
2017
+ type: "button",
2018
+ variant: "ghost",
2019
+ disabled: d,
2020
+ onClick: () => T(null),
2021
+ children: "Keep it"
2022
+ })]
2023
+ })
2024
+ ]
2025
+ })
2026
+ })
2027
+ ]
2028
+ }, e.id);
2029
+ })
2030
+ })
2031
+ }) : /* @__PURE__ */ h("p", {
2032
+ className: "text-sm text-muted-foreground",
2033
+ children: "No passkeys registered yet. Add one to sign in without a password."
2034
+ }),
2035
+ /* @__PURE__ */ h(z, {
2036
+ className: "w-full",
2037
+ type: "button",
2038
+ variant: "outline",
2039
+ disabled: d,
2040
+ loading: p,
2041
+ onClick: () => void O(),
2042
+ children: "Add a passkey"
2043
+ })
2044
+ ]
2045
+ }) : /* @__PURE__ */ h("p", {
2046
+ className: "text-sm text-muted-foreground",
2047
+ children: "Passkeys aren't available on this device. You can manage them from a device that supports passkeys."
2048
+ }) })]
2049
+ })
2050
+ });
2051
+ }
2052
+ //#endregion
2053
+ //#region src/components/blocks/auth/passkey-sign-in-block.tsx
2054
+ function Ct({ available: e = !0, label: t = "Sign in with a passkey", onSignIn: n, fallbackHint: r = "You can still sign in with your other methods below.", className: i }) {
2055
+ let [a, o] = _.useState(null), [s, c] = _.useState(!1);
2056
+ if (!e) return null;
2057
+ async function u() {
2058
+ if (!s) {
2059
+ o(null), c(!0);
2060
+ try {
2061
+ await n?.();
2062
+ } catch (e) {
2063
+ o(e instanceof Error ? e.message : "Unable to sign in with a passkey.");
2064
+ } finally {
2065
+ c(!1);
2066
+ }
2067
+ }
2068
+ }
2069
+ return /* @__PURE__ */ g("div", {
2070
+ className: L("flex w-full flex-col gap-2", i),
2071
+ children: [
2072
+ /* @__PURE__ */ g(z, {
2073
+ variant: "outline",
2074
+ className: "w-full",
2075
+ type: "button",
2076
+ loading: s,
2077
+ onClick: () => void u(),
2078
+ children: [/* @__PURE__ */ h(l, { "aria-hidden": "true" }), /* @__PURE__ */ h("span", {
2079
+ className: "flex-1",
2080
+ children: t
2081
+ })]
2082
+ }),
2083
+ /* @__PURE__ */ h(Q, { message: a }),
2084
+ /* @__PURE__ */ h(Z, {
2085
+ show: !!a && !!r,
2086
+ children: /* @__PURE__ */ h("p", {
2087
+ className: "text-xs text-muted-foreground",
2088
+ children: r
2089
+ })
2090
+ })
2091
+ ]
2092
+ });
2093
+ }
2094
+ //#endregion
1457
2095
  //#region src/components/blocks/auth/signup-block.tsx
1458
- function dt({ title: e = "Create your account", description: t = "Start exploring manuscripts in minutes", logo: n, accent: r, providers: i = [
2096
+ function wt({ title: e = "Create your account", description: t = "Start exploring manuscripts in minutes", logo: n, accent: r, providers: i = [
1459
2097
  "google",
1460
2098
  "apple",
1461
2099
  "github"
1462
2100
  ], showNameField: a = !0, showTerms: o = !0, enforceStrongPassword: s = !0, onSubmit: c, onProviderSelect: l, onLogin: u, onTerms: d }) {
1463
- let f = g.useId(), _ = g.useId(), v = g.useId(), [y, b] = g.useState("idle"), [x, S] = g.useState(null), [C, w] = g.useState(null), [T, E] = g.useState(""), [D, O] = g.useState(!1), [k, ee] = g.useState(!1), [A, j] = g.useState(!1), M = y === "loading" || C !== null, N = !s || $e(T) === K.length, P = T.trim().length > 0 && N, F = (!a || A) && k && P;
1464
- async function te(e) {
1465
- if (e.preventDefault(), S(null), !N) {
2101
+ let f = _.useId(), p = _.useId(), v = _.useId(), [y, b] = _.useState("idle"), [x, S] = _.useState(null), [C, w] = _.useState(null), [T, E] = _.useState(""), [D, O] = _.useState(!1), [k, ee] = _.useState(!1), [A, te] = _.useState(!1), j = y === "loading" || C !== null, M = !s || et(T) === $e.length, N = T.trim().length > 0 && M, ne = (!a || A) && k && N;
2102
+ async function P(e) {
2103
+ if (e.preventDefault(), S(null), !M) {
1466
2104
  S("Please meet all password requirements.");
1467
2105
  return;
1468
2106
  }
@@ -1482,7 +2120,7 @@ function dt({ title: e = "Create your account", description: t = "Start explorin
1482
2120
  b("idle"), S(e instanceof Error ? e.message : "Unable to create account.");
1483
2121
  }
1484
2122
  }
1485
- async function I(e) {
2123
+ async function F(e) {
1486
2124
  S(null), w(e);
1487
2125
  try {
1488
2126
  await l?.(e), b("success");
@@ -1492,103 +2130,103 @@ function dt({ title: e = "Create your account", description: t = "Start explorin
1492
2130
  w(null);
1493
2131
  }
1494
2132
  }
1495
- return /* @__PURE__ */ m(J, {
2133
+ return /* @__PURE__ */ h(Y, {
1496
2134
  title: e,
1497
2135
  description: t,
1498
2136
  logo: n,
1499
2137
  accent: r,
1500
- footer: y !== "success" && /* @__PURE__ */ h(p, { children: [
2138
+ footer: y !== "success" && /* @__PURE__ */ g(m, { children: [
1501
2139
  "Already have an account?",
1502
2140
  " ",
1503
- /* @__PURE__ */ m(R, {
2141
+ /* @__PURE__ */ h(z, {
1504
2142
  variant: "link",
1505
2143
  onClick: u,
1506
2144
  children: "Login"
1507
2145
  })
1508
2146
  ] }),
1509
- children: /* @__PURE__ */ m(Y, {
2147
+ children: /* @__PURE__ */ h(X, {
1510
2148
  step: y === "success" ? "success" : "form",
1511
- children: y === "success" ? /* @__PURE__ */ m(Q, {
2149
+ children: y === "success" ? /* @__PURE__ */ h($, {
1512
2150
  title: "Account created",
1513
2151
  description: "Check your inbox to confirm your email address."
1514
- }) : /* @__PURE__ */ h("div", {
2152
+ }) : /* @__PURE__ */ g("div", {
1515
2153
  className: "flex flex-col gap-4",
1516
- children: [i.length > 0 && /* @__PURE__ */ h(X, {
1517
- show: !F,
2154
+ children: [i.length > 0 && /* @__PURE__ */ g(Z, {
2155
+ show: !ne,
1518
2156
  className: "flex flex-col gap-4",
1519
- children: [/* @__PURE__ */ m(it, {
2157
+ children: [/* @__PURE__ */ h(it, {
1520
2158
  providers: i,
1521
2159
  action: "signup",
1522
2160
  loadingProvider: C,
1523
2161
  disabled: y === "loading",
1524
- onSelect: I
1525
- }), /* @__PURE__ */ m($, { label: "Or with email" })]
1526
- }), /* @__PURE__ */ h("form", {
2162
+ onSelect: F
2163
+ }), /* @__PURE__ */ h(st, { label: "Or with email" })]
2164
+ }), /* @__PURE__ */ g("form", {
1527
2165
  className: "flex flex-col gap-4",
1528
- onSubmit: te,
2166
+ onSubmit: P,
1529
2167
  children: [
1530
- a && /* @__PURE__ */ h(H, {
2168
+ a && /* @__PURE__ */ g(W, {
1531
2169
  name: "name",
1532
- children: [/* @__PURE__ */ m(U, {
2170
+ children: [/* @__PURE__ */ h(G, {
1533
2171
  htmlFor: f,
1534
2172
  children: "Name"
1535
- }), /* @__PURE__ */ m(W, {
2173
+ }), /* @__PURE__ */ h(K, {
1536
2174
  "aria-label": "Name",
1537
2175
  id: f,
1538
2176
  name: "name",
1539
2177
  autoComplete: "name",
1540
2178
  placeholder: "Your name",
1541
2179
  required: !0,
1542
- disabled: M,
1543
- onChange: (e) => j(e.currentTarget.validity.valid)
2180
+ disabled: j,
2181
+ onChange: (e) => te(e.currentTarget.validity.valid)
1544
2182
  })]
1545
2183
  }),
1546
- /* @__PURE__ */ h(H, {
2184
+ /* @__PURE__ */ g(W, {
1547
2185
  name: "email",
1548
- children: [/* @__PURE__ */ m(U, {
1549
- htmlFor: _,
2186
+ children: [/* @__PURE__ */ h(G, {
2187
+ htmlFor: p,
1550
2188
  children: "Email"
1551
- }), /* @__PURE__ */ m(W, {
1552
- id: _,
2189
+ }), /* @__PURE__ */ h(K, {
2190
+ id: p,
1553
2191
  name: "email",
1554
2192
  type: "email",
1555
2193
  autoComplete: "email",
1556
2194
  placeholder: "you@example.com",
1557
2195
  required: !0,
1558
- disabled: M,
2196
+ disabled: j,
1559
2197
  onChange: (e) => ee(e.currentTarget.validity.valid)
1560
2198
  })]
1561
2199
  }),
1562
- /* @__PURE__ */ m(X, {
2200
+ /* @__PURE__ */ h(Z, {
1563
2201
  show: k,
1564
- children: /* @__PURE__ */ h(H, {
2202
+ children: /* @__PURE__ */ g(W, {
1565
2203
  name: "password",
1566
- children: [/* @__PURE__ */ m(U, { children: "Password" }), /* @__PURE__ */ m(tt, {
2204
+ children: [/* @__PURE__ */ h(G, { children: "Password" }), /* @__PURE__ */ h(q, {
1567
2205
  name: "password",
1568
2206
  autoComplete: "new-password",
1569
2207
  placeholder: "Create a password",
1570
2208
  showStrength: !0,
1571
2209
  required: !0,
1572
- disabled: M,
2210
+ disabled: j,
1573
2211
  value: T,
1574
2212
  onChange: (e) => E(e.target.value)
1575
2213
  })]
1576
2214
  })
1577
2215
  }),
1578
- o && /* @__PURE__ */ h("div", {
2216
+ o && /* @__PURE__ */ g("div", {
1579
2217
  className: "flex items-center gap-2",
1580
- children: [/* @__PURE__ */ m(V, {
2218
+ children: [/* @__PURE__ */ h(Oe, {
1581
2219
  id: v,
1582
2220
  checked: D,
1583
2221
  onCheckedChange: (e) => O(e === !0),
1584
- disabled: M
1585
- }), /* @__PURE__ */ h(Je, {
2222
+ disabled: j
2223
+ }), /* @__PURE__ */ g(qe, {
1586
2224
  htmlFor: v,
1587
2225
  className: "font-normal",
1588
2226
  children: [
1589
2227
  "I agree to the",
1590
2228
  " ",
1591
- /* @__PURE__ */ m(R, {
2229
+ /* @__PURE__ */ h(z, {
1592
2230
  variant: "link",
1593
2231
  type: "button",
1594
2232
  onClick: d,
@@ -1597,12 +2235,12 @@ function dt({ title: e = "Create your account", description: t = "Start explorin
1597
2235
  ]
1598
2236
  })]
1599
2237
  }),
1600
- /* @__PURE__ */ m(Z, { message: x }),
1601
- /* @__PURE__ */ m(R, {
2238
+ /* @__PURE__ */ h(Q, { message: x }),
2239
+ /* @__PURE__ */ h(z, {
1602
2240
  className: L("w-full", r && "border-transparent bg-[var(--auth-accent)] bg-[image:var(--auth-accent-image)] text-[var(--auth-accent-foreground)] shadow-none hover:bg-[var(--auth-accent)] hover:brightness-110 data-pressed:bg-[var(--auth-accent)] data-pressed:brightness-110 *:data-[slot=button-loading-indicator]:text-[var(--auth-accent-foreground)]"),
1603
2241
  type: "submit",
1604
2242
  loading: y === "loading",
1605
- disabled: M,
2243
+ disabled: j,
1606
2244
  children: "Create account"
1607
2245
  })
1608
2246
  ]
@@ -1612,6 +2250,88 @@ function dt({ title: e = "Create your account", description: t = "Start explorin
1612
2250
  });
1613
2251
  }
1614
2252
  //#endregion
1615
- export { J as AuthCard, Z as AuthError, $ as AuthSeparator, Q as AuthSuccess, R as Button, ge as Card, Ee as CardAction, z as CardContent, z as CardPanel, Te as CardDescription, De as CardFooter, _e as CardFrame, xe as CardFrameAction, be as CardFrameDescription, Se as CardFrameFooter, ve as CardFrameHeader, ye as CardFrameTitle, Ce as CardHeader, we as CardTitle, V as Checkbox, w as CheckboxPrimitive, ct as CodeAuthBlock, q as EASE, H as Field, Ne as FieldControl, je as FieldDescription, Me as FieldError, Ae as FieldItem, U as FieldLabel, Pe as FieldValidity, lt as ForgotPasswordBlock, Fe as Frame, ze as FrameDescription, Be as FrameFooter, Le as FrameHeader, Ie as FramePanel, Re as FrameTitle, W as Input, Ue as InputGroup, We as InputGroupAddon, Ke as InputGroupInput, Ge as InputGroupText, qe as InputGroupTextarea, M as InputPrimitive, Je as Label, ut as LoginBlock, Y as MorphStep, Ye as OTPField, Xe as OTPFieldInput, N as OTPFieldPrimitive, Ze as OTPFieldSeparator, tt as PasswordInput, X as Reveal, G as Separator, P as SeparatorPrimitive, dt as SignupBlock, it as SocialProviders, oe as Spinner, Ve as Textarea, ot as authAccentActionStyles, at as authAccentVars, ke as bindSounds, he as buttonVariants, L as cn, $e as getPasswordStrength, K as passwordRequirements, B as playCue, D as playSound, O as setSoundEnabled, k as setSoundVolume, ee as sounds, st as useCountdown };
2253
+ //#region src/components/blocks/auth/update-password-block.tsx
2254
+ function Tt({ title: e = "Update your password", description: t = "Choose a new password for your account", logo: n, accent: r, minStrength: i = 4, onSubmit: a, onDone: o }) {
2255
+ let s = _.useId(), c = _.useId(), [l, u] = _.useState("idle"), [d, f] = _.useState(null), [p, m] = _.useState(""), [v, y] = _.useState(""), b = et(p) >= i, x = v.length > 0 && v === p, S = b && x, C = v.length > 0 && !p.startsWith(v);
2256
+ async function w(e) {
2257
+ if (e.preventDefault(), S) {
2258
+ f(null), u("loading");
2259
+ try {
2260
+ await a?.({ password: p }), u("success");
2261
+ } catch (e) {
2262
+ u("idle"), f(e instanceof Error ? e.message : "Unable to update password.");
2263
+ }
2264
+ }
2265
+ }
2266
+ return /* @__PURE__ */ h(Y, {
2267
+ title: e,
2268
+ description: t,
2269
+ logo: n,
2270
+ accent: r,
2271
+ children: /* @__PURE__ */ h(X, {
2272
+ step: l === "success" ? "success" : "form",
2273
+ children: l === "success" ? /* @__PURE__ */ h($, {
2274
+ title: "Password updated",
2275
+ description: "Your password has been changed successfully.",
2276
+ children: o && /* @__PURE__ */ h(z, {
2277
+ variant: "link",
2278
+ onClick: o,
2279
+ children: "Continue"
2280
+ })
2281
+ }) : /* @__PURE__ */ g("form", {
2282
+ className: "flex flex-col gap-4",
2283
+ onSubmit: w,
2284
+ children: [
2285
+ /* @__PURE__ */ g(W, {
2286
+ name: "password",
2287
+ children: [/* @__PURE__ */ h(G, {
2288
+ htmlFor: s,
2289
+ children: "New password"
2290
+ }), /* @__PURE__ */ h(q, {
2291
+ id: s,
2292
+ name: "password",
2293
+ autoComplete: "new-password",
2294
+ required: !0,
2295
+ showStrength: !0,
2296
+ disabled: l === "loading",
2297
+ value: p,
2298
+ onChange: (e) => m(e.target.value)
2299
+ })]
2300
+ }),
2301
+ /* @__PURE__ */ h(Z, {
2302
+ show: b,
2303
+ children: /* @__PURE__ */ g(W, {
2304
+ name: "confirmPassword",
2305
+ children: [/* @__PURE__ */ h(G, {
2306
+ htmlFor: c,
2307
+ children: "Confirm new password"
2308
+ }), /* @__PURE__ */ h(q, {
2309
+ id: c,
2310
+ name: "confirmPassword",
2311
+ autoComplete: "new-password",
2312
+ required: !0,
2313
+ disabled: l === "loading",
2314
+ value: v,
2315
+ onChange: (e) => y(e.target.value)
2316
+ })]
2317
+ })
2318
+ }),
2319
+ /* @__PURE__ */ h(Q, { message: d ?? (C ? "Passwords do not match." : null) }),
2320
+ /* @__PURE__ */ h(Z, {
2321
+ show: S,
2322
+ children: /* @__PURE__ */ h(z, {
2323
+ className: L("w-full", r && "border-transparent bg-[var(--auth-accent)] bg-[image:var(--auth-accent-image)] text-[var(--auth-accent-foreground)] shadow-none hover:bg-[var(--auth-accent)] hover:brightness-110 data-pressed:bg-[var(--auth-accent)] data-pressed:brightness-110 *:data-[slot=button-loading-indicator]:text-[var(--auth-accent-foreground)]"),
2324
+ type: "submit",
2325
+ loading: l === "loading",
2326
+ children: "Update password"
2327
+ })
2328
+ })
2329
+ ]
2330
+ })
2331
+ })
2332
+ });
2333
+ }
2334
+ //#endregion
2335
+ export { Y as AuthCard, Q as AuthError, st as AuthSeparator, $ as AuthSuccess, z as Button, B as Card, Ce as CardAction, U as CardContent, U as CardPanel, Se as CardDescription, we as CardFooter, ge as CardFrame, be as CardFrameAction, ye as CardFrameDescription, xe as CardFrameFooter, _e as CardFrameHeader, ve as CardFrameTitle, V as CardHeader, H as CardTitle, Oe as Checkbox, T as CheckboxPrimitive, lt as CodeAuthBlock, _t as DEFAULT_ONBOARDING_STEPS, J as EASE, W as Field, Me as FieldControl, Ae as FieldDescription, je as FieldError, ke as FieldItem, G as FieldLabel, Ne as FieldValidity, ut as ForgotPasswordBlock, Pe as Frame, Re as FrameDescription, ze as FrameFooter, Ie as FrameHeader, Fe as FramePanel, Le as FrameTitle, K as Input, He as InputGroup, Ue as InputGroupAddon, Ge as InputGroupInput, We as InputGroupText, Ke as InputGroupTextarea, M as InputPrimitive, qe as Label, ft as LinkedAccountsBlock, pt as LoginBlock, X as MorphStep, Ye as OTPField, Xe as OTPFieldInput, N as OTPFieldPrimitive, Ze as OTPFieldSeparator, vt as OnboardingBlock, St as PasskeyManagerBlock, Ct as PasskeySignInBlock, q as PasswordInput, Z as Reveal, nt as SOCIAL_PROVIDERS, Je as Separator, ne as SeparatorPrimitive, wt as SignupBlock, it as SocialProviders, R as Spinner, Be as Textarea, Tt as UpdatePasswordBlock, ot as authAccentActionStyles, at as authAccentVars, Ee as bindSounds, he as buttonVariants, L as cn, et as getPasswordStrength, $e as passwordRequirements, De as playCue, O as playSound, k as setSoundEnabled, ee as setSoundVolume, A as sounds, ct as useCountdown };
1616
2336
 
1617
2337
  //# sourceMappingURL=index.js.map