@zerodev/wallet-react-ui 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_types/history/components/TxHistoryItem/index.d.ts +21 -0
- package/dist/_types/history/components/TxHistoryItem/index.d.ts.map +1 -0
- package/dist/_types/history/mocks.d.ts +8 -0
- package/dist/_types/history/mocks.d.ts.map +1 -0
- package/dist/_types/history/pages/History.d.ts +10 -0
- package/dist/_types/history/pages/History.d.ts.map +1 -0
- package/dist/_types/history/pages/index.d.ts +24 -0
- package/dist/_types/history/pages/index.d.ts.map +1 -0
- package/dist/_types/history/types.d.ts +29 -0
- package/dist/_types/history/types.d.ts.map +1 -0
- package/dist/_types/history/utils/groupByDay.d.ts +13 -0
- package/dist/_types/history/utils/groupByDay.d.ts.map +1 -0
- package/dist/_types/index.d.ts +2 -0
- package/dist/_types/index.d.ts.map +1 -1
- package/dist/_types/shared/components/TokenSummary/index.d.ts +18 -0
- package/dist/_types/shared/components/TokenSummary/index.d.ts.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +721 -471
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +4 -4
- package/src/history/components/TxHistoryItem/index.tsx +108 -0
- package/src/history/mocks.ts +80 -0
- package/src/history/pages/History.tsx +69 -0
- package/src/history/pages/index.tsx +69 -0
- package/src/history/types.ts +29 -0
- package/src/history/utils/groupByDay.ts +47 -0
- package/src/index.ts +8 -0
- package/src/shared/components/TokenSummary/index.tsx +50 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type IconName } from '@zerodev/react-ui';
|
|
2
|
+
export type TxHistoryStatus = 'Pending' | 'Success' | 'Failed';
|
|
3
|
+
export interface TxHistoryItemProps {
|
|
4
|
+
/** Leading glyph for the activity kind, e.g. `'arrowSwapHorizontalOutline'`
|
|
5
|
+
* for swaps, `'lighting'` for staking/yield, `'imageFill'` for NFTs. */
|
|
6
|
+
icon: IconName;
|
|
7
|
+
/** Activity label, e.g. `"Swapped ETH → USD₮0"`. Never truncated. */
|
|
8
|
+
title: string;
|
|
9
|
+
/** Pre-formatted outcome, e.g. `"2,343 ETH"`. Truncates when long. */
|
|
10
|
+
value: string;
|
|
11
|
+
/** Chain the transaction ran on (source chain for cross-chain rows). */
|
|
12
|
+
chainName: string;
|
|
13
|
+
chainIconUrl?: string;
|
|
14
|
+
/** Destination chain. When present the row renders `chain → destChain`. */
|
|
15
|
+
destChainName?: string;
|
|
16
|
+
destChainIconUrl?: string;
|
|
17
|
+
status: TxHistoryStatus;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function TxHistoryItem({ icon, title, value, chainName, chainIconUrl, destChainName, destChainIconUrl, status, className, }: TxHistoryItemProps): import("react").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/history/components/TxHistoryItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,QAAQ,EAAQ,MAAM,mBAAmB,CAAA;AAEjE,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAA;AAQ9D,MAAM,WAAW,kBAAkB;IACjC;4EACwE;IACxE,IAAI,EAAE,QAAQ,CAAA;IACd,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAA;IACb,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAA;IACb,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,MAAM,EAAE,eAAe,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,KAAK,EACL,KAAK,EACL,SAAS,EACT,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,MAAM,EACN,SAAS,GACV,EAAE,kBAAkB,+BAmDpB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TxHistoryEntry } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Placeholder feed mirroring the Figma history screen (`15873:58582`) until
|
|
4
|
+
* the real activity source lands. Timestamps are relative to module load:
|
|
5
|
+
* a "Today" section and an older fixed-looking section two weeks back.
|
|
6
|
+
*/
|
|
7
|
+
export declare const MOCK_HISTORY: TxHistoryEntry[];
|
|
8
|
+
//# sourceMappingURL=mocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mocks.d.ts","sourceRoot":"","sources":["../../../src/history/mocks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAS7C;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,cAAc,EAiExC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TxHistoryEntry } from '../types';
|
|
2
|
+
export interface HistoryProps {
|
|
3
|
+
/** Activity feed, newest anywhere (sorted internally). Defaults to the
|
|
4
|
+
* mock feed until the real activity source lands. */
|
|
5
|
+
entries?: TxHistoryEntry[];
|
|
6
|
+
/** Fired when a row is tapped. Rows are inert when omitted. */
|
|
7
|
+
onSelectEntry?: (entry: TxHistoryEntry) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function History({ entries, onSelectEntry, }: HistoryProps): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=History.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"History.d.ts","sourceRoot":"","sources":["../../../../src/history/pages/History.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAG9C,MAAM,WAAW,YAAY;IAC3B;yDACqD;IACrD,OAAO,CAAC,EAAE,cAAc,EAAE,CAAA;IAC1B,+DAA+D;IAC/D,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAA;CAChD;AAED,wBAAgB,OAAO,CAAC,EACtB,OAAsB,EACtB,aAAa,GACd,EAAE,YAAY,+BAiCd"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { TxHistoryEntry } from '../types';
|
|
2
|
+
/** Current page within the history flow. Single page for now — a
|
|
3
|
+
* transaction-details step slots in beside it later. */
|
|
4
|
+
export type TxHistoryStep = 'history';
|
|
5
|
+
export interface TxHistoryProps {
|
|
6
|
+
/** Called when the top-right × close button is clicked. */
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
/** Activity feed; defaults to the mock feed until a real source lands. */
|
|
9
|
+
entries?: TxHistoryEntry[] | undefined;
|
|
10
|
+
/** Fired when a row is tapped. Rows are inert when omitted. */
|
|
11
|
+
onSelectEntry?: ((entry: TxHistoryEntry) => void) | undefined;
|
|
12
|
+
className?: string | undefined;
|
|
13
|
+
size?: 'sm' | 'md' | 'lg' | undefined;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Transaction history widget.
|
|
17
|
+
*
|
|
18
|
+
* Owns the shared `Screen` + `TopNav` chrome and delegates the body to the
|
|
19
|
+
* current page in this directory — mirrors the layout of
|
|
20
|
+
* `smart-routing-address-react-ui`'s `pages/index.tsx`. Navigation is owned
|
|
21
|
+
* here: pages get callbacks, never the step setter.
|
|
22
|
+
*/
|
|
23
|
+
export declare function TxHistory({ onClose, entries, onSelectEntry, className, size, }: TxHistoryProps): import("react").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/history/pages/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAG9C;wDACwD;AACxD,MAAM,MAAM,aAAa,GAAG,SAAS,CAAA;AAMrC,MAAM,WAAW,cAAc;IAC7B,2DAA2D;IAC3D,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,cAAc,EAAE,GAAG,SAAS,CAAA;IACtC,+DAA+D;IAC/D,aAAa,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC,GAAG,SAAS,CAAA;IAC7D,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAA;CACtC;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,EACxB,OAAO,EACP,OAAO,EACP,aAAa,EACb,SAAS,EACT,IAAI,GACL,EAAE,cAAc,+BA8BhB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { IconName } from '@zerodev/react-ui';
|
|
2
|
+
import type { TxHistoryStatus } from './components/TxHistoryItem';
|
|
3
|
+
/**
|
|
4
|
+
* One row of the history feed, presentation-ready. This is the mock-stage
|
|
5
|
+
* shape: display strings are pre-built and only `timestamp` is raw (day
|
|
6
|
+
* grouping is a relationship with "now", so it can't be pre-formatted).
|
|
7
|
+
* When the real activity source lands, its domain model maps into this via
|
|
8
|
+
* a `toTxHistoryEntry`-style adapter rather than reshaping the components.
|
|
9
|
+
*/
|
|
10
|
+
export interface TxHistoryEntry {
|
|
11
|
+
/** Stable key — backend id, or `${txHash}-${logIndex}` when derived. */
|
|
12
|
+
id: string;
|
|
13
|
+
/** Leading glyph for the activity kind. */
|
|
14
|
+
icon: IconName;
|
|
15
|
+
/** Row title, e.g. `"Swapped ETH → USD₮0"`. */
|
|
16
|
+
title: string;
|
|
17
|
+
/** Trailing amount/outcome, e.g. `"2,343 ETH"`. */
|
|
18
|
+
value: string;
|
|
19
|
+
/** Chain the activity ran on (source side for cross-chain rows). */
|
|
20
|
+
chainName: string;
|
|
21
|
+
chainIconUrl?: string;
|
|
22
|
+
/** Destination chain — cross-chain rows only. */
|
|
23
|
+
destChainName?: string;
|
|
24
|
+
destChainIconUrl?: string;
|
|
25
|
+
status: TxHistoryStatus;
|
|
26
|
+
/** Unix epoch milliseconds — drives sorting and day grouping. */
|
|
27
|
+
timestamp: number;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/history/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAEjE;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAA;IACV,2CAA2C;IAC3C,IAAI,EAAE,QAAQ,CAAA;IACd,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAA;IACb,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAA;IACb,oEAAoE;IACpE,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,MAAM,EAAE,eAAe,CAAA;IACvB,iEAAiE;IACjE,SAAS,EAAE,MAAM,CAAA;CAClB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TxHistoryEntry } from '../types';
|
|
2
|
+
export interface DayGroup {
|
|
3
|
+
/** Section header: "Today", "Yesterday", or e.g. "August 12, 2025". */
|
|
4
|
+
label: string;
|
|
5
|
+
entries: TxHistoryEntry[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Newest-first entries bucketed by local calendar day, ready to render as
|
|
9
|
+
* header + rows sections. `now` is injectable so tests (and midnight
|
|
10
|
+
* boundaries) are deterministic.
|
|
11
|
+
*/
|
|
12
|
+
export declare function groupByDay(entries: TxHistoryEntry[], now?: number): DayGroup[];
|
|
13
|
+
//# sourceMappingURL=groupByDay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groupByDay.d.ts","sourceRoot":"","sources":["../../../../src/history/utils/groupByDay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,MAAM,WAAW,QAAQ;IACvB,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,cAAc,EAAE,CAAA;CAC1B;AAmBD;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,cAAc,EAAE,EACzB,GAAG,GAAE,MAAmB,GACvB,QAAQ,EAAE,CAaZ"}
|
package/dist/_types/index.d.ts
CHANGED
|
@@ -9,4 +9,6 @@ export type { AuthMethod, AuthStep, EmailAuthMethod } from './auth/types';
|
|
|
9
9
|
export type { WalletId } from './auth/walletGuide';
|
|
10
10
|
export type { ZeroDevKitConnectorParams, } from './connector.js';
|
|
11
11
|
export { zeroDevWallet } from './connector.js';
|
|
12
|
+
export { TxHistory, type TxHistoryProps, type TxHistoryStep, } from './history/pages';
|
|
13
|
+
export type { TxHistoryEntry } from './history/types';
|
|
12
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACzE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAGlD,YAAY,EAEV,yBAAyB,GAC1B,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACzE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAGlD,YAAY,EAEV,yBAAyB,GAC1B,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAG9C,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,aAAa,GACnB,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface TokenSummaryProps {
|
|
2
|
+
/** Token logo URL, shown in the tile floating over the card's top edge.
|
|
3
|
+
* The tile renders empty (neutral background) when omitted. */
|
|
4
|
+
tokenLogoUrl?: string;
|
|
5
|
+
/** Pre-formatted fiat value, e.g. `"+$170.27"`. */
|
|
6
|
+
fiatValue: string;
|
|
7
|
+
/** Pre-formatted token amount, e.g. `"0.0652 ETH"`. */
|
|
8
|
+
cryptoAmount: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Portfolio-value hero (Figma "Portfolio Value", `15873:58532`): a card
|
|
13
|
+
* headed by a token logo tile that overhangs the top edge, with the fiat
|
|
14
|
+
* value large and the crypto amount beneath. The overhang headroom is part
|
|
15
|
+
* of the component, so consumers can stack it without clipping the tile.
|
|
16
|
+
*/
|
|
17
|
+
export declare function TokenSummary({ tokenLogoUrl, fiatValue, cryptoAmount, className, }: TokenSummaryProps): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/components/TokenSummary/index.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IAChC;mEAC+D;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAA;IACjB,uDAAuD;IACvD,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAC3B,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,SAAS,GACV,EAAE,iBAAiB,+BAyBnB"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("@zerodev/react-ui"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("@zerodev/react-ui"),h=require("react"),k=require("zustand"),A=require("wagmi"),E=require("@zerodev/wallet-react"),X=require("zustand/middleware"),Q=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/error.webp").href:new URL("error.webp",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),e2=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/loading.webp").href:new URL("loading.webp",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),t2=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/send.webp").href:new URL("send.webp",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),n2=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/success.webp").href:new URL("success.webp",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),s2={error:Q,loading:e2,send:t2,success:n2};function j({imageName:t,title:n,children:r,className:i}){return e.jsxs("div",{className:a.cn("zd:flex zd:flex-col zd:gap-8 zd:items-center",i),children:[e.jsx("img",{src:s2[t],alt:t,className:"zd:w-[118px] zd:h-[118px] zd:bg-transparent"}),e.jsxs("div",{className:"zd:flex zd:flex-col zd:gap-4 zd:items-center",children:[e.jsx(a.Text,{className:"zd:text-h2 zd:text-center zd:whitespace-pre-wrap",children:n}),e.jsx(a.Text,{className:"zd:text-center zd:whitespace-pre-wrap",children:r})]})]})}function i2(){const n=A.useConfig().connectors.find(r=>r.id==="zerodev-wallet");if(!n||!("getKitStore"in n))throw new Error("useKitStore must be used with the zeroDevWallet connector");return n.getKitStore()}function C(){const t=i2(),n=k.useStore(t,l=>l.auth.step),r=k.useStore(t,l=>l.auth.stepHistory),i=k.useStore(t,l=>l.auth.email),s=k.useStore(t,l=>l.auth.otpId),o=k.useStore(t,l=>l.auth.otpEncryptionTargetBundle);return{step:n,email:i,otpId:s,otpEncryptionTargetBundle:o,goToStep:t.getState().auth.goToStep,goBack:r.length>0?t.getState().auth.goBack:null,reset:t.getState().auth.reset,setEmail:t.getState().auth.setEmail,setOtpSession:t.getState().auth.setOtpSession,clearOtpSession:t.getState().auth.clearOtpSession}}function r2(){const{email:t,setOtpSession:n}=C(),{mutateAsync:r,isPending:i}=E.useSendMagicLink(),[s,o]=h.useState(60),l=s<=0&&!i;h.useEffect(()=>{if(s<=0)return;const p=setInterval(()=>{o(g=>Math.max(0,g-1))},1e3);return()=>{clearInterval(p)}},[s]);const d=async()=>{if(!(!t||!l))try{const{otpId:p,otpEncryptionTargetBundle:g}=await r({email:t});n({otpId:p,otpEncryptionTargetBundle:g}),o(60)}catch{}};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center",children:[e.jsxs(j,{imageName:"send",title:`Check your email!
|
|
2
2
|
An Email is On Its Way`,children:["We've sent a magic link to"," ",e.jsx(a.Text,{as:"span",className:"zd:text-solarOrange",children:t}),`
|
|
3
|
-
`,"Please open the email and click the link to log in."]}),e.jsx("div",{className:"zd:flex zd:flex-col zd:gap-1",children:e.jsxs(a.Text,{className:"zd:text-center",children:["Did not get an email?"," ",e.jsx("button",{type:"button",disabled:!l,onClick:u,className:"zd:cursor-pointer zd:underline zd:disabled:opacity-50 zd:disabled:cursor-not-allowed",children:l?"Resend":`Resend in ${s} ${s===1?"second":"seconds"}`})]})})]}),e.jsx(a.PoweredBy,{className:"zd:self-center zd:pt-4 zd:pb-6"})]})}function e2(){return typeof window>"u"?!1:new URLSearchParams(window.location.search).has("code")}function T(){if(typeof window>"u")return;const t=new URL(window.location.href);t.searchParams.has("code")&&(t.searchParams.delete("code"),window.history.replaceState(null,"",t.toString()))}function t2({title:t="Oops, something went wrong",message:n="We couldn't complete the sign-in process. This could be due to timeout, an expired link, or a cancelled request.",showRetry:i=!1,showChooseAnother:r=!0}){const{goToStep:s,goBack:o,reset:l}=w(),u=o??(()=>s("sign-up"));return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center",children:[e.jsx(v,{imageName:"error",title:t,children:n}),e.jsxs("div",{className:"zd:flex zd:flex-col zd:gap-1",children:[i&&e.jsx(a.Button,{action:"primary",text:"Try again",onClick:u}),r&&e.jsx(a.Button,{action:i?"secondary":"primary",onClick:()=>{T(),s("sign-up")},text:"Choose another sign-in method"}),!i&&!r&&e.jsx(a.Button,{action:"primary",text:"Start over",onClick:l})]})]}),e.jsx(a.PoweredBy,{className:"zd:self-center zd:pt-4 zd:pb-6"})]})}const n2=4,s2=8,r2=6;function i2(t){return Math.max(n2,Math.min(s2,t))}function a2({char:t,isFocused:n}){return e.jsx(a.Wrapper,{"data-testid":"code-input-box","data-active":n||void 0,className:a.cn("zd:h-16 zd:w-14 zd:rounded-lg zd:flex zd:items-center zd:justify-center",n&&"zd:border-[1.5px] zd:border-greyScale"),children:e.jsx(a.Text,{className:"zd:text-h2",children:t})})}function o2({onChange:t,onComplete:n,disabled:i=!1,error:r=!1,autoFocus:s=!1,length:o=r2,"data-testid":l}){const u=i2(o),f=g.useMemo(()=>Array.from({length:u},(c,D)=>({id:`char-${D}`,index:D})),[u]),[m,x]=g.useState(""),[C,p]=g.useState(!1),d=g.useRef(null);g.useEffect(()=>{var c;s&&!i&&((c=d.current)==null||c.focus())},[s,i]),g.useEffect(()=>{x(c=>c.slice(0,u))},[u]);const h=c=>{const D=c.slice(0,u).toUpperCase();x(D),t==null||t(D),D.length===u&&setTimeout(()=>{var z;n==null||n(D),(z=d.current)==null||z.blur()},0)};return e.jsxs("button",{type:"button",className:"zd:flex zd:flex-row zd:items-center zd:justify-between zd:gap-2 zd:w-full zd:cursor-text",onClick:()=>{var c;return(c=d.current)==null?void 0:c.focus()},disabled:i,"data-testid":l,children:[e.jsx("input",{ref:d,value:m,onChange:c=>h(c.target.value),onFocus:()=>p(!0),onBlur:()=>p(!1),maxLength:u,disabled:i,className:"zd:absolute zd:opacity-0 zd:pointer-events-none",style:{position:"absolute",opacity:0},"aria-label":"Verification code"}),f.map(c=>e.jsx(a2,{char:m[c.index]??"",isFocused:!r&&C&&c.index===m.length},c.id))]})}function l2(){const{email:t,otpId:n,otpEncryptionTargetBundle:i,setOtpSession:r,clearOtpSession:s,goToStep:o}=w(),{mutateAsync:l,isPending:u}=E.useSendOTP(),{mutateAsync:f,isPending:m}=E.useVerifyOTP(),[x,C]=g.useState(""),[p,d]=g.useState(!1),[h,c]=g.useState(60);g.useEffect(()=>{if(h<=0)return;const y=setInterval(()=>{c(_=>Math.max(0,_-1))},1e3);return()=>clearInterval(y)},[h]);const D=async()=>{if(!(!x.trim()||!n||!i)){d(!1);try{await f({otpId:n,code:x.trim(),otpEncryptionTargetBundle:i}),s(),o("authenticated")}catch{d(!0)}}},z=y=>{C(y)},F=async()=>{if(!(!t||h>0||u))try{const{otpId:y,otpEncryptionTargetBundle:_}=await l({email:t});r({otpId:y,otpEncryptionTargetBundle:_}),c(60),d(!1)}catch{d(!0)}},S=h<=0&&!u;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center zd:items-center",children:[e.jsxs("div",{className:"zd:flex zd:flex-col zd:gap-4",children:[e.jsx(a.Text,{className:"zd:text-h2 zd:text-center",children:"Enter verification code"}),e.jsxs(a.Text,{className:"zd:text-center",children:["Enter the code from the email we sent to"," ",e.jsx(a.Text,{className:"zd:text-solarOrange",children:t})]})]}),e.jsx(o2,{onComplete:z,onChange:()=>d(!1),disabled:m,error:p,autoFocus:!0}),e.jsx(a.Button,{text:"Confirm code",onClick:D,disabled:!x.trim()||m}),e.jsx("div",{className:"zd:flex zd:flex-col zd:gap-1",children:e.jsxs(a.Text,{className:"zd:text-center",children:["Did not get an email?"," ",e.jsx("button",{type:"button",disabled:!S,onClick:F,className:"zd:cursor-pointer zd:underline zd:disabled:opacity-50 zd:disabled:cursor-not-allowed",children:S?"Resend":`Resend in ${h} ${h===1?"second":"seconds"}`})]})})]}),e.jsx(a.PoweredBy,{className:"zd:self-center zd:pt-4 zd:pb-6"})]})}function d2({termsAndConditionsUrl:t,privacyPolicyUrl:n,agreedToTerms:i,setAgreedToTerms:r,highlight:s=!1}){const o=!!(t||n);return e.jsxs("div",{className:"zd:flex zd:flex-col zd:items-center zd:gap-5",children:[o&&e.jsxs("div",{className:`zd:flex zd:flex-row zd:items-center zd:gap-2 zd:rounded-md zd:p-2 zd:transition-colors ${s?"zd:border zd:border-negative":"zd:border zd:border-transparent"}`,children:[e.jsx("input",{type:"checkbox",checked:i,onChange:l=>r(l.target.checked),className:"zd:cursor-pointer zd:[color-scheme:light]"}),e.jsxs(a.Text,{className:"zd:flex-1",children:["I agree to the"," ",t&&e.jsx(a.Text,{as:"a",href:t,target:"_blank",rel:"noopener noreferrer",className:"zd:underline",children:"Terms & Conditions"}),t&&n&&" and ",n&&e.jsx(a.Text,{as:"a",href:n,target:"_blank",rel:"noopener noreferrer",className:"zd:underline",children:"Privacy Policy"})]})]}),e.jsx(a.PoweredBy,{})]})}const c2=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/blob.webm").href:new URL("blob.webm",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href);function u2({className:t}){return e.jsx("video",{className:t,style:{aspectRatio:"1 / 1"},src:c2,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,"aria-hidden":"true",tabIndex:-1})}const R=g.createContext(null);function b(){const t=g.useContext(R);if(!t)throw new Error("SignUp.* components must be rendered inside <SignUp>");return t}function k(t){const{setAuthPending:n}=b();g.useEffect(()=>(n(t),()=>n(!1)),[t,n])}const p2=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function I(t){return p2.test(t.trim())}function O(){const{goToStep:t,setEmail:n,setOtpSession:i}=w(),{authPending:r,emailAuthMethod:s,needsAgreement:o,guardAgreement:l,setError:u}=b(),[f,m]=g.useState(""),x=s==="otp",{mutateAsync:C,isPending:p}=E.useSendOTP(),{mutateAsync:d,isPending:h}=E.useSendMagicLink(),c=p||h;k(c);const D=async()=>{if(!(!f||r)&&I(f)&&l()){u(null);try{const z=x?C:d,{otpId:F,otpEncryptionTargetBundle:S}=await z({email:f});n(f),i({otpId:F,otpEncryptionTargetBundle:S}),t(x?"otp-input":"email-verification")}catch(z){u(z instanceof Error?z.message:"Failed to send verification code")}}};return e.jsx(a.Input,{iconName:"email",placeholder:"Enter your email",value:f,onChange:z=>m(z.target.value),type:"email",autoCapitalize:"none",autoComplete:"email",disabled:r,variant:"listItemStyle",onKeyDown:z=>{z.key==="Enter"&&f&&!r&&D()},children:c?e.jsx("div",{className:"zd:w-13 zd:h-13 zd:flex zd:items-center zd:justify-center",children:e.jsx("div",{className:"zd:w-5 zd:h-5 zd:border-2 zd:border-solarOrange zd:border-t-transparent zd:rounded-full zd:animate-spin"})}):e.jsx("button",{type:"button",disabled:!I(f)||o,className:`zd:w-13 zd:h-13 zd:rounded-2xl zd:flex zd:items-center zd:justify-center zd:transition-colors ${I(f)&&!o?"zd:cursor-pointer":"zd:cursor-not-allowed zd:opacity-50"}`,onClick:()=>D(),children:e.jsx(a.Icon,{name:"chevronRight",className:"zd:text-greyScale"})})})}function U(t){return t instanceof Error?t.name==="AbortError"||t.name==="NotAllowedError"||t.name==="UserRejectedRequestError"?!0:t.message.toLowerCase().includes("oauth popup was closed"):!1}function B(){const{goToStep:t}=w(),{authPending:n,guardAgreement:i,setError:r}=b(),{mutateAsync:s,isPending:o}=E.useAuthenticateOAuth({mutation:{onSuccess:()=>{t("authenticated")}}});k(o);const l=async()=>{if(!n&&i()){r(null);try{await s({provider:"google"})}catch(u){U(u)||r(u instanceof Error?u.message:String(u))}}};return e.jsx(a.ListItem,{icon:e.jsx(a.ListItemIcon,{name:"google"}),title:"Google",trailing:e.jsx(a.ListItemChevron,{}),disabled:n,onClick:l})}function L(t,n){return!!n.rdns&&(t.id===n.rdns||(Array.isArray(t.rdns)?t.rdns.includes(n.rdns):t.rdns===n.rdns))}const f2=[{id:"metamask",name:"MetaMask",rdns:"io.metamask",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22none%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cg%20clip-path%3D%22url(%23a)%22%3E%3Cpath%20fill%3D%22%23ff5c16%22%20d%3D%22m24.024%2023.824-4.846-1.434-3.655%202.172-2.55-.001-3.656-2.171-4.844%201.434L3%2018.88l1.473-5.488L3%208.751%204.473%203l7.569%204.496h4.413L24.024%203l1.473%205.751-1.473%204.64%201.473%205.488z%22%2F%3E%3Cpath%20fill%3D%22%23ff5c16%22%20d%3D%22m4.474%203%207.57%204.499-.302%203.087zm4.844%2015.881%203.33%202.522-3.33.987zm3.064-4.17-.64-4.123-4.097%202.804h-.002v.001l.013%202.886%201.661-1.567zM24.024%203l-7.57%204.499.3%203.087zM19.18%2018.881l-3.33%202.522%203.33.987zm1.674-5.488v-.002zl-4.097-2.804-.64%204.124h3.064l1.662%201.567z%22%2F%3E%3Cpath%20fill%3D%22%23e34807%22%20d%3D%22m9.317%2022.39-4.844%201.434L3%2018.881h6.317zm3.064-7.68.925%205.962-1.282-3.315-4.37-1.078%201.662-1.568zm6.799%207.68%204.844%201.434%201.473-4.943H19.18zm-3.064-7.68-.925%205.962%201.282-3.315%204.37-1.078-1.663-1.568z%22%2F%3E%3Cpath%20fill%3D%22%23ff8d5d%22%20d%3D%22m3%2018.88%201.473-5.489h3.169l.012%202.887%204.37%201.078%201.282%203.314-.659.73-3.33-2.522H3zm22.497%200-1.473-5.489h-3.17l-.01%202.887-4.371%201.078-1.282%203.314.659.73%203.33-2.522h6.317zM16.455%207.495h-4.413l-.3%203.087%201.565%2010.084h1.884l1.565-10.084z%22%2F%3E%3Cpath%20fill%3D%22%23661800%22%20d%3D%22M4.473%203%203%208.751l1.473%204.64h3.169l4.1-2.805zm6.992%2012.908H10.03l-.781.761%202.776.685-.56-1.447M24.024%203l1.473%205.751-1.473%204.64h-3.17l-4.098-2.805zm-6.99%2012.908h1.437l.782.762-2.78.686.56-1.45zm-1.512%206.687.328-1.193-.66-.73h-1.885l-.659.73.327%201.192%22%2F%3E%3Cpath%20fill%3D%22%23c0c4cd%22%20d%3D%22M15.522%2022.594v1.969h-2.548v-1.969z%22%2F%3E%3Cpath%20fill%3D%22%23e7ebf6%22%20d%3D%22m9.318%2022.388%203.658%202.174v-1.969l-.328-1.192zm9.862%200-3.658%202.174v-1.969l.328-1.192z%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22a%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M3%203h22.5v21.563H3z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",mobileLink:"https://metamask.app.link/wc?uri=",downloadUrl:"https://metamask.io/download"},{id:"trust",name:"Trust Wallet",rdns:"com.trustwallet.app",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20width%3D%2228%22%20height%3D%2228%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cpath%20fill%3D%22%230500FF%22%20d%3D%22M6%207.583%2013.53%205v17.882C8.15%2020.498%206%2015.928%206%2013.345V7.583Z%22%2F%3E%3Cpath%20fill%3D%22url(%23a)%22%20d%3D%22M22%207.583%2013.53%205v17.882c6.05-2.384%208.47-6.954%208.47-9.537V7.583Z%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22a%22%20x1%3D%2219.768%22%20x2%3D%2214.072%22%20y1%3D%223.753%22%20y2%3D%2222.853%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20offset%3D%22.02%22%20stop-color%3D%22%2300F%22%2F%3E%3Cstop%20offset%3D%22.08%22%20stop-color%3D%22%230094FF%22%2F%3E%3Cstop%20offset%3D%22.16%22%20stop-color%3D%22%2348FF91%22%2F%3E%3Cstop%20offset%3D%22.42%22%20stop-color%3D%22%230094FF%22%2F%3E%3Cstop%20offset%3D%22.68%22%20stop-color%3D%22%230038FF%22%2F%3E%3Cstop%20offset%3D%22.9%22%20stop-color%3D%22%230500FF%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",mobileLink:"trust://wc?uri=",downloadUrl:"https://trustwallet.com/download"},{id:"coinbase",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",icon:"data:image/svg+xml,%3Csvg%20width%3D%2228%22%20height%3D%2228%22%20viewBox%3D%220%200%2028%2028%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22%232C5FF6%22%2F%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M14%2023.8C19.4124%2023.8%2023.8%2019.4124%2023.8%2014C23.8%208.58761%2019.4124%204.2%2014%204.2C8.58761%204.2%204.2%208.58761%204.2%2014C4.2%2019.4124%208.58761%2023.8%2014%2023.8ZM11.55%2010.8C11.1358%2010.8%2010.8%2011.1358%2010.8%2011.55V16.45C10.8%2016.8642%2011.1358%2017.2%2011.55%2017.2H16.45C16.8642%2017.2%2017.2%2016.8642%2017.2%2016.45V11.55C17.2%2011.1358%2016.8642%2010.8%2016.45%2010.8H11.55Z%22%20fill%3D%22white%22%2F%3E%0A%3C%2Fsvg%3E",downloadUrl:"https://coinbase.com/wallet/downloads"},{id:"rainbow",name:"Rainbow",rdns:"me.rainbow",icon:"data:image/svg+xml,%3Csvg%20width%3D%22120%22%20height%3D%22120%22%20viewBox%3D%220%200%20120%20120%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20width%3D%22120%22%20height%3D%22120%22%20fill%3D%22url(%23paint0_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M20%2038H26C56.9279%2038%2082%2063.0721%2082%2094V100H94C97.3137%20100%20100%2097.3137%20100%2094C100%2053.1309%2066.8691%2020%2026%2020C22.6863%2020%2020%2022.6863%2020%2026V38Z%22%20fill%3D%22url(%23paint1_radial_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M84%2094H100C100%2097.3137%2097.3137%20100%2094%20100H84V94Z%22%20fill%3D%22url(%23paint2_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M26%2020L26%2036H20L20%2026C20%2022.6863%2022.6863%2020%2026%2020Z%22%20fill%3D%22url(%23paint3_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M20%2036H26C58.0325%2036%2084%2061.9675%2084%2094V100H66V94C66%2071.9086%2048.0914%2054%2026%2054H20V36Z%22%20fill%3D%22url(%23paint4_radial_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M68%2094H84V100H68V94Z%22%20fill%3D%22url(%23paint5_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M20%2052L20%2036L26%2036L26%2052H20Z%22%20fill%3D%22url(%23paint6_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M20%2062C20%2065.3137%2022.6863%2068%2026%2068C40.3594%2068%2052%2079.6406%2052%2094C52%2097.3137%2054.6863%20100%2058%20100H68V94C68%2070.804%2049.196%2052%2026%2052H20V62Z%22%20fill%3D%22url(%23paint7_radial_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M52%2094H68V100H58C54.6863%20100%2052%2097.3137%2052%2094Z%22%20fill%3D%22url(%23paint8_radial_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M26%2068C22.6863%2068%2020%2065.3137%2020%2062L20%2052L26%2052L26%2068Z%22%20fill%3D%22url(%23paint9_radial_62_329)%22%2F%3E%0A%3Cdefs%3E%0A%3ClinearGradient%20id%3D%22paint0_linear_62_329%22%20x1%3D%2260%22%20y1%3D%220%22%20x2%3D%2260%22%20y2%3D%22120%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23174299%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23001E59%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3CradialGradient%20id%3D%22paint1_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(26%2094)%20rotate(-90)%20scale(74)%22%3E%0A%3Cstop%20offset%3D%220.770277%22%20stop-color%3D%22%23FF4000%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238754C9%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3ClinearGradient%20id%3D%22paint2_linear_62_329%22%20x1%3D%2283%22%20y1%3D%2297%22%20x2%3D%22100%22%20y2%3D%2297%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23FF4000%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238754C9%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3ClinearGradient%20id%3D%22paint3_linear_62_329%22%20x1%3D%2223%22%20y1%3D%2220%22%20x2%3D%2223%22%20y2%3D%2237%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%238754C9%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF4000%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3CradialGradient%20id%3D%22paint4_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(26%2094)%20rotate(-90)%20scale(58)%22%3E%0A%3Cstop%20offset%3D%220.723929%22%20stop-color%3D%22%23FFF700%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3ClinearGradient%20id%3D%22paint5_linear_62_329%22%20x1%3D%2268%22%20y1%3D%2297%22%20x2%3D%2284%22%20y2%3D%2297%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23FFF700%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3ClinearGradient%20id%3D%22paint6_linear_62_329%22%20x1%3D%2223%22%20y1%3D%2252%22%20x2%3D%2223%22%20y2%3D%2236%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23FFF700%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3CradialGradient%20id%3D%22paint7_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(26%2094)%20rotate(-90)%20scale(42)%22%3E%0A%3Cstop%20offset%3D%220.59513%22%20stop-color%3D%22%2300AAFF%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3CradialGradient%20id%3D%22paint8_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(51%2097)%20scale(17%2045.3333)%22%3E%0A%3Cstop%20stop-color%3D%22%2300AAFF%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3CradialGradient%20id%3D%22paint9_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(23%2069)%20rotate(-90)%20scale(17%20322.37)%22%3E%0A%3Cstop%20stop-color%3D%22%2300AAFF%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E",mobileLink:"rainbow://wc?uri=",downloadUrl:"https://rainbow.download"},{id:"rabby",name:"Rabby Wallet",rdns:"io.rabby",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",downloadUrl:"https://rabby.io"},{id:"okx",name:"OKX Wallet",rdns:"com.okex.wallet",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%3Cpath%20fill%3D%22%23000%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20d%3D%22M10.819%205.556H5.93a.376.376%200%200%200-.375.375v4.888c0%20.207.168.375.375.375h4.888a.376.376%200%200%200%20.375-.376V5.932a.376.376%200%200%200-.376-.375Zm5.64%205.638h-4.886a.376.376%200%200%200-.376.376v4.887c0%20.208.168.376.376.376h4.887a.376.376%200%200%200%20.376-.375V11.57a.376.376%200%200%200-.376-.377Zm.75-5.638h4.887c.208%200%20.376.168.376.375v4.888a.376.376%200%200%201-.376.375H17.21a.376.376%200%200%201-.376-.376V5.933c0-.208.169-.376.376-.376Zm-6.39%2011.277H5.93a.376.376%200%200%200-.375.376v4.887c0%20.208.168.376.375.376h4.888a.376.376%200%200%200%20.375-.376V17.21a.376.376%200%200%200-.376-.376Zm6.39%200h4.887c.208%200%20.376.169.376.376v4.887a.376.376%200%200%201-.376.376H17.21a.376.376%200%200%201-.376-.376V17.21c0-.207.169-.376.376-.376Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E",mobileLink:"okex://main/wc?uri=",downloadUrl:"https://okx.com/download"},{id:"zerion",name:"Zerion",rdns:"io.zerion.wallet",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%3Cpath%20fill%3D%22%232962EF%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M6.073%207c-.48%200-.665.593-.262.841l10.073%206.074a.577.577%200%200%200%20.758-.139l4.43-5.814c.3-.404-.004-.962-.525-.962H6.073ZM21.904%2021c.48%200%20.67-.596.267-.844l-10.075-6.073a.569.569%200%200%200-.751.146l-4.437%205.813c-.301.404.012.958.534.958h14.462Z%22%2F%3E%3C%2Fsvg%3E",mobileLink:"zerion://wc?uri=",downloadUrl:"https://zerion.io"},{id:"uniswap",name:"Uniswap",rdns:"org.uniswap.app",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23FFD8EA%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cg%20fill%3D%22%23FF007A%22%20clip-path%3D%22url(%23a)%22%3E%3Cpath%20d%3D%22M9.635%206.068c-.255-.039-.266-.043-.145-.06.23-.035.773.012%201.148.099.874.202%201.67.722%202.519%201.646l.225.246.323-.051c1.36-.213%202.741-.044%203.899.477.319.144.821.43.882.503.022.024.058.173.082.335.086.557.044.982-.13%201.301-.096.173-.101.228-.037.377a.367.367%200%200%200%20.334.206c.287%200%20.597-.454.74-1.086l.056-.252.113.126c.62.685%201.106%201.618%201.189%202.282l.021.174-.103-.158a1.966%201.966%200%200%200-.59-.604c-.415-.268-.855-.36-2.017-.42-1.05-.053-1.645-.141-2.234-.329-1.003-.32-1.508-.744-2.699-2.27-.53-.678-.855-1.053-1.18-1.354-.74-.687-1.466-1.047-2.396-1.187v-.001Z%22%2F%3E%3Cpath%20d%3D%22M18.725%207.581c.026-.453.088-.753.216-1.026.028-.07.063-.136.104-.198a.69.69%200%200%201-.049.178c-.092.266-.108.629-.043%201.052.081.536.126.613.706%201.192.273.272.589.613.704.761l.21.267-.21-.191c-.255-.233-.841-.69-.972-.755-.086-.042-.1-.042-.153.01-.05.048-.06.12-.068.461-.01.532-.084.873-.263%201.213-.096.187-.111.147-.025-.062.066-.155.072-.224.072-.739%200-1.033-.127-1.283-.864-1.707a8.169%208.169%200%200%200-.684-.346%202.614%202.614%200%200%201-.334-.16c.02-.02.74.185%201.029.293.431.163.502.183.555.164.034-.013.051-.113.068-.407h.001Zm-8.595%201.77c-.517-.696-.838-1.764-.768-2.563l.02-.247.119.02c.222.04.603.179.783.286.49.29.703.673.918%201.657.064.288.147.613.185.725.061.178.294.592.483.862.136.194.046.286-.255.26-.46-.04-1.083-.46-1.485-1Zm7.965%205.182c-2.42-.95-3.273-1.777-3.273-3.17%200-.206.007-.374.016-.374.008%200%20.102.067.208.151.491.384%201.04.548%202.563.765.896.128%201.398.231%201.864.382%201.48.478%202.392%201.449%202.61%202.773.063.384.028%201.104-.076%201.484-.082.3-.329.84-.394.861-.019.007-.037-.061-.04-.154-.025-.496-.283-.98-.715-1.343-.49-.412-1.15-.741-2.763-1.375Zm-1.699.396a4.13%204.13%200%200%200-.117-.5l-.062-.18.115.127c.16.173.285.396.391.693.082.227.09.294.09.662%200%20.361-.011.437-.087.64-.104.3-.28.572-.51.794-.443.44-1.011.683-1.833.784-.142.018-.557.047-.922.066-.922.046-1.529.144-2.073.33a.446.446%200%200%201-.156.036c-.021-.021.35-.237.656-.381.431-.204.861-.315%201.825-.47.475-.078.968-.173%201.093-.21%201.178-.352%201.784-1.263%201.59-2.39Z%22%2F%3E%3Cpath%20d%3D%22M17.506%2016.855c-.321-.675-.396-1.327-.22-1.935.02-.067.05-.119.068-.119a.64.64%200%200%201%20.169.09c.149.097.445.261%201.237.682.988.527%201.553.934%201.936%201.4.335.407.542.872.643%201.438.057.32.023%201.093-.061%201.416-.266%201.018-.882%201.818-1.764%202.285a2.129%202.129%200%200%201-.258.124c-.013%200%20.035-.116.104-.259.297-.605.331-1.193.107-1.848-.138-.401-.418-.89-.982-1.718-.657-.96-.817-1.218-.979-1.556Zm-9.095%203.644c.9-.742%202.016-1.267%203.036-1.43a4.85%204.85%200%200%201%201.575.06c.652.163%201.235.528%201.538.962.296.425.423.794.556%201.618.052.324.109.651.125.724.1.427.293.768.532.939.38.272%201.037.29%201.682.044a.853.853%200%200%201%20.21-.064c.023.023-.301.235-.53.347-.27.141-.572.213-.879.208-.59%200-1.08-.294-1.49-.891a7.027%207.027%200%200%201-.402-.784c-.431-.961-.644-1.253-1.145-1.575-.437-.28-1-.329-1.424-.126-.556.266-.71.96-.312%201.4.187.189.43.313.695.354a.75.75%200%200%200%20.589-.174.728.728%200%200%200%20.251-.551c0-.29-.114-.453-.4-.581-.392-.172-.812.029-.81.388%200%20.153.069.249.226.32.1.044.103.046.02.03-.358-.073-.442-.496-.154-.776.347-.336%201.064-.188%201.31.272.103.194.115.578.025.81-.203.52-.79.793-1.387.644-.407-.102-.571-.211-1.06-.703-.852-.856-1.182-1.023-2.408-1.21l-.237-.035.268-.22Z%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20d%3D%22M4.418%205.179c2.842%203.368%204.8%204.757%205.017%205.05.18.243.112.462-.195.632a1.899%201.899%200%200%201-.699.191c-.2%200-.269-.075-.269-.075-.115-.106-.18-.088-.773-1.116A176.911%20176.911%200%200%200%205.968%207.56c-.044-.04-.042-.04%201.448%202.564.24.543.047.741.047.819%200%20.157-.044.24-.242.457-.332.36-.48.765-.587%201.604-.12.94-.456%201.604-1.39%202.741-.545.666-.635.787-.773%201.056-.174.338-.221.527-.24.952a2.9%202.9%200%200%200%20.16%201.174c.122.378.252.626.582%201.125.285.43.448.75.448.876%200%20.099.019.099.461.001%201.054-.232%201.91-.64%202.392-1.142.298-.311.367-.482.37-.907.002-.277-.008-.336-.085-.496-.125-.26-.353-.477-.855-.813-.66-.44-.942-.794-1.018-1.28-.065-.4.01-.682.373-1.427.377-.773.47-1.103.535-1.88.04-.503.096-.701.244-.861.155-.166.293-.222.676-.272.623-.084%201.018-.24%201.343-.534a1.14%201.14%200%200%200%20.421-.869l.014-.28-.16-.179C9.563%209.34%204.036%204.667%204%204.667c-.007%200%20.18.23.418.512Zm1.325%2013.086a.486.486%200%200%200-.157-.652c-.203-.133-.522-.069-.522.103%200%20.053.03.092.098.125.114.058.122.122.032.254s-.082.248.02.328c.168.126.404.057.529-.158ZM10.683%2012c-.29.086-.575.389-.664.706-.053.194-.022.534.058.638.13.169.255.213.596.212.665-.004%201.243-.283%201.311-.632.054-.286-.2-.68-.55-.855a1.33%201.33%200%200%200-.75-.07Zm.78.593c.102-.143.057-.296-.118-.4-.331-.199-.835-.035-.835.272%200%20.153.262.32.502.32.16%200%20.38-.093.45-.192Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22a%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M4%204h19v20H4z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",mobileLink:"uniswap://wc?uri=",downloadUrl:"https://wallet.uniswap.org"},{id:"ledger",name:"Ledger",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20d%3D%22M11.65%204.4H4.4V9h1.1V5.5l6.15-.04V4.4Zm.05%205.95v7.25h4.6v-1.1h-3.5l-.04-6.15H11.7ZM4.4%2023.6h7.25v-1.06L5.5%2022.5V19H4.4v4.6ZM16.35%204.4h7.25V9h-1.1V5.5l-6.15-.04V4.4Zm7.25%2019.2h-7.25v-1.06l6.15-.04V19h1.1v4.6Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E",mobileLink:"ledgerlive://wc?uri=",downloadUrl:"https://www.ledger.com/ledger-live"},{id:"binance",name:"Binance Wallet",rdns:"com.binance.wallet",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22130%22%20height%3D%22130%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M0%200h130v130H0z%22%2F%3E%3Cpath%20fill%3D%22%23F3BA2F%22%20d%3D%22M45.587%2057.02%2065.01%2037.606l19.43%2019.43%2011.295-11.303L65.01%2015%2034.284%2045.725zM15%2065.004l11.299-11.299%2011.298%2011.299L26.3%2076.302zM45.587%2072.983%2065.01%2092.406l19.43-19.43%2011.303%2011.287-.008.007-30.725%2030.734-30.725-30.718-.016-.016zM92.403%2065.006%20103.7%2053.708%20115%2065.006l-11.299%2011.299z%22%2F%3E%3Cpath%20fill%3D%22%23F3BA2F%22%20d%3D%22m76.471%2064.998-11.46-11.469-8.476%208.475-.98.972-2.005%202.006-.016.016.016.024%2011.46%2011.453%2011.461-11.47.008-.007z%22%2F%3E%3C%2Fsvg%3E",mobileLink:"bnc://app.binance.com/cedefi/wc?uri=",downloadUrl:"https://www.binance.com/en/download"}],j=f2;function h2({excludeWalletIds:t=[],maxWallets:n=4}){const{goToStep:i}=w(),{authPending:r,guardAgreement:s,setError:o,registeredWallets:l}=b(),u=A.useConnectors(),{mutate:f,isPending:m}=A.useConnect();k(m);const x=u.filter(p=>p.type==="injected"&&p.id!=="injected"&&p.id!=="zerodev-wallet").map(p=>{const d=j.find(h=>L(p,h));return{connector:p,walletId:d==null?void 0:d.id,name:(d==null?void 0:d.name)??p.name,icon:(d==null?void 0:d.icon)??p.icon,ids:d?[d.id,p.id]:[p.id],rank:d?j.indexOf(d):j.length}}).filter(p=>!(p.walletId&&l.includes(p.walletId))).filter(p=>!p.ids.some(d=>t.includes(d))).sort((p,d)=>p.rank-d.rank).slice(0,n),C=p=>{r||s()&&(o(null),f({connector:p},{onSuccess:()=>i(null),onError:d=>{U(d)||o(d instanceof Error?d.message:String(d))}}))};return e.jsx(e.Fragment,{children:x.map(({connector:p,name:d,icon:h})=>e.jsx(a.ListItem,{title:d,icon:h?e.jsx("img",{src:h,alt:"",className:"zd:w-6 zd:h-6"}):null,subtitle:e.jsx(a.Badge,{text:"INSTALLED"}),trailing:e.jsx(a.ListItemChevron,{}),disabled:r,onClick:()=>C(p)},p.uid))})}function m2({tile:t}){return e.jsxs("button",{type:"button",onClick:t.onSelect,className:"zd:flex zd:flex-col zd:items-center zd:gap-1.5 zd:cursor-pointer",children:[e.jsx("div",{className:"zd:w-16 zd:h-16 zd:rounded-2xl zd:bg-greyScale/5 zd:flex zd:items-center zd:justify-center",children:t.icon?e.jsx("img",{src:t.icon,alt:"",className:"zd:w-8 zd:h-8"}):e.jsx(a.Icon,{name:"walletOutline",className:"zd:w-8 zd:h-8 zd:text-greyScale"})}),e.jsx(a.Text,{className:"zd:text-body3 zd:max-w-full zd:truncate",children:t.name})]})}function g2({open:t,onOpenChange:n,tiles:i}){return e.jsx(a.BottomSheet,{open:t,onOpenChange:n,children:e.jsxs(a.BottomSheetContent,{className:"zd:p-4",children:[e.jsx(a.BottomSheetTitle,{children:"All wallets"}),e.jsxs("div",{className:"zd:mb-3 zd:flex zd:items-center zd:gap-2",children:[e.jsx(a.Text,{className:"zd:text-h3 zd:flex-1",children:"All wallets"}),e.jsx(a.BottomSheetClose,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"Close",className:"zd:cursor-pointer zd:px-2 zd:text-greyScale/60",children:"✕"})})]}),e.jsx("div",{className:"zd:grid zd:grid-cols-3 zd:gap-3 zd:max-h-80 zd:overflow-y-auto",children:i.map(r=>e.jsx(m2,{tile:r},r.key))})]})})}function x2({title:t="More wallets"}){const{goToStep:n}=w(),{authPending:i,guardAgreement:r,setError:s}=b(),[o,l]=g.useState(!1),u=A.useConnectors(),{mutate:f,isPending:m}=A.useConnect();k(m);const x=u.filter(c=>c.id!=="zerodev-wallet"&&c.type!=="walletConnect"),C=c=>{i||r()&&(l(!1),s(null),f({connector:c},{onSuccess:()=>n(null),onError:D=>{U(D)||s(D instanceof Error?D.message:String(D))}}))},p=j.map(c=>{const D=x.find(z=>L(z,c));return{key:c.id,name:c.name,icon:c.icon,onSelect:()=>{if(D){C(D);return}l(!1),window.open(c.downloadUrl,"_blank","noopener,noreferrer")}}}),d=x.filter(c=>!j.some(D=>L(c,D))).map(c=>({key:c.uid,name:c.name,icon:c.icon,onSelect:()=>C(c)})),h=()=>{i||r()&&l(!0)};return e.jsxs(e.Fragment,{children:[e.jsx(a.ListItem,{icon:e.jsx(a.ListItemIcon,{name:"walletOutline",className:"zd:w-5 zd:h-5"}),title:t,trailing:e.jsx(a.ListItemChevron,{}),disabled:i,onClick:h}),e.jsx(g2,{open:o,onOpenChange:l,tiles:[...p,...d]})]})}function H(){const{goToStep:t}=w(),{authPending:n,guardAgreement:i,setError:r}=b(),s={onSuccess:()=>{t("authenticated")},onError:x=>{U(x)||r(x instanceof Error?x.message:String(x))}},{mutate:o,isPending:l}=E.useRegisterPasskey({mutation:s}),{mutate:u,isPending:f}=E.useLoginPasskey({mutation:s});k(l||f);const m=x=>()=>{n||i()&&(r(null),x())};return e.jsxs(e.Fragment,{children:[e.jsx(a.Button,{action:"secondary",text:"Create a passkey",iconName:"key",trailIcon:!0,disabled:n,onClick:m(()=>o())}),e.jsx(a.Button,{action:"secondary",text:"Log in with passkey",iconName:"key",trailIcon:!0,disabled:n,onClick:m(()=>u())})]})}function D2({walletId:t}){const n=j.find(h=>h.id===t);if(!n)throw new Error(`Unknown walletId "${t}". Valid ids: ${j.map(h=>h.id).join(", ")}`);const{goToStep:i}=w(),{authPending:r,guardAgreement:s,setError:o,registerWallet:l}=b(),u=A.useConnectors(),{mutate:f,isPending:m}=A.useConnect();k(m),g.useLayoutEffect(()=>l(n.id),[l,n.id]);const x=u.find(h=>L(h,n)),C=!!n.rdns&&u.some(h=>h.id===n.rdns),p={title:n.name,icon:e.jsx("img",{src:n.icon,alt:"",className:"zd:w-6 zd:h-6"}),trailing:e.jsx(a.ListItemChevron,{})};if(!x)return e.jsx(a.ListItem,{...p,asChild:!0,children:e.jsx("a",{href:n.downloadUrl,target:"_blank",rel:"noopener noreferrer"})});const d=()=>{r||s()&&(o(null),f({connector:x},{onSuccess:()=>i(null),onError:h=>{U(h)||o(h instanceof Error?h.message:String(h))}}))};return e.jsx(a.ListItem,{...p,...C&&{subtitle:e.jsx(a.Badge,{text:"INSTALLED"})},disabled:r,onClick:d})}function Z({children:t,termsAndConditionsUrl:n,privacyPolicyUrl:i,emailAuthMethod:r="magicLink"}){const[s,o]=g.useState(!1),[l,u]=g.useState(!1),[f,m]=g.useState(null),[x,C]=g.useState(!1),[p,d]=g.useState([]),h=g.useCallback(F=>(d(S=>[...S,F]),()=>{d(S=>{const y=[...S];return y.splice(y.indexOf(F),1),y})}),[]),D=!!(n||i)&&!s,z=()=>D?(u(!0),!1):!0;return e.jsxs(R.Provider,{value:{authPending:x,emailAuthMethod:r,setAuthPending:C,needsAgreement:D,guardAgreement:z,setError:m,registeredWallets:p,registerWallet:h},children:[f!==null&&e.jsx("div",{className:"zd:flex zd:items-center zd:justify-center zd:h-full zd:min-h-100",children:e.jsxs("div",{className:"zd:flex zd:flex-col zd:gap-4 zd:max-w-md",children:[e.jsx(a.Text,{className:"zd:text-h2 zd:text-center",children:"Error occurred"}),e.jsx(a.Text,{className:"zd:text-center zd:text-red-500",children:f}),e.jsx(a.Button,{action:"primary",text:"Try again",onClick:()=>m(null)})]})}),e.jsxs("div",{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${f!==null?" zd:hidden":""}`,children:[e.jsxs("div",{className:"zd:flex-1 zd:flex zd:flex-col zd:justify-center",children:[e.jsxs("div",{className:"zd:px-4 zd:flex zd:flex-col zd:items-center",children:[e.jsx("div",{className:"zd:w-full zd:px-16 zd:py-4",children:e.jsx(u2,{className:"zd:w-full zd:pointer-events-none zd:select-none"})}),e.jsx(a.Text,{className:"zd:text-h2 zd:text-center",children:"Continue to your wallet"}),e.jsx(a.Text,{className:"zd:mt-2 zd:text-center zd:text-greyScale/50",children:"Choose a sign-in method to proceed"})]}),e.jsx("div",{className:"zd:mt-6 zd:mb-4 zd:px-4 zd:flex zd:flex-col zd:gap-2",children:t})]}),e.jsx("div",{className:"zd:px-4",children:e.jsx(d2,{termsAndConditionsUrl:n,privacyPolicyUrl:i,agreedToTerms:s,setAgreedToTerms:F=>{o(F),F&&u(!1)},highlight:l})})]})]})}function G({label:t="or"}){return e.jsxs("div",{className:"zd:-mx-4 zd:my-2 zd:flex zd:items-center zd:gap-3",children:[e.jsx("div",{className:"zd:h-px zd:flex-1 zd:bg-greyScale/30"}),e.jsx(a.Text,{className:"zd:text-body3",children:t}),e.jsx("div",{className:"zd:h-px zd:flex-1 zd:bg-greyScale/30"})]})}function z2(t){return e.jsxs(Z,{...t,children:[e.jsx(H,{}),e.jsx(G,{}),e.jsx(B,{}),e.jsx(O,{})]})}const V=Object.assign(Z,{Default:z2,Passkey:H,Google:B,Email:O,Wallet:D2,InstalledWallets:h2,MoreWallets:x2,Divider:G});function C2(){return typeof window>"u"?null:new URLSearchParams(window.location.search).get("code")}function w2(){const{otpId:t,otpEncryptionTargetBundle:n,goToStep:i,clearOtpSession:r}=w(),[s]=g.useState(C2),[o,l]=g.useState(null),u=g.useRef(!1),{mutate:f,isPending:m}=E.useVerifyMagicLink({mutation:{onSuccess:()=>{r(),i("authenticated")},onError:x=>{l(x)}}});return g.useEffect(()=>{if(!(u.current||!s)){if(u.current=!0,!t||!n){T(),i(null);return}f({otpId:t,code:s,otpEncryptionTargetBundle:n})}},[t,n,s,f,i]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center",children:[!o&&m&&e.jsx(v,{imageName:"loading",title:"Verifying Your Email",children:"Please wait while we securely connect your wallet."}),!o&&!s&&!m&&e.jsxs(e.Fragment,{children:[e.jsxs(v,{imageName:"error",title:"Invalid Link",children:["This verification link is invalid or incomplete.",e.jsx("br",{}),"Please check your email and try again with the correct link."]}),e.jsx(a.Button,{action:"primary",onClick:()=>{T(),i("sign-up")},text:"Choose another sign-in method"})]}),o!=null&&e.jsxs(e.Fragment,{children:[e.jsx(v,{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."}),e.jsx(a.Button,{action:"primary",onClick:()=>{T(),i("sign-up")},text:"Choose another sign-in method"})]})]}),e.jsx(a.PoweredBy,{className:"zd:self-center zd:pt-4 zd:pb-6"})]})}function E2(){return e.jsx("div",{className:"zd:flex zd:flex-1 zd:items-center zd:justify-center",children:e.jsx(v,{imageName:"loading",title:"Authenticating...",children:"Please wait while we complete the OAuth authentication."})})}function F2(){return e.jsx("div",{className:"zd:flex zd:flex-1 zd:items-center zd:justify-center",children:e.jsx(v,{imageName:"loading",title:"Passkey authentication",children:"Please authenticate with your passkey."})})}function y2(t,n){switch(t){case"sign-up":return n?n():e.jsx(V.Default,{});case"email-verification":return e.jsx(Q,{});case"otp-input":return e.jsx(l2,{});case"verifying-otp":return e.jsx(w2,{});case"oauth-in-progress":return e.jsx(E2,{});case"passkey-prompt":return e.jsx(F2,{});case"error":return e.jsx(t2,{});default:return null}}function S2({onClose:t,size:n,renderSignUp:i,logo:r}={}){const{step:s,goToStep:o,goBack:l,reset:u}=w();g.useEffect(()=>{s===null&&e2()&&o("verifying-otp")},[s,o]);const f=y2(s,i);if(!f)return null;const m=()=>{T(),u(),t==null||t()};return e.jsx(a.Screen,{...n&&{size:n},className:s==="sign-up"?"zd:h-auto zd:max-h-202.5":void 0,topNav:e.jsx(a.TopNav,{...l!==null&&{onLeftButtonClick:l},onRightButtonClick:m,...s==="sign-up"&&{...r&&{logo:r},className:"zd:px-4"}}),children:f})}const M="zerodev:auth:otpSession";function v2(){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(M);if(!t)return null;const n=JSON.parse(t);return!(n!=null&&n.otpId)||!(n!=null&&n.otpEncryptionTargetBundle)?null:n}catch{return null}}function j2(t){if(!(typeof window>"u"))try{window.localStorage.setItem(M,JSON.stringify(t))}catch{}}function P(){if(!(typeof window>"u"))try{window.localStorage.removeItem(M)}catch{}}const A2=(t,n,i)=>({auth:{step:null,stepHistory:[],email:null,otpId:null,otpEncryptionTargetBundle:null,initialize:()=>{const r=v2();r&&t(s=>({auth:{...s.auth,otpId:r.otpId,otpEncryptionTargetBundle:r.otpEncryptionTargetBundle}}))},goToStep:r=>{t(s=>({auth:{...s.auth,step:r,stepHistory:s.auth.step===null?s.auth.stepHistory:[...s.auth.stepHistory,s.auth.step]}}))},goBack:()=>{const{auth:r}=n();if(r.stepHistory.length===0)return;const s=[...r.stepHistory],o=s.pop();t(l=>({auth:{...l.auth,step:o,stepHistory:s}}))},reset:()=>{P(),t(r=>({auth:{...r.auth,step:null,stepHistory:[],email:null,otpId:null,otpEncryptionTargetBundle:null}}))},setEmail:r=>{t(s=>({auth:{...s.auth,email:r}}))},setOtpSession:({otpId:r,otpEncryptionTargetBundle:s})=>{j2({otpId:r,otpEncryptionTargetBundle:s}),t(o=>({auth:{...o.auth,otpId:r,otpEncryptionTargetBundle:s}}))},clearOtpSession:()=>{P(),t(r=>({auth:{...r.auth,otpId:null,otpEncryptionTargetBundle:null}}))}}}),b2=()=>N.create()(W.subscribeWithSelector((t,n,i)=>({pendingRequests:[],userConfirmationListenerActive:!1,addPendingRequest:r=>t(s=>({pendingRequests:[...s.pendingRequests,r]})),removePendingRequest:r=>t(s=>({pendingRequests:s.pendingRequests.filter(o=>o.id!==r)})),clearPendingRequests:()=>t({pendingRequests:[]}),setUserConfirmationListenerActive:r=>t({userConfirmationListenerActive:r}),...A2(t,n)})));function N2(t){return new Promise((n,i)=>{const r=t.subscribe(s=>s.auth.step,s=>{s==="authenticated"?(r(),n()):s===null&&(r(),i(new Error("Auth flow dismissed")))})})}function k2(t){const n=E.zeroDevWallet(t),i=b2();return r=>{const s=n(r);return{...s,async connect(o){try{return await s.connect(o)}catch(l){if(o!=null&&o.isReconnecting||!(l instanceof E.NotAuthenticatedError))throw l;if(i.getState().auth.step!==null)throw new Error("Auth flow already in progress");return i.getState().auth.goToStep("sign-up"),await N2(i),s.connect(o)}},async disconnect(){var o;await((o=s.disconnect)==null?void 0:o.call(s)),i.getState().auth.reset()},async setup(){var o;await((o=s.setup)==null?void 0:o.call(s)),!(typeof window>"u")&&i.getState().auth.initialize()},getKitStore(){return i}}}}exports.ConnectWallet=S2;exports.SignUp=V;exports.useAuth=w;exports.zeroDevWallet=k2;
|
|
3
|
+
`,"Please open the email and click the link to log in."]}),e.jsx("div",{className:"zd:flex zd:flex-col zd:gap-1",children:e.jsxs(a.Text,{className:"zd:text-center",children:["Did not get an email?"," ",e.jsx("button",{type:"button",disabled:!l,onClick:d,className:"zd:cursor-pointer zd:underline zd:disabled:opacity-50 zd:disabled:cursor-not-allowed",children:l?"Resend":`Resend in ${s} ${s===1?"second":"seconds"}`})]})})]}),e.jsx(a.PoweredBy,{className:"zd:self-center zd:pt-4 zd:pb-6"})]})}function a2(){return typeof window>"u"?!1:new URLSearchParams(window.location.search).has("code")}function I(){if(typeof window>"u")return;const t=new URL(window.location.href);t.searchParams.has("code")&&(t.searchParams.delete("code"),window.history.replaceState(null,"",t.toString()))}function o2({title:t="Oops, something went wrong",message:n="We couldn't complete the sign-in process. This could be due to timeout, an expired link, or a cancelled request.",showRetry:r=!1,showChooseAnother:i=!0}){const{goToStep:s,goBack:o,reset:l}=C(),d=o??(()=>s("sign-up"));return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center",children:[e.jsx(j,{imageName:"error",title:t,children:n}),e.jsxs("div",{className:"zd:flex zd:flex-col zd:gap-1",children:[r&&e.jsx(a.Button,{action:"primary",text:"Try again",onClick:d}),i&&e.jsx(a.Button,{action:r?"secondary":"primary",onClick:()=>{I(),s("sign-up")},text:"Choose another sign-in method"}),!r&&!i&&e.jsx(a.Button,{action:"primary",text:"Start over",onClick:l})]})]}),e.jsx(a.PoweredBy,{className:"zd:self-center zd:pt-4 zd:pb-6"})]})}const l2=4,d2=8,c2=6;function u2(t){return Math.max(l2,Math.min(d2,t))}function p2({char:t,isFocused:n}){return e.jsx(a.Wrapper,{"data-testid":"code-input-box","data-active":n||void 0,className:a.cn("zd:h-16 zd:w-14 zd:rounded-lg zd:flex zd:items-center zd:justify-center",n&&"zd:border-[1.5px] zd:border-greyScale"),children:e.jsx(a.Text,{className:"zd:text-h2",children:t})})}function m2({onChange:t,onComplete:n,disabled:r=!1,error:i=!1,autoFocus:s=!1,length:o=c2,"data-testid":l}){const d=u2(o),p=h.useMemo(()=>Array.from({length:d},(u,z)=>({id:`char-${z}`,index:z})),[d]),[g,x]=h.useState(""),[w,m]=h.useState(!1),c=h.useRef(null);h.useEffect(()=>{var u;s&&!r&&((u=c.current)==null||u.focus())},[s,r]),h.useEffect(()=>{x(u=>u.slice(0,d))},[d]);const f=u=>{const z=u.slice(0,d).toUpperCase();x(z),t==null||t(z),z.length===d&&setTimeout(()=>{var D;n==null||n(z),(D=c.current)==null||D.blur()},0)};return e.jsxs("button",{type:"button",className:"zd:flex zd:flex-row zd:items-center zd:justify-between zd:gap-2 zd:w-full zd:cursor-text",onClick:()=>{var u;return(u=c.current)==null?void 0:u.focus()},disabled:r,"data-testid":l,children:[e.jsx("input",{ref:c,value:g,onChange:u=>f(u.target.value),onFocus:()=>m(!0),onBlur:()=>m(!1),maxLength:d,disabled:r,className:"zd:absolute zd:opacity-0 zd:pointer-events-none",style:{position:"absolute",opacity:0},"aria-label":"Verification code"}),p.map(u=>e.jsx(p2,{char:g[u.index]??"",isFocused:!i&&w&&u.index===g.length},u.id))]})}function f2(){const{email:t,otpId:n,otpEncryptionTargetBundle:r,setOtpSession:i,clearOtpSession:s,goToStep:o}=C(),{mutateAsync:l,isPending:d}=E.useSendOTP(),{mutateAsync:p,isPending:g}=E.useVerifyOTP(),[x,w]=h.useState(""),[m,c]=h.useState(!1),[f,u]=h.useState(60);h.useEffect(()=>{if(f<=0)return;const y=setInterval(()=>{u(M=>Math.max(0,M-1))},1e3);return()=>clearInterval(y)},[f]);const z=async()=>{if(!(!x.trim()||!n||!r)){c(!1);try{await p({otpId:n,code:x.trim(),otpEncryptionTargetBundle:r}),s(),o("authenticated")}catch{c(!0)}}},D=y=>{w(y)},F=async()=>{if(!(!t||f>0||d))try{const{otpId:y,otpEncryptionTargetBundle:M}=await l({email:t});i({otpId:y,otpEncryptionTargetBundle:M}),u(60),c(!1)}catch{c(!0)}},S=f<=0&&!d;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center zd:items-center",children:[e.jsxs("div",{className:"zd:flex zd:flex-col zd:gap-4",children:[e.jsx(a.Text,{className:"zd:text-h2 zd:text-center",children:"Enter verification code"}),e.jsxs(a.Text,{className:"zd:text-center",children:["Enter the code from the email we sent to"," ",e.jsx(a.Text,{className:"zd:text-solarOrange",children:t})]})]}),e.jsx(m2,{onComplete:D,onChange:()=>c(!1),disabled:g,error:m,autoFocus:!0}),e.jsx(a.Button,{text:"Confirm code",onClick:z,disabled:!x.trim()||g}),e.jsx("div",{className:"zd:flex zd:flex-col zd:gap-1",children:e.jsxs(a.Text,{className:"zd:text-center",children:["Did not get an email?"," ",e.jsx("button",{type:"button",disabled:!S,onClick:F,className:"zd:cursor-pointer zd:underline zd:disabled:opacity-50 zd:disabled:cursor-not-allowed",children:S?"Resend":`Resend in ${f} ${f===1?"second":"seconds"}`})]})})]}),e.jsx(a.PoweredBy,{className:"zd:self-center zd:pt-4 zd:pb-6"})]})}function h2({termsAndConditionsUrl:t,privacyPolicyUrl:n,agreedToTerms:r,setAgreedToTerms:i,highlight:s=!1}){const o=!!(t||n);return e.jsxs("div",{className:"zd:flex zd:flex-col zd:items-center zd:gap-5",children:[o&&e.jsxs("div",{className:`zd:flex zd:flex-row zd:items-center zd:gap-2 zd:rounded-md zd:p-2 zd:transition-colors ${s?"zd:border zd:border-negative":"zd:border zd:border-transparent"}`,children:[e.jsx("input",{type:"checkbox",checked:r,onChange:l=>i(l.target.checked),className:"zd:cursor-pointer zd:[color-scheme:light]"}),e.jsxs(a.Text,{className:"zd:flex-1",children:["I agree to the"," ",t&&e.jsx(a.Text,{as:"a",href:t,target:"_blank",rel:"noopener noreferrer",className:"zd:underline",children:"Terms & Conditions"}),t&&n&&" and ",n&&e.jsx(a.Text,{as:"a",href:n,target:"_blank",rel:"noopener noreferrer",className:"zd:underline",children:"Privacy Policy"})]})]}),e.jsx(a.PoweredBy,{})]})}const g2=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/blob.webm").href:new URL("blob.webm",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href);function x2({className:t}){return e.jsx("video",{className:t,style:{aspectRatio:"1 / 1"},src:g2,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,"aria-hidden":"true",tabIndex:-1})}const V=h.createContext(null);function N(){const t=h.useContext(V);if(!t)throw new Error("SignUp.* components must be rendered inside <SignUp>");return t}function U(t){const{setAuthPending:n}=N();h.useEffect(()=>(n(t),()=>n(!1)),[t,n])}const z2=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function R(t){return z2.test(t.trim())}function W(){const{goToStep:t,setEmail:n,setOtpSession:r}=C(),{authPending:i,emailAuthMethod:s,needsAgreement:o,guardAgreement:l,setError:d}=N(),[p,g]=h.useState(""),x=s==="otp",{mutateAsync:w,isPending:m}=E.useSendOTP(),{mutateAsync:c,isPending:f}=E.useSendMagicLink(),u=m||f;U(u);const z=async()=>{if(!(!p||i)&&R(p)&&l()){d(null);try{const D=x?w:c,{otpId:F,otpEncryptionTargetBundle:S}=await D({email:p});n(p),r({otpId:F,otpEncryptionTargetBundle:S}),t(x?"otp-input":"email-verification")}catch(D){d(D instanceof Error?D.message:"Failed to send verification code")}}};return e.jsx(a.Input,{iconName:"email",placeholder:"Enter your email",value:p,onChange:D=>g(D.target.value),type:"email",autoCapitalize:"none",autoComplete:"email",disabled:i,variant:"listItemStyle",onKeyDown:D=>{D.key==="Enter"&&p&&!i&&z()},children:u?e.jsx("div",{className:"zd:w-13 zd:h-13 zd:flex zd:items-center zd:justify-center",children:e.jsx("div",{className:"zd:w-5 zd:h-5 zd:border-2 zd:border-solarOrange zd:border-t-transparent zd:rounded-full zd:animate-spin"})}):e.jsx("button",{type:"button",disabled:!R(p)||o,className:`zd:w-13 zd:h-13 zd:rounded-2xl zd:flex zd:items-center zd:justify-center zd:transition-colors ${R(p)&&!o?"zd:cursor-pointer":"zd:cursor-not-allowed zd:opacity-50"}`,onClick:()=>z(),children:e.jsx(a.Icon,{name:"chevronRight",className:"zd:text-greyScale"})})})}function _(t){return t instanceof Error?t.name==="AbortError"||t.name==="NotAllowedError"||t.name==="UserRejectedRequestError"?!0:t.message.toLowerCase().includes("oauth popup was closed"):!1}function q(){const{goToStep:t}=C(),{authPending:n,guardAgreement:r,setError:i}=N(),{mutateAsync:s,isPending:o}=E.useAuthenticateOAuth({mutation:{onSuccess:()=>{t("authenticated")}}});U(o);const l=async()=>{if(!n&&r()){i(null);try{await s({provider:"google"})}catch(d){_(d)||i(d instanceof Error?d.message:String(d))}}};return e.jsx(a.ListItem,{icon:e.jsx(a.ListItemIcon,{name:"google"}),title:"Google",trailing:e.jsx(a.ListItemChevron,{}),disabled:n,onClick:l})}function O(t,n){return!!n.rdns&&(t.id===n.rdns||(Array.isArray(t.rdns)?t.rdns.includes(n.rdns):t.rdns===n.rdns))}const D2=[{id:"metamask",name:"MetaMask",rdns:"io.metamask",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22none%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cg%20clip-path%3D%22url(%23a)%22%3E%3Cpath%20fill%3D%22%23ff5c16%22%20d%3D%22m24.024%2023.824-4.846-1.434-3.655%202.172-2.55-.001-3.656-2.171-4.844%201.434L3%2018.88l1.473-5.488L3%208.751%204.473%203l7.569%204.496h4.413L24.024%203l1.473%205.751-1.473%204.64%201.473%205.488z%22%2F%3E%3Cpath%20fill%3D%22%23ff5c16%22%20d%3D%22m4.474%203%207.57%204.499-.302%203.087zm4.844%2015.881%203.33%202.522-3.33.987zm3.064-4.17-.64-4.123-4.097%202.804h-.002v.001l.013%202.886%201.661-1.567zM24.024%203l-7.57%204.499.3%203.087zM19.18%2018.881l-3.33%202.522%203.33.987zm1.674-5.488v-.002zl-4.097-2.804-.64%204.124h3.064l1.662%201.567z%22%2F%3E%3Cpath%20fill%3D%22%23e34807%22%20d%3D%22m9.317%2022.39-4.844%201.434L3%2018.881h6.317zm3.064-7.68.925%205.962-1.282-3.315-4.37-1.078%201.662-1.568zm6.799%207.68%204.844%201.434%201.473-4.943H19.18zm-3.064-7.68-.925%205.962%201.282-3.315%204.37-1.078-1.663-1.568z%22%2F%3E%3Cpath%20fill%3D%22%23ff8d5d%22%20d%3D%22m3%2018.88%201.473-5.489h3.169l.012%202.887%204.37%201.078%201.282%203.314-.659.73-3.33-2.522H3zm22.497%200-1.473-5.489h-3.17l-.01%202.887-4.371%201.078-1.282%203.314.659.73%203.33-2.522h6.317zM16.455%207.495h-4.413l-.3%203.087%201.565%2010.084h1.884l1.565-10.084z%22%2F%3E%3Cpath%20fill%3D%22%23661800%22%20d%3D%22M4.473%203%203%208.751l1.473%204.64h3.169l4.1-2.805zm6.992%2012.908H10.03l-.781.761%202.776.685-.56-1.447M24.024%203l1.473%205.751-1.473%204.64h-3.17l-4.098-2.805zm-6.99%2012.908h1.437l.782.762-2.78.686.56-1.45zm-1.512%206.687.328-1.193-.66-.73h-1.885l-.659.73.327%201.192%22%2F%3E%3Cpath%20fill%3D%22%23c0c4cd%22%20d%3D%22M15.522%2022.594v1.969h-2.548v-1.969z%22%2F%3E%3Cpath%20fill%3D%22%23e7ebf6%22%20d%3D%22m9.318%2022.388%203.658%202.174v-1.969l-.328-1.192zm9.862%200-3.658%202.174v-1.969l.328-1.192z%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22a%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M3%203h22.5v21.563H3z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",mobileLink:"https://metamask.app.link/wc?uri=",downloadUrl:"https://metamask.io/download"},{id:"trust",name:"Trust Wallet",rdns:"com.trustwallet.app",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20width%3D%2228%22%20height%3D%2228%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cpath%20fill%3D%22%230500FF%22%20d%3D%22M6%207.583%2013.53%205v17.882C8.15%2020.498%206%2015.928%206%2013.345V7.583Z%22%2F%3E%3Cpath%20fill%3D%22url(%23a)%22%20d%3D%22M22%207.583%2013.53%205v17.882c6.05-2.384%208.47-6.954%208.47-9.537V7.583Z%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22a%22%20x1%3D%2219.768%22%20x2%3D%2214.072%22%20y1%3D%223.753%22%20y2%3D%2222.853%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20offset%3D%22.02%22%20stop-color%3D%22%2300F%22%2F%3E%3Cstop%20offset%3D%22.08%22%20stop-color%3D%22%230094FF%22%2F%3E%3Cstop%20offset%3D%22.16%22%20stop-color%3D%22%2348FF91%22%2F%3E%3Cstop%20offset%3D%22.42%22%20stop-color%3D%22%230094FF%22%2F%3E%3Cstop%20offset%3D%22.68%22%20stop-color%3D%22%230038FF%22%2F%3E%3Cstop%20offset%3D%22.9%22%20stop-color%3D%22%230500FF%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",mobileLink:"trust://wc?uri=",downloadUrl:"https://trustwallet.com/download"},{id:"coinbase",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",icon:"data:image/svg+xml,%3Csvg%20width%3D%2228%22%20height%3D%2228%22%20viewBox%3D%220%200%2028%2028%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22%232C5FF6%22%2F%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M14%2023.8C19.4124%2023.8%2023.8%2019.4124%2023.8%2014C23.8%208.58761%2019.4124%204.2%2014%204.2C8.58761%204.2%204.2%208.58761%204.2%2014C4.2%2019.4124%208.58761%2023.8%2014%2023.8ZM11.55%2010.8C11.1358%2010.8%2010.8%2011.1358%2010.8%2011.55V16.45C10.8%2016.8642%2011.1358%2017.2%2011.55%2017.2H16.45C16.8642%2017.2%2017.2%2016.8642%2017.2%2016.45V11.55C17.2%2011.1358%2016.8642%2010.8%2016.45%2010.8H11.55Z%22%20fill%3D%22white%22%2F%3E%0A%3C%2Fsvg%3E",downloadUrl:"https://coinbase.com/wallet/downloads"},{id:"rainbow",name:"Rainbow",rdns:"me.rainbow",icon:"data:image/svg+xml,%3Csvg%20width%3D%22120%22%20height%3D%22120%22%20viewBox%3D%220%200%20120%20120%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20width%3D%22120%22%20height%3D%22120%22%20fill%3D%22url(%23paint0_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M20%2038H26C56.9279%2038%2082%2063.0721%2082%2094V100H94C97.3137%20100%20100%2097.3137%20100%2094C100%2053.1309%2066.8691%2020%2026%2020C22.6863%2020%2020%2022.6863%2020%2026V38Z%22%20fill%3D%22url(%23paint1_radial_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M84%2094H100C100%2097.3137%2097.3137%20100%2094%20100H84V94Z%22%20fill%3D%22url(%23paint2_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M26%2020L26%2036H20L20%2026C20%2022.6863%2022.6863%2020%2026%2020Z%22%20fill%3D%22url(%23paint3_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M20%2036H26C58.0325%2036%2084%2061.9675%2084%2094V100H66V94C66%2071.9086%2048.0914%2054%2026%2054H20V36Z%22%20fill%3D%22url(%23paint4_radial_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M68%2094H84V100H68V94Z%22%20fill%3D%22url(%23paint5_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M20%2052L20%2036L26%2036L26%2052H20Z%22%20fill%3D%22url(%23paint6_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M20%2062C20%2065.3137%2022.6863%2068%2026%2068C40.3594%2068%2052%2079.6406%2052%2094C52%2097.3137%2054.6863%20100%2058%20100H68V94C68%2070.804%2049.196%2052%2026%2052H20V62Z%22%20fill%3D%22url(%23paint7_radial_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M52%2094H68V100H58C54.6863%20100%2052%2097.3137%2052%2094Z%22%20fill%3D%22url(%23paint8_radial_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M26%2068C22.6863%2068%2020%2065.3137%2020%2062L20%2052L26%2052L26%2068Z%22%20fill%3D%22url(%23paint9_radial_62_329)%22%2F%3E%0A%3Cdefs%3E%0A%3ClinearGradient%20id%3D%22paint0_linear_62_329%22%20x1%3D%2260%22%20y1%3D%220%22%20x2%3D%2260%22%20y2%3D%22120%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23174299%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23001E59%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3CradialGradient%20id%3D%22paint1_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(26%2094)%20rotate(-90)%20scale(74)%22%3E%0A%3Cstop%20offset%3D%220.770277%22%20stop-color%3D%22%23FF4000%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238754C9%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3ClinearGradient%20id%3D%22paint2_linear_62_329%22%20x1%3D%2283%22%20y1%3D%2297%22%20x2%3D%22100%22%20y2%3D%2297%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23FF4000%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238754C9%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3ClinearGradient%20id%3D%22paint3_linear_62_329%22%20x1%3D%2223%22%20y1%3D%2220%22%20x2%3D%2223%22%20y2%3D%2237%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%238754C9%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF4000%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3CradialGradient%20id%3D%22paint4_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(26%2094)%20rotate(-90)%20scale(58)%22%3E%0A%3Cstop%20offset%3D%220.723929%22%20stop-color%3D%22%23FFF700%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3ClinearGradient%20id%3D%22paint5_linear_62_329%22%20x1%3D%2268%22%20y1%3D%2297%22%20x2%3D%2284%22%20y2%3D%2297%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23FFF700%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3ClinearGradient%20id%3D%22paint6_linear_62_329%22%20x1%3D%2223%22%20y1%3D%2252%22%20x2%3D%2223%22%20y2%3D%2236%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23FFF700%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3CradialGradient%20id%3D%22paint7_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(26%2094)%20rotate(-90)%20scale(42)%22%3E%0A%3Cstop%20offset%3D%220.59513%22%20stop-color%3D%22%2300AAFF%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3CradialGradient%20id%3D%22paint8_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(51%2097)%20scale(17%2045.3333)%22%3E%0A%3Cstop%20stop-color%3D%22%2300AAFF%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3CradialGradient%20id%3D%22paint9_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(23%2069)%20rotate(-90)%20scale(17%20322.37)%22%3E%0A%3Cstop%20stop-color%3D%22%2300AAFF%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E",mobileLink:"rainbow://wc?uri=",downloadUrl:"https://rainbow.download"},{id:"rabby",name:"Rabby Wallet",rdns:"io.rabby",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",downloadUrl:"https://rabby.io"},{id:"okx",name:"OKX Wallet",rdns:"com.okex.wallet",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%3Cpath%20fill%3D%22%23000%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20d%3D%22M10.819%205.556H5.93a.376.376%200%200%200-.375.375v4.888c0%20.207.168.375.375.375h4.888a.376.376%200%200%200%20.375-.376V5.932a.376.376%200%200%200-.376-.375Zm5.64%205.638h-4.886a.376.376%200%200%200-.376.376v4.887c0%20.208.168.376.376.376h4.887a.376.376%200%200%200%20.376-.375V11.57a.376.376%200%200%200-.376-.377Zm.75-5.638h4.887c.208%200%20.376.168.376.375v4.888a.376.376%200%200%201-.376.375H17.21a.376.376%200%200%201-.376-.376V5.933c0-.208.169-.376.376-.376Zm-6.39%2011.277H5.93a.376.376%200%200%200-.375.376v4.887c0%20.208.168.376.375.376h4.888a.376.376%200%200%200%20.375-.376V17.21a.376.376%200%200%200-.376-.376Zm6.39%200h4.887c.208%200%20.376.169.376.376v4.887a.376.376%200%200%201-.376.376H17.21a.376.376%200%200%201-.376-.376V17.21c0-.207.169-.376.376-.376Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E",mobileLink:"okex://main/wc?uri=",downloadUrl:"https://okx.com/download"},{id:"zerion",name:"Zerion",rdns:"io.zerion.wallet",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%3Cpath%20fill%3D%22%232962EF%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M6.073%207c-.48%200-.665.593-.262.841l10.073%206.074a.577.577%200%200%200%20.758-.139l4.43-5.814c.3-.404-.004-.962-.525-.962H6.073ZM21.904%2021c.48%200%20.67-.596.267-.844l-10.075-6.073a.569.569%200%200%200-.751.146l-4.437%205.813c-.301.404.012.958.534.958h14.462Z%22%2F%3E%3C%2Fsvg%3E",mobileLink:"zerion://wc?uri=",downloadUrl:"https://zerion.io"},{id:"uniswap",name:"Uniswap",rdns:"org.uniswap.app",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23FFD8EA%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cg%20fill%3D%22%23FF007A%22%20clip-path%3D%22url(%23a)%22%3E%3Cpath%20d%3D%22M9.635%206.068c-.255-.039-.266-.043-.145-.06.23-.035.773.012%201.148.099.874.202%201.67.722%202.519%201.646l.225.246.323-.051c1.36-.213%202.741-.044%203.899.477.319.144.821.43.882.503.022.024.058.173.082.335.086.557.044.982-.13%201.301-.096.173-.101.228-.037.377a.367.367%200%200%200%20.334.206c.287%200%20.597-.454.74-1.086l.056-.252.113.126c.62.685%201.106%201.618%201.189%202.282l.021.174-.103-.158a1.966%201.966%200%200%200-.59-.604c-.415-.268-.855-.36-2.017-.42-1.05-.053-1.645-.141-2.234-.329-1.003-.32-1.508-.744-2.699-2.27-.53-.678-.855-1.053-1.18-1.354-.74-.687-1.466-1.047-2.396-1.187v-.001Z%22%2F%3E%3Cpath%20d%3D%22M18.725%207.581c.026-.453.088-.753.216-1.026.028-.07.063-.136.104-.198a.69.69%200%200%201-.049.178c-.092.266-.108.629-.043%201.052.081.536.126.613.706%201.192.273.272.589.613.704.761l.21.267-.21-.191c-.255-.233-.841-.69-.972-.755-.086-.042-.1-.042-.153.01-.05.048-.06.12-.068.461-.01.532-.084.873-.263%201.213-.096.187-.111.147-.025-.062.066-.155.072-.224.072-.739%200-1.033-.127-1.283-.864-1.707a8.169%208.169%200%200%200-.684-.346%202.614%202.614%200%200%201-.334-.16c.02-.02.74.185%201.029.293.431.163.502.183.555.164.034-.013.051-.113.068-.407h.001Zm-8.595%201.77c-.517-.696-.838-1.764-.768-2.563l.02-.247.119.02c.222.04.603.179.783.286.49.29.703.673.918%201.657.064.288.147.613.185.725.061.178.294.592.483.862.136.194.046.286-.255.26-.46-.04-1.083-.46-1.485-1Zm7.965%205.182c-2.42-.95-3.273-1.777-3.273-3.17%200-.206.007-.374.016-.374.008%200%20.102.067.208.151.491.384%201.04.548%202.563.765.896.128%201.398.231%201.864.382%201.48.478%202.392%201.449%202.61%202.773.063.384.028%201.104-.076%201.484-.082.3-.329.84-.394.861-.019.007-.037-.061-.04-.154-.025-.496-.283-.98-.715-1.343-.49-.412-1.15-.741-2.763-1.375Zm-1.699.396a4.13%204.13%200%200%200-.117-.5l-.062-.18.115.127c.16.173.285.396.391.693.082.227.09.294.09.662%200%20.361-.011.437-.087.64-.104.3-.28.572-.51.794-.443.44-1.011.683-1.833.784-.142.018-.557.047-.922.066-.922.046-1.529.144-2.073.33a.446.446%200%200%201-.156.036c-.021-.021.35-.237.656-.381.431-.204.861-.315%201.825-.47.475-.078.968-.173%201.093-.21%201.178-.352%201.784-1.263%201.59-2.39Z%22%2F%3E%3Cpath%20d%3D%22M17.506%2016.855c-.321-.675-.396-1.327-.22-1.935.02-.067.05-.119.068-.119a.64.64%200%200%201%20.169.09c.149.097.445.261%201.237.682.988.527%201.553.934%201.936%201.4.335.407.542.872.643%201.438.057.32.023%201.093-.061%201.416-.266%201.018-.882%201.818-1.764%202.285a2.129%202.129%200%200%201-.258.124c-.013%200%20.035-.116.104-.259.297-.605.331-1.193.107-1.848-.138-.401-.418-.89-.982-1.718-.657-.96-.817-1.218-.979-1.556Zm-9.095%203.644c.9-.742%202.016-1.267%203.036-1.43a4.85%204.85%200%200%201%201.575.06c.652.163%201.235.528%201.538.962.296.425.423.794.556%201.618.052.324.109.651.125.724.1.427.293.768.532.939.38.272%201.037.29%201.682.044a.853.853%200%200%201%20.21-.064c.023.023-.301.235-.53.347-.27.141-.572.213-.879.208-.59%200-1.08-.294-1.49-.891a7.027%207.027%200%200%201-.402-.784c-.431-.961-.644-1.253-1.145-1.575-.437-.28-1-.329-1.424-.126-.556.266-.71.96-.312%201.4.187.189.43.313.695.354a.75.75%200%200%200%20.589-.174.728.728%200%200%200%20.251-.551c0-.29-.114-.453-.4-.581-.392-.172-.812.029-.81.388%200%20.153.069.249.226.32.1.044.103.046.02.03-.358-.073-.442-.496-.154-.776.347-.336%201.064-.188%201.31.272.103.194.115.578.025.81-.203.52-.79.793-1.387.644-.407-.102-.571-.211-1.06-.703-.852-.856-1.182-1.023-2.408-1.21l-.237-.035.268-.22Z%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20d%3D%22M4.418%205.179c2.842%203.368%204.8%204.757%205.017%205.05.18.243.112.462-.195.632a1.899%201.899%200%200%201-.699.191c-.2%200-.269-.075-.269-.075-.115-.106-.18-.088-.773-1.116A176.911%20176.911%200%200%200%205.968%207.56c-.044-.04-.042-.04%201.448%202.564.24.543.047.741.047.819%200%20.157-.044.24-.242.457-.332.36-.48.765-.587%201.604-.12.94-.456%201.604-1.39%202.741-.545.666-.635.787-.773%201.056-.174.338-.221.527-.24.952a2.9%202.9%200%200%200%20.16%201.174c.122.378.252.626.582%201.125.285.43.448.75.448.876%200%20.099.019.099.461.001%201.054-.232%201.91-.64%202.392-1.142.298-.311.367-.482.37-.907.002-.277-.008-.336-.085-.496-.125-.26-.353-.477-.855-.813-.66-.44-.942-.794-1.018-1.28-.065-.4.01-.682.373-1.427.377-.773.47-1.103.535-1.88.04-.503.096-.701.244-.861.155-.166.293-.222.676-.272.623-.084%201.018-.24%201.343-.534a1.14%201.14%200%200%200%20.421-.869l.014-.28-.16-.179C9.563%209.34%204.036%204.667%204%204.667c-.007%200%20.18.23.418.512Zm1.325%2013.086a.486.486%200%200%200-.157-.652c-.203-.133-.522-.069-.522.103%200%20.053.03.092.098.125.114.058.122.122.032.254s-.082.248.02.328c.168.126.404.057.529-.158ZM10.683%2012c-.29.086-.575.389-.664.706-.053.194-.022.534.058.638.13.169.255.213.596.212.665-.004%201.243-.283%201.311-.632.054-.286-.2-.68-.55-.855a1.33%201.33%200%200%200-.75-.07Zm.78.593c.102-.143.057-.296-.118-.4-.331-.199-.835-.035-.835.272%200%20.153.262.32.502.32.16%200%20.38-.093.45-.192Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22a%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M4%204h19v20H4z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",mobileLink:"uniswap://wc?uri=",downloadUrl:"https://wallet.uniswap.org"},{id:"ledger",name:"Ledger",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20d%3D%22M11.65%204.4H4.4V9h1.1V5.5l6.15-.04V4.4Zm.05%205.95v7.25h4.6v-1.1h-3.5l-.04-6.15H11.7ZM4.4%2023.6h7.25v-1.06L5.5%2022.5V19H4.4v4.6ZM16.35%204.4h7.25V9h-1.1V5.5l-6.15-.04V4.4Zm7.25%2019.2h-7.25v-1.06l6.15-.04V19h1.1v4.6Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E",mobileLink:"ledgerlive://wc?uri=",downloadUrl:"https://www.ledger.com/ledger-live"},{id:"binance",name:"Binance Wallet",rdns:"com.binance.wallet",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22130%22%20height%3D%22130%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M0%200h130v130H0z%22%2F%3E%3Cpath%20fill%3D%22%23F3BA2F%22%20d%3D%22M45.587%2057.02%2065.01%2037.606l19.43%2019.43%2011.295-11.303L65.01%2015%2034.284%2045.725zM15%2065.004l11.299-11.299%2011.298%2011.299L26.3%2076.302zM45.587%2072.983%2065.01%2092.406l19.43-19.43%2011.303%2011.287-.008.007-30.725%2030.734-30.725-30.718-.016-.016zM92.403%2065.006%20103.7%2053.708%20115%2065.006l-11.299%2011.299z%22%2F%3E%3Cpath%20fill%3D%22%23F3BA2F%22%20d%3D%22m76.471%2064.998-11.46-11.469-8.476%208.475-.98.972-2.005%202.006-.016.016.016.024%2011.46%2011.453%2011.461-11.47.008-.007z%22%2F%3E%3C%2Fsvg%3E",mobileLink:"bnc://app.binance.com/cedefi/wc?uri=",downloadUrl:"https://www.binance.com/en/download"}],b=D2;function w2({excludeWalletIds:t=[],maxWallets:n=4}){const{goToStep:r}=C(),{authPending:i,guardAgreement:s,setError:o,registeredWallets:l}=N(),d=A.useConnectors(),{mutate:p,isPending:g}=A.useConnect();U(g);const x=d.filter(m=>m.type==="injected"&&m.id!=="injected"&&m.id!=="zerodev-wallet").map(m=>{const c=b.find(f=>O(m,f));return{connector:m,walletId:c==null?void 0:c.id,name:(c==null?void 0:c.name)??m.name,icon:(c==null?void 0:c.icon)??m.icon,ids:c?[c.id,m.id]:[m.id],rank:c?b.indexOf(c):b.length}}).filter(m=>!(m.walletId&&l.includes(m.walletId))).filter(m=>!m.ids.some(c=>t.includes(c))).sort((m,c)=>m.rank-c.rank).slice(0,n),w=m=>{i||s()&&(o(null),p({connector:m},{onSuccess:()=>r(null),onError:c=>{_(c)||o(c instanceof Error?c.message:String(c))}}))};return e.jsx(e.Fragment,{children:x.map(({connector:m,name:c,icon:f})=>e.jsx(a.ListItem,{title:c,icon:f?e.jsx("img",{src:f,alt:"",className:"zd:w-6 zd:h-6"}):null,subtitle:e.jsx(a.Badge,{text:"INSTALLED"}),trailing:e.jsx(a.ListItemChevron,{}),disabled:i,onClick:()=>w(m)},m.uid))})}function C2({tile:t}){return e.jsxs("button",{type:"button",onClick:t.onSelect,className:"zd:flex zd:flex-col zd:items-center zd:gap-1.5 zd:cursor-pointer",children:[e.jsx("div",{className:"zd:w-16 zd:h-16 zd:rounded-2xl zd:bg-greyScale/5 zd:flex zd:items-center zd:justify-center",children:t.icon?e.jsx("img",{src:t.icon,alt:"",className:"zd:w-8 zd:h-8"}):e.jsx(a.Icon,{name:"walletOutline",className:"zd:w-8 zd:h-8 zd:text-greyScale"})}),e.jsx(a.Text,{className:"zd:text-body3 zd:max-w-full zd:truncate",children:t.name})]})}function E2({open:t,onOpenChange:n,tiles:r}){return e.jsx(a.BottomSheet,{open:t,onOpenChange:n,children:e.jsxs(a.BottomSheetContent,{className:"zd:p-4",children:[e.jsx(a.BottomSheetTitle,{children:"All wallets"}),e.jsxs("div",{className:"zd:mb-3 zd:flex zd:items-center zd:gap-2",children:[e.jsx(a.Text,{className:"zd:text-h3 zd:flex-1",children:"All wallets"}),e.jsx(a.BottomSheetClose,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"Close",className:"zd:cursor-pointer zd:px-2 zd:text-greyScale/60",children:"✕"})})]}),e.jsx("div",{className:"zd:grid zd:grid-cols-3 zd:gap-3 zd:max-h-80 zd:overflow-y-auto",children:r.map(i=>e.jsx(C2,{tile:i},i.key))})]})})}function F2({title:t="More wallets"}){const{goToStep:n}=C(),{authPending:r,guardAgreement:i,setError:s}=N(),[o,l]=h.useState(!1),d=A.useConnectors(),{mutate:p,isPending:g}=A.useConnect();U(g);const x=d.filter(u=>u.id!=="zerodev-wallet"&&u.type!=="walletConnect"),w=u=>{r||i()&&(l(!1),s(null),p({connector:u},{onSuccess:()=>n(null),onError:z=>{_(z)||s(z instanceof Error?z.message:String(z))}}))},m=b.map(u=>{const z=x.find(D=>O(D,u));return{key:u.id,name:u.name,icon:u.icon,onSelect:()=>{if(z){w(z);return}l(!1),window.open(u.downloadUrl,"_blank","noopener,noreferrer")}}}),c=x.filter(u=>!b.some(z=>O(u,z))).map(u=>({key:u.uid,name:u.name,icon:u.icon,onSelect:()=>w(u)})),f=()=>{r||i()&&l(!0)};return e.jsxs(e.Fragment,{children:[e.jsx(a.ListItem,{icon:e.jsx(a.ListItemIcon,{name:"walletOutline",className:"zd:w-5 zd:h-5"}),title:t,trailing:e.jsx(a.ListItemChevron,{}),disabled:r,onClick:f}),e.jsx(E2,{open:o,onOpenChange:l,tiles:[...m,...c]})]})}function $(){const{goToStep:t}=C(),{authPending:n,guardAgreement:r,setError:i}=N(),s={onSuccess:()=>{t("authenticated")},onError:x=>{_(x)||i(x instanceof Error?x.message:String(x))}},{mutate:o,isPending:l}=E.useRegisterPasskey({mutation:s}),{mutate:d,isPending:p}=E.useLoginPasskey({mutation:s});U(l||p);const g=x=>()=>{n||r()&&(i(null),x())};return e.jsxs(e.Fragment,{children:[e.jsx(a.Button,{action:"secondary",text:"Create a passkey",iconName:"key",trailIcon:!0,disabled:n,onClick:g(()=>o())}),e.jsx(a.Button,{action:"secondary",text:"Log in with passkey",iconName:"key",trailIcon:!0,disabled:n,onClick:g(()=>d())})]})}function y2({walletId:t}){const n=b.find(f=>f.id===t);if(!n)throw new Error(`Unknown walletId "${t}". Valid ids: ${b.map(f=>f.id).join(", ")}`);const{goToStep:r}=C(),{authPending:i,guardAgreement:s,setError:o,registerWallet:l}=N(),d=A.useConnectors(),{mutate:p,isPending:g}=A.useConnect();U(g),h.useLayoutEffect(()=>l(n.id),[l,n.id]);const x=d.find(f=>O(f,n)),w=!!n.rdns&&d.some(f=>f.id===n.rdns),m={title:n.name,icon:e.jsx("img",{src:n.icon,alt:"",className:"zd:w-6 zd:h-6"}),trailing:e.jsx(a.ListItemChevron,{})};if(!x)return e.jsx(a.ListItem,{...m,asChild:!0,children:e.jsx("a",{href:n.downloadUrl,target:"_blank",rel:"noopener noreferrer"})});const c=()=>{i||s()&&(o(null),p({connector:x},{onSuccess:()=>r(null),onError:f=>{_(f)||o(f instanceof Error?f.message:String(f))}}))};return e.jsx(a.ListItem,{...m,...w&&{subtitle:e.jsx(a.Badge,{text:"INSTALLED"})},disabled:i,onClick:c})}function K({children:t,termsAndConditionsUrl:n,privacyPolicyUrl:r,emailAuthMethod:i="magicLink"}){const[s,o]=h.useState(!1),[l,d]=h.useState(!1),[p,g]=h.useState(null),[x,w]=h.useState(!1),[m,c]=h.useState([]),f=h.useCallback(F=>(c(S=>[...S,F]),()=>{c(S=>{const y=[...S];return y.splice(y.indexOf(F),1),y})}),[]),z=!!(n||r)&&!s,D=()=>z?(d(!0),!1):!0;return e.jsxs(V.Provider,{value:{authPending:x,emailAuthMethod:i,setAuthPending:w,needsAgreement:z,guardAgreement:D,setError:g,registeredWallets:m,registerWallet:f},children:[p!==null&&e.jsx("div",{className:"zd:flex zd:items-center zd:justify-center zd:h-full zd:min-h-100",children:e.jsxs("div",{className:"zd:flex zd:flex-col zd:gap-4 zd:max-w-md",children:[e.jsx(a.Text,{className:"zd:text-h2 zd:text-center",children:"Error occurred"}),e.jsx(a.Text,{className:"zd:text-center zd:text-red-500",children:p}),e.jsx(a.Button,{action:"primary",text:"Try again",onClick:()=>g(null)})]})}),e.jsxs("div",{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${p!==null?" zd:hidden":""}`,children:[e.jsxs("div",{className:"zd:flex-1 zd:flex zd:flex-col zd:justify-center",children:[e.jsxs("div",{className:"zd:px-4 zd:flex zd:flex-col zd:items-center",children:[e.jsx("div",{className:"zd:w-full zd:px-16 zd:py-4",children:e.jsx(x2,{className:"zd:w-full zd:pointer-events-none zd:select-none"})}),e.jsx(a.Text,{className:"zd:text-h2 zd:text-center",children:"Continue to your wallet"}),e.jsx(a.Text,{className:"zd:mt-2 zd:text-center zd:text-greyScale/50",children:"Choose a sign-in method to proceed"})]}),e.jsx("div",{className:"zd:mt-6 zd:mb-4 zd:px-4 zd:flex zd:flex-col zd:gap-2",children:t})]}),e.jsx("div",{className:"zd:px-4",children:e.jsx(h2,{termsAndConditionsUrl:n,privacyPolicyUrl:r,agreedToTerms:s,setAgreedToTerms:F=>{o(F),F&&d(!1)},highlight:l})})]})]})}function Y({label:t="or"}){return e.jsxs("div",{className:"zd:-mx-4 zd:my-2 zd:flex zd:items-center zd:gap-3",children:[e.jsx("div",{className:"zd:h-px zd:flex-1 zd:bg-greyScale/30"}),e.jsx(a.Text,{className:"zd:text-body3",children:t}),e.jsx("div",{className:"zd:h-px zd:flex-1 zd:bg-greyScale/30"})]})}function S2(t){return e.jsxs(K,{...t,children:[e.jsx($,{}),e.jsx(Y,{}),e.jsx(q,{}),e.jsx(W,{})]})}const J=Object.assign(K,{Default:S2,Passkey:$,Google:q,Email:W,Wallet:y2,InstalledWallets:w2,MoreWallets:F2,Divider:Y});function v2(){return typeof window>"u"?null:new URLSearchParams(window.location.search).get("code")}function j2(){const{otpId:t,otpEncryptionTargetBundle:n,goToStep:r,clearOtpSession:i}=C(),[s]=h.useState(v2),[o,l]=h.useState(null),d=h.useRef(!1),{mutate:p,isPending:g}=E.useVerifyMagicLink({mutation:{onSuccess:()=>{i(),r("authenticated")},onError:x=>{l(x)}}});return h.useEffect(()=>{if(!(d.current||!s)){if(d.current=!0,!t||!n){I(),r(null);return}p({otpId:t,code:s,otpEncryptionTargetBundle:n})}},[t,n,s,p,r]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center",children:[!o&&g&&e.jsx(j,{imageName:"loading",title:"Verifying Your Email",children:"Please wait while we securely connect your wallet."}),!o&&!s&&!g&&e.jsxs(e.Fragment,{children:[e.jsxs(j,{imageName:"error",title:"Invalid Link",children:["This verification link is invalid or incomplete.",e.jsx("br",{}),"Please check your email and try again with the correct link."]}),e.jsx(a.Button,{action:"primary",onClick:()=>{I(),r("sign-up")},text:"Choose another sign-in method"})]}),o!=null&&e.jsxs(e.Fragment,{children:[e.jsx(j,{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."}),e.jsx(a.Button,{action:"primary",onClick:()=>{I(),r("sign-up")},text:"Choose another sign-in method"})]})]}),e.jsx(a.PoweredBy,{className:"zd:self-center zd:pt-4 zd:pb-6"})]})}function b2(){return e.jsx("div",{className:"zd:flex zd:flex-1 zd:items-center zd:justify-center",children:e.jsx(j,{imageName:"loading",title:"Authenticating...",children:"Please wait while we complete the OAuth authentication."})})}function A2(){return e.jsx("div",{className:"zd:flex zd:flex-1 zd:items-center zd:justify-center",children:e.jsx(j,{imageName:"loading",title:"Passkey authentication",children:"Please authenticate with your passkey."})})}function N2(t,n){switch(t){case"sign-up":return n?n():e.jsx(J.Default,{});case"email-verification":return e.jsx(r2,{});case"otp-input":return e.jsx(f2,{});case"verifying-otp":return e.jsx(j2,{});case"oauth-in-progress":return e.jsx(b2,{});case"passkey-prompt":return e.jsx(A2,{});case"error":return e.jsx(o2,{});default:return null}}function T2({onClose:t,size:n,renderSignUp:r,logo:i}={}){const{step:s,goToStep:o,goBack:l,reset:d}=C();h.useEffect(()=>{s===null&&a2()&&o("verifying-otp")},[s,o]);const p=N2(s,r);if(!p)return null;const g=()=>{I(),d(),t==null||t()};return e.jsx(a.Screen,{...n&&{size:n},className:s==="sign-up"?"zd:h-auto zd:max-h-202.5":void 0,topNav:e.jsx(a.TopNav,{...l!==null&&{onLeftButtonClick:l},onRightButtonClick:g,...s==="sign-up"&&{...i&&{logo:i},className:"zd:px-4"}}),children:p})}const P="zerodev:auth:otpSession";function k2(){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(P);if(!t)return null;const n=JSON.parse(t);return!(n!=null&&n.otpId)||!(n!=null&&n.otpEncryptionTargetBundle)?null:n}catch{return null}}function U2(t){if(!(typeof window>"u"))try{window.localStorage.setItem(P,JSON.stringify(t))}catch{}}function H(){if(!(typeof window>"u"))try{window.localStorage.removeItem(P)}catch{}}const I2=(t,n,r)=>({auth:{step:null,stepHistory:[],email:null,otpId:null,otpEncryptionTargetBundle:null,initialize:()=>{const i=k2();i&&t(s=>({auth:{...s.auth,otpId:i.otpId,otpEncryptionTargetBundle:i.otpEncryptionTargetBundle}}))},goToStep:i=>{t(s=>({auth:{...s.auth,step:i,stepHistory:s.auth.step===null?s.auth.stepHistory:[...s.auth.stepHistory,s.auth.step]}}))},goBack:()=>{const{auth:i}=n();if(i.stepHistory.length===0)return;const s=[...i.stepHistory],o=s.pop();t(l=>({auth:{...l.auth,step:o,stepHistory:s}}))},reset:()=>{H(),t(i=>({auth:{...i.auth,step:null,stepHistory:[],email:null,otpId:null,otpEncryptionTargetBundle:null}}))},setEmail:i=>{t(s=>({auth:{...s.auth,email:i}}))},setOtpSession:({otpId:i,otpEncryptionTargetBundle:s})=>{U2({otpId:i,otpEncryptionTargetBundle:s}),t(o=>({auth:{...o.auth,otpId:i,otpEncryptionTargetBundle:s}}))},clearOtpSession:()=>{H(),t(i=>({auth:{...i.auth,otpId:null,otpEncryptionTargetBundle:null}}))}}}),_2=()=>k.create()(X.subscribeWithSelector((t,n,r)=>({pendingRequests:[],userConfirmationListenerActive:!1,addPendingRequest:i=>t(s=>({pendingRequests:[...s.pendingRequests,i]})),removePendingRequest:i=>t(s=>({pendingRequests:s.pendingRequests.filter(o=>o.id!==i)})),clearPendingRequests:()=>t({pendingRequests:[]}),setUserConfirmationListenerActive:i=>t({userConfirmationListenerActive:i}),...I2(t,n)})));function L2(t){return new Promise((n,r)=>{const i=t.subscribe(s=>s.auth.step,s=>{s==="authenticated"?(i(),n()):s===null&&(i(),r(new Error("Auth flow dismissed")))})})}function O2(t){const n=E.zeroDevWallet(t),r=_2();return i=>{const s=n(i);return{...s,async connect(o){try{return await s.connect(o)}catch(l){if(o!=null&&o.isReconnecting||!(l instanceof E.NotAuthenticatedError))throw l;if(r.getState().auth.step!==null)throw new Error("Auth flow already in progress");return r.getState().auth.goToStep("sign-up"),await L2(r),s.connect(o)}},async disconnect(){var o;await((o=s.disconnect)==null?void 0:o.call(s)),r.getState().auth.reset()},async setup(){var o;await((o=s.setup)==null?void 0:o.call(s)),!(typeof window>"u")&&r.getState().auth.initialize()},getKitStore(){return r}}}}const M2={Pending:"zd:text-solarOrange",Success:"zd:text-positive",Failed:"zd:text-negative"};function R2({icon:t,title:n,value:r,chainName:i,chainIconUrl:s,destChainName:o,destChainIconUrl:l,status:d,className:p}){return e.jsxs("div",{className:a.cn("zd:flex zd:w-full zd:items-center zd:gap-2 zd:p-2",p),children:[e.jsx("div",{className:"zd:flex zd:size-11 zd:shrink-0 zd:items-center zd:justify-center zd:rounded-xl zd:bg-white",children:e.jsx(a.Icon,{name:t,className:"zd:size-5"})}),e.jsxs("div",{className:"zd:flex zd:min-w-0 zd:flex-1 zd:flex-col zd:gap-2",children:[e.jsxs("div",{className:"zd:flex zd:w-full zd:items-center zd:justify-between zd:gap-2",children:[e.jsx(a.Text,{className:"zd:shrink-0 zd:whitespace-nowrap zd:text-body1",children:n}),e.jsx(a.Text,{className:"zd:min-w-0 zd:truncate zd:text-right zd:text-body1",children:r})]}),e.jsxs("div",{className:"zd:flex zd:w-full zd:items-center zd:justify-between zd:gap-2",children:[e.jsxs("div",{className:"zd:flex zd:min-w-0 zd:items-center zd:gap-2",children:[e.jsx(B,{name:i,...s&&{iconUrl:s}}),o&&e.jsxs(e.Fragment,{children:[e.jsx(a.Icon,{name:"arrowRightFill","aria-hidden":!0,className:"zd:size-3 zd:shrink-0 zd:opacity-30"}),e.jsx(B,{name:o,...l&&{iconUrl:l}})]})]}),e.jsx(a.Text,{className:a.cn("zd:shrink-0 zd:text-body3",M2[d]),children:d})]})]})]})}function B({name:t,iconUrl:n}){return e.jsxs("div",{className:"zd:flex zd:min-w-0 zd:items-center zd:gap-[5px]",children:[n&&e.jsx("span",{className:"zd:size-3 zd:shrink-0 zd:overflow-hidden zd:rounded-full zd:bg-white",children:e.jsx("img",{src:n,alt:"","aria-hidden":!0,className:"zd:size-full zd:object-cover"})}),e.jsx(a.Text,{className:"zd:truncate zd:text-body3",children:t})]})}const T="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/info/logo.png",Z="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/base/info/logo.png",v=3600*1e3,P2=[{id:"mock-1",icon:"arrowSwapHorizontalOutline",title:"Swapped ETH → USD₮0",value:"2,343 ETH",chainName:"Arbitrum One",chainIconUrl:T,destChainName:"Base",destChainIconUrl:Z,status:"Pending",timestamp:Date.now()-1*v},{id:"mock-2",icon:"arrowSwapHorizontalOutline",title:"Swapped ETH → USD₮0",value:"2,343 ETH",chainName:"Arbitrum One",chainIconUrl:T,destChainName:"Base",destChainIconUrl:Z,status:"Pending",timestamp:Date.now()-2*v},{id:"mock-3",icon:"lighting",title:"Fixed Yield",value:"2,323 PT wstETH (25 Jan 2026)",chainName:"Arbitrum One",chainIconUrl:T,status:"Success",timestamp:Date.now()-3*v},{id:"mock-4",icon:"imageFill",title:"Received NFT",value:"Bored Ape Yacht Club",chainName:"Arbitrum One",chainIconUrl:T,status:"Success",timestamp:Date.now()-4*v},{id:"mock-5",icon:"lighting",title:"Collateral Used",value:"Collateralization enabled for USD₮0",chainName:"Arbitrum One",chainIconUrl:T,status:"Success",timestamp:Date.now()-336*v},{id:"mock-6",icon:"lighting",title:"Liquid Staked ETH",value:"2,323 PT wstETH (25 Jan 2026)",chainName:"Arbitrum One",chainIconUrl:T,status:"Success",timestamp:Date.now()-336*v-1*v}];function L(t){const n=new Date(t);return`${n.getFullYear()}-${n.getMonth()}-${n.getDate()}`}function H2(t,n){const r=L(t);return r===L(n)?"Today":r===L(n-1440*60*1e3)?"Yesterday":new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(new Date(t))}function B2(t,n=Date.now()){var o;const r=[...t].sort((l,d)=>d.timestamp-l.timestamp),i=[];let s=null;for(const l of r){const d=L(l.timestamp);d!==s&&(s=d,i.push({label:H2(l.timestamp,n),entries:[]})),(o=i[i.length-1])==null||o.entries.push(l)}return i}function Z2({entries:t=P2,onSelectEntry:n}){const r=B2(t);return e.jsx("div",{className:"zd:flex zd:h-full zd:w-full zd:flex-col zd:gap-1 zd:pt-2 zd:pb-4",children:e.jsx(a.Wrapper,{variant:"ghost",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",children:r.map(i=>e.jsxs(h.Fragment,{children:[e.jsx("div",{className:"zd:flex zd:w-full zd:items-center zd:py-2 zd:pr-2",children:e.jsx(a.Text,{className:"zd:text-body3",children:i.label})}),i.entries.map(s=>n?e.jsx("button",{type:"button",onClick:()=>n(s),className:"zd:w-full zd:cursor-pointer zd:text-left",children:e.jsx(G,{entry:s})},s.id):e.jsx(G,{entry:s},s.id))]},i.label))})})}function G({entry:t}){return e.jsx(R2,{icon:t.icon,title:t.title,value:t.value,chainName:t.chainName,...t.chainIconUrl&&{chainIconUrl:t.chainIconUrl},...t.destChainName&&{destChainName:t.destChainName},...t.destChainIconUrl&&{destChainIconUrl:t.destChainIconUrl},status:t.status})}const G2={history:"History"};function V2({onClose:t,entries:n,onSelectEntry:r,className:i,size:s}){const[o]=h.useState("history"),l=()=>{switch(o){case"history":return e.jsx(Z2,{...n&&{entries:n},...r&&{onSelectEntry:r}})}};return e.jsx(a.Screen,{...i&&{className:i},...s&&{size:s},topNav:e.jsx(a.TopNav,{title:G2[o],onRightButtonClick:t}),children:l()})}exports.ConnectWallet=T2;exports.SignUp=J;exports.TxHistory=V2;exports.useAuth=C;exports.zeroDevWallet=O2;
|
|
4
4
|
//# sourceMappingURL=index.cjs.map
|