@zerodev/wallet-react-ui 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_types/auth/index.d.ts +2 -1
- package/dist/_types/auth/index.d.ts.map +1 -1
- package/dist/_types/shared/components/PoweredBy/index.d.ts.map +1 -1
- package/dist/_types/shared/components/Screen/index.d.ts +2 -1
- package/dist/_types/shared/components/Screen/index.d.ts.map +1 -1
- package/dist/_types/shared/components/TopNav/index.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +353 -334
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -3
- package/src/auth/index.tsx +3 -0
- package/src/shared/components/PoweredBy/index.tsx +5 -4
- package/src/shared/components/Screen/index.tsx +24 -4
- package/src/shared/components/TopNav/index.tsx +4 -1
package/dist/index.mjs
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { useStore as O, create as
|
|
4
|
-
import { cn as R, IconButton as q, Text as h,
|
|
5
|
-
import { useConfig as
|
|
6
|
-
import { useSendMagicLink as
|
|
7
|
-
import { subscribeWithSelector as
|
|
1
|
+
import { jsxs as d, jsx as t, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import { useId as V, useState as w, useEffect as P, useMemo as re, useRef as K } from "react";
|
|
3
|
+
import { useStore as O, create as ie } from "zustand";
|
|
4
|
+
import { cn as R, IconButton as q, Text as h, ZeroDevLogo as se, Button as C, Wrapper as ae, ListItem as X, Input as de, Icon as le } from "@zerodev/react-ui";
|
|
5
|
+
import { useConfig as ce, useConnect as ue } from "wagmi";
|
|
6
|
+
import { useSendMagicLink as Y, useSendOTP as J, useVerifyOTP as pe, useAuthenticateOAuth as fe, useRegisterPasskey as he, useLoginPasskey as ze, useVerifyMagicLink as me, zeroDevWallet as ge, NotAuthenticatedError as ye } from "@zerodev/wallet-react";
|
|
7
|
+
import { subscribeWithSelector as xe } from "zustand/middleware";
|
|
8
8
|
const Z = 52;
|
|
9
|
-
function
|
|
9
|
+
function we({
|
|
10
10
|
onBack: e,
|
|
11
|
-
onClose:
|
|
12
|
-
title:
|
|
11
|
+
onClose: i,
|
|
12
|
+
title: r,
|
|
13
13
|
logo: n,
|
|
14
|
-
className:
|
|
14
|
+
className: o
|
|
15
15
|
}) {
|
|
16
|
-
return /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ d(
|
|
17
17
|
"div",
|
|
18
18
|
{
|
|
19
19
|
className: R(
|
|
20
20
|
"zd:absolute zd:top-4 zd:left-0 zd:right-0 zd:flex zd:flex-row zd:items-center zd:justify-between",
|
|
21
|
-
|
|
21
|
+
o
|
|
22
22
|
),
|
|
23
|
-
style: { height: Z },
|
|
23
|
+
style: { height: `calc(${Z / 4} * var(--zd-spacing))` },
|
|
24
24
|
children: [
|
|
25
25
|
e ? /* @__PURE__ */ t(q, { iconName: "chevronLeft", onClick: e }) : /* @__PURE__ */ t("div", { className: "zd:h-13 zd:w-13" }),
|
|
26
26
|
n && /* @__PURE__ */ t("div", { className: "zd:absolute zd:left-0 zd:right-0 zd:flex zd:items-center zd:justify-center zd:pointer-events-none", children: n }),
|
|
27
|
-
|
|
28
|
-
/* @__PURE__ */ t(q, { iconName: "x", onClick:
|
|
27
|
+
r && /* @__PURE__ */ t("div", { className: "zd:absolute zd:left-0 zd:right-0 zd:flex zd:items-center zd:justify-center zd:pointer-events-none", children: /* @__PURE__ */ t(h, { className: "zd:text-body1", children: r }) }),
|
|
28
|
+
/* @__PURE__ */ t(q, { iconName: "x", onClick: i })
|
|
29
29
|
]
|
|
30
30
|
}
|
|
31
31
|
);
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function ve({
|
|
34
34
|
layer: e,
|
|
35
|
-
rect:
|
|
35
|
+
rect: i
|
|
36
36
|
}) {
|
|
37
|
-
const { id:
|
|
38
|
-
return /* @__PURE__ */
|
|
37
|
+
const { id: r, matrix: n, fillOpacity: o, stops: c } = e;
|
|
38
|
+
return /* @__PURE__ */ d(b, { children: [
|
|
39
39
|
/* @__PURE__ */ t("defs", { children: /* @__PURE__ */ t(
|
|
40
40
|
"radialGradient",
|
|
41
41
|
{
|
|
42
|
-
id:
|
|
42
|
+
id: r,
|
|
43
43
|
cx: "0",
|
|
44
44
|
cy: "0",
|
|
45
45
|
r: "1",
|
|
@@ -59,24 +59,24 @@ function we({
|
|
|
59
59
|
/* @__PURE__ */ t(
|
|
60
60
|
"rect",
|
|
61
61
|
{
|
|
62
|
-
x:
|
|
63
|
-
y:
|
|
64
|
-
width:
|
|
65
|
-
height:
|
|
66
|
-
fill: `url(#${
|
|
67
|
-
fillOpacity:
|
|
62
|
+
x: i.x,
|
|
63
|
+
y: i.y,
|
|
64
|
+
width: i.width,
|
|
65
|
+
height: i.height,
|
|
66
|
+
fill: `url(#${r})`,
|
|
67
|
+
fillOpacity: o
|
|
68
68
|
}
|
|
69
69
|
)
|
|
70
70
|
] });
|
|
71
71
|
}
|
|
72
|
-
const
|
|
73
|
-
function
|
|
72
|
+
const Ne = "-6 -6 412 812";
|
|
73
|
+
function Se() {
|
|
74
74
|
return /* @__PURE__ */ t("div", { className: "zd:absolute zd:inset-0 zd:z-0 zd:rounded-4xl zd:pointer-events-none", children: /* @__PURE__ */ t(
|
|
75
75
|
"svg",
|
|
76
76
|
{
|
|
77
77
|
width: "100%",
|
|
78
78
|
height: "100%",
|
|
79
|
-
viewBox:
|
|
79
|
+
viewBox: Ne,
|
|
80
80
|
preserveAspectRatio: "none",
|
|
81
81
|
role: "img",
|
|
82
82
|
"aria-label": "Decorative gradient background",
|
|
@@ -84,8 +84,8 @@ function Ne() {
|
|
|
84
84
|
}
|
|
85
85
|
) });
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
const e =
|
|
87
|
+
function Ee() {
|
|
88
|
+
const e = V(), i = [
|
|
89
89
|
{
|
|
90
90
|
// (CSS #6) blue → top-right. x-radius widened so the lobe reaches further
|
|
91
91
|
// left; y-radius kept short so it stays up top and doesn't bleed into the
|
|
@@ -151,7 +151,7 @@ function Se() {
|
|
|
151
151
|
]
|
|
152
152
|
}
|
|
153
153
|
];
|
|
154
|
-
return /* @__PURE__ */ t("div", { className: "zd:absolute zd:inset-0 zd:z-0 zd:rounded-4xl zd:pointer-events-none zd:overflow-hidden", children: /* @__PURE__ */
|
|
154
|
+
return /* @__PURE__ */ t("div", { className: "zd:absolute zd:inset-0 zd:z-0 zd:rounded-4xl zd:pointer-events-none zd:overflow-hidden", children: /* @__PURE__ */ d(
|
|
155
155
|
"svg",
|
|
156
156
|
{
|
|
157
157
|
width: "100%",
|
|
@@ -160,15 +160,15 @@ function Se() {
|
|
|
160
160
|
preserveAspectRatio: "none",
|
|
161
161
|
role: "presentation",
|
|
162
162
|
children: [
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
i.map((r) => /* @__PURE__ */ t(
|
|
164
|
+
ve,
|
|
165
165
|
{
|
|
166
|
-
layer:
|
|
166
|
+
layer: r,
|
|
167
167
|
rect: { x: 0, y: 0, width: 400, height: 800 }
|
|
168
168
|
},
|
|
169
|
-
|
|
169
|
+
r.id
|
|
170
170
|
)),
|
|
171
|
-
/* @__PURE__ */ t("defs", { children: /* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ t("defs", { children: /* @__PURE__ */ d(
|
|
172
172
|
"linearGradient",
|
|
173
173
|
{
|
|
174
174
|
id: `${e}-vfade`,
|
|
@@ -196,7 +196,7 @@ function Se() {
|
|
|
196
196
|
fill: `url(#${e}-vfade)`
|
|
197
197
|
}
|
|
198
198
|
),
|
|
199
|
-
/* @__PURE__ */ t("defs", { children: /* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ t("defs", { children: /* @__PURE__ */ d(
|
|
200
200
|
"linearGradient",
|
|
201
201
|
{
|
|
202
202
|
id: `${e}-bluefade`,
|
|
@@ -227,8 +227,8 @@ function Se() {
|
|
|
227
227
|
}
|
|
228
228
|
) });
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
const e =
|
|
230
|
+
function be() {
|
|
231
|
+
const e = V(), i = [
|
|
232
232
|
{
|
|
233
233
|
id: `${e}-g6`,
|
|
234
234
|
// (CSS #6) blue, top-right
|
|
@@ -304,7 +304,7 @@ function Ee() {
|
|
|
304
304
|
]
|
|
305
305
|
}
|
|
306
306
|
];
|
|
307
|
-
return /* @__PURE__ */ t("div", { className: "zd:absolute zd:inset-0 zd:z-0 zd:rounded-4xl zd:pointer-events-none zd:overflow-hidden", children: /* @__PURE__ */
|
|
307
|
+
return /* @__PURE__ */ t("div", { className: "zd:absolute zd:inset-0 zd:z-0 zd:rounded-4xl zd:pointer-events-none zd:overflow-hidden", children: /* @__PURE__ */ d(
|
|
308
308
|
"svg",
|
|
309
309
|
{
|
|
310
310
|
width: "100%",
|
|
@@ -313,78 +313,94 @@ function Ee() {
|
|
|
313
313
|
role: "presentation",
|
|
314
314
|
children: [
|
|
315
315
|
/* @__PURE__ */ t("rect", { width: "100%", height: "100%", fill: "#130E0B" }),
|
|
316
|
-
/* @__PURE__ */ t("defs", { children:
|
|
316
|
+
/* @__PURE__ */ t("defs", { children: i.map((r) => /* @__PURE__ */ t(
|
|
317
317
|
"radialGradient",
|
|
318
318
|
{
|
|
319
|
-
id:
|
|
320
|
-
cx: `${
|
|
321
|
-
cy: `${
|
|
319
|
+
id: r.id,
|
|
320
|
+
cx: `${r.cx / r.rx * 100}%`,
|
|
321
|
+
cy: `${r.cy / r.ry * 100}%`,
|
|
322
322
|
r: "100%",
|
|
323
323
|
gradientUnits: "objectBoundingBox",
|
|
324
|
-
gradientTransform: `scale(${
|
|
325
|
-
children:
|
|
324
|
+
gradientTransform: `scale(${r.rx}, ${r.ry})`,
|
|
325
|
+
children: r.stops.map((n, o) => /* @__PURE__ */ t(
|
|
326
326
|
"stop",
|
|
327
327
|
{
|
|
328
328
|
offset: n.offset,
|
|
329
329
|
stopColor: n.color,
|
|
330
330
|
stopOpacity: n.opacity
|
|
331
331
|
},
|
|
332
|
-
n.color +
|
|
332
|
+
n.color + o.toString()
|
|
333
333
|
))
|
|
334
334
|
},
|
|
335
|
-
|
|
335
|
+
r.id
|
|
336
336
|
)) }),
|
|
337
|
-
|
|
337
|
+
i.map((r) => /* @__PURE__ */ t(
|
|
338
338
|
"rect",
|
|
339
339
|
{
|
|
340
340
|
width: "100%",
|
|
341
341
|
height: "100%",
|
|
342
|
-
fill: `url(#${
|
|
342
|
+
fill: `url(#${r.id})`
|
|
343
343
|
},
|
|
344
|
-
`${
|
|
344
|
+
`${r.id}-rect`
|
|
345
345
|
))
|
|
346
346
|
]
|
|
347
347
|
}
|
|
348
348
|
) });
|
|
349
349
|
}
|
|
350
|
-
const
|
|
351
|
-
function
|
|
350
|
+
const Ce = Z + 16;
|
|
351
|
+
function ke({
|
|
352
352
|
children: e,
|
|
353
|
-
className:
|
|
354
|
-
contentClassName:
|
|
355
|
-
|
|
356
|
-
|
|
353
|
+
className: i,
|
|
354
|
+
contentClassName: r,
|
|
355
|
+
size: n = "lg",
|
|
356
|
+
style: o,
|
|
357
|
+
topNav: c
|
|
357
358
|
}) {
|
|
358
|
-
return /* @__PURE__ */
|
|
359
|
+
return /* @__PURE__ */ d(
|
|
359
360
|
"div",
|
|
360
361
|
{
|
|
362
|
+
"data-zd-size": n,
|
|
361
363
|
className: R(
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
364
|
+
// 400×810 by default, but never taller/wider than the parent — a
|
|
365
|
+
// consumer wrapper with its own size caps the Screen (max-w/h-full =
|
|
366
|
+
// 100% of the parent). overflow-hidden clips the frame to its rounded
|
|
367
|
+
// border ring; content scrolls in the inner div below.
|
|
368
|
+
"zd:relative zd:flex zd:flex-col zd:text-left",
|
|
369
|
+
// w-100 = 400px, h-202.5 = 810px at density 1; both compile to
|
|
370
|
+
// calc(var(--zd-spacing) * N), so they scale with the size variants.
|
|
371
|
+
// rounded-[38px] = inner card radius (32px) + the 6px border-ring gap,
|
|
372
|
+
// so the ring has a uniform width — equal inner/outer radii would make
|
|
373
|
+
// the corners read thicker than the sides.
|
|
374
|
+
"zd:w-100 zd:h-202.5 zd:max-w-full zd:max-h-full zd:overflow-hidden zd:rounded-[38px]",
|
|
375
|
+
i
|
|
366
376
|
),
|
|
367
|
-
style:
|
|
377
|
+
style: o,
|
|
368
378
|
children: [
|
|
369
|
-
/* @__PURE__ */ t(
|
|
370
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ t(be, {}),
|
|
380
|
+
/* @__PURE__ */ d(
|
|
371
381
|
"div",
|
|
372
382
|
{
|
|
373
383
|
className: R(
|
|
384
|
+
// m-1.5 = calc(var(--zd-spacing) * 1.5) = 6px at density 1, so the
|
|
385
|
+
// gradient border ring thins with the size variants. (Corner radii
|
|
386
|
+
// stay fixed, so at smaller sizes the ring is marginally non-uniform
|
|
387
|
+
// at the corners — a minor cosmetic trade-off.)
|
|
374
388
|
"zd:flex zd:flex-1 zd:flex-col zd:m-1.5 zd:px-4 zd:overflow-hidden zd:rounded-4xl zd:relative",
|
|
375
|
-
|
|
389
|
+
r
|
|
376
390
|
),
|
|
377
391
|
style: { clipPath: "inset(0 round 32px)" },
|
|
378
392
|
children: [
|
|
379
|
-
/* @__PURE__ */ t(Ne, {}),
|
|
380
393
|
/* @__PURE__ */ t(Se, {}),
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
-
|
|
394
|
+
/* @__PURE__ */ t(Ee, {}),
|
|
395
|
+
/* @__PURE__ */ d("div", { className: "zd:relative zd:z-10 zd:flex zd:flex-1 zd:flex-col zd:min-h-0", children: [
|
|
396
|
+
c,
|
|
383
397
|
/* @__PURE__ */ t(
|
|
384
398
|
"div",
|
|
385
399
|
{
|
|
386
400
|
className: "zd:flex zd:flex-1 zd:flex-col zd:min-h-0 zd:overflow-y-auto zd:overflow-x-hidden",
|
|
387
|
-
style: {
|
|
401
|
+
style: {
|
|
402
|
+
paddingTop: `calc(${Ce / 4} * var(--zd-spacing))`
|
|
403
|
+
},
|
|
388
404
|
children: e
|
|
389
405
|
}
|
|
390
406
|
)
|
|
@@ -396,19 +412,19 @@ function Ce({
|
|
|
396
412
|
}
|
|
397
413
|
);
|
|
398
414
|
}
|
|
399
|
-
const
|
|
400
|
-
error:
|
|
401
|
-
loading:
|
|
402
|
-
send:
|
|
403
|
-
success:
|
|
415
|
+
const Ae = "" + new URL("error.webp", import.meta.url).href, Oe = "" + new URL("loading.webp", import.meta.url).href, Te = "" + new URL("send.webp", import.meta.url).href, Be = "" + new URL("success.webp", import.meta.url).href, Ie = {
|
|
416
|
+
error: Ae,
|
|
417
|
+
loading: Oe,
|
|
418
|
+
send: Te,
|
|
419
|
+
success: Be
|
|
404
420
|
};
|
|
405
421
|
function I({
|
|
406
422
|
imageName: e,
|
|
407
|
-
title:
|
|
408
|
-
children:
|
|
423
|
+
title: i,
|
|
424
|
+
children: r,
|
|
409
425
|
className: n
|
|
410
426
|
}) {
|
|
411
|
-
return /* @__PURE__ */
|
|
427
|
+
return /* @__PURE__ */ d(
|
|
412
428
|
"div",
|
|
413
429
|
{
|
|
414
430
|
className: R("zd:flex zd:flex-col zd:gap-8 zd:items-center", n),
|
|
@@ -416,39 +432,39 @@ function I({
|
|
|
416
432
|
/* @__PURE__ */ t(
|
|
417
433
|
"img",
|
|
418
434
|
{
|
|
419
|
-
src:
|
|
435
|
+
src: Ie[e],
|
|
420
436
|
alt: e,
|
|
421
437
|
className: "zd:w-[118px] zd:h-[118px] zd:bg-transparent"
|
|
422
438
|
}
|
|
423
439
|
),
|
|
424
|
-
/* @__PURE__ */
|
|
425
|
-
/* @__PURE__ */ t(h, { className: "zd:text-h2 zd:text-center zd:whitespace-pre-wrap", children:
|
|
426
|
-
/* @__PURE__ */ t(h, { className: "zd:text-center zd:whitespace-pre-wrap", children:
|
|
440
|
+
/* @__PURE__ */ d("div", { className: "zd:flex zd:flex-col zd:gap-4 zd:items-center", children: [
|
|
441
|
+
/* @__PURE__ */ t(h, { className: "zd:text-h2 zd:text-center zd:whitespace-pre-wrap", children: i }),
|
|
442
|
+
/* @__PURE__ */ t(h, { className: "zd:text-center zd:whitespace-pre-wrap", children: r })
|
|
427
443
|
] })
|
|
428
444
|
]
|
|
429
445
|
}
|
|
430
446
|
);
|
|
431
447
|
}
|
|
432
|
-
function
|
|
433
|
-
const
|
|
434
|
-
if (!
|
|
448
|
+
function Q() {
|
|
449
|
+
const i = ce().connectors.find((r) => r.id === "zerodev-wallet");
|
|
450
|
+
if (!i || !("getKitStore" in i))
|
|
435
451
|
throw new Error("useKitStore must be used with the zeroDevWallet connector");
|
|
436
|
-
return
|
|
452
|
+
return i.getKitStore();
|
|
437
453
|
}
|
|
438
454
|
function F() {
|
|
439
|
-
const e =
|
|
455
|
+
const e = Q(), i = O(e, (l) => l.auth.step), r = O(e, (l) => l.auth.stepHistory), n = O(e, (l) => l.auth.email), o = O(e, (l) => l.auth.otpId), c = O(
|
|
440
456
|
e,
|
|
441
457
|
(l) => l.auth.otpEncryptionTargetBundle
|
|
442
458
|
), s = O(e, (l) => l.auth.enabledMethods), u = O(e, (l) => l.auth.config);
|
|
443
459
|
return {
|
|
444
|
-
step:
|
|
460
|
+
step: i,
|
|
445
461
|
email: n,
|
|
446
|
-
otpId:
|
|
462
|
+
otpId: o,
|
|
447
463
|
otpEncryptionTargetBundle: c,
|
|
448
464
|
enabledMethods: s,
|
|
449
465
|
config: u,
|
|
450
466
|
goToStep: e.getState().auth.goToStep,
|
|
451
|
-
goBack:
|
|
467
|
+
goBack: r.length > 0 ? e.getState().auth.goBack : null,
|
|
452
468
|
reset: e.getState().auth.reset,
|
|
453
469
|
setEmail: e.getState().auth.setEmail,
|
|
454
470
|
setOtpSession: e.getState().auth.setOtpSession,
|
|
@@ -457,9 +473,9 @@ function F() {
|
|
|
457
473
|
}
|
|
458
474
|
function L({
|
|
459
475
|
className: e,
|
|
460
|
-
style:
|
|
476
|
+
style: i
|
|
461
477
|
}) {
|
|
462
|
-
return /* @__PURE__ */
|
|
478
|
+
return /* @__PURE__ */ d(
|
|
463
479
|
"div",
|
|
464
480
|
{
|
|
465
481
|
className: R(
|
|
@@ -469,30 +485,31 @@ function L({
|
|
|
469
485
|
children: [
|
|
470
486
|
/* @__PURE__ */ t(h, { children: "Powered by" }),
|
|
471
487
|
/* @__PURE__ */ t(
|
|
472
|
-
|
|
488
|
+
se,
|
|
473
489
|
{
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
490
|
+
variant: "lockup",
|
|
491
|
+
tone: "black",
|
|
492
|
+
className: "zd:h-4.5 zd:w-auto",
|
|
493
|
+
style: i
|
|
477
494
|
}
|
|
478
495
|
)
|
|
479
496
|
]
|
|
480
497
|
}
|
|
481
498
|
);
|
|
482
499
|
}
|
|
483
|
-
function
|
|
484
|
-
const { email: e, setOtpSession:
|
|
500
|
+
function Fe() {
|
|
501
|
+
const { email: e, setOtpSession: i } = F(), { mutateAsync: r, isPending: n } = Y(), [o, c] = w(60), s = o <= 0 && !n;
|
|
485
502
|
return P(() => {
|
|
486
|
-
if (
|
|
503
|
+
if (o <= 0) return;
|
|
487
504
|
const l = setInterval(() => {
|
|
488
505
|
c((p) => Math.max(0, p - 1));
|
|
489
506
|
}, 1e3);
|
|
490
507
|
return () => {
|
|
491
508
|
clearInterval(l);
|
|
492
509
|
};
|
|
493
|
-
}, [
|
|
494
|
-
/* @__PURE__ */
|
|
495
|
-
/* @__PURE__ */
|
|
510
|
+
}, [o]), /* @__PURE__ */ d(b, { children: [
|
|
511
|
+
/* @__PURE__ */ d("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center", children: [
|
|
512
|
+
/* @__PURE__ */ d(
|
|
496
513
|
I,
|
|
497
514
|
{
|
|
498
515
|
imageName: "send",
|
|
@@ -508,7 +525,7 @@ function Ie() {
|
|
|
508
525
|
]
|
|
509
526
|
}
|
|
510
527
|
),
|
|
511
|
-
/* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */
|
|
528
|
+
/* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ d(h, { className: "zd:text-center", children: [
|
|
512
529
|
"Did not get an email?",
|
|
513
530
|
" ",
|
|
514
531
|
/* @__PURE__ */ t(
|
|
@@ -519,15 +536,15 @@ function Ie() {
|
|
|
519
536
|
onClick: async () => {
|
|
520
537
|
if (!(!e || !s))
|
|
521
538
|
try {
|
|
522
|
-
const { otpId: l, otpEncryptionTargetBundle: p } = await
|
|
539
|
+
const { otpId: l, otpEncryptionTargetBundle: p } = await r({
|
|
523
540
|
email: e
|
|
524
541
|
});
|
|
525
|
-
|
|
542
|
+
i({ otpId: l, otpEncryptionTargetBundle: p }), c(60);
|
|
526
543
|
} catch {
|
|
527
544
|
}
|
|
528
545
|
},
|
|
529
546
|
className: "zd:cursor-pointer zd:underline zd:disabled:opacity-50 zd:disabled:cursor-not-allowed",
|
|
530
|
-
children: s ? "Resend" : `Resend in ${
|
|
547
|
+
children: s ? "Resend" : `Resend in ${o} ${o === 1 ? "second" : "seconds"}`
|
|
531
548
|
}
|
|
532
549
|
)
|
|
533
550
|
] }) })
|
|
@@ -535,7 +552,7 @@ function Ie() {
|
|
|
535
552
|
/* @__PURE__ */ t(L, { className: "zd:self-center zd:pt-4 zd:pb-6" })
|
|
536
553
|
] });
|
|
537
554
|
}
|
|
538
|
-
function
|
|
555
|
+
function Pe() {
|
|
539
556
|
return typeof window > "u" ? !1 : new URLSearchParams(window.location.search).has("code");
|
|
540
557
|
}
|
|
541
558
|
function $() {
|
|
@@ -543,82 +560,82 @@ function $() {
|
|
|
543
560
|
const e = new URL(window.location.href);
|
|
544
561
|
e.searchParams.has("code") && (e.searchParams.delete("code"), window.history.replaceState(null, "", e.toString()));
|
|
545
562
|
}
|
|
546
|
-
function
|
|
563
|
+
function Re({
|
|
547
564
|
title: e = "Oops, something went wrong",
|
|
548
|
-
message:
|
|
549
|
-
showRetry:
|
|
565
|
+
message: i = "We couldn't complete the sign-in process. This could be due to timeout, an expired link, or a cancelled request.",
|
|
566
|
+
showRetry: r = !1,
|
|
550
567
|
showChooseAnother: n = !0
|
|
551
568
|
}) {
|
|
552
|
-
const { goToStep:
|
|
553
|
-
return /* @__PURE__ */
|
|
554
|
-
/* @__PURE__ */
|
|
555
|
-
/* @__PURE__ */ t(I, { imageName: "error", title: e, children:
|
|
556
|
-
/* @__PURE__ */
|
|
557
|
-
|
|
569
|
+
const { goToStep: o, goBack: c, reset: s } = F();
|
|
570
|
+
return /* @__PURE__ */ d(b, { children: [
|
|
571
|
+
/* @__PURE__ */ d("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center", children: [
|
|
572
|
+
/* @__PURE__ */ t(I, { imageName: "error", title: e, children: i }),
|
|
573
|
+
/* @__PURE__ */ d("div", { className: "zd:flex zd:flex-col zd:gap-1", children: [
|
|
574
|
+
r && /* @__PURE__ */ t(C, { action: "primary", text: "Try again", onClick: c ?? (() => o("sign-up")) }),
|
|
558
575
|
n && /* @__PURE__ */ t(
|
|
559
576
|
C,
|
|
560
577
|
{
|
|
561
|
-
action:
|
|
578
|
+
action: r ? "secondary" : "primary",
|
|
562
579
|
onClick: () => {
|
|
563
|
-
$(),
|
|
580
|
+
$(), o("sign-up");
|
|
564
581
|
},
|
|
565
582
|
text: "Choose another sign-in method"
|
|
566
583
|
}
|
|
567
584
|
),
|
|
568
|
-
!
|
|
585
|
+
!r && !n && /* @__PURE__ */ t(C, { action: "primary", text: "Start over", onClick: s })
|
|
569
586
|
] })
|
|
570
587
|
] }),
|
|
571
588
|
/* @__PURE__ */ t(L, { className: "zd:self-center zd:pt-4 zd:pb-6" })
|
|
572
589
|
] });
|
|
573
590
|
}
|
|
574
|
-
const
|
|
575
|
-
function
|
|
576
|
-
return Math.max(
|
|
591
|
+
const Le = 4, $e = 8, Ue = 6;
|
|
592
|
+
function Me(e) {
|
|
593
|
+
return Math.max(Le, Math.min($e, e));
|
|
577
594
|
}
|
|
578
|
-
function
|
|
595
|
+
function je({ char: e, isFocused: i }) {
|
|
579
596
|
return /* @__PURE__ */ t(
|
|
580
|
-
|
|
597
|
+
ae,
|
|
581
598
|
{
|
|
582
599
|
"data-testid": "code-input-box",
|
|
583
|
-
"data-active":
|
|
600
|
+
"data-active": i || void 0,
|
|
584
601
|
className: R(
|
|
585
602
|
"zd:h-16 zd:w-14 zd:rounded-lg zd:flex zd:items-center zd:justify-center",
|
|
586
|
-
|
|
603
|
+
i && "zd:border-[1.5px] zd:border-greyScale"
|
|
587
604
|
),
|
|
588
605
|
children: /* @__PURE__ */ t(h, { className: "zd:text-h2", children: e })
|
|
589
606
|
}
|
|
590
607
|
);
|
|
591
608
|
}
|
|
592
|
-
function
|
|
609
|
+
function _e({
|
|
593
610
|
onChange: e,
|
|
594
|
-
onComplete:
|
|
595
|
-
disabled:
|
|
611
|
+
onComplete: i,
|
|
612
|
+
disabled: r = !1,
|
|
596
613
|
error: n = !1,
|
|
597
|
-
autoFocus:
|
|
598
|
-
length: c =
|
|
614
|
+
autoFocus: o = !1,
|
|
615
|
+
length: c = Ue,
|
|
599
616
|
"data-testid": s
|
|
600
617
|
}) {
|
|
601
|
-
const u =
|
|
618
|
+
const u = Me(c), l = re(
|
|
602
619
|
() => Array.from({ length: u }, (f, g) => ({
|
|
603
620
|
id: `char-${g}`,
|
|
604
621
|
index: g
|
|
605
622
|
})),
|
|
606
623
|
[u]
|
|
607
|
-
), [p,
|
|
624
|
+
), [p, x] = w(""), [m, N] = w(!1), k = K(null);
|
|
608
625
|
P(() => {
|
|
609
626
|
var f;
|
|
610
|
-
|
|
611
|
-
}, [
|
|
612
|
-
|
|
627
|
+
o && !r && ((f = k.current) == null || f.focus());
|
|
628
|
+
}, [o, r]), P(() => {
|
|
629
|
+
x((f) => f.slice(0, u));
|
|
613
630
|
}, [u]);
|
|
614
631
|
const S = (f) => {
|
|
615
632
|
const g = f.slice(0, u).toUpperCase();
|
|
616
|
-
|
|
633
|
+
x(g), e == null || e(g), g.length === u && setTimeout(() => {
|
|
617
634
|
var T;
|
|
618
|
-
|
|
635
|
+
i == null || i(g), (T = k.current) == null || T.blur();
|
|
619
636
|
}, 0);
|
|
620
637
|
};
|
|
621
|
-
return /* @__PURE__ */
|
|
638
|
+
return /* @__PURE__ */ d(
|
|
622
639
|
"button",
|
|
623
640
|
{
|
|
624
641
|
type: "button",
|
|
@@ -627,7 +644,7 @@ function je({
|
|
|
627
644
|
var f;
|
|
628
645
|
return (f = k.current) == null ? void 0 : f.focus();
|
|
629
646
|
},
|
|
630
|
-
disabled:
|
|
647
|
+
disabled: r,
|
|
631
648
|
"data-testid": s,
|
|
632
649
|
children: [
|
|
633
650
|
/* @__PURE__ */ t(
|
|
@@ -639,14 +656,14 @@ function je({
|
|
|
639
656
|
onFocus: () => N(!0),
|
|
640
657
|
onBlur: () => N(!1),
|
|
641
658
|
maxLength: u,
|
|
642
|
-
disabled:
|
|
659
|
+
disabled: r,
|
|
643
660
|
className: "zd:absolute zd:opacity-0 zd:pointer-events-none",
|
|
644
661
|
style: { position: "absolute", opacity: 0 },
|
|
645
662
|
"aria-label": "Verification code"
|
|
646
663
|
}
|
|
647
664
|
),
|
|
648
665
|
l.map((f) => /* @__PURE__ */ t(
|
|
649
|
-
|
|
666
|
+
je,
|
|
650
667
|
{
|
|
651
668
|
char: p[f.index] ?? "",
|
|
652
669
|
isFocused: !n && m && f.index === p.length
|
|
@@ -657,16 +674,16 @@ function je({
|
|
|
657
674
|
}
|
|
658
675
|
);
|
|
659
676
|
}
|
|
660
|
-
function
|
|
677
|
+
function He() {
|
|
661
678
|
const {
|
|
662
679
|
email: e,
|
|
663
|
-
otpId:
|
|
664
|
-
otpEncryptionTargetBundle:
|
|
680
|
+
otpId: i,
|
|
681
|
+
otpEncryptionTargetBundle: r,
|
|
665
682
|
setOtpSession: n,
|
|
666
|
-
clearOtpSession:
|
|
683
|
+
clearOtpSession: o,
|
|
667
684
|
goToStep: c,
|
|
668
685
|
config: s
|
|
669
|
-
} = F(), { mutateAsync: u, isPending: l } =
|
|
686
|
+
} = F(), { mutateAsync: u, isPending: l } = J(), { mutateAsync: p, isPending: x } = pe(), [m, N] = w(""), [k, S] = w(!1), [f, g] = w(60);
|
|
670
687
|
P(() => {
|
|
671
688
|
if (f <= 0) return;
|
|
672
689
|
const v = setInterval(() => {
|
|
@@ -676,14 +693,14 @@ function _e() {
|
|
|
676
693
|
}, [f]);
|
|
677
694
|
const T = async () => {
|
|
678
695
|
var v, A;
|
|
679
|
-
if (!(!m.trim() || !
|
|
696
|
+
if (!(!m.trim() || !i || !r)) {
|
|
680
697
|
S(!1);
|
|
681
698
|
try {
|
|
682
699
|
await p({
|
|
683
|
-
otpId:
|
|
700
|
+
otpId: i,
|
|
684
701
|
code: m.trim(),
|
|
685
|
-
otpEncryptionTargetBundle:
|
|
686
|
-
}),
|
|
702
|
+
otpEncryptionTargetBundle: r
|
|
703
|
+
}), o(), c("authenticated"), (v = s == null ? void 0 : s.onSuccess) == null || v.call(s);
|
|
687
704
|
} catch (_) {
|
|
688
705
|
S(!0), (A = s == null ? void 0 : s.onError) == null || A.call(s, _);
|
|
689
706
|
}
|
|
@@ -702,22 +719,22 @@ function _e() {
|
|
|
702
719
|
S(!0);
|
|
703
720
|
}
|
|
704
721
|
}, U = f <= 0 && !l;
|
|
705
|
-
return /* @__PURE__ */
|
|
706
|
-
/* @__PURE__ */
|
|
707
|
-
/* @__PURE__ */
|
|
722
|
+
return /* @__PURE__ */ d(b, { children: [
|
|
723
|
+
/* @__PURE__ */ d("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center zd:items-center", children: [
|
|
724
|
+
/* @__PURE__ */ d("div", { className: "zd:flex zd:flex-col zd:gap-4", children: [
|
|
708
725
|
/* @__PURE__ */ t(h, { className: "zd:text-h2 zd:text-center", children: "Enter verification code" }),
|
|
709
|
-
/* @__PURE__ */
|
|
726
|
+
/* @__PURE__ */ d(h, { className: "zd:text-center", children: [
|
|
710
727
|
"Enter the code from the email we sent to",
|
|
711
728
|
" ",
|
|
712
729
|
/* @__PURE__ */ t(h, { className: "zd:text-solarOrange", children: e })
|
|
713
730
|
] })
|
|
714
731
|
] }),
|
|
715
732
|
/* @__PURE__ */ t(
|
|
716
|
-
|
|
733
|
+
_e,
|
|
717
734
|
{
|
|
718
735
|
onComplete: y,
|
|
719
736
|
onChange: () => S(!1),
|
|
720
|
-
disabled:
|
|
737
|
+
disabled: x,
|
|
721
738
|
error: k,
|
|
722
739
|
autoFocus: !0
|
|
723
740
|
}
|
|
@@ -727,10 +744,10 @@ function _e() {
|
|
|
727
744
|
{
|
|
728
745
|
text: "Confirm code",
|
|
729
746
|
onClick: T,
|
|
730
|
-
disabled: !m.trim() ||
|
|
747
|
+
disabled: !m.trim() || x
|
|
731
748
|
}
|
|
732
749
|
),
|
|
733
|
-
/* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */
|
|
750
|
+
/* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ d(h, { className: "zd:text-center", children: [
|
|
734
751
|
"Did not get an email?",
|
|
735
752
|
" ",
|
|
736
753
|
/* @__PURE__ */ t(
|
|
@@ -748,29 +765,29 @@ function _e() {
|
|
|
748
765
|
/* @__PURE__ */ t(L, { className: "zd:self-center zd:pt-4 zd:pb-6" })
|
|
749
766
|
] });
|
|
750
767
|
}
|
|
751
|
-
function
|
|
768
|
+
function Ge({
|
|
752
769
|
termsAndConditionsUrl: e,
|
|
753
|
-
privacyPolicyUrl:
|
|
754
|
-
agreedToTerms:
|
|
770
|
+
privacyPolicyUrl: i,
|
|
771
|
+
agreedToTerms: r,
|
|
755
772
|
setAgreedToTerms: n,
|
|
756
|
-
highlight:
|
|
773
|
+
highlight: o = !1
|
|
757
774
|
}) {
|
|
758
|
-
return /* @__PURE__ */
|
|
759
|
-
!!(e ||
|
|
775
|
+
return /* @__PURE__ */ d("div", { className: "zd:flex zd:flex-col zd:items-center zd:gap-5", children: [
|
|
776
|
+
!!(e || i) && /* @__PURE__ */ d(
|
|
760
777
|
"div",
|
|
761
778
|
{
|
|
762
|
-
className: `zd:flex zd:flex-row zd:items-center zd:gap-2 zd:rounded-md zd:p-2 zd:transition-colors ${
|
|
779
|
+
className: `zd:flex zd:flex-row zd:items-center zd:gap-2 zd:rounded-md zd:p-2 zd:transition-colors ${o ? "zd:border zd:border-negative" : "zd:border zd:border-transparent"}`,
|
|
763
780
|
children: [
|
|
764
781
|
/* @__PURE__ */ t(
|
|
765
782
|
"input",
|
|
766
783
|
{
|
|
767
784
|
type: "checkbox",
|
|
768
|
-
checked:
|
|
785
|
+
checked: r,
|
|
769
786
|
onChange: (s) => n(s.target.checked),
|
|
770
787
|
className: "zd:cursor-pointer zd:[color-scheme:light]"
|
|
771
788
|
}
|
|
772
789
|
),
|
|
773
|
-
/* @__PURE__ */
|
|
790
|
+
/* @__PURE__ */ d(h, { className: "zd:flex-1", children: [
|
|
774
791
|
"I agree to the",
|
|
775
792
|
" ",
|
|
776
793
|
e && /* @__PURE__ */ t(
|
|
@@ -784,12 +801,12 @@ function He({
|
|
|
784
801
|
children: "Terms & Conditions"
|
|
785
802
|
}
|
|
786
803
|
),
|
|
787
|
-
e &&
|
|
788
|
-
|
|
804
|
+
e && i && " and ",
|
|
805
|
+
i && /* @__PURE__ */ t(
|
|
789
806
|
h,
|
|
790
807
|
{
|
|
791
808
|
as: "a",
|
|
792
|
-
href:
|
|
809
|
+
href: i,
|
|
793
810
|
target: "_blank",
|
|
794
811
|
rel: "noopener noreferrer",
|
|
795
812
|
className: "zd:underline",
|
|
@@ -803,18 +820,18 @@ function He({
|
|
|
803
820
|
/* @__PURE__ */ t(L, {})
|
|
804
821
|
] });
|
|
805
822
|
}
|
|
806
|
-
const
|
|
823
|
+
const We = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
807
824
|
function M(e) {
|
|
808
|
-
return
|
|
825
|
+
return We.test(e.trim());
|
|
809
826
|
}
|
|
810
|
-
const
|
|
811
|
-
function
|
|
827
|
+
const qe = "" + new URL("blob.webm", import.meta.url).href;
|
|
828
|
+
function De({ className: e }) {
|
|
812
829
|
return /* @__PURE__ */ t(
|
|
813
830
|
"video",
|
|
814
831
|
{
|
|
815
832
|
className: e,
|
|
816
833
|
style: { aspectRatio: "1 / 1" },
|
|
817
|
-
src:
|
|
834
|
+
src: qe,
|
|
818
835
|
autoPlay: !0,
|
|
819
836
|
loop: !0,
|
|
820
837
|
muted: !0,
|
|
@@ -828,40 +845,40 @@ function H(e) {
|
|
|
828
845
|
return e instanceof Error ? e.name === "AbortError" || e.name === "NotAllowedError" ? !0 : e.message.toLowerCase().includes("oauth popup was closed") : !1;
|
|
829
846
|
}
|
|
830
847
|
function Ve() {
|
|
831
|
-
const { goToStep: e, setEmail:
|
|
848
|
+
const { goToStep: e, setEmail: i, setOtpSession: r, config: n, enabledMethods: o } = F(), [c, s] = w(!1), [u, l] = w(!1), [p, x] = w(""), m = (n == null ? void 0 : n.emailAuthMethod) === "otp", { mutateAsync: N, isPending: k } = J(), { mutateAsync: S, isPending: f } = Y(), g = k || f, [T, y] = w(null), { mutateAsync: j, isPending: U } = fe({
|
|
832
849
|
mutation: {
|
|
833
850
|
onSuccess: async () => {
|
|
834
|
-
var
|
|
835
|
-
e("authenticated"), (
|
|
851
|
+
var a;
|
|
852
|
+
e("authenticated"), (a = n == null ? void 0 : n.onSuccess) == null || a.call(n);
|
|
836
853
|
},
|
|
837
|
-
onError: (
|
|
854
|
+
onError: (a) => {
|
|
838
855
|
var z;
|
|
839
|
-
(z = n == null ? void 0 : n.onError) == null || z.call(n,
|
|
856
|
+
(z = n == null ? void 0 : n.onError) == null || z.call(n, a);
|
|
840
857
|
}
|
|
841
858
|
}
|
|
842
|
-
}), { mutate: v, isPending: A } =
|
|
859
|
+
}), { mutate: v, isPending: A } = he({
|
|
843
860
|
mutation: {
|
|
844
861
|
onSuccess: () => {
|
|
845
|
-
var
|
|
846
|
-
e("authenticated"), (
|
|
862
|
+
var a;
|
|
863
|
+
e("authenticated"), (a = n == null ? void 0 : n.onSuccess) == null || a.call(n);
|
|
847
864
|
},
|
|
848
|
-
onError: (
|
|
865
|
+
onError: (a) => {
|
|
849
866
|
var z;
|
|
850
|
-
H(
|
|
867
|
+
H(a) || y(a instanceof Error ? a.message : String(a)), (z = n == null ? void 0 : n.onError) == null || z.call(n, a);
|
|
851
868
|
}
|
|
852
869
|
}
|
|
853
|
-
}), { mutate: _, isPending:
|
|
870
|
+
}), { mutate: _, isPending: ee } = ze({
|
|
854
871
|
mutation: {
|
|
855
872
|
onSuccess: () => {
|
|
856
|
-
var
|
|
857
|
-
e("authenticated"), (
|
|
873
|
+
var a;
|
|
874
|
+
e("authenticated"), (a = n == null ? void 0 : n.onSuccess) == null || a.call(n);
|
|
858
875
|
},
|
|
859
|
-
onError: (
|
|
876
|
+
onError: (a) => {
|
|
860
877
|
var z;
|
|
861
|
-
H(
|
|
878
|
+
H(a) || y(a instanceof Error ? a.message : String(a)), (z = n == null ? void 0 : n.onError) == null || z.call(n, a);
|
|
862
879
|
}
|
|
863
880
|
}
|
|
864
|
-
}), E = U || g || A ||
|
|
881
|
+
}), E = U || g || A || ee, B = !!(n != null && n.termsAndConditionsUrl || n != null && n.privacyPolicyUrl) && !c, te = () => {
|
|
865
882
|
if (!E) {
|
|
866
883
|
if (B) {
|
|
867
884
|
l(!0);
|
|
@@ -869,7 +886,7 @@ function Ve() {
|
|
|
869
886
|
}
|
|
870
887
|
y(null), v();
|
|
871
888
|
}
|
|
872
|
-
},
|
|
889
|
+
}, ne = () => {
|
|
873
890
|
if (!E) {
|
|
874
891
|
if (B) {
|
|
875
892
|
l(!0);
|
|
@@ -877,7 +894,7 @@ function Ve() {
|
|
|
877
894
|
}
|
|
878
895
|
y(null), _();
|
|
879
896
|
}
|
|
880
|
-
},
|
|
897
|
+
}, oe = async () => {
|
|
881
898
|
if (B) {
|
|
882
899
|
l(!0);
|
|
883
900
|
return;
|
|
@@ -885,9 +902,9 @@ function Ve() {
|
|
|
885
902
|
y(null);
|
|
886
903
|
try {
|
|
887
904
|
await j({ provider: "google" });
|
|
888
|
-
} catch (
|
|
889
|
-
const z =
|
|
890
|
-
H(
|
|
905
|
+
} catch (a) {
|
|
906
|
+
const z = a instanceof Error ? a.message : String(a);
|
|
907
|
+
H(a) || y(z);
|
|
891
908
|
}
|
|
892
909
|
}, W = m ? async () => {
|
|
893
910
|
if (!(!p || E) && M(p)) {
|
|
@@ -897,13 +914,13 @@ function Ve() {
|
|
|
897
914
|
}
|
|
898
915
|
y(null);
|
|
899
916
|
try {
|
|
900
|
-
const { otpId:
|
|
917
|
+
const { otpId: a, otpEncryptionTargetBundle: z } = await N({
|
|
901
918
|
email: p
|
|
902
919
|
});
|
|
903
|
-
|
|
904
|
-
} catch (
|
|
920
|
+
i(p), r({ otpId: a, otpEncryptionTargetBundle: z }), e("otp-input");
|
|
921
|
+
} catch (a) {
|
|
905
922
|
y(
|
|
906
|
-
|
|
923
|
+
a instanceof Error ? a.message : "Failed to send verification code"
|
|
907
924
|
);
|
|
908
925
|
}
|
|
909
926
|
}
|
|
@@ -915,18 +932,18 @@ function Ve() {
|
|
|
915
932
|
}
|
|
916
933
|
y(null);
|
|
917
934
|
try {
|
|
918
|
-
const { otpId:
|
|
935
|
+
const { otpId: a, otpEncryptionTargetBundle: z } = await S({
|
|
919
936
|
email: p
|
|
920
937
|
});
|
|
921
|
-
|
|
922
|
-
} catch (
|
|
938
|
+
i(p), r({ otpId: a, otpEncryptionTargetBundle: z }), e("email-verification");
|
|
939
|
+
} catch (a) {
|
|
923
940
|
y(
|
|
924
|
-
|
|
941
|
+
a instanceof Error ? a.message : "Failed to send verification code"
|
|
925
942
|
);
|
|
926
943
|
}
|
|
927
944
|
}
|
|
928
945
|
};
|
|
929
|
-
return T ? /* @__PURE__ */ t("div", { className: "zd:flex zd:items-center zd:justify-center zd:h-full", children: /* @__PURE__ */
|
|
946
|
+
return T ? /* @__PURE__ */ t("div", { className: "zd:flex zd:items-center zd:justify-center zd:h-full", children: /* @__PURE__ */ d("div", { className: "zd:flex zd:flex-col zd:gap-4 zd:max-w-md", children: [
|
|
930
947
|
/* @__PURE__ */ t(h, { className: "zd:text-h2 zd:text-center", children: "Error occurred" }),
|
|
931
948
|
/* @__PURE__ */ t(h, { className: "zd:text-center zd:text-red-500", children: T }),
|
|
932
949
|
/* @__PURE__ */ t(
|
|
@@ -937,16 +954,16 @@ function Ve() {
|
|
|
937
954
|
onClick: () => y(null)
|
|
938
955
|
}
|
|
939
956
|
)
|
|
940
|
-
] }) }) : /* @__PURE__ */
|
|
941
|
-
/* @__PURE__ */
|
|
942
|
-
/* @__PURE__ */
|
|
943
|
-
/* @__PURE__ */ t("div", { className: "zd:w-full zd:px-16 zd:py-4", children: /* @__PURE__ */ t(
|
|
957
|
+
] }) }) : /* @__PURE__ */ d("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:justify-between zd:pb-4 zd:overflow-y-auto zd:overflow-x-hidden", children: [
|
|
958
|
+
/* @__PURE__ */ d("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:justify-center", children: [
|
|
959
|
+
/* @__PURE__ */ d("div", { className: "zd:px-4 zd:flex zd:flex-col zd:items-center", children: [
|
|
960
|
+
/* @__PURE__ */ t("div", { className: "zd:w-full zd:px-16 zd:py-4", children: /* @__PURE__ */ t(De, { className: "zd:w-full zd:pointer-events-none zd:select-none" }) }),
|
|
944
961
|
/* @__PURE__ */ t(h, { className: "zd:text-h2 zd:text-center", children: "Continue to your wallet" }),
|
|
945
962
|
/* @__PURE__ */ t(h, { className: "zd:mt-2 zd:text-center zd:text-greyScale/50", children: "Choose a sign-in method to proceed" })
|
|
946
963
|
] }),
|
|
947
|
-
/* @__PURE__ */
|
|
948
|
-
|
|
949
|
-
/* @__PURE__ */
|
|
964
|
+
/* @__PURE__ */ d("div", { className: "zd:mt-6 zd:flex zd:flex-col zd:gap-4 zd:mb-4", children: [
|
|
965
|
+
o.includes("passkey") && /* @__PURE__ */ d(b, { children: [
|
|
966
|
+
/* @__PURE__ */ d("div", { className: "zd:px-4 zd:flex zd:flex-col zd:gap-2", children: [
|
|
950
967
|
/* @__PURE__ */ t(
|
|
951
968
|
C,
|
|
952
969
|
{
|
|
@@ -955,7 +972,7 @@ function Ve() {
|
|
|
955
972
|
iconName: "key",
|
|
956
973
|
trailIcon: !0,
|
|
957
974
|
disabled: E,
|
|
958
|
-
onClick:
|
|
975
|
+
onClick: te
|
|
959
976
|
}
|
|
960
977
|
),
|
|
961
978
|
/* @__PURE__ */ t(
|
|
@@ -966,43 +983,43 @@ function Ve() {
|
|
|
966
983
|
iconName: "key",
|
|
967
984
|
trailIcon: !0,
|
|
968
985
|
disabled: E,
|
|
969
|
-
onClick:
|
|
986
|
+
onClick: ne
|
|
970
987
|
}
|
|
971
988
|
)
|
|
972
989
|
] }),
|
|
973
|
-
/* @__PURE__ */
|
|
990
|
+
/* @__PURE__ */ d("div", { className: "zd:flex zd:items-center zd:gap-3", children: [
|
|
974
991
|
/* @__PURE__ */ t("div", { className: "zd:h-px zd:flex-1 zd:bg-greyScale/30" }),
|
|
975
992
|
/* @__PURE__ */ t(h, { className: "zd:text-body3", children: "or" }),
|
|
976
993
|
/* @__PURE__ */ t("div", { className: "zd:h-px zd:flex-1 zd:bg-greyScale/30" })
|
|
977
994
|
] })
|
|
978
995
|
] }),
|
|
979
|
-
/* @__PURE__ */
|
|
980
|
-
|
|
981
|
-
|
|
996
|
+
/* @__PURE__ */ d("div", { className: "zd:px-4 zd:flex zd:flex-col zd:gap-2", children: [
|
|
997
|
+
o.includes("google") && /* @__PURE__ */ t(
|
|
998
|
+
X,
|
|
982
999
|
{
|
|
983
1000
|
iconName: "google",
|
|
984
1001
|
title: "Google",
|
|
985
1002
|
chevron: !0,
|
|
986
1003
|
className: "zd:rounded-3xl",
|
|
987
1004
|
disabled: E,
|
|
988
|
-
onClick:
|
|
1005
|
+
onClick: oe
|
|
989
1006
|
}
|
|
990
1007
|
),
|
|
991
|
-
|
|
992
|
-
|
|
1008
|
+
o.includes("email") && /* @__PURE__ */ t(
|
|
1009
|
+
de,
|
|
993
1010
|
{
|
|
994
1011
|
iconName: "email",
|
|
995
1012
|
placeholder: "Enter your email",
|
|
996
1013
|
value: p,
|
|
997
|
-
onChange: (
|
|
1014
|
+
onChange: (a) => x(a.target.value),
|
|
998
1015
|
type: "email",
|
|
999
1016
|
autoCapitalize: "none",
|
|
1000
1017
|
autoComplete: "email",
|
|
1001
1018
|
disabled: E,
|
|
1002
1019
|
variant: "listItemStyle",
|
|
1003
1020
|
containerClassName: "zd:rounded-3xl",
|
|
1004
|
-
onKeyDown: (
|
|
1005
|
-
|
|
1021
|
+
onKeyDown: (a) => {
|
|
1022
|
+
a.key === "Enter" && p && !E && W();
|
|
1006
1023
|
},
|
|
1007
1024
|
children: g ? /* @__PURE__ */ t("div", { className: "zd:w-13 zd:h-13 zd:flex zd:items-center zd:justify-center", children: /* @__PURE__ */ t("div", { className: "zd:w-5 zd:h-5 zd:border-2 zd:border-solarOrange zd:border-t-transparent zd:rounded-full zd:animate-spin" }) }) : /* @__PURE__ */ t(
|
|
1008
1025
|
"button",
|
|
@@ -1011,7 +1028,7 @@ function Ve() {
|
|
|
1011
1028
|
disabled: !M(p) || B,
|
|
1012
1029
|
className: `zd:w-13 zd:h-13 zd:rounded-2xl zd:flex zd:items-center zd:justify-center zd:transition-colors ${M(p) && !B ? "zd:cursor-pointer" : "zd:cursor-not-allowed zd:opacity-50"}`,
|
|
1013
1030
|
onClick: () => W(),
|
|
1014
|
-
children: /* @__PURE__ */ t(
|
|
1031
|
+
children: /* @__PURE__ */ t(le, { name: "chevronRight", className: "zd:text-greyScale" })
|
|
1015
1032
|
}
|
|
1016
1033
|
)
|
|
1017
1034
|
}
|
|
@@ -1020,54 +1037,54 @@ function Ve() {
|
|
|
1020
1037
|
] })
|
|
1021
1038
|
] }),
|
|
1022
1039
|
/* @__PURE__ */ t("div", { className: "zd:px-4", children: /* @__PURE__ */ t(
|
|
1023
|
-
|
|
1040
|
+
Ge,
|
|
1024
1041
|
{
|
|
1025
1042
|
termsAndConditionsUrl: n == null ? void 0 : n.termsAndConditionsUrl,
|
|
1026
1043
|
privacyPolicyUrl: n == null ? void 0 : n.privacyPolicyUrl,
|
|
1027
1044
|
agreedToTerms: c,
|
|
1028
|
-
setAgreedToTerms: (
|
|
1029
|
-
s(
|
|
1045
|
+
setAgreedToTerms: (a) => {
|
|
1046
|
+
s(a), a && l(!1);
|
|
1030
1047
|
},
|
|
1031
1048
|
highlight: u
|
|
1032
1049
|
}
|
|
1033
1050
|
) })
|
|
1034
1051
|
] });
|
|
1035
1052
|
}
|
|
1036
|
-
function
|
|
1053
|
+
function Ke() {
|
|
1037
1054
|
return typeof window > "u" ? null : new URLSearchParams(window.location.search).get("code");
|
|
1038
1055
|
}
|
|
1039
|
-
function
|
|
1056
|
+
function Xe() {
|
|
1040
1057
|
const {
|
|
1041
1058
|
otpId: e,
|
|
1042
|
-
otpEncryptionTargetBundle:
|
|
1043
|
-
goToStep:
|
|
1059
|
+
otpEncryptionTargetBundle: i,
|
|
1060
|
+
goToStep: r,
|
|
1044
1061
|
clearOtpSession: n,
|
|
1045
|
-
config:
|
|
1046
|
-
} = F(), [c] =
|
|
1062
|
+
config: o
|
|
1063
|
+
} = F(), [c] = w(Ke), [s, u] = w(null), l = K(!1), { mutate: p, isPending: x } = me({
|
|
1047
1064
|
mutation: {
|
|
1048
1065
|
onSuccess: async () => {
|
|
1049
1066
|
var m;
|
|
1050
|
-
n(),
|
|
1067
|
+
n(), r("authenticated"), (m = o == null ? void 0 : o.onSuccess) == null || m.call(o);
|
|
1051
1068
|
},
|
|
1052
1069
|
onError: (m) => {
|
|
1053
1070
|
var N;
|
|
1054
|
-
u(m), (N =
|
|
1071
|
+
u(m), (N = o == null ? void 0 : o.onError) == null || N.call(o, m);
|
|
1055
1072
|
}
|
|
1056
1073
|
}
|
|
1057
1074
|
});
|
|
1058
1075
|
return P(() => {
|
|
1059
1076
|
if (!(l.current || !c)) {
|
|
1060
|
-
if (l.current = !0, !e || !
|
|
1061
|
-
$(),
|
|
1077
|
+
if (l.current = !0, !e || !i) {
|
|
1078
|
+
$(), r(null);
|
|
1062
1079
|
return;
|
|
1063
1080
|
}
|
|
1064
|
-
p({ otpId: e, code: c, otpEncryptionTargetBundle:
|
|
1081
|
+
p({ otpId: e, code: c, otpEncryptionTargetBundle: i });
|
|
1065
1082
|
}
|
|
1066
|
-
}, [e,
|
|
1067
|
-
/* @__PURE__ */
|
|
1068
|
-
!s &&
|
|
1069
|
-
!s && !c && !
|
|
1070
|
-
/* @__PURE__ */
|
|
1083
|
+
}, [e, i, c, p, r]), /* @__PURE__ */ d(b, { children: [
|
|
1084
|
+
/* @__PURE__ */ d("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center", children: [
|
|
1085
|
+
!s && x && /* @__PURE__ */ t(I, { imageName: "loading", title: "Verifying Your Email", children: "Please wait while we securely connect your wallet." }),
|
|
1086
|
+
!s && !c && !x && /* @__PURE__ */ d(b, { children: [
|
|
1087
|
+
/* @__PURE__ */ d(I, { imageName: "error", title: "Invalid Link", children: [
|
|
1071
1088
|
"This verification link is invalid or incomplete.",
|
|
1072
1089
|
/* @__PURE__ */ t("br", {}),
|
|
1073
1090
|
"Please check your email and try again with the correct link."
|
|
@@ -1077,20 +1094,20 @@ function Ke() {
|
|
|
1077
1094
|
{
|
|
1078
1095
|
action: "primary",
|
|
1079
1096
|
onClick: () => {
|
|
1080
|
-
$(),
|
|
1097
|
+
$(), r("sign-up");
|
|
1081
1098
|
},
|
|
1082
1099
|
text: "Choose another sign-in method"
|
|
1083
1100
|
}
|
|
1084
1101
|
)
|
|
1085
1102
|
] }),
|
|
1086
|
-
s != null && /* @__PURE__ */
|
|
1103
|
+
s != null && /* @__PURE__ */ d(b, { children: [
|
|
1087
1104
|
/* @__PURE__ */ t(I, { imageName: "error", title: "Oops, something went wrong", children: "We couldn't complete the sign-in process. This could be due to timeout, an expired link, or a cancelled request." }),
|
|
1088
1105
|
/* @__PURE__ */ t(
|
|
1089
1106
|
C,
|
|
1090
1107
|
{
|
|
1091
1108
|
action: "primary",
|
|
1092
1109
|
onClick: () => {
|
|
1093
|
-
$(),
|
|
1110
|
+
$(), r("sign-up");
|
|
1094
1111
|
},
|
|
1095
1112
|
text: "Choose another sign-in method"
|
|
1096
1113
|
}
|
|
@@ -1100,9 +1117,9 @@ function Ke() {
|
|
|
1100
1117
|
/* @__PURE__ */ t(L, { className: "zd:self-center zd:pt-4 zd:pb-6" })
|
|
1101
1118
|
] });
|
|
1102
1119
|
}
|
|
1103
|
-
function
|
|
1104
|
-
const { goToStep: e } = F(), { connect:
|
|
1105
|
-
|
|
1120
|
+
function Ye() {
|
|
1121
|
+
const { goToStep: e } = F(), { connect: i, connectors: r, isPending: n } = ue(), o = r.filter((s) => s.id !== "zerodev-wallet"), c = (s) => {
|
|
1122
|
+
i(
|
|
1106
1123
|
{ connector: s },
|
|
1107
1124
|
{
|
|
1108
1125
|
onSuccess: () => {
|
|
@@ -1111,11 +1128,11 @@ function Xe() {
|
|
|
1111
1128
|
}
|
|
1112
1129
|
);
|
|
1113
1130
|
};
|
|
1114
|
-
return /* @__PURE__ */
|
|
1115
|
-
/* @__PURE__ */
|
|
1131
|
+
return /* @__PURE__ */ d(b, { children: [
|
|
1132
|
+
/* @__PURE__ */ d("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center", children: [
|
|
1116
1133
|
/* @__PURE__ */ t(h, { className: "zd:text-h2 zd:text-center", children: "Select your wallet" }),
|
|
1117
|
-
/* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-2", children:
|
|
1118
|
-
|
|
1134
|
+
/* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-2", children: o.length === 0 ? /* @__PURE__ */ t(h, { className: "zd:text-center", children: "No wallets detected. Install a browser wallet extension to continue." }) : o.map((s) => /* @__PURE__ */ t(
|
|
1135
|
+
X,
|
|
1119
1136
|
{
|
|
1120
1137
|
title: s.name,
|
|
1121
1138
|
iconName: "walletOutline",
|
|
@@ -1130,82 +1147,84 @@ function Xe() {
|
|
|
1130
1147
|
/* @__PURE__ */ t(L, { className: "zd:self-center zd:pt-4 zd:pb-6" })
|
|
1131
1148
|
] });
|
|
1132
1149
|
}
|
|
1133
|
-
const
|
|
1150
|
+
const Je = {
|
|
1134
1151
|
"wallet-selection": "Choose your wallet"
|
|
1135
1152
|
};
|
|
1136
|
-
function
|
|
1153
|
+
function Ze() {
|
|
1137
1154
|
return /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-1 zd:items-center zd:justify-center", children: /* @__PURE__ */ t(I, { imageName: "loading", title: "Authenticating...", children: "Please wait while we complete the OAuth authentication." }) });
|
|
1138
1155
|
}
|
|
1139
1156
|
function Qe() {
|
|
1140
1157
|
return /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-1 zd:items-center zd:justify-center", children: /* @__PURE__ */ t(I, { imageName: "loading", title: "Passkey authentication", children: "Please authenticate with your passkey." }) });
|
|
1141
1158
|
}
|
|
1142
|
-
function
|
|
1159
|
+
function et(e) {
|
|
1143
1160
|
switch (e) {
|
|
1144
1161
|
case "sign-up":
|
|
1145
1162
|
return /* @__PURE__ */ t(Ve, {});
|
|
1146
1163
|
case "email-verification":
|
|
1147
|
-
return /* @__PURE__ */ t(
|
|
1164
|
+
return /* @__PURE__ */ t(Fe, {});
|
|
1148
1165
|
case "otp-input":
|
|
1149
|
-
return /* @__PURE__ */ t(
|
|
1166
|
+
return /* @__PURE__ */ t(He, {});
|
|
1150
1167
|
case "verifying-otp":
|
|
1151
|
-
return /* @__PURE__ */ t(
|
|
1168
|
+
return /* @__PURE__ */ t(Xe, {});
|
|
1152
1169
|
case "oauth-in-progress":
|
|
1153
|
-
return /* @__PURE__ */ t(
|
|
1170
|
+
return /* @__PURE__ */ t(Ze, {});
|
|
1154
1171
|
case "passkey-prompt":
|
|
1155
1172
|
return /* @__PURE__ */ t(Qe, {});
|
|
1156
1173
|
case "wallet-selection":
|
|
1157
|
-
return /* @__PURE__ */ t(
|
|
1174
|
+
return /* @__PURE__ */ t(Ye, {});
|
|
1158
1175
|
case "error":
|
|
1159
|
-
return /* @__PURE__ */ t(
|
|
1176
|
+
return /* @__PURE__ */ t(Re, {});
|
|
1160
1177
|
default:
|
|
1161
1178
|
return null;
|
|
1162
1179
|
}
|
|
1163
1180
|
}
|
|
1164
|
-
function
|
|
1165
|
-
onClose: e
|
|
1181
|
+
function mt({
|
|
1182
|
+
onClose: e,
|
|
1183
|
+
size: i
|
|
1166
1184
|
} = {}) {
|
|
1167
|
-
const { step:
|
|
1185
|
+
const { step: r, goToStep: n, goBack: o, reset: c } = F(), s = O(Q(), (x) => x.logo);
|
|
1168
1186
|
P(() => {
|
|
1169
|
-
|
|
1170
|
-
}, [
|
|
1171
|
-
const
|
|
1172
|
-
if (!
|
|
1173
|
-
const
|
|
1174
|
-
$(),
|
|
1175
|
-
},
|
|
1187
|
+
r === null && Pe() && n("verifying-otp");
|
|
1188
|
+
}, [r, n]);
|
|
1189
|
+
const u = et(r);
|
|
1190
|
+
if (!u) return null;
|
|
1191
|
+
const l = () => {
|
|
1192
|
+
$(), c(), e == null || e();
|
|
1193
|
+
}, p = r ? Je[r] : void 0;
|
|
1176
1194
|
return /* @__PURE__ */ t(
|
|
1177
|
-
|
|
1195
|
+
ke,
|
|
1178
1196
|
{
|
|
1179
|
-
|
|
1197
|
+
...i && { size: i },
|
|
1198
|
+
contentClassName: r === "sign-up" ? "zd:px-0" : void 0,
|
|
1180
1199
|
topNav: /* @__PURE__ */ t(
|
|
1181
|
-
|
|
1200
|
+
we,
|
|
1182
1201
|
{
|
|
1183
|
-
...
|
|
1184
|
-
onClose:
|
|
1185
|
-
...
|
|
1186
|
-
...
|
|
1187
|
-
...
|
|
1202
|
+
...o !== null && { onBack: o },
|
|
1203
|
+
onClose: l,
|
|
1204
|
+
...p && { title: p },
|
|
1205
|
+
...r === "sign-up" && {
|
|
1206
|
+
...s && { logo: s },
|
|
1188
1207
|
className: "zd:px-4"
|
|
1189
1208
|
}
|
|
1190
1209
|
}
|
|
1191
1210
|
),
|
|
1192
|
-
children:
|
|
1211
|
+
children: u
|
|
1193
1212
|
}
|
|
1194
1213
|
);
|
|
1195
1214
|
}
|
|
1196
1215
|
const G = "zerodev:auth:otpSession";
|
|
1197
|
-
function
|
|
1216
|
+
function tt() {
|
|
1198
1217
|
if (typeof window > "u") return null;
|
|
1199
1218
|
try {
|
|
1200
1219
|
const e = window.localStorage.getItem(G);
|
|
1201
1220
|
if (!e) return null;
|
|
1202
|
-
const
|
|
1203
|
-
return !(
|
|
1221
|
+
const i = JSON.parse(e);
|
|
1222
|
+
return !(i != null && i.otpId) || !(i != null && i.otpEncryptionTargetBundle) ? null : i;
|
|
1204
1223
|
} catch {
|
|
1205
1224
|
return null;
|
|
1206
1225
|
}
|
|
1207
1226
|
}
|
|
1208
|
-
function
|
|
1227
|
+
function nt(e) {
|
|
1209
1228
|
if (!(typeof window > "u"))
|
|
1210
1229
|
try {
|
|
1211
1230
|
window.localStorage.setItem(
|
|
@@ -1215,14 +1234,14 @@ function tt(e) {
|
|
|
1215
1234
|
} catch {
|
|
1216
1235
|
}
|
|
1217
1236
|
}
|
|
1218
|
-
function
|
|
1237
|
+
function D() {
|
|
1219
1238
|
if (!(typeof window > "u"))
|
|
1220
1239
|
try {
|
|
1221
1240
|
window.localStorage.removeItem(G);
|
|
1222
1241
|
} catch {
|
|
1223
1242
|
}
|
|
1224
1243
|
}
|
|
1225
|
-
const
|
|
1244
|
+
const ot = (e, i, r) => ({
|
|
1226
1245
|
auth: {
|
|
1227
1246
|
// Initial state
|
|
1228
1247
|
step: null,
|
|
@@ -1234,42 +1253,42 @@ const nt = (e, o, i) => ({
|
|
|
1234
1253
|
config: null,
|
|
1235
1254
|
// Actions
|
|
1236
1255
|
initialize: (n) => {
|
|
1237
|
-
const
|
|
1256
|
+
const o = tt();
|
|
1238
1257
|
e((c) => ({
|
|
1239
1258
|
auth: {
|
|
1240
1259
|
...c.auth,
|
|
1241
1260
|
config: n,
|
|
1242
1261
|
enabledMethods: n.enabledMethods,
|
|
1243
|
-
...
|
|
1244
|
-
otpId:
|
|
1245
|
-
otpEncryptionTargetBundle:
|
|
1262
|
+
...o && {
|
|
1263
|
+
otpId: o.otpId,
|
|
1264
|
+
otpEncryptionTargetBundle: o.otpEncryptionTargetBundle
|
|
1246
1265
|
}
|
|
1247
1266
|
}
|
|
1248
1267
|
}));
|
|
1249
1268
|
},
|
|
1250
1269
|
goToStep: (n) => {
|
|
1251
|
-
e((
|
|
1270
|
+
e((o) => ({
|
|
1252
1271
|
auth: {
|
|
1253
|
-
...
|
|
1272
|
+
...o.auth,
|
|
1254
1273
|
step: n,
|
|
1255
|
-
stepHistory:
|
|
1274
|
+
stepHistory: o.auth.step === null ? o.auth.stepHistory : [...o.auth.stepHistory, o.auth.step]
|
|
1256
1275
|
}
|
|
1257
1276
|
}));
|
|
1258
1277
|
},
|
|
1259
1278
|
goBack: () => {
|
|
1260
|
-
const { auth: n } =
|
|
1279
|
+
const { auth: n } = i();
|
|
1261
1280
|
if (n.stepHistory.length === 0) return;
|
|
1262
|
-
const
|
|
1281
|
+
const o = [...n.stepHistory], c = o.pop();
|
|
1263
1282
|
e((s) => ({
|
|
1264
1283
|
auth: {
|
|
1265
1284
|
...s.auth,
|
|
1266
1285
|
step: c,
|
|
1267
|
-
stepHistory:
|
|
1286
|
+
stepHistory: o
|
|
1268
1287
|
}
|
|
1269
1288
|
}));
|
|
1270
1289
|
},
|
|
1271
1290
|
reset: () => {
|
|
1272
|
-
|
|
1291
|
+
D(), e((n) => ({
|
|
1273
1292
|
auth: {
|
|
1274
1293
|
...n.auth,
|
|
1275
1294
|
step: null,
|
|
@@ -1281,24 +1300,24 @@ const nt = (e, o, i) => ({
|
|
|
1281
1300
|
}));
|
|
1282
1301
|
},
|
|
1283
1302
|
setEmail: (n) => {
|
|
1284
|
-
e((
|
|
1303
|
+
e((o) => ({
|
|
1285
1304
|
auth: {
|
|
1286
|
-
...
|
|
1305
|
+
...o.auth,
|
|
1287
1306
|
email: n
|
|
1288
1307
|
}
|
|
1289
1308
|
}));
|
|
1290
1309
|
},
|
|
1291
|
-
setOtpSession: ({ otpId: n, otpEncryptionTargetBundle:
|
|
1292
|
-
|
|
1310
|
+
setOtpSession: ({ otpId: n, otpEncryptionTargetBundle: o }) => {
|
|
1311
|
+
nt({ otpId: n, otpEncryptionTargetBundle: o }), e((c) => ({
|
|
1293
1312
|
auth: {
|
|
1294
1313
|
...c.auth,
|
|
1295
1314
|
otpId: n,
|
|
1296
|
-
otpEncryptionTargetBundle:
|
|
1315
|
+
otpEncryptionTargetBundle: o
|
|
1297
1316
|
}
|
|
1298
1317
|
}));
|
|
1299
1318
|
},
|
|
1300
1319
|
clearOtpSession: () => {
|
|
1301
|
-
|
|
1320
|
+
D(), e((n) => ({
|
|
1302
1321
|
auth: {
|
|
1303
1322
|
...n.auth,
|
|
1304
1323
|
otpId: null,
|
|
@@ -1307,37 +1326,37 @@ const nt = (e, o, i) => ({
|
|
|
1307
1326
|
}));
|
|
1308
1327
|
}
|
|
1309
1328
|
}
|
|
1310
|
-
}),
|
|
1311
|
-
|
|
1329
|
+
}), rt = (e = {}) => ie()(
|
|
1330
|
+
xe((i, r, n) => ({
|
|
1312
1331
|
pendingRequests: [],
|
|
1313
1332
|
userConfirmationListenerActive: !1,
|
|
1314
1333
|
logo: e.logo ?? null,
|
|
1315
|
-
addPendingRequest: (
|
|
1316
|
-
pendingRequests: [...c.pendingRequests,
|
|
1334
|
+
addPendingRequest: (o) => i((c) => ({
|
|
1335
|
+
pendingRequests: [...c.pendingRequests, o]
|
|
1317
1336
|
})),
|
|
1318
|
-
removePendingRequest: (
|
|
1319
|
-
pendingRequests: c.pendingRequests.filter((s) => s.id !==
|
|
1337
|
+
removePendingRequest: (o) => i((c) => ({
|
|
1338
|
+
pendingRequests: c.pendingRequests.filter((s) => s.id !== o)
|
|
1320
1339
|
})),
|
|
1321
|
-
clearPendingRequests: () =>
|
|
1322
|
-
setUserConfirmationListenerActive: (
|
|
1323
|
-
...
|
|
1340
|
+
clearPendingRequests: () => i({ pendingRequests: [] }),
|
|
1341
|
+
setUserConfirmationListenerActive: (o) => i({ userConfirmationListenerActive: o }),
|
|
1342
|
+
...ot(i, r)
|
|
1324
1343
|
}))
|
|
1325
1344
|
);
|
|
1326
|
-
function
|
|
1327
|
-
return new Promise((
|
|
1345
|
+
function it(e) {
|
|
1346
|
+
return new Promise((i, r) => {
|
|
1328
1347
|
const n = e.subscribe(
|
|
1329
|
-
(
|
|
1330
|
-
(
|
|
1331
|
-
|
|
1348
|
+
(o) => o.auth.step,
|
|
1349
|
+
(o) => {
|
|
1350
|
+
o === "authenticated" ? (n(), i()) : o === null && (n(), r(new Error("Auth flow dismissed")));
|
|
1332
1351
|
}
|
|
1333
1352
|
);
|
|
1334
1353
|
});
|
|
1335
1354
|
}
|
|
1336
|
-
function
|
|
1337
|
-
var n,
|
|
1338
|
-
const
|
|
1339
|
-
return (
|
|
1340
|
-
const s =
|
|
1355
|
+
function gt(e) {
|
|
1356
|
+
var n, o;
|
|
1357
|
+
const i = ge(e), r = rt({ logo: (n = e.config) == null ? void 0 : n.logo });
|
|
1358
|
+
return (o = e.config) != null && o.auth && r.getState().auth.initialize(e.config.auth), (c) => {
|
|
1359
|
+
const s = i(c);
|
|
1341
1360
|
return {
|
|
1342
1361
|
...s,
|
|
1343
1362
|
async connect(u) {
|
|
@@ -1345,30 +1364,30 @@ function mt(e) {
|
|
|
1345
1364
|
try {
|
|
1346
1365
|
return await s.connect(u);
|
|
1347
1366
|
} catch (p) {
|
|
1348
|
-
if (u != null && u.isReconnecting || !((l = e.config) != null && l.auth) || !(p instanceof
|
|
1367
|
+
if (u != null && u.isReconnecting || !((l = e.config) != null && l.auth) || !(p instanceof ye))
|
|
1349
1368
|
throw p;
|
|
1350
|
-
if (
|
|
1369
|
+
if (r.getState().auth.step !== null)
|
|
1351
1370
|
throw new Error("Auth flow already in progress");
|
|
1352
|
-
return
|
|
1371
|
+
return r.getState().auth.goToStep("sign-up"), await it(r), s.connect(u);
|
|
1353
1372
|
}
|
|
1354
1373
|
},
|
|
1355
1374
|
async disconnect() {
|
|
1356
1375
|
var u, l;
|
|
1357
|
-
await ((u = s.disconnect) == null ? void 0 : u.call(s)), (l = e.config) != null && l.auth &&
|
|
1376
|
+
await ((u = s.disconnect) == null ? void 0 : u.call(s)), (l = e.config) != null && l.auth && r.getState().auth.reset();
|
|
1358
1377
|
},
|
|
1359
1378
|
async setup() {
|
|
1360
1379
|
var u;
|
|
1361
1380
|
await ((u = s.setup) == null ? void 0 : u.call(s)), typeof window > "u";
|
|
1362
1381
|
},
|
|
1363
1382
|
getKitStore() {
|
|
1364
|
-
return
|
|
1383
|
+
return r;
|
|
1365
1384
|
}
|
|
1366
1385
|
};
|
|
1367
1386
|
};
|
|
1368
1387
|
}
|
|
1369
1388
|
export {
|
|
1370
|
-
|
|
1389
|
+
mt as AuthFlow,
|
|
1371
1390
|
F as useAuth,
|
|
1372
|
-
|
|
1391
|
+
gt as zeroDevWallet
|
|
1373
1392
|
};
|
|
1374
1393
|
//# sourceMappingURL=index.mjs.map
|