@sheetxl/utils-react 0.7.3 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,16 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._sheetxl-scrollbar_eblx4_6 ::-webkit-scrollbar-button{background:transparent}._fullscreen-portal-root_1mjsr_4{pointer-events:none;position:absolute;inset:0;width:100%;height:100%;z-index:1200}._fullscreen-portal-root_1mjsr_4>*{pointer-events:auto}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- import { jsx as L, jsxs as be, Fragment as Me } from "react/jsx-runtime";
3
- import me, { useLayoutEffect as Ve, useEffect as V, useState as G, useMemo as N, useCallback as R, useRef as A, memo as Se, forwardRef as Le, useImperativeHandle as tn, version as nn, createElement as on, useReducer as rn } from "react";
4
- import { CommonUtils as te, InternalClipboard as Ke, ClipboardUtils as Ie, MimeType as Ne } from "@sheetxl/utils";
5
- import { createRoot as sn } from "react-dom/client";
6
- import { unstable_batchedUpdates as ln } from "react-dom";
2
+ import { jsx as L, jsxs as be, Fragment as De } from "react/jsx-runtime";
3
+ import ce, { useLayoutEffect as Ie, useEffect as V, useState as G, useMemo as W, useCallback as H, useRef as A, memo as Le, forwardRef as Ce, useImperativeHandle as nn, version as on, createContext as rn, useContext as sn, createElement as ln, useReducer as an } from "react";
4
+ import { CommonUtils as te, DelegatingNotifier as cn, Notifier as fe, InternalClipboard as Re, ClipboardUtils as We, MimeType as Fe } from "@sheetxl/utils";
5
+ import { createRoot as hn } from "react-dom/client";
6
+ import { unstable_batchedUpdates as un } from "react-dom";
7
7
  /**
8
- * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.3
8
+ * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.4
9
9
  *
10
10
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
11
11
  * License: The license can be found at https://www.sheetxl.com/license.
12
12
  */
13
- const Qn = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, Z = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, eo = { 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 }, to = { Left: 1, Middle: 2, Right: 3 }, re = { Horizontal: "horizontal", Vertical: "vertical" };
13
+ const io = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, Z = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, ro = { 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 }, so = { Left: 1, Middle: 2, Right: 3 }, re = { Horizontal: "horizontal", Vertical: "vertical" };
14
14
  function Ct(i) {
15
15
  var e, t, n = "";
16
16
  if (typeof i == "string" || typeof i == "number") n += i;
@@ -20,43 +20,43 @@ function Ct(i) {
20
20
  } else for (t in i) i[t] && (n && (n += " "), n += t);
21
21
  return n;
22
22
  }
