ui-layout-manager-dev 0.0.11 → 0.0.13
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/cjs/index.js +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/Worker/LayoutWorker.js +25 -14
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/package.json +3 -2
- package/src/components/LayoutManager/Components/Container/Container.scss +0 -12
- package/src/components/LayoutManager/Components/HandleBar/HandleBar.jsx +22 -3
- package/src/components/LayoutManager/Components/HandleBar/HandleBar.scss +1 -0
- package/src/components/LayoutManager/Components/RootContainer/RootContainer.jsx +71 -14
- package/src/components/LayoutManager/Components/RootContainer/RootContainer.scss +6 -0
- package/src/components/LayoutManager/Controller/Worker/HandleRulesEnforcer.js +23 -12
- package/src/components/LayoutManager/Controller/Worker/LayoutEditor.js +2 -2
- package/src/components/LayoutManager/LayoutManager.jsx +9 -5
- package/src/components/LayoutManager/Providers/DragProvider.js +87 -0
- package/src/stories/LayoutManager.stories.js +14 -2
- package/src/stories/layouts/vsCode/default.json +2 -2
- package/src/stories/layouts/vsCode/sample1.json +93 -154
- package/src/stories/layouts/vsCode/workbench.json +144 -0
- package/src/stories/sample_components/fileeditor/FileEditor.jsx +48 -0
- package/src/stories/sample_components/fileeditor/workspace_sample.json +1 -0
- package/src/stories/sample_components/filetree/FileTree.jsx +26 -0
- package/src/stories/sample_components/filetree/workspace_sample.json +1 -0
- package/src/stories/sample_components/map/MapSample.jsx +1 -1
- package/src/stories/sample_components/editor/EditorVSCode.jsx +0 -11
- package/src/stories/sample_components/editor/filetree.json +0 -1
|
@@ -108,6 +108,9 @@ class ParentRuleEnforcer {
|
|
|
108
108
|
* So rather than fully collapsing the container, it sets up a
|
|
109
109
|
* minimum size, this willl be useful for accordians and other containers.
|
|
110
110
|
*/
|
|
111
|
+
|
|
112
|
+
const COLLAPSE_THRESHOLD_PX = 50;
|
|
113
|
+
|
|
111
114
|
class HandleRulesEnforcer {
|
|
112
115
|
/**
|
|
113
116
|
* Initialize the child rule enforcer.
|
|
@@ -166,11 +169,13 @@ class HandleRulesEnforcer {
|
|
|
166
169
|
return;
|
|
167
170
|
}
|
|
168
171
|
|
|
169
|
-
|
|
172
|
+
// Hide and unhide containers from left of container.
|
|
173
|
+
if (this.handleMetadata.handle.x < COLLAPSE_THRESHOLD_PX) {
|
|
174
|
+
// Handle is less than collapse threshold from the left
|
|
170
175
|
this.args = {style: {"display":"none", "min-width":0}};
|
|
171
176
|
this.sibling1.hidden = true;
|
|
172
177
|
this.activeSibling = this.sibling1.id;
|
|
173
|
-
} else if (this.handleMetadata.handle.x >
|
|
178
|
+
} else if (this.handleMetadata.handle.x > COLLAPSE_THRESHOLD_PX && this.sibling1.hidden) {
|
|
174
179
|
this.args = {style: {"display":"flex"}};
|
|
175
180
|
const sibling = this.getSiblingProps(this.sibling1.id);
|
|
176
181
|
if ("min" in sibling.size) {
|
|
@@ -178,14 +183,15 @@ class HandleRulesEnforcer {
|
|
|
178
183
|
}
|
|
179
184
|
this.sibling1.hidden = false;
|
|
180
185
|
this.activeSibling = this.sibling1.id;
|
|
181
|
-
}
|
|
182
|
-
|
|
186
|
+
}
|
|
183
187
|
|
|
184
|
-
|
|
188
|
+
// Hide and unhide containrs from right of container.
|
|
189
|
+
if (this.handleMetadata.handle.x > totalWidth - COLLAPSE_THRESHOLD_PX) {
|
|
190
|
+
// Handle is greater than collapse threshold from right, so unhide container if it is hidden.
|
|
185
191
|
this.args = {style: {"display":"none", "min-width":0}};
|
|
186
192
|
this.sibling2.hidden = true;
|
|
187
193
|
this.activeSibling = this.sibling2.id;
|
|
188
|
-
} else if (this.handleMetadata.handle.x < totalWidth -
|
|
194
|
+
} else if (this.handleMetadata.handle.x < totalWidth - COLLAPSE_THRESHOLD_PX && this.sibling2.hidden) {
|
|
189
195
|
this.args = {style: {"display":"flex"}};
|
|
190
196
|
const sibling = this.getSiblingProps(this.sibling2.id);
|
|
191
197
|
if ("min" in sibling.size) {
|
|
@@ -198,7 +204,7 @@ class HandleRulesEnforcer {
|
|
|
198
204
|
|
|
199
205
|
|
|
200
206
|
/**
|
|
201
|
-
* Process the
|
|
207
|
+
* Process the horizontal containers.
|
|
202
208
|
*/
|
|
203
209
|
processHorizontalContainers () {
|
|
204
210
|
const totalHeight = this.handleMetadata.sizes[this.parent.id].height;
|
|
@@ -210,11 +216,14 @@ class HandleRulesEnforcer {
|
|
|
210
216
|
return;
|
|
211
217
|
}
|
|
212
218
|
|
|
213
|
-
|
|
219
|
+
// Hide and unhide containers from top of container.
|
|
220
|
+
if (this.handleMetadata.handle.y < COLLAPSE_THRESHOLD_PX) {
|
|
221
|
+
// Handle is less than collapse threshold from the top
|
|
214
222
|
this.args = {style: {"display":"none", "min-height":0}};
|
|
215
223
|
this.sibling1.hidden = true;
|
|
216
224
|
this.activeSibling = this.sibling1.id;
|
|
217
|
-
} else if (this.handleMetadata.handle.y >
|
|
225
|
+
} else if (this.handleMetadata.handle.y > COLLAPSE_THRESHOLD_PX && this.sibling1.hidden) {
|
|
226
|
+
// Handle is greater than collapse threshold from top, so unhide container if it is hidden.
|
|
218
227
|
this.args = {style: {"display":"flex"}};
|
|
219
228
|
const sibling = this.getSiblingProps(this.sibling1.id);
|
|
220
229
|
if ("min" in sibling.size) {
|
|
@@ -224,12 +233,14 @@ class HandleRulesEnforcer {
|
|
|
224
233
|
this.activeSibling = this.sibling1.id;
|
|
225
234
|
}
|
|
226
235
|
|
|
227
|
-
|
|
228
|
-
if (this.handleMetadata.handle.y > totalHeight -
|
|
236
|
+
// Hide and unhide containrs from bottom of container.
|
|
237
|
+
if (this.handleMetadata.handle.y > totalHeight - COLLAPSE_THRESHOLD_PX) {
|
|
238
|
+
// Handle is less than collapse threshold from the bottom
|
|
229
239
|
this.args = {style: {"display":"none", "min-height":0}};
|
|
230
240
|
this.sibling2.hidden = true;
|
|
231
241
|
this.activeSibling = this.sibling2.id;
|
|
232
|
-
} else if (this.handleMetadata.handle.y < totalHeight -
|
|
242
|
+
} else if (this.handleMetadata.handle.y < totalHeight - COLLAPSE_THRESHOLD_PX && this.sibling2.hidden) {
|
|
243
|
+
// Handle is greater than collapse threshold from bottom, so unhide container if it is hidden.
|
|
233
244
|
this.args = {style: {"display":"flex"}};
|
|
234
245
|
const sibling = this.getSiblingProps(this.sibling2.id);
|
|
235
246
|
if ("min" in sibling.size) {
|
|
@@ -347,7 +358,7 @@ class LayoutEditor {
|
|
|
347
358
|
childStyle["flex"] = "0 0 auto";
|
|
348
359
|
break;
|
|
349
360
|
case "fill":
|
|
350
|
-
childStyle["
|
|
361
|
+
childStyle["flex-grow"] = 1;
|
|
351
362
|
break;
|
|
352
363
|
default:
|
|
353
364
|
throw new Error(`Unknown size type "${child.size.initial.type}" in LDF configuration`);
|
|
@@ -426,7 +437,7 @@ class LayoutEditor {
|
|
|
426
437
|
const parent = this.ldf.containers[containerId];
|
|
427
438
|
|
|
428
439
|
// If node is not split, then it has no children and is a leaf node, so we return.
|
|
429
|
-
if (
|
|
440
|
+
if (parent.type !== "split" || !("children" in parent)) {
|
|
430
441
|
return;
|
|
431
442
|
}
|
|
432
443
|
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e,{useMemo as n,useEffect as
|
|
1
|
+
import e,{useMemo as n,useEffect as t,createContext as r,useContext as o,useRef as i,lazy as a,Suspense as l,useState as c,useCallback as s,useLayoutEffect as u,memo as d,useReducer as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";import{unstable_batchedUpdates as h,createPortal as g}from"react-dom";function y(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var b,m={exports:{}},w={exports:{}},x={};var E,D,S,C,O,R,T,k,N,A,L,I,P,j,M,z={};
|
|
2
2
|
/** @license React v16.13.1
|
|
3
3
|
* react-is.development.js
|
|
4
4
|
*
|
|
@@ -6,10 +6,10 @@ import e,{useMemo as n,useEffect as r,createContext as t,useContext as o,useRef
|
|
|
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
|
-
*/function
|
|
9
|
+
*/function B(){return D||(D=1,"production"===process.env.NODE_ENV?w.exports=function(){if(b)return x;b=1;var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,m=e?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case n:switch(e=e.type){case c:case s:case r:case i:case o:case d:return e;default:switch(e=e&&e.$$typeof){case l:case u:case v:case p:case a:return e;default:return f}}case t:return f}}}function E(e){return w(e)===s}return x.AsyncMode=c,x.ConcurrentMode=s,x.ContextConsumer=l,x.ContextProvider=a,x.Element=n,x.ForwardRef=u,x.Fragment=r,x.Lazy=v,x.Memo=p,x.Portal=t,x.Profiler=i,x.StrictMode=o,x.Suspense=d,x.isAsyncMode=function(e){return E(e)||w(e)===c},x.isConcurrentMode=E,x.isContextConsumer=function(e){return w(e)===l},x.isContextProvider=function(e){return w(e)===a},x.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},x.isForwardRef=function(e){return w(e)===u},x.isFragment=function(e){return w(e)===r},x.isLazy=function(e){return w(e)===v},x.isMemo=function(e){return w(e)===p},x.isPortal=function(e){return w(e)===t},x.isProfiler=function(e){return w(e)===i},x.isStrictMode=function(e){return w(e)===o},x.isSuspense=function(e){return w(e)===d},x.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===s||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===p||e.$$typeof===a||e.$$typeof===l||e.$$typeof===u||e.$$typeof===g||e.$$typeof===y||e.$$typeof===m||e.$$typeof===h)},x.typeOf=w,x}():w.exports=(E||(E=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function m(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case n:var h=e.type;switch(h){case c:case s:case r:case i:case o:case d:return h;default:var g=h&&h.$$typeof;switch(g){case l:case u:case v:case p:case a:return g;default:return f}}case t:return f}}}var w=c,x=s,E=l,D=a,S=n,C=u,O=r,R=v,T=p,k=t,N=i,A=o,L=d,I=!1;function P(e){return m(e)===s}z.AsyncMode=w,z.ConcurrentMode=x,z.ContextConsumer=E,z.ContextProvider=D,z.Element=S,z.ForwardRef=C,z.Fragment=O,z.Lazy=R,z.Memo=T,z.Portal=k,z.Profiler=N,z.StrictMode=A,z.Suspense=L,z.isAsyncMode=function(e){return I||(I=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),P(e)||m(e)===c},z.isConcurrentMode=P,z.isContextConsumer=function(e){return m(e)===l},z.isContextProvider=function(e){return m(e)===a},z.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},z.isForwardRef=function(e){return m(e)===u},z.isFragment=function(e){return m(e)===r},z.isLazy=function(e){return m(e)===v},z.isMemo=function(e){return m(e)===p},z.isPortal=function(e){return m(e)===t},z.isProfiler=function(e){return m(e)===i},z.isStrictMode=function(e){return m(e)===o},z.isSuspense=function(e){return m(e)===d},z.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===s||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===p||e.$$typeof===a||e.$$typeof===l||e.$$typeof===u||e.$$typeof===g||e.$$typeof===y||e.$$typeof===b||e.$$typeof===h)},z.typeOf=m}()),z)),w.exports}
|
|
10
10
|
/*
|
|
11
11
|
object-assign
|
|
12
12
|
(c) Sindre Sorhus
|
|
13
13
|
@license MIT
|
|
14
|
-
*/function L(){if(w)return g;w=1;var e=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;return g=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var n={},r=0;r<10;r++)n["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(n).map(function(e){return n[e]}).join(""))return!1;var t={};return"abcdefghijklmnopqrst".split("").forEach(function(e){t[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},t)).join("")}catch(e){return!1}}()?Object.assign:function(t,o){for(var i,a,c=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(t),s=1;s<arguments.length;s++){for(var l in i=Object(arguments[s]))n.call(i,l)&&(c[l]=i[l]);if(e){a=e(i);for(var u=0;u<a.length;u++)r.call(i,a[u])&&(c[a[u]]=i[a[u]])}}return c},g}function $(){if(x)return S;x=1;return S="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function A(){return E?O:(E=1,O=Function.call.bind(Object.prototype.hasOwnProperty))}function _(){if(R)return k;R=1;var e=function(){};if("production"!==process.env.NODE_ENV){var n=$(),r={},t=A();e=function(e){var n="Warning: "+e;"undefined"!=typeof console&&console.error(n);try{throw new Error(n)}catch(e){}}}function o(o,i,a,c,s){if("production"!==process.env.NODE_ENV)for(var l in o)if(t(o,l)){var u;try{if("function"!=typeof o[l]){var f=Error((c||"React class")+": "+a+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}u=o[l](i,l,c,a,null,n)}catch(e){u=e}if(!u||u instanceof Error||e((c||"React class")+": type specification of "+a+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in r)){r[u.message]=!0;var p=s?s():"";e("Failed "+a+" type: "+u.message+(null!=p?p:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(r={})},k=o}function B(){if(C)return T;C=1;var e=z(),n=L(),r=$(),t=A(),o=_(),i=function(){};function a(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var n="Warning: "+e;"undefined"!=typeof console&&console.error(n);try{throw new Error(n)}catch(e){}}),T=function(c,s){var l="function"==typeof Symbol&&Symbol.iterator;var u="<<anonymous>>",f={array:h("array"),bigint:h("bigint"),bool:h("boolean"),func:h("function"),number:h("number"),object:h("object"),string:h("string"),symbol:h("symbol"),any:y(a),arrayOf:function(e){return y(function(n,t,o,i,a){if("function"!=typeof e)return new d("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var c=n[t];if(!Array.isArray(c))return new d("Invalid "+i+" `"+a+"` of type `"+b(c)+"` supplied to `"+o+"`, expected an array.");for(var s=0;s<c.length;s++){var l=e(c,s,o,i,a+"["+s+"]",r);if(l instanceof Error)return l}return null})},element:y(function(e,n,r,t,o){var i=e[n];return c(i)?null:new d("Invalid "+t+" `"+o+"` of type `"+b(i)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:y(function(n,r,t,o,i){var a=n[r];return e.isValidElementType(a)?null:new d("Invalid "+o+" `"+i+"` of type `"+b(a)+"` supplied to `"+t+"`, expected a single ReactElement type.")}),instanceOf:function(e){return y(function(n,r,t,o,i){if(!(n[r]instanceof e)){var a=e.name||u;return new d("Invalid "+o+" `"+i+"` of type `"+(((c=n[r]).constructor&&c.constructor.name?c.constructor.name:u)+"` supplied to `")+t+"`, expected instance of `"+a+"`.")}var c;return null})},node:y(function(e,n,r,t,o){return m(e[n])?null:new d("Invalid "+t+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")}),objectOf:function(e){return y(function(n,o,i,a,c){if("function"!=typeof e)return new d("Property `"+c+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var s=n[o],l=b(s);if("object"!==l)return new d("Invalid "+a+" `"+c+"` of type `"+l+"` supplied to `"+i+"`, expected an object.");for(var u in s)if(t(s,u)){var f=e(s,u,i,a,c+"."+u,r);if(f instanceof Error)return f}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),a;return y(function(n,r,t,o,i){for(var a=n[r],c=0;c<e.length;c++)if(p(a,e[c]))return null;var s=JSON.stringify(e,function(e,n){return"symbol"===g(n)?String(n):n});return new d("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+t+"`, expected one of "+s+".")})},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var n=0;n<e.length;n++){var o=e[n];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+w(o)+" at index "+n+"."),a}return y(function(n,o,i,a,c){for(var s=[],l=0;l<e.length;l++){var u=(0,e[l])(n,o,i,a,c,r);if(null==u)return null;u.data&&t(u.data,"expectedType")&&s.push(u.data.expectedType)}return new d("Invalid "+a+" `"+c+"` supplied to `"+i+"`"+(s.length>0?", expected one of type ["+s.join(", ")+"]":"")+".")})},shape:function(e){return y(function(n,t,o,i,a){var c=n[t],s=b(c);if("object"!==s)return new d("Invalid "+i+" `"+a+"` of type `"+s+"` supplied to `"+o+"`, expected `object`.");for(var l in e){var u=e[l];if("function"!=typeof u)return v(o,i,a,l,g(u));var f=u(c,l,o,i,a+"."+l,r);if(f)return f}return null})},exact:function(e){return y(function(o,i,a,c,s){var l=o[i],u=b(l);if("object"!==u)return new d("Invalid "+c+" `"+s+"` of type `"+u+"` supplied to `"+a+"`, expected `object`.");var f=n({},o[i],e);for(var p in f){var y=e[p];if(t(e,p)&&"function"!=typeof y)return v(a,c,s,p,g(y));if(!y)return new d("Invalid "+c+" `"+s+"` key `"+p+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=y(l,p,a,c,s+"."+p,r);if(h)return h}return null})}};function p(e,n){return e===n?0!==e||1/e==1/n:e!=e&&n!=n}function d(e,n){this.message=e,this.data=n&&"object"==typeof n?n:{},this.stack=""}function y(e){if("production"!==process.env.NODE_ENV)var n={},t=0;function o(o,a,c,l,f,p,y){if(l=l||u,p=p||c,y!==r){if(s){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var v=l+":"+c;!n[v]&&t<3&&(i("You are manually calling a React.PropTypes validation function for the `"+p+"` prop on `"+l+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),n[v]=!0,t++)}}return null==a[c]?o?null===a[c]?new d("The "+f+" `"+p+"` is marked as required in `"+l+"`, but its value is `null`."):new d("The "+f+" `"+p+"` is marked as required in `"+l+"`, but its value is `undefined`."):null:e(a,c,l,f,p)}var a=o.bind(null,!1);return a.isRequired=o.bind(null,!0),a}function h(e){return y(function(n,r,t,o,i,a){var c=n[r];return b(c)!==e?new d("Invalid "+o+" `"+i+"` of type `"+g(c)+"` supplied to `"+t+"`, expected `"+e+"`.",{expectedType:e}):null})}function v(e,n,r,t,o){return new d((e||"React class")+": "+n+" type `"+r+"."+t+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function m(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(m);if(null===e||c(e))return!0;var n=function(e){var n=e&&(l&&e[l]||e["@@iterator"]);if("function"==typeof n)return n}(e);if(!n)return!1;var r,t=n.call(e);if(n!==e.entries){for(;!(r=t.next()).done;)if(!m(r.value))return!1}else for(;!(r=t.next()).done;){var o=r.value;if(o&&!m(o[1]))return!1}return!0;default:return!1}}function b(e){var n=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,n){return"symbol"===e||!!n&&("Symbol"===n["@@toStringTag"]||"function"==typeof Symbol&&n instanceof Symbol)}(n,e)?"symbol":n}function g(e){if(null==e)return""+e;var n=b(e);if("object"===n){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return n}function w(e){var n=g(e);switch(n){case"array":case"object":return"an "+n;case"boolean":case"date":case"regexp":return"a "+n;default:return n}}return d.prototype=Error.prototype,f.checkPropTypes=o,f.resetWarningCache=o.resetWarningCache,f.PropTypes=f,f},T}function M(){if(I)return j;I=1;var e=$();function n(){}function r(){}return r.resetWarningCache=n,j=function(){function t(n,r,t,o,i,a){if(a!==e){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function o(){return t}t.isRequired=t;var i={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:o,element:t,elementType:t,instanceOf:o,node:t,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:n};return i.PropTypes=i,i}}function V(){if(P)return y.exports;if(P=1,"production"!==process.env.NODE_ENV){var e=z();y.exports=B()(e.isElement,true)}else y.exports=M()();return y.exports}var D=p(V());function W(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=Array(n);r<n;r++)t[r]=e[r];return t}function F(e,n,r){return n&&function(e,n){for(var r=0;r<n.length;r++){var t=n[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,Y(t.key),t)}}(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function H(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=U(e))||n){r&&(e=r);var t=0,o=function(){};return{s:o,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function q(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var t,o,i,a,c=[],s=!0,l=!1;try{if(i=(r=r.call(e)).next,0===n);else for(;!(s=(t=i.call(r)).done)&&(c.push(t.value),c.length!==n);s=!0);}catch(e){l=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(e,n)||U(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Y(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var t=r.call(e,n);if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof n?n:n+""}function U(e,n){if(e){if("string"==typeof e)return W(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?W(e,n):void 0}}var X={INITIALIZE:1,INITIALIZE_FLEXBOX:2,APPLY_SIZES:3,ERROR:4,TRANSFORMATIONS:5,MOVE_HANDLE_BAR:6},Z=X=Object.freeze(X),K={UPDATE_SIZE:1},J=K=Object.freeze(K),G=function(){return F(function e(n){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),this.containers={},this.containerRefs={},this.ldf=n,this.numberOfContainers=0,this.registeredContainers=0,this.layoutLoaded=!1,this.numberOfContainers=this.ldf.containers?Object.keys(this.ldf.containers).length:0,this.worker=null},[{key:"startWorker",value:function(){try{this.worker=new Worker(new URL("./Worker/LayoutWorker.js",import.meta.url),{type:"module"}),this.worker.onmessage=this.handleWorkerMessage.bind(this),this.worker.onerror=function(e){return console.error("Worker error:",e)},this.sendToWorker(Z.INITIALIZE,{ldf:this.ldf})}catch(e){console.error("Failed to create worker:",e)}}},{key:"sendToWorker",value:function(e,n){this.worker||this.startWorker(),this.worker.postMessage({code:e,args:n})}},{key:"registerContainer",value:function(e,n,r){e in this.containers||(this.registeredContainers+=1),this.containers[e]=n,this.containerRefs[e]=r,console.log("Registered container with id: ".concat(e," ")),this.registeredContainers!==this.numberOfContainers||this.layoutLoaded||(console.log("All containers registered, layout is ready."),this.sendToWorker(Z.INITIALIZE_FLEXBOX))}},{key:"unregisterContainer",value:function(e){delete this.containers[e]}},{key:"handleRootResize",value:function(){if(this.layoutLoaded){var e={};for(var n in this.containerRefs)if(this.containerRefs.hasOwnProperty(n)){var r=this.containerRefs[n].getBoundingClientRect();e[n]={width:r.width,height:r.height}}this.sendToWorker(Z.APPLY_SIZES,{sizes:e})}}},{key:"moveHandleBar",value:function(e){for(var n={},r=0,t=[e.parent,e.sibling1,e.sibling2];r<t.length;r++){var o=t[r],i=this.containerRefs[o].getBoundingClientRect();n[o]={width:i.width,height:i.height}}e.sizes=n,this.sendToWorker(Z.MOVE_HANDLE_BAR,{metadata:e}),this.handleRootResize()}},{key:"applyTransformations",value:function(e,n){var r=this;requestAnimationFrame(function(){var t,o=H(e);try{for(o.s();!(t=o.n()).done;){var i=t.value;switch(i.type){case J.UPDATE_SIZE:r.containers[i.id].current.updateStyles(i.args.style);break;case J.REMOVE_NODE:break;default:console.warn("Unknown transformation was requested.")}}}catch(e){o.e(e)}finally{o.f()}n&&(r.layoutLoaded=!0)})}},{key:"handleWorkerMessage",value:function(e){var n;switch(e.data.type){case Z.INITIALIZE_FLEXBOX:n=e.data.data,this.applyTransformations(n,!0);break;case Z.TRANSFORMATIONS:n=e.data.data,this.applyTransformations(n,!1);break;case Z.ERROR:console.error("Error from worker:",e.data)}}},{key:"destroy",value:function(){this.worker&&(this.worker.terminate(),this.worker=null)}}])}(),Q=t(null);function ee(e){var t=e.layout,o=e.children,i=n(function(){return new G(t)},[t]);return r(function(){return function(){i.destroy()}},[i]),f(Q.Provider,{value:i,children:o})}function ne(){var e=o(Q);if(!e)throw new Error("useLayoutController must be used within a LayoutControllerProvider");return e}function re(e,n){void 0===n&&(n={});var r=n.insertAt;if(e&&"undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&t.firstChild?t.insertBefore(o,t.firstChild):t.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}ee.propTypes={layout:D.object.isRequired,children:D.node.isRequired};re(".handleBarHorizontalContainer {\n position: relative;\n width: 100%;\n height: 1px;\n background-color: #414141;\n}\n\n.handleBarHorizontal {\n position: absolute;\n top: 50%;\n height: 1px;\n left: 0;\n right: 0;\n transform: translateY(-50%);\n transition: all 0.2s ease;\n}\n\n.handleBarHorizontal:hover {\n background-color: #007acc;\n cursor: ns-resize;\n height: 5px;\n z-index: 10;\n}\n\n.handleBarHorizontalHover {\n background-color: #007acc;\n cursor: ns-resize;\n height: 5px;\n z-index: 10;\n}\n\n.handleBarVerticalContainer {\n position: relative;\n height: 100%;\n width: 1px;\n background-color: #414141;\n z-index: 1;\n}\n\n.handleBarVertical {\n position: absolute;\n top: 0;\n width: 1px;\n left: 50%;\n bottom: 0;\n transform: translateX(-50%);\n transition: all 0.3s ease;\n}\n\n.handleBarVertical:hover {\n background-color: #007acc;\n cursor: ew-resize;\n width: 5px;\n z-index: 10;\n}\n\n.handleBarVerticalHover {\n background-color: #007acc;\n cursor: ew-resize;\n width: 5px;\n z-index: 10;\n}");var te=function(n){var r=n.orientation,t=n.parent,o=n.sibling1,a=n.sibling2,c=ne(),s=i(null),l=i(null),u=i(null),p=function(e){var n,i,u;e.preventDefault(),e.stopPropagation(),document.addEventListener("mousemove",d),document.addEventListener("mouseup",y),"horizontal"===r?(n="clientY",i="height",u="handleBarHorizontalHover"):"vertical"===r&&(n="clientX",i="width",u="handleBarVerticalHover");for(var f,p,h=c.containerRefs[t],v=c.containerRefs[o],m=c.containerRefs[a],b=c.ldf.containers[t],g=0;g<b.children.length;g++)b.children[g].containerId===o?f=b.children[g].size:b.children[g].containerId===a&&(p=b.children[g].size);s.current={downValueY:e[n],hoverClass:u,downKey:n,propKey:i,parentSize:h.getBoundingClientRect()[i],parentRef:h,sibling1Ref:v,sibling2Ref:m,sibling1LayoutConfig:f,sibling2LayoutConfig:p,sibling1Size:v.getBoundingClientRect()[i],sibling2Size:m.getBoundingClientRect()[i]},l.current.classList.add(u)};var d=function(e){if(s.current){e.preventDefault(),e.stopPropagation();var n=s.current,r=e[n.downKey]-n.downValueY,i=n.sibling1Size+r,l=n.sibling2Size-r;clearTimeout(u.current),u.current=setTimeout(function(){var r,i,s;c.moveHandleBar({handle:(r=e,i=n.parentRef,s=i.getBoundingClientRect(),{x:r.clientX-s.left,y:r.clientY-s.top}),parent:t,sibling1:o,sibling2:a})},.1);var f=Object.keys(n.sibling1LayoutConfig);if(!(f.includes("min")&&i<=n.sibling1LayoutConfig.min.value||f.includes("max")&&i>=n.sibling1LayoutConfig.max.value)){var p=Object.keys(n.sibling2LayoutConfig);if(!(p.includes("min")&&l<=n.sibling2LayoutConfig.min.value||p.includes("max")&&l>=n.sibling2LayoutConfig.max.value)){var d=n.sibling1LayoutConfig.initial.type,y=n.sibling2LayoutConfig.initial.type;if("fill"===d&&"fill"===y&&i>50&&l>50)return c.containerRefs[o].style[n.propKey]=i+"px",void(c.containerRefs[a].style[n.propKey]=l+"px");"fill"!==d&&(c.containerRefs[o].style[n.propKey]=i+"px"),"fill"!==y&&(c.containerRefs[a].style[n.propKey]=l+"px")}}}},y=function(e){e.preventDefault(),e.stopPropagation(),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",y),l.current.classList.remove(s.current.hoverClass),s.current=null};return f(e.Fragment,{children:"horizontal"===r?f("div",{onMouseDown:function(e){return p(e)},className:"handleBarHorizontalContainer",children:f("div",{ref:l,className:"handleBarHorizontal"})}):"vertical"===r?f("div",{onMouseDown:function(e){return p(e)},className:"handleBarVerticalContainer",children:f("div",{ref:l,className:"handleBarVertical"})}):null})};te.propTypes={orientation:D.string,sibling1:D.string,sibling2:D.string,parent:D.string};re(".relative-container {\n position: relative;\n}\n\n.relative-container.hiding-horizontal {\n width: 0px !important;\n}\n\n.relative-container.hiding-vertical {\n height: 0px !important;\n}\n\n.verticalLine {\n height: 100%;\n width: 1px;\n background: red;\n}\n\n.horizontalLine {\n width: 100%;\n height: 1px;\n background: red;\n}");var oe=t({});oe.displayName="ComponentRegistryContext";re(".lazyContainer {\n position: absolute;\n top: 0px;\n bottom: 0px;\n left: 0px;\n right: 0px;\n}");var ie=function(e){var r=e.content,t=o(oe),i=n(function(){if(t&&r&&"component"in r&&r.component in t)return a(t[r.component])},[t,r]);return f("div",{className:"lazyContainer",children:f(c,{fallback:f("div",{children:"Loading..."}),children:i&&f(i,{})})})};ie.propTypes={content:D.object};var ae=function(e){var n=e.node,r=ne(),t=i(null),o=i(null),a=q(s(null),2),c=a[0],p=a[1],d=l(function(e){for(var n=[],t=0;t<e.children.length;t++){var o=e.children[t];if("container"===o.type){var i=r.ldf.containers[e.children[t].containerId];i.parent=e,n.push(f(ae,{meta:e.children[t],id:i.id,node:i},t))}else"handleBar"===o.type&&("horizontal"===e.orientation?n.push(f(te,{orientation:"vertical",parent:e.id,sibling1:o.sibling1,sibling2:o.sibling2},t)):"vertical"===e.orientation&&n.push(f(te,{orientation:"horizontal",parent:e.id,sibling1:o.sibling1,sibling2:o.sibling2},t)))}return n},[r]),y=i({});return y.current={updateStyles:function(e){var n="hiding-"+o.current;for(var r in e)if("display"===r&&"none"===e[r]){if(t.current.classList.contains(n))return;t.current.classList.add(n)}else if("display"===r&&"flex"===e[r]){if(!t.current.classList.contains(n))return;t.current.classList.remove(n)}else t.current.style[r]=e[r]}},u(function(){if(n&&r&&t.current){o.current=n.parent.orientation;var e=n.children&&n.children.length>0;return e?"horizontal"===n.orientation?(t.current.style.display="flex",t.current.style.flexDirection="row",t.current.style.width="100%"):"vertical"===n.orientation?(t.current.style.display="flex",t.current.style.flexDirection="column",t.current.style.height="100%"):console.warn("Unknown orientation:",n.orientation):n.background?t.current.style.background=n.background:t.current.style.background="transparent",p(e?d(n):f(ie,{content:n})),r.registerContainer(n.id,y,t.current),function(){r.unregisterContainer(n.id)}}},[n,r,d]),f("div",{ref:t,className:"relative-container",children:c})};ae.propTypes={node:D.object};re(".root-container {\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.relative-container {\n position: relative;\n display: flex;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}");var ce=function(){var e=ne(),n=i(null),r=i(null),t=i(!1),o=i({});o.current={};var a=q(s(null),2),c=a[0],p=a[1],d=l(function(n){for(var r=[],t=0;t<n.children.length;t++){var o=n.children[t];if("container"===o.type){var i=e.ldf.containers[n.children[t].containerId];i.parent=n,r.push(f(ae,{meta:n.children[t],id:i.id,node:i},t))}else"handleBar"===o.type&&("horizontal"===n.orientation?r.push(f("div",{className:"verticalLine"})):"vertical"===n.orientation&&r.push(f("div",{className:"horizontalLine"})))}return r},[e]);return u(function(){if(e){var i=e.ldf.containers[e.ldf.layoutRoot],a=i.children&&i.children.length>0;e.registerContainer(i.id,o,n.current),a&&("horizontal"===i.orientation?n.current.style.flexDirection="row":"vertical"===i.orientation&&(n.current.style.flexDirection="column")),p(a?d(i):null);var c=new ResizeObserver(function(n){t.current||(t.current=!0);var o,i=H(n);try{var a=function(){var n=o.value.contentRect,i=n.width,a=n.height;clearTimeout(r.current),r.current=setTimeout(function(){t.current=!1,e.handleRootResize(i,a)},1)};for(i.s();!(o=i.n()).done;)a()}catch(e){i.e(e)}finally{i.f()}});return c.observe(n.current),function(){e.unregisterContainer(e.ldf.layoutRoot),c.disconnect()}}},[e]),f("div",{className:"root-container",children:f("div",{ref:n,className:"relative-container",children:c})})};re("");var se=function(e){var n=e.ldf,r=e.registry;return f(ee,{layout:n,children:f(oe.Provider,{value:r,children:f(ce,{})})})};se.propTypes={ldf:D.object,registry:D.object};export{se as LayoutManager};
|
|
14
|
+
*/function $(){if(C)return S;C=1;var e=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;return S=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var n={},t=0;t<10;t++)n["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(n).map(function(e){return n[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(r,o){for(var i,a,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(r),c=1;c<arguments.length;c++){for(var s in i=Object(arguments[c]))n.call(i,s)&&(l[s]=i[s]);if(e){a=e(i);for(var u=0;u<a.length;u++)t.call(i,a[u])&&(l[a[u]]=i[a[u]])}}return l},S}function _(){if(R)return O;R=1;return O="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function F(){return k?T:(k=1,T=Function.call.bind(Object.prototype.hasOwnProperty))}function V(){if(A)return N;A=1;var e=function(){};if("production"!==process.env.NODE_ENV){var n=_(),t={},r=F();e=function(e){var n="Warning: "+e;"undefined"!=typeof console&&console.error(n);try{throw new Error(n)}catch(e){}}}function o(o,i,a,l,c){if("production"!==process.env.NODE_ENV)for(var s in o)if(r(o,s)){var u;try{if("function"!=typeof o[s]){var d=Error((l||"React class")+": "+a+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}u=o[s](i,s,l,a,null,n)}catch(e){u=e}if(!u||u instanceof Error||e((l||"React class")+": type specification of "+a+" `"+s+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in t)){t[u.message]=!0;var f=c?c():"";e("Failed "+a+" type: "+u.message+(null!=f?f:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(t={})},N=o}function W(){if(I)return L;I=1;var e=B(),n=$(),t=_(),r=F(),o=V(),i=function(){};function a(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var n="Warning: "+e;"undefined"!=typeof console&&console.error(n);try{throw new Error(n)}catch(e){}}),L=function(l,c){var s="function"==typeof Symbol&&Symbol.iterator;var u="<<anonymous>>",d={array:h("array"),bigint:h("bigint"),bool:h("boolean"),func:h("function"),number:h("number"),object:h("object"),string:h("string"),symbol:h("symbol"),any:v(a),arrayOf:function(e){return v(function(n,r,o,i,a){if("function"!=typeof e)return new p("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var l=n[r];if(!Array.isArray(l))return new p("Invalid "+i+" `"+a+"` of type `"+b(l)+"` supplied to `"+o+"`, expected an array.");for(var c=0;c<l.length;c++){var s=e(l,c,o,i,a+"["+c+"]",t);if(s instanceof Error)return s}return null})},element:v(function(e,n,t,r,o){var i=e[n];return l(i)?null:new p("Invalid "+r+" `"+o+"` of type `"+b(i)+"` supplied to `"+t+"`, expected a single ReactElement.")}),elementType:v(function(n,t,r,o,i){var a=n[t];return e.isValidElementType(a)?null:new p("Invalid "+o+" `"+i+"` of type `"+b(a)+"` supplied to `"+r+"`, expected a single ReactElement type.")}),instanceOf:function(e){return v(function(n,t,r,o,i){if(!(n[t]instanceof e)){var a=e.name||u;return new p("Invalid "+o+" `"+i+"` of type `"+(((l=n[t]).constructor&&l.constructor.name?l.constructor.name:u)+"` supplied to `")+r+"`, expected instance of `"+a+"`.")}var l;return null})},node:v(function(e,n,t,r,o){return y(e[n])?null:new p("Invalid "+r+" `"+o+"` supplied to `"+t+"`, expected a ReactNode.")}),objectOf:function(e){return v(function(n,o,i,a,l){if("function"!=typeof e)return new p("Property `"+l+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var c=n[o],s=b(c);if("object"!==s)return new p("Invalid "+a+" `"+l+"` of type `"+s+"` supplied to `"+i+"`, expected an object.");for(var u in c)if(r(c,u)){var d=e(c,u,i,a,l+"."+u,t);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),a;return v(function(n,t,r,o,i){for(var a=n[t],l=0;l<e.length;l++)if(f(a,e[l]))return null;var c=JSON.stringify(e,function(e,n){return"symbol"===m(n)?String(n):n});return new p("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+r+"`, expected one of "+c+".")})},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var n=0;n<e.length;n++){var o=e[n];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+w(o)+" at index "+n+"."),a}return v(function(n,o,i,a,l){for(var c=[],s=0;s<e.length;s++){var u=(0,e[s])(n,o,i,a,l,t);if(null==u)return null;u.data&&r(u.data,"expectedType")&&c.push(u.data.expectedType)}return new p("Invalid "+a+" `"+l+"` supplied to `"+i+"`"+(c.length>0?", expected one of type ["+c.join(", ")+"]":"")+".")})},shape:function(e){return v(function(n,r,o,i,a){var l=n[r],c=b(l);if("object"!==c)return new p("Invalid "+i+" `"+a+"` of type `"+c+"` supplied to `"+o+"`, expected `object`.");for(var s in e){var u=e[s];if("function"!=typeof u)return g(o,i,a,s,m(u));var d=u(l,s,o,i,a+"."+s,t);if(d)return d}return null})},exact:function(e){return v(function(o,i,a,l,c){var s=o[i],u=b(s);if("object"!==u)return new p("Invalid "+l+" `"+c+"` of type `"+u+"` supplied to `"+a+"`, expected `object`.");var d=n({},o[i],e);for(var f in d){var v=e[f];if(r(e,f)&&"function"!=typeof v)return g(a,l,c,f,m(v));if(!v)return new p("Invalid "+l+" `"+c+"` key `"+f+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=v(s,f,a,l,c+"."+f,t);if(h)return h}return null})}};function f(e,n){return e===n?0!==e||1/e==1/n:e!=e&&n!=n}function p(e,n){this.message=e,this.data=n&&"object"==typeof n?n:{},this.stack=""}function v(e){if("production"!==process.env.NODE_ENV)var n={},r=0;function o(o,a,l,s,d,f,v){if(s=s||u,f=f||l,v!==t){if(c){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var g=s+":"+l;!n[g]&&r<3&&(i("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+s+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),n[g]=!0,r++)}}return null==a[l]?o?null===a[l]?new p("The "+d+" `"+f+"` is marked as required in `"+s+"`, but its value is `null`."):new p("The "+d+" `"+f+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:e(a,l,s,d,f)}var a=o.bind(null,!1);return a.isRequired=o.bind(null,!0),a}function h(e){return v(function(n,t,r,o,i,a){var l=n[t];return b(l)!==e?new p("Invalid "+o+" `"+i+"` of type `"+m(l)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null})}function g(e,n,t,r,o){return new p((e||"React class")+": "+n+" type `"+t+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function y(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(y);if(null===e||l(e))return!0;var n=function(e){var n=e&&(s&&e[s]||e["@@iterator"]);if("function"==typeof n)return n}(e);if(!n)return!1;var t,r=n.call(e);if(n!==e.entries){for(;!(t=r.next()).done;)if(!y(t.value))return!1}else for(;!(t=r.next()).done;){var o=t.value;if(o&&!y(o[1]))return!1}return!0;default:return!1}}function b(e){var n=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,n){return"symbol"===e||!!n&&("Symbol"===n["@@toStringTag"]||"function"==typeof Symbol&&n instanceof Symbol)}(n,e)?"symbol":n}function m(e){if(null==e)return""+e;var n=b(e);if("object"===n){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return n}function w(e){var n=m(e);switch(n){case"array":case"object":return"an "+n;case"boolean":case"date":case"regexp":return"a "+n;default:return n}}return p.prototype=Error.prototype,d.checkPropTypes=o,d.resetWarningCache=o.resetWarningCache,d.PropTypes=d,d},L}function H(){if(j)return P;j=1;var e=_();function n(){}function t(){}return t.resetWarningCache=n,P=function(){function r(n,t,r,o,i,a){if(a!==e){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function o(){return r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:t,resetWarningCache:n};return i.PropTypes=i,i}}function Y(){if(M)return m.exports;if(M=1,"production"!==process.env.NODE_ENV){var e=B();m.exports=W()(e.isElement,true)}else m.exports=H()();return m.exports}var K=y(Y());function X(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function U(e,n,t){return n&&function(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ee(r.key),r)}}(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function q(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=ne(e))||n){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}function J(e,n,t){return(n=ee(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Z(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function G(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Z(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Z(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Q(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],c=!0,s=!1;try{if(i=(t=t.call(e)).next,0===n);else for(;!(c=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(e,n)||ne(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ee(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}function ne(e,n){if(e){if("string"==typeof e)return X(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?X(e,n):void 0}}var te={INITIALIZE:1,INITIALIZE_FLEXBOX:2,APPLY_SIZES:3,ERROR:4,TRANSFORMATIONS:5,MOVE_HANDLE_BAR:6},re=te=Object.freeze(te),oe={UPDATE_SIZE:1},ie=oe=Object.freeze(oe),ae=function(){return U(function e(n){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),this.containers={},this.containerRefs={},this.ldf=n,this.numberOfContainers=0,this.registeredContainers=0,this.layoutLoaded=!1,this.numberOfContainers=this.ldf.containers?Object.keys(this.ldf.containers).length:0,this.worker=null},[{key:"startWorker",value:function(){try{this.worker=new Worker(new URL("./Worker/LayoutWorker.js",import.meta.url),{type:"module"}),this.worker.onmessage=this.handleWorkerMessage.bind(this),this.worker.onerror=function(e){return console.error("Worker error:",e)},this.sendToWorker(re.INITIALIZE,{ldf:this.ldf})}catch(e){console.error("Failed to create worker:",e)}}},{key:"sendToWorker",value:function(e,n){this.worker||this.startWorker(),this.worker.postMessage({code:e,args:n})}},{key:"registerContainer",value:function(e,n,t){e in this.containers||(this.registeredContainers+=1),this.containers[e]=n,this.containerRefs[e]=t,console.log("Registered container with id: ".concat(e," ")),this.registeredContainers!==this.numberOfContainers||this.layoutLoaded||(console.log("All containers registered, layout is ready."),this.sendToWorker(re.INITIALIZE_FLEXBOX))}},{key:"unregisterContainer",value:function(e){delete this.containers[e]}},{key:"handleRootResize",value:function(){if(this.layoutLoaded){var e={};for(var n in this.containerRefs)if(this.containerRefs.hasOwnProperty(n)){var t=this.containerRefs[n].getBoundingClientRect();e[n]={width:t.width,height:t.height}}this.sendToWorker(re.APPLY_SIZES,{sizes:e})}}},{key:"moveHandleBar",value:function(e){for(var n={},t=0,r=[e.parent,e.sibling1,e.sibling2];t<r.length;t++){var o=r[t],i=this.containerRefs[o].getBoundingClientRect();n[o]={width:i.width,height:i.height}}e.sizes=n,this.sendToWorker(re.MOVE_HANDLE_BAR,{metadata:e}),this.handleRootResize()}},{key:"applyTransformations",value:function(e,n){var t=this;requestAnimationFrame(function(){var r,o=q(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;switch(i.type){case ie.UPDATE_SIZE:t.containers[i.id].current.updateStyles(i.args.style);break;case ie.REMOVE_NODE:break;default:console.warn("Unknown transformation was requested.")}}}catch(e){o.e(e)}finally{o.f()}n&&(t.layoutLoaded=!0)})}},{key:"handleWorkerMessage",value:function(e){var n;switch(e.data.type){case re.INITIALIZE_FLEXBOX:n=e.data.data,this.applyTransformations(n,!0);break;case re.TRANSFORMATIONS:n=e.data.data,this.applyTransformations(n,!1);break;case re.ERROR:console.error("Error from worker:",e.data)}}},{key:"destroy",value:function(){this.worker&&(this.worker.terminate(),this.worker=null)}}])}(),le=r(null);function ce(e){var r=e.layout,o=e.children,i=n(function(){return new ae(r)},[r]);return t(function(){return function(){i.destroy()}},[i]),p(le.Provider,{value:i,children:o})}function se(){var e=o(le);if(!e)throw new Error("useLayoutController must be used within a LayoutControllerProvider");return e}function ue(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}ce.propTypes={layout:K.object.isRequired,children:K.node.isRequired};ue(".handleBarHorizontalContainer {\n position: relative;\n width: 100%;\n height: 1px;\n background-color: #414141;\n z-index: 1;\n}\n\n.handleBarHorizontal {\n position: absolute;\n top: 50%;\n height: 1px;\n left: 0;\n right: 0;\n transform: translateY(-50%);\n transition: all 0.2s ease;\n}\n\n.handleBarHorizontal:hover {\n background-color: #007acc;\n cursor: ns-resize;\n height: 5px;\n z-index: 10;\n}\n\n.handleBarHorizontalHover {\n background-color: #007acc;\n cursor: ns-resize;\n height: 5px;\n z-index: 10;\n}\n\n.handleBarVerticalContainer {\n position: relative;\n height: 100%;\n width: 1px;\n background-color: #414141;\n z-index: 1;\n}\n\n.handleBarVertical {\n position: absolute;\n top: 0;\n width: 1px;\n left: 50%;\n bottom: 0;\n transform: translateX(-50%);\n transition: all 0.3s ease;\n}\n\n.handleBarVertical:hover {\n background-color: #007acc;\n cursor: ew-resize;\n width: 5px;\n z-index: 10;\n}\n\n.handleBarVerticalHover {\n background-color: #007acc;\n cursor: ew-resize;\n width: 5px;\n z-index: 10;\n}");var de=function(n){var r=n.orientation,o=n.parent,a=n.sibling1,l=n.sibling2,c=se(),s=i(null),u=i(null),d=i(null),f=function(e){var n,t,i;e.preventDefault(),e.stopPropagation(),document.addEventListener("mousemove",v),document.addEventListener("mouseup",h),"horizontal"===r?(n="clientY",t="height",i="handleBarHorizontalHover"):"vertical"===r&&(n="clientX",t="width",i="handleBarVerticalHover");for(var d,f,p=c.containerRefs[o],g=c.containerRefs[a],y=c.containerRefs[l],b=c.ldf.containers[o],m=0;m<b.children.length;m++)b.children[m].containerId===a?d=b.children[m].size:b.children[m].containerId===l&&(f=b.children[m].size);s.current={downValueY:e[n],hoverClass:i,downKey:n,propKey:t,parentSize:p.getBoundingClientRect()[t],parentRef:p,sibling1Ref:g,sibling2Ref:y,sibling1LayoutConfig:d,sibling2LayoutConfig:f,sibling1Size:g.getBoundingClientRect()[t],sibling2Size:y.getBoundingClientRect()[t]},u.current.classList.add(i)};var v=function(e){if(s.current){e.preventDefault(),e.stopPropagation();var n=s.current,t=e[n.downKey]-n.downValueY,r=n.sibling1Size+t,i=n.sibling2Size-t;clearTimeout(d.current),d.current=setTimeout(function(){var t,r,i;c.moveHandleBar({handle:(t=e,r=n.parentRef,i=r.getBoundingClientRect(),{x:t.clientX-i.left,y:t.clientY-i.top}),parent:o,sibling1:a,sibling2:l})},4);var u=Object.keys(n.sibling1LayoutConfig);if(!(u.includes("min")&&r<=n.sibling1LayoutConfig.min.value||u.includes("max")&&r>=n.sibling1LayoutConfig.max.value)){var f=Object.keys(n.sibling2LayoutConfig);if(!(f.includes("min")&&i<=n.sibling2LayoutConfig.min.value||f.includes("max")&&i>=n.sibling2LayoutConfig.max.value)){var p=n.sibling1LayoutConfig.initial.type,v=n.sibling2LayoutConfig.initial.type;if("fill"===p&&"fill"===v&&r>50&&i>50)return c.containerRefs[a].style[n.propKey]=r+"px",void(c.containerRefs[l].style[n.propKey]=i+"px");"fill"!==p&&(c.containerRefs[a].style[n.propKey]=r+"px"),"fill"!==v&&(c.containerRefs[l].style[n.propKey]=i+"px")}}}},h=function(e){e.preventDefault(),e.stopPropagation(),document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",h),clearTimeout(d.current),u.current&&s.current&&u.current.classList.remove(s.current.hoverClass),s.current=null};return t(function(){return function(){document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",h),d.current&&(clearTimeout(d.current),d.current=null)}},[]),p(e.Fragment,{children:"horizontal"===r?p("div",{onMouseDown:function(e){return f(e)},className:"handleBarHorizontalContainer",children:p("div",{ref:u,className:"handleBarHorizontal"})}):"vertical"===r?p("div",{onMouseDown:function(e){return f(e)},className:"handleBarVerticalContainer",children:p("div",{ref:u,className:"handleBarVertical"})}):null})};de.propTypes={orientation:K.string,sibling1:K.string,sibling2:K.string,parent:K.string};ue(".relative-container {\n position: relative;\n}\n\n.relative-container.hiding-horizontal {\n width: 0px !important;\n}\n\n.relative-container.hiding-vertical {\n height: 0px !important;\n}");var fe=r({});fe.displayName="ComponentRegistryContext";ue(".lazyContainer {\n position: absolute;\n top: 0px;\n bottom: 0px;\n left: 0px;\n right: 0px;\n}");var pe=function(e){var t=e.content,r=o(fe),i=n(function(){if(r&&t&&"component"in t&&t.component in r)return a(r[t.component])},[r,t]);return p("div",{className:"lazyContainer",children:p(l,{fallback:p("div",{children:"Loading..."}),children:i&&p(i,{})})})};pe.propTypes={content:K.object};var ve=function(e){var n=e.node,t=se(),r=i(null),o=i(null),a=Q(c(null),2),l=a[0],d=a[1],f=s(function(e){for(var n=[],r=0;r<e.children.length;r++){var o=e.children[r];if("container"===o.type){var i=t.ldf.containers[e.children[r].containerId];i.parent=e,n.push(p(ve,{meta:e.children[r],id:i.id,node:i},r))}else"handleBar"===o.type&&("horizontal"===e.orientation?n.push(p(de,{orientation:"vertical",parent:e.id,sibling1:o.sibling1,sibling2:o.sibling2},r)):"vertical"===e.orientation&&n.push(p(de,{orientation:"horizontal",parent:e.id,sibling1:o.sibling1,sibling2:o.sibling2},r)))}return n},[t]),v=i({});return v.current={updateStyles:function(e){var n="hiding-"+o.current;for(var t in e)if("display"===t&&"none"===e[t]){if(r.current.classList.contains(n))return;r.current.classList.add(n)}else if("display"===t&&"flex"===e[t]){if(!r.current.classList.contains(n))return;r.current.classList.remove(n)}else r.current.style[t]=e[t]}},u(function(){if(n&&t&&r.current){o.current=n.parent.orientation;var e=n.children&&n.children.length>0;return e?"horizontal"===n.orientation?(r.current.style.display="flex",r.current.style.flexDirection="row",r.current.style.width="100%"):"vertical"===n.orientation?(r.current.style.display="flex",r.current.style.flexDirection="column",r.current.style.height="100%"):console.warn("Unknown orientation:",n.orientation):n.background?r.current.style.background=n.background:r.current.style.background="transparent",d(e?f(n):p(pe,{content:n})),t.registerContainer(n.id,v,r.current),function(){t.unregisterContainer(n.id)}}},[n,t,f]),p("div",{ref:r,className:"relative-container",children:l})};ve.propTypes={node:K.object};const he="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function ge(e){const n=Object.prototype.toString.call(e);return"[object Window]"===n||"[object global]"===n}function ye(e){return"nodeType"in e}function be(e){var n,t;return e?ge(e)?e:ye(e)&&null!=(n=null==(t=e.ownerDocument)?void 0:t.defaultView)?n:window:window}function me(e){const{Document:n}=be(e);return e instanceof n}function we(e){return!ge(e)&&e instanceof be(e).HTMLElement}function xe(e){return e instanceof be(e).SVGElement}function Ee(e){return e?ge(e)?e.document:ye(e)?me(e)?e:we(e)||xe(e)?e.ownerDocument:document:document:document}const De=he?u:t;function Se(e){const n=i(e);return De(()=>{n.current=e}),s(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)},[])}function Ce(e,n){void 0===n&&(n=[e]);const t=i(e);return De(()=>{t.current!==e&&(t.current=e)},n),t}function Oe(e,t){const r=i();return n(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Re(e){const n=i();return t(()=>{n.current=e},[e]),n.current}let Te={};function ke(e,t){return n(()=>{if(t)return t;const n=null==Te[e]?0:Te[e]+1;return Te[e]=n,e+"-"+n},[e,t])}function Ne(e){return function(n){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];return r.reduce((n,t)=>{const r=Object.entries(t);for(const[t,o]of r){const r=n[t];null!=r&&(n[t]=r+e*o)}return n},{...n})}}const Ae=Ne(1),Le=Ne(-1);function Ie(e){if(!e)return!1;const{KeyboardEvent:n}=be(e.target);return n&&e instanceof n}function Pe(e){if(function(e){if(!e)return!1;const{TouchEvent:n}=be(e.target);return n&&e instanceof n}(e)){if(e.touches&&e.touches.length){const{clientX:n,clientY:t}=e.touches[0];return{x:n,y:t}}if(e.changedTouches&&e.changedTouches.length){const{clientX:n,clientY:t}=e.changedTouches[0];return{x:n,y:t}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const je="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Me(e){return e.matches(je)?e:e.querySelector(je)}const ze={display:"none"};function Be(n){let{id:t,value:r}=n;return e.createElement("div",{id:t,style:ze},r)}function $e(n){let{id:t,announcement:r,ariaLiveType:o="assertive"}=n;return e.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":o,"aria-atomic":!0},r)}const _e=r(null);const Fe={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},Ve={onDragStart(e){let{active:n}=e;return"Picked up draggable item "+n.id+"."},onDragOver(e){let{active:n,over:t}=e;return t?"Draggable item "+n.id+" was moved over droppable area "+t.id+".":"Draggable item "+n.id+" is no longer over a droppable area."},onDragEnd(e){let{active:n,over:t}=e;return t?"Draggable item "+n.id+" was dropped over droppable area "+t.id:"Draggable item "+n.id+" was dropped."},onDragCancel(e){let{active:n}=e;return"Dragging was cancelled. Draggable item "+n.id+" was dropped."}};function We(r){let{announcements:i=Ve,container:a,hiddenTextDescribedById:l,screenReaderInstructions:u=Fe}=r;const{announce:d,announcement:f}=function(){const[e,n]=c("");return{announce:s(e=>{null!=e&&n(e)},[]),announcement:e}}(),p=ke("DndLiveRegion"),[v,h]=c(!1);if(t(()=>{h(!0)},[]),function(e){const n=o(_e);t(()=>{if(!n)throw new Error("useDndMonitor must be used within a children of <DndContext>");return n(e)},[e,n])}(n(()=>({onDragStart(e){let{active:n}=e;d(i.onDragStart({active:n}))},onDragMove(e){let{active:n,over:t}=e;i.onDragMove&&d(i.onDragMove({active:n,over:t}))},onDragOver(e){let{active:n,over:t}=e;d(i.onDragOver({active:n,over:t}))},onDragEnd(e){let{active:n,over:t}=e;d(i.onDragEnd({active:n,over:t}))},onDragCancel(e){let{active:n,over:t}=e;d(i.onDragCancel({active:n,over:t}))}}),[d,i])),!v)return null;const y=e.createElement(e.Fragment,null,e.createElement(Be,{id:l,value:u.draggable}),e.createElement($e,{id:p,announcement:f}));return a?g(y,a):y}var He;function Ye(){}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(He||(He={}));const Ke=Object.freeze({x:0,y:0});function Xe(e,n){let{data:{value:t}}=e,{data:{value:r}}=n;return r-t}function Ue(e,n){const t=Math.max(n.top,e.top),r=Math.max(n.left,e.left),o=Math.min(n.left+n.width,e.left+e.width),i=Math.min(n.top+n.height,e.top+e.height),a=o-r,l=i-t;if(r<o&&t<i){const t=n.width*n.height,r=e.width*e.height,o=a*l;return Number((o/(t+r-o)).toFixed(4))}return 0}const qe=e=>{let{collisionRect:n,droppableRects:t,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=t.get(r);if(i){const t=Ue(i,n);t>0&&o.push({id:r,data:{droppableContainer:e,value:t}})}}return o.sort(Xe)};function Je(e,n){return e&&n?{x:e.left-n.left,y:e.top-n.top}:Ke}function Ze(e){return function(n){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];return r.reduce((n,t)=>({...n,top:n.top+e*t.y,bottom:n.bottom+e*t.y,left:n.left+e*t.x,right:n.right+e*t.x}),{...n})}}const Ge=Ze(1);const Qe={ignoreTransform:!1};function en(e,n){void 0===n&&(n=Qe);let t=e.getBoundingClientRect();if(n.ignoreTransform){const{transform:n,transformOrigin:r}=be(e).getComputedStyle(e);n&&(t=function(e,n,t){const r=function(e){if(e.startsWith("matrix3d(")){const n=e.slice(9,-1).split(/, /);return{x:+n[12],y:+n[13],scaleX:+n[0],scaleY:+n[5]}}if(e.startsWith("matrix(")){const n=e.slice(7,-1).split(/, /);return{x:+n[4],y:+n[5],scaleX:+n[0],scaleY:+n[3]}}return null}(n);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:l}=r,c=e.left-a-(1-o)*parseFloat(t),s=e.top-l-(1-i)*parseFloat(t.slice(t.indexOf(" ")+1)),u=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:u,height:d,top:s,right:c+u,bottom:s+d,left:c}}(t,n,r))}const{top:r,left:o,width:i,height:a,bottom:l,right:c}=t;return{top:r,left:o,width:i,height:a,bottom:l,right:c}}function nn(e){return en(e,{ignoreTransform:!0})}function tn(e,n){const t=[];return e?function r(o){if(null!=n&&t.length>=n)return t;if(!o)return t;if(me(o)&&null!=o.scrollingElement&&!t.includes(o.scrollingElement))return t.push(o.scrollingElement),t;if(!we(o)||xe(o))return t;if(t.includes(o))return t;const i=be(e).getComputedStyle(o);return o!==e&&function(e,n){void 0===n&&(n=be(e).getComputedStyle(e));const t=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=n[e];return"string"==typeof r&&t.test(r)})}(o,i)&&t.push(o),function(e,n){return void 0===n&&(n=be(e).getComputedStyle(e)),"fixed"===n.position}(o,i)?t:r(o.parentNode)}(e):t}function rn(e){const[n]=tn(e,1);return null!=n?n:null}function on(e){return he&&e?ge(e)?e:ye(e)?me(e)||e===Ee(e).scrollingElement?window:we(e)?e:null:null:null}function an(e){return ge(e)?e.scrollX:e.scrollLeft}function ln(e){return ge(e)?e.scrollY:e.scrollTop}function cn(e){return{x:an(e),y:ln(e)}}var sn;function un(e){return!(!he||!e)&&e===document.scrollingElement}function dn(e){const n={x:0,y:0},t=un(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-t.width,y:e.scrollHeight-t.height};return{isTop:e.scrollTop<=n.y,isLeft:e.scrollLeft<=n.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:n}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(sn||(sn={}));const fn={x:.2,y:.2};function pn(e,n,t,r,o){let{top:i,left:a,right:l,bottom:c}=t;void 0===r&&(r=10),void 0===o&&(o=fn);const{isTop:s,isBottom:u,isLeft:d,isRight:f}=dn(e),p={x:0,y:0},v={x:0,y:0},h=n.height*o.y,g=n.width*o.x;return!s&&i<=n.top+h?(p.y=sn.Backward,v.y=r*Math.abs((n.top+h-i)/h)):!u&&c>=n.bottom-h&&(p.y=sn.Forward,v.y=r*Math.abs((n.bottom-h-c)/h)),!f&&l>=n.right-g?(p.x=sn.Forward,v.x=r*Math.abs((n.right-g-l)/g)):!d&&a<=n.left+g&&(p.x=sn.Backward,v.x=r*Math.abs((n.left+g-a)/g)),{direction:p,speed:v}}function vn(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:n}=window;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}const{top:n,left:t,right:r,bottom:o}=e.getBoundingClientRect();return{top:n,left:t,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function hn(e){return e.reduce((e,n)=>Ae(e,cn(n)),Ke)}const gn=[["x",["left","right"],function(e){return e.reduce((e,n)=>e+an(n),0)}],["y",["top","bottom"],function(e){return e.reduce((e,n)=>e+ln(n),0)}]];class yn{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const t=tn(n),r=hn(t);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,n,o]of gn)for(const i of n)Object.defineProperty(this,i,{get:()=>{const n=o(t),a=r[e]-n;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class bn{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var n;return null==(n=this.target)?void 0:n.removeEventListener(...e)})},this.target=e}add(e,n,t){var r;null==(r=this.target)||r.addEventListener(e,n,t),this.listeners.push([e,n,t])}}function mn(e,n){const t=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof n?Math.sqrt(t**2+r**2)>n:"x"in n&&"y"in n?t>n.x&&r>n.y:"x"in n?t>n.x:"y"in n&&r>n.y}var wn,xn;function En(e){e.preventDefault()}function Dn(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(wn||(wn={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(xn||(xn={}));const Sn={start:[xn.Space,xn.Enter],cancel:[xn.Esc],end:[xn.Space,xn.Enter,xn.Tab]},Cn=(e,n)=>{let{currentCoordinates:t}=n;switch(e.code){case xn.Right:return{...t,x:t.x+25};case xn.Left:return{...t,x:t.x-25};case xn.Down:return{...t,y:t.y+25};case xn.Up:return{...t,y:t.y-25}}};class On{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new bn(Ee(n)),this.windowListeners=new bn(be(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(wn.Resize,this.handleCancel),this.windowListeners.add(wn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(wn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,t=e.node.current;t&&function(e,n){if(void 0===n&&(n=en),!e)return;const{top:t,left:r,bottom:o,right:i}=n(e);rn(e)&&(o<=0||i<=0||t>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(t),n(Ke)}handleKeyDown(e){if(Ie(e)){const{active:n,context:t,options:r}=this.props,{keyboardCodes:o=Sn,coordinateGetter:i=Cn,scrollBehavior:a="smooth"}=r,{code:l}=e;if(o.end.includes(l))return void this.handleEnd(e);if(o.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:c}=t.current,s=c?{x:c.left,y:c.top}:Ke;this.referenceCoordinates||(this.referenceCoordinates=s);const u=i(e,{active:n,context:t.current,currentCoordinates:s});if(u){const n=Le(u,s),r={x:0,y:0},{scrollableAncestors:o}=t.current;for(const t of o){const o=e.code,{isTop:i,isRight:l,isLeft:c,isBottom:s,maxScroll:d,minScroll:f}=dn(t),p=vn(t),v={x:Math.min(o===xn.Right?p.right-p.width/2:p.right,Math.max(o===xn.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(o===xn.Down?p.bottom-p.height/2:p.bottom,Math.max(o===xn.Down?p.top:p.top+p.height/2,u.y))},h=o===xn.Right&&!l||o===xn.Left&&!c,g=o===xn.Down&&!s||o===xn.Up&&!i;if(h&&v.x!==u.x){const e=t.scrollLeft+n.x,i=o===xn.Right&&e<=d.x||o===xn.Left&&e>=f.x;if(i&&!n.y)return void t.scrollTo({left:e,behavior:a});r.x=i?t.scrollLeft-e:o===xn.Right?t.scrollLeft-d.x:t.scrollLeft-f.x,r.x&&t.scrollBy({left:-r.x,behavior:a});break}if(g&&v.y!==u.y){const e=t.scrollTop+n.y,i=o===xn.Down&&e<=d.y||o===xn.Up&&e>=f.y;if(i&&!n.x)return void t.scrollTo({top:e,behavior:a});r.y=i?t.scrollTop-e:o===xn.Down?t.scrollTop-d.y:t.scrollTop-f.y,r.y&&t.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,Ae(Le(u,this.referenceCoordinates),r))}}}handleMove(e,n){const{onMove:t}=this.props;e.preventDefault(),t(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Rn(e){return Boolean(e&&"distance"in e)}function Tn(e){return Boolean(e&&"delay"in e)}On.activators=[{eventName:"onKeyDown",handler:(e,n,t)=>{let{keyboardCodes:r=Sn,onActivation:o}=n,{active:i}=t;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const n=i.activatorNode.current;return(!n||e.target===n)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class kn{constructor(e,n,t){var r;void 0===t&&(t=function(e){const{EventTarget:n}=be(e);return e instanceof n?e:Ee(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:o}=e,{target:i}=o;this.props=e,this.events=n,this.document=Ee(i),this.documentListeners=new bn(this.document),this.listeners=new bn(t),this.windowListeners=new bn(be(i)),this.initialCoordinates=null!=(r=Pe(o))?r:Ke,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:t}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(wn.Resize,this.handleCancel),this.windowListeners.add(wn.DragStart,En),this.windowListeners.add(wn.VisibilityChange,this.handleCancel),this.windowListeners.add(wn.ContextMenu,En),this.documentListeners.add(wn.Keydown,this.handleKeydown),n){if(null!=t&&t({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Tn(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(Rn(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:t,onPending:r}=this.props;r(t,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(wn.Click,Dn,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(wn.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:t,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const l=null!=(n=Pe(e))?n:Ke,c=Le(r,l);if(!t&&a){if(Rn(a)){if(null!=a.tolerance&&mn(c,a.tolerance))return this.handleCancel();if(mn(c,a.distance))return this.handleStart()}return Tn(a)&&mn(c,a.tolerance)?this.handleCancel():void this.handlePending(a,c)}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===xn.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Nn={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class An extends kn{constructor(e){const{event:n}=e,t=Ee(n.target);super(e,Nn,t)}}An.activators=[{eventName:"onPointerDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;return!(!t.isPrimary||0!==t.button)&&(null==r||r({event:t}),!0)}}];const Ln={move:{name:"mousemove"},end:{name:"mouseup"}};var In;!function(e){e[e.RightClick=2]="RightClick"}(In||(In={}));(class extends kn{constructor(e){super(e,Ln,Ee(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;return t.button!==In.RightClick&&(null==r||r({event:t}),!0)}}];const Pn={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var jn,Mn;function zn(e){let{acceleration:r,activator:o=jn.Pointer,canScroll:a,draggingRect:l,enabled:c,interval:u=5,order:d=Mn.TreeOrder,pointerCoordinates:f,scrollableAncestors:p,scrollableAncestorRects:v,delta:h,threshold:g}=e;const y=function(e){let{delta:n,disabled:t}=e;const r=Re(n);return Oe(e=>{if(t||!r||!e)return Bn;const o={x:Math.sign(n.x-r.x),y:Math.sign(n.y-r.y)};return{x:{[sn.Backward]:e.x[sn.Backward]||-1===o.x,[sn.Forward]:e.x[sn.Forward]||1===o.x},y:{[sn.Backward]:e.y[sn.Backward]||-1===o.y,[sn.Forward]:e.y[sn.Forward]||1===o.y}}},[t,n,r])}({delta:h,disabled:!c}),[b,m]=function(){const e=i(null);return[s((n,t)=>{e.current=setInterval(n,t)},[]),s(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),w=i({x:0,y:0}),x=i({x:0,y:0}),E=n(()=>{switch(o){case jn.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case jn.DraggableRect:return l}},[o,l,f]),D=i(null),S=s(()=>{const e=D.current;if(!e)return;const n=w.current.x*x.current.x,t=w.current.y*x.current.y;e.scrollBy(n,t)},[]),C=n(()=>d===Mn.TreeOrder?[...p].reverse():p,[d,p]);t(()=>{if(c&&p.length&&E){for(const e of C){if(!1===(null==a?void 0:a(e)))continue;const n=p.indexOf(e),t=v[n];if(!t)continue;const{direction:o,speed:i}=pn(e,t,E,r,g);for(const e of["x","y"])y[e][o[e]]||(i[e]=0,o[e]=0);if(i.x>0||i.y>0)return m(),D.current=e,b(S,u),w.current=i,void(x.current=o)}w.current={x:0,y:0},x.current={x:0,y:0},m()}else m()},[r,S,a,m,c,u,JSON.stringify(E),JSON.stringify(y),b,p,C,v,JSON.stringify(g)])}(class extends kn{constructor(e){super(e,Pn)}static setup(){return window.addEventListener(Pn.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Pn.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;const{touches:o}=t;return!(o.length>1)&&(null==r||r({event:t}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(jn||(jn={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Mn||(Mn={}));const Bn={x:{[sn.Backward]:!1,[sn.Forward]:!1},y:{[sn.Backward]:!1,[sn.Forward]:!1}};var $n,_n;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}($n||($n={})),function(e){e.Optimized="optimized"}(_n||(_n={}));const Fn=new Map;function Vn(e,n){return Oe(t=>e?t||("function"==typeof n?n(e):e):null,[n,e])}function Wn(e){let{callback:r,disabled:o}=e;const i=Se(r),a=n(()=>{if(o||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(i)},[o]);return t(()=>()=>null==a?void 0:a.disconnect(),[a]),a}function Hn(e){return new yn(en(e),e)}function Yn(e,r,o){void 0===r&&(r=Hn);const[i,a]=c(null);function l(){a(n=>{if(!e)return null;var t;if(!1===e.isConnected)return null!=(t=null!=n?n:o)?t:null;const i=r(e);return JSON.stringify(n)===JSON.stringify(i)?n:i})}const s=function(e){let{callback:r,disabled:o}=e;const i=Se(r),a=n(()=>{if(o||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(i)},[i,o]);return t(()=>()=>null==a?void 0:a.disconnect(),[a]),a}({callback(n){if(e)for(const t of n){const{type:n,target:r}=t;if("childList"===n&&r instanceof HTMLElement&&r.contains(e)){l();break}}}}),u=Wn({callback:l});return De(()=>{l(),e?(null==u||u.observe(e),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==u||u.disconnect(),null==s||s.disconnect())},[e]),i}const Kn=[];function Xn(e,n){void 0===n&&(n=[]);const r=i(null);return t(()=>{r.current=null},n),t(()=>{const n=e!==Ke;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?Le(e,r.current):Ke}function Un(e){return n(()=>e?function(e){const n=e.innerWidth,t=e.innerHeight;return{top:0,left:0,right:n,bottom:t,width:n,height:t}}(e):null,[e])}const qn=[];function Jn(e){let{measure:t}=e;const[r,o]=c(null),a=s(e=>{for(const{target:n}of e)if(we(n)){o(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t]),l=Wn({callback:a}),u=s(e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const n=e.children[0];return we(n)?n:e}(e);null==l||l.disconnect(),n&&(null==l||l.observe(n)),o(n?t(n):null)},[t,l]),[d,f]=function(e){const n=Se(e),t=i(null),r=s(e=>{e!==t.current&&(null==n||n(e,t.current)),t.current=e},[]);return[t,r]}(u);return n(()=>({nodeRef:d,rect:r,setRef:f}),[r,d,f])}const Zn=[{sensor:An,options:{}},{sensor:On,options:{}}],Gn={current:{}},Qn={draggable:{measure:nn},droppable:{measure:nn,strategy:$n.WhileDragging,frequency:_n.Optimized},dragOverlay:{measure:en}};class et extends Map{get(e){var n;return null!=e&&null!=(n=super.get(e))?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,t;return null!=(n=null==(t=this.get(e))?void 0:t.node.current)?n:void 0}}const nt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new et,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ye},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Qn,measureDroppableContainers:Ye,windowRect:null,measuringScheduled:!1},tt=r({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ye,draggableNodes:new Map,over:null,measureDroppableContainers:Ye}),rt=r(nt);function ot(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new et}}}function it(e,n){switch(n.type){case He.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case He.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:n.coordinates.x-e.draggable.initialCoordinates.x,y:n.coordinates.y-e.draggable.initialCoordinates.y}}};case He.DragEnd:case He.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case He.RegisterDroppable:{const{element:t}=n,{id:r}=t,o=new et(e.droppable.containers);return o.set(r,t),{...e,droppable:{...e.droppable,containers:o}}}case He.SetDroppableDisabled:{const{id:t,key:r,disabled:o}=n,i=e.droppable.containers.get(t);if(!i||r!==i.key)return e;const a=new et(e.droppable.containers);return a.set(t,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case He.UnregisterDroppable:{const{id:t,key:r}=n,o=e.droppable.containers.get(t);if(!o||r!==o.key)return e;const i=new et(e.droppable.containers);return i.delete(t),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function at(e){let{disabled:n}=e;const{active:r,activatorEvent:i,draggableNodes:a}=o(tt),l=Re(i),c=Re(null==r?void 0:r.id);return t(()=>{if(!n&&!i&&l&&null!=c){if(!Ie(l))return;if(document.activeElement===l.target)return;const e=a.get(c);if(!e)return;const{activatorNode:n,node:t}=e;if(!n.current&&!t.current)return;requestAnimationFrame(()=>{for(const e of[n.current,t.current]){if(!e)continue;const n=Me(e);if(n){n.focus();break}}})}},[i,n,a,c,l]),null}const lt=r({...Ke,scaleX:1,scaleY:1});var ct;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(ct||(ct={}));const st=d(function(r){var o,a,l,u;let{id:d,accessibility:p,autoScroll:v=!0,children:g,sensors:y=Zn,collisionDetection:b=qe,measuring:m,modifiers:w,...x}=r;const E=f(it,void 0,ot),[D,S]=E,[C,O]=function(){const[e]=c(()=>new Set),n=s(n=>(e.add(n),()=>e.delete(n)),[e]);return[s(n=>{let{type:t,event:r}=n;e.forEach(e=>{var n;return null==(n=e[t])?void 0:n.call(e,r)})},[e]),n]}(),[R,T]=c(ct.Uninitialized),k=R===ct.Initialized,{draggable:{active:N,nodes:A,translate:L},droppable:{containers:I}}=D,P=null!=N?A.get(N):null,j=i({initial:null,translated:null}),M=n(()=>{var e;return null!=N?{id:N,data:null!=(e=null==P?void 0:P.data)?e:Gn,rect:j}:null},[N,P]),z=i(null),[B,$]=c(null),[_,F]=c(null),V=Ce(x,Object.values(x)),W=ke("DndDescribedBy",d),H=n(()=>I.getEnabled(),[I]),Y=n(()=>({draggable:{...Qn.draggable,...null==K?void 0:K.draggable},droppable:{...Qn.droppable,...null==K?void 0:K.droppable},dragOverlay:{...Qn.dragOverlay,...null==K?void 0:K.dragOverlay}}),[null==(K=m)?void 0:K.draggable,null==K?void 0:K.droppable,null==K?void 0:K.dragOverlay]);var K;const{droppableRects:X,measureDroppableContainers:U,measuringScheduled:q}=function(e,n){let{dragging:r,dependencies:o,config:a}=n;const[l,u]=c(null),{frequency:d,measure:f,strategy:p}=a,v=i(e),h=function(){switch(p){case $n.Always:return!1;case $n.BeforeDragging:return r;default:return!r}}(),g=Ce(h),y=s(function(e){void 0===e&&(e=[]),g.current||u(n=>null===n?e:n.concat(e.filter(e=>!n.includes(e))))},[g]),b=i(null),m=Oe(n=>{if(h&&!r)return Fn;if(!n||n===Fn||v.current!==e||null!=l){const n=new Map;for(let t of e){if(!t)continue;if(l&&l.length>0&&!l.includes(t.id)&&t.rect.current){n.set(t.id,t.rect.current);continue}const e=t.node.current,r=e?new yn(f(e),e):null;t.rect.current=r,r&&n.set(t.id,r)}return n}return n},[e,l,r,h,f]);return t(()=>{v.current=e},[e]),t(()=>{h||y()},[r,h]),t(()=>{l&&l.length>0&&u(null)},[JSON.stringify(l)]),t(()=>{h||"number"!=typeof d||null!==b.current||(b.current=setTimeout(()=>{y(),b.current=null},d))},[d,h,y,...o]),{droppableRects:m,measureDroppableContainers:y,measuringScheduled:null!=l}}(H,{dragging:k,dependencies:[L.x,L.y],config:Y.droppable}),J=function(e,n){const t=null!=n?e.get(n):void 0,r=t?t.node.current:null;return Oe(e=>{var t;return null==n?null:null!=(t=null!=r?r:e)?t:null},[r,n])}(A,N),Z=n(()=>_?Pe(_):null,[_]),G=function(){const e=!1===(null==B?void 0:B.autoScrollEnabled),n="object"==typeof v?!1===v.enabled:!1===v,t=k&&!e&&!n;if("object"==typeof v)return{...v,enabled:t};return{enabled:t}}(),Q=function(e,n){return Vn(e,n)}(J,Y.draggable.measure);!function(e){let{activeNode:n,measure:t,initialRect:r,config:o=!0}=e;const a=i(!1),{x:l,y:c}="boolean"==typeof o?{x:o,y:o}:o;De(()=>{if(!l&&!c||!n)return void(a.current=!1);if(a.current||!r)return;const e=null==n?void 0:n.node.current;if(!e||!1===e.isConnected)return;const o=Je(t(e),r);if(l||(o.x=0),c||(o.y=0),a.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const n=rn(e);n&&n.scrollBy({top:o.y,left:o.x})}},[n,l,c,r,t])}({activeNode:null!=N?A.get(N):null,config:G.layoutShiftCompensation,initialRect:Q,measure:Y.draggable.measure});const ee=Yn(J,Y.draggable.measure,Q),ne=Yn(J?J.parentElement:null),te=i({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:A,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),re=I.getNodeFor(null==(o=te.current.over)?void 0:o.id),oe=Jn({measure:Y.dragOverlay.measure}),ie=null!=(a=oe.nodeRef.current)?a:J,ae=k?null!=(l=oe.rect)?l:ee:null,le=Boolean(oe.nodeRef.current&&oe.rect),ce=Je(se=le?null:ee,Vn(se));var se;const ue=Un(ie?be(ie):null),de=function(e){const n=i(e),r=Oe(t=>e?t&&t!==Kn&&e&&n.current&&e.parentNode===n.current.parentNode?t:tn(e):Kn,[e]);return t(()=>{n.current=e},[e]),r}(k?null!=re?re:J:null),fe=function(e,n){void 0===n&&(n=en);const[t]=e,r=Un(t?be(t):null),[o,i]=c(qn);function a(){i(()=>e.length?e.map(e=>un(e)?r:new yn(n(e),e)):qn)}const l=Wn({callback:a});return De(()=>{null==l||l.disconnect(),a(),e.forEach(e=>null==l?void 0:l.observe(e))},[e]),o}(de),pe=function(e,n){let{transform:t,...r}=n;return null!=e&&e.length?e.reduce((e,n)=>n({transform:e,...r}),t):t}(w,{transform:{x:L.x-ce.x,y:L.y-ce.y,scaleX:1,scaleY:1},activatorEvent:_,active:M,activeNodeRect:ee,containerNodeRect:ne,draggingNodeRect:ae,over:te.current.over,overlayNodeRect:oe.rect,scrollableAncestors:de,scrollableAncestorRects:fe,windowRect:ue}),ve=Z?Ae(Z,L):null,ge=function(e){const[r,o]=c(null),a=i(e),l=s(e=>{const n=on(e.target);n&&o(e=>e?(e.set(n,cn(n)),new Map(e)):null)},[]);return t(()=>{const n=a.current;if(e!==n){t(n);const r=e.map(e=>{const n=on(e);return n?(n.addEventListener("scroll",l,{passive:!0}),[n,cn(n)]):null}).filter(e=>null!=e);o(r.length?new Map(r):null),a.current=e}return()=>{t(e),t(n)};function t(e){e.forEach(e=>{const n=on(e);null==n||n.removeEventListener("scroll",l)})}},[l,e]),n(()=>e.length?r?Array.from(r.values()).reduce((e,n)=>Ae(e,n),Ke):hn(e):Ke,[e,r])}(de),ye=Xn(ge),me=Xn(ge,[ee]),we=Ae(pe,ye),xe=ae?Ge(ae,pe):null,Ee=M&&xe?b({active:M,collisionRect:xe,droppableRects:X,droppableContainers:H,pointerCoordinates:ve}):null,Se=function(e,n){if(!e||0===e.length)return null;const[t]=e;return t[n]}(Ee,"id"),[Re,Te]=c(null),Ne=function(e,n,t){return{...e,scaleX:n&&t?n.width/t.width:1,scaleY:n&&t?n.height/t.height:1}}(le?pe:Ae(pe,me),null!=(u=null==Re?void 0:Re.rect)?u:null,ee),Le=i(null),Ie=s((e,n)=>{let{sensor:t,options:r}=n;if(null==z.current)return;const o=A.get(z.current);if(!o)return;const i=e.nativeEvent,a=new t({active:z.current,activeNode:o,event:i,options:r,context:te,onAbort(e){if(!A.get(e))return;const{onDragAbort:n}=V.current,t={id:e};null==n||n(t),C({type:"onDragAbort",event:t})},onPending(e,n,t,r){if(!A.get(e))return;const{onDragPending:o}=V.current,i={id:e,constraint:n,initialCoordinates:t,offset:r};null==o||o(i),C({type:"onDragPending",event:i})},onStart(e){const n=z.current;if(null==n)return;const t=A.get(n);if(!t)return;const{onDragStart:r}=V.current,o={activatorEvent:i,active:{id:n,data:t.data,rect:j}};h(()=>{null==r||r(o),T(ct.Initializing),S({type:He.DragStart,initialCoordinates:e,active:n}),C({type:"onDragStart",event:o}),$(Le.current),F(i)})},onMove(e){S({type:He.DragMove,coordinates:e})},onEnd:l(He.DragEnd),onCancel:l(He.DragCancel)});function l(e){return async function(){const{active:n,collisions:t,over:r,scrollAdjustedTranslate:o}=te.current;let a=null;if(n&&o){const{cancelDrop:l}=V.current;if(a={activatorEvent:i,active:n,collisions:t,delta:o,over:r},e===He.DragEnd&&"function"==typeof l){await Promise.resolve(l(a))&&(e=He.DragCancel)}}z.current=null,h(()=>{S({type:e}),T(ct.Uninitialized),Te(null),$(null),F(null),Le.current=null;const n=e===He.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=V.current[n];null==e||e(a),C({type:n,event:a})}})}}Le.current=a},[A]),je=s((e,n)=>(t,r)=>{const o=t.nativeEvent,i=A.get(r);if(null!==z.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(t,n.options,a)&&(o.dndKit={capturedBy:n.sensor},z.current=r,Ie(t,n))},[A,Ie]),Me=function(e,t){return n(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(y,je);!function(e){t(()=>{if(!he)return;const n=e.map(e=>{let{sensor:n}=e;return null==n.setup?void 0:n.setup()});return()=>{for(const e of n)null==e||e()}},e.map(e=>{let{sensor:n}=e;return n}))}(y),De(()=>{ee&&R===ct.Initializing&&T(ct.Initialized)},[ee,R]),t(()=>{const{onDragMove:e}=V.current,{active:n,activatorEvent:t,collisions:r,over:o}=te.current;if(!n||!t)return;const i={active:n,activatorEvent:t,collisions:r,delta:{x:we.x,y:we.y},over:o};h(()=>{null==e||e(i),C({type:"onDragMove",event:i})})},[we.x,we.y]),t(()=>{const{active:e,activatorEvent:n,collisions:t,droppableContainers:r,scrollAdjustedTranslate:o}=te.current;if(!e||null==z.current||!n||!o)return;const{onDragOver:i}=V.current,a=r.get(Se),l=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,c={active:e,activatorEvent:n,collisions:t,delta:{x:o.x,y:o.y},over:l};h(()=>{Te(l),null==i||i(c),C({type:"onDragOver",event:c})})},[Se]),De(()=>{te.current={activatorEvent:_,active:M,activeNode:J,collisionRect:xe,collisions:Ee,droppableRects:X,draggableNodes:A,draggingNode:ie,draggingNodeRect:ae,droppableContainers:I,over:Re,scrollableAncestors:de,scrollAdjustedTranslate:we},j.current={initial:ae,translated:xe}},[M,J,Ee,xe,A,ie,ae,X,I,Re,de,we]),zn({...G,delta:L,draggingRect:xe,pointerCoordinates:ve,scrollableAncestors:de,scrollableAncestorRects:fe});const ze=n(()=>({active:M,activeNode:J,activeNodeRect:ee,activatorEvent:_,collisions:Ee,containerNodeRect:ne,dragOverlay:oe,draggableNodes:A,droppableContainers:I,droppableRects:X,over:Re,measureDroppableContainers:U,scrollableAncestors:de,scrollableAncestorRects:fe,measuringConfiguration:Y,measuringScheduled:q,windowRect:ue}),[M,J,ee,_,Ee,ne,oe,A,I,X,Re,U,de,fe,Y,q,ue]),Be=n(()=>({activatorEvent:_,activators:Me,active:M,activeNodeRect:ee,ariaDescribedById:{draggable:W},dispatch:S,draggableNodes:A,over:Re,measureDroppableContainers:U}),[_,Me,M,ee,S,W,A,Re,U]);return e.createElement(_e.Provider,{value:O},e.createElement(tt.Provider,{value:Be},e.createElement(rt.Provider,{value:ze},e.createElement(lt.Provider,{value:Ne},g)),e.createElement(at,{disabled:!1===(null==p?void 0:p.restoreFocus)})),e.createElement(We,{...p,hiddenTextDescribedById:W}))});var ut=r(null),dt=function(e){var t=e.children,r=Q(c({activeId:null,activeData:null,overId:null,overData:null,isDragging:!1}),2),o=r[0],i=r[1],a=Q(c(null),2),l=a[0],u=a[1],d=s(function(e){var n,t,r,o;i({activeId:null!==(n=null===(t=e.active)||void 0===t?void 0:t.id)&&void 0!==n?n:null,activeData:null!==(r=null===(o=e.active)||void 0===o||null===(o=o.data)||void 0===o?void 0:o.current)&&void 0!==r?r:null,overId:null,overData:null,isDragging:!0})},[]),f=s(function(e){i(function(n){var t,r,o,i;return G(G({},n),{},{overId:null!==(t=null===(r=e.over)||void 0===r?void 0:r.id)&&void 0!==t?t:null,overData:null!==(o=null===(i=e.over)||void 0===i||null===(i=i.data)||void 0===i?void 0:i.current)&&void 0!==o?o:null})})},[]),v=s(function(e){var n,t,r,o,a,l,c,s;u({activeId:null!==(n=null===(t=e.active)||void 0===t?void 0:t.id)&&void 0!==n?n:null,activeData:null!==(r=null===(o=e.active)||void 0===o||null===(o=o.data)||void 0===o?void 0:o.current)&&void 0!==r?r:null,overId:null!==(a=null===(l=e.over)||void 0===l?void 0:l.id)&&void 0!==a?a:null,overData:null!==(c=null===(s=e.over)||void 0===s||null===(s=s.data)||void 0===s?void 0:s.current)&&void 0!==c?c:null}),i({activeId:null,activeData:null,overId:null,overData:null,isDragging:!1})},[]),h=n(function(){return{dragState:o,drop:l,handleDragStart:d,handleDragOver:f,clearDrag:v}},[o,l,d,f,v]);return p(ut.Provider,{value:h,children:t})};ue(".root-container {\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.relative-container {\n position: relative;\n display: flex;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.drag-overlay {\n position: fixed;\n pointer-events: none;\n z-index: 9999;\n}");var ft=function(){var r,o=se(),a=function(){var n=e.useContext(ut);if(!n)throw new Error("useDragState must be used inside DragProvider");return n}(),l=a.dragState,d=a.handleDragStart,f=a.handleDragOver,h=a.clearDrag,g=i(null),y=i(null),b=i(!1),m=i({});m.current={};var w=Q(c(null),2),x=w[0],E=w[1],D=s(function(e){for(var n=[],t=0;t<e.children.length;t++){var r=e.children[t];if("container"===r.type){var i=o.ldf.containers[e.children[t].containerId];i.parent=e,n.push(p(ve,{meta:e.children[t],id:i.id,node:i},t))}else"handleBar"===r.type&&("horizontal"===e.orientation?n.push(p(de,{orientation:"vertical",parent:e.id,sibling1:r.sibling1,sibling2:r.sibling2},t)):"vertical"===e.orientation&&n.push(p(de,{orientation:"horizontal",parent:e.id,sibling1:r.sibling1,sibling2:r.sibling2},t)))}return n},[o]);u(function(){if(o){var e=o.ldf.containers[o.ldf.layoutRoot],n=e.children&&e.children.length>0;o.registerContainer(e.id,m,g.current),n&&("horizontal"===e.orientation?g.current.style.flexDirection="row":"vertical"===e.orientation&&(g.current.style.flexDirection="column")),E(n?D(e):null);var t=new ResizeObserver(function(e){b.current||(b.current=!0);var n,t=q(e);try{var r=function(){var e=n.value.contentRect,t=e.width,r=e.height;clearTimeout(y.current),y.current=setTimeout(function(){b.current=!1,o.handleRootResize(t,r)},1)};for(t.s();!(n=t.n()).done;)r()}catch(e){t.e(e)}finally{t.f()}});return t.observe(g.current),function(){o.unregisterContainer(o.ldf.layoutRoot),t.disconnect()}}},[o]);var S,C,O=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n(()=>[...t].filter(e=>null!=e),[...t])}(n(()=>({sensor:S,options:null!=C?C:{}}),[S=An,C={activationConstraint:{distance:8}}])),R=Q(c({left:0,top:0}),2),T=R[0],k=R[1];return t(function(){if(l.isDragging){var e=function(e){k({left:e.clientX,top:e.clientY})};return window.addEventListener("pointermove",e),function(){window.removeEventListener("pointermove",e)}}},[l.isDragging]),v(st,{sensors:O,onDragStart:d,onDragOver:f,onDragEnd:h,onDragCancel:h,children:[p("div",{className:"root-container",children:p("div",{ref:g,className:"relative-container",children:x})}),l.isDragging&&p("div",{className:"drag-overlay",style:T,children:null==l||null===(r=l.activeData)||void 0===r?void 0:r.preview})]})};ue("");var pt=function(e){var n=e.ldf,t=e.registry;return p(dt,{children:p(ce,{layout:n,children:p(fe.Provider,{value:t,children:p(ft,{})})})})};pt.propTypes={ldf:K.object,registry:K.object};export{pt as LayoutManager};
|
|
15
15
|
//# sourceMappingURL=index.js.map
|