flexlayout-react 0.8.0 → 0.8.2
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/ChangeLog.txt +12 -0
- package/README.md +6 -6
- package/declarations/view/Layout.d.ts +1 -0
- package/dist/flexlayout.js +40 -10
- package/dist/flexlayout_min.js +2 -1
- package/dist/flexlayout_min.js.LICENSE.txt +19 -0
- package/lib/model/TabSetNode.js +2 -0
- package/lib/model/TabSetNode.js.map +1 -1
- package/lib/view/BorderButton.js +7 -2
- package/lib/view/BorderButton.js.map +1 -1
- package/lib/view/Layout.js +1 -0
- package/lib/view/Layout.js.map +1 -1
- package/lib/view/TabButton.js +7 -2
- package/lib/view/TabButton.js.map +1 -1
- package/lib/view/TabSet.js +7 -2
- package/lib/view/TabSet.js.map +1 -1
- package/package.json +29 -31
- package/src/model/TabSetNode.ts +3 -0
- package/src/view/BorderButton.tsx +6 -2
- package/src/view/Layout.tsx +8 -6
- package/src/view/TabButton.tsx +6 -2
- package/src/view/TabSet.tsx +6 -2
- package/style/dark.css +5 -5
- package/style/gray.css +5 -5
- package/style/light.css +6 -6
- package/style/rounded.css +6 -6
- package/style/underline.css +6 -6
package/dist/flexlayout_min.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],e):"object"==typeof exports?exports.FlexLayout=e(require("react"),require("react-dom")):t.FlexLayout=e(t.React,t.ReactDOM)}(self,((t,e)=>(()=>{"use strict";var i={557:(t,e,i)=>{var n=i(47);e.H=n.createRoot,n.hydrateRoot},36:e=>{e.exports=t},47:t=>{t.exports=e}},n={};function o(t){var e=n[t];if(void 0!==e)return e.exports;var s=n[t]={exports:{}};return i[t](s,s.exports,o),s.exports}o.d=(t,e)=>{for(var i in e)o.o(e,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};o.r(s),o.d(s,{Action:()=>T,Actions:()=>_,BorderNode:()=>F,BorderSet:()=>b,CLASSES:()=>r,DefaultMax:()=>U,DefaultMin:()=>C,DockLocation:()=>g,DropInfo:()=>m,I18nLabel:()=>a,ICloseType:()=>H,Layout:()=>at,LayoutInternal:()=>rt,LayoutWindow:()=>B,Model:()=>W,Node:()=>f,Orientation:()=>c,Rect:()=>u,RowNode:()=>M,TabNode:()=>O,TabSetNode:()=>I});var a,r,l=o(36),d=o(47),h=o(557);class c{static flip(t){return t===c.HORZ?c.VERT:c.HORZ}constructor(t){this._name=t}getName(){return this._name}toString(){return this._name}}c.HORZ=new c("horz"),c.VERT=new c("vert");class u{static empty(){return new u(0,0,0,0)}static fromJson(t){return new u(t.x,t.y,t.width,t.height)}constructor(t,e,i,n){this.x=t,this.y=e,this.width=i,this.height=n}toJson(){return{x:this.x,y:this.y,width:this.width,height:this.height}}snap(t){this.x=Math.round(this.x/t)*t,this.y=Math.round(this.y/t)*t,this.width=Math.round(this.width/t)*t,this.height=Math.round(this.height/t)*t}static getBoundingClientRect(t){let{x:e,y:i,width:n,height:o}=t.getBoundingClientRect();return new u(e,i,n,o)}static getContentRect(t){const e=t.getBoundingClientRect(),i=window.getComputedStyle(t),n=parseFloat(i.paddingLeft),o=parseFloat(i.paddingRight),s=parseFloat(i.paddingTop),a=parseFloat(i.paddingBottom),r=parseFloat(i.borderLeftWidth),l=parseFloat(i.borderRightWidth),d=parseFloat(i.borderTopWidth),h=parseFloat(i.borderBottomWidth),c=e.width-r-n-o-l,g=e.height-d-s-a-h;return new u(e.left+r+n,e.top+d+s,c,g)}static fromDomRect(t){return new u(t.x,t.y,t.width,t.height)}relativeTo(t){return new u(this.x-t.x,this.y-t.y,this.width,this.height)}clone(){return new u(this.x,this.y,this.width,this.height)}equals(t){return this.x===(null==t?void 0:t.x)&&this.y===(null==t?void 0:t.y)&&this.width===(null==t?void 0:t.width)&&this.height===(null==t?void 0:t.height)}equalSize(t){return this.width===(null==t?void 0:t.width)&&this.height===(null==t?void 0:t.height)}getBottom(){return this.y+this.height}getRight(){return this.x+this.width}getCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}positionElement(t,e){this.styleWithPosition(t.style,e)}styleWithPosition(t,e="absolute"){return t.left=this.x+"px",t.top=this.y+"px",t.width=Math.max(0,this.width)+"px",t.height=Math.max(0,this.height)+"px",t.position=e,t}contains(t,e){return this.x<=t&&t<=this.getRight()&&this.y<=e&&e<=this.getBottom()}removeInsets(t){return new u(this.x+t.left,this.y+t.top,Math.max(0,this.width-t.left-t.right),Math.max(0,this.height-t.top-t.bottom))}centerInRect(t){this.x=(t.width-this.width)/2,this.y=(t.height-this.height)/2}_getSize(t){let e=this.width;return t===c.VERT&&(e=this.height),e}toString(){return"(Rect: x="+this.x+", y="+this.y+", width="+this.width+", height="+this.height+")"}}class g{static getByName(t){return g.values.get(t)}static getLocation(t,e,i){if(e=(e-t.x)/t.width,i=(i-t.y)/t.height,e>=.25&&e<.75&&i>=.25&&i<.75)return g.CENTER;const n=i>=1-e;return i>=e?n?g.BOTTOM:g.LEFT:n?g.RIGHT:g.TOP}constructor(t,e,i){this.name=t,this.orientation=e,this.indexPlus=i,g.values.set(this.name,this)}getName(){return this.name}getOrientation(){return this.orientation}getDockRect(t){return this===g.TOP?new u(t.x,t.y,t.width,t.height/2):this===g.BOTTOM?new u(t.x,t.getBottom()-t.height/2,t.width,t.height/2):this===g.LEFT?new u(t.x,t.y,t.width/2,t.height):this===g.RIGHT?new u(t.getRight()-t.width/2,t.y,t.width/2,t.height):t.clone()}split(t,e){return this===g.TOP?{start:new u(t.x,t.y,t.width,e),end:new u(t.x,t.y+e,t.width,t.height-e)}:this===g.LEFT?{start:new u(t.x,t.y,e,t.height),end:new u(t.x+e,t.y,t.width-e,t.height)}:this===g.RIGHT?{start:new u(t.getRight()-e,t.y,e,t.height),end:new u(t.x,t.y,t.width-e,t.height)}:{start:new u(t.x,t.getBottom()-e,t.width,e),end:new u(t.x,t.y,t.width,t.height-e)}}reflect(){return this===g.TOP?g.BOTTOM:this===g.LEFT?g.RIGHT:this===g.RIGHT?g.LEFT:g.TOP}toString(){return"(DockLocation: name="+this.name+", orientation="+this.orientation+")"}}g.values=new Map,g.TOP=new g("top",c.VERT,0),g.BOTTOM=new g("bottom",c.VERT,1),g.LEFT=new g("left",c.HORZ,0),g.RIGHT=new g("right",c.HORZ,1),g.CENTER=new g("center",c.VERT,0),function(t){t.Close_Tab="Close",t.Close_Tabset="Close tab set",t.Active_Tabset="Active tab set",t.Move_Tabset="Move tab set",t.Move_Tabs="Move tabs(?)",t.Maximize="Maximize tab set",t.Restore="Restore tab set",t.Popout_Tab="Popout selected tab",t.Overflow_Menu_Tooltip="Hidden tabs",t.Error_rendering_component="Error rendering component"}(a||(a={})),function(t){t.FLEXLAYOUT__BORDER="flexlayout__border",t.FLEXLAYOUT__BORDER_="flexlayout__border_",t.FLEXLAYOUT__BORDER_TAB_CONTENTS="flexlayout__border_tab_contents",t.FLEXLAYOUT__BORDER_BUTTON="flexlayout__border_button",t.FLEXLAYOUT__BORDER_BUTTON_="flexlayout__border_button_",t.FLEXLAYOUT__BORDER_BUTTON_CONTENT="flexlayout__border_button_content",t.FLEXLAYOUT__BORDER_BUTTON_LEADING="flexlayout__border_button_leading",t.FLEXLAYOUT__BORDER_BUTTON_TRAILING="flexlayout__border_button_trailing",t.FLEXLAYOUT__BORDER_BUTTON__SELECTED="flexlayout__border_button--selected",t.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED="flexlayout__border_button--unselected",t.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW="flexlayout__border_toolbar_button_overflow",t.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_="flexlayout__border_toolbar_button_overflow_",t.FLEXLAYOUT__BORDER_INNER="flexlayout__border_inner",t.FLEXLAYOUT__BORDER_INNER_="flexlayout__border_inner_",t.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER="flexlayout__border_inner_tab_container",t.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_="flexlayout__border_inner_tab_container_",t.FLEXLAYOUT__BORDER_TAB_DIVIDER="flexlayout__border_tab_divider",t.FLEXLAYOUT__BORDER_SIZER="flexlayout__border_sizer",t.FLEXLAYOUT__BORDER_TOOLBAR="flexlayout__border_toolbar",t.FLEXLAYOUT__BORDER_TOOLBAR_="flexlayout__border_toolbar_",t.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON="flexlayout__border_toolbar_button",t.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT="flexlayout__border_toolbar_button-float",t.FLEXLAYOUT__DRAG_RECT="flexlayout__drag_rect",t.FLEXLAYOUT__EDGE_RECT="flexlayout__edge_rect",t.FLEXLAYOUT__EDGE_RECT_TOP="flexlayout__edge_rect_top",t.FLEXLAYOUT__EDGE_RECT_LEFT="flexlayout__edge_rect_left",t.FLEXLAYOUT__EDGE_RECT_BOTTOM="flexlayout__edge_rect_bottom",t.FLEXLAYOUT__EDGE_RECT_RIGHT="flexlayout__edge_rect_right",t.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER="flexlayout__error_boundary_container",t.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT="flexlayout__error_boundary_content",t.FLEXLAYOUT__FLOATING_WINDOW_CONTENT="flexlayout__floating_window_content",t.FLEXLAYOUT__FLOATING_WINDOW_TAB="flexlayout__floating_window_tab",t.FLEXLAYOUT__LAYOUT="flexlayout__layout",t.FLEXLAYOUT__LAYOUT_MOVEABLES="flexlayout__layout_moveables",t.FLEXLAYOUT__LAYOUT_OVERLAY="flexlayout__layout_overlay",t.FLEXLAYOUT__LAYOUT_TAB_STAMPS="flexlayout__layout_tab_stamps",t.FLEXLAYOUT__LAYOUT_MAIN="flexlayout__layout_main",t.FLEXLAYOUT__LAYOUT_BORDER_CONTAINER="flexlayout__layout_border_container",t.FLEXLAYOUT__LAYOUT_BORDER_CONTAINER_INNER="flexlayout__layout_border_container_inner",t.FLEXLAYOUT__OUTLINE_RECT="flexlayout__outline_rect",t.FLEXLAYOUT__OUTLINE_RECT_EDGE="flexlayout__outline_rect_edge",t.FLEXLAYOUT__SPLITTER="flexlayout__splitter",t.FLEXLAYOUT__SPLITTER_EXTRA="flexlayout__splitter_extra",t.FLEXLAYOUT__SPLITTER_="flexlayout__splitter_",t.FLEXLAYOUT__SPLITTER_BORDER="flexlayout__splitter_border",t.FLEXLAYOUT__SPLITTER_DRAG="flexlayout__splitter_drag",t.FLEXLAYOUT__SPLITTER_HANDLE="flexlayout__splitter_handle",t.FLEXLAYOUT__SPLITTER_HANDLE_HORZ="flexlayout__splitter_handle_horz",t.FLEXLAYOUT__SPLITTER_HANDLE_VERT="flexlayout__splitter_handle_vert",t.FLEXLAYOUT__ROW="flexlayout__row",t.FLEXLAYOUT__TAB="flexlayout__tab",t.FLEXLAYOUT__TAB_POSITION="flexlayout__tab_position",t.FLEXLAYOUT__TAB_MOVEABLE="flexlayout__tab_moveable",t.FLEXLAYOUT__TAB_OVERLAY="flexlayout__tab_overlay",t.FLEXLAYOUT__TABSET="flexlayout__tabset",t.FLEXLAYOUT__TABSET_CONTAINER="flexlayout__tabset_container",t.FLEXLAYOUT__TABSET_HEADER="flexlayout__tabset_header",t.FLEXLAYOUT__TABSET_HEADER_SIZER="flexlayout__tabset_header_sizer",t.FLEXLAYOUT__TABSET_HEADER_CONTENT="flexlayout__tabset_header_content",t.FLEXLAYOUT__TABSET_MAXIMIZED="flexlayout__tabset-maximized",t.FLEXLAYOUT__TABSET_SELECTED="flexlayout__tabset-selected",t.FLEXLAYOUT__TABSET_SIZER="flexlayout__tabset_sizer",t.FLEXLAYOUT__TABSET_TAB_DIVIDER="flexlayout__tabset_tab_divider",t.FLEXLAYOUT__TABSET_CONTENT="flexlayout__tabset_content",t.FLEXLAYOUT__TABSET_TABBAR_INNER="flexlayout__tabset_tabbar_inner",t.FLEXLAYOUT__TABSET_TABBAR_INNER_="flexlayout__tabset_tabbar_inner_",t.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER="flexlayout__tabset_tabbar_inner_tab_container",t.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_="flexlayout__tabset_tabbar_inner_tab_container_",t.FLEXLAYOUT__TABSET_TABBAR_OUTER="flexlayout__tabset_tabbar_outer",t.FLEXLAYOUT__TABSET_TABBAR_OUTER_="flexlayout__tabset_tabbar_outer_",t.FLEXLAYOUT__TAB_BORDER="flexlayout__tab_border",t.FLEXLAYOUT__TAB_BORDER_="flexlayout__tab_border_",t.FLEXLAYOUT__TAB_BUTTON="flexlayout__tab_button",t.FLEXLAYOUT__TAB_BUTTON_STRETCH="flexlayout__tab_button_stretch",t.FLEXLAYOUT__TAB_BUTTON_CONTENT="flexlayout__tab_button_content",t.FLEXLAYOUT__TAB_BUTTON_LEADING="flexlayout__tab_button_leading",t.FLEXLAYOUT__TAB_BUTTON_OVERFLOW="flexlayout__tab_button_overflow",t.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT="flexlayout__tab_button_overflow_count",t.FLEXLAYOUT__TAB_BUTTON_TEXTBOX="flexlayout__tab_button_textbox",t.FLEXLAYOUT__TAB_BUTTON_TRAILING="flexlayout__tab_button_trailing",t.FLEXLAYOUT__TAB_BUTTON_STAMP="flexlayout__tab_button_stamp",t.FLEXLAYOUT__TAB_FLOATING="flexlayout__tab_floating",t.FLEXLAYOUT__TAB_FLOATING_INNER="flexlayout__tab_floating_inner",t.FLEXLAYOUT__TAB_TOOLBAR="flexlayout__tab_toolbar",t.FLEXLAYOUT__TAB_TOOLBAR_BUTTON="flexlayout__tab_toolbar_button",t.FLEXLAYOUT__TAB_TOOLBAR_ICON="flexlayout__tab_toolbar_icon",t.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_="flexlayout__tab_toolbar_button-",t.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT="flexlayout__tab_toolbar_button-float",t.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER="flexlayout__tab_toolbar_sticky_buttons_container",t.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE="flexlayout__tab_toolbar_button-close",t.FLEXLAYOUT__POPUP_MENU_CONTAINER="flexlayout__popup_menu_container",t.FLEXLAYOUT__POPUP_MENU_ITEM="flexlayout__popup_menu_item",t.FLEXLAYOUT__POPUP_MENU="flexlayout__popup_menu"}(r||(r={}));class T{constructor(t,e){this.type=t,this.data=e}}class _{static addNode(t,e,i,n,o){return new T(_.ADD_NODE,{json:t,toNode:e,location:i.getName(),index:n,select:o})}static moveNode(t,e,i,n,o){return new T(_.MOVE_NODE,{fromNode:t,toNode:e,location:i.getName(),index:n,select:o})}static deleteTab(t){return new T(_.DELETE_TAB,{node:t})}static deleteTabset(t){return new T(_.DELETE_TABSET,{node:t})}static renameTab(t,e){return new T(_.RENAME_TAB,{node:t,text:e})}static selectTab(t){return new T(_.SELECT_TAB,{tabNode:t})}static setActiveTabset(t,e){return new T(_.SET_ACTIVE_TABSET,{tabsetNode:t,windowId:e})}static adjustWeights(t,e){return new T(_.ADJUST_WEIGHTS,{nodeId:t,weights:e})}static adjustBorderSplit(t,e){return new T(_.ADJUST_BORDER_SPLIT,{node:t,pos:e})}static maximizeToggle(t,e){return new T(_.MAXIMIZE_TOGGLE,{node:t,windowId:e})}static updateModelAttributes(t){return new T(_.UPDATE_MODEL_ATTRIBUTES,{json:t})}static updateNodeAttributes(t,e){return new T(_.UPDATE_NODE_ATTRIBUTES,{node:t,json:e})}static popoutTab(t){return new T(_.POPOUT_TAB,{node:t})}static popoutTabset(t){return new T(_.POPOUT_TABSET,{node:t})}static closeWindow(t){return new T(_.CLOSE_WINDOW,{windowId:t})}static createWindow(t,e){return new T(_.CREATE_WINDOW,{layout:t,rect:e})}}_.ADD_NODE="FlexLayout_AddNode",_.MOVE_NODE="FlexLayout_MoveNode",_.DELETE_TAB="FlexLayout_DeleteTab",_.DELETE_TABSET="FlexLayout_DeleteTabset",_.RENAME_TAB="FlexLayout_RenameTab",_.SELECT_TAB="FlexLayout_SelectTab",_.SET_ACTIVE_TABSET="FlexLayout_SetActiveTabset",_.ADJUST_WEIGHTS="FlexLayout_AdjustWeights",_.ADJUST_BORDER_SPLIT="FlexLayout_AdjustBorderSplit",_.MAXIMIZE_TOGGLE="FlexLayout_MaximizeToggle",_.UPDATE_MODEL_ATTRIBUTES="FlexLayout_UpdateModelAttributes",_.UPDATE_NODE_ATTRIBUTES="FlexLayout_UpdateNodeAttributes",_.POPOUT_TAB="FlexLayout_PopoutTab",_.POPOUT_TABSET="FlexLayout_PopoutTabset",_.CLOSE_WINDOW="FlexLayout_CloseWindow",_.CREATE_WINDOW="FlexLayout_CreateWindow";class p{constructor(t,e,i,n){this.name=t,this.alias=void 0,this.modelName=e,this.defaultValue=i,this.alwaysWriteJson=n,this.required=!1,this.fixed=!1,this.type="any"}setType(t){return this.type=t,this}setAlias(t){return this.alias=t,this}setDescription(t){this.description=t}setRequired(){return this.required=!0,this}setFixed(){return this.fixed=!0,this}setpairedAttr(t){this.pairedAttr=t}setPairedType(t){this.pairedType=t}}p.NUMBER="number",p.STRING="string",p.BOOLEAN="boolean";class E{constructor(){this.attributes=[],this.nameToAttribute=new Map}addWithAll(t,e,i,n){const o=new p(t,e,i,n);return this.attributes.push(o),this.nameToAttribute.set(t,o),o}addInherited(t,e){return this.addWithAll(t,e,void 0,!1)}add(t,e,i){return this.addWithAll(t,void 0,e,i)}getAttributes(){return this.attributes}getModelName(t){const e=this.nameToAttribute.get(t);if(void 0!==e)return e.modelName}toJson(t,e){for(const i of this.attributes){const n=e[i.name];(i.alwaysWriteJson||n!==i.defaultValue)&&(t[i.name]=n)}}fromJson(t,e){for(const i of this.attributes){let n=t[i.name];void 0===n&&i.alias&&(n=t[i.alias]),e[i.name]=void 0===n?i.defaultValue:n}}update(t,e){for(const i of this.attributes)if(t.hasOwnProperty(i.name)){const n=t[i.name];void 0===n?delete e[i.name]:e[i.name]=n}}setDefaults(t){for(const e of this.attributes)t[e.name]=e.defaultValue}pairAttributes(t,e){for(const i of e.attributes)if(i.modelName&&this.nameToAttribute.has(i.modelName)){const e=this.nameToAttribute.get(i.modelName);e.setpairedAttr(i),i.setpairedAttr(e),e.setPairedType(t)}}toTypescriptInterface(t,e){var i,n;const o=[],s=this.attributes.sort(((t,e)=>t.name.localeCompare(e.name)));o.push("export interface I"+t+"Attributes {");for(let t=0;t<s.length;t++){const a=s[t];let r,l,d=a.type,h=a;void 0!==h.defaultValue?r=h.defaultValue:void 0!==h.modelName&&void 0!==e&&void 0!==e.nameToAttribute.get(h.modelName)&&(l=h.modelName,h=e.nameToAttribute.get(l),r=h.defaultValue,d=h.type);let c=JSON.stringify(r);const u=h.required?"":"?";let g="\t/**\n\t ";a.description?g+=a.description:a.pairedType&&(null===(i=a.pairedAttr)||void 0===i?void 0:i.description)&&(g+=`Value for ${a.pairedType} attribute ${a.pairedAttr.name} if not overridden`,g+="\n\n\t ",g+=null===(n=a.pairedAttr)||void 0===n?void 0:n.description),g+="\n\n\t ",a.fixed?g+=`Fixed value: ${c}`:g+=l?`Default: inherited from Global attribute ${a.modelName} (default ${c})`:`Default: ${c}`,g+="\n\t */",o.push(g),o.push("\t"+a.name+u+": "+d+";\n")}return o.push("}"),o.join("\n")}}class m{constructor(t,e,i,n,o){this.node=t,this.rect=e,this.location=i,this.index=n,this.className=o}}class b{static fromJson(t,e){const i=new b(e);i.borders=t.map((t=>F.fromJson(t,e)));for(const t of i.borders)i.borderMap.set(t.getLocation(),t);return i}constructor(t){this.borders=[],this.borderMap=new Map,this.layoutHorizontal=!0}toJson(){return this.borders.map((t=>t.toJson()))}getLayoutHorizontal(){return this.layoutHorizontal}getBorders(){return this.borders}getBorderMap(){return this.borderMap}forEachNode(t){for(const e of this.borders){t(e,0);for(const i of e.getChildren())i.forEachNode(t,1)}}setPaths(){for(const t of this.borders){const e="/border/"+t.getLocation().getName();t.setPath(e);let i=0;for(const n of t.getChildren())n.setPath(e+"/t"+i),i++}}findDropTargetNode(t,e,i){for(const n of this.borders)if(n.isShowing()){const o=n.canDrop(t,e,i);if(void 0!==o)return o}}}class f{constructor(t){this.model=t,this.attributes={},this.children=[],this.rect=u.empty(),this.listeners=new Map,this.path=""}getId(){let t=this.attributes.id;return void 0!==t||(t=this.model.nextUniqueId(),this.setId(t)),t}getModel(){return this.model}getType(){return this.attributes.type}getParent(){return this.parent}getChildren(){return this.children}getRect(){return this.rect}getPath(){return this.path}getOrientation(){return void 0===this.parent?this.model.isRootOrientationVertical()?c.VERT:c.HORZ:c.flip(this.parent.getOrientation())}setEventListener(t,e){this.listeners.set(t,e)}removeEventListener(t){this.listeners.delete(t)}setId(t){this.attributes.id=t}fireEvent(t,e){this.listeners.has(t)&&this.listeners.get(t)(e)}getAttr(t){let e=this.attributes[t];if(void 0===e){const i=this.getAttributeDefinitions().getModelName(t);void 0!==i&&(e=this.model.getAttribute(i))}return e}forEachNode(t,e){t(this,e),e++;for(const i of this.children)i.forEachNode(t,e)}setPaths(t){let e=0;for(const i of this.children){let n=t;"row"===i.getType()?i.getOrientation()===c.VERT?n+="/c"+e:n+="/r"+e:"tabset"===i.getType()?n+="/ts"+e:"tab"===i.getType()&&(n+="/t"+e),i.path=n,i.setPaths(n),e++}}setParent(t){this.parent=t}setRect(t){this.rect=t}setPath(t){this.path=t}setWeight(t){this.attributes.weight=t}setSelected(t){this.attributes.selected=t}findDropTargetNode(t,e,i,n){let o;if(this.rect.contains(i,n))if(void 0!==this.model.getMaximizedTabset(t))o=this.model.getMaximizedTabset(t).canDrop(e,i,n);else if(o=this.canDrop(e,i,n),void 0===o&&0!==this.children.length)for(const s of this.children)if(o=s.findDropTargetNode(t,e,i,n),void 0!==o)break;return o}canDrop(t,e,i){}canDockInto(t,e){if(null!=e){if(e.location===g.CENTER&&!1===e.node.isEnableDrop())return!1;if(e.location===g.CENTER&&"tabset"===t.getType()&&void 0!==t.getName())return!1;if(e.location!==g.CENTER&&!1===e.node.isEnableDivide())return!1;if(this.model.getOnAllowDrop())return this.model.getOnAllowDrop()(t,e)}return!0}removeChild(t){const e=this.children.indexOf(t);return-1!==e&&this.children.splice(e,1),e}addChild(t,e){return null!=e?this.children.splice(e,0,t):(this.children.push(t),e=this.children.length-1),t.parent=this,e}removeAll(){this.children=[]}styleWithPosition(t){return null==t&&(t={}),this.rect.styleWithPosition(t)}isEnableDivide(){return!0}toAttributeString(){return JSON.stringify(this.attributes,void 0,"\t")}}class O extends f{static fromJson(t,e,i=!0){return new O(e,t,i)}constructor(t,e,i=!0){super(t),this.tabRect=u.empty(),this.extra={},this.moveableElement=null,this.tabStamp=null,this.rendered=!1,this.visible=!1,O.attributeDefinitions.fromJson(e,this.attributes),!0===i&&t.addNode(this)}getName(){return this.getAttr("name")}getHelpText(){return this.getAttr("helpText")}getComponent(){return this.getAttr("component")}getWindowId(){return this.parent instanceof I?this.parent.getWindowId():W.MAIN_WINDOW_ID}getWindow(){const t=this.model.getwindowsMap().get(this.getWindowId());if(t)return t.window}getConfig(){return this.attributes.config}getExtraData(){return this.extra}isPoppedOut(){return this.getWindowId()!==W.MAIN_WINDOW_ID}isSelected(){return this.getParent().getSelectedNode()===this}getIcon(){return this.getAttr("icon")}isEnableClose(){return this.getAttr("enableClose")}getCloseType(){return this.getAttr("closeType")}isEnablePopout(){return this.getAttr("enablePopout")}isEnablePopoutIcon(){return this.getAttr("enablePopoutIcon")}isEnablePopoutOverlay(){return this.getAttr("enablePopoutOverlay")}isEnableDrag(){return this.getAttr("enableDrag")}isEnableRename(){return this.getAttr("enableRename")}isEnableWindowReMount(){return this.getAttr("enableWindowReMount")}getClassName(){return this.getAttr("className")}getContentClassName(){return this.getAttr("contentClassName")}getTabSetClassName(){return this.getAttr("tabsetClassName")}isEnableRenderOnDemand(){return this.getAttr("enableRenderOnDemand")}getMinWidth(){return this.getAttr("minWidth")}getMinHeight(){return this.getAttr("minHeight")}getMaxWidth(){return this.getAttr("maxWidth")}getMaxHeight(){return this.getAttr("maxHeight")}toJson(){const t={};return O.attributeDefinitions.toJson(t,this.attributes),t}saveScrollPosition(){this.moveableElement&&(this.scrollLeft=this.moveableElement.scrollLeft,this.scrollTop=this.moveableElement.scrollTop)}restoreScrollPosition(){this.scrollTop&&requestAnimationFrame((()=>{this.moveableElement&&this.scrollTop&&(this.moveableElement.scrollTop=this.scrollTop,this.moveableElement.scrollLeft=this.scrollLeft)}))}setRect(t){t.equals(this.rect)||(this.fireEvent("resize",{rect:t}),this.rect=t)}setVisible(t){t!==this.visible&&(this.fireEvent("visibility",{visible:t}),this.visible=t)}getScrollTop(){return this.scrollTop}setScrollTop(t){this.scrollTop=t}getScrollLeft(){return this.scrollLeft}setScrollLeft(t){this.scrollLeft=t}isRendered(){return this.rendered}setRendered(t){this.rendered=t}getTabRect(){return this.tabRect}setTabRect(t){this.tabRect=t}getTabStamp(){return this.tabStamp}setTabStamp(t){this.tabStamp=t}getMoveableElement(){return this.moveableElement}setMoveableElement(t){this.moveableElement=t}setRenderedName(t){this.renderedName=t}getNameForOverflowMenu(){const t=this.getAttr("altName");return void 0!==t?t:this.renderedName}setName(t){this.attributes.name=t}delete(){this.parent.remove(this),this.fireEvent("close",{})}updateAttrs(t){O.attributeDefinitions.update(t,this.attributes)}getAttributeDefinitions(){return O.attributeDefinitions}setBorderWidth(t){this.attributes.borderWidth=t}setBorderHeight(t){this.attributes.borderHeight=t}static getAttributeDefinitions(){return O.attributeDefinitions}static createAttributeDefinitions(){const t=new E;return t.add("type",O.TYPE,!0).setType(p.STRING).setFixed(),t.add("id",void 0).setType(p.STRING).setDescription("the unique id of the tab, if left undefined a uuid will be assigned"),t.add("name","[Unnamed Tab]").setType(p.STRING).setDescription("name of tab to be displayed in the tab button"),t.add("altName",void 0).setType(p.STRING).setDescription("if there is no name specifed then this value will be used in the overflow menu"),t.add("helpText",void 0).setType(p.STRING).setDescription("An optional help text for the tab to be displayed upon tab hover."),t.add("component",void 0).setType(p.STRING).setDescription("string identifying which component to run (for factory)"),t.add("config",void 0).setType("any").setDescription("a place to hold json config for the hosted component"),t.add("tabsetClassName",void 0).setType(p.STRING).setDescription("class applied to parent tabset when this is the only tab and it is stretched to fill the tabset"),t.add("enableWindowReMount",!1).setType(p.BOOLEAN).setDescription("if enabled the tab will re-mount when popped out/in"),t.addInherited("enableClose","tabEnableClose").setType(p.BOOLEAN).setDescription("allow user to close tab via close button"),t.addInherited("closeType","tabCloseType").setType("ICloseType").setDescription("see values in ICloseType"),t.addInherited("enableDrag","tabEnableDrag").setType(p.BOOLEAN).setDescription("allow user to drag tab to new location"),t.addInherited("enableRename","tabEnableRename").setType(p.BOOLEAN).setDescription("allow user to rename tabs by double clicking"),t.addInherited("className","tabClassName").setType(p.STRING).setDescription("class applied to tab button"),t.addInherited("contentClassName","tabContentClassName").setType(p.STRING).setDescription("class applied to tab content"),t.addInherited("icon","tabIcon").setType(p.STRING).setDescription("the tab icon"),t.addInherited("enableRenderOnDemand","tabEnableRenderOnDemand").setType(p.BOOLEAN).setDescription("whether to avoid rendering component until tab is visible"),t.addInherited("enablePopout","tabEnablePopout").setType(p.BOOLEAN).setAlias("enableFloat").setDescription("enable popout (in popout capable browser)"),t.addInherited("enablePopoutIcon","tabEnablePopoutIcon").setType(p.BOOLEAN).setDescription("whether to show the popout icon in the tabset header if this tab enables popouts"),t.addInherited("enablePopoutOverlay","tabEnablePopoutOverlay").setType(p.BOOLEAN).setDescription("if this tab will not work correctly in a popout window when the main window is backgrounded (inactive)\n then enabling this option will gray out this tab"),t.addInherited("borderWidth","tabBorderWidth").setType(p.NUMBER).setDescription("width when added to border, -1 will use border size"),t.addInherited("borderHeight","tabBorderHeight").setType(p.NUMBER).setDescription("height when added to border, -1 will use border size"),t.addInherited("minWidth","tabMinWidth").setType(p.NUMBER).setDescription("the min width of this tab"),t.addInherited("minHeight","tabMinHeight").setType(p.NUMBER).setDescription("the min height of this tab"),t.addInherited("maxWidth","tabMaxWidth").setType(p.NUMBER).setDescription("the max width of this tab"),t.addInherited("maxHeight","tabMaxHeight").setType(p.NUMBER).setDescription("the max height of this tab"),t}}function w(){return"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches}function A(t,e,i){let n,o=e.getName(),s=e.getName();void 0===i&&(i=0),void 0===n&&void 0!==e.getIcon()&&(n=0!==i?l.createElement("img",{style:{width:"1em",height:"1em",transform:"rotate("+i+"deg)"},src:e.getIcon(),alt:"leadingContent"}):l.createElement("img",{style:{width:"1em",height:"1em"},src:e.getIcon(),alt:"leadingContent"}));const a={leading:n,content:o,name:s,buttons:[]};return t.customizeTab(e,a),e.setRenderedName(a.name),a}function R(t){let e=!1;return t.nativeEvent instanceof MouseEvent&&(0!==t.nativeEvent.button||t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&(e=!0),e}function L(t,e){const i=[...y("iframe",e),...y("webview",e)];for(const e of i)e.style.pointerEvents=t?"auto":"none"}function y(t,e){return[...e.getElementsByTagName(t)]}function v(t){if(t instanceof O)return t.isEnablePopout();if(t instanceof I){for(const e of t.getChildren())if(!1===e.isEnablePopout())return!1;return!0}return!1}function N(t){const e=window.screen.availWidth,i=window.screen.availHeight;return t.x>=0&&t.getRight()<=e&&t.y>=0||t.getBottom()<=i}function D(t,e){const i=t.getAttribute("style");return i!==e.getAttribute("style")&&(i?e.setAttribute("style",i):e.removeAttribute("style"),!0)}function x(t,e){if(void 0!==t&&(t instanceof I||t instanceof F)){const i=t.getSelected();-1!==i&&(e===i&&t.getChildren().length>0?e>=t.getChildren().length&&t.setSelected(t.getChildren().length-1):e<i?t.setSelected(i-1):e>i||t.setSelected(-1))}}function S(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)))}O.TYPE="tab",O.attributeDefinitions=O.createAttributeDefinitions();class I extends f{static fromJson(t,e,i){const n=new I(e,t);if(null!=t.children)for(const i of t.children){const t=O.fromJson(i,e);n.addChild(t)}return 0===n.children.length&&n.setSelected(-1),t.maximized&&!0===t.maximized&&(i.maximizedTabSet=n),t.active&&!0===t.active&&(i.activeTabSet=n),n}constructor(t,e){super(t),this.tabStripRect=u.empty(),this.contentRect=u.empty(),this.calculatedMinHeight=0,this.calculatedMinWidth=0,this.calculatedMaxHeight=0,this.calculatedMaxWidth=0,I.attributeDefinitions.fromJson(e,this.attributes),t.addNode(this)}getName(){return this.getAttr("name")}isEnableActiveIcon(){return this.getAttr("enableActiveIcon")}getSelected(){const t=this.attributes.selected;return void 0!==t?t:-1}getSelectedNode(){const t=this.getSelected();if(-1!==t)return this.children[t]}getWeight(){return this.getAttr("weight")}getAttrMinWidth(){return this.getAttr("minWidth")}getAttrMinHeight(){return this.getAttr("minHeight")}getMinWidth(){return this.calculatedMinWidth}getMinHeight(){return this.calculatedMinHeight}getMinSize(t){return t===c.HORZ?this.getMinWidth():this.getMinHeight()}getAttrMaxWidth(){return this.getAttr("maxWidth")}getAttrMaxHeight(){return this.getAttr("maxHeight")}getMaxWidth(){return this.calculatedMaxWidth}getMaxHeight(){return this.calculatedMaxHeight}getMaxSize(t){return t===c.HORZ?this.getMaxWidth():this.getMaxHeight()}getConfig(){return this.attributes.config}isMaximized(){return this.model.getMaximizedTabset(this.getWindowId())===this}isActive(){return this.model.getActiveTabset(this.getWindowId())===this}isEnableDeleteWhenEmpty(){return this.getAttr("enableDeleteWhenEmpty")}isEnableDrop(){return this.getAttr("enableDrop")}isEnableTabWrap(){return this.getAttr("enableTabWrap")}isEnableDrag(){return this.getAttr("enableDrag")}isEnableDivide(){return this.getAttr("enableDivide")}isEnableMaximize(){return this.getAttr("enableMaximize")}isEnableClose(){return this.getAttr("enableClose")}isEnableSingleTabStretch(){return this.getAttr("enableSingleTabStretch")}isEnableTabStrip(){return this.getAttr("enableTabStrip")}isAutoSelectTab(){return this.getAttr("autoSelectTab")}getClassNameTabStrip(){return this.getAttr("classNameTabStrip")}getTabLocation(){return this.getAttr("tabLocation")}toJson(){const t={};return I.attributeDefinitions.toJson(t,this.attributes),t.children=this.children.map((t=>t.toJson())),this.isActive()&&(t.active=!0),this.isMaximized()&&(t.maximized=!0),t}calcMinMaxSize(){this.calculatedMinHeight=this.getAttrMinHeight(),this.calculatedMinWidth=this.getAttrMinWidth(),this.calculatedMaxHeight=this.getAttrMaxHeight(),this.calculatedMaxWidth=this.getAttrMaxWidth();for(const t of this.children){const e=t;this.calculatedMinWidth=Math.max(this.calculatedMinWidth,e.getMinWidth()),this.calculatedMinHeight=Math.max(this.calculatedMinHeight,e.getMinHeight()),this.calculatedMaxWidth=Math.min(this.calculatedMaxWidth,e.getMaxWidth()),this.calculatedMaxHeight=Math.min(this.calculatedMaxHeight,e.getMaxHeight())}}canMaximize(){return!!this.isEnableMaximize()&&(this.getModel().getMaximizedTabset(this.getWindowId())===this||this.getParent()!==this.getModel().getRoot(this.getWindowId())||1!==this.getModel().getRoot(this.getWindowId()).getChildren().length)}setContentRect(t){this.contentRect=t}getContentRect(){return this.contentRect}setTabStripRect(t){this.tabStripRect=t}setWeight(t){this.attributes.weight=t}setSelected(t){this.attributes.selected=t}getWindowId(){return this.parent.getWindowId()}canDrop(t,e,i){let n;if(t===this){const t=g.CENTER,e=this.tabStripRect;n=new m(this,e,t,-1,r.FLEXLAYOUT__OUTLINE_RECT)}else{if(this.getWindowId()!==W.MAIN_WINDOW_ID&&!v(t))return;if(this.contentRect.contains(e,i)){let t=g.CENTER;void 0===this.model.getMaximizedTabset(this.parent.getWindowId())&&(t=g.getLocation(this.contentRect,e,i));const o=t.getDockRect(this.rect);n=new m(this,o,t,-1,r.FLEXLAYOUT__OUTLINE_RECT)}else if(null!=this.tabStripRect&&this.tabStripRect.contains(e,i)){let t,o,s;if(0===this.children.length)t=this.tabStripRect.clone(),o=t.y+3,s=t.height-4,t.width=2;else{let a=this.children[0];t=a.getTabRect(),o=t.y,s=t.height;let l=this.tabStripRect.x,d=0;for(let s=0;s<this.children.length;s++){if(a=this.children[s],t=a.getTabRect(),t.y!==o&&(o=t.y,l=this.tabStripRect.x),d=t.x+t.width/2,e>=l&&e<d&&i>t.y&&i<t.getBottom()){const e=g.CENTER,i=new u(t.x-2,t.y,3,t.height);n=new m(this,i,e,s,r.FLEXLAYOUT__OUTLINE_RECT);break}l=d}}if(null==n){const e=g.CENTER,i=new u(t.getRight()-2,o,3,s);n=new m(this,i,e,this.children.length,r.FLEXLAYOUT__OUTLINE_RECT)}}}if(t.canDockInto(t,n))return n}delete(){this.parent.removeChild(this)}remove(t){const e=this.removeChild(t);this.model.tidy(),x(this,e)}drop(t,e,i,n){const o=e;if(this===t)return;let s=t.getParent(),a=0;if(void 0!==s&&(a=s.removeChild(t),s instanceof F&&s.getSelected()===a?s.setSelected(-1):x(s,a)),t instanceof O&&s===this&&a<i&&i>0&&i--,o===g.CENTER){let e=i;if(-1===e&&(e=this.children.length),t instanceof O)this.addChild(t,e),(n||!1!==n&&this.isAutoSelectTab())&&this.setSelected(e);else if(t instanceof M)t.forEachNode(((t,i)=>{t instanceof O&&(this.addChild(t,e),e++)}),0);else{for(let i=0;i<t.getChildren().length;i++){const n=t.getChildren()[i];this.addChild(n,e),e++}-1===this.getSelected()&&this.children.length>0&&this.setSelected(0)}this.model.setActiveTabset(this,this.parent.getWindowId())}else{let i=t;if(t instanceof O){const e=this.model.getOnCreateTabSet();i=new I(this.model,e?e(t):{}),i.addChild(t),s=i}else if(t instanceof M){const n=this.getParent();if(t.getOrientation()===n.getOrientation()&&(e.getOrientation()===n.getOrientation()||e===g.CENTER)){const e=new M(this.model,this.getWindowId(),{});e.addChild(t),i=e}}else i=t;const n=this.parent,a=n.getChildren().indexOf(this);if(n.getOrientation()===o.orientation)i.setWeight(this.getWeight()/2),this.setWeight(this.getWeight()/2),n.addChild(i,a+o.indexPlus);else{const t=new M(this.model,this.getWindowId(),{});t.setWeight(this.getWeight()),t.addChild(this),this.setWeight(50),i.setWeight(50),t.addChild(i,o.indexPlus),n.removeChild(this),n.addChild(t,a)}i instanceof I&&this.model.setActiveTabset(i,this.getWindowId())}this.model.tidy()}updateAttrs(t){I.attributeDefinitions.update(t,this.attributes)}getAttributeDefinitions(){return I.attributeDefinitions}static getAttributeDefinitions(){return I.attributeDefinitions}static createAttributeDefinitions(){const t=new E;return t.add("type",I.TYPE,!0).setType(p.STRING).setFixed(),t.add("id",void 0).setType(p.STRING).setDescription("the unique id of the tab set, if left undefined a uuid will be assigned"),t.add("weight",100).setType(p.NUMBER).setDescription("relative weight for sizing of this tabset in parent row"),t.add("selected",0).setType(p.NUMBER).setDescription("index of selected/visible tab in tabset"),t.add("name",void 0).setType(p.STRING),t.add("config",void 0).setType("any").setDescription("a place to hold json config used in your own code"),t.addInherited("enableDeleteWhenEmpty","tabSetEnableDeleteWhenEmpty").setDescription("whether to delete this tabset when is has no tabs"),t.addInherited("enableDrop","tabSetEnableDrop").setDescription("allow user to drag tabs into this tabset"),t.addInherited("enableDrag","tabSetEnableDrag").setDescription("allow user to drag tabs out this tabset"),t.addInherited("enableDivide","tabSetEnableDivide").setDescription("allow user to drag tabs to region of this tabset, splitting into new tabset"),t.addInherited("enableMaximize","tabSetEnableMaximize").setDescription("allow user to maximize tabset to fill view via maximize button"),t.addInherited("enableClose","tabSetEnableClose").setDescription("allow user to close tabset via a close button"),t.addInherited("enableSingleTabStretch","tabSetEnableSingleTabStretch").setDescription("if the tabset has only a single tab then stretch the single tab to fill area and display in a header style"),t.addInherited("classNameTabStrip","tabSetClassNameTabStrip").setDescription("a class name to apply to the tab strip"),t.addInherited("enableTabStrip","tabSetEnableTabStrip").setDescription("enable tab strip and allow multiple tabs in this tabset"),t.addInherited("minWidth","tabSetMinWidth").setDescription("minimum width (in px) for this tabset"),t.addInherited("minHeight","tabSetMinHeight").setDescription("minimum height (in px) for this tabset"),t.addInherited("maxWidth","tabSetMaxWidth").setDescription("maximum width (in px) for this tabset"),t.addInherited("maxHeight","tabSetMaxHeight").setDescription("maximum height (in px) for this tabset"),t.addInherited("enableTabWrap","tabSetEnableTabWrap").setDescription("show tabs in location top or bottom"),t.addInherited("tabLocation","tabSetTabLocation").setDescription("the location of the tabs either top or bottom"),t.addInherited("autoSelectTab","tabSetAutoSelectTab").setType(p.BOOLEAN).setDescription("whether to select new/moved tabs in tabset"),t.addInherited("enableActiveIcon","tabSetEnableActiveIcon").setType(p.BOOLEAN).setDescription("whether the active icon (*) should be displayed when the tabset is active"),t}}I.TYPE="tabset",I.attributeDefinitions=I.createAttributeDefinitions();class M extends f{static fromJson(t,e,i){const n=new M(e,i.windowId,t);if(null!=t.children)for(const o of t.children)if(o.type===I.TYPE){const t=I.fromJson(o,e,i);n.addChild(t)}else{const t=M.fromJson(o,e,i);n.addChild(t)}return n}constructor(t,e,i){super(t),this.windowId=e,this.minHeight=C,this.minWidth=C,this.maxHeight=U,this.maxWidth=U,M.attributeDefinitions.fromJson(i,this.attributes),this.normalizeWeights(),t.addNode(this)}getWeight(){return this.attributes.weight}toJson(){const t={};M.attributeDefinitions.toJson(t,this.attributes),t.children=[];for(const e of this.children)t.children.push(e.toJson());return t}getWindowId(){return this.windowId}setWindowId(t){this.windowId=t}setWeight(t){this.attributes.weight=t}getSplitterBounds(t){const e=this.getOrientation()===c.HORZ,i=this.getChildren(),n=this.model.getSplitterSize(),o=i[0].getRect(),s=i[i.length-1].getRect();let a=e?[o.x,s.getRight()]:[o.y,s.getBottom()];const r=e?[o.x,s.getRight()]:[o.y,s.getBottom()];for(let o=0;o<t;o++){const t=i[o];a[0]+=e?t.getMinWidth():t.getMinHeight(),r[0]+=e?t.getMaxWidth():t.getMaxHeight(),o>0&&(a[0]+=n,r[0]+=n)}for(let o=i.length-1;o>=t;o--){const t=i[o];a[1]-=(e?t.getMinWidth():t.getMinHeight())+n,r[1]-=(e?t.getMaxWidth():t.getMaxHeight())+n}return a=[Math.max(r[1],a[0]),Math.min(r[0],a[1])],a}getSplitterInitials(t){const e=this.getOrientation()===c.HORZ,i=this.getChildren(),n=this.model.getSplitterSize(),o=[];let s=0;for(let t=0;t<i.length;t++){const n=i[t].getRect(),a=e?n.width:n.height;o.push(a),s+=a}const a=i[t].getRect();return{initialSizes:o,sum:s,startPosition:(e?a.x:a.y)-n}}calculateSplit(t,e,i,n,o){const s=this.getOrientation()===c.HORZ,a=this.getChildren(),r=a[t],l=s?r.getMaxWidth():r.getMaxHeight(),d=[...i];if(e<o){let i=o-e,n=0;d[t]+i>l?(n=d[t]+i-l,d[t]=l):d[t]+=i;for(let e=t-1;e>=0;e--){const t=a[e],n=s?t.getMinWidth():t.getMinHeight();if(d[e]-i>n){d[e]-=i;break}i-=d[e]-n,d[e]=n}for(let e=t+1;e<a.length;e++){const t=a[e],i=s?t.getMaxWidth():t.getMaxHeight();if(d[e]+n<i){d[e]+=n;break}n-=i-d[e],d[e]=i}}else{let i=e-o,n=0;d[t-1]+i>l?(n=d[t-1]+i-l,d[t-1]=l):d[t-1]+=i;for(let e=t;e<a.length;e++){const t=a[e],n=s?t.getMinWidth():t.getMinHeight();if(d[e]-i>n){d[e]-=i;break}i-=d[e]-n,d[e]=n}for(let e=t-1;e>=0;e--){const t=a[e],i=s?t.getMaxWidth():t.getMaxHeight();if(d[e]+n<i){d[e]+=n;break}n-=i-d[e],d[e]=i}}return d.map((t=>100*Math.max(.1,t)/n))}getMinSize(t){return t===c.HORZ?this.getMinWidth():this.getMinHeight()}getMinWidth(){return this.minWidth}getMinHeight(){return this.minHeight}getMaxSize(t){return t===c.HORZ?this.getMaxWidth():this.getMaxHeight()}getMaxWidth(){return this.maxWidth}getMaxHeight(){return this.maxHeight}calcMinMaxSize(){this.minHeight=C,this.minWidth=C,this.maxHeight=U,this.maxWidth=U;let t=!0;for(const e of this.children){const i=e;i.calcMinMaxSize(),this.getOrientation()===c.VERT?(this.minHeight+=i.getMinHeight(),this.maxHeight+=i.getMaxHeight(),t||(this.minHeight+=this.model.getSplitterSize(),this.maxHeight+=this.model.getSplitterSize()),this.minWidth=Math.max(this.minWidth,i.getMinWidth()),this.maxWidth=Math.min(this.maxWidth,i.getMaxWidth())):(this.minWidth+=i.getMinWidth(),this.maxWidth+=i.getMaxWidth(),t||(this.minWidth+=this.model.getSplitterSize(),this.maxWidth+=this.model.getSplitterSize()),this.minHeight=Math.max(this.minHeight,i.getMinHeight()),this.maxHeight=Math.min(this.maxHeight,i.getMaxHeight())),t=!1}}tidy(){let t=0;for(;t<this.children.length;){const e=this.children[t];if(e instanceof M){e.tidy();const i=e.getChildren();if(0===i.length)this.removeChild(e);else if(1===i.length){const n=i[0];if(this.removeChild(e),n instanceof M){let i=0;const o=n.getChildren();for(const t of o)i+=t.getWeight();for(let n=0;n<o.length;n++){const s=o[n];s.setWeight(e.getWeight()*s.getWeight()/i),this.addChild(s,t+n)}}else n.setWeight(e.getWeight()),this.addChild(n,t)}else t++}else e instanceof I&&0===e.getChildren().length&&e.isEnableDeleteWhenEmpty()?(this.removeChild(e),e===this.model.getMaximizedTabset(this.windowId)&&this.model.setMaximizedTabset(void 0,this.windowId)):t++}if(this===this.model.getRoot(this.windowId)&&0===this.children.length){const t=this.model.getOnCreateTabSet();let e=t?t():{};e=Object.assign(Object.assign({},e),{selected:-1});const i=new I(this.model,e);this.model.setActiveTabset(i,this.windowId),this.addChild(i)}}canDrop(t,e,i){const n=i-this.rect.y,o=e-this.rect.x,s=this.rect.width,a=this.rect.height,l=50;let d;if(this.getWindowId()===W.MAIN_WINDOW_ID||v(t)){if(this.model.isEnableEdgeDock()&&void 0===this.parent){if(e<this.rect.x+10&&n>a/2-l&&n<a/2+l){const t=g.LEFT,e=t.getDockRect(this.rect);e.width=e.width/2,d=new m(this,e,t,-1,r.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(e>this.rect.getRight()-10&&n>a/2-l&&n<a/2+l){const t=g.RIGHT,e=t.getDockRect(this.rect);e.width=e.width/2,e.x+=e.width,d=new m(this,e,t,-1,r.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(i<this.rect.y+10&&o>s/2-l&&o<s/2+l){const t=g.TOP,e=t.getDockRect(this.rect);e.height=e.height/2,d=new m(this,e,t,-1,r.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(i>this.rect.getBottom()-10&&o>s/2-l&&o<s/2+l){const t=g.BOTTOM,e=t.getDockRect(this.rect);e.height=e.height/2,e.y+=e.height,d=new m(this,e,t,-1,r.FLEXLAYOUT__OUTLINE_RECT_EDGE)}if(void 0!==d&&!t.canDockInto(t,d))return}return d}}drop(t,e,i){const n=e,o=t.getParent();let s;if(o&&o.removeChild(t),void 0!==o&&o instanceof I&&o.setSelected(0),void 0!==o&&o instanceof F&&o.setSelected(-1),t instanceof I||t instanceof M)s=t,s instanceof M&&s.getOrientation()===this.getOrientation()&&(e.getOrientation()===this.getOrientation()||e===g.CENTER)&&(s=new M(this.model,this.windowId,{}),s.addChild(t));else{const e=this.model.getOnCreateTabSet();s=new I(this.model,e?e(t):{}),s.addChild(t)}let a=this.children.reduce(((t,e)=>t+e.getWeight()),0);0===a&&(a=100),s.setWeight(a/3);const r=!this.model.isRootOrientationVertical();if(n===g.CENTER)-1===i?this.addChild(s,this.children.length):this.addChild(s,i);else if(r&&n===g.LEFT||!r&&n===g.TOP)this.addChild(s,0);else if(r&&n===g.RIGHT||!r&&n===g.BOTTOM)this.addChild(s);else if(r&&n===g.TOP||!r&&n===g.LEFT){const t=new M(this.model,this.windowId,{}),e=new M(this.model,this.windowId,{});e.setWeight(75),s.setWeight(25);for(const t of this.children)e.addChild(t);this.removeAll(),t.addChild(s),t.addChild(e),this.addChild(t)}else if(r&&n===g.BOTTOM||!r&&n===g.RIGHT){const t=new M(this.model,this.windowId,{}),e=new M(this.model,this.windowId,{});e.setWeight(75),s.setWeight(25);for(const t of this.children)e.addChild(t);this.removeAll(),t.addChild(e),t.addChild(s),this.addChild(t)}s instanceof I&&this.model.setActiveTabset(s,this.windowId),this.model.tidy()}isEnableDrop(){return!0}getAttributeDefinitions(){return M.attributeDefinitions}updateAttrs(t){M.attributeDefinitions.update(t,this.attributes)}static getAttributeDefinitions(){return M.attributeDefinitions}normalizeWeights(){let t=0;for(const e of this.children)t+=e.getWeight();0===t&&(t=1);for(const e of this.children){const i=e;i.setWeight(Math.max(.001,100*i.getWeight()/t))}}static createAttributeDefinitions(){const t=new E;return t.add("type",M.TYPE,!0).setType(p.STRING).setFixed(),t.add("id",void 0).setType(p.STRING).setDescription("the unique id of the row, if left undefined a uuid will be assigned"),t.add("weight",100).setType(p.NUMBER).setDescription("relative weight for sizing of this row in parent row"),t}}M.TYPE="row",M.attributeDefinitions=M.createAttributeDefinitions();class B{constructor(t,e){this._windowId=t,this._rect=e,this._toScreenRectFunction=t=>t}visitNodes(t){this.root.forEachNode(t,0)}get windowId(){return this._windowId}get rect(){return this._rect}get layout(){return this._layout}get window(){return this._window}get root(){return this._root}get maximizedTabSet(){return this._maximizedTabSet}get activeTabSet(){return this._activeTabSet}set rect(t){this._rect=t}set layout(t){this._layout=t}set window(t){this._window=t}set root(t){this._root=t}set maximizedTabSet(t){this._maximizedTabSet=t}set activeTabSet(t){this._activeTabSet=t}get toScreenRectFunction(){return this._toScreenRectFunction}set toScreenRectFunction(t){this._toScreenRectFunction=t}toJson(){return this._window&&this._window.screenTop>-1e4&&(this.rect=new u(this._window.screenLeft,this._window.screenTop,this._window.outerWidth,this._window.outerHeight)),{layout:this.root.toJson(),rect:this.rect.toJson()}}static fromJson(t,e,i){const n=e.getwindowsMap().size;let o=t.rect?u.fromJson(t.rect):new u(50+50*n,50+50*n,600,400);o=function(t){t.snap(10);const e=window.screen.availWidth,i=window.screen.availHeight;return(t.x+t.width>e||t.y+t.height>i)&&(t.x=Math.max(0,Math.min(t.x,e-t.width)),t.y=Math.max(0,Math.min(t.y,i-t.height))),t}(o);const s=new B(i,o);return s.root=M.fromJson(t.layout,e,s),s}}const C=0,U=99999;class W{constructor(){this.attributes={},this.idMap=new Map,this.borders=new b(this),this.windows=new Map,this.rootWindow=new B(W.MAIN_WINDOW_ID,u.empty()),this.windows.set(W.MAIN_WINDOW_ID,this.rootWindow),this.changeListeners=[]}doAction(t){var e;let i;switch(t.type){case _.ADD_NODE:{const e=new O(this,t.data.json,!0),n=this.idMap.get(t.data.toNode);(n instanceof I||n instanceof F||n instanceof M)&&(n.drop(e,g.getByName(t.data.location),t.data.index,t.data.select),i=e);break}case _.MOVE_NODE:{const e=this.idMap.get(t.data.fromNode);if(e instanceof O||e instanceof I||e instanceof M){e===this.getMaximizedTabset(e.getWindowId())&&(this.windows.get(e.getWindowId()).maximizedTabSet=void 0);const i=this.idMap.get(t.data.toNode);(i instanceof I||i instanceof F||i instanceof M)&&i.drop(e,g.getByName(t.data.location),t.data.index,t.data.select)}this.removeEmptyWindows();break}case _.DELETE_TAB:{const e=this.idMap.get(t.data.node);e instanceof O&&e.delete(),this.removeEmptyWindows();break}case _.DELETE_TABSET:{const e=this.idMap.get(t.data.node);if(e instanceof I){const t=[...e.getChildren()];for(let e=0;e<t.length;e++){const i=t[e];i.isEnableClose()&&i.delete()}0===e.getChildren().length&&e.delete(),this.tidy()}this.removeEmptyWindows();break}case _.POPOUT_TABSET:{const e=this.idMap.get(t.data.node);if(e instanceof I){const t=e.isMaximized(),i=this.windows.get(e.getWindowId()),n=S(),o=new B(n,i.toScreenRectFunction(e.getRect())),s={type:"row",children:[]},a=M.fromJson(s,this,o);o.root=a,this.windows.set(n,o),a.drop(e,g.CENTER,0),t&&(this.rootWindow.maximizedTabSet=void 0)}this.removeEmptyWindows();break}case _.POPOUT_TAB:{const e=this.idMap.get(t.data.node);if(e instanceof O){const t=S();let i=u.empty();i=e.getParent()instanceof I?e.getParent().getRect():e.getParent().getContentRect();const n=this.windows.get(e.getWindowId()),o=new B(t,n.toScreenRectFunction(i)),s=S(),a={type:"row",children:[{type:"tabset",id:s}]},r=M.fromJson(a,this,o);o.root=r,this.windows.set(t,o),this.idMap.get(s).drop(e,g.CENTER,0,!0)}this.removeEmptyWindows();break}case _.CLOSE_WINDOW:{const i=this.windows.get(t.data.windowId);i&&(null===(e=this.rootWindow.root)||void 0===e||e.drop(null==i?void 0:i.root,g.CENTER,-1),this.rootWindow.visitNodes(((t,e)=>{t instanceof M&&t.setWindowId(W.MAIN_WINDOW_ID)})),this.windows.delete(t.data.windowId));break}case _.CREATE_WINDOW:{const e=S(),n=new B(e,u.fromJson(t.data.rect)),o=M.fromJson(t.data.layout,this,n);n.root=o,this.windows.set(e,n),i=e;break}case _.RENAME_TAB:{const e=this.idMap.get(t.data.node);e instanceof O&&e.setName(t.data.text);break}case _.SELECT_TAB:{const e=this.idMap.get(t.data.tabNode),i=t.data.windowId?t.data.windowId:W.MAIN_WINDOW_ID,n=this.windows.get(i);if(e instanceof O){const t=e.getParent(),i=t.getChildren().indexOf(e);t instanceof F?t.getSelected()===i?t.setSelected(-1):t.setSelected(i):t instanceof I&&(t.getSelected()!==i&&t.setSelected(i),n.activeTabSet=t)}break}case _.SET_ACTIVE_TABSET:{const e=t.data.windowId?t.data.windowId:W.MAIN_WINDOW_ID,i=this.windows.get(e);if(void 0===t.data.tabsetNode)i.activeTabSet=void 0;else{const e=this.idMap.get(t.data.tabsetNode);e instanceof I&&(i.activeTabSet=e)}break}case _.ADJUST_WEIGHTS:{const e=this.idMap.get(t.data.nodeId).getChildren();for(let i=0;i<e.length;i++)e[i].setWeight(t.data.weights[i]);break}case _.ADJUST_BORDER_SPLIT:{const e=this.idMap.get(t.data.node);e instanceof F&&e.setSize(t.data.pos);break}case _.MAXIMIZE_TOGGLE:{const e=t.data.windowId?t.data.windowId:W.MAIN_WINDOW_ID,i=this.windows.get(e),n=this.idMap.get(t.data.node);n instanceof I&&(n===i.maximizedTabSet?i.maximizedTabSet=void 0:(i.maximizedTabSet=n,i.activeTabSet=n));break}case _.UPDATE_MODEL_ATTRIBUTES:this.updateAttrs(t.data.json);break;case _.UPDATE_NODE_ATTRIBUTES:this.idMap.get(t.data.node).updateAttrs(t.data.json)}this.updateIdMap();for(const e of this.changeListeners)e(t);return i}getActiveTabset(t=W.MAIN_WINDOW_ID){const e=this.windows.get(t);return e&&e.activeTabSet&&this.getNodeById(e.activeTabSet.getId())?e.activeTabSet:void 0}getMaximizedTabset(t=W.MAIN_WINDOW_ID){return this.windows.get(t).maximizedTabSet}getRoot(t=W.MAIN_WINDOW_ID){return this.windows.get(t).root}isRootOrientationVertical(){return this.attributes.rootOrientationVertical}isEnableRotateBorderIcons(){return this.attributes.enableRotateBorderIcons}getBorderSet(){return this.borders}getwindowsMap(){return this.windows}visitNodes(t){this.borders.forEachNode(t);for(const[e,i]of this.windows)i.root.forEachNode(t,0)}visitWindowNodes(t,e){this.windows.has(t)&&(t===W.MAIN_WINDOW_ID&&this.borders.forEachNode(e),this.windows.get(t).visitNodes(e))}getNodeById(t){return this.idMap.get(t)}getFirstTabSet(t=this.windows.get(W.MAIN_WINDOW_ID).root){const e=t.getChildren()[0];return e instanceof I?e:this.getFirstTabSet(e)}static fromJson(t){const e=new W;if(W.attributeDefinitions.fromJson(t.global,e.attributes),t.borders&&(e.borders=b.fromJson(t.borders,e)),t.popouts){let i=0,n=100,o=100;for(const s in t.popouts){const a=t.popouts[s],r=B.fromJson(a,e,s);e.windows.set(s,r),N(r.rect)||(r.rect=new u(n+50*i,o+50*i,600,400),i++)}}return e.rootWindow.root=M.fromJson(t.layout,e,e.getwindowsMap().get(W.MAIN_WINDOW_ID)),e.tidy(),e}toJson(){const t={};W.attributeDefinitions.toJson(t,this.attributes),this.visitNodes((t=>{t.fireEvent("save",{})}));const e={};for(const[t,i]of this.windows)t!==W.MAIN_WINDOW_ID&&(e[t]=i.toJson());return{global:t,borders:this.borders.toJson(),layout:this.rootWindow.root.toJson(),popouts:e}}getSplitterSize(){return this.attributes.splitterSize}getSplitterExtra(){return this.attributes.splitterExtra}isEnableEdgeDock(){return this.attributes.enableEdgeDock}isSplitterEnableHandle(){return this.attributes.splitterEnableHandle}setOnAllowDrop(t){this.onAllowDrop=t}setOnCreateTabSet(t){this.onCreateTabSet=t}addChangeListener(t){this.changeListeners.push(t)}removeChangeListener(t){const e=this.changeListeners.findIndex((e=>e===t));-1!==e&&this.changeListeners.splice(e,1)}toString(){return JSON.stringify(this.toJson())}removeEmptyWindows(){const t=new Set;for(const[e]of this.windows)if(e!==W.MAIN_WINDOW_ID){let i=0;this.visitWindowNodes(e,(t=>{t instanceof O&&i++})),0===i&&t.add(e)}for(const e of t)this.windows.delete(e)}setActiveTabset(t,e){const i=this.windows.get(e);i&&(i.activeTabSet=t||void 0)}setMaximizedTabset(t,e){const i=this.windows.get(e);i&&(i.maximizedTabSet=t||void 0)}updateIdMap(){this.idMap.clear(),this.visitNodes((t=>{this.idMap.set(t.getId(),t)}))}addNode(t){const e=t.getId();if(this.idMap.has(e))throw new Error(`Error: each node must have a unique id, duplicate id:${t.getId()}`);this.idMap.set(e,t)}findDropTargetNode(t,e,i,n){let o=this.windows.get(t).root.findDropTargetNode(t,e,i,n);return void 0===o&&t===W.MAIN_WINDOW_ID&&(o=this.borders.findDropTargetNode(e,i,n)),o}tidy(){for(const[t,e]of this.windows)e.root.tidy()}updateAttrs(t){W.attributeDefinitions.update(t,this.attributes)}nextUniqueId(){return"#"+S()}getAttribute(t){return this.attributes[t]}getOnAllowDrop(){return this.onAllowDrop}getOnCreateTabSet(){return this.onCreateTabSet}static toTypescriptInterfaces(){W.attributeDefinitions.pairAttributes("RowNode",M.getAttributeDefinitions()),W.attributeDefinitions.pairAttributes("TabSetNode",I.getAttributeDefinitions()),W.attributeDefinitions.pairAttributes("TabNode",O.getAttributeDefinitions()),W.attributeDefinitions.pairAttributes("BorderNode",F.getAttributeDefinitions());let t=[];t.push(W.attributeDefinitions.toTypescriptInterface("Global",void 0)),t.push(M.getAttributeDefinitions().toTypescriptInterface("Row",W.attributeDefinitions)),t.push(I.getAttributeDefinitions().toTypescriptInterface("TabSet",W.attributeDefinitions)),t.push(O.getAttributeDefinitions().toTypescriptInterface("Tab",W.attributeDefinitions)),t.push(F.getAttributeDefinitions().toTypescriptInterface("Border",W.attributeDefinitions)),console.log(t.join("\n"))}static createAttributeDefinitions(){const t=new E;return t.add("enableEdgeDock",!0).setType(p.BOOLEAN).setDescription("enable docking to the edges of the layout, this will show the edge indicators"),t.add("rootOrientationVertical",!1).setType(p.BOOLEAN).setDescription("the top level 'row' will layout horizontally by default, set this option true to make it layout vertically"),t.add("enableRotateBorderIcons",!0).setType(p.BOOLEAN).setDescription("boolean indicating if tab icons should rotate with the text in the left and right borders"),t.add("splitterSize",8).setType(p.NUMBER).setDescription("width in pixels of all splitters between tabsets/borders"),t.add("splitterExtra",0).setType(p.NUMBER).setDescription("additional width in pixels of the splitter hit test area"),t.add("splitterEnableHandle",!1).setType(p.BOOLEAN).setDescription("enable a small centralized handle on all splitters"),t.add("tabEnableClose",!0).setType(p.BOOLEAN),t.add("tabCloseType",1).setType("ICloseType"),t.add("tabEnablePopout",!1).setType(p.BOOLEAN).setAlias("tabEnableFloat"),t.add("tabEnablePopoutIcon",!0).setType(p.BOOLEAN),t.add("tabEnablePopoutOverlay",!1).setType(p.BOOLEAN),t.add("tabEnableDrag",!0).setType(p.BOOLEAN),t.add("tabEnableRename",!0).setType(p.BOOLEAN),t.add("tabContentClassName",void 0).setType(p.STRING),t.add("tabClassName",void 0).setType(p.STRING),t.add("tabIcon",void 0).setType(p.STRING),t.add("tabEnableRenderOnDemand",!0).setType(p.BOOLEAN),t.add("tabDragSpeed",.3).setType(p.NUMBER),t.add("tabBorderWidth",-1).setType(p.NUMBER),t.add("tabBorderHeight",-1).setType(p.NUMBER),t.add("tabSetEnableDeleteWhenEmpty",!0).setType(p.BOOLEAN),t.add("tabSetEnableDrop",!0).setType(p.BOOLEAN),t.add("tabSetEnableDrag",!0).setType(p.BOOLEAN),t.add("tabSetEnableDivide",!0).setType(p.BOOLEAN),t.add("tabSetEnableMaximize",!0).setType(p.BOOLEAN),t.add("tabSetEnableClose",!1).setType(p.BOOLEAN),t.add("tabSetEnableSingleTabStretch",!1).setType(p.BOOLEAN),t.add("tabSetAutoSelectTab",!0).setType(p.BOOLEAN),t.add("tabSetEnableActiveIcon",!1).setType(p.BOOLEAN),t.add("tabSetClassNameTabStrip",void 0).setType(p.STRING),t.add("tabSetEnableTabStrip",!0).setType(p.BOOLEAN),t.add("tabSetEnableTabWrap",!1).setType(p.BOOLEAN),t.add("tabSetTabLocation","top").setType("ITabLocation"),t.add("tabMinWidth",C).setType(p.NUMBER),t.add("tabMinHeight",C).setType(p.NUMBER),t.add("tabSetMinWidth",C).setType(p.NUMBER),t.add("tabSetMinHeight",C).setType(p.NUMBER),t.add("tabMaxWidth",U).setType(p.NUMBER),t.add("tabMaxHeight",U).setType(p.NUMBER),t.add("tabSetMaxWidth",U).setType(p.NUMBER),t.add("tabSetMaxHeight",U).setType(p.NUMBER),t.add("borderSize",200).setType(p.NUMBER),t.add("borderMinSize",C).setType(p.NUMBER),t.add("borderMaxSize",U).setType(p.NUMBER),t.add("borderEnableDrop",!0).setType(p.BOOLEAN),t.add("borderAutoSelectTabWhenOpen",!0).setType(p.BOOLEAN),t.add("borderAutoSelectTabWhenClosed",!1).setType(p.BOOLEAN),t.add("borderClassName",void 0).setType(p.STRING),t.add("borderEnableAutoHide",!1).setType(p.BOOLEAN),t}}W.MAIN_WINDOW_ID="__main_window_id__",W.attributeDefinitions=W.createAttributeDefinitions();class F extends f{static fromJson(t,e){const i=g.getByName(t.location),n=new F(i,t,e);return t.children&&(n.children=t.children.map((t=>{const i=O.fromJson(t,e);return i.setParent(n),i}))),n}constructor(t,e,i){super(i),this.outerRect=u.empty(),this.contentRect=u.empty(),this.tabHeaderRect=u.empty(),this.location=t,this.attributes.id=`border_${t.getName()}`,F.attributeDefinitions.fromJson(e,this.attributes),i.addNode(this)}getLocation(){return this.location}getClassName(){return this.getAttr("className")}isHorizontal(){return this.location.orientation===c.HORZ}getSize(){const t=this.getAttr("size"),e=this.getSelected();if(-1===e)return t;{const i=this.children[e],n=this.isHorizontal()?i.getAttr("borderWidth"):i.getAttr("borderHeight");return-1===n?t:n}}getMinSize(){const t=this.getSelectedNode();let e=this.getAttr("minSize");if(t){const i=this.isHorizontal()?t.getMinWidth():t.getMinHeight();e=Math.max(e,i)}return e}getMaxSize(){const t=this.getSelectedNode();let e=this.getAttr("maxSize");if(t){const i=this.isHorizontal()?t.getMaxWidth():t.getMaxHeight();e=Math.min(e,i)}return e}getSelected(){return this.attributes.selected}isAutoHide(){return this.getAttr("enableAutoHide")}getSelectedNode(){if(-1!==this.getSelected())return this.children[this.getSelected()]}getOrientation(){return this.location.getOrientation()}getConfig(){return this.attributes.config}isMaximized(){return!1}isShowing(){return this.attributes.show}toJson(){const t={};return F.attributeDefinitions.toJson(t,this.attributes),t.location=this.location.getName(),t.children=this.children.map((t=>t.toJson())),t}isAutoSelectTab(t){return null==t&&(t=-1!==this.getSelected()),t?this.getAttr("autoSelectTabWhenOpen"):this.getAttr("autoSelectTabWhenClosed")}setSelected(t){this.attributes.selected=t}getTabHeaderRect(){return this.tabHeaderRect}setTabHeaderRect(t){this.tabHeaderRect=t}getOuterRect(){return this.outerRect}setOuterRect(t){this.outerRect=t}getRect(){return this.tabHeaderRect}getContentRect(){return this.contentRect}setContentRect(t){this.contentRect=t}isEnableDrop(){return this.getAttr("enableDrop")}setSize(t){const e=this.getSelected();if(-1===e)this.attributes.size=t;else{const i=this.children[e];-1===(this.isHorizontal()?i.getAttr("borderWidth"):i.getAttr("borderHeight"))?this.attributes.size=t:this.isHorizontal()?i.setBorderWidth(t):i.setBorderHeight(t)}}updateAttrs(t){F.attributeDefinitions.update(t,this.attributes)}remove(t){const e=this.removeChild(t);-1!==this.getSelected()&&x(this,e)}canDrop(t,e,i){if(!(t instanceof O))return;let n;const o=g.CENTER;if(this.tabHeaderRect.contains(e,i)){if(this.location.orientation===c.VERT)if(this.children.length>0){let t=this.children[0],i=t.getTabRect();const s=i.y,a=i.height;let l=this.tabHeaderRect.x,d=0;for(let h=0;h<this.children.length;h++){if(t=this.children[h],i=t.getTabRect(),d=i.x+i.width/2,e>=l&&e<d){const t=new u(i.x-2,s,3,a);n=new m(this,t,o,h,r.FLEXLAYOUT__OUTLINE_RECT);break}l=d}if(null==n){const t=new u(i.getRight()-2,s,3,a);n=new m(this,t,o,this.children.length,r.FLEXLAYOUT__OUTLINE_RECT)}}else{const t=new u(this.tabHeaderRect.x+1,this.tabHeaderRect.y+2,3,18);n=new m(this,t,o,0,r.FLEXLAYOUT__OUTLINE_RECT)}else if(this.children.length>0){let t=this.children[0],e=t.getTabRect();const s=e.x,a=e.width;let l=this.tabHeaderRect.y,d=0;for(let h=0;h<this.children.length;h++){if(t=this.children[h],e=t.getTabRect(),d=e.y+e.height/2,i>=l&&i<d){const t=new u(s,e.y-2,a,3);n=new m(this,t,o,h,r.FLEXLAYOUT__OUTLINE_RECT);break}l=d}if(null==n){const t=new u(s,e.getBottom()-2,a,3);n=new m(this,t,o,this.children.length,r.FLEXLAYOUT__OUTLINE_RECT)}}else{const t=new u(this.tabHeaderRect.x+2,this.tabHeaderRect.y+1,18,3);n=new m(this,t,o,0,r.FLEXLAYOUT__OUTLINE_RECT)}if(!t.canDockInto(t,n))return}else if(-1!==this.getSelected()&&this.outerRect.contains(e,i)){const e=this.outerRect;if(n=new m(this,e,o,-1,r.FLEXLAYOUT__OUTLINE_RECT),!t.canDockInto(t,n))return}return n}drop(t,e,i,n){let o=0;const s=t.getParent();void 0!==s&&(o=s.removeChild(t),s!==this&&s instanceof F&&s.getSelected()===o?s.setSelected(-1):x(s,o)),t instanceof O&&s===this&&o<i&&i>0&&i--;let a=i;-1===a&&(a=this.children.length),t instanceof O&&this.addChild(t,a),(n||!1!==n&&this.isAutoSelectTab())&&this.setSelected(a),this.model.tidy()}getSplitterBounds(t,e=!1){const i=[0,0],n=e?this.getMinSize():0,o=e?this.getMaxSize():99999,s=this.model.getRoot(W.MAIN_WINDOW_ID),a=s.getRect(),r=this.model.getSplitterSize();if(this.location===g.TOP){i[0]=this.tabHeaderRect.getBottom()+n;const t=this.tabHeaderRect.getBottom()+o;i[1]=Math.max(i[0],a.getBottom()-s.getMinHeight()-r),i[1]=Math.min(i[1],t)}else if(this.location===g.LEFT){i[0]=this.tabHeaderRect.getRight()+n;const t=this.tabHeaderRect.getRight()+o;i[1]=Math.max(i[0],a.getRight()-s.getMinWidth()-r),i[1]=Math.min(i[1],t)}else if(this.location===g.BOTTOM){i[1]=this.tabHeaderRect.y-n-r;const t=this.tabHeaderRect.y-o-r;i[0]=Math.min(i[1],a.y+s.getMinHeight()),i[0]=Math.max(i[0],t)}else if(this.location===g.RIGHT){i[1]=this.tabHeaderRect.x-n-r;const t=this.tabHeaderRect.x-o-r;i[0]=Math.min(i[1],a.x+s.getMinWidth()),i[0]=Math.max(i[0],t)}return i}calculateSplit(t,e){const i=this.getSplitterBounds(e);return this.location===g.BOTTOM||this.location===g.RIGHT?Math.max(0,i[1]-e):Math.max(0,e-i[0])}getAttributeDefinitions(){return F.attributeDefinitions}static getAttributeDefinitions(){return F.attributeDefinitions}static createAttributeDefinitions(){const t=new E;return t.add("type",F.TYPE,!0).setType(p.STRING).setFixed(),t.add("selected",-1).setType(p.NUMBER).setDescription("index of selected/visible tab in border; -1 means no tab selected"),t.add("show",!0).setType(p.BOOLEAN).setDescription("show/hide this border"),t.add("config",void 0).setType("any").setDescription("a place to hold json config used in your own code"),t.addInherited("enableDrop","borderEnableDrop").setType(p.BOOLEAN).setDescription("whether tabs can be dropped into this border"),t.addInherited("className","borderClassName").setType(p.STRING).setDescription("class applied to tab button"),t.addInherited("autoSelectTabWhenOpen","borderAutoSelectTabWhenOpen").setType(p.BOOLEAN).setDescription("whether to select new/moved tabs in border when the border is already open"),t.addInherited("autoSelectTabWhenClosed","borderAutoSelectTabWhenClosed").setType(p.BOOLEAN).setDescription("whether to select new/moved tabs in border when the border is currently closed"),t.addInherited("size","borderSize").setType(p.NUMBER).setDescription("size of the tab area when selected"),t.addInherited("minSize","borderMinSize").setType(p.NUMBER).setDescription("the minimum size of the tab area"),t.addInherited("maxSize","borderMaxSize").setType(p.NUMBER).setDescription("the maximum size of the tab area"),t.addInherited("enableAutoHide","borderEnableAutoHide").setType(p.BOOLEAN).setDescription("hide border if it has zero tabs"),t}}F.TYPE="border",F.attributeDefinitions=F.createAttributeDefinitions();const Y=t=>{const{layout:e,node:i,index:n,horizontal:o}=t,[s,a]=l.useState(!1),d=l.useRef(null),h=l.useRef(null),g=l.useRef([]),T=l.useRef(void 0),p=l.useRef(void 0),E=l.useRef(0),m=l.useRef(0),b=l.useRef({initialSizes:[],sum:0,startPosition:0}),f=i.getModel().getSplitterSize();let O=i.getModel().getSplitterExtra();w()||(O=Math.max(30,O+f)-f),l.useEffect((()=>{var t,e;return null===(t=d.current)||void 0===t||t.addEventListener("touchstart",A,{passive:!1}),null===(e=h.current)||void 0===e||e.addEventListener("touchstart",A,{passive:!1}),()=>{var t,e;null===(t=d.current)||void 0===t||t.removeEventListener("touchstart",A),null===(e=h.current)||void 0===e||e.removeEventListener("touchstart",A)}}),[]);const A=t=>{t.preventDefault(),t.stopImmediatePropagation()},R=t=>{var s;t.stopPropagation(),i instanceof M&&(b.current=i.getSplitterInitials(n)),L(!1,e.getCurrentDocument()),function(t,e,i,n,o){e.preventDefault();const s=t=>{t.preventDefault(),i(t.clientX,t.clientY)},a=t=>{t.preventDefault(),o()},r=()=>{t.removeEventListener("pointermove",s),t.removeEventListener("pointerup",r),t.removeEventListener("pointercancel",a),n()};t.addEventListener("pointermove",s),t.addEventListener("pointerup",r),t.addEventListener("pointercancel",a)}(t.currentTarget.ownerDocument,t,v,N,y),g.current=i.getSplitterBounds(n,!0);const l=e.getRootDiv();T.current=e.getCurrentDocument().createElement("div"),T.current.style.flexDirection=o?"row":"column",T.current.className=e.getClassName(r.FLEXLAYOUT__SPLITTER_DRAG),T.current.style.cursor=i.getOrientation()===c.VERT?"ns-resize":"ew-resize",i.getModel().isSplitterEnableHandle()&&(p.current=e.getCurrentDocument().createElement("div"),p.current.className=S(r.FLEXLAYOUT__SPLITTER_HANDLE)+" "+S(o?r.FLEXLAYOUT__SPLITTER_HANDLE_HORZ:r.FLEXLAYOUT__SPLITTER_HANDLE_VERT),T.current.appendChild(p.current));const h=null===(s=d.current)||void 0===s?void 0:s.getBoundingClientRect(),_=new u(h.x-e.getDomRect().x,h.y-e.getDomRect().y,h.width,h.height);E.current=t.clientX-h.x,m.current=t.clientY-h.y,_.positionElement(T.current),l&&l.appendChild(T.current),a(!0)},y=()=>{const t=e.getRootDiv();t&&T.current&&t.removeChild(T.current),T.current=void 0,a(!1)},v=(t,n)=>{if(T.current){const o=e.getDomRect();if(!o)return;i.getOrientation()===c.VERT?T.current.style.top=x(n-o.y-m.current)+"px":T.current.style.left=x(t-o.x-E.current)+"px",e.isRealtimeResize()&&D(!0)}},N=()=>{if(T.current){D(!1);const t=e.getRootDiv();t&&T.current&&t.removeChild(T.current),T.current=void 0}L(!0,e.getCurrentDocument()),a(!1)},D=t=>{(()=>{if(T.current){let t=0;if(t=i.getOrientation()===c.VERT?T.current.offsetTop:T.current.offsetLeft,i instanceof F){const n=i.calculateSplit(i,t);e.doAction(_.adjustBorderSplit(i.getId(),n))}else{const o=b.current,s=i.calculateSplit(n,t,o.initialSizes,o.sum,o.startPosition);e.doAction(_.adjustWeights(i.getId(),s))}}})()},x=t=>{const e=g.current;let i=t;return t<e[0]&&(i=e[0]),t>e[1]&&(i=e[1]),i},S=e.getClassName,I={cursor:o?"ew-resize":"ns-resize",flexDirection:o?"column":"row"};let B,C=S(r.FLEXLAYOUT__SPLITTER)+" "+S(r.FLEXLAYOUT__SPLITTER_+i.getOrientation().getName());if(i instanceof F?C+=" "+S(r.FLEXLAYOUT__SPLITTER_BORDER):void 0!==i.getModel().getMaximizedTabset(e.getWindowId())&&(I.display="none"),o?(I.width=f+"px",I.minWidth=f+"px"):(I.height=f+"px",I.minHeight=f+"px"),!s&&i.getModel().isSplitterEnableHandle()&&(B=l.createElement("div",{className:S(r.FLEXLAYOUT__SPLITTER_HANDLE)+" "+S(o?r.FLEXLAYOUT__SPLITTER_HANDLE_HORZ:r.FLEXLAYOUT__SPLITTER_HANDLE_VERT)})),0===O)return l.createElement("div",{className:C,style:I,ref:d,"data-layout-path":i.getPath()+"/s"+(n-1),onPointerDown:R},B);{const t={};i.getOrientation()===c.HORZ?(t.height="100%",t.width=f+O+"px",t.cursor="ew-resize"):(t.height=f+O+"px",t.width="100%",t.cursor="ns-resize");const e=S(r.FLEXLAYOUT__SPLITTER_EXTRA);return l.createElement("div",{className:C,style:I,ref:d,"data-layout-path":i.getPath()+"/s"+(n-1),onPointerDown:R},l.createElement("div",{style:t,ref:h,className:e,onPointerDown:R}))}};function P(t){const{layout:e,border:i,show:n}=t,o=l.useRef(null);l.useLayoutEffect((()=>{const t=e.getBoundingClientRect(o.current),n=u.getContentRect(o.current).relativeTo(e.getDomRect());t.width>0&&(i.setOuterRect(t),i.getContentRect().equals(n)||(i.setContentRect(n),e.redrawInternal("border content rect")))}));let s=!0;const a={};i.getOrientation()===c.HORZ?(a.width=i.getSize(),a.minWidth=i.getMinSize(),a.maxWidth=i.getMaxSize()):(a.height=i.getSize(),a.minHeight=i.getMinSize(),a.maxHeight=i.getMaxSize(),s=!1),a.display=n?"flex":"none";const d=e.getClassName(r.FLEXLAYOUT__BORDER_TAB_CONTENTS);return i.getLocation()===g.LEFT||i.getLocation()===g.TOP?l.createElement(l.Fragment,null,l.createElement("div",{ref:o,style:a,className:d}),n&&l.createElement(Y,{layout:e,node:i,index:0,horizontal:s})):l.createElement(l.Fragment,null,n&&l.createElement(Y,{layout:e,node:i,index:0,horizontal:s}),l.createElement("div",{ref:o,style:a,className:d}))}var H;!function(t){t[t.Visible=1]="Visible",t[t.Always=2]="Always",t[t.Selected=3]="Selected"}(H||(H={}));const X=t=>{const{layout:e,node:i,selected:n,border:o,icons:s,path:d}=t,h=l.useRef(null),c=l.useRef(null),u=()=>{e.doAction(_.selectTab(i.getId()))},g=t=>{(()=>{const t=i.getCloseType();return!!(n||t===H.Always||t===H.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches)})()?e.doAction(_.deleteTab(i.getId())):u()},T=t=>{t.stopPropagation()};l.useLayoutEffect((()=>{i.setTabRect(e.getBoundingClientRect(h.current)),e.getEditingTab()===i&&c.current.select()}));const p=e.getClassName;let E=p(r.FLEXLAYOUT__BORDER_BUTTON)+" "+p(r.FLEXLAYOUT__BORDER_BUTTON_+o);E+=n?" "+p(r.FLEXLAYOUT__BORDER_BUTTON__SELECTED):" "+p(r.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED),void 0!==i.getClassName()&&(E+=" "+i.getClassName());let m=0;!1===i.getModel().isEnableRotateBorderIcons()&&("left"===o?m=90:"right"===o&&(m=-90));const b=A(e,i,m);let f=b.content?l.createElement("div",{className:p(r.FLEXLAYOUT__BORDER_BUTTON_CONTENT)},b.content):null;const O=b.leading?l.createElement("div",{className:p(r.FLEXLAYOUT__BORDER_BUTTON_LEADING)},b.leading):null;if(e.getEditingTab()===i&&(f=l.createElement("input",{ref:c,className:p(r.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":d+"/textbox",type:"text",autoFocus:!0,defaultValue:i.getName(),onKeyDown:t=>{"Escape"===t.code?e.setEditingTab(void 0):"Enter"===t.code&&(e.setEditingTab(void 0),e.doAction(_.renameTab(i.getId(),t.target.value)))},onPointerDown:t=>{t.stopPropagation()}})),i.isEnableClose()){const t=e.i18nName(a.Close_Tab);b.buttons.push(l.createElement("div",{key:"close","data-layout-path":d+"/button/close",title:t,className:p(r.FLEXLAYOUT__BORDER_BUTTON_TRAILING),onPointerDown:T,onClick:g},"function"==typeof s.close?s.close(i):s.close))}return l.createElement("div",{ref:h,"data-layout-path":d,className:E,onClick:u,onAuxClick:t=>{R(t)&&e.auxMouseClick(i,t)},onContextMenu:t=>{e.showContextMenu(i,t)},title:i.getHelpText(),draggable:!0,onDragStart:t=>{t.stopPropagation(),e.setDragNode(t.nativeEvent,i)},onDragEnd:t=>{t.stopPropagation(),e.clearDragMain()}},O,f,b.buttons)},z=t=>{const{layout:e,node:i}=t,n=e.getClassName;let o=n(r.FLEXLAYOUT__TAB_BUTTON_STAMP);const s=A(e,i);let a=s.content?l.createElement("div",{className:n(r.FLEXLAYOUT__TAB_BUTTON_CONTENT)},s.content):i.getNameForOverflowMenu();const d=s.leading?l.createElement("div",{className:n(r.FLEXLAYOUT__TAB_BUTTON_LEADING)},s.leading):null;return l.createElement("div",{className:o,title:i.getHelpText()},d,a)};function k(t,e,i,n){var o;const s=n.getRootDiv(),a=n.getClassName,d=t.ownerDocument,h=t.getBoundingClientRect(),c=null!==(o=null==s?void 0:s.getBoundingClientRect())&&void 0!==o?o:new DOMRect(0,0,100,100),u=d.createElement("div");u.className=a(r.FLEXLAYOUT__POPUP_MENU_CONTAINER),h.left<c.left+c.width/2?u.style.left=h.left-c.left+"px":u.style.right=c.right-h.right+"px",h.top<c.top+c.height/2?u.style.top=h.top-c.top+"px":u.style.bottom=c.bottom-h.bottom+"px",n.showOverlay(!0),s&&s.appendChild(u);const g=()=>{n.hideControlInPortal(),n.showOverlay(!1),s&&s.removeChild(u),u.removeEventListener("pointerdown",T),d.removeEventListener("pointerdown",_)},T=t=>{t.stopPropagation()},_=t=>{g()};u.addEventListener("pointerdown",T),d.addEventListener("pointerdown",_),n.showControlInPortal(l.createElement(G,{currentDocument:d,onSelect:i,onHide:g,items:e,classNameMapper:a,layout:n}),u)}const G=t=>{const{items:e,onHide:i,onSelect:n,classNameMapper:o,layout:s}=t,a=t=>{s.clearDragMain()},d=e.map(((t,e)=>l.createElement("div",{key:t.index,className:o(r.FLEXLAYOUT__POPUP_MENU_ITEM),"data-layout-path":"/popup-menu/tb"+e,onClick:e=>((t,e)=>{n(t),i(),e.stopPropagation()})(t,e),draggable:!0,onDragStart:e=>{return n=e,o=t.node,n.stopPropagation(),s.setDragNode(n.nativeEvent,o),void setTimeout((()=>{i()}),0);var n,o},onDragEnd:a,title:t.node.getHelpText()},l.createElement(z,{node:t.node,layout:s}))));return l.createElement("div",{className:o(r.FLEXLAYOUT__POPUP_MENU),"data-layout-path":"/popup-menu"},d)},V=(t,e,i,n)=>{const o=l.useRef(!0),s=l.useRef(!1),a=l.useRef(u.empty()),r=l.useRef(null),[d,h]=l.useState(0),g=l.useRef(!1),[T,_]=l.useState([]),p=l.useRef(0);l.useLayoutEffect((()=>{g.current=!1}),[t.getSelectedNode(),t.getRect().width,t.getRect().height]),l.useLayoutEffect((()=>{const e=t instanceof I?t.getRect():t.getTabHeaderRect();e.width>0&&e.height>0&&w()}));const E=i.current;l.useEffect((()=>{if(E)return E.addEventListener("wheel",m,{passive:!1}),()=>{E.removeEventListener("wheel",m)}}),[E]);const m=t=>{t.preventDefault()},b=t=>e===c.HORZ?t.x:t.y,f=t=>e===c.HORZ?t.getRight():t.getBottom(),O=t=>e===c.HORZ?t.width:t.height,w=()=>{!0===o.current&&(s.current=!1);const e=t instanceof I?t.getRect():t.getTabHeaderRect();let r=t.getChildren()[t.getChildren().length-1];const l=null===n.current?0:O(n.current.getBoundingClientRect());if(!0===o.current||0===p.current&&0!==T.length||e.width!==a.current.width||e.height!==a.current.height){p.current=T.length,a.current=e;const n=!(t instanceof I)||!0===t.isEnableTabStrip();let c=f(e)-l;if(null!==i.current&&(c-=O(i.current.getBoundingClientRect())),n&&t.getChildren().length>0){if(0===T.length&&0===d&&f(r.getTabRect())+2<c)return;let i=0;const n=t.getSelectedNode();if(n&&!g.current){const t=n.getTabRect(),o=b(t)-2,s=f(t)+2;O(t)+4>=c-b(e)?i=b(e)-o:(s>c||o<b(e))&&(o<b(e)&&(i=b(e)-o),s+i>c&&(i=c-s))}const a=Math.max(0,c-(f(r.getTabRect())+2+i)),l=Math.min(0,d+i+a),u=l-d,p=[];for(let i=0;i<t.getChildren().length;i++){const n=t.getChildren()[i];(b(n.getTabRect())+u<b(e)||f(n.getTabRect())+u>c)&&p.push({node:n,index:i})}s.current=p.length>0,o.current=!1,_(p),h(l)}}else o.current=!0};return{selfRef:r,position:d,userControlledLeft:g,hiddenTabs:T,onMouseWheel:t=>{let e=0;e=Math.abs(t.deltaX)>Math.abs(t.deltaY)?-t.deltaX:-t.deltaY,1===t.deltaMode&&(e*=40),h(d+e),g.current=!0,t.stopPropagation()},tabsTruncated:s.current}},J=t=>{const{border:e,layout:i,size:n}=t,o=l.useRef(null),s=l.useRef(null),d=l.useRef(null),h=i.getIcons();l.useLayoutEffect((()=>{e.setTabHeaderRect(u.getBoundingClientRect(T.current).relativeTo(i.getDomRect()))}));const{selfRef:T,position:p,userControlledLeft:E,hiddenTabs:m,onMouseWheel:b,tabsTruncated:f}=V(e,c.flip(e.getOrientation()),o,d),O=t=>{R(t)&&i.auxMouseClick(e,t)},w=t=>{t.stopPropagation()},A=t=>{const n=i.getShowOverflowMenu();void 0!==n?n(e,t,m,L):k(s.current,m,L,i),t.stopPropagation()},L=t=>{i.doAction(_.selectTab(t.node.getId())),E.current=!1},y=t=>{const n=e.getChildren()[e.getSelected()];void 0!==n&&i.doAction(_.popoutTab(n.getId())),t.stopPropagation()},v=i.getClassName,N=[],D=t=>{let n=e.getSelected()===t,o=e.getChildren()[t];N.push(l.createElement(X,{layout:i,border:e.getLocation().getName(),node:o,path:e.getPath()+"/tb"+t,key:o.getId(),selected:n,icons:h})),t<e.getChildren().length-1&&N.push(l.createElement("div",{key:"divider"+t,className:v(r.FLEXLAYOUT__BORDER_TAB_DIVIDER)}))};for(let t=0;t<e.getChildren().length;t++)D(t);let x=v(r.FLEXLAYOUT__BORDER)+" "+v(r.FLEXLAYOUT__BORDER_+e.getLocation().getName());void 0!==e.getClassName()&&(x+=" "+e.getClassName());let S=[],I=[];const M={buttons:S,stickyButtons:I,overflowPosition:void 0};if(i.customizeTabSet(e,M),S=M.buttons,void 0===M.overflowPosition&&(M.overflowPosition=I.length),I.length>0&&(f?S=[...I,...S]:N.push(l.createElement("div",{ref:d,key:"sticky_buttons_container",onPointerDown:w,onDragStart:t=>{t.preventDefault()},className:v(r.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER)},I))),m.length>0){const t=i.i18nName(a.Overflow_Menu_Tooltip);let n;n="function"==typeof h.more?h.more(e,m):l.createElement(l.Fragment,null,h.more,l.createElement("div",{className:v(r.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT)},m.length)),S.splice(Math.min(M.overflowPosition,S.length),0,l.createElement("button",{key:"overflowbutton",ref:s,className:v(r.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+v(r.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW)+" "+v(r.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_+e.getLocation().getName()),title:t,onClick:A,onPointerDown:w},n))}const B=e.getSelected();if(-1!==B){const t=e.getChildren()[B];if(void 0!==t&&i.isSupportsPopout()&&t.isEnablePopout()){const e=i.i18nName(a.Popout_Tab);S.push(l.createElement("button",{key:"popout",title:e,className:v(r.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+v(r.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT),onClick:y,onPointerDown:w},"function"==typeof h.popout?h.popout(t):h.popout))}}const C=l.createElement("div",{key:"toolbar",ref:o,className:v(r.FLEXLAYOUT__BORDER_TOOLBAR)+" "+v(r.FLEXLAYOUT__BORDER_TOOLBAR_+e.getLocation().getName())},S);let U={},W={};const F=n-1;return e.getLocation()===g.LEFT?(U={right:"100%",top:p},W={width:F}):e.getLocation()===g.RIGHT?(U={left:"100%",top:p},W={width:F}):(U={left:p},W={height:F}),l.createElement("div",{ref:T,style:{display:"flex",flexDirection:e.getOrientation()===c.VERT?"row":"column"},className:x,"data-layout-path":e.getPath(),onClick:O,onAuxClick:O,onContextMenu:t=>{i.showContextMenu(e,t)},onWheel:b},l.createElement("div",{style:W,className:v(r.FLEXLAYOUT__BORDER_INNER)+" "+v(r.FLEXLAYOUT__BORDER_INNER_+e.getLocation().getName())},l.createElement("div",{style:U,className:v(r.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER)+" "+v(r.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_+e.getLocation().getName())},N)),C)},Z=t=>{const{layout:e,node:i}=t,n=l.useRef(null);l.useEffect((()=>{i.setTabStamp(n.current)}),[i,n.current]);let o=(0,e.getClassName)(r.FLEXLAYOUT__DRAG_RECT);return l.createElement("div",{ref:n,className:o},l.createElement(z,{key:i.getId(),layout:e,node:i}))};class j extends l.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,e){console.debug(t),console.debug(e)}render(){return this.state.hasError?l.createElement("div",{className:r.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER},l.createElement("div",{className:r.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT},this.props.message)):this.props.children}}const q=t=>{const{title:e,layout:i,layoutWindow:n,url:o,onCloseWindow:s,onSetWindow:a,children:h}=t,c=l.useRef(null),[u,g]=l.useState(void 0),T=new Map;return l.useLayoutEffect((()=>{if(!c.current){const t=n.windowId,i=n.rect;c.current=window.open(o,t,`left=${i.x},top=${i.y},width=${i.width},height=${i.height}`),c.current?(n.window=c.current,a(n,c.current),window.addEventListener("beforeunload",(()=>{if(c.current){const t=c.current;c.current=null,t.close()}})),c.current.addEventListener("load",(()=>{if(c.current){c.current.focus(),c.current.resizeTo(i.width,i.height),c.current.moveTo(i.x,i.y);const t=c.current.document;t.title=e;const o=t.createElement("div");o.className=r.FLEXLAYOUT__FLOATING_WINDOW_CONTENT,t.body.appendChild(o),function(t,e){const i=[],n=document.querySelectorAll('style, link[rel="stylesheet"]');for(const o of n)$(t,o,e,i);return Promise.all(i)}(t,T).then((()=>{g(o)}));const a=new MutationObserver((e=>function(t,e,i){for(const n of t)if("childList"===n.type){for(const t of n.addedNodes)(t instanceof HTMLLinkElement||t instanceof HTMLStyleElement)&&$(e,t,i);for(const t of n.removedNodes)if(t instanceof HTMLLinkElement||t instanceof HTMLStyleElement){const n=i.get(t);n&&e.head.removeChild(n)}}}(e,t,T)));a.observe(document.head,{childList:!0}),c.current.addEventListener("beforeunload",(()=>{c.current&&(s(n),c.current=null,a.disconnect())}))}}))):(console.warn(`Unable to open window ${o}`),s(n))}return()=>{var t;i.getModel().getwindowsMap().has(n.windowId)||(null===(t=c.current)||void 0===t||t.close(),c.current=null)}}),[]),void 0!==u?(0,d.createPortal)(h,u):null};function $(t,e,i,n){if(e instanceof HTMLLinkElement){const o=e.cloneNode(!0);t.head.appendChild(o),i.set(e,o),n&&n.push(new Promise((t=>{o.onload=()=>t(!0)})))}else if(e instanceof HTMLStyleElement)try{const n=e.cloneNode(!0);t.head.appendChild(n),i.set(e,n)}catch(t){}}const K={width:"1em",height:"1em",display:"flex",alignItems:"center"},Q=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:K,viewBox:"0 0 24 24"},l.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),l.createElement("path",{stroke:"var(--color-icon)",fill:"var(--color-icon)",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),tt=t=>{const{layout:e,show:i}=t;return l.createElement("div",{className:e.getClassName(r.FLEXLAYOUT__LAYOUT_OVERLAY),style:{display:i?"flex":"none"}})},et=t=>{const{layout:e,node:i,selected:n,path:o}=t,s=l.useRef(null),d=l.useRef(null),h=e.getIcons();l.useLayoutEffect((()=>{i.setTabRect(e.getBoundingClientRect(s.current)),e.getEditingTab()===i&&d.current.select()}));const c=()=>{e.doAction(_.selectTab(i.getId()))},u=t=>{t.target!==d.current&&(e.getCurrentDocument().body.removeEventListener("pointerdown",u),e.setEditingTab(void 0))},g=t=>{(()=>{const t=i.getCloseType();return!!(n||t===H.Always||t===H.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches)})()?e.doAction(_.deleteTab(i.getId())):c()},T=t=>{t.stopPropagation()},p=e.getClassName,E=i.getParent(),m=E.isEnableSingleTabStretch()&&1===E.getChildren().length;let b=m?r.FLEXLAYOUT__TAB_BUTTON_STRETCH:r.FLEXLAYOUT__TAB_BUTTON,f=p(b);f+=" "+p(b+"_"+E.getTabLocation()),m||(f+=n?" "+p(b+"--selected"):" "+p(b+"--unselected")),void 0!==i.getClassName()&&(f+=" "+i.getClassName());const O=A(e,i);let w=O.content?l.createElement("div",{className:p(r.FLEXLAYOUT__TAB_BUTTON_CONTENT)},O.content):null;const L=O.leading?l.createElement("div",{className:p(r.FLEXLAYOUT__TAB_BUTTON_LEADING)},O.leading):null;if(e.getEditingTab()===i&&(w=l.createElement("input",{ref:d,className:p(r.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":o+"/textbox",type:"text",autoFocus:!0,defaultValue:i.getName(),onKeyDown:t=>{"Escape"===t.code?e.setEditingTab(void 0):"Enter"===t.code&&(e.setEditingTab(void 0),e.doAction(_.renameTab(i.getId(),t.target.value)))},onPointerDown:t=>{t.stopPropagation()}})),i.isEnableClose()&&!m){const t=e.i18nName(a.Close_Tab);O.buttons.push(l.createElement("div",{key:"close","data-layout-path":o+"/button/close",title:t,className:p(r.FLEXLAYOUT__TAB_BUTTON_TRAILING),onPointerDown:T,onClick:g},"function"==typeof h.close?h.close(i):h.close))}return l.createElement("div",{ref:s,"data-layout-path":o,className:f,onClick:c,onAuxClick:t=>{R(t)&&e.auxMouseClick(i,t)},onContextMenu:t=>{e.showContextMenu(i,t)},title:i.getHelpText(),draggable:!0,onDragStart:t=>{t.stopPropagation(),e.setDragNode(t.nativeEvent,i)},onDragEnd:t=>{e.clearDragMain()},onDoubleClick:t=>{i.isEnableRename()&&(e.setEditingTab(i),e.getCurrentDocument().body.addEventListener("pointerdown",u),t.stopPropagation())}},L,w,O.buttons)},it=t=>{const{node:e,layout:i}=t,n=l.useRef(null),o=l.useRef(null),s=l.useRef(null),h=l.useRef(null),g=l.useRef(null),T=l.useRef(null),p=i.getIcons();l.useEffect((()=>{e.setRect(i.getBoundingClientRect(E.current)),n.current&&e.setTabStripRect(i.getBoundingClientRect(n.current));const t=u.getContentRect(s.current).relativeTo(i.getDomRect());e.getContentRect().equals(t)||(e.setContentRect(t),i.redrawInternal("tabset content rect "+t))}));const{selfRef:E,position:m,userControlledLeft:b,hiddenTabs:f,onMouseWheel:O,tabsTruncated:w}=V(e,c.HORZ,h,T),A=t=>{const n=i.getShowOverflowMenu();void 0!==n?n(e,t,f,L):k(g.current,f,L,i),t.stopPropagation()},L=t=>{i.doAction(_.selectTab(t.node.getId())),b.current=!1},y=t=>{i.getEditingTab()?t.preventDefault():(t.stopPropagation(),i.setDragNode(t.nativeEvent,e))},v=t=>{if(!R(t)){let t=e.getName();t=void 0===t?"":": "+t,i.doAction(_.setActiveTabset(e.getId(),i.getWindowId()))}},N=t=>{R(t)&&i.auxMouseClick(e,t)},D=t=>{i.showContextMenu(e,t)},x=t=>{t.stopPropagation()},S=t=>{e.canMaximize()&&i.maximize(e),t.stopPropagation()},I=t=>{i.doAction(_.deleteTabset(e.getId())),t.stopPropagation()},M=t=>{i.doAction(_.deleteTab(e.getChildren()[0].getId())),t.stopPropagation()},B=t=>{void 0!==W&&i.doAction(_.popoutTab(W.getId())),t.stopPropagation()},C=t=>{e.canMaximize()&&i.maximize(e)},U=i.getClassName;null!==o.current&&0!==o.current.scrollLeft&&(o.current.scrollLeft=0);const W=e.getSelectedNode(),F=e.getPath(),Y=[];if(e.isEnableTabStrip())for(let t=0;t<e.getChildren().length;t++){const n=e.getChildren()[t];let o=e.getSelected()===t;Y.push(l.createElement(et,{layout:i,node:n,path:F+"/tb"+t,key:n.getId(),selected:o})),t<e.getChildren().length-1&&Y.push(l.createElement("div",{key:"divider"+t,className:U(r.FLEXLAYOUT__TABSET_TAB_DIVIDER)}))}let P=[],H=[];const X={stickyButtons:P,buttons:H,overflowPosition:void 0};i.customizeTabSet(e,X),P=X.stickyButtons,H=X.buttons;const z=e.isEnableSingleTabStretch()&&1===e.getChildren().length,G=z&&e.getChildren()[0].isEnableClose()||e.isEnableClose();if(void 0===X.overflowPosition&&(X.overflowPosition=P.length),P.length>0&&(e.isEnableTabWrap()||!w&&!z?Y.push(l.createElement("div",{ref:T,key:"sticky_buttons_container",onPointerDown:x,onDragStart:t=>{t.preventDefault()},className:U(r.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER)},P)):H=[...P,...H]),!e.isEnableTabWrap()&&f.length>0){const t=i.i18nName(a.Overflow_Menu_Tooltip);let n;n="function"==typeof p.more?p.more(e,f):l.createElement(l.Fragment,null,p.more,l.createElement("div",{className:U(r.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT)},f.length)),H.splice(Math.min(X.overflowPosition,H.length),0,l.createElement("button",{key:"overflowbutton","data-layout-path":F+"/button/overflow",ref:g,className:U(r.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+U(r.FLEXLAYOUT__TAB_BUTTON_OVERFLOW),title:t,onClick:A,onPointerDown:x},n))}if(void 0!==W&&i.isSupportsPopout()&&W.isEnablePopout()&&W.isEnablePopoutIcon()){const t=i.i18nName(a.Popout_Tab);H.push(l.createElement("button",{key:"popout","data-layout-path":F+"/button/popout",title:t,className:U(r.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+U(r.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT),onClick:B,onPointerDown:x},"function"==typeof p.popout?p.popout(W):p.popout))}if(e.canMaximize()){const t=i.i18nName(a.Restore),n=i.i18nName(a.Maximize);H.push(l.createElement("button",{key:"max","data-layout-path":F+"/button/max",title:e.isMaximized()?t:n,className:U(r.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+U(r.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_+(e.isMaximized()?"max":"min")),onClick:S,onPointerDown:x},e.isMaximized()?"function"==typeof p.restore?p.restore(e):p.restore:"function"==typeof p.maximize?p.maximize(e):p.maximize))}if(!e.isMaximized()&&G){const t=z?i.i18nName(a.Close_Tab):i.i18nName(a.Close_Tabset);H.push(l.createElement("button",{key:"close","data-layout-path":F+"/button/close",title:t,className:U(r.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+U(r.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE),onClick:z?M:I,onPointerDown:x},"function"==typeof p.closeTabset?p.closeTabset(e):p.closeTabset))}if(e.isActive()&&e.isEnableActiveIcon()){const t=i.i18nName(a.Active_Tabset);H.push(l.createElement("div",{key:"active","data-layout-path":F+"/button/active",title:t,className:U(r.FLEXLAYOUT__TAB_TOOLBAR_ICON)},"function"==typeof p.activeTabset?p.activeTabset(e):p.activeTabset))}const J=l.createElement("div",{key:"buttonbar",ref:h,className:U(r.FLEXLAYOUT__TAB_TOOLBAR),onPointerDown:x,onDragStart:t=>{t.preventDefault()}},H);let Z,j=U(r.FLEXLAYOUT__TABSET_TABBAR_OUTER);if(void 0!==e.getClassNameTabStrip()&&(j+=" "+e.getClassNameTabStrip()),j+=" "+r.FLEXLAYOUT__TABSET_TABBAR_OUTER_+e.getTabLocation(),e.isActive()&&(j+=" "+U(r.FLEXLAYOUT__TABSET_SELECTED)),e.isMaximized()&&(j+=" "+U(r.FLEXLAYOUT__TABSET_MAXIMIZED)),z){const t=e.getChildren()[0];void 0!==t.getTabSetClassName()&&(j+=" "+t.getTabSetClassName())}var q;if(e.isEnableTabWrap()?e.isEnableTabStrip()&&(Z=l.createElement("div",{className:j,style:{flexWrap:"wrap",gap:"1px",marginTop:"2px"},ref:n,"data-layout-path":F+"/tabstrip",onPointerDown:v,onDoubleClick:C,onContextMenu:D,onClick:N,onAuxClick:N,draggable:!0,onDragStart:y},Y,l.createElement("div",{style:{flexGrow:1}}),J)):e.isEnableTabStrip()&&(Z=l.createElement("div",{className:j,ref:n,"data-layout-path":F+"/tabstrip",onPointerDown:v,onDoubleClick:C,onContextMenu:D,onClick:N,onAuxClick:N,draggable:!0,onWheel:O,onDragStart:y},l.createElement("div",{ref:o,className:U(r.FLEXLAYOUT__TABSET_TABBAR_INNER)+" "+U(r.FLEXLAYOUT__TABSET_TABBAR_INNER_+e.getTabLocation())},l.createElement("div",{style:{left:m,width:z?"100%":"10000px"},className:U(r.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER)+" "+U(r.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_+e.getTabLocation())},Y)),J)),0===e.getChildren().length){const t=i.getTabSetPlaceHolderCallback();t&&(q=t(e))}let $=l.createElement("div",{ref:s,className:U(r.FLEXLAYOUT__TABSET_CONTENT)},q);$="top"===e.getTabLocation()?l.createElement(l.Fragment,null,Z,$):l.createElement(l.Fragment,null,$,Z);let K={flexGrow:Math.max(1,1e3*e.getWeight()),minWidth:e.getMinWidth(),minHeight:e.getMinHeight(),maxWidth:e.getMaxWidth(),maxHeight:e.getMaxHeight()};void 0===e.getModel().getMaximizedTabset(i.getWindowId())||e.isMaximized()||(K.display="none");const Q=l.createElement("div",{ref:E,className:U(r.FLEXLAYOUT__TABSET_CONTAINER),style:K},l.createElement("div",{className:U(r.FLEXLAYOUT__TABSET),"data-layout-path":F},$));return e.isMaximized()&&i.getMainElement()?(0,d.createPortal)(l.createElement("div",{style:{position:"absolute",display:"flex",top:0,left:0,bottom:0,right:0}},Q),i.getMainElement()):Q},nt=t=>{const{layout:e,node:i}=t,n=l.useRef(null),o=i.getOrientation()===c.HORZ;l.useLayoutEffect((()=>{i.setRect(e.getBoundingClientRect(n.current))}));const s=[];let a=0;for(const t of i.getChildren())a>0&&s.push(l.createElement(Y,{key:"splitter"+a,layout:e,node:i,index:a,horizontal:o})),t instanceof M?s.push(l.createElement(nt,{key:t.getId(),layout:e,node:t})):t instanceof I&&s.push(l.createElement(it,{key:t.getId(),layout:e,node:t})),a++;const d={flexGrow:Math.max(1,1e3*i.getWeight()),minWidth:i.getMinWidth(),minHeight:i.getMinHeight(),maxWidth:i.getMaxWidth(),maxHeight:i.getMaxHeight()};return d.flexDirection=o?"row":"column",l.createElement("div",{ref:n,className:e.getClassName(r.FLEXLAYOUT__ROW),style:d},s)},ot=t=>{const{layout:e,selected:i,node:n,path:o}=t,s=l.useRef(null),a=l.useRef(!0),d=n.getParent(),h=d.getContentRect();l.useLayoutEffect((()=>{const t=n.getMoveableElement();s.current.appendChild(t),n.setMoveableElement(t);const e=()=>{n.saveScrollPosition()};return t.addEventListener("scroll",e),s.current.addEventListener("pointerdown",c),()=>{t.removeEventListener("scroll",e),s.current&&s.current.removeEventListener("pointerdown",c),n.setVisible(!1)}}),[]),l.useEffect((()=>{n.isSelected()&&a.current&&(n.restoreScrollPosition(),a.current=!1)}));const c=()=>{const t=n.getParent();t instanceof I&&(t.isActive()||e.doAction(_.setActiveTabset(t.getId(),e.getWindowId())))};n.setRect(h);const u=e.getClassName,g={};h.styleWithPosition(g);let T=null;if(i){if(n.setVisible(!0),document.hidden&&n.isEnablePopoutOverlay()){const t={};h.styleWithPosition(t),T=l.createElement("div",{style:t,className:u(r.FLEXLAYOUT__TAB_OVERLAY)})}}else g.display="none",n.setVisible(!1);d instanceof I&&void 0!==n.getModel().getMaximizedTabset(e.getWindowId())&&(d.isMaximized()?g.zIndex=10:g.display="none");let p=u(r.FLEXLAYOUT__TAB);return d instanceof F&&(p+=" "+u(r.FLEXLAYOUT__TAB_BORDER),p+=" "+u(r.FLEXLAYOUT__TAB_BORDER_+d.getLocation().getName())),void 0!==n.getContentClassName()&&(p+=" "+n.getContentClassName()),l.createElement(l.Fragment,null,T,l.createElement("div",{ref:s,style:g,className:p,"data-layout-path":o}))},st=l.memo((({children:t})=>l.createElement(l.Fragment,null,t)),((t,e)=>t.rect.equalSize(e.rect)&&t.selected===e.selected&&t.forceRevision===e.forceRevision&&t.tabsRevision===e.tabsRevision));class at extends l.Component{constructor(t){super(t),this.selfRef=l.createRef(),this.revision=0}redraw(){this.selfRef.current.redraw("parent "+this.revision)}addTabToTabSet(t,e){return this.selfRef.current.addTabToTabSet(t,e)}addTabWithDragAndDrop(t,e,i){this.selfRef.current.addTabWithDragAndDrop(t,e,i)}moveTabWithDragAndDrop(t,e){this.selfRef.current.moveTabWithDragAndDrop(t,e)}addTabToActiveTabSet(t){return this.selfRef.current.addTabToActiveTabSet(t)}setDragComponent(t,e,i,n){this.selfRef.current.setDragComponent(t,e,i,n)}getRootDiv(){return this.selfRef.current.getRootDiv()}render(){return l.createElement(rt,Object.assign({ref:this.selfRef},this.props,{renderRevision:this.revision++}))}}class rt extends l.Component{constructor(t){super(t),this.moveableElementMap=new Map,this.dragEnterCount=0,this.dragging=!1,this.updateLayoutMetrics=()=>{if(this.findBorderBarSizeRef.current){const t=this.findBorderBarSizeRef.current.getBoundingClientRect().height;t!==this.state.calculatedBorderBarSize&&this.setState({calculatedBorderBarSize:t})}},this.onModelChange=t=>{this.redrawInternal("model change"),this.props.onModelChange&&this.props.onModelChange(this.props.model,t)},this.updateRect=()=>{const t=this.getDomRect();t.equals(this.state.rect)||0===t.width||0===t.height||(this.setState({rect:t}),this.windowId!==W.MAIN_WINDOW_ID&&this.redrawInternal("rect updated"))},this.getClassName=t=>void 0===this.props.classNameMapper?t:this.props.classNameMapper(t),this.onCloseWindow=t=>{this.doAction(_.closeWindow(t.windowId))},this.onSetWindow=(t,e)=>{},this.showControlInPortal=(t,e)=>{const i=(0,d.createPortal)(t,e);this.setState({portal:i})},this.hideControlInPortal=()=>{this.setState({portal:void 0})},this.getIcons=()=>this.icons,this.setDragNode=(t,e)=>{if(rt.dragState=new gt(this.mainLayout,dt.Internal,e,void 0,void 0),t.dataTransfer.setData("text/plain","--flexlayout--"),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.dropEffect="move",this.dragEnterCount=0,e instanceof I){let i=!1,n=this.i18nName(a.Move_Tabset);if(e.getChildren().length>0&&(n=this.i18nName(a.Move_Tabs).replace("?",String(e.getChildren().length))),this.props.onRenderDragRect){const o=this.props.onRenderDragRect(n,e,void 0);o&&(this.setDragComponent(t,o,10,10),i=!0)}i||this.setDragComponent(t,n,10,10)}else{const i=t.target.getBoundingClientRect(),n=t.clientX-i.left,o=t.clientY-i.top,s=null==e?void 0:e.getParent(),a=s instanceof F&&s.getOrientation()===c.HORZ,r=a?10:n,d=a?10:o;let h=!1;if(this.props.onRenderDragRect){const i=l.createElement(z,{key:e.getId(),layout:this,node:e}),n=this.props.onRenderDragRect(i,e,void 0);n&&(this.setDragComponent(t,n,r,d),h=!0)}h||(function(){const t=navigator.userAgent;return t.includes("Safari")&&!t.includes("Chrome")&&!t.includes("Chromium")}()?this.setDragComponent(t,l.createElement(z,{node:e,layout:this}),r,d):t.dataTransfer.setDragImage(e.getTabStamp(),r,d))}},this.onDragEnterRaw=t=>{this.dragEnterCount++,1===this.dragEnterCount&&this.onDragEnter(t)},this.onDragLeaveRaw=t=>{this.dragEnterCount--,0===this.dragEnterCount&&this.onDragLeave(t)},this.onDragEnter=t=>{var e;if(!rt.dragState&&this.props.onExternalDrag){const e=this.props.onExternalDrag(t);if(e){const t=O.fromJson(e.json,this.props.model,!1);rt.dragState=new gt(this.mainLayout,dt.External,t,e.json,e.onDrop)}}if(rt.dragState){if(this.windowId!==W.MAIN_WINDOW_ID&&rt.dragState.mainLayout===this.mainLayout&&rt.dragState.mainLayout.setDraggingOverWindow(!0),rt.dragState.mainLayout!==this.mainLayout)return;t.preventDefault(),this.dropInfo=void 0;const i=this.selfRef.current;this.outlineDiv=this.currentDocument.createElement("div"),this.outlineDiv.className=this.getClassName(r.FLEXLAYOUT__OUTLINE_RECT),this.outlineDiv.style.visibility="hidden";const n=this.props.model.getAttribute("tabDragSpeed");this.outlineDiv.style.transition=`top ${n}s, left ${n}s, width ${n}s, height ${n}s`,i.appendChild(this.outlineDiv),this.dragging=!0,this.showOverlay(!0),this.isDraggingOverWindow||void 0!==this.props.model.getMaximizedTabset(this.windowId)||this.setState({showEdges:this.props.model.isEnableEdgeDock()});const o=null===(e=this.selfRef.current)||void 0===e?void 0:e.getBoundingClientRect();new u(t.clientX-o.left,t.clientY-o.top,1,1).positionElement(this.outlineDiv)}},this.onDragOver=t=>{var e,i,n;if(this.dragging&&!this.isDraggingOverWindow){t.preventDefault();const o=null===(e=this.selfRef.current)||void 0===e?void 0:e.getBoundingClientRect(),s={x:t.clientX-(null!==(i=null==o?void 0:o.left)&&void 0!==i?i:0),y:t.clientY-(null!==(n=null==o?void 0:o.top)&&void 0!==n?n:0)};this.checkForBorderToShow(s.x,s.y);let a=this.props.model.findDropTargetNode(this.windowId,rt.dragState.dragNode,s.x,s.y);a&&(this.dropInfo=a,this.outlineDiv&&(this.outlineDiv.className=this.getClassName(a.className),a.rect.positionElement(this.outlineDiv),this.outlineDiv.style.visibility="visible"))}},this.onDragLeave=t=>{this.dragging&&(this.windowId!==W.MAIN_WINDOW_ID&&rt.dragState.mainLayout.setDraggingOverWindow(!1),this.clearDragLocal())},this.onDrop=t=>{if(this.dragging){t.preventDefault();const e=rt.dragState;if(this.dropInfo)if(void 0!==e.dragJson){const i=this.doAction(_.addNode(e.dragJson,this.dropInfo.node.getId(),this.dropInfo.location,this.dropInfo.index));void 0!==e.fnNewNodeDropped&&e.fnNewNodeDropped(i,t)}else void 0!==e.dragNode&&this.doAction(_.moveNode(e.dragNode.getId(),this.dropInfo.node.getId(),this.dropInfo.location,this.dropInfo.index));this.mainLayout.clearDragMain()}this.dragEnterCount=0},this.orderedIds=[],this.selfRef=l.createRef(),this.moveablesRef=l.createRef(),this.mainRef=l.createRef(),this.findBorderBarSizeRef=l.createRef(),this.supportsPopout=void 0!==t.supportsPopout?t.supportsPopout:ht,this.popoutURL=t.popoutURL?t.popoutURL:"popout.html",this.icons=Object.assign(Object.assign({},lt),t.icons),this.windowId=t.windowId?t.windowId:W.MAIN_WINDOW_ID,this.mainLayout=this.props.mainLayout?this.props.mainLayout:this,this.isDraggingOverWindow=!1,this.layoutWindow=this.props.model.getwindowsMap().get(this.windowId),this.layoutWindow.layout=this,this.popoutWindowName=this.props.popoutWindowName||"Popout Window",this.state={rect:u.empty(),editingTab:void 0,showEdges:!1,showOverlay:!1,calculatedBorderBarSize:29,layoutRevision:0,forceRevision:0,showHiddenBorder:g.CENTER},this.isMainWindow=this.windowId===W.MAIN_WINDOW_ID}componentDidMount(){if(this.updateRect(),this.currentDocument=this.selfRef.current.ownerDocument,this.currentWindow=this.currentDocument.defaultView,this.layoutWindow.window=this.currentWindow,this.layoutWindow.toScreenRectFunction=t=>this.getScreenRect(t),this.resizeObserver=new ResizeObserver((t=>{requestAnimationFrame((()=>{this.updateRect()}))})),this.selfRef.current&&this.resizeObserver.observe(this.selfRef.current),this.isMainWindow)this.props.model.addChangeListener(this.onModelChange),this.updateLayoutMetrics();else{this.currentWindow.addEventListener("resize",(()=>{this.updateRect()}));const t=this.props.mainLayout.getRootDiv(),e=this.selfRef.current;D(t,e),this.styleObserver=new MutationObserver((()=>{D(t,e)&&this.redraw("mutation observer")})),this.styleObserver.observe(t,{attributeFilter:["style"]})}document.addEventListener("visibilitychange",(()=>{for(const[t,e]of this.props.model.getwindowsMap())e.layout&&this.redraw("visibility change")}))}componentDidUpdate(){this.currentDocument=this.selfRef.current.ownerDocument,this.currentWindow=this.currentDocument.defaultView,this.isMainWindow&&(this.props.model!==this.previousModel&&(void 0!==this.previousModel&&this.previousModel.removeChangeListener(this.onModelChange),this.props.model.getwindowsMap().get(this.windowId).layout=this,this.props.model.addChangeListener(this.onModelChange),this.layoutWindow=this.props.model.getwindowsMap().get(this.windowId),this.layoutWindow.layout=this,this.layoutWindow.toScreenRectFunction=t=>this.getScreenRect(t),this.previousModel=this.props.model,this.tidyMoveablesMap()),this.updateLayoutMetrics())}componentWillUnmount(){var t,e;this.selfRef.current&&(null===(t=this.resizeObserver)||void 0===t||t.unobserve(this.selfRef.current)),null===(e=this.styleObserver)||void 0===e||e.disconnect()}render(){if(!this.selfRef.current)return l.createElement("div",{ref:this.selfRef,className:this.getClassName(r.FLEXLAYOUT__LAYOUT)},l.createElement("div",{ref:this.moveablesRef,key:"__moveables__",className:this.getClassName(r.FLEXLAYOUT__LAYOUT_MOVEABLES)}),this.renderMetricsElements());const t=this.props.model;t.getRoot(this.windowId).calcMinMaxSize(),t.getRoot(this.windowId).setPaths(""),t.getBorderSet().setPaths();const e=this.renderLayout(),i=this.renderBorders(e),n=this.renderTabs(),o=this.reorderComponents(n,this.orderedIds);let s=null,a=null,d=null,h=null;return this.isMainWindow&&(s=this.renderWindows(),h=this.renderMetricsElements(),a=this.renderTabMoveables(),d=l.createElement("div",{key:"__tabStamps__",className:this.getClassName(r.FLEXLAYOUT__LAYOUT_TAB_STAMPS)},this.renderTabStamps())),l.createElement("div",{ref:this.selfRef,className:this.getClassName(r.FLEXLAYOUT__LAYOUT),onDragEnter:this.onDragEnterRaw,onDragLeave:this.onDragLeaveRaw,onDragOver:this.onDragOver,onDrop:this.onDrop},l.createElement("div",{ref:this.moveablesRef,key:"__moveables__",className:this.getClassName(r.FLEXLAYOUT__LAYOUT_MOVEABLES)}),h,l.createElement(tt,{key:"__overlay__",layout:this,show:this.state.showOverlay}),i,o,a,d,this.state.portal,s)}renderBorders(t){const e=this.getClassName(r.FLEXLAYOUT__LAYOUT_MAIN),i=this.props.model.getBorderSet().getBorderMap();if(this.isMainWindow&&i.size>0){t=l.createElement("div",{className:e,ref:this.mainRef},t);const n=new Map,o=new Map;for(const[t,e]of g.values){const t=i.get(e);t&&(!t.isAutoHide()||t.isAutoHide()&&(t.getChildren().length>0||this.state.showHiddenBorder===e))&&(n.set(e,l.createElement(J,{layout:this,border:t,size:this.state.calculatedBorderBarSize})),o.set(e,l.createElement(P,{layout:this,border:t,show:-1!==t.getSelected()})))}const s=this.getClassName(r.FLEXLAYOUT__LAYOUT_BORDER_CONTAINER),a=this.getClassName(r.FLEXLAYOUT__LAYOUT_BORDER_CONTAINER_INNER);if(this.props.model.getBorderSet().getLayoutHorizontal()){const e=l.createElement("div",{className:a,style:{flexDirection:"column"}},o.get(g.TOP),l.createElement("div",{className:a,style:{flexDirection:"row"}},o.get(g.LEFT),t,o.get(g.RIGHT)),o.get(g.BOTTOM));return l.createElement("div",{className:s,style:{flexDirection:"column"}},n.get(g.TOP),l.createElement("div",{className:a,style:{flexDirection:"row"}},n.get(g.LEFT),e,n.get(g.RIGHT)),n.get(g.BOTTOM))}{const e=l.createElement("div",{className:a,style:{flexDirection:"row"}},o.get(g.LEFT),l.createElement("div",{className:a,style:{flexDirection:"column"}},o.get(g.TOP),t,o.get(g.BOTTOM)),o.get(g.RIGHT));return l.createElement("div",{className:s,style:{flexDirection:"row"}},n.get(g.LEFT),l.createElement("div",{className:a,style:{flexDirection:"column"}},n.get(g.TOP),e,n.get(g.BOTTOM)),n.get(g.RIGHT))}}return l.createElement("div",{className:e,ref:this.mainRef,style:{position:"absolute",top:0,left:0,bottom:0,right:0,display:"flex"}},t)}renderLayout(){return l.createElement(l.Fragment,null,l.createElement(nt,{key:"__row__",layout:this,node:this.props.model.getRoot(this.windowId)}),this.renderEdgeIndicators())}renderEdgeIndicators(){const t=[],e=this.icons.edgeArrow;if(this.state.showEdges){const i=this.props.model.getRoot(this.windowId).getRect(),n=ct,o=ut,s=ct/2,a=this.getClassName(r.FLEXLAYOUT__EDGE_RECT),d=50;t.push(l.createElement("div",{key:"North",style:{top:0,left:i.width/2-s,width:n,height:o,borderBottomLeftRadius:d,borderBottomRightRadius:d},className:a+" "+this.getClassName(r.FLEXLAYOUT__EDGE_RECT_TOP)},l.createElement("div",{style:{transform:"rotate(180deg)"}},e))),t.push(l.createElement("div",{key:"West",style:{top:i.height/2-s,left:0,width:o,height:n,borderTopRightRadius:d,borderBottomRightRadius:d},className:a+" "+this.getClassName(r.FLEXLAYOUT__EDGE_RECT_LEFT)},l.createElement("div",{style:{transform:"rotate(90deg)"}},e))),t.push(l.createElement("div",{key:"South",style:{top:i.height-o,left:i.width/2-s,width:n,height:o,borderTopLeftRadius:d,borderTopRightRadius:d},className:a+" "+this.getClassName(r.FLEXLAYOUT__EDGE_RECT_BOTTOM)},l.createElement("div",null,e))),t.push(l.createElement("div",{key:"East",style:{top:i.height/2-s,left:i.width-o,width:o,height:n,borderTopLeftRadius:d,borderBottomLeftRadius:d},className:a+" "+this.getClassName(r.FLEXLAYOUT__EDGE_RECT_RIGHT)},l.createElement("div",{style:{transform:"rotate(-90deg)"}},e)))}return t}renderWindows(){const t=[];if(this.supportsPopout){const e=this.props.model.getwindowsMap();let i=1;for(const[n,o]of e)n!==W.MAIN_WINDOW_ID&&(t.push(l.createElement(q,{key:n,layout:this,title:this.popoutWindowName+" "+i,layoutWindow:o,url:this.popoutURL+"?id="+n,onSetWindow:this.onSetWindow,onCloseWindow:this.onCloseWindow},l.createElement(rt,Object.assign({},this.props,{windowId:n,mainLayout:this})))),i++)}return t}renderTabMoveables(){const t=[];return this.props.model.visitNodes((e=>{if(e instanceof O){const i=e,n=this.getMoveableElement(i.getId());i.setMoveableElement(n);const o=i.isSelected(),s=i.getParent().getContentRect(),r=i.isRendered()||(o||!i.isEnableRenderOnDemand())&&s.width>0&&s.height>0;if(r){const e=i.getId()+(i.isEnableWindowReMount()?i.getWindowId():"");t.push((0,d.createPortal)(l.createElement(st,{rect:s,selected:i.isSelected(),forceRevision:this.state.forceRevision,tabsRevision:this.props.renderRevision,key:e},l.createElement(j,{message:this.i18nName(a.Error_rendering_component)},this.props.factory(i))),n,e)),i.setRendered(r)}}})),t}renderTabStamps(){const t=[];return this.props.model.visitNodes((e=>{if(e instanceof O){const i=e;t.push(l.createElement(Z,{key:i.getId(),layout:this,node:i}))}})),t}renderTabs(){const t=new Map;return this.props.model.visitWindowNodes(this.windowId,(e=>{if(e instanceof O){const i=e,n=i.isSelected(),o=i.getPath();(i.isRendered()||n||!i.isEnableRenderOnDemand())&&t.set(i.getId(),l.createElement(ot,{key:i.getId(),layout:this,path:o,node:i,selected:n}))}})),t}renderMetricsElements(){return l.createElement("div",{key:"findBorderBarSize",ref:this.findBorderBarSizeRef,className:this.getClassName(r.FLEXLAYOUT__BORDER_SIZER)},"FindBorderBarSize")}checkForBorderToShow(t,e){const i=this.getBoundingClientRect(this.mainRef.current),n=i.getCenter(),o=ut,s=ct/2;let a=!1;this.props.model.isEnableEdgeDock()&&this.state.showHiddenBorder===g.CENTER&&(e>n.y-s&&e<n.y+s||t>n.x-s&&t<n.x+s)&&(a=!0);let r=g.CENTER;a||(t<=i.x+o?r=g.LEFT:t>=i.getRight()-o?r=g.RIGHT:e<=i.y+o?r=g.TOP:e>=i.getBottom()-o&&(r=g.BOTTOM)),r!==this.state.showHiddenBorder&&this.setState({showHiddenBorder:r})}tidyMoveablesMap(){const t=new Map;this.props.model.visitNodes(((e,i)=>{e instanceof O&&t.set(e.getId(),e)}));for(const[e,i]of this.moveableElementMap)t.has(e)||(i.remove(),this.moveableElementMap.delete(e))}reorderComponents(t,e){const i=[],n=new Set;let o=[];for(const o of e)t.get(o)&&(i.push(o),n.add(o));e.splice(0,e.length,...i);for(const[i,o]of t)n.has(i)||e.push(i);return o=e.map((e=>t.get(e))),o}redraw(t){this.mainLayout.setState(((t,e)=>({forceRevision:t.forceRevision+1})))}redrawInternal(t){this.mainLayout.setState(((t,e)=>({layoutRevision:t.layoutRevision+1})))}doAction(t){if(void 0!==this.props.onAction){const e=this.props.onAction(t);return void 0!==e?this.props.model.doAction(e):void 0}return this.props.model.doAction(t)}getBoundingClientRect(t){const e=this.getDomRect();return e?u.getBoundingClientRect(t).relativeTo(e):u.empty()}getMoveableContainer(){return this.moveablesRef.current}getMoveableElement(t){let e=this.moveableElementMap.get(t);return void 0===e&&(e=document.createElement("div"),this.moveablesRef.current.appendChild(e),e.className=r.FLEXLAYOUT__TAB_MOVEABLE,this.moveableElementMap.set(t,e)),e}getMainLayout(){return this.mainLayout}getCurrentDocument(){return this.currentDocument}getDomRect(){return this.selfRef.current?u.fromDomRect(this.selfRef.current.getBoundingClientRect()):u.empty()}getWindowId(){return this.windowId}getRootDiv(){return this.selfRef.current}getMainElement(){return this.mainRef.current}getFactory(){return this.props.factory}isSupportsPopout(){return this.supportsPopout}isRealtimeResize(){var t;return null!==(t=this.props.realtimeResize)&&void 0!==t&&t}getPopoutURL(){return this.popoutURL}setEditingTab(t){this.setState({editingTab:t})}getEditingTab(){return this.state.editingTab}getModel(){return this.props.model}getScreenRect(t){const e=t.clone(),i=this.getDomRect();return e.x=this.currentWindow.screenX+this.currentWindow.scrollX+1+i.x+e.x,e.y=this.currentWindow.screenY+this.currentWindow.scrollY+59+i.y+e.y,e.height+=60,e.width+=2,e}addTabToTabSet(t,e){if(void 0!==this.props.model.getNodeById(t))return this.doAction(_.addNode(e,t,g.CENTER,-1))}addTabToActiveTabSet(t){const e=this.props.model.getActiveTabset(this.windowId);if(void 0!==e)return this.doAction(_.addNode(t,e.getId(),g.CENTER,-1))}maximize(t){this.doAction(_.maximizeToggle(t.getId(),this.getWindowId()))}customizeTab(t,e){this.props.onRenderTab&&this.props.onRenderTab(t,e)}customizeTabSet(t,e){this.props.onRenderTabSet&&this.props.onRenderTabSet(t,e)}i18nName(t,e){let i;return this.props.i18nMapper&&(i=this.props.i18nMapper(t,e)),void 0===i&&(i=t+(void 0===e?"":e)),i}getShowOverflowMenu(){return this.props.onShowOverflowMenu}getTabSetPlaceHolderCallback(){return this.props.onTabSetPlaceHolder}showContextMenu(t,e){this.props.onContextMenu&&this.props.onContextMenu(t,e)}auxMouseClick(t,e){this.props.onAuxMouseClick&&this.props.onAuxMouseClick(t,e)}showOverlay(t){this.setState({showOverlay:t}),L(!t,this.currentDocument)}addTabWithDragAndDrop(t,e,i){const n=O.fromJson(e,this.props.model,!1);rt.dragState=new gt(this.mainLayout,dt.Add,n,e,i)}moveTabWithDragAndDrop(t,e){this.setDragNode(t,e)}setDragComponent(t,e,i,n){let o=l.createElement("div",{style:{position:"unset"},className:this.getClassName(r.FLEXLAYOUT__LAYOUT)+" "+this.getClassName(r.FLEXLAYOUT__DRAG_RECT)},e);const s=this.currentDocument.createElement("div");s.setAttribute("data-layout-path","/drag-rectangle"),s.style.position="absolute",s.style.left="-10000px",s.style.top="-10000px",this.currentDocument.body.appendChild(s),(0,h.H)(s).render(o),t.dataTransfer.setDragImage(s,i,n),setTimeout((()=>{this.currentDocument.body.removeChild(s)}),0)}setDraggingOverWindow(t){this.isDraggingOverWindow!==t&&(this.outlineDiv&&(this.outlineDiv.style.visibility=t?"hidden":"visible"),t?this.setState({showEdges:!1}):void 0===this.props.model.getMaximizedTabset(this.windowId)&&this.setState({showEdges:this.props.model.isEnableEdgeDock()}),this.isDraggingOverWindow=t)}clearDragMain(){rt.dragState=void 0,this.windowId===W.MAIN_WINDOW_ID&&(this.isDraggingOverWindow=!1);for(const[,t]of this.props.model.getwindowsMap())t.layout.clearDragLocal()}clearDragLocal(){this.setState({showEdges:!1}),this.showOverlay(!1),this.dragEnterCount=0,this.dragging=!1,this.outlineDiv&&(this.selfRef.current.removeChild(this.outlineDiv),this.outlineDiv=void 0)}}rt.dragState=void 0;const lt={close:l.createElement(Q,null),closeTabset:l.createElement(Q,null),popout:l.createElement((()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:K,viewBox:"0 0 20 20",fill:"var(--color-icon)"},l.createElement("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),l.createElement("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"}))),null),maximize:l.createElement((()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:K,viewBox:"0 0 24 24",fill:"var(--color-icon)"},l.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),l.createElement("path",{stroke:"var(--color-icon)",d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))),null),restore:l.createElement((()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:K,viewBox:"0 0 24 24",fill:"var(--color-icon)"},l.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),l.createElement("path",{stroke:"var(--color-icon)",d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))),null),more:l.createElement((()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:K,viewBox:"0 0 24 24",fill:"var(--color-icon)"},l.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),l.createElement("path",{stroke:"var(--color-icon)",d:"M7 10l5 5 5-5z"}))),null),edgeArrow:l.createElement((()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{display:"block",width:10,height:10},preserveAspectRatio:"none",viewBox:"0 0 100 100"},l.createElement("path",{fill:"var(--color-edge-icon)",stroke:"var(--color-edge-icon)",d:"M10 30 L90 30 l-40 40 Z"}))),null),activeTabset:l.createElement((()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:K,height:"24px",viewBox:"0 -960 960 960",width:"24px"},l.createElement("path",{fill:"var(--color-icon)",stroke:"var(--color-icon)",d:"M440-120v-264L254-197l-57-57 187-186H120v-80h264L197-706l57-57 186 187v-264h80v264l186-187 57 57-187 186h264v80H576l187 186-57 57-186-187v264h-80Z"}))),null)};var dt;!function(t){t.Internal="internal",t.External="external",t.Add="add"}(dt||(dt={}));const ht=w(),ct=100,ut=10;class gt{constructor(t,e,i,n,o){this.mainLayout=t,this.dragSource=e,this.dragNode=i,this.dragJson=n,this.fnNewNodeDropped=o}}return s})()));
|
|
1
|
+
/*! For license information please see flexlayout_min.js.LICENSE.txt */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.FlexLayout=t(require("react"),require("react-dom")):e.FlexLayout=t(e.React,e.ReactDOM)}(self,((e,t)=>(()=>{"use strict";var n={36:t=>{t.exports=e},47:e=>{e.exports=t},370:(e,t,n)=>{e.exports=n(849)},553:(e,t,n)=>{var r=n(370),i=n(36),a=n(47);function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=Symbol.for("react.element"),s=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),p=Symbol.for("react.consumer"),g=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),T=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var _=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.tracing_marker");var E=Symbol.for("react.memo_cache_sentinel"),w=Symbol.iterator;function S(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=w&&e[w]||e["@@iterator"])?e:null}var L=Symbol.for("react.client.reference");function O(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===L?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case c:return"Fragment";case u:return"Portal";case h:return"Profiler";case d:return"StrictMode";case b:return"Suspense";case v:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case g:return(e.displayName||"Context")+".Provider";case p:return(e._context.displayName||"Context")+".Consumer";case m:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case y:return null!==(t=e.displayName||null)?t:O(e.type)||"Memo";case T:t=e._payload,e=e._init;try{return O(e(t))}catch(e){}}return null}var N,A,R=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,x=Object.assign;function k(e){if(void 0===N)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);N=t&&t[1]||"",A=-1<e.stack.indexOf("\n at")?" (<anonymous>)":-1<e.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+N+e+A}var C=!1;function D(e,t){if(!e||C)return"";C=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&"function"==typeof n.catch&&n.catch((function(){}))}}catch(e){if(e&&r&&"string"==typeof e.stack)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=r.DetermineComponentFrameRoot(),o=a[0],l=a[1];if(o&&l){var s=o.split("\n"),u=l.split("\n");for(i=r=0;r<s.length&&!s[r].includes("DetermineComponentFrameRoot");)r++;for(;i<u.length&&!u[i].includes("DetermineComponentFrameRoot");)i++;if(r===s.length||i===u.length)for(r=s.length-1,i=u.length-1;1<=r&&0<=i&&s[r]!==u[i];)i--;for(;1<=r&&0<=i;r--,i--)if(s[r]!==u[i]){if(1!==r||1!==i)do{if(r--,0>--i||s[r]!==u[i]){var c="\n"+s[r].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}}while(1<=r&&0<=i);break}}}finally{C=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?k(n):""}function M(e){switch(e.tag){case 26:case 27:case 5:return k(e.type);case 16:return k("Lazy");case 13:return k("Suspense");case 19:return k("SuspenseList");case 0:case 15:return D(e.type,!1);case 11:return D(e.type.render,!1);case 1:return D(e.type,!0);default:return""}}function I(e){try{var t="";do{t+=M(e),e=e.return}while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}function B(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function P(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function z(e){if(B(e)!==e)throw Error(o(188))}function U(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(null!==(t=U(e)))return t;e=e.sibling}return null}var F=Array.isArray,W=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},Y=[],X=-1;function V(e){return{current:e}}function j(e){0>X||(e.current=Y[X],Y[X]=null,X--)}function G(e,t){X++,Y[X]=e.current,e.current=t}var $=V(null),q=V(null),Q=V(null),J=V(null);function K(e,t){switch(G(Q,t),G(q,e),G($,null),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)&&(t=t.namespaceURI)?qc(t):0;break;default:if(t=(e=8===e?t.parentNode:t).tagName,e=e.namespaceURI)t=Qc(e=qc(e),t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}j($),G($,t)}function Z(){j($),j(q),j(Q)}function ee(e){null!==e.memoizedState&&G(J,e);var t=$.current,n=Qc(t,e.type);t!==n&&(G(q,e),G($,n))}function te(e){q.current===e&&(j($),j(q)),J.current===e&&(j(J),Id._currentValue=H)}var ne=Object.prototype.hasOwnProperty,re=r.unstable_scheduleCallback,ie=r.unstable_cancelCallback,ae=r.unstable_shouldYield,oe=r.unstable_requestPaint,le=r.unstable_now,se=r.unstable_getCurrentPriorityLevel,ue=r.unstable_ImmediatePriority,ce=r.unstable_UserBlockingPriority,de=r.unstable_NormalPriority,he=r.unstable_LowPriority,fe=r.unstable_IdlePriority,pe=r.log,ge=r.unstable_setDisableYieldValue,me=null,be=null;function ve(e){if("function"==typeof pe&&ge(e),be&&"function"==typeof be.setStrictMode)try{be.setStrictMode(me,e)}catch(e){}}var ye=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(Te(e)/_e|0)|0},Te=Math.log,_e=Math.LN2,Ee=128,we=4194304;function Se(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194176&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Le(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=e.warmLanes;e=0!==e.finishedLanes;var l=134217727&n;return 0!==l?0!=(n=l&~i)?r=Se(n):0!=(a&=l)?r=Se(a):e||0!=(o=l&~o)&&(r=Se(o)):0!=(l=n&~i)?r=Se(l):0!==a?r=Se(a):e||0!=(o=n&~o)&&(r=Se(o)),0===r?0:0===t||t===r||t&i||!((i=r&-r)>=(o=t&-t)||32===i&&4194176&o)?r:t}function Oe(e,t){return!(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function Ne(e,t){switch(e){case 1:case 2:case 4:case 8:return t+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function Ae(){var e=Ee;return!(4194176&(Ee<<=1))&&(Ee=128),e}function Re(){var e=we;return!(62914560&(we<<=1))&&(we=4194304),e}function xe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ke(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ce(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ye(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|4194218&n}function De(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ye(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Me(e){return 2<(e&=-e)?8<e?134217727&e?32:268435456:8:2}function Ie(){var e=W.p;return 0!==e?e:void 0===(e=window.event)?32:$d(e.type)}var Be=Math.random().toString(36).slice(2),Pe="__reactFiber$"+Be,ze="__reactProps$"+Be,Ue="__reactContainer$"+Be,Fe="__reactEvents$"+Be,We="__reactListeners$"+Be,He="__reactHandles$"+Be,Ye="__reactResources$"+Be,Xe="__reactMarker$"+Be;function Ve(e){delete e[Pe],delete e[ze],delete e[Fe],delete e[We],delete e[He]}function je(e){var t=e[Pe];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ue]||n[Pe]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=ld(e);null!==e;){if(n=e[Pe])return n;e=ld(e)}return t}n=(e=n).parentNode}return null}function Ge(e){if(e=e[Pe]||e[Ue]){var t=e.tag;if(5===t||6===t||13===t||26===t||27===t||3===t)return e}return null}function $e(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e.stateNode;throw Error(o(33))}function qe(e){var t=e[Ye];return t||(t=e[Ye]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Qe(e){e[Xe]=!0}var Je=new Set,Ke={};function Ze(e,t){et(e,t),et(e+"Capture",t)}function et(e,t){for(Ke[e]=t,e=0;e<t.length;e++)Je.add(t[e])}var tt=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),nt=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),rt={},it={};function at(e,t,n){if(i=t,ne.call(it,i)||!ne.call(rt,i)&&(nt.test(i)?it[i]=!0:(rt[i]=!0,0)))if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":return void e.removeAttribute(t);case"boolean":var r=t.toLowerCase().slice(0,5);if("data-"!==r&&"aria-"!==r)return void e.removeAttribute(t)}e.setAttribute(t,""+n)}var i}function ot(e,t,n){if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(t)}e.setAttribute(t,""+n)}}function lt(e,t,n,r){if(null===r)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(n)}e.setAttributeNS(t,n,""+r)}}function st(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function ut(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function ct(e){e._valueTracker||(e._valueTracker=function(e){var t=ut(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function dt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ut(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function ht(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var ft=/[\n"\\]/g;function pt(e){return e.replace(ft,(function(e){return"\\"+e.charCodeAt(0).toString(16)+" "}))}function gt(e,t,n,r,i,a,o,l){e.name="",null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o?e.type=o:e.removeAttribute("type"),null!=t?"number"===o?(0===t&&""===e.value||e.value!=t)&&(e.value=""+st(t)):e.value!==""+st(t)&&(e.value=""+st(t)):"submit"!==o&&"reset"!==o||e.removeAttribute("value"),null!=t?bt(e,o,st(t)):null!=n?bt(e,o,st(n)):null!=r&&e.removeAttribute("value"),null==i&&null!=a&&(e.defaultChecked=!!a),null!=i&&(e.checked=i&&"function"!=typeof i&&"symbol"!=typeof i),null!=l&&"function"!=typeof l&&"symbol"!=typeof l&&"boolean"!=typeof l?e.name=""+st(l):e.removeAttribute("name")}function mt(e,t,n,r,i,a,o,l){if(null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a&&(e.type=a),null!=t||null!=n){if(("submit"===a||"reset"===a)&&null==t)return;n=null!=n?""+st(n):"",t=null!=t?""+st(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}r="function"!=typeof(r=null!=r?r:i)&&"symbol"!=typeof r&&!!r,e.checked=l?e.checked:!!r,e.defaultChecked=!!r,null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o&&(e.name=o)}function bt(e,t,n){"number"===t&&ht(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function vt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+st(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function yt(e,t,n){null==t||((t=""+st(t))!==e.value&&(e.value=t),null!=n)?e.defaultValue=null!=n?""+st(n):"":e.defaultValue!==t&&(e.defaultValue=t)}function Tt(e,t,n,r){if(null==t){if(null!=r){if(null!=n)throw Error(o(92));if(F(r)){if(1<r.length)throw Error(o(93));r=r[0]}n=r}null==n&&(n=""),t=n}n=st(t),e.defaultValue=n,(r=e.textContent)===n&&""!==r&&null!==r&&(e.value=r)}function _t(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var Et=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function wt(e,t,n){var r=0===t.indexOf("--");null==n||"boolean"==typeof n||""===n?r?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":r?e.setProperty(t,n):"number"!=typeof n||0===n||Et.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function St(e,t,n){if(null!=t&&"object"!=typeof t)throw Error(o(62));if(e=e.style,null!=n){for(var r in n)!n.hasOwnProperty(r)||null!=t&&t.hasOwnProperty(r)||(0===r.indexOf("--")?e.setProperty(r,""):"float"===r?e.cssFloat="":e[r]="");for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&wt(e,i,r)}else for(var a in t)t.hasOwnProperty(a)&&wt(e,a,t[a])}function Lt(e){if(-1===e.indexOf("-"))return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ot=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Nt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function At(e){return Nt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Rt=null;function xt(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var kt=null,Ct=null;function Dt(e){var t=Ge(e);if(t&&(e=t.stateNode)){var n=e[ze]||null;e:switch(e=t.stateNode,t.type){case"input":if(gt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+pt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[ze]||null;if(!i)throw Error(o(90));gt(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)(r=n[t]).form===e.form&&dt(r)}break e;case"textarea":yt(e,n.value,n.defaultValue);break e;case"select":null!=(t=n.value)&&vt(e,!!n.multiple,t,!1)}}}var Mt=!1;function It(e,t,n){if(Mt)return e(t,n);Mt=!0;try{return e(t)}finally{if(Mt=!1,(null!==kt||null!==Ct)&&(Pu(),kt&&(t=kt,e=Ct,Ct=kt=null,Dt(t),e)))for(t=0;t<e.length;t++)Dt(e[t])}}function Bt(e,t){var n=e.stateNode;if(null===n)return null;var r=n[ze]||null;if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(o(231,t,typeof n));return n}var Pt=!1;if(tt)try{var zt={};Object.defineProperty(zt,"passive",{get:function(){Pt=!0}}),window.addEventListener("test",zt,zt),window.removeEventListener("test",zt,zt)}catch(e){Pt=!1}var Ut=null,Ft=null,Wt=null;function Ht(){if(Wt)return Wt;var e,t,n=Ft,r=n.length,i="value"in Ut?Ut.value:Ut.textContent,a=i.length;for(e=0;e<r&&n[e]===i[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===i[a-t];t++);return Wt=i.slice(e,1<t?1-t:void 0)}function Yt(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Xt(){return!0}function Vt(){return!1}function jt(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?Xt:Vt,this.isPropagationStopped=Vt,this}return x(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Xt)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Xt)},persist:function(){},isPersistent:Xt}),t}var Gt,$t,qt,Qt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jt=jt(Qt),Kt=x({},Qt,{view:0,detail:0}),Zt=jt(Kt),en=x({},Kt,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==qt&&(qt&&"mousemove"===e.type?(Gt=e.screenX-qt.screenX,$t=e.screenY-qt.screenY):$t=Gt=0,qt=e),Gt)},movementY:function(e){return"movementY"in e?e.movementY:$t}}),tn=jt(en),nn=jt(x({},en,{dataTransfer:0})),rn=jt(x({},Kt,{relatedTarget:0})),an=jt(x({},Qt,{animationName:0,elapsedTime:0,pseudoElement:0})),on=jt(x({},Qt,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),ln=jt(x({},Qt,{data:0})),sn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},un={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},cn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=cn[e])&&!!t[e]}function hn(){return dn}var fn=jt(x({},Kt,{key:function(e){if(e.key){var t=sn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Yt(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?un[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hn,charCode:function(e){return"keypress"===e.type?Yt(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Yt(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),pn=jt(x({},en,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),gn=jt(x({},Kt,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hn})),mn=jt(x({},Qt,{propertyName:0,elapsedTime:0,pseudoElement:0})),bn=jt(x({},en,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),vn=jt(x({},Qt,{newState:0,oldState:0})),yn=[9,13,27,32],Tn=tt&&"CompositionEvent"in window,_n=null;tt&&"documentMode"in document&&(_n=document.documentMode);var En=tt&&"TextEvent"in window&&!_n,wn=tt&&(!Tn||_n&&8<_n&&11>=_n),Sn=String.fromCharCode(32),Ln=!1;function On(e,t){switch(e){case"keyup":return-1!==yn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var An=!1,Rn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function xn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Rn[e.type]:"textarea"===t}function kn(e,t,n,r){kt?Ct?Ct.push(r):Ct=[r]:kt=r,0<(t=Ic(t,"onChange")).length&&(n=new Jt("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Cn=null,Dn=null;function Mn(e){Nc(e,0)}function In(e){if(dt($e(e)))return e}function Bn(e,t){if("change"===e)return t}var Pn=!1;if(tt){var zn;if(tt){var Un="oninput"in document;if(!Un){var Fn=document.createElement("div");Fn.setAttribute("oninput","return;"),Un="function"==typeof Fn.oninput}zn=Un}else zn=!1;Pn=zn&&(!document.documentMode||9<document.documentMode)}function Wn(){Cn&&(Cn.detachEvent("onpropertychange",Hn),Dn=Cn=null)}function Hn(e){if("value"===e.propertyName&&In(Dn)){var t=[];kn(t,Dn,e,xt(e)),It(Mn,t)}}function Yn(e,t,n){"focusin"===e?(Wn(),Dn=n,(Cn=t).attachEvent("onpropertychange",Hn)):"focusout"===e&&Wn()}function Xn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return In(Dn)}function Vn(e,t){if("click"===e)return In(t)}function jn(e,t){if("input"===e||"change"===e)return In(t)}var Gn="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function $n(e,t){if(Gn(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ne.call(t,i)||!Gn(e[i],t[i]))return!1}return!0}function qn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Qn(e,t){var n,r=qn(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=qn(r)}}function Jn(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?Jn(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Kn(e){for(var t=ht((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=ht((e=t.contentWindow).document)}return t}function Zn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function er(e,t){var n=Kn(t);t=e.focusedElem;var r=e.selectionRange;if(n!==t&&t&&t.ownerDocument&&Jn(t.ownerDocument.documentElement,t)){if(null!==r&&Zn(t))if(e=r.start,void 0===(n=r.end)&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if((n=(e=t.ownerDocument||document)&&e.defaultView||window).getSelection){n=n.getSelection();var i=t.textContent.length,a=Math.min(r.start,i);r=void 0===r.end?a:Math.min(r.end,i),!n.extend&&a>r&&(i=r,r=a,a=i),i=Qn(t,a);var o=Qn(t,r);i&&o&&(1!==n.rangeCount||n.anchorNode!==i.node||n.anchorOffset!==i.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&((e=e.createRange()).setStart(i.node,i.offset),n.removeAllRanges(),a>r?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}for(e=[],n=t;n=n.parentNode;)1===n.nodeType&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for("function"==typeof t.focus&&t.focus(),t=0;t<e.length;t++)(n=e[t]).element.scrollLeft=n.left,n.element.scrollTop=n.top}}var tr=tt&&"documentMode"in document&&11>=document.documentMode,nr=null,rr=null,ir=null,ar=!1;function or(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;ar||null==nr||nr!==ht(r)||(r="selectionStart"in(r=nr)&&Zn(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},ir&&$n(ir,r)||(ir=r,0<(r=Ic(rr,"onSelect")).length&&(t=new Jt("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=nr)))}function lr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var sr={animationend:lr("Animation","AnimationEnd"),animationiteration:lr("Animation","AnimationIteration"),animationstart:lr("Animation","AnimationStart"),transitionrun:lr("Transition","TransitionRun"),transitionstart:lr("Transition","TransitionStart"),transitioncancel:lr("Transition","TransitionCancel"),transitionend:lr("Transition","TransitionEnd")},ur={},cr={};function dr(e){if(ur[e])return ur[e];if(!sr[e])return e;var t,n=sr[e];for(t in n)if(n.hasOwnProperty(t)&&t in cr)return ur[e]=n[t];return e}tt&&(cr=document.createElement("div").style,"AnimationEvent"in window||(delete sr.animationend.animation,delete sr.animationiteration.animation,delete sr.animationstart.animation),"TransitionEvent"in window||delete sr.transitionend.transition);var hr=dr("animationend"),fr=dr("animationiteration"),pr=dr("animationstart"),gr=dr("transitionrun"),mr=dr("transitionstart"),br=dr("transitioncancel"),vr=dr("transitionend"),yr=new Map,Tr="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll scrollEnd toggle touchMove waiting wheel".split(" ");function _r(e,t){yr.set(e,t),Ze(t,[e])}var Er=[],wr=0,Sr=0;function Lr(){for(var e=wr,t=Sr=wr=0;t<e;){var n=Er[t];Er[t++]=null;var r=Er[t];Er[t++]=null;var i=Er[t];Er[t++]=null;var a=Er[t];if(Er[t++]=null,null!==r&&null!==i){var o=r.pending;null===o?i.next=i:(i.next=o.next,o.next=i),r.pending=i}0!==a&&Rr(n,i,a)}}function Or(e,t,n,r){Er[wr++]=e,Er[wr++]=t,Er[wr++]=n,Er[wr++]=r,Sr|=r,e.lanes|=r,null!==(e=e.alternate)&&(e.lanes|=r)}function Nr(e,t,n,r){return Or(e,t,n,r),xr(e)}function Ar(e,t){return Or(e,null,null,t),xr(e)}function Rr(e,t,n){e.lanes|=n;var r=e.alternate;null!==r&&(r.lanes|=n);for(var i=!1,a=e.return;null!==a;)a.childLanes|=n,null!==(r=a.alternate)&&(r.childLanes|=n),22===a.tag&&(null===(e=a.stateNode)||1&e._visibility||(i=!0)),e=a,a=a.return;i&&null!==t&&3===e.tag&&(a=e.stateNode,i=31-ye(n),null===(e=(a=a.hiddenUpdates)[i])?a[i]=[t]:e.push(t),t.lane=536870912|n)}function xr(e){if(50<Nu)throw Nu=0,Au=null,Error(o(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}var kr={},Cr=new WeakMap;function Dr(e,t){if("object"==typeof e&&null!==e){var n=Cr.get(e);return void 0!==n?n:(t={value:e,source:t,stack:I(t)},Cr.set(e,t),t)}return{value:e,source:t,stack:I(t)}}var Mr=[],Ir=0,Br=null,Pr=0,zr=[],Ur=0,Fr=null,Wr=1,Hr="";function Yr(e,t){Mr[Ir++]=Pr,Mr[Ir++]=Br,Br=e,Pr=t}function Xr(e,t,n){zr[Ur++]=Wr,zr[Ur++]=Hr,zr[Ur++]=Fr,Fr=e;var r=Wr;e=Hr;var i=32-ye(r)-1;r&=~(1<<i),n+=1;var a=32-ye(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Wr=1<<32-ye(t)+i|n<<i|r,Hr=a+e}else Wr=1<<a|n<<i|r,Hr=e}function Vr(e){null!==e.return&&(Yr(e,1),Xr(e,1,0))}function jr(e){for(;e===Br;)Br=Mr[--Ir],Mr[Ir]=null,Pr=Mr[--Ir],Mr[Ir]=null;for(;e===Fr;)Fr=zr[--Ur],zr[Ur]=null,Hr=zr[--Ur],zr[Ur]=null,Wr=zr[--Ur],zr[Ur]=null}var Gr=null,$r=null,qr=!1,Qr=null,Jr=!1,Kr=Error(o(519));function Zr(e){throw ii(Dr(Error(o(418,"")),e)),Kr}function ei(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Pe]=e,t[ze]=r,n){case"dialog":Ac("cancel",t),Ac("close",t);break;case"iframe":case"object":case"embed":Ac("load",t);break;case"video":case"audio":for(n=0;n<Lc.length;n++)Ac(Lc[n],t);break;case"source":Ac("error",t);break;case"img":case"image":case"link":Ac("error",t),Ac("load",t);break;case"details":Ac("toggle",t);break;case"input":Ac("invalid",t),mt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0),ct(t);break;case"select":Ac("invalid",t);break;case"textarea":Ac("invalid",t),Tt(t,r.value,r.defaultValue,r.children),ct(t)}"string"!=typeof(n=r.children)&&"number"!=typeof n&&"bigint"!=typeof n||t.textContent===""+n||!0===r.suppressHydrationWarning||Wc(t.textContent,n)?(null!=r.popover&&(Ac("beforetoggle",t),Ac("toggle",t)),null!=r.onScroll&&Ac("scroll",t),null!=r.onScrollEnd&&Ac("scrollend",t),null!=r.onClick&&(t.onclick=Hc),t=!0):t=!1,t||Zr(e)}function ti(e){for(Gr=e.return;Gr;)switch(Gr.tag){case 3:case 27:return void(Jr=!0);case 5:case 13:return void(Jr=!1);default:Gr=Gr.return}}function ni(e){if(e!==Gr)return!1;if(!qr)return ti(e),qr=!0,!1;var t,n=!1;if((t=3!==e.tag&&27!==e.tag)&&((t=5===e.tag)&&(t=!("form"!==(t=e.type)&&"button"!==t)||Jc(e.type,e.memoizedProps)),t=!t),t&&(n=!0),n&&$r&&Zr(e),ti(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));e:{for(e=e.nextSibling,n=0;e;){if(8===e.nodeType)if("/$"===(t=e.data)){if(0===n){$r=od(e.nextSibling);break e}n--}else"$"!==t&&"$!"!==t&&"$?"!==t||n++;e=e.nextSibling}$r=null}}else $r=Gr?od(e.stateNode.nextSibling):null;return!0}function ri(){$r=Gr=null,qr=!1}function ii(e){null===Qr?Qr=[e]:Qr.push(e)}var ai=Error(o(460)),oi=Error(o(474)),li={then:function(){}};function si(e){return"fulfilled"===(e=e.status)||"rejected"===e}function ui(){}function ci(e,t,n){switch(void 0===(n=e[n])?e.push(t):n!==t&&(t.then(ui,ui),t=n),t.status){case"fulfilled":return t.value;case"rejected":if((e=t.reason)===ai)throw Error(o(483));throw e;default:if("string"==typeof t.status)t.then(ui,ui);else{if(null!==(e=eu)&&100<e.shellSuspendCounter)throw Error(o(482));(e=t).status="pending",e.then((function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}}),(function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}}))}switch(t.status){case"fulfilled":return t.value;case"rejected":if((e=t.reason)===ai)throw Error(o(483));throw e}throw di=t,ai}}var di=null;function hi(){if(null===di)throw Error(o(459));var e=di;return di=null,e}var fi=null,pi=0;function gi(e){var t=pi;return pi+=1,null===fi&&(fi=[]),ci(fi,e,t)}function mi(e,t){t=t.props.ref,e.ref=void 0!==t?t:null}function bi(e,t){if(t.$$typeof===l)throw Error(o(525));throw e=Object.prototype.toString.call(t),Error(o(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function vi(e){return(0,e._init)(e._payload)}function yi(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function i(e,t){return(e=Bs(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=33554434,n):r:(t.flags|=33554434,n):(t.flags|=1048576,n)}function l(t){return e&&null===t.alternate&&(t.flags|=33554434),t}function d(e,t,n,r){return null===t||6!==t.tag?((t=Ws(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function h(e,t,n,r){var a=n.type;return a===c?p(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===a||"object"==typeof a&&null!==a&&a.$$typeof===T&&vi(a)===t.type)?(mi(t=i(t,n.props),n),t.return=e,t):(mi(t=zs(n.type,n.key,n.props,null,e.mode,r),n),t.return=e,t)}function f(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Hs(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function p(e,t,n,r,a){return null===t||7!==t.tag?((t=Us(n,e.mode,r,a)).return=e,t):((t=i(t,n)).return=e,t)}function m(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t||"bigint"==typeof t)return(t=Ws(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case s:return mi(n=zs(t.type,t.key,t.props,null,e.mode,n),t),n.return=e,n;case u:return(t=Hs(t,e.mode,n)).return=e,t;case T:return m(e,t=(0,t._init)(t._payload),n)}if(F(t)||S(t))return(t=Us(t,e.mode,n,null)).return=e,t;if("function"==typeof t.then)return m(e,gi(t),n);if(t.$$typeof===g)return m(e,Ll(e,t),n);bi(e,t)}return null}function b(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n||"bigint"==typeof n)return null!==i?null:d(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case s:return n.key===i?h(e,t,n,r):null;case u:return n.key===i?f(e,t,n,r):null;case T:return b(e,t,n=(i=n._init)(n._payload),r)}if(F(n)||S(n))return null!==i?null:p(e,t,n,r,null);if("function"==typeof n.then)return b(e,t,gi(n),r);if(n.$$typeof===g)return b(e,t,Ll(e,n),r);bi(e,n)}return null}function v(e,t,n,r,i){if("string"==typeof r&&""!==r||"number"==typeof r||"bigint"==typeof r)return d(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case s:return h(t,e=e.get(null===r.key?n:r.key)||null,r,i);case u:return f(t,e=e.get(null===r.key?n:r.key)||null,r,i);case T:return v(e,t,n,r=(0,r._init)(r._payload),i)}if(F(r)||S(r))return p(t,e=e.get(n)||null,r,i,null);if("function"==typeof r.then)return v(e,t,n,gi(r),i);if(r.$$typeof===g)return v(e,t,n,Ll(t,r),i);bi(t,r)}return null}function y(d,h,f,p){if("object"==typeof f&&null!==f&&f.type===c&&null===f.key&&(f=f.props.children),"object"==typeof f&&null!==f){switch(f.$$typeof){case s:e:{for(var _=f.key;null!==h;){if(h.key===_){if((_=f.type)===c){if(7===h.tag){n(d,h.sibling),(p=i(h,f.props.children)).return=d,d=p;break e}}else if(h.elementType===_||"object"==typeof _&&null!==_&&_.$$typeof===T&&vi(_)===h.type){n(d,h.sibling),mi(p=i(h,f.props),f),p.return=d,d=p;break e}n(d,h);break}t(d,h),h=h.sibling}f.type===c?((p=Us(f.props.children,d.mode,p,f.key)).return=d,d=p):(mi(p=zs(f.type,f.key,f.props,null,d.mode,p),f),p.return=d,d=p)}return l(d);case u:e:{for(_=f.key;null!==h;){if(h.key===_){if(4===h.tag&&h.stateNode.containerInfo===f.containerInfo&&h.stateNode.implementation===f.implementation){n(d,h.sibling),(p=i(h,f.children||[])).return=d,d=p;break e}n(d,h);break}t(d,h),h=h.sibling}(p=Hs(f,d.mode,p)).return=d,d=p}return l(d);case T:return y(d,h,f=(_=f._init)(f._payload),p)}if(F(f))return function(i,o,l,s){for(var u=null,c=null,d=o,h=o=0,f=null;null!==d&&h<l.length;h++){d.index>h?(f=d,d=null):f=d.sibling;var p=b(i,d,l[h],s);if(null===p){null===d&&(d=f);break}e&&d&&null===p.alternate&&t(i,d),o=a(p,o,h),null===c?u=p:c.sibling=p,c=p,d=f}if(h===l.length)return n(i,d),qr&&Yr(i,h),u;if(null===d){for(;h<l.length;h++)null!==(d=m(i,l[h],s))&&(o=a(d,o,h),null===c?u=d:c.sibling=d,c=d);return qr&&Yr(i,h),u}for(d=r(d);h<l.length;h++)null!==(f=v(d,i,h,l[h],s))&&(e&&null!==f.alternate&&d.delete(null===f.key?h:f.key),o=a(f,o,h),null===c?u=f:c.sibling=f,c=f);return e&&d.forEach((function(e){return t(i,e)})),qr&&Yr(i,h),u}(d,h,f,p);if(S(f)){if("function"!=typeof(_=S(f)))throw Error(o(150));return function(i,l,s,u){if(null==s)throw Error(o(151));for(var c=null,d=null,h=l,f=l=0,p=null,g=s.next();null!==h&&!g.done;f++,g=s.next()){h.index>f?(p=h,h=null):p=h.sibling;var y=b(i,h,g.value,u);if(null===y){null===h&&(h=p);break}e&&h&&null===y.alternate&&t(i,h),l=a(y,l,f),null===d?c=y:d.sibling=y,d=y,h=p}if(g.done)return n(i,h),qr&&Yr(i,f),c;if(null===h){for(;!g.done;f++,g=s.next())null!==(g=m(i,g.value,u))&&(l=a(g,l,f),null===d?c=g:d.sibling=g,d=g);return qr&&Yr(i,f),c}for(h=r(h);!g.done;f++,g=s.next())null!==(g=v(h,i,f,g.value,u))&&(e&&null!==g.alternate&&h.delete(null===g.key?f:g.key),l=a(g,l,f),null===d?c=g:d.sibling=g,d=g);return e&&h.forEach((function(e){return t(i,e)})),qr&&Yr(i,f),c}(d,h,f=_.call(f),p)}if("function"==typeof f.then)return y(d,h,gi(f),p);if(f.$$typeof===g)return y(d,h,Ll(d,f),p);bi(d,f)}return"string"==typeof f&&""!==f||"number"==typeof f||"bigint"==typeof f?(f=""+f,null!==h&&6===h.tag?(n(d,h.sibling),(p=i(h,f)).return=d,d=p):(n(d,h),(p=Ws(f,d.mode,p)).return=d,d=p),l(d)):n(d,h)}return function(e,t,n,r){try{pi=0;var i=y(e,t,n,r);return fi=null,i}catch(t){if(t===ai)throw t;var a=Ms(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ti=yi(!0),_i=yi(!1),Ei=V(null),wi=V(0);function Si(e,t){G(wi,e=su),G(Ei,t),su=e|t.baseLanes}function Li(){G(wi,su),G(Ei,Ei.current)}function Oi(){su=wi.current,j(Ei),j(wi)}var Ni=V(null),Ai=null;function Ri(e){var t=e.alternate;G(Di,1&Di.current),G(Ni,e),null===Ai&&(null===t||null!==Ei.current||null!==t.memoizedState)&&(Ai=e)}function xi(e){if(22===e.tag){if(G(Di,Di.current),G(Ni,e),null===Ai){var t=e.alternate;null!==t&&null!==t.memoizedState&&(Ai=e)}}else ki()}function ki(){G(Di,Di.current),G(Ni,Ni.current)}function Ci(e){j(Ni),Ai===e&&(Ai=null),j(Di)}var Di=V(0);function Mi(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ii="undefined"!=typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach((function(e){return e()}))}},Bi=r.unstable_scheduleCallback,Pi=r.unstable_NormalPriority,zi={$$typeof:g,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ui(){return{controller:new Ii,data:new Map,refCount:0}}function Fi(e){e.refCount--,0===e.refCount&&Bi(Pi,(function(){e.controller.abort()}))}var Wi=null,Hi=0,Yi=0,Xi=null;function Vi(){if(0==--Hi&&null!==Wi){null!==Xi&&(Xi.status="fulfilled");var e=Wi;Wi=null,Yi=0,Xi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}var ji=R.S;R.S=function(e,t){"object"==typeof t&&null!==t&&"function"==typeof t.then&&function(e,t){if(null===Wi){var n=Wi=[];Hi=0,Yi=Tc(),Xi={status:"pending",value:void 0,then:function(e){n.push(e)}}}Hi++,t.then(Vi,Vi)}(0,t),null!==ji&&ji(e,t)};var Gi=V(null);function $i(){var e=Gi.current;return null!==e?e:eu.pooledCache}function qi(e,t){G(Gi,null===t?Gi.current:t.pool)}function Qi(){var e=$i();return null===e?null:{parent:zi._currentValue,pool:e}}var Ji=0,Ki=null,Zi=null,ea=null,ta=!1,na=!1,ra=!1,ia=0,aa=0,oa=null,la=0;function sa(){throw Error(o(321))}function ua(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Gn(e[n],t[n]))return!1;return!0}function ca(e,t,n,r,i,a){return Ji=a,Ki=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,R.H=null===e||null===e.memoizedState?Lo:Oo,ra=!1,a=n(r,i),ra=!1,na&&(a=ha(t,n,r,i)),da(e),a}function da(e){R.H=So;var t=null!==Zi&&null!==Zi.next;if(Ji=0,ea=Zi=Ki=null,ta=!1,aa=0,oa=null,t)throw Error(o(300));null===e||Yo||null!==(e=e.dependencies)&&El(e)&&(Yo=!0)}function ha(e,t,n,r){Ki=e;var i=0;do{if(na&&(oa=null),aa=0,na=!1,25<=i)throw Error(o(301));if(i+=1,ea=Zi=null,null!=e.updateQueue){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,null!=a.memoCache&&(a.memoCache.index=0)}R.H=No,a=t(n,r)}while(na);return a}function fa(){var e=R.H,t=e.useState()[0];return t="function"==typeof t.then?ya(t):t,e=e.useState()[0],(null!==Zi?Zi.memoizedState:null)!==e&&(Ki.flags|=1024),t}function pa(){var e=0!==ia;return ia=0,e}function ga(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ma(e){if(ta){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}ta=!1}Ji=0,ea=Zi=Ki=null,na=!1,aa=ia=0,oa=null}function ba(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ea?Ki.memoizedState=ea=e:ea=ea.next=e,ea}function va(){if(null===Zi){var e=Ki.alternate;e=null!==e?e.memoizedState:null}else e=Zi.next;var t=null===ea?Ki.memoizedState:ea.next;if(null!==t)ea=t,Zi=e;else{if(null===e){if(null===Ki.alternate)throw Error(o(467));throw Error(o(310))}e={memoizedState:(Zi=e).memoizedState,baseState:Zi.baseState,baseQueue:Zi.baseQueue,queue:Zi.queue,next:null},null===ea?Ki.memoizedState=ea=e:ea=ea.next=e}return ea}function ya(e){var t=aa;return aa+=1,null===oa&&(oa=[]),e=ci(oa,e,t),t=Ki,null===(null===ea?t.memoizedState:ea.next)&&(t=t.alternate,R.H=null===t||null===t.memoizedState?Lo:Oo),e}function Ta(e){if(null!==e&&"object"==typeof e){if("function"==typeof e.then)return ya(e);if(e.$$typeof===g)return Sl(e)}throw Error(o(438,String(e)))}function _a(e){var t=null,n=Ki.updateQueue;if(null!==n&&(t=n.memoCache),null==t){var r=Ki.alternate;null!==r&&null!==(r=r.updateQueue)&&null!=(r=r.memoCache)&&(t={data:r.data.map((function(e){return e.slice()})),index:0})}if(null==t&&(t={data:[],index:0}),null===n&&(n={lastEffect:null,events:null,stores:null,memoCache:null},Ki.updateQueue=n),n.memoCache=t,void 0===(n=t.data[t.index]))for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=E;return t.index++,n}function Ea(e,t){return"function"==typeof t?t(e):t}function wa(e){return Sa(va(),Zi,e)}function Sa(e,t,n){var r=e.queue;if(null===r)throw Error(o(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(null!==a){if(null!==i){var l=i.next;i.next=a.next,a.next=l}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,null===i)e.memoizedState=a;else{var s=l=null,u=null,c=t=i.next,d=!1;do{var h=-536870913&c.lane;if(h!==c.lane?(nu&h)===h:(Ji&h)===h){var f=c.revertLane;if(0===f)null!==u&&(u=u.next={lane:0,revertLane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),h===Yi&&(d=!0);else{if((Ji&f)===f){c=c.next,f===Yi&&(d=!0);continue}h={lane:0,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},null===u?(s=u=h,l=a):u=u.next=h,Ki.lanes|=f,cu|=f}h=c.action,ra&&n(a,h),a=c.hasEagerState?c.eagerState:n(a,h)}else f={lane:h,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},null===u?(s=u=f,l=a):u=u.next=f,Ki.lanes|=h,cu|=h;c=c.next}while(null!==c&&c!==t);if(null===u?l=a:u.next=s,!Gn(a,e.memoizedState)&&(Yo=!0,d&&null!==(n=Xi)))throw n;e.memoizedState=a,e.baseState=l,e.baseQueue=u,r.lastRenderedState=a}return null===i&&(r.lanes=0),[e.memoizedState,r.dispatch]}function La(e){var t=va(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(null!==i){n.pending=null;var l=i=i.next;do{a=e(a,l.action),l=l.next}while(l!==i);Gn(a,t.memoizedState)||(Yo=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Oa(e,t,n){var r=Ki,i=va(),a=qr;if(a){if(void 0===n)throw Error(o(407));n=n()}else n=t();var l=!Gn((Zi||i).memoizedState,n);if(l&&(i.memoizedState=n,Yo=!0),i=i.queue,Ja(Ra.bind(null,r,i,e),[e]),i.getSnapshot!==t||l||null!==ea&&1&ea.memoizedState.tag){if(r.flags|=2048,ja(9,Aa.bind(null,r,i,n,t),{destroy:void 0},null),null===eu)throw Error(o(349));a||60&Ji||Na(r,t,n)}return n}function Na(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=Ki.updateQueue)?(t={lastEffect:null,events:null,stores:null,memoCache:null},Ki.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Aa(e,t,n,r){t.value=n,t.getSnapshot=r,xa(t)&&ka(e)}function Ra(e,t,n){return n((function(){xa(t)&&ka(e)}))}function xa(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Gn(e,n)}catch(e){return!0}}function ka(e){var t=Ar(e,2);null!==t&&ku(t,0,2)}function Ca(e){var t=ba();if("function"==typeof e){var n=e;if(e=n(),ra){ve(!0);try{n()}finally{ve(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ea,lastRenderedState:e},t}function Da(e,t,n,r){return e.baseState=n,Sa(e,Zi,"function"==typeof r?r:Ea)}function Ma(e,t,n,r,i){if(_o(e))throw Error(o(485));if(null!==(e=t.action)){var a={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};null!==R.T?n(!0):a.isTransition=!1,r(a),null===(n=t.pending)?(a.next=t.pending=a,Ia(t,a)):(a.next=n.next,t.pending=n.next=a)}}function Ia(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=R.T,o={};R.T=o;try{var l=n(i,r),s=R.S;null!==s&&s(o,l),Ba(e,t,l)}catch(n){za(e,t,n)}finally{R.T=a}}else try{Ba(e,t,a=n(i,r))}catch(n){za(e,t,n)}}function Ba(e,t,n){null!==n&&"object"==typeof n&&"function"==typeof n.then?n.then((function(n){Pa(e,t,n)}),(function(n){return za(e,t,n)})):Pa(e,t,n)}function Pa(e,t,n){t.status="fulfilled",t.value=n,Ua(t),e.state=n,null!==(t=e.pending)&&((n=t.next)===t?e.pending=null:(n=n.next,t.next=n,Ia(e,n)))}function za(e,t,n){var r=e.pending;if(e.pending=null,null!==r){r=r.next;do{t.status="rejected",t.reason=n,Ua(t),t=t.next}while(t!==r)}e.action=null}function Ua(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Fa(e,t){return t}function Wa(e,t){if(qr){var n=eu.formState;if(null!==n){e:{var r=Ki;if(qr){if($r){t:{for(var i=$r,a=Jr;8!==i.nodeType;){if(!a){i=null;break t}if(null===(i=od(i.nextSibling))){i=null;break t}}i="F!"===(a=i.data)||"F"===a?i:null}if(i){$r=od(i.nextSibling),r="F!"===i.data;break e}}Zr(r)}r=!1}r&&(t=n[0])}}return(n=ba()).memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fa,lastRenderedState:t},n.queue=r,n=vo.bind(null,Ki,r),r.dispatch=n,r=Ca(!1),a=To.bind(null,Ki,!1,r.queue),i={state:t,dispatch:null,action:e,pending:null},(r=ba()).queue=i,n=Ma.bind(null,Ki,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ha(e){return Ya(va(),Zi,e)}function Ya(e,t,n){t=Sa(e,t,Fa)[0],e=wa(Ea)[0],t="object"==typeof t&&null!==t&&"function"==typeof t.then?ya(t):t;var r=va(),i=r.queue,a=i.dispatch;return n!==r.memoizedState&&(Ki.flags|=2048,ja(9,Xa.bind(null,i,n),{destroy:void 0},null)),[t,a,e]}function Xa(e,t){e.action=t}function Va(e){var t=va(),n=Zi;if(null!==n)return Ya(t,n,e);va(),t=t.memoizedState;var r=(n=va()).queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ja(e,t,n,r){return e={tag:e,create:t,inst:n,deps:r,next:null},null===(t=Ki.updateQueue)&&(t={lastEffect:null,events:null,stores:null,memoCache:null},Ki.updateQueue=t),null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ga(){return va().memoizedState}function $a(e,t,n,r){var i=ba();Ki.flags|=e,i.memoizedState=ja(1|t,n,{destroy:void 0},void 0===r?null:r)}function qa(e,t,n,r){var i=va();r=void 0===r?null:r;var a=i.memoizedState.inst;null!==Zi&&null!==r&&ua(r,Zi.memoizedState.deps)?i.memoizedState=ja(t,n,a,r):(Ki.flags|=e,i.memoizedState=ja(1|t,n,a,r))}function Qa(e,t){$a(8390656,8,e,t)}function Ja(e,t){qa(2048,8,e,t)}function Ka(e,t){return qa(4,2,e,t)}function Za(e,t){return qa(4,4,e,t)}function eo(e,t){if("function"==typeof t){e=e();var n=t(e);return function(){"function"==typeof n?n():t(null)}}if(null!=t)return e=e(),t.current=e,function(){t.current=null}}function to(e,t,n){n=null!=n?n.concat([e]):null,qa(4,4,eo.bind(null,t,e),n)}function no(){}function ro(e,t){var n=va();t=void 0===t?null:t;var r=n.memoizedState;return null!==t&&ua(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function io(e,t){var n=va();t=void 0===t?null:t;var r=n.memoizedState;if(null!==t&&ua(t,r[1]))return r[0];if(r=e(),ra){ve(!0);try{e()}finally{ve(!1)}}return n.memoizedState=[r,t],r}function ao(e,t,n){return void 0===n||1073741824&Ji?e.memoizedState=t:(e.memoizedState=n,e=xu(),Ki.lanes|=e,cu|=e,n)}function oo(e,t,n,r){return Gn(n,t)?n:null!==Ei.current?(e=ao(e,n,r),Gn(e,t)||(Yo=!0),e):42&Ji?(e=xu(),Ki.lanes|=e,cu|=e,t):(Yo=!0,e.memoizedState=n)}function lo(e,t,n,r,i){var a=W.p;W.p=0!==a&&8>a?a:8;var o,l,s,u=R.T,c={};R.T=c,To(e,!1,t,n);try{var d=i(),h=R.S;null!==h&&h(c,d),null!==d&&"object"==typeof d&&"function"==typeof d.then?yo(e,t,(o=r,l=[],s={status:"pending",value:null,reason:null,then:function(e){l.push(e)}},d.then((function(){s.status="fulfilled",s.value=o;for(var e=0;e<l.length;e++)(0,l[e])(o)}),(function(e){for(s.status="rejected",s.reason=e,e=0;e<l.length;e++)(0,l[e])(void 0)})),s),Ru()):yo(e,t,r,Ru())}catch(n){yo(e,t,{then:function(){},status:"rejected",reason:n},Ru())}finally{W.p=a,R.T=u}}function so(){}function uo(e,t,n,r){if(5!==e.tag)throw Error(o(476));var i=co(e).queue;lo(e,i,t,H,null===n?so:function(){return ho(e),n(r)})}function co(e){var t=e.memoizedState;if(null!==t)return t;var n={};return(t={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ea,lastRenderedState:H},next:null}).next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ea,lastRenderedState:n},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function ho(e){yo(e,co(e).next.queue,{},Ru())}function fo(){return Sl(Id)}function po(){return va().memoizedState}function go(){return va().memoizedState}function mo(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var n=Ru(),r=kl(t,e=xl(n),n);return null!==r&&(ku(r,0,n),Cl(r,t,n)),t={cache:Ui()},void(e.payload=t)}t=t.return}}function bo(e,t,n){var r=Ru();n={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},_o(e)?Eo(t,n):null!==(n=Nr(e,t,n,r))&&(ku(n,0,r),wo(n,t,r))}function vo(e,t,n){yo(e,t,n,Ru())}function yo(e,t,n,r){var i={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(_o(e))Eo(t,i);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var o=t.lastRenderedState,l=a(o,n);if(i.hasEagerState=!0,i.eagerState=l,Gn(l,o))return Or(e,t,i,0),null===eu&&Lr(),!1}catch(e){}if(null!==(n=Nr(e,t,i,r)))return ku(n,0,r),wo(n,t,r),!0}return!1}function To(e,t,n,r){if(r={lane:2,revertLane:Tc(),action:r,hasEagerState:!1,eagerState:null,next:null},_o(e)){if(t)throw Error(o(479))}else null!==(t=Nr(e,n,r,2))&&ku(t,0,2)}function _o(e){var t=e.alternate;return e===Ki||null!==t&&t===Ki}function Eo(e,t){na=ta=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function wo(e,t,n){if(4194176&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,De(e,n)}}var So={readContext:Sl,use:Ta,useCallback:sa,useContext:sa,useEffect:sa,useImperativeHandle:sa,useLayoutEffect:sa,useInsertionEffect:sa,useMemo:sa,useReducer:sa,useRef:sa,useState:sa,useDebugValue:sa,useDeferredValue:sa,useTransition:sa,useSyncExternalStore:sa,useId:sa};So.useCacheRefresh=sa,So.useMemoCache=sa,So.useHostTransitionStatus=sa,So.useFormState=sa,So.useActionState=sa,So.useOptimistic=sa;var Lo={readContext:Sl,use:Ta,useCallback:function(e,t){return ba().memoizedState=[e,void 0===t?null:t],e},useContext:Sl,useEffect:Qa,useImperativeHandle:function(e,t,n){n=null!=n?n.concat([e]):null,$a(4194308,4,eo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $a(4194308,4,e,t)},useInsertionEffect:function(e,t){$a(4,2,e,t)},useMemo:function(e,t){var n=ba();t=void 0===t?null:t;var r=e();if(ra){ve(!0);try{e()}finally{ve(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ba();if(void 0!==n){var i=n(t);if(ra){ve(!0);try{n(t)}finally{ve(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=bo.bind(null,Ki,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},ba().memoizedState=e},useState:function(e){var t=(e=Ca(e)).queue,n=vo.bind(null,Ki,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:no,useDeferredValue:function(e,t){return ao(ba(),e,t)},useTransition:function(){var e=Ca(!1);return e=lo.bind(null,Ki,e.queue,!0,!1),ba().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Ki,i=ba();if(qr){if(void 0===n)throw Error(o(407));n=n()}else{if(n=t(),null===eu)throw Error(o(349));60&nu||Na(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Qa(Ra.bind(null,r,a,e),[e]),r.flags|=2048,ja(9,Aa.bind(null,r,a,n,t),{destroy:void 0},null),n},useId:function(){var e=ba(),t=eu.identifierPrefix;if(qr){var n=Hr;t=":"+t+"R"+(n=(Wr&~(1<<32-ye(Wr)-1)).toString(32)+n),0<(n=ia++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=la++).toString(32)+":";return e.memoizedState=t},useCacheRefresh:function(){return ba().memoizedState=mo.bind(null,Ki)}};Lo.useMemoCache=_a,Lo.useHostTransitionStatus=fo,Lo.useFormState=Wa,Lo.useActionState=Wa,Lo.useOptimistic=function(e){var t=ba();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=To.bind(null,Ki,!0,n),n.dispatch=t,[e,t]};var Oo={readContext:Sl,use:Ta,useCallback:ro,useContext:Sl,useEffect:Ja,useImperativeHandle:to,useInsertionEffect:Ka,useLayoutEffect:Za,useMemo:io,useReducer:wa,useRef:Ga,useState:function(){return wa(Ea)},useDebugValue:no,useDeferredValue:function(e,t){return oo(va(),Zi.memoizedState,e,t)},useTransition:function(){var e=wa(Ea)[0],t=va().memoizedState;return["boolean"==typeof e?e:ya(e),t]},useSyncExternalStore:Oa,useId:po};Oo.useCacheRefresh=go,Oo.useMemoCache=_a,Oo.useHostTransitionStatus=fo,Oo.useFormState=Ha,Oo.useActionState=Ha,Oo.useOptimistic=function(e,t){return Da(va(),0,e,t)};var No={readContext:Sl,use:Ta,useCallback:ro,useContext:Sl,useEffect:Ja,useImperativeHandle:to,useInsertionEffect:Ka,useLayoutEffect:Za,useMemo:io,useReducer:La,useRef:Ga,useState:function(){return La(Ea)},useDebugValue:no,useDeferredValue:function(e,t){var n=va();return null===Zi?ao(n,e,t):oo(n,Zi.memoizedState,e,t)},useTransition:function(){var e=La(Ea)[0],t=va().memoizedState;return["boolean"==typeof e?e:ya(e),t]},useSyncExternalStore:Oa,useId:po};function Ao(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:x({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}No.useCacheRefresh=go,No.useMemoCache=_a,No.useHostTransitionStatus=fo,No.useFormState=Va,No.useActionState=Va,No.useOptimistic=function(e,t){var n=va();return null!==Zi?Da(n,0,e,t):(n.baseState=e,[e,n.queue.dispatch])};var Ro={isMounted:function(e){return!!(e=e._reactInternals)&&B(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ru(),i=xl(r);i.payload=t,null!=n&&(i.callback=n),null!==(t=kl(e,i,r))&&(ku(t,0,r),Cl(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ru(),i=xl(r);i.tag=1,i.payload=t,null!=n&&(i.callback=n),null!==(t=kl(e,i,r))&&(ku(t,0,r),Cl(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ru(),r=xl(n);r.tag=2,null!=t&&(r.callback=t),null!==(t=kl(e,r,n))&&(ku(t,0,n),Cl(t,e,n))}};function xo(e,t,n,r,i,a,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,o):!(t.prototype&&t.prototype.isPureReactComponent&&$n(n,r)&&$n(i,a))}function ko(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ro.enqueueReplaceState(t,t.state,null)}function Co(e,t){var n=t;if("ref"in t)for(var r in n={},t)"ref"!==r&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=x({},n)),e)void 0===n[i]&&(n[i]=e[i]);return n}var Do="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function Mo(e){Do(e)}function Io(e){console.error(e)}function Bo(e){Do(e)}function Po(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(e){setTimeout((function(){throw e}))}}function zo(e,t,n){try{(0,e.onCaughtError)(n.value,{componentStack:n.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(e){setTimeout((function(){throw e}))}}function Uo(e,t,n){return(n=xl(n)).tag=3,n.payload={element:null},n.callback=function(){Po(e,t)},n}function Fo(e){return(e=xl(e)).tag=3,e}function Wo(e,t,n,r){var i=n.type.getDerivedStateFromError;if("function"==typeof i){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){zo(t,n,r)}}var o=n.stateNode;null!==o&&"function"==typeof o.componentDidCatch&&(e.callback=function(){zo(t,n,r),"function"!=typeof i&&(null===_u?_u=new Set([this]):_u.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:null!==e?e:""})})}var Ho=Error(o(461)),Yo=!1;function Xo(e,t,n,r){t.child=null===e?_i(t,null,n,r):Ti(t,e.child,n,r)}function Vo(e,t,n,r,i){n=n.render;var a=t.ref;if("ref"in r){var o={};for(var l in r)"ref"!==l&&(o[l]=r[l])}else o=r;return wl(t),r=ca(e,t,n,o,a,i),l=pa(),null===e||Yo?(qr&&l&&Vr(t),t.flags|=1,Xo(e,t,r,i),t.child):(ga(e,t,i),dl(e,t,i))}function jo(e,t,n,r,i){if(null===e){var a=n.type;return"function"!=typeof a||Is(a)||void 0!==a.defaultProps||null!==n.compare?((e=zs(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Go(e,t,a,r,i))}if(a=e.child,!hl(e,i)){var o=a.memoizedProps;if((n=null!==(n=n.compare)?n:$n)(o,r)&&e.ref===t.ref)return dl(e,t,i)}return t.flags|=1,(e=Bs(a,r)).ref=t.ref,e.return=t,t.child=e}function Go(e,t,n,r,i){if(null!==e){var a=e.memoizedProps;if($n(a,r)&&e.ref===t.ref){if(Yo=!1,t.pendingProps=r=a,!hl(e,i))return t.lanes=e.lanes,dl(e,t,i);131072&e.flags&&(Yo=!0)}}return Jo(e,t,n,r,i)}function $o(e,t,n){var r=t.pendingProps,i=r.children,a=!!(2&t.stateNode._pendingVisibility),o=null!==e?e.memoizedState:null;if(Qo(e,t),"hidden"===r.mode||a){if(128&t.flags){if(r=null!==o?o.baseLanes|n:n,null!==e){for(i=t.child=e.child,a=0;null!==i;)a=a|i.lanes|i.childLanes,i=i.sibling;t.childLanes=a&~r}else t.childLanes=0,t.child=null;return qo(e,t,r,n)}if(!(536870912&n))return t.lanes=t.childLanes=536870912,qo(e,t,null!==o?o.baseLanes|n:n,n);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&qi(0,null!==o?o.cachePool:null),null!==o?Si(t,o):Li(),xi(t)}else null!==o?(qi(0,o.cachePool),Si(t,o),ki(),t.memoizedState=null):(null!==e&&qi(0,null),Li(),ki());return Xo(e,t,i,n),t.child}function qo(e,t,n,r){var i=$i();return i=null===i?null:{parent:zi._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},null!==e&&qi(0,null),Li(),xi(t),null!==e&&_l(e,t,r,!0),null}function Qo(e,t){var n=t.ref;if(null===n)null!==e&&null!==e.ref&&(t.flags|=2097664);else{if("function"!=typeof n&&"object"!=typeof n)throw Error(o(284));null!==e&&e.ref===n||(t.flags|=2097664)}}function Jo(e,t,n,r,i){return wl(t),n=ca(e,t,n,r,void 0,i),r=pa(),null===e||Yo?(qr&&r&&Vr(t),t.flags|=1,Xo(e,t,n,i),t.child):(ga(e,t,i),dl(e,t,i))}function Ko(e,t,n,r,i,a){return wl(t),t.updateQueue=null,n=ha(t,r,n,i),da(e),r=pa(),null===e||Yo?(qr&&r&&Vr(t),t.flags|=1,Xo(e,t,n,a),t.child):(ga(e,t,a),dl(e,t,a))}function Zo(e,t,n,r,i){if(wl(t),null===t.stateNode){var a=kr,o=n.contextType;"object"==typeof o&&null!==o&&(a=Sl(o)),a=new n(r,a),t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,a.updater=Ro,t.stateNode=a,a._reactInternals=t,(a=t.stateNode).props=r,a.state=t.memoizedState,a.refs={},Al(t),o=n.contextType,a.context="object"==typeof o&&null!==o?Sl(o):kr,a.state=t.memoizedState,"function"==typeof(o=n.getDerivedStateFromProps)&&(Ao(t,n,o,r),a.state=t.memoizedState),"function"==typeof n.getDerivedStateFromProps||"function"==typeof a.getSnapshotBeforeUpdate||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||(o=a.state,"function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),o!==a.state&&Ro.enqueueReplaceState(a,a.state,null),Bl(t,r,a,i),Il(),a.state=t.memoizedState),"function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!0}else if(null===e){a=t.stateNode;var l=t.memoizedProps,s=Co(n,l);a.props=s;var u=a.context,c=n.contextType;o=kr,"object"==typeof c&&null!==c&&(o=Sl(c));var d=n.getDerivedStateFromProps;c="function"==typeof d||"function"==typeof a.getSnapshotBeforeUpdate,l=t.pendingProps!==l,c||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(l||u!==o)&&ko(t,a,r,o),Nl=!1;var h=t.memoizedState;a.state=h,Bl(t,r,a,i),Il(),u=t.memoizedState,l||h!==u||Nl?("function"==typeof d&&(Ao(t,n,d,r),u=t.memoizedState),(s=Nl||xo(t,n,s,r,h,u,o))?(c||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),a.props=r,a.state=u,a.context=o,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Rl(e,t),c=Co(n,o=t.memoizedProps),a.props=c,d=t.pendingProps,h=a.context,u=n.contextType,s=kr,"object"==typeof u&&null!==u&&(s=Sl(u)),(u="function"==typeof(l=n.getDerivedStateFromProps)||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==d||h!==s)&&ko(t,a,r,s),Nl=!1,h=t.memoizedState,a.state=h,Bl(t,r,a,i),Il();var f=t.memoizedState;o!==d||h!==f||Nl||null!==e&&null!==e.dependencies&&El(e.dependencies)?("function"==typeof l&&(Ao(t,n,l,r),f=t.memoizedState),(c=Nl||xo(t,n,c,r,h,f,s)||null!==e&&null!==e.dependencies&&El(e.dependencies))?(u||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,f,s),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,f,s)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=f),a.props=r,a.state=f,a.context=s,r=c):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Qo(e,t),r=!!(128&t.flags),a||r?(a=t.stateNode,n=r&&"function"!=typeof n.getDerivedStateFromError?null:a.render(),t.flags|=1,null!==e&&r?(t.child=Ti(t,e.child,null,i),t.child=Ti(t,null,n,i)):Xo(e,t,n,i),t.memoizedState=a.state,e=t.child):e=dl(e,t,i),e}function el(e,t,n,r){return ri(),t.flags|=256,Xo(e,t,n,r),t.child}var tl={dehydrated:null,treeContext:null,retryLane:0};function nl(e){return{baseLanes:e,cachePool:Qi()}}function rl(e,t,n){return e=null!==e?e.childLanes&~n:0,t&&(e|=fu),e}function il(e,t,n){var r,i=t.pendingProps,a=!1,l=!!(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&!!(2&Di.current)),r&&(a=!0,t.flags&=-129),r=!!(32&t.flags),t.flags&=-33,null===e){if(qr){if(a?Ri(t):ki(),qr){var s,u=$r;if(s=u){e:{for(s=u,u=Jr;8!==s.nodeType;){if(!u){u=null;break e}if(null===(s=od(s.nextSibling))){u=null;break e}}u=s}null!==u?(t.memoizedState={dehydrated:u,treeContext:null!==Fr?{id:Wr,overflow:Hr}:null,retryLane:536870912},(s=Ms(18,null,null,0)).stateNode=u,s.return=t,t.child=s,Gr=t,$r=null,s=!0):s=!1}s||Zr(t)}if(null!==(u=t.memoizedState)&&null!==(u=u.dehydrated))return"$!"===u.data?t.lanes=16:t.lanes=536870912,null;Ci(t)}return u=i.children,i=i.fallback,a?(ki(),u=ol({mode:"hidden",children:u},a=t.mode),i=Us(i,a,n,null),u.return=t,i.return=t,u.sibling=i,t.child=u,(a=t.child).memoizedState=nl(n),a.childLanes=rl(e,r,n),t.memoizedState=tl,i):(Ri(t),al(t,u))}if(null!==(s=e.memoizedState)&&null!==(u=s.dehydrated)){if(l)256&t.flags?(Ri(t),t.flags&=-257,t=ll(e,t,n)):null!==t.memoizedState?(ki(),t.child=e.child,t.flags|=128,t=null):(ki(),a=i.fallback,u=t.mode,i=ol({mode:"visible",children:i.children},u),(a=Us(a,u,n,null)).flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,Ti(t,e.child,null,n),(i=t.child).memoizedState=nl(n),i.childLanes=rl(e,r,n),t.memoizedState=tl,t=a);else if(Ri(t),"$!"===u.data){if(r=u.nextSibling&&u.nextSibling.dataset)var c=r.dgst;r=c,(i=Error(o(419))).stack="",i.digest=r,ii({value:i,source:null,stack:null}),t=ll(e,t,n)}else if(Yo||_l(e,t,n,!1),r=!!(n&e.childLanes),Yo||r){if(null!==(r=eu)){if(42&(i=n&-n))i=1;else switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=64;break;case 268435456:i=134217728;break;default:i=0}if(0!==(i=i&(r.suspendedLanes|n)?0:i)&&i!==s.retryLane)throw s.retryLane=i,Ar(e,i),ku(r,0,i),Ho}"$?"===u.data||Yu(),t=ll(e,t,n)}else"$?"===u.data?(t.flags|=128,t.child=e.child,t=oc.bind(null,e),u._reactRetry=t,t=null):(e=s.treeContext,$r=od(u.nextSibling),Gr=t,qr=!0,Qr=null,Jr=!1,null!==e&&(zr[Ur++]=Wr,zr[Ur++]=Hr,zr[Ur++]=Fr,Wr=e.id,Hr=e.overflow,Fr=t),(t=al(t,i.children)).flags|=4096);return t}return a?(ki(),a=i.fallback,u=t.mode,c=(s=e.child).sibling,(i=Bs(s,{mode:"hidden",children:i.children})).subtreeFlags=31457280&s.subtreeFlags,null!==c?a=Bs(c,a):(a=Us(a,u,n,null)).flags|=2,a.return=t,i.return=t,i.sibling=a,t.child=i,i=a,a=t.child,null===(u=e.child.memoizedState)?u=nl(n):(null!==(s=u.cachePool)?(c=zi._currentValue,s=s.parent!==c?{parent:c,pool:c}:s):s=Qi(),u={baseLanes:u.baseLanes|n,cachePool:s}),a.memoizedState=u,a.childLanes=rl(e,r,n),t.memoizedState=tl,i):(Ri(t),e=(n=e.child).sibling,(n=Bs(n,{mode:"visible",children:i.children})).return=t,n.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n)}function al(e,t){return(t=ol({mode:"visible",children:t},e.mode)).return=e,e.child=t}function ol(e,t){return Fs(e,t,0,null)}function ll(e,t,n){return Ti(t,e.child,null,n),(e=al(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function sl(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),yl(e.return,t,n)}function ul(e,t,n,r,i){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function cl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Xo(e,t,r.children,n),2&(r=Di.current))r=1&r|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&sl(e,n,t);else if(19===e.tag)sl(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}switch(G(Di,r),i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===Mi(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ul(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Mi(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ul(t,!0,n,null,a);break;case"together":ul(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function dl(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),cu|=t.lanes,!(n&t.childLanes)){if(null===e)return null;if(_l(e,t,n,!1),!(n&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(n=Bs(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Bs(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function hl(e,t){return!!(e.lanes&t)||!(null===(e=e.dependencies)||!El(e))}function fl(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps)Yo=!0;else{if(!(hl(e,n)||128&t.flags))return Yo=!1,function(e,t,n){switch(t.tag){case 3:K(t,t.stateNode.containerInfo),bl(0,zi,e.memoizedState.cache),ri();break;case 27:case 5:ee(t);break;case 4:K(t,t.stateNode.containerInfo);break;case 10:bl(0,t.type,t.memoizedProps.value);break;case 13:var r=t.memoizedState;if(null!==r)return null!==r.dehydrated?(Ri(t),t.flags|=128,null):n&t.child.childLanes?il(e,t,n):(Ri(t),null!==(e=dl(e,t,n))?e.sibling:null);Ri(t);break;case 19:var i=!!(128&e.flags);if((r=!!(n&t.childLanes))||(_l(e,t,n,!1),r=!!(n&t.childLanes)),i){if(r)return cl(e,t,n);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),G(Di,Di.current),r)break;return null;case 22:case 23:return t.lanes=0,$o(e,t,n);case 24:bl(0,zi,e.memoizedState.cache)}return dl(e,t,n)}(e,t,n);Yo=!!(131072&e.flags)}else Yo=!1,qr&&1048576&t.flags&&Xr(t,Pr,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var r=t.elementType,i=r._init;if(r=i(r._payload),t.type=r,"function"!=typeof r){if(null!=r){if((i=r.$$typeof)===m){t.tag=11,t=Vo(null,t,r,e,n);break e}if(i===y){t.tag=14,t=jo(null,t,r,e,n);break e}}throw t=O(r)||r,Error(o(306,t,""))}Is(r)?(e=Co(r,e),t.tag=1,t=Zo(null,t,r,e,n)):(t.tag=0,t=Jo(null,t,r,e,n))}return t;case 0:return Jo(e,t,t.type,t.pendingProps,n);case 1:return Zo(e,t,r=t.type,i=Co(r,t.pendingProps),n);case 3:e:{if(K(t,t.stateNode.containerInfo),null===e)throw Error(o(387));var a=t.pendingProps;r=(i=t.memoizedState).element,Rl(e,t),Bl(t,a,null,n);var l=t.memoizedState;if(a=l.cache,bl(0,zi,a),a!==i.cache&&Tl(t,[zi],n,!0),Il(),a=l.element,i.isDehydrated){if(i={element:a,isDehydrated:!1,cache:l.cache},t.updateQueue.baseState=i,t.memoizedState=i,256&t.flags){t=el(e,t,a,n);break e}if(a!==r){ii(r=Dr(Error(o(424)),t)),t=el(e,t,a,n);break e}for($r=od(t.stateNode.containerInfo.firstChild),Gr=t,qr=!0,Qr=null,Jr=!0,n=_i(t,null,a,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(ri(),a===r){t=dl(e,t,n);break e}Xo(e,t,a,n)}t=t.child}return t;case 26:return Qo(e,t),null===e?(n=gd(t.type,null,t.pendingProps,null))?t.memoizedState=n:qr||(n=t.type,e=t.pendingProps,(r=$c(Q.current).createElement(n))[Pe]=t,r[ze]=e,Vc(r,n,e),Qe(r),t.stateNode=r):t.memoizedState=gd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ee(t),null===e&&qr&&(r=t.stateNode=sd(t.type,t.pendingProps,Q.current),Gr=t,Jr=!0,$r=od(r.firstChild)),r=t.pendingProps.children,null!==e||qr?Xo(e,t,r,n):t.child=Ti(t,null,r,n),Qo(e,t),t.child;case 5:return null===e&&qr&&((i=r=$r)&&(null!==(r=function(e,t,n,r){for(;1===e.nodeType;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(r){if(!e[Xe])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(a=e.getAttribute("rel"))&&e.hasAttribute("data-precedence"))break;if(a!==i.rel||e.getAttribute("href")!==(null==i.href?null:i.href)||e.getAttribute("crossorigin")!==(null==i.crossOrigin?null:i.crossOrigin)||e.getAttribute("title")!==(null==i.title?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((a=e.getAttribute("src"))!==(null==i.src?null:i.src)||e.getAttribute("type")!==(null==i.type?null:i.type)||e.getAttribute("crossorigin")!==(null==i.crossOrigin?null:i.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==t||"hidden"!==e.type)return e;var a=null==i.name?null:""+i.name;if("hidden"===i.type&&e.getAttribute("name")===a)return e}if(null===(e=od(e.nextSibling)))break}return null}(r,t.type,t.pendingProps,Jr))?(t.stateNode=r,Gr=t,$r=od(r.firstChild),Jr=!1,i=!0):i=!1),i||Zr(t)),ee(t),i=t.type,a=t.pendingProps,l=null!==e?e.memoizedProps:null,r=a.children,Jc(i,a)?r=null:null!==l&&Jc(i,l)&&(t.flags|=32),null!==t.memoizedState&&(i=ca(e,t,fa,null,null,n),Id._currentValue=i),Qo(e,t),Xo(e,t,r,n),t.child;case 6:return null===e&&qr&&((e=n=$r)&&(null!==(n=function(e,t,n){if(""===t)return null;for(;3!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!n)return null;if(null===(e=od(e.nextSibling)))return null}return e}(n,t.pendingProps,Jr))?(t.stateNode=n,Gr=t,$r=null,e=!0):e=!1),e||Zr(t)),null;case 13:return il(e,t,n);case 4:return K(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Ti(t,null,r,n):Xo(e,t,r,n),t.child;case 11:return Vo(e,t,t.type,t.pendingProps,n);case 7:return Xo(e,t,t.pendingProps,n),t.child;case 8:case 12:return Xo(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,bl(0,t.type,r.value),Xo(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,wl(t),r=r(i=Sl(i)),t.flags|=1,Xo(e,t,r,n),t.child;case 14:return jo(e,t,t.type,t.pendingProps,n);case 15:return Go(e,t,t.type,t.pendingProps,n);case 19:return cl(e,t,n);case 22:return $o(e,t,n);case 24:return wl(t),r=Sl(zi),null===e?(null===(i=$i())&&(i=eu,a=Ui(),i.pooledCache=a,a.refCount++,null!==a&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},Al(t),bl(0,zi,i)):(!!(e.lanes&n)&&(Rl(e,t),Bl(t,null,null,n),Il()),i=e.memoizedState,a=t.memoizedState,i.parent!==r?(i={parent:r,cache:r},t.memoizedState=i,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=i),bl(0,zi,r)):(r=a.cache,bl(0,zi,r),r!==i.cache&&Tl(t,[zi],n,!0))),Xo(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}var pl=V(null),gl=null,ml=null;function bl(e,t,n){G(pl,t._currentValue),t._currentValue=n}function vl(e){e._currentValue=pl.current,j(pl)}function yl(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Tl(e,t,n,r){var i=e.child;for(null!==i&&(i.return=e);null!==i;){var a=i.dependencies;if(null!==a){var l=i.child;a=a.firstContext;e:for(;null!==a;){var s=a;a=i;for(var u=0;u<t.length;u++)if(s.context===t[u]){a.lanes|=n,null!==(s=a.alternate)&&(s.lanes|=n),yl(a.return,n,e),r||(l=null);break e}a=s.next}}else if(18===i.tag){if(null===(l=i.return))throw Error(o(341));l.lanes|=n,null!==(a=l.alternate)&&(a.lanes|=n),yl(l,n,e),l=null}else l=i.child;if(null!==l)l.return=i;else for(l=i;null!==l;){if(l===e){l=null;break}if(null!==(i=l.sibling)){i.return=l.return,l=i;break}l=l.return}i=l}}function _l(e,t,n,r){e=null;for(var i=t,a=!1;null!==i;){if(!a)if(524288&i.flags)a=!0;else if(262144&i.flags)break;if(10===i.tag){var l=i.alternate;if(null===l)throw Error(o(387));if(null!==(l=l.memoizedProps)){var s=i.type;Gn(i.pendingProps.value,l.value)||(null!==e?e.push(s):e=[s])}}else if(i===J.current){if(null===(l=i.alternate))throw Error(o(387));l.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(null!==e?e.push(Id):e=[Id])}i=i.return}null!==e&&Tl(t,e,n,r),t.flags|=262144}function El(e){for(e=e.firstContext;null!==e;){if(!Gn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function wl(e){gl=e,ml=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function Sl(e){return Ol(gl,e)}function Ll(e,t){return null===gl&&wl(e),Ol(e,t)}function Ol(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},null===ml){if(null===e)throw Error(o(308));ml=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ml=ml.next=t;return n}var Nl=!1;function Al(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Rl(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function xl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function kl(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&Zs){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=xr(e),Rr(e,null,n),t}return Or(e,r,t,n),xr(e)}function Cl(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194176&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,De(e,n)}}function Dl(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===a?i=a=o:a=a.next=o,n=n.next}while(null!==n);null===a?i=a=t:a=a.next=t}else i=a=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ml=!1;function Il(){if(Ml&&null!==Xi)throw Xi}function Bl(e,t,n,r){Ml=!1;var i=e.updateQueue;Nl=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(null!==l){i.shared.pending=null;var s=l,u=s.next;s.next=null,null===o?a=u:o.next=u,o=s;var c=e.alternate;null!==c&&(l=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===l?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=s)}if(null!==a){var d=i.baseState;for(o=0,c=u=s=null,l=a;;){var h=-536870913&l.lane,f=h!==l.lane;if(f?(nu&h)===h:(r&h)===h){0!==h&&h===Yi&&(Ml=!0),null!==c&&(c=c.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var p=e,g=l;h=t;var m=n;switch(g.tag){case 1:if("function"==typeof(p=g.payload)){d=p.call(m,d,h);break e}d=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(null==(h="function"==typeof(p=g.payload)?p.call(m,d,h):p))break e;d=x({},d,h);break e;case 2:Nl=!0}}null!==(h=l.callback)&&(e.flags|=64,f&&(e.flags|=8192),null===(f=i.callbacks)?i.callbacks=[h]:f.push(h))}else f={lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},null===c?(u=c=f,s=d):c=c.next=f,o|=h;if(null===(l=l.next)){if(null===(l=i.shared.pending))break;l=(f=l).next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}null===c&&(s=d),i.baseState=s,i.firstBaseUpdate=u,i.lastBaseUpdate=c,null===a&&(i.shared.lanes=0),cu|=o,e.lanes=o,e.memoizedState=d}}function Pl(e,t){if("function"!=typeof e)throw Error(o(191,e));e.call(t)}function zl(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;e<n.length;e++)Pl(n[e],t)}function Ul(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){nc(t,t.return,e)}}function Fl(e,t,n){try{var r=t.updateQueue,i=null!==r?r.lastEffect:null;if(null!==i){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,l=o.destroy;if(void 0!==l){o.destroy=void 0,i=t;var s=n;try{l()}catch(e){nc(i,s,e)}}}r=r.next}while(r!==a)}}catch(e){nc(t,t.return,e)}}function Wl(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{zl(t,n)}catch(t){nc(e,e.return,t)}}}function Hl(e,t,n){n.props=Co(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){nc(e,t,n)}}function Yl(e,t){try{var n=e.ref;if(null!==n){var r=e.stateNode;switch(e.tag){case 26:case 27:case 5:var i=r;break;default:i=r}"function"==typeof n?e.refCleanup=n(i):n.current=i}}catch(n){nc(e,t,n)}}function Xl(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(n){nc(e,t,n)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(n){nc(e,t,n)}else n.current=null}function Vl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){nc(e,e.return,t)}}function jl(e,t,n){try{var r=e.stateNode;!function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,a=null,l=null,s=null,u=null,c=null,d=null;for(p in n){var h=n[p];if(n.hasOwnProperty(p)&&null!=h)switch(p){case"checked":case"value":break;case"defaultValue":u=h;default:r.hasOwnProperty(p)||Yc(e,t,p,null,r,h)}}for(var f in r){var p=r[f];if(h=n[f],r.hasOwnProperty(f)&&(null!=p||null!=h))switch(f){case"type":a=p;break;case"name":i=p;break;case"checked":c=p;break;case"defaultChecked":d=p;break;case"value":l=p;break;case"defaultValue":s=p;break;case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(o(137,t));break;default:p!==h&&Yc(e,t,f,p,r,h)}}return void gt(e,l,s,u,c,d,a,i);case"select":for(a in p=l=s=f=null,n)if(u=n[a],n.hasOwnProperty(a)&&null!=u)switch(a){case"value":break;case"multiple":p=u;default:r.hasOwnProperty(a)||Yc(e,t,a,null,r,u)}for(i in r)if(a=r[i],u=n[i],r.hasOwnProperty(i)&&(null!=a||null!=u))switch(i){case"value":f=a;break;case"defaultValue":s=a;break;case"multiple":l=a;default:a!==u&&Yc(e,t,i,a,r,u)}return t=s,n=l,r=p,void(null!=f?vt(e,!!n,f,!1):!!r!=!!n&&(null!=t?vt(e,!!n,t,!0):vt(e,!!n,n?[]:"",!1)));case"textarea":for(s in p=f=null,n)if(i=n[s],n.hasOwnProperty(s)&&null!=i&&!r.hasOwnProperty(s))switch(s){case"value":case"children":break;default:Yc(e,t,s,null,r,i)}for(l in r)if(i=r[l],a=n[l],r.hasOwnProperty(l)&&(null!=i||null!=a))switch(l){case"value":f=i;break;case"defaultValue":p=i;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=i)throw Error(o(91));break;default:i!==a&&Yc(e,t,l,i,r,a)}return void yt(e,f,p);case"option":for(var g in n)f=n[g],n.hasOwnProperty(g)&&null!=f&&!r.hasOwnProperty(g)&&("selected"===g?e.selected=!1:Yc(e,t,g,null,r,f));for(u in r)f=r[u],p=n[u],!r.hasOwnProperty(u)||f===p||null==f&&null==p||("selected"===u?e.selected=f&&"function"!=typeof f&&"symbol"!=typeof f:Yc(e,t,u,f,r,p));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var m in n)f=n[m],n.hasOwnProperty(m)&&null!=f&&!r.hasOwnProperty(m)&&Yc(e,t,m,null,r,f);for(c in r)if(f=r[c],p=n[c],r.hasOwnProperty(c)&&f!==p&&(null!=f||null!=p))switch(c){case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(o(137,t));break;default:Yc(e,t,c,f,r,p)}return;default:if(Lt(t)){for(var b in n)f=n[b],n.hasOwnProperty(b)&&void 0!==f&&!r.hasOwnProperty(b)&&Xc(e,t,b,void 0,r,f);for(d in r)f=r[d],p=n[d],!r.hasOwnProperty(d)||f===p||void 0===f&&void 0===p||Xc(e,t,d,f,r,p);return}}for(var v in n)f=n[v],n.hasOwnProperty(v)&&null!=f&&!r.hasOwnProperty(v)&&Yc(e,t,v,null,r,f);for(h in r)f=r[h],p=n[h],!r.hasOwnProperty(h)||f===p||null==f&&null==p||Yc(e,t,h,f,r,p)}(r,e.type,n,t),r[ze]=t}catch(t){nc(e,e.return,t)}}function Gl(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag||4===e.tag}function $l(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Gl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&27!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function ql(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Hc));else if(4!==r&&27!==r&&null!==(e=e.child))for(ql(e,t,n),e=e.sibling;null!==e;)ql(e,t,n),e=e.sibling}function Ql(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&27!==r&&null!==(e=e.child))for(Ql(e,t,n),e=e.sibling;null!==e;)Ql(e,t,n),e=e.sibling}var Jl=!1,Kl=!1,Zl=!1,es="function"==typeof WeakSet?WeakSet:Set,ts=null,ns=!1;function rs(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ms(e,n),4&r&&Ul(5,n);break;case 1:if(ms(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(e){nc(n,n.return,e)}else{var i=Co(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){nc(n,n.return,e)}}64&r&&Wl(n),512&r&&Yl(n,n.return);break;case 3:if(ms(e,n),64&r&&null!==(r=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:e=n.child.stateNode}try{zl(r,e)}catch(e){nc(n,n.return,e)}}break;case 26:ms(e,n),512&r&&Yl(n,n.return);break;case 27:case 5:ms(e,n),null===t&&4&r&&Vl(n),512&r&&Yl(n,n.return);break;case 12:default:ms(e,n);break;case 13:ms(e,n),4&r&&us(e,n);break;case 22:if(!(i=null!==n.memoizedState||Jl)){t=null!==t&&null!==t.memoizedState||Kl;var a=Jl,o=Kl;Jl=i,(Kl=t)&&!o?vs(e,n,!!(8772&n.subtreeFlags)):ms(e,n),Jl=a,Kl=o}512&r&&("manual"===n.memoizedProps.mode?Yl(n,n.return):Xl(n,n.return))}}function is(e){var t=e.alternate;null!==t&&(e.alternate=null,is(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&Ve(t),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var as=null,os=!1;function ls(e,t,n){for(n=n.child;null!==n;)ss(e,t,n),n=n.sibling}function ss(e,t,n){if(be&&"function"==typeof be.onCommitFiberUnmount)try{be.onCommitFiberUnmount(me,n)}catch(e){}switch(n.tag){case 26:Kl||Xl(n,t),ls(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:Kl||Xl(n,t);var r=as,i=os;for(as=n.stateNode,ls(e,t,n),t=(n=n.stateNode).attributes;t.length;)n.removeAttributeNode(t[0]);Ve(n),as=r,os=i;break;case 5:Kl||Xl(n,t);case 6:i=as;var a=os;if(as=null,ls(e,t,n),os=a,null!==(as=i))if(os)try{e=as,r=n.stateNode,8===e.nodeType?e.parentNode.removeChild(r):e.removeChild(r)}catch(e){nc(n,t,e)}else try{as.removeChild(n.stateNode)}catch(e){nc(n,t,e)}break;case 18:null!==as&&(os?(t=as,n=n.stateNode,8===t.nodeType?id(t.parentNode,n):1===t.nodeType&&id(t,n),hh(t)):id(as,n.stateNode));break;case 4:r=as,i=os,as=n.stateNode.containerInfo,os=!0,ls(e,t,n),as=r,os=i;break;case 0:case 11:case 14:case 15:Kl||Fl(2,n,t),Kl||Fl(4,n,t),ls(e,t,n);break;case 1:Kl||(Xl(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&Hl(n,t,r)),ls(e,t,n);break;case 21:ls(e,t,n);break;case 22:Kl||Xl(n,t),Kl=(r=Kl)||null!==n.memoizedState,ls(e,t,n),Kl=r;break;default:ls(e,t,n)}}function us(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))try{hh(e)}catch(e){nc(t,t.return,e)}}function cs(e,t){var n=function(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new es),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new es),t;default:throw Error(o(435,e.tag))}}(e);t.forEach((function(t){var r=lc.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}function ds(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var i=n[r],a=e,l=t,s=l;e:for(;null!==s;){switch(s.tag){case 27:case 5:as=s.stateNode,os=!1;break e;case 3:case 4:as=s.stateNode.containerInfo,os=!0;break e}s=s.return}if(null===as)throw Error(o(160));ss(a,l,i),as=null,os=!1,null!==(a=i.alternate)&&(a.return=null),i.return=null}if(13878&t.subtreeFlags)for(t=t.child;null!==t;)fs(t,e),t=t.sibling}var hs=null;function fs(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ds(t,e),ps(e),4&r&&(Fl(3,e,e.return),Ul(3,e),Fl(5,e,e.return));break;case 1:ds(t,e),ps(e),512&r&&(Kl||null===n||Xl(n,n.return)),64&r&&Jl&&null!==(e=e.updateQueue)&&null!==(r=e.callbacks)&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===n?r:n.concat(r));break;case 26:var i=hs;if(ds(t,e),ps(e),512&r&&(Kl||null===n||Xl(n,n.return)),4&r){var a=null!==n?n.memoizedState:null;if(r=e.memoizedState,null===n)if(null===r)if(null===e.stateNode){e:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(r){case"title":(!(a=i.getElementsByTagName("title")[0])||a[Xe]||a[Pe]||"http://www.w3.org/2000/svg"===a.namespaceURI||a.hasAttribute("itemprop"))&&(a=i.createElement(r),i.head.insertBefore(a,i.querySelector("head > title"))),Vc(a,r,n),a[Pe]=e,Qe(a),r=a;break e;case"link":var l=Od("link","href",i).get(r+(n.href||""));if(l)for(var s=0;s<l.length;s++)if((a=l[s]).getAttribute("href")===(null==n.href?null:n.href)&&a.getAttribute("rel")===(null==n.rel?null:n.rel)&&a.getAttribute("title")===(null==n.title?null:n.title)&&a.getAttribute("crossorigin")===(null==n.crossOrigin?null:n.crossOrigin)){l.splice(s,1);break t}Vc(a=i.createElement(r),r,n),i.head.appendChild(a);break;case"meta":if(l=Od("meta","content",i).get(r+(n.content||"")))for(s=0;s<l.length;s++)if((a=l[s]).getAttribute("content")===(null==n.content?null:""+n.content)&&a.getAttribute("name")===(null==n.name?null:n.name)&&a.getAttribute("property")===(null==n.property?null:n.property)&&a.getAttribute("http-equiv")===(null==n.httpEquiv?null:n.httpEquiv)&&a.getAttribute("charset")===(null==n.charSet?null:n.charSet)){l.splice(s,1);break t}Vc(a=i.createElement(r),r,n),i.head.appendChild(a);break;default:throw Error(o(468,r))}a[Pe]=e,Qe(a),r=a}e.stateNode=r}else Nd(i,e.type,e.stateNode);else e.stateNode=_d(i,r,e.memoizedProps);else a!==r?(null===a?null!==n.stateNode&&(n=n.stateNode).parentNode.removeChild(n):a.count--,null===r?Nd(i,e.type,e.stateNode):_d(i,r,e.memoizedProps)):null===r&&null!==e.stateNode&&jl(e,e.memoizedProps,n.memoizedProps)}break;case 27:if(4&r&&null===e.alternate){i=e.stateNode,a=e.memoizedProps;try{for(var u=i.firstChild;u;){var c=u.nextSibling,d=u.nodeName;u[Xe]||"HEAD"===d||"BODY"===d||"SCRIPT"===d||"STYLE"===d||"LINK"===d&&"stylesheet"===u.rel.toLowerCase()||i.removeChild(u),u=c}for(var h=e.type,f=i.attributes;f.length;)i.removeAttributeNode(f[0]);Vc(i,h,a),i[Pe]=e,i[ze]=a}catch(t){nc(e,e.return,t)}}case 5:if(ds(t,e),ps(e),512&r&&(Kl||null===n||Xl(n,n.return)),32&e.flags){i=e.stateNode;try{_t(i,"")}catch(t){nc(e,e.return,t)}}4&r&&null!=e.stateNode&&jl(e,i=e.memoizedProps,null!==n?n.memoizedProps:i),1024&r&&(Zl=!0);break;case 6:if(ds(t,e),ps(e),4&r){if(null===e.stateNode)throw Error(o(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){nc(e,e.return,t)}}break;case 3:if(Ld=null,i=hs,hs=dd(t.containerInfo),ds(t,e),hs=i,ps(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{hh(t.containerInfo)}catch(t){nc(e,e.return,t)}Zl&&(Zl=!1,gs(e));break;case 4:r=hs,hs=dd(e.stateNode.containerInfo),ds(t,e),ps(e),hs=r;break;case 12:ds(t,e),ps(e);break;case 13:ds(t,e),ps(e),8192&e.child.flags&&null!==e.memoizedState!=(null!==n&&null!==n.memoizedState)&&(vu=le()),4&r&&null!==(r=e.updateQueue)&&(e.updateQueue=null,cs(e,r));break;case 22:if(512&r&&(Kl||null===n||Xl(n,n.return)),u=null!==e.memoizedState,c=null!==n&&null!==n.memoizedState,Jl=(d=Jl)||u,Kl=(h=Kl)||c,ds(t,e),Kl=h,Jl=d,ps(e),(t=e.stateNode)._current=e,t._visibility&=-3,t._visibility|=2&t._pendingVisibility,8192&r&&(t._visibility=u?-2&t._visibility:1|t._visibility,u&&(t=Jl||Kl,null===n||c||t||bs(e)),null===e.memoizedProps||"manual"!==e.memoizedProps.mode))e:for(n=null,t=e;;){if(5===t.tag||26===t.tag||27===t.tag){if(null===n){c=n=t;try{if(i=c.stateNode,u)"function"==typeof(a=i.style).setProperty?a.setProperty("display","none","important"):a.display="none";else{l=c.stateNode;var p=null!=(s=c.memoizedProps.style)&&s.hasOwnProperty("display")?s.display:null;l.style.display=null==p||"boolean"==typeof p?"":(""+p).trim()}}catch(e){nc(c,c.return,e)}}}else if(6===t.tag){if(null===n){c=t;try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(e){nc(c,c.return,e)}}}else if((22!==t.tag&&23!==t.tag||null===t.memoizedState||t===e)&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;null===t.sibling;){if(null===t.return||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}4&r&&null!==(r=e.updateQueue)&&null!==(n=r.retryQueue)&&(r.retryQueue=null,cs(e,n));break;case 19:ds(t,e),ps(e),4&r&&null!==(r=e.updateQueue)&&(e.updateQueue=null,cs(e,r));break;case 21:break;default:ds(t,e),ps(e)}}function ps(e){var t=e.flags;if(2&t){try{if(27!==e.tag){e:{for(var n=e.return;null!==n;){if(Gl(n)){var r=n;break e}n=n.return}throw Error(o(160))}switch(r.tag){case 27:var i=r.stateNode;Ql(e,$l(e),i);break;case 5:var a=r.stateNode;32&r.flags&&(_t(a,""),r.flags&=-33),Ql(e,$l(e),a);break;case 3:case 4:var l=r.stateNode.containerInfo;ql(e,$l(e),l);break;default:throw Error(o(161))}}}catch(t){nc(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function gs(e){if(1024&e.subtreeFlags)for(e=e.child;null!==e;){var t=e;gs(t),5===t.tag&&1024&t.flags&&t.stateNode.reset(),e=e.sibling}}function ms(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)rs(e,t.alternate,t),t=t.sibling}function bs(e){for(e=e.child;null!==e;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Fl(4,t,t.return),bs(t);break;case 1:Xl(t,t.return);var n=t.stateNode;"function"==typeof n.componentWillUnmount&&Hl(t,t.return,n),bs(t);break;case 26:case 27:case 5:Xl(t,t.return),bs(t);break;case 22:Xl(t,t.return),null===t.memoizedState&&bs(t);break;default:bs(t)}e=e.sibling}}function vs(e,t,n){for(n=n&&!!(8772&t.subtreeFlags),t=t.child;null!==t;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:vs(i,a,n),Ul(4,a);break;case 1:if(vs(i,a,n),"function"==typeof(i=(r=a).stateNode).componentDidMount)try{i.componentDidMount()}catch(e){nc(r,r.return,e)}if(null!==(i=(r=a).updateQueue)){var l=r.stateNode;try{var s=i.shared.hiddenCallbacks;if(null!==s)for(i.shared.hiddenCallbacks=null,i=0;i<s.length;i++)Pl(s[i],l)}catch(e){nc(r,r.return,e)}}n&&64&o&&Wl(a),Yl(a,a.return);break;case 26:case 27:case 5:vs(i,a,n),n&&null===r&&4&o&&Vl(a),Yl(a,a.return);break;case 12:default:vs(i,a,n);break;case 13:vs(i,a,n),n&&4&o&&us(i,a);break;case 22:null===a.memoizedState&&vs(i,a,n),Yl(a,a.return)}t=t.sibling}}function ys(e,t){var n=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==n&&(null!=e&&e.refCount++,null!=n&&Fi(n))}function Ts(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&Fi(e))}function _s(e,t,n,r){if(10256&t.subtreeFlags)for(t=t.child;null!==t;)Es(e,t,n,r),t=t.sibling}function Es(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:_s(e,t,n,r),2048&i&&Ul(9,t);break;case 3:_s(e,t,n,r),2048&i&&(e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&Fi(e)));break;case 12:if(2048&i){_s(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,l=a.onPostCommit;"function"==typeof l&&l(o,null===t.alternate?"mount":"update",e.passiveEffectDuration,-0)}catch(e){nc(t,t.return,e)}}else _s(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,null!==t.memoizedState?4&a._visibility?_s(e,t,n,r):Ss(e,t):4&a._visibility?_s(e,t,n,r):(a._visibility|=4,ws(e,t,n,r,!!(10256&t.subtreeFlags))),2048&i&&ys(t.alternate,t);break;case 24:_s(e,t,n,r),2048&i&&Ts(t.alternate,t);break;default:_s(e,t,n,r)}}function ws(e,t,n,r,i){for(i=i&&!!(10256&t.subtreeFlags),t=t.child;null!==t;){var a=e,o=t,l=n,s=r,u=o.flags;switch(o.tag){case 0:case 11:case 15:ws(a,o,l,s,i),Ul(8,o);break;case 23:break;case 22:var c=o.stateNode;null!==o.memoizedState?4&c._visibility?ws(a,o,l,s,i):Ss(a,o):(c._visibility|=4,ws(a,o,l,s,i)),i&&2048&u&&ys(o.alternate,o);break;case 24:ws(a,o,l,s,i),i&&2048&u&&Ts(o.alternate,o);break;default:ws(a,o,l,s,i)}t=t.sibling}}function Ss(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ss(n,r),2048&i&&ys(r.alternate,r);break;case 24:Ss(n,r),2048&i&&Ts(r.alternate,r);break;default:Ss(n,r)}t=t.sibling}}var Ls=8192;function Os(e){if(e.subtreeFlags&Ls)for(e=e.child;null!==e;)Ns(e),e=e.sibling}function Ns(e){switch(e.tag){case 26:Os(e),e.flags&Ls&&null!==e.memoizedState&&function(e,t,n){if(null===Rd)throw Error(o(475));var r=Rd;if(!("stylesheet"!==t.type||"string"==typeof n.media&&!1===matchMedia(n.media).matches||4&t.state.loading)){if(null===t.instance){var i=md(n.href),a=e.querySelector(bd(i));if(a)return null!==(e=a._p)&&"object"==typeof e&&"function"==typeof e.then&&(r.count++,r=kd.bind(r),e.then(r,r)),t.state.loading|=4,t.instance=a,void Qe(a);a=e.ownerDocument||e,n=vd(n),(i=ud.get(i))&&wd(n,i),Qe(a=a.createElement("link"));var l=a;l._p=new Promise((function(e,t){l.onload=e,l.onerror=t})),Vc(a,"link",n),t.instance=a}null===r.stylesheets&&(r.stylesheets=new Map),r.stylesheets.set(t,e),(e=t.state.preload)&&!(3&t.state.loading)&&(r.count++,t=kd.bind(r),e.addEventListener("load",t),e.addEventListener("error",t))}}(hs,e.memoizedState,e.memoizedProps);break;case 5:default:Os(e);break;case 3:case 4:var t=hs;hs=dd(e.stateNode.containerInfo),Os(e),hs=t;break;case 22:null===e.memoizedState&&(null!==(t=e.alternate)&&null!==t.memoizedState?(t=Ls,Ls=16777216,Os(e),Ls=t):Os(e))}}function As(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do{t=e.sibling,e.sibling=null,e=t}while(null!==e)}}function Rs(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];ts=r,Cs(r,e)}As(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)xs(e),e=e.sibling}function xs(e){switch(e.tag){case 0:case 11:case 15:Rs(e),2048&e.flags&&Fl(9,e,e.return);break;case 3:case 12:default:Rs(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&4&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-5,ks(e)):Rs(e)}}function ks(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];ts=r,Cs(r,e)}As(e)}for(e=e.child;null!==e;){switch((t=e).tag){case 0:case 11:case 15:Fl(8,t,t.return),ks(t);break;case 22:4&(n=t.stateNode)._visibility&&(n._visibility&=-5,ks(t));break;default:ks(t)}e=e.sibling}}function Cs(e,t){for(;null!==ts;){var n=ts;switch(n.tag){case 0:case 11:case 15:Fl(8,n,t);break;case 23:case 22:if(null!==n.memoizedState&&null!==n.memoizedState.cachePool){var r=n.memoizedState.cachePool.pool;null!=r&&r.refCount++}break;case 24:Fi(n.memoizedState.cache)}if(null!==(r=n.child))r.return=n,ts=r;else e:for(n=e;null!==ts;){var i=(r=ts).sibling,a=r.return;if(is(r),r===n){ts=null;break e}if(null!==i){i.return=a,ts=i;break e}ts=a}}}function Ds(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ms(e,t,n,r){return new Ds(e,t,n,r)}function Is(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Bs(e,t){var n=e.alternate;return null===n?((n=Ms(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=31457280&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ps(e,t){e.flags&=31457282;var n=e.alternate;return null===n?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function zs(e,t,n,r,i,a){var l=0;if(r=e,"function"==typeof e)Is(e)&&(l=1);else if("string"==typeof e)l=function(e,t,n){if(1===n||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!=typeof t.precedence||"string"!=typeof t.href||""===t.href)break;return!0;case"link":if("string"!=typeof t.rel||"string"!=typeof t.href||""===t.href||t.onLoad||t.onError)break;return"stylesheet"!==t.rel||(e=t.disabled,"string"==typeof t.precedence&&null==e);case"script":if(t.async&&"function"!=typeof t.async&&"symbol"!=typeof t.async&&!t.onLoad&&!t.onError&&t.src&&"string"==typeof t.src)return!0}return!1}(e,n,$.current)?26:"html"===e||"head"===e||"body"===e?27:5;else e:switch(e){case c:return Us(n.children,i,a,t);case d:l=8,i|=24;break;case h:return(e=Ms(12,n,t,2|i)).elementType=h,e.lanes=a,e;case b:return(e=Ms(13,n,t,i)).elementType=b,e.lanes=a,e;case v:return(e=Ms(19,n,t,i)).elementType=v,e.lanes=a,e;case _:return Fs(n,i,a,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case f:case g:l=10;break e;case p:l=9;break e;case m:l=11;break e;case y:l=14;break e;case T:l=16,r=null;break e}l=29,n=Error(o(130,null===e?"null":typeof e,"")),r=null}return(t=Ms(l,n,t,i)).elementType=e,t.type=r,t.lanes=a,t}function Us(e,t,n,r){return(e=Ms(7,e,r,t)).lanes=n,e}function Fs(e,t,n,r){(e=Ms(22,e,r,t)).elementType=_,e.lanes=n;var i={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var e=i._current;if(null===e)throw Error(o(456));if(!(2&i._pendingVisibility)){var t=Ar(e,2);null!==t&&(i._pendingVisibility|=2,ku(t,0,2))}},attach:function(){var e=i._current;if(null===e)throw Error(o(456));if(2&i._pendingVisibility){var t=Ar(e,2);null!==t&&(i._pendingVisibility&=-3,ku(t,0,2))}}};return e.stateNode=i,e}function Ws(e,t,n){return(e=Ms(6,e,null,t)).lanes=n,e}function Hs(e,t,n){return(t=Ms(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ys(e){e.flags|=4}function Xs(e,t){if("stylesheet"!==t.type||4&t.state.loading)e.flags&=-16777217;else if(e.flags|=16777216,!Ad(t)){if(null!==(t=Ni.current)&&((4194176&nu)===nu?null!==Ai:(62914560&nu)!==nu&&!(536870912&nu)||t!==Ai))throw di=li,oi;e.flags|=8192}}function Vs(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?Re():536870912,e.lanes|=t,pu|=t)}function js(e,t){if(!qr)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Gs(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=31457280&i.subtreeFlags,r|=31457280&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function $s(e,t,n){var r=t.pendingProps;switch(jr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return Gs(t),null;case 3:return n=t.stateNode,r=null,null!==e&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),vl(zi),Z(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(ni(t)?Ys(t):null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==Qr&&(Du(Qr),Qr=null))),Gs(t),null;case 26:return n=t.memoizedState,null===e?(Ys(t),null!==n?(Gs(t),Xs(t,n)):(Gs(t),t.flags&=-16777217)):n?n!==e.memoizedState?(Ys(t),Gs(t),Xs(t,n)):(Gs(t),t.flags&=-16777217):(e.memoizedProps!==r&&Ys(t),Gs(t),t.flags&=-16777217),null;case 27:te(t),n=Q.current;var i=t.type;if(null!==e&&null!=t.stateNode)e.memoizedProps!==r&&Ys(t);else{if(!r){if(null===t.stateNode)throw Error(o(166));return Gs(t),null}e=$.current,ni(t)?ei(t):(e=sd(i,r,n),t.stateNode=e,Ys(t))}return Gs(t),null;case 5:if(te(t),n=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==r&&Ys(t);else{if(!r){if(null===t.stateNode)throw Error(o(166));return Gs(t),null}if(e=$.current,ni(t))ei(t);else{switch(i=$c(Q.current),e){case 1:e=i.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:e=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":e=i.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":e=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":(e=i.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e="string"==typeof r.is?i.createElement("select",{is:r.is}):i.createElement("select"),r.multiple?e.multiple=!0:r.size&&(e.size=r.size);break;default:e="string"==typeof r.is?i.createElement(n,{is:r.is}):i.createElement(n)}}e[Pe]=t,e[ze]=r;e:for(i=t.child;null!==i;){if(5===i.tag||6===i.tag)e.appendChild(i.stateNode);else if(4!==i.tag&&27!==i.tag&&null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;null===i.sibling;){if(null===i.return||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=e;e:switch(Vc(e,n,r),n){case"button":case"input":case"select":case"textarea":e=!!r.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Ys(t)}}return Gs(t),t.flags&=-16777217,null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&Ys(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));if(e=Q.current,ni(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(i=Gr))switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Pe]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||Wc(e.nodeValue,n)))||Zr(t)}else(e=$c(e).createTextNode(r))[Pe]=t,t.stateNode=e}return Gs(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(i=ni(t),null!==r&&null!==r.dehydrated){if(null===e){if(!i)throw Error(o(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(o(317));i[Pe]=t}else ri(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Gs(t),i=!1}else null!==Qr&&(Du(Qr),Qr=null),i=!0;if(!i)return 256&t.flags?(Ci(t),t):(Ci(t),null)}if(Ci(t),128&t.flags)return t.lanes=n,t;if(n=null!==r,e=null!==e&&null!==e.memoizedState,n){i=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(i=r.alternate.memoizedState.cachePool.pool);var a=null;null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),Vs(t,t.updateQueue),Gs(t),null;case 4:return Z(),null===e&&kc(t.stateNode.containerInfo),Gs(t),null;case 10:return vl(t.type),Gs(t),null;case 19:if(j(Di),null===(i=t.memoizedState))return Gs(t),null;if(r=!!(128&t.flags),null===(a=i.rendering))if(r)js(i,!1);else{if(0!==uu||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(a=Mi(e))){for(t.flags|=128,js(i,!1),e=a.updateQueue,t.updateQueue=e,Vs(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)Ps(n,e),n=n.sibling;return G(Di,1&Di.current|2),t.child}e=e.sibling}null!==i.tail&&le()>yu&&(t.flags|=128,r=!0,js(i,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=Mi(a))){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Vs(t,e),js(i,!0),null===i.tail&&"hidden"===i.tailMode&&!a.alternate&&!qr)return Gs(t),null}else 2*le()-i.renderingStartTime>yu&&536870912!==n&&(t.flags|=128,r=!0,js(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=i.last)?e.sibling=a:t.child=a,i.last=a)}return null!==i.tail?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=le(),t.sibling=null,e=Di.current,G(Di,r?1&e|2:1&e),t):(Gs(t),null);case 22:case 23:return Ci(t),Oi(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?!!(536870912&n)&&!(128&t.flags)&&(Gs(t),6&t.subtreeFlags&&(t.flags|=8192)):Gs(t),null!==(n=t.updateQueue)&&Vs(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&j(Gi),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),vl(zi),Gs(t),null;case 25:return null}throw Error(o(156,t.tag))}function qs(e,t){switch(jr(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return vl(zi),Z(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return te(t),null;case 13:if(Ci(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));ri()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return j(Di),null;case 4:return Z(),null;case 10:return vl(t.type),null;case 22:case 23:return Ci(t),Oi(),null!==e&&j(Gi),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return vl(zi),null;default:return null}}function Qs(e,t){switch(jr(t),t.tag){case 3:vl(zi),Z();break;case 26:case 27:case 5:te(t);break;case 4:Z();break;case 13:Ci(t);break;case 19:j(Di);break;case 10:vl(t.type);break;case 22:case 23:Ci(t),Oi(),null!==e&&j(Gi);break;case 24:vl(zi)}}var Js={getCacheForType:function(e){var t=Sl(zi),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n}},Ks="function"==typeof WeakMap?WeakMap:Map,Zs=0,eu=null,tu=null,nu=0,ru=0,iu=null,au=!1,ou=!1,lu=!1,su=0,uu=0,cu=0,du=0,hu=0,fu=0,pu=0,gu=null,mu=null,bu=!1,vu=0,yu=1/0,Tu=null,_u=null,Eu=!1,wu=null,Su=0,Lu=0,Ou=null,Nu=0,Au=null;function Ru(){return 2&Zs&&0!==nu?nu&-nu:null!==R.T?0!==Yi?Yi:Tc():Ie()}function xu(){0===fu&&(fu=536870912&nu&&!qr?536870912:Ae());var e=Ni.current;return null!==e&&(e.flags|=32),fu}function ku(e,t,n){(e===eu&&2===ru||null!==e.cancelPendingCommit)&&(Uu(e,0),Bu(e,nu,fu,!1)),ke(e,n),2&Zs&&e===eu||(e===eu&&(!(2&Zs)&&(du|=n),4===uu&&Bu(e,nu,fu,!1)),pc(e))}function Cu(e,t,n){if(6&Zs)throw Error(o(327));for(var r=!n&&!(60&t)&&!(t&e.expiredLanes)||Oe(e,t),i=r?function(e,t){var n=Zs;Zs|=2;var r=Wu(),i=Hu();eu!==e||nu!==t?(Tu=null,yu=le()+500,Uu(e,t)):ou=Oe(e,t);e:for(;;)try{if(0!==ru&&null!==tu){t=tu;var a=iu;t:switch(ru){case 1:ru=0,iu=null,qu(e,t,a,1);break;case 2:if(si(a)){ru=0,iu=null,$u(t);break}t=function(){2===ru&&eu===e&&(ru=7),pc(e)},a.then(t,t);break e;case 3:ru=7;break e;case 4:ru=5;break e;case 7:si(a)?(ru=0,iu=null,$u(t)):(ru=0,iu=null,qu(e,t,a,7));break;case 5:var l=null;switch(tu.tag){case 26:l=tu.memoizedState;case 5:case 27:var s=tu;if(!l||Ad(l)){ru=0,iu=null;var u=s.sibling;if(null!==u)tu=u;else{var c=s.return;null!==c?(tu=c,Qu(c)):tu=null}break t}}ru=0,iu=null,qu(e,t,a,5);break;case 6:ru=0,iu=null,qu(e,t,a,6);break;case 8:zu(),uu=6;break e;default:throw Error(o(462))}}ju();break}catch(t){Fu(e,t)}return ml=gl=null,R.H=r,R.A=i,Zs=n,null!==tu?0:(eu=null,nu=0,Lr(),uu)}(e,t):Xu(e,t,!0),a=r;;){if(0===i){ou&&!r&&Bu(e,t,0,!1);break}if(6===i)Bu(e,t,0,!au);else{if(n=e.current.alternate,a&&!Iu(n)){i=Xu(e,t,!1),a=!1;continue}if(2===i){if(a=t,e.errorRecoveryDisabledLanes&a)var l=0;else l=0!=(l=-536870913&e.pendingLanes)?l:536870912&l?536870912:0;if(0!==l){t=l;e:{var s=e;i=gu;var u=s.current.memoizedState.isDehydrated;if(u&&(Uu(s,l).flags|=256),2!==(l=Xu(s,l,!1))){if(lu&&!u){s.errorRecoveryDisabledLanes|=a,du|=a,i=4;break e}a=mu,mu=i,null!==a&&Du(a)}i=l}if(a=!1,2!==i)continue}}if(1===i){Uu(e,0),Bu(e,t,0,!0);break}e:{switch(r=e,i){case 0:case 1:throw Error(o(345));case 4:if((4194176&t)===t){Bu(r,t,fu,!au);break e}break;case 2:mu=null;break;case 3:case 5:break;default:throw Error(o(329))}if(r.finishedWork=n,r.finishedLanes=t,(62914560&t)===t&&10<(a=vu+300-le())){if(Bu(r,t,fu,!au),0!==Le(r,0))break e;r.timeoutHandle=Zc(Mu.bind(null,r,n,mu,Tu,bu,t,fu,du,pu,au,2,-0,0),a)}else Mu(r,n,mu,Tu,bu,t,fu,du,pu,au,0,-0,0)}}break}pc(e)}function Du(e){null===mu?mu=e:mu.push.apply(mu,e)}function Mu(e,t,n,r,i,a,l,s,u,c,d,h,f){var p=t.subtreeFlags;if((8192&p||!(16785408&~p))&&(Rd={stylesheets:null,count:0,unsuspend:xd},Ns(t),null!==(t=function(){if(null===Rd)throw Error(o(475));var e=Rd;return e.stylesheets&&0===e.count&&Dd(e,e.stylesheets),0<e.count?function(t){var n=setTimeout((function(){if(e.stylesheets&&Dd(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}),6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(n)}}:null}())))return e.cancelPendingCommit=t(Ku.bind(null,e,n,r,i,l,s,u,1,h,f)),void Bu(e,a,l,!c);Ku(e,n,r,i,l,s,u)}function Iu(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&null!==(n=t.updateQueue)&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Gn(a(),i))return!1}catch(e){return!1}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Bu(e,t,n,r){t&=~hu,t&=~du,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-ye(i),o=1<<a;r[a]=-1,i&=~o}0!==n&&Ce(e,n,t)}function Pu(){return!!(6&Zs)||(gc(0,!1),!1)}function zu(){if(null!==tu){if(0===ru)var e=tu.return;else ml=gl=null,ma(e=tu),fi=null,pi=0,e=tu;for(;null!==e;)Qs(e.alternate,e),e=e.return;tu=null}}function Uu(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;-1!==n&&(e.timeoutHandle=-1,ed(n)),null!==(n=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,n()),zu(),eu=e,tu=n=Bs(e.current,null),nu=t,ru=0,iu=null,au=!1,ou=Oe(e,t),lu=!1,pu=fu=hu=du=cu=uu=0,mu=gu=null,bu=!1,8&t&&(t|=32&t);var r=e.entangledLanes;if(0!==r)for(e=e.entanglements,r&=t;0<r;){var i=31-ye(r),a=1<<i;t|=e[i],r&=~a}return su=t,Lr(),n}function Fu(e,t){Ki=null,R.H=So,t===ai?(t=hi(),ru=3):t===oi?(t=hi(),ru=4):ru=t===Ho?8:null!==t&&"object"==typeof t&&"function"==typeof t.then?6:1,iu=t,null===tu&&(uu=1,Po(e,Dr(t,e.current)))}function Wu(){var e=R.H;return R.H=So,null===e?So:e}function Hu(){var e=R.A;return R.A=Js,e}function Yu(){uu=4,au||(4194176&nu)!==nu&&null!==Ni.current||(ou=!0),!(134217727&cu)&&!(134217727&du)||null===eu||Bu(eu,nu,fu,!1)}function Xu(e,t,n){var r=Zs;Zs|=2;var i=Wu(),a=Hu();eu===e&&nu===t||(Tu=null,Uu(e,t)),t=!1;var o=uu;e:for(;;)try{if(0!==ru&&null!==tu){var l=tu,s=iu;switch(ru){case 8:zu(),o=6;break e;case 3:case 2:case 6:null===Ni.current&&(t=!0);var u=ru;if(ru=0,iu=null,qu(e,l,s,u),n&&ou){o=0;break e}break;default:u=ru,ru=0,iu=null,qu(e,l,s,u)}}Vu(),o=uu;break}catch(t){Fu(e,t)}return t&&e.shellSuspendCounter++,ml=gl=null,Zs=r,R.H=i,R.A=a,null===tu&&(eu=null,nu=0,Lr()),o}function Vu(){for(;null!==tu;)Gu(tu)}function ju(){for(;null!==tu&&!ae();)Gu(tu)}function Gu(e){var t=fl(e.alternate,e,su);e.memoizedProps=e.pendingProps,null===t?Qu(e):tu=t}function $u(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Ko(n,t,t.pendingProps,t.type,void 0,nu);break;case 11:t=Ko(n,t,t.pendingProps,t.type.render,t.ref,nu);break;case 5:ma(t);default:Qs(n,t),t=fl(n,t=tu=Ps(t,su),su)}e.memoizedProps=e.pendingProps,null===t?Qu(e):tu=t}function qu(e,t,n,r){ml=gl=null,ma(t),fi=null,pi=0;var i=t.return;try{if(function(e,t,n,r,i){if(n.flags|=32768,null!==r&&"object"==typeof r&&"function"==typeof r.then){if(null!==(t=n.alternate)&&_l(t,n,i,!0),null!==(n=Ni.current)){switch(n.tag){case 13:return null===Ai?Yu():null===n.alternate&&0===uu&&(uu=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===li?n.flags|=16384:(null===(t=n.updateQueue)?n.updateQueue=new Set([r]):t.add(r),rc(e,r,i)),!1;case 22:return n.flags|=65536,r===li?n.flags|=16384:(null===(t=n.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):null===(n=t.retryQueue)?t.retryQueue=new Set([r]):n.add(r),rc(e,r,i)),!1}throw Error(o(435,n.tag))}return rc(e,r,i),Yu(),!1}if(qr)return null!==(t=Ni.current)?(!(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Kr&&ii(Dr(e=Error(o(422),{cause:r}),n))):(r!==Kr&&ii(Dr(t=Error(o(423),{cause:r}),n)),(e=e.current.alternate).flags|=65536,i&=-i,e.lanes|=i,r=Dr(r,n),Dl(e,i=Uo(e.stateNode,r,i)),4!==uu&&(uu=2)),!1;var a=Error(o(520),{cause:r});if(a=Dr(a,n),null===gu?gu=[a]:gu.push(a),4!==uu&&(uu=2),null===t)return!0;r=Dr(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,Dl(n,e=Uo(n.stateNode,r,e)),!1;case 1:if(t=n.type,a=n.stateNode,!(128&n.flags||"function"!=typeof t.getDerivedStateFromError&&(null===a||"function"!=typeof a.componentDidCatch||null!==_u&&_u.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,Wo(i=Fo(i),e,n,r),Dl(n,i),!1}n=n.return}while(null!==n);return!1}(e,i,t,n,nu))return uu=1,Po(e,Dr(n,e.current)),void(tu=null)}catch(t){if(null!==i)throw tu=i,t;return uu=1,Po(e,Dr(n,e.current)),void(tu=null)}32768&t.flags?(qr||1===r?e=!0:ou||536870912&nu?e=!1:(au=e=!0,(2===r||3===r||6===r)&&null!==(r=Ni.current)&&13===r.tag&&(r.flags|=16384)),Ju(t,e)):Qu(t)}function Qu(e){var t=e;do{if(32768&t.flags)return void Ju(t,au);e=t.return;var n=$s(t.alternate,t,su);if(null!==n)return void(tu=n);if(null!==(t=t.sibling))return void(tu=t);tu=t=e}while(null!==t);0===uu&&(uu=5)}function Ju(e,t){do{var n=qs(e.alternate,e);if(null!==n)return n.flags&=32767,void(tu=n);if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling))return void(tu=e);tu=e=n}while(null!==e);uu=6,tu=null}function Ku(e,t,n,r,i,a,l,s,u,c){var d=R.T,h=W.p;try{W.p=2,R.T=null,function(e,t,n,r,i,a,l,s){do{ec()}while(null!==wu);if(6&Zs)throw Error(o(327));var u=e.finishedWork;if(r=e.finishedLanes,null===u)return null;if(e.finishedWork=null,e.finishedLanes=0,u===e.current)throw Error(o(177));e.callbackNode=null,e.callbackPriority=0,e.cancelPendingCommit=null;var c=u.lanes|u.childLanes;if(function(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,s=e.expirationTimes,u=e.hiddenUpdates;for(n=o&~n;0<n;){var c=31-ye(n),d=1<<c;l[c]=0,s[c]=-1;var h=u[c];if(null!==h)for(u[c]=null,c=0;c<h.length;c++){var f=h[c];null!==f&&(f.lane&=-536870913)}n&=~d}0!==r&&Ce(e,r,0),0!==a&&0===i&&0!==e.tag&&(e.suspendedLanes|=a&~(o&~t))}(e,r,c|=Sr,a,l,s),e===eu&&(tu=eu=null,nu=0),!(10256&u.subtreeFlags)&&!(10256&u.flags)||Eu||(Eu=!0,Lu=c,Ou=n,re(de,(function(){return ec(),null}))),n=!!(15990&u.flags),15990&u.subtreeFlags||n?(n=R.T,R.T=null,a=W.p,W.p=2,l=Zs,Zs|=4,function(e,t){if(e=e.containerInfo,jc=Wd,Zn(e=Kn(e))){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch(e){n=null;break e}var l=0,s=-1,u=-1,c=0,d=0,h=e,f=null;t:for(;;){for(var p;h!==n||0!==i&&3!==h.nodeType||(s=l+i),h!==a||0!==r&&3!==h.nodeType||(u=l+r),3===h.nodeType&&(l+=h.nodeValue.length),null!==(p=h.firstChild);)f=h,h=p;for(;;){if(h===e)break t;if(f===n&&++c===i&&(s=l),f===a&&++d===r&&(u=l),null!==(p=h.nextSibling))break;f=(h=f).parentNode}h=p}n=-1===s||-1===u?null:{start:s,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Gc={focusedElem:e,selectionRange:n},Wd=!1,ts=t;null!==ts;)if(e=(t=ts).child,1028&t.subtreeFlags&&null!==e)e.return=t,ts=e;else for(;null!==ts;){switch(a=(t=ts).alternate,e=t.flags,t.tag){case 0:case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(1024&e&&null!==a){e=void 0,n=t,i=a.memoizedProps,a=a.memoizedState,r=n.stateNode;try{var g=Co(n.type,i,(n.elementType,n.type));e=r.getSnapshotBeforeUpdate(g,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){nc(n,n.return,e)}}break;case 3:if(1024&e)if(9===(n=(e=t.stateNode.containerInfo).nodeType))ad(e);else if(1===n)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ad(e);break;default:e.textContent=""}break;default:if(1024&e)throw Error(o(163))}if(null!==(e=t.sibling)){e.return=t.return,ts=e;break}ts=t.return}g=ns,ns=!1}(e,u),fs(u,e),er(Gc,e.containerInfo),Wd=!!jc,Gc=jc=null,e.current=u,rs(e,u.alternate,u),oe(),Zs=l,W.p=a,R.T=n):e.current=u,Eu?(Eu=!1,wu=e,Su=r):Zu(e,c),0===(c=e.pendingLanes)&&(_u=null),function(e){if(be&&"function"==typeof be.onCommitFiberRoot)try{be.onCommitFiberRoot(me,e,void 0,!(128&~e.current.flags))}catch(e){}}(u.stateNode),pc(e),null!==t)for(i=e.onRecoverableError,u=0;u<t.length;u++)i((c=t[u]).value,{componentStack:c.stack});!!(3&Su)&&ec(),c=e.pendingLanes,4194218&r&&42&c?e===Au?Nu++:(Nu=0,Au=e):Nu=0,gc(0,!1)}(e,t,n,r,h,i,a,l)}finally{R.T=d,W.p=h}}function Zu(e,t){0==(e.pooledCacheLanes&=t)&&null!=(t=e.pooledCache)&&(e.pooledCache=null,Fi(t))}function ec(){if(null!==wu){var e=wu,t=Lu;Lu=0;var n=Me(Su),r=R.T,i=W.p;try{if(W.p=32>n?32:n,R.T=null,null===wu)var a=!1;else{n=Ou,Ou=null;var l=wu,s=Su;if(wu=null,Su=0,6&Zs)throw Error(o(331));var u=Zs;if(Zs|=4,xs(l.current),Es(l,l.current,s,n),Zs=u,gc(0,!1),be&&"function"==typeof be.onPostCommitFiberRoot)try{be.onPostCommitFiberRoot(me,l)}catch(e){}a=!0}return a}finally{W.p=i,R.T=r,Zu(e,t)}}return!1}function tc(e,t,n){t=Dr(n,t),null!==(e=kl(e,t=Uo(e.stateNode,t,2),2))&&(ke(e,2),pc(e))}function nc(e,t,n){if(3===e.tag)tc(e,e,n);else for(;null!==t;){if(3===t.tag){tc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===_u||!_u.has(r))){e=Dr(n,e),null!==(r=kl(t,n=Fo(2),2))&&(Wo(n,r,t,e),ke(r,2),pc(r));break}}t=t.return}}function rc(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new Ks;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(lu=!0,i.add(n),e=ic.bind(null,e,t,n),t.then(e,e))}function ic(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,eu===e&&(nu&n)===n&&(4===uu||3===uu&&(62914560&nu)===nu&&300>le()-vu?!(2&Zs)&&Uu(e,0):hu|=n,pu===nu&&(pu=0)),pc(e)}function ac(e,t){0===t&&(t=Re()),null!==(e=Ar(e,t))&&(ke(e,t),pc(e))}function oc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),ac(e,n)}function lc(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}null!==r&&r.delete(t),ac(e,n)}var sc=null,uc=null,cc=!1,dc=!1,hc=!1,fc=0;function pc(e){var t;e!==uc&&null===e.next&&(null===uc?sc=uc=e:uc=uc.next=e),dc=!0,cc||(cc=!0,t=mc,nd((function(){6&Zs?re(ue,t):t()})))}function gc(e,t){if(!hc&&dc){hc=!0;do{for(var n=!1,r=sc;null!==r;){if(!t)if(0!==e){var i=r.pendingLanes;if(0===i)var a=0;else{var o=r.suspendedLanes,l=r.pingedLanes;a=(1<<31-ye(42|e)+1)-1,a=201326677&(a&=i&~(o&~l))?201326677&a|1:a?2|a:0}0!==a&&(n=!0,yc(r,a))}else a=nu,!(3&(a=Le(r,r===eu?a:0)))||Oe(r,a)||(n=!0,yc(r,a));r=r.next}}while(n);hc=!1}}function mc(){dc=cc=!1;var e,t=0;0!==fc&&(((e=window.event)&&"popstate"===e.type?e!==Kc&&(Kc=e,!0):(Kc=null,!1))&&(t=fc),fc=0);for(var n=le(),r=null,i=sc;null!==i;){var a=i.next,o=bc(i,n);0===o?(i.next=null,null===r?sc=a:r.next=a,null===a&&(uc=r)):(r=i,(0!==t||3&o)&&(dc=!0)),i=a}gc(t,!1)}function bc(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=-62914561&e.pendingLanes;0<a;){var o=31-ye(a),l=1<<o,s=i[o];-1===s?l&n&&!(l&r)||(i[o]=Ne(l,t)):s<=t&&(e.expiredLanes|=l),a&=~l}if(n=nu,n=Le(e,e===(t=eu)?n:0),r=e.callbackNode,0===n||e===t&&2===ru||null!==e.cancelPendingCommit)return null!==r&&null!==r&&ie(r),e.callbackNode=null,e.callbackPriority=0;if(!(3&n)||Oe(e,n)){if((t=n&-n)===e.callbackPriority)return t;switch(null!==r&&ie(r),Me(n)){case 2:case 8:n=ce;break;case 32:default:n=de;break;case 268435456:n=fe}return r=vc.bind(null,e),n=re(n,r),e.callbackPriority=t,e.callbackNode=n,t}return null!==r&&null!==r&&ie(r),e.callbackPriority=2,e.callbackNode=null,2}function vc(e,t){var n=e.callbackNode;if(ec()&&e.callbackNode!==n)return null;var r=nu;return 0===(r=Le(e,e===eu?r:0))?null:(Cu(e,r,t),bc(e,le()),null!=e.callbackNode&&e.callbackNode===n?vc.bind(null,e):null)}function yc(e,t){if(ec())return null;Cu(e,t,!0)}function Tc(){return 0===fc&&(fc=Ae()),fc}function _c(e){return null==e||"symbol"==typeof e||"boolean"==typeof e?null:"function"==typeof e?e:At(""+e)}function Ec(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}for(var wc=0;wc<Tr.length;wc++){var Sc=Tr[wc];_r(Sc.toLowerCase(),"on"+(Sc[0].toUpperCase()+Sc.slice(1)))}_r(hr,"onAnimationEnd"),_r(fr,"onAnimationIteration"),_r(pr,"onAnimationStart"),_r("dblclick","onDoubleClick"),_r("focusin","onFocus"),_r("focusout","onBlur"),_r(gr,"onTransitionRun"),_r(mr,"onTransitionStart"),_r(br,"onTransitionCancel"),_r(vr,"onTransitionEnd"),et("onMouseEnter",["mouseout","mouseover"]),et("onMouseLeave",["mouseout","mouseover"]),et("onPointerEnter",["pointerout","pointerover"]),et("onPointerLeave",["pointerout","pointerover"]),Ze("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ze("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ze("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ze("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ze("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ze("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Oc=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Lc));function Nc(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],s=l.instance,u=l.currentTarget;if(l=l.listener,s!==a&&i.isPropagationStopped())break e;a=l,i.currentTarget=u;try{a(i)}catch(e){Do(e)}i.currentTarget=null,a=s}else for(o=0;o<r.length;o++){if(s=(l=r[o]).instance,u=l.currentTarget,l=l.listener,s!==a&&i.isPropagationStopped())break e;a=l,i.currentTarget=u;try{a(i)}catch(e){Do(e)}i.currentTarget=null,a=s}}}}function Ac(e,t){var n=t[Fe];void 0===n&&(n=t[Fe]=new Set);var r=e+"__bubble";n.has(r)||(Cc(t,e,2,!1),n.add(r))}function Rc(e,t,n){var r=0;t&&(r|=4),Cc(n,e,r,t)}var xc="_reactListening"+Math.random().toString(36).slice(2);function kc(e){if(!e[xc]){e[xc]=!0,Je.forEach((function(t){"selectionchange"!==t&&(Oc.has(t)||Rc(t,!1,e),Rc(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[xc]||(t[xc]=!0,Rc("selectionchange",!1,t))}}function Cc(e,t,n,r){switch($d(t)){case 2:var i=Hd;break;case 8:i=Yd;break;default:i=Xd}n=i.bind(null,t,n,e),i=void 0,!Pt||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Dc(e,t,n,r,i){var a=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var o=r.tag;if(3===o||4===o){var l=r.stateNode.containerInfo;if(l===i||8===l.nodeType&&l.parentNode===i)break;if(4===o)for(o=r.return;null!==o;){var s=o.tag;if((3===s||4===s)&&((s=o.stateNode.containerInfo)===i||8===s.nodeType&&s.parentNode===i))return;o=o.return}for(;null!==l;){if(null===(o=je(l)))return;if(5===(s=o.tag)||6===s||26===s||27===s){r=a=o;continue e}l=l.parentNode}}r=r.return}It((function(){var r=a,i=xt(n),o=[];e:{var l=yr.get(e);if(void 0!==l){var s=Jt,u=e;switch(e){case"keypress":if(0===Yt(n))break e;case"keydown":case"keyup":s=fn;break;case"focusin":u="focus",s=rn;break;case"focusout":u="blur",s=rn;break;case"beforeblur":case"afterblur":s=rn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":s=tn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":s=nn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":s=gn;break;case hr:case fr:case pr:s=an;break;case vr:s=mn;break;case"scroll":case"scrollend":s=Zt;break;case"wheel":s=bn;break;case"copy":case"cut":case"paste":s=on;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":s=pn;break;case"toggle":case"beforetoggle":s=vn}var c=!!(4&t),d=!c&&("scroll"===e||"scrollend"===e),h=c?null!==l?l+"Capture":null:l;c=[];for(var f,p=r;null!==p;){var g=p;if(f=g.stateNode,5!==(g=g.tag)&&26!==g&&27!==g||null===f||null===h||null!=(g=Bt(p,h))&&c.push(Mc(p,g,f)),d)break;p=p.return}0<c.length&&(l=new s(l,u,null,n,i),o.push({event:l,listeners:c}))}}if(!(7&t)){if(s="mouseout"===e||"pointerout"===e,(!(l="mouseover"===e||"pointerover"===e)||n===Rt||!(u=n.relatedTarget||n.fromElement)||!je(u)&&!u[Ue])&&(s||l)&&(l=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,s?(s=r,null!==(u=(u=n.relatedTarget||n.toElement)?je(u):null)&&(d=B(u),c=u.tag,u!==d||5!==c&&27!==c&&6!==c)&&(u=null)):(s=null,u=r),s!==u)){if(c=tn,g="onMouseLeave",h="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(c=pn,g="onPointerLeave",h="onPointerEnter",p="pointer"),d=null==s?l:$e(s),f=null==u?l:$e(u),(l=new c(g,p+"leave",s,n,i)).target=d,l.relatedTarget=f,g=null,je(i)===r&&((c=new c(h,p+"enter",u,n,i)).target=f,c.relatedTarget=d,g=c),d=g,s&&u)e:{for(h=u,p=0,f=c=s;f;f=Bc(f))p++;for(f=0,g=h;g;g=Bc(g))f++;for(;0<p-f;)c=Bc(c),p--;for(;0<f-p;)h=Bc(h),f--;for(;p--;){if(c===h||null!==h&&c===h.alternate)break e;c=Bc(c),h=Bc(h)}c=null}else c=null;null!==s&&Pc(o,l,s,c,!1),null!==u&&null!==d&&Pc(o,d,u,c,!0)}if("select"===(s=(l=r?$e(r):window).nodeName&&l.nodeName.toLowerCase())||"input"===s&&"file"===l.type)var m=Bn;else if(xn(l))if(Pn)m=jn;else{m=Xn;var b=Yn}else!(s=l.nodeName)||"input"!==s.toLowerCase()||"checkbox"!==l.type&&"radio"!==l.type?r&&Lt(r.elementType)&&(m=Bn):m=Vn;switch(m&&(m=m(e,r))?kn(o,m,n,i):(b&&b(e,l,r),"focusout"===e&&r&&"number"===l.type&&null!=r.memoizedProps.value&&bt(l,"number",l.value)),b=r?$e(r):window,e){case"focusin":(xn(b)||"true"===b.contentEditable)&&(nr=b,rr=r,ir=null);break;case"focusout":ir=rr=nr=null;break;case"mousedown":ar=!0;break;case"contextmenu":case"mouseup":case"dragend":ar=!1,or(o,n,i);break;case"selectionchange":if(tr)break;case"keydown":case"keyup":or(o,n,i)}var v;if(Tn)e:{switch(e){case"compositionstart":var y="onCompositionStart";break e;case"compositionend":y="onCompositionEnd";break e;case"compositionupdate":y="onCompositionUpdate";break e}y=void 0}else An?On(e,n)&&(y="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(y="onCompositionStart");y&&(wn&&"ko"!==n.locale&&(An||"onCompositionStart"!==y?"onCompositionEnd"===y&&An&&(v=Ht()):(Ft="value"in(Ut=i)?Ut.value:Ut.textContent,An=!0)),0<(b=Ic(r,y)).length&&(y=new ln(y,e,null,n,i),o.push({event:y,listeners:b}),(v||null!==(v=Nn(n)))&&(y.data=v))),(v=En?function(e,t){switch(e){case"compositionend":return Nn(t);case"keypress":return 32!==t.which?null:(Ln=!0,Sn);case"textInput":return(e=t.data)===Sn&&Ln?null:e;default:return null}}(e,n):function(e,t){if(An)return"compositionend"===e||!Tn&&On(e,t)?(e=Ht(),Wt=Ft=Ut=null,An=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return wn&&"ko"!==t.locale?null:t.data}}(e,n))&&0<(y=Ic(r,"onBeforeInput")).length&&(b=new ln("onBeforeInput","beforeinput",null,n,i),o.push({event:b,listeners:y}),b.data=v),function(e,t,n,r,i){if("submit"===t&&n&&n.stateNode===i){var a=_c((i[ze]||null).action),o=r.submitter;o&&null!==(t=(t=o[ze]||null)?_c(t.formAction):o.getAttribute("formAction"))&&(a=t,o=null);var l=new Jt("action","action",null,r,i);e.push({event:l,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(0!==fc){var e=o?Ec(i,o):new FormData(i);uo(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else"function"==typeof a&&(l.preventDefault(),e=o?Ec(i,o):new FormData(i),uo(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}(o,e,r,n,i)}Nc(o,t)}))}function Mc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ic(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,a=i.stateNode;5!==(i=i.tag)&&26!==i&&27!==i||null===a||(null!=(i=Bt(e,n))&&r.unshift(Mc(e,i,a)),null!=(i=Bt(e,t))&&r.push(Mc(e,i,a))),e=e.return}return r}function Bc(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag&&27!==e.tag);return e||null}function Pc(e,t,n,r,i){for(var a=t._reactName,o=[];null!==n&&n!==r;){var l=n,s=l.alternate,u=l.stateNode;if(l=l.tag,null!==s&&s===r)break;5!==l&&26!==l&&27!==l||null===u||(s=u,i?null!=(u=Bt(n,a))&&o.unshift(Mc(n,u,s)):i||null!=(u=Bt(n,a))&&o.push(Mc(n,u,s))),n=n.return}0!==o.length&&e.push({event:t,listeners:o})}var zc=/\r\n?/g,Uc=/\u0000|\uFFFD/g;function Fc(e){return("string"==typeof e?e:""+e).replace(zc,"\n").replace(Uc,"")}function Wc(e,t){return t=Fc(t),Fc(e)===t}function Hc(){}function Yc(e,t,n,r,i,a){switch(n){case"children":"string"==typeof r?"body"===t||"textarea"===t&&""===r||_t(e,r):("number"==typeof r||"bigint"==typeof r)&&"body"!==t&&_t(e,""+r);break;case"className":ot(e,"class",r);break;case"tabIndex":ot(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":ot(e,n,r);break;case"style":St(e,r,a);break;case"data":if("object"!==t){ot(e,"data",r);break}case"src":case"href":if(""===r&&("a"!==t||"href"!==n)){e.removeAttribute(n);break}if(null==r||"function"==typeof r||"symbol"==typeof r||"boolean"==typeof r){e.removeAttribute(n);break}r=At(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if("function"==typeof r){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}if("function"==typeof a&&("formAction"===n?("input"!==t&&Yc(e,t,"name",i.name,i,null),Yc(e,t,"formEncType",i.formEncType,i,null),Yc(e,t,"formMethod",i.formMethod,i,null),Yc(e,t,"formTarget",i.formTarget,i,null)):(Yc(e,t,"encType",i.encType,i,null),Yc(e,t,"method",i.method,i,null),Yc(e,t,"target",i.target,i,null))),null==r||"symbol"==typeof r||"boolean"==typeof r){e.removeAttribute(n);break}r=At(""+r),e.setAttribute(n,r);break;case"onClick":null!=r&&(e.onclick=Hc);break;case"onScroll":null!=r&&Ac("scroll",e);break;case"onScrollEnd":null!=r&&Ac("scrollend",e);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!=typeof r||!("__html"in r))throw Error(o(61));if(null!=(n=r.__html)){if(null!=i.children)throw Error(o(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&"function"!=typeof r&&"symbol"!=typeof r;break;case"muted":e.muted=r&&"function"!=typeof r&&"symbol"!=typeof r;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":break;case"xlinkHref":if(null==r||"function"==typeof r||"boolean"==typeof r||"symbol"==typeof r){e.removeAttribute("xlink:href");break}n=At(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":null!=r&&"function"!=typeof r&&"symbol"!=typeof r?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&"function"!=typeof r&&"symbol"!=typeof r?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":!0===r?e.setAttribute(n,""):!1!==r&&null!=r&&"function"!=typeof r&&"symbol"!=typeof r?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":null!=r&&"function"!=typeof r&&"symbol"!=typeof r&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":null==r||"function"==typeof r||"symbol"==typeof r||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":Ac("beforetoggle",e),Ac("toggle",e),at(e,"popover",r);break;case"xlinkActuate":lt(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":lt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":lt(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":lt(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":lt(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":lt(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":lt(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":lt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":lt(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":at(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||"o"!==n[0]&&"O"!==n[0]||"n"!==n[1]&&"N"!==n[1])&&at(e,n=Ot.get(n)||n,r)}}function Xc(e,t,n,r,i,a){switch(n){case"style":St(e,r,a);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!=typeof r||!("__html"in r))throw Error(o(61));if(null!=(n=r.__html)){if(null!=i.children)throw Error(o(60));e.innerHTML=n}}break;case"children":"string"==typeof r?_t(e,r):("number"==typeof r||"bigint"==typeof r)&&_t(e,""+r);break;case"onScroll":null!=r&&Ac("scroll",e);break;case"onScrollEnd":null!=r&&Ac("scrollend",e);break;case"onClick":null!=r&&(e.onclick=Hc);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":break;default:Ke.hasOwnProperty(n)||("o"!==n[0]||"n"!==n[1]||(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),"function"==typeof(a=null!=(a=e[ze]||null)?a[n]:null)&&e.removeEventListener(t,a,i),"function"!=typeof r)?n in e?e[n]=r:!0===r?e.setAttribute(n,""):at(e,n,r):("function"!=typeof a&&null!==a&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i)))}}function Vc(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ac("error",e),Ac("load",e);var r,i=!1,a=!1;for(r in n)if(n.hasOwnProperty(r)){var l=n[r];if(null!=l)switch(r){case"src":i=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Yc(e,t,r,l,n,null)}}return a&&Yc(e,t,"srcSet",n.srcSet,n,null),void(i&&Yc(e,t,"src",n.src,n,null));case"input":Ac("invalid",e);var s=r=l=a=null,u=null,c=null;for(i in n)if(n.hasOwnProperty(i)){var d=n[i];if(null!=d)switch(i){case"name":a=d;break;case"type":l=d;break;case"checked":u=d;break;case"defaultChecked":c=d;break;case"value":r=d;break;case"defaultValue":s=d;break;case"children":case"dangerouslySetInnerHTML":if(null!=d)throw Error(o(137,t));break;default:Yc(e,t,i,d,n,null)}}return mt(e,r,s,u,c,l,a,!1),void ct(e);case"select":for(a in Ac("invalid",e),i=l=r=null,n)if(n.hasOwnProperty(a)&&null!=(s=n[a]))switch(a){case"value":r=s;break;case"defaultValue":l=s;break;case"multiple":i=s;default:Yc(e,t,a,s,n,null)}return t=r,n=l,e.multiple=!!i,void(null!=t?vt(e,!!i,t,!1):null!=n&&vt(e,!!i,n,!0));case"textarea":for(l in Ac("invalid",e),r=a=i=null,n)if(n.hasOwnProperty(l)&&null!=(s=n[l]))switch(l){case"value":i=s;break;case"defaultValue":a=s;break;case"children":r=s;break;case"dangerouslySetInnerHTML":if(null!=s)throw Error(o(91));break;default:Yc(e,t,l,s,n,null)}return Tt(e,i,a,r),void ct(e);case"option":for(u in n)n.hasOwnProperty(u)&&null!=(i=n[u])&&("selected"===u?e.selected=i&&"function"!=typeof i&&"symbol"!=typeof i:Yc(e,t,u,i,n,null));return;case"dialog":Ac("cancel",e),Ac("close",e);break;case"iframe":case"object":Ac("load",e);break;case"video":case"audio":for(i=0;i<Lc.length;i++)Ac(Lc[i],e);break;case"image":Ac("error",e),Ac("load",e);break;case"details":Ac("toggle",e);break;case"embed":case"source":case"link":Ac("error",e),Ac("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&null!=(i=n[c]))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Yc(e,t,c,i,n,null)}return;default:if(Lt(t)){for(d in n)n.hasOwnProperty(d)&&void 0!==(i=n[d])&&Xc(e,t,d,i,n,void 0);return}}for(s in n)n.hasOwnProperty(s)&&null!=(i=n[s])&&Yc(e,t,s,i,n,null)}var jc=null,Gc=null;function $c(e){return 9===e.nodeType?e:e.ownerDocument}function qc(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Qc(e,t){if(0===e)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===t?0:e}function Jc(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"bigint"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Kc=null,Zc="function"==typeof setTimeout?setTimeout:void 0,ed="function"==typeof clearTimeout?clearTimeout:void 0,td="function"==typeof Promise?Promise:void 0,nd="function"==typeof queueMicrotask?queueMicrotask:void 0!==td?function(e){return td.resolve(null).then(e).catch(rd)}:Zc;function rd(e){setTimeout((function(){throw e}))}function id(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&8===i.nodeType)if("/$"===(n=i.data)){if(0===r)return e.removeChild(i),void hh(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=i}while(n);hh(t)}function ad(e){var t=e.firstChild;for(t&&10===t.nodeType&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":ad(n),Ve(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===n.rel.toLowerCase())continue}e.removeChild(n)}}function od(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t||"F!"===t||"F"===t)break;if("/$"===t)return null}}return e}function ld(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}function sd(e,t,n){switch(t=$c(n),e){case"html":if(!(e=t.documentElement))throw Error(o(452));return e;case"head":if(!(e=t.head))throw Error(o(453));return e;case"body":if(!(e=t.body))throw Error(o(454));return e;default:throw Error(o(451))}}var ud=new Map,cd=new Set;function dd(e){return"function"==typeof e.getRootNode?e.getRootNode():e.ownerDocument}var hd=W.d;W.d={f:function(){var e=hd.f(),t=Pu();return e||t},r:function(e){var t=Ge(e);null!==t&&5===t.tag&&"form"===t.type?ho(t):hd.r(e)},D:function(e){hd.D(e),pd("dns-prefetch",e,null)},C:function(e,t){hd.C(e,t),pd("preconnect",e,t)},L:function(e,t,n){hd.L(e,t,n);var r=fd;if(r&&e&&t){var i='link[rel="preload"][as="'+pt(t)+'"]';"image"===t&&n&&n.imageSrcSet?(i+='[imagesrcset="'+pt(n.imageSrcSet)+'"]',"string"==typeof n.imageSizes&&(i+='[imagesizes="'+pt(n.imageSizes)+'"]')):i+='[href="'+pt(e)+'"]';var a=i;switch(t){case"style":a=md(e);break;case"script":a=yd(e)}ud.has(a)||(e=x({rel:"preload",href:"image"===t&&n&&n.imageSrcSet?void 0:e,as:t},n),ud.set(a,e),null!==r.querySelector(i)||"style"===t&&r.querySelector(bd(a))||"script"===t&&r.querySelector(Td(a))||(Vc(t=r.createElement("link"),"link",e),Qe(t),r.head.appendChild(t)))}},m:function(e,t){hd.m(e,t);var n=fd;if(n&&e){var r=t&&"string"==typeof t.as?t.as:"script",i='link[rel="modulepreload"][as="'+pt(r)+'"][href="'+pt(e)+'"]',a=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=yd(e)}if(!ud.has(a)&&(e=x({rel:"modulepreload",href:e},t),ud.set(a,e),null===n.querySelector(i))){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Td(a)))return}Vc(r=n.createElement("link"),"link",e),Qe(r),n.head.appendChild(r)}}},X:function(e,t){hd.X(e,t);var n=fd;if(n&&e){var r=qe(n).hoistableScripts,i=yd(e),a=r.get(i);a||((a=n.querySelector(Td(i)))||(e=x({src:e,async:!0},t),(t=ud.get(i))&&Sd(e,t),Qe(a=n.createElement("script")),Vc(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(i,a))}},S:function(e,t,n){hd.S(e,t,n);var r=fd;if(r&&e){var i=qe(r).hoistableStyles,a=md(e);t=t||"default";var o=i.get(a);if(!o){var l={loading:0,preload:null};if(o=r.querySelector(bd(a)))l.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ud.get(a))&&wd(e,n);var s=o=r.createElement("link");Qe(s),Vc(s,"link",e),s._p=new Promise((function(e,t){s.onload=e,s.onerror=t})),s.addEventListener("load",(function(){l.loading|=1})),s.addEventListener("error",(function(){l.loading|=2})),l.loading|=4,Ed(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:l},i.set(a,o)}}},M:function(e,t){hd.M(e,t);var n=fd;if(n&&e){var r=qe(n).hoistableScripts,i=yd(e),a=r.get(i);a||((a=n.querySelector(Td(i)))||(e=x({src:e,async:!0,type:"module"},t),(t=ud.get(i))&&Sd(e,t),Qe(a=n.createElement("script")),Vc(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(i,a))}}};var fd="undefined"==typeof document?null:document;function pd(e,t,n){var r=fd;if(r&&"string"==typeof t&&t){var i=pt(t);i='link[rel="'+e+'"][href="'+i+'"]',"string"==typeof n&&(i+='[crossorigin="'+n+'"]'),cd.has(i)||(cd.add(i),e={rel:e,crossOrigin:n,href:t},null===r.querySelector(i)&&(Vc(t=r.createElement("link"),"link",e),Qe(t),r.head.appendChild(t)))}}function gd(e,t,n,r){var i,a,l,s,u=(u=Q.current)?dd(u):null;if(!u)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return"string"==typeof n.precedence&&"string"==typeof n.href?(t=md(n.href),(r=(n=qe(u).hoistableStyles).get(t))||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===n.rel&&"string"==typeof n.href&&"string"==typeof n.precedence){e=md(n.href);var c=qe(u).hoistableStyles,d=c.get(e);if(d||(u=u.ownerDocument||u,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,d),(c=u.querySelector(bd(e)))&&!c._p&&(d.instance=c,d.state.loading=5),ud.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ud.set(e,n),c||(i=u,a=e,l=n,s=d.state,i.querySelector('link[rel="preload"][as="style"]['+a+"]")?s.loading=1:(a=i.createElement("link"),s.preload=a,a.addEventListener("load",(function(){return s.loading|=1})),a.addEventListener("error",(function(){return s.loading|=2})),Vc(a,"link",l),Qe(a),i.head.appendChild(a))))),t&&null===r)throw Error(o(528,""));return d}if(t&&null!==r)throw Error(o(529,""));return null;case"script":return t=n.async,"string"==typeof(n=n.src)&&t&&"function"!=typeof t&&"symbol"!=typeof t?(t=yd(n),(r=(n=qe(u).hoistableScripts).get(t))||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function md(e){return'href="'+pt(e)+'"'}function bd(e){return'link[rel="stylesheet"]['+e+"]"}function vd(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function yd(e){return'[src="'+pt(e)+'"]'}function Td(e){return"script[async]"+e}function _d(e,t,n){if(t.count++,null===t.instance)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+pt(n.href)+'"]');if(r)return t.instance=r,Qe(r),r;var i=x({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return Qe(r=(e.ownerDocument||e).createElement("style")),Vc(r,"style",i),Ed(r,n.precedence,e),t.instance=r;case"stylesheet":i=md(n.href);var a=e.querySelector(bd(i));if(a)return t.state.loading|=4,t.instance=a,Qe(a),a;r=vd(n),(i=ud.get(i))&&wd(r,i),Qe(a=(e.ownerDocument||e).createElement("link"));var l=a;return l._p=new Promise((function(e,t){l.onload=e,l.onerror=t})),Vc(a,"link",r),t.state.loading|=4,Ed(a,n.precedence,e),t.instance=a;case"script":return a=yd(n.src),(i=e.querySelector(Td(a)))?(t.instance=i,Qe(i),i):(r=n,(i=ud.get(a))&&Sd(r=x({},n),i),Qe(i=(e=e.ownerDocument||e).createElement("script")),Vc(i,"link",r),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(o(443,t.type))}else"stylesheet"===t.type&&!(4&t.state.loading)&&(r=t.instance,t.state.loading|=4,Ed(r,n.precedence,e));return t.instance}function Ed(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var l=r[o];if(l.dataset.precedence===t)a=l;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=9===n.nodeType?n.head:n).insertBefore(e,t.firstChild)}function wd(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.title&&(e.title=t.title)}function Sd(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.integrity&&(e.integrity=t.integrity)}var Ld=null;function Od(e,t,n){if(null===Ld){var r=new Map,i=Ld=new Map;i.set(n,r)}else(r=(i=Ld).get(n))||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Xe]||a[Pe]||"link"===e&&"stylesheet"===a.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==a.namespaceURI){var o=a.getAttribute(t)||"";o=e+o;var l=r.get(o);l?l.push(a):r.set(o,[a])}}return r}function Nd(e,t,n){(e=e.ownerDocument||e).head.insertBefore(n,"title"===t?e.querySelector("head > title"):null)}function Ad(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var Rd=null;function xd(){}function kd(){if(this.count--,0===this.count)if(this.stylesheets)Dd(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var Cd=null;function Dd(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,Cd=new Map,t.forEach(Md,e),Cd=null,kd.call(e))}function Md(e,t){if(!(4&t.state.loading)){var n=Cd.get(e);if(n)var r=n.get(null);else{n=new Map,Cd.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<i.length;a++){var o=i[a];"LINK"!==o.nodeName&&"not all"===o.getAttribute("media")||(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}o=(i=t.instance).getAttribute("data-precedence"),(a=n.get(o)||r)===r&&n.set(null,i),n.set(o,i),this.count++,r=kd.bind(this),i.addEventListener("load",r),i.addEventListener("error",r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(i,e.firstChild),t.state.loading|=4}}var Id={$$typeof:g,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function Bd(e,t,n,r,i,a,o,l){this.tag=1,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=xe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xe(0),this.hiddenUpdates=xe(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function Pd(e,t,n,r,i,a){i=function(e){return e?e=kr:kr}(i),null===r.context?r.context=i:r.pendingContext=i,(r=xl(t)).payload={element:n},null!==(a=void 0===a?null:a)&&(r.callback=a),null!==(n=kl(e,r,t))&&(ku(n,0,t),Cl(n,e,t))}function zd(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Ud(e,t){zd(e,t),(e=e.alternate)&&zd(e,t)}function Fd(e){if(13===e.tag){var t=Ar(e,67108864);null!==t&&ku(t,0,67108864),Ud(e,67108864)}}var Wd=!0;function Hd(e,t,n,r){var i=R.T;R.T=null;var a=W.p;try{W.p=2,Xd(e,t,n,r)}finally{W.p=a,R.T=i}}function Yd(e,t,n,r){var i=R.T;R.T=null;var a=W.p;try{W.p=8,Xd(e,t,n,r)}finally{W.p=a,R.T=i}}function Xd(e,t,n,r){if(Wd){var i=Vd(r);if(null===i)Dc(e,t,r,jd,n),rh(e,r);else if(function(e,t,n,r,i){switch(t){case"focusin":return Qd=ih(Qd,e,t,n,r,i),!0;case"dragenter":return Jd=ih(Jd,e,t,n,r,i),!0;case"mouseover":return Kd=ih(Kd,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return Zd.set(a,ih(Zd.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,eh.set(a,ih(eh.get(a)||null,e,t,n,r,i)),!0}return!1}(i,e,t,n,r))r.stopPropagation();else if(rh(e,r),4&t&&-1<nh.indexOf(e)){for(;null!==i;){var a=Ge(i);if(null!==a)switch(a.tag){case 3:if((a=a.stateNode).current.memoizedState.isDehydrated){var o=Se(a.pendingLanes);if(0!==o){var l=a;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var s=1<<31-ye(o);l.entanglements[1]|=s,o&=~s}pc(a),!(6&Zs)&&(yu=le()+500,gc(0,!1))}}break;case 13:null!==(l=Ar(a,2))&&ku(l,0,2),Pu(),Ud(a,2)}if(null===(a=Vd(r))&&Dc(e,t,r,jd,n),a===i)break;i=a}null!==i&&r.stopPropagation()}else Dc(e,t,r,null,n)}}function Vd(e){return Gd(e=xt(e))}var jd=null;function Gd(e){if(jd=null,null!==(e=je(e))){var t=B(e);if(null===t)e=null;else{var n=t.tag;if(13===n){if(null!==(e=P(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return jd=e,null}function $d(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(se()){case ue:return 2;case ce:return 8;case de:case he:return 32;case fe:return 268435456;default:return 32}default:return 32}}var qd=!1,Qd=null,Jd=null,Kd=null,Zd=new Map,eh=new Map,th=[],nh="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function rh(e,t){switch(e){case"focusin":case"focusout":Qd=null;break;case"dragenter":case"dragleave":Jd=null;break;case"mouseover":case"mouseout":Kd=null;break;case"pointerover":case"pointerout":Zd.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":eh.delete(t.pointerId)}}function ih(e,t,n,r,i,a){return null===e||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},null!==t&&null!==(t=Ge(t))&&Fd(t),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function ah(e){var t=je(e.target);if(null!==t){var n=B(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=P(n)))return e.blockedOn=t,void function(e){var t=W.p;try{return W.p=e,function(){if(13===n.tag){var e=Ru(),t=Ar(n,e);null!==t&&ku(t,0,e),Ud(n,e)}}()}finally{W.p=t}}(e.priority)}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function oh(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Vd(e.nativeEvent);if(null!==n)return null!==(t=Ge(n))&&Fd(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);Rt=r,n.target.dispatchEvent(r),Rt=null,t.shift()}return!0}function lh(e,t,n){oh(e)&&n.delete(t)}function sh(){qd=!1,null!==Qd&&oh(Qd)&&(Qd=null),null!==Jd&&oh(Jd)&&(Jd=null),null!==Kd&&oh(Kd)&&(Kd=null),Zd.forEach(lh),eh.forEach(lh)}function uh(e,t){e.blockedOn===t&&(e.blockedOn=null,qd||(qd=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,sh)))}var ch=null;function dh(e){ch!==e&&(ch=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,(function(){ch===e&&(ch=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if("function"!=typeof r){if(null===Gd(r||n))continue;break}var a=Ge(n);null!==a&&(e.splice(t,3),t-=3,uo(a,{pending:!0,data:i,method:n.method,action:r},r,i))}})))}function hh(e){function t(t){return uh(t,e)}null!==Qd&&uh(Qd,e),null!==Jd&&uh(Jd,e),null!==Kd&&uh(Kd,e),Zd.forEach(t),eh.forEach(t);for(var n=0;n<th.length;n++){var r=th[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<th.length&&null===(n=th[0]).blockedOn;)ah(n),null===n.blockedOn&&th.shift();if(null!=(n=(e.ownerDocument||e).$$reactFormReplay))for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ze]||null;if("function"==typeof a)o||dh(n);else if(o){var l=null;if(a&&a.hasAttribute("formAction")){if(i=a,o=a[ze]||null)l=o.formAction;else if(null!==Gd(i))continue}else l=o.action;"function"==typeof l?n[r+1]=l:(n.splice(r,3),r-=3),dh(n)}}}function fh(e){this._internalRoot=e}function ph(e){this._internalRoot=e}ph.prototype.render=fh.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(o(409));Pd(t.current,Ru(),e,t,null,null)},ph.prototype.unmount=fh.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;0===e.tag&&ec(),Pd(e.current,2,null,e,null,null),Pu(),t[Ue]=null}},ph.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ie();e={blockedOn:null,target:e,priority:t};for(var n=0;n<th.length&&0!==t&&t<th[n].priority;n++);th.splice(n,0,e),0===n&&ah(e)}};var gh=i.version;if("19.0.0"!==gh)throw Error(o(527,gh,"19.0.0"));W.findDOMNode=function(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(o(188));throw e=Object.keys(e).join(","),Error(o(268,e))}return e=function(e){var t=e.alternate;if(!t){if(null===(t=B(e)))throw Error(o(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(r=i.return)){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return z(i),e;if(a===r)return z(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var l=!1,s=i.child;s;){if(s===n){l=!0,n=i,r=a;break}if(s===r){l=!0,r=i,n=a;break}s=s.sibling}if(!l){for(s=a.child;s;){if(s===n){l=!0,n=a,r=i;break}if(s===r){l=!0,r=a,n=i;break}s=s.sibling}if(!l)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(3!==n.tag)throw Error(o(188));return n.stateNode.current===n?e:t}(t),null===(e=null!==e?U(e):null)?null:e.stateNode};var mh={bundleType:0,version:"19.0.0",rendererPackageName:"react-dom",currentDispatcherRef:R,findFiberByHostInstance:je,reconcilerVersion:"19.0.0"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var bh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bh.isDisabled&&bh.supportsFiber)try{me=bh.inject(mh),be=bh}catch(e){}}t.createRoot=function(e,t){if(!(n=e)||1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType)throw Error(o(299));var n,r=!1,i="",a=Mo,l=Io,s=Bo;return null!=t&&(!0===t.unstable_strictMode&&(r=!0),void 0!==t.identifierPrefix&&(i=t.identifierPrefix),void 0!==t.onUncaughtError&&(a=t.onUncaughtError),void 0!==t.onCaughtError&&(l=t.onCaughtError),void 0!==t.onRecoverableError&&(s=t.onRecoverableError),void 0!==t.unstable_transitionCallbacks&&t.unstable_transitionCallbacks),t=function(e,t,n,r,i,a,o,l,s,u,c,d){return e=new Bd(e,t,n,o,l,s,u,d),t=1,!0===a&&(t|=24),a=Ms(3,null,null,t),e.current=a,a.stateNode=e,(t=Ui()).refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Al(a),e}(e,1,!1,null,0,r,i,a,l,s,0,null),e[Ue]=t.current,kc(8===e.nodeType?e.parentNode:e),new fh(t)}},849:(e,t)=>{function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<a(i,t)))break e;e[r]=t,e[n]=i,n=r}}function r(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,o=i>>>1;r<o;){var l=2*(r+1)-1,s=e[l],u=l+1,c=e[u];if(0>a(s,n))u<i&&0>a(c,s)?(e[r]=c,e[u]=n,r=u):(e[r]=s,e[l]=n,r=l);else{if(!(u<i&&0>a(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var l=Date,s=l.now();t.unstable_now=function(){return l.now()-s}}var u=[],c=[],d=1,h=null,f=3,p=!1,g=!1,m=!1,b="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function T(e){for(var t=r(c);null!==t;){if(null===t.callback)i(c);else{if(!(t.startTime<=e))break;i(c),t.sortIndex=t.expirationTime,n(u,t)}t=r(c)}}function _(e){if(m=!1,T(e),!g)if(null!==r(u))g=!0,k();else{var t=r(c);null!==t&&C(_,t.startTime-e)}}var E,w=!1,S=-1,L=5,O=-1;function N(){return!(t.unstable_now()-O<L)}function A(){if(w){var e=t.unstable_now();O=e;var n=!0;try{e:{g=!1,m&&(m=!1,v(S),S=-1),p=!0;var a=f;try{t:{for(T(e),h=r(u);null!==h&&!(h.expirationTime>e&&N());){var o=h.callback;if("function"==typeof o){h.callback=null,f=h.priorityLevel;var l=o(h.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof l){h.callback=l,T(e),n=!0;break t}h===r(u)&&i(u),T(e)}else i(u);h=r(u)}if(null!==h)n=!0;else{var s=r(c);null!==s&&C(_,s.startTime-e),n=!1}}break e}finally{h=null,f=a,p=!1}n=void 0}}finally{n?E():w=!1}}}if("function"==typeof y)E=function(){y(A)};else if("undefined"!=typeof MessageChannel){var R=new MessageChannel,x=R.port2;R.port1.onmessage=A,E=function(){x.postMessage(null)}}else E=function(){b(A,0)};function k(){w||(w=!0,E())}function C(e,n){S=b((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){g||p||(g=!0,k())},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return r(u)},t.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},t.unstable_scheduleCallback=function(e,i,a){var o=t.unstable_now();switch(a="object"==typeof a&&null!==a&&"number"==typeof(a=a.delay)&&0<a?o+a:o,e){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return e={id:d++,callback:i,priorityLevel:e,startTime:a,expirationTime:l=a+l,sortIndex:-1},a>o?(e.sortIndex=a,n(c,e),null===r(u)&&e===r(c)&&(m?(v(S),S=-1):m=!0,C(_,a-o))):(e.sortIndex=l,n(u,e),g||p||(g=!0,k())),e},t.unstable_shouldYield=N,t.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}},884:(e,t,n)=>{!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(553)}},r={};function i(e){var t=r[e];if(void 0!==t)return t.exports;var a=r[e]={exports:{}};return n[e](a,a.exports,i),a.exports}i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};i.r(a),i.d(a,{Action:()=>p,Actions:()=>g,BorderNode:()=>z,BorderSet:()=>y,CLASSES:()=>l,DefaultMax:()=>B,DefaultMin:()=>I,DockLocation:()=>f,DropInfo:()=>v,FlexLayoutVersion:()=>se,I18nLabel:()=>o,ICloseType:()=>W,Layout:()=>oe,LayoutInternal:()=>le,LayoutWindow:()=>M,Model:()=>P,Node:()=>T,Orientation:()=>d,Rect:()=>h,RowNode:()=>D,TabNode:()=>_,TabSetNode:()=>C});var o,l,s=i(36),u=i(47),c=i(884);class d{static flip(e){return e===d.HORZ?d.VERT:d.HORZ}constructor(e){this._name=e}getName(){return this._name}toString(){return this._name}}d.HORZ=new d("horz"),d.VERT=new d("vert");class h{static empty(){return new h(0,0,0,0)}static fromJson(e){return new h(e.x,e.y,e.width,e.height)}constructor(e,t,n,r){this.x=e,this.y=t,this.width=n,this.height=r}toJson(){return{x:this.x,y:this.y,width:this.width,height:this.height}}snap(e){this.x=Math.round(this.x/e)*e,this.y=Math.round(this.y/e)*e,this.width=Math.round(this.width/e)*e,this.height=Math.round(this.height/e)*e}static getBoundingClientRect(e){let{x:t,y:n,width:r,height:i}=e.getBoundingClientRect();return new h(t,n,r,i)}static getContentRect(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e),r=parseFloat(n.paddingLeft),i=parseFloat(n.paddingRight),a=parseFloat(n.paddingTop),o=parseFloat(n.paddingBottom),l=parseFloat(n.borderLeftWidth),s=parseFloat(n.borderRightWidth),u=parseFloat(n.borderTopWidth),c=parseFloat(n.borderBottomWidth),d=t.width-l-r-i-s,f=t.height-u-a-o-c;return new h(t.left+l+r,t.top+u+a,d,f)}static fromDomRect(e){return new h(e.x,e.y,e.width,e.height)}relativeTo(e){return new h(this.x-e.x,this.y-e.y,this.width,this.height)}clone(){return new h(this.x,this.y,this.width,this.height)}equals(e){return this.x===(null==e?void 0:e.x)&&this.y===(null==e?void 0:e.y)&&this.width===(null==e?void 0:e.width)&&this.height===(null==e?void 0:e.height)}equalSize(e){return this.width===(null==e?void 0:e.width)&&this.height===(null==e?void 0:e.height)}getBottom(){return this.y+this.height}getRight(){return this.x+this.width}getCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}positionElement(e,t){this.styleWithPosition(e.style,t)}styleWithPosition(e,t="absolute"){return e.left=this.x+"px",e.top=this.y+"px",e.width=Math.max(0,this.width)+"px",e.height=Math.max(0,this.height)+"px",e.position=t,e}contains(e,t){return this.x<=e&&e<=this.getRight()&&this.y<=t&&t<=this.getBottom()}removeInsets(e){return new h(this.x+e.left,this.y+e.top,Math.max(0,this.width-e.left-e.right),Math.max(0,this.height-e.top-e.bottom))}centerInRect(e){this.x=(e.width-this.width)/2,this.y=(e.height-this.height)/2}_getSize(e){let t=this.width;return e===d.VERT&&(t=this.height),t}toString(){return"(Rect: x="+this.x+", y="+this.y+", width="+this.width+", height="+this.height+")"}}class f{static getByName(e){return f.values.get(e)}static getLocation(e,t,n){if(t=(t-e.x)/e.width,n=(n-e.y)/e.height,t>=.25&&t<.75&&n>=.25&&n<.75)return f.CENTER;const r=n>=1-t;return n>=t?r?f.BOTTOM:f.LEFT:r?f.RIGHT:f.TOP}constructor(e,t,n){this.name=e,this.orientation=t,this.indexPlus=n,f.values.set(this.name,this)}getName(){return this.name}getOrientation(){return this.orientation}getDockRect(e){return this===f.TOP?new h(e.x,e.y,e.width,e.height/2):this===f.BOTTOM?new h(e.x,e.getBottom()-e.height/2,e.width,e.height/2):this===f.LEFT?new h(e.x,e.y,e.width/2,e.height):this===f.RIGHT?new h(e.getRight()-e.width/2,e.y,e.width/2,e.height):e.clone()}split(e,t){return this===f.TOP?{start:new h(e.x,e.y,e.width,t),end:new h(e.x,e.y+t,e.width,e.height-t)}:this===f.LEFT?{start:new h(e.x,e.y,t,e.height),end:new h(e.x+t,e.y,e.width-t,e.height)}:this===f.RIGHT?{start:new h(e.getRight()-t,e.y,t,e.height),end:new h(e.x,e.y,e.width-t,e.height)}:{start:new h(e.x,e.getBottom()-t,e.width,t),end:new h(e.x,e.y,e.width,e.height-t)}}reflect(){return this===f.TOP?f.BOTTOM:this===f.LEFT?f.RIGHT:this===f.RIGHT?f.LEFT:f.TOP}toString(){return"(DockLocation: name="+this.name+", orientation="+this.orientation+")"}}f.values=new Map,f.TOP=new f("top",d.VERT,0),f.BOTTOM=new f("bottom",d.VERT,1),f.LEFT=new f("left",d.HORZ,0),f.RIGHT=new f("right",d.HORZ,1),f.CENTER=new f("center",d.VERT,0),function(e){e.Close_Tab="Close",e.Close_Tabset="Close tab set",e.Active_Tabset="Active tab set",e.Move_Tabset="Move tab set",e.Move_Tabs="Move tabs(?)",e.Maximize="Maximize tab set",e.Restore="Restore tab set",e.Popout_Tab="Popout selected tab",e.Overflow_Menu_Tooltip="Hidden tabs",e.Error_rendering_component="Error rendering component"}(o||(o={})),function(e){e.FLEXLAYOUT__BORDER="flexlayout__border",e.FLEXLAYOUT__BORDER_="flexlayout__border_",e.FLEXLAYOUT__BORDER_TAB_CONTENTS="flexlayout__border_tab_contents",e.FLEXLAYOUT__BORDER_BUTTON="flexlayout__border_button",e.FLEXLAYOUT__BORDER_BUTTON_="flexlayout__border_button_",e.FLEXLAYOUT__BORDER_BUTTON_CONTENT="flexlayout__border_button_content",e.FLEXLAYOUT__BORDER_BUTTON_LEADING="flexlayout__border_button_leading",e.FLEXLAYOUT__BORDER_BUTTON_TRAILING="flexlayout__border_button_trailing",e.FLEXLAYOUT__BORDER_BUTTON__SELECTED="flexlayout__border_button--selected",e.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED="flexlayout__border_button--unselected",e.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW="flexlayout__border_toolbar_button_overflow",e.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_="flexlayout__border_toolbar_button_overflow_",e.FLEXLAYOUT__BORDER_INNER="flexlayout__border_inner",e.FLEXLAYOUT__BORDER_INNER_="flexlayout__border_inner_",e.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER="flexlayout__border_inner_tab_container",e.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_="flexlayout__border_inner_tab_container_",e.FLEXLAYOUT__BORDER_TAB_DIVIDER="flexlayout__border_tab_divider",e.FLEXLAYOUT__BORDER_SIZER="flexlayout__border_sizer",e.FLEXLAYOUT__BORDER_TOOLBAR="flexlayout__border_toolbar",e.FLEXLAYOUT__BORDER_TOOLBAR_="flexlayout__border_toolbar_",e.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON="flexlayout__border_toolbar_button",e.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT="flexlayout__border_toolbar_button-float",e.FLEXLAYOUT__DRAG_RECT="flexlayout__drag_rect",e.FLEXLAYOUT__EDGE_RECT="flexlayout__edge_rect",e.FLEXLAYOUT__EDGE_RECT_TOP="flexlayout__edge_rect_top",e.FLEXLAYOUT__EDGE_RECT_LEFT="flexlayout__edge_rect_left",e.FLEXLAYOUT__EDGE_RECT_BOTTOM="flexlayout__edge_rect_bottom",e.FLEXLAYOUT__EDGE_RECT_RIGHT="flexlayout__edge_rect_right",e.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER="flexlayout__error_boundary_container",e.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT="flexlayout__error_boundary_content",e.FLEXLAYOUT__FLOATING_WINDOW_CONTENT="flexlayout__floating_window_content",e.FLEXLAYOUT__FLOATING_WINDOW_TAB="flexlayout__floating_window_tab",e.FLEXLAYOUT__LAYOUT="flexlayout__layout",e.FLEXLAYOUT__LAYOUT_MOVEABLES="flexlayout__layout_moveables",e.FLEXLAYOUT__LAYOUT_OVERLAY="flexlayout__layout_overlay",e.FLEXLAYOUT__LAYOUT_TAB_STAMPS="flexlayout__layout_tab_stamps",e.FLEXLAYOUT__LAYOUT_MAIN="flexlayout__layout_main",e.FLEXLAYOUT__LAYOUT_BORDER_CONTAINER="flexlayout__layout_border_container",e.FLEXLAYOUT__LAYOUT_BORDER_CONTAINER_INNER="flexlayout__layout_border_container_inner",e.FLEXLAYOUT__OUTLINE_RECT="flexlayout__outline_rect",e.FLEXLAYOUT__OUTLINE_RECT_EDGE="flexlayout__outline_rect_edge",e.FLEXLAYOUT__SPLITTER="flexlayout__splitter",e.FLEXLAYOUT__SPLITTER_EXTRA="flexlayout__splitter_extra",e.FLEXLAYOUT__SPLITTER_="flexlayout__splitter_",e.FLEXLAYOUT__SPLITTER_BORDER="flexlayout__splitter_border",e.FLEXLAYOUT__SPLITTER_DRAG="flexlayout__splitter_drag",e.FLEXLAYOUT__SPLITTER_HANDLE="flexlayout__splitter_handle",e.FLEXLAYOUT__SPLITTER_HANDLE_HORZ="flexlayout__splitter_handle_horz",e.FLEXLAYOUT__SPLITTER_HANDLE_VERT="flexlayout__splitter_handle_vert",e.FLEXLAYOUT__ROW="flexlayout__row",e.FLEXLAYOUT__TAB="flexlayout__tab",e.FLEXLAYOUT__TAB_POSITION="flexlayout__tab_position",e.FLEXLAYOUT__TAB_MOVEABLE="flexlayout__tab_moveable",e.FLEXLAYOUT__TAB_OVERLAY="flexlayout__tab_overlay",e.FLEXLAYOUT__TABSET="flexlayout__tabset",e.FLEXLAYOUT__TABSET_CONTAINER="flexlayout__tabset_container",e.FLEXLAYOUT__TABSET_HEADER="flexlayout__tabset_header",e.FLEXLAYOUT__TABSET_HEADER_SIZER="flexlayout__tabset_header_sizer",e.FLEXLAYOUT__TABSET_HEADER_CONTENT="flexlayout__tabset_header_content",e.FLEXLAYOUT__TABSET_MAXIMIZED="flexlayout__tabset-maximized",e.FLEXLAYOUT__TABSET_SELECTED="flexlayout__tabset-selected",e.FLEXLAYOUT__TABSET_SIZER="flexlayout__tabset_sizer",e.FLEXLAYOUT__TABSET_TAB_DIVIDER="flexlayout__tabset_tab_divider",e.FLEXLAYOUT__TABSET_CONTENT="flexlayout__tabset_content",e.FLEXLAYOUT__TABSET_TABBAR_INNER="flexlayout__tabset_tabbar_inner",e.FLEXLAYOUT__TABSET_TABBAR_INNER_="flexlayout__tabset_tabbar_inner_",e.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER="flexlayout__tabset_tabbar_inner_tab_container",e.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_="flexlayout__tabset_tabbar_inner_tab_container_",e.FLEXLAYOUT__TABSET_TABBAR_OUTER="flexlayout__tabset_tabbar_outer",e.FLEXLAYOUT__TABSET_TABBAR_OUTER_="flexlayout__tabset_tabbar_outer_",e.FLEXLAYOUT__TAB_BORDER="flexlayout__tab_border",e.FLEXLAYOUT__TAB_BORDER_="flexlayout__tab_border_",e.FLEXLAYOUT__TAB_BUTTON="flexlayout__tab_button",e.FLEXLAYOUT__TAB_BUTTON_STRETCH="flexlayout__tab_button_stretch",e.FLEXLAYOUT__TAB_BUTTON_CONTENT="flexlayout__tab_button_content",e.FLEXLAYOUT__TAB_BUTTON_LEADING="flexlayout__tab_button_leading",e.FLEXLAYOUT__TAB_BUTTON_OVERFLOW="flexlayout__tab_button_overflow",e.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT="flexlayout__tab_button_overflow_count",e.FLEXLAYOUT__TAB_BUTTON_TEXTBOX="flexlayout__tab_button_textbox",e.FLEXLAYOUT__TAB_BUTTON_TRAILING="flexlayout__tab_button_trailing",e.FLEXLAYOUT__TAB_BUTTON_STAMP="flexlayout__tab_button_stamp",e.FLEXLAYOUT__TAB_FLOATING="flexlayout__tab_floating",e.FLEXLAYOUT__TAB_FLOATING_INNER="flexlayout__tab_floating_inner",e.FLEXLAYOUT__TAB_TOOLBAR="flexlayout__tab_toolbar",e.FLEXLAYOUT__TAB_TOOLBAR_BUTTON="flexlayout__tab_toolbar_button",e.FLEXLAYOUT__TAB_TOOLBAR_ICON="flexlayout__tab_toolbar_icon",e.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_="flexlayout__tab_toolbar_button-",e.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT="flexlayout__tab_toolbar_button-float",e.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER="flexlayout__tab_toolbar_sticky_buttons_container",e.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE="flexlayout__tab_toolbar_button-close",e.FLEXLAYOUT__POPUP_MENU_CONTAINER="flexlayout__popup_menu_container",e.FLEXLAYOUT__POPUP_MENU_ITEM="flexlayout__popup_menu_item",e.FLEXLAYOUT__POPUP_MENU="flexlayout__popup_menu"}(l||(l={}));class p{constructor(e,t){this.type=e,this.data=t}}class g{static addNode(e,t,n,r,i){return new p(g.ADD_NODE,{json:e,toNode:t,location:n.getName(),index:r,select:i})}static moveNode(e,t,n,r,i){return new p(g.MOVE_NODE,{fromNode:e,toNode:t,location:n.getName(),index:r,select:i})}static deleteTab(e){return new p(g.DELETE_TAB,{node:e})}static deleteTabset(e){return new p(g.DELETE_TABSET,{node:e})}static renameTab(e,t){return new p(g.RENAME_TAB,{node:e,text:t})}static selectTab(e){return new p(g.SELECT_TAB,{tabNode:e})}static setActiveTabset(e,t){return new p(g.SET_ACTIVE_TABSET,{tabsetNode:e,windowId:t})}static adjustWeights(e,t){return new p(g.ADJUST_WEIGHTS,{nodeId:e,weights:t})}static adjustBorderSplit(e,t){return new p(g.ADJUST_BORDER_SPLIT,{node:e,pos:t})}static maximizeToggle(e,t){return new p(g.MAXIMIZE_TOGGLE,{node:e,windowId:t})}static updateModelAttributes(e){return new p(g.UPDATE_MODEL_ATTRIBUTES,{json:e})}static updateNodeAttributes(e,t){return new p(g.UPDATE_NODE_ATTRIBUTES,{node:e,json:t})}static popoutTab(e){return new p(g.POPOUT_TAB,{node:e})}static popoutTabset(e){return new p(g.POPOUT_TABSET,{node:e})}static closeWindow(e){return new p(g.CLOSE_WINDOW,{windowId:e})}static createWindow(e,t){return new p(g.CREATE_WINDOW,{layout:e,rect:t})}}g.ADD_NODE="FlexLayout_AddNode",g.MOVE_NODE="FlexLayout_MoveNode",g.DELETE_TAB="FlexLayout_DeleteTab",g.DELETE_TABSET="FlexLayout_DeleteTabset",g.RENAME_TAB="FlexLayout_RenameTab",g.SELECT_TAB="FlexLayout_SelectTab",g.SET_ACTIVE_TABSET="FlexLayout_SetActiveTabset",g.ADJUST_WEIGHTS="FlexLayout_AdjustWeights",g.ADJUST_BORDER_SPLIT="FlexLayout_AdjustBorderSplit",g.MAXIMIZE_TOGGLE="FlexLayout_MaximizeToggle",g.UPDATE_MODEL_ATTRIBUTES="FlexLayout_UpdateModelAttributes",g.UPDATE_NODE_ATTRIBUTES="FlexLayout_UpdateNodeAttributes",g.POPOUT_TAB="FlexLayout_PopoutTab",g.POPOUT_TABSET="FlexLayout_PopoutTabset",g.CLOSE_WINDOW="FlexLayout_CloseWindow",g.CREATE_WINDOW="FlexLayout_CreateWindow";class m{constructor(e,t,n,r){this.name=e,this.alias=void 0,this.modelName=t,this.defaultValue=n,this.alwaysWriteJson=r,this.required=!1,this.fixed=!1,this.type="any"}setType(e){return this.type=e,this}setAlias(e){return this.alias=e,this}setDescription(e){this.description=e}setRequired(){return this.required=!0,this}setFixed(){return this.fixed=!0,this}setpairedAttr(e){this.pairedAttr=e}setPairedType(e){this.pairedType=e}}m.NUMBER="number",m.STRING="string",m.BOOLEAN="boolean";class b{constructor(){this.attributes=[],this.nameToAttribute=new Map}addWithAll(e,t,n,r){const i=new m(e,t,n,r);return this.attributes.push(i),this.nameToAttribute.set(e,i),i}addInherited(e,t){return this.addWithAll(e,t,void 0,!1)}add(e,t,n){return this.addWithAll(e,void 0,t,n)}getAttributes(){return this.attributes}getModelName(e){const t=this.nameToAttribute.get(e);if(void 0!==t)return t.modelName}toJson(e,t){for(const n of this.attributes){const r=t[n.name];(n.alwaysWriteJson||r!==n.defaultValue)&&(e[n.name]=r)}}fromJson(e,t){for(const n of this.attributes){let r=e[n.name];void 0===r&&n.alias&&(r=e[n.alias]),t[n.name]=void 0===r?n.defaultValue:r}}update(e,t){for(const n of this.attributes)if(e.hasOwnProperty(n.name)){const r=e[n.name];void 0===r?delete t[n.name]:t[n.name]=r}}setDefaults(e){for(const t of this.attributes)e[t.name]=t.defaultValue}pairAttributes(e,t){for(const n of t.attributes)if(n.modelName&&this.nameToAttribute.has(n.modelName)){const t=this.nameToAttribute.get(n.modelName);t.setpairedAttr(n),n.setpairedAttr(t),t.setPairedType(e)}}toTypescriptInterface(e,t){var n,r;const i=[],a=this.attributes.sort(((e,t)=>e.name.localeCompare(t.name)));i.push("export interface I"+e+"Attributes {");for(let e=0;e<a.length;e++){const o=a[e];let l,s,u=o.type,c=o;void 0!==c.defaultValue?l=c.defaultValue:void 0!==c.modelName&&void 0!==t&&void 0!==t.nameToAttribute.get(c.modelName)&&(s=c.modelName,c=t.nameToAttribute.get(s),l=c.defaultValue,u=c.type);let d=JSON.stringify(l);const h=c.required?"":"?";let f="\t/**\n\t ";o.description?f+=o.description:o.pairedType&&(null===(n=o.pairedAttr)||void 0===n?void 0:n.description)&&(f+=`Value for ${o.pairedType} attribute ${o.pairedAttr.name} if not overridden`,f+="\n\n\t ",f+=null===(r=o.pairedAttr)||void 0===r?void 0:r.description),f+="\n\n\t ",o.fixed?f+=`Fixed value: ${d}`:f+=s?`Default: inherited from Global attribute ${o.modelName} (default ${d})`:`Default: ${d}`,f+="\n\t */",i.push(f),i.push("\t"+o.name+h+": "+u+";\n")}return i.push("}"),i.join("\n")}}class v{constructor(e,t,n,r,i){this.node=e,this.rect=t,this.location=n,this.index=r,this.className=i}}class y{static fromJson(e,t){const n=new y(t);n.borders=e.map((e=>z.fromJson(e,t)));for(const e of n.borders)n.borderMap.set(e.getLocation(),e);return n}constructor(e){this.borders=[],this.borderMap=new Map,this.layoutHorizontal=!0}toJson(){return this.borders.map((e=>e.toJson()))}getLayoutHorizontal(){return this.layoutHorizontal}getBorders(){return this.borders}getBorderMap(){return this.borderMap}forEachNode(e){for(const t of this.borders){e(t,0);for(const n of t.getChildren())n.forEachNode(e,1)}}setPaths(){for(const e of this.borders){const t="/border/"+e.getLocation().getName();e.setPath(t);let n=0;for(const r of e.getChildren())r.setPath(t+"/t"+n),n++}}findDropTargetNode(e,t,n){for(const r of this.borders)if(r.isShowing()){const i=r.canDrop(e,t,n);if(void 0!==i)return i}}}class T{constructor(e){this.model=e,this.attributes={},this.children=[],this.rect=h.empty(),this.listeners=new Map,this.path=""}getId(){let e=this.attributes.id;return void 0!==e||(e=this.model.nextUniqueId(),this.setId(e)),e}getModel(){return this.model}getType(){return this.attributes.type}getParent(){return this.parent}getChildren(){return this.children}getRect(){return this.rect}getPath(){return this.path}getOrientation(){return void 0===this.parent?this.model.isRootOrientationVertical()?d.VERT:d.HORZ:d.flip(this.parent.getOrientation())}setEventListener(e,t){this.listeners.set(e,t)}removeEventListener(e){this.listeners.delete(e)}setId(e){this.attributes.id=e}fireEvent(e,t){this.listeners.has(e)&&this.listeners.get(e)(t)}getAttr(e){let t=this.attributes[e];if(void 0===t){const n=this.getAttributeDefinitions().getModelName(e);void 0!==n&&(t=this.model.getAttribute(n))}return t}forEachNode(e,t){e(this,t),t++;for(const n of this.children)n.forEachNode(e,t)}setPaths(e){let t=0;for(const n of this.children){let r=e;"row"===n.getType()?n.getOrientation()===d.VERT?r+="/c"+t:r+="/r"+t:"tabset"===n.getType()?r+="/ts"+t:"tab"===n.getType()&&(r+="/t"+t),n.path=r,n.setPaths(r),t++}}setParent(e){this.parent=e}setRect(e){this.rect=e}setPath(e){this.path=e}setWeight(e){this.attributes.weight=e}setSelected(e){this.attributes.selected=e}findDropTargetNode(e,t,n,r){let i;if(this.rect.contains(n,r))if(void 0!==this.model.getMaximizedTabset(e))i=this.model.getMaximizedTabset(e).canDrop(t,n,r);else if(i=this.canDrop(t,n,r),void 0===i&&0!==this.children.length)for(const a of this.children)if(i=a.findDropTargetNode(e,t,n,r),void 0!==i)break;return i}canDrop(e,t,n){}canDockInto(e,t){if(null!=t){if(t.location===f.CENTER&&!1===t.node.isEnableDrop())return!1;if(t.location===f.CENTER&&"tabset"===e.getType()&&void 0!==e.getName())return!1;if(t.location!==f.CENTER&&!1===t.node.isEnableDivide())return!1;if(this.model.getOnAllowDrop())return this.model.getOnAllowDrop()(e,t)}return!0}removeChild(e){const t=this.children.indexOf(e);return-1!==t&&this.children.splice(t,1),t}addChild(e,t){return null!=t?this.children.splice(t,0,e):(this.children.push(e),t=this.children.length-1),e.parent=this,t}removeAll(){this.children=[]}styleWithPosition(e){return null==e&&(e={}),this.rect.styleWithPosition(e)}isEnableDivide(){return!0}toAttributeString(){return JSON.stringify(this.attributes,void 0,"\t")}}class _ extends T{static fromJson(e,t,n=!0){return new _(t,e,n)}constructor(e,t,n=!0){super(e),this.tabRect=h.empty(),this.extra={},this.moveableElement=null,this.tabStamp=null,this.rendered=!1,this.visible=!1,_.attributeDefinitions.fromJson(t,this.attributes),!0===n&&e.addNode(this)}getName(){return this.getAttr("name")}getHelpText(){return this.getAttr("helpText")}getComponent(){return this.getAttr("component")}getWindowId(){return this.parent instanceof C?this.parent.getWindowId():P.MAIN_WINDOW_ID}getWindow(){const e=this.model.getwindowsMap().get(this.getWindowId());if(e)return e.window}getConfig(){return this.attributes.config}getExtraData(){return this.extra}isPoppedOut(){return this.getWindowId()!==P.MAIN_WINDOW_ID}isSelected(){return this.getParent().getSelectedNode()===this}getIcon(){return this.getAttr("icon")}isEnableClose(){return this.getAttr("enableClose")}getCloseType(){return this.getAttr("closeType")}isEnablePopout(){return this.getAttr("enablePopout")}isEnablePopoutIcon(){return this.getAttr("enablePopoutIcon")}isEnablePopoutOverlay(){return this.getAttr("enablePopoutOverlay")}isEnableDrag(){return this.getAttr("enableDrag")}isEnableRename(){return this.getAttr("enableRename")}isEnableWindowReMount(){return this.getAttr("enableWindowReMount")}getClassName(){return this.getAttr("className")}getContentClassName(){return this.getAttr("contentClassName")}getTabSetClassName(){return this.getAttr("tabsetClassName")}isEnableRenderOnDemand(){return this.getAttr("enableRenderOnDemand")}getMinWidth(){return this.getAttr("minWidth")}getMinHeight(){return this.getAttr("minHeight")}getMaxWidth(){return this.getAttr("maxWidth")}getMaxHeight(){return this.getAttr("maxHeight")}toJson(){const e={};return _.attributeDefinitions.toJson(e,this.attributes),e}saveScrollPosition(){this.moveableElement&&(this.scrollLeft=this.moveableElement.scrollLeft,this.scrollTop=this.moveableElement.scrollTop)}restoreScrollPosition(){this.scrollTop&&requestAnimationFrame((()=>{this.moveableElement&&this.scrollTop&&(this.moveableElement.scrollTop=this.scrollTop,this.moveableElement.scrollLeft=this.scrollLeft)}))}setRect(e){e.equals(this.rect)||(this.fireEvent("resize",{rect:e}),this.rect=e)}setVisible(e){e!==this.visible&&(this.fireEvent("visibility",{visible:e}),this.visible=e)}getScrollTop(){return this.scrollTop}setScrollTop(e){this.scrollTop=e}getScrollLeft(){return this.scrollLeft}setScrollLeft(e){this.scrollLeft=e}isRendered(){return this.rendered}setRendered(e){this.rendered=e}getTabRect(){return this.tabRect}setTabRect(e){this.tabRect=e}getTabStamp(){return this.tabStamp}setTabStamp(e){this.tabStamp=e}getMoveableElement(){return this.moveableElement}setMoveableElement(e){this.moveableElement=e}setRenderedName(e){this.renderedName=e}getNameForOverflowMenu(){const e=this.getAttr("altName");return void 0!==e?e:this.renderedName}setName(e){this.attributes.name=e}delete(){this.parent.remove(this),this.fireEvent("close",{})}updateAttrs(e){_.attributeDefinitions.update(e,this.attributes)}getAttributeDefinitions(){return _.attributeDefinitions}setBorderWidth(e){this.attributes.borderWidth=e}setBorderHeight(e){this.attributes.borderHeight=e}static getAttributeDefinitions(){return _.attributeDefinitions}static createAttributeDefinitions(){const e=new b;return e.add("type",_.TYPE,!0).setType(m.STRING).setFixed(),e.add("id",void 0).setType(m.STRING).setDescription("the unique id of the tab, if left undefined a uuid will be assigned"),e.add("name","[Unnamed Tab]").setType(m.STRING).setDescription("name of tab to be displayed in the tab button"),e.add("altName",void 0).setType(m.STRING).setDescription("if there is no name specifed then this value will be used in the overflow menu"),e.add("helpText",void 0).setType(m.STRING).setDescription("An optional help text for the tab to be displayed upon tab hover."),e.add("component",void 0).setType(m.STRING).setDescription("string identifying which component to run (for factory)"),e.add("config",void 0).setType("any").setDescription("a place to hold json config for the hosted component"),e.add("tabsetClassName",void 0).setType(m.STRING).setDescription("class applied to parent tabset when this is the only tab and it is stretched to fill the tabset"),e.add("enableWindowReMount",!1).setType(m.BOOLEAN).setDescription("if enabled the tab will re-mount when popped out/in"),e.addInherited("enableClose","tabEnableClose").setType(m.BOOLEAN).setDescription("allow user to close tab via close button"),e.addInherited("closeType","tabCloseType").setType("ICloseType").setDescription("see values in ICloseType"),e.addInherited("enableDrag","tabEnableDrag").setType(m.BOOLEAN).setDescription("allow user to drag tab to new location"),e.addInherited("enableRename","tabEnableRename").setType(m.BOOLEAN).setDescription("allow user to rename tabs by double clicking"),e.addInherited("className","tabClassName").setType(m.STRING).setDescription("class applied to tab button"),e.addInherited("contentClassName","tabContentClassName").setType(m.STRING).setDescription("class applied to tab content"),e.addInherited("icon","tabIcon").setType(m.STRING).setDescription("the tab icon"),e.addInherited("enableRenderOnDemand","tabEnableRenderOnDemand").setType(m.BOOLEAN).setDescription("whether to avoid rendering component until tab is visible"),e.addInherited("enablePopout","tabEnablePopout").setType(m.BOOLEAN).setAlias("enableFloat").setDescription("enable popout (in popout capable browser)"),e.addInherited("enablePopoutIcon","tabEnablePopoutIcon").setType(m.BOOLEAN).setDescription("whether to show the popout icon in the tabset header if this tab enables popouts"),e.addInherited("enablePopoutOverlay","tabEnablePopoutOverlay").setType(m.BOOLEAN).setDescription("if this tab will not work correctly in a popout window when the main window is backgrounded (inactive)\n then enabling this option will gray out this tab"),e.addInherited("borderWidth","tabBorderWidth").setType(m.NUMBER).setDescription("width when added to border, -1 will use border size"),e.addInherited("borderHeight","tabBorderHeight").setType(m.NUMBER).setDescription("height when added to border, -1 will use border size"),e.addInherited("minWidth","tabMinWidth").setType(m.NUMBER).setDescription("the min width of this tab"),e.addInherited("minHeight","tabMinHeight").setType(m.NUMBER).setDescription("the min height of this tab"),e.addInherited("maxWidth","tabMaxWidth").setType(m.NUMBER).setDescription("the max width of this tab"),e.addInherited("maxHeight","tabMaxHeight").setType(m.NUMBER).setDescription("the max height of this tab"),e}}function E(){return"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches}function w(e,t,n){let r,i=t.getName(),a=t.getName();void 0===n&&(n=0),void 0===r&&void 0!==t.getIcon()&&(r=0!==n?s.createElement("img",{style:{width:"1em",height:"1em",transform:"rotate("+n+"deg)"},src:t.getIcon(),alt:"leadingContent"}):s.createElement("img",{style:{width:"1em",height:"1em"},src:t.getIcon(),alt:"leadingContent"}));const o={leading:r,content:i,name:a,buttons:[]};return e.customizeTab(t,o),t.setRenderedName(o.name),o}function S(e){let t=!1;return e.nativeEvent instanceof MouseEvent&&(0!==e.nativeEvent.button||e.ctrlKey||e.altKey||e.metaKey||e.shiftKey)&&(t=!0),t}function L(e,t){const n=[...O("iframe",t),...O("webview",t)];for(const t of n)t.style.pointerEvents=e?"auto":"none"}function O(e,t){return[...t.getElementsByTagName(e)]}function N(e){if(e instanceof _)return e.isEnablePopout();if(e instanceof C){for(const t of e.getChildren())if(!1===t.isEnablePopout())return!1;return!0}return!1}function A(e){const t=window.screen.availWidth,n=window.screen.availHeight;return e.x>=0&&e.getRight()<=t&&e.y>=0||e.getBottom()<=n}function R(e,t){const n=e.getAttribute("style");return n!==t.getAttribute("style")&&(n?t.setAttribute("style",n):t.removeAttribute("style"),!0)}function x(e,t){if(void 0!==e&&(e instanceof C||e instanceof z)){const n=e.getSelected();-1!==n&&(t===n&&e.getChildren().length>0?t>=e.getChildren().length&&e.setSelected(e.getChildren().length-1):t<n?e.setSelected(n-1):t>n||e.setSelected(-1))}}function k(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)))}_.TYPE="tab",_.attributeDefinitions=_.createAttributeDefinitions();class C extends T{static fromJson(e,t,n){const r=new C(t,e);if(null!=e.children)for(const n of e.children){const e=_.fromJson(n,t);r.addChild(e)}return 0===r.children.length&&r.setSelected(-1),e.maximized&&!0===e.maximized&&(n.maximizedTabSet=r),e.active&&!0===e.active&&(n.activeTabSet=r),r}constructor(e,t){super(e),this.tabStripRect=h.empty(),this.contentRect=h.empty(),this.calculatedMinHeight=0,this.calculatedMinWidth=0,this.calculatedMaxHeight=0,this.calculatedMaxWidth=0,C.attributeDefinitions.fromJson(t,this.attributes),e.addNode(this)}getName(){return this.getAttr("name")}isEnableActiveIcon(){return this.getAttr("enableActiveIcon")}getSelected(){const e=this.attributes.selected;return void 0!==e?e:-1}getSelectedNode(){const e=this.getSelected();if(-1!==e)return this.children[e]}getWeight(){return this.getAttr("weight")}getAttrMinWidth(){return this.getAttr("minWidth")}getAttrMinHeight(){return this.getAttr("minHeight")}getMinWidth(){return this.calculatedMinWidth}getMinHeight(){return this.calculatedMinHeight}getMinSize(e){return e===d.HORZ?this.getMinWidth():this.getMinHeight()}getAttrMaxWidth(){return this.getAttr("maxWidth")}getAttrMaxHeight(){return this.getAttr("maxHeight")}getMaxWidth(){return this.calculatedMaxWidth}getMaxHeight(){return this.calculatedMaxHeight}getMaxSize(e){return e===d.HORZ?this.getMaxWidth():this.getMaxHeight()}getConfig(){return this.attributes.config}isMaximized(){return this.model.getMaximizedTabset(this.getWindowId())===this}isActive(){return this.model.getActiveTabset(this.getWindowId())===this}isEnableDeleteWhenEmpty(){return this.getAttr("enableDeleteWhenEmpty")}isEnableDrop(){return this.getAttr("enableDrop")}isEnableTabWrap(){return this.getAttr("enableTabWrap")}isEnableDrag(){return this.getAttr("enableDrag")}isEnableDivide(){return this.getAttr("enableDivide")}isEnableMaximize(){return this.getAttr("enableMaximize")}isEnableClose(){return this.getAttr("enableClose")}isEnableSingleTabStretch(){return this.getAttr("enableSingleTabStretch")}isEnableTabStrip(){return this.getAttr("enableTabStrip")}isAutoSelectTab(){return this.getAttr("autoSelectTab")}getClassNameTabStrip(){return this.getAttr("classNameTabStrip")}getTabLocation(){return this.getAttr("tabLocation")}toJson(){const e={};return C.attributeDefinitions.toJson(e,this.attributes),e.children=this.children.map((e=>e.toJson())),this.isActive()&&(e.active=!0),this.isMaximized()&&(e.maximized=!0),e}calcMinMaxSize(){this.calculatedMinHeight=this.getAttrMinHeight(),this.calculatedMinWidth=this.getAttrMinWidth(),this.calculatedMaxHeight=this.getAttrMaxHeight(),this.calculatedMaxWidth=this.getAttrMaxWidth();for(const e of this.children){const t=e;this.calculatedMinWidth=Math.max(this.calculatedMinWidth,t.getMinWidth()),this.calculatedMinHeight=Math.max(this.calculatedMinHeight,t.getMinHeight()),this.calculatedMaxWidth=Math.min(this.calculatedMaxWidth,t.getMaxWidth()),this.calculatedMaxHeight=Math.min(this.calculatedMaxHeight,t.getMaxHeight())}this.calculatedMinHeight+=this.tabStripRect.height,this.calculatedMaxHeight+=this.tabStripRect.height}canMaximize(){return!!this.isEnableMaximize()&&(this.getModel().getMaximizedTabset(this.getWindowId())===this||this.getParent()!==this.getModel().getRoot(this.getWindowId())||1!==this.getModel().getRoot(this.getWindowId()).getChildren().length)}setContentRect(e){this.contentRect=e}getContentRect(){return this.contentRect}setTabStripRect(e){this.tabStripRect=e}setWeight(e){this.attributes.weight=e}setSelected(e){this.attributes.selected=e}getWindowId(){return this.parent.getWindowId()}canDrop(e,t,n){let r;if(e===this){const e=f.CENTER,t=this.tabStripRect;r=new v(this,t,e,-1,l.FLEXLAYOUT__OUTLINE_RECT)}else{if(this.getWindowId()!==P.MAIN_WINDOW_ID&&!N(e))return;if(this.contentRect.contains(t,n)){let e=f.CENTER;void 0===this.model.getMaximizedTabset(this.parent.getWindowId())&&(e=f.getLocation(this.contentRect,t,n));const i=e.getDockRect(this.rect);r=new v(this,i,e,-1,l.FLEXLAYOUT__OUTLINE_RECT)}else if(null!=this.tabStripRect&&this.tabStripRect.contains(t,n)){let e,i,a;if(0===this.children.length)e=this.tabStripRect.clone(),i=e.y+3,a=e.height-4,e.width=2;else{let o=this.children[0];e=o.getTabRect(),i=e.y,a=e.height;let s=this.tabStripRect.x,u=0;for(let a=0;a<this.children.length;a++){if(o=this.children[a],e=o.getTabRect(),e.y!==i&&(i=e.y,s=this.tabStripRect.x),u=e.x+e.width/2,t>=s&&t<u&&n>e.y&&n<e.getBottom()){const t=f.CENTER,n=new h(e.x-2,e.y,3,e.height);r=new v(this,n,t,a,l.FLEXLAYOUT__OUTLINE_RECT);break}s=u}}if(null==r){const t=f.CENTER,n=new h(e.getRight()-2,i,3,a);r=new v(this,n,t,this.children.length,l.FLEXLAYOUT__OUTLINE_RECT)}}}if(e.canDockInto(e,r))return r}delete(){this.parent.removeChild(this)}remove(e){const t=this.removeChild(e);this.model.tidy(),x(this,t)}drop(e,t,n,r){const i=t;if(this===e)return;let a=e.getParent(),o=0;if(void 0!==a&&(o=a.removeChild(e),a instanceof z&&a.getSelected()===o?a.setSelected(-1):x(a,o)),e instanceof _&&a===this&&o<n&&n>0&&n--,i===f.CENTER){let t=n;if(-1===t&&(t=this.children.length),e instanceof _)this.addChild(e,t),(r||!1!==r&&this.isAutoSelectTab())&&this.setSelected(t);else if(e instanceof D)e.forEachNode(((e,n)=>{e instanceof _&&(this.addChild(e,t),t++)}),0);else{for(let n=0;n<e.getChildren().length;n++){const r=e.getChildren()[n];this.addChild(r,t),t++}-1===this.getSelected()&&this.children.length>0&&this.setSelected(0)}this.model.setActiveTabset(this,this.parent.getWindowId())}else{let n=e;if(e instanceof _){const t=this.model.getOnCreateTabSet();n=new C(this.model,t?t(e):{}),n.addChild(e),a=n}else if(e instanceof D){const r=this.getParent();if(e.getOrientation()===r.getOrientation()&&(t.getOrientation()===r.getOrientation()||t===f.CENTER)){const t=new D(this.model,this.getWindowId(),{});t.addChild(e),n=t}}else n=e;const r=this.parent,o=r.getChildren().indexOf(this);if(r.getOrientation()===i.orientation)n.setWeight(this.getWeight()/2),this.setWeight(this.getWeight()/2),r.addChild(n,o+i.indexPlus);else{const e=new D(this.model,this.getWindowId(),{});e.setWeight(this.getWeight()),e.addChild(this),this.setWeight(50),n.setWeight(50),e.addChild(n,i.indexPlus),r.removeChild(this),r.addChild(e,o)}n instanceof C&&this.model.setActiveTabset(n,this.getWindowId())}this.model.tidy()}updateAttrs(e){C.attributeDefinitions.update(e,this.attributes)}getAttributeDefinitions(){return C.attributeDefinitions}static getAttributeDefinitions(){return C.attributeDefinitions}static createAttributeDefinitions(){const e=new b;return e.add("type",C.TYPE,!0).setType(m.STRING).setFixed(),e.add("id",void 0).setType(m.STRING).setDescription("the unique id of the tab set, if left undefined a uuid will be assigned"),e.add("weight",100).setType(m.NUMBER).setDescription("relative weight for sizing of this tabset in parent row"),e.add("selected",0).setType(m.NUMBER).setDescription("index of selected/visible tab in tabset"),e.add("name",void 0).setType(m.STRING),e.add("config",void 0).setType("any").setDescription("a place to hold json config used in your own code"),e.addInherited("enableDeleteWhenEmpty","tabSetEnableDeleteWhenEmpty").setDescription("whether to delete this tabset when is has no tabs"),e.addInherited("enableDrop","tabSetEnableDrop").setDescription("allow user to drag tabs into this tabset"),e.addInherited("enableDrag","tabSetEnableDrag").setDescription("allow user to drag tabs out this tabset"),e.addInherited("enableDivide","tabSetEnableDivide").setDescription("allow user to drag tabs to region of this tabset, splitting into new tabset"),e.addInherited("enableMaximize","tabSetEnableMaximize").setDescription("allow user to maximize tabset to fill view via maximize button"),e.addInherited("enableClose","tabSetEnableClose").setDescription("allow user to close tabset via a close button"),e.addInherited("enableSingleTabStretch","tabSetEnableSingleTabStretch").setDescription("if the tabset has only a single tab then stretch the single tab to fill area and display in a header style"),e.addInherited("classNameTabStrip","tabSetClassNameTabStrip").setDescription("a class name to apply to the tab strip"),e.addInherited("enableTabStrip","tabSetEnableTabStrip").setDescription("enable tab strip and allow multiple tabs in this tabset"),e.addInherited("minWidth","tabSetMinWidth").setDescription("minimum width (in px) for this tabset"),e.addInherited("minHeight","tabSetMinHeight").setDescription("minimum height (in px) for this tabset"),e.addInherited("maxWidth","tabSetMaxWidth").setDescription("maximum width (in px) for this tabset"),e.addInherited("maxHeight","tabSetMaxHeight").setDescription("maximum height (in px) for this tabset"),e.addInherited("enableTabWrap","tabSetEnableTabWrap").setDescription("show tabs in location top or bottom"),e.addInherited("tabLocation","tabSetTabLocation").setDescription("the location of the tabs either top or bottom"),e.addInherited("autoSelectTab","tabSetAutoSelectTab").setType(m.BOOLEAN).setDescription("whether to select new/moved tabs in tabset"),e.addInherited("enableActiveIcon","tabSetEnableActiveIcon").setType(m.BOOLEAN).setDescription("whether the active icon (*) should be displayed when the tabset is active"),e}}C.TYPE="tabset",C.attributeDefinitions=C.createAttributeDefinitions();class D extends T{static fromJson(e,t,n){const r=new D(t,n.windowId,e);if(null!=e.children)for(const i of e.children)if(i.type===C.TYPE){const e=C.fromJson(i,t,n);r.addChild(e)}else{const e=D.fromJson(i,t,n);r.addChild(e)}return r}constructor(e,t,n){super(e),this.windowId=t,this.minHeight=I,this.minWidth=I,this.maxHeight=B,this.maxWidth=B,D.attributeDefinitions.fromJson(n,this.attributes),this.normalizeWeights(),e.addNode(this)}getWeight(){return this.attributes.weight}toJson(){const e={};D.attributeDefinitions.toJson(e,this.attributes),e.children=[];for(const t of this.children)e.children.push(t.toJson());return e}getWindowId(){return this.windowId}setWindowId(e){this.windowId=e}setWeight(e){this.attributes.weight=e}getSplitterBounds(e){const t=this.getOrientation()===d.HORZ,n=this.getChildren(),r=this.model.getSplitterSize(),i=n[0].getRect(),a=n[n.length-1].getRect();let o=t?[i.x,a.getRight()]:[i.y,a.getBottom()];const l=t?[i.x,a.getRight()]:[i.y,a.getBottom()];for(let i=0;i<e;i++){const e=n[i];o[0]+=t?e.getMinWidth():e.getMinHeight(),l[0]+=t?e.getMaxWidth():e.getMaxHeight(),i>0&&(o[0]+=r,l[0]+=r)}for(let i=n.length-1;i>=e;i--){const e=n[i];o[1]-=(t?e.getMinWidth():e.getMinHeight())+r,l[1]-=(t?e.getMaxWidth():e.getMaxHeight())+r}return o=[Math.max(l[1],o[0]),Math.min(l[0],o[1])],o}getSplitterInitials(e){const t=this.getOrientation()===d.HORZ,n=this.getChildren(),r=this.model.getSplitterSize(),i=[];let a=0;for(let e=0;e<n.length;e++){const r=n[e].getRect(),o=t?r.width:r.height;i.push(o),a+=o}const o=n[e].getRect();return{initialSizes:i,sum:a,startPosition:(t?o.x:o.y)-r}}calculateSplit(e,t,n,r,i){const a=this.getOrientation()===d.HORZ,o=this.getChildren(),l=o[e],s=a?l.getMaxWidth():l.getMaxHeight(),u=[...n];if(t<i){let n=i-t,r=0;u[e]+n>s?(r=u[e]+n-s,u[e]=s):u[e]+=n;for(let t=e-1;t>=0;t--){const e=o[t],r=a?e.getMinWidth():e.getMinHeight();if(u[t]-n>r){u[t]-=n;break}n-=u[t]-r,u[t]=r}for(let t=e+1;t<o.length;t++){const e=o[t],n=a?e.getMaxWidth():e.getMaxHeight();if(u[t]+r<n){u[t]+=r;break}r-=n-u[t],u[t]=n}}else{let n=t-i,r=0;u[e-1]+n>s?(r=u[e-1]+n-s,u[e-1]=s):u[e-1]+=n;for(let t=e;t<o.length;t++){const e=o[t],r=a?e.getMinWidth():e.getMinHeight();if(u[t]-n>r){u[t]-=n;break}n-=u[t]-r,u[t]=r}for(let t=e-1;t>=0;t--){const e=o[t],n=a?e.getMaxWidth():e.getMaxHeight();if(u[t]+r<n){u[t]+=r;break}r-=n-u[t],u[t]=n}}return u.map((e=>100*Math.max(.1,e)/r))}getMinSize(e){return e===d.HORZ?this.getMinWidth():this.getMinHeight()}getMinWidth(){return this.minWidth}getMinHeight(){return this.minHeight}getMaxSize(e){return e===d.HORZ?this.getMaxWidth():this.getMaxHeight()}getMaxWidth(){return this.maxWidth}getMaxHeight(){return this.maxHeight}calcMinMaxSize(){this.minHeight=I,this.minWidth=I,this.maxHeight=B,this.maxWidth=B;let e=!0;for(const t of this.children){const n=t;n.calcMinMaxSize(),this.getOrientation()===d.VERT?(this.minHeight+=n.getMinHeight(),this.maxHeight+=n.getMaxHeight(),e||(this.minHeight+=this.model.getSplitterSize(),this.maxHeight+=this.model.getSplitterSize()),this.minWidth=Math.max(this.minWidth,n.getMinWidth()),this.maxWidth=Math.min(this.maxWidth,n.getMaxWidth())):(this.minWidth+=n.getMinWidth(),this.maxWidth+=n.getMaxWidth(),e||(this.minWidth+=this.model.getSplitterSize(),this.maxWidth+=this.model.getSplitterSize()),this.minHeight=Math.max(this.minHeight,n.getMinHeight()),this.maxHeight=Math.min(this.maxHeight,n.getMaxHeight())),e=!1}}tidy(){let e=0;for(;e<this.children.length;){const t=this.children[e];if(t instanceof D){t.tidy();const n=t.getChildren();if(0===n.length)this.removeChild(t);else if(1===n.length){const r=n[0];if(this.removeChild(t),r instanceof D){let n=0;const i=r.getChildren();for(const e of i)n+=e.getWeight();for(let r=0;r<i.length;r++){const a=i[r];a.setWeight(t.getWeight()*a.getWeight()/n),this.addChild(a,e+r)}}else r.setWeight(t.getWeight()),this.addChild(r,e)}else e++}else t instanceof C&&0===t.getChildren().length&&t.isEnableDeleteWhenEmpty()?(this.removeChild(t),t===this.model.getMaximizedTabset(this.windowId)&&this.model.setMaximizedTabset(void 0,this.windowId)):e++}if(this===this.model.getRoot(this.windowId)&&0===this.children.length){const e=this.model.getOnCreateTabSet();let t=e?e():{};t=Object.assign(Object.assign({},t),{selected:-1});const n=new C(this.model,t);this.model.setActiveTabset(n,this.windowId),this.addChild(n)}}canDrop(e,t,n){const r=n-this.rect.y,i=t-this.rect.x,a=this.rect.width,o=this.rect.height,s=50;let u;if(this.getWindowId()===P.MAIN_WINDOW_ID||N(e)){if(this.model.isEnableEdgeDock()&&void 0===this.parent){if(t<this.rect.x+10&&r>o/2-s&&r<o/2+s){const e=f.LEFT,t=e.getDockRect(this.rect);t.width=t.width/2,u=new v(this,t,e,-1,l.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(t>this.rect.getRight()-10&&r>o/2-s&&r<o/2+s){const e=f.RIGHT,t=e.getDockRect(this.rect);t.width=t.width/2,t.x+=t.width,u=new v(this,t,e,-1,l.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(n<this.rect.y+10&&i>a/2-s&&i<a/2+s){const e=f.TOP,t=e.getDockRect(this.rect);t.height=t.height/2,u=new v(this,t,e,-1,l.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(n>this.rect.getBottom()-10&&i>a/2-s&&i<a/2+s){const e=f.BOTTOM,t=e.getDockRect(this.rect);t.height=t.height/2,t.y+=t.height,u=new v(this,t,e,-1,l.FLEXLAYOUT__OUTLINE_RECT_EDGE)}if(void 0!==u&&!e.canDockInto(e,u))return}return u}}drop(e,t,n){const r=t,i=e.getParent();let a;if(i&&i.removeChild(e),void 0!==i&&i instanceof C&&i.setSelected(0),void 0!==i&&i instanceof z&&i.setSelected(-1),e instanceof C||e instanceof D)a=e,a instanceof D&&a.getOrientation()===this.getOrientation()&&(t.getOrientation()===this.getOrientation()||t===f.CENTER)&&(a=new D(this.model,this.windowId,{}),a.addChild(e));else{const t=this.model.getOnCreateTabSet();a=new C(this.model,t?t(e):{}),a.addChild(e)}let o=this.children.reduce(((e,t)=>e+t.getWeight()),0);0===o&&(o=100),a.setWeight(o/3);const l=!this.model.isRootOrientationVertical();if(r===f.CENTER)-1===n?this.addChild(a,this.children.length):this.addChild(a,n);else if(l&&r===f.LEFT||!l&&r===f.TOP)this.addChild(a,0);else if(l&&r===f.RIGHT||!l&&r===f.BOTTOM)this.addChild(a);else if(l&&r===f.TOP||!l&&r===f.LEFT){const e=new D(this.model,this.windowId,{}),t=new D(this.model,this.windowId,{});t.setWeight(75),a.setWeight(25);for(const e of this.children)t.addChild(e);this.removeAll(),e.addChild(a),e.addChild(t),this.addChild(e)}else if(l&&r===f.BOTTOM||!l&&r===f.RIGHT){const e=new D(this.model,this.windowId,{}),t=new D(this.model,this.windowId,{});t.setWeight(75),a.setWeight(25);for(const e of this.children)t.addChild(e);this.removeAll(),e.addChild(t),e.addChild(a),this.addChild(e)}a instanceof C&&this.model.setActiveTabset(a,this.windowId),this.model.tidy()}isEnableDrop(){return!0}getAttributeDefinitions(){return D.attributeDefinitions}updateAttrs(e){D.attributeDefinitions.update(e,this.attributes)}static getAttributeDefinitions(){return D.attributeDefinitions}normalizeWeights(){let e=0;for(const t of this.children)e+=t.getWeight();0===e&&(e=1);for(const t of this.children){const n=t;n.setWeight(Math.max(.001,100*n.getWeight()/e))}}static createAttributeDefinitions(){const e=new b;return e.add("type",D.TYPE,!0).setType(m.STRING).setFixed(),e.add("id",void 0).setType(m.STRING).setDescription("the unique id of the row, if left undefined a uuid will be assigned"),e.add("weight",100).setType(m.NUMBER).setDescription("relative weight for sizing of this row in parent row"),e}}D.TYPE="row",D.attributeDefinitions=D.createAttributeDefinitions();class M{constructor(e,t){this._windowId=e,this._rect=t,this._toScreenRectFunction=e=>e}visitNodes(e){this.root.forEachNode(e,0)}get windowId(){return this._windowId}get rect(){return this._rect}get layout(){return this._layout}get window(){return this._window}get root(){return this._root}get maximizedTabSet(){return this._maximizedTabSet}get activeTabSet(){return this._activeTabSet}set rect(e){this._rect=e}set layout(e){this._layout=e}set window(e){this._window=e}set root(e){this._root=e}set maximizedTabSet(e){this._maximizedTabSet=e}set activeTabSet(e){this._activeTabSet=e}get toScreenRectFunction(){return this._toScreenRectFunction}set toScreenRectFunction(e){this._toScreenRectFunction=e}toJson(){return this._window&&this._window.screenTop>-1e4&&(this.rect=new h(this._window.screenLeft,this._window.screenTop,this._window.outerWidth,this._window.outerHeight)),{layout:this.root.toJson(),rect:this.rect.toJson()}}static fromJson(e,t,n){const r=t.getwindowsMap().size;let i=e.rect?h.fromJson(e.rect):new h(50+50*r,50+50*r,600,400);i=function(e){e.snap(10);const t=window.screen.availWidth,n=window.screen.availHeight;return(e.x+e.width>t||e.y+e.height>n)&&(e.x=Math.max(0,Math.min(e.x,t-e.width)),e.y=Math.max(0,Math.min(e.y,n-e.height))),e}(i);const a=new M(n,i);return a.root=D.fromJson(e.layout,t,a),a}}const I=0,B=99999;class P{constructor(){this.attributes={},this.idMap=new Map,this.borders=new y(this),this.windows=new Map,this.rootWindow=new M(P.MAIN_WINDOW_ID,h.empty()),this.windows.set(P.MAIN_WINDOW_ID,this.rootWindow),this.changeListeners=[]}doAction(e){var t;let n;switch(e.type){case g.ADD_NODE:{const t=new _(this,e.data.json,!0),r=this.idMap.get(e.data.toNode);(r instanceof C||r instanceof z||r instanceof D)&&(r.drop(t,f.getByName(e.data.location),e.data.index,e.data.select),n=t);break}case g.MOVE_NODE:{const t=this.idMap.get(e.data.fromNode);if(t instanceof _||t instanceof C||t instanceof D){t===this.getMaximizedTabset(t.getWindowId())&&(this.windows.get(t.getWindowId()).maximizedTabSet=void 0);const n=this.idMap.get(e.data.toNode);(n instanceof C||n instanceof z||n instanceof D)&&n.drop(t,f.getByName(e.data.location),e.data.index,e.data.select)}this.removeEmptyWindows();break}case g.DELETE_TAB:{const t=this.idMap.get(e.data.node);t instanceof _&&t.delete(),this.removeEmptyWindows();break}case g.DELETE_TABSET:{const t=this.idMap.get(e.data.node);if(t instanceof C){const e=[...t.getChildren()];for(let t=0;t<e.length;t++){const n=e[t];n.isEnableClose()&&n.delete()}0===t.getChildren().length&&t.delete(),this.tidy()}this.removeEmptyWindows();break}case g.POPOUT_TABSET:{const t=this.idMap.get(e.data.node);if(t instanceof C){const e=t.isMaximized(),n=this.windows.get(t.getWindowId()),r=k(),i=new M(r,n.toScreenRectFunction(t.getRect())),a={type:"row",children:[]},o=D.fromJson(a,this,i);i.root=o,this.windows.set(r,i),o.drop(t,f.CENTER,0),e&&(this.rootWindow.maximizedTabSet=void 0)}this.removeEmptyWindows();break}case g.POPOUT_TAB:{const t=this.idMap.get(e.data.node);if(t instanceof _){const e=k();let n=h.empty();n=t.getParent()instanceof C?t.getParent().getRect():t.getParent().getContentRect();const r=this.windows.get(t.getWindowId()),i=new M(e,r.toScreenRectFunction(n)),a=k(),o={type:"row",children:[{type:"tabset",id:a}]},l=D.fromJson(o,this,i);i.root=l,this.windows.set(e,i),this.idMap.get(a).drop(t,f.CENTER,0,!0)}this.removeEmptyWindows();break}case g.CLOSE_WINDOW:{const n=this.windows.get(e.data.windowId);n&&(null===(t=this.rootWindow.root)||void 0===t||t.drop(null==n?void 0:n.root,f.CENTER,-1),this.rootWindow.visitNodes(((e,t)=>{e instanceof D&&e.setWindowId(P.MAIN_WINDOW_ID)})),this.windows.delete(e.data.windowId));break}case g.CREATE_WINDOW:{const t=k(),r=new M(t,h.fromJson(e.data.rect)),i=D.fromJson(e.data.layout,this,r);r.root=i,this.windows.set(t,r),n=t;break}case g.RENAME_TAB:{const t=this.idMap.get(e.data.node);t instanceof _&&t.setName(e.data.text);break}case g.SELECT_TAB:{const t=this.idMap.get(e.data.tabNode),n=e.data.windowId?e.data.windowId:P.MAIN_WINDOW_ID,r=this.windows.get(n);if(t instanceof _){const e=t.getParent(),n=e.getChildren().indexOf(t);e instanceof z?e.getSelected()===n?e.setSelected(-1):e.setSelected(n):e instanceof C&&(e.getSelected()!==n&&e.setSelected(n),r.activeTabSet=e)}break}case g.SET_ACTIVE_TABSET:{const t=e.data.windowId?e.data.windowId:P.MAIN_WINDOW_ID,n=this.windows.get(t);if(void 0===e.data.tabsetNode)n.activeTabSet=void 0;else{const t=this.idMap.get(e.data.tabsetNode);t instanceof C&&(n.activeTabSet=t)}break}case g.ADJUST_WEIGHTS:{const t=this.idMap.get(e.data.nodeId).getChildren();for(let n=0;n<t.length;n++)t[n].setWeight(e.data.weights[n]);break}case g.ADJUST_BORDER_SPLIT:{const t=this.idMap.get(e.data.node);t instanceof z&&t.setSize(e.data.pos);break}case g.MAXIMIZE_TOGGLE:{const t=e.data.windowId?e.data.windowId:P.MAIN_WINDOW_ID,n=this.windows.get(t),r=this.idMap.get(e.data.node);r instanceof C&&(r===n.maximizedTabSet?n.maximizedTabSet=void 0:(n.maximizedTabSet=r,n.activeTabSet=r));break}case g.UPDATE_MODEL_ATTRIBUTES:this.updateAttrs(e.data.json);break;case g.UPDATE_NODE_ATTRIBUTES:this.idMap.get(e.data.node).updateAttrs(e.data.json)}this.updateIdMap();for(const t of this.changeListeners)t(e);return n}getActiveTabset(e=P.MAIN_WINDOW_ID){const t=this.windows.get(e);return t&&t.activeTabSet&&this.getNodeById(t.activeTabSet.getId())?t.activeTabSet:void 0}getMaximizedTabset(e=P.MAIN_WINDOW_ID){return this.windows.get(e).maximizedTabSet}getRoot(e=P.MAIN_WINDOW_ID){return this.windows.get(e).root}isRootOrientationVertical(){return this.attributes.rootOrientationVertical}isEnableRotateBorderIcons(){return this.attributes.enableRotateBorderIcons}getBorderSet(){return this.borders}getwindowsMap(){return this.windows}visitNodes(e){this.borders.forEachNode(e);for(const[t,n]of this.windows)n.root.forEachNode(e,0)}visitWindowNodes(e,t){this.windows.has(e)&&(e===P.MAIN_WINDOW_ID&&this.borders.forEachNode(t),this.windows.get(e).visitNodes(t))}getNodeById(e){return this.idMap.get(e)}getFirstTabSet(e=this.windows.get(P.MAIN_WINDOW_ID).root){const t=e.getChildren()[0];return t instanceof C?t:this.getFirstTabSet(t)}static fromJson(e){const t=new P;if(P.attributeDefinitions.fromJson(e.global,t.attributes),e.borders&&(t.borders=y.fromJson(e.borders,t)),e.popouts){let n=0,r=100,i=100;for(const a in e.popouts){const o=e.popouts[a],l=M.fromJson(o,t,a);t.windows.set(a,l),A(l.rect)||(l.rect=new h(r+50*n,i+50*n,600,400),n++)}}return t.rootWindow.root=D.fromJson(e.layout,t,t.getwindowsMap().get(P.MAIN_WINDOW_ID)),t.tidy(),t}toJson(){const e={};P.attributeDefinitions.toJson(e,this.attributes),this.visitNodes((e=>{e.fireEvent("save",{})}));const t={};for(const[e,n]of this.windows)e!==P.MAIN_WINDOW_ID&&(t[e]=n.toJson());return{global:e,borders:this.borders.toJson(),layout:this.rootWindow.root.toJson(),popouts:t}}getSplitterSize(){return this.attributes.splitterSize}getSplitterExtra(){return this.attributes.splitterExtra}isEnableEdgeDock(){return this.attributes.enableEdgeDock}isSplitterEnableHandle(){return this.attributes.splitterEnableHandle}setOnAllowDrop(e){this.onAllowDrop=e}setOnCreateTabSet(e){this.onCreateTabSet=e}addChangeListener(e){this.changeListeners.push(e)}removeChangeListener(e){const t=this.changeListeners.findIndex((t=>t===e));-1!==t&&this.changeListeners.splice(t,1)}toString(){return JSON.stringify(this.toJson())}removeEmptyWindows(){const e=new Set;for(const[t]of this.windows)if(t!==P.MAIN_WINDOW_ID){let n=0;this.visitWindowNodes(t,(e=>{e instanceof _&&n++})),0===n&&e.add(t)}for(const t of e)this.windows.delete(t)}setActiveTabset(e,t){const n=this.windows.get(t);n&&(n.activeTabSet=e||void 0)}setMaximizedTabset(e,t){const n=this.windows.get(t);n&&(n.maximizedTabSet=e||void 0)}updateIdMap(){this.idMap.clear(),this.visitNodes((e=>{this.idMap.set(e.getId(),e)}))}addNode(e){const t=e.getId();if(this.idMap.has(t))throw new Error(`Error: each node must have a unique id, duplicate id:${e.getId()}`);this.idMap.set(t,e)}findDropTargetNode(e,t,n,r){let i=this.windows.get(e).root.findDropTargetNode(e,t,n,r);return void 0===i&&e===P.MAIN_WINDOW_ID&&(i=this.borders.findDropTargetNode(t,n,r)),i}tidy(){for(const[e,t]of this.windows)t.root.tidy()}updateAttrs(e){P.attributeDefinitions.update(e,this.attributes)}nextUniqueId(){return"#"+k()}getAttribute(e){return this.attributes[e]}getOnAllowDrop(){return this.onAllowDrop}getOnCreateTabSet(){return this.onCreateTabSet}static toTypescriptInterfaces(){P.attributeDefinitions.pairAttributes("RowNode",D.getAttributeDefinitions()),P.attributeDefinitions.pairAttributes("TabSetNode",C.getAttributeDefinitions()),P.attributeDefinitions.pairAttributes("TabNode",_.getAttributeDefinitions()),P.attributeDefinitions.pairAttributes("BorderNode",z.getAttributeDefinitions());let e=[];e.push(P.attributeDefinitions.toTypescriptInterface("Global",void 0)),e.push(D.getAttributeDefinitions().toTypescriptInterface("Row",P.attributeDefinitions)),e.push(C.getAttributeDefinitions().toTypescriptInterface("TabSet",P.attributeDefinitions)),e.push(_.getAttributeDefinitions().toTypescriptInterface("Tab",P.attributeDefinitions)),e.push(z.getAttributeDefinitions().toTypescriptInterface("Border",P.attributeDefinitions)),console.log(e.join("\n"))}static createAttributeDefinitions(){const e=new b;return e.add("enableEdgeDock",!0).setType(m.BOOLEAN).setDescription("enable docking to the edges of the layout, this will show the edge indicators"),e.add("rootOrientationVertical",!1).setType(m.BOOLEAN).setDescription("the top level 'row' will layout horizontally by default, set this option true to make it layout vertically"),e.add("enableRotateBorderIcons",!0).setType(m.BOOLEAN).setDescription("boolean indicating if tab icons should rotate with the text in the left and right borders"),e.add("splitterSize",8).setType(m.NUMBER).setDescription("width in pixels of all splitters between tabsets/borders"),e.add("splitterExtra",0).setType(m.NUMBER).setDescription("additional width in pixels of the splitter hit test area"),e.add("splitterEnableHandle",!1).setType(m.BOOLEAN).setDescription("enable a small centralized handle on all splitters"),e.add("tabEnableClose",!0).setType(m.BOOLEAN),e.add("tabCloseType",1).setType("ICloseType"),e.add("tabEnablePopout",!1).setType(m.BOOLEAN).setAlias("tabEnableFloat"),e.add("tabEnablePopoutIcon",!0).setType(m.BOOLEAN),e.add("tabEnablePopoutOverlay",!1).setType(m.BOOLEAN),e.add("tabEnableDrag",!0).setType(m.BOOLEAN),e.add("tabEnableRename",!0).setType(m.BOOLEAN),e.add("tabContentClassName",void 0).setType(m.STRING),e.add("tabClassName",void 0).setType(m.STRING),e.add("tabIcon",void 0).setType(m.STRING),e.add("tabEnableRenderOnDemand",!0).setType(m.BOOLEAN),e.add("tabDragSpeed",.3).setType(m.NUMBER),e.add("tabBorderWidth",-1).setType(m.NUMBER),e.add("tabBorderHeight",-1).setType(m.NUMBER),e.add("tabSetEnableDeleteWhenEmpty",!0).setType(m.BOOLEAN),e.add("tabSetEnableDrop",!0).setType(m.BOOLEAN),e.add("tabSetEnableDrag",!0).setType(m.BOOLEAN),e.add("tabSetEnableDivide",!0).setType(m.BOOLEAN),e.add("tabSetEnableMaximize",!0).setType(m.BOOLEAN),e.add("tabSetEnableClose",!1).setType(m.BOOLEAN),e.add("tabSetEnableSingleTabStretch",!1).setType(m.BOOLEAN),e.add("tabSetAutoSelectTab",!0).setType(m.BOOLEAN),e.add("tabSetEnableActiveIcon",!1).setType(m.BOOLEAN),e.add("tabSetClassNameTabStrip",void 0).setType(m.STRING),e.add("tabSetEnableTabStrip",!0).setType(m.BOOLEAN),e.add("tabSetEnableTabWrap",!1).setType(m.BOOLEAN),e.add("tabSetTabLocation","top").setType("ITabLocation"),e.add("tabMinWidth",I).setType(m.NUMBER),e.add("tabMinHeight",I).setType(m.NUMBER),e.add("tabSetMinWidth",I).setType(m.NUMBER),e.add("tabSetMinHeight",I).setType(m.NUMBER),e.add("tabMaxWidth",B).setType(m.NUMBER),e.add("tabMaxHeight",B).setType(m.NUMBER),e.add("tabSetMaxWidth",B).setType(m.NUMBER),e.add("tabSetMaxHeight",B).setType(m.NUMBER),e.add("borderSize",200).setType(m.NUMBER),e.add("borderMinSize",I).setType(m.NUMBER),e.add("borderMaxSize",B).setType(m.NUMBER),e.add("borderEnableDrop",!0).setType(m.BOOLEAN),e.add("borderAutoSelectTabWhenOpen",!0).setType(m.BOOLEAN),e.add("borderAutoSelectTabWhenClosed",!1).setType(m.BOOLEAN),e.add("borderClassName",void 0).setType(m.STRING),e.add("borderEnableAutoHide",!1).setType(m.BOOLEAN),e}}P.MAIN_WINDOW_ID="__main_window_id__",P.attributeDefinitions=P.createAttributeDefinitions();class z extends T{static fromJson(e,t){const n=f.getByName(e.location),r=new z(n,e,t);return e.children&&(r.children=e.children.map((e=>{const n=_.fromJson(e,t);return n.setParent(r),n}))),r}constructor(e,t,n){super(n),this.outerRect=h.empty(),this.contentRect=h.empty(),this.tabHeaderRect=h.empty(),this.location=e,this.attributes.id=`border_${e.getName()}`,z.attributeDefinitions.fromJson(t,this.attributes),n.addNode(this)}getLocation(){return this.location}getClassName(){return this.getAttr("className")}isHorizontal(){return this.location.orientation===d.HORZ}getSize(){const e=this.getAttr("size"),t=this.getSelected();if(-1===t)return e;{const n=this.children[t],r=this.isHorizontal()?n.getAttr("borderWidth"):n.getAttr("borderHeight");return-1===r?e:r}}getMinSize(){const e=this.getSelectedNode();let t=this.getAttr("minSize");if(e){const n=this.isHorizontal()?e.getMinWidth():e.getMinHeight();t=Math.max(t,n)}return t}getMaxSize(){const e=this.getSelectedNode();let t=this.getAttr("maxSize");if(e){const n=this.isHorizontal()?e.getMaxWidth():e.getMaxHeight();t=Math.min(t,n)}return t}getSelected(){return this.attributes.selected}isAutoHide(){return this.getAttr("enableAutoHide")}getSelectedNode(){if(-1!==this.getSelected())return this.children[this.getSelected()]}getOrientation(){return this.location.getOrientation()}getConfig(){return this.attributes.config}isMaximized(){return!1}isShowing(){return this.attributes.show}toJson(){const e={};return z.attributeDefinitions.toJson(e,this.attributes),e.location=this.location.getName(),e.children=this.children.map((e=>e.toJson())),e}isAutoSelectTab(e){return null==e&&(e=-1!==this.getSelected()),e?this.getAttr("autoSelectTabWhenOpen"):this.getAttr("autoSelectTabWhenClosed")}setSelected(e){this.attributes.selected=e}getTabHeaderRect(){return this.tabHeaderRect}setTabHeaderRect(e){this.tabHeaderRect=e}getOuterRect(){return this.outerRect}setOuterRect(e){this.outerRect=e}getRect(){return this.tabHeaderRect}getContentRect(){return this.contentRect}setContentRect(e){this.contentRect=e}isEnableDrop(){return this.getAttr("enableDrop")}setSize(e){const t=this.getSelected();if(-1===t)this.attributes.size=e;else{const n=this.children[t];-1===(this.isHorizontal()?n.getAttr("borderWidth"):n.getAttr("borderHeight"))?this.attributes.size=e:this.isHorizontal()?n.setBorderWidth(e):n.setBorderHeight(e)}}updateAttrs(e){z.attributeDefinitions.update(e,this.attributes)}remove(e){const t=this.removeChild(e);-1!==this.getSelected()&&x(this,t)}canDrop(e,t,n){if(!(e instanceof _))return;let r;const i=f.CENTER;if(this.tabHeaderRect.contains(t,n)){if(this.location.orientation===d.VERT)if(this.children.length>0){let e=this.children[0],n=e.getTabRect();const a=n.y,o=n.height;let s=this.tabHeaderRect.x,u=0;for(let c=0;c<this.children.length;c++){if(e=this.children[c],n=e.getTabRect(),u=n.x+n.width/2,t>=s&&t<u){const e=new h(n.x-2,a,3,o);r=new v(this,e,i,c,l.FLEXLAYOUT__OUTLINE_RECT);break}s=u}if(null==r){const e=new h(n.getRight()-2,a,3,o);r=new v(this,e,i,this.children.length,l.FLEXLAYOUT__OUTLINE_RECT)}}else{const e=new h(this.tabHeaderRect.x+1,this.tabHeaderRect.y+2,3,18);r=new v(this,e,i,0,l.FLEXLAYOUT__OUTLINE_RECT)}else if(this.children.length>0){let e=this.children[0],t=e.getTabRect();const a=t.x,o=t.width;let s=this.tabHeaderRect.y,u=0;for(let c=0;c<this.children.length;c++){if(e=this.children[c],t=e.getTabRect(),u=t.y+t.height/2,n>=s&&n<u){const e=new h(a,t.y-2,o,3);r=new v(this,e,i,c,l.FLEXLAYOUT__OUTLINE_RECT);break}s=u}if(null==r){const e=new h(a,t.getBottom()-2,o,3);r=new v(this,e,i,this.children.length,l.FLEXLAYOUT__OUTLINE_RECT)}}else{const e=new h(this.tabHeaderRect.x+2,this.tabHeaderRect.y+1,18,3);r=new v(this,e,i,0,l.FLEXLAYOUT__OUTLINE_RECT)}if(!e.canDockInto(e,r))return}else if(-1!==this.getSelected()&&this.outerRect.contains(t,n)){const t=this.outerRect;if(r=new v(this,t,i,-1,l.FLEXLAYOUT__OUTLINE_RECT),!e.canDockInto(e,r))return}return r}drop(e,t,n,r){let i=0;const a=e.getParent();void 0!==a&&(i=a.removeChild(e),a!==this&&a instanceof z&&a.getSelected()===i?a.setSelected(-1):x(a,i)),e instanceof _&&a===this&&i<n&&n>0&&n--;let o=n;-1===o&&(o=this.children.length),e instanceof _&&this.addChild(e,o),(r||!1!==r&&this.isAutoSelectTab())&&this.setSelected(o),this.model.tidy()}getSplitterBounds(e,t=!1){const n=[0,0],r=t?this.getMinSize():0,i=t?this.getMaxSize():99999,a=this.model.getRoot(P.MAIN_WINDOW_ID),o=a.getRect(),l=this.model.getSplitterSize();if(this.location===f.TOP){n[0]=this.tabHeaderRect.getBottom()+r;const e=this.tabHeaderRect.getBottom()+i;n[1]=Math.max(n[0],o.getBottom()-a.getMinHeight()-l),n[1]=Math.min(n[1],e)}else if(this.location===f.LEFT){n[0]=this.tabHeaderRect.getRight()+r;const e=this.tabHeaderRect.getRight()+i;n[1]=Math.max(n[0],o.getRight()-a.getMinWidth()-l),n[1]=Math.min(n[1],e)}else if(this.location===f.BOTTOM){n[1]=this.tabHeaderRect.y-r-l;const e=this.tabHeaderRect.y-i-l;n[0]=Math.min(n[1],o.y+a.getMinHeight()),n[0]=Math.max(n[0],e)}else if(this.location===f.RIGHT){n[1]=this.tabHeaderRect.x-r-l;const e=this.tabHeaderRect.x-i-l;n[0]=Math.min(n[1],o.x+a.getMinWidth()),n[0]=Math.max(n[0],e)}return n}calculateSplit(e,t){const n=this.getSplitterBounds(t);return this.location===f.BOTTOM||this.location===f.RIGHT?Math.max(0,n[1]-t):Math.max(0,t-n[0])}getAttributeDefinitions(){return z.attributeDefinitions}static getAttributeDefinitions(){return z.attributeDefinitions}static createAttributeDefinitions(){const e=new b;return e.add("type",z.TYPE,!0).setType(m.STRING).setFixed(),e.add("selected",-1).setType(m.NUMBER).setDescription("index of selected/visible tab in border; -1 means no tab selected"),e.add("show",!0).setType(m.BOOLEAN).setDescription("show/hide this border"),e.add("config",void 0).setType("any").setDescription("a place to hold json config used in your own code"),e.addInherited("enableDrop","borderEnableDrop").setType(m.BOOLEAN).setDescription("whether tabs can be dropped into this border"),e.addInherited("className","borderClassName").setType(m.STRING).setDescription("class applied to tab button"),e.addInherited("autoSelectTabWhenOpen","borderAutoSelectTabWhenOpen").setType(m.BOOLEAN).setDescription("whether to select new/moved tabs in border when the border is already open"),e.addInherited("autoSelectTabWhenClosed","borderAutoSelectTabWhenClosed").setType(m.BOOLEAN).setDescription("whether to select new/moved tabs in border when the border is currently closed"),e.addInherited("size","borderSize").setType(m.NUMBER).setDescription("size of the tab area when selected"),e.addInherited("minSize","borderMinSize").setType(m.NUMBER).setDescription("the minimum size of the tab area"),e.addInherited("maxSize","borderMaxSize").setType(m.NUMBER).setDescription("the maximum size of the tab area"),e.addInherited("enableAutoHide","borderEnableAutoHide").setType(m.BOOLEAN).setDescription("hide border if it has zero tabs"),e}}z.TYPE="border",z.attributeDefinitions=z.createAttributeDefinitions();const U=e=>{const{layout:t,node:n,index:r,horizontal:i}=e,[a,o]=s.useState(!1),u=s.useRef(null),c=s.useRef(null),f=s.useRef([]),p=s.useRef(void 0),m=s.useRef(void 0),b=s.useRef(0),v=s.useRef(0),y=s.useRef({initialSizes:[],sum:0,startPosition:0}),T=n.getModel().getSplitterSize();let _=n.getModel().getSplitterExtra();E()||(_=Math.max(30,_+T)-T),s.useEffect((()=>{var e,t;return null===(e=u.current)||void 0===e||e.addEventListener("touchstart",w,{passive:!1}),null===(t=c.current)||void 0===t||t.addEventListener("touchstart",w,{passive:!1}),()=>{var e,t;null===(e=u.current)||void 0===e||e.removeEventListener("touchstart",w),null===(t=c.current)||void 0===t||t.removeEventListener("touchstart",w)}}),[]);const w=e=>{e.preventDefault(),e.stopImmediatePropagation()},S=e=>{var a;e.stopPropagation(),n instanceof D&&(y.current=n.getSplitterInitials(r)),L(!1,t.getCurrentDocument()),function(e,t,n,r,i){t.preventDefault();const a=e=>{e.preventDefault(),n(e.clientX,e.clientY)},o=e=>{e.preventDefault(),i()},l=()=>{e.removeEventListener("pointermove",a),e.removeEventListener("pointerup",l),e.removeEventListener("pointercancel",o),r()};e.addEventListener("pointermove",a),e.addEventListener("pointerup",l),e.addEventListener("pointercancel",o)}(e.currentTarget.ownerDocument,e,N,A,O),f.current=n.getSplitterBounds(r,!0);const s=t.getRootDiv();p.current=t.getCurrentDocument().createElement("div"),p.current.style.flexDirection=i?"row":"column",p.current.className=t.getClassName(l.FLEXLAYOUT__SPLITTER_DRAG),p.current.style.cursor=n.getOrientation()===d.VERT?"ns-resize":"ew-resize",n.getModel().isSplitterEnableHandle()&&(m.current=t.getCurrentDocument().createElement("div"),m.current.className=k(l.FLEXLAYOUT__SPLITTER_HANDLE)+" "+k(i?l.FLEXLAYOUT__SPLITTER_HANDLE_HORZ:l.FLEXLAYOUT__SPLITTER_HANDLE_VERT),p.current.appendChild(m.current));const c=null===(a=u.current)||void 0===a?void 0:a.getBoundingClientRect(),g=new h(c.x-t.getDomRect().x,c.y-t.getDomRect().y,c.width,c.height);b.current=e.clientX-c.x,v.current=e.clientY-c.y,g.positionElement(p.current),s&&s.appendChild(p.current),o(!0)},O=()=>{const e=t.getRootDiv();e&&p.current&&e.removeChild(p.current),p.current=void 0,o(!1)},N=(e,r)=>{if(p.current){const i=t.getDomRect();if(!i)return;n.getOrientation()===d.VERT?p.current.style.top=x(r-i.y-v.current)+"px":p.current.style.left=x(e-i.x-b.current)+"px",t.isRealtimeResize()&&R(!0)}},A=()=>{if(p.current){R(!1);const e=t.getRootDiv();e&&p.current&&e.removeChild(p.current),p.current=void 0}L(!0,t.getCurrentDocument()),o(!1)},R=e=>{(()=>{if(p.current){let e=0;if(e=n.getOrientation()===d.VERT?p.current.offsetTop:p.current.offsetLeft,n instanceof z){const r=n.calculateSplit(n,e);t.doAction(g.adjustBorderSplit(n.getId(),r))}else{const i=y.current,a=n.calculateSplit(r,e,i.initialSizes,i.sum,i.startPosition);t.doAction(g.adjustWeights(n.getId(),a))}}})()},x=e=>{const t=f.current;let n=e;return e<t[0]&&(n=t[0]),e>t[1]&&(n=t[1]),n},k=t.getClassName,C={cursor:i?"ew-resize":"ns-resize",flexDirection:i?"column":"row"};let M,I=k(l.FLEXLAYOUT__SPLITTER)+" "+k(l.FLEXLAYOUT__SPLITTER_+n.getOrientation().getName());if(n instanceof z?I+=" "+k(l.FLEXLAYOUT__SPLITTER_BORDER):void 0!==n.getModel().getMaximizedTabset(t.getWindowId())&&(C.display="none"),i?(C.width=T+"px",C.minWidth=T+"px"):(C.height=T+"px",C.minHeight=T+"px"),!a&&n.getModel().isSplitterEnableHandle()&&(M=s.createElement("div",{className:k(l.FLEXLAYOUT__SPLITTER_HANDLE)+" "+k(i?l.FLEXLAYOUT__SPLITTER_HANDLE_HORZ:l.FLEXLAYOUT__SPLITTER_HANDLE_VERT)})),0===_)return s.createElement("div",{className:I,style:C,ref:u,"data-layout-path":n.getPath()+"/s"+(r-1),onPointerDown:S},M);{const e={};n.getOrientation()===d.HORZ?(e.height="100%",e.width=T+_+"px",e.cursor="ew-resize"):(e.height=T+_+"px",e.width="100%",e.cursor="ns-resize");const t=k(l.FLEXLAYOUT__SPLITTER_EXTRA);return s.createElement("div",{className:I,style:C,ref:u,"data-layout-path":n.getPath()+"/s"+(r-1),onPointerDown:S},s.createElement("div",{style:e,ref:c,className:t,onPointerDown:S}))}};function F(e){const{layout:t,border:n,show:r}=e,i=s.useRef(null);s.useLayoutEffect((()=>{const e=t.getBoundingClientRect(i.current),r=h.getContentRect(i.current).relativeTo(t.getDomRect());e.width>0&&(n.setOuterRect(e),n.getContentRect().equals(r)||(n.setContentRect(r),t.redrawInternal("border content rect")))}));let a=!0;const o={};n.getOrientation()===d.HORZ?(o.width=n.getSize(),o.minWidth=n.getMinSize(),o.maxWidth=n.getMaxSize()):(o.height=n.getSize(),o.minHeight=n.getMinSize(),o.maxHeight=n.getMaxSize(),a=!1),o.display=r?"flex":"none";const u=t.getClassName(l.FLEXLAYOUT__BORDER_TAB_CONTENTS);return n.getLocation()===f.LEFT||n.getLocation()===f.TOP?s.createElement(s.Fragment,null,s.createElement("div",{ref:i,style:o,className:u}),r&&s.createElement(U,{layout:t,node:n,index:0,horizontal:a})):s.createElement(s.Fragment,null,r&&s.createElement(U,{layout:t,node:n,index:0,horizontal:a}),s.createElement("div",{ref:i,style:o,className:u}))}var W;!function(e){e[e.Visible=1]="Visible",e[e.Always=2]="Always",e[e.Selected=3]="Selected"}(W||(W={}));const H=e=>{const{layout:t,node:n,selected:r,border:i,icons:a,path:u}=e,c=s.useRef(null),d=s.useRef(null),h=()=>{t.doAction(g.selectTab(n.getId()))},f=e=>{(()=>{const e=n.getCloseType();return!!(r||e===W.Always||e===W.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches)})()?t.doAction(g.deleteTab(n.getId())):h()},p=e=>{e.stopPropagation()};s.useLayoutEffect((()=>{n.setTabRect(t.getBoundingClientRect(c.current)),t.getEditingTab()===n&&d.current.select()}));const m=t.getClassName;let b=m(l.FLEXLAYOUT__BORDER_BUTTON)+" "+m(l.FLEXLAYOUT__BORDER_BUTTON_+i);b+=r?" "+m(l.FLEXLAYOUT__BORDER_BUTTON__SELECTED):" "+m(l.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED),void 0!==n.getClassName()&&(b+=" "+n.getClassName());let v=0;!1===n.getModel().isEnableRotateBorderIcons()&&("left"===i?v=90:"right"===i&&(v=-90));const y=w(t,n,v);let T=y.content?s.createElement("div",{className:m(l.FLEXLAYOUT__BORDER_BUTTON_CONTENT)},y.content):null;const _=y.leading?s.createElement("div",{className:m(l.FLEXLAYOUT__BORDER_BUTTON_LEADING)},y.leading):null;if(t.getEditingTab()===n&&(T=s.createElement("input",{ref:d,className:m(l.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":u+"/textbox",type:"text",autoFocus:!0,defaultValue:n.getName(),onKeyDown:e=>{"Escape"===e.code?t.setEditingTab(void 0):"Enter"===e.code&&(t.setEditingTab(void 0),t.doAction(g.renameTab(n.getId(),e.target.value)))},onPointerDown:e=>{e.stopPropagation()}})),n.isEnableClose()){const e=t.i18nName(o.Close_Tab);y.buttons.push(s.createElement("div",{key:"close","data-layout-path":u+"/button/close",title:e,className:m(l.FLEXLAYOUT__BORDER_BUTTON_TRAILING),onPointerDown:p,onClick:f},"function"==typeof a.close?a.close(n):a.close))}return s.createElement("div",{ref:c,"data-layout-path":u,className:b,onClick:h,onAuxClick:e=>{S(e)&&t.auxMouseClick(n,e)},onContextMenu:e=>{t.showContextMenu(n,e)},title:n.getHelpText(),draggable:!0,onDragStart:e=>{n.isEnableDrag()?(e.stopPropagation(),t.setDragNode(e.nativeEvent,n)):e.preventDefault()},onDragEnd:e=>{e.stopPropagation(),t.clearDragMain()}},_,T,y.buttons)},Y=e=>{const{layout:t,node:n}=e,r=t.getClassName;let i=r(l.FLEXLAYOUT__TAB_BUTTON_STAMP);const a=w(t,n);let o=a.content?s.createElement("div",{className:r(l.FLEXLAYOUT__TAB_BUTTON_CONTENT)},a.content):n.getNameForOverflowMenu();const u=a.leading?s.createElement("div",{className:r(l.FLEXLAYOUT__TAB_BUTTON_LEADING)},a.leading):null;return s.createElement("div",{className:i,title:n.getHelpText()},u,o)};function X(e,t,n,r){var i;const a=r.getRootDiv(),o=r.getClassName,u=e.ownerDocument,c=e.getBoundingClientRect(),d=null!==(i=null==a?void 0:a.getBoundingClientRect())&&void 0!==i?i:new DOMRect(0,0,100,100),h=u.createElement("div");h.className=o(l.FLEXLAYOUT__POPUP_MENU_CONTAINER),c.left<d.left+d.width/2?h.style.left=c.left-d.left+"px":h.style.right=d.right-c.right+"px",c.top<d.top+d.height/2?h.style.top=c.top-d.top+"px":h.style.bottom=d.bottom-c.bottom+"px",r.showOverlay(!0),a&&a.appendChild(h);const f=()=>{r.hideControlInPortal(),r.showOverlay(!1),a&&a.removeChild(h),h.removeEventListener("pointerdown",p),u.removeEventListener("pointerdown",g)},p=e=>{e.stopPropagation()},g=e=>{f()};h.addEventListener("pointerdown",p),u.addEventListener("pointerdown",g),r.showControlInPortal(s.createElement(V,{currentDocument:u,onSelect:n,onHide:f,items:t,classNameMapper:o,layout:r}),h)}const V=e=>{const{items:t,onHide:n,onSelect:r,classNameMapper:i,layout:a}=e,o=e=>{a.clearDragMain()},u=t.map(((e,t)=>s.createElement("div",{key:e.index,className:i(l.FLEXLAYOUT__POPUP_MENU_ITEM),"data-layout-path":"/popup-menu/tb"+t,onClick:t=>((e,t)=>{r(e),n(),t.stopPropagation()})(e,t),draggable:!0,onDragStart:t=>{return r=t,i=e.node,r.stopPropagation(),a.setDragNode(r.nativeEvent,i),void setTimeout((()=>{n()}),0);var r,i},onDragEnd:o,title:e.node.getHelpText()},s.createElement(Y,{node:e.node,layout:a}))));return s.createElement("div",{className:i(l.FLEXLAYOUT__POPUP_MENU),"data-layout-path":"/popup-menu"},u)},j=(e,t,n,r)=>{const i=s.useRef(!0),a=s.useRef(!1),o=s.useRef(h.empty()),l=s.useRef(null),[u,c]=s.useState(0),f=s.useRef(!1),[p,g]=s.useState([]),m=s.useRef(0);s.useLayoutEffect((()=>{f.current=!1}),[e.getSelectedNode(),e.getRect().width,e.getRect().height]),s.useLayoutEffect((()=>{const t=e instanceof C?e.getRect():e.getTabHeaderRect();t.width>0&&t.height>0&&E()}));const b=n.current;s.useEffect((()=>{if(b)return b.addEventListener("wheel",v,{passive:!1}),()=>{b.removeEventListener("wheel",v)}}),[b]);const v=e=>{e.preventDefault()},y=e=>t===d.HORZ?e.x:e.y,T=e=>t===d.HORZ?e.getRight():e.getBottom(),_=e=>t===d.HORZ?e.width:e.height,E=()=>{!0===i.current&&(a.current=!1);const t=e instanceof C?e.getRect():e.getTabHeaderRect();let l=e.getChildren()[e.getChildren().length-1];const s=null===r.current?0:_(r.current.getBoundingClientRect());if(!0===i.current||0===m.current&&0!==p.length||t.width!==o.current.width||t.height!==o.current.height){m.current=p.length,o.current=t;const r=!(e instanceof C)||!0===e.isEnableTabStrip();let d=T(t)-s;if(null!==n.current&&(d-=_(n.current.getBoundingClientRect())),r&&e.getChildren().length>0){if(0===p.length&&0===u&&T(l.getTabRect())+2<d)return;let n=0;const r=e.getSelectedNode();if(r&&!f.current){const e=r.getTabRect(),i=y(e)-2,a=T(e)+2;_(e)+4>=d-y(t)?n=y(t)-i:(a>d||i<y(t))&&(i<y(t)&&(n=y(t)-i),a+n>d&&(n=d-a))}const o=Math.max(0,d-(T(l.getTabRect())+2+n)),s=Math.min(0,u+n+o),h=s-u,m=[];for(let n=0;n<e.getChildren().length;n++){const r=e.getChildren()[n];(y(r.getTabRect())+h<y(t)||T(r.getTabRect())+h>d)&&m.push({node:r,index:n})}a.current=m.length>0,i.current=!1,g(m),c(s)}}else i.current=!0};return{selfRef:l,position:u,userControlledLeft:f,hiddenTabs:p,onMouseWheel:e=>{let t=0;t=Math.abs(e.deltaX)>Math.abs(e.deltaY)?-e.deltaX:-e.deltaY,1===e.deltaMode&&(t*=40),c(u+t),f.current=!0,e.stopPropagation()},tabsTruncated:a.current}},G=e=>{const{border:t,layout:n,size:r}=e,i=s.useRef(null),a=s.useRef(null),u=s.useRef(null),c=n.getIcons();s.useLayoutEffect((()=>{t.setTabHeaderRect(h.getBoundingClientRect(p.current).relativeTo(n.getDomRect()))}));const{selfRef:p,position:m,userControlledLeft:b,hiddenTabs:v,onMouseWheel:y,tabsTruncated:T}=j(t,d.flip(t.getOrientation()),i,u),_=e=>{S(e)&&n.auxMouseClick(t,e)},E=e=>{e.stopPropagation()},w=e=>{const r=n.getShowOverflowMenu();void 0!==r?r(t,e,v,L):X(a.current,v,L,n),e.stopPropagation()},L=e=>{n.doAction(g.selectTab(e.node.getId())),b.current=!1},O=e=>{const r=t.getChildren()[t.getSelected()];void 0!==r&&n.doAction(g.popoutTab(r.getId())),e.stopPropagation()},N=n.getClassName,A=[],R=e=>{let r=t.getSelected()===e,i=t.getChildren()[e];A.push(s.createElement(H,{layout:n,border:t.getLocation().getName(),node:i,path:t.getPath()+"/tb"+e,key:i.getId(),selected:r,icons:c})),e<t.getChildren().length-1&&A.push(s.createElement("div",{key:"divider"+e,className:N(l.FLEXLAYOUT__BORDER_TAB_DIVIDER)}))};for(let e=0;e<t.getChildren().length;e++)R(e);let x=N(l.FLEXLAYOUT__BORDER)+" "+N(l.FLEXLAYOUT__BORDER_+t.getLocation().getName());void 0!==t.getClassName()&&(x+=" "+t.getClassName());let k=[],C=[];const D={buttons:k,stickyButtons:C,overflowPosition:void 0};if(n.customizeTabSet(t,D),k=D.buttons,void 0===D.overflowPosition&&(D.overflowPosition=C.length),C.length>0&&(T?k=[...C,...k]:A.push(s.createElement("div",{ref:u,key:"sticky_buttons_container",onPointerDown:E,onDragStart:e=>{e.preventDefault()},className:N(l.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER)},C))),v.length>0){const e=n.i18nName(o.Overflow_Menu_Tooltip);let r;r="function"==typeof c.more?c.more(t,v):s.createElement(s.Fragment,null,c.more,s.createElement("div",{className:N(l.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT)},v.length)),k.splice(Math.min(D.overflowPosition,k.length),0,s.createElement("button",{key:"overflowbutton",ref:a,className:N(l.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+N(l.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW)+" "+N(l.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_+t.getLocation().getName()),title:e,onClick:w,onPointerDown:E},r))}const M=t.getSelected();if(-1!==M){const e=t.getChildren()[M];if(void 0!==e&&n.isSupportsPopout()&&e.isEnablePopout()){const t=n.i18nName(o.Popout_Tab);k.push(s.createElement("button",{key:"popout",title:t,className:N(l.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+N(l.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT),onClick:O,onPointerDown:E},"function"==typeof c.popout?c.popout(e):c.popout))}}const I=s.createElement("div",{key:"toolbar",ref:i,className:N(l.FLEXLAYOUT__BORDER_TOOLBAR)+" "+N(l.FLEXLAYOUT__BORDER_TOOLBAR_+t.getLocation().getName())},k);let B={},P={};const z=r-1;return t.getLocation()===f.LEFT?(B={right:"100%",top:m},P={width:z}):t.getLocation()===f.RIGHT?(B={left:"100%",top:m},P={width:z}):(B={left:m},P={height:z}),s.createElement("div",{ref:p,style:{display:"flex",flexDirection:t.getOrientation()===d.VERT?"row":"column"},className:x,"data-layout-path":t.getPath(),onClick:_,onAuxClick:_,onContextMenu:e=>{n.showContextMenu(t,e)},onWheel:y},s.createElement("div",{style:P,className:N(l.FLEXLAYOUT__BORDER_INNER)+" "+N(l.FLEXLAYOUT__BORDER_INNER_+t.getLocation().getName())},s.createElement("div",{style:B,className:N(l.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER)+" "+N(l.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_+t.getLocation().getName())},A)),I)},$=e=>{const{layout:t,node:n}=e,r=s.useRef(null);s.useEffect((()=>{n.setTabStamp(r.current)}),[n,r.current]);let i=(0,t.getClassName)(l.FLEXLAYOUT__DRAG_RECT);return s.createElement("div",{ref:r,className:i},s.createElement(Y,{key:n.getId(),layout:t,node:n}))};class q extends s.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.debug(e),console.debug(t)}render(){return this.state.hasError?s.createElement("div",{className:l.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER},s.createElement("div",{className:l.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT},this.props.message)):this.props.children}}const Q=e=>{const{title:t,layout:n,layoutWindow:r,url:i,onCloseWindow:a,onSetWindow:o,children:c}=e,d=s.useRef(null),[h,f]=s.useState(void 0),p=new Map;return s.useLayoutEffect((()=>{if(!d.current){const e=r.windowId,n=r.rect;d.current=window.open(i,e,`left=${n.x},top=${n.y},width=${n.width},height=${n.height}`),d.current?(r.window=d.current,o(r,d.current),window.addEventListener("beforeunload",(()=>{if(d.current){const e=d.current;d.current=null,e.close()}})),d.current.addEventListener("load",(()=>{if(d.current){d.current.focus(),d.current.resizeTo(n.width,n.height),d.current.moveTo(n.x,n.y);const e=d.current.document;e.title=t;const i=e.createElement("div");i.className=l.FLEXLAYOUT__FLOATING_WINDOW_CONTENT,e.body.appendChild(i),function(e,t){const n=[],r=document.querySelectorAll('style, link[rel="stylesheet"]');for(const i of r)J(e,i,t,n);return Promise.all(n)}(e,p).then((()=>{f(i)}));const o=new MutationObserver((t=>function(e,t,n){for(const r of e)if("childList"===r.type){for(const e of r.addedNodes)(e instanceof HTMLLinkElement||e instanceof HTMLStyleElement)&&J(t,e,n);for(const e of r.removedNodes)if(e instanceof HTMLLinkElement||e instanceof HTMLStyleElement){const r=n.get(e);r&&t.head.removeChild(r)}}}(t,e,p)));o.observe(document.head,{childList:!0}),d.current.addEventListener("beforeunload",(()=>{d.current&&(a(r),d.current=null,o.disconnect())}))}}))):(console.warn(`Unable to open window ${i}`),a(r))}return()=>{var e;n.getModel().getwindowsMap().has(r.windowId)||(null===(e=d.current)||void 0===e||e.close(),d.current=null)}}),[]),void 0!==h?(0,u.createPortal)(c,h):null};function J(e,t,n,r){if(t instanceof HTMLLinkElement){const i=t.cloneNode(!0);e.head.appendChild(i),n.set(t,i),r&&r.push(new Promise((e=>{i.onload=()=>e(!0)})))}else if(t instanceof HTMLStyleElement)try{const r=t.cloneNode(!0);e.head.appendChild(r),n.set(t,r)}catch(e){}}const K={width:"1em",height:"1em",display:"flex",alignItems:"center"},Z=()=>s.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:K,viewBox:"0 0 24 24"},s.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),s.createElement("path",{stroke:"var(--color-icon)",fill:"var(--color-icon)",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),ee=e=>{const{layout:t,show:n}=e;return s.createElement("div",{className:t.getClassName(l.FLEXLAYOUT__LAYOUT_OVERLAY),style:{display:n?"flex":"none"}})},te=e=>{const{layout:t,node:n,selected:r,path:i}=e,a=s.useRef(null),u=s.useRef(null),c=t.getIcons();s.useLayoutEffect((()=>{n.setTabRect(t.getBoundingClientRect(a.current)),t.getEditingTab()===n&&u.current.select()}));const d=()=>{t.doAction(g.selectTab(n.getId()))},h=e=>{e.target!==u.current&&(t.getCurrentDocument().body.removeEventListener("pointerdown",h),t.setEditingTab(void 0))},f=e=>{(()=>{const e=n.getCloseType();return!!(r||e===W.Always||e===W.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches)})()?t.doAction(g.deleteTab(n.getId())):d()},p=e=>{e.stopPropagation()},m=t.getClassName,b=n.getParent(),v=b.isEnableSingleTabStretch()&&1===b.getChildren().length;let y=v?l.FLEXLAYOUT__TAB_BUTTON_STRETCH:l.FLEXLAYOUT__TAB_BUTTON,T=m(y);T+=" "+m(y+"_"+b.getTabLocation()),v||(T+=r?" "+m(y+"--selected"):" "+m(y+"--unselected")),void 0!==n.getClassName()&&(T+=" "+n.getClassName());const _=w(t,n);let E=_.content?s.createElement("div",{className:m(l.FLEXLAYOUT__TAB_BUTTON_CONTENT)},_.content):null;const L=_.leading?s.createElement("div",{className:m(l.FLEXLAYOUT__TAB_BUTTON_LEADING)},_.leading):null;if(t.getEditingTab()===n&&(E=s.createElement("input",{ref:u,className:m(l.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":i+"/textbox",type:"text",autoFocus:!0,defaultValue:n.getName(),onKeyDown:e=>{"Escape"===e.code?t.setEditingTab(void 0):"Enter"===e.code&&(t.setEditingTab(void 0),t.doAction(g.renameTab(n.getId(),e.target.value)))},onPointerDown:e=>{e.stopPropagation()}})),n.isEnableClose()&&!v){const e=t.i18nName(o.Close_Tab);_.buttons.push(s.createElement("div",{key:"close","data-layout-path":i+"/button/close",title:e,className:m(l.FLEXLAYOUT__TAB_BUTTON_TRAILING),onPointerDown:p,onClick:f},"function"==typeof c.close?c.close(n):c.close))}return s.createElement("div",{ref:a,"data-layout-path":i,className:T,onClick:d,onAuxClick:e=>{S(e)&&t.auxMouseClick(n,e)},onContextMenu:e=>{t.showContextMenu(n,e)},title:n.getHelpText(),draggable:!0,onDragStart:e=>{n.isEnableDrag()?(e.stopPropagation(),t.setDragNode(e.nativeEvent,n)):e.preventDefault()},onDragEnd:e=>{t.clearDragMain()},onDoubleClick:e=>{n.isEnableRename()&&(t.setEditingTab(n),t.getCurrentDocument().body.addEventListener("pointerdown",h),e.stopPropagation())}},L,E,_.buttons)},ne=e=>{const{node:t,layout:n}=e,r=s.useRef(null),i=s.useRef(null),a=s.useRef(null),c=s.useRef(null),f=s.useRef(null),p=s.useRef(null),m=n.getIcons();s.useEffect((()=>{t.setRect(n.getBoundingClientRect(b.current)),r.current&&t.setTabStripRect(n.getBoundingClientRect(r.current));const e=h.getContentRect(a.current).relativeTo(n.getDomRect());t.getContentRect().equals(e)||(t.setContentRect(e),n.redrawInternal("tabset content rect "+e))}));const{selfRef:b,position:v,userControlledLeft:y,hiddenTabs:T,onMouseWheel:_,tabsTruncated:E}=j(t,d.HORZ,c,p),w=e=>{const r=n.getShowOverflowMenu();void 0!==r?r(t,e,T,L):X(f.current,T,L,n),e.stopPropagation()},L=e=>{n.doAction(g.selectTab(e.node.getId())),y.current=!1},O=e=>{n.getEditingTab()?e.preventDefault():t.isEnableDrag()?(e.stopPropagation(),n.setDragNode(e.nativeEvent,t)):e.preventDefault()},N=e=>{if(!S(e)){let e=t.getName();e=void 0===e?"":": "+e,n.doAction(g.setActiveTabset(t.getId(),n.getWindowId()))}},A=e=>{S(e)&&n.auxMouseClick(t,e)},R=e=>{n.showContextMenu(t,e)},x=e=>{e.stopPropagation()},k=e=>{t.canMaximize()&&n.maximize(t),e.stopPropagation()},C=e=>{n.doAction(g.deleteTabset(t.getId())),e.stopPropagation()},D=e=>{n.doAction(g.deleteTab(t.getChildren()[0].getId())),e.stopPropagation()},M=e=>{void 0!==P&&n.doAction(g.popoutTab(P.getId())),e.stopPropagation()},I=e=>{t.canMaximize()&&n.maximize(t)},B=n.getClassName;null!==i.current&&0!==i.current.scrollLeft&&(i.current.scrollLeft=0);const P=t.getSelectedNode(),z=t.getPath(),U=[];if(t.isEnableTabStrip())for(let e=0;e<t.getChildren().length;e++){const r=t.getChildren()[e];let i=t.getSelected()===e;U.push(s.createElement(te,{layout:n,node:r,path:z+"/tb"+e,key:r.getId(),selected:i})),e<t.getChildren().length-1&&U.push(s.createElement("div",{key:"divider"+e,className:B(l.FLEXLAYOUT__TABSET_TAB_DIVIDER)}))}let F=[],W=[];const H={stickyButtons:F,buttons:W,overflowPosition:void 0};n.customizeTabSet(t,H),F=H.stickyButtons,W=H.buttons;const Y=t.isEnableSingleTabStretch()&&1===t.getChildren().length,V=Y&&t.getChildren()[0].isEnableClose()||t.isEnableClose();if(void 0===H.overflowPosition&&(H.overflowPosition=F.length),F.length>0&&(t.isEnableTabWrap()||!E&&!Y?U.push(s.createElement("div",{ref:p,key:"sticky_buttons_container",onPointerDown:x,onDragStart:e=>{e.preventDefault()},className:B(l.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER)},F)):W=[...F,...W]),!t.isEnableTabWrap()&&T.length>0){const e=n.i18nName(o.Overflow_Menu_Tooltip);let r;r="function"==typeof m.more?m.more(t,T):s.createElement(s.Fragment,null,m.more,s.createElement("div",{className:B(l.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT)},T.length)),W.splice(Math.min(H.overflowPosition,W.length),0,s.createElement("button",{key:"overflowbutton","data-layout-path":z+"/button/overflow",ref:f,className:B(l.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+B(l.FLEXLAYOUT__TAB_BUTTON_OVERFLOW),title:e,onClick:w,onPointerDown:x},r))}if(void 0!==P&&n.isSupportsPopout()&&P.isEnablePopout()&&P.isEnablePopoutIcon()){const e=n.i18nName(o.Popout_Tab);W.push(s.createElement("button",{key:"popout","data-layout-path":z+"/button/popout",title:e,className:B(l.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+B(l.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT),onClick:M,onPointerDown:x},"function"==typeof m.popout?m.popout(P):m.popout))}if(t.canMaximize()){const e=n.i18nName(o.Restore),r=n.i18nName(o.Maximize);W.push(s.createElement("button",{key:"max","data-layout-path":z+"/button/max",title:t.isMaximized()?e:r,className:B(l.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+B(l.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_+(t.isMaximized()?"max":"min")),onClick:k,onPointerDown:x},t.isMaximized()?"function"==typeof m.restore?m.restore(t):m.restore:"function"==typeof m.maximize?m.maximize(t):m.maximize))}if(!t.isMaximized()&&V){const e=Y?n.i18nName(o.Close_Tab):n.i18nName(o.Close_Tabset);W.push(s.createElement("button",{key:"close","data-layout-path":z+"/button/close",title:e,className:B(l.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+B(l.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE),onClick:Y?D:C,onPointerDown:x},"function"==typeof m.closeTabset?m.closeTabset(t):m.closeTabset))}if(t.isActive()&&t.isEnableActiveIcon()){const e=n.i18nName(o.Active_Tabset);W.push(s.createElement("div",{key:"active","data-layout-path":z+"/button/active",title:e,className:B(l.FLEXLAYOUT__TAB_TOOLBAR_ICON)},"function"==typeof m.activeTabset?m.activeTabset(t):m.activeTabset))}const G=s.createElement("div",{key:"buttonbar",ref:c,className:B(l.FLEXLAYOUT__TAB_TOOLBAR),onPointerDown:x,onDragStart:e=>{e.preventDefault()}},W);let $,q=B(l.FLEXLAYOUT__TABSET_TABBAR_OUTER);if(void 0!==t.getClassNameTabStrip()&&(q+=" "+t.getClassNameTabStrip()),q+=" "+l.FLEXLAYOUT__TABSET_TABBAR_OUTER_+t.getTabLocation(),t.isActive()&&(q+=" "+B(l.FLEXLAYOUT__TABSET_SELECTED)),t.isMaximized()&&(q+=" "+B(l.FLEXLAYOUT__TABSET_MAXIMIZED)),Y){const e=t.getChildren()[0];void 0!==e.getTabSetClassName()&&(q+=" "+e.getTabSetClassName())}var Q;if(t.isEnableTabWrap()?t.isEnableTabStrip()&&($=s.createElement("div",{className:q,style:{flexWrap:"wrap",gap:"1px",marginTop:"2px"},ref:r,"data-layout-path":z+"/tabstrip",onPointerDown:N,onDoubleClick:I,onContextMenu:R,onClick:A,onAuxClick:A,draggable:!0,onDragStart:O},U,s.createElement("div",{style:{flexGrow:1}}),G)):t.isEnableTabStrip()&&($=s.createElement("div",{className:q,ref:r,"data-layout-path":z+"/tabstrip",onPointerDown:N,onDoubleClick:I,onContextMenu:R,onClick:A,onAuxClick:A,draggable:!0,onWheel:_,onDragStart:O},s.createElement("div",{ref:i,className:B(l.FLEXLAYOUT__TABSET_TABBAR_INNER)+" "+B(l.FLEXLAYOUT__TABSET_TABBAR_INNER_+t.getTabLocation())},s.createElement("div",{style:{left:v,width:Y?"100%":"10000px"},className:B(l.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER)+" "+B(l.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_+t.getTabLocation())},U)),G)),0===t.getChildren().length){const e=n.getTabSetPlaceHolderCallback();e&&(Q=e(t))}let J=s.createElement("div",{ref:a,className:B(l.FLEXLAYOUT__TABSET_CONTENT)},Q);J="top"===t.getTabLocation()?s.createElement(s.Fragment,null,$,J):s.createElement(s.Fragment,null,J,$);let K={flexGrow:Math.max(1,1e3*t.getWeight()),minWidth:t.getMinWidth(),minHeight:t.getMinHeight(),maxWidth:t.getMaxWidth(),maxHeight:t.getMaxHeight()};void 0===t.getModel().getMaximizedTabset(n.getWindowId())||t.isMaximized()||(K.display="none");const Z=s.createElement("div",{ref:b,className:B(l.FLEXLAYOUT__TABSET_CONTAINER),style:K},s.createElement("div",{className:B(l.FLEXLAYOUT__TABSET),"data-layout-path":z},J));return t.isMaximized()&&n.getMainElement()?(0,u.createPortal)(s.createElement("div",{style:{position:"absolute",display:"flex",top:0,left:0,bottom:0,right:0}},Z),n.getMainElement()):Z},re=e=>{const{layout:t,node:n}=e,r=s.useRef(null),i=n.getOrientation()===d.HORZ;s.useLayoutEffect((()=>{n.setRect(t.getBoundingClientRect(r.current))}));const a=[];let o=0;for(const e of n.getChildren())o>0&&a.push(s.createElement(U,{key:"splitter"+o,layout:t,node:n,index:o,horizontal:i})),e instanceof D?a.push(s.createElement(re,{key:e.getId(),layout:t,node:e})):e instanceof C&&a.push(s.createElement(ne,{key:e.getId(),layout:t,node:e})),o++;const u={flexGrow:Math.max(1,1e3*n.getWeight()),minWidth:n.getMinWidth(),minHeight:n.getMinHeight(),maxWidth:n.getMaxWidth(),maxHeight:n.getMaxHeight()};return u.flexDirection=i?"row":"column",s.createElement("div",{ref:r,className:t.getClassName(l.FLEXLAYOUT__ROW),style:u},a)},ie=e=>{const{layout:t,selected:n,node:r,path:i}=e,a=s.useRef(null),o=s.useRef(!0),u=r.getParent(),c=u.getContentRect();s.useLayoutEffect((()=>{const e=r.getMoveableElement();a.current.appendChild(e),r.setMoveableElement(e);const t=()=>{r.saveScrollPosition()};return e.addEventListener("scroll",t),a.current.addEventListener("pointerdown",d),()=>{e.removeEventListener("scroll",t),a.current&&a.current.removeEventListener("pointerdown",d),r.setVisible(!1)}}),[]),s.useEffect((()=>{r.isSelected()&&o.current&&(r.restoreScrollPosition(),o.current=!1)}));const d=()=>{const e=r.getParent();e instanceof C&&(e.isActive()||t.doAction(g.setActiveTabset(e.getId(),t.getWindowId())))};r.setRect(c);const h=t.getClassName,f={};c.styleWithPosition(f);let p=null;if(n){if(r.setVisible(!0),document.hidden&&r.isEnablePopoutOverlay()){const e={};c.styleWithPosition(e),p=s.createElement("div",{style:e,className:h(l.FLEXLAYOUT__TAB_OVERLAY)})}}else f.display="none",r.setVisible(!1);u instanceof C&&void 0!==r.getModel().getMaximizedTabset(t.getWindowId())&&(u.isMaximized()?f.zIndex=10:f.display="none");let m=h(l.FLEXLAYOUT__TAB);return u instanceof z&&(m+=" "+h(l.FLEXLAYOUT__TAB_BORDER),m+=" "+h(l.FLEXLAYOUT__TAB_BORDER_+u.getLocation().getName())),void 0!==r.getContentClassName()&&(m+=" "+r.getContentClassName()),s.createElement(s.Fragment,null,p,s.createElement("div",{ref:a,style:f,className:m,"data-layout-path":i}))},ae=s.memo((({children:e})=>s.createElement(s.Fragment,null,e)),((e,t)=>e.rect.equalSize(t.rect)&&e.selected===t.selected&&e.forceRevision===t.forceRevision&&e.tabsRevision===t.tabsRevision));class oe extends s.Component{constructor(e){super(e),this.selfRef=s.createRef(),this.revision=0}redraw(){this.selfRef.current.redraw("parent "+this.revision)}addTabToTabSet(e,t){return this.selfRef.current.addTabToTabSet(e,t)}addTabWithDragAndDrop(e,t,n){this.selfRef.current.addTabWithDragAndDrop(e,t,n)}moveTabWithDragAndDrop(e,t){this.selfRef.current.moveTabWithDragAndDrop(e,t)}addTabToActiveTabSet(e){return this.selfRef.current.addTabToActiveTabSet(e)}setDragComponent(e,t,n,r){this.selfRef.current.setDragComponent(e,t,n,r)}getRootDiv(){return this.selfRef.current.getRootDiv()}render(){return s.createElement(le,Object.assign({ref:this.selfRef},this.props,{renderRevision:this.revision++}))}}class le extends s.Component{constructor(e){super(e),this.moveableElementMap=new Map,this.dragEnterCount=0,this.dragging=!1,this.updateLayoutMetrics=()=>{if(this.findBorderBarSizeRef.current){const e=this.findBorderBarSizeRef.current.getBoundingClientRect().height;e!==this.state.calculatedBorderBarSize&&this.setState({calculatedBorderBarSize:e})}},this.onModelChange=e=>{this.redrawInternal("model change"),this.props.onModelChange&&this.props.onModelChange(this.props.model,e)},this.updateRect=()=>{const e=this.getDomRect();e.equals(this.state.rect)||0===e.width||0===e.height||(this.setState({rect:e}),this.windowId!==P.MAIN_WINDOW_ID&&this.redrawInternal("rect updated"))},this.getClassName=e=>void 0===this.props.classNameMapper?e:this.props.classNameMapper(e),this.onCloseWindow=e=>{this.doAction(g.closeWindow(e.windowId))},this.onSetWindow=(e,t)=>{},this.showControlInPortal=(e,t)=>{const n=(0,u.createPortal)(e,t);this.setState({portal:n})},this.hideControlInPortal=()=>{this.setState({portal:void 0})},this.getIcons=()=>this.icons,this.setDragNode=(e,t)=>{if(le.dragState=new pe(this.mainLayout,ce.Internal,t,void 0,void 0),e.dataTransfer.setData("text/plain","--flexlayout--"),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.dropEffect="move",this.dragEnterCount=0,t instanceof C){let n=!1,r=this.i18nName(o.Move_Tabset);if(t.getChildren().length>0&&(r=this.i18nName(o.Move_Tabs).replace("?",String(t.getChildren().length))),this.props.onRenderDragRect){const i=this.props.onRenderDragRect(r,t,void 0);i&&(this.setDragComponent(e,i,10,10),n=!0)}n||this.setDragComponent(e,r,10,10)}else{const n=e.target.getBoundingClientRect(),r=e.clientX-n.left,i=e.clientY-n.top,a=null==t?void 0:t.getParent(),o=a instanceof z&&a.getOrientation()===d.HORZ,l=o?10:r,u=o?10:i;let c=!1;if(this.props.onRenderDragRect){const n=s.createElement(Y,{key:t.getId(),layout:this,node:t}),r=this.props.onRenderDragRect(n,t,void 0);r&&(this.setDragComponent(e,r,l,u),c=!0)}c||(function(){const e=navigator.userAgent;return e.includes("Safari")&&!e.includes("Chrome")&&!e.includes("Chromium")}()?this.setDragComponent(e,s.createElement(Y,{node:t,layout:this}),l,u):e.dataTransfer.setDragImage(t.getTabStamp(),l,u))}},this.onDragEnterRaw=e=>{this.dragEnterCount++,1===this.dragEnterCount&&this.onDragEnter(e)},this.onDragLeaveRaw=e=>{this.dragEnterCount--,0===this.dragEnterCount&&this.onDragLeave(e)},this.onDragEnter=e=>{var t;if(!le.dragState&&this.props.onExternalDrag){const t=this.props.onExternalDrag(e);if(t){const e=_.fromJson(t.json,this.props.model,!1);le.dragState=new pe(this.mainLayout,ce.External,e,t.json,t.onDrop)}}if(le.dragState){if(this.windowId!==P.MAIN_WINDOW_ID&&le.dragState.mainLayout===this.mainLayout&&le.dragState.mainLayout.setDraggingOverWindow(!0),le.dragState.mainLayout!==this.mainLayout)return;e.preventDefault(),this.dropInfo=void 0;const n=this.selfRef.current;this.outlineDiv=this.currentDocument.createElement("div"),this.outlineDiv.className=this.getClassName(l.FLEXLAYOUT__OUTLINE_RECT),this.outlineDiv.style.visibility="hidden";const r=this.props.model.getAttribute("tabDragSpeed");this.outlineDiv.style.transition=`top ${r}s, left ${r}s, width ${r}s, height ${r}s`,n.appendChild(this.outlineDiv),this.dragging=!0,this.showOverlay(!0),this.isDraggingOverWindow||void 0!==this.props.model.getMaximizedTabset(this.windowId)||this.setState({showEdges:this.props.model.isEnableEdgeDock()});const i=null===(t=this.selfRef.current)||void 0===t?void 0:t.getBoundingClientRect();new h(e.clientX-i.left,e.clientY-i.top,1,1).positionElement(this.outlineDiv)}},this.onDragOver=e=>{var t,n,r;if(this.dragging&&!this.isDraggingOverWindow){e.preventDefault();const i=null===(t=this.selfRef.current)||void 0===t?void 0:t.getBoundingClientRect(),a={x:e.clientX-(null!==(n=null==i?void 0:i.left)&&void 0!==n?n:0),y:e.clientY-(null!==(r=null==i?void 0:i.top)&&void 0!==r?r:0)};this.checkForBorderToShow(a.x,a.y);let o=this.props.model.findDropTargetNode(this.windowId,le.dragState.dragNode,a.x,a.y);o&&(this.dropInfo=o,this.outlineDiv&&(this.outlineDiv.className=this.getClassName(o.className),o.rect.positionElement(this.outlineDiv),this.outlineDiv.style.visibility="visible"))}},this.onDragLeave=e=>{this.dragging&&(this.windowId!==P.MAIN_WINDOW_ID&&le.dragState.mainLayout.setDraggingOverWindow(!1),this.clearDragLocal())},this.onDrop=e=>{if(this.dragging){e.preventDefault();const t=le.dragState;if(this.dropInfo)if(void 0!==t.dragJson){const n=this.doAction(g.addNode(t.dragJson,this.dropInfo.node.getId(),this.dropInfo.location,this.dropInfo.index));void 0!==t.fnNewNodeDropped&&t.fnNewNodeDropped(n,e)}else void 0!==t.dragNode&&this.doAction(g.moveNode(t.dragNode.getId(),this.dropInfo.node.getId(),this.dropInfo.location,this.dropInfo.index));this.mainLayout.clearDragMain()}this.dragEnterCount=0},this.orderedIds=[],this.selfRef=s.createRef(),this.moveablesRef=s.createRef(),this.mainRef=s.createRef(),this.findBorderBarSizeRef=s.createRef(),this.supportsPopout=void 0!==e.supportsPopout?e.supportsPopout:de,this.popoutURL=e.popoutURL?e.popoutURL:"popout.html",this.icons=Object.assign(Object.assign({},ue),e.icons),this.windowId=e.windowId?e.windowId:P.MAIN_WINDOW_ID,this.mainLayout=this.props.mainLayout?this.props.mainLayout:this,this.isDraggingOverWindow=!1,this.layoutWindow=this.props.model.getwindowsMap().get(this.windowId),this.layoutWindow.layout=this,this.popoutWindowName=this.props.popoutWindowName||"Popout Window",this.state={rect:h.empty(),editingTab:void 0,showEdges:!1,showOverlay:!1,calculatedBorderBarSize:29,layoutRevision:0,forceRevision:0,showHiddenBorder:f.CENTER},this.isMainWindow=this.windowId===P.MAIN_WINDOW_ID}componentDidMount(){if(this.updateRect(),this.currentDocument=this.selfRef.current.ownerDocument,this.currentWindow=this.currentDocument.defaultView,this.layoutWindow.window=this.currentWindow,this.layoutWindow.toScreenRectFunction=e=>this.getScreenRect(e),this.resizeObserver=new ResizeObserver((e=>{requestAnimationFrame((()=>{this.updateRect()}))})),this.selfRef.current&&this.resizeObserver.observe(this.selfRef.current),this.isMainWindow)this.props.model.addChangeListener(this.onModelChange),this.updateLayoutMetrics();else{this.currentWindow.addEventListener("resize",(()=>{this.updateRect()}));const e=this.props.mainLayout.getRootDiv(),t=this.selfRef.current;R(e,t),this.styleObserver=new MutationObserver((()=>{R(e,t)&&this.redraw("mutation observer")})),this.styleObserver.observe(e,{attributeFilter:["style"]})}document.addEventListener("visibilitychange",(()=>{for(const[e,t]of this.props.model.getwindowsMap())t.layout&&this.redraw("visibility change")}))}componentDidUpdate(){this.currentDocument=this.selfRef.current.ownerDocument,this.currentWindow=this.currentDocument.defaultView,this.isMainWindow&&(this.props.model!==this.previousModel&&(void 0!==this.previousModel&&this.previousModel.removeChangeListener(this.onModelChange),this.props.model.getwindowsMap().get(this.windowId).layout=this,this.props.model.addChangeListener(this.onModelChange),this.layoutWindow=this.props.model.getwindowsMap().get(this.windowId),this.layoutWindow.layout=this,this.layoutWindow.toScreenRectFunction=e=>this.getScreenRect(e),this.previousModel=this.props.model,this.tidyMoveablesMap()),this.updateLayoutMetrics())}componentWillUnmount(){var e,t;this.selfRef.current&&(null===(e=this.resizeObserver)||void 0===e||e.unobserve(this.selfRef.current)),null===(t=this.styleObserver)||void 0===t||t.disconnect()}render(){if(!this.selfRef.current)return s.createElement("div",{ref:this.selfRef,className:this.getClassName(l.FLEXLAYOUT__LAYOUT)},s.createElement("div",{ref:this.moveablesRef,key:"__moveables__",className:this.getClassName(l.FLEXLAYOUT__LAYOUT_MOVEABLES)}),this.renderMetricsElements());const e=this.props.model;e.getRoot(this.windowId).calcMinMaxSize(),e.getRoot(this.windowId).setPaths(""),e.getBorderSet().setPaths();const t=this.renderLayout(),n=this.renderBorders(t),r=this.renderTabs(),i=this.reorderComponents(r,this.orderedIds);let a=null,o=null,u=null,c=null;return this.isMainWindow&&(a=this.renderWindows(),c=this.renderMetricsElements(),o=this.renderTabMoveables(),u=s.createElement("div",{key:"__tabStamps__",className:this.getClassName(l.FLEXLAYOUT__LAYOUT_TAB_STAMPS)},this.renderTabStamps())),s.createElement("div",{ref:this.selfRef,className:this.getClassName(l.FLEXLAYOUT__LAYOUT),onDragEnter:this.onDragEnterRaw,onDragLeave:this.onDragLeaveRaw,onDragOver:this.onDragOver,onDrop:this.onDrop},s.createElement("div",{ref:this.moveablesRef,key:"__moveables__",className:this.getClassName(l.FLEXLAYOUT__LAYOUT_MOVEABLES)}),c,s.createElement(ee,{key:"__overlay__",layout:this,show:this.state.showOverlay}),n,i,o,u,this.state.portal,a)}renderBorders(e){const t=this.getClassName(l.FLEXLAYOUT__LAYOUT_MAIN),n=this.props.model.getBorderSet().getBorderMap();if(this.isMainWindow&&n.size>0){e=s.createElement("div",{className:t,ref:this.mainRef},e);const r=new Map,i=new Map;for(const[e,t]of f.values){const e=n.get(t);e&&(!e.isAutoHide()||e.isAutoHide()&&(e.getChildren().length>0||this.state.showHiddenBorder===t))&&(r.set(t,s.createElement(G,{layout:this,border:e,size:this.state.calculatedBorderBarSize})),i.set(t,s.createElement(F,{layout:this,border:e,show:-1!==e.getSelected()})))}const a=this.getClassName(l.FLEXLAYOUT__LAYOUT_BORDER_CONTAINER),o=this.getClassName(l.FLEXLAYOUT__LAYOUT_BORDER_CONTAINER_INNER);if(this.props.model.getBorderSet().getLayoutHorizontal()){const t=s.createElement("div",{className:o,style:{flexDirection:"column"}},i.get(f.TOP),s.createElement("div",{className:o,style:{flexDirection:"row"}},i.get(f.LEFT),e,i.get(f.RIGHT)),i.get(f.BOTTOM));return s.createElement("div",{className:a,style:{flexDirection:"column"}},r.get(f.TOP),s.createElement("div",{className:o,style:{flexDirection:"row"}},r.get(f.LEFT),t,r.get(f.RIGHT)),r.get(f.BOTTOM))}{const t=s.createElement("div",{className:o,style:{flexDirection:"row"}},i.get(f.LEFT),s.createElement("div",{className:o,style:{flexDirection:"column"}},i.get(f.TOP),e,i.get(f.BOTTOM)),i.get(f.RIGHT));return s.createElement("div",{className:a,style:{flexDirection:"row"}},r.get(f.LEFT),s.createElement("div",{className:o,style:{flexDirection:"column"}},r.get(f.TOP),t,r.get(f.BOTTOM)),r.get(f.RIGHT))}}return s.createElement("div",{className:t,ref:this.mainRef,style:{position:"absolute",top:0,left:0,bottom:0,right:0,display:"flex"}},e)}renderLayout(){return s.createElement(s.Fragment,null,s.createElement(re,{key:"__row__",layout:this,node:this.props.model.getRoot(this.windowId)}),this.renderEdgeIndicators())}renderEdgeIndicators(){const e=[],t=this.icons.edgeArrow;if(this.state.showEdges){const n=this.props.model.getRoot(this.windowId).getRect(),r=he,i=fe,a=he/2,o=this.getClassName(l.FLEXLAYOUT__EDGE_RECT),u=50;e.push(s.createElement("div",{key:"North",style:{top:0,left:n.width/2-a,width:r,height:i,borderBottomLeftRadius:u,borderBottomRightRadius:u},className:o+" "+this.getClassName(l.FLEXLAYOUT__EDGE_RECT_TOP)},s.createElement("div",{style:{transform:"rotate(180deg)"}},t))),e.push(s.createElement("div",{key:"West",style:{top:n.height/2-a,left:0,width:i,height:r,borderTopRightRadius:u,borderBottomRightRadius:u},className:o+" "+this.getClassName(l.FLEXLAYOUT__EDGE_RECT_LEFT)},s.createElement("div",{style:{transform:"rotate(90deg)"}},t))),e.push(s.createElement("div",{key:"South",style:{top:n.height-i,left:n.width/2-a,width:r,height:i,borderTopLeftRadius:u,borderTopRightRadius:u},className:o+" "+this.getClassName(l.FLEXLAYOUT__EDGE_RECT_BOTTOM)},s.createElement("div",null,t))),e.push(s.createElement("div",{key:"East",style:{top:n.height/2-a,left:n.width-i,width:i,height:r,borderTopLeftRadius:u,borderBottomLeftRadius:u},className:o+" "+this.getClassName(l.FLEXLAYOUT__EDGE_RECT_RIGHT)},s.createElement("div",{style:{transform:"rotate(-90deg)"}},t)))}return e}renderWindows(){const e=[];if(this.supportsPopout){const t=this.props.model.getwindowsMap();let n=1;for(const[r,i]of t)r!==P.MAIN_WINDOW_ID&&(e.push(s.createElement(Q,{key:r,layout:this,title:this.popoutWindowName+" "+n,layoutWindow:i,url:this.popoutURL+"?id="+r,onSetWindow:this.onSetWindow,onCloseWindow:this.onCloseWindow},s.createElement(le,Object.assign({},this.props,{windowId:r,mainLayout:this})))),n++)}return e}renderTabMoveables(){const e=[];return this.props.model.visitNodes((t=>{if(t instanceof _){const n=t,r=this.getMoveableElement(n.getId());n.setMoveableElement(r);const i=n.isSelected(),a=n.getParent().getContentRect(),l=n.isRendered()||(i||!n.isEnableRenderOnDemand())&&a.width>0&&a.height>0;if(l){const t=n.getId()+(n.isEnableWindowReMount()?n.getWindowId():"");e.push((0,u.createPortal)(s.createElement(ae,{rect:a,selected:n.isSelected(),forceRevision:this.state.forceRevision,tabsRevision:this.props.renderRevision,key:t},s.createElement(q,{message:this.i18nName(o.Error_rendering_component)},this.props.factory(n))),r,t)),n.setRendered(l)}}})),e}renderTabStamps(){const e=[];return this.props.model.visitNodes((t=>{if(t instanceof _){const n=t;e.push(s.createElement($,{key:n.getId(),layout:this,node:n}))}})),e}renderTabs(){const e=new Map;return this.props.model.visitWindowNodes(this.windowId,(t=>{if(t instanceof _){const n=t,r=n.isSelected(),i=n.getPath();(n.isRendered()||r||!n.isEnableRenderOnDemand())&&e.set(n.getId(),s.createElement(ie,{key:n.getId(),layout:this,path:i,node:n,selected:r}))}})),e}renderMetricsElements(){return s.createElement("div",{key:"findBorderBarSize",ref:this.findBorderBarSizeRef,className:this.getClassName(l.FLEXLAYOUT__BORDER_SIZER)},"FindBorderBarSize")}checkForBorderToShow(e,t){const n=this.getBoundingClientRect(this.mainRef.current),r=n.getCenter(),i=fe,a=he/2;let o=!1;this.props.model.isEnableEdgeDock()&&this.state.showHiddenBorder===f.CENTER&&(t>r.y-a&&t<r.y+a||e>r.x-a&&e<r.x+a)&&(o=!0);let l=f.CENTER;o||(e<=n.x+i?l=f.LEFT:e>=n.getRight()-i?l=f.RIGHT:t<=n.y+i?l=f.TOP:t>=n.getBottom()-i&&(l=f.BOTTOM)),l!==this.state.showHiddenBorder&&this.setState({showHiddenBorder:l})}tidyMoveablesMap(){const e=new Map;this.props.model.visitNodes(((t,n)=>{t instanceof _&&e.set(t.getId(),t)}));for(const[t,n]of this.moveableElementMap)e.has(t)||(n.remove(),this.moveableElementMap.delete(t))}reorderComponents(e,t){const n=[],r=new Set;let i=[];for(const i of t)e.get(i)&&(n.push(i),r.add(i));t.splice(0,t.length,...n);for(const[n,i]of e)r.has(n)||t.push(n);return i=t.map((t=>e.get(t))),i}redraw(e){this.mainLayout.setState(((e,t)=>({forceRevision:e.forceRevision+1})))}redrawInternal(e){this.mainLayout.setState(((e,t)=>({layoutRevision:e.layoutRevision+1})))}doAction(e){if(void 0!==this.props.onAction){const t=this.props.onAction(e);return void 0!==t?this.props.model.doAction(t):void 0}return this.props.model.doAction(e)}getBoundingClientRect(e){const t=this.getDomRect();return t?h.getBoundingClientRect(e).relativeTo(t):h.empty()}getMoveableContainer(){return this.moveablesRef.current}getMoveableElement(e){let t=this.moveableElementMap.get(e);return void 0===t&&(t=document.createElement("div"),this.moveablesRef.current.appendChild(t),t.className=l.FLEXLAYOUT__TAB_MOVEABLE,this.moveableElementMap.set(e,t)),t}getMainLayout(){return this.mainLayout}getCurrentDocument(){return this.currentDocument}getDomRect(){return this.selfRef.current?h.fromDomRect(this.selfRef.current.getBoundingClientRect()):h.empty()}getWindowId(){return this.windowId}getRootDiv(){return this.selfRef.current}getMainElement(){return this.mainRef.current}getFactory(){return this.props.factory}isSupportsPopout(){return this.supportsPopout}isRealtimeResize(){var e;return null!==(e=this.props.realtimeResize)&&void 0!==e&&e}getPopoutURL(){return this.popoutURL}setEditingTab(e){this.setState({editingTab:e})}getEditingTab(){return this.state.editingTab}getModel(){return this.props.model}getScreenRect(e){const t=e.clone(),n=this.getDomRect();return t.x=this.currentWindow.screenX+this.currentWindow.scrollX+1+n.x+t.x,t.y=this.currentWindow.screenY+this.currentWindow.scrollY+59+n.y+t.y,t.height+=60,t.width+=2,t}addTabToTabSet(e,t){if(void 0!==this.props.model.getNodeById(e))return this.doAction(g.addNode(t,e,f.CENTER,-1))}addTabToActiveTabSet(e){const t=this.props.model.getActiveTabset(this.windowId);if(void 0!==t)return this.doAction(g.addNode(e,t.getId(),f.CENTER,-1))}maximize(e){this.doAction(g.maximizeToggle(e.getId(),this.getWindowId()))}customizeTab(e,t){this.props.onRenderTab&&this.props.onRenderTab(e,t)}customizeTabSet(e,t){this.props.onRenderTabSet&&this.props.onRenderTabSet(e,t)}i18nName(e,t){let n;return this.props.i18nMapper&&(n=this.props.i18nMapper(e,t)),void 0===n&&(n=e+(void 0===t?"":t)),n}getShowOverflowMenu(){return this.props.onShowOverflowMenu}getTabSetPlaceHolderCallback(){return this.props.onTabSetPlaceHolder}showContextMenu(e,t){this.props.onContextMenu&&this.props.onContextMenu(e,t)}auxMouseClick(e,t){this.props.onAuxMouseClick&&this.props.onAuxMouseClick(e,t)}showOverlay(e){this.setState({showOverlay:e}),L(!e,this.currentDocument)}addTabWithDragAndDrop(e,t,n){const r=_.fromJson(t,this.props.model,!1);le.dragState=new pe(this.mainLayout,ce.Add,r,t,n)}moveTabWithDragAndDrop(e,t){this.setDragNode(e,t)}setDragComponent(e,t,n,r){let i=s.createElement("div",{style:{position:"unset"},className:this.getClassName(l.FLEXLAYOUT__LAYOUT)+" "+this.getClassName(l.FLEXLAYOUT__DRAG_RECT)},t);const a=this.currentDocument.createElement("div");a.setAttribute("data-layout-path","/drag-rectangle"),a.style.position="absolute",a.style.left="-10000px",a.style.top="-10000px",this.currentDocument.body.appendChild(a),(0,c.createRoot)(a).render(i),e.dataTransfer.setDragImage(a,n,r),setTimeout((()=>{this.currentDocument.body.removeChild(a)}),0)}setDraggingOverWindow(e){this.isDraggingOverWindow!==e&&(this.outlineDiv&&(this.outlineDiv.style.visibility=e?"hidden":"visible"),e?this.setState({showEdges:!1}):void 0===this.props.model.getMaximizedTabset(this.windowId)&&this.setState({showEdges:this.props.model.isEnableEdgeDock()}),this.isDraggingOverWindow=e)}clearDragMain(){le.dragState=void 0,this.windowId===P.MAIN_WINDOW_ID&&(this.isDraggingOverWindow=!1);for(const[,e]of this.props.model.getwindowsMap())e.layout.clearDragLocal()}clearDragLocal(){this.setState({showEdges:!1}),this.showOverlay(!1),this.dragEnterCount=0,this.dragging=!1,this.outlineDiv&&(this.selfRef.current.removeChild(this.outlineDiv),this.outlineDiv=void 0)}}le.dragState=void 0;const se="0.8.1",ue={close:s.createElement(Z,null),closeTabset:s.createElement(Z,null),popout:s.createElement((()=>s.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:K,viewBox:"0 0 20 20",fill:"var(--color-icon)"},s.createElement("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),s.createElement("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"}))),null),maximize:s.createElement((()=>s.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:K,viewBox:"0 0 24 24",fill:"var(--color-icon)"},s.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),s.createElement("path",{stroke:"var(--color-icon)",d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))),null),restore:s.createElement((()=>s.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:K,viewBox:"0 0 24 24",fill:"var(--color-icon)"},s.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),s.createElement("path",{stroke:"var(--color-icon)",d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))),null),more:s.createElement((()=>s.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:K,viewBox:"0 0 24 24",fill:"var(--color-icon)"},s.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),s.createElement("path",{stroke:"var(--color-icon)",d:"M7 10l5 5 5-5z"}))),null),edgeArrow:s.createElement((()=>s.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{display:"block",width:10,height:10},preserveAspectRatio:"none",viewBox:"0 0 100 100"},s.createElement("path",{fill:"var(--color-edge-icon)",stroke:"var(--color-edge-icon)",d:"M10 30 L90 30 l-40 40 Z"}))),null),activeTabset:s.createElement((()=>s.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:K,height:"24px",viewBox:"0 -960 960 960",width:"24px"},s.createElement("path",{fill:"var(--color-icon)",stroke:"var(--color-icon)",d:"M440-120v-264L254-197l-57-57 187-186H120v-80h264L197-706l57-57 186 187v-264h80v264l186-187 57 57-187 186h264v80H576l187 186-57 57-186-187v264h-80Z"}))),null)};var ce;!function(e){e.Internal="internal",e.External="external",e.Add="add"}(ce||(ce={}));const de=E(),he=100,fe=10;class pe{constructor(e,t,n,r,i){this.mainLayout=e,this.dragSource=t,this.dragNode=n,this.dragJson=r,this.fnNewNodeDropped=i}}return a})()));
|