nexus-shell 0.1.0 → 0.1.1
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/dist/core/registry/ComponentRegistry.d.ts +20 -0
- package/dist/index.d.ts +1 -0
- package/dist/nexus-shell.es.js +288 -259
- package/dist/nexus-shell.umd.js +37 -37
- package/package.json +1 -1
package/dist/nexus-shell.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(ne,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],A):(ne=typeof globalThis<"u"?globalThis:ne||self,A(ne.NexusShell={},ne.React,ne.ReactDOM))})(this,function(ne,A,At){"use strict";var
|
|
1
|
+
(function(ne,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],A):(ne=typeof globalThis<"u"?globalThis:ne||self,A(ne.NexusShell={},ne.React,ne.ReactDOM))})(this,function(ne,A,At){"use strict";var ju=Object.defineProperty;var Hu=(ne,A,At)=>A in ne?ju(ne,A,{enumerable:!0,configurable:!0,writable:!0,value:At}):ne[A]=At;var mn=(ne,A,At)=>Hu(ne,typeof A!="symbol"?A+"":A,At);var qn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ga(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Bo={exports:{}},_n={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Xi;function
|
|
9
|
+
*/var Xi;function pa(){if(Xi)return _n;Xi=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(o,i,r){var s=null;if(r!==void 0&&(s=""+r),i.key!==void 0&&(s=""+i.key),"key"in i){r={};for(var a in i)a!=="key"&&(r[a]=i[a])}else r=i;return i=r.ref,{$$typeof:n,type:o,key:s,ref:i!==void 0?i:null,props:r}}return _n.Fragment=e,_n.jsx=t,_n.jsxs=t,_n}var bn={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,44 +14,44 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Gi;function
|
|
17
|
+
*/var Gi;function ma(){return Gi||(Gi=1,process.env.NODE_ENV!=="production"&&function(){function n(N){if(N==null)return null;if(typeof N=="function")return N.$$typeof===L?null:N.displayName||N.name||null;if(typeof N=="string")return N;switch(N){case u:return"Fragment";case _:return"Profiler";case p:return"StrictMode";case E:return"Suspense";case T:return"SuspenseList";case O:return"Activity"}if(typeof N=="object")switch(typeof N.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),N.$$typeof){case g:return"Portal";case S:return N.displayName||"Context";case v:return(N._context.displayName||"Context")+".Consumer";case x:var W=N.render;return N=N.displayName,N||(N=W.displayName||W.name||"",N=N!==""?"ForwardRef("+N+")":"ForwardRef"),N;case w:return W=N.displayName||null,W!==null?W:n(N.type)||"Memo";case C:W=N._payload,N=N._init;try{return n(N(W))}catch{}}return null}function e(N){return""+N}function t(N){try{e(N);var W=!1}catch{W=!0}if(W){W=console;var oe=W.error,he=typeof Symbol=="function"&&Symbol.toStringTag&&N[Symbol.toStringTag]||N.constructor.name||"Object";return oe.call(W,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",he),e(N)}}function o(N){if(N===u)return"<>";if(typeof N=="object"&&N!==null&&N.$$typeof===C)return"<...>";try{var W=n(N);return W?"<"+W+">":"<...>"}catch{return"<...>"}}function i(){var N=R.A;return N===null?null:N.getOwner()}function r(){return Error("react-stack-top-frame")}function s(N){if(F.call(N,"key")){var W=Object.getOwnPropertyDescriptor(N,"key").get;if(W&&W.isReactWarning)return!1}return N.key!==void 0}function a(N,W){function oe(){Y||(Y=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",W))}oe.isReactWarning=!0,Object.defineProperty(N,"key",{get:oe,configurable:!0})}function c(){var N=n(this.type);return j[N]||(j[N]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),N=this.props.ref,N!==void 0?N:null}function f(N,W,oe,he,$e,Je){var re=oe.ref;return N={$$typeof:l,type:N,key:W,props:oe,_owner:he},(re!==void 0?re:null)!==null?Object.defineProperty(N,"ref",{enumerable:!1,get:c}):Object.defineProperty(N,"ref",{enumerable:!1,value:null}),N._store={},Object.defineProperty(N._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(N,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(N,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:$e}),Object.defineProperty(N,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Je}),Object.freeze&&(Object.freeze(N.props),Object.freeze(N)),N}function m(N,W,oe,he,$e,Je){var re=W.children;if(re!==void 0)if(he)if(k(re)){for(he=0;he<re.length;he++)h(re[he]);Object.freeze&&Object.freeze(re)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(re);if(F.call(W,"key")){re=n(N);var M=Object.keys(W).filter(function(fe){return fe!=="key"});he=0<M.length?"{key: someKey, "+M.join(": ..., ")+": ...}":"{key: someKey}",ae[re+he]||(M=0<M.length?"{"+M.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,he,re,M,re),ae[re+he]=!0)}if(re=null,oe!==void 0&&(t(oe),re=""+oe),s(W)&&(t(W.key),re=""+W.key),"key"in W){oe={};for(var te in W)te!=="key"&&(oe[te]=W[te])}else oe=W;return re&&a(oe,typeof N=="function"?N.displayName||N.name||"Unknown":N),f(N,re,oe,i(),$e,Je)}function h(N){b(N)?N._store&&(N._store.validated=1):typeof N=="object"&&N!==null&&N.$$typeof===C&&(N._payload.status==="fulfilled"?b(N._payload.value)&&N._payload.value._store&&(N._payload.value._store.validated=1):N._store&&(N._store.validated=1))}function b(N){return typeof N=="object"&&N!==null&&N.$$typeof===l}var d=A,l=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),S=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),L=Symbol.for("react.client.reference"),R=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,k=Array.isArray,B=console.createTask?console.createTask:function(){return null};d={react_stack_bottom_frame:function(N){return N()}};var Y,j={},z=d.react_stack_bottom_frame.bind(d,r)(),V=B(o(r)),ae={};_n.Fragment=u,_n.jsx=function(N,W,oe){var he=1e4>R.recentlyCreatedOwnerStacks++;return m(N,W,oe,!1,he?Error("react-stack-top-frame"):z,he?B(o(N)):V)},_n.jsxs=function(N,W,oe){var he=1e4>R.recentlyCreatedOwnerStacks++;return m(N,W,oe,!0,he?Error("react-stack-top-frame"):z,he?B(o(N)):V)}}()),_n}process.env.NODE_ENV==="production"?Bo.exports=ga():Bo.exports=pa();var v=Bo.exports,Ot={},Kn={},rt={},Ce={};Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.Orientation=void 0;class mt{static flip(e){return e===mt.HORZ?mt.VERT:mt.HORZ}constructor(e){this._name=e}getName(){return this._name}toString(){return this._name}}Ce.Orientation=mt,mt.HORZ=new mt("horz"),mt.VERT=new mt("vert");var Me={};Object.defineProperty(Me,"__esModule",{value:!0}),Me.Rect=void 0;const ma=Ce;class rn{static empty(){return new rn(0,0,0,0)}constructor(e,t,o,i){this.x=e,this.y=t,this.width=o,this.height=i}static fromElement(e){let{x:t,y:o,width:i,height:r}=e.getBoundingClientRect();return new rn(t,o,i,r)}clone(){return new rn(this.x,this.y,this.width,this.height)}equals(e){return this.x===(e==null?void 0:e.x)&&this.y===(e==null?void 0:e.y)&&this.width===(e==null?void 0:e.width)&&this.height===(e==null?void 0:e.height)}getBottom(){return this.y+this.height}getRight(){return this.x+this.width}getCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}positionElement(e,t){this.styleWithPosition(e.style,t)}styleWithPosition(e,t="absolute"){return e.left=this.x+"px",e.top=this.y+"px",e.width=Math.max(0,this.width)+"px",e.height=Math.max(0,this.height)+"px",e.position=t,e}contains(e,t){return this.x<=e&&e<=this.getRight()&&this.y<=t&&t<=this.getBottom()}removeInsets(e){return new rn(this.x+e.left,this.y+e.top,Math.max(0,this.width-e.left-e.right),Math.max(0,this.height-e.top-e.bottom))}centerInRect(e){this.x=(e.width-this.width)/2,this.y=(e.height-this.height)/2}_getSize(e){let t=this.width;return e===ma.Orientation.VERT&&(t=this.height),t}toString(){return"(Rect: x="+this.x+", y="+this.y+", width="+this.width+", height="+this.height+")"}}Me.Rect=rn,Object.defineProperty(rt,"__esModule",{value:!0}),rt.DockLocation=void 0;const bn=Ce,et=Me;class se{static getByName(e){return se.values[e]}static getLocation(e,t,o){if(t=(t-e.x)/e.width,o=(o-e.y)/e.height,t>=.25&&t<.75&&o>=.25&&o<.75)return se.CENTER;const i=o>=t,r=o>=1-t;return i?r?se.BOTTOM:se.LEFT:r?se.RIGHT:se.TOP}constructor(e,t,o){this._name=e,this._orientation=t,this._indexPlus=o,se.values[this._name]=this}getName(){return this._name}getOrientation(){return this._orientation}getDockRect(e){return this===se.TOP?new et.Rect(e.x,e.y,e.width,e.height/2):this===se.BOTTOM?new et.Rect(e.x,e.getBottom()-e.height/2,e.width,e.height/2):this===se.LEFT?new et.Rect(e.x,e.y,e.width/2,e.height):this===se.RIGHT?new et.Rect(e.getRight()-e.width/2,e.y,e.width/2,e.height):e.clone()}split(e,t){if(this===se.TOP){const o=new et.Rect(e.x,e.y,e.width,t),i=new et.Rect(e.x,e.y+t,e.width,e.height-t);return{start:o,end:i}}else if(this===se.LEFT){const o=new et.Rect(e.x,e.y,t,e.height),i=new et.Rect(e.x+t,e.y,e.width-t,e.height);return{start:o,end:i}}if(this===se.RIGHT){const o=new et.Rect(e.getRight()-t,e.y,t,e.height),i=new et.Rect(e.x,e.y,e.width-t,e.height);return{start:o,end:i}}else{const o=new et.Rect(e.x,e.getBottom()-t,e.width,t),i=new et.Rect(e.x,e.y,e.width,e.height-t);return{start:o,end:i}}}reflect(){return this===se.TOP?se.BOTTOM:this===se.LEFT?se.RIGHT:this===se.RIGHT?se.LEFT:se.TOP}toString(){return"(DockLocation: name="+this._name+", orientation="+this._orientation+")"}}rt.DockLocation=se,se.values={},se.TOP=new se("top",bn.Orientation.VERT,0),se.BOTTOM=new se("bottom",bn.Orientation.VERT,1),se.LEFT=new se("left",bn.Orientation.HORZ,0),se.RIGHT=new se("right",bn.Orientation.HORZ,1),se.CENTER=new se("center",bn.Orientation.VERT,0);var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.DragDrop=void 0;const _a=Me,ba=!!(typeof window<"u"&&window.document&&window.document.createElement);class Mo{constructor(){this._manualGlassManagement=!1,this._startX=0,this._startY=0,this._dragDepth=0,this._glassShowing=!1,this._dragging=!1,this._active=!1,ba&&(this._glass=document.createElement("div"),this._glass.style.zIndex="998",this._glass.style.backgroundColor="transparent",this._glass.style.outline="none"),this._defaultGlassCursor="default",this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onKeyPress=this._onKeyPress.bind(this),this._onDragCancel=this._onDragCancel.bind(this),this._onDragEnter=this._onDragEnter.bind(this),this._onDragLeave=this._onDragLeave.bind(this),this.resizeGlass=this.resizeGlass.bind(this),this._lastClick=0,this._clickX=0,this._clickY=0}addGlass(e){var t;this._glassShowing?this._manualGlassManagement=!0:(this._document||(this._document=window.document),this._rootElement||(this._rootElement=this._document.body),this.resizeGlass(),(t=this._document.defaultView)===null||t===void 0||t.addEventListener("resize",this.resizeGlass),this._document.body.appendChild(this._glass),this._glass.tabIndex=-1,this._glass.focus(),this._glass.addEventListener("keydown",this._onKeyPress),this._glass.addEventListener("dragenter",this._onDragEnter,{passive:!1}),this._glass.addEventListener("dragover",this._onMouseMove,{passive:!1}),this._glass.addEventListener("dragleave",this._onDragLeave,{passive:!1}),this._glassShowing=!0,this._fDragCancel=e,this._manualGlassManagement=!1)}resizeGlass(){_a.Rect.fromElement(this._rootElement).positionElement(this._glass,"fixed")}hideGlass(){var e;this._glassShowing&&(this._document.body.removeChild(this._glass),(e=this._document.defaultView)===null||e===void 0||e.removeEventListener("resize",this.resizeGlass),this._glassShowing=!1,this._document=void 0,this._rootElement=void 0,this.setGlassCursorOverride(void 0))}_updateGlassCursor(){var e;this._glass.style.cursor=(e=this._glassCursorOverride)!==null&&e!==void 0?e:this._defaultGlassCursor}_setDefaultGlassCursor(e){this._defaultGlassCursor=e,this._updateGlassCursor()}setGlassCursorOverride(e){this._glassCursorOverride=e,this._updateGlassCursor()}startDrag(e,t,o,i,r,s,a,c,f){if(e&&this._lastEvent&&this._lastEvent.type.startsWith("touch")&&e.type.startsWith("mouse")&&e.timeStamp-this._lastEvent.timeStamp<500||this._dragging)return;this._lastEvent=e,c?this._document=c:this._document=window.document,f?this._rootElement=f:this._rootElement=this._document.body;const m=this._getLocationEvent(e);this.addGlass(r),e?(this._startX=m.clientX,this._startY=m.clientY,(!window.matchMedia||window.matchMedia("(pointer: fine)").matches)&&this._setDefaultGlassCursor(getComputedStyle(e.target).cursor),this._stopPropagation(e),this._preventDefault(e)):(this._startX=0,this._startY=0,this._setDefaultGlassCursor("default")),this._dragging=!1,this._fDragStart=t,this._fDragMove=o,this._fDragEnd=i,this._fDragCancel=r,this._fClick=s,this._fDblClick=a,this._active=!0,(e==null?void 0:e.type)==="dragenter"?(this._dragDepth=1,this._rootElement.addEventListener("dragenter",this._onDragEnter,{passive:!1}),this._rootElement.addEventListener("dragover",this._onMouseMove,{passive:!1}),this._rootElement.addEventListener("dragleave",this._onDragLeave,{passive:!1}),this._document.addEventListener("dragend",this._onDragCancel,{passive:!1}),this._document.addEventListener("drop",this._onMouseUp,{passive:!1})):(this._document.addEventListener("mouseup",this._onMouseUp,{passive:!1}),this._document.addEventListener("mousemove",this._onMouseMove,{passive:!1}),this._document.addEventListener("touchend",this._onMouseUp,{passive:!1}),this._document.addEventListener("touchmove",this._onMouseMove,{passive:!1}))}isDragging(){return this._dragging}isActive(){return this._active}toString(){return"(DragDrop: startX="+this._startX+", startY="+this._startY+", dragging="+this._dragging+")"}_onKeyPress(e){e.code==="Escape"&&this._onDragCancel()}_onDragCancel(){this._rootElement.removeEventListener("dragenter",this._onDragEnter),this._rootElement.removeEventListener("dragover",this._onMouseMove),this._rootElement.removeEventListener("dragleave",this._onDragLeave),this._document.removeEventListener("dragend",this._onDragCancel),this._document.removeEventListener("drop",this._onMouseUp),this._document.removeEventListener("mousemove",this._onMouseMove),this._document.removeEventListener("mouseup",this._onMouseUp),this._document.removeEventListener("touchend",this._onMouseUp),this._document.removeEventListener("touchmove",this._onMouseMove),this.hideGlass(),this._fDragCancel!==void 0&&this._fDragCancel(this._dragging),this._dragging=!1,this._active=!1}_getLocationEvent(e){let t=e;return e&&e.touches&&(t=e.touches[0]),t}_getLocationEventEnd(e){let t=e;return e.changedTouches&&(t=e.changedTouches[0]),t}_stopPropagation(e){e.stopPropagation&&e.stopPropagation()}_preventDefault(e){return e.preventDefault&&e.cancelable&&e.preventDefault(),e}_onMouseMove(e){this._lastEvent=e;const t=this._getLocationEvent(e);return this._stopPropagation(e),this._preventDefault(e),!this._dragging&&(Math.abs(this._startX-t.clientX)>5||Math.abs(this._startY-t.clientY)>5)&&(this._dragging=!0,this._fDragStart&&(this._setDefaultGlassCursor("move"),this._dragging=this._fDragStart({clientX:this._startX,clientY:this._startY}))),this._dragging&&this._fDragMove&&this._fDragMove(t),!1}_onMouseUp(e){this._lastEvent=e;const t=this._getLocationEventEnd(e);if(this._stopPropagation(e),this._preventDefault(e),this._active=!1,this._rootElement.removeEventListener("dragenter",this._onDragEnter),this._rootElement.removeEventListener("dragover",this._onMouseMove),this._rootElement.removeEventListener("dragleave",this._onDragLeave),this._document.removeEventListener("dragend",this._onDragCancel),this._document.removeEventListener("drop",this._onMouseUp),this._document.removeEventListener("mousemove",this._onMouseMove),this._document.removeEventListener("mouseup",this._onMouseUp),this._document.removeEventListener("touchend",this._onMouseUp),this._document.removeEventListener("touchmove",this._onMouseMove),this._manualGlassManagement||this.hideGlass(),this._dragging)this._dragging=!1,this._fDragEnd&&this._fDragEnd(e);else if(this._fDragCancel&&this._fDragCancel(this._dragging),Math.abs(this._startX-t.clientX)<=5&&Math.abs(this._startY-t.clientY)<=5){let o=!1;const i=new Date().getTime();Math.abs(this._clickX-t.clientX)<=5&&Math.abs(this._clickY-t.clientY)<=5&&i-this._lastClick<500&&this._fDblClick&&(this._fDblClick(e),o=!0),!o&&this._fClick&&this._fClick(e),this._lastClick=i,this._clickX=t.clientX,this._clickY=t.clientY}return!1}_onDragEnter(e){return this._preventDefault(e),this._stopPropagation(e),this._dragDepth++,!1}_onDragLeave(e){return this._preventDefault(e),this._stopPropagation(e),this._dragDepth--,this._dragDepth<=0&&this._onDragCancel(),!1}}Yt.DragDrop=Mo,Mo.instance=new Mo;var Ze={},Tn={};Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.Action=void 0;class Ta{constructor(e,t){this.type=e,this.data=t}}Tn.Action=Ta,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.Actions=void 0;const He=Tn;class ce{static addNode(e,t,o,i,r){return new He.Action(ce.ADD_NODE,{json:e,toNode:t,location:o.getName(),index:i,select:r})}static moveNode(e,t,o,i,r){return new He.Action(ce.MOVE_NODE,{fromNode:e,toNode:t,location:o.getName(),index:i,select:r})}static deleteTab(e){return new He.Action(ce.DELETE_TAB,{node:e})}static deleteTabset(e){return new He.Action(ce.DELETE_TABSET,{node:e})}static renameTab(e,t){return new He.Action(ce.RENAME_TAB,{node:e,text:t})}static selectTab(e){return new He.Action(ce.SELECT_TAB,{tabNode:e})}static setActiveTabset(e){return new He.Action(ce.SET_ACTIVE_TABSET,{tabsetNode:e})}static adjustSplit(e){const t=e.node1Id,o=e.node2Id;return new He.Action(ce.ADJUST_SPLIT,{node1:t,weight1:e.weight1,pixelWidth1:e.pixelWidth1,node2:o,weight2:e.weight2,pixelWidth2:e.pixelWidth2})}static adjustBorderSplit(e,t){return new He.Action(ce.ADJUST_BORDER_SPLIT,{node:e,pos:t})}static maximizeToggle(e){return new He.Action(ce.MAXIMIZE_TOGGLE,{node:e})}static updateModelAttributes(e){return new He.Action(ce.UPDATE_MODEL_ATTRIBUTES,{json:e})}static updateNodeAttributes(e,t){return new He.Action(ce.UPDATE_NODE_ATTRIBUTES,{node:e,json:t})}static floatTab(e){return new He.Action(ce.FLOAT_TAB,{node:e})}static unFloatTab(e){return new He.Action(ce.UNFLOAT_TAB,{node:e})}}Ze.Actions=ce,ce.ADD_NODE="FlexLayout_AddNode",ce.MOVE_NODE="FlexLayout_MoveNode",ce.DELETE_TAB="FlexLayout_DeleteTab",ce.DELETE_TABSET="FlexLayout_DeleteTabset",ce.RENAME_TAB="FlexLayout_RenameTab",ce.SELECT_TAB="FlexLayout_SelectTab",ce.SET_ACTIVE_TABSET="FlexLayout_SetActiveTabset",ce.ADJUST_SPLIT="FlexLayout_AdjustSplit",ce.ADJUST_BORDER_SPLIT="FlexLayout_AdjustBorderSplit",ce.MAXIMIZE_TOGGLE="FlexLayout_MaximizeToggle",ce.UPDATE_MODEL_ATTRIBUTES="FlexLayout_UpdateModelAttributes",ce.UPDATE_NODE_ATTRIBUTES="FlexLayout_UpdateNodeAttributes",ce.FLOAT_TAB="FlexLayout_FloatTab",ce.UNFLOAT_TAB="FlexLayout_UnFloatTab";var vn={},_t={};Object.defineProperty(_t,"__esModule",{value:!0}),_t.Attribute=void 0;class Qn{constructor(e,t,o,i){this.name=e,this.modelName=t,this.defaultValue=o,this.alwaysWriteJson=i,this.required=!1,this.fixed=!1,this.type="any"}setType(e){return this.type=e,this}setRequired(){return this.required=!0,this}setFixed(){return this.fixed=!0,this}}_t.Attribute=Qn,Qn.NUMBER="number",Qn.STRING="string",Qn.BOOLEAN="boolean";var bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.AttributeDefinitions=void 0;const va=_t;class ya{constructor(){this.attributes=[],this.nameToAttribute={}}addWithAll(e,t,o,i){const r=new va.Attribute(e,t,o,i);return this.attributes.push(r),this.nameToAttribute[e]=r,r}addInherited(e,t){return this.addWithAll(e,t,void 0,!1)}add(e,t,o){return this.addWithAll(e,void 0,t,o)}getAttributes(){return this.attributes}getModelName(e){const t=this.nameToAttribute[e];if(t!==void 0)return t.modelName}toJson(e,t){for(const o of this.attributes){const i=t[o.name];(o.alwaysWriteJson||i!==o.defaultValue)&&(e[o.name]=i)}}fromJson(e,t){for(const o of this.attributes){const i=e[o.name];i===void 0?t[o.name]=o.defaultValue:t[o.name]=i}}update(e,t){for(const o of this.attributes)if(e.hasOwnProperty(o.name)){const i=e[o.name];i===void 0?delete t[o.name]:t[o.name]=i}}setDefaults(e){for(const t of this.attributes)e[t.name]=t.defaultValue}toTypescriptInterface(e,t){const o=[],i=this.attributes.sort((r,s)=>r.name.localeCompare(s.name));o.push("export interface I"+e+"Attributes {");for(let r=0;r<i.length;r++){const s=i[r];let a=s.type,c,f=s,m;f.defaultValue!==void 0?c=f.defaultValue:f.modelName!==void 0&&t!==void 0&&t.nameToAttribute[f.modelName]!==void 0&&(m=f.modelName,f=t.nameToAttribute[f.modelName],c=f.defaultValue,a=f.type);let h=JSON.stringify(c);const b=f.required||f.fixed?"":"?";if(s.fixed)o.push(" "+s.name+": "+h+";");else{const d=(c!==void 0?"default: "+h:"")+(m!==void 0?" - inherited from global "+m:"");o.push(" "+s.name+b+": "+a+";"+(d.length>0?" // "+d:""))}}return o.push("}"),o.join(`
|
|
23
|
-
`)}}bt.AttributeDefinitions=ya;var Xt={};Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.DropInfo=void 0;class xa{constructor(e,t,o,i,r){this.node=e,this.rect=t,this.location=o,this.index=i,this.className=r}}Xt.DropInfo=xa;var Le={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CLASSES=void 0,function(e){e.FLEXLAYOUT__BORDER="flexlayout__border",e.FLEXLAYOUT__BORDER_="flexlayout__border_",e.FLEXLAYOUT__BORDER_BUTTON="flexlayout__border_button",e.FLEXLAYOUT__BORDER_BUTTON_="flexlayout__border_button_",e.FLEXLAYOUT__BORDER_BUTTON_CONTENT="flexlayout__border_button_content",e.FLEXLAYOUT__BORDER_BUTTON_LEADING="flexlayout__border_button_leading",e.FLEXLAYOUT__BORDER_BUTTON_TRAILING="flexlayout__border_button_trailing",e.FLEXLAYOUT__BORDER_BUTTON__SELECTED="flexlayout__border_button--selected",e.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED="flexlayout__border_button--unselected",e.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW="flexlayout__border_toolbar_button_overflow",e.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_="flexlayout__border_toolbar_button_overflow_",e.FLEXLAYOUT__BORDER_INNER="flexlayout__border_inner",e.FLEXLAYOUT__BORDER_INNER_="flexlayout__border_inner_",e.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER="flexlayout__border_inner_tab_container",e.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_="flexlayout__border_inner_tab_container_",e.FLEXLAYOUT__BORDER_TAB_DIVIDER="flexlayout__border_tab_divider",e.FLEXLAYOUT__BORDER_SIZER="flexlayout__border_sizer",e.FLEXLAYOUT__BORDER_TOOLBAR="flexlayout__border_toolbar",e.FLEXLAYOUT__BORDER_TOOLBAR_="flexlayout__border_toolbar_",e.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON="flexlayout__border_toolbar_button",e.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT="flexlayout__border_toolbar_button-float",e.FLEXLAYOUT__DRAG_RECT="flexlayout__drag_rect",e.FLEXLAYOUT__EDGE_RECT="flexlayout__edge_rect",e.FLEXLAYOUT__EDGE_RECT_TOP="flexlayout__edge_rect_top",e.FLEXLAYOUT__EDGE_RECT_LEFT="flexlayout__edge_rect_left",e.FLEXLAYOUT__EDGE_RECT_BOTTOM="flexlayout__edge_rect_bottom",e.FLEXLAYOUT__EDGE_RECT_RIGHT="flexlayout__edge_rect_right",e.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER="flexlayout__error_boundary_container",e.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT="flexlayout__error_boundary_content",e.FLEXLAYOUT__FLOATING_WINDOW_CONTENT="flexlayout__floating_window_content",e.FLEXLAYOUT__FLOATING_WINDOW_TAB="flexlayout__floating_window_tab",e.FLEXLAYOUT__LAYOUT="flexlayout__layout",e.FLEXLAYOUT__OUTLINE_RECT="flexlayout__outline_rect",e.FLEXLAYOUT__OUTLINE_RECT_EDGE="flexlayout__outline_rect_edge",e.FLEXLAYOUT__SPLITTER="flexlayout__splitter",e.FLEXLAYOUT__SPLITTER_EXTRA="flexlayout__splitter_extra",e.FLEXLAYOUT__SPLITTER_="flexlayout__splitter_",e.FLEXLAYOUT__SPLITTER_BORDER="flexlayout__splitter_border",e.FLEXLAYOUT__SPLITTER_DRAG="flexlayout__splitter_drag",e.FLEXLAYOUT__TAB="flexlayout__tab",e.FLEXLAYOUT__TABSET="flexlayout__tabset",e.FLEXLAYOUT__TABSET_HEADER="flexlayout__tabset_header",e.FLEXLAYOUT__TABSET_HEADER_SIZER="flexlayout__tabset_header_sizer",e.FLEXLAYOUT__TABSET_HEADER_CONTENT="flexlayout__tabset_header_content",e.FLEXLAYOUT__TABSET_MAXIMIZED="flexlayout__tabset-maximized",e.FLEXLAYOUT__TABSET_SELECTED="flexlayout__tabset-selected",e.FLEXLAYOUT__TABSET_SIZER="flexlayout__tabset_sizer",e.FLEXLAYOUT__TABSET_TAB_DIVIDER="flexlayout__tabset_tab_divider",e.FLEXLAYOUT__TABSET_CONTENT="flexlayout__tabset_content",e.FLEXLAYOUT__TABSET_TABBAR_INNER="flexlayout__tabset_tabbar_inner",e.FLEXLAYOUT__TABSET_TABBAR_INNER_="flexlayout__tabset_tabbar_inner_",e.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER="flexlayout__tabset_tabbar_inner_tab_container",e.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_="flexlayout__tabset_tabbar_inner_tab_container_",e.FLEXLAYOUT__TABSET_TABBAR_OUTER="flexlayout__tabset_tabbar_outer",e.FLEXLAYOUT__TABSET_TABBAR_OUTER_="flexlayout__tabset_tabbar_outer_",e.FLEXLAYOUT__TAB_BORDER="flexlayout__tab_border",e.FLEXLAYOUT__TAB_BORDER_="flexlayout__tab_border_",e.FLEXLAYOUT__TAB_BUTTON="flexlayout__tab_button",e.FLEXLAYOUT__TAB_BUTTON_STRETCH="flexlayout__tab_button_stretch",e.FLEXLAYOUT__TAB_BUTTON_CONTENT="flexlayout__tab_button_content",e.FLEXLAYOUT__TAB_BUTTON_LEADING="flexlayout__tab_button_leading",e.FLEXLAYOUT__TAB_BUTTON_OVERFLOW="flexlayout__tab_button_overflow",e.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT="flexlayout__tab_button_overflow_count",e.FLEXLAYOUT__TAB_BUTTON_TEXTBOX="flexlayout__tab_button_textbox",e.FLEXLAYOUT__TAB_BUTTON_TRAILING="flexlayout__tab_button_trailing",e.FLEXLAYOUT__TAB_BUTTON_STAMP="flexlayout__tab_button_stamp",e.FLEXLAYOUT__TAB_FLOATING="flexlayout__tab_floating",e.FLEXLAYOUT__TAB_FLOATING_INNER="flexlayout__tab_floating_inner",e.FLEXLAYOUT__TAB_TOOLBAR="flexlayout__tab_toolbar",e.FLEXLAYOUT__TAB_TOOLBAR_BUTTON="flexlayout__tab_toolbar_button",e.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_="flexlayout__tab_toolbar_button-",e.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT="flexlayout__tab_toolbar_button-float",e.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER="flexlayout__tab_toolbar_sticky_buttons_container",e.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE="flexlayout__tab_toolbar_button-close",e.FLEXLAYOUT__POPUP_MENU_CONTAINER="flexlayout__popup_menu_container",e.FLEXLAYOUT__POPUP_MENU_ITEM="flexlayout__popup_menu_item",e.FLEXLAYOUT__POPUP_MENU="flexlayout__popup_menu"}(n.CLASSES||(n.CLASSES={}))})(Le);var Tt={};Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.Node=void 0;const ko=rt,zo=Ce,Ea=Me;class Sa{constructor(e){this._dirty=!1,this._tempSize=0,this._model=e,this._attributes={},this._children=[],this._fixed=!1,this._rect=Ea.Rect.empty(),this._visible=!1,this._listeners={}}getId(){let e=this._attributes.id;return e!==void 0||(e=this._model._nextUniqueId(),this._setId(e)),e}getModel(){return this._model}getType(){return this._attributes.type}getParent(){return this._parent}getChildren(){return this._children}getRect(){return this._rect}isVisible(){return this._visible}getOrientation(){return this._parent===void 0?this._model.isRootOrientationVertical()?zo.Orientation.VERT:zo.Orientation.HORZ:zo.Orientation.flip(this._parent.getOrientation())}setEventListener(e,t){this._listeners[e]=t}removeEventListener(e){delete this._listeners[e]}_setId(e){this._attributes.id=e}_fireEvent(e,t){this._listeners[e]!==void 0&&this._listeners[e](t)}_getAttr(e){let t=this._attributes[e];if(t===void 0){const o=this._getAttributeDefinitions().getModelName(e);o!==void 0&&(t=this._model._getAttribute(o))}return t}_forEachNode(e,t){e(this,t),t++;for(const o of this._children)o._forEachNode(e,t)}_setVisible(e){e!==this._visible&&(this._fireEvent("visibility",{visible:e}),this._visible=e)}_getDrawChildren(){return this._children}_setParent(e){this._parent=e}_setRect(e){this._rect=e}_setWeight(e){this._attributes.weight=e}_setSelected(e){this._attributes.selected=e}_isFixed(){return this._fixed}_layout(e,t){this._rect=e}_findDropTargetNode(e,t,o){let i;if(this._rect.contains(t,o)){if(this._model.getMaximizedTabset()!==void 0)i=this._model.getMaximizedTabset().canDrop(e,t,o);else if(i=this.canDrop(e,t,o),i===void 0&&this._children.length!==0){for(const r of this._children)if(i=r._findDropTargetNode(e,t,o),i!==void 0)break}}return i}canDrop(e,t,o){}_canDockInto(e,t){if(t!=null){if(t.location===ko.DockLocation.CENTER&&t.node.isEnableDrop()===!1||t.location===ko.DockLocation.CENTER&&e.getType()==="tabset"&&e.getName()!==void 0||t.location!==ko.DockLocation.CENTER&&t.node.isEnableDivide()===!1)return!1;if(this._model._getOnAllowDrop())return this._model._getOnAllowDrop()(e,t)}return!0}_removeChild(e){const t=this._children.indexOf(e);return t!==-1&&this._children.splice(t,1),this._dirty=!0,t}_addChild(e,t){return t!=null?this._children.splice(t,0,e):(this._children.push(e),t=this._children.length-1),e._parent=this,this._dirty=!0,t}_removeAll(){this._children=[],this._dirty=!0}_styleWithPosition(e){return e==null&&(e={}),this._rect.styleWithPosition(e)}_getTempSize(){return this._tempSize}_setTempSize(e){this._tempSize=e}isEnableDivide(){return!0}_toAttributeString(){return JSON.stringify(this._attributes,void 0," ")}}Tt.Node=Sa;var Gt={};Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.SplitterNode=void 0;const wa=bt,Fo=Ce,Ra=Tt;class eo extends Ra.Node{constructor(e){super(e),this._fixed=!0,this._attributes.type=eo.TYPE,e._addNode(this)}getWidth(){return this._model.getSplitterSize()}getMinWidth(){return this.getOrientation()===Fo.Orientation.VERT?this._model.getSplitterSize():0}getHeight(){return this._model.getSplitterSize()}getMinHeight(){return this.getOrientation()===Fo.Orientation.HORZ?this._model.getSplitterSize():0}getMinSize(e){return e===Fo.Orientation.HORZ?this.getMinWidth():this.getMinHeight()}getWeight(){return 0}_setWeight(e){}_getPrefSize(e){return this._model.getSplitterSize()}_updateAttrs(e){}_getAttributeDefinitions(){return new wa.AttributeDefinitions}toJson(){}}Gt.SplitterNode=eo,eo.TYPE="splitter";var Nt={};Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.TabNode=void 0;const De=_t,Aa=bt,Oa=Tt;class tt extends Oa.Node{static _fromJson(e,t,o=!0){return new tt(t,e,o)}static _createAttributeDefinitions(){const e=new Aa.AttributeDefinitions;return e.add("type",tt.TYPE,!0).setType(De.Attribute.STRING),e.add("id",void 0).setType(De.Attribute.STRING),e.add("name","[Unnamed Tab]").setType(De.Attribute.STRING),e.add("altName",void 0).setType(De.Attribute.STRING),e.add("helpText",void 0).setType(De.Attribute.STRING),e.add("component",void 0).setType(De.Attribute.STRING),e.add("config",void 0).setType("any"),e.add("floating",!1).setType(De.Attribute.BOOLEAN),e.add("tabsetClassName",void 0).setType(De.Attribute.STRING),e.addInherited("enableClose","tabEnableClose").setType(De.Attribute.BOOLEAN),e.addInherited("closeType","tabCloseType").setType("ICloseType"),e.addInherited("enableDrag","tabEnableDrag").setType(De.Attribute.BOOLEAN),e.addInherited("enableRename","tabEnableRename").setType(De.Attribute.BOOLEAN),e.addInherited("className","tabClassName").setType(De.Attribute.STRING),e.addInherited("contentClassName","tabContentClassName").setType(De.Attribute.STRING),e.addInherited("icon","tabIcon").setType(De.Attribute.STRING),e.addInherited("enableRenderOnDemand","tabEnableRenderOnDemand").setType(De.Attribute.BOOLEAN),e.addInherited("enableFloat","tabEnableFloat").setType(De.Attribute.BOOLEAN),e.addInherited("borderWidth","tabBorderWidth").setType(De.Attribute.NUMBER),e.addInherited("borderHeight","tabBorderHeight").setType(De.Attribute.NUMBER),e}constructor(e,t,o=!0){super(e),this._extra={},tt._attributeDefinitions.fromJson(t,this._attributes),o===!0&&e._addNode(this)}getWindow(){return this._window}getTabRect(){return this._tabRect}_setTabRect(e){this._tabRect=e}_setRenderedName(e){this._renderedName=e}_getNameForOverflowMenu(){const e=this._getAttr("altName");return e!==void 0?e:this._renderedName}getName(){return this._getAttr("name")}getHelpText(){return this._getAttr("helpText")}getComponent(){return this._getAttr("component")}getConfig(){return this._attributes.config}getExtraData(){return this._extra}isFloating(){return this._getAttr("floating")}getIcon(){return this._getAttr("icon")}isEnableClose(){return this._getAttr("enableClose")}getCloseType(){return this._getAttr("closeType")}isEnableFloat(){return this._getAttr("enableFloat")}isEnableDrag(){return this._getAttr("enableDrag")}isEnableRename(){return this._getAttr("enableRename")}getClassName(){return this._getAttr("className")}getContentClassName(){return this._getAttr("contentClassName")}getTabSetClassName(){return this._getAttr("tabsetClassName")}isEnableRenderOnDemand(){return this._getAttr("enableRenderOnDemand")}_setName(e){this._attributes.name=e,this._window&&this._window.document&&(this._window.document.title=e)}_setFloating(e){this._attributes.floating=e}_layout(e,t){e.equals(this._rect)||this._fireEvent("resize",{rect:e}),this._rect=e}_delete(){this._parent._remove(this),this._fireEvent("close",{})}toJson(){const e={};return tt._attributeDefinitions.toJson(e,this._attributes),e}_updateAttrs(e){tt._attributeDefinitions.update(e,this._attributes)}_getAttributeDefinitions(){return tt._attributeDefinitions}_setWindow(e){this._window=e}_setBorderWidth(e){this._attributes.borderWidth=e}_setBorderHeight(e){this._attributes.borderHeight=e}static getAttributeDefinitions(){return tt._attributeDefinitions}}Nt.TabNode=tt,tt.TYPE="tab",tt._attributeDefinitions=tt._createAttributeDefinitions();var st={},yn={},xn={},Vi;function Uo(){if(Vi)return xn;Vi=1,Object.defineProperty(xn,"__esModule",{value:!0}),xn.RowNode=void 0;const n=_t,e=bt,t=rt,o=Xt,i=Ce,r=Me,s=Le,a=vt(),c=Tt,f=Gt,m=Ct();let h=class Ue extends c.Node{static _fromJson(d,l){const g=new Ue(l,d);if(d.children!=null)for(const u of d.children)if(u.type===m.TabSetNode.TYPE){const p=m.TabSetNode._fromJson(u,l);g._addChild(p)}else{const p=Ue._fromJson(u,l);g._addChild(p)}return g}static _createAttributeDefinitions(){const d=new e.AttributeDefinitions;return d.add("type",Ue.TYPE,!0).setType(n.Attribute.STRING).setFixed(),d.add("id",void 0).setType(n.Attribute.STRING),d.add("weight",100).setType(n.Attribute.NUMBER),d.add("width",void 0).setType(n.Attribute.NUMBER),d.add("height",void 0).setType(n.Attribute.NUMBER),d}constructor(d,l){super(d),this._dirty=!0,this._drawChildren=[],this._minHeight=0,this._minWidth=0,Ue._attributeDefinitions.fromJson(l,this._attributes),d._addNode(this)}getWeight(){return this._attributes.weight}getWidth(){return this._getAttr("width")}getHeight(){return this._getAttr("height")}_setWeight(d){this._attributes.weight=d}_layout(d,l){super._layout(d,l);const g=this._rect._getSize(this.getOrientation());let u=0,p=0,_=0,y=0;const S=this._getDrawChildren();for(const O of S){const L=O._getPrefSize(this.getOrientation());O._isFixed()?L!==void 0&&(p+=L):L===void 0?u+=O.getWeight():(_+=L,y+=O.getWeight())}let x=!1,E=g-p-_;E<0&&(E=g-p,x=!0,u+=y);let T=0,w=0;for(const O of S){const L=O._getPrefSize(this.getOrientation());if(O._isFixed())L!==void 0&&O._setTempSize(L);else if(L==null||x){if(u===0)O._setTempSize(0);else{const R=O.getMinSize(this.getOrientation()),F=Math.floor(E*(O.getWeight()/u));O._setTempSize(Math.max(R,F))}w+=O._getTempSize()}else O._setTempSize(L);T+=O._getTempSize()}if(w>0){for(;T<g;)for(const O of S)if(!(O instanceof f.SplitterNode)){const L=O._getPrefSize(this.getOrientation());!O._isFixed()&&(L===void 0||x)&&T<g&&(O._setTempSize(O._getTempSize()+1),T++)}for(;T>g;){let O=!1;for(const L of S)if(!(L instanceof f.SplitterNode)){const R=L.getMinSize(this.getOrientation());L._getTempSize()>R&&T>g&&(L._setTempSize(L._getTempSize()-1),T--,O=!0)}if(!O)break}for(;T>g;){let O=!1;for(const L of S)L instanceof f.SplitterNode||L._getTempSize()>0&&T>g&&(L._setTempSize(L._getTempSize()-1),T--,O=!0);if(!O)break}}let C=0;for(const O of S)this.getOrientation()===i.Orientation.HORZ?O._layout(new r.Rect(this._rect.x+C,this._rect.y,O._getTempSize(),this._rect.height),l):O._layout(new r.Rect(this._rect.x,this._rect.y+C,this._rect.width,O._getTempSize()),l),C+=O._getTempSize();return!0}_getSplitterBounds(d,l=!1){const g=[0,0],u=this._getDrawChildren(),p=u.indexOf(d),_=u[p-1],y=u[p+1];if(this.getOrientation()===i.Orientation.HORZ){const S=l?_.getMinWidth():0,x=l?y.getMinWidth():0;g[0]=_.getRect().x+S,g[1]=y.getRect().getRight()-d.getWidth()-x}else{const S=l?_.getMinHeight():0,x=l?y.getMinHeight():0;g[0]=_.getRect().y+S,g[1]=y.getRect().getBottom()-d.getHeight()-x}return g}_calculateSplit(d,l){let g;const u=this._getDrawChildren(),p=u.indexOf(d),_=this._getSplitterBounds(d),y=u[p-1].getWeight()+u[p+1].getWeight(),S=Math.max(0,l-_[0]),x=Math.max(0,_[1]-l);if(S+x>0){const E=S*y/(S+x),T=x*y/(S+x);g={node1Id:u[p-1].getId(),weight1:E,pixelWidth1:S,node2Id:u[p+1].getId(),weight2:T,pixelWidth2:x}}return g}_getDrawChildren(){if(this._dirty){this._drawChildren=[];for(let d=0;d<this._children.length;d++){const l=this._children[d];if(d!==0){const g=new f.SplitterNode(this._model);g._setParent(this),this._drawChildren.push(g)}this._drawChildren.push(l)}this._dirty=!1}return this._drawChildren}getMinSize(d){return d===i.Orientation.HORZ?this.getMinWidth():this.getMinHeight()}getMinWidth(){return this._minWidth}getMinHeight(){return this._minHeight}calcMinSize(){this._minHeight=0,this._minWidth=0;let d=!0;for(const l of this._children){const g=l;g instanceof Ue&&g.calcMinSize(),this.getOrientation()===i.Orientation.VERT?(this._minHeight+=g.getMinHeight(),d||(this._minHeight+=this._model.getSplitterSize()),this._minWidth=Math.max(this._minWidth,g.getMinWidth())):(this._minWidth+=g.getMinWidth(),d||(this._minWidth+=this._model.getSplitterSize()),this._minHeight=Math.max(this._minHeight,g.getMinHeight())),d=!1}}_tidy(){let d=0;for(;d<this._children.length;){const l=this._children[d];if(l instanceof Ue){l._tidy();const g=l.getChildren();if(g.length===0)this._removeChild(l);else if(g.length===1){const u=g[0];if(this._removeChild(l),u instanceof Ue){let p=0;const _=u.getChildren();for(const y of _)p+=y.getWeight();for(let y=0;y<_.length;y++){const S=_[y];S._setWeight(l.getWeight()*S.getWeight()/p),this._addChild(S,d+y)}}else u._setWeight(l.getWeight()),this._addChild(u,d)}else d++}else l instanceof m.TabSetNode&&l.getChildren().length===0&&l.isEnableDeleteWhenEmpty()?(this._removeChild(l),l===this._model.getMaximizedTabset()&&this._model._setMaximizedTabset(void 0)):d++}if(this===this._model.getRoot()&&this._children.length===0){const l=this._model._getOnCreateTabSet();let g=l?l():{};g=Object.assign(Object.assign({},g),{selected:-1});const u=new m.TabSetNode(this._model,g);this._model._setActiveTabset(u),this._addChild(u)}}canDrop(d,l,g){const u=g-this._rect.y,p=l-this._rect.x,_=this._rect.width,y=this._rect.height,S=10,x=50;let E;if(this._model.isEnableEdgeDock()&&this._parent===void 0){if(l<this._rect.x+S&&u>y/2-x&&u<y/2+x){const T=t.DockLocation.LEFT,w=T.getDockRect(this._rect);w.width=w.width/2,E=new o.DropInfo(this,w,T,-1,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(l>this._rect.getRight()-S&&u>y/2-x&&u<y/2+x){const T=t.DockLocation.RIGHT,w=T.getDockRect(this._rect);w.width=w.width/2,w.x+=w.width,E=new o.DropInfo(this,w,T,-1,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(g<this._rect.y+S&&p>_/2-x&&p<_/2+x){const T=t.DockLocation.TOP,w=T.getDockRect(this._rect);w.height=w.height/2,E=new o.DropInfo(this,w,T,-1,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(g>this._rect.getBottom()-S&&p>_/2-x&&p<_/2+x){const T=t.DockLocation.BOTTOM,w=T.getDockRect(this._rect);w.height=w.height/2,w.y+=w.height,E=new o.DropInfo(this,w,T,-1,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT_EDGE)}if(E!==void 0&&!d._canDockInto(d,E))return}return E}drop(d,l,g){const u=l,p=d.getParent();p&&p._removeChild(d),p!==void 0&&p.getType()===m.TabSetNode.TYPE&&p._setSelected(0),p!==void 0&&p.getType()===a.BorderNode.TYPE&&p._setSelected(-1);let _;if(d instanceof m.TabSetNode)_=d;else{const x=this._model._getOnCreateTabSet();_=new m.TabSetNode(this._model,x?x(d):{}),_._addChild(d)}let y=this._children.reduce((x,E)=>x+E.getWeight(),0);y===0&&(y=100),_._setWeight(y/3);const S=!this._model.isRootOrientationVertical();if(S&&u===t.DockLocation.LEFT||!S&&u===t.DockLocation.TOP)this._addChild(_,0);else if(S&&u===t.DockLocation.RIGHT||!S&&u===t.DockLocation.BOTTOM)this._addChild(_);else if(S&&u===t.DockLocation.TOP||!S&&u===t.DockLocation.LEFT){const x=new Ue(this._model,{}),E=new Ue(this._model,{});E._setWeight(75),_._setWeight(25);for(const T of this._children)E._addChild(T);this._removeAll(),x._addChild(_),x._addChild(E),this._addChild(x)}else if(S&&u===t.DockLocation.BOTTOM||!S&&u===t.DockLocation.RIGHT){const x=new Ue(this._model,{}),E=new Ue(this._model,{});E._setWeight(75),_._setWeight(25);for(const T of this._children)E._addChild(T);this._removeAll(),x._addChild(E),x._addChild(_),this._addChild(x)}this._model._setActiveTabset(_),this._model._tidy()}toJson(){const d={};Ue._attributeDefinitions.toJson(d,this._attributes),d.children=[];for(const l of this._children)d.children.push(l.toJson());return d}isEnableDrop(){return!0}_getPrefSize(d){let l=this.getWidth();return d===i.Orientation.VERT&&(l=this.getHeight()),l}_getAttributeDefinitions(){return Ue._attributeDefinitions}_updateAttrs(d){Ue._attributeDefinitions.update(d,this._attributes)}static getAttributeDefinitions(){return Ue._attributeDefinitions}};return xn.RowNode=h,h.TYPE="row",h._attributeDefinitions=h._createAttributeDefinitions(),xn}var $i;function Ct(){if($i)return yn;$i=1,Object.defineProperty(yn,"__esModule",{value:!0}),yn.TabSetNode=void 0;const n=_t,e=bt,t=rt,o=Xt,i=Ce,r=Me,s=Le,a=vt(),c=Tt,f=Uo(),m=Nt,h=Po();let b=class wt extends c.Node{static _fromJson(l,g){const u=new wt(g,l);if(l.children!=null)for(const p of l.children){const _=m.TabNode._fromJson(p,g);u._addChild(_)}return u._children.length===0&&u._setSelected(-1),l.maximized&&l.maximized===!0&&g._setMaximizedTabset(u),l.active&&l.active===!0&&g._setActiveTabset(u),u}static _createAttributeDefinitions(){const l=new e.AttributeDefinitions;return l.add("type",wt.TYPE,!0).setType(n.Attribute.STRING).setFixed(),l.add("id",void 0).setType(n.Attribute.STRING),l.add("weight",100).setType(n.Attribute.NUMBER),l.add("width",void 0).setType(n.Attribute.NUMBER),l.add("height",void 0).setType(n.Attribute.NUMBER),l.add("selected",0).setType(n.Attribute.NUMBER),l.add("name",void 0).setType(n.Attribute.STRING),l.add("config",void 0).setType("any"),l.addInherited("enableDeleteWhenEmpty","tabSetEnableDeleteWhenEmpty"),l.addInherited("enableDrop","tabSetEnableDrop"),l.addInherited("enableDrag","tabSetEnableDrag"),l.addInherited("enableDivide","tabSetEnableDivide"),l.addInherited("enableMaximize","tabSetEnableMaximize"),l.addInherited("enableClose","tabSetEnableClose"),l.addInherited("enableSingleTabStretch","tabSetEnableSingleTabStretch"),l.addInherited("classNameTabStrip","tabSetClassNameTabStrip"),l.addInherited("classNameHeader","tabSetClassNameHeader"),l.addInherited("enableTabStrip","tabSetEnableTabStrip"),l.addInherited("borderInsets","tabSetBorderInsets"),l.addInherited("marginInsets","tabSetMarginInsets"),l.addInherited("minWidth","tabSetMinWidth"),l.addInherited("minHeight","tabSetMinHeight"),l.addInherited("headerHeight","tabSetHeaderHeight"),l.addInherited("tabStripHeight","tabSetTabStripHeight"),l.addInherited("tabLocation","tabSetTabLocation"),l.addInherited("autoSelectTab","tabSetAutoSelectTab").setType(n.Attribute.BOOLEAN),l}constructor(l,g){super(l),wt._attributeDefinitions.fromJson(g,this._attributes),l._addNode(this),this._calculatedTabBarHeight=0,this._calculatedHeaderBarHeight=0}getName(){return this._getAttr("name")}getSelected(){const l=this._attributes.selected;return l!==void 0?l:-1}getSelectedNode(){const l=this.getSelected();if(l!==-1)return this._children[l]}getWeight(){return this._getAttr("weight")}getWidth(){return this._getAttr("width")}getMinWidth(){return this._getAttr("minWidth")}getHeight(){return this._getAttr("height")}getMinHeight(){return this._getAttr("minHeight")}getMinSize(l){return l===i.Orientation.HORZ?this.getMinWidth():this.getMinHeight()}getConfig(){return this._attributes.config}isMaximized(){return this._model.getMaximizedTabset()===this}isActive(){return this._model.getActiveTabset()===this}isEnableDeleteWhenEmpty(){return this._getAttr("enableDeleteWhenEmpty")}isEnableDrop(){return this._getAttr("enableDrop")}isEnableDrag(){return this._getAttr("enableDrag")}isEnableDivide(){return this._getAttr("enableDivide")}isEnableMaximize(){return this._getAttr("enableMaximize")}isEnableClose(){return this._getAttr("enableClose")}isEnableSingleTabStretch(){return this._getAttr("enableSingleTabStretch")}canMaximize(){return this.isEnableMaximize()?this.getModel().getMaximizedTabset()===this?!0:!(this.getParent()===this.getModel().getRoot()&&this.getModel().getRoot().getChildren().length===1):!1}isEnableTabStrip(){return this._getAttr("enableTabStrip")}isAutoSelectTab(){return this._getAttr("autoSelectTab")}getClassNameTabStrip(){return this._getAttr("classNameTabStrip")}getClassNameHeader(){return this._getAttr("classNameHeader")}calculateHeaderBarHeight(l){const g=this._getAttr("headerHeight");g!==0?this._calculatedHeaderBarHeight=g:this._calculatedHeaderBarHeight=l.headerBarSize}calculateTabBarHeight(l){const g=this._getAttr("tabStripHeight");g!==0?this._calculatedTabBarHeight=g:this._calculatedTabBarHeight=l.tabBarSize}getHeaderHeight(){return this._calculatedHeaderBarHeight}getTabStripHeight(){return this._calculatedTabBarHeight}getTabLocation(){return this._getAttr("tabLocation")}_setWeight(l){this._attributes.weight=l}_setSelected(l){this._attributes.selected=l}canDrop(l,g,u){let p;if(l===this){const _=t.DockLocation.CENTER,y=this._tabHeaderRect;p=new o.DropInfo(this,y,_,-1,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT)}else if(this._contentRect.contains(g,u)){let _=t.DockLocation.CENTER;this._model.getMaximizedTabset()===void 0&&(_=t.DockLocation.getLocation(this._contentRect,g,u));const y=_.getDockRect(this._rect);p=new o.DropInfo(this,y,_,-1,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT)}else if(this._tabHeaderRect!=null&&this._tabHeaderRect.contains(g,u)){let _,y,S;if(this._children.length===0)_=this._tabHeaderRect.clone(),y=_.y+3,S=_.height-4,_.width=2;else{let x=this._children[0];_=x.getTabRect(),y=_.y,S=_.height;let E=this._tabHeaderRect.x,T=0;for(let w=0;w<this._children.length;w++){if(x=this._children[w],_=x.getTabRect(),T=_.x+_.width/2,g>=E&&g<T){const C=t.DockLocation.CENTER,O=new r.Rect(_.x-2,y,3,S);p=new o.DropInfo(this,O,C,w,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT);break}E=T}}if(p==null){const x=t.DockLocation.CENTER,E=new r.Rect(_.getRight()-2,y,3,S);p=new o.DropInfo(this,E,x,this._children.length,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT)}}if(l._canDockInto(l,p))return p}_layout(l,g){this.calculateHeaderBarHeight(g),this.calculateTabBarHeight(g),this.isMaximized()&&(l=this._model.getRoot().getRect()),l=l.removeInsets(this._getAttr("marginInsets")),this._rect=l,l=l.removeInsets(this._getAttr("borderInsets"));const u=this.getName()!==void 0;let p=0,_=0;u&&(p+=this._calculatedHeaderBarHeight,_+=this._calculatedHeaderBarHeight),this.isEnableTabStrip()&&(this.getTabLocation()==="top"?this._tabHeaderRect=new r.Rect(l.x,l.y+p,l.width,this._calculatedTabBarHeight):this._tabHeaderRect=new r.Rect(l.x,l.y+l.height-this._calculatedTabBarHeight,l.width,this._calculatedTabBarHeight),_+=this._calculatedTabBarHeight,this.getTabLocation()==="top"&&(p+=this._calculatedTabBarHeight)),this._contentRect=new r.Rect(l.x,l.y+p,l.width,l.height-_);for(let y=0;y<this._children.length;y++){const S=this._children[y];S._layout(this._contentRect,g),S._setVisible(y===this.getSelected())}}_delete(){this._parent._removeChild(this)}_remove(l){const g=this._removeChild(l);this._model._tidy(),(0,h.adjustSelectedIndex)(this,g)}drop(l,g,u,p){const _=g;if(this===l)return;let y=l.getParent(),S=0;if(y!==void 0&&(S=y._removeChild(l),y instanceof a.BorderNode&&y.getSelected()===S?y._setSelected(-1):(0,h.adjustSelectedIndex)(y,S)),l.getType()===m.TabNode.TYPE&&y===this&&S<u&&u>0&&u--,_===t.DockLocation.CENTER){let x=u;if(x===-1&&(x=this._children.length),l.getType()===m.TabNode.TYPE)this._addChild(l,x),(p||p!==!1&&this.isAutoSelectTab())&&this._setSelected(x);else{for(let E=0;E<l.getChildren().length;E++){const T=l.getChildren()[E];this._addChild(T,x),x++}this.getSelected()===-1&&this._children.length>0&&this._setSelected(0)}this._model._setActiveTabset(this)}else{let x;if(l instanceof m.TabNode){const w=this._model._getOnCreateTabSet();x=new wt(this._model,w?w(l):{}),x._addChild(l),y=x}else x=l;const E=this._parent,T=E.getChildren().indexOf(this);if(E.getOrientation()===_._orientation)x._setWeight(this.getWeight()/2),this._setWeight(this.getWeight()/2),E._addChild(x,T+_._indexPlus);else{const w=new f.RowNode(this._model,{});w._setWeight(this.getWeight()),w._addChild(this),this._setWeight(50),x._setWeight(50),w._addChild(x,_._indexPlus),E._removeChild(this),E._addChild(w,T)}this._model._setActiveTabset(x)}this._model._tidy()}toJson(){const l={};return wt._attributeDefinitions.toJson(l,this._attributes),l.children=this._children.map(g=>g.toJson()),this.isActive()&&(l.active=!0),this.isMaximized()&&(l.maximized=!0),l}_updateAttrs(l){wt._attributeDefinitions.update(l,this._attributes)}_getAttributeDefinitions(){return wt._attributeDefinitions}_getPrefSize(l){let g=this.getWidth();return l===i.Orientation.VERT&&(g=this.getHeight()),g}static getAttributeDefinitions(){return wt._attributeDefinitions}};return yn.TabSetNode=b,b.TYPE="tabset",b._attributeDefinitions=b._createAttributeDefinitions(),yn}var Ji;function Po(){if(Ji)return st;Ji=1,Object.defineProperty(st,"__esModule",{value:!0}),st.randomUUID=st.adjustSelectedIndex=st.adjustSelectedIndexAfterDock=st.adjustSelectedIndexAfterFloat=void 0;const n=Ct(),e=vt();function t(s){const a=s.getParent();if(a!==null)if(a instanceof n.TabSetNode){let c=!1,f=0;const m=a.getChildren();for(let h=0;h<m.length;h++){const b=m[h];if(b===s)c=!0;else if(!b.isFloating()&&(f=h,c))break}a._setSelected(f)}else a instanceof e.BorderNode&&a._setSelected(-1)}st.adjustSelectedIndexAfterFloat=t;function o(s){const a=s.getParent();if(a!==null&&(a instanceof n.TabSetNode||a instanceof e.BorderNode)){const c=a.getChildren();for(let f=0;f<c.length;f++)if(c[f]===s){a._setSelected(f);return}}}st.adjustSelectedIndexAfterDock=o;function i(s,a){if(s!==void 0&&(s.getType()===n.TabSetNode.TYPE||s.getType()===e.BorderNode.TYPE)){const c=s.getSelected();c!==-1&&(a===c&&s.getChildren().length>0?a>=s.getChildren().length&&s._setSelected(s.getChildren().length-1):a<c?s._setSelected(c-1):a>c||s._setSelected(-1))}}st.adjustSelectedIndex=i;function r(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,s=>(s^crypto.getRandomValues(new Uint8Array(1))[0]&15>>s/4).toString(16))}return st.randomUUID=r,st}var Zi;function vt(){if(Zi)return vn;Zi=1,Object.defineProperty(vn,"__esModule",{value:!0}),vn.BorderNode=void 0;const n=_t,e=bt,t=rt,o=Xt,i=Ce,r=Me,s=Le,a=Tt,c=Gt,f=Nt,m=Po();let h=class Rt extends a.Node{static _fromJson(d,l){const g=t.DockLocation.getByName(d.location),u=new Rt(g,d,l);return d.children&&(u._children=d.children.map(p=>{const _=f.TabNode._fromJson(p,l);return _._setParent(u),_})),u}static _createAttributeDefinitions(){const d=new e.AttributeDefinitions;return d.add("type",Rt.TYPE,!0).setType(n.Attribute.STRING).setFixed(),d.add("selected",-1).setType(n.Attribute.NUMBER),d.add("show",!0).setType(n.Attribute.BOOLEAN),d.add("config",void 0).setType("any"),d.addInherited("barSize","borderBarSize").setType(n.Attribute.NUMBER),d.addInherited("enableDrop","borderEnableDrop").setType(n.Attribute.BOOLEAN),d.addInherited("className","borderClassName").setType(n.Attribute.STRING),d.addInherited("autoSelectTabWhenOpen","borderAutoSelectTabWhenOpen").setType(n.Attribute.BOOLEAN),d.addInherited("autoSelectTabWhenClosed","borderAutoSelectTabWhenClosed").setType(n.Attribute.BOOLEAN),d.addInherited("size","borderSize").setType(n.Attribute.NUMBER),d.addInherited("minSize","borderMinSize").setType(n.Attribute.NUMBER),d.addInherited("enableAutoHide","borderEnableAutoHide").setType(n.Attribute.BOOLEAN),d}constructor(d,l,g){super(g),this._adjustedSize=0,this._calculatedBorderBarSize=0,this._location=d,this._drawChildren=[],this._attributes.id=`border_${d.getName()}`,Rt._attributeDefinitions.fromJson(l,this._attributes),g._addNode(this)}getLocation(){return this._location}getTabHeaderRect(){return this._tabHeaderRect}getRect(){return this._tabHeaderRect}getContentRect(){return this._contentRect}isEnableDrop(){return this._getAttr("enableDrop")}isAutoSelectTab(d){return d==null&&(d=this.getSelected()!==-1),d?this._getAttr("autoSelectTabWhenOpen"):this._getAttr("autoSelectTabWhenClosed")}getClassName(){return this._getAttr("className")}calcBorderBarSize(d){const l=this._getAttr("barSize");l!==0?this._calculatedBorderBarSize=l:this._calculatedBorderBarSize=d.borderBarSize}getBorderBarSize(){return this._calculatedBorderBarSize}getSize(){const d=this._getAttr("size"),l=this.getSelected();if(l===-1)return d;{const g=this._children[l],u=this._location._orientation===i.Orientation.HORZ?g._getAttr("borderWidth"):g._getAttr("borderHeight");return u===-1?d:u}}getMinSize(){return this._getAttr("minSize")}getSelected(){return this._attributes.selected}getSelectedNode(){if(this.getSelected()!==-1)return this._children[this.getSelected()]}getOrientation(){return this._location.getOrientation()}getConfig(){return this._attributes.config}isMaximized(){return!1}isShowing(){return this._attributes.show?!(this._model._getShowHiddenBorder()!==this._location&&this.isAutoHide()&&this._children.length===0):!1}isAutoHide(){return this._getAttr("enableAutoHide")}_setSelected(d){this._attributes.selected=d}_setSize(d){const l=this.getSelected();if(l===-1)this._attributes.size=d;else{const g=this._children[l];(this._location._orientation===i.Orientation.HORZ?g._getAttr("borderWidth"):g._getAttr("borderHeight"))===-1?this._attributes.size=d:this._location._orientation===i.Orientation.HORZ?g._setBorderWidth(d):g._setBorderHeight(d)}}_updateAttrs(d){Rt._attributeDefinitions.update(d,this._attributes)}_getDrawChildren(){return this._drawChildren}_setAdjustedSize(d){this._adjustedSize=d}_getAdjustedSize(){return this._adjustedSize}_layoutBorderOuter(d,l){this.calcBorderBarSize(l);const g=this._location.split(d,this.getBorderBarSize());return this._tabHeaderRect=g.start,g.end}_layoutBorderInner(d,l){this._drawChildren=[];const g=this._location,u=g.split(d,this._adjustedSize+this._model.getSplitterSize()),p=g.reflect().split(u.start,this._model.getSplitterSize());this._contentRect=p.end;for(let _=0;_<this._children.length;_++){const y=this._children[_];y._layout(this._contentRect,l),y._setVisible(_===this.getSelected()),this._drawChildren.push(y)}if(this.getSelected()===-1)return d;{const _=new c.SplitterNode(this._model);return _._setParent(this),_._setRect(p.start),this._drawChildren.push(_),u.end}}_remove(d){const l=this._removeChild(d);this.getSelected()!==-1&&(0,m.adjustSelectedIndex)(this,l)}canDrop(d,l,g){if(d.getType()!==f.TabNode.TYPE)return;let u;const p=t.DockLocation.CENTER;if(this._tabHeaderRect.contains(l,g)){if(this._location._orientation===i.Orientation.VERT)if(this._children.length>0){let _=this._children[0],y=_.getTabRect();const S=y.y,x=y.height;let E=this._tabHeaderRect.x,T=0;for(let w=0;w<this._children.length;w++){if(_=this._children[w],y=_.getTabRect(),T=y.x+y.width/2,l>=E&&l<T){const C=new r.Rect(y.x-2,S,3,x);u=new o.DropInfo(this,C,p,w,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT);break}E=T}if(u==null){const w=new r.Rect(y.getRight()-2,S,3,x);u=new o.DropInfo(this,w,p,this._children.length,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT)}}else{const _=new r.Rect(this._tabHeaderRect.x+1,this._tabHeaderRect.y+2,3,18);u=new o.DropInfo(this,_,p,0,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT)}else if(this._children.length>0){let _=this._children[0],y=_.getTabRect();const S=y.x,x=y.width;let E=this._tabHeaderRect.y,T=0;for(let w=0;w<this._children.length;w++){if(_=this._children[w],y=_.getTabRect(),T=y.y+y.height/2,g>=E&&g<T){const C=new r.Rect(S,y.y-2,x,3);u=new o.DropInfo(this,C,p,w,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT);break}E=T}if(u==null){const w=new r.Rect(S,y.getBottom()-2,x,3);u=new o.DropInfo(this,w,p,this._children.length,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT)}}else{const _=new r.Rect(this._tabHeaderRect.x+2,this._tabHeaderRect.y+1,18,3);u=new o.DropInfo(this,_,p,0,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT)}if(!d._canDockInto(d,u))return}else if(this.getSelected()!==-1&&this._contentRect.contains(l,g)){const _=this._contentRect;if(u=new o.DropInfo(this,_,p,-1,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT),!d._canDockInto(d,u))return}return u}drop(d,l,g,u){let p=0;const _=d.getParent();_!==void 0&&(p=_._removeChild(d),_!==this&&_ instanceof Rt&&_.getSelected()===p?_._setSelected(-1):(0,m.adjustSelectedIndex)(_,p)),d.getType()===f.TabNode.TYPE&&_===this&&p<g&&g>0&&g--;let y=g;y===-1&&(y=this._children.length),d.getType()===f.TabNode.TYPE&&this._addChild(d,y),(u||u!==!1&&this.isAutoSelectTab())&&this._setSelected(y),this._model._tidy()}toJson(){const d={};return Rt._attributeDefinitions.toJson(d,this._attributes),d.location=this._location.getName(),d.children=this._children.map(l=>l.toJson()),d}_getSplitterBounds(d,l=!1){const g=[0,0],u=l?this.getMinSize():0,p=this._model._getOuterInnerRects().outer,_=this._model._getOuterInnerRects().inner,y=this._model.getRoot();return this._location===t.DockLocation.TOP?(g[0]=p.y+u,g[1]=Math.max(g[0],_.getBottom()-d.getHeight()-y.getMinHeight())):this._location===t.DockLocation.LEFT?(g[0]=p.x+u,g[1]=Math.max(g[0],_.getRight()-d.getWidth()-y.getMinWidth())):this._location===t.DockLocation.BOTTOM?(g[1]=p.getBottom()-d.getHeight()-u,g[0]=Math.min(g[1],_.y+y.getMinHeight())):this._location===t.DockLocation.RIGHT&&(g[1]=p.getRight()-d.getWidth()-u,g[0]=Math.min(g[1],_.x+y.getMinWidth())),g}_calculateSplit(d,l){const g=this._getSplitterBounds(d);return this._location===t.DockLocation.BOTTOM||this._location===t.DockLocation.RIGHT?Math.max(0,g[1]-l):Math.max(0,l-g[0])}_getAttributeDefinitions(){return Rt._attributeDefinitions}static getAttributeDefinitions(){return Rt._attributeDefinitions}};return vn.BorderNode=h,h.TYPE="border",h._attributeDefinitions=h._createAttributeDefinitions(),vn}var to={},no={},yt={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.I18nLabel=void 0,function(e){e.Close_Tab="Close",e.Close_Tabset="Close tabset",e.Move_Tab="Move: ",e.Move_Tabset="Move tabset",e.Maximize="Maximize tabset",e.Restore="Restore tabset",e.Float_Tab="Show selected tab in floating window",e.Overflow_Menu_Tooltip="Hidden tabs",e.Floating_Window_Message="This panel is shown in a floating window",e.Floating_Window_Show_Window="Show window",e.Floating_Window_Dock_Window="Dock window",e.Error_rendering_component="Error rendering component"}(n.I18nLabel||(n.I18nLabel={}))})(yt);var oo={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ICloseType=void 0,function(e){e[e.Visible=1]="Visible",e[e.Always=2]="Always",e[e.Selected=3]="Selected"}(n.ICloseType||(n.ICloseType={}))})(oo);var We={};Object.defineProperty(We,"__esModule",{value:!0}),We.isAuxMouseEvent=We.hideElement=We.getRenderStateEx=void 0;const qi=A;function Na(n,e,t,o,i){let r=t?t(e):void 0,s=e.getName(),a=e.getName();i===void 0&&(i=0);function c(h){return h.titleContent!==void 0}if(o!==void 0){const h=o(e);h!==void 0&&(typeof h=="string"?(s=h,a=h):c(h)?(s=h.titleContent,a=h.name):s=h)}r===void 0&&e.getIcon()!==void 0&&(i!==0?r=qi.createElement("img",{style:{width:"1em",height:"1em",transform:"rotate("+i+"deg)"},src:e.getIcon(),alt:"leadingContent"}):r=qi.createElement("img",{style:{width:"1em",height:"1em"},src:e.getIcon(),alt:"leadingContent"}));const m={leading:r,content:s,name:a,buttons:[]};return n.customizeTab(e,m),e._setRenderedName(m.name),m}We.getRenderStateEx=Na;function Ca(n,e){e?n.visibility="hidden":n.display="none"}We.hideElement=Ca;function La(n){let e=!1;return n.nativeEvent instanceof MouseEvent&&(n.nativeEvent.button!==0||n.ctrlKey||n.altKey||n.metaKey||n.shiftKey)&&(e=!0),e}We.isAuxMouseEvent=La,Object.defineProperty(no,"__esModule",{value:!0}),no.BorderButton=void 0;const Lt=A,Da=yt,jo=Ze,Ia=Me,Ki=oo,Dt=Le,Ho=We,Ba=n=>{const{layout:e,node:t,selected:o,border:i,iconFactory:r,titleFactory:s,icons:a,path:c}=n,f=Lt.useRef(null),m=Lt.useRef(null),h=R=>{!(0,Ho.isAuxMouseEvent)(R)&&!e.getEditingTab()&&e.dragStart(R,void 0,t,t.isEnableDrag(),l,g)},b=R=>{(0,Ho.isAuxMouseEvent)(R)&&e.auxMouseClick(t,R)},d=R=>{e.showContextMenu(t,R)},l=()=>{e.doAction(jo.Actions.selectTab(t.getId()))},g=R=>{},u=()=>{const R=t.getCloseType();return!!(o||R===Ki.ICloseType.Always||R===Ki.ICloseType.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches)},p=R=>{u()?e.doAction(jo.Actions.deleteTab(t.getId())):l()},_=R=>{R.stopPropagation()};Lt.useLayoutEffect(()=>{y(),e.getEditingTab()===t&&m.current.select()});const y=()=>{var R;const F=e.getDomRect(),k=(R=f.current)===null||R===void 0?void 0:R.getBoundingClientRect();k&&F&&t._setTabRect(new Ia.Rect(k.left-F.left,k.top-F.top,k.width,k.height))},S=R=>{R.stopPropagation()},x=R=>{R.code==="Escape"?e.setEditingTab(void 0):R.code==="Enter"&&(e.setEditingTab(void 0),e.doAction(jo.Actions.renameTab(t.getId(),R.target.value)))},E=e.getClassName;let T=E(Dt.CLASSES.FLEXLAYOUT__BORDER_BUTTON)+" "+E(Dt.CLASSES.FLEXLAYOUT__BORDER_BUTTON_+i);o?T+=" "+E(Dt.CLASSES.FLEXLAYOUT__BORDER_BUTTON__SELECTED):T+=" "+E(Dt.CLASSES.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED),t.getClassName()!==void 0&&(T+=" "+t.getClassName());let w=0;t.getModel().isEnableRotateBorderIcons()===!1&&(i==="left"?w=90:i==="right"&&(w=-90));const C=(0,Ho.getRenderStateEx)(e,t,r,s,w);let O=C.content?Lt.createElement("div",{className:E(Dt.CLASSES.FLEXLAYOUT__BORDER_BUTTON_CONTENT)},C.content):null;const L=C.leading?Lt.createElement("div",{className:E(Dt.CLASSES.FLEXLAYOUT__BORDER_BUTTON_LEADING)},C.leading):null;if(e.getEditingTab()===t&&(O=Lt.createElement("input",{ref:m,className:E(Dt.CLASSES.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":c+"/textbox",type:"text",autoFocus:!0,defaultValue:t.getName(),onKeyDown:x,onMouseDown:S,onTouchStart:S})),t.isEnableClose()){const R=e.i18nName(Da.I18nLabel.Close_Tab);C.buttons.push(Lt.createElement("div",{key:"close","data-layout-path":c+"/button/close",title:R,className:E(Dt.CLASSES.FLEXLAYOUT__BORDER_BUTTON_TRAILING),onMouseDown:_,onClick:p,onTouchStart:_},typeof a.close=="function"?a.close(t):a.close))}return Lt.createElement("div",{ref:f,"data-layout-path":c,className:T,onMouseDown:h,onClick:b,onAuxClick:b,onContextMenu:d,onTouchStart:h,title:t.getHelpText()},L,O,C.buttons)};no.BorderButton=Ba;var En={},Sn={};Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.TabButtonStamp=void 0;const io=A,Wo=Le,Ma=We,ka=n=>{const{layout:e,node:t,iconFactory:o,titleFactory:i}=n,r=io.useRef(null),s=e.getClassName;let a=s(Wo.CLASSES.FLEXLAYOUT__TAB_BUTTON_STAMP);const c=(0,Ma.getRenderStateEx)(e,t,o,i);let f=c.content?io.createElement("div",{className:s(Wo.CLASSES.FLEXLAYOUT__TAB_BUTTON_CONTENT)},c.content):t._getNameForOverflowMenu();const m=c.leading?io.createElement("div",{className:s(Wo.CLASSES.FLEXLAYOUT__TAB_BUTTON_LEADING)},c.leading):null;return io.createElement("div",{ref:r,className:a,title:t.getHelpText()},m,f)};Sn.TabButtonStamp=ka,Object.defineProperty(En,"__esModule",{value:!0}),En.showPopup=void 0;const ro=A,Yo=Yt,Xo=Le,za=Sn;function Fa(n,e,t,o,i,r){var s;const a=o.getRootDiv(),c=o.getClassName,f=n.ownerDocument,m=n.getBoundingClientRect(),h=(s=a==null?void 0:a.getBoundingClientRect())!==null&&s!==void 0?s:new DOMRect(0,0,100,100),b=f.createElement("div");b.className=c(Xo.CLASSES.FLEXLAYOUT__POPUP_MENU_CONTAINER),m.left<h.left+h.width/2?b.style.left=m.left-h.left+"px":b.style.right=h.right-m.right+"px",m.top<h.top+h.height/2?b.style.top=m.top-h.top+"px":b.style.bottom=h.bottom-m.bottom+"px",Yo.DragDrop.instance.addGlass(()=>d()),Yo.DragDrop.instance.setGlassCursorOverride("default"),a&&a.appendChild(b);const d=()=>{o.hidePortal(),Yo.DragDrop.instance.hideGlass(),a&&a.removeChild(b),b.removeEventListener("mousedown",l),f.removeEventListener("mousedown",g)},l=u=>{u.stopPropagation()},g=u=>{d()};b.addEventListener("mousedown",l),f.addEventListener("mousedown",g),o.showPortal(ro.createElement(Ua,{currentDocument:f,onSelect:t,onHide:d,items:e,classNameMapper:c,layout:o,iconFactory:i,titleFactory:r}),b)}En.showPopup=Fa;const Ua=n=>{const{items:e,onHide:t,onSelect:o,classNameMapper:i,layout:r,iconFactory:s,titleFactory:a}=n,c=(m,h)=>{o(m),t(),h.stopPropagation()},f=e.map((m,h)=>ro.createElement("div",{key:m.index,className:i(Xo.CLASSES.FLEXLAYOUT__POPUP_MENU_ITEM),"data-layout-path":"/popup-menu/tb"+h,onClick:b=>c(m,b),title:m.node.getHelpText()},m.node.getModel().isLegacyOverflowMenu()?m.node._getNameForOverflowMenu():ro.createElement(za.TabButtonStamp,{node:m.node,layout:r,iconFactory:s,titleFactory:a})));return ro.createElement("div",{className:i(Xo.CLASSES.FLEXLAYOUT__POPUP_MENU),"data-layout-path":"/popup-menu"},f)};var wn={};Object.defineProperty(wn,"__esModule",{value:!0}),wn.useTabOverflow=void 0;const at=A,Pa=Me,Qi=Ct(),Go=Ce,ja=(n,e,t,o)=>{const i=at.useRef(!0),r=at.useRef(!1),s=at.useRef(new Pa.Rect(0,0,0,0)),a=at.useRef(null),[c,f]=at.useState(0),m=at.useRef(!1),[h,b]=at.useState([]),d=at.useRef(0);at.useLayoutEffect(()=>{m.current=!1},[n.getSelectedNode(),n.getRect().width,n.getRect().height]),at.useLayoutEffect(()=>{y()});const l=a.current;at.useEffect(()=>{if(l)return l.addEventListener("wheel",g,{passive:!1}),()=>{l.removeEventListener("wheel",g)}},[l]);const g=x=>{x.preventDefault()},u=x=>e===Go.Orientation.HORZ?x.x:x.y,p=x=>e===Go.Orientation.HORZ?x.getRight():x.getBottom(),_=x=>e===Go.Orientation.HORZ?x.width:x.height,y=()=>{i.current===!0&&(r.current=!1);const E=n instanceof Qi.TabSetNode?n.getRect():n.getTabHeaderRect();let T=n.getChildren()[n.getChildren().length-1];const w=o.current===null?0:_(o.current.getBoundingClientRect());if(i.current===!0||d.current===0&&h.length!==0||E.width!==s.current.width||E.height!==s.current.height){d.current=h.length,s.current=E;const C=n instanceof Qi.TabSetNode?n.isEnableTabStrip()===!0:!0;let O=p(E)-w;if(t.current!==null&&(O-=_(t.current.getBoundingClientRect())),C&&n.getChildren().length>0){if(h.length===0&&c===0&&p(T.getTabRect())+2<O)return;let L=0;const R=n.getSelectedNode();if(R&&!m.current){const j=R.getTabRect(),z=u(j)-2,V=p(j)+2;_(j)+2*2>=O-u(E)?L=u(E)-z:(V>O||z<u(E))&&(z<u(E)&&(L=u(E)-z),V+L>O&&(L=O-V))}const F=Math.max(0,O-(p(T.getTabRect())+2+L)),k=Math.min(0,c+L+F),B=k-c,Y=[];for(let j=0;j<n.getChildren().length;j++){const z=n.getChildren()[j];(u(z.getTabRect())+B<u(E)||p(z.getTabRect())+B>O)&&Y.push({node:z,index:j})}Y.length>0&&(r.current=!0),i.current=!1,b(Y),f(k)}}else i.current=!0};return{selfRef:a,position:c,userControlledLeft:m,hiddenTabs:h,onMouseWheel:x=>{let E=0;Math.abs(x.deltaX)>Math.abs(x.deltaY)?E=-x.deltaX:E=-x.deltaY,x.deltaMode===1&&(E*=40),f(c+E),m.current=!0,x.stopPropagation()},tabsTruncated:r.current}};wn.useTabOverflow=ja,Object.defineProperty(to,"__esModule",{value:!0}),to.BorderTabSet=void 0;const Pe=A,er=rt,Ha=no,Wa=En,tr=Ze,nr=yt,Ya=wn,Xa=Ce,ke=Le,Ga=We,Va=n=>{const{border:e,layout:t,iconFactory:o,titleFactory:i,icons:r,path:s}=n,a=Pe.useRef(null),c=Pe.useRef(null),f=Pe.useRef(null),{selfRef:m,position:h,userControlledLeft:b,hiddenTabs:d,onMouseWheel:l,tabsTruncated:g}=(0,Ya.useTabOverflow)(e,Xa.Orientation.flip(e.getOrientation()),a,f),u=z=>{(0,Ga.isAuxMouseEvent)(z)&&t.auxMouseClick(e,z)},p=z=>{t.showContextMenu(e,z)},_=z=>{z.stopPropagation()},y=z=>{const V=t.getShowOverflowMenu();if(V!==void 0)V(e,z,d,S);else{const ae=c.current;(0,Wa.showPopup)(ae,d,S,t,o,i)}z.stopPropagation()},S=z=>{t.doAction(tr.Actions.selectTab(z.node.getId())),b.current=!1},x=z=>{const V=e.getChildren()[e.getSelected()];V!==void 0&&t.doAction(tr.Actions.floatTab(V.getId())),z.stopPropagation()},E=t.getClassName;let T=e.getTabHeaderRect().styleWithPosition({});const w=[],C=z=>{let V=e.getSelected()===z,ae=e.getChildren()[z];w.push(Pe.createElement(Ha.BorderButton,{layout:t,border:e.getLocation().getName(),node:ae,path:s+"/tb"+z,key:ae.getId(),selected:V,iconFactory:o,titleFactory:i,icons:r})),z<e.getChildren().length-1&&w.push(Pe.createElement("div",{key:"divider"+z,className:E(ke.CLASSES.FLEXLAYOUT__BORDER_TAB_DIVIDER)}))};for(let z=0;z<e.getChildren().length;z++)C(z);let O=E(ke.CLASSES.FLEXLAYOUT__BORDER)+" "+E(ke.CLASSES.FLEXLAYOUT__BORDER_+e.getLocation().getName());e.getClassName()!==void 0&&(O+=" "+e.getClassName());let L=[],R=[];const F={headerContent:void 0,buttons:L,stickyButtons:R,headerButtons:[],overflowPosition:void 0};if(t.customizeTabSet(e,F),L=F.buttons,F.overflowPosition===void 0&&(F.overflowPosition=R.length),R.length>0&&(g?L=[...R,...L]:w.push(Pe.createElement("div",{ref:f,key:"sticky_buttons_container",onMouseDown:_,onTouchStart:_,onDragStart:z=>{z.preventDefault()},className:E(ke.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER)},R))),d.length>0){const z=t.i18nName(nr.I18nLabel.Overflow_Menu_Tooltip);let V;typeof r.more=="function"?V=r.more(e,d):V=Pe.createElement(Pe.Fragment,null,r.more,Pe.createElement("div",{className:E(ke.CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT)},d.length)),L.splice(Math.min(F.overflowPosition,L.length),0,Pe.createElement("button",{key:"overflowbutton",ref:c,className:E(ke.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+E(ke.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW)+" "+E(ke.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_+e.getLocation().getName()),title:z,onClick:y,onMouseDown:_,onTouchStart:_},V))}const k=e.getSelected();if(k!==-1){const z=e.getChildren()[k];if(z!==void 0&&t.isSupportsPopout()&&z.isEnableFloat()&&!z.isFloating()){const V=t.i18nName(nr.I18nLabel.Float_Tab);L.push(Pe.createElement("button",{key:"float",title:V,className:E(ke.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+E(ke.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT),onClick:x,onMouseDown:_,onTouchStart:_},typeof r.popout=="function"?r.popout(z):r.popout))}}const B=Pe.createElement("div",{key:"toolbar",ref:a,className:E(ke.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR)+" "+E(ke.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_+e.getLocation().getName())},L);T=t.styleFont(T);let Y={};const j=e.getBorderBarSize()-1;return e.getLocation()===er.DockLocation.LEFT?Y={right:j,height:j,top:h}:e.getLocation()===er.DockLocation.RIGHT?Y={left:j,height:j,top:h}:Y={height:j,left:h},Pe.createElement("div",{ref:m,dir:"ltr",style:T,className:O,"data-layout-path":s,onClick:u,onAuxClick:u,onContextMenu:p,onWheel:l},Pe.createElement("div",{style:{height:j},className:E(ke.CLASSES.FLEXLAYOUT__BORDER_INNER)+" "+E(ke.CLASSES.FLEXLAYOUT__BORDER_INNER_+e.getLocation().getName())},Pe.createElement("div",{style:Y,className:E(ke.CLASSES.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER)+" "+E(ke.CLASSES.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_+e.getLocation().getName())},w)),B)};to.BorderTabSet=Va;var so={};Object.defineProperty(so,"__esModule",{value:!0}),so.Splitter=void 0;const Rn=A,or=Yt,ir=Ze,rr=vt(),xt=Ce,An=Le,$a=n=>{const{layout:e,node:t,path:o}=n,i=Rn.useRef([]),r=Rn.useRef(void 0),s=t.getParent(),a=y=>{var S;or.DragDrop.instance.setGlassCursorOverride(t.getOrientation()===xt.Orientation.HORZ?"ns-resize":"ew-resize"),or.DragDrop.instance.startDrag(y,f,m,b,c,void 0,void 0,e.getCurrentDocument(),(S=e.getRootDiv())!==null&&S!==void 0?S:void 0),i.current=s._getSplitterBounds(t,!0);const x=e.getRootDiv();r.current=e.getCurrentDocument().createElement("div"),r.current.style.position="absolute",r.current.className=e.getClassName(An.CLASSES.FLEXLAYOUT__SPLITTER_DRAG),r.current.style.cursor=t.getOrientation()===xt.Orientation.HORZ?"ns-resize":"ew-resize";const E=t.getRect();t.getOrientation()===xt.Orientation.VERT&&E.width<2?E.width=2:t.getOrientation()===xt.Orientation.HORZ&&E.height<2&&(E.height=2),E.positionElement(r.current),x&&x.appendChild(r.current)},c=y=>{const S=e.getRootDiv();S&&S.removeChild(r.current)},f=()=>!0,m=y=>{const S=e.getDomRect();if(!S)return;const x={x:y.clientX-S.left,y:y.clientY-S.top};r&&(t.getOrientation()===xt.Orientation.HORZ?r.current.style.top=d(x.y-4)+"px":r.current.style.left=d(x.x-4)+"px"),e.isRealtimeResize()&&h()},h=()=>{let y=0;if(r&&(t.getOrientation()===xt.Orientation.HORZ?y=r.current.offsetTop:y=r.current.offsetLeft),s instanceof rr.BorderNode){const S=s._calculateSplit(t,y);e.doAction(ir.Actions.adjustBorderSplit(t.getParent().getId(),S))}else{const S=s._calculateSplit(t,y);S!==void 0&&e.doAction(ir.Actions.adjustSplit(S))}},b=()=>{h();const y=e.getRootDiv();y&&y.removeChild(r.current)},d=y=>{const S=i.current;let x=y;return y<S[0]&&(x=S[0]),y>S[1]&&(x=S[1]),x},l=e.getClassName;let g=t.getRect();const u=g.styleWithPosition({cursor:t.getOrientation()===xt.Orientation.HORZ?"ns-resize":"ew-resize"});let p=l(An.CLASSES.FLEXLAYOUT__SPLITTER)+" "+l(An.CLASSES.FLEXLAYOUT__SPLITTER_+t.getOrientation().getName());s instanceof rr.BorderNode?p+=" "+l(An.CLASSES.FLEXLAYOUT__SPLITTER_BORDER):t.getModel().getMaximizedTabset()!==void 0&&(u.display="none");const _=t.getModel().getSplitterExtra();if(_===0)return Rn.createElement("div",{style:u,"data-layout-path":o,className:p,onTouchStart:a,onMouseDown:a});{let y=g.clone();y.x=0,y.y=0,t.getOrientation()===xt.Orientation.VERT?y.width+=_:y.height+=_;const S=y.styleWithPosition({cursor:t.getOrientation()===xt.Orientation.HORZ?"ns-resize":"ew-resize"}),x=l(An.CLASSES.FLEXLAYOUT__SPLITTER_EXTRA);return Rn.createElement("div",{style:u,"data-layout-path":o,className:p},Rn.createElement("div",{style:S,className:x,onTouchStart:a,onMouseDown:a}))}};so.Splitter=$a;var ao={},On={};Object.defineProperty(On,"__esModule",{value:!0}),On.ErrorBoundary=void 0;const Vo=A,sr=Le;class Ja extends Vo.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.debug(e),console.debug(t)}render(){return this.state.hasError?Vo.createElement("div",{className:sr.CLASSES.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER},Vo.createElement("div",{className:sr.CLASSES.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT},this.props.message)):this.props.children}}On.ErrorBoundary=Ja,Object.defineProperty(ao,"__esModule",{value:!0}),ao.Tab=void 0;const Nn=A,Za=A,qa=Ze,ar=Ct(),$o=Le,Ka=On,Qa=yt,el=vt(),lr=We,tl=n=>{const{layout:e,selected:t,node:o,factory:i,path:r}=n,[s,a]=Nn.useState(!n.node.isEnableRenderOnDemand()||n.selected);Nn.useLayoutEffect(()=>{!s&&t&&a(!0)});const c=()=>{const g=o.getParent();g.getType()===ar.TabSetNode.TYPE&&(g.isActive()||e.doAction(qa.Actions.setActiveTabset(g.getId())))},f=e.getClassName,m=o.getModel().isUseVisibility(),h=o.getParent(),b=o._styleWithPosition();t||(0,lr.hideElement)(b,m),h instanceof ar.TabSetNode&&o.getModel().getMaximizedTabset()!==void 0&&!h.isMaximized()&&(0,lr.hideElement)(b,m);let d;s&&(d=i(o));let l=f($o.CLASSES.FLEXLAYOUT__TAB);return h instanceof el.BorderNode&&(l+=" "+f($o.CLASSES.FLEXLAYOUT__TAB_BORDER),l+=" "+f($o.CLASSES.FLEXLAYOUT__TAB_BORDER_+h.getLocation().getName())),o.getContentClassName()!==void 0&&(l+=" "+o.getContentClassName()),Nn.createElement("div",{className:l,"data-layout-path":r,onMouseDown:c,onTouchStart:c,style:b},Nn.createElement(Ka.ErrorBoundary,{message:n.layout.i18nName(Qa.I18nLabel.Error_rendering_component)},Nn.createElement(Za.Fragment,null,d)))};ao.Tab=tl;var lo={},co={};Object.defineProperty(co,"__esModule",{value:!0}),co.TabButton=void 0;const It=A,nl=yt,Jo=Ze,ol=Me,dr=oo,sn=Le,Zo=We,il=n=>{const{layout:e,node:t,selected:o,iconFactory:i,titleFactory:r,icons:s,path:a}=n,c=It.useRef(null),f=It.useRef(null),m=B=>{!(0,Zo.isAuxMouseEvent)(B)&&!e.getEditingTab()&&e.dragStart(B,void 0,t,t.isEnableDrag(),d,l)},h=B=>{(0,Zo.isAuxMouseEvent)(B)&&e.auxMouseClick(t,B)},b=B=>{e.showContextMenu(t,B)},d=()=>{e.doAction(Jo.Actions.selectTab(t.getId()))},l=B=>{t.isEnableRename()&&g()},g=()=>{e.setEditingTab(t),e.getCurrentDocument().body.addEventListener("mousedown",u),e.getCurrentDocument().body.addEventListener("touchstart",u)},u=B=>{B.target!==f.current&&(e.getCurrentDocument().body.removeEventListener("mousedown",u),e.getCurrentDocument().body.removeEventListener("touchstart",u),e.setEditingTab(void 0))},p=()=>{const B=t.getCloseType();return!!(o||B===dr.ICloseType.Always||B===dr.ICloseType.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches)},_=B=>{p()?e.doAction(Jo.Actions.deleteTab(t.getId())):d()},y=B=>{B.stopPropagation()};It.useLayoutEffect(()=>{S(),e.getEditingTab()===t&&f.current.select()});const S=()=>{var B;const Y=e.getDomRect(),j=(B=c.current)===null||B===void 0?void 0:B.getBoundingClientRect();j&&Y&&t._setTabRect(new ol.Rect(j.left-Y.left,j.top-Y.top,j.width,j.height))},x=B=>{B.stopPropagation()},E=B=>{B.code==="Escape"?e.setEditingTab(void 0):B.code==="Enter"&&(e.setEditingTab(void 0),e.doAction(Jo.Actions.renameTab(t.getId(),B.target.value)))},T=e.getClassName,w=t.getParent(),C=w.isEnableSingleTabStretch()&&w.getChildren().length===1;let O=C?sn.CLASSES.FLEXLAYOUT__TAB_BUTTON_STRETCH:sn.CLASSES.FLEXLAYOUT__TAB_BUTTON,L=T(O);L+=" "+T(O+"_"+w.getTabLocation()),C||(o?L+=" "+T(O+"--selected"):L+=" "+T(O+"--unselected")),t.getClassName()!==void 0&&(L+=" "+t.getClassName());const R=(0,Zo.getRenderStateEx)(e,t,i,r);let F=R.content?It.createElement("div",{className:T(sn.CLASSES.FLEXLAYOUT__TAB_BUTTON_CONTENT)},R.content):null;const k=R.leading?It.createElement("div",{className:T(sn.CLASSES.FLEXLAYOUT__TAB_BUTTON_LEADING)},R.leading):null;if(e.getEditingTab()===t&&(F=It.createElement("input",{ref:f,className:T(sn.CLASSES.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":a+"/textbox",type:"text",autoFocus:!0,defaultValue:t.getName(),onKeyDown:E,onMouseDown:x,onTouchStart:x})),t.isEnableClose()&&!C){const B=e.i18nName(nl.I18nLabel.Close_Tab);R.buttons.push(It.createElement("div",{key:"close","data-layout-path":a+"/button/close",title:B,className:T(sn.CLASSES.FLEXLAYOUT__TAB_BUTTON_TRAILING),onMouseDown:y,onClick:_,onTouchStart:y},typeof s.close=="function"?s.close(t):s.close))}return It.createElement("div",{ref:c,"data-layout-path":a,className:L,onMouseDown:m,onClick:h,onAuxClick:h,onContextMenu:b,onTouchStart:m,title:t.getHelpText()},k,F,R.buttons)};co.TabButton=il,Object.defineProperty(lo,"__esModule",{value:!0}),lo.TabSet=void 0;const me=A,Vt=yt,Cn=Ze,rl=En,sl=co,al=wn,ll=Ce,_e=Le,qo=We,dl=n=>{const{node:e,layout:t,iconFactory:o,titleFactory:i,icons:r,path:s}=n,a=me.useRef(null),c=me.useRef(null),f=me.useRef(null),m=me.useRef(null),{selfRef:h,position:b,userControlledLeft:d,hiddenTabs:l,onMouseWheel:g,tabsTruncated:u}=(0,al.useTabOverflow)(e,ll.Orientation.HORZ,a,m),p=P=>{const Z=t.getShowOverflowMenu();if(Z!==void 0)Z(e,P,l,_);else{const de=c.current;(0,rl.showPopup)(de,l,_,t,o,i)}P.stopPropagation()},_=P=>{t.doAction(Cn.Actions.selectTab(P.node.getId())),d.current=!1},y=P=>{if(!(0,qo.isAuxMouseEvent)(P)){let Z=e.getName();if(Z===void 0?Z="":Z=": "+Z,t.doAction(Cn.Actions.setActiveTabset(e.getId())),!t.getEditingTab()){const de=t.i18nName(Vt.I18nLabel.Move_Tabset,Z);e.getModel().getMaximizedTabset()!==void 0?t.dragStart(P,de,e,!1,Ae=>{},L):t.dragStart(P,de,e,e.isEnableDrag(),Ae=>{},L)}}},S=P=>{(0,qo.isAuxMouseEvent)(P)&&t.auxMouseClick(e,P)},x=P=>{t.showContextMenu(e,P)},E=P=>{P.stopPropagation()},T=P=>{e.canMaximize()&&t.maximize(e),P.stopPropagation()},w=P=>{t.doAction(Cn.Actions.deleteTabset(e.getId())),P.stopPropagation()},C=P=>{t.doAction(Cn.Actions.deleteTab(e.getChildren()[0].getId())),P.stopPropagation()},O=P=>{F!==void 0&&t.doAction(Cn.Actions.floatTab(F.getId())),P.stopPropagation()},L=P=>{e.canMaximize()&&t.maximize(e)},R=t.getClassName;f.current!==null&&f.current.scrollLeft!==0&&(f.current.scrollLeft=0);const F=e.getSelectedNode();let k=e._styleWithPosition();e.getModel().getMaximizedTabset()!==void 0&&!e.isMaximized()&&(0,qo.hideElement)(k,e.getModel().isUseVisibility());const B=[];if(e.isEnableTabStrip())for(let P=0;P<e.getChildren().length;P++){const Z=e.getChildren()[P];let de=e.getSelected()===P;B.push(me.createElement(sl.TabButton,{layout:t,node:Z,path:s+"/tb"+P,key:Z.getId(),selected:de,iconFactory:o,titleFactory:i,icons:r})),P<e.getChildren().length-1&&B.push(me.createElement("div",{key:"divider"+P,className:R(_e.CLASSES.FLEXLAYOUT__TABSET_TAB_DIVIDER)}))}const Y=e.getName()!==void 0;let j=[],z=[],V=[];const ae={headerContent:e.getName(),stickyButtons:j,buttons:z,headerButtons:V,overflowPosition:void 0};t.customizeTabSet(e,ae);const N=ae.headerContent;j=ae.stickyButtons,z=ae.buttons,V=ae.headerButtons;const W=e.isEnableSingleTabStretch()&&e.getChildren().length===1,oe=W&&e.getChildren()[0].isEnableClose()||e.isEnableClose();if(ae.overflowPosition===void 0&&(ae.overflowPosition=j.length),j.length>0&&(u||W?z=[...j,...z]:B.push(me.createElement("div",{ref:m,key:"sticky_buttons_container",onMouseDown:E,onTouchStart:E,onDragStart:P=>{P.preventDefault()},className:R(_e.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER)},j))),l.length>0){const P=t.i18nName(Vt.I18nLabel.Overflow_Menu_Tooltip);let Z;typeof r.more=="function"?Z=r.more(e,l):Z=me.createElement(me.Fragment,null,r.more,me.createElement("div",{className:R(_e.CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT)},l.length)),z.splice(Math.min(ae.overflowPosition,z.length),0,me.createElement("button",{key:"overflowbutton","data-layout-path":s+"/button/overflow",ref:c,className:R(_e.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+R(_e.CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW),title:P,onClick:p,onMouseDown:E,onTouchStart:E},Z))}if(F!==void 0&&t.isSupportsPopout()&&F.isEnableFloat()&&!F.isFloating()){const P=t.i18nName(Vt.I18nLabel.Float_Tab);z.push(me.createElement("button",{key:"float","data-layout-path":s+"/button/float",title:P,className:R(_e.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+R(_e.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT),onClick:O,onMouseDown:E,onTouchStart:E},typeof r.popout=="function"?r.popout(F):r.popout))}if(e.canMaximize()){const P=t.i18nName(Vt.I18nLabel.Restore),Z=t.i18nName(Vt.I18nLabel.Maximize);(Y?V:z).push(me.createElement("button",{key:"max","data-layout-path":s+"/button/max",title:e.isMaximized()?P:Z,className:R(_e.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+R(_e.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_+(e.isMaximized()?"max":"min")),onClick:T,onMouseDown:E,onTouchStart:E},e.isMaximized()?typeof r.restore=="function"?r.restore(e):r.restore:typeof r.maximize=="function"?r.maximize(e):r.maximize))}if(!e.isMaximized()&&oe){const P=W?t.i18nName(Vt.I18nLabel.Close_Tab):t.i18nName(Vt.I18nLabel.Close_Tabset);(Y?V:z).push(me.createElement("button",{key:"close","data-layout-path":s+"/button/close",title:P,className:R(_e.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+R(_e.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE),onClick:W?C:w,onMouseDown:E,onTouchStart:E},typeof r.closeTabset=="function"?r.closeTabset(e):r.closeTabset))}const he=me.createElement("div",{key:"toolbar",ref:a,className:R(_e.CLASSES.FLEXLAYOUT__TAB_TOOLBAR),onMouseDown:E,onTouchStart:E,onDragStart:P=>{P.preventDefault()}},z);let $e,Je,re=R(_e.CLASSES.FLEXLAYOUT__TABSET_TABBAR_OUTER);if(e.getClassNameTabStrip()!==void 0&&(re+=" "+e.getClassNameTabStrip()),re+=" "+_e.CLASSES.FLEXLAYOUT__TABSET_TABBAR_OUTER_+e.getTabLocation(),e.isActive()&&!Y&&(re+=" "+R(_e.CLASSES.FLEXLAYOUT__TABSET_SELECTED)),e.isMaximized()&&!Y&&(re+=" "+R(_e.CLASSES.FLEXLAYOUT__TABSET_MAXIMIZED)),W){const P=e.getChildren()[0];P.getTabSetClassName()!==void 0&&(re+=" "+P.getTabSetClassName())}if(Y){const P=me.createElement("div",{key:"toolbar",ref:a,className:R(_e.CLASSES.FLEXLAYOUT__TAB_TOOLBAR),onMouseDown:E,onTouchStart:E,onDragStart:de=>{de.preventDefault()}},V);let Z=R(_e.CLASSES.FLEXLAYOUT__TABSET_HEADER);e.isActive()&&(Z+=" "+R(_e.CLASSES.FLEXLAYOUT__TABSET_SELECTED)),e.isMaximized()&&(Z+=" "+R(_e.CLASSES.FLEXLAYOUT__TABSET_MAXIMIZED)),e.getClassNameHeader()!==void 0&&(Z+=" "+e.getClassNameHeader()),$e=me.createElement("div",{className:Z,style:{height:e.getHeaderHeight()+"px"},"data-layout-path":s+"/header",onMouseDown:y,onContextMenu:x,onClick:S,onAuxClick:S,onTouchStart:y},me.createElement("div",{className:R(_e.CLASSES.FLEXLAYOUT__TABSET_HEADER_CONTENT)},N),P)}const M={height:e.getTabStripHeight()+"px"};Je=me.createElement("div",{className:re,style:M,"data-layout-path":s+"/tabstrip",onMouseDown:y,onContextMenu:x,onClick:S,onAuxClick:S,onTouchStart:y},me.createElement("div",{ref:f,className:R(_e.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER)+" "+R(_e.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_+e.getTabLocation())},me.createElement("div",{style:{left:b,width:W?"100%":"10000px"},className:R(_e.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER)+" "+R(_e.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_+e.getTabLocation())},B)),he),k=t.styleFont(k);var te=void 0;if(e.getChildren().length===0){const P=t.getTabSetPlaceHolderCallback();P&&(te=P(e))}const fe=me.createElement("div",{className:R(_e.CLASSES.FLEXLAYOUT__TABSET_CONTENT)},te);var we;return e.getTabLocation()==="top"?we=me.createElement(me.Fragment,null,$e,Je,fe):we=me.createElement(me.Fragment,null,$e,fe,Je),me.createElement("div",{ref:h,dir:"ltr","data-layout-path":s,style:k,className:R(_e.CLASSES.FLEXLAYOUT__TABSET),onWheel:g},we)};lo.TabSet=dl;var uo={};Object.defineProperty(uo,"__esModule",{value:!0}),uo.FloatingWindow=void 0;const ho=A,cl=At,ul=Me,hl=Le,fl=n=>{const{title:e,id:t,url:o,rect:i,onCloseWindow:r,onSetWindow:s,children:a}=n,c=ho.useRef(null),f=ho.useRef(null),[m,h]=ho.useState(void 0);return ho.useLayoutEffect(()=>{f.current&&clearTimeout(f.current);let b=!0;const d=i||new ul.Rect(0,0,100,100),l=Array.from(window.document.styleSheets).reduce((g,u)=>{let p;try{p=u.cssRules}catch{}try{return[...g,{href:u.href,type:u.type,rules:p?Array.from(p).map(_=>_.cssText):null}]}catch{return g}},[]);return c.current=window.open(o,t,`left=${d.x},top=${d.y},width=${d.width},height=${d.height}`),c.current!==null?(s(t,c.current),window.addEventListener("beforeunload",()=>{c.current&&(c.current.close(),c.current=null)}),c.current.addEventListener("load",()=>{if(b){const g=c.current.document;g.title=e;const u=g.createElement("div");u.className=hl.CLASSES.FLEXLAYOUT__FLOATING_WINDOW_CONTENT,g.body.appendChild(u),gl(g,l).then(()=>{h(u)}),c.current.addEventListener("beforeunload",()=>{r(t)})}})):(console.warn(`Unable to open window ${o}`),r(t)),()=>{b=!1,f.current=setTimeout(()=>{c.current&&(c.current.close(),c.current=null)},0)}},[]),m!==void 0?(0,cl.createPortal)(a,m):null};uo.FloatingWindow=fl;function gl(n,e){const t=n.head,o=[];for(const i of e)if(i.href){const r=n.createElement("link");r.type=i.type,r.rel="stylesheet",r.href=i.href,t.appendChild(r),o.push(new Promise(s=>{r.onload=()=>s(!0)}))}else if(i.rules){const r=n.createElement("style");for(const s of i.rules)r.appendChild(n.createTextNode(s));t.appendChild(r)}return Promise.all(o)}var fo={};Object.defineProperty(fo,"__esModule",{value:!0}),fo.FloatingWindowTab=void 0;const Ko=A,pl=On,ml=yt,_l=A,bl=Le,Tl=n=>{const{layout:e,node:t,factory:o}=n,i=e.getClassName,r=o(t);return Ko.createElement("div",{className:i(bl.CLASSES.FLEXLAYOUT__FLOATING_WINDOW_TAB)},Ko.createElement(pl.ErrorBoundary,{message:n.layout.i18nName(ml.I18nLabel.Error_rendering_component)},Ko.createElement(_l.Fragment,null,r)))};fo.FloatingWindowTab=Tl;var go={};Object.defineProperty(go,"__esModule",{value:!0}),go.TabFloating=void 0;const Bt=A,cr=Ze,ur=Ct(),Qo=Le,ei=yt,hr=We,vl=n=>{const{layout:e,selected:t,node:o,path:i}=n,r=()=>{o.getWindow()&&o.getWindow().focus()},s=()=>{e.doAction(cr.Actions.unFloatTab(o.getId()))},a=()=>{const p=o.getParent();p.getType()===ur.TabSetNode.TYPE&&(p.isActive()||e.doAction(cr.Actions.setActiveTabset(p.getId())))},c=p=>{p.preventDefault(),r()},f=p=>{p.preventDefault(),s()},m=e.getClassName,h=o.getParent(),b=o._styleWithPosition();t||(0,hr.hideElement)(b,o.getModel().isUseVisibility()),h instanceof ur.TabSetNode&&o.getModel().getMaximizedTabset()!==void 0&&!h.isMaximized()&&(0,hr.hideElement)(b,o.getModel().isUseVisibility());const d=e.i18nName(ei.I18nLabel.Floating_Window_Message),l=e.i18nName(ei.I18nLabel.Floating_Window_Show_Window),g=e.i18nName(ei.I18nLabel.Floating_Window_Dock_Window),u=e.getOnRenderFloatingTabPlaceholder();return u?Bt.createElement("div",{className:m(Qo.CLASSES.FLEXLAYOUT__TAB_FLOATING),onMouseDown:a,onTouchStart:a,style:b},u(s,r)):Bt.createElement("div",{className:m(Qo.CLASSES.FLEXLAYOUT__TAB_FLOATING),"data-layout-path":i,onMouseDown:a,onTouchStart:a,style:b},Bt.createElement("div",{className:m(Qo.CLASSES.FLEXLAYOUT__TAB_FLOATING_INNER)},Bt.createElement("div",null,d),Bt.createElement("div",null,Bt.createElement("a",{href:"#",onClick:c},l)),Bt.createElement("div",null,Bt.createElement("a",{href:"#",onClick:f},g))))};go.TabFloating=vl;var Ye={};Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.RestoreIcon=Ye.PopoutIcon=Ye.EdgeIcon=Ye.OverflowIcon=Ye.MaximizeIcon=Ye.CloseIcon=void 0;const Ie=A,Ln={width:"1em",height:"1em",display:"flex",alignItems:"center"},yl=()=>Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:Ln,viewBox:"0 0 24 24"},Ie.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),Ie.createElement("path",{stroke:"var(--color-icon)",fill:"var(--color-icon)",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));Ye.CloseIcon=yl;const xl=()=>Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:Ln,viewBox:"0 0 24 24",fill:"var(--color-icon)"},Ie.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),Ie.createElement("path",{stroke:"var(--color-icon)",d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}));Ye.MaximizeIcon=xl;const El=()=>Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:Ln,viewBox:"0 0 24 24",fill:"var(--color-icon)"},Ie.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),Ie.createElement("path",{stroke:"var(--color-icon)",d:"M7 10l5 5 5-5z"}));Ye.OverflowIcon=El;const Sl=()=>Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{display:"block",width:10,height:10},preserveAspectRatio:"none",viewBox:"0 0 100 100"},Ie.createElement("path",{fill:"var(--color-edge-icon)",stroke:"var(--color-edge-icon)",d:"M10 30 L90 30 l-40 40 Z"}));Ye.EdgeIcon=Sl;const wl=()=>Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:Ln,viewBox:"0 0 20 20",fill:"var(--color-icon)"},Ie.createElement("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),Ie.createElement("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"}));Ye.PopoutIcon=wl;const Rl=()=>Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:Ln,viewBox:"0 0 24 24",fill:"var(--color-icon)"},Ie.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),Ie.createElement("path",{stroke:"var(--color-icon)",d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}));Ye.RestoreIcon=Rl,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.Layout=void 0;const $=A,Al=At,lt=rt,Mt=Yt,an=Ze,Ol=vt(),fr=Gt,kt=Nt,gr=Ct(),po=Me,Xe=Le,Nl=to,pr=so,mr=ao,Cl=lo,_r=uo,br=fo,Tr=go,ti=Ce,$t=Ye,Ll=Sn,Dl={close:$.createElement($t.CloseIcon,null),closeTabset:$.createElement($t.CloseIcon,null),popout:$.createElement($t.PopoutIcon,null),maximize:$.createElement($t.MaximizeIcon,null),restore:$.createElement($t.RestoreIcon,null),more:$.createElement($t.OverflowIcon,null),edgeArrow:$.createElement($t.EdgeIcon,null)},Il=typeof window<"u"&&(window.document.documentMode||/Edge\//.test(window.navigator.userAgent)),Bl=typeof window<"u"&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches&&!Il;class Ml extends $.Component{constructor(e){super(e),this.firstMove=!1,this.dragRectRendered=!0,this.dragDivText=void 0,this.edgeRectLength=100,this.edgeRectWidth=10,this.onModelChange=t=>{this.forceUpdate(),this.props.onModelChange&&this.props.onModelChange(this.props.model,t)},this.updateRect=t=>{if(t||(t=this.getDomRect()),!t)return;const o=new po.Rect(0,0,t.width,t.height);!o.equals(this.state.rect)&&o.width!==0&&o.height!==0&&this.setState({rect:o})},this.updateLayoutMetrics=()=>{if(this.findHeaderBarSizeRef.current){const t=this.findHeaderBarSizeRef.current.getBoundingClientRect().height;t!==this.state.calculatedHeaderBarSize&&this.setState({calculatedHeaderBarSize:t})}if(this.findTabBarSizeRef.current){const t=this.findTabBarSizeRef.current.getBoundingClientRect().height;t!==this.state.calculatedTabBarSize&&this.setState({calculatedTabBarSize:t})}if(this.findBorderBarSizeRef.current){const t=this.findBorderBarSizeRef.current.getBoundingClientRect().height;t!==this.state.calculatedBorderBarSize&&this.setState({calculatedBorderBarSize:t})}},this.getClassName=t=>this.props.classNameMapper===void 0?t:this.props.classNameMapper(t),this.onCloseWindow=t=>{this.doAction(an.Actions.unFloatTab(t));try{this.props.model.getNodeById(t)._setWindow(void 0)}catch{}},this.onSetWindow=(t,o)=>{this.props.model.getNodeById(t)._setWindow(o)},this.onCancelAdd=()=>{var t,o;const i=this.selfRef.current;i&&this.dragDiv&&i.removeChild(this.dragDiv),this.dragDiv=void 0,this.hidePortal(),this.fnNewNodeDropped!=null&&(this.fnNewNodeDropped(),this.fnNewNodeDropped=void 0);try{(o=(t=this.customDrop)===null||t===void 0?void 0:t.invalidated)===null||o===void 0||o.call(t)}catch(r){console.error(r)}Mt.DragDrop.instance.hideGlass(),this.newTabJson=void 0,this.customDrop=void 0},this.onCancelDrag=t=>{var o,i;if(t){const r=this.selfRef.current,s=this.outlineDiv;if(r&&s)try{r.removeChild(s)}catch{}const a=this.dragDiv;if(r&&a)try{r.removeChild(a)}catch{}this.dragDiv=void 0,this.hidePortal(),this.setState({showEdges:!1}),this.fnNewNodeDropped!=null&&(this.fnNewNodeDropped(),this.fnNewNodeDropped=void 0);try{(i=(o=this.customDrop)===null||o===void 0?void 0:o.invalidated)===null||i===void 0||i.call(o)}catch(c){console.error(c)}Mt.DragDrop.instance.hideGlass(),this.newTabJson=void 0,this.customDrop=void 0}this.setState({showHiddenBorder:lt.DockLocation.CENTER})},this.onDragDivMouseDown=t=>{t.preventDefault(),this.dragStart(t,this.dragDivText,kt.TabNode._fromJson(this.newTabJson,this.props.model,!1),!0,void 0,void 0)},this.dragStart=(t,o,i,r,s,a)=>{var c,f;r?(this.dragNode=i,this.dragDivText=o,Mt.DragDrop.instance.startDrag(t,this.onDragStart,this.onDragMove,this.onDragEnd,this.onCancelDrag,s,a,this.currentDocument,(f=this.selfRef.current)!==null&&f!==void 0?f:void 0)):Mt.DragDrop.instance.startDrag(t,void 0,void 0,void 0,void 0,s,a,this.currentDocument,(c=this.selfRef.current)!==null&&c!==void 0?c:void 0)},this.dragRectRender=(t,o,i,r)=>{let s;if(t!==void 0?s=$.createElement("div",{style:{whiteSpace:"pre"}},t.replace("<br>",`
|
|
24
|
-
`)):o&&o instanceof kt.TabNode&&(s=$.createElement(Ll.TabButtonStamp,{node:o,layout:this,iconFactory:this.props.iconFactory,titleFactory:this.props.titleFactory})),this.props.onRenderDragRect!==void 0){const c=this.props.onRenderDragRect(s,o,i);c!==void 0&&(s=c)}this.dragRectRendered=!1;const a=this.dragDiv;a&&(a.style.visibility="hidden",this.showPortal($.createElement(kl,{onRendered:()=>{this.dragRectRendered=!0,r==null||r()}},s),a))},this.showPortal=(t,o)=>{const i=(0,Al.createPortal)(t,o);this.setState({portal:i})},this.hidePortal=()=>{this.setState({portal:void 0})},this.onDragStart=()=>{var t;this.dropInfo=void 0,this.customDrop=void 0;const o=this.selfRef.current;return this.outlineDiv=this.currentDocument.createElement("div"),this.outlineDiv.className=this.getClassName(Xe.CLASSES.FLEXLAYOUT__OUTLINE_RECT),this.outlineDiv.style.visibility="hidden",o&&o.appendChild(this.outlineDiv),this.dragDiv==null&&(this.dragDiv=this.currentDocument.createElement("div"),this.dragDiv.className=this.getClassName(Xe.CLASSES.FLEXLAYOUT__DRAG_RECT),this.dragDiv.setAttribute("data-layout-path","/drag-rectangle"),this.dragRectRender(this.dragDivText,this.dragNode,this.newTabJson),o&&o.appendChild(this.dragDiv)),this.props.model.getMaximizedTabset()===void 0&&this.setState({showEdges:this.props.model.isEnableEdgeDock()}),this.dragNode&&this.outlineDiv&&this.dragNode instanceof kt.TabNode&&this.dragNode.getTabRect()!==void 0&&((t=this.dragNode.getTabRect())===null||t===void 0||t.positionElement(this.outlineDiv)),this.firstMove=!0,!0},this.onDragMove=t=>{var o,i,r,s,a,c,f;if(this.firstMove===!1){const g=this.props.model._getAttribute("tabDragSpeed");this.outlineDiv&&(this.outlineDiv.style.transition=`top ${g}s, left ${g}s, width ${g}s, height ${g}s`)}this.firstMove=!1;const m=(o=this.selfRef.current)===null||o===void 0?void 0:o.getBoundingClientRect(),h={x:t.clientX-((i=m==null?void 0:m.left)!==null&&i!==void 0?i:0),y:t.clientY-((r=m==null?void 0:m.top)!==null&&r!==void 0?r:0)};this.checkForBorderToShow(h.x,h.y);const b=(a=(s=this.dragDiv)===null||s===void 0?void 0:s.getBoundingClientRect())!==null&&a!==void 0?a:new DOMRect(0,0,100,100);let d=h.x-b.width/2;d+b.width>((c=m==null?void 0:m.width)!==null&&c!==void 0?c:0)&&(d=((f=m==null?void 0:m.width)!==null&&f!==void 0?f:0)-b.width),d=Math.max(0,d),this.dragDiv&&(this.dragDiv.style.left=d+"px",this.dragDiv.style.top=h.y+5+"px",this.dragRectRendered&&this.dragDiv.style.visibility==="hidden"&&(this.dragDiv.style.visibility="visible"));let l=this.props.model._findDropTargetNode(this.dragNode,h.x,h.y);l&&(this.props.onTabDrag?this.handleCustomTabDrag(l,h,t):(this.dropInfo=l,this.outlineDiv&&(this.outlineDiv.className=this.getClassName(l.className),l.rect.positionElement(this.outlineDiv),this.outlineDiv.style.visibility="visible")))},this.onDragEnd=t=>{const o=this.selfRef.current;if(o&&(this.outlineDiv&&o.removeChild(this.outlineDiv),this.dragDiv&&o.removeChild(this.dragDiv)),this.dragDiv=void 0,this.hidePortal(),this.setState({showEdges:!1}),Mt.DragDrop.instance.hideGlass(),this.dropInfo)if(this.customDrop){this.newTabJson=void 0;try{const{callback:i,dragging:r,over:s,x:a,y:c,location:f}=this.customDrop;i(r,s,a,c,f),this.fnNewNodeDropped!=null&&(this.fnNewNodeDropped(),this.fnNewNodeDropped=void 0)}catch(i){console.error(i)}}else if(this.newTabJson!==void 0){const i=this.doAction(an.Actions.addNode(this.newTabJson,this.dropInfo.node.getId(),this.dropInfo.location,this.dropInfo.index));this.fnNewNodeDropped!=null&&(this.fnNewNodeDropped(i,t),this.fnNewNodeDropped=void 0),this.newTabJson=void 0}else this.dragNode!==void 0&&this.doAction(an.Actions.moveNode(this.dragNode.getId(),this.dropInfo.node.getId(),this.dropInfo.location,this.dropInfo.index));this.setState({showHiddenBorder:lt.DockLocation.CENTER})},this.props.model._setChangeListener(this.onModelChange),this.tabIds=[],this.selfRef=$.createRef(),this.findHeaderBarSizeRef=$.createRef(),this.findTabBarSizeRef=$.createRef(),this.findBorderBarSizeRef=$.createRef(),this.supportsPopout=e.supportsPopout!==void 0?e.supportsPopout:Bl,this.popoutURL=e.popoutURL?e.popoutURL:"popout.html",this.icons=Object.assign(Object.assign({},Dl),e.icons),this.state={rect:new po.Rect(0,0,0,0),calculatedHeaderBarSize:25,calculatedTabBarSize:26,calculatedBorderBarSize:30,editingTab:void 0,showHiddenBorder:lt.DockLocation.CENTER,showEdges:!1},this.onDragEnter=this.onDragEnter.bind(this)}styleFont(e){return this.props.font&&(this.selfRef.current&&(this.props.font.size&&this.selfRef.current.style.setProperty("--font-size",this.props.font.size),this.props.font.family&&this.selfRef.current.style.setProperty("--font-family",this.props.font.family)),this.props.font.style&&(e.fontStyle=this.props.font.style),this.props.font.weight&&(e.fontWeight=this.props.font.weight)),e}doAction(e){if(this.props.onAction!==void 0){const t=this.props.onAction(e);return t!==void 0?this.props.model.doAction(t):void 0}else return this.props.model.doAction(e)}componentDidMount(){this.updateRect(),this.updateLayoutMetrics(),this.currentDocument=this.selfRef.current.ownerDocument,this.currentWindow=this.currentDocument.defaultView,this.resizeObserver=new ResizeObserver(t=>{this.updateRect(t[0].contentRect)});const e=this.selfRef.current;e&&this.resizeObserver.observe(e)}componentDidUpdate(){this.updateLayoutMetrics(),this.props.model!==this.previousModel&&(this.previousModel!==void 0&&this.previousModel._setChangeListener(void 0),this.props.model._setChangeListener(this.onModelChange),this.previousModel=this.props.model)}getCurrentDocument(){return this.currentDocument}getDomRect(){var e;return(e=this.selfRef.current)===null||e===void 0?void 0:e.getBoundingClientRect()}getRootDiv(){return this.selfRef.current}isSupportsPopout(){return this.supportsPopout}isRealtimeResize(){var e;return(e=this.props.realtimeResize)!==null&&e!==void 0?e:!1}onTabDrag(...e){var t,o;return(o=(t=this.props).onTabDrag)===null||o===void 0?void 0:o.call(t,...e)}getPopoutURL(){return this.popoutURL}componentWillUnmount(){var e;const t=this.selfRef.current;t&&((e=this.resizeObserver)===null||e===void 0||e.unobserve(t))}setEditingTab(e){this.setState({editingTab:e})}getEditingTab(){return this.state.editingTab}render(){if(!this.selfRef.current)return $.createElement("div",{ref:this.selfRef,className:this.getClassName(Xe.CLASSES.FLEXLAYOUT__LAYOUT)},this.metricsElements());this.props.model._setPointerFine(window&&window.matchMedia&&window.matchMedia("(pointer: fine)").matches);const e=[],t=[],o=[],i={},r=[],s={headerBarSize:this.state.calculatedHeaderBarSize,tabBarSize:this.state.calculatedTabBarSize,borderBarSize:this.state.calculatedBorderBarSize};this.props.model._setShowHiddenBorder(this.state.showHiddenBorder),this.centerRect=this.props.model._layout(this.state.rect,s),this.renderBorder(this.props.model.getBorderSet(),e,i,o,r),this.renderChildren("",this.props.model.getRoot(),t,i,o,r);const a=[],c={};for(const h of this.tabIds)i[h]&&(a.push(h),c[h]=h);this.tabIds=a;for(const h of Object.keys(i))c[h]||this.tabIds.push(h);const f=[],m=this.icons.edgeArrow;if(this.state.showEdges){const h=this.centerRect,b=this.edgeRectLength,d=this.edgeRectWidth,l=this.edgeRectLength/2,g=this.getClassName(Xe.CLASSES.FLEXLAYOUT__EDGE_RECT),u=50;f.push($.createElement("div",{key:"North",style:{top:h.y,left:h.x+h.width/2-l,width:b,height:d,borderBottomLeftRadius:u,borderBottomRightRadius:u},className:g+" "+this.getClassName(Xe.CLASSES.FLEXLAYOUT__EDGE_RECT_TOP)},$.createElement("div",{style:{transform:"rotate(180deg)"}},m))),f.push($.createElement("div",{key:"West",style:{top:h.y+h.height/2-l,left:h.x,width:d,height:b,borderTopRightRadius:u,borderBottomRightRadius:u},className:g+" "+this.getClassName(Xe.CLASSES.FLEXLAYOUT__EDGE_RECT_LEFT)},$.createElement("div",{style:{transform:"rotate(90deg)"}},m))),f.push($.createElement("div",{key:"South",style:{top:h.y+h.height-d,left:h.x+h.width/2-l,width:b,height:d,borderTopLeftRadius:u,borderTopRightRadius:u},className:g+" "+this.getClassName(Xe.CLASSES.FLEXLAYOUT__EDGE_RECT_BOTTOM)},$.createElement("div",null,m))),f.push($.createElement("div",{key:"East",style:{top:h.y+h.height/2-l,left:h.x+h.width-d,width:d,height:b,borderTopLeftRadius:u,borderBottomLeftRadius:u},className:g+" "+this.getClassName(Xe.CLASSES.FLEXLAYOUT__EDGE_RECT_RIGHT)},$.createElement("div",{style:{transform:"rotate(-90deg)"}},m)))}return $.createElement("div",{ref:this.selfRef,className:this.getClassName(Xe.CLASSES.FLEXLAYOUT__LAYOUT),onDragEnter:this.props.onExternalDrag?this.onDragEnter:void 0},t,this.tabIds.map(h=>i[h]),e,r,f,o,this.metricsElements(),this.state.portal)}metricsElements(){const e=this.styleFont({visibility:"hidden"});return $.createElement($.Fragment,null,$.createElement("div",{key:"findHeaderBarSize",ref:this.findHeaderBarSizeRef,style:e,className:this.getClassName(Xe.CLASSES.FLEXLAYOUT__TABSET_HEADER_SIZER)},"FindHeaderBarSize"),$.createElement("div",{key:"findTabBarSize",ref:this.findTabBarSizeRef,style:e,className:this.getClassName(Xe.CLASSES.FLEXLAYOUT__TABSET_SIZER)},"FindTabBarSize"),$.createElement("div",{key:"findBorderBarSize",ref:this.findBorderBarSizeRef,style:e,className:this.getClassName(Xe.CLASSES.FLEXLAYOUT__BORDER_SIZER)},"FindBorderBarSize"))}renderBorder(e,t,o,i,r){for(const s of e.getBorders()){const a=`/border/${s.getLocation().getName()}`;if(s.isShowing()){t.push($.createElement(Nl.BorderTabSet,{key:`border_${s.getLocation().getName()}`,path:a,border:s,layout:this,iconFactory:this.props.iconFactory,titleFactory:this.props.titleFactory,icons:this.icons}));const c=s._getDrawChildren();let f=0,m=0;for(const h of c){if(h instanceof fr.SplitterNode){let b=a+"/s";r.push($.createElement(pr.Splitter,{key:h.getId(),layout:this,node:h,path:b}))}else if(h instanceof kt.TabNode){let b=a+"/t"+m++;if(this.supportsPopout&&h.isFloating()){const d=this._getScreenRect(h),l=h._getAttr("borderWidth"),g=h._getAttr("borderHeight");d&&(l!==-1&&s.getLocation().getOrientation()===ti.Orientation.HORZ?d.width=l:g!==-1&&s.getLocation().getOrientation()===ti.Orientation.VERT&&(d.height=g)),i.push($.createElement(_r.FloatingWindow,{key:h.getId(),url:this.popoutURL,rect:d,title:h.getName(),id:h.getId(),onSetWindow:this.onSetWindow,onCloseWindow:this.onCloseWindow},$.createElement(br.FloatingWindowTab,{layout:this,node:h,factory:this.props.factory}))),o[h.getId()]=$.createElement(Tr.TabFloating,{key:h.getId(),layout:this,path:b,node:h,selected:f===s.getSelected()})}else o[h.getId()]=$.createElement(mr.Tab,{key:h.getId(),layout:this,path:b,node:h,selected:f===s.getSelected(),factory:this.props.factory})}f++}}}}renderChildren(e,t,o,i,r,s){const a=t._getDrawChildren();let c=0,f=0,m=0;for(const h of a)if(h instanceof fr.SplitterNode){const b=e+"/s"+c++;s.push($.createElement(pr.Splitter,{key:h.getId(),layout:this,path:b,node:h}))}else if(h instanceof gr.TabSetNode){const b=e+"/ts"+m++;o.push($.createElement(Cl.TabSet,{key:h.getId(),layout:this,path:b,node:h,iconFactory:this.props.iconFactory,titleFactory:this.props.titleFactory,icons:this.icons})),this.renderChildren(b,h,o,i,r,s)}else if(h instanceof kt.TabNode){const b=e+"/t"+f++,d=h.getParent().getChildren()[h.getParent().getSelected()];if(d===void 0&&console.warn("undefined selectedTab should not happen"),this.supportsPopout&&h.isFloating()){const l=this._getScreenRect(h);r.push($.createElement(_r.FloatingWindow,{key:h.getId(),url:this.popoutURL,rect:l,title:h.getName(),id:h.getId(),onSetWindow:this.onSetWindow,onCloseWindow:this.onCloseWindow},$.createElement(br.FloatingWindowTab,{layout:this,node:h,factory:this.props.factory}))),i[h.getId()]=$.createElement(Tr.TabFloating,{key:h.getId(),layout:this,path:b,node:h,selected:h===d})}else i[h.getId()]=$.createElement(mr.Tab,{key:h.getId(),layout:this,path:b,node:h,selected:h===d,factory:this.props.factory})}else{const b=e+(h.getOrientation()===ti.Orientation.HORZ?"/r":"/c")+m++;this.renderChildren(b,h,o,i,r,s)}}_getScreenRect(e){var t;const o=e.getRect().clone(),i=(t=this.selfRef.current)===null||t===void 0?void 0:t.getBoundingClientRect();if(!i)return null;const r=Math.min(80,this.currentWindow.outerHeight-this.currentWindow.innerHeight),s=Math.min(80,this.currentWindow.outerWidth-this.currentWindow.innerWidth);return o.x=o.x+i.x+this.currentWindow.screenX+s,o.y=o.y+i.y+this.currentWindow.screenY+r,o}addTabToTabSet(e,t){if(this.props.model.getNodeById(e)!==void 0)return this.doAction(an.Actions.addNode(t,e,lt.DockLocation.CENTER,-1))}addTabToActiveTabSet(e){const t=this.props.model.getActiveTabset();if(t!==void 0)return this.doAction(an.Actions.addNode(e,t.getId(),lt.DockLocation.CENTER,-1))}addTabWithDragAndDrop(e,t,o){this.fnNewNodeDropped=o,this.newTabJson=t,this.dragStart(void 0,e,kt.TabNode._fromJson(t,this.props.model,!1),!0,void 0,void 0)}moveTabWithDragAndDrop(e,t){this.dragStart(void 0,t,e,!0,void 0,void 0)}addTabWithDragAndDropIndirect(e,t,o){this.fnNewNodeDropped=o,this.newTabJson=t,Mt.DragDrop.instance.addGlass(this.onCancelAdd),this.dragDivText=e,this.dragDiv=this.currentDocument.createElement("div"),this.dragDiv.className=this.getClassName(Xe.CLASSES.FLEXLAYOUT__DRAG_RECT),this.dragDiv.addEventListener("mousedown",this.onDragDivMouseDown),this.dragDiv.addEventListener("touchstart",this.onDragDivMouseDown,{passive:!1}),this.dragRectRender(this.dragDivText,void 0,this.newTabJson,()=>{if(this.dragDiv){this.dragDiv.style.visibility="visible";const r=this.dragDiv.getBoundingClientRect(),s=new po.Rect(0,0,r==null?void 0:r.width,r==null?void 0:r.height);s.centerInRect(this.state.rect),this.dragDiv.setAttribute("data-layout-path","/drag-rectangle"),this.dragDiv.style.left=s.x+"px",this.dragDiv.style.top=s.y+"px"}}),this.selfRef.current.appendChild(this.dragDiv)}handleCustomTabDrag(e,t,o){var i,r,s;let a=(i=this.customDrop)===null||i===void 0?void 0:i.invalidated;const c=(r=this.customDrop)===null||r===void 0?void 0:r.callback;this.customDrop=void 0;const f=this.newTabJson||(this.dragNode instanceof kt.TabNode?this.dragNode:void 0);if(f&&(e.node instanceof gr.TabSetNode||e.node instanceof Ol.BorderNode)&&e.index===-1){const m=e.node.getSelectedNode(),h=m==null?void 0:m.getRect();if(m&&(h!=null&&h.contains(t.x,t.y))){let b;try{const d=this.onTabDrag(f,m,t.x-h.x,t.y-h.y,e.location,()=>this.onDragMove(o));d&&(b={rect:new po.Rect(d.x+h.x,d.y+h.y,d.width,d.height),callback:d.callback,invalidated:d.invalidated,dragging:f,over:m,x:t.x-h.x,y:t.y-h.y,location:e.location,cursor:d.cursor})}catch(d){console.error(d)}(b==null?void 0:b.callback)===c&&(a=void 0),this.customDrop=b}}this.dropInfo=e,this.outlineDiv&&(this.outlineDiv.className=this.getClassName(this.customDrop?Xe.CLASSES.FLEXLAYOUT__OUTLINE_RECT:e.className),this.customDrop?this.customDrop.rect.positionElement(this.outlineDiv):e.rect.positionElement(this.outlineDiv)),Mt.DragDrop.instance.setGlassCursorOverride((s=this.customDrop)===null||s===void 0?void 0:s.cursor),this.outlineDiv&&(this.outlineDiv.style.visibility="visible");try{a==null||a()}catch(m){console.error(m)}}onDragEnter(e){if(Mt.DragDrop.instance.isDragging())return;const t=this.props.onExternalDrag(e);t&&(this.fnNewNodeDropped=t.onDrop,this.newTabJson=t.json,this.dragStart(e,t.dragText,kt.TabNode._fromJson(t.json,this.props.model,!1),!0,void 0,void 0))}checkForBorderToShow(e,t){const o=this.props.model._getOuterInnerRects().outer,i=o.getCenter(),r=this.edgeRectWidth,s=this.edgeRectLength/2;let a=!1;this.props.model.isEnableEdgeDock()&&this.state.showHiddenBorder===lt.DockLocation.CENTER&&(t>i.y-s&&t<i.y+s||e>i.x-s&&e<i.x+s)&&(a=!0);let c=lt.DockLocation.CENTER;a||(e<=o.x+r?c=lt.DockLocation.LEFT:e>=o.getRight()-r?c=lt.DockLocation.RIGHT:t<=o.y+r?c=lt.DockLocation.TOP:t>=o.getBottom()-r&&(c=lt.DockLocation.BOTTOM)),c!==this.state.showHiddenBorder&&this.setState({showHiddenBorder:c})}maximize(e){this.doAction(an.Actions.maximizeToggle(e.getId()))}customizeTab(e,t){this.props.onRenderTab&&this.props.onRenderTab(e,t)}customizeTabSet(e,t){this.props.onRenderTabSet&&this.props.onRenderTabSet(e,t)}i18nName(e,t){let o;return this.props.i18nMapper&&(o=this.props.i18nMapper(e,t)),o===void 0&&(o=e+(t===void 0?"":t)),o}getOnRenderFloatingTabPlaceholder(){return this.props.onRenderFloatingTabPlaceholder}getShowOverflowMenu(){return this.props.onShowOverflowMenu}getTabSetPlaceHolderCallback(){return this.props.onTabSetPlaceHolder}showContextMenu(e,t){this.props.onContextMenu&&this.props.onContextMenu(e,t)}auxMouseClick(e,t){this.props.onAuxMouseClick&&this.props.onAuxMouseClick(e,t)}}Kn.Layout=Ml;const kl=n=>($.useEffect(()=>{var e;(e=n.onRendered)===null||e===void 0||e.call(n)},[n]),$.createElement($.Fragment,null,n.children));var Dn={};Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.BorderSet=void 0;const ni=Ce,zl=vt();class oi{static _fromJson(e,t){const o=new oi(t);return o._borders=e.map(i=>zl.BorderNode._fromJson(i,t)),o}constructor(e){this._model=e,this._borders=[]}getBorders(){return this._borders}_forEachNode(e){for(const t of this._borders){e(t,0);for(const o of t.getChildren())o._forEachNode(e,1)}}_toJson(){return this._borders.map(e=>e.toJson())}_layoutBorder(e,t){const o=e.outer,i=this._model.getRoot();let r=Math.max(0,o.height-i.getMinHeight()),s=Math.max(0,o.width-i.getMinWidth()),a=0,c=0,f=0,m=0;const h=this._borders.filter(l=>l.isShowing());for(const l of h){l._setAdjustedSize(l.getSize());const g=l.getSelected()!==-1;l.getLocation().getOrientation()===ni.Orientation.HORZ?(c+=l.getBorderBarSize(),g&&(s-=this._model.getSplitterSize(),c+=l.getSize(),m+=l.getSize())):(a+=l.getBorderBarSize(),g&&(r-=this._model.getSplitterSize(),a+=l.getSize(),f+=l.getSize()))}let b=0,d=!1;for(;c>s&&m>0||a>r&&f>0;){const l=h[b];if(l.getSelected()!==-1){const g=l._getAdjustedSize();c>s&&m>0&&l.getLocation().getOrientation()===ni.Orientation.HORZ&&g>0&&g>l.getMinSize()?(l._setAdjustedSize(g-1),c--,m--,d=!0):a>r&&f>0&&l.getLocation().getOrientation()===ni.Orientation.VERT&&g>0&&g>l.getMinSize()&&(l._setAdjustedSize(g-1),a--,f--,d=!0)}if(b=(b+1)%h.length,b===0)if(d)d=!1;else break}for(const l of h)e.outer=l._layoutBorderOuter(e.outer,t);e.inner=e.outer;for(const l of h)e.inner=l._layoutBorderInner(e.inner,t);return e}_findDropTargetNode(e,t,o){for(const i of this._borders)if(i.isShowing()){const r=i.canDrop(e,t,o);if(r!==void 0)return r}}}Dn.BorderSet=oi;var vr={};Object.defineProperty(vr,"__esModule",{value:!0});var yr={};Object.defineProperty(yr,"__esModule",{value:!0});var xr={};Object.defineProperty(xr,"__esModule",{value:!0});var mo={};Object.defineProperty(mo,"__esModule",{value:!0}),mo.Model=void 0;const q=_t,Fl=bt,ii=rt,Er=Ce,Sr=Me,Ge=Ze,In=vt(),wr=Dn,ln=Uo(),zt=Nt,dt=Ct(),ri=Po();class qe{static fromJson(e){const t=new qe;return qe._attributeDefinitions.fromJson(e.global,t._attributes),e.borders&&(t._borders=wr.BorderSet._fromJson(e.borders,t)),t._root=ln.RowNode._fromJson(e.layout,t),t._tidy(),t}static _createAttributeDefinitions(){const e=new Fl.AttributeDefinitions;return e.add("legacyOverflowMenu",!1).setType(q.Attribute.BOOLEAN),e.add("enableEdgeDock",!0).setType(q.Attribute.BOOLEAN),e.add("rootOrientationVertical",!1).setType(q.Attribute.BOOLEAN),e.add("marginInsets",{top:0,right:0,bottom:0,left:0}).setType("IInsets"),e.add("enableUseVisibility",!1).setType(q.Attribute.BOOLEAN),e.add("enableRotateBorderIcons",!0).setType(q.Attribute.BOOLEAN),e.add("splitterSize",-1).setType(q.Attribute.NUMBER),e.add("splitterExtra",0).setType(q.Attribute.NUMBER),e.add("tabEnableClose",!0).setType(q.Attribute.BOOLEAN),e.add("tabCloseType",1).setType("ICloseType"),e.add("tabEnableFloat",!1).setType(q.Attribute.BOOLEAN),e.add("tabEnableDrag",!0).setType(q.Attribute.BOOLEAN),e.add("tabEnableRename",!0).setType(q.Attribute.BOOLEAN),e.add("tabContentClassName",void 0).setType(q.Attribute.STRING),e.add("tabClassName",void 0).setType(q.Attribute.STRING),e.add("tabIcon",void 0).setType(q.Attribute.STRING),e.add("tabEnableRenderOnDemand",!0).setType(q.Attribute.BOOLEAN),e.add("tabDragSpeed",.3).setType(q.Attribute.NUMBER),e.add("tabBorderWidth",-1).setType(q.Attribute.NUMBER),e.add("tabBorderHeight",-1).setType(q.Attribute.NUMBER),e.add("tabSetEnableDeleteWhenEmpty",!0).setType(q.Attribute.BOOLEAN),e.add("tabSetEnableDrop",!0).setType(q.Attribute.BOOLEAN),e.add("tabSetEnableDrag",!0).setType(q.Attribute.BOOLEAN),e.add("tabSetEnableDivide",!0).setType(q.Attribute.BOOLEAN),e.add("tabSetEnableMaximize",!0).setType(q.Attribute.BOOLEAN),e.add("tabSetEnableClose",!1).setType(q.Attribute.BOOLEAN),e.add("tabSetEnableSingleTabStretch",!1).setType(q.Attribute.BOOLEAN),e.add("tabSetAutoSelectTab",!0).setType(q.Attribute.BOOLEAN),e.add("tabSetClassNameTabStrip",void 0).setType(q.Attribute.STRING),e.add("tabSetClassNameHeader",void 0).setType(q.Attribute.STRING),e.add("tabSetEnableTabStrip",!0).setType(q.Attribute.BOOLEAN),e.add("tabSetHeaderHeight",0).setType(q.Attribute.NUMBER),e.add("tabSetTabStripHeight",0).setType(q.Attribute.NUMBER),e.add("tabSetMarginInsets",{top:0,right:0,bottom:0,left:0}).setType("IInsets"),e.add("tabSetBorderInsets",{top:0,right:0,bottom:0,left:0}).setType("IInsets"),e.add("tabSetTabLocation","top").setType("ITabLocation"),e.add("tabSetMinWidth",0).setType(q.Attribute.NUMBER),e.add("tabSetMinHeight",0).setType(q.Attribute.NUMBER),e.add("borderSize",200).setType(q.Attribute.NUMBER),e.add("borderMinSize",0).setType(q.Attribute.NUMBER),e.add("borderBarSize",0).setType(q.Attribute.NUMBER),e.add("borderEnableDrop",!0).setType(q.Attribute.BOOLEAN),e.add("borderAutoSelectTabWhenOpen",!0).setType(q.Attribute.BOOLEAN),e.add("borderAutoSelectTabWhenClosed",!1).setType(q.Attribute.BOOLEAN),e.add("borderClassName",void 0).setType(q.Attribute.STRING),e.add("borderEnableAutoHide",!1).setType(q.Attribute.BOOLEAN),e}constructor(){this._borderRects={inner:Sr.Rect.empty(),outer:Sr.Rect.empty()},this._attributes={},this._idMap={},this._borders=new wr.BorderSet(this),this._pointerFine=!0,this._showHiddenBorder=ii.DockLocation.CENTER}_setChangeListener(e){this._changeListener=e}getActiveTabset(){if(this._activeTabSet&&this.getNodeById(this._activeTabSet.getId()))return this._activeTabSet}_getShowHiddenBorder(){return this._showHiddenBorder}_setShowHiddenBorder(e){this._showHiddenBorder=e}_setActiveTabset(e){this._activeTabSet=e}getMaximizedTabset(){return this._maximizedTabSet}_setMaximizedTabset(e){this._maximizedTabSet=e}getRoot(){return this._root}isRootOrientationVertical(){return this._attributes.rootOrientationVertical}isUseVisibility(){return this._attributes.enableUseVisibility}isEnableRotateBorderIcons(){return this._attributes.enableRotateBorderIcons}getBorderSet(){return this._borders}_getOuterInnerRects(){return this._borderRects}_getPointerFine(){return this._pointerFine}_setPointerFine(e){this._pointerFine=e}visitNodes(e){this._borders._forEachNode(e),this._root._forEachNode(e,0)}getNodeById(e){return this._idMap[e]}getFirstTabSet(e=this._root){const t=e.getChildren()[0];return t instanceof dt.TabSetNode?t:this.getFirstTabSet(t)}doAction(e){let t;switch(e.type){case Ge.Actions.ADD_NODE:{const o=new zt.TabNode(this,e.data.json,!0),i=this._idMap[e.data.toNode];(i instanceof dt.TabSetNode||i instanceof In.BorderNode||i instanceof ln.RowNode)&&(i.drop(o,ii.DockLocation.getByName(e.data.location),e.data.index,e.data.select),t=o);break}case Ge.Actions.MOVE_NODE:{const o=this._idMap[e.data.fromNode];if(o instanceof zt.TabNode||o instanceof dt.TabSetNode){const i=this._idMap[e.data.toNode];(i instanceof dt.TabSetNode||i instanceof In.BorderNode||i instanceof ln.RowNode)&&i.drop(o,ii.DockLocation.getByName(e.data.location),e.data.index,e.data.select)}break}case Ge.Actions.DELETE_TAB:{const o=this._idMap[e.data.node];o instanceof zt.TabNode&&o._delete();break}case Ge.Actions.DELETE_TABSET:{const o=this._idMap[e.data.node];if(o instanceof dt.TabSetNode){const i=[...o.getChildren()];for(let r=0;r<i.length;r++){const s=i[r];s.isEnableClose()&&s._delete()}o.getChildren().length===0&&o._delete(),this._tidy()}break}case Ge.Actions.FLOAT_TAB:{const o=this._idMap[e.data.node];o instanceof zt.TabNode&&(o._setFloating(!0),(0,ri.adjustSelectedIndexAfterFloat)(o));break}case Ge.Actions.UNFLOAT_TAB:{const o=this._idMap[e.data.node];o instanceof zt.TabNode&&(o._setFloating(!1),(0,ri.adjustSelectedIndexAfterDock)(o));break}case Ge.Actions.RENAME_TAB:{const o=this._idMap[e.data.node];o instanceof zt.TabNode&&o._setName(e.data.text);break}case Ge.Actions.SELECT_TAB:{const o=this._idMap[e.data.tabNode];if(o instanceof zt.TabNode){const i=o.getParent(),r=i.getChildren().indexOf(o);i instanceof In.BorderNode?i.getSelected()===r?i._setSelected(-1):i._setSelected(r):i instanceof dt.TabSetNode&&(i.getSelected()!==r&&i._setSelected(r),this._activeTabSet=i)}break}case Ge.Actions.SET_ACTIVE_TABSET:{if(e.data.tabsetNode===void 0)this._activeTabSet=void 0;else{const o=this._idMap[e.data.tabsetNode];o instanceof dt.TabSetNode&&(this._activeTabSet=o)}break}case Ge.Actions.ADJUST_SPLIT:{const o=this._idMap[e.data.node1],i=this._idMap[e.data.node2];(o instanceof dt.TabSetNode||o instanceof ln.RowNode)&&(i instanceof dt.TabSetNode||i instanceof ln.RowNode)&&(this._adjustSplitSide(o,e.data.weight1,e.data.pixelWidth1),this._adjustSplitSide(i,e.data.weight2,e.data.pixelWidth2));break}case Ge.Actions.ADJUST_BORDER_SPLIT:{const o=this._idMap[e.data.node];o instanceof In.BorderNode&&o._setSize(e.data.pos);break}case Ge.Actions.MAXIMIZE_TOGGLE:{const o=this._idMap[e.data.node];o instanceof dt.TabSetNode&&(o===this._maximizedTabSet?this._maximizedTabSet=void 0:(this._maximizedTabSet=o,this._activeTabSet=o));break}case Ge.Actions.UPDATE_MODEL_ATTRIBUTES:{this._updateAttrs(e.data.json);break}case Ge.Actions.UPDATE_NODE_ATTRIBUTES:{this._idMap[e.data.node]._updateAttrs(e.data.json);break}}return this._updateIdMap(),this._changeListener!==void 0&&this._changeListener(e),t}_updateIdMap(){this._idMap={},this.visitNodes(e=>this._idMap[e.getId()]=e)}_adjustSplitSide(e,t,o){e._setWeight(t),e.getWidth()!=null&&e.getOrientation()===Er.Orientation.VERT?e._updateAttrs({width:o}):e.getHeight()!=null&&e.getOrientation()===Er.Orientation.HORZ&&e._updateAttrs({height:o})}toJson(){const e={};return qe._attributeDefinitions.toJson(e,this._attributes),this.visitNodes(t=>{t._fireEvent("save",void 0)}),{global:e,borders:this._borders._toJson(),layout:this._root.toJson()}}getSplitterSize(){let e=this._attributes.splitterSize;return e===-1&&(e=this._pointerFine?8:12),e}isLegacyOverflowMenu(){return this._attributes.legacyOverflowMenu}getSplitterExtra(){return this._attributes.splitterExtra}isEnableEdgeDock(){return this._attributes.enableEdgeDock}_addNode(e){const t=e.getId();if(this._idMap[t]!==void 0)throw new Error(`Error: each node must have a unique id, duplicate id:${e.getId()}`);e.getType()!=="splitter"&&(this._idMap[t]=e)}_layout(e,t){var o;return this._borderRects=this._borders._layoutBorder({outer:e,inner:e},t),e=this._borderRects.inner.removeInsets(this._getAttribute("marginInsets")),(o=this._root)===null||o===void 0||o.calcMinSize(),this._root._layout(e,t),e}_findDropTargetNode(e,t,o){let i=this._root._findDropTargetNode(e,t,o);return i===void 0&&(i=this._borders._findDropTargetNode(e,t,o)),i}_tidy(){this._root._tidy()}_updateAttrs(e){qe._attributeDefinitions.update(e,this._attributes)}_nextUniqueId(){return"#"+(0,ri.randomUUID)()}_getAttribute(e){return this._attributes[e]}setOnAllowDrop(e){this._onAllowDrop=e}_getOnAllowDrop(){return this._onAllowDrop}setOnCreateTabSet(e){this._onCreateTabSet=e}_getOnCreateTabSet(){return this._onCreateTabSet}static toTypescriptInterfaces(){console.log(qe._attributeDefinitions.toTypescriptInterface("Global",void 0)),console.log(ln.RowNode.getAttributeDefinitions().toTypescriptInterface("Row",qe._attributeDefinitions)),console.log(dt.TabSetNode.getAttributeDefinitions().toTypescriptInterface("TabSet",qe._attributeDefinitions)),console.log(zt.TabNode.getAttributeDefinitions().toTypescriptInterface("Tab",qe._attributeDefinitions)),console.log(In.BorderNode.getAttributeDefinitions().toTypescriptInterface("Border",qe._attributeDefinitions))}toString(){return JSON.stringify(this.toJson())}}mo.Model=qe,qe._attributeDefinitions=qe._createAttributeDefinitions(),function(n){var e=qn&&qn.__createBinding||(Object.create?function(o,i,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(i,r);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[r]}}),Object.defineProperty(o,s,a)}:function(o,i,r,s){s===void 0&&(s=r),o[s]=i[r]}),t=qn&&qn.__exportStar||function(o,i){for(var r in o)r!=="default"&&!Object.prototype.hasOwnProperty.call(i,r)&&e(i,o,r)};Object.defineProperty(n,"__esModule",{value:!0}),t(Kn,n),t(Tn,n),t(Ze,n),t(vt(),n),t(Dn,n),t(oo,n),t(vr,n),t(yr,n),t(xr,n),t(mo,n),t(Tt,n),t(Uo(),n),t(Gt,n),t(Nt,n),t(Ct(),n),t(rt,n),t(Yt,n),t(Xt,n),t(yt,n),t(Ce,n),t(Me,n),t(Le,n)}(Ot);class Ul{constructor(){Zn(this,"menus",new Map)}registerMenu(e,t){var o;this.menus.has(e)||this.menus.set(e,[]),(o=this.menus.get(e))==null||o.push(t)}setMenus(e){this.menus=new Map(Object.entries(e))}getMenu(e){return this.menus.get(e)||[]}getAllMenus(){const e={};return this.menus.forEach((t,o)=>{e[o]=t}),e}}const Jt=new Ul;class Pl{constructor(){Zn(this,"commands",new Map)}registerCommand(e){if(this.commands.has(e.id)){console.warn(`Command ${e.id} is already registered.`);return}this.commands.set(e.id,e)}executeCommand(e,...t){const o=this.commands.get(e);o?o.execute(...t):console.warn(`Command ${e} not found.`)}getCommand(e){return this.commands.get(e)}getCommands(){return Array.from(this.commands.values())}}const ht=new Pl;/**
|
|
22
|
+
<%s key={someKey} {...props} />`,he,re,M,re),ae[re+he]=!0)}if(re=null,oe!==void 0&&(t(oe),re=""+oe),s(W)&&(t(W.key),re=""+W.key),"key"in W){oe={};for(var te in W)te!=="key"&&(oe[te]=W[te])}else oe=W;return re&&a(oe,typeof N=="function"?N.displayName||N.name||"Unknown":N),f(N,re,oe,i(),$e,Je)}function h(N){b(N)?N._store&&(N._store.validated=1):typeof N=="object"&&N!==null&&N.$$typeof===C&&(N._payload.status==="fulfilled"?b(N._payload.value)&&N._payload.value._store&&(N._payload.value._store.validated=1):N._store&&(N._store.validated=1))}function b(N){return typeof N=="object"&&N!==null&&N.$$typeof===l}var d=A,l=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),S=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),L=Symbol.for("react.client.reference"),R=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,k=Array.isArray,B=console.createTask?console.createTask:function(){return null};d={react_stack_bottom_frame:function(N){return N()}};var Y,j={},z=d.react_stack_bottom_frame.bind(d,r)(),V=B(o(r)),ae={};bn.Fragment=u,bn.jsx=function(N,W,oe){var he=1e4>R.recentlyCreatedOwnerStacks++;return m(N,W,oe,!1,he?Error("react-stack-top-frame"):z,he?B(o(N)):V)},bn.jsxs=function(N,W,oe){var he=1e4>R.recentlyCreatedOwnerStacks++;return m(N,W,oe,!0,he?Error("react-stack-top-frame"):z,he?B(o(N)):V)}}()),bn}process.env.NODE_ENV==="production"?Bo.exports=pa():Bo.exports=ma();var y=Bo.exports,Ot={},Kn={},rt={},Ce={};Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.Orientation=void 0;class mt{static flip(e){return e===mt.HORZ?mt.VERT:mt.HORZ}constructor(e){this._name=e}getName(){return this._name}toString(){return this._name}}Ce.Orientation=mt,mt.HORZ=new mt("horz"),mt.VERT=new mt("vert");var Me={};Object.defineProperty(Me,"__esModule",{value:!0}),Me.Rect=void 0;const _a=Ce;class rn{static empty(){return new rn(0,0,0,0)}constructor(e,t,o,i){this.x=e,this.y=t,this.width=o,this.height=i}static fromElement(e){let{x:t,y:o,width:i,height:r}=e.getBoundingClientRect();return new rn(t,o,i,r)}clone(){return new rn(this.x,this.y,this.width,this.height)}equals(e){return this.x===(e==null?void 0:e.x)&&this.y===(e==null?void 0:e.y)&&this.width===(e==null?void 0:e.width)&&this.height===(e==null?void 0:e.height)}getBottom(){return this.y+this.height}getRight(){return this.x+this.width}getCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}positionElement(e,t){this.styleWithPosition(e.style,t)}styleWithPosition(e,t="absolute"){return e.left=this.x+"px",e.top=this.y+"px",e.width=Math.max(0,this.width)+"px",e.height=Math.max(0,this.height)+"px",e.position=t,e}contains(e,t){return this.x<=e&&e<=this.getRight()&&this.y<=t&&t<=this.getBottom()}removeInsets(e){return new rn(this.x+e.left,this.y+e.top,Math.max(0,this.width-e.left-e.right),Math.max(0,this.height-e.top-e.bottom))}centerInRect(e){this.x=(e.width-this.width)/2,this.y=(e.height-this.height)/2}_getSize(e){let t=this.width;return e===_a.Orientation.VERT&&(t=this.height),t}toString(){return"(Rect: x="+this.x+", y="+this.y+", width="+this.width+", height="+this.height+")"}}Me.Rect=rn,Object.defineProperty(rt,"__esModule",{value:!0}),rt.DockLocation=void 0;const Tn=Ce,et=Me;class se{static getByName(e){return se.values[e]}static getLocation(e,t,o){if(t=(t-e.x)/e.width,o=(o-e.y)/e.height,t>=.25&&t<.75&&o>=.25&&o<.75)return se.CENTER;const i=o>=t,r=o>=1-t;return i?r?se.BOTTOM:se.LEFT:r?se.RIGHT:se.TOP}constructor(e,t,o){this._name=e,this._orientation=t,this._indexPlus=o,se.values[this._name]=this}getName(){return this._name}getOrientation(){return this._orientation}getDockRect(e){return this===se.TOP?new et.Rect(e.x,e.y,e.width,e.height/2):this===se.BOTTOM?new et.Rect(e.x,e.getBottom()-e.height/2,e.width,e.height/2):this===se.LEFT?new et.Rect(e.x,e.y,e.width/2,e.height):this===se.RIGHT?new et.Rect(e.getRight()-e.width/2,e.y,e.width/2,e.height):e.clone()}split(e,t){if(this===se.TOP){const o=new et.Rect(e.x,e.y,e.width,t),i=new et.Rect(e.x,e.y+t,e.width,e.height-t);return{start:o,end:i}}else if(this===se.LEFT){const o=new et.Rect(e.x,e.y,t,e.height),i=new et.Rect(e.x+t,e.y,e.width-t,e.height);return{start:o,end:i}}if(this===se.RIGHT){const o=new et.Rect(e.getRight()-t,e.y,t,e.height),i=new et.Rect(e.x,e.y,e.width-t,e.height);return{start:o,end:i}}else{const o=new et.Rect(e.x,e.getBottom()-t,e.width,t),i=new et.Rect(e.x,e.y,e.width,e.height-t);return{start:o,end:i}}}reflect(){return this===se.TOP?se.BOTTOM:this===se.LEFT?se.RIGHT:this===se.RIGHT?se.LEFT:se.TOP}toString(){return"(DockLocation: name="+this._name+", orientation="+this._orientation+")"}}rt.DockLocation=se,se.values={},se.TOP=new se("top",Tn.Orientation.VERT,0),se.BOTTOM=new se("bottom",Tn.Orientation.VERT,1),se.LEFT=new se("left",Tn.Orientation.HORZ,0),se.RIGHT=new se("right",Tn.Orientation.HORZ,1),se.CENTER=new se("center",Tn.Orientation.VERT,0);var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.DragDrop=void 0;const ba=Me,Ta=!!(typeof window<"u"&&window.document&&window.document.createElement);class Mo{constructor(){this._manualGlassManagement=!1,this._startX=0,this._startY=0,this._dragDepth=0,this._glassShowing=!1,this._dragging=!1,this._active=!1,Ta&&(this._glass=document.createElement("div"),this._glass.style.zIndex="998",this._glass.style.backgroundColor="transparent",this._glass.style.outline="none"),this._defaultGlassCursor="default",this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onKeyPress=this._onKeyPress.bind(this),this._onDragCancel=this._onDragCancel.bind(this),this._onDragEnter=this._onDragEnter.bind(this),this._onDragLeave=this._onDragLeave.bind(this),this.resizeGlass=this.resizeGlass.bind(this),this._lastClick=0,this._clickX=0,this._clickY=0}addGlass(e){var t;this._glassShowing?this._manualGlassManagement=!0:(this._document||(this._document=window.document),this._rootElement||(this._rootElement=this._document.body),this.resizeGlass(),(t=this._document.defaultView)===null||t===void 0||t.addEventListener("resize",this.resizeGlass),this._document.body.appendChild(this._glass),this._glass.tabIndex=-1,this._glass.focus(),this._glass.addEventListener("keydown",this._onKeyPress),this._glass.addEventListener("dragenter",this._onDragEnter,{passive:!1}),this._glass.addEventListener("dragover",this._onMouseMove,{passive:!1}),this._glass.addEventListener("dragleave",this._onDragLeave,{passive:!1}),this._glassShowing=!0,this._fDragCancel=e,this._manualGlassManagement=!1)}resizeGlass(){ba.Rect.fromElement(this._rootElement).positionElement(this._glass,"fixed")}hideGlass(){var e;this._glassShowing&&(this._document.body.removeChild(this._glass),(e=this._document.defaultView)===null||e===void 0||e.removeEventListener("resize",this.resizeGlass),this._glassShowing=!1,this._document=void 0,this._rootElement=void 0,this.setGlassCursorOverride(void 0))}_updateGlassCursor(){var e;this._glass.style.cursor=(e=this._glassCursorOverride)!==null&&e!==void 0?e:this._defaultGlassCursor}_setDefaultGlassCursor(e){this._defaultGlassCursor=e,this._updateGlassCursor()}setGlassCursorOverride(e){this._glassCursorOverride=e,this._updateGlassCursor()}startDrag(e,t,o,i,r,s,a,c,f){if(e&&this._lastEvent&&this._lastEvent.type.startsWith("touch")&&e.type.startsWith("mouse")&&e.timeStamp-this._lastEvent.timeStamp<500||this._dragging)return;this._lastEvent=e,c?this._document=c:this._document=window.document,f?this._rootElement=f:this._rootElement=this._document.body;const m=this._getLocationEvent(e);this.addGlass(r),e?(this._startX=m.clientX,this._startY=m.clientY,(!window.matchMedia||window.matchMedia("(pointer: fine)").matches)&&this._setDefaultGlassCursor(getComputedStyle(e.target).cursor),this._stopPropagation(e),this._preventDefault(e)):(this._startX=0,this._startY=0,this._setDefaultGlassCursor("default")),this._dragging=!1,this._fDragStart=t,this._fDragMove=o,this._fDragEnd=i,this._fDragCancel=r,this._fClick=s,this._fDblClick=a,this._active=!0,(e==null?void 0:e.type)==="dragenter"?(this._dragDepth=1,this._rootElement.addEventListener("dragenter",this._onDragEnter,{passive:!1}),this._rootElement.addEventListener("dragover",this._onMouseMove,{passive:!1}),this._rootElement.addEventListener("dragleave",this._onDragLeave,{passive:!1}),this._document.addEventListener("dragend",this._onDragCancel,{passive:!1}),this._document.addEventListener("drop",this._onMouseUp,{passive:!1})):(this._document.addEventListener("mouseup",this._onMouseUp,{passive:!1}),this._document.addEventListener("mousemove",this._onMouseMove,{passive:!1}),this._document.addEventListener("touchend",this._onMouseUp,{passive:!1}),this._document.addEventListener("touchmove",this._onMouseMove,{passive:!1}))}isDragging(){return this._dragging}isActive(){return this._active}toString(){return"(DragDrop: startX="+this._startX+", startY="+this._startY+", dragging="+this._dragging+")"}_onKeyPress(e){e.code==="Escape"&&this._onDragCancel()}_onDragCancel(){this._rootElement.removeEventListener("dragenter",this._onDragEnter),this._rootElement.removeEventListener("dragover",this._onMouseMove),this._rootElement.removeEventListener("dragleave",this._onDragLeave),this._document.removeEventListener("dragend",this._onDragCancel),this._document.removeEventListener("drop",this._onMouseUp),this._document.removeEventListener("mousemove",this._onMouseMove),this._document.removeEventListener("mouseup",this._onMouseUp),this._document.removeEventListener("touchend",this._onMouseUp),this._document.removeEventListener("touchmove",this._onMouseMove),this.hideGlass(),this._fDragCancel!==void 0&&this._fDragCancel(this._dragging),this._dragging=!1,this._active=!1}_getLocationEvent(e){let t=e;return e&&e.touches&&(t=e.touches[0]),t}_getLocationEventEnd(e){let t=e;return e.changedTouches&&(t=e.changedTouches[0]),t}_stopPropagation(e){e.stopPropagation&&e.stopPropagation()}_preventDefault(e){return e.preventDefault&&e.cancelable&&e.preventDefault(),e}_onMouseMove(e){this._lastEvent=e;const t=this._getLocationEvent(e);return this._stopPropagation(e),this._preventDefault(e),!this._dragging&&(Math.abs(this._startX-t.clientX)>5||Math.abs(this._startY-t.clientY)>5)&&(this._dragging=!0,this._fDragStart&&(this._setDefaultGlassCursor("move"),this._dragging=this._fDragStart({clientX:this._startX,clientY:this._startY}))),this._dragging&&this._fDragMove&&this._fDragMove(t),!1}_onMouseUp(e){this._lastEvent=e;const t=this._getLocationEventEnd(e);if(this._stopPropagation(e),this._preventDefault(e),this._active=!1,this._rootElement.removeEventListener("dragenter",this._onDragEnter),this._rootElement.removeEventListener("dragover",this._onMouseMove),this._rootElement.removeEventListener("dragleave",this._onDragLeave),this._document.removeEventListener("dragend",this._onDragCancel),this._document.removeEventListener("drop",this._onMouseUp),this._document.removeEventListener("mousemove",this._onMouseMove),this._document.removeEventListener("mouseup",this._onMouseUp),this._document.removeEventListener("touchend",this._onMouseUp),this._document.removeEventListener("touchmove",this._onMouseMove),this._manualGlassManagement||this.hideGlass(),this._dragging)this._dragging=!1,this._fDragEnd&&this._fDragEnd(e);else if(this._fDragCancel&&this._fDragCancel(this._dragging),Math.abs(this._startX-t.clientX)<=5&&Math.abs(this._startY-t.clientY)<=5){let o=!1;const i=new Date().getTime();Math.abs(this._clickX-t.clientX)<=5&&Math.abs(this._clickY-t.clientY)<=5&&i-this._lastClick<500&&this._fDblClick&&(this._fDblClick(e),o=!0),!o&&this._fClick&&this._fClick(e),this._lastClick=i,this._clickX=t.clientX,this._clickY=t.clientY}return!1}_onDragEnter(e){return this._preventDefault(e),this._stopPropagation(e),this._dragDepth++,!1}_onDragLeave(e){return this._preventDefault(e),this._stopPropagation(e),this._dragDepth--,this._dragDepth<=0&&this._onDragCancel(),!1}}Yt.DragDrop=Mo,Mo.instance=new Mo;var Ze={},vn={};Object.defineProperty(vn,"__esModule",{value:!0}),vn.Action=void 0;class va{constructor(e,t){this.type=e,this.data=t}}vn.Action=va,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.Actions=void 0;const He=vn;class ce{static addNode(e,t,o,i,r){return new He.Action(ce.ADD_NODE,{json:e,toNode:t,location:o.getName(),index:i,select:r})}static moveNode(e,t,o,i,r){return new He.Action(ce.MOVE_NODE,{fromNode:e,toNode:t,location:o.getName(),index:i,select:r})}static deleteTab(e){return new He.Action(ce.DELETE_TAB,{node:e})}static deleteTabset(e){return new He.Action(ce.DELETE_TABSET,{node:e})}static renameTab(e,t){return new He.Action(ce.RENAME_TAB,{node:e,text:t})}static selectTab(e){return new He.Action(ce.SELECT_TAB,{tabNode:e})}static setActiveTabset(e){return new He.Action(ce.SET_ACTIVE_TABSET,{tabsetNode:e})}static adjustSplit(e){const t=e.node1Id,o=e.node2Id;return new He.Action(ce.ADJUST_SPLIT,{node1:t,weight1:e.weight1,pixelWidth1:e.pixelWidth1,node2:o,weight2:e.weight2,pixelWidth2:e.pixelWidth2})}static adjustBorderSplit(e,t){return new He.Action(ce.ADJUST_BORDER_SPLIT,{node:e,pos:t})}static maximizeToggle(e){return new He.Action(ce.MAXIMIZE_TOGGLE,{node:e})}static updateModelAttributes(e){return new He.Action(ce.UPDATE_MODEL_ATTRIBUTES,{json:e})}static updateNodeAttributes(e,t){return new He.Action(ce.UPDATE_NODE_ATTRIBUTES,{node:e,json:t})}static floatTab(e){return new He.Action(ce.FLOAT_TAB,{node:e})}static unFloatTab(e){return new He.Action(ce.UNFLOAT_TAB,{node:e})}}Ze.Actions=ce,ce.ADD_NODE="FlexLayout_AddNode",ce.MOVE_NODE="FlexLayout_MoveNode",ce.DELETE_TAB="FlexLayout_DeleteTab",ce.DELETE_TABSET="FlexLayout_DeleteTabset",ce.RENAME_TAB="FlexLayout_RenameTab",ce.SELECT_TAB="FlexLayout_SelectTab",ce.SET_ACTIVE_TABSET="FlexLayout_SetActiveTabset",ce.ADJUST_SPLIT="FlexLayout_AdjustSplit",ce.ADJUST_BORDER_SPLIT="FlexLayout_AdjustBorderSplit",ce.MAXIMIZE_TOGGLE="FlexLayout_MaximizeToggle",ce.UPDATE_MODEL_ATTRIBUTES="FlexLayout_UpdateModelAttributes",ce.UPDATE_NODE_ATTRIBUTES="FlexLayout_UpdateNodeAttributes",ce.FLOAT_TAB="FlexLayout_FloatTab",ce.UNFLOAT_TAB="FlexLayout_UnFloatTab";var yn={},_t={};Object.defineProperty(_t,"__esModule",{value:!0}),_t.Attribute=void 0;class Qn{constructor(e,t,o,i){this.name=e,this.modelName=t,this.defaultValue=o,this.alwaysWriteJson=i,this.required=!1,this.fixed=!1,this.type="any"}setType(e){return this.type=e,this}setRequired(){return this.required=!0,this}setFixed(){return this.fixed=!0,this}}_t.Attribute=Qn,Qn.NUMBER="number",Qn.STRING="string",Qn.BOOLEAN="boolean";var bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.AttributeDefinitions=void 0;const ya=_t;class xa{constructor(){this.attributes=[],this.nameToAttribute={}}addWithAll(e,t,o,i){const r=new ya.Attribute(e,t,o,i);return this.attributes.push(r),this.nameToAttribute[e]=r,r}addInherited(e,t){return this.addWithAll(e,t,void 0,!1)}add(e,t,o){return this.addWithAll(e,void 0,t,o)}getAttributes(){return this.attributes}getModelName(e){const t=this.nameToAttribute[e];if(t!==void 0)return t.modelName}toJson(e,t){for(const o of this.attributes){const i=t[o.name];(o.alwaysWriteJson||i!==o.defaultValue)&&(e[o.name]=i)}}fromJson(e,t){for(const o of this.attributes){const i=e[o.name];i===void 0?t[o.name]=o.defaultValue:t[o.name]=i}}update(e,t){for(const o of this.attributes)if(e.hasOwnProperty(o.name)){const i=e[o.name];i===void 0?delete t[o.name]:t[o.name]=i}}setDefaults(e){for(const t of this.attributes)e[t.name]=t.defaultValue}toTypescriptInterface(e,t){const o=[],i=this.attributes.sort((r,s)=>r.name.localeCompare(s.name));o.push("export interface I"+e+"Attributes {");for(let r=0;r<i.length;r++){const s=i[r];let a=s.type,c,f=s,m;f.defaultValue!==void 0?c=f.defaultValue:f.modelName!==void 0&&t!==void 0&&t.nameToAttribute[f.modelName]!==void 0&&(m=f.modelName,f=t.nameToAttribute[f.modelName],c=f.defaultValue,a=f.type);let h=JSON.stringify(c);const b=f.required||f.fixed?"":"?";if(s.fixed)o.push(" "+s.name+": "+h+";");else{const d=(c!==void 0?"default: "+h:"")+(m!==void 0?" - inherited from global "+m:"");o.push(" "+s.name+b+": "+a+";"+(d.length>0?" // "+d:""))}}return o.push("}"),o.join(`
|
|
23
|
+
`)}}bt.AttributeDefinitions=xa;var Xt={};Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.DropInfo=void 0;class Ea{constructor(e,t,o,i,r){this.node=e,this.rect=t,this.location=o,this.index=i,this.className=r}}Xt.DropInfo=Ea;var Le={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CLASSES=void 0,function(e){e.FLEXLAYOUT__BORDER="flexlayout__border",e.FLEXLAYOUT__BORDER_="flexlayout__border_",e.FLEXLAYOUT__BORDER_BUTTON="flexlayout__border_button",e.FLEXLAYOUT__BORDER_BUTTON_="flexlayout__border_button_",e.FLEXLAYOUT__BORDER_BUTTON_CONTENT="flexlayout__border_button_content",e.FLEXLAYOUT__BORDER_BUTTON_LEADING="flexlayout__border_button_leading",e.FLEXLAYOUT__BORDER_BUTTON_TRAILING="flexlayout__border_button_trailing",e.FLEXLAYOUT__BORDER_BUTTON__SELECTED="flexlayout__border_button--selected",e.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED="flexlayout__border_button--unselected",e.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW="flexlayout__border_toolbar_button_overflow",e.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_="flexlayout__border_toolbar_button_overflow_",e.FLEXLAYOUT__BORDER_INNER="flexlayout__border_inner",e.FLEXLAYOUT__BORDER_INNER_="flexlayout__border_inner_",e.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER="flexlayout__border_inner_tab_container",e.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_="flexlayout__border_inner_tab_container_",e.FLEXLAYOUT__BORDER_TAB_DIVIDER="flexlayout__border_tab_divider",e.FLEXLAYOUT__BORDER_SIZER="flexlayout__border_sizer",e.FLEXLAYOUT__BORDER_TOOLBAR="flexlayout__border_toolbar",e.FLEXLAYOUT__BORDER_TOOLBAR_="flexlayout__border_toolbar_",e.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON="flexlayout__border_toolbar_button",e.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT="flexlayout__border_toolbar_button-float",e.FLEXLAYOUT__DRAG_RECT="flexlayout__drag_rect",e.FLEXLAYOUT__EDGE_RECT="flexlayout__edge_rect",e.FLEXLAYOUT__EDGE_RECT_TOP="flexlayout__edge_rect_top",e.FLEXLAYOUT__EDGE_RECT_LEFT="flexlayout__edge_rect_left",e.FLEXLAYOUT__EDGE_RECT_BOTTOM="flexlayout__edge_rect_bottom",e.FLEXLAYOUT__EDGE_RECT_RIGHT="flexlayout__edge_rect_right",e.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER="flexlayout__error_boundary_container",e.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT="flexlayout__error_boundary_content",e.FLEXLAYOUT__FLOATING_WINDOW_CONTENT="flexlayout__floating_window_content",e.FLEXLAYOUT__FLOATING_WINDOW_TAB="flexlayout__floating_window_tab",e.FLEXLAYOUT__LAYOUT="flexlayout__layout",e.FLEXLAYOUT__OUTLINE_RECT="flexlayout__outline_rect",e.FLEXLAYOUT__OUTLINE_RECT_EDGE="flexlayout__outline_rect_edge",e.FLEXLAYOUT__SPLITTER="flexlayout__splitter",e.FLEXLAYOUT__SPLITTER_EXTRA="flexlayout__splitter_extra",e.FLEXLAYOUT__SPLITTER_="flexlayout__splitter_",e.FLEXLAYOUT__SPLITTER_BORDER="flexlayout__splitter_border",e.FLEXLAYOUT__SPLITTER_DRAG="flexlayout__splitter_drag",e.FLEXLAYOUT__TAB="flexlayout__tab",e.FLEXLAYOUT__TABSET="flexlayout__tabset",e.FLEXLAYOUT__TABSET_HEADER="flexlayout__tabset_header",e.FLEXLAYOUT__TABSET_HEADER_SIZER="flexlayout__tabset_header_sizer",e.FLEXLAYOUT__TABSET_HEADER_CONTENT="flexlayout__tabset_header_content",e.FLEXLAYOUT__TABSET_MAXIMIZED="flexlayout__tabset-maximized",e.FLEXLAYOUT__TABSET_SELECTED="flexlayout__tabset-selected",e.FLEXLAYOUT__TABSET_SIZER="flexlayout__tabset_sizer",e.FLEXLAYOUT__TABSET_TAB_DIVIDER="flexlayout__tabset_tab_divider",e.FLEXLAYOUT__TABSET_CONTENT="flexlayout__tabset_content",e.FLEXLAYOUT__TABSET_TABBAR_INNER="flexlayout__tabset_tabbar_inner",e.FLEXLAYOUT__TABSET_TABBAR_INNER_="flexlayout__tabset_tabbar_inner_",e.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER="flexlayout__tabset_tabbar_inner_tab_container",e.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_="flexlayout__tabset_tabbar_inner_tab_container_",e.FLEXLAYOUT__TABSET_TABBAR_OUTER="flexlayout__tabset_tabbar_outer",e.FLEXLAYOUT__TABSET_TABBAR_OUTER_="flexlayout__tabset_tabbar_outer_",e.FLEXLAYOUT__TAB_BORDER="flexlayout__tab_border",e.FLEXLAYOUT__TAB_BORDER_="flexlayout__tab_border_",e.FLEXLAYOUT__TAB_BUTTON="flexlayout__tab_button",e.FLEXLAYOUT__TAB_BUTTON_STRETCH="flexlayout__tab_button_stretch",e.FLEXLAYOUT__TAB_BUTTON_CONTENT="flexlayout__tab_button_content",e.FLEXLAYOUT__TAB_BUTTON_LEADING="flexlayout__tab_button_leading",e.FLEXLAYOUT__TAB_BUTTON_OVERFLOW="flexlayout__tab_button_overflow",e.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT="flexlayout__tab_button_overflow_count",e.FLEXLAYOUT__TAB_BUTTON_TEXTBOX="flexlayout__tab_button_textbox",e.FLEXLAYOUT__TAB_BUTTON_TRAILING="flexlayout__tab_button_trailing",e.FLEXLAYOUT__TAB_BUTTON_STAMP="flexlayout__tab_button_stamp",e.FLEXLAYOUT__TAB_FLOATING="flexlayout__tab_floating",e.FLEXLAYOUT__TAB_FLOATING_INNER="flexlayout__tab_floating_inner",e.FLEXLAYOUT__TAB_TOOLBAR="flexlayout__tab_toolbar",e.FLEXLAYOUT__TAB_TOOLBAR_BUTTON="flexlayout__tab_toolbar_button",e.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_="flexlayout__tab_toolbar_button-",e.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT="flexlayout__tab_toolbar_button-float",e.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER="flexlayout__tab_toolbar_sticky_buttons_container",e.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE="flexlayout__tab_toolbar_button-close",e.FLEXLAYOUT__POPUP_MENU_CONTAINER="flexlayout__popup_menu_container",e.FLEXLAYOUT__POPUP_MENU_ITEM="flexlayout__popup_menu_item",e.FLEXLAYOUT__POPUP_MENU="flexlayout__popup_menu"}(n.CLASSES||(n.CLASSES={}))})(Le);var Tt={};Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.Node=void 0;const ko=rt,zo=Ce,Sa=Me;class wa{constructor(e){this._dirty=!1,this._tempSize=0,this._model=e,this._attributes={},this._children=[],this._fixed=!1,this._rect=Sa.Rect.empty(),this._visible=!1,this._listeners={}}getId(){let e=this._attributes.id;return e!==void 0||(e=this._model._nextUniqueId(),this._setId(e)),e}getModel(){return this._model}getType(){return this._attributes.type}getParent(){return this._parent}getChildren(){return this._children}getRect(){return this._rect}isVisible(){return this._visible}getOrientation(){return this._parent===void 0?this._model.isRootOrientationVertical()?zo.Orientation.VERT:zo.Orientation.HORZ:zo.Orientation.flip(this._parent.getOrientation())}setEventListener(e,t){this._listeners[e]=t}removeEventListener(e){delete this._listeners[e]}_setId(e){this._attributes.id=e}_fireEvent(e,t){this._listeners[e]!==void 0&&this._listeners[e](t)}_getAttr(e){let t=this._attributes[e];if(t===void 0){const o=this._getAttributeDefinitions().getModelName(e);o!==void 0&&(t=this._model._getAttribute(o))}return t}_forEachNode(e,t){e(this,t),t++;for(const o of this._children)o._forEachNode(e,t)}_setVisible(e){e!==this._visible&&(this._fireEvent("visibility",{visible:e}),this._visible=e)}_getDrawChildren(){return this._children}_setParent(e){this._parent=e}_setRect(e){this._rect=e}_setWeight(e){this._attributes.weight=e}_setSelected(e){this._attributes.selected=e}_isFixed(){return this._fixed}_layout(e,t){this._rect=e}_findDropTargetNode(e,t,o){let i;if(this._rect.contains(t,o)){if(this._model.getMaximizedTabset()!==void 0)i=this._model.getMaximizedTabset().canDrop(e,t,o);else if(i=this.canDrop(e,t,o),i===void 0&&this._children.length!==0){for(const r of this._children)if(i=r._findDropTargetNode(e,t,o),i!==void 0)break}}return i}canDrop(e,t,o){}_canDockInto(e,t){if(t!=null){if(t.location===ko.DockLocation.CENTER&&t.node.isEnableDrop()===!1||t.location===ko.DockLocation.CENTER&&e.getType()==="tabset"&&e.getName()!==void 0||t.location!==ko.DockLocation.CENTER&&t.node.isEnableDivide()===!1)return!1;if(this._model._getOnAllowDrop())return this._model._getOnAllowDrop()(e,t)}return!0}_removeChild(e){const t=this._children.indexOf(e);return t!==-1&&this._children.splice(t,1),this._dirty=!0,t}_addChild(e,t){return t!=null?this._children.splice(t,0,e):(this._children.push(e),t=this._children.length-1),e._parent=this,this._dirty=!0,t}_removeAll(){this._children=[],this._dirty=!0}_styleWithPosition(e){return e==null&&(e={}),this._rect.styleWithPosition(e)}_getTempSize(){return this._tempSize}_setTempSize(e){this._tempSize=e}isEnableDivide(){return!0}_toAttributeString(){return JSON.stringify(this._attributes,void 0," ")}}Tt.Node=wa;var Gt={};Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.SplitterNode=void 0;const Ra=bt,Fo=Ce,Aa=Tt;class eo extends Aa.Node{constructor(e){super(e),this._fixed=!0,this._attributes.type=eo.TYPE,e._addNode(this)}getWidth(){return this._model.getSplitterSize()}getMinWidth(){return this.getOrientation()===Fo.Orientation.VERT?this._model.getSplitterSize():0}getHeight(){return this._model.getSplitterSize()}getMinHeight(){return this.getOrientation()===Fo.Orientation.HORZ?this._model.getSplitterSize():0}getMinSize(e){return e===Fo.Orientation.HORZ?this.getMinWidth():this.getMinHeight()}getWeight(){return 0}_setWeight(e){}_getPrefSize(e){return this._model.getSplitterSize()}_updateAttrs(e){}_getAttributeDefinitions(){return new Ra.AttributeDefinitions}toJson(){}}Gt.SplitterNode=eo,eo.TYPE="splitter";var Nt={};Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.TabNode=void 0;const De=_t,Oa=bt,Na=Tt;class tt extends Na.Node{static _fromJson(e,t,o=!0){return new tt(t,e,o)}static _createAttributeDefinitions(){const e=new Oa.AttributeDefinitions;return e.add("type",tt.TYPE,!0).setType(De.Attribute.STRING),e.add("id",void 0).setType(De.Attribute.STRING),e.add("name","[Unnamed Tab]").setType(De.Attribute.STRING),e.add("altName",void 0).setType(De.Attribute.STRING),e.add("helpText",void 0).setType(De.Attribute.STRING),e.add("component",void 0).setType(De.Attribute.STRING),e.add("config",void 0).setType("any"),e.add("floating",!1).setType(De.Attribute.BOOLEAN),e.add("tabsetClassName",void 0).setType(De.Attribute.STRING),e.addInherited("enableClose","tabEnableClose").setType(De.Attribute.BOOLEAN),e.addInherited("closeType","tabCloseType").setType("ICloseType"),e.addInherited("enableDrag","tabEnableDrag").setType(De.Attribute.BOOLEAN),e.addInherited("enableRename","tabEnableRename").setType(De.Attribute.BOOLEAN),e.addInherited("className","tabClassName").setType(De.Attribute.STRING),e.addInherited("contentClassName","tabContentClassName").setType(De.Attribute.STRING),e.addInherited("icon","tabIcon").setType(De.Attribute.STRING),e.addInherited("enableRenderOnDemand","tabEnableRenderOnDemand").setType(De.Attribute.BOOLEAN),e.addInherited("enableFloat","tabEnableFloat").setType(De.Attribute.BOOLEAN),e.addInherited("borderWidth","tabBorderWidth").setType(De.Attribute.NUMBER),e.addInherited("borderHeight","tabBorderHeight").setType(De.Attribute.NUMBER),e}constructor(e,t,o=!0){super(e),this._extra={},tt._attributeDefinitions.fromJson(t,this._attributes),o===!0&&e._addNode(this)}getWindow(){return this._window}getTabRect(){return this._tabRect}_setTabRect(e){this._tabRect=e}_setRenderedName(e){this._renderedName=e}_getNameForOverflowMenu(){const e=this._getAttr("altName");return e!==void 0?e:this._renderedName}getName(){return this._getAttr("name")}getHelpText(){return this._getAttr("helpText")}getComponent(){return this._getAttr("component")}getConfig(){return this._attributes.config}getExtraData(){return this._extra}isFloating(){return this._getAttr("floating")}getIcon(){return this._getAttr("icon")}isEnableClose(){return this._getAttr("enableClose")}getCloseType(){return this._getAttr("closeType")}isEnableFloat(){return this._getAttr("enableFloat")}isEnableDrag(){return this._getAttr("enableDrag")}isEnableRename(){return this._getAttr("enableRename")}getClassName(){return this._getAttr("className")}getContentClassName(){return this._getAttr("contentClassName")}getTabSetClassName(){return this._getAttr("tabsetClassName")}isEnableRenderOnDemand(){return this._getAttr("enableRenderOnDemand")}_setName(e){this._attributes.name=e,this._window&&this._window.document&&(this._window.document.title=e)}_setFloating(e){this._attributes.floating=e}_layout(e,t){e.equals(this._rect)||this._fireEvent("resize",{rect:e}),this._rect=e}_delete(){this._parent._remove(this),this._fireEvent("close",{})}toJson(){const e={};return tt._attributeDefinitions.toJson(e,this._attributes),e}_updateAttrs(e){tt._attributeDefinitions.update(e,this._attributes)}_getAttributeDefinitions(){return tt._attributeDefinitions}_setWindow(e){this._window=e}_setBorderWidth(e){this._attributes.borderWidth=e}_setBorderHeight(e){this._attributes.borderHeight=e}static getAttributeDefinitions(){return tt._attributeDefinitions}}Nt.TabNode=tt,tt.TYPE="tab",tt._attributeDefinitions=tt._createAttributeDefinitions();var st={},xn={},En={},Vi;function Uo(){if(Vi)return En;Vi=1,Object.defineProperty(En,"__esModule",{value:!0}),En.RowNode=void 0;const n=_t,e=bt,t=rt,o=Xt,i=Ce,r=Me,s=Le,a=vt(),c=Tt,f=Gt,m=Ct();let h=class Ue extends c.Node{static _fromJson(d,l){const g=new Ue(l,d);if(d.children!=null)for(const u of d.children)if(u.type===m.TabSetNode.TYPE){const p=m.TabSetNode._fromJson(u,l);g._addChild(p)}else{const p=Ue._fromJson(u,l);g._addChild(p)}return g}static _createAttributeDefinitions(){const d=new e.AttributeDefinitions;return d.add("type",Ue.TYPE,!0).setType(n.Attribute.STRING).setFixed(),d.add("id",void 0).setType(n.Attribute.STRING),d.add("weight",100).setType(n.Attribute.NUMBER),d.add("width",void 0).setType(n.Attribute.NUMBER),d.add("height",void 0).setType(n.Attribute.NUMBER),d}constructor(d,l){super(d),this._dirty=!0,this._drawChildren=[],this._minHeight=0,this._minWidth=0,Ue._attributeDefinitions.fromJson(l,this._attributes),d._addNode(this)}getWeight(){return this._attributes.weight}getWidth(){return this._getAttr("width")}getHeight(){return this._getAttr("height")}_setWeight(d){this._attributes.weight=d}_layout(d,l){super._layout(d,l);const g=this._rect._getSize(this.getOrientation());let u=0,p=0,_=0,v=0;const S=this._getDrawChildren();for(const O of S){const L=O._getPrefSize(this.getOrientation());O._isFixed()?L!==void 0&&(p+=L):L===void 0?u+=O.getWeight():(_+=L,v+=O.getWeight())}let x=!1,E=g-p-_;E<0&&(E=g-p,x=!0,u+=v);let T=0,w=0;for(const O of S){const L=O._getPrefSize(this.getOrientation());if(O._isFixed())L!==void 0&&O._setTempSize(L);else if(L==null||x){if(u===0)O._setTempSize(0);else{const R=O.getMinSize(this.getOrientation()),F=Math.floor(E*(O.getWeight()/u));O._setTempSize(Math.max(R,F))}w+=O._getTempSize()}else O._setTempSize(L);T+=O._getTempSize()}if(w>0){for(;T<g;)for(const O of S)if(!(O instanceof f.SplitterNode)){const L=O._getPrefSize(this.getOrientation());!O._isFixed()&&(L===void 0||x)&&T<g&&(O._setTempSize(O._getTempSize()+1),T++)}for(;T>g;){let O=!1;for(const L of S)if(!(L instanceof f.SplitterNode)){const R=L.getMinSize(this.getOrientation());L._getTempSize()>R&&T>g&&(L._setTempSize(L._getTempSize()-1),T--,O=!0)}if(!O)break}for(;T>g;){let O=!1;for(const L of S)L instanceof f.SplitterNode||L._getTempSize()>0&&T>g&&(L._setTempSize(L._getTempSize()-1),T--,O=!0);if(!O)break}}let C=0;for(const O of S)this.getOrientation()===i.Orientation.HORZ?O._layout(new r.Rect(this._rect.x+C,this._rect.y,O._getTempSize(),this._rect.height),l):O._layout(new r.Rect(this._rect.x,this._rect.y+C,this._rect.width,O._getTempSize()),l),C+=O._getTempSize();return!0}_getSplitterBounds(d,l=!1){const g=[0,0],u=this._getDrawChildren(),p=u.indexOf(d),_=u[p-1],v=u[p+1];if(this.getOrientation()===i.Orientation.HORZ){const S=l?_.getMinWidth():0,x=l?v.getMinWidth():0;g[0]=_.getRect().x+S,g[1]=v.getRect().getRight()-d.getWidth()-x}else{const S=l?_.getMinHeight():0,x=l?v.getMinHeight():0;g[0]=_.getRect().y+S,g[1]=v.getRect().getBottom()-d.getHeight()-x}return g}_calculateSplit(d,l){let g;const u=this._getDrawChildren(),p=u.indexOf(d),_=this._getSplitterBounds(d),v=u[p-1].getWeight()+u[p+1].getWeight(),S=Math.max(0,l-_[0]),x=Math.max(0,_[1]-l);if(S+x>0){const E=S*v/(S+x),T=x*v/(S+x);g={node1Id:u[p-1].getId(),weight1:E,pixelWidth1:S,node2Id:u[p+1].getId(),weight2:T,pixelWidth2:x}}return g}_getDrawChildren(){if(this._dirty){this._drawChildren=[];for(let d=0;d<this._children.length;d++){const l=this._children[d];if(d!==0){const g=new f.SplitterNode(this._model);g._setParent(this),this._drawChildren.push(g)}this._drawChildren.push(l)}this._dirty=!1}return this._drawChildren}getMinSize(d){return d===i.Orientation.HORZ?this.getMinWidth():this.getMinHeight()}getMinWidth(){return this._minWidth}getMinHeight(){return this._minHeight}calcMinSize(){this._minHeight=0,this._minWidth=0;let d=!0;for(const l of this._children){const g=l;g instanceof Ue&&g.calcMinSize(),this.getOrientation()===i.Orientation.VERT?(this._minHeight+=g.getMinHeight(),d||(this._minHeight+=this._model.getSplitterSize()),this._minWidth=Math.max(this._minWidth,g.getMinWidth())):(this._minWidth+=g.getMinWidth(),d||(this._minWidth+=this._model.getSplitterSize()),this._minHeight=Math.max(this._minHeight,g.getMinHeight())),d=!1}}_tidy(){let d=0;for(;d<this._children.length;){const l=this._children[d];if(l instanceof Ue){l._tidy();const g=l.getChildren();if(g.length===0)this._removeChild(l);else if(g.length===1){const u=g[0];if(this._removeChild(l),u instanceof Ue){let p=0;const _=u.getChildren();for(const v of _)p+=v.getWeight();for(let v=0;v<_.length;v++){const S=_[v];S._setWeight(l.getWeight()*S.getWeight()/p),this._addChild(S,d+v)}}else u._setWeight(l.getWeight()),this._addChild(u,d)}else d++}else l instanceof m.TabSetNode&&l.getChildren().length===0&&l.isEnableDeleteWhenEmpty()?(this._removeChild(l),l===this._model.getMaximizedTabset()&&this._model._setMaximizedTabset(void 0)):d++}if(this===this._model.getRoot()&&this._children.length===0){const l=this._model._getOnCreateTabSet();let g=l?l():{};g=Object.assign(Object.assign({},g),{selected:-1});const u=new m.TabSetNode(this._model,g);this._model._setActiveTabset(u),this._addChild(u)}}canDrop(d,l,g){const u=g-this._rect.y,p=l-this._rect.x,_=this._rect.width,v=this._rect.height,S=10,x=50;let E;if(this._model.isEnableEdgeDock()&&this._parent===void 0){if(l<this._rect.x+S&&u>v/2-x&&u<v/2+x){const T=t.DockLocation.LEFT,w=T.getDockRect(this._rect);w.width=w.width/2,E=new o.DropInfo(this,w,T,-1,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(l>this._rect.getRight()-S&&u>v/2-x&&u<v/2+x){const T=t.DockLocation.RIGHT,w=T.getDockRect(this._rect);w.width=w.width/2,w.x+=w.width,E=new o.DropInfo(this,w,T,-1,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(g<this._rect.y+S&&p>_/2-x&&p<_/2+x){const T=t.DockLocation.TOP,w=T.getDockRect(this._rect);w.height=w.height/2,E=new o.DropInfo(this,w,T,-1,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(g>this._rect.getBottom()-S&&p>_/2-x&&p<_/2+x){const T=t.DockLocation.BOTTOM,w=T.getDockRect(this._rect);w.height=w.height/2,w.y+=w.height,E=new o.DropInfo(this,w,T,-1,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT_EDGE)}if(E!==void 0&&!d._canDockInto(d,E))return}return E}drop(d,l,g){const u=l,p=d.getParent();p&&p._removeChild(d),p!==void 0&&p.getType()===m.TabSetNode.TYPE&&p._setSelected(0),p!==void 0&&p.getType()===a.BorderNode.TYPE&&p._setSelected(-1);let _;if(d instanceof m.TabSetNode)_=d;else{const x=this._model._getOnCreateTabSet();_=new m.TabSetNode(this._model,x?x(d):{}),_._addChild(d)}let v=this._children.reduce((x,E)=>x+E.getWeight(),0);v===0&&(v=100),_._setWeight(v/3);const S=!this._model.isRootOrientationVertical();if(S&&u===t.DockLocation.LEFT||!S&&u===t.DockLocation.TOP)this._addChild(_,0);else if(S&&u===t.DockLocation.RIGHT||!S&&u===t.DockLocation.BOTTOM)this._addChild(_);else if(S&&u===t.DockLocation.TOP||!S&&u===t.DockLocation.LEFT){const x=new Ue(this._model,{}),E=new Ue(this._model,{});E._setWeight(75),_._setWeight(25);for(const T of this._children)E._addChild(T);this._removeAll(),x._addChild(_),x._addChild(E),this._addChild(x)}else if(S&&u===t.DockLocation.BOTTOM||!S&&u===t.DockLocation.RIGHT){const x=new Ue(this._model,{}),E=new Ue(this._model,{});E._setWeight(75),_._setWeight(25);for(const T of this._children)E._addChild(T);this._removeAll(),x._addChild(E),x._addChild(_),this._addChild(x)}this._model._setActiveTabset(_),this._model._tidy()}toJson(){const d={};Ue._attributeDefinitions.toJson(d,this._attributes),d.children=[];for(const l of this._children)d.children.push(l.toJson());return d}isEnableDrop(){return!0}_getPrefSize(d){let l=this.getWidth();return d===i.Orientation.VERT&&(l=this.getHeight()),l}_getAttributeDefinitions(){return Ue._attributeDefinitions}_updateAttrs(d){Ue._attributeDefinitions.update(d,this._attributes)}static getAttributeDefinitions(){return Ue._attributeDefinitions}};return En.RowNode=h,h.TYPE="row",h._attributeDefinitions=h._createAttributeDefinitions(),En}var $i;function Ct(){if($i)return xn;$i=1,Object.defineProperty(xn,"__esModule",{value:!0}),xn.TabSetNode=void 0;const n=_t,e=bt,t=rt,o=Xt,i=Ce,r=Me,s=Le,a=vt(),c=Tt,f=Uo(),m=Nt,h=Po();let b=class wt extends c.Node{static _fromJson(l,g){const u=new wt(g,l);if(l.children!=null)for(const p of l.children){const _=m.TabNode._fromJson(p,g);u._addChild(_)}return u._children.length===0&&u._setSelected(-1),l.maximized&&l.maximized===!0&&g._setMaximizedTabset(u),l.active&&l.active===!0&&g._setActiveTabset(u),u}static _createAttributeDefinitions(){const l=new e.AttributeDefinitions;return l.add("type",wt.TYPE,!0).setType(n.Attribute.STRING).setFixed(),l.add("id",void 0).setType(n.Attribute.STRING),l.add("weight",100).setType(n.Attribute.NUMBER),l.add("width",void 0).setType(n.Attribute.NUMBER),l.add("height",void 0).setType(n.Attribute.NUMBER),l.add("selected",0).setType(n.Attribute.NUMBER),l.add("name",void 0).setType(n.Attribute.STRING),l.add("config",void 0).setType("any"),l.addInherited("enableDeleteWhenEmpty","tabSetEnableDeleteWhenEmpty"),l.addInherited("enableDrop","tabSetEnableDrop"),l.addInherited("enableDrag","tabSetEnableDrag"),l.addInherited("enableDivide","tabSetEnableDivide"),l.addInherited("enableMaximize","tabSetEnableMaximize"),l.addInherited("enableClose","tabSetEnableClose"),l.addInherited("enableSingleTabStretch","tabSetEnableSingleTabStretch"),l.addInherited("classNameTabStrip","tabSetClassNameTabStrip"),l.addInherited("classNameHeader","tabSetClassNameHeader"),l.addInherited("enableTabStrip","tabSetEnableTabStrip"),l.addInherited("borderInsets","tabSetBorderInsets"),l.addInherited("marginInsets","tabSetMarginInsets"),l.addInherited("minWidth","tabSetMinWidth"),l.addInherited("minHeight","tabSetMinHeight"),l.addInherited("headerHeight","tabSetHeaderHeight"),l.addInherited("tabStripHeight","tabSetTabStripHeight"),l.addInherited("tabLocation","tabSetTabLocation"),l.addInherited("autoSelectTab","tabSetAutoSelectTab").setType(n.Attribute.BOOLEAN),l}constructor(l,g){super(l),wt._attributeDefinitions.fromJson(g,this._attributes),l._addNode(this),this._calculatedTabBarHeight=0,this._calculatedHeaderBarHeight=0}getName(){return this._getAttr("name")}getSelected(){const l=this._attributes.selected;return l!==void 0?l:-1}getSelectedNode(){const l=this.getSelected();if(l!==-1)return this._children[l]}getWeight(){return this._getAttr("weight")}getWidth(){return this._getAttr("width")}getMinWidth(){return this._getAttr("minWidth")}getHeight(){return this._getAttr("height")}getMinHeight(){return this._getAttr("minHeight")}getMinSize(l){return l===i.Orientation.HORZ?this.getMinWidth():this.getMinHeight()}getConfig(){return this._attributes.config}isMaximized(){return this._model.getMaximizedTabset()===this}isActive(){return this._model.getActiveTabset()===this}isEnableDeleteWhenEmpty(){return this._getAttr("enableDeleteWhenEmpty")}isEnableDrop(){return this._getAttr("enableDrop")}isEnableDrag(){return this._getAttr("enableDrag")}isEnableDivide(){return this._getAttr("enableDivide")}isEnableMaximize(){return this._getAttr("enableMaximize")}isEnableClose(){return this._getAttr("enableClose")}isEnableSingleTabStretch(){return this._getAttr("enableSingleTabStretch")}canMaximize(){return this.isEnableMaximize()?this.getModel().getMaximizedTabset()===this?!0:!(this.getParent()===this.getModel().getRoot()&&this.getModel().getRoot().getChildren().length===1):!1}isEnableTabStrip(){return this._getAttr("enableTabStrip")}isAutoSelectTab(){return this._getAttr("autoSelectTab")}getClassNameTabStrip(){return this._getAttr("classNameTabStrip")}getClassNameHeader(){return this._getAttr("classNameHeader")}calculateHeaderBarHeight(l){const g=this._getAttr("headerHeight");g!==0?this._calculatedHeaderBarHeight=g:this._calculatedHeaderBarHeight=l.headerBarSize}calculateTabBarHeight(l){const g=this._getAttr("tabStripHeight");g!==0?this._calculatedTabBarHeight=g:this._calculatedTabBarHeight=l.tabBarSize}getHeaderHeight(){return this._calculatedHeaderBarHeight}getTabStripHeight(){return this._calculatedTabBarHeight}getTabLocation(){return this._getAttr("tabLocation")}_setWeight(l){this._attributes.weight=l}_setSelected(l){this._attributes.selected=l}canDrop(l,g,u){let p;if(l===this){const _=t.DockLocation.CENTER,v=this._tabHeaderRect;p=new o.DropInfo(this,v,_,-1,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT)}else if(this._contentRect.contains(g,u)){let _=t.DockLocation.CENTER;this._model.getMaximizedTabset()===void 0&&(_=t.DockLocation.getLocation(this._contentRect,g,u));const v=_.getDockRect(this._rect);p=new o.DropInfo(this,v,_,-1,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT)}else if(this._tabHeaderRect!=null&&this._tabHeaderRect.contains(g,u)){let _,v,S;if(this._children.length===0)_=this._tabHeaderRect.clone(),v=_.y+3,S=_.height-4,_.width=2;else{let x=this._children[0];_=x.getTabRect(),v=_.y,S=_.height;let E=this._tabHeaderRect.x,T=0;for(let w=0;w<this._children.length;w++){if(x=this._children[w],_=x.getTabRect(),T=_.x+_.width/2,g>=E&&g<T){const C=t.DockLocation.CENTER,O=new r.Rect(_.x-2,v,3,S);p=new o.DropInfo(this,O,C,w,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT);break}E=T}}if(p==null){const x=t.DockLocation.CENTER,E=new r.Rect(_.getRight()-2,v,3,S);p=new o.DropInfo(this,E,x,this._children.length,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT)}}if(l._canDockInto(l,p))return p}_layout(l,g){this.calculateHeaderBarHeight(g),this.calculateTabBarHeight(g),this.isMaximized()&&(l=this._model.getRoot().getRect()),l=l.removeInsets(this._getAttr("marginInsets")),this._rect=l,l=l.removeInsets(this._getAttr("borderInsets"));const u=this.getName()!==void 0;let p=0,_=0;u&&(p+=this._calculatedHeaderBarHeight,_+=this._calculatedHeaderBarHeight),this.isEnableTabStrip()&&(this.getTabLocation()==="top"?this._tabHeaderRect=new r.Rect(l.x,l.y+p,l.width,this._calculatedTabBarHeight):this._tabHeaderRect=new r.Rect(l.x,l.y+l.height-this._calculatedTabBarHeight,l.width,this._calculatedTabBarHeight),_+=this._calculatedTabBarHeight,this.getTabLocation()==="top"&&(p+=this._calculatedTabBarHeight)),this._contentRect=new r.Rect(l.x,l.y+p,l.width,l.height-_);for(let v=0;v<this._children.length;v++){const S=this._children[v];S._layout(this._contentRect,g),S._setVisible(v===this.getSelected())}}_delete(){this._parent._removeChild(this)}_remove(l){const g=this._removeChild(l);this._model._tidy(),(0,h.adjustSelectedIndex)(this,g)}drop(l,g,u,p){const _=g;if(this===l)return;let v=l.getParent(),S=0;if(v!==void 0&&(S=v._removeChild(l),v instanceof a.BorderNode&&v.getSelected()===S?v._setSelected(-1):(0,h.adjustSelectedIndex)(v,S)),l.getType()===m.TabNode.TYPE&&v===this&&S<u&&u>0&&u--,_===t.DockLocation.CENTER){let x=u;if(x===-1&&(x=this._children.length),l.getType()===m.TabNode.TYPE)this._addChild(l,x),(p||p!==!1&&this.isAutoSelectTab())&&this._setSelected(x);else{for(let E=0;E<l.getChildren().length;E++){const T=l.getChildren()[E];this._addChild(T,x),x++}this.getSelected()===-1&&this._children.length>0&&this._setSelected(0)}this._model._setActiveTabset(this)}else{let x;if(l instanceof m.TabNode){const w=this._model._getOnCreateTabSet();x=new wt(this._model,w?w(l):{}),x._addChild(l),v=x}else x=l;const E=this._parent,T=E.getChildren().indexOf(this);if(E.getOrientation()===_._orientation)x._setWeight(this.getWeight()/2),this._setWeight(this.getWeight()/2),E._addChild(x,T+_._indexPlus);else{const w=new f.RowNode(this._model,{});w._setWeight(this.getWeight()),w._addChild(this),this._setWeight(50),x._setWeight(50),w._addChild(x,_._indexPlus),E._removeChild(this),E._addChild(w,T)}this._model._setActiveTabset(x)}this._model._tidy()}toJson(){const l={};return wt._attributeDefinitions.toJson(l,this._attributes),l.children=this._children.map(g=>g.toJson()),this.isActive()&&(l.active=!0),this.isMaximized()&&(l.maximized=!0),l}_updateAttrs(l){wt._attributeDefinitions.update(l,this._attributes)}_getAttributeDefinitions(){return wt._attributeDefinitions}_getPrefSize(l){let g=this.getWidth();return l===i.Orientation.VERT&&(g=this.getHeight()),g}static getAttributeDefinitions(){return wt._attributeDefinitions}};return xn.TabSetNode=b,b.TYPE="tabset",b._attributeDefinitions=b._createAttributeDefinitions(),xn}var Ji;function Po(){if(Ji)return st;Ji=1,Object.defineProperty(st,"__esModule",{value:!0}),st.randomUUID=st.adjustSelectedIndex=st.adjustSelectedIndexAfterDock=st.adjustSelectedIndexAfterFloat=void 0;const n=Ct(),e=vt();function t(s){const a=s.getParent();if(a!==null)if(a instanceof n.TabSetNode){let c=!1,f=0;const m=a.getChildren();for(let h=0;h<m.length;h++){const b=m[h];if(b===s)c=!0;else if(!b.isFloating()&&(f=h,c))break}a._setSelected(f)}else a instanceof e.BorderNode&&a._setSelected(-1)}st.adjustSelectedIndexAfterFloat=t;function o(s){const a=s.getParent();if(a!==null&&(a instanceof n.TabSetNode||a instanceof e.BorderNode)){const c=a.getChildren();for(let f=0;f<c.length;f++)if(c[f]===s){a._setSelected(f);return}}}st.adjustSelectedIndexAfterDock=o;function i(s,a){if(s!==void 0&&(s.getType()===n.TabSetNode.TYPE||s.getType()===e.BorderNode.TYPE)){const c=s.getSelected();c!==-1&&(a===c&&s.getChildren().length>0?a>=s.getChildren().length&&s._setSelected(s.getChildren().length-1):a<c?s._setSelected(c-1):a>c||s._setSelected(-1))}}st.adjustSelectedIndex=i;function r(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,s=>(s^crypto.getRandomValues(new Uint8Array(1))[0]&15>>s/4).toString(16))}return st.randomUUID=r,st}var Zi;function vt(){if(Zi)return yn;Zi=1,Object.defineProperty(yn,"__esModule",{value:!0}),yn.BorderNode=void 0;const n=_t,e=bt,t=rt,o=Xt,i=Ce,r=Me,s=Le,a=Tt,c=Gt,f=Nt,m=Po();let h=class Rt extends a.Node{static _fromJson(d,l){const g=t.DockLocation.getByName(d.location),u=new Rt(g,d,l);return d.children&&(u._children=d.children.map(p=>{const _=f.TabNode._fromJson(p,l);return _._setParent(u),_})),u}static _createAttributeDefinitions(){const d=new e.AttributeDefinitions;return d.add("type",Rt.TYPE,!0).setType(n.Attribute.STRING).setFixed(),d.add("selected",-1).setType(n.Attribute.NUMBER),d.add("show",!0).setType(n.Attribute.BOOLEAN),d.add("config",void 0).setType("any"),d.addInherited("barSize","borderBarSize").setType(n.Attribute.NUMBER),d.addInherited("enableDrop","borderEnableDrop").setType(n.Attribute.BOOLEAN),d.addInherited("className","borderClassName").setType(n.Attribute.STRING),d.addInherited("autoSelectTabWhenOpen","borderAutoSelectTabWhenOpen").setType(n.Attribute.BOOLEAN),d.addInherited("autoSelectTabWhenClosed","borderAutoSelectTabWhenClosed").setType(n.Attribute.BOOLEAN),d.addInherited("size","borderSize").setType(n.Attribute.NUMBER),d.addInherited("minSize","borderMinSize").setType(n.Attribute.NUMBER),d.addInherited("enableAutoHide","borderEnableAutoHide").setType(n.Attribute.BOOLEAN),d}constructor(d,l,g){super(g),this._adjustedSize=0,this._calculatedBorderBarSize=0,this._location=d,this._drawChildren=[],this._attributes.id=`border_${d.getName()}`,Rt._attributeDefinitions.fromJson(l,this._attributes),g._addNode(this)}getLocation(){return this._location}getTabHeaderRect(){return this._tabHeaderRect}getRect(){return this._tabHeaderRect}getContentRect(){return this._contentRect}isEnableDrop(){return this._getAttr("enableDrop")}isAutoSelectTab(d){return d==null&&(d=this.getSelected()!==-1),d?this._getAttr("autoSelectTabWhenOpen"):this._getAttr("autoSelectTabWhenClosed")}getClassName(){return this._getAttr("className")}calcBorderBarSize(d){const l=this._getAttr("barSize");l!==0?this._calculatedBorderBarSize=l:this._calculatedBorderBarSize=d.borderBarSize}getBorderBarSize(){return this._calculatedBorderBarSize}getSize(){const d=this._getAttr("size"),l=this.getSelected();if(l===-1)return d;{const g=this._children[l],u=this._location._orientation===i.Orientation.HORZ?g._getAttr("borderWidth"):g._getAttr("borderHeight");return u===-1?d:u}}getMinSize(){return this._getAttr("minSize")}getSelected(){return this._attributes.selected}getSelectedNode(){if(this.getSelected()!==-1)return this._children[this.getSelected()]}getOrientation(){return this._location.getOrientation()}getConfig(){return this._attributes.config}isMaximized(){return!1}isShowing(){return this._attributes.show?!(this._model._getShowHiddenBorder()!==this._location&&this.isAutoHide()&&this._children.length===0):!1}isAutoHide(){return this._getAttr("enableAutoHide")}_setSelected(d){this._attributes.selected=d}_setSize(d){const l=this.getSelected();if(l===-1)this._attributes.size=d;else{const g=this._children[l];(this._location._orientation===i.Orientation.HORZ?g._getAttr("borderWidth"):g._getAttr("borderHeight"))===-1?this._attributes.size=d:this._location._orientation===i.Orientation.HORZ?g._setBorderWidth(d):g._setBorderHeight(d)}}_updateAttrs(d){Rt._attributeDefinitions.update(d,this._attributes)}_getDrawChildren(){return this._drawChildren}_setAdjustedSize(d){this._adjustedSize=d}_getAdjustedSize(){return this._adjustedSize}_layoutBorderOuter(d,l){this.calcBorderBarSize(l);const g=this._location.split(d,this.getBorderBarSize());return this._tabHeaderRect=g.start,g.end}_layoutBorderInner(d,l){this._drawChildren=[];const g=this._location,u=g.split(d,this._adjustedSize+this._model.getSplitterSize()),p=g.reflect().split(u.start,this._model.getSplitterSize());this._contentRect=p.end;for(let _=0;_<this._children.length;_++){const v=this._children[_];v._layout(this._contentRect,l),v._setVisible(_===this.getSelected()),this._drawChildren.push(v)}if(this.getSelected()===-1)return d;{const _=new c.SplitterNode(this._model);return _._setParent(this),_._setRect(p.start),this._drawChildren.push(_),u.end}}_remove(d){const l=this._removeChild(d);this.getSelected()!==-1&&(0,m.adjustSelectedIndex)(this,l)}canDrop(d,l,g){if(d.getType()!==f.TabNode.TYPE)return;let u;const p=t.DockLocation.CENTER;if(this._tabHeaderRect.contains(l,g)){if(this._location._orientation===i.Orientation.VERT)if(this._children.length>0){let _=this._children[0],v=_.getTabRect();const S=v.y,x=v.height;let E=this._tabHeaderRect.x,T=0;for(let w=0;w<this._children.length;w++){if(_=this._children[w],v=_.getTabRect(),T=v.x+v.width/2,l>=E&&l<T){const C=new r.Rect(v.x-2,S,3,x);u=new o.DropInfo(this,C,p,w,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT);break}E=T}if(u==null){const w=new r.Rect(v.getRight()-2,S,3,x);u=new o.DropInfo(this,w,p,this._children.length,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT)}}else{const _=new r.Rect(this._tabHeaderRect.x+1,this._tabHeaderRect.y+2,3,18);u=new o.DropInfo(this,_,p,0,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT)}else if(this._children.length>0){let _=this._children[0],v=_.getTabRect();const S=v.x,x=v.width;let E=this._tabHeaderRect.y,T=0;for(let w=0;w<this._children.length;w++){if(_=this._children[w],v=_.getTabRect(),T=v.y+v.height/2,g>=E&&g<T){const C=new r.Rect(S,v.y-2,x,3);u=new o.DropInfo(this,C,p,w,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT);break}E=T}if(u==null){const w=new r.Rect(S,v.getBottom()-2,x,3);u=new o.DropInfo(this,w,p,this._children.length,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT)}}else{const _=new r.Rect(this._tabHeaderRect.x+2,this._tabHeaderRect.y+1,18,3);u=new o.DropInfo(this,_,p,0,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT)}if(!d._canDockInto(d,u))return}else if(this.getSelected()!==-1&&this._contentRect.contains(l,g)){const _=this._contentRect;if(u=new o.DropInfo(this,_,p,-1,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT),!d._canDockInto(d,u))return}return u}drop(d,l,g,u){let p=0;const _=d.getParent();_!==void 0&&(p=_._removeChild(d),_!==this&&_ instanceof Rt&&_.getSelected()===p?_._setSelected(-1):(0,m.adjustSelectedIndex)(_,p)),d.getType()===f.TabNode.TYPE&&_===this&&p<g&&g>0&&g--;let v=g;v===-1&&(v=this._children.length),d.getType()===f.TabNode.TYPE&&this._addChild(d,v),(u||u!==!1&&this.isAutoSelectTab())&&this._setSelected(v),this._model._tidy()}toJson(){const d={};return Rt._attributeDefinitions.toJson(d,this._attributes),d.location=this._location.getName(),d.children=this._children.map(l=>l.toJson()),d}_getSplitterBounds(d,l=!1){const g=[0,0],u=l?this.getMinSize():0,p=this._model._getOuterInnerRects().outer,_=this._model._getOuterInnerRects().inner,v=this._model.getRoot();return this._location===t.DockLocation.TOP?(g[0]=p.y+u,g[1]=Math.max(g[0],_.getBottom()-d.getHeight()-v.getMinHeight())):this._location===t.DockLocation.LEFT?(g[0]=p.x+u,g[1]=Math.max(g[0],_.getRight()-d.getWidth()-v.getMinWidth())):this._location===t.DockLocation.BOTTOM?(g[1]=p.getBottom()-d.getHeight()-u,g[0]=Math.min(g[1],_.y+v.getMinHeight())):this._location===t.DockLocation.RIGHT&&(g[1]=p.getRight()-d.getWidth()-u,g[0]=Math.min(g[1],_.x+v.getMinWidth())),g}_calculateSplit(d,l){const g=this._getSplitterBounds(d);return this._location===t.DockLocation.BOTTOM||this._location===t.DockLocation.RIGHT?Math.max(0,g[1]-l):Math.max(0,l-g[0])}_getAttributeDefinitions(){return Rt._attributeDefinitions}static getAttributeDefinitions(){return Rt._attributeDefinitions}};return yn.BorderNode=h,h.TYPE="border",h._attributeDefinitions=h._createAttributeDefinitions(),yn}var to={},no={},yt={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.I18nLabel=void 0,function(e){e.Close_Tab="Close",e.Close_Tabset="Close tabset",e.Move_Tab="Move: ",e.Move_Tabset="Move tabset",e.Maximize="Maximize tabset",e.Restore="Restore tabset",e.Float_Tab="Show selected tab in floating window",e.Overflow_Menu_Tooltip="Hidden tabs",e.Floating_Window_Message="This panel is shown in a floating window",e.Floating_Window_Show_Window="Show window",e.Floating_Window_Dock_Window="Dock window",e.Error_rendering_component="Error rendering component"}(n.I18nLabel||(n.I18nLabel={}))})(yt);var oo={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ICloseType=void 0,function(e){e[e.Visible=1]="Visible",e[e.Always=2]="Always",e[e.Selected=3]="Selected"}(n.ICloseType||(n.ICloseType={}))})(oo);var We={};Object.defineProperty(We,"__esModule",{value:!0}),We.isAuxMouseEvent=We.hideElement=We.getRenderStateEx=void 0;const qi=A;function Ca(n,e,t,o,i){let r=t?t(e):void 0,s=e.getName(),a=e.getName();i===void 0&&(i=0);function c(h){return h.titleContent!==void 0}if(o!==void 0){const h=o(e);h!==void 0&&(typeof h=="string"?(s=h,a=h):c(h)?(s=h.titleContent,a=h.name):s=h)}r===void 0&&e.getIcon()!==void 0&&(i!==0?r=qi.createElement("img",{style:{width:"1em",height:"1em",transform:"rotate("+i+"deg)"},src:e.getIcon(),alt:"leadingContent"}):r=qi.createElement("img",{style:{width:"1em",height:"1em"},src:e.getIcon(),alt:"leadingContent"}));const m={leading:r,content:s,name:a,buttons:[]};return n.customizeTab(e,m),e._setRenderedName(m.name),m}We.getRenderStateEx=Ca;function La(n,e){e?n.visibility="hidden":n.display="none"}We.hideElement=La;function Da(n){let e=!1;return n.nativeEvent instanceof MouseEvent&&(n.nativeEvent.button!==0||n.ctrlKey||n.altKey||n.metaKey||n.shiftKey)&&(e=!0),e}We.isAuxMouseEvent=Da,Object.defineProperty(no,"__esModule",{value:!0}),no.BorderButton=void 0;const Lt=A,Ia=yt,jo=Ze,Ba=Me,Ki=oo,Dt=Le,Ho=We,Ma=n=>{const{layout:e,node:t,selected:o,border:i,iconFactory:r,titleFactory:s,icons:a,path:c}=n,f=Lt.useRef(null),m=Lt.useRef(null),h=R=>{!(0,Ho.isAuxMouseEvent)(R)&&!e.getEditingTab()&&e.dragStart(R,void 0,t,t.isEnableDrag(),l,g)},b=R=>{(0,Ho.isAuxMouseEvent)(R)&&e.auxMouseClick(t,R)},d=R=>{e.showContextMenu(t,R)},l=()=>{e.doAction(jo.Actions.selectTab(t.getId()))},g=R=>{},u=()=>{const R=t.getCloseType();return!!(o||R===Ki.ICloseType.Always||R===Ki.ICloseType.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches)},p=R=>{u()?e.doAction(jo.Actions.deleteTab(t.getId())):l()},_=R=>{R.stopPropagation()};Lt.useLayoutEffect(()=>{v(),e.getEditingTab()===t&&m.current.select()});const v=()=>{var R;const F=e.getDomRect(),k=(R=f.current)===null||R===void 0?void 0:R.getBoundingClientRect();k&&F&&t._setTabRect(new Ba.Rect(k.left-F.left,k.top-F.top,k.width,k.height))},S=R=>{R.stopPropagation()},x=R=>{R.code==="Escape"?e.setEditingTab(void 0):R.code==="Enter"&&(e.setEditingTab(void 0),e.doAction(jo.Actions.renameTab(t.getId(),R.target.value)))},E=e.getClassName;let T=E(Dt.CLASSES.FLEXLAYOUT__BORDER_BUTTON)+" "+E(Dt.CLASSES.FLEXLAYOUT__BORDER_BUTTON_+i);o?T+=" "+E(Dt.CLASSES.FLEXLAYOUT__BORDER_BUTTON__SELECTED):T+=" "+E(Dt.CLASSES.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED),t.getClassName()!==void 0&&(T+=" "+t.getClassName());let w=0;t.getModel().isEnableRotateBorderIcons()===!1&&(i==="left"?w=90:i==="right"&&(w=-90));const C=(0,Ho.getRenderStateEx)(e,t,r,s,w);let O=C.content?Lt.createElement("div",{className:E(Dt.CLASSES.FLEXLAYOUT__BORDER_BUTTON_CONTENT)},C.content):null;const L=C.leading?Lt.createElement("div",{className:E(Dt.CLASSES.FLEXLAYOUT__BORDER_BUTTON_LEADING)},C.leading):null;if(e.getEditingTab()===t&&(O=Lt.createElement("input",{ref:m,className:E(Dt.CLASSES.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":c+"/textbox",type:"text",autoFocus:!0,defaultValue:t.getName(),onKeyDown:x,onMouseDown:S,onTouchStart:S})),t.isEnableClose()){const R=e.i18nName(Ia.I18nLabel.Close_Tab);C.buttons.push(Lt.createElement("div",{key:"close","data-layout-path":c+"/button/close",title:R,className:E(Dt.CLASSES.FLEXLAYOUT__BORDER_BUTTON_TRAILING),onMouseDown:_,onClick:p,onTouchStart:_},typeof a.close=="function"?a.close(t):a.close))}return Lt.createElement("div",{ref:f,"data-layout-path":c,className:T,onMouseDown:h,onClick:b,onAuxClick:b,onContextMenu:d,onTouchStart:h,title:t.getHelpText()},L,O,C.buttons)};no.BorderButton=Ma;var Sn={},wn={};Object.defineProperty(wn,"__esModule",{value:!0}),wn.TabButtonStamp=void 0;const io=A,Wo=Le,ka=We,za=n=>{const{layout:e,node:t,iconFactory:o,titleFactory:i}=n,r=io.useRef(null),s=e.getClassName;let a=s(Wo.CLASSES.FLEXLAYOUT__TAB_BUTTON_STAMP);const c=(0,ka.getRenderStateEx)(e,t,o,i);let f=c.content?io.createElement("div",{className:s(Wo.CLASSES.FLEXLAYOUT__TAB_BUTTON_CONTENT)},c.content):t._getNameForOverflowMenu();const m=c.leading?io.createElement("div",{className:s(Wo.CLASSES.FLEXLAYOUT__TAB_BUTTON_LEADING)},c.leading):null;return io.createElement("div",{ref:r,className:a,title:t.getHelpText()},m,f)};wn.TabButtonStamp=za,Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.showPopup=void 0;const ro=A,Yo=Yt,Xo=Le,Fa=wn;function Ua(n,e,t,o,i,r){var s;const a=o.getRootDiv(),c=o.getClassName,f=n.ownerDocument,m=n.getBoundingClientRect(),h=(s=a==null?void 0:a.getBoundingClientRect())!==null&&s!==void 0?s:new DOMRect(0,0,100,100),b=f.createElement("div");b.className=c(Xo.CLASSES.FLEXLAYOUT__POPUP_MENU_CONTAINER),m.left<h.left+h.width/2?b.style.left=m.left-h.left+"px":b.style.right=h.right-m.right+"px",m.top<h.top+h.height/2?b.style.top=m.top-h.top+"px":b.style.bottom=h.bottom-m.bottom+"px",Yo.DragDrop.instance.addGlass(()=>d()),Yo.DragDrop.instance.setGlassCursorOverride("default"),a&&a.appendChild(b);const d=()=>{o.hidePortal(),Yo.DragDrop.instance.hideGlass(),a&&a.removeChild(b),b.removeEventListener("mousedown",l),f.removeEventListener("mousedown",g)},l=u=>{u.stopPropagation()},g=u=>{d()};b.addEventListener("mousedown",l),f.addEventListener("mousedown",g),o.showPortal(ro.createElement(Pa,{currentDocument:f,onSelect:t,onHide:d,items:e,classNameMapper:c,layout:o,iconFactory:i,titleFactory:r}),b)}Sn.showPopup=Ua;const Pa=n=>{const{items:e,onHide:t,onSelect:o,classNameMapper:i,layout:r,iconFactory:s,titleFactory:a}=n,c=(m,h)=>{o(m),t(),h.stopPropagation()},f=e.map((m,h)=>ro.createElement("div",{key:m.index,className:i(Xo.CLASSES.FLEXLAYOUT__POPUP_MENU_ITEM),"data-layout-path":"/popup-menu/tb"+h,onClick:b=>c(m,b),title:m.node.getHelpText()},m.node.getModel().isLegacyOverflowMenu()?m.node._getNameForOverflowMenu():ro.createElement(Fa.TabButtonStamp,{node:m.node,layout:r,iconFactory:s,titleFactory:a})));return ro.createElement("div",{className:i(Xo.CLASSES.FLEXLAYOUT__POPUP_MENU),"data-layout-path":"/popup-menu"},f)};var Rn={};Object.defineProperty(Rn,"__esModule",{value:!0}),Rn.useTabOverflow=void 0;const at=A,ja=Me,Qi=Ct(),Go=Ce,Ha=(n,e,t,o)=>{const i=at.useRef(!0),r=at.useRef(!1),s=at.useRef(new ja.Rect(0,0,0,0)),a=at.useRef(null),[c,f]=at.useState(0),m=at.useRef(!1),[h,b]=at.useState([]),d=at.useRef(0);at.useLayoutEffect(()=>{m.current=!1},[n.getSelectedNode(),n.getRect().width,n.getRect().height]),at.useLayoutEffect(()=>{v()});const l=a.current;at.useEffect(()=>{if(l)return l.addEventListener("wheel",g,{passive:!1}),()=>{l.removeEventListener("wheel",g)}},[l]);const g=x=>{x.preventDefault()},u=x=>e===Go.Orientation.HORZ?x.x:x.y,p=x=>e===Go.Orientation.HORZ?x.getRight():x.getBottom(),_=x=>e===Go.Orientation.HORZ?x.width:x.height,v=()=>{i.current===!0&&(r.current=!1);const E=n instanceof Qi.TabSetNode?n.getRect():n.getTabHeaderRect();let T=n.getChildren()[n.getChildren().length-1];const w=o.current===null?0:_(o.current.getBoundingClientRect());if(i.current===!0||d.current===0&&h.length!==0||E.width!==s.current.width||E.height!==s.current.height){d.current=h.length,s.current=E;const C=n instanceof Qi.TabSetNode?n.isEnableTabStrip()===!0:!0;let O=p(E)-w;if(t.current!==null&&(O-=_(t.current.getBoundingClientRect())),C&&n.getChildren().length>0){if(h.length===0&&c===0&&p(T.getTabRect())+2<O)return;let L=0;const R=n.getSelectedNode();if(R&&!m.current){const j=R.getTabRect(),z=u(j)-2,V=p(j)+2;_(j)+2*2>=O-u(E)?L=u(E)-z:(V>O||z<u(E))&&(z<u(E)&&(L=u(E)-z),V+L>O&&(L=O-V))}const F=Math.max(0,O-(p(T.getTabRect())+2+L)),k=Math.min(0,c+L+F),B=k-c,Y=[];for(let j=0;j<n.getChildren().length;j++){const z=n.getChildren()[j];(u(z.getTabRect())+B<u(E)||p(z.getTabRect())+B>O)&&Y.push({node:z,index:j})}Y.length>0&&(r.current=!0),i.current=!1,b(Y),f(k)}}else i.current=!0};return{selfRef:a,position:c,userControlledLeft:m,hiddenTabs:h,onMouseWheel:x=>{let E=0;Math.abs(x.deltaX)>Math.abs(x.deltaY)?E=-x.deltaX:E=-x.deltaY,x.deltaMode===1&&(E*=40),f(c+E),m.current=!0,x.stopPropagation()},tabsTruncated:r.current}};Rn.useTabOverflow=Ha,Object.defineProperty(to,"__esModule",{value:!0}),to.BorderTabSet=void 0;const Pe=A,er=rt,Wa=no,Ya=Sn,tr=Ze,nr=yt,Xa=Rn,Ga=Ce,ke=Le,Va=We,$a=n=>{const{border:e,layout:t,iconFactory:o,titleFactory:i,icons:r,path:s}=n,a=Pe.useRef(null),c=Pe.useRef(null),f=Pe.useRef(null),{selfRef:m,position:h,userControlledLeft:b,hiddenTabs:d,onMouseWheel:l,tabsTruncated:g}=(0,Xa.useTabOverflow)(e,Ga.Orientation.flip(e.getOrientation()),a,f),u=z=>{(0,Va.isAuxMouseEvent)(z)&&t.auxMouseClick(e,z)},p=z=>{t.showContextMenu(e,z)},_=z=>{z.stopPropagation()},v=z=>{const V=t.getShowOverflowMenu();if(V!==void 0)V(e,z,d,S);else{const ae=c.current;(0,Ya.showPopup)(ae,d,S,t,o,i)}z.stopPropagation()},S=z=>{t.doAction(tr.Actions.selectTab(z.node.getId())),b.current=!1},x=z=>{const V=e.getChildren()[e.getSelected()];V!==void 0&&t.doAction(tr.Actions.floatTab(V.getId())),z.stopPropagation()},E=t.getClassName;let T=e.getTabHeaderRect().styleWithPosition({});const w=[],C=z=>{let V=e.getSelected()===z,ae=e.getChildren()[z];w.push(Pe.createElement(Wa.BorderButton,{layout:t,border:e.getLocation().getName(),node:ae,path:s+"/tb"+z,key:ae.getId(),selected:V,iconFactory:o,titleFactory:i,icons:r})),z<e.getChildren().length-1&&w.push(Pe.createElement("div",{key:"divider"+z,className:E(ke.CLASSES.FLEXLAYOUT__BORDER_TAB_DIVIDER)}))};for(let z=0;z<e.getChildren().length;z++)C(z);let O=E(ke.CLASSES.FLEXLAYOUT__BORDER)+" "+E(ke.CLASSES.FLEXLAYOUT__BORDER_+e.getLocation().getName());e.getClassName()!==void 0&&(O+=" "+e.getClassName());let L=[],R=[];const F={headerContent:void 0,buttons:L,stickyButtons:R,headerButtons:[],overflowPosition:void 0};if(t.customizeTabSet(e,F),L=F.buttons,F.overflowPosition===void 0&&(F.overflowPosition=R.length),R.length>0&&(g?L=[...R,...L]:w.push(Pe.createElement("div",{ref:f,key:"sticky_buttons_container",onMouseDown:_,onTouchStart:_,onDragStart:z=>{z.preventDefault()},className:E(ke.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER)},R))),d.length>0){const z=t.i18nName(nr.I18nLabel.Overflow_Menu_Tooltip);let V;typeof r.more=="function"?V=r.more(e,d):V=Pe.createElement(Pe.Fragment,null,r.more,Pe.createElement("div",{className:E(ke.CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT)},d.length)),L.splice(Math.min(F.overflowPosition,L.length),0,Pe.createElement("button",{key:"overflowbutton",ref:c,className:E(ke.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+E(ke.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW)+" "+E(ke.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_+e.getLocation().getName()),title:z,onClick:v,onMouseDown:_,onTouchStart:_},V))}const k=e.getSelected();if(k!==-1){const z=e.getChildren()[k];if(z!==void 0&&t.isSupportsPopout()&&z.isEnableFloat()&&!z.isFloating()){const V=t.i18nName(nr.I18nLabel.Float_Tab);L.push(Pe.createElement("button",{key:"float",title:V,className:E(ke.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+E(ke.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT),onClick:x,onMouseDown:_,onTouchStart:_},typeof r.popout=="function"?r.popout(z):r.popout))}}const B=Pe.createElement("div",{key:"toolbar",ref:a,className:E(ke.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR)+" "+E(ke.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_+e.getLocation().getName())},L);T=t.styleFont(T);let Y={};const j=e.getBorderBarSize()-1;return e.getLocation()===er.DockLocation.LEFT?Y={right:j,height:j,top:h}:e.getLocation()===er.DockLocation.RIGHT?Y={left:j,height:j,top:h}:Y={height:j,left:h},Pe.createElement("div",{ref:m,dir:"ltr",style:T,className:O,"data-layout-path":s,onClick:u,onAuxClick:u,onContextMenu:p,onWheel:l},Pe.createElement("div",{style:{height:j},className:E(ke.CLASSES.FLEXLAYOUT__BORDER_INNER)+" "+E(ke.CLASSES.FLEXLAYOUT__BORDER_INNER_+e.getLocation().getName())},Pe.createElement("div",{style:Y,className:E(ke.CLASSES.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER)+" "+E(ke.CLASSES.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_+e.getLocation().getName())},w)),B)};to.BorderTabSet=$a;var so={};Object.defineProperty(so,"__esModule",{value:!0}),so.Splitter=void 0;const An=A,or=Yt,ir=Ze,rr=vt(),xt=Ce,On=Le,Ja=n=>{const{layout:e,node:t,path:o}=n,i=An.useRef([]),r=An.useRef(void 0),s=t.getParent(),a=v=>{var S;or.DragDrop.instance.setGlassCursorOverride(t.getOrientation()===xt.Orientation.HORZ?"ns-resize":"ew-resize"),or.DragDrop.instance.startDrag(v,f,m,b,c,void 0,void 0,e.getCurrentDocument(),(S=e.getRootDiv())!==null&&S!==void 0?S:void 0),i.current=s._getSplitterBounds(t,!0);const x=e.getRootDiv();r.current=e.getCurrentDocument().createElement("div"),r.current.style.position="absolute",r.current.className=e.getClassName(On.CLASSES.FLEXLAYOUT__SPLITTER_DRAG),r.current.style.cursor=t.getOrientation()===xt.Orientation.HORZ?"ns-resize":"ew-resize";const E=t.getRect();t.getOrientation()===xt.Orientation.VERT&&E.width<2?E.width=2:t.getOrientation()===xt.Orientation.HORZ&&E.height<2&&(E.height=2),E.positionElement(r.current),x&&x.appendChild(r.current)},c=v=>{const S=e.getRootDiv();S&&S.removeChild(r.current)},f=()=>!0,m=v=>{const S=e.getDomRect();if(!S)return;const x={x:v.clientX-S.left,y:v.clientY-S.top};r&&(t.getOrientation()===xt.Orientation.HORZ?r.current.style.top=d(x.y-4)+"px":r.current.style.left=d(x.x-4)+"px"),e.isRealtimeResize()&&h()},h=()=>{let v=0;if(r&&(t.getOrientation()===xt.Orientation.HORZ?v=r.current.offsetTop:v=r.current.offsetLeft),s instanceof rr.BorderNode){const S=s._calculateSplit(t,v);e.doAction(ir.Actions.adjustBorderSplit(t.getParent().getId(),S))}else{const S=s._calculateSplit(t,v);S!==void 0&&e.doAction(ir.Actions.adjustSplit(S))}},b=()=>{h();const v=e.getRootDiv();v&&v.removeChild(r.current)},d=v=>{const S=i.current;let x=v;return v<S[0]&&(x=S[0]),v>S[1]&&(x=S[1]),x},l=e.getClassName;let g=t.getRect();const u=g.styleWithPosition({cursor:t.getOrientation()===xt.Orientation.HORZ?"ns-resize":"ew-resize"});let p=l(On.CLASSES.FLEXLAYOUT__SPLITTER)+" "+l(On.CLASSES.FLEXLAYOUT__SPLITTER_+t.getOrientation().getName());s instanceof rr.BorderNode?p+=" "+l(On.CLASSES.FLEXLAYOUT__SPLITTER_BORDER):t.getModel().getMaximizedTabset()!==void 0&&(u.display="none");const _=t.getModel().getSplitterExtra();if(_===0)return An.createElement("div",{style:u,"data-layout-path":o,className:p,onTouchStart:a,onMouseDown:a});{let v=g.clone();v.x=0,v.y=0,t.getOrientation()===xt.Orientation.VERT?v.width+=_:v.height+=_;const S=v.styleWithPosition({cursor:t.getOrientation()===xt.Orientation.HORZ?"ns-resize":"ew-resize"}),x=l(On.CLASSES.FLEXLAYOUT__SPLITTER_EXTRA);return An.createElement("div",{style:u,"data-layout-path":o,className:p},An.createElement("div",{style:S,className:x,onTouchStart:a,onMouseDown:a}))}};so.Splitter=Ja;var ao={},Nn={};Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.ErrorBoundary=void 0;const Vo=A,sr=Le;class Za extends Vo.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.debug(e),console.debug(t)}render(){return this.state.hasError?Vo.createElement("div",{className:sr.CLASSES.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER},Vo.createElement("div",{className:sr.CLASSES.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT},this.props.message)):this.props.children}}Nn.ErrorBoundary=Za,Object.defineProperty(ao,"__esModule",{value:!0}),ao.Tab=void 0;const Cn=A,qa=A,Ka=Ze,ar=Ct(),$o=Le,Qa=Nn,el=yt,tl=vt(),lr=We,nl=n=>{const{layout:e,selected:t,node:o,factory:i,path:r}=n,[s,a]=Cn.useState(!n.node.isEnableRenderOnDemand()||n.selected);Cn.useLayoutEffect(()=>{!s&&t&&a(!0)});const c=()=>{const g=o.getParent();g.getType()===ar.TabSetNode.TYPE&&(g.isActive()||e.doAction(Ka.Actions.setActiveTabset(g.getId())))},f=e.getClassName,m=o.getModel().isUseVisibility(),h=o.getParent(),b=o._styleWithPosition();t||(0,lr.hideElement)(b,m),h instanceof ar.TabSetNode&&o.getModel().getMaximizedTabset()!==void 0&&!h.isMaximized()&&(0,lr.hideElement)(b,m);let d;s&&(d=i(o));let l=f($o.CLASSES.FLEXLAYOUT__TAB);return h instanceof tl.BorderNode&&(l+=" "+f($o.CLASSES.FLEXLAYOUT__TAB_BORDER),l+=" "+f($o.CLASSES.FLEXLAYOUT__TAB_BORDER_+h.getLocation().getName())),o.getContentClassName()!==void 0&&(l+=" "+o.getContentClassName()),Cn.createElement("div",{className:l,"data-layout-path":r,onMouseDown:c,onTouchStart:c,style:b},Cn.createElement(Qa.ErrorBoundary,{message:n.layout.i18nName(el.I18nLabel.Error_rendering_component)},Cn.createElement(qa.Fragment,null,d)))};ao.Tab=nl;var lo={},co={};Object.defineProperty(co,"__esModule",{value:!0}),co.TabButton=void 0;const It=A,ol=yt,Jo=Ze,il=Me,dr=oo,sn=Le,Zo=We,rl=n=>{const{layout:e,node:t,selected:o,iconFactory:i,titleFactory:r,icons:s,path:a}=n,c=It.useRef(null),f=It.useRef(null),m=B=>{!(0,Zo.isAuxMouseEvent)(B)&&!e.getEditingTab()&&e.dragStart(B,void 0,t,t.isEnableDrag(),d,l)},h=B=>{(0,Zo.isAuxMouseEvent)(B)&&e.auxMouseClick(t,B)},b=B=>{e.showContextMenu(t,B)},d=()=>{e.doAction(Jo.Actions.selectTab(t.getId()))},l=B=>{t.isEnableRename()&&g()},g=()=>{e.setEditingTab(t),e.getCurrentDocument().body.addEventListener("mousedown",u),e.getCurrentDocument().body.addEventListener("touchstart",u)},u=B=>{B.target!==f.current&&(e.getCurrentDocument().body.removeEventListener("mousedown",u),e.getCurrentDocument().body.removeEventListener("touchstart",u),e.setEditingTab(void 0))},p=()=>{const B=t.getCloseType();return!!(o||B===dr.ICloseType.Always||B===dr.ICloseType.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches)},_=B=>{p()?e.doAction(Jo.Actions.deleteTab(t.getId())):d()},v=B=>{B.stopPropagation()};It.useLayoutEffect(()=>{S(),e.getEditingTab()===t&&f.current.select()});const S=()=>{var B;const Y=e.getDomRect(),j=(B=c.current)===null||B===void 0?void 0:B.getBoundingClientRect();j&&Y&&t._setTabRect(new il.Rect(j.left-Y.left,j.top-Y.top,j.width,j.height))},x=B=>{B.stopPropagation()},E=B=>{B.code==="Escape"?e.setEditingTab(void 0):B.code==="Enter"&&(e.setEditingTab(void 0),e.doAction(Jo.Actions.renameTab(t.getId(),B.target.value)))},T=e.getClassName,w=t.getParent(),C=w.isEnableSingleTabStretch()&&w.getChildren().length===1;let O=C?sn.CLASSES.FLEXLAYOUT__TAB_BUTTON_STRETCH:sn.CLASSES.FLEXLAYOUT__TAB_BUTTON,L=T(O);L+=" "+T(O+"_"+w.getTabLocation()),C||(o?L+=" "+T(O+"--selected"):L+=" "+T(O+"--unselected")),t.getClassName()!==void 0&&(L+=" "+t.getClassName());const R=(0,Zo.getRenderStateEx)(e,t,i,r);let F=R.content?It.createElement("div",{className:T(sn.CLASSES.FLEXLAYOUT__TAB_BUTTON_CONTENT)},R.content):null;const k=R.leading?It.createElement("div",{className:T(sn.CLASSES.FLEXLAYOUT__TAB_BUTTON_LEADING)},R.leading):null;if(e.getEditingTab()===t&&(F=It.createElement("input",{ref:f,className:T(sn.CLASSES.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":a+"/textbox",type:"text",autoFocus:!0,defaultValue:t.getName(),onKeyDown:E,onMouseDown:x,onTouchStart:x})),t.isEnableClose()&&!C){const B=e.i18nName(ol.I18nLabel.Close_Tab);R.buttons.push(It.createElement("div",{key:"close","data-layout-path":a+"/button/close",title:B,className:T(sn.CLASSES.FLEXLAYOUT__TAB_BUTTON_TRAILING),onMouseDown:v,onClick:_,onTouchStart:v},typeof s.close=="function"?s.close(t):s.close))}return It.createElement("div",{ref:c,"data-layout-path":a,className:L,onMouseDown:m,onClick:h,onAuxClick:h,onContextMenu:b,onTouchStart:m,title:t.getHelpText()},k,F,R.buttons)};co.TabButton=rl,Object.defineProperty(lo,"__esModule",{value:!0}),lo.TabSet=void 0;const me=A,Vt=yt,Ln=Ze,sl=Sn,al=co,ll=Rn,dl=Ce,_e=Le,qo=We,cl=n=>{const{node:e,layout:t,iconFactory:o,titleFactory:i,icons:r,path:s}=n,a=me.useRef(null),c=me.useRef(null),f=me.useRef(null),m=me.useRef(null),{selfRef:h,position:b,userControlledLeft:d,hiddenTabs:l,onMouseWheel:g,tabsTruncated:u}=(0,ll.useTabOverflow)(e,dl.Orientation.HORZ,a,m),p=P=>{const Z=t.getShowOverflowMenu();if(Z!==void 0)Z(e,P,l,_);else{const de=c.current;(0,sl.showPopup)(de,l,_,t,o,i)}P.stopPropagation()},_=P=>{t.doAction(Ln.Actions.selectTab(P.node.getId())),d.current=!1},v=P=>{if(!(0,qo.isAuxMouseEvent)(P)){let Z=e.getName();if(Z===void 0?Z="":Z=": "+Z,t.doAction(Ln.Actions.setActiveTabset(e.getId())),!t.getEditingTab()){const de=t.i18nName(Vt.I18nLabel.Move_Tabset,Z);e.getModel().getMaximizedTabset()!==void 0?t.dragStart(P,de,e,!1,Ae=>{},L):t.dragStart(P,de,e,e.isEnableDrag(),Ae=>{},L)}}},S=P=>{(0,qo.isAuxMouseEvent)(P)&&t.auxMouseClick(e,P)},x=P=>{t.showContextMenu(e,P)},E=P=>{P.stopPropagation()},T=P=>{e.canMaximize()&&t.maximize(e),P.stopPropagation()},w=P=>{t.doAction(Ln.Actions.deleteTabset(e.getId())),P.stopPropagation()},C=P=>{t.doAction(Ln.Actions.deleteTab(e.getChildren()[0].getId())),P.stopPropagation()},O=P=>{F!==void 0&&t.doAction(Ln.Actions.floatTab(F.getId())),P.stopPropagation()},L=P=>{e.canMaximize()&&t.maximize(e)},R=t.getClassName;f.current!==null&&f.current.scrollLeft!==0&&(f.current.scrollLeft=0);const F=e.getSelectedNode();let k=e._styleWithPosition();e.getModel().getMaximizedTabset()!==void 0&&!e.isMaximized()&&(0,qo.hideElement)(k,e.getModel().isUseVisibility());const B=[];if(e.isEnableTabStrip())for(let P=0;P<e.getChildren().length;P++){const Z=e.getChildren()[P];let de=e.getSelected()===P;B.push(me.createElement(al.TabButton,{layout:t,node:Z,path:s+"/tb"+P,key:Z.getId(),selected:de,iconFactory:o,titleFactory:i,icons:r})),P<e.getChildren().length-1&&B.push(me.createElement("div",{key:"divider"+P,className:R(_e.CLASSES.FLEXLAYOUT__TABSET_TAB_DIVIDER)}))}const Y=e.getName()!==void 0;let j=[],z=[],V=[];const ae={headerContent:e.getName(),stickyButtons:j,buttons:z,headerButtons:V,overflowPosition:void 0};t.customizeTabSet(e,ae);const N=ae.headerContent;j=ae.stickyButtons,z=ae.buttons,V=ae.headerButtons;const W=e.isEnableSingleTabStretch()&&e.getChildren().length===1,oe=W&&e.getChildren()[0].isEnableClose()||e.isEnableClose();if(ae.overflowPosition===void 0&&(ae.overflowPosition=j.length),j.length>0&&(u||W?z=[...j,...z]:B.push(me.createElement("div",{ref:m,key:"sticky_buttons_container",onMouseDown:E,onTouchStart:E,onDragStart:P=>{P.preventDefault()},className:R(_e.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER)},j))),l.length>0){const P=t.i18nName(Vt.I18nLabel.Overflow_Menu_Tooltip);let Z;typeof r.more=="function"?Z=r.more(e,l):Z=me.createElement(me.Fragment,null,r.more,me.createElement("div",{className:R(_e.CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT)},l.length)),z.splice(Math.min(ae.overflowPosition,z.length),0,me.createElement("button",{key:"overflowbutton","data-layout-path":s+"/button/overflow",ref:c,className:R(_e.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+R(_e.CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW),title:P,onClick:p,onMouseDown:E,onTouchStart:E},Z))}if(F!==void 0&&t.isSupportsPopout()&&F.isEnableFloat()&&!F.isFloating()){const P=t.i18nName(Vt.I18nLabel.Float_Tab);z.push(me.createElement("button",{key:"float","data-layout-path":s+"/button/float",title:P,className:R(_e.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+R(_e.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT),onClick:O,onMouseDown:E,onTouchStart:E},typeof r.popout=="function"?r.popout(F):r.popout))}if(e.canMaximize()){const P=t.i18nName(Vt.I18nLabel.Restore),Z=t.i18nName(Vt.I18nLabel.Maximize);(Y?V:z).push(me.createElement("button",{key:"max","data-layout-path":s+"/button/max",title:e.isMaximized()?P:Z,className:R(_e.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+R(_e.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_+(e.isMaximized()?"max":"min")),onClick:T,onMouseDown:E,onTouchStart:E},e.isMaximized()?typeof r.restore=="function"?r.restore(e):r.restore:typeof r.maximize=="function"?r.maximize(e):r.maximize))}if(!e.isMaximized()&&oe){const P=W?t.i18nName(Vt.I18nLabel.Close_Tab):t.i18nName(Vt.I18nLabel.Close_Tabset);(Y?V:z).push(me.createElement("button",{key:"close","data-layout-path":s+"/button/close",title:P,className:R(_e.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+R(_e.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE),onClick:W?C:w,onMouseDown:E,onTouchStart:E},typeof r.closeTabset=="function"?r.closeTabset(e):r.closeTabset))}const he=me.createElement("div",{key:"toolbar",ref:a,className:R(_e.CLASSES.FLEXLAYOUT__TAB_TOOLBAR),onMouseDown:E,onTouchStart:E,onDragStart:P=>{P.preventDefault()}},z);let $e,Je,re=R(_e.CLASSES.FLEXLAYOUT__TABSET_TABBAR_OUTER);if(e.getClassNameTabStrip()!==void 0&&(re+=" "+e.getClassNameTabStrip()),re+=" "+_e.CLASSES.FLEXLAYOUT__TABSET_TABBAR_OUTER_+e.getTabLocation(),e.isActive()&&!Y&&(re+=" "+R(_e.CLASSES.FLEXLAYOUT__TABSET_SELECTED)),e.isMaximized()&&!Y&&(re+=" "+R(_e.CLASSES.FLEXLAYOUT__TABSET_MAXIMIZED)),W){const P=e.getChildren()[0];P.getTabSetClassName()!==void 0&&(re+=" "+P.getTabSetClassName())}if(Y){const P=me.createElement("div",{key:"toolbar",ref:a,className:R(_e.CLASSES.FLEXLAYOUT__TAB_TOOLBAR),onMouseDown:E,onTouchStart:E,onDragStart:de=>{de.preventDefault()}},V);let Z=R(_e.CLASSES.FLEXLAYOUT__TABSET_HEADER);e.isActive()&&(Z+=" "+R(_e.CLASSES.FLEXLAYOUT__TABSET_SELECTED)),e.isMaximized()&&(Z+=" "+R(_e.CLASSES.FLEXLAYOUT__TABSET_MAXIMIZED)),e.getClassNameHeader()!==void 0&&(Z+=" "+e.getClassNameHeader()),$e=me.createElement("div",{className:Z,style:{height:e.getHeaderHeight()+"px"},"data-layout-path":s+"/header",onMouseDown:v,onContextMenu:x,onClick:S,onAuxClick:S,onTouchStart:v},me.createElement("div",{className:R(_e.CLASSES.FLEXLAYOUT__TABSET_HEADER_CONTENT)},N),P)}const M={height:e.getTabStripHeight()+"px"};Je=me.createElement("div",{className:re,style:M,"data-layout-path":s+"/tabstrip",onMouseDown:v,onContextMenu:x,onClick:S,onAuxClick:S,onTouchStart:v},me.createElement("div",{ref:f,className:R(_e.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER)+" "+R(_e.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_+e.getTabLocation())},me.createElement("div",{style:{left:b,width:W?"100%":"10000px"},className:R(_e.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER)+" "+R(_e.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_+e.getTabLocation())},B)),he),k=t.styleFont(k);var te=void 0;if(e.getChildren().length===0){const P=t.getTabSetPlaceHolderCallback();P&&(te=P(e))}const fe=me.createElement("div",{className:R(_e.CLASSES.FLEXLAYOUT__TABSET_CONTENT)},te);var we;return e.getTabLocation()==="top"?we=me.createElement(me.Fragment,null,$e,Je,fe):we=me.createElement(me.Fragment,null,$e,fe,Je),me.createElement("div",{ref:h,dir:"ltr","data-layout-path":s,style:k,className:R(_e.CLASSES.FLEXLAYOUT__TABSET),onWheel:g},we)};lo.TabSet=cl;var uo={};Object.defineProperty(uo,"__esModule",{value:!0}),uo.FloatingWindow=void 0;const ho=A,ul=At,hl=Me,fl=Le,gl=n=>{const{title:e,id:t,url:o,rect:i,onCloseWindow:r,onSetWindow:s,children:a}=n,c=ho.useRef(null),f=ho.useRef(null),[m,h]=ho.useState(void 0);return ho.useLayoutEffect(()=>{f.current&&clearTimeout(f.current);let b=!0;const d=i||new hl.Rect(0,0,100,100),l=Array.from(window.document.styleSheets).reduce((g,u)=>{let p;try{p=u.cssRules}catch{}try{return[...g,{href:u.href,type:u.type,rules:p?Array.from(p).map(_=>_.cssText):null}]}catch{return g}},[]);return c.current=window.open(o,t,`left=${d.x},top=${d.y},width=${d.width},height=${d.height}`),c.current!==null?(s(t,c.current),window.addEventListener("beforeunload",()=>{c.current&&(c.current.close(),c.current=null)}),c.current.addEventListener("load",()=>{if(b){const g=c.current.document;g.title=e;const u=g.createElement("div");u.className=fl.CLASSES.FLEXLAYOUT__FLOATING_WINDOW_CONTENT,g.body.appendChild(u),pl(g,l).then(()=>{h(u)}),c.current.addEventListener("beforeunload",()=>{r(t)})}})):(console.warn(`Unable to open window ${o}`),r(t)),()=>{b=!1,f.current=setTimeout(()=>{c.current&&(c.current.close(),c.current=null)},0)}},[]),m!==void 0?(0,ul.createPortal)(a,m):null};uo.FloatingWindow=gl;function pl(n,e){const t=n.head,o=[];for(const i of e)if(i.href){const r=n.createElement("link");r.type=i.type,r.rel="stylesheet",r.href=i.href,t.appendChild(r),o.push(new Promise(s=>{r.onload=()=>s(!0)}))}else if(i.rules){const r=n.createElement("style");for(const s of i.rules)r.appendChild(n.createTextNode(s));t.appendChild(r)}return Promise.all(o)}var fo={};Object.defineProperty(fo,"__esModule",{value:!0}),fo.FloatingWindowTab=void 0;const Ko=A,ml=Nn,_l=yt,bl=A,Tl=Le,vl=n=>{const{layout:e,node:t,factory:o}=n,i=e.getClassName,r=o(t);return Ko.createElement("div",{className:i(Tl.CLASSES.FLEXLAYOUT__FLOATING_WINDOW_TAB)},Ko.createElement(ml.ErrorBoundary,{message:n.layout.i18nName(_l.I18nLabel.Error_rendering_component)},Ko.createElement(bl.Fragment,null,r)))};fo.FloatingWindowTab=vl;var go={};Object.defineProperty(go,"__esModule",{value:!0}),go.TabFloating=void 0;const Bt=A,cr=Ze,ur=Ct(),Qo=Le,ei=yt,hr=We,yl=n=>{const{layout:e,selected:t,node:o,path:i}=n,r=()=>{o.getWindow()&&o.getWindow().focus()},s=()=>{e.doAction(cr.Actions.unFloatTab(o.getId()))},a=()=>{const p=o.getParent();p.getType()===ur.TabSetNode.TYPE&&(p.isActive()||e.doAction(cr.Actions.setActiveTabset(p.getId())))},c=p=>{p.preventDefault(),r()},f=p=>{p.preventDefault(),s()},m=e.getClassName,h=o.getParent(),b=o._styleWithPosition();t||(0,hr.hideElement)(b,o.getModel().isUseVisibility()),h instanceof ur.TabSetNode&&o.getModel().getMaximizedTabset()!==void 0&&!h.isMaximized()&&(0,hr.hideElement)(b,o.getModel().isUseVisibility());const d=e.i18nName(ei.I18nLabel.Floating_Window_Message),l=e.i18nName(ei.I18nLabel.Floating_Window_Show_Window),g=e.i18nName(ei.I18nLabel.Floating_Window_Dock_Window),u=e.getOnRenderFloatingTabPlaceholder();return u?Bt.createElement("div",{className:m(Qo.CLASSES.FLEXLAYOUT__TAB_FLOATING),onMouseDown:a,onTouchStart:a,style:b},u(s,r)):Bt.createElement("div",{className:m(Qo.CLASSES.FLEXLAYOUT__TAB_FLOATING),"data-layout-path":i,onMouseDown:a,onTouchStart:a,style:b},Bt.createElement("div",{className:m(Qo.CLASSES.FLEXLAYOUT__TAB_FLOATING_INNER)},Bt.createElement("div",null,d),Bt.createElement("div",null,Bt.createElement("a",{href:"#",onClick:c},l)),Bt.createElement("div",null,Bt.createElement("a",{href:"#",onClick:f},g))))};go.TabFloating=yl;var Ye={};Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.RestoreIcon=Ye.PopoutIcon=Ye.EdgeIcon=Ye.OverflowIcon=Ye.MaximizeIcon=Ye.CloseIcon=void 0;const Ie=A,Dn={width:"1em",height:"1em",display:"flex",alignItems:"center"},xl=()=>Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:Dn,viewBox:"0 0 24 24"},Ie.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),Ie.createElement("path",{stroke:"var(--color-icon)",fill:"var(--color-icon)",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));Ye.CloseIcon=xl;const El=()=>Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:Dn,viewBox:"0 0 24 24",fill:"var(--color-icon)"},Ie.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),Ie.createElement("path",{stroke:"var(--color-icon)",d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}));Ye.MaximizeIcon=El;const Sl=()=>Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:Dn,viewBox:"0 0 24 24",fill:"var(--color-icon)"},Ie.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),Ie.createElement("path",{stroke:"var(--color-icon)",d:"M7 10l5 5 5-5z"}));Ye.OverflowIcon=Sl;const wl=()=>Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{display:"block",width:10,height:10},preserveAspectRatio:"none",viewBox:"0 0 100 100"},Ie.createElement("path",{fill:"var(--color-edge-icon)",stroke:"var(--color-edge-icon)",d:"M10 30 L90 30 l-40 40 Z"}));Ye.EdgeIcon=wl;const Rl=()=>Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:Dn,viewBox:"0 0 20 20",fill:"var(--color-icon)"},Ie.createElement("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),Ie.createElement("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"}));Ye.PopoutIcon=Rl;const Al=()=>Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:Dn,viewBox:"0 0 24 24",fill:"var(--color-icon)"},Ie.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),Ie.createElement("path",{stroke:"var(--color-icon)",d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}));Ye.RestoreIcon=Al,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.Layout=void 0;const $=A,Ol=At,lt=rt,Mt=Yt,an=Ze,Nl=vt(),fr=Gt,kt=Nt,gr=Ct(),po=Me,Xe=Le,Cl=to,pr=so,mr=ao,Ll=lo,_r=uo,br=fo,Tr=go,ti=Ce,$t=Ye,Dl=wn,Il={close:$.createElement($t.CloseIcon,null),closeTabset:$.createElement($t.CloseIcon,null),popout:$.createElement($t.PopoutIcon,null),maximize:$.createElement($t.MaximizeIcon,null),restore:$.createElement($t.RestoreIcon,null),more:$.createElement($t.OverflowIcon,null),edgeArrow:$.createElement($t.EdgeIcon,null)},Bl=typeof window<"u"&&(window.document.documentMode||/Edge\//.test(window.navigator.userAgent)),Ml=typeof window<"u"&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches&&!Bl;class kl extends $.Component{constructor(e){super(e),this.firstMove=!1,this.dragRectRendered=!0,this.dragDivText=void 0,this.edgeRectLength=100,this.edgeRectWidth=10,this.onModelChange=t=>{this.forceUpdate(),this.props.onModelChange&&this.props.onModelChange(this.props.model,t)},this.updateRect=t=>{if(t||(t=this.getDomRect()),!t)return;const o=new po.Rect(0,0,t.width,t.height);!o.equals(this.state.rect)&&o.width!==0&&o.height!==0&&this.setState({rect:o})},this.updateLayoutMetrics=()=>{if(this.findHeaderBarSizeRef.current){const t=this.findHeaderBarSizeRef.current.getBoundingClientRect().height;t!==this.state.calculatedHeaderBarSize&&this.setState({calculatedHeaderBarSize:t})}if(this.findTabBarSizeRef.current){const t=this.findTabBarSizeRef.current.getBoundingClientRect().height;t!==this.state.calculatedTabBarSize&&this.setState({calculatedTabBarSize:t})}if(this.findBorderBarSizeRef.current){const t=this.findBorderBarSizeRef.current.getBoundingClientRect().height;t!==this.state.calculatedBorderBarSize&&this.setState({calculatedBorderBarSize:t})}},this.getClassName=t=>this.props.classNameMapper===void 0?t:this.props.classNameMapper(t),this.onCloseWindow=t=>{this.doAction(an.Actions.unFloatTab(t));try{this.props.model.getNodeById(t)._setWindow(void 0)}catch{}},this.onSetWindow=(t,o)=>{this.props.model.getNodeById(t)._setWindow(o)},this.onCancelAdd=()=>{var t,o;const i=this.selfRef.current;i&&this.dragDiv&&i.removeChild(this.dragDiv),this.dragDiv=void 0,this.hidePortal(),this.fnNewNodeDropped!=null&&(this.fnNewNodeDropped(),this.fnNewNodeDropped=void 0);try{(o=(t=this.customDrop)===null||t===void 0?void 0:t.invalidated)===null||o===void 0||o.call(t)}catch(r){console.error(r)}Mt.DragDrop.instance.hideGlass(),this.newTabJson=void 0,this.customDrop=void 0},this.onCancelDrag=t=>{var o,i;if(t){const r=this.selfRef.current,s=this.outlineDiv;if(r&&s)try{r.removeChild(s)}catch{}const a=this.dragDiv;if(r&&a)try{r.removeChild(a)}catch{}this.dragDiv=void 0,this.hidePortal(),this.setState({showEdges:!1}),this.fnNewNodeDropped!=null&&(this.fnNewNodeDropped(),this.fnNewNodeDropped=void 0);try{(i=(o=this.customDrop)===null||o===void 0?void 0:o.invalidated)===null||i===void 0||i.call(o)}catch(c){console.error(c)}Mt.DragDrop.instance.hideGlass(),this.newTabJson=void 0,this.customDrop=void 0}this.setState({showHiddenBorder:lt.DockLocation.CENTER})},this.onDragDivMouseDown=t=>{t.preventDefault(),this.dragStart(t,this.dragDivText,kt.TabNode._fromJson(this.newTabJson,this.props.model,!1),!0,void 0,void 0)},this.dragStart=(t,o,i,r,s,a)=>{var c,f;r?(this.dragNode=i,this.dragDivText=o,Mt.DragDrop.instance.startDrag(t,this.onDragStart,this.onDragMove,this.onDragEnd,this.onCancelDrag,s,a,this.currentDocument,(f=this.selfRef.current)!==null&&f!==void 0?f:void 0)):Mt.DragDrop.instance.startDrag(t,void 0,void 0,void 0,void 0,s,a,this.currentDocument,(c=this.selfRef.current)!==null&&c!==void 0?c:void 0)},this.dragRectRender=(t,o,i,r)=>{let s;if(t!==void 0?s=$.createElement("div",{style:{whiteSpace:"pre"}},t.replace("<br>",`
|
|
24
|
+
`)):o&&o instanceof kt.TabNode&&(s=$.createElement(Dl.TabButtonStamp,{node:o,layout:this,iconFactory:this.props.iconFactory,titleFactory:this.props.titleFactory})),this.props.onRenderDragRect!==void 0){const c=this.props.onRenderDragRect(s,o,i);c!==void 0&&(s=c)}this.dragRectRendered=!1;const a=this.dragDiv;a&&(a.style.visibility="hidden",this.showPortal($.createElement(zl,{onRendered:()=>{this.dragRectRendered=!0,r==null||r()}},s),a))},this.showPortal=(t,o)=>{const i=(0,Ol.createPortal)(t,o);this.setState({portal:i})},this.hidePortal=()=>{this.setState({portal:void 0})},this.onDragStart=()=>{var t;this.dropInfo=void 0,this.customDrop=void 0;const o=this.selfRef.current;return this.outlineDiv=this.currentDocument.createElement("div"),this.outlineDiv.className=this.getClassName(Xe.CLASSES.FLEXLAYOUT__OUTLINE_RECT),this.outlineDiv.style.visibility="hidden",o&&o.appendChild(this.outlineDiv),this.dragDiv==null&&(this.dragDiv=this.currentDocument.createElement("div"),this.dragDiv.className=this.getClassName(Xe.CLASSES.FLEXLAYOUT__DRAG_RECT),this.dragDiv.setAttribute("data-layout-path","/drag-rectangle"),this.dragRectRender(this.dragDivText,this.dragNode,this.newTabJson),o&&o.appendChild(this.dragDiv)),this.props.model.getMaximizedTabset()===void 0&&this.setState({showEdges:this.props.model.isEnableEdgeDock()}),this.dragNode&&this.outlineDiv&&this.dragNode instanceof kt.TabNode&&this.dragNode.getTabRect()!==void 0&&((t=this.dragNode.getTabRect())===null||t===void 0||t.positionElement(this.outlineDiv)),this.firstMove=!0,!0},this.onDragMove=t=>{var o,i,r,s,a,c,f;if(this.firstMove===!1){const g=this.props.model._getAttribute("tabDragSpeed");this.outlineDiv&&(this.outlineDiv.style.transition=`top ${g}s, left ${g}s, width ${g}s, height ${g}s`)}this.firstMove=!1;const m=(o=this.selfRef.current)===null||o===void 0?void 0:o.getBoundingClientRect(),h={x:t.clientX-((i=m==null?void 0:m.left)!==null&&i!==void 0?i:0),y:t.clientY-((r=m==null?void 0:m.top)!==null&&r!==void 0?r:0)};this.checkForBorderToShow(h.x,h.y);const b=(a=(s=this.dragDiv)===null||s===void 0?void 0:s.getBoundingClientRect())!==null&&a!==void 0?a:new DOMRect(0,0,100,100);let d=h.x-b.width/2;d+b.width>((c=m==null?void 0:m.width)!==null&&c!==void 0?c:0)&&(d=((f=m==null?void 0:m.width)!==null&&f!==void 0?f:0)-b.width),d=Math.max(0,d),this.dragDiv&&(this.dragDiv.style.left=d+"px",this.dragDiv.style.top=h.y+5+"px",this.dragRectRendered&&this.dragDiv.style.visibility==="hidden"&&(this.dragDiv.style.visibility="visible"));let l=this.props.model._findDropTargetNode(this.dragNode,h.x,h.y);l&&(this.props.onTabDrag?this.handleCustomTabDrag(l,h,t):(this.dropInfo=l,this.outlineDiv&&(this.outlineDiv.className=this.getClassName(l.className),l.rect.positionElement(this.outlineDiv),this.outlineDiv.style.visibility="visible")))},this.onDragEnd=t=>{const o=this.selfRef.current;if(o&&(this.outlineDiv&&o.removeChild(this.outlineDiv),this.dragDiv&&o.removeChild(this.dragDiv)),this.dragDiv=void 0,this.hidePortal(),this.setState({showEdges:!1}),Mt.DragDrop.instance.hideGlass(),this.dropInfo)if(this.customDrop){this.newTabJson=void 0;try{const{callback:i,dragging:r,over:s,x:a,y:c,location:f}=this.customDrop;i(r,s,a,c,f),this.fnNewNodeDropped!=null&&(this.fnNewNodeDropped(),this.fnNewNodeDropped=void 0)}catch(i){console.error(i)}}else if(this.newTabJson!==void 0){const i=this.doAction(an.Actions.addNode(this.newTabJson,this.dropInfo.node.getId(),this.dropInfo.location,this.dropInfo.index));this.fnNewNodeDropped!=null&&(this.fnNewNodeDropped(i,t),this.fnNewNodeDropped=void 0),this.newTabJson=void 0}else this.dragNode!==void 0&&this.doAction(an.Actions.moveNode(this.dragNode.getId(),this.dropInfo.node.getId(),this.dropInfo.location,this.dropInfo.index));this.setState({showHiddenBorder:lt.DockLocation.CENTER})},this.props.model._setChangeListener(this.onModelChange),this.tabIds=[],this.selfRef=$.createRef(),this.findHeaderBarSizeRef=$.createRef(),this.findTabBarSizeRef=$.createRef(),this.findBorderBarSizeRef=$.createRef(),this.supportsPopout=e.supportsPopout!==void 0?e.supportsPopout:Ml,this.popoutURL=e.popoutURL?e.popoutURL:"popout.html",this.icons=Object.assign(Object.assign({},Il),e.icons),this.state={rect:new po.Rect(0,0,0,0),calculatedHeaderBarSize:25,calculatedTabBarSize:26,calculatedBorderBarSize:30,editingTab:void 0,showHiddenBorder:lt.DockLocation.CENTER,showEdges:!1},this.onDragEnter=this.onDragEnter.bind(this)}styleFont(e){return this.props.font&&(this.selfRef.current&&(this.props.font.size&&this.selfRef.current.style.setProperty("--font-size",this.props.font.size),this.props.font.family&&this.selfRef.current.style.setProperty("--font-family",this.props.font.family)),this.props.font.style&&(e.fontStyle=this.props.font.style),this.props.font.weight&&(e.fontWeight=this.props.font.weight)),e}doAction(e){if(this.props.onAction!==void 0){const t=this.props.onAction(e);return t!==void 0?this.props.model.doAction(t):void 0}else return this.props.model.doAction(e)}componentDidMount(){this.updateRect(),this.updateLayoutMetrics(),this.currentDocument=this.selfRef.current.ownerDocument,this.currentWindow=this.currentDocument.defaultView,this.resizeObserver=new ResizeObserver(t=>{this.updateRect(t[0].contentRect)});const e=this.selfRef.current;e&&this.resizeObserver.observe(e)}componentDidUpdate(){this.updateLayoutMetrics(),this.props.model!==this.previousModel&&(this.previousModel!==void 0&&this.previousModel._setChangeListener(void 0),this.props.model._setChangeListener(this.onModelChange),this.previousModel=this.props.model)}getCurrentDocument(){return this.currentDocument}getDomRect(){var e;return(e=this.selfRef.current)===null||e===void 0?void 0:e.getBoundingClientRect()}getRootDiv(){return this.selfRef.current}isSupportsPopout(){return this.supportsPopout}isRealtimeResize(){var e;return(e=this.props.realtimeResize)!==null&&e!==void 0?e:!1}onTabDrag(...e){var t,o;return(o=(t=this.props).onTabDrag)===null||o===void 0?void 0:o.call(t,...e)}getPopoutURL(){return this.popoutURL}componentWillUnmount(){var e;const t=this.selfRef.current;t&&((e=this.resizeObserver)===null||e===void 0||e.unobserve(t))}setEditingTab(e){this.setState({editingTab:e})}getEditingTab(){return this.state.editingTab}render(){if(!this.selfRef.current)return $.createElement("div",{ref:this.selfRef,className:this.getClassName(Xe.CLASSES.FLEXLAYOUT__LAYOUT)},this.metricsElements());this.props.model._setPointerFine(window&&window.matchMedia&&window.matchMedia("(pointer: fine)").matches);const e=[],t=[],o=[],i={},r=[],s={headerBarSize:this.state.calculatedHeaderBarSize,tabBarSize:this.state.calculatedTabBarSize,borderBarSize:this.state.calculatedBorderBarSize};this.props.model._setShowHiddenBorder(this.state.showHiddenBorder),this.centerRect=this.props.model._layout(this.state.rect,s),this.renderBorder(this.props.model.getBorderSet(),e,i,o,r),this.renderChildren("",this.props.model.getRoot(),t,i,o,r);const a=[],c={};for(const h of this.tabIds)i[h]&&(a.push(h),c[h]=h);this.tabIds=a;for(const h of Object.keys(i))c[h]||this.tabIds.push(h);const f=[],m=this.icons.edgeArrow;if(this.state.showEdges){const h=this.centerRect,b=this.edgeRectLength,d=this.edgeRectWidth,l=this.edgeRectLength/2,g=this.getClassName(Xe.CLASSES.FLEXLAYOUT__EDGE_RECT),u=50;f.push($.createElement("div",{key:"North",style:{top:h.y,left:h.x+h.width/2-l,width:b,height:d,borderBottomLeftRadius:u,borderBottomRightRadius:u},className:g+" "+this.getClassName(Xe.CLASSES.FLEXLAYOUT__EDGE_RECT_TOP)},$.createElement("div",{style:{transform:"rotate(180deg)"}},m))),f.push($.createElement("div",{key:"West",style:{top:h.y+h.height/2-l,left:h.x,width:d,height:b,borderTopRightRadius:u,borderBottomRightRadius:u},className:g+" "+this.getClassName(Xe.CLASSES.FLEXLAYOUT__EDGE_RECT_LEFT)},$.createElement("div",{style:{transform:"rotate(90deg)"}},m))),f.push($.createElement("div",{key:"South",style:{top:h.y+h.height-d,left:h.x+h.width/2-l,width:b,height:d,borderTopLeftRadius:u,borderTopRightRadius:u},className:g+" "+this.getClassName(Xe.CLASSES.FLEXLAYOUT__EDGE_RECT_BOTTOM)},$.createElement("div",null,m))),f.push($.createElement("div",{key:"East",style:{top:h.y+h.height/2-l,left:h.x+h.width-d,width:d,height:b,borderTopLeftRadius:u,borderBottomLeftRadius:u},className:g+" "+this.getClassName(Xe.CLASSES.FLEXLAYOUT__EDGE_RECT_RIGHT)},$.createElement("div",{style:{transform:"rotate(-90deg)"}},m)))}return $.createElement("div",{ref:this.selfRef,className:this.getClassName(Xe.CLASSES.FLEXLAYOUT__LAYOUT),onDragEnter:this.props.onExternalDrag?this.onDragEnter:void 0},t,this.tabIds.map(h=>i[h]),e,r,f,o,this.metricsElements(),this.state.portal)}metricsElements(){const e=this.styleFont({visibility:"hidden"});return $.createElement($.Fragment,null,$.createElement("div",{key:"findHeaderBarSize",ref:this.findHeaderBarSizeRef,style:e,className:this.getClassName(Xe.CLASSES.FLEXLAYOUT__TABSET_HEADER_SIZER)},"FindHeaderBarSize"),$.createElement("div",{key:"findTabBarSize",ref:this.findTabBarSizeRef,style:e,className:this.getClassName(Xe.CLASSES.FLEXLAYOUT__TABSET_SIZER)},"FindTabBarSize"),$.createElement("div",{key:"findBorderBarSize",ref:this.findBorderBarSizeRef,style:e,className:this.getClassName(Xe.CLASSES.FLEXLAYOUT__BORDER_SIZER)},"FindBorderBarSize"))}renderBorder(e,t,o,i,r){for(const s of e.getBorders()){const a=`/border/${s.getLocation().getName()}`;if(s.isShowing()){t.push($.createElement(Cl.BorderTabSet,{key:`border_${s.getLocation().getName()}`,path:a,border:s,layout:this,iconFactory:this.props.iconFactory,titleFactory:this.props.titleFactory,icons:this.icons}));const c=s._getDrawChildren();let f=0,m=0;for(const h of c){if(h instanceof fr.SplitterNode){let b=a+"/s";r.push($.createElement(pr.Splitter,{key:h.getId(),layout:this,node:h,path:b}))}else if(h instanceof kt.TabNode){let b=a+"/t"+m++;if(this.supportsPopout&&h.isFloating()){const d=this._getScreenRect(h),l=h._getAttr("borderWidth"),g=h._getAttr("borderHeight");d&&(l!==-1&&s.getLocation().getOrientation()===ti.Orientation.HORZ?d.width=l:g!==-1&&s.getLocation().getOrientation()===ti.Orientation.VERT&&(d.height=g)),i.push($.createElement(_r.FloatingWindow,{key:h.getId(),url:this.popoutURL,rect:d,title:h.getName(),id:h.getId(),onSetWindow:this.onSetWindow,onCloseWindow:this.onCloseWindow},$.createElement(br.FloatingWindowTab,{layout:this,node:h,factory:this.props.factory}))),o[h.getId()]=$.createElement(Tr.TabFloating,{key:h.getId(),layout:this,path:b,node:h,selected:f===s.getSelected()})}else o[h.getId()]=$.createElement(mr.Tab,{key:h.getId(),layout:this,path:b,node:h,selected:f===s.getSelected(),factory:this.props.factory})}f++}}}}renderChildren(e,t,o,i,r,s){const a=t._getDrawChildren();let c=0,f=0,m=0;for(const h of a)if(h instanceof fr.SplitterNode){const b=e+"/s"+c++;s.push($.createElement(pr.Splitter,{key:h.getId(),layout:this,path:b,node:h}))}else if(h instanceof gr.TabSetNode){const b=e+"/ts"+m++;o.push($.createElement(Ll.TabSet,{key:h.getId(),layout:this,path:b,node:h,iconFactory:this.props.iconFactory,titleFactory:this.props.titleFactory,icons:this.icons})),this.renderChildren(b,h,o,i,r,s)}else if(h instanceof kt.TabNode){const b=e+"/t"+f++,d=h.getParent().getChildren()[h.getParent().getSelected()];if(d===void 0&&console.warn("undefined selectedTab should not happen"),this.supportsPopout&&h.isFloating()){const l=this._getScreenRect(h);r.push($.createElement(_r.FloatingWindow,{key:h.getId(),url:this.popoutURL,rect:l,title:h.getName(),id:h.getId(),onSetWindow:this.onSetWindow,onCloseWindow:this.onCloseWindow},$.createElement(br.FloatingWindowTab,{layout:this,node:h,factory:this.props.factory}))),i[h.getId()]=$.createElement(Tr.TabFloating,{key:h.getId(),layout:this,path:b,node:h,selected:h===d})}else i[h.getId()]=$.createElement(mr.Tab,{key:h.getId(),layout:this,path:b,node:h,selected:h===d,factory:this.props.factory})}else{const b=e+(h.getOrientation()===ti.Orientation.HORZ?"/r":"/c")+m++;this.renderChildren(b,h,o,i,r,s)}}_getScreenRect(e){var t;const o=e.getRect().clone(),i=(t=this.selfRef.current)===null||t===void 0?void 0:t.getBoundingClientRect();if(!i)return null;const r=Math.min(80,this.currentWindow.outerHeight-this.currentWindow.innerHeight),s=Math.min(80,this.currentWindow.outerWidth-this.currentWindow.innerWidth);return o.x=o.x+i.x+this.currentWindow.screenX+s,o.y=o.y+i.y+this.currentWindow.screenY+r,o}addTabToTabSet(e,t){if(this.props.model.getNodeById(e)!==void 0)return this.doAction(an.Actions.addNode(t,e,lt.DockLocation.CENTER,-1))}addTabToActiveTabSet(e){const t=this.props.model.getActiveTabset();if(t!==void 0)return this.doAction(an.Actions.addNode(e,t.getId(),lt.DockLocation.CENTER,-1))}addTabWithDragAndDrop(e,t,o){this.fnNewNodeDropped=o,this.newTabJson=t,this.dragStart(void 0,e,kt.TabNode._fromJson(t,this.props.model,!1),!0,void 0,void 0)}moveTabWithDragAndDrop(e,t){this.dragStart(void 0,t,e,!0,void 0,void 0)}addTabWithDragAndDropIndirect(e,t,o){this.fnNewNodeDropped=o,this.newTabJson=t,Mt.DragDrop.instance.addGlass(this.onCancelAdd),this.dragDivText=e,this.dragDiv=this.currentDocument.createElement("div"),this.dragDiv.className=this.getClassName(Xe.CLASSES.FLEXLAYOUT__DRAG_RECT),this.dragDiv.addEventListener("mousedown",this.onDragDivMouseDown),this.dragDiv.addEventListener("touchstart",this.onDragDivMouseDown,{passive:!1}),this.dragRectRender(this.dragDivText,void 0,this.newTabJson,()=>{if(this.dragDiv){this.dragDiv.style.visibility="visible";const r=this.dragDiv.getBoundingClientRect(),s=new po.Rect(0,0,r==null?void 0:r.width,r==null?void 0:r.height);s.centerInRect(this.state.rect),this.dragDiv.setAttribute("data-layout-path","/drag-rectangle"),this.dragDiv.style.left=s.x+"px",this.dragDiv.style.top=s.y+"px"}}),this.selfRef.current.appendChild(this.dragDiv)}handleCustomTabDrag(e,t,o){var i,r,s;let a=(i=this.customDrop)===null||i===void 0?void 0:i.invalidated;const c=(r=this.customDrop)===null||r===void 0?void 0:r.callback;this.customDrop=void 0;const f=this.newTabJson||(this.dragNode instanceof kt.TabNode?this.dragNode:void 0);if(f&&(e.node instanceof gr.TabSetNode||e.node instanceof Nl.BorderNode)&&e.index===-1){const m=e.node.getSelectedNode(),h=m==null?void 0:m.getRect();if(m&&(h!=null&&h.contains(t.x,t.y))){let b;try{const d=this.onTabDrag(f,m,t.x-h.x,t.y-h.y,e.location,()=>this.onDragMove(o));d&&(b={rect:new po.Rect(d.x+h.x,d.y+h.y,d.width,d.height),callback:d.callback,invalidated:d.invalidated,dragging:f,over:m,x:t.x-h.x,y:t.y-h.y,location:e.location,cursor:d.cursor})}catch(d){console.error(d)}(b==null?void 0:b.callback)===c&&(a=void 0),this.customDrop=b}}this.dropInfo=e,this.outlineDiv&&(this.outlineDiv.className=this.getClassName(this.customDrop?Xe.CLASSES.FLEXLAYOUT__OUTLINE_RECT:e.className),this.customDrop?this.customDrop.rect.positionElement(this.outlineDiv):e.rect.positionElement(this.outlineDiv)),Mt.DragDrop.instance.setGlassCursorOverride((s=this.customDrop)===null||s===void 0?void 0:s.cursor),this.outlineDiv&&(this.outlineDiv.style.visibility="visible");try{a==null||a()}catch(m){console.error(m)}}onDragEnter(e){if(Mt.DragDrop.instance.isDragging())return;const t=this.props.onExternalDrag(e);t&&(this.fnNewNodeDropped=t.onDrop,this.newTabJson=t.json,this.dragStart(e,t.dragText,kt.TabNode._fromJson(t.json,this.props.model,!1),!0,void 0,void 0))}checkForBorderToShow(e,t){const o=this.props.model._getOuterInnerRects().outer,i=o.getCenter(),r=this.edgeRectWidth,s=this.edgeRectLength/2;let a=!1;this.props.model.isEnableEdgeDock()&&this.state.showHiddenBorder===lt.DockLocation.CENTER&&(t>i.y-s&&t<i.y+s||e>i.x-s&&e<i.x+s)&&(a=!0);let c=lt.DockLocation.CENTER;a||(e<=o.x+r?c=lt.DockLocation.LEFT:e>=o.getRight()-r?c=lt.DockLocation.RIGHT:t<=o.y+r?c=lt.DockLocation.TOP:t>=o.getBottom()-r&&(c=lt.DockLocation.BOTTOM)),c!==this.state.showHiddenBorder&&this.setState({showHiddenBorder:c})}maximize(e){this.doAction(an.Actions.maximizeToggle(e.getId()))}customizeTab(e,t){this.props.onRenderTab&&this.props.onRenderTab(e,t)}customizeTabSet(e,t){this.props.onRenderTabSet&&this.props.onRenderTabSet(e,t)}i18nName(e,t){let o;return this.props.i18nMapper&&(o=this.props.i18nMapper(e,t)),o===void 0&&(o=e+(t===void 0?"":t)),o}getOnRenderFloatingTabPlaceholder(){return this.props.onRenderFloatingTabPlaceholder}getShowOverflowMenu(){return this.props.onShowOverflowMenu}getTabSetPlaceHolderCallback(){return this.props.onTabSetPlaceHolder}showContextMenu(e,t){this.props.onContextMenu&&this.props.onContextMenu(e,t)}auxMouseClick(e,t){this.props.onAuxMouseClick&&this.props.onAuxMouseClick(e,t)}}Kn.Layout=kl;const zl=n=>($.useEffect(()=>{var e;(e=n.onRendered)===null||e===void 0||e.call(n)},[n]),$.createElement($.Fragment,null,n.children));var In={};Object.defineProperty(In,"__esModule",{value:!0}),In.BorderSet=void 0;const ni=Ce,Fl=vt();class oi{static _fromJson(e,t){const o=new oi(t);return o._borders=e.map(i=>Fl.BorderNode._fromJson(i,t)),o}constructor(e){this._model=e,this._borders=[]}getBorders(){return this._borders}_forEachNode(e){for(const t of this._borders){e(t,0);for(const o of t.getChildren())o._forEachNode(e,1)}}_toJson(){return this._borders.map(e=>e.toJson())}_layoutBorder(e,t){const o=e.outer,i=this._model.getRoot();let r=Math.max(0,o.height-i.getMinHeight()),s=Math.max(0,o.width-i.getMinWidth()),a=0,c=0,f=0,m=0;const h=this._borders.filter(l=>l.isShowing());for(const l of h){l._setAdjustedSize(l.getSize());const g=l.getSelected()!==-1;l.getLocation().getOrientation()===ni.Orientation.HORZ?(c+=l.getBorderBarSize(),g&&(s-=this._model.getSplitterSize(),c+=l.getSize(),m+=l.getSize())):(a+=l.getBorderBarSize(),g&&(r-=this._model.getSplitterSize(),a+=l.getSize(),f+=l.getSize()))}let b=0,d=!1;for(;c>s&&m>0||a>r&&f>0;){const l=h[b];if(l.getSelected()!==-1){const g=l._getAdjustedSize();c>s&&m>0&&l.getLocation().getOrientation()===ni.Orientation.HORZ&&g>0&&g>l.getMinSize()?(l._setAdjustedSize(g-1),c--,m--,d=!0):a>r&&f>0&&l.getLocation().getOrientation()===ni.Orientation.VERT&&g>0&&g>l.getMinSize()&&(l._setAdjustedSize(g-1),a--,f--,d=!0)}if(b=(b+1)%h.length,b===0)if(d)d=!1;else break}for(const l of h)e.outer=l._layoutBorderOuter(e.outer,t);e.inner=e.outer;for(const l of h)e.inner=l._layoutBorderInner(e.inner,t);return e}_findDropTargetNode(e,t,o){for(const i of this._borders)if(i.isShowing()){const r=i.canDrop(e,t,o);if(r!==void 0)return r}}}In.BorderSet=oi;var vr={};Object.defineProperty(vr,"__esModule",{value:!0});var yr={};Object.defineProperty(yr,"__esModule",{value:!0});var xr={};Object.defineProperty(xr,"__esModule",{value:!0});var mo={};Object.defineProperty(mo,"__esModule",{value:!0}),mo.Model=void 0;const q=_t,Ul=bt,ii=rt,Er=Ce,Sr=Me,Ge=Ze,Bn=vt(),wr=In,ln=Uo(),zt=Nt,dt=Ct(),ri=Po();class qe{static fromJson(e){const t=new qe;return qe._attributeDefinitions.fromJson(e.global,t._attributes),e.borders&&(t._borders=wr.BorderSet._fromJson(e.borders,t)),t._root=ln.RowNode._fromJson(e.layout,t),t._tidy(),t}static _createAttributeDefinitions(){const e=new Ul.AttributeDefinitions;return e.add("legacyOverflowMenu",!1).setType(q.Attribute.BOOLEAN),e.add("enableEdgeDock",!0).setType(q.Attribute.BOOLEAN),e.add("rootOrientationVertical",!1).setType(q.Attribute.BOOLEAN),e.add("marginInsets",{top:0,right:0,bottom:0,left:0}).setType("IInsets"),e.add("enableUseVisibility",!1).setType(q.Attribute.BOOLEAN),e.add("enableRotateBorderIcons",!0).setType(q.Attribute.BOOLEAN),e.add("splitterSize",-1).setType(q.Attribute.NUMBER),e.add("splitterExtra",0).setType(q.Attribute.NUMBER),e.add("tabEnableClose",!0).setType(q.Attribute.BOOLEAN),e.add("tabCloseType",1).setType("ICloseType"),e.add("tabEnableFloat",!1).setType(q.Attribute.BOOLEAN),e.add("tabEnableDrag",!0).setType(q.Attribute.BOOLEAN),e.add("tabEnableRename",!0).setType(q.Attribute.BOOLEAN),e.add("tabContentClassName",void 0).setType(q.Attribute.STRING),e.add("tabClassName",void 0).setType(q.Attribute.STRING),e.add("tabIcon",void 0).setType(q.Attribute.STRING),e.add("tabEnableRenderOnDemand",!0).setType(q.Attribute.BOOLEAN),e.add("tabDragSpeed",.3).setType(q.Attribute.NUMBER),e.add("tabBorderWidth",-1).setType(q.Attribute.NUMBER),e.add("tabBorderHeight",-1).setType(q.Attribute.NUMBER),e.add("tabSetEnableDeleteWhenEmpty",!0).setType(q.Attribute.BOOLEAN),e.add("tabSetEnableDrop",!0).setType(q.Attribute.BOOLEAN),e.add("tabSetEnableDrag",!0).setType(q.Attribute.BOOLEAN),e.add("tabSetEnableDivide",!0).setType(q.Attribute.BOOLEAN),e.add("tabSetEnableMaximize",!0).setType(q.Attribute.BOOLEAN),e.add("tabSetEnableClose",!1).setType(q.Attribute.BOOLEAN),e.add("tabSetEnableSingleTabStretch",!1).setType(q.Attribute.BOOLEAN),e.add("tabSetAutoSelectTab",!0).setType(q.Attribute.BOOLEAN),e.add("tabSetClassNameTabStrip",void 0).setType(q.Attribute.STRING),e.add("tabSetClassNameHeader",void 0).setType(q.Attribute.STRING),e.add("tabSetEnableTabStrip",!0).setType(q.Attribute.BOOLEAN),e.add("tabSetHeaderHeight",0).setType(q.Attribute.NUMBER),e.add("tabSetTabStripHeight",0).setType(q.Attribute.NUMBER),e.add("tabSetMarginInsets",{top:0,right:0,bottom:0,left:0}).setType("IInsets"),e.add("tabSetBorderInsets",{top:0,right:0,bottom:0,left:0}).setType("IInsets"),e.add("tabSetTabLocation","top").setType("ITabLocation"),e.add("tabSetMinWidth",0).setType(q.Attribute.NUMBER),e.add("tabSetMinHeight",0).setType(q.Attribute.NUMBER),e.add("borderSize",200).setType(q.Attribute.NUMBER),e.add("borderMinSize",0).setType(q.Attribute.NUMBER),e.add("borderBarSize",0).setType(q.Attribute.NUMBER),e.add("borderEnableDrop",!0).setType(q.Attribute.BOOLEAN),e.add("borderAutoSelectTabWhenOpen",!0).setType(q.Attribute.BOOLEAN),e.add("borderAutoSelectTabWhenClosed",!1).setType(q.Attribute.BOOLEAN),e.add("borderClassName",void 0).setType(q.Attribute.STRING),e.add("borderEnableAutoHide",!1).setType(q.Attribute.BOOLEAN),e}constructor(){this._borderRects={inner:Sr.Rect.empty(),outer:Sr.Rect.empty()},this._attributes={},this._idMap={},this._borders=new wr.BorderSet(this),this._pointerFine=!0,this._showHiddenBorder=ii.DockLocation.CENTER}_setChangeListener(e){this._changeListener=e}getActiveTabset(){if(this._activeTabSet&&this.getNodeById(this._activeTabSet.getId()))return this._activeTabSet}_getShowHiddenBorder(){return this._showHiddenBorder}_setShowHiddenBorder(e){this._showHiddenBorder=e}_setActiveTabset(e){this._activeTabSet=e}getMaximizedTabset(){return this._maximizedTabSet}_setMaximizedTabset(e){this._maximizedTabSet=e}getRoot(){return this._root}isRootOrientationVertical(){return this._attributes.rootOrientationVertical}isUseVisibility(){return this._attributes.enableUseVisibility}isEnableRotateBorderIcons(){return this._attributes.enableRotateBorderIcons}getBorderSet(){return this._borders}_getOuterInnerRects(){return this._borderRects}_getPointerFine(){return this._pointerFine}_setPointerFine(e){this._pointerFine=e}visitNodes(e){this._borders._forEachNode(e),this._root._forEachNode(e,0)}getNodeById(e){return this._idMap[e]}getFirstTabSet(e=this._root){const t=e.getChildren()[0];return t instanceof dt.TabSetNode?t:this.getFirstTabSet(t)}doAction(e){let t;switch(e.type){case Ge.Actions.ADD_NODE:{const o=new zt.TabNode(this,e.data.json,!0),i=this._idMap[e.data.toNode];(i instanceof dt.TabSetNode||i instanceof Bn.BorderNode||i instanceof ln.RowNode)&&(i.drop(o,ii.DockLocation.getByName(e.data.location),e.data.index,e.data.select),t=o);break}case Ge.Actions.MOVE_NODE:{const o=this._idMap[e.data.fromNode];if(o instanceof zt.TabNode||o instanceof dt.TabSetNode){const i=this._idMap[e.data.toNode];(i instanceof dt.TabSetNode||i instanceof Bn.BorderNode||i instanceof ln.RowNode)&&i.drop(o,ii.DockLocation.getByName(e.data.location),e.data.index,e.data.select)}break}case Ge.Actions.DELETE_TAB:{const o=this._idMap[e.data.node];o instanceof zt.TabNode&&o._delete();break}case Ge.Actions.DELETE_TABSET:{const o=this._idMap[e.data.node];if(o instanceof dt.TabSetNode){const i=[...o.getChildren()];for(let r=0;r<i.length;r++){const s=i[r];s.isEnableClose()&&s._delete()}o.getChildren().length===0&&o._delete(),this._tidy()}break}case Ge.Actions.FLOAT_TAB:{const o=this._idMap[e.data.node];o instanceof zt.TabNode&&(o._setFloating(!0),(0,ri.adjustSelectedIndexAfterFloat)(o));break}case Ge.Actions.UNFLOAT_TAB:{const o=this._idMap[e.data.node];o instanceof zt.TabNode&&(o._setFloating(!1),(0,ri.adjustSelectedIndexAfterDock)(o));break}case Ge.Actions.RENAME_TAB:{const o=this._idMap[e.data.node];o instanceof zt.TabNode&&o._setName(e.data.text);break}case Ge.Actions.SELECT_TAB:{const o=this._idMap[e.data.tabNode];if(o instanceof zt.TabNode){const i=o.getParent(),r=i.getChildren().indexOf(o);i instanceof Bn.BorderNode?i.getSelected()===r?i._setSelected(-1):i._setSelected(r):i instanceof dt.TabSetNode&&(i.getSelected()!==r&&i._setSelected(r),this._activeTabSet=i)}break}case Ge.Actions.SET_ACTIVE_TABSET:{if(e.data.tabsetNode===void 0)this._activeTabSet=void 0;else{const o=this._idMap[e.data.tabsetNode];o instanceof dt.TabSetNode&&(this._activeTabSet=o)}break}case Ge.Actions.ADJUST_SPLIT:{const o=this._idMap[e.data.node1],i=this._idMap[e.data.node2];(o instanceof dt.TabSetNode||o instanceof ln.RowNode)&&(i instanceof dt.TabSetNode||i instanceof ln.RowNode)&&(this._adjustSplitSide(o,e.data.weight1,e.data.pixelWidth1),this._adjustSplitSide(i,e.data.weight2,e.data.pixelWidth2));break}case Ge.Actions.ADJUST_BORDER_SPLIT:{const o=this._idMap[e.data.node];o instanceof Bn.BorderNode&&o._setSize(e.data.pos);break}case Ge.Actions.MAXIMIZE_TOGGLE:{const o=this._idMap[e.data.node];o instanceof dt.TabSetNode&&(o===this._maximizedTabSet?this._maximizedTabSet=void 0:(this._maximizedTabSet=o,this._activeTabSet=o));break}case Ge.Actions.UPDATE_MODEL_ATTRIBUTES:{this._updateAttrs(e.data.json);break}case Ge.Actions.UPDATE_NODE_ATTRIBUTES:{this._idMap[e.data.node]._updateAttrs(e.data.json);break}}return this._updateIdMap(),this._changeListener!==void 0&&this._changeListener(e),t}_updateIdMap(){this._idMap={},this.visitNodes(e=>this._idMap[e.getId()]=e)}_adjustSplitSide(e,t,o){e._setWeight(t),e.getWidth()!=null&&e.getOrientation()===Er.Orientation.VERT?e._updateAttrs({width:o}):e.getHeight()!=null&&e.getOrientation()===Er.Orientation.HORZ&&e._updateAttrs({height:o})}toJson(){const e={};return qe._attributeDefinitions.toJson(e,this._attributes),this.visitNodes(t=>{t._fireEvent("save",void 0)}),{global:e,borders:this._borders._toJson(),layout:this._root.toJson()}}getSplitterSize(){let e=this._attributes.splitterSize;return e===-1&&(e=this._pointerFine?8:12),e}isLegacyOverflowMenu(){return this._attributes.legacyOverflowMenu}getSplitterExtra(){return this._attributes.splitterExtra}isEnableEdgeDock(){return this._attributes.enableEdgeDock}_addNode(e){const t=e.getId();if(this._idMap[t]!==void 0)throw new Error(`Error: each node must have a unique id, duplicate id:${e.getId()}`);e.getType()!=="splitter"&&(this._idMap[t]=e)}_layout(e,t){var o;return this._borderRects=this._borders._layoutBorder({outer:e,inner:e},t),e=this._borderRects.inner.removeInsets(this._getAttribute("marginInsets")),(o=this._root)===null||o===void 0||o.calcMinSize(),this._root._layout(e,t),e}_findDropTargetNode(e,t,o){let i=this._root._findDropTargetNode(e,t,o);return i===void 0&&(i=this._borders._findDropTargetNode(e,t,o)),i}_tidy(){this._root._tidy()}_updateAttrs(e){qe._attributeDefinitions.update(e,this._attributes)}_nextUniqueId(){return"#"+(0,ri.randomUUID)()}_getAttribute(e){return this._attributes[e]}setOnAllowDrop(e){this._onAllowDrop=e}_getOnAllowDrop(){return this._onAllowDrop}setOnCreateTabSet(e){this._onCreateTabSet=e}_getOnCreateTabSet(){return this._onCreateTabSet}static toTypescriptInterfaces(){console.log(qe._attributeDefinitions.toTypescriptInterface("Global",void 0)),console.log(ln.RowNode.getAttributeDefinitions().toTypescriptInterface("Row",qe._attributeDefinitions)),console.log(dt.TabSetNode.getAttributeDefinitions().toTypescriptInterface("TabSet",qe._attributeDefinitions)),console.log(zt.TabNode.getAttributeDefinitions().toTypescriptInterface("Tab",qe._attributeDefinitions)),console.log(Bn.BorderNode.getAttributeDefinitions().toTypescriptInterface("Border",qe._attributeDefinitions))}toString(){return JSON.stringify(this.toJson())}}mo.Model=qe,qe._attributeDefinitions=qe._createAttributeDefinitions(),function(n){var e=qn&&qn.__createBinding||(Object.create?function(o,i,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(i,r);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[r]}}),Object.defineProperty(o,s,a)}:function(o,i,r,s){s===void 0&&(s=r),o[s]=i[r]}),t=qn&&qn.__exportStar||function(o,i){for(var r in o)r!=="default"&&!Object.prototype.hasOwnProperty.call(i,r)&&e(i,o,r)};Object.defineProperty(n,"__esModule",{value:!0}),t(Kn,n),t(vn,n),t(Ze,n),t(vt(),n),t(In,n),t(oo,n),t(vr,n),t(yr,n),t(xr,n),t(mo,n),t(Tt,n),t(Uo(),n),t(Gt,n),t(Nt,n),t(Ct(),n),t(rt,n),t(Yt,n),t(Xt,n),t(yt,n),t(Ce,n),t(Me,n),t(Le,n)}(Ot);class Pl{constructor(){mn(this,"menus",new Map)}registerMenu(e,t){var o;this.menus.has(e)||this.menus.set(e,[]),(o=this.menus.get(e))==null||o.push(t)}setMenus(e){this.menus=new Map(Object.entries(e))}getMenu(e){return this.menus.get(e)||[]}getAllMenus(){const e={};return this.menus.forEach((t,o)=>{e[o]=t}),e}}const Jt=new Pl;class jl{constructor(){mn(this,"commands",new Map)}registerCommand(e){if(this.commands.has(e.id)){console.warn(`Command ${e.id} is already registered.`);return}this.commands.set(e.id,e)}executeCommand(e,...t){const o=this.commands.get(e);o?o.execute(...t):console.warn(`Command ${e} not found.`)}getCommand(e){return this.commands.get(e)}getCommands(){return Array.from(this.commands.values())}}const ht=new jl;/**
|
|
25
25
|
* @license lucide-react v0.378.0 - ISC
|
|
26
26
|
*
|
|
27
27
|
* This source code is licensed under the ISC license.
|
|
28
28
|
* See the LICENSE file in the root directory of this source tree.
|
|
29
|
-
*/const
|
|
29
|
+
*/const Hl=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Rr=(...n)=>n.filter((e,t,o)=>!!e&&o.indexOf(e)===t).join(" ");/**
|
|
30
30
|
* @license lucide-react v0.378.0 - ISC
|
|
31
31
|
*
|
|
32
32
|
* This source code is licensed under the ISC license.
|
|
33
33
|
* See the LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/var
|
|
34
|
+
*/var Wl={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
35
35
|
* @license lucide-react v0.378.0 - ISC
|
|
36
36
|
*
|
|
37
37
|
* This source code is licensed under the ISC license.
|
|
38
38
|
* See the LICENSE file in the root directory of this source tree.
|
|
39
|
-
*/const
|
|
39
|
+
*/const Yl=A.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:o,className:i="",children:r,iconNode:s,...a},c)=>A.createElement("svg",{ref:c,...Wl,width:e,height:e,stroke:n,strokeWidth:o?Number(t)*24/Number(e):t,className:Rr("lucide",i),...a},[...s.map(([f,m])=>A.createElement(f,m)),...Array.isArray(r)?r:[r]]));/**
|
|
40
40
|
* @license lucide-react v0.378.0 - ISC
|
|
41
41
|
*
|
|
42
42
|
* This source code is licensed under the ISC license.
|
|
43
43
|
* See the LICENSE file in the root directory of this source tree.
|
|
44
|
-
*/const be=(n,e)=>{const t=A.forwardRef(({className:o,...i},r)=>A.createElement(
|
|
44
|
+
*/const be=(n,e)=>{const t=A.forwardRef(({className:o,...i},r)=>A.createElement(Yl,{ref:r,iconNode:e,className:Rr(`lucide-${Hl(n)}`,o),...i}));return t.displayName=`${n}`,t};/**
|
|
45
45
|
* @license lucide-react v0.378.0 - ISC
|
|
46
46
|
*
|
|
47
47
|
* This source code is licensed under the ISC license.
|
|
48
48
|
* See the LICENSE file in the root directory of this source tree.
|
|
49
|
-
*/const
|
|
49
|
+
*/const Xl=be("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
|
|
50
50
|
* @license lucide-react v0.378.0 - ISC
|
|
51
51
|
*
|
|
52
52
|
* This source code is licensed under the ISC license.
|
|
53
53
|
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
-
*/const
|
|
54
|
+
*/const Gl=be("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
55
55
|
* @license lucide-react v0.378.0 - ISC
|
|
56
56
|
*
|
|
57
57
|
* This source code is licensed under the ISC license.
|
|
@@ -61,52 +61,52 @@ React keys must be passed directly to JSX without using spread:
|
|
|
61
61
|
*
|
|
62
62
|
* This source code is licensed under the ISC license.
|
|
63
63
|
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/const
|
|
64
|
+
*/const Vl=be("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
65
65
|
* @license lucide-react v0.378.0 - ISC
|
|
66
66
|
*
|
|
67
67
|
* This source code is licensed under the ISC license.
|
|
68
68
|
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/const
|
|
69
|
+
*/const $l=be("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
70
70
|
* @license lucide-react v0.378.0 - ISC
|
|
71
71
|
*
|
|
72
72
|
* This source code is licensed under the ISC license.
|
|
73
73
|
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/const
|
|
74
|
+
*/const Jl=be("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
|
|
75
75
|
* @license lucide-react v0.378.0 - ISC
|
|
76
76
|
*
|
|
77
77
|
* This source code is licensed under the ISC license.
|
|
78
78
|
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
-
*/const
|
|
79
|
+
*/const Zl=be("Files",[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]]);/**
|
|
80
80
|
* @license lucide-react v0.378.0 - ISC
|
|
81
81
|
*
|
|
82
82
|
* This source code is licensed under the ISC license.
|
|
83
83
|
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
-
*/const
|
|
84
|
+
*/const ql=be("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
85
85
|
* @license lucide-react v0.378.0 - ISC
|
|
86
86
|
*
|
|
87
87
|
* This source code is licensed under the ISC license.
|
|
88
88
|
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
-
*/const
|
|
89
|
+
*/const Kl=be("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
90
90
|
* @license lucide-react v0.378.0 - ISC
|
|
91
91
|
*
|
|
92
92
|
* This source code is licensed under the ISC license.
|
|
93
93
|
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
-
*/const
|
|
94
|
+
*/const Ql=be("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
95
95
|
* @license lucide-react v0.378.0 - ISC
|
|
96
96
|
*
|
|
97
97
|
* This source code is licensed under the ISC license.
|
|
98
98
|
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
-
*/const
|
|
99
|
+
*/const ed=be("GitGraph",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M5 9v6",key:"158jrl"}],["circle",{cx:"5",cy:"18",r:"3",key:"104gr9"}],["path",{d:"M12 3v18",key:"108xh3"}],["circle",{cx:"19",cy:"6",r:"3",key:"108a5v"}],["path",{d:"M16 15.7A9 9 0 0 0 19 9",key:"1e3vqb"}]]);/**
|
|
100
100
|
* @license lucide-react v0.378.0 - ISC
|
|
101
101
|
*
|
|
102
102
|
* This source code is licensed under the ISC license.
|
|
103
103
|
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
-
*/const
|
|
104
|
+
*/const td=be("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/**
|
|
105
105
|
* @license lucide-react v0.378.0 - ISC
|
|
106
106
|
*
|
|
107
107
|
* This source code is licensed under the ISC license.
|
|
108
108
|
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/const
|
|
109
|
+
*/const nd=be("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
110
110
|
* @license lucide-react v0.378.0 - ISC
|
|
111
111
|
*
|
|
112
112
|
* This source code is licensed under the ISC license.
|
|
@@ -116,17 +116,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
116
116
|
*
|
|
117
117
|
* This source code is licensed under the ISC license.
|
|
118
118
|
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
-
*/const
|
|
119
|
+
*/const od=be("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
120
120
|
* @license lucide-react v0.378.0 - ISC
|
|
121
121
|
*
|
|
122
122
|
* This source code is licensed under the ISC license.
|
|
123
123
|
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
-
*/const
|
|
124
|
+
*/const id=be("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
|
|
125
125
|
* @license lucide-react v0.378.0 - ISC
|
|
126
126
|
*
|
|
127
127
|
* This source code is licensed under the ISC license.
|
|
128
128
|
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
-
*/const
|
|
129
|
+
*/const rd=be("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
130
130
|
* @license lucide-react v0.378.0 - ISC
|
|
131
131
|
*
|
|
132
132
|
* This source code is licensed under the ISC license.
|
|
@@ -136,22 +136,22 @@ React keys must be passed directly to JSX without using spread:
|
|
|
136
136
|
*
|
|
137
137
|
* This source code is licensed under the ISC license.
|
|
138
138
|
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
-
*/const
|
|
139
|
+
*/const sd=be("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
|
|
140
140
|
* @license lucide-react v0.378.0 - ISC
|
|
141
141
|
*
|
|
142
142
|
* This source code is licensed under the ISC license.
|
|
143
143
|
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
-
*/const
|
|
144
|
+
*/const ad=be("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
145
145
|
* @license lucide-react v0.378.0 - ISC
|
|
146
146
|
*
|
|
147
147
|
* This source code is licensed under the ISC license.
|
|
148
148
|
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
-
*/const
|
|
149
|
+
*/const ld=be("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a2.121 2.121 0 1 1 3 3L12 15l-4 1 1-4Z",key:"1lpok0"}]]);/**
|
|
150
150
|
* @license lucide-react v0.378.0 - ISC
|
|
151
151
|
*
|
|
152
152
|
* This source code is licensed under the ISC license.
|
|
153
153
|
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
-
*/const
|
|
154
|
+
*/const dd=be("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
155
155
|
* @license lucide-react v0.378.0 - ISC
|
|
156
156
|
*
|
|
157
157
|
* This source code is licensed under the ISC license.
|
|
@@ -161,7 +161,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
161
161
|
*
|
|
162
162
|
* This source code is licensed under the ISC license.
|
|
163
163
|
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
-
*/const
|
|
164
|
+
*/const cd=be("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
165
165
|
* @license lucide-react v0.378.0 - ISC
|
|
166
166
|
*
|
|
167
167
|
* This source code is licensed under the ISC license.
|
|
@@ -171,7 +171,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
171
171
|
*
|
|
172
172
|
* This source code is licensed under the ISC license.
|
|
173
173
|
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
-
*/const bo=be("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Cr=({rightContent:n})=>{const[e,t]=A.useState(Jt.getAllMenus());A.useEffect(()=>{t(Jt.getAllMenus())},[]);const o=s=>{s&&ht.executeCommand(s)},i=s=>{var c;const a=s.keybinding||s.commandId&&((c=ht.getCommand(s.commandId))==null?void 0:c.keybinding);return a?
|
|
174
|
+
*/const bo=be("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Cr=({rightContent:n})=>{const[e,t]=A.useState(Jt.getAllMenus());A.useEffect(()=>{t(Jt.getAllMenus())},[]);const o=s=>{s&&ht.executeCommand(s)},i=s=>{var c;const a=s.keybinding||s.commandId&&((c=ht.getCommand(s.commandId))==null?void 0:c.keybinding);return a?y.jsx("span",{className:"text-[10px] text-muted-foreground opacity-60 ml-4",children:a}):null},r=s=>y.jsx("div",{className:"absolute left-0 top-full hidden group-hover:block z-50 min-w-[180px] bg-popover text-popover-foreground border shadow-md rounded-md py-1",children:s.map(a=>y.jsxs("div",{className:"relative group/sub",children:[y.jsxs("div",{className:"px-3 py-1.5 hover:bg-accent hover:text-accent-foreground cursor-pointer text-xs flex justify-between items-center",onClick:()=>!a.submenu&&o(a.commandId),children:[y.jsx("span",{children:a.label}),y.jsxs("div",{className:"flex items-center space-x-2",children:[i(a),a.submenu&&y.jsx(Ar,{size:10})]})]}),a.submenu&&y.jsx("div",{className:"absolute left-full top-0 hidden group-hover/sub:block z-[60] min-w-[180px] bg-popover text-popover-foreground border shadow-md rounded-md py-1 ml-[-2px]",children:a.submenu.map(c=>y.jsxs("div",{className:"px-3 py-1.5 hover:bg-accent hover:text-accent-foreground cursor-pointer text-xs flex justify-between items-center",onClick:()=>o(c.commandId),children:[y.jsx("span",{children:c.label}),i(c)]},c.id))})]},a.id))});return y.jsxs("div",{className:"h-8 bg-muted border-b flex items-center justify-between px-4 select-none shrink-0",children:[y.jsxs("div",{className:"flex items-center",children:[y.jsx("div",{className:"font-semibold mr-6 text-sm",children:"Nexus Shell"}),y.jsx("div",{className:"flex space-x-1 text-sm",children:Object.entries(e).map(([s,a])=>y.jsxs("div",{className:"relative group",children:[y.jsx("div",{className:"cursor-pointer hover:bg-accent hover:text-accent-foreground px-3 py-1 rounded text-xs",children:s}),a.length>0&&r(a)]},s))})]}),n&&y.jsx("div",{className:"flex items-center",children:n})]})},ud={},Lr=n=>{let e;const t=new Set,o=(m,h)=>{const b=typeof m=="function"?m(e):m;if(!Object.is(b,e)){const d=e;e=h??(typeof b!="object"||b===null)?b:Object.assign({},e,b),t.forEach(l=>l(e,d))}},i=()=>e,c={setState:o,getState:i,getInitialState:()=>f,subscribe:m=>(t.add(m),()=>t.delete(m)),destroy:()=>{(ud?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},f=e=n(o,i,c);return c},hd=n=>n?Lr(n):Lr;var ai={exports:{}},li={},To={exports:{}},di={};/**
|
|
175
175
|
* @license React
|
|
176
176
|
* use-sync-external-store-shim.production.js
|
|
177
177
|
*
|
|
@@ -179,7 +179,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
179
179
|
*
|
|
180
180
|
* This source code is licensed under the MIT license found in the
|
|
181
181
|
* LICENSE file in the root directory of this source tree.
|
|
182
|
-
*/var Dr;function
|
|
182
|
+
*/var Dr;function fd(){if(Dr)return di;Dr=1;var n=A;function e(h,b){return h===b&&(h!==0||1/h===1/b)||h!==h&&b!==b}var t=typeof Object.is=="function"?Object.is:e,o=n.useState,i=n.useEffect,r=n.useLayoutEffect,s=n.useDebugValue;function a(h,b){var d=b(),l=o({inst:{value:d,getSnapshot:b}}),g=l[0].inst,u=l[1];return r(function(){g.value=d,g.getSnapshot=b,c(g)&&u({inst:g})},[h,d,b]),i(function(){return c(g)&&u({inst:g}),h(function(){c(g)&&u({inst:g})})},[h]),s(d),d}function c(h){var b=h.getSnapshot;h=h.value;try{var d=b();return!t(h,d)}catch{return!0}}function f(h,b){return b()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:a;return di.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:m,di}var ci={};/**
|
|
183
183
|
* @license React
|
|
184
184
|
* use-sync-external-store-shim.development.js
|
|
185
185
|
*
|
|
@@ -187,7 +187,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
187
187
|
*
|
|
188
188
|
* This source code is licensed under the MIT license found in the
|
|
189
189
|
* LICENSE file in the root directory of this source tree.
|
|
190
|
-
*/var Ir;function
|
|
190
|
+
*/var Ir;function gd(){return Ir||(Ir=1,process.env.NODE_ENV!=="production"&&function(){function n(d,l){return d===l&&(d!==0||1/d===1/l)||d!==d&&l!==l}function e(d,l){m||i.startTransition===void 0||(m=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var g=l();if(!h){var u=l();r(g,u)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}u=s({inst:{value:g,getSnapshot:l}});var p=u[0].inst,_=u[1];return c(function(){p.value=g,p.getSnapshot=l,t(p)&&_({inst:p})},[d,g,l]),a(function(){return t(p)&&_({inst:p}),d(function(){t(p)&&_({inst:p})})},[d]),f(g),g}function t(d){var l=d.getSnapshot;d=d.value;try{var g=l();return!r(d,g)}catch{return!0}}function o(d,l){return l()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=A,r=typeof Object.is=="function"?Object.is:n,s=i.useState,a=i.useEffect,c=i.useLayoutEffect,f=i.useDebugValue,m=!1,h=!1,b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?o:e;ci.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:b,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ci}var Br;function Mr(){return Br||(Br=1,process.env.NODE_ENV==="production"?To.exports=fd():To.exports=gd()),To.exports}/**
|
|
191
191
|
* @license React
|
|
192
192
|
* use-sync-external-store-shim/with-selector.production.js
|
|
193
193
|
*
|
|
@@ -195,7 +195,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
195
195
|
*
|
|
196
196
|
* This source code is licensed under the MIT license found in the
|
|
197
197
|
* LICENSE file in the root directory of this source tree.
|
|
198
|
-
*/var kr;function
|
|
198
|
+
*/var kr;function pd(){if(kr)return li;kr=1;var n=A,e=Mr();function t(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var o=typeof Object.is=="function"?Object.is:t,i=e.useSyncExternalStore,r=n.useRef,s=n.useEffect,a=n.useMemo,c=n.useDebugValue;return li.useSyncExternalStoreWithSelector=function(f,m,h,b,d){var l=r(null);if(l.current===null){var g={hasValue:!1,value:null};l.current=g}else g=l.current;l=a(function(){function p(E){if(!_){if(_=!0,v=E,E=b(E),d!==void 0&&g.hasValue){var T=g.value;if(d(T,E))return S=T}return S=E}if(T=S,o(v,E))return T;var w=b(E);return d!==void 0&&d(T,w)?(v=E,T):(v=E,S=w)}var _=!1,v,S,x=h===void 0?null:h;return[function(){return p(m())},x===null?void 0:function(){return p(x())}]},[m,h,b,d]);var u=i(f,l[0],l[1]);return s(function(){g.hasValue=!0,g.value=u},[u]),c(u),u},li}var ui={};/**
|
|
199
199
|
* @license React
|
|
200
200
|
* use-sync-external-store-shim/with-selector.development.js
|
|
201
201
|
*
|
|
@@ -203,8 +203,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
203
203
|
*
|
|
204
204
|
* This source code is licensed under the MIT license found in the
|
|
205
205
|
* LICENSE file in the root directory of this source tree.
|
|
206
|
-
*/var zr;function pd(){return zr||(zr=1,process.env.NODE_ENV!=="production"&&function(){function n(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=A,t=Mr(),o=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,r=e.useRef,s=e.useEffect,a=e.useMemo,c=e.useDebugValue;ui.useSyncExternalStoreWithSelector=function(f,m,h,b,d){var l=r(null);if(l.current===null){var g={hasValue:!1,value:null};l.current=g}else g=l.current;l=a(function(){function p(E){if(!_){if(_=!0,y=E,E=b(E),d!==void 0&&g.hasValue){var T=g.value;if(d(T,E))return S=T}return S=E}if(T=S,o(y,E))return T;var w=b(E);return d!==void 0&&d(T,w)?(y=E,T):(y=E,S=w)}var _=!1,y,S,x=h===void 0?null:h;return[function(){return p(m())},x===null?void 0:function(){return p(x())}]},[m,h,b,d]);var u=i(f,l[0],l[1]);return s(function(){g.hasValue=!0,g.value=u},[u]),c(u),u},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ui}process.env.NODE_ENV==="production"?ai.exports=gd():ai.exports=pd();var md=ai.exports;const _d=fa(md),Fr={},{useDebugValue:bd}=A,{useSyncExternalStoreWithSelector:Td}=_d;let Ur=!1;const vd=n=>n;function yd(n,e=vd,t){(Fr?"production":void 0)!=="production"&&t&&!Ur&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Ur=!0);const o=Td(n.subscribe,n.getState,n.getServerState||n.getInitialState,e,t);return bd(o),o}const Pr=n=>{(Fr?"production":void 0)!=="production"&&typeof n!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof n=="function"?ud(n):n,t=(o,i)=>yd(e,o,i);return Object.assign(t,e),t},Zt=n=>n?Pr(n):Pr,vo=Zt(n=>({widgets:[],setWidgets:e=>n({widgets:e}),addWidget:e=>n(t=>({widgets:[...t.widgets,e].sort((o,i)=>(i.priority||0)-(o.priority||0))})),removeWidget:e=>n(t=>({widgets:t.widgets.filter(o=>o.id!==e)})),updateWidget:(e,t)=>n(o=>({widgets:o.widgets.map(i=>i.id===e?{...i,...t}:i)}))}));function jr(n){var e,t,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=jr(n[e]))&&(o&&(o+=" "),o+=t)}else for(t in n)n[t]&&(o&&(o+=" "),o+=t);return o}function qt(){for(var n,e,t=0,o="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=jr(n))&&(o&&(o+=" "),o+=e);return o}const hi="-",xd=n=>{const e=Sd(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:o}=n;return{getClassGroupId:s=>{const a=s.split(hi);return a[0]===""&&a.length!==1&&a.shift(),Hr(a,e)||Ed(s)},getConflictingClassGroupIds:(s,a)=>{const c=t[s]||[];return a&&o[s]?[...c,...o[s]]:c}}},Hr=(n,e)=>{var s;if(n.length===0)return e.classGroupId;const t=n[0],o=e.nextPart.get(t),i=o?Hr(n.slice(1),o):void 0;if(i)return i;if(e.validators.length===0)return;const r=n.join(hi);return(s=e.validators.find(({validator:a})=>a(r)))==null?void 0:s.classGroupId},Wr=/^\[(.+)\]$/,Ed=n=>{if(Wr.test(n)){const e=Wr.exec(n)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},Sd=n=>{const{theme:e,prefix:t}=n,o={nextPart:new Map,validators:[]};return Rd(Object.entries(n.classGroups),t).forEach(([r,s])=>{fi(s,o,r,e)}),o},fi=(n,e,t,o)=>{n.forEach(i=>{if(typeof i=="string"){const r=i===""?e:Yr(e,i);r.classGroupId=t;return}if(typeof i=="function"){if(wd(i)){fi(i(o),e,t,o);return}e.validators.push({validator:i,classGroupId:t});return}Object.entries(i).forEach(([r,s])=>{fi(s,Yr(e,r),t,o)})})},Yr=(n,e)=>{let t=n;return e.split(hi).forEach(o=>{t.nextPart.has(o)||t.nextPart.set(o,{nextPart:new Map,validators:[]}),t=t.nextPart.get(o)}),t},wd=n=>n.isThemeGetter,Rd=(n,e)=>e?n.map(([t,o])=>{const i=o.map(r=>typeof r=="string"?e+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([s,a])=>[e+s,a])):r);return[t,i]}):n,Ad=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,o=new Map;const i=(r,s)=>{t.set(r,s),e++,e>n&&(e=0,o=t,t=new Map)};return{get(r){let s=t.get(r);if(s!==void 0)return s;if((s=o.get(r))!==void 0)return i(r,s),s},set(r,s){t.has(r)?t.set(r,s):i(r,s)}}},Xr="!",Od=n=>{const{separator:e,experimentalParseClassName:t}=n,o=e.length===1,i=e[0],r=e.length,s=a=>{const c=[];let f=0,m=0,h;for(let u=0;u<a.length;u++){let p=a[u];if(f===0){if(p===i&&(o||a.slice(u,u+r)===e)){c.push(a.slice(m,u)),m=u+r;continue}if(p==="/"){h=u;continue}}p==="["?f++:p==="]"&&f--}const b=c.length===0?a:a.substring(m),d=b.startsWith(Xr),l=d?b.substring(1):b,g=h&&h>m?h-m:void 0;return{modifiers:c,hasImportantModifier:d,baseClassName:l,maybePostfixModifierPosition:g}};return t?a=>t({className:a,parseClassName:s}):s},Nd=n=>{if(n.length<=1)return n;const e=[];let t=[];return n.forEach(o=>{o[0]==="["?(e.push(...t.sort(),o),t=[]):t.push(o)}),e.push(...t.sort()),e},Cd=n=>({cache:Ad(n.cacheSize),parseClassName:Od(n),...xd(n)}),Ld=/\s+/,Dd=(n,e)=>{const{parseClassName:t,getClassGroupId:o,getConflictingClassGroupIds:i}=e,r=[],s=n.trim().split(Ld);let a="";for(let c=s.length-1;c>=0;c-=1){const f=s[c],{modifiers:m,hasImportantModifier:h,baseClassName:b,maybePostfixModifierPosition:d}=t(f);let l=!!d,g=o(l?b.substring(0,d):b);if(!g){if(!l){a=f+(a.length>0?" "+a:a);continue}if(g=o(b),!g){a=f+(a.length>0?" "+a:a);continue}l=!1}const u=Nd(m).join(":"),p=h?u+Xr:u,_=p+g;if(r.includes(_))continue;r.push(_);const y=i(g,l);for(let S=0;S<y.length;++S){const x=y[S];r.push(p+x)}a=f+(a.length>0?" "+a:a)}return a};function Id(){let n=0,e,t,o="";for(;n<arguments.length;)(e=arguments[n++])&&(t=Gr(e))&&(o&&(o+=" "),o+=t);return o}const Gr=n=>{if(typeof n=="string")return n;let e,t="";for(let o=0;o<n.length;o++)n[o]&&(e=Gr(n[o]))&&(t&&(t+=" "),t+=e);return t};function Bd(n,...e){let t,o,i,r=s;function s(c){const f=e.reduce((m,h)=>h(m),n());return t=Cd(f),o=t.cache.get,i=t.cache.set,r=a,a(c)}function a(c){const f=o(c);if(f)return f;const m=Dd(c,t);return i(c,m),m}return function(){return r(Id.apply(null,arguments))}}const ve=n=>{const e=t=>t[n]||[];return e.isThemeGetter=!0,e},Vr=/^\[(?:([a-z-]+):)?(.+)\]$/i,Md=/^\d+\/\d+$/,kd=new Set(["px","full","screen"]),zd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fd=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ud=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Pd=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Et=n=>dn(n)||kd.has(n)||Md.test(n),Ft=n=>cn(n,"length",Jd),dn=n=>!!n&&!Number.isNaN(Number(n)),gi=n=>cn(n,"number",dn),Bn=n=>!!n&&Number.isInteger(Number(n)),Hd=n=>n.endsWith("%")&&dn(n.slice(0,-1)),K=n=>Vr.test(n),Ut=n=>zd.test(n),Wd=new Set(["length","size","percentage"]),Yd=n=>cn(n,Wd,$r),Xd=n=>cn(n,"position",$r),Gd=new Set(["image","url"]),Vd=n=>cn(n,Gd,qd),$d=n=>cn(n,"",Zd),Mn=()=>!0,cn=(n,e,t)=>{const o=Vr.exec(n);return o?o[1]?typeof e=="string"?o[1]===e:e.has(o[1]):t(o[2]):!1},Jd=n=>Fd.test(n)&&!Ud.test(n),$r=()=>!1,Zd=n=>Pd.test(n),qd=n=>jd.test(n),Kt=Bd(()=>{const n=ve("colors"),e=ve("spacing"),t=ve("blur"),o=ve("brightness"),i=ve("borderColor"),r=ve("borderRadius"),s=ve("borderSpacing"),a=ve("borderWidth"),c=ve("contrast"),f=ve("grayscale"),m=ve("hueRotate"),h=ve("invert"),b=ve("gap"),d=ve("gradientColorStops"),l=ve("gradientColorStopPositions"),g=ve("inset"),u=ve("margin"),p=ve("opacity"),_=ve("padding"),y=ve("saturate"),S=ve("scale"),x=ve("sepia"),E=ve("skew"),T=ve("space"),w=ve("translate"),C=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",K,e],R=()=>[K,e],F=()=>["",Et,Ft],k=()=>["auto",dn,K],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],j=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],z=()=>["start","end","center","between","around","evenly","stretch"],V=()=>["","0",K],ae=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>[dn,K];return{cacheSize:500,separator:":",theme:{colors:[Mn],spacing:[Et,Ft],blur:["none","",Ut,K],brightness:N(),borderColor:[n],borderRadius:["none","","full",Ut,K],borderSpacing:R(),borderWidth:F(),contrast:N(),grayscale:V(),hueRotate:N(),invert:V(),gap:R(),gradientColorStops:[n],gradientColorStopPositions:[Hd,Ft],inset:L(),margin:L(),opacity:N(),padding:R(),saturate:N(),scale:N(),sepia:V(),skew:N(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",K]}],container:["container"],columns:[{columns:[Ut]}],"break-after":[{"break-after":ae()}],"break-before":[{"break-before":ae()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...B(),K]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Bn,K]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",K]}],grow:[{grow:V()}],shrink:[{shrink:V()}],order:[{order:["first","last","none",Bn,K]}],"grid-cols":[{"grid-cols":[Mn]}],"col-start-end":[{col:["auto",{span:["full",Bn,K]},K]}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":[Mn]}],"row-start-end":[{row:["auto",{span:[Bn,K]},K]}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",K]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",K]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],m:[{m:[u]}],mx:[{mx:[u]}],my:[{my:[u]}],ms:[{ms:[u]}],me:[{me:[u]}],mt:[{mt:[u]}],mr:[{mr:[u]}],mb:[{mb:[u]}],ml:[{ml:[u]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",K,e]}],"min-w":[{"min-w":[K,e,"min","max","fit"]}],"max-w":[{"max-w":[K,e,"none","full","min","max","fit","prose",{screen:[Ut]},Ut]}],h:[{h:[K,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[K,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[K,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[K,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Ut,Ft]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",gi]}],"font-family":[{font:[Mn]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",K]}],"line-clamp":[{"line-clamp":["none",dn,gi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Et,K]}],"list-image":[{"list-image":["none",K]}],"list-style-type":[{list:["none","disc","decimal",K]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[p]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[p]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Et,Ft]}],"underline-offset":[{"underline-offset":["auto",Et,K]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",K]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",K]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[p]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),Xd]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Yd]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Vd]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[l]}],"gradient-via-pos":[{via:[l]}],"gradient-to-pos":[{to:[l]}],"gradient-from":[{from:[d]}],"gradient-via":[{via:[d]}],"gradient-to":[{to:[d]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-b":[{"rounded-b":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-se":[{"rounded-se":[r]}],"rounded-ee":[{"rounded-ee":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-tr":[{"rounded-tr":[r]}],"rounded-br":[{"rounded-br":[r]}],"rounded-bl":[{"rounded-bl":[r]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[p]}],"border-style":[{border:[...Y(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[p]}],"divide-style":[{divide:Y()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Y()]}],"outline-offset":[{"outline-offset":[Et,K]}],"outline-w":[{outline:[Et,Ft]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[p]}],"ring-offset-w":[{"ring-offset":[Et,Ft]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",Ut,$d]}],"shadow-color":[{shadow:[Mn]}],opacity:[{opacity:[p]}],"mix-blend":[{"mix-blend":[...j(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":j()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[o]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Ut,K]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[h]}],saturate:[{saturate:[y]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[p]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",K]}],duration:[{duration:N()}],ease:[{ease:["linear","in","out","in-out",K]}],delay:[{delay:N()}],animate:[{animate:["none","spin","ping","pulse","bounce",K]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Bn,K]}],"translate-x":[{"translate-x":[w]}],"translate-y":[{"translate-y":[w]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",K]}],accent:[{accent:["auto",n]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",K]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",K]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[Et,Ft,gi]}],stroke:[{stroke:[n,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function Kd(...n){return Kt(qt(n))}const Jr=()=>{const{widgets:n}=vo(),e=n.filter(r=>r.alignment==="left"),t=n.filter(r=>r.alignment==="center"),o=n.filter(r=>r.alignment==="right"),i=r=>{const s=r.icon,a=!!(r.commandId||r.onClick),c=()=>{r.onClick?r.onClick():r.commandId&&ht.executeCommand(r.commandId)};return v.jsxs("div",{onClick:a?c:void 0,className:Kd("flex items-center space-x-1.5 px-2 py-0.5 rounded transition-colors h-full",a?"cursor-pointer hover:bg-white/10":"cursor-default",r.className),children:[s&&v.jsx(s,{size:12}),r.label&&v.jsx("span",{children:r.label})]},r.id)};return v.jsxs("div",{className:"h-6 bg-primary text-primary-foreground text-[11px] flex items-center justify-between px-1 select-none shrink-0 border-t border-white/5",children:[v.jsx("div",{className:"flex items-center space-x-1 h-full",children:e.map(i)}),v.jsx("div",{className:"flex items-center space-x-1 h-full",children:t.map(i)}),v.jsx("div",{className:"flex items-center space-x-1 h-full",children:o.map(i)})]})},kn="nexus-shell-sidebar",zn=Zt(n=>{const e=localStorage.getItem(kn);return{activeSidebar:e!==null?e:null,panels:[],setActiveSidebar:o=>{o===null?localStorage.removeItem(kn):localStorage.setItem(kn,o),n({activeSidebar:o})},toggleSidebar:o=>n(i=>{const r=i.activeSidebar===o?null:o;return r===null?localStorage.removeItem(kn):localStorage.setItem(kn,r),{activeSidebar:r}}),setPanels:o=>n({panels:o})}});function Zr(...n){return Kt(qt(n))}const qr=()=>{const{activeSidebar:n,toggleSidebar:e,panels:t}=zn();return v.jsxs("div",{className:"w-12 h-full bg-muted border-r flex flex-col items-center py-2 select-none",children:[v.jsx("div",{className:"flex-1 flex flex-col space-y-4",children:t.map(o=>{const i=o.icon;return v.jsx("div",{onClick:()=>e(o.id),"aria-label":o.label,className:Zr("p-2 cursor-pointer rounded text-muted-foreground hover:text-foreground transition-colors",n===o.id&&"text-foreground border-l-2 border-primary rounded-none"),children:v.jsx(i,{size:24})},o.id)})}),v.jsx("div",{onClick:()=>e("settings"),"aria-label":"Settings",className:Zr("p-2 cursor-pointer rounded text-muted-foreground hover:text-foreground transition-colors",n==="settings"&&"text-foreground border-l-2 border-primary rounded-none"),children:v.jsx(sd,{size:24})})]})},Kr="nexus-shell-theme",Qr=n=>{const e=window.document.documentElement;e.classList.remove("theme-light","theme-dark","theme-gt"),e.classList.add(`theme-${n}`)},yo=Zt(n=>{const t=localStorage.getItem(Kr)||"light";return Qr(t),{theme:t,setTheme:o=>{localStorage.setItem(Kr,o),Qr(o),n({theme:o})}}}),es=()=>{const{activeSidebar:n,setActiveSidebar:e,panels:t}=zn(),{theme:o,setTheme:i}=yo();if(!n)return null;const r=t.find(c=>c.id===n),s=()=>{if(n==="settings")return v.jsx("div",{className:"p-4 space-y-6",children:v.jsxs("section",{children:[v.jsx("h3",{className:"text-[11px] font-bold text-muted-foreground uppercase mb-3",children:"Theme"}),v.jsx("div",{className:"grid grid-cols-1 gap-2",children:[{id:"light",label:"Light",icon:ld},{id:"dark",label:"Dark",icon:nd},{id:"gt",label:"Georgia Tech",icon:ed}].map(({id:c,label:f,icon:m})=>v.jsxs("button",{onClick:()=>i(c),className:`
|
|
206
|
+
*/var zr;function md(){return zr||(zr=1,process.env.NODE_ENV!=="production"&&function(){function n(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=A,t=Mr(),o=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,r=e.useRef,s=e.useEffect,a=e.useMemo,c=e.useDebugValue;ui.useSyncExternalStoreWithSelector=function(f,m,h,b,d){var l=r(null);if(l.current===null){var g={hasValue:!1,value:null};l.current=g}else g=l.current;l=a(function(){function p(E){if(!_){if(_=!0,v=E,E=b(E),d!==void 0&&g.hasValue){var T=g.value;if(d(T,E))return S=T}return S=E}if(T=S,o(v,E))return T;var w=b(E);return d!==void 0&&d(T,w)?(v=E,T):(v=E,S=w)}var _=!1,v,S,x=h===void 0?null:h;return[function(){return p(m())},x===null?void 0:function(){return p(x())}]},[m,h,b,d]);var u=i(f,l[0],l[1]);return s(function(){g.hasValue=!0,g.value=u},[u]),c(u),u},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ui}process.env.NODE_ENV==="production"?ai.exports=pd():ai.exports=md();var _d=ai.exports;const bd=ga(_d),Fr={},{useDebugValue:Td}=A,{useSyncExternalStoreWithSelector:vd}=bd;let Ur=!1;const yd=n=>n;function xd(n,e=yd,t){(Fr?"production":void 0)!=="production"&&t&&!Ur&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Ur=!0);const o=vd(n.subscribe,n.getState,n.getServerState||n.getInitialState,e,t);return Td(o),o}const Pr=n=>{(Fr?"production":void 0)!=="production"&&typeof n!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof n=="function"?hd(n):n,t=(o,i)=>xd(e,o,i);return Object.assign(t,e),t},Zt=n=>n?Pr(n):Pr,vo=Zt(n=>({widgets:[],setWidgets:e=>n({widgets:e}),addWidget:e=>n(t=>({widgets:[...t.widgets,e].sort((o,i)=>(i.priority||0)-(o.priority||0))})),removeWidget:e=>n(t=>({widgets:t.widgets.filter(o=>o.id!==e)})),updateWidget:(e,t)=>n(o=>({widgets:o.widgets.map(i=>i.id===e?{...i,...t}:i)}))}));function jr(n){var e,t,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=jr(n[e]))&&(o&&(o+=" "),o+=t)}else for(t in n)n[t]&&(o&&(o+=" "),o+=t);return o}function qt(){for(var n,e,t=0,o="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=jr(n))&&(o&&(o+=" "),o+=e);return o}const hi="-",Ed=n=>{const e=wd(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:o}=n;return{getClassGroupId:s=>{const a=s.split(hi);return a[0]===""&&a.length!==1&&a.shift(),Hr(a,e)||Sd(s)},getConflictingClassGroupIds:(s,a)=>{const c=t[s]||[];return a&&o[s]?[...c,...o[s]]:c}}},Hr=(n,e)=>{var s;if(n.length===0)return e.classGroupId;const t=n[0],o=e.nextPart.get(t),i=o?Hr(n.slice(1),o):void 0;if(i)return i;if(e.validators.length===0)return;const r=n.join(hi);return(s=e.validators.find(({validator:a})=>a(r)))==null?void 0:s.classGroupId},Wr=/^\[(.+)\]$/,Sd=n=>{if(Wr.test(n)){const e=Wr.exec(n)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},wd=n=>{const{theme:e,prefix:t}=n,o={nextPart:new Map,validators:[]};return Ad(Object.entries(n.classGroups),t).forEach(([r,s])=>{fi(s,o,r,e)}),o},fi=(n,e,t,o)=>{n.forEach(i=>{if(typeof i=="string"){const r=i===""?e:Yr(e,i);r.classGroupId=t;return}if(typeof i=="function"){if(Rd(i)){fi(i(o),e,t,o);return}e.validators.push({validator:i,classGroupId:t});return}Object.entries(i).forEach(([r,s])=>{fi(s,Yr(e,r),t,o)})})},Yr=(n,e)=>{let t=n;return e.split(hi).forEach(o=>{t.nextPart.has(o)||t.nextPart.set(o,{nextPart:new Map,validators:[]}),t=t.nextPart.get(o)}),t},Rd=n=>n.isThemeGetter,Ad=(n,e)=>e?n.map(([t,o])=>{const i=o.map(r=>typeof r=="string"?e+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([s,a])=>[e+s,a])):r);return[t,i]}):n,Od=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,o=new Map;const i=(r,s)=>{t.set(r,s),e++,e>n&&(e=0,o=t,t=new Map)};return{get(r){let s=t.get(r);if(s!==void 0)return s;if((s=o.get(r))!==void 0)return i(r,s),s},set(r,s){t.has(r)?t.set(r,s):i(r,s)}}},Xr="!",Nd=n=>{const{separator:e,experimentalParseClassName:t}=n,o=e.length===1,i=e[0],r=e.length,s=a=>{const c=[];let f=0,m=0,h;for(let u=0;u<a.length;u++){let p=a[u];if(f===0){if(p===i&&(o||a.slice(u,u+r)===e)){c.push(a.slice(m,u)),m=u+r;continue}if(p==="/"){h=u;continue}}p==="["?f++:p==="]"&&f--}const b=c.length===0?a:a.substring(m),d=b.startsWith(Xr),l=d?b.substring(1):b,g=h&&h>m?h-m:void 0;return{modifiers:c,hasImportantModifier:d,baseClassName:l,maybePostfixModifierPosition:g}};return t?a=>t({className:a,parseClassName:s}):s},Cd=n=>{if(n.length<=1)return n;const e=[];let t=[];return n.forEach(o=>{o[0]==="["?(e.push(...t.sort(),o),t=[]):t.push(o)}),e.push(...t.sort()),e},Ld=n=>({cache:Od(n.cacheSize),parseClassName:Nd(n),...Ed(n)}),Dd=/\s+/,Id=(n,e)=>{const{parseClassName:t,getClassGroupId:o,getConflictingClassGroupIds:i}=e,r=[],s=n.trim().split(Dd);let a="";for(let c=s.length-1;c>=0;c-=1){const f=s[c],{modifiers:m,hasImportantModifier:h,baseClassName:b,maybePostfixModifierPosition:d}=t(f);let l=!!d,g=o(l?b.substring(0,d):b);if(!g){if(!l){a=f+(a.length>0?" "+a:a);continue}if(g=o(b),!g){a=f+(a.length>0?" "+a:a);continue}l=!1}const u=Cd(m).join(":"),p=h?u+Xr:u,_=p+g;if(r.includes(_))continue;r.push(_);const v=i(g,l);for(let S=0;S<v.length;++S){const x=v[S];r.push(p+x)}a=f+(a.length>0?" "+a:a)}return a};function Bd(){let n=0,e,t,o="";for(;n<arguments.length;)(e=arguments[n++])&&(t=Gr(e))&&(o&&(o+=" "),o+=t);return o}const Gr=n=>{if(typeof n=="string")return n;let e,t="";for(let o=0;o<n.length;o++)n[o]&&(e=Gr(n[o]))&&(t&&(t+=" "),t+=e);return t};function Md(n,...e){let t,o,i,r=s;function s(c){const f=e.reduce((m,h)=>h(m),n());return t=Ld(f),o=t.cache.get,i=t.cache.set,r=a,a(c)}function a(c){const f=o(c);if(f)return f;const m=Id(c,t);return i(c,m),m}return function(){return r(Bd.apply(null,arguments))}}const ve=n=>{const e=t=>t[n]||[];return e.isThemeGetter=!0,e},Vr=/^\[(?:([a-z-]+):)?(.+)\]$/i,kd=/^\d+\/\d+$/,zd=new Set(["px","full","screen"]),Fd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ud=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Pd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,jd=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Hd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Et=n=>dn(n)||zd.has(n)||kd.test(n),Ft=n=>cn(n,"length",Zd),dn=n=>!!n&&!Number.isNaN(Number(n)),gi=n=>cn(n,"number",dn),Mn=n=>!!n&&Number.isInteger(Number(n)),Wd=n=>n.endsWith("%")&&dn(n.slice(0,-1)),K=n=>Vr.test(n),Ut=n=>Fd.test(n),Yd=new Set(["length","size","percentage"]),Xd=n=>cn(n,Yd,$r),Gd=n=>cn(n,"position",$r),Vd=new Set(["image","url"]),$d=n=>cn(n,Vd,Kd),Jd=n=>cn(n,"",qd),kn=()=>!0,cn=(n,e,t)=>{const o=Vr.exec(n);return o?o[1]?typeof e=="string"?o[1]===e:e.has(o[1]):t(o[2]):!1},Zd=n=>Ud.test(n)&&!Pd.test(n),$r=()=>!1,qd=n=>jd.test(n),Kd=n=>Hd.test(n),Kt=Md(()=>{const n=ve("colors"),e=ve("spacing"),t=ve("blur"),o=ve("brightness"),i=ve("borderColor"),r=ve("borderRadius"),s=ve("borderSpacing"),a=ve("borderWidth"),c=ve("contrast"),f=ve("grayscale"),m=ve("hueRotate"),h=ve("invert"),b=ve("gap"),d=ve("gradientColorStops"),l=ve("gradientColorStopPositions"),g=ve("inset"),u=ve("margin"),p=ve("opacity"),_=ve("padding"),v=ve("saturate"),S=ve("scale"),x=ve("sepia"),E=ve("skew"),T=ve("space"),w=ve("translate"),C=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",K,e],R=()=>[K,e],F=()=>["",Et,Ft],k=()=>["auto",dn,K],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],j=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],z=()=>["start","end","center","between","around","evenly","stretch"],V=()=>["","0",K],ae=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>[dn,K];return{cacheSize:500,separator:":",theme:{colors:[kn],spacing:[Et,Ft],blur:["none","",Ut,K],brightness:N(),borderColor:[n],borderRadius:["none","","full",Ut,K],borderSpacing:R(),borderWidth:F(),contrast:N(),grayscale:V(),hueRotate:N(),invert:V(),gap:R(),gradientColorStops:[n],gradientColorStopPositions:[Wd,Ft],inset:L(),margin:L(),opacity:N(),padding:R(),saturate:N(),scale:N(),sepia:V(),skew:N(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",K]}],container:["container"],columns:[{columns:[Ut]}],"break-after":[{"break-after":ae()}],"break-before":[{"break-before":ae()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...B(),K]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Mn,K]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",K]}],grow:[{grow:V()}],shrink:[{shrink:V()}],order:[{order:["first","last","none",Mn,K]}],"grid-cols":[{"grid-cols":[kn]}],"col-start-end":[{col:["auto",{span:["full",Mn,K]},K]}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":[kn]}],"row-start-end":[{row:["auto",{span:[Mn,K]},K]}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",K]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",K]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],m:[{m:[u]}],mx:[{mx:[u]}],my:[{my:[u]}],ms:[{ms:[u]}],me:[{me:[u]}],mt:[{mt:[u]}],mr:[{mr:[u]}],mb:[{mb:[u]}],ml:[{ml:[u]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",K,e]}],"min-w":[{"min-w":[K,e,"min","max","fit"]}],"max-w":[{"max-w":[K,e,"none","full","min","max","fit","prose",{screen:[Ut]},Ut]}],h:[{h:[K,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[K,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[K,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[K,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Ut,Ft]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",gi]}],"font-family":[{font:[kn]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",K]}],"line-clamp":[{"line-clamp":["none",dn,gi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Et,K]}],"list-image":[{"list-image":["none",K]}],"list-style-type":[{list:["none","disc","decimal",K]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[p]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[p]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Et,Ft]}],"underline-offset":[{"underline-offset":["auto",Et,K]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",K]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",K]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[p]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),Gd]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Xd]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},$d]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[l]}],"gradient-via-pos":[{via:[l]}],"gradient-to-pos":[{to:[l]}],"gradient-from":[{from:[d]}],"gradient-via":[{via:[d]}],"gradient-to":[{to:[d]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-b":[{"rounded-b":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-se":[{"rounded-se":[r]}],"rounded-ee":[{"rounded-ee":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-tr":[{"rounded-tr":[r]}],"rounded-br":[{"rounded-br":[r]}],"rounded-bl":[{"rounded-bl":[r]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[p]}],"border-style":[{border:[...Y(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[p]}],"divide-style":[{divide:Y()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Y()]}],"outline-offset":[{"outline-offset":[Et,K]}],"outline-w":[{outline:[Et,Ft]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[p]}],"ring-offset-w":[{"ring-offset":[Et,Ft]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",Ut,Jd]}],"shadow-color":[{shadow:[kn]}],opacity:[{opacity:[p]}],"mix-blend":[{"mix-blend":[...j(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":j()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[o]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Ut,K]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[h]}],saturate:[{saturate:[v]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[p]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",K]}],duration:[{duration:N()}],ease:[{ease:["linear","in","out","in-out",K]}],delay:[{delay:N()}],animate:[{animate:["none","spin","ping","pulse","bounce",K]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Mn,K]}],"translate-x":[{"translate-x":[w]}],"translate-y":[{"translate-y":[w]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",K]}],accent:[{accent:["auto",n]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",K]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",K]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[Et,Ft,gi]}],stroke:[{stroke:[n,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});function Qd(...n){return Kt(qt(n))}const Jr=()=>{const{widgets:n}=vo(),e=n.filter(r=>r.alignment==="left"),t=n.filter(r=>r.alignment==="center"),o=n.filter(r=>r.alignment==="right"),i=r=>{const s=r.icon,a=!!(r.commandId||r.onClick),c=()=>{r.onClick?r.onClick():r.commandId&&ht.executeCommand(r.commandId)};return y.jsxs("div",{onClick:a?c:void 0,className:Qd("flex items-center space-x-1.5 px-2 py-0.5 rounded transition-colors h-full",a?"cursor-pointer hover:bg-white/10":"cursor-default",r.className),children:[s&&y.jsx(s,{size:12}),r.label&&y.jsx("span",{children:r.label})]},r.id)};return y.jsxs("div",{className:"h-6 bg-primary text-primary-foreground text-[11px] flex items-center justify-between px-1 select-none shrink-0 border-t border-white/5",children:[y.jsx("div",{className:"flex items-center space-x-1 h-full",children:e.map(i)}),y.jsx("div",{className:"flex items-center space-x-1 h-full",children:t.map(i)}),y.jsx("div",{className:"flex items-center space-x-1 h-full",children:o.map(i)})]})},zn="nexus-shell-sidebar",Fn=Zt(n=>{const e=localStorage.getItem(zn);return{activeSidebar:e!==null?e:null,panels:[],setActiveSidebar:o=>{o===null?localStorage.removeItem(zn):localStorage.setItem(zn,o),n({activeSidebar:o})},toggleSidebar:o=>n(i=>{const r=i.activeSidebar===o?null:o;return r===null?localStorage.removeItem(zn):localStorage.setItem(zn,r),{activeSidebar:r}}),setPanels:o=>n({panels:o})}});function Zr(...n){return Kt(qt(n))}const qr=()=>{const{activeSidebar:n,toggleSidebar:e,panels:t}=Fn();return y.jsxs("div",{className:"w-12 h-full bg-muted border-r flex flex-col items-center py-2 select-none",children:[y.jsx("div",{className:"flex-1 flex flex-col space-y-4",children:t.map(o=>{const i=o.icon;return y.jsx("div",{onClick:()=>e(o.id),"aria-label":o.label,className:Zr("p-2 cursor-pointer rounded text-muted-foreground hover:text-foreground transition-colors",n===o.id&&"text-foreground border-l-2 border-primary rounded-none"),children:y.jsx(i,{size:24})},o.id)})}),y.jsx("div",{onClick:()=>e("settings"),"aria-label":"Settings",className:Zr("p-2 cursor-pointer rounded text-muted-foreground hover:text-foreground transition-colors",n==="settings"&&"text-foreground border-l-2 border-primary rounded-none"),children:y.jsx(ad,{size:24})})]})},Kr="nexus-shell-theme",Qr=n=>{const e=window.document.documentElement;e.classList.remove("theme-light","theme-dark","theme-gt"),e.classList.add(`theme-${n}`)},yo=Zt(n=>{const t=localStorage.getItem(Kr)||"light";return Qr(t),{theme:t,setTheme:o=>{localStorage.setItem(Kr,o),Qr(o),n({theme:o})}}}),es=()=>{const{activeSidebar:n,setActiveSidebar:e,panels:t}=Fn(),{theme:o,setTheme:i}=yo();if(!n)return null;const r=t.find(c=>c.id===n),s=()=>{if(n==="settings")return y.jsx("div",{className:"p-4 space-y-6",children:y.jsxs("section",{children:[y.jsx("h3",{className:"text-[11px] font-bold text-muted-foreground uppercase mb-3",children:"Theme"}),y.jsx("div",{className:"grid grid-cols-1 gap-2",children:[{id:"light",label:"Light",icon:dd},{id:"dark",label:"Dark",icon:od},{id:"gt",label:"Georgia Tech",icon:td}].map(({id:c,label:f,icon:m})=>y.jsxs("button",{onClick:()=>i(c),className:`
|
|
207
207
|
flex items-center space-x-3 px-3 py-2 rounded-md border text-sm transition-all
|
|
208
208
|
${o===c?"bg-primary text-primary-foreground border-primary":"bg-background hover:bg-accent border-border"}
|
|
209
|
-
`,children:[v.jsx(m,{size:16}),v.jsx("span",{children:f})]},c))})]})});if(r){if(typeof r.component=="function"){const c=r.component;return v.jsx(c,{})}return r.component}return v.jsx("div",{className:"p-4 text-sm italic text-muted-foreground",children:"Panel content not found."})},a=()=>n==="settings"?"SETTINGS":(r==null?void 0:r.label.toUpperCase())||"";return v.jsxs("div",{className:"w-[300px] h-full bg-muted border-r flex flex-col select-none",children:[v.jsxs("div",{className:"h-10 flex items-center justify-between px-4 text-[11px] font-bold text-muted-foreground uppercase tracking-widest",children:[v.jsx("span",{children:a()}),v.jsx("button",{onClick:()=>e(null),className:"p-1 hover:bg-accent hover:text-foreground rounded transition-colors",children:v.jsx(bo,{size:14})})]}),v.jsx("div",{className:"flex-1 overflow-auto border-t border-border/50 bg-background/50",children:s()})]})},pi="nexus-shell-right-sidebar",mi=Zt(n=>({isChatOpen:localStorage.getItem(pi)==="true",setChatOpen:o=>{localStorage.setItem(pi,String(o)),n({isChatOpen:o})},toggleChat:()=>n(o=>{const i=!o.isChatOpen;return localStorage.setItem(pi,String(i)),{isChatOpen:i}})})),xo=Zt(n=>({slashCommands:[],setSlashCommands:e=>n({slashCommands:e}),registerSlashCommand:e=>n(t=>({slashCommands:[...t.slashCommands,e]}))}));function _i(...n){return Kt(qt(n))}const ts=()=>{const{isChatOpen:n,setChatOpen:e}=mi(),{slashCommands:t}=xo(),[o,i]=A.useState([{id:1,sender:"Nexus",text:"Welcome to the Nexus Shell chat! How can I help you today?"}]),[r,s]=A.useState(""),[a,c]=A.useState(!1),[f,m]=A.useState(0),h=A.useRef(null),b=t.filter(u=>`/${u.command}`.startsWith(r.toLowerCase()));if(A.useEffect(()=>{r.startsWith("/")&&b.length>0?c(!0):c(!1)},[r,b.length]),!n)return null;const d=()=>{if(!r.trim())return;if(r.startsWith("/")){const p=r.slice(1).split(" "),_=p[0],y=p.slice(1),S=t.find(x=>x.command===_);if(S){S.execute(y),i(x=>[...x,{id:Date.now(),sender:"User",text:r}]),s("");return}}const u={id:Date.now(),sender:"User",text:r};i(p=>[...p,u]),s(""),setTimeout(()=>{i(p=>[...p,{id:Date.now()+1,sender:"Nexus",text:"I'm a simulated Nexus response. In a real application, I'd be connected to an LLM!"}])},1e3)},l=u=>{var p;s(`/${u.command} `),c(!1),(p=h.current)==null||p.focus()},g=u=>{a?u.key==="ArrowDown"?(u.preventDefault(),m(p=>(p+1)%b.length)):u.key==="ArrowUp"?(u.preventDefault(),m(p=>(p-1+b.length)%b.length)):u.key==="Tab"||u.key==="Enter"?(u.preventDefault(),l(b[f])):u.key==="Escape"&&c(!1):u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),d())};return v.jsxs("div",{className:"w-[350px] h-full bg-muted border-l flex flex-col select-none animate-in slide-in-from-right duration-300",children:[v.jsxs("div",{className:"h-10 flex items-center justify-between px-4 text-[11px] font-bold text-muted-foreground uppercase tracking-widest border-b border-border/50",children:[v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(Or,{size:14}),v.jsx("span",{children:"Chat"})]}),v.jsx("button",{onClick:()=>e(!1),className:"p-1 hover:bg-accent hover:text-foreground rounded transition-colors",children:v.jsx(bo,{size:14})})]}),v.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:o.map(u=>v.jsxs("div",{className:_i("flex flex-col space-y-1",u.sender==="User"?"items-end":"items-start"),children:[v.jsxs("div",{className:"flex items-center space-x-1 text-[10px] text-muted-foreground",children:[v.jsx(Nr,{size:10}),v.jsx("span",{children:u.sender})]}),v.jsx("div",{className:_i("px-3 py-2 rounded-lg text-sm max-w-[90%]",u.sender==="User"?"bg-primary text-primary-foreground":"bg-accent/50 text-foreground"),children:u.text})]},u.id))}),v.jsxs("div",{className:"p-4 border-t border-border/50 relative",children:[a&&v.jsxs("div",{className:"absolute bottom-full left-4 right-4 mb-2 bg-popover border shadow-xl rounded-lg overflow-hidden z-50",children:[v.jsx("div",{className:"px-3 py-2 text-[10px] font-bold text-muted-foreground border-b bg-muted/30",children:"COMMANDS"}),b.map((u,p)=>v.jsxs("div",{className:_i("px-3 py-2 cursor-pointer flex items-center justify-between text-xs",p===f?"bg-accent text-accent-foreground":"hover:bg-accent/50"),onClick:()=>l(u),onMouseEnter:()=>m(p),children:[v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(_o,{size:12,className:"text-primary"}),v.jsxs("span",{className:"font-semibold",children:["/",u.command]})]}),v.jsx("span",{className:"text-[10px] text-muted-foreground",children:u.description})]},u.command))]}),v.jsxs("div",{className:"relative",children:[v.jsx("textarea",{ref:h,value:r,onChange:u=>s(u.target.value),onKeyDown:g,placeholder:"Ask Nexus... (Type / for commands)",className:"w-full bg-background border rounded-md p-2 text-sm focus:ring-1 focus:ring-primary outline-none resize-none min-h-[80px]"}),v.jsx("button",{onClick:d,className:"absolute right-2 bottom-2 p-1.5 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",children:v.jsx(rd,{size:14})})]}),v.jsxs("div",{className:"mt-1.5 flex items-center space-x-1.5 text-[10px] text-muted-foreground opacity-70",children:[v.jsx(_o,{size:10}),v.jsxs("span",{children:["Use ",v.jsx("kbd",{className:"bg-muted px-1 rounded border border-border/50 font-sans",children:"/"})," to trigger slash commands"]})]})]})]})},bi=Zt(n=>({isOpen:!1,history:["Welcome to Nexus Shell Terminal v0.1.0",'Type "help" for a list of commands.'],setOpen:e=>n({isOpen:e}),toggle:()=>n(e=>({isOpen:!e.isOpen})),addHistory:e=>n(t=>({history:[...t.history,e]})),clearHistory:()=>n({history:[]})})),ns=()=>{const{isOpen:n,setOpen:e,history:t,addHistory:o,clearHistory:i}=bi(),[r,s]=A.useState(""),a=A.useRef(null),c=A.useRef(null);if(A.useEffect(()=>{a.current&&(a.current.scrollTop=a.current.scrollHeight)},[t]),A.useEffect(()=>{var m;n&&((m=c.current)==null||m.focus())},[n]),!n)return null;const f=m=>{if(m.key==="Enter"){const h=r.trim();if(!h)return;o(`$ ${h}`);const b=h.toLowerCase();b==="clear"?i():b==="help"?o("Available commands: help, clear, echo [text], date, theme"):b.startsWith("echo ")?o(h.slice(5)):o(b==="date"?new Date().toLocaleString():`Command not found: ${h}`),s("")}};return v.jsxs("div",{className:"h-[250px] bg-background border-t border-border flex flex-col select-text animate-in slide-in-from-bottom duration-300",children:[v.jsxs("div",{className:"h-9 border-b border-border/50 flex items-center justify-between px-4 bg-muted/30",children:[v.jsxs("div",{className:"flex items-center space-x-4",children:[v.jsxs("div",{className:"flex items-center space-x-2 text-[11px] font-bold text-muted-foreground uppercase tracking-widest border-b-2 border-primary pb-2.5 pt-2.5 mt-0.5",children:[v.jsx(_o,{size:14}),v.jsx("span",{children:"Terminal"})]}),v.jsx("div",{className:"text-[11px] text-muted-foreground hover:text-foreground cursor-pointer transition-colors",children:"Output"}),v.jsx("div",{className:"text-[11px] text-muted-foreground hover:text-foreground cursor-pointer transition-colors",children:"Debug Console"})]}),v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx("button",{className:"p-1 hover:bg-accent rounded text-muted-foreground",children:v.jsx(Gl,{size:14})}),v.jsx("button",{onClick:()=>e(!1),className:"p-1 hover:bg-accent rounded text-muted-foreground",children:v.jsx(bo,{size:14})})]})]}),v.jsxs("div",{ref:a,className:"flex-1 overflow-y-auto p-3 font-mono text-xs space-y-1 bg-black/5 dark:bg-black/20",children:[t.map((m,h)=>v.jsx("div",{className:"whitespace-pre-wrap break-all opacity-90",children:m},h)),v.jsxs("div",{className:"flex items-center space-x-2 pt-1",children:[v.jsx("span",{className:"text-primary font-bold",children:"$"}),v.jsx("input",{ref:c,type:"text",className:"flex-1 bg-transparent border-none outline-none text-xs font-mono",value:r,onChange:m=>s(m.target.value),onKeyDown:f,spellCheck:!1,autoComplete:"off"})]})]})]})},os={global:{tabEnableClose:!0,tabSetEnableMaximize:!1,tabSetEnableDivide:!0},borders:[{type:"border",location:"left",children:[]}],layout:{type:"row",weight:100,children:[{type:"tabset",weight:50,children:[{type:"tab",name:"Welcome",component:"welcome"}]}]}},is="nexus-shell-layout",Ti=Zt((n,e)=>{let t;try{const o=localStorage.getItem(is);o?t=Ot.Model.fromJson(JSON.parse(o)):t=Ot.Model.fromJson(os)}catch(o){console.warn("Failed to load layout from storage, using default",o),t=Ot.Model.fromJson(os)}return{model:t,dirtyTabs:new Set,setModel:o=>{n({model:o}),localStorage.setItem(is,JSON.stringify(o.toJson()))},setTabDirty:(o,i)=>{n(r=>{const s=new Set(r.dirtyTabs);return i?s.add(o):s.delete(o),{dirtyTabs:s}})},isTabDirty:o=>e().dirtyTabs.has(o),addTab:(o,i)=>{const r=e().model,s=r.getActiveTabset();let a=s==null?void 0:s.getId();a&&r.doAction(Ot.Actions.addNode({type:"tab",component:o,name:i||o},a,Ot.DockLocation.CENTER,-1))}}}),Qd=({panels:n,slashCommands:e,menuConfig:t,statusBarConfig:o,rightMenuBarContent:i})=>{const{model:r,setModel:s,isTabDirty:a,setTabDirty:c}=Ti(),{theme:f}=yo(),{setPanels:m}=zn(),{setSlashCommands:h}=xo(),{setWidgets:b}=vo();A.useEffect(()=>{n&&m(n)},[n,m]),A.useEffect(()=>{e&&h(e)},[e,h]),A.useEffect(()=>{t&&Jt.setMenus(t)},[t]),A.useEffect(()=>{o&&b(o)},[o,b]);const d=g=>{try{var u=g.getComponent();const p=g.getId(),_=a(p);return u==="welcome"?v.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center space-y-4 p-8",children:[v.jsx("h1",{className:"text-4xl font-bold text-primary",children:"Nexus Shell"}),v.jsx("p",{className:"text-muted-foreground",children:"A professional-grade frontend framework built with React and TypeScript."}),v.jsx("p",{className:"text-sm text-muted-foreground",children:"Start by exploring the menu or dragging tabs."}),v.jsxs("div",{className:"mt-8 p-4 border rounded bg-muted/20",children:[v.jsx("p",{className:"text-xs mb-2",children:"Tab Persistence & Lifecycle Test:"}),v.jsx("button",{onClick:()=>c(p,!_),className:`px-3 py-1 text-xs rounded border ${_?"bg-destructive text-destructive-foreground":"bg-secondary text-secondary-foreground"}`,children:_?"Mark as Saved (Clear Dirty)":"Mark as Dirty (Unsaved Changes)"}),_&&v.jsx("p",{className:"text-[10px] mt-1 text-destructive",children:"This tab will now prompt before closing."})]})]}):v.jsxs("div",{className:"p-4 text-sm",children:["Unknown Component: ",u]})}catch(p){return console.error("Error in component factory:",p),v.jsxs("div",{className:"p-8 text-destructive bg-destructive/10 border border-destructive/20 h-full flex items-center justify-center",children:["Error rendering component: ",(p==null?void 0:p.message)||"Unknown error"]})}},l=g=>{if(g.type===Ot.Actions.DELETE_TAB){const u=r.getNodeById(g.data.node);if(u&&a(u.getId())){if(!window.confirm(`Tab "${u.getName()}" has unsaved changes. Are you sure you want to close it?`))return;c(u.getId(),!1)}}return g};return v.jsxs("div",{className:`flex flex-col h-screen w-screen bg-background text-foreground overflow-hidden theme-${f}`,children:[v.jsx(Cr,{rightContent:i}),v.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[v.jsx(qr,{}),v.jsx(es,{}),v.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-card",children:[v.jsx("div",{className:"flex-1 relative h-full w-full",children:v.jsx(Ot.Layout,{model:r,factory:d,onModelChange:g=>s(g),onAction:l})}),v.jsx(ns,{})]}),v.jsx(ts,{})]}),v.jsx(Jr,{})]})},Eo=0,Pt=1,un=2,rs=4;function ss(n){return()=>n}function ec(n){n()}function as(n,e){return t=>n(e(t))}function ls(n,e){return()=>n(e)}function tc(n,e){return t=>n(e,t)}function vi(n){return n!==void 0}function nc(...n){return()=>{n.map(ec)}}function hn(){}function So(n,e){return e(n),n}function oc(n,e){return e(n)}function ye(...n){return n}function ue(n,e){return n(Pt,e)}function Q(n,e){n(Eo,e)}function yi(n){n(un)}function Ee(n){return n(rs)}function H(n,e){return ue(n,tc(e,Eo))}function ct(n,e){const t=n(Pt,o=>{t(),e(o)});return t}function ds(n){let e,t;return o=>i=>{e=i,t&&clearTimeout(t),t=setTimeout(()=>{o(e)},n)}}function cs(n,e){return n===e}function xe(n=cs){let e;return t=>o=>{n(e,o)||(e=o,t(o))}}function X(n){return e=>t=>{n(t)&&e(t)}}function U(n){return e=>as(e,n)}function ft(n){return e=>()=>{e(n)}}function D(n,...e){const t=ic(...e);return(o,i)=>{switch(o){case un:yi(n);return;case Pt:return ue(n,t(i))}}}function gt(n,e){return t=>o=>{t(e=n(e,o))}}function Qt(n){return e=>t=>{n>0?n--:e(t)}}function St(n){let e=null,t;return o=>i=>{e=i,!t&&(t=setTimeout(()=>{t=void 0,o(e)},n))}}function ee(...n){const e=new Array(n.length);let t=0,o=null;const i=Math.pow(2,n.length)-1;return n.forEach((r,s)=>{const a=Math.pow(2,s);ue(r,c=>{const f=t;t=t|a,e[s]=c,f!==i&&t===i&&o&&(o(),o=null)})}),r=>s=>{const a=()=>{r([s].concat(e))};t===i?a():o=a}}function ic(...n){return e=>n.reduceRight(oc,e)}function rc(n){let e,t;const o=()=>e==null?void 0:e();return function(i,r){switch(i){case Pt:return r?t===r?void 0:(o(),t=r,e=ue(n,r),e):(o(),hn);case un:o(),t=null;return}}}function I(n){let e=n;const t=ie();return(o,i)=>{switch(o){case Eo:e=i;break;case Pt:{i(e);break}case rs:return e}return t(o,i)}}function ze(n,e){return So(I(e),t=>H(n,t))}function ie(){const n=[];return(e,t)=>{switch(e){case Eo:n.slice().forEach(o=>{o(t)});return;case un:n.splice(0,n.length);return;case Pt:return n.push(t),()=>{const o=n.indexOf(t);o>-1&&n.splice(o,1)}}}}function Ke(n){return So(ie(),e=>H(n,e))}function le(n,e=[],{singleton:t}={singleton:!0}){return{constructor:n,dependencies:e,id:sc(),singleton:t}}const sc=()=>Symbol();function ac(n){const e=new Map,t=({constructor:o,dependencies:i,id:r,singleton:s})=>{if(s&&e.has(r))return e.get(r);const a=o(i.map(c=>t(c)));return s&&e.set(r,a),a};return t(n)}function Re(...n){const e=ie(),t=new Array(n.length);let o=0;const i=Math.pow(2,n.length)-1;return n.forEach((r,s)=>{const a=Math.pow(2,s);ue(r,c=>{t[s]=c,o=o|a,o===i&&Q(e,t)})}),function(r,s){switch(r){case un:{yi(e);return}case Pt:return o===i&&s(t),ue(e,s)}}}function G(n,e=cs){return D(n,xe(e))}function xi(...n){return function(e,t){switch(e){case un:return;case Pt:return nc(...n.map(o=>ue(o,t)))}}}var Ve=(n=>(n[n.DEBUG=0]="DEBUG",n[n.INFO=1]="INFO",n[n.WARN=2]="WARN",n[n.ERROR=3]="ERROR",n))(Ve||{});const lc={0:"debug",3:"error",1:"log",2:"warn"},dc=()=>typeof globalThis>"u"?window:globalThis,jt=le(()=>{const n=I(3);return{log:I((e,t,o=1)=>{var i;const r=(i=dc().VIRTUOSO_LOG_LEVEL)!=null?i:Ee(n);o>=r&&console[lc[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",e,t)}),logLevel:n}},[],{singleton:!0});function en(n,e,t){return Ei(n,e,t).callbackRef}function Ei(n,e,t){const o=A.useRef(null);let i=s=>{};const r=A.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(s=>{const a=()=>{const c=s[0].target;c.offsetParent!==null&&n(c)};t?a():requestAnimationFrame(a)}):null,[n,t]);return i=s=>{s&&e?(r==null||r.observe(s),o.current=s):(o.current&&(r==null||r.unobserve(o.current)),o.current=null)},{callbackRef:i,ref:o}}function cc(n,e,t,o,i,r,s,a,c){const f=A.useCallback(m=>{const h=uc(m.children,e,a?"offsetWidth":"offsetHeight",i);let b=m.parentElement;for(;!b.dataset.virtuosoScroller;)b=b.parentElement;const d=b.lastElementChild.dataset.viewportType==="window";let l;d&&(l=b.ownerDocument.defaultView);const g=s?a?s.scrollLeft:s.scrollTop:d?a?l.scrollX||l.document.documentElement.scrollLeft:l.scrollY||l.document.documentElement.scrollTop:a?b.scrollLeft:b.scrollTop,u=s?a?s.scrollWidth:s.scrollHeight:d?a?l.document.documentElement.scrollWidth:l.document.documentElement.scrollHeight:a?b.scrollWidth:b.scrollHeight,p=s?a?s.offsetWidth:s.offsetHeight:d?a?l.innerWidth:l.innerHeight:a?b.offsetWidth:b.offsetHeight;o({scrollHeight:u,scrollTop:Math.max(g,0),viewportHeight:p}),r==null||r(a?us("column-gap",getComputedStyle(m).columnGap,i):us("row-gap",getComputedStyle(m).rowGap,i)),h!==null&&n(h)},[n,e,i,r,s,o,a]);return Ei(f,t,c)}function uc(n,e,t,o){const i=n.length;if(i===0)return null;const r=[];for(let s=0;s<i;s++){const a=n.item(s);if(a.dataset.index===void 0)continue;const c=parseInt(a.dataset.index),f=parseFloat(a.dataset.knownSize),m=e(a,t);if(m===0&&o("Zero-sized element, this should not happen",{child:a},Ve.ERROR),m===f)continue;const h=r[r.length-1];r.length===0||h.size!==m||h.endIndex!==c-1?r.push({endIndex:c,size:m,startIndex:c}):r[r.length-1].endIndex++}return r}function us(n,e,t){return e!=="normal"&&!(e!=null&&e.endsWith("px"))&&t(`${n} was not resolved to pixel value correctly`,e,Ve.WARN),e==="normal"?0:parseInt(e??"0",10)}function hs(n,e,t){const o=A.useRef(null),i=A.useCallback(c=>{if(!(c!=null&&c.offsetParent))return;const f=c.getBoundingClientRect(),m=f.width;let h,b;if(e){const d=e.getBoundingClientRect(),l=f.top-d.top;b=d.height-Math.max(0,l),h=l+e.scrollTop}else{const d=s.current.ownerDocument.defaultView;b=d.innerHeight-Math.max(0,f.top),h=f.top+d.scrollY}o.current={offsetTop:h,visibleHeight:b,visibleWidth:m},n(o.current)},[n,e]),{callbackRef:r,ref:s}=Ei(i,!0,t),a=A.useCallback(()=>{i(s.current)},[i,s]);return A.useEffect(()=>{var c;if(e){e.addEventListener("scroll",a);const f=new ResizeObserver(()=>{requestAnimationFrame(a)});return f.observe(e),()=>{e.removeEventListener("scroll",a),f.unobserve(e)}}else{const f=(c=s.current)==null?void 0:c.ownerDocument.defaultView;return f==null||f.addEventListener("scroll",a),f==null||f.addEventListener("resize",a),()=>{f==null||f.removeEventListener("scroll",a),f==null||f.removeEventListener("resize",a)}}},[a,e,s]),r}const je=le(()=>{const n=ie(),e=ie(),t=I(0),o=ie(),i=I(0),r=ie(),s=ie(),a=I(0),c=I(0),f=I(0),m=I(0),h=ie(),b=ie(),d=I(!1),l=I(!1),g=I(!1);return H(D(n,U(({scrollTop:u})=>u)),e),H(D(n,U(({scrollHeight:u})=>u)),s),H(e,i),{deviation:t,fixedFooterHeight:f,fixedHeaderHeight:c,footerHeight:m,headerHeight:a,horizontalDirection:l,scrollBy:b,scrollContainerState:n,scrollHeight:s,scrollingInProgress:d,scrollTo:h,scrollTop:e,skipAnimationFrameInResizeObserver:g,smoothScrollTargetReached:o,statefulScrollTop:i,viewportHeight:r}},[],{singleton:!0}),Fn={lvl:0};function fs(n,e){const t=n.length;if(t===0)return[];let{index:o,value:i}=e(n[0]);const r=[];for(let s=1;s<t;s++){const{index:a,value:c}=e(n[s]);r.push({end:a-1,start:o,value:i}),o=a,i=c}return r.push({end:1/0,start:o,value:i}),r}function ge(n){return n===Fn}function Un(n,e){if(!ge(n))return e===n.k?n.v:e<n.k?Un(n.l,e):Un(n.r,e)}function ut(n,e,t="k"){if(ge(n))return[-1/0,void 0];if(Number(n[t])===e)return[n.k,n.v];if(Number(n[t])<e){const o=ut(n.r,e,t);return o[0]===-1/0?[n.k,n.v]:o}return ut(n.l,e,t)}function Qe(n,e,t){return ge(n)?ms(e,t,1):e===n.k?Ne(n,{k:e,v:t}):e<n.k?_s(Ne(n,{l:Qe(n.l,e,t)})):_s(Ne(n,{r:Qe(n.r,e,t)}))}function fn(){return Fn}function gn(n,e,t){if(ge(n))return[];const o=ut(n,e)[0];return hc(wi(n,o,t))}function Si(n,e){if(ge(n))return Fn;const{k:t,l:o,r:i}=n;if(e===t){if(ge(o))return i;if(ge(i))return o;{const[r,s]=ps(o);return wo(Ne(n,{k:r,l:gs(o),v:s}))}}else return e<t?wo(Ne(n,{l:Si(o,e)})):wo(Ne(n,{r:Si(i,e)}))}function tn(n){return ge(n)?[]:[...tn(n.l),{k:n.k,v:n.v},...tn(n.r)]}function wi(n,e,t){if(ge(n))return[];const{k:o,l:i,r,v:s}=n;let a=[];return o>e&&(a=a.concat(wi(i,e,t))),o>=e&&o<=t&&a.push({k:o,v:s}),o<=t&&(a=a.concat(wi(r,e,t))),a}function wo(n){const{l:e,lvl:t,r:o}=n;if(o.lvl>=t-1&&e.lvl>=t-1)return n;if(t>o.lvl+1){if(Ri(e))return bs(Ne(n,{lvl:t-1}));if(!ge(e)&&!ge(e.r))return Ne(e.r,{l:Ne(e,{r:e.r.l}),lvl:t,r:Ne(n,{l:e.r.r,lvl:t-1})});throw new Error("Unexpected empty nodes")}else{if(Ri(n))return Ai(Ne(n,{lvl:t-1}));if(!ge(o)&&!ge(o.l)){const i=o.l,r=Ri(i)?o.lvl-1:o.lvl;return Ne(i,{l:Ne(n,{lvl:t-1,r:i.l}),lvl:i.lvl+1,r:Ai(Ne(o,{l:i.r,lvl:r}))})}else throw new Error("Unexpected empty nodes")}}function Ne(n,e){return ms(e.k!==void 0?e.k:n.k,e.v!==void 0?e.v:n.v,e.lvl!==void 0?e.lvl:n.lvl,e.l!==void 0?e.l:n.l,e.r!==void 0?e.r:n.r)}function gs(n){return ge(n.r)?n.l:wo(Ne(n,{r:gs(n.r)}))}function Ri(n){return ge(n)||n.lvl>n.r.lvl}function ps(n){return ge(n.r)?[n.k,n.v]:ps(n.r)}function ms(n,e,t,o=Fn,i=Fn){return{k:n,l:o,lvl:t,r:i,v:e}}function _s(n){return Ai(bs(n))}function bs(n){const{l:e}=n;return!ge(e)&&e.lvl===n.lvl?Ne(e,{r:Ne(n,{l:e.r})}):n}function Ai(n){const{lvl:e,r:t}=n;return!ge(t)&&!ge(t.r)&&t.lvl===e&&t.r.lvl===e?Ne(t,{l:Ne(n,{r:t.l}),lvl:e+1}):n}function hc(n){return fs(n,({k:e,v:t})=>({index:e,value:t}))}function Ts(n,e){return!!(n&&n.startIndex===e.startIndex&&n.endIndex===e.endIndex)}function Pn(n,e){return!!(n&&n[0]===e[0]&&n[1]===e[1])}const Oi=le(()=>({recalcInProgress:I(!1)}),[],{singleton:!0});function vs(n,e,t){return n[Ro(n,e,t)]}function Ro(n,e,t,o=0){let i=n.length-1;for(;o<=i;){const r=Math.floor((o+i)/2),s=n[r],a=t(s,e);if(a===0)return r;if(a===-1){if(i-o<2)return r-1;i=r-1}else{if(i===o)return r;o=r+1}}throw new Error(`Failed binary finding record in array - ${n.join(",")}, searched for ${e}`)}function fc(n,e,t,o){const i=Ro(n,e,o),r=Ro(n,t,o,i);return n.slice(i,r+1)}function Ht(n,e){return Math.round(n.getBoundingClientRect()[e])}function Ao(n){return!ge(n.groupOffsetTree)}function Ni({index:n},e){return e===n?0:e<n?-1:1}function gc(){return{groupIndices:[],groupOffsetTree:fn(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:fn()}}function pc(n,e){let t=ge(n)?0:1/0;for(const o of e){const{endIndex:i,size:r,startIndex:s}=o;if(t=Math.min(t,s),ge(n)){n=Qe(n,0,r);continue}const a=gn(n,s-1,i+1);if(a.some(xc(o)))continue;let c=!1,f=!1;for(const{end:m,start:h,value:b}of a)c?(i>=h||r===b)&&(n=Si(n,h)):(f=b!==r,c=!0),m>i&&i>=h&&b!==r&&(n=Qe(n,i+1,b));f&&(n=Qe(n,s,r))}return[n,t]}function mc(n){return typeof n.groupIndex<"u"}function _c({offset:n},e){return e===n?0:e<n?-1:1}function jn(n,e,t){if(e.length===0)return 0;const{index:o,offset:i,size:r}=vs(e,n,Ni),s=n-o,a=r*s+(s-1)*t+i;return a>0?a+t:a}function ys(n,e){if(!Ao(e))return n;let t=0;for(;e.groupIndices[t]<=n+t;)t++;return n+t}function xs(n,e,t){if(mc(n))return e.groupIndices[n.groupIndex]+1;{const o=n.index==="LAST"?t:n.index;let i=ys(o,e);return i=Math.max(0,i,Math.min(t,i)),i}}function bc(n,e,t,o=0){return o>0&&(e=Math.max(e,vs(n,o,Ni).offset)),fs(fc(n,e,t,_c),yc)}function Tc(n,[e,t,o,i]){e.length>0&&o("received item sizes",e,Ve.DEBUG);const r=n.sizeTree;let s=r,a=0;if(t.length>0&&ge(r)&&e.length===2){const b=e[0].size,d=e[1].size;s=t.reduce((l,g)=>Qe(Qe(l,g,b),g+1,d),s)}else[s,a]=pc(s,e);if(s===r)return n;const{lastIndex:c,lastOffset:f,lastSize:m,offsetTree:h}=Ci(n.offsetTree,a,s,i);return{groupIndices:t,groupOffsetTree:t.reduce((b,d)=>Qe(b,d,jn(d,h,i)),fn()),lastIndex:c,lastOffset:f,lastSize:m,offsetTree:h,sizeTree:s}}function vc(n){return tn(n).map(({k:e,v:t},o,i)=>{const r=i[o+1];return{endIndex:r?r.k-1:1/0,size:t,startIndex:e}})}function Es(n,e){let t=0,o=0;for(;t<n;)t+=e[o+1]-e[o]-1,o++;return o-(t===n?0:1)}function Ci(n,e,t,o){let i=n,r=0,s=0,a=0,c=0;if(e!==0){c=Ro(i,e-1,Ni),a=i[c].offset;const f=ut(t,e-1);r=f[0],s=f[1],i.length&&i[c].size===ut(t,e)[1]&&(c-=1),i=i.slice(0,c+1)}else i=[];for(const{start:f,value:m}of gn(t,e,1/0)){const h=f-r,b=h*s+a+h*o;i.push({index:f,offset:b,size:m}),r=f,a=b,s=m}return{lastIndex:r,lastOffset:a,lastSize:s,offsetTree:i}}function yc(n){return{index:n.index,value:n}}function xc(n){const{endIndex:e,size:t,startIndex:o}=n;return i=>i.start===o&&(i.end===e||i.end===1/0)&&i.value===t}const Ec={offsetHeight:"height",offsetWidth:"width"},pt=le(([{log:n},{recalcInProgress:e}])=>{const t=ie(),o=ie(),i=ze(o,0),r=ie(),s=ie(),a=I(0),c=I([]),f=I(void 0),m=I(void 0),h=I(void 0),b=I(void 0),d=I((T,w)=>Ht(T,Ec[w])),l=I(void 0),g=I(0),u=gc(),p=ze(D(t,ee(c,n,g),gt(Tc,u),xe()),u),_=ze(D(c,xe(),gt((T,w)=>({current:w,prev:T.current}),{current:[],prev:[]}),U(({prev:T})=>T)),[]);H(D(c,X(T=>T.length>0),ee(p,g),U(([T,w,C])=>{const O=T.reduce((L,R,F)=>Qe(L,R,jn(R,w.offsetTree,C)||F),fn());return{...w,groupIndices:T,groupOffsetTree:O}})),p),H(D(o,ee(p),X(([T,{lastIndex:w}])=>T<w),U(([T,{lastIndex:w,lastSize:C}])=>[{endIndex:w,size:C,startIndex:T}])),t),H(f,m);const y=ze(D(f,U(T=>T===void 0)),!0);H(D(m,X(T=>T!==void 0&&ge(Ee(p).sizeTree)),U(T=>{const w=Ee(h),C=Ee(c).length>0;return w?C?[{endIndex:0,size:w,startIndex:0},{endIndex:1,size:T,startIndex:1}]:[]:[{endIndex:0,size:T,startIndex:0}]})),t),H(D(b,X(T=>T!==void 0&&T.length>0&&ge(Ee(p).sizeTree)),U(T=>{const w=[];let C=T[0],O=0;for(let L=1;L<T.length;L++){const R=T[L];R!==C&&(w.push({endIndex:L-1,size:C,startIndex:O}),C=R,O=L)}return w.push({endIndex:T.length-1,size:C,startIndex:O}),w})),t),H(D(c,ee(h,m),X(([,T,w])=>T!==void 0&&w!==void 0),U(([T,w,C])=>{const O=[];for(let L=0;L<T.length;L++){const R=T[L],F=T[L+1];O.push({startIndex:R,endIndex:R,size:w}),F!==void 0&&O.push({startIndex:R+1,endIndex:F-1,size:C})}return O})),t);const S=Ke(D(t,ee(p),gt(({sizes:T},[w,C])=>({changed:C!==T,sizes:C}),{changed:!1,sizes:u}),U(T=>T.changed)));ue(D(a,gt((T,w)=>({diff:T.prev-w,prev:w}),{diff:0,prev:0}),U(T=>T.diff)),T=>{const{groupIndices:w}=Ee(p);if(T>0)Q(e,!0),Q(r,T+Es(T,w));else if(T<0){const C=Ee(_);C.length>0&&(T-=Es(-T,C)),Q(s,T)}}),ue(D(a,ee(n)),([T,w])=>{T<0&&w("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:a},Ve.ERROR)});const x=Ke(r);H(D(r,ee(p),U(([T,w])=>{const C=w.groupIndices.length>0,O=[],L=w.lastSize;if(C){const R=Un(w.sizeTree,0);let F=0,k=0;for(;F<T;){const Y=w.groupIndices[k],j=w.groupIndices.length===k+1?1/0:w.groupIndices[k+1]-Y-1;O.push({endIndex:Y,size:R,startIndex:Y}),O.push({endIndex:Y+1+j-1,size:L,startIndex:Y+1}),k++,F+=j+1}const B=tn(w.sizeTree);return F!==T&&B.shift(),B.reduce((Y,{k:j,v:z})=>{let V=Y.ranges;return Y.prevSize!==0&&(V=[...Y.ranges,{endIndex:j+T-1,size:Y.prevSize,startIndex:Y.prevIndex}]),{prevIndex:j+T,prevSize:z,ranges:V}},{prevIndex:T,prevSize:0,ranges:O}).ranges}return tn(w.sizeTree).reduce((R,{k:F,v:k})=>({prevIndex:F+T,prevSize:k,ranges:[...R.ranges,{endIndex:F+T-1,size:R.prevSize,startIndex:R.prevIndex}]}),{prevIndex:0,prevSize:L,ranges:[]}).ranges})),t);const E=Ke(D(s,ee(p,g),U(([T,{offsetTree:w},C])=>{const O=-T;return jn(O,w,C)})));return H(D(s,ee(p,g),U(([T,w,C])=>{if(w.groupIndices.length>0){if(ge(w.sizeTree))return w;let O=fn();const L=Ee(_);let R=0,F=0,k=0;for(;R<-T;){k=L[F];const B=L[F+1]-k-1;F++,R+=B+1}if(O=tn(w.sizeTree).reduce((B,{k:Y,v:j})=>Qe(B,Math.max(0,Y+T),j),O),R!==-T){const B=Un(w.sizeTree,k);O=Qe(O,0,B);const Y=ut(w.sizeTree,-T+1)[1];O=Qe(O,1,Y)}return{...w,sizeTree:O,...Ci(w.offsetTree,0,O,C)}}else{const O=tn(w.sizeTree).reduce((L,{k:R,v:F})=>Qe(L,Math.max(0,R+T),F),fn());return{...w,sizeTree:O,...Ci(w.offsetTree,0,O,C)}}})),p),{beforeUnshiftWith:x,data:l,defaultItemSize:m,firstItemIndex:a,fixedItemSize:f,fixedGroupSize:h,gap:g,groupIndices:c,heightEstimates:b,itemSize:d,listRefresh:S,shiftWith:s,shiftWithOffset:E,sizeRanges:t,sizes:p,statefulTotalCount:i,totalCount:o,trackItemSizes:y,unshiftWith:r}},ye(jt,Oi),{singleton:!0});function Sc(n){return n.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}const Ss=le(([{groupIndices:n,sizes:e,totalCount:t},{headerHeight:o,scrollTop:i}])=>{const r=ie(),s=ie(),a=Ke(D(r,U(Sc)));return H(D(a,U(c=>c.totalCount)),t),H(D(a,U(c=>c.groupIndices)),n),H(D(Re(i,e,o),X(([c,f])=>Ao(f)),U(([c,f,m])=>ut(f.groupOffsetTree,Math.max(c-m,0),"v")[0]),xe(),U(c=>[c])),s),{groupCounts:r,topItemsIndexes:s}},ye(pt,je)),Wt=le(([{log:n}])=>{const e=I(!1),t=Ke(D(e,X(o=>o),xe()));return ue(e,o=>{o&&Ee(n)("props updated",{},Ve.DEBUG)}),{didMount:t,propsReady:e}},ye(jt),{singleton:!0}),wc=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function ws(n){const e=typeof n=="number"?{index:n}:n;return e.align||(e.align="start"),(!e.behavior||!wc)&&(e.behavior="auto"),e.offset||(e.offset=0),e}const Hn=le(([{gap:n,listRefresh:e,sizes:t,totalCount:o},{fixedFooterHeight:i,fixedHeaderHeight:r,footerHeight:s,headerHeight:a,scrollingInProgress:c,scrollTo:f,smoothScrollTargetReached:m,viewportHeight:h},{log:b}])=>{const d=ie(),l=ie(),g=I(0);let u=null,p=null,_=null;function y(){u&&(u(),u=null),_&&(_(),_=null),p&&(clearTimeout(p),p=null),Q(c,!1)}return H(D(d,ee(t,h,o,g,a,s,b),ee(n,r,i),U(([[S,x,E,T,w,C,O,L],R,F,k])=>{const B=ws(S),{align:Y,behavior:j,offset:z}=B,V=T-1,ae=xs(B,x,V);let N=jn(ae,x.offsetTree,R)+C;Y==="end"?(N+=F+ut(x.sizeTree,ae)[1]-E+k,ae===V&&(N+=O)):Y==="center"?N+=(F+ut(x.sizeTree,ae)[1]-E+k)/2:N-=w,z&&(N+=z);const W=oe=>{y(),oe?(L("retrying to scroll to",{location:S},Ve.DEBUG),Q(d,S)):(Q(l,!0),L("list did not change, scroll successful",{},Ve.DEBUG))};if(y(),j==="smooth"){let oe=!1;_=ue(e,he=>{oe=oe||he}),u=ct(m,()=>{W(oe)})}else u=ct(D(e,Rc(150)),W);return p=setTimeout(()=>{y()},1200),Q(c,!0),L("scrolling from index to",{behavior:j,index:ae,top:N},Ve.DEBUG),{behavior:j,top:N}})),f),{scrollTargetReached:l,scrollToIndex:d,topListHeight:g}},ye(pt,je,jt),{singleton:!0});function Rc(n){return e=>{const t=setTimeout(()=>{e(!1)},n);return o=>{o&&(e(!0),clearTimeout(t))}}}function Li(n,e){n==0?e():requestAnimationFrame(()=>{Li(n-1,e)})}function Di(n,e){const t=e-1;return typeof n=="number"?n:n.index==="LAST"?t:n.index}const Wn=le(([{defaultItemSize:n,listRefresh:e,sizes:t},{scrollTop:o},{scrollTargetReached:i,scrollToIndex:r},{didMount:s}])=>{const a=I(!0),c=I(0),f=I(!0);return H(D(s,ee(c),X(([m,h])=>!!h),ft(!1)),a),H(D(s,ee(c),X(([m,h])=>!!h),ft(!1)),f),ue(D(Re(e,s),ee(a,t,n,f),X(([[,m],h,{sizeTree:b},d,l])=>m&&(!ge(b)||vi(d))&&!h&&!l),ee(c)),([,m])=>{ct(i,()=>{Q(f,!0)}),Li(4,()=>{ct(o,()=>{Q(a,!0)}),Q(r,m)})}),{initialItemFinalLocationReached:f,initialTopMostItemIndex:c,scrolledToInitialItem:a}},ye(pt,je,Hn,Wt),{singleton:!0});function Rs(n,e){return Math.abs(n-e)<1.01}const Yn="up",Xn="down",Ac="none",Oc={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},Nc=0,Gn=le(([{footerHeight:n,headerHeight:e,scrollBy:t,scrollContainerState:o,scrollTop:i,viewportHeight:r}])=>{const s=I(!1),a=I(!0),c=ie(),f=ie(),m=I(4),h=I(Nc),b=ze(D(xi(D(G(i),Qt(1),ft(!0)),D(G(i),Qt(1),ft(!1),ds(100))),xe()),!1),d=ze(D(xi(D(t,ft(!0)),D(t,ft(!1),ds(200))),xe()),!1);H(D(Re(G(i),G(h)),U(([_,y])=>_<=y),xe()),a),H(D(a,St(50)),f);const l=Ke(D(Re(o,G(r),G(e),G(n),G(m)),gt((_,[{scrollHeight:y,scrollTop:S},x,E,T,w])=>{const C=S+x-y>-w,O={scrollHeight:y,scrollTop:S,viewportHeight:x};if(C){let R,F;return S>_.state.scrollTop?(R="SCROLLED_DOWN",F=_.state.scrollTop-S):(R="SIZE_DECREASED",F=_.state.scrollTop-S||_.scrollTopDelta),{atBottom:!0,atBottomBecause:R,scrollTopDelta:F,state:O}}let L;return O.scrollHeight>_.state.scrollHeight?L="SIZE_INCREASED":x<_.state.viewportHeight?L="VIEWPORT_HEIGHT_DECREASING":S<_.state.scrollTop?L="SCROLLING_UPWARDS":L="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:L,state:O}},Oc),xe((_,y)=>_&&_.atBottom===y.atBottom))),g=ze(D(o,gt((_,{scrollHeight:y,scrollTop:S,viewportHeight:x})=>{if(Rs(_.scrollHeight,y))return{changed:!1,jump:0,scrollHeight:y,scrollTop:S};{const E=y-(S+x)<1;return _.scrollTop!==S&&E?{changed:!0,jump:_.scrollTop-S,scrollHeight:y,scrollTop:S}:{changed:!0,jump:0,scrollHeight:y,scrollTop:S}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),X(_=>_.changed),U(_=>_.jump)),0);H(D(l,U(_=>_.atBottom)),s),H(D(s,St(50)),c);const u=I(Xn);H(D(o,U(({scrollTop:_})=>_),xe(),gt((_,y)=>Ee(d)?{direction:_.direction,prevScrollTop:y}:{direction:y<_.prevScrollTop?Yn:Xn,prevScrollTop:y},{direction:Xn,prevScrollTop:0}),U(_=>_.direction)),u),H(D(o,St(50),ft(Ac)),u);const p=I(0);return H(D(b,X(_=>!_),ft(0)),p),H(D(i,St(100),ee(b),X(([_,y])=>y),gt(([_,y],[S])=>[y,S],[0,0]),U(([_,y])=>y-_)),p),{atBottomState:l,atBottomStateChange:c,atBottomThreshold:m,atTopStateChange:f,atTopThreshold:h,isAtBottom:s,isAtTop:a,isScrolling:b,lastJumpDueToItemResize:g,scrollDirection:u,scrollVelocity:p}},ye(je)),Vn="top",$n="bottom",As="none";function Os(n,e,t){return typeof n=="number"?t===Yn&&e===Vn||t===Xn&&e===$n?n:0:t===Yn?e===Vn?n.main:n.reverse:e===$n?n.main:n.reverse}function Ns(n,e){var t;return typeof n=="number"?n:(t=n[e])!=null?t:0}const Ii=le(([{deviation:n,fixedHeaderHeight:e,headerHeight:t,scrollTop:o,viewportHeight:i}])=>{const r=ie(),s=I(0),a=I(0),c=I(0),f=ze(D(Re(G(o),G(i),G(t),G(r,Pn),G(c),G(s),G(e),G(n),G(a)),U(([m,h,b,[d,l],g,u,p,_,y])=>{const S=m-_,x=u+p,E=Math.max(b-S,0);let T=As;const w=Ns(y,Vn),C=Ns(y,$n);return d-=_,d+=b+p,l+=b+p,l-=_,d>m+x-w&&(T=Yn),l<m-E+h+C&&(T=Xn),T!==As?[Math.max(S-b-Os(g,Vn,T)-w,0),S-E-p+h+Os(g,$n,T)+C]:null}),X(m=>m!=null),xe(Pn)),[0,0]);return{increaseViewportBy:a,listBoundary:r,overscan:c,topListHeight:s,visibleRange:f}},ye(je),{singleton:!0});function Cc(n,e,t){if(Ao(e)){const o=ys(n,e);return[{index:ut(e.groupOffsetTree,o)[0],offset:0,size:0},{data:t==null?void 0:t[0],index:o,offset:0,size:0}]}return[{data:t==null?void 0:t[0],index:n,offset:0,size:0}]}const Bi={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Oo(n,e,t,o,i,r){const{lastIndex:s,lastOffset:a,lastSize:c}=i;let f=0,m=0;if(n.length>0){f=n[0].offset;const g=n[n.length-1];m=g.offset+g.size}const h=t-s,b=a+h*c+(h-1)*o,d=f,l=b-m;return{bottom:m,firstItemIndex:r,items:Ls(n,i,r),offsetBottom:l,offsetTop:f,top:d,topItems:Ls(e,i,r),topListHeight:e.reduce((g,u)=>u.size+g,0),totalCount:t}}function Cs(n,e,t,o,i,r){let s=0;if(t.groupIndices.length>0)for(const m of t.groupIndices){if(m-s>=n)break;s++}const a=n+s,c=Di(e,a),f=Array.from({length:a}).map((m,h)=>({data:r[h+c],index:h+c,offset:0,size:0}));return Oo(f,[],a,i,t,o)}function Ls(n,e,t){if(n.length===0)return[];if(!Ao(e))return n.map(f=>({...f,index:f.index+t,originalIndex:f.index}));const o=n[0].index,i=n[n.length-1].index,r=[],s=gn(e.groupOffsetTree,o,i);let a,c=0;for(const f of n){(!a||a.end<f.index)&&(a=s.shift(),c=e.groupIndices.indexOf(a.start));let m;f.index===a.start?m={index:c,type:"group"}:m={groupIndex:c,index:f.index-(c+1)+t},r.push({...m,data:f.data,offset:f.offset,originalIndex:f.index,size:f.size})}return r}function Ds(n,e){var t;return n===void 0?0:typeof n=="number"?n:(t=n[e])!=null?t:0}const nn=le(([{data:n,firstItemIndex:e,gap:t,sizes:o,totalCount:i},r,{listBoundary:s,topListHeight:a,visibleRange:c},{initialTopMostItemIndex:f,scrolledToInitialItem:m},{topListHeight:h},b,{didMount:d},{recalcInProgress:l}])=>{const g=I([]),u=I(0),p=ie(),_=I(0);H(r.topItemsIndexes,g);const y=ze(D(Re(d,l,G(c,Pn),G(i),G(o),G(f),m,G(g),G(e),G(t),G(_),n),X(([T,w,,C,,,,,,,,O])=>{const L=O&&O.length!==C;return T&&!w&&!L}),U(([,,[T,w],C,O,L,R,F,k,B,Y,j])=>{var z,V,ae,N;const W=O,{offsetTree:oe,sizeTree:he}=W,$e=Ee(u);if(C===0)return{...Bi,totalCount:C};if(T===0&&w===0)return $e===0?{...Bi,totalCount:C}:Cs($e,L,O,k,B,j||[]);if(ge(he))return $e>0?null:Oo(Cc(Di(L,C),W,j),[],C,B,W,k);const Je=[];if(F.length>0){const Z=F[0],de=F[F.length-1];let Ae=0;for(const Oe of gn(he,Z,de)){const pe=Oe.value,Te=Math.max(Oe.start,Z),it=Math.min(Oe.end,de);for(let Be=Te;Be<=it;Be++)Je.push({data:j==null?void 0:j[Be],index:Be,offset:Ae,size:pe}),Ae+=pe}}if(!R)return Oo([],Je,C,B,W,k);const re=F.length>0?F[F.length-1]+1:0,M=bc(oe,T,w,re);if(M.length===0)return null;const te=C-1,fe=So([],Z=>{for(const de of M){const Ae=de.value;let Oe=Ae.offset,pe=de.start;const Te=Ae.size;if(Ae.offset<T){pe+=Math.floor((T-Ae.offset+B)/(Te+B));const Be=pe-de.start;Oe+=Be*Te+Be*B}pe<re&&(Oe+=(re-pe)*Te,pe=re);const it=Math.min(de.end,te);for(let Be=pe;Be<=it&&!(Oe>=w);Be++)Z.push({data:j==null?void 0:j[Be],index:Be,offset:Oe,size:Te}),Oe+=Te+B}}),we=Ds(Y,Vn),P=Ds(Y,$n);if(fe.length>0&&(we>0||P>0)){const Z=fe[0],de=fe[fe.length-1];if(we>0&&Z.index>re){const Ae=Math.min(we,Z.index-re),Oe=[];let pe=Z.offset;for(let Te=Z.index-1;Te>=Z.index-Ae;Te--){const it=(V=(z=gn(he,Te,Te)[0])==null?void 0:z.value)!=null?V:Z.size;pe-=it+B,Oe.unshift({data:j==null?void 0:j[Te],index:Te,offset:pe,size:it})}fe.unshift(...Oe)}if(P>0&&de.index<te){const Ae=Math.min(P,te-de.index);let Oe=de.offset+de.size+B;for(let pe=de.index+1;pe<=de.index+Ae;pe++){const Te=(N=(ae=gn(he,pe,pe)[0])==null?void 0:ae.value)!=null?N:de.size;fe.push({data:j==null?void 0:j[pe],index:pe,offset:Oe,size:Te}),Oe+=Te+B}}}return Oo(fe,Je,C,B,W,k)}),X(T=>T!==null),xe()),Bi);H(D(n,X(vi),U(T=>T==null?void 0:T.length)),i),H(D(y,U(T=>T.topListHeight)),h),H(h,a),H(D(y,U(T=>[T.top,T.bottom])),s),H(D(y,U(T=>T.items)),p);const S=Ke(D(y,X(({items:T})=>T.length>0),ee(i,n),X(([{items:T},w])=>T[T.length-1].originalIndex===w-1),U(([,T,w])=>[T-1,w]),xe(Pn),U(([T])=>T))),x=Ke(D(y,St(200),X(({items:T,topItems:w})=>T.length>0&&T[0].originalIndex===w.length),U(({items:T})=>T[0].index),xe())),E=Ke(D(y,X(({items:T})=>T.length>0),U(({items:T})=>{let w=0,C=T.length-1;for(;T[w].type==="group"&&w<C;)w++;for(;T[C].type==="group"&&C>w;)C--;return{endIndex:T[C].index,startIndex:T[w].index}}),xe(Ts)));return{endReached:S,initialItemCount:u,itemsRendered:p,listState:y,minOverscanItemCount:_,rangeChanged:E,startReached:x,topItemsIndexes:g,...b}},ye(pt,Ss,Ii,Wn,Hn,Gn,Wt,Oi),{singleton:!0}),Is=le(([{fixedFooterHeight:n,fixedHeaderHeight:e,footerHeight:t,headerHeight:o},{listState:i}])=>{const r=ie(),s=ze(D(Re(t,n,o,e,i),U(([a,c,f,m,h])=>a+c+f+m+h.offsetBottom+h.bottom)),0);return H(G(s),r),{totalListHeight:s,totalListHeightChanged:r}},ye(je,nn),{singleton:!0}),Lc=le(([{viewportHeight:n},{totalListHeight:e}])=>{const t=I(!1),o=ze(D(Re(t,n,e),X(([i])=>i),U(([,i,r])=>Math.max(0,i-r)),St(0),xe()),0);return{alignToBottom:t,paddingTopAddition:o}},ye(je,Is),{singleton:!0}),Bs=le(()=>({context:I(null)})),Dc=({itemBottom:n,itemTop:e,locationParams:{align:t,behavior:o,...i},viewportBottom:r,viewportTop:s})=>e<s?{...i,align:t??"start",behavior:o}:n>r?{...i,align:t??"end",behavior:o}:null,Ms=le(([{gap:n,sizes:e,totalCount:t},{fixedFooterHeight:o,fixedHeaderHeight:i,headerHeight:r,scrollingInProgress:s,scrollTop:a,viewportHeight:c},{scrollToIndex:f}])=>{const m=ie();return H(D(m,ee(e,c,t,r,i,o,a),ee(n),U(([[h,b,d,l,g,u,p,_],y])=>{const{align:S,behavior:x,calculateViewLocation:E=Dc,done:T,...w}=h,C=xs(h,b,l-1),O=jn(C,b.offsetTree,y)+g+u,L=O+ut(b.sizeTree,C)[1],R=_+u,F=_+d-p,k=E({itemBottom:L,itemTop:O,locationParams:{align:S,behavior:x,...w},viewportBottom:F,viewportTop:R});return k?T&&ct(D(s,X(B=>!B),Qt(Ee(s)?1:2)),T):T==null||T(),k}),X(h=>h!==null)),f),{scrollIntoView:m}},ye(pt,je,Hn,nn,jt),{singleton:!0});function ks(n){return n?n==="smooth"?"smooth":"auto":!1}const Ic=(n,e)=>typeof n=="function"?ks(n(e)):e&&ks(n),Bc=le(([{listRefresh:n,totalCount:e,fixedItemSize:t,data:o},{atBottomState:i,isAtBottom:r},{scrollToIndex:s},{scrolledToInitialItem:a},{didMount:c,propsReady:f},{log:m},{scrollingInProgress:h},{context:b},{scrollIntoView:d}])=>{const l=I(!1),g=ie();let u=null;function p(x){Q(s,{align:"end",behavior:x,index:"LAST"})}ue(D(Re(D(G(e),Qt(1)),c),ee(G(l),r,a,h),U(([[x,E],T,w,C,O])=>{let L=E&&C,R="auto";return L&&(R=Ic(T,w||O),L=L&&!!R),{followOutputBehavior:R,shouldFollow:L,totalCount:x}}),X(({shouldFollow:x})=>x)),({followOutputBehavior:x,totalCount:E})=>{u&&(u(),u=null),Ee(t)?requestAnimationFrame(()=>{Ee(m)("following output to ",{totalCount:E},Ve.DEBUG),p(x)}):u=ct(n,()=>{Ee(m)("following output to ",{totalCount:E},Ve.DEBUG),p(x),u=null})});function _(x){const E=ct(i,T=>{x&&!T.atBottom&&T.notAtBottomBecause==="SIZE_INCREASED"&&!u&&(Ee(m)("scrolling to bottom due to increased size",{},Ve.DEBUG),p("auto"))});setTimeout(E,100)}ue(D(Re(G(l),e,f),X(([x,,E])=>x&&E),gt(({value:x},[,E])=>({refreshed:x===E,value:E}),{refreshed:!1,value:0}),X(({refreshed:x})=>x),ee(l,e)),([,x])=>{Ee(a)&&_(x!==!1)}),ue(g,()=>{_(Ee(l)!==!1)}),ue(Re(G(l),i),([x,E])=>{x&&!E.atBottom&&E.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&p("auto")});const y=I(null),S=ie();return H(xi(D(G(o),U(x=>{var E;return(E=x==null?void 0:x.length)!=null?E:0})),D(G(e))),S),ue(D(Re(D(S,Qt(1)),c),ee(G(y),a,h,b),U(([[x,E],T,w,C,O])=>E&&w&&(T==null?void 0:T({context:O,totalCount:x,scrollingInProgress:C}))),X(x=>!!x),St(0)),x=>{u&&(u(),u=null),Ee(t)?requestAnimationFrame(()=>{Ee(m)("scrolling into view",{}),Q(d,x)}):u=ct(n,()=>{Ee(m)("scrolling into view",{}),Q(d,x),u=null})}),{autoscrollToBottom:g,followOutput:l,scrollIntoViewOnChange:y}},ye(pt,Gn,Hn,Wn,Wt,jt,je,Bs,Ms)),Mc=le(([{data:n,firstItemIndex:e,gap:t,sizes:o},{initialTopMostItemIndex:i},{initialItemCount:r,listState:s},{didMount:a}])=>(H(D(a,ee(r),X(([,c])=>c!==0),ee(i,o,e,t,n),U(([[,c],f,m,h,b,d=[]])=>Cs(c,f,m,h,b,d))),s),{}),ye(pt,Wn,nn,Wt),{singleton:!0}),kc=le(([{didMount:n},{scrollTo:e},{listState:t}])=>{const o=I(0);return ue(D(n,ee(o),X(([,i])=>i!==0),U(([,i])=>({top:i}))),i=>{ct(D(t,Qt(1),X(r=>r.items.length>1)),()=>{requestAnimationFrame(()=>{Q(e,i)})})}),{initialScrollTop:o}},ye(Wt,je,nn),{singleton:!0}),zs=le(([{scrollVelocity:n}])=>{const e=I(!1),t=ie(),o=I(!1);return H(D(n,ee(o,e,t),X(([i,r])=>!!r),U(([i,r,s,a])=>{const{enter:c,exit:f}=r;if(s){if(f(i,a))return!1}else if(c(i,a))return!0;return s}),xe()),e),ue(D(Re(e,n,t),ee(o)),([[i,r,s],a])=>{i&&a&&a.change&&a.change(r,s)}),{isSeeking:e,scrollSeekConfiguration:o,scrollSeekRangeChanged:t,scrollVelocity:n}},ye(Gn),{singleton:!0}),Mi=le(([{scrollContainerState:n,scrollTo:e}])=>{const t=ie(),o=ie(),i=ie(),r=I(!1),s=I(void 0);return H(D(Re(t,o),U(([{scrollHeight:a,scrollTop:c,viewportHeight:f},{offsetTop:m}])=>({scrollHeight:a,scrollTop:Math.max(0,c-m),viewportHeight:f}))),n),H(D(e,ee(o),U(([a,{offsetTop:c}])=>({...a,top:a.top+c}))),i),{customScrollParent:s,useWindowScroll:r,windowScrollContainerState:t,windowScrollTo:i,windowViewportRect:o}},ye(je)),zc=le(([{sizeRanges:n,sizes:e},{headerHeight:t,scrollTop:o},{initialTopMostItemIndex:i},{didMount:r},{useWindowScroll:s,windowScrollContainerState:a,windowViewportRect:c}])=>{const f=ie(),m=I(void 0),h=I(null),b=I(null);return H(a,h),H(c,b),ue(D(f,ee(e,o,s,h,b,t)),([d,l,g,u,p,_,y])=>{const S=vc(l.sizeTree);u&&p!==null&&_!==null&&(g=p.scrollTop-_.offsetTop),g-=y,d({ranges:S,scrollTop:g})}),H(D(m,X(vi),U(Fc)),i),H(D(r,ee(m),X(([,d])=>d!==void 0),xe(),U(([,d])=>d.ranges)),n),{getState:f,restoreStateFrom:m}},ye(pt,je,Wn,Wt,Mi));function Fc(n){return{align:"start",index:0,offset:n.scrollTop}}const Uc=le(([{topItemsIndexes:n}])=>{const e=I(0);return H(D(e,X(t=>t>=0),U(t=>Array.from({length:t}).map((o,i)=>i))),n),{topItemCount:e}},ye(nn));function Fs(n){let e=!1,t;return()=>(e||(e=!0,t=n()),t)}const Pc=Fs(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),jc=le(([{deviation:n,scrollBy:e,scrollingInProgress:t,scrollTop:o},{isAtBottom:i,isScrolling:r,lastJumpDueToItemResize:s,scrollDirection:a},{listState:c},{beforeUnshiftWith:f,gap:m,shiftWithOffset:h,sizes:b},{log:d},{recalcInProgress:l}])=>{const g=Ke(D(c,ee(s),gt(([,p,_,y],[{bottom:S,items:x,offsetBottom:E,totalCount:T},w])=>{const C=S+E;let O=0;return _===T&&p.length>0&&x.length>0&&(x[0].originalIndex===0&&p[0].originalIndex===0||(O=C-y,O!==0&&(O+=w))),[O,x,T,C]},[0,[],0,0]),X(([p])=>p!==0),ee(o,a,t,i,d,l),X(([,p,_,y,,,S])=>!S&&!y&&p!==0&&_===Yn),U(([[p],,,,,_])=>(_("Upward scrolling compensation",{amount:p},Ve.DEBUG),p))));function u(p){p>0?(Q(e,{behavior:"auto",top:-p}),Q(n,0)):(Q(n,0),Q(e,{behavior:"auto",top:-p}))}return ue(D(g,ee(n,r)),([p,_,y])=>{y&&Pc()?Q(n,_-p):u(-p)}),ue(D(Re(ze(r,!1),n,l),X(([p,_,y])=>!p&&!y&&_!==0),U(([p,_])=>_),St(1)),u),H(D(h,U(p=>({top:-p}))),e),ue(D(f,ee(b,m),U(([p,{groupIndices:_,lastSize:y,sizeTree:S},x])=>{function E(T){return T*(y+x)}if(_.length===0)return E(p);{let T=0;const w=Un(S,0);let C=0,O=0;for(;C<p;){C++,T+=w;let L=_.length===O+1?1/0:_[O+1]-_[O]-1;C+L>p&&(T-=w,L=p-C+1),C+=L,T+=E(L),O++}return T}})),p=>{Q(n,p),requestAnimationFrame(()=>{Q(e,{top:p}),requestAnimationFrame(()=>{Q(n,0),Q(l,!1)})})}),{deviation:n}},ye(je,Gn,nn,pt,jt,Oi)),Hc=le(([n,e,t,o,i,r,s,a,c,f,m])=>({...n,...e,...t,...o,...i,...r,...s,...a,...c,...f,...m}),ye(Ii,Mc,Wt,zs,Is,kc,Lc,Mi,Ms,jt,Bs)),Us=le(([{data:n,defaultItemSize:e,firstItemIndex:t,fixedItemSize:o,fixedGroupSize:i,gap:r,groupIndices:s,heightEstimates:a,itemSize:c,sizeRanges:f,sizes:m,statefulTotalCount:h,totalCount:b,trackItemSizes:d},{initialItemFinalLocationReached:l,initialTopMostItemIndex:g,scrolledToInitialItem:u},p,_,y,S,{scrollToIndex:x},E,{topItemCount:T},{groupCounts:w},C])=>{const{listState:O,minOverscanItemCount:L,topItemsIndexes:R,rangeChanged:F,...k}=S;return H(F,C.scrollSeekRangeChanged),H(D(C.windowViewportRect,U(B=>B.visibleHeight)),p.viewportHeight),{data:n,defaultItemHeight:e,firstItemIndex:t,fixedItemHeight:o,fixedGroupHeight:i,gap:r,groupCounts:w,heightEstimates:a,initialItemFinalLocationReached:l,initialTopMostItemIndex:g,scrolledToInitialItem:u,sizeRanges:f,topItemCount:T,topItemsIndexes:R,totalCount:b,...y,groupIndices:s,itemSize:c,listState:O,minOverscanItemCount:L,scrollToIndex:x,statefulTotalCount:h,trackItemSizes:d,rangeChanged:F,...k,...C,...p,sizes:m,..._}},ye(pt,Wn,je,zc,Bc,nn,Hn,jc,Uc,Ss,Hc));function Wc(n,e){const t={},o={};let i=0;const r=n.length;for(;i<r;)o[n[i]]=1,i+=1;for(const s in e)Object.hasOwn(o,s)||(t[s]=e[s]);return t}const No=typeof document<"u"?A.useLayoutEffect:A.useEffect;function Ps(n,e,t){const o=Object.keys(e.required||{}),i=Object.keys(e.optional||{}),r=Object.keys(e.methods||{}),s=Object.keys(e.events||{}),a=A.createContext({});function c(u,p){u.propsReady&&Q(u.propsReady,!1);for(const _ of o){const y=u[e.required[_]];Q(y,p[_])}for(const _ of i)if(_ in p){const y=u[e.optional[_]];Q(y,p[_])}u.propsReady&&Q(u.propsReady,!0)}function f(u){return r.reduce((p,_)=>(p[_]=y=>{const S=u[e.methods[_]];Q(S,y)},p),{})}function m(u){return s.reduce((p,_)=>(p[_]=rc(u[e.events[_]]),p),{})}const h=A.forwardRef((u,p)=>{const{children:_,...y}=u,[S]=A.useState(()=>So(ac(n),T=>{c(T,y)})),[x]=A.useState(ls(m,S));No(()=>{for(const T of s)T in y&&ue(x[T],y[T]);return()=>{Object.values(x).map(yi)}},[y,x,S]),No(()=>{c(S,y)}),A.useImperativeHandle(p,ss(f(S)));const E=t;return v.jsx(a.Provider,{value:S,children:t?v.jsx(E,{...Wc([...o,...i,...s],y),children:_}):_})}),b=u=>{const p=A.useContext(a);return A.useCallback(_=>{Q(p[u],_)},[p,u])},d=u=>{const p=A.useContext(a)[u],_=A.useCallback(y=>ue(p,y),[p]);return A.useSyncExternalStore(_,()=>Ee(p),()=>Ee(p))},l=u=>{const p=A.useContext(a)[u],[_,y]=A.useState(ls(Ee,p));return No(()=>ue(p,S=>{S!==_&&y(ss(S))}),[p,_]),_},g=A.version.startsWith("18")?d:l;return{Component:h,useEmitter:(u,p)=>{const _=A.useContext(a)[u];No(()=>ue(_,p),[p,_])},useEmitterValue:g,usePublisher:b}}const js=A.createContext(void 0),Hs=A.createContext(void 0),Ws=typeof document<"u"?A.useLayoutEffect:A.useEffect;function ki(n){return"self"in n}function Yc(n){return"body"in n}function Ys(n,e,t,o=hn,i,r){const s=A.useRef(null),a=A.useRef(null),c=A.useRef(null),f=A.useCallback(b=>{let d,l,g;const u=b.target;if(Yc(u)||ki(u)){const _=ki(u)?u:u.defaultView;g=r?_.scrollX:_.scrollY,d=r?_.document.documentElement.scrollWidth:_.document.documentElement.scrollHeight,l=r?_.innerWidth:_.innerHeight}else g=r?u.scrollLeft:u.scrollTop,d=r?u.scrollWidth:u.scrollHeight,l=r?u.offsetWidth:u.offsetHeight;const p=()=>{n({scrollHeight:d,scrollTop:Math.max(g,0),viewportHeight:l})};b.suppressFlushSync?p():At.flushSync(p),a.current!==null&&(g===a.current||g<=0||g===d-l)&&(a.current=null,e(!0),c.current&&(clearTimeout(c.current),c.current=null))},[n,e,r]);A.useEffect(()=>{const b=i||s.current;return o(i||s.current),f({suppressFlushSync:!0,target:b}),b.addEventListener("scroll",f,{passive:!0}),()=>{o(null),b.removeEventListener("scroll",f)}},[s,f,t,o,i]);function m(b){const d=s.current;if(!d||(r?"offsetWidth"in d&&d.offsetWidth===0:"offsetHeight"in d&&d.offsetHeight===0))return;const l=b.behavior==="smooth";let g,u,p;ki(d)?(u=Math.max(Ht(d.document.documentElement,r?"width":"height"),r?d.document.documentElement.scrollWidth:d.document.documentElement.scrollHeight),g=r?d.innerWidth:d.innerHeight,p=r?window.scrollX:window.scrollY):(u=d[r?"scrollWidth":"scrollHeight"],g=Ht(d,r?"width":"height"),p=d[r?"scrollLeft":"scrollTop"]);const _=u-g;if(b.top=Math.ceil(Math.max(Math.min(_,b.top),0)),Rs(g,u)||b.top===p){n({scrollHeight:u,scrollTop:p,viewportHeight:g}),l&&e(!0);return}l?(a.current=b.top,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,a.current=null,e(!0)},1e3)):a.current=null,r&&(b={behavior:b.behavior,left:b.top}),d.scrollTo(b)}function h(b){r&&(b={behavior:b.behavior,left:b.top}),s.current.scrollBy(b)}return{scrollByCallback:h,scrollerRef:s,scrollToCallback:m}}const zi="-webkit-sticky",Xs="sticky",Fi=Fs(()=>{if(typeof document>"u")return Xs;const n=document.createElement("div");return n.style.position=zi,n.style.position===zi?zi:Xs});function Ui(n){return n}const Xc=le(()=>{const n=I(a=>`Item ${a}`),e=I(a=>`Group ${a}`),t=I({}),o=I(Ui),i=I("div"),r=I(hn),s=(a,c=null)=>ze(D(t,U(f=>f[a]),xe()),c);return{components:t,computeItemKey:o,EmptyPlaceholder:s("EmptyPlaceholder"),FooterComponent:s("Footer"),GroupComponent:s("Group","div"),groupContent:e,HeaderComponent:s("Header"),HeaderFooterTag:i,ItemComponent:s("Item","div"),itemContent:n,ListComponent:s("List","div"),ScrollerComponent:s("Scroller","div"),scrollerRef:r,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),TopItemListComponent:s("TopItemList")}}),Gc=le(([n,e])=>({...n,...e}),ye(Us,Xc)),Vc=({height:n})=>v.jsx("div",{style:{height:n}}),$c={overflowAnchor:"none",position:Fi(),zIndex:1},Gs={overflowAnchor:"none"},Jc={...Gs,display:"inline-block",height:"100%"},Vs=A.memo(function({showTopList:n=!1}){const e=J("listState"),t=nt("sizeRanges"),o=J("useWindowScroll"),i=J("customScrollParent"),r=nt("windowScrollContainerState"),s=nt("scrollContainerState"),a=i||o?r:s,c=J("itemContent"),f=J("context"),m=J("groupContent"),h=J("trackItemSizes"),b=J("itemSize"),d=J("log"),l=nt("gap"),g=J("horizontalDirection"),{callbackRef:u}=cc(t,b,h,n?hn:a,d,l,i,g,J("skipAnimationFrameInResizeObserver")),[p,_]=A.useState(0);Pi("deviation",k=>{p!==k&&_(k)});const y=J("EmptyPlaceholder"),S=J("ScrollSeekPlaceholder")||Vc,x=J("ListComponent"),E=J("ItemComponent"),T=J("GroupComponent"),w=J("computeItemKey"),C=J("isSeeking"),O=J("groupIndices").length>0,L=J("alignToBottom"),R=J("initialItemFinalLocationReached"),F=n?{}:{boxSizing:"border-box",...g?{display:"inline-block",height:"100%",marginLeft:p!==0?p:L?"auto":0,paddingLeft:e.offsetTop,paddingRight:e.offsetBottom,whiteSpace:"nowrap"}:{marginTop:p!==0?p:L?"auto":0,paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},...R?{}:{visibility:"hidden"}};return!n&&e.totalCount===0&&y?v.jsx(y,{...Fe(y,f)}):v.jsx(x,{...Fe(x,f),"data-testid":n?"virtuoso-top-item-list":"virtuoso-item-list",ref:u,style:F,children:(n?e.topItems:e.items).map(k=>{const B=k.originalIndex,Y=w(B+e.firstItemIndex,k.data,f);return C?A.createElement(S,{...Fe(S,f),height:k.size,index:k.index,key:Y,type:k.type||"item",...k.type==="group"?{}:{groupIndex:k.groupIndex}}):k.type==="group"?A.createElement(T,{...Fe(T,f),"data-index":B,"data-item-index":k.index,"data-known-size":k.size,key:Y,style:$c},m(k.index,f)):A.createElement(E,{...Fe(E,f),...Qc(E,k.data),"data-index":B,"data-item-group-index":k.groupIndex,"data-item-index":k.index,"data-known-size":k.size,key:Y,style:g?Jc:Gs},O?c(k.index,k.groupIndex,k.data,f):c(k.index,k.data,f))})})}),Zc={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},qc={outline:"none",overflowX:"auto",position:"relative"},Co=n=>({height:"100%",position:"absolute",top:0,width:"100%",...n?{display:"flex",flexDirection:"column"}:{}}),Kc={position:Fi(),top:0,width:"100%",zIndex:1};function Fe(n,e){if(typeof n!="string")return{context:e}}function Qc(n,e){return{item:typeof n=="string"?void 0:e}}const eu=A.memo(function(){const n=J("HeaderComponent"),e=nt("headerHeight"),t=J("HeaderFooterTag"),o=en(A.useMemo(()=>r=>{e(Ht(r,"height"))},[e]),!0,J("skipAnimationFrameInResizeObserver")),i=J("context");return n?v.jsx(t,{ref:o,children:v.jsx(n,{...Fe(n,i)})}):null}),tu=A.memo(function(){const n=J("FooterComponent"),e=nt("footerHeight"),t=J("HeaderFooterTag"),o=en(A.useMemo(()=>r=>{e(Ht(r,"height"))},[e]),!0,J("skipAnimationFrameInResizeObserver")),i=J("context");return n?v.jsx(t,{ref:o,children:v.jsx(n,{...Fe(n,i)})}):null});function $s({useEmitter:n,useEmitterValue:e,usePublisher:t}){return A.memo(function({children:o,style:i,context:r,...s}){const a=t("scrollContainerState"),c=e("ScrollerComponent"),f=t("smoothScrollTargetReached"),m=e("scrollerRef"),h=e("horizontalDirection")||!1,{scrollByCallback:b,scrollerRef:d,scrollToCallback:l}=Ys(a,f,c,m,void 0,h);return n("scrollTo",l),n("scrollBy",b),v.jsx(c,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:d,style:{...h?qc:Zc,...i},tabIndex:0,...s,...Fe(c,r),children:o})})}function Js({useEmitter:n,useEmitterValue:e,usePublisher:t}){return A.memo(function({children:o,style:i,context:r,...s}){const a=t("windowScrollContainerState"),c=e("ScrollerComponent"),f=t("smoothScrollTargetReached"),m=e("totalListHeight"),h=e("deviation"),b=e("customScrollParent"),d=A.useRef(null),l=e("scrollerRef"),{scrollByCallback:g,scrollerRef:u,scrollToCallback:p}=Ys(a,f,c,l,b);return Ws(()=>{var _;return u.current=b||((_=d.current)==null?void 0:_.ownerDocument.defaultView),()=>{u.current=null}},[u,b]),n("windowScrollTo",p),n("scrollBy",g),v.jsx(c,{ref:d,"data-virtuoso-scroller":!0,style:{position:"relative",...i,...m!==0?{height:m+h}:{}},...s,...Fe(c,r),children:o})})}const nu=({children:n})=>{const e=A.useContext(js),t=nt("viewportHeight"),o=nt("fixedItemHeight"),i=J("alignToBottom"),r=J("horizontalDirection"),s=A.useMemo(()=>as(t,c=>Ht(c,r?"width":"height")),[t,r]),a=en(s,!0,J("skipAnimationFrameInResizeObserver"));return A.useEffect(()=>{e&&(t(e.viewportHeight),o(e.itemHeight))},[e,t,o]),v.jsx("div",{"data-viewport-type":"element",ref:a,style:Co(i),children:n})},ou=({children:n})=>{const e=A.useContext(js),t=nt("windowViewportRect"),o=nt("fixedItemHeight"),i=J("customScrollParent"),r=hs(t,i,J("skipAnimationFrameInResizeObserver")),s=J("alignToBottom");return A.useEffect(()=>{e&&(o(e.itemHeight),t({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,t,o]),v.jsx("div",{"data-viewport-type":"window",ref:r,style:Co(s),children:n})},iu=({children:n})=>{const e=J("TopItemListComponent")||"div",t=J("headerHeight"),o={...Kc,marginTop:`${t}px`},i=J("context");return v.jsx(e,{style:o,...Fe(e,i),children:n})},ru=A.memo(function(n){const e=J("useWindowScroll"),t=J("topItemsIndexes").length>0,o=J("customScrollParent"),i=J("context");return v.jsxs(o||e?lu:au,{...n,context:i,children:[t&&v.jsx(iu,{children:v.jsx(Vs,{showTopList:!0})}),v.jsxs(o||e?ou:nu,{children:[v.jsx(eu,{}),v.jsx(Vs,{}),v.jsx(tu,{})]})]})}),{Component:su,useEmitter:Pi,useEmitterValue:J,usePublisher:nt}=Ps(Gc,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},ru),au=$s({useEmitter:Pi,useEmitterValue:J,usePublisher:nt}),lu=Js({useEmitter:Pi,useEmitterValue:J,usePublisher:nt}),du=su;ye(Us,le(()=>{const n=I(f=>v.jsxs("td",{children:["Item $",f]})),e=I(null),t=I(f=>v.jsxs("td",{colSpan:1e3,children:["Group ",f]})),o=I(null),i=I(null),r=I({}),s=I(Ui),a=I(hn),c=(f,m=null)=>ze(D(r,U(h=>h[f]),xe()),m);return{components:r,computeItemKey:s,context:e,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:i,fixedHeaderContent:o,itemContent:n,groupContent:t,ScrollerComponent:c("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder"),TableBodyComponent:c("TableBody","tbody"),TableComponent:c("Table","table"),TableFooterComponent:c("TableFoot","tfoot"),TableHeadComponent:c("TableHead","thead"),TableRowComponent:c("TableRow","tr"),GroupComponent:c("Group","tr")}})),Fi();const Zs={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},cu={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:qs,floor:Lo,max:Jn,min:ji,round:Ks}=Math;function Qs(n,e,t){return Array.from({length:e-n+1}).map((o,i)=>({data:t===null?null:t[i+n],index:i+n}))}function uu(n){return{...cu,items:n}}function Do(n,e){return n&&n.width===e.width&&n.height===e.height}function hu(n,e){return n&&n.column===e.column&&n.row===e.row}const fu=le(([{increaseViewportBy:n,listBoundary:e,overscan:t,visibleRange:o},{footerHeight:i,headerHeight:r,scrollBy:s,scrollContainerState:a,scrollTo:c,scrollTop:f,smoothScrollTargetReached:m,viewportHeight:h},b,d,{didMount:l,propsReady:g},{customScrollParent:u,useWindowScroll:p,windowScrollContainerState:_,windowScrollTo:y,windowViewportRect:S},x])=>{const E=I(0),T=I(0),w=I(Zs),C=I({height:0,width:0}),O=I({height:0,width:0}),L=ie(),R=ie(),F=I(0),k=I(null),B=I({column:0,row:0}),Y=ie(),j=ie(),z=I(!1),V=I(0),ae=I(!0),N=I(!1),W=I(!1);ue(D(l,ee(V),X(([M,te])=>!!te)),()=>{Q(ae,!1)}),ue(D(Re(l,ae,O,C,V,N),X(([M,te,fe,we,,P])=>M&&!te&&fe.height!==0&&we.height!==0&&!P)),([,,,,M])=>{Q(N,!0),Li(1,()=>{Q(L,M)}),ct(D(f),()=>{Q(e,[0,0]),Q(ae,!0)})}),H(D(j,X(M=>M!=null&&M.scrollTop>0),ft(0)),T),ue(D(l,ee(j),X(([,M])=>M!=null)),([,M])=>{M&&(Q(C,M.viewport),Q(O,M.item),Q(B,M.gap),M.scrollTop>0&&(Q(z,!0),ct(D(f,Qt(1)),te=>{Q(z,!1)}),Q(c,{top:M.scrollTop})))}),H(D(C,U(({height:M})=>M)),h),H(D(Re(G(C,Do),G(O,Do),G(B,(M,te)=>M&&M.column===te.column&&M.row===te.row),G(f)),U(([M,te,fe,we])=>({gap:fe,item:te,scrollTop:we,viewport:M}))),Y),H(D(Re(G(E),o,G(B,hu),G(O,Do),G(C,Do),G(k),G(T),G(z),G(ae),G(V)),X(([,,,,,,,M])=>!M),U(([M,[te,fe],we,P,Z,de,Ae,,Oe,pe])=>{const{column:Te,row:it}=we,{height:Be,width:Yi}=P,{width:aa}=Z;if(Ae===0&&(M===0||aa===0))return Zs;if(Yi===0){const ha=Di(pe,M),Fu=ha+Math.max(Ae-1,0);return uu(Qs(ha,Fu,de))}const Io=ea(aa,Yi,Te);let pn,on;Oe?te===0&&fe===0&&Ae>0?(pn=0,on=Ae-1):(pn=Io*Lo((te+it)/(Be+it)),on=Io*qs((fe+it)/(Be+it))-1,on=ji(M-1,Jn(on,Io-1)),pn=ji(on,Jn(0,pn))):(pn=0,on=-1);const la=Qs(pn,on,de),{bottom:da,top:ca}=ta(Z,we,P,la),ua=qs(M/Io),zu=ua*Be+(ua-1)*it-da;return{bottom:da,itemHeight:Be,items:la,itemWidth:Yi,offsetBottom:zu,offsetTop:ca,top:ca}})),w),H(D(k,X(M=>M!==null),U(M=>M.length)),E),H(D(Re(C,O,w,B),X(([M,te,{items:fe}])=>fe.length>0&&te.height!==0&&M.height!==0),U(([M,te,{items:fe},we])=>{const{bottom:P,top:Z}=ta(M,we,te,fe);return[Z,P]}),xe(Pn)),e);const oe=I(!1);H(D(f,ee(oe),U(([M,te])=>te||M!==0)),oe);const he=Ke(D(Re(w,E),X(([{items:M}])=>M.length>0),ee(oe),X(([[M,te],fe])=>{const we=M.items[M.items.length-1].index===te-1;return(fe||M.bottom>0&&M.itemHeight>0&&M.offsetBottom===0&&M.items.length===te)&&we}),U(([[,M]])=>M-1),xe())),$e=Ke(D(G(w),X(({items:M})=>M.length>0&&M[0].index===0),ft(0),xe())),Je=Ke(D(G(w),ee(z),X(([{items:M},te])=>M.length>0&&!te),U(([{items:M}])=>({endIndex:M[M.length-1].index,startIndex:M[0].index})),xe(Ts),St(0)));H(Je,d.scrollSeekRangeChanged),H(D(L,ee(C,O,E,B),U(([M,te,fe,we,P])=>{const Z=ws(M),{align:de,behavior:Ae,offset:Oe}=Z;let pe=Z.index;pe==="LAST"&&(pe=we-1),pe=Jn(0,pe,ji(we-1,pe));let Te=Hi(te,P,fe,pe);return de==="end"?Te=Ks(Te-te.height+fe.height):de==="center"&&(Te=Ks(Te-te.height/2+fe.height/2)),Oe&&(Te+=Oe),{behavior:Ae,top:Te}})),c);const re=ze(D(w,U(M=>M.offsetBottom+M.bottom)),0);return H(D(S,U(M=>({height:M.visibleHeight,width:M.visibleWidth}))),C),{customScrollParent:u,data:k,deviation:F,footerHeight:i,gap:B,headerHeight:r,increaseViewportBy:n,initialItemCount:T,itemDimensions:O,overscan:t,restoreStateFrom:j,scrollBy:s,scrollContainerState:a,scrollHeight:R,scrollTo:c,scrollToIndex:L,scrollTop:f,smoothScrollTargetReached:m,totalCount:E,useWindowScroll:p,viewportDimensions:C,windowScrollContainerState:_,windowScrollTo:y,windowViewportRect:S,...d,gridState:w,horizontalDirection:W,initialTopMostItemIndex:V,totalListHeight:re,...b,endReached:he,propsReady:g,rangeChanged:Je,startReached:$e,stateChanged:Y,stateRestoreInProgress:z,...x}},ye(Ii,je,Gn,zs,Wt,Mi,jt));function ea(n,e,t){return Jn(1,Lo((n+t)/(Lo(e)+t)))}function ta(n,e,t,o){const{height:i}=t;if(i===void 0||o.length===0)return{bottom:0,top:0};const r=Hi(n,e,t,o[0].index);return{bottom:Hi(n,e,t,o[o.length-1].index)+i,top:r}}function Hi(n,e,t,o){const i=ea(n.width,t.width,e.column),r=Lo(o/i),s=r*t.height+Jn(0,r-1)*e.row;return s>0?s+e.row:s}const gu=le(()=>{const n=I(h=>`Item ${h}`),e=I({}),t=I(null),o=I("virtuoso-grid-item"),i=I("virtuoso-grid-list"),r=I(Ui),s=I("div"),a=I(hn),c=(h,b=null)=>ze(D(e,U(d=>d[h]),xe()),b),f=I(!1),m=I(!1);return H(G(m),f),{components:e,computeItemKey:r,context:t,FooterComponent:c("Footer"),HeaderComponent:c("Header"),headerFooterTag:s,itemClassName:o,ItemComponent:c("Item","div"),itemContent:n,listClassName:i,ListComponent:c("List","div"),readyStateChanged:f,reportReadyState:m,ScrollerComponent:c("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),pu=le(([n,e])=>({...n,...e}),ye(fu,gu)),mu=A.memo(function(){const n=Se("gridState"),e=Se("listClassName"),t=Se("itemClassName"),o=Se("itemContent"),i=Se("computeItemKey"),r=Se("isSeeking"),s=ot("scrollHeight"),a=Se("ItemComponent"),c=Se("ListComponent"),f=Se("ScrollSeekPlaceholder"),m=Se("context"),h=ot("itemDimensions"),b=ot("gap"),d=Se("log"),l=Se("stateRestoreInProgress"),g=ot("reportReadyState"),u=en(A.useMemo(()=>p=>{const _=p.parentElement.parentElement.scrollHeight;s(_);const y=p.firstChild;if(y){const{height:S,width:x}=y.getBoundingClientRect();h({height:S,width:x})}b({column:oa("column-gap",getComputedStyle(p).columnGap,d),row:oa("row-gap",getComputedStyle(p).rowGap,d)})},[s,h,b,d]),!0,!1);return Ws(()=>{n.itemHeight>0&&n.itemWidth>0&&g(!0)},[n]),l?null:v.jsx(c,{className:e,ref:u,...Fe(c,m),"data-testid":"virtuoso-item-list",style:{paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},children:n.items.map(p=>{const _=i(p.index,p.data,m);return r?v.jsx(f,{...Fe(f,m),height:n.itemHeight,index:p.index,width:n.itemWidth},_):A.createElement(a,{...Fe(a,m),className:t,"data-index":p.index,key:_},o(p.index,p.data,m))})})}),_u=A.memo(function(){const n=Se("HeaderComponent"),e=ot("headerHeight"),t=Se("headerFooterTag"),o=en(A.useMemo(()=>r=>{e(Ht(r,"height"))},[e]),!0,!1),i=Se("context");return n?v.jsx(t,{ref:o,children:v.jsx(n,{...Fe(n,i)})}):null}),bu=A.memo(function(){const n=Se("FooterComponent"),e=ot("footerHeight"),t=Se("headerFooterTag"),o=en(A.useMemo(()=>r=>{e(Ht(r,"height"))},[e]),!0,!1),i=Se("context");return n?v.jsx(t,{ref:o,children:v.jsx(n,{...Fe(n,i)})}):null}),Tu=({children:n})=>{const e=A.useContext(Hs),t=ot("itemDimensions"),o=ot("viewportDimensions"),i=en(A.useMemo(()=>r=>{o(r.getBoundingClientRect())},[o]),!0,!1);return A.useEffect(()=>{e&&(o({height:e.viewportHeight,width:e.viewportWidth}),t({height:e.itemHeight,width:e.itemWidth}))},[e,o,t]),v.jsx("div",{ref:i,style:Co(!1),children:n})},vu=({children:n})=>{const e=A.useContext(Hs),t=ot("windowViewportRect"),o=ot("itemDimensions"),i=Se("customScrollParent"),r=hs(t,i,!1);return A.useEffect(()=>{e&&(o({height:e.itemHeight,width:e.itemWidth}),t({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:e.viewportWidth}))},[e,t,o]),v.jsx("div",{ref:r,style:Co(!1),children:n})},yu=A.memo(function({...n}){const e=Se("useWindowScroll"),t=Se("customScrollParent"),o=t||e?Eu:xu,i=t||e?vu:Tu,r=Se("context");return v.jsx(o,{...n,...Fe(o,r),children:v.jsxs(i,{children:[v.jsx(_u,{}),v.jsx(mu,{}),v.jsx(bu,{})]})})}),{useEmitter:na,useEmitterValue:Se,usePublisher:ot}=Ps(pu,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},yu),xu=$s({useEmitter:na,useEmitterValue:Se,usePublisher:ot}),Eu=Js({useEmitter:na,useEmitterValue:Se,usePublisher:ot});function oa(n,e,t){return e!=="normal"&&!(e!=null&&e.endsWith("px"))&&t(`${n} was not resolved to pixel value correctly`,e,Ve.WARN),e==="normal"?0:parseInt(e??"0",10)}const Su=({x:n,y:e,items:t,onClose:o})=>{const i=A.useRef(null);return A.useEffect(()=>{const r=s=>{i.current&&!i.current.contains(s.target)&&o()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[o]),v.jsx("div",{ref:i,className:"fixed z-[1000] min-w-[160px] bg-popover text-popover-foreground border shadow-md rounded-md py-1 animate-in fade-in zoom-in-95 duration-100",style:{top:e,left:n},children:t.map((r,s)=>v.jsxs(A.Fragment,{children:[r.divider&&v.jsx("div",{className:"h-[1px] bg-border my-1"}),v.jsxs("div",{className:"px-3 py-1.5 hover:bg-accent hover:text-accent-foreground cursor-pointer text-xs flex items-center",onClick:()=>{r.onClick(),o()},children:[r.icon&&v.jsx("span",{className:"mr-2 opacity-70",children:r.icon}),v.jsx("span",{children:r.label})]})]},s))})};function wu(...n){return Kt(qt(n))}const ia=({data:n,onMoveNode:e,onNewFile:t,onNewFolder:o,onRename:i,onDelete:r})=>{const[s,a]=A.useState(b(n)),[c,f]=A.useState(null),[m,h]=A.useState(null);A.useEffect(()=>{a(b(n))},[n]);function b(S,x=0){return S.reduce((E,T)=>{const w={...T,level:x};return E.push(w),w.isOpen&&w.children&&E.push(...b(w.children,x+1)),E},[])}const d=S=>{const x=E=>E.map(T=>T.id===S?{...T,isOpen:!T.isOpen}:T.children?{...T,children:x(T.children)}:T);a(b(x(n)))},l=(S,x)=>{S.dataTransfer.setData("text/plain",x),S.dataTransfer.effectAllowed="move"},g=(S,x,E)=>{S.preventDefault(),E==="folder"&&h(x)},u=()=>{h(null)},p=(S,x,E)=>{S.preventDefault(),h(null);const T=S.dataTransfer.getData("text/plain");T&&T!==x&&E==="folder"&&e&&e(T,x)},_=(S,x)=>{S.preventDefault(),f({x:S.clientX,y:S.clientY,nodeId:x.id,type:x.type})},y=[{label:"New File",icon:v.jsx(id,{size:14}),onClick:()=>c&&(t==null?void 0:t(c.nodeId))},{label:"New Folder",icon:v.jsx(Zl,{size:14}),onClick:()=>c&&(o==null?void 0:o(c.nodeId))},{label:"Rename",icon:v.jsx(ad,{size:14}),divider:!0,onClick:()=>c&&(i==null?void 0:i(c.nodeId))},{label:"Delete",icon:v.jsx(dd,{size:14,className:"text-destructive"}),onClick:()=>c&&(r==null?void 0:r(c.nodeId))}];return v.jsxs("div",{className:"h-full w-full bg-muted/30",children:[v.jsx(du,{style:{height:"100%"},totalCount:s.length,itemContent:S=>{const x=s[S];return v.jsxs("div",{draggable:!0,onDragStart:E=>l(E,x.id),onDragOver:E=>g(E,x.id,x.type),onDragLeave:u,onDrop:E=>p(E,x.id,x.type),className:wu("flex items-center py-1 px-2 cursor-pointer hover:bg-accent hover:text-accent-foreground select-none text-xs","transition-colors duration-150 relative",m===x.id&&"bg-primary/20 ring-1 ring-primary/50 rounded-sm"),style:{paddingLeft:`${(x.level||0)*12+8}px`},onClick:()=>x.type==="folder"&&d(x.id),onContextMenu:E=>_(E,x),children:[v.jsx("div",{className:"w-4 h-4 mr-1 flex items-center justify-center",children:x.type==="folder"?x.isOpen?v.jsx(Xl,{size:14}):v.jsx(Ar,{size:14}):null}),v.jsx("div",{className:"mr-2",children:x.type==="folder"?v.jsx(ql,{size:14,className:"text-blue-400 fill-blue-400/20"}):v.jsx($l,{size:14,className:"text-muted-foreground"})}),v.jsx("span",{className:"truncate",children:x.label})]})}}),c&&v.jsx(Su,{x:c.x,y:c.y,items:y,onClose:()=>f(null)})]})};function ra(...n){return Kt(qt(n))}const Ru=({placeholder:n="Search...",onSearch:e,results:t,onSelect:o,suggestions:i=[],loading:r=!1,className:s})=>{const[a,c]=A.useState(""),[f,m]=A.useState(!1),[h,b]=A.useState(-1),d=A.useRef(null);A.useEffect(()=>{const u=setTimeout(()=>{e(a)},300);return()=>clearTimeout(u)},[a,e]);const l=i.filter(u=>u.toLowerCase().includes(a.toLowerCase())&&u.toLowerCase()!==a.toLowerCase()),g=u=>{f&&l.length>0&&(u.key==="ArrowDown"?(u.preventDefault(),b(p=>(p+1)%l.length)):u.key==="ArrowUp"?(u.preventDefault(),b(p=>(p-1+l.length)%l.length)):u.key==="Enter"&&h>=0&&(u.preventDefault(),c(l[h]),m(!1)))};return v.jsxs("div",{ref:d,className:ra("flex flex-col h-full bg-background",s),children:[v.jsxs("div",{className:"p-3 border-b border-border/50",children:[v.jsxs("div",{className:"relative",children:[v.jsx("div",{className:"absolute left-2.5 top-2.5 text-muted-foreground",children:r?v.jsx(td,{size:14,className:"animate-spin"}):v.jsx(si,{size:14})}),v.jsx("input",{type:"text",className:"w-full bg-muted/50 border rounded-md pl-9 pr-8 py-1.5 text-xs outline-none focus:ring-1 focus:ring-primary focus:border-primary transition-all",placeholder:n,value:a,onChange:u=>{c(u.target.value),m(!0),b(-1)},onKeyDown:g,onFocus:()=>m(!0)}),a&&v.jsx("button",{onClick:()=>{c(""),e("")},className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",children:v.jsx(bo,{size:14})})]}),f&&l.length>0&&v.jsx("div",{className:"absolute left-3 right-3 mt-1 bg-popover border shadow-lg rounded-md z-50 py-1 overflow-hidden",children:l.map((u,p)=>v.jsxs("div",{className:ra("px-3 py-1.5 text-xs cursor-pointer flex items-center space-x-2",p===h?"bg-accent text-accent-foreground":"hover:bg-accent/50"),onClick:()=>{c(u),m(!1)},children:[v.jsx(Vl,{size:12,className:"text-muted-foreground"}),v.jsx("span",{children:u})]},u))})]}),v.jsx("div",{className:"flex-1 overflow-y-auto",children:t.length===0?v.jsx("div",{className:"p-8 text-center text-xs text-muted-foreground italic",children:a?`No results found for "${a}"`:"Type to start searching..."}):v.jsx("div",{className:"py-2",children:t.map(u=>{const p=u.icon;return v.jsx("div",{onClick:()=>o(u),className:"px-4 py-2 hover:bg-accent/50 cursor-pointer group transition-colors border-l-2 border-transparent hover:border-primary",children:v.jsxs("div",{className:"flex items-start space-x-3",children:[p&&v.jsx("div",{className:"mt-0.5 p-1 rounded bg-muted group-hover:bg-background transition-colors",children:v.jsx(p,{size:14,className:"text-muted-foreground group-hover:text-primary"})}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-xs font-medium truncate",children:u.title}),u.category&&v.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-bold px-1.5 py-0.5 bg-muted rounded",children:u.category})]}),u.description&&v.jsx("p",{className:"text-[11px] text-muted-foreground truncate mt-0.5",children:u.description})]})]})},u.id)})})})]})};function sa(...n){return Kt(qt(n))}const Au=({commands:n,forcedOpen:e=!1})=>{const[t,o]=A.useState(e),[i,r]=A.useState(""),[s,a]=A.useState(0),c=A.useRef(null),f=(n||ht.getCommands()).filter(b=>b.label.toLowerCase().includes(i.toLowerCase())||b.id.toLowerCase().includes(i.toLowerCase()));A.useEffect(()=>{o(e)},[e]),A.useEffect(()=>{const b=d=>{(d.metaKey||d.ctrlKey)&&d.shiftKey&&d.key.toLowerCase()==="p"?(d.preventDefault(),o(l=>!l),r(""),a(0)):d.key==="Escape"&&o(!1)};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[]),A.useEffect(()=>{var b;t&&((b=c.current)==null||b.focus())},[t]);const m=b=>{b.key==="ArrowDown"?(b.preventDefault(),a(d=>(d+1)%f.length)):b.key==="ArrowUp"?(b.preventDefault(),a(d=>(d-1+f.length)%f.length)):b.key==="Enter"&&(b.preventDefault(),f[s]&&h(f[s]))},h=b=>{b.execute(),e||o(!1)};return t?v.jsx("div",{className:sa("z-[100] flex items-start justify-center pt-[10vh]",e?"relative pt-0 w-full max-w-xl":"fixed inset-0 bg-black/50 backdrop-blur-sm"),children:v.jsxs("div",{className:"w-full max-w-xl bg-popover text-popover-foreground border shadow-2xl rounded-xl overflow-hidden animate-in fade-in zoom-in duration-200",children:[v.jsxs("div",{className:"flex items-center px-4 border-b",children:[v.jsx(si,{size:18,className:"text-muted-foreground mr-3"}),v.jsx("input",{ref:c,type:"text",placeholder:"Type a command to run...",className:"flex-1 h-12 bg-transparent outline-none text-sm",value:i,onChange:b=>{r(b.target.value),a(0)},onKeyDown:m})]}),v.jsx("div",{className:"max-h-[300px] overflow-y-auto py-2",children:f.length===0?v.jsxs("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:['No commands found matching "',i,'"']}):f.map((b,d)=>v.jsxs("div",{className:sa("px-4 py-2 cursor-pointer flex justify-between items-center text-sm",d===s?"bg-accent text-accent-foreground":"hover:bg-accent/50"),onClick:()=>h(b),onMouseEnter:()=>a(d),children:[v.jsx("span",{children:b.label}),b.keybinding&&v.jsx("span",{className:"text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded border border-border/50",children:b.keybinding})]},b.id))}),v.jsxs("div",{className:"px-4 py-2 border-t bg-muted/30 flex justify-between items-center text-[10px] text-muted-foreground",children:[v.jsxs("div",{className:"flex gap-3",children:[v.jsxs("span",{children:[v.jsx("kbd",{className:"bg-muted px-1 rounded border",children:"↑↓"})," to navigate"]}),v.jsxs("span",{children:[v.jsx("kbd",{className:"bg-muted px-1 rounded border",children:"Enter"})," to select"]})]}),v.jsxs("span",{children:[v.jsx("kbd",{className:"bg-muted px-1 rounded border",children:"Esc"})," to close"]})]})]})}):null};function Ou(...n){return Kt(qt(n))}const Nu=({name:n,avatarUrl:e,role:t,onClick:o,className:i,showName:r=!0})=>v.jsxs("div",{onClick:o,className:Ou("flex items-center space-x-2 px-2 py-1 rounded hover:bg-accent hover:text-accent-foreground cursor-pointer transition-colors select-none",i),children:[v.jsx("div",{className:"relative w-6 h-6 rounded-full overflow-hidden border border-border/50 bg-muted flex items-center justify-center shrink-0",children:e?v.jsx("img",{src:e,alt:n,className:"w-full h-full object-cover"}):v.jsx(Nr,{size:14,className:"text-muted-foreground"})}),r&&v.jsxs("div",{className:"flex flex-col min-w-0 leading-tight",children:[v.jsx("span",{className:"text-[11px] font-semibold truncate",children:n}),t&&v.jsx("span",{className:"text-[9px] text-muted-foreground truncate",children:t})]})]});class Cu{constructor(){Zn(this,"plugins",new Map);Zn(this,"loaders",new Map)}registerPlugin(e){if(this.plugins.has(e.id)){console.warn(`Plugin ${e.id} is already registered.`);return}this.plugins.set(e.id,e),console.log(`Plugin ${e.name} (${e.id}) registered.`)}registerLazyPlugin(e,t){if(this.loaders.has(e)||this.plugins.has(e)){console.warn(`Plugin ${e} is already registered or has a loader.`);return}this.loaders.set(e,t),console.log(`Lazy plugin loader for ${e} registered.`)}async activatePlugin(e){let t=this.plugins.get(e);if(!t&&this.loaders.has(e))try{t=await this.loaders.get(e)(),this.plugins.set(e,t),console.log(`Lazy plugin ${e} loaded.`)}catch(o){console.error(`Failed to load lazy plugin ${e}`,o);return}if(t)try{t.activate(),console.log(`Plugin ${t.name} activated.`)}catch(o){console.error(`Failed to activate plugin ${e}`,o)}else console.warn(`Plugin ${e} not found for activation.`)}getPlugin(e){return this.plugins.get(e)}getAllPlugins(){return Array.from(this.plugins.values())}}const Wi=new Cu,Lu={id:"plugin-example",name:"Example Plugin",activate:()=>{ht.registerCommand({id:"plugin.hello",label:"Plugin Hello",execute:()=>{alert("Hello from Example Plugin!")}}),Jt.registerMenu("View",{id:"view.greet",label:"Greet from Plugin",commandId:"plugin.hello"}),console.log("Example Plugin Activated")},deactivate:()=>{console.log("Example Plugin Deactivated")}},Du=[{id:"src",label:"src",type:"folder",isOpen:!0,children:[{id:"core",label:"core",type:"folder",isOpen:!0,children:[{id:"boot",label:"Boot.ts",type:"file"},{id:"registry",label:"registry",type:"folder"}]},{id:"components",label:"components",type:"folder",children:[{id:"layout",label:"layout",type:"folder"},{id:"widgets",label:"widgets",type:"folder"}]},{id:"app",label:"App.tsx",type:"file"},{id:"main",label:"main.tsx",type:"file"}]},{id:"package",label:"package.json",type:"file"},{id:"readme",label:"README.md",type:"file"}],Iu=()=>v.jsx(ia,{data:Du,onNewFile:n=>window.prompt("New File Name:"),onNewFolder:n=>window.prompt("New Folder Name:"),onRename:n=>window.prompt("New Name:"),onDelete:n=>window.confirm("Delete this item?")}),Bu=async()=>{vo.getState().setWidgets([{id:"git-branch",label:"main",icon:Kl,alignment:"left",priority:100},{id:"notifications",label:"0",icon:Yl,alignment:"left",priority:90},{id:"status-text",label:"Ready",alignment:"right",priority:10},{id:"terminal-toggle",label:"Terminal",icon:_o,alignment:"right",onClick:()=>bi.getState().toggle(),priority:110},{id:"chat-toggle",label:"Chat",icon:Or,alignment:"right",commandId:"nexus.toggle-chat",priority:100},{id:"line-col",label:"Ln 1, Col 1",alignment:"right",priority:50},{id:"encoding",label:"UTF-8",alignment:"right",priority:40}]),zn.getState().setPanels([{id:"files",label:"Explorer",icon:Jl,component:Iu},{id:"search",label:"Search",icon:si,component:()=>v.jsx("div",{className:"p-4 text-sm italic text-muted-foreground",children:"Search functionality coming soon..."})},{id:"git",label:"Source Control",icon:Ql,component:()=>v.jsx("div",{className:"p-4 text-sm italic text-muted-foreground",children:"Source control integration pending..."})},{id:"plugins",label:"Extensions",icon:od,component:()=>v.jsx("div",{className:"p-4 text-sm italic text-muted-foreground",children:"Extension manager view..."})}]),xo.getState().setSlashCommands([{command:"help",description:"Show available commands",execute:()=>alert("Available commands: /help, /clear, /theme [light|dark|gt]")},{command:"clear",description:"Clear chat history",execute:()=>{console.log("Chat clear triggered")}},{command:"theme",description:"Change the application theme",execute:n=>{const e=n[0];["light","dark","gt"].includes(e)?yo.getState().setTheme(e):alert("Usage: /theme [light|dark|gt]")}}]),ht.registerCommand({id:"nexus.new-tab",label:"New Welcome Tab",keybinding:"Control+N",execute:()=>Ti.getState().addTab("welcome","Welcome")}),ht.registerCommand({id:"nexus.toggle-chat",label:"Toggle Chat Pane",keybinding:"Control+I",execute:()=>mi.getState().toggleChat()}),ht.registerCommand({id:"nexus.about",label:"About Nexus Shell",keybinding:"Control+H",execute:()=>alert(`Nexus-Shell Framework v0.1.0
|
|
210
|
-
Professional-grade Workbench UI`)}),Jt.registerMenu("File",{id:"file.new-tab",label:"New Welcome Tab",commandId:"nexus.new-tab"}),Jt.registerMenu("Help",{id:"help.about",label:"About",commandId:"nexus.about"}),Wi.registerLazyPlugin("plugin-example",async()=>
|
|
209
|
+
`,children:[y.jsx(m,{size:16}),y.jsx("span",{children:f})]},c))})]})});if(r){if(typeof r.component=="function"){const c=r.component;return y.jsx(c,{})}return r.component}return y.jsx("div",{className:"p-4 text-sm italic text-muted-foreground",children:"Panel content not found."})},a=()=>n==="settings"?"SETTINGS":(r==null?void 0:r.label.toUpperCase())||"";return y.jsxs("div",{className:"w-[300px] h-full bg-muted border-r flex flex-col select-none",children:[y.jsxs("div",{className:"h-10 flex items-center justify-between px-4 text-[11px] font-bold text-muted-foreground uppercase tracking-widest",children:[y.jsx("span",{children:a()}),y.jsx("button",{onClick:()=>e(null),className:"p-1 hover:bg-accent hover:text-foreground rounded transition-colors",children:y.jsx(bo,{size:14})})]}),y.jsx("div",{className:"flex-1 overflow-auto border-t border-border/50 bg-background/50",children:s()})]})},pi="nexus-shell-right-sidebar",mi=Zt(n=>({isChatOpen:localStorage.getItem(pi)==="true",setChatOpen:o=>{localStorage.setItem(pi,String(o)),n({isChatOpen:o})},toggleChat:()=>n(o=>{const i=!o.isChatOpen;return localStorage.setItem(pi,String(i)),{isChatOpen:i}})})),xo=Zt(n=>({slashCommands:[],setSlashCommands:e=>n({slashCommands:e}),registerSlashCommand:e=>n(t=>({slashCommands:[...t.slashCommands,e]}))}));function _i(...n){return Kt(qt(n))}const ts=()=>{const{isChatOpen:n,setChatOpen:e}=mi(),{slashCommands:t}=xo(),[o,i]=A.useState([{id:1,sender:"Nexus",text:"Welcome to the Nexus Shell chat! How can I help you today?"}]),[r,s]=A.useState(""),[a,c]=A.useState(!1),[f,m]=A.useState(0),h=A.useRef(null),b=t.filter(u=>`/${u.command}`.startsWith(r.toLowerCase()));if(A.useEffect(()=>{r.startsWith("/")&&b.length>0?c(!0):c(!1)},[r,b.length]),!n)return null;const d=()=>{if(!r.trim())return;if(r.startsWith("/")){const p=r.slice(1).split(" "),_=p[0],v=p.slice(1),S=t.find(x=>x.command===_);if(S){S.execute(v),i(x=>[...x,{id:Date.now(),sender:"User",text:r}]),s("");return}}const u={id:Date.now(),sender:"User",text:r};i(p=>[...p,u]),s(""),setTimeout(()=>{i(p=>[...p,{id:Date.now()+1,sender:"Nexus",text:"I'm a simulated Nexus response. In a real application, I'd be connected to an LLM!"}])},1e3)},l=u=>{var p;s(`/${u.command} `),c(!1),(p=h.current)==null||p.focus()},g=u=>{a?u.key==="ArrowDown"?(u.preventDefault(),m(p=>(p+1)%b.length)):u.key==="ArrowUp"?(u.preventDefault(),m(p=>(p-1+b.length)%b.length)):u.key==="Tab"||u.key==="Enter"?(u.preventDefault(),l(b[f])):u.key==="Escape"&&c(!1):u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),d())};return y.jsxs("div",{className:"w-[350px] h-full bg-muted border-l flex flex-col select-none animate-in slide-in-from-right duration-300",children:[y.jsxs("div",{className:"h-10 flex items-center justify-between px-4 text-[11px] font-bold text-muted-foreground uppercase tracking-widest border-b border-border/50",children:[y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(Or,{size:14}),y.jsx("span",{children:"Chat"})]}),y.jsx("button",{onClick:()=>e(!1),className:"p-1 hover:bg-accent hover:text-foreground rounded transition-colors",children:y.jsx(bo,{size:14})})]}),y.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:o.map(u=>y.jsxs("div",{className:_i("flex flex-col space-y-1",u.sender==="User"?"items-end":"items-start"),children:[y.jsxs("div",{className:"flex items-center space-x-1 text-[10px] text-muted-foreground",children:[y.jsx(Nr,{size:10}),y.jsx("span",{children:u.sender})]}),y.jsx("div",{className:_i("px-3 py-2 rounded-lg text-sm max-w-[90%]",u.sender==="User"?"bg-primary text-primary-foreground":"bg-accent/50 text-foreground"),children:u.text})]},u.id))}),y.jsxs("div",{className:"p-4 border-t border-border/50 relative",children:[a&&y.jsxs("div",{className:"absolute bottom-full left-4 right-4 mb-2 bg-popover border shadow-xl rounded-lg overflow-hidden z-50",children:[y.jsx("div",{className:"px-3 py-2 text-[10px] font-bold text-muted-foreground border-b bg-muted/30",children:"COMMANDS"}),b.map((u,p)=>y.jsxs("div",{className:_i("px-3 py-2 cursor-pointer flex items-center justify-between text-xs",p===f?"bg-accent text-accent-foreground":"hover:bg-accent/50"),onClick:()=>l(u),onMouseEnter:()=>m(p),children:[y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(_o,{size:12,className:"text-primary"}),y.jsxs("span",{className:"font-semibold",children:["/",u.command]})]}),y.jsx("span",{className:"text-[10px] text-muted-foreground",children:u.description})]},u.command))]}),y.jsxs("div",{className:"relative",children:[y.jsx("textarea",{ref:h,value:r,onChange:u=>s(u.target.value),onKeyDown:g,placeholder:"Ask Nexus... (Type / for commands)",className:"w-full bg-background border rounded-md p-2 text-sm focus:ring-1 focus:ring-primary outline-none resize-none min-h-[80px]"}),y.jsx("button",{onClick:d,className:"absolute right-2 bottom-2 p-1.5 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",children:y.jsx(sd,{size:14})})]}),y.jsxs("div",{className:"mt-1.5 flex items-center space-x-1.5 text-[10px] text-muted-foreground opacity-70",children:[y.jsx(_o,{size:10}),y.jsxs("span",{children:["Use ",y.jsx("kbd",{className:"bg-muted px-1 rounded border border-border/50 font-sans",children:"/"})," to trigger slash commands"]})]})]})]})},bi=Zt(n=>({isOpen:!1,history:["Welcome to Nexus Shell Terminal v0.1.0",'Type "help" for a list of commands.'],setOpen:e=>n({isOpen:e}),toggle:()=>n(e=>({isOpen:!e.isOpen})),addHistory:e=>n(t=>({history:[...t.history,e]})),clearHistory:()=>n({history:[]})})),ns=()=>{const{isOpen:n,setOpen:e,history:t,addHistory:o,clearHistory:i}=bi(),[r,s]=A.useState(""),a=A.useRef(null),c=A.useRef(null);if(A.useEffect(()=>{a.current&&(a.current.scrollTop=a.current.scrollHeight)},[t]),A.useEffect(()=>{var m;n&&((m=c.current)==null||m.focus())},[n]),!n)return null;const f=m=>{if(m.key==="Enter"){const h=r.trim();if(!h)return;o(`$ ${h}`);const b=h.toLowerCase();b==="clear"?i():b==="help"?o("Available commands: help, clear, echo [text], date, theme"):b.startsWith("echo ")?o(h.slice(5)):o(b==="date"?new Date().toLocaleString():`Command not found: ${h}`),s("")}};return y.jsxs("div",{className:"h-[250px] bg-background border-t border-border flex flex-col select-text animate-in slide-in-from-bottom duration-300",children:[y.jsxs("div",{className:"h-9 border-b border-border/50 flex items-center justify-between px-4 bg-muted/30",children:[y.jsxs("div",{className:"flex items-center space-x-4",children:[y.jsxs("div",{className:"flex items-center space-x-2 text-[11px] font-bold text-muted-foreground uppercase tracking-widest border-b-2 border-primary pb-2.5 pt-2.5 mt-0.5",children:[y.jsx(_o,{size:14}),y.jsx("span",{children:"Terminal"})]}),y.jsx("div",{className:"text-[11px] text-muted-foreground hover:text-foreground cursor-pointer transition-colors",children:"Output"}),y.jsx("div",{className:"text-[11px] text-muted-foreground hover:text-foreground cursor-pointer transition-colors",children:"Debug Console"})]}),y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx("button",{className:"p-1 hover:bg-accent rounded text-muted-foreground",children:y.jsx(Vl,{size:14})}),y.jsx("button",{onClick:()=>e(!1),className:"p-1 hover:bg-accent rounded text-muted-foreground",children:y.jsx(bo,{size:14})})]})]}),y.jsxs("div",{ref:a,className:"flex-1 overflow-y-auto p-3 font-mono text-xs space-y-1 bg-black/5 dark:bg-black/20",children:[t.map((m,h)=>y.jsx("div",{className:"whitespace-pre-wrap break-all opacity-90",children:m},h)),y.jsxs("div",{className:"flex items-center space-x-2 pt-1",children:[y.jsx("span",{className:"text-primary font-bold",children:"$"}),y.jsx("input",{ref:c,type:"text",className:"flex-1 bg-transparent border-none outline-none text-xs font-mono",value:r,onChange:m=>s(m.target.value),onKeyDown:f,spellCheck:!1,autoComplete:"off"})]})]})]})},os={global:{tabEnableClose:!0,tabSetEnableMaximize:!1,tabSetEnableDivide:!0},borders:[{type:"border",location:"left",children:[]}],layout:{type:"row",weight:100,children:[{type:"tabset",weight:50,children:[{type:"tab",name:"Welcome",component:"welcome"}]}]}},is="nexus-shell-layout",Ti=Zt((n,e)=>{let t;try{const o=localStorage.getItem(is);o?t=Ot.Model.fromJson(JSON.parse(o)):t=Ot.Model.fromJson(os)}catch(o){console.warn("Failed to load layout from storage, using default",o),t=Ot.Model.fromJson(os)}return{model:t,dirtyTabs:new Set,setModel:o=>{n({model:o}),localStorage.setItem(is,JSON.stringify(o.toJson()))},setTabDirty:(o,i)=>{n(r=>{const s=new Set(r.dirtyTabs);return i?s.add(o):s.delete(o),{dirtyTabs:s}})},isTabDirty:o=>e().dirtyTabs.has(o),addTab:(o,i)=>{const r=e().model,s=r.getActiveTabset();let a=s==null?void 0:s.getId();a&&r.doAction(Ot.Actions.addNode({type:"tab",component:o,name:i||o},a,Ot.DockLocation.CENTER,-1))}}});class ec{constructor(){mn(this,"components",new Map)}register(e,t){this.components.has(e)&&console.warn(`Component with ID "${e}" is already registered.`),this.components.set(e,t)}get(e){return this.components.get(e)}getRegisteredIds(){return Array.from(this.components.keys())}}const rs=new ec,tc=({panels:n,slashCommands:e,menuConfig:t,statusBarConfig:o,rightMenuBarContent:i})=>{const{model:r,setModel:s,isTabDirty:a,setTabDirty:c}=Ti(),{theme:f}=yo(),{setPanels:m}=Fn(),{setSlashCommands:h}=xo(),{setWidgets:b}=vo();A.useEffect(()=>{n&&m(n)},[n,m]),A.useEffect(()=>{e&&h(e)},[e,h]),A.useEffect(()=>{t&&Jt.setMenus(t)},[t]),A.useEffect(()=>{o&&b(o)},[o,b]);const d=g=>{try{var u=g.getComponent();const p=g.getId(),_=a(p);if(u==="welcome")return y.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center space-y-4 p-8",children:[y.jsx("h1",{className:"text-4xl font-bold text-primary",children:"Nexus Shell"}),y.jsx("p",{className:"text-muted-foreground",children:"A professional-grade frontend framework built with React and TypeScript."}),y.jsx("p",{className:"text-sm text-muted-foreground",children:"Start by exploring the menu or dragging tabs."}),y.jsxs("div",{className:"mt-8 p-4 border rounded bg-muted/20",children:[y.jsx("p",{className:"text-xs mb-2",children:"Tab Persistence & Lifecycle Test:"}),y.jsx("button",{onClick:()=>c(p,!_),className:`px-3 py-1 text-xs rounded border ${_?"bg-destructive text-destructive-foreground":"bg-secondary text-secondary-foreground"}`,children:_?"Mark as Saved (Clear Dirty)":"Mark as Dirty (Unsaved Changes)"}),_&&y.jsx("p",{className:"text-[10px] mt-1 text-destructive",children:"This tab will now prompt before closing."})]})]});const v=u?rs.get(u):void 0;return v?y.jsx(v,{node:g}):y.jsxs("div",{className:"p-4 text-sm",children:["Unknown Component: ",u]})}catch(p){return console.error("Error in component factory:",p),y.jsxs("div",{className:"p-8 text-destructive bg-destructive/10 border border-destructive/20 h-full flex items-center justify-center",children:["Error rendering component: ",(p==null?void 0:p.message)||"Unknown error"]})}},l=g=>{if(g.type===Ot.Actions.DELETE_TAB){const u=r.getNodeById(g.data.node);if(u&&a(u.getId())){if(!window.confirm(`Tab "${u.getName()}" has unsaved changes. Are you sure you want to close it?`))return;c(u.getId(),!1)}}return g};return y.jsxs("div",{className:`flex flex-col h-screen w-screen bg-background text-foreground overflow-hidden theme-${f}`,children:[y.jsx(Cr,{rightContent:i}),y.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[y.jsx(qr,{}),y.jsx(es,{}),y.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-card",children:[y.jsx("div",{className:"flex-1 relative h-full w-full",children:y.jsx(Ot.Layout,{model:r,factory:d,onModelChange:g=>s(g),onAction:l})}),y.jsx(ns,{})]}),y.jsx(ts,{})]}),y.jsx(Jr,{})]})},Eo=0,Pt=1,un=2,ss=4;function as(n){return()=>n}function nc(n){n()}function ls(n,e){return t=>n(e(t))}function ds(n,e){return()=>n(e)}function oc(n,e){return t=>n(e,t)}function vi(n){return n!==void 0}function ic(...n){return()=>{n.map(nc)}}function hn(){}function So(n,e){return e(n),n}function rc(n,e){return e(n)}function ye(...n){return n}function ue(n,e){return n(Pt,e)}function Q(n,e){n(Eo,e)}function yi(n){n(un)}function Ee(n){return n(ss)}function H(n,e){return ue(n,oc(e,Eo))}function ct(n,e){const t=n(Pt,o=>{t(),e(o)});return t}function cs(n){let e,t;return o=>i=>{e=i,t&&clearTimeout(t),t=setTimeout(()=>{o(e)},n)}}function us(n,e){return n===e}function xe(n=us){let e;return t=>o=>{n(e,o)||(e=o,t(o))}}function X(n){return e=>t=>{n(t)&&e(t)}}function U(n){return e=>ls(e,n)}function ft(n){return e=>()=>{e(n)}}function D(n,...e){const t=sc(...e);return(o,i)=>{switch(o){case un:yi(n);return;case Pt:return ue(n,t(i))}}}function gt(n,e){return t=>o=>{t(e=n(e,o))}}function Qt(n){return e=>t=>{n>0?n--:e(t)}}function St(n){let e=null,t;return o=>i=>{e=i,!t&&(t=setTimeout(()=>{t=void 0,o(e)},n))}}function ee(...n){const e=new Array(n.length);let t=0,o=null;const i=Math.pow(2,n.length)-1;return n.forEach((r,s)=>{const a=Math.pow(2,s);ue(r,c=>{const f=t;t=t|a,e[s]=c,f!==i&&t===i&&o&&(o(),o=null)})}),r=>s=>{const a=()=>{r([s].concat(e))};t===i?a():o=a}}function sc(...n){return e=>n.reduceRight(rc,e)}function ac(n){let e,t;const o=()=>e==null?void 0:e();return function(i,r){switch(i){case Pt:return r?t===r?void 0:(o(),t=r,e=ue(n,r),e):(o(),hn);case un:o(),t=null;return}}}function I(n){let e=n;const t=ie();return(o,i)=>{switch(o){case Eo:e=i;break;case Pt:{i(e);break}case ss:return e}return t(o,i)}}function ze(n,e){return So(I(e),t=>H(n,t))}function ie(){const n=[];return(e,t)=>{switch(e){case Eo:n.slice().forEach(o=>{o(t)});return;case un:n.splice(0,n.length);return;case Pt:return n.push(t),()=>{const o=n.indexOf(t);o>-1&&n.splice(o,1)}}}}function Ke(n){return So(ie(),e=>H(n,e))}function le(n,e=[],{singleton:t}={singleton:!0}){return{constructor:n,dependencies:e,id:lc(),singleton:t}}const lc=()=>Symbol();function dc(n){const e=new Map,t=({constructor:o,dependencies:i,id:r,singleton:s})=>{if(s&&e.has(r))return e.get(r);const a=o(i.map(c=>t(c)));return s&&e.set(r,a),a};return t(n)}function Re(...n){const e=ie(),t=new Array(n.length);let o=0;const i=Math.pow(2,n.length)-1;return n.forEach((r,s)=>{const a=Math.pow(2,s);ue(r,c=>{t[s]=c,o=o|a,o===i&&Q(e,t)})}),function(r,s){switch(r){case un:{yi(e);return}case Pt:return o===i&&s(t),ue(e,s)}}}function G(n,e=us){return D(n,xe(e))}function xi(...n){return function(e,t){switch(e){case un:return;case Pt:return ic(...n.map(o=>ue(o,t)))}}}var Ve=(n=>(n[n.DEBUG=0]="DEBUG",n[n.INFO=1]="INFO",n[n.WARN=2]="WARN",n[n.ERROR=3]="ERROR",n))(Ve||{});const cc={0:"debug",3:"error",1:"log",2:"warn"},uc=()=>typeof globalThis>"u"?window:globalThis,jt=le(()=>{const n=I(3);return{log:I((e,t,o=1)=>{var i;const r=(i=uc().VIRTUOSO_LOG_LEVEL)!=null?i:Ee(n);o>=r&&console[cc[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",e,t)}),logLevel:n}},[],{singleton:!0});function en(n,e,t){return Ei(n,e,t).callbackRef}function Ei(n,e,t){const o=A.useRef(null);let i=s=>{};const r=A.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(s=>{const a=()=>{const c=s[0].target;c.offsetParent!==null&&n(c)};t?a():requestAnimationFrame(a)}):null,[n,t]);return i=s=>{s&&e?(r==null||r.observe(s),o.current=s):(o.current&&(r==null||r.unobserve(o.current)),o.current=null)},{callbackRef:i,ref:o}}function hc(n,e,t,o,i,r,s,a,c){const f=A.useCallback(m=>{const h=fc(m.children,e,a?"offsetWidth":"offsetHeight",i);let b=m.parentElement;for(;!b.dataset.virtuosoScroller;)b=b.parentElement;const d=b.lastElementChild.dataset.viewportType==="window";let l;d&&(l=b.ownerDocument.defaultView);const g=s?a?s.scrollLeft:s.scrollTop:d?a?l.scrollX||l.document.documentElement.scrollLeft:l.scrollY||l.document.documentElement.scrollTop:a?b.scrollLeft:b.scrollTop,u=s?a?s.scrollWidth:s.scrollHeight:d?a?l.document.documentElement.scrollWidth:l.document.documentElement.scrollHeight:a?b.scrollWidth:b.scrollHeight,p=s?a?s.offsetWidth:s.offsetHeight:d?a?l.innerWidth:l.innerHeight:a?b.offsetWidth:b.offsetHeight;o({scrollHeight:u,scrollTop:Math.max(g,0),viewportHeight:p}),r==null||r(a?hs("column-gap",getComputedStyle(m).columnGap,i):hs("row-gap",getComputedStyle(m).rowGap,i)),h!==null&&n(h)},[n,e,i,r,s,o,a]);return Ei(f,t,c)}function fc(n,e,t,o){const i=n.length;if(i===0)return null;const r=[];for(let s=0;s<i;s++){const a=n.item(s);if(a.dataset.index===void 0)continue;const c=parseInt(a.dataset.index),f=parseFloat(a.dataset.knownSize),m=e(a,t);if(m===0&&o("Zero-sized element, this should not happen",{child:a},Ve.ERROR),m===f)continue;const h=r[r.length-1];r.length===0||h.size!==m||h.endIndex!==c-1?r.push({endIndex:c,size:m,startIndex:c}):r[r.length-1].endIndex++}return r}function hs(n,e,t){return e!=="normal"&&!(e!=null&&e.endsWith("px"))&&t(`${n} was not resolved to pixel value correctly`,e,Ve.WARN),e==="normal"?0:parseInt(e??"0",10)}function fs(n,e,t){const o=A.useRef(null),i=A.useCallback(c=>{if(!(c!=null&&c.offsetParent))return;const f=c.getBoundingClientRect(),m=f.width;let h,b;if(e){const d=e.getBoundingClientRect(),l=f.top-d.top;b=d.height-Math.max(0,l),h=l+e.scrollTop}else{const d=s.current.ownerDocument.defaultView;b=d.innerHeight-Math.max(0,f.top),h=f.top+d.scrollY}o.current={offsetTop:h,visibleHeight:b,visibleWidth:m},n(o.current)},[n,e]),{callbackRef:r,ref:s}=Ei(i,!0,t),a=A.useCallback(()=>{i(s.current)},[i,s]);return A.useEffect(()=>{var c;if(e){e.addEventListener("scroll",a);const f=new ResizeObserver(()=>{requestAnimationFrame(a)});return f.observe(e),()=>{e.removeEventListener("scroll",a),f.unobserve(e)}}else{const f=(c=s.current)==null?void 0:c.ownerDocument.defaultView;return f==null||f.addEventListener("scroll",a),f==null||f.addEventListener("resize",a),()=>{f==null||f.removeEventListener("scroll",a),f==null||f.removeEventListener("resize",a)}}},[a,e,s]),r}const je=le(()=>{const n=ie(),e=ie(),t=I(0),o=ie(),i=I(0),r=ie(),s=ie(),a=I(0),c=I(0),f=I(0),m=I(0),h=ie(),b=ie(),d=I(!1),l=I(!1),g=I(!1);return H(D(n,U(({scrollTop:u})=>u)),e),H(D(n,U(({scrollHeight:u})=>u)),s),H(e,i),{deviation:t,fixedFooterHeight:f,fixedHeaderHeight:c,footerHeight:m,headerHeight:a,horizontalDirection:l,scrollBy:b,scrollContainerState:n,scrollHeight:s,scrollingInProgress:d,scrollTo:h,scrollTop:e,skipAnimationFrameInResizeObserver:g,smoothScrollTargetReached:o,statefulScrollTop:i,viewportHeight:r}},[],{singleton:!0}),Un={lvl:0};function gs(n,e){const t=n.length;if(t===0)return[];let{index:o,value:i}=e(n[0]);const r=[];for(let s=1;s<t;s++){const{index:a,value:c}=e(n[s]);r.push({end:a-1,start:o,value:i}),o=a,i=c}return r.push({end:1/0,start:o,value:i}),r}function ge(n){return n===Un}function Pn(n,e){if(!ge(n))return e===n.k?n.v:e<n.k?Pn(n.l,e):Pn(n.r,e)}function ut(n,e,t="k"){if(ge(n))return[-1/0,void 0];if(Number(n[t])===e)return[n.k,n.v];if(Number(n[t])<e){const o=ut(n.r,e,t);return o[0]===-1/0?[n.k,n.v]:o}return ut(n.l,e,t)}function Qe(n,e,t){return ge(n)?_s(e,t,1):e===n.k?Ne(n,{k:e,v:t}):e<n.k?bs(Ne(n,{l:Qe(n.l,e,t)})):bs(Ne(n,{r:Qe(n.r,e,t)}))}function fn(){return Un}function gn(n,e,t){if(ge(n))return[];const o=ut(n,e)[0];return gc(wi(n,o,t))}function Si(n,e){if(ge(n))return Un;const{k:t,l:o,r:i}=n;if(e===t){if(ge(o))return i;if(ge(i))return o;{const[r,s]=ms(o);return wo(Ne(n,{k:r,l:ps(o),v:s}))}}else return e<t?wo(Ne(n,{l:Si(o,e)})):wo(Ne(n,{r:Si(i,e)}))}function tn(n){return ge(n)?[]:[...tn(n.l),{k:n.k,v:n.v},...tn(n.r)]}function wi(n,e,t){if(ge(n))return[];const{k:o,l:i,r,v:s}=n;let a=[];return o>e&&(a=a.concat(wi(i,e,t))),o>=e&&o<=t&&a.push({k:o,v:s}),o<=t&&(a=a.concat(wi(r,e,t))),a}function wo(n){const{l:e,lvl:t,r:o}=n;if(o.lvl>=t-1&&e.lvl>=t-1)return n;if(t>o.lvl+1){if(Ri(e))return Ts(Ne(n,{lvl:t-1}));if(!ge(e)&&!ge(e.r))return Ne(e.r,{l:Ne(e,{r:e.r.l}),lvl:t,r:Ne(n,{l:e.r.r,lvl:t-1})});throw new Error("Unexpected empty nodes")}else{if(Ri(n))return Ai(Ne(n,{lvl:t-1}));if(!ge(o)&&!ge(o.l)){const i=o.l,r=Ri(i)?o.lvl-1:o.lvl;return Ne(i,{l:Ne(n,{lvl:t-1,r:i.l}),lvl:i.lvl+1,r:Ai(Ne(o,{l:i.r,lvl:r}))})}else throw new Error("Unexpected empty nodes")}}function Ne(n,e){return _s(e.k!==void 0?e.k:n.k,e.v!==void 0?e.v:n.v,e.lvl!==void 0?e.lvl:n.lvl,e.l!==void 0?e.l:n.l,e.r!==void 0?e.r:n.r)}function ps(n){return ge(n.r)?n.l:wo(Ne(n,{r:ps(n.r)}))}function Ri(n){return ge(n)||n.lvl>n.r.lvl}function ms(n){return ge(n.r)?[n.k,n.v]:ms(n.r)}function _s(n,e,t,o=Un,i=Un){return{k:n,l:o,lvl:t,r:i,v:e}}function bs(n){return Ai(Ts(n))}function Ts(n){const{l:e}=n;return!ge(e)&&e.lvl===n.lvl?Ne(e,{r:Ne(n,{l:e.r})}):n}function Ai(n){const{lvl:e,r:t}=n;return!ge(t)&&!ge(t.r)&&t.lvl===e&&t.r.lvl===e?Ne(t,{l:Ne(n,{r:t.l}),lvl:e+1}):n}function gc(n){return gs(n,({k:e,v:t})=>({index:e,value:t}))}function vs(n,e){return!!(n&&n.startIndex===e.startIndex&&n.endIndex===e.endIndex)}function jn(n,e){return!!(n&&n[0]===e[0]&&n[1]===e[1])}const Oi=le(()=>({recalcInProgress:I(!1)}),[],{singleton:!0});function ys(n,e,t){return n[Ro(n,e,t)]}function Ro(n,e,t,o=0){let i=n.length-1;for(;o<=i;){const r=Math.floor((o+i)/2),s=n[r],a=t(s,e);if(a===0)return r;if(a===-1){if(i-o<2)return r-1;i=r-1}else{if(i===o)return r;o=r+1}}throw new Error(`Failed binary finding record in array - ${n.join(",")}, searched for ${e}`)}function pc(n,e,t,o){const i=Ro(n,e,o),r=Ro(n,t,o,i);return n.slice(i,r+1)}function Ht(n,e){return Math.round(n.getBoundingClientRect()[e])}function Ao(n){return!ge(n.groupOffsetTree)}function Ni({index:n},e){return e===n?0:e<n?-1:1}function mc(){return{groupIndices:[],groupOffsetTree:fn(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:fn()}}function _c(n,e){let t=ge(n)?0:1/0;for(const o of e){const{endIndex:i,size:r,startIndex:s}=o;if(t=Math.min(t,s),ge(n)){n=Qe(n,0,r);continue}const a=gn(n,s-1,i+1);if(a.some(Sc(o)))continue;let c=!1,f=!1;for(const{end:m,start:h,value:b}of a)c?(i>=h||r===b)&&(n=Si(n,h)):(f=b!==r,c=!0),m>i&&i>=h&&b!==r&&(n=Qe(n,i+1,b));f&&(n=Qe(n,s,r))}return[n,t]}function bc(n){return typeof n.groupIndex<"u"}function Tc({offset:n},e){return e===n?0:e<n?-1:1}function Hn(n,e,t){if(e.length===0)return 0;const{index:o,offset:i,size:r}=ys(e,n,Ni),s=n-o,a=r*s+(s-1)*t+i;return a>0?a+t:a}function xs(n,e){if(!Ao(e))return n;let t=0;for(;e.groupIndices[t]<=n+t;)t++;return n+t}function Es(n,e,t){if(bc(n))return e.groupIndices[n.groupIndex]+1;{const o=n.index==="LAST"?t:n.index;let i=xs(o,e);return i=Math.max(0,i,Math.min(t,i)),i}}function vc(n,e,t,o=0){return o>0&&(e=Math.max(e,ys(n,o,Ni).offset)),gs(pc(n,e,t,Tc),Ec)}function yc(n,[e,t,o,i]){e.length>0&&o("received item sizes",e,Ve.DEBUG);const r=n.sizeTree;let s=r,a=0;if(t.length>0&&ge(r)&&e.length===2){const b=e[0].size,d=e[1].size;s=t.reduce((l,g)=>Qe(Qe(l,g,b),g+1,d),s)}else[s,a]=_c(s,e);if(s===r)return n;const{lastIndex:c,lastOffset:f,lastSize:m,offsetTree:h}=Ci(n.offsetTree,a,s,i);return{groupIndices:t,groupOffsetTree:t.reduce((b,d)=>Qe(b,d,Hn(d,h,i)),fn()),lastIndex:c,lastOffset:f,lastSize:m,offsetTree:h,sizeTree:s}}function xc(n){return tn(n).map(({k:e,v:t},o,i)=>{const r=i[o+1];return{endIndex:r?r.k-1:1/0,size:t,startIndex:e}})}function Ss(n,e){let t=0,o=0;for(;t<n;)t+=e[o+1]-e[o]-1,o++;return o-(t===n?0:1)}function Ci(n,e,t,o){let i=n,r=0,s=0,a=0,c=0;if(e!==0){c=Ro(i,e-1,Ni),a=i[c].offset;const f=ut(t,e-1);r=f[0],s=f[1],i.length&&i[c].size===ut(t,e)[1]&&(c-=1),i=i.slice(0,c+1)}else i=[];for(const{start:f,value:m}of gn(t,e,1/0)){const h=f-r,b=h*s+a+h*o;i.push({index:f,offset:b,size:m}),r=f,a=b,s=m}return{lastIndex:r,lastOffset:a,lastSize:s,offsetTree:i}}function Ec(n){return{index:n.index,value:n}}function Sc(n){const{endIndex:e,size:t,startIndex:o}=n;return i=>i.start===o&&(i.end===e||i.end===1/0)&&i.value===t}const wc={offsetHeight:"height",offsetWidth:"width"},pt=le(([{log:n},{recalcInProgress:e}])=>{const t=ie(),o=ie(),i=ze(o,0),r=ie(),s=ie(),a=I(0),c=I([]),f=I(void 0),m=I(void 0),h=I(void 0),b=I(void 0),d=I((T,w)=>Ht(T,wc[w])),l=I(void 0),g=I(0),u=mc(),p=ze(D(t,ee(c,n,g),gt(yc,u),xe()),u),_=ze(D(c,xe(),gt((T,w)=>({current:w,prev:T.current}),{current:[],prev:[]}),U(({prev:T})=>T)),[]);H(D(c,X(T=>T.length>0),ee(p,g),U(([T,w,C])=>{const O=T.reduce((L,R,F)=>Qe(L,R,Hn(R,w.offsetTree,C)||F),fn());return{...w,groupIndices:T,groupOffsetTree:O}})),p),H(D(o,ee(p),X(([T,{lastIndex:w}])=>T<w),U(([T,{lastIndex:w,lastSize:C}])=>[{endIndex:w,size:C,startIndex:T}])),t),H(f,m);const v=ze(D(f,U(T=>T===void 0)),!0);H(D(m,X(T=>T!==void 0&&ge(Ee(p).sizeTree)),U(T=>{const w=Ee(h),C=Ee(c).length>0;return w?C?[{endIndex:0,size:w,startIndex:0},{endIndex:1,size:T,startIndex:1}]:[]:[{endIndex:0,size:T,startIndex:0}]})),t),H(D(b,X(T=>T!==void 0&&T.length>0&&ge(Ee(p).sizeTree)),U(T=>{const w=[];let C=T[0],O=0;for(let L=1;L<T.length;L++){const R=T[L];R!==C&&(w.push({endIndex:L-1,size:C,startIndex:O}),C=R,O=L)}return w.push({endIndex:T.length-1,size:C,startIndex:O}),w})),t),H(D(c,ee(h,m),X(([,T,w])=>T!==void 0&&w!==void 0),U(([T,w,C])=>{const O=[];for(let L=0;L<T.length;L++){const R=T[L],F=T[L+1];O.push({startIndex:R,endIndex:R,size:w}),F!==void 0&&O.push({startIndex:R+1,endIndex:F-1,size:C})}return O})),t);const S=Ke(D(t,ee(p),gt(({sizes:T},[w,C])=>({changed:C!==T,sizes:C}),{changed:!1,sizes:u}),U(T=>T.changed)));ue(D(a,gt((T,w)=>({diff:T.prev-w,prev:w}),{diff:0,prev:0}),U(T=>T.diff)),T=>{const{groupIndices:w}=Ee(p);if(T>0)Q(e,!0),Q(r,T+Ss(T,w));else if(T<0){const C=Ee(_);C.length>0&&(T-=Ss(-T,C)),Q(s,T)}}),ue(D(a,ee(n)),([T,w])=>{T<0&&w("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:a},Ve.ERROR)});const x=Ke(r);H(D(r,ee(p),U(([T,w])=>{const C=w.groupIndices.length>0,O=[],L=w.lastSize;if(C){const R=Pn(w.sizeTree,0);let F=0,k=0;for(;F<T;){const Y=w.groupIndices[k],j=w.groupIndices.length===k+1?1/0:w.groupIndices[k+1]-Y-1;O.push({endIndex:Y,size:R,startIndex:Y}),O.push({endIndex:Y+1+j-1,size:L,startIndex:Y+1}),k++,F+=j+1}const B=tn(w.sizeTree);return F!==T&&B.shift(),B.reduce((Y,{k:j,v:z})=>{let V=Y.ranges;return Y.prevSize!==0&&(V=[...Y.ranges,{endIndex:j+T-1,size:Y.prevSize,startIndex:Y.prevIndex}]),{prevIndex:j+T,prevSize:z,ranges:V}},{prevIndex:T,prevSize:0,ranges:O}).ranges}return tn(w.sizeTree).reduce((R,{k:F,v:k})=>({prevIndex:F+T,prevSize:k,ranges:[...R.ranges,{endIndex:F+T-1,size:R.prevSize,startIndex:R.prevIndex}]}),{prevIndex:0,prevSize:L,ranges:[]}).ranges})),t);const E=Ke(D(s,ee(p,g),U(([T,{offsetTree:w},C])=>{const O=-T;return Hn(O,w,C)})));return H(D(s,ee(p,g),U(([T,w,C])=>{if(w.groupIndices.length>0){if(ge(w.sizeTree))return w;let O=fn();const L=Ee(_);let R=0,F=0,k=0;for(;R<-T;){k=L[F];const B=L[F+1]-k-1;F++,R+=B+1}if(O=tn(w.sizeTree).reduce((B,{k:Y,v:j})=>Qe(B,Math.max(0,Y+T),j),O),R!==-T){const B=Pn(w.sizeTree,k);O=Qe(O,0,B);const Y=ut(w.sizeTree,-T+1)[1];O=Qe(O,1,Y)}return{...w,sizeTree:O,...Ci(w.offsetTree,0,O,C)}}else{const O=tn(w.sizeTree).reduce((L,{k:R,v:F})=>Qe(L,Math.max(0,R+T),F),fn());return{...w,sizeTree:O,...Ci(w.offsetTree,0,O,C)}}})),p),{beforeUnshiftWith:x,data:l,defaultItemSize:m,firstItemIndex:a,fixedItemSize:f,fixedGroupSize:h,gap:g,groupIndices:c,heightEstimates:b,itemSize:d,listRefresh:S,shiftWith:s,shiftWithOffset:E,sizeRanges:t,sizes:p,statefulTotalCount:i,totalCount:o,trackItemSizes:v,unshiftWith:r}},ye(jt,Oi),{singleton:!0});function Rc(n){return n.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}const ws=le(([{groupIndices:n,sizes:e,totalCount:t},{headerHeight:o,scrollTop:i}])=>{const r=ie(),s=ie(),a=Ke(D(r,U(Rc)));return H(D(a,U(c=>c.totalCount)),t),H(D(a,U(c=>c.groupIndices)),n),H(D(Re(i,e,o),X(([c,f])=>Ao(f)),U(([c,f,m])=>ut(f.groupOffsetTree,Math.max(c-m,0),"v")[0]),xe(),U(c=>[c])),s),{groupCounts:r,topItemsIndexes:s}},ye(pt,je)),Wt=le(([{log:n}])=>{const e=I(!1),t=Ke(D(e,X(o=>o),xe()));return ue(e,o=>{o&&Ee(n)("props updated",{},Ve.DEBUG)}),{didMount:t,propsReady:e}},ye(jt),{singleton:!0}),Ac=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Rs(n){const e=typeof n=="number"?{index:n}:n;return e.align||(e.align="start"),(!e.behavior||!Ac)&&(e.behavior="auto"),e.offset||(e.offset=0),e}const Wn=le(([{gap:n,listRefresh:e,sizes:t,totalCount:o},{fixedFooterHeight:i,fixedHeaderHeight:r,footerHeight:s,headerHeight:a,scrollingInProgress:c,scrollTo:f,smoothScrollTargetReached:m,viewportHeight:h},{log:b}])=>{const d=ie(),l=ie(),g=I(0);let u=null,p=null,_=null;function v(){u&&(u(),u=null),_&&(_(),_=null),p&&(clearTimeout(p),p=null),Q(c,!1)}return H(D(d,ee(t,h,o,g,a,s,b),ee(n,r,i),U(([[S,x,E,T,w,C,O,L],R,F,k])=>{const B=Rs(S),{align:Y,behavior:j,offset:z}=B,V=T-1,ae=Es(B,x,V);let N=Hn(ae,x.offsetTree,R)+C;Y==="end"?(N+=F+ut(x.sizeTree,ae)[1]-E+k,ae===V&&(N+=O)):Y==="center"?N+=(F+ut(x.sizeTree,ae)[1]-E+k)/2:N-=w,z&&(N+=z);const W=oe=>{v(),oe?(L("retrying to scroll to",{location:S},Ve.DEBUG),Q(d,S)):(Q(l,!0),L("list did not change, scroll successful",{},Ve.DEBUG))};if(v(),j==="smooth"){let oe=!1;_=ue(e,he=>{oe=oe||he}),u=ct(m,()=>{W(oe)})}else u=ct(D(e,Oc(150)),W);return p=setTimeout(()=>{v()},1200),Q(c,!0),L("scrolling from index to",{behavior:j,index:ae,top:N},Ve.DEBUG),{behavior:j,top:N}})),f),{scrollTargetReached:l,scrollToIndex:d,topListHeight:g}},ye(pt,je,jt),{singleton:!0});function Oc(n){return e=>{const t=setTimeout(()=>{e(!1)},n);return o=>{o&&(e(!0),clearTimeout(t))}}}function Li(n,e){n==0?e():requestAnimationFrame(()=>{Li(n-1,e)})}function Di(n,e){const t=e-1;return typeof n=="number"?n:n.index==="LAST"?t:n.index}const Yn=le(([{defaultItemSize:n,listRefresh:e,sizes:t},{scrollTop:o},{scrollTargetReached:i,scrollToIndex:r},{didMount:s}])=>{const a=I(!0),c=I(0),f=I(!0);return H(D(s,ee(c),X(([m,h])=>!!h),ft(!1)),a),H(D(s,ee(c),X(([m,h])=>!!h),ft(!1)),f),ue(D(Re(e,s),ee(a,t,n,f),X(([[,m],h,{sizeTree:b},d,l])=>m&&(!ge(b)||vi(d))&&!h&&!l),ee(c)),([,m])=>{ct(i,()=>{Q(f,!0)}),Li(4,()=>{ct(o,()=>{Q(a,!0)}),Q(r,m)})}),{initialItemFinalLocationReached:f,initialTopMostItemIndex:c,scrolledToInitialItem:a}},ye(pt,je,Wn,Wt),{singleton:!0});function As(n,e){return Math.abs(n-e)<1.01}const Xn="up",Gn="down",Nc="none",Cc={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},Lc=0,Vn=le(([{footerHeight:n,headerHeight:e,scrollBy:t,scrollContainerState:o,scrollTop:i,viewportHeight:r}])=>{const s=I(!1),a=I(!0),c=ie(),f=ie(),m=I(4),h=I(Lc),b=ze(D(xi(D(G(i),Qt(1),ft(!0)),D(G(i),Qt(1),ft(!1),cs(100))),xe()),!1),d=ze(D(xi(D(t,ft(!0)),D(t,ft(!1),cs(200))),xe()),!1);H(D(Re(G(i),G(h)),U(([_,v])=>_<=v),xe()),a),H(D(a,St(50)),f);const l=Ke(D(Re(o,G(r),G(e),G(n),G(m)),gt((_,[{scrollHeight:v,scrollTop:S},x,E,T,w])=>{const C=S+x-v>-w,O={scrollHeight:v,scrollTop:S,viewportHeight:x};if(C){let R,F;return S>_.state.scrollTop?(R="SCROLLED_DOWN",F=_.state.scrollTop-S):(R="SIZE_DECREASED",F=_.state.scrollTop-S||_.scrollTopDelta),{atBottom:!0,atBottomBecause:R,scrollTopDelta:F,state:O}}let L;return O.scrollHeight>_.state.scrollHeight?L="SIZE_INCREASED":x<_.state.viewportHeight?L="VIEWPORT_HEIGHT_DECREASING":S<_.state.scrollTop?L="SCROLLING_UPWARDS":L="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:L,state:O}},Cc),xe((_,v)=>_&&_.atBottom===v.atBottom))),g=ze(D(o,gt((_,{scrollHeight:v,scrollTop:S,viewportHeight:x})=>{if(As(_.scrollHeight,v))return{changed:!1,jump:0,scrollHeight:v,scrollTop:S};{const E=v-(S+x)<1;return _.scrollTop!==S&&E?{changed:!0,jump:_.scrollTop-S,scrollHeight:v,scrollTop:S}:{changed:!0,jump:0,scrollHeight:v,scrollTop:S}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),X(_=>_.changed),U(_=>_.jump)),0);H(D(l,U(_=>_.atBottom)),s),H(D(s,St(50)),c);const u=I(Gn);H(D(o,U(({scrollTop:_})=>_),xe(),gt((_,v)=>Ee(d)?{direction:_.direction,prevScrollTop:v}:{direction:v<_.prevScrollTop?Xn:Gn,prevScrollTop:v},{direction:Gn,prevScrollTop:0}),U(_=>_.direction)),u),H(D(o,St(50),ft(Nc)),u);const p=I(0);return H(D(b,X(_=>!_),ft(0)),p),H(D(i,St(100),ee(b),X(([_,v])=>v),gt(([_,v],[S])=>[v,S],[0,0]),U(([_,v])=>v-_)),p),{atBottomState:l,atBottomStateChange:c,atBottomThreshold:m,atTopStateChange:f,atTopThreshold:h,isAtBottom:s,isAtTop:a,isScrolling:b,lastJumpDueToItemResize:g,scrollDirection:u,scrollVelocity:p}},ye(je)),$n="top",Jn="bottom",Os="none";function Ns(n,e,t){return typeof n=="number"?t===Xn&&e===$n||t===Gn&&e===Jn?n:0:t===Xn?e===$n?n.main:n.reverse:e===Jn?n.main:n.reverse}function Cs(n,e){var t;return typeof n=="number"?n:(t=n[e])!=null?t:0}const Ii=le(([{deviation:n,fixedHeaderHeight:e,headerHeight:t,scrollTop:o,viewportHeight:i}])=>{const r=ie(),s=I(0),a=I(0),c=I(0),f=ze(D(Re(G(o),G(i),G(t),G(r,jn),G(c),G(s),G(e),G(n),G(a)),U(([m,h,b,[d,l],g,u,p,_,v])=>{const S=m-_,x=u+p,E=Math.max(b-S,0);let T=Os;const w=Cs(v,$n),C=Cs(v,Jn);return d-=_,d+=b+p,l+=b+p,l-=_,d>m+x-w&&(T=Xn),l<m-E+h+C&&(T=Gn),T!==Os?[Math.max(S-b-Ns(g,$n,T)-w,0),S-E-p+h+Ns(g,Jn,T)+C]:null}),X(m=>m!=null),xe(jn)),[0,0]);return{increaseViewportBy:a,listBoundary:r,overscan:c,topListHeight:s,visibleRange:f}},ye(je),{singleton:!0});function Dc(n,e,t){if(Ao(e)){const o=xs(n,e);return[{index:ut(e.groupOffsetTree,o)[0],offset:0,size:0},{data:t==null?void 0:t[0],index:o,offset:0,size:0}]}return[{data:t==null?void 0:t[0],index:n,offset:0,size:0}]}const Bi={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Oo(n,e,t,o,i,r){const{lastIndex:s,lastOffset:a,lastSize:c}=i;let f=0,m=0;if(n.length>0){f=n[0].offset;const g=n[n.length-1];m=g.offset+g.size}const h=t-s,b=a+h*c+(h-1)*o,d=f,l=b-m;return{bottom:m,firstItemIndex:r,items:Ds(n,i,r),offsetBottom:l,offsetTop:f,top:d,topItems:Ds(e,i,r),topListHeight:e.reduce((g,u)=>u.size+g,0),totalCount:t}}function Ls(n,e,t,o,i,r){let s=0;if(t.groupIndices.length>0)for(const m of t.groupIndices){if(m-s>=n)break;s++}const a=n+s,c=Di(e,a),f=Array.from({length:a}).map((m,h)=>({data:r[h+c],index:h+c,offset:0,size:0}));return Oo(f,[],a,i,t,o)}function Ds(n,e,t){if(n.length===0)return[];if(!Ao(e))return n.map(f=>({...f,index:f.index+t,originalIndex:f.index}));const o=n[0].index,i=n[n.length-1].index,r=[],s=gn(e.groupOffsetTree,o,i);let a,c=0;for(const f of n){(!a||a.end<f.index)&&(a=s.shift(),c=e.groupIndices.indexOf(a.start));let m;f.index===a.start?m={index:c,type:"group"}:m={groupIndex:c,index:f.index-(c+1)+t},r.push({...m,data:f.data,offset:f.offset,originalIndex:f.index,size:f.size})}return r}function Is(n,e){var t;return n===void 0?0:typeof n=="number"?n:(t=n[e])!=null?t:0}const nn=le(([{data:n,firstItemIndex:e,gap:t,sizes:o,totalCount:i},r,{listBoundary:s,topListHeight:a,visibleRange:c},{initialTopMostItemIndex:f,scrolledToInitialItem:m},{topListHeight:h},b,{didMount:d},{recalcInProgress:l}])=>{const g=I([]),u=I(0),p=ie(),_=I(0);H(r.topItemsIndexes,g);const v=ze(D(Re(d,l,G(c,jn),G(i),G(o),G(f),m,G(g),G(e),G(t),G(_),n),X(([T,w,,C,,,,,,,,O])=>{const L=O&&O.length!==C;return T&&!w&&!L}),U(([,,[T,w],C,O,L,R,F,k,B,Y,j])=>{var z,V,ae,N;const W=O,{offsetTree:oe,sizeTree:he}=W,$e=Ee(u);if(C===0)return{...Bi,totalCount:C};if(T===0&&w===0)return $e===0?{...Bi,totalCount:C}:Ls($e,L,O,k,B,j||[]);if(ge(he))return $e>0?null:Oo(Dc(Di(L,C),W,j),[],C,B,W,k);const Je=[];if(F.length>0){const Z=F[0],de=F[F.length-1];let Ae=0;for(const Oe of gn(he,Z,de)){const pe=Oe.value,Te=Math.max(Oe.start,Z),it=Math.min(Oe.end,de);for(let Be=Te;Be<=it;Be++)Je.push({data:j==null?void 0:j[Be],index:Be,offset:Ae,size:pe}),Ae+=pe}}if(!R)return Oo([],Je,C,B,W,k);const re=F.length>0?F[F.length-1]+1:0,M=vc(oe,T,w,re);if(M.length===0)return null;const te=C-1,fe=So([],Z=>{for(const de of M){const Ae=de.value;let Oe=Ae.offset,pe=de.start;const Te=Ae.size;if(Ae.offset<T){pe+=Math.floor((T-Ae.offset+B)/(Te+B));const Be=pe-de.start;Oe+=Be*Te+Be*B}pe<re&&(Oe+=(re-pe)*Te,pe=re);const it=Math.min(de.end,te);for(let Be=pe;Be<=it&&!(Oe>=w);Be++)Z.push({data:j==null?void 0:j[Be],index:Be,offset:Oe,size:Te}),Oe+=Te+B}}),we=Is(Y,$n),P=Is(Y,Jn);if(fe.length>0&&(we>0||P>0)){const Z=fe[0],de=fe[fe.length-1];if(we>0&&Z.index>re){const Ae=Math.min(we,Z.index-re),Oe=[];let pe=Z.offset;for(let Te=Z.index-1;Te>=Z.index-Ae;Te--){const it=(V=(z=gn(he,Te,Te)[0])==null?void 0:z.value)!=null?V:Z.size;pe-=it+B,Oe.unshift({data:j==null?void 0:j[Te],index:Te,offset:pe,size:it})}fe.unshift(...Oe)}if(P>0&&de.index<te){const Ae=Math.min(P,te-de.index);let Oe=de.offset+de.size+B;for(let pe=de.index+1;pe<=de.index+Ae;pe++){const Te=(N=(ae=gn(he,pe,pe)[0])==null?void 0:ae.value)!=null?N:de.size;fe.push({data:j==null?void 0:j[pe],index:pe,offset:Oe,size:Te}),Oe+=Te+B}}}return Oo(fe,Je,C,B,W,k)}),X(T=>T!==null),xe()),Bi);H(D(n,X(vi),U(T=>T==null?void 0:T.length)),i),H(D(v,U(T=>T.topListHeight)),h),H(h,a),H(D(v,U(T=>[T.top,T.bottom])),s),H(D(v,U(T=>T.items)),p);const S=Ke(D(v,X(({items:T})=>T.length>0),ee(i,n),X(([{items:T},w])=>T[T.length-1].originalIndex===w-1),U(([,T,w])=>[T-1,w]),xe(jn),U(([T])=>T))),x=Ke(D(v,St(200),X(({items:T,topItems:w})=>T.length>0&&T[0].originalIndex===w.length),U(({items:T})=>T[0].index),xe())),E=Ke(D(v,X(({items:T})=>T.length>0),U(({items:T})=>{let w=0,C=T.length-1;for(;T[w].type==="group"&&w<C;)w++;for(;T[C].type==="group"&&C>w;)C--;return{endIndex:T[C].index,startIndex:T[w].index}}),xe(vs)));return{endReached:S,initialItemCount:u,itemsRendered:p,listState:v,minOverscanItemCount:_,rangeChanged:E,startReached:x,topItemsIndexes:g,...b}},ye(pt,ws,Ii,Yn,Wn,Vn,Wt,Oi),{singleton:!0}),Bs=le(([{fixedFooterHeight:n,fixedHeaderHeight:e,footerHeight:t,headerHeight:o},{listState:i}])=>{const r=ie(),s=ze(D(Re(t,n,o,e,i),U(([a,c,f,m,h])=>a+c+f+m+h.offsetBottom+h.bottom)),0);return H(G(s),r),{totalListHeight:s,totalListHeightChanged:r}},ye(je,nn),{singleton:!0}),Ic=le(([{viewportHeight:n},{totalListHeight:e}])=>{const t=I(!1),o=ze(D(Re(t,n,e),X(([i])=>i),U(([,i,r])=>Math.max(0,i-r)),St(0),xe()),0);return{alignToBottom:t,paddingTopAddition:o}},ye(je,Bs),{singleton:!0}),Ms=le(()=>({context:I(null)})),Bc=({itemBottom:n,itemTop:e,locationParams:{align:t,behavior:o,...i},viewportBottom:r,viewportTop:s})=>e<s?{...i,align:t??"start",behavior:o}:n>r?{...i,align:t??"end",behavior:o}:null,ks=le(([{gap:n,sizes:e,totalCount:t},{fixedFooterHeight:o,fixedHeaderHeight:i,headerHeight:r,scrollingInProgress:s,scrollTop:a,viewportHeight:c},{scrollToIndex:f}])=>{const m=ie();return H(D(m,ee(e,c,t,r,i,o,a),ee(n),U(([[h,b,d,l,g,u,p,_],v])=>{const{align:S,behavior:x,calculateViewLocation:E=Bc,done:T,...w}=h,C=Es(h,b,l-1),O=Hn(C,b.offsetTree,v)+g+u,L=O+ut(b.sizeTree,C)[1],R=_+u,F=_+d-p,k=E({itemBottom:L,itemTop:O,locationParams:{align:S,behavior:x,...w},viewportBottom:F,viewportTop:R});return k?T&&ct(D(s,X(B=>!B),Qt(Ee(s)?1:2)),T):T==null||T(),k}),X(h=>h!==null)),f),{scrollIntoView:m}},ye(pt,je,Wn,nn,jt),{singleton:!0});function zs(n){return n?n==="smooth"?"smooth":"auto":!1}const Mc=(n,e)=>typeof n=="function"?zs(n(e)):e&&zs(n),kc=le(([{listRefresh:n,totalCount:e,fixedItemSize:t,data:o},{atBottomState:i,isAtBottom:r},{scrollToIndex:s},{scrolledToInitialItem:a},{didMount:c,propsReady:f},{log:m},{scrollingInProgress:h},{context:b},{scrollIntoView:d}])=>{const l=I(!1),g=ie();let u=null;function p(x){Q(s,{align:"end",behavior:x,index:"LAST"})}ue(D(Re(D(G(e),Qt(1)),c),ee(G(l),r,a,h),U(([[x,E],T,w,C,O])=>{let L=E&&C,R="auto";return L&&(R=Mc(T,w||O),L=L&&!!R),{followOutputBehavior:R,shouldFollow:L,totalCount:x}}),X(({shouldFollow:x})=>x)),({followOutputBehavior:x,totalCount:E})=>{u&&(u(),u=null),Ee(t)?requestAnimationFrame(()=>{Ee(m)("following output to ",{totalCount:E},Ve.DEBUG),p(x)}):u=ct(n,()=>{Ee(m)("following output to ",{totalCount:E},Ve.DEBUG),p(x),u=null})});function _(x){const E=ct(i,T=>{x&&!T.atBottom&&T.notAtBottomBecause==="SIZE_INCREASED"&&!u&&(Ee(m)("scrolling to bottom due to increased size",{},Ve.DEBUG),p("auto"))});setTimeout(E,100)}ue(D(Re(G(l),e,f),X(([x,,E])=>x&&E),gt(({value:x},[,E])=>({refreshed:x===E,value:E}),{refreshed:!1,value:0}),X(({refreshed:x})=>x),ee(l,e)),([,x])=>{Ee(a)&&_(x!==!1)}),ue(g,()=>{_(Ee(l)!==!1)}),ue(Re(G(l),i),([x,E])=>{x&&!E.atBottom&&E.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&p("auto")});const v=I(null),S=ie();return H(xi(D(G(o),U(x=>{var E;return(E=x==null?void 0:x.length)!=null?E:0})),D(G(e))),S),ue(D(Re(D(S,Qt(1)),c),ee(G(v),a,h,b),U(([[x,E],T,w,C,O])=>E&&w&&(T==null?void 0:T({context:O,totalCount:x,scrollingInProgress:C}))),X(x=>!!x),St(0)),x=>{u&&(u(),u=null),Ee(t)?requestAnimationFrame(()=>{Ee(m)("scrolling into view",{}),Q(d,x)}):u=ct(n,()=>{Ee(m)("scrolling into view",{}),Q(d,x),u=null})}),{autoscrollToBottom:g,followOutput:l,scrollIntoViewOnChange:v}},ye(pt,Vn,Wn,Yn,Wt,jt,je,Ms,ks)),zc=le(([{data:n,firstItemIndex:e,gap:t,sizes:o},{initialTopMostItemIndex:i},{initialItemCount:r,listState:s},{didMount:a}])=>(H(D(a,ee(r),X(([,c])=>c!==0),ee(i,o,e,t,n),U(([[,c],f,m,h,b,d=[]])=>Ls(c,f,m,h,b,d))),s),{}),ye(pt,Yn,nn,Wt),{singleton:!0}),Fc=le(([{didMount:n},{scrollTo:e},{listState:t}])=>{const o=I(0);return ue(D(n,ee(o),X(([,i])=>i!==0),U(([,i])=>({top:i}))),i=>{ct(D(t,Qt(1),X(r=>r.items.length>1)),()=>{requestAnimationFrame(()=>{Q(e,i)})})}),{initialScrollTop:o}},ye(Wt,je,nn),{singleton:!0}),Fs=le(([{scrollVelocity:n}])=>{const e=I(!1),t=ie(),o=I(!1);return H(D(n,ee(o,e,t),X(([i,r])=>!!r),U(([i,r,s,a])=>{const{enter:c,exit:f}=r;if(s){if(f(i,a))return!1}else if(c(i,a))return!0;return s}),xe()),e),ue(D(Re(e,n,t),ee(o)),([[i,r,s],a])=>{i&&a&&a.change&&a.change(r,s)}),{isSeeking:e,scrollSeekConfiguration:o,scrollSeekRangeChanged:t,scrollVelocity:n}},ye(Vn),{singleton:!0}),Mi=le(([{scrollContainerState:n,scrollTo:e}])=>{const t=ie(),o=ie(),i=ie(),r=I(!1),s=I(void 0);return H(D(Re(t,o),U(([{scrollHeight:a,scrollTop:c,viewportHeight:f},{offsetTop:m}])=>({scrollHeight:a,scrollTop:Math.max(0,c-m),viewportHeight:f}))),n),H(D(e,ee(o),U(([a,{offsetTop:c}])=>({...a,top:a.top+c}))),i),{customScrollParent:s,useWindowScroll:r,windowScrollContainerState:t,windowScrollTo:i,windowViewportRect:o}},ye(je)),Uc=le(([{sizeRanges:n,sizes:e},{headerHeight:t,scrollTop:o},{initialTopMostItemIndex:i},{didMount:r},{useWindowScroll:s,windowScrollContainerState:a,windowViewportRect:c}])=>{const f=ie(),m=I(void 0),h=I(null),b=I(null);return H(a,h),H(c,b),ue(D(f,ee(e,o,s,h,b,t)),([d,l,g,u,p,_,v])=>{const S=xc(l.sizeTree);u&&p!==null&&_!==null&&(g=p.scrollTop-_.offsetTop),g-=v,d({ranges:S,scrollTop:g})}),H(D(m,X(vi),U(Pc)),i),H(D(r,ee(m),X(([,d])=>d!==void 0),xe(),U(([,d])=>d.ranges)),n),{getState:f,restoreStateFrom:m}},ye(pt,je,Yn,Wt,Mi));function Pc(n){return{align:"start",index:0,offset:n.scrollTop}}const jc=le(([{topItemsIndexes:n}])=>{const e=I(0);return H(D(e,X(t=>t>=0),U(t=>Array.from({length:t}).map((o,i)=>i))),n),{topItemCount:e}},ye(nn));function Us(n){let e=!1,t;return()=>(e||(e=!0,t=n()),t)}const Hc=Us(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),Wc=le(([{deviation:n,scrollBy:e,scrollingInProgress:t,scrollTop:o},{isAtBottom:i,isScrolling:r,lastJumpDueToItemResize:s,scrollDirection:a},{listState:c},{beforeUnshiftWith:f,gap:m,shiftWithOffset:h,sizes:b},{log:d},{recalcInProgress:l}])=>{const g=Ke(D(c,ee(s),gt(([,p,_,v],[{bottom:S,items:x,offsetBottom:E,totalCount:T},w])=>{const C=S+E;let O=0;return _===T&&p.length>0&&x.length>0&&(x[0].originalIndex===0&&p[0].originalIndex===0||(O=C-v,O!==0&&(O+=w))),[O,x,T,C]},[0,[],0,0]),X(([p])=>p!==0),ee(o,a,t,i,d,l),X(([,p,_,v,,,S])=>!S&&!v&&p!==0&&_===Xn),U(([[p],,,,,_])=>(_("Upward scrolling compensation",{amount:p},Ve.DEBUG),p))));function u(p){p>0?(Q(e,{behavior:"auto",top:-p}),Q(n,0)):(Q(n,0),Q(e,{behavior:"auto",top:-p}))}return ue(D(g,ee(n,r)),([p,_,v])=>{v&&Hc()?Q(n,_-p):u(-p)}),ue(D(Re(ze(r,!1),n,l),X(([p,_,v])=>!p&&!v&&_!==0),U(([p,_])=>_),St(1)),u),H(D(h,U(p=>({top:-p}))),e),ue(D(f,ee(b,m),U(([p,{groupIndices:_,lastSize:v,sizeTree:S},x])=>{function E(T){return T*(v+x)}if(_.length===0)return E(p);{let T=0;const w=Pn(S,0);let C=0,O=0;for(;C<p;){C++,T+=w;let L=_.length===O+1?1/0:_[O+1]-_[O]-1;C+L>p&&(T-=w,L=p-C+1),C+=L,T+=E(L),O++}return T}})),p=>{Q(n,p),requestAnimationFrame(()=>{Q(e,{top:p}),requestAnimationFrame(()=>{Q(n,0),Q(l,!1)})})}),{deviation:n}},ye(je,Vn,nn,pt,jt,Oi)),Yc=le(([n,e,t,o,i,r,s,a,c,f,m])=>({...n,...e,...t,...o,...i,...r,...s,...a,...c,...f,...m}),ye(Ii,zc,Wt,Fs,Bs,Fc,Ic,Mi,ks,jt,Ms)),Ps=le(([{data:n,defaultItemSize:e,firstItemIndex:t,fixedItemSize:o,fixedGroupSize:i,gap:r,groupIndices:s,heightEstimates:a,itemSize:c,sizeRanges:f,sizes:m,statefulTotalCount:h,totalCount:b,trackItemSizes:d},{initialItemFinalLocationReached:l,initialTopMostItemIndex:g,scrolledToInitialItem:u},p,_,v,S,{scrollToIndex:x},E,{topItemCount:T},{groupCounts:w},C])=>{const{listState:O,minOverscanItemCount:L,topItemsIndexes:R,rangeChanged:F,...k}=S;return H(F,C.scrollSeekRangeChanged),H(D(C.windowViewportRect,U(B=>B.visibleHeight)),p.viewportHeight),{data:n,defaultItemHeight:e,firstItemIndex:t,fixedItemHeight:o,fixedGroupHeight:i,gap:r,groupCounts:w,heightEstimates:a,initialItemFinalLocationReached:l,initialTopMostItemIndex:g,scrolledToInitialItem:u,sizeRanges:f,topItemCount:T,topItemsIndexes:R,totalCount:b,...v,groupIndices:s,itemSize:c,listState:O,minOverscanItemCount:L,scrollToIndex:x,statefulTotalCount:h,trackItemSizes:d,rangeChanged:F,...k,...C,...p,sizes:m,..._}},ye(pt,Yn,je,Uc,kc,nn,Wn,Wc,jc,ws,Yc));function Xc(n,e){const t={},o={};let i=0;const r=n.length;for(;i<r;)o[n[i]]=1,i+=1;for(const s in e)Object.hasOwn(o,s)||(t[s]=e[s]);return t}const No=typeof document<"u"?A.useLayoutEffect:A.useEffect;function js(n,e,t){const o=Object.keys(e.required||{}),i=Object.keys(e.optional||{}),r=Object.keys(e.methods||{}),s=Object.keys(e.events||{}),a=A.createContext({});function c(u,p){u.propsReady&&Q(u.propsReady,!1);for(const _ of o){const v=u[e.required[_]];Q(v,p[_])}for(const _ of i)if(_ in p){const v=u[e.optional[_]];Q(v,p[_])}u.propsReady&&Q(u.propsReady,!0)}function f(u){return r.reduce((p,_)=>(p[_]=v=>{const S=u[e.methods[_]];Q(S,v)},p),{})}function m(u){return s.reduce((p,_)=>(p[_]=ac(u[e.events[_]]),p),{})}const h=A.forwardRef((u,p)=>{const{children:_,...v}=u,[S]=A.useState(()=>So(dc(n),T=>{c(T,v)})),[x]=A.useState(ds(m,S));No(()=>{for(const T of s)T in v&&ue(x[T],v[T]);return()=>{Object.values(x).map(yi)}},[v,x,S]),No(()=>{c(S,v)}),A.useImperativeHandle(p,as(f(S)));const E=t;return y.jsx(a.Provider,{value:S,children:t?y.jsx(E,{...Xc([...o,...i,...s],v),children:_}):_})}),b=u=>{const p=A.useContext(a);return A.useCallback(_=>{Q(p[u],_)},[p,u])},d=u=>{const p=A.useContext(a)[u],_=A.useCallback(v=>ue(p,v),[p]);return A.useSyncExternalStore(_,()=>Ee(p),()=>Ee(p))},l=u=>{const p=A.useContext(a)[u],[_,v]=A.useState(ds(Ee,p));return No(()=>ue(p,S=>{S!==_&&v(as(S))}),[p,_]),_},g=A.version.startsWith("18")?d:l;return{Component:h,useEmitter:(u,p)=>{const _=A.useContext(a)[u];No(()=>ue(_,p),[p,_])},useEmitterValue:g,usePublisher:b}}const Hs=A.createContext(void 0),Ws=A.createContext(void 0),Ys=typeof document<"u"?A.useLayoutEffect:A.useEffect;function ki(n){return"self"in n}function Gc(n){return"body"in n}function Xs(n,e,t,o=hn,i,r){const s=A.useRef(null),a=A.useRef(null),c=A.useRef(null),f=A.useCallback(b=>{let d,l,g;const u=b.target;if(Gc(u)||ki(u)){const _=ki(u)?u:u.defaultView;g=r?_.scrollX:_.scrollY,d=r?_.document.documentElement.scrollWidth:_.document.documentElement.scrollHeight,l=r?_.innerWidth:_.innerHeight}else g=r?u.scrollLeft:u.scrollTop,d=r?u.scrollWidth:u.scrollHeight,l=r?u.offsetWidth:u.offsetHeight;const p=()=>{n({scrollHeight:d,scrollTop:Math.max(g,0),viewportHeight:l})};b.suppressFlushSync?p():At.flushSync(p),a.current!==null&&(g===a.current||g<=0||g===d-l)&&(a.current=null,e(!0),c.current&&(clearTimeout(c.current),c.current=null))},[n,e,r]);A.useEffect(()=>{const b=i||s.current;return o(i||s.current),f({suppressFlushSync:!0,target:b}),b.addEventListener("scroll",f,{passive:!0}),()=>{o(null),b.removeEventListener("scroll",f)}},[s,f,t,o,i]);function m(b){const d=s.current;if(!d||(r?"offsetWidth"in d&&d.offsetWidth===0:"offsetHeight"in d&&d.offsetHeight===0))return;const l=b.behavior==="smooth";let g,u,p;ki(d)?(u=Math.max(Ht(d.document.documentElement,r?"width":"height"),r?d.document.documentElement.scrollWidth:d.document.documentElement.scrollHeight),g=r?d.innerWidth:d.innerHeight,p=r?window.scrollX:window.scrollY):(u=d[r?"scrollWidth":"scrollHeight"],g=Ht(d,r?"width":"height"),p=d[r?"scrollLeft":"scrollTop"]);const _=u-g;if(b.top=Math.ceil(Math.max(Math.min(_,b.top),0)),As(g,u)||b.top===p){n({scrollHeight:u,scrollTop:p,viewportHeight:g}),l&&e(!0);return}l?(a.current=b.top,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,a.current=null,e(!0)},1e3)):a.current=null,r&&(b={behavior:b.behavior,left:b.top}),d.scrollTo(b)}function h(b){r&&(b={behavior:b.behavior,left:b.top}),s.current.scrollBy(b)}return{scrollByCallback:h,scrollerRef:s,scrollToCallback:m}}const zi="-webkit-sticky",Gs="sticky",Fi=Us(()=>{if(typeof document>"u")return Gs;const n=document.createElement("div");return n.style.position=zi,n.style.position===zi?zi:Gs});function Ui(n){return n}const Vc=le(()=>{const n=I(a=>`Item ${a}`),e=I(a=>`Group ${a}`),t=I({}),o=I(Ui),i=I("div"),r=I(hn),s=(a,c=null)=>ze(D(t,U(f=>f[a]),xe()),c);return{components:t,computeItemKey:o,EmptyPlaceholder:s("EmptyPlaceholder"),FooterComponent:s("Footer"),GroupComponent:s("Group","div"),groupContent:e,HeaderComponent:s("Header"),HeaderFooterTag:i,ItemComponent:s("Item","div"),itemContent:n,ListComponent:s("List","div"),ScrollerComponent:s("Scroller","div"),scrollerRef:r,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),TopItemListComponent:s("TopItemList")}}),$c=le(([n,e])=>({...n,...e}),ye(Ps,Vc)),Jc=({height:n})=>y.jsx("div",{style:{height:n}}),Zc={overflowAnchor:"none",position:Fi(),zIndex:1},Vs={overflowAnchor:"none"},qc={...Vs,display:"inline-block",height:"100%"},$s=A.memo(function({showTopList:n=!1}){const e=J("listState"),t=nt("sizeRanges"),o=J("useWindowScroll"),i=J("customScrollParent"),r=nt("windowScrollContainerState"),s=nt("scrollContainerState"),a=i||o?r:s,c=J("itemContent"),f=J("context"),m=J("groupContent"),h=J("trackItemSizes"),b=J("itemSize"),d=J("log"),l=nt("gap"),g=J("horizontalDirection"),{callbackRef:u}=hc(t,b,h,n?hn:a,d,l,i,g,J("skipAnimationFrameInResizeObserver")),[p,_]=A.useState(0);Pi("deviation",k=>{p!==k&&_(k)});const v=J("EmptyPlaceholder"),S=J("ScrollSeekPlaceholder")||Jc,x=J("ListComponent"),E=J("ItemComponent"),T=J("GroupComponent"),w=J("computeItemKey"),C=J("isSeeking"),O=J("groupIndices").length>0,L=J("alignToBottom"),R=J("initialItemFinalLocationReached"),F=n?{}:{boxSizing:"border-box",...g?{display:"inline-block",height:"100%",marginLeft:p!==0?p:L?"auto":0,paddingLeft:e.offsetTop,paddingRight:e.offsetBottom,whiteSpace:"nowrap"}:{marginTop:p!==0?p:L?"auto":0,paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},...R?{}:{visibility:"hidden"}};return!n&&e.totalCount===0&&v?y.jsx(v,{...Fe(v,f)}):y.jsx(x,{...Fe(x,f),"data-testid":n?"virtuoso-top-item-list":"virtuoso-item-list",ref:u,style:F,children:(n?e.topItems:e.items).map(k=>{const B=k.originalIndex,Y=w(B+e.firstItemIndex,k.data,f);return C?A.createElement(S,{...Fe(S,f),height:k.size,index:k.index,key:Y,type:k.type||"item",...k.type==="group"?{}:{groupIndex:k.groupIndex}}):k.type==="group"?A.createElement(T,{...Fe(T,f),"data-index":B,"data-item-index":k.index,"data-known-size":k.size,key:Y,style:Zc},m(k.index,f)):A.createElement(E,{...Fe(E,f),...tu(E,k.data),"data-index":B,"data-item-group-index":k.groupIndex,"data-item-index":k.index,"data-known-size":k.size,key:Y,style:g?qc:Vs},O?c(k.index,k.groupIndex,k.data,f):c(k.index,k.data,f))})})}),Kc={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},Qc={outline:"none",overflowX:"auto",position:"relative"},Co=n=>({height:"100%",position:"absolute",top:0,width:"100%",...n?{display:"flex",flexDirection:"column"}:{}}),eu={position:Fi(),top:0,width:"100%",zIndex:1};function Fe(n,e){if(typeof n!="string")return{context:e}}function tu(n,e){return{item:typeof n=="string"?void 0:e}}const nu=A.memo(function(){const n=J("HeaderComponent"),e=nt("headerHeight"),t=J("HeaderFooterTag"),o=en(A.useMemo(()=>r=>{e(Ht(r,"height"))},[e]),!0,J("skipAnimationFrameInResizeObserver")),i=J("context");return n?y.jsx(t,{ref:o,children:y.jsx(n,{...Fe(n,i)})}):null}),ou=A.memo(function(){const n=J("FooterComponent"),e=nt("footerHeight"),t=J("HeaderFooterTag"),o=en(A.useMemo(()=>r=>{e(Ht(r,"height"))},[e]),!0,J("skipAnimationFrameInResizeObserver")),i=J("context");return n?y.jsx(t,{ref:o,children:y.jsx(n,{...Fe(n,i)})}):null});function Js({useEmitter:n,useEmitterValue:e,usePublisher:t}){return A.memo(function({children:o,style:i,context:r,...s}){const a=t("scrollContainerState"),c=e("ScrollerComponent"),f=t("smoothScrollTargetReached"),m=e("scrollerRef"),h=e("horizontalDirection")||!1,{scrollByCallback:b,scrollerRef:d,scrollToCallback:l}=Xs(a,f,c,m,void 0,h);return n("scrollTo",l),n("scrollBy",b),y.jsx(c,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:d,style:{...h?Qc:Kc,...i},tabIndex:0,...s,...Fe(c,r),children:o})})}function Zs({useEmitter:n,useEmitterValue:e,usePublisher:t}){return A.memo(function({children:o,style:i,context:r,...s}){const a=t("windowScrollContainerState"),c=e("ScrollerComponent"),f=t("smoothScrollTargetReached"),m=e("totalListHeight"),h=e("deviation"),b=e("customScrollParent"),d=A.useRef(null),l=e("scrollerRef"),{scrollByCallback:g,scrollerRef:u,scrollToCallback:p}=Xs(a,f,c,l,b);return Ys(()=>{var _;return u.current=b||((_=d.current)==null?void 0:_.ownerDocument.defaultView),()=>{u.current=null}},[u,b]),n("windowScrollTo",p),n("scrollBy",g),y.jsx(c,{ref:d,"data-virtuoso-scroller":!0,style:{position:"relative",...i,...m!==0?{height:m+h}:{}},...s,...Fe(c,r),children:o})})}const iu=({children:n})=>{const e=A.useContext(Hs),t=nt("viewportHeight"),o=nt("fixedItemHeight"),i=J("alignToBottom"),r=J("horizontalDirection"),s=A.useMemo(()=>ls(t,c=>Ht(c,r?"width":"height")),[t,r]),a=en(s,!0,J("skipAnimationFrameInResizeObserver"));return A.useEffect(()=>{e&&(t(e.viewportHeight),o(e.itemHeight))},[e,t,o]),y.jsx("div",{"data-viewport-type":"element",ref:a,style:Co(i),children:n})},ru=({children:n})=>{const e=A.useContext(Hs),t=nt("windowViewportRect"),o=nt("fixedItemHeight"),i=J("customScrollParent"),r=fs(t,i,J("skipAnimationFrameInResizeObserver")),s=J("alignToBottom");return A.useEffect(()=>{e&&(o(e.itemHeight),t({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,t,o]),y.jsx("div",{"data-viewport-type":"window",ref:r,style:Co(s),children:n})},su=({children:n})=>{const e=J("TopItemListComponent")||"div",t=J("headerHeight"),o={...eu,marginTop:`${t}px`},i=J("context");return y.jsx(e,{style:o,...Fe(e,i),children:n})},au=A.memo(function(n){const e=J("useWindowScroll"),t=J("topItemsIndexes").length>0,o=J("customScrollParent"),i=J("context");return y.jsxs(o||e?cu:du,{...n,context:i,children:[t&&y.jsx(su,{children:y.jsx($s,{showTopList:!0})}),y.jsxs(o||e?ru:iu,{children:[y.jsx(nu,{}),y.jsx($s,{}),y.jsx(ou,{})]})]})}),{Component:lu,useEmitter:Pi,useEmitterValue:J,usePublisher:nt}=js($c,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},au),du=Js({useEmitter:Pi,useEmitterValue:J,usePublisher:nt}),cu=Zs({useEmitter:Pi,useEmitterValue:J,usePublisher:nt}),uu=lu;ye(Ps,le(()=>{const n=I(f=>y.jsxs("td",{children:["Item $",f]})),e=I(null),t=I(f=>y.jsxs("td",{colSpan:1e3,children:["Group ",f]})),o=I(null),i=I(null),r=I({}),s=I(Ui),a=I(hn),c=(f,m=null)=>ze(D(r,U(h=>h[f]),xe()),m);return{components:r,computeItemKey:s,context:e,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:i,fixedHeaderContent:o,itemContent:n,groupContent:t,ScrollerComponent:c("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder"),TableBodyComponent:c("TableBody","tbody"),TableComponent:c("Table","table"),TableFooterComponent:c("TableFoot","tfoot"),TableHeadComponent:c("TableHead","thead"),TableRowComponent:c("TableRow","tr"),GroupComponent:c("Group","tr")}})),Fi();const qs={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},hu={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:Ks,floor:Lo,max:Zn,min:ji,round:Qs}=Math;function ea(n,e,t){return Array.from({length:e-n+1}).map((o,i)=>({data:t===null?null:t[i+n],index:i+n}))}function fu(n){return{...hu,items:n}}function Do(n,e){return n&&n.width===e.width&&n.height===e.height}function gu(n,e){return n&&n.column===e.column&&n.row===e.row}const pu=le(([{increaseViewportBy:n,listBoundary:e,overscan:t,visibleRange:o},{footerHeight:i,headerHeight:r,scrollBy:s,scrollContainerState:a,scrollTo:c,scrollTop:f,smoothScrollTargetReached:m,viewportHeight:h},b,d,{didMount:l,propsReady:g},{customScrollParent:u,useWindowScroll:p,windowScrollContainerState:_,windowScrollTo:v,windowViewportRect:S},x])=>{const E=I(0),T=I(0),w=I(qs),C=I({height:0,width:0}),O=I({height:0,width:0}),L=ie(),R=ie(),F=I(0),k=I(null),B=I({column:0,row:0}),Y=ie(),j=ie(),z=I(!1),V=I(0),ae=I(!0),N=I(!1),W=I(!1);ue(D(l,ee(V),X(([M,te])=>!!te)),()=>{Q(ae,!1)}),ue(D(Re(l,ae,O,C,V,N),X(([M,te,fe,we,,P])=>M&&!te&&fe.height!==0&&we.height!==0&&!P)),([,,,,M])=>{Q(N,!0),Li(1,()=>{Q(L,M)}),ct(D(f),()=>{Q(e,[0,0]),Q(ae,!0)})}),H(D(j,X(M=>M!=null&&M.scrollTop>0),ft(0)),T),ue(D(l,ee(j),X(([,M])=>M!=null)),([,M])=>{M&&(Q(C,M.viewport),Q(O,M.item),Q(B,M.gap),M.scrollTop>0&&(Q(z,!0),ct(D(f,Qt(1)),te=>{Q(z,!1)}),Q(c,{top:M.scrollTop})))}),H(D(C,U(({height:M})=>M)),h),H(D(Re(G(C,Do),G(O,Do),G(B,(M,te)=>M&&M.column===te.column&&M.row===te.row),G(f)),U(([M,te,fe,we])=>({gap:fe,item:te,scrollTop:we,viewport:M}))),Y),H(D(Re(G(E),o,G(B,gu),G(O,Do),G(C,Do),G(k),G(T),G(z),G(ae),G(V)),X(([,,,,,,,M])=>!M),U(([M,[te,fe],we,P,Z,de,Ae,,Oe,pe])=>{const{column:Te,row:it}=we,{height:Be,width:Yi}=P,{width:la}=Z;if(Ae===0&&(M===0||la===0))return qs;if(Yi===0){const fa=Di(pe,M),Pu=fa+Math.max(Ae-1,0);return fu(ea(fa,Pu,de))}const Io=ta(la,Yi,Te);let pn,on;Oe?te===0&&fe===0&&Ae>0?(pn=0,on=Ae-1):(pn=Io*Lo((te+it)/(Be+it)),on=Io*Ks((fe+it)/(Be+it))-1,on=ji(M-1,Zn(on,Io-1)),pn=ji(on,Zn(0,pn))):(pn=0,on=-1);const da=ea(pn,on,de),{bottom:ca,top:ua}=na(Z,we,P,da),ha=Ks(M/Io),Uu=ha*Be+(ha-1)*it-ca;return{bottom:ca,itemHeight:Be,items:da,itemWidth:Yi,offsetBottom:Uu,offsetTop:ua,top:ua}})),w),H(D(k,X(M=>M!==null),U(M=>M.length)),E),H(D(Re(C,O,w,B),X(([M,te,{items:fe}])=>fe.length>0&&te.height!==0&&M.height!==0),U(([M,te,{items:fe},we])=>{const{bottom:P,top:Z}=na(M,we,te,fe);return[Z,P]}),xe(jn)),e);const oe=I(!1);H(D(f,ee(oe),U(([M,te])=>te||M!==0)),oe);const he=Ke(D(Re(w,E),X(([{items:M}])=>M.length>0),ee(oe),X(([[M,te],fe])=>{const we=M.items[M.items.length-1].index===te-1;return(fe||M.bottom>0&&M.itemHeight>0&&M.offsetBottom===0&&M.items.length===te)&&we}),U(([[,M]])=>M-1),xe())),$e=Ke(D(G(w),X(({items:M})=>M.length>0&&M[0].index===0),ft(0),xe())),Je=Ke(D(G(w),ee(z),X(([{items:M},te])=>M.length>0&&!te),U(([{items:M}])=>({endIndex:M[M.length-1].index,startIndex:M[0].index})),xe(vs),St(0)));H(Je,d.scrollSeekRangeChanged),H(D(L,ee(C,O,E,B),U(([M,te,fe,we,P])=>{const Z=Rs(M),{align:de,behavior:Ae,offset:Oe}=Z;let pe=Z.index;pe==="LAST"&&(pe=we-1),pe=Zn(0,pe,ji(we-1,pe));let Te=Hi(te,P,fe,pe);return de==="end"?Te=Qs(Te-te.height+fe.height):de==="center"&&(Te=Qs(Te-te.height/2+fe.height/2)),Oe&&(Te+=Oe),{behavior:Ae,top:Te}})),c);const re=ze(D(w,U(M=>M.offsetBottom+M.bottom)),0);return H(D(S,U(M=>({height:M.visibleHeight,width:M.visibleWidth}))),C),{customScrollParent:u,data:k,deviation:F,footerHeight:i,gap:B,headerHeight:r,increaseViewportBy:n,initialItemCount:T,itemDimensions:O,overscan:t,restoreStateFrom:j,scrollBy:s,scrollContainerState:a,scrollHeight:R,scrollTo:c,scrollToIndex:L,scrollTop:f,smoothScrollTargetReached:m,totalCount:E,useWindowScroll:p,viewportDimensions:C,windowScrollContainerState:_,windowScrollTo:v,windowViewportRect:S,...d,gridState:w,horizontalDirection:W,initialTopMostItemIndex:V,totalListHeight:re,...b,endReached:he,propsReady:g,rangeChanged:Je,startReached:$e,stateChanged:Y,stateRestoreInProgress:z,...x}},ye(Ii,je,Vn,Fs,Wt,Mi,jt));function ta(n,e,t){return Zn(1,Lo((n+t)/(Lo(e)+t)))}function na(n,e,t,o){const{height:i}=t;if(i===void 0||o.length===0)return{bottom:0,top:0};const r=Hi(n,e,t,o[0].index);return{bottom:Hi(n,e,t,o[o.length-1].index)+i,top:r}}function Hi(n,e,t,o){const i=ta(n.width,t.width,e.column),r=Lo(o/i),s=r*t.height+Zn(0,r-1)*e.row;return s>0?s+e.row:s}const mu=le(()=>{const n=I(h=>`Item ${h}`),e=I({}),t=I(null),o=I("virtuoso-grid-item"),i=I("virtuoso-grid-list"),r=I(Ui),s=I("div"),a=I(hn),c=(h,b=null)=>ze(D(e,U(d=>d[h]),xe()),b),f=I(!1),m=I(!1);return H(G(m),f),{components:e,computeItemKey:r,context:t,FooterComponent:c("Footer"),HeaderComponent:c("Header"),headerFooterTag:s,itemClassName:o,ItemComponent:c("Item","div"),itemContent:n,listClassName:i,ListComponent:c("List","div"),readyStateChanged:f,reportReadyState:m,ScrollerComponent:c("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),_u=le(([n,e])=>({...n,...e}),ye(pu,mu)),bu=A.memo(function(){const n=Se("gridState"),e=Se("listClassName"),t=Se("itemClassName"),o=Se("itemContent"),i=Se("computeItemKey"),r=Se("isSeeking"),s=ot("scrollHeight"),a=Se("ItemComponent"),c=Se("ListComponent"),f=Se("ScrollSeekPlaceholder"),m=Se("context"),h=ot("itemDimensions"),b=ot("gap"),d=Se("log"),l=Se("stateRestoreInProgress"),g=ot("reportReadyState"),u=en(A.useMemo(()=>p=>{const _=p.parentElement.parentElement.scrollHeight;s(_);const v=p.firstChild;if(v){const{height:S,width:x}=v.getBoundingClientRect();h({height:S,width:x})}b({column:ia("column-gap",getComputedStyle(p).columnGap,d),row:ia("row-gap",getComputedStyle(p).rowGap,d)})},[s,h,b,d]),!0,!1);return Ys(()=>{n.itemHeight>0&&n.itemWidth>0&&g(!0)},[n]),l?null:y.jsx(c,{className:e,ref:u,...Fe(c,m),"data-testid":"virtuoso-item-list",style:{paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},children:n.items.map(p=>{const _=i(p.index,p.data,m);return r?y.jsx(f,{...Fe(f,m),height:n.itemHeight,index:p.index,width:n.itemWidth},_):A.createElement(a,{...Fe(a,m),className:t,"data-index":p.index,key:_},o(p.index,p.data,m))})})}),Tu=A.memo(function(){const n=Se("HeaderComponent"),e=ot("headerHeight"),t=Se("headerFooterTag"),o=en(A.useMemo(()=>r=>{e(Ht(r,"height"))},[e]),!0,!1),i=Se("context");return n?y.jsx(t,{ref:o,children:y.jsx(n,{...Fe(n,i)})}):null}),vu=A.memo(function(){const n=Se("FooterComponent"),e=ot("footerHeight"),t=Se("headerFooterTag"),o=en(A.useMemo(()=>r=>{e(Ht(r,"height"))},[e]),!0,!1),i=Se("context");return n?y.jsx(t,{ref:o,children:y.jsx(n,{...Fe(n,i)})}):null}),yu=({children:n})=>{const e=A.useContext(Ws),t=ot("itemDimensions"),o=ot("viewportDimensions"),i=en(A.useMemo(()=>r=>{o(r.getBoundingClientRect())},[o]),!0,!1);return A.useEffect(()=>{e&&(o({height:e.viewportHeight,width:e.viewportWidth}),t({height:e.itemHeight,width:e.itemWidth}))},[e,o,t]),y.jsx("div",{ref:i,style:Co(!1),children:n})},xu=({children:n})=>{const e=A.useContext(Ws),t=ot("windowViewportRect"),o=ot("itemDimensions"),i=Se("customScrollParent"),r=fs(t,i,!1);return A.useEffect(()=>{e&&(o({height:e.itemHeight,width:e.itemWidth}),t({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:e.viewportWidth}))},[e,t,o]),y.jsx("div",{ref:r,style:Co(!1),children:n})},Eu=A.memo(function({...n}){const e=Se("useWindowScroll"),t=Se("customScrollParent"),o=t||e?wu:Su,i=t||e?xu:yu,r=Se("context");return y.jsx(o,{...n,...Fe(o,r),children:y.jsxs(i,{children:[y.jsx(Tu,{}),y.jsx(bu,{}),y.jsx(vu,{})]})})}),{useEmitter:oa,useEmitterValue:Se,usePublisher:ot}=js(_u,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},Eu),Su=Js({useEmitter:oa,useEmitterValue:Se,usePublisher:ot}),wu=Zs({useEmitter:oa,useEmitterValue:Se,usePublisher:ot});function ia(n,e,t){return e!=="normal"&&!(e!=null&&e.endsWith("px"))&&t(`${n} was not resolved to pixel value correctly`,e,Ve.WARN),e==="normal"?0:parseInt(e??"0",10)}const Ru=({x:n,y:e,items:t,onClose:o})=>{const i=A.useRef(null);return A.useEffect(()=>{const r=s=>{i.current&&!i.current.contains(s.target)&&o()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[o]),y.jsx("div",{ref:i,className:"fixed z-[1000] min-w-[160px] bg-popover text-popover-foreground border shadow-md rounded-md py-1 animate-in fade-in zoom-in-95 duration-100",style:{top:e,left:n},children:t.map((r,s)=>y.jsxs(A.Fragment,{children:[r.divider&&y.jsx("div",{className:"h-[1px] bg-border my-1"}),y.jsxs("div",{className:"px-3 py-1.5 hover:bg-accent hover:text-accent-foreground cursor-pointer text-xs flex items-center",onClick:()=>{r.onClick(),o()},children:[r.icon&&y.jsx("span",{className:"mr-2 opacity-70",children:r.icon}),y.jsx("span",{children:r.label})]})]},s))})};function Au(...n){return Kt(qt(n))}const ra=({data:n,onMoveNode:e,onNewFile:t,onNewFolder:o,onRename:i,onDelete:r})=>{const[s,a]=A.useState(b(n)),[c,f]=A.useState(null),[m,h]=A.useState(null);A.useEffect(()=>{a(b(n))},[n]);function b(S,x=0){return S.reduce((E,T)=>{const w={...T,level:x};return E.push(w),w.isOpen&&w.children&&E.push(...b(w.children,x+1)),E},[])}const d=S=>{const x=E=>E.map(T=>T.id===S?{...T,isOpen:!T.isOpen}:T.children?{...T,children:x(T.children)}:T);a(b(x(n)))},l=(S,x)=>{S.dataTransfer.setData("text/plain",x),S.dataTransfer.effectAllowed="move"},g=(S,x,E)=>{S.preventDefault(),E==="folder"&&h(x)},u=()=>{h(null)},p=(S,x,E)=>{S.preventDefault(),h(null);const T=S.dataTransfer.getData("text/plain");T&&T!==x&&E==="folder"&&e&&e(T,x)},_=(S,x)=>{S.preventDefault(),f({x:S.clientX,y:S.clientY,nodeId:x.id,type:x.type})},v=[{label:"New File",icon:y.jsx(rd,{size:14}),onClick:()=>c&&(t==null?void 0:t(c.nodeId))},{label:"New Folder",icon:y.jsx(ql,{size:14}),onClick:()=>c&&(o==null?void 0:o(c.nodeId))},{label:"Rename",icon:y.jsx(ld,{size:14}),divider:!0,onClick:()=>c&&(i==null?void 0:i(c.nodeId))},{label:"Delete",icon:y.jsx(cd,{size:14,className:"text-destructive"}),onClick:()=>c&&(r==null?void 0:r(c.nodeId))}];return y.jsxs("div",{className:"h-full w-full bg-muted/30",children:[y.jsx(uu,{style:{height:"100%"},totalCount:s.length,itemContent:S=>{const x=s[S];return y.jsxs("div",{draggable:!0,onDragStart:E=>l(E,x.id),onDragOver:E=>g(E,x.id,x.type),onDragLeave:u,onDrop:E=>p(E,x.id,x.type),className:Au("flex items-center py-1 px-2 cursor-pointer hover:bg-accent hover:text-accent-foreground select-none text-xs","transition-colors duration-150 relative",m===x.id&&"bg-primary/20 ring-1 ring-primary/50 rounded-sm"),style:{paddingLeft:`${(x.level||0)*12+8}px`},onClick:()=>x.type==="folder"&&d(x.id),onContextMenu:E=>_(E,x),children:[y.jsx("div",{className:"w-4 h-4 mr-1 flex items-center justify-center",children:x.type==="folder"?x.isOpen?y.jsx(Gl,{size:14}):y.jsx(Ar,{size:14}):null}),y.jsx("div",{className:"mr-2",children:x.type==="folder"?y.jsx(Kl,{size:14,className:"text-blue-400 fill-blue-400/20"}):y.jsx(Jl,{size:14,className:"text-muted-foreground"})}),y.jsx("span",{className:"truncate",children:x.label})]})}}),c&&y.jsx(Ru,{x:c.x,y:c.y,items:v,onClose:()=>f(null)})]})};function sa(...n){return Kt(qt(n))}const Ou=({placeholder:n="Search...",onSearch:e,results:t,onSelect:o,suggestions:i=[],loading:r=!1,className:s})=>{const[a,c]=A.useState(""),[f,m]=A.useState(!1),[h,b]=A.useState(-1),d=A.useRef(null);A.useEffect(()=>{const u=setTimeout(()=>{e(a)},300);return()=>clearTimeout(u)},[a,e]);const l=i.filter(u=>u.toLowerCase().includes(a.toLowerCase())&&u.toLowerCase()!==a.toLowerCase()),g=u=>{f&&l.length>0&&(u.key==="ArrowDown"?(u.preventDefault(),b(p=>(p+1)%l.length)):u.key==="ArrowUp"?(u.preventDefault(),b(p=>(p-1+l.length)%l.length)):u.key==="Enter"&&h>=0&&(u.preventDefault(),c(l[h]),m(!1)))};return y.jsxs("div",{ref:d,className:sa("flex flex-col h-full bg-background",s),children:[y.jsxs("div",{className:"p-3 border-b border-border/50",children:[y.jsxs("div",{className:"relative",children:[y.jsx("div",{className:"absolute left-2.5 top-2.5 text-muted-foreground",children:r?y.jsx(nd,{size:14,className:"animate-spin"}):y.jsx(si,{size:14})}),y.jsx("input",{type:"text",className:"w-full bg-muted/50 border rounded-md pl-9 pr-8 py-1.5 text-xs outline-none focus:ring-1 focus:ring-primary focus:border-primary transition-all",placeholder:n,value:a,onChange:u=>{c(u.target.value),m(!0),b(-1)},onKeyDown:g,onFocus:()=>m(!0)}),a&&y.jsx("button",{onClick:()=>{c(""),e("")},className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",children:y.jsx(bo,{size:14})})]}),f&&l.length>0&&y.jsx("div",{className:"absolute left-3 right-3 mt-1 bg-popover border shadow-lg rounded-md z-50 py-1 overflow-hidden",children:l.map((u,p)=>y.jsxs("div",{className:sa("px-3 py-1.5 text-xs cursor-pointer flex items-center space-x-2",p===h?"bg-accent text-accent-foreground":"hover:bg-accent/50"),onClick:()=>{c(u),m(!1)},children:[y.jsx($l,{size:12,className:"text-muted-foreground"}),y.jsx("span",{children:u})]},u))})]}),y.jsx("div",{className:"flex-1 overflow-y-auto",children:t.length===0?y.jsx("div",{className:"p-8 text-center text-xs text-muted-foreground italic",children:a?`No results found for "${a}"`:"Type to start searching..."}):y.jsx("div",{className:"py-2",children:t.map(u=>{const p=u.icon;return y.jsx("div",{onClick:()=>o(u),className:"px-4 py-2 hover:bg-accent/50 cursor-pointer group transition-colors border-l-2 border-transparent hover:border-primary",children:y.jsxs("div",{className:"flex items-start space-x-3",children:[p&&y.jsx("div",{className:"mt-0.5 p-1 rounded bg-muted group-hover:bg-background transition-colors",children:y.jsx(p,{size:14,className:"text-muted-foreground group-hover:text-primary"})}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("span",{className:"text-xs font-medium truncate",children:u.title}),u.category&&y.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-bold px-1.5 py-0.5 bg-muted rounded",children:u.category})]}),u.description&&y.jsx("p",{className:"text-[11px] text-muted-foreground truncate mt-0.5",children:u.description})]})]})},u.id)})})})]})};function aa(...n){return Kt(qt(n))}const Nu=({commands:n,forcedOpen:e=!1})=>{const[t,o]=A.useState(e),[i,r]=A.useState(""),[s,a]=A.useState(0),c=A.useRef(null),f=(n||ht.getCommands()).filter(b=>b.label.toLowerCase().includes(i.toLowerCase())||b.id.toLowerCase().includes(i.toLowerCase()));A.useEffect(()=>{o(e)},[e]),A.useEffect(()=>{const b=d=>{(d.metaKey||d.ctrlKey)&&d.shiftKey&&d.key.toLowerCase()==="p"?(d.preventDefault(),o(l=>!l),r(""),a(0)):d.key==="Escape"&&o(!1)};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[]),A.useEffect(()=>{var b;t&&((b=c.current)==null||b.focus())},[t]);const m=b=>{b.key==="ArrowDown"?(b.preventDefault(),a(d=>(d+1)%f.length)):b.key==="ArrowUp"?(b.preventDefault(),a(d=>(d-1+f.length)%f.length)):b.key==="Enter"&&(b.preventDefault(),f[s]&&h(f[s]))},h=b=>{b.execute(),e||o(!1)};return t?y.jsx("div",{className:aa("z-[100] flex items-start justify-center pt-[10vh]",e?"relative pt-0 w-full max-w-xl":"fixed inset-0 bg-black/50 backdrop-blur-sm"),children:y.jsxs("div",{className:"w-full max-w-xl bg-popover text-popover-foreground border shadow-2xl rounded-xl overflow-hidden animate-in fade-in zoom-in duration-200",children:[y.jsxs("div",{className:"flex items-center px-4 border-b",children:[y.jsx(si,{size:18,className:"text-muted-foreground mr-3"}),y.jsx("input",{ref:c,type:"text",placeholder:"Type a command to run...",className:"flex-1 h-12 bg-transparent outline-none text-sm",value:i,onChange:b=>{r(b.target.value),a(0)},onKeyDown:m})]}),y.jsx("div",{className:"max-h-[300px] overflow-y-auto py-2",children:f.length===0?y.jsxs("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:['No commands found matching "',i,'"']}):f.map((b,d)=>y.jsxs("div",{className:aa("px-4 py-2 cursor-pointer flex justify-between items-center text-sm",d===s?"bg-accent text-accent-foreground":"hover:bg-accent/50"),onClick:()=>h(b),onMouseEnter:()=>a(d),children:[y.jsx("span",{children:b.label}),b.keybinding&&y.jsx("span",{className:"text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded border border-border/50",children:b.keybinding})]},b.id))}),y.jsxs("div",{className:"px-4 py-2 border-t bg-muted/30 flex justify-between items-center text-[10px] text-muted-foreground",children:[y.jsxs("div",{className:"flex gap-3",children:[y.jsxs("span",{children:[y.jsx("kbd",{className:"bg-muted px-1 rounded border",children:"↑↓"})," to navigate"]}),y.jsxs("span",{children:[y.jsx("kbd",{className:"bg-muted px-1 rounded border",children:"Enter"})," to select"]})]}),y.jsxs("span",{children:[y.jsx("kbd",{className:"bg-muted px-1 rounded border",children:"Esc"})," to close"]})]})]})}):null};function Cu(...n){return Kt(qt(n))}const Lu=({name:n,avatarUrl:e,role:t,onClick:o,className:i,showName:r=!0})=>y.jsxs("div",{onClick:o,className:Cu("flex items-center space-x-2 px-2 py-1 rounded hover:bg-accent hover:text-accent-foreground cursor-pointer transition-colors select-none",i),children:[y.jsx("div",{className:"relative w-6 h-6 rounded-full overflow-hidden border border-border/50 bg-muted flex items-center justify-center shrink-0",children:e?y.jsx("img",{src:e,alt:n,className:"w-full h-full object-cover"}):y.jsx(Nr,{size:14,className:"text-muted-foreground"})}),r&&y.jsxs("div",{className:"flex flex-col min-w-0 leading-tight",children:[y.jsx("span",{className:"text-[11px] font-semibold truncate",children:n}),t&&y.jsx("span",{className:"text-[9px] text-muted-foreground truncate",children:t})]})]});class Du{constructor(){mn(this,"plugins",new Map);mn(this,"loaders",new Map)}registerPlugin(e){if(this.plugins.has(e.id)){console.warn(`Plugin ${e.id} is already registered.`);return}this.plugins.set(e.id,e),console.log(`Plugin ${e.name} (${e.id}) registered.`)}registerLazyPlugin(e,t){if(this.loaders.has(e)||this.plugins.has(e)){console.warn(`Plugin ${e} is already registered or has a loader.`);return}this.loaders.set(e,t),console.log(`Lazy plugin loader for ${e} registered.`)}async activatePlugin(e){let t=this.plugins.get(e);if(!t&&this.loaders.has(e))try{t=await this.loaders.get(e)(),this.plugins.set(e,t),console.log(`Lazy plugin ${e} loaded.`)}catch(o){console.error(`Failed to load lazy plugin ${e}`,o);return}if(t)try{t.activate(),console.log(`Plugin ${t.name} activated.`)}catch(o){console.error(`Failed to activate plugin ${e}`,o)}else console.warn(`Plugin ${e} not found for activation.`)}getPlugin(e){return this.plugins.get(e)}getAllPlugins(){return Array.from(this.plugins.values())}}const Wi=new Du,Iu={id:"plugin-example",name:"Example Plugin",activate:()=>{ht.registerCommand({id:"plugin.hello",label:"Plugin Hello",execute:()=>{alert("Hello from Example Plugin!")}}),Jt.registerMenu("View",{id:"view.greet",label:"Greet from Plugin",commandId:"plugin.hello"}),console.log("Example Plugin Activated")},deactivate:()=>{console.log("Example Plugin Deactivated")}},Bu=[{id:"src",label:"src",type:"folder",isOpen:!0,children:[{id:"core",label:"core",type:"folder",isOpen:!0,children:[{id:"boot",label:"Boot.ts",type:"file"},{id:"registry",label:"registry",type:"folder"}]},{id:"components",label:"components",type:"folder",children:[{id:"layout",label:"layout",type:"folder"},{id:"widgets",label:"widgets",type:"folder"}]},{id:"app",label:"App.tsx",type:"file"},{id:"main",label:"main.tsx",type:"file"}]},{id:"package",label:"package.json",type:"file"},{id:"readme",label:"README.md",type:"file"}],Mu=()=>y.jsx(ra,{data:Bu,onNewFile:n=>window.prompt("New File Name:"),onNewFolder:n=>window.prompt("New Folder Name:"),onRename:n=>window.prompt("New Name:"),onDelete:n=>window.confirm("Delete this item?")}),ku=async()=>{vo.getState().setWidgets([{id:"git-branch",label:"main",icon:Ql,alignment:"left",priority:100},{id:"notifications",label:"0",icon:Xl,alignment:"left",priority:90},{id:"status-text",label:"Ready",alignment:"right",priority:10},{id:"terminal-toggle",label:"Terminal",icon:_o,alignment:"right",onClick:()=>bi.getState().toggle(),priority:110},{id:"chat-toggle",label:"Chat",icon:Or,alignment:"right",commandId:"nexus.toggle-chat",priority:100},{id:"line-col",label:"Ln 1, Col 1",alignment:"right",priority:50},{id:"encoding",label:"UTF-8",alignment:"right",priority:40}]),Fn.getState().setPanels([{id:"files",label:"Explorer",icon:Zl,component:Mu},{id:"search",label:"Search",icon:si,component:()=>y.jsx("div",{className:"p-4 text-sm italic text-muted-foreground",children:"Search functionality coming soon..."})},{id:"git",label:"Source Control",icon:ed,component:()=>y.jsx("div",{className:"p-4 text-sm italic text-muted-foreground",children:"Source control integration pending..."})},{id:"plugins",label:"Extensions",icon:id,component:()=>y.jsx("div",{className:"p-4 text-sm italic text-muted-foreground",children:"Extension manager view..."})}]),xo.getState().setSlashCommands([{command:"help",description:"Show available commands",execute:()=>alert("Available commands: /help, /clear, /theme [light|dark|gt]")},{command:"clear",description:"Clear chat history",execute:()=>{console.log("Chat clear triggered")}},{command:"theme",description:"Change the application theme",execute:n=>{const e=n[0];["light","dark","gt"].includes(e)?yo.getState().setTheme(e):alert("Usage: /theme [light|dark|gt]")}}]),ht.registerCommand({id:"nexus.new-tab",label:"New Welcome Tab",keybinding:"Control+N",execute:()=>Ti.getState().addTab("welcome","Welcome")}),ht.registerCommand({id:"nexus.toggle-chat",label:"Toggle Chat Pane",keybinding:"Control+I",execute:()=>mi.getState().toggleChat()}),ht.registerCommand({id:"nexus.about",label:"About Nexus Shell",keybinding:"Control+H",execute:()=>alert(`Nexus-Shell Framework v0.1.0
|
|
210
|
+
Professional-grade Workbench UI`)}),Jt.registerMenu("File",{id:"file.new-tab",label:"New Welcome Tab",commandId:"nexus.new-tab"}),Jt.registerMenu("Help",{id:"help.about",label:"About",commandId:"nexus.about"}),Wi.registerLazyPlugin("plugin-example",async()=>Iu),await Wi.activatePlugin("plugin-example"),console.log("Nexus Shell Core Initialized")},zu=()=>{A.useEffect(()=>{const n=e=>{const t=ht.getCommands();for(const o of t)if(o.keybinding&&Fu(e,o.keybinding)){e.preventDefault(),o.execute();break}};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[])};function Fu(n,e){var b;const t=e.split("+"),o=(b=t.pop())==null?void 0:b.toLowerCase(),i=t.includes("Control")||t.includes("Ctrl"),r=t.includes("Shift"),s=t.includes("Alt"),a=t.includes("Meta")||t.includes("Cmd"),c=n.ctrlKey,f=n.shiftKey,m=n.altKey,h=n.metaKey;return n.key.toLowerCase()===o&&c===i&&f===r&&m===s&&h===a}ne.ActivityBar=qr,ne.ChatPane=ts,ne.CommandPalette=Nu,ne.MenuBar=Cr,ne.SearchWidget=Ou,ne.ShellLayout=tc,ne.SidebarPane=es,ne.StatusBar=Jr,ne.TerminalPane=ns,ne.TreeWidget=ra,ne.UserProfile=Lu,ne.commandRegistry=ht,ne.componentRegistry=rs,ne.initializeShell=ku,ne.menuRegistry=Jt,ne.pluginRegistry=Wi,ne.useChatStore=xo,ne.useKeyboardShortcuts=zu,ne.useLayoutStore=Ti,ne.useRightSidebarStore=mi,ne.useSidebarStore=Fn,ne.useStatusBarStore=vo,ne.useTerminalStore=bi,ne.useThemeStore=yo,Object.defineProperty(ne,Symbol.toStringTag,{value:"Module"})});
|