balkan-orgchart-js 9.2.38 → 9.2.40

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/orgchart.d.mts CHANGED
@@ -5749,47 +5749,20 @@ declare namespace OrgChart {
5749
5749
 
5750
5750
 
5751
5751
  /**
5752
- * Controls which related nodes are visually emphasized when hovering a node.
5752
+ * Controls which related nodes are visually highlighted when hovering over a node.
5753
5753
  *
5754
- * This option helps users understand relationships in the chart by
5755
- * automatically highlighting connected nodes while dimming unrelated ones.
5754
+ * Available modes:
5756
5755
  *
5757
- * Available values:
5758
- *
5759
- * - `'parents'`
5760
- * Highlights all ancestor nodes of the hovered node
5761
- * (parent, grandparent, etc.).
5762
- *
5763
- * - `'children'`
5764
- * Highlights all descendant nodes of the hovered node
5765
- * (children, grandchildren, etc.).
5766
- *
5767
- * - `'none'`
5768
- * Disables hover-based relationship highlighting.
5769
- *
5770
- * - `'sameLevel'`
5771
- * Highlights nodes on the same hierarchy level as the hovered node
5772
- * (siblings and other nodes in the same row/depth).
5773
- *
5774
- * - `'childrenAndParents'`
5775
- * Highlights both ancestor and descendant nodes of the hovered node.
5756
+ * - 'parents' → Highlights only the parent chain of the hovered node.
5757
+ * - 'children' → Highlights only the direct and indirect children of the hovered node.
5758
+ * - 'sameLevel' → Highlights nodes that share the same parent (siblings).
5759
+ * - 'childrenAndParents' Highlights both ancestors and descendants of the hovered node.
5760
+ * - 'self' → Highlights only the hovered node itself (no relationships).
5761
+ * - 'none' → Disables hover highlighting entirely.
5776
5762
  *
5777
5763
  * @default 'none'
5778
- *
5779
- * @example
5780
- * // Highlight managers above the hovered employee
5781
- * highlightOnHover: 'parents'
5782
- *
5783
- * @example
5784
- * // Highlight the hovered node's team below it
5785
- * highlightOnHover: 'children'
5786
- *
5787
- * @example
5788
- * // Highlight reporting chain in both directions
5789
- * highlightOnHover: 'childrenAndParents'
5790
5764
  */
5791
-
5792
- highlightOnHover?: 'parents' | 'children' | 'none' | 'sameLevel' | 'childrenAndParents',
5765
+ highlightOnHover?: 'parents' | 'children' | 'none' | 'sameLevel' | 'childrenAndParents' | 'self',
5793
5766
 
5794
5767
 
5795
5768
 
package/orgchart.d.ts CHANGED
@@ -5749,47 +5749,20 @@ declare namespace OrgChart {
5749
5749
 
5750
5750
 
5751
5751
  /**
5752
- * Controls which related nodes are visually emphasized when hovering a node.
5752
+ * Controls which related nodes are visually highlighted when hovering over a node.
5753
5753
  *
5754
- * This option helps users understand relationships in the chart by
5755
- * automatically highlighting connected nodes while dimming unrelated ones.
5754
+ * Available modes:
5756
5755
  *
5757
- * Available values:
5758
- *
5759
- * - `'parents'`
5760
- * Highlights all ancestor nodes of the hovered node
5761
- * (parent, grandparent, etc.).
5762
- *
5763
- * - `'children'`
5764
- * Highlights all descendant nodes of the hovered node
5765
- * (children, grandchildren, etc.).
5766
- *
5767
- * - `'none'`
5768
- * Disables hover-based relationship highlighting.
5769
- *
5770
- * - `'sameLevel'`
5771
- * Highlights nodes on the same hierarchy level as the hovered node
5772
- * (siblings and other nodes in the same row/depth).
5773
- *
5774
- * - `'childrenAndParents'`
5775
- * Highlights both ancestor and descendant nodes of the hovered node.
5756
+ * - 'parents' → Highlights only the parent chain of the hovered node.
5757
+ * - 'children' → Highlights only the direct and indirect children of the hovered node.
5758
+ * - 'sameLevel' → Highlights nodes that share the same parent (siblings).
5759
+ * - 'childrenAndParents' Highlights both ancestors and descendants of the hovered node.
5760
+ * - 'self' → Highlights only the hovered node itself (no relationships).
5761
+ * - 'none' → Disables hover highlighting entirely.
5776
5762
  *
5777
5763
  * @default 'none'
5778
- *
5779
- * @example
5780
- * // Highlight managers above the hovered employee
5781
- * highlightOnHover: 'parents'
5782
- *
5783
- * @example
5784
- * // Highlight the hovered node's team below it
5785
- * highlightOnHover: 'children'
5786
- *
5787
- * @example
5788
- * // Highlight reporting chain in both directions
5789
- * highlightOnHover: 'childrenAndParents'
5790
5764
  */
5791
-
5792
- highlightOnHover?: 'parents' | 'children' | 'none' | 'sameLevel' | 'childrenAndParents',
5765
+ highlightOnHover?: 'parents' | 'children' | 'none' | 'sameLevel' | 'childrenAndParents' | 'self',
5793
5766
 
5794
5767
 
5795
5768
 
package/orgchart.js CHANGED
@@ -21,7 +21,7 @@ var e=function(e,t){var n=this;Object.defineProperty(this,`element`,{get(){retur
21
21
  <rect style="display: ${C}" data-treelist-scroll="${p.id}" class="boc-scroll" x="${p.x+p.w-p.padding[1]-e.TREELIST_SCROLLBAR_WIDTH}" y="${p.y+p.padding[0]}" width="${e.TREELIST_SCROLLBAR_WIDTH}" height="${p.h-p.padding[2]-p.padding[0]}"></rect>
22
22
  <rect style="display: ${C}" data-treelist-thumb="${p.id}" class="boc-scroll-thumb" x="${p.x+p.w-p.padding[1]-e.TREELIST_SCROLLBAR_WIDTH}" y="${S}" width="${e.TREELIST_SCROLLBAR_WIDTH}" height="${x}"></rect>
23
23
 
24
- </g>`}}for(var f=0;f<t.visibleNodeIds.length;f++){var p=t.nodes[t.visibleNodeIds[f]],m=a._get(p.id);p.isTreeListItem||(e.RENDER_LINKS_BEFORE_NODES||(s+=a.ui.link(p,a,c,t.bordersByRootIdAndLevel,t.nodes,n)),s+=a.ui.expandCollapseBtn(a,p,m,a.config,a._layoutConfigs,n,c))}var o={content:s,res:t};if(e.events.publish(`render`,[a,o]),s=o.content,t=o.res,s+=a.ui.lonely(a.config),n===e.action.exporting){var w=t.boundary,T=w.maxX-w.minX,E=w.maxY-w.minY,D=a.ui.svg(T,E,[w.minX,w.minY,T,E],a.config,s,c);i.call(a,D,t);return}(n===e.action.centernode||n===e.action.insert||n===e.action.expand||n===e.action.collapse||n===e.action.update)&&(u=l),n===e.action.init&&l!=null&&(u=l),n===e.action.centerNode&&l!=null&&(u=l),a.response=t,a._lastSize={width:a.width(),height:a.height()};var D=a.ui.svg(`100%`,`100%`,u,a.config,s);if(!a._initialized)a.element.innerHTML=a.ui.css()+D+a.ui.menuButton(a.config)+a.ui.aiButton(a.config),a._attachEventHandlers(),a.xScrollUI.create(a.width(),a.config.padding),a.xScrollUI.setPosition(),a.xScrollUI.addListener(a.getSvg()),a.yScrollUI.create(a.height(),a.config.padding),a.yScrollUI.setPosition(),a.yScrollUI.addListener(a.getSvg()),a.config.enableSearch&&a.searchUI.init(a),a.aiUI.init(a),a.orgScribeUI.init(a),a.powerPointPreviewUI.init(a),a.pdfPreviewUI.init(a),a.svgPreviewUI.init(a),a.pngPreviewUI.init(a),a.toolbarUI.init(a,a.config.toolbar),a.undoRedoUI.init(a),a.controlsUI.init(a);else{var O=a.getSvg(),k=O.parentNode;k.removeChild(O),k.insertAdjacentHTML(`afterbegin`,D),a._attachEventHandlers(),a.xScrollUI.addListener(a.getSvg()),a.yScrollUI.addListener(a.getSvg()),a.xScrollUI.setPosition(),a.yScrollUI.setPosition()}var A=!1,j=a.response.animations;if(j[0].length>0){a._hideBeforeAnimation(j[0].length);for(var f=0;f<j[0].length;f++)j[0][f]=a.getNodeElement(j[0][f]);e.animate(j[0],j[1],j[2],a.config.anim.duration,a.config.anim.func,function(){A||=(i&&i.call(a),e.events.publish(`redraw`,[a]),a._showAfterAnimation(),!0)})}n===e.action.centerNode?e.animate(a.getSvg(),{viewbox:l},{viewbox:a.response.viewBox},a.config.anim.duration,a.config.anim.func,function(){a.ripple(r.options.rippleId),A||=(i&&i.call(a),e.events.publish(`redraw`,[a]),a._showAfterAnimation(),!0)},function(){a.xScrollUI.setPosition(),a.yScrollUI.setPosition()}):l&&a.response&&(l[0]!=a.response.viewBox[0]||l[1]!=a.response.viewBox[1]||l[2]!=a.response.viewBox[2]||l[3]!=a.response.viewBox[3])&&(n===e.action.insert||n===e.action.expand||n===e.action.collapse||n===e.action.update||n===e.action.init)?e.animate(a.getSvg(),{viewbox:l},{viewbox:a.response.viewBox},a.config.anim.duration*2,a.config.anim.func,function(){a.xScrollUI.setPosition(),a.yScrollUI.setPosition(),A||=(i&&i.call(a),e.events.publish(`redraw`,[a]),!0)}):j[0].length==0&&(A||=(i&&i.call(a),e.events.publish(`redraw`,[a]),!0)),a._initialized||(a._initialized=!0,a.filterUI.update(),a._ai.setContext(),e.events.publish(`init`,[a])),!a._loaded&&t&&t.nodes&&Object.keys(t.nodes).length&&(a._loaded=!0)}},function(t){e.events.publish(`ready`,[a,t])})}},e.prototype._setInitialSizeIfNotSet=function(){this.mainElement.style.overflow=`hidden`,this.mainElement.style.position=`relative`,this.mainElement.offsetHeight==0&&(this.mainElement.style.height=`100%`,this.mainElement.offsetHeight==0&&(this.mainElement.style.height=`700px`)),this.mainElement.offsetWidth==0&&(this.mainElement.style.width=`100%`,this.mainElement.offsetWidth==0&&(this.mainElement.style.width=`700px`))},e.prototype.width=function(){return this.element.offsetWidth},e.prototype.height=function(){return this.element.offsetHeight},e.prototype.getViewBox=function(){var t=this.getSvg();return e._getViewBox(t)},e.prototype.setViewBox=function(e){this.getSvg().setAttribute(`viewBox`,e.toString())},e.prototype.getScale=function(t){return t||=this.getViewBox(),e.getScale(t,this.width(),this.height(),this.config.scaleInitial,this.config.scaleMax,this.config.scaleMin)},e.prototype.setScale=function(t){t>this.config.scaleMax&&(t=this.config.scaleMax),t<this.config.scaleMin&&(t=this.config.scaleMin);var n=this.getViewBox().slice(0),r=this.width(),i=this.height(),a=r/n[2],o=i/n[3],s=a>o?o:a,c=n,l=n[2],u=n[3];return n[2]/=t/s,n[3]/=t/s,n[0]=c[0]-(n[2]-l)/2,n[1]=c[1]-(n[3]-u)/2,this.setViewBox(n),e.events.publish(`redraw`,[this]),t},e.prototype.ripple=function(t,n,r){var i=this.getNode(t);if(i!=null){var a=this.getNodeElement(t);if(a!=null){var o=this.getScale(),s=i.w/2,c=i.h/2;if(n!==void 0&&r!==void 0){var l=a.getBoundingClientRect();s=n/o-l.left/o,c=r/o-l.top/o}var u=i.w,d=i.h,f=u-s>s?u-s:s,p=d-c>c?d-c:c;f=f,p=p;var m=f>p?f:p,h=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),g=document.createElementNS(`http://www.w3.org/2000/svg`,`clipPath`),_=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),v=document.createElementNS(`http://www.w3.org/2000/svg`,`circle`),y=e.randomId();g.setAttribute(`id`,y);var b={ripple:e.t(i.templateName,i.min,this.getScale()).ripple,node:i};e.events.publish(`ripple`,[this,b]),_.setAttribute(`x`,b.ripple.rect?b.ripple.rect.x:0),_.setAttribute(`y`,b.ripple.rect?b.ripple.rect.y:0),_.setAttribute(`width`,b.ripple.rect?b.ripple.rect.width:i.w),_.setAttribute(`height`,b.ripple.rect?b.ripple.rect.height:i.h),_.setAttribute(`rx`,b.ripple.radius),_.setAttribute(`ry`,b.ripple.radius),v.setAttribute(`clip-path`,`url(#`+y+`)`),v.setAttribute(`cx`,s),v.setAttribute(`cy`,c),v.setAttribute(`r`,0),v.setAttribute(`fill`,b.ripple.color),v.setAttribute(`class`,`boc-ripple`),g.appendChild(_),h.appendChild(g),h.appendChild(v),a.appendChild(h),e.animate(v,{r:0,opacity:1},{r:m,opacity:0},500,e.anim.outPow,function(){a.removeChild(h)})}}},e.prototype.centerOutNodes=function(t){if(this._centerInNodes){var n=JSON.parse(this._centerInNodes);this._centerInNodes=null;var r=this;this._centerInNodesTimeout=e.animate(this.getSvg(),{viewBox:this.getViewBox()},{viewBox:n},300,this.config.anim.func,function(){r.draw(e.action.update,null,function(){t&&t.call(r)})})}},e.prototype.centerInNodes=function(t,n){var r=this.getViewBox();this._centerInNodes||=JSON.stringify(r);var i=2**53-1,a=-(2**53-1),o=2**53-1,s=-(2**53-1);for(var c of t)c.y<i&&(i=c.y),c.y+c.h>a&&(a=c.y+c.h),c.x<o&&(o=c.x),c.x+c.w>s&&(s=c.x+c.w);var l=s-o,u=a-i,d=l/(l+this.config.padding*2),f=u/(u+this.config.padding*2),p=d>f?f:d;p>this.config.scaleMax&&(p=this.config.scaleMax),p<this.config.scaleMin&&(p=this.config.scaleMin);var m=[50,50],h=this.width(),g=this.height(),d=h/r[2],f=g/r[3],_=d>f?f:d,v=r,y=r[2],b=r[3];r[2]/=p/_,r[3]/=p/_,r[0]=v[0]-(r[2]-y)/(100/m[0]),r[1]=v[1]-(r[3]-b)/(100/m[1]),r[0]=o-(h/p-l)/2,r[1]=i-(g/p-u)/2;var x=this;this._centerInNodesTimeout&&=(clearTimeout(this._centerInNodesTimeout),null),this._centerInNodesTimeout=e.animate(this.getSvg(),{viewBox:this.getViewBox()},{viewBox:r},300,this.config.anim.func,function(){x.draw(e.action.update,null,function(){n&&n.call(x)})})},e.prototype.center=function(t,n,r){var i,a,o=t,s=!0,c=!0;n&&n.parentState!=null&&(i=n.parentState),n&&n.childrenState!=null&&(a=n.childrenState),n&&n.rippleId!=null&&(o=n.rippleId),n&&n.vertical!=null&&(s=n.vertical),n&&n.horizontal!=null&&(c=n.horizontal);var l={parentState:i,childrenState:a,rippleId:o,vertical:s,horizontal:c};this._draw(!1,e.action.centerNode,{id:t,options:l},r)},e.prototype.fit=function(t){this.config.scaleInitial=e.match.boundary,this._draw(!0,e.action.init,{method:`fit`},t)},e.prototype.fitIfOutside=function(t){this.config.scaleInitial=e.match.boundaryIfOutside,this._draw(!0,e.action.init,{method:`fit`},t)},e.prototype.toggleFullScreen=function(){var t=document.querySelector(`[`+e.attr.tlbr+`r='fullScreen']`);document.fullscreenElement==this.element||document.webkitFullscreenElement==this.element||document.mozFullScreenElement==this.element||document.msFullscreenElement==this.element?(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen(),t&&(t.innerHTML=e.toolbarUI.openFullScreenIcon)):(this.element.requestFullscreen?this.element.requestFullscreen():this.element.mozRequestFullScreen?this.element.mozRequestFullScreen():this.element.webkitRequestFullscreen?this.element.webkitRequestFullscreen():this.element.msRequestFullscreen&&this.element.msRequestFullscreen(),t&&(t.innerHTML=e.toolbarUI.closeFullScreenIcon))},e.prototype.getNode=function(e){return this.nodes[e]},e.prototype.setLayout=function(t,n){n||=`base`,this._layoutConfigs[n].layout=t,n==`base`&&(this.config.layout=t),this._draw(!1,e.action.update)},e.prototype.setOrientation=function(t,n,r){var i=this;n||=`base`,this._layoutConfigs[n].orientation=t,n==`base`&&(this.config.orientation=t),this._draw(!1,e.action.update,void 0,function(){i.getScale(),e._moveToBoundaryArea(i.getSvg(),i.getViewBox(),i.response.boundary,function(){i._draw(!0,e.action.pan),r&&r()})})},e.prototype.search=function(t,n,r){return e.isNEU(n)&&(n=this.searchUI._searchFields),e.isNEU(r)&&(r=n),e._search.search(this.config.nodes,t,n,r,this.config.searchDisplayField,this.config.searchFieldsWeight,this.searchUI._searchFieldsAbbreviation)},e.prototype._hideBeforeAnimation=function(t){if(this._hideBeforeAnimationCompleted!=1&&!(t&&t<e.ANIM_THRESHOLD)){var n=this.element.getElementsByTagName(`text`);if(n.length>e.TEXT_THRESHOLD)for(var r=0;r<n.length;r++)n[r].style.display=`none`;var i=this.element.getElementsByTagName(`image`);if(i.length>e.IMAGES_THRESHOLD)for(var r=0;r<i.length;r++)i[r].style.display=`none`;var a=this.element.querySelectorAll(`[`+e.attr.link_id+`]`);if(a.length>e.LINKS_THRESHOLD)for(var r=0;r<a.length;r++)a[r].style.display=`none`;var o=this.element.querySelectorAll(`[`+e.attr.control_expcoll_id+`]`);if(o.length>e.BUTTONS_THRESHOLD)for(var r=0;r<o.length;r++)o[r].style.display=`none`;var s=this.element.querySelectorAll(`[`+e.attr.control_up_id+`]`);if(s.length>e.BUTTONS_THRESHOLD)for(var r=0;r<s.length;r++)s[r].style.display=`none`;this._hideBeforeAnimationCompleted=!0}},e.prototype._showAfterAnimation=function(){for(var t=this.element.getElementsByTagName(`text`),n=0;n<t.length;n++)t[n].style.display=``;for(var r=this.element.getElementsByTagName(`image`),n=0;n<r.length;n++)r[n].style.display=``;for(var i=this.element.querySelectorAll(`[`+e.attr.link_id+`]`),n=0;n<i.length;n++)i[n].style.display=``;for(var a=this.element.querySelectorAll(`[`+e.attr.control_expcoll_id+`]`),n=0;n<a.length;n++)a[n].style.display=``;for(var o=this.element.querySelectorAll(`[`+e.attr.control_up_id+`]`),n=0;n<o.length;n++)o[n].style.display=``;this._hideBeforeAnimationCompleted=!1},e.prototype.isChild=function(e,t){for(var n=this.getNode(t);n;){if(n.id==e)return!0;n=n.parent?n.parent:n.stParent}return!1},e.prototype.getCollapsedIds=function(e){for(var t=[],n=0;n<e.childrenIds.length;n++){var r=this.getNode(e.childrenIds[n]);r.collapsed==1&&t.push(r.id)}return t},e.prototype.stateToUrl=function(){if(this.manager.state){var e={};return e.exp=this.manager.state.exp.join(`*`),e.min=this.manager.state.min.join(`*`),e.adjustify=this.manager.state.adjustify.x+`*`+this.manager.state.adjustify.y,e.scale=this.manager.state.scale,e.y=this.manager.state.x,e.x=this.manager.state.y,new URLSearchParams(e).toString()}return``},e.prototype.generateId=function(){for(;;){var e=`_`+(`0000`+(Math.random()*36**4|0).toString(36)).slice(-4);if(this.nodes==null||!this.nodes.hasOwnProperty(e))return e}},e.prototype.moveNodesToVisibleArea=function(t,n){for(var r=this,i=this.roots[0],a=this.getSvg(),o=this.getViewBox(),s=null,c=null,l=null,u=null,d=0;d<t.length;d++){var f=this.nodes[t[d]];f.x!=null&&f.y!=null&&((s===null||s<f.x+f.w)&&(s=f.x+f.w),(c===null||c<f.y+f.h)&&(c=f.y+f.h),(l===null||l>f.x)&&(l=f.x),(u===null||u>f.y)&&(u=f.y))}if(!(s==null||c==null||l==null||u==null)){var p=this.width(),m=this.height(),h=s-l+this.config.padding*2,g=c-u+this.config.padding*2,_=p/h,v=m/g,y=_>v?v:_,b=Math.ceil(p/y),x=Math.ceil(m/y),h=0,g=0;if(b-this.config.padding*2>=s-l)h=(s+l)/2-b/2;else switch(h=i.x-b/2+e.manager._getNodeWidth(i,this.config)/2,this.config.orientation){case e.orientation.right:case e.orientation.right_top:h=-(b/2-(l-s)/2),h<this.config.padding-b&&(h=this.config.padding-b);break;case e.orientation.left:case e.orientation.bottom_left:case e.orientation.top_left:case e.orientation.left_top:h=-(b/2-(s-l)/2),h>-this.config.padding&&(h=-this.config.padding);break}if(x-this.config.padding*2>=c-u)g=(c+u)/2-x/2;else switch(g=-(x/2-(c-u)/2),g>-this.config.padding&&(g=-this.config.padding),this.config.orientation){case e.orientation.bottom:case e.orientation.bottom_left:g=-(x/2-(u-c)/2),g<this.config.padding-x&&(g=this.config.padding-x);break;case e.orientation.left:case e.orientation.right:g=i.y-x/2+e.manager._getNodeWidth(i,this.config)/2;break}var S=[h,g,b,x];o[0]!==S[0]||o[1]!==S[1]?e.animate(a,{viewBox:o},{viewBox:S},this.config.anim.duration,this.config.anim.func,function(){r.draw(e.action.update,void 0,n)}):n&&n()}},e.prototype._nodeHasHiddenParent=function(t){return!t.parent&&!e.isNEU(t.pid)&&this.getNode(t.pid)},e.prototype.destroy=function(){this._initCalled=!1,this._resizeObserver.unobserve(this.element),e.events.removeForEventId(this._event_id),this.element.innerHTML=null},e._defaultConfig=function(t){return{interactive:!0,mode:`light`,lazyLoading:`auto`,enableDragDrop:!1,enableSearch:!0,enableAI:!1,enablePan:!0,keyNavigation:!1,miniMap:!1,controls:null,nodeMenu:null,nodeCircleMenu:null,nodeContextMenu:null,menu:null,toolbar:!1,nodeMouseClick:e.action.details,nodeMouseDbClick:e.none,mouseScrool:e.action.ctrlZoom,showXScroll:!1,showYScroll:!1,template:`ana`,tags:{},min:!1,nodeBinding:{},linkBinding:{},searchFields:null,searchDisplayField:null,searchFieldsWeight:null,searchFieldsAbbreviation:null,nodes:[],clinks:[],slinks:[],backdrops:[],groupDottedLines:[],dottedLines:[],undoRedoStorageName:null,levelSeparation:60,siblingSeparation:20,subtreeSeparation:40,backdropSeparation:15,mixedHierarchyNodesSeparation:15,assistantSeparation:100,minPartnerSeparation:50,partnerChildrenSplitSeparation:20,partnerNodeSeparation:15,columns:10,padding:30,orientation:e.orientation.top,layout:e.layout.normal,layoutGridColumns:`dynamic`,scaleInitial:e.match.boundaryIfOutside,movable:null,scaleMin:.1,scaleMax:5,highlightOnHover:`none`,orderBy:null,editUI:null,aiUI:null,orgScribeUI:null,powerPointPreviewUI:null,pdfPreviewUI:null,svgPreviewUI:null,pngPreviewUI:null,filterUI:null,searchUI:null,xScrollUI:null,yScrollUI:null,nodeMenuUI:null,controlsUI:null,nodeCircleMenuUI:null,nodeContextMenuUI:null,toolbarUI:null,notifierUI:null,menuUI:null,undoRedoUI:null,exportUrl:`https://balkan.app/export`,serverUrl:`https://serverjs.balkan.app`,aiChatTools:[],collapse:{},expand:{},align:e.CENTER,UI:null,anim:{func:e.anim.outPow,duration:200},zoom:{speed:120,smooth:12},roots:null,state:null,editForm:{readOnly:!1,titleBinding:`name`,photoBinding:`img`,addMore:`Add more fields`,addMoreBtn:`Add`,addMoreFieldName:`Field name`,saveAndCloseBtn:`Save and close`,generateElementsFromFields:!0,focusBinding:null,buttons:{edit:{icon:e.icon.edit(24,24,`#fff`),text:`Edit`,hideIfEditMode:!0,hideIfDetailsMode:!1},share:{icon:e.icon.share(24,24,`#fff`),text:`Share`},pdf:{icon:e.icon.pdf(24,24,`#fff`),text:`Save as PDF`},remove:{icon:e.icon.remove(24,24,`#fff`),text:`Remove`,hideIfDetailsMode:!0}},elements:[]}}},e.localStorage={},e.localStorage.getItem=function(e){var t=localStorage.getItem(`to_date`);if(!t)t=new Date,t.setDate(t.getDate()+5),t=t.toISOString(),localStorage.setItem(`to_date`,t);else if(t=new Date(t),t<new Date){for(var n=0,r=localStorage.length;n<r;++n){var i=localStorage.key(n);i&&i.startsWith&&i.startsWith(`{"n"`)&&localStorage.removeItem(i)}localStorage.removeItem(`to_date`)}return localStorage.getItem(e)},e.localStorage.setItem=function(e,t){try{localStorage.setItem(e,t)}catch(e){e.code==e.QUOTA_EXCEEDED_ERR?(console.warn(`Local storage quota exceeded`),localStorage.clear()):(console.error(`Local storage error code:`+e.code),console.error(e))}},e.prototype.canUpdateLink=function(e,t){if(t==null||t==null||e==null||e==null||e==t)return!1;var n=this.getNode(t),r=this.getNode(e);return n&&r&&(n.isPartner||n.hasPartners&&r.isAssistant||n.hasAssistants&&r.isPartner)?!1:!this.isChild(e,t)},e.prototype._canUpdateLink=e.prototype.canUpdateLink,e.prototype.updateNode=function(t,n,r,i){if(t){var a=this,o=this.get(t.id);if(r===!0&&e.events.publish(`update`,[this,o,t])===!1)return!1;this.update(t),this._ai.setContext(),e.events.publish(`updated`,[this]),this.filterUI.update();var s=this.getNode(t.id),c=s.pid;c??=s.stpid,this._draw(!1,e.action.update,{id:c},function(){i||a.ripple(t.id),n&&n()})}},e.prototype.update=function(e){for(var t=0;t<this.config.nodes.length;t++)if(this.config.nodes[t].id==e.id){this._putInUndoStack(),this.clearRedo(),this.config.nodes[t]=e;break}return this},e.prototype.removeNode=function(t,n,r){if(!this.canRemove(t))return!1;var i=this._getNewPidsAndStpidsForIds(t);return r===!0&&e.events.publish(`remove`,[this,t,i])===!1?!1:(this.remove(t),this._ai.setContext(),e.events.publish(`updated`,[this]),this.filterUI.update(),this._draw(!1,e.action.update,null,function(){n&&n()}),!0)},e.prototype.remove=function(e){var t=this.get(e);if(t){this._putInUndoStack(),this.clearRedo();for(var n=this.config.nodes.length-1;n>=0;n--)(this.config.nodes[n].pid==e||this.config.nodes[n].stpid==e)&&(this.config.nodes[n].pid=t.pid,this.config.nodes[n].stpid=t.stpid),this.config.nodes[n].id==e&&this.config.nodes.splice(n,1)}return this},e.prototype._getNewPidsAndStpidsForIds=function(e){var t=this.get(e),n={},r={};if(t)for(var i=this.config.nodes.length-1;i>=0;i--)this.config.nodes[i].pid==e?n[this.config.nodes[i].id]=t.pid:this.config.nodes[i].stpid==e&&(r[this.config.nodes[i].id]=t.stpid);return{newPidsForIds:n,newStpidsForIds:r}},e.prototype.addNode=function(t,n,r){var i=this;if(r===!0&&e.events.publish(`add`,[this,t])===!1)return!1;this.add(t),this._ai.setContext(),e.events.publish(`updated`,[this]),this.filterUI.update(),i._draw(!1,e.action.insert,{id:t.pid,insertedNodeId:t.id},function(){i.ripple(t.id),n&&n()})},e.prototype.add=function(t){if(t.id??console.error(`Call addNode without id`),this._putInUndoStack(),this.clearRedo(),this.config.movable&&!e.isNEU(t.pid)){var n=this._get(t.pid);n&&(n.movex!=null&&(t.movex=n.movex),n.movey!=null&&(t.movey=n.movey))}return this.config.nodes.push(t),this},e.prototype.replaceIds=function(t,n){this._replaceIds(t),this._draw(!1,e.action.update,void 0,n)},e.prototype._replaceIds=function(t){for(var n=function(e){for(var n=0;n<e.length;n++){var r=e[n];for(var i in t){var a=t[i];r.from==i&&(r.from=a),r.to==i&&(r.to=a)}}},r=0;r<this.config.nodes.length;r++){var i=this.config.nodes[r];for(var a in t){var o=t[a];i.id==a&&(i.id=o),i.pid==a&&(i.pid=o),i.stpid==a&&(i.stpid=o),i.ppid==a&&(i.ppid=o)}}if(Array.isArray(this.config.roots))for(var r=0;r<this.config.roots.length;r++)e.isNEU(t[this.config.roots[r]])||(this.config.roots[r]=t[this.config.roots[r]]);if(this.nodes){for(var s in this.nodes)if(!e.isNEU(t[s])){var o=t[s],c=this.nodes[s];c.id=o,this.nodes[o]=c}}if(this.manager.oldNodes){for(var s in this.manager.oldNodes)if(!e.isNEU(t[s])){var o=t[s],c=this.manager.oldNodes[s];c.id=o,this.manager.oldNodes[o]=c}}if(this.roots){for(var s in this.roots)if(!e.isNEU(t[s])){var o=t[s],c=this.roots[s];c.id=o,this.roots[o]=c}}n(this.config.clinks),n(this.config.slinks),n(this.config.groupDottedLines),n(this.config.dottedLines)},e.prototype._get=function(t){var n=this.__get(t);if(n)return n;if((this.config.groupDottedLines.length||this.config.dottedLines.length)&&!e.isNEU(t)&&typeof t==`string`&&(t.indexOf(`balkan_group_dotted_`)!=-1||t.indexOf(`balkan_dotted_`)!=-1)){t=t.replace(`balkan_group_dotted_`,``),t=t.replace(`balkan_dotted_`,``);var r=t.indexOf(`_balkan_id_`);if(t=t.substring(r+11),n=this.__get(t),n)return n}return null},e.prototype.__get=function(e){for(var t=0;t<this.config.nodes.length;t++)if(this.config.nodes[t].id==e)return this.config.nodes[t];return null},e.prototype.get=function(e){var t=this._get(e);return t==null?null:JSON.parse(JSON.stringify(t))},e.prototype.canRemove=function(e){var t=this.getNode(e);return!(!t||t.hasPartners||t.hasAssistants)},e===void 0&&(e={}),e._ajax=function(t,n,r,i,a){i??=`arraybuffer`;var o=new XMLHttpRequest;for(var s in o.onload=function(e){o.readyState==4&&this.status===200&&(e.target==null?a(this.response):a(e.target.response))},o.onerror=function(e){a({error:e})},o.open(n,t),o.responseType=i,o.setRequestHeader(`Content-Type`,`application/json`),e.REQUEST_CUSTOM_HEADERS)o.setRequestHeader(s,e.REQUEST_CUSTOM_HEADERS[s]);r==null?o.send():o.send(r)},e===void 0&&(e={}),e.animate=function(t,n,r,i,a,o,s){var c=10,l=1,u=1,d=i/c+1,f;document.getElementsByTagName(`g`),Array.isArray(t)||(t=[t]),Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);function p(){for(var p=0;p<t.length;p++)for(var m in r[p]){var h=e._arrayContains([`top`,`left`,`right`,`bottom`,`width`,`height`],m.toLowerCase())?`px`:``;switch(m.toLowerCase()){case`d`:var g=a((u*c-c)/i)*(r[p][m][0]-n[p][m][0])+n[p][m][0],_=a((u*c-c)/i)*(r[p][m][1]-n[p][m][1])+n[p][m][1];t[p].setAttribute(`d`,t[p].getAttribute(`d`)+` L`+g+` `+_);break;case`r`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].setAttribute(`r`,v);break;case`x1`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].setAttribute(`x1`,v);break;case`x2`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].setAttribute(`x2`,v);break;case`y1`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].setAttribute(`y1`,v);break;case`y2`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].setAttribute(`y2`,v);break;case`scrolltop`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].scrollTop=v;break;case`rotate3d`:if(r[p][m]){var y=n[p][m],b=r[p][m],x=[0,0,0,0];for(var S in y)x[S]=a((u*c-c)/i)*(b[S]-y[S])+y[S];t[p].style.transform=`rotate3d(`+x.toString()+`deg)`}break;case`transform`:if(r[p][m]){var y=n[p][m],b=r[p][m],x=[0,0,0,0,0,0];for(var S in y)x[S]=a((u*c-c)/i)*(b[S]-y[S])+y[S];t[p].hasAttribute(`transform`)?t[p].setAttribute(`transform`,`matrix(`+x.toString()+`)`):t[p].style.transform=`matrix(`+x.toString()+`)`}break;case`viewbox`:if(r[p][m]){var y=n[p][m],b=r[p][m],x=[0,0,0,0];for(var S in y)x[S]=a((u*c-c)/i)*(b[S]-y[S])+y[S];t[p].setAttribute(`viewBox`,x.toString())}break;case`margin`:if(r[p][m]){var y=n[p][m],b=r[p][m],x=[0,0,0,0];for(var S in y)x[S]=a((u*c-c)/i)*(b[S]-y[S])+y[S];for(var C=``,S=0;S<x.length;S++)C+=parseInt(x[S])+`px `;t[p]&&t[p].style&&(t[p].style[m]=C)}break;case`scrolly`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].scrollTo(0,v);break;default:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p]&&t[p].style&&(t[p].style[m]=v+h);break}}if(s){var v=a((u*c-c)/i);s(v)}u+=l,u>d+1&&(clearInterval(f),o&&o(t))}return f=setInterval(p,c),f},e.anim={},e.anim.inPow=function(e){return e<0?0:e>1?1:e**2},e.anim.outPow=function(e){var t=2;if(e<0)return 0;if(e>1)return 1;var n=t%2==0?-1:1;return n*((e-1)**t+n)},e.anim.inOutPow=function(t){var n=2;if(t<0)return 0;if(t>1)return 1;if(t*=2,t<1)return e.anim.inPow(t,n)/2;var r=n%2==0?-1:1;return r/2*((t-2)**n+r*2)},e.anim.inSin=function(e){return e<0?0:e>1?1:-Math.cos(Math.PI/2*e)+1},e.anim.outSin=function(e){return e<0?0:e>1?1:Math.sin(Math.PI/2*e)},e.anim.inOutSin=function(e){return e<0?0:e>1?1:-.5*(Math.cos(Math.PI*e)-1)},e.anim.inExp=function(e){return e<0?0:e>1?1:2**(10*(e-1))},e.anim.outExp=function(e){return e<0?0:e>1?1:-(2**(-10*e))+1},e.anim.inOutExp=function(e){return e<0?0:e>1?1:e<.5?.5*2**(10*(2*e-1)):.5*(-(2**(10*(-2*e+1)))+2)},e.anim.inCirc=function(e){return e<0?0:e>1?1:-(Math.sqrt(1-e*e)-1)},e.anim.outCirc=function(e){return e<0?0:e>1?1:Math.sqrt(1-(e-1)*(e-1))},e.anim.inOutCirc=function(e){return e<0?0:e>1?1:e<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(2*e-2)*(2*e-2))+1)},e.anim.rebound=function(e){return e<0?0:e>1?1:e<1/2.75?1-7.5625*e*e:e<2/2.75?1-(7.5625*(e-1.5/2.75)*(e-1.5/2.75)+.75):e<2.5/2.75?1-(7.5625*(e-2.25/2.75)*(e-2.25/2.75)+.9375):1-(7.5625*(e-2.625/2.75)*(e-2.625/2.75)+.984375)},e.anim.inBack=function(e){return e<0?0:e>1?1:e*e*(2.70158*e-1.70158)},e.anim.outBack=function(e){return e<0?0:e>1?1:(e-1)*(e-1)*(2.70158*(e-1)+1.70158)+1},e.anim.inOutBack=function(e){return e<0?0:e>1?1:e<.5?.5*(4*e*e*(3.5949*2*e-2.5949)):.5*((2*e-2)*(2*e-2)*(3.5949*(2*e-2)+2.5949)+2)},e.anim.impulse=function(e){var t=2*e;return t*Math.exp(1-t)},e.anim.expPulse=function(e){return Math.exp(-2*e**2)},e===void 0&&(e={}),e.prototype._attachEventHandlers=function(t){if(this.config.interactive){var t=this.getSvg(),n=this;t.addEventListener(`touchstart`,function(e){e.preventDefault(),n._globalMouseDownHandler.apply(n,[this,e])},{passive:!1}),t.addEventListener(`mousedown`,function(e){n._globalMouseDownHandler.apply(n,[this,e])},{passive:!0}),t.addEventListener(`contextmenu`,function(e){n._globalContextHandler.apply(n,[this,e])},{passive:!1}),t.addEventListener(`dblclick`,function(e){n._globalDbClickHandler.apply(n,[this,e])},{passive:!0}),this.config.mouseScrool!=e.action.none&&t.addEventListener(`wheel`,function(e){n._mouseScrollHandler.apply(n,[this,e])},{passive:!1});var r=this.getMenuButton();r&&r.addEventListener(`click`,function(e){n._menuClickHandler.apply(n,[this,e])})}},e===void 0&&(e={}),e.VERSION=`9.2.38`,e.orientation={},e.orientation.top=0,e.orientation.bottom=1,e.orientation.right=2,e.orientation.left=3,e.orientation.top_left=4,e.orientation.bottom_left=5,e.orientation.right_top=6,e.orientation.left_top=7,e.anchor={top_right:`top_right`,right_top:`right_top`,bottom_right:`bottom_right`,right_bottom:`right_bottom`,top_left:`top_left`,left_top:`left_top`,bottom_left:`bottom_left`,left_bottom:`left_bottom`,top:`top`,bottom:`bottom`,left:`left`,right:`right`},e.align={},e.align.center=e.CENTER=8,e.align.orientation=e.ORIENTATION=9,e.attr={},e.attr.l=`data-l`,e.attr.id=`data-id`,e.attr.sl=`data-sl`,e.attr.lbl=`data-lbl`,e.attr.val=`data-val`,e.attr.tlbr=`data-tlbr`,e.attr.item=`data-item`,e.attr.layout=`data-layout`,e.attr.node_id=`data-n-id`,e.attr.link_id=`data-l-id`,e.attr.field_name=`data-f-name`,e.attr.c_link_to=`data-c-l-to`,e.attr.c_link_from=`data-c-l-from`,e.attr.s_link_to=`data-s-l-to`,e.attr.s_link_from=`data-s-l-from`,e.attr.control_add=`data-ctrl-add`,e.attr.control_expcoll_id=`data-ctrl-ec-id`,e.attr.control_up_id=`data-ctrl-up-id`,e.attr.control_export_menu=`data-ctrl-menu`,e.attr.control_node_menu_id=`data-ctrl-n-menu-id`,e.attr.control_node_circle_menu_id=`data-ctrl-n-c-menu-id`,e.attr.control_node_circle_menu_name=`data-ctrl-n-c-menu-name`,e.attr.control_node_circle_menu_wrraper_id=`data-ctrl-n-c-menu-wrapper-id`,e.attr.width=`data-width`,e.attr.text_overflow=`data-text-overflow`,e.ID=`id`,e.PID=`pid`,e.STPID=`stpid`,e.TAGS=`tags`,e.NODES=`nodes`,e.ELASTIC=`elastic`,e.ASSISTANT=`Assistant`,e.action={},e.action.expand=0,e.action.collapse=1,e.action.maximize=101,e.action.minimize=102,e.action.expandCollapse=501,e.action.edit=1,e.action.zoom=2,e.action.ctrlZoom=22,e.action.scroll=41,e.action.xScroll=3,e.action.yScroll=4,e.action.none=5,e.action.init=6,e.action.update=7,e.action.move=70,e.action.pan=8,e.action.centerNode=9,e.action.resize=10,e.action.insert=11,e.action.insertfirst=12,e.action.details=13,e.action.exporting=14,e.none=400001,e.scroll={},e.scroll.visible=!0,e.scroll.smooth=12,e.scroll.speed=120,e.scroll.safari={smooth:12,speed:250},e.match={},e.match.height=100001,e.match.width=100002,e.match.boundary=100003,e.match.boundaryIfOutside=100004,e.match.none=1,e.movable={},e.movable.node=`node`,e.movable.tree=`tree`,e.movable.detachTree=`detachTree`,e.layout={},e.layout.normal=e.normal=0,e.layout.mixed=e.mixed=1,e.layout.tree=e.tree=2,e.layout.treeLeftOffset=e.treeLeftOffset=3,e.layout.treeRightOffset=e.treeRightOffset=4,e.layout.treeLeft=5,e.layout.treeRight=6,e.layout.grid=-1,e.layout.treeList=-2,e.nodeOpenTag=`<g `+e.attr.node_id+`="{id}" style="opacity: {opacity}" transform="matrix(1,0,0,1,{x},{y})" class="{class}" `+e.attr.sl+`="{sl}" `+e.attr.l+`="{level}" {lcn}>`,e.linkOpenTag=`<g `+e.attr.link_id+`="[{id}][{child-id}]" class="{class}">`,e.expcollOpenTag=`<g `+e.attr.control_expcoll_id+`="{id}" transform="matrix(1,0,0,1,{x},{y})" style="cursor:pointer;">`,e.upOpenTag=`<g `+e.attr.control_up_id+`="{id}" transform="matrix(1,0,0,1,{x},{y})" style="cursor:pointer;">`,e.linkFieldsOpenTag=`<g transform="matrix(1,0,0,1,{x},{y}) rotate({rotate})">`,e.grCloseTag=`</g>`,e.A5={width:420,height:595},e.A4={width:595,height:842},e.A3={width:842,height:1191},e.A2={width:1191,height:1684},e.A1={width:1684,height:2384},e.Letter={width:612,height:791},e.Legal={width:612,height:1009},e.Legal={width:612,height:1009},e.Widescreen={width:720,height:1280},e.Standard={width:720,height:960},e.COLLAPSE_PARENT_NEIGHBORS=1,e.COLLAPSE_SUB_CHILDRENS=2,e.COLLAPSE_PARENT_SUB_CHILDREN_EXCEPT_CLICKED=3,e.TEXT_THRESHOLD=4e3,e.IMAGES_THRESHOLD=1e3,e.LINKS_THRESHOLD=2e3,e.BUTTONS_THRESHOLD=700,e.ANIM_THRESHOLD=500,e.IT_IS_LONELY_HERE=`<g transform="translate(-100, 0)" style="cursor:pointer;" `+e.attr.control_add+`="control-add"><text fill="#039be5">{link}</text></g>`,e.RES={},e.IT_IS_LONELY_HERE_LINK=e.RES.IT_IS_LONELY_HERE_LINK=`It's lonely here, add your first node`,e.FIRE_DRAG_NOT_CLICK_IF_MOVE=3,e.STRING_TAGS=!1,e.MAX_NODES_MESS=`The trial has expired or 200 nodes limit was reached! <br /><a style='color: #039BE5;' target='_blank' href='https://balkan.app/OrgChartJS/Docs/Evaluation'>See more</a>`,e.OFFLINE_MESS=`The evaluation version requires internet connection! <br /><a style='color: #039BE5;' target='_blank' href='https://balkan.app/OrgChartJS/Docs/Evaluation'>See more</a>`,e.SEARCH_PLACEHOLDER=`Search... type ? to get help.`,e.SEARCH_HELP_SYMBOL=`?`,e.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE=!1,e.SEARCH_RESULT_LIMIT=10,e.IMPORT_MESSAGE=`Choose the columns (fields) in your data file that contain the required information.`,e.FIXED_POSITION_ON_CLICK=!1,e.RENDER_LINKS_BEFORE_NODES=!1,e.RENDER_CLINKS_BEFORE_NODES=!1,e.MIXED_LAYOUT_ALL_NODES=!1,e.MIXED_LAYOUT_FOR_NODES_WITH_COLLAPSED_CHILDREN=!1,e.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN=1,e.LINK_ROUNDED_CORNERS=5,e.MOVE_STEP=5,e.CLINK_CURVE=1,e.MAX_DEPTH=200,e.SCALE_FACTOR=1.44,e.LAZY_LOADING_FACTOR=`auto`,e.LAZY_LOADING=!0,e.ARRAY_FIELDS=[`tags`],e.CSV_DELIMITER=`,`,e.EDITFORM_CLOSE_BTN=`<svg data-edit-from-close class="boc-edit-form-close"><path style="fill:#ffffff;" d="M21.205,5.007c-0.429-0.444-1.143-0.444-1.587,0c-0.429,0.429-0.429,1.143,0,1.571l8.047,8.047H1.111 C0.492,14.626,0,15.118,0,15.737c0,0.619,0.492,1.127,1.111,1.127h26.554l-8.047,8.032c-0.429,0.444-0.429,1.159,0,1.587 c0.444,0.444,1.159,0.444,1.587,0l9.952-9.952c0.444-0.429,0.444-1.143,0-1.571L21.205,5.007z"></path></svg>`,e.ESCAPE_HTML=!1,e.VERTICAL_CHILDREN_ASSISTANT=!1,e.EXPORT_PAGES_CUT_NODES=!1,e.RESET_MOVABLE_ONEXPANDCOLLAPSE=!1,e.FILTER_ALPHABETICALLY=!0,e.SERVER_PREFIX=`.azurewebsites.net/api/you-see-this-request-because-it-is-trial-version-of-orgchartjs`,e.FUNC_URL_NAME=`func-url-orgchartjs`,e.MINIMUM_SYMBOLS_IN_SEARCH_INPUT=1,e.AI_SYSTEM_MESSAGES=[],e.ORGSCRIBE_OFFSET=` `,e.TREELIST_WHEEL_STEP=`auto`,e.TREELIST_SCROLLBAR_WIDTH=10,e.CONVERT_IMAGES_TO_BASE64_BEFORE_EXPORT=!1,e.REQUEST_CUSTOM_HEADERS={},e.SLINK_GAP=7,e._intersects=function(t,n,r){var i=t.x-r.siblingSeparation/4,a=t.y,o=t.x+t.w+r.siblingSeparation/4,s=t.y;switch(r.orientation){case e.orientation.right:case e.orientation.right_top:case e.orientation.left:case e.orientation.left_top:i=t.x,a=t.y-r.siblingSeparation/4,o=t.x,s=t.y+t.h+r.siblingSeparation/4;break}var c=n.p,l=n.q,u=n.r,d=n.s,f=(o-i)*(d-l)-(u-c)*(s-a),p,m;return f===0?!1:(m=((d-l)*(u-i)+(c-u)*(d-a))/f,p=((a-s)*(u-i)+(o-i)*(d-a))/f,0<m&&m<1&&0<p&&p<1)},e._addPoint=function(t,n,r,i,a){switch(r.orientation){case e.orientation.top:case e.orientation.top_left:return e._addPointTop(t,n,r,i,a);case e.orientation.bottom:case e.orientation.bottom_left:return e._addPointBottom(t,n,r,i,a);case e.orientation.left:case e.orientation.left_top:return e._addPointLeft(t,n,r,i,a);case e.orientation.right:case e.orientation.right_top:return e._addPointRight(t,n,r,i,a)}},e._addPointTop=function(e,t,n,r,i){var a,o,s;return i==`left`?a=e.leftNeighbor?e.x+(e.leftNeighbor.x+e.leftNeighbor.w-e.x)/2:e.x-n.siblingSeparation/2:i==`right`&&(a=e.rightNeighbor?e.x+e.w+(e.rightNeighbor.x-(e.x+e.w))/2:e.x+e.w+n.siblingSeparation/2),t.push([a,t[t.length-1][1]]),t.push([a,e.y-n.levelSeparation/3]),o=t[t.length-1][1],s=a,r.p=a,r.q=o,r.r=s,r},e._addPointBottom=function(e,t,n,r,i){var a,o,s;return i==`left`?a=e.leftNeighbor?e.x+(e.leftNeighbor.x+e.leftNeighbor.w-e.x)/2:e.x-n.siblingSeparation/2:i==`right`&&(a=e.rightNeighbor?e.x+e.w+(e.rightNeighbor.x-(e.x+e.w))/2:e.x+e.w+n.siblingSeparation/2),t.push([a,t[t.length-1][1]]),t.push([a,e.y+e.h+n.levelSeparation/3]),o=t[t.length-1][1],s=a,r.p=a,r.q=o,r.r=s,r},e._addPointLeft=function(e,t,n,r,i){var a=t[t.length-1][0],o;i==`bottom`?o=e.rightNeighbor?e.y+e.h+(e.rightNeighbor.y-(e.y+e.h))/2:e.y+e.h+n.siblingSeparation/2:i==`top`&&(o=e.leftNeighbor?e.y+(e.leftNeighbor.y+e.leftNeighbor.h-e.y)/2:e.y-n.siblingSeparation/2),t.push([t[t.length-1][0],o]),t.push([e.x-n.levelSeparation/3,o]),a=t[t.length-1][0];var s=o;return r.p=a,r.q=o,r.s=s,r},e._addPointRight=function(e,t,n,r,i){var a=t[t.length-1][0],o;i==`bottom`?o=e.rightNeighbor?e.y+e.h+(e.rightNeighbor.y-(e.y+e.h))/2:e.y+e.h+n.siblingSeparation/2:i==`top`&&(o=e.leftNeighbor?e.y+(e.leftNeighbor.y+e.leftNeighbor.h-e.y)/2:e.y-n.siblingSeparation/2),t.push([t[t.length-1][0],o]),t.push([e.x+e.w+n.levelSeparation/3,o]),a=t[t.length-1][0];var s=o;return r.p=a,r.q=o,r.s=s,r},e._addConnectorLines=function(t,n){e._addConnectorLine(t,{x1:n.xa,y1:n.ya,x2:n.xb,y2:n.yb}),e._addConnectorLine(t,{x1:n.xb,y1:n.yb,x2:n.xc,y2:n.yc}),e._addConnectorLine(t,{x1:n.xc,y1:n.yc,x2:n.xd,y2:n.yd})},e._addConnectorLine=function(e,t){if(t.x1==t.x2){if(e.x[t.x1]||(e.x[t.x1]=[]),t.y1>t.y2){var n=t.y1;t.y1=t.y2,t.y2=n}e.x[t.x1].push({y1:t.y1,y2:t.y2})}if(t.y1==t.y2){if(e.y[t.y1]||(e.y[t.y1]=[]),t.x1>t.x2){var r=t.x1;t.x1=t.x2,t.x2=r}e.y[t.y1].push({x1:t.x1,x2:t.x2})}},e._addLineToPath=function(t,n,r){return e._avoidOverlapping(n,r),t.push([r.x1,r.y1]),t.push([r.x2,r.y2]),e._addConnectorLine(n,r),r},e._slinkRemoveUnusedPoints=function(e){for(var t=e.length-2;t>=1;t--){var n=e[t-1],r=e[t],i=e[t+1];(r[0]==n[0]&&r[0]==i[0]||r[1]==n[1]&&r[1]==i[1])&&e.splice(t,1)}},e._slinkAvoidOverlaping=function(t,n,r,i){for(var a=1;a<n.length;a++){var o=n[a-1],s=n[a];if(o[0]==s[0]){for(var c=t.x[s[0]];c;){var l=!0;for(var u of c)if(u.y1<=o[1]&&u.y2>=o[1]||u.y1<=s[1]&&u.y2>=s[1]){i==e.orientation.top||i==e.orientation.top_left?r==`left`?s[0]-=e.SLINK_GAP:r==`right`&&(s[0]+=e.SLINK_GAP):(i==e.orientation.bottom||i==e.orientation.bottom_left)&&(r==`right`?s[0]+=e.SLINK_GAP:r==`left`&&(s[0]-=e.SLINK_GAP)),l=!1;break}if(l)break;c=t.x[s[0]]}o[0]=s[0]}var d=!0;if(o[1]==s[1]&&o[0]>=s[0]&&(d=!1),d&&o[1]==s[1]){for(var c=t.y[s[1]];c;){var l=!0;for(var u of c)if(u.x1<=o[0]&&u.x2>=o[0]||u.x1<=s[0]&&u.x2>=s[0]){o[0]>=s[0]||(i==e.orientation.top||i==e.orientation.top_left?s[1]-=e.SLINK_GAP:(i==e.orientation.bottom||i==e.orientation.bottom_left)&&(s[1]+=e.SLINK_GAP),l=!1);break}if(l)break;c=t.y[s[1]]}o[1]=s[1]}d&&e._addConnectorLine(t,{x1:o[0],y1:o[1],x2:s[0],y2:s[1]})}},e._slinkAvoidOverlapingSecond=function(t,n,r){for(var i=1;i<n.length;i++){var a=n[i-1],o=n[i],s=!1;if(a[1]==o[1]){for(var c=t.y[o[1]];c;){var l=!0;for(var u of c)if(u.x1<=a[0]&&u.x2>=a[0]||u.x1<=o[0]&&u.x2>=o[0]){a[0]>=o[0]?(r==e.orientation.top||r==e.orientation.top_left?o[1]-=e.SLINK_GAP:(r==e.orientation.bottom||r==e.orientation.bottom_left)&&(o[1]+=e.SLINK_GAP),l=!1):s=!0;break}if(l)break;c=t.y[o[1]]}a[1]=o[1]}s||e._addConnectorLine(t,{x1:a[0],y1:a[1],x2:o[0],y2:o[1]})}},e._slinkAvoidOverlaping2=function(t,n,r,i){for(var a=1;a<n.length;a++){var o=n[a-1],s=n[a];if(o[1]==s[1]){for(var c=t.y[s[1]];c;){var l=!0;for(var u of c)if(u.x1<=o[0]&&u.x2>=o[0]||u.x1<=s[0]&&u.x2>=s[0]){i==e.orientation.left||i==e.orientation.left_top?r==`top`?s[1]-=e.SLINK_GAP:r==`bottom`&&(s[1]+=e.SLINK_GAP):(i==e.orientation.right||i==e.orientation.right_top)&&(r==`bottom`?s[1]+=e.SLINK_GAP:r==`top`&&(s[1]-=e.SLINK_GAP)),l=!1;break}if(l)break;c=t.y[s[1]]}o[1]=s[1]}var d=!0;if(o[0]==s[0]&&o[1]>=s[1]&&(d=!1),d&&o[0]==s[0]){for(var c=t.x[s[0]];c;){var l=!0;for(var u of c)if(u.y1<=o[1]&&u.y2>=o[1]||u.y1<=s[1]&&u.y2>=s[1]){o[1]>=s[1]||(i==e.orientation.left||i==e.orientation.left_top?s[0]-=e.SLINK_GAP:(i==e.orientation.right||i==e.orientation.right_top)&&(s[0]+=e.SLINK_GAP),l=!1);break}if(l)break;c=t.x[s[0]]}o[0]=s[0]}d&&e._addConnectorLine(t,{x1:o[0],y1:o[1],x2:s[0],y2:s[1]})}},e._slinkAvoidOverlapingSecond2=function(t,n,r){for(var i=1;i<n.length;i++){var a=n[i-1],o=n[i],s=!1;if(a[0]==o[0]){for(var c=t.x[o[0]];c;){var l=!0;for(var u of c)if(u.y1<=a[1]&&u.y2>=a[1]||u.y1<=o[1]&&u.y2>=o[1]){a[1]>=o[1]?(r==e.orientation.left||r==e.orientation.left_top?o[0]-=e.SLINK_GAP:(r==e.orientation.right||r==e.orientation.right_top)&&(o[0]+=e.SLINK_GAP),l=!1):s=!0;break}if(l)break;c=t.x[o[0]]}a[0]=o[0]}s||e._addConnectorLine(t,{x1:a[0],y1:a[1],x2:o[0],y2:o[1]})}},e.editUI=function(){},e.editUI.prototype.init=function(t){this.obj=t,this.fields=null,this.nodeId=null,this.detailsMode=null,this._event_id=e._guid()},e.editUI.prototype.on=function(t,n){return e.events.on(t,n,this._event_id),this},e.editUI.prototype.show=function(t,n,r){if(this.hide(!0)){if(this.nodeId=t,this.detailsMode=n,e.events.publish(`show`,[this,t])===!1)return!1;var i=this,a=this.content(t,n,r);this.obj.element.appendChild(a.element),e.input.init(this.obj.element),e.events.publish(`shown`,[this,{nodeId:t}]),r?n||this._focusElement(a.focusId):this.interval=e.animate(a.element,{right:-20,opacity:0},{right:0,opacity:1},300,e.anim.outSin,function(){n||i._focusElement(a.focusId)}),this.obj.element.querySelector(`[data-edit-from-close]`).addEventListener(`click`,function(n){n.preventDefault(),e.events.publish(`cancel`,[i,{id:t}])!==!1&&i.hide()}),this.obj.element.querySelector(`[data-edit-from-save]`).addEventListener(`click`,function(e){e.preventDefault(),i.hide()});for(var o=this.obj.element.querySelectorAll(`[data-input-btn]`),s=0;s<o.length;s++)o[s].addEventListener(`click`,function(n){n.preventDefault(),e.events.publish(`element-btn-click`,[i,{input:this.parentNode.querySelector(`input`),nodeId:t,event:n}])});this.obj.element.querySelector(`[data-add-more-fields-btn]`).addEventListener(`click`,function(t){t.stopPropagation(),t.preventDefault();var n=this,r=e.elements.textbox({},{type:`textbox`,label:i.obj.config.editForm.addMoreFieldName,btn:i.obj.config.editForm.addMoreBtn},`280px`);n.parentNode.insertAdjacentHTML(`beforebegin`,r.html),n.style.display=`none`,e.input.init(n.parentNode.previousSibling);var a=document.getElementById(r.id);a.focus(),a.nextElementSibling.addEventListener(`click`,function(t){t.stopPropagation(),t.preventDefault();var r=a.value,o=i.obj.element.querySelector(`[data-binding="`+e._escapeDoubleQuotes(a.value)+`"]`);if(!e.isNEU(r)&&!o){var s=e.elements.textbox({},{type:`textbox`,label:r,binding:r},`280px`);a.parentNode.parentNode.parentNode.removeChild(a.parentNode.parentNode),n.parentNode.insertAdjacentHTML(`beforebegin`,s.html),n.style.display=``,e.input.init(n.parentNode.previousSibling);var c=document.getElementById(s.id);c.focus(),c.addEventListener(`input`,function(){i._drawCurrentNodeElement()})}else a.focus()})}),this.obj.element.querySelector(`[data-boc-edit-from-btns]`).addEventListener(`click`,function(n){for(var r=n.target;r&&r.hasAttribute&&!r.hasAttribute(`data-edit-from-btn`);)r=r.parentNode;if(r&&r.hasAttribute){var a=r.getAttribute(`data-edit-from-btn`),o={button:i.obj.config.editForm.buttons[a],name:a,nodeId:t,event:n};if(e.events.publish(`button-click`,[i,o])===!1)return!1;switch(a){case`edit`:i.obj.editUI.show(t,!1,!0);break;case`pdf`:i.obj.exportToPDFProfile(t),i.hide();break;case`share`:i.obj.shareProfile(t);break;case`remove`:i.obj.removeNode(t,null,!0),i.hide();break}}});for(var c=this.obj.element.querySelectorAll(`[data-boc-edit-form] [data-binding]`),s=0;s<c.length;s++){var l=c[s];l.getAttribute(`data-binding`)&&l.addEventListener(`input`,function(){i._drawCurrentNodeElement()})}}},e.editUI.prototype._drawCurrentNodeElement=function(){var t=this.obj.element.querySelector(`[data-boc-edit-form]`),n=e.input.getData(t),r=this.obj.get(this.nodeId),i=this.obj.getNode(this.nodeId),a=e.mergeDeep(r,n),o=this.obj.ui.node(i,a,[],this.obj.config,void 0,void 0,void 0,void 0,this.obj.getScale(),this.obj);this._replaceNodeWith(o)},e.editUI.prototype._replaceNodeWith=function(e){var t=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);t.innerHTML=e;var n=t.firstElementChild;this.obj.getNodeElement(this.nodeId).replaceWith(n)},e.editUI.prototype.setAvatar=function(e){var t=this.obj.element.querySelector(`[id="boc-avatar"]`),n=this.obj.element.querySelector(`[id="boc-avatar"] img`),r=this.obj.element.querySelector(`[id="boc-avatar"] svg`);if(t)n?n.setAttribute(`src`,e):r&&(t.innerHTML=`<img style="width: 100%;height:100%;border-radius: 50%;object-fit:cover;" src="${e}">`);else return;this._drawCurrentNodeElement()},e.editUI.prototype.save=function(t){var n=this.obj.element.querySelector(`[data-boc-edit-form]`),r=e.input.validateAndGetData(n);if(r!==!1){var i=this.obj.get(this.nodeId),a={data:e.mergeDeep(i,r)};return e.events.publish(`save`,[this,a])===!1?void 0:(this.obj.updateNode(a.data,null,!0,t),!0)}return!1},e.editUI.prototype._focusElement=function(t){var n=null;e.isNEU(this.obj.config.editForm.focusBinding)?e.isNEU(t)||(n=document.getElementById(t)):n=this.obj.element.querySelector(`[data-binding="`+this.obj.config.editForm.focusBinding+`"]`),n&&(n.value&&n.value.length&&n.setSelectionRange(n.value.length,n.value.length),n.focus())},e.editUI.prototype.content=function(t,n,r,i,a){var o=this.obj.config.editForm.readOnly,s=JSON.parse(JSON.stringify(this.obj.config.editForm.elements)),c=this.obj.config.editForm.addMore,l=this.obj.config.editForm.saveAndCloseBtn,u=this.obj.config.editForm.buttons,d=this.obj.config.editForm.titleBinding,f=this.obj.config.editForm.photoBinding,p=this.obj.getNode(t),m=this.obj._get(t),h=e.t(p.templateName,p.min,this.obj.getScale()),g=m[d],_=m[f];if(this.obj.config.editForm.generateElementsFromFields)for(var v=0;v<this.fields.length;v++){var y=this.fields[v];if(y!=`tags`){for(var b=!1,x=0;x<s.length;x++){if(Array.isArray(s[x])){for(var S=0;S<s[x].length;S++)if(y==s[x][S].binding){b=!0;break}}else if(y==s[x].binding){b=!0;break}if(b)break}b||s.push({type:`textbox`,label:y,binding:y})}}e.isNEU(g)&&(g=``),_=e.isNEU(_)?e.icon.user(150,150,`#8C8C8C`,0,0):`<img style="width: 100%;height:100%;border-radius: 50%;object-fit:cover;" src="${_}"></img>`;var C,w=!n,T=n?`display:none;`:``,E=n||!c?`display:none;`:``,D=h.editFormHeaderColor?`style="background-color:${h.editFormHeaderColor};"`:``,O=document.createElement(`form`);if(O.setAttribute(`data-boc-edit-form`,``),O.classList.add(`boc-edit-form`),O.classList.add(this.obj.config.mode),O.classList.add(p.templateName.replaceAll(` `,``)),O.classList.add(e.ui._defsIds[p.templateName]),Array.isArray(p.tags)&&p.tags.length)for(var v=0;v<p.tags.length;v++)O.classList.add(p.tags[v].replaceAll(` `,``));O.style.display=`flex`,O.style.opacity=r?1:0,O.style.right=r?0:`-20px`,i&&(O.style.width=i);var k=[];return O.innerHTML=`<div>
24
+ </g>`}}for(var f=0;f<t.visibleNodeIds.length;f++){var p=t.nodes[t.visibleNodeIds[f]],m=a._get(p.id);p.isTreeListItem||(e.RENDER_LINKS_BEFORE_NODES||(s+=a.ui.link(p,a,c,t.bordersByRootIdAndLevel,t.nodes,n)),s+=a.ui.expandCollapseBtn(a,p,m,a.config,a._layoutConfigs,n,c))}var o={content:s,res:t};if(e.events.publish(`render`,[a,o]),s=o.content,t=o.res,s+=a.ui.lonely(a.config),n===e.action.exporting){var w=t.boundary,T=w.maxX-w.minX,E=w.maxY-w.minY,D=a.ui.svg(T,E,[w.minX,w.minY,T,E],a.config,s,c);i.call(a,D,t);return}(n===e.action.centernode||n===e.action.insert||n===e.action.expand||n===e.action.collapse||n===e.action.update)&&(u=l),n===e.action.init&&l!=null&&(u=l),n===e.action.centerNode&&l!=null&&(u=l),a.response=t,a._lastSize={width:a.width(),height:a.height()};var D=a.ui.svg(`100%`,`100%`,u,a.config,s);if(!a._initialized)a.element.innerHTML=a.ui.css()+D+a.ui.menuButton(a.config)+a.ui.aiButton(a.config),a._attachEventHandlers(),a.xScrollUI.create(a.width(),a.config.padding),a.xScrollUI.setPosition(),a.xScrollUI.addListener(a.getSvg()),a.yScrollUI.create(a.height(),a.config.padding),a.yScrollUI.setPosition(),a.yScrollUI.addListener(a.getSvg()),a.config.enableSearch&&a.searchUI.init(a),a.aiUI.init(a),a.orgScribeUI.init(a),a.powerPointPreviewUI.init(a),a.pdfPreviewUI.init(a),a.svgPreviewUI.init(a),a.pngPreviewUI.init(a),a.toolbarUI.init(a,a.config.toolbar),a.undoRedoUI.init(a),a.controlsUI.init(a);else{var O=a.getSvg(),k=O.parentNode;k.removeChild(O),k.insertAdjacentHTML(`afterbegin`,D),a._attachEventHandlers(),a.xScrollUI.addListener(a.getSvg()),a.yScrollUI.addListener(a.getSvg()),a.xScrollUI.setPosition(),a.yScrollUI.setPosition()}var A=!1,j=a.response.animations;if(j[0].length>0){a._hideBeforeAnimation(j[0].length);for(var f=0;f<j[0].length;f++)j[0][f]=a.getNodeElement(j[0][f]);e.animate(j[0],j[1],j[2],a.config.anim.duration,a.config.anim.func,function(){A||=(i&&i.call(a),e.events.publish(`redraw`,[a]),a._showAfterAnimation(),!0)})}n===e.action.centerNode?e.animate(a.getSvg(),{viewbox:l},{viewbox:a.response.viewBox},a.config.anim.duration,a.config.anim.func,function(){a.ripple(r.options.rippleId),A||=(i&&i.call(a),e.events.publish(`redraw`,[a]),a._showAfterAnimation(),!0)},function(){a.xScrollUI.setPosition(),a.yScrollUI.setPosition()}):l&&a.response&&(l[0]!=a.response.viewBox[0]||l[1]!=a.response.viewBox[1]||l[2]!=a.response.viewBox[2]||l[3]!=a.response.viewBox[3])&&(n===e.action.insert||n===e.action.expand||n===e.action.collapse||n===e.action.update||n===e.action.init)?e.animate(a.getSvg(),{viewbox:l},{viewbox:a.response.viewBox},a.config.anim.duration*2,a.config.anim.func,function(){a.xScrollUI.setPosition(),a.yScrollUI.setPosition(),A||=(i&&i.call(a),e.events.publish(`redraw`,[a]),!0)}):j[0].length==0&&(A||=(i&&i.call(a),e.events.publish(`redraw`,[a]),!0)),a._initialized||(a._initialized=!0,a.filterUI.update(),a._ai.setContext(),e.events.publish(`init`,[a])),!a._loaded&&t&&t.nodes&&Object.keys(t.nodes).length&&(a._loaded=!0)}},function(t){e.events.publish(`ready`,[a,t])})}},e.prototype._setInitialSizeIfNotSet=function(){this.mainElement.style.overflow=`hidden`,this.mainElement.style.position=`relative`,this.mainElement.offsetHeight==0&&(this.mainElement.style.height=`100%`,this.mainElement.offsetHeight==0&&(this.mainElement.style.height=`700px`)),this.mainElement.offsetWidth==0&&(this.mainElement.style.width=`100%`,this.mainElement.offsetWidth==0&&(this.mainElement.style.width=`700px`))},e.prototype.width=function(){return this.element.offsetWidth},e.prototype.height=function(){return this.element.offsetHeight},e.prototype.getViewBox=function(){var t=this.getSvg();return e._getViewBox(t)},e.prototype.setViewBox=function(e){this.getSvg().setAttribute(`viewBox`,e.toString())},e.prototype.getScale=function(t){return t||=this.getViewBox(),e.getScale(t,this.width(),this.height(),this.config.scaleInitial,this.config.scaleMax,this.config.scaleMin)},e.prototype.setScale=function(t){t>this.config.scaleMax&&(t=this.config.scaleMax),t<this.config.scaleMin&&(t=this.config.scaleMin);var n=this.getViewBox().slice(0),r=this.width(),i=this.height(),a=r/n[2],o=i/n[3],s=a>o?o:a,c=n,l=n[2],u=n[3];return n[2]/=t/s,n[3]/=t/s,n[0]=c[0]-(n[2]-l)/2,n[1]=c[1]-(n[3]-u)/2,this.setViewBox(n),e.events.publish(`redraw`,[this]),t},e.prototype.ripple=function(t,n,r){var i=this.getNode(t);if(i!=null){var a=this.getNodeElement(t);if(a!=null){var o=this.getScale(),s=i.w/2,c=i.h/2;if(n!==void 0&&r!==void 0){var l=a.getBoundingClientRect();s=n/o-l.left/o,c=r/o-l.top/o}var u=i.w,d=i.h,f=u-s>s?u-s:s,p=d-c>c?d-c:c;f=f,p=p;var m=f>p?f:p,h=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),g=document.createElementNS(`http://www.w3.org/2000/svg`,`clipPath`),_=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),v=document.createElementNS(`http://www.w3.org/2000/svg`,`circle`),y=e.randomId();g.setAttribute(`id`,y);var b={ripple:e.t(i.templateName,i.min,this.getScale()).ripple,node:i};e.events.publish(`ripple`,[this,b]),_.setAttribute(`x`,b.ripple.rect?b.ripple.rect.x:0),_.setAttribute(`y`,b.ripple.rect?b.ripple.rect.y:0),_.setAttribute(`width`,b.ripple.rect?b.ripple.rect.width:i.w),_.setAttribute(`height`,b.ripple.rect?b.ripple.rect.height:i.h),_.setAttribute(`rx`,b.ripple.radius),_.setAttribute(`ry`,b.ripple.radius),v.setAttribute(`clip-path`,`url(#`+y+`)`),v.setAttribute(`cx`,s),v.setAttribute(`cy`,c),v.setAttribute(`r`,0),v.setAttribute(`fill`,b.ripple.color),v.setAttribute(`class`,`boc-ripple`),g.appendChild(_),h.appendChild(g),h.appendChild(v),a.appendChild(h),e.animate(v,{r:0,opacity:1},{r:m,opacity:0},500,e.anim.outPow,function(){a.removeChild(h)})}}},e.prototype.centerOutNodes=function(t){if(this._centerInNodes){var n=JSON.parse(this._centerInNodes);this._centerInNodes=null;var r=this;this._centerInNodesTimeout=e.animate(this.getSvg(),{viewBox:this.getViewBox()},{viewBox:n},300,this.config.anim.func,function(){r.draw(e.action.update,null,function(){t&&t.call(r)})})}},e.prototype.centerInNodes=function(t,n){var r=this.getViewBox();this._centerInNodes||=JSON.stringify(r);var i=2**53-1,a=-(2**53-1),o=2**53-1,s=-(2**53-1);for(var c of t)c.y<i&&(i=c.y),c.y+c.h>a&&(a=c.y+c.h),c.x<o&&(o=c.x),c.x+c.w>s&&(s=c.x+c.w);var l=s-o,u=a-i,d=l/(l+this.config.padding*2),f=u/(u+this.config.padding*2),p=d>f?f:d;p>this.config.scaleMax&&(p=this.config.scaleMax),p<this.config.scaleMin&&(p=this.config.scaleMin);var m=[50,50],h=this.width(),g=this.height(),d=h/r[2],f=g/r[3],_=d>f?f:d,v=r,y=r[2],b=r[3];r[2]/=p/_,r[3]/=p/_,r[0]=v[0]-(r[2]-y)/(100/m[0]),r[1]=v[1]-(r[3]-b)/(100/m[1]),r[0]=o-(h/p-l)/2,r[1]=i-(g/p-u)/2;var x=this;this._centerInNodesTimeout&&=(clearTimeout(this._centerInNodesTimeout),null),this._centerInNodesTimeout=e.animate(this.getSvg(),{viewBox:this.getViewBox()},{viewBox:r},300,this.config.anim.func,function(){x.draw(e.action.update,null,function(){n&&n.call(x)})})},e.prototype.center=function(t,n,r){var i,a,o=t,s=!0,c=!0;n&&n.parentState!=null&&(i=n.parentState),n&&n.childrenState!=null&&(a=n.childrenState),n&&n.rippleId!=null&&(o=n.rippleId),n&&n.vertical!=null&&(s=n.vertical),n&&n.horizontal!=null&&(c=n.horizontal);var l={parentState:i,childrenState:a,rippleId:o,vertical:s,horizontal:c};this._draw(!1,e.action.centerNode,{id:t,options:l},r)},e.prototype.fit=function(t){this.config.scaleInitial=e.match.boundary,this._draw(!0,e.action.init,{method:`fit`},t)},e.prototype.fitIfOutside=function(t){this.config.scaleInitial=e.match.boundaryIfOutside,this._draw(!0,e.action.init,{method:`fit`},t)},e.prototype.toggleFullScreen=function(){var t=document.querySelector(`[`+e.attr.tlbr+`r='fullScreen']`);document.fullscreenElement==this.element||document.webkitFullscreenElement==this.element||document.mozFullScreenElement==this.element||document.msFullscreenElement==this.element?(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen(),t&&(t.innerHTML=e.toolbarUI.openFullScreenIcon)):(this.element.requestFullscreen?this.element.requestFullscreen():this.element.mozRequestFullScreen?this.element.mozRequestFullScreen():this.element.webkitRequestFullscreen?this.element.webkitRequestFullscreen():this.element.msRequestFullscreen&&this.element.msRequestFullscreen(),t&&(t.innerHTML=e.toolbarUI.closeFullScreenIcon))},e.prototype.getNode=function(e){return this.nodes[e]},e.prototype.setLayout=function(t,n){n||=`base`,this._layoutConfigs[n].layout=t,n==`base`&&(this.config.layout=t),this._draw(!1,e.action.update)},e.prototype.setOrientation=function(t,n,r){var i=this;n||=`base`,this._layoutConfigs[n].orientation=t,n==`base`&&(this.config.orientation=t),this._draw(!1,e.action.update,void 0,function(){i.getScale(),e._moveToBoundaryArea(i.getSvg(),i.getViewBox(),i.response.boundary,function(){i._draw(!0,e.action.pan),r&&r()})})},e.prototype.search=function(t,n,r){return e.isNEU(n)&&(n=this.searchUI._searchFields),e.isNEU(r)&&(r=n),e._search.search(this.config.nodes,t,n,r,this.config.searchDisplayField,this.config.searchFieldsWeight,this.searchUI._searchFieldsAbbreviation)},e.prototype._hideBeforeAnimation=function(t){if(this._hideBeforeAnimationCompleted!=1&&!(t&&t<e.ANIM_THRESHOLD)){var n=this.element.getElementsByTagName(`text`);if(n.length>e.TEXT_THRESHOLD)for(var r=0;r<n.length;r++)n[r].style.display=`none`;var i=this.element.getElementsByTagName(`image`);if(i.length>e.IMAGES_THRESHOLD)for(var r=0;r<i.length;r++)i[r].style.display=`none`;var a=this.element.querySelectorAll(`[`+e.attr.link_id+`]`);if(a.length>e.LINKS_THRESHOLD)for(var r=0;r<a.length;r++)a[r].style.display=`none`;var o=this.element.querySelectorAll(`[`+e.attr.control_expcoll_id+`]`);if(o.length>e.BUTTONS_THRESHOLD)for(var r=0;r<o.length;r++)o[r].style.display=`none`;var s=this.element.querySelectorAll(`[`+e.attr.control_up_id+`]`);if(s.length>e.BUTTONS_THRESHOLD)for(var r=0;r<s.length;r++)s[r].style.display=`none`;this._hideBeforeAnimationCompleted=!0}},e.prototype._showAfterAnimation=function(){for(var t=this.element.getElementsByTagName(`text`),n=0;n<t.length;n++)t[n].style.display=``;for(var r=this.element.getElementsByTagName(`image`),n=0;n<r.length;n++)r[n].style.display=``;for(var i=this.element.querySelectorAll(`[`+e.attr.link_id+`]`),n=0;n<i.length;n++)i[n].style.display=``;for(var a=this.element.querySelectorAll(`[`+e.attr.control_expcoll_id+`]`),n=0;n<a.length;n++)a[n].style.display=``;for(var o=this.element.querySelectorAll(`[`+e.attr.control_up_id+`]`),n=0;n<o.length;n++)o[n].style.display=``;this._hideBeforeAnimationCompleted=!1},e.prototype.isChild=function(e,t){for(var n=this.getNode(t);n;){if(n.id==e)return!0;n=n.parent?n.parent:n.stParent}return!1},e.prototype.getCollapsedIds=function(e){for(var t=[],n=0;n<e.childrenIds.length;n++){var r=this.getNode(e.childrenIds[n]);r.collapsed==1&&t.push(r.id)}return t},e.prototype.stateToUrl=function(){if(this.manager.state){var e={};return e.exp=this.manager.state.exp.join(`*`),e.min=this.manager.state.min.join(`*`),e.adjustify=this.manager.state.adjustify.x+`*`+this.manager.state.adjustify.y,e.scale=this.manager.state.scale,e.y=this.manager.state.x,e.x=this.manager.state.y,new URLSearchParams(e).toString()}return``},e.prototype.generateId=function(){for(;;){var e=`_`+(`0000`+(Math.random()*36**4|0).toString(36)).slice(-4);if(this.nodes==null||!this.nodes.hasOwnProperty(e))return e}},e.prototype.moveNodesToVisibleArea=function(t,n){for(var r=this,i=this.roots[0],a=this.getSvg(),o=this.getViewBox(),s=null,c=null,l=null,u=null,d=0;d<t.length;d++){var f=this.nodes[t[d]];f.x!=null&&f.y!=null&&((s===null||s<f.x+f.w)&&(s=f.x+f.w),(c===null||c<f.y+f.h)&&(c=f.y+f.h),(l===null||l>f.x)&&(l=f.x),(u===null||u>f.y)&&(u=f.y))}if(!(s==null||c==null||l==null||u==null)){var p=this.width(),m=this.height(),h=s-l+this.config.padding*2,g=c-u+this.config.padding*2,_=p/h,v=m/g,y=_>v?v:_,b=Math.ceil(p/y),x=Math.ceil(m/y),h=0,g=0;if(b-this.config.padding*2>=s-l)h=(s+l)/2-b/2;else switch(h=i.x-b/2+e.manager._getNodeWidth(i,this.config)/2,this.config.orientation){case e.orientation.right:case e.orientation.right_top:h=-(b/2-(l-s)/2),h<this.config.padding-b&&(h=this.config.padding-b);break;case e.orientation.left:case e.orientation.bottom_left:case e.orientation.top_left:case e.orientation.left_top:h=-(b/2-(s-l)/2),h>-this.config.padding&&(h=-this.config.padding);break}if(x-this.config.padding*2>=c-u)g=(c+u)/2-x/2;else switch(g=-(x/2-(c-u)/2),g>-this.config.padding&&(g=-this.config.padding),this.config.orientation){case e.orientation.bottom:case e.orientation.bottom_left:g=-(x/2-(u-c)/2),g<this.config.padding-x&&(g=this.config.padding-x);break;case e.orientation.left:case e.orientation.right:g=i.y-x/2+e.manager._getNodeWidth(i,this.config)/2;break}var S=[h,g,b,x];o[0]!==S[0]||o[1]!==S[1]?e.animate(a,{viewBox:o},{viewBox:S},this.config.anim.duration,this.config.anim.func,function(){r.draw(e.action.update,void 0,n)}):n&&n()}},e.prototype._nodeHasHiddenParent=function(t){return!t.parent&&!e.isNEU(t.pid)&&this.getNode(t.pid)},e.prototype.destroy=function(){this._initCalled=!1,this._resizeObserver.unobserve(this.element),e.events.removeForEventId(this._event_id),this.element.innerHTML=null},e._defaultConfig=function(t){return{interactive:!0,mode:`light`,lazyLoading:`auto`,enableDragDrop:!1,enableSearch:!0,enableAI:!1,enablePan:!0,keyNavigation:!1,miniMap:!1,controls:null,nodeMenu:null,nodeCircleMenu:null,nodeContextMenu:null,menu:null,toolbar:!1,nodeMouseClick:e.action.details,nodeMouseDbClick:e.none,mouseScrool:e.action.ctrlZoom,showXScroll:!1,showYScroll:!1,template:`ana`,tags:{},min:!1,nodeBinding:{},linkBinding:{},searchFields:null,searchDisplayField:null,searchFieldsWeight:null,searchFieldsAbbreviation:null,nodes:[],clinks:[],slinks:[],backdrops:[],groupDottedLines:[],dottedLines:[],undoRedoStorageName:null,levelSeparation:60,siblingSeparation:20,subtreeSeparation:40,backdropSeparation:15,mixedHierarchyNodesSeparation:15,assistantSeparation:100,minPartnerSeparation:50,partnerChildrenSplitSeparation:20,partnerNodeSeparation:15,columns:10,padding:30,orientation:e.orientation.top,layout:e.layout.normal,layoutGridColumns:`dynamic`,scaleInitial:e.match.boundaryIfOutside,movable:null,scaleMin:.1,scaleMax:5,highlightOnHover:`none`,orderBy:null,editUI:null,aiUI:null,orgScribeUI:null,powerPointPreviewUI:null,pdfPreviewUI:null,svgPreviewUI:null,pngPreviewUI:null,filterUI:null,searchUI:null,xScrollUI:null,yScrollUI:null,nodeMenuUI:null,controlsUI:null,nodeCircleMenuUI:null,nodeContextMenuUI:null,toolbarUI:null,notifierUI:null,menuUI:null,undoRedoUI:null,exportUrl:`https://balkan.app/export`,serverUrl:`https://serverjs.balkan.app`,aiChatTools:[],collapse:{},expand:{},align:e.CENTER,UI:null,anim:{func:e.anim.outPow,duration:200},zoom:{speed:120,smooth:12},roots:null,state:null,editForm:{readOnly:!1,titleBinding:`name`,photoBinding:`img`,addMore:`Add more fields`,addMoreBtn:`Add`,addMoreFieldName:`Field name`,saveAndCloseBtn:`Save and close`,generateElementsFromFields:!0,focusBinding:null,buttons:{edit:{icon:e.icon.edit(24,24,`#fff`),text:`Edit`,hideIfEditMode:!0,hideIfDetailsMode:!1},share:{icon:e.icon.share(24,24,`#fff`),text:`Share`},pdf:{icon:e.icon.pdf(24,24,`#fff`),text:`Save as PDF`},remove:{icon:e.icon.remove(24,24,`#fff`),text:`Remove`,hideIfDetailsMode:!0}},elements:[]}}},e.localStorage={},e.localStorage.getItem=function(e){var t=localStorage.getItem(`to_date`);if(!t)t=new Date,t.setDate(t.getDate()+5),t=t.toISOString(),localStorage.setItem(`to_date`,t);else if(t=new Date(t),t<new Date){for(var n=0,r=localStorage.length;n<r;++n){var i=localStorage.key(n);i&&i.startsWith&&i.startsWith(`{"n"`)&&localStorage.removeItem(i)}localStorage.removeItem(`to_date`)}return localStorage.getItem(e)},e.localStorage.setItem=function(e,t){try{localStorage.setItem(e,t)}catch(e){e.code==e.QUOTA_EXCEEDED_ERR?(console.warn(`Local storage quota exceeded`),localStorage.clear()):(console.error(`Local storage error code:`+e.code),console.error(e))}},e.prototype.canUpdateLink=function(e,t){if(t==null||t==null||e==null||e==null||e==t)return!1;var n=this.getNode(t),r=this.getNode(e);return n&&r&&(n.isPartner||n.hasPartners&&r.isAssistant||n.hasAssistants&&r.isPartner)?!1:!this.isChild(e,t)},e.prototype._canUpdateLink=e.prototype.canUpdateLink,e.prototype.updateNode=function(t,n,r,i){if(t){var a=this,o=this.get(t.id);if(r===!0&&e.events.publish(`update`,[this,o,t])===!1)return!1;this.update(t),this._ai.setContext(),e.events.publish(`updated`,[this]),this.filterUI.update();var s=this.getNode(t.id),c=s.pid;c??=s.stpid,this._draw(!1,e.action.update,{id:c},function(){i||a.ripple(t.id),n&&n()})}},e.prototype.update=function(e){for(var t=0;t<this.config.nodes.length;t++)if(this.config.nodes[t].id==e.id){this._putInUndoStack(),this.clearRedo(),this.config.nodes[t]=e;break}return this},e.prototype.removeNode=function(t,n,r){if(!this.canRemove(t))return!1;var i=this._getNewPidsAndStpidsForIds(t);return r===!0&&e.events.publish(`remove`,[this,t,i])===!1?!1:(this.remove(t),this._ai.setContext(),e.events.publish(`updated`,[this]),this.filterUI.update(),this._draw(!1,e.action.update,null,function(){n&&n()}),!0)},e.prototype.remove=function(e){var t=this.get(e);if(t){this._putInUndoStack(),this.clearRedo();for(var n=this.config.nodes.length-1;n>=0;n--)(this.config.nodes[n].pid==e||this.config.nodes[n].stpid==e)&&(this.config.nodes[n].pid=t.pid,this.config.nodes[n].stpid=t.stpid),this.config.nodes[n].id==e&&this.config.nodes.splice(n,1)}return this},e.prototype._getNewPidsAndStpidsForIds=function(e){var t=this.get(e),n={},r={};if(t)for(var i=this.config.nodes.length-1;i>=0;i--)this.config.nodes[i].pid==e?n[this.config.nodes[i].id]=t.pid:this.config.nodes[i].stpid==e&&(r[this.config.nodes[i].id]=t.stpid);return{newPidsForIds:n,newStpidsForIds:r}},e.prototype.addNode=function(t,n,r){var i=this;if(r===!0&&e.events.publish(`add`,[this,t])===!1)return!1;this.add(t),this._ai.setContext(),e.events.publish(`updated`,[this]),this.filterUI.update(),i._draw(!1,e.action.insert,{id:t.pid,insertedNodeId:t.id},function(){i.ripple(t.id),n&&n()})},e.prototype.add=function(t){if(t.id??console.error(`Call addNode without id`),this._putInUndoStack(),this.clearRedo(),this.config.movable&&!e.isNEU(t.pid)){var n=this._get(t.pid);n&&(n.movex!=null&&(t.movex=n.movex),n.movey!=null&&(t.movey=n.movey))}return this.config.nodes.push(t),this},e.prototype.replaceIds=function(t,n){this._replaceIds(t),this._draw(!1,e.action.update,void 0,n)},e.prototype._replaceIds=function(t){for(var n=function(e){for(var n=0;n<e.length;n++){var r=e[n];for(var i in t){var a=t[i];r.from==i&&(r.from=a),r.to==i&&(r.to=a)}}},r=0;r<this.config.nodes.length;r++){var i=this.config.nodes[r];for(var a in t){var o=t[a];i.id==a&&(i.id=o),i.pid==a&&(i.pid=o),i.stpid==a&&(i.stpid=o),i.ppid==a&&(i.ppid=o)}}if(Array.isArray(this.config.roots))for(var r=0;r<this.config.roots.length;r++)e.isNEU(t[this.config.roots[r]])||(this.config.roots[r]=t[this.config.roots[r]]);if(this.nodes){for(var s in this.nodes)if(!e.isNEU(t[s])){var o=t[s],c=this.nodes[s];c.id=o,this.nodes[o]=c}}if(this.manager.oldNodes){for(var s in this.manager.oldNodes)if(!e.isNEU(t[s])){var o=t[s],c=this.manager.oldNodes[s];c.id=o,this.manager.oldNodes[o]=c}}if(this.roots){for(var s in this.roots)if(!e.isNEU(t[s])){var o=t[s],c=this.roots[s];c.id=o,this.roots[o]=c}}n(this.config.clinks),n(this.config.slinks),n(this.config.groupDottedLines),n(this.config.dottedLines)},e.prototype._get=function(t){var n=this.__get(t);if(n)return n;if((this.config.groupDottedLines.length||this.config.dottedLines.length)&&!e.isNEU(t)&&typeof t==`string`&&(t.indexOf(`balkan_group_dotted_`)!=-1||t.indexOf(`balkan_dotted_`)!=-1)){t=t.replace(`balkan_group_dotted_`,``),t=t.replace(`balkan_dotted_`,``);var r=t.indexOf(`_balkan_id_`);if(t=t.substring(r+11),n=this.__get(t),n)return n}return null},e.prototype.__get=function(e){for(var t=0;t<this.config.nodes.length;t++)if(this.config.nodes[t].id==e)return this.config.nodes[t];return null},e.prototype.get=function(e){var t=this._get(e);return t==null?null:JSON.parse(JSON.stringify(t))},e.prototype.canRemove=function(e){var t=this.getNode(e);return!(!t||t.hasPartners||t.hasAssistants)},e===void 0&&(e={}),e._ajax=function(t,n,r,i,a){i??=`arraybuffer`;var o=new XMLHttpRequest;for(var s in o.onload=function(e){o.readyState==4&&this.status===200&&(e.target==null?a(this.response):a(e.target.response))},o.onerror=function(e){a({error:e})},o.open(n,t),o.responseType=i,o.setRequestHeader(`Content-Type`,`application/json`),e.REQUEST_CUSTOM_HEADERS)o.setRequestHeader(s,e.REQUEST_CUSTOM_HEADERS[s]);r==null?o.send():o.send(r)},e===void 0&&(e={}),e.animate=function(t,n,r,i,a,o,s){var c=10,l=1,u=1,d=i/c+1,f;document.getElementsByTagName(`g`),Array.isArray(t)||(t=[t]),Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);function p(){for(var p=0;p<t.length;p++)for(var m in r[p]){var h=e._arrayContains([`top`,`left`,`right`,`bottom`,`width`,`height`],m.toLowerCase())?`px`:``;switch(m.toLowerCase()){case`d`:var g=a((u*c-c)/i)*(r[p][m][0]-n[p][m][0])+n[p][m][0],_=a((u*c-c)/i)*(r[p][m][1]-n[p][m][1])+n[p][m][1];t[p].setAttribute(`d`,t[p].getAttribute(`d`)+` L`+g+` `+_);break;case`r`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].setAttribute(`r`,v);break;case`x1`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].setAttribute(`x1`,v);break;case`x2`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].setAttribute(`x2`,v);break;case`y1`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].setAttribute(`y1`,v);break;case`y2`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].setAttribute(`y2`,v);break;case`scrolltop`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].scrollTop=v;break;case`rotate3d`:if(r[p][m]){var y=n[p][m],b=r[p][m],x=[0,0,0,0];for(var S in y)x[S]=a((u*c-c)/i)*(b[S]-y[S])+y[S];t[p].style.transform=`rotate3d(`+x.toString()+`deg)`}break;case`transform`:if(r[p][m]){var y=n[p][m],b=r[p][m],x=[0,0,0,0,0,0];for(var S in y)x[S]=a((u*c-c)/i)*(b[S]-y[S])+y[S];t[p].hasAttribute(`transform`)?t[p].setAttribute(`transform`,`matrix(`+x.toString()+`)`):t[p].style.transform=`matrix(`+x.toString()+`)`}break;case`viewbox`:if(r[p][m]){var y=n[p][m],b=r[p][m],x=[0,0,0,0];for(var S in y)x[S]=a((u*c-c)/i)*(b[S]-y[S])+y[S];t[p].setAttribute(`viewBox`,x.toString())}break;case`margin`:if(r[p][m]){var y=n[p][m],b=r[p][m],x=[0,0,0,0];for(var S in y)x[S]=a((u*c-c)/i)*(b[S]-y[S])+y[S];for(var C=``,S=0;S<x.length;S++)C+=parseInt(x[S])+`px `;t[p]&&t[p].style&&(t[p].style[m]=C)}break;case`scrolly`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].scrollTo(0,v);break;default:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p]&&t[p].style&&(t[p].style[m]=v+h);break}}if(s){var v=a((u*c-c)/i);s(v)}u+=l,u>d+1&&(clearInterval(f),o&&o(t))}return f=setInterval(p,c),f},e.anim={},e.anim.inPow=function(e){return e<0?0:e>1?1:e**2},e.anim.outPow=function(e){var t=2;if(e<0)return 0;if(e>1)return 1;var n=t%2==0?-1:1;return n*((e-1)**t+n)},e.anim.inOutPow=function(t){var n=2;if(t<0)return 0;if(t>1)return 1;if(t*=2,t<1)return e.anim.inPow(t,n)/2;var r=n%2==0?-1:1;return r/2*((t-2)**n+r*2)},e.anim.inSin=function(e){return e<0?0:e>1?1:-Math.cos(Math.PI/2*e)+1},e.anim.outSin=function(e){return e<0?0:e>1?1:Math.sin(Math.PI/2*e)},e.anim.inOutSin=function(e){return e<0?0:e>1?1:-.5*(Math.cos(Math.PI*e)-1)},e.anim.inExp=function(e){return e<0?0:e>1?1:2**(10*(e-1))},e.anim.outExp=function(e){return e<0?0:e>1?1:-(2**(-10*e))+1},e.anim.inOutExp=function(e){return e<0?0:e>1?1:e<.5?.5*2**(10*(2*e-1)):.5*(-(2**(10*(-2*e+1)))+2)},e.anim.inCirc=function(e){return e<0?0:e>1?1:-(Math.sqrt(1-e*e)-1)},e.anim.outCirc=function(e){return e<0?0:e>1?1:Math.sqrt(1-(e-1)*(e-1))},e.anim.inOutCirc=function(e){return e<0?0:e>1?1:e<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(2*e-2)*(2*e-2))+1)},e.anim.rebound=function(e){return e<0?0:e>1?1:e<1/2.75?1-7.5625*e*e:e<2/2.75?1-(7.5625*(e-1.5/2.75)*(e-1.5/2.75)+.75):e<2.5/2.75?1-(7.5625*(e-2.25/2.75)*(e-2.25/2.75)+.9375):1-(7.5625*(e-2.625/2.75)*(e-2.625/2.75)+.984375)},e.anim.inBack=function(e){return e<0?0:e>1?1:e*e*(2.70158*e-1.70158)},e.anim.outBack=function(e){return e<0?0:e>1?1:(e-1)*(e-1)*(2.70158*(e-1)+1.70158)+1},e.anim.inOutBack=function(e){return e<0?0:e>1?1:e<.5?.5*(4*e*e*(3.5949*2*e-2.5949)):.5*((2*e-2)*(2*e-2)*(3.5949*(2*e-2)+2.5949)+2)},e.anim.impulse=function(e){var t=2*e;return t*Math.exp(1-t)},e.anim.expPulse=function(e){return Math.exp(-2*e**2)},e===void 0&&(e={}),e.prototype._attachEventHandlers=function(t){if(this.config.interactive){var t=this.getSvg(),n=this;t.addEventListener(`touchstart`,function(e){e.preventDefault(),n._globalMouseDownHandler.apply(n,[this,e])},{passive:!1}),t.addEventListener(`mousedown`,function(e){n._globalMouseDownHandler.apply(n,[this,e])},{passive:!0}),t.addEventListener(`contextmenu`,function(e){n._globalContextHandler.apply(n,[this,e])},{passive:!1}),t.addEventListener(`dblclick`,function(e){n._globalDbClickHandler.apply(n,[this,e])},{passive:!0}),this.config.mouseScrool!=e.action.none&&t.addEventListener(`wheel`,function(e){n._mouseScrollHandler.apply(n,[this,e])},{passive:!1});var r=this.getMenuButton();r&&r.addEventListener(`click`,function(e){n._menuClickHandler.apply(n,[this,e])})}},e===void 0&&(e={}),e.VERSION=`9.2.40`,e.orientation={},e.orientation.top=0,e.orientation.bottom=1,e.orientation.right=2,e.orientation.left=3,e.orientation.top_left=4,e.orientation.bottom_left=5,e.orientation.right_top=6,e.orientation.left_top=7,e.anchor={top_right:`top_right`,right_top:`right_top`,bottom_right:`bottom_right`,right_bottom:`right_bottom`,top_left:`top_left`,left_top:`left_top`,bottom_left:`bottom_left`,left_bottom:`left_bottom`,top:`top`,bottom:`bottom`,left:`left`,right:`right`},e.align={},e.align.center=e.CENTER=8,e.align.orientation=e.ORIENTATION=9,e.attr={},e.attr.l=`data-l`,e.attr.id=`data-id`,e.attr.sl=`data-sl`,e.attr.lbl=`data-lbl`,e.attr.val=`data-val`,e.attr.tlbr=`data-tlbr`,e.attr.item=`data-item`,e.attr.layout=`data-layout`,e.attr.node_id=`data-n-id`,e.attr.link_id=`data-l-id`,e.attr.field_name=`data-f-name`,e.attr.c_link_to=`data-c-l-to`,e.attr.c_link_from=`data-c-l-from`,e.attr.s_link_to=`data-s-l-to`,e.attr.s_link_from=`data-s-l-from`,e.attr.control_add=`data-ctrl-add`,e.attr.control_expcoll_id=`data-ctrl-ec-id`,e.attr.control_up_id=`data-ctrl-up-id`,e.attr.control_export_menu=`data-ctrl-menu`,e.attr.control_node_menu_id=`data-ctrl-n-menu-id`,e.attr.control_node_circle_menu_id=`data-ctrl-n-c-menu-id`,e.attr.control_node_circle_menu_name=`data-ctrl-n-c-menu-name`,e.attr.control_node_circle_menu_wrraper_id=`data-ctrl-n-c-menu-wrapper-id`,e.attr.width=`data-width`,e.attr.text_overflow=`data-text-overflow`,e.ID=`id`,e.PID=`pid`,e.STPID=`stpid`,e.TAGS=`tags`,e.NODES=`nodes`,e.ELASTIC=`elastic`,e.ASSISTANT=`Assistant`,e.action={},e.action.expand=0,e.action.collapse=1,e.action.maximize=101,e.action.minimize=102,e.action.expandCollapse=501,e.action.edit=1,e.action.zoom=2,e.action.ctrlZoom=22,e.action.scroll=41,e.action.xScroll=3,e.action.yScroll=4,e.action.none=5,e.action.init=6,e.action.update=7,e.action.move=70,e.action.pan=8,e.action.centerNode=9,e.action.resize=10,e.action.insert=11,e.action.insertfirst=12,e.action.details=13,e.action.exporting=14,e.none=400001,e.scroll={},e.scroll.visible=!0,e.scroll.smooth=12,e.scroll.speed=120,e.scroll.safari={smooth:12,speed:250},e.match={},e.match.height=100001,e.match.width=100002,e.match.boundary=100003,e.match.boundaryIfOutside=100004,e.match.none=1,e.movable={},e.movable.node=`node`,e.movable.tree=`tree`,e.movable.detachTree=`detachTree`,e.layout={},e.layout.normal=e.normal=0,e.layout.mixed=e.mixed=1,e.layout.tree=e.tree=2,e.layout.treeLeftOffset=e.treeLeftOffset=3,e.layout.treeRightOffset=e.treeRightOffset=4,e.layout.treeLeft=5,e.layout.treeRight=6,e.layout.grid=-1,e.layout.treeList=-2,e.nodeOpenTag=`<g `+e.attr.node_id+`="{id}" style="opacity: {opacity}" transform="matrix(1,0,0,1,{x},{y})" class="{class}" `+e.attr.sl+`="{sl}" `+e.attr.l+`="{level}" {lcn}>`,e.linkOpenTag=`<g `+e.attr.link_id+`="[{id}][{child-id}]" class="{class}">`,e.expcollOpenTag=`<g `+e.attr.control_expcoll_id+`="{id}" transform="matrix(1,0,0,1,{x},{y})" style="cursor:pointer;">`,e.upOpenTag=`<g `+e.attr.control_up_id+`="{id}" transform="matrix(1,0,0,1,{x},{y})" style="cursor:pointer;">`,e.linkFieldsOpenTag=`<g transform="matrix(1,0,0,1,{x},{y}) rotate({rotate})">`,e.grCloseTag=`</g>`,e.A5={width:420,height:595},e.A4={width:595,height:842},e.A3={width:842,height:1191},e.A2={width:1191,height:1684},e.A1={width:1684,height:2384},e.Letter={width:612,height:791},e.Legal={width:612,height:1009},e.Legal={width:612,height:1009},e.Widescreen={width:720,height:1280},e.Standard={width:720,height:960},e.COLLAPSE_PARENT_NEIGHBORS=1,e.COLLAPSE_SUB_CHILDRENS=2,e.COLLAPSE_PARENT_SUB_CHILDREN_EXCEPT_CLICKED=3,e.TEXT_THRESHOLD=4e3,e.IMAGES_THRESHOLD=1e3,e.LINKS_THRESHOLD=2e3,e.BUTTONS_THRESHOLD=700,e.ANIM_THRESHOLD=500,e.IT_IS_LONELY_HERE=`<g transform="translate(-100, 0)" style="cursor:pointer;" `+e.attr.control_add+`="control-add"><text fill="#039be5">{link}</text></g>`,e.RES={},e.IT_IS_LONELY_HERE_LINK=e.RES.IT_IS_LONELY_HERE_LINK=`It's lonely here, add your first node`,e.FIRE_DRAG_NOT_CLICK_IF_MOVE=3,e.STRING_TAGS=!1,e.MAX_NODES_MESS=`The trial has expired or 200 nodes limit was reached! <br /><a style='color: #039BE5;' target='_blank' href='https://balkan.app/OrgChartJS/Docs/Evaluation'>See more</a>`,e.OFFLINE_MESS=`The evaluation version requires internet connection! <br /><a style='color: #039BE5;' target='_blank' href='https://balkan.app/OrgChartJS/Docs/Evaluation'>See more</a>`,e.SEARCH_PLACEHOLDER=`Search... type ? to get help.`,e.SEARCH_HELP_SYMBOL=`?`,e.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE=!1,e.SEARCH_RESULT_LIMIT=10,e.IMPORT_MESSAGE=`Choose the columns (fields) in your data file that contain the required information.`,e.FIXED_POSITION_ON_CLICK=!1,e.RENDER_LINKS_BEFORE_NODES=!1,e.RENDER_CLINKS_BEFORE_NODES=!1,e.MIXED_LAYOUT_ALL_NODES=!1,e.MIXED_LAYOUT_FOR_NODES_WITH_COLLAPSED_CHILDREN=!1,e.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN=1,e.LINK_ROUNDED_CORNERS=5,e.MOVE_STEP=5,e.CLINK_CURVE=1,e.MAX_DEPTH=200,e.SCALE_FACTOR=1.44,e.LAZY_LOADING_FACTOR=`auto`,e.LAZY_LOADING=!0,e.ARRAY_FIELDS=[`tags`],e.CSV_DELIMITER=`,`,e.EDITFORM_CLOSE_BTN=`<svg data-edit-from-close class="boc-edit-form-close"><path style="fill:#ffffff;" d="M21.205,5.007c-0.429-0.444-1.143-0.444-1.587,0c-0.429,0.429-0.429,1.143,0,1.571l8.047,8.047H1.111 C0.492,14.626,0,15.118,0,15.737c0,0.619,0.492,1.127,1.111,1.127h26.554l-8.047,8.032c-0.429,0.444-0.429,1.159,0,1.587 c0.444,0.444,1.159,0.444,1.587,0l9.952-9.952c0.444-0.429,0.444-1.143,0-1.571L21.205,5.007z"></path></svg>`,e.ESCAPE_HTML=!1,e.VERTICAL_CHILDREN_ASSISTANT=!1,e.EXPORT_PAGES_CUT_NODES=!1,e.RESET_MOVABLE_ONEXPANDCOLLAPSE=!1,e.FILTER_ALPHABETICALLY=!0,e.SERVER_PREFIX=`.azurewebsites.net/api/you-see-this-request-because-it-is-trial-version-of-orgchartjs`,e.FUNC_URL_NAME=`func-url-orgchartjs`,e.MINIMUM_SYMBOLS_IN_SEARCH_INPUT=1,e.AI_SYSTEM_MESSAGES=[],e.ORGSCRIBE_OFFSET=` `,e.TREELIST_WHEEL_STEP=`auto`,e.TREELIST_SCROLLBAR_WIDTH=10,e.CONVERT_IMAGES_TO_BASE64_BEFORE_EXPORT=!1,e.REQUEST_CUSTOM_HEADERS={},e.SLINK_GAP=7,e._intersects=function(t,n,r){var i=t.x-r.siblingSeparation/4,a=t.y,o=t.x+t.w+r.siblingSeparation/4,s=t.y;switch(r.orientation){case e.orientation.right:case e.orientation.right_top:case e.orientation.left:case e.orientation.left_top:i=t.x,a=t.y-r.siblingSeparation/4,o=t.x,s=t.y+t.h+r.siblingSeparation/4;break}var c=n.p,l=n.q,u=n.r,d=n.s,f=(o-i)*(d-l)-(u-c)*(s-a),p,m;return f===0?!1:(m=((d-l)*(u-i)+(c-u)*(d-a))/f,p=((a-s)*(u-i)+(o-i)*(d-a))/f,0<m&&m<1&&0<p&&p<1)},e._addPoint=function(t,n,r,i,a){switch(r.orientation){case e.orientation.top:case e.orientation.top_left:return e._addPointTop(t,n,r,i,a);case e.orientation.bottom:case e.orientation.bottom_left:return e._addPointBottom(t,n,r,i,a);case e.orientation.left:case e.orientation.left_top:return e._addPointLeft(t,n,r,i,a);case e.orientation.right:case e.orientation.right_top:return e._addPointRight(t,n,r,i,a)}},e._addPointTop=function(e,t,n,r,i){var a,o,s;return i==`left`?a=e.leftNeighbor?e.x+(e.leftNeighbor.x+e.leftNeighbor.w-e.x)/2:e.x-n.siblingSeparation/2:i==`right`&&(a=e.rightNeighbor?e.x+e.w+(e.rightNeighbor.x-(e.x+e.w))/2:e.x+e.w+n.siblingSeparation/2),t.push([a,t[t.length-1][1]]),t.push([a,e.y-n.levelSeparation/3]),o=t[t.length-1][1],s=a,r.p=a,r.q=o,r.r=s,r},e._addPointBottom=function(e,t,n,r,i){var a,o,s;return i==`left`?a=e.leftNeighbor?e.x+(e.leftNeighbor.x+e.leftNeighbor.w-e.x)/2:e.x-n.siblingSeparation/2:i==`right`&&(a=e.rightNeighbor?e.x+e.w+(e.rightNeighbor.x-(e.x+e.w))/2:e.x+e.w+n.siblingSeparation/2),t.push([a,t[t.length-1][1]]),t.push([a,e.y+e.h+n.levelSeparation/3]),o=t[t.length-1][1],s=a,r.p=a,r.q=o,r.r=s,r},e._addPointLeft=function(e,t,n,r,i){var a=t[t.length-1][0],o;i==`bottom`?o=e.rightNeighbor?e.y+e.h+(e.rightNeighbor.y-(e.y+e.h))/2:e.y+e.h+n.siblingSeparation/2:i==`top`&&(o=e.leftNeighbor?e.y+(e.leftNeighbor.y+e.leftNeighbor.h-e.y)/2:e.y-n.siblingSeparation/2),t.push([t[t.length-1][0],o]),t.push([e.x-n.levelSeparation/3,o]),a=t[t.length-1][0];var s=o;return r.p=a,r.q=o,r.s=s,r},e._addPointRight=function(e,t,n,r,i){var a=t[t.length-1][0],o;i==`bottom`?o=e.rightNeighbor?e.y+e.h+(e.rightNeighbor.y-(e.y+e.h))/2:e.y+e.h+n.siblingSeparation/2:i==`top`&&(o=e.leftNeighbor?e.y+(e.leftNeighbor.y+e.leftNeighbor.h-e.y)/2:e.y-n.siblingSeparation/2),t.push([t[t.length-1][0],o]),t.push([e.x+e.w+n.levelSeparation/3,o]),a=t[t.length-1][0];var s=o;return r.p=a,r.q=o,r.s=s,r},e._addConnectorLines=function(t,n){e._addConnectorLine(t,{x1:n.xa,y1:n.ya,x2:n.xb,y2:n.yb}),e._addConnectorLine(t,{x1:n.xb,y1:n.yb,x2:n.xc,y2:n.yc}),e._addConnectorLine(t,{x1:n.xc,y1:n.yc,x2:n.xd,y2:n.yd})},e._addConnectorLine=function(e,t){if(t.x1==t.x2){if(e.x[t.x1]||(e.x[t.x1]=[]),t.y1>t.y2){var n=t.y1;t.y1=t.y2,t.y2=n}e.x[t.x1].push({y1:t.y1,y2:t.y2})}if(t.y1==t.y2){if(e.y[t.y1]||(e.y[t.y1]=[]),t.x1>t.x2){var r=t.x1;t.x1=t.x2,t.x2=r}e.y[t.y1].push({x1:t.x1,x2:t.x2})}},e._addLineToPath=function(t,n,r){return e._avoidOverlapping(n,r),t.push([r.x1,r.y1]),t.push([r.x2,r.y2]),e._addConnectorLine(n,r),r},e._slinkRemoveUnusedPoints=function(e){for(var t=e.length-2;t>=1;t--){var n=e[t-1],r=e[t],i=e[t+1];(r[0]==n[0]&&r[0]==i[0]||r[1]==n[1]&&r[1]==i[1])&&e.splice(t,1)}},e._slinkAvoidOverlaping=function(t,n,r,i){for(var a=1;a<n.length;a++){var o=n[a-1],s=n[a];if(o[0]==s[0]){for(var c=t.x[s[0]];c;){var l=!0;for(var u of c)if(u.y1<=o[1]&&u.y2>=o[1]||u.y1<=s[1]&&u.y2>=s[1]){i==e.orientation.top||i==e.orientation.top_left?r==`left`?s[0]-=e.SLINK_GAP:r==`right`&&(s[0]+=e.SLINK_GAP):(i==e.orientation.bottom||i==e.orientation.bottom_left)&&(r==`right`?s[0]+=e.SLINK_GAP:r==`left`&&(s[0]-=e.SLINK_GAP)),l=!1;break}if(l)break;c=t.x[s[0]]}o[0]=s[0]}var d=!0;if(o[1]==s[1]&&o[0]>=s[0]&&(d=!1),d&&o[1]==s[1]){for(var c=t.y[s[1]];c;){var l=!0;for(var u of c)if(u.x1<=o[0]&&u.x2>=o[0]||u.x1<=s[0]&&u.x2>=s[0]){o[0]>=s[0]||(i==e.orientation.top||i==e.orientation.top_left?s[1]-=e.SLINK_GAP:(i==e.orientation.bottom||i==e.orientation.bottom_left)&&(s[1]+=e.SLINK_GAP),l=!1);break}if(l)break;c=t.y[s[1]]}o[1]=s[1]}d&&e._addConnectorLine(t,{x1:o[0],y1:o[1],x2:s[0],y2:s[1]})}},e._slinkAvoidOverlapingSecond=function(t,n,r){for(var i=1;i<n.length;i++){var a=n[i-1],o=n[i],s=!1;if(a[1]==o[1]){for(var c=t.y[o[1]];c;){var l=!0;for(var u of c)if(u.x1<=a[0]&&u.x2>=a[0]||u.x1<=o[0]&&u.x2>=o[0]){a[0]>=o[0]?(r==e.orientation.top||r==e.orientation.top_left?o[1]-=e.SLINK_GAP:(r==e.orientation.bottom||r==e.orientation.bottom_left)&&(o[1]+=e.SLINK_GAP),l=!1):s=!0;break}if(l)break;c=t.y[o[1]]}a[1]=o[1]}s||e._addConnectorLine(t,{x1:a[0],y1:a[1],x2:o[0],y2:o[1]})}},e._slinkAvoidOverlaping2=function(t,n,r,i){for(var a=1;a<n.length;a++){var o=n[a-1],s=n[a];if(o[1]==s[1]){for(var c=t.y[s[1]];c;){var l=!0;for(var u of c)if(u.x1<=o[0]&&u.x2>=o[0]||u.x1<=s[0]&&u.x2>=s[0]){i==e.orientation.left||i==e.orientation.left_top?r==`top`?s[1]-=e.SLINK_GAP:r==`bottom`&&(s[1]+=e.SLINK_GAP):(i==e.orientation.right||i==e.orientation.right_top)&&(r==`bottom`?s[1]+=e.SLINK_GAP:r==`top`&&(s[1]-=e.SLINK_GAP)),l=!1;break}if(l)break;c=t.y[s[1]]}o[1]=s[1]}var d=!0;if(o[0]==s[0]&&o[1]>=s[1]&&(d=!1),d&&o[0]==s[0]){for(var c=t.x[s[0]];c;){var l=!0;for(var u of c)if(u.y1<=o[1]&&u.y2>=o[1]||u.y1<=s[1]&&u.y2>=s[1]){o[1]>=s[1]||(i==e.orientation.left||i==e.orientation.left_top?s[0]-=e.SLINK_GAP:(i==e.orientation.right||i==e.orientation.right_top)&&(s[0]+=e.SLINK_GAP),l=!1);break}if(l)break;c=t.x[s[0]]}o[0]=s[0]}d&&e._addConnectorLine(t,{x1:o[0],y1:o[1],x2:s[0],y2:s[1]})}},e._slinkAvoidOverlapingSecond2=function(t,n,r){for(var i=1;i<n.length;i++){var a=n[i-1],o=n[i],s=!1;if(a[0]==o[0]){for(var c=t.x[o[0]];c;){var l=!0;for(var u of c)if(u.y1<=a[1]&&u.y2>=a[1]||u.y1<=o[1]&&u.y2>=o[1]){a[1]>=o[1]?(r==e.orientation.left||r==e.orientation.left_top?o[0]-=e.SLINK_GAP:(r==e.orientation.right||r==e.orientation.right_top)&&(o[0]+=e.SLINK_GAP),l=!1):s=!0;break}if(l)break;c=t.x[o[0]]}a[0]=o[0]}s||e._addConnectorLine(t,{x1:a[0],y1:a[1],x2:o[0],y2:o[1]})}},e.editUI=function(){},e.editUI.prototype.init=function(t){this.obj=t,this.fields=null,this.nodeId=null,this.detailsMode=null,this._event_id=e._guid()},e.editUI.prototype.on=function(t,n){return e.events.on(t,n,this._event_id),this},e.editUI.prototype.show=function(t,n,r){if(this.hide(!0)){if(this.nodeId=t,this.detailsMode=n,e.events.publish(`show`,[this,t])===!1)return!1;var i=this,a=this.content(t,n,r);this.obj.element.appendChild(a.element),e.input.init(this.obj.element),e.events.publish(`shown`,[this,{nodeId:t}]),r?n||this._focusElement(a.focusId):this.interval=e.animate(a.element,{right:-20,opacity:0},{right:0,opacity:1},300,e.anim.outSin,function(){n||i._focusElement(a.focusId)}),this.obj.element.querySelector(`[data-edit-from-close]`).addEventListener(`click`,function(n){n.preventDefault(),e.events.publish(`cancel`,[i,{id:t}])!==!1&&i.hide()}),this.obj.element.querySelector(`[data-edit-from-save]`).addEventListener(`click`,function(e){e.preventDefault(),i.hide()});for(var o=this.obj.element.querySelectorAll(`[data-input-btn]`),s=0;s<o.length;s++)o[s].addEventListener(`click`,function(n){n.preventDefault(),e.events.publish(`element-btn-click`,[i,{input:this.parentNode.querySelector(`input`),nodeId:t,event:n}])});this.obj.element.querySelector(`[data-add-more-fields-btn]`).addEventListener(`click`,function(t){t.stopPropagation(),t.preventDefault();var n=this,r=e.elements.textbox({},{type:`textbox`,label:i.obj.config.editForm.addMoreFieldName,btn:i.obj.config.editForm.addMoreBtn},`280px`);n.parentNode.insertAdjacentHTML(`beforebegin`,r.html),n.style.display=`none`,e.input.init(n.parentNode.previousSibling);var a=document.getElementById(r.id);a.focus(),a.nextElementSibling.addEventListener(`click`,function(t){t.stopPropagation(),t.preventDefault();var r=a.value,o=i.obj.element.querySelector(`[data-binding="`+e._escapeDoubleQuotes(a.value)+`"]`);if(!e.isNEU(r)&&!o){var s=e.elements.textbox({},{type:`textbox`,label:r,binding:r},`280px`);a.parentNode.parentNode.parentNode.removeChild(a.parentNode.parentNode),n.parentNode.insertAdjacentHTML(`beforebegin`,s.html),n.style.display=``,e.input.init(n.parentNode.previousSibling);var c=document.getElementById(s.id);c.focus(),c.addEventListener(`input`,function(){i._drawCurrentNodeElement()})}else a.focus()})}),this.obj.element.querySelector(`[data-boc-edit-from-btns]`).addEventListener(`click`,function(n){for(var r=n.target;r&&r.hasAttribute&&!r.hasAttribute(`data-edit-from-btn`);)r=r.parentNode;if(r&&r.hasAttribute){var a=r.getAttribute(`data-edit-from-btn`),o={button:i.obj.config.editForm.buttons[a],name:a,nodeId:t,event:n};if(e.events.publish(`button-click`,[i,o])===!1)return!1;switch(a){case`edit`:i.obj.editUI.show(t,!1,!0);break;case`pdf`:i.obj.exportToPDFProfile(t),i.hide();break;case`share`:i.obj.shareProfile(t);break;case`remove`:i.obj.removeNode(t,null,!0),i.hide();break}}});for(var c=this.obj.element.querySelectorAll(`[data-boc-edit-form] [data-binding]`),s=0;s<c.length;s++){var l=c[s];l.getAttribute(`data-binding`)&&l.addEventListener(`input`,function(){i._drawCurrentNodeElement()})}}},e.editUI.prototype._drawCurrentNodeElement=function(){var t=this.obj.element.querySelector(`[data-boc-edit-form]`),n=e.input.getData(t),r=this.obj.get(this.nodeId),i=this.obj.getNode(this.nodeId),a=e.mergeDeep(r,n),o=this.obj.ui.node(i,a,[],this.obj.config,void 0,void 0,void 0,void 0,this.obj.getScale(),this.obj);this._replaceNodeWith(o)},e.editUI.prototype._replaceNodeWith=function(e){var t=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);t.innerHTML=e;var n=t.firstElementChild;this.obj.getNodeElement(this.nodeId).replaceWith(n)},e.editUI.prototype.setAvatar=function(e){var t=this.obj.element.querySelector(`[id="boc-avatar"]`),n=this.obj.element.querySelector(`[id="boc-avatar"] img`),r=this.obj.element.querySelector(`[id="boc-avatar"] svg`);if(t)n?n.setAttribute(`src`,e):r&&(t.innerHTML=`<img style="width: 100%;height:100%;border-radius: 50%;object-fit:cover;" src="${e}">`);else return;this._drawCurrentNodeElement()},e.editUI.prototype.save=function(t){var n=this.obj.element.querySelector(`[data-boc-edit-form]`),r=e.input.validateAndGetData(n);if(r!==!1){var i=this.obj.get(this.nodeId),a={data:e.mergeDeep(i,r)};return e.events.publish(`save`,[this,a])===!1?void 0:(this.obj.updateNode(a.data,null,!0,t),!0)}return!1},e.editUI.prototype._focusElement=function(t){var n=null;e.isNEU(this.obj.config.editForm.focusBinding)?e.isNEU(t)||(n=document.getElementById(t)):n=this.obj.element.querySelector(`[data-binding="`+this.obj.config.editForm.focusBinding+`"]`),n&&(n.value&&n.value.length&&n.setSelectionRange(n.value.length,n.value.length),n.focus())},e.editUI.prototype.content=function(t,n,r,i,a){var o=this.obj.config.editForm.readOnly,s=JSON.parse(JSON.stringify(this.obj.config.editForm.elements)),c=this.obj.config.editForm.addMore,l=this.obj.config.editForm.saveAndCloseBtn,u=this.obj.config.editForm.buttons,d=this.obj.config.editForm.titleBinding,f=this.obj.config.editForm.photoBinding,p=this.obj.getNode(t),m=this.obj._get(t),h=e.t(p.templateName,p.min,this.obj.getScale()),g=m[d],_=m[f];if(this.obj.config.editForm.generateElementsFromFields)for(var v=0;v<this.fields.length;v++){var y=this.fields[v];if(y!=`tags`){for(var b=!1,x=0;x<s.length;x++){if(Array.isArray(s[x])){for(var S=0;S<s[x].length;S++)if(y==s[x][S].binding){b=!0;break}}else if(y==s[x].binding){b=!0;break}if(b)break}b||s.push({type:`textbox`,label:y,binding:y})}}e.isNEU(g)&&(g=``),_=e.isNEU(_)?e.icon.user(150,150,`#8C8C8C`,0,0):`<img style="width: 100%;height:100%;border-radius: 50%;object-fit:cover;" src="${_}"></img>`;var C,w=!n,T=n?`display:none;`:``,E=n||!c?`display:none;`:``,D=h.editFormHeaderColor?`style="background-color:${h.editFormHeaderColor};"`:``,O=document.createElement(`form`);if(O.setAttribute(`data-boc-edit-form`,``),O.classList.add(`boc-edit-form`),O.classList.add(this.obj.config.mode),O.classList.add(p.templateName.replaceAll(` `,``)),O.classList.add(e.ui._defsIds[p.templateName]),Array.isArray(p.tags)&&p.tags.length)for(var v=0;v<p.tags.length;v++)O.classList.add(p.tags[v].replaceAll(` `,``));O.style.display=`flex`,O.style.opacity=r?1:0,O.style.right=r?0:`-20px`,i&&(O.style.width=i);var k=[];return O.innerHTML=`<div>
25
25
  <div class="boc-edit-form-header" ${D}>
26
26
  ${a?``:e.EDITFORM_CLOSE_BTN}
27
27
  ${e.editUI.renderHeaderContent(g,_,p,m)}
@@ -270,11 +270,11 @@ var e=function(e,t){var n=this;Object.defineProperty(this,`element`,{get(){retur
270
270
  ${t}
271
271
  </td>
272
272
  <td class="boc-search-text-td">${r} <br/>${i}</td>
273
- </tr>`},e.searchUI.prototype.hide=function(){if(e.events.publish(`hide`,[this])===!1)return!1;this._searchAfterEnterPress&&(this._searchAfterEnterPress=!1,this.instance.draw()),this.lastSearch=[],this.xBtn&&(this.xBtn.style.display=`none`),this.searchTableWrapper&&(this.searchTableWrapper.innerHTML=``),this.input&&(e.isMobile()||(this.input.value=``),document.activeElement==this.input&&this.input.blur(),document.activeElement==this.xBtn&&e.input.blurHandler(this.input))},e.searchUI.prototype.on=function(t,n){return e.events.on(t,n,this._event_id),this},e.events.on(`redraw`,function(t,n){for(var r=t.element.querySelectorAll(`[data-n-id]`),i=0;i<r.length;i++)r[i].addEventListener(`mouseover`,function(n){if(!this.contains(n.relatedTarget)){var r=this.getAttribute(`data-n-id`),i={node:t.getNode(r),event:n};if(e.events.publish(`node-mouseover`,[t,i])===!1)return;e._hover._addSelectedStyle(t,i.node,i.node.id)}}),r[i].addEventListener(`mouseleave`,function(n){var r=this.getAttribute(`data-n-id`),i={node:t.getNode(r),event:n};e.events.publish(`node-mouseleave`,[t,i])!==!1&&e._hover._removeSelectedStyle(t)})}),e._hover={},e._hover._addSelectedStyle=function(t,n,r){n.isSplit||t.config.highlightOnHover!=`none`&&((t.config.highlightOnHover==`parents`||t.config.highlightOnHover==`childrenAndParents`)&&e._hover._addSelectedStyleParents(t,n,r),(t.config.highlightOnHover==`children`||t.config.highlightOnHover==`childrenAndParents`)&&e._hover._addSelectedStyleChildren(t,n,r),t.config.highlightOnHover==`sameLevel`&&e._hover._addSelectedStyleSameLevel(t,n,r))},e._hover._addSelectedStyleChildren=function(t,n,r){var i=t.getNodeElement(n.id);i&&i.classList.add(`boc-hover`);var a=t.element.querySelector(`[data-ctrl-ec-id="${n.id}"]`);if(a&&a.classList.add(`boc-hover`),n.id!=r){if(n.rightNeighbor&&n.rightNeighbor.isSplit&&n.rightNeighbor.pid==n.pid){var o=t.element.querySelector(`[data-l-id="[${n.parent.id}][${n.id}]"]`);o&&o.classList.add(`boc-hover`)}if(n.leftNeighbor&&n.leftNeighbor.isSplit&&n.leftNeighbor.pid==n.pid){var o=t.element.querySelector(`[data-l-id="[${n.parent.id}][${n.id}]"]`);o&&o.classList.add(`boc-hover`)}if(n.parent&&n.parent.isSplit){var o=t.element.querySelector(`[data-l-id="[${n.parent.id}][${n.id}]"]`);o&&o.classList.add(`boc-hover`)}}for(var s of n.children)if(s.isSplit){var o=t.element.querySelector(`[data-l-id="[${n.id}][${s.id}]"]`);o&&o.classList.add(`boc-hover`),e._hover._addSelectedStyleChildren(t,s,r)}for(var c of n.childrenIds){var s=t.getNode(c),o=t.element.querySelector(`[data-l-id="[${n.id}][${s.id}]"]`);o&&o.classList.add(`boc-hover`),e._hover._addSelectedStyleChildren(t,s,r)}},e._hover._addSelectedStyleSameLevel=function(e,t,n){var r=e.getNodeElement(t.id);r&&r.classList.add(`boc-hover`);for(var i of e.element.querySelectorAll(`[data-l="${t.level}"]`))i.classList.add(`boc-hover`)},e._hover._addSelectedStyleParents=function(t,n,r){var i=t.getNodeElement(n.id);if(i&&i.classList.add(`boc-hover`),n.parent){var a=t.element.querySelector(`[data-l-id="[${n.parent.id}][${n.id}]"]`);a&&a.classList.add(`boc-hover`)}if(r!=n.id){var o=t.element.querySelector(`[data-ctrl-ec-id="${n.id}"]`);o&&o.classList.add(`boc-hover`)}n.rightNeighbor&&n.rightNeighbor.isSplit&&n.rightNeighbor.pid==n.pid&&e._hover._addSelectedStyleParents(t,n.rightNeighbor,r),n.leftNeighbor&&n.leftNeighbor.isSplit&&n.leftNeighbor.pid==n.pid&&e._hover._addSelectedStyleParents(t,n.leftNeighbor,r),n.parent&&n.parent.isSplit&&e._hover._addSelectedStyleParents(t,n.parent,r);var s=t.getNode(n.pid);n.parent&&e._hover._addSelectedStyleParents(t,s,r)},e._hover._removeSelectedStyle=function(e){let t=e.element.querySelectorAll(`.boc-hover`);for(let e=0;e<t.length;e++)t[e].classList.remove(`boc-hover`)},e===void 0&&(e={}),e.manager=function(e){this.config=e.config,this.layoutConfigs=e._layoutConfigs,this.visibleNodeIds=[],this.viewBox=null,this.action=null,this.actionParams=null,this.nodes={},this.oldNodes={},this.maxX=null,this.maxY=null,this.minX=null,this.minY=null,this.bordersByRootIdAndLevel=null,this.roots=null,this.state=null,this.vbIsInitializedFromState=!1,this.rootList=[],this.instance=e,this._fixAdjustForExport={x:0,y:0}},e.manager.prototype.read=function(t,n,r,i,a,o,s,c){var l=this;e.state._get(this.config.state,n,r,function(u){l.state=u,l.action=a,l.actionParams=o,a!=e.action.init||!l.state||o&&o.method&&o.method==`fit`?(l.viewBox=i,l.vbIsInitializedFromState=!1):(l.viewBox=l.state.vb,l.vbIsInitializedFromState=!0,Array.isArray(l.state.roots)&&(l.config.roots=l.state.roots));var d=l.maxX,f=l.maxY,p=l.minX,m=l.minY,h=l.bordersByRootIdAndLevel,g=l.roots,_=l.nodes;if(!t)_?l.oldNodes=_:l.oldNodes=null,l._read(function(t){d=t.maxX,f=t.maxY,p=t.minX,m=t.minY,h=t.bordersByRootIdAndLevel,g=t.roots,_=t.nodes;var i=e.manager._getResponse(n,r,l.visibleNodeIds,l.config,d,f,p,m,l.viewBox,g,l.action,l.actionParams,_,l.oldNodes,l.vbIsInitializedFromState);i.notif=t.limit,i.roots=g,i.bordersByRootIdAndLevel=h,i.adjustify=t.adjustify,a!=e.action.exporting&&(l.maxX=d,l.maxY=f,l.minX=p,l.minY=m,l.roots=g,l.nodes=_,l.visibleNodeIds=i.visibleNodeIds,l.bordersByRootIdAndLevel=h,l.rootList=t.rootList),s(i)},c);else{var v=e.manager._getResponse(n,r,l.visibleNodeIds,l.config,d,f,p,m,l.viewBox,g,l.action,l.actionParams,_,l.oldNodes,l.vbIsInitializedFromState);a!=e.action.exporting&&(l.maxX=d,l.maxY=f,l.minX=p,l.minY=m,l.roots=g,l.nodes=_,l.visibleNodeIds=v.visibleNodeIds),v.bordersByRootIdAndLevel=h,v.roots=g,v.adjustify={x:0,y:0},l.state&&(v.adjustify=l.state.adjustify),s(v)}})},e.manager.prototype._read=function(t,n){var r=this,i=e.manager._createNodes(this.instance);n(i);var a=i.nodes,o=i.roots,s=e.remote;s??=e.local,s._setPositions(o,r.layoutConfigs,function(n){var s=e.manager._doNotChangePositionOfClickedNodeIfAny(o,a,r.action,r.actionParams,r.oldNodes,r.config.orientation);r.state&&r.action==e.action.init&&(s=r.state.adjustify),r.action==e.action.exporting?s=r._fixAdjustForExport:r._fixAdjustForExport=s;for(var c={minX:null,minY:null,maxX:null,maxY:null},l={},u=[],d=0;d<o.length;d++)e.manager._setMinMaxXYAdjustifyIterate(o[d],o[d],c,0,l,s,r.config.orientation,u);for(var d=0;d<o.length;d++)e.manager._setChildCountPropsIterate(o[d],a);for(var f in u)for(var p in u[f]){var m=l[f][p],h=u[f][p];m.minX==null&&m.minY==null&&m.maxX==null&&m.maxY==null&&e._setMinMaxXY(h,m,!0)}t({minX:c.minX,minY:c.minY,maxX:c.maxX,maxY:c.maxY,bordersByRootIdAndLevel:l,nodes:a,roots:o,rootList:i.rootList,limit:n,adjustify:s})},a)},e===void 0&&(e={}),e.manager._initDinamicNode=function(t,n,r){n&&(t.lcn=n),r&&(t.isAssistant=!0);var i=e.t(t.templateName);t.w=i&&i.size?i.size[0]:0,t.h=i&&i.size?i.size[1]:0,t.isSplit=t.templateName==`split`,t.isMirror=t.templateName==`mirror`,t.isSubLevel=t.templateName==`subLevel`},e.manager._setCollpasedProperty=function(t,n,r,i,a,o,s,c){if(t.collapsed==null&&n.collapse&&n.collapse.allChildren?t.collapsed=!0:t.collapsed??=!1,a==e.action.expand&&r.ids.indexOf(t.id)!=-1&&(t.collapsed=!1),a==e.action.collapse&&(r.expandIds||r.collapseIds)?r.expandIds&&r.expandIds.indexOf(t.id)!=-1?t.collapsed=!1:r.collapseIds&&r.collapseIds.indexOf(t.id)!=-1&&(t.collapsed=!0):a==e.action.collapse&&r.ids.indexOf(t.id)!=-1&&(t.collapsed=!0),a==e.action.expand&&r.ids==`all`&&(t.collapsed=!1),a==e.action.exporting&&(!e.isNEU(r.parentLevels)||!e.isNEU(r.childLevels))&&r.id!=null){if(r.id!=null&&(!e.isNEU(r.parentLevels)||!e.isNEU(r.childLevels))){var l=c[r.id];if(l==t)t.collapsed=!1;else{for(var u=!1,d=-1,f=!1,p=-1;l;){if(d++,l==t){u=!0;break}l=c[l.pid]}l=c[r.id];for(var m=c[t.id];m;){if(p++,m==l){f=!0;break}m=c[m.pid]}r.parentLevels!=null&&u&&d<=r.parentLevels||r.childLevels!=null&&f&&p<=r.childLevels||f&&r.expandChildren?t.collapsed=!1:t.collapsed=!0}}}else a==e.action.exporting&&r.expandChildren&&(t.collapsed=!1);a==e.action.init&&s!=null?t.collapsed=!s.exp.has(t.id):a==e.action.init?t.tags.indexOf(`left-partner`)!=-1||t.tags.indexOf(`right-partner`)!=-1||t.tags.indexOf(`partner`)!=-1||t.parentPartner?t.collapsed=n.collapse&&o>=n.collapse.level&&i.indexOf(t.id)==-1:t.collapsed=n.collapse&&o>=n.collapse.level-1&&i.indexOf(t.id)==-1:a==e.action.centerNode||a==e.action.insert||a==e.action.expand||a==e.action.collapse?i.has(t.id)&&(t.collapsed=!1):a==e.action.update&&r&&r.changeRoots&&r.changeRoots.has(t.id)&&(t.collapsed=!1)},e.manager._initNode=function(t,n,r,i,a,o,s){var c=s.manager.config,l=s.manager.layoutConfigs,u=s.manager.action,d=s.manager.actionParams,f=s.manager.state,p=l[r||`base`];t.parent??e.manager._setCollpasedProperty(t,p,d,a,u,i-1,f,n);for(var m=0;m<t.childrenIds.length;m++){var h=n[t.childrenIds[m]];if(e.manager._setCollpasedProperty(h,p,d,a,u,i,f,n),h.collapsed)t.collapsedChildCount++;else{if(h.parent=t,h.ppid!=null){var g=n[h.ppid];g&&(h.parentPartner=g)}(h.tags.indexOf(`left-partner`)!=-1||h.tags.indexOf(`right-partner`)!=-1||h.tags.indexOf(`partner`)!=-1||h.parentPartner)&&o.indexOf(t.id)==-1&&o.push(t.id),t.children.push(h)}}if(u==e.action.minimize&&!t.min?(d.all||d.id==t.id)&&(t.min=!0):u==e.action.maximize&&t.min===!0?(d.all||d.id==t.id)&&(t.min=!1):u==e.action.exporting&&d.min===!1?t.min=!1:u==e.action.init&&f!=null&&(t.min=f.min.has(t.id)),!t.min&&(!t.tags||!t.tags.has(`filter`)))for(var m=0;m<t.stChildrenIds.length;m++){var h=n[t.stChildrenIds[m]];h.stParent=t,t.stChildren.push(h)}i!=null&&(t.level=i),r&&(t.lcn=r);var _=e._getSubLevels(t.tags,c.tags);_>0&&(t.subLevels=_),t.tags.indexOf(`assistant`)!=-1&&t.parent!=null&&(t.isAssistant=!0),p.layout==e.layout.treeList&&(t.isTreeListItem=!0),p.template&&c.template==t.templateName&&(t.templateName=p.template);var v=e.t(t.templateName,t.min);if(t.w=v&&v.size?v.size[0]:0,t.h=v&&v.size?v.size[1]:0,t.padding=v&&v.padding?v.padding:[0,0,0,0],t.isTreeListItem&&t.stParent&&t.stParent.treeList==null){var y=e.t(t.stParent.templateName,t.stParent.min);t.stParent.treeList={pinnedIds:[],scrollTop:0,scrollTopMax:0,maxHeight:y.treeListMaxHeight}}var b={node:t};e.events.publish(`node-initialized`,[s,b])},e.manager._iterate=function(t,n,r,i,a,o,s,c,l,u,d,f){var p=f.manager.layoutConfigs;if(e.manager._initNode(n,r,l,i,u,d,f),n.isAssistant&&(o[n.pid]||(o[n.pid]=[]),o[n.pid].push(n.id)),n.subLevels>0&&s.push(n.id),e.MIXED_LAYOUT_FOR_NODES_WITH_COLLAPSED_CHILDREN&&!n.isAssistant&&n.parent){if(n.parent&&n.parent.children.length&&n.parent.children[n.parent.children.length-1]==n){for(var m=[],h=0,g=0,_=0;_<n.parent.children.length;_++){var v=n.parent.children[_];v.tags.indexOf(`partner`)==-1&&v.tags.indexOf(`left-partner`)==-1&&v.tags.indexOf(`right-partner`)==-1&&v.tags.indexOf(`assistant`)==-1&&v.children.length==0?m.push(v.id):v.tags.indexOf(`assistant`)==-1?(v.tags.indexOf(`partner`)!=-1||v.tags.indexOf(`left-partner`)!=-1||v.tags.indexOf(`right-partner`)!=-1)&&g++:h++}(e.MIXED_LAYOUT_ALL_NODES&&m.length>1&&m.length==n.parent.children.length-h-g||!e.MIXED_LAYOUT_ALL_NODES&&m.length>1)&&(c[n.pid]=m)}}else if(!n.isAssistant&&n.childrenIds.length==0&&n.parent&&!c[n.pid]){for(var m=[],h=0,g=0,_=0;_<n.parent.children.length;_++){var v=n.parent.children[_];v.tags.indexOf(`partner`)==-1&&v.tags.indexOf(`left-partner`)==-1&&v.tags.indexOf(`right-partner`)==-1&&v.tags.indexOf(`assistant`)==-1&&v.childrenIds.length==0?m.push(v.id):v.tags.indexOf(`assistant`)==-1?(v.tags.indexOf(`partner`)!=-1||v.tags.indexOf(`left-partner`)!=-1||v.tags.indexOf(`right-partner`)!=-1)&&g++:h++}(e.MIXED_LAYOUT_ALL_NODES&&m.length>e.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN&&m.length==n.parent.childrenIds.length-h-g||!e.MIXED_LAYOUT_ALL_NODES&&m.length>e.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN)&&(c[n.pid]=m)}n.stChildren.length&&(t.stContainerNodes||=[],t.stContainerNodes.push(n));for(var y=0;y<n.stChildren.length;y++){for(var b=``,_=0;_<n.tags.length;_++)if(p[n.tags[_]]){b=n.tags[_];break}a.push(n.stChildren[y].id),e.manager._iterate(t,n.stChildren[y],r,0,a,o,s,c,b,u,d,f)}i++;for(var y=0;y<n.children.length;y++)n.isTreeListItem&&(n.children[y].isTreeListItem=n.isTreeListItem),e.manager._iterate(t,n.children[y],r,i,a,o,s,c,l,u,d,f)},e.manager.__createNodes=function(t,n,r,i,a,o,s,c){for(var l=[],u=e._addDottedLines(r),d=0;d<u.length;d++){var f=u[d],p=e.STRING_TAGS?f.tags?f.tags.split(`,`):[]:Array.isArray(f.tags)?f.tags.slice(0):[];c.filterUI.addFilterTag(f)&&p.unshift(`filter`);var m=c.searchUI.addMatchTag(f.id);m===!0?p.unshift(`match`):m===!1&&p.unshift(`no-match`);var h=e._getTemplate(p,r.tags,r.template);f&&f.template&&(h=f.template);var g=new e.node(f.id,f.pid,p,h);e.isNEU(f.ppid)||(g.ppid=f.ppid),e.isNEU(f.stpid)||(g.stpid=f.stpid),f.movex!=null&&(g.movex=f.movex),f.movey!=null&&(g.movey=f.movey),t[f.id]=g,l.push(f.id)}if(r.orderBy!=null){var _=e.manager._getOrderSortArray(r.orderBy);l.sort(function(e,t){var n,r;for(var i of u)if(i.id==e&&(n=i),i.id==t&&(r=i),n&&r)break;for(var a=0;a<_.length;a++){var o=n[_[a].field],s=r[_[a].field],c=o,l=s;if(c??=``,l??=``,typeof c==`string`&&typeof l==`string`){var d=c.localeCompare(l);if(_[a].desc&&(d*=-1),d!==0)return d}else{var d=o<s?-1:o>s?1:0;if(_[a].desc&&(d*=-1),d!==0)return d}}})}for(var d=0;d<l.length;d++){var v=l[d],g=t[v],y=o?o[v]:null,b=t[g.stpid],x=t[g.pid];if(b||(g.stpid=null),x||(g.pid=null),b){var S=o?o[b.id]:null;S&&(b.min=S.min),b.stChildrenIds.push(g.id)}else x?(y&&(g.collapsed=y.collapsed,g.min=y.min,g.treeList=y.treeList),x.childrenIds.push(g.id)):(y&&(g.collapsed=y.collapsed,g.min=y.min,g.treeList=y.treeList),n.push(g),s.push(g.id));i==e.action.init&&(g.min=e._getMin(g,r))}},e.manager._createNodes=function(t){var n=t.manager.config,r=t.manager.layoutConfigs,i=t.manager.action,a=t.manager.actionParams,o=t.manager.oldNodes,s=t.manager.state,c={},l=[],u=[];if(e.manager.__createNodes(c,l,n,i,a,o,u,t),n.roots!=null){l=[];for(var d=0;d<n.roots.length;d++){var f=c[n.roots[d]];if(f&&i==e.action.centerNode){for(var p=f;p.pid!=null||p.stpid!=null;)p=p.pid==null&&p.stpid!=null?c[p.stpid]:c[p.pid];for(var m=c[a.id];(m.pid!=null||m.stpid!=null)&&m!=f;)m=m.pid==null&&m.stpid!=null?c[m.stpid]:c[m.pid];p==m&&(f=p)}if(f){for(var h=!1,g=0;g<l.length;g++)if(l[g].id==f.id){h=!0;break}if(!h){if(!e.isNEU(f.pid)){var _=c[f.pid],v=_.childrenIds.indexOf(f.id);v>-1&&_.childrenIds.splice(v,1)}l.push(f)}}}n.roots=[];for(var d=0;d<l.length;d++)n.roots.push(l[d].id)}if(i==e.action.exporting&&a.id!=null)if(a.parentLevels){for(var _=c[a.id],y=0;y<a.parentLevels&&c[_.pid];)y++,_=c[_.pid];_.pid=null,l=[_]}else{var b=c[a.id];b&&(b.pid=null,l=[b])}var x=[];if(i==e.action.init&&n.expand&&n.expand.nodes&&s==null)for(var d=0;d<n.expand.nodes.length;d++){var b=c[n.expand.nodes[d]];for(n.expand.allChildren===!0&&e.manager._addExpandedNodeIdsIterate(b,c,x);b;)x.push(b.id),b.pid==null&&b.stpid!=null?(b=c[b.stpid],b.min=!1):b=c[b.pid]}else if(i==e.action.expand&&a.ids&&a.ids!=`all`||i==e.action.collapse&&a&&a.expandIds)for(var S=i==e.action.expand?a.ids:a.expandIds,d=0;d<S.length;d++)for(var b=c[S[d]],_=c[b.pid];_;)x.push(_.id),_.pid==null&&_.stpid!=null?(_=c[_.stpid],_.min=!1):_=c[_.pid];else if(i==e.action.centerNode){for(var C=e._getCenterNodeFromParams(c,a);C;){if(x.push(C.id),a.options.parentState===e.COLLAPSE_PARENT_NEIGHBORS&&C)for(var d=0;d<C.childrenIds.length;d++){var w=c[C.childrenIds[d]];w.collapsed=!0}if(C.pid==null&&C.stpid!=null){if(C=c[C.stpid],C.min=!1,C.tags){var v=C.tags.indexOf(`filter`);v!=-1&&(C.tags.splice(v,1),t.filterUI._removeFilter(C.id))}}else C=c[C.pid]}if(C=e._getCenterNodeFromParams(c,a),a.options.childrenState===e.COLLAPSE_SUB_CHILDRENS)for(var d=0;d<C.childrenIds.length;d++){var T=c[C.childrenIds[d]];T.collapsed=!1;for(var E=0;E<T.childrenIds.length;E++){var D=c[T.childrenIds[E]];D.collapsed=!0}}if(a.options.parentState===e.COLLAPSE_PARENT_SUB_CHILDREN_EXCEPT_CLICKED){var _=c[C.pid];if(_)for(var d=0;d<_.childrenIds.length;d++){var T=c[_.childrenIds[d]];if(T!=C){T.collapsed=!1;for(var E=0;E<T.childrenIds.length;E++){var D=c[T.childrenIds[E]];D.collapsed=!0}}}}}else if(i==e.action.insert)for(var b=c[a.insertedNodeId];b;)x.push(b.id),b.pid==null&&b.stpid!=null?(b=c[b.stpid],b.min=!1):b=c[b.pid];for(var O=[],k={},A=[],j={},M=[],d=0;d<l.length;d++)e.manager._iterate(l[d],l[d],c,0,O,k,A,j,``,x,M,t);if(i==e.action.collapse&&a&&Array.isArray(a.expandIds)&&Array.isArray(a.collapseIds))for(var d=0;d<a.ids.length;d++)if(a.expandIds.has(a.collapseIds[d]))console.error(`id ${a.collapseIds[d]} exist in both collapseIds and expandIds`);else{var b=c[a.collapseIds[d]];b&&(b.collapsed=!0)}for(var d=l.length-1;d>=0;d--)l[d].collapsed&&l.splice(d,1);for(var d=0;d<M.length;d++){for(var b=c[M[d]],N=[],P=[],F=[],I={},ee=0,L=0,te=0,ne=[],re=[],E=0;E<b.children.length;E++){var w=b.children[E];w.isAssistant?N.push(w.id):w.tags.indexOf(`right-partner`)==-1?w.tags.indexOf(`left-partner`)==-1?w.tags.indexOf(`partner`)!=-1&&!(ee%2)?(w.isPartner=1,w.children=[],P.push(w.id),ee++):w.tags.indexOf(`partner`)!=-1&&ee%2?(w.isPartner=2,w.children=[],F.push(w.id),ee++):w.parentPartner?(I[w.parentPartner.id]||(I[w.parentPartner.id]=[]),I[w.parentPartner.id].push(w.id)):N.push(w.id):(w.isPartner=2,w.children=[],F.push(w.id)):(w.isPartner=1,w.children=[],P.push(w.id))}b.children=[];for(var ie=[],E=0;E<P.length;E++){var w=c[P[E]];I[w.id]?b.children.push(w):b.children.splice(0,0,w);for(var R=0;R<w.childrenIds.length;R++)ie.push(w.childrenIds[R])}for(var z=[],E=0;E<F.length;E++){var w=c[F[E]];I[w.id]?b.children.push(w):b.children.splice(0,0,w);for(var R=0;R<w.childrenIds.length;R++)z.push(w.childrenIds[R])}for(var E=0;E<z.length;E++){var w=c[z[E]];w.collapsed||(w.parentPartner=w.parent,w.parent=b,w.isChildOfPartner=!0,b.children.push(w))}for(var E=F.length-1;E>=0;E--)if(I[F[E]])for(var g=0;g<I[F[E]].length;g++)b.children.push(c[I[F[E]][g]]),L++,re.indexOf(F[E])==-1&&re.push(F[E]);for(var E=0;E<N.length;E++){var w=c[N[E]];b.children.push(w)}for(var E=0;E<P.length;E++)if(I[P[E]])for(var g=0;g<I[P[E]].length;g++)b.children.push(c[I[P[E]][g]]),te++,ne.indexOf(P[E])==-1&&ne.push(P[E]);for(var E=0;E<ie.length;E++){var w=c[ie[E]];w.collapsed||(w.parentPartner=w.parent,w.parent=b,w.isChildOfPartner=!0,b.children.push(w))}b.partnerSeparation=Math.max(re.length,ne.length)*n.partnerChildrenSplitSeparation+n.minPartnerSeparation,!N.length&&L&&!te?b.hasPartners=2:!N.length&&!L&&te?b.hasPartners=3:!N.length&&L==1&&te==1?b.hasPartners=4:!N.length&&!L&&!te?b.hasPartners=5:N.length&&!L&&!te?b.hasPartners=6:N.length&&(L||te)?b.hasPartners=7:b.hasPartners=1}for(var d=0;d<A.length;d++)for(var b=c[A[d]],ae=b.lcn?b.lcn:`base`,oe=r[ae],E=0;E<b.subLevels;E++){var B=new e.node(b.id+`_sub_level_index_`+E,b.pid,[],`subLevel`);e.manager._initDinamicNode(B,b.lcn);var _=b.parent;if(_){b.movex!=null&&(B.movex=b.movex),b.movey!=null&&(B.movey=b.movey);var v=_.children.indexOf(b);v>-1&&(_.children.splice(v,1),_.children.splice(v,0,B)),B.children.push(b),B.parent=_,b.parent=B,c[B.id]=B}}for(var V in k){var _=c[V];_.hasAssistants=!0;var B=new e.node(_.id+`_split_assitant_0`,_.id,[`assistant`],`split`);_.movex!=null&&(B.movex=_.movex),_.movey!=null&&(B.movey=_.movey),e.manager._initDinamicNode(B,_.lcn,!0),c[B.id]=B;for(var H=[],E=_.children.length-1;E>=0;E--){var w=_.children[E];w.isAssistant?(w.parent=null,_.children.splice(E,1),H.splice(0,0,w.id)):w.isPartner||(w.parent&&j[w.parent.id]&&B&&w.parent.id!=B.id&&(Object.defineProperty(j,B.id,Object.getOwnPropertyDescriptor(j,w.parent.id)),delete j[w.parent.id]),w.parent=B,B.children.unshift(w),_.children.splice(E,1))}if(H.length%2){var U=c[H[H.length-1]],se=new e.node(U.id+`_mirror`,_.pid,[],`mirror`);e.manager._initDinamicNode(se,U.lcn,!0),se.isAssistant=!0,se.w=U.w,se.h=U.h,c[se.id]=se,H.splice(H.length-1,0,se.id)}for(var ce=1,E=H.length-1;E>=0;E--)if(E%2&&E!=H.length-1){var W=new e.node(_.id+`_split_assitant_`+ce,_.pid,[],`split`);e.manager._initDinamicNode(W,_.lcn,!0),_.movex!=null&&(W.movex=_.movex),_.movey!=null&&(W.movey=_.movey),c[W.id]=W,H.splice(E,0,W.id),ce++}else E%2&&H.splice(E,0,B.id);for(var E=0;E<H.length;E+=3){var G=null;G=E==0?_:c[H[E-2]];var le=c[H[E]],K=c[H[E+1]],q=c[H[E+2]];le.parent=G,K.parent=G,q.parent=G,G.children.push(le),G.children.push(K),G.children.push(q)}}var ue=!1;for(var J in r){var oe=r[J];if(oe.layout!=0){ue=!0;break}}var de=e.events.has(`node-layout`,t._event_id);if(ue||de){var Y={nodes:c,config:n,action:i,actionParams:a};if(A.length){var fe=!1;for(var V in j){for(var S=j[V],d=0;d<S.length;d++){var b=c[S[d]];if(b.subLevels){fe=!0;break}}if(fe)break}if(fe){var X={},pe={},me={};for(var V in j)for(var S=j[V],he=!1,ge=null,d=0;d<S.length;d++){var _e=S[d];(ge===null||A.has(_e))&&(ge=c[_e].parent.id,!he&&!e.isNEU(c[_e].subLevels)&&(he=c[_e].subLevels>0)),X[ge]||(X[ge]=[]),X[ge].push(_e),he&&(me[ge]=V,pe[ge]||(pe[ge]=[]),pe[ge].push(_e))}for(var V in j={},pe)if(pe[V].length>e.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN)for(var ve=me[V],d=c[ve].children.length-1;d>=0;d--){var w=c[ve].children[d];pe[V].has(w.id)&&c[ve].children.splice(d,1)}for(var V in X)X[V].length>e.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN&&(j[V]=X[V])}}for(var V in j){for(var _=c[V],Z=_;Z.isSplit;)Z=c[Z.pid];for(;Z.isSubLevel;)Z=c[Z.pid];var ae=_.lcn?_.lcn:`base`,oe=r[ae];if(oe.layout!=0||de){Y.pnode=_,Y.layout=oe.layout,Y.layoutGridColumns=n.layoutGridColumns,Y.childrenIds=j[V],Y.lastChildrenPidIds=j,Y.subLevels=0,Y.layouts=[],e.events.publish(`node-layout`,[t,Y]),e.events.publish(`layout`,[Y]),Y.layouts.length||Y.layouts.push({layout:Y.layout,childrenIds:Y.childrenIds,subLevels:Y.subLevels,layoutGridColumns:Y.layoutGridColumns});for(var ye=0;ye<Y.layouts.length;ye++){var Q=Y.layouts[ye];for(e.isNEU(Q.subLevels)&&(Q.subLevels=0),e.isNEU(Q.layout)&&(Q.layout=oe.layout),_=c[V],Z=_;Z.isSplit;)Z=c[Z.pid];for(;Z.isSubLevel;)Z=c[Z.pid];for(var be=_,E=0;E<Q.subLevels;E++){var B=new e.node(ye+`_sublevel_layout_`+E,be.id,[],`subLevel`);e.manager._initDinamicNode(B,be.lcn),B.parent=be,be.children.push(B),c[B.id]=B,be=B}if(Q.subLevels){for(var E=0;E<Q.childrenIds.length;E++){var w=c[Q.childrenIds[E]],v=_.children.indexOf(w);v!=-1&&_.children.splice(v,1),w.parent=be,be.children.push(w)}_=be}if(Q.layout==e.layout.grid&&Q.childrenIds.length>2){Q.layoutGridColumns==`dynamic`&&(Q.layoutGridColumns=e._getDynamicGridCoulumns(Q.childrenIds.length));for(var xe=_.id,d=_.children.length-1;d>=0;d--)for(var E=0;E<Q.childrenIds.length;E++){var _e=Q.childrenIds[E];if(_.children[d].id==_e){_.children.splice(d,1);break}}var Se=Q.layoutGridColumns;Se%2!=0&&Se>2&&Se--;for(var d=0;d<Q.childrenIds.length;d+=Se)for(var Ce=null,E=0;E<Se;E++){var we=d+Se>=Q.childrenIds.length;if(Q.childrenIds.length-1<d+E)break;var _e=Q.childrenIds[d+E],w=c[_e];w.parent=c[xe],c[xe].children.push(w),we||(Se/2-1==E&&(Ce=new e.node(Q.childrenIds[d+E-1]+`_grid_pseudo_node_`+Q.childrenIds[d+E+1],xe,[],`subLevel`),e.manager._initDinamicNode(Ce,_.lcn),Ce.parent=c[xe],c[xe].children.push(Ce),c[Ce.id]=Ce),Se-1==E&&(xe=Ce.id))}}if(Q.layout==e.layout.mixed)for(var Te=Q.childrenIds,d=Te.length-1;d>=0;d--){var w=c[Te[d]];_=w.parent,w.layout=e.layout.mixed;for(var E=_.children.length-1;E>=0;E--)if(w.id==_.children[E].id){_.children.splice(E,1);break}if(d>0){var Ee=c[Te[d-1]];w.parent=Ee,w.layout=e.layout.mixed,Ee.children.push(w)}else _.children.push(w)}else if(Q.layout>1){var B=new e.node(ye+`_`+_.id+`_split_0`,Z.id,[],`split`);_.movex!=null&&(B.movex=_.movex),_.movey!=null&&(B.movey=_.movey),e.manager._initDinamicNode(B,_.lcn),c[B.id]=B,B.layout=Q.layout;for(var $=[],d=Q.childrenIds.length-1;d>=0;d--){for(var w=c[Q.childrenIds[d]],E=0;E<_.children.length;E++)_.children[E].id==w.id&&_.children.splice(E,1);if(w.parent=null,w.layout=Q.layout,(Q.layout==e.layout.treeRightOffset||Q.layout==e.layout.treeRight)&&$.splice(0,0,w.id),Q.layout>2){var De=new e.node(ye+`_`+w.id+`_mirror`,Z.id,[],`mirror`);e.manager._initDinamicNode(De,w.lcn),De.layout=Q.layout,c[De.id]=De,$.splice(0,0,De.id)}Q.layout!=e.layout.treeRightOffset&&Q.layout!=e.layout.treeRight&&$.splice(0,0,w.id)}for(var ce=1,E=$.length-1;E>=0;E--)if(E%2&&E!=$.length-1){var W=new e.node(ye+`_`+_.id+`_split_`+ce,Z.id,[],`split`);e.manager._initDinamicNode(W,_.lcn),_.movex!=null&&(W.movex=_.movex),_.movey!=null&&(W.movey=_.movey),W.layout=Q.layout,c[W.id]=W,$.splice(E,0,W.id),ce++}else E%2&&$.splice(E,0,B.id);for(var E=0;E<$.length;E+=3){var G=null;E==0&&(G=_);var le=c[$[E]],K=c[$[E+1]],q=c[$[E+2]];E!=0&&(G=c[$[E-3]]),E!=0&&!K&&(G=c[$[E-2]]),le.parent=G,G.children.push(le),K&&(E!=0&&(G=c[$[E-2]]),K.parent=G,G.children.push(K)),q&&(E!=0&&(G=c[$[E-1]]),q.parent=G,G.children.push(q))}}}}}}if(e.VERTICAL_CHILDREN_ASSISTANT)for(var d=0;d<l.length;d++)e.manager._verticalAssistantIterate(l[d],c);var Y={nodes:c,roots:l};return e.events.publish(`nodes-initialized`,[t,Y]),{nodes:Y.nodes,roots:Y.roots,rootList:u}},e.manager._getOrderSortArray=function(e){if(typeof e==`string`)return[{field:e,desc:!1}];if(Array.isArray(e)){var t=[];for(var n of e)typeof n==`string`?t.push({field:n,desc:!1}):e instanceof Object?t.push(n):console.error(`Unseported orderBy value!`);return t}else if(e instanceof Object)return[e];else console.error(`Unseported orderBy value!`)},e.manager._getNodeWidth=function(t,n){switch(n.orientation){case e.orientation.top:case e.orientation.top_left:case e.orientation.bottom:case e.orientation.bottom_left:return t.w;case e.orientation.right:case e.orientation.right_top:case e.orientation.left:case e.orientation.left_top:return t.h}return 0},e.manager._isVisible=function(t,n,r,i,a,o,s){var c=0;if(e.LAZY_LOADING_FACTOR==`auto`){var l=o/a*2,u=s/a*2;c=Math.ceil(l>u?l:u)}else c=e.LAZY_LOADING_FACTOR/a;if(!(t.x==null||t.y==null)){if(e._getLazyLoading(n)&&i!==e.action.exporting){function e(e,t){var n=e.x,r=e.y,i=e.w,a=e.h,o=t[0]-c,s=t[2]+c+t[0],l=t[1]-c,u=t[3]+c+t[1],d=n+i>o&&s>n;return d&&=r+a>l&&u>r,d}if(e(t,r))return!0;for(var d=0;d<t.children.length;d++)if(e(t.children[d],r))return!0;return!1}return!0}},e.manager.getAllFields=function(t){var n=[e.TAGS];for(var r in t.nodeBinding)n.push(t.nodeBinding[r]);for(var r=0;r<t.nodes.length;r++)for(var i in t.nodes[r])i!==e.ID&&i!==e.TAGS&&i!==e.NODES&&i!==e.PID&&i!==e.STPID&&i!==`movex`&&i!==`movey`&&(t.nodeBinding[i]||n.has(i)||n.push(i));return n},e.manager._getMostDeepChild=function(e){if(!e)return;var t=e;function n(e){e.sl>t.sl&&(t=e);for(var r=0;r<e.children.length;r++)n(e.children[r])}return n(e),t},e.manager._getResponse=function(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){var g=u[0],_=[],v={top:null,left:null,bottom:null,right:null,minX:null,maxX:null,minY:null,maxY:null},y=[[],[],[]],b=a-s+i.padding*2,x=o-c+i.padding*2,S=e.getScale(l,t,n,i.scaleInitial,i.scaleMax,i.scaleMin,b,x);if(v.top=c-i.padding,v.left=s-i.padding,v.bottom=o+i.padding-n/S,v.right=a+i.padding-t/S,v.maxX=a,v.minX=s,v.maxY=o,v.minY=c,u.length==0||l==null&&!h&&i.align==e.CENTER){var C=Math.ceil(t/S),w=Math.ceil(n/S),T=0,E=0;if(C-i.padding*2>=a-s)switch(T=(a+s)/2-C/2,i.orientation){case e.orientation.right:case e.orientation.right_top:T=(s-a)/2-C/2;break}else switch(T=g.x-C/2+e.manager._getNodeWidth(g,i)/2,i.orientation){case e.orientation.right:case e.orientation.right_top:T=-(C/2-(s-a)/2),T<i.padding-C&&(T=i.padding-C);break;case e.orientation.left:case e.orientation.bottom_left:case e.orientation.top_left:case e.orientation.left_top:T=-(C/2-(a-s)/2),T>-i.padding&&(T=-i.padding);break}if(w-i.padding*2>=o-c)switch(E=(o+c)/2-w/2,i.orientation){case e.orientation.bottom:case e.orientation.bottom_left:E=(c-o)/2-w/2;break}else switch(E=-(w/2-(o-c)/2),E>-i.padding&&(E=-i.padding),i.orientation){case e.orientation.bottom:case e.orientation.bottom_left:E=-(w/2-(c-o)/2),E<i.padding-w&&(E=i.padding-w);break;case e.orientation.left:case e.orientation.right:E=g.y-w/2+e.manager._getNodeWidth(g,i)/2;break}l=[T,E,C,w]}else if(l==null&&!h&&i.align==e.ORIENTATION){var C=Math.ceil(t/S),w=Math.ceil(n/S),T=0,E=0;switch(i.orientation){case e.orientation.top:T=g.x-C/2+e.manager._getNodeWidth(g,i)/2,E=-i.padding;break;case e.orientation.bottom:T=g.x-C/2+e.manager._getNodeWidth(g,i)/2,E=i.padding-w;break;case e.orientation.left:T=-i.padding,E=g.y-w/2+e.manager._getNodeWidth(g,i)/2;break;case e.orientation.right:T=i.padding-C,E=g.y-w/2+e.manager._getNodeWidth(g,i)/2;break;case e.orientation.top_left:T=-i.padding,E=-i.padding;break;case e.orientation.right_top:T=i.padding-C,E=-i.padding;break;case e.orientation.left_top:T=-i.padding,E=-i.padding;break;case e.orientation.bottom_left:T=-i.padding,E=i.padding-w;break}l=[T,E,C,w]}if(d==e.action.centerNode||d==e.action.maximize){var D=e._getCenterNodeFromParams(p,f);f.options.horizontal==1&&(l[0]=D.x+D.w/2-l[2]/2),f.options.vertical==1&&(l[1]=D.y+D.h/2-l[3]/2)}if(d==e.action.insert||d==e.action.expand||d==e.action.collapse||d==e.action.update||d==e.action.centerNode){var O=null;if(d==e.action.insert&&f&&f.insertedNodeId!=null&&f.insertedNodeId!=null)O=p[f.insertedNodeId];else if(d==e.action.update&&f&&f.visId!=null&&f.visId!=null)O=p[f.visId];else if((d==e.action.expand||d==e.action.collapse)&&f&&f.id!=null&&f.id!=null)O=p[f.id],O=e.manager._getMostDeepChild(O);else if(d==e.action.centerNode){switch(i.orientation){case e.orientation.top:case e.orientation.top_left:case e.orientation.bottom:case e.orientation.bottom_left:f.options.vertical||(O=p[f.id]);break;case e.orientation.right:case e.orientation.right_top:case e.orientation.left:case e.orientation.left_top:f.options.horizontal||(O=p[f.id]);break}O&&=e.manager._getMostDeepChild(O)}if(!e.FIXED_POSITION_ON_CLICK&&O){if(O.isTreeListItem){for(;!O.stParent;)O=O.parent;O=O.stParent}switch(i.orientation){case e.orientation.top:case e.orientation.top_left:var k=O.y+O.h-l[3]+i.padding;l[1]<k&&(l[1]=k);break;case e.orientation.bottom:case e.orientation.bottom_left:var k=O.y-i.padding;l[1]>k&&(l[1]=k);break;case e.orientation.right:case e.orientation.right_top:var k=O.x-i.padding;l[0]>k&&(l[0]=k);break;case e.orientation.left:case e.orientation.left_top:var k=O.x+O.w-l[2]+i.padding;l[0]<k&&(l[0]=k);break}}}for(var A=0;A<u.length;A++)e.manager._iterate2(u[A],p,i,l,d,f,_,m,r,y,S,t,n);return{animations:y,boundary:v,viewBox:l,visibleNodeIds:_,nodes:p,allFields:e.manager.getAllFields(i)}},e.manager._iterate2=function(t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.manager._isVisible(t,r,i,a,d,f,p)){s.push(t.id);var m=null;if((a==e.action.expand||a==e.action.collapse||a==e.action.maximize)&&c&&c[t.id]&&o.method==`expandCollapseToLevel`){var h=c[t.id];if(m={x:h.x,y:h.y},h){m={x:h.x,y:h.y};for(var g=t,_=null;g!=null;)c[g.id]&&c[g.id].collapsed&&(_=g),g=g.parent;_&&_.parent&&(m={x:_.parent.x,y:_.parent.y})}var v=n[o.id];if(v){for(var g=t.parent;g!=null;)g=g.parent;g&&(m={x:v.x+v.w/2-t.w/2,y:v.y+v.h/2-t.h/2})}}else if((a==e.action.expand||a==e.action.collapse)&&c&&c[t.id]){var h=c[t.id];if(m={x:h.x,y:h.y},o.ids==`all`&&h){m={x:h.x,y:h.y};for(var g=t,_=null;g!=null;)c[g.id]&&c[g.id].collapsed&&(_=g),g=g.parent;_&&_.parent&&(m={x:_.parent.x,y:_.parent.y})}var v=n[o.id];if(v){for(var g=t.parent;g!=null&&o.ids.indexOf(t.id)==-1&&o.ids.indexOf(g.id)==-1;)g=g.parent;g&&(m={x:v.x+v.w/2-t.w/2,y:v.y+v.h/2-t.h/2})}}else if(a==e.action.centerNode&&c&&c[t.id]){var h=c[t.id];h.x!=null&&h.y!=null&&(m={x:h.x,y:h.y});var y=e._getCenterNodeFromParams(n,o);if(y&&y==t){var g=t.parent;g&&g.id==o.id&&(m={x:y.x+y.w/2-t.w/2,y:y.y+y.h/2-t.h/2})}}else if(a==e.action.maximize&&c&&c[t.id]){var h=c[t.id];h.x!=null&&h.y!=null&&(m={x:h.x,y:h.y});var y=e._getCenterNodeFromParams(n,o);if(y&&y==t){var g=t.parent;g&&g.id==o.id&&(m={x:y.x+y.w/2-t.w/2,y:y.y+y.h/2-t.h/2})}}else if(a==e.action.minimize&&c&&c[t.id]){var h=c[t.id];m={x:h.x,y:h.y}}else if(a==e.action.insert&&o&&o.insertedNodeId==t.id&&t.parent)m={x:t.parent.x,y:t.parent.y};else if((a==e.action.update||a==e.action.insert)&&c){var h=c[t.id];if((!h||e.isNEU(h.x)&&e.isNEU(h.y))&&o){var v=n[o.id];if(v){for(var g=v;g&&g.id==t.id;)g=g.parent;g&&(m={x:v.x,y:v.y})}}else h&&(m={x:h.x,y:h.y})}else a!==e.action.exporting&&a!==e.action.init&&l.indexOf(t.id)==-1&&(u[0].push(t.id),u[1].push({opacity:0}),u[2].push({opacity:1}));m!=null&&m.x!=null&&m.y!=null&&(m.x!=t.x||m.y!=t.y)&&!(o&&o.dragNodeIdList&&o.dragNodeIdList.indexOf(t.id)!=-1)&&!t.isSplit&&(u[0].push(t.id),u[1].push({transform:[1,0,0,1,m.x,m.y]}),u[2].push({transform:[1,0,0,1,t.x,t.y]}))}for(var b=0;b<t.stChildren.length;b++)e.manager._iterate2(t.stChildren[b],n,r,i,a,o,s,c,l,u,d,f,p);for(var b=0;b<t.children.length;b++)e.manager._iterate2(t.children[b],n,r,i,a,o,s,c,l,u,d,f,p)},e.manager._addExpandedNodeIdsIterate=function(t,n,r){for(var i=0;i<t.childrenIds.length;i++)r.push(t.childrenIds[i]),e.manager._addExpandedNodeIdsIterate(n[t.childrenIds[i]],n,r)},e.manager._setChildCountPropsIterate=function(t,n){t.w===void 0&&(t.collapsedChildCount=t.childrenIds.length),t.deepChildCount=t.childCount=t.childrenIds.length,t.deepCollapsedChildCount=t.collapsedChildCount;for(var r=n[t.pid];r;)r.deepCollapsedChildCount+=t.collapsedChildCount,r.deepChildCount+=t.childCount,r=n[r.pid];for(var i of t.stChildrenIds)e.manager._setChildCountPropsIterate(n[i],n);for(var i of t.childrenIds)e.manager._setChildCountPropsIterate(n[i],n)},e.manager._setMinMaxXYAdjustifyIterate=function(t,n,r,i,a,o,s,c){t.x+=o.x,t.y+=o.y;for(var l of t.stChildren)e.manager._setMinMaxXYAdjustifyIterate(l,l,r,0,a,o,s,c);t.isPartner?t.sl=i-1:t.sl=i,a[n.id]??(a[n.id]={}),a[n.id][t.sl]??(a[n.id][t.sl]={minX:null,minY:null,maxX:null,maxY:null}),t.layout?(c[n.id]??(c[n.id]={}),c[n.id][t.sl]??(c[n.id][t.sl]=t)):e._setMinMaxXY(t,a[n.id][t.sl],!0),t.movex!=null&&(t.x+=t.movex),t.movey!=null&&(t.y+=t.movey),e._setMinMaxXY(t,r,!0),i++;for(var l of t.children)e.manager._setMinMaxXYAdjustifyIterate(l,n,r,i,a,o,s,c)},e.manager._doNotChangePositionOfClickedNodeIfAny=function(t,n,r,i,a,o){if(r!=e.action.expand&&r!=e.action.collapse&&r!=e.action.minimize&&r!=e.action.maximize&&r!=e.action.centerNode&&r!=e.action.update&&r!=e.action.insert)return{x:0,y:0};if(r==e.action.update&&(!i||i.id==null)){if(!t||!t.length)return{x:0,y:0};i={id:t[0].id}}if(i.id==null)return{x:0,y:0};var s=i.id;(r==e.action.minimize&&n[s].parent||r==e.action.maximize&&n[s].parent)&&(s=n[s].pid);var c=n[s],l=a[s];if(!l)return{x:0,y:0};var u=l.movex==null?0:l.movex,d=l.movey==null?0:l.movey,f={x:(l.x?l.x-u:0)-c.x,y:(l.y?l.y-d:0)-c.y};return c&&c.isTreeListItem?{x:0,y:0}:f},e.manager._verticalAssistantIterate=function(t,n){for(var r=0;r<t.stChildren.length;r++)e.manager._verticalAssistantIterate(t.stChildren[r],n);if(t.children.length==3)e.manager._verticalAssistantIterate(t.children[0],n),e.manager._verticalAssistantIterate(t.children[2],n),e.manager._verticalAssistantIterate(t.children[1],n);else for(var r=0;r<t.children.length;r++)e.manager._verticalAssistantIterate(t.children[r],n);if(t.isAssistant&&t.isSplit&&t.children.length){for(var i=t.parent.children[0],a=t.parent.children[2],o=t.parent;!o.hasAssistants;)o=o.parent;var s={max:0},c={max:0};e.manager._verticalAssistantLevelCountIterate(i,0,s),e.manager._verticalAssistantLevelCountIterate(a,0,c);for(var l=Math.max(s.max,c.max),u=[],r=0;r<l;r++){var d=new e.node(t.parent.id+`_split_assitant_level_`+r,t.pid,[],`subLevel`);e.manager._initDinamicNode(d,t.lcn,!0),o.movex!=null&&(d.movex=o.movex),o.movey!=null&&(d.movey=o.movey),r>0&&(u[r-1].children.push(d),d.parent=u[r-1]),n[d.id]=d,u.push(d)}if(u.length){for(var f=u[u.length-1],p=u[0],m=t.children.length-1;m>=0;m--){var h=t.children[m];f.children.unshift(h),h.parent=f,t.children.splice(m,1)}t.children.push(p),p.parent=t}}},e.manager._verticalAssistantLevelCountIterate=function(t,n,r){r.max<n&&(r.max=n),n++;for(var i=0;i<t.children.length;i++)e.manager._verticalAssistantLevelCountIterate(t.children[i],n,r)},e._addDottedLines=function(e){var t=e.nodes;if((e.groupDottedLines.length||e.dottedLines.length)&&(t=JSON.parse(JSON.stringify(t))),e.groupDottedLines.length)for(var n=[],r=0;r<e.groupDottedLines.length;r++){var i=e.groupDottedLines[r];i.rootId??=i.to;var a=`balkan_group_dotted_${i.rootId}`;if(!n.has(a)){for(var o=0;o<t.length;o++)if(t[o].id==i.rootId){var s=JSON.parse(JSON.stringify(t[o]));s.id=`balkan_group_dotted_${i.rootId}_balkan_id_${t[o].id}`,s.pid=void 0,s.stpid=t[o].id,t.push(s),n.push(a),t[o].tags||(t[o].tags=[]),t[o].tags.push(`group-dotted-lines`),t[o].tags.push(`group-dotted-lines-`+a);break}}for(var o=0;o<t.length;o++)if(t[o].id==i.from){var s=JSON.parse(JSON.stringify(t[o]));if(s.id=`balkan_group_dotted_${i.rootId}_balkan_id_${t[o].id}`,s.pid=`balkan_group_dotted_${i.rootId}_balkan_id_${i.to}`,s.tags){var c=s.tags.indexOf(`group-dotted-lines`);c!=-1&&s.tags.splice(c,1)}if(s.tags||=[],s.tags.push(`boc-dotted-connector`),i.tags)for(var l=0;l<i.tags.length;l++)s.tags.push(i.tags[l]);t.push(s);break}}if(e.dottedLines.length)for(var r=0;r<e.dottedLines.length;r++){var u=e.dottedLines[r];u.rootId??=u.to;for(var o=0;o<t.length;o++)if(t[o].id==u.from){var s=JSON.parse(JSON.stringify(t[o]));if(s.id=`balkan_dotted_${u.rootId}_balkan_id_${t[o].id}`,u.rootId==u.to?s.pid=u.to:s.pid=`balkan_dotted_${u.rootId}_balkan_id_${u.to}`,s.tags||=[],s.tags.push(`boc-dotted-connector`),u.tags)for(var l=0;l<u.tags.length;l++)s.tags.push(u.tags[l]);t.push(s);break}}return t},e===void 0&&(e={}),e.templates={},e.templates.base={defs:``,size:[250,120],expandCollapseSize:30,linkAdjuster:{fromX:0,fromY:0,toX:0,toY:0},ripple:{radius:0,color:`#e6e6e6`,rect:null},svg:`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:block;" width="{w}" height="{h}" viewBox="{viewBox}">{content}</svg>`,link:`<path stroke-linejoin="round" stroke="#aeaeae" stroke-width="1px" fill="none" d="M{xa},{ya} {xb},{yb} {xc},{yc} L{xd},{yd}"/>`,node:`<rect x="0" y="0" height="120" width="250" fill="none" stroke-width="1" stroke="#aeaeae" rx="7" ry="7"></rect>`,plus:function(e,t,n,r,i){var a=r.mode==`dark`?`#1E1E1E`:`#ffffff`;return`<g transform="matrix(1,0,0,1,${i.x-15},${i.y-15})"><circle cx="15" cy="15" r="15" fill="${a}" stroke="#aeaeae" stroke-width="1"></circle>
273
+ </tr>`},e.searchUI.prototype.hide=function(){if(e.events.publish(`hide`,[this])===!1)return!1;this._searchAfterEnterPress&&(this._searchAfterEnterPress=!1,this.instance.draw()),this.lastSearch=[],this.xBtn&&(this.xBtn.style.display=`none`),this.searchTableWrapper&&(this.searchTableWrapper.innerHTML=``),this.input&&(e.isMobile()||(this.input.value=``),document.activeElement==this.input&&this.input.blur(),document.activeElement==this.xBtn&&e.input.blurHandler(this.input))},e.searchUI.prototype.on=function(t,n){return e.events.on(t,n,this._event_id),this},e.events.on(`redraw`,function(t,n){for(var r=t.element.querySelectorAll(`[data-n-id]`),i=0;i<r.length;i++)r[i].addEventListener(`mouseover`,function(n){if(!this.contains(n.relatedTarget)){var r=this.getAttribute(`data-n-id`),i={node:t.getNode(r),event:n};if(e.events.publish(`node-mouseover`,[t,i])===!1)return;e._hover._addSelectedStyle(t,i.node,i.node.id)}}),r[i].addEventListener(`mouseleave`,function(n){var r=this.getAttribute(`data-n-id`),i={node:t.getNode(r),event:n};e.events.publish(`node-mouseleave`,[t,i])!==!1&&e._hover._removeSelectedStyle(t)})}),e._hover={},e._hover._addSelectedStyle=function(t,n,r){n.isSplit||t.config.highlightOnHover!=`none`&&((t.config.highlightOnHover==`parents`||t.config.highlightOnHover==`childrenAndParents`)&&e._hover._addSelectedStyleParents(t,n,r),(t.config.highlightOnHover==`children`||t.config.highlightOnHover==`childrenAndParents`)&&e._hover._addSelectedStyleChildren(t,n,r),t.config.highlightOnHover==`sameLevel`&&e._hover._addSelectedStyleSameLevel(t,n,r),t.config.highlightOnHover==`self`&&e._hover._addSelectedStyleSelf(t,n,r))},e._hover._addSelectedStyleSelf=function(e,t,n){var r=e.getNodeElement(t.id);r&&r.classList.add(`boc-hover`)},e._hover._addSelectedStyleChildren=function(t,n,r){var i=t.getNodeElement(n.id);i&&i.classList.add(`boc-hover`);var a=t.element.querySelector(`[data-ctrl-ec-id="${n.id}"]`);if(a&&a.classList.add(`boc-hover`),n.id!=r){if(n.rightNeighbor&&n.rightNeighbor.isSplit&&n.rightNeighbor.pid==n.pid){var o=t.element.querySelector(`[data-l-id="[${n.parent.id}][${n.id}]"]`);o&&o.classList.add(`boc-hover`)}if(n.leftNeighbor&&n.leftNeighbor.isSplit&&n.leftNeighbor.pid==n.pid){var o=t.element.querySelector(`[data-l-id="[${n.parent.id}][${n.id}]"]`);o&&o.classList.add(`boc-hover`)}if(n.parent&&n.parent.isSplit){var o=t.element.querySelector(`[data-l-id="[${n.parent.id}][${n.id}]"]`);o&&o.classList.add(`boc-hover`)}}for(var s of n.children)if(s.isSplit){var o=t.element.querySelector(`[data-l-id="[${n.id}][${s.id}]"]`);o&&o.classList.add(`boc-hover`),e._hover._addSelectedStyleChildren(t,s,r)}for(var c of n.childrenIds){var s=t.getNode(c),o=t.element.querySelector(`[data-l-id="[${n.id}][${s.id}]"]`);o&&o.classList.add(`boc-hover`),e._hover._addSelectedStyleChildren(t,s,r)}},e._hover._addSelectedStyleSameLevel=function(e,t,n){var r=e.getNodeElement(t.id);r&&r.classList.add(`boc-hover`);for(var i of e.element.querySelectorAll(`[data-l="${t.level}"]`))i.classList.add(`boc-hover`)},e._hover._addSelectedStyleParents=function(t,n,r){var i=t.getNodeElement(n.id);if(i&&i.classList.add(`boc-hover`),n.parent){var a=t.element.querySelector(`[data-l-id="[${n.parent.id}][${n.id}]"]`);a&&a.classList.add(`boc-hover`)}if(r!=n.id){var o=t.element.querySelector(`[data-ctrl-ec-id="${n.id}"]`);o&&o.classList.add(`boc-hover`)}n.rightNeighbor&&n.rightNeighbor.isSplit&&n.rightNeighbor.pid==n.pid&&e._hover._addSelectedStyleParents(t,n.rightNeighbor,r),n.leftNeighbor&&n.leftNeighbor.isSplit&&n.leftNeighbor.pid==n.pid&&e._hover._addSelectedStyleParents(t,n.leftNeighbor,r),n.parent&&n.parent.isSplit&&e._hover._addSelectedStyleParents(t,n.parent,r);var s=t.getNode(n.pid);n.parent&&e._hover._addSelectedStyleParents(t,s,r)},e._hover._removeSelectedStyle=function(e){let t=e.element.querySelectorAll(`.boc-hover`);for(let e=0;e<t.length;e++)t[e].classList.remove(`boc-hover`)},e===void 0&&(e={}),e.manager=function(e){this.config=e.config,this.layoutConfigs=e._layoutConfigs,this.visibleNodeIds=[],this.viewBox=null,this.action=null,this.actionParams=null,this.nodes={},this.oldNodes={},this.maxX=null,this.maxY=null,this.minX=null,this.minY=null,this.bordersByRootIdAndLevel=null,this.roots=null,this.state=null,this.vbIsInitializedFromState=!1,this.rootList=[],this.instance=e,this._fixAdjustForExport={x:0,y:0}},e.manager.prototype.read=function(t,n,r,i,a,o,s,c){var l=this;e.state._get(this.config.state,n,r,function(u){l.state=u,l.action=a,l.actionParams=o,a!=e.action.init||!l.state||o&&o.method&&o.method==`fit`?(l.viewBox=i,l.vbIsInitializedFromState=!1):(l.viewBox=l.state.vb,l.vbIsInitializedFromState=!0,Array.isArray(l.state.roots)&&(l.config.roots=l.state.roots));var d=l.maxX,f=l.maxY,p=l.minX,m=l.minY,h=l.bordersByRootIdAndLevel,g=l.roots,_=l.nodes;if(!t)_?l.oldNodes=_:l.oldNodes=null,l._read(function(t){d=t.maxX,f=t.maxY,p=t.minX,m=t.minY,h=t.bordersByRootIdAndLevel,g=t.roots,_=t.nodes;var i=e.manager._getResponse(n,r,l.visibleNodeIds,l.config,d,f,p,m,l.viewBox,g,l.action,l.actionParams,_,l.oldNodes,l.vbIsInitializedFromState);i.notif=t.limit,i.roots=g,i.bordersByRootIdAndLevel=h,i.adjustify=t.adjustify,a!=e.action.exporting&&(l.maxX=d,l.maxY=f,l.minX=p,l.minY=m,l.roots=g,l.nodes=_,l.visibleNodeIds=i.visibleNodeIds,l.bordersByRootIdAndLevel=h,l.rootList=t.rootList),s(i)},c);else{var v=e.manager._getResponse(n,r,l.visibleNodeIds,l.config,d,f,p,m,l.viewBox,g,l.action,l.actionParams,_,l.oldNodes,l.vbIsInitializedFromState);a!=e.action.exporting&&(l.maxX=d,l.maxY=f,l.minX=p,l.minY=m,l.roots=g,l.nodes=_,l.visibleNodeIds=v.visibleNodeIds),v.bordersByRootIdAndLevel=h,v.roots=g,v.adjustify={x:0,y:0},l.state&&(v.adjustify=l.state.adjustify),s(v)}})},e.manager.prototype._read=function(t,n){var r=this,i=e.manager._createNodes(this.instance);n(i);var a=i.nodes,o=i.roots,s=e.remote;s??=e.local,s._setPositions(o,r.layoutConfigs,function(n){var s=e.manager._doNotChangePositionOfClickedNodeIfAny(o,a,r.action,r.actionParams,r.oldNodes,r.config.orientation);r.state&&r.action==e.action.init&&(s=r.state.adjustify),r.action==e.action.exporting?s=r._fixAdjustForExport:r._fixAdjustForExport=s;for(var c={minX:null,minY:null,maxX:null,maxY:null},l={},u=[],d=0;d<o.length;d++)e.manager._setMinMaxXYAdjustifyIterate(o[d],o[d],c,0,l,s,r.config.orientation,u);for(var d=0;d<o.length;d++)e.manager._setChildCountPropsIterate(o[d],a);for(var f in u)for(var p in u[f]){var m=l[f][p],h=u[f][p];m.minX==null&&m.minY==null&&m.maxX==null&&m.maxY==null&&e._setMinMaxXY(h,m,!0)}t({minX:c.minX,minY:c.minY,maxX:c.maxX,maxY:c.maxY,bordersByRootIdAndLevel:l,nodes:a,roots:o,rootList:i.rootList,limit:n,adjustify:s})},a)},e===void 0&&(e={}),e.manager._initDinamicNode=function(t,n,r){n&&(t.lcn=n),r&&(t.isAssistant=!0);var i=e.t(t.templateName);t.w=i&&i.size?i.size[0]:0,t.h=i&&i.size?i.size[1]:0,t.isSplit=t.templateName==`split`,t.isMirror=t.templateName==`mirror`,t.isSubLevel=t.templateName==`subLevel`},e.manager._setCollpasedProperty=function(t,n,r,i,a,o,s,c){if(t.collapsed==null&&n.collapse&&n.collapse.allChildren?t.collapsed=!0:t.collapsed??=!1,a==e.action.expand&&r.ids.indexOf(t.id)!=-1&&(t.collapsed=!1),a==e.action.collapse&&(r.expandIds||r.collapseIds)?r.expandIds&&r.expandIds.indexOf(t.id)!=-1?t.collapsed=!1:r.collapseIds&&r.collapseIds.indexOf(t.id)!=-1&&(t.collapsed=!0):a==e.action.collapse&&r.ids.indexOf(t.id)!=-1&&(t.collapsed=!0),a==e.action.expand&&r.ids==`all`&&(t.collapsed=!1),a==e.action.exporting&&(!e.isNEU(r.parentLevels)||!e.isNEU(r.childLevels))&&r.id!=null){if(r.id!=null&&(!e.isNEU(r.parentLevels)||!e.isNEU(r.childLevels))){var l=c[r.id];if(l==t)t.collapsed=!1;else{for(var u=!1,d=-1,f=!1,p=-1;l;){if(d++,l==t){u=!0;break}l=c[l.pid]}l=c[r.id];for(var m=c[t.id];m;){if(p++,m==l){f=!0;break}m=c[m.pid]}r.parentLevels!=null&&u&&d<=r.parentLevels||r.childLevels!=null&&f&&p<=r.childLevels||f&&r.expandChildren?t.collapsed=!1:t.collapsed=!0}}}else a==e.action.exporting&&r.expandChildren&&(t.collapsed=!1);a==e.action.init&&s!=null?t.collapsed=!s.exp.has(t.id):a==e.action.init?t.tags.indexOf(`left-partner`)!=-1||t.tags.indexOf(`right-partner`)!=-1||t.tags.indexOf(`partner`)!=-1||t.parentPartner?t.collapsed=n.collapse&&o>=n.collapse.level&&i.indexOf(t.id)==-1:t.collapsed=n.collapse&&o>=n.collapse.level-1&&i.indexOf(t.id)==-1:a==e.action.centerNode||a==e.action.insert||a==e.action.expand||a==e.action.collapse?i.has(t.id)&&(t.collapsed=!1):a==e.action.update&&r&&r.changeRoots&&r.changeRoots.has(t.id)&&(t.collapsed=!1)},e.manager._initNode=function(t,n,r,i,a,o,s){var c=s.manager.config,l=s.manager.layoutConfigs,u=s.manager.action,d=s.manager.actionParams,f=s.manager.state,p=l[r||`base`];t.parent??e.manager._setCollpasedProperty(t,p,d,a,u,i-1,f,n);for(var m=0;m<t.childrenIds.length;m++){var h=n[t.childrenIds[m]];if(e.manager._setCollpasedProperty(h,p,d,a,u,i,f,n),h.collapsed)t.collapsedChildCount++;else{if(h.parent=t,h.ppid!=null){var g=n[h.ppid];g&&(h.parentPartner=g)}(h.tags.indexOf(`left-partner`)!=-1||h.tags.indexOf(`right-partner`)!=-1||h.tags.indexOf(`partner`)!=-1||h.parentPartner)&&o.indexOf(t.id)==-1&&o.push(t.id),t.children.push(h)}}if(u==e.action.minimize&&!t.min?(d.all||d.id==t.id)&&(t.min=!0):u==e.action.maximize&&t.min===!0?(d.all||d.id==t.id)&&(t.min=!1):u==e.action.exporting&&d.min===!1?t.min=!1:u==e.action.init&&f!=null&&(t.min=f.min.has(t.id)),!t.min&&(!t.tags||!t.tags.has(`filter`)))for(var m=0;m<t.stChildrenIds.length;m++){var h=n[t.stChildrenIds[m]];h.stParent=t,t.stChildren.push(h)}i!=null&&(t.level=i),r&&(t.lcn=r);var _=e._getSubLevels(t.tags,c.tags);_>0&&(t.subLevels=_),t.tags.indexOf(`assistant`)!=-1&&t.parent!=null&&(t.isAssistant=!0),p.layout==e.layout.treeList&&(t.isTreeListItem=!0),p.template&&c.template==t.templateName&&(t.templateName=p.template);var v=e.t(t.templateName,t.min);if(t.w=v&&v.size?v.size[0]:0,t.h=v&&v.size?v.size[1]:0,t.padding=v&&v.padding?v.padding:[0,0,0,0],t.isTreeListItem&&t.stParent&&t.stParent.treeList==null){var y=e.t(t.stParent.templateName,t.stParent.min);t.stParent.treeList={pinnedIds:[],scrollTop:0,scrollTopMax:0,maxHeight:y.treeListMaxHeight}}var b={node:t};e.events.publish(`node-initialized`,[s,b])},e.manager._iterate=function(t,n,r,i,a,o,s,c,l,u,d,f){var p=f.manager.layoutConfigs;if(e.manager._initNode(n,r,l,i,u,d,f),n.isAssistant&&(o[n.pid]||(o[n.pid]=[]),o[n.pid].push(n.id)),n.subLevels>0&&s.push(n.id),e.MIXED_LAYOUT_FOR_NODES_WITH_COLLAPSED_CHILDREN&&!n.isAssistant&&n.parent){if(n.parent&&n.parent.children.length&&n.parent.children[n.parent.children.length-1]==n){for(var m=[],h=0,g=0,_=0;_<n.parent.children.length;_++){var v=n.parent.children[_];v.tags.indexOf(`partner`)==-1&&v.tags.indexOf(`left-partner`)==-1&&v.tags.indexOf(`right-partner`)==-1&&v.tags.indexOf(`assistant`)==-1&&v.children.length==0?m.push(v.id):v.tags.indexOf(`assistant`)==-1?(v.tags.indexOf(`partner`)!=-1||v.tags.indexOf(`left-partner`)!=-1||v.tags.indexOf(`right-partner`)!=-1)&&g++:h++}(e.MIXED_LAYOUT_ALL_NODES&&m.length>1&&m.length==n.parent.children.length-h-g||!e.MIXED_LAYOUT_ALL_NODES&&m.length>1)&&(c[n.pid]=m)}}else if(!n.isAssistant&&n.childrenIds.length==0&&n.parent&&!c[n.pid]){for(var m=[],h=0,g=0,_=0;_<n.parent.children.length;_++){var v=n.parent.children[_];v.tags.indexOf(`partner`)==-1&&v.tags.indexOf(`left-partner`)==-1&&v.tags.indexOf(`right-partner`)==-1&&v.tags.indexOf(`assistant`)==-1&&v.childrenIds.length==0?m.push(v.id):v.tags.indexOf(`assistant`)==-1?(v.tags.indexOf(`partner`)!=-1||v.tags.indexOf(`left-partner`)!=-1||v.tags.indexOf(`right-partner`)!=-1)&&g++:h++}(e.MIXED_LAYOUT_ALL_NODES&&m.length>e.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN&&m.length==n.parent.childrenIds.length-h-g||!e.MIXED_LAYOUT_ALL_NODES&&m.length>e.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN)&&(c[n.pid]=m)}n.stChildren.length&&(t.stContainerNodes||=[],t.stContainerNodes.push(n));for(var y=0;y<n.stChildren.length;y++){for(var b=``,_=0;_<n.tags.length;_++)if(p[n.tags[_]]){b=n.tags[_];break}a.push(n.stChildren[y].id),e.manager._iterate(t,n.stChildren[y],r,0,a,o,s,c,b,u,d,f)}i++;for(var y=0;y<n.children.length;y++)n.isTreeListItem&&(n.children[y].isTreeListItem=n.isTreeListItem),e.manager._iterate(t,n.children[y],r,i,a,o,s,c,l,u,d,f)},e.manager.__createNodes=function(t,n,r,i,a,o,s,c){for(var l=[],u=e._addDottedLines(r),d=0;d<u.length;d++){var f=u[d],p=e.STRING_TAGS?f.tags?f.tags.split(`,`):[]:Array.isArray(f.tags)?f.tags.slice(0):[];c.filterUI.addFilterTag(f)&&p.unshift(`filter`);var m=c.searchUI.addMatchTag(f.id);m===!0?p.unshift(`match`):m===!1&&p.unshift(`no-match`);var h=e._getTemplate(p,r.tags,r.template);f&&f.template&&(h=f.template);var g=new e.node(f.id,f.pid,p,h);e.isNEU(f.ppid)||(g.ppid=f.ppid),e.isNEU(f.stpid)||(g.stpid=f.stpid),f.movex!=null&&(g.movex=f.movex),f.movey!=null&&(g.movey=f.movey),t[f.id]=g,l.push(f.id)}if(r.orderBy!=null){var _=e.manager._getOrderSortArray(r.orderBy);l.sort(function(e,t){var n,r;for(var i of u)if(i.id==e&&(n=i),i.id==t&&(r=i),n&&r)break;for(var a=0;a<_.length;a++){var o=n[_[a].field],s=r[_[a].field],c=o,l=s;if(c??=``,l??=``,typeof c==`string`&&typeof l==`string`){var d=c.localeCompare(l);if(_[a].desc&&(d*=-1),d!==0)return d}else{var d=o<s?-1:o>s?1:0;if(_[a].desc&&(d*=-1),d!==0)return d}}})}for(var d=0;d<l.length;d++){var v=l[d],g=t[v],y=o?o[v]:null,b=t[g.stpid],x=t[g.pid];if(b||(g.stpid=null),x||(g.pid=null),b){var S=o?o[b.id]:null;S&&(b.min=S.min),b.stChildrenIds.push(g.id)}else x?(y&&(g.collapsed=y.collapsed,g.min=y.min,g.treeList=y.treeList),x.childrenIds.push(g.id)):(y&&(g.collapsed=y.collapsed,g.min=y.min,g.treeList=y.treeList),n.push(g),s.push(g.id));i==e.action.init&&(g.min=e._getMin(g,r))}},e.manager._createNodes=function(t){var n=t.manager.config,r=t.manager.layoutConfigs,i=t.manager.action,a=t.manager.actionParams,o=t.manager.oldNodes,s=t.manager.state,c={},l=[],u=[];if(e.manager.__createNodes(c,l,n,i,a,o,u,t),n.roots!=null){l=[];for(var d=0;d<n.roots.length;d++){var f=c[n.roots[d]];if(f&&i==e.action.centerNode){for(var p=f;p.pid!=null||p.stpid!=null;)p=p.pid==null&&p.stpid!=null?c[p.stpid]:c[p.pid];for(var m=c[a.id];(m.pid!=null||m.stpid!=null)&&m!=f;)m=m.pid==null&&m.stpid!=null?c[m.stpid]:c[m.pid];p==m&&(f=p)}if(f){for(var h=!1,g=0;g<l.length;g++)if(l[g].id==f.id){h=!0;break}if(!h){if(!e.isNEU(f.pid)){var _=c[f.pid],v=_.childrenIds.indexOf(f.id);v>-1&&_.childrenIds.splice(v,1)}l.push(f)}}}n.roots=[];for(var d=0;d<l.length;d++)n.roots.push(l[d].id)}if(i==e.action.exporting&&a.id!=null)if(a.parentLevels){for(var _=c[a.id],y=0;y<a.parentLevels&&c[_.pid];)y++,_=c[_.pid];_.pid=null,l=[_]}else{var b=c[a.id];b&&(b.pid=null,l=[b])}var x=[];if(i==e.action.init&&n.expand&&n.expand.nodes&&s==null)for(var d=0;d<n.expand.nodes.length;d++){var b=c[n.expand.nodes[d]];for(n.expand.allChildren===!0&&e.manager._addExpandedNodeIdsIterate(b,c,x);b;)x.push(b.id),b.pid==null&&b.stpid!=null?(b=c[b.stpid],b.min=!1):b=c[b.pid]}else if(i==e.action.expand&&a.ids&&a.ids!=`all`||i==e.action.collapse&&a&&a.expandIds)for(var S=i==e.action.expand?a.ids:a.expandIds,d=0;d<S.length;d++)for(var b=c[S[d]],_=c[b.pid];_;)x.push(_.id),_.pid==null&&_.stpid!=null?(_=c[_.stpid],_.min=!1):_=c[_.pid];else if(i==e.action.centerNode){for(var C=e._getCenterNodeFromParams(c,a);C;){if(x.push(C.id),a.options.parentState===e.COLLAPSE_PARENT_NEIGHBORS&&C)for(var d=0;d<C.childrenIds.length;d++){var w=c[C.childrenIds[d]];w.collapsed=!0}if(C.pid==null&&C.stpid!=null){if(C=c[C.stpid],C.min=!1,C.tags){var v=C.tags.indexOf(`filter`);v!=-1&&(C.tags.splice(v,1),t.filterUI._removeFilter(C.id))}}else C=c[C.pid]}if(C=e._getCenterNodeFromParams(c,a),a.options.childrenState===e.COLLAPSE_SUB_CHILDRENS)for(var d=0;d<C.childrenIds.length;d++){var T=c[C.childrenIds[d]];T.collapsed=!1;for(var E=0;E<T.childrenIds.length;E++){var D=c[T.childrenIds[E]];D.collapsed=!0}}if(a.options.parentState===e.COLLAPSE_PARENT_SUB_CHILDREN_EXCEPT_CLICKED){var _=c[C.pid];if(_)for(var d=0;d<_.childrenIds.length;d++){var T=c[_.childrenIds[d]];if(T!=C){T.collapsed=!1;for(var E=0;E<T.childrenIds.length;E++){var D=c[T.childrenIds[E]];D.collapsed=!0}}}}}else if(i==e.action.insert)for(var b=c[a.insertedNodeId];b;)x.push(b.id),b.pid==null&&b.stpid!=null?(b=c[b.stpid],b.min=!1):b=c[b.pid];for(var O=[],k={},A=[],j={},M=[],d=0;d<l.length;d++)e.manager._iterate(l[d],l[d],c,0,O,k,A,j,``,x,M,t);if(i==e.action.collapse&&a&&Array.isArray(a.expandIds)&&Array.isArray(a.collapseIds))for(var d=0;d<a.ids.length;d++)if(a.expandIds.has(a.collapseIds[d]))console.error(`id ${a.collapseIds[d]} exist in both collapseIds and expandIds`);else{var b=c[a.collapseIds[d]];b&&(b.collapsed=!0)}for(var d=l.length-1;d>=0;d--)l[d].collapsed&&l.splice(d,1);for(var d=0;d<M.length;d++){for(var b=c[M[d]],N=[],P=[],F=[],I={},ee=0,L=0,te=0,ne=[],re=[],E=0;E<b.children.length;E++){var w=b.children[E];w.isAssistant?N.push(w.id):w.tags.indexOf(`right-partner`)==-1?w.tags.indexOf(`left-partner`)==-1?w.tags.indexOf(`partner`)!=-1&&!(ee%2)?(w.isPartner=1,w.children=[],P.push(w.id),ee++):w.tags.indexOf(`partner`)!=-1&&ee%2?(w.isPartner=2,w.children=[],F.push(w.id),ee++):w.parentPartner?(I[w.parentPartner.id]||(I[w.parentPartner.id]=[]),I[w.parentPartner.id].push(w.id)):N.push(w.id):(w.isPartner=2,w.children=[],F.push(w.id)):(w.isPartner=1,w.children=[],P.push(w.id))}b.children=[];for(var ie=[],E=0;E<P.length;E++){var w=c[P[E]];I[w.id]?b.children.push(w):b.children.splice(0,0,w);for(var R=0;R<w.childrenIds.length;R++)ie.push(w.childrenIds[R])}for(var z=[],E=0;E<F.length;E++){var w=c[F[E]];I[w.id]?b.children.push(w):b.children.splice(0,0,w);for(var R=0;R<w.childrenIds.length;R++)z.push(w.childrenIds[R])}for(var E=0;E<z.length;E++){var w=c[z[E]];w.collapsed||(w.parentPartner=w.parent,w.parent=b,w.isChildOfPartner=!0,b.children.push(w))}for(var E=F.length-1;E>=0;E--)if(I[F[E]])for(var g=0;g<I[F[E]].length;g++)b.children.push(c[I[F[E]][g]]),L++,re.indexOf(F[E])==-1&&re.push(F[E]);for(var E=0;E<N.length;E++){var w=c[N[E]];b.children.push(w)}for(var E=0;E<P.length;E++)if(I[P[E]])for(var g=0;g<I[P[E]].length;g++)b.children.push(c[I[P[E]][g]]),te++,ne.indexOf(P[E])==-1&&ne.push(P[E]);for(var E=0;E<ie.length;E++){var w=c[ie[E]];w.collapsed||(w.parentPartner=w.parent,w.parent=b,w.isChildOfPartner=!0,b.children.push(w))}b.partnerSeparation=Math.max(re.length,ne.length)*n.partnerChildrenSplitSeparation+n.minPartnerSeparation,!N.length&&L&&!te?b.hasPartners=2:!N.length&&!L&&te?b.hasPartners=3:!N.length&&L==1&&te==1?b.hasPartners=4:!N.length&&!L&&!te?b.hasPartners=5:N.length&&!L&&!te?b.hasPartners=6:N.length&&(L||te)?b.hasPartners=7:b.hasPartners=1}for(var d=0;d<A.length;d++)for(var b=c[A[d]],ae=b.lcn?b.lcn:`base`,oe=r[ae],E=0;E<b.subLevels;E++){var B=new e.node(b.id+`_sub_level_index_`+E,b.pid,[],`subLevel`);e.manager._initDinamicNode(B,b.lcn);var _=b.parent;if(_){b.movex!=null&&(B.movex=b.movex),b.movey!=null&&(B.movey=b.movey);var v=_.children.indexOf(b);v>-1&&(_.children.splice(v,1),_.children.splice(v,0,B)),B.children.push(b),B.parent=_,b.parent=B,c[B.id]=B}}for(var V in k){var _=c[V];_.hasAssistants=!0;var B=new e.node(_.id+`_split_assitant_0`,_.id,[`assistant`],`split`);_.movex!=null&&(B.movex=_.movex),_.movey!=null&&(B.movey=_.movey),e.manager._initDinamicNode(B,_.lcn,!0),c[B.id]=B;for(var H=[],E=_.children.length-1;E>=0;E--){var w=_.children[E];w.isAssistant?(w.parent=null,_.children.splice(E,1),H.splice(0,0,w.id)):w.isPartner||(w.parent&&j[w.parent.id]&&B&&w.parent.id!=B.id&&(Object.defineProperty(j,B.id,Object.getOwnPropertyDescriptor(j,w.parent.id)),delete j[w.parent.id]),w.parent=B,B.children.unshift(w),_.children.splice(E,1))}if(H.length%2){var U=c[H[H.length-1]],se=new e.node(U.id+`_mirror`,_.pid,[],`mirror`);e.manager._initDinamicNode(se,U.lcn,!0),se.isAssistant=!0,se.w=U.w,se.h=U.h,c[se.id]=se,H.splice(H.length-1,0,se.id)}for(var ce=1,E=H.length-1;E>=0;E--)if(E%2&&E!=H.length-1){var W=new e.node(_.id+`_split_assitant_`+ce,_.pid,[],`split`);e.manager._initDinamicNode(W,_.lcn,!0),_.movex!=null&&(W.movex=_.movex),_.movey!=null&&(W.movey=_.movey),c[W.id]=W,H.splice(E,0,W.id),ce++}else E%2&&H.splice(E,0,B.id);for(var E=0;E<H.length;E+=3){var G=null;G=E==0?_:c[H[E-2]];var le=c[H[E]],K=c[H[E+1]],q=c[H[E+2]];le.parent=G,K.parent=G,q.parent=G,G.children.push(le),G.children.push(K),G.children.push(q)}}var ue=!1;for(var J in r){var oe=r[J];if(oe.layout!=0){ue=!0;break}}var de=e.events.has(`node-layout`,t._event_id);if(ue||de){var Y={nodes:c,config:n,action:i,actionParams:a};if(A.length){var fe=!1;for(var V in j){for(var S=j[V],d=0;d<S.length;d++){var b=c[S[d]];if(b.subLevels){fe=!0;break}}if(fe)break}if(fe){var X={},pe={},me={};for(var V in j)for(var S=j[V],he=!1,ge=null,d=0;d<S.length;d++){var _e=S[d];(ge===null||A.has(_e))&&(ge=c[_e].parent.id,!he&&!e.isNEU(c[_e].subLevels)&&(he=c[_e].subLevels>0)),X[ge]||(X[ge]=[]),X[ge].push(_e),he&&(me[ge]=V,pe[ge]||(pe[ge]=[]),pe[ge].push(_e))}for(var V in j={},pe)if(pe[V].length>e.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN)for(var ve=me[V],d=c[ve].children.length-1;d>=0;d--){var w=c[ve].children[d];pe[V].has(w.id)&&c[ve].children.splice(d,1)}for(var V in X)X[V].length>e.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN&&(j[V]=X[V])}}for(var V in j){for(var _=c[V],Z=_;Z.isSplit;)Z=c[Z.pid];for(;Z.isSubLevel;)Z=c[Z.pid];var ae=_.lcn?_.lcn:`base`,oe=r[ae];if(oe.layout!=0||de){Y.pnode=_,Y.layout=oe.layout,Y.layoutGridColumns=n.layoutGridColumns,Y.childrenIds=j[V],Y.lastChildrenPidIds=j,Y.subLevels=0,Y.layouts=[],e.events.publish(`node-layout`,[t,Y]),e.events.publish(`layout`,[Y]),Y.layouts.length||Y.layouts.push({layout:Y.layout,childrenIds:Y.childrenIds,subLevels:Y.subLevels,layoutGridColumns:Y.layoutGridColumns});for(var ye=0;ye<Y.layouts.length;ye++){var Q=Y.layouts[ye];for(e.isNEU(Q.subLevels)&&(Q.subLevels=0),e.isNEU(Q.layout)&&(Q.layout=oe.layout),_=c[V],Z=_;Z.isSplit;)Z=c[Z.pid];for(;Z.isSubLevel;)Z=c[Z.pid];for(var be=_,E=0;E<Q.subLevels;E++){var B=new e.node(ye+`_sublevel_layout_`+E,be.id,[],`subLevel`);e.manager._initDinamicNode(B,be.lcn),B.parent=be,be.children.push(B),c[B.id]=B,be=B}if(Q.subLevels){for(var E=0;E<Q.childrenIds.length;E++){var w=c[Q.childrenIds[E]],v=_.children.indexOf(w);v!=-1&&_.children.splice(v,1),w.parent=be,be.children.push(w)}_=be}if(Q.layout==e.layout.grid&&Q.childrenIds.length>2){Q.layoutGridColumns==`dynamic`&&(Q.layoutGridColumns=e._getDynamicGridCoulumns(Q.childrenIds.length));for(var xe=_.id,d=_.children.length-1;d>=0;d--)for(var E=0;E<Q.childrenIds.length;E++){var _e=Q.childrenIds[E];if(_.children[d].id==_e){_.children.splice(d,1);break}}var Se=Q.layoutGridColumns;Se%2!=0&&Se>2&&Se--;for(var d=0;d<Q.childrenIds.length;d+=Se)for(var Ce=null,E=0;E<Se;E++){var we=d+Se>=Q.childrenIds.length;if(Q.childrenIds.length-1<d+E)break;var _e=Q.childrenIds[d+E],w=c[_e];w.parent=c[xe],c[xe].children.push(w),we||(Se/2-1==E&&(Ce=new e.node(Q.childrenIds[d+E-1]+`_grid_pseudo_node_`+Q.childrenIds[d+E+1],xe,[],`subLevel`),e.manager._initDinamicNode(Ce,_.lcn),Ce.parent=c[xe],c[xe].children.push(Ce),c[Ce.id]=Ce),Se-1==E&&(xe=Ce.id))}}if(Q.layout==e.layout.mixed)for(var Te=Q.childrenIds,d=Te.length-1;d>=0;d--){var w=c[Te[d]];_=w.parent,w.layout=e.layout.mixed;for(var E=_.children.length-1;E>=0;E--)if(w.id==_.children[E].id){_.children.splice(E,1);break}if(d>0){var Ee=c[Te[d-1]];w.parent=Ee,w.layout=e.layout.mixed,Ee.children.push(w)}else _.children.push(w)}else if(Q.layout>1){var B=new e.node(ye+`_`+_.id+`_split_0`,Z.id,[],`split`);_.movex!=null&&(B.movex=_.movex),_.movey!=null&&(B.movey=_.movey),e.manager._initDinamicNode(B,_.lcn),c[B.id]=B,B.layout=Q.layout;for(var $=[],d=Q.childrenIds.length-1;d>=0;d--){for(var w=c[Q.childrenIds[d]],E=0;E<_.children.length;E++)_.children[E].id==w.id&&_.children.splice(E,1);if(w.parent=null,w.layout=Q.layout,(Q.layout==e.layout.treeRightOffset||Q.layout==e.layout.treeRight)&&$.splice(0,0,w.id),Q.layout>2){var De=new e.node(ye+`_`+w.id+`_mirror`,Z.id,[],`mirror`);e.manager._initDinamicNode(De,w.lcn),De.layout=Q.layout,c[De.id]=De,$.splice(0,0,De.id)}Q.layout!=e.layout.treeRightOffset&&Q.layout!=e.layout.treeRight&&$.splice(0,0,w.id)}for(var ce=1,E=$.length-1;E>=0;E--)if(E%2&&E!=$.length-1){var W=new e.node(ye+`_`+_.id+`_split_`+ce,Z.id,[],`split`);e.manager._initDinamicNode(W,_.lcn),_.movex!=null&&(W.movex=_.movex),_.movey!=null&&(W.movey=_.movey),W.layout=Q.layout,c[W.id]=W,$.splice(E,0,W.id),ce++}else E%2&&$.splice(E,0,B.id);for(var E=0;E<$.length;E+=3){var G=null;E==0&&(G=_);var le=c[$[E]],K=c[$[E+1]],q=c[$[E+2]];E!=0&&(G=c[$[E-3]]),E!=0&&!K&&(G=c[$[E-2]]),le.parent=G,G.children.push(le),K&&(E!=0&&(G=c[$[E-2]]),K.parent=G,G.children.push(K)),q&&(E!=0&&(G=c[$[E-1]]),q.parent=G,G.children.push(q))}}}}}}if(e.VERTICAL_CHILDREN_ASSISTANT)for(var d=0;d<l.length;d++)e.manager._verticalAssistantIterate(l[d],c);var Y={nodes:c,roots:l};return e.events.publish(`nodes-initialized`,[t,Y]),{nodes:Y.nodes,roots:Y.roots,rootList:u}},e.manager._getOrderSortArray=function(e){if(typeof e==`string`)return[{field:e,desc:!1}];if(Array.isArray(e)){var t=[];for(var n of e)typeof n==`string`?t.push({field:n,desc:!1}):e instanceof Object?t.push(n):console.error(`Unseported orderBy value!`);return t}else if(e instanceof Object)return[e];else console.error(`Unseported orderBy value!`)},e.manager._getNodeWidth=function(t,n){switch(n.orientation){case e.orientation.top:case e.orientation.top_left:case e.orientation.bottom:case e.orientation.bottom_left:return t.w;case e.orientation.right:case e.orientation.right_top:case e.orientation.left:case e.orientation.left_top:return t.h}return 0},e.manager._isVisible=function(t,n,r,i,a,o,s){var c=0;if(e.LAZY_LOADING_FACTOR==`auto`){var l=o/a*2,u=s/a*2;c=Math.ceil(l>u?l:u)}else c=e.LAZY_LOADING_FACTOR/a;if(!(t.x==null||t.y==null)){if(e._getLazyLoading(n)&&i!==e.action.exporting){function e(e,t){var n=e.x,r=e.y,i=e.w,a=e.h,o=t[0]-c,s=t[2]+c+t[0],l=t[1]-c,u=t[3]+c+t[1],d=n+i>o&&s>n;return d&&=r+a>l&&u>r,d}if(e(t,r))return!0;for(var d=0;d<t.children.length;d++)if(e(t.children[d],r))return!0;return!1}return!0}},e.manager.getAllFields=function(t){var n=[e.TAGS];for(var r in t.nodeBinding)n.push(t.nodeBinding[r]);for(var r=0;r<t.nodes.length;r++)for(var i in t.nodes[r])i!==e.ID&&i!==e.TAGS&&i!==e.NODES&&i!==e.PID&&i!==e.STPID&&i!==`movex`&&i!==`movey`&&(t.nodeBinding[i]||n.has(i)||n.push(i));return n},e.manager._getMostDeepChild=function(e){if(!e)return;var t=e;function n(e){e.sl>t.sl&&(t=e);for(var r=0;r<e.children.length;r++)n(e.children[r])}return n(e),t},e.manager._getResponse=function(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){var g=u[0],_=[],v={top:null,left:null,bottom:null,right:null,minX:null,maxX:null,minY:null,maxY:null},y=[[],[],[]],b=a-s+i.padding*2,x=o-c+i.padding*2,S=e.getScale(l,t,n,i.scaleInitial,i.scaleMax,i.scaleMin,b,x);if(v.top=c-i.padding,v.left=s-i.padding,v.bottom=o+i.padding-n/S,v.right=a+i.padding-t/S,v.maxX=a,v.minX=s,v.maxY=o,v.minY=c,u.length==0||l==null&&!h&&i.align==e.CENTER){var C=Math.ceil(t/S),w=Math.ceil(n/S),T=0,E=0;if(C-i.padding*2>=a-s)switch(T=(a+s)/2-C/2,i.orientation){case e.orientation.right:case e.orientation.right_top:T=(s-a)/2-C/2;break}else switch(T=g.x-C/2+e.manager._getNodeWidth(g,i)/2,i.orientation){case e.orientation.right:case e.orientation.right_top:T=-(C/2-(s-a)/2),T<i.padding-C&&(T=i.padding-C);break;case e.orientation.left:case e.orientation.bottom_left:case e.orientation.top_left:case e.orientation.left_top:T=-(C/2-(a-s)/2),T>-i.padding&&(T=-i.padding);break}if(w-i.padding*2>=o-c)switch(E=(o+c)/2-w/2,i.orientation){case e.orientation.bottom:case e.orientation.bottom_left:E=(c-o)/2-w/2;break}else switch(E=-(w/2-(o-c)/2),E>-i.padding&&(E=-i.padding),i.orientation){case e.orientation.bottom:case e.orientation.bottom_left:E=-(w/2-(c-o)/2),E<i.padding-w&&(E=i.padding-w);break;case e.orientation.left:case e.orientation.right:E=g.y-w/2+e.manager._getNodeWidth(g,i)/2;break}l=[T,E,C,w]}else if(l==null&&!h&&i.align==e.ORIENTATION){var C=Math.ceil(t/S),w=Math.ceil(n/S),T=0,E=0;switch(i.orientation){case e.orientation.top:T=g.x-C/2+e.manager._getNodeWidth(g,i)/2,E=-i.padding;break;case e.orientation.bottom:T=g.x-C/2+e.manager._getNodeWidth(g,i)/2,E=i.padding-w;break;case e.orientation.left:T=-i.padding,E=g.y-w/2+e.manager._getNodeWidth(g,i)/2;break;case e.orientation.right:T=i.padding-C,E=g.y-w/2+e.manager._getNodeWidth(g,i)/2;break;case e.orientation.top_left:T=-i.padding,E=-i.padding;break;case e.orientation.right_top:T=i.padding-C,E=-i.padding;break;case e.orientation.left_top:T=-i.padding,E=-i.padding;break;case e.orientation.bottom_left:T=-i.padding,E=i.padding-w;break}l=[T,E,C,w]}if(d==e.action.centerNode||d==e.action.maximize){var D=e._getCenterNodeFromParams(p,f);f.options.horizontal==1&&(l[0]=D.x+D.w/2-l[2]/2),f.options.vertical==1&&(l[1]=D.y+D.h/2-l[3]/2)}if(d==e.action.insert||d==e.action.expand||d==e.action.collapse||d==e.action.update||d==e.action.centerNode){var O=null;if(d==e.action.insert&&f&&f.insertedNodeId!=null&&f.insertedNodeId!=null)O=p[f.insertedNodeId];else if(d==e.action.update&&f&&f.visId!=null&&f.visId!=null)O=p[f.visId];else if((d==e.action.expand||d==e.action.collapse)&&f&&f.id!=null&&f.id!=null)O=p[f.id],O=e.manager._getMostDeepChild(O);else if(d==e.action.centerNode){switch(i.orientation){case e.orientation.top:case e.orientation.top_left:case e.orientation.bottom:case e.orientation.bottom_left:f.options.vertical||(O=p[f.id]);break;case e.orientation.right:case e.orientation.right_top:case e.orientation.left:case e.orientation.left_top:f.options.horizontal||(O=p[f.id]);break}O&&=e.manager._getMostDeepChild(O)}if(!e.FIXED_POSITION_ON_CLICK&&O){if(O.isTreeListItem){for(;!O.stParent;)O=O.parent;O=O.stParent}switch(i.orientation){case e.orientation.top:case e.orientation.top_left:var k=O.y+O.h-l[3]+i.padding;l[1]<k&&(l[1]=k);break;case e.orientation.bottom:case e.orientation.bottom_left:var k=O.y-i.padding;l[1]>k&&(l[1]=k);break;case e.orientation.right:case e.orientation.right_top:var k=O.x-i.padding;l[0]>k&&(l[0]=k);break;case e.orientation.left:case e.orientation.left_top:var k=O.x+O.w-l[2]+i.padding;l[0]<k&&(l[0]=k);break}}}for(var A=0;A<u.length;A++)e.manager._iterate2(u[A],p,i,l,d,f,_,m,r,y,S,t,n);return{animations:y,boundary:v,viewBox:l,visibleNodeIds:_,nodes:p,allFields:e.manager.getAllFields(i)}},e.manager._iterate2=function(t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.manager._isVisible(t,r,i,a,d,f,p)){s.push(t.id);var m=null;if((a==e.action.expand||a==e.action.collapse||a==e.action.maximize)&&c&&c[t.id]&&o.method==`expandCollapseToLevel`){var h=c[t.id];if(m={x:h.x,y:h.y},h){m={x:h.x,y:h.y};for(var g=t,_=null;g!=null;)c[g.id]&&c[g.id].collapsed&&(_=g),g=g.parent;_&&_.parent&&(m={x:_.parent.x,y:_.parent.y})}var v=n[o.id];if(v){for(var g=t.parent;g!=null;)g=g.parent;g&&(m={x:v.x+v.w/2-t.w/2,y:v.y+v.h/2-t.h/2})}}else if((a==e.action.expand||a==e.action.collapse)&&c&&c[t.id]){var h=c[t.id];if(m={x:h.x,y:h.y},o.ids==`all`&&h){m={x:h.x,y:h.y};for(var g=t,_=null;g!=null;)c[g.id]&&c[g.id].collapsed&&(_=g),g=g.parent;_&&_.parent&&(m={x:_.parent.x,y:_.parent.y})}var v=n[o.id];if(v){for(var g=t.parent;g!=null&&o.ids.indexOf(t.id)==-1&&o.ids.indexOf(g.id)==-1;)g=g.parent;g&&(m={x:v.x+v.w/2-t.w/2,y:v.y+v.h/2-t.h/2})}}else if(a==e.action.centerNode&&c&&c[t.id]){var h=c[t.id];h.x!=null&&h.y!=null&&(m={x:h.x,y:h.y});var y=e._getCenterNodeFromParams(n,o);if(y&&y==t){var g=t.parent;g&&g.id==o.id&&(m={x:y.x+y.w/2-t.w/2,y:y.y+y.h/2-t.h/2})}}else if(a==e.action.maximize&&c&&c[t.id]){var h=c[t.id];h.x!=null&&h.y!=null&&(m={x:h.x,y:h.y});var y=e._getCenterNodeFromParams(n,o);if(y&&y==t){var g=t.parent;g&&g.id==o.id&&(m={x:y.x+y.w/2-t.w/2,y:y.y+y.h/2-t.h/2})}}else if(a==e.action.minimize&&c&&c[t.id]){var h=c[t.id];m={x:h.x,y:h.y}}else if(a==e.action.insert&&o&&o.insertedNodeId==t.id&&t.parent)m={x:t.parent.x,y:t.parent.y};else if((a==e.action.update||a==e.action.insert)&&c){var h=c[t.id];if((!h||e.isNEU(h.x)&&e.isNEU(h.y))&&o){var v=n[o.id];if(v){for(var g=v;g&&g.id==t.id;)g=g.parent;g&&(m={x:v.x,y:v.y})}}else h&&(m={x:h.x,y:h.y})}else a!==e.action.exporting&&a!==e.action.init&&l.indexOf(t.id)==-1&&(u[0].push(t.id),u[1].push({opacity:0}),u[2].push({opacity:1}));m!=null&&m.x!=null&&m.y!=null&&(m.x!=t.x||m.y!=t.y)&&!(o&&o.dragNodeIdList&&o.dragNodeIdList.indexOf(t.id)!=-1)&&!t.isSplit&&(u[0].push(t.id),u[1].push({transform:[1,0,0,1,m.x,m.y]}),u[2].push({transform:[1,0,0,1,t.x,t.y]}))}for(var b=0;b<t.stChildren.length;b++)e.manager._iterate2(t.stChildren[b],n,r,i,a,o,s,c,l,u,d,f,p);for(var b=0;b<t.children.length;b++)e.manager._iterate2(t.children[b],n,r,i,a,o,s,c,l,u,d,f,p)},e.manager._addExpandedNodeIdsIterate=function(t,n,r){for(var i=0;i<t.childrenIds.length;i++)r.push(t.childrenIds[i]),e.manager._addExpandedNodeIdsIterate(n[t.childrenIds[i]],n,r)},e.manager._setChildCountPropsIterate=function(t,n){t.w===void 0&&(t.collapsedChildCount=t.childrenIds.length),t.deepChildCount=t.childCount=t.childrenIds.length,t.deepCollapsedChildCount=t.collapsedChildCount;for(var r=n[t.pid];r;)r.deepCollapsedChildCount+=t.collapsedChildCount,r.deepChildCount+=t.childCount,r=n[r.pid];for(var i of t.stChildrenIds)e.manager._setChildCountPropsIterate(n[i],n);for(var i of t.childrenIds)e.manager._setChildCountPropsIterate(n[i],n)},e.manager._setMinMaxXYAdjustifyIterate=function(t,n,r,i,a,o,s,c){t.x+=o.x,t.y+=o.y;for(var l of t.stChildren)e.manager._setMinMaxXYAdjustifyIterate(l,l,r,0,a,o,s,c);t.isPartner?t.sl=i-1:t.sl=i,a[n.id]??(a[n.id]={}),a[n.id][t.sl]??(a[n.id][t.sl]={minX:null,minY:null,maxX:null,maxY:null}),t.layout?(c[n.id]??(c[n.id]={}),c[n.id][t.sl]??(c[n.id][t.sl]=t)):e._setMinMaxXY(t,a[n.id][t.sl],!0),t.movex!=null&&(t.x+=t.movex),t.movey!=null&&(t.y+=t.movey),e._setMinMaxXY(t,r,!0),i++;for(var l of t.children)e.manager._setMinMaxXYAdjustifyIterate(l,n,r,i,a,o,s,c)},e.manager._doNotChangePositionOfClickedNodeIfAny=function(t,n,r,i,a,o){if(r!=e.action.expand&&r!=e.action.collapse&&r!=e.action.minimize&&r!=e.action.maximize&&r!=e.action.centerNode&&r!=e.action.update&&r!=e.action.insert)return{x:0,y:0};if(r==e.action.update&&(!i||i.id==null)){if(!t||!t.length)return{x:0,y:0};i={id:t[0].id}}if(i.id==null)return{x:0,y:0};var s=i.id;(r==e.action.minimize&&n[s].parent||r==e.action.maximize&&n[s].parent)&&(s=n[s].pid);var c=n[s],l=a[s];if(!l)return{x:0,y:0};var u=l.movex==null?0:l.movex,d=l.movey==null?0:l.movey,f={x:(l.x?l.x-u:0)-c.x,y:(l.y?l.y-d:0)-c.y};return c&&c.isTreeListItem?{x:0,y:0}:f},e.manager._verticalAssistantIterate=function(t,n){for(var r=0;r<t.stChildren.length;r++)e.manager._verticalAssistantIterate(t.stChildren[r],n);if(t.children.length==3)e.manager._verticalAssistantIterate(t.children[0],n),e.manager._verticalAssistantIterate(t.children[2],n),e.manager._verticalAssistantIterate(t.children[1],n);else for(var r=0;r<t.children.length;r++)e.manager._verticalAssistantIterate(t.children[r],n);if(t.isAssistant&&t.isSplit&&t.children.length){for(var i=t.parent.children[0],a=t.parent.children[2],o=t.parent;!o.hasAssistants;)o=o.parent;var s={max:0},c={max:0};e.manager._verticalAssistantLevelCountIterate(i,0,s),e.manager._verticalAssistantLevelCountIterate(a,0,c);for(var l=Math.max(s.max,c.max),u=[],r=0;r<l;r++){var d=new e.node(t.parent.id+`_split_assitant_level_`+r,t.pid,[],`subLevel`);e.manager._initDinamicNode(d,t.lcn,!0),o.movex!=null&&(d.movex=o.movex),o.movey!=null&&(d.movey=o.movey),r>0&&(u[r-1].children.push(d),d.parent=u[r-1]),n[d.id]=d,u.push(d)}if(u.length){for(var f=u[u.length-1],p=u[0],m=t.children.length-1;m>=0;m--){var h=t.children[m];f.children.unshift(h),h.parent=f,t.children.splice(m,1)}t.children.push(p),p.parent=t}}},e.manager._verticalAssistantLevelCountIterate=function(t,n,r){r.max<n&&(r.max=n),n++;for(var i=0;i<t.children.length;i++)e.manager._verticalAssistantLevelCountIterate(t.children[i],n,r)},e._addDottedLines=function(e){var t=e.nodes;if((e.groupDottedLines.length||e.dottedLines.length)&&(t=JSON.parse(JSON.stringify(t))),e.groupDottedLines.length)for(var n=[],r=0;r<e.groupDottedLines.length;r++){var i=e.groupDottedLines[r];i.rootId??=i.to;var a=`balkan_group_dotted_${i.rootId}`;if(!n.has(a)){for(var o=0;o<t.length;o++)if(t[o].id==i.rootId){var s=JSON.parse(JSON.stringify(t[o]));s.id=`balkan_group_dotted_${i.rootId}_balkan_id_${t[o].id}`,s.pid=void 0,s.stpid=t[o].id,t.push(s),n.push(a),t[o].tags||(t[o].tags=[]),t[o].tags.push(`group-dotted-lines`),t[o].tags.push(`group-dotted-lines-`+a);break}}for(var o=0;o<t.length;o++)if(t[o].id==i.from){var s=JSON.parse(JSON.stringify(t[o]));if(s.id=`balkan_group_dotted_${i.rootId}_balkan_id_${t[o].id}`,s.pid=`balkan_group_dotted_${i.rootId}_balkan_id_${i.to}`,s.tags){var c=s.tags.indexOf(`group-dotted-lines`);c!=-1&&s.tags.splice(c,1)}if(s.tags||=[],s.tags.push(`boc-dotted-connector`),i.tags)for(var l=0;l<i.tags.length;l++)s.tags.push(i.tags[l]);t.push(s);break}}if(e.dottedLines.length)for(var r=0;r<e.dottedLines.length;r++){var u=e.dottedLines[r];u.rootId??=u.to;for(var o=0;o<t.length;o++)if(t[o].id==u.from){var s=JSON.parse(JSON.stringify(t[o]));if(s.id=`balkan_dotted_${u.rootId}_balkan_id_${t[o].id}`,u.rootId==u.to?s.pid=u.to:s.pid=`balkan_dotted_${u.rootId}_balkan_id_${u.to}`,s.tags||=[],s.tags.push(`boc-dotted-connector`),u.tags)for(var l=0;l<u.tags.length;l++)s.tags.push(u.tags[l]);t.push(s);break}}return t},e===void 0&&(e={}),e.templates={},e.templates.base={defs:``,size:[250,120],expandCollapseSize:30,linkAdjuster:{fromX:0,fromY:0,toX:0,toY:0},ripple:{radius:0,color:`#e6e6e6`,rect:null},svg:`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:block;" width="{w}" height="{h}" viewBox="{viewBox}">{content}</svg>`,link:`<path stroke-linejoin="round" stroke="#aeaeae" stroke-width="1px" fill="none" d="M{xa},{ya} {xb},{yb} {xc},{yc} L{xd},{yd}"/>`,node:`<rect x="0" y="0" height="120" width="250" fill="none" stroke-width="1" stroke="#aeaeae" rx="7" ry="7"></rect>`,plus:function(e,t,n,r,i){var a=r.mode==`dark`?`#1E1E1E`:`#ffffff`;return`<g transform="matrix(1,0,0,1,${i.x-15},${i.y-15})"><circle cx="15" cy="15" r="15" fill="${a}" stroke="#aeaeae" stroke-width="1"></circle>
274
274
  <text text-anchor="middle" style="font-size: 14px;cursor:pointer;" fill="#aeaeae" x="15" y="21">${e.deepCollapsedChildCount}</text></g>`},minus:function(e,t,n,r,i){var a=r.mode==`dark`?`#1E1E1E`:`#ffffff`;return`<g transform="matrix(1,0,0,1,${i.x-15},${i.y-15})"><circle cx="15" cy="15" r="15" fill="${a}" stroke="#aeaeae" stroke-width="1"></circle>
275
275
  <line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#aeaeae"></line></g>`},nodeMenuButton:`<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,105)"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#ffffff"></circle><circle cx="7" cy="0" r="2" fill="#ffffff"></circle><circle cx="14" cy="0" r="2" fill="#ffffff"></circle></g>`,menuButton:`<div style="user-select:none;position:absolute;right:{p}px;top:{p}px; width:30px;height:50px;cursor:pointer;" `+e.attr.control_export_menu+`=""><hr style="background-color: #7A7A7A; height: 3px; border: none;"><hr style="background-color: #7A7A7A; height: 3px; border: none;"><hr style="background-color: #7A7A7A; height: 3px; border: none;"></div>`,img_0:`<clipPath id="{randId}"><circle cx="60" cy="60" r="40"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="20" y="20" width="80" height="80"></image>`,link_field_0:`<text text-anchor="middle" fill="#aeaeae" `+e.attr.width+`="290" x="0" y="0" style="font-size:10px;">{val}</text>`,editFormHeaderColor:`#039BE5`,treeListMaxHeight:500},e.templates.ana={defs:``,size:[250,120],linkAdjuster:{fromX:0,fromY:0,toX:0,toY:0},ripple:{radius:0,color:`#e6e6e6`,rect:null},expandCollapseSize:30,svg:`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:block;" width="{w}" height="{h}" viewBox="{viewBox}">{content}</svg>`,link:`<path class="boc-hoverable" stroke-linejoin="round" stroke="#aeaeae" stroke-width="1px" fill="none" d="{rounded}" />`,node:function(e,t,n,r){return`<rect class="boc-hoverable" x="0" y="0" height="${e.h}" width="${e.w}" fill="#039BE5" stroke-width="1" stroke="#aeaeae" rx="10" ry="10"></rect>`},plus:function(e,t,n,r,i){var a=r.mode==`dark`?`#1E1E1E`:`#ffffff`;return`<g transform="matrix(1,0,0,1,${i.x-15},${i.y-15})"><circle class="boc-hoverable" cx="15" cy="15" r="15" fill="${a}" stroke="#aeaeae" stroke-width="1"></circle>
276
276
  <text text-anchor="middle" style="font-size: 14px;cursor:pointer;" fill="#aeaeae" x="15" y="21">${e.deepCollapsedChildCount}</text></g>`},minus:function(e,t,n,r,i){var a=r.mode==`dark`?`#1E1E1E`:`#ffffff`;return`<g transform="matrix(1,0,0,1,${i.x-15},${i.y-15})"><circle class="boc-hoverable" cx="15" cy="15" r="15" fill="${a}" stroke="#aeaeae" stroke-width="1"></circle>
277
- <line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#aeaeae"></line></g>`},up:`<rect x="20" y="-25" width="30" height="17" fill="#aeaeae" rx="3" ry="3"></rect><line x1="35" x2="35" y1="0" y2="-8" stroke="#aeaeae" stroke-width="1"></line>`,nodeMenuButton:function(e,t,n,r){return`<g transform="matrix(1,0,0,1,${e.w-25},${e.h-15})"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#ffffff"></circle><circle cx="7" cy="0" r="2" fill="#ffffff"></circle><circle cx="14" cy="0" r="2" fill="#ffffff"></circle></g>`},menuButton:e.templates.base.menuButton,img_0:function(t,n,r,i,a){var o=50,s=30,c=40,l=e.randomId();return`<clipPath id="${l}"><circle cx="${o}" cy="${s}" r="${c}"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#${l})" xlink:href="${a}" x="${o-c}" y="${s-c}" width="${c*2}" height="${c*2}" ></image>`},link_field_0:`<text text-anchor="middle" fill="#aeaeae" `+e.attr.width+`="290" x="0" y="0" style="font-size:10px;">{val}</text>`,field_0:function(t,n,r,i,a){return e.wrapText(a,`<text style="font-size: 18px;" fill="#ffffff" x="${t.w/2}" y="${t.h-25}" text-anchor="middle"></text>`,t.w-20,1)},field_1:function(t,n,r,i,a){return e.wrapText(a,`<text style="font-size: 14px;" fill="#ffffff" x="${t.w-20}" y="30" text-anchor="end"></text>`,t.w-120,3)},padding:[75,5,50,5],editFormHeaderColor:`#039BE5`,treeListMaxHeight:500},e.templates.split=Object.assign({},e.templates.ana),e.templates.split.size=[10,10],e.templates.split.node=`<circle class="boc-hoverable" cx="5" cy="5" r="5" fill="none" stroke-width="1" stroke="#aeaeae"></circle>`,e.templates.split.field_0=``,e.templates.split.field_1=``,e.templates.split.img_0=``,e.templates.dot=Object.assign({},e.templates.split),e.templates.group=Object.assign({},e.templates.ana),e.templates.group.size=[250,120],e.templates.group.padding=[50,20,35,20],e.templates.group.node=`<rect rx="50" ry="50" x="0" y="0" height="{h}" width="{w}" fill="#f2f2f2" stroke-width="0"></rect>`,e.templates.group.link=`<path stroke="#aeaeae" stroke-width="1px" fill="none" d="M{xa},{ya} C{xb},{yb} {xc},{yc} {xd},{yd}"/>`,e.templates.group.nodeMenuButton=`<g style="cursor:pointer;" transform="matrix(1,0,0,1,{ew},25)"><g transform="matrix(1,0,0,1,-22,-8)"><rect x="0" y="0" fill="red" fill-opacity="0" width="18" height="22"></rect><line x1="0" y1="2" x2="9" y2="2" stroke="#aeaeae" stroke-width="1"></line><line x1="0" y1="9" x2="18" y2="9" stroke="#aeaeae" stroke-width="1"></line><line x1="0" y1="16" x2="22" y2="16" stroke="#aeaeae" stroke-width="1"></line></g></g>`,e.templates.group.field_0=`<text `+e.attr.width+`="230" style="font-size: 18px;" fill="#aeaeae" x="{cw}" y="30" text-anchor="middle">{val}</text>`,e.templates.group.field_1=``,e.templates.group.ripple={radius:50,color:`#aeaeae`},e.templates.invisibleGroup=Object.assign({},e.templates.group),e.templates.invisibleGroup.node=``,e.templates.invisibleGroup.padding=[0,0,0,0],e.templates.invisibleGroup.field_0=``,e.templates.invisibleGroup.nodeMenuButton=``,e.templates.mirror={linkAdjuster:{},link:``,node:``,nodeMenuButton:``,size:[0,0]},e.templates.ula=Object.assign({},e.templates.ana),e.templates.ula.field_0=function(t,n,r,i,a){return e.wrapText(a,`<text style="font-size: 18px;" fill="#039BE5" x="100" y="55"></text>`,t.w-105,1)},e.templates.ula.field_1=function(t,n,r,i,a){return e.wrapText(a,`<text data-text-overflow="multiline" style="font-size: 14px;" fill="#afafaf" x="100" y="76"></text>`,t.w-105,3)},e.templates.ula.node=function(e,t,n,r){return`<rect class="boc-hoverable" x="0" y="0" height="${e.h}" width="${e.w}" fill="#ffffff" stroke-width="1" stroke="#aeaeae"></rect><line class="boc-hoverable" x1="0" y1="0" x2="${e.w}" y2="0" stroke-width="2" stroke="#039BE5"></line>`},e.templates.ula.img_0=function(t,n,r,i,a){var o=50,s=60,c=40,l=e.randomId();return`<clipPath id="${l}"><circle cx="${o}" cy="${s}" r="${c}"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#${l})" xlink:href="${a}" x="${o-c}" y="${s-c}" width="${c*2}" height="${c*2}" ></image>`},e.templates.ula.menu=`<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,12)" `+e.attr.control_node_menu_id+`="{id}"><rect x="-4" y="-10" fill="#ffffff" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#039BE5"></circle><circle cx="7" cy="0" r="2" fill="#039BE5"></circle><circle cx="14" cy="0" r="2" fill="#039BE5"></circle></g>`,e.templates.ula.nodeMenuButton=function(e,t,n,r){return`<g transform="matrix(1,0,0,1,${e.w-25}, ${e.h-15})"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#AEAEAE"></circle><circle cx="7" cy="0" r="2" fill="#AEAEAE"></circle><circle cx="14" cy="0" r="2" fill="#AEAEAE"></circle></g>`},e.templates.ula.padding=[110,1,1,1],e.templates.olivia=Object.assign({},e.templates.ana),e.templates.olivia.defs=`<style>
277
+ <line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#aeaeae"></line></g>`},up:`<rect x="20" y="-25" width="30" height="17" fill="#aeaeae" rx="3" ry="3"></rect><line x1="35" x2="35" y1="0" y2="-8" stroke="#aeaeae" stroke-width="1"></line>`,nodeMenuButton:function(e,t,n,r){return`<g transform="matrix(1,0,0,1,${e.w-25},${e.h-15})"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#ffffff"></circle><circle cx="7" cy="0" r="2" fill="#ffffff"></circle><circle cx="14" cy="0" r="2" fill="#ffffff"></circle></g>`},menuButton:e.templates.base.menuButton,img_0:function(t,n,r,i,a){var o=50,s=30,c=40,l=e.randomId();return`<clipPath id="${l}"><circle cx="${o}" cy="${s}" r="${c}"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#${l})" xlink:href="${a}" x="${o-c}" y="${s-c}" width="${c*2}" height="${c*2}" ></image>`},link_field_0:`<text text-anchor="middle" fill="#aeaeae" `+e.attr.width+`="290" x="0" y="0" style="font-size:10px;">{val}</text>`,field_0:function(t,n,r,i,a){return e.wrapText(a,`<text style="font-size: 18px;" fill="#ffffff" x="${t.w/2}" y="${t.h-25}" text-anchor="middle"></text>`,t.w-20,1)},field_1:function(t,n,r,i,a){return e.wrapText(a,`<text style="font-size: 14px;" fill="#ffffff" x="${t.w-20}" y="30" text-anchor="end"></text>`,t.w-120,3)},padding:[75,5,50,5],editFormHeaderColor:`#039BE5`,treeListMaxHeight:500},e.templates.split=Object.assign({},e.templates.ana),e.templates.split.size=[10,10],e.templates.split.node=`<circle cx="5" cy="5" r="5" fill="none" stroke-width="1" stroke="#aeaeae"></circle>`,e.templates.split.field_0=``,e.templates.split.field_1=``,e.templates.split.img_0=``,e.templates.dot=Object.assign({},e.templates.split),e.templates.group=Object.assign({},e.templates.ana),e.templates.group.size=[250,120],e.templates.group.padding=[50,20,35,20],e.templates.group.node=`<rect rx="50" ry="50" x="0" y="0" height="{h}" width="{w}" fill="#f2f2f2" stroke-width="0"></rect>`,e.templates.group.link=`<path stroke="#aeaeae" stroke-width="1px" fill="none" d="M{xa},{ya} C{xb},{yb} {xc},{yc} {xd},{yd}"/>`,e.templates.group.nodeMenuButton=`<g style="cursor:pointer;" transform="matrix(1,0,0,1,{ew},25)"><g transform="matrix(1,0,0,1,-22,-8)"><rect x="0" y="0" fill="red" fill-opacity="0" width="18" height="22"></rect><line x1="0" y1="2" x2="9" y2="2" stroke="#aeaeae" stroke-width="1"></line><line x1="0" y1="9" x2="18" y2="9" stroke="#aeaeae" stroke-width="1"></line><line x1="0" y1="16" x2="22" y2="16" stroke="#aeaeae" stroke-width="1"></line></g></g>`,e.templates.group.field_0=`<text `+e.attr.width+`="230" style="font-size: 18px;" fill="#aeaeae" x="{cw}" y="30" text-anchor="middle">{val}</text>`,e.templates.group.field_1=``,e.templates.group.ripple={radius:50,color:`#aeaeae`},e.templates.invisibleGroup=Object.assign({},e.templates.group),e.templates.invisibleGroup.node=``,e.templates.invisibleGroup.padding=[0,0,0,0],e.templates.invisibleGroup.field_0=``,e.templates.invisibleGroup.nodeMenuButton=``,e.templates.mirror={linkAdjuster:{},link:``,node:``,nodeMenuButton:``,size:[0,0]},e.templates.ula=Object.assign({},e.templates.ana),e.templates.ula.field_0=function(t,n,r,i,a){return e.wrapText(a,`<text style="font-size: 18px;" fill="#039BE5" x="100" y="55"></text>`,t.w-105,1)},e.templates.ula.field_1=function(t,n,r,i,a){return e.wrapText(a,`<text data-text-overflow="multiline" style="font-size: 14px;" fill="#afafaf" x="100" y="76"></text>`,t.w-105,3)},e.templates.ula.node=function(e,t,n,r){return`<rect class="boc-hoverable" x="0" y="0" height="${e.h}" width="${e.w}" fill="#ffffff" stroke-width="1" stroke="#aeaeae"></rect><line class="boc-hoverable" x1="0" y1="0" x2="${e.w}" y2="0" stroke-width="2" stroke="#039BE5"></line>`},e.templates.ula.img_0=function(t,n,r,i,a){var o=50,s=60,c=40,l=e.randomId();return`<clipPath id="${l}"><circle cx="${o}" cy="${s}" r="${c}"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#${l})" xlink:href="${a}" x="${o-c}" y="${s-c}" width="${c*2}" height="${c*2}" ></image>`},e.templates.ula.menu=`<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,12)" `+e.attr.control_node_menu_id+`="{id}"><rect x="-4" y="-10" fill="#ffffff" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#039BE5"></circle><circle cx="7" cy="0" r="2" fill="#039BE5"></circle><circle cx="14" cy="0" r="2" fill="#039BE5"></circle></g>`,e.templates.ula.nodeMenuButton=function(e,t,n,r){return`<g transform="matrix(1,0,0,1,${e.w-25}, ${e.h-15})"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#AEAEAE"></circle><circle cx="7" cy="0" r="2" fill="#AEAEAE"></circle><circle cx="14" cy="0" r="2" fill="#AEAEAE"></circle></g>`},e.templates.ula.padding=[110,1,1,1],e.templates.olivia=Object.assign({},e.templates.ana),e.templates.olivia.defs=`<style>
278
278
  #olivia_gradient {
279
279
  --color-stop-1: #ffffff;
280
280
  --color-stop-2: #eeeeee;
@@ -307,7 +307,7 @@ var e=function(e,t){var n=this;Object.defineProperty(this,`element`,{get(){retur
307
307
  <circle cx="13" cy="6" r="2" fill="${i}"></circle>
308
308
  <circle cx="13" cy="13" r="2" fill="${i}"></circle>
309
309
  <circle cx="13" cy="20" r="2" fill="${i}"></circle>
310
- </g>`},e.templates.treeListItem.node=function(e,t,n,r){var i=``,a=`#FFFFFF`;if(e.isTreeListItem&&!e.stParent||e.isTreeListItem&&e.stParent&&e.stParent.stChildren[0]!=e){var o=`#E0E0E0`;r.mode==`dark`&&(o=`#444444`),i=`<line stroke="${o}" stroke-width="1" x1="0" x2="${e.w}" y1="0" y2="0"></line>`}return r.mode==`dark`&&(a=`#252526`),`<rect fill="${a}" x="0" y="0" height="${e.h}" width="${e.w}" rx="0" ry="0" ></rect>${i}`},e.ui={_defsIds:{},defs:function(t){var n=``;for(var r in e.templates){var i=e.templates[r];i.defs&&(e.ui._defsIds[r]=e.randomId(),n+=i.defs.replaceAll(`{randId}`,e.ui._defsIds[r]))}return`<defs>`+n+t+`</defs>`},lonely:function(t){return!t.nodes||!t.nodes.length?e.IT_IS_LONELY_HERE.replace(`{link}`,e.RES.IT_IS_LONELY_HERE_LINK):``},pointer:function(t,n,r){if(n===e.action.exporting)return``;var i=e.t(t.template,!1,r).pointer;return i||=``,i},aiButton:function(e){return e.enableAI?`<div data-boc-ai-button class="boc-ai-button">AI</div>`:``},node:function(t,n,r,i,a,o,s,c,l,u,d){var f=e.t(t.templateName,t.min,l),p=``;typeof f.node==`function`?p=f.node(t,n,f,i):e.isNEU(f.node)||(p=f.node,p&&=p.replaceAll(`{w}`,t.w).replaceAll(`{h}`,t.h)),f.defs&&(p=p.replaceAll(`{randId}`,e.ui._defsIds[t.templateName])),s??=i.nodeBinding;var m={node:t,data:n};for(var h in s){var g=s[h],_;n&&(_=n[g]),_??=t[g],m.element=f[h],m.value=_;var v=!1;typeof m.element==`function`&&(v=!0,m.element=m.element(t,n,f,i,m.value));var y=e._lblIsImg(i,h);if(m.name=g,m.field=h,e.events.publish(`field`,[u,m])!==!1&&m.value!=null&&m.value!=null&&m.element!=null){if(v)p+=m.element;else if(!y||y&&!e.isNEU(m.value)){if(!y&&typeof m.value==`string`){var b=m.element;b&&=b.replaceAll(`{ew}`,t.w-(t.padding?t.padding[1]:0)).replaceAll(`{cw}`,t.w/2),m.value=e.wrapText(m.value,b)}var x=m.element.replace(`{val}`,m.value);x=x.replaceAll(`{ew}`,t.w-(t.padding?t.padding[1]:0)).replaceAll(`{cw}`,t.w/2).replaceAll(`{randId}`,e.randomId()).replaceAll(`{randId2}`,e.randomId()),p+=x}}}var S=e._getPosition(r,t,a,o),C=`node`;Array.isArray(t.tags)&&t.tags.length&&(C+=` `+t.tags.join(` `)),t.layout&&(C+=` tree-layout`),d&&(C+=` treelist-pinned`);var w=``;t.lcn&&(w=`lcn="`+t.lcn+`"`);var T=e.nodeOpenTag.replace(`{lcn}`,w).replace(`{id}`,t.id).replace(`{class}`,C).replace(`{sl}`,t.sl).replace(`{level}`,t.level).replace(`{x}`,S.x).replace(`{y}`,S.y),E=e._getOpacity(r,t);return T=T.replace(`{opacity}`,E),p+=e.ui.nodeBtns(i,t,n,c,f,u),p=T+p+e.grCloseTag,p},nodeBtns:function(t,n,r,i,a,o){var s=``;return t.nodeMenu!=null&&!n.isSplit&&i!==e.action.exporting&&(typeof a.nodeMenuButton==`function`?s+=a.nodeMenuButton(n,r,a,t):e.isNEU(a.nodeMenuButton)||(s+=a.nodeMenuButton.replace(`{id}`,n.id).replace(`{cw}`,n.w/2).replace(`{ch}`,n.h/2).replace(`{ew}`,n.w-(n.padding?n.padding[1]:0)).replace(`{eh}`,n.h-(n.padding?n.padding[2]:0)))),s&&=`<g style="cursor:pointer;" ${e.attr.control_node_menu_id}="${n.id}">${s}</g>`,t.nodeCircleMenu!=null&&!n.isSplit&&i!==e.action.exporting&&(e.isNEU(a.nodeCircleMenuButton)||(s+=`<g style="cursor:pointer;" transform="matrix(1,0,0,1,`+a.nodeCircleMenuButton.x+`,`+a.nodeCircleMenuButton.y+`)" `+e.attr.control_node_circle_menu_id+`="`+n.id+`"><circle cx="0" cy="0" fill="`+a.nodeCircleMenuButton.color+`" r="`+a.nodeCircleMenuButton.radius+`" stroke-width="1" stroke="`+a.nodeCircleMenuButton.stroke+`"></circle><line x1="-`+a.nodeCircleMenuButton.radius/2+`" y1="-6" x2="`+a.nodeCircleMenuButton.radius/2+`" y2="-6" stroke-width="2" stroke="`+a.nodeCircleMenuButton.stroke+`"></line><line x1="-`+a.nodeCircleMenuButton.radius/2+`" y1="0" x2="`+a.nodeCircleMenuButton.radius/2+`" y2="0" stroke-width="2" stroke="`+a.nodeCircleMenuButton.stroke+`"></line><line x1="-`+a.nodeCircleMenuButton.radius/2+`" y1="6" x2="`+a.nodeCircleMenuButton.radius/2+`" y2="6" stroke-width="2" stroke="`+a.nodeCircleMenuButton.stroke+`"></line></g>`)),s},expandCollapseBtn:function(t,n,r,i,a,o,s){var c=``;if(o!==e.action.exporting&&!n.isSplit){var l=a[n.lcn?n.lcn:`base`],u=e.t(n.templateName,n.min,s);if(n.childrenIds.length>0){if(n.hasPartners){for(var d=!1,f=0;f<n.childrenIds.length;f++){var p=t.getNode(n.childrenIds[f]);p&&!p.parentPartner&&!p.isPartner&&(d=!0)}if(!d)return``}var m=e._getDefailtPositionForExpandCollpase(l,n),h={x:m.x+n.x-u.expandCollapseSize/2,y:m.y+n.y-u.expandCollapseSize/2},g=t.getCollapsedIds(n);g.length?(typeof u.plus==`function`?(c+=e.expcollOpenTag.replace(`{id}`,n.id).replace(`{x}`,n.x).replace(`{y}`,n.y),c+=u.plus(n,r,u,i,m)):(c+=e.expcollOpenTag.replace(`{id}`,n.id).replace(`{x}`,h.x).replace(`{y}`,h.y),c+=u.plus),c+=e.grCloseTag):(typeof u.minus==`function`?(c+=e.expcollOpenTag.replace(`{id}`,n.id).replace(`{x}`,n.x).replace(`{y}`,n.y),c+=u.minus(n,r,u,i,m)):(c+=e.expcollOpenTag.replace(`{id}`,n.id).replace(`{x}`,h.x).replace(`{y}`,h.y),c+=u.minus),c+=e.grCloseTag),(g.length&&typeof u.plus!=`function`||!g.length&&typeof u.minus!=`function`)&&(c.indexOf(`{collapsed-children-count}`)!=-1&&(c=c.replace(`{collapsed-children-count}`,n.collapsedChildCount)),c.indexOf(`{collapsed-children-total-count}`)!=-1&&(c=c.replace(`{collapsed-children-total-count}`,n.deepCollapsedChildCount)),c.indexOf(`{children-count}`)!=-1&&(c=c.replace(`{children-count}`,n.childCount)),c.indexOf(`{children-total-count}`)!=-1&&(c=c.replace(`{children-total-count}`,n.deepChildCount)))}t._nodeHasHiddenParent(n)&&(c+=e.upOpenTag.replace(`{id}`,n.id).replace(`{x}`,n.x).replace(`{y}`,n.y),c+=u.up,c+=e.grCloseTag)}var _={html:c,node:n};return e.events.publish(`renderbuttons`,[t,_]),_.html},link:function(t,n,r,i,a,o,s){var c=t.lcn?t.lcn:`base`,l=n._layoutConfigs[c],u=e.t(t.templateName,t.min,r),d=[],f=[],p=0,m=l.levelSeparation/2;t.layout>0&&(m=l.mixedHierarchyNodesSeparation/2);var h=0,g=e.getRootOf(t).id,_=i[g][t.sl],v=void 0;if(t.hasPartners){v={ids:[],indexes:{},ppnodes:{},lastLeft:null,firstRight:null,maxSidePartnersWithChildren:0,rightIds:[],leftIds:[],partnerChildrenSplitSeparation:n.config.partnerChildrenSplitSeparation};for(var y=0;y<t.children.length;y++){var b=t.children[y];b.parentPartner?(v.ppnodes[b.id]=b.parentPartner,v.ids.push(b.id),b.parentPartner.isPartner==1?(v.rightIds.indexOf(b.parentPartner.id)==-1&&v.rightIds.push(b.parentPartner.id),v.indexes[b.id]=v.rightIds.indexOf(b.parentPartner.id),v.firstRight||=b):b.parentPartner.isPartner==2&&(v.leftIds.indexOf(b.parentPartner.id)==-1&&v.leftIds.push(b.parentPartner.id),v.indexes[b.id]=v.leftIds.indexOf(b.parentPartner.id),v.lastLeft=b)):b.isPartner||(v.lastLeft=b,v.firstRight||=b)}v.maxSidePartnersWithChildren=Math.max(v.leftIds.length,v.rightIds.length),h=v.maxSidePartnersWithChildren==0?n.config.minPartnerSeparation/2:n.config.minPartnerSeparation/2+v.partnerChildrenSplitSeparation*v.maxSidePartnersWithChildren+v.partnerChildrenSplitSeparation/2}for(var y=0;y<t.children.length;y++){var b=t.children[y],x=i[g][b.sl],S={xa:0,ya:0,xb:0,yb:0,xc:0,yc:0,xd:0,yd:0,x:0,y:0,rotate:0};u=e.t(b.templateName,b.min,r);var C=u.link;if(b.isChildOfPartner)switch(l.orientation){case e.orientation.top:case e.orientation.top_left:var w=b.layout==1?void 0:x.minY-(x.minY-_.maxY)/2;S=e.ui._linkTopToBottom(b.parentPartner,b,u,m,w,n);break;case e.orientation.bottom:case e.orientation.bottom_left:var w=b.layout==1?void 0:x.maxY-(x.maxY-_.minY)/2;S=e.ui._linkBottomToTop(b.parentPartner,b,u,m,w,n);break;case e.orientation.right:case e.orientation.right_top:var w=b.layout==1?void 0:x.maxX-(x.maxX-_.minX)/2;S=e.ui._linkRightToLeft(b.parentPartner,b,u,m,w,n);break;case e.orientation.left:case e.orientation.left_top:var w=b.layout==1?void 0:x.minX-(x.minX-_.maxX)/2;S=e.ui._linkLeftToRight(b.parentPartner,b,u,m,w,n);break}else if(v&&v.ids.indexOf(b.id)!=-1)switch(l.orientation){case e.orientation.top:case e.orientation.top_left:S=e.ui._linkPpTop(v,t,b,x,_,u);break;case e.orientation.bottom:case e.orientation.bottom_left:S=e.ui._linkPpBottom(v,t,b,x,_,u);break;case e.orientation.right:case e.orientation.right_top:S=e.ui._linkPpRight(v,t,b,x,_,u);break;case e.orientation.left:case e.orientation.left_top:S=e.ui._linkPpLeft(v,t,b,x,_,u);break}else{var T=b.isAssistant&&b.rightNeighbor&&b.rightNeighbor.isAssistant&&b.parent==b.rightNeighbor.parent,E=b.isAssistant&&b.leftNeighbor&&b.leftNeighbor.isAssistant&&b.parent==b.leftNeighbor.parent;if((T||b.layout>1)&&b.rightNeighbor&&b.rightNeighbor.isSplit)switch(l.orientation){case e.orientation.top:case e.orientation.top_left:S=e.ui._linkRightToLeft(b.rightNeighbor,b,u,m);break;case e.orientation.bottom:case e.orientation.bottom_left:S=e.ui._linkRightToLeft(b.rightNeighbor,b,u,m);break;case e.orientation.right:case e.orientation.right_top:S=e.ui._linkBottomToTop(b.rightNeighbor,b,u,m);break;case e.orientation.left:case e.orientation.left_top:S=e.ui._linkBottomToTop(b.rightNeighbor,b,u,m);break}else if((E||b.layout>1)&&b.leftNeighbor&&b.leftNeighbor.isSplit)switch(l.orientation){case e.orientation.top:case e.orientation.top_left:S=e.ui._linkLeftToRight(b.leftNeighbor,b,u,m,n);break;case e.orientation.bottom:case e.orientation.bottom_left:S=e.ui._linkLeftToRight(b.leftNeighbor,b,u,m,n);break;case e.orientation.right:case e.orientation.right_top:S=e.ui._linkTopToBottom(b.leftNeighbor,b,u,m,n);break;case e.orientation.left:case e.orientation.left_top:S=e.ui._linkTopToBottom(b.leftNeighbor,b,u,m,n);break}else switch(l.orientation){case e.orientation.top:case e.orientation.top_left:if(b.isPartner==1)S=e.ui._linkLeftToRight(t,b,u,h);else if(b.isPartner==2)S=e.ui._linkRightToLeft(t,b,u,h);else{var w=b.layout==1?void 0:x.minY-(x.minY-_.maxY)/2;S=e.ui._linkTopToBottom(t,b,u,m,w,n)}break;case e.orientation.bottom:case e.orientation.bottom_left:if(b.isPartner==1)S=e.ui._linkLeftToRight(t,b,u,h);else if(b.isPartner==2)S=e.ui._linkRightToLeft(t,b,u,h);else{var w=b.layout==1?void 0:x.maxY-(x.maxY-_.minY)/2;S=e.ui._linkBottomToTop(t,b,u,m,w,n)}break;case e.orientation.right:case e.orientation.right_top:if(b.isPartner==1)S=e.ui._linkTopToBottom(t,b,u,h);else if(b.isPartner==2)S=e.ui._linkBottomToTop(t,b,u,h);else{var w=b.layout==1?void 0:x.maxX-(x.maxX-_.minX)/2;S=e.ui._linkRightToLeft(t,b,u,m,w,n)}break;case e.orientation.left:case e.orientation.left_top:if(b.isPartner==1)S=e.ui._linkTopToBottom(t,b,u,h);else if(b.isPartner==2)S=e.ui._linkBottomToTop(t,b,u,h);else{var w=b.layout==1?void 0:x.minX-(x.minX-_.maxX)/2;S=e.ui._linkLeftToRight(t,b,u,m,w,n)}break}}var D,O=e.ui._draggableLinkPath(n,t,b,S,m,l.orientation);if(O)D=O,C=C.replaceAll(`{rounded}`,O).replaceAll(`{edge}`,O).replaceAll(`{curve}`,D);else if(C.indexOf(`{rounded}`)!=-1)if(S.xa==S.xb&&S.xa==S.xc&&S.xa==S.xd||S.ya==S.yb&&S.ya==S.yc&&S.ya==S.yd)D=`M`+S.xa+`,`+S.ya+` L`+S.xd+`,`+S.yd,C=C.replaceAll(`{rounded}`,D);else if(Math.abs(S.xa-S.xd)<=e.LINK_ROUNDED_CORNERS&&Math.abs(S.xa-S.xc)<=e.LINK_ROUNDED_CORNERS&&Math.abs(S.xa-S.xb)<=e.LINK_ROUNDED_CORNERS)D=`M`+S.xa+`,`+S.ya+` L`+S.xa+`,`+S.yd,C=C.replaceAll(`{rounded}`,D);else if(Math.abs(S.ya-S.yd)<=e.LINK_ROUNDED_CORNERS&&Math.abs(S.ya-S.yc)<=e.LINK_ROUNDED_CORNERS&&Math.abs(S.ya-S.yb)<=e.LINK_ROUNDED_CORNERS)D=`M`+S.xa+`,`+S.ya+` L`+S.xd+`,`+S.ya,C=C.replaceAll(`{rounded}`,D);else{var k=e.ui._roundedEdge(S.xa,S.ya,S.xb,S.yb,S.xc,S.yc),A=e.ui._roundedEdge(S.xb,S.yb,S.xc,S.yc,S.xd,S.yd);D=`M`+k.x1+`,`+k.y1+` `+k.x2+`,`+k.y2+` Q`+k.qx1+`,`+k.qy1+` `+k.qx2+`,`+k.qy2+` L`+A.x2+`,`+A.y2+` Q`+A.qx1+`,`+A.qy1+` `+A.qx2+`,`+A.qy2+` L`+A.x3+`,`+A.y3,C=C.replaceAll(`{rounded}`,D)}else C.indexOf(`{edge}`)==-1?C.indexOf(`{curve}`)==-1?(D=C.replaceAll(`{xa}`,S.xa).replaceAll(`{ya}`,S.ya).replaceAll(`{xb}`,S.xb).replaceAll(`{yb}`,S.yb).replaceAll(`{xc}`,S.xc).replaceAll(`{yc}`,S.yc).replaceAll(`{xd}`,S.xd).replaceAll(`{yd}`,S.yd),C=D):(D=`M`+S.xa+`,`+S.ya+` C`+S.xb+`,`+S.yb+` `+S.xc+`,`+S.yc+` `+S.xd+`,`+S.yd,C=C.replaceAll(`{curve}`,D)):(D=`M`+S.xa+`,`+S.ya+` `+S.xb+`,`+S.yb+` `+S.xc+`,`+S.yc+` L`+S.xd+`,`+S.yd,C=C.replaceAll(`{edge}`,D));d.push(e.linkOpenTag.replaceAll(`{id}`,t.id).replaceAll(`{class}`,`link `+b.tags.join(` `)).replaceAll(`{child-id}`,b.id));var j={node:t,cnode:b,p:S,html:C,action:o};e.events.publish(`render-link`,[n,j]),d.push(j.html),s&&f.push({id:t.id,childId:b.id,html:j.html});var M=``;for(var N in n.config.linkBinding){var P=n.config.linkBinding[N],F=n._get(b.id);F&&(j.value=F[P],j.element=u[N],j.name=P,e.events.publish(`label`,[n,j])!==!1&&!e.isNEU(j.value)&&!e.isNEU(j.element)&&(M+=j.element.replace(`{val}`,j.value)))}if(M!=``){var I=S.x,ee=S.y;b.movey!=null&&(ee+=b.movey),M=e.linkFieldsOpenTag.replace(`{x}`,I).replace(`{y}`,ee).replace(`{rotate}`,p)+M+e.grCloseTag,d.push(M)}d.push(e.grCloseTag)}return s?f:d.join(``)},svg:function(t,n,r,i,a,o){return e.t(i.template,!1,o).svg.replace(`{w}`,t).replace(`{h}`,n).replace(`{viewBox}`,r).replace(`{randId}`,e.ui._defsIds[i.template]).replace(`{mode}`,i.mode).replace(`{template}`,i.template).replace(`{content}`,function(){return a})},menuButton:function(t){return t.menu==null?``:e.t(t.template,!1).menuButton.replaceAll(`{p}`,t.padding)},_roundedEdge:function(t,n,r,i,a,o){var s=e.LINK_ROUNDED_CORNERS,c,l,u,d=0;return t==r&&t==a||n==i&&n==o?(c=u=r,l=d=i):(t!=a&&r==a&&(c=u=r,l=i,n<o?d=i+s:n>o&&(d=i-s)),t<a&&r==a?r-=s:t>a&&r==a&&(r+=s),n!=o&&i==o&&(c=r,l=d=i,t<a?u=r+s:t>a&&(u=r-s)),n<o&&i==o?i-=s:n>o&&i==o&&(i+=s)),{x1:t,y1:n,x2:r,y2:i,x3:a,y3:o,qx1:c,qy1:l,qx2:u,qy2:d}},_linkTopToBottom:function(t,n,r,i,a,o){var s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0;s=t.x+t.w/2+r.linkAdjuster.toX,c=t.y+t.h+r.linkAdjuster.toY,p=d=n.x+n.w/2+r.linkAdjuster.fromX,m=n.y+r.linkAdjuster.fromY,l=s,u=f=t.rightNeighbor&&t.rightNeighbor.isAssistant&&n.templateName==`split`?t.rightNeighbor.y+t.rightNeighbor.h+i:t.templateName==`split`&&(n.isAssistant||n.layout>1)?m:n.templateName==`split`?c+i:a??m-i,h=d,g=e.isNEU(n.parentPartner)?f+16:f;var v={xa:s,ya:c,xb:l,yb:u,xc:d,yc:f,xd:p,yd:m,x:h,y:g,rotate:_};return o&&e._addConnectorLines(o._connectorLines,v),v},_linkBottomToTop:function(t,n,r,i,a,o){var s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0;s=t.x+t.w/2+r.linkAdjuster.toX,c=t.y+r.linkAdjuster.toY,p=d=n.x+n.w/2+r.linkAdjuster.fromX,m=n.y+n.h+r.linkAdjuster.fromY,l=s,u=f=t.rightNeighbor&&t.rightNeighbor.isAssistant&&n.templateName==`split`?t.rightNeighbor.y-i:t.templateName==`split`&&(n.isAssistant||n.layout>1)?m:n.templateName==`split`?c-i:a??m+i,h=d,g=f-14;var v={xa:s,ya:c,xb:l,yb:u,xc:d,yc:f,xd:p,yd:m,x:h,y:g,rotate:_};return o&&e._addConnectorLines(o._connectorLines,v),v},_linkRightToLeft:function(t,n,r,i,a,o){var s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0;s=t.x+r.linkAdjuster.toX,c=t.y+t.h/2+r.linkAdjuster.toY,p=n.x+n.w+r.linkAdjuster.fromX,m=f=n.y+n.h/2+r.linkAdjuster.fromY,u=c,l=d=t.rightNeighbor&&t.rightNeighbor.isAssistant&&n.templateName==`split`?t.rightNeighbor.x-i:t.templateName==`split`&&(n.isAssistant||n.layout>1)?p:n.templateName==`split`?s-i:a??p+i,h=d-16,g=f,_=90;var v={xa:s,ya:c,xb:l,yb:u,xc:d,yc:f,xd:p,yd:m,x:h,y:g,rotate:_};return o&&e._addConnectorLines(o._connectorLines,v),v},_linkLeftToRight:function(t,n,r,i,a,o){var s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0;s=t.x+t.w+r.linkAdjuster.toX,c=t.y+t.h/2+r.linkAdjuster.toY,p=n.x+r.linkAdjuster.fromX,m=f=n.y+n.h/2+r.linkAdjuster.fromY,u=c,l=d=t.rightNeighbor&&t.rightNeighbor.isAssistant&&n.templateName==`split`?t.rightNeighbor.x+t.rightNeighbor.w+i:t.templateName==`split`&&(n.isAssistant||n.layout>1)?p:n.templateName==`split`?s+i:a??p-i,h=d+14,g=f,_=270;var v={xa:s,ya:c,xb:l,yb:u,xc:d,yc:f,xd:p,yd:m,x:h,y:g,rotate:_};return o&&e._addConnectorLines(o._connectorLines,v),v},_linkPpTop:function(t,n,r,i,a,o){var s=t.ppnodes[r.id],c=s.y+s.h/2,l=i.minY-(i.minY-a.maxY)/2,u=(i.minY-a.maxY)/t.maxSidePartnersWithChildren/4,d=e.ui.__linkPpBottomTop(t,n,r,l,u,s),f=d.x;return l=d.mid,e.ui._linkTopToBottom({x:f,y:c,w:0,h:0},r,o,0,l)},_linkPpBottom:function(t,n,r,i,a,o){var s=t.ppnodes[r.id],c=s.y+s.h/2,l=i.maxY-(i.maxY-a.minY)/2,u=(i.maxY-a.minY)/t.maxSidePartnersWithChildren/4,d=e.ui.__linkPpBottomTop(t,n,r,l,u,s),f=d.x;return l=d.mid,e.ui._linkBottomToTop({x:f,y:c,w:0,h:0},r,o,0,l)},_linkPpLeft:function(t,n,r,i,a,o){var s=t.ppnodes[r.id],c=i.minX-(i.minX-a.maxX)/2,l=(i.minX-a.maxX)/t.maxSidePartnersWithChildren/4,u=s.x+s.w/2,d=e.ui.__linkPpLeftRight(t,n,r,c,l,s),f=d.y;return c=d.mid,e.ui._linkLeftToRight({x:u,y:f,w:0,h:0},r,o,0,c)},_linkPpRight:function(t,n,r,i,a,o){var s=t.ppnodes[r.id],c=i.maxX-(i.maxX-a.minX)/2,l=(i.maxX-a.minX)/t.maxSidePartnersWithChildren/4,u=s.x+s.w/2,d=e.ui.__linkPpLeftRight(t,n,r,c,l,s),f=d.y;return c=d.mid,e.ui._linkRightToLeft({x:u,y:f,w:0,h:0},r,o,0,c)},__linkPpBottomTop:function(e,t,n,r,i,a){var o=0;return a.isPartner==1?(o=a.x-t.partnerSeparation/2+e.indexes[n.id]*e.partnerChildrenSplitSeparation-(e.rightIds.length-1)*e.partnerChildrenSplitSeparation/2,e.lastLeft&&o<e.lastLeft.x+e.lastLeft.w/2?o<n.x+n.w/2?r-=(e.indexes[n.id]+1)*i:r-=(e.rightIds.length-e.indexes[n.id])*i:o<n.x+n.w/2?r+=(e.rightIds.length-e.indexes[n.id])*i:r+=(e.indexes[n.id]+1)*i):a.isPartner==2&&(o=a.x+a.w+t.partnerSeparation/2+e.indexes[n.id]*e.partnerChildrenSplitSeparation-(e.leftIds.length-1)*e.partnerChildrenSplitSeparation/2,e.firstRight&&o>e.firstRight.x+e.firstRight.w/2?o<n.x+n.w/2?r-=(e.indexes[n.id]+1)*i:r-=(e.leftIds.length-e.indexes[n.id])*i:o<n.x+n.w/2?r+=(e.leftIds.length-e.indexes[n.id])*i:r+=(e.indexes[n.id]+1)*i),{x:o,mid:r}},__linkPpLeftRight:function(e,t,n,r,i,a){var o=0;return a.isPartner==1?(o=a.y-t.partnerSeparation/2+e.indexes[n.id]*e.partnerChildrenSplitSeparation-(e.rightIds.length-1)*e.partnerChildrenSplitSeparation/2,e.lastLeft&&o<e.lastLeft.y+e.lastLeft.h/2?o<n.y+n.h/2?r-=(e.indexes[n.id]+1)*i:r-=(e.rightIds.length-e.indexes[n.id])*i:o<n.y+n.h/2?r+=(e.rightIds.length-e.indexes[n.id])*i:r+=(e.indexes[n.id]+1)*i):a.isPartner==2&&(o=a.y+a.h+t.partnerSeparation/2+e.indexes[n.id]*e.partnerChildrenSplitSeparation-(e.leftIds.length-1)*e.partnerChildrenSplitSeparation/2,e.firstRight&&o>e.firstRight.y+e.firstRight.h/2?o<n.y+n.h/2?r-=(e.indexes[n.id]+1)*i:r-=(e.leftIds.length-e.indexes[n.id])*i:o<n.y+n.h/2?r+=(e.leftIds.length-e.indexes[n.id])*i:r+=(e.indexes[n.id]+1)*i),{y:o,mid:r}},_draggableLinkPath:function(t,n,r,i,a,o){if(r.isSubLevel||n.isSubLevel||r.leftNeighbor&&r.leftNeighbor.isSplit||r.rightNeighbor&&r.rightNeighbor.isSplit||r.isPartner||r.isAssistant)return null;if(e._isMoved(r)&&!e._isMoved(n)){var s,c,l=[];switch(o){case e.orientation.top:case e.orientation.top_left:if(i.yb+a/2<i.yd)return null;s=i.xa<i.xd?r.x-a/2:r.x+r.w+a/2,c=r.y-a/2;break;case e.orientation.bottom:case e.orientation.bottom_left:if(i.yb-a/2>i.yd)return null;s=i.xa<i.xd?r.x-a/2:r.x+r.w+a/2,c=r.y+r.h+a/2;break;case e.orientation.right:case e.orientation.right_top:if(i.xb-a/2>i.xd)return null;c=i.ya<i.yd?r.y-a/2:r.y+r.h+a/2,s=r.x+r.w+a/2;break;case e.orientation.left:case e.orientation.left_top:if(i.xb+a/2<i.xd)return null;c=i.ya<i.yd?r.y-a/2:r.y+r.h+a/2,s=r.x-a/2;break}switch(o){case e.orientation.top:case e.orientation.top_left:case e.orientation.bottom:case e.orientation.bottom_left:l.push([`M`,i.xa,i.ya]),l.push([`L`,i.xb,i.yb]),l.push([`L`,s,i.yb]),l.push([`L`,s,c]),l.push([`L`,i.xd,c]),l.push([`L`,i.xd,i.yd]);break;case e.orientation.right:case e.orientation.right_top:case e.orientation.left:case e.orientation.left_top:var l=[];l.push([`M`,i.xa,i.ya]),l.push([`L`,i.xb,i.yb]),l.push([`L`,i.xb,c]),l.push([`L`,s,c]),l.push([`L`,s,i.yd]),l.push([`L`,i.xd,i.yd]);break}return e.roundPathCorners(l,e.LINK_ROUNDED_CORNERS,!1)}else if(!e._isMoved(r)&&e._isMoved(n)){var s,c,u=!1,l=[];switch(o){case e.orientation.top:case e.orientation.top_left:if(i.ya+a/2>i.yb)u=!0,s=i.xa<i.xd?n.x+n.w+a/2:n.x-a/2,c=n.y+n.h+a;else if(i.yb+a/2<i.yd)return null;else s=i.xa<i.xd?r.x-a/2:r.x+r.w+a/2,c=r.y-a/2;break;case e.orientation.bottom:case e.orientation.bottom_left:if(i.ya-a/2<i.yb)u=!0,s=i.xa<i.xd?n.x+n.w+a/2:n.x-a/2,c=n.y-a;else if(i.yb-a/2>i.yd)return null;else s=i.xa<i.xd?r.x-a/2:r.x+r.w+a/2,c=r.y+r.h+a/2;break;case e.orientation.right:case e.orientation.right_top:if(i.xa-a/2<i.xb)u=!0,c=i.ya<i.yd?n.y+n.h+a/2:n.y-a/2,s=n.x-a;else if(i.xb-a/2>i.xd)return null;else c=i.ya<i.yd?r.y-a/2:r.y+r.h+a/2,s=r.x+r.w+a/2;break;case e.orientation.left:case e.orientation.left_top:if(i.xa+a/2>i.xb)u=!0,c=i.ya<i.yd?n.y+n.h+a/2:n.y-a/2,s=n.x+n.w+a;else if(i.xb+a/2<i.xd)return null;else c=i.ya<i.yd?r.y-a/2:r.y+r.h+a/2,s=r.x-a/2;break}if(u)switch(o){case e.orientation.top:case e.orientation.top_left:case e.orientation.bottom:case e.orientation.bottom_left:l.push([`M`,i.xa,i.ya]),l.push([`L`,i.xa,c]),l.push([`L`,s,c]),l.push([`L`,s,i.yc]),l.push([`L`,i.xc,i.yc]),l.push([`L`,i.xd,i.yd]);break;case e.orientation.right:case e.orientation.right_top:case e.orientation.left:case e.orientation.left_top:l.push([`M`,i.xa,i.ya]),l.push([`L`,s,i.ya]),l.push([`L`,s,c]),l.push([`L`,i.xc,c]),l.push([`L`,i.xc,i.yc]),l.push([`L`,i.xd,i.yd]);break}else switch(o){case e.orientation.top:case e.orientation.top_left:case e.orientation.bottom:case e.orientation.bottom_left:l.push([`M`,i.xa,i.ya]),l.push([`L`,i.xb,i.yb]),l.push([`L`,s,i.yb]),l.push([`L`,s,c]),l.push([`L`,i.xd,c]),l.push([`L`,i.xd,i.yd]);break;case e.orientation.right:case e.orientation.right_top:case e.orientation.left:case e.orientation.left_top:l.push([`M`,i.xa,i.ya]),l.push([`L`,i.xb,i.yb]),l.push([`L`,i.xb,c]),l.push([`L`,s,c]),l.push([`L`,s,i.yd]),l.push([`L`,i.xd,i.yd]);break}return e.roundPathCorners(l,e.LINK_ROUNDED_CORNERS,!1)}else if(e._isMoved(r)&&e._isMoved(n)){var l=[];switch(o){case e.orientation.top:case e.orientation.top_left:if(i.ya+a>i.yd){var s=i.xa<i.xd?n.x+n.w+a/2:n.x-a/2,c=n.y+n.h+a,d=r.y-a;l.push([`M`,i.xa,i.ya]),l.push([`L`,i.xa,c]),l.push([`L`,s,c]),l.push([`L`,s,d]),l.push([`L`,i.xc,d]),l.push([`L`,i.xd,i.yd])}else l.push([`M`,i.xa,i.ya]),l.push([`L`,i.xa,n.y+n.h+a]),l.push([`L`,i.xc,n.y+n.h+a]),l.push([`L`,i.xd,i.yd]);break;case e.orientation.bottom:case e.orientation.bottom_left:if(i.ya-a<i.yd){var s=i.xa<i.xd?n.x+n.w+a/2:n.x-a/2,c=n.y-a,d=r.y+r.h+a;l.push([`M`,i.xa,i.ya]),l.push([`L`,i.xa,c]),l.push([`L`,s,c]),l.push([`L`,s,d]),l.push([`L`,i.xc,d]),l.push([`L`,i.xd,i.yd])}else l.push([`M`,i.xa,i.ya]),l.push([`L`,i.xa,n.y-a]),l.push([`L`,i.xc,n.y-a]),l.push([`L`,i.xd,i.yd]);break;case e.orientation.right:case e.orientation.right_top:if(i.xa-a<i.xd){var c=i.ya<i.yd?n.y+n.h+a/2:n.y-a/2,s=n.x-a,f=r.x+r.w+a;l.push([`M`,i.xa,i.ya]),l.push([`L`,s,i.ya]),l.push([`L`,s,c]),l.push([`L`,f,c]),l.push([`L`,f,i.yc]),l.push([`L`,i.xd,i.yd])}else l.push([`M`,i.xa,i.ya]),l.push([`L`,n.x-a,i.ya]),l.push([`L`,n.x-a,i.yc]),l.push([`L`,i.xd,i.yd]);break;case e.orientation.left:case e.orientation.left_top:if(i.xa+a>i.xd){var c=i.ya<i.yd?n.y+n.h+a/2:n.y-a/2,s=n.x+n.w+a,f=r.x-a;l.push([`M`,i.xa,i.ya]),l.push([`L`,s,i.ya]),l.push([`L`,s,c]),l.push([`L`,f,c]),l.push([`L`,f,i.yc]),l.push([`L`,i.xd,i.yd])}else l.push([`M`,i.xa,i.ya]),l.push([`L`,n.x+n.w+a,i.ya]),l.push([`L`,n.x+n.w+a,i.yc]),l.push([`L`,i.xd,i.yd]);break}return e.roundPathCorners(l,e.LINK_ROUNDED_CORNERS,!1)}return null}},e===void 0&&(e={}),e._validateConfig=function(e){if(!e)console.error(`config is not defined`);else return!0;return!1},e._arrayContains=function(e,t){if(e&&Array.isArray(e)){for(var n=e.length;n--;)if(e[n]===t)return!0}return!1},e._interceptions=function(e,t){if(!e||!t)return[];var n=[];if(Array.isArray(e)&&Array.isArray(t))for(var r in e)for(var i in t)e[r]==t[i]&&n.push(e[r]);else if(Array.isArray(e)&&!Array.isArray(t))for(var r in e)for(var i in t)e[r]==i&&n.push(e[r]);else if(!Array.isArray(e)&&Array.isArray(t))for(var r in e)for(var i in t)r==t[i]&&n.push(t[i]);return n},e._getTags=function(e){return e.tags&&!Array.isArray(e.tags)?e.tags.split(`,`):e.tags&&Array.isArray(e.tags)?e.tags:[]},e._centerPointInPercent=function(e,t,n){var r=e.getBoundingClientRect(),i=t-r.left,a=n-r.top;return[i/(r.width/100),a/(r.height/100)]},e._trim=function(e){return e.replace(/^\s+|\s+$/g,``)},e._getTransform=function(t){var n=t.getAttribute(`transform`);return n=n.replace(`matrix`,``).replace(`(`,``).replace(`)`,``),e._browser().msie&&(n=n.replace(/ /g,`,`)),n=e._trim(n),n=`[`+n+`]`,n=JSON.parse(n),n},e.getScale=function(t,n,r,i,a,o,s,c){var l=1;if(!t&&(i===e.match.boundary||i===e.match.boundaryIfOutside)){var u=n/s,d=r/c;l=u>d?d:u,i===e.match.boundaryIfOutside&&l>1&&(l=1)}else if(!t&&i===e.match.width)l=n/s;else if(!t&&i===e.match.height)l=r/c;else if(!t)l=i;else{var u=n/t[2],d=r/t[3];l=u>d?d:u}return l&&l>a&&(l=a),l&&l<o&&(l=o),l},e.isObject=function(e){return e&&typeof e==`object`&&!Array.isArray(e)&&e!==null&&e.constructor&&e.constructor.name.toLowerCase()==`object`},e.fileUploadDialog=function(e){var t=document.createElement(`INPUT`);t.setAttribute(`type`,`file`),t.style.display=`none`,t.onchange=function(){var t=this.files[0];e(t)},document.body.appendChild(t),t.click()},e.mergeDeep=function(t,n){if(e.isObject(t)&&e.isObject(n))for(var r in n)e.isObject(n[r])?(t[r]||Object.assign(t,{[r]:{}}),e.mergeDeep(t[r],n[r])):Object.assign(t,{[r]:n[r]});return t},e._lblIsImg=function(e,t){return!!(e.nodeBinding&&typeof t==`string`&&t.indexOf(`img`)!=-1&&e.nodeBinding[t])},e._getFistImgField=function(e){if(e.nodeBinding){for(var t in e.nodeBinding)if(t.indexOf(`img`)!=-1)return e.nodeBinding[t]}return!1},e._fieldIsImg=function(t,n){if(t.nodeBinding){for(var r in t.nodeBinding)if(t.nodeBinding[r]==n)return e._lblIsImg(t,r)}return!1},e._guid=function(){function e(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return e()+e()+`-`+e()+`-`+e()+`-`+e()+`-`+e()+e()+e()},e.htmlRipple=function(e){var t=document.createElement(`style`);t.type=`text/css`,t.innerHTML=` .boc-ripple-container {position: absolute; top: 0; right: 0; bottom: 0; left: 0; } .boc-ripple-container span {transform: scale(0);border-radius:100%;position:absolute;opacity:0.75;background-color:#fff;animation: boc-ripple 1000ms; }@-moz-keyframes boc-ripple {to {opacity: 0;transform: scale(2);}}@-webkit-keyframes boc-ripple {to {opacity: 0;transform: scale(2);}}@-o-keyframes boc-ripple {to {opacity: 0;transform: scale(2);}}@keyframes boc-ripple {to {opacity: 0;transform: scale(2);}}`,document.head.appendChild(t);var n=function(e,t){var n=void 0;return function(){var r,i=this;return r=arguments,clearTimeout(n),n=setTimeout(function(){return e.apply(i,r)},t)}},r=function(t){var n,r=this,i=document.createElement(`span`),a=r.offsetWidth,o,s,c;return n=r.getBoundingClientRect(),s=t.pageX-n.left-a/2,c=t.pageY-n.top-a/2,o=`top:`+c+`px; left: `+s+`px; height: `+a+`px; width: `+a+`px;`,e.rippleContainer.appendChild(i),i.setAttribute(`style`,o)},i=function(){for(;this.rippleContainer.firstChild;)this.rippleContainer.removeChild(this.rippleContainer.firstChild)},a=document.createElement(`div`);a.className=`boc-ripple-container`,e.addEventListener(`mousedown`,r),e.addEventListener(`mouseup`,n(i,2e3)),e.rippleContainer=a,e.appendChild(a)},e._moveToBoundaryArea=function(t,n,r,i){var a=n.slice(0);n[0]<r.left&&n[0]<r.right&&(a[0]=r.left>r.right?r.right:r.left),n[0]>r.right&&n[0]>r.left&&(a[0]=r.left>r.right?r.left:r.right),n[1]<r.top&&n[1]<r.bottom&&(a[1]=r.top>r.bottom?r.bottom:r.top),n[1]>r.bottom&&n[1]>r.top&&(a[1]=r.top>r.bottom?r.top:r.bottom),n[0]!==a[0]||n[1]!==a[1]?e.animate(t,{viewBox:n},{viewBox:a},300,e.anim.outPow,function(){i&&i()}):i&&i()},e.randomId=function(){return`_`+(`0000`+(Math.random()*36**4|0).toString(36)).slice(-4)},e._getClientXY=function(e){if(e.type.indexOf(`touch`)!=-1){if(e.changedTouches.length)return{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}}else return{x:e.clientX,y:e.clientY}},e._getClientTouchesXY=function(e,t){return e.type.indexOf(`touch`)==-1?{x:e.clientX,y:e.clientY}:e.touches.length<t+1?{x:null,y:null}:{x:e.touches[t].clientX,y:e.touches[t].clientY}},e._getOffset=function(t,n){t&&(n.x+=t.offsetLeft,n.y+=t.offsetTop,e._getOffset(t.offsetParent,n))},e._getTopLeft=function(t){var n={x:0,y:0};return e._getOffset(t,n),n},e._getOffsetXY=function(t,n){if(n.type.indexOf(`touch`)!=-1){if(n.touches.length){var r=e._getTopLeft(t);return{x:n.touches[0].pageX-r.x,y:n.touches[0].pageY-r.y}}else if(n.changedTouches.length){var r=e._getTopLeft(t);return isNaN(r.x)||isNaN(r.y)?{x:n.changedTouches[0].pageX,y:n.changedTouches[0].pageY}:{x:n.changedTouches[0].pageX-r.x,y:n.changedTouches[0].pageY-r.y}}}else return{x:n.offsetX,y:n.offsetY}},e._pinchMiddlePointInPercent=function(t,n,r,i){var a=e._getTopLeft(t),o=i.touches[0].pageX-a.x,s=i.touches[0].pageY-a.y,c=i.touches[1].pageX-a.x,l=i.touches[1].pageY-a.y;return[((o-c)/2+c)/(n/100),((s-l)/2+l)/(r/100)]},e._browser=function(){var e=!!window.opr&&!!window.opr.addons||!!window.opera||navigator.userAgent.indexOf(` OPR/`)>=0,t=typeof InstallTrigger<`u`,n=/constructor/i.test(window.HTMLElement)||(function(e){return e.toString()===`[object SafariRemoteNotification]`})(!window.safari||window.safari!==void 0&&safari.pushNotification),r=!!document.documentMode,i=!r&&!!window.StyleMedia,a=!!window.chrome&&(!!window.chrome.webstore||!!window.chrome.runtime);return{opera:e,firefox:t,safari:n,msie:r,edge:i,chrome:a,blink:(a||e)&&!!window.CSS}},e._menuPosition=function(e,t,n){var r=e.getBoundingClientRect(),i=n.getBoundingClientRect(),a=t.getBoundingClientRect(),o=r.left-i.left,s=r.top-i.top;return r.top+a.height>i.top+i.height&&(s-=a.height),r.left-a.width<i.left&&(o+=a.width),{x:o,y:s}},e._getTemplate=function(e,t,n){if(Array.isArray(e))for(var r=0;r<e.length;r++){var i=t[e[r]];if(i&&i.template)return i.template}return n},e._getMin=function(e,t){if(e.tags&&e.tags.length&&t.tags)for(var n=0;n<e.tags.length;n++){var r=t.tags[e.tags[n]];if(r&&r.min===!0)return!0}return t.min},e._getSubLevels=function(e,t){if(e&&e.length)for(var n=0;n<e.length;n++){var r=t[e[n]];if(r&&r.subLevels)return r.subLevels}return 0},e._isHTML=function(e){var t=new DOMParser().parseFromString(e,`text/html`);return Array.from(t.body.childNodes).some(e=>e.nodeType===1)},e._getTestDiv=function(){var e=document.getElementById(`orgchart_js_test_div`);return e||(e=document.createElement(`div`),e.id=`orgchart_js_test_div`,e.style.position=`fixed`,e.style.top=`-10000px`,e.style.left=`-10000px`,document.body.appendChild(e)),e},e._getLabelSize=function(t){var n=e._getTestDiv();return n.innerHTML=`<svg>`+t+`</svg>`,n.querySelector(`text`).getBoundingClientRect()},e.wrapText=function(t,n,r,i){if(r!=null&&i!=null)return e._lineClamp(n,t,r,i);var a=n,o=a.toLowerCase();if(o.indexOf(`<text`)==-1||o.indexOf(e.attr.width)==-1||o.indexOf(`foreignobject`)!=-1||a.indexOf(e.attr.width)==-1||e.ESCAPE_HTML&&typeof str==`string`&&e._isHTML(t))return e._escapeHtml(t);if(!e.ESCAPE_HTML&&e._isHTML(t))return t;var s=e._getTestDiv();a=a.replaceAll(`{cw}`,0),s.innerHTML=`<svg>`+a+`</svg>`;var c=new DOMParser().parseFromString(a,`text/xml`).getElementsByTagName(`text`)[0],l=parseFloat(c.getAttribute(`x`)),u=parseFloat(c.getAttribute(`y`)),d=c.getAttribute(`text-anchor`),r=c.getAttribute(e.attr.width),f=c.getAttribute(e.attr.text_overflow),p=`http://www.w3.org/2000/svg`,m=s.getElementsByTagName(`svg`)[0].getElementsByTagName(`text`)[0],i,h;f||=`ellipsis`;var g=f.split(`-`);if(g.length>1&&(i=parseInt(f.split(`-`)[1]),g.length>2&&g[2]==`ellipsis`&&(h=!0)),!r)return e._escapeHtml(t);if(r=parseFloat(r),l||=0,u||=0,l||(d=`start`),f==`ellipsis`){m.removeChild(m.firstChild),m.textContent=t;for(var _=m.getComputedTextLength(),v=2;_>r;)m.textContent=t.substring(0,t.length-v),m.textContent+=`...`,_=m.getComputedTextLength(),v++;return v>2?`<title>${e._escapeHtml(t)}</title>${m.textContent}`:e._escapeHtml(t)}else if(f.indexOf(`multiline`)!=-1){var y=t.split(` `),b=m.getBBox().height;m.textContent=``;var x=document.createElementNS(p,`tspan`),S=document.createTextNode(y[0]);x.setAttributeNS(null,`x`,l),x.setAttributeNS(null,`y`,u),x.setAttributeNS(null,`text-anchor`,d),x.appendChild(S),m.appendChild(x);for(var v=1,C=1,w=!1,T=1;T<y.length;T++){var E=x.firstChild.data.length;if(x.firstChild.data+=` `+y[T],x.getComputedTextLength()>r){if(x.firstChild.data=x.firstChild.data.slice(0,E),C++,i&&C>i){if(h&&m.children.length==i){var D=m.children[i-1].textContent;m.children[i-1].textContent=D.substring(0,D.length-3)+`...`,w=!0}break}var x=document.createElementNS(p,`tspan`);x.setAttributeNS(null,`x`,l),x.setAttributeNS(null,`y`,u+b*v),x.setAttributeNS(null,`text-anchor`,d),S=document.createTextNode(y[T]),x.appendChild(S),m.appendChild(x),v++}}var O=``;if(m.innerHTML!=null)O=m.innerHTML,m.innerHTML=``;else{for(var k=``,T=m.childNodes.length-1;T>=0;T--)k=XMLSerializer().serializeToString(m.childNodes[T])+k,m.removeChild(m.childNodes[T]);O=k}return w?`<title>${e._escapeHtml(t)}</title>${O}`:O}},e._downloadFile=function(e,t,n,r,i){var a=new Blob([t],{type:e});if(r==1){var o=URL.createObjectURL(a);window.open(o,`_blank`).focus()}else if(navigator.msSaveBlob)navigator.msSaveBlob(a,n);else{var s=document.createElement(`a`);if(s.download!==void 0){var o=URL.createObjectURL(a);s.setAttribute(`href`,o);var c=n;c.toLowerCase().endsWith(i.toLowerCase())||(c=c+`.`+i),s.setAttribute(`download`,c),s.style.visibility=`hidden`,document.body.appendChild(s),s.click(),document.body.removeChild(s)}}},e._getPosition=function(e,t,n,r){var i={x:t.x,y:t.y};if(n!=null&&(i.x=n),r!=null&&(i.y=n),e&&e.length==3){var a=e[0].indexOf(t.id);a!=-1&&e[1][a].transform!=null&&(n??(i.x=e[1][a].transform[4]),r??(i.y=e[1][a].transform[5]))}return i},e._getOpacity=function(e,t){var n=1;if(e&&e.length==3){var r=e[0].indexOf(t.id);r!=-1&&e[1][r].opacity!=null&&(n=e[1][r].opacity)}return n},e.t=function(t,n,r){var i=e.templates[t];i??console.error(`Template "${t}" does not exist!`);var a=null;if(r!=null&&i.scaleLessThen){var o=[];for(var s in i.scaleLessThen){var c=parseFloat(s);r<c&&o.push(c)}if(o.length>0){o.sort(function(e,t){return e-t});var l=i.scaleLessThen[o[0]];for(var u in l)a??=Object.assign({},i),a[u]=l[u]}}return n?a==null?i.min?i.min:i:a.min?a.min:a:a??i},e.setNodeSize=function(t){var n=e.t(t.templateName,t.min);t.w=n&&n.size?n.size[0]:0,t.h=n&&n.size?n.size[1]:0},e._imgs2base64=function(t,n,r,i){var a=t.getElementsByTagName(n),o=a.length;o==0&&i();for(var s=0;s<o;s++)(function(){var t=s,n=a[t];e._getDataUri(n.getAttribute(r),function(e){e.success&&n.setAttribute(r,e.result),t==o-1&&i()})})()},e._getDataUri=function(e,t){if(e.indexOf(`base64`)!=-1)t({success:!1});else{var n=new XMLHttpRequest;n.open(`GET`,e),n.responseType=`blob`,n.onload=function(){n.status===200?r.readAsDataURL(n.response):n.status===404&&t({success:!1,result:n.status})};var r=new FileReader;r.onloadend=function(){t({success:!0,result:r.result})},n.send()}},e._convertStringToArray=function(t,n){return e.ARRAY_FIELDS.indexOf(t)==-1?n:e.isNEU(n)?[]:n.split(`,`)},e._convertArrayToString=function(t){return!e.isNEU(t)&&Array.isArray(t)?t.join():t},e._csvToArray=function(t,n){n||=e.CSV_DELIMITER;for(var r=RegExp(`(\\`+n+`|\\r?\\n|\\r|^)(?:"([^"]*(?:""[^"]*)*)"|([^"\\`+n+`\\r\\n]*))`,`gi`),i=[[]],a=null;a=r.exec(t);){var o=a[1];o.length&&o!==n&&i.push([]);var s=a[2]?a[2].replace(RegExp(`""`,`g`),`"`):a[3];i[i.length-1].push(s)}return i},e._json2xml=function(t){for(var n=document.implementation.createDocument(``,``,null),r=n.createElement(`nodes`),i=0;i<t.length;i++){var a=n.createElement(`node`),o=t[i];for(var s in o){var c=o[s];a.setAttribute(s,e._convertArrayToString(c))}r.appendChild(a)}return n.appendChild(r),`<?xml version="1.0" encoding="utf-8" ?>`+new XMLSerializer().serializeToString(n.documentElement)},e._xml2json=function(t){for(var n=new DOMParser().parseFromString(t,`text/xml`).getElementsByTagName(`node`),r=[],i=0;i<n.length;i++){for(var a=n[i],o={},s=0;s<a.attributes.length;s++){var c=a.attributes[s];o[c.name]=e._convertStringToArray(c.name,c.value)}r.push(o)}return r},e.convertNodesToCsv=function(t){return e._json2csv(t)},e._json2csv=function(t){for(var n=[],r=function(t){for(var r=``,i=0;i<n.length;i++){var a=n[i]==`reportsTo`?null:t[n[i]]==null?``:t[n[i]];a instanceof Date&&(a=a.toLocaleString()),a=a===null?``:a.toString();var o=a.replace(/"/g,`""`),s=RegExp(`("|;|
310
+ </g>`},e.templates.treeListItem.node=function(e,t,n,r){var i=``,a=`#FFFFFF`;if(e.isTreeListItem&&!e.stParent||e.isTreeListItem&&e.stParent&&e.stParent.stChildren[0]!=e){var o=`#E0E0E0`;r.mode==`dark`&&(o=`#444444`),i=`<line stroke="${o}" stroke-width="1" x1="0" x2="${e.w}" y1="0" y2="0"></line>`}return r.mode==`dark`&&(a=`#252526`),`<rect fill="${a}" x="0" y="0" height="${e.h}" width="${e.w}" rx="0" ry="0" ></rect>${i}`},e.ui={_defsIds:{},defs:function(t){var n=``;for(var r in e.templates){var i=e.templates[r];i.defs&&(e.ui._defsIds[r]=e.randomId(),n+=i.defs.replaceAll(`{randId}`,e.ui._defsIds[r]))}return`<defs>`+n+t+`</defs>`},lonely:function(t){return!t.nodes||!t.nodes.length?e.IT_IS_LONELY_HERE.replace(`{link}`,e.RES.IT_IS_LONELY_HERE_LINK):``},pointer:function(t,n,r){if(n===e.action.exporting)return``;var i=e.t(t.template,!1,r).pointer;return i||=``,i},aiButton:function(e){return e.enableAI?`<div data-boc-ai-button class="boc-ai-button">AI</div>`:``},node:function(t,n,r,i,a,o,s,c,l,u,d){var f=e.t(t.templateName,t.min,l),p=``;typeof f.node==`function`?p=f.node(t,n,f,i):e.isNEU(f.node)||(p=f.node,p&&=p.replaceAll(`{w}`,t.w).replaceAll(`{h}`,t.h)),f.defs&&(p=p.replaceAll(`{randId}`,e.ui._defsIds[t.templateName])),s??=i.nodeBinding;var m={node:t,data:n};for(var h in s){var g=s[h],_;n&&(_=n[g]),_??=t[g],m.element=f[h],m.value=_;var v=!1;typeof m.element==`function`&&(v=!0,m.element=m.element(t,n,f,i,m.value));var y=e._lblIsImg(i,h);if(m.name=g,m.field=h,e.events.publish(`field`,[u,m])!==!1&&m.value!=null&&m.value!=null&&m.element!=null){if(v)p+=m.element;else if(!y||y&&!e.isNEU(m.value)){if(!y&&typeof m.value==`string`){var b=m.element;b&&=b.replaceAll(`{ew}`,t.w-(t.padding?t.padding[1]:0)).replaceAll(`{cw}`,t.w/2),m.value=e.wrapText(m.value,b)}var x=m.element.replace(`{val}`,m.value);x=x.replaceAll(`{ew}`,t.w-(t.padding?t.padding[1]:0)).replaceAll(`{cw}`,t.w/2).replaceAll(`{randId}`,e.randomId()).replaceAll(`{randId2}`,e.randomId()),p+=x}}}var S=e._getPosition(r,t,a,o),C=`node`;Array.isArray(t.tags)&&t.tags.length&&(C+=` `+t.tags.join(` `)),t.layout&&(C+=` tree-layout`),d&&(C+=` treelist-pinned`);var w=``;t.lcn&&(w=`lcn="`+t.lcn+`"`);var T=e.nodeOpenTag.replace(`{lcn}`,w).replace(`{id}`,t.id).replace(`{class}`,C).replace(`{sl}`,t.sl).replace(`{level}`,t.level).replace(`{x}`,S.x).replace(`{y}`,S.y),E=e._getOpacity(r,t);return T=T.replace(`{opacity}`,E),p+=e.ui.nodeBtns(i,t,n,c,f,u),p=T+p+e.grCloseTag,p},nodeBtns:function(t,n,r,i,a,o){var s=``;return t.nodeMenu!=null&&!n.isSplit&&i!==e.action.exporting&&(typeof a.nodeMenuButton==`function`?s+=a.nodeMenuButton(n,r,a,t):e.isNEU(a.nodeMenuButton)||(s+=a.nodeMenuButton.replace(`{id}`,n.id).replace(`{cw}`,n.w/2).replace(`{ch}`,n.h/2).replace(`{ew}`,n.w-(n.padding?n.padding[1]:0)).replace(`{eh}`,n.h-(n.padding?n.padding[2]:0)))),s&&=`<g style="cursor:pointer;" ${e.attr.control_node_menu_id}="${n.id}">${s}</g>`,t.nodeCircleMenu!=null&&!n.isSplit&&i!==e.action.exporting&&(e.isNEU(a.nodeCircleMenuButton)||(s+=`<g style="cursor:pointer;" transform="matrix(1,0,0,1,`+a.nodeCircleMenuButton.x+`,`+a.nodeCircleMenuButton.y+`)" `+e.attr.control_node_circle_menu_id+`="`+n.id+`"><circle cx="0" cy="0" fill="`+a.nodeCircleMenuButton.color+`" r="`+a.nodeCircleMenuButton.radius+`" stroke-width="1" stroke="`+a.nodeCircleMenuButton.stroke+`"></circle><line x1="-`+a.nodeCircleMenuButton.radius/2+`" y1="-6" x2="`+a.nodeCircleMenuButton.radius/2+`" y2="-6" stroke-width="2" stroke="`+a.nodeCircleMenuButton.stroke+`"></line><line x1="-`+a.nodeCircleMenuButton.radius/2+`" y1="0" x2="`+a.nodeCircleMenuButton.radius/2+`" y2="0" stroke-width="2" stroke="`+a.nodeCircleMenuButton.stroke+`"></line><line x1="-`+a.nodeCircleMenuButton.radius/2+`" y1="6" x2="`+a.nodeCircleMenuButton.radius/2+`" y2="6" stroke-width="2" stroke="`+a.nodeCircleMenuButton.stroke+`"></line></g>`)),s},expandCollapseBtn:function(t,n,r,i,a,o,s){var c=``;if(o!==e.action.exporting&&!n.isSplit){var l=a[n.lcn?n.lcn:`base`],u=e.t(n.templateName,n.min,s);if(n.childrenIds.length>0){if(n.hasPartners){for(var d=!1,f=0;f<n.childrenIds.length;f++){var p=t.getNode(n.childrenIds[f]);p&&!p.parentPartner&&!p.isPartner&&(d=!0)}if(!d)return``}var m=e._getDefailtPositionForExpandCollpase(l,n),h={x:m.x+n.x-u.expandCollapseSize/2,y:m.y+n.y-u.expandCollapseSize/2},g=t.getCollapsedIds(n);g.length?(typeof u.plus==`function`?(c+=e.expcollOpenTag.replace(`{id}`,n.id).replace(`{x}`,n.x).replace(`{y}`,n.y),c+=u.plus(n,r,u,i,m)):(c+=e.expcollOpenTag.replace(`{id}`,n.id).replace(`{x}`,h.x).replace(`{y}`,h.y),c+=u.plus),c+=e.grCloseTag):(typeof u.minus==`function`?(c+=e.expcollOpenTag.replace(`{id}`,n.id).replace(`{x}`,n.x).replace(`{y}`,n.y),c+=u.minus(n,r,u,i,m)):(c+=e.expcollOpenTag.replace(`{id}`,n.id).replace(`{x}`,h.x).replace(`{y}`,h.y),c+=u.minus),c+=e.grCloseTag),(g.length&&typeof u.plus!=`function`||!g.length&&typeof u.minus!=`function`)&&(c.indexOf(`{collapsed-children-count}`)!=-1&&(c=c.replace(`{collapsed-children-count}`,n.collapsedChildCount)),c.indexOf(`{collapsed-children-total-count}`)!=-1&&(c=c.replace(`{collapsed-children-total-count}`,n.deepCollapsedChildCount)),c.indexOf(`{children-count}`)!=-1&&(c=c.replace(`{children-count}`,n.childCount)),c.indexOf(`{children-total-count}`)!=-1&&(c=c.replace(`{children-total-count}`,n.deepChildCount)))}t._nodeHasHiddenParent(n)&&(c+=e.upOpenTag.replace(`{id}`,n.id).replace(`{x}`,n.x).replace(`{y}`,n.y),c+=u.up,c+=e.grCloseTag)}var _={html:c,node:n};return e.events.publish(`renderbuttons`,[t,_]),_.html},link:function(t,n,r,i,a,o,s){var c=t.lcn?t.lcn:`base`,l=n._layoutConfigs[c],u=e.t(t.templateName,t.min,r),d=[],f=[],p=0,m=l.levelSeparation/2;t.layout>0&&(m=l.mixedHierarchyNodesSeparation/2);var h=0,g=e.getRootOf(t).id,_=i[g][t.sl],v=void 0;if(t.hasPartners){v={ids:[],indexes:{},ppnodes:{},lastLeft:null,firstRight:null,maxSidePartnersWithChildren:0,rightIds:[],leftIds:[],partnerChildrenSplitSeparation:n.config.partnerChildrenSplitSeparation};for(var y=0;y<t.children.length;y++){var b=t.children[y];b.parentPartner?(v.ppnodes[b.id]=b.parentPartner,v.ids.push(b.id),b.parentPartner.isPartner==1?(v.rightIds.indexOf(b.parentPartner.id)==-1&&v.rightIds.push(b.parentPartner.id),v.indexes[b.id]=v.rightIds.indexOf(b.parentPartner.id),v.firstRight||=b):b.parentPartner.isPartner==2&&(v.leftIds.indexOf(b.parentPartner.id)==-1&&v.leftIds.push(b.parentPartner.id),v.indexes[b.id]=v.leftIds.indexOf(b.parentPartner.id),v.lastLeft=b)):b.isPartner||(v.lastLeft=b,v.firstRight||=b)}v.maxSidePartnersWithChildren=Math.max(v.leftIds.length,v.rightIds.length),h=v.maxSidePartnersWithChildren==0?n.config.minPartnerSeparation/2:n.config.minPartnerSeparation/2+v.partnerChildrenSplitSeparation*v.maxSidePartnersWithChildren+v.partnerChildrenSplitSeparation/2}for(var y=0;y<t.children.length;y++){var b=t.children[y],x=i[g][b.sl],S={xa:0,ya:0,xb:0,yb:0,xc:0,yc:0,xd:0,yd:0,x:0,y:0,rotate:0},C=b.templateName;b.isSplit&&(b.leftNeighbor&&!b.leftNeighbor.isMirror&&b.leftNeighbor.pid==b.pid?C=b.leftNeighbor.templateName:b.rightNeighbor&&!b.rightNeighbor.isMirror&&b.rightNeighbor.pid==b.pid&&(C=b.rightNeighbor.templateName)),u=e.t(C,b.min,r);var w=u.link;if(b.isChildOfPartner)switch(l.orientation){case e.orientation.top:case e.orientation.top_left:var T=b.layout==1?void 0:x.minY-(x.minY-_.maxY)/2;S=e.ui._linkTopToBottom(b.parentPartner,b,u,m,T,n);break;case e.orientation.bottom:case e.orientation.bottom_left:var T=b.layout==1?void 0:x.maxY-(x.maxY-_.minY)/2;S=e.ui._linkBottomToTop(b.parentPartner,b,u,m,T,n);break;case e.orientation.right:case e.orientation.right_top:var T=b.layout==1?void 0:x.maxX-(x.maxX-_.minX)/2;S=e.ui._linkRightToLeft(b.parentPartner,b,u,m,T,n);break;case e.orientation.left:case e.orientation.left_top:var T=b.layout==1?void 0:x.minX-(x.minX-_.maxX)/2;S=e.ui._linkLeftToRight(b.parentPartner,b,u,m,T,n);break}else if(v&&v.ids.indexOf(b.id)!=-1)switch(l.orientation){case e.orientation.top:case e.orientation.top_left:S=e.ui._linkPpTop(v,t,b,x,_,u);break;case e.orientation.bottom:case e.orientation.bottom_left:S=e.ui._linkPpBottom(v,t,b,x,_,u);break;case e.orientation.right:case e.orientation.right_top:S=e.ui._linkPpRight(v,t,b,x,_,u);break;case e.orientation.left:case e.orientation.left_top:S=e.ui._linkPpLeft(v,t,b,x,_,u);break}else{var E=b.isAssistant&&b.rightNeighbor&&b.rightNeighbor.isAssistant&&b.parent==b.rightNeighbor.parent,D=b.isAssistant&&b.leftNeighbor&&b.leftNeighbor.isAssistant&&b.parent==b.leftNeighbor.parent;if((E||b.layout>1)&&b.rightNeighbor&&b.rightNeighbor.isSplit)switch(l.orientation){case e.orientation.top:case e.orientation.top_left:S=e.ui._linkRightToLeft(b.rightNeighbor,b,u,m);break;case e.orientation.bottom:case e.orientation.bottom_left:S=e.ui._linkRightToLeft(b.rightNeighbor,b,u,m);break;case e.orientation.right:case e.orientation.right_top:S=e.ui._linkBottomToTop(b.rightNeighbor,b,u,m);break;case e.orientation.left:case e.orientation.left_top:S=e.ui._linkBottomToTop(b.rightNeighbor,b,u,m);break}else if((D||b.layout>1)&&b.leftNeighbor&&b.leftNeighbor.isSplit)switch(l.orientation){case e.orientation.top:case e.orientation.top_left:S=e.ui._linkLeftToRight(b.leftNeighbor,b,u,m,n);break;case e.orientation.bottom:case e.orientation.bottom_left:S=e.ui._linkLeftToRight(b.leftNeighbor,b,u,m,n);break;case e.orientation.right:case e.orientation.right_top:S=e.ui._linkTopToBottom(b.leftNeighbor,b,u,m,n);break;case e.orientation.left:case e.orientation.left_top:S=e.ui._linkTopToBottom(b.leftNeighbor,b,u,m,n);break}else switch(l.orientation){case e.orientation.top:case e.orientation.top_left:if(b.isPartner==1)S=e.ui._linkLeftToRight(t,b,u,h);else if(b.isPartner==2)S=e.ui._linkRightToLeft(t,b,u,h);else{var T=b.layout==1?void 0:x.minY-(x.minY-_.maxY)/2;S=e.ui._linkTopToBottom(t,b,u,m,T,n)}break;case e.orientation.bottom:case e.orientation.bottom_left:if(b.isPartner==1)S=e.ui._linkLeftToRight(t,b,u,h);else if(b.isPartner==2)S=e.ui._linkRightToLeft(t,b,u,h);else{var T=b.layout==1?void 0:x.maxY-(x.maxY-_.minY)/2;S=e.ui._linkBottomToTop(t,b,u,m,T,n)}break;case e.orientation.right:case e.orientation.right_top:if(b.isPartner==1)S=e.ui._linkTopToBottom(t,b,u,h);else if(b.isPartner==2)S=e.ui._linkBottomToTop(t,b,u,h);else{var T=b.layout==1?void 0:x.maxX-(x.maxX-_.minX)/2;S=e.ui._linkRightToLeft(t,b,u,m,T,n)}break;case e.orientation.left:case e.orientation.left_top:if(b.isPartner==1)S=e.ui._linkTopToBottom(t,b,u,h);else if(b.isPartner==2)S=e.ui._linkBottomToTop(t,b,u,h);else{var T=b.layout==1?void 0:x.minX-(x.minX-_.maxX)/2;S=e.ui._linkLeftToRight(t,b,u,m,T,n)}break}}var O,k=e.ui._draggableLinkPath(n,t,b,S,m,l.orientation);if(k)O=k,w=w.replaceAll(`{rounded}`,k).replaceAll(`{edge}`,k).replaceAll(`{curve}`,O);else if(w.indexOf(`{rounded}`)!=-1)if(S.xa==S.xb&&S.xa==S.xc&&S.xa==S.xd||S.ya==S.yb&&S.ya==S.yc&&S.ya==S.yd)O=`M`+S.xa+`,`+S.ya+` L`+S.xd+`,`+S.yd,w=w.replaceAll(`{rounded}`,O);else if(Math.abs(S.xa-S.xd)<=e.LINK_ROUNDED_CORNERS&&Math.abs(S.xa-S.xc)<=e.LINK_ROUNDED_CORNERS&&Math.abs(S.xa-S.xb)<=e.LINK_ROUNDED_CORNERS)O=`M`+S.xa+`,`+S.ya+` L`+S.xa+`,`+S.yd,w=w.replaceAll(`{rounded}`,O);else if(Math.abs(S.ya-S.yd)<=e.LINK_ROUNDED_CORNERS&&Math.abs(S.ya-S.yc)<=e.LINK_ROUNDED_CORNERS&&Math.abs(S.ya-S.yb)<=e.LINK_ROUNDED_CORNERS)O=`M`+S.xa+`,`+S.ya+` L`+S.xd+`,`+S.ya,w=w.replaceAll(`{rounded}`,O);else{var A=e.ui._roundedEdge(S.xa,S.ya,S.xb,S.yb,S.xc,S.yc),j=e.ui._roundedEdge(S.xb,S.yb,S.xc,S.yc,S.xd,S.yd);O=`M`+A.x1+`,`+A.y1+` `+A.x2+`,`+A.y2+` Q`+A.qx1+`,`+A.qy1+` `+A.qx2+`,`+A.qy2+` L`+j.x2+`,`+j.y2+` Q`+j.qx1+`,`+j.qy1+` `+j.qx2+`,`+j.qy2+` L`+j.x3+`,`+j.y3,w=w.replaceAll(`{rounded}`,O)}else w.indexOf(`{edge}`)==-1?w.indexOf(`{curve}`)==-1?(O=w.replaceAll(`{xa}`,S.xa).replaceAll(`{ya}`,S.ya).replaceAll(`{xb}`,S.xb).replaceAll(`{yb}`,S.yb).replaceAll(`{xc}`,S.xc).replaceAll(`{yc}`,S.yc).replaceAll(`{xd}`,S.xd).replaceAll(`{yd}`,S.yd),w=O):(O=`M`+S.xa+`,`+S.ya+` C`+S.xb+`,`+S.yb+` `+S.xc+`,`+S.yc+` `+S.xd+`,`+S.yd,w=w.replaceAll(`{curve}`,O)):(O=`M`+S.xa+`,`+S.ya+` `+S.xb+`,`+S.yb+` `+S.xc+`,`+S.yc+` L`+S.xd+`,`+S.yd,w=w.replaceAll(`{edge}`,O));d.push(e.linkOpenTag.replaceAll(`{id}`,t.id).replaceAll(`{class}`,`link `+b.tags.join(` `)).replaceAll(`{child-id}`,b.id));var M={node:t,cnode:b,p:S,html:w,action:o};e.events.publish(`render-link`,[n,M]),d.push(M.html),s&&f.push({id:t.id,childId:b.id,html:M.html});var N=``;for(var P in n.config.linkBinding){var F=n.config.linkBinding[P],I=n._get(b.id);I&&(M.value=I[F],M.element=u[P],M.name=F,e.events.publish(`label`,[n,M])!==!1&&!e.isNEU(M.value)&&!e.isNEU(M.element)&&(N+=M.element.replace(`{val}`,M.value)))}if(N!=``){var ee=S.x,L=S.y;b.movey!=null&&(L+=b.movey),N=e.linkFieldsOpenTag.replace(`{x}`,ee).replace(`{y}`,L).replace(`{rotate}`,p)+N+e.grCloseTag,d.push(N)}d.push(e.grCloseTag)}return s?f:d.join(``)},svg:function(t,n,r,i,a,o){return e.t(i.template,!1,o).svg.replace(`{w}`,t).replace(`{h}`,n).replace(`{viewBox}`,r).replace(`{randId}`,e.ui._defsIds[i.template]).replace(`{mode}`,i.mode).replace(`{template}`,i.template).replace(`{content}`,function(){return a})},menuButton:function(t){return t.menu==null?``:e.t(t.template,!1).menuButton.replaceAll(`{p}`,t.padding)},_roundedEdge:function(t,n,r,i,a,o){var s=e.LINK_ROUNDED_CORNERS,c,l,u,d=0;return t==r&&t==a||n==i&&n==o?(c=u=r,l=d=i):(t!=a&&r==a&&(c=u=r,l=i,n<o?d=i+s:n>o&&(d=i-s)),t<a&&r==a?r-=s:t>a&&r==a&&(r+=s),n!=o&&i==o&&(c=r,l=d=i,t<a?u=r+s:t>a&&(u=r-s)),n<o&&i==o?i-=s:n>o&&i==o&&(i+=s)),{x1:t,y1:n,x2:r,y2:i,x3:a,y3:o,qx1:c,qy1:l,qx2:u,qy2:d}},_linkTopToBottom:function(t,n,r,i,a,o){var s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0;s=t.x+t.w/2+r.linkAdjuster.toX,c=t.y+t.h+r.linkAdjuster.toY,p=d=n.x+n.w/2+r.linkAdjuster.fromX,m=n.y+r.linkAdjuster.fromY,l=s,u=f=t.rightNeighbor&&t.rightNeighbor.isAssistant&&n.templateName==`split`?t.rightNeighbor.y+t.rightNeighbor.h+i:t.templateName==`split`&&(n.isAssistant||n.layout>1)?m:n.templateName==`split`?c+i:a??m-i,h=d,g=e.isNEU(n.parentPartner)?f+16:f;var v={xa:s,ya:c,xb:l,yb:u,xc:d,yc:f,xd:p,yd:m,x:h,y:g,rotate:_};return o&&e._addConnectorLines(o._connectorLines,v),v},_linkBottomToTop:function(t,n,r,i,a,o){var s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0;s=t.x+t.w/2+r.linkAdjuster.toX,c=t.y+r.linkAdjuster.toY,p=d=n.x+n.w/2+r.linkAdjuster.fromX,m=n.y+n.h+r.linkAdjuster.fromY,l=s,u=f=t.rightNeighbor&&t.rightNeighbor.isAssistant&&n.templateName==`split`?t.rightNeighbor.y-i:t.templateName==`split`&&(n.isAssistant||n.layout>1)?m:n.templateName==`split`?c-i:a??m+i,h=d,g=f-14;var v={xa:s,ya:c,xb:l,yb:u,xc:d,yc:f,xd:p,yd:m,x:h,y:g,rotate:_};return o&&e._addConnectorLines(o._connectorLines,v),v},_linkRightToLeft:function(t,n,r,i,a,o){var s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0;s=t.x+r.linkAdjuster.toX,c=t.y+t.h/2+r.linkAdjuster.toY,p=n.x+n.w+r.linkAdjuster.fromX,m=f=n.y+n.h/2+r.linkAdjuster.fromY,u=c,l=d=t.rightNeighbor&&t.rightNeighbor.isAssistant&&n.templateName==`split`?t.rightNeighbor.x-i:t.templateName==`split`&&(n.isAssistant||n.layout>1)?p:n.templateName==`split`?s-i:a??p+i,h=d-16,g=f,_=90;var v={xa:s,ya:c,xb:l,yb:u,xc:d,yc:f,xd:p,yd:m,x:h,y:g,rotate:_};return o&&e._addConnectorLines(o._connectorLines,v),v},_linkLeftToRight:function(t,n,r,i,a,o){var s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0;s=t.x+t.w+r.linkAdjuster.toX,c=t.y+t.h/2+r.linkAdjuster.toY,p=n.x+r.linkAdjuster.fromX,m=f=n.y+n.h/2+r.linkAdjuster.fromY,u=c,l=d=t.rightNeighbor&&t.rightNeighbor.isAssistant&&n.templateName==`split`?t.rightNeighbor.x+t.rightNeighbor.w+i:t.templateName==`split`&&(n.isAssistant||n.layout>1)?p:n.templateName==`split`?s+i:a??p-i,h=d+14,g=f,_=270;var v={xa:s,ya:c,xb:l,yb:u,xc:d,yc:f,xd:p,yd:m,x:h,y:g,rotate:_};return o&&e._addConnectorLines(o._connectorLines,v),v},_linkPpTop:function(t,n,r,i,a,o){var s=t.ppnodes[r.id],c=s.y+s.h/2,l=i.minY-(i.minY-a.maxY)/2,u=(i.minY-a.maxY)/t.maxSidePartnersWithChildren/4,d=e.ui.__linkPpBottomTop(t,n,r,l,u,s),f=d.x;return l=d.mid,e.ui._linkTopToBottom({x:f,y:c,w:0,h:0},r,o,0,l)},_linkPpBottom:function(t,n,r,i,a,o){var s=t.ppnodes[r.id],c=s.y+s.h/2,l=i.maxY-(i.maxY-a.minY)/2,u=(i.maxY-a.minY)/t.maxSidePartnersWithChildren/4,d=e.ui.__linkPpBottomTop(t,n,r,l,u,s),f=d.x;return l=d.mid,e.ui._linkBottomToTop({x:f,y:c,w:0,h:0},r,o,0,l)},_linkPpLeft:function(t,n,r,i,a,o){var s=t.ppnodes[r.id],c=i.minX-(i.minX-a.maxX)/2,l=(i.minX-a.maxX)/t.maxSidePartnersWithChildren/4,u=s.x+s.w/2,d=e.ui.__linkPpLeftRight(t,n,r,c,l,s),f=d.y;return c=d.mid,e.ui._linkLeftToRight({x:u,y:f,w:0,h:0},r,o,0,c)},_linkPpRight:function(t,n,r,i,a,o){var s=t.ppnodes[r.id],c=i.maxX-(i.maxX-a.minX)/2,l=(i.maxX-a.minX)/t.maxSidePartnersWithChildren/4,u=s.x+s.w/2,d=e.ui.__linkPpLeftRight(t,n,r,c,l,s),f=d.y;return c=d.mid,e.ui._linkRightToLeft({x:u,y:f,w:0,h:0},r,o,0,c)},__linkPpBottomTop:function(e,t,n,r,i,a){var o=0;return a.isPartner==1?(o=a.x-t.partnerSeparation/2+e.indexes[n.id]*e.partnerChildrenSplitSeparation-(e.rightIds.length-1)*e.partnerChildrenSplitSeparation/2,e.lastLeft&&o<e.lastLeft.x+e.lastLeft.w/2?o<n.x+n.w/2?r-=(e.indexes[n.id]+1)*i:r-=(e.rightIds.length-e.indexes[n.id])*i:o<n.x+n.w/2?r+=(e.rightIds.length-e.indexes[n.id])*i:r+=(e.indexes[n.id]+1)*i):a.isPartner==2&&(o=a.x+a.w+t.partnerSeparation/2+e.indexes[n.id]*e.partnerChildrenSplitSeparation-(e.leftIds.length-1)*e.partnerChildrenSplitSeparation/2,e.firstRight&&o>e.firstRight.x+e.firstRight.w/2?o<n.x+n.w/2?r-=(e.indexes[n.id]+1)*i:r-=(e.leftIds.length-e.indexes[n.id])*i:o<n.x+n.w/2?r+=(e.leftIds.length-e.indexes[n.id])*i:r+=(e.indexes[n.id]+1)*i),{x:o,mid:r}},__linkPpLeftRight:function(e,t,n,r,i,a){var o=0;return a.isPartner==1?(o=a.y-t.partnerSeparation/2+e.indexes[n.id]*e.partnerChildrenSplitSeparation-(e.rightIds.length-1)*e.partnerChildrenSplitSeparation/2,e.lastLeft&&o<e.lastLeft.y+e.lastLeft.h/2?o<n.y+n.h/2?r-=(e.indexes[n.id]+1)*i:r-=(e.rightIds.length-e.indexes[n.id])*i:o<n.y+n.h/2?r+=(e.rightIds.length-e.indexes[n.id])*i:r+=(e.indexes[n.id]+1)*i):a.isPartner==2&&(o=a.y+a.h+t.partnerSeparation/2+e.indexes[n.id]*e.partnerChildrenSplitSeparation-(e.leftIds.length-1)*e.partnerChildrenSplitSeparation/2,e.firstRight&&o>e.firstRight.y+e.firstRight.h/2?o<n.y+n.h/2?r-=(e.indexes[n.id]+1)*i:r-=(e.leftIds.length-e.indexes[n.id])*i:o<n.y+n.h/2?r+=(e.leftIds.length-e.indexes[n.id])*i:r+=(e.indexes[n.id]+1)*i),{y:o,mid:r}},_draggableLinkPath:function(t,n,r,i,a,o){if(r.isSubLevel||n.isSubLevel||r.leftNeighbor&&r.leftNeighbor.isSplit||r.rightNeighbor&&r.rightNeighbor.isSplit||r.isPartner||r.isAssistant)return null;if(e._isMoved(r)&&!e._isMoved(n)){var s,c,l=[];switch(o){case e.orientation.top:case e.orientation.top_left:if(i.yb+a/2<i.yd)return null;s=i.xa<i.xd?r.x-a/2:r.x+r.w+a/2,c=r.y-a/2;break;case e.orientation.bottom:case e.orientation.bottom_left:if(i.yb-a/2>i.yd)return null;s=i.xa<i.xd?r.x-a/2:r.x+r.w+a/2,c=r.y+r.h+a/2;break;case e.orientation.right:case e.orientation.right_top:if(i.xb-a/2>i.xd)return null;c=i.ya<i.yd?r.y-a/2:r.y+r.h+a/2,s=r.x+r.w+a/2;break;case e.orientation.left:case e.orientation.left_top:if(i.xb+a/2<i.xd)return null;c=i.ya<i.yd?r.y-a/2:r.y+r.h+a/2,s=r.x-a/2;break}switch(o){case e.orientation.top:case e.orientation.top_left:case e.orientation.bottom:case e.orientation.bottom_left:l.push([`M`,i.xa,i.ya]),l.push([`L`,i.xb,i.yb]),l.push([`L`,s,i.yb]),l.push([`L`,s,c]),l.push([`L`,i.xd,c]),l.push([`L`,i.xd,i.yd]);break;case e.orientation.right:case e.orientation.right_top:case e.orientation.left:case e.orientation.left_top:var l=[];l.push([`M`,i.xa,i.ya]),l.push([`L`,i.xb,i.yb]),l.push([`L`,i.xb,c]),l.push([`L`,s,c]),l.push([`L`,s,i.yd]),l.push([`L`,i.xd,i.yd]);break}return e.roundPathCorners(l,e.LINK_ROUNDED_CORNERS,!1)}else if(!e._isMoved(r)&&e._isMoved(n)){var s,c,u=!1,l=[];switch(o){case e.orientation.top:case e.orientation.top_left:if(i.ya+a/2>i.yb)u=!0,s=i.xa<i.xd?n.x+n.w+a/2:n.x-a/2,c=n.y+n.h+a;else if(i.yb+a/2<i.yd)return null;else s=i.xa<i.xd?r.x-a/2:r.x+r.w+a/2,c=r.y-a/2;break;case e.orientation.bottom:case e.orientation.bottom_left:if(i.ya-a/2<i.yb)u=!0,s=i.xa<i.xd?n.x+n.w+a/2:n.x-a/2,c=n.y-a;else if(i.yb-a/2>i.yd)return null;else s=i.xa<i.xd?r.x-a/2:r.x+r.w+a/2,c=r.y+r.h+a/2;break;case e.orientation.right:case e.orientation.right_top:if(i.xa-a/2<i.xb)u=!0,c=i.ya<i.yd?n.y+n.h+a/2:n.y-a/2,s=n.x-a;else if(i.xb-a/2>i.xd)return null;else c=i.ya<i.yd?r.y-a/2:r.y+r.h+a/2,s=r.x+r.w+a/2;break;case e.orientation.left:case e.orientation.left_top:if(i.xa+a/2>i.xb)u=!0,c=i.ya<i.yd?n.y+n.h+a/2:n.y-a/2,s=n.x+n.w+a;else if(i.xb+a/2<i.xd)return null;else c=i.ya<i.yd?r.y-a/2:r.y+r.h+a/2,s=r.x-a/2;break}if(u)switch(o){case e.orientation.top:case e.orientation.top_left:case e.orientation.bottom:case e.orientation.bottom_left:l.push([`M`,i.xa,i.ya]),l.push([`L`,i.xa,c]),l.push([`L`,s,c]),l.push([`L`,s,i.yc]),l.push([`L`,i.xc,i.yc]),l.push([`L`,i.xd,i.yd]);break;case e.orientation.right:case e.orientation.right_top:case e.orientation.left:case e.orientation.left_top:l.push([`M`,i.xa,i.ya]),l.push([`L`,s,i.ya]),l.push([`L`,s,c]),l.push([`L`,i.xc,c]),l.push([`L`,i.xc,i.yc]),l.push([`L`,i.xd,i.yd]);break}else switch(o){case e.orientation.top:case e.orientation.top_left:case e.orientation.bottom:case e.orientation.bottom_left:l.push([`M`,i.xa,i.ya]),l.push([`L`,i.xb,i.yb]),l.push([`L`,s,i.yb]),l.push([`L`,s,c]),l.push([`L`,i.xd,c]),l.push([`L`,i.xd,i.yd]);break;case e.orientation.right:case e.orientation.right_top:case e.orientation.left:case e.orientation.left_top:l.push([`M`,i.xa,i.ya]),l.push([`L`,i.xb,i.yb]),l.push([`L`,i.xb,c]),l.push([`L`,s,c]),l.push([`L`,s,i.yd]),l.push([`L`,i.xd,i.yd]);break}return e.roundPathCorners(l,e.LINK_ROUNDED_CORNERS,!1)}else if(e._isMoved(r)&&e._isMoved(n)){var l=[];switch(o){case e.orientation.top:case e.orientation.top_left:if(i.ya+a>i.yd){var s=i.xa<i.xd?n.x+n.w+a/2:n.x-a/2,c=n.y+n.h+a,d=r.y-a;l.push([`M`,i.xa,i.ya]),l.push([`L`,i.xa,c]),l.push([`L`,s,c]),l.push([`L`,s,d]),l.push([`L`,i.xc,d]),l.push([`L`,i.xd,i.yd])}else l.push([`M`,i.xa,i.ya]),l.push([`L`,i.xa,n.y+n.h+a]),l.push([`L`,i.xc,n.y+n.h+a]),l.push([`L`,i.xd,i.yd]);break;case e.orientation.bottom:case e.orientation.bottom_left:if(i.ya-a<i.yd){var s=i.xa<i.xd?n.x+n.w+a/2:n.x-a/2,c=n.y-a,d=r.y+r.h+a;l.push([`M`,i.xa,i.ya]),l.push([`L`,i.xa,c]),l.push([`L`,s,c]),l.push([`L`,s,d]),l.push([`L`,i.xc,d]),l.push([`L`,i.xd,i.yd])}else l.push([`M`,i.xa,i.ya]),l.push([`L`,i.xa,n.y-a]),l.push([`L`,i.xc,n.y-a]),l.push([`L`,i.xd,i.yd]);break;case e.orientation.right:case e.orientation.right_top:if(i.xa-a<i.xd){var c=i.ya<i.yd?n.y+n.h+a/2:n.y-a/2,s=n.x-a,f=r.x+r.w+a;l.push([`M`,i.xa,i.ya]),l.push([`L`,s,i.ya]),l.push([`L`,s,c]),l.push([`L`,f,c]),l.push([`L`,f,i.yc]),l.push([`L`,i.xd,i.yd])}else l.push([`M`,i.xa,i.ya]),l.push([`L`,n.x-a,i.ya]),l.push([`L`,n.x-a,i.yc]),l.push([`L`,i.xd,i.yd]);break;case e.orientation.left:case e.orientation.left_top:if(i.xa+a>i.xd){var c=i.ya<i.yd?n.y+n.h+a/2:n.y-a/2,s=n.x+n.w+a,f=r.x-a;l.push([`M`,i.xa,i.ya]),l.push([`L`,s,i.ya]),l.push([`L`,s,c]),l.push([`L`,f,c]),l.push([`L`,f,i.yc]),l.push([`L`,i.xd,i.yd])}else l.push([`M`,i.xa,i.ya]),l.push([`L`,n.x+n.w+a,i.ya]),l.push([`L`,n.x+n.w+a,i.yc]),l.push([`L`,i.xd,i.yd]);break}return e.roundPathCorners(l,e.LINK_ROUNDED_CORNERS,!1)}return null}},e===void 0&&(e={}),e._validateConfig=function(e){if(!e)console.error(`config is not defined`);else return!0;return!1},e._arrayContains=function(e,t){if(e&&Array.isArray(e)){for(var n=e.length;n--;)if(e[n]===t)return!0}return!1},e._interceptions=function(e,t){if(!e||!t)return[];var n=[];if(Array.isArray(e)&&Array.isArray(t))for(var r in e)for(var i in t)e[r]==t[i]&&n.push(e[r]);else if(Array.isArray(e)&&!Array.isArray(t))for(var r in e)for(var i in t)e[r]==i&&n.push(e[r]);else if(!Array.isArray(e)&&Array.isArray(t))for(var r in e)for(var i in t)r==t[i]&&n.push(t[i]);return n},e._getTags=function(e){return e.tags&&!Array.isArray(e.tags)?e.tags.split(`,`):e.tags&&Array.isArray(e.tags)?e.tags:[]},e._centerPointInPercent=function(e,t,n){var r=e.getBoundingClientRect(),i=t-r.left,a=n-r.top;return[i/(r.width/100),a/(r.height/100)]},e._trim=function(e){return e.replace(/^\s+|\s+$/g,``)},e._getTransform=function(t){var n=t.getAttribute(`transform`);return n=n.replace(`matrix`,``).replace(`(`,``).replace(`)`,``),e._browser().msie&&(n=n.replace(/ /g,`,`)),n=e._trim(n),n=`[`+n+`]`,n=JSON.parse(n),n},e.getScale=function(t,n,r,i,a,o,s,c){var l=1;if(!t&&(i===e.match.boundary||i===e.match.boundaryIfOutside)){var u=n/s,d=r/c;l=u>d?d:u,i===e.match.boundaryIfOutside&&l>1&&(l=1)}else if(!t&&i===e.match.width)l=n/s;else if(!t&&i===e.match.height)l=r/c;else if(!t)l=i;else{var u=n/t[2],d=r/t[3];l=u>d?d:u}return l&&l>a&&(l=a),l&&l<o&&(l=o),l},e.isObject=function(e){return e&&typeof e==`object`&&!Array.isArray(e)&&e!==null&&e.constructor&&e.constructor.name.toLowerCase()==`object`},e.fileUploadDialog=function(e){var t=document.createElement(`INPUT`);t.setAttribute(`type`,`file`),t.style.display=`none`,t.onchange=function(){var t=this.files[0];e(t)},document.body.appendChild(t),t.click()},e.mergeDeep=function(t,n){if(e.isObject(t)&&e.isObject(n))for(var r in n)e.isObject(n[r])?(t[r]||Object.assign(t,{[r]:{}}),e.mergeDeep(t[r],n[r])):Object.assign(t,{[r]:n[r]});return t},e._lblIsImg=function(e,t){return!!(e.nodeBinding&&typeof t==`string`&&t.indexOf(`img`)!=-1&&e.nodeBinding[t])},e._getFistImgField=function(e){if(e.nodeBinding){for(var t in e.nodeBinding)if(t.indexOf(`img`)!=-1)return e.nodeBinding[t]}return!1},e._fieldIsImg=function(t,n){if(t.nodeBinding){for(var r in t.nodeBinding)if(t.nodeBinding[r]==n)return e._lblIsImg(t,r)}return!1},e._guid=function(){function e(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return e()+e()+`-`+e()+`-`+e()+`-`+e()+`-`+e()+e()+e()},e.htmlRipple=function(e){var t=document.createElement(`style`);t.type=`text/css`,t.innerHTML=` .boc-ripple-container {position: absolute; top: 0; right: 0; bottom: 0; left: 0; } .boc-ripple-container span {transform: scale(0);border-radius:100%;position:absolute;opacity:0.75;background-color:#fff;animation: boc-ripple 1000ms; }@-moz-keyframes boc-ripple {to {opacity: 0;transform: scale(2);}}@-webkit-keyframes boc-ripple {to {opacity: 0;transform: scale(2);}}@-o-keyframes boc-ripple {to {opacity: 0;transform: scale(2);}}@keyframes boc-ripple {to {opacity: 0;transform: scale(2);}}`,document.head.appendChild(t);var n=function(e,t){var n=void 0;return function(){var r,i=this;return r=arguments,clearTimeout(n),n=setTimeout(function(){return e.apply(i,r)},t)}},r=function(t){var n,r=this,i=document.createElement(`span`),a=r.offsetWidth,o,s,c;return n=r.getBoundingClientRect(),s=t.pageX-n.left-a/2,c=t.pageY-n.top-a/2,o=`top:`+c+`px; left: `+s+`px; height: `+a+`px; width: `+a+`px;`,e.rippleContainer.appendChild(i),i.setAttribute(`style`,o)},i=function(){for(;this.rippleContainer.firstChild;)this.rippleContainer.removeChild(this.rippleContainer.firstChild)},a=document.createElement(`div`);a.className=`boc-ripple-container`,e.addEventListener(`mousedown`,r),e.addEventListener(`mouseup`,n(i,2e3)),e.rippleContainer=a,e.appendChild(a)},e._moveToBoundaryArea=function(t,n,r,i){var a=n.slice(0);n[0]<r.left&&n[0]<r.right&&(a[0]=r.left>r.right?r.right:r.left),n[0]>r.right&&n[0]>r.left&&(a[0]=r.left>r.right?r.left:r.right),n[1]<r.top&&n[1]<r.bottom&&(a[1]=r.top>r.bottom?r.bottom:r.top),n[1]>r.bottom&&n[1]>r.top&&(a[1]=r.top>r.bottom?r.top:r.bottom),n[0]!==a[0]||n[1]!==a[1]?e.animate(t,{viewBox:n},{viewBox:a},300,e.anim.outPow,function(){i&&i()}):i&&i()},e.randomId=function(){return`_`+(`0000`+(Math.random()*36**4|0).toString(36)).slice(-4)},e._getClientXY=function(e){if(e.type.indexOf(`touch`)!=-1){if(e.changedTouches.length)return{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}}else return{x:e.clientX,y:e.clientY}},e._getClientTouchesXY=function(e,t){return e.type.indexOf(`touch`)==-1?{x:e.clientX,y:e.clientY}:e.touches.length<t+1?{x:null,y:null}:{x:e.touches[t].clientX,y:e.touches[t].clientY}},e._getOffset=function(t,n){t&&(n.x+=t.offsetLeft,n.y+=t.offsetTop,e._getOffset(t.offsetParent,n))},e._getTopLeft=function(t){var n={x:0,y:0};return e._getOffset(t,n),n},e._getOffsetXY=function(t,n){if(n.type.indexOf(`touch`)!=-1){if(n.touches.length){var r=e._getTopLeft(t);return{x:n.touches[0].pageX-r.x,y:n.touches[0].pageY-r.y}}else if(n.changedTouches.length){var r=e._getTopLeft(t);return isNaN(r.x)||isNaN(r.y)?{x:n.changedTouches[0].pageX,y:n.changedTouches[0].pageY}:{x:n.changedTouches[0].pageX-r.x,y:n.changedTouches[0].pageY-r.y}}}else return{x:n.offsetX,y:n.offsetY}},e._pinchMiddlePointInPercent=function(t,n,r,i){var a=e._getTopLeft(t),o=i.touches[0].pageX-a.x,s=i.touches[0].pageY-a.y,c=i.touches[1].pageX-a.x,l=i.touches[1].pageY-a.y;return[((o-c)/2+c)/(n/100),((s-l)/2+l)/(r/100)]},e._browser=function(){var e=!!window.opr&&!!window.opr.addons||!!window.opera||navigator.userAgent.indexOf(` OPR/`)>=0,t=typeof InstallTrigger<`u`,n=/constructor/i.test(window.HTMLElement)||(function(e){return e.toString()===`[object SafariRemoteNotification]`})(!window.safari||window.safari!==void 0&&safari.pushNotification),r=!!document.documentMode,i=!r&&!!window.StyleMedia,a=!!window.chrome&&(!!window.chrome.webstore||!!window.chrome.runtime);return{opera:e,firefox:t,safari:n,msie:r,edge:i,chrome:a,blink:(a||e)&&!!window.CSS}},e._menuPosition=function(e,t,n){var r=e.getBoundingClientRect(),i=n.getBoundingClientRect(),a=t.getBoundingClientRect(),o=r.left-i.left,s=r.top-i.top;return r.top+a.height>i.top+i.height&&(s-=a.height),r.left-a.width<i.left&&(o+=a.width),{x:o,y:s}},e._getTemplate=function(e,t,n){if(Array.isArray(e))for(var r=0;r<e.length;r++){var i=t[e[r]];if(i&&i.template)return i.template}return n},e._getMin=function(e,t){if(e.tags&&e.tags.length&&t.tags)for(var n=0;n<e.tags.length;n++){var r=t.tags[e.tags[n]];if(r&&r.min===!0)return!0}return t.min},e._getSubLevels=function(e,t){if(e&&e.length)for(var n=0;n<e.length;n++){var r=t[e[n]];if(r&&r.subLevels)return r.subLevels}return 0},e._isHTML=function(e){var t=new DOMParser().parseFromString(e,`text/html`);return Array.from(t.body.childNodes).some(e=>e.nodeType===1)},e._getTestDiv=function(){var e=document.getElementById(`orgchart_js_test_div`);return e||(e=document.createElement(`div`),e.id=`orgchart_js_test_div`,e.style.position=`fixed`,e.style.top=`-10000px`,e.style.left=`-10000px`,document.body.appendChild(e)),e},e._getLabelSize=function(t){var n=e._getTestDiv();return n.innerHTML=`<svg>`+t+`</svg>`,n.querySelector(`text`).getBoundingClientRect()},e.wrapText=function(t,n,r,i){if(r!=null&&i!=null)return e._lineClamp(n,t,r,i);var a=n,o=a.toLowerCase();if(o.indexOf(`<text`)==-1||o.indexOf(e.attr.width)==-1||o.indexOf(`foreignobject`)!=-1||a.indexOf(e.attr.width)==-1||e.ESCAPE_HTML&&typeof str==`string`&&e._isHTML(t))return e._escapeHtml(t);if(!e.ESCAPE_HTML&&e._isHTML(t))return t;var s=e._getTestDiv();a=a.replaceAll(`{cw}`,0),s.innerHTML=`<svg>`+a+`</svg>`;var c=new DOMParser().parseFromString(a,`text/xml`).getElementsByTagName(`text`)[0],l=parseFloat(c.getAttribute(`x`)),u=parseFloat(c.getAttribute(`y`)),d=c.getAttribute(`text-anchor`),r=c.getAttribute(e.attr.width),f=c.getAttribute(e.attr.text_overflow),p=`http://www.w3.org/2000/svg`,m=s.getElementsByTagName(`svg`)[0].getElementsByTagName(`text`)[0],i,h;f||=`ellipsis`;var g=f.split(`-`);if(g.length>1&&(i=parseInt(f.split(`-`)[1]),g.length>2&&g[2]==`ellipsis`&&(h=!0)),!r)return e._escapeHtml(t);if(r=parseFloat(r),l||=0,u||=0,l||(d=`start`),f==`ellipsis`){m.removeChild(m.firstChild),m.textContent=t;for(var _=m.getComputedTextLength(),v=2;_>r;)m.textContent=t.substring(0,t.length-v),m.textContent+=`...`,_=m.getComputedTextLength(),v++;return v>2?`<title>${e._escapeHtml(t)}</title>${m.textContent}`:e._escapeHtml(t)}else if(f.indexOf(`multiline`)!=-1){var y=t.split(` `),b=m.getBBox().height;m.textContent=``;var x=document.createElementNS(p,`tspan`),S=document.createTextNode(y[0]);x.setAttributeNS(null,`x`,l),x.setAttributeNS(null,`y`,u),x.setAttributeNS(null,`text-anchor`,d),x.appendChild(S),m.appendChild(x);for(var v=1,C=1,w=!1,T=1;T<y.length;T++){var E=x.firstChild.data.length;if(x.firstChild.data+=` `+y[T],x.getComputedTextLength()>r){if(x.firstChild.data=x.firstChild.data.slice(0,E),C++,i&&C>i){if(h&&m.children.length==i){var D=m.children[i-1].textContent;m.children[i-1].textContent=D.substring(0,D.length-3)+`...`,w=!0}break}var x=document.createElementNS(p,`tspan`);x.setAttributeNS(null,`x`,l),x.setAttributeNS(null,`y`,u+b*v),x.setAttributeNS(null,`text-anchor`,d),S=document.createTextNode(y[T]),x.appendChild(S),m.appendChild(x),v++}}var O=``;if(m.innerHTML!=null)O=m.innerHTML,m.innerHTML=``;else{for(var k=``,T=m.childNodes.length-1;T>=0;T--)k=XMLSerializer().serializeToString(m.childNodes[T])+k,m.removeChild(m.childNodes[T]);O=k}return w?`<title>${e._escapeHtml(t)}</title>${O}`:O}},e._downloadFile=function(e,t,n,r,i){var a=new Blob([t],{type:e});if(r==1){var o=URL.createObjectURL(a);window.open(o,`_blank`).focus()}else if(navigator.msSaveBlob)navigator.msSaveBlob(a,n);else{var s=document.createElement(`a`);if(s.download!==void 0){var o=URL.createObjectURL(a);s.setAttribute(`href`,o);var c=n;c.toLowerCase().endsWith(i.toLowerCase())||(c=c+`.`+i),s.setAttribute(`download`,c),s.style.visibility=`hidden`,document.body.appendChild(s),s.click(),document.body.removeChild(s)}}},e._getPosition=function(e,t,n,r){var i={x:t.x,y:t.y};if(n!=null&&(i.x=n),r!=null&&(i.y=n),e&&e.length==3){var a=e[0].indexOf(t.id);a!=-1&&e[1][a].transform!=null&&(n??(i.x=e[1][a].transform[4]),r??(i.y=e[1][a].transform[5]))}return i},e._getOpacity=function(e,t){var n=1;if(e&&e.length==3){var r=e[0].indexOf(t.id);r!=-1&&e[1][r].opacity!=null&&(n=e[1][r].opacity)}return n},e.t=function(t,n,r){var i=e.templates[t];i??console.error(`Template "${t}" does not exist!`);var a=null;if(r!=null&&i.scaleLessThen){var o=[];for(var s in i.scaleLessThen){var c=parseFloat(s);r<c&&o.push(c)}if(o.length>0){o.sort(function(e,t){return e-t});var l=i.scaleLessThen[o[0]];for(var u in l)a??=Object.assign({},i),a[u]=l[u]}}return n?a==null?i.min?i.min:i:a.min?a.min:a:a??i},e.setNodeSize=function(t){var n=e.t(t.templateName,t.min);t.w=n&&n.size?n.size[0]:0,t.h=n&&n.size?n.size[1]:0},e._imgs2base64=function(t,n,r,i){var a=t.getElementsByTagName(n),o=a.length;o==0&&i();for(var s=0;s<o;s++)(function(){var t=s,n=a[t];e._getDataUri(n.getAttribute(r),function(e){e.success&&n.setAttribute(r,e.result),t==o-1&&i()})})()},e._getDataUri=function(e,t){if(e.indexOf(`base64`)!=-1)t({success:!1});else{var n=new XMLHttpRequest;n.open(`GET`,e),n.responseType=`blob`,n.onload=function(){n.status===200?r.readAsDataURL(n.response):n.status===404&&t({success:!1,result:n.status})};var r=new FileReader;r.onloadend=function(){t({success:!0,result:r.result})},n.send()}},e._convertStringToArray=function(t,n){return e.ARRAY_FIELDS.indexOf(t)==-1?n:e.isNEU(n)?[]:n.split(`,`)},e._convertArrayToString=function(t){return!e.isNEU(t)&&Array.isArray(t)?t.join():t},e._csvToArray=function(t,n){n||=e.CSV_DELIMITER;for(var r=RegExp(`(\\`+n+`|\\r?\\n|\\r|^)(?:"([^"]*(?:""[^"]*)*)"|([^"\\`+n+`\\r\\n]*))`,`gi`),i=[[]],a=null;a=r.exec(t);){var o=a[1];o.length&&o!==n&&i.push([]);var s=a[2]?a[2].replace(RegExp(`""`,`g`),`"`):a[3];i[i.length-1].push(s)}return i},e._json2xml=function(t){for(var n=document.implementation.createDocument(``,``,null),r=n.createElement(`nodes`),i=0;i<t.length;i++){var a=n.createElement(`node`),o=t[i];for(var s in o){var c=o[s];a.setAttribute(s,e._convertArrayToString(c))}r.appendChild(a)}return n.appendChild(r),`<?xml version="1.0" encoding="utf-8" ?>`+new XMLSerializer().serializeToString(n.documentElement)},e._xml2json=function(t){for(var n=new DOMParser().parseFromString(t,`text/xml`).getElementsByTagName(`node`),r=[],i=0;i<n.length;i++){for(var a=n[i],o={},s=0;s<a.attributes.length;s++){var c=a.attributes[s];o[c.name]=e._convertStringToArray(c.name,c.value)}r.push(o)}return r},e.convertNodesToCsv=function(t){return e._json2csv(t)},e._json2csv=function(t){for(var n=[],r=function(t){for(var r=``,i=0;i<n.length;i++){var a=n[i]==`reportsTo`?null:t[n[i]]==null?``:t[n[i]];a instanceof Date&&(a=a.toLocaleString()),a=a===null?``:a.toString();var o=a.replace(/"/g,`""`),s=RegExp(`("|;|
311
311
  )`,`g`);o.search(s)>=0&&(o=`"`+o+`"`),i>0&&(r+=e.CSV_DELIMITER),r+=o}return r+`
312
312
  `},i=``,a=0;a<t.length;a++)for(var o in t[a])e._arrayContains(n,o)||(n.push(o),i+=o+e.CSV_DELIMITER);i=i.substring(0,i.length-1),i+=`
313
313
  `;for(var a=0;a<t.length;a++)i+=r(t[a]);return i=i.substring(0,i.length-1),i},e.accentFold=function(e){return e=e.toString().toLowerCase(),e.replace(/([àáâãäå])|([ç])|([èéêë])|([ìíîï])|([ñ])|([òóôõöø])|([ß])|([ùúûü])|([ÿ])|([æ])/g,function(e,t,n,r,i,a,o,s,c,l,u){if(t)return`a`;if(n)return`c`;if(r)return`e`;if(i)return`i`;if(a)return`n`;if(o)return`o`;if(s)return`s`;if(c)return`u`;if(l)return`y`;if(u)return`ae`})},e.copy=function(t){if(typeof t!=`object`||!t||`isActiveClone`in t)return t;if(t instanceof Date)var n=new t.constructor;else var n=t.constructor();for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t.isActiveClone=null,n[r]=e.copy(t[r]),delete t.isActiveClone);return n},e._getScrollSensitivity=function(){var t=e._browser();return t.msie&&e.scroll.ie?e.scroll.ie:t.edge&&e.scroll.edge?e.scroll.edge:t.safari&&e.scroll.safari?e.scroll.safari:t.chrome&&e.scroll.chrome?e.scroll.chrome:t.firefox&&e.scroll.firefox?e.scroll.firefox:t.opera&&e.scroll.opera?e.scroll.opera:{smooth:e.scroll.smooth,speed:e.scroll.speed}},e.isMobile=function(){let e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e),n=navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1;return t||n},e._isTouchDevice=function(){return navigator.maxTouchPoints>0},e.isTrial=function(){return e.remote!==void 0},e.childrenCount=function(e,t){for(var n=0,r=0;r<t.childrenIds.length;r++)e.nodes[t.childrenIds[r]]&&n++;return n},e.childrenTotalCount=function(t,n){for(var r=0,i=0;i<n.childrenIds.length;i++){var a=t.nodes[n.childrenIds[i]];a&&(r++,r+=e.childrenTotalCount(t,a))}return r},e.collapsedChildrenCount=function(e,t){for(var n=0,r=0;r<t.childrenIds.length;r++){var i=e.nodes[t.childrenIds[r]];i&&i.collapsed===!0&&n++}return n},e.collapsedChildrenTotalCount=function(t,n,r){for(var i=0,a=0;a<n.childrenIds.length;a++){var o=t.nodes[n.childrenIds[a]];o&&((r||o.collapsed===!0)&&i++,i+=e.collapsedChildrenTotalCount(t,o,!0))}return i},e._setMinMaxXY=function(e,t,n){n&&e.isTreeListItem||((t.minX==null||e.x!=null&&e.x<t.minX)&&(t.minX=e.x),(t.minY==null||e.y!=null&&e.y<t.minY)&&(t.minY=e.y),(t.maxX==null||e.x!=null&&e.x+e.w>t.maxX)&&(t.maxX=e.x+e.w),(t.maxY==null||e.y!=null&&e.y+e.h>t.maxY)&&(t.maxY=e.y+e.h))},e.getStParentNodes=function(t,n){for(n||=[];t.parent;)t=t.parent;return t.stParent&&(n.push(t.stParent),e.getStParentNodes(t.stParent,n)),n},e.getRootOf=function(e){for(;e&&e.parent;)e=e.parent;return e},e._getViewBox=function(e){var t=null;return e?(t=e.getAttribute(`viewBox`),t=`[`+t+`]`,t=t.replace(/\ /g,`,`),t=JSON.parse(t),t):null},e.isNEU=function(e){return e==null||e===``},e.gradientCircleForDefs=function(e,t,n,r){Array.isArray(t)||(t=[t,t,t,t,t,t]);function i(e,t,n,r){var i=(r-90)*Math.PI/180;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function a(e,t,n,r,a){var o=i(e,t,n,a),s=i(e,t,n,r),c=a-r<=180?`0`:`1`;return[`M`,o.x,o.y,`A`,n,n,0,c,0,s.x,s.y].join(` `)}return`<linearGradient id="${e}_linearColors1" x1="0" y1="0" x2="1" y2="1">
package/orgchart.mjs CHANGED
@@ -848,7 +848,7 @@ e.prototype.init = function(t, n) {
848
848
  n._menuClickHandler.apply(n, [this, e]);
849
849
  });
850
850
  }
851
- }, e === void 0 && (e = {}), e.VERSION = "9.2.38", e.orientation = {}, e.orientation.top = 0, e.orientation.bottom = 1, e.orientation.right = 2, e.orientation.left = 3, e.orientation.top_left = 4, e.orientation.bottom_left = 5, e.orientation.right_top = 6, e.orientation.left_top = 7, e.anchor = {
851
+ }, e === void 0 && (e = {}), e.VERSION = "9.2.40", e.orientation = {}, e.orientation.top = 0, e.orientation.bottom = 1, e.orientation.right = 2, e.orientation.left = 3, e.orientation.top_left = 4, e.orientation.bottom_left = 5, e.orientation.right_top = 6, e.orientation.left_top = 7, e.anchor = {
852
852
  top_right: "top_right",
853
853
  right_top: "right_top",
854
854
  bottom_right: "bottom_right",
@@ -3555,7 +3555,10 @@ e.prototype.init = function(t, n) {
3555
3555
  e.events.publish("node-mouseleave", [t, i]) !== !1 && e._hover._removeSelectedStyle(t);
3556
3556
  });
3557
3557
  }), e._hover = {}, e._hover._addSelectedStyle = function(t, n, r) {
3558
- n.isSplit || t.config.highlightOnHover != "none" && ((t.config.highlightOnHover == "parents" || t.config.highlightOnHover == "childrenAndParents") && e._hover._addSelectedStyleParents(t, n, r), (t.config.highlightOnHover == "children" || t.config.highlightOnHover == "childrenAndParents") && e._hover._addSelectedStyleChildren(t, n, r), t.config.highlightOnHover == "sameLevel" && e._hover._addSelectedStyleSameLevel(t, n, r));
3558
+ n.isSplit || t.config.highlightOnHover != "none" && ((t.config.highlightOnHover == "parents" || t.config.highlightOnHover == "childrenAndParents") && e._hover._addSelectedStyleParents(t, n, r), (t.config.highlightOnHover == "children" || t.config.highlightOnHover == "childrenAndParents") && e._hover._addSelectedStyleChildren(t, n, r), t.config.highlightOnHover == "sameLevel" && e._hover._addSelectedStyleSameLevel(t, n, r), t.config.highlightOnHover == "self" && e._hover._addSelectedStyleSelf(t, n, r));
3559
+ }, e._hover._addSelectedStyleSelf = function(e, t, n) {
3560
+ var r = e.getNodeElement(t.id);
3561
+ r && r.classList.add("boc-hover");
3559
3562
  }, e._hover._addSelectedStyleChildren = function(t, n, r) {
3560
3563
  var i = t.getNodeElement(n.id);
3561
3564
  i && i.classList.add("boc-hover");
@@ -4600,7 +4603,7 @@ e.prototype.init = function(t, n) {
4600
4603
  ],
4601
4604
  editFormHeaderColor: "#039BE5",
4602
4605
  treeListMaxHeight: 500
4603
- }, e.templates.split = Object.assign({}, e.templates.ana), e.templates.split.size = [10, 10], e.templates.split.node = "<circle class=\"boc-hoverable\" cx=\"5\" cy=\"5\" r=\"5\" fill=\"none\" stroke-width=\"1\" stroke=\"#aeaeae\"></circle>", e.templates.split.field_0 = "", e.templates.split.field_1 = "", e.templates.split.img_0 = "", e.templates.dot = Object.assign({}, e.templates.split), e.templates.group = Object.assign({}, e.templates.ana), e.templates.group.size = [250, 120], e.templates.group.padding = [
4606
+ }, e.templates.split = Object.assign({}, e.templates.ana), e.templates.split.size = [10, 10], e.templates.split.node = "<circle cx=\"5\" cy=\"5\" r=\"5\" fill=\"none\" stroke-width=\"1\" stroke=\"#aeaeae\"></circle>", e.templates.split.field_0 = "", e.templates.split.field_1 = "", e.templates.split.img_0 = "", e.templates.dot = Object.assign({}, e.templates.split), e.templates.group = Object.assign({}, e.templates.ana), e.templates.group.size = [250, 120], e.templates.group.padding = [
4604
4607
  50,
4605
4608
  20,
4606
4609
  35,
@@ -4984,29 +4987,29 @@ e.prototype.init = function(t, n) {
4984
4987
  x: 0,
4985
4988
  y: 0,
4986
4989
  rotate: 0
4987
- };
4988
- u = e.t(b.templateName, b.min, r);
4989
- var C = u.link;
4990
+ }, C = b.templateName;
4991
+ b.isSplit && (b.leftNeighbor && !b.leftNeighbor.isMirror && b.leftNeighbor.pid == b.pid ? C = b.leftNeighbor.templateName : b.rightNeighbor && !b.rightNeighbor.isMirror && b.rightNeighbor.pid == b.pid && (C = b.rightNeighbor.templateName)), u = e.t(C, b.min, r);
4992
+ var w = u.link;
4990
4993
  if (b.isChildOfPartner) switch (l.orientation) {
4991
4994
  case e.orientation.top:
4992
4995
  case e.orientation.top_left:
4993
- var w = b.layout == 1 ? void 0 : x.minY - (x.minY - _.maxY) / 2;
4994
- S = e.ui._linkTopToBottom(b.parentPartner, b, u, m, w, n);
4996
+ var T = b.layout == 1 ? void 0 : x.minY - (x.minY - _.maxY) / 2;
4997
+ S = e.ui._linkTopToBottom(b.parentPartner, b, u, m, T, n);
4995
4998
  break;
4996
4999
  case e.orientation.bottom:
4997
5000
  case e.orientation.bottom_left:
4998
- var w = b.layout == 1 ? void 0 : x.maxY - (x.maxY - _.minY) / 2;
4999
- S = e.ui._linkBottomToTop(b.parentPartner, b, u, m, w, n);
5001
+ var T = b.layout == 1 ? void 0 : x.maxY - (x.maxY - _.minY) / 2;
5002
+ S = e.ui._linkBottomToTop(b.parentPartner, b, u, m, T, n);
5000
5003
  break;
5001
5004
  case e.orientation.right:
5002
5005
  case e.orientation.right_top:
5003
- var w = b.layout == 1 ? void 0 : x.maxX - (x.maxX - _.minX) / 2;
5004
- S = e.ui._linkRightToLeft(b.parentPartner, b, u, m, w, n);
5006
+ var T = b.layout == 1 ? void 0 : x.maxX - (x.maxX - _.minX) / 2;
5007
+ S = e.ui._linkRightToLeft(b.parentPartner, b, u, m, T, n);
5005
5008
  break;
5006
5009
  case e.orientation.left:
5007
5010
  case e.orientation.left_top:
5008
- var w = b.layout == 1 ? void 0 : x.minX - (x.minX - _.maxX) / 2;
5009
- S = e.ui._linkLeftToRight(b.parentPartner, b, u, m, w, n);
5011
+ var T = b.layout == 1 ? void 0 : x.minX - (x.minX - _.maxX) / 2;
5012
+ S = e.ui._linkLeftToRight(b.parentPartner, b, u, m, T, n);
5010
5013
  break;
5011
5014
  }
5012
5015
  else if (v && v.ids.indexOf(b.id) != -1) switch (l.orientation) {
@@ -5028,8 +5031,8 @@ e.prototype.init = function(t, n) {
5028
5031
  break;
5029
5032
  }
5030
5033
  else {
5031
- var T = b.isAssistant && b.rightNeighbor && b.rightNeighbor.isAssistant && b.parent == b.rightNeighbor.parent, E = b.isAssistant && b.leftNeighbor && b.leftNeighbor.isAssistant && b.parent == b.leftNeighbor.parent;
5032
- if ((T || b.layout > 1) && b.rightNeighbor && b.rightNeighbor.isSplit) switch (l.orientation) {
5034
+ var E = b.isAssistant && b.rightNeighbor && b.rightNeighbor.isAssistant && b.parent == b.rightNeighbor.parent, D = b.isAssistant && b.leftNeighbor && b.leftNeighbor.isAssistant && b.parent == b.leftNeighbor.parent;
5035
+ if ((E || b.layout > 1) && b.rightNeighbor && b.rightNeighbor.isSplit) switch (l.orientation) {
5033
5036
  case e.orientation.top:
5034
5037
  case e.orientation.top_left:
5035
5038
  S = e.ui._linkRightToLeft(b.rightNeighbor, b, u, m);
@@ -5047,7 +5050,7 @@ e.prototype.init = function(t, n) {
5047
5050
  S = e.ui._linkBottomToTop(b.rightNeighbor, b, u, m);
5048
5051
  break;
5049
5052
  }
5050
- else if ((E || b.layout > 1) && b.leftNeighbor && b.leftNeighbor.isSplit) switch (l.orientation) {
5053
+ else if ((D || b.layout > 1) && b.leftNeighbor && b.leftNeighbor.isSplit) switch (l.orientation) {
5051
5054
  case e.orientation.top:
5052
5055
  case e.orientation.top_left:
5053
5056
  S = e.ui._linkLeftToRight(b.leftNeighbor, b, u, m, n);
@@ -5071,8 +5074,8 @@ e.prototype.init = function(t, n) {
5071
5074
  if (b.isPartner == 1) S = e.ui._linkLeftToRight(t, b, u, h);
5072
5075
  else if (b.isPartner == 2) S = e.ui._linkRightToLeft(t, b, u, h);
5073
5076
  else {
5074
- var w = b.layout == 1 ? void 0 : x.minY - (x.minY - _.maxY) / 2;
5075
- S = e.ui._linkTopToBottom(t, b, u, m, w, n);
5077
+ var T = b.layout == 1 ? void 0 : x.minY - (x.minY - _.maxY) / 2;
5078
+ S = e.ui._linkTopToBottom(t, b, u, m, T, n);
5076
5079
  }
5077
5080
  break;
5078
5081
  case e.orientation.bottom:
@@ -5080,8 +5083,8 @@ e.prototype.init = function(t, n) {
5080
5083
  if (b.isPartner == 1) S = e.ui._linkLeftToRight(t, b, u, h);
5081
5084
  else if (b.isPartner == 2) S = e.ui._linkRightToLeft(t, b, u, h);
5082
5085
  else {
5083
- var w = b.layout == 1 ? void 0 : x.maxY - (x.maxY - _.minY) / 2;
5084
- S = e.ui._linkBottomToTop(t, b, u, m, w, n);
5086
+ var T = b.layout == 1 ? void 0 : x.maxY - (x.maxY - _.minY) / 2;
5087
+ S = e.ui._linkBottomToTop(t, b, u, m, T, n);
5085
5088
  }
5086
5089
  break;
5087
5090
  case e.orientation.right:
@@ -5089,8 +5092,8 @@ e.prototype.init = function(t, n) {
5089
5092
  if (b.isPartner == 1) S = e.ui._linkTopToBottom(t, b, u, h);
5090
5093
  else if (b.isPartner == 2) S = e.ui._linkBottomToTop(t, b, u, h);
5091
5094
  else {
5092
- var w = b.layout == 1 ? void 0 : x.maxX - (x.maxX - _.minX) / 2;
5093
- S = e.ui._linkRightToLeft(t, b, u, m, w, n);
5095
+ var T = b.layout == 1 ? void 0 : x.maxX - (x.maxX - _.minX) / 2;
5096
+ S = e.ui._linkRightToLeft(t, b, u, m, T, n);
5094
5097
  }
5095
5098
  break;
5096
5099
  case e.orientation.left:
@@ -5098,43 +5101,43 @@ e.prototype.init = function(t, n) {
5098
5101
  if (b.isPartner == 1) S = e.ui._linkTopToBottom(t, b, u, h);
5099
5102
  else if (b.isPartner == 2) S = e.ui._linkBottomToTop(t, b, u, h);
5100
5103
  else {
5101
- var w = b.layout == 1 ? void 0 : x.minX - (x.minX - _.maxX) / 2;
5102
- S = e.ui._linkLeftToRight(t, b, u, m, w, n);
5104
+ var T = b.layout == 1 ? void 0 : x.minX - (x.minX - _.maxX) / 2;
5105
+ S = e.ui._linkLeftToRight(t, b, u, m, T, n);
5103
5106
  }
5104
5107
  break;
5105
5108
  }
5106
5109
  }
5107
- var D, O = e.ui._draggableLinkPath(n, t, b, S, m, l.orientation);
5108
- if (O) D = O, C = C.replaceAll("{rounded}", O).replaceAll("{edge}", O).replaceAll("{curve}", D);
5109
- else if (C.indexOf("{rounded}") != -1) if (S.xa == S.xb && S.xa == S.xc && S.xa == S.xd || S.ya == S.yb && S.ya == S.yc && S.ya == S.yd) D = "M" + S.xa + "," + S.ya + " L" + S.xd + "," + S.yd, C = C.replaceAll("{rounded}", D);
5110
- else if (Math.abs(S.xa - S.xd) <= e.LINK_ROUNDED_CORNERS && Math.abs(S.xa - S.xc) <= e.LINK_ROUNDED_CORNERS && Math.abs(S.xa - S.xb) <= e.LINK_ROUNDED_CORNERS) D = "M" + S.xa + "," + S.ya + " L" + S.xa + "," + S.yd, C = C.replaceAll("{rounded}", D);
5111
- else if (Math.abs(S.ya - S.yd) <= e.LINK_ROUNDED_CORNERS && Math.abs(S.ya - S.yc) <= e.LINK_ROUNDED_CORNERS && Math.abs(S.ya - S.yb) <= e.LINK_ROUNDED_CORNERS) D = "M" + S.xa + "," + S.ya + " L" + S.xd + "," + S.ya, C = C.replaceAll("{rounded}", D);
5110
+ var O, k = e.ui._draggableLinkPath(n, t, b, S, m, l.orientation);
5111
+ if (k) O = k, w = w.replaceAll("{rounded}", k).replaceAll("{edge}", k).replaceAll("{curve}", O);
5112
+ else if (w.indexOf("{rounded}") != -1) if (S.xa == S.xb && S.xa == S.xc && S.xa == S.xd || S.ya == S.yb && S.ya == S.yc && S.ya == S.yd) O = "M" + S.xa + "," + S.ya + " L" + S.xd + "," + S.yd, w = w.replaceAll("{rounded}", O);
5113
+ else if (Math.abs(S.xa - S.xd) <= e.LINK_ROUNDED_CORNERS && Math.abs(S.xa - S.xc) <= e.LINK_ROUNDED_CORNERS && Math.abs(S.xa - S.xb) <= e.LINK_ROUNDED_CORNERS) O = "M" + S.xa + "," + S.ya + " L" + S.xa + "," + S.yd, w = w.replaceAll("{rounded}", O);
5114
+ else if (Math.abs(S.ya - S.yd) <= e.LINK_ROUNDED_CORNERS && Math.abs(S.ya - S.yc) <= e.LINK_ROUNDED_CORNERS && Math.abs(S.ya - S.yb) <= e.LINK_ROUNDED_CORNERS) O = "M" + S.xa + "," + S.ya + " L" + S.xd + "," + S.ya, w = w.replaceAll("{rounded}", O);
5112
5115
  else {
5113
- var k = e.ui._roundedEdge(S.xa, S.ya, S.xb, S.yb, S.xc, S.yc), A = e.ui._roundedEdge(S.xb, S.yb, S.xc, S.yc, S.xd, S.yd);
5114
- D = "M" + k.x1 + "," + k.y1 + " " + k.x2 + "," + k.y2 + " Q" + k.qx1 + "," + k.qy1 + " " + k.qx2 + "," + k.qy2 + " L" + A.x2 + "," + A.y2 + " Q" + A.qx1 + "," + A.qy1 + " " + A.qx2 + "," + A.qy2 + " L" + A.x3 + "," + A.y3, C = C.replaceAll("{rounded}", D);
5116
+ var A = e.ui._roundedEdge(S.xa, S.ya, S.xb, S.yb, S.xc, S.yc), j = e.ui._roundedEdge(S.xb, S.yb, S.xc, S.yc, S.xd, S.yd);
5117
+ O = "M" + A.x1 + "," + A.y1 + " " + A.x2 + "," + A.y2 + " Q" + A.qx1 + "," + A.qy1 + " " + A.qx2 + "," + A.qy2 + " L" + j.x2 + "," + j.y2 + " Q" + j.qx1 + "," + j.qy1 + " " + j.qx2 + "," + j.qy2 + " L" + j.x3 + "," + j.y3, w = w.replaceAll("{rounded}", O);
5115
5118
  }
5116
- else C.indexOf("{edge}") == -1 ? C.indexOf("{curve}") == -1 ? (D = C.replaceAll("{xa}", S.xa).replaceAll("{ya}", S.ya).replaceAll("{xb}", S.xb).replaceAll("{yb}", S.yb).replaceAll("{xc}", S.xc).replaceAll("{yc}", S.yc).replaceAll("{xd}", S.xd).replaceAll("{yd}", S.yd), C = D) : (D = "M" + S.xa + "," + S.ya + " C" + S.xb + "," + S.yb + " " + S.xc + "," + S.yc + " " + S.xd + "," + S.yd, C = C.replaceAll("{curve}", D)) : (D = "M" + S.xa + "," + S.ya + " " + S.xb + "," + S.yb + " " + S.xc + "," + S.yc + " L" + S.xd + "," + S.yd, C = C.replaceAll("{edge}", D));
5119
+ else w.indexOf("{edge}") == -1 ? w.indexOf("{curve}") == -1 ? (O = w.replaceAll("{xa}", S.xa).replaceAll("{ya}", S.ya).replaceAll("{xb}", S.xb).replaceAll("{yb}", S.yb).replaceAll("{xc}", S.xc).replaceAll("{yc}", S.yc).replaceAll("{xd}", S.xd).replaceAll("{yd}", S.yd), w = O) : (O = "M" + S.xa + "," + S.ya + " C" + S.xb + "," + S.yb + " " + S.xc + "," + S.yc + " " + S.xd + "," + S.yd, w = w.replaceAll("{curve}", O)) : (O = "M" + S.xa + "," + S.ya + " " + S.xb + "," + S.yb + " " + S.xc + "," + S.yc + " L" + S.xd + "," + S.yd, w = w.replaceAll("{edge}", O));
5117
5120
  d.push(e.linkOpenTag.replaceAll("{id}", t.id).replaceAll("{class}", "link " + b.tags.join(" ")).replaceAll("{child-id}", b.id));
5118
- var j = {
5121
+ var M = {
5119
5122
  node: t,
5120
5123
  cnode: b,
5121
5124
  p: S,
5122
- html: C,
5125
+ html: w,
5123
5126
  action: o
5124
5127
  };
5125
- e.events.publish("render-link", [n, j]), d.push(j.html), s && f.push({
5128
+ e.events.publish("render-link", [n, M]), d.push(M.html), s && f.push({
5126
5129
  id: t.id,
5127
5130
  childId: b.id,
5128
- html: j.html
5131
+ html: M.html
5129
5132
  });
5130
- var M = "";
5131
- for (var N in n.config.linkBinding) {
5132
- var P = n.config.linkBinding[N], F = n._get(b.id);
5133
- F && (j.value = F[P], j.element = u[N], j.name = P, e.events.publish("label", [n, j]) !== !1 && !e.isNEU(j.value) && !e.isNEU(j.element) && (M += j.element.replace("{val}", j.value)));
5134
- }
5135
- if (M != "") {
5136
- var I = S.x, ee = S.y;
5137
- b.movey != null && (ee += b.movey), M = e.linkFieldsOpenTag.replace("{x}", I).replace("{y}", ee).replace("{rotate}", p) + M + e.grCloseTag, d.push(M);
5133
+ var N = "";
5134
+ for (var P in n.config.linkBinding) {
5135
+ var F = n.config.linkBinding[P], I = n._get(b.id);
5136
+ I && (M.value = I[F], M.element = u[P], M.name = F, e.events.publish("label", [n, M]) !== !1 && !e.isNEU(M.value) && !e.isNEU(M.element) && (N += M.element.replace("{val}", M.value)));
5137
+ }
5138
+ if (N != "") {
5139
+ var ee = S.x, L = S.y;
5140
+ b.movey != null && (L += b.movey), N = e.linkFieldsOpenTag.replace("{x}", ee).replace("{y}", L).replace("{rotate}", p) + N + e.grCloseTag, d.push(N);
5138
5141
  }
5139
5142
  d.push(e.grCloseTag);
5140
5143
  }
package/package.json CHANGED
@@ -58,5 +58,5 @@
58
58
  "url": "git+https://github.com/BALKANGraph/OrgChartJS.git"
59
59
  },
60
60
  "dependencies": {},
61
- "version": "9.2.38"
61
+ "version": "9.2.40"
62
62
  }