UNPKG

docking-egid

Version:

This library is built to provide a solution for Angular enables the creation of complex layouts consisting of panels that can be floated, docked, nested, resized, pinned, unpinned and closed. Additional components can be integrated to create an IDE-like l

1 lines 146 kB
var __awaiter=this&&this.__awaiter||function(e,t,n,i){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function r(e){try{c(i.next(e))}catch(e){a(e)}}function s(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):o(e.value).then(r,s)}c((i=i.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var n,i,o,a,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},__spreadArray=this&&this.__spreadArray||function(e,t){for(var n=0,i=t.length,o=e.length;n<i;n++,o++)e[o]=t[n];return e};System.register(["./p-972bb54a.system.js","./p-41c42898.system.js"],(function(e){"use strict";var t,n,i,o,a,r,s,c,l,d,h,p,u,g,f;return{setters:[function(e){t=e.r,n=e.h,i=e.H,o=e.c,a=e.F,r=e.g,s=e.f},function(e){c=e.h,l=e.f,d=e.e,h=e.g,p=e.i,u=e.k,g=e.r,f=e.d}],execute:function(){var m=e("igc_button_component",function(){function e(e){t(this,e)}return e.prototype.render=function(){return n(i,{disabled:this.disabled},n("button",{name:this.name,type:this.type,value:this.value,"aria-disabled":this.disabled?"true":null},n("slot",null)))},e}());m.style="button{position:static;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:auto;height:100%;min-width:10px;padding:2px 4px;border-radius:2px;color:var(--igc-button-text, rgba(0, 0, 0, 0.72));cursor:pointer;outline-style:none;font-size:14px;font-family:inherit;background:transparent;border:none;-webkit-tap-highlight-color:transparent;opacity:0.7;-webkit-transition:background 0.25s ease-out, opacity 0.25s ease-out, -webkit-box-shadow 0.25s ease-out;transition:background 0.25s ease-out, opacity 0.25s ease-out, -webkit-box-shadow 0.25s ease-out;transition:background 0.25s ease-out, opacity 0.25s ease-out, box-shadow 0.25s ease-out;transition:background 0.25s ease-out, opacity 0.25s ease-out, box-shadow 0.25s ease-out, -webkit-box-shadow 0.25s ease-out}:host([disabled]){pointer-events:none}:host{display:-ms-flexbox;display:flex}button{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}button:hover{opacity:1}button:focus{background:var(--igc-accent-color, #fff);-webkit-box-shadow:inset 0 0 0 1px var(--igc-active-color, cornflowerblue);box-shadow:inset 0 0 0 1px var(--igc-active-color, cornflowerblue);opacity:1}button[disabled]{opacity:0.54}";var v,b,y,P=function(){function e(){}return e.isDockingIndicatorVertical=function(e){return e===c.top||e===c.bottom||e===c.outerTop||e===c.outerBottom},e.isDockingIndicatorBefore=function(e){return e===c.top||e===c.left||e===c.outerTop||e===c.outerLeft},e.isDockingIndicatorBeforeRTL=function(e){return e===c.top||e===c.right||e===c.outerTop||e===c.outerRight},e.isDockingIndicatorOuter=function(e){return e===c.outerLeft||e===c.outerRight||e===c.outerTop||e===c.outerBottom},e.isSplitPaneVertical=function(e){return e.orientation===l.vertical},e.isAltPressed=function(e){return e.altKey||e.getModifierState("Alt")||e.getModifierState("AltGraph")},e.isControlOrMetaPressed=function(e){return e.ctrlKey||e.metaKey||e.getModifierState("Meta")||e.getModifierState("OS")},e.partNameMap=function(e,t){return void 0===t&&(t=" "),Object.keys(e).filter((function(t){return e[t]})).join(t)},e.getDirection=function(e){var t="";if(""!==e.dir)t=e.dir;else for(var n=e.parentElement;n;){if(""!==n.dir){t=n.dir;break}n=n.parentElement}return t},e}(),x=100,w=42;!function(e){e.top="top",e.bottom="bottom"}(v||(v={})),function(e){e.top="top",e.bottom="bottom"}(b||(b={})),function(e){e.allPanes="allPanes",e.selectedPane="selectedPane"}(y||(y={}));var k=e("igc_content_pane_component",function(){function e(e){t(this,e),this.rendered=o(this,"rendered",7),this.disabled=!1,this.isSingleFloating=!1}return e.prototype.componentDidRender=function(){this.rendered.emit()},e.prototype.render=function(){var e=this.size||0===this.size?this.size:x,t=this.unpinnedSize?this.unpinnedSize:200,o=P.partNameMap({"content-pane":!0,disabled:this.disabled,"single-floating":this.isSingleFloating});return n(i,{role:"group","aria-label":this.header,"aria-disabled":this.disabled?"true":"false",tabindex:this.disabled?-1:0,style:{flex:this.isFlyout?"0 1 "+t+"px":e+" 1 "+e+"px"},part:o},n("slot",{name:"header"}),n("slot",null))},e}());k.style=":host{--min-pane-size:0px;position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:hidden;width:100%;height:100%;min-width:var(--min-pane-size);min-height:var(--min-pane-size);-webkit-box-sizing:border-box;box-sizing:border-box;pointer-events:all}:host(:focus){outline-style:none}:host([part~=disabled]:not([part~=single-floating])),:host([part~=disabled])>slot:not([name]){pointer-events:none}";var M=e("igc_context_menu_component",function(){function e(e){var n=this;t(this,e),this.menuClosed=o(this,"menuClosed",7),this.activeIndex=0,this.handleDocumentResize=function(){n.menuClosed.emit()},this.handleDocumentMouseDown=function(e){e.composedPath().every((function(e){return e!==n.elem}))&&n.menuClosed.emit()}}return e.prototype.emitMenuClosed=function(){this.menuClosed.emit()},e.prototype.connectedCallback=function(){document.defaultView.addEventListener("resize",this.handleDocumentResize,!1),document.defaultView.addEventListener("mousedown",this.handleDocumentMouseDown,!1)},e.prototype.disconnectedCallback=function(){document.defaultView.removeEventListener("resize",this.handleDocumentResize,!1),document.defaultView.removeEventListener("mousedown",this.handleDocumentMouseDown,!1)},e.prototype.componentDidLoad=function(){var e=null!==this.target.querySelector('slot[name="tabsMoreButton"]'),t=this.menuItemsDiv.getBoundingClientRect(),n=this.elem.getBoundingClientRect(),i=this.target.getRootNode(),o=i.host.getBoundingClientRect(),a="igc-tab-header-component"===i.host.tagName.toLowerCase(),r=a?i.host.parentElement.shadowRoot:i,s=r.host.getBoundingClientRect(),c=r.querySelector('div[part~="tabs-content"]').getBoundingClientRect(),l=o.right-t.right<=0,d=s.bottom+t.bottom>=window.innerHeight||s.height+t.bottom>=window.innerHeight||e&&c.height-t.height>0?c.top+(c.height-t.bottom):o.top-t.top+o.height,h=c.top-t.top,p=l?o.right-t.width:o.left,u=l?o.left:o.right-t.width,g=o.left+(o.width-t.width)/2,f=l?u:p,m=this.orientation===b.bottom?a?d:h:d,v=m+t.height;switch(m=m>=0?m:d,this.position){case"start":f=p;break;case"center":f=o.width>t.width&&g;break;case"stretch":this.menuItemsDiv.style.width=o.width>t.width&&o.width+"px";break;default:f=u}this.orientation===b.bottom&&v>n.height&&(m=h),f-=t.left,this.menuItemsDiv.style.left=f+"px",this.menuItemsDiv.style.top=m+"px",this.menuItemsDiv.style.visibility="visible",this.focusItemAndSetActiveIndex()},e.prototype.focusItemAndSetActiveIndex=function(){var e;null===(e=this.menuItemsDiv.querySelector('div[part="menu-item"]'))||void 0===e||e.focus()},e.prototype.handleKeyboardEvents=function(e,t){var n=this.menuItemsDiv.querySelectorAll('div[part="menu-item"]');"ArrowDown"===t.key?this.activeIndex<n.length-1&&(this.activeIndex++,n[this.activeIndex].focus()):"ArrowUp"===t.key?this.activeIndex>0&&(this.activeIndex--,n[this.activeIndex].focus()):"Enter"===t.key||" "===t.key?(e.clickHandler(),this.emitMenuClosed()):"Escape"===t.key&&this.emitMenuClosed()},e.prototype.handleMenuItemClick=function(e){e.clickHandler(),this.emitMenuClosed()},e.prototype.renderItemIcon=function(e){return n(a,null,"close"===e.iconName&&this.renderCloseButton(),"unpin"===e.iconName&&this.renderUnpinButton(),null!==e.iconName&&"close"!==e.iconName&&"unpin"!==e.iconName&&n("igc-icon-component",{name:e.iconName}))},e.prototype.renderCloseButton=function(){return n("slot",{name:"contextMenuCloseButton"},n("igc-icon-component",{part:"context-menu-close-button",name:"close"}))},e.prototype.renderUnpinButton=function(){return n("slot",{name:"contextMenuUnpinButton"},n("igc-icon-component",{part:"context-menu-unpin-button",name:"unpin"}))},e.prototype.render=function(){var e=this;return n(i,{part:"context-menu",exportparts:"context-menu,\r\n menu-item: context-menu-item,\r\n menu-content: context-menu-content,\r\n context-menu-close-button,\r\n context-menu-unpin-button"},n("div",{role:"menu",part:"menu-content",ref:function(t){return e.menuItemsDiv=t},onMouseDown:function(e){e.preventDefault()}},this.items.map((function(t){var i=P.partNameMap({"menu-item":!0,disabled:t.disabled});return n("div",{role:"menuitem",part:i,tabindex:"-1",onKeyDown:e.handleKeyboardEvents.bind(e,t),onClick:e.handleMenuItemClick.bind(e,t)},n("span",{style:{flexGrow:"1",userSelect:"none"}},t.displayText),e.renderItemIcon(t))}))))},Object.defineProperty(e.prototype,"elem",{get:function(){return r(this)},enumerable:!1,configurable:!0}),e}());M.style=":host{position:absolute;display:block;-webkit-box-sizing:border-box;box-sizing:border-box;top:0;left:0;bottom:0;right:0;z-index:10002;pointer-events:none}:host igc-icon-component svg{width:17px;height:17px}:host igc-icon-component{margin-left:8px}[part=menu-content]{position:absolute;visibility:hidden;color:var(--igc-context-menu-color, var(--igc-text-color, rgba(0, 0, 0, 0.72)));background:var(--igc-context-menu-background, var(--igc-accent-color, #fff));border:1px solid var(--igc-context-menu-background, var(--igc-accent-color, #fff));pointer-events:all;-webkit-box-shadow:0 5px 22px rgba(0, 0, 0, 0.08), 0 12px 17px 2px rgba(0, 0, 0, 0.12), 0 7px 8px -4px rgba(0, 0, 0, 0.26);box-shadow:0 5px 22px rgba(0, 0, 0, 0.08), 0 12px 17px 2px rgba(0, 0, 0, 0.12), 0 7px 8px -4px rgba(0, 0, 0, 0.26);-webkit-box-sizing:border-box;box-sizing:border-box}[part~=menu-item]{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:6px 8px;font-size:0.75em;line-height:1.7;cursor:pointer;-webkit-transition:background 0.25s ease-out, color 0.25s ease-out;transition:background 0.25s ease-out, color 0.25s ease-out;outline-style:none}[part~=menu-item]:hover{background:var(--igc-context-menu-background-active, var(--igc-border-color, #F3F5F7));color:var(--igc-context-menu-color-active, #000)}[part~=menu-item]:focus{background:var(--igc-context-menu-background-active, var(--igc-border-color, #F3F5F7));color:var(--igc-context-menu-color-active, #000)}[part~=disabled]{pointer-events:none;color:var(--igc-disabled-color, rgba(0, 0, 0, 0.38))}";var z,C=function(){function e(){this.map=new Map,this.reversedMap=new Map}return e.prototype.set=function(e,t){this.map.set(e,t),this.reversedMap.set(t,e)},e.prototype.get=function(e){return this.map.get(e)},e.prototype.getByValue=function(e){return this.reversedMap.get(e)},e.prototype.delete=function(e){var t=this.map.get(e);this.map.delete(e),this.reversedMap.delete(t)},e.prototype.has=function(e){return this.map.has(e)},e.prototype.hasValue=function(e){return this.reversedMap.has(e)},e}(),D=function(){function e(e){this.dockManager=e,this.unpinnedLocationMap=new Map}return e.prototype.getContent=function(e){return this.clientContentPanesMap.get(e)},e.prototype.generateUuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},e.prototype.populatePaneParents=function(e,t,n){if(e){e.id||(e.id=this.generateUuid());for(var i=0,o=e.panes;i<o.length;i++){var a=o[i];if(this.paneParentMap.set(a,e),a.id||(a.id=this.generateUuid()),a.type!==d.contentPane||a.hidden)if(a.type===d.splitPane)this.populatePaneParents(a,t,n);else if(a.type===d.tabGroupPane)for(var r=0,s=a.panes;r<s.length;r++){var c=s[r];c.id||(c.id=this.generateUuid()),this.paneParentMap.set(c,a),c.hidden||(this.clientContentPanesMap.set(c.contentId,c),n?this.visibleDocuments.push(c):this.visibleContentPanes.push(c))}else a.type===d.documentHost&&(t&&this.documentHosts.push(a),this.paneParentMap.set(a.rootPane,a),this.populatePaneParents(a.rootPane,t,!0));else this.clientContentPanesMap.set(a.contentId,a),n?this.visibleDocuments.push(a):this.visibleContentPanes.push(a)}}},e.prototype.populatePinLocations=function(e){if(e)for(var t=0,n=e.panes;t<n.length;t++){var i=n[t];if(i.type===d.splitPane)this.populatePinLocations(i);else if(i.type===d.tabGroupPane)for(var o=0,a=i.panes;o<a.length;o++){var r=a[o];this.addContentPanePinLocation(r),this.paneParentMap.set(r,i)}else i.type===d.contentPane&&this.addContentPanePinLocation(i)}},e.prototype.resolvePaneUnpinLocation=function(e){var t;if(e.unpinnedLocation)t=e.unpinnedLocation;else{var n=this.findClosestDocumentHost(e);t=n?this.findPaneUnpinLocation(e,n):h.left}return t},e.prototype.addContentPanePinLocation=function(e){if(!1===e.isPinned){var t=this.resolvePaneUnpinLocation(e);this.unpinnedLocationMap.set(e,t)}},e.prototype.findClosestDocumentHost=function(e){for(var t,n=this.getPanePath(e),i=-1,o=0,a=this.documentHosts;o<a.length;o++){var r=a[o],s=this.getPanePath(r),c=void 0;for(c=0;c<n.length&&n[c]===s[c];c++);c>i&&(i=c,t=r)}return t},e.prototype.findPaneUnpinLocation=function(e,t){for(var n=this.getPanePath(e),i=this.getPanePath(t),o=-1,a=0;a<n.length&&n[a]===i[a];a++)o=a;if(o>=0){var r=n[o],s=r.panes.indexOf(n[o+1]),c=r.panes.indexOf(i[o+1]);return r.orientation===l.horizontal?s<c?h.left:h.right:s<c?h.top:h.bottom}return h.left},e.prototype.removePane=function(e){e===this.dockManager.maximizedPane&&(this.dockManager.maximizedPane=null);var t=this.paneParentMap.get(e);if(t)if(t.type===d.splitPane||t.type===d.tabGroupPane){var n=t.panes.indexOf(e);if(t.panes.splice(n,1),0===t.panes.length)if(t.allowEmpty){var i=this.getRootParent(e);this.isFloatingPane(i)&&this.removeFloatingPaneIfEmpty(i)}else this.removePane(t);else t.type===d.splitPane&&(i=this.getRootParent(t),this.isFloatingPane(i)&&this.removeFloatingPaneIfEmpty(t))}else t.type===d.documentHost&&(t.rootPane=null,this.removePane(t));else if(this.dockManager.layout.floatingPanes){var o=this.dockManager.layout.floatingPanes.indexOf(e);o>-1&&this.dockManager.layout.floatingPanes.splice(o,1)}},e.prototype.removeFloatingPaneIfEmpty=function(e){0===this.getChildContentPanes(e).length&&this.removePane(e)},e.prototype.isFloatingPane=function(e){return!!this.dockManager.layout.floatingPanes&&this.dockManager.layout.floatingPanes.indexOf(e)>-1},e.prototype.addFloatingPane=function(e,t,n,i){var o={type:d.splitPane,orientation:l.vertical,panes:[e]};o.floatingLocation=t,o.floatingWidth=n,o.floatingHeight=i,this.dockManager.layout.floatingPanes||(this.dockManager.layout.floatingPanes=[]),this.dockManager.layout.floatingPanes.push(o),this.dockManager.draggedPane=o,this.initialFloatingPaneLocation=o.floatingLocation,this.forceDragPane=o},e.prototype.getChildContentPanes=function(e){var t=[];return this.getChildContentPanesRecursive(e,t),t},e.prototype.getChildContentPanesRecursive=function(e,t){for(var n=0,i=e.panes;n<i.length;n++){var o=i[n];o.type===d.contentPane?t.push(o):o.type===d.tabGroupPane||o.type===d.splitPane?this.getChildContentPanesRecursive(o,t):o.type===d.documentHost&&this.getChildContentPanesRecursive(o.rootPane,t)}},e.prototype.getChildDocHostRecursive=function(e){for(var t=0,n=e.panes;t<n.length;t++){var i=n[t];if(i.type===d.documentHost)return i;if(i.type===d.splitPane){var o=this.getChildDocHostRecursive(i);if(o)return o}}return null},e.prototype.getVisibleContentPanes=function(e){var t=this;return e.panes.filter((function(e){return t.isContentPaneVisible(e)}))},e.prototype.getPaneToDock=function(e){return e.type===d.contentPane||e.type!==d.tabGroupPane&&e.type!==d.splitPane||1!==e.panes.length?e:e.panes[0]},e.prototype.removeDocumentHost=function(e){var t=this.getChildDocHostRecursive(e);if(t){var n=this.getParent(t),i=n.panes.indexOf(t);n.panes[i]=1===t.rootPane.panes.length?t.rootPane.panes[0]:t.rootPane}},e.prototype.dockToCenter=function(e,t){var n,i;if(e.type===d.tabGroupPane)i=e;else if(e.type===d.contentPane){i={type:d.tabGroupPane,size:e.size,panes:[e]};var o=this.paneParentMap.get(e),a=o.panes.indexOf(e);o.panes[a]=i}else e.type===d.splitPane?i=e:e.type===d.documentHost&&(i=e.rootPane);if(i.type===d.tabGroupPane){var r=t.type===d.contentPane?[t]:this.getChildContentPanes(t);(n=i.panes).push.apply(n,r)}else if(i.type===d.splitPane){var s=t;if((null==t?void 0:t.type)===d.splitPane&&this.dockManager.documentOnlyDrag){this.removeDocumentHost(t);var c=this.getChildContentPanes(t);s=1===c.length?c[0]:s}i.panes.push(s)}},e.prototype.dockToEdge=function(e,t){var n=this.getParent(e),i=n.panes.indexOf(e),o=P.isDockingIndicatorVertical(t),a=P.isSplitPaneVertical(n),r=this.dockingIndicator&&"rtl"===this.dockingIndicator.direction,s=this.dockManager.draggedPane;(null==s?void 0:s.type)===d.splitPane&&this.dockManager.documentOnlyDrag&&!this.dockManager.dropTargetPaneInfo.floatingPaneWithoutDocHost?this.removeDocumentHost(s):(null==s?void 0:s.type)===d.contentPane&&this.dockManager.documentOnlyDrag&&this.dockManager.dropTargetPaneInfo.floatingPaneWithoutDocHost&&(s={type:d.documentHost,rootPane:{type:d.splitPane,orientation:l.horizontal,panes:[s]}});var c=s?this.getPaneToDock(s):this.dockManager.activePane;if(o&&a||!o&&!a){var h=P.isDockingIndicatorBefore(t)&&!r||P.isDockingIndicatorBeforeRTL(t)&&r?i:i+1;n.panes.splice(h,0,c)}else{var p={type:d.splitPane,orientation:a?l.horizontal:l.vertical,panes:P.isDockingIndicatorBefore(t)&&!r||P.isDockingIndicatorBeforeRTL(t)&&r?[c,e]:[e,c],size:e.size};e.size=void 0,c.size=void 0,n.panes[i]=p}},e.prototype.updateLayout=function(){this.dockManager.layout=Object.assign({},this.dockManager.layout)},e.prototype.processLayout=function(){this.paneParentMap=new Map,this.unpinnedLocationMap=new Map,this.clientContentPanesMap=new Map,this.documentHosts=[],this.visibleContentPanes=[],this.visibleDocuments=[];var e=this.dockManager.layout;if(e){if(this.populatePaneParents(e.rootPane,!0,!1),e.floatingPanes){for(var t=new Map(this.dockManager.floatingPaneZIndicesMap),n=0;n<e.floatingPanes.length;n++){var i=e.floatingPanes[n];this.populatePaneParents(i,!1,!1),this.dockManager.floatingPaneZIndicesMap.has(i)?t.delete(i):this.dockManager.floatingPaneZIndicesMap.set(i,n)}for(var o=0,a=t.keys();o<a.length;o++){var r=a[o];this.dockManager.floatingPaneZIndicesMap.delete(r)}}this.populatePinLocations(e.rootPane),this.dockManager.flyoutPane&&!this.unpinnedLocationMap.has(this.dockManager.flyoutPane)&&(this.dockManager.flyoutPane=null)}},e.prototype.getParent=function(e){return this.paneParentMap.get(e)},e.prototype.getRootParent=function(e){return this.getPanePath(e)[0]},e.prototype.getPanePath=function(e){for(var t=[],n=e;n;)t.splice(0,0,n),n=this.paneParentMap.get(n);return t},e.prototype.getDocHostParent=function(e){var t=e;do{t=this.paneParentMap.get(t)}while(t&&t.type!==d.documentHost);return t},e.prototype.resizeFlyoutPane=function(e){var t=this.dockManager.flyoutPane,n=this.unpinnedLocationMap.get(t),i=t.unpinnedSize?t.unpinnedSize:200,o=n===h.left||n===h.top?i+e:i-e;t.unpinnedSize=o,this.updateLayout()},e.prototype.resizePane=function(e,t){var n=this.getParent(e),i=this.getSplitPaneVisibleChildren(n),o=i.indexOf(e),a=i.map((function(e){return e.size||0===e.size?e.size:x})),r=a.reduce((function(e,t){return t+e}),0),s=t*r;i[o-1].size=a[o-1]+s,i[o].size=a[o]-s,this.updateLayout()},e.prototype.togglePin=function(e,t){void 0===t&&(t=y.allPanes);var n=!this.getActualIsPinned(e),i=this.paneParentMap.get(e),o={sourcePane:e,panes:i.type===d.tabGroupPane&&t===y.allPanes?i.panes.filter((function(e){return!1!==e.allowPinning})):[e],newValue:n,location:this.resolvePaneUnpinLocation(e)};if(!this.dockManager.panePinnedToggle.emit(o).defaultPrevented){for(var a=0,r=o.panes;a<r.length;a++)r[a].isPinned=n;this.dockManager.maximizedPane?(this.dockManager.maximizedPane=null,n?this.dockManager.flyoutPane=null:this.flyoutPane(e)):n&&(this.dockManager.flyoutPane=null),this.updateLayout()}},e.prototype.closePane=function(e){var t=e;if(e.type===d.contentPane&&e!==this.dockManager.flyoutPane){var n=this.paneParentMap.get(e);n.type===d.tabGroupPane&&(t=n)}((t.type===d.tabGroupPane?this.removeAllowedPanes(e,t):this.emitPaneClose(e,[t]))||e.hidden)&&e===this.dockManager.flyoutPane&&(this.dockManager.flyoutPane=null),this.updateLayout()},e.prototype.closeFloatingPane=function(e){this.removeAllowedPanes(e,e),this.updateLayout()},e.prototype.emitPaneClose=function(e,t){var n=!1,i={sourcePane:e,panes:t};if(!this.dockManager.paneClose.emit(i).defaultPrevented)for(var o=0,a=i.panes;o<a.length;o++){var r=a[o];this.removePane(r),n=!0}return n},e.prototype.removeAllowedPanes=function(e,t){var n=this,i=this.getChildContentPanes(t).filter((function(e){return n.getActualAllowClose(e)})).filter((function(n){return t.type!==d.tabGroupPane||e.type!==d.contentPane||!1!==n.isPinned}));return this.emitPaneClose(e,i)},e.prototype.flyoutPane=function(e){this.dockManager.flyoutPane=this.dockManager.flyoutPane===e?null:e},e.prototype.maximizePane=function(e){var t=this.getParent(e),n=t&&t.type===d.tabGroupPane&&e!==this.dockManager.flyoutPane?t:e;this.dockManager.maximizedPane=this.dockManager.maximizedPane===n?null:n},e.prototype.moveFloatingPane=function(e,t){e.floatingLocation=t,this.updateLayout()},e.prototype.resizeFloatingPaneStart=function(e,t){var n,i,o,a={sourcePane:e,resizerLocation:t};return!this.dockManager.floatingPaneResizeStart.emit(a).defaultPrevented&&(this.initialFloatingPaneLocation=null!==(n=e.floatingLocation)&&void 0!==n?n:{x:0,y:0},this.initialFloatingPaneWidth=null!==(i=e.floatingWidth)&&void 0!==i?i:x,this.initialFloatingPaneHeight=null!==(o=e.floatingHeight)&&void 0!==o?o:x,!0)},e.prototype.resizeFloatingPane=function(e,t){var n=e.floatingLocation?e.floatingLocation.x:0,i=e.floatingLocation?e.floatingLocation.y:0,o=e.floatingWidth?e.floatingWidth:x,a=e.floatingHeight?e.floatingHeight:x,r=x,s=x,c=this.initialFloatingPaneWidth,l=this.initialFloatingPaneHeight,d=this.initialFloatingPaneLocation,h=t.dragMoveArgs.totalOffsetY,p=t.dragMoveArgs.totalOffsetX,g=n,f=i,m=o,v=a,b=document.documentElement.clientHeight,y=document.documentElement.clientWidth;switch(t.resizerLocation){case u.top:case u.topLeft:case u.topRight:(v=l-h)<s&&(h=l-s,v=s),(f=d.y+h)<0?(v+=f,f=0):f>=b-1&&(f=b-1);break;case u.bottom:case u.bottomLeft:case u.bottomRight:(v=l+h)<s&&(v=s),f+v>b&&(v=b-f)}switch(t.resizerLocation){case u.left:case u.topLeft:case u.bottomLeft:(m=c-p)<r&&(p=c-r,m=r),(g=d.x+p)<0?(m+=g,g=0):g>=y&&(g=y);break;case u.right:case u.topRight:case u.bottomRight:(m=c+p)<r&&(m=r),g+m>y&&(m=y-g)}if(n!==g||i!==f||o!==m||a!==v){var P={sourcePane:e,oldWidth:o,newWidth:m,oldHeight:a,newHeight:v,oldLocation:{x:n,y:i},newLocation:{x:g,y:f},resizerLocation:t.resizerLocation};this.dockManager.floatingPaneResizeMove.emit(P).defaultPrevented?t.dragMoveArgs.cancel=!0:(e.floatingLocation=P.newLocation,e.floatingWidth=P.newWidth,e.floatingHeight=P.newHeight,this.updateLayout())}},e.prototype.resizeFloatingPaneEnd=function(e,t){this.dockManager.floatingPaneResizeEnd.emit({sourcePane:e,resizerLocation:t}),this.dockManager.layoutChange.emit()},e.prototype.floatPane=function(e,t,n,i,o){var a=this,r=[e],s=e,c=this.paneParentMap.get(e);if(e!==this.dockManager.flyoutPane&&c.type===d.tabGroupPane)if(c.allowEmpty){var l=__spreadArray([],c.panes);r=l,s=1===c.panes.length?e:{type:d.tabGroupPane,panes:l,selectedIndex:c.selectedIndex}}else r=[c],s=c;r.forEach((function(e){return a.removePane(e)})),this.addFloatingPane(s,{x:t,y:n},i,o),e===this.dockManager.flyoutPane&&(e.isPinned=!0,this.dockManager.flyoutPane=null),this.updateLayout()},e.prototype.floatTab=function(e,t,n,i,o){var a;this.removePane(e),a=this.getDocHostParent(e)&&e.documentOnly?{type:d.documentHost,rootPane:{type:d.splitPane,orientation:l.vertical,panes:[e]}}:e,this.addFloatingPane(a,{x:t,y:n},i,o),this.updateLayout()},e.prototype.hasFloatingPaneHeader=function(e){var t=this.getSplitPaneVisibleChildren(e);if(t&&t.length){if(t.length>1)return!0;var n=t[0];if(n.type===d.splitPane)return this.hasFloatingPaneHeader(n);if(n.type===d.documentHost)return!0}return!1},e.prototype.rootDockPane=function(e){var t=this.dockManager.layout,n=t.rootPane,i=this.dockManager.draggedPane?this.getPaneToDock(this.dockManager.draggedPane):this.dockManager.activePane;this.removePane(i);var o=e===c.top||e===c.bottom,a=P.isSplitPaneVertical(n),r=this.dockingIndicator&&"rtl"===this.dockingIndicator.direction;if(o&&a||!o&&!a){var s=e===c.left&&!r||e===c.right&&r||e===c.top?0:n.panes.length;n.panes.splice(s,0,i)}else{var h={type:d.splitPane,orientation:a?l.horizontal:l.vertical,panes:e===c.left&&!r||e===c.right&&r||e===c.top?[i,n]:[n,i]};n.size=void 0,i.size=void 0,t.rootPane=h}this.updateLayout()},e.prototype.dockPane=function(e){var t,n=null!==(t=this.dockManager.draggedPane)&&void 0!==t?t:this.dockManager.activePane,i=this.dockManager.dropTargetPaneInfo;this.removePane(n);var o=this.dockManager.draggedPane?i.pane:this.getParent(this.dockManager.activePane);switch(e){case c.center:this.dockToCenter(o,n);break;case c.left:case c.top:case c.right:case c.bottom:this.dockToEdge(o,e);break;case c.outerLeft:case c.outerTop:case c.outerRight:case c.outerBottom:var a=this.dockManager.dropTargetPaneInfo.docHost;this.dockToEdge(a,e)}this.updateLayout()},e.prototype.getActualIsPinned=function(e){return!1!==e.isPinned},e.prototype.getActualAllowClose=function(e){return!1!==e.allowClose},e.prototype.isContentPaneVisible=function(e){return!1!==e.isPinned&&!0!==e.hidden},e.prototype.getSplitPaneVisibleChildren=function(e){var t=this;return e.panes.filter((function(e){return e.type===d.contentPane?t.isContentPaneVisible(e):e.type===d.splitPane?e.allowEmpty||t.getSplitPaneVisibleChildren(e).length:e.type===d.tabGroupPane?e.allowEmpty||e.panes.some((function(e){return t.isContentPaneVisible(e)})):e.type===d.documentHost?e.rootPane.allowEmpty||t.getSplitPaneVisibleChildren(e.rootPane).length:void 0}))},e.prototype.closeTabPane=function(e){this.emitPaneClose(e,[e]),this.updateLayout()},e.prototype.bringFloatingPaneOnTop=function(e){for(var t=this.dockManager.layout.floatingPanes,n=this.dockManager.floatingPaneZIndicesMap,i=n.get(e),o=0,a=t;o<a.length;o++){var r=a[o],s=n.get(r);s<i||(s>i?n.set(r,s-1):n.set(r,t.length-1))}this.dockManager.floatingPaneZIndicesMap=new Map(n)},e.prototype.createContextMenuItems=function(e){var t=this,n=[];return this.getActualAllowClose(e)&&n.push({displayText:this.dockManager.resourceStrings.close,iconName:"close",clickHandler:function(){return t.closeTabPane(e)}}),!1!==e.allowPinning&&n.push({displayText:this.dockManager.resourceStrings.unpin,iconName:"unpin",clickHandler:function(){return t.togglePin(e,y.selectedPane)}}),n},e.prototype.dragPaneStart=function(e,t,n,i){var o,a,r;if(this.dockManager.maximizedPane)return!1;if(e.type===d.contentPane)a=(r=this.getParent(e)).type===d.tabGroupPane&&e!==this.dockManager.flyoutPane?r.panes:[e];else{if(this.dockManager.draggedPane===e)return!0;a=this.getChildContentPanes(e)}var s=a.some((function(e){return!1===e.allowDocking}))&&a.some((function(e){return!1===e.allowFloating}));if(e.type===d.contentPane&&s)return!1;if(this.dockManager.paneDragStart.emit({sourcePane:e,panes:a}).defaultPrevented)return!1;if(this.draggedPanes=a,this.initialDragClientPoint={x:n,y:i},e.type!==d.splitPane){if(this.draggedPanes.some((function(e){return!1===e.allowFloating})))return this.dockManager.draggedPane=a.length>1?r:e,!0;var c={type:p.floatPane,location:{x:t.x,y:t.y},width:t.width,height:t.height},l=this.dockManager.paneDragOver.emit({sourcePane:e,panes:a,action:c,isValid:!0});return!l.defaultPrevented&&(l.detail.isValid?(this.floatPane(e,t.x,t.y,c.width,c.height),!1):(this.dockManager.draggedPane=a.length>1?r:e,!0))}return this.dockManager.draggedPane=e,this.initialFloatingPaneLocation=null!==(o=e.floatingLocation)&&void 0!==o?o:{x:0,y:0},!0},e.prototype.dragPaneMove=function(e,t){var n=this.dockManager.draggedPane;if(n.type===d.splitPane){var i=n.floatingLocation?n.floatingLocation:{x:0,y:0},o={x:this.initialFloatingPaneLocation.x+e-this.initialDragClientPoint.x,y:this.initialFloatingPaneLocation.y+t-this.initialDragClientPoint.y},a=this.dockManager.paneDragOver.emit({sourcePane:n,panes:this.draggedPanes,action:{type:p.moveFloatingPane,oldLocation:i,newLocation:o},isValid:!0});if(a.defaultPrevented)return!1;a.detail.isValid&&this.moveFloatingPane(n,o),this.dockManager.isValidDrop=a.detail.isValid}return this.dragOver()},e.prototype.dragPaneEnd=function(){var e,t=this.dockingIndicator,n=null!==(e=this.dockManager.draggedPane)&&void 0!==e?e:this.draggedTab,i=!1;return this.dockManager.paneDragEnd.emit({sourcePane:n,panes:this.draggedPanes}),t&&this.dockManager.isValidDrop&&(n.type===d.contentPane&&!1===n.isPinned&&(n.isPinned=!0,n===this.dockManager.flyoutPane&&(this.dockManager.flyoutPane=null)),t.isRoot?this.rootDockPane(t.position):this.dockPane(t.position),i=!0),this.draggedPanes=null,this.draggedTab=null,this.dockManager.draggedPane=null,this.dockManager.dropTargetPaneInfo=null,this.dockManager.dropShadowRect=null,this.dockManager.isValidDrop=!0,this.dockManager.layoutChange.emit(),i},e.prototype.dragOver=function(){var e;if(this.dockingIndicator){var t=this.dockManager.paneDragOver.emit({sourcePane:this.dockManager.draggedPane,panes:this.draggedPanes,action:{type:p.dockPane,dockingIndicator:this.dockingIndicator,targetPane:null===(e=this.dockManager.dropTargetPaneInfo)||void 0===e?void 0:e.pane},isValid:!0});if(t.defaultPrevented)return!1;this.dockManager.isValidDrop=t.detail.isValid,this.dockManager.dropShadowRect=this.dockManager.isValidDrop?this.dockingIndicator.isRoot?this.getDropShadowRectRoot():this.getDropShadowRect():null}else this.dockManager.dropShadowRect=null,this.dockManager.draggedPane.type!==d.splitPane&&(this.dockManager.isValidDrop=!1);return!0},e.prototype.dragTabStart=function(e){return this.shiftLeftThreshold=Number.MAX_VALUE,this.shiftRightThreshold=0,this.dockManager.draggedPane===e||!this.dockManager.paneDragStart.emit({sourcePane:e,panes:[e]}).defaultPrevented&&(this.initialTabHeaderClickOffset=null,this.draggedTab=e,this.draggedPanes=[e],!0)},e.prototype.dragTabMove=function(e,t,n){var i=t.clientX,o=t.clientY,a=t.offsetX,r=t.totalOffsetX,s=t.totalOffsetY,c=n.headerRect,l=n.prevHeaderRect,d=n.nextHeaderRect,h=n.lastVisibleHeaderRect,u=n.tabsRect;if(!this.initialTabHeaderClickOffset){var g=i-r-c.left,f=o-s-c.top;this.initialTabHeaderClickOffset={x:g,y:f}}if(!1===e.allowFloating&&(i<u.left||i>u.right||o<c.top||o>c.bottom))return this.dockManager.draggedPane=e,this.dragOver();this.dockManager.draggedPane=null,this.dockManager.isValidDrop=!0;var m=this.getParent(e).panes.indexOf(e);if(l&&i<c.left&&i<this.shiftLeftThreshold&&a<0){this.shiftLeftThreshold=l.left;var v={type:p.moveTab,oldIndex:m,newIndex:m-1};if((b=this.dockManager.paneDragOver.emit({sourcePane:e,panes:[e],action:v,isValid:!0})).defaultPrevented)return!1;if(!b.detail.isValid)return!0;this.shiftTabLeft(e)}else if(d&&i>c.right&&i>this.shiftRightThreshold&&a>0&&(this.shiftRightThreshold=d.right,c.top===d.top)){var b;if(v={type:p.moveTab,oldIndex:m,newIndex:m+1},(b=this.dockManager.paneDragOver.emit({sourcePane:e,panes:[e],action:v,isValid:!0})).defaultPrevented)return!1;if(!b.detail.isValid)return!0;this.shiftTabRight(e)}return!((Math.abs(s)>50||u.left-i>50||i-h.right>50)&&!1!==e.allowFloating&&!this.dockManager.maximizedPane)||this.floatTabHeader(e,i,o,u)},e.prototype.floatTabHeader=function(e,t,n,i){var o,a,r=new DOMRect(t-this.initialTabHeaderClickOffset.x,n-this.initialTabHeaderClickOffset.y,i.width,i.height);e.type===d.contentPane&&(o=(a=this.getParent(e)).type===d.tabGroupPane&&e!==this.dockManager.flyoutPane?a.panes:[e]),this.draggedTab=null;var s={type:p.floatPane,location:{x:r.x,y:r.y},width:r.width,height:r.height},c=this.dockManager.paneDragOver.emit({sourcePane:e,panes:o,action:s,isValid:!0});return!(c.defaultPrevented||c.detail.isValid&&(this.initialDragClientPoint={x:t,y:n},this.floatTab(e,r.x,r.y,s.width,s.height),1))},e.prototype.resolveChildPanesAllowMaximize=function(e){var t=this;return this.getChildContentPanes(e).filter((function(e){return t.isContentPaneVisible(e)})).every((function(e){var n;return null!==(n=e.allowMaximize)&&void 0!==n?n:t.dockManager.allowMaximize}))},e.prototype.normalizeMaximizedPane=function(e){this.dockManager.maximizedPane&&(this.dockManager.maximizedPane.type===d.splitPane||this.dockManager.maximizedPane.type===d.tabGroupPane?this.getChildContentPanes(this.dockManager.maximizedPane):[this.dockManager.maximizedPane]).every((function(t){return t!==e}))&&this.maximizePane(this.dockManager.maximizedPane)},e.prototype.resolveAllowMaximize=function(e){var t,n;if(e.type===d.splitPane||e.type===d.tabGroupPane)return this.resolveChildPanesAllowMaximize(e);if(e.type===d.contentPane){if(!this.getActualIsPinned(e))return null!==(t=e.allowMaximize)&&void 0!==t?t:this.dockManager.allowMaximize;var i=this.getParent(e);return i.type===d.tabGroupPane?this.resolveChildPanesAllowMaximize(i):null!==(n=e.allowMaximize)&&void 0!==n?n:this.dockManager.allowMaximize}},e.prototype.getDropShadowRect=function(){var e,t=this.dropTargetParentRect,n=this.dockManager.dropTargetPaneInfo;if(n){var i=new DOMRect,o=null!==(e=this.getPaneToDock(this.dockManager.draggedPane).size)&&void 0!==e?e:x,a=P.isDockingIndicatorOuter(this.dockingIndicator.position),r=a?t:n.targetRect;if(this.dockingIndicator.position===c.center)return i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height,i;var s=a?n.docHost:n.pane,l=this.getParent(s),d=this.getSplitPaneVisibleChildren(l),h=d.indexOf(this.dockManager.draggedPane);h>-1&&d.splice(h,1);var p=d.indexOf(s),u=P.isDockingIndicatorVertical(this.dockingIndicator.position),g=P.isSplitPaneVertical(l),f=u&&g||!u&&!g,m="rtl"===this.dockingIndicator.direction,v=d.reduce((function(e,t){return e+(t.size||x)}),0),b=!m||u?d.slice(0,p).reduce((function(e,t){return e+(t.size||x)}),0):d.slice(p,d.length).reduce((function(e,t){return e+(t.size||x)}),0),y=!m||u?d.slice(0,p+1).reduce((function(e,t){return e+(t.size||x)}),0):d.slice(p+1,d.length).reduce((function(e,t){return e+(t.size||x)}),0);switch(this.dockingIndicator.position){case c.left:case c.outerLeft:i.x=r.x,i.y=r.y,i.height=r.height,f?(i.width=o/(o+v)*t.width,i.x=m?t.left+y/(o+v)*t.width:t.left+b/(o+v)*t.width):i.width=t.width/2;break;case c.right:case c.outerRight:i.y=r.y,i.height=r.height,f?(i.width=o/(o+v)*t.width,i.x=m?t.left+b/(o+v)*t.width:t.left+y/(o+v)*t.width):(i.width=t.width/2,i.x=t.right-i.width);break;case c.top:case c.outerTop:i.x=r.x,i.y=r.y,i.width=r.width,f?(i.height=o/(o+v)*t.height,i.y=t.top+b/(o+v)*t.height):i.height=t.height/2;break;case c.bottom:case c.outerBottom:i.x=r.x,i.width=r.width,f?(i.height=o/(o+v)*t.height,i.y=t.top+y/(o+v)*t.height):(i.height=t.height/2,i.y=t.bottom-i.height)}return i}},e.prototype.getDropShadowRectRoot=function(){var e,t=this.dropTargetParentRect,n=new DOMRect,i=null!==(e=this.getPaneToDock(this.dockManager.draggedPane).size)&&void 0!==e?e:x,o=this.getSplitPaneVisibleChildren(this.dockManager.layout.rootPane),a=o.indexOf(this.dockManager.draggedPane);a>-1&&o.splice(a,1);var r=o.reduce((function(e,t){return e+(t.size||x)}),0),s=P.isDockingIndicatorVertical(this.dockingIndicator.position),l=P.isSplitPaneVertical(this.dockManager.layout.rootPane),d=s&&l||!s&&!l,h=0===o.length;switch(this.dockingIndicator.position){case c.left:n.x=t.x,n.y=t.y,n.height=t.height,n.width=d||h?i/(i+r)*t.width:t.width/2;break;case c.right:n.y=t.y,n.height=t.height,n.width=d||h?n.width=i/(i+r)*t.width:t.width/2,n.x=t.right-n.width;break;case c.top:n.x=t.x,n.y=t.y,n.width=t.width,n.height=d||h?i/(i+r)*t.height:t.height/2;break;case c.bottom:n.x=t.x,n.width=t.width,n.height=d||h?i/(i+r)*t.height:t.height/2,n.y=t.bottom-n.height}return n},e.prototype.selectHiddenTab=function(e,t){var n=e.panes.indexOf(t);e.panes.splice(n,1),e.panes.splice(0,0,t),e.selectedIndex=0,this.updateLayout()},e.prototype.shiftTabLeft=function(e){var t=this.getParent(e),n=t.panes.indexOf(e);n>0&&(t.panes.splice(n,1),t.panes.splice(n-1,0,e),t.selectedIndex=n-1,this.updateLayout()),this.forceDragTabHeader=e},e.prototype.shiftTabRight=function(e){var t=this.getParent(e),n=t.panes.indexOf(e);n<t.panes.length-1&&(t.panes.splice(n,1),t.panes.splice(n+1,0,e),t.selectedIndex=n+1,this.updateLayout()),this.forceDragTabHeader=e},e.prototype.cacheDocumentsOrder=function(){this.documentsCache=this.visibleDocuments.filter((function(e){return!e.disabled}))},e.prototype.cacheContentPanesOrder=function(){this.contentPanesCache=this.visibleContentPanes.filter((function(e){return!e.disabled}))},e.prototype.focusPrevContentPane=function(e){var t=e?this.documentsCache:this.contentPanesCache,n=t.indexOf(this.dockManager.activePane),i=n>0?t[n-1]:t[t.length-1];this.normalizeMaximizedPane(i),this.dockManager.activePane=i},e.prototype.focusNextContentPane=function(e){var t=e?this.documentsCache:this.contentPanesCache,n=t.indexOf(this.dockManager.activePane),i=n>=0&&n<t.length-1?t[n+1]:t[0];this.normalizeMaximizedPane(i),this.dockManager.activePane=i},e}(),I=function(){function e(e){this.service=e}return e.prototype.handleKeydown=function(e){if(!this.service.dockManager.disableKeyboardNavigation){var t=this.service.dockManager.activePane,n=P.isControlOrMetaPressed(e),i=P.isAltPressed(e),o=e.shiftKey;if("Control"===e.key||"Meta"===e.key||"OS"===e.key)this.service.cacheDocumentsOrder();else if("Alt"===e.key||"AltGraph"===e.key)this.service.cacheContentPanesOrder();else if("F6"===e.key||e.key.startsWith("Arrow")&&!o&&n)this.handleFocusPane(e),e.stopPropagation();else if("F3"===e.key&&i&&t)this.service.dockManager.focusElement(),this.service.closePane(t),e.stopPropagation();else if(e.key.startsWith("Arrow")&&o&&t)this.service.dockManager.focusElement(),this.handleDockPane(e),e.stopPropagation();else{if("F7"!==e.key&&"F8"!==e.key||!i&&!n)return;this.setPaneNavigatorMeta(i,n,o),e.stopPropagation()}}},e.prototype.handleFocusPane=function(e){var t=P.isAltPressed(e),n=P.isControlOrMetaPressed(e),i=e.shiftKey,o="F6"===e.key,a="ArrowLeft"===e.key,r="ArrowRight"===e.key;t&&i&&o?this.service.focusPrevContentPane(!1):t&&o?this.service.focusNextContentPane(!1):n&&i&&o||n&&a?this.service.focusPrevContentPane(!0):(n&&o||n&&r)&&this.service.focusNextContentPane(!0)},e.prototype.handleDockPane=function(e){var t=e.key,n=P.isControlOrMetaPressed(e),i=e.shiftKey;if(n&&i)this.handleRootDockPane(t);else if(i){var o=this.service.dockManager.activePane,a=this.service.getParent(o);a.type===d.tabGroupPane&&a.panes.length>1&&this.handleInnerDockPane(t)}},e.prototype.handleRootDockPane=function(e){switch(e){case"ArrowUp":this.service.rootDockPane(c.top);break;case"ArrowDown":this.service.rootDockPane(c.bottom);break;case"ArrowLeft":this.service.rootDockPane(c.left);break;case"ArrowRight":this.service.rootDockPane(c.right)}},e.prototype.handleInnerDockPane=function(e){switch(e){case"ArrowUp":this.service.dockPane(c.top);break;case"ArrowDown":this.service.dockPane(c.bottom);break;case"ArrowLeft":this.service.dockPane(c.left);break;case"ArrowRight":this.service.dockPane(c.right)}},e.prototype.setPaneNavigatorMeta=function(e,t,n){var i=0,o=this.service.visibleContentPanes.concat(this.service.visibleDocuments);if(o.length>0){t?i=this.service.visibleDocuments.length>0?n?this.service.visibleContentPanes.length+this.service.visibleDocuments.length-1:this.service.visibleContentPanes.length:n?this.service.visibleContentPanes.length-1:0:e&&(i=n?this.service.visibleContentPanes.length>0?this.service.visibleContentPanes.length-1:this.service.visibleDocuments.length-1:0);var a={activePanes:this.service.visibleContentPanes,activeDocuments:this.service.visibleDocuments,initialIndex:i,previousActivePaneIndex:o.indexOf(this.service.dockManager.activePane)};this.service.dockManager.activePane=null,this.service.dockManager.navigationPaneMeta=a}},e}();!function(e){e.click="click",e.drop="drop",e.maximizeOrMinimize="maximizeOrMinimize"}(z||(z={}));var H=e("ngx_flexlayout",function(){function e(e){var n=this;t(this,e),this.paneHeaderConnected=o(this,"paneHeaderConnected",7),this.paneHeaderDisconnected=o(this,"paneHeaderDisconnected",7),this.tabHeaderConnected=o(this,"tabHeaderConnected",7),this.tabHeaderDisconnected=o(this,"tabHeaderDisconnected",7),this.splitterResizeStart=o(this,"splitterResizeStart",7),this.splitterResizeEnd=o(this,"splitterResizeEnd",7),this.paneClose=o(this,"paneClose",7),this.panePinnedToggle=o(this,"panePinnedToggle",7),this.activePaneChanged=o(this,"activePaneChanged",7),this.paneDragStart=o(this,"paneDragStart",7),this.paneDragOver=o(this,"paneDragOver",7),this.paneDragEnd=o(this,"paneDragEnd",7),this.floatingPaneResizeMove=o(this,"floatingPaneResizeMove",7),this.floatingPaneResizeEnd=o(this,"floatingPaneResizeEnd",7),this.floatingPaneResizeStart=o(this,"floatingPaneResizeStart",7),this.layoutChange=o(this,"layoutChange",7),this._tabHeaderIconClicked=!1,this.service=new D(this),this.keyboardService=new I(this.service),this.activePaneInternalSet=!1,this.domObserver=new MutationObserver(this.mutationCallback.bind(this)),this.shouldMovePane=!1,this.scheduledCallbacks=[],this.shouldClearActivePane=!0,this.isDragging=!1,this.splitterOffset=1,this.templatableComponents=[{slot:"paneHeaderCloseButton",targetName:"igc-pane-header-component",targetSlot:"paneHeaderCloseButton",targetPart:"pane-header-close-button"},{slot:"tabHeaderCloseButton",targetName:"igc-tab-header-component",targetSlot:"tabHeaderCloseButton",targetPart:"tab-header-close-button"},{slot:"tabHeaderCloseButton",targetName:"igc-context-menu-component",targetSlot:"contextMenuCloseButton",targetPart:"context-menu-close-button"},{slot:"closeButton",targetName:"igc-pane-header-component",targetSlot:"paneHeaderCloseButton",targetPart:"pane-header-close-button"},{slot:"closeButton",targetName:"igc-tab-header-component",targetSlot:"tabHeaderCloseButton",targetPart:"tab-header-close-button"},{slot:"closeButton",targetName:"igc-context-menu-component",targetSlot:"contextMenuCloseButton",targetPart:"context-menu-close-button"},{slot:"moreTabsButton",targetName:"igc-tabs-component",targetSlot:"tabsMoreButton",targetPart:"tabs-more-button"},{slot:"maximizeButton",targetName:"igc-pane-header-component",targetSlot:"paneHeaderMaximizeButton",targetPart:"pane-header-maximize-button"},{slot:"maximizeButton",targetName:"igc-tabs-component",targetSlot:"tabsMaximizeButton",targetPart:"tabs-maximize-button"},{slot:"minimizeButton",targetName:"igc-pane-header-component",targetSlot:"paneHeaderMinimizeButton",targetPart:"pane-header-minimize-button"},{slot:"minimizeButton",targetName:"igc-tabs-component",targetSlot:"tabsMinimizeButton",targetPart:"tabs-minimize-button"},{slot:"pinButton",targetName:"igc-pane-header-component",targetSlot:"paneHeaderPinButton",targetPart:"pane-header-pin-button"},{slot:"unpinButton",targetName:"igc-pane-header-component",targetSlot:"paneHeaderUnpinButton",targetPart:"pane-header-unpin-button"},{slot:"unpinButton",targetName:"igc-context-menu-component",targetSlot:"contextMenuUnpinButton",targetPart:"context-menu-unpin-button"},{slot:"moreOptionsButton",targetName:"igc-tab-header-component",targetSlot:"tabHeaderMoreOptionsButton",targetPart:"tab-header-more-options-button"},{slot:"splitterHandle",targetName:"igc-splitter-component",targetSlot:"splitterHandle",targetPart:"splitter-handle"}],this.floatingPaneZIndicesMap=new Map,this.templates=new Map,this.allowMaximize=!0,this.allowFloatingPanesResize=!0,this.disableKeyboardNavigation=!1,this.activePane=null,this.updateTemplates=function(){if(!(n.templates.size>0)){var e=n.element.shadowRoot.querySelectorAll("slot"),t=Array.from(e),i=new Map,o=n.templatableComponents.map((function(e){return e.slot}));o.forEach((function(e){var o=t.filter((function(t){return t.name===e}));!n.templates.get(e)&&o.length>0&&o[0].assignedElements().length>0&&i.set(e,o[0].assignedElements()[0])})),n.templates=i}},this.handleCustomContentFocusIn=function(e){var t=e.currentTarget;if(t){var i=n.service.clientContentPanesMap.get(t.slot);if(!i)return;n.setActivePane(i)}},this._isValidDrop=!0,this.handleShadowRootFocusOut=function(){if(!n.paneToFocus){var e=n.getRootNode();requestAnimationFrame((function(){n.element.shadowRoot.activeElement||e.activeElement!==n.element||n.reason===z.maximizeOrMinimize||n.clearActivePane()}))}}}return e.prototype.flyoutPaneChanged=function(e){var t=this;e&&this.scheduleAfterRender((function(){t.setFocus(e)}))},e.prototype.layoutChanged=function(){this.service.processLayout(),this.isDragging||this.layoutChange.emit()},e.prototype.draggedPaneChanged=function(){if(this.draggedPane){var e=this.draggedPane.type===d.contentPane?[this.draggedPane]:this.service.getChildContentPanes(this.draggedPane);this.showDockingIndicators=e.every((function(e){return!1!==e.allowDocking})),this.documentOnlyDrag=e.some((function(e){return e.documentOnly}))}else this.showDockingIndicators=!1,this.documentOnlyDrag=!1},e.prototype.dropPositionChanged=function(){var e,t;this.paneDragMoved(null===(e=this.dropPosition)||void 0===e?void 0:e.x,null===(t=this.dropPosition)||void 0===t?void 0:t.y)},e.prototype.activePaneChange=function(e,t){var n,i=this,o={newPane:e,oldPane:t};if(this.flyoutPane&&e&&e!==this.flyoutPane&&this.service.flyoutPane(this.flyoutPane),this.activePaneChanged.emit(o),this.contentPaneId=(null==e?void 0:e.contentId)||this.contentPaneId,this.activePaneInternalSet)this.activePaneInternalSet=!1;else{if(e){if(!1===e.isPinned)return requestAnimationFrame((function(){i.service.flyoutPane(e)})),void(this.paneToFocus=e);var a=this.service.getParent(e);if(a.type===d.tabGroupPane&&a.panes.length>1){var r=this.service.getVisibleContentPanes(a),s=this.tabHeadersMap.get(e),c=this.tabHeadersMap.get(r[0]).getBoundingClientRect();if(s.getBoundingClientRect().top!==c.top)return this.service.selectHiddenTab(a,e),void(this.paneToFocus=e);var l=r.indexOf(e);if((null!==(n=a.selectedIndex)&&void 0!==n?n:0)!==l)return a.selectedIndex=l,void(this.paneToFocus=e)}}this.scheduleAfterRender((function(){i.setFocus(e)}))}},e.prototype.handleFocusOut=function(e){var t=this;if(!this.paneToFocus){var n=this.getRootNode();this._tabHeaderIconClicked||this.isDragging||requestAnimationFrame((function(){t.element.contains(n.activeElement)||t.clearActivePane()})),this._tabHeaderIconClicked=!1}},e.prototype.handleKeyDown=function(e){this.keyboardService.handleKeydown(e)},e.prototype.handlePointerDown=function(e){var t=e.composedPath().filter((function(e){return e instanceof HTMLElement})).map((function(e){return e})).filter((function(e){return e.attributes.getNamedItem("part")&&("tabs-minimize-button"===e.attributes.getNamedItem("part").value||"tabs-maximize-button"===e.attributes.getNamedItem("part").value)})).length>0;t&&(this.reason=z.maximizeOrMinimize)},e.prototype.handlePointerUp=function(){this.reason=null},e.prototype.dropPane=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){return e=this.handlePaneDragEnd(),[2,Promise.resolve(e)]}))}))},e.prototype.removePane=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.service.removePane(e),[2]}))}))},e.prototype.connectedCallback=function(){this.element.shadowRoot.addEventListener("focusout",this.handleShadowRootFocusOut),this.domObserver.observe(this.element,{attributes:!0,subtree:!0,childList:!0});for(var e=0,t=Array.from(this.element.children);e<t.length;e++){var n=t[e];null==n||n.addEventListener("focusin",this.handleCustomContentFocusIn)}},e.prototype.componentWillLoad=function(){if(this.contextMenuMeta=null,this.navigationPaneMeta=null,this.layout&&this.layoutChanged(),!this.resourceStrings){var e=this.element.closest("[lang]"),t=e?e.lang.toLowerCase():"en";this.resourceStrings=g.has(t)?g.get(t):g.get("en")}},e.prototype.componentDidRender=function(){for(;this.scheduledCallbacks.length;)this.scheduledCallbacks.shift()();this.processTemplates()},e.prototype.disconnectedCallback=function(){this.element.shadowRoot.removeEventListener("focusout",this.handleShadowRootFocusOut),this.removeCustomContentEventListeners(),this.domObserver.disconnect()},e.prototype.focusElement=function(){this.element.focus()},e.prototype.handleTabsRendered=function(e){var t;if(this.reason===z.drop&&(null===(t=e.panes)||void 0===t?void 0:t.length)>0){var n=this.findFocusablePane(e.panes);(null==n?void 0:n.contentId)===this.contentPaneId&&(e.selectedIndex=e.panes.indexOf(n),this.setActivePane(n),this.setFocus(n))}},e.prototype.handleSplitPaneRendered=function(e){if(this.reason===z.drop){var t=this.findFocusablePane(e);(null==t?void 0:t.contentId)===this.contentPaneId&&(this.setActivePane(t),this.setFocus(t))}},e.prototype.findFocusablePane=function(e,t){for(var n=this,i=0,o=e.filter((function(e){return e.type===d.splitPane}));i<o.length;i++){var a=o[i];if(t)return t;var r=a;t=this.findFocusablePane(r.panes)}for(var s=0,c=e.filter((function(e){return e.type===d.tabGroupPane}));s<c.length;s++){if(a=c[s],t)return t;var l=a;t=l.selectedIndex?l.panes[l.selectedIndex]:this.findFocusablePane(l.panes)}for(v