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