@zerodev/wallet-react-ui 0.0.11 → 0.0.12
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/README.md +38 -7
- package/dist/_types/auth/brandAssets.d.ts +2 -0
- package/dist/_types/auth/brandAssets.d.ts.map +1 -0
- package/dist/_types/auth/components/WalletSheet/index.d.ts +20 -0
- package/dist/_types/auth/components/WalletSheet/index.d.ts.map +1 -0
- package/dist/_types/auth/hooks/useWalletConnectPairing.d.ts +19 -0
- package/dist/_types/auth/hooks/useWalletConnectPairing.d.ts.map +1 -0
- package/dist/_types/auth/hooks/useWalletInfo.d.ts +32 -0
- package/dist/_types/auth/hooks/useWalletInfo.d.ts.map +1 -0
- package/dist/_types/auth/pages/SignUp/MoreWallets.d.ts.map +1 -1
- package/dist/_types/auth/pages/SignUp/Wallet.d.ts.map +1 -1
- package/dist/_types/auth/pages/SignUp/WalletConnect.d.ts +5 -0
- package/dist/_types/auth/pages/SignUp/WalletConnect.d.ts.map +1 -0
- package/dist/_types/auth/pages/SignUp/context.d.ts +4 -0
- package/dist/_types/auth/pages/SignUp/context.d.ts.map +1 -1
- package/dist/_types/auth/pages/SignUp/index.d.ts +2 -0
- package/dist/_types/auth/pages/SignUp/index.d.ts.map +1 -1
- package/dist/_types/auth/utils/isMobile.d.ts +2 -0
- package/dist/_types/auth/utils/isMobile.d.ts.map +1 -0
- package/dist/_types/auth/utils/isZeroDevWalletConnect.d.ts +6 -0
- package/dist/_types/auth/utils/isZeroDevWalletConnect.d.ts.map +1 -0
- package/dist/_types/auth/utils/walletDeepLink.d.ts +18 -0
- package/dist/_types/auth/utils/walletDeepLink.d.ts.map +1 -0
- package/dist/_types/auth/walletGuide.d.ts +21 -3
- package/dist/_types/auth/walletGuide.d.ts.map +1 -1
- package/dist/_types/index.d.ts +3 -0
- package/dist/_types/index.d.ts.map +1 -1
- package/dist/_types/zeroDevWalletConnect.d.ts +13 -0
- package/dist/_types/zeroDevWalletConnect.d.ts.map +1 -0
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1009 -659
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +6 -5
- package/src/assets.d.ts +5 -0
- package/src/auth/brandAssets.ts +5 -0
- package/src/auth/components/WalletSheet/index.tsx +220 -0
- package/src/auth/hooks/useWalletConnectPairing.ts +134 -0
- package/src/auth/hooks/useWalletInfo.ts +145 -0
- package/src/auth/pages/SignUp/InstalledWallets.tsx +1 -1
- package/src/auth/pages/SignUp/MoreWallets.tsx +44 -9
- package/src/auth/pages/SignUp/Wallet.tsx +43 -13
- package/src/auth/pages/SignUp/WalletConnect.tsx +32 -0
- package/src/auth/pages/SignUp/context.tsx +4 -0
- package/src/auth/pages/SignUp/index.tsx +31 -0
- package/src/auth/utils/isMobile.ts +9 -0
- package/src/auth/utils/isZeroDevWalletConnect.ts +8 -0
- package/src/auth/utils/walletDeepLink.ts +23 -0
- package/src/auth/walletGuide.ts +42 -8
- package/src/index.ts +7 -2
- package/src/zeroDevWalletConnect.ts +95 -0
package/dist/index.mjs
CHANGED
|
@@ -1,59 +1,60 @@
|
|
|
1
|
-
import { jsxs as c, jsx as
|
|
2
|
-
import { Text as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useStore as
|
|
5
|
-
import { useConfig as
|
|
6
|
-
import { useSendMagicLink as
|
|
7
|
-
import { subscribeWithSelector as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as c, jsx as n, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import { Text as w, cn as q, PoweredBy as Z, Button as A, Wrapper as c2, BottomSheet as u2, BottomSheetContent as f2, BottomSheetTitle as p2, BottomSheetClose as m2, QrCode as N2, Input as U2, Icon as K, ListItem as T, ListItemChevron as G, ListItemIcon as h2, Badge as X, Screen as g2, TopNav as z2 } from "@zerodev/react-ui";
|
|
3
|
+
import { useState as E, useEffect as N, useMemo as $, useRef as e2, createContext as I2, useContext as T2, useLayoutEffect as L2, useCallback as O2, Fragment as M2 } from "react";
|
|
4
|
+
import { useStore as W, create as B2 } from "zustand";
|
|
5
|
+
import { useConfig as H2, useConnectors as H, useConnect as V, useConnections as R2, useAccount as D2 } from "wagmi";
|
|
6
|
+
import { useSendMagicLink as C2, useSendOTP as w2, useVerifyOTP as P2, useAuthenticateOAuth as W2, useRegisterPasskey as _2, useLoginPasskey as Z2, useVerifyMagicLink as G2, zeroDevWallet as V2, NotAuthenticatedError as j2 } from "@zerodev/wallet-react";
|
|
7
|
+
import { subscribeWithSelector as q2 } from "zustand/middleware";
|
|
8
|
+
import { walletConnect as K2 } from "wagmi/connectors";
|
|
9
|
+
const J2 = "" + new URL("error.webp", import.meta.url).href, Q2 = "" + new URL("loading.webp", import.meta.url).href, Y2 = "" + new URL("send.webp", import.meta.url).href, X2 = "" + new URL("success.webp", import.meta.url).href, $2 = {
|
|
10
|
+
error: J2,
|
|
11
|
+
loading: Q2,
|
|
12
|
+
send: Y2,
|
|
13
|
+
success: X2
|
|
13
14
|
};
|
|
14
|
-
function
|
|
15
|
+
function L({
|
|
15
16
|
imageName: e,
|
|
16
|
-
title:
|
|
17
|
+
title: t,
|
|
17
18
|
children: r,
|
|
18
|
-
className:
|
|
19
|
+
className: i
|
|
19
20
|
}) {
|
|
20
21
|
return /* @__PURE__ */ c(
|
|
21
22
|
"div",
|
|
22
23
|
{
|
|
23
|
-
className:
|
|
24
|
+
className: q("zd:flex zd:flex-col zd:gap-8 zd:items-center", i),
|
|
24
25
|
children: [
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
+
/* @__PURE__ */ n(
|
|
26
27
|
"img",
|
|
27
28
|
{
|
|
28
|
-
src:
|
|
29
|
+
src: $2[e],
|
|
29
30
|
alt: e,
|
|
30
31
|
className: "zd:w-[118px] zd:h-[118px] zd:bg-transparent"
|
|
31
32
|
}
|
|
32
33
|
),
|
|
33
34
|
/* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:gap-4 zd:items-center", children: [
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ n(w, { className: "zd:text-h2 zd:text-center zd:whitespace-pre-wrap", children: t }),
|
|
36
|
+
/* @__PURE__ */ n(w, { className: "zd:text-center zd:whitespace-pre-wrap", children: r })
|
|
36
37
|
] })
|
|
37
38
|
]
|
|
38
39
|
}
|
|
39
40
|
);
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
-
const
|
|
43
|
-
if (!
|
|
42
|
+
function ee() {
|
|
43
|
+
const t = H2().connectors.find((r) => r.id === "zerodev-wallet");
|
|
44
|
+
if (!t || !("getKitStore" in t))
|
|
44
45
|
throw new Error("useKitStore must be used with the zeroDevWallet connector");
|
|
45
|
-
return
|
|
46
|
+
return t.getKitStore();
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
-
const e =
|
|
48
|
+
function S() {
|
|
49
|
+
const e = ee(), t = W(e, (s) => s.auth.step), r = W(e, (s) => s.auth.stepHistory), i = W(e, (s) => s.auth.email), o = W(e, (s) => s.auth.otpId), a = W(
|
|
49
50
|
e,
|
|
50
|
-
(
|
|
51
|
+
(s) => s.auth.otpEncryptionTargetBundle
|
|
51
52
|
);
|
|
52
53
|
return {
|
|
53
|
-
step:
|
|
54
|
-
email:
|
|
55
|
-
otpId:
|
|
56
|
-
otpEncryptionTargetBundle:
|
|
54
|
+
step: t,
|
|
55
|
+
email: i,
|
|
56
|
+
otpId: o,
|
|
57
|
+
otpEncryptionTargetBundle: a,
|
|
57
58
|
goToStep: e.getState().auth.goToStep,
|
|
58
59
|
goBack: r.length > 0 ? e.getState().auth.goBack : null,
|
|
59
60
|
reset: e.getState().auth.reset,
|
|
@@ -62,20 +63,20 @@ function F() {
|
|
|
62
63
|
clearOtpSession: e.getState().auth.clearOtpSession
|
|
63
64
|
};
|
|
64
65
|
}
|
|
65
|
-
function
|
|
66
|
-
const { email: e, setOtpSession:
|
|
67
|
-
return
|
|
68
|
-
if (
|
|
69
|
-
const
|
|
70
|
-
|
|
66
|
+
function te() {
|
|
67
|
+
const { email: e, setOtpSession: t } = S(), { mutateAsync: r, isPending: i } = C2(), [o, a] = E(60), s = o <= 0 && !i;
|
|
68
|
+
return N(() => {
|
|
69
|
+
if (o <= 0) return;
|
|
70
|
+
const u = setInterval(() => {
|
|
71
|
+
a((g) => Math.max(0, g - 1));
|
|
71
72
|
}, 1e3);
|
|
72
73
|
return () => {
|
|
73
|
-
clearInterval(
|
|
74
|
+
clearInterval(u);
|
|
74
75
|
};
|
|
75
|
-
}, [
|
|
76
|
+
}, [o]), /* @__PURE__ */ c(b, { children: [
|
|
76
77
|
/* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center", children: [
|
|
77
78
|
/* @__PURE__ */ c(
|
|
78
|
-
|
|
79
|
+
L,
|
|
79
80
|
{
|
|
80
81
|
imageName: "send",
|
|
81
82
|
title: `Check your email!
|
|
@@ -83,121 +84,121 @@ function B2() {
|
|
|
83
84
|
children: [
|
|
84
85
|
"We've sent a magic link to",
|
|
85
86
|
" ",
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ n(w, { as: "span", className: "zd:text-solarOrange", children: e }),
|
|
87
88
|
`
|
|
88
89
|
`,
|
|
89
90
|
"Please open the email and click the link to log in."
|
|
90
91
|
]
|
|
91
92
|
}
|
|
92
93
|
),
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ n("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ c(w, { className: "zd:text-center", children: [
|
|
94
95
|
"Did not get an email?",
|
|
95
96
|
" ",
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ n(
|
|
97
98
|
"button",
|
|
98
99
|
{
|
|
99
100
|
type: "button",
|
|
100
|
-
disabled: !
|
|
101
|
+
disabled: !s,
|
|
101
102
|
onClick: async () => {
|
|
102
|
-
if (!(!e || !
|
|
103
|
+
if (!(!e || !s))
|
|
103
104
|
try {
|
|
104
|
-
const { otpId:
|
|
105
|
+
const { otpId: u, otpEncryptionTargetBundle: g } = await r({
|
|
105
106
|
email: e
|
|
106
107
|
});
|
|
107
|
-
|
|
108
|
+
t({ otpId: u, otpEncryptionTargetBundle: g }), a(60);
|
|
108
109
|
} catch {
|
|
109
110
|
}
|
|
110
111
|
},
|
|
111
112
|
className: "zd:cursor-pointer zd:underline zd:disabled:opacity-50 zd:disabled:cursor-not-allowed",
|
|
112
|
-
children:
|
|
113
|
+
children: s ? "Resend" : `Resend in ${o} ${o === 1 ? "second" : "seconds"}`
|
|
113
114
|
}
|
|
114
115
|
)
|
|
115
116
|
] }) })
|
|
116
117
|
] }),
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
+
/* @__PURE__ */ n(Z, { className: "zd:self-center zd:pt-4 zd:pb-6" })
|
|
118
119
|
] });
|
|
119
120
|
}
|
|
120
|
-
function
|
|
121
|
+
function ne() {
|
|
121
122
|
return typeof window > "u" ? !1 : new URLSearchParams(window.location.search).has("code");
|
|
122
123
|
}
|
|
123
|
-
function
|
|
124
|
+
function _() {
|
|
124
125
|
if (typeof window > "u") return;
|
|
125
126
|
const e = new URL(window.location.href);
|
|
126
127
|
e.searchParams.has("code") && (e.searchParams.delete("code"), window.history.replaceState(null, "", e.toString()));
|
|
127
128
|
}
|
|
128
|
-
function
|
|
129
|
+
function ie({
|
|
129
130
|
title: e = "Oops, something went wrong",
|
|
130
|
-
message:
|
|
131
|
+
message: t = "We couldn't complete the sign-in process. This could be due to timeout, an expired link, or a cancelled request.",
|
|
131
132
|
showRetry: r = !1,
|
|
132
|
-
showChooseAnother:
|
|
133
|
+
showChooseAnother: i = !0
|
|
133
134
|
}) {
|
|
134
|
-
const { goToStep:
|
|
135
|
-
return /* @__PURE__ */ c(
|
|
135
|
+
const { goToStep: o, goBack: a, reset: s } = S();
|
|
136
|
+
return /* @__PURE__ */ c(b, { children: [
|
|
136
137
|
/* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center", children: [
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ n(L, { imageName: "error", title: e, children: t }),
|
|
138
139
|
/* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:gap-1", children: [
|
|
139
|
-
r && /* @__PURE__ */
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
r && /* @__PURE__ */ n(A, { action: "primary", text: "Try again", onClick: a ?? (() => o("sign-up")) }),
|
|
141
|
+
i && /* @__PURE__ */ n(
|
|
142
|
+
A,
|
|
142
143
|
{
|
|
143
144
|
action: r ? "secondary" : "primary",
|
|
144
145
|
onClick: () => {
|
|
145
|
-
|
|
146
|
+
_(), o("sign-up");
|
|
146
147
|
},
|
|
147
148
|
text: "Choose another sign-in method"
|
|
148
149
|
}
|
|
149
150
|
),
|
|
150
|
-
!r && !
|
|
151
|
+
!r && !i && /* @__PURE__ */ n(A, { action: "primary", text: "Start over", onClick: s })
|
|
151
152
|
] })
|
|
152
153
|
] }),
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ n(Z, { className: "zd:self-center zd:pt-4 zd:pb-6" })
|
|
154
155
|
] });
|
|
155
156
|
}
|
|
156
|
-
const
|
|
157
|
-
function
|
|
158
|
-
return Math.max(
|
|
157
|
+
const re = 4, oe = 8, ae = 6;
|
|
158
|
+
function se(e) {
|
|
159
|
+
return Math.max(re, Math.min(oe, e));
|
|
159
160
|
}
|
|
160
|
-
function
|
|
161
|
-
return /* @__PURE__ */
|
|
162
|
-
|
|
161
|
+
function le({ char: e, isFocused: t }) {
|
|
162
|
+
return /* @__PURE__ */ n(
|
|
163
|
+
c2,
|
|
163
164
|
{
|
|
164
165
|
"data-testid": "code-input-box",
|
|
165
|
-
"data-active":
|
|
166
|
-
className:
|
|
166
|
+
"data-active": t || void 0,
|
|
167
|
+
className: q(
|
|
167
168
|
"zd:h-16 zd:w-14 zd:rounded-lg zd:flex zd:items-center zd:justify-center",
|
|
168
|
-
|
|
169
|
+
t && "zd:border-[1.5px] zd:border-greyScale"
|
|
169
170
|
),
|
|
170
|
-
children: /* @__PURE__ */
|
|
171
|
+
children: /* @__PURE__ */ n(w, { className: "zd:text-h2", children: e })
|
|
171
172
|
}
|
|
172
173
|
);
|
|
173
174
|
}
|
|
174
|
-
function
|
|
175
|
+
function de({
|
|
175
176
|
onChange: e,
|
|
176
|
-
onComplete:
|
|
177
|
+
onComplete: t,
|
|
177
178
|
disabled: r = !1,
|
|
178
|
-
error:
|
|
179
|
-
autoFocus:
|
|
180
|
-
length:
|
|
181
|
-
"data-testid":
|
|
179
|
+
error: i = !1,
|
|
180
|
+
autoFocus: o = !1,
|
|
181
|
+
length: a = ae,
|
|
182
|
+
"data-testid": s
|
|
182
183
|
}) {
|
|
183
|
-
const
|
|
184
|
-
() => Array.from({ length:
|
|
185
|
-
id: `char-${
|
|
186
|
-
index:
|
|
184
|
+
const l = se(a), u = $(
|
|
185
|
+
() => Array.from({ length: l }, (f, C) => ({
|
|
186
|
+
id: `char-${C}`,
|
|
187
|
+
index: C
|
|
187
188
|
})),
|
|
188
|
-
[
|
|
189
|
-
), [
|
|
190
|
-
|
|
191
|
-
var
|
|
192
|
-
|
|
193
|
-
}, [
|
|
194
|
-
|
|
195
|
-
}, [
|
|
196
|
-
const
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
var
|
|
200
|
-
|
|
189
|
+
[l]
|
|
190
|
+
), [g, z] = E(""), [F, p] = E(!1), d = e2(null);
|
|
191
|
+
N(() => {
|
|
192
|
+
var f;
|
|
193
|
+
o && !r && ((f = d.current) == null || f.focus());
|
|
194
|
+
}, [o, r]), N(() => {
|
|
195
|
+
z((f) => f.slice(0, l));
|
|
196
|
+
}, [l]);
|
|
197
|
+
const D = (f) => {
|
|
198
|
+
const C = f.slice(0, l).toUpperCase();
|
|
199
|
+
z(C), e == null || e(C), C.length === l && setTimeout(() => {
|
|
200
|
+
var x;
|
|
201
|
+
t == null || t(C), (x = d.current) == null || x.blur();
|
|
201
202
|
}, 0);
|
|
202
203
|
};
|
|
203
204
|
return /* @__PURE__ */ c(
|
|
@@ -206,155 +207,155 @@ function K2({
|
|
|
206
207
|
type: "button",
|
|
207
208
|
className: "zd:flex zd:flex-row zd:items-center zd:justify-between zd:gap-2 zd:w-full zd:cursor-text",
|
|
208
209
|
onClick: () => {
|
|
209
|
-
var
|
|
210
|
-
return (
|
|
210
|
+
var f;
|
|
211
|
+
return (f = d.current) == null ? void 0 : f.focus();
|
|
211
212
|
},
|
|
212
213
|
disabled: r,
|
|
213
|
-
"data-testid":
|
|
214
|
+
"data-testid": s,
|
|
214
215
|
children: [
|
|
215
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ n(
|
|
216
217
|
"input",
|
|
217
218
|
{
|
|
218
219
|
ref: d,
|
|
219
|
-
value:
|
|
220
|
-
onChange: (
|
|
221
|
-
onFocus: () =>
|
|
222
|
-
onBlur: () =>
|
|
223
|
-
maxLength:
|
|
220
|
+
value: g,
|
|
221
|
+
onChange: (f) => D(f.target.value),
|
|
222
|
+
onFocus: () => p(!0),
|
|
223
|
+
onBlur: () => p(!1),
|
|
224
|
+
maxLength: l,
|
|
224
225
|
disabled: r,
|
|
225
226
|
className: "zd:absolute zd:opacity-0 zd:pointer-events-none",
|
|
226
227
|
style: { position: "absolute", opacity: 0 },
|
|
227
228
|
"aria-label": "Verification code"
|
|
228
229
|
}
|
|
229
230
|
),
|
|
230
|
-
|
|
231
|
-
|
|
231
|
+
u.map((f) => /* @__PURE__ */ n(
|
|
232
|
+
le,
|
|
232
233
|
{
|
|
233
|
-
char:
|
|
234
|
-
isFocused: !
|
|
234
|
+
char: g[f.index] ?? "",
|
|
235
|
+
isFocused: !i && F && f.index === g.length
|
|
235
236
|
},
|
|
236
|
-
|
|
237
|
+
f.id
|
|
237
238
|
))
|
|
238
239
|
]
|
|
239
240
|
}
|
|
240
241
|
);
|
|
241
242
|
}
|
|
242
|
-
function
|
|
243
|
+
function ce() {
|
|
243
244
|
const {
|
|
244
245
|
email: e,
|
|
245
|
-
otpId:
|
|
246
|
+
otpId: t,
|
|
246
247
|
otpEncryptionTargetBundle: r,
|
|
247
|
-
setOtpSession:
|
|
248
|
-
clearOtpSession:
|
|
249
|
-
goToStep:
|
|
250
|
-
} =
|
|
251
|
-
|
|
252
|
-
if (
|
|
248
|
+
setOtpSession: i,
|
|
249
|
+
clearOtpSession: o,
|
|
250
|
+
goToStep: a
|
|
251
|
+
} = S(), { mutateAsync: s, isPending: l } = w2(), { mutateAsync: u, isPending: g } = P2(), [z, F] = E(""), [p, d] = E(!1), [D, f] = E(60);
|
|
252
|
+
N(() => {
|
|
253
|
+
if (D <= 0) return;
|
|
253
254
|
const v = setInterval(() => {
|
|
254
|
-
|
|
255
|
+
f((y) => Math.max(0, y - 1));
|
|
255
256
|
}, 1e3);
|
|
256
257
|
return () => clearInterval(v);
|
|
257
|
-
}, [
|
|
258
|
-
const
|
|
259
|
-
if (!(!
|
|
258
|
+
}, [D]);
|
|
259
|
+
const C = async () => {
|
|
260
|
+
if (!(!z.trim() || !t || !r)) {
|
|
260
261
|
d(!1);
|
|
261
262
|
try {
|
|
262
|
-
await
|
|
263
|
-
otpId:
|
|
264
|
-
code:
|
|
263
|
+
await u({
|
|
264
|
+
otpId: t,
|
|
265
|
+
code: z.trim(),
|
|
265
266
|
otpEncryptionTargetBundle: r
|
|
266
|
-
}),
|
|
267
|
+
}), o(), a("authenticated");
|
|
267
268
|
} catch {
|
|
268
269
|
d(!0);
|
|
269
270
|
}
|
|
270
271
|
}
|
|
271
|
-
},
|
|
272
|
-
|
|
273
|
-
},
|
|
274
|
-
if (!(!e ||
|
|
272
|
+
}, x = (v) => {
|
|
273
|
+
F(v);
|
|
274
|
+
}, m = async () => {
|
|
275
|
+
if (!(!e || D > 0 || l))
|
|
275
276
|
try {
|
|
276
|
-
const { otpId: v, otpEncryptionTargetBundle:
|
|
277
|
-
|
|
277
|
+
const { otpId: v, otpEncryptionTargetBundle: y } = await s({ email: e });
|
|
278
|
+
i({
|
|
278
279
|
otpId: v,
|
|
279
|
-
otpEncryptionTargetBundle:
|
|
280
|
-
}),
|
|
280
|
+
otpEncryptionTargetBundle: y
|
|
281
|
+
}), f(60), d(!1);
|
|
281
282
|
} catch {
|
|
282
283
|
d(!0);
|
|
283
284
|
}
|
|
284
|
-
},
|
|
285
|
-
return /* @__PURE__ */ c(
|
|
285
|
+
}, h = D <= 0 && !l;
|
|
286
|
+
return /* @__PURE__ */ c(b, { children: [
|
|
286
287
|
/* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center zd:items-center", children: [
|
|
287
288
|
/* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:gap-4", children: [
|
|
288
|
-
/* @__PURE__ */
|
|
289
|
-
/* @__PURE__ */ c(
|
|
289
|
+
/* @__PURE__ */ n(w, { className: "zd:text-h2 zd:text-center", children: "Enter verification code" }),
|
|
290
|
+
/* @__PURE__ */ c(w, { className: "zd:text-center", children: [
|
|
290
291
|
"Enter the code from the email we sent to",
|
|
291
292
|
" ",
|
|
292
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ n(w, { className: "zd:text-solarOrange", children: e })
|
|
293
294
|
] })
|
|
294
295
|
] }),
|
|
295
|
-
/* @__PURE__ */
|
|
296
|
-
|
|
296
|
+
/* @__PURE__ */ n(
|
|
297
|
+
de,
|
|
297
298
|
{
|
|
298
|
-
onComplete:
|
|
299
|
+
onComplete: x,
|
|
299
300
|
onChange: () => d(!1),
|
|
300
|
-
disabled:
|
|
301
|
-
error:
|
|
301
|
+
disabled: g,
|
|
302
|
+
error: p,
|
|
302
303
|
autoFocus: !0
|
|
303
304
|
}
|
|
304
305
|
),
|
|
305
|
-
/* @__PURE__ */
|
|
306
|
-
|
|
306
|
+
/* @__PURE__ */ n(
|
|
307
|
+
A,
|
|
307
308
|
{
|
|
308
309
|
text: "Confirm code",
|
|
309
|
-
onClick:
|
|
310
|
-
disabled: !
|
|
310
|
+
onClick: C,
|
|
311
|
+
disabled: !z.trim() || g
|
|
311
312
|
}
|
|
312
313
|
),
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ n("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ c(w, { className: "zd:text-center", children: [
|
|
314
315
|
"Did not get an email?",
|
|
315
316
|
" ",
|
|
316
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ n(
|
|
317
318
|
"button",
|
|
318
319
|
{
|
|
319
320
|
type: "button",
|
|
320
|
-
disabled: !
|
|
321
|
-
onClick:
|
|
321
|
+
disabled: !h,
|
|
322
|
+
onClick: m,
|
|
322
323
|
className: "zd:cursor-pointer zd:underline zd:disabled:opacity-50 zd:disabled:cursor-not-allowed",
|
|
323
|
-
children:
|
|
324
|
+
children: h ? "Resend" : `Resend in ${D} ${D === 1 ? "second" : "seconds"}`
|
|
324
325
|
}
|
|
325
326
|
)
|
|
326
327
|
] }) })
|
|
327
328
|
] }),
|
|
328
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ n(Z, { className: "zd:self-center zd:pt-4 zd:pb-6" })
|
|
329
330
|
] });
|
|
330
331
|
}
|
|
331
|
-
function
|
|
332
|
+
function ue({
|
|
332
333
|
termsAndConditionsUrl: e,
|
|
333
|
-
privacyPolicyUrl:
|
|
334
|
+
privacyPolicyUrl: t,
|
|
334
335
|
agreedToTerms: r,
|
|
335
|
-
setAgreedToTerms:
|
|
336
|
-
highlight:
|
|
336
|
+
setAgreedToTerms: i,
|
|
337
|
+
highlight: o = !1
|
|
337
338
|
}) {
|
|
338
339
|
return /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:items-center zd:gap-5", children: [
|
|
339
|
-
!!(e ||
|
|
340
|
+
!!(e || t) && /* @__PURE__ */ c(
|
|
340
341
|
"div",
|
|
341
342
|
{
|
|
342
|
-
className: `zd:flex zd:flex-row zd:items-center zd:gap-2 zd:rounded-md zd:p-2 zd:transition-colors ${
|
|
343
|
+
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"}`,
|
|
343
344
|
children: [
|
|
344
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ n(
|
|
345
346
|
"input",
|
|
346
347
|
{
|
|
347
348
|
type: "checkbox",
|
|
348
349
|
checked: r,
|
|
349
|
-
onChange: (
|
|
350
|
+
onChange: (s) => i(s.target.checked),
|
|
350
351
|
className: "zd:cursor-pointer zd:[color-scheme:light]"
|
|
351
352
|
}
|
|
352
353
|
),
|
|
353
|
-
/* @__PURE__ */ c(
|
|
354
|
+
/* @__PURE__ */ c(w, { className: "zd:flex-1", children: [
|
|
354
355
|
"I agree to the",
|
|
355
356
|
" ",
|
|
356
|
-
e && /* @__PURE__ */
|
|
357
|
-
|
|
357
|
+
e && /* @__PURE__ */ n(
|
|
358
|
+
w,
|
|
358
359
|
{
|
|
359
360
|
as: "a",
|
|
360
361
|
href: e,
|
|
@@ -364,12 +365,12 @@ function J2({
|
|
|
364
365
|
children: "Terms & Conditions"
|
|
365
366
|
}
|
|
366
367
|
),
|
|
367
|
-
e &&
|
|
368
|
-
|
|
369
|
-
|
|
368
|
+
e && t && " and ",
|
|
369
|
+
t && /* @__PURE__ */ n(
|
|
370
|
+
w,
|
|
370
371
|
{
|
|
371
372
|
as: "a",
|
|
372
|
-
href:
|
|
373
|
+
href: t,
|
|
373
374
|
target: "_blank",
|
|
374
375
|
rel: "noopener noreferrer",
|
|
375
376
|
className: "zd:underline",
|
|
@@ -380,17 +381,17 @@ function J2({
|
|
|
380
381
|
]
|
|
381
382
|
}
|
|
382
383
|
),
|
|
383
|
-
/* @__PURE__ */
|
|
384
|
+
/* @__PURE__ */ n(Z, {})
|
|
384
385
|
] });
|
|
385
386
|
}
|
|
386
|
-
const
|
|
387
|
-
function
|
|
388
|
-
return /* @__PURE__ */
|
|
387
|
+
const fe = "" + new URL("blob.webm", import.meta.url).href;
|
|
388
|
+
function pe({ className: e }) {
|
|
389
|
+
return /* @__PURE__ */ n(
|
|
389
390
|
"video",
|
|
390
391
|
{
|
|
391
392
|
className: e,
|
|
392
393
|
style: { aspectRatio: "1 / 1" },
|
|
393
|
-
src:
|
|
394
|
+
src: fe,
|
|
394
395
|
autoPlay: !0,
|
|
395
396
|
loop: !0,
|
|
396
397
|
muted: !0,
|
|
@@ -400,108 +401,17 @@ function Q2({ className: e }) {
|
|
|
400
401
|
}
|
|
401
402
|
);
|
|
402
403
|
}
|
|
403
|
-
const
|
|
404
|
-
function
|
|
405
|
-
const e = E2(o2);
|
|
406
|
-
if (!e)
|
|
407
|
-
throw new Error("SignUp.* components must be rendered inside <SignUp>");
|
|
408
|
-
return e;
|
|
409
|
-
}
|
|
410
|
-
function L(e) {
|
|
411
|
-
const { setAuthPending: n } = T();
|
|
412
|
-
U(() => (n(e), () => n(!1)), [e, n]);
|
|
413
|
-
}
|
|
414
|
-
const ee = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
415
|
-
function j(e) {
|
|
416
|
-
return ee.test(e.trim());
|
|
417
|
-
}
|
|
418
|
-
function d2() {
|
|
419
|
-
const { goToStep: e, setEmail: n, setOtpSession: r } = F(), {
|
|
420
|
-
authPending: a,
|
|
421
|
-
emailAuthMethod: i,
|
|
422
|
-
needsAgreement: s,
|
|
423
|
-
guardAgreement: l,
|
|
424
|
-
setError: o
|
|
425
|
-
} = T(), [p, m] = C(""), g = i === "otp", { mutateAsync: E, isPending: h } = l2(), { mutateAsync: d, isPending: f } = s2(), u = h || f;
|
|
426
|
-
L(u);
|
|
427
|
-
const z = async () => {
|
|
428
|
-
if (!(!p || a) && j(p) && l()) {
|
|
429
|
-
o(null);
|
|
430
|
-
try {
|
|
431
|
-
const w = g ? E : d, { otpId: y, otpEncryptionTargetBundle: b } = await w({
|
|
432
|
-
email: p
|
|
433
|
-
});
|
|
434
|
-
n(p), r({ otpId: y, otpEncryptionTargetBundle: b }), e(g ? "otp-input" : "email-verification");
|
|
435
|
-
} catch (w) {
|
|
436
|
-
o(
|
|
437
|
-
w instanceof Error ? w.message : "Failed to send verification code"
|
|
438
|
-
);
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
};
|
|
442
|
-
return /* @__PURE__ */ t(
|
|
443
|
-
f2,
|
|
444
|
-
{
|
|
445
|
-
iconName: "email",
|
|
446
|
-
placeholder: "Enter your email",
|
|
447
|
-
value: p,
|
|
448
|
-
onChange: (w) => m(w.target.value),
|
|
449
|
-
type: "email",
|
|
450
|
-
autoCapitalize: "none",
|
|
451
|
-
autoComplete: "email",
|
|
452
|
-
disabled: a,
|
|
453
|
-
variant: "listItemStyle",
|
|
454
|
-
onKeyDown: (w) => {
|
|
455
|
-
w.key === "Enter" && p && !a && z();
|
|
456
|
-
},
|
|
457
|
-
children: u ? /* @__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(
|
|
458
|
-
"button",
|
|
459
|
-
{
|
|
460
|
-
type: "button",
|
|
461
|
-
disabled: !j(p) || s,
|
|
462
|
-
className: `zd:w-13 zd:h-13 zd:rounded-2xl zd:flex zd:items-center zd:justify-center zd:transition-colors ${j(p) && !s ? "zd:cursor-pointer" : "zd:cursor-not-allowed zd:opacity-50"}`,
|
|
463
|
-
onClick: () => z(),
|
|
464
|
-
children: /* @__PURE__ */ t(Z, { name: "chevronRight", className: "zd:text-greyScale" })
|
|
465
|
-
}
|
|
466
|
-
)
|
|
467
|
-
}
|
|
468
|
-
);
|
|
469
|
-
}
|
|
470
|
-
function P(e) {
|
|
404
|
+
const me = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3crect%20width='24'%20height='24'%20fill='url(%23pattern0_19361_9946)'/%3e%3cdefs%3e%3cpattern%20id='pattern0_19361_9946'%20patternContentUnits='objectBoundingBox'%20width='1'%20height='1'%3e%3cuse%20xlink:href='%23image0_19361_9946'%20transform='scale(0.0136986)'/%3e%3c/pattern%3e%3cimage%20id='image0_19361_9946'%20width='73'%20height='73'%20preserveAspectRatio='none'%20xlink:href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEkAAABJCAYAAABxcwvcAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAgpSURBVHgB5Zx/bFNVFMfPbWc2NJD9BAckjmSDDs1WEwSNvzqVxGCCDP/ABJUZTUQJv4wGogkwEg38xQ9jookJW9QE/hhs+8N/AFeDkoAkPIyuA6aUBEgJYw4WZcDayzl3feV1e3197/a+0rWfpGn7+nr73rfnnHvuue8+Blmm7nG/nwMEIBZ7DIDVMAA/bcdtNcb9cHsYtw2BeHANPJ6LuFHr/1MLQpZh4DI1Nf7SokegBWL8dfw1P6pRCpkTBA/rKopCZ1+fFgaXcUWkJGHIatwlyDys/e5/0BkOa0PgAkpFEuI8HFuPzW5QZDG2GXNP3lnEPXtUW5cykWrnN2x9EOKMR4jFeFt/7x+toIiMRap9wh9gUb5vfOB90JBYGLdaz/+ltUGGSIskXGtKbMx6chjGoO3u/2xjJvFKSiSfz18zyvghiHffuQ5ZlZezJtlY5QGHkHuNevhpmCQCERQK8E89PdfnXwUSeJ3sPNfXsIpz6MSXJTD5KOEMlpVPnwGD167+4uSLtkWq9TVs5YzthkkPCzgVypZIwoLyQiAdZ0KlFYliUNzF8gwWqKysDl8fiJxJu6fVh9SLRRnvybUcSCFDOKRpwlxKs9rJsnfLc4GIUhxfHqKcz2qnlCLV1jfsynOBBHSORVP4Pqt9TN2N4hBEeQ8UEBxY898hzTT2mloSjcWgwGDA96Vyuwki1dU3rC8ENzMByzxgOg5NcrcC6M3SMTR6i80ZPxhOsqRRiK0qYIEIU2tKsqS6+sYL2RJp2rSpsPCpBbAIH9OmToVZs2aKbcTNm8Nwc3gYQn1nxePk76fEtiwxwZoSIuEsRguPuRuwSYTly5bCKy81waKFCxx998TJU3Cws1s8XIex1v5ebVvirf6itr6RuvwAuMTaNauh5e2VCWuR5fLlK9CBQn319TfgGjR11XvmyftvIVFEuwAuQBaz84vtwp1UQmJt+nyLsDBX8LImfY5PBO6o1x0LanlnJfzQ9p1ygQhqk9omC3WF2H1NRBWgvHLGLlAcsOngP/14PbgNWSq58LFfj4NqBgeuttOzcLfa+Y3/qpwKIoHW2fiHyVWO/Nwjni9fuZLoweik633zxMNukD94qFu4n0qwlyujXo7V+nCcxtSN0+bjiXUdPGC5D/VQezHwUlyxA7kWiU49oxVL31gBodBZUIU+nvOI+XmF9GJek6rnuYSiLF2+AjZ9tsW2QIQI0vidwOIlog0z6DdVCkSweAjyllU9+ia+eRoUcgKTP/Jjo5scOdoD732wxpE44xnGBLP9+x9h9syZUF8/L7GdBNrrQkrAGIsMXot0eSuqZmwCF7Jso1DkXhs+2Qy3b98BFVAc09t2SyAB/gjWwb9lGLRPo/O5Noe2+OUmOHzUndIUBXYatrgFTWqeD52Z42GSvRr1QJSnBA//BLMt8iC7AlEb1Fa69oxYCaS3142diGyWr49jGQ5HODhEF4j+SYLizIfrNkoHztnxxFBPOqm9t1reTxmknbZHYlJ7MoNkSgMcT3OPF4jQs19jMLXL+BMytmfXoozQcXV1HEhqj7bJtldSAqWORVr70eokgXSo3OFUKDOBdGSE0sUwcy/6THYI41gk6qlSma0ToawE0nEilJVAOjIdyMgIDHnExU4OSOffdoSyI5COHaHSCUTHSsd8REIkGpY4tiTCjlDdGBfMhhFOBNKxinl2BZIsqYjqpAe7Ng0ksNNj7Pxye5JQ+gnJlE7MhKK2rbp4XSDpXIqNeRkOS6qfkR2WDAxcFyWK5597NuWBUjKpD0XoJKuqKlO2txnHZ4cxm6bvmFFcXAyvLXkVjv12HF7A36Q/IRUZCyRgJwYHIvsxT/Lj7ADfBRlgJ27QQVsFVRKoI16/JpF2YDVTNglUIxAkat0eTCul3M2IneTPyiWMAhHUC8kmf6LSQCUTBcMVHtfGM1qCLxhkfCW9TJas/+MdJjMgMlnypfgxZFJpMPKQLlJYw/klBdZEOBHKjks4EUq1QDRjol+tG08BWBcowo5QTmKGHaGUCwTkaixxqaAQqUjx5X5WQskEVdqX4oxZe24IRDDvfU2ESHGzCoJCzITST0gmqFq1p1wgTLSN6+oMGbc6l9MxnlgmAlm1p1ogAicA9hjfJ6a5a/z+0qI7OIvr0iojSgFUXfRgvLDCDYo4m2NcYpG4RHkoEhkpr6iegrIFwAVU1bf1tlS2ZwSL/23nQlq7cVvy9UklsFtFzjSZ8cZgwjq5JJFEzhRL9sdCgqzIbCXThFIJWZPTGlM+IJZ7mVgRMUEksiZMpN6FQoOz1lTr4UzXlmB5IIwllDLVM7u5CrnZ+ZDWmurzlJXJaDFsKwS3s3IznZQiiSDuYc1539vhOaZbdmq5lGvwWiRSUVF9FYVaBvnIWFFtf7rd0q53w/iklVdWM7eSzAfGuCtsrbC1chKFCuaVUA4EImyvwc0boRwKRDhazU1CVVRWX8RwH4BJuaKbbewPaTvAIdI3T5hMC3XE/UswQe7vk7v3kiNL0hkYiAxNr6zu4oyVQc7fRIEFsfTRfK5Pk67jS1mSkTqfvwUY35pzVkX5HQ410L0yXqovZUlGKEUgq4oBu5ErQZ0qi9FbrPmffjW3NsvYkoyMxSrYxoFL3RMkI9BysOvtpCFGzt5kyogQi1Y8ZcMNya2wBjY6Arsnxe3KzKC7AcZi0MIYvIiTWUqCPFpMOAbQxXAqTLbHcvZ7WUTcmKoEe8OxPKtRTDownvqOgWJwzcJ4kFqMww3cEozegqBbFpOKrIqUDnJTeqZL8LIthBX3AMO5NwaXDfWSAAAAAElFTkSuQmCC'/%3e%3c/defs%3e%3c/svg%3e", t2 = me;
|
|
405
|
+
function R(e) {
|
|
471
406
|
return e instanceof Error ? e.name === "AbortError" || e.name === "NotAllowedError" || e.name === "UserRejectedRequestError" ? !0 : e.message.toLowerCase().includes("oauth popup was closed") : !1;
|
|
472
407
|
}
|
|
473
|
-
function
|
|
474
|
-
|
|
475
|
-
mutation: {
|
|
476
|
-
onSuccess: () => {
|
|
477
|
-
e("authenticated");
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
});
|
|
481
|
-
return L(s), /* @__PURE__ */ t(
|
|
482
|
-
M,
|
|
483
|
-
{
|
|
484
|
-
icon: /* @__PURE__ */ t(t2, { name: "google" }),
|
|
485
|
-
title: "Google",
|
|
486
|
-
trailing: /* @__PURE__ */ t(V, {}),
|
|
487
|
-
disabled: n,
|
|
488
|
-
onClick: async () => {
|
|
489
|
-
if (!n && r()) {
|
|
490
|
-
a(null);
|
|
491
|
-
try {
|
|
492
|
-
await i({ provider: "google" });
|
|
493
|
-
} catch (o) {
|
|
494
|
-
P(o) || a(o instanceof Error ? o.message : String(o));
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
);
|
|
408
|
+
function n2(e, t) {
|
|
409
|
+
return t.rdns && e.id === t.rdns ? !0 : !!t.rdns && e.type === "injected" && e.id !== "injected" && e.id !== "zerodev-wallet" && e.name === t.name;
|
|
500
410
|
}
|
|
501
|
-
function
|
|
502
|
-
return
|
|
411
|
+
function O(e, t) {
|
|
412
|
+
return n2(e, t) ? !0 : !!t.rdns && (Array.isArray(e.rdns) ? e.rdns.includes(t.rdns) : e.rdns === t.rdns);
|
|
503
413
|
}
|
|
504
|
-
const
|
|
414
|
+
const he = [
|
|
505
415
|
{
|
|
506
416
|
id: "metamask",
|
|
507
417
|
name: "MetaMask",
|
|
@@ -538,6 +448,7 @@ const te = [
|
|
|
538
448
|
name: "Rabby Wallet",
|
|
539
449
|
rdns: "io.rabby",
|
|
540
450
|
icon: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cg%20clip-path%3D%22url(%23a)%22%3E%3Cpath%20fill%3D%22%238697FF%22%20d%3D%22M28%200H0v28h28V0Z%22%2F%3E%3Cpath%20fill%3D%22url(%23b)%22%20d%3D%22M22.54%2015.078c.677-1.514-2.673-5.744-5.874-7.506-2.017-1.365-4.12-1.178-4.545-.579-.935%201.316%203.094%202.43%205.788%203.731-.58.252-1.125.703-1.446%201.28-1.004-1.096-3.209-2.04-5.796-1.28-1.743.513-3.191%201.721-3.751%203.546a1.097%201.097%200%201%200-.445%202.1c.112%200%20.463-.075.463-.075l5.612.041c-2.244%203.56-4.018%204.081-4.018%204.698s1.697.45%202.335.22c3.05-1.1%206.327-4.531%206.89-5.519%202.36.295%204.345.33%204.786-.657Z%22%2F%3E%3Cpath%20fill%3D%22url(%23c)%22%20fill-rule%3D%22evenodd%22%20d%3D%22m17.885%2010.713.025.01c.125-.049.105-.233.07-.378-.078-.333-1.438-1.676-2.715-2.277-1.743-.82-3.025-.777-3.212-.398.356.726%201.998%201.408%203.714%202.12.723.3%201.46.606%202.118.923Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3Cpath%20fill%3D%22url(%23d)%22%20fill-rule%3D%22evenodd%22%20d%3D%22M15.701%2018.036a10.296%2010.296%200%200%200-1.2-.37c.482-.862.583-2.138.128-2.945-.639-1.133-1.44-1.736-3.304-1.736-1.024%200-3.783.346-3.832%202.648-.005.242%200%20.464.017.667l5.036.037a17.264%2017.264%200%200%201-1.871%202.483c.669.172%201.221.316%201.728.448.48.125.92.24%201.38.357a21.003%2021.003%200%200%200%201.918-1.59Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3Cpath%20fill%3D%22url(%23e)%22%20d%3D%22M6.848%2016.063c.206%201.75%201.2%202.435%203.232%202.638%202.032.203%203.197.067%204.749.208%201.296.118%202.453.778%202.882.55.386-.205.17-.947-.347-1.423-.67-.617-1.597-1.046-3.229-1.199.325-.89.234-2.138-.27-2.817-.731-.982-2.079-1.426-3.785-1.232-1.782.202-3.49%201.08-3.232%203.275Z%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22b%22%20x1%3D%2210.464%22%20x2%3D%2222.394%22%20y1%3D%2213.737%22%20y2%3D%2217.12%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23fff%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23fff%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22c%22%20x1%3D%2220.386%22%20x2%3D%2211.779%22%20y1%3D%2213.509%22%20y2%3D%224.879%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%237258DC%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23797DEA%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22d%22%20x1%3D%2215.94%22%20x2%3D%227.673%22%20y1%3D%2218.337%22%20y2%3D%2213.584%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%237461EA%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23BFC2FF%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22e%22%20x1%3D%2211.177%22%20x2%3D%2216.765%22%20y1%3D%2213.648%22%20y2%3D%2220.749%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23fff%22%2F%3E%3Cstop%20offset%3D%22.984%22%20stop-color%3D%22%23D5CEFF%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22a%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",
|
|
451
|
+
mobileLink: "rabby://wc?uri=",
|
|
541
452
|
downloadUrl: "https://rabby.io"
|
|
542
453
|
},
|
|
543
454
|
{
|
|
@@ -579,54 +490,325 @@ const te = [
|
|
|
579
490
|
mobileLink: "bnc://app.binance.com/cedefi/wc?uri=",
|
|
580
491
|
downloadUrl: "https://www.binance.com/en/download"
|
|
581
492
|
}
|
|
582
|
-
], k =
|
|
583
|
-
function
|
|
493
|
+
], k = he;
|
|
494
|
+
function ge({
|
|
495
|
+
open: e,
|
|
496
|
+
onOpenChange: t,
|
|
497
|
+
wallet: r,
|
|
498
|
+
pairing: i
|
|
499
|
+
}) {
|
|
500
|
+
return /* @__PURE__ */ n(u2, { open: e, onOpenChange: t, children: /* @__PURE__ */ c(f2, { className: "zd:p-4", children: [
|
|
501
|
+
/* @__PURE__ */ n(p2, { children: r ? `Connect ${r.name}` : "WalletConnect" }),
|
|
502
|
+
/* @__PURE__ */ n(ze, { wallet: r, pairing: i })
|
|
503
|
+
] }) });
|
|
504
|
+
}
|
|
505
|
+
function ze({
|
|
506
|
+
wallet: e,
|
|
507
|
+
pairing: t
|
|
508
|
+
}) {
|
|
509
|
+
const { goToStep: r } = S(), { uri: i, error: o, retry: a } = t, s = H(), { connect: l } = V(), u = e ? s.find((h) => O(h, e)) : void 0, [g, z] = E(
|
|
510
|
+
u ? "browser" : "mobile"
|
|
511
|
+
), [F, p] = E(null), [d, D] = E(!1), f = i && (e != null && e.mobileLink) ? `${e.mobileLink}${encodeURIComponent(i)}` : i, C = async () => {
|
|
512
|
+
if (i)
|
|
513
|
+
try {
|
|
514
|
+
await navigator.clipboard.writeText(i), D(!0), setTimeout(() => D(!1), 2e3);
|
|
515
|
+
} catch {
|
|
516
|
+
}
|
|
517
|
+
}, x = () => {
|
|
518
|
+
u && (p(null), l(
|
|
519
|
+
{ connector: u },
|
|
520
|
+
{
|
|
521
|
+
onSuccess: () => r(null),
|
|
522
|
+
onError: (h) => {
|
|
523
|
+
R(h) || p(h instanceof Error ? h.message : String(h));
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
));
|
|
527
|
+
}, m = o ?? F;
|
|
528
|
+
return /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:items-center zd:gap-3", children: [
|
|
529
|
+
/* @__PURE__ */ c("div", { className: "zd:flex zd:w-full zd:items-center zd:gap-2", children: [
|
|
530
|
+
/* @__PURE__ */ n(
|
|
531
|
+
"img",
|
|
532
|
+
{
|
|
533
|
+
src: e ? e.icon : t2,
|
|
534
|
+
alt: "",
|
|
535
|
+
className: "zd:w-8 zd:h-8 zd:rounded-xl"
|
|
536
|
+
}
|
|
537
|
+
),
|
|
538
|
+
/* @__PURE__ */ n(w, { className: "zd:text-h3 zd:flex-1", children: e ? e.name : "WalletConnect" }),
|
|
539
|
+
/* @__PURE__ */ n(m2, { asChild: !0, children: /* @__PURE__ */ n(
|
|
540
|
+
"button",
|
|
541
|
+
{
|
|
542
|
+
type: "button",
|
|
543
|
+
"aria-label": "Close",
|
|
544
|
+
className: "zd:cursor-pointer zd:px-2 zd:text-greyScale/60",
|
|
545
|
+
children: "✕"
|
|
546
|
+
}
|
|
547
|
+
) })
|
|
548
|
+
] }),
|
|
549
|
+
e && /* @__PURE__ */ n("div", { className: "zd:flex zd:w-full zd:gap-2", children: ["mobile", "browser"].map((h) => /* @__PURE__ */ n(
|
|
550
|
+
"button",
|
|
551
|
+
{
|
|
552
|
+
type: "button",
|
|
553
|
+
onClick: () => z(h),
|
|
554
|
+
className: `zd:flex-1 zd:rounded-2xl zd:py-1.5 zd:text-body3 zd:cursor-pointer ${g === h ? "zd:bg-greyScale/10 zd:font-semibold" : "zd:text-greyScale/60"}`,
|
|
555
|
+
children: h === "mobile" ? "Mobile" : "Browser"
|
|
556
|
+
},
|
|
557
|
+
h
|
|
558
|
+
)) }),
|
|
559
|
+
!e || g === "mobile" ? m ? /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:gap-2 zd:items-center", children: [
|
|
560
|
+
/* @__PURE__ */ n(w, { className: "zd:text-center zd:text-red-500", children: m }),
|
|
561
|
+
/* @__PURE__ */ n(A, { action: "secondary", text: "Try again", onClick: a })
|
|
562
|
+
] }) : /* @__PURE__ */ c(b, { children: [
|
|
563
|
+
/* @__PURE__ */ n("div", { className: "zd:bg-white zd:rounded-2xl zd:p-2 zd:border zd:border-greyScale/10", children: f ? /* @__PURE__ */ n(N2, { value: f, size: 176 }) : /* @__PURE__ */ n("div", { className: "zd:w-[176px] zd:h-[176px] zd:flex zd:items-center zd:justify-center", children: /* @__PURE__ */ n("div", { className: "zd:w-8 zd:h-8 zd:border-2 zd:border-solarOrange zd:border-t-transparent zd:rounded-full zd:animate-spin" }) }) }),
|
|
564
|
+
f && (e == null ? void 0 : e.mobileLink) && /* @__PURE__ */ c(
|
|
565
|
+
"a",
|
|
566
|
+
{
|
|
567
|
+
href: f,
|
|
568
|
+
className: "zd:w-full zd:rounded-2xl zd:bg-greyScale/10 zd:py-2 zd:text-center zd:text-body2 zd:font-semibold",
|
|
569
|
+
children: [
|
|
570
|
+
"Open in ",
|
|
571
|
+
e.name
|
|
572
|
+
]
|
|
573
|
+
}
|
|
574
|
+
),
|
|
575
|
+
/* @__PURE__ */ n(
|
|
576
|
+
A,
|
|
577
|
+
{
|
|
578
|
+
action: "secondary",
|
|
579
|
+
text: d ? "Copied" : "Copy link",
|
|
580
|
+
onClick: C,
|
|
581
|
+
disabled: !f
|
|
582
|
+
}
|
|
583
|
+
)
|
|
584
|
+
] }) : m ? /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:gap-2 zd:items-center", children: [
|
|
585
|
+
/* @__PURE__ */ n(w, { className: "zd:text-center zd:text-red-500", children: m }),
|
|
586
|
+
/* @__PURE__ */ n(
|
|
587
|
+
A,
|
|
588
|
+
{
|
|
589
|
+
action: "secondary",
|
|
590
|
+
text: "Try again",
|
|
591
|
+
onClick: u ? x : a
|
|
592
|
+
}
|
|
593
|
+
)
|
|
594
|
+
] }) : u && e ? /* @__PURE__ */ c(
|
|
595
|
+
"button",
|
|
596
|
+
{
|
|
597
|
+
type: "button",
|
|
598
|
+
onClick: x,
|
|
599
|
+
className: "zd:w-full zd:cursor-pointer zd:rounded-2xl zd:bg-greyScale/10 zd:py-2 zd:text-center zd:text-body2 zd:font-semibold",
|
|
600
|
+
children: [
|
|
601
|
+
"Open in ",
|
|
602
|
+
e.name
|
|
603
|
+
]
|
|
604
|
+
}
|
|
605
|
+
) : e && /* @__PURE__ */ c(
|
|
606
|
+
"a",
|
|
607
|
+
{
|
|
608
|
+
href: e.downloadUrl,
|
|
609
|
+
target: "_blank",
|
|
610
|
+
rel: "noopener noreferrer",
|
|
611
|
+
className: "zd:w-full zd:rounded-2xl zd:bg-greyScale/10 zd:py-2 zd:text-center zd:text-body2 zd:font-semibold",
|
|
612
|
+
children: [
|
|
613
|
+
"Get ",
|
|
614
|
+
e.name
|
|
615
|
+
]
|
|
616
|
+
}
|
|
617
|
+
)
|
|
618
|
+
] });
|
|
619
|
+
}
|
|
620
|
+
function x2() {
|
|
621
|
+
var e, t;
|
|
622
|
+
return typeof window > "u" ? !1 : ((t = (e = window.matchMedia) == null ? void 0 : e.call(window, "(pointer: coarse)")) == null ? void 0 : t.matches) || /Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(
|
|
623
|
+
navigator.userAgent
|
|
624
|
+
);
|
|
625
|
+
}
|
|
626
|
+
function J(e) {
|
|
627
|
+
return e.type === "walletConnect" && "zdWalletConnect" in e;
|
|
628
|
+
}
|
|
629
|
+
function De(e) {
|
|
630
|
+
const { wallet: t, connectors: r, uri: i, mobile: o } = e;
|
|
631
|
+
return !t.mobileLink || !o || !i || r.some((a) => O(a, t)) ? null : `${t.mobileLink}${encodeURIComponent(i)}`;
|
|
632
|
+
}
|
|
633
|
+
function Ce() {
|
|
634
|
+
const { goToStep: e } = S(), t = H(), r = t.find(J), { connect: i } = V(), a = R2().some(
|
|
635
|
+
(d) => d.connector.uid === (r == null ? void 0 : r.uid)
|
|
636
|
+
), { isReconnecting: s } = D2(), [l, u] = E(null), [g, z] = E(null), F = e2(!1), p = (d) => {
|
|
637
|
+
z(null), u(null), i({ connector: d }, { onError: (D) => z(D.message) });
|
|
638
|
+
};
|
|
639
|
+
return N(() => {
|
|
640
|
+
if (!r || a) return;
|
|
641
|
+
const d = ({ type: m, data: h }) => {
|
|
642
|
+
m === "display_uri" && typeof h == "string" && u(h);
|
|
643
|
+
};
|
|
644
|
+
r.emitter.on("message", d);
|
|
645
|
+
const D = () => z("Proposal expired"), f = () => e(null);
|
|
646
|
+
let C, x = !1;
|
|
647
|
+
return r.getProvider().then((m) => {
|
|
648
|
+
var h, v, y;
|
|
649
|
+
x || (C = m, (y = (v = (h = C.signer) == null ? void 0 : h.client) == null ? void 0 : v.events) == null || y.on("proposal_expire", D), C.on("connect", f));
|
|
650
|
+
}).catch((m) => {
|
|
651
|
+
x || z(m instanceof Error ? m.message : String(m));
|
|
652
|
+
}), !F.current && !s && (F.current = !0, p(r)), () => {
|
|
653
|
+
var m, h, v;
|
|
654
|
+
x = !0, (v = (h = (m = C == null ? void 0 : C.signer) == null ? void 0 : m.client) == null ? void 0 : h.events) == null || v.off("proposal_expire", D), C == null || C.off("connect", f), r.emitter.off("message", d);
|
|
655
|
+
};
|
|
656
|
+
}, [r, a, s]), {
|
|
657
|
+
uri: l,
|
|
658
|
+
error: g,
|
|
659
|
+
retry: () => {
|
|
660
|
+
r && p(r);
|
|
661
|
+
},
|
|
662
|
+
deepLinkFor: (d) => De({
|
|
663
|
+
wallet: d,
|
|
664
|
+
connectors: t,
|
|
665
|
+
uri: g ? null : l,
|
|
666
|
+
mobile: x2()
|
|
667
|
+
})
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
const E2 = I2(null);
|
|
671
|
+
function U() {
|
|
672
|
+
const e = T2(E2);
|
|
673
|
+
if (!e)
|
|
674
|
+
throw new Error("SignUp.* components must be rendered inside <SignUp>");
|
|
675
|
+
return e;
|
|
676
|
+
}
|
|
677
|
+
function P(e) {
|
|
678
|
+
const { setAuthPending: t } = U();
|
|
679
|
+
N(() => (t(e), () => t(!1)), [e, t]);
|
|
680
|
+
}
|
|
681
|
+
const we = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
682
|
+
function Y(e) {
|
|
683
|
+
return we.test(e.trim());
|
|
684
|
+
}
|
|
685
|
+
function F2() {
|
|
686
|
+
const { goToStep: e, setEmail: t, setOtpSession: r } = S(), {
|
|
687
|
+
authPending: i,
|
|
688
|
+
emailAuthMethod: o,
|
|
689
|
+
needsAgreement: a,
|
|
690
|
+
guardAgreement: s,
|
|
691
|
+
setError: l
|
|
692
|
+
} = U(), [u, g] = E(""), z = o === "otp", { mutateAsync: F, isPending: p } = w2(), { mutateAsync: d, isPending: D } = C2(), f = p || D;
|
|
693
|
+
P(f);
|
|
694
|
+
const C = async () => {
|
|
695
|
+
if (!(!u || i) && Y(u) && s()) {
|
|
696
|
+
l(null);
|
|
697
|
+
try {
|
|
698
|
+
const x = z ? F : d, { otpId: m, otpEncryptionTargetBundle: h } = await x({
|
|
699
|
+
email: u
|
|
700
|
+
});
|
|
701
|
+
t(u), r({ otpId: m, otpEncryptionTargetBundle: h }), e(z ? "otp-input" : "email-verification");
|
|
702
|
+
} catch (x) {
|
|
703
|
+
l(
|
|
704
|
+
x instanceof Error ? x.message : "Failed to send verification code"
|
|
705
|
+
);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
return /* @__PURE__ */ n(
|
|
710
|
+
U2,
|
|
711
|
+
{
|
|
712
|
+
iconName: "email",
|
|
713
|
+
placeholder: "Enter your email",
|
|
714
|
+
value: u,
|
|
715
|
+
onChange: (x) => g(x.target.value),
|
|
716
|
+
type: "email",
|
|
717
|
+
autoCapitalize: "none",
|
|
718
|
+
autoComplete: "email",
|
|
719
|
+
disabled: i,
|
|
720
|
+
variant: "listItemStyle",
|
|
721
|
+
onKeyDown: (x) => {
|
|
722
|
+
x.key === "Enter" && u && !i && C();
|
|
723
|
+
},
|
|
724
|
+
children: f ? /* @__PURE__ */ n("div", { className: "zd:w-13 zd:h-13 zd:flex zd:items-center zd:justify-center", children: /* @__PURE__ */ n("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__ */ n(
|
|
725
|
+
"button",
|
|
726
|
+
{
|
|
727
|
+
type: "button",
|
|
728
|
+
disabled: !Y(u) || a,
|
|
729
|
+
className: `zd:w-13 zd:h-13 zd:rounded-2xl zd:flex zd:items-center zd:justify-center zd:transition-colors ${Y(u) && !a ? "zd:cursor-pointer" : "zd:cursor-not-allowed zd:opacity-50"}`,
|
|
730
|
+
onClick: () => C(),
|
|
731
|
+
children: /* @__PURE__ */ n(K, { name: "chevronRight", className: "zd:text-greyScale" })
|
|
732
|
+
}
|
|
733
|
+
)
|
|
734
|
+
}
|
|
735
|
+
);
|
|
736
|
+
}
|
|
737
|
+
function y2() {
|
|
738
|
+
const { goToStep: e } = S(), { authPending: t, guardAgreement: r, setError: i } = U(), { mutateAsync: o, isPending: a } = W2({
|
|
739
|
+
mutation: {
|
|
740
|
+
onSuccess: () => {
|
|
741
|
+
e("authenticated");
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
});
|
|
745
|
+
return P(a), /* @__PURE__ */ n(
|
|
746
|
+
T,
|
|
747
|
+
{
|
|
748
|
+
icon: /* @__PURE__ */ n(h2, { name: "google" }),
|
|
749
|
+
title: "Google",
|
|
750
|
+
trailing: /* @__PURE__ */ n(G, {}),
|
|
751
|
+
disabled: t,
|
|
752
|
+
onClick: async () => {
|
|
753
|
+
if (!t && r()) {
|
|
754
|
+
i(null);
|
|
755
|
+
try {
|
|
756
|
+
await o({ provider: "google" });
|
|
757
|
+
} catch (l) {
|
|
758
|
+
R(l) || i(l instanceof Error ? l.message : String(l));
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
);
|
|
764
|
+
}
|
|
765
|
+
function xe({
|
|
584
766
|
excludeWalletIds: e = [],
|
|
585
|
-
maxWallets:
|
|
767
|
+
maxWallets: t = 4
|
|
586
768
|
}) {
|
|
587
|
-
const { goToStep: r } =
|
|
588
|
-
|
|
589
|
-
const
|
|
590
|
-
(
|
|
591
|
-
).map((
|
|
592
|
-
const d = k.find((
|
|
769
|
+
const { goToStep: r } = S(), { authPending: i, guardAgreement: o, setError: a, registeredWallets: s } = U(), l = H(), { connect: u, isPending: g } = V();
|
|
770
|
+
P(g);
|
|
771
|
+
const z = l.filter(
|
|
772
|
+
(p) => p.type === "injected" && p.id !== "injected" && p.id !== "zerodev-wallet"
|
|
773
|
+
).map((p) => {
|
|
774
|
+
const d = k.find((D) => O(p, D));
|
|
593
775
|
return {
|
|
594
|
-
connector:
|
|
776
|
+
connector: p,
|
|
595
777
|
walletId: d == null ? void 0 : d.id,
|
|
596
|
-
name: (d == null ? void 0 : d.name) ??
|
|
597
|
-
icon: (d == null ? void 0 : d.icon) ??
|
|
598
|
-
ids: d ? [d.id,
|
|
778
|
+
name: (d == null ? void 0 : d.name) ?? p.name,
|
|
779
|
+
icon: (d == null ? void 0 : d.icon) ?? p.icon,
|
|
780
|
+
ids: d ? [d.id, p.id] : [p.id],
|
|
599
781
|
rank: d ? k.indexOf(d) : k.length
|
|
600
782
|
};
|
|
601
783
|
}).filter(
|
|
602
|
-
(
|
|
603
|
-
).filter((
|
|
604
|
-
|
|
605
|
-
{ connector:
|
|
784
|
+
(p) => !(p.walletId && s.includes(p.walletId))
|
|
785
|
+
).filter((p) => !p.ids.some((d) => e.includes(d))).sort((p, d) => p.rank - d.rank).slice(0, t), F = (p) => {
|
|
786
|
+
i || o() && (a(null), u(
|
|
787
|
+
{ connector: p },
|
|
606
788
|
{
|
|
607
789
|
// The external wallet is now the active wagmi connection — the
|
|
608
790
|
// embedded-wallet flow is done, so close it (mirrors SignUp.Wallet).
|
|
609
791
|
onSuccess: () => r(null),
|
|
610
792
|
onError: (d) => {
|
|
611
|
-
|
|
793
|
+
R(d) || a(d instanceof Error ? d.message : String(d));
|
|
612
794
|
}
|
|
613
795
|
}
|
|
614
796
|
));
|
|
615
797
|
};
|
|
616
|
-
return /* @__PURE__ */
|
|
617
|
-
|
|
798
|
+
return /* @__PURE__ */ n(b, { children: z.map(({ connector: p, name: d, icon: D }) => /* @__PURE__ */ n(
|
|
799
|
+
T,
|
|
618
800
|
{
|
|
619
801
|
title: d,
|
|
620
|
-
icon:
|
|
621
|
-
subtitle: /* @__PURE__ */
|
|
622
|
-
trailing: /* @__PURE__ */
|
|
623
|
-
disabled:
|
|
624
|
-
onClick: () =>
|
|
802
|
+
icon: D ? /* @__PURE__ */ n("img", { src: D, alt: "", className: "zd:w-6 zd:h-6" }) : null,
|
|
803
|
+
subtitle: /* @__PURE__ */ n(X, { text: "INSTALLED" }),
|
|
804
|
+
trailing: /* @__PURE__ */ n(G, {}),
|
|
805
|
+
disabled: i,
|
|
806
|
+
onClick: () => F(p)
|
|
625
807
|
},
|
|
626
|
-
|
|
808
|
+
p.uid
|
|
627
809
|
)) });
|
|
628
810
|
}
|
|
629
|
-
function
|
|
811
|
+
function Ee({ tile: e }) {
|
|
630
812
|
return /* @__PURE__ */ c(
|
|
631
813
|
"button",
|
|
632
814
|
{
|
|
@@ -634,28 +816,28 @@ function ie({ tile: e }) {
|
|
|
634
816
|
onClick: e.onSelect,
|
|
635
817
|
className: "zd:flex zd:flex-col zd:items-center zd:gap-1.5 zd:cursor-pointer",
|
|
636
818
|
children: [
|
|
637
|
-
/* @__PURE__ */
|
|
638
|
-
|
|
819
|
+
/* @__PURE__ */ n("div", { className: "zd:w-16 zd:h-16 zd:rounded-2xl zd:bg-greyScale/5 zd:flex zd:items-center zd:justify-center", children: e.icon ? /* @__PURE__ */ n("img", { src: e.icon, alt: "", className: "zd:w-8 zd:h-8" }) : /* @__PURE__ */ n(
|
|
820
|
+
K,
|
|
639
821
|
{
|
|
640
822
|
name: "walletOutline",
|
|
641
823
|
className: "zd:w-8 zd:h-8 zd:text-greyScale"
|
|
642
824
|
}
|
|
643
825
|
) }),
|
|
644
|
-
/* @__PURE__ */
|
|
826
|
+
/* @__PURE__ */ n(w, { className: "zd:text-body3 zd:max-w-full zd:truncate", children: e.name })
|
|
645
827
|
]
|
|
646
828
|
}
|
|
647
829
|
);
|
|
648
830
|
}
|
|
649
|
-
function
|
|
831
|
+
function Fe({
|
|
650
832
|
open: e,
|
|
651
|
-
onOpenChange:
|
|
833
|
+
onOpenChange: t,
|
|
652
834
|
tiles: r
|
|
653
835
|
}) {
|
|
654
|
-
return /* @__PURE__ */
|
|
655
|
-
/* @__PURE__ */
|
|
836
|
+
return /* @__PURE__ */ n(u2, { open: e, onOpenChange: t, children: /* @__PURE__ */ c(f2, { className: "zd:p-4", children: [
|
|
837
|
+
/* @__PURE__ */ n(p2, { children: "All wallets" }),
|
|
656
838
|
/* @__PURE__ */ c("div", { className: "zd:mb-3 zd:flex zd:items-center zd:gap-2", children: [
|
|
657
|
-
/* @__PURE__ */
|
|
658
|
-
/* @__PURE__ */
|
|
839
|
+
/* @__PURE__ */ n(w, { className: "zd:text-h3 zd:flex-1", children: "All wallets" }),
|
|
840
|
+
/* @__PURE__ */ n(m2, { asChild: !0, children: /* @__PURE__ */ n(
|
|
659
841
|
"button",
|
|
660
842
|
{
|
|
661
843
|
type: "button",
|
|
@@ -665,398 +847,527 @@ function ae({
|
|
|
665
847
|
}
|
|
666
848
|
) })
|
|
667
849
|
] }),
|
|
668
|
-
/* @__PURE__ */
|
|
850
|
+
/* @__PURE__ */ n("div", { className: "zd:grid zd:grid-cols-3 zd:gap-3 zd:max-h-80 zd:overflow-y-auto", children: r.map((i) => /* @__PURE__ */ n(Ee, { tile: i }, i.key)) })
|
|
669
851
|
] }) });
|
|
670
852
|
}
|
|
671
|
-
function
|
|
853
|
+
function ye({
|
|
672
854
|
title: e = "More wallets"
|
|
673
855
|
}) {
|
|
674
|
-
const { goToStep:
|
|
675
|
-
|
|
676
|
-
const
|
|
677
|
-
(
|
|
678
|
-
),
|
|
679
|
-
r ||
|
|
680
|
-
{ connector:
|
|
856
|
+
const { goToStep: t } = S(), { authPending: r, guardAgreement: i, setError: o, openWalletSheet: a } = U(), [s, l] = E(!1), u = H(), { connect: g, isPending: z } = V();
|
|
857
|
+
P(z);
|
|
858
|
+
const F = u.filter(
|
|
859
|
+
(m) => m.id !== "zerodev-wallet" && m.type !== "walletConnect"
|
|
860
|
+
), p = (m) => {
|
|
861
|
+
r || i() && (l(!1), o(null), g(
|
|
862
|
+
{ connector: m },
|
|
681
863
|
{
|
|
682
864
|
// The external wallet is now the active wagmi connection — the
|
|
683
865
|
// embedded-wallet flow is done, so close it.
|
|
684
|
-
onSuccess: () =>
|
|
685
|
-
onError: (
|
|
686
|
-
|
|
866
|
+
onSuccess: () => t(null),
|
|
867
|
+
onError: (h) => {
|
|
868
|
+
R(h) || o(h instanceof Error ? h.message : String(h));
|
|
687
869
|
}
|
|
688
870
|
}
|
|
689
871
|
));
|
|
690
|
-
},
|
|
691
|
-
const
|
|
872
|
+
}, d = u.some(J), D = k.map((m) => {
|
|
873
|
+
const h = F.find((v) => n2(v, m));
|
|
692
874
|
return {
|
|
693
|
-
key:
|
|
694
|
-
name:
|
|
695
|
-
icon:
|
|
875
|
+
key: m.id,
|
|
876
|
+
name: m.name,
|
|
877
|
+
icon: m.icon,
|
|
696
878
|
onSelect: () => {
|
|
697
|
-
if (
|
|
698
|
-
|
|
879
|
+
if (h) {
|
|
880
|
+
p(h);
|
|
881
|
+
return;
|
|
882
|
+
}
|
|
883
|
+
if (d) {
|
|
884
|
+
if (r || !i()) return;
|
|
885
|
+
l(!1), a(m);
|
|
699
886
|
return;
|
|
700
887
|
}
|
|
701
|
-
|
|
888
|
+
const v = F.find((y) => O(y, m));
|
|
889
|
+
if (v) {
|
|
890
|
+
p(v);
|
|
891
|
+
return;
|
|
892
|
+
}
|
|
893
|
+
l(!1), window.open(m.downloadUrl, "_blank", "noopener,noreferrer");
|
|
702
894
|
}
|
|
703
895
|
};
|
|
704
|
-
}),
|
|
705
|
-
key:
|
|
706
|
-
name:
|
|
707
|
-
icon:
|
|
708
|
-
onSelect: () =>
|
|
896
|
+
}), f = F.filter((m) => !k.some((h) => O(m, h))).map((m) => ({
|
|
897
|
+
key: m.uid,
|
|
898
|
+
name: m.name,
|
|
899
|
+
icon: m.icon,
|
|
900
|
+
onSelect: () => p(m)
|
|
709
901
|
}));
|
|
710
|
-
return /* @__PURE__ */ c(
|
|
711
|
-
/* @__PURE__ */
|
|
712
|
-
|
|
902
|
+
return /* @__PURE__ */ c(b, { children: [
|
|
903
|
+
/* @__PURE__ */ n(
|
|
904
|
+
T,
|
|
713
905
|
{
|
|
714
|
-
icon: /* @__PURE__ */
|
|
906
|
+
icon: /* @__PURE__ */ n(h2, { name: "walletOutline", className: "zd:w-5 zd:h-5" }),
|
|
715
907
|
title: e,
|
|
716
|
-
trailing: /* @__PURE__ */
|
|
908
|
+
trailing: /* @__PURE__ */ n(G, {}),
|
|
717
909
|
disabled: r,
|
|
718
910
|
onClick: () => {
|
|
719
|
-
r ||
|
|
911
|
+
r || i() && l(!0);
|
|
720
912
|
}
|
|
721
913
|
}
|
|
722
914
|
),
|
|
723
|
-
/* @__PURE__ */
|
|
724
|
-
|
|
915
|
+
/* @__PURE__ */ n(
|
|
916
|
+
Fe,
|
|
725
917
|
{
|
|
726
918
|
open: s,
|
|
727
919
|
onOpenChange: l,
|
|
728
|
-
tiles: [...
|
|
920
|
+
tiles: [...d ? [
|
|
921
|
+
{
|
|
922
|
+
key: "walletconnect",
|
|
923
|
+
name: "WalletConnect",
|
|
924
|
+
icon: t2,
|
|
925
|
+
onSelect: () => {
|
|
926
|
+
r || i() && (l(!1), a());
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
] : [], ...D, ...f]
|
|
729
930
|
}
|
|
730
931
|
)
|
|
731
932
|
] });
|
|
732
933
|
}
|
|
733
|
-
function
|
|
734
|
-
const { goToStep: e } =
|
|
934
|
+
function v2() {
|
|
935
|
+
const { goToStep: e } = S(), { authPending: t, guardAgreement: r, setError: i } = U(), o = {
|
|
735
936
|
onSuccess: () => {
|
|
736
937
|
e("authenticated");
|
|
737
938
|
},
|
|
738
|
-
onError: (
|
|
739
|
-
|
|
939
|
+
onError: (z) => {
|
|
940
|
+
R(z) || i(z instanceof Error ? z.message : String(z));
|
|
740
941
|
}
|
|
741
|
-
}, { mutate:
|
|
742
|
-
mutation:
|
|
942
|
+
}, { mutate: a, isPending: s } = _2({ mutation: o }), { mutate: l, isPending: u } = Z2({
|
|
943
|
+
mutation: o
|
|
743
944
|
});
|
|
744
|
-
|
|
745
|
-
const
|
|
746
|
-
|
|
945
|
+
P(s || u);
|
|
946
|
+
const g = (z) => () => {
|
|
947
|
+
t || r() && (i(null), z());
|
|
747
948
|
};
|
|
748
|
-
return /* @__PURE__ */ c(
|
|
749
|
-
/* @__PURE__ */
|
|
750
|
-
|
|
949
|
+
return /* @__PURE__ */ c(b, { children: [
|
|
950
|
+
/* @__PURE__ */ n(
|
|
951
|
+
A,
|
|
751
952
|
{
|
|
752
953
|
action: "secondary",
|
|
753
954
|
text: "Create a passkey",
|
|
754
955
|
iconName: "key",
|
|
755
956
|
trailIcon: !0,
|
|
756
|
-
disabled:
|
|
757
|
-
onClick:
|
|
957
|
+
disabled: t,
|
|
958
|
+
onClick: g(() => a())
|
|
758
959
|
}
|
|
759
960
|
),
|
|
760
|
-
/* @__PURE__ */
|
|
761
|
-
|
|
961
|
+
/* @__PURE__ */ n(
|
|
962
|
+
A,
|
|
762
963
|
{
|
|
763
964
|
action: "secondary",
|
|
764
965
|
text: "Log in with passkey",
|
|
765
966
|
iconName: "key",
|
|
766
967
|
trailIcon: !0,
|
|
767
|
-
disabled:
|
|
768
|
-
onClick:
|
|
968
|
+
disabled: t,
|
|
969
|
+
onClick: g(() => l())
|
|
769
970
|
}
|
|
770
971
|
)
|
|
771
972
|
] });
|
|
772
973
|
}
|
|
773
|
-
function
|
|
774
|
-
const
|
|
775
|
-
if (!
|
|
974
|
+
function ve({ walletId: e }) {
|
|
975
|
+
const t = k.find((f) => f.id === e);
|
|
976
|
+
if (!t)
|
|
776
977
|
throw new Error(
|
|
777
978
|
`Unknown walletId "${e}". Valid ids: ${k.map((f) => f.id).join(", ")}`
|
|
778
979
|
);
|
|
779
|
-
const { goToStep: r } =
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
980
|
+
const { goToStep: r } = S(), {
|
|
981
|
+
authPending: i,
|
|
982
|
+
guardAgreement: o,
|
|
983
|
+
setError: a,
|
|
984
|
+
registerWallet: s,
|
|
985
|
+
openWalletSheet: l
|
|
986
|
+
} = U(), u = H(), { connect: g, isPending: z } = V();
|
|
987
|
+
P(z), L2(() => s(t.id), [s, t.id]);
|
|
988
|
+
const F = u.find((f) => n2(f, t)), p = {
|
|
989
|
+
title: t.name,
|
|
990
|
+
icon: /* @__PURE__ */ n("img", { src: t.icon, alt: "", className: "zd:w-6 zd:h-6" }),
|
|
991
|
+
trailing: /* @__PURE__ */ n(G, {})
|
|
785
992
|
};
|
|
786
|
-
|
|
787
|
-
|
|
993
|
+
if (!F && u.some(J))
|
|
994
|
+
return /* @__PURE__ */ n(
|
|
995
|
+
T,
|
|
996
|
+
{
|
|
997
|
+
...p,
|
|
998
|
+
disabled: i,
|
|
999
|
+
onClick: () => {
|
|
1000
|
+
i || o() && l(t);
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
);
|
|
1004
|
+
const d = F ?? u.find((f) => O(f, t));
|
|
1005
|
+
return d ? /* @__PURE__ */ n(
|
|
1006
|
+
T,
|
|
788
1007
|
{
|
|
789
|
-
...
|
|
790
|
-
|
|
791
|
-
disabled:
|
|
1008
|
+
...p,
|
|
1009
|
+
...!!F && { subtitle: /* @__PURE__ */ n(X, { text: "INSTALLED" }) },
|
|
1010
|
+
disabled: i,
|
|
792
1011
|
onClick: () => {
|
|
793
|
-
|
|
794
|
-
{ connector:
|
|
1012
|
+
i || o() && (a(null), g(
|
|
1013
|
+
{ connector: d },
|
|
795
1014
|
{
|
|
796
1015
|
// The external wallet is now the active wagmi connection — the
|
|
797
1016
|
// embedded-wallet flow is done, so close it (mirrors SignUp.MoreWallets).
|
|
798
1017
|
onSuccess: () => r(null),
|
|
799
1018
|
onError: (f) => {
|
|
800
|
-
|
|
1019
|
+
R(f) || a(f instanceof Error ? f.message : String(f));
|
|
801
1020
|
}
|
|
802
1021
|
}
|
|
803
1022
|
));
|
|
804
1023
|
}
|
|
805
1024
|
}
|
|
806
|
-
) : /* @__PURE__ */
|
|
1025
|
+
) : /* @__PURE__ */ n(T, { ...p, asChild: !0, children: /* @__PURE__ */ n(
|
|
807
1026
|
"a",
|
|
808
1027
|
{
|
|
809
|
-
href:
|
|
1028
|
+
href: t.downloadUrl,
|
|
810
1029
|
target: "_blank",
|
|
811
1030
|
rel: "noopener noreferrer"
|
|
812
1031
|
}
|
|
813
1032
|
) });
|
|
814
1033
|
}
|
|
815
|
-
function
|
|
1034
|
+
function Se() {
|
|
1035
|
+
const { authPending: e, guardAgreement: t, openWalletSheet: r } = U();
|
|
1036
|
+
return H().some(J) ? /* @__PURE__ */ n(
|
|
1037
|
+
T,
|
|
1038
|
+
{
|
|
1039
|
+
title: "WalletConnect",
|
|
1040
|
+
icon: /* @__PURE__ */ n("img", { src: t2, alt: "", className: "zd:w-6 zd:h-6" }),
|
|
1041
|
+
subtitle: /* @__PURE__ */ n(X, { text: "QR CODE" }),
|
|
1042
|
+
trailing: /* @__PURE__ */ n(G, {}),
|
|
1043
|
+
disabled: e,
|
|
1044
|
+
onClick: () => {
|
|
1045
|
+
e || t() && r();
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
) : null;
|
|
1049
|
+
}
|
|
1050
|
+
function S2({
|
|
816
1051
|
children: e,
|
|
817
|
-
termsAndConditionsUrl:
|
|
1052
|
+
termsAndConditionsUrl: t,
|
|
818
1053
|
privacyPolicyUrl: r,
|
|
819
|
-
emailAuthMethod:
|
|
1054
|
+
emailAuthMethod: i = "magicLink"
|
|
820
1055
|
}) {
|
|
821
|
-
const [
|
|
1056
|
+
const [o, a] = E(!1), [s, l] = E(!1), [u, g] = E(null), [z, F] = E(!1), [p, d] = E(
|
|
822
1057
|
[]
|
|
823
|
-
),
|
|
824
|
-
d((
|
|
825
|
-
const
|
|
826
|
-
return
|
|
1058
|
+
), D = O2((y) => (d((M) => [...M, y]), () => {
|
|
1059
|
+
d((M) => {
|
|
1060
|
+
const Q = [...M];
|
|
1061
|
+
return Q.splice(Q.indexOf(y), 1), Q;
|
|
827
1062
|
});
|
|
828
|
-
}), []),
|
|
1063
|
+
}), []), [f, C] = E(null), x = Ce(), h = !!(t || r) && !o, v = () => h ? (l(!0), !1) : !0;
|
|
829
1064
|
return /* @__PURE__ */ c(
|
|
830
|
-
|
|
1065
|
+
E2.Provider,
|
|
831
1066
|
{
|
|
832
1067
|
value: {
|
|
833
|
-
authPending:
|
|
834
|
-
emailAuthMethod:
|
|
835
|
-
setAuthPending:
|
|
836
|
-
needsAgreement:
|
|
837
|
-
guardAgreement:
|
|
838
|
-
setError:
|
|
839
|
-
registeredWallets:
|
|
840
|
-
registerWallet:
|
|
1068
|
+
authPending: z,
|
|
1069
|
+
emailAuthMethod: i,
|
|
1070
|
+
setAuthPending: F,
|
|
1071
|
+
needsAgreement: h,
|
|
1072
|
+
guardAgreement: v,
|
|
1073
|
+
setError: g,
|
|
1074
|
+
registeredWallets: p,
|
|
1075
|
+
registerWallet: D,
|
|
1076
|
+
openWalletSheet: (y) => {
|
|
1077
|
+
const M = y && x.deepLinkFor(y);
|
|
1078
|
+
M && (window.location.href = M), C({ wallet: y });
|
|
1079
|
+
}
|
|
841
1080
|
},
|
|
842
1081
|
children: [
|
|
843
|
-
|
|
844
|
-
/* @__PURE__ */
|
|
845
|
-
/* @__PURE__ */
|
|
846
|
-
/* @__PURE__ */
|
|
847
|
-
|
|
1082
|
+
u !== null && /* @__PURE__ */ n("div", { className: "zd:flex zd:items-center zd:justify-center zd:h-full zd:min-h-100", children: /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:gap-4 zd:max-w-md", children: [
|
|
1083
|
+
/* @__PURE__ */ n(w, { className: "zd:text-h2 zd:text-center", children: "Error occurred" }),
|
|
1084
|
+
/* @__PURE__ */ n(w, { className: "zd:text-center zd:text-red-500", children: u }),
|
|
1085
|
+
/* @__PURE__ */ n(
|
|
1086
|
+
A,
|
|
848
1087
|
{
|
|
849
1088
|
action: "primary",
|
|
850
1089
|
text: "Try again",
|
|
851
|
-
onClick: () =>
|
|
1090
|
+
onClick: () => g(null)
|
|
852
1091
|
}
|
|
853
1092
|
)
|
|
854
1093
|
] }) }),
|
|
855
1094
|
/* @__PURE__ */ c(
|
|
856
1095
|
"div",
|
|
857
1096
|
{
|
|
858
|
-
className: `zd:-mx-4 zd:flex-1 zd:flex zd:flex-col zd:justify-between zd:pb-4 zd:overflow-y-auto zd:overflow-x-hidden${
|
|
1097
|
+
className: `zd:-mx-4 zd:flex-1 zd:flex zd:flex-col zd:justify-between zd:pb-4 zd:overflow-y-auto zd:overflow-x-hidden${u !== null ? " zd:hidden" : ""}`,
|
|
859
1098
|
children: [
|
|
860
1099
|
/* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:justify-center", children: [
|
|
861
1100
|
/* @__PURE__ */ c("div", { className: "zd:px-4 zd:flex zd:flex-col zd:items-center", children: [
|
|
862
|
-
/* @__PURE__ */
|
|
863
|
-
/* @__PURE__ */
|
|
864
|
-
/* @__PURE__ */
|
|
1101
|
+
/* @__PURE__ */ n("div", { className: "zd:w-full zd:px-16 zd:py-4", children: /* @__PURE__ */ n(pe, { className: "zd:w-full zd:pointer-events-none zd:select-none" }) }),
|
|
1102
|
+
/* @__PURE__ */ n(w, { className: "zd:text-h2 zd:text-center", children: "Continue to your wallet" }),
|
|
1103
|
+
/* @__PURE__ */ n(w, { className: "zd:mt-2 zd:text-center zd:text-greyScale/50", children: "Choose a sign-in method to proceed" })
|
|
865
1104
|
] }),
|
|
866
|
-
/* @__PURE__ */
|
|
1105
|
+
/* @__PURE__ */ n("div", { className: "zd:mt-6 zd:mb-4 zd:px-4 zd:flex zd:flex-col zd:gap-2", children: e })
|
|
867
1106
|
] }),
|
|
868
|
-
/* @__PURE__ */
|
|
869
|
-
|
|
1107
|
+
/* @__PURE__ */ n("div", { className: "zd:px-4", children: /* @__PURE__ */ n(
|
|
1108
|
+
ue,
|
|
870
1109
|
{
|
|
871
|
-
termsAndConditionsUrl:
|
|
1110
|
+
termsAndConditionsUrl: t,
|
|
872
1111
|
privacyPolicyUrl: r,
|
|
873
|
-
agreedToTerms:
|
|
1112
|
+
agreedToTerms: o,
|
|
874
1113
|
setAgreedToTerms: (y) => {
|
|
875
|
-
|
|
1114
|
+
a(y), y && l(!1);
|
|
876
1115
|
},
|
|
877
|
-
highlight:
|
|
1116
|
+
highlight: s
|
|
878
1117
|
}
|
|
879
1118
|
) })
|
|
880
1119
|
]
|
|
881
1120
|
}
|
|
1121
|
+
),
|
|
1122
|
+
/* @__PURE__ */ n(
|
|
1123
|
+
ge,
|
|
1124
|
+
{
|
|
1125
|
+
pairing: x,
|
|
1126
|
+
open: f !== null,
|
|
1127
|
+
onOpenChange: (y) => {
|
|
1128
|
+
y || C(null);
|
|
1129
|
+
},
|
|
1130
|
+
wallet: f == null ? void 0 : f.wallet
|
|
1131
|
+
}
|
|
882
1132
|
)
|
|
883
1133
|
]
|
|
884
1134
|
}
|
|
885
1135
|
);
|
|
886
1136
|
}
|
|
887
|
-
function
|
|
1137
|
+
function A2({ label: e = "or" }) {
|
|
888
1138
|
return /* @__PURE__ */ c("div", { className: "zd:-mx-4 zd:my-2 zd:flex zd:items-center zd:gap-3", children: [
|
|
889
|
-
/* @__PURE__ */
|
|
890
|
-
/* @__PURE__ */
|
|
891
|
-
/* @__PURE__ */
|
|
1139
|
+
/* @__PURE__ */ n("div", { className: "zd:h-px zd:flex-1 zd:bg-greyScale/30" }),
|
|
1140
|
+
/* @__PURE__ */ n(w, { className: "zd:text-body3", children: e }),
|
|
1141
|
+
/* @__PURE__ */ n("div", { className: "zd:h-px zd:flex-1 zd:bg-greyScale/30" })
|
|
892
1142
|
] });
|
|
893
1143
|
}
|
|
894
|
-
function
|
|
895
|
-
return /* @__PURE__ */ c(
|
|
896
|
-
/* @__PURE__ */
|
|
897
|
-
/* @__PURE__ */
|
|
898
|
-
/* @__PURE__ */
|
|
899
|
-
/* @__PURE__ */
|
|
1144
|
+
function Ae(e) {
|
|
1145
|
+
return /* @__PURE__ */ c(S2, { ...e, children: [
|
|
1146
|
+
/* @__PURE__ */ n(v2, {}),
|
|
1147
|
+
/* @__PURE__ */ n(A2, {}),
|
|
1148
|
+
/* @__PURE__ */ n(y2, {}),
|
|
1149
|
+
/* @__PURE__ */ n(F2, {})
|
|
900
1150
|
] });
|
|
901
1151
|
}
|
|
902
|
-
const
|
|
903
|
-
Default:
|
|
904
|
-
Passkey:
|
|
905
|
-
Google:
|
|
906
|
-
Email:
|
|
907
|
-
Wallet:
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
1152
|
+
const be = Object.assign(S2, {
|
|
1153
|
+
Default: Ae,
|
|
1154
|
+
Passkey: v2,
|
|
1155
|
+
Google: y2,
|
|
1156
|
+
Email: F2,
|
|
1157
|
+
Wallet: ve,
|
|
1158
|
+
WalletConnect: Se,
|
|
1159
|
+
InstalledWallets: xe,
|
|
1160
|
+
MoreWallets: ye,
|
|
1161
|
+
Divider: A2
|
|
911
1162
|
});
|
|
912
|
-
function
|
|
1163
|
+
function ke() {
|
|
913
1164
|
return typeof window > "u" ? null : new URLSearchParams(window.location.search).get("code");
|
|
914
1165
|
}
|
|
915
|
-
function
|
|
916
|
-
const { otpId: e, otpEncryptionTargetBundle:
|
|
1166
|
+
function Ne() {
|
|
1167
|
+
const { otpId: e, otpEncryptionTargetBundle: t, goToStep: r, clearOtpSession: i } = S(), [o] = E(ke), [a, s] = E(null), l = e2(!1), { mutate: u, isPending: g } = G2({
|
|
917
1168
|
mutation: {
|
|
918
1169
|
onSuccess: () => {
|
|
919
|
-
|
|
1170
|
+
i(), r("authenticated");
|
|
920
1171
|
},
|
|
921
|
-
onError: (
|
|
922
|
-
|
|
1172
|
+
onError: (z) => {
|
|
1173
|
+
s(z);
|
|
923
1174
|
}
|
|
924
1175
|
}
|
|
925
1176
|
});
|
|
926
|
-
return
|
|
927
|
-
if (!(
|
|
928
|
-
if (
|
|
929
|
-
|
|
1177
|
+
return N(() => {
|
|
1178
|
+
if (!(l.current || !o)) {
|
|
1179
|
+
if (l.current = !0, !e || !t) {
|
|
1180
|
+
_(), r(null);
|
|
930
1181
|
return;
|
|
931
1182
|
}
|
|
932
|
-
|
|
1183
|
+
u({ otpId: e, code: o, otpEncryptionTargetBundle: t });
|
|
933
1184
|
}
|
|
934
|
-
}, [e,
|
|
1185
|
+
}, [e, t, o, u, r]), /* @__PURE__ */ c(b, { children: [
|
|
935
1186
|
/* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center", children: [
|
|
936
|
-
!
|
|
937
|
-
!
|
|
938
|
-
/* @__PURE__ */ c(
|
|
1187
|
+
!a && g && /* @__PURE__ */ n(L, { imageName: "loading", title: "Verifying Your Email", children: "Please wait while we securely connect your wallet." }),
|
|
1188
|
+
!a && !o && !g && /* @__PURE__ */ c(b, { children: [
|
|
1189
|
+
/* @__PURE__ */ c(L, { imageName: "error", title: "Invalid Link", children: [
|
|
939
1190
|
"This verification link is invalid or incomplete.",
|
|
940
|
-
/* @__PURE__ */
|
|
1191
|
+
/* @__PURE__ */ n("br", {}),
|
|
941
1192
|
"Please check your email and try again with the correct link."
|
|
942
1193
|
] }),
|
|
943
|
-
/* @__PURE__ */
|
|
944
|
-
|
|
1194
|
+
/* @__PURE__ */ n(
|
|
1195
|
+
A,
|
|
945
1196
|
{
|
|
946
1197
|
action: "primary",
|
|
947
1198
|
onClick: () => {
|
|
948
|
-
|
|
1199
|
+
_(), r("sign-up");
|
|
949
1200
|
},
|
|
950
1201
|
text: "Choose another sign-in method"
|
|
951
1202
|
}
|
|
952
1203
|
)
|
|
953
1204
|
] }),
|
|
954
|
-
|
|
955
|
-
/* @__PURE__ */
|
|
956
|
-
/* @__PURE__ */
|
|
957
|
-
|
|
1205
|
+
a != null && /* @__PURE__ */ c(b, { children: [
|
|
1206
|
+
/* @__PURE__ */ n(L, { 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." }),
|
|
1207
|
+
/* @__PURE__ */ n(
|
|
1208
|
+
A,
|
|
958
1209
|
{
|
|
959
1210
|
action: "primary",
|
|
960
1211
|
onClick: () => {
|
|
961
|
-
|
|
1212
|
+
_(), r("sign-up");
|
|
962
1213
|
},
|
|
963
1214
|
text: "Choose another sign-in method"
|
|
964
1215
|
}
|
|
965
1216
|
)
|
|
966
1217
|
] })
|
|
967
1218
|
] }),
|
|
968
|
-
/* @__PURE__ */
|
|
1219
|
+
/* @__PURE__ */ n(Z, { className: "zd:self-center zd:pt-4 zd:pb-6" })
|
|
969
1220
|
] });
|
|
970
1221
|
}
|
|
971
|
-
function
|
|
972
|
-
return /* @__PURE__ */
|
|
1222
|
+
function Ue() {
|
|
1223
|
+
return /* @__PURE__ */ n("div", { className: "zd:flex zd:flex-1 zd:items-center zd:justify-center", children: /* @__PURE__ */ n(L, { imageName: "loading", title: "Authenticating...", children: "Please wait while we complete the OAuth authentication." }) });
|
|
973
1224
|
}
|
|
974
|
-
function
|
|
975
|
-
return /* @__PURE__ */
|
|
1225
|
+
function Ie() {
|
|
1226
|
+
return /* @__PURE__ */ n("div", { className: "zd:flex zd:flex-1 zd:items-center zd:justify-center", children: /* @__PURE__ */ n(L, { imageName: "loading", title: "Passkey authentication", children: "Please authenticate with your passkey." }) });
|
|
976
1227
|
}
|
|
977
|
-
function
|
|
1228
|
+
function Te(e, t) {
|
|
978
1229
|
switch (e) {
|
|
979
1230
|
case "sign-up":
|
|
980
|
-
return
|
|
1231
|
+
return t ? t() : /* @__PURE__ */ n(be.Default, {});
|
|
981
1232
|
case "email-verification":
|
|
982
|
-
return /* @__PURE__ */
|
|
1233
|
+
return /* @__PURE__ */ n(te, {});
|
|
983
1234
|
case "otp-input":
|
|
984
|
-
return /* @__PURE__ */
|
|
1235
|
+
return /* @__PURE__ */ n(ce, {});
|
|
985
1236
|
case "verifying-otp":
|
|
986
|
-
return /* @__PURE__ */
|
|
1237
|
+
return /* @__PURE__ */ n(Ne, {});
|
|
987
1238
|
case "oauth-in-progress":
|
|
988
|
-
return /* @__PURE__ */
|
|
1239
|
+
return /* @__PURE__ */ n(Ue, {});
|
|
989
1240
|
case "passkey-prompt":
|
|
990
|
-
return /* @__PURE__ */
|
|
1241
|
+
return /* @__PURE__ */ n(Ie, {});
|
|
991
1242
|
case "error":
|
|
992
|
-
return /* @__PURE__ */
|
|
1243
|
+
return /* @__PURE__ */ n(ie, {});
|
|
993
1244
|
default:
|
|
994
1245
|
return null;
|
|
995
1246
|
}
|
|
996
1247
|
}
|
|
997
|
-
function
|
|
1248
|
+
function rt({
|
|
998
1249
|
onClose: e,
|
|
999
|
-
size:
|
|
1250
|
+
size: t,
|
|
1000
1251
|
renderSignUp: r,
|
|
1001
|
-
logo:
|
|
1252
|
+
logo: i
|
|
1002
1253
|
} = {}) {
|
|
1003
|
-
const { step:
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
}, [
|
|
1007
|
-
const
|
|
1008
|
-
return
|
|
1009
|
-
|
|
1254
|
+
const { step: o, goToStep: a, goBack: s, reset: l } = S();
|
|
1255
|
+
N(() => {
|
|
1256
|
+
o === null && ne() && a("verifying-otp");
|
|
1257
|
+
}, [o, a]);
|
|
1258
|
+
const u = Te(o, r);
|
|
1259
|
+
return u ? /* @__PURE__ */ n(
|
|
1260
|
+
g2,
|
|
1010
1261
|
{
|
|
1011
|
-
...
|
|
1012
|
-
className:
|
|
1013
|
-
topNav: /* @__PURE__ */
|
|
1014
|
-
|
|
1262
|
+
...t && { size: t },
|
|
1263
|
+
className: o === "sign-up" ? "zd:h-auto zd:max-h-202.5" : void 0,
|
|
1264
|
+
topNav: /* @__PURE__ */ n(
|
|
1265
|
+
z2,
|
|
1015
1266
|
{
|
|
1016
|
-
...
|
|
1267
|
+
...s !== null && { onLeftButtonClick: s },
|
|
1017
1268
|
onRightButtonClick: () => {
|
|
1018
|
-
|
|
1269
|
+
_(), l(), e == null || e();
|
|
1019
1270
|
},
|
|
1020
|
-
...
|
|
1021
|
-
...
|
|
1271
|
+
...o === "sign-up" && {
|
|
1272
|
+
...i && { logo: i },
|
|
1022
1273
|
className: "zd:px-4"
|
|
1023
1274
|
}
|
|
1024
1275
|
}
|
|
1025
1276
|
),
|
|
1026
|
-
children:
|
|
1277
|
+
children: u
|
|
1027
1278
|
}
|
|
1028
1279
|
) : null;
|
|
1029
1280
|
}
|
|
1030
|
-
|
|
1031
|
-
|
|
1281
|
+
function Le(e) {
|
|
1282
|
+
const t = e.toLowerCase();
|
|
1283
|
+
return k.find((r) => {
|
|
1284
|
+
const i = r.name.toLowerCase();
|
|
1285
|
+
return t.includes(i) || i.includes(t);
|
|
1286
|
+
});
|
|
1287
|
+
}
|
|
1288
|
+
function Oe(e) {
|
|
1289
|
+
return k.find((t) => O(e, t));
|
|
1290
|
+
}
|
|
1291
|
+
function Me() {
|
|
1292
|
+
const { connector: e, isConnected: t } = D2(), [r, i] = E(void 0), o = !!e && e.type === "walletConnect";
|
|
1293
|
+
return N(() => {
|
|
1294
|
+
if (!e || !o) {
|
|
1295
|
+
i(void 0);
|
|
1296
|
+
return;
|
|
1297
|
+
}
|
|
1298
|
+
let a = !1;
|
|
1299
|
+
return e.getProvider().then((s) => {
|
|
1300
|
+
var u, g;
|
|
1301
|
+
if (a) return;
|
|
1302
|
+
const l = (g = (u = s.session) == null ? void 0 : u.peer) == null ? void 0 : g.metadata;
|
|
1303
|
+
i(l);
|
|
1304
|
+
}).catch(() => {
|
|
1305
|
+
}), () => {
|
|
1306
|
+
a = !0;
|
|
1307
|
+
};
|
|
1308
|
+
}, [e, o]), $(() => {
|
|
1309
|
+
var s;
|
|
1310
|
+
if (!t || !e) return;
|
|
1311
|
+
if (e.id === "zerodev-wallet")
|
|
1312
|
+
return {
|
|
1313
|
+
name: e.name,
|
|
1314
|
+
icon: e.icon,
|
|
1315
|
+
source: "embedded"
|
|
1316
|
+
};
|
|
1317
|
+
if (o) {
|
|
1318
|
+
const l = r != null && r.name ? Le(r.name) : void 0;
|
|
1319
|
+
return {
|
|
1320
|
+
name: (r == null ? void 0 : r.name) ?? void 0,
|
|
1321
|
+
icon: ((s = r == null ? void 0 : r.icons) == null ? void 0 : s[0]) ?? (l == null ? void 0 : l.icon),
|
|
1322
|
+
walletId: l == null ? void 0 : l.id,
|
|
1323
|
+
// Identity is about the session, so a raw walletConnect() connector
|
|
1324
|
+
// resolves here too — unlike pairing, which is kit-connector-only.
|
|
1325
|
+
source: "walletconnect"
|
|
1326
|
+
};
|
|
1327
|
+
}
|
|
1328
|
+
const a = Oe(e);
|
|
1329
|
+
return {
|
|
1330
|
+
name: e.name,
|
|
1331
|
+
icon: e.icon ?? (a == null ? void 0 : a.icon),
|
|
1332
|
+
walletId: a == null ? void 0 : a.id,
|
|
1333
|
+
source: e.type === "injected" ? "injected" : "other"
|
|
1334
|
+
};
|
|
1335
|
+
}, [e, t, o, r]);
|
|
1336
|
+
}
|
|
1337
|
+
function ot(e) {
|
|
1338
|
+
const t = Me();
|
|
1339
|
+
return $(() => ({ walletInfo: t }), [t]);
|
|
1340
|
+
}
|
|
1341
|
+
const i2 = "zerodev:auth:otpSession";
|
|
1342
|
+
function Be() {
|
|
1032
1343
|
if (typeof window > "u") return null;
|
|
1033
1344
|
try {
|
|
1034
|
-
const e = window.localStorage.getItem(
|
|
1345
|
+
const e = window.localStorage.getItem(i2);
|
|
1035
1346
|
if (!e) return null;
|
|
1036
|
-
const
|
|
1037
|
-
return !(
|
|
1347
|
+
const t = JSON.parse(e);
|
|
1348
|
+
return !(t != null && t.otpId) || !(t != null && t.otpEncryptionTargetBundle) ? null : t;
|
|
1038
1349
|
} catch {
|
|
1039
1350
|
return null;
|
|
1040
1351
|
}
|
|
1041
1352
|
}
|
|
1042
|
-
function
|
|
1353
|
+
function He(e) {
|
|
1043
1354
|
if (!(typeof window > "u"))
|
|
1044
1355
|
try {
|
|
1045
1356
|
window.localStorage.setItem(
|
|
1046
|
-
|
|
1357
|
+
i2,
|
|
1047
1358
|
JSON.stringify(e)
|
|
1048
1359
|
);
|
|
1049
1360
|
} catch {
|
|
1050
1361
|
}
|
|
1051
1362
|
}
|
|
1052
|
-
function
|
|
1363
|
+
function r2() {
|
|
1053
1364
|
if (!(typeof window > "u"))
|
|
1054
1365
|
try {
|
|
1055
|
-
window.localStorage.removeItem(
|
|
1366
|
+
window.localStorage.removeItem(i2);
|
|
1056
1367
|
} catch {
|
|
1057
1368
|
}
|
|
1058
1369
|
}
|
|
1059
|
-
const
|
|
1370
|
+
const Re = (e, t, r) => ({
|
|
1060
1371
|
auth: {
|
|
1061
1372
|
// Initial state
|
|
1062
1373
|
step: null,
|
|
@@ -1066,40 +1377,40 @@ const ge = (e, n, r) => ({
|
|
|
1066
1377
|
otpEncryptionTargetBundle: null,
|
|
1067
1378
|
// Actions
|
|
1068
1379
|
initialize: () => {
|
|
1069
|
-
const
|
|
1070
|
-
|
|
1380
|
+
const i = Be();
|
|
1381
|
+
i && e((o) => ({
|
|
1071
1382
|
auth: {
|
|
1072
|
-
...
|
|
1073
|
-
otpId:
|
|
1074
|
-
otpEncryptionTargetBundle:
|
|
1383
|
+
...o.auth,
|
|
1384
|
+
otpId: i.otpId,
|
|
1385
|
+
otpEncryptionTargetBundle: i.otpEncryptionTargetBundle
|
|
1075
1386
|
}
|
|
1076
1387
|
}));
|
|
1077
1388
|
},
|
|
1078
|
-
goToStep: (
|
|
1079
|
-
e((
|
|
1389
|
+
goToStep: (i) => {
|
|
1390
|
+
e((o) => ({
|
|
1080
1391
|
auth: {
|
|
1081
|
-
...
|
|
1082
|
-
step:
|
|
1083
|
-
stepHistory:
|
|
1392
|
+
...o.auth,
|
|
1393
|
+
step: i,
|
|
1394
|
+
stepHistory: o.auth.step === null ? o.auth.stepHistory : [...o.auth.stepHistory, o.auth.step]
|
|
1084
1395
|
}
|
|
1085
1396
|
}));
|
|
1086
1397
|
},
|
|
1087
1398
|
goBack: () => {
|
|
1088
|
-
const { auth:
|
|
1089
|
-
if (
|
|
1090
|
-
const
|
|
1091
|
-
e((
|
|
1399
|
+
const { auth: i } = t();
|
|
1400
|
+
if (i.stepHistory.length === 0) return;
|
|
1401
|
+
const o = [...i.stepHistory], a = o.pop();
|
|
1402
|
+
e((s) => ({
|
|
1092
1403
|
auth: {
|
|
1093
|
-
...
|
|
1094
|
-
step:
|
|
1095
|
-
stepHistory:
|
|
1404
|
+
...s.auth,
|
|
1405
|
+
step: a,
|
|
1406
|
+
stepHistory: o
|
|
1096
1407
|
}
|
|
1097
1408
|
}));
|
|
1098
1409
|
},
|
|
1099
1410
|
reset: () => {
|
|
1100
|
-
|
|
1411
|
+
r2(), e((i) => ({
|
|
1101
1412
|
auth: {
|
|
1102
|
-
...
|
|
1413
|
+
...i.auth,
|
|
1103
1414
|
step: null,
|
|
1104
1415
|
stepHistory: [],
|
|
1105
1416
|
email: null,
|
|
@@ -1108,82 +1419,82 @@ const ge = (e, n, r) => ({
|
|
|
1108
1419
|
}
|
|
1109
1420
|
}));
|
|
1110
1421
|
},
|
|
1111
|
-
setEmail: (
|
|
1112
|
-
e((
|
|
1422
|
+
setEmail: (i) => {
|
|
1423
|
+
e((o) => ({
|
|
1113
1424
|
auth: {
|
|
1114
|
-
...
|
|
1115
|
-
email:
|
|
1425
|
+
...o.auth,
|
|
1426
|
+
email: i
|
|
1116
1427
|
}
|
|
1117
1428
|
}));
|
|
1118
1429
|
},
|
|
1119
|
-
setOtpSession: ({ otpId:
|
|
1120
|
-
|
|
1430
|
+
setOtpSession: ({ otpId: i, otpEncryptionTargetBundle: o }) => {
|
|
1431
|
+
He({ otpId: i, otpEncryptionTargetBundle: o }), e((a) => ({
|
|
1121
1432
|
auth: {
|
|
1122
|
-
...
|
|
1123
|
-
otpId:
|
|
1124
|
-
otpEncryptionTargetBundle:
|
|
1433
|
+
...a.auth,
|
|
1434
|
+
otpId: i,
|
|
1435
|
+
otpEncryptionTargetBundle: o
|
|
1125
1436
|
}
|
|
1126
1437
|
}));
|
|
1127
1438
|
},
|
|
1128
1439
|
clearOtpSession: () => {
|
|
1129
|
-
|
|
1440
|
+
r2(), e((i) => ({
|
|
1130
1441
|
auth: {
|
|
1131
|
-
...
|
|
1442
|
+
...i.auth,
|
|
1132
1443
|
otpId: null,
|
|
1133
1444
|
otpEncryptionTargetBundle: null
|
|
1134
1445
|
}
|
|
1135
1446
|
}));
|
|
1136
1447
|
}
|
|
1137
1448
|
}
|
|
1138
|
-
}),
|
|
1139
|
-
|
|
1449
|
+
}), Pe = () => B2()(
|
|
1450
|
+
q2((e, t, r) => ({
|
|
1140
1451
|
pendingRequests: [],
|
|
1141
1452
|
userConfirmationListenerActive: !1,
|
|
1142
|
-
addPendingRequest: (
|
|
1143
|
-
pendingRequests: [...
|
|
1453
|
+
addPendingRequest: (i) => e((o) => ({
|
|
1454
|
+
pendingRequests: [...o.pendingRequests, i]
|
|
1144
1455
|
})),
|
|
1145
|
-
removePendingRequest: (
|
|
1146
|
-
pendingRequests:
|
|
1456
|
+
removePendingRequest: (i) => e((o) => ({
|
|
1457
|
+
pendingRequests: o.pendingRequests.filter((a) => a.id !== i)
|
|
1147
1458
|
})),
|
|
1148
1459
|
clearPendingRequests: () => e({ pendingRequests: [] }),
|
|
1149
|
-
setUserConfirmationListenerActive: (
|
|
1150
|
-
...
|
|
1460
|
+
setUserConfirmationListenerActive: (i) => e({ userConfirmationListenerActive: i }),
|
|
1461
|
+
...Re(e, t)
|
|
1151
1462
|
}))
|
|
1152
1463
|
);
|
|
1153
|
-
function
|
|
1154
|
-
return new Promise((
|
|
1155
|
-
const
|
|
1156
|
-
(
|
|
1157
|
-
(
|
|
1158
|
-
|
|
1464
|
+
function We(e) {
|
|
1465
|
+
return new Promise((t, r) => {
|
|
1466
|
+
const i = e.subscribe(
|
|
1467
|
+
(o) => o.auth.step,
|
|
1468
|
+
(o) => {
|
|
1469
|
+
o === "authenticated" ? (i(), t()) : o === null && (i(), r(new Error("Auth flow dismissed")));
|
|
1159
1470
|
}
|
|
1160
1471
|
);
|
|
1161
1472
|
});
|
|
1162
1473
|
}
|
|
1163
|
-
function
|
|
1164
|
-
const
|
|
1165
|
-
return (
|
|
1166
|
-
const
|
|
1474
|
+
function at(e) {
|
|
1475
|
+
const t = V2(e), r = Pe();
|
|
1476
|
+
return (i) => {
|
|
1477
|
+
const o = t(i);
|
|
1167
1478
|
return {
|
|
1168
|
-
...
|
|
1169
|
-
async connect(
|
|
1479
|
+
...o,
|
|
1480
|
+
async connect(a) {
|
|
1170
1481
|
try {
|
|
1171
|
-
return await
|
|
1172
|
-
} catch (
|
|
1173
|
-
if (
|
|
1174
|
-
throw
|
|
1482
|
+
return await o.connect(a);
|
|
1483
|
+
} catch (s) {
|
|
1484
|
+
if (a != null && a.isReconnecting || !(s instanceof j2))
|
|
1485
|
+
throw s;
|
|
1175
1486
|
if (r.getState().auth.step !== null)
|
|
1176
1487
|
throw new Error("Auth flow already in progress");
|
|
1177
|
-
return r.getState().auth.goToStep("sign-up"), await
|
|
1488
|
+
return r.getState().auth.goToStep("sign-up"), await We(r), o.connect(a);
|
|
1178
1489
|
}
|
|
1179
1490
|
},
|
|
1180
1491
|
async disconnect() {
|
|
1181
|
-
var
|
|
1182
|
-
await ((
|
|
1492
|
+
var a;
|
|
1493
|
+
await ((a = o.disconnect) == null ? void 0 : a.call(o)), r.getState().auth.reset();
|
|
1183
1494
|
},
|
|
1184
1495
|
async setup() {
|
|
1185
|
-
var
|
|
1186
|
-
await ((
|
|
1496
|
+
var a;
|
|
1497
|
+
await ((a = o.setup) == null ? void 0 : a.call(o)), !(typeof window > "u") && r.getState().auth.initialize();
|
|
1187
1498
|
},
|
|
1188
1499
|
getKitStore() {
|
|
1189
1500
|
return r;
|
|
@@ -1191,68 +1502,68 @@ function Le(e) {
|
|
|
1191
1502
|
};
|
|
1192
1503
|
};
|
|
1193
1504
|
}
|
|
1194
|
-
const
|
|
1505
|
+
const _e = {
|
|
1195
1506
|
Pending: "zd:text-solarOrange",
|
|
1196
1507
|
Success: "zd:text-positive",
|
|
1197
1508
|
Failed: "zd:text-negative"
|
|
1198
1509
|
};
|
|
1199
|
-
function
|
|
1510
|
+
function Ze({
|
|
1200
1511
|
icon: e,
|
|
1201
|
-
title:
|
|
1512
|
+
title: t,
|
|
1202
1513
|
value: r,
|
|
1203
|
-
chainName:
|
|
1204
|
-
chainIconUrl:
|
|
1205
|
-
destChainName:
|
|
1206
|
-
destChainIconUrl:
|
|
1207
|
-
status:
|
|
1208
|
-
className:
|
|
1514
|
+
chainName: i,
|
|
1515
|
+
chainIconUrl: o,
|
|
1516
|
+
destChainName: a,
|
|
1517
|
+
destChainIconUrl: s,
|
|
1518
|
+
status: l,
|
|
1519
|
+
className: u
|
|
1209
1520
|
}) {
|
|
1210
1521
|
return /* @__PURE__ */ c(
|
|
1211
1522
|
"div",
|
|
1212
1523
|
{
|
|
1213
|
-
className:
|
|
1524
|
+
className: q(
|
|
1214
1525
|
"zd:flex zd:w-full zd:items-center zd:gap-2 zd:p-2",
|
|
1215
|
-
|
|
1526
|
+
u
|
|
1216
1527
|
),
|
|
1217
1528
|
children: [
|
|
1218
|
-
/* @__PURE__ */
|
|
1529
|
+
/* @__PURE__ */ n("div", { className: "zd:flex zd:size-11 zd:shrink-0 zd:items-center zd:justify-center zd:rounded-xl zd:bg-white", children: /* @__PURE__ */ n(K, { name: e, className: "zd:size-5" }) }),
|
|
1219
1530
|
/* @__PURE__ */ c("div", { className: "zd:flex zd:min-w-0 zd:flex-1 zd:flex-col zd:gap-2", children: [
|
|
1220
1531
|
/* @__PURE__ */ c("div", { className: "zd:flex zd:w-full zd:items-center zd:justify-between zd:gap-2", children: [
|
|
1221
|
-
/* @__PURE__ */
|
|
1222
|
-
/* @__PURE__ */
|
|
1532
|
+
/* @__PURE__ */ n(w, { className: "zd:shrink-0 zd:whitespace-nowrap zd:text-body1", children: t }),
|
|
1533
|
+
/* @__PURE__ */ n(w, { className: "zd:min-w-0 zd:truncate zd:text-right zd:text-body1", children: r })
|
|
1223
1534
|
] }),
|
|
1224
1535
|
/* @__PURE__ */ c("div", { className: "zd:flex zd:w-full zd:items-center zd:justify-between zd:gap-2", children: [
|
|
1225
1536
|
/* @__PURE__ */ c("div", { className: "zd:flex zd:min-w-0 zd:items-center zd:gap-2", children: [
|
|
1226
|
-
/* @__PURE__ */
|
|
1227
|
-
|
|
1537
|
+
/* @__PURE__ */ n(
|
|
1538
|
+
o2,
|
|
1228
1539
|
{
|
|
1229
|
-
name:
|
|
1230
|
-
...
|
|
1540
|
+
name: i,
|
|
1541
|
+
...o && { iconUrl: o }
|
|
1231
1542
|
}
|
|
1232
1543
|
),
|
|
1233
|
-
|
|
1234
|
-
/* @__PURE__ */
|
|
1235
|
-
|
|
1544
|
+
a && /* @__PURE__ */ c(b, { children: [
|
|
1545
|
+
/* @__PURE__ */ n(
|
|
1546
|
+
K,
|
|
1236
1547
|
{
|
|
1237
1548
|
name: "arrowRightFill",
|
|
1238
1549
|
"aria-hidden": !0,
|
|
1239
1550
|
className: "zd:size-3 zd:shrink-0 zd:opacity-30"
|
|
1240
1551
|
}
|
|
1241
1552
|
),
|
|
1242
|
-
/* @__PURE__ */
|
|
1243
|
-
|
|
1553
|
+
/* @__PURE__ */ n(
|
|
1554
|
+
o2,
|
|
1244
1555
|
{
|
|
1245
|
-
name:
|
|
1246
|
-
...
|
|
1556
|
+
name: a,
|
|
1557
|
+
...s && { iconUrl: s }
|
|
1247
1558
|
}
|
|
1248
1559
|
)
|
|
1249
1560
|
] })
|
|
1250
1561
|
] }),
|
|
1251
|
-
/* @__PURE__ */
|
|
1252
|
-
|
|
1562
|
+
/* @__PURE__ */ n(
|
|
1563
|
+
w,
|
|
1253
1564
|
{
|
|
1254
|
-
className:
|
|
1255
|
-
children:
|
|
1565
|
+
className: q("zd:shrink-0 zd:text-body3", _e[l]),
|
|
1566
|
+
children: l
|
|
1256
1567
|
}
|
|
1257
1568
|
)
|
|
1258
1569
|
] })
|
|
@@ -1261,32 +1572,32 @@ function Ce({
|
|
|
1261
1572
|
}
|
|
1262
1573
|
);
|
|
1263
1574
|
}
|
|
1264
|
-
function
|
|
1575
|
+
function o2({ name: e, iconUrl: t }) {
|
|
1265
1576
|
return /* @__PURE__ */ c("div", { className: "zd:flex zd:min-w-0 zd:items-center zd:gap-[5px]", children: [
|
|
1266
|
-
|
|
1577
|
+
t && /* @__PURE__ */ n("span", { className: "zd:size-3 zd:shrink-0 zd:overflow-hidden zd:rounded-full zd:bg-white", children: /* @__PURE__ */ n(
|
|
1267
1578
|
"img",
|
|
1268
1579
|
{
|
|
1269
|
-
src:
|
|
1580
|
+
src: t,
|
|
1270
1581
|
alt: "",
|
|
1271
1582
|
"aria-hidden": !0,
|
|
1272
1583
|
className: "zd:size-full zd:object-cover"
|
|
1273
1584
|
}
|
|
1274
1585
|
) }),
|
|
1275
|
-
/* @__PURE__ */
|
|
1586
|
+
/* @__PURE__ */ n(w, { className: "zd:truncate zd:text-body3", children: e })
|
|
1276
1587
|
] });
|
|
1277
1588
|
}
|
|
1278
|
-
const
|
|
1589
|
+
const B = "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/info/logo.png", a2 = "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/base/info/logo.png", I = 3600 * 1e3, Ge = [
|
|
1279
1590
|
{
|
|
1280
1591
|
id: "mock-1",
|
|
1281
1592
|
icon: "arrowSwapHorizontalOutline",
|
|
1282
1593
|
title: "Swapped ETH → USD₮0",
|
|
1283
1594
|
value: "2,343 ETH",
|
|
1284
1595
|
chainName: "Arbitrum One",
|
|
1285
|
-
chainIconUrl:
|
|
1596
|
+
chainIconUrl: B,
|
|
1286
1597
|
destChainName: "Base",
|
|
1287
|
-
destChainIconUrl:
|
|
1598
|
+
destChainIconUrl: a2,
|
|
1288
1599
|
status: "Pending",
|
|
1289
|
-
timestamp: Date.now() - 1 *
|
|
1600
|
+
timestamp: Date.now() - 1 * I
|
|
1290
1601
|
},
|
|
1291
1602
|
{
|
|
1292
1603
|
id: "mock-2",
|
|
@@ -1294,11 +1605,11 @@ const _ = "https://raw.githubusercontent.com/trustwallet/assets/master/blockchai
|
|
|
1294
1605
|
title: "Swapped ETH → USD₮0",
|
|
1295
1606
|
value: "2,343 ETH",
|
|
1296
1607
|
chainName: "Arbitrum One",
|
|
1297
|
-
chainIconUrl:
|
|
1608
|
+
chainIconUrl: B,
|
|
1298
1609
|
destChainName: "Base",
|
|
1299
|
-
destChainIconUrl:
|
|
1610
|
+
destChainIconUrl: a2,
|
|
1300
1611
|
status: "Pending",
|
|
1301
|
-
timestamp: Date.now() - 2 *
|
|
1612
|
+
timestamp: Date.now() - 2 * I
|
|
1302
1613
|
},
|
|
1303
1614
|
{
|
|
1304
1615
|
id: "mock-3",
|
|
@@ -1306,9 +1617,9 @@ const _ = "https://raw.githubusercontent.com/trustwallet/assets/master/blockchai
|
|
|
1306
1617
|
title: "Fixed Yield",
|
|
1307
1618
|
value: "2,323 PT wstETH (25 Jan 2026)",
|
|
1308
1619
|
chainName: "Arbitrum One",
|
|
1309
|
-
chainIconUrl:
|
|
1620
|
+
chainIconUrl: B,
|
|
1310
1621
|
status: "Success",
|
|
1311
|
-
timestamp: Date.now() - 3 *
|
|
1622
|
+
timestamp: Date.now() - 3 * I
|
|
1312
1623
|
},
|
|
1313
1624
|
{
|
|
1314
1625
|
id: "mock-4",
|
|
@@ -1316,9 +1627,9 @@ const _ = "https://raw.githubusercontent.com/trustwallet/assets/master/blockchai
|
|
|
1316
1627
|
title: "Received NFT",
|
|
1317
1628
|
value: "Bored Ape Yacht Club",
|
|
1318
1629
|
chainName: "Arbitrum One",
|
|
1319
|
-
chainIconUrl:
|
|
1630
|
+
chainIconUrl: B,
|
|
1320
1631
|
status: "Success",
|
|
1321
|
-
timestamp: Date.now() - 4 *
|
|
1632
|
+
timestamp: Date.now() - 4 * I
|
|
1322
1633
|
},
|
|
1323
1634
|
{
|
|
1324
1635
|
id: "mock-5",
|
|
@@ -1326,9 +1637,9 @@ const _ = "https://raw.githubusercontent.com/trustwallet/assets/master/blockchai
|
|
|
1326
1637
|
title: "Collateral Used",
|
|
1327
1638
|
value: "Collateralization enabled for USD₮0",
|
|
1328
1639
|
chainName: "Arbitrum One",
|
|
1329
|
-
chainIconUrl:
|
|
1640
|
+
chainIconUrl: B,
|
|
1330
1641
|
status: "Success",
|
|
1331
|
-
timestamp: Date.now() - 336 *
|
|
1642
|
+
timestamp: Date.now() - 336 * I
|
|
1332
1643
|
},
|
|
1333
1644
|
{
|
|
1334
1645
|
id: "mock-6",
|
|
@@ -1336,64 +1647,64 @@ const _ = "https://raw.githubusercontent.com/trustwallet/assets/master/blockchai
|
|
|
1336
1647
|
title: "Liquid Staked ETH",
|
|
1337
1648
|
value: "2,323 PT wstETH (25 Jan 2026)",
|
|
1338
1649
|
chainName: "Arbitrum One",
|
|
1339
|
-
chainIconUrl:
|
|
1650
|
+
chainIconUrl: B,
|
|
1340
1651
|
status: "Success",
|
|
1341
|
-
timestamp: Date.now() - 336 *
|
|
1652
|
+
timestamp: Date.now() - 336 * I - 1 * I
|
|
1342
1653
|
}
|
|
1343
1654
|
];
|
|
1344
|
-
function
|
|
1345
|
-
const
|
|
1346
|
-
return `${
|
|
1655
|
+
function j(e) {
|
|
1656
|
+
const t = new Date(e);
|
|
1657
|
+
return `${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`;
|
|
1347
1658
|
}
|
|
1348
|
-
function
|
|
1349
|
-
const r =
|
|
1350
|
-
return r ===
|
|
1659
|
+
function Ve(e, t) {
|
|
1660
|
+
const r = j(e);
|
|
1661
|
+
return r === j(t) ? "Today" : r === j(t - 1440 * 60 * 1e3) ? "Yesterday" : new Intl.DateTimeFormat("en-US", {
|
|
1351
1662
|
month: "long",
|
|
1352
1663
|
day: "numeric",
|
|
1353
1664
|
year: "numeric"
|
|
1354
1665
|
}).format(new Date(e));
|
|
1355
1666
|
}
|
|
1356
|
-
function
|
|
1357
|
-
var
|
|
1358
|
-
const r = [...e].sort((
|
|
1359
|
-
let
|
|
1360
|
-
for (const
|
|
1361
|
-
const
|
|
1362
|
-
|
|
1667
|
+
function je(e, t = Date.now()) {
|
|
1668
|
+
var a;
|
|
1669
|
+
const r = [...e].sort((s, l) => l.timestamp - s.timestamp), i = [];
|
|
1670
|
+
let o = null;
|
|
1671
|
+
for (const s of r) {
|
|
1672
|
+
const l = j(s.timestamp);
|
|
1673
|
+
l !== o && (o = l, i.push({ label: Ve(s.timestamp, t), entries: [] })), (a = i[i.length - 1]) == null || a.entries.push(s);
|
|
1363
1674
|
}
|
|
1364
|
-
return
|
|
1675
|
+
return i;
|
|
1365
1676
|
}
|
|
1366
|
-
function
|
|
1367
|
-
entries: e =
|
|
1368
|
-
onSelectEntry:
|
|
1677
|
+
function qe({
|
|
1678
|
+
entries: e = Ge,
|
|
1679
|
+
onSelectEntry: t
|
|
1369
1680
|
}) {
|
|
1370
|
-
const r =
|
|
1371
|
-
return /* @__PURE__ */
|
|
1372
|
-
|
|
1681
|
+
const r = je(e);
|
|
1682
|
+
return /* @__PURE__ */ n("div", { className: "zd:flex zd:h-full zd:w-full zd:flex-col zd:gap-1 zd:pt-2 zd:pb-4", children: /* @__PURE__ */ n(
|
|
1683
|
+
c2,
|
|
1373
1684
|
{
|
|
1374
1685
|
variant: "ghost",
|
|
1375
1686
|
className: "zd:flex zd:w-full zd:flex-1 zd:flex-col zd:gap-1 zd:overflow-y-auto zd:rounded-2xl zd:p-2",
|
|
1376
|
-
children: r.map((
|
|
1377
|
-
/* @__PURE__ */
|
|
1378
|
-
|
|
1379
|
-
(
|
|
1687
|
+
children: r.map((i) => /* @__PURE__ */ c(M2, { children: [
|
|
1688
|
+
/* @__PURE__ */ n("div", { className: "zd:flex zd:w-full zd:items-center zd:py-2 zd:pr-2", children: /* @__PURE__ */ n(w, { className: "zd:text-body3", children: i.label }) }),
|
|
1689
|
+
i.entries.map(
|
|
1690
|
+
(o) => t ? /* @__PURE__ */ n(
|
|
1380
1691
|
"button",
|
|
1381
1692
|
{
|
|
1382
1693
|
type: "button",
|
|
1383
|
-
onClick: () =>
|
|
1694
|
+
onClick: () => t(o),
|
|
1384
1695
|
className: "zd:w-full zd:cursor-pointer zd:text-left",
|
|
1385
|
-
children: /* @__PURE__ */
|
|
1696
|
+
children: /* @__PURE__ */ n(s2, { entry: o })
|
|
1386
1697
|
},
|
|
1387
|
-
|
|
1388
|
-
) : /* @__PURE__ */
|
|
1698
|
+
o.id
|
|
1699
|
+
) : /* @__PURE__ */ n(s2, { entry: o }, o.id)
|
|
1389
1700
|
)
|
|
1390
|
-
] },
|
|
1701
|
+
] }, i.label))
|
|
1391
1702
|
}
|
|
1392
1703
|
) });
|
|
1393
1704
|
}
|
|
1394
|
-
function
|
|
1395
|
-
return /* @__PURE__ */
|
|
1396
|
-
|
|
1705
|
+
function s2({ entry: e }) {
|
|
1706
|
+
return /* @__PURE__ */ n(
|
|
1707
|
+
Ze,
|
|
1397
1708
|
{
|
|
1398
1709
|
icon: e.icon,
|
|
1399
1710
|
title: e.title,
|
|
@@ -1408,43 +1719,82 @@ function Q({ entry: e }) {
|
|
|
1408
1719
|
}
|
|
1409
1720
|
);
|
|
1410
1721
|
}
|
|
1411
|
-
const
|
|
1722
|
+
const Ke = {
|
|
1412
1723
|
history: "History"
|
|
1413
1724
|
};
|
|
1414
|
-
function
|
|
1725
|
+
function st({
|
|
1415
1726
|
onClose: e,
|
|
1416
|
-
entries:
|
|
1727
|
+
entries: t,
|
|
1417
1728
|
onSelectEntry: r,
|
|
1418
|
-
className:
|
|
1419
|
-
size:
|
|
1729
|
+
className: i,
|
|
1730
|
+
size: o
|
|
1420
1731
|
}) {
|
|
1421
|
-
const [
|
|
1422
|
-
switch (
|
|
1732
|
+
const [a] = E("history"), s = () => {
|
|
1733
|
+
switch (a) {
|
|
1423
1734
|
case "history":
|
|
1424
|
-
return /* @__PURE__ */
|
|
1425
|
-
|
|
1735
|
+
return /* @__PURE__ */ n(
|
|
1736
|
+
qe,
|
|
1426
1737
|
{
|
|
1427
|
-
...
|
|
1738
|
+
...t && { entries: t },
|
|
1428
1739
|
...r && { onSelectEntry: r }
|
|
1429
1740
|
}
|
|
1430
1741
|
);
|
|
1431
1742
|
}
|
|
1432
1743
|
};
|
|
1433
|
-
return /* @__PURE__ */
|
|
1434
|
-
|
|
1744
|
+
return /* @__PURE__ */ n(
|
|
1745
|
+
g2,
|
|
1435
1746
|
{
|
|
1436
|
-
...
|
|
1437
|
-
...
|
|
1438
|
-
topNav: /* @__PURE__ */
|
|
1439
|
-
children:
|
|
1747
|
+
...i && { className: i },
|
|
1748
|
+
...o && { size: o },
|
|
1749
|
+
topNav: /* @__PURE__ */ n(z2, { title: Ke[a], onRightButtonClick: e }),
|
|
1750
|
+
children: s()
|
|
1440
1751
|
}
|
|
1441
1752
|
);
|
|
1442
1753
|
}
|
|
1754
|
+
const b2 = "WALLETCONNECT_DEEPLINK_CHOICE", l2 = /* @__PURE__ */ new WeakSet();
|
|
1755
|
+
function d2(e) {
|
|
1756
|
+
var i, o, a;
|
|
1757
|
+
const t = (o = (i = e.session) == null ? void 0 : i.peer) == null ? void 0 : o.metadata, r = (a = t == null ? void 0 : t.redirect) == null ? void 0 : a.native;
|
|
1758
|
+
if (!r || !x2()) {
|
|
1759
|
+
k2();
|
|
1760
|
+
return;
|
|
1761
|
+
}
|
|
1762
|
+
try {
|
|
1763
|
+
localStorage.setItem(
|
|
1764
|
+
b2,
|
|
1765
|
+
JSON.stringify({ href: r, name: (t == null ? void 0 : t.name) ?? "" })
|
|
1766
|
+
);
|
|
1767
|
+
} catch {
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
function k2() {
|
|
1771
|
+
try {
|
|
1772
|
+
localStorage.removeItem(b2);
|
|
1773
|
+
} catch {
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
function Je(e) {
|
|
1777
|
+
l2.has(e) || (l2.add(e), e.on("connect", () => d2(e)), e.on("disconnect", k2), e.session && d2(e));
|
|
1778
|
+
}
|
|
1779
|
+
function lt(e) {
|
|
1780
|
+
if (!e.projectId)
|
|
1781
|
+
throw new Error("zeroDevWalletConnect requires a WalletConnect projectId");
|
|
1782
|
+
const t = K2({ ...e, showQrModal: !1 });
|
|
1783
|
+
return (r) => {
|
|
1784
|
+
const i = Object.assign(t(r), { zdWalletConnect: !0 }), o = i.getProvider.bind(i);
|
|
1785
|
+
return i.getProvider = async (...a) => {
|
|
1786
|
+
const s = await o(...a);
|
|
1787
|
+
return Je(s), s;
|
|
1788
|
+
}, i;
|
|
1789
|
+
};
|
|
1790
|
+
}
|
|
1443
1791
|
export {
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1792
|
+
rt as ConnectWallet,
|
|
1793
|
+
be as SignUp,
|
|
1794
|
+
st as TxHistory,
|
|
1795
|
+
S as useAuth,
|
|
1796
|
+
ot as useWalletInfo,
|
|
1797
|
+
at as zeroDevWallet,
|
|
1798
|
+
lt as zeroDevWalletConnect
|
|
1449
1799
|
};
|
|
1450
1800
|
//# sourceMappingURL=index.mjs.map
|