@sheetxl/utils-react 0.7.5 → 0.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/browser/cjs/Bb5sSoT2rOCEdJUD.cjs +6 -0
- package/browser/cjs/index.cjs +3 -3
- package/browser/esm/DG6oB4sgLAgJaOve.mjs +12 -0
- package/browser/esm/index.mjs +1176 -846
- package/node/assets/style.css +1 -1
- package/node/esm/Cq6QyR2iVPDVSg3n.mjs +12 -0
- package/node/esm/index.mjs +704 -371
- package/package.json +2 -2
- package/types/index.d.ts +244 -10
package/browser/esm/index.mjs
CHANGED
|
@@ -1,769 +1,720 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
4
|
-
import { CommonUtils as
|
|
5
|
-
import { createRoot as
|
|
6
|
-
import { unstable_batchedUpdates as
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.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}:root{--icon-size-sm: .875rem;--icon-size-md: 1rem;--icon-size-lg: 1.25rem;--icon-size-xl: 1.5rem}._Icon_1ipwo_10{font-size:var(--icon-size, var(--icon-size-md));min-width:var(--icon-size, var(--icon-size-md));min-height:var(--icon-size, var(--icon-size-md));--icon-stroke-em: .085em;--icon-color: currentColor;--icon-secondary-color: color-mix(in oklab, currentColor 65%, transparent);--icon-tertiary-color: color-mix(in oklab, currentColor 40%, transparent);--icon-line-color: currentColor;--icon-main-opacity: 1;--icon-secondary-opacity: .45;--icon-tertiary-opacity: .25;--icon-line-opacity: 1;--icon-filter: none;filter:var(--icon-filter);display:inline-flex;align-items:center;justify-content:center;line-height:1;vertical-align:middle;flex:0 0 auto}._Icon_1ipwo_10 .sm{--font-size: var(--icon-size-sm)}._Icon_1ipwo_10 .md{--font-size: var(--icon-size-md)}._Icon_1ipwo_10 .lg{--font-size: var(--icon-size-lg)}._Icon_1ipwo_10 .xl{--font-size: var(--icon-size-xl)}._Icon_1ipwo_10>svg{width:var(--icon-size);height:var(--icon-size)}._Icon_1ipwo_10>img{aspect-ratio:1 / 1;display:block;line-height:1}._Icon_1ipwo_10 .fill,._Icon_1ipwo_10 .line{--layer-color: var(--icon-color);--layer-opacity: var(--icon-main-opacity)}._Icon_1ipwo_10 .secondary{--layer-color: var(--icon-secondary-color)}._Icon_1ipwo_10 .tertiary{--layer-color: var(--icon-tertiary-color)}._Icon_1ipwo_10 .primary{--layer-color: var(--sxl-app-color-primary, var(--icon-primary, #595b5e))}._Icon_1ipwo_10 .secondary{--layer-color: var(--sxl-app-color-secondary, #9c27b0)}._Icon_1ipwo_10 .secondary.light{--layer-color: var(--sxl-app-color-secondary-light, #a060ac)}._Icon_1ipwo_10 .success{--layer-color: var(--sxl-app-color-success, #22c55e)}._Icon_1ipwo_10 .success.light{--layer-color: var(--sxl-app-color-success-light, #22c55e)}._Icon_1ipwo_10 .info{--layer-color: var(--sxl-app-color-info, #3b82f6)}._Icon_1ipwo_10 .warn{--layer-color: var(--sxl-app-color-warn, #f59e0b)}._Icon_1ipwo_10 .error{--layer-color: var(--sxl-app-color-error, #ef4444)}._Icon_1ipwo_10 .error.light{--layer-color: var(--sxl-app-color-error-light, #f87171)}._Icon_1ipwo_10 .grey{--layer-color: var(--sxl-app-color-grey, #cccccc)}._Icon_1ipwo_10 .shadow{--layer-color: var(--sxl-app-color-shadow, #cccccc)}._Icon_1ipwo_10 .fill:not(.fixed){fill:var(--layer-color);opacity:var(--layer-opacity);stroke:none}._Icon_1ipwo_10 .line:not(.fixed){fill:none;stroke:var(--layer-color, var(--icon-line-color));stroke-width:var(--icon-stroke-em);opacity:var(--layer-opacity, var(--icon-line-opacity));vector-effect:non-scaling-stroke;pointer-events:none;stroke-linecap:var(--icon-linecap, round);stroke-linejoin:var(--icon-linejoin, round);stroke-miterlimit:var(--icon-miter, 4)}@media (prefers-color-scheme: dark){._Icon_1ipwo_10 .invert-dark{filter:invert(1) hue-rotate(180deg)}}._Icon_1ipwo_10 .muted{opacity:calc(var(--layer-opacity, 1) * .6)}@keyframes _sxl-walk_1ipwo_1{to{stroke-dashoffset:0}}.icon.walking .walkable.line{stroke-dasharray:var(--walk-dash-length, 5px) var(--walk-dash-gap, 2px);stroke-dashoffset:calc(var(--walk-dash-length, 5px) + var(--walk-dash-gap, 2px));animation:_sxl-walk_1ipwo_1 var(--walk-duration, .96s) linear infinite;will-change:stroke-dashoffset}")),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
+
import { jsx as S, jsxs as bt, Fragment as St } from "react/jsx-runtime";
|
|
3
|
+
import it, { useLayoutEffect as ne, useEffect as V, useState as J, useMemo as K, useCallback as R, useRef as z, memo as gt, forwardRef as Lt, useImperativeHandle as ln, version as an, createContext as cn, useContext as hn, createElement as un, useReducer as dn, Component as pn } from "react";
|
|
4
|
+
import { CommonUtils as G, DefaultNotifier as fn, Notifier as _t, InternalClipboard as Rt, ClipboardUtils as Wt, MimeType as jt } from "@sheetxl/utils";
|
|
5
|
+
import { createRoot as _n } from "react-dom/client";
|
|
6
|
+
import { unstable_batchedUpdates as mn } from "react-dom";
|
|
7
7
|
/**
|
|
8
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
8
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.7
|
|
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
|
|
14
|
-
function
|
|
15
|
-
var
|
|
13
|
+
const mo = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, X = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, go = { 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 }, yo = { Left: 1, Middle: 2, Right: 3 }, st = { Horizontal: "horizontal", Vertical: "vertical" };
|
|
14
|
+
function Ae(i) {
|
|
15
|
+
var t, e, n = "";
|
|
16
16
|
if (typeof i == "string" || typeof i == "number") n += i;
|
|
17
17
|
else if (typeof i == "object") if (Array.isArray(i)) {
|
|
18
18
|
var o = i.length;
|
|
19
|
-
for (
|
|
20
|
-
} else for (
|
|
19
|
+
for (t = 0; t < o; t++) i[t] && (e = Ae(i[t])) && (n && (n += " "), n += e);
|
|
20
|
+
} else for (e in i) i[e] && (n && (n += " "), n += e);
|
|
21
21
|
return n;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
for (var i,
|
|
23
|
+
function wt() {
|
|
24
|
+
for (var i, t, e = 0, n = "", o = arguments.length; e < o; e++) (i = arguments[e]) && (t = Ae(i)) && (n && (n += " "), n += t);
|
|
25
25
|
return n;
|
|
26
26
|
}
|
|
27
|
-
var
|
|
28
|
-
},
|
|
29
|
-
const
|
|
30
|
-
var i =
|
|
31
|
-
return new window.ResizeObserver(function(
|
|
32
|
-
if (
|
|
33
|
-
var
|
|
34
|
-
r({ x:
|
|
27
|
+
var gn = function() {
|
|
28
|
+
}, ze = typeof window < "u", yn = ze ? ne : V, _e = { x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, bottom: 0, right: 0 };
|
|
29
|
+
const mt = ze && window.ResizeObserver !== void 0 ? function() {
|
|
30
|
+
var i = J(null), t = i[0], e = i[1], n = J(_e), o = n[0], r = n[1], a = K(function() {
|
|
31
|
+
return new window.ResizeObserver(function(h) {
|
|
32
|
+
if (h[0]) {
|
|
33
|
+
var s = h[0].contentRect, l = s.x, c = s.y, u = s.width, d = s.height, f = s.top, v = s.left, g = s.bottom, b = s.right;
|
|
34
|
+
r({ x: l, y: c, width: u, height: d, top: f, left: v, bottom: g, right: b });
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
}, []);
|
|
38
|
-
return
|
|
39
|
-
if (
|
|
40
|
-
|
|
38
|
+
return yn(function() {
|
|
39
|
+
if (t) return a.observe(t), function() {
|
|
40
|
+
a.disconnect();
|
|
41
41
|
};
|
|
42
|
-
}, [
|
|
42
|
+
}, [t]), [e, o];
|
|
43
43
|
} : function() {
|
|
44
|
-
return [
|
|
45
|
-
},
|
|
46
|
-
const
|
|
47
|
-
n.current =
|
|
48
|
-
const o =
|
|
44
|
+
return [gn, _e];
|
|
45
|
+
}, D = (i, t) => {
|
|
46
|
+
const e = R((...r) => i?.(...r), t), n = z(null);
|
|
47
|
+
n.current = e;
|
|
48
|
+
const o = R((...r) => n.current?.(...r), []);
|
|
49
49
|
if (n.current) return o;
|
|
50
|
-
},
|
|
51
|
-
const { style:
|
|
52
|
-
return
|
|
53
|
-
},
|
|
54
|
-
const { style:
|
|
55
|
-
return
|
|
56
|
-
},
|
|
57
|
-
const { style:
|
|
58
|
-
return
|
|
59
|
-
},
|
|
60
|
-
for (let r = 0; r <
|
|
61
|
-
const
|
|
62
|
-
let
|
|
50
|
+
}, vn = (i) => {
|
|
51
|
+
const { style: t, orientation: e = st.Vertical, ...n } = i, o = e === st.Vertical;
|
|
52
|
+
return S("div", { style: { paddingBottom: "0px", paddingRight: "0px", paddingLeft: o ? "0px" : "3px", paddingTop: o ? "3px" : "0px", display: "flex", alignItems: "center", justifyContent: "center", ...t }, ...n, children: S("button", { style: { padding: "0", display: "flex", alignItems: "center", justifyContent: "center", border: "none" }, className: `scrollbar-button ${o ? "vertical" : "horizontal"} single-button start`, children: S("svg", { width: "9", height: "9", viewBox: "0 0 6 6", style: { opacity: "inherit" }, children: S("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
|
+
}, wn = (i) => {
|
|
54
|
+
const { style: t, orientation: e = st.Vertical, ...n } = i, o = e === st.Vertical;
|
|
55
|
+
return S("div", { style: { paddingLeft: "0px", paddingTop: "0px", paddingRight: o ? "0px" : "3px", paddingBottom: o ? "3px" : "0px", display: "flex", alignItems: "center", justifyContent: "center", ...t }, ...n, children: S("button", { style: { padding: "0", display: "flex", alignItems: "center", justifyContent: "center", border: "none" }, className: `scrollbar-button ${o ? "vertical" : "horizontal"} single-button end`, children: S("svg", { width: "9", height: "9", viewBox: "0 0 6 6", style: { opacity: "inherit" }, children: S("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
|
+
}, vo = (i) => {
|
|
57
|
+
const { style: t, orientation: e = st.Vertical, ...n } = i, o = e === st.Vertical;
|
|
58
|
+
return S("div", { style: { display: "flex", justifyContent: "center", alignItems: "end", transition: "fill-opacity 1s", zIndex: 1, width: "24px", height: "24px", ...t }, className: `scrollbar-button ${o ? "vertical" : "horizontal"} edge`, ...n, children: S("svg", { width: "24", height: "24", viewBox: "0 0 24 24", transform: o ? "rotate(90) " : "", children: S("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
|
+
}, Gt = (i, t, e, n, o = 0) => {
|
|
60
|
+
for (let r = 0; r < e.length; r++) {
|
|
61
|
+
const a = e[r].getBoundingClientRect();
|
|
62
|
+
let h = a.left - t, s = h + a.width;
|
|
63
63
|
if (n) {
|
|
64
|
-
if (
|
|
65
|
-
} else if (Math.ceil(
|
|
64
|
+
if (h < i && s >= i) return h;
|
|
65
|
+
} else if (Math.ceil(s) > Math.ceil(i) + 2) return s;
|
|
66
66
|
}
|
|
67
67
|
return o;
|
|
68
|
-
},
|
|
69
|
-
const { offset:
|
|
68
|
+
}, wo = Object.freeze(Object.defineProperty({ __proto__: null, getScrollTo: Gt }, Symbol.toStringTag, { value: "Module" })), xn = "_sheetxl-scrollbar_eblx4_6", oe = gt(Lt((i, t) => {
|
|
69
|
+
const { offset: e = 0, totalSize: n = 0, viewportSize: o = 0, style: r, className: a, orientation: h = st.Vertical, onScrollOffset: s, onScroll: l, showCustomScrollButtons: c = !1, scrollButtonIncrement: u = 200, scrollButtonInitialRepeatDelay: d = 260, scrollButtonAdditionalRepeatDelay: f = 120, createScrollStartButton: v = vn, createScrollEndButton: g = wn, ...b } = i, T = D(l, [l]), _ = z(null), [w, { width: x, height: A }] = mt(), [P, { width: I, height: O }] = mt(), y = h === st.Vertical, E = y ? "top" : "left", M = y ? "scrollTop" : "scrollLeft", p = y ? A : x, L = y ? O : I, [m, C] = J(null);
|
|
70
70
|
V(() => {
|
|
71
|
-
m !== null && _.current && _.current.scrollTo({ behavior: "smooth", [
|
|
72
|
-
}, [m,
|
|
73
|
-
const
|
|
71
|
+
m !== null && _.current && _.current.scrollTo({ behavior: "smooth", [E]: m });
|
|
72
|
+
}, [m, y]);
|
|
73
|
+
const N = R(($, et = !1) => {
|
|
74
74
|
if (!_.current) return 0;
|
|
75
|
-
const
|
|
76
|
-
return
|
|
77
|
-
}, []),
|
|
75
|
+
const rt = _.current.querySelector(".scrollbar-viewport"), pt = rt.getBoundingClientRect(), at = rt.children, ct = et ? 0 : Gt($, pt[E], at, !0, Math.max(0, $ - u));
|
|
76
|
+
return C(ct), Math.max(0, ct);
|
|
77
|
+
}, []), Q = R(($, et = !1) => {
|
|
78
78
|
if (!_.current) return 0;
|
|
79
|
-
const
|
|
80
|
-
return
|
|
81
|
-
}, [
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
}, [
|
|
79
|
+
const rt = _.current.querySelector(".scrollbar-viewport"), pt = rt.getBoundingClientRect(), at = rt.children, ct = Math.ceil(L - p), Ct = et ? ct : Gt($, pt[E], at, !1, Math.max(0, $ + u));
|
|
80
|
+
return C(Ct), Math.min(ct, Ct);
|
|
81
|
+
}, [L, p]), j = z(null), tt = R(($) => {
|
|
82
|
+
if (j.current !== null) return void (j.current = null);
|
|
83
|
+
const et = $.target[M];
|
|
84
|
+
s(et, o, n), T?.($);
|
|
85
|
+
}, [s, o, n, e]);
|
|
86
86
|
V(() => {
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
}, [
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
}, []),
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
},
|
|
97
|
-
}, [
|
|
98
|
-
V(() => () =>
|
|
99
|
-
const
|
|
100
|
-
if (!
|
|
101
|
-
const
|
|
102
|
-
return
|
|
103
|
-
}, [
|
|
104
|
-
if (!
|
|
105
|
-
const
|
|
106
|
-
return
|
|
107
|
-
}, [
|
|
108
|
-
return
|
|
87
|
+
const $ = j.current;
|
|
88
|
+
e !== $ && _.current[M] !== e && (j.current = e, _.current[M] = e);
|
|
89
|
+
}, [e, M]);
|
|
90
|
+
const F = z(null), B = z(null), W = R(() => {
|
|
91
|
+
F.current && (clearTimeout(F.current), F.current = null, B.current = null);
|
|
92
|
+
}, []), Y = R(($, et, rt, pt = d) => {
|
|
93
|
+
B.current = $, F.current = setTimeout(() => {
|
|
94
|
+
const at = rt ? N(B.current || $) : Q(B.current || $);
|
|
95
|
+
at !== B.current ? Y(at, !1, rt, f) : W();
|
|
96
|
+
}, et ? 0 : pt);
|
|
97
|
+
}, [N, Q, W]);
|
|
98
|
+
V(() => () => W(), [W]);
|
|
99
|
+
const yt = K(() => {
|
|
100
|
+
if (!c) return null;
|
|
101
|
+
const $ = { orientation: h, disabled: Math.floor(e) <= 0 || Math.floor(L - p) === 0, onMouseUp: W, onMouseLeave: W, onMouseDown: () => Y(e, !0, !0) };
|
|
102
|
+
return v?.($);
|
|
103
|
+
}, [c, h, e, m, L, p]), vt = K(() => {
|
|
104
|
+
if (!c) return null;
|
|
105
|
+
const $ = { orientation: h, disabled: Math.floor(L - p) <= Math.ceil(e), onMouseUp: W, onMouseLeave: W, onMouseDown: () => Y(e, !0, !1) };
|
|
106
|
+
return g?.($);
|
|
107
|
+
}, [c, h, e, m, L, p]);
|
|
108
|
+
return bt("div", { ref: t, style: { display: "flex", flex: "1", flexDirection: y ? "column" : "row", padding: "0", ...r }, className: wt(xn, a), ...b, children: [yt, S("div", { className: "pseudo-scrollbar", style: { flex: "1 1 100%", display: "flex", boxSizing: "content-box", flexDirection: y ? "column" : "row", justifyContent: "center", alignItems: "center" }, ref: w, children: S("div", { tabIndex: -1, style: { flex: "1 1 100%", overflowY: y ? "scroll" : "hidden", overflowX: y ? "hidden" : "scroll", position: "relative", willChange: "transform" }, onScroll: tt, ref: _, children: S("div", { ref: P, style: { position: "absolute", height: y ? n - o + (A ?? 0) : 1, width: y ? 1 : n - o + (x ?? 0) }, className: "scrollbar-viewport" }) }) }), vt] });
|
|
109
109
|
}));
|
|
110
|
-
|
|
111
|
-
let
|
|
112
|
-
const
|
|
113
|
-
let
|
|
114
|
-
return
|
|
115
|
-
},
|
|
116
|
-
let r =
|
|
117
|
-
if (
|
|
110
|
+
oe.displayName = "Scrollbar";
|
|
111
|
+
let me = Date.now, ge = 1e3, dt = {}, bn = 1;
|
|
112
|
+
const Tt = (i) => {
|
|
113
|
+
let t = dt[i] !== null;
|
|
114
|
+
return t && (dt[i] = null), t;
|
|
115
|
+
}, ye = (i, t, e, n = 0, o) => {
|
|
116
|
+
let r = me(), a = r, h = 0, s = 0, l = 0, c = bn++;
|
|
117
|
+
if (c % 20 == 0) {
|
|
118
118
|
const d = {};
|
|
119
|
-
for (let
|
|
120
|
-
|
|
119
|
+
for (let f in dt) d[f] = !0;
|
|
120
|
+
dt = d;
|
|
121
121
|
}
|
|
122
122
|
const u = function(d) {
|
|
123
|
-
let
|
|
123
|
+
let f = d !== !0, v = me(), g = !0;
|
|
124
124
|
try {
|
|
125
|
-
|
|
125
|
+
g = (!t || t(c)) ?? !0;
|
|
126
126
|
} catch {
|
|
127
|
-
|
|
127
|
+
g = !1;
|
|
128
128
|
}
|
|
129
|
-
if (!
|
|
130
|
-
if (
|
|
131
|
-
|
|
132
|
-
for (let _ = 0; _ < Math.min(
|
|
129
|
+
if (!dt[c] || !g) return dt[c] = null, void e?.(60 - s / ((v - r) / ge), c, !1);
|
|
130
|
+
if (f) {
|
|
131
|
+
l = Math.round((v - a) / 16.666666666666668) - 1;
|
|
132
|
+
for (let _ = 0; _ < Math.min(l, 4); _++) u(!0), s++;
|
|
133
133
|
}
|
|
134
|
-
n && (
|
|
135
|
-
let
|
|
134
|
+
n && (h = (v - r) / n, h > 1 && (h = 1));
|
|
135
|
+
let b = o ? o(h) : h, T = !1;
|
|
136
136
|
try {
|
|
137
|
-
|
|
137
|
+
T = i(b, v, f);
|
|
138
138
|
} catch {
|
|
139
|
-
|
|
139
|
+
T = !1;
|
|
140
140
|
}
|
|
141
|
-
|
|
141
|
+
T !== !1 && h !== 1 || !f ? f && (a = v, requestAnimationFrame(u)) : (dt[c] = null, e?.(60 - s / ((v - r) / ge), c, h === 1 || n == null));
|
|
142
142
|
};
|
|
143
|
-
return
|
|
144
|
-
},
|
|
143
|
+
return dt[c] = !0, requestAnimationFrame(u), c;
|
|
144
|
+
}, Sn = function(i) {
|
|
145
145
|
return Math.pow(i - 1, 3) + 1;
|
|
146
|
-
},
|
|
146
|
+
}, En = 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
|
|
150
|
-
constructor(
|
|
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 =
|
|
149
|
+
class Ln {
|
|
150
|
+
constructor(t, e) {
|
|
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 = t, 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, ...e };
|
|
152
152
|
}
|
|
153
|
-
setDimensions(
|
|
154
|
-
|
|
153
|
+
setDimensions(t, e, n, o) {
|
|
154
|
+
t !== null && (this.__clientWidth = t), e !== null && (this.__clientHeight = e), n !== null && (this.__contentWidth = n), o !== null && (this.__contentHeight = o), this.__computeScrollMax(), this.scrollTo(this.__scrollLeft, this.__scrollTop, !0);
|
|
155
155
|
}
|
|
156
|
-
setPosition(
|
|
157
|
-
this.__clientLeft =
|
|
156
|
+
setPosition(t, e) {
|
|
157
|
+
this.__clientLeft = t || 0, this.__clientTop = e || 0;
|
|
158
158
|
}
|
|
159
|
-
setSnapSize(
|
|
160
|
-
this.__snapWidth =
|
|
159
|
+
setSnapSize(t, e) {
|
|
160
|
+
this.__snapWidth = t, this.__snapHeight = e;
|
|
161
161
|
}
|
|
162
162
|
getValues() {
|
|
163
163
|
return { left: this.__scrollLeft, top: this.__scrollTop, right: this.__scrollLeft + this.__clientWidth / this.__zoomLevel, bottom: this.__scrollTop + this.__clientHeight / this.__zoomLevel, zoom: this.__zoomLevel };
|
|
164
164
|
}
|
|
165
|
-
getPoint(
|
|
165
|
+
getPoint(t, e) {
|
|
166
166
|
const n = this.getValues();
|
|
167
|
-
return { left:
|
|
167
|
+
return { left: t / n.zoom, top: e / n.zoom };
|
|
168
168
|
}
|
|
169
169
|
getScrollMax() {
|
|
170
170
|
return { left: this.__maxScrollLeft, top: this.__maxScrollTop };
|
|
171
171
|
}
|
|
172
|
-
zoomTo(
|
|
172
|
+
zoomTo(t, e = !1, n, o, r) {
|
|
173
173
|
if (!this.options.zooming) throw new Error("Zooming is not enabled!");
|
|
174
|
-
r && (this.__zoomComplete = r), this.__isDecelerating && (
|
|
175
|
-
const
|
|
176
|
-
n === void 0 && (n = this.__clientWidth / 2), o === void 0 && (o = this.__clientHeight / 2),
|
|
177
|
-
const
|
|
178
|
-
let
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
-
zoomBy(
|
|
182
|
-
this.zoomTo(this.__zoomLevel *
|
|
183
|
-
}
|
|
184
|
-
scrollTo(
|
|
185
|
-
if (this.__isDecelerating && (
|
|
174
|
+
r && (this.__zoomComplete = r), this.__isDecelerating && (Tt(this.__isDecelerating), this.__isDecelerating = 0);
|
|
175
|
+
const a = this.__zoomLevel;
|
|
176
|
+
n === void 0 && (n = this.__clientWidth / 2), o === void 0 && (o = this.__clientHeight / 2), t = Math.max(Math.min(t, this.options.maxZoom), this.options.minZoom), this.__computeScrollMax(t);
|
|
177
|
+
const h = t / a;
|
|
178
|
+
let s = h * (this.__scrollLeft + n) - n, l = h * (this.__scrollTop + o) - o;
|
|
179
|
+
s > this.__maxScrollLeft ? s = this.__maxScrollLeft : s < 0 && (s = 0), l > this.__maxScrollTop ? l = this.__maxScrollTop : l < 0 && (l = 0), this.__publish(s, l, t, e);
|
|
180
|
+
}
|
|
181
|
+
zoomBy(t, e = !1, n = 0, o = 0, r) {
|
|
182
|
+
this.zoomTo(this.__zoomLevel * t, e, n, o, r);
|
|
183
|
+
}
|
|
184
|
+
scrollTo(t, e, n = !1, o = 1) {
|
|
185
|
+
if (this.__isDecelerating && (Tt(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
|
+
t *= o, e *= o, this.__computeScrollMax(o);
|
|
188
188
|
} else o = this.__zoomLevel;
|
|
189
|
-
this.options.scrollingX ? this.options.paging ?
|
|
189
|
+
this.options.scrollingX ? this.options.paging ? t = Math.round(t / this.__clientWidth) * this.__clientWidth : this.options.snapping && (t = Math.round(t / this.__snapWidth) * this.__snapWidth) : t = this.__scrollLeft, this.options.scrollingY ? this.options.paging ? e = Math.round(e / this.__clientHeight) * this.__clientHeight : this.options.snapping && (e = Math.round(e / this.__snapHeight) * this.__snapHeight) : e = this.__scrollTop, t = Math.max(Math.min(this.__maxScrollLeft, t), 0), e = Math.max(Math.min(this.__maxScrollTop, e), 0), t === this.__scrollLeft && e === this.__scrollTop && (n = !1), this.__publish(t, e, o, n);
|
|
190
190
|
}
|
|
191
|
-
scrollBy(
|
|
191
|
+
scrollBy(t = 0, e = 0, n = !1) {
|
|
192
192
|
const o = this.__isAnimating ? this.__scheduledLeft : this.__scrollLeft, r = this.__isAnimating ? this.__scheduledTop : this.__scrollTop;
|
|
193
|
-
this.scrollTo(o + (
|
|
193
|
+
this.scrollTo(o + (t || 0), r + (e || 0), n);
|
|
194
194
|
}
|
|
195
|
-
doMouseZoom(
|
|
196
|
-
const r =
|
|
195
|
+
doMouseZoom(t, e, n, o) {
|
|
196
|
+
const r = t > 0 ? 0.97 : 1.03;
|
|
197
197
|
return this.zoomTo(this.__zoomLevel * r, !1, n - this.__clientLeft, o - this.__clientTop);
|
|
198
198
|
}
|
|
199
|
-
doTouchStart(
|
|
200
|
-
if (
|
|
201
|
-
if (
|
|
199
|
+
doTouchStart(t, e) {
|
|
200
|
+
if (t.length === void 0) throw new Error("Invalid touch list: " + t);
|
|
201
|
+
if (e instanceof Date && (e = e.valueOf()), typeof e != "number") throw new Error("Invalid timestamp value: " + e);
|
|
202
202
|
let n, o;
|
|
203
|
-
this.__interruptedAnimation = !0, this.__isDecelerating && (
|
|
204
|
-
let r =
|
|
205
|
-
r ? (n =
|
|
203
|
+
this.__interruptedAnimation = !0, this.__isDecelerating && (Tt(this.__isDecelerating), this.__isDecelerating = 0, this.__interruptedAnimation = !0), this.__isAnimating && (Tt(this.__isAnimating), this.__isAnimating = 0, this.__interruptedAnimation = !0);
|
|
204
|
+
let r = t.length === 1;
|
|
205
|
+
r ? (n = t[0].pageX, o = t[0].pageY) : (n = Math.abs(t[0].pageX + t[1].pageX) / 2, o = Math.abs(t[0].pageY + t[1].pageY) / 2), this.__initialTouchLeft = n, this.__initialTouchTop = o, this.__zoomLevelStart = this.__zoomLevel, this.__lastTouchLeft = n, this.__lastTouchTop = o, this.__lastTouchMove = e, 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
|
}
|
|
207
|
-
doTouchMove(
|
|
208
|
-
if (
|
|
209
|
-
if (
|
|
207
|
+
doTouchMove(t, e, n = 1) {
|
|
208
|
+
if (t.length === void 0) throw new Error("Invalid touch list: " + t);
|
|
209
|
+
if (e instanceof Date && (e = e.valueOf()), typeof e != "number") throw new Error("Invalid timestamp value: " + e);
|
|
210
210
|
if (!this.__isTracking) return;
|
|
211
211
|
let o, r;
|
|
212
|
-
|
|
213
|
-
let
|
|
212
|
+
t.length === 2 ? (o = Math.abs(t[0].pageX + t[1].pageX) / 2, r = Math.abs(t[0].pageY + t[1].pageY) / 2) : (o = t[0].pageX, r = t[0].pageY);
|
|
213
|
+
let a = this.__positions;
|
|
214
214
|
if (this.__isDragging) {
|
|
215
|
-
let
|
|
215
|
+
let h = o - this.__lastTouchLeft, s = r - this.__lastTouchTop, l = this.__scrollLeft, c = this.__scrollTop, u = this.__zoomLevel;
|
|
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
|
|
220
|
-
|
|
219
|
+
let f = o - this.__clientLeft, v = r - this.__clientTop;
|
|
220
|
+
l = (f + l) * u / d - f, c = (v + c) * u / d - v, this.__computeScrollMax(u);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
if (this.__enableScrollX) {
|
|
224
|
-
|
|
224
|
+
l -= h * this.options.speedMultiplier;
|
|
225
225
|
let d = this.__maxScrollLeft;
|
|
226
|
-
(
|
|
226
|
+
(l > d || l < 0) && (this.options.bouncing ? l += h / 2 * this.options.speedMultiplier : l = l > d ? d : 0);
|
|
227
227
|
}
|
|
228
228
|
if (this.__enableScrollY) {
|
|
229
|
-
|
|
229
|
+
c -= s * this.options.speedMultiplier;
|
|
230
230
|
const d = this.__maxScrollTop;
|
|
231
|
-
(
|
|
231
|
+
(c > d || c < 0) && (this.options.bouncing ? c += s / 2 * this.options.speedMultiplier : c = c > d ? d : 0);
|
|
232
232
|
}
|
|
233
|
-
|
|
233
|
+
a.length > 60 && a.splice(0, 30), a.push(l, c, e), this.__publish(l, c, u);
|
|
234
234
|
} else {
|
|
235
|
-
let
|
|
236
|
-
this.__enableScrollX = this.options.scrollingX &&
|
|
235
|
+
let h = this.options.locking ? 3 : 0, s = 5, l = Math.abs(o - this.__initialTouchLeft), c = Math.abs(r - this.__initialTouchTop);
|
|
236
|
+
this.__enableScrollX = this.options.scrollingX && l >= h, this.__enableScrollY = this.options.scrollingY && c >= h, a.push(this.__scrollLeft, this.__scrollTop, e), this.__isDragging = (this.__enableScrollX || this.__enableScrollY) && (l >= s || c >= s), this.__isDragging && (this.__interruptedAnimation = !1);
|
|
237
237
|
}
|
|
238
|
-
this.__lastTouchLeft = o, this.__lastTouchTop = r, this.__lastTouchMove =
|
|
238
|
+
this.__lastTouchLeft = o, this.__lastTouchTop = r, this.__lastTouchMove = e, this.__lastScale = n;
|
|
239
239
|
}
|
|
240
|
-
doTouchEnd(
|
|
241
|
-
if (
|
|
240
|
+
doTouchEnd(t) {
|
|
241
|
+
if (t instanceof Date && (t = t.valueOf()), typeof t != "number") throw new Error("Invalid timestamp value: " + t);
|
|
242
242
|
if (this.__isTracking) {
|
|
243
|
-
if (this.__isTracking = !1, this.__isDragging) if (this.__isDragging = !1, this.__isSingleTouch && this.options.animating &&
|
|
244
|
-
let
|
|
245
|
-
for (let r = n; r > 0 &&
|
|
243
|
+
if (this.__isTracking = !1, this.__isDragging) if (this.__isDragging = !1, this.__isSingleTouch && this.options.animating && t - this.__lastTouchMove <= 100) {
|
|
244
|
+
let e = this.__positions, n = e.length - 1, o = n;
|
|
245
|
+
for (let r = n; r > 0 && e[r] > this.__lastTouchMove - 100; r -= 3) o = r;
|
|
246
246
|
if (o !== n) {
|
|
247
|
-
const r =
|
|
248
|
-
this.__decelerationVelocityX =
|
|
249
|
-
const
|
|
250
|
-
(Math.abs(this.__decelerationVelocityX) >
|
|
247
|
+
const r = e[n] - e[o], a = this.__scrollLeft - e[o - 2], h = this.__scrollTop - e[o - 1];
|
|
248
|
+
this.__decelerationVelocityX = a / r * (1e3 / 60), this.__decelerationVelocityY = h / r * (1e3 / 60);
|
|
249
|
+
const s = this.options.paging || this.options.snapping ? 4 : 1;
|
|
250
|
+
(Math.abs(this.__decelerationVelocityX) > s || Math.abs(this.__decelerationVelocityY) > s) && this.__startDeceleration(t);
|
|
251
251
|
} else this.options.scrollingComplete?.();
|
|
252
|
-
} else
|
|
252
|
+
} else t - this.__lastTouchMove > 100 && this.options.scrollingComplete?.();
|
|
253
253
|
this.__isDecelerating || ((this.__interruptedAnimation || this.__isDragging) && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, !0, this.__zoomLevel)), this.__positions.length = 0;
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
|
-
__publish(
|
|
256
|
+
__publish(t, e, n, o = !1) {
|
|
257
257
|
const r = this.__isAnimating;
|
|
258
|
-
if (r && (
|
|
259
|
-
this.__scheduledLeft =
|
|
260
|
-
const
|
|
261
|
-
|
|
262
|
-
}.bind(this),
|
|
263
|
-
return this.__isAnimating ===
|
|
264
|
-
}.bind(this),
|
|
265
|
-
|
|
258
|
+
if (r && (Tt(r), this.__isAnimating = 0), o && this.options.animating) {
|
|
259
|
+
this.__scheduledLeft = t, this.__scheduledTop = e, this.__scheduledZoom = n;
|
|
260
|
+
const a = this.__scrollLeft, h = this.__scrollTop, s = this.__zoomLevel, l = t - a, c = e - h, u = n - s, d = function(g, b, T) {
|
|
261
|
+
T && (this.__scrollLeft = a + l * g, this.__scrollTop = h + c * g, this.__zoomLevel = s + u * g, this.__callback && this.__callback(this.__scrollLeft, this.__scrollTop, this.__zoomLevel));
|
|
262
|
+
}.bind(this), f = function(g) {
|
|
263
|
+
return this.__isAnimating === g;
|
|
264
|
+
}.bind(this), v = function(g, b, T) {
|
|
265
|
+
b === this.__isAnimating && (this.__isAnimating = !1), (this.__didDecelerationComplete || T) && this.options.scrollingComplete?.(), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
|
|
266
266
|
}.bind(this);
|
|
267
|
-
this.__isAnimating =
|
|
268
|
-
} else this.__scheduledLeft = this.__scrollLeft =
|
|
267
|
+
this.__isAnimating = ye(d, f, v, this.options.animationDuration, r ? Sn : En);
|
|
268
|
+
} else this.__scheduledLeft = this.__scrollLeft = t, this.__scheduledTop = this.__scrollTop = e, this.__scheduledZoom = this.__zoomLevel = n, this.__callback && this.__callback(t, e, n), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
|
|
269
269
|
}
|
|
270
|
-
__computeScrollMax(
|
|
271
|
-
this.__maxScrollLeft = Math.max(this.__contentWidth *
|
|
270
|
+
__computeScrollMax(t = this.__zoomLevel) {
|
|
271
|
+
this.__maxScrollLeft = Math.max(this.__contentWidth * t - this.__clientWidth, 0), this.__maxScrollTop = Math.max(this.__contentHeight * t - this.__clientHeight, 0);
|
|
272
272
|
}
|
|
273
|
-
__startDeceleration(
|
|
273
|
+
__startDeceleration(t) {
|
|
274
274
|
if (this.options.paging) {
|
|
275
|
-
const
|
|
276
|
-
this.__minDecelerationScrollLeft = Math.floor(
|
|
275
|
+
const a = Math.max(Math.min(this.__scrollLeft, this.__maxScrollLeft), 0), h = Math.max(Math.min(this.__scrollTop, this.__maxScrollTop), 0), s = this.__clientWidth, l = this.__clientHeight;
|
|
276
|
+
this.__minDecelerationScrollLeft = Math.floor(a / s) * s, this.__minDecelerationScrollTop = Math.floor(h / l) * l, this.__maxDecelerationScrollLeft = Math.ceil(a / s) * s, this.__maxDecelerationScrollTop = Math.ceil(h / l) * l;
|
|
277
277
|
} else this.__minDecelerationScrollLeft = 0, this.__minDecelerationScrollTop = 0, this.__maxDecelerationScrollLeft = this.__maxScrollLeft, this.__maxDecelerationScrollTop = this.__maxScrollTop;
|
|
278
|
-
const
|
|
279
|
-
this.__stepThroughDeceleration(
|
|
278
|
+
const e = function(a, h, s) {
|
|
279
|
+
this.__stepThroughDeceleration(s);
|
|
280
280
|
}.bind(this), n = this.options.snapping ? 4 : 0.1, o = function() {
|
|
281
|
-
const
|
|
282
|
-
return
|
|
283
|
-
}.bind(this), r = function(
|
|
281
|
+
const a = Math.abs(this.__decelerationVelocityX) >= n || Math.abs(this.__decelerationVelocityY) >= n;
|
|
282
|
+
return a || (this.__didDecelerationComplete = !0), a;
|
|
283
|
+
}.bind(this), r = function(a, h, s) {
|
|
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 =
|
|
286
|
+
this.__isDecelerating = ye(e, o, r);
|
|
287
287
|
}
|
|
288
|
-
__stepThroughDeceleration(
|
|
289
|
-
let
|
|
288
|
+
__stepThroughDeceleration(t) {
|
|
289
|
+
let e = this.__scrollLeft + this.__decelerationVelocityX, n = this.__scrollTop + this.__decelerationVelocityY;
|
|
290
290
|
if (!this.options.bouncing) {
|
|
291
|
-
const o = Math.max(Math.min(this.__maxDecelerationScrollLeft,
|
|
292
|
-
o !==
|
|
291
|
+
const o = Math.max(Math.min(this.__maxDecelerationScrollLeft, e), this.__minDecelerationScrollLeft);
|
|
292
|
+
o !== e && (e = o, this.__decelerationVelocityX = 0);
|
|
293
293
|
const r = Math.max(Math.min(this.__maxDecelerationScrollTop, n), this.__minDecelerationScrollTop);
|
|
294
294
|
r !== n && (n = r, this.__decelerationVelocityY = 0);
|
|
295
295
|
}
|
|
296
|
-
if (
|
|
297
|
-
let o = 0, r = 0,
|
|
298
|
-
|
|
296
|
+
if (t ? this.__publish(e, n, this.__zoomLevel) : (this.__scrollLeft = e, this.__scrollTop = n), !this.options.paging && (this.__decelerationVelocityX *= 0.95, this.__decelerationVelocityY *= 0.95), this.options.bouncing) {
|
|
297
|
+
let o = 0, r = 0, a = this.options.penetrationDeceleration, h = this.options.penetrationAcceleration;
|
|
298
|
+
e < this.__minDecelerationScrollLeft ? o = this.__minDecelerationScrollLeft - e : e > this.__maxDecelerationScrollLeft && (o = this.__maxDecelerationScrollLeft - e), n < this.__minDecelerationScrollTop ? r = this.__minDecelerationScrollTop - n : n > this.__maxDecelerationScrollTop && (r = this.__maxDecelerationScrollTop - n), o !== 0 && (o * this.__decelerationVelocityX <= 0 ? this.__decelerationVelocityX += o * a : this.__decelerationVelocityX = o * h), r !== 0 && (r * this.__decelerationVelocityY <= 0 ? this.__decelerationVelocityY += r * a : this.__decelerationVelocityY = r * h);
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
|
-
var
|
|
302
|
+
var q = typeof window < "u" ? window : { screen: {}, navigator: {} }, Et = (q.matchMedia || function() {
|
|
303
303
|
return { matches: !1 };
|
|
304
|
-
}).bind(
|
|
305
|
-
return
|
|
306
|
-
} },
|
|
304
|
+
}).bind(q), Be = !1, Cn = { get passive() {
|
|
305
|
+
return Be = !0;
|
|
306
|
+
} }, ve = function() {
|
|
307
307
|
};
|
|
308
|
-
|
|
309
|
-
var
|
|
310
|
-
const
|
|
311
|
-
function
|
|
312
|
-
return
|
|
308
|
+
q.addEventListener && q.addEventListener("p", ve, Cn), q.removeEventListener && q.removeEventListener("p", ve, !1);
|
|
309
|
+
var Tn = Be, Mn = "PointerEvent" in q, ie = "ontouchstart" in q, Oe = ie || "TouchEvent" in q && Et("(any-pointer: coarse)").matches, we = (q.navigator.maxTouchPoints || 0) > 0 || Oe, $e = q.navigator.userAgent || "", kn = Et("(pointer: coarse)").matches && /iPad|Macintosh/.test($e) && Math.min(q.screen.width || 0, q.screen.height || 0) >= 768, Ke = (Et("(pointer: coarse)").matches || !Et("(pointer: fine)").matches && ie) && !/Windows.*Firefox/.test($e), Dn = Et("(any-pointer: fine)").matches || Et("(any-hover: hover)").matches || kn || !ie, Zt = !we || !Dn && Ke ? we ? "touchOnly" : "mouseOnly" : "hybrid", Pn = Zt === "mouseOnly" ? "mouse" : Zt === "touchOnly" || Ke ? "touch" : "mouse";
|
|
310
|
+
const An = Object.freeze(Object.defineProperty({ __proto__: null, deviceType: Zt, primaryInput: Pn, supportsPassiveEvents: Tn, supportsPointerEvents: Mn, supportsTouchEvents: Oe }, Symbol.toStringTag, { value: "Module" })), zn = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), Re = {};
|
|
311
|
+
function qt() {
|
|
312
|
+
return An;
|
|
313
313
|
}
|
|
314
|
-
const
|
|
314
|
+
const Ie = (i) => i === "BracketLeft" ? "[" : i === "BracketRight" ? "]" : G.camelToPrettyCase(i), xo = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: Re, boundPixel: function(i, t = !1, e = 0) {
|
|
315
315
|
return i;
|
|
316
316
|
}, createSyntheticEvent: (i) => {
|
|
317
|
-
let
|
|
317
|
+
let t = !1, e = !1;
|
|
318
318
|
return { nativeEvent: i, currentTarget: i.currentTarget, target: i.target, bubbles: i.bubbles, cancelable: i.cancelable, defaultPrevented: i.defaultPrevented, eventPhase: i.eventPhase, isTrusted: i.isTrusted, preventDefault: () => {
|
|
319
|
-
|
|
320
|
-
}, isDefaultPrevented: () =>
|
|
321
|
-
|
|
322
|
-
}, isPropagationStopped: () =>
|
|
319
|
+
t = !0, i.preventDefault();
|
|
320
|
+
}, isDefaultPrevented: () => t, stopPropagation: () => {
|
|
321
|
+
e = !0, i.stopPropagation();
|
|
322
|
+
}, isPropagationStopped: () => e, persist: () => {
|
|
323
323
|
}, timeStamp: i.timeStamp, type: i.type };
|
|
324
|
-
}, detectIt:
|
|
325
|
-
function
|
|
326
|
-
const n =
|
|
327
|
-
return
|
|
324
|
+
}, detectIt: qt, focusableNodeNames: zn, toPrettyKeyCode: Ie }, Symbol.toStringTag, { value: "Module" })), Bn = [];
|
|
325
|
+
function Ne(i, t, e = Bn) {
|
|
326
|
+
const n = z(null);
|
|
327
|
+
return ln(i, () => {
|
|
328
328
|
if (!n.current) return;
|
|
329
|
-
const o = n.current, r =
|
|
329
|
+
const o = n.current, r = t?.();
|
|
330
330
|
if (!r || typeof r != "object") throw new Error("attributes must return a plain object of values");
|
|
331
|
-
const
|
|
332
|
-
for (let
|
|
333
|
-
const
|
|
334
|
-
Object.defineProperty(o,
|
|
331
|
+
const a = Object.keys(r), h = a.length;
|
|
332
|
+
for (let s = 0; s < h; s++) {
|
|
333
|
+
const l = a[s], c = r[l];
|
|
334
|
+
Object.defineProperty(o, l, { value: c, writable: !0, configurable: !0, enumerable: !0 });
|
|
335
335
|
}
|
|
336
336
|
return o;
|
|
337
|
-
},
|
|
337
|
+
}, e), n;
|
|
338
338
|
}
|
|
339
|
-
const
|
|
340
|
-
const { children:
|
|
339
|
+
const xe = (i) => S(oe, { ...i }), On = ({ width: i, height: t }) => S("div", { className: "corner", style: { minWidth: `${i}px`, width: `${i}px`, minHeight: `${t}px`, height: `${t}px` } }), $n = gt(Lt((i, t) => {
|
|
340
|
+
const { children: e, viewport: n, onScrollViewport: o, showHorizontalScrollbar: r = !0, showVerticalScrollbar: a = !0, createScrollCorner: h = On, createHorizontalScrollbar: s = xe, createVerticalScrollbar: l = xe, style: c, touchElement: u, disableTouch: d, ...f } = i, v = D(o, [o]), g = Ne(t, () => ({ isScrollPane: () => !0 }), []), b = z(null);
|
|
341
341
|
V(() => {
|
|
342
|
-
|
|
342
|
+
b.current && (b.current.__scrollTop === n?.top && b.current.__scrollLeft === n?.left || b.current.__isDecelerating || b.current?.scrollTo(n?.left, n?.top, !1));
|
|
343
343
|
}, [n?.left, n?.top, u]);
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
}, []), _ =
|
|
347
|
-
|
|
348
|
-
}, []),
|
|
349
|
-
p.preventDefault(),
|
|
350
|
-
}, []),
|
|
351
|
-
|
|
352
|
-
}, []),
|
|
353
|
-
|
|
344
|
+
const T = R((p, L) => {
|
|
345
|
+
v?.({ left: p, top: L });
|
|
346
|
+
}, []), _ = R((p) => {
|
|
347
|
+
b.current?.doTouchStart(p.touches, p.timeStamp);
|
|
348
|
+
}, []), w = R((p) => {
|
|
349
|
+
p.preventDefault(), b.current?.doTouchMove(p.touches, p.timeStamp);
|
|
350
|
+
}, []), x = R((p) => {
|
|
351
|
+
b.current?.doTouchEnd(p.timeStamp);
|
|
352
|
+
}, []), A = R(({ containerWidth: p, containerHeight: L, totalWidth: m, totalHeight: C }) => {
|
|
353
|
+
b.current.setDimensions(p, L, m, C);
|
|
354
354
|
}, []);
|
|
355
355
|
V(() => {
|
|
356
|
-
const p = u ??
|
|
357
|
-
if (!d &&
|
|
358
|
-
if (!
|
|
359
|
-
const
|
|
360
|
-
|
|
356
|
+
const p = u ?? g.current;
|
|
357
|
+
if (!d && qt().supportsTouchEvents && p && n) {
|
|
358
|
+
if (!b.current) {
|
|
359
|
+
const L = { scrollingX: !0, scrollingY: !0, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
|
|
360
|
+
b.current = new Ln(T, L);
|
|
361
361
|
}
|
|
362
|
-
|
|
362
|
+
qt().supportsTouchEvents && (p.addEventListener("touchstart", _), p.addEventListener("touchend", x), p.addEventListener("touchmove", w)), A({ containerWidth: n?.width, containerHeight: n?.height, totalWidth: n?.totalWidth, totalHeight: n?.totalHeight });
|
|
363
363
|
}
|
|
364
364
|
return () => {
|
|
365
|
-
p?.removeEventListener("touchstart", _), p?.removeEventListener("touchend",
|
|
365
|
+
p?.removeEventListener("touchstart", _), p?.removeEventListener("touchend", x), p?.removeEventListener("touchmove", w);
|
|
366
366
|
};
|
|
367
367
|
}, [n?.width, n?.height, n?.totalWidth, n?.totalHeight, d, u]);
|
|
368
|
-
const [
|
|
369
|
-
const p =
|
|
370
|
-
|
|
368
|
+
const [P, { width: I }] = mt(), [O, { height: y }] = mt(), E = K(() => {
|
|
369
|
+
const p = l({ orientation: st.Vertical, offset: n?.top, viewportSize: n?.height, totalSize: n?.totalHeight, onScrollOffset: (L) => {
|
|
370
|
+
v?.({ top: L });
|
|
371
371
|
} });
|
|
372
|
-
return
|
|
373
|
-
}, [
|
|
374
|
-
const p =
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
372
|
+
return S("div", { style: { display: "flex", flex: "0" }, ref: P, children: p });
|
|
373
|
+
}, [l, n?.top, n?.height, n?.totalHeight]), M = K(() => {
|
|
374
|
+
const p = s({ orientation: st.Horizontal, offset: n?.left, viewportSize: n?.width, totalSize: n?.totalWidth, onScrollOffset: (L) => {
|
|
375
|
+
v?.({ left: L });
|
|
376
|
+
} });
|
|
377
|
+
return bt("div", { style: { display: "flex", flex: "none", flexDirection: "row", alignItems: "stretch", justifyContent: "center" }, children: [S("div", { style: { display: "flex", flex: "1 1 100%", flexDirection: "column", width: `calc(100% - ${I}px)` }, children: S("div", { ref: O, className: "sizer", children: p }) }), a ? h({ width: I, height: y }) : S(St, {})] });
|
|
378
|
+
}, [s, n?.left, n?.width, n?.totalWidth, a, h, I, y]);
|
|
379
|
+
return S("div", { style: { position: "relative", display: "flex", minWidth: a ? `${I}px` : void 0, minHeight: r ? `${y}px` : void 0, ...c }, ...f, ref: g, children: bt("div", { style: { position: "relative", width: "100%", flex: "1 1 100%", display: "flex", flexDirection: "column", boxSizing: "border-box" }, children: [bt("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: [S("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: e }), a ? E : S(St, {})] }), r ? M : S(St, {})] }) });
|
|
378
380
|
}));
|
|
379
|
-
|
|
380
|
-
let
|
|
381
|
-
function
|
|
382
|
-
const [i,
|
|
381
|
+
$n.displayName = "ScrollPane";
|
|
382
|
+
let At = 0;
|
|
383
|
+
function bo() {
|
|
384
|
+
const [i, t] = J(!!document.fullscreenElement), e = R(() => {
|
|
383
385
|
const n = document.fullscreenElement;
|
|
384
386
|
return n ? n.querySelector(".fullscreen-portal-root") || n : document.body;
|
|
385
387
|
}, []);
|
|
386
388
|
return V(() => {
|
|
387
389
|
function n() {
|
|
388
390
|
const o = document.fullscreenElement;
|
|
389
|
-
if (
|
|
391
|
+
if (t(!!o), !o) return;
|
|
390
392
|
let r = o.querySelector(".fullscreen-portal-root");
|
|
391
393
|
r || (r = document.createElement("div"), r.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", o.appendChild(r));
|
|
392
394
|
}
|
|
393
|
-
return
|
|
394
|
-
document.removeEventListener("fullscreenchange", n),
|
|
395
|
+
return At++, n(), document.addEventListener("fullscreenchange", n), () => {
|
|
396
|
+
document.removeEventListener("fullscreenchange", n), At--, At <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((o) => {
|
|
395
397
|
o.parentNode && o.parentNode.removeChild(o);
|
|
396
|
-
}),
|
|
398
|
+
}), At = 0);
|
|
397
399
|
};
|
|
398
|
-
}, []), { getPortalContainer:
|
|
400
|
+
}, []), { getPortalContainer: e, isFullscreen: i };
|
|
399
401
|
}
|
|
400
|
-
const
|
|
401
|
-
const { offset:
|
|
402
|
+
const Kn = 100, Rn = 100, In = 1e6, Nn = 100, Hn = 50, Vn = gt(Lt((i, t) => {
|
|
403
|
+
const { offset: e = 0, viewportSize: n = 0, totalSize: o = 0, minSize: r = 0, endGap: a = Kn, endScrollIncrement: h = Rn, style: s = Re, onMouseDown: l, onScrollOffset: c, onScroll: u, scaleLimit: d = In, scaleFactor: f = Nn, precisionFactor: v = Hn, ...g } = i;
|
|
402
404
|
u && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
|
|
403
|
-
const
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
}, [
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
S?.(D), B(!0), document.addEventListener("mousemove", g, { passive: !0 }), document.addEventListener("mouseup", m, { passive: !0 });
|
|
419
|
-
}, [g, m]);
|
|
420
|
-
return L(nt, { ref: e, style: { ...a }, ...x, offset: $, totalSize: z, viewportSize: I, onMouseDown: E, onScrollOffset: C });
|
|
405
|
+
const b = D(l, [l]), [T, _] = J(!1), w = z(null), x = K(() => {
|
|
406
|
+
const M = d === 0 ? o : Math.min(o ?? 0, Math.max(r ?? 0, (e ?? 0) + (n ?? 0)) + (a ?? 0)), p = d !== 0 && M > d ? f : 1, L = Math.ceil(M / p), m = { offset: Math.ceil(e / p), totalSize: L, viewportSize: Math.ceil(n / p), scaledOffset: e, scaledTotalSize: o, scaledViewportSize: n };
|
|
407
|
+
return w.current = T ? null : m, m;
|
|
408
|
+
}, [e, o, n, T, r, a, h]), A = d !== 0 && x.totalSize > d ? f : 1, P = A / v, I = D((M, p, L) => {
|
|
409
|
+
const m = w.current;
|
|
410
|
+
if (w.current = null, m && m.scaledTotalSize === o && m.scaledViewportSize === n && m.scaledOffset === e) return;
|
|
411
|
+
const C = x.offset;
|
|
412
|
+
Math.abs(M - C) < P && (M = C), c?.(M * A, C, x.viewportSize);
|
|
413
|
+
}, [c, A, P, x]), O = R((M) => {
|
|
414
|
+
}, []), y = R((M) => {
|
|
415
|
+
document.removeEventListener("mousemove", O), document.removeEventListener("mouseup", y), _(!1);
|
|
416
|
+
}, []), E = R((M) => {
|
|
417
|
+
_(!0), b?.(M), document.addEventListener("mousemove", O, { passive: !0 }), document.addEventListener("mouseup", y, { passive: !0 });
|
|
418
|
+
}, [O, y]);
|
|
419
|
+
return S(oe, { ref: t, style: s, ...g, offset: x.offset, totalSize: x.totalSize, viewportSize: x.viewportSize, onMouseDown: E, onScrollOffset: I });
|
|
421
420
|
}));
|
|
422
|
-
|
|
423
|
-
const
|
|
424
|
-
function
|
|
425
|
-
if (typeof i == "function") return i(
|
|
426
|
-
i && (i.current =
|
|
421
|
+
Vn.displayName = "VirtualScrollbar";
|
|
422
|
+
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" };
|
|
423
|
+
function Ft(i, t) {
|
|
424
|
+
if (typeof i == "function") return i(t);
|
|
425
|
+
i && (i.current = t);
|
|
427
426
|
}
|
|
428
|
-
var
|
|
429
|
-
return (
|
|
430
|
-
const
|
|
427
|
+
var It = parseInt(an.split(".")[0], 10) >= 19 ? function(i) {
|
|
428
|
+
return (t) => {
|
|
429
|
+
const e = [];
|
|
431
430
|
for (const n of i) {
|
|
432
|
-
const o =
|
|
433
|
-
|
|
431
|
+
const o = Ft(n, t), r = typeof o == "function";
|
|
432
|
+
e.push(r ? o : () => Ft(n, null));
|
|
434
433
|
}
|
|
435
434
|
return () => {
|
|
436
|
-
for (const n of
|
|
435
|
+
for (const n of e) n();
|
|
437
436
|
};
|
|
438
437
|
};
|
|
439
438
|
} : function(i) {
|
|
440
|
-
return (
|
|
441
|
-
for (const
|
|
439
|
+
return (t) => {
|
|
440
|
+
for (const e of i) Ft(e, t);
|
|
442
441
|
};
|
|
443
442
|
};
|
|
444
|
-
const
|
|
445
|
-
const { refFocusStart:
|
|
446
|
-
if (
|
|
447
|
-
const
|
|
448
|
-
let
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
h.focus && l.push({ tabindex: parseInt(c), child: h });
|
|
443
|
+
const Eo = gt(Lt((i, t) => {
|
|
444
|
+
const { refFocusStart: e, ...n } = i, o = z(null), r = R(() => {
|
|
445
|
+
if (e) return void e?.current?.focus();
|
|
446
|
+
const a = o.current.parentElement.children;
|
|
447
|
+
let h = [];
|
|
448
|
+
const s = a.length;
|
|
449
|
+
for (let l = 0; l < s && a[l] !== o.current; l++) {
|
|
450
|
+
const c = a[l], u = c.getAttribute("tabindex");
|
|
451
|
+
u == null || u === "-1" || c.getAttribute("disabled") !== "true" && c.focus && h.push({ tabindex: parseInt(u), child: c });
|
|
454
452
|
}
|
|
455
|
-
|
|
456
|
-
return
|
|
457
|
-
}),
|
|
458
|
-
}, [
|
|
459
|
-
return
|
|
460
|
-
})),
|
|
461
|
-
const { className:
|
|
462
|
-
const
|
|
463
|
-
return (function(
|
|
464
|
-
if (
|
|
465
|
-
function
|
|
466
|
-
let
|
|
467
|
-
return
|
|
453
|
+
h.length !== 0 && (h.sort(function(l, c) {
|
|
454
|
+
return l.tabindex - c.tabindex;
|
|
455
|
+
}), h[0].child.focus());
|
|
456
|
+
}, [e]);
|
|
457
|
+
return S("div", { tabIndex: 0, ref: It([o, t]), onFocus: r, ...n });
|
|
458
|
+
})), Lo = gt(Lt((i, t) => {
|
|
459
|
+
const { className: e, style: n, children: o, radius: r = 4, strokeWidth: a = 1, strokeColor: h = "grey", ...s } = i, [l, { width: c, height: u }] = mt(), d = z(null), f = (T, _ = 0) => {
|
|
460
|
+
const w = T / 2, x = u - w + _;
|
|
461
|
+
return (function(A, P, I = !1) {
|
|
462
|
+
if (P === 0) return A;
|
|
463
|
+
function O(m, C, N) {
|
|
464
|
+
let Q = C.x - m.x, j = C.y - m.y, tt = Math.sqrt(Q * Q + j * j);
|
|
465
|
+
return y(m, C, Math.min(1, N / tt));
|
|
468
466
|
}
|
|
469
|
-
function
|
|
470
|
-
return { x: m.x + (
|
|
467
|
+
function y(m, C, N) {
|
|
468
|
+
return { x: m.x + (C.x - m.x) * N, y: m.y + (C.y - m.y) * N };
|
|
471
469
|
}
|
|
472
|
-
function
|
|
473
|
-
m.length > 2 && (m[m.length - 2] =
|
|
470
|
+
function E(m, C) {
|
|
471
|
+
m.length > 2 && (m[m.length - 2] = C.x, m[m.length - 1] = C.y);
|
|
474
472
|
}
|
|
475
|
-
function
|
|
473
|
+
function M(m) {
|
|
476
474
|
return { x: parseFloat(m[m.length - 2]), y: parseFloat(m[m.length - 1]) };
|
|
477
475
|
}
|
|
478
|
-
let p =
|
|
479
|
-
let
|
|
480
|
-
return
|
|
481
|
-
}, []).reduce(function(m,
|
|
482
|
-
return parseFloat(
|
|
483
|
-
}, []),
|
|
476
|
+
let p = A.split(/[,\s]/).reduce(function(m, C) {
|
|
477
|
+
let N = C.match("([a-zA-Z])(.+)");
|
|
478
|
+
return N ? (m.push(N[1]), m.push(N[2])) : m.push(C), m;
|
|
479
|
+
}, []).reduce(function(m, C) {
|
|
480
|
+
return parseFloat(C) == C && m.length ? m[m.length - 1].push(C) : m.push([C]), m;
|
|
481
|
+
}, []), L = [];
|
|
484
482
|
if (p.length > 1) {
|
|
485
|
-
let m =
|
|
486
|
-
p[p.length - 1][0] === "Z" && p[0].length > 2 && (
|
|
487
|
-
for (let
|
|
488
|
-
let
|
|
489
|
-
if (
|
|
490
|
-
let
|
|
491
|
-
|
|
492
|
-
let
|
|
493
|
-
|
|
494
|
-
} else
|
|
483
|
+
let m = M(p[0]), C = null;
|
|
484
|
+
p[p.length - 1][0] === "Z" && p[0].length > 2 && (C = ["L", m.x, m.y], p[p.length - 1] = C), L.push(p[0]);
|
|
485
|
+
for (let N = 1; N < p.length; N++) {
|
|
486
|
+
let Q = L[L.length - 1], j = p[N], tt = j === C ? p[1] : p[N + 1];
|
|
487
|
+
if (tt && Q && Q.length > 2 && j[0] === "L" && tt.length > 2 && tt[0] === "L") {
|
|
488
|
+
let F, B, W = M(Q), Y = M(j), yt = M(tt);
|
|
489
|
+
I ? (F = y(Y, Q.origPoint || W, P), B = y(Y, tt.origPoint || yt, P)) : (F = O(Y, W, P), B = O(Y, yt, P)), E(j, F), j.origPoint = Y, L.push(j);
|
|
490
|
+
let vt = y(F, Y, 0.5), $ = y(Y, B, 0.5), et = ["C", vt.x, vt.y, $.x, $.y, B.x, B.y];
|
|
491
|
+
et.origPoint = Y, L.push(et);
|
|
492
|
+
} else L.push(j);
|
|
495
493
|
}
|
|
496
|
-
if (
|
|
497
|
-
let
|
|
498
|
-
|
|
494
|
+
if (C) {
|
|
495
|
+
let N = M(L[L.length - 1]);
|
|
496
|
+
L.push(["Z"]), E(L[0], N);
|
|
499
497
|
}
|
|
500
|
-
} else
|
|
501
|
-
return
|
|
502
|
-
return m +
|
|
498
|
+
} else L = p;
|
|
499
|
+
return L.reduce(function(m, C) {
|
|
500
|
+
return m + C.join(" ") + " ";
|
|
503
501
|
}, "");
|
|
504
|
-
})(`${`M 0 ${
|
|
505
|
-
},
|
|
502
|
+
})(`${`M 0 ${w} L ${r - 0.5} ${w} L ${r - 0.5} ${x} L ${2 * r} ${x}`} ${`L ${c - 2 * r} ${x}`} ${`M ${c - 2 * r} ${x} L ${c - r} ${x} L ${c - r} ${w} L ${c} ${w}`}`, r);
|
|
503
|
+
}, v = K(() => f(a), [c, u, r, a]), g = K(() => {
|
|
506
504
|
if (r === 0) return;
|
|
507
|
-
const
|
|
508
|
-
return
|
|
509
|
-
}, [
|
|
510
|
-
return
|
|
511
|
-
})),
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
if (i == null) return null;
|
|
516
|
-
const t = { percent: null, pixels: null };
|
|
517
|
-
let n = e;
|
|
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);
|
|
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;
|
|
521
|
-
if (d) throw new Error("Use elementBefore and elementAfter instead of children.");
|
|
522
|
-
const I = W(() => ce.isValidElement(n) && ce.isValidElement(t), [n, t]), g = W(() => {
|
|
523
|
-
let M = null;
|
|
524
|
-
r && (r === "before" ? M = 0 : r === "after" && (M = 1));
|
|
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));
|
|
528
|
-
V(() => {
|
|
529
|
-
p(de(s, r === null));
|
|
530
|
-
}, [s, r]);
|
|
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) => {
|
|
532
|
-
const ae = [null, null], oe = [null, null];
|
|
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();
|
|
544
|
-
let J = 0;
|
|
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);
|
|
551
|
-
}
|
|
552
|
-
M.stopPropagation(), M.preventDefault();
|
|
553
|
-
}
|
|
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
|
-
setOverrides(e) {
|
|
561
|
-
super.setOverrides(e);
|
|
505
|
+
const T = r / 2;
|
|
506
|
+
return f(r) + `L ${c} 0 L 0 0 L 0 ${T}`;
|
|
507
|
+
}, [v, r, a]), b = K(() => ({ style: { clipPath: `path('${g}')` } }), [g]);
|
|
508
|
+
return bt("div", { className: e, style: { display: "flex", flexDirection: "row", ...n }, ...s, ref: It([d, l, t]), children: [it.isValidElement(o) ? it.cloneElement(o, b) : S(St, {}), S("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: c, height: u, viewBox: `0 0 ${c} ${u}`, children: S("path", { d: v, stroke: h, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: a }) })] });
|
|
509
|
+
})), be = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" };
|
|
510
|
+
class Wn extends fn {
|
|
511
|
+
setOverrides(t) {
|
|
512
|
+
super.setOverrides(t);
|
|
562
513
|
}
|
|
563
514
|
getDelegate() {
|
|
564
515
|
return this._overrides;
|
|
565
516
|
}
|
|
566
|
-
showMessage(
|
|
517
|
+
showMessage(t, e) {
|
|
567
518
|
const n = this.getDelegate();
|
|
568
|
-
if (n?.showMessage) return n.showMessage(
|
|
569
|
-
|
|
519
|
+
if (n?.showMessage) return n.showMessage(t, e);
|
|
520
|
+
e?.type !== be.Warning ? e?.type !== be.Error ? _t.log(t) : _t.error(t) : _t.warn(t);
|
|
570
521
|
}
|
|
571
|
-
showBusy(
|
|
522
|
+
showBusy(t, e) {
|
|
572
523
|
const n = this.getDelegate();
|
|
573
|
-
return n?.showBusy ? n.showBusy(
|
|
524
|
+
return n?.showBusy ? n.showBusy(t, e) : new Promise((o) => {
|
|
574
525
|
o(() => {
|
|
575
526
|
});
|
|
576
527
|
});
|
|
577
528
|
}
|
|
578
|
-
showWindow(
|
|
529
|
+
showWindow(t, e, n) {
|
|
579
530
|
const o = this.getDelegate();
|
|
580
|
-
if (o?.showWindow) return o.showWindow(
|
|
531
|
+
if (o?.showWindow) return o.showWindow(t, e, n);
|
|
581
532
|
}
|
|
582
|
-
showError(
|
|
583
|
-
const
|
|
584
|
-
|
|
533
|
+
showError(t) {
|
|
534
|
+
const e = this.getDelegate();
|
|
535
|
+
e?.showError ? e.showError(t) : _t.error(t);
|
|
585
536
|
}
|
|
586
|
-
showOptions(
|
|
587
|
-
const
|
|
588
|
-
return
|
|
537
|
+
showOptions(t) {
|
|
538
|
+
const e = this.getDelegate();
|
|
539
|
+
return e?.showOptions ? e.showOptions(t) : Promise.resolve("");
|
|
589
540
|
}
|
|
590
|
-
showInputOptions(
|
|
591
|
-
const
|
|
592
|
-
return
|
|
541
|
+
showInputOptions(t) {
|
|
542
|
+
const e = this.getDelegate();
|
|
543
|
+
return e?.showInputOptions ? e.showInputOptions(t) : Promise.resolve({ input: "", option: "" });
|
|
593
544
|
}
|
|
594
545
|
}
|
|
595
|
-
const
|
|
596
|
-
const
|
|
597
|
-
return
|
|
598
|
-
|
|
546
|
+
const He = cn(new Wn()), Co = ({ children: i, notifier: t }) => (it.useEffect(() => {
|
|
547
|
+
const e = _t.getOverrides();
|
|
548
|
+
return _t.setOverrides(t), () => {
|
|
549
|
+
_t.setOverrides(e);
|
|
599
550
|
};
|
|
600
|
-
}, [
|
|
601
|
-
function
|
|
602
|
-
const [
|
|
551
|
+
}, [t]), it.createElement(He.Provider, { value: t }, i)), Ht = () => hn(He);
|
|
552
|
+
function To(i) {
|
|
553
|
+
const [t, e] = J(typeof window < "u" ? window.devicePixelRatio : 1), n = z(null);
|
|
603
554
|
return V(() => {
|
|
604
555
|
if (!(typeof window < "u" && "matchMedia" in window)) return;
|
|
605
556
|
const o = () => {
|
|
606
557
|
const r = window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);
|
|
607
|
-
r.addEventListener("change", o, { once: !0, passive: !0 }),
|
|
558
|
+
r.addEventListener("change", o, { once: !0, passive: !0 }), e(window.devicePixelRatio), n.current = { mediaMatcher: r, listener: o };
|
|
608
559
|
};
|
|
609
560
|
return o(), () => {
|
|
610
561
|
n.current && n.current.mediaMatcher.removeEventListener("change", n.current.listener);
|
|
611
562
|
};
|
|
612
|
-
}, [i]),
|
|
563
|
+
}, [i]), t;
|
|
613
564
|
}
|
|
614
|
-
function
|
|
565
|
+
function Mo(i) {
|
|
615
566
|
if (typeof window > "u") return 1;
|
|
616
|
-
const { defaultDpr:
|
|
617
|
-
return Math.min(Math.max(1, n ? Math.floor(o) : o),
|
|
567
|
+
const { defaultDpr: t = 1, maxDpr: e = 3, round: n = !0 } = i || {}, o = typeof window < "u" && typeof window.devicePixelRatio == "number" ? window.devicePixelRatio : t;
|
|
568
|
+
return Math.min(Math.max(1, n ? Math.floor(o) : o), e);
|
|
618
569
|
}
|
|
619
|
-
function
|
|
620
|
-
const n =
|
|
570
|
+
function ko(i, t, e) {
|
|
571
|
+
const n = D(t, [t]);
|
|
621
572
|
V(() => {
|
|
622
573
|
const o = (r) => {
|
|
623
574
|
i.current && !i.current.contains(r.target) && n(r);
|
|
624
575
|
};
|
|
625
|
-
return
|
|
576
|
+
return e && e.mouseEvents === !1 || (document.addEventListener("mousedown", o), document.addEventListener("touchstart", o)), e && e.focusEvents === !1 || document.addEventListener("focus", o), () => {
|
|
626
577
|
document.removeEventListener("mousedown", o), document.removeEventListener("touchstart", o), document.removeEventListener("focus", o);
|
|
627
578
|
};
|
|
628
579
|
}, [i]);
|
|
629
580
|
}
|
|
630
|
-
function
|
|
581
|
+
function jn(i) {
|
|
631
582
|
if (!i) throw new Error("must have a PointerHandlerOptions");
|
|
632
|
-
const { onPointerDown:
|
|
633
|
-
|
|
634
|
-
}, []),
|
|
635
|
-
|
|
583
|
+
const { onPointerDown: t, onPointerUp: e, onPointerMoveOrWait: n, processTouch: o = !1, consumeTouch: r = !0 } = i, a = D(t, [t]), h = D(e, [e]), s = D(n, [n]), l = z(!1), c = i?.timerInitial ?? 230, u = i?.timerContinuous ?? c / 2, d = z(null), f = z(null), v = z(null), g = z(null), b = R(() => {
|
|
584
|
+
g.current && (clearTimeout(g.current), g.current = null);
|
|
585
|
+
}, []), T = R((E) => {
|
|
586
|
+
g.current = setTimeout(() => {
|
|
636
587
|
window.requestAnimationFrame(() => {
|
|
637
|
-
|
|
638
|
-
}),
|
|
639
|
-
},
|
|
588
|
+
l.current !== !1 && s?.(f.current, v.current, d.current);
|
|
589
|
+
}), T(u);
|
|
590
|
+
}, E ?? c);
|
|
640
591
|
}, []);
|
|
641
|
-
V(() => () =>
|
|
642
|
-
const _ = o ? "pointer" : "mouse",
|
|
643
|
-
|
|
644
|
-
}, []),
|
|
645
|
-
document.removeEventListener(`${_}move`,
|
|
646
|
-
|
|
592
|
+
V(() => () => b(), []);
|
|
593
|
+
const _ = o ? "pointer" : "mouse", w = R((E) => {
|
|
594
|
+
E.stopPropagation(), E.stopImmediatePropagation(), E.preventDefault();
|
|
595
|
+
}, []), x = D((E) => {
|
|
596
|
+
document.removeEventListener(`${_}move`, I), document.removeEventListener(`${_}up`, x), document.removeEventListener("keydown", O), document.removeEventListener("keyup", y), document.removeEventListener("touchstart", w, { capture: !0 }), document.removeEventListener("touchmove", w, { capture: !0 }), window.removeEventListener("blur", A), b(), window.requestAnimationFrame(() => {
|
|
597
|
+
l.current !== !1 && (l.current = !1, h?.(E, v.current, d.current), v.current = null);
|
|
647
598
|
});
|
|
648
|
-
}, []),
|
|
649
|
-
|
|
650
|
-
}, []),
|
|
651
|
-
|
|
652
|
-
|
|
599
|
+
}, []), A = R(() => {
|
|
600
|
+
l.current !== !1 && (l.current = !1, x(f.current));
|
|
601
|
+
}, []), P = D(() => {
|
|
602
|
+
b(), T(u), window.requestAnimationFrame(() => {
|
|
603
|
+
l.current !== !1 && s?.(f.current, v.current, d.current);
|
|
653
604
|
});
|
|
654
|
-
}, [u]),
|
|
655
|
-
|
|
656
|
-
}, []),
|
|
657
|
-
|
|
658
|
-
}, []),
|
|
659
|
-
|
|
605
|
+
}, [u]), I = D((E) => {
|
|
606
|
+
f.current = E, P();
|
|
607
|
+
}, []), O = D((E) => {
|
|
608
|
+
v.current = { ctrlKey: E.ctrlKey, shiftKey: E.shiftKey, altKey: E.altKey, metaKey: E.metaKey }, P();
|
|
609
|
+
}, []), y = D((E) => {
|
|
610
|
+
v.current = { ctrlKey: E.ctrlKey, shiftKey: E.shiftKey, altKey: E.altKey, metaKey: E.metaKey }, P();
|
|
660
611
|
}, [u]);
|
|
661
|
-
return
|
|
662
|
-
|
|
663
|
-
}, [
|
|
612
|
+
return D((E) => {
|
|
613
|
+
E.isDefaultPrevented() || (v.current = { ctrlKey: E.ctrlKey, shiftKey: E.shiftKey, altKey: E.altKey, metaKey: E.metaKey }, a(E, v.current) !== !1 && (d.current = E, f.current = E.nativeEvent, document.addEventListener(`${_}up`, x, { passive: !1 }), document.addEventListener(`${_}move`, I, { passive: !1 }), document.addEventListener("keydown", O, { passive: !1 }), document.addEventListener("keyup", y, { passive: !1 }), window.addEventListener("blur", A, { passive: !0 }), o && r && (document.addEventListener("touchstart", w, { passive: !1, capture: !0 }), document.addEventListener("touchmove", w, { passive: !1, capture: !0 })), l.current = !0, T(c)));
|
|
614
|
+
}, [c, o]);
|
|
664
615
|
}
|
|
665
|
-
function
|
|
666
|
-
return
|
|
616
|
+
function Do(i, t) {
|
|
617
|
+
return jn({ onPointerDown: i, onPointerMoveOrWait: (e, n, o) => {
|
|
667
618
|
i?.(o);
|
|
668
|
-
}, ...
|
|
619
|
+
}, ...t });
|
|
669
620
|
}
|
|
670
|
-
const
|
|
671
|
-
const n =
|
|
672
|
-
if (typeof
|
|
673
|
-
const o =
|
|
674
|
-
return
|
|
675
|
-
n.current !== o && (n.current = o,
|
|
676
|
-
}, [
|
|
677
|
-
},
|
|
621
|
+
const Fn = ({ initValue: i, useHookBody: t, applyStateChange: e }) => {
|
|
622
|
+
const n = z(i);
|
|
623
|
+
if (typeof t != "function") throw new Error("function expected as hook body parameter. got " + typeof t);
|
|
624
|
+
const o = t();
|
|
625
|
+
return ne(() => {
|
|
626
|
+
n.current !== o && (n.current = o, e(o));
|
|
627
|
+
}, [e, o]), null;
|
|
628
|
+
}, Jt = (i) => {
|
|
678
629
|
console && console.warn && console.warn(i);
|
|
679
|
-
},
|
|
680
|
-
let
|
|
681
|
-
const
|
|
682
|
-
|
|
683
|
-
},
|
|
684
|
-
const [
|
|
685
|
-
return n.current =
|
|
630
|
+
}, Yt = typeof self == "object" && self.self === self && self || typeof global == "object" && global.global === global && global || void 0;
|
|
631
|
+
let Yn = 1, Qt = !1, Ve = !1;
|
|
632
|
+
const $t = [], xt = [], Nt = () => {
|
|
633
|
+
xt.forEach((i) => i());
|
|
634
|
+
}, Un = ({ automaticContainerInternalUseOnly: i }) => {
|
|
635
|
+
const [t, e] = J([]), n = z([]);
|
|
636
|
+
return n.current = t, i || Qt !== !1 || (Ve = !0), V(() => {
|
|
686
637
|
let o = !0;
|
|
687
638
|
function r() {
|
|
688
|
-
if (o) return
|
|
639
|
+
if (o) return xt[0] !== r ? (i || Qt !== !0 || Jt("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void e((a) => [])) : void e([...$t]);
|
|
689
640
|
}
|
|
690
|
-
return
|
|
691
|
-
o = !1, n.current?.length > 0 &&
|
|
641
|
+
return xt.push(r), Nt(), () => {
|
|
642
|
+
o = !1, n.current?.length > 0 && Jt("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), xt.splice(xt.indexOf(r), 1), Nt();
|
|
692
643
|
};
|
|
693
|
-
}, [i]),
|
|
694
|
-
},
|
|
695
|
-
const
|
|
696
|
-
return
|
|
697
|
-
if (
|
|
698
|
-
const n =
|
|
699
|
-
|
|
700
|
-
} else
|
|
701
|
-
})(
|
|
702
|
-
|
|
644
|
+
}, [i]), S(St, { children: t.map(({ hook: o, key: r }) => un(Fn, { ...o, key: r })) });
|
|
645
|
+
}, Xn = (i) => {
|
|
646
|
+
const t = Yn++;
|
|
647
|
+
return $t.push({ hook: i, key: t }), xt.length === 0 && Ve === !1 && (Qt = !0, ((e) => {
|
|
648
|
+
if (Yt.document && Yt.document.createElement) {
|
|
649
|
+
const n = Yt.document.createElement("div");
|
|
650
|
+
_n(n).render(S(e, { automaticContainerInternalUseOnly: !0 }));
|
|
651
|
+
} else Jt("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
|
|
652
|
+
})(Un)), Nt(), () => {
|
|
653
|
+
$t.splice($t.findIndex((e) => e.key === t), 1), Nt();
|
|
703
654
|
};
|
|
704
655
|
};
|
|
705
|
-
let
|
|
706
|
-
|
|
707
|
-
let n, o, r = !1,
|
|
708
|
-
const
|
|
709
|
-
o = u,
|
|
710
|
-
},
|
|
656
|
+
let te = null;
|
|
657
|
+
te || (te = (i, t, e = {}) => {
|
|
658
|
+
let n, o, r = !1, a = !1, h = [], { unmountIfNoConsumers: s = !1 } = e;
|
|
659
|
+
const l = (u) => {
|
|
660
|
+
o = u, mn(() => h.forEach((d) => d(u)));
|
|
661
|
+
}, c = () => (a || (o = typeof i == "function" ? i() : i, a = !0), o);
|
|
711
662
|
return () => {
|
|
712
|
-
const [u, d] =
|
|
713
|
-
return V(() => (r || (r = !0, n =
|
|
714
|
-
|
|
663
|
+
const [u, d] = J(c);
|
|
664
|
+
return V(() => (r || (r = !0, n = Xn({ initValue: i, useHookBody: t, applyStateChange: l })), h.push(d), o !== u && d(o), () => {
|
|
665
|
+
h.splice(h.indexOf(d), 1), h.length === 0 && s && (n(), r = !1);
|
|
715
666
|
}), []), u;
|
|
716
667
|
};
|
|
717
668
|
});
|
|
718
|
-
const
|
|
719
|
-
let
|
|
669
|
+
const We = te;
|
|
670
|
+
let je = () => {
|
|
720
671
|
console.warn("You must call useEditMode before setting its state.");
|
|
721
672
|
};
|
|
722
|
-
const
|
|
723
|
-
const [i,
|
|
724
|
-
return
|
|
725
|
-
}),
|
|
726
|
-
const i =
|
|
727
|
-
return
|
|
728
|
-
|
|
673
|
+
const Gn = We(null, () => {
|
|
674
|
+
const [i, t] = J(null);
|
|
675
|
+
return je = t, i;
|
|
676
|
+
}), Po = () => {
|
|
677
|
+
const i = Gn();
|
|
678
|
+
return K(() => ({ setMode: (t) => {
|
|
679
|
+
je((e) => (typeof t == "function" && (t = t(e)), t?.onModeChange?.(t ?? null), t));
|
|
729
680
|
}, getMode: () => i }), [i]);
|
|
730
681
|
};
|
|
731
|
-
class
|
|
732
|
-
constructor(
|
|
733
|
-
this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key =
|
|
682
|
+
class ee {
|
|
683
|
+
constructor(t, e, n, o) {
|
|
684
|
+
this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key = t, this._target = e, this._applyProps(n || {}), this._callback = o, o === void 0 && (this._callback = () => {
|
|
734
685
|
console.log(`implement: ${this.label()} : ${this.description()}`);
|
|
735
686
|
});
|
|
736
687
|
}
|
|
737
688
|
key() {
|
|
738
689
|
return this._key;
|
|
739
690
|
}
|
|
740
|
-
_resolve(
|
|
741
|
-
if (typeof
|
|
742
|
-
const n =
|
|
743
|
-
return
|
|
691
|
+
_resolve(t, e) {
|
|
692
|
+
if (typeof t == "function") {
|
|
693
|
+
const n = e ?? this._context;
|
|
694
|
+
return t(typeof n == "function" ? n() : n);
|
|
744
695
|
}
|
|
745
|
-
return
|
|
696
|
+
return t;
|
|
746
697
|
}
|
|
747
698
|
target() {
|
|
748
699
|
return typeof this._target == "function" ? this._target() : this._target;
|
|
749
700
|
}
|
|
750
|
-
label(
|
|
751
|
-
const n = this._scopedLabels?.[
|
|
701
|
+
label(t, e) {
|
|
702
|
+
const n = this._scopedLabels?.[t] || this._label;
|
|
752
703
|
let o = null;
|
|
753
704
|
if (typeof n == "function") {
|
|
754
|
-
const r =
|
|
705
|
+
const r = e ?? this._context;
|
|
755
706
|
o = n(typeof r == "function" ? r() : r);
|
|
756
707
|
} else o = n;
|
|
757
708
|
return o;
|
|
758
709
|
}
|
|
759
|
-
description(
|
|
760
|
-
return this._resolve(this._description,
|
|
710
|
+
description(t) {
|
|
711
|
+
return this._resolve(this._description, t);
|
|
761
712
|
}
|
|
762
|
-
tags(
|
|
763
|
-
return this._resolve(this._tags,
|
|
713
|
+
tags(t) {
|
|
714
|
+
return this._resolve(this._tags, t);
|
|
764
715
|
}
|
|
765
|
-
icon(
|
|
766
|
-
return this._resolve(this._icon,
|
|
716
|
+
icon(t) {
|
|
717
|
+
return this._resolve(this._icon, t);
|
|
767
718
|
}
|
|
768
719
|
shortcut() {
|
|
769
720
|
return this._resolve(this._shortcut);
|
|
@@ -777,176 +728,176 @@ class tt {
|
|
|
777
728
|
context() {
|
|
778
729
|
return typeof this._context == "function" ? this._context() : this._context;
|
|
779
730
|
}
|
|
780
|
-
async execute(
|
|
731
|
+
async execute(t, e) {
|
|
781
732
|
if (!this.disabled() && this._callback) {
|
|
782
733
|
try {
|
|
783
734
|
let n = !0;
|
|
784
|
-
if (
|
|
785
|
-
const o = this._callback.bind(this)(
|
|
735
|
+
if (e?.beforeExecute && (n = e?.beforeExecute(this, t)), await Promise.resolve(n) === !1) return !1;
|
|
736
|
+
const o = this._callback.bind(this)(t, this);
|
|
786
737
|
if (await Promise.resolve(o) === !1) return !1;
|
|
787
|
-
|
|
738
|
+
e?.onExecute?.(this, t), this._notifyExecute(t);
|
|
788
739
|
} catch (n) {
|
|
789
|
-
return console.warn(n),
|
|
740
|
+
return console.warn(n), e?.onError(this, n, t), this._notifyError(t, n), !1;
|
|
790
741
|
}
|
|
791
742
|
return !0;
|
|
792
743
|
}
|
|
793
744
|
}
|
|
794
|
-
addPropertyListener(
|
|
795
|
-
if (!
|
|
745
|
+
addPropertyListener(t, e = !1) {
|
|
746
|
+
if (!t) throw new Error("listener must be specified");
|
|
796
747
|
const n = this._listenersProperties;
|
|
797
|
-
return n.add(
|
|
798
|
-
n.delete(
|
|
748
|
+
return n.add(t), e && t({}, this), () => {
|
|
749
|
+
n.delete(t);
|
|
799
750
|
};
|
|
800
751
|
}
|
|
801
|
-
addExecuteListener(
|
|
802
|
-
if (!
|
|
803
|
-
const
|
|
804
|
-
return
|
|
805
|
-
|
|
752
|
+
addExecuteListener(t) {
|
|
753
|
+
if (!t) throw new Error("listener must be specified");
|
|
754
|
+
const e = this._listenersExecute;
|
|
755
|
+
return e.add(t), function() {
|
|
756
|
+
e.delete(t);
|
|
806
757
|
};
|
|
807
758
|
}
|
|
808
|
-
_notifyExecute(
|
|
809
|
-
const
|
|
759
|
+
_notifyExecute(t) {
|
|
760
|
+
const e = this;
|
|
810
761
|
this._listenersExecute.forEach((n) => {
|
|
811
|
-
n.onExecute(
|
|
762
|
+
n.onExecute(e, t);
|
|
812
763
|
});
|
|
813
764
|
}
|
|
814
|
-
_notifyError(
|
|
765
|
+
_notifyError(t, e) {
|
|
815
766
|
const n = this;
|
|
816
767
|
this._listenersExecute.forEach((o) => {
|
|
817
|
-
o.onError?.(n,
|
|
768
|
+
o.onError?.(n, t, e);
|
|
818
769
|
});
|
|
819
770
|
}
|
|
820
|
-
updateCallback(
|
|
821
|
-
return this._callback =
|
|
771
|
+
updateCallback(t) {
|
|
772
|
+
return this._callback = t || null, this;
|
|
822
773
|
}
|
|
823
|
-
update(
|
|
824
|
-
if (!
|
|
825
|
-
const
|
|
826
|
-
return Object.keys(
|
|
774
|
+
update(t) {
|
|
775
|
+
if (!t) return;
|
|
776
|
+
const e = this._applyProps(t);
|
|
777
|
+
return Object.keys(e).length > 0 && this._notifyPropertyChange(e), this;
|
|
827
778
|
}
|
|
828
|
-
_notifyPropertyChange(
|
|
829
|
-
const
|
|
779
|
+
_notifyPropertyChange(t) {
|
|
780
|
+
const e = this;
|
|
830
781
|
this._listenersProperties.forEach((n) => {
|
|
831
|
-
n(
|
|
782
|
+
n(t, e);
|
|
832
783
|
});
|
|
833
784
|
}
|
|
834
|
-
_applyProps(
|
|
835
|
-
let
|
|
836
|
-
return Object.keys(
|
|
837
|
-
let r =
|
|
838
|
-
n["_" + o] !== r && (n["_" + o] =
|
|
839
|
-
}),
|
|
785
|
+
_applyProps(t) {
|
|
786
|
+
let e = {}, n = this;
|
|
787
|
+
return Object.keys(t).forEach((o) => {
|
|
788
|
+
let r = t[o];
|
|
789
|
+
n["_" + o] !== r && (n["_" + o] = e[o] = r);
|
|
790
|
+
}), e;
|
|
840
791
|
}
|
|
841
792
|
}
|
|
842
|
-
class
|
|
793
|
+
class Ut extends ee {
|
|
843
794
|
}
|
|
844
|
-
class
|
|
845
|
-
constructor(
|
|
846
|
-
this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid =
|
|
795
|
+
class Fe {
|
|
796
|
+
constructor(t, e) {
|
|
797
|
+
this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid = G.uuidV4(), this._target = t, this._groupKey = e ?? null, this._root = this, this._nodes = /* @__PURE__ */ new Map(), this._nodes.set(e, this), this._children = /* @__PURE__ */ new Map(), this._listeners = /* @__PURE__ */ new Set(), this._commandsByKey = /* @__PURE__ */ new Map(), this._commandsByShortcut = /* @__PURE__ */ new Map();
|
|
847
798
|
const n = this;
|
|
848
799
|
this._unListenersByCommand = /* @__PURE__ */ new Map(), this._listenersByKey = /* @__PURE__ */ new Map(), this._commandsPropertyListener = (o, r) => {
|
|
849
|
-
const
|
|
850
|
-
|
|
800
|
+
const a = n._root._listenersByKey, h = r.key(), s = a.get(h);
|
|
801
|
+
s && n._notifyCommands(s, "onCommandChange", r);
|
|
851
802
|
};
|
|
852
803
|
}
|
|
853
|
-
_getCommand(
|
|
854
|
-
return this._commandsByKey.get(
|
|
804
|
+
_getCommand(t) {
|
|
805
|
+
return this._commandsByKey.get(t) || (this._parent?._getCommand(t) ?? null);
|
|
855
806
|
}
|
|
856
|
-
getCommand(
|
|
807
|
+
getCommand(t, e = !1) {
|
|
857
808
|
const n = this._root._focused;
|
|
858
809
|
let o = n, r = n === this;
|
|
859
810
|
for (; !r && o; ) o === this && (r = !0), o = o._parent;
|
|
860
|
-
return (r ? n : this)._getCommand(
|
|
811
|
+
return (r ? n : this)._getCommand(t);
|
|
861
812
|
}
|
|
862
|
-
createChildGroup(
|
|
813
|
+
createChildGroup(t, e, n) {
|
|
863
814
|
let o;
|
|
864
815
|
if (!n) {
|
|
865
|
-
let
|
|
866
|
-
for (;
|
|
867
|
-
let
|
|
868
|
-
|
|
816
|
+
let h = this;
|
|
817
|
+
for (; h && !o; ) {
|
|
818
|
+
let s = h._nodes.get(e);
|
|
819
|
+
s && (o = s), h = h._parent;
|
|
869
820
|
}
|
|
870
821
|
}
|
|
871
|
-
o || (o = new
|
|
872
|
-
const r = (
|
|
873
|
-
!
|
|
822
|
+
o || (o = new Fe(t, e), o._parent = this, o._root = this._root, o._unListenersByCommand = null, o._listenersByKey = null, o._commandsPropertyListener = null);
|
|
823
|
+
const r = (h, s) => {
|
|
824
|
+
!h.has(e) || n ? h.set(e, s) : n === void 0 && console.warn("commandGroup already registered", e);
|
|
874
825
|
};
|
|
875
826
|
r(this._root._nodes, o);
|
|
876
|
-
let
|
|
877
|
-
for (;
|
|
878
|
-
return this._children.set(
|
|
827
|
+
let a = this._parent;
|
|
828
|
+
for (; a; ) r(this._nodes, o), a = a._parent;
|
|
829
|
+
return this._children.set(e, o), this._notify("onGroupChange"), o;
|
|
879
830
|
}
|
|
880
831
|
getKey() {
|
|
881
832
|
return this._groupKey;
|
|
882
833
|
}
|
|
883
|
-
getGroup(
|
|
884
|
-
return this._nodes.get(
|
|
834
|
+
getGroup(t) {
|
|
835
|
+
return this._nodes.get(t);
|
|
885
836
|
}
|
|
886
|
-
_addCommands(
|
|
887
|
-
const n = this._commandsByKey, o = this._commandsByShortcut, r = this._root._commandsPropertyListener,
|
|
888
|
-
for (let
|
|
889
|
-
const
|
|
890
|
-
if (n.has(
|
|
891
|
-
|
|
837
|
+
_addCommands(t, e = void 0) {
|
|
838
|
+
const n = this._commandsByKey, o = this._commandsByShortcut, r = this._root._commandsPropertyListener, a = this._root._unListenersByCommand;
|
|
839
|
+
for (let h = 0; h < t.length; h++) {
|
|
840
|
+
const s = t[h], l = s.key();
|
|
841
|
+
if (n.has(l) && !e) {
|
|
842
|
+
e === void 0 && console.warn("command already registered", l);
|
|
892
843
|
continue;
|
|
893
844
|
}
|
|
894
|
-
n.set(
|
|
895
|
-
let
|
|
896
|
-
|
|
897
|
-
const u =
|
|
898
|
-
|
|
899
|
-
const d =
|
|
845
|
+
n.set(l, s);
|
|
846
|
+
let c = a.get(s);
|
|
847
|
+
c && (c(), a.delete(s));
|
|
848
|
+
const u = s.addPropertyListener(r);
|
|
849
|
+
a.set(s, u);
|
|
850
|
+
const d = s.shortcut();
|
|
900
851
|
if (!d) continue;
|
|
901
|
-
const
|
|
902
|
-
for (let
|
|
903
|
-
const
|
|
904
|
-
|
|
852
|
+
const f = Array.isArray(d) ? d : [d];
|
|
853
|
+
for (let v = 0; v < f.length; v++) {
|
|
854
|
+
const g = Mt(f[v]), b = o.get(g);
|
|
855
|
+
b && !e && e === void 0 && console.warn(`Shortcut already registered: ${g}, ${l}, ${b}.`), o.set(g, l);
|
|
905
856
|
}
|
|
906
857
|
}
|
|
907
858
|
}
|
|
908
859
|
removeFromParent() {
|
|
909
860
|
if (!this._parent) return;
|
|
910
|
-
let
|
|
861
|
+
let t = this._parent, e = [];
|
|
911
862
|
const n = this._groupKey;
|
|
912
|
-
for (;
|
|
913
|
-
|
|
863
|
+
for (; t; ) e.push(t._nodes), t._nodes.delete(n), t = t._parent;
|
|
864
|
+
t = this._parent;
|
|
914
865
|
const o = (r) => {
|
|
915
|
-
r._children.forEach((
|
|
916
|
-
for (let
|
|
917
|
-
o(
|
|
866
|
+
r._children.forEach((a) => {
|
|
867
|
+
for (let h = 0; h < e.length; h++) a._nodes.delete(e[h]);
|
|
868
|
+
o(a);
|
|
918
869
|
});
|
|
919
870
|
};
|
|
920
871
|
o(this), this._parent = null, this._notify("onGroupChange");
|
|
921
872
|
}
|
|
922
|
-
addCommands(
|
|
923
|
-
this._addCommands(
|
|
873
|
+
addCommands(t, e) {
|
|
874
|
+
this._addCommands(t, e), this._notify("onGroupChange");
|
|
924
875
|
}
|
|
925
876
|
getActive() {
|
|
926
877
|
return this._root._focused ?? this._root;
|
|
927
878
|
}
|
|
928
|
-
activate(
|
|
929
|
-
let
|
|
930
|
-
if (
|
|
879
|
+
activate(t) {
|
|
880
|
+
let e = this;
|
|
881
|
+
if (t && (e = this._nodes.get(t), !e)) return void console.warn("group not found", t);
|
|
931
882
|
let n = this._root._focused ?? this._root;
|
|
932
883
|
for (; n; ) n = n._parent;
|
|
933
|
-
this._root._focused !==
|
|
884
|
+
this._root._focused !== e && (this._root._focused = e, this._notify("onGroupChange"), this._notify("onActiveChange"));
|
|
934
885
|
}
|
|
935
|
-
findCommandByEvent(
|
|
936
|
-
const
|
|
937
|
-
|
|
938
|
-
let n =
|
|
886
|
+
findCommandByEvent(t) {
|
|
887
|
+
const e = [];
|
|
888
|
+
t.altKey && e.push(X.Alt), t.shiftKey && e.push(X.Shift), t.ctrlKey && e.push(X.Ctrl), t.metaKey && e.push(X.Meta);
|
|
889
|
+
let n = Mt({ key: t.code, modifiers: e });
|
|
939
890
|
const o = this._commandsByShortcut;
|
|
940
891
|
let r = o.get(n);
|
|
941
|
-
r || (n =
|
|
942
|
-
let
|
|
943
|
-
return r && (
|
|
892
|
+
r || (n = Mt({ key: t.key, modifiers: e }), r = o.get(n)), !r && t.code.startsWith("Digit") && (n = Mt({ key: t.code.substring(5, t.code.length), modifiers: e }), r = this._commandsByShortcut.get(n)), !r && t.code.startsWith("Key") && (r = Mt({ key: t.code.substring(3, t.code.length), modifiers: e }), r = o.get(n));
|
|
893
|
+
let a = null;
|
|
894
|
+
return r && (a = this._commandsByKey.get(r), a && a.disabled() && (a = null), !a || a.target() && a.target().contains(t.target) || (a = null)), a || (this._parent?.findCommandByEvent(t) ?? null);
|
|
944
895
|
}
|
|
945
|
-
dispatchToFocusedCommand(
|
|
946
|
-
const
|
|
947
|
-
if (!
|
|
948
|
-
const n =
|
|
949
|
-
return !!n && (n.execute(),
|
|
896
|
+
dispatchToFocusedCommand(t) {
|
|
897
|
+
const e = this.getActive();
|
|
898
|
+
if (!e || t.isDefaultPrevented()) return !1;
|
|
899
|
+
const n = e.findCommandByEvent?.(t);
|
|
900
|
+
return !!n && (n.execute(), t.preventDefault(), !0);
|
|
950
901
|
}
|
|
951
902
|
getRoot() {
|
|
952
903
|
return this._parent ? this._parent.getRoot() : this;
|
|
@@ -954,298 +905,677 @@ class Ht {
|
|
|
954
905
|
getParent() {
|
|
955
906
|
return this._parent;
|
|
956
907
|
}
|
|
957
|
-
addListener(
|
|
958
|
-
const n = this._listeners, o =
|
|
959
|
-
if (o && !
|
|
960
|
-
let
|
|
961
|
-
if (o) for (let
|
|
962
|
-
const
|
|
963
|
-
if (!
|
|
964
|
-
let
|
|
965
|
-
|
|
908
|
+
addListener(t, e) {
|
|
909
|
+
const n = this._listeners, o = e?.keys, r = this._root._listenersByKey;
|
|
910
|
+
if (o && !t.onCommandChange) throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");
|
|
911
|
+
let a = null;
|
|
912
|
+
if (o) for (let h = 0; h < o.length; h++) {
|
|
913
|
+
const s = o[h];
|
|
914
|
+
if (!s) continue;
|
|
915
|
+
let l = r.get(s);
|
|
916
|
+
l || (l = /* @__PURE__ */ new Set(), r.set(s, l)), a || (a = []), a.push(l), l.add(t);
|
|
966
917
|
}
|
|
967
|
-
return n.add(
|
|
968
|
-
if (
|
|
969
|
-
|
|
970
|
-
n.delete(
|
|
918
|
+
return n.add(t), () => {
|
|
919
|
+
if (a) for (let h = 0; h < a.length; h++)
|
|
920
|
+
a[h].delete(t);
|
|
921
|
+
n.delete(t);
|
|
971
922
|
};
|
|
972
923
|
}
|
|
973
|
-
_notifyCommands(
|
|
924
|
+
_notifyCommands(t, e, n) {
|
|
974
925
|
const o = this;
|
|
975
926
|
setTimeout(() => {
|
|
976
|
-
|
|
977
|
-
r[
|
|
927
|
+
t.forEach((r) => {
|
|
928
|
+
r[e]?.(o, n);
|
|
978
929
|
});
|
|
979
930
|
}, 0);
|
|
980
931
|
}
|
|
981
|
-
_notify(
|
|
932
|
+
_notify(t, e) {
|
|
982
933
|
const n = this;
|
|
983
934
|
setTimeout(() => {
|
|
984
935
|
n._listeners.forEach((o) => {
|
|
985
|
-
o[
|
|
986
|
-
}), n._parent && n._parent._notify(
|
|
936
|
+
o[t]?.(n, e);
|
|
937
|
+
}), n._parent && n._parent._notify(t, e);
|
|
987
938
|
}, 0);
|
|
988
939
|
}
|
|
989
940
|
getAllCommands() {
|
|
990
|
-
const
|
|
941
|
+
const t = [], e = this._groupKey;
|
|
991
942
|
return this._commandsByKey.forEach((n) => {
|
|
992
|
-
|
|
943
|
+
t.push({ command: n, groupKey: e });
|
|
993
944
|
}), this._children.forEach((n) => {
|
|
994
|
-
|
|
995
|
-
}),
|
|
945
|
+
t.push(...n.getAllCommands());
|
|
946
|
+
}), t;
|
|
996
947
|
}
|
|
997
948
|
}
|
|
998
|
-
const
|
|
999
|
-
const
|
|
1000
|
-
for (let o = 0; i.modifiers && o < i.modifiers.length; o++)
|
|
949
|
+
const Zn = G.getOS() === G.OSType.MacOS || G.getOS() === G.OSType.IOS ? "Cmd" : "Ctrl", qn = G.getOS() === G.OSType.MacOS || G.getOS() === G.OSType.IOS ? "⌘" : "^", Mt = (i, t = !1) => {
|
|
950
|
+
const e = {};
|
|
951
|
+
for (let o = 0; i.modifiers && o < i.modifiers.length; o++) e[i.modifiers[o]] = !0;
|
|
1001
952
|
let n = "";
|
|
1002
|
-
return (
|
|
953
|
+
return (e?.[X.Ctrl] || e?.[X.Meta]) && (n += (n.length > 0 ? "+" : "") + (t ? qn : Zn)), e?.[X.Alt] && (n += t ? "⌥" : "Alt"), e?.[X.Shift] && (n += (n.length > 0 ? "+" : "") + (t ? "⇧" : "Shift")), n += (n.length > 0 ? "+" : "") + Ie(i.key), n;
|
|
1003
954
|
};
|
|
1004
|
-
function
|
|
1005
|
-
const
|
|
1006
|
-
|
|
1007
|
-
const [n, o] =
|
|
955
|
+
function Ao(i, t = null) {
|
|
956
|
+
const e = z(t);
|
|
957
|
+
e.current = t;
|
|
958
|
+
const [n, o] = dn((a) => a + 1, 0), r = K(() => Array.isArray(i) ? i : [i], [i]);
|
|
1008
959
|
return V(() => {
|
|
1009
960
|
if (!r || r.length === 0) return;
|
|
1010
|
-
const
|
|
1011
|
-
|
|
961
|
+
const a = (l, c) => {
|
|
962
|
+
e.current?.onChange?.(c), o();
|
|
1012
963
|
};
|
|
1013
|
-
let
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
}, onError(
|
|
1017
|
-
|
|
964
|
+
let h = null;
|
|
965
|
+
t && (h = { onExecute(l, c) {
|
|
966
|
+
e.current?.onExecute?.(l, c);
|
|
967
|
+
}, onError(l, c, u) {
|
|
968
|
+
e.current?.onError?.(l, c, u);
|
|
1018
969
|
} });
|
|
1019
|
-
const
|
|
1020
|
-
for (let
|
|
970
|
+
const s = /* @__PURE__ */ new Set();
|
|
971
|
+
for (let l = 0; l < r.length; l++) s.add(r[l]?.addPropertyListener(G.debounce(a, 0), !0)), t && s.add(r[l]?.addExecuteListener(h));
|
|
1021
972
|
return () => {
|
|
1022
|
-
|
|
1023
|
-
|
|
973
|
+
s.forEach((l) => {
|
|
974
|
+
l?.();
|
|
1024
975
|
});
|
|
1025
976
|
};
|
|
1026
977
|
}, [i]), n;
|
|
1027
978
|
}
|
|
1028
|
-
const
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
t.
|
|
979
|
+
const zt = (i, t) => {
|
|
980
|
+
if (!t || !i || t.length === 0) return G.EmptyArray;
|
|
981
|
+
const e = t.length, n = new Array(e);
|
|
982
|
+
for (let o = 0; o < e; o++) {
|
|
983
|
+
const r = t[o], a = r ? i.getCommand(r) : null;
|
|
984
|
+
n[o] = a;
|
|
1033
985
|
}
|
|
1034
|
-
return
|
|
986
|
+
return n;
|
|
1035
987
|
};
|
|
1036
|
-
function
|
|
1037
|
-
const o =
|
|
1038
|
-
o.current =
|
|
1039
|
-
const [r,
|
|
988
|
+
function zo(i, t = null, e = null, n) {
|
|
989
|
+
const o = z(e);
|
|
990
|
+
o.current = e, t && !Array.isArray(t) && (t = [t]);
|
|
991
|
+
const [r, a] = J(zt(i, t)), h = n ? [...n, i] : [i];
|
|
1040
992
|
return V(() => {
|
|
1041
|
-
const
|
|
1042
|
-
const d =
|
|
1043
|
-
|
|
993
|
+
const s = { onGroupChange: () => {
|
|
994
|
+
const d = zt(i, t);
|
|
995
|
+
a(d), o.current?.onChange?.(this);
|
|
1044
996
|
} };
|
|
1045
|
-
let
|
|
1046
|
-
|
|
1047
|
-
o.current?.onChange?.(i),
|
|
997
|
+
let l;
|
|
998
|
+
t && t.length > 0 && (l = { keys: t }, s.onCommandChange = (d, f) => {
|
|
999
|
+
o.current?.onChange?.(i), a(zt(i, t));
|
|
1048
1000
|
});
|
|
1049
|
-
const
|
|
1050
|
-
return
|
|
1051
|
-
|
|
1001
|
+
const c = i?.addListener(s, l), u = zt(i, t);
|
|
1002
|
+
return a(u), o.current?.onChange && o.current?.onChange(i), () => {
|
|
1003
|
+
c?.();
|
|
1052
1004
|
};
|
|
1053
|
-
},
|
|
1005
|
+
}, h), r;
|
|
1054
1006
|
}
|
|
1055
|
-
const
|
|
1007
|
+
const Bo = { Toolbar: "toolbar", Menuitem: "menuitem" }, Jn = We({ setClipboard: (i) => {
|
|
1056
1008
|
throw new Error("This is only available via the useClipboard.");
|
|
1057
|
-
}, getClipboard: () =>
|
|
1058
|
-
const [i,
|
|
1059
|
-
return { setClipboard: (
|
|
1060
|
-
}),
|
|
1061
|
-
const { source:
|
|
1062
|
-
|
|
1063
|
-
const _ =
|
|
1009
|
+
}, getClipboard: () => Rt.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
|
|
1010
|
+
const [i, t] = J(Rt.Global);
|
|
1011
|
+
return { setClipboard: (e) => t(e), getClipboard: () => i, refNativeCopy: z(null), refNativeLastKey: z(null) };
|
|
1012
|
+
}), Oo = (i) => {
|
|
1013
|
+
const { source: t, target: e, onPaste: n, onClipboardUpdate: o, commands: r } = i, a = Ht(), h = D(o, [o]), s = D(n, [n]), { getClipboard: l, refNativeCopy: c } = Jn(), u = l();
|
|
1014
|
+
K(() => {
|
|
1015
|
+
const _ = t?.element, w = e?.element ?? t?.element;
|
|
1064
1016
|
if (!r) return;
|
|
1065
|
-
const
|
|
1066
|
-
r?.addCommands(
|
|
1017
|
+
const x = [new Ut("cut", _, { label: "Cut", description: "Remove the selection and put it on the clipboard so you can paste it somewhere else.", icon: "cut", shortcut: { key: "X", modifiers: [X.Ctrl] } }), new Ut("copy", _, { label: "Copy", description: "Put a copy of the selection on the clipboard so you can paste it somewhere else.", icon: "copy", shortcut: { key: "C", modifiers: [X.Ctrl] } }), new Ut("paste", w, { label: "Paste", description: "Add content on the clipboard to your document.", icon: "paste", shortcut: [{ key: "V", modifiers: [X.Ctrl] }, { key: "F8", modifiers: [X.Ctrl] }] })];
|
|
1018
|
+
r?.addCommands(x, !0);
|
|
1067
1019
|
}, [r]);
|
|
1068
|
-
const d =
|
|
1069
|
-
if (!
|
|
1070
|
-
let
|
|
1020
|
+
const d = D(async (_) => {
|
|
1021
|
+
if (!t?.element) return;
|
|
1022
|
+
let w = null;
|
|
1071
1023
|
try {
|
|
1072
|
-
|
|
1073
|
-
} catch (
|
|
1074
|
-
throw
|
|
1024
|
+
w = t.doCopy?.(_), typeof w == "string" ? await u.writeText(w) : await u.writeReference(w);
|
|
1025
|
+
} catch (x) {
|
|
1026
|
+
throw x;
|
|
1075
1027
|
}
|
|
1076
|
-
}, [
|
|
1077
|
-
const
|
|
1078
|
-
if (
|
|
1079
|
-
|
|
1028
|
+
}, [t, a]), f = D(async (_) => {
|
|
1029
|
+
const w = t?.element?.();
|
|
1030
|
+
if (w) {
|
|
1031
|
+
c.current = { sourceElement: w, args: _ };
|
|
1080
1032
|
try {
|
|
1081
1033
|
await d(_);
|
|
1082
|
-
} catch (
|
|
1083
|
-
|
|
1034
|
+
} catch (x) {
|
|
1035
|
+
a.showError?.(x);
|
|
1084
1036
|
}
|
|
1085
1037
|
}
|
|
1086
|
-
}, [
|
|
1087
|
-
|
|
1088
|
-
}, []),
|
|
1038
|
+
}, [t?.element, a]), v = R(() => {
|
|
1039
|
+
f({ isCut: !0 });
|
|
1040
|
+
}, []), g = D(async (_, w, x) => {
|
|
1089
1041
|
try {
|
|
1090
|
-
if (await _.doPaste(
|
|
1091
|
-
|
|
1092
|
-
} catch (
|
|
1093
|
-
|
|
1042
|
+
if (await _.doPaste(w, x) === !1) return;
|
|
1043
|
+
s?.(w, x);
|
|
1044
|
+
} catch (A) {
|
|
1045
|
+
a.showError?.(A);
|
|
1094
1046
|
}
|
|
1095
|
-
}, [
|
|
1096
|
-
const
|
|
1097
|
-
if (
|
|
1098
|
-
const
|
|
1099
|
-
if (
|
|
1100
|
-
return await
|
|
1101
|
-
} catch (
|
|
1102
|
-
|
|
1047
|
+
}, [s]), b = D(async (_, w, x) => {
|
|
1048
|
+
const A = e?.element?.();
|
|
1049
|
+
if (A && await G.whenFocus(A), !_ && !w) return;
|
|
1050
|
+
const P = await a.showBusy?.("Pasting...");
|
|
1051
|
+
if (w) try {
|
|
1052
|
+
return await g(e, w, x), void P?.();
|
|
1053
|
+
} catch (y) {
|
|
1054
|
+
P?.(), a.showError?.(y);
|
|
1103
1055
|
}
|
|
1104
|
-
let
|
|
1105
|
-
|
|
1056
|
+
let I, O = e.importFromExternal;
|
|
1057
|
+
O || (O = (y, E) => ({ getItemType: () => "text", toText: () => _.text, isClipboardItem: !0 }));
|
|
1106
1058
|
try {
|
|
1107
|
-
|
|
1108
|
-
} catch (
|
|
1109
|
-
|
|
1110
|
-
}
|
|
1111
|
-
if ($) try {
|
|
1112
|
-
const g = await Promise.resolve($);
|
|
1113
|
-
await x(t, g, f), z?.();
|
|
1114
|
-
} catch (g) {
|
|
1115
|
-
z?.(), s.showError?.(g);
|
|
1059
|
+
I = await O(_, { isCut: !1 });
|
|
1060
|
+
} catch (y) {
|
|
1061
|
+
P?.(), a.showError?.(y);
|
|
1116
1062
|
}
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
const y = await u.readReference();
|
|
1121
|
-
if (y) return void await S(null, y, _);
|
|
1122
|
-
const f = [];
|
|
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);
|
|
1124
|
-
const k = { text: f[0] ?? null, html: f[1] ?? null, image: f[2] ?? null };
|
|
1125
|
-
await S(k, null, _);
|
|
1063
|
+
if (I) try {
|
|
1064
|
+
const y = await Promise.resolve(I);
|
|
1065
|
+
await g(e, y, x), P?.();
|
|
1126
1066
|
} catch (y) {
|
|
1127
|
-
|
|
1128
|
-
|
|
1067
|
+
P?.(), a.showError?.(y);
|
|
1068
|
+
}
|
|
1069
|
+
else P?.();
|
|
1070
|
+
}, [g, e, a]), T = D(async (_) => {
|
|
1071
|
+
if (e?.element) try {
|
|
1072
|
+
const w = await u.readReference();
|
|
1073
|
+
if (w) return void await b(null, w, _);
|
|
1074
|
+
const x = [];
|
|
1075
|
+
x[0] = await Wt.readStringFromClipboard(u, jt.plain), x[1] = await Wt.readHTMLFromClipboard(u, jt.html), x[2] = await Wt.readBlobFromClipboard(u, jt.png);
|
|
1076
|
+
const A = { text: x[0] ?? null, html: x[1] ?? null, image: x[2] ?? null };
|
|
1077
|
+
await b(A, null, _);
|
|
1078
|
+
} catch (w) {
|
|
1079
|
+
if (w?.message === "Document is not focused.") return;
|
|
1080
|
+
a.showError?.(w);
|
|
1129
1081
|
}
|
|
1130
|
-
}, [
|
|
1131
|
-
return
|
|
1132
|
-
}, [
|
|
1133
|
-
}, [
|
|
1082
|
+
}, [b, e?.element, a]);
|
|
1083
|
+
return D(async (_) => {
|
|
1084
|
+
}, [t?.element]), D(async (_) => {
|
|
1085
|
+
}, [e?.element, b, a]), V(() => {
|
|
1134
1086
|
if (!u) return;
|
|
1135
|
-
const _ = async (
|
|
1136
|
-
const
|
|
1137
|
-
|
|
1138
|
-
},
|
|
1139
|
-
|
|
1140
|
-
},
|
|
1141
|
-
|
|
1087
|
+
const _ = async (A) => {
|
|
1088
|
+
const P = await u.readReference();
|
|
1089
|
+
h?.(P);
|
|
1090
|
+
}, w = (A) => {
|
|
1091
|
+
a.showMessage?.(Rt.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
|
|
1092
|
+
}, x = (A) => {
|
|
1093
|
+
a.showMessage?.(Rt.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
|
|
1142
1094
|
};
|
|
1143
|
-
return u.addEventListener("clipboardchange", _), u.addEventListener("clipboarderrorread",
|
|
1144
|
-
u.removeEventListener("clipboardchange", _), u.removeEventListener("clipboarderrorread",
|
|
1095
|
+
return u.addEventListener("clipboardchange", _), u.addEventListener("clipboarderrorread", w), u.addEventListener("clipboarderrorwrite", x), () => {
|
|
1096
|
+
u.removeEventListener("clipboardchange", _), u.removeEventListener("clipboarderrorread", w), u.removeEventListener("clipboarderrorwrite", x);
|
|
1145
1097
|
};
|
|
1146
|
-
}, [u,
|
|
1147
|
-
}, [d,
|
|
1148
|
-
r?.getCommand("cut")?.updateCallback(
|
|
1149
|
-
}, [
|
|
1098
|
+
}, [u, a]), V(() => {
|
|
1099
|
+
}, [d, b, t, e]), V(() => {
|
|
1100
|
+
r?.getCommand("cut")?.updateCallback(v).update({ disabled: !t || !e }), r?.getCommand("copy")?.updateCallback(f).update({ disabled: !t }), r?.getCommand("paste")?.updateCallback(T).update({ disabled: !e });
|
|
1101
|
+
}, [t, e, r]), { paste: T, copy: f, clipboard: u };
|
|
1150
1102
|
};
|
|
1151
|
-
function
|
|
1152
|
-
const
|
|
1103
|
+
function $o(i, t = !0) {
|
|
1104
|
+
const e = z(i);
|
|
1153
1105
|
V(() => {
|
|
1154
|
-
if (
|
|
1155
|
-
const n = Object.entries(i).reduce((o, [r,
|
|
1106
|
+
if (t) {
|
|
1107
|
+
const n = Object.entries(i).reduce((o, [r, a]) => (e.current[r] !== a && (o[r] = [e.current[r], a]), o), {});
|
|
1156
1108
|
Object.keys(n).length > 0 && console.log("Changed props:", n);
|
|
1157
1109
|
}
|
|
1158
|
-
|
|
1110
|
+
e.current = i;
|
|
1159
1111
|
});
|
|
1160
1112
|
}
|
|
1161
|
-
let
|
|
1162
|
-
var
|
|
1163
|
-
const
|
|
1164
|
-
const [i,
|
|
1165
|
-
return
|
|
1166
|
-
i == null &&
|
|
1167
|
-
}, []),
|
|
1168
|
-
|
|
1113
|
+
let Xt = !1, Qn = 0;
|
|
1114
|
+
var to = typeof document < "u" ? ne : V;
|
|
1115
|
+
const Se = () => "sheetxl-ui-" + Qn++, Ee = it.useId, Ko = Ee ?? function() {
|
|
1116
|
+
const [i, t] = it.useState(() => Xt ? Se() : void 0);
|
|
1117
|
+
return to(() => {
|
|
1118
|
+
i == null && t(Se());
|
|
1119
|
+
}, []), it.useEffect(() => {
|
|
1120
|
+
Xt || (Xt = !0);
|
|
1169
1121
|
}, []), i;
|
|
1170
|
-
},
|
|
1171
|
-
const n =
|
|
1122
|
+
}, Le = "Undo the last action.", Ce = "Repeat the last action or undo the redo.", eo = (i) => `Redo ${i}`, Ro = ({ manager: i, commands: t, disabled: e }) => {
|
|
1123
|
+
const n = Ht(), o = D((a) => {
|
|
1172
1124
|
try {
|
|
1173
|
-
i?.undo(
|
|
1174
|
-
} catch (
|
|
1175
|
-
n.error(
|
|
1125
|
+
i?.undo(a);
|
|
1126
|
+
} catch (h) {
|
|
1127
|
+
n.error(h);
|
|
1176
1128
|
}
|
|
1177
|
-
}, [i]), r =
|
|
1129
|
+
}, [i]), r = D((a) => {
|
|
1178
1130
|
try {
|
|
1179
|
-
i?.redo(
|
|
1180
|
-
} catch (
|
|
1181
|
-
n.error(
|
|
1131
|
+
i?.redo(a);
|
|
1132
|
+
} catch (h) {
|
|
1133
|
+
n.error(h);
|
|
1182
1134
|
}
|
|
1183
1135
|
}, [i]);
|
|
1184
|
-
return
|
|
1185
|
-
if (!
|
|
1186
|
-
const
|
|
1187
|
-
} },
|
|
1188
|
-
|
|
1189
|
-
}, [
|
|
1190
|
-
if (!
|
|
1191
|
-
const
|
|
1192
|
-
const
|
|
1193
|
-
var
|
|
1194
|
-
|
|
1136
|
+
return K(() => {
|
|
1137
|
+
if (!t) return;
|
|
1138
|
+
const a = { contains: (s) => !0, focus() {
|
|
1139
|
+
} }, h = [new ee("undo", a, { label: "Undo", description: Le, shortcut: { key: "z", modifiers: [X.Ctrl] }, disabled: !0 }, o), new ee("redo", a, { label: "Redo", description: Ce, shortcut: [{ key: "y", modifiers: [X.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [X.Alt] }], disabled: !0 }, r)];
|
|
1140
|
+
t?.addCommands(h, !0);
|
|
1141
|
+
}, [t]), V(() => {
|
|
1142
|
+
if (!t) return;
|
|
1143
|
+
const a = () => {
|
|
1144
|
+
const s = i?.getTopUndoDescription(), l = {};
|
|
1145
|
+
var c;
|
|
1146
|
+
t.getCommand("undo").update({ disabled: e || !i || !i.hasUndo(), description: s ? (c = s, `Undo ${c}`) : Le, state: l, context: { undoManager: i } });
|
|
1195
1147
|
const u = i?.getTopRedoDescription();
|
|
1196
|
-
|
|
1148
|
+
t.getCommand("redo").update({ disabled: e || !i || !i.hasRedo(), description: u ? eo(u) : Ce, state: l, context: { undoManager: i } });
|
|
1197
1149
|
};
|
|
1198
|
-
if (
|
|
1199
|
-
const
|
|
1200
|
-
|
|
1150
|
+
if (a(), !i) return;
|
|
1151
|
+
const h = i.addListener({ onStackChange() {
|
|
1152
|
+
a();
|
|
1201
1153
|
} });
|
|
1202
|
-
return () =>
|
|
1203
|
-
}, [i,
|
|
1154
|
+
return () => h?.();
|
|
1155
|
+
}, [i, t, e]), { undo: o, redo: r };
|
|
1156
|
+
};
|
|
1157
|
+
class no extends pn {
|
|
1158
|
+
static getDerivedStateFromError() {
|
|
1159
|
+
return { hasError: !0 };
|
|
1160
|
+
}
|
|
1161
|
+
componentDidCatch(t) {
|
|
1162
|
+
this.props.onError?.(t);
|
|
1163
|
+
}
|
|
1164
|
+
render() {
|
|
1165
|
+
return this.props.children;
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
const Io = ({ children: i }) => {
|
|
1169
|
+
const t = Ht(), e = R((n) => {
|
|
1170
|
+
t.showError(n);
|
|
1171
|
+
}, [t]);
|
|
1172
|
+
return S(no, { onError: e, children: i });
|
|
1204
1173
|
};
|
|
1174
|
+
class oo {
|
|
1175
|
+
constructor(t) {
|
|
1176
|
+
this.notifier = t, this.handleUnhandledRejection = (e) => {
|
|
1177
|
+
const n = e.reason;
|
|
1178
|
+
n instanceof DOMException && n.name === "AbortError" || this.notifier.showError(n);
|
|
1179
|
+
}, this.handleGlobalError = (e) => {
|
|
1180
|
+
this.notifier.showError(e.error);
|
|
1181
|
+
}, this.setupGlobalHandlers();
|
|
1182
|
+
}
|
|
1183
|
+
setupGlobalHandlers() {
|
|
1184
|
+
window.addEventListener("unhandledrejection", this.handleUnhandledRejection), window.addEventListener("error", this.handleGlobalError);
|
|
1185
|
+
}
|
|
1186
|
+
cleanup() {
|
|
1187
|
+
window.removeEventListener("unhandledrejection", this.handleUnhandledRejection), window.removeEventListener("error", this.handleGlobalError);
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
const No = ({ children: i }) => {
|
|
1191
|
+
const t = Ht();
|
|
1192
|
+
return V(() => {
|
|
1193
|
+
const e = new oo(t);
|
|
1194
|
+
return () => {
|
|
1195
|
+
e.cleanup();
|
|
1196
|
+
};
|
|
1197
|
+
}, [t]), S(St, { children: i });
|
|
1198
|
+
}, Ho = () => null, io = {}, ro = (i) => {
|
|
1199
|
+
const { onPointerDown: t, style: e, splitDirection: n, paddingBefore: o = 0, paddingAfter: r = 0, disabled: a, key: h, hitAreaProps: s = io, ...l } = i, c = n === "row", { style: u, className: d, ...f } = s;
|
|
1200
|
+
return S("div", { style: { ...e, position: "relative" }, ...l, children: S("div", { className: wt("hit-box", d), style: { left: (c ? -o : 0) + "px", width: `calc(100% + ${c ? o + r : 0}px)`, top: (c ? 0 : -o) + "px", height: `calc(100% + ${c ? 0 : o + r}px)`, position: "absolute", ...u }, onPointerDown: a ? void 0 : t, ...f }) }, h);
|
|
1201
|
+
}, Bt = {}, ft = (i, t, e = !0) => i === null ? null : i.pixels !== null ? e ? i.pixels : t - i.pixels : (e ? i.percent : 100 - i.percent) / 100 * t, Ot = (i, t = !0) => i?.percent ? `${t ? i.percent : 100 - i.percent}%` : i?.pixels ? `${i.pixels}px` : void 0, ut = (i, t) => {
|
|
1202
|
+
if (i == null) return null;
|
|
1203
|
+
const e = { percent: null, pixels: null };
|
|
1204
|
+
let n = t;
|
|
1205
|
+
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 ? e.percent = i : e.pixels = i, Object.freeze(e);
|
|
1206
|
+
}, Vo = gt(Lt((i, t) => {
|
|
1207
|
+
const { elementBefore: e, elementAfter: n, splitDirection: o = "row", fixedPane: r = null, position: a, onPositionChange: h, minBefore: s, maxBefore: l, minAfter: c, maxAfter: u, children: d, className: f, style: v, disabled: g = !1, onDragStart: b, onDragResize: T, onDragFinish: _, resizerProps: w = Bt, paneProps: x = Bt, paneBeforeProps: A = Bt, paneAfterProps: P = Bt, createResizer: I = ro } = i;
|
|
1208
|
+
if (d) throw new Error("Use elementBefore and elementAfter instead of children.");
|
|
1209
|
+
const O = K(() => it.isValidElement(n) && it.isValidElement(e), [n, e]), y = K(() => {
|
|
1210
|
+
let k = null;
|
|
1211
|
+
r && (r === "before" ? k = 0 : r === "after" && (k = 1));
|
|
1212
|
+
const H = k === null;
|
|
1213
|
+
return { fixedPaneOffset: k, isPercent: H, minBefore: ut(s, H), maxBefore: ut(l, H), minAfter: ut(c, H), maxAfter: ut(u, H) };
|
|
1214
|
+
}, [s, l, c, u]), E = D(h, [h]), [M, p] = J(() => ut(a, r === null));
|
|
1215
|
+
V(() => {
|
|
1216
|
+
p(ut(a, r === null));
|
|
1217
|
+
}, [a, r]);
|
|
1218
|
+
const [L, { width: m, height: C }] = mt(), [N, { width: Q, height: j }] = mt(), tt = o === "row" ? Q : j, F = o === "row" ? m : C, B = K(() => ((k, H, Z, U) => {
|
|
1219
|
+
const lt = [null, null], ot = [null, null];
|
|
1220
|
+
if (k || (k = { percent: U.fixedPaneOffset === null ? 50 : null, pixels: U.fixedPaneOffset === null ? null : 0 }), H === 0) return k?.pixels != null ? U.fixedPaneOffset !== 1 ? (lt[0] = k?.pixels, ot[1] = 100) : (lt[1] = k?.pixels - Z, ot[0] = 100) : k?.percent != null && (U.fixedPaneOffset !== 1 ? (ot[0] = k?.percent, ot[1] = 100 - k?.percent) : (ot[1] = k?.percent, ot[0] = 100 - k?.percent)), { percents: ot, pixels: lt, minBefore: Ot(U.minBefore, !0), maxBefore: Ot(U.maxBefore, !0), minAfter: Ot(U.minAfter), maxAfter: Ot(U.maxAfter) };
|
|
1221
|
+
let ht = ft(k, H, U.fixedPaneOffset !== 1), nt = H - Z, de = ft(U.minBefore, nt, !0) ?? 0, rn = ft(U.maxBefore, nt, !0) ?? nt, Pt = 0, Vt = 0, pe = 0, fe = nt;
|
|
1222
|
+
Pt = (ft(U.maxAfter, H, !1) ?? Z) - Z, Vt = ft(U.minAfter, H, !1) ?? H, pe = Math.max(de, Pt), fe = Math.min(rn, Vt), ht = Math.max(pe, Math.min(ht, fe)), Vt = Math.min(nt - ht, ft(U.maxAfter, nt - ht, !0) ?? nt), Pt = Math.min(nt - ht, ft(U.minAfter, nt - ht, !0) ?? nt), lt[0] = ht, lt[1] = nt - lt[0];
|
|
1223
|
+
const sn = Math.max(0, Math.min(100, ht / nt * 100));
|
|
1224
|
+
return ot[0] = sn, ot[1] = 100 - ot[0], { percents: ot, pixels: lt, minBefore: `${de}px`, minAfter: `${Pt}px`, maxBefore: `${lt[0]}px`, maxAfter: `${lt[1]}px` };
|
|
1225
|
+
})(M, F, tt, y), [y, M, F, tt, o]), [W, Y] = J(!1), yt = D(b, [b]), vt = D(T, [T]), $ = D(_, [_]), et = z(null), rt = z(null), pt = z(null), { style: at, className: ct, ...Ct } = x, re = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", height: "100%", widthResizer: "100%", display: "flex", overflow: "hidden", position: "relative", ...at }, { className: Ye, style: Ue, ...Xe } = A, { className: Ge, style: Ze, ...qe } = P, Je = { flex: "1 1 100%", width: "100%", ...v, flexDirection: o, display: "flex" }, { className: se, style: le, onPointerDown: ae, ...ce } = w, Qe = D((k) => {
|
|
1226
|
+
const H = ut(k, r === null);
|
|
1227
|
+
p(H);
|
|
1228
|
+
}, [r]), kt = D((k) => {
|
|
1229
|
+
if (g || !W) return;
|
|
1230
|
+
const H = ue.current?.getBoundingClientRect();
|
|
1231
|
+
let Z = 0;
|
|
1232
|
+
Z = o === "row" ? (k.clientX ?? k.touches?.[0]?.clientX) - H.x : (k.clientY ?? k.touches?.[0]?.clientY) - H.y, Z = Math.max(0, Math.min(F, Z)), y.fixedPaneOffset === 1 && (Z = F - Z), a && M.pixels === Z || p({ pixels: Z, percent: null }), vt?.(Z), k.stopPropagation(), k.preventDefault();
|
|
1233
|
+
}, [y, o, g, W, M, F]), he = D((k) => {
|
|
1234
|
+
if (document.removeEventListener("pointermove", kt), document.removeEventListener("touchmove", kt), document.removeEventListener("pointerup", he), !!W && (Y(!1), !!M)) {
|
|
1235
|
+
if ($(M.pixels), !ut(a, r === null) || M.pixels !== a) {
|
|
1236
|
+
const H = { ...M };
|
|
1237
|
+
H.percent === null && (H.percent = H.pixels / F * 100), E(H);
|
|
1238
|
+
}
|
|
1239
|
+
k.stopPropagation(), k.preventDefault();
|
|
1240
|
+
}
|
|
1241
|
+
}, [M, W, a, r, F]), tn = D((k) => {
|
|
1242
|
+
ae?.(k), k.defaultPrevented || g || W || (Y(!0), yt(), document.addEventListener("pointermove", kt, { passive: !1 }), document.addEventListener("touchmove", kt, { passive: !1 }), document.addEventListener("pointerup", he, { passive: !1 }));
|
|
1243
|
+
}, [ae]), ue = Ne(t, () => ({ setPosition: Qe, isSplitPane: () => !0 }), []), en = K(() => O ? I?.({ key: "resizer", ref: It([N, rt]), className: wt("resizer", se), onPointerDownCapture: tn, style: { cursor: g ? 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, ...le }, splitDirection: o, disabled: g, ...ce }) : null, [O, se, ce, o, le, g]), Dt = o === "row" ? "Width" : "Height", nn = K(() => {
|
|
1244
|
+
if (!e) return null;
|
|
1245
|
+
const k = { ...re, ...Ue, flex: y.fixedPaneOffset === 0 && B?.pixels[0] !== null ? `0 0 ${Math.round(B?.pixels[0])}px` : `1 1 ${Math.round(B?.percents[0] ?? 100)}%`, [`min${Dt}`]: B?.minBefore, [`max${Dt}`]: n ? B?.maxBefore : "100%" };
|
|
1246
|
+
return S("div", { ref: et, className: wt("before", ct, Ye), style: k, ...Ct, ...Xe, children: e }, "before");
|
|
1247
|
+
}, [e, x, A, y, B]), on = K(() => {
|
|
1248
|
+
if (!n) return null;
|
|
1249
|
+
const k = { ...re, ...Ze, flex: y.fixedPaneOffset === 1 && B?.pixels[1] !== null ? `0 0 ${Math.round(B?.pixels[1])}px` : `1 1 ${Math.round(B?.percents[1] ?? 100)}%`, [`min${Dt}`]: B?.minAfter, [`max${Dt}`]: e ? B?.maxAfter : "100%" };
|
|
1250
|
+
return S("div", { ref: pt, className: wt("after", ct, Ge), style: k, ...Ct, ...qe, children: n }, "after");
|
|
1251
|
+
}, [n, x, P, y, B]);
|
|
1252
|
+
return bt("div", { ref: It([L, ue]), className: wt("splitPane", o === "row" ? "vertical" : "horizontal", { dragging: W }, f), style: Je, children: [nn, en, on] });
|
|
1253
|
+
}));
|
|
1254
|
+
function so(i) {
|
|
1255
|
+
if (typeof i == "function") return i;
|
|
1256
|
+
if (typeof i == "string") {
|
|
1257
|
+
const t = i.trim();
|
|
1258
|
+
if (t.startsWith("data:image/svg+xml")) {
|
|
1259
|
+
const e = (function(n) {
|
|
1260
|
+
const o = /^data:image\/svg\+xml(;[^,]*)?,(.*)$/i.exec(n.trim());
|
|
1261
|
+
if (!o) return null;
|
|
1262
|
+
const r = o[1] || "", a = o[2] || "";
|
|
1263
|
+
try {
|
|
1264
|
+
if (/;base64/i.test(r)) {
|
|
1265
|
+
if (typeof atob < "u") {
|
|
1266
|
+
const h = atob(a);
|
|
1267
|
+
if (typeof TextDecoder < "u") {
|
|
1268
|
+
const l = new Uint8Array(h.length);
|
|
1269
|
+
for (let c = 0; c < h.length; c++) l[c] = h.charCodeAt(c);
|
|
1270
|
+
return new TextDecoder("utf-8").decode(l);
|
|
1271
|
+
}
|
|
1272
|
+
let s = "";
|
|
1273
|
+
for (let l = 0; l < h.length; l++)
|
|
1274
|
+
s += `%${h.charCodeAt(l).toString(16).padStart(2, "0")}`;
|
|
1275
|
+
return decodeURIComponent(s);
|
|
1276
|
+
}
|
|
1277
|
+
return (globalThis.Buffer ? globalThis.Buffer.from(a, "base64") : require("buffer").Buffer.from(a, "base64")).toString("utf-8");
|
|
1278
|
+
}
|
|
1279
|
+
try {
|
|
1280
|
+
return decodeURIComponent(a);
|
|
1281
|
+
} catch {
|
|
1282
|
+
return a;
|
|
1283
|
+
}
|
|
1284
|
+
} catch {
|
|
1285
|
+
return null;
|
|
1286
|
+
}
|
|
1287
|
+
})(t);
|
|
1288
|
+
if (e) return ke(e);
|
|
1289
|
+
}
|
|
1290
|
+
if (t.startsWith("<")) {
|
|
1291
|
+
if (/^<\s*svg\b/i.test(t)) return ke(t);
|
|
1292
|
+
if (/^<\s*path\b/i.test(t)) {
|
|
1293
|
+
const e = Te(t);
|
|
1294
|
+
if (e) return { paths: [{ d: e }] };
|
|
1295
|
+
}
|
|
1296
|
+
return { paths: [{ d: t }] };
|
|
1297
|
+
}
|
|
1298
|
+
return { paths: [{ d: t }] };
|
|
1299
|
+
}
|
|
1300
|
+
if (Array.isArray(i)) {
|
|
1301
|
+
const t = [];
|
|
1302
|
+
for (const e of i) if (typeof e == "string") {
|
|
1303
|
+
const n = String(e).trim();
|
|
1304
|
+
if (n.startsWith("<path")) {
|
|
1305
|
+
const o = Te(n);
|
|
1306
|
+
o && t.push({ d: o });
|
|
1307
|
+
} else t.push({ d: n });
|
|
1308
|
+
} else e && typeof e == "object" && "d" in e && typeof e.d == "string" && t.push({ ...e });
|
|
1309
|
+
return { paths: t };
|
|
1310
|
+
}
|
|
1311
|
+
return i;
|
|
1312
|
+
}
|
|
1313
|
+
function Te(i) {
|
|
1314
|
+
const t = /\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(i);
|
|
1315
|
+
return t ? t[1] ?? t[2] ?? null : null;
|
|
1316
|
+
}
|
|
1317
|
+
function Me(i) {
|
|
1318
|
+
if ("svg" in i) return { ...i, svg: so(i.svg) };
|
|
1319
|
+
if ("url" in i) {
|
|
1320
|
+
const t = typeof i.url == "string" ? { src: i.url } : i.url;
|
|
1321
|
+
return { ...i, url: t };
|
|
1322
|
+
}
|
|
1323
|
+
if ("emoji" in i) {
|
|
1324
|
+
const t = typeof i.emoji == "string" ? i.emoji : i.emoji.text;
|
|
1325
|
+
return { ...i, emoji: t };
|
|
1326
|
+
}
|
|
1327
|
+
return i;
|
|
1328
|
+
}
|
|
1329
|
+
function ke(i) {
|
|
1330
|
+
try {
|
|
1331
|
+
if (typeof DOMParser < "u") {
|
|
1332
|
+
const a = new DOMParser().parseFromString(i, "image/svg+xml"), h = a.querySelector("svg"), s = h?.getAttribute("viewBox") ?? void 0, l = [];
|
|
1333
|
+
return a.querySelectorAll("path").forEach((c) => {
|
|
1334
|
+
const u = c.getAttribute("d");
|
|
1335
|
+
if (!u) return;
|
|
1336
|
+
const d = { d: u }, f = c.getAttribute("class");
|
|
1337
|
+
f && (d.className = f);
|
|
1338
|
+
const v = c.getAttribute("fill");
|
|
1339
|
+
v && v !== "none" && (d.fill = v);
|
|
1340
|
+
const g = c.getAttribute("stroke");
|
|
1341
|
+
g && (d.stroke = g);
|
|
1342
|
+
const b = c.getAttribute("opacity");
|
|
1343
|
+
b && (d.opacity = Number(b));
|
|
1344
|
+
const T = c.getAttribute("fill-rule");
|
|
1345
|
+
T && (d.fillRule = T);
|
|
1346
|
+
const _ = c.getAttribute("clip-rule");
|
|
1347
|
+
_ && (d.clipRule = _), l.push(d);
|
|
1348
|
+
}), { viewBox: s, paths: l };
|
|
1349
|
+
}
|
|
1350
|
+
} catch {
|
|
1351
|
+
}
|
|
1352
|
+
const t = i.match(/viewBox="([^"]+)"/i), e = t ? t[1] : void 0, n = [], o = /<path\b[^>]*\sd="([^"]+)"[^>]*>/gi;
|
|
1353
|
+
let r;
|
|
1354
|
+
for (; r = o.exec(i); ) n.push({ d: r[1] });
|
|
1355
|
+
return { viewBox: e, paths: n };
|
|
1356
|
+
}
|
|
1357
|
+
function De(i) {
|
|
1358
|
+
const t = {};
|
|
1359
|
+
for (const [r, a] of Object.entries(i.icons)) t[r] = Me(a);
|
|
1360
|
+
const e = { label: i.meta?.label ?? "Unnamed", version: i.meta?.version ?? "1.0.0", license: i.meta?.license ?? "MIT", defaultViewBox: "0 0 24 24", extends: i.meta?.extends ?? [] };
|
|
1361
|
+
e.extends.includes("base") || e.extends.push("base");
|
|
1362
|
+
const n = { meta: e, icons: t }, o = i.overrides;
|
|
1363
|
+
if (o) {
|
|
1364
|
+
const r = {};
|
|
1365
|
+
for (const [a, h] of Object.entries(o)) {
|
|
1366
|
+
const s = {};
|
|
1367
|
+
for (const [l, c] of Object.entries(h)) s[l] = Me(c);
|
|
1368
|
+
r[a] = s;
|
|
1369
|
+
}
|
|
1370
|
+
n.__overrides = r;
|
|
1371
|
+
}
|
|
1372
|
+
return n;
|
|
1373
|
+
}
|
|
1374
|
+
function lo() {
|
|
1375
|
+
const i = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
|
|
1376
|
+
let e = "base", n = /* @__PURE__ */ new Map();
|
|
1377
|
+
async function o(s) {
|
|
1378
|
+
const l = i.get(s ?? e);
|
|
1379
|
+
if (!l) throw new Error(`Icon pack not registered: ${s}`);
|
|
1380
|
+
if (!l.pack) {
|
|
1381
|
+
if (!l.loading) {
|
|
1382
|
+
if (!l.loader) throw new Error(`No loader for icon pack: ${s}`);
|
|
1383
|
+
l.loading = l.loader().then((c) => {
|
|
1384
|
+
const u = c && typeof c == "object" && "default" in c ? c.default : c;
|
|
1385
|
+
l.pack = De(u);
|
|
1386
|
+
}).catch((c) => {
|
|
1387
|
+
throw l.loading = void 0, c;
|
|
1388
|
+
});
|
|
1389
|
+
}
|
|
1390
|
+
await l.loading;
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
function r(s) {
|
|
1394
|
+
const l = s.indexOf(":");
|
|
1395
|
+
return l > 0 ? { ns: s.slice(0, l), key: s.slice(l + 1) } : { key: s };
|
|
1396
|
+
}
|
|
1397
|
+
function a(s, l) {
|
|
1398
|
+
const c = [s, ...i.get(s)?.pack?.meta.extends ?? []];
|
|
1399
|
+
for (const u of c) {
|
|
1400
|
+
const d = i.get(u);
|
|
1401
|
+
if (!d?.pack) continue;
|
|
1402
|
+
const { icons: f } = d.pack, v = f[t.get(u)?.get(l) ?? l] ?? f[l];
|
|
1403
|
+
if (v) return { glyph: v, pack: d.pack, packKey: u };
|
|
1404
|
+
}
|
|
1405
|
+
return null;
|
|
1406
|
+
}
|
|
1407
|
+
function h(s, l) {
|
|
1408
|
+
const c = l?.packKey ?? e;
|
|
1409
|
+
if (l?.packKey) return a(l.packKey, s);
|
|
1410
|
+
if (!s) return null;
|
|
1411
|
+
const { ns: u, key: d } = r(s);
|
|
1412
|
+
if (u) {
|
|
1413
|
+
const f = i.get(u)?.pack;
|
|
1414
|
+
if (f) {
|
|
1415
|
+
if (i.get(e)?.pack) {
|
|
1416
|
+
const g = f.__overrides, b = g?.[e]?.[d];
|
|
1417
|
+
if (b) return { glyph: b, pack: f, packKey: u };
|
|
1418
|
+
}
|
|
1419
|
+
const v = a(u, d);
|
|
1420
|
+
if (v) return v;
|
|
1421
|
+
}
|
|
1422
|
+
return null;
|
|
1423
|
+
}
|
|
1424
|
+
return a(c, s);
|
|
1425
|
+
}
|
|
1426
|
+
return { register: function(s, l) {
|
|
1427
|
+
const c = i.get(s) ?? {};
|
|
1428
|
+
typeof l == "function" ? c.loader = l : c.pack = De(l), i.set(s, c), e || (e = s);
|
|
1429
|
+
}, prefetch: async function(s = e) {
|
|
1430
|
+
const l = Array.isArray(s) ? s : [s];
|
|
1431
|
+
await Promise.all(l.map(o));
|
|
1432
|
+
}, setActive: function(s) {
|
|
1433
|
+
e = s;
|
|
1434
|
+
for (const l of n.keys()) try {
|
|
1435
|
+
l(s);
|
|
1436
|
+
} catch {
|
|
1437
|
+
}
|
|
1438
|
+
}, getActive: function() {
|
|
1439
|
+
return e;
|
|
1440
|
+
}, resolve: async function(s, l) {
|
|
1441
|
+
let c = h(s, l);
|
|
1442
|
+
if (c) return c;
|
|
1443
|
+
const u = l?.packKey ?? e, { ns: d } = r(s);
|
|
1444
|
+
if (l?.packKey) {
|
|
1445
|
+
if (await o(u), c = h(s, l), c) return c;
|
|
1446
|
+
const f = i.get(u)?.pack?.meta?.extends ?? [];
|
|
1447
|
+
if (f.length && (await Promise.all(f.map(o)), c = h(s, l), c)) return c;
|
|
1448
|
+
} else if (d) {
|
|
1449
|
+
if (await o(d), c = h(s, l), c) return c;
|
|
1450
|
+
const f = i.get(d)?.pack?.meta?.extends ?? [];
|
|
1451
|
+
if (f.length && (await Promise.all(f.map(o)), c = h(s, l), c)) return c;
|
|
1452
|
+
} else {
|
|
1453
|
+
if (await o(u), c = h(s, l), c) return c;
|
|
1454
|
+
const f = i.get(u)?.pack?.meta?.extends ?? [];
|
|
1455
|
+
if (f.length && (await Promise.all(f.map(o)), c = h(s, l), c)) return c;
|
|
1456
|
+
}
|
|
1457
|
+
return null;
|
|
1458
|
+
}, registerAlias: function(s, l, c) {
|
|
1459
|
+
t.has(s) || t.set(s, /* @__PURE__ */ new Map()), t.get(s).set(l, c);
|
|
1460
|
+
}, has: function(s, l) {
|
|
1461
|
+
return !!h(s, l);
|
|
1462
|
+
}, getPack: function(s) {
|
|
1463
|
+
return i.get(s ?? e)?.pack;
|
|
1464
|
+
}, hasPack: function(s) {
|
|
1465
|
+
return !!i.get(s)?.pack;
|
|
1466
|
+
}, listPacks: function() {
|
|
1467
|
+
return Array.from(i.keys());
|
|
1468
|
+
}, listIcons: function(s) {
|
|
1469
|
+
const l = i.get(s)?.pack;
|
|
1470
|
+
return l ? Object.keys(l.icons) : [];
|
|
1471
|
+
}, addActiveListener: function(s) {
|
|
1472
|
+
const l = n.get(s);
|
|
1473
|
+
if (l) return l;
|
|
1474
|
+
const c = () => {
|
|
1475
|
+
n.delete(s);
|
|
1476
|
+
};
|
|
1477
|
+
return n.set(s, c), c;
|
|
1478
|
+
} };
|
|
1479
|
+
}
|
|
1480
|
+
const Kt = lo();
|
|
1481
|
+
Kt.register("base", () => import("./DG6oB4sgLAgJaOve.mjs"));
|
|
1482
|
+
const Pe = (i) => S("svg", { ...i, children: S("path", {}) }), ao = { Icon: "_Icon_1ipwo_10" }, co = gt((i) => {
|
|
1483
|
+
const { iconKey: t, packKey: e, className: n, style: o, role: r, title: a, size: h, ariaHidden: s, sourceProps: l, children: c, ...u } = i, [d, f] = it.useState(null);
|
|
1484
|
+
it.useEffect(() => {
|
|
1485
|
+
let p = !0, L = e, m = t;
|
|
1486
|
+
if (!m) {
|
|
1487
|
+
const C = Kt.getPack(L);
|
|
1488
|
+
return void f({ glyph: C ? { svg: G.EmptyArray } : void 0, pack: C ?? void 0, packKey: L ?? Kt.getActive() });
|
|
1489
|
+
}
|
|
1490
|
+
if (m.includes(":")) {
|
|
1491
|
+
const [C, N] = m.split(":");
|
|
1492
|
+
L = C, m = N;
|
|
1493
|
+
}
|
|
1494
|
+
return Kt.resolve(m, { packKey: L }).then((C) => {
|
|
1495
|
+
p && f(C);
|
|
1496
|
+
}), () => {
|
|
1497
|
+
p = !1;
|
|
1498
|
+
};
|
|
1499
|
+
}, [t, e]);
|
|
1500
|
+
const v = d?.pack, g = d?.glyph, b = d?.packKey;
|
|
1501
|
+
let T = g ? g.svg : void 0;
|
|
1502
|
+
const _ = g && !T ? g.url : void 0, w = !g || T || _ ? void 0 : g.emoji, x = h != null ? typeof h == "number" ? `${h}px` : h : void 0, A = K(() => [ao.Icon, "icon", n].filter(Boolean).join(" "), [n]), P = K(() => {
|
|
1503
|
+
const p = { ...o };
|
|
1504
|
+
return p["--icon-size"] = x, p;
|
|
1505
|
+
}, [o, x]), I = r ?? (a ? "img" : "presentation"), O = s ?? (!a || void 0), y = (p) => S("span", { className: A, style: P, role: I, "aria-hidden": O, title: a, "data-icon-glyph": t, "data-icon-pack": b, ...u, children: p });
|
|
1506
|
+
if (c) return y(c);
|
|
1507
|
+
if (w) return y(S("span", { children: typeof w == "string" ? w : w.text }));
|
|
1508
|
+
if (_) return y(S("img", { src: _.src, alt: a ?? "" }));
|
|
1509
|
+
if (g && "react" in g) {
|
|
1510
|
+
const p = g.react, L = { className: A, style: P, role: I, "aria-hidden": O, title: a, ...u, ...l };
|
|
1511
|
+
return y(S(p, { ...L }));
|
|
1512
|
+
}
|
|
1513
|
+
const E = { viewBox: T?.viewBox ?? v?.meta.defaultViewBox ?? "0 0 24 24" };
|
|
1514
|
+
if (typeof T == "function")
|
|
1515
|
+
return y(T(E) ?? S(Pe, { ...E }));
|
|
1516
|
+
if (!T) return y(S(Pe, { ...E }));
|
|
1517
|
+
const M = T.paths;
|
|
1518
|
+
return y(S("svg", { ...E, children: M ? M.map((p, L) => S("path", { d: p.d, className: p.className, fill: p.fill, stroke: p.stroke, opacity: p.opacity, fillRule: p.fillRule, clipRule: p.clipRule }, L)) : null }));
|
|
1519
|
+
});
|
|
1520
|
+
function Wo(i) {
|
|
1521
|
+
const { isWalking: t = !1, themedType: e = "info", speed: n = 120, dashGap: o = 3, dashLength: r = 5, iconKey: a, packKey: h, style: s, className: l, ...c } = i, u = K(() => {
|
|
1522
|
+
if (!t) return;
|
|
1523
|
+
const f = { "--walk-duration": `${n * (o + r)}ms`, "--walk-dash-length": `${r}px`, "--walk-dash-gap": `${o}px` };
|
|
1524
|
+
return e && e !== "accent" && (f["--icon-accent"] = `var(--icon-${e})`), f;
|
|
1525
|
+
}, [t, n, o, r, e]), d = K(() => t ? l + " walking" : l, [t, l]);
|
|
1526
|
+
return S(co, { iconKey: a, packKey: h, className: d, style: { ...s, ...u }, ...c });
|
|
1527
|
+
}
|
|
1205
1528
|
export {
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1529
|
+
ee as Command,
|
|
1530
|
+
Bo as CommandButtonType,
|
|
1531
|
+
Fe as CommandGroup,
|
|
1532
|
+
Kt as DefaultDynamicIconService,
|
|
1533
|
+
Wn as DefaultReactNotifier,
|
|
1534
|
+
co as DynamicIcon,
|
|
1535
|
+
Ho as ErrorTestPanel,
|
|
1536
|
+
Eo as FocusKeyNavigation,
|
|
1537
|
+
mo as HorizontalAlignment,
|
|
1538
|
+
go as KeyCodes,
|
|
1539
|
+
X as KeyModifiers,
|
|
1540
|
+
yo as MouseButtonCodes,
|
|
1541
|
+
Co as NotifierProvider,
|
|
1542
|
+
be as NotifierType,
|
|
1543
|
+
Io as ReactErrorBoundary,
|
|
1544
|
+
xo as ReactUtils,
|
|
1545
|
+
Lo as RoundedTab,
|
|
1546
|
+
$n as ScrollPane,
|
|
1547
|
+
wo as ScrollUtils,
|
|
1548
|
+
oe as Scrollbar,
|
|
1549
|
+
st as ScrollbarOrientation,
|
|
1550
|
+
Ut as SimpleCommand,
|
|
1551
|
+
Vo as SplitPane,
|
|
1552
|
+
ro as SplitPaneResizer,
|
|
1553
|
+
So as ToolTipPlacement,
|
|
1554
|
+
No as UncaughtErrorBoundary,
|
|
1555
|
+
Vn as VirtualScrollbar,
|
|
1556
|
+
Wo as WalkingIcon,
|
|
1557
|
+
lo as createDynamicIconService,
|
|
1558
|
+
On as defaultCreateScrollCorner,
|
|
1559
|
+
vo as defaultCreateScrollEdgeButton,
|
|
1560
|
+
wn as defaultCreateScrollEndButton,
|
|
1561
|
+
vn as defaultCreateScrollStartButton,
|
|
1562
|
+
xe as defaultCreateScrollbar,
|
|
1563
|
+
Mo as getDevicePixelRatio,
|
|
1564
|
+
Mt as toShortcutString,
|
|
1565
|
+
D as useCallbackRef,
|
|
1566
|
+
Ao as useCommand,
|
|
1567
|
+
zo as useCommands,
|
|
1568
|
+
Oo as useCopyPaste,
|
|
1569
|
+
To as useDevicePixelRatio,
|
|
1570
|
+
Po as useEditMode,
|
|
1571
|
+
bo as useFullscreenPortal,
|
|
1572
|
+
Jn as useGlobalClipboard,
|
|
1573
|
+
Ko as useId,
|
|
1574
|
+
Ne as useImperativeElement,
|
|
1575
|
+
Do as useMouseDownAndHoldListener,
|
|
1576
|
+
Ht as useNotifier,
|
|
1577
|
+
ko as useOnClickOrFocusAway,
|
|
1578
|
+
jn as useSynchronizedPointerHandler,
|
|
1579
|
+
$o as useTraceUpdate,
|
|
1580
|
+
Ro as useUndoManager
|
|
1251
1581
|
};
|