@arcblock/ux 3.0.9 → 3.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/lib/Address/did-address.js +47 -49
  2. package/lib/Address/responsive-did-address.js +53 -57
  3. package/lib/Avatar/index.js +16 -16
  4. package/lib/BlockletV2/blocklet.js +64 -64
  5. package/lib/BlockletV2/components/tooltip-icon.js +26 -27
  6. package/lib/CardSelector/index.js +1 -2
  7. package/lib/ClickToCopy/hook.js +10 -11
  8. package/lib/ClickToCopy/index.js +16 -16
  9. package/lib/Config/theme-mode-toggle.js +7 -8
  10. package/lib/DID/index.js +131 -133
  11. package/lib/DIDConnect/app-info-item.js +18 -18
  12. package/lib/DIDConnect/auth-apps/index.js +83 -84
  13. package/lib/DIDConnect/did-connect-container.js +89 -90
  14. package/lib/DIDConnect/did-connect-footer.js +25 -25
  15. package/lib/DIDConnect/landing-page.js +17 -17
  16. package/lib/DIDConnect/powered-by.js +11 -11
  17. package/lib/DIDConnect/request-storage-access-api-dialog.js +36 -37
  18. package/lib/DIDConnect/with-container.js +66 -68
  19. package/lib/Dialog/use-confirm.js +40 -43
  20. package/lib/Earth/index.js +21 -22
  21. package/lib/Footer/index.js +15 -16
  22. package/lib/Header/responsive-header.js +23 -24
  23. package/lib/Layout/dashboard/index.js +63 -72
  24. package/lib/Layout/dashboard/sidebar.js +20 -21
  25. package/lib/Layout/dashboard-legacy/index.js +52 -52
  26. package/lib/Locale/context.js +36 -37
  27. package/lib/Locale/selector.js +40 -42
  28. package/lib/NFTDisplay/index.js +114 -118
  29. package/lib/NFTDisplay/render-svg.js +12 -12
  30. package/lib/NavMenu/nav-menu.js +159 -161
  31. package/lib/NavMenu/sub-container.js +25 -26
  32. package/lib/PageScroller/index.js +28 -32
  33. package/lib/Passport/passport.js +11 -11
  34. package/lib/PhoneInput/country-select.js +38 -38
  35. package/lib/PhoneInput/index.js +65 -66
  36. package/lib/Screenshot/index.js +26 -27
  37. package/lib/SessionBlocklet/index.js +87 -93
  38. package/lib/SessionPermission/index.js +5 -9
  39. package/lib/SessionUser/components/did-space.js +24 -25
  40. package/lib/SessionUser/components/logged-in.js +122 -127
  41. package/lib/SessionUser/components/quick-login-item.js +41 -42
  42. package/lib/SessionUser/components/session-user-item.js +35 -36
  43. package/lib/SessionUser/components/session-user-switch.js +81 -85
  44. package/lib/SessionUser/components/un-login.js +41 -41
  45. package/lib/SessionUser/components/user-info.js +43 -47
  46. package/lib/SessionUser/index.js +1 -1
  47. package/lib/SessionUser/libs/utils.js +24 -30
  48. package/lib/SharedBridge/index.js +35 -35
  49. package/lib/Theme/index.js +16 -16
  50. package/lib/Theme/theme.js +42 -43
  51. package/lib/Toast/index.js +24 -25
  52. package/lib/Typography/index.js +42 -42
  53. package/lib/UserCard/Content/basic.js +91 -93
  54. package/lib/UserCard/Content/shorten-label.js +9 -9
  55. package/lib/UserCard/components.js +15 -15
  56. package/lib/Util/deprecate.js +1 -1
  57. package/lib/Util/federated.js +28 -32
  58. package/lib/Util/iframe.js +9 -10
  59. package/lib/Util/index.js +134 -135
  60. package/lib/Util/security.js +9 -10
  61. package/lib/Util/wallet.js +6 -9
  62. package/lib/VerificationCode/index.js +26 -28
  63. package/lib/hooks/use-blocklet-logo.js +11 -14
  64. package/lib/ux.css +1 -1
  65. package/lib/withTracker/index.js +13 -14
  66. package/package.json +10 -11
