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