@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,18 +1,18 @@
1
- import { jsx as n, jsxs as E } from "react/jsx-runtime";
2
- import { memo as H, createElement as I, useState as K, useRef as Q } from "react";
3
- import { Backdrop as U, useMediaQuery as V, useTheme as q, Box as c, Drawer as J, SwipeableDrawer as X, Dialog as Y, DialogContent as Z } from "@mui/material";
4
- import { useDebounce as oo, useMemoizedFn as D } from "ahooks";
5
- import { useBrowser as eo } from "@arcblock/react-hooks";
6
- import no from "color-convert";
1
+ import { jsx as e, jsxs as N } from "react/jsx-runtime";
2
+ import { memo as F, createElement as E, useState as H, useRef as I } from "react";
3
+ import { Backdrop as K, useMediaQuery as Q, useTheme as U, Box as c, Drawer as V, SwipeableDrawer as q, Dialog as J, DialogContent as X } from "@mui/material";
4
+ import { useDebounce as Y, useMemoizedFn as v } from "ahooks";
5
+ import { useBrowser as Z } from "@arcblock/react-hooks";
6
+ import oo from "color-convert";
7
7
  import "../Theme/theme.js";
8
8
  import "../Theme/theme-provider.js";
9
- import { mergeSx as ro } from "../Util/style.js";
9
+ import { mergeSx as eo } from "../Util/style.js";
10
10
  import { hexToRgba as d } from "../Util/index.js";
