@seams/wallet 0.15.1 → 0.15.4
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/.build-inputs.sha256 +1 -1
- package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuSurface.js +2 -2
- package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/icons.js +23 -1
- package/dist/esm/react/components/AccountMenuButton/AuthenticationMethodRow.js +1 -1
- package/dist/esm/react/components/AccountMenuButton/MenuItem.js +2 -11
- package/dist/esm/react/components/AccountMenuButton/ProfileDropdown.css +30 -4
- package/dist/esm/react/components/AccountMenuButton/Web3AuthProfileButton.css +4 -39
- package/dist/esm/react/components/AccountMenuButton/icons/HoverArrowIcon.css +45 -0
- package/dist/esm/react/components/AccountMenuButton/icons/HoverArrowIcon.js +3 -2
- package/dist/esm/react/styles/styles.css +80 -43
- package/dist/esm/react/styles.css +1 -0
- package/dist/esm/sdk/{host-DYuu07E5.js → host-z-JJRWQe.js} +1 -1
- package/dist/esm/sdk/runtime-auth-ZcxkQ-XF.js +1 -0
- package/dist/esm/sdk/wallet-iframe-host-ecdsa.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-full.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-near.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-runtime.js +1 -1
- package/dist/esm/sdk/wallet-ui.css +1 -1
- package/dist/public/headers.manifest.json +1 -1
- package/dist/public/sdk/{host-DYuu07E5.js → host-z-JJRWQe.js} +1 -1
- package/dist/public/sdk/runtime-auth-ZcxkQ-XF.js +1 -0
- package/dist/public/sdk/wallet-iframe-host-ecdsa.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-full.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-near.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-runtime.js +1 -1
- package/dist/public/sdk/wallet-ui.css +1 -1
- package/dist/public/wallet-assets.manifest.json +6 -6
- package/dist/public/wallet-service/index.html +4 -4
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ui/auth-menu/icons.d.ts +1 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/icons/HoverArrowIcon.d.ts +3 -2
- package/package.json +1 -1
- package/dist/esm/sdk/runtime-auth-BNR1wI8E.js +0 -1
- package/dist/public/sdk/runtime-auth-BNR1wI8E.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
93b1ef116ecd8e93d9fe147324f06212aa3982133323ca33aa407d5e80a19d96
|
|
@@ -5,7 +5,7 @@ import { demoEmailOtpCodeFromDelivery } from "../../../../../core/signingEngine/
|
|
|
5
5
|
import { isAuthMenuActionReady, isAuthMenuGoogleActionReady, isAuthMenuLoadingStatus, isAuthMenuReady, resolveAuthMenuLoginAccount } from "../../auth-menu/domain.js";
|
|
6
6
|
import { PadlockIcon } from "../../../../../core/signingEngine/uiConfirm/ui/preact/PadlockIcon.js";
|
|
7
7
|
import { blinkMenuItem } from "../../../../../utils/menuItemBlink.js";
|
|
8
|
-
import { accountDropdownIcon, backIcon, chevronIcon, fingerprintIcon, googleIcon, linkDeviceIcon, linkFailedIcon, mailIcon, recoveryIcon, rerollIcon } from "./icons.js";
|
|
8
|
+
import { accountDropdownIcon, backIcon, chevronIcon, fingerprintIcon, googleIcon, linkDeviceIcon, linkFailedIcon, mailIcon, passkeyRingIcon, recoveryIcon, rerollIcon } from "./icons.js";
|
|
9
9
|
import { AuthMenuFooter } from "./AuthMenuFooter.js";
|
|
10
10
|
import { linkDeviceDotRing, linkDeviceEmailOtpPresentation } from "./linkDeviceBadge.js";
|
|
11
11
|
import { Component, Fragment } from "preact";
|
|
@@ -1139,7 +1139,7 @@ var AuthMenuSurface = class extends Component {
|
|
|
1139
1139
|
class: "seams-passkey-prompt",
|
|
1140
1140
|
role: "img",
|
|
1141
1141
|
"aria-label": "Passkey authentication",
|
|
1142
|
-
children:
|
|
1142
|
+
children: passkeyRingIcon()
|
|
1143
1143
|
}) : null,
|
|
1144
1144
|
/* @__PURE__ */ jsxs("div", {
|
|
1145
1145
|
class: "seams-waiting-message",
|
|
@@ -17,6 +17,28 @@ function strokeIcon(size, strokeWidth, ...shapes) {
|
|
|
17
17
|
function fingerprintIcon() {
|
|
18
18
|
return strokeIcon("22", "1.5", /* @__PURE__ */ jsx("path", { d: "M6.405 19.048c.184-.443.353-.894.507-1.351" }), /* @__PURE__ */ jsx("path", { d: "M14.343 20.693c.266-.751.502-1.516.707-2.294.186-.706.346-1.422.478-2.147" }), /* @__PURE__ */ jsx("path", { d: "M19.448 17.058c.364-1.964.555-3.989.555-6.058 0-4.418-3.582-8-8-8-1.255 0-2.443.289-3.501.805" }), /* @__PURE__ */ jsx("path", { d: "M3.523 15.025c.314-1.29.48-2.638.48-4.025 0-1.74.556-3.351 1.499-4.664" }), /* @__PURE__ */ jsx("path", { d: "M12.003 11c0 2.76-.447 5.416-1.273 7.899-.213.639-.451 1.266-.712 1.881" }), /* @__PURE__ */ jsx("path", { d: "M7.712 14.5c.191-1.138.291-2.308.291-3.5 0-2.209 1.791-4 4-4s4 1.791 4 4c0 .617-.02 1.229-.058 1.836" }));
|
|
19
19
|
}
|
|
20
|
+
function passkeyRingIcon() {
|
|
21
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
22
|
+
class: "seams-passkey-ring",
|
|
23
|
+
viewBox: "0 0 56 56",
|
|
24
|
+
fill: "none",
|
|
25
|
+
"aria-hidden": "true",
|
|
26
|
+
focusable: "false",
|
|
27
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
28
|
+
class: "seams-passkey-ring-track",
|
|
29
|
+
cx: "28",
|
|
30
|
+
cy: "28",
|
|
31
|
+
r: "26.75"
|
|
32
|
+
}), /* @__PURE__ */ jsx("circle", {
|
|
33
|
+
class: "seams-passkey-ring-arc",
|
|
34
|
+
cx: "28",
|
|
35
|
+
cy: "28",
|
|
36
|
+
r: "26.75",
|
|
37
|
+
pathLength: "100",
|
|
38
|
+
transform: "rotate(-90 28 28)"
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
20
42
|
function accountDropdownIcon() {
|
|
21
43
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("svg", {
|
|
22
44
|
class: "seams-account-dropdown-arrow",
|
|
@@ -131,6 +153,6 @@ function alertIcon() {
|
|
|
131
153
|
}));
|
|
132
154
|
}
|
|
133
155
|
//#endregion
|
|
134
|
-
export { accountDropdownIcon, alertIcon, backIcon, chevronIcon, fingerprintIcon, googleIcon, linkDeviceIcon, linkFailedIcon, mailIcon, recoveryIcon, rerollIcon, shieldIcon };
|
|
156
|
+
export { accountDropdownIcon, alertIcon, backIcon, chevronIcon, fingerprintIcon, googleIcon, linkDeviceIcon, linkFailedIcon, mailIcon, passkeyRingIcon, recoveryIcon, rerollIcon, shieldIcon };
|
|
135
157
|
|
|
136
158
|
//# sourceMappingURL=icons.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import TouchIcon from "./icons/TouchIcon.js";
|
|
2
|
-
import { MailIcon } from "./icons/MailIcon.js";
|
|
3
2
|
import { HoverArrowIcon } from "./icons/HoverArrowIcon.js";
|
|
3
|
+
import { MailIcon } from "./icons/MailIcon.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/react/components/AccountMenuButton/AuthenticationMethodRow.tsx
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { HoverArrowIcon } from "./icons/HoverArrowIcon.js";
|
|
1
2
|
import { forwardRef, memo } from "react";
|
|
2
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
//#region src/react/components/AccountMenuButton/MenuItem.tsx
|
|
@@ -35,17 +36,7 @@ const MenuItem = memo(forwardRef(({ item, onClose, className, style, isHighlight
|
|
|
35
36
|
children: item.description
|
|
36
37
|
})]
|
|
37
38
|
}),
|
|
38
|
-
!item.disabled ? /* @__PURE__ */ jsx(
|
|
39
|
-
className: "seams-account-menu-chevron",
|
|
40
|
-
width: "16",
|
|
41
|
-
height: "16",
|
|
42
|
-
viewBox: "0 0 24 24",
|
|
43
|
-
fill: "none",
|
|
44
|
-
stroke: "currentColor",
|
|
45
|
-
strokeWidth: "1.5",
|
|
46
|
-
"aria-hidden": "true",
|
|
47
|
-
children: /* @__PURE__ */ jsx("path", { d: "m9 6 6 6-6 6" })
|
|
48
|
-
}) : null
|
|
39
|
+
!item.disabled ? /* @__PURE__ */ jsx(HoverArrowIcon, {}) : null
|
|
49
40
|
]
|
|
50
41
|
});
|
|
51
42
|
}));
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
--seams-expander-surface: var(--seams-colors-surface2);
|
|
19
19
|
}
|
|
20
20
|
.seams-profile-dropdown-menu .seams-dropdown-menu-item {
|
|
21
|
+
position: relative;
|
|
22
|
+
isolation: isolate;
|
|
21
23
|
min-height: 40px;
|
|
22
24
|
padding: 6px 0;
|
|
23
25
|
gap: 10px;
|
|
@@ -57,9 +59,23 @@
|
|
|
57
59
|
.seams-profile-dropdown-menu .seams-dropdown-menu-item-content {
|
|
58
60
|
flex: 1;
|
|
59
61
|
}
|
|
60
|
-
.seams-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
.seams-profile-dropdown-menu .seams-dropdown-menu-item > .seams-hover-arrow {
|
|
63
|
+
margin-inline-end: 4px;
|
|
64
|
+
}
|
|
65
|
+
/* The hover shade bleeds past the row edges so the icons and labels stay
|
|
66
|
+
aligned with the group headings. */
|
|
67
|
+
.seams-profile-dropdown-menu .seams-dropdown-menu-item:not(.seams-lock-menu-item)::before {
|
|
68
|
+
content: '';
|
|
69
|
+
position: absolute;
|
|
70
|
+
z-index: -1;
|
|
71
|
+
inset: 1px -10px;
|
|
72
|
+
border-radius: var(--seams-shape-item, 10px);
|
|
73
|
+
background: var(--seams-colors-surface2);
|
|
74
|
+
opacity: 0;
|
|
75
|
+
transition: opacity 150ms ease;
|
|
76
|
+
}
|
|
77
|
+
.seams-profile-dropdown-menu .seams-dropdown-menu-item:focus-visible::before {
|
|
78
|
+
opacity: 1;
|
|
63
79
|
}
|
|
64
80
|
.seams-profile-dropdown-menu .seams-lock-menu-item {
|
|
65
81
|
border: 1px solid var(--seams-colors-borderPrimary);
|
|
@@ -72,9 +88,19 @@
|
|
|
72
88
|
}
|
|
73
89
|
@media (hover: hover) {
|
|
74
90
|
.seams-profile-dropdown-menu .seams-dropdown-menu-item:not(:disabled):hover {
|
|
75
|
-
color: var(--seams-colors-textSecondary);
|
|
76
91
|
background: transparent;
|
|
77
92
|
}
|
|
93
|
+
.seams-profile-dropdown-menu .seams-dropdown-menu-item:not(:disabled):hover::before {
|
|
94
|
+
opacity: 1;
|
|
95
|
+
}
|
|
96
|
+
.seams-profile-dropdown-menu .seams-lock-menu-item:not(:disabled):hover {
|
|
97
|
+
background: var(--seams-colors-surface2);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
@media (prefers-reduced-motion: reduce) {
|
|
101
|
+
.seams-profile-dropdown-menu .seams-dropdown-menu-item::before {
|
|
102
|
+
transition: none;
|
|
103
|
+
}
|
|
78
104
|
}
|
|
79
105
|
|
|
80
106
|
@media (pointer: coarse) {
|
|
@@ -284,6 +284,9 @@
|
|
|
284
284
|
.seams-account-method-button > div {
|
|
285
285
|
flex: 1;
|
|
286
286
|
}
|
|
287
|
+
.seams-account-method-button > .seams-hover-arrow {
|
|
288
|
+
margin-inline-end: 2px;
|
|
289
|
+
}
|
|
287
290
|
.seams-account-method-button strong {
|
|
288
291
|
font-size: 15px;
|
|
289
292
|
font-weight: 500;
|
|
@@ -294,47 +297,9 @@
|
|
|
294
297
|
color: var(--seams-colors-textSecondary);
|
|
295
298
|
font-size: 12px;
|
|
296
299
|
}
|
|
297
|
-
.seams-account-method-button > .seams-hover-arrow {
|
|
298
|
-
flex: 0 0 auto;
|
|
299
|
-
margin-inline-end: 2px;
|
|
300
|
-
fill: none;
|
|
301
|
-
stroke: currentColor;
|
|
302
|
-
stroke-width: 1.5;
|
|
303
|
-
color: var(--seams-colors-textSecondary);
|
|
304
|
-
transition: color 140ms ease;
|
|
305
|
-
}
|
|
306
|
-
.seams-hover-arrow-line {
|
|
307
|
-
opacity: 0;
|
|
308
|
-
filter: blur(2px);
|
|
309
|
-
transform: scaleX(0.45);
|
|
310
|
-
transform-origin: right center;
|
|
311
|
-
transition:
|
|
312
|
-
opacity 140ms cubic-bezier(0.215, 0.61, 0.355, 1),
|
|
313
|
-
filter 140ms cubic-bezier(0.215, 0.61, 0.355, 1),
|
|
314
|
-
transform 140ms cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
315
|
-
}
|
|
316
|
-
.seams-hover-arrow-tip {
|
|
317
|
-
transition: transform 140ms cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
318
|
-
}
|
|
319
|
-
.seams-account-method-button:hover > .seams-hover-arrow,
|
|
320
|
-
.seams-account-method-button:focus-visible > .seams-hover-arrow {
|
|
321
|
-
color: var(--seams-colors-textPrimary);
|
|
322
|
-
}
|
|
323
|
-
.seams-account-method-button:hover .seams-hover-arrow-line,
|
|
324
|
-
.seams-account-method-button:focus-visible .seams-hover-arrow-line {
|
|
325
|
-
opacity: 1;
|
|
326
|
-
filter: blur(0);
|
|
327
|
-
transform: scaleX(1);
|
|
328
|
-
}
|
|
329
|
-
.seams-account-method-button:hover .seams-hover-arrow-tip,
|
|
330
|
-
.seams-account-method-button:focus-visible .seams-hover-arrow-tip {
|
|
331
|
-
transform: translateX(3px);
|
|
332
|
-
}
|
|
333
300
|
@media (prefers-reduced-motion: reduce) {
|
|
334
301
|
.seams-account-method-button::before,
|
|
335
|
-
.seams-account-method-button .seams-account-avatar
|
|
336
|
-
.seams-hover-arrow-line,
|
|
337
|
-
.seams-hover-arrow-tip {
|
|
302
|
+
.seams-account-method-button .seams-account-avatar {
|
|
338
303
|
transition: none;
|
|
339
304
|
}
|
|
340
305
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/* HoverArrowIcon: a chevron that grows a shaft (">" to "->") when its
|
|
2
|
+
direct parent is hovered or focused from the keyboard. */
|
|
3
|
+
|
|
4
|
+
.seams-hover-arrow {
|
|
5
|
+
flex: 0 0 auto;
|
|
6
|
+
fill: none;
|
|
7
|
+
stroke: currentColor;
|
|
8
|
+
stroke-width: 1.5;
|
|
9
|
+
color: var(--seams-colors-textSecondary);
|
|
10
|
+
transition: color 140ms ease;
|
|
11
|
+
}
|
|
12
|
+
.seams-hover-arrow-line {
|
|
13
|
+
opacity: 0;
|
|
14
|
+
filter: blur(2px);
|
|
15
|
+
transform: scaleX(0.45);
|
|
16
|
+
transform-origin: right center;
|
|
17
|
+
transition:
|
|
18
|
+
opacity 140ms cubic-bezier(0.215, 0.61, 0.355, 1),
|
|
19
|
+
filter 140ms cubic-bezier(0.215, 0.61, 0.355, 1),
|
|
20
|
+
transform 140ms cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
21
|
+
}
|
|
22
|
+
.seams-hover-arrow-tip {
|
|
23
|
+
transition: transform 140ms cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
24
|
+
}
|
|
25
|
+
:hover > .seams-hover-arrow,
|
|
26
|
+
:focus-visible > .seams-hover-arrow {
|
|
27
|
+
color: var(--seams-colors-textPrimary);
|
|
28
|
+
}
|
|
29
|
+
:hover > .seams-hover-arrow .seams-hover-arrow-line,
|
|
30
|
+
:focus-visible > .seams-hover-arrow .seams-hover-arrow-line {
|
|
31
|
+
opacity: 1;
|
|
32
|
+
filter: blur(0);
|
|
33
|
+
transform: scaleX(1);
|
|
34
|
+
}
|
|
35
|
+
:hover > .seams-hover-arrow .seams-hover-arrow-tip,
|
|
36
|
+
:focus-visible > .seams-hover-arrow .seams-hover-arrow-tip {
|
|
37
|
+
transform: translateX(3px);
|
|
38
|
+
}
|
|
39
|
+
@media (prefers-reduced-motion: reduce) {
|
|
40
|
+
.seams-hover-arrow,
|
|
41
|
+
.seams-hover-arrow-line,
|
|
42
|
+
.seams-hover-arrow-tip {
|
|
43
|
+
transition: none;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import "./HoverArrowIcon.css";
|
|
3
4
|
//#region src/react/components/AccountMenuButton/icons/HoverArrowIcon.tsx
|
|
4
|
-
/** A chevron that grows a shaft on its parent's hover (">" to "->").
|
|
5
|
-
*
|
|
5
|
+
/** A chevron that grows a shaft on its parent's hover (">" to "->"). Place it
|
|
6
|
+
* as a direct child of the row that triggers it (HoverArrowIcon.css). */
|
|
6
7
|
function HoverArrowIcon({ size = 12 }) {
|
|
7
8
|
return /* @__PURE__ */ jsxs("svg", {
|
|
8
9
|
className: "seams-hover-arrow",
|
|
@@ -323,6 +323,8 @@
|
|
|
323
323
|
--seams-expander-surface: var(--seams-colors-surface2);
|
|
324
324
|
}
|
|
325
325
|
.seams-profile-dropdown-menu .seams-dropdown-menu-item {
|
|
326
|
+
position: relative;
|
|
327
|
+
isolation: isolate;
|
|
326
328
|
min-height: 40px;
|
|
327
329
|
padding: 6px 0;
|
|
328
330
|
gap: 10px;
|
|
@@ -362,9 +364,23 @@
|
|
|
362
364
|
.seams-profile-dropdown-menu .seams-dropdown-menu-item-content {
|
|
363
365
|
flex: 1;
|
|
364
366
|
}
|
|
365
|
-
.seams-
|
|
366
|
-
|
|
367
|
-
|
|
367
|
+
.seams-profile-dropdown-menu .seams-dropdown-menu-item > .seams-hover-arrow {
|
|
368
|
+
margin-inline-end: 4px;
|
|
369
|
+
}
|
|
370
|
+
/* The hover shade bleeds past the row edges so the icons and labels stay
|
|
371
|
+
aligned with the group headings. */
|
|
372
|
+
.seams-profile-dropdown-menu .seams-dropdown-menu-item:not(.seams-lock-menu-item)::before {
|
|
373
|
+
content: '';
|
|
374
|
+
position: absolute;
|
|
375
|
+
z-index: -1;
|
|
376
|
+
inset: 1px -10px;
|
|
377
|
+
border-radius: var(--seams-shape-item, 10px);
|
|
378
|
+
background: var(--seams-colors-surface2);
|
|
379
|
+
opacity: 0;
|
|
380
|
+
transition: opacity 150ms ease;
|
|
381
|
+
}
|
|
382
|
+
.seams-profile-dropdown-menu .seams-dropdown-menu-item:focus-visible::before {
|
|
383
|
+
opacity: 1;
|
|
368
384
|
}
|
|
369
385
|
.seams-profile-dropdown-menu .seams-lock-menu-item {
|
|
370
386
|
border: 1px solid var(--seams-colors-borderPrimary);
|
|
@@ -377,9 +393,19 @@
|
|
|
377
393
|
}
|
|
378
394
|
@media (hover: hover) {
|
|
379
395
|
.seams-profile-dropdown-menu .seams-dropdown-menu-item:not(:disabled):hover {
|
|
380
|
-
color: var(--seams-colors-textSecondary);
|
|
381
396
|
background: transparent;
|
|
382
397
|
}
|
|
398
|
+
.seams-profile-dropdown-menu .seams-dropdown-menu-item:not(:disabled):hover::before {
|
|
399
|
+
opacity: 1;
|
|
400
|
+
}
|
|
401
|
+
.seams-profile-dropdown-menu .seams-lock-menu-item:not(:disabled):hover {
|
|
402
|
+
background: var(--seams-colors-surface2);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
@media (prefers-reduced-motion: reduce) {
|
|
406
|
+
.seams-profile-dropdown-menu .seams-dropdown-menu-item::before {
|
|
407
|
+
transition: none;
|
|
408
|
+
}
|
|
383
409
|
}
|
|
384
410
|
|
|
385
411
|
@media (pointer: coarse) {
|
|
@@ -388,6 +414,52 @@
|
|
|
388
414
|
}
|
|
389
415
|
}
|
|
390
416
|
|
|
417
|
+
/* HoverArrowIcon: a chevron that grows a shaft (">" to "->") when its
|
|
418
|
+
direct parent is hovered or focused from the keyboard. */
|
|
419
|
+
|
|
420
|
+
.seams-hover-arrow {
|
|
421
|
+
flex: 0 0 auto;
|
|
422
|
+
fill: none;
|
|
423
|
+
stroke: currentColor;
|
|
424
|
+
stroke-width: 1.5;
|
|
425
|
+
color: var(--seams-colors-textSecondary);
|
|
426
|
+
transition: color 140ms ease;
|
|
427
|
+
}
|
|
428
|
+
.seams-hover-arrow-line {
|
|
429
|
+
opacity: 0;
|
|
430
|
+
filter: blur(2px);
|
|
431
|
+
transform: scaleX(0.45);
|
|
432
|
+
transform-origin: right center;
|
|
433
|
+
transition:
|
|
434
|
+
opacity 140ms cubic-bezier(0.215, 0.61, 0.355, 1),
|
|
435
|
+
filter 140ms cubic-bezier(0.215, 0.61, 0.355, 1),
|
|
436
|
+
transform 140ms cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
437
|
+
}
|
|
438
|
+
.seams-hover-arrow-tip {
|
|
439
|
+
transition: transform 140ms cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
440
|
+
}
|
|
441
|
+
:hover > .seams-hover-arrow,
|
|
442
|
+
:focus-visible > .seams-hover-arrow {
|
|
443
|
+
color: var(--seams-colors-textPrimary);
|
|
444
|
+
}
|
|
445
|
+
:hover > .seams-hover-arrow .seams-hover-arrow-line,
|
|
446
|
+
:focus-visible > .seams-hover-arrow .seams-hover-arrow-line {
|
|
447
|
+
opacity: 1;
|
|
448
|
+
filter: blur(0);
|
|
449
|
+
transform: scaleX(1);
|
|
450
|
+
}
|
|
451
|
+
:hover > .seams-hover-arrow .seams-hover-arrow-tip,
|
|
452
|
+
:focus-visible > .seams-hover-arrow .seams-hover-arrow-tip {
|
|
453
|
+
transform: translateX(3px);
|
|
454
|
+
}
|
|
455
|
+
@media (prefers-reduced-motion: reduce) {
|
|
456
|
+
.seams-hover-arrow,
|
|
457
|
+
.seams-hover-arrow-line,
|
|
458
|
+
.seams-hover-arrow-tip {
|
|
459
|
+
transition: none;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
391
463
|
/* TouchIcon specific styles and animations */
|
|
392
464
|
|
|
393
465
|
.seams-fingerprint-icon path {
|
|
@@ -1001,6 +1073,9 @@
|
|
|
1001
1073
|
.seams-account-method-button > div {
|
|
1002
1074
|
flex: 1;
|
|
1003
1075
|
}
|
|
1076
|
+
.seams-account-method-button > .seams-hover-arrow {
|
|
1077
|
+
margin-inline-end: 2px;
|
|
1078
|
+
}
|
|
1004
1079
|
.seams-account-method-button strong {
|
|
1005
1080
|
font-size: 15px;
|
|
1006
1081
|
font-weight: 500;
|
|
@@ -1011,47 +1086,9 @@
|
|
|
1011
1086
|
color: var(--seams-colors-textSecondary);
|
|
1012
1087
|
font-size: 12px;
|
|
1013
1088
|
}
|
|
1014
|
-
.seams-account-method-button > .seams-hover-arrow {
|
|
1015
|
-
flex: 0 0 auto;
|
|
1016
|
-
margin-inline-end: 2px;
|
|
1017
|
-
fill: none;
|
|
1018
|
-
stroke: currentColor;
|
|
1019
|
-
stroke-width: 1.5;
|
|
1020
|
-
color: var(--seams-colors-textSecondary);
|
|
1021
|
-
transition: color 140ms ease;
|
|
1022
|
-
}
|
|
1023
|
-
.seams-hover-arrow-line {
|
|
1024
|
-
opacity: 0;
|
|
1025
|
-
filter: blur(2px);
|
|
1026
|
-
transform: scaleX(0.45);
|
|
1027
|
-
transform-origin: right center;
|
|
1028
|
-
transition:
|
|
1029
|
-
opacity 140ms cubic-bezier(0.215, 0.61, 0.355, 1),
|
|
1030
|
-
filter 140ms cubic-bezier(0.215, 0.61, 0.355, 1),
|
|
1031
|
-
transform 140ms cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
1032
|
-
}
|
|
1033
|
-
.seams-hover-arrow-tip {
|
|
1034
|
-
transition: transform 140ms cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
1035
|
-
}
|
|
1036
|
-
.seams-account-method-button:hover > .seams-hover-arrow,
|
|
1037
|
-
.seams-account-method-button:focus-visible > .seams-hover-arrow {
|
|
1038
|
-
color: var(--seams-colors-textPrimary);
|
|
1039
|
-
}
|
|
1040
|
-
.seams-account-method-button:hover .seams-hover-arrow-line,
|
|
1041
|
-
.seams-account-method-button:focus-visible .seams-hover-arrow-line {
|
|
1042
|
-
opacity: 1;
|
|
1043
|
-
filter: blur(0);
|
|
1044
|
-
transform: scaleX(1);
|
|
1045
|
-
}
|
|
1046
|
-
.seams-account-method-button:hover .seams-hover-arrow-tip,
|
|
1047
|
-
.seams-account-method-button:focus-visible .seams-hover-arrow-tip {
|
|
1048
|
-
transform: translateX(3px);
|
|
1049
|
-
}
|
|
1050
1089
|
@media (prefers-reduced-motion: reduce) {
|
|
1051
1090
|
.seams-account-method-button::before,
|
|
1052
|
-
.seams-account-method-button .seams-account-avatar
|
|
1053
|
-
.seams-hover-arrow-line,
|
|
1054
|
-
.seams-hover-arrow-tip {
|
|
1091
|
+
.seams-account-method-button .seams-account-avatar {
|
|
1055
1092
|
transition: none;
|
|
1056
1093
|
}
|
|
1057
1094
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
@import './components/AccountMenuButton/ExportKeysSection.css';
|
|
5
5
|
@import './components/AccountMenuButton/MenuItem.css';
|
|
6
6
|
@import './components/AccountMenuButton/ProfileDropdown.css';
|
|
7
|
+
@import './components/AccountMenuButton/icons/HoverArrowIcon.css';
|
|
7
8
|
@import './components/AccountMenuButton/icons/TouchIcon.css';
|
|
8
9
|
@import './components/AccountMenuButton/TransactionSettingsSection.css';
|
|
9
10
|
@import './components/AccountMenuButton/UserAccountButton.css';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,S as t}from"./chains-C_X_fNuS.js";import{n}from"./walletRegistrationSetupPrewarm-B9kpnrbK.js";import{t as r}from"./walletDbName-DtRewci9.js";import{_ as i,b as a,c as o,d as s,g as c,i as l,m as u,n as d,r as f,t as p,u as m,v as ee,y as te}from"./sessionObservationRevision-CnEOLDbl.js";import{a as h,c as g,i as _,l as ne,n as v,o as re,s as y,t as ie,u as ae}from"./transactionReviewAdmission-CIvR4W5_.js";import{t as b}from"./events-1dzC4Ocx.js";import{t as x}from"./walletIframeIdentity-Cz82I_Uh.js";import{t as S}from"./errors-DIWY1KR9.js";import{t as C}from"./signer-worker-DlK58rEA.js";function w(){let e=globalThis;e.global===void 0&&(e.global=globalThis),!e.process||typeof e.process!=`object`?e.process={env:{}}:(!e.process.env||typeof e.process.env!=`object`)&&(e.process.env={})}function T(){w(),window.location.origin===`null`&&(window.parent?.postMessage({type:`SERVICE_HOST_DEBUG_ORIGIN`,origin:window.location.origin,href:window.location.href},`*`),console.warn(`[WalletHost] iframe is running with opaque (null) origin. Check COEP/CORP headers and ensure navigation succeeded.`)),oe(),window.parent?.postMessage({type:`SERVICE_HOST_BOOTED`},`*`),window.parent?.postMessage({type:`SERVICE_HOST_DEBUG_ORIGIN`,origin:window.location.origin,href:window.location.href},`*`);let e=new URL(import.meta.url),t=e.searchParams.get(`v`);t&&c(t);let n=new URL(`.`,e).toString(),r=n.endsWith(`/`)?n:n+`/`;u()||i(r)}function oe(){let e=()=>{let e=document;e.documentElement.classList.add(`seams-transparent`),e.body?.classList.add(`seams-transparent`),e.documentElement.classList.remove(`dark`),e.body?.classList.remove(`dark`)};document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,()=>e(),{once:!0}):e(),window.addEventListener(`load`,()=>e(),{once:!0})}const E={};let D=null,O=null;function se(e){return e.type===`PM_ACKNOWLEDGE_WALLET_RECOVERY_CODE_BACKUP`?(D??=import(`./runtime-recovery-codes-GOytzExh.js`),D):k(e.kind)}function ce(){k(`auth`).catch(le)}function le(){}function k(e){let t=E[e];if(t)return t;let n=M(e);return E[e]=n,n.catch(A.bind(null,e,n)),n}function A(e,t){E[e]===t&&delete E[e]}async function j(){D??=import(`./runtime-recovery-codes-GOytzExh.js`),O??=Promise.all([D,import(`./mountRecoveryCodeBackupSurface-DlEb3uD7.js`)]).then(()=>void 0),await O}function M(e){switch(e){case`auth`:return import(`./runtime-auth-BNR1wI8E.js`);case`near`:return import(`./runtime-near-J3hKjC7G.js`);case`ecdsa`:return import(`./runtime-ecdsa-tempo-AGjT7Xpa.js`);case`email_otp`:return import(`./runtime-email-otp-BpBOuSsT.js`);case`recovery`:return import(`./runtime-recovery-BzewdcoT.js`);case`export`:return import(`./runtime-export-CBsacCPY.js`);case`device_link`:return import(`./runtime-device-link-Dq8g_UNb.js`);case`preferences`:return import(`./runtime-preferences-CVt5sLvm.js`)}return N(e)}function N(e){throw Error(`Unhandled wallet host runtime route: ${String(e)}`)}function P(e){switch(e.type){case`PM_GET_RECENT_UNLOCKS`:case`PM_GET_CONFIRMATION_CONFIG`:return!0;case`PM_GET_EXACT_WALLET_SESSION_STATE`:{let t=e.request.payload;if(!t||typeof t!=`object`)return!1;let n=Reflect.get(t,`authenticationRead`),r=Reflect.get(t,`wallet`);return(n===`restore`||n===`current`)&&!!r&&typeof r==`object`&&Reflect.get(r,`kind`)===`current`}default:return!1}}function F(e){switch(e.type){case`PM_GET_EXACT_WALLET_SESSION_STATE`:return{revision:p(),walletId:null,state:{kind:`wallet_locked`},session:d()};case`PM_GET_RECENT_UNLOCKS`:return{walletIds:[],accountIds:[],accounts:[],lastUsedAccount:null};case`PM_GET_CONFIRMATION_CONFIG`:return{walletId:null,confirmationConfig:C,revision:0}}}let I=null;function L(){return I??=z().finally(R),I}function R(){I=null}async function z(){try{return typeof indexedDB>`u`||typeof indexedDB.databases!=`function`?!1:(await indexedDB.databases()).some(B)?await V():!0}catch{return!1}}function B(e){return e.name===r}function V(){return new Promise(e=>{let t=indexedDB.open(r);t.onupgradeneeded=()=>t.transaction?.abort(),t.onerror=()=>e(!1),t.onsuccess=()=>{let n=t.result;n.onversionchange=()=>n.close(),H(n).then(t=>{n.close(),e(t===0)},()=>{n.close(),e(!1)})}})}function H(e){let t=Array.from(e.objectStoreNames);return t.length===0?Promise.resolve(0):new Promise((n,r)=>{let i=e.transaction(t,`readonly`),a=0;for(let e of t){let t=i.objectStore(e).count();t.onsuccess=()=>{a+=t.result}}i.oncomplete=()=>n(a),i.onerror=()=>r(i.error),i.onabort=()=>r(i.error)})}function U(e){throw Error(`Unhandled wallet host route: ${String(e)}`)}function W(e,t){if(e===null)throw Error(`Invalid ${t} payload`);return e}function G(e){try{return x(e)}catch{throw Error(`Hosted auth-menu request requires a non-empty requestId`)}}function ue(e){switch(e.type){case`PM_ACTIVATE_TRANSACTION_REVIEW`:case`PING`:case`PM_PREPARE_WALLET_RUNTIME`:case`PM_SET_CONFIG`:case`PM_CANCEL`:case`PM_SET_TRANSACTION_VIEW`:case`PM_TRANSACTION_BROADCAST_STARTED`:return{kind:`boot`,type:e.type,request:e};case`PM_REGISTER_WALLET`:case`PM_ADD_WALLET_SIGNER`:case`PM_ADD_PASSKEY`:case`PM_ADD_EMAIL_OTP`:case`PM_REVOKE_AUTH_METHOD`:case`PM_GET_NEAR_PROVISIONING_STATE`:case`PM_SIGN_TX_WITH_ACTIONS`:case`PM_SIGN_AND_SEND_TX`:case`PM_SEND_TRANSACTION`:case`PM_SIGN_DELEGATE_ACTION`:case`PM_SIGN_NEP413`:return{kind:`near`,type:e.type,request:e};case`PM_OPEN_AUTH_MENU`:{let t=G(e.requestId);return{kind:`auth`,type:e.type,request:{...e,requestId:t,payload:W(s(e.payload),`hosted auth-menu open`)}}}case`PM_CANCEL_AUTH_MENU`:{let t=G(e.requestId);return{kind:`auth`,type:e.type,request:{...e,requestId:t,payload:W(o(e.payload),`hosted auth-menu cancellation`)}}}case`PM_RESOLVE_AUTH_MENU_EXTERNAL_AUTH`:{let t=G(e.requestId);return{kind:`auth`,type:e.type,request:{...e,requestId:t,payload:W(m(e.payload),`hosted auth-menu external-auth resolution`)}}}case`PM_UNLOCK`:case`PM_LOCK`:case`PM_LOCK_EXACT_WALLET_SESSION`:case`PM_GET_LAST_WALLET_MOVE_REQUEST`:case`PM_MOVE_WALLET`:case`PM_GET_WALLET_MOVE`:case`PM_GET_WALLET_PLACEMENT`:case`PM_GET_WALLET_SESSION`:case`PM_GET_EXACT_WALLET_SESSION_STATE`:case`PM_GET_RECENT_UNLOCKS`:return{kind:`auth`,type:e.type,request:e};case`PM_SIGN_TEMPO`:case`PM_REPORT_TEMPO_BROADCAST_ACCEPTED`:case`PM_REPORT_TEMPO_BROADCAST_REJECTED`:case`PM_REPORT_TEMPO_FINALIZED`:case`PM_REPORT_TEMPO_DROPPED_OR_REPLACED`:case`PM_RECONCILE_TEMPO_NONCE_LANE`:return{kind:`ecdsa`,type:e.type,request:e};case`PM_REDEEM_HOSTED_WALLET_SEAMS_SESSION`:case`PM_REQUEST_EMAIL_OTP_CHALLENGE`:case`PM_BEGIN_GOOGLE_EMAIL_OTP_WALLET_AUTH`:case`PM_GOOGLE_EMAIL_OTP_WALLET_AUTH_RESEND`:case`PM_GOOGLE_EMAIL_OTP_WALLET_AUTH_REROLL_WALLET_ID`:case`PM_GOOGLE_EMAIL_OTP_WALLET_AUTH_SUBMIT`:case`PM_GOOGLE_EMAIL_OTP_WALLET_AUTH_COMPLETE_REGISTRATION`:case`PM_GOOGLE_EMAIL_OTP_WALLET_AUTH_CANCEL`:case`PM_GET_WALLET_RECOVERY_CODE_STATUS`:case`PM_ACKNOWLEDGE_WALLET_RECOVERY_CODE_BACKUP`:case`PM_ROTATE_WALLET_RECOVERY_CODES`:case`PM_REQUEST_WALLET_CUSTODY_EMAIL_OTP_CHALLENGE`:return{kind:`email_otp`,type:e.type,request:e};case`PM_SYNC_ACCOUNT_FLOW`:return{kind:`recovery`,type:e.type,request:e};case`PM_RESOLVE_EXACT_KEY_EXPORT_LANE`:case`PM_EXPORT_KEYPAIR_UI`:return{kind:`export`,type:e.type,request:e};case`PM_HAS_PASSKEY`:case`PM_LIST_LINKED_DEVICES`:case`PM_REVOKE_LINKED_DEVICE`:case`PM_SCAN_AND_LINK_DEVICE`:case`PM_START_DEVICE2_LINKING_FLOW`:case`PM_DEVICE_LINK_TARGET_FACTOR_ACTION`:case`PM_DEVICE_LINK_EMAIL_OTP_BASE_FACTOR_ACTION`:case`PM_CANCEL_DEVICE_LINKING`:return{kind:`device_link`,type:e.type,request:e};case`PM_SET_CONFIRM_BEHAVIOR`:case`PM_SET_CONFIRMATION_CONFIG`:case`PM_GET_CONFIRMATION_CONFIG`:return{kind:`preferences`,type:e.type,request:e}}return U(e)}function de(e){return e.kind!==`boot`}let K=!1;const fe=[{selector:`.seams-auth-menu-surface`,cancellationKind:`native_cancel`},{selector:`.seams-confirmation-surface`,cancellationKind:`native_cancel`},{selector:`.seams-export-surface`,cancellationKind:`wallet_iframe_cancel`},{selector:`[data-seams-wallet-recovery-backup-dialog]`,cancellationKind:`native_cancel`}];function q(e,t){let n=new Set(t),r=Object.keys(e);return r.length===t.length&&r.every(e=>n.has(e))}function pe(t){return!e(t)||!q(t,[`type`,`payload`])||t.type!==`CONNECT`||!e(t.payload)||!q(t.payload,[`protocolVersion`])?null:typeof t.payload.protocolVersion==`string`?{type:`CONNECT`,payload:{protocolVersion:t.payload.protocolVersion}}:null}function J(e){if(e===`null`)return!0;try{let t=new URL(e);return(t.protocol===`https:`||t.protocol===`http:`)&&t.origin===e}catch{return!1}}function Y(e){try{e.close()}catch{}}function me(e,t){if(t===`16.0.0`)return!1;let n={expectedProtocolVersion:l,receivedProtocolVersion:t};try{e.postMessage({type:`ERROR`,payload:{code:f,message:`Wallet iframe protocol version mismatch: expected ${l}, received ${t??`missing`}`,details:n}})}catch{}return Y(e),!0}function X(e,t){return!t||t.has(e)}function Z(e,t,n,r){e.executionGeneration===t&&n(r)}function Q(e,t,n,r){return e.executionGeneration!==t||n(r)}function $(e={}){if(K)return;K=!0,T(),(!e.supportedRuntimeRouteKinds||e.supportedRuntimeRouteKinds.has(`email_otp`))&&j().catch(()=>void 0);let r=new Set,i=new Set,o=!1,s={parentOrigin:null,port:null,configuration:{kind:`unconfigured`},executionGeneration:0,onConfigurationChanged:null},c=e=>{try{s.port?.postMessage(e)}catch{}},u=e=>{e&&r.add(e)},d=e=>!!e&&(r.has(e)||_(e)?.cancelled===!0),f=e=>{e&&r.delete(e)},p=e=>{e&&c({type:`ERROR`,requestId:e,payload:{code:`cancelled`,message:`Request cancelled`}})},m=e=>!e||!d(e)?!1:_(e)?.cancelled?!0:(p(e),f(e),!0),x=()=>{for(let e of fe){let t=document.querySelectorAll(e.selector);for(let n of t)try{e.cancellationKind===`native_cancel`?n.dispatchEvent(new Event(`cancel`,{cancelable:!0})):n.dispatchEvent(new CustomEvent(b.TX_CONFIRMER_CANCEL,{bubbles:!0,composed:!0}))}catch{}}},C=async r=>{let l=r.data;if(!l||!t(l))return;let b=l.requestId,C=s.executionGeneration,w=Z.bind(null,s,C,c),T=null;try{if(`transactionReview`in l){if(l.type!==`PM_SIGN_AND_SEND_TX`&&l.type!==`PM_SIGN_TEMPO`)throw new h(`review_invalid_input`,`Review is unsupported for this request`);let e=g(l.transactionReview);if(e.requestId!==b)throw new h(`review_invalid_input`,`Review request identity mismatch`);let t=l.payload?.options?.confirmationConfig;if(t?.uiMode!==`modal`||t.behavior!==`requireClick`)throw new h(`review_unsupported_mode`,`Review requires modal presentation and explicit approval`);T=new ie(e,l.type===`PM_SIGN_TEMPO`&&l.payload?.request.senderSignatureAlgorithm!==`secp256k1`?`credential`:`mpc`,e=>w({type:`TRANSACTION_REVIEW_STATE`,requestId:b,payload:e}),e=>w({type:`ERROR`,requestId:b,payload:{code:e instanceof h?e.code:`cancelled`,message:e.message}}))}(l.type===`PM_LOCK`||l.type===`PM_LOCK_EXACT_WALLET_SESSION`)&&v(new h(`review_identity_changed`,`The wallet session changed`));let t=ue(l);if(!de(t))switch(t.type){case`PING`:c({type:`PONG`,requestId:b});return;case`PM_PREPARE_WALLET_RUNTIME`:X(`auth`,e.supportedRuntimeRouteKinds)&&ce(),c({type:`PONG`,requestId:b});return;case`PM_SET_CONFIG`:{let e=ee(s.configuration,te(t.request.payload)),r=a(s.configuration.kind===`configured`?s.configuration.config:null)!==a(e.config);if(s.configuration=e,r){s.executionGeneration+=1;let t=e.config;t.registration.publishableKey&&t.registration.projectEnvironmentId&&n(t.network.relayer.url);for(let e of i)c({type:`ERROR`,requestId:e,payload:{code:`wallet_configuration_changed`,message:`Wallet configuration changed during request`}});i.clear()}s.onConfigurationChanged?.(),r&&(v(new h(`review_identity_changed`,`Wallet execution configuration changed`)),x()),c({type:`PONG`,requestId:b});return}case`PM_ACTIVATE_TRANSACTION_REVIEW`:{let e=y(t.request.payload);e&&_(e.requestId)?.activate(e);return}case`PM_CANCEL`:{let e=t.request.payload?.requestId,n=t.request.payload,r=n&&typeof n==`object`?Reflect.get(n,`transactionReview`):void 0;if(r!==void 0){let t=g(r),i=_(t.requestId);if(t.requestId===e&&i&&ne(t,i.metadata)){let e=new h(ae(n&&typeof n==`object`?Reflect.get(n,`reviewErrorCode`):void 0),`Reviewed request cancelled`);try{re(i.metadata.validity)}catch(t){t instanceof Error&&(e=t)}i.cancel(e)}c({type:`PONG`,requestId:b});return}let i=e?_(e):void 0;if(i){i.cancel(new h(`cancelled`,`Request cancelled`)),c({type:`PONG`,requestId:b});return}u(e),x(),e&&p(e),c({type:`PONG`,requestId:b});return}case`PM_SET_TRANSACTION_VIEW`:{let e=t.request.payload,n=e&&typeof e==`object`?Reflect.get(e,`requestId`):null,r=e&&typeof e==`object`?Reflect.get(e,`view`):null;typeof n==`string`&&(r===`toast`||r===`closed`)&&(await import(`./transaction-activity-Cccvec2J.js`).then(e=>e.o)).setTransactionActivityView(n,r);return}case`PM_TRANSACTION_BROADCAST_STARTED`:{let e=t.request.payload,n=e&&typeof e==`object`?Reflect.get(e,`signedTransaction`):null;typeof n==`string`&&(await import(`./transaction-activity-Cccvec2J.js`).then(e=>e.o)).transactionBroadcastStarted(n);return}}if(!X(t.kind,e.supportedRuntimeRouteKinds)){c({type:`ERROR`,requestId:b,payload:{code:`unsupported_request`,message:`Unsupported wallet iframe request type: ${t.type}`}});return}if(b&&i.add(b),!o&&P(t)&&await L()&&!o){if(C!==s.executionGeneration||m(b))return;w({type:`PM_RESULT`,requestId:b,payload:{ok:!0,result:F(t)}});return}o=!0;let r=await se(t);if(C!==s.executionGeneration)return;await r.handleWalletHostRuntimeRequest({transactionReview:T,state:s,executionGeneration:C,req:t.request,post:Z.bind(null,s,C,c),isCancelled:Q.bind(null,s,C,d),respondIfCancelled:Q.bind(null,s,C,m)})}catch(e){if(C!==s.executionGeneration&&l.type!==`PM_SET_CONFIG`||T?.cancelled)return;let t=await import(`./canonicalSignerErrorCode-Cz48v4oy.js`);if(C!==s.executionGeneration&&l.type!==`PM_SET_CONFIG`)return;let n=e&&typeof e==`object`&&`code`in e?e.code:void 0,r=S(e),i=t.resolveWalletBoundaryErrorCode({requestType:l.type,rawCode:n,message:r,defaultCode:`HOST_ERROR`}),a=t.resolveWalletBoundaryErrorMessage({requestType:l.type,rawCode:n,code:i,message:r}),o=t.resolveWalletBoundarySignerKind(l.type);c({type:`ERROR`,requestId:b,payload:{code:i,message:a,...t.isWalletSignerBoundaryRequestType(l.type)&&t.isCanonicalSignerSessionBoundaryCode(i)&&o?{signerKind:o}:{}}})}finally{b&&(i.delete(b),f(b)),T?.finish()}};window.addEventListener(`message`,e=>{let t=pe(e.data),n=e.ports[0];if(!(!t||!n||s.port)){if(e.source!==window.parent||!J(e.origin)){Y(n);return}if(!me(n,t.payload.protocolVersion)){typeof e.origin==`string`&&e.origin.length&&e.origin!==`null`&&(s.parentOrigin=e.origin),s.port=n;try{s.port.onmessage=C,s.port.start?.()}catch{}c({type:`READY`,payload:{protocolVersion:l}})}}})}try{$()}catch(e){console.error(`[WalletHost] init failed`,e)}export{$ as t};
|
|
1
|
+
import{C as e,S as t}from"./chains-C_X_fNuS.js";import{n}from"./walletRegistrationSetupPrewarm-B9kpnrbK.js";import{t as r}from"./walletDbName-DtRewci9.js";import{_ as i,b as a,c as o,d as s,g as c,i as l,m as u,n as d,r as f,t as p,u as m,v as ee,y as te}from"./sessionObservationRevision-CnEOLDbl.js";import{a as h,c as g,i as _,l as ne,n as v,o as re,s as y,t as ie,u as ae}from"./transactionReviewAdmission-CIvR4W5_.js";import{t as b}from"./events-1dzC4Ocx.js";import{t as x}from"./walletIframeIdentity-Cz82I_Uh.js";import{t as S}from"./errors-DIWY1KR9.js";import{t as C}from"./signer-worker-DlK58rEA.js";function w(){let e=globalThis;e.global===void 0&&(e.global=globalThis),!e.process||typeof e.process!=`object`?e.process={env:{}}:(!e.process.env||typeof e.process.env!=`object`)&&(e.process.env={})}function T(){w(),window.location.origin===`null`&&(window.parent?.postMessage({type:`SERVICE_HOST_DEBUG_ORIGIN`,origin:window.location.origin,href:window.location.href},`*`),console.warn(`[WalletHost] iframe is running with opaque (null) origin. Check COEP/CORP headers and ensure navigation succeeded.`)),oe(),window.parent?.postMessage({type:`SERVICE_HOST_BOOTED`},`*`),window.parent?.postMessage({type:`SERVICE_HOST_DEBUG_ORIGIN`,origin:window.location.origin,href:window.location.href},`*`);let e=new URL(import.meta.url),t=e.searchParams.get(`v`);t&&c(t);let n=new URL(`.`,e).toString(),r=n.endsWith(`/`)?n:n+`/`;u()||i(r)}function oe(){let e=()=>{let e=document;e.documentElement.classList.add(`seams-transparent`),e.body?.classList.add(`seams-transparent`),e.documentElement.classList.remove(`dark`),e.body?.classList.remove(`dark`)};document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,()=>e(),{once:!0}):e(),window.addEventListener(`load`,()=>e(),{once:!0})}const E={};let D=null,O=null;function se(e){return e.type===`PM_ACKNOWLEDGE_WALLET_RECOVERY_CODE_BACKUP`?(D??=import(`./runtime-recovery-codes-GOytzExh.js`),D):k(e.kind)}function ce(){k(`auth`).catch(le)}function le(){}function k(e){let t=E[e];if(t)return t;let n=M(e);return E[e]=n,n.catch(A.bind(null,e,n)),n}function A(e,t){E[e]===t&&delete E[e]}async function j(){D??=import(`./runtime-recovery-codes-GOytzExh.js`),O??=Promise.all([D,import(`./mountRecoveryCodeBackupSurface-DlEb3uD7.js`)]).then(()=>void 0),await O}function M(e){switch(e){case`auth`:return import(`./runtime-auth-ZcxkQ-XF.js`);case`near`:return import(`./runtime-near-J3hKjC7G.js`);case`ecdsa`:return import(`./runtime-ecdsa-tempo-AGjT7Xpa.js`);case`email_otp`:return import(`./runtime-email-otp-BpBOuSsT.js`);case`recovery`:return import(`./runtime-recovery-BzewdcoT.js`);case`export`:return import(`./runtime-export-CBsacCPY.js`);case`device_link`:return import(`./runtime-device-link-Dq8g_UNb.js`);case`preferences`:return import(`./runtime-preferences-CVt5sLvm.js`)}return N(e)}function N(e){throw Error(`Unhandled wallet host runtime route: ${String(e)}`)}function P(e){switch(e.type){case`PM_GET_RECENT_UNLOCKS`:case`PM_GET_CONFIRMATION_CONFIG`:return!0;case`PM_GET_EXACT_WALLET_SESSION_STATE`:{let t=e.request.payload;if(!t||typeof t!=`object`)return!1;let n=Reflect.get(t,`authenticationRead`),r=Reflect.get(t,`wallet`);return(n===`restore`||n===`current`)&&!!r&&typeof r==`object`&&Reflect.get(r,`kind`)===`current`}default:return!1}}function F(e){switch(e.type){case`PM_GET_EXACT_WALLET_SESSION_STATE`:return{revision:p(),walletId:null,state:{kind:`wallet_locked`},session:d()};case`PM_GET_RECENT_UNLOCKS`:return{walletIds:[],accountIds:[],accounts:[],lastUsedAccount:null};case`PM_GET_CONFIRMATION_CONFIG`:return{walletId:null,confirmationConfig:C,revision:0}}}let I=null;function L(){return I??=z().finally(R),I}function R(){I=null}async function z(){try{return typeof indexedDB>`u`||typeof indexedDB.databases!=`function`?!1:(await indexedDB.databases()).some(B)?await V():!0}catch{return!1}}function B(e){return e.name===r}function V(){return new Promise(e=>{let t=indexedDB.open(r);t.onupgradeneeded=()=>t.transaction?.abort(),t.onerror=()=>e(!1),t.onsuccess=()=>{let n=t.result;n.onversionchange=()=>n.close(),H(n).then(t=>{n.close(),e(t===0)},()=>{n.close(),e(!1)})}})}function H(e){let t=Array.from(e.objectStoreNames);return t.length===0?Promise.resolve(0):new Promise((n,r)=>{let i=e.transaction(t,`readonly`),a=0;for(let e of t){let t=i.objectStore(e).count();t.onsuccess=()=>{a+=t.result}}i.oncomplete=()=>n(a),i.onerror=()=>r(i.error),i.onabort=()=>r(i.error)})}function U(e){throw Error(`Unhandled wallet host route: ${String(e)}`)}function W(e,t){if(e===null)throw Error(`Invalid ${t} payload`);return e}function G(e){try{return x(e)}catch{throw Error(`Hosted auth-menu request requires a non-empty requestId`)}}function ue(e){switch(e.type){case`PM_ACTIVATE_TRANSACTION_REVIEW`:case`PING`:case`PM_PREPARE_WALLET_RUNTIME`:case`PM_SET_CONFIG`:case`PM_CANCEL`:case`PM_SET_TRANSACTION_VIEW`:case`PM_TRANSACTION_BROADCAST_STARTED`:return{kind:`boot`,type:e.type,request:e};case`PM_REGISTER_WALLET`:case`PM_ADD_WALLET_SIGNER`:case`PM_ADD_PASSKEY`:case`PM_ADD_EMAIL_OTP`:case`PM_REVOKE_AUTH_METHOD`:case`PM_GET_NEAR_PROVISIONING_STATE`:case`PM_SIGN_TX_WITH_ACTIONS`:case`PM_SIGN_AND_SEND_TX`:case`PM_SEND_TRANSACTION`:case`PM_SIGN_DELEGATE_ACTION`:case`PM_SIGN_NEP413`:return{kind:`near`,type:e.type,request:e};case`PM_OPEN_AUTH_MENU`:{let t=G(e.requestId);return{kind:`auth`,type:e.type,request:{...e,requestId:t,payload:W(s(e.payload),`hosted auth-menu open`)}}}case`PM_CANCEL_AUTH_MENU`:{let t=G(e.requestId);return{kind:`auth`,type:e.type,request:{...e,requestId:t,payload:W(o(e.payload),`hosted auth-menu cancellation`)}}}case`PM_RESOLVE_AUTH_MENU_EXTERNAL_AUTH`:{let t=G(e.requestId);return{kind:`auth`,type:e.type,request:{...e,requestId:t,payload:W(m(e.payload),`hosted auth-menu external-auth resolution`)}}}case`PM_UNLOCK`:case`PM_LOCK`:case`PM_LOCK_EXACT_WALLET_SESSION`:case`PM_GET_LAST_WALLET_MOVE_REQUEST`:case`PM_MOVE_WALLET`:case`PM_GET_WALLET_MOVE`:case`PM_GET_WALLET_PLACEMENT`:case`PM_GET_WALLET_SESSION`:case`PM_GET_EXACT_WALLET_SESSION_STATE`:case`PM_GET_RECENT_UNLOCKS`:return{kind:`auth`,type:e.type,request:e};case`PM_SIGN_TEMPO`:case`PM_REPORT_TEMPO_BROADCAST_ACCEPTED`:case`PM_REPORT_TEMPO_BROADCAST_REJECTED`:case`PM_REPORT_TEMPO_FINALIZED`:case`PM_REPORT_TEMPO_DROPPED_OR_REPLACED`:case`PM_RECONCILE_TEMPO_NONCE_LANE`:return{kind:`ecdsa`,type:e.type,request:e};case`PM_REDEEM_HOSTED_WALLET_SEAMS_SESSION`:case`PM_REQUEST_EMAIL_OTP_CHALLENGE`:case`PM_BEGIN_GOOGLE_EMAIL_OTP_WALLET_AUTH`:case`PM_GOOGLE_EMAIL_OTP_WALLET_AUTH_RESEND`:case`PM_GOOGLE_EMAIL_OTP_WALLET_AUTH_REROLL_WALLET_ID`:case`PM_GOOGLE_EMAIL_OTP_WALLET_AUTH_SUBMIT`:case`PM_GOOGLE_EMAIL_OTP_WALLET_AUTH_COMPLETE_REGISTRATION`:case`PM_GOOGLE_EMAIL_OTP_WALLET_AUTH_CANCEL`:case`PM_GET_WALLET_RECOVERY_CODE_STATUS`:case`PM_ACKNOWLEDGE_WALLET_RECOVERY_CODE_BACKUP`:case`PM_ROTATE_WALLET_RECOVERY_CODES`:case`PM_REQUEST_WALLET_CUSTODY_EMAIL_OTP_CHALLENGE`:return{kind:`email_otp`,type:e.type,request:e};case`PM_SYNC_ACCOUNT_FLOW`:return{kind:`recovery`,type:e.type,request:e};case`PM_RESOLVE_EXACT_KEY_EXPORT_LANE`:case`PM_EXPORT_KEYPAIR_UI`:return{kind:`export`,type:e.type,request:e};case`PM_HAS_PASSKEY`:case`PM_LIST_LINKED_DEVICES`:case`PM_REVOKE_LINKED_DEVICE`:case`PM_SCAN_AND_LINK_DEVICE`:case`PM_START_DEVICE2_LINKING_FLOW`:case`PM_DEVICE_LINK_TARGET_FACTOR_ACTION`:case`PM_DEVICE_LINK_EMAIL_OTP_BASE_FACTOR_ACTION`:case`PM_CANCEL_DEVICE_LINKING`:return{kind:`device_link`,type:e.type,request:e};case`PM_SET_CONFIRM_BEHAVIOR`:case`PM_SET_CONFIRMATION_CONFIG`:case`PM_GET_CONFIRMATION_CONFIG`:return{kind:`preferences`,type:e.type,request:e}}return U(e)}function de(e){return e.kind!==`boot`}let K=!1;const fe=[{selector:`.seams-auth-menu-surface`,cancellationKind:`native_cancel`},{selector:`.seams-confirmation-surface`,cancellationKind:`native_cancel`},{selector:`.seams-export-surface`,cancellationKind:`wallet_iframe_cancel`},{selector:`[data-seams-wallet-recovery-backup-dialog]`,cancellationKind:`native_cancel`}];function q(e,t){let n=new Set(t),r=Object.keys(e);return r.length===t.length&&r.every(e=>n.has(e))}function pe(t){return!e(t)||!q(t,[`type`,`payload`])||t.type!==`CONNECT`||!e(t.payload)||!q(t.payload,[`protocolVersion`])?null:typeof t.payload.protocolVersion==`string`?{type:`CONNECT`,payload:{protocolVersion:t.payload.protocolVersion}}:null}function J(e){if(e===`null`)return!0;try{let t=new URL(e);return(t.protocol===`https:`||t.protocol===`http:`)&&t.origin===e}catch{return!1}}function Y(e){try{e.close()}catch{}}function me(e,t){if(t===`16.0.0`)return!1;let n={expectedProtocolVersion:l,receivedProtocolVersion:t};try{e.postMessage({type:`ERROR`,payload:{code:f,message:`Wallet iframe protocol version mismatch: expected ${l}, received ${t??`missing`}`,details:n}})}catch{}return Y(e),!0}function X(e,t){return!t||t.has(e)}function Z(e,t,n,r){e.executionGeneration===t&&n(r)}function Q(e,t,n,r){return e.executionGeneration!==t||n(r)}function $(e={}){if(K)return;K=!0,T(),(!e.supportedRuntimeRouteKinds||e.supportedRuntimeRouteKinds.has(`email_otp`))&&j().catch(()=>void 0);let r=new Set,i=new Set,o=!1,s={parentOrigin:null,port:null,configuration:{kind:`unconfigured`},executionGeneration:0,onConfigurationChanged:null},c=e=>{try{s.port?.postMessage(e)}catch{}},u=e=>{e&&r.add(e)},d=e=>!!e&&(r.has(e)||_(e)?.cancelled===!0),f=e=>{e&&r.delete(e)},p=e=>{e&&c({type:`ERROR`,requestId:e,payload:{code:`cancelled`,message:`Request cancelled`}})},m=e=>!e||!d(e)?!1:_(e)?.cancelled?!0:(p(e),f(e),!0),x=()=>{for(let e of fe){let t=document.querySelectorAll(e.selector);for(let n of t)try{e.cancellationKind===`native_cancel`?n.dispatchEvent(new Event(`cancel`,{cancelable:!0})):n.dispatchEvent(new CustomEvent(b.TX_CONFIRMER_CANCEL,{bubbles:!0,composed:!0}))}catch{}}},C=async r=>{let l=r.data;if(!l||!t(l))return;let b=l.requestId,C=s.executionGeneration,w=Z.bind(null,s,C,c),T=null;try{if(`transactionReview`in l){if(l.type!==`PM_SIGN_AND_SEND_TX`&&l.type!==`PM_SIGN_TEMPO`)throw new h(`review_invalid_input`,`Review is unsupported for this request`);let e=g(l.transactionReview);if(e.requestId!==b)throw new h(`review_invalid_input`,`Review request identity mismatch`);let t=l.payload?.options?.confirmationConfig;if(t?.uiMode!==`modal`||t.behavior!==`requireClick`)throw new h(`review_unsupported_mode`,`Review requires modal presentation and explicit approval`);T=new ie(e,l.type===`PM_SIGN_TEMPO`&&l.payload?.request.senderSignatureAlgorithm!==`secp256k1`?`credential`:`mpc`,e=>w({type:`TRANSACTION_REVIEW_STATE`,requestId:b,payload:e}),e=>w({type:`ERROR`,requestId:b,payload:{code:e instanceof h?e.code:`cancelled`,message:e.message}}))}(l.type===`PM_LOCK`||l.type===`PM_LOCK_EXACT_WALLET_SESSION`)&&v(new h(`review_identity_changed`,`The wallet session changed`));let t=ue(l);if(!de(t))switch(t.type){case`PING`:c({type:`PONG`,requestId:b});return;case`PM_PREPARE_WALLET_RUNTIME`:X(`auth`,e.supportedRuntimeRouteKinds)&&ce(),c({type:`PONG`,requestId:b});return;case`PM_SET_CONFIG`:{let e=ee(s.configuration,te(t.request.payload)),r=a(s.configuration.kind===`configured`?s.configuration.config:null)!==a(e.config);if(s.configuration=e,r){s.executionGeneration+=1;let t=e.config;t.registration.publishableKey&&t.registration.projectEnvironmentId&&n(t.network.relayer.url);for(let e of i)c({type:`ERROR`,requestId:e,payload:{code:`wallet_configuration_changed`,message:`Wallet configuration changed during request`}});i.clear()}s.onConfigurationChanged?.(),r&&(v(new h(`review_identity_changed`,`Wallet execution configuration changed`)),x()),c({type:`PONG`,requestId:b});return}case`PM_ACTIVATE_TRANSACTION_REVIEW`:{let e=y(t.request.payload);e&&_(e.requestId)?.activate(e);return}case`PM_CANCEL`:{let e=t.request.payload?.requestId,n=t.request.payload,r=n&&typeof n==`object`?Reflect.get(n,`transactionReview`):void 0;if(r!==void 0){let t=g(r),i=_(t.requestId);if(t.requestId===e&&i&&ne(t,i.metadata)){let e=new h(ae(n&&typeof n==`object`?Reflect.get(n,`reviewErrorCode`):void 0),`Reviewed request cancelled`);try{re(i.metadata.validity)}catch(t){t instanceof Error&&(e=t)}i.cancel(e)}c({type:`PONG`,requestId:b});return}let i=e?_(e):void 0;if(i){i.cancel(new h(`cancelled`,`Request cancelled`)),c({type:`PONG`,requestId:b});return}u(e),x(),e&&p(e),c({type:`PONG`,requestId:b});return}case`PM_SET_TRANSACTION_VIEW`:{let e=t.request.payload,n=e&&typeof e==`object`?Reflect.get(e,`requestId`):null,r=e&&typeof e==`object`?Reflect.get(e,`view`):null;typeof n==`string`&&(r===`toast`||r===`closed`)&&(await import(`./transaction-activity-Cccvec2J.js`).then(e=>e.o)).setTransactionActivityView(n,r);return}case`PM_TRANSACTION_BROADCAST_STARTED`:{let e=t.request.payload,n=e&&typeof e==`object`?Reflect.get(e,`signedTransaction`):null;typeof n==`string`&&(await import(`./transaction-activity-Cccvec2J.js`).then(e=>e.o)).transactionBroadcastStarted(n);return}}if(!X(t.kind,e.supportedRuntimeRouteKinds)){c({type:`ERROR`,requestId:b,payload:{code:`unsupported_request`,message:`Unsupported wallet iframe request type: ${t.type}`}});return}if(b&&i.add(b),!o&&P(t)&&await L()&&!o){if(C!==s.executionGeneration||m(b))return;w({type:`PM_RESULT`,requestId:b,payload:{ok:!0,result:F(t)}});return}o=!0;let r=await se(t);if(C!==s.executionGeneration)return;await r.handleWalletHostRuntimeRequest({transactionReview:T,state:s,executionGeneration:C,req:t.request,post:Z.bind(null,s,C,c),isCancelled:Q.bind(null,s,C,d),respondIfCancelled:Q.bind(null,s,C,m)})}catch(e){if(C!==s.executionGeneration&&l.type!==`PM_SET_CONFIG`||T?.cancelled)return;let t=await import(`./canonicalSignerErrorCode-Cz48v4oy.js`);if(C!==s.executionGeneration&&l.type!==`PM_SET_CONFIG`)return;let n=e&&typeof e==`object`&&`code`in e?e.code:void 0,r=S(e),i=t.resolveWalletBoundaryErrorCode({requestType:l.type,rawCode:n,message:r,defaultCode:`HOST_ERROR`}),a=t.resolveWalletBoundaryErrorMessage({requestType:l.type,rawCode:n,code:i,message:r}),o=t.resolveWalletBoundarySignerKind(l.type);c({type:`ERROR`,requestId:b,payload:{code:i,message:a,...t.isWalletSignerBoundaryRequestType(l.type)&&t.isCanonicalSignerSessionBoundaryCode(i)&&o?{signerKind:o}:{}}})}finally{b&&(i.delete(b),f(b)),T?.finish()}};window.addEventListener(`message`,e=>{let t=pe(e.data),n=e.ports[0];if(!(!t||!n||s.port)){if(e.source!==window.parent||!J(e.origin)){Y(n);return}if(!me(n,t.payload.protocolVersion)){typeof e.origin==`string`&&e.origin.length&&e.origin!==`null`&&(s.parentOrigin=e.origin),s.port=n;try{s.port.onmessage=C,s.port.start?.()}catch{}c({type:`READY`,payload:{protocolVersion:l}})}}})}try{$()}catch(e){console.error(`[WalletHost] init failed`,e)}export{$ as t};
|