@@ -1,49 +1,48 @@
1
- import { jsx as x } from "react/jsx-runtime";
2
- import { Tooltip as n, tooltipClasses as f } from "@mui/material";
3
- import { mergeSx as u } from "../../Util/style.js";
4
- function I({
5
- title: t,
6
- sx: c,
7
- children: p,
8
- slotProps: e,
9
- fontSize: a = 12,
10
- fontWeight: m = 500,
11
- color: r = "text.contrast",
12
- ...i
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { Tooltip as i, tooltipClasses as x } from "@mui/material";
3
+ import { mergeSx as l } from "../../Util/style.js";
4
+ function d({
5
+ title: o,
6
+ sx: n,
7
+ children: t,
8
+ slotProps: p,
9
+ fontSize: r = 12,
10
+ fontWeight: e = 500,
11
+ color: s = "text.contrast",
12
+ ...a
13
13
  }) {
14
- var o;
15
- return t ? /* @__PURE__ */ x(
16
- n,
14
+ return o ? /* @__PURE__ */ m(
15
+ i,
17
16
  {
18
- title: t,
17
+ title: o,
19
18
  placement: "top",
20
- ...i,
19
+ ...a,
21
20
  slotProps: {
22
21
  popper: {
23
- ...e == null ? void 0 : e.popper,
24
- sx: u(
22
+ ...p?.popper,
23
+ sx: l(
25
24
  {
26
- [`& .${f.tooltip}`]: {
27
- fontSize: a,
28
- fontWeight: m,
25
+ [`& .${x.tooltip}`]: {
26
+ fontSize: r,
27
+ fontWeight: e,
29
28
  boxShadow: 2,
30
29
  marginBottom: "6px !important",
31
30
  borderRadius: "8px",
32
31
  cursor: "default",
33
- color: r,
32
+ color: s,
34
33
  display: "flex",
35
34
  alignItems: "center"
36
35
  }
37
36
  },
38
37
  // @ts-expect-error
39
- (o = e == null ? void 0 : e.popper) == null ? void 0 : o.sx
38
+ p?.popper?.sx
40
39
  )
41
40
  }
42
41
  },
43
- children: p
42
+ children: t
44
43
  }
45
- ) : p;
44
+ ) : t;
46
45
  }
47
46
  export {
48
- I as default
47
+ d as default
49
48
  };
@@ -20,8 +20,7 @@ function $({
20
20
  }
21
21
  };
22
22
  y(() => {
23
- var t;
24
- n(h), (t = c.current) == null || t.addEventListener("touchmove", (e) => e.preventDefault(), { passive: !1 });
23
+ n(h), c.current?.addEventListener("touchmove", (t) => t.preventDefault(), { passive: !1 });
25
24
  }, []);
26
25
  let d;
27
26
  return /* @__PURE__ */ r(b, { ref: c, onTouchStart: (t) => {
@@ -1,6 +1,6 @@
1
- import { useState as u, useRef as f, useEffect as a } from "react";
2
- import l from "copy-to-clipboard";
3
- const r = {
1
+ import { useState as p, useRef as u, useEffect as f } from "react";
2
+ import a from "copy-to-clipboard";
3
+ const i = {
4
4
  en: {
5
5
  copy: "Click To Copy",
6
6
  copied: "Copied!"
@@ -10,21 +10,20 @@ const r = {
10
10
  copied: "已复制!"
11
11
  }
12
12
  };
13
- function d({ content: s, locale: c = "en" }) {
14
- const [t, o] = u(!1), n = f(null), p = (e) => {
15
- var i;
16
- e && e.stopPropagation(), l(s || (((i = n.current) == null ? void 0 : i.textContent) ?? "")), o(!0);
13
+ function C({ content: r, locale: s = "en" }) {
14
+ const [t, o] = p(!1), n = u(null), c = (e) => {
15
+ e && e.stopPropagation(), a(r || (n.current?.textContent ?? "")), o(!0);
17
16
  };
18
- return a(() => {
17
+ return f(() => {
19
18
  let e;
20
19
  return t && (e = setTimeout(() => o(!1), 2e3)), () => clearTimeout(e);
21
20
  }, [t]), {
22
21
  containerRef: n,
23
22
  copied: t,
24
- copy: p,
25
- texts: r[c] || r.en
23
+ copy: c,
24
+ texts: i[s] || i.en
26
25
  };
27
26
  }
28
27
  export {
29
- d as default
28
+ C as default
30
29
  };
@@ -1,14 +1,14 @@
1
- import { jsx as e, Fragment as v } from "react/jsx-runtime";
2
- import { useSize as F } from "ahooks";
3
- import { Tooltip as S } from "@mui/material";
1
+ import { jsx as e, Fragment as j } from "react/jsx-runtime";
2
+ import { useSize as z } from "ahooks";
3
+ import { Tooltip as v } from "@mui/material";
4
4
  import t from "lodash/isUndefined";
5
- import { useSnackbar as U } from "notistack";
6
- import _ from "./hook.js";
7
- import B, { ToastProvider as L } from "../Toast/index.js";
8
- import { mergeProps as O } from "../Util/index.js";
5
+ import { useSnackbar as F } from "notistack";
6
+ import S from "./hook.js";
7
+ import U, { ToastProvider as _ } from "../Toast/index.js";
8
+ import { mergeProps as B } from "../Util/index.js";
9
9
  import { styled as s } from "../Theme/index.js";
10
10
  import { default as X } from "./copy-button.js";
11
- const R = s("span")`
11
+ const L = s("span")`
12
12
  display: inline;
13
13
  white-space: pre-wrap;
14
14
  word-wrap: break-word;
@@ -19,18 +19,18 @@ const R = s("span")`
19
19
  padding: 1px 12px;
20
20
  background-color: rgba(0, 0, 0, 0.08);
21
21
  cursor: pointer;
22
- `, q = s("span")`
22
+ `, O = s("span")`
23
23
  cursor: pointer;
24
24
  `;
25
- function z(a) {
26
- const o = Object.assign({}, a);
25
+ function R(c) {
26
+ const o = Object.assign({}, c);
27
27
  t(o.content) && (o.content = ""), t(o.tip) && (o.tip = ""), t(o.copiedTip) && (o.copiedTip = ""), t(o.tipPlacement) && (o.tipPlacement = "right"), t(o.locale) && (o.locale = "en"), t(o.unstyled) && (o.unstyled = !1);
28
- const d = O(o, z, ["style"]), { children: l, content: r, tip: m, copiedTip: f, tipPlacement: u, locale: y, style: C, unstyled: w, ...b } = d, { containerRef: h, copied: g, copy: x, texts: i } = _({ content: r, locale: y }), T = m || i.copy, p = f || i.copied, k = U(), n = F(document.body), P = (n == null ? void 0 : n.width) || 0, c = /* @__PURE__ */ e(S, { title: g ? p : T, ...b, placement: u, disableFocusListener: !0, children: /* @__PURE__ */ e(w ? q : R, { ref: h, style: C, onClick: (j) => {
29
- x(j), P < 600 && B.success(p);
30
- }, children: l || r }) });
31
- return k ? /* @__PURE__ */ e(v, { children: c }) : /* @__PURE__ */ e(L, { children: c });
28
+ const a = B(o, R, ["style"]), { children: d, content: n, tip: l, copiedTip: m, tipPlacement: f, locale: u, style: y, unstyled: C, ...w } = a, { containerRef: b, copied: h, copy: g, texts: i } = S({ content: n, locale: u }), x = l || i.copy, r = m || i.copied, T = F(), k = z(document.body)?.width || 0, p = /* @__PURE__ */ e(v, { title: h ? r : x, ...w, placement: f, disableFocusListener: !0, children: /* @__PURE__ */ e(C ? O : L, { ref: b, style: y, onClick: (P) => {
29
+ g(P), k < 600 && U.success(r);
30
+ }, children: d || n }) });
31
+ return T ? /* @__PURE__ */ e(j, { children: p }) : /* @__PURE__ */ e(_, { children: p });
32
32
  }
33
33
  export {
34
34
  X as CopyButton,
35
- z as default
35
+ R as default
36
36
  };
@@ -1,12 +1,11 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { IconButton as l } from "@mui/material";
3
- import { Brightness2Outlined as s, LightModeOutlined as m } from "@mui/icons-material";
4
- import { useColorScheme as u } from "../Theme/theme-provider.js";
5
- function h() {
6
- var r, t;
7
- const { mode: n, toggleMode: o, prefer: i } = u();
8
- return o ? i === "system" || ((t = (r = window.blocklet) == null ? void 0 : r.theme) == null ? void 0 : t.prefer) === "system" ? /* @__PURE__ */ e(l, { onClick: o, children: n === "light" ? /* @__PURE__ */ e(s, {}) : /* @__PURE__ */ e(m, {}) }) : null : (process.env.NODE_ENV !== "production" && console.warn("Please ensure the component is wrapped with ConfigProvider context"), null);
2
+ import { IconButton as n } from "@mui/material";
3
+ import { Brightness2Outlined as i, LightModeOutlined as l } from "@mui/icons-material";
4
+ import { useColorScheme as s } from "../Theme/theme-provider.js";
5
+ function f() {
6
+ const { mode: r, toggleMode: o, prefer: t } = s();
7
+ return o ? t === "system" || window.blocklet?.theme?.prefer === "system" ? /* @__PURE__ */ e(n, { onClick: o, children: r === "light" ? /* @__PURE__ */ e(i, {}) : /* @__PURE__ */ e(l, {}) }) : null : (process.env.NODE_ENV !== "production" && console.warn("Please ensure the component is wrapped with ConfigProvider context"), null);
9
8
  }
10
9
  export {
11
- h as default
10
+ f as default
12
11
  };
package/lib/DID/index.js CHANGED
@@ -1,20 +1,20 @@
1
- import { jsxs as x, Fragment as H, jsx as t } from "react/jsx-runtime";
2
- import { getDIDMotifInfo as j } from "@arcblock/did-motif";
3
- import { types as P } from "@ocap/mcrypto";
4
- import q from "qrcode.react";
5
- import { Icon as X } from "@iconify/react";
6
- import Y from "@iconify-icons/material-symbols/qr-code-rounded";
7
- import { Box as N, Dialog as G, DialogContent as J, Typography as S } from "@mui/material";
8
- import { useMemoizedFn as v, useCreation as g } from "ahooks";
9
- import { useRef as K, useState as V, useImperativeHandle as Z } from "react";
10
- import { toAddress as ee } from "@arcblock/did";
11
- import oe from "lodash/noop";
12
- import k from "../Address/index.js";
13
- import re from "../Avatar/index.js";
14
- import { DID_PREFIX as te } from "../Util/constant.js";
15
- import { translate as ne } from "../Locale/util.js";
16
- import { isEthereumDid as se, getDIDColor as ie } from "../Util/index.js";
17
- const ae = {
1
+ import { jsxs as w, Fragment as Q, jsx as t } from "react/jsx-runtime";
2
+ import { getDIDMotifInfo as O } from "@arcblock/did-motif";
3
+ import { types as E } from "@ocap/mcrypto";
4
+ import j from "qrcode.react";
5
+ import { Icon as q } from "@iconify/react";
6
+ import X from "@iconify-icons/material-symbols/qr-code-rounded";
7
+ import { Box as H, Dialog as Y, DialogContent as G, Typography as P } from "@mui/material";
8
+ import { useMemoizedFn as b, useCreation as D } from "ahooks";
9
+ import { useRef as J, useState as K, useImperativeHandle as V } from "react";
10
+ import { toAddress as Z } from "@arcblock/did";
11
+ import ee from "lodash/noop";
12
+ import W from "../Address/index.js";
13
+ import oe from "../Avatar/index.js";
14
+ import { DID_PREFIX as re } from "../Util/constant.js";
15
+ import { translate as te } from "../Locale/util.js";
16
+ import { isEthereumDid as ne, getDIDColor as se } from "../Util/index.js";
17
+ const ie = {
18
18
  en: {
19
19
  scanQrcode: "Scan with DID Wallet to view the {role}",
20
20
  download: "Download",
@@ -25,129 +25,128 @@ const ae = {
25
25
  download: "下载",
26
26
  downloadTips: "没有 DID Wallet ?"
27
27
  }
28
- }, A = "xenon-2020-01-15", W = {
29
- main: A,
30
- "main.abtnetwork.io": A,
28
+ }, y = "xenon-2020-01-15", S = {
29
+ main: y,
30
+ "main.abtnetwork.io": y,
31
31
  "beta.abtnetwork.io": "beta"
32
- }, le = (e, r, o) => o ? ie(e) : r.color, de = (e) => !{
32
+ }, ae = (e, r, o) => o ? se(e) : r.color, de = (e) => !{
33
33
  0: !0,
34
34
  // ACCOUNT
35
35
  6: !0,
36
36
  // ASSET
37
37
  17: !0
38
38
  // TOKEN
39
- }[e], ce = (e) => {
40
- if (e === P.RoleType.ROLE_ANY)
39
+ }[e], le = (e) => {
40
+ if (e === E.RoleType.ROLE_ANY)
41
41
  return "DID";
42
- const [r] = Object.entries(P.RoleType).find((o) => o[1] === e) || [];
42
+ const [r] = Object.entries(E.RoleType).find((o) => o[1] === e) || [];
43
43
  return r ? r.toLowerCase().replace(/role_(\S)/g, (o, n) => n.toUpperCase()) : "DID";
44
- }, pe = (e, r, o) => r || de(e.roleType) ? o * 0.75 : o;
45
- function F({ did: e, showAvatar: r }) {
46
- const o = se(e), n = o ? void 0 : j(e), f = g(() => o ? e : `${te}${e}`, [e, o]), c = v((i, a) => [
44
+ }, ce = (e, r, o) => r || de(e.roleType) ? o * 0.75 : o;
45
+ function M({ did: e, showAvatar: r }) {
46
+ const o = ne(e), n = o ? void 0 : O(e), u = D(() => o ? e : `${re}${e}`, [e, o]), c = b((s, a) => [
47
47
  /* @__PURE__ */ t(
48
48
  "span",
49
49
  {
50
- style: { flex: "0 0 auto", color: le(e, n, o) },
50
+ style: { flex: "0 0 auto", color: ae(e, n, o) },
51
51
  children: "DID:"
52
52
  },
53
- `${a}-prefix-did-${i}`
53
+ `${a}-prefix-did-${s}`
54
54
  ),
55
- /* @__PURE__ */ x("span", { className: "did-address-text", children: [
55
+ /* @__PURE__ */ w("span", { className: "did-address-text", children: [
56
56
  o ? "ETH" : "ABT",
57
57
  ":"
58
- ] }, `${a}-prefix-abt-${i}`),
58
+ ] }, `${a}-prefix-abt-${s}`),
59
59
  r && /* @__PURE__ */ t(
60
- re,
60
+ oe,
61
61
  {
62
62
  src: "",
63
63
  did: e,
64
- size: pe(n, o, i || 18),
64
+ size: ce(n, o, s || 18),
65
65
  style: { display: "inline-flex", alignItems: "center", marginLeft: 2, marginRight: 4 },
66
66
  blockiesPadding: !1,
67
67
  className: "did-address-avatar",
68
68
  sx: { flexShrink: 0 }
69
69
  },
70
- `${a}-avatar-${i}`
70
+ `${a}-avatar-${s}`
71
71
  )
72
72
  ]);
73
73
  return {
74
74
  isEthDid: o,
75
75
  didMotifInfo: n,
76
- content: f,
76
+ content: u,
77
77
  getPrepend: c
78
78
  };
79
79
  }
80
- function _e({
80
+ function $e({
81
81
  ref: e = void 0,
82
82
  ...r
83
83
  }) {
84
84
  const {
85
85
  did: o,
86
86
  chainId: n,
87
- roleType: f,
87
+ roleType: u,
88
88
  showAvatar: c = !0,
89
- showQrcode: i = !1,
89
+ showQrcode: s = !1,
90
90
  locale: a = "en",
91
- size: T = 0,
92
- component: l = "span",
93
- copyable: R = !0,
94
- responsive: h = !0,
91
+ size: v = 0,
92
+ component: d = "span",
93
+ copyable: A = !0,
94
+ responsive: m = !0,
95
95
  showCopyButtonInTooltip: p = !1,
96
- inline: u = !1,
97
- append: D = null,
98
- compact: $ = !1,
99
- startChars: I = 6,
100
- endChars: _ = 6,
101
- style: w,
102
- className: Q,
103
- sx: m
104
- } = r, s = ee(o), d = {
105
- size: T,
106
- component: l,
107
- copyable: R,
108
- responsive: h,
96
+ inline: f = !1,
97
+ append: R = null,
98
+ compact: T = !1,
99
+ startChars: g = 6,
100
+ endChars: $ = 6,
101
+ style: h,
102
+ className: _,
103
+ sx: l
104
+ } = r, i = Z(o), x = {
105
+ size: v,
106
+ component: d,
107
+ copyable: A,
108
+ responsive: m,
109
109
  showCopyButtonInTooltip: p,
110
- inline: u,
111
- append: D,
112
- compact: $,
113
- startChars: I,
114
- endChars: _,
115
- style: w,
116
- className: Q,
117
- sx: m
118
- }, C = K(null), { content: L, getPrepend: M } = F({ did: s, showAvatar: c }), [U, b] = V(!1), B = v(() => {
119
- b(!1);
120
- }), O = v((y) => {
121
- y.stopPropagation(), y.preventDefault(), b(!0);
110
+ inline: f,
111
+ append: R,
112
+ compact: T,
113
+ startChars: g,
114
+ endChars: $,
115
+ style: h,
116
+ className: _,
117
+ sx: l
118
+ }, N = J(null), { content: k, getPrepend: F } = M({ did: i, showAvatar: c }), [L, I] = K(!1), U = b(() => {
119
+ I(!1);
120
+ }), B = b((C) => {
121
+ C.stopPropagation(), C.preventDefault(), I(!0);
122
122
  });
123
- return Z(e, () => new Proxy(
123
+ return V(e, () => new Proxy(
124
124
  {
125
- openQRCode: () => b(!0),
126
- closeQRCode: () => b(!1)
125
+ openQRCode: () => I(!0),
126
+ closeQRCode: () => I(!1)
127
127
  },
128
128
  {
129
- get(y, z) {
130
- var E;
131
- return y[z] || ((E = C == null ? void 0 : C.current) == null ? void 0 : E[z]);
129
+ get(C, z) {
130
+ return C[z] || N?.current?.[z];
132
131
  }
133
132
  }
134
- )), /* @__PURE__ */ x(H, { children: [
133
+ )), /* @__PURE__ */ w(Q, { children: [
135
134
  /* @__PURE__ */ t(
136
- k,
135
+ W,
137
136
  {
138
137
  locale: a,
139
- content: L,
140
- ...d,
141
- ref: C,
142
- prepend: M(d.size, "address"),
143
- append: /* @__PURE__ */ x(H, { children: [
144
- i ? /* @__PURE__ */ t(
145
- N,
138
+ content: k,
139
+ ...x,
140
+ ref: N,
141
+ prepend: F(x.size, "address"),
142
+ append: /* @__PURE__ */ w(Q, { children: [
143
+ s ? /* @__PURE__ */ t(
144
+ H,
146
145
  {
147
146
  id: "did-qrcode-button",
148
- component: X,
149
- icon: Y,
150
- onClick: O,
147
+ component: q,
148
+ icon: X,
149
+ onClick: B,
151
150
  sx: {
152
151
  flexShrink: 0,
153
152
  cursor: "pointer",
@@ -156,49 +155,49 @@ function _e({
156
155
  }
157
156
  }
158
157
  ) : null,
159
- d.append
158
+ x.append
160
159
  ] }),
161
- children: s
160
+ children: i
162
161
  },
163
162
  "address"
164
163
  ),
165
164
  /* @__PURE__ */ t(
166
- ue,
165
+ pe,
167
166
  {
168
- did: s,
167
+ did: i,
169
168
  chainId: n,
170
- roleType: f,
169
+ roleType: u,
171
170
  showAvatar: c,
172
- open: U,
173
- onClose: B,
174
- ...d
171
+ open: L,
172
+ onClose: U,
173
+ ...x
175
174
  }
176
175
  )
177
176
  ] });
178
177
  }
179
- function ue({
178
+ function pe({
180
179
  did: e,
181
180
  chainId: r = void 0,
182
181
  roleType: o = void 0,
183
182
  showAvatar: n = !0,
184
183
  // DialogProps
185
- open: f,
184
+ open: u,
186
185
  fullScreen: c = !1,
187
- fullWidth: i = !1,
186
+ fullWidth: s = !1,
188
187
  scroll: a = "paper",
189
- onClose: T = oe,
188
+ onClose: v = ee,
190
189
  // AddressProps
191
- locale: l = "en",
192
- ...R
190
+ locale: d = "en",
191
+ ...A
193
192
  }) {
194
- const h = v((m, s = {}) => ne(ae, m, l, "en", s)), { isEthDid: p, content: u, didMotifInfo: D, getPrepend: $ } = F({ did: e, showAvatar: n }), I = g(() => ["zh", "en"].includes(l) ? `https://www.didwallet.io/${l}` : "https://www.didwallet.io/en", [l]), _ = g(() => /* @__PURE__ */ x(H, { children: [
195
- h("downloadTips"),
193
+ const m = b((l, i = {}) => te(ie, l, d, "en", i)), { isEthDid: p, content: f, didMotifInfo: R, getPrepend: T } = M({ did: e, showAvatar: n }), g = D(() => ["zh", "en"].includes(d) ? `https://www.didwallet.io/${d}` : "https://www.didwallet.io/en", [d]), $ = D(() => /* @__PURE__ */ w(Q, { children: [
194
+ m("downloadTips"),
196
195
  " ",
197
196
  /* @__PURE__ */ t(
198
- N,
197
+ H,
199
198
  {
200
199
  component: "a",
201
- href: I,
200
+ href: g,
202
201
  target: "_blank",
203
202
  rel: "noreferrer",
204
203
  sx: {
@@ -208,30 +207,29 @@ function ue({
208
207
  textDecoration: "underline"
209
208
  }
210
209
  },
211
- children: h("download")
210
+ children: m("download")
212
211
  }
213
212
  )
214
- ] }), [I]), w = g(() => {
215
- var m;
213
+ ] }), [g]), h = D(() => {
216
214
  if (r)
217
- return W[r] || r;
215
+ return S[r] || r;
218
216
  if (p) return "1";
219
217
  try {
220
- const s = (m = window.blocklet) == null ? void 0 : m.CHAIN_HOST, d = new URL(s).hostname;
221
- if (d)
222
- return W[d] || A;
223
- } catch (s) {
224
- console.warn("Failed to parse chainHost:", s);
218
+ const l = window.blocklet?.CHAIN_HOST, i = new URL(l).hostname;
219
+ if (i)
220
+ return S[i] || y;
221
+ } catch (l) {
222
+ console.warn("Failed to parse chainHost:", l);
225
223
  }
226
- return A;
227
- }, [p, r]), Q = g(() => p ? `ethereum:abtwallet.io/i?address=${u}&action=didRecognize&chainID=${w}` : `abt://abtwallet.io/i?did=${u}&action=didRecognize&chainID=${w}`, [u, p, w]);
224
+ return y;
225
+ }, [p, r]), _ = D(() => p ? `ethereum:abtwallet.io/i?address=${f}&action=didRecognize&chainID=${h}` : `abt://abtwallet.io/i?did=${f}&action=didRecognize&chainID=${h}`, [f, p, h]);
228
226
  return /* @__PURE__ */ t(
229
- G,
227
+ Y,
230
228
  {
231
- open: f,
232
- onClose: T,
229
+ open: u,
230
+ onClose: v,
233
231
  fullScreen: c,
234
- fullWidth: i,
232
+ fullWidth: s,
235
233
  scroll: a,
236
234
  maxWidth: "sm",
237
235
  PaperProps: {
@@ -240,24 +238,24 @@ function ue({
240
238
  borderRadius: "12px"
241
239
  }
242
240
  },
243
- children: /* @__PURE__ */ x(J, { align: "center", sx: { p: 3 }, children: [
244
- /* @__PURE__ */ t(S, { sx: { mb: 2, fontWeight: 500, fontSize: 18 }, children: h("scanQrcode", { role: ce(o || (D == null ? void 0 : D.roleType)) }) }),
241
+ children: /* @__PURE__ */ w(G, { align: "center", sx: { p: 3 }, children: [
242
+ /* @__PURE__ */ t(P, { sx: { mb: 2, fontWeight: 500, fontSize: 18 }, children: m("scanQrcode", { role: le(o || R?.roleType) }) }),
245
243
  /* @__PURE__ */ t(
246
- q,
244
+ j,
247
245
  {
248
- value: Q,
246
+ value: _,
249
247
  size: 256,
250
248
  renderAs: "svg",
251
249
  level: "M"
252
250
  }
253
251
  ),
254
- /* @__PURE__ */ t(N, { sx: { mt: 1.5, textAlign: "center" }, children: /* @__PURE__ */ t(
255
- k,
252
+ /* @__PURE__ */ t(H, { sx: { mt: 1.5, textAlign: "center" }, children: /* @__PURE__ */ t(
253
+ W,
256
254
  {
257
- locale: l,
258
- content: u,
259
- prepend: $(16, "dialog"),
260
- ...R,
255
+ locale: d,
256
+ content: f,
257
+ prepend: T(16, "dialog"),
258
+ ...A,
261
259
  size: 16,
262
260
  copyable: !0,
263
261
  children: e
@@ -265,7 +263,7 @@ function ue({
265
263
  "dialog-address"
266
264
  ) }),
267
265
  /* @__PURE__ */ t(
268
- S,
266
+ P,
269
267
  {
270
268
  variant: "body2",
271
269
  sx: {
@@ -273,7 +271,7 @@ function ue({
273
271
  fontSize: "12px",
274
272
  mt: 1
275
273
  },
276
- children: _
274
+ children: $
277
275
  }
278
276
  )
279
277
  ] })
@@ -281,7 +279,7 @@ function ue({
281
279
  );
282
280
  }
283
281
  export {
284
- _e as DID,
285
- ue as DIDDialog,
286
- _e as default
282
+ $e as DID,
283
+ pe as DIDDialog,
284
+ $e as default
287
285
  };