11
- const L = H(({ ref: l, ...m }) => /* @__PURE__ */ I(
12
- U,
11
+ const P = F(({ ref: i, ...m }) => /* @__PURE__ */ E(
12
+ K,
13
13
  {
14
14
  open: !0,
15
- ref: l,
15
+ ref: i,
16
16
  style: {
17
17
  backgroundColor: "rgba(0, 0, 0, 0.6)",
18
18
  backdropFilter: "blur(3px)",
@@ -22,34 +22,33 @@ const L = H(({ ref: l, ...m }) => /* @__PURE__ */ I(
22
22
  key: "background"
23
23
  }
24
24
  ));
25
- function fo(l) {
25
+ function xo(i) {
26
26
  function m({
27
- popup: B = !1,
28
- open: _ = !1,
27
+ popup: y = !1,
28
+ open: D = !1,
29
29
  hideCloseButton: h = !1,
30
- ...e
30
+ ...s
31
31
  }) {
32
- var P, y;
33
- const [a, x] = K("#fff"), w = Q(null), z = eo(), M = V("(max-width:640px)");
32
+ const [t, x] = H("#fff"), b = I(null), L = Z(), B = Q("(max-width:640px)");
34
33
  let r = "page";
35
- B && (r = "dialog", M && z.mobile.any && (r = "drawer"));
36
- const g = q(), p = _, T = ((y = (P = g == null ? void 0 : g.transitions) == null ? void 0 : P.duration) == null ? void 0 : y.leavingScreen) || 500, A = oo(p, {
37
- wait: T
38
- }), k = D(() => {
34
+ y && (r = "dialog", B && L.mobile.any && (r = "drawer"));
35
+ const _ = U(), p = D, z = _?.transitions?.duration?.leavingScreen || 500, M = Y(p, {
36
+ wait: z
37
+ }), w = v(() => {
39
38
  const o = new URLSearchParams(window.location.search);
40
39
  o.get("magicToken") && o.delete("magicToken"), o.toString() && window.history.replaceState({}, "", `${window.location.pathname}?${o.toString()}`);
41
- }), C = (o, t) => {
42
- ["backdropClick", "escapeKeyDown"].includes(t) || (k(), e == null || e.onClose());
43
- }, $ = A || p, j = h ? J : X, O = no.hex.hsl(a), [R, S, i] = O, u = [0, 30, 60, 30, 0, 30, 60, 30], W = Math.max(...u), G = Math.min(...u);
44
- let f = !1;
45
- (i * (100 + W) / 100 > 100 || i * (100 + G) / 100 < 0) && (f = !0);
46
- const N = `linear-gradient(45deg, ${u.map((o) => {
47
- let t = i * (100 + o) / 100, s = 0.6;
48
- return f ? s = 0.5 * (100 + o) / 100 : t = i * (100 + o) / 100, `hsla(${R}, ${S}%, ${t}%, ${s})`;
49
- }).join(", ")})`, F = `linear-gradient(45deg, ${u.map((o) => {
50
- let t = i * (100 + o) / 100, s = 0.2;
51
- return f ? s = 0.3 * (100 + o) / 100 : t = i * (100 + o) / 100, `hsla(${R}, ${S}%, ${t}%, ${s})`;
52
- }).join(", ")})`, v = {
40
+ }), k = (o, n) => {
41
+ ["backdropClick", "escapeKeyDown"].includes(n) || (w(), s?.onClose());
42
+ }, C = M || p, T = h ? V : q, A = oo.hex.hsl(t), [$, R, a] = A, u = [0, 30, 60, 30, 0, 30, 60, 30], j = Math.max(...u), O = Math.min(...u);
43
+ let g = !1;
44
+ (a * (100 + j) / 100 > 100 || a * (100 + O) / 100 < 0) && (g = !0);
45
+ const W = `linear-gradient(45deg, ${u.map((o) => {
46
+ let n = a * (100 + o) / 100, l = 0.6;
47
+ return g ? l = 0.5 * (100 + o) / 100 : n = a * (100 + o) / 100, `hsla(${$}, ${R}%, ${n}%, ${l})`;
48
+ }).join(", ")})`, G = `linear-gradient(45deg, ${u.map((o) => {
49
+ let n = a * (100 + o) / 100, l = 0.2;
50
+ return g ? l = 0.3 * (100 + o) / 100 : n = a * (100 + o) / 100, `hsla(${$}, ${R}%, ${n}%, ${l})`;
51
+ }).join(", ")})`, S = {
53
52
  overflow: "visible",
54
53
  "&::before, &::after": {
55
54
  content: '""',
@@ -58,7 +57,7 @@ function fo(l) {
58
57
  right: "-3px",
59
58
  bottom: "-3px",
60
59
  left: "-3px",
61
- background: N,
60
+ background: W,
62
61
  backgroundSize: "300% 300%",
63
62
  backgroundRepeat: "no-repeat",
64
63
  animation: "glowRotate 10s linear infinite",
@@ -66,7 +65,7 @@ function fo(l) {
66
65
  zIndex: 0
67
66
  },
68
67
  "&::after": {
69
- background: F,
68
+ background: G,
70
69
  filter: "blur(15px)"
71
70
  },
72
71
  "@keyframes glowRotate": {
@@ -80,45 +79,44 @@ function fo(l) {
80
79
  backgroundPosition: "0 0"
81
80
  }
82
81
  }
83
- }, b = D(() => {
84
- var o;
85
- k(), (o = e == null ? void 0 : e.onClose) == null || o.call(e);
82
+ }, f = v(() => {
83
+ w(), s?.onClose?.();
86
84
  });
87
- return r === "page" ? /* @__PURE__ */ n(
85
+ return r === "page" ? /* @__PURE__ */ e(
88
86
  c,
89
87
  {
90
88
  className: "did-connect__container-page",
91
- sx: ro(v, {
89
+ sx: eo(S, {
92
90
  borderRadius: 1,
93
91
  position: "relative",
94
92
  zIndex: 1
95
93
  }),
96
- children: /* @__PURE__ */ n(
94
+ children: /* @__PURE__ */ e(
97
95
  c,
98
96
  {
99
97
  sx: {
100
- border: `1px solid ${d(a, 0.1)}`,
98
+ border: `1px solid ${d(t, 0.1)}`,
101
99
  m: "-1px",
102
100
  position: "relative",
103
101
  borderRadius: "12px",
104
102
  zIndex: 2,
105
103
  overflow: "hidden"
106
104
  },
107
- children: /* @__PURE__ */ n(l, { ...e, onClose: b, setColor: x, hideCloseButton: !0, mode: r })
105
+ children: /* @__PURE__ */ e(i, { ...s, onClose: f, setColor: x, hideCloseButton: !0, mode: r })
108
106
  }
109
107
  )
110
108
  }
111
- ) : r === "drawer" ? /* @__PURE__ */ E(
112
- j,
109
+ ) : r === "drawer" ? /* @__PURE__ */ N(
110
+ T,
113
111
  {
114
112
  className: "did-connect__container-drawer",
115
113
  disableSwipeToOpen: !0,
116
114
  open: p,
117
115
  anchor: "bottom",
118
- drawerDragger: w.current,
119
- onClose: C,
116
+ drawerDragger: b.current,
117
+ onClose: k,
120
118
  slots: {
121
- backdrop: L
119
+ backdrop: P
122
120
  },
123
121
  PaperProps: {
124
122
  sx: {
@@ -135,22 +133,22 @@ function fo(l) {
135
133
  "@keyframes glowBreathe": {
136
134
  "0%, 100%": {
137
135
  boxShadow: `
138
- inset 0 0 7px ${d(a, 0.3)},
139
- inset 0 0 12px ${d(a, 0.3)}`
136
+ inset 0 0 7px ${d(t, 0.3)},
137
+ inset 0 0 12px ${d(t, 0.3)}`
140
138
  },
141
139
  "50%": {
142
140
  boxShadow: `
143
- inset 0 0 18px ${d(a, 0.7)},
144
- inset 0 0 24px ${d(a, 0.5)}`
141
+ inset 0 0 18px ${d(t, 0.7)},
142
+ inset 0 0 24px ${d(t, 0.5)}`
145
143
  }
146
144
  }
147
145
  }
148
146
  },
149
147
  children: [
150
- h ? null : /* @__PURE__ */ n(
148
+ h ? null : /* @__PURE__ */ e(
151
149
  c,
152
150
  {
153
- ref: w,
151
+ ref: b,
154
152
  sx: {
155
153
  px: 1,
156
154
  pt: 2,
@@ -159,7 +157,7 @@ function fo(l) {
159
157
  mb: -2,
160
158
  zIndex: 2
161
159
  },
162
- children: /* @__PURE__ */ n(
160
+ children: /* @__PURE__ */ e(
163
161
  c,
164
162
  {
165
163
  sx: {
@@ -172,7 +170,7 @@ function fo(l) {
172
170
  )
173
171
  }
174
172
  ),
175
- /* @__PURE__ */ n(
173
+ /* @__PURE__ */ e(
176
174
  c,
177
175
  {
178
176
  sx: {
@@ -181,20 +179,20 @@ function fo(l) {
181
179
  width: 500,
182
180
  height: "auto"
183
181
  },
184
- children: $ ? /* @__PURE__ */ n(l, { ...e, onClose: b, setColor: x, hideCloseButton: !0, mode: r }) : null
182
+ children: C ? /* @__PURE__ */ e(i, { ...s, onClose: f, setColor: x, hideCloseButton: !0, mode: r }) : null
185
183
  }
186
184
  )
187
185
  ]
188
186
  }
189
- ) : /* @__PURE__ */ n(
190
- Y,
187
+ ) : /* @__PURE__ */ e(
188
+ J,
191
189
  {
192
190
  open: p,
193
191
  slots: {
194
- backdrop: L
192
+ backdrop: P
195
193
  },
196
194
  className: "did-connect__container-dialog",
197
- onClose: C,
195
+ onClose: k,
198
196
  PaperProps: {
199
197
  sx: {
200
198
  // 避免样式被 server 中的定义覆盖
@@ -202,11 +200,11 @@ function fo(l) {
202
200
  borderRadius: "12px !important"
203
201
  },
204
202
  position: "relative",
205
- ...v
203
+ ...S
206
204
  }
207
205
  },
208
- children: /* @__PURE__ */ n(
209
- Z,
206
+ children: /* @__PURE__ */ e(
207
+ X,
210
208
  {
211
209
  sx: {
212
210
  maxWidth: "calc(100vw - 18px)",
@@ -217,11 +215,11 @@ function fo(l) {
217
215
  borderRadius: "12px !important",
218
216
  zIndex: 1
219
217
  },
220
- children: $ ? /* @__PURE__ */ n(
221
- l,
218
+ children: C ? /* @__PURE__ */ e(
219
+ i,
222
220
  {
223
- ...e,
224
- onClose: b,
221
+ ...s,
222
+ onClose: f,
225
223
  setColor: x,
226
224
  hideCloseButton: h,
227
225
  mode: r
@@ -235,5 +233,5 @@ function fo(l) {
235
233
  return m;
236
234
  }
237
235
  export {
238
- fo as default
236
+ xo as default
239
237
  };
@@ -1,15 +1,15 @@
1
1
  import { jsx as d } from "react/jsx-runtime";
2
- import { useRef as g, useState as w, isValidElement as f, useImperativeHandle as y } from "react";
3
- import { useMemoizedFn as e, useReactive as v } from "ahooks";
4
- import u from "lodash/noop";
2
+ import { useRef as g, useState as w, isValidElement as r, useImperativeHandle as y } from "react";
3
+ import { useMemoizedFn as n, useReactive as v } from "ahooks";
4
+ import l from "lodash/noop";
5
5
  import H from "./confirm.js";
6
- function R({ ref: s, ...l }) {
7
- const [B, c] = w(""), [C, i] = w(""), t = v({
6
+ function R({ ref: f, ...i }) {
7
+ const [s, e] = w(""), [B, c] = w(""), t = v({
8
8
  show: !1,
9
9
  title: "",
10
10
  content: "",
11
- onConfirm: u,
12
- onCancel: u,
11
+ onConfirm: l,
12
+ onCancel: l,
13
13
  // 其他属性
14
14
  loading: !1,
15
15
  showCancelButton: !0,
@@ -19,39 +19,39 @@ function R({ ref: s, ...l }) {
19
19
  confirmButtonProps: {},
20
20
  cancelButtonText: "Cancel",
21
21
  cancelButtonProps: {}
22
- }), n = e((o = {}) => {
23
- f(o.title) ? (c(o.title), t.title = "") : (c(""), t.title = o.title), f(o.content) ? (i(o.content), t.content = "") : (i(""), t.content = o.content), t.onConfirm = o.onConfirm || u, t.onCancel = o.onCancel || u, t.showCloseButton = o.showCloseButton ?? !0, t.showCancelButton = o.showCancelButton ?? !0, t.showConfirmButton = o.showConfirmButton ?? !0, o.confirmButtonText && (t.confirmButtonText = o.confirmButtonText), o.confirmButtonProps && (t.confirmButtonProps = o.confirmButtonProps), o.cancelButtonText && (t.cancelButtonText = o.cancelButtonText), o.cancelButtonProps && (t.cancelButtonProps = o.cancelButtonProps), t.loading = !1, t.show = !0;
24
- }), x = e(() => {
25
- c(""), i(""), t.title = "", t.content = "", t.onConfirm = u, t.onCancel = u, t.confirmButtonText = "Confirm", t.confirmButtonProps = {}, t.cancelButtonText = "Cancel", t.cancelButtonProps = {}, t.showConfirmButton = !0, t.showCancelButton = !0, t.showCloseButton = !0;
26
- }), r = e(() => {
22
+ }), m = n((o = {}) => {
23
+ r(o.title) ? (e(o.title), t.title = "") : (e(""), t.title = o.title), r(o.content) ? (c(o.content), t.content = "") : (c(""), t.content = o.content), t.onConfirm = o.onConfirm || l, t.onCancel = o.onCancel || l, t.showCloseButton = o.showCloseButton ?? !0, t.showCancelButton = o.showCancelButton ?? !0, t.showConfirmButton = o.showConfirmButton ?? !0, o.confirmButtonText && (t.confirmButtonText = o.confirmButtonText), o.confirmButtonProps && (t.confirmButtonProps = o.confirmButtonProps), o.cancelButtonText && (t.cancelButtonText = o.cancelButtonText), o.cancelButtonProps && (t.cancelButtonProps = o.cancelButtonProps), t.loading = !1, t.show = !0;
24
+ }), x = n(() => {
25
+ e(""), c(""), t.title = "", t.content = "", t.onConfirm = l, t.onCancel = l, t.confirmButtonText = "Confirm", t.confirmButtonProps = {}, t.cancelButtonText = "Cancel", t.cancelButtonProps = {}, t.showConfirmButton = !0, t.showCancelButton = !0, t.showCloseButton = !0;
26
+ }), u = n(() => {
27
27
  t.show = !1, setTimeout(() => {
28
28
  x();
29
29
  }, 300);
30
- }), h = e((o) => {
31
- o.title && (f(o.title) ? (c(o.title), t.title = "") : (c(""), t.title = o.title)), o.content && (f(o.content) ? (i(o.content), t.content = "") : (i(""), t.content = o.content));
32
- }), T = e((o, p) => {
33
- r(), t == null || t.onCancel(o, p);
34
- }, []), P = e(async (o) => {
30
+ }), h = n((o) => {
31
+ o.title && (r(o.title) ? (e(o.title), t.title = "") : (e(""), t.title = o.title)), o.content && (r(o.content) ? (c(o.content), t.content = "") : (c(""), t.content = o.content));
32
+ }), T = n((o, p) => {
33
+ u(), t?.onCancel(o, p);
34
+ }, []), a = n(async (o) => {
35
35
  t.loading = !0;
36
36
  try {
37
- await (t == null ? void 0 : t.onConfirm(r, o));
37
+ await t?.onConfirm(u, o);
38
38
  } finally {
39
39
  t.loading = !1;
40
40
  }
41
41
  }, []);
42
- y(s, () => ({
43
- open: n,
44
- close: r,
42
+ y(f, () => ({
43
+ open: m,
44
+ close: u,
45
45
  update: h
46
- }), [n, r, h]);
47
- const a = B || t.title, m = C || t.content;
46
+ }), [m, u, h]);
47
+ const P = s || t.title, C = B || t.content;
48
48
  return /* @__PURE__ */ d(
49
49
  H,
50
50
  {
51
- ...l,
51
+ ...i,
52
52
  open: t.show,
53
- title: a,
54
- onConfirm: P,
53
+ title: P,
54
+ onConfirm: a,
55
55
  onCancel: T,
56
56
  confirmButton: {
57
57
  text: t.confirmButtonText,
@@ -73,28 +73,25 @@ function R({ ref: s, ...l }) {
73
73
  ...t.cancelButtonProps
74
74
  }
75
75
  },
76
- children: m instanceof Function ? m() : m
76
+ children: C instanceof Function ? C() : C
77
77
  }
78
78
  );
79
79
  }
80
- function I(s = {}) {
81
- const l = g(null), B = e((...t) => {
82
- var n;
83
- (n = l.current) == null || n.open(...t);
84
- }), c = e((...t) => {
85
- var n;
86
- (n = l.current) == null || n.close(...t);
87
- }), C = e((...t) => {
88
- var n;
89
- (n = l.current) == null || n.update(...t);
90
- }), i = {
91
- open: B,
92
- close: c,
93
- update: C
80
+ function I(f = {}) {
81
+ const i = g(null), s = n((...t) => {
82
+ i.current?.open(...t);
83
+ }), e = n((...t) => {
84
+ i.current?.close(...t);
85
+ }), B = n((...t) => {
86
+ i.current?.update(...t);
87
+ }), c = {
88
+ open: s,
89
+ close: e,
90
+ update: B
94
91
  };
95
92
  return {
96
- confirmHolder: /* @__PURE__ */ d(R, { ...s, ref: l }),
97
- confirmApi: i
93
+ confirmHolder: /* @__PURE__ */ d(R, { ...f, ref: i }),
94
+ confirmApi: c
98
95
  };
99
96
  }
100
97
  export {
@@ -52,7 +52,7 @@ function W({
52
52
  height: g = 600,
53
53
  enableRotation: I = !1,
54
54
  rotationSpeed: M = 5,
55
- activeMarkerId: a = void 0,
55
+ activeMarkerId: i = void 0,
56
56
  markers: y = [],
57
57
  colors: L = {}
58
58
  }) {
@@ -70,29 +70,29 @@ function W({
70
70
  step: 0,
71
71
  markerId: null,
72
72
  iv: null
73
- }), C = J(r.animateDuration, 170, 26), S = a && k.current.markerId !== a && y.some((t) => t.id === a), p = N.geoOrthographic().fitExtent(
73
+ }), C = J(r.animateDuration, 170, 26), S = i && k.current.markerId !== i && y.some((t) => t.id === i), p = N.geoOrthographic().fitExtent(
74
74
  [
75
75
  [30, 30],
76
76
  [s - 30, g - 30]
77
77
  ],
78
78
  F
79
79
  ).rotate(
80
- C <= 1 || r.isDragging || !a ? r.rotation : k.current.iv(C / r.animateDuration)
80
+ C <= 1 || r.isDragging || !i ? r.rotation : k.current.iv(C / r.animateDuration)
81
81
  ), P = N.geoPath().projection(p).pointRadius(2);
82
82
  H(() => {
83
83
  if (S) {
84
- let { p1: t, p2: o, r1: i, r2: u, markerId: c } = k.current;
85
- if (c !== a && !r.isDragging) {
86
- const l = y.find((v) => v.id === a);
87
- t = o, o = [l.longitude, l.latitude], i = u, u = [-o[0], 20 - o[1], p.rotate()[2]];
88
- const h = X.interpolateAngles(i, u);
84
+ let { p1: t, p2: o, r1: a, r2: u, markerId: c } = k.current;
85
+ if (c !== i && !r.isDragging) {
86
+ const l = y.find((v) => v.id === i);
87
+ t = o, o = [l.longitude, l.latitude], a = u, u = [-o[0], 20 - o[1], p.rotate()[2]];
88
+ const h = X.interpolateAngles(a, u);
89
89
  Object.assign(k.current, {
90
90
  p1: t,
91
91
  p2: o,
92
- r1: i,
92
+ r1: a,
93
93
  r2: u,
94
94
  iv: h,
95
- markerId: a
95
+ markerId: i
96
96
  });
97
97
  const f = r.animateDuration * 2;
98
98
  d({
@@ -113,15 +113,15 @@ function W({
113
113
  }
114
114
  });
115
115
  const b = (t) => {
116
- const o = E.current, i = o == null ? void 0 : o.getBoundingClientRect();
117
- return [t.clientX - i.left - o.clientLeft, t.clientY - i.top - o.clientTop];
116
+ const o = E.current, a = o?.getBoundingClientRect();
117
+ return [t.clientX - a.left - o.clientLeft, t.clientY - a.top - o.clientTop];
118
118
  }, T = (t) => {
119
119
  const o = b(t);
120
120
  o[0] && (x.current.v0 = D.cartesian(p.invert(o)), x.current.r0 = p.rotate(), x.current.q0 = D(x.current.r0), d({ type: "dragStart", payload: { mousePosition: o } }));
121
121
  }, z = (t) => {
122
122
  if (r.isDragging === !1)
123
123
  return;
124
- const o = b(t), { r0: i, v0: u, q0: c } = x.current, l = D.cartesian(p.rotate(i).invert(o)), h = D.multiply(c, D.delta(u, l)), f = D.rotation(h);
124
+ const o = b(t), { r0: a, v0: u, q0: c } = x.current, l = D.cartesian(p.rotate(a).invert(o)), h = D.multiply(c, D.delta(u, l)), f = D.rotation(h);
125
125
  d({ type: "rotate", payload: { rotation: f, mousePosition: o } });
126
126
  }, j = () => {
127
127
  setTimeout(() => {
@@ -131,7 +131,7 @@ function W({
131
131
  type: "tooltip",
132
132
  payload: { tooltipIndex: o, mousePosition: b(t) }
133
133
  }), O = () => d({ type: "tooltip", payload: { tooltipIndex: -1, mousePosition: null } }), G = () => y.map((t, o) => {
134
- const i = [t.longitude, t.latitude], u = N.geoDistance(i, p.invert([s / 2, g / 2])), c = p(i), l = a === t.id, h = u > 1.57 ? "none" : l ? $.activeMarker : $.marker, f = l ? 9 : 6;
134
+ const a = [t.longitude, t.latitude], u = N.geoDistance(a, p.invert([s / 2, g / 2])), c = p(a), l = i === t.id, h = u > 1.57 ? "none" : l ? $.activeMarker : $.marker, f = l ? 9 : 6;
135
135
  return /* @__PURE__ */ m(
136
136
  "g",
137
137
  {
@@ -174,22 +174,21 @@ function W({
174
174
  t.id
175
175
  );
176
176
  }), q = () => {
177
- var t, o;
178
177
  if (r.tooltipIndex >= 0) {
179
- const i = y[r.tooltipIndex];
180
- return /* @__PURE__ */ m(oo, { style: { left: ((t = r.mousePosition) == null ? void 0 : t[0]) ?? 0, top: ((o = r.mousePosition) == null ? void 0 : o[1]) ?? 0 }, children: [
181
- /* @__PURE__ */ n("p", { className: "title", children: i.title }),
182
- /* @__PURE__ */ n("p", { className: "description", children: i.description }),
178
+ const t = y[r.tooltipIndex];
179
+ return /* @__PURE__ */ m(oo, { style: { left: r.mousePosition?.[0] ?? 0, top: r.mousePosition?.[1] ?? 0 }, children: [
180
+ /* @__PURE__ */ n("p", { className: "title", children: t.title }),
181
+ /* @__PURE__ */ n("p", { className: "description", children: t.description }),
183
182
  /* @__PURE__ */ m("p", { className: "description", children: [
184
183
  "ID: ",
185
- i.id
184
+ t.id
186
185
  ] })
187
186
  ] });
188
187
  }
189
188
  };
190
189
  let _ = null;
191
- if (a && y.some((t) => t.id === a)) {
192
- const t = y.find((o) => o.id === a);
190
+ if (i && y.some((t) => t.id === i)) {
191
+ const t = y.find((o) => o.id === i);
193
192
  _ = F.features.findIndex(
194
193
  (o) => o.properties && o.properties.name && o.properties.name === t.country
195
194
  );
@@ -1,20 +1,19 @@
1
1
  import { jsxs as o, jsx as t } from "react/jsx-runtime";
2
- import { Container as h, Typography as r, Box as g } from "@mui/material";
3
- import { mergeProps as w } from "../Util/index.js";
4
- import y from "../Logo/index.js";
5
- import { styled as u } from "../Theme/index.js";
6
- function b({ ...e }) {
7
- var s;
8
- const p = w(e, b, ["dark", "style"]), { className: d = "", copyStart: m = "2017", style: c = {}, brand: x = "ArcBlock", dark: n = !1, addon: a = null } = p, i = `${(/* @__PURE__ */ new Date()).getFullYear()}`, l = `${m}`, f = i === l ? i : `${l}-${i}`;
9
- return /* @__PURE__ */ o(k, { className: d, style: c, dark: n, children: [
10
- /* @__PURE__ */ t(h, { maxWidth: !1, children: /* @__PURE__ */ o(r, { component: "div", className: "footer", children: [
2
+ import { Container as f, Typography as r, Box as h } from "@mui/material";
3
+ import { mergeProps as g } from "../Util/index.js";
4
+ import w from "../Logo/index.js";
5
+ import { styled as y } from "../Theme/index.js";
6
+ function u({ ...e }) {
7
+ const s = g(e, u, ["dark", "style"]), { className: p = "", copyStart: d = "2017", style: m = {}, brand: c = "ArcBlock", dark: n = !1, addon: a = null } = s, i = `${(/* @__PURE__ */ new Date()).getFullYear()}`, l = `${d}`, x = i === l ? i : `${l}-${i}`;
8
+ return /* @__PURE__ */ o(b, { className: p, style: m, dark: n, children: [
9
+ /* @__PURE__ */ t(f, { maxWidth: !1, children: /* @__PURE__ */ o(r, { component: "div", className: "footer", children: [
11
10
  /* @__PURE__ */ o(r, { component: "p", className: "footer-item", children: [
12
11
  /* @__PURE__ */ o("span", { className: "footer-copy", children: [
13
12
  "Copyright © ",
14
- f,
13
+ x,
15
14
  " "
16
15
  ] }),
17
- /* @__PURE__ */ t("span", { className: "footer-brand", children: x })
16
+ /* @__PURE__ */ t("span", { className: "footer-brand", children: c })
18
17
  ] }),
19
18
  a && /* @__PURE__ */ t(
20
19
  r,
@@ -27,11 +26,11 @@ function b({ ...e }) {
27
26
  ),
28
27
  /* @__PURE__ */ o(r, { component: "p", className: "footer-item", style: { justifyContent: "flex-end", flexShrink: 0 }, children: [
29
28
  "Powered by",
30
- /* @__PURE__ */ t(y, { mode: n ? "light" : "dark", layout: "horizontal", className: "logo-container" })
29
+ /* @__PURE__ */ t(w, { mode: n ? "light" : "dark", layout: "horizontal", className: "logo-container" })
31
30
  ] })
32
31
  ] }) }),
33
32
  /* @__PURE__ */ t(
34
- g,
33
+ h,
35
34
  {
36
35
  sx: {
37
36
  position: "absolute",
@@ -41,12 +40,12 @@ function b({ ...e }) {
41
40
  color: "transparent",
42
41
  "::selection": { background: "#000", color: "#fff" }
43
42
  },
44
- children: (s = window == null ? void 0 : window.blocklet) == null ? void 0 : s.version
43
+ children: window?.blocklet?.version
45
44
  }
46
45
  )
47
46
  ] });
48
47
  }
49
- const k = u("div", {
48
+ const b = y("div", {
50
49
  shouldForwardProp: (e) => e !== "dark"
51
50
  })`
52
51
  position: relative;
@@ -110,5 +109,5 @@ const k = u("div", {
110
109
  }
111
110
  `;
112
111
  export {
113
- b as default
112
+ u as default
114
113
  };