@sheetxl/utils-react 0.3.17 → 0.3.19

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.
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.3.17
2
+ * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.3.19
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
- import { jsx as e, jsxs as t, Fragment as n } from "react/jsx-runtime";
7
+ import { jsx as t, jsxs as e, Fragment as n } from "react/jsx-runtime";
8
8
  import o, { useCallback as i, useRef as r, memo as s, forwardRef as l, useState as a, useEffect as c, useMemo as h, useImperativeHandle as u, useLayoutEffect as d, createElement as _, useReducer as p } from "react";
9
9
  import m from "clsx";
10
10
  import { useMeasure as f } from "react-use";
@@ -13,27 +13,27 @@ import * as b from "detect-it";
13
13
  import { mergeRefs as w } from "react-merge-refs";
14
14
  import { createRoot as S } from "react-dom/client";
15
15
  import { unstable_batchedUpdates as L } from "react-dom";
16
- const C = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, E = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, T = { BackSpace: 8, Tab: 9, Clear: 12, Enter: 13, Shift: 16, Control: 17, Alt: 18, Pause: 19, CapsLock: 20, Escape: 27, Space: 32, PageUp: 33, PageDown: 34, End: 35, Home: 36, Left: 37, Up: 38, Right: 39, Down: 40, Insert: 45, Delete: 46, Digit_8: 56, Y: 89, Z: 90, Meta: 91, F1: 112, F2: 113, F3: 114, F4: 115, F5: 116, F6: 117, F7: 118, F8: 119, F9: 120, F10: 121, F11: 122, F12: 123, NumLock: 144, ScrollLock: 145, BackSlash: 220, Slash: 191, BracketRight: 221, BracketLeft: 219 }, M = { Left: 1, Middle: 2, Right: 3 }, D = { Horizontal: "horizontal", Vertical: "vertical" }, P = (e2, t2) => {
17
- const n2 = i((...t3) => e2?.(...t3), t2), o2 = r(null);
16
+ const C = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, E = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, T = { BackSpace: 8, Tab: 9, Clear: 12, Enter: 13, Shift: 16, Control: 17, Alt: 18, Pause: 19, CapsLock: 20, Escape: 27, Space: 32, PageUp: 33, PageDown: 34, End: 35, Home: 36, Left: 37, Up: 38, Right: 39, Down: 40, Insert: 45, Delete: 46, Digit_8: 56, Y: 89, Z: 90, Meta: 91, F1: 112, F2: 113, F3: 114, F4: 115, F5: 116, F6: 117, F7: 118, F8: 119, F9: 120, F10: 121, F11: 122, F12: 123, NumLock: 144, ScrollLock: 145, BackSlash: 220, Slash: 191, BracketRight: 221, BracketLeft: 219 }, M = { Left: 1, Middle: 2, Right: 3 }, D = { Horizontal: "horizontal", Vertical: "vertical" }, P = (t2, e2) => {
17
+ const n2 = i((...e3) => t2?.(...e3), e2), o2 = r(null);
18
18
  o2.current = n2;
19
- const s2 = i((...e3) => o2.current?.(...e3), []);
19
+ const s2 = i((...t3) => o2.current?.(...t3), []);
20
20
  if (o2.current) return s2;
21
- }, z = (t2) => {
22
- const { style: n2, orientation: o2 = D.Vertical, ...i2 } = t2, r2 = o2 === D.Vertical;
23
- return e("div", { style: { paddingBottom: "0px", paddingRight: "0px", paddingLeft: r2 ? "0px" : "3px", paddingTop: r2 ? "3px" : "0px", display: "flex", alignItems: "center", justifyContent: "center", ...n2 }, ...i2, children: e("button", { style: { padding: "0", display: "flex", alignItems: "center", justifyContent: "center", border: "none" }, className: `scrollbar-button ${r2 ? "vertical" : "horizontal"} single-button start`, children: e("svg", { width: "9", height: "9", viewBox: "0 0 6 6", style: { opacity: "inherit" }, children: e("path", { d: r2 ? "m 3.7274761,0.68060577 1.11969,1.93863003 1.12075,1.93912 c 0.0895,0.155 0.12152,0.33658 0.0904,0.51283 -0.0311,0.17625 -0.12336,0.33591 -0.26054,0.45091 -0.13715,0.11495 -0.31044,0.17793 -0.4894,0.17781 H 0.83095614 c -0.20186,0 -0.39542,-0.0802 -0.53814,-0.2229 -0.14272,-0.14272 -0.22291,-0.33629 -0.22291,-0.53814 -3e-4,-0.13308 0.0347,-0.26385 0.10147,-0.379 l 1.11872996,-1.94066 1.11921,-1.93864003 c 0.13594,-0.23541 0.38717,-0.38047 0.65905,-0.38047 0.27188,0 0.52311,0.14506 0.65905,0.38047 z" : "m 0.75051,2.3424298 1.93863,-1.11969 1.93912,-1.12075 c 0.155,-0.0895 0.33658,-0.12152 0.51283,-0.0904 0.17625,0.0311 0.33591,0.12336 0.45091,0.26054 0.11495,0.13715 0.17793,0.31044 0.17781,0.4894 v 4.47742 c 0,0.20186 -0.0802,0.39542 -0.2229,0.53814 -0.14272,0.14272 -0.33629,0.22291 -0.53814,0.22291 -0.13308,3e-4 -0.26385,-0.0347 -0.379,-0.10147 L 2.68911,4.7797998 0.75047,3.6605898 C 0.51506,3.5246498 0.37,3.2734198 0.37,3.0015398 c 0,-0.27188 0.14506,-0.52311 0.38047,-0.65905 z" }) }) }) });
24
- }, k = (t2) => {
25
- const { style: n2, orientation: o2 = D.Vertical, ...i2 } = t2, r2 = o2 === D.Vertical;
26
- return e("div", { style: { paddingLeft: "0px", paddingTop: "0px", paddingRight: r2 ? "0px" : "3px", paddingBottom: r2 ? "3px" : "0px", display: "flex", alignItems: "center", justifyContent: "center", ...n2 }, ...i2, children: e("button", { style: { padding: "0", display: "flex", alignItems: "center", justifyContent: "center", border: "none" }, className: `scrollbar-button ${r2 ? "vertical" : "horizontal"} single-button end`, children: e("svg", { width: "9", height: "9", viewBox: "0 0 6 6", style: { opacity: "inherit" }, children: e("path", { d: r2 ? "M 2.412334,5.319396 1.292644,3.3807659 0.17189405,1.4416459 c -0.0895,-0.155 -0.12152,-0.33658 -0.0904,-0.51282998 0.0311,-0.17625 0.12336,-0.33591 0.26054,-0.45091 0.13715,-0.11495 0.31044,-0.17793 0.4894,-0.17781 H 5.308854 c 0.20186,0 0.39542,0.0802 0.53814,0.2229 0.14272,0.14272 0.22291,0.33629 0.22291,0.53813998 3e-4,0.13308 -0.0347,0.26385 -0.10147,0.379 l -1.11873,1.94066 -1.11921,1.9386401 c -0.13594,0.23541 -0.38717,0.38047 -0.65905,0.38047 -0.27188,0 -0.52311,-0.14506 -0.65905,-0.38047 z" : "m 5.3893002,3.6575719 -1.9386301,1.11969 -1.93912,1.12075 c -0.155,0.0895 -0.33658,0.12152 -0.51282997,0.0904 -0.17625,-0.0311 -0.33591,-0.12336 -0.45091,-0.26054 -0.11495,-0.13715 -0.17793,-0.31044 -0.17781,-0.4894 V 0.76105195 c 0,-0.20186 0.0802,-0.39542 0.2229,-0.53814 C 0.73562013,0.08019195 0.92919013,1.9467784e-6 1.1310401,1.9467784e-6 1.2641201,-2.9805322e-4 1.3948901,0.03470195 1.5100401,0.10147195 l 1.94066,1.11872995 1.9386401,1.11921 c 0.23541,0.13594 0.38047,0.38717 0.38047,0.65905 0,0.27188 -0.14506,0.52311 -0.38047,0.65905 z" }) }) }) });
27
- }, A = (t2) => {
28
- const { style: n2, orientation: o2 = D.Vertical, ...i2 } = t2, r2 = o2 === D.Vertical;
29
- return e("div", { style: { display: "flex", justifyContent: "center", alignItems: "end", transition: "fill-opacity 1s", zIndex: 1, width: "24px", height: "24px", ...n2 }, className: `scrollbar-button ${r2 ? "vertical" : "horizontal"} edge`, ...i2, children: e("svg", { width: "24", height: "24", viewBox: "0 0 24 24", transform: r2 ? "rotate(90) " : "", children: e("path", { style: { transition: "opacity 240ms ease 0s", opacity: t2.disabled ? 0 : 1 }, d: "M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }) }) });
30
- }, B = (e2, t2, n2, o2, i2 = 0) => {
21
+ }, z = (e2) => {
22
+ const { style: n2, orientation: o2 = D.Vertical, ...i2 } = e2, r2 = o2 === D.Vertical;
23
+ return t("div", { style: { paddingBottom: "0px", paddingRight: "0px", paddingLeft: r2 ? "0px" : "3px", paddingTop: r2 ? "3px" : "0px", display: "flex", alignItems: "center", justifyContent: "center", ...n2 }, ...i2, children: t("button", { style: { padding: "0", display: "flex", alignItems: "center", justifyContent: "center", border: "none" }, className: `scrollbar-button ${r2 ? "vertical" : "horizontal"} single-button start`, children: t("svg", { width: "9", height: "9", viewBox: "0 0 6 6", style: { opacity: "inherit" }, children: t("path", { d: r2 ? "m 3.7274761,0.68060577 1.11969,1.93863003 1.12075,1.93912 c 0.0895,0.155 0.12152,0.33658 0.0904,0.51283 -0.0311,0.17625 -0.12336,0.33591 -0.26054,0.45091 -0.13715,0.11495 -0.31044,0.17793 -0.4894,0.17781 H 0.83095614 c -0.20186,0 -0.39542,-0.0802 -0.53814,-0.2229 -0.14272,-0.14272 -0.22291,-0.33629 -0.22291,-0.53814 -3e-4,-0.13308 0.0347,-0.26385 0.10147,-0.379 l 1.11872996,-1.94066 1.11921,-1.93864003 c 0.13594,-0.23541 0.38717,-0.38047 0.65905,-0.38047 0.27188,0 0.52311,0.14506 0.65905,0.38047 z" : "m 0.75051,2.3424298 1.93863,-1.11969 1.93912,-1.12075 c 0.155,-0.0895 0.33658,-0.12152 0.51283,-0.0904 0.17625,0.0311 0.33591,0.12336 0.45091,0.26054 0.11495,0.13715 0.17793,0.31044 0.17781,0.4894 v 4.47742 c 0,0.20186 -0.0802,0.39542 -0.2229,0.53814 -0.14272,0.14272 -0.33629,0.22291 -0.53814,0.22291 -0.13308,3e-4 -0.26385,-0.0347 -0.379,-0.10147 L 2.68911,4.7797998 0.75047,3.6605898 C 0.51506,3.5246498 0.37,3.2734198 0.37,3.0015398 c 0,-0.27188 0.14506,-0.52311 0.38047,-0.65905 z" }) }) }) });
24
+ }, k = (e2) => {
25
+ const { style: n2, orientation: o2 = D.Vertical, ...i2 } = e2, r2 = o2 === D.Vertical;
26
+ return t("div", { style: { paddingLeft: "0px", paddingTop: "0px", paddingRight: r2 ? "0px" : "3px", paddingBottom: r2 ? "3px" : "0px", display: "flex", alignItems: "center", justifyContent: "center", ...n2 }, ...i2, children: t("button", { style: { padding: "0", display: "flex", alignItems: "center", justifyContent: "center", border: "none" }, className: `scrollbar-button ${r2 ? "vertical" : "horizontal"} single-button end`, children: t("svg", { width: "9", height: "9", viewBox: "0 0 6 6", style: { opacity: "inherit" }, children: t("path", { d: r2 ? "M 2.412334,5.319396 1.292644,3.3807659 0.17189405,1.4416459 c -0.0895,-0.155 -0.12152,-0.33658 -0.0904,-0.51282998 0.0311,-0.17625 0.12336,-0.33591 0.26054,-0.45091 0.13715,-0.11495 0.31044,-0.17793 0.4894,-0.17781 H 5.308854 c 0.20186,0 0.39542,0.0802 0.53814,0.2229 0.14272,0.14272 0.22291,0.33629 0.22291,0.53813998 3e-4,0.13308 -0.0347,0.26385 -0.10147,0.379 l -1.11873,1.94066 -1.11921,1.9386401 c -0.13594,0.23541 -0.38717,0.38047 -0.65905,0.38047 -0.27188,0 -0.52311,-0.14506 -0.65905,-0.38047 z" : "m 5.3893002,3.6575719 -1.9386301,1.11969 -1.93912,1.12075 c -0.155,0.0895 -0.33658,0.12152 -0.51282997,0.0904 -0.17625,-0.0311 -0.33591,-0.12336 -0.45091,-0.26054 -0.11495,-0.13715 -0.17793,-0.31044 -0.17781,-0.4894 V 0.76105195 c 0,-0.20186 0.0802,-0.39542 0.2229,-0.53814 C 0.73562013,0.08019195 0.92919013,1.9467784e-6 1.1310401,1.9467784e-6 1.2641201,-2.9805322e-4 1.3948901,0.03470195 1.5100401,0.10147195 l 1.94066,1.11872995 1.9386401,1.11921 c 0.23541,0.13594 0.38047,0.38717 0.38047,0.65905 0,0.27188 -0.14506,0.52311 -0.38047,0.65905 z" }) }) }) });
27
+ }, A = (e2) => {
28
+ const { style: n2, orientation: o2 = D.Vertical, ...i2 } = e2, r2 = o2 === D.Vertical;
29
+ return t("div", { style: { display: "flex", justifyContent: "center", alignItems: "end", transition: "fill-opacity 1s", zIndex: 1, width: "24px", height: "24px", ...n2 }, className: `scrollbar-button ${r2 ? "vertical" : "horizontal"} edge`, ...i2, children: t("svg", { width: "24", height: "24", viewBox: "0 0 24 24", transform: r2 ? "rotate(90) " : "", children: t("path", { style: { transition: "opacity 240ms ease 0s", opacity: e2.disabled ? 0 : 1 }, d: "M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }) }) });
30
+ }, B = (t2, e2, n2, o2, i2 = 0) => {
31
31
  for (let i3 = 0; i3 < n2.length; i3++) {
32
32
  const r2 = n2[i3].getBoundingClientRect();
33
- let s2 = r2.left - t2, l2 = s2 + r2.width;
33
+ let s2 = r2.left - e2, l2 = s2 + r2.width;
34
34
  if (o2) {
35
- if (s2 < e2 && l2 >= e2) return s2;
36
- } else if (Math.ceil(l2) > Math.ceil(e2) + 2) return l2;
35
+ if (s2 < t2 && l2 >= t2) return s2;
36
+ } else if (Math.ceil(l2) > Math.ceil(t2) + 2) return l2;
37
37
  }
38
38
  return i2;
39
39
  }, $ = Object.freeze(Object.defineProperty({ __proto__: null, getScrollTo: B }, Symbol.toStringTag, { value: "Module" })), K = "_sheetxl-scrollbar_eblx4_6", O = s(l((n2, o2) => {
@@ -41,498 +41,528 @@ const C = { General: "general", Left: "left", Right: "right", Center: "center",
41
41
  c(() => {
42
42
  null !== Y2 && T2.current && T2.current.scrollTo({ behavior: "smooth", [N2]: Y2 });
43
43
  }, [Y2, W2]);
44
- const j2 = i((e2, t2 = false) => {
44
+ const j2 = i((t2, e2 = false) => {
45
45
  if (!T2.current) return 0;
46
- const n3 = T2.current.querySelector(".scrollbar-viewport"), o3 = n3.getBoundingClientRect(), i2 = n3.children, r2 = t2 ? 0 : B(e2, o3[N2], i2, true, Math.max(0, e2 - x2));
46
+ const n3 = T2.current.querySelector(".scrollbar-viewport"), o3 = n3.getBoundingClientRect(), i2 = n3.children, r2 = e2 ? 0 : B(t2, o3[N2], i2, true, Math.max(0, t2 - x2));
47
47
  return X2(r2), Math.max(0, r2);
48
- }, []), U2 = i((e2, t2 = false) => {
48
+ }, []), U2 = i((t2, e2 = false) => {
49
49
  if (!T2.current) return 0;
50
- const n3 = T2.current.querySelector(".scrollbar-viewport"), o3 = n3.getBoundingClientRect(), i2 = n3.children, r2 = Math.ceil(I2 - F2), s3 = t2 ? r2 : B(e2, o3[N2], i2, false, Math.max(0, e2 + x2));
50
+ const n3 = T2.current.querySelector(".scrollbar-viewport"), o3 = n3.getBoundingClientRect(), i2 = n3.children, r2 = Math.ceil(I2 - F2), s3 = e2 ? r2 : B(t2, o3[N2], i2, false, Math.max(0, t2 + x2));
51
51
  return X2(s3), Math.min(r2, s3);
52
- }, [I2, F2]), Z2 = r(null), G2 = i((e2) => {
52
+ }, [I2, F2]), Z2 = r(null), G2 = i((t2) => {
53
53
  Z2.current = s2;
54
- const t2 = e2.target[R2];
55
- g2(t2, u2, l2), E2?.(e2);
54
+ const e2 = t2.target[R2];
55
+ g2(e2, u2, l2), E2?.(t2);
56
56
  }, [g2, u2, l2, s2]);
57
57
  c(() => {
58
- const e2 = Z2.current;
59
- Z2.current = null, s2 !== e2 && (T2.current[R2] = s2);
58
+ const t2 = Z2.current;
59
+ Z2.current = null, s2 !== t2 && (T2.current[R2] = s2);
60
60
  }, [s2, R2]);
61
61
  const q2 = r(null), J2 = r(null), Q2 = i(() => {
62
62
  q2.current && (clearTimeout(q2.current), q2.current = null, J2.current = null);
63
- }, []), ee2 = i((e2, t2, n3, o3 = b2) => {
64
- J2.current = e2, q2.current = setTimeout(() => {
65
- const t3 = n3 ? j2(J2.current || e2) : U2(J2.current || e2);
66
- t3 !== J2.current ? ee2(t3, false, n3, w2) : Q2();
67
- }, t2 ? 0 : o3);
63
+ }, []), tt2 = i((t2, e2, n3, o3 = b2) => {
64
+ J2.current = t2, q2.current = setTimeout(() => {
65
+ const e3 = n3 ? j2(J2.current || t2) : U2(J2.current || t2);
66
+ e3 !== J2.current ? tt2(e3, false, n3, w2) : Q2();
67
+ }, e2 ? 0 : o3);
68
68
  }, [j2, U2, Q2]);
69
69
  c(() => () => Q2(), [Q2]);
70
- const te2 = s2, ne2 = h(() => {
70
+ const et2 = s2, nt2 = h(() => {
71
71
  if (!v2) return null;
72
- const e2 = { orientation: p2, disabled: Math.floor(te2) <= 0 || 0 === Math.floor(I2 - F2), onMouseUp: Q2, onMouseLeave: Q2, onMouseDown: () => ee2(te2, true, true) };
73
- return S2?.(e2);
74
- }, [v2, p2, te2, Y2, I2, F2]), oe2 = h(() => {
72
+ const t2 = { orientation: p2, disabled: Math.floor(et2) <= 0 || 0 === Math.floor(I2 - F2), onMouseUp: Q2, onMouseLeave: Q2, onMouseDown: () => tt2(et2, true, true) };
73
+ return S2?.(t2);
74
+ }, [v2, p2, et2, Y2, I2, F2]), ot2 = h(() => {
75
75
  if (!v2) return null;
76
- const e2 = { orientation: p2, disabled: Math.floor(I2 - F2) <= Math.ceil(te2), onMouseUp: Q2, onMouseLeave: Q2, onMouseDown: () => ee2(te2, true, false) };
77
- return L2?.(e2);
78
- }, [v2, p2, te2, Y2, I2, F2]);
79
- return t("div", { ref: o2, style: { display: "flex", flex: "1", flexDirection: W2 ? "column" : "row", padding: "0", ...d2 }, className: m(K, _2), ...C2, children: [ne2, e("div", { className: "pseudo-scrollbar", style: { flex: "1 1 100%", display: "flex", boxSizing: "content-box", flexDirection: W2 ? "column" : "row", justifyContent: "center", alignItems: "center" }, ref: M2, children: e("div", { tabIndex: -1, style: { flex: "1 1 100%", overflowY: W2 ? "scroll" : "hidden", overflowX: W2 ? "hidden" : "scroll", position: "relative", willChange: "transform" }, onScroll: G2, ref: T2, children: e("div", { ref: O2, style: { position: "absolute", height: W2 ? l2 - u2 + ($2 ?? 0) : 1, width: W2 ? 1 : l2 - u2 + (A2 ?? 0) }, className: "scrollbar-viewport" }) }) }), oe2] });
76
+ const t2 = { orientation: p2, disabled: Math.floor(I2 - F2) <= Math.ceil(et2), onMouseUp: Q2, onMouseLeave: Q2, onMouseDown: () => tt2(et2, true, false) };
77
+ return L2?.(t2);
78
+ }, [v2, p2, et2, Y2, I2, F2]);
79
+ return e("div", { ref: o2, style: { display: "flex", flex: "1", flexDirection: W2 ? "column" : "row", padding: "0", ...d2 }, className: m(K, _2), ...C2, children: [nt2, t("div", { className: "pseudo-scrollbar", style: { flex: "1 1 100%", display: "flex", boxSizing: "content-box", flexDirection: W2 ? "column" : "row", justifyContent: "center", alignItems: "center" }, ref: M2, children: t("div", { tabIndex: -1, style: { flex: "1 1 100%", overflowY: W2 ? "scroll" : "hidden", overflowX: W2 ? "hidden" : "scroll", position: "relative", willChange: "transform" }, onScroll: G2, ref: T2, children: t("div", { ref: O2, style: { position: "absolute", height: W2 ? l2 - u2 + ($2 ?? 0) : 1, width: W2 ? 1 : l2 - u2 + (A2 ?? 0) }, className: "scrollbar-viewport" }) }) }), ot2] });
80
80
  }));
81
81
  O.displayName = "Scrollbar";
82
82
  let V = Date.now, H = 1e3, W = {}, N = 1;
83
- const R = (e2) => {
84
- let t2 = null !== W[e2];
85
- return t2 && (W[e2] = null), t2;
86
- }, F = (e2, t2, n2, o2 = 0, i2) => {
87
- let r2 = V(), s2 = r2, l2 = 0, a2 = 0, c2 = N++;
88
- if (c2 % 20 == 0) {
89
- const e3 = {};
90
- for (let t3 in W) e3[t3] = true;
91
- W = e3;
83
+ const R = (t2) => {
84
+ let e2 = null !== W[t2];
85
+ return e2 && (W[t2] = null), e2;
86
+ }, F = (t2, e2, n2, o2 = 0, i2) => {
87
+ let r2 = V(), s2 = r2, l2 = 0, a2 = 0, c2 = 0, h2 = N++;
88
+ if (h2 % 20 == 0) {
89
+ const t3 = {};
90
+ for (let e3 in W) t3[e3] = true;
91
+ W = t3;
92
92
  }
93
- const h2 = function(u2) {
94
- const d2 = true !== u2, _2 = V();
95
- if (!W[c2] || t2 && !t2(c2)) return W[c2] = null, void n2(60 - a2 / ((_2 - r2) / H), c2, false);
96
- if (d2) {
97
- const e3 = Math.round((_2 - s2) / 16.666666666666668) - 1;
98
- for (let t3 = 0; t3 < Math.min(e3, 4); t3++) h2(true), a2++;
93
+ const u2 = function(d2) {
94
+ let _2 = true !== d2, p2 = V(), m2 = true;
95
+ try {
96
+ m2 = (!e2 || e2(h2)) ?? true;
97
+ } catch (t3) {
98
+ m2 = false;
99
+ }
100
+ if (!W[h2] || !m2) return W[h2] = null, void n2?.(60 - a2 / ((p2 - r2) / H), h2, false);
101
+ if (_2) {
102
+ c2 = Math.round((p2 - s2) / 16.666666666666668) - 1;
103
+ for (let t3 = 0; t3 < Math.min(c2, 4); t3++) u2(true), a2++;
104
+ }
105
+ o2 && (l2 = (p2 - r2) / o2, l2 > 1 && (l2 = 1));
106
+ let f2 = i2 ? i2(l2) : l2, g2 = false;
107
+ try {
108
+ g2 = t2(f2, p2, _2);
109
+ } catch (t3) {
110
+ g2 = false;
99
111
  }
100
- o2 && (l2 = (_2 - r2) / o2, l2 > 1 && (l2 = 1));
101
- const p2 = i2 ? i2(l2) : l2;
102
- false !== e2(p2, _2, d2) && 1 !== l2 || !d2 ? d2 && (s2 = _2, requestAnimationFrame(h2)) : (W[c2] = null, n2(60 - a2 / ((_2 - r2) / H), c2, 1 === l2 || void 0 === o2));
112
+ false !== g2 && 1 !== l2 || !_2 ? _2 && (s2 = p2, requestAnimationFrame(u2)) : (W[h2] = null, n2?.(60 - a2 / ((p2 - r2) / H), h2, 1 === l2 || null == o2));
103
113
  };
104
- return W[c2] = true, requestAnimationFrame(h2), c2;
105
- };
106
- var I = function() {
107
- }, Y = function(e2) {
108
- return Math.pow(e2 - 1, 3) + 1;
109
- }, X = function(e2) {
110
- return (e2 /= 0.5) < 1 ? 0.5 * Math.pow(e2, 3) : 0.5 * (Math.pow(e2 - 2, 3) + 2);
111
- }, j = function(e2, t2) {
112
- for (var n2 in this.__callback = e2, this.options = { scrollingX: true, scrollingY: true, animating: true, animationDuration: 250, bouncing: true, locking: true, paging: false, snapping: false, zooming: false, minZoom: 0.5, maxZoom: 3, speedMultiplier: 1, scrollingComplete: I, penetrationDeceleration: 0.03, penetrationAcceleration: 0.08 }, t2) this.options[n2] = t2[n2];
114
+ return W[h2] = true, requestAnimationFrame(u2), h2;
115
+ }, I = function(t2) {
116
+ return Math.pow(t2 - 1, 3) + 1;
117
+ }, Y = function(t2) {
118
+ return (t2 /= 0.5) < 1 ? 0.5 * Math.pow(t2, 3) : 0.5 * (Math.pow(t2 - 2, 3) + 2);
113
119
  };
114
- j.prototype = { __isSingleTouch: false, __isTracking: false, __didDecelerationComplete: false, __isGesturing: false, __isDragging: false, __isDecelerating: false, __isAnimating: false, __clientLeft: 0, __clientTop: 0, __clientWidth: 0, __clientHeight: 0, __contentWidth: 0, __contentHeight: 0, __snapWidth: 100, __snapHeight: 100, __zoomLevel: 1, __scrollLeft: 0, __scrollTop: 0, __maxScrollLeft: 0, __maxScrollTop: 0, __scheduledLeft: 0, __scheduledTop: 0, __scheduledZoom: 0, __lastTouchLeft: null, __lastTouchTop: null, __lastTouchMove: null, __positions: null, __minDecelerationScrollLeft: null, __minDecelerationScrollTop: null, __maxDecelerationScrollLeft: null, __maxDecelerationScrollTop: null, __decelerationVelocityX: null, __decelerationVelocityY: null, setDimensions: function(e2, t2, n2, o2) {
115
- null !== e2 && (this.__clientWidth = e2), null !== t2 && (this.__clientHeight = t2), null !== n2 && (this.__contentWidth = n2), null !== o2 && (this.__contentHeight = o2), this.__computeScrollMax(), this.scrollTo(this.__scrollLeft, this.__scrollTop, true);
116
- }, setPosition: function(e2, t2) {
117
- this.__clientLeft = e2 || 0, this.__clientTop = t2 || 0;
118
- }, setSnapSize: function(e2, t2) {
119
- this.__snapWidth = e2, this.__snapHeight = t2;
120
- }, getValues: function() {
121
- return { left: this.__scrollLeft, top: this.__scrollTop, right: this.__scrollLeft + this.__clientWidth / this.__zoomLevel, bottom: this.__scrollTop + this.__clientHeight / this.__zoomLevel, zoom: this.__zoomLevel };
122
- }, getPoint: function(e2, t2) {
123
- var n2 = this.getValues();
124
- return { left: e2 / n2.zoom, top: t2 / n2.zoom };
125
- }, getScrollMax: function() {
126
- return { left: this.__maxScrollLeft, top: this.__maxScrollTop };
127
- }, zoomTo: function(e2, t2, n2, o2, i2) {
128
- if (!this.options.zooming) throw new Error("Zooming is not enabled!");
129
- i2 && (this.__zoomComplete = i2), this.__isDecelerating && (R(this.__isDecelerating), this.__isDecelerating = false);
130
- var r2 = this.__zoomLevel;
131
- void 0 === n2 && (n2 = this.__clientWidth / 2), void 0 === o2 && (o2 = this.__clientHeight / 2), e2 = Math.max(Math.min(e2, this.options.maxZoom), this.options.minZoom), this.__computeScrollMax(e2);
132
- var s2 = e2 / r2, l2 = s2 * (this.__scrollLeft + n2) - n2, a2 = s2 * (this.__scrollTop + o2) - o2;
133
- l2 > this.__maxScrollLeft ? l2 = this.__maxScrollLeft : l2 < 0 && (l2 = 0), a2 > this.__maxScrollTop ? a2 = this.__maxScrollTop : a2 < 0 && (a2 = 0), this.__publish(l2, a2, e2, t2);
134
- }, zoomBy: function(e2, t2, n2, o2, i2) {
135
- this.zoomTo(this.__zoomLevel * e2, t2, n2, o2, i2);
136
- }, scrollTo: function(e2, t2, n2, o2) {
137
- if (this.__isDecelerating && (R(this.__isDecelerating), this.__isDecelerating = false), void 0 !== o2 && o2 !== this.__zoomLevel) {
120
+ class X {
121
+ constructor(t2, e2) {
122
+ this.__isSingleTouch = false, this.__isTracking = false, this.__didDecelerationComplete = false, this.__isGesturing = false, this.__isDragging = false, this.__isDecelerating = 0, this.__isAnimating = 0, this.__interruptedAnimation = false, this.__lastScale = 1, this.__enableScrollX = true, this.__enableScrollY = true, this.__clientLeft = 0, this.__clientTop = 0, this.__clientWidth = 0, this.__clientHeight = 0, this.__contentWidth = 0, this.__contentHeight = 0, this.__snapWidth = 100, this.__snapHeight = 100, this.__zoomLevel = 1, this.__scrollLeft = 0, this.__scrollTop = 0, this.__maxScrollLeft = 0, this.__maxScrollTop = 0, this.__scheduledLeft = 0, this.__scheduledTop = 0, this.__scheduledZoom = 0, this.__lastTouchLeft = 0, this.__lastTouchTop = 0, this.__lastTouchMove = 0, this.__positions = [], this.__initialTouchLeft = 0, this.__initialTouchTop = 0, this.__zoomLevelStart = 1, this.__minDecelerationScrollLeft = null, this.__minDecelerationScrollTop = null, this.__maxDecelerationScrollLeft = null, this.__maxDecelerationScrollTop = null, this.__decelerationVelocityX = null, this.__decelerationVelocityY = 0, this.__callback = t2, this.options = { scrollingX: true, scrollingY: true, animating: true, animationDuration: 250, bouncing: true, locking: true, paging: false, snapping: false, zooming: false, minZoom: 0.5, maxZoom: 3, speedMultiplier: 1, scrollingComplete: void 0, penetrationDeceleration: 0.03, penetrationAcceleration: 0.08, ...e2 };
123
+ }
124
+ setDimensions(t2, e2, n2, o2) {
125
+ null !== t2 && (this.__clientWidth = t2), null !== e2 && (this.__clientHeight = e2), null !== n2 && (this.__contentWidth = n2), null !== o2 && (this.__contentHeight = o2), this.__computeScrollMax(), this.scrollTo(this.__scrollLeft, this.__scrollTop, true);
126
+ }
127
+ setPosition(t2, e2) {
128
+ this.__clientLeft = t2 || 0, this.__clientTop = e2 || 0;
129
+ }
130
+ setSnapSize(t2, e2) {
131
+ this.__snapWidth = t2, this.__snapHeight = e2;
132
+ }
133
+ getValues() {
134
+ return { left: this.__scrollLeft, top: this.__scrollTop, right: this.__scrollLeft + this.__clientWidth / this.__zoomLevel, bottom: this.__scrollTop + this.__clientHeight / this.__zoomLevel, zoom: this.__zoomLevel };
135
+ }
136
+ getPoint(t2, e2) {
137
+ const n2 = this.getValues();
138
+ return { left: t2 / n2.zoom, top: e2 / n2.zoom };
139
+ }
140
+ getScrollMax() {
141
+ return { left: this.__maxScrollLeft, top: this.__maxScrollTop };
142
+ }
143
+ zoomTo(t2, e2 = false, n2, o2, i2) {
138
144
  if (!this.options.zooming) throw new Error("Zooming is not enabled!");
139
- e2 *= o2, t2 *= o2, this.__computeScrollMax(o2);
140
- } else o2 = this.__zoomLevel;
141
- this.options.scrollingX ? this.options.paging ? e2 = Math.round(e2 / this.__clientWidth) * this.__clientWidth : this.options.snapping && (e2 = Math.round(e2 / this.__snapWidth) * this.__snapWidth) : e2 = this.__scrollLeft, this.options.scrollingY ? this.options.paging ? t2 = Math.round(t2 / this.__clientHeight) * this.__clientHeight : this.options.snapping && (t2 = Math.round(t2 / this.__snapHeight) * this.__snapHeight) : t2 = this.__scrollTop, e2 = Math.max(Math.min(this.__maxScrollLeft, e2), 0), t2 = Math.max(Math.min(this.__maxScrollTop, t2), 0), e2 === this.__scrollLeft && t2 === this.__scrollTop && (n2 = false), this.__publish(e2, t2, o2, n2);
142
- }, scrollBy: function(e2, t2, n2) {
143
- var o2 = this.__isAnimating ? this.__scheduledLeft : this.__scrollLeft, i2 = this.__isAnimating ? this.__scheduledTop : this.__scrollTop;
144
- this.scrollTo(o2 + (e2 || 0), i2 + (t2 || 0), n2);
145
- }, doMouseZoom: function(e2, t2, n2, o2) {
146
- var i2 = e2 > 0 ? 0.97 : 1.03;
147
- return this.zoomTo(this.__zoomLevel * i2, false, n2 - this.__clientLeft, o2 - this.__clientTop);
148
- }, doTouchStart: function(e2, t2) {
149
- if (void 0 === e2.length) throw new Error("Invalid touch list: " + e2);
150
- if (t2 instanceof Date && (t2 = t2.valueOf()), "number" != typeof t2) throw new Error("Invalid timestamp value: " + t2);
151
- var n2, o2;
152
- this.__interruptedAnimation = true, this.__isDecelerating && (R(this.__isDecelerating), this.__isDecelerating = false, this.__interruptedAnimation = true), this.__isAnimating && (R(this.__isAnimating), this.__isAnimating = false, this.__interruptedAnimation = true);
153
- var i2 = 1 === e2.length;
154
- i2 ? (n2 = e2[0].pageX, o2 = e2[0].pageY) : (n2 = Math.abs(e2[0].pageX + e2[1].pageX) / 2, o2 = Math.abs(e2[0].pageY + e2[1].pageY) / 2), this.__initialTouchLeft = n2, this.__initialTouchTop = o2, this.__zoomLevelStart = this.__zoomLevel, this.__lastTouchLeft = n2, this.__lastTouchTop = o2, this.__lastTouchMove = t2, this.__lastScale = 1, this.__enableScrollX = !i2 && this.options.scrollingX, this.__enableScrollY = !i2 && this.options.scrollingY, this.__isTracking = true, this.__didDecelerationComplete = false, this.__isDragging = !i2, this.__isSingleTouch = i2, this.__positions = [];
155
- }, doTouchMove: function(e2, t2, n2) {
156
- if (void 0 === e2.length) throw new Error("Invalid touch list: " + e2);
157
- if (t2 instanceof Date && (t2 = t2.valueOf()), "number" != typeof t2) throw new Error("Invalid timestamp value: " + t2);
158
- if (this.__isTracking) {
159
- var o2, i2;
160
- 2 === e2.length ? (o2 = Math.abs(e2[0].pageX + e2[1].pageX) / 2, i2 = Math.abs(e2[0].pageY + e2[1].pageY) / 2) : (o2 = e2[0].pageX, i2 = e2[0].pageY);
161
- var r2 = this.__positions;
145
+ i2 && (this.__zoomComplete = i2), this.__isDecelerating && (R(this.__isDecelerating), this.__isDecelerating = 0);
146
+ const r2 = this.__zoomLevel;
147
+ void 0 === n2 && (n2 = this.__clientWidth / 2), void 0 === o2 && (o2 = this.__clientHeight / 2), t2 = Math.max(Math.min(t2, this.options.maxZoom), this.options.minZoom), this.__computeScrollMax(t2);
148
+ const s2 = t2 / r2;
149
+ let l2 = s2 * (this.__scrollLeft + n2) - n2, a2 = s2 * (this.__scrollTop + o2) - o2;
150
+ l2 > this.__maxScrollLeft ? l2 = this.__maxScrollLeft : l2 < 0 && (l2 = 0), a2 > this.__maxScrollTop ? a2 = this.__maxScrollTop : a2 < 0 && (a2 = 0), this.__publish(l2, a2, t2, e2);
151
+ }
152
+ zoomBy(t2, e2 = false, n2 = 0, o2 = 0, i2) {
153
+ this.zoomTo(this.__zoomLevel * t2, e2, n2, o2, i2);
154
+ }
155
+ scrollTo(t2, e2, n2 = false, o2 = 1) {
156
+ if (this.__isDecelerating && (R(this.__isDecelerating), this.__isDecelerating = 0), void 0 !== o2 && o2 !== this.__zoomLevel) {
157
+ if (!this.options.zooming) throw new Error("Zooming is not enabled!");
158
+ t2 *= o2, e2 *= o2, this.__computeScrollMax(o2);
159
+ } else o2 = this.__zoomLevel;
160
+ this.options.scrollingX ? this.options.paging ? t2 = Math.round(t2 / this.__clientWidth) * this.__clientWidth : this.options.snapping && (t2 = Math.round(t2 / this.__snapWidth) * this.__snapWidth) : t2 = this.__scrollLeft, this.options.scrollingY ? this.options.paging ? e2 = Math.round(e2 / this.__clientHeight) * this.__clientHeight : this.options.snapping && (e2 = Math.round(e2 / this.__snapHeight) * this.__snapHeight) : e2 = this.__scrollTop, t2 = Math.max(Math.min(this.__maxScrollLeft, t2), 0), e2 = Math.max(Math.min(this.__maxScrollTop, e2), 0), t2 === this.__scrollLeft && e2 === this.__scrollTop && (n2 = false), this.__publish(t2, e2, o2, n2);
161
+ }
162
+ scrollBy(t2 = 0, e2 = 0, n2 = false) {
163
+ const o2 = this.__isAnimating ? this.__scheduledLeft : this.__scrollLeft, i2 = this.__isAnimating ? this.__scheduledTop : this.__scrollTop;
164
+ this.scrollTo(o2 + (t2 || 0), i2 + (e2 || 0), n2);
165
+ }
166
+ doMouseZoom(t2, e2, n2, o2) {
167
+ const i2 = t2 > 0 ? 0.97 : 1.03;
168
+ return this.zoomTo(this.__zoomLevel * i2, false, n2 - this.__clientLeft, o2 - this.__clientTop);
169
+ }
170
+ doTouchStart(t2, e2) {
171
+ if (void 0 === t2.length) throw new Error("Invalid touch list: " + t2);
172
+ if (e2 instanceof Date && (e2 = e2.valueOf()), "number" != typeof e2) throw new Error("Invalid timestamp value: " + e2);
173
+ let n2, o2;
174
+ this.__interruptedAnimation = true, this.__isDecelerating && (R(this.__isDecelerating), this.__isDecelerating = 0, this.__interruptedAnimation = true), this.__isAnimating && (R(this.__isAnimating), this.__isAnimating = 0, this.__interruptedAnimation = true);
175
+ let i2 = 1 === t2.length;
176
+ i2 ? (n2 = t2[0].pageX, o2 = t2[0].pageY) : (n2 = Math.abs(t2[0].pageX + t2[1].pageX) / 2, o2 = Math.abs(t2[0].pageY + t2[1].pageY) / 2), this.__initialTouchLeft = n2, this.__initialTouchTop = o2, this.__zoomLevelStart = this.__zoomLevel, this.__lastTouchLeft = n2, this.__lastTouchTop = o2, this.__lastTouchMove = e2, this.__lastScale = 1, this.__enableScrollX = !i2 && this.options.scrollingX, this.__enableScrollY = !i2 && this.options.scrollingY, this.__isTracking = true, this.__didDecelerationComplete = false, this.__isDragging = !i2, this.__isSingleTouch = i2, this.__positions = [];
177
+ }
178
+ doTouchMove(t2, e2, n2 = 1) {
179
+ if (void 0 === t2.length) throw new Error("Invalid touch list: " + t2);
180
+ if (e2 instanceof Date && (e2 = e2.valueOf()), "number" != typeof e2) throw new Error("Invalid timestamp value: " + e2);
181
+ if (!this.__isTracking) return;
182
+ let o2, i2;
183
+ 2 === t2.length ? (o2 = Math.abs(t2[0].pageX + t2[1].pageX) / 2, i2 = Math.abs(t2[0].pageY + t2[1].pageY) / 2) : (o2 = t2[0].pageX, i2 = t2[0].pageY);
184
+ let r2 = this.__positions;
162
185
  if (this.__isDragging) {
163
- var s2 = o2 - this.__lastTouchLeft, l2 = i2 - this.__lastTouchTop, a2 = this.__scrollLeft, c2 = this.__scrollTop, h2 = this.__zoomLevel;
186
+ let t3 = o2 - this.__lastTouchLeft, s2 = i2 - this.__lastTouchTop, l2 = this.__scrollLeft, a2 = this.__scrollTop, c2 = this.__zoomLevel;
164
187
  if (void 0 !== n2 && this.options.zooming) {
165
- var u2 = h2;
166
- if (h2 = h2 / this.__lastScale * n2, u2 !== (h2 = Math.max(Math.min(h2, this.options.maxZoom), this.options.minZoom))) {
167
- var d2 = o2 - this.__clientLeft, _2 = i2 - this.__clientTop;
168
- a2 = (d2 + a2) * h2 / u2 - d2, c2 = (_2 + c2) * h2 / u2 - _2, this.__computeScrollMax(h2);
188
+ let t4 = c2;
189
+ if (c2 = c2 / this.__lastScale * n2, c2 = Math.max(Math.min(c2, this.options.maxZoom), this.options.minZoom), t4 !== c2) {
190
+ let e3 = o2 - this.__clientLeft, n3 = i2 - this.__clientTop;
191
+ l2 = (e3 + l2) * c2 / t4 - e3, a2 = (n3 + a2) * c2 / t4 - n3, this.__computeScrollMax(c2);
169
192
  }
170
193
  }
171
194
  if (this.__enableScrollX) {
172
- a2 -= s2 * this.options.speedMultiplier;
173
- var p2 = this.__maxScrollLeft;
174
- (a2 > p2 || a2 < 0) && (this.options.bouncing ? a2 += s2 / 2 * this.options.speedMultiplier : a2 = a2 > p2 ? p2 : 0);
195
+ l2 -= t3 * this.options.speedMultiplier;
196
+ let e3 = this.__maxScrollLeft;
197
+ (l2 > e3 || l2 < 0) && (this.options.bouncing ? l2 += t3 / 2 * this.options.speedMultiplier : l2 = l2 > e3 ? e3 : 0);
175
198
  }
176
199
  if (this.__enableScrollY) {
177
- c2 -= l2 * this.options.speedMultiplier;
178
- var m2 = this.__maxScrollTop;
179
- (c2 > m2 || c2 < 0) && (this.options.bouncing ? c2 += l2 / 2 * this.options.speedMultiplier : c2 = c2 > m2 ? m2 : 0);
200
+ a2 -= s2 * this.options.speedMultiplier;
201
+ const t4 = this.__maxScrollTop;
202
+ (a2 > t4 || a2 < 0) && (this.options.bouncing ? a2 += s2 / 2 * this.options.speedMultiplier : a2 = a2 > t4 ? t4 : 0);
180
203
  }
181
- r2.length > 60 && r2.splice(0, 30), r2.push(a2, c2, t2), this.__publish(a2, c2, h2);
204
+ r2.length > 60 && r2.splice(0, 30), r2.push(l2, a2, e2), this.__publish(l2, a2, c2);
182
205
  } else {
183
- var f2 = this.options.locking ? 3 : 0, g2 = Math.abs(o2 - this.__initialTouchLeft), y2 = Math.abs(i2 - this.__initialTouchTop);
184
- this.__enableScrollX = this.options.scrollingX && g2 >= f2, this.__enableScrollY = this.options.scrollingY && y2 >= f2, r2.push(this.__scrollLeft, this.__scrollTop, t2), this.__isDragging = (this.__enableScrollX || this.__enableScrollY) && (g2 >= 5 || y2 >= 5), this.__isDragging && (this.__interruptedAnimation = false);
206
+ let t3 = this.options.locking ? 3 : 0, n3 = 5, s2 = Math.abs(o2 - this.__initialTouchLeft), l2 = Math.abs(i2 - this.__initialTouchTop);
207
+ this.__enableScrollX = this.options.scrollingX && s2 >= t3, this.__enableScrollY = this.options.scrollingY && l2 >= t3, r2.push(this.__scrollLeft, this.__scrollTop, e2), this.__isDragging = (this.__enableScrollX || this.__enableScrollY) && (s2 >= n3 || l2 >= n3), this.__isDragging && (this.__interruptedAnimation = false);
208
+ }
209
+ this.__lastTouchLeft = o2, this.__lastTouchTop = i2, this.__lastTouchMove = e2, this.__lastScale = n2;
210
+ }
211
+ doTouchEnd(t2) {
212
+ if (t2 instanceof Date && (t2 = t2.valueOf()), "number" != typeof t2) throw new Error("Invalid timestamp value: " + t2);
213
+ if (this.__isTracking) {
214
+ if (this.__isTracking = false, this.__isDragging) if (this.__isDragging = false, this.__isSingleTouch && this.options.animating && t2 - this.__lastTouchMove <= 100) {
215
+ let e2 = this.__positions, n2 = e2.length - 1, o2 = n2;
216
+ for (let t3 = n2; t3 > 0 && e2[t3] > this.__lastTouchMove - 100; t3 -= 3) o2 = t3;
217
+ if (o2 !== n2) {
218
+ const i2 = e2[n2] - e2[o2], r2 = this.__scrollLeft - e2[o2 - 2], s2 = this.__scrollTop - e2[o2 - 1];
219
+ this.__decelerationVelocityX = r2 / i2 * (1e3 / 60), this.__decelerationVelocityY = s2 / i2 * (1e3 / 60);
220
+ const l2 = this.options.paging || this.options.snapping ? 4 : 1;
221
+ (Math.abs(this.__decelerationVelocityX) > l2 || Math.abs(this.__decelerationVelocityY) > l2) && this.__startDeceleration(t2);
222
+ } else this.options.scrollingComplete?.();
223
+ } else t2 - this.__lastTouchMove > 100 && this.options.scrollingComplete?.();
224
+ this.__isDecelerating || ((this.__interruptedAnimation || this.__isDragging) && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, true, this.__zoomLevel)), this.__positions.length = 0;
185
225
  }
186
- this.__lastTouchLeft = o2, this.__lastTouchTop = i2, this.__lastTouchMove = t2, this.__lastScale = n2;
187
226
  }
188
- }, doTouchEnd: function(e2) {
189
- if (e2 instanceof Date && (e2 = e2.valueOf()), "number" != typeof e2) throw new Error("Invalid timestamp value: " + e2);
190
- if (this.__isTracking) {
191
- if (this.__isTracking = false, this.__isDragging) if (this.__isDragging = false, this.__isSingleTouch && this.options.animating && e2 - this.__lastTouchMove <= 100) {
192
- for (var t2 = this.__positions, n2 = t2.length - 1, o2 = n2, i2 = n2; i2 > 0 && t2[i2] > this.__lastTouchMove - 100; i2 -= 3) o2 = i2;
193
- if (o2 !== n2) {
194
- var r2 = t2[n2] - t2[o2], s2 = this.__scrollLeft - t2[o2 - 2], l2 = this.__scrollTop - t2[o2 - 1];
195
- this.__decelerationVelocityX = s2 / r2 * (1e3 / 60), this.__decelerationVelocityY = l2 / r2 * (1e3 / 60);
196
- var a2 = this.options.paging || this.options.snapping ? 4 : 1;
197
- (Math.abs(this.__decelerationVelocityX) > a2 || Math.abs(this.__decelerationVelocityY) > a2) && this.__startDeceleration(e2);
198
- } else this.options.scrollingComplete();
199
- } else e2 - this.__lastTouchMove > 100 && this.options.scrollingComplete();
200
- this.__isDecelerating || ((this.__interruptedAnimation || this.__isDragging) && this.options.scrollingComplete(), this.scrollTo(this.__scrollLeft, this.__scrollTop, true, this.__zoomLevel)), this.__positions.length = 0;
227
+ __publish(t2, e2, n2, o2 = false) {
228
+ const i2 = this.__isAnimating;
229
+ if (i2 && (R(i2), this.__isAnimating = 0), o2 && this.options.animating) {
230
+ this.__scheduledLeft = t2, this.__scheduledTop = e2, this.__scheduledZoom = n2;
231
+ const o3 = this.__scrollLeft, r2 = this.__scrollTop, s2 = this.__zoomLevel, l2 = t2 - o3, a2 = e2 - r2, c2 = n2 - s2, h2 = function(t3, e3, n3) {
232
+ n3 && (this.__scrollLeft = o3 + l2 * t3, this.__scrollTop = r2 + a2 * t3, this.__zoomLevel = s2 + c2 * t3, this.__callback && this.__callback(this.__scrollLeft, this.__scrollTop, this.__zoomLevel));
233
+ }.bind(this), u2 = function(t3) {
234
+ return this.__isAnimating === t3;
235
+ }.bind(this), d2 = function(t3, e3, n3) {
236
+ e3 === this.__isAnimating && (this.__isAnimating = false), (this.__didDecelerationComplete || n3) && this.options.scrollingComplete?.(), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
237
+ }.bind(this);
238
+ this.__isAnimating = F(h2, u2, d2, this.options.animationDuration, i2 ? I : Y);
239
+ } else this.__scheduledLeft = this.__scrollLeft = t2, this.__scheduledTop = this.__scrollTop = e2, this.__scheduledZoom = this.__zoomLevel = n2, this.__callback && this.__callback(t2, e2, n2), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
201
240
  }
202
- }, __publish: function(e2, t2, n2, o2) {
203
- var i2 = this.__isAnimating;
204
- if (i2 && (R(i2), this.__isAnimating = false), o2 && this.options.animating) {
205
- this.__scheduledLeft = e2, this.__scheduledTop = t2, this.__scheduledZoom = n2;
206
- var r2 = this.__scrollLeft, s2 = this.__scrollTop, l2 = this.__zoomLevel, a2 = e2 - r2, c2 = t2 - s2, h2 = n2 - l2, u2 = function(e3, t3, n3) {
207
- n3 && (this.__scrollLeft = r2 + a2 * e3, this.__scrollTop = s2 + c2 * e3, this.__zoomLevel = l2 + h2 * e3, this.__callback && this.__callback(this.__scrollLeft, this.__scrollTop, this.__zoomLevel));
208
- }.bind(this), d2 = function(e3) {
209
- return this.__isAnimating === e3;
210
- }.bind(this), _2 = function(e3, t3, n3) {
211
- t3 === this.__isAnimating && (this.__isAnimating = false), (this.__didDecelerationComplete || n3) && this.options.scrollingComplete(), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
212
- }.bind(this);
213
- this.__isAnimating = F(u2, d2, _2, this.options.animationDuration, i2 ? Y : X);
214
- } else this.__scheduledLeft = this.__scrollLeft = e2, this.__scheduledTop = this.__scrollTop = t2, this.__scheduledZoom = this.__zoomLevel = n2, this.__callback && this.__callback(e2, t2, n2), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
215
- }, __computeScrollMax: function(e2) {
216
- void 0 === e2 && (e2 = this.__zoomLevel), this.__maxScrollLeft = Math.max(this.__contentWidth * e2 - this.__clientWidth, 0), this.__maxScrollTop = Math.max(this.__contentHeight * e2 - this.__clientHeight, 0);
217
- }, __startDeceleration: function(e2) {
218
- if (this.options.paging) {
219
- var t2 = Math.max(Math.min(this.__scrollLeft, this.__maxScrollLeft), 0), n2 = Math.max(Math.min(this.__scrollTop, this.__maxScrollTop), 0), o2 = this.__clientWidth, i2 = this.__clientHeight;
220
- this.__minDecelerationScrollLeft = Math.floor(t2 / o2) * o2, this.__minDecelerationScrollTop = Math.floor(n2 / i2) * i2, this.__maxDecelerationScrollLeft = Math.ceil(t2 / o2) * o2, this.__maxDecelerationScrollTop = Math.ceil(n2 / i2) * i2;
221
- } else this.__minDecelerationScrollLeft = 0, this.__minDecelerationScrollTop = 0, this.__maxDecelerationScrollLeft = this.__maxScrollLeft, this.__maxDecelerationScrollTop = this.__maxScrollTop;
222
- var r2 = function(e3, t3, n3) {
223
- this.__stepThroughDeceleration(n3);
224
- }.bind(this), s2 = this.options.snapping ? 4 : 0.1, l2 = function() {
225
- var e3 = Math.abs(this.__decelerationVelocityX) >= s2 || Math.abs(this.__decelerationVelocityY) >= s2;
226
- return e3 || (this.__didDecelerationComplete = true), e3;
227
- }.bind(this), a2 = function(e3, t3, n3) {
228
- this.__isDecelerating = false, this.__didDecelerationComplete && this.options.scrollingComplete(), this.scrollTo(this.__scrollLeft, this.__scrollTop, this.options.snapping);
229
- }.bind(this);
230
- this.__isDecelerating = F(r2, l2, a2);
231
- }, __stepThroughDeceleration: function(e2) {
232
- var t2 = this.__scrollLeft + this.__decelerationVelocityX, n2 = this.__scrollTop + this.__decelerationVelocityY;
233
- if (!this.options.bouncing) {
234
- var o2 = Math.max(Math.min(this.__maxDecelerationScrollLeft, t2), this.__minDecelerationScrollLeft);
235
- o2 !== t2 && (t2 = o2, this.__decelerationVelocityX = 0);
236
- var i2 = Math.max(Math.min(this.__maxDecelerationScrollTop, n2), this.__minDecelerationScrollTop);
237
- i2 !== n2 && (n2 = i2, this.__decelerationVelocityY = 0);
241
+ __computeScrollMax(t2 = this.__zoomLevel) {
242
+ this.__maxScrollLeft = Math.max(this.__contentWidth * t2 - this.__clientWidth, 0), this.__maxScrollTop = Math.max(this.__contentHeight * t2 - this.__clientHeight, 0);
238
243
  }
239
- if (e2 ? this.__publish(t2, n2, this.__zoomLevel) : (this.__scrollLeft = t2, this.__scrollTop = n2), !this.options.paging) {
240
- this.__decelerationVelocityX *= 0.95, this.__decelerationVelocityY *= 0.95;
244
+ __startDeceleration(t2) {
245
+ if (this.options.paging) {
246
+ const t3 = Math.max(Math.min(this.__scrollLeft, this.__maxScrollLeft), 0), e3 = Math.max(Math.min(this.__scrollTop, this.__maxScrollTop), 0), n3 = this.__clientWidth, o3 = this.__clientHeight;
247
+ this.__minDecelerationScrollLeft = Math.floor(t3 / n3) * n3, this.__minDecelerationScrollTop = Math.floor(e3 / o3) * o3, this.__maxDecelerationScrollLeft = Math.ceil(t3 / n3) * n3, this.__maxDecelerationScrollTop = Math.ceil(e3 / o3) * o3;
248
+ } else this.__minDecelerationScrollLeft = 0, this.__minDecelerationScrollTop = 0, this.__maxDecelerationScrollLeft = this.__maxScrollLeft, this.__maxDecelerationScrollTop = this.__maxScrollTop;
249
+ const e2 = function(t3, e3, n3) {
250
+ this.__stepThroughDeceleration(n3);
251
+ }.bind(this), n2 = this.options.snapping ? 4 : 0.1, o2 = function() {
252
+ const t3 = Math.abs(this.__decelerationVelocityX) >= n2 || Math.abs(this.__decelerationVelocityY) >= n2;
253
+ return t3 || (this.__didDecelerationComplete = true), t3;
254
+ }.bind(this), i2 = function(t3, e3, n3) {
255
+ this.__isDecelerating = 0, this.__didDecelerationComplete && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, this.options.snapping);
256
+ }.bind(this);
257
+ this.__isDecelerating = F(e2, o2, i2);
241
258
  }
242
- if (this.options.bouncing) {
243
- var r2 = 0, s2 = 0, l2 = this.options.penetrationDeceleration, a2 = this.options.penetrationAcceleration;
244
- t2 < this.__minDecelerationScrollLeft ? r2 = this.__minDecelerationScrollLeft - t2 : t2 > this.__maxDecelerationScrollLeft && (r2 = this.__maxDecelerationScrollLeft - t2), n2 < this.__minDecelerationScrollTop ? s2 = this.__minDecelerationScrollTop - n2 : n2 > this.__maxDecelerationScrollTop && (s2 = this.__maxDecelerationScrollTop - n2), 0 !== r2 && (r2 * this.__decelerationVelocityX <= 0 ? this.__decelerationVelocityX += r2 * l2 : this.__decelerationVelocityX = r2 * a2), 0 !== s2 && (s2 * this.__decelerationVelocityY <= 0 ? this.__decelerationVelocityY += s2 * l2 : this.__decelerationVelocityY = s2 * a2);
259
+ __stepThroughDeceleration(t2) {
260
+ let e2 = this.__scrollLeft + this.__decelerationVelocityX, n2 = this.__scrollTop + this.__decelerationVelocityY;
261
+ if (!this.options.bouncing) {
262
+ const t3 = Math.max(Math.min(this.__maxDecelerationScrollLeft, e2), this.__minDecelerationScrollLeft);
263
+ t3 !== e2 && (e2 = t3, this.__decelerationVelocityX = 0);
264
+ const o2 = Math.max(Math.min(this.__maxDecelerationScrollTop, n2), this.__minDecelerationScrollTop);
265
+ o2 !== n2 && (n2 = o2, this.__decelerationVelocityY = 0);
266
+ }
267
+ if (t2 ? this.__publish(e2, n2, this.__zoomLevel) : (this.__scrollLeft = e2, this.__scrollTop = n2), !this.options.paging) {
268
+ const t3 = 0.95;
269
+ this.__decelerationVelocityX *= t3, this.__decelerationVelocityY *= t3;
270
+ }
271
+ if (this.options.bouncing) {
272
+ let t3 = 0, o2 = 0, i2 = this.options.penetrationDeceleration, r2 = this.options.penetrationAcceleration;
273
+ e2 < this.__minDecelerationScrollLeft ? t3 = this.__minDecelerationScrollLeft - e2 : e2 > this.__maxDecelerationScrollLeft && (t3 = this.__maxDecelerationScrollLeft - e2), n2 < this.__minDecelerationScrollTop ? o2 = this.__minDecelerationScrollTop - n2 : n2 > this.__maxDecelerationScrollTop && (o2 = this.__maxDecelerationScrollTop - n2), 0 !== t3 && (t3 * this.__decelerationVelocityX <= 0 ? this.__decelerationVelocityX += t3 * i2 : this.__decelerationVelocityX = t3 * r2), 0 !== o2 && (o2 * this.__decelerationVelocityY <= 0 ? this.__decelerationVelocityY += o2 * i2 : this.__decelerationVelocityY = o2 * r2);
274
+ }
245
275
  }
246
- } };
247
- const U = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), Z = {};
248
- function G() {
276
+ }
277
+ const j = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), U = {};
278
+ function Z() {
249
279
  return b;
250
280
  }
251
- const q = (e2) => "BracketLeft" === e2 ? "[" : "BracketRight" === e2 ? "]" : g.camelToPrettyCase(e2), J = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: Z, boundPixel: function(e2, t2 = false, n2 = 0) {
252
- return e2;
253
- }, createSyntheticEvent: (e2) => {
254
- let t2 = false, n2 = false;
255
- return { nativeEvent: e2, currentTarget: e2.currentTarget, target: e2.target, bubbles: e2.bubbles, cancelable: e2.cancelable, defaultPrevented: e2.defaultPrevented, eventPhase: e2.eventPhase, isTrusted: e2.isTrusted, preventDefault: () => {
256
- t2 = true, e2.preventDefault();
257
- }, isDefaultPrevented: () => t2, stopPropagation: () => {
258
- n2 = true, e2.stopPropagation();
281
+ const G = (t2) => "BracketLeft" === t2 ? "[" : "BracketRight" === t2 ? "]" : g.camelToPrettyCase(t2), q = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: U, boundPixel: function(t2, e2 = false, n2 = 0) {
282
+ return t2;
283
+ }, createSyntheticEvent: (t2) => {
284
+ let e2 = false, n2 = false;
285
+ return { nativeEvent: t2, currentTarget: t2.currentTarget, target: t2.target, bubbles: t2.bubbles, cancelable: t2.cancelable, defaultPrevented: t2.defaultPrevented, eventPhase: t2.eventPhase, isTrusted: t2.isTrusted, preventDefault: () => {
286
+ e2 = true, t2.preventDefault();
287
+ }, isDefaultPrevented: () => e2, stopPropagation: () => {
288
+ n2 = true, t2.stopPropagation();
259
289
  }, isPropagationStopped: () => n2, persist: () => {
260
- }, timeStamp: e2.timeStamp, type: e2.type };
261
- }, detectIt: G, focusableNodeNames: U, toPrettyKeyCode: q }, Symbol.toStringTag, { value: "Module" })), Q = [];
262
- function ee(e2, t2, n2 = Q) {
290
+ }, timeStamp: t2.timeStamp, type: t2.type };
291
+ }, detectIt: Z, focusableNodeNames: j, toPrettyKeyCode: G }, Symbol.toStringTag, { value: "Module" })), J = [];
292
+ function Q(t2, e2, n2 = J) {
263
293
  const o2 = r(null);
264
- return u(e2, () => {
294
+ return u(t2, () => {
265
295
  if (!o2.current) return;
266
- const e3 = o2.current, n3 = t2?.();
296
+ const t3 = o2.current, n3 = e2?.();
267
297
  if (!n3 || "object" != typeof n3) throw new Error("attributes must return a plain object of values");
268
298
  const i2 = Object.keys(n3), r2 = i2.length;
269
- for (let t3 = 0; t3 < r2; t3++) {
270
- const o3 = i2[t3], r3 = n3[o3];
271
- Object.defineProperty(e3, o3, { value: r3, writable: true, configurable: true, enumerable: true });
299
+ for (let e3 = 0; e3 < r2; e3++) {
300
+ const o3 = i2[e3], r3 = n3[o3];
301
+ Object.defineProperty(t3, o3, { value: r3, writable: true, configurable: true, enumerable: true });
272
302
  }
273
- return e3;
303
+ return t3;
274
304
  }, n2), o2;
275
305
  }
276
- const te = (t2) => e(O, { ...t2 }), ne = ({ width: t2, height: n2 }) => e("div", { className: "corner", style: { minWidth: `${t2}px`, width: `${t2}px`, minHeight: `${n2}px`, height: `${n2}px` } }), oe = s(l((o2, s2) => {
277
- const { children: l2, viewport: a2, onScrollViewport: u2, showHorizontalScrollbar: d2 = true, showVerticalScrollbar: _2 = true, createScrollCorner: p2 = ne, createHorizontalScrollbar: m2 = te, createVerticalScrollbar: g2 = te, style: y2, touchElement: v2, disableTouch: x2, ...b2 } = o2, w2 = P(u2, [u2]), S2 = ee(s2, () => ({ isScrollPane: () => true }), []), L2 = r(null);
306
+ const tt = (e2) => t(O, { ...e2 }), et = ({ width: e2, height: n2 }) => t("div", { className: "corner", style: { minWidth: `${e2}px`, width: `${e2}px`, minHeight: `${n2}px`, height: `${n2}px` } }), nt = s(l((o2, s2) => {
307
+ const { children: l2, viewport: a2, onScrollViewport: u2, showHorizontalScrollbar: d2 = true, showVerticalScrollbar: _2 = true, createScrollCorner: p2 = et, createHorizontalScrollbar: m2 = tt, createVerticalScrollbar: g2 = tt, style: y2, touchElement: v2, disableTouch: x2, ...b2 } = o2, w2 = P(u2, [u2]), S2 = Q(s2, () => ({ isScrollPane: () => true }), []), L2 = r(null);
278
308
  c(() => {
279
- L2.current && (L2.current.__scrollTop === a2?.top && L2.current.__scrollLeft !== !a2?.left || L2.current?.scrollTo(a2?.left, a2?.top, false));
309
+ L2.current && (L2.current.__scrollTop === a2?.top && L2.current.__scrollLeft === a2?.left || L2.current.__isDecelerating || L2.current?.scrollTo(a2?.left, a2?.top, false));
280
310
  }, [a2?.left, a2?.top, v2]);
281
- const C2 = i((e2, t2) => {
282
- w2?.({ left: e2, top: t2 });
283
- }, []), E2 = i((e2) => {
284
- L2.current?.doTouchStart(e2.touches, e2.timeStamp);
285
- }, []), T2 = i((e2) => {
286
- e2.preventDefault(), L2.current?.doTouchMove(e2.touches, e2.timeStamp);
287
- }, []), M2 = i((e2) => {
288
- L2.current?.doTouchEnd(e2.timeStamp);
289
- }, []), z2 = i(({ containerWidth: e2, containerHeight: t2, totalWidth: n2, totalHeight: o3 }) => {
290
- L2.current.setDimensions(e2, t2, n2, o3);
311
+ const C2 = i((t2, e2) => {
312
+ w2?.({ left: t2, top: e2 });
313
+ }, []), E2 = i((t2) => {
314
+ L2.current?.doTouchStart(t2.touches, t2.timeStamp);
315
+ }, []), T2 = i((t2) => {
316
+ t2.preventDefault(), L2.current?.doTouchMove(t2.touches, t2.timeStamp);
317
+ }, []), M2 = i((t2) => {
318
+ L2.current?.doTouchEnd(t2.timeStamp);
319
+ }, []), z2 = i(({ containerWidth: t2, containerHeight: e2, totalWidth: n2, totalHeight: o3 }) => {
320
+ L2.current.setDimensions(t2, e2, n2, o3);
291
321
  }, []);
292
322
  c(() => {
293
- const e2 = v2 ?? S2.current;
294
- if (!x2 && G().supportsTouchEvents && e2 && a2) {
323
+ const t2 = v2 ?? S2.current;
324
+ if (!x2 && Z().supportsTouchEvents && t2 && a2) {
295
325
  if (!L2.current) {
296
- const e3 = { scrollingX: true, scrollingY: true, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
297
- L2.current = new j(C2, e3);
326
+ const t3 = { scrollingX: true, scrollingY: true, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
327
+ L2.current = new X(C2, t3);
298
328
  }
299
- G().supportsTouchEvents && (e2.addEventListener("touchstart", E2), e2.addEventListener("touchend", M2), e2.addEventListener("touchmove", T2)), z2({ containerWidth: a2?.width, containerHeight: a2?.height, totalWidth: a2?.totalWidth, totalHeight: a2?.totalHeight });
329
+ Z().supportsTouchEvents && (t2.addEventListener("touchstart", E2), t2.addEventListener("touchend", M2), t2.addEventListener("touchmove", T2)), z2({ containerWidth: a2?.width, containerHeight: a2?.height, totalWidth: a2?.totalWidth, totalHeight: a2?.totalHeight });
300
330
  }
301
331
  return () => {
302
- e2?.removeEventListener("touchstart", E2), e2?.removeEventListener("touchend", M2), e2?.removeEventListener("touchmove", T2);
332
+ t2?.removeEventListener("touchstart", E2), t2?.removeEventListener("touchend", M2), t2?.removeEventListener("touchmove", T2);
303
333
  };
304
334
  }, [a2?.width, a2?.height, a2?.totalWidth, a2?.totalHeight, x2, v2]);
305
335
  const [k2, { width: A2 }] = f(), [B2, { height: $2 }] = f(), K2 = h(() => {
306
- const t2 = g2({ orientation: D.Vertical, offset: a2?.top, viewportSize: a2?.height, totalSize: a2?.totalHeight, onScrollOffset: (e2) => {
307
- w2?.({ top: e2 });
336
+ const e2 = g2({ orientation: D.Vertical, offset: a2?.top, viewportSize: a2?.height, totalSize: a2?.totalHeight, onScrollOffset: (t2) => {
337
+ w2?.({ top: t2 });
308
338
  } });
309
- return e("div", { style: { display: "flex", flex: "0" }, ref: k2, children: t2 });
339
+ return t("div", { style: { display: "flex", flex: "0" }, ref: k2, children: e2 });
310
340
  }, [g2, a2?.top, a2?.height, a2?.totalHeight]), O2 = h(() => {
311
- const o3 = m2({ orientation: D.Horizontal, offset: a2?.left, viewportSize: a2?.width, totalSize: a2?.totalWidth, onScrollOffset: (e2) => w2?.({ left: e2 }) });
312
- return t("div", { style: { display: "flex", flex: "none", flexDirection: "row", alignItems: "stretch", justifyContent: "center" }, children: [e("div", { style: { display: "flex", flex: "1 1 100%", flexDirection: "column", width: `calc(100% - ${A2}px)` }, children: e("div", { ref: B2, className: "sizer", children: o3 }) }), _2 ? p2({ width: A2, height: $2 }) : e(n, {})] });
341
+ const o3 = m2({ orientation: D.Horizontal, offset: a2?.left, viewportSize: a2?.width, totalSize: a2?.totalWidth, onScrollOffset: (t2) => w2?.({ left: t2 }) });
342
+ return e("div", { style: { display: "flex", flex: "none", flexDirection: "row", alignItems: "stretch", justifyContent: "center" }, children: [t("div", { style: { display: "flex", flex: "1 1 100%", flexDirection: "column", width: `calc(100% - ${A2}px)` }, children: t("div", { ref: B2, className: "sizer", children: o3 }) }), _2 ? p2({ width: A2, height: $2 }) : t(n, {})] });
313
343
  }, [m2, a2?.left, a2?.width, a2?.totalWidth, _2, p2, A2, $2]);
314
- return e("div", { style: { position: "relative", display: "flex", minWidth: _2 ? `${A2}px` : void 0, minHeight: d2 ? `${$2}px` : void 0, ...y2 }, ...b2, ref: S2, children: t("div", { style: { position: "relative", width: "100%", flex: "1 1 100%", display: "flex", flexDirection: "column", boxSizing: "border-box" }, children: [t("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: [e("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: l2 }), _2 ? K2 : e(n, {})] }), d2 ? O2 : e(n, {})] }) });
344
+ return t("div", { style: { position: "relative", display: "flex", minWidth: _2 ? `${A2}px` : void 0, minHeight: d2 ? `${$2}px` : void 0, ...y2 }, ...b2, ref: S2, children: e("div", { style: { position: "relative", width: "100%", flex: "1 1 100%", display: "flex", flexDirection: "column", boxSizing: "border-box" }, children: [e("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: [t("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: l2 }), _2 ? K2 : t(n, {})] }), d2 ? O2 : t(n, {})] }) });
315
345
  }));
316
- oe.displayName = "ScrollPane";
317
- const ie = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" }, re = /* @__PURE__ */ new Set(), se = { showMessage: (e2, t2) => {
318
- if (t2?.onceKey) {
319
- if (re.has(t2.onceKey)) return;
320
- re.add(t2.onceKey);
346
+ nt.displayName = "ScrollPane";
347
+ const ot = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" }, it = /* @__PURE__ */ new Set(), rt = { showMessage: (t2, e2) => {
348
+ if (e2?.onceKey) {
349
+ if (it.has(e2.onceKey)) return;
350
+ it.add(e2.onceKey);
321
351
  }
322
352
  let n2 = console.log;
323
- t2?.type !== ie.Warning && t2?.type !== ie.Error || (n2 = console.warn), n2(e2);
324
- }, showBusy: (e2, t2) => new Promise((e3) => {
325
- e3(() => {
353
+ e2?.type !== ot.Warning && e2?.type !== ot.Error || (n2 = console.warn), n2(t2);
354
+ }, showBusy: (t2, e2) => new Promise((t3) => {
355
+ t3(() => {
326
356
  });
327
- }), showError: (e2) => {
328
- console.error(e2);
329
- } }, le = () => {
330
- const e2 = document.fullscreenElement;
331
- return e2 ? e2.querySelector(".fullscreen-portal-root") || e2 : document.body;
357
+ }), showError: (t2) => {
358
+ console.error(t2);
359
+ } }, st = () => {
360
+ const t2 = document.fullscreenElement;
361
+ return t2 ? t2.querySelector(".fullscreen-portal-root") || t2 : document.body;
332
362
  };
333
- let ae = 0;
334
- function ce() {
363
+ let lt = 0;
364
+ function at() {
335
365
  return c(() => {
336
- function e2() {
337
- const e3 = document.fullscreenElement;
338
- if (!e3) return;
339
- let t2 = e3.querySelector(".fullscreen-portal-root");
340
- t2 || (t2 = document.createElement("div"), t2.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", e3.appendChild(t2));
366
+ function t2() {
367
+ const t3 = document.fullscreenElement;
368
+ if (!t3) return;
369
+ let e2 = t3.querySelector(".fullscreen-portal-root");
370
+ e2 || (e2 = document.createElement("div"), e2.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", t3.appendChild(e2));
341
371
  }
342
- return ae++, e2(), document.addEventListener("fullscreenchange", e2), () => {
343
- document.removeEventListener("fullscreenchange", e2), ae--, ae <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((e3) => {
344
- e3.parentNode && e3.parentNode.removeChild(e3);
345
- }), ae = 0);
372
+ return lt++, t2(), document.addEventListener("fullscreenchange", t2), () => {
373
+ document.removeEventListener("fullscreenchange", t2), lt--, lt <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((t3) => {
374
+ t3.parentNode && t3.parentNode.removeChild(t3);
375
+ }), lt = 0);
346
376
  };
347
- }, []), { getPortalContainer: le };
377
+ }, []), { getPortalContainer: st };
348
378
  }
349
- const he = 100, ue = 100, de = 1e6, _e = 100, pe = 50, me = s(l((t2, n2) => {
350
- const { offset: o2 = 0, viewportSize: s2 = 0, totalSize: l2 = 0, minSize: c2 = 0, endGap: h2 = he, endScrollIncrement: u2 = ue, style: _2 = Z, onMouseDown: p2, onScrollOffset: m2, onScroll: f2, scaleLimit: g2 = de, scaleFactor: y2 = _e, precisionFactor: v2 = pe, ...x2 } = t2;
379
+ const ct = 100, ht = 100, ut = 1e6, dt = 100, _t = 50, pt = s(l((e2, n2) => {
380
+ const { offset: o2 = 0, viewportSize: s2 = 0, totalSize: l2 = 0, minSize: c2 = 0, endGap: h2 = ct, endScrollIncrement: u2 = ht, style: _2 = U, onMouseDown: p2, onScrollOffset: m2, onScroll: f2, scaleLimit: g2 = ut, scaleFactor: y2 = dt, precisionFactor: v2 = _t, ...x2 } = e2;
351
381
  f2 && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
352
- const b2 = P(p2, [p2]), w2 = () => ({ offset: o2, totalSize: 0 === g2 ? l2 : Math.min(l2 ?? 0, Math.max(c2 ?? 0, (o2 ?? 0) + (s2 ?? 0)) + (h2 ?? 0)) }), [S2, L2] = a(w2), C2 = 0 !== g2 && S2.totalSize > g2 ? y2 : 1, E2 = C2 / v2, T2 = Math.ceil(S2.totalSize / C2), M2 = Math.ceil(S2.offset / C2), D2 = Math.ceil(s2 / C2), z2 = i((e2) => {
382
+ const b2 = P(p2, [p2]), w2 = () => ({ offset: o2, totalSize: 0 === g2 ? l2 : Math.min(l2 ?? 0, Math.max(c2 ?? 0, (o2 ?? 0) + (s2 ?? 0)) + (h2 ?? 0)) }), [S2, L2] = a(w2), C2 = 0 !== g2 && S2.totalSize > g2 ? y2 : 1, E2 = C2 / v2, T2 = Math.ceil(S2.totalSize / C2), M2 = Math.ceil(S2.offset / C2), D2 = Math.ceil(s2 / C2), z2 = i((t2) => {
353
383
  }, []), [k2, A2] = a(false), B2 = r(null);
354
384
  d(() => {
355
385
  if (!k2) {
356
386
  B2.current = { propTotalSize: l2, propViewportSize: s2, propOffset: o2 };
357
- const e2 = w2();
358
- L2(e2);
387
+ const t2 = w2();
388
+ L2(t2);
359
389
  }
360
390
  }, [l2, s2, o2, k2, c2, h2, u2]);
361
- const $2 = P((e2, t3, n3) => {
391
+ const $2 = P((t2, e3, n3) => {
362
392
  const i2 = B2.current;
363
- B2.current = null, i2 && i2.propTotalSize === l2 && i2.propViewportSize === s2 && i2.propOffset === o2 || (Math.abs(e2 - M2) < E2 && (e2 = M2), m2?.(e2 * C2, M2, D2));
364
- }, [m2, C2, E2, M2, D2]), K2 = i((e2) => {
393
+ B2.current = null, i2 && i2.propTotalSize === l2 && i2.propViewportSize === s2 && i2.propOffset === o2 || (Math.abs(t2 - M2) < E2 && (t2 = M2), m2?.(t2 * C2, M2, D2));
394
+ }, [m2, C2, E2, M2, D2]), K2 = i((t2) => {
365
395
  document.removeEventListener("mousemove", z2), document.removeEventListener("mouseup", K2), A2(false);
366
- }, []), V2 = i((e2) => {
367
- b2?.(e2), A2(true), document.addEventListener("mousemove", z2, { passive: true }), document.addEventListener("mouseup", K2, { passive: true });
396
+ }, []), V2 = i((t2) => {
397
+ b2?.(t2), A2(true), document.addEventListener("mousemove", z2, { passive: true }), document.addEventListener("mouseup", K2, { passive: true });
368
398
  }, [z2, K2]);
369
- return e(O, { ref: n2, style: { ..._2 }, ...x2, offset: M2, totalSize: T2, viewportSize: D2, onMouseDown: V2, onScrollOffset: $2 });
399
+ return t(O, { ref: n2, style: { ..._2 }, ...x2, offset: M2, totalSize: T2, viewportSize: D2, onMouseDown: V2, onScrollOffset: $2 });
370
400
  }));
371
- me.displayName = "VirtualScrollbar";
372
- const fe = { BottomEnd: "bottom-end", BottomStart: "bottom-start", Bottom: "bottom", LeftEnd: "left-end", LeftStart: "left-start", Left: "left", RightEnd: "right-end", RightStart: "right-start", Right: "right", TopEnd: "top-end", TopStart: "top-start", Top: "top" }, ge = s(l((t2, n2) => {
373
- const { refFocusStart: o2, ...s2 } = t2, l2 = r(null), a2 = i(() => {
401
+ pt.displayName = "VirtualScrollbar";
402
+ const mt = { BottomEnd: "bottom-end", BottomStart: "bottom-start", Bottom: "bottom", LeftEnd: "left-end", LeftStart: "left-start", Left: "left", RightEnd: "right-end", RightStart: "right-start", Right: "right", TopEnd: "top-end", TopStart: "top-start", Top: "top" }, ft = s(l((e2, n2) => {
403
+ const { refFocusStart: o2, ...s2 } = e2, l2 = r(null), a2 = i(() => {
374
404
  if (o2) return void o2?.current?.focus();
375
- const e2 = l2.current.parentElement.children;
376
- let t3 = [];
377
- for (let n3 = 0; n3 < e2.length && e2[n3] !== l2.current; n3++) {
378
- const o3 = e2[n3].getAttribute("tabindex");
405
+ const t2 = l2.current.parentElement.children;
406
+ let e3 = [];
407
+ for (let n3 = 0; n3 < t2.length && t2[n3] !== l2.current; n3++) {
408
+ const o3 = t2[n3].getAttribute("tabindex");
379
409
  if (null == o3 || "-1" === o3) continue;
380
- if ("true" === e2[n3].getAttribute("disabled")) continue;
381
- const i2 = e2[n3];
382
- i2.focus && t3.push({ tabindex: parseInt(o3), child: i2 });
410
+ if ("true" === t2[n3].getAttribute("disabled")) continue;
411
+ const i2 = t2[n3];
412
+ i2.focus && e3.push({ tabindex: parseInt(o3), child: i2 });
383
413
  }
384
- 0 !== t3.length && (t3.sort(function(e3, t4) {
385
- return e3.tabindex - t4.tabindex;
386
- }), t3[0].child.focus());
414
+ 0 !== e3.length && (e3.sort(function(t3, e4) {
415
+ return t3.tabindex - e4.tabindex;
416
+ }), e3[0].child.focus());
387
417
  }, [o2]);
388
- return e("div", { tabIndex: 0, ref: w([l2, n2]), onFocus: a2, ...s2 });
418
+ return t("div", { tabIndex: 0, ref: w([l2, n2]), onFocus: a2, ...s2 });
389
419
  }));
390
- const ye = s(l((i2, s2) => {
391
- const { className: l2, style: a2, children: c2, radius: u2 = 4, strokeWidth: d2 = 1, strokeColor: _2 = "grey", ...p2 } = i2, [m2, { width: g2, height: y2 }] = f(), v2 = r(null), x2 = (e2, t2 = 0) => {
392
- const n2 = e2 / 2, o2 = y2 - n2 + t2;
393
- return function(e3, t3, n3 = false) {
394
- if (0 === t3) return e3;
395
- function o3(e4, t4, n4) {
396
- let o4 = t4.x - e4.x, r3 = t4.y - e4.y, s4 = Math.sqrt(o4 * o4 + r3 * r3);
397
- return i3(e4, t4, Math.min(1, n4 / s4));
420
+ const gt = s(l((i2, s2) => {
421
+ const { className: l2, style: a2, children: c2, radius: u2 = 4, strokeWidth: d2 = 1, strokeColor: _2 = "grey", ...p2 } = i2, [m2, { width: g2, height: y2 }] = f(), v2 = r(null), x2 = (t2, e2 = 0) => {
422
+ const n2 = t2 / 2, o2 = y2 - n2 + e2;
423
+ return function(t3, e3, n3 = false) {
424
+ if (0 === e3) return t3;
425
+ function o3(t4, e4, n4) {
426
+ let o4 = e4.x - t4.x, r3 = e4.y - t4.y, s4 = Math.sqrt(o4 * o4 + r3 * r3);
427
+ return i3(t4, e4, Math.min(1, n4 / s4));
398
428
  }
399
- function i3(e4, t4, n4) {
400
- return { x: e4.x + (t4.x - e4.x) * n4, y: e4.y + (t4.y - e4.y) * n4 };
429
+ function i3(t4, e4, n4) {
430
+ return { x: t4.x + (e4.x - t4.x) * n4, y: t4.y + (e4.y - t4.y) * n4 };
401
431
  }
402
- function r2(e4, t4) {
403
- e4.length > 2 && (e4[e4.length - 2] = t4.x, e4[e4.length - 1] = t4.y);
432
+ function r2(t4, e4) {
433
+ t4.length > 2 && (t4[t4.length - 2] = e4.x, t4[t4.length - 1] = e4.y);
404
434
  }
405
- function s3(e4) {
406
- return { x: parseFloat(e4[e4.length - 2]), y: parseFloat(e4[e4.length - 1]) };
435
+ function s3(t4) {
436
+ return { x: parseFloat(t4[t4.length - 2]), y: parseFloat(t4[t4.length - 1]) };
407
437
  }
408
- let l3 = e3.split(/[,\s]/).reduce(function(e4, t4) {
409
- let n4 = t4.match("([a-zA-Z])(.+)");
410
- return n4 ? (e4.push(n4[1]), e4.push(n4[2])) : e4.push(t4), e4;
411
- }, []).reduce(function(e4, t4) {
412
- return parseFloat(t4) == t4 && e4.length ? e4[e4.length - 1].push(t4) : e4.push([t4]), e4;
438
+ let l3 = t3.split(/[,\s]/).reduce(function(t4, e4) {
439
+ let n4 = e4.match("([a-zA-Z])(.+)");
440
+ return n4 ? (t4.push(n4[1]), t4.push(n4[2])) : t4.push(e4), t4;
441
+ }, []).reduce(function(t4, e4) {
442
+ return parseFloat(e4) == e4 && t4.length ? t4[t4.length - 1].push(e4) : t4.push([e4]), t4;
413
443
  }, []), a3 = [];
414
444
  if (l3.length > 1) {
415
- let e4 = s3(l3[0]), c3 = null;
416
- "Z" === l3[l3.length - 1][0] && l3[0].length > 2 && (c3 = ["L", e4.x, e4.y], l3[l3.length - 1] = c3), a3.push(l3[0]);
417
- for (let e5 = 1; e5 < l3.length; e5++) {
418
- let h2 = a3[a3.length - 1], u3 = l3[e5], d3 = u3 === c3 ? l3[1] : l3[e5 + 1];
445
+ let t4 = s3(l3[0]), c3 = null;
446
+ "Z" === l3[l3.length - 1][0] && l3[0].length > 2 && (c3 = ["L", t4.x, t4.y], l3[l3.length - 1] = c3), a3.push(l3[0]);
447
+ for (let t5 = 1; t5 < l3.length; t5++) {
448
+ let h2 = a3[a3.length - 1], u3 = l3[t5], d3 = u3 === c3 ? l3[1] : l3[t5 + 1];
419
449
  if (d3 && h2 && h2.length > 2 && "L" === u3[0] && d3.length > 2 && "L" === d3[0]) {
420
- let e6, l4, c4 = s3(h2), _3 = s3(u3), p3 = s3(d3);
421
- n3 ? (e6 = i3(_3, h2.origPoint || c4, t3), l4 = i3(_3, d3.origPoint || p3, t3)) : (e6 = o3(_3, c4, t3), l4 = o3(_3, p3, t3)), r2(u3, e6), u3.origPoint = _3, a3.push(u3);
422
- let m3 = i3(e6, _3, 0.5), f2 = i3(_3, l4, 0.5), g3 = ["C", m3.x, m3.y, f2.x, f2.y, l4.x, l4.y];
450
+ let t6, l4, c4 = s3(h2), _3 = s3(u3), p3 = s3(d3);
451
+ n3 ? (t6 = i3(_3, h2.origPoint || c4, e3), l4 = i3(_3, d3.origPoint || p3, e3)) : (t6 = o3(_3, c4, e3), l4 = o3(_3, p3, e3)), r2(u3, t6), u3.origPoint = _3, a3.push(u3);
452
+ let m3 = i3(t6, _3, 0.5), f2 = i3(_3, l4, 0.5), g3 = ["C", m3.x, m3.y, f2.x, f2.y, l4.x, l4.y];
423
453
  g3.origPoint = _3, a3.push(g3);
424
454
  } else a3.push(u3);
425
455
  }
426
456
  if (c3) {
427
- let e5 = s3(a3[a3.length - 1]);
428
- a3.push(["Z"]), r2(a3[0], e5);
457
+ let t5 = s3(a3[a3.length - 1]);
458
+ a3.push(["Z"]), r2(a3[0], t5);
429
459
  }
430
460
  } else a3 = l3;
431
- return a3.reduce(function(e4, t4) {
432
- return e4 + t4.join(" ") + " ";
461
+ return a3.reduce(function(t4, e4) {
462
+ return t4 + e4.join(" ") + " ";
433
463
  }, "");
434
464
  }(`${`M 0 ${n2} L ${u2 - 0.5} ${n2} L ${u2 - 0.5} ${o2} L ${2 * u2} ${o2}`} ${`L ${g2 - 2 * u2} ${o2}`} ${`M ${g2 - 2 * u2} ${o2} L ${g2 - u2} ${o2} L ${g2 - u2} ${n2} L ${g2} ${n2}`}`, u2);
435
465
  }, b2 = h(() => x2(d2), [g2, y2, u2, d2]), S2 = h(() => {
436
466
  if (0 === u2) return;
437
- const e2 = u2 / 2;
438
- return x2(u2) + `L ${g2} 0 L 0 0 L 0 ${e2}`;
467
+ const t2 = u2 / 2;
468
+ return x2(u2) + `L ${g2} 0 L 0 0 L 0 ${t2}`;
439
469
  }, [b2, u2, d2]), L2 = h(() => ({ style: { clipPath: `path('${S2}')` } }), [S2]);
440
- return t("div", { className: l2, style: { display: "flex", flexDirection: "row", ...a2 }, ...p2, ref: w([v2, m2, s2]), children: [o.isValidElement(c2) ? o.cloneElement(c2, L2) : e(n, {}), e("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: g2, height: y2, viewBox: `0 0 ${g2} ${y2}`, children: e("path", { d: b2, stroke: _2, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: d2 }) })] });
441
- })), ve = {}, xe = (t2) => {
442
- const { onPointerDown: n2, style: o2, splitDirection: i2, paddingBefore: r2 = 0, paddingAfter: s2 = 0, disabled: l2, key: a2, hitAreaProps: c2 = ve, ...h2 } = t2, u2 = "row" === i2, { style: d2, className: _2, ...p2 } = c2;
443
- return e("div", { style: { ...o2, position: "relative" }, ...h2, children: e("div", { className: m("hit-box", _2), style: { left: (u2 ? -r2 : 0) + "px", width: `calc(100% + ${u2 ? r2 + s2 : 0}px)`, top: (u2 ? 0 : -r2) + "px", height: `calc(100% + ${u2 ? 0 : r2 + s2}px)`, position: "absolute", ...d2 }, onPointerDown: l2 ? void 0 : n2, ...p2 }) }, a2);
444
- }, be = {}, we = (e2, t2, n2 = true) => null === e2 ? null : null !== e2.pixels ? n2 ? e2.pixels : t2 - e2.pixels : (n2 ? e2.percent : 100 - e2.percent) / 100 * t2, Se = (e2, t2 = true) => e2?.percent ? `${t2 ? e2.percent : 100 - e2.percent}%` : e2?.pixels ? `${e2.pixels}px` : void 0, Le = (e2, t2) => {
445
- if (null == e2) return null;
470
+ return e("div", { className: l2, style: { display: "flex", flexDirection: "row", ...a2 }, ...p2, ref: w([v2, m2, s2]), children: [o.isValidElement(c2) ? o.cloneElement(c2, L2) : t(n, {}), t("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: g2, height: y2, viewBox: `0 0 ${g2} ${y2}`, children: t("path", { d: b2, stroke: _2, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: d2 }) })] });
471
+ })), yt = {}, vt = (e2) => {
472
+ const { onPointerDown: n2, style: o2, splitDirection: i2, paddingBefore: r2 = 0, paddingAfter: s2 = 0, disabled: l2, key: a2, hitAreaProps: c2 = yt, ...h2 } = e2, u2 = "row" === i2, { style: d2, className: _2, ...p2 } = c2;
473
+ return t("div", { style: { ...o2, position: "relative" }, ...h2, children: t("div", { className: m("hit-box", _2), style: { left: (u2 ? -r2 : 0) + "px", width: `calc(100% + ${u2 ? r2 + s2 : 0}px)`, top: (u2 ? 0 : -r2) + "px", height: `calc(100% + ${u2 ? 0 : r2 + s2}px)`, position: "absolute", ...d2 }, onPointerDown: l2 ? void 0 : n2, ...p2 }) }, a2);
474
+ }, xt = {}, bt = (t2, e2, n2 = true) => null === t2 ? null : null !== t2.pixels ? n2 ? t2.pixels : e2 - t2.pixels : (n2 ? t2.percent : 100 - t2.percent) / 100 * e2, wt = (t2, e2 = true) => t2?.percent ? `${e2 ? t2.percent : 100 - t2.percent}%` : t2?.pixels ? `${t2.pixels}px` : void 0, St = (t2, e2) => {
475
+ if (null == t2) return null;
446
476
  const n2 = { percent: null, pixels: null };
447
- let o2 = t2;
448
- return "string" == typeof e2 && ((e2 = e2.trim().toLowerCase()).endsWith("px") ? (e2 = e2.substring(0, e2.length - 2), o2 = false) : e2.endsWith("%") && (e2 = e2.substring(0, e2.length - 1), o2 = true), e2 = parseFloat(e2)), o2 ? n2.percent = e2 : n2.pixels = e2, Object.freeze(n2);
449
- }, Ce = s(l((n2, i2) => {
450
- const { elementBefore: s2, elementAfter: l2, splitDirection: u2 = "row", fixedPane: d2 = null, position: _2, onPositionChange: p2, minBefore: g2, maxBefore: y2, minAfter: v2, maxAfter: x2, children: b2, className: S2, style: L2, disabled: C2 = false, onDragStart: E2, onDragResize: T2, onDragFinish: M2, resizerProps: D2 = be, paneProps: z2 = be, paneBeforeProps: k2 = be, paneAfterProps: A2 = be, createResizer: B2 = xe } = n2;
477
+ let o2 = e2;
478
+ return "string" == typeof t2 && ((t2 = t2.trim().toLowerCase()).endsWith("px") ? (t2 = t2.substring(0, t2.length - 2), o2 = false) : t2.endsWith("%") && (t2 = t2.substring(0, t2.length - 1), o2 = true), t2 = parseFloat(t2)), o2 ? n2.percent = t2 : n2.pixels = t2, Object.freeze(n2);
479
+ }, Lt = s(l((n2, i2) => {
480
+ const { elementBefore: s2, elementAfter: l2, splitDirection: u2 = "row", fixedPane: d2 = null, position: _2, onPositionChange: p2, minBefore: g2, maxBefore: y2, minAfter: v2, maxAfter: x2, children: b2, className: S2, style: L2, disabled: C2 = false, onDragStart: E2, onDragResize: T2, onDragFinish: M2, resizerProps: D2 = xt, paneProps: z2 = xt, paneBeforeProps: k2 = xt, paneAfterProps: A2 = xt, createResizer: B2 = vt } = n2;
451
481
  if (b2) throw new Error("Use elementBefore and elementAfter instead of children.");
452
482
  const $2 = h(() => o.isValidElement(l2) && o.isValidElement(s2), [l2, s2]), K2 = h(() => {
453
- let e2 = null;
454
- d2 && ("before" === d2 ? e2 = 0 : "after" === d2 && (e2 = 1));
455
- const t2 = null === e2;
456
- return { fixedPaneOffset: e2, isPercent: t2, minBefore: Le(g2, t2), maxBefore: Le(y2, t2), minAfter: Le(v2, t2), maxAfter: Le(x2, t2) };
457
- }, [g2, y2, v2, x2]), O2 = P(p2, [p2]), [V2, H2] = a(() => Le(_2, null === d2));
483
+ let t2 = null;
484
+ d2 && ("before" === d2 ? t2 = 0 : "after" === d2 && (t2 = 1));
485
+ const e2 = null === t2;
486
+ return { fixedPaneOffset: t2, isPercent: e2, minBefore: St(g2, e2), maxBefore: St(y2, e2), minAfter: St(v2, e2), maxAfter: St(x2, e2) };
487
+ }, [g2, y2, v2, x2]), O2 = P(p2, [p2]), [V2, H2] = a(() => St(_2, null === d2));
458
488
  c(() => {
459
- H2(Le(_2, null === d2));
489
+ H2(St(_2, null === d2));
460
490
  }, [_2, d2]);
461
- const [W2, { width: N2, height: R2 }] = f(), [F2, { width: I2, height: Y2 }] = f(), X2 = "row" === u2 ? I2 : Y2, j2 = "row" === u2 ? N2 : R2, U2 = h(() => ((e2, t2, n3, o2) => {
491
+ const [W2, { width: N2, height: R2 }] = f(), [F2, { width: I2, height: Y2 }] = f(), X2 = "row" === u2 ? I2 : Y2, j2 = "row" === u2 ? N2 : R2, U2 = h(() => ((t2, e2, n3, o2) => {
462
492
  const i3 = [null, null], r2 = [null, null];
463
- if (e2 || (e2 = { percent: null === o2.fixedPaneOffset ? 50 : null, pixels: null === o2.fixedPaneOffset ? null : 0 }), 0 === t2) return null != e2?.pixels ? 1 !== o2.fixedPaneOffset ? (i3[0] = e2?.pixels, r2[1] = 100) : (i3[1] = e2?.pixels - n3, r2[0] = 100) : null != e2?.percent && (1 !== o2.fixedPaneOffset ? (r2[0] = e2?.percent, r2[1] = 100 - e2?.percent) : (r2[1] = e2?.percent, r2[0] = 100 - e2?.percent)), { percents: r2, pixels: i3, minBefore: Se(o2.minBefore, true), maxBefore: Se(o2.maxBefore, true), minAfter: Se(o2.minAfter), maxAfter: Se(o2.maxAfter) };
464
- let s3 = we(e2, t2, 1 !== o2.fixedPaneOffset), l3 = t2 - n3, a2 = we(o2.minBefore, l3, true) ?? 0, c2 = we(o2.maxBefore, l3, true) ?? l3, h2 = 0, u3 = 0, d3 = 0, _3 = l3;
465
- h2 = (we(o2.maxAfter, t2, false) ?? n3) - n3, u3 = we(o2.minAfter, t2, false) ?? t2, d3 = Math.max(a2, h2), _3 = Math.min(c2, u3), s3 = Math.max(d3, Math.min(s3, _3)), u3 = Math.min(l3 - s3, we(o2.maxAfter, l3 - s3, true) ?? l3), h2 = Math.min(l3 - s3, we(o2.minAfter, l3 - s3, true) ?? l3), i3[0] = s3, i3[1] = l3 - i3[0];
493
+ if (t2 || (t2 = { percent: null === o2.fixedPaneOffset ? 50 : null, pixels: null === o2.fixedPaneOffset ? null : 0 }), 0 === e2) return null != t2?.pixels ? 1 !== o2.fixedPaneOffset ? (i3[0] = t2?.pixels, r2[1] = 100) : (i3[1] = t2?.pixels - n3, r2[0] = 100) : null != t2?.percent && (1 !== o2.fixedPaneOffset ? (r2[0] = t2?.percent, r2[1] = 100 - t2?.percent) : (r2[1] = t2?.percent, r2[0] = 100 - t2?.percent)), { percents: r2, pixels: i3, minBefore: wt(o2.minBefore, true), maxBefore: wt(o2.maxBefore, true), minAfter: wt(o2.minAfter), maxAfter: wt(o2.maxAfter) };
494
+ let s3 = bt(t2, e2, 1 !== o2.fixedPaneOffset), l3 = e2 - n3, a2 = bt(o2.minBefore, l3, true) ?? 0, c2 = bt(o2.maxBefore, l3, true) ?? l3, h2 = 0, u3 = 0, d3 = 0, _3 = l3;
495
+ h2 = (bt(o2.maxAfter, e2, false) ?? n3) - n3, u3 = bt(o2.minAfter, e2, false) ?? e2, d3 = Math.max(a2, h2), _3 = Math.min(c2, u3), s3 = Math.max(d3, Math.min(s3, _3)), u3 = Math.min(l3 - s3, bt(o2.maxAfter, l3 - s3, true) ?? l3), h2 = Math.min(l3 - s3, bt(o2.minAfter, l3 - s3, true) ?? l3), i3[0] = s3, i3[1] = l3 - i3[0];
466
496
  const p3 = Math.max(0, Math.min(100, s3 / l3 * 100));
467
497
  return r2[0] = p3, r2[1] = 100 - r2[0], { percents: r2, pixels: i3, minBefore: `${a2}px`, minAfter: `${h2}px`, maxBefore: `${i3[0]}px`, maxAfter: `${i3[1]}px` };
468
- })(V2, j2, X2, K2), [K2, V2, j2, X2, u2]), [Z2, G2] = a(false), q2 = P(E2, [E2]), J2 = P(T2, [T2]), Q2 = P(M2, [M2]), te2 = r(null), ne2 = r(null), oe2 = r(null), { style: ie2, className: re2, ...se2 } = z2, le2 = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", display: "flex", overflow: "hidden", ...ie2 }, { className: ae2, style: ce2, ...he2 } = k2, { className: ue2, style: de2, ..._e2 } = A2, pe2 = { flex: "1 1 100%", width: "100%", ...L2, flexDirection: u2, display: "flex" }, { className: me2, style: fe2, onPointerDown: ge2, ...ye2 } = D2, ve2 = P((e2) => {
469
- const t2 = Le(e2, null === d2);
470
- H2(t2);
471
- }, [d2]), Ce2 = P((e2) => {
498
+ })(V2, j2, X2, K2), [K2, V2, j2, X2, u2]), [Z2, G2] = a(false), q2 = P(E2, [E2]), J2 = P(T2, [T2]), tt2 = P(M2, [M2]), et2 = r(null), nt2 = r(null), ot2 = r(null), { style: it2, className: rt2, ...st2 } = z2, lt2 = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", display: "flex", overflow: "hidden", ...it2 }, { className: at2, style: ct2, ...ht2 } = k2, { className: ut2, style: dt2, ..._t2 } = A2, pt2 = { flex: "1 1 100%", width: "100%", ...L2, flexDirection: u2, display: "flex" }, { className: mt2, style: ft2, onPointerDown: gt2, ...yt2 } = D2, Lt2 = P((t2) => {
499
+ const e2 = St(t2, null === d2);
500
+ H2(e2);
501
+ }, [d2]), Ct2 = P((t2) => {
472
502
  if (C2 || !Z2) return;
473
- const t2 = Me2.current?.getBoundingClientRect();
503
+ const e2 = Mt2.current?.getBoundingClientRect();
474
504
  let n3 = 0;
475
- n3 = "row" === u2 ? (e2.clientX ?? e2.touches?.[0]?.clientX) - t2.x : (e2.clientY ?? e2.touches?.[0]?.clientY) - t2.y, n3 = Math.max(0, Math.min(j2, n3)), 1 === K2.fixedPaneOffset && (n3 = j2 - n3), _2 && V2.pixels === n3 || H2({ pixels: n3, percent: null }), J2?.(n3), e2.stopPropagation(), e2.preventDefault();
476
- }, [K2, u2, C2, Z2, V2, j2]), Ee2 = P((e2) => {
477
- if (document.removeEventListener("pointermove", Ce2), document.removeEventListener("touchmove", Ce2), document.removeEventListener("pointerup", Ee2), !Z2) return;
505
+ n3 = "row" === u2 ? (t2.clientX ?? t2.touches?.[0]?.clientX) - e2.x : (t2.clientY ?? t2.touches?.[0]?.clientY) - e2.y, n3 = Math.max(0, Math.min(j2, n3)), 1 === K2.fixedPaneOffset && (n3 = j2 - n3), _2 && V2.pixels === n3 || H2({ pixels: n3, percent: null }), J2?.(n3), t2.stopPropagation(), t2.preventDefault();
506
+ }, [K2, u2, C2, Z2, V2, j2]), Et2 = P((t2) => {
507
+ if (document.removeEventListener("pointermove", Ct2), document.removeEventListener("touchmove", Ct2), document.removeEventListener("pointerup", Et2), !Z2) return;
478
508
  if (G2(false), !V2) return;
479
- Q2(V2.pixels);
480
- if (!Le(_2, null === d2) || V2.pixels !== _2) {
481
- const e3 = { ...V2 };
482
- null === e3.percent && (e3.percent = e3.pixels / j2 * 100), O2(e3);
509
+ tt2(V2.pixels);
510
+ if (!St(_2, null === d2) || V2.pixels !== _2) {
511
+ const t3 = { ...V2 };
512
+ null === t3.percent && (t3.percent = t3.pixels / j2 * 100), O2(t3);
483
513
  }
484
- e2.stopPropagation(), e2.preventDefault();
485
- }, [V2, Z2, _2, d2, j2]), Te2 = P((e2) => {
486
- ge2?.(e2), e2.defaultPrevented || C2 || Z2 || (G2(true), q2(), document.addEventListener("pointermove", Ce2, { passive: false }), document.addEventListener("touchmove", Ce2, { passive: false }), document.addEventListener("pointerup", Ee2, { passive: false }));
487
- }, [ge2]), Me2 = ee(i2, () => ({ setPosition: ve2, isSplitPane: () => true }), []), De2 = h(() => $2 ? B2?.({ key: "resizer", ref: w([F2, ne2]), className: m("resizer", me2), onPointerDownCapture: Te2, style: { cursor: C2 ? void 0 : "row" === u2 ? "ew-resize" : "ns-resize", minWidth: "row" === u2 ? "2px" : void 0, minHeight: "row" !== u2 ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...fe2 }, splitDirection: u2, disabled: C2, ...ye2 }) : null, [$2, me2, ye2, u2, fe2, C2]), Pe2 = "row" === u2 ? "Width" : "Height", ze2 = { ...le2, ...ce2, flex: 0 === K2.fixedPaneOffset && null !== U2?.pixels[0] ? `0 0 ${Math.round(U2?.pixels[0])}px` : `1 1 ${Math.round(U2?.percents[0] ?? 100)}%`, [`min${Pe2}`]: U2?.minBefore, [`max${Pe2}`]: l2 ? U2?.maxBefore : "100%" }, ke2 = { ...le2, ...de2, flex: 1 === K2.fixedPaneOffset && null !== U2?.pixels[1] ? `0 0 ${Math.round(U2?.pixels[1])}px` : `1 1 ${Math.round(U2?.percents[1] ?? 100)}%`, [`min${Pe2}`]: U2?.minAfter, [`max${Pe2}`]: s2 ? U2?.maxAfter : "100%" }, Ae2 = h(() => s2 ? e("div", { ref: te2, className: m("before", re2, ae2), style: ze2, ...se2, ...he2, children: s2 }, "before") : null, [s2, z2, k2, K2, U2]), Be2 = h(() => l2 ? e("div", { ref: oe2, className: m("after", re2, ue2), style: ke2, ...se2, ..._e2, children: l2 }, "after") : null, [l2, z2, A2, K2, U2]);
488
- return t("div", { ref: w([W2, Me2]), className: m("splitPane", "row" === u2 ? "vertical" : "horizontal", { dragging: Z2 }, S2), style: pe2, children: [Ae2, De2, Be2] });
514
+ t2.stopPropagation(), t2.preventDefault();
515
+ }, [V2, Z2, _2, d2, j2]), Tt2 = P((t2) => {
516
+ gt2?.(t2), t2.defaultPrevented || C2 || Z2 || (G2(true), q2(), document.addEventListener("pointermove", Ct2, { passive: false }), document.addEventListener("touchmove", Ct2, { passive: false }), document.addEventListener("pointerup", Et2, { passive: false }));
517
+ }, [gt2]), Mt2 = Q(i2, () => ({ setPosition: Lt2, isSplitPane: () => true }), []), Dt2 = h(() => $2 ? B2?.({ key: "resizer", ref: w([F2, nt2]), className: m("resizer", mt2), onPointerDownCapture: Tt2, style: { cursor: C2 ? void 0 : "row" === u2 ? "ew-resize" : "ns-resize", minWidth: "row" === u2 ? "2px" : void 0, minHeight: "row" !== u2 ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...ft2 }, splitDirection: u2, disabled: C2, ...yt2 }) : null, [$2, mt2, yt2, u2, ft2, C2]), Pt2 = "row" === u2 ? "Width" : "Height", zt2 = { ...lt2, ...ct2, flex: 0 === K2.fixedPaneOffset && null !== U2?.pixels[0] ? `0 0 ${Math.round(U2?.pixels[0])}px` : `1 1 ${Math.round(U2?.percents[0] ?? 100)}%`, [`min${Pt2}`]: U2?.minBefore, [`max${Pt2}`]: l2 ? U2?.maxBefore : "100%" }, kt2 = { ...lt2, ...dt2, flex: 1 === K2.fixedPaneOffset && null !== U2?.pixels[1] ? `0 0 ${Math.round(U2?.pixels[1])}px` : `1 1 ${Math.round(U2?.percents[1] ?? 100)}%`, [`min${Pt2}`]: U2?.minAfter, [`max${Pt2}`]: s2 ? U2?.maxAfter : "100%" }, At2 = h(() => s2 ? t("div", { ref: et2, className: m("before", rt2, at2), style: zt2, ...st2, ...ht2, children: s2 }, "before") : null, [s2, z2, k2, K2, U2]), Bt2 = h(() => l2 ? t("div", { ref: ot2, className: m("after", rt2, ut2), style: kt2, ...st2, ..._t2, children: l2 }, "after") : null, [l2, z2, A2, K2, U2]);
518
+ return e("div", { ref: w([W2, Mt2]), className: m("splitPane", "row" === u2 ? "vertical" : "horizontal", { dragging: Z2 }, S2), style: pt2, children: [At2, Dt2, Bt2] });
489
519
  }));
490
- function Ee(e2) {
491
- const [t2, n2] = a("undefined" != typeof window ? window.devicePixelRatio : 1), o2 = r(null);
520
+ function Ct(t2) {
521
+ const [e2, n2] = a("undefined" != typeof window ? window.devicePixelRatio : 1), o2 = r(null);
492
522
  return c(() => {
493
523
  if (!("undefined" != typeof window && "matchMedia" in window)) return;
494
- const e3 = () => {
495
- const t3 = window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);
496
- t3.addEventListener("change", e3, { once: true, passive: true }), n2(window.devicePixelRatio), o2.current = { mediaMatcher: t3, listener: e3 };
524
+ const t3 = () => {
525
+ const e3 = window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);
526
+ e3.addEventListener("change", t3, { once: true, passive: true }), n2(window.devicePixelRatio), o2.current = { mediaMatcher: e3, listener: t3 };
497
527
  };
498
- return e3(), () => {
528
+ return t3(), () => {
499
529
  o2.current && o2.current.mediaMatcher.removeEventListener("change", o2.current.listener);
500
530
  };
501
- }, [e2]), t2;
531
+ }, [t2]), e2;
502
532
  }
503
- function Te(e2) {
533
+ function Et(t2) {
504
534
  if ("undefined" == typeof window) return 1;
505
- const { defaultDpr: t2 = 1, maxDpr: n2 = 3, round: o2 = true } = e2 || {}, i2 = "undefined" != typeof window && "number" == typeof window.devicePixelRatio ? window.devicePixelRatio : t2;
535
+ const { defaultDpr: e2 = 1, maxDpr: n2 = 3, round: o2 = true } = t2 || {}, i2 = "undefined" != typeof window && "number" == typeof window.devicePixelRatio ? window.devicePixelRatio : e2;
506
536
  return Math.min(Math.max(1, o2 ? Math.floor(i2) : i2), n2);
507
537
  }
508
- function Me(e2, t2, n2) {
509
- const o2 = P(t2, [t2]);
538
+ function Tt(t2, e2, n2) {
539
+ const o2 = P(e2, [e2]);
510
540
  c(() => {
511
- const t3 = (t4) => {
512
- e2.current && !e2.current.contains(t4.target) && o2(t4);
541
+ const e3 = (e4) => {
542
+ t2.current && !t2.current.contains(e4.target) && o2(e4);
513
543
  };
514
- return n2 && false === n2.mouseEvents || (document.addEventListener("mousedown", t3), document.addEventListener("touchstart", t3)), n2 && false === n2.focusEvents || document.addEventListener("focus", t3), () => {
515
- document.removeEventListener("mousedown", t3), document.removeEventListener("touchstart", t3), document.removeEventListener("focus", t3);
544
+ return n2 && false === n2.mouseEvents || (document.addEventListener("mousedown", e3), document.addEventListener("touchstart", e3)), n2 && false === n2.focusEvents || document.addEventListener("focus", e3), () => {
545
+ document.removeEventListener("mousedown", e3), document.removeEventListener("touchstart", e3), document.removeEventListener("focus", e3);
516
546
  };
517
- }, [e2]);
547
+ }, [t2]);
518
548
  }
519
- function De(e2) {
520
- if (!e2) throw new Error("must have a PointerHandlerOptions");
521
- const { onPointerDown: t2, onPointerUp: n2, onPointerMoveOrWait: o2, processTouch: s2 = false, consumeTouch: l2 = true } = e2, a2 = P(t2, [t2]), h2 = P(n2, [n2]), u2 = P(o2, [o2]), d2 = r(false), _2 = e2?.timerInitial ?? 230, p2 = e2?.timerContinuous ?? _2 / 2, m2 = r(null), f2 = r(null), g2 = r(null), y2 = r(null), v2 = i(() => {
549
+ function Mt(t2) {
550
+ if (!t2) throw new Error("must have a PointerHandlerOptions");
551
+ const { onPointerDown: e2, onPointerUp: n2, onPointerMoveOrWait: o2, processTouch: s2 = false, consumeTouch: l2 = true } = t2, a2 = P(e2, [e2]), h2 = P(n2, [n2]), u2 = P(o2, [o2]), d2 = r(false), _2 = t2?.timerInitial ?? 230, p2 = t2?.timerContinuous ?? _2 / 2, m2 = r(null), f2 = r(null), g2 = r(null), y2 = r(null), v2 = i(() => {
522
552
  y2.current && (clearTimeout(y2.current), y2.current = null);
523
- }, []), x2 = i((e3) => {
553
+ }, []), x2 = i((t3) => {
524
554
  y2.current = setTimeout(() => {
525
555
  window.requestAnimationFrame(() => {
526
556
  false !== d2.current && u2?.(f2.current, g2.current, m2.current);
527
557
  }), x2(p2);
528
- }, e3 ?? _2);
558
+ }, t3 ?? _2);
529
559
  }, []);
530
560
  c(() => () => v2(), []);
531
- const b2 = s2 ? "pointer" : "mouse", w2 = i((e3) => {
532
- e3.stopPropagation(), e3.stopImmediatePropagation(), e3.preventDefault();
533
- }, []), S2 = P((e3) => {
561
+ const b2 = s2 ? "pointer" : "mouse", w2 = i((t3) => {
562
+ t3.stopPropagation(), t3.stopImmediatePropagation(), t3.preventDefault();
563
+ }, []), S2 = P((t3) => {
534
564
  document.removeEventListener(`${b2}move`, E2), document.removeEventListener(`${b2}up`, S2), document.removeEventListener("keydown", T2), document.removeEventListener("keyup", M2), document.removeEventListener("touchstart", w2, { capture: true }), document.removeEventListener("touchmove", w2, { capture: true }), window.removeEventListener("blur", L2), v2(), window.requestAnimationFrame(() => {
535
- false !== d2.current && (d2.current = false, h2?.(e3, g2.current, m2.current), g2.current = null);
565
+ false !== d2.current && (d2.current = false, h2?.(t3, g2.current, m2.current), g2.current = null);
536
566
  });
537
567
  }, []), L2 = i(() => {
538
568
  false !== d2.current && (d2.current = false, S2(f2.current));
@@ -540,118 +570,118 @@ function De(e2) {
540
570
  v2(), x2(p2), window.requestAnimationFrame(() => {
541
571
  false !== d2.current && u2?.(f2.current, g2.current, m2.current);
542
572
  });
543
- }, [p2]), E2 = P((e3) => {
544
- f2.current = e3, C2();
545
- }, []), T2 = P((e3) => {
546
- g2.current = { ctrlKey: e3.ctrlKey, shiftKey: e3.shiftKey, altKey: e3.altKey, metaKey: e3.metaKey }, C2();
547
- }, []), M2 = P((e3) => {
548
- g2.current = { ctrlKey: e3.ctrlKey, shiftKey: e3.shiftKey, altKey: e3.altKey, metaKey: e3.metaKey }, C2();
573
+ }, [p2]), E2 = P((t3) => {
574
+ f2.current = t3, C2();
575
+ }, []), T2 = P((t3) => {
576
+ g2.current = { ctrlKey: t3.ctrlKey, shiftKey: t3.shiftKey, altKey: t3.altKey, metaKey: t3.metaKey }, C2();
577
+ }, []), M2 = P((t3) => {
578
+ g2.current = { ctrlKey: t3.ctrlKey, shiftKey: t3.shiftKey, altKey: t3.altKey, metaKey: t3.metaKey }, C2();
549
579
  }, [p2]);
550
- return P((e3) => {
551
- if (e3.isDefaultPrevented()) return;
552
- g2.current = { ctrlKey: e3.ctrlKey, shiftKey: e3.shiftKey, altKey: e3.altKey, metaKey: e3.metaKey };
553
- false !== a2(e3, g2.current) && (m2.current = e3, f2.current = e3.nativeEvent, document.addEventListener(`${b2}up`, S2, { passive: false }), document.addEventListener(`${b2}move`, E2, { passive: false }), document.addEventListener("keydown", T2, { passive: false }), document.addEventListener("keyup", M2, { passive: false }), window.addEventListener("blur", L2, { passive: true }), s2 && l2 && (document.addEventListener("touchstart", w2, { passive: false, capture: true }), document.addEventListener("touchmove", w2, { passive: false, capture: true })), d2.current = true, x2(_2));
580
+ return P((t3) => {
581
+ if (t3.isDefaultPrevented()) return;
582
+ g2.current = { ctrlKey: t3.ctrlKey, shiftKey: t3.shiftKey, altKey: t3.altKey, metaKey: t3.metaKey };
583
+ false !== a2(t3, g2.current) && (m2.current = t3, f2.current = t3.nativeEvent, document.addEventListener(`${b2}up`, S2, { passive: false }), document.addEventListener(`${b2}move`, E2, { passive: false }), document.addEventListener("keydown", T2, { passive: false }), document.addEventListener("keyup", M2, { passive: false }), window.addEventListener("blur", L2, { passive: true }), s2 && l2 && (document.addEventListener("touchstart", w2, { passive: false, capture: true }), document.addEventListener("touchmove", w2, { passive: false, capture: true })), d2.current = true, x2(_2));
554
584
  }, [_2, s2]);
555
585
  }
556
- function Pe(e2, t2) {
557
- return De({ onPointerDown: e2, onPointerMoveOrWait: (t3, n2, o2) => {
558
- e2?.(o2);
559
- }, ...t2 });
586
+ function Dt(t2, e2) {
587
+ return Mt({ onPointerDown: t2, onPointerMoveOrWait: (e3, n2, o2) => {
588
+ t2?.(o2);
589
+ }, ...e2 });
560
590
  }
561
- const ze = ({ initValue: e2, useHookBody: t2, applyStateChange: n2 }) => {
562
- const o2 = r(e2);
563
- if ("function" != typeof t2) throw new Error("function expected as hook body parameter. got " + typeof t2);
564
- const i2 = t2();
591
+ const Pt = ({ initValue: t2, useHookBody: e2, applyStateChange: n2 }) => {
592
+ const o2 = r(t2);
593
+ if ("function" != typeof e2) throw new Error("function expected as hook body parameter. got " + typeof e2);
594
+ const i2 = e2();
565
595
  return d(() => {
566
596
  o2.current !== i2 && (o2.current = i2, n2(i2));
567
597
  }, [n2, i2]), null;
568
- }, ke = (e2) => {
569
- console && console.warn && console.warn(e2);
570
- }, Ae = "object" == typeof self && self.self === self && self || "object" == typeof global && global.global === global && global || void 0;
571
- let Be = 1, $e = false, Ke = false;
572
- const Oe = [], Ve = [], He = () => {
573
- Ve.forEach((e2) => e2());
574
- }, We = ({ automaticContainerInternalUseOnly: t2 }) => {
598
+ }, zt = (t2) => {
599
+ console && console.warn && console.warn(t2);
600
+ }, kt = "object" == typeof self && self.self === self && self || "object" == typeof global && global.global === global && global || void 0;
601
+ let At = 1, Bt = false, $t = false;
602
+ const Kt = [], Ot = [], Vt = () => {
603
+ Ot.forEach((t2) => t2());
604
+ }, Ht = ({ automaticContainerInternalUseOnly: e2 }) => {
575
605
  const [o2, i2] = a([]), s2 = r([]);
576
- return s2.current = o2, t2 || false !== $e || (Ke = true), c(() => {
577
- let e2 = true;
606
+ return s2.current = o2, e2 || false !== Bt || ($t = true), c(() => {
607
+ let t2 = true;
578
608
  function n2() {
579
- if (e2) return Ve[0] !== n2 ? (t2 || true !== $e || ke("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void i2((e3) => [])) : void i2([...Oe]);
609
+ if (t2) return Ot[0] !== n2 ? (e2 || true !== Bt || zt("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void i2((t3) => [])) : void i2([...Kt]);
580
610
  }
581
- return Ve.push(n2), He(), () => {
582
- e2 = false, s2.current?.length > 0 && ke("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), Ve.splice(Ve.indexOf(n2), 1), He();
611
+ return Ot.push(n2), Vt(), () => {
612
+ t2 = false, s2.current?.length > 0 && zt("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), Ot.splice(Ot.indexOf(n2), 1), Vt();
583
613
  };
584
- }, [t2]), e(n, { children: o2.map(({ hook: e2, key: t3 }) => _(ze, { ...e2, key: t3 })) });
585
- }, Ne = (t2) => {
586
- const n2 = Be++;
587
- return Oe.push({ hook: t2, key: n2 }), 0 === Ve.length && false === Ke && ($e = true, ((t3) => {
588
- if (Ae.document && Ae.document.createElement) {
589
- const n3 = Ae.document.createElement("div");
590
- S(n3).render(e(t3, { automaticContainerInternalUseOnly: true }));
591
- } else ke("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
592
- })(We)), He(), () => {
593
- Oe.splice(Oe.findIndex((e2) => e2.key === n2), 1), He();
614
+ }, [e2]), t(n, { children: o2.map(({ hook: t2, key: e3 }) => _(Pt, { ...t2, key: e3 })) });
615
+ }, Wt = (e2) => {
616
+ const n2 = At++;
617
+ return Kt.push({ hook: e2, key: n2 }), 0 === Ot.length && false === $t && (Bt = true, ((e3) => {
618
+ if (kt.document && kt.document.createElement) {
619
+ const n3 = kt.document.createElement("div");
620
+ S(n3).render(t(e3, { automaticContainerInternalUseOnly: true }));
621
+ } else zt("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
622
+ })(Ht)), Vt(), () => {
623
+ Kt.splice(Kt.findIndex((t2) => t2.key === n2), 1), Vt();
594
624
  };
595
- }, Re = (e2, t2, n2 = {}) => {
625
+ }, Nt = (t2, e2, n2 = {}) => {
596
626
  let o2, i2, r2 = false, s2 = false, l2 = [], { unmountIfNoConsumers: h2 = false } = n2;
597
- const u2 = (e3) => {
598
- i2 = e3, L(() => l2.forEach((t3) => t3(e3)));
599
- }, d2 = () => (s2 || (i2 = "function" == typeof e2 ? e2() : e2, s2 = true), i2);
627
+ const u2 = (t3) => {
628
+ i2 = t3, L(() => l2.forEach((e3) => e3(t3)));
629
+ }, d2 = () => (s2 || (i2 = "function" == typeof t2 ? t2() : t2, s2 = true), i2);
600
630
  return () => {
601
631
  const [n3, s3] = a(d2);
602
- return c(() => (r2 || (r2 = true, o2 = Ne({ initValue: e2, useHookBody: t2, applyStateChange: u2 })), l2.push(s3), i2 !== n3 && s3(i2), () => {
632
+ return c(() => (r2 || (r2 = true, o2 = Wt({ initValue: t2, useHookBody: e2, applyStateChange: u2 })), l2.push(s3), i2 !== n3 && s3(i2), () => {
603
633
  l2.splice(l2.indexOf(s3), 1), 0 === l2.length && h2 && (o2(), r2 = false);
604
634
  }), []), n3;
605
635
  };
606
636
  };
607
- let Fe = () => {
637
+ let Rt = () => {
608
638
  console.warn("You must call useEditMode before setting its state.");
609
639
  };
610
- const Ie = Re(null, () => {
611
- const [e2, t2] = a(null);
612
- return Fe = t2, e2;
613
- }), Ye = () => {
614
- const e2 = Ie();
615
- return h(() => ({ setMode: (e3) => {
616
- Fe((t2) => ("function" == typeof e3 && (e3 = e3(t2)), e3?.onModeChange?.(e3 ?? null), e3));
617
- }, getMode: () => e2 }), [e2]);
640
+ const Ft = Nt(null, () => {
641
+ const [t2, e2] = a(null);
642
+ return Rt = e2, t2;
643
+ }), It = () => {
644
+ const t2 = Ft();
645
+ return h(() => ({ setMode: (t3) => {
646
+ Rt((e2) => ("function" == typeof t3 && (t3 = t3(e2)), t3?.onModeChange?.(t3 ?? null), t3));
647
+ }, getMode: () => t2 }), [t2]);
618
648
  };
619
- class Xe {
620
- constructor(e2, t2, n2, o2) {
621
- this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key = e2, this._target = t2, this._applyProps(n2 || {}), this._callback = o2, void 0 === o2 && (this._callback = () => {
649
+ class Yt {
650
+ constructor(t2, e2, n2, o2) {
651
+ this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key = t2, this._target = e2, this._applyProps(n2 || {}), this._callback = o2, void 0 === o2 && (this._callback = () => {
622
652
  console.log(`implement: ${this.label()} : ${this.description()}`);
623
653
  });
624
654
  }
625
655
  key() {
626
656
  return this._key;
627
657
  }
628
- _resolve(e2, t2) {
629
- if ("function" == typeof e2) {
630
- const n2 = t2 ?? this._context;
631
- return e2("function" == typeof n2 ? n2() : n2);
658
+ _resolve(t2, e2) {
659
+ if ("function" == typeof t2) {
660
+ const n2 = e2 ?? this._context;
661
+ return t2("function" == typeof n2 ? n2() : n2);
632
662
  }
633
- return e2;
663
+ return t2;
634
664
  }
635
665
  target() {
636
666
  return "function" == typeof this._target ? this._target() : this._target;
637
667
  }
638
- label(e2, t2) {
639
- const n2 = this._scopedLabels?.[e2] || this._label;
668
+ label(t2, e2) {
669
+ const n2 = this._scopedLabels?.[t2] || this._label;
640
670
  let o2 = null;
641
671
  if ("function" == typeof n2) {
642
- const e3 = t2 ?? this._context;
643
- o2 = n2("function" == typeof e3 ? e3() : e3);
672
+ const t3 = e2 ?? this._context;
673
+ o2 = n2("function" == typeof t3 ? t3() : t3);
644
674
  } else o2 = n2;
645
675
  return o2;
646
676
  }
647
- description(e2) {
648
- return this._resolve(this._description, e2);
677
+ description(t2) {
678
+ return this._resolve(this._description, t2);
649
679
  }
650
- tags(e2) {
651
- return this._resolve(this._tags, e2);
680
+ tags(t2) {
681
+ return this._resolve(this._tags, t2);
652
682
  }
653
- icon(e2) {
654
- return this._resolve(this._icon, e2);
683
+ icon(t2) {
684
+ return this._resolve(this._icon, t2);
655
685
  }
656
686
  shortcut() {
657
687
  return this._resolve(this._shortcut);
@@ -665,120 +695,120 @@ class Xe {
665
695
  context() {
666
696
  return "function" == typeof this._context ? this._context() : this._context;
667
697
  }
668
- async execute(e2, t2) {
698
+ async execute(t2, e2) {
669
699
  if (!this.disabled() && this._callback) {
670
700
  try {
671
701
  let n2 = true;
672
- t2?.beforeExecute && (n2 = t2?.beforeExecute(this, e2));
702
+ e2?.beforeExecute && (n2 = e2?.beforeExecute(this, t2));
673
703
  if (false === await Promise.resolve(n2)) return false;
674
- const o2 = this._callback.bind(this)(e2, this);
704
+ const o2 = this._callback.bind(this)(t2, this);
675
705
  if (false === await Promise.resolve(o2)) return false;
676
- t2?.onExecute?.(this, e2), this._notifyExecute(e2);
706
+ e2?.onExecute?.(this, t2), this._notifyExecute(t2);
677
707
  } catch (n2) {
678
- return console.warn(n2), t2?.onError(this, n2, e2), this._notifyError(e2, n2), false;
708
+ return console.warn(n2), e2?.onError(this, n2, t2), this._notifyError(t2, n2), false;
679
709
  }
680
710
  return true;
681
711
  }
682
712
  }
683
- addPropertyListener(e2, t2 = false) {
684
- if (!e2) throw new Error("listener must be specified");
713
+ addPropertyListener(t2, e2 = false) {
714
+ if (!t2) throw new Error("listener must be specified");
685
715
  const n2 = this._listenersProperties;
686
- return n2.add(e2), t2 && e2({}, this), () => {
687
- n2.delete(e2);
716
+ return n2.add(t2), e2 && t2({}, this), () => {
717
+ n2.delete(t2);
688
718
  };
689
719
  }
690
- addExecuteListener(e2) {
691
- if (!e2) throw new Error("listener must be specified");
692
- const t2 = this._listenersExecute;
693
- return t2.add(e2), function() {
694
- t2.delete(e2);
720
+ addExecuteListener(t2) {
721
+ if (!t2) throw new Error("listener must be specified");
722
+ const e2 = this._listenersExecute;
723
+ return e2.add(t2), function() {
724
+ e2.delete(t2);
695
725
  };
696
726
  }
697
- _notifyExecute(e2) {
698
- const t2 = this;
727
+ _notifyExecute(t2) {
728
+ const e2 = this;
699
729
  this._listenersExecute.forEach((n2) => {
700
- n2.onExecute(t2, e2);
730
+ n2.onExecute(e2, t2);
701
731
  });
702
732
  }
703
- _notifyError(e2, t2) {
733
+ _notifyError(t2, e2) {
704
734
  const n2 = this;
705
735
  this._listenersExecute.forEach((o2) => {
706
- o2.onError?.(n2, e2, t2);
736
+ o2.onError?.(n2, t2, e2);
707
737
  });
708
738
  }
709
- updateCallback(e2) {
710
- return this._callback = e2 || null, this;
739
+ updateCallback(t2) {
740
+ return this._callback = t2 || null, this;
711
741
  }
712
- update(e2) {
713
- if (!e2) return;
714
- const t2 = this._applyProps(e2);
715
- return Object.keys(t2).length > 0 && this._notifyPropertyChange(t2), this;
742
+ update(t2) {
743
+ if (!t2) return;
744
+ const e2 = this._applyProps(t2);
745
+ return Object.keys(e2).length > 0 && this._notifyPropertyChange(e2), this;
716
746
  }
717
- _notifyPropertyChange(e2) {
718
- const t2 = this;
747
+ _notifyPropertyChange(t2) {
748
+ const e2 = this;
719
749
  this._listenersProperties.forEach((n2) => {
720
- n2(e2, t2);
750
+ n2(t2, e2);
721
751
  });
722
752
  }
723
- _applyProps(e2) {
724
- let t2 = {}, n2 = this;
725
- return Object.keys(e2).forEach((o2) => {
726
- let i2 = e2[o2];
727
- n2["_" + o2] !== i2 && (n2["_" + o2] = t2[o2] = i2);
728
- }), t2;
753
+ _applyProps(t2) {
754
+ let e2 = {}, n2 = this;
755
+ return Object.keys(t2).forEach((o2) => {
756
+ let i2 = t2[o2];
757
+ n2["_" + o2] !== i2 && (n2["_" + o2] = e2[o2] = i2);
758
+ }), e2;
729
759
  }
730
760
  }
731
- class je extends Xe {
761
+ class Xt extends Yt {
732
762
  }
733
- class Ue {
734
- constructor(e2, t2) {
735
- this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid = g.uuidV4(), this._target = e2, this._groupKey = t2 ?? null, this._root = this, this._nodes = /* @__PURE__ */ new Map(), this._nodes.set(t2, this), this._children = /* @__PURE__ */ new Map(), this._listeners = /* @__PURE__ */ new Set(), this._commandsByKey = /* @__PURE__ */ new Map(), this._commandsByShortcut = /* @__PURE__ */ new Map();
763
+ class jt {
764
+ constructor(t2, e2) {
765
+ this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid = g.uuidV4(), this._target = t2, this._groupKey = e2 ?? null, this._root = this, this._nodes = /* @__PURE__ */ new Map(), this._nodes.set(e2, this), this._children = /* @__PURE__ */ new Map(), this._listeners = /* @__PURE__ */ new Set(), this._commandsByKey = /* @__PURE__ */ new Map(), this._commandsByShortcut = /* @__PURE__ */ new Map();
736
766
  const n2 = this;
737
- this._unListenersByCommand = /* @__PURE__ */ new Map(), this._listenersByKey = /* @__PURE__ */ new Map(), this._commandsPropertyListener = (e3, t3) => {
738
- const o2 = n2._root._listenersByKey, i2 = t3.key(), r2 = o2.get(i2);
739
- r2 && n2._notifyCommands(r2, "onCommandChange", t3);
767
+ this._unListenersByCommand = /* @__PURE__ */ new Map(), this._listenersByKey = /* @__PURE__ */ new Map(), this._commandsPropertyListener = (t3, e3) => {
768
+ const o2 = n2._root._listenersByKey, i2 = e3.key(), r2 = o2.get(i2);
769
+ r2 && n2._notifyCommands(r2, "onCommandChange", e3);
740
770
  };
741
771
  }
742
- _getCommand(e2) {
743
- const t2 = this._commandsByKey.get(e2);
744
- return t2 || (this._parent?._getCommand(e2) ?? null);
772
+ _getCommand(t2) {
773
+ const e2 = this._commandsByKey.get(t2);
774
+ return e2 || (this._parent?._getCommand(t2) ?? null);
745
775
  }
746
- getCommand(e2, t2 = false) {
776
+ getCommand(t2, e2 = false) {
747
777
  const n2 = this._root._focused;
748
778
  let o2 = n2, i2 = n2 === this;
749
779
  for (; !i2 && o2; ) o2 === this && (i2 = true), o2 = o2._parent;
750
- return (i2 ? n2 : this)._getCommand(e2);
780
+ return (i2 ? n2 : this)._getCommand(t2);
751
781
  }
752
- createChildGroup(e2, t2, n2) {
782
+ createChildGroup(t2, e2, n2) {
753
783
  let o2;
754
784
  if (!n2) {
755
- let e3 = this;
756
- for (; e3 && !o2; ) {
757
- let n3 = e3._nodes.get(t2);
758
- n3 && (o2 = n3), e3 = e3._parent;
785
+ let t3 = this;
786
+ for (; t3 && !o2; ) {
787
+ let n3 = t3._nodes.get(e2);
788
+ n3 && (o2 = n3), t3 = t3._parent;
759
789
  }
760
790
  }
761
- o2 || (o2 = new Ue(e2, t2), o2._parent = this, o2._root = this._root, o2._unListenersByCommand = null, o2._listenersByKey = null, o2._commandsPropertyListener = null);
762
- const i2 = (e3, o3) => {
763
- !e3.has(t2) || n2 ? e3.set(t2, o3) : void 0 === n2 && console.warn("commandGroup already registered", t2);
791
+ o2 || (o2 = new jt(t2, e2), o2._parent = this, o2._root = this._root, o2._unListenersByCommand = null, o2._listenersByKey = null, o2._commandsPropertyListener = null);
792
+ const i2 = (t3, o3) => {
793
+ !t3.has(e2) || n2 ? t3.set(e2, o3) : void 0 === n2 && console.warn("commandGroup already registered", e2);
764
794
  };
765
795
  i2(this._root._nodes, o2);
766
796
  let r2 = this._parent;
767
797
  for (; r2; ) i2(this._nodes, o2), r2 = r2._parent;
768
- return this._children.set(t2, o2), this._notify("onGroupChange"), o2;
798
+ return this._children.set(e2, o2), this._notify("onGroupChange"), o2;
769
799
  }
770
800
  getKey() {
771
801
  return this._groupKey;
772
802
  }
773
- getGroup(e2) {
774
- return this._nodes.get(e2);
803
+ getGroup(t2) {
804
+ return this._nodes.get(t2);
775
805
  }
776
- _addCommands(e2, t2 = void 0) {
806
+ _addCommands(t2, e2 = void 0) {
777
807
  const n2 = this._commandsByKey, o2 = this._commandsByShortcut, i2 = this._root._commandsPropertyListener, r2 = this._root._unListenersByCommand;
778
- for (let s2 = 0; s2 < e2.length; s2++) {
779
- const l2 = e2[s2], a2 = l2.key();
780
- if (n2.has(a2) && !t2) {
781
- void 0 === t2 && console.warn("command already registered", a2);
808
+ for (let s2 = 0; s2 < t2.length; s2++) {
809
+ const l2 = t2[s2], a2 = l2.key();
810
+ if (n2.has(a2) && !e2) {
811
+ void 0 === e2 && console.warn("command already registered", a2);
782
812
  continue;
783
813
  }
784
814
  n2.set(a2, l2);
@@ -789,55 +819,55 @@ class Ue {
789
819
  const u2 = l2.shortcut();
790
820
  if (!u2) continue;
791
821
  const d2 = Array.isArray(u2) ? u2 : [u2];
792
- for (let e3 = 0; e3 < d2.length; e3++) {
793
- const n3 = qe(d2[e3]), i3 = o2.get(n3);
794
- i3 && !t2 && void 0 === t2 && console.warn(`Shortcut already registered: ${n3}, ${a2}, ${i3}.`), o2.set(n3, a2);
822
+ for (let t3 = 0; t3 < d2.length; t3++) {
823
+ const n3 = Gt(d2[t3]), i3 = o2.get(n3);
824
+ i3 && !e2 && void 0 === e2 && console.warn(`Shortcut already registered: ${n3}, ${a2}, ${i3}.`), o2.set(n3, a2);
795
825
  }
796
826
  }
797
827
  }
798
828
  removeFromParent() {
799
829
  if (!this._parent) return;
800
- let e2 = this._parent, t2 = [];
830
+ let t2 = this._parent, e2 = [];
801
831
  const n2 = this._groupKey;
802
- for (; e2; ) t2.push(e2._nodes), e2._nodes.delete(n2), e2 = e2._parent;
803
- e2 = this._parent;
804
- const o2 = (e3) => {
805
- e3._children.forEach((e4) => {
806
- for (let n3 = 0; n3 < t2.length; n3++) e4._nodes.delete(t2[n3]);
807
- o2(e4);
832
+ for (; t2; ) e2.push(t2._nodes), t2._nodes.delete(n2), t2 = t2._parent;
833
+ t2 = this._parent;
834
+ const o2 = (t3) => {
835
+ t3._children.forEach((t4) => {
836
+ for (let n3 = 0; n3 < e2.length; n3++) t4._nodes.delete(e2[n3]);
837
+ o2(t4);
808
838
  });
809
839
  };
810
840
  o2(this), this._parent = null, this._notify("onGroupChange");
811
841
  }
812
- addCommands(e2, t2) {
813
- this._addCommands(e2, t2), this._notify("onGroupChange");
842
+ addCommands(t2, e2) {
843
+ this._addCommands(t2, e2), this._notify("onGroupChange");
814
844
  }
815
845
  getActive() {
816
846
  return this._root._focused ?? this._root;
817
847
  }
818
- activate(e2) {
819
- let t2 = this;
820
- if (e2 && (t2 = this._nodes.get(e2), !t2)) return void console.warn("group not found", e2);
848
+ activate(t2) {
849
+ let e2 = this;
850
+ if (t2 && (e2 = this._nodes.get(t2), !e2)) return void console.warn("group not found", t2);
821
851
  let n2 = this._root._focused ?? this._root;
822
852
  for (; n2; ) n2 = n2._parent;
823
- this._root._focused !== t2 && (this._root._focused = t2, this._notify("onGroupChange"), this._notify("onActiveChange"));
853
+ this._root._focused !== e2 && (this._root._focused = e2, this._notify("onGroupChange"), this._notify("onActiveChange"));
824
854
  }
825
- findCommandByEvent(e2) {
826
- const t2 = [];
827
- e2.altKey && t2.push(E.Alt), e2.shiftKey && t2.push(E.Shift), e2.ctrlKey && t2.push(E.Ctrl), e2.metaKey && t2.push(E.Meta);
828
- let n2 = qe({ key: e2.code, modifiers: t2 });
855
+ findCommandByEvent(t2) {
856
+ const e2 = [];
857
+ t2.altKey && e2.push(E.Alt), t2.shiftKey && e2.push(E.Shift), t2.ctrlKey && e2.push(E.Ctrl), t2.metaKey && e2.push(E.Meta);
858
+ let n2 = Gt({ key: t2.code, modifiers: e2 });
829
859
  const o2 = this._commandsByShortcut;
830
860
  let i2 = o2.get(n2);
831
- i2 || (n2 = qe({ key: e2.key, modifiers: t2 }), i2 = o2.get(n2)), !i2 && e2.code.startsWith("Digit") && (n2 = qe({ key: e2.code.substring(5, e2.code.length), modifiers: t2 }), i2 = this._commandsByShortcut.get(n2)), !i2 && e2.code.startsWith("Key") && (i2 = qe({ key: e2.code.substring(3, e2.code.length), modifiers: t2 }), i2 = o2.get(n2));
861
+ i2 || (n2 = Gt({ key: t2.key, modifiers: e2 }), i2 = o2.get(n2)), !i2 && t2.code.startsWith("Digit") && (n2 = Gt({ key: t2.code.substring(5, t2.code.length), modifiers: e2 }), i2 = this._commandsByShortcut.get(n2)), !i2 && t2.code.startsWith("Key") && (i2 = Gt({ key: t2.code.substring(3, t2.code.length), modifiers: e2 }), i2 = o2.get(n2));
832
862
  let r2 = null;
833
- return i2 && (r2 = this._commandsByKey.get(i2), r2 && r2.disabled() && (r2 = null), !r2 || r2.target() && r2.target().contains(e2.target) || (r2 = null)), r2 || (this._parent?.findCommandByEvent(e2) ?? null);
863
+ return i2 && (r2 = this._commandsByKey.get(i2), r2 && r2.disabled() && (r2 = null), !r2 || r2.target() && r2.target().contains(t2.target) || (r2 = null)), r2 || (this._parent?.findCommandByEvent(t2) ?? null);
834
864
  }
835
- dispatchToFocusedCommand(e2) {
836
- const t2 = this.getActive();
837
- if (!t2) return false;
838
- if (e2.isDefaultPrevented()) return false;
839
- const n2 = t2.findCommandByEvent?.(e2);
840
- return !!n2 && (n2.execute(), e2.preventDefault(), true);
865
+ dispatchToFocusedCommand(t2) {
866
+ const e2 = this.getActive();
867
+ if (!e2) return false;
868
+ if (t2.isDefaultPrevented()) return false;
869
+ const n2 = e2.findCommandByEvent?.(t2);
870
+ return !!n2 && (n2.execute(), t2.preventDefault(), true);
841
871
  }
842
872
  getRoot() {
843
873
  return this._parent ? this._parent.getRoot() : this;
@@ -845,299 +875,299 @@ class Ue {
845
875
  getParent() {
846
876
  return this._parent;
847
877
  }
848
- addListener(e2, t2) {
849
- const n2 = this._listeners, o2 = t2?.keys, i2 = this._root._listenersByKey;
850
- if (o2 && !e2.onCommandChange) throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");
878
+ addListener(t2, e2) {
879
+ const n2 = this._listeners, o2 = e2?.keys, i2 = this._root._listenersByKey;
880
+ if (o2 && !t2.onCommandChange) throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");
851
881
  let r2 = null;
852
- if (o2) for (let t3 = 0; t3 < o2.length; t3++) {
853
- const n3 = o2[t3];
882
+ if (o2) for (let e3 = 0; e3 < o2.length; e3++) {
883
+ const n3 = o2[e3];
854
884
  if (!n3) continue;
855
885
  let s2 = i2.get(n3);
856
- s2 || (s2 = /* @__PURE__ */ new Set(), i2.set(n3, s2)), r2 || (r2 = []), r2.push(s2), s2.add(e2);
886
+ s2 || (s2 = /* @__PURE__ */ new Set(), i2.set(n3, s2)), r2 || (r2 = []), r2.push(s2), s2.add(t2);
857
887
  }
858
- return n2.add(e2), () => {
859
- if (r2) for (let t3 = 0; t3 < r2.length; t3++) {
860
- r2[t3].delete(e2);
888
+ return n2.add(t2), () => {
889
+ if (r2) for (let e3 = 0; e3 < r2.length; e3++) {
890
+ r2[e3].delete(t2);
861
891
  }
862
- n2.delete(e2);
892
+ n2.delete(t2);
863
893
  };
864
894
  }
865
- _notifyCommands(e2, t2, n2) {
895
+ _notifyCommands(t2, e2, n2) {
866
896
  const o2 = this;
867
897
  setTimeout(() => {
868
- e2.forEach((e3) => {
869
- e3[t2]?.(o2, n2);
898
+ t2.forEach((t3) => {
899
+ t3[e2]?.(o2, n2);
870
900
  });
871
901
  }, 0);
872
902
  }
873
- _notify(e2, t2) {
903
+ _notify(t2, e2) {
874
904
  const n2 = this;
875
905
  setTimeout(() => {
876
906
  n2._listeners.forEach((o2) => {
877
- o2[e2]?.(n2, t2);
878
- }), n2._parent && n2._parent._notify(e2, t2);
907
+ o2[t2]?.(n2, e2);
908
+ }), n2._parent && n2._parent._notify(t2, e2);
879
909
  }, 0);
880
910
  }
881
911
  getAllCommands() {
882
- const e2 = [], t2 = this._groupKey;
912
+ const t2 = [], e2 = this._groupKey;
883
913
  return this._commandsByKey.forEach((n2) => {
884
- e2.push({ command: n2, groupKey: t2 });
885
- }), this._children.forEach((t3) => {
886
- e2.push(...t3.getAllCommands());
887
- }), e2;
914
+ t2.push({ command: n2, groupKey: e2 });
915
+ }), this._children.forEach((e3) => {
916
+ t2.push(...e3.getAllCommands());
917
+ }), t2;
888
918
  }
889
919
  }
890
- const Ze = g.getOS() === g.OSType.MacOS || g.getOS() === g.OSType.IOS ? "Cmd" : "Ctrl", Ge = g.getOS() === g.OSType.MacOS || g.getOS() === g.OSType.IOS ? "⌘" : "^", qe = (e2, t2 = false) => {
920
+ const Ut = g.getOS() === g.OSType.MacOS || g.getOS() === g.OSType.IOS ? "Cmd" : "Ctrl", Zt = g.getOS() === g.OSType.MacOS || g.getOS() === g.OSType.IOS ? "⌘" : "^", Gt = (t2, e2 = false) => {
891
921
  const n2 = {};
892
- for (let t3 = 0; e2.modifiers && t3 < e2.modifiers.length; t3++) n2[e2.modifiers[t3]] = true;
922
+ for (let e3 = 0; t2.modifiers && e3 < t2.modifiers.length; e3++) n2[t2.modifiers[e3]] = true;
893
923
  let o2 = "";
894
- return (n2?.[E.Ctrl] || n2?.[E.Meta]) && (o2 += (o2.length > 0 ? "+" : "") + (t2 ? Ge : Ze)), n2?.[E.Alt] && (o2 += t2 ? "⌥" : "Alt"), n2?.[E.Shift] && (o2 += (o2.length > 0 ? "+" : "") + (t2 ? "⇧" : "Shift")), o2 += (o2.length > 0 ? "+" : "") + q(e2.key), o2;
924
+ return (n2?.[E.Ctrl] || n2?.[E.Meta]) && (o2 += (o2.length > 0 ? "+" : "") + (e2 ? Zt : Ut)), n2?.[E.Alt] && (o2 += e2 ? "⌥" : "Alt"), n2?.[E.Shift] && (o2 += (o2.length > 0 ? "+" : "") + (e2 ? "⇧" : "Shift")), o2 += (o2.length > 0 ? "+" : "") + G(t2.key), o2;
895
925
  };
896
- function Je(e2, t2 = null) {
897
- const n2 = r(t2);
898
- n2.current = t2;
899
- const [o2, i2] = p((e3) => e3 + 1, 0), s2 = h(() => Array.isArray(e2) ? e2 : [e2], [e2]);
926
+ function qt(t2, e2 = null) {
927
+ const n2 = r(e2);
928
+ n2.current = e2;
929
+ const [o2, i2] = p((t3) => t3 + 1, 0), s2 = h(() => Array.isArray(t2) ? t2 : [t2], [t2]);
900
930
  return c(() => {
901
931
  if (!s2 || 0 === s2.length) return;
902
- const e3 = (e4, t3) => {
903
- n2.current?.onChange?.(t3), i2();
932
+ const t3 = (t4, e3) => {
933
+ n2.current?.onChange?.(e3), i2();
904
934
  };
905
935
  let o3 = null;
906
- t2 && (o3 = { onExecute(e4, t3) {
907
- n2.current?.onExecute?.(e4, t3);
908
- }, onError(e4, t3, o4) {
909
- n2.current?.onError?.(e4, t3, o4);
936
+ e2 && (o3 = { onExecute(t4, e3) {
937
+ n2.current?.onExecute?.(t4, e3);
938
+ }, onError(t4, e3, o4) {
939
+ n2.current?.onError?.(t4, e3, o4);
910
940
  } });
911
941
  const r2 = /* @__PURE__ */ new Set();
912
- for (let n3 = 0; n3 < s2.length; n3++) r2.add(s2[n3]?.addPropertyListener(g.debounce(e3, 0), true)), t2 && r2.add(s2[n3]?.addExecuteListener(o3));
942
+ for (let n3 = 0; n3 < s2.length; n3++) r2.add(s2[n3]?.addPropertyListener(g.debounce(t3, 0), true)), e2 && r2.add(s2[n3]?.addExecuteListener(o3));
913
943
  return () => {
914
- r2.forEach((e4) => {
915
- e4?.();
944
+ r2.forEach((t4) => {
945
+ t4?.();
916
946
  });
917
947
  };
918
- }, [e2]), o2;
948
+ }, [t2]), o2;
919
949
  }
920
- const Qe = (e2, t2) => {
950
+ const Jt = (t2, e2) => {
921
951
  const n2 = [];
922
- if (t2) for (let o2 = 0; o2 < t2.length; o2++) {
923
- const i2 = t2[o2], r2 = i2 ? e2?.getCommand(i2) : null;
952
+ if (e2) for (let o2 = 0; o2 < e2.length; o2++) {
953
+ const i2 = e2[o2], r2 = i2 ? t2?.getCommand(i2) : null;
924
954
  n2.push(r2);
925
955
  }
926
956
  return n2;
927
957
  };
928
- function et(e2, t2 = null, n2 = null, o2) {
958
+ function Qt(t2, e2 = null, n2 = null, o2) {
929
959
  const i2 = r(n2);
930
- i2.current = n2, t2 && !Array.isArray(t2) && (t2 = [t2]);
931
- const [s2, l2] = a(Qe(e2, t2)), h2 = o2 ? [...o2, e2] : [e2];
960
+ i2.current = n2, e2 && !Array.isArray(e2) && (e2 = [e2]);
961
+ const [s2, l2] = a(Jt(t2, e2)), h2 = o2 ? [...o2, t2] : [t2];
932
962
  return c(() => {
933
963
  const n3 = { onGroupChange: () => {
934
- const n4 = Qe(e2, t2);
964
+ const n4 = Jt(t2, e2);
935
965
  l2(n4), i2.current?.onChange?.(this);
936
966
  } };
937
967
  let o3;
938
- t2 && t2.length > 0 && (o3 = { keys: t2 }, n3.onCommandChange = (n4, o4) => {
939
- i2.current?.onChange?.(e2), l2(Qe(e2, t2));
968
+ e2 && e2.length > 0 && (o3 = { keys: e2 }, n3.onCommandChange = (n4, o4) => {
969
+ i2.current?.onChange?.(t2), l2(Jt(t2, e2));
940
970
  });
941
- const r2 = e2?.addListener(n3, o3), s3 = Qe(e2, t2);
942
- return l2(s3), i2.current?.onChange && i2.current?.onChange(e2), () => {
971
+ const r2 = t2?.addListener(n3, o3), s3 = Jt(t2, e2);
972
+ return l2(s3), i2.current?.onChange && i2.current?.onChange(t2), () => {
943
973
  r2?.();
944
974
  };
945
975
  }, h2), s2;
946
976
  }
947
- const tt = { Toolbar: "toolbar", Menuitem: "menuitem" }, nt = Re({ setClipboard: (e2) => {
977
+ const te = { Toolbar: "toolbar", Menuitem: "menuitem" }, ee = Nt({ setClipboard: (t2) => {
948
978
  throw new Error("This is only available via the useClipboard.");
949
979
  }, getClipboard: () => x.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
950
- const [e2, t2] = a(x.Global);
951
- return { setClipboard: (e3) => t2(e3), getClipboard: () => e2, refNativeCopy: r(null), refNativeLastKey: r(null) };
952
- }), ot = (e2) => {
953
- const { source: t2, target: n2, onPaste: o2, onClipboardUpdate: r2, notifier: s2 = se, commands: l2 } = e2, a2 = P(r2, [r2]), u2 = P(o2, [o2]), { getClipboard: d2, refNativeCopy: _2 } = nt(), p2 = d2();
980
+ const [t2, e2] = a(x.Global);
981
+ return { setClipboard: (t3) => e2(t3), getClipboard: () => t2, refNativeCopy: r(null), refNativeLastKey: r(null) };
982
+ }), ne = (t2) => {
983
+ const { source: e2, target: n2, onPaste: o2, onClipboardUpdate: r2, notifier: s2 = rt, commands: l2 } = t2, a2 = P(r2, [r2]), u2 = P(o2, [o2]), { getClipboard: d2, refNativeCopy: _2 } = ee(), p2 = d2();
954
984
  h(() => {
955
- const e3 = t2?.element, o3 = n2?.element ?? t2?.element;
985
+ const t3 = e2?.element, o3 = n2?.element ?? e2?.element;
956
986
  if (!l2) return;
957
- const i2 = [new je("cut", e3, { label: "Cut", description: "Remove the selection and put it on the clipboard so you can paste it somewhere else.", shortcut: { key: "X", modifiers: [E.Ctrl] } }), new je("copy", e3, { label: "Copy", description: "Put a copy of the selection on the clipboard so you can paste it somewhere else.", shortcut: { key: "C", modifiers: [E.Ctrl] } }), new je("paste", o3, { label: "Paste", description: "Add content on the clipboard to your document.", shortcut: [{ key: "V", modifiers: [E.Ctrl] }, { key: "F8", modifiers: [E.Ctrl] }] })];
987
+ const i2 = [new Xt("cut", t3, { label: "Cut", description: "Remove the selection and put it on the clipboard so you can paste it somewhere else.", shortcut: { key: "X", modifiers: [E.Ctrl] } }), new Xt("copy", t3, { label: "Copy", description: "Put a copy of the selection on the clipboard so you can paste it somewhere else.", shortcut: { key: "C", modifiers: [E.Ctrl] } }), new Xt("paste", o3, { label: "Paste", description: "Add content on the clipboard to your document.", shortcut: [{ key: "V", modifiers: [E.Ctrl] }, { key: "F8", modifiers: [E.Ctrl] }] })];
958
988
  l2?.addCommands(i2, true);
959
989
  }, [l2]);
960
- const m2 = P(async (e3) => {
961
- if (!t2?.element) return;
990
+ const m2 = P(async (t3) => {
991
+ if (!e2?.element) return;
962
992
  let n3 = null;
963
993
  try {
964
- n3 = t2.doCopy?.(e3), "string" == typeof n3 ? await p2.writeText(n3) : await p2.writeReference(n3);
965
- } catch (e4) {
966
- throw e4;
994
+ n3 = e2.doCopy?.(t3), "string" == typeof n3 ? await p2.writeText(n3) : await p2.writeReference(n3);
995
+ } catch (t4) {
996
+ throw t4;
967
997
  }
968
- }, [t2, s2]), f2 = P(async (e3) => {
969
- const n3 = t2?.element?.();
998
+ }, [e2, s2]), f2 = P(async (t3) => {
999
+ const n3 = e2?.element?.();
970
1000
  if (n3) {
971
- _2.current = { sourceElement: n3, args: e3 };
1001
+ _2.current = { sourceElement: n3, args: t3 };
972
1002
  try {
973
- await m2(e3);
974
- } catch (e4) {
975
- s2?.showError?.(e4);
1003
+ await m2(t3);
1004
+ } catch (t4) {
1005
+ s2?.showError?.(t4);
976
1006
  }
977
1007
  }
978
- }, [t2?.element, s2]), b2 = i(() => {
1008
+ }, [e2?.element, s2]), b2 = i(() => {
979
1009
  f2({ isCut: true });
980
- }, []), w2 = P(async (e3, t3, n3) => {
1010
+ }, []), w2 = P(async (t3, e3, n3) => {
981
1011
  try {
982
- if (false === await e3.doPaste(t3, n3)) return;
983
- u2?.(t3, n3);
984
- } catch (e4) {
985
- s2?.showError?.(e4);
1012
+ if (false === await t3.doPaste(e3, n3)) return;
1013
+ u2?.(e3, n3);
1014
+ } catch (t4) {
1015
+ s2?.showError?.(t4);
986
1016
  }
987
- }, [u2]), S2 = P(async (e3, t3, o3) => {
1017
+ }, [u2]), S2 = P(async (t3, e3, o3) => {
988
1018
  const i2 = n2?.element?.();
989
- if (i2 && await g.whenFocus(i2), !e3 && !t3) return;
1019
+ if (i2 && await g.whenFocus(i2), !t3 && !e3) return;
990
1020
  const r3 = await s2?.showBusy?.("Pasting...");
991
- if (t3) try {
992
- return await w2(n2, t3, o3), void r3?.();
993
- } catch (e4) {
994
- r3?.(), s2?.showError?.(e4);
1021
+ if (e3) try {
1022
+ return await w2(n2, e3, o3), void r3?.();
1023
+ } catch (t4) {
1024
+ r3?.(), s2?.showError?.(t4);
995
1025
  }
996
1026
  let l3, a3 = n2.importFromExternal;
997
- a3 || (a3 = (t4, n3) => ({ getItemType: () => "text", toText: () => e3.text, isClipboardItem: true }));
1027
+ a3 || (a3 = (e4, n3) => ({ getItemType: () => "text", toText: () => t3.text, isClipboardItem: true }));
998
1028
  try {
999
- l3 = await a3(e3, { isCut: false });
1000
- } catch (e4) {
1001
- r3?.(), s2?.showError?.(e4);
1029
+ l3 = await a3(t3, { isCut: false });
1030
+ } catch (t4) {
1031
+ r3?.(), s2?.showError?.(t4);
1002
1032
  }
1003
1033
  if (l3) try {
1004
- const e4 = await Promise.resolve(l3);
1005
- await w2(n2, e4, o3), r3?.();
1006
- } catch (e4) {
1007
- r3?.(), s2?.showError?.(e4);
1034
+ const t4 = await Promise.resolve(l3);
1035
+ await w2(n2, t4, o3), r3?.();
1036
+ } catch (t4) {
1037
+ r3?.(), s2?.showError?.(t4);
1008
1038
  }
1009
1039
  else r3?.();
1010
- }, [w2, n2, s2]), L2 = P(async (e3) => {
1040
+ }, [w2, n2, s2]), L2 = P(async (t3) => {
1011
1041
  if (n2?.element) try {
1012
- const t3 = await p2.readReference();
1013
- if (t3) return void await S2(null, t3, e3);
1042
+ const e3 = await p2.readReference();
1043
+ if (e3) return void await S2(null, e3, t3);
1014
1044
  const n3 = [];
1015
1045
  n3[0] = await y.readStringFromClipboard(p2, v.plain), n3[1] = await y.readHTMLFromClipboard(p2, v.html), n3[2] = await y.readBlobFromClipboard(p2, v.png);
1016
1046
  const o3 = { text: n3[0] ?? null, html: n3[1] ?? null, image: n3[2] ?? null };
1017
- await S2(o3, null, e3);
1018
- } catch (e4) {
1019
- if ("Document is not focused." === e4?.message) return;
1020
- s2?.showError?.(e4);
1047
+ await S2(o3, null, t3);
1048
+ } catch (t4) {
1049
+ if ("Document is not focused." === t4?.message) return;
1050
+ s2?.showError?.(t4);
1021
1051
  }
1022
1052
  }, [S2, n2?.element, s2]);
1023
- return P(async (e3) => {
1024
- }, [t2?.element]), P(async (e3) => {
1053
+ return P(async (t3) => {
1054
+ }, [e2?.element]), P(async (t3) => {
1025
1055
  }, [n2?.element, S2, s2]), c(() => {
1026
1056
  if (!p2) return;
1027
- const e3 = async (e4) => {
1028
- const t4 = await p2.readReference();
1029
- a2?.(t4);
1030
- }, t3 = (e4) => {
1057
+ const t3 = async (t4) => {
1058
+ const e4 = await p2.readReference();
1059
+ a2?.(e4);
1060
+ }, e3 = (t4) => {
1031
1061
  s2?.showMessage?.(x.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
1032
- }, n3 = (e4) => {
1062
+ }, n3 = (t4) => {
1033
1063
  s2?.showMessage?.(x.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
1034
1064
  };
1035
- return p2.addEventListener("clipboardchange", e3), p2.addEventListener("clipboarderrorread", t3), p2.addEventListener("clipboarderrorwrite", n3), () => {
1036
- p2.removeEventListener("clipboardchange", e3), p2.removeEventListener("clipboarderrorread", t3), p2.removeEventListener("clipboarderrorwrite", n3);
1065
+ return p2.addEventListener("clipboardchange", t3), p2.addEventListener("clipboarderrorread", e3), p2.addEventListener("clipboarderrorwrite", n3), () => {
1066
+ p2.removeEventListener("clipboardchange", t3), p2.removeEventListener("clipboarderrorread", e3), p2.removeEventListener("clipboarderrorwrite", n3);
1037
1067
  };
1038
1068
  }, [p2, s2]), c(() => {
1039
- }, [m2, S2, t2, n2]), c(() => {
1040
- l2?.getCommand("cut")?.updateCallback(b2).update({ disabled: !t2 || !n2 }), l2?.getCommand("copy")?.updateCallback(f2).update({ disabled: !t2 }), l2?.getCommand("paste")?.updateCallback(L2).update({ disabled: !n2 });
1041
- }, [t2, n2, l2]), { paste: L2, copy: f2, clipboard: p2 };
1069
+ }, [m2, S2, e2, n2]), c(() => {
1070
+ l2?.getCommand("cut")?.updateCallback(b2).update({ disabled: !e2 || !n2 }), l2?.getCommand("copy")?.updateCallback(f2).update({ disabled: !e2 }), l2?.getCommand("paste")?.updateCallback(L2).update({ disabled: !n2 });
1071
+ }, [e2, n2, l2]), { paste: L2, copy: f2, clipboard: p2 };
1042
1072
  };
1043
- function it(e2, t2 = true) {
1044
- const n2 = r(e2);
1073
+ function oe(t2, e2 = true) {
1074
+ const n2 = r(t2);
1045
1075
  c(() => {
1046
- if (t2) {
1047
- const t3 = Object.entries(e2).reduce((e3, [t4, o2]) => (n2.current[t4] !== o2 && (e3[t4] = [n2.current[t4], o2]), e3), {});
1048
- Object.keys(t3).length > 0 && console.log("Changed props:", t3);
1076
+ if (e2) {
1077
+ const e3 = Object.entries(t2).reduce((t3, [e4, o2]) => (n2.current[e4] !== o2 && (t3[e4] = [n2.current[e4], o2]), t3), {});
1078
+ Object.keys(e3).length > 0 && console.log("Changed props:", e3);
1049
1079
  }
1050
- n2.current = e2;
1080
+ n2.current = t2;
1051
1081
  });
1052
1082
  }
1053
- let rt = false, st = 0;
1054
- var lt = "undefined" != typeof document ? d : c;
1055
- const at = () => "sheetxl-ui-" + st++;
1056
- const ct = o["useId".toString()], ht = null != ct ? ct : function() {
1057
- const [e2, t2] = o.useState(() => rt ? at() : void 0);
1058
- return lt(() => {
1059
- null == e2 && t2(at());
1083
+ let ie = false, re = 0;
1084
+ var se = "undefined" != typeof document ? d : c;
1085
+ const le = () => "sheetxl-ui-" + re++;
1086
+ const ae = o["useId".toString()], ce = null != ae ? ae : function() {
1087
+ const [t2, e2] = o.useState(() => ie ? le() : void 0);
1088
+ return se(() => {
1089
+ null == t2 && e2(le());
1060
1090
  }, []), o.useEffect(() => {
1061
- rt || (rt = true);
1062
- }, []), e2;
1063
- }, ut = "Undo the last action.", dt = "Repeat the last action or undo the redo.", _t = (e2) => `Redo ${e2}`, pt = ({ manager: e2, commands: t2, disabled: n2, notifier: o2 = se }) => {
1064
- const i2 = P((t3) => {
1091
+ ie || (ie = true);
1092
+ }, []), t2;
1093
+ }, he = "Undo the last action.", ue = "Repeat the last action or undo the redo.", de = (t2) => `Redo ${t2}`, _e = ({ manager: t2, commands: e2, disabled: n2, notifier: o2 = rt }) => {
1094
+ const i2 = P((e3) => {
1065
1095
  try {
1066
- e2?.undo(t3);
1067
- } catch (e3) {
1068
- o2.showError?.(e3);
1096
+ t2?.undo(e3);
1097
+ } catch (t3) {
1098
+ o2.showError?.(t3);
1069
1099
  }
1070
- }, [e2]), r2 = P((t3) => {
1100
+ }, [t2]), r2 = P((e3) => {
1071
1101
  try {
1072
- e2?.redo(t3);
1073
- } catch (e3) {
1074
- o2.showError?.(e3);
1102
+ t2?.redo(e3);
1103
+ } catch (t3) {
1104
+ o2.showError?.(t3);
1075
1105
  }
1076
- }, [e2]);
1106
+ }, [t2]);
1077
1107
  return h(() => {
1078
- if (!t2) return;
1079
- const e3 = { contains: (e4) => true, focus() {
1080
- } }, n3 = [new Xe("undo", e3, { label: "Undo", description: ut, shortcut: { key: "z", modifiers: [E.Ctrl] }, disabled: true }, i2), new Xe("redo", e3, { label: "Redo", description: dt, shortcut: [{ key: "y", modifiers: [E.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [E.Alt] }], disabled: true }, r2)];
1081
- t2?.addCommands(n3, true);
1082
- }, [t2]), c(() => {
1083
- if (!t2) return;
1108
+ if (!e2) return;
1109
+ const t3 = { contains: (t4) => true, focus() {
1110
+ } }, n3 = [new Yt("undo", t3, { label: "Undo", description: he, shortcut: { key: "z", modifiers: [E.Ctrl] }, disabled: true }, i2), new Yt("redo", t3, { label: "Redo", description: ue, shortcut: [{ key: "y", modifiers: [E.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [E.Alt] }], disabled: true }, r2)];
1111
+ e2?.addCommands(n3, true);
1112
+ }, [e2]), c(() => {
1113
+ if (!e2) return;
1084
1114
  const o3 = () => {
1085
- const o4 = e2?.getTopUndoDescription(), i4 = {};
1115
+ const o4 = t2?.getTopUndoDescription(), i4 = {};
1086
1116
  var r3;
1087
- t2.getCommand("undo").update({ disabled: n2 || !e2 || !e2.hasUndo(), description: o4 ? (r3 = o4, `Undo ${r3}`) : ut, state: i4, context: { undoManager: e2 } });
1088
- const s2 = e2?.getTopRedoDescription();
1089
- t2.getCommand("redo").update({ disabled: n2 || !e2 || !e2.hasRedo(), description: s2 ? _t(s2) : dt, state: i4, context: { undoManager: e2 } });
1117
+ e2.getCommand("undo").update({ disabled: n2 || !t2 || !t2.hasUndo(), description: o4 ? (r3 = o4, `Undo ${r3}`) : he, state: i4, context: { undoManager: t2 } });
1118
+ const s2 = t2?.getTopRedoDescription();
1119
+ e2.getCommand("redo").update({ disabled: n2 || !t2 || !t2.hasRedo(), description: s2 ? de(s2) : ue, state: i4, context: { undoManager: t2 } });
1090
1120
  };
1091
- if (o3(), !e2) return;
1092
- const i3 = e2.addListener({ onStackChange() {
1121
+ if (o3(), !t2) return;
1122
+ const i3 = t2.addListener({ onStackChange() {
1093
1123
  o3();
1094
1124
  } });
1095
1125
  return () => i3?.();
1096
- }, [e2, t2, n2]), { undo: i2, redo: r2 };
1126
+ }, [t2, e2, n2]), { undo: i2, redo: r2 };
1097
1127
  };
1098
1128
  export {
1099
- Xe as Command,
1100
- tt as CommandButtonType,
1101
- Ue as CommandGroup,
1102
- se as DefaultNotifier,
1103
- ge as FocusKeyNavigation,
1129
+ Yt as Command,
1130
+ te as CommandButtonType,
1131
+ jt as CommandGroup,
1132
+ rt as DefaultNotifier,
1133
+ ft as FocusKeyNavigation,
1104
1134
  C as HorizontalAlignment,
1105
1135
  T as KeyCodes,
1106
1136
  E as KeyModifiers,
1107
1137
  M as MouseButtonCodes,
1108
- ie as NotificationType,
1109
- J as ReactUtils,
1110
- ye as RoundedTab,
1111
- oe as ScrollPane,
1138
+ ot as NotificationType,
1139
+ q as ReactUtils,
1140
+ gt as RoundedTab,
1141
+ nt as ScrollPane,
1112
1142
  $ as ScrollUtils,
1113
1143
  O as Scrollbar,
1114
1144
  D as ScrollbarOrientation,
1115
- je as SimpleCommand,
1116
- Ce as SplitPane,
1117
- xe as SplitPaneResizer,
1118
- fe as ToolTipPlacement,
1119
- me as VirtualScrollbar,
1120
- ne as defaultCreateScrollCorner,
1145
+ Xt as SimpleCommand,
1146
+ Lt as SplitPane,
1147
+ vt as SplitPaneResizer,
1148
+ mt as ToolTipPlacement,
1149
+ pt as VirtualScrollbar,
1150
+ et as defaultCreateScrollCorner,
1121
1151
  A as defaultCreateScrollEdgeButton,
1122
1152
  k as defaultCreateScrollEndButton,
1123
1153
  z as defaultCreateScrollStartButton,
1124
- te as defaultCreateScrollbar,
1125
- Te as getDevicePixelRatio,
1126
- le as getPortalContainer,
1127
- qe as toShortcutString,
1154
+ tt as defaultCreateScrollbar,
1155
+ Et as getDevicePixelRatio,
1156
+ st as getPortalContainer,
1157
+ Gt as toShortcutString,
1128
1158
  P as useCallbackRef,
1129
- Je as useCommand,
1130
- et as useCommands,
1131
- ot as useCopyPaste,
1132
- Ee as useDevicePixelRatio,
1133
- Ye as useEditMode,
1134
- ce as useFullscreenPortal,
1135
- nt as useGlobalClipboard,
1136
- ht as useId,
1137
- ee as useImperativeElement,
1138
- Pe as useMouseDownAndHoldListener,
1139
- Me as useOnClickOrFocusAway,
1140
- De as useSynchronizedPointerHandler,
1141
- it as useTraceUpdate,
1142
- pt as useUndoManager
1159
+ qt as useCommand,
1160
+ Qt as useCommands,
1161
+ ne as useCopyPaste,
1162
+ Ct as useDevicePixelRatio,
1163
+ It as useEditMode,
1164
+ at as useFullscreenPortal,
1165
+ ee as useGlobalClipboard,
1166
+ ce as useId,
1167
+ Q as useImperativeElement,
1168
+ Dt as useMouseDownAndHoldListener,
1169
+ Tt as useOnClickOrFocusAway,
1170
+ Mt as useSynchronizedPointerHandler,
1171
+ oe as useTraceUpdate,
1172
+ _e as useUndoManager
1143
1173
  };