@sheetxl/utils-react 0.7.23 → 0.7.25
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/{Bhq-qomDuX-3Zv9l.cjs → 9KKOlESwiTD1ICGm.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{Czq3S5X04g1B_iOl.mjs → D7SQx0X3SaYbQ8_r.mjs} +1 -1
- package/browser/esm/index.mjs +2 -2
- package/node/esm/{1il9ZLP9RKvPohl7.mjs → CZ8VXxBwgT4_x2I0.mjs} +1 -1
- package/node/esm/index.mjs +2 -2
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
2
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.25
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
package/browser/cjs/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
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_gqxsx_24 ::-webkit-scrollbar-button{background:transparent}._scrollbar_gqxsx_24{display:flex;flex:1 1 100%;overflow:hidden;border-radius:var(--scrollbar-border-radius);align-items:center;border:var(--scrollbar-border-width) solid transparent}._scrollbar_gqxsx_24 ._track_gqxsx_35{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_gqxsx_24 ._thumb_gqxsx_47{background:var(--scrollbar-thumb-color);border-radius:var(--scrollbar-border-radius);transition:background .12s;touch-action:none}._scrollbar_gqxsx_24 ._thumb_gqxsx_47:hover{background:var(--scrollbar-active-color)}._scrollbar_gqxsx_24.vertical{flex-direction:column;min-width:var(--scrollbar-width, 0px);max-width:var(--scrollbar-width, 100%)}._scrollbar_gqxsx_24.vertical ._thumb_gqxsx_47{min-height:var(--scrollbar-min-thumb-size)}._scrollbar_gqxsx_24.vertical ._track_gqxsx_35{width:100%}._scrollbar_gqxsx_24.horizontal{flex-direction:row;min-height:var(--scrollbar-height, 0px);max-height:var(--scrollbar-height, 100%)}._scrollbar_gqxsx_24.horizontal ._thumb_gqxsx_47{min-width:var(--scrollbar-min-thumb-size)}._scrollbar_gqxsx_24.horizontal ._track_gqxsx_35{height:100%}._scrollbar_gqxsx_24.dragging ._thumb_gqxsx_47{background:var(--scrollbar-active-color)}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89{display:flex;align-items:center;justify-content:center;border:none;background:transparent;padding:0}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89>*{fill:var(--scrollbar-button-color);transition:fill .12s ease}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89:hover:not([disabled])>*{fill:var(--scrollbar-active-color)}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89[disabled]>*{fill:var(--scrollbar-button-color);opacity:.5}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89.vertical{width:var(--scrollbar-width)}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89.horizontal{height:var(--scrollbar-height)}._touch-thumb_gqxsx_124{position:absolute;cursor:grab;pointer-events:all;transition-property:opacity;border-radius:9999px;will-change:opacity;opacity:.7}._touch-thumb_gqxsx_124:hover,._touch-thumb_gqxsx_124.dragging{opacity:1}._scrollpane_1fbi8_2{position:relative;display:flex}._vertical-container_1fbi8_7{display:flex;flex:0}._horizontal-corner-container_1fbi8_12{display:flex;flex:none;flex-direction:row;align-items:stretch;justify-content:center}._horizontal-container_1fbi8_20{display:flex;flex:1 1 100%;flex-direction:column}._scrollbar-sizer_1fbi8_26{display:flex;flex:1 1 100%;align-items:stretch;justify-content:stretch}._scrollpane-content_1fbi8_34{position:relative;width:100%;flex:1 1 100%;display:flex;flex-direction:column;box-sizing:border-box}._scrollpane-content-element_1fbi8_43{display:flex;flex:1 1 100%;overflow:hidden}")),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
2
|
"use strict";/**
|
|
3
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
3
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.25
|
|
4
4
|
*
|
|
5
5
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
6
6
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
7
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),$=require("@sheetxl/utils"),E=require("react/jsx-runtime"),gn=require("react-dom/client"),Nt=require("react-dom"),Y={Shift:"shift",Alt:"alt",Ctrl:"ctrl",Meta:"meta"};class Ye{constructor(e,t,n,r){this._listenersProperties=new Set,this._listenersExecute=new Set,this._key=e,this._target=t,this._applyProps(n||{}),this._callback=r,r===void 0&&(this._callback=()=>{console.log(`implement: ${this.getLabel()} : ${this.getDescription()}`)})}getKey(){return this._key}_resolve(e,t){if(typeof e=="function"){const n=t??this._context;return e(typeof n=="function"?n():n)}return e}getTarget(){return typeof this._target=="function"?this._target():this._target}getLabel(e,t){const n=this._scopedLabels?.[e]||this._label;let r=null;if(typeof n=="function"){const i=t??this._context;r=n(typeof i=="function"?i():i)}else r=n;return r}getDescription(e){return this._resolve(this._description,e)}getTags(e){return this._resolve(this._tags,e)}getIcon(e){return this._resolve(this._icon,e)}getShortcut(){return this._resolve(this._shortcut)}disabled(){return this._resolve(this._disabled)||!this._callback}getState(){return this._resolve(this._state)}getContext(){return typeof this._context=="function"?this._context():this._context}async execute(e,t){if(!this.disabled()&&this._callback){try{let n=!0;if(t?.beforeExecute&&(n=t?.beforeExecute(this,e)),await Promise.resolve(n)===!1)return!1;const r=this._callback.bind(this)(e,this);if(await Promise.resolve(r)===!1)return!1;t?.onExecute?.(this,e),this._notifyExecute(e)}catch(n){return console.warn(n),t?.onError(this,n,e),this._notifyError(e,n),!1}return!0}}addPropertyListener(e,t=!1){if(!e)throw new Error("listener must be specified");const n=this._listenersProperties;return n.add(e),t&&e({},this),()=>{n.delete(e)}}addExecuteListener(e){if(!e)throw new Error("listener must be specified");const t=this._listenersExecute;return t.add(e),function(){t.delete(e)}}_notifyExecute(e){const t=this;this._listenersExecute.forEach(n=>{n.onExecute(t,e)})}_notifyError(e,t){const n=this;this._listenersExecute.forEach(r=>{r.onError?.(n,e,t)})}updateCallback(e){return this._callback=e||null,this}update(e){if(!e)return;const t=this._applyProps(e);return Object.keys(t).length>0&&this._notifyPropertyChange(t),this}_notifyPropertyChange(e){const t=this;this._listenersProperties.forEach(n=>{n(e,t)})}_applyProps(e){let t={},n=this;return Object.keys(e).forEach(r=>{let i=e[r];n["_"+r]!==i&&(n["_"+r]=t[r]=i)}),t}}class We extends Ye{}var ee=typeof window<"u"?window:{screen:{},navigator:{}},Se=(ee.matchMedia||function(){return{matches:!1}}).bind(ee),Kt=!1,yn={get passive(){return Kt=!0}},wt=function(){};ee.addEventListener&&ee.addEventListener("p",wt,yn),ee.removeEventListener&&ee.removeEventListener("p",wt,!1);var vn=Kt,bn="PointerEvent"in ee,_t="ontouchstart"in ee,Ht=_t||"TouchEvent"in ee&&Se("(any-pointer: coarse)").matches,xt=(ee.navigator.maxTouchPoints||0)>0||Ht,Wt=ee.navigator.userAgent||"",wn=Se("(pointer: coarse)").matches&&/iPad|Macintosh/.test(Wt)&&Math.min(ee.screen.width||0,ee.screen.height||0)>=768,Ft=(Se("(pointer: coarse)").matches||!Se("(pointer: fine)").matches&&_t)&&!/Windows.*Firefox/.test(Wt),xn=Se("(any-pointer: fine)").matches||Se("(any-hover: hover)").matches||wn||!_t,ut=!xt||!xn&&Ft?xt?"touchOnly":"mouseOnly":"hybrid",Sn=ut==="mouseOnly"?"mouse":ut==="touchOnly"||Ft?"touch":"mouse";const En=Object.freeze(Object.defineProperty({__proto__:null,deviceType:ut,primaryInput:Sn,supportsPassiveEvents:vn,supportsPointerEvents:bn,supportsTouchEvents:Ht},Symbol.toStringTag,{value:"Module"})),Cn=new Set(["INPUT","TEXTAREA","SELECT"]),Ut={};function Pe(){return En}const Vt=o=>o==="BracketLeft"?"[":o==="BracketRight"?"]":$.CommonUtils.camelToPrettyCase(o),qe=(o,e)=>{let t=!1,n=!1;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:()=>{t=!0,o.preventDefault()},isDefaultPrevented:()=>t,stopPropagation:()=>{n=!0,o.stopPropagation()},isPropagationStopped:()=>n,persist:()=>{},timeStamp:o.timeStamp,type:o.type};for(const i in o)i in r||typeof o[i]=="function"||(r[i]=o[i]);return r},Mn=Object.freeze(Object.defineProperty({__proto__:null,EmptyCssProperties:Ut,boundPixel:function(o,e=!1,t=0){return o},createSyntheticEvent:qe,detectIt:Pe,focusableNodeNames:Cn,toPrettyKeyCode:Vt},Symbol.toStringTag,{value:"Module"}));class gt{constructor(e,t){this._target=null,this._groupKey=null,this._root=null,this._parent=null,this._uuid=$.CommonUtils.uuidV4(),this._target=e,this._groupKey=t??null,this._root=this,this._nodes=new Map,this._nodes.set(t,this),this._children=new Map,this._listeners=new Set,this._commandsByKey=new Map,this._commandsByShortcut=new Map;const n=this;this._unListenersByCommand=new Map,this._listenersByKey=new Map,this._commandsPropertyListener=(r,i)=>{const c=n._root._listenersByKey,d=i.getKey(),s=c.get(d);s&&n._notifyCommands(s,"onCommandChange",i)}}_getCommand(e){return this._commandsByKey.get(e)||(this._parent?._getCommand(e)??null)}getCommand(e,t=!1){const n=this._root._focused;let r=n,i=n===this;for(;!i&&r;)r===this&&(i=!0),r=r._parent;return(i?n:this)._getCommand(e)}createChildGroup(e,t,n){let r;if(!n){let d=this;for(;d&&!r;){let s=d._nodes.get(t);s&&(r=s),d=d._parent}}r||(r=new gt(e,t),r._parent=this,r._root=this._root,r._unListenersByCommand=null,r._listenersByKey=null,r._commandsPropertyListener=null);const i=(d,s)=>{!d.has(t)||n?d.set(t,s):n===void 0&&console.warn("commandGroup already registered",t)};i(this._root._nodes,r);let c=this._parent;for(;c;)i(this._nodes,r),c=c._parent;return this._children.set(t,r),this._notify("onGroupChange"),r}getKey(){return this._groupKey}getGroup(e){return this._nodes.get(e)}_addCommands(e,t=void 0){const n=this._commandsByKey,r=this._commandsByShortcut,i=this._root._commandsPropertyListener,c=this._root._unListenersByCommand,d=e.length;for(let s=0;s<d;s++){const l=e[s],a=l.getKey();if(n.has(a)&&!t){t===void 0&&console.warn("command already registered",a);continue}n.set(a,l);let h=c.get(l);h&&(h(),c.delete(l));const f=l.addPropertyListener(i);c.set(l,f);const p=l.getShortcut();if(!p)continue;const _=Array.isArray(p)?p:[p],m=_.length;for(let S=0;S<m;S++){const C=we(_[S]),y=r.get(C);y&&!t&&t===void 0&&console.warn(`Shortcut already registered: ${C}, ${a}, ${y}.`),r.set(C,a)}}}removeFromParent(){if(!this._parent)return;let e=this._parent,t=[];const n=this._groupKey;for(;e;)t.push(e._nodes),e._nodes.delete(n),e=e._parent;e=this._parent;const r=i=>{i._children.forEach(c=>{const d=t.length,s=c._nodes;for(let l=0;l<d;l++)s.delete(t[l]);r(c)})};r(this),this._parent=null,this._notify("onGroupChange")}addCommands(e,t){this._addCommands(e,t),this._notify("onGroupChange")}getActive(){return this._root._focused??this._root}activate(e){let t=this;if(e&&(t=this._nodes.get(e),!t))return void console.warn("group not found",e);let n=this._root._focused??this._root;for(;n;)n=n._parent;this._root._focused!==t&&(this._root._focused=t,this._notify("onGroupChange"),this._notify("onActiveChange"))}findCommandByEvent(e){const t=[];e.altKey&&t.push(Y.Alt),e.shiftKey&&t.push(Y.Shift),e.ctrlKey&&t.push(Y.Ctrl),e.metaKey&&t.push(Y.Meta);let n=we({key:e.code,modifiers:t});const r=this._commandsByShortcut;let i=r.get(n);i||(n=we({key:e.key,modifiers:t}),i=r.get(n)),!i&&e.code.startsWith("Digit")&&(n=we({key:e.code.substring(5,e.code.length),modifiers:t}),i=this._commandsByShortcut.get(n)),!i&&e.code.startsWith("Key")&&(i=we({key:e.code.substring(3,e.code.length),modifiers:t}),i=r.get(n));let c=null;return i&&(c=this._commandsByKey.get(i),c&&c.disabled()&&(c=null),!c||c.getTarget()&&c.getTarget().contains(e.target)||(c=null)),c||(this._parent?.findCommandByEvent(e)??null)}dispatchToFocusedCommand(e){const t=this.getActive();if(!t||e.isDefaultPrevented())return!1;const n=t.findCommandByEvent?.(e);return!!n&&(n.execute(),e.preventDefault(),!0)}getRoot(){return this._parent?this._parent.getRoot():this}getParent(){return this._parent}addListener(e,t){const n=this._listeners,r=t?.keys,i=this._root._listenersByKey;if(r&&!e.onCommandChange)throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");let c=null;if(r){const d=r.length;for(let s=0;s<d;s++){const l=r[s];if(!l)continue;let a=i.get(l);a||(a=new Set,i.set(l,a)),c||(c=[]),c.push(a),a.add(e)}}return n.add(e),()=>{if(c){const d=c.length;for(let s=0;s<d;s++)c[s].delete(e)}n.delete(e)}}_notifyCommands(e,t,n){const r=this;setTimeout(()=>{e.forEach(i=>{i[t]?.(r,n)})},0)}_notify(e,t){const n=this;setTimeout(()=>{n._listeners.forEach(r=>{r[e]?.(n,t)}),n._parent&&n._parent._notify(e,t)},0)}getAllCommands(){const e=[],t=this._groupKey;return this._commandsByKey.forEach(n=>{e.push({command:n,groupKey:t})}),this._children.forEach(n=>{e.push(...n.getAllCommands())}),e}}const Ln=$.CommonUtils.getOS()===$.CommonUtils.OSType.MacOS||$.CommonUtils.getOS()===$.CommonUtils.OSType.IOS?"Cmd":"Ctrl",Tn=$.CommonUtils.getOS()===$.CommonUtils.OSType.MacOS||$.CommonUtils.getOS()===$.CommonUtils.OSType.IOS?"⌘":"^",we=(o,e=!1)=>{const t={};for(let r=0;o.modifiers&&r<o.modifiers.length;r++)t[o.modifiers[r]]=!0;let n="";return(t?.[Y.Ctrl]||t?.[Y.Meta])&&(n+=(n.length>0?"+":"")+(e?Tn:Ln)),t?.[Y.Alt]&&(n+=e?"⌥":"Alt"),t?.[Y.Shift]&&(n+=(n.length>0?"+":"")+(e?"⇧":"Shift")),n+=(n.length>0?"+":"")+Vt(o.key),n},Fe=(o,e)=>{if(!e||!o||e.length===0)return $.CommonUtils.EmptyArray;const t=e.length,n=new Array(t);for(let r=0;r<t;r++){const i=e[r],c=i?o.getCommand(i):null;n[r]=c}return n};function st(o,e){if(typeof o=="function")return o(e);o&&(o.current=e)}var Ee=parseInt(u.version.split(".")[0],10)>=19?function(o){return e=>{const t=[];for(const n of o){const r=st(n,e),i=typeof r=="function";t.push(i?r:()=>st(n,null))}return()=>{for(const n of t)n()}}}:function(o){return e=>{for(const t of o)st(t,e)}};const kn=u.memo(u.forwardRef((o,e)=>{const{refFocusStart:t,...n}=o,r=u.useRef(null),i=u.useCallback(()=>{if(t)return void t?.current?.focus();const c=r.current.parentElement.children;let d=[];const s=c.length;for(let l=0;l<s&&c[l]!==r.current;l++){const a=c[l],h=a.getAttribute("tabindex");h==null||h==="-1"||a.getAttribute("disabled")!=="true"&&a.focus&&d.push({tabindex:parseInt(h),child:a})}d.length!==0&&(d.sort(function(l,a){return l.tabindex-a.tabindex}),d[0].child.focus())},[t]);return E.jsx("div",{tabIndex:0,ref:Ee([r,e]),onFocus:i,...n})}));var Pn=function(){},Xt=typeof window<"u",Dn=Xt?u.useLayoutEffect:u.useEffect,St={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const me=Xt&&window.ResizeObserver!==void 0?function(){var o=u.useState(null),e=o[0],t=o[1],n=u.useState(St),r=n[0],i=n[1],c=u.useMemo(function(){return new window.ResizeObserver(function(d){if(d[0]){var s=d[0].contentRect,l=s.x,a=s.y,h=s.width,f=s.height,p=s.top,_=s.left,m=s.bottom,S=s.right;i({x:l,y:a,width:h,height:f,top:p,left:_,bottom:m,right:S})}})},[]);return Dn(function(){if(e)return c.observe(e),function(){c.disconnect()}},[e]),[t,r]}:function(){return[Pn,St]},zn=u.memo(u.forwardRef((o,e)=>{const{className:t,style:n,children:r,radius:i=4,strokeWidth:c=1,strokeColor:d="grey",...s}=o,[l,{width:a,height:h}]=me(),f=u.useRef(null),p=(C,y=0)=>{const g=C/2,b=h-g+y;return(function(j,M,B=!1){if(M===0)return j;function O(P,v,A){let K=v.x-P.x,U=v.y-P.y,z=Math.sqrt(K*K+U*U);return T(P,v,Math.min(1,A/z))}function T(P,v,A){return{x:P.x+(v.x-P.x)*A,y:P.y+(v.y-P.y)*A}}function w(P,v){P.length>2&&(P[P.length-2]=v.x,P[P.length-1]=v.y)}function k(P){return{x:parseFloat(P[P.length-2]),y:parseFloat(P[P.length-1])}}let L=j.split(/[,\s]/).reduce(function(P,v){let A=v.match("([a-zA-Z])(.+)");return A?(P.push(A[1]),P.push(A[2])):P.push(v),P},[]).reduce(function(P,v){return parseFloat(v)==v&&P.length?P[P.length-1].push(v):P.push([v]),P},[]),I=[];if(L.length>1){let P=k(L[0]),v=null;L[L.length-1][0]==="Z"&&L[0].length>2&&(v=["L",P.x,P.y],L[L.length-1]=v),I.push(L[0]);for(let A=1;A<L.length;A++){let K=I[I.length-1],U=L[A],z=U===v?L[1]:L[A+1];if(z&&K&&K.length>2&&U[0]==="L"&&z.length>2&&z[0]==="L"){let W,H,V=k(K),J=k(U),_e=k(z);B?(W=T(J,K.origPoint||V,M),H=T(J,z.origPoint||_e,M)):(W=O(J,V,M),H=O(J,_e,M)),w(U,W),U.origPoint=J,I.push(U);let ce=T(W,J,.5),ge=T(J,H,.5),ue=["C",ce.x,ce.y,ge.x,ge.y,H.x,H.y];ue.origPoint=J,I.push(ue)}else I.push(U)}if(v){let A=k(I[I.length-1]);I.push(["Z"]),w(I[0],A)}}else I=L;return I.reduce(function(P,v){return P+v.join(" ")+" "},"")})(`${`M 0 ${g} L ${i-.5} ${g} L ${i-.5} ${b} L ${2*i} ${b}`} ${`L ${a-2*i} ${b}`} ${`M ${a-2*i} ${b} L ${a-i} ${b} L ${a-i} ${g} L ${a} ${g}`}`,i)},_=u.useMemo(()=>p(c),[a,h,i,c]),m=u.useMemo(()=>{if(i===0)return;const C=i/2;return p(i)+`L ${a} 0 L 0 0 L 0 ${C}`},[_,i,c]),S=u.useMemo(()=>({style:{clipPath:`path('${m}')`}}),[m]);return E.jsxs("div",{className:t,style:{display:"flex",flexDirection:"row",...n},...s,ref:Ee([f,l,e]),children:[u.isValidElement(r)?u.cloneElement(r,S):E.jsx(E.Fragment,{}),E.jsx("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none"},width:a,height:h,viewBox:`0 0 ${a} ${h}`,children:E.jsx("path",{d:_,stroke:d,fill:"none",vectorEffect:"non-scaling-stroke",strokeWidth:c})})]})})),ht={Default:"default",Error:"error",Success:"success",Warning:"warning",Info:"info"};class Yt extends $.DefaultNotifier{setOverrides(e){super.setOverrides(e)}getDelegate(){return this._overrides}showMessage(e,t){const n=this.getDelegate();if(n?.showMessage)return n.showMessage(e,t);t?.type!==ht.Warning?t?.type!==ht.Error?$.Notifier.log(e):$.Notifier.error(e):$.Notifier.warn(e)}showBusy(e,t){const n=this.getDelegate();return n?.showBusy?n.showBusy(e,t):new Promise(r=>{r(()=>{})})}showWindow(e,t){const n=this.getDelegate();if(n?.showWindow)return n.showWindow(e,t)}showError(e){const t=this.getDelegate();t?.showError?t.showError(e):$.Notifier.error(e)}showOptions(e){const t=this.getDelegate();return t?.showOptions?t.showOptions(e):Promise.resolve("")}showInput(e){const t=this.getDelegate();return t?.showInput?t.showInput(e):Promise.resolve({input:"",option:""})}}const An=new Yt,qt=u.createContext(An),Le=()=>u.useContext(qt),Rn=3,jn=.5,Bn=50,lt=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});function Gt(o={}){const{threshold:e=jn,stillnessThreshold:t=Rn,maxHierarchyDepth:n=Bn}=o,[r,i]=me(),c=u.useRef(null),[d,s]=u.useReducer(_=>_+1,0),l=u.useRef(void 0),a=u.useRef({x:0,y:0,width:0,height:0,top:0,left:0,right:0,bottom:0}),h=u.useCallback(_=>{c.current=_,typeof r=="function"&&r(_)},[r]),[f,p]=u.useState(i);return u.useEffect(()=>{i&&!f&&p(i)},[i,f]),u.useEffect(()=>{const _=c.current;if(!_)return;let m=!1,S=0;const C=()=>{if(!_)return;const M=_.getBoundingClientRect(),B=a.current;Math.abs(M.x-B.x)>e||Math.abs(M.y-B.y)>e||Math.abs(M.width-B.width)>e||Math.abs(M.height-B.height)>e?(m||(m=!0,p(lt(M)),s()),S=0):S++,m&&S>=t&&(m=!1,p(lt(M)),s()),a.current=lt(M),l.current=requestAnimationFrame(C)};l.current=requestAnimationFrame(C);const y=M=>{m=!0,s()},g=M=>{m=!1,S=t,s()};let b=_;const j=[];for(;b&&b!==document.documentElement&&(b.addEventListener("animationstart",y,!0),b.addEventListener("animationend",g,!0),b.addEventListener("transitionstart",y,!0),b.addEventListener("transitionend",g,!0),j.push(b),b=b.parentElement,!(j.length>n)););return()=>{l.current&&cancelAnimationFrame(l.current),j.forEach(M=>{M.removeEventListener("animationstart",y,!0),M.removeEventListener("animationend",g,!0),M.removeEventListener("transitionstart",y,!0),M.removeEventListener("transitionend",g,!0)})}},[d,i,e,t,n]),[h,f]}const D=(o,e)=>{const t=u.useCallback((...i)=>o?.(...i),e),n=u.useRef(null);n.current=t;const r=u.useCallback((...i)=>n.current?.(...i),[]);if(n.current)return r};let Ue=0;function Zt(){const[o,e]=u.useState(!!document.fullscreenElement),t=u.useCallback(()=>{const n=document.fullscreenElement;return n?n.querySelector(".fullscreen-portal-root")||n:document.body},[]);return u.useEffect(()=>{function n(){const r=document.fullscreenElement;if(e(!!r),!r)return;let i=r.querySelector(".fullscreen-portal-root");i||(i=document.createElement("div"),i.className="fullscreen-portal-root _fullscreen-portal-root_1mjsr_4",r.appendChild(i))}return Ue++,n(),document.addEventListener("fullscreenchange",n),()=>{document.removeEventListener("fullscreenchange",n),Ue--,Ue<=0&&(document.querySelectorAll(".fullscreen-portal-root").forEach(r=>{r.parentNode&&r.parentNode.removeChild(r)}),Ue=0)}},[]),{getPortalContainer:t,isFullscreen:o}}function dt(o){if(!o)throw new Error("must have a PointerHandlerOptions");const{onPointerDown:e,onPointerUp:t,onPointerMoveOrWait:n,processTouch:r=!1,consumeTouch:i=!0}=o,c=D(e,[e]),d=D(t,[t]),s=D(n,[n]),l=u.useRef(!1),a=o?.timerInitial??230,h=o?.timerContinuous??a/2,f=u.useRef(null),p=u.useRef(null),_=u.useRef(null),m=u.useRef(null),S=u.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null)},[]),C=u.useCallback(w=>{m.current=setTimeout(()=>{window.requestAnimationFrame(()=>{if(l.current===!1)return;const k=p.current,L=f.current,I=qe(k,L.currentTarget);s?.(I,_.current,L)}),C(h)},w??a)},[]);u.useEffect(()=>()=>S(),[]);const y=r?"pointer":"mouse",g=u.useCallback(w=>{w.stopPropagation(),w.stopImmediatePropagation(),w.preventDefault()},[]),b=D(w=>{document.removeEventListener(`${y}move`,B),document.removeEventListener(`${y}up`,b),document.removeEventListener("keydown",O),document.removeEventListener("keyup",T),document.removeEventListener("touchstart",g,{capture:!0}),document.removeEventListener("touchmove",g,{capture:!0}),window.removeEventListener("blur",j),S(),window.requestAnimationFrame(()=>{if(l.current===!1)return;l.current=!1;const k=w,L=f.current,I=qe(k,L.currentTarget);d?.(I,_.current,L),_.current=null})},[]),j=u.useCallback(()=>{l.current!==!1&&(l.current=!1,b(p.current))},[]),M=D(()=>{S(),C(h),window.requestAnimationFrame(()=>{if(l.current===!1)return;const w=p.current,k=f.current,L=qe(w,k.currentTarget);s?.(L,_.current,k)})},[h]),B=D(w=>{p.current=w,M()},[]),O=D(w=>{_.current={ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,altKey:w.altKey,metaKey:w.metaKey},M()},[]),T=D(w=>{_.current={ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,altKey:w.altKey,metaKey:w.metaKey},M()},[h]);return D(w=>{w.isDefaultPrevented()||(_.current={ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,altKey:w.altKey,metaKey:w.metaKey},c(w,_.current)!==!1&&(f.current=w,p.current=w.nativeEvent,document.addEventListener(`${y}up`,b,{passive:!1}),document.addEventListener(`${y}move`,B,{passive:!1}),document.addEventListener("keydown",O,{passive:!1}),document.addEventListener("keyup",T,{passive:!1}),window.addEventListener("blur",j,{passive:!0}),r&&i&&(document.addEventListener("touchstart",g,{passive:!1,capture:!0}),document.addEventListener("touchmove",g,{passive:!1,capture:!0})),l.current=!0,C(a)))},[a,r])}const On=({initValue:o,useHookBody:e,applyStateChange:t})=>{const n=u.useRef(o);if(typeof e!="function")throw new Error("function expected as hook body parameter. got "+typeof e);const r=e();return u.useLayoutEffect(()=>{n.current!==r&&(n.current=r,t(r))},[t,r]),null},ft=o=>{console&&console.warn&&console.warn(o)},at=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||void 0;let In=1,pt=!1,Jt=!1;const Ge=[],xe=[],Je=()=>{xe.forEach(o=>o())},$n=({automaticContainerInternalUseOnly:o})=>{const[e,t]=u.useState([]),n=u.useRef([]);return n.current=e,o||pt!==!1||(Jt=!0),u.useEffect(()=>{let r=!0;function i(){if(r)return xe[0]!==i?(o||pt!==!0||ft("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."),void t(c=>[])):void t([...Ge])}return xe.push(i),Je(),()=>{r=!1,n.current?.length>0&&ft("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"),xe.splice(xe.indexOf(i),1),Je()}},[o]),E.jsx(E.Fragment,{children:e.map(({hook:r,key:i})=>u.createElement(On,{...r,key:i}))})},Nn=o=>{const e=In++;return Ge.push({hook:o,key:e}),xe.length===0&&Jt===!1&&(pt=!0,(t=>{if(at.document&&at.document.createElement){const n=at.document.createElement("div");gn.createRoot(n).render(E.jsx(t,{automaticContainerInternalUseOnly:!0}))}else ft("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.")})($n)),Je(),()=>{Ge.splice(Ge.findIndex(t=>t.key===e),1),Je()}};let mt=null;mt||(mt=(o,e,t={})=>{let n,r,i=!1,c=!1,d=[],{unmountIfNoConsumers:s=!1}=t;const l=h=>{var f;r=h,f=()=>d.forEach(p=>p(h)),Nt.unstable_batchedUpdates(f)},a=()=>(c||(r=typeof o=="function"?o():o,c=!0),r);return()=>{const[h,f]=u.useState(a);return u.useEffect(()=>(i||(i=!0,n=Nn({initValue:o,useHookBody:e,applyStateChange:l})),d.push(f),r!==h&&f(r),()=>{d.splice(d.indexOf(f),1),d.length===0&&s&&(n(),i=!1)}),[]),h}});const Qt=mt;let en=()=>{console.warn("You must call useEditMode before setting its state.")};const Kn=Qt(null,()=>{const[o,e]=u.useState(null);return en=e,o}),Et=Qt({setClipboard:o=>{throw new Error("This is only available via the useClipboard.")},getClipboard:()=>$.InternalClipboard.Global,refNativeCopy:{current:null},refNativeLastKey:{current:null}},()=>{const[o,e]=u.useState($.InternalClipboard.Global);return{setClipboard:t=>e(t),getClipboard:()=>o,refNativeCopy:u.useRef(null),refNativeLastKey:u.useRef(null)}});let ct=!1,Hn=0;var Wn=typeof document<"u"?u.useLayoutEffect:u.useEffect;const Ct=()=>"sheetxl-ui-"+Hn++,Mt=u.useId,Fn=Mt??function(){const[o,e]=u.useState(()=>ct?Ct():void 0);return Wn(()=>{o==null&&e(Ct())},[]),u.useEffect(()=>{ct||(ct=!0)},[]),o},Un=[];function et(o,e,t=Un){const n=u.useRef(null);return u.useImperativeHandle(o,()=>{if(!n.current)return;const r=n.current,i=e?.();if(!i||typeof i!="object")throw new Error("attributes must return a plain object of values");const c=Object.keys(i),d=c.length;for(let s=0;s<d;s++){const l=c[s],a=i[l];Object.defineProperty(r,l,{value:a,writable:!0,configurable:!0,enumerable:!0})}return r},t),n}const Lt="Undo the last action.",Tt="Repeat the last action or undo the redo.",Vn=o=>`Redo ${o}`;class Xn extends u.Component{static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){this.props.onError?.(e)}render(){return this.props.children}}class Yn{constructor(e){this.notifier=e,this.handleUnhandledRejection=t=>{const n=t.reason;n instanceof DOMException&&n.name==="AbortError"||this.notifier.showError(n)},this.handleGlobalError=t=>{this.notifier.showError(t.error)},this.setupGlobalHandlers()}setupGlobalHandlers(){window.addEventListener("unhandledrejection",this.handleUnhandledRejection),window.addEventListener("error",this.handleGlobalError)}cleanup(){window.removeEventListener("unhandledrejection",this.handleUnhandledRejection),window.removeEventListener("error",this.handleGlobalError)}}function tn(o){var e,t,n="";if(typeof o=="string"||typeof o=="number")n+=o;else if(typeof o=="object")if(Array.isArray(o)){var r=o.length;for(e=0;e<r;e++)o[e]&&(t=tn(o[e]))&&(n&&(n+=" "),n+=t)}else for(t in o)o[t]&&(n&&(n+=" "),n+=t);return n}function X(){for(var o,e,t=0,n="",r=arguments.length;t<r;t++)(o=arguments[t])&&(e=tn(o))&&(n&&(n+=" "),n+=e);return n}const qn={},nn=o=>{const{onPointerDown:e,style:t,splitDirection:n,paddingBefore:r=0,paddingAfter:i=0,disabled:c,key:d,propsHitArea:s=qn,...l}=o,a=n==="row",{style:h,className:f,...p}=s;return E.jsx("div",{style:{...t,position:"relative"},...l,children:E.jsx("div",{className:X("hit-box",f),style:{left:(a?-r:0)+"px",width:`calc(100% + ${a?r+i:0}px)`,top:(a?0:-r)+"px",height:`calc(100% + ${a?0:r+i}px)`,position:"absolute",...h},onPointerDown:c?void 0:e,...p})},d)},Ve={},fe=(o,e,t=!0)=>o===null?null:o.pixels!==null?t?o.pixels:e-o.pixels:(t?o.percent:100-o.percent)/100*e,Xe=(o,e=!0)=>o?.percent?`${e?o.percent:100-o.percent}%`:o?.pixels?`${o.pixels}px`:void 0,se=(o,e)=>{if(o==null)return null;const t={percent:null,pixels:null};let n=e;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)},on=u.memo(u.forwardRef((o,e)=>{const{elementBefore:t,elementAfter:n,splitDirection:r="row",fixedPane:i=null,position:c,onPositionChange:d,minBefore:s,maxBefore:l,minAfter:a,maxAfter:h,children:f,className:p,style:_,disabled:m=!1,onDragStart:S,onDragResize:C,onDragFinish:y,propsResizer:g=Ve,propsPane:b=Ve,propsPaneBefore:j=Ve,propsPaneAfter:M=Ve,renderResizer:B=nn}=o;if(f)throw new Error("Use elementBefore and elementAfter instead of children.");const O=u.useMemo(()=>u.isValidElement(n)&&u.isValidElement(t),[n,t]),T=u.useMemo(()=>{let R=null;i&&(i==="before"?R=0:i==="after"&&(R=1));const F=R===null;return{fixedPaneOffset:R,isPercent:F,minBefore:se(s,F),maxBefore:se(l,F),minAfter:se(a,F),maxAfter:se(h,F)}},[s,l,a,h]),w=D(d,[d]),[k,L]=u.useState(()=>se(c,i===null));u.useEffect(()=>{L(se(c,i===null))},[c,i]);const[I,{width:P,height:v}]=me(),[A,{width:K,height:U}]=me(),z=r==="row"?K:U,W=r==="row"?P:v,H=u.useMemo(()=>((R,F,Q,G)=>{const re=[null,null],oe=[null,null];if(R||(R={percent:G.fixedPaneOffset===null?50:null,pixels:G.fixedPaneOffset===null?null:0}),F===0)return R?.pixels!=null?G.fixedPaneOffset!==1?(re[0]=R?.pixels,oe[1]=100):(re[1]=R?.pixels-Q,oe[0]=100):R?.percent!=null&&(G.fixedPaneOffset!==1?(oe[0]=R?.percent,oe[1]=100-R?.percent):(oe[1]=R?.percent,oe[0]=100-R?.percent)),{percents:oe,pixels:re,minBefore:Xe(G.minBefore,!0),maxBefore:Xe(G.maxBefore,!0),minAfter:Xe(G.minAfter),maxAfter:Xe(G.maxAfter)};let ie=fe(R,F,G.fixedPaneOffset!==1),te=F-Q,yt=fe(G.minBefore,te,!0)??0,mn=fe(G.maxBefore,te,!0)??te,He=0,it=0,vt=0,bt=te;He=(fe(G.maxAfter,F,!1)??Q)-Q,it=fe(G.minAfter,F,!1)??F,vt=Math.max(yt,He),bt=Math.min(mn,it),ie=Math.max(vt,Math.min(ie,bt)),it=Math.min(te-ie,fe(G.maxAfter,te-ie,!0)??te),He=Math.min(te-ie,fe(G.minAfter,te-ie,!0)??te),re[0]=ie,re[1]=te-re[0];const _n=Math.max(0,Math.min(100,ie/te*100));return oe[0]=_n,oe[1]=100-oe[0],{percents:oe,pixels:re,minBefore:`${yt}px`,minAfter:`${He}px`,maxBefore:`${re[0]}px`,maxAfter:`${re[1]}px`}})(k,W,z,T),[T,k,W,z,r]),[V,J]=u.useState(!1),_e=D(S,[S]),ce=D(C,[C]),ge=D(y,[y]),ue=u.useRef(null),tt=u.useRef(null),De=u.useRef(null),{style:nt,className:ze,...Ae}=b,Re={minWidth:0,minHeight:0,maxWidth:"100%",maxHeight:"100%",height:"100%",widthResizer:"100%",display:"flex",overflow:"hidden",position:"relative",...nt},{className:ot,style:je,...Be}=j,{className:Oe,style:Ie,...ye}=M,Ce={flex:"1 1 100%",width:"100%",..._,flexDirection:r,display:"flex"},{className:ne,style:ve,onPointerDown:$e,...Ne}=g,Me=D(R=>{const F=se(R,i===null);L(F)},[i]),x=D(R=>{if(m||!V)return;const F=he.current?.getBoundingClientRect();let Q=0;Q=r==="row"?(R.clientX??R.touches?.[0]?.clientX)-F.x:(R.clientY??R.touches?.[0]?.clientY)-F.y,Q=Math.max(0,Math.min(W,Q)),T.fixedPaneOffset===1&&(Q=W-Q),c&&k.pixels===Q||L({pixels:Q,percent:null}),ce?.(Q),R.stopPropagation(),R.preventDefault()},[T,r,m,V,k,W]),N=D(R=>{if(document.removeEventListener("pointermove",x),document.removeEventListener("touchmove",x),document.removeEventListener("pointerup",N),!!V&&(J(!1),!!k)){if(ge(k.pixels),!se(c,i===null)||k.pixels!==c){const F={...k};F.percent===null&&(F.percent=F.pixels/W*100),w(F)}R.stopPropagation(),R.preventDefault()}},[k,V,c,i,W]),q=D(R=>{$e?.(R),R.defaultPrevented||m||V||(J(!0),_e(),document.addEventListener("pointermove",x,{passive:!1}),document.addEventListener("touchmove",x,{passive:!1}),document.addEventListener("pointerup",N,{passive:!1}))},[$e]),he=et(e,()=>({setPosition:Me,isSplitPane:()=>!0}),[]),be=u.useMemo(()=>O?B?.({key:"resizer",ref:Ee([A,tt]),className:X("resizer",ne),onPointerDownCapture:q,style:{cursor:m?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,...ve},splitDirection:r,disabled:m,...Ne}):null,[O,ne,Ne,r,ve,m]),de=r==="row"?"Width":"Height",rt=u.useMemo(()=>{if(!t)return null;const R={...Re,...je,flex:T.fixedPaneOffset===0&&H?.pixels[0]!==null?`0 0 ${Math.round(H?.pixels[0])}px`:`1 1 ${Math.round(H?.percents[0]??100)}%`,[`min${de}`]:H?.minBefore,[`max${de}`]:n?H?.maxBefore:"100%"};return E.jsx("div",{ref:ue,className:X("before",ze,ot),style:R,...Ae,...Be,children:t},"before")},[t,b,j,T,H]),Ke=u.useMemo(()=>{if(!n)return null;const R={...Re,...Ie,flex:T.fixedPaneOffset===1&&H?.pixels[1]!==null?`0 0 ${Math.round(H?.pixels[1])}px`:`1 1 ${Math.round(H?.percents[1]??100)}%`,[`min${de}`]:H?.minAfter,[`max${de}`]:t?H?.maxAfter:"100%"};return E.jsx("div",{ref:De,className:X("after",ze,Oe),style:R,...Ae,...ye,children:n},"after")},[n,b,M,T,H]);return E.jsxs("div",{ref:Ee([I,he]),className:X("splitPane",r==="row"?"vertical":"horizontal",{dragging:V},p),style:Ce,children:[rt,be,Ke]})}));function Gn(o){if(typeof o=="function")return o;if(typeof o=="string"){const e=o.trim();if(e.startsWith("data:image/svg+xml")){const t=(function(n){const r=/^data:image\/svg\+xml(;[^,]*)?,(.*)$/i.exec(n.trim());if(!r)return null;const i=r[1]||"",c=r[2]||"";try{if(/;base64/i.test(i)){if(typeof atob<"u"){const d=atob(c),s=d.length;if(typeof TextDecoder<"u"){const a=new Uint8Array(s);for(let h=0;h<s;h++)a[h]=d.charCodeAt(h);return new TextDecoder("utf-8").decode(a)}let l="";for(let a=0;a<s;a++)l+=`%${d.charCodeAt(a).toString(16).padStart(2,"0")}`;return decodeURIComponent(l)}return(globalThis.Buffer?globalThis.Buffer.from(c,"base64"):require("buffer").Buffer.from(c,"base64")).toString("utf-8")}try{return decodeURIComponent(c)}catch{return c}}catch{return null}})(e);if(t)return Dt(t)}if(e.startsWith("<")){if(/^<\s*svg\b/i.test(e))return Dt(e);if(/^<\s*path\b/i.test(e)){const t=kt(e);if(t)return{paths:[{d:t}]}}return{paths:[{d:e}]}}return{paths:[{d:e}]}}if(Array.isArray(o)){const e=[];for(const t of o)if(typeof t=="string"){const n=String(t).trim();if(n.startsWith("<path")){const r=kt(n);r&&e.push({d:r})}else e.push({d:n})}else t&&typeof t=="object"&&"d"in t&&typeof t.d=="string"&&e.push({...t});return{paths:e}}return o}function kt(o){const e=/\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(o);return e?e[1]??e[2]??null:null}function Pt(o){if("svg"in o)return{...o,svg:Gn(o.svg)};if("url"in o){const e=typeof o.url=="string"?{src:o.url}:o.url;return{...o,url:e}}if("emoji"in o){const e=typeof o.emoji=="string"?o.emoji:o.emoji.text;return{...o,emoji:e}}return o}function Dt(o){try{if(typeof DOMParser<"u"){const c=new DOMParser().parseFromString(o,"image/svg+xml"),d=c.querySelector("svg"),s=d?.getAttribute("viewBox")??void 0,l=[];return c.querySelectorAll("path").forEach(a=>{const h=a.getAttribute("d");if(!h)return;const f={d:h},p=a.getAttribute("class");p&&(f.className=p);const _=a.getAttribute("fill");_&&_!=="none"&&(f.fill=_);const m=a.getAttribute("stroke");m&&(f.stroke=m);const S=a.getAttribute("opacity");S&&(f.opacity=Number(S));const C=a.getAttribute("fill-rule");C&&(f.fillRule=C);const y=a.getAttribute("clip-rule");y&&(f.clipRule=y),l.push(f)}),{viewBox:s,paths:l}}}catch{}const e=o.match(/viewBox="([^"]+)"/i),t=e?e[1]:void 0,n=[],r=/<path\b[^>]*\sd="([^"]+)"[^>]*>/gi;let i;for(;i=r.exec(o);)n.push({d:i[1]});return{viewBox:t,paths:n}}function zt(o){const e={};for(const[i,c]of Object.entries(o.icons))e[i]=Pt(c);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??[]};t.extends.includes("base")||t.extends.push("base");const n={meta:t,icons:e},r=o.overrides;if(r){const i={};for(const[c,d]of Object.entries(r)){const s={};for(const[l,a]of Object.entries(d))s[l]=Pt(a);i[c]=s}n.__overrides=i}return n}function rn(){const o=new Map,e=new Map;let t="base",n=new Map;async function r(s){const l=o.get(s??t);if(!l)throw new Error(`Icon pack not registered: ${s}`);if(!l.pack){if(!l.loading){if(!l.loader)throw new Error(`No loader for icon pack: ${s}`);l.loading=l.loader().then(a=>{const h=a&&typeof a=="object"&&"default"in a?a.default:a;l.pack=zt(h)}).catch(a=>{throw l.loading=void 0,a})}await l.loading}}function i(s){const l=s.indexOf(":");return l>0?{ns:s.slice(0,l),key:s.slice(l+1)}:{key:s}}function c(s,l){const a=[s,...o.get(s)?.pack?.meta.extends??[]];for(const h of a){const f=o.get(h);if(!f?.pack)continue;const{icons:p}=f.pack,_=p[e.get(h)?.get(l)??l]??p[l];if(_)return{glyph:_,pack:f.pack,packKey:h}}return null}function d(s,l){const a=l?.packKey??t;if(l?.packKey)return c(l.packKey,s);if(!s)return null;const{ns:h,key:f}=i(s);if(h){const p=o.get(h)?.pack;if(p){if(o.get(t)?.pack){const m=p.__overrides,S=m?.[t]?.[f];if(S)return{glyph:S,pack:p,packKey:h}}const _=c(h,f);if(_)return _}return null}return c(a,s)}return{register:function(s,l){const a=o.get(s)??{};typeof l=="function"?a.loader=l:a.pack=zt(l),o.set(s,a),t||(t=s)},prefetch:async function(s=t){const l=Array.isArray(s)?s:[s];await Promise.all(l.map(r))},setActive:function(s){t=s;for(const l of n.keys())try{l(s)}catch{}},getActive:function(){return t},resolve:async function(s,l){let a=d(s,l);if(a)return a;const h=l?.packKey??t,{ns:f}=i(s);if(l?.packKey){if(await r(h),a=d(s,l),a)return a;const p=o.get(h)?.pack?.meta?.extends??[];if(p.length&&(await Promise.all(p.map(r)),a=d(s,l),a))return a}else if(f){if(await r(f),a=d(s,l),a)return a;const p=o.get(f)?.pack?.meta?.extends??[];if(p.length&&(await Promise.all(p.map(r)),a=d(s,l),a))return a}else{if(await r(h),a=d(s,l),a)return a;const p=o.get(h)?.pack?.meta?.extends??[];if(p.length&&(await Promise.all(p.map(r)),a=d(s,l),a))return a}return null},registerAlias:function(s,l,a){e.has(s)||e.set(s,new Map),e.get(s).set(l,a)},has:function(s,l){return!!d(s,l)},getPack:function(s){return o.get(s??t)?.pack},hasPack:function(s){return!!o.get(s)?.pack},listPacks:function(){return Array.from(o.keys())},listIcons:function(s){const l=o.get(s)?.pack;return l?Object.keys(l.icons):[]},addActiveListener:function(s){const l=n.get(s);if(l)return l;const a=()=>{n.delete(s)};return n.set(s,a),a}}}on.displayName="SplitPane";const ke=rn();ke.register("base",()=>Promise.resolve().then(()=>require("./Bhq-qomDuX-3Zv9l.cjs")));const At=o=>E.jsx("svg",{...o,children:E.jsx("path",{})}),Zn={Icon:"_Icon_17dpm_10"},Rt=u.memo(o=>{const{iconKey:e,packKey:t,className:n,style:r,role:i,title:c,size:d,ariaHidden:s,propsSource:l,children:a,...h}=o,[f,p]=u.useState(null);u.useEffect(()=>{let L=!0,I=t,P=e;if(!P){const v=ke.getPack(I);return void p({glyph:v?{svg:$.CommonUtils.EmptyArray}:void 0,pack:v??void 0,packKey:I??ke.getActive()})}if(P.includes(":")){const[v,A]=P.split(":");I=v,P=A}return ke.resolve(P,{packKey:I}).then(v=>{L&&p(v)}),()=>{L=!1}},[e,t]);const _=f?.pack,m=f?.glyph,S=f?.packKey;let C=m?m.svg:void 0;const y=m&&!C?m.url:void 0,g=!m||C||y?void 0:m.emoji,b=d!=null?typeof d=="number"?`${d}px`:d:void 0,j=u.useMemo(()=>[Zn.Icon,"icon",n].filter(Boolean).join(" "),[n]),M=u.useMemo(()=>{const L={...r};return L["--icon-size"]=b,L},[r,b]),B=i??(c?"img":"presentation"),O=s??(!c||void 0),T=L=>E.jsx("span",{className:j,style:M,role:B,"aria-hidden":O,title:c,"data-icon-glyph":e,"data-icon-pack":S,...h,children:L});if(a)return T(a);if(g)return T(E.jsx("span",{children:typeof g=="string"?g:g.text}));if(y)return T(E.jsx("img",{src:y.src,alt:c??""}));if(m&&"react"in m){const L=m.react,I={className:j,style:M,role:B,"aria-hidden":O,title:c,...h,...l};return T(E.jsx(L,{...I}))}const w={viewBox:C?.viewBox??_?.meta.defaultViewBox??"0 0 24 24"};if(typeof C=="function")return T(C(w)??E.jsx(At,{...w}));if(!C)return T(E.jsx(At,{...w}));const k=C.paths;return T(E.jsx("svg",{...w,children:k?k.map((L,I)=>E.jsx("path",{d:L.d,className:L.className,fill:L.fill,stroke:L.stroke,opacity:L.opacity,fillRule:L.fillRule,clipRule:L.clipRule},I)):null}))});class Ze{constructor(){this.store=new Map}async getItem(e){return this.store.get(e)??null}async setItem(e,t){this.store.set(e,t)}async removeItem(e){this.store.delete(e)}}const jt=u.createContext(null),sn={parse:o=>o?JSON.parse(o):null,stringify:JSON.stringify},Jn={store:new Ze,namespace:"",serializer:sn,debounceMs:0,crossTabSync:!1,notify:()=>{},subscribeKey:()=>()=>{}},Qn={},eo={parse:o=>o==null?null:JSON.parse(o),stringify:JSON.stringify},Z={Horizontal:"horizontal",Vertical:"vertical"},pe={scrollbar:"_scrollbar_gqxsx_24",track:"_track_gqxsx_35",thumb:"_thumb_gqxsx_47","scrollbar-button":"_scrollbar-button_gqxsx_89","touch-thumb":"_touch-thumb_gqxsx_124"},ln="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",an="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",to={transform:"rotate(180deg)"},cn=o=>{const{style:e,orientation:t=Z.Vertical,disabled:n,...r}=o,i=t===Z.Vertical?ln:an;return E.jsx("button",{style:e,className:X(pe["scrollbar-button"],t,"scroll-button"),disabled:n,...r,children:E.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",children:E.jsx("path",{d:i})})})},un=o=>{const{style:e,orientation:t=Z.Vertical,disabled:n,...r}=o,i=t===Z.Vertical?ln:an;return E.jsx("button",{style:e,className:X(pe["scrollbar-button"],t,"scroll-button"),disabled:n,...r,children:E.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",style:to,children:E.jsx("path",{d:i})})})},no=Pe().supportsTouchEvents,hn=u.memo(u.forwardRef((o,e)=>{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:c=22,style:d,className:s,onPointerDown:l,onPointerMove:a,onPointerUp:h,orientation:f=Z.Vertical,offset:p=0,currentTouchAnchor:_,elementParent:m,elementRoot:S,key:C,...y}=o;if(!no)return null;const g=D(l,[l]),b=D(a,[a]),j=D(h,[h]),M=f===Z.Vertical,[B,O]=u.useState(!1),T=dt(u.useMemo(()=>({processTouch:!0,consumeTouch:!0,onPointerDown:(z,W)=>{O(!0),g?.(z),z.preventDefault(),z.stopPropagation()},onPointerMoveOrWait:(z,W,H)=>{b?.(z)},onPointerUp:(z,W,H)=>{O(!1),j?.(H),z.preventDefault(),z.stopPropagation()}}),[])),w=u.useMemo(()=>{const z=c/2+i/2+6;return{x:M?-z:p+c,y:M?p+c:-z,width:0,height:0}},[M,p,c]),[k,{y:L,x:I}]=Gt(),P=u.useRef(null),{getPortalContainer:v,isFullscreen:A}=Zt(),[K,U]=u.useState(null);return u.useEffect(()=>{const z=P.current?.getBoundingClientRect();if(!z)return void U(null);let W=0,H=0,V=m;for(;V;)W+=V.scrollLeft,H+=V.scrollTop,V=S&&V===S.parentElement?null:V.parentElement;U(Nt.createPortal(E.jsx("div",{className:X("touch-thumb",pe["touch-thumb"],s,pe,{dragging:B}),ref:e,style:{left:W+(z?.x??0)-(c+i)/2,top:H+(z?.y??0)-(c+i)/2,width:M?c:1.8*c,height:M?1.8*c:c,borderWidth:`${i}px`,boxShadow:B?`${n} 0px 0px 0px 1.5px`:void 0,borderStyle:"solid",borderColor:t,backgroundColor:n,opacity:_?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",...d},tabIndex:-1,onPointerDown:T,...y}),S??v(),C))},[L,B,t,n,r,I,w?.x,w?.y,w?.width,w?.height,s,_,n,c,i,t,m,A,C]),w?E.jsxs(E.Fragment,{children:[E.jsx("div",{ref:Ee([k,P]),style:{position:"absolute",left:w.x,top:w.y,opacity:0}}),K]}):null}));hn.displayName="TouchThumbHandle";const oo=24,dn=u.memo(u.forwardRef((o,e)=>{const{offset:t=0,totalSize:n=0,viewportSize:r=0,style:i,className:c,orientation:d=Z.Vertical,onScrollOffset:s,onScroll:l,showCustomScrollButtons:a,scrollButtonIncrement:h=200,scrollButtonInitialRepeatDelay:f=260,scrollButtonAdditionalRepeatDelay:p=120,minThumbSize:_=oo,maxThumbSize:m,renderScrollButtonStart:S=cn,renderScrollButtonEnd:C=un,propsTouchThumb:y,propsThumb:g,onMouseDown:b,...j}=o,M=Pe().primaryInput==="touch",B=a??!M;D(l,[l]);const[O,T]=u.useState({offset:0,length:0,disabled:!1}),w=u.useRef(-1),k=d===Z.Vertical,[L,{width:I,height:P}]=me(),v=k?P:I,A=D((x,N,q)=>{if(N===0||q===0){const Ke={offset:0,length:_,disabled:!0};return T(Ke),Ke}if(N>=q)return{offset:0,length:v,disabled:!0};const he=q/v,be=N/he,de=Math.min(Math.max(_,be),Math.min(v,m??Number.MAX_SAFE_INTEGER)),rt=x/he;return{offset:Math.min(Math.max(0,rt),v-de),length:de,disabled:!1}},[v,_,m]),K=D(x=>{const N=n/v,q=Math.round(x*N);T(A(q,r,n)),s?.(q,r,n),w.current=x},[s,r,n,v,O]),U=D(x=>{T(A(x,r,n)),s?.(x,r,n),w.current=x},[s,r,n]);u.useEffect(()=>{w.current!==t&&v!==0&&(w.current=-1,T(A(t,r,n)))},[t]),u.useEffect(()=>{v!==0&&T(A(t,r,n))},[r,n,k,v]);const z=Math.max(0,n-r),[W,H]=u.useState(!1),V=u.useRef(0),J=u.useRef(0),_e=et(e,()=>({isScrollbar:()=>!0}),[]),ce=D(x=>{H(!0),V.current=k?x.clientY:x.clientX,J.current=O.offset},[k,O]),ge=D(x=>{x.currentTarget.setPointerCapture(x.pointerId),ce(x),x.stopPropagation()},[b]),ue=D(x=>{if(!W)return;const N=(k?x.clientY:x.clientX)-V.current,q=J.current+N;K(q)},[W,k]),tt=D(x=>{ue(x)},[]),De=D(x=>{H(!1)},[]),nt=D(x=>{try{x.currentTarget.releasePointerCapture(x.pointerId)}catch{}De(x)},[]),ze=D(x=>{if(!x.currentTarget)return;const N=x.currentTarget.getBoundingClientRect(),q=k?x.clientY-N.top:x.clientX-N.left;K(q)},[k,O,r,n]),Ae=D(x=>{const N=Math.max(1,Math.floor(.9*r));k?(x.key==="ArrowDown"&&K(Math.min(z,t+1)),x.key==="ArrowUp"&&K(Math.max(0,t-1)),x.key==="PageDown"&&K(Math.min(z,t+N)),x.key==="PageUp"&&K(Math.max(0,t-N)),x.key==="Home"&&K(0),x.key==="End"&&K(z)):(x.key==="ArrowRight"&&K(Math.min(z,t+1)),x.key==="ArrowLeft"&&K(Math.max(0,t-1)),x.key==="PageDown"&&K(Math.min(z,t+N)),x.key==="PageUp"&&K(Math.max(0,t-N)),x.key==="Home"&&K(0),x.key==="End"&&K(z))},[k,r,n,t,z]),Re=u.useRef(null),ot=u.useMemo(()=>{const x=O.disabled;if(x)return null;const N=E.jsx("div",{...g,className:X(pe.thumb,{disabled:x}),ref:Re,role:"slider","aria-label":k?"Rows":"Columns","aria-orientation":k?"vertical":"horizontal","aria-valuemin":0,"aria-valuemax":z,"aria-valuenow":t,tabIndex:0,style:{...g?.style,position:"relative",[k?"height":"width"]:`${O.length}px`,[k?"width":"height"]:"100%",transform:k?`translateY(${O.offset}px)`:`translateX(${O.offset}px)`,[k?"minHeight":"minWidth"]:`${_}px`},onMouseDown:b,onPointerDown:ge,onPointerMove:tt,onPointerUp:nt});return!M||x?N:E.jsxs(E.Fragment,{children:[N,E.jsx(hn,{...y,offset:O.offset,orientation:k?Z.Vertical:Z.Horizontal,onPointerDown:ce,onPointerMove:ue,onPointerUp:De})]})},[O,_,z,t,k,M,b,y,g]),[je,Be]=u.useState(null),Oe=D(()=>{let x;x=typeof h=="function"?h(t,r,n):t-h;const N=Math.max(0,x);return U(N),Be(N),N},[h,t,r,n]),Ie=D(()=>{let x;x=typeof h=="function"?h(t,r,n):t+h;const N=Math.min(z,x);return U(N),Be(N),N},[h,t,z,r,n]),ye=u.useRef(null),Ce=u.useRef(null),ne=u.useCallback(()=>{ye.current&&(clearTimeout(ye.current),ye.current=null,Ce.current=null)},[]),ve=u.useCallback((x,N,q,he=f)=>{Ce.current=x,ye.current=setTimeout(()=>{const be=q?Oe():Ie();be!==Ce.current?ve(be,!1,q,p):ne()},N?0:he)},[Oe,Ie,ne]);u.useEffect(()=>()=>ne(),[ne]);const $e=u.useMemo(()=>{if(!B)return null;const x={orientation:d,disabled:t<=0,onMouseUp:ne,onMouseLeave:ne,onMouseDown:()=>ve(t,!0,!0)};return S?.(x)},[B,d,t,je]),Ne=u.useMemo(()=>{if(!B)return null;const x={orientation:d,disabled:t>=z,onMouseUp:ne,onMouseLeave:ne,onMouseDown:()=>ve(t,!0,!1)};return C?.(x)},[B,d,t,z,je]),Me=k?"vertical":"horizontal";return E.jsxs("div",{ref:Ee([_e,e]),className:X(c,pe.scrollbar,Me,{dragging:W,"has-touch-thumb":M}),style:i,...j,children:[$e,E.jsx("div",{ref:L,role:"scrollbar","aria-orientation":Me,"aria-valuemin":0,"aria-valuemax":z,"aria-valuenow":t,tabIndex:0,className:X(pe.track,"track",Me),onMouseDown:b,onPointerDown:ze,onKeyDown:Ae,children:ot}),Ne]})}));let Bt=Date.now,Ot=1e3,ae={},ro=1;const Te=o=>{let e=ae[o]!==null;return e&&(ae[o]=null),e},It=(o,e,t,n=0,r)=>{let i=Bt(),c=i,d=0,s=0,l=0,a=ro++;if(a%20==0){const f={};for(let p in ae)f[p]=!0;ae=f}const h=function(f){let p=f!==!0,_=Bt(),m=!0;try{m=(!e||e(a))??!0}catch{m=!1}if(!ae[a]||!m)return ae[a]=null,void t?.(60-s/((_-i)/Ot),a,!1);if(p){l=Math.round((_-c)/16.666666666666668)-1;for(let y=0;y<Math.min(l,4);y++)h(!0),s++}n&&(d=(_-i)/n,d>1&&(d=1));let S=r?r(d):d,C=!1;try{C=o(S,_,p)}catch{C=!1}C!==!1&&d!==1||!p?p&&(c=_,requestAnimationFrame(h)):(ae[a]=null,t?.(60-s/((_-i)/Ot),a,d===1||n==null))};return ae[a]=!0,requestAnimationFrame(h),a},io=function(o){return Math.pow(o-1,3)+1},so=function(o){return(o/=.5)<1?.5*Math.pow(o,3):.5*(Math.pow(o-2,3)+2)};class lo{constructor(e,t){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:.5,maxZoom:3,speedMultiplier:1,scrollingComplete:void 0,penetrationDeceleration:.03,penetrationAcceleration:.08,...t}}setDimensions(e,t,n,r){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)}setPosition(e,t){this.__clientLeft=e||0,this.__clientTop=t||0}setSnapSize(e,t){this.__snapWidth=e,this.__snapHeight=t}getValues(){return{left:this.__scrollLeft,top:this.__scrollTop,right:this.__scrollLeft+this.__clientWidth/this.__zoomLevel,bottom:this.__scrollTop+this.__clientHeight/this.__zoomLevel,zoom:this.__zoomLevel}}getPoint(e,t){const n=this.getValues();return{left:e/n.zoom,top:t/n.zoom}}getScrollMax(){return{left:this.__maxScrollLeft,top:this.__maxScrollTop}}zoomTo(e,t=!1,n,r,i){if(!this.options.zooming)throw new Error("Zooming is not enabled!");i&&(this.__zoomComplete=i),this.__isDecelerating&&(Te(this.__isDecelerating),this.__isDecelerating=0);const c=this.__zoomLevel;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);const d=e/c;let s=d*(this.__scrollLeft+n)-n,l=d*(this.__scrollTop+r)-r;s>this.__maxScrollLeft?s=this.__maxScrollLeft:s<0&&(s=0),l>this.__maxScrollTop?l=this.__maxScrollTop:l<0&&(l=0),this.__publish(s,l,e,t)}zoomBy(e,t=!1,n=0,r=0,i){this.zoomTo(this.__zoomLevel*e,t,n,r,i)}scrollTo(e,t,n=!1,r=1){if(this.__isDecelerating&&(Te(this.__isDecelerating),this.__isDecelerating=0),r!==void 0&&r!==this.__zoomLevel){if(!this.options.zooming)throw new Error("Zooming is not enabled!");e*=r,t*=r,this.__computeScrollMax(r)}else r=this.__zoomLevel;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)}scrollBy(e=0,t=0,n=!1){const r=this.__isAnimating?this.__scheduledLeft:this.__scrollLeft,i=this.__isAnimating?this.__scheduledTop:this.__scrollTop;this.scrollTo(r+(e||0),i+(t||0),n)}doMouseZoom(e,t,n,r){const i=e>0?.97:1.03;return this.zoomTo(this.__zoomLevel*i,!1,n-this.__clientLeft,r-this.__clientTop)}doTouchStart(e,t){if(e.length===void 0)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),typeof t!="number")throw new Error("Invalid timestamp value: "+t);let n,r;this.__interruptedAnimation=!0,this.__isDecelerating&&(Te(this.__isDecelerating),this.__isDecelerating=0,this.__interruptedAnimation=!0),this.__isAnimating&&(Te(this.__isAnimating),this.__isAnimating=0,this.__interruptedAnimation=!0);let i=e.length===1;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=[]}doTouchMove(e,t,n=1){if(e.length===void 0)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),typeof t!="number")throw new Error("Invalid timestamp value: "+t);if(!this.__isTracking)return;let r,i;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);let c=this.__positions;if(this.__isDragging){let d=r-this.__lastTouchLeft,s=i-this.__lastTouchTop,l=this.__scrollLeft,a=this.__scrollTop,h=this.__zoomLevel;if(n!==void 0&&this.options.zooming){let f=h;if(h=h/this.__lastScale*n,h=Math.max(Math.min(h,this.options.maxZoom),this.options.minZoom),f!==h){let p=r-this.__clientLeft,_=i-this.__clientTop;l=(p+l)*h/f-p,a=(_+a)*h/f-_,this.__computeScrollMax(h)}}if(this.__enableScrollX){l-=d*this.options.speedMultiplier;let f=this.__maxScrollLeft;(l>f||l<0)&&(this.options.bouncing?l+=d/2*this.options.speedMultiplier:l=l>f?f:0)}if(this.__enableScrollY){a-=s*this.options.speedMultiplier;const f=this.__maxScrollTop;(a>f||a<0)&&(this.options.bouncing?a+=s/2*this.options.speedMultiplier:a=a>f?f:0)}c.length>60&&c.splice(0,30),c.push(l,a,t),this.__publish(l,a,h)}else{let d=this.options.locking?3:0,s=5,l=Math.abs(r-this.__initialTouchLeft),a=Math.abs(i-this.__initialTouchTop);this.__enableScrollX=this.options.scrollingX&&l>=d,this.__enableScrollY=this.options.scrollingY&&a>=d,c.push(this.__scrollLeft,this.__scrollTop,t),this.__isDragging=(this.__enableScrollX||this.__enableScrollY)&&(l>=s||a>=s),this.__isDragging&&(this.__interruptedAnimation=!1)}this.__lastTouchLeft=r,this.__lastTouchTop=i,this.__lastTouchMove=t,this.__lastScale=n}doTouchEnd(e){if(e instanceof Date&&(e=e.valueOf()),typeof e!="number")throw new Error("Invalid timestamp value: "+e);if(this.__isTracking){if(this.__isTracking=!1,this.__isDragging)if(this.__isDragging=!1,this.__isSingleTouch&&this.options.animating&&e-this.__lastTouchMove<=100){let t=this.__positions,n=t.length-1,r=n;for(let i=n;i>0&&t[i]>this.__lastTouchMove-100;i-=3)r=i;if(r!==n){const i=t[n]-t[r],c=this.__scrollLeft-t[r-2],d=this.__scrollTop-t[r-1];this.__decelerationVelocityX=c/i*(1e3/60),this.__decelerationVelocityY=d/i*(1e3/60);const s=this.options.paging||this.options.snapping?4:1;(Math.abs(this.__decelerationVelocityX)>s||Math.abs(this.__decelerationVelocityY)>s)&&this.__startDeceleration(e)}else this.options.scrollingComplete?.()}else e-this.__lastTouchMove>100&&this.options.scrollingComplete?.();this.__isDecelerating||((this.__interruptedAnimation||this.__isDragging)&&this.options.scrollingComplete?.(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0,this.__zoomLevel)),this.__positions.length=0}}__publish(e,t,n,r=!1){const i=this.__isAnimating;if(i&&(Te(i),this.__isAnimating=0),r&&this.options.animating){this.__scheduledLeft=e,this.__scheduledTop=t,this.__scheduledZoom=n;const c=this.__scrollLeft,d=this.__scrollTop,s=this.__zoomLevel,l=e-c,a=t-d,h=n-s,f=function(m,S,C){C&&(this.__scrollLeft=c+l*m,this.__scrollTop=d+a*m,this.__zoomLevel=s+h*m,this.__callback&&this.__callback(this.__scrollLeft,this.__scrollTop,this.__zoomLevel))}.bind(this),p=function(m){return this.__isAnimating===m}.bind(this),_=function(m,S,C){S===this.__isAnimating&&(this.__isAnimating=!1),(this.__didDecelerationComplete||C)&&this.options.scrollingComplete?.(),this.options.zooming&&(this.__computeScrollMax(),this.__zoomComplete&&(this.__zoomComplete(),this.__zoomComplete=null))}.bind(this);this.__isAnimating=It(f,p,_,this.options.animationDuration,i?io:so)}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))}__computeScrollMax(e=this.__zoomLevel){this.__maxScrollLeft=Math.max(this.__contentWidth*e-this.__clientWidth,0),this.__maxScrollTop=Math.max(this.__contentHeight*e-this.__clientHeight,0)}__startDeceleration(e){if(this.options.paging){const c=Math.max(Math.min(this.__scrollLeft,this.__maxScrollLeft),0),d=Math.max(Math.min(this.__scrollTop,this.__maxScrollTop),0),s=this.__clientWidth,l=this.__clientHeight;this.__minDecelerationScrollLeft=Math.floor(c/s)*s,this.__minDecelerationScrollTop=Math.floor(d/l)*l,this.__maxDecelerationScrollLeft=Math.ceil(c/s)*s,this.__maxDecelerationScrollTop=Math.ceil(d/l)*l}else this.__minDecelerationScrollLeft=0,this.__minDecelerationScrollTop=0,this.__maxDecelerationScrollLeft=this.__maxScrollLeft,this.__maxDecelerationScrollTop=this.__maxScrollTop;const t=function(c,d,s){this.__stepThroughDeceleration(s)}.bind(this),n=this.options.snapping?4:.1,r=function(){const c=Math.abs(this.__decelerationVelocityX)>=n||Math.abs(this.__decelerationVelocityY)>=n;return c||(this.__didDecelerationComplete=!0),c}.bind(this),i=function(c,d,s){this.__isDecelerating=0,this.__didDecelerationComplete&&this.options.scrollingComplete?.(),this.scrollTo(this.__scrollLeft,this.__scrollTop,this.options.snapping)}.bind(this);this.__isDecelerating=It(t,r,i)}__stepThroughDeceleration(e){let t=this.__scrollLeft+this.__decelerationVelocityX,n=this.__scrollTop+this.__decelerationVelocityY;if(!this.options.bouncing){const r=Math.max(Math.min(this.__maxDecelerationScrollLeft,t),this.__minDecelerationScrollLeft);r!==t&&(t=r,this.__decelerationVelocityX=0);const i=Math.max(Math.min(this.__maxDecelerationScrollTop,n),this.__minDecelerationScrollTop);i!==n&&(n=i,this.__decelerationVelocityY=0)}if(e?this.__publish(t,n,this.__zoomLevel):(this.__scrollLeft=t,this.__scrollTop=n),!this.options.paging&&(this.__decelerationVelocityX*=.95,this.__decelerationVelocityY*=.95),this.options.bouncing){let r=0,i=0,c=this.options.penetrationDeceleration,d=this.options.penetrationAcceleration;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*c:this.__decelerationVelocityX=r*d),i!==0&&(i*this.__decelerationVelocityY<=0?this.__decelerationVelocityY+=i*c:this.__decelerationVelocityY=i*d)}}}const Qe=o=>E.jsx(dn,{...o}),ao=Object.freeze(Object.defineProperty({__proto__:null,defaultRenderScrollbar:Qe,getScrollTo:(o,e,t,n,r=0)=>{for(let i=0;i<t.length;i++){const c=t[i].getBoundingClientRect();let d=c.left-e,s=d+c.width;if(n){if(d<o&&s>=o)return d}else if(Math.ceil(s)>Math.ceil(o)+2)return s}return r}},Symbol.toStringTag,{value:"Module"})),le={scrollpane:"_scrollpane_1fbi8_2","vertical-container":"_vertical-container_1fbi8_7","horizontal-corner-container":"_horizontal-corner-container_1fbi8_12","scrollbar-sizer":"_scrollbar-sizer_1fbi8_26","scrollpane-content":"_scrollpane-content_1fbi8_34","scrollpane-content-element":"_scrollpane-content-element_1fbi8_43"},fn=o=>{const e=o?.width,t=o?.height;return E.jsx("div",{className:"corner",style:{minWidth:`${e}px`,width:`${e}px`,minHeight:`${t}px`,height:`${t}px`}})},pn=u.memo(u.forwardRef((o,e)=>{const{children:t,viewport:n,onScrollViewport:r,showHorizontalScrollbar:i=!0,showVerticalScrollbar:c=!0,createScrollCorner:d=fn,renderScrollbarHorizontal:s=Qe,renderScrollbarVertical:l=Qe,style:a,className:h,touchElement:f,disableTouch:p,..._}=o,m=i&&s,S=c&&l,C=D(r,[r]),y=et(e,()=>({isScrollPane:()=>!0}),[]),g=u.useRef(null);u.useEffect(()=>{g.current&&(g.current.__scrollTop===n?.top&&g.current.__scrollLeft===n?.left||g.current.__isDecelerating||g.current?.scrollTo(n?.left,n?.top,!1))},[n?.left,n?.top,f]);const b=u.useCallback((v,A)=>{C?.({left:v,top:A})},[]),j=u.useCallback(v=>{g.current?.doTouchStart(v.touches,v.timeStamp)},[]),M=u.useCallback(v=>{v.preventDefault(),g.current?.doTouchMove(v.touches,v.timeStamp)},[]),B=u.useCallback(v=>{g.current?.doTouchEnd(v.timeStamp)},[]),O=u.useCallback(({containerWidth:v,containerHeight:A,totalWidth:K,totalHeight:U})=>{g.current.setDimensions(v,A,K,U)},[]);u.useEffect(()=>{const v=f??y.current;if(!p&&Pe().supportsTouchEvents&&v&&n){if(!g.current){const A={scrollingX:!0,scrollingY:!0,decelerationRate:.95,penetrationAcceleration:.08};g.current=new lo(b,A)}Pe().supportsTouchEvents&&(v.addEventListener("touchstart",j),v.addEventListener("touchend",B),v.addEventListener("touchmove",M)),O({containerWidth:n?.width,containerHeight:n?.height,totalWidth:n?.totalWidth,totalHeight:n?.totalHeight})}return()=>{v?.removeEventListener("touchstart",j),v?.removeEventListener("touchend",B),v?.removeEventListener("touchmove",M)}},[n?.width,n?.height,n?.totalWidth,n?.totalHeight,p,f]);const[T,{width:w}]=me(),[k,{height:L}]=me(),I=u.useMemo(()=>{if(!S)return null;const v=l({orientation:Z.Vertical,offset:n?.top,viewportSize:n?.height,totalSize:n?.totalHeight,onScrollOffset:A=>{C?.({top:A})}});return E.jsx("div",{className:X("vertical-container",le["vertical-container"]),ref:T,children:v})},[l,n?.top,n?.height,n?.totalHeight]),P=u.useMemo(()=>{if(!m)return null;const v=s({orientation:Z.Horizontal,offset:n?.left,viewportSize:n?.width,totalSize:n?.totalWidth,onScrollOffset:A=>{C?.({left:A})}});return E.jsxs("div",{className:X("horizontal-corner-container",le["horizontal-corner-container"]),children:[E.jsx("div",{className:X("horizontal-sizer",le["horizontal-sizer"]),style:{width:`calc(100% - ${w}px)`},children:E.jsx("div",{ref:k,className:X("scrollbar-sizer",le["scrollbar-sizer"]),children:v})}),S?d({width:w,height:L}):E.jsx(E.Fragment,{})]})},[s,n?.left,n?.width,n?.totalWidth,S,d,w,L]);return E.jsx("div",{className:X(h,"scrollpane",le.scrollpane),style:{minWidth:S?`${w}px`:void 0,minHeight:m?`${L}px`:void 0,...a},..._,ref:y,children:E.jsxs("div",{className:X("scrollpane-content",le["scrollpane-content"]),children:[E.jsxs("div",{className:X("scrollpane-content-element",le["scrollpane-content-element"]),children:[E.jsx("div",{className:X("scrollpane-content-element",le["scrollpane-content-element"]),children:t}),S?I:E.jsx(E.Fragment,{})]}),m?P:E.jsx(E.Fragment,{})]})})}));pn.displayName="ScrollPane";const co=300,uo=100,ho=1e6,fo=100,po=50,$t=u.memo(u.forwardRef((o,e)=>{const{offset:t=0,viewportSize:n=0,totalSize:r=0,minSize:i=0,endGap:c=co,endScrollIncrement:d=uo,style:s=Ut,onMouseDown:l,onScrollOffset:a,onScroll:h,scaleLimit:f=ho,scaleFactor:p=fo,precisionFactor:_=po,renderScrollbar:m=Qe,...S}=o;h&&console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");const C=D(l,[l]),[y,g]=u.useState(!1),b=u.useMemo(()=>{const T=f===0?r:Math.min(r??0,Math.max(i??0,(t??0)+(n??0))+(c??0)),w=f!==0&&T>f?p:1,k=w/_,L=Math.ceil(T/w);return{offset:Math.ceil(t/w),totalSize:L,viewportSize:Math.ceil(n/w),scaledOffset:t,scaledTotalSize:r,scaledViewportSize:n,factor:w,precision:k}},[t,r,n,y,i,c,d]),j=D((T,w,k)=>{const L=b.offset;Math.abs(T-L)<b.precision&&(T=L),a?.(T*b.factor,L,b.viewportSize)},[a,b]),M=u.useCallback(T=>{},[]),B=u.useCallback(T=>{document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",B),g(!1)},[]),O=u.useCallback(T=>{g(!0),C?.(T),document.addEventListener("mousemove",M,{passive:!0}),document.addEventListener("mouseup",B,{passive:!0})},[M,B]);return m({style:s,...S,offset:b.offset,totalSize:b.totalSize,viewportSize:b.viewportSize,onMouseDown:O,onScrollOffset:j,ref:e})}));$t.displayName="VirtualScrollbar",exports.Command=Ye,exports.CommandButtonType={Toolbar:"toolbar",Menuitem:"menuitem"},exports.CommandGroup=gt,exports.DefaultDynamicIconService=ke,exports.DefaultReactNotifier=Yt,exports.DynamicIcon=Rt,exports.ErrorTestPanel=()=>null,exports.FocusKeyNavigation=kn,exports.HorizontalAlignment={General:"general",Left:"left",Right:"right",Center:"center",Justify:"justify",Fill:"fill",Distributed:"distributed",CenterContinuous:"centerContinuous"},exports.InMemoryStore=Ze,exports.KeyCodes={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,Composition:229},exports.KeyModifiers=Y,exports.LocalStorageStore=class{constructor(o=window.localStorage){this.storage=o}async getItem(o){try{return this.storage.getItem(o)}catch{return null}}async setItem(o,e){try{this.storage.setItem(o,e)}catch{}}async removeItem(o){try{this.storage.removeItem(o)}catch{}}subscribe(o){const e=t=>{t.storageArea===this.storage&&t.key&&o(t.key)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}},exports.MouseButtonCodes={Left:1,Middle:2,Right:3},exports.NotifierProvider=({children:o,notifier:e})=>(u.useEffect(()=>{const t=$.Notifier.getOverrides();return $.Notifier.setOverrides(e),()=>{$.Notifier.setOverrides(t)}},[e]),u.createElement(qt.Provider,{value:e},o)),exports.NotifierType=ht,exports.PersistenceStateProvider=function(o){const{store:e,namespace:t="",serializer:n=eo,debounceMs:r=0,crossTabSync:i=!0,children:c}=o,d=u.useMemo(()=>typeof window>"u"?new Ze:e??new Ze,[e]),s=u.useRef(new Map),l=u.useMemo(()=>({store:d,namespace:t,serializer:n,debounceMs:r,crossTabSync:i,notify(a){const h=s.current.get(a);h&&h.forEach(f=>f())},subscribeKey(a,h){const f=s.current,p=f.get(a)??new Set;return p.add(h),f.set(a,p),()=>{const _=f.get(a);_&&(_.delete(h),_.size===0&&f.delete(a))}}}),[d,t,n,r,i]);return u.useEffect(()=>{if(l.crossTabSync&&l.store.subscribe)return l.store.subscribe(a=>{if(!a.startsWith(l.namespace+":"))return;const h=a.slice(l.namespace.length+1);l.notify(h)})},[l]),E.jsx(jt.Provider,{value:l,children:c})},exports.ReactErrorBoundary=({children:o})=>{const e=Le(),t=u.useCallback(n=>{e.showError(n)},[e]);return E.jsx(Xn,{onError:t,children:o})},exports.ReactUtils=Mn,exports.RoundedTab=zn,exports.ScrollPane=pn,exports.ScrollUtils=ao,exports.Scrollbar=dn,exports.ScrollbarOrientation=Z,exports.SimpleCommand=We,exports.SplitPane=on,exports.SplitPaneResizer=nn,exports.ToolTipPlacement={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"},exports.UncaughtErrorBoundary=({children:o})=>{const e=Le();return u.useEffect(()=>{const t=new Yn(e);return()=>{t.cleanup()}},[e]),E.jsx(E.Fragment,{children:o})},exports.VirtualScrollbar=$t,exports.WalkingIcon=function(o){const{isWalking:e=!1,themedType:t="info",speed:n=120,dashGap:r=3,dashLength:i=5,iconKey:c,packKey:d,style:s,className:l,...a}=o,h=u.useMemo(()=>{if(!e)return;const p={"--walk-duration":`${n*(r+i)}ms`,"--walk-dash-length":`${i}px`,"--walk-dash-gap":`${r}px`};return t&&t!=="accent"&&(p["--icon-accent"]=`var(--icon-${t})`),p},[e,n,r,i,t]),f=u.useMemo(()=>e?l+" walking":l,[e,l]);return E.jsx(Rt,{iconKey:c,packKey:d,className:f,style:{...s,...h},...a})},exports.createDynamicIconService=rn,exports.defaultCreateScrollCorner=fn,exports.defaultCreateScrollEdgeButton=o=>{const{style:e,orientation:t=Z.Vertical,...n}=o,r=t===Z.Vertical,i=r?"rotate(90) ":"";return E.jsx("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:E.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",transform:i,children:E.jsx("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"})})})},exports.defaultCreateScrollEndButton=un,exports.defaultCreateScrollStartButton=cn,exports.getDevicePixelRatio=function(o){if(typeof window>"u")return 1;const{defaultDpr:e=1,maxDpr:t=3,round:n=!0}=o||{},r=typeof window<"u"&&typeof window.devicePixelRatio=="number"?window.devicePixelRatio:e;return Math.min(Math.max(1,n?Math.floor(r):r),t)},exports.toShortcutString=we,exports.useAnimatedMeasure=Gt,exports.useCallbackRef=D,exports.useCommand=function(o,e=null){const t=u.useRef(e);t.current=e;const[n,r]=u.useReducer(c=>c+1,0),i=u.useMemo(()=>Array.isArray(o)?o:[o],[o]);return u.useEffect(()=>{const c=i?i.length:0;if(c===0)return;const d=(a,h)=>{t.current?.onChange?.(h),r()};let s=null;e&&(s={onExecute(a,h){t.current?.onExecute?.(a,h)},onError(a,h,f){t.current?.onError?.(a,h,f)}});const l=new Set;for(let a=0;a<c;a++){const h=i[a];h&&(l.add(h.addPropertyListener($.CommonUtils.debounce(d,0),!0)),e&&l.add(h.addExecuteListener(s)))}return()=>{l.forEach(a=>{a?.()})}},[o]),n},exports.useCommands=function(o,e=null,t=null,n){const r=u.useRef(t);r.current=t,e&&!Array.isArray(e)&&(e=[e]);const[i,c]=u.useState(Fe(o,e)),d=n?[...n,o]:[o];return u.useEffect(()=>{const s={onGroupChange:()=>{const f=Fe(o,e);c(f),r.current?.onChange?.(this)}};let l;e&&e.length>0&&(l={keys:e},s.onCommandChange=(f,p)=>{r.current?.onChange?.(o),c(Fe(o,e))});const a=o?.addListener(s,l),h=Fe(o,e);return c(h),r.current?.onChange&&r.current?.onChange(o),()=>{a?.()}},d),i},exports.useCopyPaste=o=>{const{source:e,target:t,onPaste:n,onClipboardUpdate:r,commands:i}=o,c=Le(),d=D(r,[r]),s=D(n,[n]),{getClipboard:l,refNativeCopy:a}=Et(),h=l();u.useMemo(()=>{const y=e?.element,g=t?.element??e?.element;if(!i)return;const b=[new We("cut",y,{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:[Y.Ctrl]}}),new We("copy",y,{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:[Y.Ctrl]}}),new We("paste",g,{label:"Paste",description:"Add content on the clipboard to your document.",icon:"paste.yellow",shortcut:[{key:"V",modifiers:[Y.Ctrl]},{key:"F8",modifiers:[Y.Ctrl]}]})];i?.addCommands(b,!0)},[i]);const f=D(async y=>{if(!e?.element)return;let g=null;try{g=e.doCopy?.(y),typeof g=="string"?await h.writeText(g):await h.writeReference(g)}catch(b){throw b}},[e,c]),p=D(async y=>{const g=e?.element?.();if(g){a.current={sourceElement:g,args:y};try{await f(y)}catch(b){c.showError?.(b)}}},[e?.element,c]),_=u.useCallback(()=>{p({isCut:!0})},[]),m=D(async(y,g,b)=>{try{if(await y.doPaste(g,b)===!1)return;s?.(g,b)}catch(j){c.showError?.(j)}},[s]),S=D(async(y,g,b)=>{const j=t?.element?.();if(j&&await $.CommonUtils.whenFocus(j),!y&&!g)return;const M=await c.showBusy?.("Pasting...");if(g)try{return await m(t,g,b),void M?.()}catch(T){M?.(),c.showError?.(T)}let B,O=t.importFromExternal;O||(O=(T,w)=>({getItemType:()=>"text",toText:()=>y.text,isClipboardItem:!0}));try{B=await O(y,{isCut:!1})}catch(T){M?.(),c.showError?.(T)}if(B)try{const T=await Promise.resolve(B);await m(t,T,b),M?.()}catch(T){M?.(),c.showError?.(T)}else M?.()},[m,t,c]),C=D(async y=>{if(t?.element)try{const g=await h.readReference();if(g)return void await S(null,g,y);const b=[];b[0]=await $.ClipboardUtils.readStringFromClipboard(h,$.MimeType.plain),b[1]=await $.ClipboardUtils.readHTMLFromClipboard(h,$.MimeType.html),b[2]=await $.ClipboardUtils.readBlobFromClipboard(h,$.MimeType.png);const j={text:b[0]??null,html:b[1]??null,image:b[2]??null};await S(j,null,y)}catch(g){if(g?.message==="Document is not focused.")return;c.showError?.(g)}},[S,t?.element,c]);return D(async y=>{},[e?.element]),D(async y=>{},[t?.element,S,c]),u.useEffect(()=>{if(!h)return;const y=async j=>{const M=await h.readReference();d?.(M)},g=j=>{c.showMessage?.($.InternalClipboard.ErrorMessages.PermsRead,{onceKey:"clipboard.features"})},b=j=>{c.showMessage?.($.InternalClipboard.ErrorMessages.PermsWrite,{onceKey:"clipboard.features"})};return h.addEventListener("clipboardchange",y),h.addEventListener("clipboarderrorread",g),h.addEventListener("clipboarderrorwrite",b),()=>{h.removeEventListener("clipboardchange",y),h.removeEventListener("clipboarderrorread",g),h.removeEventListener("clipboarderrorwrite",b)}},[h,c]),u.useEffect(()=>{},[f,S,e,t]),u.useEffect(()=>{i?.getCommand("cut")?.updateCallback(_).update({disabled:!e||!t}),i?.getCommand("copy")?.updateCallback(p).update({disabled:!e}),i?.getCommand("paste")?.updateCallback(C).update({disabled:!t})},[e,t,i]),{paste:C,copy:p,clipboard:h}},exports.useDevicePixelRatio=function(o){const[e,t]=u.useState(typeof window<"u"?window.devicePixelRatio:1),n=u.useRef(null);return u.useEffect(()=>{if(!(typeof window<"u"&&"matchMedia"in window))return;const r=()=>{const i=window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);i.addEventListener("change",r,{once:!0,passive:!0}),t(window.devicePixelRatio),n.current={mediaMatcher:i,listener:r}};return r(),()=>{n.current&&n.current.mediaMatcher.removeEventListener("change",n.current.listener)}},[o]),e},exports.useEditMode=()=>{const o=Kn();return u.useMemo(()=>({setMode:e=>{en(t=>(typeof e=="function"&&(e=e(t)),e?.onModeChange?.(e??null),e))},getMode:()=>o}),[o])},exports.useFullscreenPortal=Zt,exports.useGlobalClipboard=Et,exports.useId=Fn,exports.useImperativeElement=et,exports.useMouseDownAndHoldListener=function(o,e){return dt({onPointerDown:o,onPointerMoveOrWait:(t,n,r)=>{o?.(r)},...e})},exports.useNotifier=Le,exports.useOnClickOrFocusAway=function(o,e,t){const n=D(e,[e]);u.useEffect(()=>{const r=i=>{o.current&&!o.current.contains(i.target)&&n(i)};return t&&t.mouseEvents===!1||(document.addEventListener("mousedown",r),document.addEventListener("touchstart",r)),t&&t.focusEvents===!1||document.addEventListener("focus",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r),document.removeEventListener("focus",r)}},[o])},exports.usePersistenceState=function(o,e,t=Qn){const{store:n,namespace:r,serializer:i,debounceMs:c,subscribeKey:d}=u.useContext(jt)||Jn,s=t.serializer??i??sn,l=u.useMemo(()=>`${r}:${o}`,[r,o]),a=u.useRef(null),h=`${l}::v`,[f,p]=u.useState(()=>{let m;try{if(typeof window<"u"&&"localStorage"in window&&l.startsWith(r)){const S=window.localStorage?.getItem(l)??null;S!=null&&(m=s.parse(S))}}catch{}if(m===void 0){const S=e;return typeof S=="function"?S():S}return m});u.useEffect(()=>{let m=!0;return(async()=>{const[S,C]=await Promise.all([n.getItem(l),n.getItem(h)]);let y;try{y=S==null?void 0:s.parse(S)}catch{}const g=C==null?void 0:Number.parseInt(C,10);y===void 0?!t.lazy&&e!==void 0&&(y=typeof e=="function"?e():e,await n.setItem(l,s.stringify(y)),t.version!=null&&await n.setItem(h,String(t.version))):t.version!=null&&g!==void 0&&g!==t.version&&t.migrate&&(y=t.migrate(y,g),await n.setItem(l,s.stringify(y)),await n.setItem(h,String(t.version))),m&&y!==void 0&&p(y)})(),()=>{m=!1}},[n,l,h,t.version,t.migrate,t.lazy]),u.useEffect(()=>d(o,async()=>{const m=await n.getItem(l);if(m!=null)try{p(s.parse(m))}catch{}}),[n,l,d,o]);const _=async m=>{await n.setItem(l,s.stringify(m)),t.version!=null&&await n.setItem(h,String(t.version))};return[f,m=>{p(S=>{const C=typeof m=="function"?m(S):m;return a.current&&clearTimeout(a.current),c>0?a.current=setTimeout(()=>{_(C)},c):_(C),C})},()=>{if(a.current&&clearTimeout(a.current),n.removeItem(l),n.removeItem(h),e!==void 0){const m=typeof e=="function"?e():e;p(m)}else p(void 0)}]},exports.useSynchronizedPointerHandler=dt,exports.useTraceUpdate=function(o,e=!0){const t=u.useRef(o);u.useEffect(()=>{if(e){const n=Object.entries(o).reduce((r,[i,c])=>(t.current[i]!==c&&(r[i]=[t.current[i],c]),r),{});Object.keys(n).length>0&&console.log("Changed props:",n)}t.current=o})},exports.useUndoManager=({manager:o,commands:e,disabled:t})=>{const n=Le(),r=D(c=>{try{o?.undo(c)}catch(d){n.error(d)}},[o]),i=D(c=>{try{o?.redo(c)}catch(d){n.error(d)}},[o]);return u.useMemo(()=>{if(!e)return;const c={contains:s=>!0,focus(){}},d=[new Ye("undo",c,{label:"Undo",description:Lt,shortcut:{key:"z",modifiers:[Y.Ctrl]},disabled:!0},r),new Ye("redo",c,{label:"Redo",description:Tt,shortcut:[{key:"y",modifiers:[Y.Ctrl]},{key:"F4"},{key:"Enter",modifiers:[Y.Alt]}],disabled:!0},i)];e?.addCommands(d,!0)},[e]),u.useEffect(()=>{if(!e)return;const c=()=>{const s=o?.getTopUndoDescription(),l={};var a;e.getCommand("undo").update({disabled:t||!o||!o.hasUndo(),description:s?(a=s,`Undo ${a}`):Lt,state:l,context:{undoManager:o}});const h=o?.getTopRedoDescription();e.getCommand("redo").update({disabled:t||!o||!o.hasRedo(),description:h?Vn(h):Tt,state:l,context:{undoManager:o}})};if(c(),!o)return;const d=o.addListener({onStackChange(){c()}});return()=>d?.()},[o,e,t]),{undo:r,redo:i}};
|
|
7
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),$=require("@sheetxl/utils"),E=require("react/jsx-runtime"),gn=require("react-dom/client"),Nt=require("react-dom"),Y={Shift:"shift",Alt:"alt",Ctrl:"ctrl",Meta:"meta"};class Ye{constructor(e,t,n,r){this._listenersProperties=new Set,this._listenersExecute=new Set,this._key=e,this._target=t,this._applyProps(n||{}),this._callback=r,r===void 0&&(this._callback=()=>{console.log(`implement: ${this.getLabel()} : ${this.getDescription()}`)})}getKey(){return this._key}_resolve(e,t){if(typeof e=="function"){const n=t??this._context;return e(typeof n=="function"?n():n)}return e}getTarget(){return typeof this._target=="function"?this._target():this._target}getLabel(e,t){const n=this._scopedLabels?.[e]||this._label;let r=null;if(typeof n=="function"){const i=t??this._context;r=n(typeof i=="function"?i():i)}else r=n;return r}getDescription(e){return this._resolve(this._description,e)}getTags(e){return this._resolve(this._tags,e)}getIcon(e){return this._resolve(this._icon,e)}getShortcut(){return this._resolve(this._shortcut)}disabled(){return this._resolve(this._disabled)||!this._callback}getState(){return this._resolve(this._state)}getContext(){return typeof this._context=="function"?this._context():this._context}async execute(e,t){if(!this.disabled()&&this._callback){try{let n=!0;if(t?.beforeExecute&&(n=t?.beforeExecute(this,e)),await Promise.resolve(n)===!1)return!1;const r=this._callback.bind(this)(e,this);if(await Promise.resolve(r)===!1)return!1;t?.onExecute?.(this,e),this._notifyExecute(e)}catch(n){return console.warn(n),t?.onError(this,n,e),this._notifyError(e,n),!1}return!0}}addPropertyListener(e,t=!1){if(!e)throw new Error("listener must be specified");const n=this._listenersProperties;return n.add(e),t&&e({},this),()=>{n.delete(e)}}addExecuteListener(e){if(!e)throw new Error("listener must be specified");const t=this._listenersExecute;return t.add(e),function(){t.delete(e)}}_notifyExecute(e){const t=this;this._listenersExecute.forEach(n=>{n.onExecute(t,e)})}_notifyError(e,t){const n=this;this._listenersExecute.forEach(r=>{r.onError?.(n,e,t)})}updateCallback(e){return this._callback=e||null,this}update(e){if(!e)return;const t=this._applyProps(e);return Object.keys(t).length>0&&this._notifyPropertyChange(t),this}_notifyPropertyChange(e){const t=this;this._listenersProperties.forEach(n=>{n(e,t)})}_applyProps(e){let t={},n=this;return Object.keys(e).forEach(r=>{let i=e[r];n["_"+r]!==i&&(n["_"+r]=t[r]=i)}),t}}class We extends Ye{}var ee=typeof window<"u"?window:{screen:{},navigator:{}},Se=(ee.matchMedia||function(){return{matches:!1}}).bind(ee),Kt=!1,yn={get passive(){return Kt=!0}},wt=function(){};ee.addEventListener&&ee.addEventListener("p",wt,yn),ee.removeEventListener&&ee.removeEventListener("p",wt,!1);var vn=Kt,bn="PointerEvent"in ee,_t="ontouchstart"in ee,Ht=_t||"TouchEvent"in ee&&Se("(any-pointer: coarse)").matches,xt=(ee.navigator.maxTouchPoints||0)>0||Ht,Wt=ee.navigator.userAgent||"",wn=Se("(pointer: coarse)").matches&&/iPad|Macintosh/.test(Wt)&&Math.min(ee.screen.width||0,ee.screen.height||0)>=768,Ft=(Se("(pointer: coarse)").matches||!Se("(pointer: fine)").matches&&_t)&&!/Windows.*Firefox/.test(Wt),xn=Se("(any-pointer: fine)").matches||Se("(any-hover: hover)").matches||wn||!_t,ut=!xt||!xn&&Ft?xt?"touchOnly":"mouseOnly":"hybrid",Sn=ut==="mouseOnly"?"mouse":ut==="touchOnly"||Ft?"touch":"mouse";const En=Object.freeze(Object.defineProperty({__proto__:null,deviceType:ut,primaryInput:Sn,supportsPassiveEvents:vn,supportsPointerEvents:bn,supportsTouchEvents:Ht},Symbol.toStringTag,{value:"Module"})),Cn=new Set(["INPUT","TEXTAREA","SELECT"]),Ut={};function Pe(){return En}const Vt=o=>o==="BracketLeft"?"[":o==="BracketRight"?"]":$.CommonUtils.camelToPrettyCase(o),qe=(o,e)=>{let t=!1,n=!1;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:()=>{t=!0,o.preventDefault()},isDefaultPrevented:()=>t,stopPropagation:()=>{n=!0,o.stopPropagation()},isPropagationStopped:()=>n,persist:()=>{},timeStamp:o.timeStamp,type:o.type};for(const i in o)i in r||typeof o[i]=="function"||(r[i]=o[i]);return r},Mn=Object.freeze(Object.defineProperty({__proto__:null,EmptyCssProperties:Ut,boundPixel:function(o,e=!1,t=0){return o},createSyntheticEvent:qe,detectIt:Pe,focusableNodeNames:Cn,toPrettyKeyCode:Vt},Symbol.toStringTag,{value:"Module"}));class gt{constructor(e,t){this._target=null,this._groupKey=null,this._root=null,this._parent=null,this._uuid=$.CommonUtils.uuidV4(),this._target=e,this._groupKey=t??null,this._root=this,this._nodes=new Map,this._nodes.set(t,this),this._children=new Map,this._listeners=new Set,this._commandsByKey=new Map,this._commandsByShortcut=new Map;const n=this;this._unListenersByCommand=new Map,this._listenersByKey=new Map,this._commandsPropertyListener=(r,i)=>{const c=n._root._listenersByKey,d=i.getKey(),s=c.get(d);s&&n._notifyCommands(s,"onCommandChange",i)}}_getCommand(e){return this._commandsByKey.get(e)||(this._parent?._getCommand(e)??null)}getCommand(e,t=!1){const n=this._root._focused;let r=n,i=n===this;for(;!i&&r;)r===this&&(i=!0),r=r._parent;return(i?n:this)._getCommand(e)}createChildGroup(e,t,n){let r;if(!n){let d=this;for(;d&&!r;){let s=d._nodes.get(t);s&&(r=s),d=d._parent}}r||(r=new gt(e,t),r._parent=this,r._root=this._root,r._unListenersByCommand=null,r._listenersByKey=null,r._commandsPropertyListener=null);const i=(d,s)=>{!d.has(t)||n?d.set(t,s):n===void 0&&console.warn("commandGroup already registered",t)};i(this._root._nodes,r);let c=this._parent;for(;c;)i(this._nodes,r),c=c._parent;return this._children.set(t,r),this._notify("onGroupChange"),r}getKey(){return this._groupKey}getGroup(e){return this._nodes.get(e)}_addCommands(e,t=void 0){const n=this._commandsByKey,r=this._commandsByShortcut,i=this._root._commandsPropertyListener,c=this._root._unListenersByCommand,d=e.length;for(let s=0;s<d;s++){const l=e[s],a=l.getKey();if(n.has(a)&&!t){t===void 0&&console.warn("command already registered",a);continue}n.set(a,l);let h=c.get(l);h&&(h(),c.delete(l));const f=l.addPropertyListener(i);c.set(l,f);const p=l.getShortcut();if(!p)continue;const _=Array.isArray(p)?p:[p],m=_.length;for(let S=0;S<m;S++){const C=we(_[S]),y=r.get(C);y&&!t&&t===void 0&&console.warn(`Shortcut already registered: ${C}, ${a}, ${y}.`),r.set(C,a)}}}removeFromParent(){if(!this._parent)return;let e=this._parent,t=[];const n=this._groupKey;for(;e;)t.push(e._nodes),e._nodes.delete(n),e=e._parent;e=this._parent;const r=i=>{i._children.forEach(c=>{const d=t.length,s=c._nodes;for(let l=0;l<d;l++)s.delete(t[l]);r(c)})};r(this),this._parent=null,this._notify("onGroupChange")}addCommands(e,t){this._addCommands(e,t),this._notify("onGroupChange")}getActive(){return this._root._focused??this._root}activate(e){let t=this;if(e&&(t=this._nodes.get(e),!t))return void console.warn("group not found",e);let n=this._root._focused??this._root;for(;n;)n=n._parent;this._root._focused!==t&&(this._root._focused=t,this._notify("onGroupChange"),this._notify("onActiveChange"))}findCommandByEvent(e){const t=[];e.altKey&&t.push(Y.Alt),e.shiftKey&&t.push(Y.Shift),e.ctrlKey&&t.push(Y.Ctrl),e.metaKey&&t.push(Y.Meta);let n=we({key:e.code,modifiers:t});const r=this._commandsByShortcut;let i=r.get(n);i||(n=we({key:e.key,modifiers:t}),i=r.get(n)),!i&&e.code.startsWith("Digit")&&(n=we({key:e.code.substring(5,e.code.length),modifiers:t}),i=this._commandsByShortcut.get(n)),!i&&e.code.startsWith("Key")&&(i=we({key:e.code.substring(3,e.code.length),modifiers:t}),i=r.get(n));let c=null;return i&&(c=this._commandsByKey.get(i),c&&c.disabled()&&(c=null),!c||c.getTarget()&&c.getTarget().contains(e.target)||(c=null)),c||(this._parent?.findCommandByEvent(e)??null)}dispatchToFocusedCommand(e){const t=this.getActive();if(!t||e.isDefaultPrevented())return!1;const n=t.findCommandByEvent?.(e);return!!n&&(n.execute(),e.preventDefault(),!0)}getRoot(){return this._parent?this._parent.getRoot():this}getParent(){return this._parent}addListener(e,t){const n=this._listeners,r=t?.keys,i=this._root._listenersByKey;if(r&&!e.onCommandChange)throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");let c=null;if(r){const d=r.length;for(let s=0;s<d;s++){const l=r[s];if(!l)continue;let a=i.get(l);a||(a=new Set,i.set(l,a)),c||(c=[]),c.push(a),a.add(e)}}return n.add(e),()=>{if(c){const d=c.length;for(let s=0;s<d;s++)c[s].delete(e)}n.delete(e)}}_notifyCommands(e,t,n){const r=this;setTimeout(()=>{e.forEach(i=>{i[t]?.(r,n)})},0)}_notify(e,t){const n=this;setTimeout(()=>{n._listeners.forEach(r=>{r[e]?.(n,t)}),n._parent&&n._parent._notify(e,t)},0)}getAllCommands(){const e=[],t=this._groupKey;return this._commandsByKey.forEach(n=>{e.push({command:n,groupKey:t})}),this._children.forEach(n=>{e.push(...n.getAllCommands())}),e}}const Ln=$.CommonUtils.getOS()===$.CommonUtils.OSType.MacOS||$.CommonUtils.getOS()===$.CommonUtils.OSType.IOS?"Cmd":"Ctrl",Tn=$.CommonUtils.getOS()===$.CommonUtils.OSType.MacOS||$.CommonUtils.getOS()===$.CommonUtils.OSType.IOS?"⌘":"^",we=(o,e=!1)=>{const t={};for(let r=0;o.modifiers&&r<o.modifiers.length;r++)t[o.modifiers[r]]=!0;let n="";return(t?.[Y.Ctrl]||t?.[Y.Meta])&&(n+=(n.length>0?"+":"")+(e?Tn:Ln)),t?.[Y.Alt]&&(n+=e?"⌥":"Alt"),t?.[Y.Shift]&&(n+=(n.length>0?"+":"")+(e?"⇧":"Shift")),n+=(n.length>0?"+":"")+Vt(o.key),n},Fe=(o,e)=>{if(!e||!o||e.length===0)return $.CommonUtils.EmptyArray;const t=e.length,n=new Array(t);for(let r=0;r<t;r++){const i=e[r],c=i?o.getCommand(i):null;n[r]=c}return n};function st(o,e){if(typeof o=="function")return o(e);o&&(o.current=e)}var Ee=parseInt(u.version.split(".")[0],10)>=19?function(o){return e=>{const t=[];for(const n of o){const r=st(n,e),i=typeof r=="function";t.push(i?r:()=>st(n,null))}return()=>{for(const n of t)n()}}}:function(o){return e=>{for(const t of o)st(t,e)}};const kn=u.memo(u.forwardRef((o,e)=>{const{refFocusStart:t,...n}=o,r=u.useRef(null),i=u.useCallback(()=>{if(t)return void t?.current?.focus();const c=r.current.parentElement.children;let d=[];const s=c.length;for(let l=0;l<s&&c[l]!==r.current;l++){const a=c[l],h=a.getAttribute("tabindex");h==null||h==="-1"||a.getAttribute("disabled")!=="true"&&a.focus&&d.push({tabindex:parseInt(h),child:a})}d.length!==0&&(d.sort(function(l,a){return l.tabindex-a.tabindex}),d[0].child.focus())},[t]);return E.jsx("div",{tabIndex:0,ref:Ee([r,e]),onFocus:i,...n})}));var Pn=function(){},Xt=typeof window<"u",Dn=Xt?u.useLayoutEffect:u.useEffect,St={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const me=Xt&&window.ResizeObserver!==void 0?function(){var o=u.useState(null),e=o[0],t=o[1],n=u.useState(St),r=n[0],i=n[1],c=u.useMemo(function(){return new window.ResizeObserver(function(d){if(d[0]){var s=d[0].contentRect,l=s.x,a=s.y,h=s.width,f=s.height,p=s.top,_=s.left,m=s.bottom,S=s.right;i({x:l,y:a,width:h,height:f,top:p,left:_,bottom:m,right:S})}})},[]);return Dn(function(){if(e)return c.observe(e),function(){c.disconnect()}},[e]),[t,r]}:function(){return[Pn,St]},zn=u.memo(u.forwardRef((o,e)=>{const{className:t,style:n,children:r,radius:i=4,strokeWidth:c=1,strokeColor:d="grey",...s}=o,[l,{width:a,height:h}]=me(),f=u.useRef(null),p=(C,y=0)=>{const g=C/2,b=h-g+y;return(function(j,M,B=!1){if(M===0)return j;function O(P,v,A){let K=v.x-P.x,U=v.y-P.y,z=Math.sqrt(K*K+U*U);return T(P,v,Math.min(1,A/z))}function T(P,v,A){return{x:P.x+(v.x-P.x)*A,y:P.y+(v.y-P.y)*A}}function w(P,v){P.length>2&&(P[P.length-2]=v.x,P[P.length-1]=v.y)}function k(P){return{x:parseFloat(P[P.length-2]),y:parseFloat(P[P.length-1])}}let L=j.split(/[,\s]/).reduce(function(P,v){let A=v.match("([a-zA-Z])(.+)");return A?(P.push(A[1]),P.push(A[2])):P.push(v),P},[]).reduce(function(P,v){return parseFloat(v)==v&&P.length?P[P.length-1].push(v):P.push([v]),P},[]),I=[];if(L.length>1){let P=k(L[0]),v=null;L[L.length-1][0]==="Z"&&L[0].length>2&&(v=["L",P.x,P.y],L[L.length-1]=v),I.push(L[0]);for(let A=1;A<L.length;A++){let K=I[I.length-1],U=L[A],z=U===v?L[1]:L[A+1];if(z&&K&&K.length>2&&U[0]==="L"&&z.length>2&&z[0]==="L"){let W,H,V=k(K),J=k(U),_e=k(z);B?(W=T(J,K.origPoint||V,M),H=T(J,z.origPoint||_e,M)):(W=O(J,V,M),H=O(J,_e,M)),w(U,W),U.origPoint=J,I.push(U);let ce=T(W,J,.5),ge=T(J,H,.5),ue=["C",ce.x,ce.y,ge.x,ge.y,H.x,H.y];ue.origPoint=J,I.push(ue)}else I.push(U)}if(v){let A=k(I[I.length-1]);I.push(["Z"]),w(I[0],A)}}else I=L;return I.reduce(function(P,v){return P+v.join(" ")+" "},"")})(`${`M 0 ${g} L ${i-.5} ${g} L ${i-.5} ${b} L ${2*i} ${b}`} ${`L ${a-2*i} ${b}`} ${`M ${a-2*i} ${b} L ${a-i} ${b} L ${a-i} ${g} L ${a} ${g}`}`,i)},_=u.useMemo(()=>p(c),[a,h,i,c]),m=u.useMemo(()=>{if(i===0)return;const C=i/2;return p(i)+`L ${a} 0 L 0 0 L 0 ${C}`},[_,i,c]),S=u.useMemo(()=>({style:{clipPath:`path('${m}')`}}),[m]);return E.jsxs("div",{className:t,style:{display:"flex",flexDirection:"row",...n},...s,ref:Ee([f,l,e]),children:[u.isValidElement(r)?u.cloneElement(r,S):E.jsx(E.Fragment,{}),E.jsx("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none"},width:a,height:h,viewBox:`0 0 ${a} ${h}`,children:E.jsx("path",{d:_,stroke:d,fill:"none",vectorEffect:"non-scaling-stroke",strokeWidth:c})})]})})),ht={Default:"default",Error:"error",Success:"success",Warning:"warning",Info:"info"};class Yt extends $.DefaultNotifier{setOverrides(e){super.setOverrides(e)}getDelegate(){return this._overrides}showMessage(e,t){const n=this.getDelegate();if(n?.showMessage)return n.showMessage(e,t);t?.type!==ht.Warning?t?.type!==ht.Error?$.Notifier.log(e):$.Notifier.error(e):$.Notifier.warn(e)}showBusy(e,t){const n=this.getDelegate();return n?.showBusy?n.showBusy(e,t):new Promise(r=>{r(()=>{})})}showWindow(e,t){const n=this.getDelegate();if(n?.showWindow)return n.showWindow(e,t)}showError(e){const t=this.getDelegate();t?.showError?t.showError(e):$.Notifier.error(e)}showOptions(e){const t=this.getDelegate();return t?.showOptions?t.showOptions(e):Promise.resolve("")}showInput(e){const t=this.getDelegate();return t?.showInput?t.showInput(e):Promise.resolve({input:"",option:""})}}const An=new Yt,qt=u.createContext(An),Le=()=>u.useContext(qt),Rn=3,jn=.5,Bn=50,lt=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});function Gt(o={}){const{threshold:e=jn,stillnessThreshold:t=Rn,maxHierarchyDepth:n=Bn}=o,[r,i]=me(),c=u.useRef(null),[d,s]=u.useReducer(_=>_+1,0),l=u.useRef(void 0),a=u.useRef({x:0,y:0,width:0,height:0,top:0,left:0,right:0,bottom:0}),h=u.useCallback(_=>{c.current=_,typeof r=="function"&&r(_)},[r]),[f,p]=u.useState(i);return u.useEffect(()=>{i&&!f&&p(i)},[i,f]),u.useEffect(()=>{const _=c.current;if(!_)return;let m=!1,S=0;const C=()=>{if(!_)return;const M=_.getBoundingClientRect(),B=a.current;Math.abs(M.x-B.x)>e||Math.abs(M.y-B.y)>e||Math.abs(M.width-B.width)>e||Math.abs(M.height-B.height)>e?(m||(m=!0,p(lt(M)),s()),S=0):S++,m&&S>=t&&(m=!1,p(lt(M)),s()),a.current=lt(M),l.current=requestAnimationFrame(C)};l.current=requestAnimationFrame(C);const y=M=>{m=!0,s()},g=M=>{m=!1,S=t,s()};let b=_;const j=[];for(;b&&b!==document.documentElement&&(b.addEventListener("animationstart",y,!0),b.addEventListener("animationend",g,!0),b.addEventListener("transitionstart",y,!0),b.addEventListener("transitionend",g,!0),j.push(b),b=b.parentElement,!(j.length>n)););return()=>{l.current&&cancelAnimationFrame(l.current),j.forEach(M=>{M.removeEventListener("animationstart",y,!0),M.removeEventListener("animationend",g,!0),M.removeEventListener("transitionstart",y,!0),M.removeEventListener("transitionend",g,!0)})}},[d,i,e,t,n]),[h,f]}const D=(o,e)=>{const t=u.useCallback((...i)=>o?.(...i),e),n=u.useRef(null);n.current=t;const r=u.useCallback((...i)=>n.current?.(...i),[]);if(n.current)return r};let Ue=0;function Zt(){const[o,e]=u.useState(!!document.fullscreenElement),t=u.useCallback(()=>{const n=document.fullscreenElement;return n?n.querySelector(".fullscreen-portal-root")||n:document.body},[]);return u.useEffect(()=>{function n(){const r=document.fullscreenElement;if(e(!!r),!r)return;let i=r.querySelector(".fullscreen-portal-root");i||(i=document.createElement("div"),i.className="fullscreen-portal-root _fullscreen-portal-root_1mjsr_4",r.appendChild(i))}return Ue++,n(),document.addEventListener("fullscreenchange",n),()=>{document.removeEventListener("fullscreenchange",n),Ue--,Ue<=0&&(document.querySelectorAll(".fullscreen-portal-root").forEach(r=>{r.parentNode&&r.parentNode.removeChild(r)}),Ue=0)}},[]),{getPortalContainer:t,isFullscreen:o}}function dt(o){if(!o)throw new Error("must have a PointerHandlerOptions");const{onPointerDown:e,onPointerUp:t,onPointerMoveOrWait:n,processTouch:r=!1,consumeTouch:i=!0}=o,c=D(e,[e]),d=D(t,[t]),s=D(n,[n]),l=u.useRef(!1),a=o?.timerInitial??230,h=o?.timerContinuous??a/2,f=u.useRef(null),p=u.useRef(null),_=u.useRef(null),m=u.useRef(null),S=u.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null)},[]),C=u.useCallback(w=>{m.current=setTimeout(()=>{window.requestAnimationFrame(()=>{if(l.current===!1)return;const k=p.current,L=f.current,I=qe(k,L.currentTarget);s?.(I,_.current,L)}),C(h)},w??a)},[]);u.useEffect(()=>()=>S(),[]);const y=r?"pointer":"mouse",g=u.useCallback(w=>{w.stopPropagation(),w.stopImmediatePropagation(),w.preventDefault()},[]),b=D(w=>{document.removeEventListener(`${y}move`,B),document.removeEventListener(`${y}up`,b),document.removeEventListener("keydown",O),document.removeEventListener("keyup",T),document.removeEventListener("touchstart",g,{capture:!0}),document.removeEventListener("touchmove",g,{capture:!0}),window.removeEventListener("blur",j),S(),window.requestAnimationFrame(()=>{if(l.current===!1)return;l.current=!1;const k=w,L=f.current,I=qe(k,L.currentTarget);d?.(I,_.current,L),_.current=null})},[]),j=u.useCallback(()=>{l.current!==!1&&(l.current=!1,b(p.current))},[]),M=D(()=>{S(),C(h),window.requestAnimationFrame(()=>{if(l.current===!1)return;const w=p.current,k=f.current,L=qe(w,k.currentTarget);s?.(L,_.current,k)})},[h]),B=D(w=>{p.current=w,M()},[]),O=D(w=>{_.current={ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,altKey:w.altKey,metaKey:w.metaKey},M()},[]),T=D(w=>{_.current={ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,altKey:w.altKey,metaKey:w.metaKey},M()},[h]);return D(w=>{w.isDefaultPrevented()||(_.current={ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,altKey:w.altKey,metaKey:w.metaKey},c(w,_.current)!==!1&&(f.current=w,p.current=w.nativeEvent,document.addEventListener(`${y}up`,b,{passive:!1}),document.addEventListener(`${y}move`,B,{passive:!1}),document.addEventListener("keydown",O,{passive:!1}),document.addEventListener("keyup",T,{passive:!1}),window.addEventListener("blur",j,{passive:!0}),r&&i&&(document.addEventListener("touchstart",g,{passive:!1,capture:!0}),document.addEventListener("touchmove",g,{passive:!1,capture:!0})),l.current=!0,C(a)))},[a,r])}const On=({initValue:o,useHookBody:e,applyStateChange:t})=>{const n=u.useRef(o);if(typeof e!="function")throw new Error("function expected as hook body parameter. got "+typeof e);const r=e();return u.useLayoutEffect(()=>{n.current!==r&&(n.current=r,t(r))},[t,r]),null},ft=o=>{console&&console.warn&&console.warn(o)},at=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||void 0;let In=1,pt=!1,Jt=!1;const Ge=[],xe=[],Je=()=>{xe.forEach(o=>o())},$n=({automaticContainerInternalUseOnly:o})=>{const[e,t]=u.useState([]),n=u.useRef([]);return n.current=e,o||pt!==!1||(Jt=!0),u.useEffect(()=>{let r=!0;function i(){if(r)return xe[0]!==i?(o||pt!==!0||ft("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."),void t(c=>[])):void t([...Ge])}return xe.push(i),Je(),()=>{r=!1,n.current?.length>0&&ft("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"),xe.splice(xe.indexOf(i),1),Je()}},[o]),E.jsx(E.Fragment,{children:e.map(({hook:r,key:i})=>u.createElement(On,{...r,key:i}))})},Nn=o=>{const e=In++;return Ge.push({hook:o,key:e}),xe.length===0&&Jt===!1&&(pt=!0,(t=>{if(at.document&&at.document.createElement){const n=at.document.createElement("div");gn.createRoot(n).render(E.jsx(t,{automaticContainerInternalUseOnly:!0}))}else ft("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.")})($n)),Je(),()=>{Ge.splice(Ge.findIndex(t=>t.key===e),1),Je()}};let mt=null;mt||(mt=(o,e,t={})=>{let n,r,i=!1,c=!1,d=[],{unmountIfNoConsumers:s=!1}=t;const l=h=>{var f;r=h,f=()=>d.forEach(p=>p(h)),Nt.unstable_batchedUpdates(f)},a=()=>(c||(r=typeof o=="function"?o():o,c=!0),r);return()=>{const[h,f]=u.useState(a);return u.useEffect(()=>(i||(i=!0,n=Nn({initValue:o,useHookBody:e,applyStateChange:l})),d.push(f),r!==h&&f(r),()=>{d.splice(d.indexOf(f),1),d.length===0&&s&&(n(),i=!1)}),[]),h}});const Qt=mt;let en=()=>{console.warn("You must call useEditMode before setting its state.")};const Kn=Qt(null,()=>{const[o,e]=u.useState(null);return en=e,o}),Et=Qt({setClipboard:o=>{throw new Error("This is only available via the useClipboard.")},getClipboard:()=>$.InternalClipboard.Global,refNativeCopy:{current:null},refNativeLastKey:{current:null}},()=>{const[o,e]=u.useState($.InternalClipboard.Global);return{setClipboard:t=>e(t),getClipboard:()=>o,refNativeCopy:u.useRef(null),refNativeLastKey:u.useRef(null)}});let ct=!1,Hn=0;var Wn=typeof document<"u"?u.useLayoutEffect:u.useEffect;const Ct=()=>"sheetxl-ui-"+Hn++,Mt=u.useId,Fn=Mt??function(){const[o,e]=u.useState(()=>ct?Ct():void 0);return Wn(()=>{o==null&&e(Ct())},[]),u.useEffect(()=>{ct||(ct=!0)},[]),o},Un=[];function et(o,e,t=Un){const n=u.useRef(null);return u.useImperativeHandle(o,()=>{if(!n.current)return;const r=n.current,i=e?.();if(!i||typeof i!="object")throw new Error("attributes must return a plain object of values");const c=Object.keys(i),d=c.length;for(let s=0;s<d;s++){const l=c[s],a=i[l];Object.defineProperty(r,l,{value:a,writable:!0,configurable:!0,enumerable:!0})}return r},t),n}const Lt="Undo the last action.",Tt="Repeat the last action or undo the redo.",Vn=o=>`Redo ${o}`;class Xn extends u.Component{static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){this.props.onError?.(e)}render(){return this.props.children}}class Yn{constructor(e){this.notifier=e,this.handleUnhandledRejection=t=>{const n=t.reason;n instanceof DOMException&&n.name==="AbortError"||this.notifier.showError(n)},this.handleGlobalError=t=>{this.notifier.showError(t.error)},this.setupGlobalHandlers()}setupGlobalHandlers(){window.addEventListener("unhandledrejection",this.handleUnhandledRejection),window.addEventListener("error",this.handleGlobalError)}cleanup(){window.removeEventListener("unhandledrejection",this.handleUnhandledRejection),window.removeEventListener("error",this.handleGlobalError)}}function tn(o){var e,t,n="";if(typeof o=="string"||typeof o=="number")n+=o;else if(typeof o=="object")if(Array.isArray(o)){var r=o.length;for(e=0;e<r;e++)o[e]&&(t=tn(o[e]))&&(n&&(n+=" "),n+=t)}else for(t in o)o[t]&&(n&&(n+=" "),n+=t);return n}function X(){for(var o,e,t=0,n="",r=arguments.length;t<r;t++)(o=arguments[t])&&(e=tn(o))&&(n&&(n+=" "),n+=e);return n}const qn={},nn=o=>{const{onPointerDown:e,style:t,splitDirection:n,paddingBefore:r=0,paddingAfter:i=0,disabled:c,key:d,propsHitArea:s=qn,...l}=o,a=n==="row",{style:h,className:f,...p}=s;return E.jsx("div",{style:{...t,position:"relative"},...l,children:E.jsx("div",{className:X("hit-box",f),style:{left:(a?-r:0)+"px",width:`calc(100% + ${a?r+i:0}px)`,top:(a?0:-r)+"px",height:`calc(100% + ${a?0:r+i}px)`,position:"absolute",...h},onPointerDown:c?void 0:e,...p})},d)},Ve={},fe=(o,e,t=!0)=>o===null?null:o.pixels!==null?t?o.pixels:e-o.pixels:(t?o.percent:100-o.percent)/100*e,Xe=(o,e=!0)=>o?.percent?`${e?o.percent:100-o.percent}%`:o?.pixels?`${o.pixels}px`:void 0,se=(o,e)=>{if(o==null)return null;const t={percent:null,pixels:null};let n=e;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)},on=u.memo(u.forwardRef((o,e)=>{const{elementBefore:t,elementAfter:n,splitDirection:r="row",fixedPane:i=null,position:c,onPositionChange:d,minBefore:s,maxBefore:l,minAfter:a,maxAfter:h,children:f,className:p,style:_,disabled:m=!1,onDragStart:S,onDragResize:C,onDragFinish:y,propsResizer:g=Ve,propsPane:b=Ve,propsPaneBefore:j=Ve,propsPaneAfter:M=Ve,renderResizer:B=nn}=o;if(f)throw new Error("Use elementBefore and elementAfter instead of children.");const O=u.useMemo(()=>u.isValidElement(n)&&u.isValidElement(t),[n,t]),T=u.useMemo(()=>{let R=null;i&&(i==="before"?R=0:i==="after"&&(R=1));const F=R===null;return{fixedPaneOffset:R,isPercent:F,minBefore:se(s,F),maxBefore:se(l,F),minAfter:se(a,F),maxAfter:se(h,F)}},[s,l,a,h]),w=D(d,[d]),[k,L]=u.useState(()=>se(c,i===null));u.useEffect(()=>{L(se(c,i===null))},[c,i]);const[I,{width:P,height:v}]=me(),[A,{width:K,height:U}]=me(),z=r==="row"?K:U,W=r==="row"?P:v,H=u.useMemo(()=>((R,F,Q,G)=>{const re=[null,null],oe=[null,null];if(R||(R={percent:G.fixedPaneOffset===null?50:null,pixels:G.fixedPaneOffset===null?null:0}),F===0)return R?.pixels!=null?G.fixedPaneOffset!==1?(re[0]=R?.pixels,oe[1]=100):(re[1]=R?.pixels-Q,oe[0]=100):R?.percent!=null&&(G.fixedPaneOffset!==1?(oe[0]=R?.percent,oe[1]=100-R?.percent):(oe[1]=R?.percent,oe[0]=100-R?.percent)),{percents:oe,pixels:re,minBefore:Xe(G.minBefore,!0),maxBefore:Xe(G.maxBefore,!0),minAfter:Xe(G.minAfter),maxAfter:Xe(G.maxAfter)};let ie=fe(R,F,G.fixedPaneOffset!==1),te=F-Q,yt=fe(G.minBefore,te,!0)??0,mn=fe(G.maxBefore,te,!0)??te,He=0,it=0,vt=0,bt=te;He=(fe(G.maxAfter,F,!1)??Q)-Q,it=fe(G.minAfter,F,!1)??F,vt=Math.max(yt,He),bt=Math.min(mn,it),ie=Math.max(vt,Math.min(ie,bt)),it=Math.min(te-ie,fe(G.maxAfter,te-ie,!0)??te),He=Math.min(te-ie,fe(G.minAfter,te-ie,!0)??te),re[0]=ie,re[1]=te-re[0];const _n=Math.max(0,Math.min(100,ie/te*100));return oe[0]=_n,oe[1]=100-oe[0],{percents:oe,pixels:re,minBefore:`${yt}px`,minAfter:`${He}px`,maxBefore:`${re[0]}px`,maxAfter:`${re[1]}px`}})(k,W,z,T),[T,k,W,z,r]),[V,J]=u.useState(!1),_e=D(S,[S]),ce=D(C,[C]),ge=D(y,[y]),ue=u.useRef(null),tt=u.useRef(null),De=u.useRef(null),{style:nt,className:ze,...Ae}=b,Re={minWidth:0,minHeight:0,maxWidth:"100%",maxHeight:"100%",height:"100%",widthResizer:"100%",display:"flex",overflow:"hidden",position:"relative",...nt},{className:ot,style:je,...Be}=j,{className:Oe,style:Ie,...ye}=M,Ce={flex:"1 1 100%",width:"100%",..._,flexDirection:r,display:"flex"},{className:ne,style:ve,onPointerDown:$e,...Ne}=g,Me=D(R=>{const F=se(R,i===null);L(F)},[i]),x=D(R=>{if(m||!V)return;const F=he.current?.getBoundingClientRect();let Q=0;Q=r==="row"?(R.clientX??R.touches?.[0]?.clientX)-F.x:(R.clientY??R.touches?.[0]?.clientY)-F.y,Q=Math.max(0,Math.min(W,Q)),T.fixedPaneOffset===1&&(Q=W-Q),c&&k.pixels===Q||L({pixels:Q,percent:null}),ce?.(Q),R.stopPropagation(),R.preventDefault()},[T,r,m,V,k,W]),N=D(R=>{if(document.removeEventListener("pointermove",x),document.removeEventListener("touchmove",x),document.removeEventListener("pointerup",N),!!V&&(J(!1),!!k)){if(ge(k.pixels),!se(c,i===null)||k.pixels!==c){const F={...k};F.percent===null&&(F.percent=F.pixels/W*100),w(F)}R.stopPropagation(),R.preventDefault()}},[k,V,c,i,W]),q=D(R=>{$e?.(R),R.defaultPrevented||m||V||(J(!0),_e(),document.addEventListener("pointermove",x,{passive:!1}),document.addEventListener("touchmove",x,{passive:!1}),document.addEventListener("pointerup",N,{passive:!1}))},[$e]),he=et(e,()=>({setPosition:Me,isSplitPane:()=>!0}),[]),be=u.useMemo(()=>O?B?.({key:"resizer",ref:Ee([A,tt]),className:X("resizer",ne),onPointerDownCapture:q,style:{cursor:m?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,...ve},splitDirection:r,disabled:m,...Ne}):null,[O,ne,Ne,r,ve,m]),de=r==="row"?"Width":"Height",rt=u.useMemo(()=>{if(!t)return null;const R={...Re,...je,flex:T.fixedPaneOffset===0&&H?.pixels[0]!==null?`0 0 ${Math.round(H?.pixels[0])}px`:`1 1 ${Math.round(H?.percents[0]??100)}%`,[`min${de}`]:H?.minBefore,[`max${de}`]:n?H?.maxBefore:"100%"};return E.jsx("div",{ref:ue,className:X("before",ze,ot),style:R,...Ae,...Be,children:t},"before")},[t,b,j,T,H]),Ke=u.useMemo(()=>{if(!n)return null;const R={...Re,...Ie,flex:T.fixedPaneOffset===1&&H?.pixels[1]!==null?`0 0 ${Math.round(H?.pixels[1])}px`:`1 1 ${Math.round(H?.percents[1]??100)}%`,[`min${de}`]:H?.minAfter,[`max${de}`]:t?H?.maxAfter:"100%"};return E.jsx("div",{ref:De,className:X("after",ze,Oe),style:R,...Ae,...ye,children:n},"after")},[n,b,M,T,H]);return E.jsxs("div",{ref:Ee([I,he]),className:X("splitPane",r==="row"?"vertical":"horizontal",{dragging:V},p),style:Ce,children:[rt,be,Ke]})}));function Gn(o){if(typeof o=="function")return o;if(typeof o=="string"){const e=o.trim();if(e.startsWith("data:image/svg+xml")){const t=(function(n){const r=/^data:image\/svg\+xml(;[^,]*)?,(.*)$/i.exec(n.trim());if(!r)return null;const i=r[1]||"",c=r[2]||"";try{if(/;base64/i.test(i)){if(typeof atob<"u"){const d=atob(c),s=d.length;if(typeof TextDecoder<"u"){const a=new Uint8Array(s);for(let h=0;h<s;h++)a[h]=d.charCodeAt(h);return new TextDecoder("utf-8").decode(a)}let l="";for(let a=0;a<s;a++)l+=`%${d.charCodeAt(a).toString(16).padStart(2,"0")}`;return decodeURIComponent(l)}return(globalThis.Buffer?globalThis.Buffer.from(c,"base64"):require("buffer").Buffer.from(c,"base64")).toString("utf-8")}try{return decodeURIComponent(c)}catch{return c}}catch{return null}})(e);if(t)return Dt(t)}if(e.startsWith("<")){if(/^<\s*svg\b/i.test(e))return Dt(e);if(/^<\s*path\b/i.test(e)){const t=kt(e);if(t)return{paths:[{d:t}]}}return{paths:[{d:e}]}}return{paths:[{d:e}]}}if(Array.isArray(o)){const e=[];for(const t of o)if(typeof t=="string"){const n=String(t).trim();if(n.startsWith("<path")){const r=kt(n);r&&e.push({d:r})}else e.push({d:n})}else t&&typeof t=="object"&&"d"in t&&typeof t.d=="string"&&e.push({...t});return{paths:e}}return o}function kt(o){const e=/\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(o);return e?e[1]??e[2]??null:null}function Pt(o){if("svg"in o)return{...o,svg:Gn(o.svg)};if("url"in o){const e=typeof o.url=="string"?{src:o.url}:o.url;return{...o,url:e}}if("emoji"in o){const e=typeof o.emoji=="string"?o.emoji:o.emoji.text;return{...o,emoji:e}}return o}function Dt(o){try{if(typeof DOMParser<"u"){const c=new DOMParser().parseFromString(o,"image/svg+xml"),d=c.querySelector("svg"),s=d?.getAttribute("viewBox")??void 0,l=[];return c.querySelectorAll("path").forEach(a=>{const h=a.getAttribute("d");if(!h)return;const f={d:h},p=a.getAttribute("class");p&&(f.className=p);const _=a.getAttribute("fill");_&&_!=="none"&&(f.fill=_);const m=a.getAttribute("stroke");m&&(f.stroke=m);const S=a.getAttribute("opacity");S&&(f.opacity=Number(S));const C=a.getAttribute("fill-rule");C&&(f.fillRule=C);const y=a.getAttribute("clip-rule");y&&(f.clipRule=y),l.push(f)}),{viewBox:s,paths:l}}}catch{}const e=o.match(/viewBox="([^"]+)"/i),t=e?e[1]:void 0,n=[],r=/<path\b[^>]*\sd="([^"]+)"[^>]*>/gi;let i;for(;i=r.exec(o);)n.push({d:i[1]});return{viewBox:t,paths:n}}function zt(o){const e={};for(const[i,c]of Object.entries(o.icons))e[i]=Pt(c);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??[]};t.extends.includes("base")||t.extends.push("base");const n={meta:t,icons:e},r=o.overrides;if(r){const i={};for(const[c,d]of Object.entries(r)){const s={};for(const[l,a]of Object.entries(d))s[l]=Pt(a);i[c]=s}n.__overrides=i}return n}function rn(){const o=new Map,e=new Map;let t="base",n=new Map;async function r(s){const l=o.get(s??t);if(!l)throw new Error(`Icon pack not registered: ${s}`);if(!l.pack){if(!l.loading){if(!l.loader)throw new Error(`No loader for icon pack: ${s}`);l.loading=l.loader().then(a=>{const h=a&&typeof a=="object"&&"default"in a?a.default:a;l.pack=zt(h)}).catch(a=>{throw l.loading=void 0,a})}await l.loading}}function i(s){const l=s.indexOf(":");return l>0?{ns:s.slice(0,l),key:s.slice(l+1)}:{key:s}}function c(s,l){const a=[s,...o.get(s)?.pack?.meta.extends??[]];for(const h of a){const f=o.get(h);if(!f?.pack)continue;const{icons:p}=f.pack,_=p[e.get(h)?.get(l)??l]??p[l];if(_)return{glyph:_,pack:f.pack,packKey:h}}return null}function d(s,l){const a=l?.packKey??t;if(l?.packKey)return c(l.packKey,s);if(!s)return null;const{ns:h,key:f}=i(s);if(h){const p=o.get(h)?.pack;if(p){if(o.get(t)?.pack){const m=p.__overrides,S=m?.[t]?.[f];if(S)return{glyph:S,pack:p,packKey:h}}const _=c(h,f);if(_)return _}return null}return c(a,s)}return{register:function(s,l){const a=o.get(s)??{};typeof l=="function"?a.loader=l:a.pack=zt(l),o.set(s,a),t||(t=s)},prefetch:async function(s=t){const l=Array.isArray(s)?s:[s];await Promise.all(l.map(r))},setActive:function(s){t=s;for(const l of n.keys())try{l(s)}catch{}},getActive:function(){return t},resolve:async function(s,l){let a=d(s,l);if(a)return a;const h=l?.packKey??t,{ns:f}=i(s);if(l?.packKey){if(await r(h),a=d(s,l),a)return a;const p=o.get(h)?.pack?.meta?.extends??[];if(p.length&&(await Promise.all(p.map(r)),a=d(s,l),a))return a}else if(f){if(await r(f),a=d(s,l),a)return a;const p=o.get(f)?.pack?.meta?.extends??[];if(p.length&&(await Promise.all(p.map(r)),a=d(s,l),a))return a}else{if(await r(h),a=d(s,l),a)return a;const p=o.get(h)?.pack?.meta?.extends??[];if(p.length&&(await Promise.all(p.map(r)),a=d(s,l),a))return a}return null},registerAlias:function(s,l,a){e.has(s)||e.set(s,new Map),e.get(s).set(l,a)},has:function(s,l){return!!d(s,l)},getPack:function(s){return o.get(s??t)?.pack},hasPack:function(s){return!!o.get(s)?.pack},listPacks:function(){return Array.from(o.keys())},listIcons:function(s){const l=o.get(s)?.pack;return l?Object.keys(l.icons):[]},addActiveListener:function(s){const l=n.get(s);if(l)return l;const a=()=>{n.delete(s)};return n.set(s,a),a}}}on.displayName="SplitPane";const ke=rn();ke.register("base",()=>Promise.resolve().then(()=>require("./9KKOlESwiTD1ICGm.cjs")));const At=o=>E.jsx("svg",{...o,children:E.jsx("path",{})}),Zn={Icon:"_Icon_17dpm_10"},Rt=u.memo(o=>{const{iconKey:e,packKey:t,className:n,style:r,role:i,title:c,size:d,ariaHidden:s,propsSource:l,children:a,...h}=o,[f,p]=u.useState(null);u.useEffect(()=>{let L=!0,I=t,P=e;if(!P){const v=ke.getPack(I);return void p({glyph:v?{svg:$.CommonUtils.EmptyArray}:void 0,pack:v??void 0,packKey:I??ke.getActive()})}if(P.includes(":")){const[v,A]=P.split(":");I=v,P=A}return ke.resolve(P,{packKey:I}).then(v=>{L&&p(v)}),()=>{L=!1}},[e,t]);const _=f?.pack,m=f?.glyph,S=f?.packKey;let C=m?m.svg:void 0;const y=m&&!C?m.url:void 0,g=!m||C||y?void 0:m.emoji,b=d!=null?typeof d=="number"?`${d}px`:d:void 0,j=u.useMemo(()=>[Zn.Icon,"icon",n].filter(Boolean).join(" "),[n]),M=u.useMemo(()=>{const L={...r};return L["--icon-size"]=b,L},[r,b]),B=i??(c?"img":"presentation"),O=s??(!c||void 0),T=L=>E.jsx("span",{className:j,style:M,role:B,"aria-hidden":O,title:c,"data-icon-glyph":e,"data-icon-pack":S,...h,children:L});if(a)return T(a);if(g)return T(E.jsx("span",{children:typeof g=="string"?g:g.text}));if(y)return T(E.jsx("img",{src:y.src,alt:c??""}));if(m&&"react"in m){const L=m.react,I={className:j,style:M,role:B,"aria-hidden":O,title:c,...h,...l};return T(E.jsx(L,{...I}))}const w={viewBox:C?.viewBox??_?.meta.defaultViewBox??"0 0 24 24"};if(typeof C=="function")return T(C(w)??E.jsx(At,{...w}));if(!C)return T(E.jsx(At,{...w}));const k=C.paths;return T(E.jsx("svg",{...w,children:k?k.map((L,I)=>E.jsx("path",{d:L.d,className:L.className,fill:L.fill,stroke:L.stroke,opacity:L.opacity,fillRule:L.fillRule,clipRule:L.clipRule},I)):null}))});class Ze{constructor(){this.store=new Map}async getItem(e){return this.store.get(e)??null}async setItem(e,t){this.store.set(e,t)}async removeItem(e){this.store.delete(e)}}const jt=u.createContext(null),sn={parse:o=>o?JSON.parse(o):null,stringify:JSON.stringify},Jn={store:new Ze,namespace:"",serializer:sn,debounceMs:0,crossTabSync:!1,notify:()=>{},subscribeKey:()=>()=>{}},Qn={},eo={parse:o=>o==null?null:JSON.parse(o),stringify:JSON.stringify},Z={Horizontal:"horizontal",Vertical:"vertical"},pe={scrollbar:"_scrollbar_gqxsx_24",track:"_track_gqxsx_35",thumb:"_thumb_gqxsx_47","scrollbar-button":"_scrollbar-button_gqxsx_89","touch-thumb":"_touch-thumb_gqxsx_124"},ln="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",an="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",to={transform:"rotate(180deg)"},cn=o=>{const{style:e,orientation:t=Z.Vertical,disabled:n,...r}=o,i=t===Z.Vertical?ln:an;return E.jsx("button",{style:e,className:X(pe["scrollbar-button"],t,"scroll-button"),disabled:n,...r,children:E.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",children:E.jsx("path",{d:i})})})},un=o=>{const{style:e,orientation:t=Z.Vertical,disabled:n,...r}=o,i=t===Z.Vertical?ln:an;return E.jsx("button",{style:e,className:X(pe["scrollbar-button"],t,"scroll-button"),disabled:n,...r,children:E.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",style:to,children:E.jsx("path",{d:i})})})},no=Pe().supportsTouchEvents,hn=u.memo(u.forwardRef((o,e)=>{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:c=22,style:d,className:s,onPointerDown:l,onPointerMove:a,onPointerUp:h,orientation:f=Z.Vertical,offset:p=0,currentTouchAnchor:_,elementParent:m,elementRoot:S,key:C,...y}=o;if(!no)return null;const g=D(l,[l]),b=D(a,[a]),j=D(h,[h]),M=f===Z.Vertical,[B,O]=u.useState(!1),T=dt(u.useMemo(()=>({processTouch:!0,consumeTouch:!0,onPointerDown:(z,W)=>{O(!0),g?.(z),z.preventDefault(),z.stopPropagation()},onPointerMoveOrWait:(z,W,H)=>{b?.(z)},onPointerUp:(z,W,H)=>{O(!1),j?.(H),z.preventDefault(),z.stopPropagation()}}),[])),w=u.useMemo(()=>{const z=c/2+i/2+6;return{x:M?-z:p+c,y:M?p+c:-z,width:0,height:0}},[M,p,c]),[k,{y:L,x:I}]=Gt(),P=u.useRef(null),{getPortalContainer:v,isFullscreen:A}=Zt(),[K,U]=u.useState(null);return u.useEffect(()=>{const z=P.current?.getBoundingClientRect();if(!z)return void U(null);let W=0,H=0,V=m;for(;V;)W+=V.scrollLeft,H+=V.scrollTop,V=S&&V===S.parentElement?null:V.parentElement;U(Nt.createPortal(E.jsx("div",{className:X("touch-thumb",pe["touch-thumb"],s,pe,{dragging:B}),ref:e,style:{left:W+(z?.x??0)-(c+i)/2,top:H+(z?.y??0)-(c+i)/2,width:M?c:1.8*c,height:M?1.8*c:c,borderWidth:`${i}px`,boxShadow:B?`${n} 0px 0px 0px 1.5px`:void 0,borderStyle:"solid",borderColor:t,backgroundColor:n,opacity:_?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",...d},tabIndex:-1,onPointerDown:T,...y}),S??v(),C))},[L,B,t,n,r,I,w?.x,w?.y,w?.width,w?.height,s,_,n,c,i,t,m,A,C]),w?E.jsxs(E.Fragment,{children:[E.jsx("div",{ref:Ee([k,P]),style:{position:"absolute",left:w.x,top:w.y,opacity:0}}),K]}):null}));hn.displayName="TouchThumbHandle";const oo=24,dn=u.memo(u.forwardRef((o,e)=>{const{offset:t=0,totalSize:n=0,viewportSize:r=0,style:i,className:c,orientation:d=Z.Vertical,onScrollOffset:s,onScroll:l,showCustomScrollButtons:a,scrollButtonIncrement:h=200,scrollButtonInitialRepeatDelay:f=260,scrollButtonAdditionalRepeatDelay:p=120,minThumbSize:_=oo,maxThumbSize:m,renderScrollButtonStart:S=cn,renderScrollButtonEnd:C=un,propsTouchThumb:y,propsThumb:g,onMouseDown:b,...j}=o,M=Pe().primaryInput==="touch",B=a??!M;D(l,[l]);const[O,T]=u.useState({offset:0,length:0,disabled:!1}),w=u.useRef(-1),k=d===Z.Vertical,[L,{width:I,height:P}]=me(),v=k?P:I,A=D((x,N,q)=>{if(N===0||q===0){const Ke={offset:0,length:_,disabled:!0};return T(Ke),Ke}if(N>=q)return{offset:0,length:v,disabled:!0};const he=q/v,be=N/he,de=Math.min(Math.max(_,be),Math.min(v,m??Number.MAX_SAFE_INTEGER)),rt=x/he;return{offset:Math.min(Math.max(0,rt),v-de),length:de,disabled:!1}},[v,_,m]),K=D(x=>{const N=n/v,q=Math.round(x*N);T(A(q,r,n)),s?.(q,r,n),w.current=x},[s,r,n,v,O]),U=D(x=>{T(A(x,r,n)),s?.(x,r,n),w.current=x},[s,r,n]);u.useEffect(()=>{w.current!==t&&v!==0&&(w.current=-1,T(A(t,r,n)))},[t]),u.useEffect(()=>{v!==0&&T(A(t,r,n))},[r,n,k,v]);const z=Math.max(0,n-r),[W,H]=u.useState(!1),V=u.useRef(0),J=u.useRef(0),_e=et(e,()=>({isScrollbar:()=>!0}),[]),ce=D(x=>{H(!0),V.current=k?x.clientY:x.clientX,J.current=O.offset},[k,O]),ge=D(x=>{x.currentTarget.setPointerCapture(x.pointerId),ce(x),x.stopPropagation()},[b]),ue=D(x=>{if(!W)return;const N=(k?x.clientY:x.clientX)-V.current,q=J.current+N;K(q)},[W,k]),tt=D(x=>{ue(x)},[]),De=D(x=>{H(!1)},[]),nt=D(x=>{try{x.currentTarget.releasePointerCapture(x.pointerId)}catch{}De(x)},[]),ze=D(x=>{if(!x.currentTarget)return;const N=x.currentTarget.getBoundingClientRect(),q=k?x.clientY-N.top:x.clientX-N.left;K(q)},[k,O,r,n]),Ae=D(x=>{const N=Math.max(1,Math.floor(.9*r));k?(x.key==="ArrowDown"&&K(Math.min(z,t+1)),x.key==="ArrowUp"&&K(Math.max(0,t-1)),x.key==="PageDown"&&K(Math.min(z,t+N)),x.key==="PageUp"&&K(Math.max(0,t-N)),x.key==="Home"&&K(0),x.key==="End"&&K(z)):(x.key==="ArrowRight"&&K(Math.min(z,t+1)),x.key==="ArrowLeft"&&K(Math.max(0,t-1)),x.key==="PageDown"&&K(Math.min(z,t+N)),x.key==="PageUp"&&K(Math.max(0,t-N)),x.key==="Home"&&K(0),x.key==="End"&&K(z))},[k,r,n,t,z]),Re=u.useRef(null),ot=u.useMemo(()=>{const x=O.disabled;if(x)return null;const N=E.jsx("div",{...g,className:X(pe.thumb,{disabled:x}),ref:Re,role:"slider","aria-label":k?"Rows":"Columns","aria-orientation":k?"vertical":"horizontal","aria-valuemin":0,"aria-valuemax":z,"aria-valuenow":t,tabIndex:0,style:{...g?.style,position:"relative",[k?"height":"width"]:`${O.length}px`,[k?"width":"height"]:"100%",transform:k?`translateY(${O.offset}px)`:`translateX(${O.offset}px)`,[k?"minHeight":"minWidth"]:`${_}px`},onMouseDown:b,onPointerDown:ge,onPointerMove:tt,onPointerUp:nt});return!M||x?N:E.jsxs(E.Fragment,{children:[N,E.jsx(hn,{...y,offset:O.offset,orientation:k?Z.Vertical:Z.Horizontal,onPointerDown:ce,onPointerMove:ue,onPointerUp:De})]})},[O,_,z,t,k,M,b,y,g]),[je,Be]=u.useState(null),Oe=D(()=>{let x;x=typeof h=="function"?h(t,r,n):t-h;const N=Math.max(0,x);return U(N),Be(N),N},[h,t,r,n]),Ie=D(()=>{let x;x=typeof h=="function"?h(t,r,n):t+h;const N=Math.min(z,x);return U(N),Be(N),N},[h,t,z,r,n]),ye=u.useRef(null),Ce=u.useRef(null),ne=u.useCallback(()=>{ye.current&&(clearTimeout(ye.current),ye.current=null,Ce.current=null)},[]),ve=u.useCallback((x,N,q,he=f)=>{Ce.current=x,ye.current=setTimeout(()=>{const be=q?Oe():Ie();be!==Ce.current?ve(be,!1,q,p):ne()},N?0:he)},[Oe,Ie,ne]);u.useEffect(()=>()=>ne(),[ne]);const $e=u.useMemo(()=>{if(!B)return null;const x={orientation:d,disabled:t<=0,onMouseUp:ne,onMouseLeave:ne,onMouseDown:()=>ve(t,!0,!0)};return S?.(x)},[B,d,t,je]),Ne=u.useMemo(()=>{if(!B)return null;const x={orientation:d,disabled:t>=z,onMouseUp:ne,onMouseLeave:ne,onMouseDown:()=>ve(t,!0,!1)};return C?.(x)},[B,d,t,z,je]),Me=k?"vertical":"horizontal";return E.jsxs("div",{ref:Ee([_e,e]),className:X(c,pe.scrollbar,Me,{dragging:W,"has-touch-thumb":M}),style:i,...j,children:[$e,E.jsx("div",{ref:L,role:"scrollbar","aria-orientation":Me,"aria-valuemin":0,"aria-valuemax":z,"aria-valuenow":t,tabIndex:0,className:X(pe.track,"track",Me),onMouseDown:b,onPointerDown:ze,onKeyDown:Ae,children:ot}),Ne]})}));let Bt=Date.now,Ot=1e3,ae={},ro=1;const Te=o=>{let e=ae[o]!==null;return e&&(ae[o]=null),e},It=(o,e,t,n=0,r)=>{let i=Bt(),c=i,d=0,s=0,l=0,a=ro++;if(a%20==0){const f={};for(let p in ae)f[p]=!0;ae=f}const h=function(f){let p=f!==!0,_=Bt(),m=!0;try{m=(!e||e(a))??!0}catch{m=!1}if(!ae[a]||!m)return ae[a]=null,void t?.(60-s/((_-i)/Ot),a,!1);if(p){l=Math.round((_-c)/16.666666666666668)-1;for(let y=0;y<Math.min(l,4);y++)h(!0),s++}n&&(d=(_-i)/n,d>1&&(d=1));let S=r?r(d):d,C=!1;try{C=o(S,_,p)}catch{C=!1}C!==!1&&d!==1||!p?p&&(c=_,requestAnimationFrame(h)):(ae[a]=null,t?.(60-s/((_-i)/Ot),a,d===1||n==null))};return ae[a]=!0,requestAnimationFrame(h),a},io=function(o){return Math.pow(o-1,3)+1},so=function(o){return(o/=.5)<1?.5*Math.pow(o,3):.5*(Math.pow(o-2,3)+2)};class lo{constructor(e,t){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:.5,maxZoom:3,speedMultiplier:1,scrollingComplete:void 0,penetrationDeceleration:.03,penetrationAcceleration:.08,...t}}setDimensions(e,t,n,r){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)}setPosition(e,t){this.__clientLeft=e||0,this.__clientTop=t||0}setSnapSize(e,t){this.__snapWidth=e,this.__snapHeight=t}getValues(){return{left:this.__scrollLeft,top:this.__scrollTop,right:this.__scrollLeft+this.__clientWidth/this.__zoomLevel,bottom:this.__scrollTop+this.__clientHeight/this.__zoomLevel,zoom:this.__zoomLevel}}getPoint(e,t){const n=this.getValues();return{left:e/n.zoom,top:t/n.zoom}}getScrollMax(){return{left:this.__maxScrollLeft,top:this.__maxScrollTop}}zoomTo(e,t=!1,n,r,i){if(!this.options.zooming)throw new Error("Zooming is not enabled!");i&&(this.__zoomComplete=i),this.__isDecelerating&&(Te(this.__isDecelerating),this.__isDecelerating=0);const c=this.__zoomLevel;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);const d=e/c;let s=d*(this.__scrollLeft+n)-n,l=d*(this.__scrollTop+r)-r;s>this.__maxScrollLeft?s=this.__maxScrollLeft:s<0&&(s=0),l>this.__maxScrollTop?l=this.__maxScrollTop:l<0&&(l=0),this.__publish(s,l,e,t)}zoomBy(e,t=!1,n=0,r=0,i){this.zoomTo(this.__zoomLevel*e,t,n,r,i)}scrollTo(e,t,n=!1,r=1){if(this.__isDecelerating&&(Te(this.__isDecelerating),this.__isDecelerating=0),r!==void 0&&r!==this.__zoomLevel){if(!this.options.zooming)throw new Error("Zooming is not enabled!");e*=r,t*=r,this.__computeScrollMax(r)}else r=this.__zoomLevel;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)}scrollBy(e=0,t=0,n=!1){const r=this.__isAnimating?this.__scheduledLeft:this.__scrollLeft,i=this.__isAnimating?this.__scheduledTop:this.__scrollTop;this.scrollTo(r+(e||0),i+(t||0),n)}doMouseZoom(e,t,n,r){const i=e>0?.97:1.03;return this.zoomTo(this.__zoomLevel*i,!1,n-this.__clientLeft,r-this.__clientTop)}doTouchStart(e,t){if(e.length===void 0)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),typeof t!="number")throw new Error("Invalid timestamp value: "+t);let n,r;this.__interruptedAnimation=!0,this.__isDecelerating&&(Te(this.__isDecelerating),this.__isDecelerating=0,this.__interruptedAnimation=!0),this.__isAnimating&&(Te(this.__isAnimating),this.__isAnimating=0,this.__interruptedAnimation=!0);let i=e.length===1;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=[]}doTouchMove(e,t,n=1){if(e.length===void 0)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),typeof t!="number")throw new Error("Invalid timestamp value: "+t);if(!this.__isTracking)return;let r,i;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);let c=this.__positions;if(this.__isDragging){let d=r-this.__lastTouchLeft,s=i-this.__lastTouchTop,l=this.__scrollLeft,a=this.__scrollTop,h=this.__zoomLevel;if(n!==void 0&&this.options.zooming){let f=h;if(h=h/this.__lastScale*n,h=Math.max(Math.min(h,this.options.maxZoom),this.options.minZoom),f!==h){let p=r-this.__clientLeft,_=i-this.__clientTop;l=(p+l)*h/f-p,a=(_+a)*h/f-_,this.__computeScrollMax(h)}}if(this.__enableScrollX){l-=d*this.options.speedMultiplier;let f=this.__maxScrollLeft;(l>f||l<0)&&(this.options.bouncing?l+=d/2*this.options.speedMultiplier:l=l>f?f:0)}if(this.__enableScrollY){a-=s*this.options.speedMultiplier;const f=this.__maxScrollTop;(a>f||a<0)&&(this.options.bouncing?a+=s/2*this.options.speedMultiplier:a=a>f?f:0)}c.length>60&&c.splice(0,30),c.push(l,a,t),this.__publish(l,a,h)}else{let d=this.options.locking?3:0,s=5,l=Math.abs(r-this.__initialTouchLeft),a=Math.abs(i-this.__initialTouchTop);this.__enableScrollX=this.options.scrollingX&&l>=d,this.__enableScrollY=this.options.scrollingY&&a>=d,c.push(this.__scrollLeft,this.__scrollTop,t),this.__isDragging=(this.__enableScrollX||this.__enableScrollY)&&(l>=s||a>=s),this.__isDragging&&(this.__interruptedAnimation=!1)}this.__lastTouchLeft=r,this.__lastTouchTop=i,this.__lastTouchMove=t,this.__lastScale=n}doTouchEnd(e){if(e instanceof Date&&(e=e.valueOf()),typeof e!="number")throw new Error("Invalid timestamp value: "+e);if(this.__isTracking){if(this.__isTracking=!1,this.__isDragging)if(this.__isDragging=!1,this.__isSingleTouch&&this.options.animating&&e-this.__lastTouchMove<=100){let t=this.__positions,n=t.length-1,r=n;for(let i=n;i>0&&t[i]>this.__lastTouchMove-100;i-=3)r=i;if(r!==n){const i=t[n]-t[r],c=this.__scrollLeft-t[r-2],d=this.__scrollTop-t[r-1];this.__decelerationVelocityX=c/i*(1e3/60),this.__decelerationVelocityY=d/i*(1e3/60);const s=this.options.paging||this.options.snapping?4:1;(Math.abs(this.__decelerationVelocityX)>s||Math.abs(this.__decelerationVelocityY)>s)&&this.__startDeceleration(e)}else this.options.scrollingComplete?.()}else e-this.__lastTouchMove>100&&this.options.scrollingComplete?.();this.__isDecelerating||((this.__interruptedAnimation||this.__isDragging)&&this.options.scrollingComplete?.(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0,this.__zoomLevel)),this.__positions.length=0}}__publish(e,t,n,r=!1){const i=this.__isAnimating;if(i&&(Te(i),this.__isAnimating=0),r&&this.options.animating){this.__scheduledLeft=e,this.__scheduledTop=t,this.__scheduledZoom=n;const c=this.__scrollLeft,d=this.__scrollTop,s=this.__zoomLevel,l=e-c,a=t-d,h=n-s,f=function(m,S,C){C&&(this.__scrollLeft=c+l*m,this.__scrollTop=d+a*m,this.__zoomLevel=s+h*m,this.__callback&&this.__callback(this.__scrollLeft,this.__scrollTop,this.__zoomLevel))}.bind(this),p=function(m){return this.__isAnimating===m}.bind(this),_=function(m,S,C){S===this.__isAnimating&&(this.__isAnimating=!1),(this.__didDecelerationComplete||C)&&this.options.scrollingComplete?.(),this.options.zooming&&(this.__computeScrollMax(),this.__zoomComplete&&(this.__zoomComplete(),this.__zoomComplete=null))}.bind(this);this.__isAnimating=It(f,p,_,this.options.animationDuration,i?io:so)}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))}__computeScrollMax(e=this.__zoomLevel){this.__maxScrollLeft=Math.max(this.__contentWidth*e-this.__clientWidth,0),this.__maxScrollTop=Math.max(this.__contentHeight*e-this.__clientHeight,0)}__startDeceleration(e){if(this.options.paging){const c=Math.max(Math.min(this.__scrollLeft,this.__maxScrollLeft),0),d=Math.max(Math.min(this.__scrollTop,this.__maxScrollTop),0),s=this.__clientWidth,l=this.__clientHeight;this.__minDecelerationScrollLeft=Math.floor(c/s)*s,this.__minDecelerationScrollTop=Math.floor(d/l)*l,this.__maxDecelerationScrollLeft=Math.ceil(c/s)*s,this.__maxDecelerationScrollTop=Math.ceil(d/l)*l}else this.__minDecelerationScrollLeft=0,this.__minDecelerationScrollTop=0,this.__maxDecelerationScrollLeft=this.__maxScrollLeft,this.__maxDecelerationScrollTop=this.__maxScrollTop;const t=function(c,d,s){this.__stepThroughDeceleration(s)}.bind(this),n=this.options.snapping?4:.1,r=function(){const c=Math.abs(this.__decelerationVelocityX)>=n||Math.abs(this.__decelerationVelocityY)>=n;return c||(this.__didDecelerationComplete=!0),c}.bind(this),i=function(c,d,s){this.__isDecelerating=0,this.__didDecelerationComplete&&this.options.scrollingComplete?.(),this.scrollTo(this.__scrollLeft,this.__scrollTop,this.options.snapping)}.bind(this);this.__isDecelerating=It(t,r,i)}__stepThroughDeceleration(e){let t=this.__scrollLeft+this.__decelerationVelocityX,n=this.__scrollTop+this.__decelerationVelocityY;if(!this.options.bouncing){const r=Math.max(Math.min(this.__maxDecelerationScrollLeft,t),this.__minDecelerationScrollLeft);r!==t&&(t=r,this.__decelerationVelocityX=0);const i=Math.max(Math.min(this.__maxDecelerationScrollTop,n),this.__minDecelerationScrollTop);i!==n&&(n=i,this.__decelerationVelocityY=0)}if(e?this.__publish(t,n,this.__zoomLevel):(this.__scrollLeft=t,this.__scrollTop=n),!this.options.paging&&(this.__decelerationVelocityX*=.95,this.__decelerationVelocityY*=.95),this.options.bouncing){let r=0,i=0,c=this.options.penetrationDeceleration,d=this.options.penetrationAcceleration;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*c:this.__decelerationVelocityX=r*d),i!==0&&(i*this.__decelerationVelocityY<=0?this.__decelerationVelocityY+=i*c:this.__decelerationVelocityY=i*d)}}}const Qe=o=>E.jsx(dn,{...o}),ao=Object.freeze(Object.defineProperty({__proto__:null,defaultRenderScrollbar:Qe,getScrollTo:(o,e,t,n,r=0)=>{for(let i=0;i<t.length;i++){const c=t[i].getBoundingClientRect();let d=c.left-e,s=d+c.width;if(n){if(d<o&&s>=o)return d}else if(Math.ceil(s)>Math.ceil(o)+2)return s}return r}},Symbol.toStringTag,{value:"Module"})),le={scrollpane:"_scrollpane_1fbi8_2","vertical-container":"_vertical-container_1fbi8_7","horizontal-corner-container":"_horizontal-corner-container_1fbi8_12","scrollbar-sizer":"_scrollbar-sizer_1fbi8_26","scrollpane-content":"_scrollpane-content_1fbi8_34","scrollpane-content-element":"_scrollpane-content-element_1fbi8_43"},fn=o=>{const e=o?.width,t=o?.height;return E.jsx("div",{className:"corner",style:{minWidth:`${e}px`,width:`${e}px`,minHeight:`${t}px`,height:`${t}px`}})},pn=u.memo(u.forwardRef((o,e)=>{const{children:t,viewport:n,onScrollViewport:r,showHorizontalScrollbar:i=!0,showVerticalScrollbar:c=!0,createScrollCorner:d=fn,renderScrollbarHorizontal:s=Qe,renderScrollbarVertical:l=Qe,style:a,className:h,touchElement:f,disableTouch:p,..._}=o,m=i&&s,S=c&&l,C=D(r,[r]),y=et(e,()=>({isScrollPane:()=>!0}),[]),g=u.useRef(null);u.useEffect(()=>{g.current&&(g.current.__scrollTop===n?.top&&g.current.__scrollLeft===n?.left||g.current.__isDecelerating||g.current?.scrollTo(n?.left,n?.top,!1))},[n?.left,n?.top,f]);const b=u.useCallback((v,A)=>{C?.({left:v,top:A})},[]),j=u.useCallback(v=>{g.current?.doTouchStart(v.touches,v.timeStamp)},[]),M=u.useCallback(v=>{v.preventDefault(),g.current?.doTouchMove(v.touches,v.timeStamp)},[]),B=u.useCallback(v=>{g.current?.doTouchEnd(v.timeStamp)},[]),O=u.useCallback(({containerWidth:v,containerHeight:A,totalWidth:K,totalHeight:U})=>{g.current.setDimensions(v,A,K,U)},[]);u.useEffect(()=>{const v=f??y.current;if(!p&&Pe().supportsTouchEvents&&v&&n){if(!g.current){const A={scrollingX:!0,scrollingY:!0,decelerationRate:.95,penetrationAcceleration:.08};g.current=new lo(b,A)}Pe().supportsTouchEvents&&(v.addEventListener("touchstart",j),v.addEventListener("touchend",B),v.addEventListener("touchmove",M)),O({containerWidth:n?.width,containerHeight:n?.height,totalWidth:n?.totalWidth,totalHeight:n?.totalHeight})}return()=>{v?.removeEventListener("touchstart",j),v?.removeEventListener("touchend",B),v?.removeEventListener("touchmove",M)}},[n?.width,n?.height,n?.totalWidth,n?.totalHeight,p,f]);const[T,{width:w}]=me(),[k,{height:L}]=me(),I=u.useMemo(()=>{if(!S)return null;const v=l({orientation:Z.Vertical,offset:n?.top,viewportSize:n?.height,totalSize:n?.totalHeight,onScrollOffset:A=>{C?.({top:A})}});return E.jsx("div",{className:X("vertical-container",le["vertical-container"]),ref:T,children:v})},[l,n?.top,n?.height,n?.totalHeight]),P=u.useMemo(()=>{if(!m)return null;const v=s({orientation:Z.Horizontal,offset:n?.left,viewportSize:n?.width,totalSize:n?.totalWidth,onScrollOffset:A=>{C?.({left:A})}});return E.jsxs("div",{className:X("horizontal-corner-container",le["horizontal-corner-container"]),children:[E.jsx("div",{className:X("horizontal-sizer",le["horizontal-sizer"]),style:{width:`calc(100% - ${w}px)`},children:E.jsx("div",{ref:k,className:X("scrollbar-sizer",le["scrollbar-sizer"]),children:v})}),S?d({width:w,height:L}):E.jsx(E.Fragment,{})]})},[s,n?.left,n?.width,n?.totalWidth,S,d,w,L]);return E.jsx("div",{className:X(h,"scrollpane",le.scrollpane),style:{minWidth:S?`${w}px`:void 0,minHeight:m?`${L}px`:void 0,...a},..._,ref:y,children:E.jsxs("div",{className:X("scrollpane-content",le["scrollpane-content"]),children:[E.jsxs("div",{className:X("scrollpane-content-element",le["scrollpane-content-element"]),children:[E.jsx("div",{className:X("scrollpane-content-element",le["scrollpane-content-element"]),children:t}),S?I:E.jsx(E.Fragment,{})]}),m?P:E.jsx(E.Fragment,{})]})})}));pn.displayName="ScrollPane";const co=300,uo=100,ho=1e6,fo=100,po=50,$t=u.memo(u.forwardRef((o,e)=>{const{offset:t=0,viewportSize:n=0,totalSize:r=0,minSize:i=0,endGap:c=co,endScrollIncrement:d=uo,style:s=Ut,onMouseDown:l,onScrollOffset:a,onScroll:h,scaleLimit:f=ho,scaleFactor:p=fo,precisionFactor:_=po,renderScrollbar:m=Qe,...S}=o;h&&console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");const C=D(l,[l]),[y,g]=u.useState(!1),b=u.useMemo(()=>{const T=f===0?r:Math.min(r??0,Math.max(i??0,(t??0)+(n??0))+(c??0)),w=f!==0&&T>f?p:1,k=w/_,L=Math.ceil(T/w);return{offset:Math.ceil(t/w),totalSize:L,viewportSize:Math.ceil(n/w),scaledOffset:t,scaledTotalSize:r,scaledViewportSize:n,factor:w,precision:k}},[t,r,n,y,i,c,d]),j=D((T,w,k)=>{const L=b.offset;Math.abs(T-L)<b.precision&&(T=L),a?.(T*b.factor,L,b.viewportSize)},[a,b]),M=u.useCallback(T=>{},[]),B=u.useCallback(T=>{document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",B),g(!1)},[]),O=u.useCallback(T=>{g(!0),C?.(T),document.addEventListener("mousemove",M,{passive:!0}),document.addEventListener("mouseup",B,{passive:!0})},[M,B]);return m({style:s,...S,offset:b.offset,totalSize:b.totalSize,viewportSize:b.viewportSize,onMouseDown:O,onScrollOffset:j,ref:e})}));$t.displayName="VirtualScrollbar",exports.Command=Ye,exports.CommandButtonType={Toolbar:"toolbar",Menuitem:"menuitem"},exports.CommandGroup=gt,exports.DefaultDynamicIconService=ke,exports.DefaultReactNotifier=Yt,exports.DynamicIcon=Rt,exports.ErrorTestPanel=()=>null,exports.FocusKeyNavigation=kn,exports.HorizontalAlignment={General:"general",Left:"left",Right:"right",Center:"center",Justify:"justify",Fill:"fill",Distributed:"distributed",CenterContinuous:"centerContinuous"},exports.InMemoryStore=Ze,exports.KeyCodes={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,Composition:229},exports.KeyModifiers=Y,exports.LocalStorageStore=class{constructor(o=window.localStorage){this.storage=o}async getItem(o){try{return this.storage.getItem(o)}catch{return null}}async setItem(o,e){try{this.storage.setItem(o,e)}catch{}}async removeItem(o){try{this.storage.removeItem(o)}catch{}}subscribe(o){const e=t=>{t.storageArea===this.storage&&t.key&&o(t.key)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}},exports.MouseButtonCodes={Left:1,Middle:2,Right:3},exports.NotifierProvider=({children:o,notifier:e})=>(u.useEffect(()=>{const t=$.Notifier.getOverrides();return $.Notifier.setOverrides(e),()=>{$.Notifier.setOverrides(t)}},[e]),u.createElement(qt.Provider,{value:e},o)),exports.NotifierType=ht,exports.PersistenceStateProvider=function(o){const{store:e,namespace:t="",serializer:n=eo,debounceMs:r=0,crossTabSync:i=!0,children:c}=o,d=u.useMemo(()=>typeof window>"u"?new Ze:e??new Ze,[e]),s=u.useRef(new Map),l=u.useMemo(()=>({store:d,namespace:t,serializer:n,debounceMs:r,crossTabSync:i,notify(a){const h=s.current.get(a);h&&h.forEach(f=>f())},subscribeKey(a,h){const f=s.current,p=f.get(a)??new Set;return p.add(h),f.set(a,p),()=>{const _=f.get(a);_&&(_.delete(h),_.size===0&&f.delete(a))}}}),[d,t,n,r,i]);return u.useEffect(()=>{if(l.crossTabSync&&l.store.subscribe)return l.store.subscribe(a=>{if(!a.startsWith(l.namespace+":"))return;const h=a.slice(l.namespace.length+1);l.notify(h)})},[l]),E.jsx(jt.Provider,{value:l,children:c})},exports.ReactErrorBoundary=({children:o})=>{const e=Le(),t=u.useCallback(n=>{e.showError(n)},[e]);return E.jsx(Xn,{onError:t,children:o})},exports.ReactUtils=Mn,exports.RoundedTab=zn,exports.ScrollPane=pn,exports.ScrollUtils=ao,exports.Scrollbar=dn,exports.ScrollbarOrientation=Z,exports.SimpleCommand=We,exports.SplitPane=on,exports.SplitPaneResizer=nn,exports.ToolTipPlacement={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"},exports.UncaughtErrorBoundary=({children:o})=>{const e=Le();return u.useEffect(()=>{const t=new Yn(e);return()=>{t.cleanup()}},[e]),E.jsx(E.Fragment,{children:o})},exports.VirtualScrollbar=$t,exports.WalkingIcon=function(o){const{isWalking:e=!1,themedType:t="info",speed:n=120,dashGap:r=3,dashLength:i=5,iconKey:c,packKey:d,style:s,className:l,...a}=o,h=u.useMemo(()=>{if(!e)return;const p={"--walk-duration":`${n*(r+i)}ms`,"--walk-dash-length":`${i}px`,"--walk-dash-gap":`${r}px`};return t&&t!=="accent"&&(p["--icon-accent"]=`var(--icon-${t})`),p},[e,n,r,i,t]),f=u.useMemo(()=>e?l+" walking":l,[e,l]);return E.jsx(Rt,{iconKey:c,packKey:d,className:f,style:{...s,...h},...a})},exports.createDynamicIconService=rn,exports.defaultCreateScrollCorner=fn,exports.defaultCreateScrollEdgeButton=o=>{const{style:e,orientation:t=Z.Vertical,...n}=o,r=t===Z.Vertical,i=r?"rotate(90) ":"";return E.jsx("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:E.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",transform:i,children:E.jsx("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"})})})},exports.defaultCreateScrollEndButton=un,exports.defaultCreateScrollStartButton=cn,exports.getDevicePixelRatio=function(o){if(typeof window>"u")return 1;const{defaultDpr:e=1,maxDpr:t=3,round:n=!0}=o||{},r=typeof window<"u"&&typeof window.devicePixelRatio=="number"?window.devicePixelRatio:e;return Math.min(Math.max(1,n?Math.floor(r):r),t)},exports.toShortcutString=we,exports.useAnimatedMeasure=Gt,exports.useCallbackRef=D,exports.useCommand=function(o,e=null){const t=u.useRef(e);t.current=e;const[n,r]=u.useReducer(c=>c+1,0),i=u.useMemo(()=>Array.isArray(o)?o:[o],[o]);return u.useEffect(()=>{const c=i?i.length:0;if(c===0)return;const d=(a,h)=>{t.current?.onChange?.(h),r()};let s=null;e&&(s={onExecute(a,h){t.current?.onExecute?.(a,h)},onError(a,h,f){t.current?.onError?.(a,h,f)}});const l=new Set;for(let a=0;a<c;a++){const h=i[a];h&&(l.add(h.addPropertyListener($.CommonUtils.debounce(d,0),!0)),e&&l.add(h.addExecuteListener(s)))}return()=>{l.forEach(a=>{a?.()})}},[o]),n},exports.useCommands=function(o,e=null,t=null,n){const r=u.useRef(t);r.current=t,e&&!Array.isArray(e)&&(e=[e]);const[i,c]=u.useState(Fe(o,e)),d=n?[...n,o]:[o];return u.useEffect(()=>{const s={onGroupChange:()=>{const f=Fe(o,e);c(f),r.current?.onChange?.(this)}};let l;e&&e.length>0&&(l={keys:e},s.onCommandChange=(f,p)=>{r.current?.onChange?.(o),c(Fe(o,e))});const a=o?.addListener(s,l),h=Fe(o,e);return c(h),r.current?.onChange&&r.current?.onChange(o),()=>{a?.()}},d),i},exports.useCopyPaste=o=>{const{source:e,target:t,onPaste:n,onClipboardUpdate:r,commands:i}=o,c=Le(),d=D(r,[r]),s=D(n,[n]),{getClipboard:l,refNativeCopy:a}=Et(),h=l();u.useMemo(()=>{const y=e?.element,g=t?.element??e?.element;if(!i)return;const b=[new We("cut",y,{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:[Y.Ctrl]}}),new We("copy",y,{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:[Y.Ctrl]}}),new We("paste",g,{label:"Paste",description:"Add content on the clipboard to your document.",icon:"paste.yellow",shortcut:[{key:"V",modifiers:[Y.Ctrl]},{key:"F8",modifiers:[Y.Ctrl]}]})];i?.addCommands(b,!0)},[i]);const f=D(async y=>{if(!e?.element)return;let g=null;try{g=e.doCopy?.(y),typeof g=="string"?await h.writeText(g):await h.writeReference(g)}catch(b){throw b}},[e,c]),p=D(async y=>{const g=e?.element?.();if(g){a.current={sourceElement:g,args:y};try{await f(y)}catch(b){c.showError?.(b)}}},[e?.element,c]),_=u.useCallback(()=>{p({isCut:!0})},[]),m=D(async(y,g,b)=>{try{if(await y.doPaste(g,b)===!1)return;s?.(g,b)}catch(j){c.showError?.(j)}},[s]),S=D(async(y,g,b)=>{const j=t?.element?.();if(j&&await $.CommonUtils.whenFocus(j),!y&&!g)return;const M=await c.showBusy?.("Pasting...");if(g)try{return await m(t,g,b),void M?.()}catch(T){M?.(),c.showError?.(T)}let B,O=t.importFromExternal;O||(O=(T,w)=>({getItemType:()=>"text",toText:()=>y.text,isClipboardItem:!0}));try{B=await O(y,{isCut:!1})}catch(T){M?.(),c.showError?.(T)}if(B)try{const T=await Promise.resolve(B);await m(t,T,b),M?.()}catch(T){M?.(),c.showError?.(T)}else M?.()},[m,t,c]),C=D(async y=>{if(t?.element)try{const g=await h.readReference();if(g)return void await S(null,g,y);const b=[];b[0]=await $.ClipboardUtils.readStringFromClipboard(h,$.MimeType.plain),b[1]=await $.ClipboardUtils.readHTMLFromClipboard(h,$.MimeType.html),b[2]=await $.ClipboardUtils.readBlobFromClipboard(h,$.MimeType.png);const j={text:b[0]??null,html:b[1]??null,image:b[2]??null};await S(j,null,y)}catch(g){if(g?.message==="Document is not focused.")return;c.showError?.(g)}},[S,t?.element,c]);return D(async y=>{},[e?.element]),D(async y=>{},[t?.element,S,c]),u.useEffect(()=>{if(!h)return;const y=async j=>{const M=await h.readReference();d?.(M)},g=j=>{c.showMessage?.($.InternalClipboard.ErrorMessages.PermsRead,{onceKey:"clipboard.features"})},b=j=>{c.showMessage?.($.InternalClipboard.ErrorMessages.PermsWrite,{onceKey:"clipboard.features"})};return h.addEventListener("clipboardchange",y),h.addEventListener("clipboarderrorread",g),h.addEventListener("clipboarderrorwrite",b),()=>{h.removeEventListener("clipboardchange",y),h.removeEventListener("clipboarderrorread",g),h.removeEventListener("clipboarderrorwrite",b)}},[h,c]),u.useEffect(()=>{},[f,S,e,t]),u.useEffect(()=>{i?.getCommand("cut")?.updateCallback(_).update({disabled:!e||!t}),i?.getCommand("copy")?.updateCallback(p).update({disabled:!e}),i?.getCommand("paste")?.updateCallback(C).update({disabled:!t})},[e,t,i]),{paste:C,copy:p,clipboard:h}},exports.useDevicePixelRatio=function(o){const[e,t]=u.useState(typeof window<"u"?window.devicePixelRatio:1),n=u.useRef(null);return u.useEffect(()=>{if(!(typeof window<"u"&&"matchMedia"in window))return;const r=()=>{const i=window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);i.addEventListener("change",r,{once:!0,passive:!0}),t(window.devicePixelRatio),n.current={mediaMatcher:i,listener:r}};return r(),()=>{n.current&&n.current.mediaMatcher.removeEventListener("change",n.current.listener)}},[o]),e},exports.useEditMode=()=>{const o=Kn();return u.useMemo(()=>({setMode:e=>{en(t=>(typeof e=="function"&&(e=e(t)),e?.onModeChange?.(e??null),e))},getMode:()=>o}),[o])},exports.useFullscreenPortal=Zt,exports.useGlobalClipboard=Et,exports.useId=Fn,exports.useImperativeElement=et,exports.useMouseDownAndHoldListener=function(o,e){return dt({onPointerDown:o,onPointerMoveOrWait:(t,n,r)=>{o?.(r)},...e})},exports.useNotifier=Le,exports.useOnClickOrFocusAway=function(o,e,t){const n=D(e,[e]);u.useEffect(()=>{const r=i=>{o.current&&!o.current.contains(i.target)&&n(i)};return t&&t.mouseEvents===!1||(document.addEventListener("mousedown",r),document.addEventListener("touchstart",r)),t&&t.focusEvents===!1||document.addEventListener("focus",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r),document.removeEventListener("focus",r)}},[o])},exports.usePersistenceState=function(o,e,t=Qn){const{store:n,namespace:r,serializer:i,debounceMs:c,subscribeKey:d}=u.useContext(jt)||Jn,s=t.serializer??i??sn,l=u.useMemo(()=>`${r}:${o}`,[r,o]),a=u.useRef(null),h=`${l}::v`,[f,p]=u.useState(()=>{let m;try{if(typeof window<"u"&&"localStorage"in window&&l.startsWith(r)){const S=window.localStorage?.getItem(l)??null;S!=null&&(m=s.parse(S))}}catch{}if(m===void 0){const S=e;return typeof S=="function"?S():S}return m});u.useEffect(()=>{let m=!0;return(async()=>{const[S,C]=await Promise.all([n.getItem(l),n.getItem(h)]);let y;try{y=S==null?void 0:s.parse(S)}catch{}const g=C==null?void 0:Number.parseInt(C,10);y===void 0?!t.lazy&&e!==void 0&&(y=typeof e=="function"?e():e,await n.setItem(l,s.stringify(y)),t.version!=null&&await n.setItem(h,String(t.version))):t.version!=null&&g!==void 0&&g!==t.version&&t.migrate&&(y=t.migrate(y,g),await n.setItem(l,s.stringify(y)),await n.setItem(h,String(t.version))),m&&y!==void 0&&p(y)})(),()=>{m=!1}},[n,l,h,t.version,t.migrate,t.lazy]),u.useEffect(()=>d(o,async()=>{const m=await n.getItem(l);if(m!=null)try{p(s.parse(m))}catch{}}),[n,l,d,o]);const _=async m=>{await n.setItem(l,s.stringify(m)),t.version!=null&&await n.setItem(h,String(t.version))};return[f,m=>{p(S=>{const C=typeof m=="function"?m(S):m;return a.current&&clearTimeout(a.current),c>0?a.current=setTimeout(()=>{_(C)},c):_(C),C})},()=>{if(a.current&&clearTimeout(a.current),n.removeItem(l),n.removeItem(h),e!==void 0){const m=typeof e=="function"?e():e;p(m)}else p(void 0)}]},exports.useSynchronizedPointerHandler=dt,exports.useTraceUpdate=function(o,e=!0){const t=u.useRef(o);u.useEffect(()=>{if(e){const n=Object.entries(o).reduce((r,[i,c])=>(t.current[i]!==c&&(r[i]=[t.current[i],c]),r),{});Object.keys(n).length>0&&console.log("Changed props:",n)}t.current=o})},exports.useUndoManager=({manager:o,commands:e,disabled:t})=>{const n=Le(),r=D(c=>{try{o?.undo(c)}catch(d){n.error(d)}},[o]),i=D(c=>{try{o?.redo(c)}catch(d){n.error(d)}},[o]);return u.useMemo(()=>{if(!e)return;const c={contains:s=>!0,focus(){}},d=[new Ye("undo",c,{label:"Undo",description:Lt,shortcut:{key:"z",modifiers:[Y.Ctrl]},disabled:!0},r),new Ye("redo",c,{label:"Redo",description:Tt,shortcut:[{key:"y",modifiers:[Y.Ctrl]},{key:"F4"},{key:"Enter",modifiers:[Y.Alt]}],disabled:!0},i)];e?.addCommands(d,!0)},[e]),u.useEffect(()=>{if(!e)return;const c=()=>{const s=o?.getTopUndoDescription(),l={};var a;e.getCommand("undo").update({disabled:t||!o||!o.hasUndo(),description:s?(a=s,`Undo ${a}`):Lt,state:l,context:{undoManager:o}});const h=o?.getTopRedoDescription();e.getCommand("redo").update({disabled:t||!o||!o.hasRedo(),description:h?Vn(h):Tt,state:l,context:{undoManager:o}})};if(c(),!o)return;const d=o.addListener({onStackChange(){c()}});return()=>d?.()},[o,e,t]),{undo:r,redo:i}};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as m, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { WalkingIcon as a } from "./index.mjs";
|
|
3
3
|
/**
|
|
4
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
4
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.25
|
|
5
5
|
*
|
|
6
6
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
7
7
|
* License: The license can be found at https://www.sheetxl.com/license.
|
package/browser/esm/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { jsx as P, jsxs as fe, Fragment as me } from "react/jsx-runtime";
|
|
|
5
5
|
import { createRoot as En } from "react-dom/client";
|
|
6
6
|
import { unstable_batchedUpdates as Ln, 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.25
|
|
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.
|
|
@@ -1217,7 +1217,7 @@ function lo() {
|
|
|
1217
1217
|
}
|
|
1218
1218
|
io.displayName = "SplitPane";
|
|
1219
1219
|
const ot = lo();
|
|
1220
|
-
ot.register("base", () => import("./
|
|
1220
|
+
ot.register("base", () => import("./D7SQx0X3SaYbQ8_r.mjs"));
|
|
1221
1221
|
const Ft = (o) => P("svg", { ...o, children: P("path", {}) }), ao = { Icon: "_Icon_17dpm_10" }, co = _e((o) => {
|
|
1222
1222
|
const { iconKey: e, packKey: t, className: n, style: r, role: i, title: c, size: h, ariaHidden: s, propsSource: l, children: a, ...u } = o, [d, p] = ae.useState(null);
|
|
1223
1223
|
ae.useEffect(() => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
2
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.25
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
package/node/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
2
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.25
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1169,7 +1169,7 @@ function de() {
|
|
|
1169
1169
|
}
|
|
1170
1170
|
se.displayName = "SplitPane";
|
|
1171
1171
|
const pe = de();
|
|
1172
|
-
pe.register("base", () => import("./
|
|
1172
|
+
pe.register("base", () => import("./CZ8VXxBwgT4_x2I0.mjs"));
|
|
1173
1173
|
const me = (t2) => x("svg", { ...t2, children: x("path", {}) }), fe = { Icon: "_Icon_17dpm_10" }, _e = s((e2) => {
|
|
1174
1174
|
const { iconKey: n2, packKey: r2, className: i2, style: s2, role: l2, title: a2, size: c2, ariaHidden: h2, propsSource: u2, children: d2, ...p2 } = e2, [m2, _2] = t.useState(null);
|
|
1175
1175
|
t.useEffect(() => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/utils-react",
|
|
3
3
|
"description": "Utils React - Utilities for React capabilities needed for all SheetXL components.",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.25",
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"react"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@sheetxl/utils": "^0.7.
|
|
43
|
+
"@sheetxl/utils": "^0.7.25",
|
|
44
44
|
"clsx": "^2.1.1",
|
|
45
45
|
"detect-it": "^4.0.1",
|
|
46
46
|
"react-merge-refs": "^3.0.2",
|