23
- function ve() {
23
+ function xe() {
24
24
  for (var i, e, t = 0, n = "", o = arguments.length; t < o; t++) (i = arguments[t]) && (e = Ct(i)) && (n && (n += " "), n += e);
25
25
  return n;
26
26
  }
27
- var an = function() {
28
- }, Et = typeof window < "u", cn = Et ? Ve : V, dt = { x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, bottom: 0, right: 0 };
29
- const fe = Et && window.ResizeObserver !== void 0 ? function() {
30
- var i = G(null), e = i[0], t = i[1], n = G(dt), o = n[0], r = n[1], s = N(function() {
27
+ var dn = function() {
28
+ }, Et = typeof window < "u", pn = Et ? Ie : V, pt = { x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, bottom: 0, right: 0 };
29
+ const ge = Et && window.ResizeObserver !== void 0 ? function() {
30
+ var i = G(null), e = i[0], t = i[1], n = G(pt), o = n[0], r = n[1], s = W(function() {
31
31
  return new window.ResizeObserver(function(l) {
32
32
  if (l[0]) {
33
- var a = l[0].contentRect, c = a.x, h = a.y, u = a.width, d = a.height, w = a.top, b = a.left, x = a.bottom, S = a.right;
34
- r({ x: c, y: h, width: u, height: d, top: w, left: b, bottom: x, right: S });
33
+ var a = l[0].contentRect, c = a.x, h = a.y, u = a.width, d = a.height, b = a.top, w = a.left, x = a.bottom, S = a.right;
34
+ r({ x: c, y: h, width: u, height: d, top: b, left: w, bottom: x, right: S });
35
35
  }
36
36
  });
37
37
  }, []);
38
- return cn(function() {
38
+ return pn(function() {
39
39
  if (e) return s.observe(e), function() {
40
40
  s.disconnect();
41
41
  };
42
42
  }, [e]), [t, o];
43
43
  } : function() {
44
- return [an, dt];
44
+ return [dn, pt];
45
45
  }, T = (i, e) => {
46
- const t = R((...r) => i?.(...r), e), n = A(null);
46
+ const t = H((...r) => i?.(...r), e), n = A(null);
47
47
  n.current = t;
48
- const o = R((...r) => n.current?.(...r), []);
48
+ const o = H((...r) => n.current?.(...r), []);
49
49
  if (n.current) return o;
50
- }, hn = (i) => {
50
+ }, _n = (i) => {
51
51
  const { style: e, orientation: t = re.Vertical, ...n } = i, o = t === re.Vertical;
52
52
  return L("div", { style: { paddingBottom: "0px", paddingRight: "0px", paddingLeft: o ? "0px" : "3px", paddingTop: o ? "3px" : "0px", display: "flex", alignItems: "center", justifyContent: "center", ...e }, ...n, children: L("button", { style: { padding: "0", display: "flex", alignItems: "center", justifyContent: "center", border: "none" }, className: `scrollbar-button ${o ? "vertical" : "horizontal"} single-button start`, children: L("svg", { width: "9", height: "9", viewBox: "0 0 6 6", style: { opacity: "inherit" }, children: L("path", { d: o ? "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" }) }) }) });
53
- }, un = (i) => {
53
+ }, mn = (i) => {
54
54
  const { style: e, orientation: t = re.Vertical, ...n } = i, o = t === re.Vertical;
55
55
  return L("div", { style: { paddingLeft: "0px", paddingTop: "0px", paddingRight: o ? "0px" : "3px", paddingBottom: o ? "3px" : "0px", display: "flex", alignItems: "center", justifyContent: "center", ...e }, ...n, children: L("button", { style: { padding: "0", display: "flex", alignItems: "center", justifyContent: "center", border: "none" }, className: `scrollbar-button ${o ? "vertical" : "horizontal"} single-button end`, children: L("svg", { width: "9", height: "9", viewBox: "0 0 6 6", style: { opacity: "inherit" }, children: L("path", { d: o ? "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" }) }) }) });
56
- }, no = (i) => {
56
+ }, lo = (i) => {
57
57
  const { style: e, orientation: t = re.Vertical, ...n } = i, o = t === re.Vertical;
58
58
  return L("div", { style: { display: "flex", justifyContent: "center", alignItems: "end", transition: "fill-opacity 1s", zIndex: 1, width: "24px", height: "24px", ...e }, className: `scrollbar-button ${o ? "vertical" : "horizontal"} edge`, ...n, children: L("svg", { width: "24", height: "24", viewBox: "0 0 24 24", transform: o ? "rotate(90) " : "", children: L("path", { style: { transition: "opacity 240ms ease 0s", opacity: i.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" }) }) });
59
- }, Ue = (i, e, t, n, o = 0) => {
59
+ }, Ze = (i, e, t, n, o = 0) => {
60
60
  for (let r = 0; r < t.length; r++) {
61
61
  const s = t[r].getBoundingClientRect();
62
62
  let l = s.left - e, a = l + s.width;
@@ -65,88 +65,88 @@ const fe = Et && window.ResizeObserver !== void 0 ? function() {
65
65
  } else if (Math.ceil(a) > Math.ceil(i) + 2) return a;
66
66
  }
67
67
  return o;
68
- }, oo = Object.freeze(Object.defineProperty({ __proto__: null, getScrollTo: Ue }, Symbol.toStringTag, { value: "Module" })), dn = "_sheetxl-scrollbar_eblx4_6", tt = Se(Le((i, e) => {
69
- const { offset: t = 0, totalSize: n = 0, viewportSize: o = 0, style: r, className: s, orientation: l = re.Vertical, onScrollOffset: a, onScroll: c, showCustomScrollButtons: h = !1, scrollButtonIncrement: u = 200, scrollButtonInitialRepeatDelay: d = 260, scrollButtonAdditionalRepeatDelay: w = 120, createScrollStartButton: b = hn, createScrollEndButton: x = un, ...S } = i, P = T(c, [c]), _ = A(null), [y, { width: f, height: k }] = fe(), [z, { width: O, height: F }] = fe(), g = l === re.Vertical, v = g ? "top" : "left", B = g ? "scrollTop" : "scrollLeft", p = g ? k : f, C = g ? F : O, [m, E] = G(null);
68
+ }, ao = Object.freeze(Object.defineProperty({ __proto__: null, getScrollTo: Ze }, Symbol.toStringTag, { value: "Module" })), fn = "_sheetxl-scrollbar_eblx4_6", nt = Le(Ce((i, e) => {
69
+ const { offset: t = 0, totalSize: n = 0, viewportSize: o = 0, style: r, className: s, orientation: l = re.Vertical, onScrollOffset: a, onScroll: c, showCustomScrollButtons: h = !1, scrollButtonIncrement: u = 200, scrollButtonInitialRepeatDelay: d = 260, scrollButtonAdditionalRepeatDelay: b = 120, createScrollStartButton: w = _n, createScrollEndButton: x = mn, ...S } = i, P = T(c, [c]), _ = A(null), [y, { width: f, height: k }] = ge(), [z, { width: $, height: I }] = ge(), g = l === re.Vertical, v = g ? "top" : "left", B = g ? "scrollTop" : "scrollLeft", p = g ? k : f, C = g ? I : $, [m, E] = G(null);
70
70
  V(() => {
71
71
  m !== null && _.current && _.current.scrollTo({ behavior: "smooth", [v]: m });
72
72
  }, [m, g]);
73
- const D = R((K, se = !1) => {
73
+ const D = H((K, se = !1) => {
74
74
  if (!_.current) return 0;
75
- const ie = _.current.querySelector(".scrollbar-viewport"), pe = ie.getBoundingClientRect(), le = ie.children, ce = se ? 0 : Ue(K, pe[v], le, !0, Math.max(0, K - u));
76
- return E(ce), Math.max(0, ce);
77
- }, []), q = R((K, se = !1) => {
75
+ const ie = _.current.querySelector(".scrollbar-viewport"), _e = ie.getBoundingClientRect(), le = ie.children, he = se ? 0 : Ze(K, _e[v], le, !0, Math.max(0, K - u));
76
+ return E(he), Math.max(0, he);
77
+ }, []), q = H((K, se = !1) => {
78
78
  if (!_.current) return 0;
79
- const ie = _.current.querySelector(".scrollbar-viewport"), pe = ie.getBoundingClientRect(), le = ie.children, ce = Math.ceil(C - p), Ce = se ? ce : Ue(K, pe[v], le, !1, Math.max(0, K + u));
80
- return E(Ce), Math.min(ce, Ce);
81
- }, [C, p]), W = A(null), Y = R((K) => {
82
- W.current = t;
79
+ const ie = _.current.querySelector(".scrollbar-viewport"), _e = ie.getBoundingClientRect(), le = ie.children, he = Math.ceil(C - p), Ee = se ? he : Ze(K, _e[v], le, !1, Math.max(0, K + u));
80
+ return E(Ee), Math.min(he, Ee);
81
+ }, [C, p]), F = A(null), Y = H((K) => {
82
+ F.current = t;
83
83
  const se = K.target[B];
84
84
  a(se, o, n), P?.(K);
85
85
  }, [a, o, n, t]);
86
86
  V(() => {
87
- const K = W.current;
88
- W.current = null, t !== K && (_.current[B] = t);
87
+ const K = F.current;
88
+ F.current = null, t !== K && (_.current[B] = t);
89
89
  }, [t, B]);
90
- const X = A(null), $ = A(null), I = R(() => {
91
- X.current && (clearTimeout(X.current), X.current = null, $.current = null);
92
- }, []), j = R((K, se, ie, pe = d) => {
93
- $.current = K, X.current = setTimeout(() => {
94
- const le = ie ? D($.current || K) : q($.current || K);
95
- le !== $.current ? j(le, !1, ie, w) : I();
96
- }, se ? 0 : pe);
97
- }, [D, q, I]);
98
- V(() => () => I(), [I]);
99
- const ne = t, ge = N(() => {
90
+ const X = A(null), O = A(null), N = H(() => {
91
+ X.current && (clearTimeout(X.current), X.current = null, O.current = null);
92
+ }, []), j = H((K, se, ie, _e = d) => {
93
+ O.current = K, X.current = setTimeout(() => {
94
+ const le = ie ? D(O.current || K) : q(O.current || K);
95
+ le !== O.current ? j(le, !1, ie, b) : N();
96
+ }, se ? 0 : _e);
97
+ }, [D, q, N]);
98
+ V(() => () => N(), [N]);
99
+ const ne = t, ye = W(() => {
100
100
  if (!h) return null;
101
- const K = { orientation: l, disabled: Math.floor(ne) <= 0 || Math.floor(C - p) === 0, onMouseUp: I, onMouseLeave: I, onMouseDown: () => j(ne, !0, !0) };
102
- return b?.(K);
103
- }, [h, l, ne, m, C, p]), ye = N(() => {
101
+ const K = { orientation: l, disabled: Math.floor(ne) <= 0 || Math.floor(C - p) === 0, onMouseUp: N, onMouseLeave: N, onMouseDown: () => j(ne, !0, !0) };
102
+ return w?.(K);
103
+ }, [h, l, ne, m, C, p]), ve = W(() => {
104
104
  if (!h) return null;
105
- const K = { orientation: l, disabled: Math.floor(C - p) <= Math.ceil(ne), onMouseUp: I, onMouseLeave: I, onMouseDown: () => j(ne, !0, !1) };
105
+ const K = { orientation: l, disabled: Math.floor(C - p) <= Math.ceil(ne), onMouseUp: N, onMouseLeave: N, onMouseDown: () => j(ne, !0, !1) };
106
106
  return x?.(K);
107
107
  }, [h, l, ne, m, C, p]);
108
- return be("div", { ref: e, style: { display: "flex", flex: "1", flexDirection: g ? "column" : "row", padding: "0", ...r }, className: ve(dn, s), ...S, children: [ge, L("div", { className: "pseudo-scrollbar", style: { flex: "1 1 100%", display: "flex", boxSizing: "content-box", flexDirection: g ? "column" : "row", justifyContent: "center", alignItems: "center" }, ref: y, children: L("div", { tabIndex: -1, style: { flex: "1 1 100%", overflowY: g ? "scroll" : "hidden", overflowX: g ? "hidden" : "scroll", position: "relative", willChange: "transform" }, onScroll: Y, ref: _, children: L("div", { ref: z, style: { position: "absolute", height: g ? n - o + (k ?? 0) : 1, width: g ? 1 : n - o + (f ?? 0) }, className: "scrollbar-viewport" }) }) }), ye] });
108
+ return be("div", { ref: e, style: { display: "flex", flex: "1", flexDirection: g ? "column" : "row", padding: "0", ...r }, className: xe(fn, s), ...S, children: [ye, L("div", { className: "pseudo-scrollbar", style: { flex: "1 1 100%", display: "flex", boxSizing: "content-box", flexDirection: g ? "column" : "row", justifyContent: "center", alignItems: "center" }, ref: y, children: L("div", { tabIndex: -1, style: { flex: "1 1 100%", overflowY: g ? "scroll" : "hidden", overflowX: g ? "hidden" : "scroll", position: "relative", willChange: "transform" }, onScroll: Y, ref: _, children: L("div", { ref: z, style: { position: "absolute", height: g ? n - o + (k ?? 0) : 1, width: g ? 1 : n - o + (f ?? 0) }, className: "scrollbar-viewport" }) }) }), ve] });
109
109
  }));
110
- tt.displayName = "Scrollbar";
111
- let pt = Date.now, _t = 1e3, de = {}, pn = 1;
112
- const Ee = (i) => {
113
- let e = de[i] !== null;
114
- return e && (de[i] = null), e;
115
- }, mt = (i, e, t, n = 0, o) => {
116
- let r = pt(), s = r, l = 0, a = 0, c = 0, h = pn++;
110
+ nt.displayName = "Scrollbar";
111
+ let _t = Date.now, mt = 1e3, pe = {}, gn = 1;
112
+ const Te = (i) => {
113
+ let e = pe[i] !== null;
114
+ return e && (pe[i] = null), e;
115
+ }, ft = (i, e, t, n = 0, o) => {
116
+ let r = _t(), s = r, l = 0, a = 0, c = 0, h = gn++;
117
117
  if (h % 20 == 0) {
118
118
  const d = {};
119
- for (let w in de) d[w] = !0;
120
- de = d;
119
+ for (let b in pe) d[b] = !0;
120
+ pe = d;
121
121
  }
122
122
  const u = function(d) {
123
- let w = d !== !0, b = pt(), x = !0;
123
+ let b = d !== !0, w = _t(), x = !0;
124
124
  try {
125
125
  x = (!e || e(h)) ?? !0;
126
126
  } catch {
127
127
  x = !1;
128
128
  }
129
- if (!de[h] || !x) return de[h] = null, void t?.(60 - a / ((b - r) / _t), h, !1);
130
- if (w) {
131
- c = Math.round((b - s) / 16.666666666666668) - 1;
129
+ if (!pe[h] || !x) return pe[h] = null, void t?.(60 - a / ((w - r) / mt), h, !1);
130
+ if (b) {
131
+ c = Math.round((w - s) / 16.666666666666668) - 1;
132
132
  for (let _ = 0; _ < Math.min(c, 4); _++) u(!0), a++;
133
133
  }
134
- n && (l = (b - r) / n, l > 1 && (l = 1));
134
+ n && (l = (w - r) / n, l > 1 && (l = 1));
135
135
  let S = o ? o(l) : l, P = !1;
136
136
  try {
137
- P = i(S, b, w);
137
+ P = i(S, w, b);
138
138
  } catch {
139
139
  P = !1;
140
140
  }
141
- P !== !1 && l !== 1 || !w ? w && (s = b, requestAnimationFrame(u)) : (de[h] = null, t?.(60 - a / ((b - r) / _t), h, l === 1 || n == null));
141
+ P !== !1 && l !== 1 || !b ? b && (s = w, requestAnimationFrame(u)) : (pe[h] = null, t?.(60 - a / ((w - r) / mt), h, l === 1 || n == null));
142
142
  };
143
- return de[h] = !0, requestAnimationFrame(u), h;
144
- }, _n = function(i) {
143
+ return pe[h] = !0, requestAnimationFrame(u), h;
144
+ }, yn = function(i) {
145
145
  return Math.pow(i - 1, 3) + 1;
146
- }, mn = function(i) {
146
+ }, vn = function(i) {
147
147
  return (i /= 0.5) < 1 ? 0.5 * Math.pow(i, 3) : 0.5 * (Math.pow(i - 2, 3) + 2);
148
148
  };
149
- class fn {
149
+ class xn {
150
150
  constructor(e, t) {
151
151
  this.__isSingleTouch = !1, this.__isTracking = !1, this.__didDecelerationComplete = !1, this.__isGesturing = !1, this.__isDragging = !1, this.__isDecelerating = 0, this.__isAnimating = 0, this.__interruptedAnimation = !1, this.__lastScale = 1, this.__enableScrollX = !0, this.__enableScrollY = !0, 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 = e, this.options = { scrollingX: !0, scrollingY: !0, animating: !0, animationDuration: 250, bouncing: !0, locking: !0, paging: !1, snapping: !1, zooming: !1, minZoom: 0.5, maxZoom: 3, speedMultiplier: 1, scrollingComplete: void 0, penetrationDeceleration: 0.03, penetrationAcceleration: 0.08, ...t };
152
152
  }
@@ -171,7 +171,7 @@ class fn {
171
171
  }
172
172
  zoomTo(e, t = !1, n, o, r) {
173
173
  if (!this.options.zooming) throw new Error("Zooming is not enabled!");
174
- r && (this.__zoomComplete = r), this.__isDecelerating && (Ee(this.__isDecelerating), this.__isDecelerating = 0);
174
+ r && (this.__zoomComplete = r), this.__isDecelerating && (Te(this.__isDecelerating), this.__isDecelerating = 0);
175
175
  const s = this.__zoomLevel;
176
176
  n === void 0 && (n = this.__clientWidth / 2), o === void 0 && (o = this.__clientHeight / 2), e = Math.max(Math.min(e, this.options.maxZoom), this.options.minZoom), this.__computeScrollMax(e);
177
177
  const l = e / s;
@@ -182,7 +182,7 @@ class fn {
182
182
  this.zoomTo(this.__zoomLevel * e, t, n, o, r);
183
183
  }
184
184
  scrollTo(e, t, n = !1, o = 1) {
185
- if (this.__isDecelerating && (Ee(this.__isDecelerating), this.__isDecelerating = 0), o !== void 0 && o !== this.__zoomLevel) {
185
+ if (this.__isDecelerating && (Te(this.__isDecelerating), this.__isDecelerating = 0), o !== void 0 && o !== this.__zoomLevel) {
186
186
  if (!this.options.zooming) throw new Error("Zooming is not enabled!");
187
187
  e *= o, t *= o, this.__computeScrollMax(o);
188
188
  } else o = this.__zoomLevel;
@@ -200,7 +200,7 @@ class fn {
200
200
  if (e.length === void 0) throw new Error("Invalid touch list: " + e);
201
201
  if (t instanceof Date && (t = t.valueOf()), typeof t != "number") throw new Error("Invalid timestamp value: " + t);
202
202
  let n, o;
203
- this.__interruptedAnimation = !0, this.__isDecelerating && (Ee(this.__isDecelerating), this.__isDecelerating = 0, this.__interruptedAnimation = !0), this.__isAnimating && (Ee(this.__isAnimating), this.__isAnimating = 0, this.__interruptedAnimation = !0);
203
+ this.__interruptedAnimation = !0, this.__isDecelerating && (Te(this.__isDecelerating), this.__isDecelerating = 0, this.__interruptedAnimation = !0), this.__isAnimating && (Te(this.__isAnimating), this.__isAnimating = 0, this.__interruptedAnimation = !0);
204
204
  let r = e.length === 1;
205
205
  r ? (n = e[0].pageX, o = e[0].pageY) : (n = Math.abs(e[0].pageX + e[1].pageX) / 2, o = Math.abs(e[0].pageY + e[1].pageY) / 2), this.__initialTouchLeft = n, this.__initialTouchTop = o, this.__zoomLevelStart = this.__zoomLevel, this.__lastTouchLeft = n, this.__lastTouchTop = o, this.__lastTouchMove = t, this.__lastScale = 1, this.__enableScrollX = !r && this.options.scrollingX, this.__enableScrollY = !r && this.options.scrollingY, this.__isTracking = !0, this.__didDecelerationComplete = !1, this.__isDragging = !r, this.__isSingleTouch = r, this.__positions = [];
206
206
  }
@@ -216,8 +216,8 @@ class fn {
216
216
  if (n !== void 0 && this.options.zooming) {
217
217
  let d = u;
218
218
  if (u = u / this.__lastScale * n, u = Math.max(Math.min(u, this.options.maxZoom), this.options.minZoom), d !== u) {
219
- let w = o - this.__clientLeft, b = r - this.__clientTop;
220
- c = (w + c) * u / d - w, h = (b + h) * u / d - b, this.__computeScrollMax(u);
219
+ let b = o - this.__clientLeft, w = r - this.__clientTop;
220
+ c = (b + c) * u / d - b, h = (w + h) * u / d - w, this.__computeScrollMax(u);
221
221
  }
222
222
  }
223
223
  if (this.__enableScrollX) {
@@ -255,16 +255,16 @@ class fn {
255
255
  }
256
256
  __publish(e, t, n, o = !1) {
257
257
  const r = this.__isAnimating;
258
- if (r && (Ee(r), this.__isAnimating = 0), o && this.options.animating) {
258
+ if (r && (Te(r), this.__isAnimating = 0), o && this.options.animating) {
259
259
  this.__scheduledLeft = e, this.__scheduledTop = t, this.__scheduledZoom = n;
260
260
  const s = this.__scrollLeft, l = this.__scrollTop, a = this.__zoomLevel, c = e - s, h = t - l, u = n - a, d = function(x, S, P) {
261
261
  P && (this.__scrollLeft = s + c * x, this.__scrollTop = l + h * x, this.__zoomLevel = a + u * x, this.__callback && this.__callback(this.__scrollLeft, this.__scrollTop, this.__zoomLevel));
262
- }.bind(this), w = function(x) {
262
+ }.bind(this), b = function(x) {
263
263
  return this.__isAnimating === x;
264
- }.bind(this), b = function(x, S, P) {
264
+ }.bind(this), w = function(x, S, P) {
265
265
  S === this.__isAnimating && (this.__isAnimating = !1), (this.__didDecelerationComplete || P) && this.options.scrollingComplete?.(), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
266
266
  }.bind(this);
267
- this.__isAnimating = mt(d, w, b, this.options.animationDuration, r ? _n : mn);
267
+ this.__isAnimating = ft(d, b, w, this.options.animationDuration, r ? yn : vn);
268
268
  } else this.__scheduledLeft = this.__scrollLeft = e, this.__scheduledTop = this.__scrollTop = t, this.__scheduledZoom = this.__zoomLevel = n, this.__callback && this.__callback(e, t, n), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
269
269
  }
270
270
  __computeScrollMax(e = this.__zoomLevel) {
@@ -283,7 +283,7 @@ class fn {
283
283
  }.bind(this), r = function(s, l, a) {
284
284
  this.__isDecelerating = 0, this.__didDecelerationComplete && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, this.options.snapping);
285
285
  }.bind(this);
286
- this.__isDecelerating = mt(t, o, r);
286
+ this.__isDecelerating = ft(t, o, r);
287
287
  }
288
288
  __stepThroughDeceleration(e) {
289
289
  let t = this.__scrollLeft + this.__decelerationVelocityX, n = this.__scrollTop + this.__decelerationVelocityY;
@@ -299,19 +299,19 @@ class fn {
299
299
  }
300
300
  }
301
301
  }
302
- var Q = typeof window < "u" ? window : { screen: {}, navigator: {} }, we = (Q.matchMedia || function() {
302
+ var Q = typeof window < "u" ? window : { screen: {}, navigator: {} }, Se = (Q.matchMedia || function() {
303
303
  return { matches: !1 };
304
- }).bind(Q), Tt = !1, gn = { get passive() {
304
+ }).bind(Q), Tt = !1, wn = { get passive() {
305
305
  return Tt = !0;
306
- } }, ft = function() {
306
+ } }, gt = function() {
307
307
  };
308
- Q.addEventListener && Q.addEventListener("p", ft, gn), Q.removeEventListener && Q.removeEventListener("p", ft, !1);
309
- var yn = Tt, vn = "PointerEvent" in Q, nt = "ontouchstart" in Q, Mt = nt || "TouchEvent" in Q && we("(any-pointer: coarse)").matches, gt = (Q.navigator.maxTouchPoints || 0) > 0 || Mt, Dt = Q.navigator.userAgent || "", xn = we("(pointer: coarse)").matches && /iPad|Macintosh/.test(Dt) && Math.min(Q.screen.width || 0, Q.screen.height || 0) >= 768, Pt = (we("(pointer: coarse)").matches || !we("(pointer: fine)").matches && nt) && !/Windows.*Firefox/.test(Dt), bn = we("(any-pointer: fine)").matches || we("(any-hover: hover)").matches || xn || !nt, Ze = !gt || !bn && Pt ? gt ? "touchOnly" : "mouseOnly" : "hybrid", wn = Ze === "mouseOnly" ? "mouse" : Ze === "touchOnly" || Pt ? "touch" : "mouse";
310
- const Sn = Object.freeze(Object.defineProperty({ __proto__: null, deviceType: Ze, primaryInput: wn, supportsPassiveEvents: yn, supportsPointerEvents: vn, supportsTouchEvents: Mt }, Symbol.toStringTag, { value: "Module" })), Ln = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), zt = {};
311
- function Ge() {
312
- return Sn;
308
+ Q.addEventListener && Q.addEventListener("p", gt, wn), Q.removeEventListener && Q.removeEventListener("p", gt, !1);
309
+ var bn = Tt, Sn = "PointerEvent" in Q, ot = "ontouchstart" in Q, Mt = ot || "TouchEvent" in Q && Se("(any-pointer: coarse)").matches, yt = (Q.navigator.maxTouchPoints || 0) > 0 || Mt, Dt = Q.navigator.userAgent || "", Ln = Se("(pointer: coarse)").matches && /iPad|Macintosh/.test(Dt) && Math.min(Q.screen.width || 0, Q.screen.height || 0) >= 768, Pt = (Se("(pointer: coarse)").matches || !Se("(pointer: fine)").matches && ot) && !/Windows.*Firefox/.test(Dt), Cn = Se("(any-pointer: fine)").matches || Se("(any-hover: hover)").matches || Ln || !ot, Ge = !yt || !Cn && Pt ? yt ? "touchOnly" : "mouseOnly" : "hybrid", En = Ge === "mouseOnly" ? "mouse" : Ge === "touchOnly" || Pt ? "touch" : "mouse";
310
+ const Tn = Object.freeze(Object.defineProperty({ __proto__: null, deviceType: Ge, primaryInput: En, supportsPassiveEvents: bn, supportsPointerEvents: Sn, supportsTouchEvents: Mt }, Symbol.toStringTag, { value: "Module" })), Mn = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), zt = {};
311
+ function qe() {
312
+ return Tn;
313
313
  }
314
- const kt = (i) => i === "BracketLeft" ? "[" : i === "BracketRight" ? "]" : te.camelToPrettyCase(i), io = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: zt, boundPixel: function(i, e = !1, t = 0) {
314
+ const kt = (i) => i === "BracketLeft" ? "[" : i === "BracketRight" ? "]" : te.camelToPrettyCase(i), co = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: zt, boundPixel: function(i, e = !1, t = 0) {
315
315
  return i;
316
316
  }, createSyntheticEvent: (i) => {
317
317
  let e = !1, t = !1;
@@ -321,10 +321,10 @@ const kt = (i) => i === "BracketLeft" ? "[" : i === "BracketRight" ? "]" : te.ca
321
321
  t = !0, i.stopPropagation();
322
322
  }, isPropagationStopped: () => t, persist: () => {
323
323
  }, timeStamp: i.timeStamp, type: i.type };
324
- }, detectIt: Ge, focusableNodeNames: Ln, toPrettyKeyCode: kt }, Symbol.toStringTag, { value: "Module" })), Cn = [];
325
- function At(i, e, t = Cn) {
324
+ }, detectIt: qe, focusableNodeNames: Mn, toPrettyKeyCode: kt }, Symbol.toStringTag, { value: "Module" })), Dn = [];
325
+ function At(i, e, t = Dn) {
326
326
  const n = A(null);
327
- return tn(i, () => {
327
+ return nn(i, () => {
328
328
  if (!n.current) return;
329
329
  const o = n.current, r = e?.();
330
330
  if (!r || typeof r != "object") throw new Error("attributes must return a plain object of values");
@@ -336,63 +336,50 @@ function At(i, e, t = Cn) {
336
336
  return o;
337
337
  }, t), n;
338
338
  }
339
- const yt = (i) => L(tt, { ...i }), En = ({ width: i, height: e }) => L("div", { className: "corner", style: { minWidth: `${i}px`, width: `${i}px`, minHeight: `${e}px`, height: `${e}px` } }), Tn = Se(Le((i, e) => {
340
- const { children: t, viewport: n, onScrollViewport: o, showHorizontalScrollbar: r = !0, showVerticalScrollbar: s = !0, createScrollCorner: l = En, createHorizontalScrollbar: a = yt, createVerticalScrollbar: c = yt, style: h, touchElement: u, disableTouch: d, ...w } = i, b = T(o, [o]), x = At(e, () => ({ isScrollPane: () => !0 }), []), S = A(null);
339
+ const vt = (i) => L(nt, { ...i }), Pn = ({ width: i, height: e }) => L("div", { className: "corner", style: { minWidth: `${i}px`, width: `${i}px`, minHeight: `${e}px`, height: `${e}px` } }), zn = Le(Ce((i, e) => {
340
+ const { children: t, viewport: n, onScrollViewport: o, showHorizontalScrollbar: r = !0, showVerticalScrollbar: s = !0, createScrollCorner: l = Pn, createHorizontalScrollbar: a = vt, createVerticalScrollbar: c = vt, style: h, touchElement: u, disableTouch: d, ...b } = i, w = T(o, [o]), x = At(e, () => ({ isScrollPane: () => !0 }), []), S = A(null);
341
341
  V(() => {
342
342
  S.current && (S.current.__scrollTop === n?.top && S.current.__scrollLeft === n?.left || S.current.__isDecelerating || S.current?.scrollTo(n?.left, n?.top, !1));
343
343
  }, [n?.left, n?.top, u]);
344
- const P = R((p, C) => {
345
- b?.({ left: p, top: C });
346
- }, []), _ = R((p) => {
344
+ const P = H((p, C) => {
345
+ w?.({ left: p, top: C });
346
+ }, []), _ = H((p) => {
347
347
  S.current?.doTouchStart(p.touches, p.timeStamp);
348
- }, []), y = R((p) => {
348
+ }, []), y = H((p) => {
349
349
  p.preventDefault(), S.current?.doTouchMove(p.touches, p.timeStamp);
350
- }, []), f = R((p) => {
350
+ }, []), f = H((p) => {
351
351
  S.current?.doTouchEnd(p.timeStamp);
352
- }, []), k = R(({ containerWidth: p, containerHeight: C, totalWidth: m, totalHeight: E }) => {
352
+ }, []), k = H(({ containerWidth: p, containerHeight: C, totalWidth: m, totalHeight: E }) => {
353
353
  S.current.setDimensions(p, C, m, E);
354
354
  }, []);
355
355
  V(() => {
356
356
  const p = u ?? x.current;
357
- if (!d && Ge().supportsTouchEvents && p && n) {
357
+ if (!d && qe().supportsTouchEvents && p && n) {
358
358
  if (!S.current) {
359
359
  const C = { scrollingX: !0, scrollingY: !0, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
360
- S.current = new fn(P, C);
360
+ S.current = new xn(P, C);
361
361
  }
362
- Ge().supportsTouchEvents && (p.addEventListener("touchstart", _), p.addEventListener("touchend", f), p.addEventListener("touchmove", y)), k({ containerWidth: n?.width, containerHeight: n?.height, totalWidth: n?.totalWidth, totalHeight: n?.totalHeight });
362
+ qe().supportsTouchEvents && (p.addEventListener("touchstart", _), p.addEventListener("touchend", f), p.addEventListener("touchmove", y)), k({ containerWidth: n?.width, containerHeight: n?.height, totalWidth: n?.totalWidth, totalHeight: n?.totalHeight });
363
363
  }
364
364
  return () => {
365
365
  p?.removeEventListener("touchstart", _), p?.removeEventListener("touchend", f), p?.removeEventListener("touchmove", y);
366
366
  };
367
367
  }, [n?.width, n?.height, n?.totalWidth, n?.totalHeight, d, u]);
368
- const [z, { width: O }] = fe(), [F, { height: g }] = fe(), v = N(() => {
368
+ const [z, { width: $ }] = ge(), [I, { height: g }] = ge(), v = W(() => {
369
369
  const p = c({ orientation: re.Vertical, offset: n?.top, viewportSize: n?.height, totalSize: n?.totalHeight, onScrollOffset: (C) => {
370
- b?.({ top: C });
370
+ w?.({ top: C });
371
371
  } });
372
372
  return L("div", { style: { display: "flex", flex: "0" }, ref: z, children: p });
373
- }, [c, n?.top, n?.height, n?.totalHeight]), B = N(() => {
374
- const p = a({ orientation: re.Horizontal, offset: n?.left, viewportSize: n?.width, totalSize: n?.totalWidth, onScrollOffset: (C) => b?.({ left: C }) });
375
- return be("div", { style: { display: "flex", flex: "none", flexDirection: "row", alignItems: "stretch", justifyContent: "center" }, children: [L("div", { style: { display: "flex", flex: "1 1 100%", flexDirection: "column", width: `calc(100% - ${O}px)` }, children: L("div", { ref: F, className: "sizer", children: p }) }), s ? l({ width: O, height: g }) : L(Me, {})] });
376
- }, [a, n?.left, n?.width, n?.totalWidth, s, l, O, g]);
377
- return L("div", { style: { position: "relative", display: "flex", minWidth: s ? `${O}px` : void 0, minHeight: r ? `${g}px` : void 0, ...h }, ...w, ref: x, children: be("div", { style: { position: "relative", width: "100%", flex: "1 1 100%", display: "flex", flexDirection: "column", boxSizing: "border-box" }, children: [be("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: [L("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: t }), s ? v : L(Me, {})] }), r ? B : L(Me, {})] }) });
373
+ }, [c, n?.top, n?.height, n?.totalHeight]), B = W(() => {
374
+ const p = a({ orientation: re.Horizontal, offset: n?.left, viewportSize: n?.width, totalSize: n?.totalWidth, onScrollOffset: (C) => w?.({ left: C }) });
375
+ return be("div", { style: { display: "flex", flex: "none", flexDirection: "row", alignItems: "stretch", justifyContent: "center" }, children: [L("div", { style: { display: "flex", flex: "1 1 100%", flexDirection: "column", width: `calc(100% - ${$}px)` }, children: L("div", { ref: I, className: "sizer", children: p }) }), s ? l({ width: $, height: g }) : L(De, {})] });
376
+ }, [a, n?.left, n?.width, n?.totalWidth, s, l, $, g]);
377
+ return L("div", { style: { position: "relative", display: "flex", minWidth: s ? `${$}px` : void 0, minHeight: r ? `${g}px` : void 0, ...h }, ...b, ref: x, children: be("div", { style: { position: "relative", width: "100%", flex: "1 1 100%", display: "flex", flexDirection: "column", boxSizing: "border-box" }, children: [be("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: [L("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: t }), s ? v : L(De, {})] }), r ? B : L(De, {})] }) });
378
378
  }));
379
- Tn.displayName = "ScrollPane";
380
- const vt = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" }, xt = /* @__PURE__ */ new Set(), Bt = { showMessage: (i, e) => {
381
- if (e?.onceKey) {
382
- if (xt.has(e.onceKey)) return;
383
- xt.add(e.onceKey);
384
- }
385
- let t = console.log;
386
- e?.type !== vt.Warning && e?.type !== vt.Error || (t = console.warn), t(i);
387
- }, showBusy: (i, e) => new Promise((t) => {
388
- t(() => {
389
- });
390
- }), showError: (i) => {
391
- console.error(i);
392
- } };
393
- let ke = 0;
394
- function ro() {
395
- const [i, e] = G(!!document.fullscreenElement), t = R(() => {
379
+ zn.displayName = "ScrollPane";
380
+ let Ae = 0;
381
+ function ho() {
382
+ const [i, e] = G(!!document.fullscreenElement), t = H(() => {
396
383
  const n = document.fullscreenElement;
397
384
  return n ? n.querySelector(".fullscreen-portal-root") || n : document.body;
398
385
  }, []);
@@ -403,47 +390,47 @@ function ro() {
403
390
  let r = o.querySelector(".fullscreen-portal-root");
404
391
  r || (r = document.createElement("div"), r.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", o.appendChild(r));
405
392
  }
406
- return ke++, n(), document.addEventListener("fullscreenchange", n), () => {
407
- document.removeEventListener("fullscreenchange", n), ke--, ke <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((o) => {
393
+ return Ae++, n(), document.addEventListener("fullscreenchange", n), () => {
394
+ document.removeEventListener("fullscreenchange", n), Ae--, Ae <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((o) => {
408
395
  o.parentNode && o.parentNode.removeChild(o);
409
- }), ke = 0);
396
+ }), Ae = 0);
410
397
  };
411
398
  }, []), { getPortalContainer: t, isFullscreen: i };
412
399
  }
413
- const Mn = 100, Dn = 100, Pn = 1e6, zn = 100, kn = 50, An = Se(Le((i, e) => {
414
- const { offset: t = 0, viewportSize: n = 0, totalSize: o = 0, minSize: r = 0, endGap: s = Mn, endScrollIncrement: l = Dn, style: a = zt, onMouseDown: c, onScrollOffset: h, onScroll: u, scaleLimit: d = Pn, scaleFactor: w = zn, precisionFactor: b = kn, ...x } = i;
400
+ const kn = 100, An = 100, Bn = 1e6, On = 100, $n = 50, Kn = Le(Ce((i, e) => {
401
+ const { offset: t = 0, viewportSize: n = 0, totalSize: o = 0, minSize: r = 0, endGap: s = kn, endScrollIncrement: l = An, style: a = zt, onMouseDown: c, onScrollOffset: h, onScroll: u, scaleLimit: d = Bn, scaleFactor: b = On, precisionFactor: w = $n, ...x } = i;
415
402
  u && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
416
- const S = T(c, [c]), P = () => ({ offset: t, totalSize: d === 0 ? o : Math.min(o ?? 0, Math.max(r ?? 0, (t ?? 0) + (n ?? 0)) + (s ?? 0)) }), [_, y] = G(P), f = d !== 0 && _.totalSize > d ? w : 1, k = f / b, z = Math.ceil(_.totalSize / f), O = Math.ceil(_.offset / f), F = Math.ceil(n / f), g = R((D) => {
403
+ const S = T(c, [c]), P = () => ({ offset: t, totalSize: d === 0 ? o : Math.min(o ?? 0, Math.max(r ?? 0, (t ?? 0) + (n ?? 0)) + (s ?? 0)) }), [_, y] = G(P), f = d !== 0 && _.totalSize > d ? b : 1, k = f / w, z = Math.ceil(_.totalSize / f), $ = Math.ceil(_.offset / f), I = Math.ceil(n / f), g = H((D) => {
417
404
  }, []), [v, B] = G(!1), p = A(null);
418
- Ve(() => {
405
+ Ie(() => {
419
406
  if (!v) {
420
407
  p.current = { propTotalSize: o, propViewportSize: n, propOffset: t };
421
408
  const D = P();
422
409
  y(D);
423
410
  }
424
411
  }, [o, n, t, v, r, s, l]);
425
- const C = T((D, q, W) => {
412
+ const C = T((D, q, F) => {
426
413
  const Y = p.current;
427
- p.current = null, Y && Y.propTotalSize === o && Y.propViewportSize === n && Y.propOffset === t || (Math.abs(D - O) < k && (D = O), h?.(D * f, O, F));
428
- }, [h, f, k, O, F]), m = R((D) => {
414
+ p.current = null, Y && Y.propTotalSize === o && Y.propViewportSize === n && Y.propOffset === t || (Math.abs(D - $) < k && (D = $), h?.(D * f, $, I));
415
+ }, [h, f, k, $, I]), m = H((D) => {
429
416
  document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", m), B(!1);
430
- }, []), E = R((D) => {
417
+ }, []), E = H((D) => {
431
418
  S?.(D), B(!0), document.addEventListener("mousemove", g, { passive: !0 }), document.addEventListener("mouseup", m, { passive: !0 });
432
419
  }, [g, m]);
433
- return L(tt, { ref: e, style: { ...a }, ...x, offset: O, totalSize: z, viewportSize: F, onMouseDown: E, onScrollOffset: C });
420
+ return L(nt, { ref: e, style: { ...a }, ...x, offset: $, totalSize: z, viewportSize: I, onMouseDown: E, onScrollOffset: C });
434
421
  }));
435
- An.displayName = "VirtualScrollbar";
436
- const so = { 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" };
437
- function We(i, e) {
422
+ Kn.displayName = "VirtualScrollbar";
423
+ const uo = { 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" };
424
+ function Ye(i, e) {
438
425
  if (typeof i == "function") return i(e);
439
426
  i && (i.current = e);
440
427
  }
441
- var He = parseInt(nn.split(".")[0], 10) >= 19 ? function(i) {
428
+ var He = parseInt(on.split(".")[0], 10) >= 19 ? function(i) {
442
429
  return (e) => {
443
430
  const t = [];
444
431
  for (const n of i) {
445
- const o = We(n, e), r = typeof o == "function";
446
- t.push(r ? o : () => We(n, null));
432
+ const o = Ye(n, e), r = typeof o == "function";
433
+ t.push(r ? o : () => Ye(n, null));
447
434
  }
448
435
  return () => {
449
436
  for (const n of t) n();
@@ -451,11 +438,11 @@ var He = parseInt(nn.split(".")[0], 10) >= 19 ? function(i) {
451
438
  };
452
439
  } : function(i) {
453
440
  return (e) => {
454
- for (const t of i) We(t, e);
441
+ for (const t of i) Ye(t, e);
455
442
  };
456
443
  };
457
- const lo = Se(Le((i, e) => {
458
- const { refFocusStart: t, ...n } = i, o = A(null), r = R(() => {
444
+ const po = Le(Ce((i, e) => {
445
+ const { refFocusStart: t, ...n } = i, o = A(null), r = H(() => {
459
446
  if (t) return void t?.current?.focus();
460
447
  const s = o.current.parentElement.children;
461
448
  let l = [];
@@ -470,13 +457,13 @@ const lo = Se(Le((i, e) => {
470
457
  }), l[0].child.focus());
471
458
  }, [t]);
472
459
  return L("div", { tabIndex: 0, ref: He([o, e]), onFocus: r, ...n });
473
- })), ao = Se(Le((i, e) => {
474
- const { className: t, style: n, children: o, radius: r = 4, strokeWidth: s = 1, strokeColor: l = "grey", ...a } = i, [c, { width: h, height: u }] = fe(), d = A(null), w = (P, _ = 0) => {
460
+ })), _o = Le(Ce((i, e) => {
461
+ const { className: t, style: n, children: o, radius: r = 4, strokeWidth: s = 1, strokeColor: l = "grey", ...a } = i, [c, { width: h, height: u }] = ge(), d = A(null), b = (P, _ = 0) => {
475
462
  const y = P / 2, f = u - y + _;
476
- return (function(k, z, O = !1) {
463
+ return (function(k, z, $ = !1) {
477
464
  if (z === 0) return k;
478
- function F(m, E, D) {
479
- let q = E.x - m.x, W = E.y - m.y, Y = Math.sqrt(q * q + W * W);
465
+ function I(m, E, D) {
466
+ let q = E.x - m.x, F = E.y - m.y, Y = Math.sqrt(q * q + F * F);
480
467
  return g(m, E, Math.min(1, D / Y));
481
468
  }
482
469
  function g(m, E, D) {
@@ -498,13 +485,13 @@ const lo = Se(Le((i, e) => {
498
485
  let m = B(p[0]), E = null;
499
486
  p[p.length - 1][0] === "Z" && p[0].length > 2 && (E = ["L", m.x, m.y], p[p.length - 1] = E), C.push(p[0]);
500
487
  for (let D = 1; D < p.length; D++) {
501
- let q = C[C.length - 1], W = p[D], Y = W === E ? p[1] : p[D + 1];
502
- if (Y && q && q.length > 2 && W[0] === "L" && Y.length > 2 && Y[0] === "L") {
503
- let X, $, I = B(q), j = B(W), ne = B(Y);
504
- O ? (X = g(j, q.origPoint || I, z), $ = g(j, Y.origPoint || ne, z)) : (X = F(j, I, z), $ = F(j, ne, z)), v(W, X), W.origPoint = j, C.push(W);
505
- let ge = g(X, j, 0.5), ye = g(j, $, 0.5), K = ["C", ge.x, ge.y, ye.x, ye.y, $.x, $.y];
488
+ let q = C[C.length - 1], F = p[D], Y = F === E ? p[1] : p[D + 1];
489
+ if (Y && q && q.length > 2 && F[0] === "L" && Y.length > 2 && Y[0] === "L") {
490
+ let X, O, N = B(q), j = B(F), ne = B(Y);
491
+ $ ? (X = g(j, q.origPoint || N, z), O = g(j, Y.origPoint || ne, z)) : (X = I(j, N, z), O = I(j, ne, z)), v(F, X), F.origPoint = j, C.push(F);
492
+ let ye = g(X, j, 0.5), ve = g(j, O, 0.5), K = ["C", ye.x, ye.y, ve.x, ve.y, O.x, O.y];
506
493
  K.origPoint = j, C.push(K);
507
- } else C.push(W);
494
+ } else C.push(F);
508
495
  }
509
496
  if (E) {
510
497
  let D = B(C[C.length - 1]);
@@ -515,61 +502,103 @@ const lo = Se(Le((i, e) => {
515
502
  return m + E.join(" ") + " ";
516
503
  }, "");
517
504
  })(`${`M 0 ${y} L ${r - 0.5} ${y} L ${r - 0.5} ${f} L ${2 * r} ${f}`} ${`L ${h - 2 * r} ${f}`} ${`M ${h - 2 * r} ${f} L ${h - r} ${f} L ${h - r} ${y} L ${h} ${y}`}`, r);
518
- }, b = N(() => w(s), [h, u, r, s]), x = N(() => {
505
+ }, w = W(() => b(s), [h, u, r, s]), x = W(() => {
519
506
  if (r === 0) return;
520
507
  const P = r / 2;
521
- return w(r) + `L ${h} 0 L 0 0 L 0 ${P}`;
522
- }, [b, r, s]), S = N(() => ({ style: { clipPath: `path('${x}')` } }), [x]);
523
- return be("div", { className: t, style: { display: "flex", flexDirection: "row", ...n }, ...a, ref: He([d, c, e]), children: [me.isValidElement(o) ? me.cloneElement(o, S) : L(Me, {}), L("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: h, height: u, viewBox: `0 0 ${h} ${u}`, children: L("path", { d: b, stroke: l, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: s }) })] });
524
- })), Bn = {}, $n = (i) => {
525
- const { onPointerDown: e, style: t, splitDirection: n, paddingBefore: o = 0, paddingAfter: r = 0, disabled: s, key: l, hitAreaProps: a = Bn, ...c } = i, h = n === "row", { style: u, className: d, ...w } = a;
526
- return L("div", { style: { ...t, position: "relative" }, ...c, children: L("div", { className: ve("hit-box", d), style: { left: (h ? -o : 0) + "px", width: `calc(100% + ${h ? o + r : 0}px)`, top: (h ? 0 : -o) + "px", height: `calc(100% + ${h ? 0 : o + r}px)`, position: "absolute", ...u }, onPointerDown: s ? void 0 : e, ...w }) }, l);
527
- }, Ae = {}, _e = (i, e, t = !0) => i === null ? null : i.pixels !== null ? t ? i.pixels : e - i.pixels : (t ? i.percent : 100 - i.percent) / 100 * e, Be = (i, e = !0) => i?.percent ? `${e ? i.percent : 100 - i.percent}%` : i?.pixels ? `${i.pixels}px` : void 0, ue = (i, e) => {
508
+ return b(r) + `L ${h} 0 L 0 0 L 0 ${P}`;
509
+ }, [w, r, s]), S = W(() => ({ style: { clipPath: `path('${x}')` } }), [x]);
510
+ return be("div", { className: t, style: { display: "flex", flexDirection: "row", ...n }, ...a, ref: He([d, c, e]), children: [ce.isValidElement(o) ? ce.cloneElement(o, S) : L(De, {}), L("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: h, height: u, viewBox: `0 0 ${h} ${u}`, children: L("path", { d: w, stroke: l, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: s }) })] });
511
+ })), Rn = {}, Hn = (i) => {
512
+ const { onPointerDown: e, style: t, splitDirection: n, paddingBefore: o = 0, paddingAfter: r = 0, disabled: s, key: l, hitAreaProps: a = Rn, ...c } = i, h = n === "row", { style: u, className: d, ...b } = a;
513
+ return L("div", { style: { ...t, position: "relative" }, ...c, children: L("div", { className: xe("hit-box", d), style: { left: (h ? -o : 0) + "px", width: `calc(100% + ${h ? o + r : 0}px)`, top: (h ? 0 : -o) + "px", height: `calc(100% + ${h ? 0 : o + r}px)`, position: "absolute", ...u }, onPointerDown: s ? void 0 : e, ...b }) }, l);
514
+ }, Be = {}, me = (i, e, t = !0) => i === null ? null : i.pixels !== null ? t ? i.pixels : e - i.pixels : (t ? i.percent : 100 - i.percent) / 100 * e, Oe = (i, e = !0) => i?.percent ? `${e ? i.percent : 100 - i.percent}%` : i?.pixels ? `${i.pixels}px` : void 0, de = (i, e) => {
528
515
  if (i == null) return null;
529
516
  const t = { percent: null, pixels: null };
530
517
  let n = e;
531
518
  return typeof i == "string" && ((i = i.trim().toLowerCase()).endsWith("px") ? (i = i.substring(0, i.length - 2), n = !1) : i.endsWith("%") && (i = i.substring(0, i.length - 1), n = !0), i = parseFloat(i)), n ? t.percent = i : t.pixels = i, Object.freeze(t);
532
- }, co = Se(Le((i, e) => {
533
- const { elementBefore: t, elementAfter: n, splitDirection: o = "row", fixedPane: r = null, position: s, onPositionChange: l, minBefore: a, maxBefore: c, minAfter: h, maxAfter: u, children: d, className: w, style: b, disabled: x = !1, onDragStart: S, onDragResize: P, onDragFinish: _, resizerProps: y = Ae, paneProps: f = Ae, paneBeforeProps: k = Ae, paneAfterProps: z = Ae, createResizer: O = $n } = i;
519
+ }, mo = Le(Ce((i, e) => {
520
+ const { elementBefore: t, elementAfter: n, splitDirection: o = "row", fixedPane: r = null, position: s, onPositionChange: l, minBefore: a, maxBefore: c, minAfter: h, maxAfter: u, children: d, className: b, style: w, disabled: x = !1, onDragStart: S, onDragResize: P, onDragFinish: _, resizerProps: y = Be, paneProps: f = Be, paneBeforeProps: k = Be, paneAfterProps: z = Be, createResizer: $ = Hn } = i;
534
521
  if (d) throw new Error("Use elementBefore and elementAfter instead of children.");
535
- const F = N(() => me.isValidElement(n) && me.isValidElement(t), [n, t]), g = N(() => {
522
+ const I = W(() => ce.isValidElement(n) && ce.isValidElement(t), [n, t]), g = W(() => {
536
523
  let M = null;
537
524
  r && (r === "before" ? M = 0 : r === "after" && (M = 1));
538
- const H = M === null;
539
- return { fixedPaneOffset: M, isPercent: H, minBefore: ue(a, H), maxBefore: ue(c, H), minAfter: ue(h, H), maxAfter: ue(u, H) };
540
- }, [a, c, h, u]), v = T(l, [l]), [B, p] = G(() => ue(s, r === null));
525
+ const R = M === null;
526
+ return { fixedPaneOffset: M, isPercent: R, minBefore: de(a, R), maxBefore: de(c, R), minAfter: de(h, R), maxAfter: de(u, R) };
527
+ }, [a, c, h, u]), v = T(l, [l]), [B, p] = G(() => de(s, r === null));
541
528
  V(() => {
542
- p(ue(s, r === null));
529
+ p(de(s, r === null));
543
530
  }, [s, r]);
544
- const [C, { width: m, height: E }] = fe(), [D, { width: q, height: W }] = fe(), Y = o === "row" ? q : W, X = o === "row" ? m : E, $ = N(() => ((M, H, J, U) => {
531
+ const [C, { width: m, height: E }] = ge(), [D, { width: q, height: F }] = ge(), Y = o === "row" ? q : F, X = o === "row" ? m : E, O = W(() => ((M, R, J, U) => {
545
532
  const ae = [null, null], oe = [null, null];
546
- if (M || (M = { percent: U.fixedPaneOffset === null ? 50 : null, pixels: U.fixedPaneOffset === null ? null : 0 }), H === 0) return M?.pixels != null ? U.fixedPaneOffset !== 1 ? (ae[0] = M?.pixels, oe[1] = 100) : (ae[1] = M?.pixels - J, oe[0] = 100) : M?.percent != null && (U.fixedPaneOffset !== 1 ? (oe[0] = M?.percent, oe[1] = 100 - M?.percent) : (oe[1] = M?.percent, oe[0] = 100 - M?.percent)), { percents: oe, pixels: ae, minBefore: Be(U.minBefore, !0), maxBefore: Be(U.maxBefore, !0), minAfter: Be(U.minAfter), maxAfter: Be(U.maxAfter) };
547
- let he = _e(M, H, U.fixedPaneOffset !== 1), ee = H - J, ct = _e(U.minBefore, ee, !0) ?? 0, Qt = _e(U.maxBefore, ee, !0) ?? ee, ze = 0, Fe = 0, ht = 0, ut = ee;
548
- ze = (_e(U.maxAfter, H, !1) ?? J) - J, Fe = _e(U.minAfter, H, !1) ?? H, ht = Math.max(ct, ze), ut = Math.min(Qt, Fe), he = Math.max(ht, Math.min(he, ut)), Fe = Math.min(ee - he, _e(U.maxAfter, ee - he, !0) ?? ee), ze = Math.min(ee - he, _e(U.minAfter, ee - he, !0) ?? ee), ae[0] = he, ae[1] = ee - ae[0];
549
- const en = Math.max(0, Math.min(100, he / ee * 100));
550
- return oe[0] = en, oe[1] = 100 - oe[0], { percents: oe, pixels: ae, minBefore: `${ct}px`, minAfter: `${ze}px`, maxBefore: `${ae[0]}px`, maxAfter: `${ae[1]}px` };
551
- })(B, X, Y, g), [g, B, X, Y, o]), [I, j] = G(!1), ne = T(S, [S]), ge = T(P, [P]), ye = T(_, [_]), K = A(null), se = A(null), ie = A(null), { style: pe, className: le, ...ce } = f, Ce = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", display: "flex", overflow: "hidden", ...pe }, { className: Rt, style: Vt, ...Ft } = k, { className: It, style: Nt, ...Wt } = z, Yt = { flex: "1 1 100%", width: "100%", ...b, flexDirection: o, display: "flex" }, { className: ot, style: it, onPointerDown: rt, ...st } = y, Xt = T((M) => {
552
- const H = ue(M, r === null);
553
- p(H);
554
- }, [r]), De = T((M) => {
555
- if (x || !I) return;
556
- const H = at.current?.getBoundingClientRect();
533
+ if (M || (M = { percent: U.fixedPaneOffset === null ? 50 : null, pixels: U.fixedPaneOffset === null ? null : 0 }), R === 0) return M?.pixels != null ? U.fixedPaneOffset !== 1 ? (ae[0] = M?.pixels, oe[1] = 100) : (ae[1] = M?.pixels - J, oe[0] = 100) : M?.percent != null && (U.fixedPaneOffset !== 1 ? (oe[0] = M?.percent, oe[1] = 100 - M?.percent) : (oe[1] = M?.percent, oe[0] = 100 - M?.percent)), { percents: oe, pixels: ae, minBefore: Oe(U.minBefore, !0), maxBefore: Oe(U.maxBefore, !0), minAfter: Oe(U.minAfter), maxAfter: Oe(U.maxAfter) };
534
+ let ue = me(M, R, U.fixedPaneOffset !== 1), ee = R - J, ht = me(U.minBefore, ee, !0) ?? 0, en = me(U.maxBefore, ee, !0) ?? ee, ke = 0, Ne = 0, ut = 0, dt = ee;
535
+ ke = (me(U.maxAfter, R, !1) ?? J) - J, Ne = me(U.minAfter, R, !1) ?? R, ut = Math.max(ht, ke), dt = Math.min(en, Ne), ue = Math.max(ut, Math.min(ue, dt)), Ne = Math.min(ee - ue, me(U.maxAfter, ee - ue, !0) ?? ee), ke = Math.min(ee - ue, me(U.minAfter, ee - ue, !0) ?? ee), ae[0] = ue, ae[1] = ee - ae[0];
536
+ const tn = Math.max(0, Math.min(100, ue / ee * 100));
537
+ return oe[0] = tn, oe[1] = 100 - oe[0], { percents: oe, pixels: ae, minBefore: `${ht}px`, minAfter: `${ke}px`, maxBefore: `${ae[0]}px`, maxAfter: `${ae[1]}px` };
538
+ })(B, X, Y, g), [g, B, X, Y, o]), [N, j] = G(!1), ne = T(S, [S]), ye = T(P, [P]), ve = T(_, [_]), K = A(null), se = A(null), ie = A(null), { style: _e, className: le, ...he } = f, Ee = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", display: "flex", overflow: "hidden", ..._e }, { className: Vt, style: It, ...Nt } = k, { className: Wt, style: Ft, ...Yt } = z, Xt = { flex: "1 1 100%", width: "100%", ...w, flexDirection: o, display: "flex" }, { className: it, style: rt, onPointerDown: st, ...lt } = y, jt = T((M) => {
539
+ const R = de(M, r === null);
540
+ p(R);
541
+ }, [r]), Pe = T((M) => {
542
+ if (x || !N) return;
543
+ const R = ct.current?.getBoundingClientRect();
557
544
  let J = 0;
558
- J = o === "row" ? (M.clientX ?? M.touches?.[0]?.clientX) - H.x : (M.clientY ?? M.touches?.[0]?.clientY) - H.y, J = Math.max(0, Math.min(X, J)), g.fixedPaneOffset === 1 && (J = X - J), s && B.pixels === J || p({ pixels: J, percent: null }), ge?.(J), M.stopPropagation(), M.preventDefault();
559
- }, [g, o, x, I, B, X]), lt = T((M) => {
560
- if (document.removeEventListener("pointermove", De), document.removeEventListener("touchmove", De), document.removeEventListener("pointerup", lt), !!I && (j(!1), !!B)) {
561
- if (ye(B.pixels), !ue(s, r === null) || B.pixels !== s) {
562
- const H = { ...B };
563
- H.percent === null && (H.percent = H.pixels / X * 100), v(H);
545
+ J = o === "row" ? (M.clientX ?? M.touches?.[0]?.clientX) - R.x : (M.clientY ?? M.touches?.[0]?.clientY) - R.y, J = Math.max(0, Math.min(X, J)), g.fixedPaneOffset === 1 && (J = X - J), s && B.pixels === J || p({ pixels: J, percent: null }), ye?.(J), M.stopPropagation(), M.preventDefault();
546
+ }, [g, o, x, N, B, X]), at = T((M) => {
547
+ if (document.removeEventListener("pointermove", Pe), document.removeEventListener("touchmove", Pe), document.removeEventListener("pointerup", at), !!N && (j(!1), !!B)) {
548
+ if (ve(B.pixels), !de(s, r === null) || B.pixels !== s) {
549
+ const R = { ...B };
550
+ R.percent === null && (R.percent = R.pixels / X * 100), v(R);
564
551
  }
565
552
  M.stopPropagation(), M.preventDefault();
566
553
  }
567
- }, [B, I, s, r, X]), jt = T((M) => {
568
- rt?.(M), M.defaultPrevented || x || I || (j(!0), ne(), document.addEventListener("pointermove", De, { passive: !1 }), document.addEventListener("touchmove", De, { passive: !1 }), document.addEventListener("pointerup", lt, { passive: !1 }));
569
- }, [rt]), at = At(e, () => ({ setPosition: Xt, isSplitPane: () => !0 }), []), Ut = N(() => F ? O?.({ key: "resizer", ref: He([D, se]), className: ve("resizer", ot), onPointerDownCapture: jt, style: { cursor: x ? void 0 : o === "row" ? "ew-resize" : "ns-resize", minWidth: o === "row" ? "2px" : void 0, minHeight: o !== "row" ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...it }, splitDirection: o, disabled: x, ...st }) : null, [F, ot, st, o, it, x]), Pe = o === "row" ? "Width" : "Height", Zt = { ...Ce, ...Vt, flex: g.fixedPaneOffset === 0 && $?.pixels[0] !== null ? `0 0 ${Math.round($?.pixels[0])}px` : `1 1 ${Math.round($?.percents[0] ?? 100)}%`, [`min${Pe}`]: $?.minBefore, [`max${Pe}`]: n ? $?.maxBefore : "100%" }, Gt = { ...Ce, ...Nt, flex: g.fixedPaneOffset === 1 && $?.pixels[1] !== null ? `0 0 ${Math.round($?.pixels[1])}px` : `1 1 ${Math.round($?.percents[1] ?? 100)}%`, [`min${Pe}`]: $?.minAfter, [`max${Pe}`]: t ? $?.maxAfter : "100%" }, qt = N(() => t ? L("div", { ref: K, className: ve("before", le, Rt), style: Zt, ...ce, ...Ft, children: t }, "before") : null, [t, f, k, g, $]), Jt = N(() => n ? L("div", { ref: ie, className: ve("after", le, It), style: Gt, ...ce, ...Wt, children: n }, "after") : null, [n, f, z, g, $]);
570
- return be("div", { ref: He([C, at]), className: ve("splitPane", o === "row" ? "vertical" : "horizontal", { dragging: I }, w), style: Yt, children: [qt, Ut, Jt] });
571
- }));
572
- function ho(i) {
554
+ }, [B, N, s, r, X]), Ut = T((M) => {
555
+ st?.(M), M.defaultPrevented || x || N || (j(!0), ne(), document.addEventListener("pointermove", Pe, { passive: !1 }), document.addEventListener("touchmove", Pe, { passive: !1 }), document.addEventListener("pointerup", at, { passive: !1 }));
556
+ }, [st]), ct = At(e, () => ({ setPosition: jt, isSplitPane: () => !0 }), []), Zt = W(() => I ? $?.({ key: "resizer", ref: He([D, se]), className: xe("resizer", it), onPointerDownCapture: Ut, style: { cursor: x ? void 0 : o === "row" ? "ew-resize" : "ns-resize", minWidth: o === "row" ? "2px" : void 0, minHeight: o !== "row" ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...rt }, splitDirection: o, disabled: x, ...lt }) : null, [I, it, lt, o, rt, x]), ze = o === "row" ? "Width" : "Height", Gt = { ...Ee, ...It, flex: g.fixedPaneOffset === 0 && O?.pixels[0] !== null ? `0 0 ${Math.round(O?.pixels[0])}px` : `1 1 ${Math.round(O?.percents[0] ?? 100)}%`, [`min${ze}`]: O?.minBefore, [`max${ze}`]: n ? O?.maxBefore : "100%" }, qt = { ...Ee, ...Ft, flex: g.fixedPaneOffset === 1 && O?.pixels[1] !== null ? `0 0 ${Math.round(O?.pixels[1])}px` : `1 1 ${Math.round(O?.percents[1] ?? 100)}%`, [`min${ze}`]: O?.minAfter, [`max${ze}`]: t ? O?.maxAfter : "100%" }, Jt = W(() => t ? L("div", { ref: K, className: xe("before", le, Vt), style: Gt, ...he, ...Nt, children: t }, "before") : null, [t, f, k, g, O]), Qt = W(() => n ? L("div", { ref: ie, className: xe("after", le, Wt), style: qt, ...he, ...Yt, children: n }, "after") : null, [n, f, z, g, O]);
557
+ return be("div", { ref: He([C, ct]), className: xe("splitPane", o === "row" ? "vertical" : "horizontal", { dragging: N }, b), style: Xt, children: [Jt, Zt, Qt] });
558
+ })), xt = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" };
559
+ class Vn extends cn {
560
+ setDelegate(e) {
561
+ super.setDelegate(e);
562
+ }
563
+ getDelegate() {
564
+ return this._delegate;
565
+ }
566
+ showMessage(e, t) {
567
+ const n = this.getDelegate();
568
+ if (n?.showMessage) return n.showMessage(e, t);
569
+ t?.type !== xt.Warning ? t?.type !== xt.Error ? fe.log(e) : fe.error(e) : fe.warn(e);
570
+ }
571
+ showBusy(e, t) {
572
+ const n = this.getDelegate();
573
+ return n?.showBusy ? n.showBusy(e, t) : new Promise((o) => {
574
+ o(() => {
575
+ });
576
+ });
577
+ }
578
+ showWindow(e, t, n) {
579
+ const o = this.getDelegate();
580
+ if (o?.showWindow) return o.showWindow(e, t, n);
581
+ }
582
+ showError(e) {
583
+ const t = this.getDelegate();
584
+ t?.showError ? t.showError(e) : fe.error(e);
585
+ }
586
+ showOptions(e) {
587
+ const t = this.getDelegate();
588
+ return t?.showOptions ? t.showOptions(e) : Promise.resolve("");
589
+ }
590
+ showInputOptions(e) {
591
+ const t = this.getDelegate();
592
+ return t?.showInputOptions ? t.showInputOptions(e) : Promise.resolve({ input: "", option: "" });
593
+ }
594
+ }
595
+ const Bt = rn(new Vn()), fo = ({ children: i, notifier: e }) => (ce.useEffect(() => {
596
+ const t = fe.getDelegate();
597
+ return fe.setDelegate(e), () => {
598
+ fe.setDelegate(t);
599
+ };
600
+ }, [e]), ce.createElement(Bt.Provider, { value: e }, i)), Ot = () => sn(Bt);
601
+ function go(i) {
573
602
  const [e, t] = G(typeof window < "u" ? window.devicePixelRatio : 1), n = A(null);
574
603
  return V(() => {
575
604
  if (!(typeof window < "u" && "matchMedia" in window)) return;
@@ -582,12 +611,12 @@ function ho(i) {
582
611
  };
583
612
  }, [i]), e;
584
613
  }
585
- function uo(i) {
614
+ function yo(i) {
586
615
  if (typeof window > "u") return 1;
587
616
  const { defaultDpr: e = 1, maxDpr: t = 3, round: n = !0 } = i || {}, o = typeof window < "u" && typeof window.devicePixelRatio == "number" ? window.devicePixelRatio : e;
588
617
  return Math.min(Math.max(1, n ? Math.floor(o) : o), t);
589
618
  }
590
- function po(i, e, t) {
619
+ function vo(i, e, t) {
591
620
  const n = T(e, [e]);
592
621
  V(() => {
593
622
  const o = (r) => {
@@ -598,108 +627,108 @@ function po(i, e, t) {
598
627
  };
599
628
  }, [i]);
600
629
  }
601
- function On(i) {
630
+ function In(i) {
602
631
  if (!i) throw new Error("must have a PointerHandlerOptions");
603
- const { onPointerDown: e, onPointerUp: t, onPointerMoveOrWait: n, processTouch: o = !1, consumeTouch: r = !0 } = i, s = T(e, [e]), l = T(t, [t]), a = T(n, [n]), c = A(!1), h = i?.timerInitial ?? 230, u = i?.timerContinuous ?? h / 2, d = A(null), w = A(null), b = A(null), x = A(null), S = R(() => {
632
+ const { onPointerDown: e, onPointerUp: t, onPointerMoveOrWait: n, processTouch: o = !1, consumeTouch: r = !0 } = i, s = T(e, [e]), l = T(t, [t]), a = T(n, [n]), c = A(!1), h = i?.timerInitial ?? 230, u = i?.timerContinuous ?? h / 2, d = A(null), b = A(null), w = A(null), x = A(null), S = H(() => {
604
633
  x.current && (clearTimeout(x.current), x.current = null);
605
- }, []), P = R((v) => {
634
+ }, []), P = H((v) => {
606
635
  x.current = setTimeout(() => {
607
636
  window.requestAnimationFrame(() => {
608
- c.current !== !1 && a?.(w.current, b.current, d.current);
637
+ c.current !== !1 && a?.(b.current, w.current, d.current);
609
638
  }), P(u);
610
639
  }, v ?? h);
611
640
  }, []);
612
641
  V(() => () => S(), []);
613
- const _ = o ? "pointer" : "mouse", y = R((v) => {
642
+ const _ = o ? "pointer" : "mouse", y = H((v) => {
614
643
  v.stopPropagation(), v.stopImmediatePropagation(), v.preventDefault();
615
644
  }, []), f = T((v) => {
616
- document.removeEventListener(`${_}move`, O), document.removeEventListener(`${_}up`, f), document.removeEventListener("keydown", F), document.removeEventListener("keyup", g), document.removeEventListener("touchstart", y, { capture: !0 }), document.removeEventListener("touchmove", y, { capture: !0 }), window.removeEventListener("blur", k), S(), window.requestAnimationFrame(() => {
617
- c.current !== !1 && (c.current = !1, l?.(v, b.current, d.current), b.current = null);
645
+ document.removeEventListener(`${_}move`, $), document.removeEventListener(`${_}up`, f), document.removeEventListener("keydown", I), document.removeEventListener("keyup", g), document.removeEventListener("touchstart", y, { capture: !0 }), document.removeEventListener("touchmove", y, { capture: !0 }), window.removeEventListener("blur", k), S(), window.requestAnimationFrame(() => {
646
+ c.current !== !1 && (c.current = !1, l?.(v, w.current, d.current), w.current = null);
618
647
  });
619
- }, []), k = R(() => {
620
- c.current !== !1 && (c.current = !1, f(w.current));
648
+ }, []), k = H(() => {
649
+ c.current !== !1 && (c.current = !1, f(b.current));
621
650
  }, []), z = T(() => {
622
651
  S(), P(u), window.requestAnimationFrame(() => {
623
- c.current !== !1 && a?.(w.current, b.current, d.current);
652
+ c.current !== !1 && a?.(b.current, w.current, d.current);
624
653
  });
625
- }, [u]), O = T((v) => {
626
- w.current = v, z();
627
- }, []), F = T((v) => {
628
- b.current = { ctrlKey: v.ctrlKey, shiftKey: v.shiftKey, altKey: v.altKey, metaKey: v.metaKey }, z();
654
+ }, [u]), $ = T((v) => {
655
+ b.current = v, z();
656
+ }, []), I = T((v) => {
657
+ w.current = { ctrlKey: v.ctrlKey, shiftKey: v.shiftKey, altKey: v.altKey, metaKey: v.metaKey }, z();
629
658
  }, []), g = T((v) => {
630
- b.current = { ctrlKey: v.ctrlKey, shiftKey: v.shiftKey, altKey: v.altKey, metaKey: v.metaKey }, z();
659
+ w.current = { ctrlKey: v.ctrlKey, shiftKey: v.shiftKey, altKey: v.altKey, metaKey: v.metaKey }, z();
631
660
  }, [u]);
632
661
  return T((v) => {
633
- v.isDefaultPrevented() || (b.current = { ctrlKey: v.ctrlKey, shiftKey: v.shiftKey, altKey: v.altKey, metaKey: v.metaKey }, s(v, b.current) !== !1 && (d.current = v, w.current = v.nativeEvent, document.addEventListener(`${_}up`, f, { passive: !1 }), document.addEventListener(`${_}move`, O, { passive: !1 }), document.addEventListener("keydown", F, { passive: !1 }), document.addEventListener("keyup", g, { passive: !1 }), window.addEventListener("blur", k, { passive: !0 }), o && r && (document.addEventListener("touchstart", y, { passive: !1, capture: !0 }), document.addEventListener("touchmove", y, { passive: !1, capture: !0 })), c.current = !0, P(h)));
662
+ v.isDefaultPrevented() || (w.current = { ctrlKey: v.ctrlKey, shiftKey: v.shiftKey, altKey: v.altKey, metaKey: v.metaKey }, s(v, w.current) !== !1 && (d.current = v, b.current = v.nativeEvent, document.addEventListener(`${_}up`, f, { passive: !1 }), document.addEventListener(`${_}move`, $, { passive: !1 }), document.addEventListener("keydown", I, { passive: !1 }), document.addEventListener("keyup", g, { passive: !1 }), window.addEventListener("blur", k, { passive: !0 }), o && r && (document.addEventListener("touchstart", y, { passive: !1, capture: !0 }), document.addEventListener("touchmove", y, { passive: !1, capture: !0 })), c.current = !0, P(h)));
634
663
  }, [h, o]);
635
664
  }
636
- function _o(i, e) {
637
- return On({ onPointerDown: i, onPointerMoveOrWait: (t, n, o) => {
665
+ function xo(i, e) {
666
+ return In({ onPointerDown: i, onPointerMoveOrWait: (t, n, o) => {
638
667
  i?.(o);
639
668
  }, ...e });
640
669
  }
641
- const Kn = ({ initValue: i, useHookBody: e, applyStateChange: t }) => {
670
+ const Nn = ({ initValue: i, useHookBody: e, applyStateChange: t }) => {
642
671
  const n = A(i);
643
672
  if (typeof e != "function") throw new Error("function expected as hook body parameter. got " + typeof e);
644
673
  const o = e();
645
- return Ve(() => {
674
+ return Ie(() => {
646
675
  n.current !== o && (n.current = o, t(o));
647
676
  }, [t, o]), null;
648
- }, qe = (i) => {
677
+ }, Je = (i) => {
649
678
  console && console.warn && console.warn(i);
650
- }, Ye = typeof self == "object" && self.self === self && self || typeof global == "object" && global.global === global && global || void 0;
651
- let Hn = 1, Je = !1, $t = !1;
652
- const Oe = [], xe = [], Re = () => {
653
- xe.forEach((i) => i());
654
- }, Rn = ({ automaticContainerInternalUseOnly: i }) => {
679
+ }, Xe = typeof self == "object" && self.self === self && self || typeof global == "object" && global.global === global && global || void 0;
680
+ let Wn = 1, Qe = !1, $t = !1;
681
+ const Ke = [], we = [], Ve = () => {
682
+ we.forEach((i) => i());
683
+ }, Fn = ({ automaticContainerInternalUseOnly: i }) => {
655
684
  const [e, t] = G([]), n = A([]);
656
- return n.current = e, i || Je !== !1 || ($t = !0), V(() => {
685
+ return n.current = e, i || Qe !== !1 || ($t = !0), V(() => {
657
686
  let o = !0;
658
687
  function r() {
659
- if (o) return xe[0] !== r ? (i || Je !== !0 || qe("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void t((s) => [])) : void t([...Oe]);
688
+ if (o) return we[0] !== r ? (i || Qe !== !0 || Je("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void t((s) => [])) : void t([...Ke]);
660
689
  }
661
- return xe.push(r), Re(), () => {
662
- o = !1, n.current?.length > 0 && qe("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), xe.splice(xe.indexOf(r), 1), Re();
690
+ return we.push(r), Ve(), () => {
691
+ o = !1, n.current?.length > 0 && Je("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), we.splice(we.indexOf(r), 1), Ve();
663
692
  };
664
- }, [i]), L(Me, { children: e.map(({ hook: o, key: r }) => on(Kn, { ...o, key: r })) });
665
- }, Vn = (i) => {
666
- const e = Hn++;
667
- return Oe.push({ hook: i, key: e }), xe.length === 0 && $t === !1 && (Je = !0, ((t) => {
668
- if (Ye.document && Ye.document.createElement) {
669
- const n = Ye.document.createElement("div");
670
- sn(n).render(L(t, { automaticContainerInternalUseOnly: !0 }));
671
- } else qe("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
672
- })(Rn)), Re(), () => {
673
- Oe.splice(Oe.findIndex((t) => t.key === e), 1), Re();
693
+ }, [i]), L(De, { children: e.map(({ hook: o, key: r }) => ln(Nn, { ...o, key: r })) });
694
+ }, Yn = (i) => {
695
+ const e = Wn++;
696
+ return Ke.push({ hook: i, key: e }), we.length === 0 && $t === !1 && (Qe = !0, ((t) => {
697
+ if (Xe.document && Xe.document.createElement) {
698
+ const n = Xe.document.createElement("div");
699
+ hn(n).render(L(t, { automaticContainerInternalUseOnly: !0 }));
700
+ } else Je("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
701
+ })(Fn)), Ve(), () => {
702
+ Ke.splice(Ke.findIndex((t) => t.key === e), 1), Ve();
674
703
  };
675
704
  };
676
- let Qe = null;
677
- Qe || (Qe = (i, e, t = {}) => {
705
+ let et = null;
706
+ et || (et = (i, e, t = {}) => {
678
707
  let n, o, r = !1, s = !1, l = [], { unmountIfNoConsumers: a = !1 } = t;
679
708
  const c = (u) => {
680
- o = u, ln(() => l.forEach((d) => d(u)));
709
+ o = u, un(() => l.forEach((d) => d(u)));
681
710
  }, h = () => (s || (o = typeof i == "function" ? i() : i, s = !0), o);
682
711
  return () => {
683
712
  const [u, d] = G(h);
684
- return V(() => (r || (r = !0, n = Vn({ initValue: i, useHookBody: e, applyStateChange: c })), l.push(d), o !== u && d(o), () => {
713
+ return V(() => (r || (r = !0, n = Yn({ initValue: i, useHookBody: e, applyStateChange: c })), l.push(d), o !== u && d(o), () => {
685
714
  l.splice(l.indexOf(d), 1), l.length === 0 && a && (n(), r = !1);
686
715
  }), []), u;
687
716
  };
688
717
  });
689
- const Ot = Qe;
690
- let Kt = () => {
718
+ const Kt = et;
719
+ let Rt = () => {
691
720
  console.warn("You must call useEditMode before setting its state.");
692
721
  };
693
- const Fn = Ot(null, () => {
722
+ const Xn = Kt(null, () => {
694
723
  const [i, e] = G(null);
695
- return Kt = e, i;
696
- }), mo = () => {
697
- const i = Fn();
698
- return N(() => ({ setMode: (e) => {
699
- Kt((t) => (typeof e == "function" && (e = e(t)), e?.onModeChange?.(e ?? null), e));
724
+ return Rt = e, i;
725
+ }), wo = () => {
726
+ const i = Xn();
727
+ return W(() => ({ setMode: (e) => {
728
+ Rt((t) => (typeof e == "function" && (e = e(t)), e?.onModeChange?.(e ?? null), e));
700
729
  }, getMode: () => i }), [i]);
701
730
  };
702
- class et {
731
+ class tt {
703
732
  constructor(e, t, n, o) {
704
733
  this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key = e, this._target = t, this._applyProps(n || {}), this._callback = o, o === void 0 && (this._callback = () => {
705
734
  console.log(`implement: ${this.label()} : ${this.description()}`);
@@ -810,7 +839,7 @@ class et {
810
839
  }), t;
811
840
  }
812
841
  }
813
- class Xe extends et {
842
+ class je extends tt {
814
843
  }
815
844
  class Ht {
816
845
  constructor(e, t) {
@@ -869,9 +898,9 @@ class Ht {
869
898
  s.set(a, u);
870
899
  const d = a.shortcut();
871
900
  if (!d) continue;
872
- const w = Array.isArray(d) ? d : [d];
873
- for (let b = 0; b < w.length; b++) {
874
- const x = Te(w[b]), S = o.get(x);
901
+ const b = Array.isArray(d) ? d : [d];
902
+ for (let w = 0; w < b.length; w++) {
903
+ const x = Me(b[w]), S = o.get(x);
875
904
  S && !t && t === void 0 && console.warn(`Shortcut already registered: ${x}, ${c}, ${S}.`), o.set(x, c);
876
905
  }
877
906
  }
@@ -906,10 +935,10 @@ class Ht {
906
935
  findCommandByEvent(e) {
907
936
  const t = [];
908
937
  e.altKey && t.push(Z.Alt), e.shiftKey && t.push(Z.Shift), e.ctrlKey && t.push(Z.Ctrl), e.metaKey && t.push(Z.Meta);
909
- let n = Te({ key: e.code, modifiers: t });
938
+ let n = Me({ key: e.code, modifiers: t });
910
939
  const o = this._commandsByShortcut;
911
940
  let r = o.get(n);
912
- r || (n = Te({ key: e.key, modifiers: t }), r = o.get(n)), !r && e.code.startsWith("Digit") && (n = Te({ key: e.code.substring(5, e.code.length), modifiers: t }), r = this._commandsByShortcut.get(n)), !r && e.code.startsWith("Key") && (r = Te({ key: e.code.substring(3, e.code.length), modifiers: t }), r = o.get(n));
941
+ r || (n = Me({ key: e.key, modifiers: t }), r = o.get(n)), !r && e.code.startsWith("Digit") && (n = Me({ key: e.code.substring(5, e.code.length), modifiers: t }), r = this._commandsByShortcut.get(n)), !r && e.code.startsWith("Key") && (r = Me({ key: e.code.substring(3, e.code.length), modifiers: t }), r = o.get(n));
913
942
  let s = null;
914
943
  return r && (s = this._commandsByKey.get(r), s && s.disabled() && (s = null), !s || s.target() && s.target().contains(e.target) || (s = null)), s || (this._parent?.findCommandByEvent(e) ?? null);
915
944
  }
@@ -966,16 +995,16 @@ class Ht {
966
995
  }), e;
967
996
  }
968
997
  }
969
- const In = te.getOS() === te.OSType.MacOS || te.getOS() === te.OSType.IOS ? "Cmd" : "Ctrl", Nn = te.getOS() === te.OSType.MacOS || te.getOS() === te.OSType.IOS ? "⌘" : "^", Te = (i, e = !1) => {
998
+ const jn = te.getOS() === te.OSType.MacOS || te.getOS() === te.OSType.IOS ? "Cmd" : "Ctrl", Un = te.getOS() === te.OSType.MacOS || te.getOS() === te.OSType.IOS ? "⌘" : "^", Me = (i, e = !1) => {
970
999
  const t = {};
971
1000
  for (let o = 0; i.modifiers && o < i.modifiers.length; o++) t[i.modifiers[o]] = !0;
972
1001
  let n = "";
973
- return (t?.[Z.Ctrl] || t?.[Z.Meta]) && (n += (n.length > 0 ? "+" : "") + (e ? Nn : In)), t?.[Z.Alt] && (n += e ? "⌥" : "Alt"), t?.[Z.Shift] && (n += (n.length > 0 ? "+" : "") + (e ? "⇧" : "Shift")), n += (n.length > 0 ? "+" : "") + kt(i.key), n;
1002
+ return (t?.[Z.Ctrl] || t?.[Z.Meta]) && (n += (n.length > 0 ? "+" : "") + (e ? Un : jn)), t?.[Z.Alt] && (n += e ? "⌥" : "Alt"), t?.[Z.Shift] && (n += (n.length > 0 ? "+" : "") + (e ? "⇧" : "Shift")), n += (n.length > 0 ? "+" : "") + kt(i.key), n;
974
1003
  };
975
- function fo(i, e = null) {
1004
+ function bo(i, e = null) {
976
1005
  const t = A(e);
977
1006
  t.current = e;
978
- const [n, o] = rn((s) => s + 1, 0), r = N(() => Array.isArray(i) ? i : [i], [i]);
1007
+ const [n, o] = an((s) => s + 1, 0), r = W(() => Array.isArray(i) ? i : [i], [i]);
979
1008
  return V(() => {
980
1009
  if (!r || r.length === 0) return;
981
1010
  const s = (c, h) => {
@@ -1004,7 +1033,7 @@ const $e = (i, e) => {
1004
1033
  }
1005
1034
  return t;
1006
1035
  };
1007
- function go(i, e = null, t = null, n) {
1036
+ function So(i, e = null, t = null, n) {
1008
1037
  const o = A(t);
1009
1038
  o.current = t, e && !Array.isArray(e) && (e = [e]);
1010
1039
  const [r, s] = G($e(i, e)), l = n ? [...n, i] : [i];
@@ -1014,7 +1043,7 @@ function go(i, e = null, t = null, n) {
1014
1043
  s(d), o.current?.onChange?.(this);
1015
1044
  } };
1016
1045
  let c;
1017
- e && e.length > 0 && (c = { keys: e }, a.onCommandChange = (d, w) => {
1046
+ e && e.length > 0 && (c = { keys: e }, a.onCommandChange = (d, b) => {
1018
1047
  o.current?.onChange?.(i), s($e(i, e));
1019
1048
  });
1020
1049
  const h = i?.addListener(a, c), u = $e(i, e);
@@ -1023,19 +1052,19 @@ function go(i, e = null, t = null, n) {
1023
1052
  };
1024
1053
  }, l), r;
1025
1054
  }
1026
- const yo = { Toolbar: "toolbar", Menuitem: "menuitem" }, Wn = Ot({ setClipboard: (i) => {
1055
+ const Lo = { Toolbar: "toolbar", Menuitem: "menuitem" }, Zn = Kt({ setClipboard: (i) => {
1027
1056
  throw new Error("This is only available via the useClipboard.");
1028
- }, getClipboard: () => Ke.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
1029
- const [i, e] = G(Ke.Global);
1057
+ }, getClipboard: () => Re.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
1058
+ const [i, e] = G(Re.Global);
1030
1059
  return { setClipboard: (t) => e(t), getClipboard: () => i, refNativeCopy: A(null), refNativeLastKey: A(null) };
1031
- }), vo = (i) => {
1032
- const { source: e, target: t, onPaste: n, onClipboardUpdate: o, notifier: r = Bt, commands: s } = i, l = T(o, [o]), a = T(n, [n]), { getClipboard: c, refNativeCopy: h } = Wn(), u = c();
1033
- N(() => {
1060
+ }), Co = (i) => {
1061
+ const { source: e, target: t, onPaste: n, onClipboardUpdate: o, commands: r } = i, s = Ot(), l = T(o, [o]), a = T(n, [n]), { getClipboard: c, refNativeCopy: h } = Zn(), u = c();
1062
+ W(() => {
1034
1063
  const _ = e?.element, y = t?.element ?? e?.element;
1035
- if (!s) return;
1036
- const f = [new Xe("cut", _, { label: "Cut", description: "Remove the selection and put it on the clipboard so you can paste it somewhere else.", shortcut: { key: "X", modifiers: [Z.Ctrl] } }), new Xe("copy", _, { label: "Copy", description: "Put a copy of the selection on the clipboard so you can paste it somewhere else.", shortcut: { key: "C", modifiers: [Z.Ctrl] } }), new Xe("paste", y, { label: "Paste", description: "Add content on the clipboard to your document.", shortcut: [{ key: "V", modifiers: [Z.Ctrl] }, { key: "F8", modifiers: [Z.Ctrl] }] })];
1037
- s?.addCommands(f, !0);
1038
- }, [s]);
1064
+ if (!r) return;
1065
+ const f = [new je("cut", _, { label: "Cut", description: "Remove the selection and put it on the clipboard so you can paste it somewhere else.", shortcut: { key: "X", modifiers: [Z.Ctrl] } }), new je("copy", _, { label: "Copy", description: "Put a copy of the selection on the clipboard so you can paste it somewhere else.", shortcut: { key: "C", modifiers: [Z.Ctrl] } }), new je("paste", y, { label: "Paste", description: "Add content on the clipboard to your document.", shortcut: [{ key: "V", modifiers: [Z.Ctrl] }, { key: "F8", modifiers: [Z.Ctrl] }] })];
1066
+ r?.addCommands(f, !0);
1067
+ }, [r]);
1039
1068
  const d = T(async (_) => {
1040
1069
  if (!e?.element) return;
1041
1070
  let y = null;
@@ -1044,82 +1073,82 @@ const yo = { Toolbar: "toolbar", Menuitem: "menuitem" }, Wn = Ot({ setClipboard:
1044
1073
  } catch (f) {
1045
1074
  throw f;
1046
1075
  }
1047
- }, [e, r]), w = T(async (_) => {
1076
+ }, [e, s]), b = T(async (_) => {
1048
1077
  const y = e?.element?.();
1049
1078
  if (y) {
1050
1079
  h.current = { sourceElement: y, args: _ };
1051
1080
  try {
1052
1081
  await d(_);
1053
1082
  } catch (f) {
1054
- r?.showError?.(f);
1083
+ s.showError?.(f);
1055
1084
  }
1056
1085
  }
1057
- }, [e?.element, r]), b = R(() => {
1058
- w({ isCut: !0 });
1086
+ }, [e?.element, s]), w = H(() => {
1087
+ b({ isCut: !0 });
1059
1088
  }, []), x = T(async (_, y, f) => {
1060
1089
  try {
1061
1090
  if (await _.doPaste(y, f) === !1) return;
1062
1091
  a?.(y, f);
1063
1092
  } catch (k) {
1064
- r?.showError?.(k);
1093
+ s.showError?.(k);
1065
1094
  }
1066
1095
  }, [a]), S = T(async (_, y, f) => {
1067
1096
  const k = t?.element?.();
1068
1097
  if (k && await te.whenFocus(k), !_ && !y) return;
1069
- const z = await r?.showBusy?.("Pasting...");
1098
+ const z = await s.showBusy?.("Pasting...");
1070
1099
  if (y) try {
1071
1100
  return await x(t, y, f), void z?.();
1072
1101
  } catch (g) {
1073
- z?.(), r?.showError?.(g);
1102
+ z?.(), s.showError?.(g);
1074
1103
  }
1075
- let O, F = t.importFromExternal;
1076
- F || (F = (g, v) => ({ getItemType: () => "text", toText: () => _.text, isClipboardItem: !0 }));
1104
+ let $, I = t.importFromExternal;
1105
+ I || (I = (g, v) => ({ getItemType: () => "text", toText: () => _.text, isClipboardItem: !0 }));
1077
1106
  try {
1078
- O = await F(_, { isCut: !1 });
1107
+ $ = await I(_, { isCut: !1 });
1079
1108
  } catch (g) {
1080
- z?.(), r?.showError?.(g);
1109
+ z?.(), s.showError?.(g);
1081
1110
  }
1082
- if (O) try {
1083
- const g = await Promise.resolve(O);
1111
+ if ($) try {
1112
+ const g = await Promise.resolve($);
1084
1113
  await x(t, g, f), z?.();
1085
1114
  } catch (g) {
1086
- z?.(), r?.showError?.(g);
1115
+ z?.(), s.showError?.(g);
1087
1116
  }
1088
1117
  else z?.();
1089
- }, [x, t, r]), P = T(async (_) => {
1118
+ }, [x, t, s]), P = T(async (_) => {
1090
1119
  if (t?.element) try {
1091
1120
  const y = await u.readReference();
1092
1121
  if (y) return void await S(null, y, _);
1093
1122
  const f = [];
1094
- f[0] = await Ie.readStringFromClipboard(u, Ne.plain), f[1] = await Ie.readHTMLFromClipboard(u, Ne.html), f[2] = await Ie.readBlobFromClipboard(u, Ne.png);
1123
+ f[0] = await We.readStringFromClipboard(u, Fe.plain), f[1] = await We.readHTMLFromClipboard(u, Fe.html), f[2] = await We.readBlobFromClipboard(u, Fe.png);
1095
1124
  const k = { text: f[0] ?? null, html: f[1] ?? null, image: f[2] ?? null };
1096
1125
  await S(k, null, _);
1097
1126
  } catch (y) {
1098
1127
  if (y?.message === "Document is not focused.") return;
1099
- r?.showError?.(y);
1128
+ s.showError?.(y);
1100
1129
  }
1101
- }, [S, t?.element, r]);
1130
+ }, [S, t?.element, s]);
1102
1131
  return T(async (_) => {
1103
1132
  }, [e?.element]), T(async (_) => {
1104
- }, [t?.element, S, r]), V(() => {
1133
+ }, [t?.element, S, s]), V(() => {
1105
1134
  if (!u) return;
1106
1135
  const _ = async (k) => {
1107
1136
  const z = await u.readReference();
1108
1137
  l?.(z);
1109
1138
  }, y = (k) => {
1110
- r?.showMessage?.(Ke.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
1139
+ s.showMessage?.(Re.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
1111
1140
  }, f = (k) => {
1112
- r?.showMessage?.(Ke.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
1141
+ s.showMessage?.(Re.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
1113
1142
  };
1114
1143
  return u.addEventListener("clipboardchange", _), u.addEventListener("clipboarderrorread", y), u.addEventListener("clipboarderrorwrite", f), () => {
1115
1144
  u.removeEventListener("clipboardchange", _), u.removeEventListener("clipboarderrorread", y), u.removeEventListener("clipboarderrorwrite", f);
1116
1145
  };
1117
- }, [u, r]), V(() => {
1146
+ }, [u, s]), V(() => {
1118
1147
  }, [d, S, e, t]), V(() => {
1119
- s?.getCommand("cut")?.updateCallback(b).update({ disabled: !e || !t }), s?.getCommand("copy")?.updateCallback(w).update({ disabled: !e }), s?.getCommand("paste")?.updateCallback(P).update({ disabled: !t });
1120
- }, [e, t, s]), { paste: P, copy: w, clipboard: u };
1148
+ r?.getCommand("cut")?.updateCallback(w).update({ disabled: !e || !t }), r?.getCommand("copy")?.updateCallback(b).update({ disabled: !e }), r?.getCommand("paste")?.updateCallback(P).update({ disabled: !t });
1149
+ }, [e, t, r]), { paste: P, copy: b, clipboard: u };
1121
1150
  };
1122
- function xo(i, e = !0) {
1151
+ function Eo(i, e = !0) {
1123
1152
  const t = A(i);
1124
1153
  V(() => {
1125
1154
  if (e) {
@@ -1129,33 +1158,33 @@ function xo(i, e = !0) {
1129
1158
  t.current = i;
1130
1159
  });
1131
1160
  }
1132
- let je = !1, Yn = 0;
1133
- var Xn = typeof document < "u" ? Ve : V;
1134
- const bt = () => "sheetxl-ui-" + Yn++, wt = me.useId, bo = wt ?? function() {
1135
- const [i, e] = me.useState(() => je ? bt() : void 0);
1136
- return Xn(() => {
1137
- i == null && e(bt());
1138
- }, []), me.useEffect(() => {
1139
- je || (je = !0);
1161
+ let Ue = !1, Gn = 0;
1162
+ var qn = typeof document < "u" ? Ie : V;
1163
+ const wt = () => "sheetxl-ui-" + Gn++, bt = ce.useId, To = bt ?? function() {
1164
+ const [i, e] = ce.useState(() => Ue ? wt() : void 0);
1165
+ return qn(() => {
1166
+ i == null && e(wt());
1167
+ }, []), ce.useEffect(() => {
1168
+ Ue || (Ue = !0);
1140
1169
  }, []), i;
1141
- }, St = "Undo the last action.", Lt = "Repeat the last action or undo the redo.", jn = (i) => `Redo ${i}`, wo = ({ manager: i, commands: e, disabled: t, notifier: n = Bt }) => {
1142
- const o = T((s) => {
1170
+ }, St = "Undo the last action.", Lt = "Repeat the last action or undo the redo.", Jn = (i) => `Redo ${i}`, Mo = ({ manager: i, commands: e, disabled: t }) => {
1171
+ const n = Ot(), o = T((s) => {
1143
1172
  try {
1144
1173
  i?.undo(s);
1145
1174
  } catch (l) {
1146
- n.showError?.(l);
1175
+ n.error(l);
1147
1176
  }
1148
1177
  }, [i]), r = T((s) => {
1149
1178
  try {
1150
1179
  i?.redo(s);
1151
1180
  } catch (l) {
1152
- n.showError?.(l);
1181
+ n.error(l);
1153
1182
  }
1154
1183
  }, [i]);
1155
- return N(() => {
1184
+ return W(() => {
1156
1185
  if (!e) return;
1157
1186
  const s = { contains: (a) => !0, focus() {
1158
- } }, l = [new et("undo", s, { label: "Undo", description: St, shortcut: { key: "z", modifiers: [Z.Ctrl] }, disabled: !0 }, o), new et("redo", s, { label: "Redo", description: Lt, shortcut: [{ key: "y", modifiers: [Z.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [Z.Alt] }], disabled: !0 }, r)];
1187
+ } }, l = [new tt("undo", s, { label: "Undo", description: St, shortcut: { key: "z", modifiers: [Z.Ctrl] }, disabled: !0 }, o), new tt("redo", s, { label: "Redo", description: Lt, shortcut: [{ key: "y", modifiers: [Z.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [Z.Alt] }], disabled: !0 }, r)];
1159
1188
  e?.addCommands(l, !0);
1160
1189
  }, [e]), V(() => {
1161
1190
  if (!e) return;
@@ -1164,7 +1193,7 @@ const bt = () => "sheetxl-ui-" + Yn++, wt = me.useId, bo = wt ?? function() {
1164
1193
  var h;
1165
1194
  e.getCommand("undo").update({ disabled: t || !i || !i.hasUndo(), description: a ? (h = a, `Undo ${h}`) : St, state: c, context: { undoManager: i } });
1166
1195
  const u = i?.getTopRedoDescription();
1167
- e.getCommand("redo").update({ disabled: t || !i || !i.hasRedo(), description: u ? jn(u) : Lt, state: c, context: { undoManager: i } });
1196
+ e.getCommand("redo").update({ disabled: t || !i || !i.hasRedo(), description: u ? Jn(u) : Lt, state: c, context: { undoManager: i } });
1168
1197
  };
1169
1198
  if (s(), !i) return;
1170
1199
  const l = i.addListener({ onStackChange() {
@@ -1174,47 +1203,49 @@ const bt = () => "sheetxl-ui-" + Yn++, wt = me.useId, bo = wt ?? function() {
1174
1203
  }, [i, e, t]), { undo: o, redo: r };
1175
1204
  };
1176
1205
  export {
1177
- et as Command,
1178
- yo as CommandButtonType,
1206
+ tt as Command,
1207
+ Lo as CommandButtonType,
1179
1208
  Ht as CommandGroup,
1180
- Bt as DefaultNotifier,
1181
- lo as FocusKeyNavigation,
1182
- Qn as HorizontalAlignment,
1183
- eo as KeyCodes,
1209
+ Vn as DelegatingReactNotifier,
1210
+ po as FocusKeyNavigation,
1211
+ io as HorizontalAlignment,
1212
+ ro as KeyCodes,
1184
1213
  Z as KeyModifiers,
1185
- to as MouseButtonCodes,
1186
- vt as NotificationType,
1187
- io as ReactUtils,
1188
- ao as RoundedTab,
1189
- Tn as ScrollPane,
1190
- oo as ScrollUtils,
1191
- tt as Scrollbar,
1214
+ so as MouseButtonCodes,
1215
+ fo as NotifierProvider,
1216
+ xt as NotifierType,
1217
+ co as ReactUtils,
1218
+ _o as RoundedTab,
1219
+ zn as ScrollPane,
1220
+ ao as ScrollUtils,
1221
+ nt as Scrollbar,
1192
1222
  re as ScrollbarOrientation,
1193
- Xe as SimpleCommand,
1194
- co as SplitPane,
1195
- $n as SplitPaneResizer,
1196
- so as ToolTipPlacement,
1197
- An as VirtualScrollbar,
1198
- En as defaultCreateScrollCorner,
1199
- no as defaultCreateScrollEdgeButton,
1200
- un as defaultCreateScrollEndButton,
1201
- hn as defaultCreateScrollStartButton,
1202
- yt as defaultCreateScrollbar,
1203
- uo as getDevicePixelRatio,
1204
- Te as toShortcutString,
1223
+ je as SimpleCommand,
1224
+ mo as SplitPane,
1225
+ Hn as SplitPaneResizer,
1226
+ uo as ToolTipPlacement,
1227
+ Kn as VirtualScrollbar,
1228
+ Pn as defaultCreateScrollCorner,
1229
+ lo as defaultCreateScrollEdgeButton,
1230
+ mn as defaultCreateScrollEndButton,
1231
+ _n as defaultCreateScrollStartButton,
1232
+ vt as defaultCreateScrollbar,
1233
+ yo as getDevicePixelRatio,
1234
+ Me as toShortcutString,
1205
1235
  T as useCallbackRef,
1206
- fo as useCommand,
1207
- go as useCommands,
1208
- vo as useCopyPaste,
1209
- ho as useDevicePixelRatio,
1210
- mo as useEditMode,
1211
- ro as useFullscreenPortal,
1212
- Wn as useGlobalClipboard,
1213
- bo as useId,
1236
+ bo as useCommand,
1237
+ So as useCommands,
1238
+ Co as useCopyPaste,
1239
+ go as useDevicePixelRatio,
1240
+ wo as useEditMode,
1241
+ ho as useFullscreenPortal,
1242
+ Zn as useGlobalClipboard,
1243
+ To as useId,
1214
1244
  At as useImperativeElement,
1215
- _o as useMouseDownAndHoldListener,
1216
- po as useOnClickOrFocusAway,
1217
- On as useSynchronizedPointerHandler,
1218
- xo as useTraceUpdate,
1219
- wo as useUndoManager
1245
+ xo as useMouseDownAndHoldListener,
1246
+ Ot as useNotifier,
1247
+ vo as useOnClickOrFocusAway,
1248
+ In as useSynchronizedPointerHandler,
1249
+ Eo as useTraceUpdate,
1250
+ Mo as useUndoManager
1220
1251
  };