@balkangraph/orgchart.js 8.16.17 → 8.16.18
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.js +1 -1
- package/package.json +1 -1
package/orgchart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var OrgChart=function(t,e){("string"==typeof t||t instanceof String)&&(t=document.querySelector(t));var r=this;Object.defineProperty(this,"element",{get:()=>t,set(i){t=i,i&&r._constructor(e)}}),this.element=t};OrgChart.prototype._constructor=function(t){var e=this;if(this.config=OrgChart.mergeDeep(OrgChart._defaultConfig(t),t),this._layoutConfigs={base:{orientation:this.config.orientation,levelSeparation:this.config.levelSeparation,mixedHierarchyNodesSeparation:this.config.mixedHierarchyNodesSeparation,assistantSeparation:this.config.assistantSeparation,subtreeSeparation:this.config.subtreeSeparation,siblingSeparation:this.config.siblingSeparation,layout:this.config.layout,columns:this.config.columns,collapse:this.config.collapse,partnerNodeSeparation:this.config.partnerNodeSeparation}},this.config.tags)for(var r in this.config.tags){var i=this.config.tags[r];null!=i.subTreeConfig&&(this._layoutConfigs[r]={orientation:null!=i.subTreeConfig.orientation?i.subTreeConfig.orientation:this.config.orientation,levelSeparation:null!=i.subTreeConfig.levelSeparation?i.subTreeConfig.levelSeparation:this.config.levelSeparation,mixedHierarchyNodesSeparation:null!=i.subTreeConfig.mixedHierarchyNodesSeparation?i.subTreeConfig.mixedHierarchyNodesSeparation:this.config.mixedHierarchyNodesSeparation,assistantSeparation:null!=i.subTreeConfig.assistantSeparation?i.subTreeConfig.assistantSeparation:this.config.assistantSeparation,subtreeSeparation:null!=i.subTreeConfig.subtreeSeparation?i.subTreeConfig.subtreeSeparation:this.config.subtreeSeparation,siblingSeparation:null!=i.subTreeConfig.siblingSeparation?i.subTreeConfig.siblingSeparation:this.config.siblingSeparation,layout:null!=i.subTreeConfig.layout?i.subTreeConfig.layout:this.config.layout,columns:null!=i.subTreeConfig.columns?i.subTreeConfig.columns:this.config.columns,collapse:null!=i.subTreeConfig.collapse?i.subTreeConfig.collapse:this.config.collapse,partnerNodeSeparation:null!=i.subTreeConfig.partnerNodeSeparation?i.subTreeConfig.partnerNodeSeparation:this.config.partnerNodeSeparation})}this._event_id=OrgChart._guid(),OrgChart._validateConfig(this.config)&&(this._vScroll={},this.config.ui||(this.ui=OrgChart.ui),this.config.editUI?this.editUI=this.config.editUI:this.editUI=new OrgChart.editUI,this.editUI.init(this),this.config.filterUI?this.filterUI=this.config.filterUI:this.filterUI=new OrgChart.filterUI,this.filterUI.init(this),this.manager=new OrgChart.manager(this),this._ai=new OrgChart._ai(this),this.config.searchUI?this.searchUI=this.config.searchUI:this.searchUI=new OrgChart.searchUI,this.config.aiUI?this.aiUI=this.config.aiUI:this.aiUI=new OrgChart.aiUI,this.config.nodeMenuUI?this.nodeMenuUI=this.config.nodeMenuUI:this.nodeMenuUI=new OrgChart.menuUI,this.nodeMenuUI.init(this,this.config.nodeMenu),this.config.nodeCircleMenuUI?this.nodeCircleMenuUI=this.config.nodeCircleMenuUI:this.nodeCircleMenuUI=new OrgChart.circleMenuUI,this.nodeCircleMenuUI.init(this,this.config.nodeCircleMenu),this.config.nodeContextMenuUI?this.nodeContextMenuUI=this.config.nodeContextMenuUI:this.nodeContextMenuUI=new OrgChart.menuUI,this.nodeContextMenuUI.init(this,this.config.nodeContextMenu),this.config.toolbarUI?this.toolbarUI=this.config.toolbarUI:this.toolbarUI=new OrgChart.toolbarUI,this.config.notifierUI?this.notifierUI=this.config.notifierUI:this.notifierUI=new OrgChart.notifierUI,this.notifierUI.init(this),this.config.menuUI?this.menuUI=this.config.menuUI:this.menuUI=new OrgChart.menuUI,this.menuUI.init(this,this.config.menu),this.config.xScrollUI||(this.xScrollUI=new OrgChart.xScrollUI(this.element,this.config,(function(){return{boundary:e.response.boundary,scale:e.getScale(),viewBox:e.getViewBox(),padding:e.config.padding}}),(function(t){e.setViewBox(t)}),(function(){e._draw(!0,OrgChart.action.xScroll)}))),this.config.yScrollUI||(this.yScrollUI=new OrgChart.yScrollUI(this.element,this.config,(function(){return{boundary:e.response.boundary,scale:e.getScale(),viewBox:e.getViewBox(),padding:e.config.padding}}),(function(t){e.setViewBox(t)}),(function(){e._draw(!0,OrgChart.action.xScroll)}))),this.config.undoRedoUI?this.undoRedoUI=this.config.undoRedoUI:this.undoRedoUI=new OrgChart.undoRedoUI,this.element.classList.add("boc-"+this.config.mode),this._gragStartedId=null,this._timeout=null,this._touch=null,this._initialized=!1,this._loaded=!1,this._moveInterval=null,this._movePosition=null,this.response=null,this.nodes=null,this.isVisible=null,OrgChart._intersectionObserver(this.element,(function(t){e.isVisible=t,!1!==OrgChart.events.publish("visibility-change",[e])&&OrgChart.LAZY_LOADING&&e.isVisible&&(e._loaded?e._draw(!1,OrgChart.action.update):(e._setInitialSizeIfNotSet(),e._draw(!1,OrgChart.action.init)))})))},OrgChart._defaultConfig=function(t){return{interactive:!0,mode:"light",lazyLoading:"auto",enableDragDrop:!1,enableSearch:!0,enableAI:!1,enableTouch:!1,enablePan:!0,keyNavigation:!1,miniMap:!1,nodeMenu:null,nodeCircleMenu:null,nodeContextMenu:null,menu:null,toolbar:!1,sticky:!0,nodeMouseClick:OrgChart.action.details,nodeMouseDbClick:OrgChart.none,mouseScrool:OrgChart.action.zoom,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:OrgChart.orientation.top,layout:OrgChart.layout.normal,layoutGridColumns:"dynamic",scaleInitial:1,movable:null,scaleMin:.1,scaleMax:5,orderBy:null,editUI:null,aiUI:null,filterUI:null,searchUI:null,xScrollUI:null,yScrollUI:null,nodeMenuUI: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:OrgChart.CENTER,UI:null,anim:{func:OrgChart.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",cancelBtn:"Cancel",generateElementsFromFields:!0,focusBinding:null,buttons:{edit:{icon:OrgChart.icon.edit(24,24,"#fff"),text:"Edit",hideIfEditMode:!0,hideIfDetailsMode:!1},share:{icon:OrgChart.icon.share(24,24,"#fff"),text:"Share"},pdf:{icon:OrgChart.icon.pdf(24,24,"#fff"),text:"Save as PDF"},remove:{icon:OrgChart.icon.remove(24,24,"#fff"),text:"Remove",hideIfDetailsMode:!0}},elements:[]}}},OrgChart.prototype.load=function(t,e){var r=this;return this.config.nodes=t,this._draw(!1,OrgChart.action.init,void 0,(function(){r.filterUI.update(),e&&e()})),this},OrgChart.prototype.loadXML=function(t,e){var r=OrgChart._xml2json(t);return this.load(r,e)},OrgChart.prototype.getXML=function(){return OrgChart._json2xml(this.config.nodes)},OrgChart.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},OrgChart.prototype.removeListener=function(t,e){return OrgChart.events.remove(t,e,this._event_id)},OrgChart.prototype.draw=function(t,e,r){null==t&&(t=OrgChart.action.update),this._draw(!1,t,e,r)},OrgChart.prototype._draw=function(t,e,r,i){var n=this;if(!OrgChart.LAZY_LOADING||this.isVisible)if(OrgChart.LAZY_LOADING||this._initialized||(this._setInitialSizeIfNotSet(),0!=this.width()&&0!=this.height())){this._hideBeforeAnimationCompleted=!1;var a=e==OrgChart.action.init?null:this.getViewBox();this.manager.read(t,this.width(),this.height(),a,e,r,(function(t){if(!n.notifierUI.show(t.notif)){e!=OrgChart.action.exporting&&(n.nodes=t.nodes,n.visibleNodeIds=t.visibleNodeIds,n.roots=t.roots),n.editUI.fields=t.allFields;var a={defs:""};OrgChart.events.publish("renderdefs",[n,a]);var o=n.ui.defs(a.defs),s=n.getScale(t.viewBox);o+=n.ui.pointer(n.config,e,s);var l=n.getViewBox(),h=t.viewBox;a={content:o,res:t};OrgChart.events.publish("prerender",[n,a]),o=a.content;var c=[];if(OrgChart.RENDER_LINKS_BEFORE_NODES)for(var d=0;d<t.visibleNodeIds.length;d++){var g=t.nodes[t.visibleNodeIds[d]];OrgChart.getRootOf(g).stParent?c.push(g.id):o+=n.ui.link(g,n,s,t.bordersByRootIdAndLevel,t.nodes,e)}for(d=0;d<t.visibleNodeIds.length;d++){g=t.nodes[t.visibleNodeIds[d]];var p=n._get(g.id);OrgChart.RENDER_LINKS_BEFORE_NODES&&c.includes(g.id)&&(o+=n.ui.link(g,n,s,t.bordersByRootIdAndLevel,t.nodes,e)),o+=n.ui.node(g,p,t.animations,n.config,void 0,void 0,void 0,e,s,n)}for(d=0;d<t.visibleNodeIds.length;d++){g=t.nodes[t.visibleNodeIds[d]];OrgChart.RENDER_LINKS_BEFORE_NODES||(o+=n.ui.link(g,n,s,t.bordersByRootIdAndLevel,t.nodes,e)),o+=n.ui.expandCollapseBtn(n,g,n._layoutConfigs,e,s)}a={content:o,res:t};if(OrgChart.events.publish("render",[n,a]),o=a.content,t=a.res,o+=n.ui.lonely(n.config),e!==OrgChart.action.exporting){e!==OrgChart.action.centernode&&e!==OrgChart.action.insert&&e!==OrgChart.action.expand&&e!==OrgChart.action.collapse&&e!==OrgChart.action.update||(h=l),e===OrgChart.action.init&&null!=l&&(h=l),n.response=t;x=n.ui.svg(n.width(),n.height(),h,n.config,o);if(n._initialized){var u=n.getSvg(),f=u.parentNode;f.removeChild(u),f.insertAdjacentHTML("afterbegin",x),n._attachEventHandlers(),n.xScrollUI.addListener(n.getSvg()),n.yScrollUI.addListener(n.getSvg()),n.xScrollUI.setPosition(),n.yScrollUI.setPosition()}else n.element.innerHTML=n.ui.css()+x+n.ui.menuButton(n.config)+n.ui.aiButton(n.config),n._attachInitEventHandlers(),n._attachEventHandlers(),n.xScrollUI.create(n.width(),n.config.padding),n.xScrollUI.setPosition(),n.xScrollUI.addListener(n.getSvg()),n.yScrollUI.create(n.height(),n.config.padding),n.yScrollUI.setPosition(),n.yScrollUI.addListener(n.getSvg()),n.config.enableSearch&&n.searchUI.init(n),n.aiUI.init(n),n.toolbarUI.init(n,n.config.toolbar),n.undoRedoUI.init(n);var m=!1,C=n.response.animations;if(C[0].length>0){n._hideBeforeAnimation(C[0].length);for(d=0;d<C[0].length;d++)C[0][d]=n.getNodeElement(C[0][d]);OrgChart.animate(C[0],C[1],C[2],n.config.anim.duration,n.config.anim.func,(function(){m||(i&&i(),OrgChart.events.publish("redraw",[n]),n._showAfterAnimation(),m=!0)}))}e===OrgChart.action.centerNode?OrgChart.animate(n.getSvg(),{viewbox:l},{viewbox:n.response.viewBox},n.config.anim.duration,n.config.anim.func,(function(){n.ripple(r.options.rippleId),m||(i&&i(),OrgChart.events.publish("redraw",[n]),n._showAfterAnimation(),m=!0)}),(function(){n.xScrollUI.setPosition(),n.yScrollUI.setPosition()})):!l||!n.response||l[0]==n.response.viewBox[0]&&l[1]==n.response.viewBox[1]&&l[2]==n.response.viewBox[2]&&l[3]==n.response.viewBox[3]||e!==OrgChart.action.insert&&e!==OrgChart.action.expand&&e!==OrgChart.action.collapse&&e!==OrgChart.action.update&&e!==OrgChart.action.init?0==C[0].length&&(m||(i&&i(),OrgChart.events.publish("redraw",[n]),m=!0)):OrgChart.animate(n.getSvg(),{viewbox:l},{viewbox:n.response.viewBox},2*n.config.anim.duration,n.config.anim.func,(function(){n.xScrollUI.setPosition(),n.yScrollUI.setPosition(),m||(i&&i(),OrgChart.events.publish("redraw",[n]),m=!0)})),n._initialized||(n._initialized=!0,n.filterUI.update(),n._ai.setContext(),OrgChart.events.publish("init",[n])),!n._loaded&&t&&t.nodes&&Object.keys(t.nodes).length&&(n._loaded=!0)}else{var b=t.boundary,v=b.maxX-b.minX,O=b.maxY-b.minY,x=n.ui.svg(v,O,[b.minX,b.minY,v,O],n.config,o,s);i(x,t)}}}),(function(t){OrgChart.events.publish("ready",[n,t])}))}else console.error("Cannot load the chart with size 0! If you are using the OrgChart within tabs set OrgChart.LAZY_LOADING to true! ")},OrgChart.prototype._setInitialSizeIfNotSet=function(){this.element.style.overflow="hidden",this.element.style.position="relative",0==this.element.offsetHeight&&(this.element.style.height="100%",0==this.element.offsetHeight&&(this.element.style.height="700px")),0==this.element.offsetWidth&&(this.element.style.width="100%",0==this.element.offsetWidth&&(this.element.style.width="700px"))},OrgChart.prototype.width=function(){return this.element.offsetWidth},OrgChart.prototype.height=function(){return this.element.offsetHeight},OrgChart.prototype.getViewBox=function(){var t=this.getSvg();return OrgChart._getViewBox(t)},OrgChart.prototype.setViewBox=function(t){this.getSvg().setAttribute("viewBox",t.toString())},OrgChart.prototype.getScale=function(t){return t||(t=this.getViewBox()),OrgChart.getScale(t,this.width(),this.height(),this.config.scaleInitial,this.config.scaleMax,this.config.scaleMin)},OrgChart.prototype.setScale=function(t){t>this.config.scaleMax&&(t=this.config.scaleMax),t<this.config.scaleMin&&(t=this.config.scaleMin);var e=this.getViewBox().slice(0),r=this.width(),i=this.height(),n=r/e[2],a=i/e[3],o=n>a?a:n,s=e,l=e[2],h=e[3];return e[2]=e[2]/(t/o),e[3]=e[3]/(t/o),e[0]=s[0]-(e[2]-l)/2,e[1]=s[1]-(e[3]-h)/2,this.setViewBox(e),OrgChart.events.publish("redraw",[this]),t},OrgChart.prototype.ripple=function(t,e,r){var i=this.getNode(t);if(null!=i){var n=this.getNodeElement(t);if(null!=n){var a=this.getScale(),o=i.w/2,s=i.h/2;if(void 0!==e&&void 0!==r){var l=n.getBoundingClientRect();o=e/a-l.left/a,s=r/a-l.top/a}var h=i.w,c=i.h,d=h-o>o?h-o:o,g=c-s>s?c-s:s,p=d>g?d:g,u=document.createElementNS("http://www.w3.org/2000/svg","g"),f=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),m=document.createElementNS("http://www.w3.org/2000/svg","rect"),C=document.createElementNS("http://www.w3.org/2000/svg","circle"),b=OrgChart.randomId();f.setAttribute("id",b);var v={ripple:OrgChart.t(i.templateName,i.min,this.getScale()).ripple,node:i};OrgChart.events.publish("ripple",[this,v]),m.setAttribute("x",v.ripple.rect?v.ripple.rect.x:0),m.setAttribute("y",v.ripple.rect?v.ripple.rect.y:0),m.setAttribute("width",v.ripple.rect?v.ripple.rect.width:i.w),m.setAttribute("height",v.ripple.rect?v.ripple.rect.height:i.h),m.setAttribute("rx",v.ripple.radius),m.setAttribute("ry",v.ripple.radius),C.setAttribute("clip-path","url(#"+b+")"),C.setAttribute("cx",o),C.setAttribute("cy",s),C.setAttribute("r",0),C.setAttribute("fill",v.ripple.color),C.setAttribute("class","boc-ripple"),f.appendChild(m),u.appendChild(f),u.appendChild(C),n.appendChild(u),OrgChart.animate(C,{r:0,opacity:1},{r:p,opacity:0},500,OrgChart.anim.outPow,(function(){n.removeChild(u)}))}}},OrgChart.prototype.center=function(t,e,r){var i,n,a=t,o=!0,s=!0;e&&null!=e.parentState&&(i=e.parentState),e&&null!=e.childrenState&&(n=e.childrenState),e&&null!=e.rippleId&&(a=e.rippleId),e&&null!=e.vertical&&(o=e.vertical),e&&null!=e.horizontal&&(s=e.horizontal);var l={parentState:i,childrenState:n,rippleId:a,vertical:o,horizontal:s};this._draw(!1,OrgChart.action.centerNode,{id:t,options:l},r)},OrgChart.prototype.fit=function(t){this.config.scaleInitial=OrgChart.match.boundary,this._draw(!0,OrgChart.action.init,{method:"fit"},t)},OrgChart.prototype.toggleFullScreen=function(){var t=document.querySelector("["+OrgChart.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=OrgChart.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=OrgChart.toolbarUI.closeFullScreenIcon))},OrgChart.prototype.getNode=function(t){return this.nodes[t]},OrgChart.prototype.setLayout=function(t,e){e||(e="base"),this._layoutConfigs[e].layout=t,"base"==e&&(this.config.layout=t),this._draw(!1,OrgChart.action.update)},OrgChart.prototype.setOrientation=function(t,e,r){var i=this;e||(e="base"),this._layoutConfigs[e].orientation=t,"base"==e&&(this.config.orientation=t),this._draw(!1,OrgChart.action.update,void 0,(function(){OrgChart._moveToBoundaryArea(i.getSvg(),i.getViewBox(),i.response.boundary,(function(){i._draw(!0,OrgChart.action.pan),r&&r()}))}))},OrgChart.prototype.search=function(t,e,r){return OrgChart.isNEU(e)&&(e=this.searchUI._searchFields),OrgChart.isNEU(r)&&(r=e),OrgChart._search.search(this.config.nodes,t,e,r,this.config.searchDisplayField,this.config.searchFieldsWeight,this.searchUI._searchFieldsAbbreviation)},OrgChart.prototype._hideBeforeAnimation=function(t){if(1!=this._hideBeforeAnimationCompleted&&!(t&&t<OrgChart.ANIM_THRESHOLD)){var e=this.element.getElementsByTagName("text");if(e.length>OrgChart.TEXT_THRESHOLD)for(var r=0;r<e.length;r++)e[r].style.display="none";var i=this.element.getElementsByTagName("image");if(i.length>OrgChart.IMAGES_THRESHOLD)for(r=0;r<i.length;r++)i[r].style.display="none";var n=this.element.querySelectorAll("["+OrgChart.attr.link_id+"]");if(n.length>OrgChart.LINKS_THRESHOLD)for(r=0;r<n.length;r++)n[r].style.display="none";var a=this.element.querySelectorAll("["+OrgChart.attr.control_expcoll_id+"]");if(a.length>OrgChart.BUTTONS_THRESHOLD)for(r=0;r<a.length;r++)a[r].style.display="none";var o=this.element.querySelectorAll("["+OrgChart.attr.control_up_id+"]");if(o.length>OrgChart.BUTTONS_THRESHOLD)for(r=0;r<o.length;r++)o[r].style.display="none";this._hideBeforeAnimationCompleted=!0}},OrgChart.prototype._showAfterAnimation=function(){for(var t=this.element.getElementsByTagName("text"),e=0;e<t.length;e++)t[e].style.display="";var r=this.element.getElementsByTagName("image");for(e=0;e<r.length;e++)r[e].style.display="";var i=this.element.querySelectorAll("["+OrgChart.attr.link_id+"]");for(e=0;e<i.length;e++)i[e].style.display="";var n=this.element.querySelectorAll("["+OrgChart.attr.control_expcoll_id+"]");for(e=0;e<n.length;e++)n[e].style.display="";var a=this.element.querySelectorAll("["+OrgChart.attr.control_up_id+"]");for(e=0;e<a.length;e++)a[e].style.display="";this._hideBeforeAnimationCompleted=!1},OrgChart.prototype.isChild=function(t,e){for(var r=this.getNode(e);r;){if(r.id==t)return!0;r=r.parent?r.parent:r.stParent}return!1},OrgChart.prototype.getCollapsedIds=function(t){for(var e=[],r=0;r<t.childrenIds.length;r++){var i=this.getNode(t.childrenIds[r]);1==i.collapsed&&e.push(i.id)}return e},OrgChart.prototype.stateToUrl=function(){if(this.manager.state){var t={};return t.exp=this.manager.state.exp.join("*"),t.min=this.manager.state.min.join("*"),t.adjustify=this.manager.state.adjustify.x+"*"+this.manager.state.adjustify.y,t.scale=this.manager.state.scale,t.y=this.manager.state.x,t.x=this.manager.state.y,new URLSearchParams(t).toString()}return""},OrgChart.prototype.generateId=function(){for(;;){var t="_"+("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4);if(null==this.nodes||!this.nodes.hasOwnProperty(t))return t}},OrgChart.prototype.moveNodesToVisibleArea=function(t,e){for(var r=this,i=this.getSvg(),n=this.getViewBox(),a=null,o=null,s=null,l=null,h=0;h<t.length;h++){var c=this.nodes[t[h]];(null===a||a<c.x+c.w)&&(a=c.x+c.w),(null===o||o<c.y+c.h)&&(o=c.y+c.h),(null===s||s>c.x)&&(s=c.x),(null===l||l>c.y)&&(l=c.y)}var d=this.width(),g=this.height(),p=d/(b=a-s+2*this.config.padding),u=g/(v=o-l+2*this.config.padding),f=p>u?u:p,m=Math.ceil(d/f),C=Math.ceil(g/f),b=0,v=0;if(m-2*this.config.padding>=a-s)b=(a+s)/2-m/2;else switch(b=firstRoot.x-m/2+OrgChart.manager._getNodeWidth(firstRoot,this.config)/2,this.config.orientation){case OrgChart.orientation.right:case OrgChart.orientation.right_top:(b=-(m/2-(s-a)/2))<this.config.padding-m&&(b=this.config.padding-m);break;case OrgChart.orientation.left:case OrgChart.orientation.bottom_left:case OrgChart.orientation.top_left:case OrgChart.orientation.left_top:(b=-(m/2-(a-s)/2))>-this.config.padding&&(b=-this.config.padding)}if(C-2*this.config.padding>=o-l)v=(o+l)/2-C/2;else switch((v=-(C/2-(o-l)/2))>-this.config.padding&&(v=-this.config.padding),this.config.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:(v=-(C/2-(l-o)/2))<this.config.padding-C&&(v=this.config.padding-C);break;case OrgChart.orientation.left:case OrgChart.orientation.right:v=firstRoot.y-C/2+OrgChart.manager._getNodeWidth(firstRoot,this.config)/2}var O=[b,v,m,C];n[0]!==O[0]||n[1]!==O[1]?OrgChart.animate(i,{viewBox:n},{viewBox:O},this.config.anim.duration,this.config.anim.func,(function(){r.draw(OrgChart.action.update,void 0,e)})):e&&e()},OrgChart.prototype._nodeHasHiddenParent=function(t){return!t.parent&&!OrgChart.isNEU(t.pid)&&this.getNode(t.pid)},OrgChart.prototype.destroy=function(){this._removeEvent(window,"resize"),OrgChart.events.removeForEventId(this._event_id),this.element.innerHTML=null},OrgChart.localStorage={},OrgChart.localStorage.getItem=function(t){var e=localStorage.getItem("to_date");if(e){if((e=new Date(e))<new Date){for(var r=0,i=localStorage.length;r<i;++r){var n=localStorage.key(r);n&&n.startsWith&&n.startsWith('{"n"')&&localStorage.removeItem(n)}localStorage.removeItem("to_date")}}else(e=new Date).setDate(e.getDate()+5),e=e.toISOString(),localStorage.setItem("to_date",e);return localStorage.getItem(t)},OrgChart.localStorage.setItem=function(t,e){try{localStorage.setItem(t,e)}catch(t){t.code==t.QUOTA_EXCEEDED_ERR?(console.warn("Local storage quota exceeded"),localStorage.clear()):(console.error("Local storage error code:"+t.code),console.error(t))}},OrgChart.prototype.canUpdateLink=function(t,e){if(null==e||null==e)return!1;if(null==t||null==t)return!1;if(t==e)return!1;var r=this.getNode(e),i=this.getNode(t);return!(r&&i&&(r.isPartner||r.hasPartners&&i.isAssistant||r.hasAssistants&&i.isPartner))&&!this.isChild(t,e)},OrgChart.prototype._canUpdateLink=OrgChart.prototype.canUpdateLink,OrgChart.prototype.updateNode=function(t,e,r){var i=this,n=this.get(t.id);if(!0===r&&!1===OrgChart.events.publish("update",[this,n,t]))return!1;this.update(t),this._ai.setContext(),OrgChart.events.publish("updated",[this]),this.filterUI.update();var a=this.getNode(t.id),o=a.pid;null==o&&(o=a.stpid),this._draw(!1,OrgChart.action.update,{id:o},(function(){i.ripple(t.id),e&&e()}))},OrgChart.prototype.update=function(t){for(var e=0;e<this.config.nodes.length;e++)if(this.config.nodes[e].id==t.id){this._putInUndoStack(),this.clearRedo(),this.config.nodes[e]=t;break}return this},OrgChart.prototype.removeNode=function(t,e,r){var i=this;if(!this.canRemove(t))return!1;var n=this._getNewPidsAndStpidsForIds(t);if(!0===r&&!1===OrgChart.events.publish("remove",[this,t,n]))return!1;return this.remove(t),this._ai.setContext(),OrgChart.events.publish("updated",[this]),this.filterUI.update(),this._draw(!1,OrgChart.action.update,null,(function(){i.config.sticky&&OrgChart._moveToBoundaryArea(i.getSvg(),i.getViewBox(),i.response.boundary),e&&e()})),!0},OrgChart.prototype.remove=function(t){var e=this.get(t);if(e){this._putInUndoStack(),this.clearRedo();for(var r=this.config.nodes.length-1;r>=0;r--)this.config.nodes[r].pid!=t&&this.config.nodes[r].stpid!=t||(this.config.nodes[r].pid=e.pid,this.config.nodes[r].stpid=e.stpid),this.config.nodes[r].id==t&&this.config.nodes.splice(r,1)}return this},OrgChart.prototype._getNewPidsAndStpidsForIds=function(t){var e=this.get(t),r={},i={};if(e)for(var n=this.config.nodes.length-1;n>=0;n--)this.config.nodes[n].pid==t?r[this.config.nodes[n].id]=e.pid:this.config.nodes[n].stpid==t&&(i[this.config.nodes[n].id]=e.stpid);return{newPidsForIds:r,newStpidsForIds:i}},OrgChart.prototype.addNode=function(t,e,r){var i=this;if(!0===r&&!1===OrgChart.events.publish("add",[this,t]))return!1;this.add(t),this._ai.setContext(),OrgChart.events.publish("updated",[this]),this.filterUI.update(),i._draw(!1,OrgChart.action.insert,{id:t.pid,insertedNodeId:t.id},(function(){i.ripple(t.id),e&&e()}))},OrgChart.prototype.add=function(t){if(null==t.id&&console.error("Call addNode without id"),this._putInUndoStack(),this.clearRedo(),this.config.movable&&!OrgChart.isNEU(t.pid)){var e=this._get(t.pid);e&&(null!=e.movex&&(t.movex=e.movex),null!=e.movey&&(t.movey=e.movey))}return this.config.nodes.push(t),this},OrgChart.prototype.replaceIds=function(t,e){this._replaceIds(t),this._draw(!1,OrgChart.action.update,void 0,e)},OrgChart.prototype._replaceIds=function(t){for(var e=function(e){for(var r=0;r<e.length;r++){var i=e[r];for(var n in t){var a=t[n];i.from==n&&(i.from=a),i.to==n&&(i.to=a)}}},r=0;r<this.config.nodes.length;r++){var i=this.config.nodes[r];for(var n in t){var a=t[n];i.id==n&&(i.id=a),i.pid==n&&(i.pid=a),i.stpid==n&&(i.stpid=a),i.ppid==n&&(i.ppid=a)}}if(Array.isArray(this.config.roots))for(r=0;r<this.config.roots.length;r++)OrgChart.isNEU(t[this.config.roots[r]])||(this.config.roots[r]=t[this.config.roots[r]]);if(this.nodes)for(var o in this.nodes)if(!OrgChart.isNEU(t[o])){a=t[o];(s=this.nodes[o]).id=a,this.nodes[a]=s}if(this.manager.oldNodes)for(var o in this.manager.oldNodes)if(!OrgChart.isNEU(t[o])){a=t[o];(s=this.manager.oldNodes[o]).id=a,this.manager.oldNodes[a]=s}if(this.roots)for(var o in this.roots)if(!OrgChart.isNEU(t[o])){var s;a=t[o];(s=this.roots[o]).id=a,this.roots[a]=s}e(this.config.clinks),e(this.config.slinks),e(this.config.groupDottedLines),e(this.config.dottedLines)},OrgChart.prototype._get=function(t){var e=this.__get(t);if(e)return e;if((this.config.groupDottedLines.length||this.config.dottedLines.length)&&!OrgChart.isNEU(t)&&"string"==typeof t&&(-1!=t.indexOf("balkan_group_dotted_")||-1!=t.indexOf("balkan_dotted_"))){var r=(t=(t=t.replace("balkan_group_dotted_","")).replace("balkan_dotted_","")).indexOf("_balkan_id_");if(t=t.substring(r+11),e=this.__get(t))return e}return null},OrgChart.prototype.__get=function(t){for(var e=0;e<this.config.nodes.length;e++)if(this.config.nodes[e].id==t)return this.config.nodes[e];return null},OrgChart.prototype.get=function(t){var e=this._get(t);return null==e?null:JSON.parse(JSON.stringify(e))},OrgChart.prototype.canRemove=function(t){var e=this.getNode(t);return!!e&&(!e.hasPartners&&!e.hasAssistants)},void 0===OrgChart&&(OrgChart={}),OrgChart._ajax=function(t,e,r,i,n){null==i&&(i="arraybuffer");var a=new XMLHttpRequest;a.onload=function(t){4==a.readyState&&200===this.status&&(null==t.target?n(this.response):n(t.target.response))},a.onerror=function(t){n({error:t})},a.open(e,t),a.responseType=i,a.setRequestHeader("Content-Type","application/json"),null==r?a.send():a.send(r)},void 0===OrgChart&&(OrgChart={}),OrgChart.animate=function(t,e,r,i,n,a,o){var s,l=10,h=1,c=i/l+1;document.getElementsByTagName("g");return Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]),Array.isArray(r)||(r=[r]),s=setInterval((function(){for(var d=0;d<t.length;d++)for(var g in r[d]){var p=OrgChart._arrayContains(["top","left","right","bottom","width","height"],g.toLowerCase())?"px":"";switch(g.toLowerCase()){case"d":var u=n((h*l-l)/i)*(r[d][g][0]-e[d][g][0])+e[d][g][0],f=n((h*l-l)/i)*(r[d][g][1]-e[d][g][1])+e[d][g][1];t[d].setAttribute("d",t[d].getAttribute("d")+" L"+u+" "+f);break;case"r":var m=n((h*l-l)/i)*(r[d][g]-e[d][g])+e[d][g];t[d].setAttribute("r",m);break;case"x1":m=n((h*l-l)/i)*(r[d][g]-e[d][g])+e[d][g];t[d].setAttribute("x1",m);break;case"x2":m=n((h*l-l)/i)*(r[d][g]-e[d][g])+e[d][g];t[d].setAttribute("x2",m);break;case"y1":m=n((h*l-l)/i)*(r[d][g]-e[d][g])+e[d][g];t[d].setAttribute("y1",m);break;case"y2":m=n((h*l-l)/i)*(r[d][g]-e[d][g])+e[d][g];t[d].setAttribute("y2",m);break;case"rotate3d":if(r[d][g]){var C=e[d][g],b=r[d][g],v=[0,0,0,0];for(var O in C)v[O]=n((h*l-l)/i)*(b[O]-C[O])+C[O];t[d].style.transform="rotate3d("+v.toString()+"deg)"}break;case"transform":if(r[d][g]){C=e[d][g],b=r[d][g],v=[0,0,0,0,0,0];for(var O in C)v[O]=n((h*l-l)/i)*(b[O]-C[O])+C[O];t[d].hasAttribute("transform")?t[d].setAttribute("transform","matrix("+v.toString()+")"):t[d].style.transform="matrix("+v.toString()+")"}break;case"viewbox":if(r[d][g]){C=e[d][g],b=r[d][g],v=[0,0,0,0];for(var O in C)v[O]=n((h*l-l)/i)*(b[O]-C[O])+C[O];t[d].setAttribute("viewBox",v.toString())}break;case"margin":if(r[d][g]){C=e[d][g],b=r[d][g],v=[0,0,0,0];for(var O in C)v[O]=n((h*l-l)/i)*(b[O]-C[O])+C[O];var x="";for(O=0;O<v.length;O++)x+=parseInt(v[O])+"px ";t[d]&&t[d].style&&(t[d].style[g]=x)}break;case"scrolly":m=n((h*l-l)/i)*(r[d][g]-e[d][g])+e[d][g];t[d].scrollTo(0,m);break;default:m=n((h*l-l)/i)*(r[d][g]-e[d][g])+e[d][g];t[d]&&t[d].style&&(t[d].style[g]=m+p)}}o&&o(),(h+=1)>c+1&&(clearInterval(s),a&&a(t))}),l)},OrgChart.anim={},OrgChart.anim.inPow=function(t){return t<0?0:t>1?1:Math.pow(t,2)},OrgChart.anim.outPow=function(t){if(t<0)return 0;if(t>1)return 1;return-1*(Math.pow(t-1,2)+-1)},OrgChart.anim.inOutPow=function(t){if(t<0)return 0;if(t>1)return 1;if((t*=2)<1)return OrgChart.anim.inPow(t,2)/2;return-.5*(Math.pow(t-2,2)+-2)},OrgChart.anim.inSin=function(t){return t<0?0:t>1?1:1-Math.cos(t*(Math.PI/2))},OrgChart.anim.outSin=function(t){return t<0?0:t>1?1:Math.sin(t*(Math.PI/2))},OrgChart.anim.inOutSin=function(t){return t<0?0:t>1?1:-.5*(Math.cos(Math.PI*t)-1)},OrgChart.anim.inExp=function(t){return t<0?0:t>1?1:Math.pow(2,10*(t-1))},OrgChart.anim.outExp=function(t){return t<0?0:t>1?1:1-Math.pow(2,-10*t)},OrgChart.anim.inOutExp=function(t){return t<0?0:t>1?1:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,10*(-2*t+1)))},OrgChart.anim.inCirc=function(t){return t<0?0:t>1?1:-(Math.sqrt(1-t*t)-1)},OrgChart.anim.outCirc=function(t){return t<0?0:t>1?1:Math.sqrt(1-(t-1)*(t-1))},OrgChart.anim.inOutCirc=function(t){return t<0?0:t>1?1:t<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(2*t-2)*(2*t-2))+1)},OrgChart.anim.rebound=function(t){return t<0?0:t>1?1:t<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-1.5/2.75)*(t-1.5/2.75)+.75):t<2.5/2.75?1-(7.5625*(t-2.25/2.75)*(t-2.25/2.75)+.9375):1-(7.5625*(t-2.625/2.75)*(t-2.625/2.75)+.984375)},OrgChart.anim.inBack=function(t){return t<0?0:t>1?1:t*t*(2.70158*t-1.70158)},OrgChart.anim.outBack=function(t){return t<0?0:t>1?1:(t-1)*(t-1)*(2.70158*(t-1)+1.70158)+1},OrgChart.anim.inOutBack=function(t){return t<0?0:t>1?1:t<.5?4*t*t*(7.1898*t-2.5949)*.5:.5*((2*t-2)*(2*t-2)*(3.5949*(2*t-2)+2.5949)+2)},OrgChart.anim.impulse=function(t){var e=2*t;return e*Math.exp(1-e)},OrgChart.anim.expPulse=function(t){return Math.exp(-2*Math.pow(t,2))},void 0===OrgChart&&(OrgChart={}),OrgChart.prototype._attachInitEventHandlers=function(t){this._addEvent(window,"resize",this._resizeHandler)},OrgChart.prototype._attachEventHandlers=function(t){if(this.config.interactive){t=this.getSvg();this.config.enableTouch||OrgChart.isMobile()?(this._addEvent(t,"touchstart",this._globalMouseDownHandler),this._addEvent(t,"touchend",this._globalClickHandler)):(this._addEvent(t,"mousedown",this._globalMouseDownHandler),this._addEvent(t,"click",this._globalClickHandler),this._addEvent(t,"contextmenu",this._globalContextHandler),this._addEvent(t,"dblclick",this._globalDbClickHandler),this.config.mouseScrool!=OrgChart.action.none&&this._addEvent(t,"wheel",this._mouseScrollHandler));var e=this.getMenuButton();e&&this._addEvent(e,"click",this._menuClickHandler)}},OrgChart.prototype._addEvent=function(t,e,r,i){var n,a;(i||(i=""),t.getListenerList||(t.getListenerList={}),t.getListenerList[e+i])||(n=this,a=r,r=function(){if(a)return a.apply(n,[this,arguments[0]])},t.addEventListener?"mousewheel"==e||"wheel"==e?t.addEventListener(e,o,{passive:!1}):t.addEventListener(e,o,!1):t.attachEvent("on"+e,(function(){var e=r.call(t,window.event);return!1===e&&(window.event.returnValue=!1,window.event.cancelBubble=!0),e})),t.getListenerList[e+i]=o);function o(t){var e=r.apply(this,arguments);return!1===e&&(t.stopPropagation(),t.preventDefault()),e}},OrgChart.prototype._removeEvent=function(t,e){if(t.getListenerList[e]){var r=t.getListenerList[e];t.removeEventListener(e,r,!1),delete t.getListenerList[e]}},void 0===OrgChart&&(OrgChart={}),OrgChart.VERSION="8.16.17",OrgChart.orientation={},OrgChart.orientation.top=0,OrgChart.orientation.bottom=1,OrgChart.orientation.right=2,OrgChart.orientation.left=3,OrgChart.orientation.top_left=4,OrgChart.orientation.bottom_left=5,OrgChart.orientation.right_top=6,OrgChart.orientation.left_top=7,OrgChart.align={},OrgChart.align.center=OrgChart.CENTER=8,OrgChart.align.orientation=OrgChart.ORIENTATION=9,OrgChart.attr={},OrgChart.attr.l="data-l",OrgChart.attr.id="data-id",OrgChart.attr.sl="data-sl",OrgChart.attr.lbl="data-lbl",OrgChart.attr.val="data-val",OrgChart.attr.tlbr="data-tlbr",OrgChart.attr.item="data-item",OrgChart.attr.layout="data-layout",OrgChart.attr.node_id="data-n-id",OrgChart.attr.link_id="data-l-id",OrgChart.attr.field_name="data-f-name",OrgChart.attr.c_link_to="data-c-l-to",OrgChart.attr.c_link_from="data-c-l-from",OrgChart.attr.s_link_to="data-s-l-to",OrgChart.attr.s_link_from="data-s-l-from",OrgChart.attr.control_add="data-ctrl-add",OrgChart.attr.control_expcoll_id="data-ctrl-ec-id",OrgChart.attr.control_up_id="data-ctrl-up-id",OrgChart.attr.control_export_menu="data-ctrl-menu",OrgChart.attr.control_node_menu_id="data-ctrl-n-menu-id",OrgChart.attr.control_node_circle_menu_id="data-ctrl-n-c-menu-id",OrgChart.attr.control_node_circle_menu_name="data-ctrl-n-c-menu-name",OrgChart.attr.control_node_circle_menu_wrraper_id="data-ctrl-n-c-menu-wrapper-id",OrgChart.attr.width="data-width",OrgChart.attr.text_overflow="data-text-overflow",OrgChart.ID="id",OrgChart.PID="pid",OrgChart.STPID="stpid",OrgChart.TAGS="tags",OrgChart.NODES="nodes",OrgChart.ELASTIC="elastic",OrgChart.ASSISTANT="Assistant",OrgChart.action={},OrgChart.action.expand=0,OrgChart.action.collapse=1,OrgChart.action.maximize=101,OrgChart.action.minimize=102,OrgChart.action.expandCollapse=501,OrgChart.action.edit=1,OrgChart.action.zoom=2,OrgChart.action.ctrlZoom=22,OrgChart.action.scroll=41,OrgChart.action.xScroll=3,OrgChart.action.yScroll=4,OrgChart.action.none=5,OrgChart.action.init=6,OrgChart.action.update=7,OrgChart.action.move=70,OrgChart.action.pan=8,OrgChart.action.centerNode=9,OrgChart.action.resize=10,OrgChart.action.insert=11,OrgChart.action.insertfirst=12,OrgChart.action.details=13,OrgChart.action.exporting=14,OrgChart.none=400001,OrgChart.scroll={},OrgChart.scroll.visible=!0,OrgChart.scroll.smooth=12,OrgChart.scroll.speed=120,OrgChart.scroll.safari={smooth:12,speed:250},OrgChart.match={},OrgChart.match.height=100001,OrgChart.match.width=100002,OrgChart.match.boundary=100003,OrgChart.movable={},OrgChart.movable.node="node",OrgChart.movable.tree="tree",OrgChart.movable.detachTree="detachTree",OrgChart.layout={},OrgChart.layout.normal=OrgChart.normal=0,OrgChart.layout.mixed=OrgChart.mixed=1,OrgChart.layout.tree=OrgChart.tree=2,OrgChart.layout.treeLeftOffset=OrgChart.treeLeftOffset=3,OrgChart.layout.treeRightOffset=OrgChart.treeRightOffset=4,OrgChart.layout.treeLeft=5,OrgChart.layout.treeRight=6,OrgChart.layout.grid=-1,OrgChart.nodeOpenTag="<g "+OrgChart.attr.node_id+'="{id}" style="opacity: {opacity}" transform="matrix(1,0,0,1,{x},{y})" class="{class}" '+OrgChart.attr.sl+'="{sl}" '+OrgChart.attr.l+"={level} {lcn}>",OrgChart.linkOpenTag="<g "+OrgChart.attr.link_id+'="[{id}][{child-id}]" class="{class}">',OrgChart.expcollOpenTag="<g "+OrgChart.attr.control_expcoll_id+'="{id}" transform="matrix(1,0,0,1,{x},{y})" style="cursor:pointer;">',OrgChart.upOpenTag="<g "+OrgChart.attr.control_up_id+'="{id}" transform="matrix(1,0,0,1,{x},{y})" style="cursor:pointer;">',OrgChart.linkFieldsOpenTag='<g transform="matrix(1,0,0,1,{x},{y}) rotate({rotate})">',OrgChart.grCloseTag="</g>",OrgChart.A5w=420,OrgChart.A5h=595,OrgChart.A4w=595,OrgChart.A4h=842,OrgChart.A3w=842,OrgChart.A3h=1191,OrgChart.A2w=1191,OrgChart.A2h=1684,OrgChart.A1w=1684,OrgChart.A1h=2384,OrgChart.Letterw=612,OrgChart.Letterh=791,OrgChart.Legalw=612,OrgChart.Legalh=1009,OrgChart.COLLAPSE_PARENT_NEIGHBORS=1,OrgChart.COLLAPSE_SUB_CHILDRENS=2,OrgChart.COLLAPSE_PARENT_SUB_CHILDREN_EXCEPT_CLICKED=3,OrgChart.TEXT_THRESHOLD=4e3,OrgChart.IMAGES_THRESHOLD=1e3,OrgChart.LINKS_THRESHOLD=2e3,OrgChart.BUTTONS_THRESHOLD=700,OrgChart.ANIM_THRESHOLD=500,OrgChart.IT_IS_LONELY_HERE='<g transform="translate(-100, 0)" style="cursor:pointer;" '+OrgChart.attr.control_add+'="control-add"><text fill="#039be5">{link}</text></g>',OrgChart.RES={},OrgChart.IT_IS_LONELY_HERE_LINK=OrgChart.RES.IT_IS_LONELY_HERE_LINK="It's lonely here, add your first node",OrgChart.FIRE_DRAG_NOT_CLICK_IF_MOVE=3,OrgChart.STRING_TAGS=!1,OrgChart.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>",OrgChart.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>",OrgChart.SEARCH_PLACEHOLDER="Search... type ? to get help.",OrgChart.SEARCH_HELP_SYMBOL="?",OrgChart.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE=!1,OrgChart.SEARCH_RESULT_LIMIT=10,OrgChart.IMPORT_MESSAGE="Choose the columns (fields) in your data file that contain the required information.",OrgChart.FIXED_POSITION_ON_CLICK=!1,OrgChart.RENDER_LINKS_BEFORE_NODES=!1,OrgChart.RENDER_CLINKS_BEFORE_NODES=!1,OrgChart.MIXED_LAYOUT_ALL_NODES=!0,OrgChart.MIXED_LAYOUT_FOR_NODES_WITH_COLLAPSED_CHILDREN=!1,OrgChart.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN=1,OrgChart.LINK_ROUNDED_CORNERS=5,OrgChart.MOVE_STEP=5,OrgChart.CLINK_CURVE=1,OrgChart.MAX_DEPTH=200,OrgChart.SCALE_FACTOR=1.44,OrgChart.LAZY_LOADING_FACTOR="auto",OrgChart.HIDE_EDIT_FORM_ON_PAN=!0,OrgChart.LAZY_LOADING=!0,OrgChart.ARRAY_FIELDS=["tags"],OrgChart.CSV_DELIMITER=",",OrgChart.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>',OrgChart.ESCAPE_HTML=!1,OrgChart.VERTICAL_CHILDREN_ASSISTANT=!1,OrgChart.EXPORT_PAGES_CUT_NODES=!1,OrgChart.RESET_MOVABLE_ONEXPANDCOLLAPSE=!1,OrgChart.FILTER_ALPHABETICALLY=!0,OrgChart.SERVER_PREFIX=".azurewebsites.net/api/OrgChartJS",OrgChart.FUNC_URL_NAME="func-url-orgchartjs",OrgChart.MINIMUM_SYMBOLS_IN_SEARCH_INPUT=1,OrgChart.AI_SYSTEM_MESSAGES=[],"undefined"!=typeof module&&(module.exports=OrgChart),OrgChart._intersects=function(t,e,r){var i=t.x-r.siblingSeparation/4,n=t.y,a=t.x+t.w+r.siblingSeparation/4,o=t.y;switch(r.orientation){case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:i=t.x,n=t.y-r.siblingSeparation/4,a=t.x,o=t.y+t.h+r.siblingSeparation/4}var s,l,h,c=e.p,d=e.q,g=e.r,p=e.s;return 0!==(s=(a-i)*(p-d)-(g-c)*(o-n))&&(l=((n-o)*(g-i)+(a-i)*(p-n))/s,0<(h=((p-d)*(g-i)+(c-g)*(p-n))/s)&&h<1&&0<l&&l<1)},OrgChart._addPoint=function(t,e,r,i,n){switch(r.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:return OrgChart._addPointTop(t,e,r,i,n);case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:return OrgChart._addPointBottom(t,e,r,i,n);case OrgChart.orientation.left:case OrgChart.orientation.left_top:return OrgChart._addPointLeft(t,e,r,i,n);case OrgChart.orientation.right:case OrgChart.orientation.right_top:return OrgChart._addPointRight(t,e,r,i,n)}},OrgChart._addPointTop=function(t,e,r,i,n){var a,o,s;return"left"==n?a=t.leftNeighbor?t.x+(t.leftNeighbor.x+t.leftNeighbor.w-t.x)/2:t.x-r.siblingSeparation/2:"right"==n&&(a=t.rightNeighbor?t.x+t.w+(t.rightNeighbor.x-(t.x+t.w))/2:t.x+t.w+r.siblingSeparation/2),e.push([a,e[e.length-1][1]]),e.push([a,t.y-r.levelSeparation/3]),o=e[e.length-1][1],s=a,i.p=a,i.q=o,i.r=s,i},OrgChart._addPointBottom=function(t,e,r,i,n){var a,o,s;return"left"==n?a=t.leftNeighbor?t.x+(t.leftNeighbor.x+t.leftNeighbor.w-t.x)/2:t.x-r.siblingSeparation/2:"right"==n&&(a=t.rightNeighbor?t.x+t.w+(t.rightNeighbor.x-(t.x+t.w))/2:t.x+t.w+r.siblingSeparation/2),e.push([a,e[e.length-1][1]]),e.push([a,t.y+t.h+r.levelSeparation/3]),o=e[e.length-1][1],s=a,i.p=a,i.q=o,i.r=s,i},OrgChart._addPointLeft=function(t,e,r,i,n){var a,o=e[e.length-1][0];"bottom"==n?a=t.rightNeighbor?t.y+t.h+(t.rightNeighbor.y-(t.y+t.h))/2:t.y+t.h+r.siblingSeparation/2:"top"==n&&(a=t.leftNeighbor?t.y+(t.leftNeighbor.y+t.leftNeighbor.h-t.y)/2:t.y-r.siblingSeparation/2),e.push([e[e.length-1][0],a]),e.push([t.x-r.levelSeparation/3,a]),o=e[e.length-1][0];var s=a;return i.p=o,i.q=a,i.s=s,i},OrgChart._addPointRight=function(t,e,r,i,n){var a,o=e[e.length-1][0];"bottom"==n?a=t.rightNeighbor?t.y+t.h+(t.rightNeighbor.y-(t.y+t.h))/2:t.y+t.h+r.siblingSeparation/2:"top"==n&&(a=t.leftNeighbor?t.y+(t.leftNeighbor.y+t.leftNeighbor.h-t.y)/2:t.y-r.siblingSeparation/2),e.push([e[e.length-1][0],a]),e.push([t.x+t.w+r.levelSeparation/3,a]),o=e[e.length-1][0];var s=a;return i.p=o,i.q=a,i.s=s,i},OrgChart.editUI=function(){},OrgChart.editUI.prototype.init=function(t){this.obj=t,this.fields=null,this._event_id=OrgChart._guid()},OrgChart.editUI.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},OrgChart.editUI.prototype.show=function(t,e,r){if(this.hide(),!1===OrgChart.events.publish("show",[this,t]))return!1;var i=this,n=this.content(t,e,r);this.obj.element.appendChild(n.element),OrgChart.input.init(this.obj.element),OrgChart.events.publish("shown",[this,{nodeId:t}]),r?e||this._focusElement(n.focusId):this.interval=OrgChart.animate(n.element,{right:-20,opacity:0},{right:0,opacity:1},300,OrgChart.anim.outSin,(function(){e||i._focusElement(n.focusId)})),this.obj.element.querySelector("[data-edit-from-close]").addEventListener("click",(function(e){e.preventDefault(),!1!==OrgChart.events.publish("cancel",[i,{id:t}])&&i.hide()})),this.obj.element.querySelector("[data-edit-from-cancel]").addEventListener("click",(function(e){e.preventDefault(),!1!==OrgChart.events.publish("cancel",[i,{id:t}])&&i.hide()})),this.obj.element.querySelector("[data-edit-from-save]").addEventListener("click",(function(e){e.preventDefault();var r=OrgChart.input.validateAndGetData(n.element);if(!1!==r){var a=i.obj.get(t),o={data:OrgChart.mergeDeep(a,r)};if(!1===OrgChart.events.publish("save",[i,o]))return;i.obj.updateNode(o.data,null,!0),i.hide()}}));for(var a=this.obj.element.querySelectorAll("[data-input-btn]"),o=0;o<a.length;o++){a[o].addEventListener("click",(function(e){e.preventDefault(),OrgChart.events.publish("element-btn-click",[i,{input:this.parentNode.querySelector("input"),nodeId:t,event:e}])}))}this.obj.element.querySelector("[data-add-more-fields-btn]").addEventListener("click",(function(t){t.stopPropagation(),t.preventDefault();var e=this,r=OrgChart.elements.textbox({},{type:"textbox",label:i.obj.config.editForm.addMoreFieldName,btn:i.obj.config.editForm.addMoreBtn},"280px");e.parentNode.insertAdjacentHTML("beforebegin",r.html),e.style.display="none",OrgChart.input.init(e.parentNode.previousSibling);var n=document.getElementById(r.id);n.focus(),n.nextElementSibling.addEventListener("click",(function(t){t.stopPropagation(),t.preventDefault();var r=n.value,a=i.obj.element.querySelector('[data-binding="'+OrgChart._escapeDoubleQuotes(n.value)+'"]');if(OrgChart.isNEU(r)||a)n.focus();else{var o=OrgChart.elements.textbox({},{type:"textbox",label:r,binding:r},"280px");n.parentNode.parentNode.parentNode.removeChild(n.parentNode.parentNode),e.parentNode.insertAdjacentHTML("beforebegin",o.html),e.style.display="",OrgChart.input.init(e.parentNode.previousSibling),document.getElementById(o.id).focus()}}))})),this.obj.element.querySelector("[data-boc-edit-from-btns]").addEventListener("click",(function(e){for(var r=e.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:e};if(!1===OrgChart.events.publish("button-click",[i,o]))return!1;switch(a){case"edit":i.obj.editUI.show(t,!1,!0);break;case"pdf":i.obj.exportPDFProfile({id:t,filename:n.title}),i.hide();break;case"png":i.obj.exportPNGProfile({id:t,filename:n.title}),i.hide();break;case"share":i.obj.shareProfile(t);break;case"remove":i.obj.removeNode(t,null,!0),i.hide()}}}))},OrgChart.editUI.prototype._focusElement=function(t){var e=null;OrgChart.isNEU(this.obj.config.editForm.focusBinding)?OrgChart.isNEU(t)||(e=document.getElementById(t)):e=this.obj.element.querySelector('[data-binding="'+this.obj.config.editForm.focusBinding+'"]'),e&&(e.value&&e.value.length&&e.setSelectionRange(e.value.length,e.value.length),e.focus())},OrgChart.editUI.prototype.content=function(t,e,r,i,n){var a,o=this.obj.config.editForm.readOnly,s=JSON.parse(JSON.stringify(this.obj.config.editForm.elements)),l=this.obj.config.editForm.addMore,h=this.obj.config.editForm.saveAndCloseBtn,c=this.obj.config.editForm.cancelBtn,d=this.obj.config.editForm.buttons,g=this.obj.config.editForm.titleBinding,p=this.obj.config.editForm.photoBinding,u=this.obj.getNode(t),f=this.obj._get(t),m=OrgChart.t(u.templateName,u.min,this.obj.getScale()),C=f[g],b=f[p];if(this.obj.config.editForm.generateElementsFromFields)for(var v=0;v<this.fields.length;v++){var O=this.fields[v];if("tags"!=O){for(var x=!1,y=0;y<s.length;y++){if(Array.isArray(s[y])){for(var _=0;_<s[y].length;_++)if(O==s[y][_].binding){x=!0;break}}else if(O==s[y].binding){x=!0;break}if(x)break}x||s.push({type:"textbox",label:O,binding:O})}}OrgChart.isNEU(C)&&(C=""),b=OrgChart.isNEU(b)?OrgChart.icon.user(150,150,"#8C8C8C",0,0):`<img style="width: 100%;height:100%;border-radius: 50%;object-fit:cover;" src="${b}"></img>`;var k=!e,w=e?"display:none;":"",S=e||!l?"display:none;":"",I=m.editFormHeaderColor?`style="background-color:${m.editFormHeaderColor};"`:"",A=document.createElement("form");if(A.setAttribute("data-boc-edit-form",""),A.classList.add("boc-edit-form"),A.classList.add(this.obj.config.mode),A.classList.add(u.templateName.replaceAll(" ","")),A.classList.add(OrgChart.ui._defsIds[u.templateName]),Array.isArray(u.tags)&&u.tags.length)for(v=0;v<u.tags.length;v++)A.classList.add(u.tags[v].replaceAll(" ",""));A.style.display="flex",A.style.opacity=r?1:0,A.style.right=r?0:"-20px",i&&(A.style.width=i);var L=[],E=n?"":OrgChart.EDITFORM_CLOSE_BTN;return A.innerHTML=`<div>\n <div class="boc-edit-form-header" ${I}>\n ${E}\n ${OrgChart.editUI.renderHeaderContent(C,b,u,f)}\n </div>\n <div data-boc-edit-from-btns class="boc-edit-form-instruments">\n ${function(){if(n)return"";var t="";for(var r in d){var i=d[r];OrgChart.isNEU(i)||(k&&i.hideIfEditMode||e&&i.hideIfDetailsMode||o&&"Edit"==i.text||(t+=`<div data-edit-from-btn='${r}' class="boc-img-button" ${I} title="${i.text}">${i.icon}</div>`))}return t}()} \n </div>\n </div>\n <div class="boc-edit-form-fields">\n <div class="boc-edit-form-fields-inner">\n <div class="boc-form-fieldset">\n ${function(){for(var t="",r=0;r<s.length;r++){var i=s[r];if(Array.isArray(i)){t+='<div class="boc-form-field-100 boc-form-fieldset">';for(var n=0;n<i.length;n++){var o=i[n],l=OrgChart.elements[o.type](f,o,"unset",e);!OrgChart.isNEU(l.id)&&OrgChart.isNEU(a)&&OrgChart.isNEU(l.value)&&(a=l.id),OrgChart.isNEU(l.value)||L.push(`${o.label}: ${l.value}`),t+=l.html}t+="</div>"}else{l=OrgChart.elements[i.type](f,i,"280px",e);!OrgChart.isNEU(l.id)&&OrgChart.isNEU(a)&&OrgChart.isNEU(l.value)&&(a=l.id),OrgChart.isNEU(l.value)||L.push(`${i.label}: ${l.value}`),t+=l.html}}return t}()}\n\n <div class="boc-form-field" style="min-width: 280px; text-align:center; ${S}">\n <a data-add-more-fields-btn href="#" class="boc-link">${l}</a>\n </div>\n </div> \n </div>\n </div>\n <div class="boc-form-fieldset" style="padding: 14px 10px; ${w}">\n <div class="boc-form-field" style="min-width: initial;">\n <button data-edit-from-cancel type="button" class="boc-button transparent">${c}</button>\n </div>\n <div class="boc-form-field" style="min-width: initial;">\n <button type="submit" data-edit-from-save type="button" class="boc-button">${h}</button>\n </div>\n </div>`,{element:A,focusId:a,title:C,shareText:L.join("\n")}},OrgChart.editUI.prototype.hide=function(){if(!1===OrgChart.events.publish("hide",[this]))return!1;OrgChart.isNEU(this.interval)&&(clearInterval(this.interval),this.interval=null);var t=this.obj.element.querySelector("[data-boc-edit-form]");t&&t.parentNode&&t.parentNode.removeChild(t)},OrgChart.editUI.renderHeaderContent=function(t,e,r,i){return`<h1 class="boc-edit-form-title">${OrgChart._escapeGreaterLessSign(t)}</h1>\n <div id="boc-avatar" class="boc-edit-form-avatar">${e}</div>`},OrgChart.prototype.getSvg=function(){var t=this.element.getElementsByTagName("svg");return t&&t.length?t[0]:null},OrgChart.prototype.getPointerElement=function(){return this.element.querySelector("g[data-pointer]")},OrgChart.prototype.getNodeElement=function(t){return this.element.querySelector("["+OrgChart.attr.node_id+"='"+t+"']")},OrgChart.prototype.getMenuButton=function(){return this.element.querySelector("["+OrgChart.attr.control_export_menu+"]")},OrgChart.menuUI=function(){},OrgChart.menuUI.prototype.init=function(t,e){this.obj=t,this.wrapper=null,this.menu=e,this._event_id=OrgChart._guid()},OrgChart.menuUI.prototype.showStickIn=function(t,e,r,i){this._show(t,null,e,r,i)},OrgChart.menuUI.prototype.show=function(t,e,r,i,n){this._show(t,e,r,i,n)},OrgChart.menuUI.prototype._show=function(t,e,r,i,n){var a=this;this.hide();var o="";n||(n=this.menu);var s={firstNodeId:r,secondNodeId:i,menu:n};if(!1===OrgChart.events.publish("show",[this,s]))return!1;for(var l in n=s.menu){var h=n[l].icon,c=n[l].text;void 0===h&&(h=OrgChart.icon[l]?OrgChart.icon[l](24,24,"#7A7A7A"):""),"function"==typeof c&&(c=c()),"function"==typeof h&&(h=h()),o+="<div "+OrgChart.attr.item+'="'+l+'">'+h+"<span> "+c+"</span></div>"}if(""!=o){if(this.wrapper=document.createElement("div"),this.wrapper.className="boc-chart-menu",this.wrapper.style.left="-99999px",this.wrapper.style.top="-99999px",this.wrapper.innerHTML=o,this.obj.element.appendChild(this.wrapper),null==e){var d=OrgChart._menuPosition(t,this.wrapper,this.obj.getSvg());t=d.x,e=d.y}var g=t+45;this.wrapper.style.left=g+"px",this.wrapper.style.top=e+"px",this.wrapper.style.left=g-this.wrapper.offsetWidth+"px";var p=t-this.wrapper.offsetWidth;OrgChart.animate(this.wrapper,{opacity:0,left:g-this.wrapper.offsetWidth},{opacity:1,left:p},300,OrgChart.anim.inOutPow);for(var u=this.wrapper.getElementsByTagName("div"),f=0;f<u.length;f++){(l=u[f]).addEventListener("click",(function(t){var e,o=this.getAttribute(OrgChart.attr.item);if(void 0===n[o].onClick)if("add"===o){var s={id:a.obj.generateId(),pid:r};a.obj.addNode(s,null,!0)}else if("edit"===o){var l=a.obj.getNode(r);a.obj.editUI.show(l.id)}else if("details"===o){l=a.obj.getNode(r);a.obj.editUI.show(l.id,!0)}else"remove"===o?a.obj.removeNode(r,null,!0):"svg"===o?a.obj.exportSVG({filename:"OrgChart.svg",expandChildren:!1,nodeId:r}):"pdf"===o?a.obj.exportPDF({filename:"OrgChart.pdf",expandChildren:!1,nodeId:r}):"png"===o?a.obj.exportPNG({filename:"OrgChart.png",expandChildren:!1,nodeId:r}):"csv"===o?a.obj.exportCSV({nodeId:r}):"xml"===o?a.obj.exportXML({nodeId:r}):"json"===o?a.obj.exportJSON({nodeId:r}):"visio"===o&&a.obj.exportVisio({nodeId:r});else e=n[o].onClick.call(a.obj,r,i);0!=e&&a.hide()}))}}},OrgChart.menuUI.prototype.isVisible=function(){return null!=this.wrapper},OrgChart.menuUI.prototype.hide=function(){null!=this.wrapper&&(this.obj.element.removeChild(this.wrapper),this.wrapper=null)},OrgChart.menuUI.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},OrgChart.circleMenuUI=function(){},OrgChart.circleMenuUI.prototype.init=function(t,e){this.obj=t,this.menu=e,this._menu=null,this._buttonsInterval=[],this._linesInterval=[],this._event_id=OrgChart._guid()},OrgChart.circleMenuUI.prototype.show=function(t,e){this._show(t,e)},OrgChart.circleMenuUI.prototype._show=function(t,e){var r=this,i=this.obj.getNode(t),n=OrgChart.t(i.templateName,i.min,this.obj.getScale());if(!OrgChart.isNEU(n.nodeCircleMenuButton)){var a=this.obj.getSvg(),o=this.obj.element.querySelector("["+OrgChart.attr.control_node_circle_menu_id+'="'+t+'"]'),s=this.obj.getNodeElement(t),l=OrgChart._getTransform(o),h=OrgChart._getTransform(s),c=l[4]+h[4],d=l[5]+h[5],g=o.querySelectorAll("line"),p=this.obj.element.querySelector("["+OrgChart.attr.control_node_circle_menu_wrraper_id+"]");if(OrgChart.isNEU(p)||p.getAttribute(OrgChart.attr.control_node_circle_menu_wrraper_id)!=t){this.hide(),e||(e=this.menu);var u={nodeId:t,menu:e},f=OrgChart.events.publish("show",[this,u]);if(this._menu=e,!1===f)return!1;for(var m=0,C=Object.keys(u.menu).length,b=2*n.nodeCircleMenuButton.radius+4,v=2*Math.PI*b,O=v/C-(2*n.nodeCircleMenuButton.radius+2);O<0;)b+=8,O=(v=2*Math.PI*b)/C-(2*n.nodeCircleMenuButton.radius+2);for(var x in(p=document.createElementNS("http://www.w3.org/2000/svg","g")).setAttribute(OrgChart.attr.control_node_circle_menu_wrraper_id,t),p.setAttribute("transform","matrix(1,0,0,1,"+c+","+d+")"),a.appendChild(p),u.menu){var y=u.menu[x].icon,_=u.menu[x].color,k=u.menu[x].text;"function"==typeof y&&(y=y()),"function"==typeof _&&(_=_()),"function"==typeof k&&(k=k());var w=document.createElementNS("http://www.w3.org/2000/svg","g");w.setAttribute("transform","matrix(1,0,0,1,0,0)"),w.setAttribute(OrgChart.attr.control_node_circle_menu_name,x),w.style.cursor="pointer";var S=document.createElementNS("http://www.w3.org/2000/svg","title");OrgChart.isNEU(k)||(S.innerHTML=k);var I=document.createElementNS("http://www.w3.org/2000/svg","circle");I.setAttribute("cx",0),I.setAttribute("cy",0),I.setAttribute("r",n.nodeCircleMenuButton.radius),I.setAttribute("fill",_),I.setAttribute("stroke-width","1"),I.setAttribute("stroke",n.nodeCircleMenuButton.stroke),w.appendChild(I),w.appendChild(S),w.innerHTML+=y,p.appendChild(w);var A=w.getElementsByTagName("svg")[0];if(A.setAttribute("pointer-events","none"),A){var L=parseInt(A.getAttribute("width")),E=parseInt(A.getAttribute("height"));A.setAttribute("x",-L/2),A.setAttribute("y",-E/2)}var N=m*Math.PI/(C/2);m++;var M=Math.cos(N)*b,T=Math.sin(N)*b;this._buttonsInterval.push(OrgChart.animate(w,{transform:[1,0,0,1,0,0]},{transform:[1,0,0,1,M,T]},250,OrgChart.anim.outBack,(function(t){var e=t[0].getAttribute(OrgChart.attr.control_node_circle_menu_name),i=t[0].parentNode.getAttribute(OrgChart.attr.control_node_circle_menu_wrraper_id);t[0].addEventListener("mouseenter",(function(t){OrgChart.events.publish("mouseenter",[r,{from:i,menuItem:u.menu[e],menuItemName:e,event:t}])})),t[0].addEventListener("mouseout",(function(t){OrgChart.events.publish("mouseout",[r,{from:i,menuItem:u.menu[e],menuItemName:e,event:t}])}))})))}this._linesInterval.push(OrgChart.animate(g[0],{x1:-n.nodeCircleMenuButton.radius/2,y1:-6,x2:n.nodeCircleMenuButton.radius/2,y2:-6},{x1:-7,y1:-7,x2:7,y2:7},500,OrgChart.anim.inOutSin)),this._linesInterval.push(OrgChart.animate(g[1],{x1:-n.nodeCircleMenuButton.radius/2,y1:0,x2:n.nodeCircleMenuButton.radius/2,y2:0},{x1:0,y1:0,x2:0,y2:0},500,OrgChart.anim.inOutSin)),this._linesInterval.push(OrgChart.animate(g[2],{x1:-n.nodeCircleMenuButton.radius/2,y1:6,x2:n.nodeCircleMenuButton.radius/2,y2:6},{x1:-7,y1:7,x2:7,y2:-7},500,OrgChart.anim.inOutSin))}else this.hide()}},OrgChart.circleMenuUI.prototype.hide=function(){for(var t=this._buttonsInterval.length-1;t>=0;t--)clearInterval(this._buttonsInterval[t]),this._buttonsInterval.splice(t,1);this._buttonsInterval=[];for(t=this._linesInterval.length-1;t>=0;t--)clearInterval(this._linesInterval[t]),this._linesInterval.splice(t,1);this._linesInterval=[];var e=this.obj.element.querySelector("["+OrgChart.attr.control_node_circle_menu_wrraper_id+"]");if(null!=e){var r=e.getAttribute(OrgChart.attr.control_node_circle_menu_wrraper_id),i=this.obj.getNode(r),n=OrgChart.t(i.templateName,i.min,this.obj.getScale()),a=this.obj.element.querySelector("["+OrgChart.attr.control_node_circle_menu_id+'="'+r+'"]').querySelectorAll("line");a[0].setAttribute("x1",-n.nodeCircleMenuButton.radius/2),a[0].setAttribute("x2",n.nodeCircleMenuButton.radius/2),a[0].setAttribute("y1",-6),a[0].setAttribute("y2",-6),a[1].setAttribute("x1",-n.nodeCircleMenuButton.radius/2),a[1].setAttribute("x2",n.nodeCircleMenuButton.radius/2),a[1].setAttribute("y1",0),a[1].setAttribute("y2",0),a[2].setAttribute("x1",-n.nodeCircleMenuButton.radius/2),a[2].setAttribute("x2",n.nodeCircleMenuButton.radius/2),a[2].setAttribute("y1",6),a[2].setAttribute("y2",6),e.parentElement.removeChild(e),e=null}},OrgChart.circleMenuUI.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},void 0===OrgChart&&(OrgChart={}),OrgChart.idb={version:1,dbName:"BALKAN",tableName:"orgchart-js",keyPath:"id"},OrgChart.idb.db=null,OrgChart.idb._open=function(t){if(OrgChart._browser().msie)t&&t(!1);else if((navigator.userAgent.toLowerCase().indexOf("safari")>0||navigator.userAgent.toLowerCase().indexOf("firefox")>0)&&window.location!==window.parent.location)t&&t(!1);else{if(!window.indexedDB)return console.error("Your browser doesn't support a stable version of IndexedDB."),void(t&&t(!1));if(null==OrgChart.idb.db){var e=indexedDB.open(OrgChart.idb.dbName,OrgChart.idb.version);e.onerror=function(e){console.error("Cannot open database!"),t&&t(!1)},e.onsuccess=function(e){OrgChart.idb.db=e.target.result,t&&t(!0)},e.onupgradeneeded=function(t){var e=t.target.result;e.objectStoreNames.contains(OrgChart.idb.tableName)&&e.deleteObjectStore(OrgChart.idb.tableName);e.createObjectStore(OrgChart.idb.tableName,{keyPath:OrgChart.idb.keyPath})}}else t&&t(!0)}},OrgChart.idb.read=function(t,e){OrgChart.idb._open((function(r){if(r){var i=OrgChart.idb.db.transaction([OrgChart.idb.tableName]).objectStore(OrgChart.idb.tableName).get(t);i.onerror=function(t){console.error("Unable to retrieve data from database!"),e&&e(!1)},i.onsuccess=function(t){i.result?e&&e(!0,i.result):e&&e(null)}}else e&&e(!1)}))},OrgChart.idb.write=function(t,e){OrgChart.idb.read(t.id,(function(r){if(null==r){var i=OrgChart.idb.db.transaction([OrgChart.idb.tableName],"readwrite").objectStore(OrgChart.idb.tableName).add(t);i.onerror=function(t){console.error("Unable to add data to database!"),e&&e(!1)},i.onsuccess=function(t){e&&e(!0)}}else e&&e(r)}))},OrgChart.idb.put=function(t,e){OrgChart.idb._open((function(r){if(r){var i=OrgChart.idb.db.transaction([OrgChart.idb.tableName],"readwrite").objectStore(OrgChart.idb.tableName).put(t);i.onerror=function(t){console.error("Unable to put data to database!"),e&&e(!1)},i.onsuccess=function(t){e&&e(!0)}}else e&&e(!1)}))},OrgChart.idb.delete=function(t,e){OrgChart.idb._open((function(r){if(r){var i=OrgChart.idb.db.transaction([OrgChart.idb.tableName],"readwrite").objectStore(OrgChart.idb.tableName).delete(t);i.onerror=function(t){console.error("Unable to retrieve data from database!"),e&&e(!1)},i.onsuccess=function(t){i.error?e&&e(!1):e&&e(!0)}}else e&&e(!1)}))},OrgChart.toolbarUI=function(){},OrgChart.toolbarUI.expandAllIcon='<svg style="margin-bottom:7px;box-shadow: 0px 1px 4px rgba(0,0,0,0.3); border: 1px solid #cacaca;background-color: #f9f9f9;display: block;cursor: pointer;" width="32px" height="32px"><marker id="arrow" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="4" markerHeight="4" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#757575" /></marker><line x1="11" y1="11" x2="6" y2="6" stroke="#757575" stroke-width="2" marker-end="url(#arrow)" /><line x1="21" y1="11" x2="26" y2="6" stroke="#757575" stroke-width="2" marker-end="url(#arrow)" /><line x1="21" y1="21" x2="26" y2="26" stroke="#757575" stroke-width="2" marker-end="url(#arrow)" /><line x1="11" y1="21" x2="6" y2="26" stroke="#757575" stroke-width="2" marker-end="url(#arrow)" /><rect x="12" y="12" width="8" height="8" fill="#757575"></rect></svg>',OrgChart.toolbarUI.fitIcon='<svg style="margin-bottom:7px;box-shadow: 0px 1px 4px rgba(0,0,0,0.3); border: 1px solid #cacaca;background-color: #f9f9f9;display: block;cursor: pointer;" width="32px" height="32px"><path stroke-width="3" fill="none" stroke="#757575" d="M4,11 L4,4 L11,4"></path><path stroke-width="3" fill="none" stroke="#757575" d="M28,11 L28,4 L21,4"></path><path stroke-width="3" fill="none" stroke="#757575" d="M28,21 L28,28 L21,28"></path><path stroke-width="3" fill="none" stroke="#757575" d="M4,21 L4,28 L11,28"></path><circle cx="16" cy="16" r="5" fill="#757575"></circle></svg>',OrgChart.toolbarUI.openFullScreenIcon='<svg style="margin-bottom:7px;box-shadow: 0px 1px 4px rgba(0,0,0,0.3); border: 1px solid #cacaca;background-color: #f9f9f9;display: block;cursor: pointer;" width="32px" height="32px"><path stroke-width="3" fill="none" stroke="#757575" d="M4,11 L4,4 L11,4"></path><path stroke-width="3" fill="none" stroke="#757575" d="M28,11 L28,4 L21,4"></path><path stroke-width="3" fill="none" stroke="#757575" d="M28,21 L28,28 L21,28"></path><path stroke-width="3" fill="none" stroke="#757575" d="M4,21 L4,28 L11,28"></path><line x1="5" y1="5" x2="27" y2="27" stroke-width="3" stroke="#757575"></line><line x1="5" y1="27" x2="27" y2="5" stroke-width="3" stroke="#757575"></line></svg>',OrgChart.toolbarUI.closeFullScreenIcon='<svg style="margin-bottom:7px;box-shadow: 0px 1px 4px rgba(0,0,0,0.3); border: 1px solid #cacaca;background-color: #f9f9f9;display: block;cursor: pointer;" width="32px" height="32px"><path stroke-width="3" fill="none" stroke="#757575" d="M4,11 L4,4 L11,4"></path><path stroke-width="3" fill="none" stroke="#757575" d="M28,11 L28,4 L21,4"></path><path stroke-width="3" fill="none" stroke="#757575" d="M28,21 L28,28 L21,28"></path><path stroke-width="3" fill="none" stroke="#757575" d="M4,21 L4,28 L11,28"></path><rect x="11" y="11" width="10" height="10" stroke-width="3" fill="none" stroke="#757575" ></rect></svg>',OrgChart.toolbarUI.zoomInIcon='<svg style="box-shadow: 0px 1px 4px rgba(0,0,0,0.3); border-left: 1px solid #cacaca; border-right: 1px solid #cacaca; border-top: 1px solid #cacaca; background-color: #f9f9f9;display: block; cursor: pointer;" width="32px" height="32px" ><g><rect fill="#f9f9f9" x="0" y="0" width="32" height="32" ></rect><line x1="8" y1="16" x2="24" y2="16" stroke-width="3" stroke="#757575"></line><line x1="16" y1="8" x2="16" y2="24" stroke-width="3" stroke="#757575"></line></g><line x1="4" y1="32" x2="28" y2="32" stroke-width="1" stroke="#cacaca"></line></svg>',OrgChart.toolbarUI.zoomOutIcon='<svg style="box-shadow: 0px 1px 4px rgba(0,0,0,0.3); margin-bottom:7px; border-left: 1px solid #cacaca; border-right: 1px solid #cacaca; border-bottom: 1px solid #cacaca; background-color: #f9f9f9;display: block; cursor: pointer;" width="32px" height="32px" ><g><rect fill="#f9f9f9" x="0" y="0" width="32" height="32" ></rect><line x1="8" y1="16" x2="24" y2="16" stroke-width="3" stroke="#757575"></line></g></svg>',OrgChart.toolbarUI.layoutIcon="<svg "+OrgChart.attr.tlbr+'="layout" style="box-shadow: 0px 1px 4px rgba(0,0,0,0.3); border: 1px solid #cacaca;background-color: #f9f9f9;display: block;cursor: pointer;" width="32px" height="32px"><path stroke-width="3" fill="none" stroke="#757575" d="M8,24 L16,14 L24,24"></path><path stroke-width="3" fill="none" stroke="#757575" d="M8,16 L16,8 L24,16"></path></svg>',OrgChart.toolbarUI.prototype.init=function(t,e){if(e){this.obj=t,this.toolbar=e,this._visible=!1,this.div=document.createElement("div"),this.div.classList.add("boc-toolbar-container"),Object.assign(this.div.style,{position:"absolute",padding:"3px",right:this.obj.config.padding-10+"px",bottom:this.obj.config.padding-10+"px"}),e.expandAll&&(this.div.innerHTML+="<div "+OrgChart.attr.tlbr+'="expand">'+OrgChart.toolbarUI.expandAllIcon+"</div>"),e.fit&&(this.div.innerHTML+="<div "+OrgChart.attr.tlbr+'="fit">'+OrgChart.toolbarUI.fitIcon+"</div>"),e.zoom&&(this.div.innerHTML+="<div "+OrgChart.attr.tlbr+'="plus">'+OrgChart.toolbarUI.zoomInIcon+"</div>",this.div.innerHTML+="<div "+OrgChart.attr.tlbr+'="minus">'+OrgChart.toolbarUI.zoomOutIcon+"</div>"),e.layout&&(this.div.innerHTML+="<div "+OrgChart.attr.tlbr+'="layout">'+OrgChart.toolbarUI.layoutIcon+"</div>",this.layouts=document.createElement("div"),this.layouts.classList.add("boc-toolbar-layout"),this.layouts.innerHTML='<svg data-layout="normal" style="cursor: pointer;" width="110" height="100"><rect fill="#039BE5" x="35" y="0" width="50" height="27"></rect><rect fill="#F57C00" x="7" y="41" width="50" height="27"></rect><rect fill="#F57C00" x="63" y="41" width="50" height="27"></rect><line stroke="#000000" x1="60" x2="60" y1="27" y2="35" stroke-width="1"></line><line stroke="#000000" x1="32" x2="88" y1="35" y2="35" stroke-width="1"></line><line stroke="#000000" x1="32" x2="32" y1="35" y2="41" stroke-width="1"></line><line stroke="#000000" x1="88" x2="88" y1="35" y2="41" stroke-width="1"></line></svg>\n <svg data-layout="treeRightOffset" style="cursor: pointer;" width="110" height="100"><rect fill="#039BE5" x="35" y="0" width="50" height="27"></rect><rect fill="#F57C00" x="40" y="41" width="50" height="27"></rect><rect fill="#F57C00" x="40" y="73" width="50" height="27"></rect><line stroke="#000000" x1="60" x2="60" y1="27" y2="35" stroke-width="1"></line><line stroke="#000000" x1="60" x2="35" y1="35" y2="35" stroke-width="1"></line><line stroke="#000000" x1="35" x2="35" y1="35" y2="86" stroke-width="1"></line><line stroke="#000000" x1="35" x2="40" y1="86" y2="86" stroke-width="1"></line><line stroke="#000000" x1="35" x2="40" y1="54" y2="54" stroke-width="1"></line></svg>\n <svg data-layout="treeLeftOffset" style="cursor: pointer;" width="110" height="100"><rect fill="#039BE5" x="35" y="0" width="50" height="27"></rect><rect fill="#F57C00" x="30" y="41" width="50" height="27"></rect><rect fill="#F57C00" x="30" y="73" width="50" height="27"></rect><line stroke="#000000" x1="60" x2="60" y1="27" y2="35" stroke-width="1"></line><line stroke="#000000" x1="60" x2="85" y1="35" y2="35" stroke-width="1"></line><line stroke="#000000" x1="85" x2="85" y1="35" y2="86" stroke-width="1"></line><line stroke="#000000" x1="80" x2="85" y1="86" y2="86" stroke-width="1"></line><line stroke="#000000" x1="80" x2="85" y1="54" y2="54" stroke-width="1"></line></svg>\n <svg data-layout="mixed" style="cursor: pointer;" width="110" height="100"><rect fill="#039BE5" x="35" y="0" width="50" height="27"></rect><rect fill="#F57C00" x="35" y="41" width="50" height="27"></rect><rect fill="#F57C00" x="35" y="73" width="50" height="27"></rect><line stroke="#000000" x1="60" x2="60" y1="27" y2="41" stroke-width="1"></line><line stroke="#000000" x1="60" x2="60" y1="68" y2="73" stroke-width="1"></line></svg>\n <svg data-layout="tree" style="cursor: pointer;" width="110" height="100"><rect fill="#039BE5" x="35" y="0" width="50" height="27"></rect><rect fill="#F57C00" x="7" y="41" width="50" height="27"></rect><rect fill="#F57C00" x="35" y="73" width="50" height="27"></rect><rect fill="#F57C00" x="63" y="41" width="50" height="27"></rect><line stroke="#000000" x1="60" x2="60" y1="27" y2="73" stroke-width="1"></line><line stroke="#000000" x1="57" x2="63" y1="54" y2="54" stroke-width="1"></line></svg>\n <svg data-layout="grid" style="cursor: pointer;" width="110" height="100"><rect fill="#039BE5" x="35" y="0" width="50" height="27"></rect><rect fill="#F57C00" x="7" y="41" width="50" height="27"></rect><rect fill="#F57C00" x="7" y="73" width="50" height="27"></rect><rect fill="#F57C00" x="63" y="41" width="50" height="27"></rect><rect fill="#F57C00" x="63" y="73" width="50" height="27"></rect><line stroke="#000000" x1="60" x2="60" y1="27" y2="71" stroke-width="1"></line><line stroke="#000000" x1="32" x2="88" y1="39" y2="39" stroke-width="1"></line><line stroke="#000000" x1="32" x2="88" y1="71" y2="71" stroke-width="1"></line><line stroke="#000000" x1="32" x2="32" y1="71" y2="73" stroke-width="1"></line><line stroke="#000000" x1="88" x2="88" y1="71" y2="73" stroke-width="1"></line><line stroke="#000000" x1="32" x2="32" y1="39" y2="41" stroke-width="1"></line><line stroke="#000000" x1="88" x2="88" y1="39" y2="41" stroke-width="1"></line></svg>',this.obj.element.appendChild(this.layouts)),e.fullScreen&&(this.div.innerHTML+="<div "+OrgChart.attr.tlbr+'="fullScreen">'+OrgChart.toolbarUI.openFullScreenIcon+"</div>"),this.obj.element.appendChild(this.div),this.layoutBtn=this.div.querySelector("["+OrgChart.attr.tlbr+'="layout"]');var r=this.div.querySelector("["+OrgChart.attr.tlbr+'="plus"]'),i=this.div.querySelector("["+OrgChart.attr.tlbr+'="minus"]'),n=this.div.querySelector("["+OrgChart.attr.tlbr+'="fit"]'),a=this.div.querySelector("["+OrgChart.attr.tlbr+'="fullScreen"]'),o=this.div.querySelector("["+OrgChart.attr.tlbr+'="expand"]'),s=this;r&&r.addEventListener("click",(function(){s.obj.zoom(!0,null,!0)})),i&&i.addEventListener("click",(function(){s.obj.zoom(!1,null,!0)})),n&&n.addEventListener("click",(function(){s.obj.fit()})),a&&a.addEventListener("click",(function(){s.obj.toggleFullScreen()})),o&&o.addEventListener("click",(function(){s.obj.expand(null,"all")})),this.layoutBtn&&this.layoutBtn.addEventListener("click",(function(){s._visible?s.hideLayout():s.showLayout()})),this.layouts&&this.layouts.addEventListener("click",(function(t){for(var e=t.target;e;){if(e.hasAttribute&&e.hasAttribute(OrgChart.attr.layout)){e=e.getAttribute(OrgChart.attr.layout),s.obj.setLayout(OrgChart.layout[e]);break}e=e.parentNode}}))}},OrgChart.toolbarUI.prototype.showLayout=function(){this._visible=!0,this.layoutBtn.style.transform="rotate(180deg) translateX(0px) translateY(0px)",OrgChart.animate(this.div,{bottom:this.obj.config.padding-10},{bottom:this.obj.config.padding+135},this.obj.config.anim.duration,this.obj.config.anim.func),OrgChart.animate(this.layouts,{bottom:-145},{bottom:0},this.obj.config.anim.duration,this.obj.config.anim.func)},OrgChart.toolbarUI.prototype.hideLayout=function(){this._visible=!1,this.layoutBtn.style.transform="rotate(0deg) translateX(0px) translateY(0px)",OrgChart.animate(this.div,{bottom:this.obj.config.padding+135},{bottom:this.obj.config.padding-10},this.obj.config.anim.duration,this.obj.config.anim.func),OrgChart.animate(this.layouts,{bottom:0},{bottom:-145},this.obj.config.anim.duration,this.obj.config.anim.func)},OrgChart.notifierUI=function(){},OrgChart.notifierUI.prototype.init=function(t){this.obj=t},OrgChart.notifierUI.prototype.show=function(t,e){if(null==t)return!1;1==t&&(t=OrgChart.MAX_NODES_MESS,e="#FFCA28"),2==t&&(t=OrgChart.OFFLINE_MESS,e="#FFCA28");var r=document.createElement("div");r.innerHTML=t,Object.assign(r.style,{position:"absolute","background-color":e,color:"#ffffff",padding:"15px","border-radius":"40px",opacity:0,overflow:"hidden","white-space":"nowrap","text-align":"center"}),this.obj.element.appendChild(r);var i=this.obj.width()/2-r.offsetWidth/2,n=this.obj.height()/2-r.offsetHeight/2;r.style.left=i+"px",r.style.top=n+"px";var a=r.offsetWidth;return r.style.width="20px",OrgChart.animate(r,{opacity:0,width:10},{opacity:1,width:a},this.obj.config.anim.duration,this.obj.config.anim.func),!0},void 0===OrgChart&&(OrgChart={}),OrgChart.icon={},OrgChart.icon.png=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 550.801 550.801"><path fill="'+r+'" d="M146.747,276.708c0-13.998-9.711-22.352-26.887-22.352c-6.99,0-11.726,0.675-14.204,1.355v44.927 c2.932,0.676,6.539,0.896,11.52,0.896C135.449,301.546,146.747,292.28,146.747,276.708z"/><path fill="'+r+'" d="M488.426,197.019H475.2v-63.816c0-0.398-0.063-0.799-0.116-1.202c-0.021-2.534-0.827-5.023-2.562-6.995L366.325,3.694 c-0.032-0.031-0.063-0.042-0.085-0.076c-0.633-0.707-1.371-1.295-2.151-1.804c-0.231-0.155-0.464-0.285-0.706-0.419 c-0.676-0.369-1.393-0.675-2.131-0.896c-0.2-0.056-0.38-0.138-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.873v160.545 c0,17.043,13.824,30.87,30.873,30.87h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87v-160.54C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.513c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M234.344,335.86v45.831h-31.601V229.524h40.184 l31.611,55.759c9.025,16.031,18.064,34.983,24.825,52.154h0.675c-2.257-20.103-2.933-40.643-2.933-63.44v-44.473h31.614v152.167 h-36.117l-32.516-58.703c-9.049-16.253-18.971-35.892-26.438-53.727l-0.665,0.222C233.906,289.58,234.344,311.027,234.344,335.86z M71.556,381.691V231.56c10.613-1.804,25.516-3.159,46.506-3.159c21.215,0,36.353,4.061,46.509,12.192 c9.698,7.673,16.255,20.313,16.255,35.219c0,14.897-4.959,27.549-13.999,36.123c-11.738,11.063-29.123,16.031-49.441,16.031 c-4.522,0-8.593-0.231-11.736-0.675v54.411H71.556V381.691z M453.601,523.353H97.2V419.302h356.4V523.353z M485.652,374.688 c-10.61,3.607-30.713,8.585-50.805,8.585c-27.759,0-47.872-7.003-61.857-20.545c-13.995-13.1-21.684-32.97-21.452-55.318 c0.222-50.569,37.03-79.463,86.917-79.463c19.644,0,34.783,3.829,42.219,7.446l-7.214,27.543c-8.369-3.617-18.752-6.55-35.458-6.55 c-28.656,0-50.341,16.256-50.341,49.22c0,31.382,19.649,49.892,47.872,49.892c7.895,0,14.218-0.901,16.934-2.257v-31.835h-23.493 v-26.869h56.679V374.688z"/></svg>'},OrgChart.icon.pdf=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 550.801 550.801"><path fill="'+r+'" d="M160.381,282.225c0-14.832-10.299-23.684-28.474-23.684c-7.414,0-12.437,0.715-15.071,1.432V307.6 c3.114,0.707,6.942,0.949,12.192,0.949C148.419,308.549,160.381,298.74,160.381,282.225z"/><path fill="'+r+'" d="M272.875,259.019c-8.145,0-13.397,0.717-16.519,1.435v105.523c3.116,0.729,8.142,0.729,12.69,0.729 c33.017,0.231,54.554-17.946,54.554-56.474C323.842,276.719,304.215,259.019,272.875,259.019z"/><path fill="'+r+'" d="M488.426,197.019H475.2v-63.816c0-0.398-0.063-0.799-0.116-1.202c-0.021-2.534-0.827-5.023-2.562-6.995L366.325,3.694 c-0.032-0.031-0.063-0.042-0.085-0.076c-0.633-0.707-1.371-1.295-2.151-1.804c-0.231-0.155-0.464-0.285-0.706-0.419 c-0.676-0.369-1.393-0.675-2.131-0.896c-0.2-0.056-0.38-0.138-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.873v160.545 c0,17.043,13.824,30.87,30.873,30.87h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87v-160.54C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.513c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M362.359,309.023c0,30.876-11.243,52.165-26.82,65.333 c-16.971,14.117-42.82,20.814-74.396,20.814c-18.9,0-32.297-1.197-41.401-2.389V234.365c13.399-2.149,30.878-3.346,49.304-3.346 c30.612,0,50.478,5.508,66.039,17.226C351.828,260.69,362.359,280.547,362.359,309.023z M80.7,393.499V234.365 c11.241-1.904,27.042-3.346,49.296-3.346c22.491,0,38.527,4.308,49.291,12.928c10.292,8.131,17.215,21.534,17.215,37.328 c0,15.799-5.25,29.198-14.829,38.285c-12.442,11.728-30.865,16.996-52.407,16.996c-4.778,0-9.1-0.243-12.435-0.723v57.67H80.7 V393.499z M453.601,523.353H97.2V419.302h356.4V523.353z M484.898,262.127h-61.989v36.851h57.913v29.674h-57.913v64.848h-36.593 V232.216h98.582V262.127z"/></svg>'},OrgChart.icon.svg=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 550.801 550.801"><path fill="'+r+'" d="M488.426,197.019H475.2v-63.816c0-0.398-0.063-0.799-0.116-1.202c-0.021-2.534-0.827-5.023-2.562-6.995L366.325,3.694 c-0.032-0.031-0.063-0.042-0.085-0.076c-0.633-0.707-1.371-1.295-2.151-1.804c-0.231-0.155-0.464-0.285-0.706-0.419 c-0.676-0.369-1.393-0.675-2.131-0.896c-0.2-0.056-0.38-0.138-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.873v160.545 c0,17.043,13.824,30.87,30.873,30.87h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87v-160.54C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.513c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M338.871,225.672L284.545,386.96h-42.591 l-51.69-161.288h39.967l19.617,68.196c5.508,19.143,10.531,37.567,14.36,57.67h0.717c4.061-19.385,9.089-38.527,14.592-56.953 l20.585-68.918h38.77V225.672z M68.458,379.54l7.415-30.153c9.811,5.021,24.888,10.051,40.439,10.051 c16.751,0,25.607-6.935,25.607-17.465c0-10.052-7.662-15.795-27.05-22.734c-26.8-9.328-44.263-24.168-44.263-47.611 c0-27.524,22.971-48.579,61.014-48.579c18.188,0,31.591,3.823,41.159,8.131l-8.126,29.437c-6.465-3.116-17.945-7.657-33.745-7.657 c-15.791,0-23.454,7.183-23.454,15.552c0,10.296,9.089,14.842,29.917,22.731c28.468,10.536,41.871,25.365,41.871,48.094 c0,27.042-20.812,50.013-65.09,50.013C95.731,389.349,77.538,384.571,68.458,379.54z M453.601,523.353H97.2V419.302h356.4V523.353z M488.911,379.54c-11.243,3.823-32.537,9.103-53.831,9.103c-29.437,0-50.73-7.426-65.57-21.779 c-14.839-13.875-22.971-34.942-22.738-58.625c0.253-53.604,39.255-84.235,92.137-84.235c20.81,0,36.852,4.073,44.74,7.896 l-7.657,29.202c-8.859-3.829-19.849-6.95-37.567-6.95c-30.396,0-53.357,17.233-53.357,52.173c0,33.265,20.81,52.882,50.73,52.882 c8.375,0,15.072-0.96,17.94-2.395v-33.745h-24.875v-28.471h60.049V379.54L488.911,379.54z" /></svg>'},OrgChart.icon.csv=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 548.29 548.291" ><path fill="'+r+'" d="M486.2,196.121h-13.164V132.59c0-0.399-0.064-0.795-0.116-1.2c-0.021-2.52-0.824-5-2.551-6.96L364.656,3.677 c-0.031-0.034-0.064-0.044-0.085-0.075c-0.629-0.707-1.364-1.292-2.141-1.796c-0.231-0.157-0.462-0.286-0.704-0.419 c-0.672-0.365-1.386-0.672-2.121-0.893c-0.199-0.052-0.377-0.134-0.576-0.188C358.229,0.118,357.4,0,356.562,0H96.757 C84.893,0,75.256,9.649,75.256,21.502v174.613H62.093c-16.972,0-30.733,13.756-30.733,30.73v159.81 c0,16.966,13.761,30.736,30.733,30.736h13.163V526.79c0,11.854,9.637,21.501,21.501,21.501h354.777 c11.853,0,21.502-9.647,21.502-21.501V417.392H486.2c16.966,0,30.729-13.764,30.729-30.731v-159.81 C516.93,209.872,503.166,196.121,486.2,196.121z M96.757,21.502h249.053v110.006c0,5.94,4.818,10.751,10.751,10.751h94.973v53.861 H96.757V21.502z M258.618,313.18c-26.68-9.291-44.063-24.053-44.063-47.389c0-27.404,22.861-48.368,60.733-48.368 c18.107,0,31.447,3.811,40.968,8.107l-8.09,29.3c-6.43-3.107-17.862-7.632-33.59-7.632c-15.717,0-23.339,7.149-23.339,15.485 c0,10.247,9.047,14.769,29.78,22.632c28.341,10.479,41.681,25.239,41.681,47.874c0,26.909-20.721,49.786-64.792,49.786 c-18.338,0-36.449-4.776-45.497-9.77l7.38-30.016c9.772,5.014,24.775,10.006,40.264,10.006c16.671,0,25.488-6.908,25.488-17.396 C285.536,325.789,277.909,320.078,258.618,313.18z M69.474,302.692c0-54.781,39.074-85.269,87.654-85.269 c18.822,0,33.113,3.811,39.549,7.149l-7.392,28.816c-7.38-3.084-17.632-5.939-30.491-5.939c-28.822,0-51.206,17.375-51.206,53.099 c0,32.158,19.051,52.4,51.456,52.4c10.947,0,23.097-2.378,30.241-5.238l5.483,28.346c-6.672,3.34-21.674,6.919-41.208,6.919 C98.06,382.976,69.474,348.424,69.474,302.692z M451.534,520.962H96.757v-103.57h354.777V520.962z M427.518,380.583h-42.399 l-51.45-160.536h39.787l19.526,67.894c5.479,19.046,10.479,37.386,14.299,57.397h0.709c4.048-19.298,9.045-38.352,14.526-56.693 l20.487-68.598h38.599L427.518,380.583z" /></svg>'},OrgChart.icon.json=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 32 32" ><polygon fill="'+r+'" points="31 11 31 21 29 21 27 15 27 21 25 21 25 11 27 11 29 17 29 11 31 11"/><path fill="'+r+'" d="M21.3335,21h-2.667A1.6684,1.6684,0,0,1,17,19.3335v-6.667A1.6684,1.6684,0,0,1,18.6665,11h2.667A1.6684,1.6684,0,0,1,23,12.6665v6.667A1.6684,1.6684,0,0,1,21.3335,21ZM19,19h2V13H19Z"/><path fill="'+r+'" d="M13.3335,21H9V19h4V17H11a2.002,2.002,0,0,1-2-2V12.6665A1.6684,1.6684,0,0,1,10.6665,11H15v2H11v2h2a2.002,2.002,0,0,1,2,2v2.3335A1.6684,1.6684,0,0,1,13.3335,21Z"/><path fill="'+r+'" d="M5.3335,21H2.6665A1.6684,1.6684,0,0,1,1,19.3335V17H3v2H5V11H7v8.3335A1.6684,1.6684,0,0,1,5.3335,21Z"/><rect fill="'+r+'" id="_Transparent_Rectangle_" data-name="<Transparent Rectangle>" style="fill: none;" width="32" height="32"/></svg>'},OrgChart.icon.excel=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 512 512"><path fill="#ECEFF1" d="M496,432.011H272c-8.832,0-16-7.168-16-16s0-311.168,0-320s7.168-16,16-16h224 c8.832,0,16,7.168,16,16v320C512,424.843,504.832,432.011,496,432.011z" /><path fill="'+r+'" d="M336,176.011h-64c-8.832,0-16-7.168-16-16s7.168-16,16-16h64c8.832,0,16,7.168,16,16 S344.832,176.011,336,176.011z" /><path fill="'+r+'" d="M336,240.011h-64c-8.832,0-16-7.168-16-16s7.168-16,16-16h64c8.832,0,16,7.168,16,16 S344.832,240.011,336,240.011z" /><path fill="'+r+'" d="M336,304.011h-64c-8.832,0-16-7.168-16-16s7.168-16,16-16h64c8.832,0,16,7.168,16,16 S344.832,304.011,336,304.011z" /><path fill="'+r+'" d="M336,368.011h-64c-8.832,0-16-7.168-16-16s7.168-16,16-16h64c8.832,0,16,7.168,16,16 S344.832,368.011,336,368.011z" /><path fill="'+r+'" d="M432,176.011h-32c-8.832,0-16-7.168-16-16s7.168-16,16-16h32c8.832,0,16,7.168,16,16 S440.832,176.011,432,176.011z" /><path fill="'+r+'" d="M432,240.011h-32c-8.832,0-16-7.168-16-16s7.168-16,16-16h32c8.832,0,16,7.168,16,16 S440.832,240.011,432,240.011z" /><path fill="'+r+'" d="M432,304.011h-32c-8.832,0-16-7.168-16-16s7.168-16,16-16h32c8.832,0,16,7.168,16,16 S440.832,304.011,432,304.011z" /><path fill="'+r+'" d="M432,368.011h-32c-8.832,0-16-7.168-16-16s7.168-16,16-16h32c8.832,0,16,7.168,16,16 S440.832,368.011,432,368.011z" /><path fill="'+r+'" d="M282.208,19.691c-3.648-3.04-8.544-4.352-13.152-3.392l-256,48C5.472,65.707,0,72.299,0,80.011v352 c0,7.68,5.472,14.304,13.056,15.712l256,48c0.96,0.192,1.952,0.288,2.944,0.288c3.712,0,7.328-1.28,10.208-3.68 c3.68-3.04,5.792-7.584,5.792-12.32v-448C288,27.243,285.888,22.731,282.208,19.691z" /><path fill="#FAFAFA" d="M220.032,309.483l-50.592-57.824l51.168-65.792c5.44-6.976,4.16-17.024-2.784-22.464 c-6.944-5.44-16.992-4.16-22.464,2.784l-47.392,60.928l-39.936-45.632c-5.856-6.72-15.968-7.328-22.56-1.504 c-6.656,5.824-7.328,15.936-1.504,22.56l44,50.304L83.36,310.187c-5.44,6.976-4.16,17.024,2.784,22.464 c2.944,2.272,6.432,3.36,9.856,3.36c4.768,0,9.472-2.112,12.64-6.176l40.8-52.48l46.528,53.152 c3.168,3.648,7.584,5.504,12.032,5.504c3.744,0,7.488-1.312,10.528-3.968C225.184,326.219,225.856,316.107,220.032,309.483z" /></svg>'},OrgChart.icon.edit=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 528.899 528.899"><path fill="'+r+'" d="M328.883,89.125l107.59,107.589l-272.34,272.34L56.604,361.465L328.883,89.125z M518.113,63.177l-47.981-47.981 c-18.543-18.543-48.653-18.543-67.259,0l-45.961,45.961l107.59,107.59l53.611-53.611 C532.495,100.753,532.495,77.559,518.113,63.177z M0.3,512.69c-1.958,8.812,5.998,16.708,14.811,14.565l119.891-29.069 L27.473,390.597L0.3,512.69z" /></svg>'},OrgChart.icon.details=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 512 512"><path fill="'+r+'" d="M447.933,103.629c-0.034-3.076-1.224-6.09-3.485-8.352L352.683,3.511c-0.004-0.004-0.007-0.005-0.011-0.008 C350.505,1.338,347.511,0,344.206,0H89.278C75.361,0,64.04,11.32,64.04,25.237v461.525c0,13.916,11.32,25.237,25.237,25.237 h333.444c13.916,0,25.237-11.32,25.237-25.237V103.753C447.96,103.709,447.937,103.672,447.933,103.629z M356.194,40.931 l50.834,50.834h-49.572c-0.695,0-1.262-0.567-1.262-1.262V40.931z M423.983,486.763c0,0.695-0.566,1.261-1.261,1.261H89.278 c-0.695,0-1.261-0.566-1.261-1.261V25.237c0-0.695,0.566-1.261,1.261-1.261h242.94v66.527c0,13.916,11.322,25.239,25.239,25.239 h66.527V486.763z"/><path fill="'+r+'" d="M362.088,164.014H149.912c-6.62,0-11.988,5.367-11.988,11.988c0,6.62,5.368,11.988,11.988,11.988h212.175 c6.62,0,11.988-5.368,11.988-11.988C374.076,169.381,368.707,164.014,362.088,164.014z"/><path fill="'+r+'" d="M362.088,236.353H149.912c-6.62,0-11.988,5.368-11.988,11.988c0,6.62,5.368,11.988,11.988,11.988h212.175 c6.62,0,11.988-5.368,11.988-11.988C374.076,241.721,368.707,236.353,362.088,236.353z"/><path fill="'+r+'" d="M362.088,308.691H149.912c-6.62,0-11.988,5.368-11.988,11.988c0,6.621,5.368,11.988,11.988,11.988h212.175 c6.62,0,11.988-5.367,11.988-11.988C374.076,314.06,368.707,308.691,362.088,308.691z"/><path fill="'+r+'" d="M256,381.031H149.912c-6.62,0-11.988,5.368-11.988,11.988c0,6.621,5.368,11.988,11.988,11.988H256 c6.62,0,11.988-5.367,11.988-11.988C267.988,386.398,262.62,381.031,256,381.031z"/></svg>'},OrgChart.icon.remove=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 900.5 900.5"><path fill="'+r+'" d="M176.415,880.5c0,11.046,8.954,20,20,20h507.67c11.046,0,20-8.954,20-20V232.487h-547.67V880.5L176.415,880.5z M562.75,342.766h75v436.029h-75V342.766z M412.75,342.766h75v436.029h-75V342.766z M262.75,342.766h75v436.029h-75V342.766z"/><path fill="'+r+'" d="M618.825,91.911V20c0-11.046-8.954-20-20-20h-297.15c-11.046,0-20,8.954-20,20v71.911v12.5v12.5H141.874 c-11.046,0-20,8.954-20,20v50.576c0,11.045,8.954,20,20,20h34.541h547.67h34.541c11.046,0,20-8.955,20-20v-50.576 c0-11.046-8.954-20-20-20H618.825v-12.5V91.911z M543.825,112.799h-187.15v-8.389v-12.5V75h187.15v16.911v12.5V112.799z"/></svg>'},OrgChart.icon.add=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 922 922"><path fill="'+r+'" d="M922,453V81c0-11.046-8.954-20-20-20H410c-11.045,0-20,8.954-20,20v149h318c24.812,0,45,20.187,45,45v198h149 C913.046,473.001,922,464.046,922,453z" /><path fill="'+r+'" d="M557,667.001h151c11.046,0,20-8.954,20-20v-174v-198c0-11.046-8.954-20-20-20H390H216c-11.045,0-20,8.954-20,20v149h194 h122c24.812,0,45,20.187,45,45v4V667.001z" /><path fill="'+r+'" d="M0,469v372c0,11.046,8.955,20,20,20h492c11.046,0,20-8.954,20-20V692v-12.501V667V473v-4c0-11.046-8.954-20-20-20H390H196 h-12.5H171H20C8.955,449,0,457.955,0,469z" /></svg>'},OrgChart.icon.search=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 485.213 485.213"><path fill="'+r+'" d="M471.882,407.567L360.567,296.243c-16.586,25.795-38.536,47.734-64.331,64.321l111.324,111.324 c17.772,17.768,46.587,17.768,64.321,0C489.654,454.149,489.654,425.334,471.882,407.567z" /><path fill="'+r+'" d="M363.909,181.955C363.909,81.473,282.44,0,181.956,0C81.474,0,0.001,81.473,0.001,181.955s81.473,181.951,181.955,181.951 C282.44,363.906,363.909,282.437,363.909,181.955z M181.956,318.416c-75.252,0-136.465-61.208-136.465-136.46 c0-75.252,61.213-136.465,136.465-136.465c75.25,0,136.468,61.213,136.468,136.465 C318.424,257.208,257.206,318.416,181.956,318.416z" /><path fill="'+r+'" d="M75.817,181.955h30.322c0-41.803,34.014-75.814,75.816-75.814V75.816C123.438,75.816,75.817,123.437,75.817,181.955z" /></svg>'},OrgChart.icon.xml=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 550.801 550.801"><path fill="'+r+'" d="M488.426,197.019H475.2v-63.816c0-0.401-0.063-0.799-0.116-1.205c-0.021-2.534-0.827-5.023-2.562-6.992L366.325,3.691 c-0.032-0.031-0.063-0.042-0.085-0.073c-0.633-0.707-1.371-1.298-2.151-1.804c-0.231-0.158-0.464-0.287-0.706-0.422 c-0.676-0.366-1.393-0.675-2.131-0.896c-0.2-0.053-0.38-0.135-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.87v160.542 c0,17.044,13.824,30.876,30.873,30.876h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87V227.89C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.51c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M369.531,374.53h-32.058l-2.156-55.519 c-0.644-17.434-1.298-38.518-1.298-59.611h-0.633c-4.514,18.516-10.547,39.166-16.137,56.162l-17.645,56.601h-25.618 l-15.494-56.157c-4.725-16.996-9.671-37.658-13.123-56.6h-0.43c-0.854,19.585-1.508,41.961-2.586,60.038l-2.576,55.086h-30.343 l9.26-145.035h43.677l14.207,48.421c4.517,16.774,9.041,34.847,12.258,51.843h0.654c4.081-16.77,9.038-35.923,13.774-52.064 l15.493-48.199h42.82L369.531,374.53z M69.992,374.53l41.955-73.385l-40.444-71.65h37.655l12.688,26.465 c4.316,8.828,7.533,15.928,10.99,24.092h0.422c3.438-9.242,6.23-15.694,9.893-24.092l12.274-26.465h37.434l-40.89,70.796 l43.044,74.239h-37.866l-13.134-26.257c-5.376-10.108-8.817-17.639-12.909-26.04h-0.433c-3.009,8.401-6.674,15.932-11.19,26.04 l-12.042,26.257H69.992z M453.601,523.353H97.2V419.302h356.4V523.353z M485.325,374.53h-90.608V229.495h32.933v117.497h57.682 v27.538H485.325z"/></svg>'},OrgChart.icon.visio=function(t,e,r,i,n){return null==i&&(i=0),null==n&&(n=0),`<svg width="${t}" height="${e}" viewBox="0 0 24 24" x="${n}" x="${n}">\n <path fill="${r}" d="M24 7.609v9.556q0 .424-.302.726-.303.303-.726.303h-5.19q-.072 1.149-.556 2.135-.484.986-1.264 1.717-.78.732-1.803 1.15-1.022.417-2.159.417-1.016 0-1.96-.35-.943-.352-1.705-.969-.762-.617-1.295-1.47-.532-.852-.713-1.856H1.028q-.423 0-.726-.303Q0 18.363 0 17.94V7.609q0-.424.302-.726.303-.302.726-.302h5.238q-.072-.182-.072-.387 0-.424.302-.726L11.274.69q.303-.303.726-.303t.726.303l4.778 4.778q.302.302.302.726 0 .205-.072.387h5.238q.423 0 .726.302.302.302.302.726zM12 2.153l-4.04 4.04.387.388h3.012q.423 0 .726.302.302.302.302.726v2.238l3.653-3.653zM7.161 16.84l3.085-8.13H8.238q-.508 1.489-1.028 2.952-.52 1.464-1.004 2.964-.496-1.488-.992-2.958-.496-1.47-1.004-2.957H2.153l3.037 8.129zM12 22.065q.883 0 1.657-.333t1.355-.913q.58-.581.913-1.355.333-.774.333-1.658 0-.81-.302-1.548-.303-.738-.823-1.318-.52-.581-1.228-.944-.707-.363-1.518-.423v4.367q0 .423-.302.725-.303.303-.726.303H7.923q.206.677.593 1.246.387.568.92.98.532.41 1.185.64.653.23 1.379.23zm10.452-5.42V8.13h-6.158q-.133.133-.441.454-.309.32-.714.725-.405.406-.847.853-.441.448-.828.823-.387.375-.684.641-.296.266-.393.302v.097q.968.036 1.845.411t1.578.998q.702.623 1.186 1.446t.677 1.766Z"/>\n </svg>`},OrgChart.icon.link=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 512.092 512.092" ><path fill="'+r+'" d="M312.453,199.601c-6.066-6.102-12.792-11.511-20.053-16.128c-19.232-12.315-41.59-18.859-64.427-18.859 c-31.697-0.059-62.106,12.535-84.48,34.987L34.949,308.23c-22.336,22.379-34.89,52.7-34.91,84.318 c-0.042,65.98,53.41,119.501,119.39,119.543c31.648,0.11,62.029-12.424,84.395-34.816l89.6-89.6 c1.628-1.614,2.537-3.816,2.524-6.108c-0.027-4.713-3.87-8.511-8.583-8.484h-3.413c-18.72,0.066-37.273-3.529-54.613-10.581 c-3.195-1.315-6.867-0.573-9.301,1.877l-64.427,64.512c-20.006,20.006-52.442,20.006-72.448,0 c-20.006-20.006-20.006-52.442,0-72.448l108.971-108.885c19.99-19.965,52.373-19.965,72.363,0 c13.472,12.679,34.486,12.679,47.957,0c5.796-5.801,9.31-13.495,9.899-21.675C322.976,216.108,319.371,206.535,312.453,199.601z" /><path fill="'+r+'" d="M477.061,34.993c-46.657-46.657-122.303-46.657-168.96,0l-89.515,89.429c-2.458,2.47-3.167,6.185-1.792,9.387 c1.359,3.211,4.535,5.272,8.021,5.205h3.157c18.698-0.034,37.221,3.589,54.528,10.667c3.195,1.315,6.867,0.573,9.301-1.877 l64.256-64.171c20.006-20.006,52.442-20.006,72.448,0c20.006,20.006,20.006,52.442,0,72.448l-80.043,79.957l-0.683,0.768 l-27.989,27.819c-19.99,19.965-52.373,19.965-72.363,0c-13.472-12.679-34.486-12.679-47.957,0 c-5.833,5.845-9.35,13.606-9.899,21.845c-0.624,9.775,2.981,19.348,9.899,26.283c9.877,9.919,21.433,18.008,34.133,23.893 c1.792,0.853,3.584,1.536,5.376,2.304c1.792,0.768,3.669,1.365,5.461,2.048c1.792,0.683,3.669,1.28,5.461,1.792l5.035,1.365 c3.413,0.853,6.827,1.536,10.325,2.133c4.214,0.626,8.458,1.025,12.715,1.195h5.973h0.512l5.12-0.597 c1.877-0.085,3.84-0.512,6.059-0.512h2.901l5.888-0.853l2.731-0.512l4.949-1.024h0.939c20.961-5.265,40.101-16.118,55.381-31.403 l108.629-108.629C523.718,157.296,523.718,81.65,477.061,34.993z" /></svg>'},OrgChart.icon.happy=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 512 512"><path fill="'+r+'" d="M256,0C114.615,0,0,114.615,0,256s114.615,256,256,256s256-114.615,256-256S397.385,0,256,0z M256,480 C132.288,480,32,379.712,32,256S132.288,32,256,32s224,100.288,224,224S379.712,480,256,480z"/><path fill="'+r+'" d="M176,176c17.673,0,32,14.327,32,32h32c0-35.346-28.654-64-64-64c-35.346,0-64,28.654-64,64h32 C144,190.327,158.327,176,176,176z"/><path fill="'+r+'" d="M336,144c-35.346,0-64,28.654-64,64h32c0-17.673,14.327-32,32-32c17.673,0,32,14.327,32,32h32 C400,172.654,371.346,144,336,144z"/><path fill="'+r+'" d="M256,368c-53.019,0-96-42.981-96-96h-32c0,70.692,57.308,128,128,128s128-57.308,128-128h-32 C352,325.019,309.019,368,256,368z"/></svg>'},OrgChart.icon.sad=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 512 512"><path fill="'+r+'" d="M256,0C114.615,0,0,114.615,0,256s114.615,256,256,256s256-114.615,256-256S397.385,0,256,0z M256,480 C132.288,480,32,379.712,32,256S132.288,32,256,32s224,100.288,224,224S379.712,480,256,480z"/><path fill="'+r+'" d="M336,192c-17.673,0-32-14.327-32-32h-32c0,35.346,28.654,64,64,64c35.346,0,64-28.654,64-64h-32 C368,177.673,353.673,192,336,192z"/><path fill="'+r+'" d="M176,224c35.346,0,64-28.654,64-64h-32c0,17.673-14.327,32-32,32s-32-14.327-32-32h-32C112,195.346,140.654,224,176,224z "/><path fill="'+r+'" d="M256,256c-70.692,0-128,57.308-128,128h32c0-53.019,42.981-96,96-96s96,42.981,96,96h32C384,313.308,326.692,256,256,256 z"/></svg>'},OrgChart.icon.share=function(t,e,r,i,n){return null==i&&(i=0),null==n&&(n=0),`<svg width="${t}" height="${e}" x="${i}" y="${n}" viewBox="0 0 512 512">\n <path fill="${r}" d="M406,332c-29.641,0-55.761,14.581-72.167,36.755L191.99,296.124c2.355-8.027,4.01-16.346,4.01-25.124\n c0-11.906-2.441-23.225-6.658-33.636l148.445-89.328C354.307,167.424,378.589,180,406,180c49.629,0,90-40.371,90-90\n c0-49.629-40.371-90-90-90c-49.629,0-90,40.371-90,90c0,11.437,2.355,22.286,6.262,32.358l-148.887,89.59\n C156.869,193.136,132.937,181,106,181c-49.629,0-90,40.371-90,90c0,49.629,40.371,90,90,90c30.13,0,56.691-15.009,73.035-37.806\n l141.376,72.395C317.807,403.995,316,412.75,316,422c0,49.629,40.371,90,90,90c49.629,0,90-40.371,90-90\n C496,372.371,455.629,332,406,332z"/>\n </svg>`},OrgChart.icon.user=function(t,e,r,i,n){return OrgChart.isNEU(i)&&(i=0),OrgChart.isNEU(n)&&(n=0),`<svg width="${t}" height="${e}" x="${i}" y="${n}" viewBox="0 0 24 24">\n <path fill="${r}" d="M12 11.796C14.7189 11.796 16.9231 9.60308 16.9231 6.89801C16.9231 4.19294 14.7189 2.00005 12 2.00005C9.28106 2.00005 7.07692 4.19294 7.07692 6.89801C7.07692 9.60308 9.28106 11.796 12 11.796Z" fill="#030D45"/>\n <path fill="${r}" d="M14.5641 13.8369H9.4359C6.46154 13.8369 4 16.2859 4 19.245C4 19.9593 4.30769 20.5716 4.92308 20.8777C5.84615 21.3879 7.89744 22.0001 12 22.0001C16.1026 22.0001 18.1538 21.3879 19.0769 20.8777C19.5897 20.5716 20 19.9593 20 19.245C20 16.1838 17.5385 13.8369 14.5641 13.8369Z" fill="#030D45"/>\n </svg>`},OrgChart.icon.close=function(t,e,r,i,n){return null==i&&(i=0),null==n&&(n=0),`<svg width="${t}" height="${e}" x="${i}" y="${n}" viewBox="0 0 512 512">\n <path fill="${r}" d="m256 0c-141.49 0-256 114.5-256 256 0 141.49 114.5 256 256 256 141.49 0 256-114.5 256-256 0-141.49-114.5-256-256-256zm-12.284 317.397-58.121 58.132c-6.565 6.553-15.283 10.166-24.557 10.166-19.196 0-34.734-15.526-34.734-34.734 0-9.274 3.612-17.992 10.166-24.557l58.132-58.121c6.785-6.784 6.785-17.783 0-24.568l-58.132-58.121c-6.553-6.565-10.166-15.283-10.166-24.557 0-19.196 15.526-34.734 34.734-34.734 9.274 0 17.992 3.613 24.557 10.166l58.121 58.132c6.785 6.773 17.784 6.773 24.568 0l58.121-58.132c6.565-6.553 15.283-10.166 24.557-10.166 19.196 0 34.734 15.526 34.734 34.734 0 9.274-3.612 17.992-10.166 24.557l-58.132 58.121c-6.785 6.784-6.785 17.783 0 24.568l58.132 58.121c6.553 6.565 10.166 15.283 10.166 24.557 0 19.196-15.526 34.734-34.734 34.734-9.274 0-17.992-3.613-24.557-10.166l-58.121-58.132c-6.784-6.784-17.784-6.773-24.568 0z"/>\n </svg>`},OrgChart.icon.undo=function(t,e,r,i,n){return null==i&&(i=0),null==n&&(n=0),`<svg width="${t}" height="${e}" x="${i}" y="${n}" viewBox="0 0 24 24">\n <path fill-rule="evenodd" clip-rule="evenodd" fill="${r}" d="M3.46447 3.46447C2 4.92893 2 7.28595 2 12C2 16.714 2 19.0711 3.46447 20.5355C4.92893 22 7.28595 22 12 22C16.714 22 19.0711 22 20.5355 20.5355C22 19.0711 22 16.7141 22 12C22 7.28598 22 4.92893 20.5355 3.46447C19.0711 2 16.714 2 12 2C7.28595 2 4.92893 2 3.46447 3.46447ZM9.25871 7.97395C9.56308 7.693 9.58205 7.21851 9.3011 6.91414C9.02015 6.60978 8.54565 6.5908 8.24129 6.87175L5.99129 8.94867C5.83748 9.09065 5.75 9.29045 5.75 9.49977C5.75 9.7091 5.83748 9.9089 5.99129 10.0509L8.24129 12.1278C8.54565 12.4088 9.02015 12.3898 9.3011 12.0854C9.58205 11.781 9.56308 11.3065 9.25871 11.0256L8.41824 10.2498H14.0385C14.7376 10.2498 15.2069 10.2506 15.5652 10.2862C15.9116 10.3205 16.0724 10.3813 16.1787 10.4501C16.3272 10.5461 16.4537 10.6726 16.5497 10.8211C16.6184 10.9274 16.6793 11.0882 16.7136 11.4345C16.7491 11.7929 16.75 12.2622 16.75 12.9613C16.75 13.6604 16.7491 14.1298 16.7136 14.4881C16.6793 14.8344 16.6185 14.9952 16.5497 15.1015C16.4537 15.2501 16.3272 15.3765 16.1787 15.4726C16.0724 15.5413 15.9116 15.6021 15.5652 15.6365C15.2069 15.672 14.7376 15.6729 14.0385 15.6729H9.5C9.08579 15.6729 8.75 16.0086 8.75 16.4229C8.75 16.8371 9.08579 17.1729 9.5 17.1729H14.0758C14.7279 17.1729 15.2721 17.1729 15.7133 17.1291C16.1748 17.0834 16.6038 16.9839 16.9931 16.7322C17.3199 16.5209 17.5981 16.2427 17.8094 15.916C18.0611 15.5266 18.1605 15.0976 18.2063 14.6361C18.25 14.195 18.25 13.6508 18.25 12.9987V12.924C18.25 12.2718 18.25 11.7276 18.2063 11.2865C18.1605 10.825 18.0611 10.396 17.8093 10.0067C17.5981 9.6799 17.3199 9.40169 16.9931 9.19042C16.6038 8.9387 16.1748 8.83927 15.7133 8.7935C15.2721 8.74975 14.7279 8.74976 14.0758 8.74977L8.41824 8.74977L9.25871 7.97395Z" />\n <rect style="opacity: 0" x="2" y="2" width="20" height="20"></rect>\n </svg>`},OrgChart.icon.redo=function(t,e,r,i,n){return null==i&&(i=0),null==n&&(n=0),`<svg width="${t}" height="${e}" x="${i}" y="${n}" viewBox="0 0 24 24" >\n <path fill="#f9f9f9" fill-rule="evenodd" clip-rule="evenodd" fill="${r}" d="M3.46447 3.46447C2 4.92893 2 7.28595 2 12C2 16.714 2 19.0711 3.46447 20.5355C4.92893 22 7.28595 22 12 22C16.714 22 19.0711 22 20.5355 20.5355C22 19.0711 22 16.7141 22 12C22 7.28598 22 4.92893 20.5355 3.46447C19.0711 2 16.714 2 12 2C7.28595 2 4.92893 2 3.46447 3.46447ZM15.7587 6.87273C15.4543 6.59177 14.9799 6.61075 14.6989 6.91512C14.4179 7.21948 14.4369 7.69398 14.7413 7.97493L15.5818 8.75075H9.96155C7.63558 8.75075 5.75 10.6363 5.75 12.9623C5.75 15.2883 7.63557 17.1738 9.96154 17.1738H14.5C14.9142 17.1738 15.25 16.838 15.25 16.4238C15.25 16.0096 14.9142 15.6738 14.5 15.6738H9.96154C8.464 15.6738 7.25 14.4598 7.25 12.9623C7.25 11.4647 8.464 10.2508 9.96155 10.2508H15.5818L14.7413 11.0266C14.4369 11.3075 14.4179 11.782 14.6989 12.0864C14.9799 12.3908 15.4543 12.4097 15.7587 12.1288L18.0087 10.0519C18.1625 9.90987 18.25 9.71007 18.25 9.50075C18.25 9.29143 18.1625 9.09163 18.0087 8.94965L15.7587 6.87273Z"/>\n <rect style="opacity: 0" x="2" y="2" width="20" height="20"></rect> \n </svg>`},OrgChart.icon.send=function(t,e,r,i,n){return null==i&&(i=0),null==n&&(n=0),`<svg width="${t}" height="${e}" x="${i}" y="${n}" viewBox="0 0 24 24" >\n <path fill="none" stroke="${r}" stroke-width="2" d="M10.3009 13.6949L20.102 3.89742M10.5795 14.1355L12.8019 18.5804C13.339 19.6545 13.6075 20.1916 13.9458 20.3356C14.2394 20.4606 14.575 20.4379 14.8492 20.2747C15.1651 20.0866 15.3591 19.5183 15.7472 18.3818L19.9463 6.08434C20.2845 5.09409 20.4535 4.59896 20.3378 4.27142C20.2371 3.98648 20.013 3.76234 19.7281 3.66167C19.4005 3.54595 18.9054 3.71502 17.9151 4.05315L5.61763 8.2523C4.48114 8.64037 3.91289 8.83441 3.72478 9.15032C3.56153 9.42447 3.53891 9.76007 3.66389 10.0536C3.80791 10.3919 4.34498 10.6605 5.41912 11.1975L9.86397 13.42C10.041 13.5085 10.1295 13.5527 10.2061 13.6118C10.2742 13.6643 10.3352 13.7253 10.3876 13.7933C10.4468 13.87 10.491 13.9585 10.5795 14.1355Z" />\n </svg>`},OrgChart.icon.x=function(t,e,r,i,n){return null==i&&(i=0),null==n&&(n=0),`<svg width="${t}" height="${e}" x="${i}" y="${n}" viewBox="0 0 24 24">\n <line x1="0" y1="0" x2="24" y2="24" stroke-width="3" stroke="${r}"></line>\n <line x1="24" y1="0" x2="0" y2="24" stroke-width="3" stroke="${r}"></line>\n </svg>`},OrgChart.prototype.exportPDFProfile=function(t,e){t=this._defaultExportProfileOptions(t,"pdf"),this._exportProfile(t,e)},OrgChart.prototype.exportPDFPreview=function(t){OrgChart.pdfPrevUI.show(this,t)},OrgChart.prototype.exportPNGProfile=function(t,e){t=this._defaultExportProfileOptions(t,"png"),this._exportProfile(t,e)},OrgChart.prototype.shareProfile=function(t){var e;"object"==typeof t?t=(e=t).focusId:e=this.editUI.content(t,!0,!0,"100%",!0);var r=new URL(window.location.href);r.searchParams.append("nodeId",t);var i={title:e.title,text:e.shareText,url:r.href};try{navigator.share(i)}catch(t){console.error("error: "+t)}},OrgChart.prototype.exportPDF=function(t,e){t=this._defaultExportOptions(t,"pdf"),this._export(t,e)},OrgChart._exportPDFFromChartsFetchWithCallback=function(t,e){t.type&&"profile"==t.type.toLowerCase()?t.chartInstance.exportPDFProfile(t,(function(t,r){e(r)})):t.chartInstance.exportPDF(t,(function(t,r){e(r)}))},OrgChart._exportPDFFromChartsFetchSequentially=function(t,e,r,i,n,a){if(t>=e.length){var o=[];for(var s of e)-1==o.indexOf(s.chartInstance)&&o.push(s.chartInstance),delete s.chartInstance;for(var l of(r=JSON.stringify(r),o))OrgChart.loading.show(l);return null==i&&(i="OrgChart.pdf"),null==n&&(n=!1),void OrgChart._ajax(l.config.exportUrl+"/v4","POST",r,"arraybuffer",(function(t){for(var e of o)OrgChart.loading.hide(e);a?a(t):OrgChart._downloadFile("application/pdf",t,i,n,"pdf")}))}OrgChart._exportPDFFromChartsFetchWithCallback(e[t],(function(o){r.push(o),OrgChart._exportPDFFromChartsFetchSequentially(t+1,e,r,i,n,a)}))},OrgChart.exportPDFFromCharts=function(t,e,r,i){OrgChart._exportPDFFromChartsFetchSequentially(0,t,[],e,r,i)},OrgChart.prototype.exportPNG=function(t,e){t=this._defaultExportOptions(t,"png"),this._export(t,e)},OrgChart.prototype.exportSVG=function(t,e){t=this._defaultExportOptions(t,"svg"),this._export(t,e)},OrgChart.prototype.exportVisio=function(t,e){t=this._defaultExportOptions(t,"visio"),this._export(t,e)},OrgChart.prototype._defaultExportOptions=function(t,e){return null==t&&(t={}),"svg"==e?(t.ext="svg",t.mime="image/svg+xml"):"visio"==e?(t.ext="vsdx",t.mime="application/vnd.visio"):"pdf"==e?(t.mime="application/pdf",t.ext="pdf"):"png"==e&&(t.mime="image/png",t.ext="png"),null==t.margin&&(t.margin=[50,40,50,40]),null==t.padding&&(t.padding="visio"==e?25:0),null==t.landscape&&(t.landscape=!1),null==t.filename&&(t.filename="OrgChart."+t.ext),null==t.scale&&(t.scale="fit"),null==t.format&&(t.format="fit"),null==t.header&&(t.header=""),"pdf"==e&&null==t.footer?t.footer="Page {current-page} of {total-pages}":null==t.footer&&(t.footer=""),null==t.openInNewTab&&(t.openInNewTab=!1),null==t.mode&&(t.mode="boc-"+this.config.mode),t},OrgChart.prototype._export=function(t,e){var r=this,i={id:t.nodeId,expandChildren:t.expandChildren,parentLevels:t.parentLevels,childLevels:t.childLevels,min:t.min};t.margin&&t.margin[0]<2&&(t.margin[0]=2),t.margin&&t.margin[1]<2&&(t.margin[1]=2),t.margin&&t.margin[2]<2&&(t.margin[2]=2),t.margin&&t.margin[3]<2&&(t.margin[3]=2),this._draw(!1,OrgChart.action.exporting,i,(function(i,n){var a=document.createElement("div");if(a.innerHTML=i,t.padding>0){var o=a.querySelector("svg"),s=OrgChart._getViewBox(o);s[0]-=t.padding,s[1]-=t.padding,s[2]+=2*t.padding,s[3]+=2*t.padding,o.setAttribute("viewBox",s.join()),o.setAttribute("width",s[2]),o.setAttribute("height",s[3])}if("svg"==t.ext||"vsdx"==t.ext){(o=a.querySelector("svg")).classList.add("boc-"+r.config.mode);var l={content:a.innerHTML,options:t,styles:""};if(!e){var h=OrgChart.events.publish("exportstart",[r,l]);if(!1===h)return!1}var c=r.element.querySelector("[data-boc-styles]");if(c&&(l.styles+=c.outerHTML),l.styles&&(a.childNodes[0].insertAdjacentHTML("afterbegin",l.styles),l.content=a.innerHTML),"svg"==t.ext)if(e)e(l);else{if(!1===(h=OrgChart.events.publish("exportend",[r,l])))return!1;OrgChart._downloadFile(t.mime,l.content,l.options.filename,l.options.openInNewTab,l.options.ext)}else if("vsdx"==t.ext){OrgChart.loading.show(r);var d=JSON.stringify({svg:l.content,fileName:l.options.filename});OrgChart._ajax(r.config.serverUrl+"/Export/Visio","POST",d,"arraybuffer",(function(i){if(OrgChart.loading.hide(r),e)e(l,i);else{if(!1===OrgChart.events.publish("exportend",[r,i]))return!1;OrgChart._downloadFile(t.mime,i,l.options.filename,l.options.openInNewTab,l.options.ext)}}))}}else r._pages(t,a.querySelector("svg"),n,(function(i){var n={content:a.innerHTML,options:t,pages:i,styles:""},o=OrgChart.events.publish("exportstart",[r,n]),s=r.element.querySelector("[data-boc-styles]");if(s&&(n.styles+=s.outerHTML),!1===o)return!1;e||OrgChart.loading.show(r),e?e(r,n,a.querySelector("svg")):(n=JSON.stringify(n),OrgChart._ajax(r.config.exportUrl+"/v4","POST",n,"arraybuffer",(function(e){var i=OrgChart.events.publish("exportend",[r,e]);if(OrgChart.loading.hide(r),!1===i)return!1;OrgChart._downloadFile(t.mime,e,t.filename,t.openInNewTab,t.ext)})))}))}))},OrgChart.prototype.exportCSV=function(t){var e=OrgChart._defaultExportProfileOptionsForCSV_SVG_JSON(t,"csv"),r=this.getNode(e.nodeId),i=null;r?(i=[],OrgChart._exportIterateForJSON_XML_CSV(this,r,e,i)):!1===e.min||!1===e.expandChildren?OrgChart._exportIterateForJSON_XML_CSV(this,this.roots,e,i):i=JSON.parse(JSON.stringify(this.config.nodes));var n={ext:"csv",filename:t,options:e,nodes:i};if(!1===OrgChart.events.publish("exportstart",[this,n]))return!1;var a=OrgChart._json2csv(n.nodes),o={ext:n.ext,filename:n.filename,options:e,nodes:n.nodes,content:a};if(!1===OrgChart.events.publish("exportend",[this,o]))return!1;OrgChart._downloadFile("text/csv;charset=utf-8;","\ufeff"+o.content,o.options.filename,o.options.openInNewTab,o.ext)},OrgChart.prototype.exportXML=function(t){var e=OrgChart._defaultExportProfileOptionsForCSV_SVG_JSON(t,"xml"),r=this.getNode(e.nodeId),i=null;r?(i=[],OrgChart._exportIterateForJSON_XML_CSV(this,r,e,i)):!1===e.min||!1===e.expandChildren?OrgChart._exportIterateForJSON_XML_CSV(this,this.roots,e,i):i=JSON.parse(JSON.stringify(this.config.nodes));var n={ext:"xml",filename:t,options:e,nodes:i};if(!1===OrgChart.events.publish("exportstart",[this,n]))return!1;var a=OrgChart._json2xml(n.nodes),o={ext:n.ext,filename:n.filename,options:e,nodes:n.nodes,content:a};if(!1===OrgChart.events.publish("exportend",[this,o]))return!1;OrgChart._downloadFile("application/xml",o.content,o.options.filename,o.options.openInNewTab,o.ext)},OrgChart.prototype.exportJSON=function(t){var e=OrgChart._defaultExportProfileOptionsForCSV_SVG_JSON(t,"json"),r=this.getNode(e.nodeId),i=null;r?(i=[],OrgChart._exportIterateForJSON_XML_CSV(this,r,e,i)):!1===e.min||!1===e.expandChildren?OrgChart._exportIterateForJSON_XML_CSV(this,this.roots,e,i):i=JSON.parse(JSON.stringify(this.config.nodes));var n={ext:"json",filename:e.filename,options:e,nodes:i};if(!1===OrgChart.events.publish("exportstart",[this,n]))return!1;var a={ext:n.ext,filename:n.filename,options:e,nodes:n.nodes,content:JSON.stringify(n.nodes)};if(!1===OrgChart.events.publish("exportend",[this,a]))return!1;OrgChart._downloadFile("application/json",a.content,a.options.filename,a.options.openInNewTab,a.ext)},OrgChart._exportIterateForJSON_XML_CSV=function(t,e,r,i){if(Array.isArray(e))for(var n=0;n<e.length;n++)OrgChart._exportIterateForJSON_XML_CSV(t,e[n],r,i);else{var a=t.get(e.id);if(i.push(a),r.min)for(n=0;n<e.stChildrenIds.length;n++)OrgChart._exportIterateForJSON_XML_CSV(t,t.getNode(e.stChildrenIds[n]),r,i);else for(n=0;n<e.stChildren.length;n++)OrgChart._exportIterateForJSON_XML_CSV(t,e.stChildren[n],r,i);if(r.expandChildren)for(n=0;n<e.childrenIds.length;n++)OrgChart._exportIterateForJSON_XML_CSV(t,t.getNode(e.childrenIds[n]),r,i);else for(n=0;n<e.children.length;n++)OrgChart._exportIterateForJSON_XML_CSV(t,e.children[n],r,i)}},OrgChart.prototype._pages=function(t,e,r,i){"A5"==t.format&&"fit"!=t.scale||"A4"==t.format&&"fit"!=t.scale||"A3"==t.format&&"fit"!=t.scale||"A2"==t.format&&"fit"!=t.scale||"A1"==t.format&&"fit"!=t.scale||"Letter"==t.format&&"fit"!=t.scale||"Legal"==t.format&&"fit"!=t.scale?i(this._pagesA100(t,e,t.scale)):"A5"==t.format&&"fit"==t.scale||"A4"==t.format&&"fit"==t.scale||"A3"==t.format&&"fit"==t.scale||"A2"==t.format&&"fit"==t.scale||"A1"==t.format&&"fit"==t.scale||"Letter"==t.format&&"fit"==t.scale||"Legal"==t.format&&"fit"==t.scale?i(this._pagesAfit(t,e,r)):"fit"==t.format&&i(this._pagesFit(t,e))},OrgChart.prototype._pagesFit=function(t,e){var r=e.getAttribute("width"),i=e.getAttribute("height"),n=OrgChart._getViewBox(e),a={w:parseFloat(r),h:parseFloat(i)};return[{vb:n,size:{w:a.w+(t.margin[1]+t.margin[3]),h:a.h+(t.margin[0]+t.margin[2])},innerSize:a}]},OrgChart.prototype._pagesAfit=function(t,e,r){var i=e.getAttribute("width"),n=0,a=0;switch(t.format){case"A5":n=OrgChart.A5w,a=OrgChart.A5h;break;case"A4":n=OrgChart.A4w,a=OrgChart.A4h;break;case"A3":n=OrgChart.A3w,a=OrgChart.A3h;break;case"A2":n=OrgChart.A2w,a=OrgChart.A2h;break;case"A1":n=OrgChart.A1w,a=OrgChart.A1h;break;case"Letter":n=OrgChart.Letterw,a=OrgChart.Letterh;break;case"Legal":n=OrgChart.Legalw,a=OrgChart.Legalh}var o=t.landscape?a-(t.margin[1]+t.margin[3]):n-(t.margin[1]+t.margin[3]),s=(t.landscape?(t.margin[0],t.margin[2]):(t.margin[0],t.margin[2]),o/i);return this._pagesA100(t,e,100*s,r)},OrgChart.prototype._pagesA100=function(t,e,r,i){var n=OrgChart._getViewBox(e),a=0,o=0;switch(t.format){case"A5":a=OrgChart.A5w,o=OrgChart.A5h;break;case"A4":a=OrgChart.A4w,o=OrgChart.A4h;break;case"A3":a=OrgChart.A3w,o=OrgChart.A3h;break;case"A2":a=OrgChart.A2w,o=OrgChart.A2h;break;case"A1":a=OrgChart.A1w,o=OrgChart.A1h;break;case"Letter":a=OrgChart.Letterw,o=OrgChart.Letterh;break;case"Legal":a=OrgChart.Legalw,o=OrgChart.Legalh}var s=n[0],l=n[1],h=n[2],c=n[3],d={w:t.landscape?o-(t.margin[1]+t.margin[3]):a-(t.margin[1]+t.margin[3]),h:t.landscape?a-(t.margin[0]+t.margin[2]):o-(t.margin[0]+t.margin[2])},g={w:t.landscape?o:a,h:t.landscape?a:o};e.setAttribute("width",d.w),e.setAttribute("height",d.h);var p=d.w*(100/r),u=d.h*(100/r),f=s,m=l,C=[],b=!0;if(!OrgChart.EXPORT_PAGES_CUT_NODES&&"fit"==t.scale){e.setAttribute("preserveAspectRatio","xMinYMin");for(var v=Object.keys(i.bordersByRootIdAndLevel),O=i.bordersByRootIdAndLevel[v[0]],x=Object.keys(O).length,y=1;y<v.length;y++)x<Object.keys(i.bordersByRootIdAndLevel[v[y]]).length&&(O=i.bordersByRootIdAndLevel[v[y]],x=Object.keys(O).length);for(var _=0,k=0;;){for(k=_;!(x<=_);){if((O[_].maxY-O[_].minY)/(100/r)>d.h){b=!1;break}var w=(O[_].minY-O[k].minY)/(100/r);if(_==x-1&&(w=(O[_].maxY-O[k].minY)/(100/r)),w>d.h)break;_++}if(!b)break;var S=(_==x?O[_-1].maxY:O[_-1].minY)-O[k].minY;if(0==S){b=!1;break}if(I=(I=[f,O[k].minY,p,S]).join(),C.push({vb:I,innerSize:{w:d.x,h:S/(100/r)-1},size:g}),_==x)break;_--}C.length&&(C[C.length-1].innerSize.h+=1)}if(!b||OrgChart.EXPORT_PAGES_CUT_NODES||"fit"!=t.scale)for(e.setAttribute("preserveAspectRatio","xMinYMin slice"),C=[];f<h+s;){for(;m<c+l;){var I;I=(I=[f,m,p,u]).join(),C.push({vb:I,innerSize:d,size:g}),m+=u}f+=p,m=l}return C},OrgChart.prototype._defaultExportProfileOptions=function(t,e){return OrgChart.isNEU(t)||null==t.id||null!=t.nodeId||(t.nodeId=t.id),(OrgChart.isNEU(t)||OrgChart.isNEU(t.nodeId))&&console.error("options.nodeId is not defilned"),"svg"==e?(t.ext="svg",t.mime="image/svg+xml"):"pdf"==e?(t.mime="application/pdf",t.ext="pdf"):"png"==e&&(t.mime="image/png",t.ext="png"),null==t.margin&&(t.margin=[50,40,50,40]),null==t.padding&&(t.padding=0),null==t.landscape&&(t.landscape=!1),null==t.filename&&(t.filename="Profile."+t.ext),null==t.scale&&(t.scale="fit"),null==t.format&&(t.format="A4"),null==t.header&&(t.header=""),null==t.footer&&(t.footer=""),null==t.openInNewTab&&(t.openInNewTab=!1),null==t.mode&&(t.mode="boc-"+this.config.mode),t},OrgChart._defaultExportProfileOptionsForCSV_SVG_JSON=function(t,e){return OrgChart.isNEU(t)&&(t={}),"string"==typeof t&&(t={filename:t}),OrgChart.isNEU(t.filename)&&(t.filename=`OrgChart.${e}`),OrgChart.isNEU(t.expandChildren)&&(t.expandChildren=!0),OrgChart.isNEU(t.min)&&(t.min=!0),OrgChart.isNEU(t.openInNewTab)&&(t.openInNewTab=!1),t},OrgChart.prototype._exportProfile=function(t,e){var r=this,i=0,n=0;switch(t.format){case"A5":i=OrgChart.A5w,n=OrgChart.A5h;break;case"A4":i=OrgChart.A4w,n=OrgChart.A4h;break;case"A3":i=OrgChart.A3w,n=OrgChart.A3h;break;case"A2":i=OrgChart.A2w,n=OrgChart.A2h;break;case"A1":i=OrgChart.A1w,n=OrgChart.A1h;break;case"Letter":i=OrgChart.Letterw,n=OrgChart.Letterh;break;case"Legal":i=OrgChart.Legalw,n=OrgChart.Legalh}var a={w:t.landscape?n-(t.margin[1]+t.margin[3]):i-(t.margin[1]+t.margin[3]),h:t.landscape?i-(t.margin[0]+t.margin[2]):n-(t.margin[0]+t.margin[2])},o={w:t.landscape?n:i,h:t.landscape?i:n},s=this.editUI.content(t.nodeId,!0,!0,"100%",!0).element;OrgChart.input.init(s);var l={content:s.outerHTML,options:t,pages:[{vb:"",innerSize:a,size:o}],styles:""};if(!1===OrgChart.events.publish("exportstart",[r,l]))return!1;e||OrgChart.loading.show(r);var h=this.element.querySelector("[data-boc-styles]");h&&(l.styles+=h.outerHTML);var c=this.getSvg().querySelector("defs");if(c)for(var d=0;d<c.children.length;d++)"style"==c.children[d].nodeName.toLowerCase()&&(l.styles+=c.children[d].outerHTML);e?e(r,l,s):(l=JSON.stringify(l),OrgChart._ajax(this.config.exportUrl+"/v4","POST",l,"arraybuffer",(function(e){var i=OrgChart.events.publish("exportend",[r,e]);if(OrgChart.loading.hide(r),!1===i)return!1;OrgChart._downloadFile(t.mime,e,t.filename,t.openInNewTab,t.ext)})))},void 0===OrgChart&&(OrgChart={}),OrgChart.events=function(){var t={};return{on:function(e,r,i){Array.isArray(t[e])||(t[e]=[]),t[e].push({listener:r,event_id:i})},removeAll:function(e){Array.isArray(t[e])||(t[e]=[]),t[e]=[]},remove:function(e,r,i){var n=!1;if(t[e]&&Array.isArray(t[e])&&t[e].length>0)for(var a=t[e].length-1;a>=0;a--)(!OrgChart.isNEU(i)&&!OrgChart.isNEU(r)&&t[e][a].event_id==i&&t[e][a].listener==r||!OrgChart.isNEU(i)&&OrgChart.isNEU(r)&&t[e][a].event_id==i||OrgChart.isNEU(i)&&!OrgChart.isNEU(r)&&t[e][a].listener==r||OrgChart.isNEU(i)&&OrgChart.isNEU(r))&&(t[e].splice(a,1),n=!0);return n},has:function(e,r){if(t[e]&&Array.isArray(t[e])&&t[e].length>0){if(OrgChart.isNEU(r))return!0;for(var i=0;i<t[e].length;i++)if(t[e][i].event_id==r)return!0}return!1},removeForEventId:function(e){for(var r in t)if(Array.isArray(t[r]))for(var i=t[r].length-1;i>=0;i--)t[r][i].event_id==e&&t[r].splice(i,1)},publish:function(e,r){if(t[e]){for(var i=[],n=0;n<t[e].length;n++){var a=t[e][n];null!=a.event_id&&a.event_id!=r[0]._event_id||i.push(a.listener)}if(i.length>0){var o=!0;for(n=0;n<i.length&&(1==r.length?o=i[n](r[0])&&o:2==r.length?o=i[n](r[0],r[1])&&o:3==r.length?o=i[n](r[0],r[1],r[2])&&o:4==r.length?o=i[n](r[0],r[1],r[2],r[3])&&o:5==r.length&&(o=i[n](r[0],r[1],r[2],r[3],r[4])&&o),!1!==o);n++);return o}}}}}(),OrgChart.prototype.importCSV=function(){var t=this,e=document.createElement("INPUT");e.setAttribute("type","file"),e.setAttribute("accept",".csv"),e.style.display="none",e.onchange=function(e){var r=e.target,i=new FileReader;i.onload=function(){var e=i.result,r=OrgChart._csvToArray(e),n=[],a=r[0];OrgChart._importSetColumnNames(a,(function(e){for(var i=1;i<r.length;i++){for(var a={},o=0;o<r[i].length;o++){var s=e[o],l=r[i][o];a[s]=OrgChart._convertStringToArray(s,l)}""!=a.id.trim()&&n.push(a)}var h={nodes:n,columnNames:r[0]};0!=OrgChart.events.publish("import",[t,h])&&(t._putInUndoStack(),t.clearRedo(),t.config.nodes=h.nodes,t._ai.setContext(),OrgChart.events.publish("updated",[t]),t.filterUI.update(),t.draw())}))},i.readAsText(r.files[0])},e.click()},OrgChart._importSetColumnNames=function(t,e){if(-1==t.indexOf("id")||-1==t.indexOf("pid")){var r=document.createElement("DIV"),i=document.createElement("P");i.style.padding="5px",i.style.color="rgb(122, 122, 122)",i.innerHTML=OrgChart.IMPORT_MESSAGE,r.appendChild(i);var n=document.createElement("div"),a=document.createElement("div"),o=document.createElement("div"),s=document.createElement("span");n.setAttribute("id","boc-sampleDialog"),n.style.height="260px",n.style.width="400px",n.style.background="white",n.style.border="0.5px solid grey",n.style.position="fixed",n.style.overflow="hidden",n.style.zIndex="99",a.setAttribute("id","title"),a.style.backgroundColor="#e5e5e5",a.style.fontWeight="bold",a.style.color="rgb(122, 122, 122)",a.style.height="20px",a.style.padding="3px 0 0 7px",s.setAttribute("id","close"),s.style.cursor="pointer",s.style.position="absolute",s.style.color="rgb(122, 122, 122)",s.style.fontWeight="bold",s.style.top="2px",s.style.zIndex=100,o.setAttribute("id","content"),o.style.padding="2px",a.innerHTML="Import Organizational Chart Data",s.innerHTML="×";var l=document.createElement("HR");l.style.height="0.1px",l.style.backgroundColor="#aeaeae",l.style.border="none",l.style.margin="0",n.appendChild(a),n.appendChild(l),o.appendChild(r),n.appendChild(o),n.appendChild(s),document.body.appendChild(n),OrgChart._importCenter(n),s.style.left=n.offsetWidth-20+"px";var h=document.createElement("div");h.setAttribute("id","overlay"),h.style.width="100%",h.style.height="100%",h.style.left=0,h.style.top=0,h.style.position="fixed",h.style.background="grey",h.style.opacity="0.5",h.style.zIndex=98,document.body.appendChild(h),n._overlay=h;var c=document.createElement("LABEL"),d=document.createTextNode("Name:");c.setAttribute("for","boc-id-select"),c.appendChild(d),c.style.fontSize="16px",c.style.color="rgb(122, 122, 122)",c.style.padding="5px",c.style.margin="5px",c.style.width="30%",c.style.textAlign="right",c.style.display="inline-block",r.appendChild(c);var g=document.createElement("SELECT");g.id="boc-id-select",g.style.fontSize="16px",g.style.color="rgb(122, 122, 122)",g.style.padding="5px",g.style.margin="5px",g.style.width="60%",g.style.border="1px solid #aeaeae",r.appendChild(g);var p=document.createElement("BR");r.appendChild(p);for(var u=0;u<t.length;u++){(v=document.createElement("option")).setAttribute("value",t[u]);var f=document.createTextNode(t[u]);v.appendChild(f),g.appendChild(v)}var m=document.createElement("LABEL"),C=document.createTextNode("Reports to:");m.setAttribute("for","pid-select"),m.appendChild(C),m.style.fontSize="16px",m.style.color="rgb(122, 122, 122)",m.style.padding="5px",m.style.margin="5px",m.style.width="30%",m.style.textAlign="right",m.style.display="inline-block",r.appendChild(m);var b=document.createElement("SELECT");b.id="pid-select",b.style.fontSize="16px",b.style.color="rgb(122, 122, 122)",b.style.padding="5px",b.style.margin="5px",b.style.width="60%",b.style.border="1px solid #aeaeae",r.appendChild(b);for(u=0;u<t.length;u++){var v;(v=document.createElement("option")).setAttribute("value",t[u]);f=document.createTextNode(t[u]);v.appendChild(f),b.appendChild(v)}var O=document.createElement("BUTTON");O.innerHTML="Import",O.style.fontSize="16px",O.style.color="rgb(122, 122, 122)",O.style.padding="5px 20px",O.style.margin="20px auto",O.style.display="block",O.onclick=function(){n.style.display="none",n._overlay&&n._overlay.parentNode.removeChild(n._overlay);var r=g.options[g.selectedIndex].value,i=t.indexOf(r);t[i]="id";var a=b.options[b.selectedIndex].value,o=t.indexOf(a);t[o]="pid",e(t)};var x=document.createElement("DIV");return x.appendChild(O),r.appendChild(x),s.onclick=function(t){n._overlay&&n._overlay.parentNode.removeChild(n._overlay),n.parentNode.removeChild(n),t.stopPropagation()},a.onmousedown=function(t){t=t||window.event,n._dragging=!0,n._originalLeft=n.offsetLeft,n._originalTop=n.offsetTop,n._mouseLeft=t.clientX,n._mouseTop=t.clientY},document.onmousemove=function(t){t=t||window.event,n._dragging&&(n.style.left=n._originalLeft+t.clientX-n._mouseLeft+"px",n.style.top=n._originalTop+t.clientY-n._mouseTop+"px")},document.onmouseup=function(t){t=t||window.event,n._dragging&&(n.style.left=n._originalLeft+t.clientX-n._mouseLeft+"px",n.style.top=n._originalTop+t.clientY-n._mouseTop+"px",n._dragging=!1)},n}e(t)},OrgChart._importCenter=function(t){t&&(t.style.left=(window.innerWidth-t.offsetWidth)/2+"px",t.style.top=(window.innerHeight-t.offsetHeight)/2+"px")},OrgChart.prototype.importXML=function(){var t=this,e=document.createElement("INPUT");e.setAttribute("type","file"),e.setAttribute("accept",".xml"),e.style.display="none",e.onchange=function(e){var r=e.target,i=new FileReader;i.onload=function(){var e=i.result,r=OrgChart._xml2json(e);0!=OrgChart.events.publish("import",[t,r])&&(t._putInUndoStack(),t.clearRedo(),t.config.nodes=r,t._ai.setContext(),OrgChart.events.publish("updated",[t]),t.filterUI.update(),t.draw())},i.readAsText(r.files[0])},e.click()},OrgChart.prototype.importJSON=function(){var t=this,e=document.createElement("INPUT");e.setAttribute("type","file"),e.setAttribute("accept",".json"),e.style.display="none",e.onchange=function(e){var r=e.target,i=new FileReader;i.onload=function(){var e=i.result,r=JSON.parse(e);0!=OrgChart.events.publish("import",[t,r])&&(t._putInUndoStack(),t.clearRedo(),t.config.nodes=r,t._ai.setContext(),OrgChart.events.publish("updated",[t]),t.filterUI.update(),t.draw())},i.readAsText(r.files[0])},e.click()},OrgChart.prototype.expand=function(t,e,r){this._resetMovableNodes();var i={id:t,ids:e};this._draw(!1,OrgChart.action.expand,i,r)},OrgChart.prototype.collapse=function(t,e,r){this._resetMovableNodes();var i={id:t,ids:e};this._draw(!1,OrgChart.action.collapse,i,r)},OrgChart.prototype.expandCollapse=function(t,e,r,i){this._resetMovableNodes(),Array.isArray(e)||(e=[]),Array.isArray(r)||(r=[]);var n={id:t,expandIds:e,collapseIds:r,ids:e.concat(r)};this._draw(!1,OrgChart.action.collapse,n,i)},OrgChart.prototype.changeRoots=function(t,e,r){this.config.roots=e;var i={id:t,changeRoots:e};this._draw(!1,OrgChart.action.update,i,r)},OrgChart.prototype._resetMovableNodes=function(){if(OrgChart.RESET_MOVABLE_ONEXPANDCOLLAPSE&&null!=this.config.movable){for(var t=!1,e=0;e<this.config.nodes.length;e++){var r=this.config.nodes[e];null!=r.movex&&(r.movex=0,t=!0),null!=r.movey&&(r.movey=0,t=!0)}t&&(this._ai.setContext(),OrgChart.events.publish("updated",[this]))}},OrgChart.prototype.maximize=function(t,e,r,i){var n=this,a={id:t,options:{}};OrgChart.isNEU(a.id)&&(a.id=this.roots[0].id,a.all=!0),a.options.horizontal=!1,a.options.vertical=!1,e&&(a.options.horizontal=e),r&&(a.options.vertical=r),this._draw(!1,OrgChart.action.maximize,a,(function(){n.ripple(t),i&&i()}))},OrgChart.prototype.minimize=function(t,e){var r=this,i={id:t};OrgChart.isNEU(i.id)&&(i.id=this.roots[0].id,i.all=!0),this._draw(!1,OrgChart.action.minimize,i,(function(){r.ripple(t),e&&e()}))},OrgChart.prototype._expCollHandler=function(t){this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var e=this.getNode(t),r=this.getCollapsedIds(e);if(r.length){if(!1===OrgChart.events.publish("expcollclick",[this,!1,t,r]))return!1;this.expand(t,r,!1)}else{if(!1===OrgChart.events.publish("expcollclick",[this,!0,t,e.childrenIds]))return!1;this.collapse(t,e.childrenIds,!1)}},OrgChart.prototype._upHandler=function(t){this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var e=this._upHandlerCreateArgs(t);if(!1===OrgChart.events.publish("up-click",[this,e]))return!1;this.changeRoots(e.id,e.roots,!1)},OrgChart.prototype._upHandlerCreateArgs=function(t){var e,r=this.getNode(t),i=Object.assign([],this.config.roots),n=this.getNode(r.pid);if(n&&(e=n),e){if(Array.isArray(i)){var a=i.indexOf(r.id);-1!=a&&i.splice(a,1)}else i=[];i.push(e.id)}return{id:r.id,roots:i}},String.prototype.replaceAll||(String.prototype.replaceAll=function(t,e){return this.replace(new RegExp(t,"g"),e)}),String.prototype.endsWith||(String.prototype.endsWith=function(t){return-1!==this.indexOf(t,this.length-t.length)}),String.prototype.splice||(String.prototype.splice=function(t,e,r){return this.slice(0,t)+r+this.slice(t+Math.abs(e))}),String.prototype.insert||(String.prototype.insert=function(t,e){return t>0?this.substring(0,t)+e+this.substr(t):e+this}),Array.prototype.unique||Object.defineProperty(Array.prototype,"unique",{value:function(){for(var t=this.concat(),e=0;e<t.length;++e)for(var r=e+1;r<t.length;++r)t[e]===t[r]&&t.splice(r--,1);return t},writable:!0,configurable:!0,enumerable:!1}),Array.prototype.has||Object.defineProperty(Array.prototype,"has",{value:function(t){for(var e=0;e<this.length;e++)if(this[e]==t)return!0;return!1},writable:!0,configurable:!0,enumerable:!1}),Array.prototype.compare||Object.defineProperty(Array.prototype,"compare",{value:function(t){if(this.length!=t.length)return!1;for(var e=0;e<this.length;e++)if(!t.has(this[e]))return!1;return!0},writable:!0,configurable:!0,enumerable:!1}),Object.assign||Object.defineProperty(Object,"assign",{value:function(t,e){"use strict";if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])}return r},writable:!0,configurable:!0}),OrgChart.prototype._globalMouseDownHandler=function(t,e){var r={move:"mousemove",up:"mouseup",leave:"mouseleave"};if(-1!=e.type.indexOf("touch")&&(1==e.touches.length?this._touch={x:e.touches[0].clientX,y:e.touches[0].clientY}:this._touch=null,r={move:"touchmove",up:"touchend",touchstart:"touchstart"}),t==e.target)return e.stopPropagation(),e.preventDefault(),void this._mouseDownHandler(t,e,r);if(this.config.nodeMouseClick==OrgChart.action.pan){for(var i=e.target;i!=t&&!i.hasAttribute(OrgChart.attr.control_expcoll_id)&&!i.hasAttribute(OrgChart.attr.control_up_id);)i=i.parentNode;if(!i.hasAttribute(OrgChart.attr.control_expcoll_id)&&!i.hasAttribute(OrgChart.attr.control_up_id))return e.stopPropagation(),e.preventDefault(),void this._mouseDownHandler(t,e,r)}for(var n=e.target;n!=t;){if(n.hasAttribute(OrgChart.attr.node_id))return void this._nodeMouseDownHandler(n,e,r);if(n.hasAttribute(OrgChart.attr.control_node_circle_menu_name))return e.stopPropagation(),e.preventDefault(),void this._nodeCircleNodeMenuItemMouseDownHandler(n,e,r);n=n.parentNode}},OrgChart.prototype._globalClickHandler=function(t,e){if(-1!=e.type.indexOf("touch")&&this._touch&&1==e.changedTouches.length){if(e.changedTouches.length){var r={x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY},i=OrgChart.t(this.config.template,!1,this.getScale()).size,n=this.getScale(),a=Math.abs(r.x-this._touch.x)/n,o=Math.abs(r.y-this._touch.y)/n;if(this._touch=null,a>i[0]/10)return;if(o>i[1]/10)return}}else if(-1!=e.type.indexOf("touch")&&null==this._touch)return;for(var s=e.target;s!=t;){if(s.hasAttribute(OrgChart.attr.control_expcoll_id)){var l=s.getAttribute(OrgChart.attr.control_expcoll_id),h=this.getNode(l);return void this._expCollHandler(h.id)}if(s.hasAttribute(OrgChart.attr.node_id)){l=s.getAttribute(OrgChart.attr.node_id),h=this.getNode(l);return void this._nodeClickHandler(h.id,e)}if(s.hasAttribute(OrgChart.attr.control_node_menu_id)){e.stopPropagation(),e.preventDefault();l=s.getAttribute(OrgChart.attr.control_node_menu_id),h=this.getNode(l);return void this._nodeMenuClickHandler(h.id,s,e)}if(s.hasAttribute(OrgChart.attr.control_node_circle_menu_id)){e.stopPropagation(),e.preventDefault();l=s.getAttribute(OrgChart.attr.control_node_circle_menu_id);return void this._nodeCircleMenuClickHandler(l)}if(s.hasAttribute(OrgChart.attr.control_node_circle_menu_name))return e.stopPropagation(),e.preventDefault(),void this._nodeCircleMenuItemClickHandler(s,e);if(s.hasAttribute(OrgChart.attr.control_add))return void this._lonelyButtonHandler();if(s.hasAttribute(OrgChart.attr.control_up_id)){l=s.getAttribute(OrgChart.attr.control_up_id);return e.stopPropagation(),e.preventDefault(),void this._upHandler(l)}if(s.hasAttribute(OrgChart.attr.c_link_from))return void OrgChart.events.publish("clink-click",[this,{from:s.getAttribute(OrgChart.attr.c_link_from),to:s.getAttribute(OrgChart.attr.c_link_to),event:e}]);if(s.hasAttribute(OrgChart.attr.s_link_from))return void OrgChart.events.publish("slink-click",[this,{from:s.getAttribute(OrgChart.attr.s_link_from),to:s.getAttribute(OrgChart.attr.s_link_to),event:e}]);s=s.parentNode}},OrgChart.prototype._globalContextHandler=function(t,e){for(var r=e.target;r!=t;){if(r.hasAttribute(OrgChart.attr.node_id)){var i=r.getAttribute(OrgChart.attr.node_id),n=this.getNode(i);return void this._nodeContextHandler(n.id,e)}r=r.parentNode}},OrgChart.prototype._nodeContextHandler=function(t,e){e.preventDefault(),OrgChart.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var r=this.get(t),i=null;if(null!=r&&Array.isArray(r.tags))for(var n=0;n<r.tags.length;n++){var a=r.tags[n];this.config.tags[a]&&this.config.tags[a].nodeContextMenu&&(i=this.config.tags[a].nodeContextMenu)}var o=this.element.getBoundingClientRect(),s=e.clientX-o.left,l=e.clientY-o.top;this.nodeContextMenuUI.show(s,l,t,null,i)},OrgChart.prototype._globalDbClickHandler=function(t,e){for(var r=e.target;r!=t;){if(r.hasAttribute(OrgChart.attr.node_id)){var i=r.getAttribute(OrgChart.attr.node_id),n=this.getNode(i);return void this._nodeDbClickHandler(n.id,e)}r=r.parentNode}},OrgChart.prototype._mouseScrollHandler=function(t,e){this.__mouseScrollHandler(this.getSvg(),e)},OrgChart.prototype.__mouseScrollHandler=function(t,e){if(e.ctrlKey){if(this.config.mouseScrool==OrgChart.action.zoom)return}else{if(this.config.mouseScrool==OrgChart.action.ctrlZoom)return;if(this.config.mouseScrool!=OrgChart.action.zoom)return}if(e.preventDefault(),!navigator.hardwareConcurrency||navigator.hardwareConcurrency<9){let i=e.deltaY/1e3;i=Math.abs(i)<.1?.1*e.deltaY/Math.abs(e.deltaY):i;var r=OrgChart._centerPointInPercent(t,e.pageX,e.pageY);this.zoom(1-i,r)}else{var i=this,n=!1,a=this.config.zoom.speed,o=this.config.zoom.smooth,s=0,l=this.getScale();r=OrgChart._centerPointInPercent(t,e.pageX,e.pageY);var h=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,20)};e.preventDefault();var c=e.delta||e.wheelDelta;void 0===c&&(c=-e.detail),c=Math.max(-1,Math.min(1,c)),s+=-c*a,n||function t(){n=!0;var e=(s-l)/o;e>0?e++:e--,l+=e,i.zoom(1-e/12/50,r),parseInt(l)==parseInt(s)?n=!1:h(t)}()}},OrgChart.prototype._nodeCircleNodeMenuItemMouseDownHandler=function(t,e,r){var i=t.parentNode.getAttribute(OrgChart.attr.control_node_circle_menu_wrraper_id),n=t.getAttribute(OrgChart.attr.control_node_circle_menu_name),a=this.nodeCircleMenuUI._menu[n];if(a.draggable){var o=this,s=OrgChart._getClientXY(e),l=this.getNode(i);t._dragEventFired=!1;var h=o.getScale(),c=null,d=null;this._gragStartedId=i,document.body.style.mozUserSelect=document.body.style.webkitUserSelect=document.body.style.userSelect="none";var g=this.getSvg(),p={x:s.x,y:s.y},u=t.cloneNode(!0);g.insertBefore(u,g.firstChild);var f=OrgChart._getTransform(u),m=f[4],C=f[5],b=function(t){for(;t&&!t.hasAttribute(OrgChart.attr.control_node_circle_menu_wrraper_id);)t=t.parentNode;if(t){var e=OrgChart._getTransform(t);return{x:e[4],y:e[5]}}console.error("cannot find parent"+OrgChart.attr.control_node_circle_menu_wrraper_id)}(t);u.setAttribute("transform","matrix(1,0,0,1,"+(m+b.x)+","+(C+b.y)+")"),u.style.opacity=.7;var v=function(t,e){if(null!=t){e.classList.remove("boc-drag-over");for(var r=OrgChart.getStParentNodes(o.getNode(c)),i=0;i<r.length;i++){var n=o.getNodeElement(r[i].id);n&&(n.style.opacity=1)}}},O=function(e){if(p){var r=OrgChart._getClientXY(e),i=e.target;OrgChart.isMobile()&&(i=document.elementFromPoint(r.x,r.y)),r.x+=b.x*h,r.y+=b.y*h;var s=OrgChart._getOffsetXY(o.element,e),l={left:o.width()-(s.x+o.config.padding)<0,right:s.x-o.config.padding<0,up:o.height()-(s.y+o.config.padding)<0,down:s.y-o.config.padding<0};if(l.left||l.right||l.up||l.down){g.classList&&(g.classList.remove("boc-cursor-grab"),g.classList.add("boc-cursor-move"),g.classList.remove("boc-cursor-nodrop"),g.classList.remove("boc-cursor-copy"));var O=f[4],y=f[5],_=p.x,k=p.y,w=r.x,S=r.y;o.moveStart(l,(function(t){f[4]=O+t.x,f[5]=y+t.y,p.x=_-t.xWithoutScale,p.y=k-t.yWithoutScale,r.x=w-t.xWithoutScale,r.y=S-t.yWithoutScale,u.setAttribute("transform","matrix("+f.toString()+")")}))}else{for(o.moveEnd(),g.classList&&(g.classList.add("boc-cursor-grab"),g.classList.remove("boc-cursor-move"),g.classList.remove("boc-cursor-nodrop"),g.classList.remove("boc-cursor-copy")),v(c,d),c=null,d=null;null!=i&&i!=g;){if(i.hasAttribute&&i.hasAttribute(OrgChart.attr.node_id)){var I=i.getAttribute(OrgChart.attr.node_id);c=I,d=i;break}i=i.parentNode}if(null!=c){d.classList.add("boc-drag-over");for(var A=o.getNode(c),L=OrgChart.getStParentNodes(A),E=0;E<L.length;E++){var N=o.getNodeElement(L[E].id);N&&(N.style.opacity=.1)}g.classList.remove("boc-cursor-grab"),g.classList.remove("boc-cursor-move"),g.classList.add("boc-cursor-copy"),g.classList.remove("boc-cursor-nodrop")}var M=(r.x-p.x)/h,T=(r.y-p.y)/h;if(f[4]=m+M,f[5]=C+T,!t._dragEventFired&&(Math.abs(r.x-p.x)>OrgChart.FIRE_DRAG_NOT_CLICK_IF_MOVE||Math.abs(r.y-p.y)>OrgChart.FIRE_DRAG_NOT_CLICK_IF_MOVE))!1===OrgChart.events.publish("drag",[o.nodeCircleMenuUI,{from:I,menuItem:a,menuItemName:n}])&&x(),t._dragEventFired=!0;u.setAttribute("transform","matrix("+f.toString()+")")}}},x=function(e){if(o.moveEnd(),g.classList&&(g.classList.remove("boc-cursor-grab"),g.classList.remove("boc-cursor-move"),g.classList.remove("boc-cursor-nodrop"),g.classList.remove("boc-cursor-copy")),g.removeEventListener(r.move,O),g.removeEventListener(r.up,x),r.leave&&g.removeEventListener(r.leave,x),l.id==c||null==c)return g.removeChild(u),o._gragStartedId=null,void(t._dragEventFired&&OrgChart.events.publish("drop",[o.nodeCircleMenuUI,{from:l.id,menuItemName:n,menuItem:a,event:e}]));var i=o.getNode(c);OrgChart.events.publish("drop",[o.nodeCircleMenuUI,{from:l.id,to:i.id,menuItem:a,menuItemName:n,event:e}]),v(c,d),g.removeChild(u),o._gragStartedId=null};g.addEventListener(r.move,O),g.addEventListener(r.up,x),r.leave&&g.addEventListener(r.leave,x)}},OrgChart.prototype._nodeMouseDownHandler=function(t,e,r){var i=t.getAttribute(OrgChart.attr.node_id),n=this.getNode(i);this.config.movable&&!OrgChart.getRootOf(n).stParent?this._movableHandler(t,e,r):this.config.enableDragDrop&&this._dragDropHandler(t,e,r)},OrgChart.prototype._movableHandler=function(t,e,r){var i=this,n=t.getAttribute(OrgChart.attr.node_id),a=[],o=function(t,e){if(Array.isArray(t))for(var r=0;r<t.length;r++)o(t[r],e);else{e.push(t.id);for(r=0;r<t.stChildren.length;r++)o(t.stChildren[r],e);for(r=0;r<t.children.length;r++)o(t.children[r],e)}},s=function(t,e){if(Array.isArray(t))for(var r=0;r<t.length;r++)o(t[r],e);else{e.push(t.id);for(r=0;r<t.stChildrenIds.length;r++)s(i.getNode(t.stChildrenIds[r]),e);for(r=0;r<t.childrenIds.length;r++)s(i.getNode(t.childrenIds[r]),e)}},l=this.getNode(n);o(l,a);for(var h=this.getSvg(),c=OrgChart._getClientXY(e),d=[],g=[],p=[],u=[],f=[],m=[],C=[],b=[],v=0;v<a.length;v++){var O=this.getNode(a[v]);d.push(O),p.push({x:O.x,y:O.y});var x=this.getNodeElement(a[v]);if(x){f.push(x);var y=OrgChart._getTransform(x);u.push({x:y[4],y:y[5]}),g.push(y);var _=this.element.querySelector(`[data-ctrl-ec-id="${a[v]}"]`);if(_){m.push(_);var k=OrgChart._getTransform(_);C.push(k),b.push({x:k[4],y:k[5]})}else m.push(null),C.push(null),b.push(null);if(this.config.movable==OrgChart.movable.node)break}}t._dragEventFired=!1;var w=null,S=null;this._gragStartedId=a[0],document.body.style.mozUserSelect=document.body.style.webkitUserSelect=document.body.style.userSelect="none";var I={x:c.x,y:c.y},A=i.getScale(),L=function(t,e){if(null!=t){e.classList.remove("boc-drag-over");for(var r=i.getNode(w),n=OrgChart.getStParentNodes(r),a=0;a<n.length;a++){var o=i.getNodeElement(n[a].id);o&&(o.style.opacity=1)}}},E=function(e){if(I){var r=OrgChart._getClientXY(e),o=e.target;OrgChart.isMobile()&&(o=document.elementFromPoint(r.x,r.y));var s=OrgChart._getOffsetXY(i.element,e),c={left:i.width()-(s.x+i.config.padding)<0,right:s.x-i.config.padding<0,up:i.height()-(s.y+i.config.padding)<0,down:s.y-i.config.padding<0};if(c.left||c.right||c.up||c.down){h.classList&&(h.classList.remove("boc-cursor-grab"),h.classList.add("boc-cursor-move"),h.classList.remove("boc-cursor-nodrop"),h.classList.remove("boc-cursor-copy"));for(var v=[],O=[],x=[],y=[],_=0;_<g.length;_++)v.push(g[_][4]),O.push(g[_][5]),C[_]?(x.push(C[_][4]),y.push(C[_][5])):(x.push(null),y.push(null));var k=I.x,E=I.y,M=r.x,T=r.y;i.moveStart(c,(function(t){for(var e=0;e<g.length;e++){var n=v[e],a=O[e],o=x[e],s=y[e];g[e][4]=n+t.x,g[e][5]=a+t.y,I.x=k-t.xWithoutScale,I.y=E-t.yWithoutScale,r.x=M-t.xWithoutScale,r.y=T-t.yWithoutScale,d[e].x=n+t.x,d[e].y=a+t.y,d[e].movex=t.x,d[e].movey=t.y,C[e]&&(C[e][4]=o+t.x,C[e][5]=s+t.y);for(var l=OrgChart.ui.link(d[e],i,A,i.response.bordersByRootIdAndLevel,i.nodes,OrgChart.action.update,!0),h=0;h<l.length;h++){var c=l[h];(p=i.element.querySelector(`[data-l-id="[${c.id}][${c.childId}]"]`))&&(p.innerHTML=c.html)}if(d[e].parent)for(l=OrgChart.ui.link(d[e].parent,i,A,i.response.bordersByRootIdAndLevel,i.nodes,OrgChart.action.update,!0),h=0;h<l.length;h++){var p;c=l[h];(p=i.element.querySelector(`[data-l-id="[${c.id}][${c.childId}]"]`))&&(p.innerHTML=c.html)}f[e].setAttribute("transform","matrix("+g[e].toString()+")"),m[e]&&m[e].setAttribute("transform","matrix("+C[e].toString()+")")}}))}else{if(i.moveEnd(),h.classList&&(h.classList.add("boc-cursor-grab"),h.classList.remove("boc-cursor-move"),h.classList.remove("boc-cursor-nodrop"),h.classList.remove("boc-cursor-copy")),L(w,S),w=null,S=null,i.config.enableDragDrop)for(;null!=o&&o!=h;){if(o.hasAttribute&&o.hasAttribute(OrgChart.attr.node_id)){var R=o.getAttribute(OrgChart.attr.node_id);if(i._gragStartedId&&R!=i._gragStartedId){w=R,S=o;break}}o=o.parentNode}if(null!=w){S.classList.add("boc-drag-over");for(var B=i.getNode(w),U=OrgChart.getStParentNodes(B),P=0;P<U.length;P++){var F=i.getNodeElement(U[P].id);F&&(F.style.opacity=.1)}!i.canUpdateLink(d[0].id,w)&&h.classList?(h.classList.remove("boc-cursor-grab"),h.classList.remove("boc-cursor-move"),h.classList.remove("boc-cursor-copy"),h.classList.add("boc-cursor-nodrop")):h.classList&&(h.classList.remove("boc-cursor-grab"),h.classList.remove("boc-cursor-move"),h.classList.add("boc-cursor-copy"),h.classList.remove("boc-cursor-nodrop"))}var z=(r.x-I.x)/A,D=(r.y-I.y)/A;for(_=0;_<g.length;_++){g[_][4]=u[_].x+z,g[_][5]=u[_].y+D,C[_]&&(C[_][4]=b[_].x+z,C[_][5]=b[_].y+D),d[_].x=p[_].x+z,d[_].y=p[_].y+D,d[_].movex=z,d[_].movey=D;var H=OrgChart.ui.link(d[_],i,A,i.response.bordersByRootIdAndLevel,i.nodes,OrgChart.action.update,!0);for(P=0;P<H.length;P++){var $=H[P];(j=i.element.querySelector(`[data-l-id="[${$.id}][${$.childId}]"]`))&&(j.innerHTML=$.html)}}if(l.parent)if(i.config.movable==OrgChart.movable.detachTree)(j=i.element.querySelector(`[data-l-id="[${l.parent.id}][${l.id}]"]`))&&j.parentElement.removeChild(j);else for(H=OrgChart.ui.link(l.parent,i,A,i.response.bordersByRootIdAndLevel,i.nodes,OrgChart.action.update,!0),P=0;P<H.length;P++){var j;$=H[P];(j=i.element.querySelector(`[data-l-id="[${$.id}][${$.childId}]"]`))&&(j.innerHTML=$.html)}if(!t._dragEventFired&&(Math.abs(r.x-I.x)>OrgChart.FIRE_DRAG_NOT_CLICK_IF_MOVE||Math.abs(r.y-I.y)>OrgChart.FIRE_DRAG_NOT_CLICK_IF_MOVE)){if(!1===OrgChart.events.publish("drag",[i,n,e,a])&&N(),i.config.enableDragDrop)for(_=0;_<f.length;_++)h.insertBefore(f[_],h.firstChild);t._dragEventFired=!0}for(_=0;_<g.length;_++)f[_].setAttribute("transform","matrix("+g[_].toString()+")"),m[_]&&m[_].setAttribute("transform","matrix("+C[_].toString()+")")}}},N=function(e){for(var n=0;n<d.length;n++)d[n].x=p[n].x,d[n].y=p[n].y;if(i.moveEnd(),h.classList&&(h.classList.remove("boc-cursor-grab"),h.classList.remove("boc-cursor-move"),h.classList.remove("boc-cursor-nodrop"),h.classList.remove("boc-cursor-copy")),h.removeEventListener(r.move,E),h.removeEventListener(r.up,N),r.leave&&h.removeEventListener(r.leave,N),d[0].id!=w&&null!=w){var a=i.getNode(w);if(!1===(o=OrgChart.events.publish("drop",[i,d[0].id,a.id,f[0],e])))return L(w,S),void(i._gragStartedId=null);if(i.canUpdateLink(d[0].id,w))(C=i.get(d[0].id)).pid=w,C.stpid=null,i.updateNode(C,null,!0);else L(w,S);i._gragStartedId=null}else{if(t._dragEventFired){var o=OrgChart.events.publish("drop",[i,d[0].id,void 0,f[0],e]);if(i.config.movable&&!1!==o)if(i.config.movable==OrgChart.movable.detachTree){var c=OrgChart._getTransform(i.getNodeElement(l.id));(C=i.get(l.id)).pid=null,C.stpid=null,i.updateNode(C,null,!0)}else{var g=[];i.config.movable==OrgChart.movable.node?g.push(l.id):s(l,g);var u=(c=OrgChart._getTransform(i.getNodeElement(l.id)))[4]-l.x,m=c[5]-l.y;for(n=0;n<g.length;n++){var C;(C=i.get(g[n]))&&(null!=C.movex?C.movex+=u:C.movex=u,null!=C.movey?C.movey+=m:C.movey=m,i.update(C))}i._ai.setContext(),OrgChart.events.publish("updated",[i]),i.draw(OrgChart.action.update,{dragNodeIdList:g})}}i._gragStartedId=null}};h.addEventListener(r.move,E),h.addEventListener(r.up,N),r.leave&&h.addEventListener(r.leave,N)},OrgChart.prototype._dragDropHandler=function(t,e,r){var i=OrgChart._getClientXY(e),n=t.getAttribute(OrgChart.attr.node_id),a=this.getNode(n);t._dragEventFired=!1;var o=null,s=null;this._gragStartedId=n,this.element.style.mozUserSelect=this.element.style.webkitUserSelect=this.element.style.userSelect="none";var l=this,h=this.getSvg(),c={x:i.x,y:i.y},d=OrgChart._getTransform(t),g=d[4],p=d[5],u=l.getScale(),f=t.cloneNode(!0);f.setAttribute("data-n-id","draging"),h.insertBefore(f,h.firstChild),f.style.opacity=.7;var m=function(t,e){if(null!=t){e.classList.remove("boc-drag-over");for(var r=l.getNode(o),i=OrgChart.getStParentNodes(r),n=0;n<i.length;n++){var a=l.getNodeElement(i[n].id);a&&(a.style.opacity=1)}}},C=function(e){if(c){var r=OrgChart._getClientXY(e),i=e.target;OrgChart.isMobile()&&(i=document.elementFromPoint(r.x,r.y));var n=OrgChart._getOffsetXY(l.element,e),C={left:l.width()-(n.x+l.config.padding)<0,right:n.x-l.config.padding<0,up:l.height()-(n.y+l.config.padding)<0,down:n.y-l.config.padding<0};if(C.left||C.right||C.up||C.down){h.classList&&(h.classList.remove("boc-cursor-grab"),h.classList.add("boc-cursor-move"),h.classList.remove("boc-cursor-nodrop"),h.classList.remove("boc-cursor-copy"));var v=d[4],O=d[5],x=c.x,y=c.y,_=r.x,k=r.y;l.moveStart(C,(function(t){d[4]=v+t.x,d[5]=O+t.y,c.x=x-t.xWithoutScale,c.y=y-t.yWithoutScale,r.x=_-t.xWithoutScale,r.y=k-t.yWithoutScale,f.setAttribute("transform","matrix("+d.toString()+")")}))}else{if(l.moveEnd(),h.classList&&(h.classList.add("boc-cursor-grab"),h.classList.remove("boc-cursor-move"),h.classList.remove("boc-cursor-nodrop"),h.classList.remove("boc-cursor-copy")),m(o,s),o=null,s=null,l.config.enableDragDrop)for(;null!=i&&i!=h;){if(i.hasAttribute&&i.hasAttribute(OrgChart.attr.node_id)){var w=i.getAttribute(OrgChart.attr.node_id);if(l._gragStartedId&&w!=l._gragStartedId){o=w,s=i;break}}i=i.parentNode}if("draging"==o&&(o=null,s=null),null!=o){s.classList.add("boc-drag-over");for(var S=l.getNode(o),I=OrgChart.getStParentNodes(S),A=0;A<I.length;A++){var L=l.getNodeElement(I[A].id);L&&(L.style.opacity=.1)}!l.canUpdateLink(a.id,o)&&h.classList?(h.classList.remove("boc-cursor-grab"),h.classList.remove("boc-cursor-move"),h.classList.remove("boc-cursor-copy"),h.classList.add("boc-cursor-nodrop")):h.classList&&(h.classList.remove("boc-cursor-grab"),h.classList.remove("boc-cursor-move"),h.classList.add("boc-cursor-copy"),h.classList.remove("boc-cursor-nodrop"))}var E=(r.x-c.x)/u,N=(r.y-c.y)/u;if(d[4]=g+E,d[5]=p+N,!t._dragEventFired&&(Math.abs(r.x-c.x)>OrgChart.FIRE_DRAG_NOT_CLICK_IF_MOVE||Math.abs(r.y-c.y)>OrgChart.FIRE_DRAG_NOT_CLICK_IF_MOVE))!1===OrgChart.events.publish("drag",[l,w,e])&&b(),t._dragEventFired=!0;f.setAttribute("transform","matrix("+d.toString()+")")}}},b=function(e){if(l.moveEnd(),h.classList&&(h.classList.remove("boc-cursor-grab"),h.classList.remove("boc-cursor-move"),h.classList.remove("boc-cursor-nodrop"),h.classList.remove("boc-cursor-copy")),h.removeEventListener(r.move,C),h.removeEventListener(r.up,b),r.leave&&h.removeEventListener(r.leave,b),a.id==o||null==o)return t._dragEventFired&&OrgChart.events.publish("drop",[l,a.id,void 0,f,e]),h.removeChild(f),void(l._gragStartedId=null);var i=l.getNode(o);if(!1===OrgChart.events.publish("drop",[l,a.id,i.id,f,e]))return m(o,s),h.removeChild(f),void(l._gragStartedId=null);if(l.canUpdateLink(a.id,o)){var n=l.get(a.id);n.pid=o,n.stpid=null,null!=n.movex&&(n.movex=void 0),null!=n.movey&&(n.movey=void 0),l.updateNode(n,null,!0)}else h.removeChild(f),m(o,s);l._gragStartedId=null};h.addEventListener(r.move,C),h.addEventListener(r.up,b),r.leave&&h.addEventListener(r.leave,b)},OrgChart.prototype._resizeHandler=function(t,e){if(this.isVisible){var r=this.getViewBox(),i=this.getSvg(),n=i.getAttribute("width"),a=i.getAttribute("height"),o=n/r[2],s=a/r[3],l=o>s?s:o;i.setAttribute("width",this.width()),i.setAttribute("height",this.height()),r[2]=this.width()/l,r[3]=this.height()/l,this.setViewBox(r),this.xScrollUI.create(this.width()),this.yScrollUI.create(this.height()),this._draw(!1,OrgChart.action.resize)}},OrgChart.prototype._nodeDbClickHandler=function(t,e){if(!1===OrgChart.events.publish("dbclick",[this,this.get(t)]))return!1;this._commonClickHandler(t,e,this.config.nodeMouseDbClick)},OrgChart.prototype._nodeClickHandler=function(t,e){var r=this.getNodeElement(t);if(r&&r._dragEventFired)r._dragEventFired=!1;else{if(!1===OrgChart.events.publish("click",[this,{node:this.getNode(t),event:e}]))return!1;this._commonClickHandler(t,e,this.config.nodeMouseClick)}},OrgChart.prototype._nodeCircleMenuItemClickHandler=function(t,e){var r=t.parentNode.getAttribute(OrgChart.attr.control_node_circle_menu_wrraper_id),i=t.getAttribute(OrgChart.attr.control_node_circle_menu_name),n=this.nodeCircleMenuUI._menu[i];OrgChart.events.publish("click",[this.nodeCircleMenuUI,{nodeId:r,menuItemName:i,menuItem:n,event:e}])},OrgChart.prototype._nodeCircleMenuClickHandler=function(t){OrgChart.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide();var e=this.getNode(t),r=null;if(Array.isArray(e.tags))for(var i=0;i<e.tags.length;i++){var n=e.tags[i];this.config.tags[n]&&this.config.tags[n].nodeCircleMenu&&(r=this.config.tags[n].nodeCircleMenu)}this.nodeCircleMenuUI.show(t,r)},OrgChart.prototype._commonClickHandler=function(t,e,r){var i;(OrgChart.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide(),r==OrgChart.action.expandCollapse&&this.toggleExpandCollapse(t,e),r==OrgChart.action.edit)&&((i=this.getNode(t))&&(this.editUI.show(i.id),this.ripple(i.id,e.clientX,e.clientY)));r==OrgChart.action.details&&((i=this.getNode(t))&&(this.editUI.show(i.id,!0),this.ripple(i.id,e.clientX,e.clientY)))},OrgChart.prototype._menuHandlerMouseDownHandler=function(t,e){e.stopPropagation(),e.preventDefault()},OrgChart.prototype._nodeMenuClickHandler=function(t,e,r){OrgChart.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var i=this.getNode(t),n=null;if(Array.isArray(i.tags))for(var a=0;a<i.tags.length;a++){var o=i.tags[a];this.config.tags[o]&&this.config.tags[o].nodeMenu&&(n=this.config.tags[o].nodeMenu)}this.nodeMenuUI.showStickIn(e,t,null,n)},OrgChart.prototype._menuClickHandler=function(t,e){e.stopPropagation(),e.preventDefault(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.show(t.offsetLeft,t.offsetTop)},OrgChart.prototype._lonelyButtonHandler=function(){var t={id:this.generateId()};!1!==this.addNode(t,null,!0)&&this.center(t.id)},OrgChart.prototype.toggleExpandCollapse=function(t,e){var r=this.getNode(t),i=this.getCollapsedIds(r);if(i.length){if(!1===OrgChart.events.publish("expcollclick",[this,!1,t,i]))return!1;this.expand(t,i,!1)}else{if(!1===OrgChart.events.publish("expcollclick",[this,!0,t,r.childrenIds]))return!1;this.collapse(t,r.childrenIds,!1)}e&&this.ripple(r.id,e.clientX,e.clientY)},OrgChart.prototype._move=function(t,e,r){r[0]=e,r[1]=t,this.setViewBox(r),this.xScrollUI.setPosition(),this.yScrollUI.setPosition()},OrgChart.prototype.moveStart=function(t,e,r,i){if(t){if(!this._moveInterval){var n=this,a=this.getViewBox().slice(0),o=this.getScale(),s=0,l=0,h=1;OrgChart.isNEU(r)&&(r=OrgChart.anim.inSin),OrgChart.isNEU(i)&&(i=3e3),this._moveInterval=setInterval((function(){var c={x:0,y:0,xWithoutScale:0,yWithoutScale:0};t.left?(s++,c.x=s*OrgChart.MOVE_STEP/o,c.xWithoutScale=s*OrgChart.MOVE_STEP):t.right&&(s++,c.x=-s*OrgChart.MOVE_STEP/o,c.xWithoutScale=-s*OrgChart.MOVE_STEP),t.up?(l++,c.y=l*OrgChart.MOVE_STEP/o,c.yWithoutScale=l*OrgChart.MOVE_STEP):t.down&&(l++,c.y=-l*OrgChart.MOVE_STEP/o,c.yWithoutScale=-l*OrgChart.MOVE_STEP);var d=r((10*h-10)/i);c.x=c.x*d,c.xWithoutScale=c.xWithoutScale*d,c.y=c.y*d,c.yWithoutScale=c.yWithoutScale*d,n.setViewBox([a[0]+c.x,a[1]+c.y,a[2],a[3]]),e&&e(c),h+=1}),10)}}else console.error("movePosition parameter not defined")},OrgChart.prototype.moveEnd=function(){this._moveInterval&&(clearInterval(this._moveInterval),this._moveInterval=null)},void 0===OrgChart&&(OrgChart={}),OrgChart.node=function(t,e,r,i){this.templateName=i,this.id=t,this.pid=e,this.children=[],this.childrenIds=[],this.parent=null,this.stpid=null,this.stParent=null,this.stChildren=[],this.stChildrenIds=[],this.tags=r,this.tags||(this.tags=[])},OrgChart.prototype._mouseDownHandler=function(t,e,r){var i=this;OrgChart.HIDE_EDIT_FORM_ON_PAN&&this.editUI.hide(),OrgChart.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var n=this.getViewBox(),a=this.getScale(),o=OrgChart._getClientTouchesXY(e,0),s=OrgChart._getClientTouchesXY(e,1),l={diffX:0,diffY:0,x0:o.x,y0:o.y,type:"pan",viewBoxLeft:n[0],viewBoxTop:n[1]};e.touches&&e.touches.length>1&&(l.type="pinch",l.dist=Math.sqrt((o.x-s.x)*(o.x-s.x)+(o.y-s.y)*(o.y-s.y))),"pan"==l.type&&(this._hideBeforeAnimation(),this._changeCursorOnPanStart(n,a,e));var h=function(t){var e=OrgChart._getClientTouchesXY(t,0);if(l&&"pan"==l.type){i._hideBeforeAnimation(),l.diffX=e.x-l.x0,l.diffY=e.y-l.y0;var r=-l.diffY/a+l.viewBoxTop,o=-l.diffX/a+l.viewBoxLeft;i._move(r,o,n)}else if(l&&"pinch"==l.type){var s=OrgChart._getClientTouchesXY(t,1),h=Math.sqrt((e.x-s.x)*(e.x-s.x)+(e.y-s.y)*(e.y-s.y)),c=1+(h-l.dist)/(l.dist/100)/100;l.dist=h;var d=OrgChart._pinchMiddlePointInPercent(i.element,i.width(),i.height(),t);i.zoom(c,d)}},c=function(){"pan"==l.type&&i.config.sticky?setTimeout((function(){OrgChart._moveToBoundaryArea(t,i.getViewBox(),i.response.boundary,(function(){i._draw(!0,OrgChart.action.pan)}))}),0):"pan"!=l.type||i.config.sticky||setTimeout((function(){i._draw(!0,OrgChart.action.pan)}),0),"pan"==l.type&&i._changeCursorOnPanEnd(),l=null,t.removeEventListener(r.move,h),t.removeEventListener(r.up,c),r.leave&&t.removeEventListener(r.leave,c),r.touchstart&&t.removeEventListener(r.touchstart,c)};this.config.enablePan&&(t.addEventListener(r.move,h),t.addEventListener(r.up,c),r.leave&&t.addEventListener(r.leave,c),r.touchstart&&t.addEventListener(r.touchstart,c))},OrgChart.prototype._changeCursorOnPanStart=function(t,e,r){var i=this.getPointerElement();if(i){var n=OrgChart._getOffsetXY(this.element,r),a=n.x/e+t[0]-16/e,o=n.y/e+t[1]-16/e;i.style.display="inherit",i.setAttribute("transform","matrix(0,0,0,0,"+a+","+o+")"),OrgChart.animate(i,{transform:[0,0,0,0,a,o],opacity:0},{transform:[1/e,0,0,1/e,a,o],opacity:1},300,OrgChart.anim.outBack)}else this.element.style.cursor="move"},OrgChart.prototype._changeCursorOnPanEnd=function(){var t=this.getPointerElement();t?t.style.display="none":this.element.style.cursor="initial"},OrgChart.searchUI=function(){this.lastSearch=[],this._searchAfterEnterPress=!1,this._event_id=OrgChart._guid(),this.instance=null},OrgChart.searchUI.prototype.init=function(t){this.instance=t,this.obj=this.instance,this._initSearchFields();var e=this,r=this.instance.config.padding-10,i=this.instance.config.padding-10,n=this.instance.getMenuButton();if(n){var a=n.getBoundingClientRect(),o=this.instance.getSvg().getBoundingClientRect();r=o.right-a.left+10,i=a.top-o.top-10}var s=document.createElement("div");s.classList.add("boc-search"),s.style.right=r+"px",s.style.top=i+"px";var l=OrgChart.elements.textbox({},{label:OrgChart.SEARCH_PLACEHOLDER,btn:"X"},"320px");s.innerHTML+=l.html,this.xBtn=s.querySelector("[data-input-btn]"),this.xBtn.style.display="none",this.searchTableWrapper=document.createElement("div"),s.appendChild(this.searchTableWrapper);var h=this.instance.getSvg().nextSibling;this.instance.element.insertBefore(s,h),OrgChart.input.init(s),this.input=document.getElementById(l.id),this.xBtn.addEventListener("click",(function(t){t.preventDefault(),e.hide()})),this.input.addEventListener("keypress",(function(t){"Enter"==t.key&&t.preventDefault()})),this.input.addEventListener("focus",(function(t){e.xBtn.style.display="",e._search()})),this.input.addEventListener("blur",(function(t){OrgChart.isNEU(e.input.value)&&OrgChart.SEARCH_HELP_SYMBOL!=e.input.value&&(e.xBtn.style.display="none")})),this.input.addEventListener("keydown",(function(t){("ArrowDown"==t.key||"ArrowUp"==t.key)&&t.preventDefault()})),this.input.addEventListener("keyup",(function(t){"ArrowDown"==t.key?c():"ArrowUp"==t.key?d():"Enter"==t.key?e._enterHandler():"Escape"==t.key?e.hide():this.value.length>=OrgChart.MINIMUM_SYMBOLS_IN_SEARCH_INPUT&&e._search()}));var c=function(){var t=e.instance.element.querySelectorAll("[data-search-item-id]"),r=e.instance.element.querySelector('[data-selected="yes"]');null==r&&t.length>0?t[0].setAttribute("data-selected","yes"):t.length>0&&r.nextSibling&&r.nextSibling.setAttribute&&(r.removeAttribute("data-selected"),r.nextSibling.setAttribute("data-selected","yes"))},d=function(){var t=e.instance.element.querySelectorAll("[data-search-item-id]"),r=e.instance.element.querySelector('[data-selected="yes"]');null==r&&t.length>0?t[t.length-1].setAttribute("data-selected","yes"):t.length>0&&r.previousSibling&&r.previousSibling.setAttribute&&(r.removeAttribute("data-selected"),r.previousSibling.setAttribute("data-selected","yes"))}},OrgChart.searchUI.prototype._enterHandler=function(){var t=this.instance.element.querySelector('[data-selected="yes"]');if(t){if(t.hasAttribute("data-search-item-id")){var e=t.getAttribute("data-search-item-id");if(this.input.value!=OrgChart.SEARCH_HELP_SYMBOL){var r=OrgChart.events.publish("",[this.instance,e]),i=OrgChart.events.publish("searchclick",[this,{nodeId:e}]);!1===r&&(i=!1),0!=i&&this.instance.center(e)}else this.input.value=e+" ",this.searchTableWrapper.innerHTML=""}}else this._searchAfterEnterPress=!0,this.__search(),this.searchTableWrapper.innerHTML="",this.instance.draw()},OrgChart.searchUI.prototype._initSearchFields=function(){if(null==this.instance.config.searchFields){this._searchFields=[];for(var t=0;t<this.instance.response.allFields.length;t++){var e=this.instance.response.allFields[t];"tags"==e||OrgChart._fieldIsImg(this.instance.config,e)||-1==this._searchFields.indexOf(e)&&this._searchFields.push(e)}}else this._searchFields=this.instance.config.searchFields;if(null==this.instance.config.searchFieldsAbbreviation){this.searchFieldsAbbreviation={};for(t=0;t<this._searchFields.length;t++){for(var r=this._searchFields[t],i=0,n=r.slice(0,i+1).toLowerCase();this.searchFieldsAbbreviation[n];)i++,n=r.slice(0,i+1).toLowerCase();this.searchFieldsAbbreviation[n]=r}}else this.searchFieldsAbbreviation=this.instance.config.searchFieldsAbbreviation;this._searchFieldsAbbreviation=this.searchFieldsAbbreviation},OrgChart.searchUI.prototype.find=function(t){this.input&&(this.input.value=t,document.activeElement==this.input?this._search(t):this.input.focus())},OrgChart.searchUI.prototype.addMatchTag=function(t){if(this._searchAfterEnterPress){for(var e=0;e<this.lastSearch.length;e++)if(this.lastSearch[e].id==t)return!0;return!1}return null},OrgChart.searchUI.prototype.__search=function(){this.lastSearch=OrgChart._search.search(this.instance.config.nodes,this.input.value,this._searchFields,this._searchFields,this.instance.config.searchDisplayField,this.instance.config.searchFieldsWeight,this.searchFieldsAbbreviation)},OrgChart.searchUI.prototype._search=function(){var t,e=this;if(this._searchAfterEnterPress=!1,this.input.value==OrgChart.SEARCH_HELP_SYMBOL)t=this.helpView();else{this.__search();var r=OrgChart._getFistImgField(this.instance.config);t=`<table border="0" cellspacing="0" cellpadding="0">\n <tbody>\n ${function(){for(var t="",i=0;i<e.lastSearch.length&&!(i>=OrgChart.SEARCH_RESULT_LIMIT);i++){var n=e.lastSearch[i],a="";if(r){var o=e.instance._get(n.id);"function"==typeof r?a=r(e.instance,e.instance.getNode(n.id),o):o[r]&&(a=o[r])}var s="",l="";e.instance.config.searchDisplayField==n.__searchField?s=n.__searchMarks:e.instance.config.searchDisplayField?(s=n[e.instance.config.searchDisplayField],OrgChart.isNEU(s)&&(s=""),l=n.__searchMarks):s=n.__searchMarks;var h={img:a,nodeId:n.id,first:s,second:l,searchItem:n,html:OrgChart.searchUI.createItem(a,n.id,s,l)};OrgChart.events.publish("add-item",[e,h]),t+=h.html}return t}()} \n </tbody>\n </table>`}this.searchTableWrapper.innerHTML=t;for(var i=this.instance.element.querySelectorAll("[data-search-item-id]"),n=0;n<i.length;n++)i[n].addEventListener("click",(function(){if(this.hasAttribute("data-search-item-id")){var t=this.getAttribute("data-search-item-id");if(e.input.value!=OrgChart.SEARCH_HELP_SYMBOL){var r=OrgChart.events.publish("searchclick",[e.instance,t]),i=OrgChart.events.publish("searchclick",[e,{nodeId:t}]);if(!1===r&&(i=!1),!1!==i){e.instance.center(this.getAttribute("data-search-item-id"));var n=e.instance.element.querySelector('[data-selected="yes"]');n&&n.removeAttribute("data-selected"),this.setAttribute("data-selected","yes"),e.input.focus()}}else e.input.value=t+" ",e.searchTableWrapper.innerHTML="",e.input.focus()}}));OrgChart.events.publish("show-items",[this,{}])},OrgChart.searchUI.prototype.helpView=function(){var t='<table border="0" cellspacing="0" cellpadding="0">';for(var e in this.searchFieldsAbbreviation)t+=`<tr data-search-item-id="${e}" style="height: 50px;"><td class="boc-search-image-td" style="text-align: center;">${e}</td><td class="boc-search-text-td">${this.searchFieldsAbbreviation[e]}</td></tr>`;return t+="</table>"},OrgChart.searchUI.createItem=function(t,e,r,i){return r&&(r="<b>"+r+"</b>"),`<tr data-search-item-id="${e}">\n <td class="boc-search-image-td">\n ${t=t?`<div class="boc-search-photo" style="background-image: url(${t})"></div>`:`<div class="boc-search-photo">${OrgChart.icon.user(32,32,"#aeaeae")}</div>`}\n </td>\n <td class="boc-search-text-td">${r} <br/>${i}</td>\n </tr>`},OrgChart.searchUI.prototype.hide=function(){if(!1===OrgChart.events.publish("hide",[this]))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&&(this.input.value="",document.activeElement==this.input&&this.input.blur(),document.activeElement==this.xBtn&&OrgChart.input.blurHandler(this.input))},OrgChart.searchUI.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},void 0===OrgChart&&(OrgChart={}),OrgChart.manager=function(t){this.config=t.config,this.layoutConfigs=t._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=t,this._fixAdjustForExport={x:0,y:0}},OrgChart.manager.prototype.read=function(t,e,r,i,n,a,o,s){var l=this;OrgChart.state._get(this.config.state,e,r,(function(h){l.state=h,l.action=n,l.actionParams=a,n!=OrgChart.action.init||!l.state||a&&a.method&&"fit"==a.method?(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 c=l.maxX,d=l.maxY,g=l.minX,p=l.minY,u=l.bordersByRootIdAndLevel,f=l.roots,m=l.nodes;if(t){var C=OrgChart.manager._getResponse(e,r,l.visibleNodeIds,l.config,c,d,g,p,l.viewBox,f,l.action,l.actionParams,m,l.oldNodes,l.vbIsInitializedFromState);n!=OrgChart.action.exporting&&(l.maxX=c,l.maxY=d,l.minX=g,l.minY=p,l.roots=f,l.nodes=m,l.visibleNodeIds=C.visibleNodeIds),C.bordersByRootIdAndLevel=u,C.roots=f,C.adjustify={x:0,y:0},l.state&&(C.adjustify=l.state.adjustify),o(C)}else l.oldNodes=m||null,l._read((function(t){c=t.maxX,d=t.maxY,g=t.minX,p=t.minY,u=t.bordersByRootIdAndLevel,f=t.roots,m=t.nodes;var i=OrgChart.manager._getResponse(e,r,l.visibleNodeIds,l.config,c,d,g,p,l.viewBox,f,l.action,l.actionParams,m,l.oldNodes,l.vbIsInitializedFromState);i.notif=t.limit,i.roots=f,i.bordersByRootIdAndLevel=u,i.adjustify=t.adjustify,n!=OrgChart.action.exporting&&(l.maxX=c,l.maxY=d,l.minX=g,l.minY=p,l.roots=f,l.nodes=m,l.visibleNodeIds=i.visibleNodeIds,l.bordersByRootIdAndLevel=u,l.rootList=t.rootList),o(i)}),s)}))},OrgChart.manager.prototype._read=function(t,e){var r=this,i=OrgChart.manager._createNodes(this.instance);e(i);var n=i.nodes,a=i.roots,o=OrgChart.remote;null==o&&(o=OrgChart.local),o._setPositions(a,r.layoutConfigs,(function(e){var o=OrgChart.manager._doNotChangePositionOfClickedNodeIfAny(a,n,r.action,r.actionParams,r.oldNodes,r.config.orientation);r.state&&r.action==OrgChart.action.init&&(o=r.state.adjustify),r.action==OrgChart.action.exporting?o=r._fixAdjustForExport:r._fixAdjustForExport=o;for(var s={minX:null,minY:null,maxX:null,maxY:null},l={},h=[],c=0;c<a.length;c++)OrgChart.manager._setMinMaxXYAdjustifyIterate(a[c],a[c],s,0,l,o,r.config.orientation,h);for(var d in h)for(var g in h[d]){var p=l[d][g],u=h[d][g];null==p.minX&&null==p.minY&&null==p.maxX&&null==p.maxY&&OrgChart._setMinMaxXY(u,p)}t({minX:s.minX,minY:s.minY,maxX:s.maxX,maxY:s.maxY,bordersByRootIdAndLevel:l,nodes:n,roots:a,rootList:i.rootList,limit:e,adjustify:o})}),n)},void 0===OrgChart&&(OrgChart={}),OrgChart.manager._initDinamicNode=function(t,e,r){e&&(t.lcn=e),r&&(t.isAssistant=!0);var i=OrgChart.t(t.templateName);t.w=i&&i.size?i.size[0]:0,t.h=i&&i.size?i.size[1]:0,t.isSplit="split"==t.templateName,t.isMirror="mirror"==t.templateName,t.isSubLevel="subLevel"==t.templateName},OrgChart.manager._setCollpasedProperty=function(t,e,r,i,n,a,o,s){if(null==t.collapsed&&e.collapse&&e.collapse.allChildren?t.collapsed=!0:null==t.collapsed&&(t.collapsed=!1),n==OrgChart.action.expand&&-1!=r.ids.indexOf(t.id)&&(t.collapsed=!1),n==OrgChart.action.collapse&&(r.expandIds||r.collapseIds)?r.expandIds&&-1!=r.expandIds.indexOf(t.id)?t.collapsed=!1:r.collapseIds&&-1!=r.collapseIds.indexOf(t.id)&&(t.collapsed=!0):n==OrgChart.action.collapse&&-1!=r.ids.indexOf(t.id)&&(t.collapsed=!0),n==OrgChart.action.expand&&"all"==r.ids&&(t.collapsed=!1),n!=OrgChart.action.exporting||null==r.parentLevels&&null==r.childLevels||null==r.id)n==OrgChart.action.exporting&&r.expandChildren&&(t.collapsed=!1);else if(null!=r.id&&(r.parentLevels||r.childLevels)){var l=s[r.id];if(l==t)t.collapsed=!1;else{for(var h=!1,c=-1,d=!1,g=-1;l;){if(c++,l==t){h=!0;break}l=s[l.pid]}l=s[r.id];for(var p=s[t.id];p;){if(g++,p==l){d=!0;break}p=s[p.pid]}null!=r.parentLevels&&h&&c<=r.parentLevels||null!=r.childLevels&&d&&g<=r.childLevels||d&&r.expandChildren?t.collapsed=!1:t.collapsed=!0}}n==OrgChart.action.init&&null!=o?t.collapsed=!o.exp.has(t.id):n==OrgChart.action.init?-1!=t.tags.indexOf("left-partner")||-1!=t.tags.indexOf("right-partner")||-1!=t.tags.indexOf("partner")||t.parentPartner?t.collapsed=e.collapse&&a>=e.collapse.level&&-1==i.indexOf(t.id):t.collapsed=e.collapse&&a>=e.collapse.level-1&&-1==i.indexOf(t.id):n==OrgChart.action.centerNode||n==OrgChart.action.insert||n==OrgChart.action.expand||n==OrgChart.action.collapse?i.has(t.id)&&(t.collapsed=!1):n==OrgChart.action.update&&r&&r.changeRoots&&r.changeRoots.has(t.id)&&(t.collapsed=!1)},OrgChart.manager._initNode=function(t,e,r,i,n,a,o){var s=o.manager.config,l=o.manager.layoutConfigs,h=o.manager.action,c=o.manager.actionParams,d=o.manager.state,g=l[r||"base"];null==t.parent&&OrgChart.manager._setCollpasedProperty(t,g,c,n,h,i-1,d,e);for(var p=0;p<t.childrenIds.length;p++){var u=e[t.childrenIds[p]];if(OrgChart.manager._setCollpasedProperty(u,g,c,n,h,i,d,e),!u.collapsed){if(u.parent=t,null!=u.ppid){var f=e[u.ppid];f&&(u.parentPartner=f)}(-1!=u.tags.indexOf("left-partner")||-1!=u.tags.indexOf("right-partner")||-1!=u.tags.indexOf("partner")||u.parentPartner)&&-1==a.indexOf(t.id)&&a.push(t.id),t.children.push(u)}}if(h!=OrgChart.action.minimize||t.min?h==OrgChart.action.maximize&&!0===t.min?(c.all||c.id==t.id)&&(t.min=!1):h==OrgChart.action.exporting&&!1===c.min?t.min=!1:h==OrgChart.action.init&&null!=d&&(t.min=d.min.has(t.id)):(c.all||c.id==t.id)&&(t.min=!0),!t.min)for(p=0;p<t.stChildrenIds.length;p++){u=e[t.stChildrenIds[p]];t.tags&&t.tags.has("filter")||(u.stParent=t,t.stChildren.push(u))}null!=i&&(t.level=i),r&&(t.lcn=r);var m=OrgChart._getSubLevels(t.tags,s.tags);m>0&&(t.subLevels=m),-1!=t.tags.indexOf("assistant")&&null!=t.parent&&(t.isAssistant=!0);var C=OrgChart.t(t.templateName,t.min);t.w=C&&C.size?C.size[0]:0,t.h=C&&C.size?C.size[1]:0,t.padding=C&&C.padding?C.padding:[0,0,0,0];var b={node:t};OrgChart.events.publish("node-initialized",[o,b])},OrgChart.manager._iterate=function(t,e,r,i,n,a,o,s,l,h,c,d){var g=d.manager.layoutConfigs;if(OrgChart.manager._initNode(e,r,l,i,h,c,d),e.isAssistant&&(a[e.pid]||(a[e.pid]=[]),a[e.pid].push(e.id)),e.subLevels>0&&o.push(e.id),OrgChart.MIXED_LAYOUT_FOR_NODES_WITH_COLLAPSED_CHILDREN&&!e.isAssistant&&e.parent){if(e.parent&&e.parent.children.length&&e.parent.children[e.parent.children.length-1]==e){for(var p=[],u=0,f=0,m=0;m<e.parent.children.length;m++){-1==(C=e.parent.children[m]).tags.indexOf("partner")&&-1==C.tags.indexOf("left-partner")&&-1==C.tags.indexOf("right-partner")&&-1==C.tags.indexOf("assistant")&&0==C.children.length?p.push(C.id):-1!=C.tags.indexOf("assistant")?u++:-1==C.tags.indexOf("partner")&&-1==C.tags.indexOf("left-partner")&&-1==C.tags.indexOf("right-partner")||f++}(OrgChart.MIXED_LAYOUT_ALL_NODES&&p.length>1&&p.length==e.parent.children.length-u-f||!OrgChart.MIXED_LAYOUT_ALL_NODES&&p.length>1)&&(s[e.pid]=p)}}else if(!e.isAssistant&&0==e.childrenIds.length&&e.parent&&!s[e.pid]){for(p=[],u=0,f=0,m=0;m<e.parent.children.length;m++){var C;-1==(C=e.parent.children[m]).tags.indexOf("partner")&&-1==C.tags.indexOf("left-partner")&&-1==C.tags.indexOf("right-partner")&&-1==C.tags.indexOf("assistant")&&0==C.childrenIds.length?p.push(C.id):-1!=C.tags.indexOf("assistant")?u++:-1==C.tags.indexOf("partner")&&-1==C.tags.indexOf("left-partner")&&-1==C.tags.indexOf("right-partner")||f++}(OrgChart.MIXED_LAYOUT_ALL_NODES&&p.length>OrgChart.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN&&p.length==e.parent.childrenIds.length-u-f||!OrgChart.MIXED_LAYOUT_ALL_NODES&&p.length>OrgChart.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN)&&(s[e.pid]=p)}e.stChildren.length&&(t.stContainerNodes||(t.stContainerNodes=[]),t.stContainerNodes.push(e));for(var b=0;b<e.stChildren.length;b++){var v="";for(m=0;m<e.tags.length;m++)if(g[e.tags[m]]){v=e.tags[m];break}n.push(e.stChildren[b].id),OrgChart.manager._iterate(t,e.stChildren[b],r,0,n,a,o,s,v,h,c,d)}i++;for(b=0;b<e.children.length;b++)OrgChart.manager._iterate(t,e.children[b],r,i,n,a,o,s,l,h,c,d)},OrgChart.manager.__createNodes=function(t,e,r,i,n,a,o,s){for(var l=[],h=OrgChart._addDottedLines(r),c=0;c<h.length;c++){var d,g=h[c];d=OrgChart.STRING_TAGS?g.tags?g.tags.split(","):[]:Array.isArray(g.tags)?g.tags.slice(0):[],s.filterUI.addFilterTag(g)&&d.unshift("filter");var p=s.searchUI.addMatchTag(g.id);!0===p?d.unshift("match"):!1===p&&d.unshift("no-match");var u=OrgChart._getTemplate(d,r.tags,r.template),f=new OrgChart.node(g.id,g.pid,d,u);OrgChart.isNEU(g.ppid)||(f.ppid=g.ppid),OrgChart.isNEU(g.stpid)||(f.stpid=g.stpid),null!=g.movex&&(f.movex=g.movex),null!=g.movey&&(f.movey=g.movey),t[g.id]=f,l.push(g.id)}if(null!=r.orderBy){var m=OrgChart.manager._getOrderSortArray(r.orderBy);l.sort((function(t,e){var r,i;for(var n of h)if(n.id==t&&(r=n),n.id==e&&(i=n),r&&i)break;for(var a=0;a<m.length;a++){var o=r[m[a].field],s=i[m[a].field],l=o,c=s;if(null==l&&(l=""),null==c&&(c=""),"string"==typeof l&&"string"==typeof c){var d=l.localeCompare(c);if(m[a].desc&&(d*=-1),0!==d)return d}else{d=o<s?-1:o>s?1:0;if(m[a].desc&&(d*=-1),0!==d)return d}}}))}for(c=0;c<l.length;c++){var C=l[c],b=(f=t[C],a?a[C]:null),v=t[f.stpid],O=t[f.pid];if(v||(f.stpid=null),O||(f.pid=null),v){var x=a?a[v.id]:null;x&&(v.min=x.min),v.stChildrenIds.push(f.id)}else O?(b&&(f.collapsed=b.collapsed,f.min=b.min),O.childrenIds.push(f.id)):(b&&(f.collapsed=b.collapsed,f.min=b.min),e.push(f),o.push(f.id));i==OrgChart.action.init&&(f.min=OrgChart._getMin(f,r))}},OrgChart.manager._createNodes=function(t){var e=t.manager.config,r=t.manager.layoutConfigs,i=t.manager.action,n=t.manager.actionParams,a=t.manager.oldNodes,o=t.manager.state,s={},l=[],h=[];if(OrgChart.manager.__createNodes(s,l,e,i,n,a,h,t),null!=e.roots){l=[];for(var c=0;c<e.roots.length;c++){var d=s[e.roots[c]];if(d&&i==OrgChart.action.centerNode){for(var g=d;null!=g.pid||null!=g.stpid;)g=null==g.pid&&null!=g.stpid?s[g.stpid]:s[g.pid];for(var p=s[n.id];(null!=p.pid||null!=p.stpid)&&p!=d;)p=null==p.pid&&null!=p.stpid?s[p.stpid]:s[p.pid];g==p&&(d=g)}if(d){for(var u=!1,f=0;f<l.length;f++)if(l[f].id==d.id){u=!0;break}if(!u){if(!OrgChart.isNEU(d.pid))(mt=(m=s[d.pid]).childrenIds.indexOf(d.id))>-1&&m.childrenIds.splice(mt,1);l.push(d)}}}e.roots=[];for(c=0;c<l.length;c++)e.roots.push(l[c].id)}if(i==OrgChart.action.exporting&&null!=n.id)if(n.parentLevels){for(var m=s[n.id],C=0;C<n.parentLevels&&s[m.pid];)C++,m=s[m.pid];m.pid=null,l=[m]}else{(v=s[n.id])&&(v.pid=null,l=[v])}var b=[];if(i==OrgChart.action.init&&e.expand&&e.expand.nodes&&null==o)for(c=0;c<e.expand.nodes.length;c++){var v=s[e.expand.nodes[c]];for(!0===e.expand.allChildren&&OrgChart.manager._addExpandedNodeIdsIterate(v,s,b);v;)b.push(v.id),null==v.pid&&null!=v.stpid?(v=s[v.stpid]).min=!1:v=s[v.pid]}else if(i==OrgChart.action.expand&&n.ids&&"all"!=n.ids||i==OrgChart.action.collapse&&n&&n.expandIds){nt=i==OrgChart.action.expand?n.ids:n.expandIds;for(c=0;c<nt.length;c++)for(m=s[(v=s[nt[c]]).pid];m;)b.push(m.id),null==m.pid&&null!=m.stpid?(m=s[m.stpid]).min=!1:m=s[m.pid]}else if(i==OrgChart.action.centerNode){for(var O=s[n.id];O;){if(b.push(O.id),n.options.parentState===OrgChart.COLLAPSE_PARENT_NEIGHBORS&&O)for(c=0;c<O.childrenIds.length;c++){(D=s[O.childrenIds[c]]).collapsed=!0}null==O.pid&&null!=O.stpid?(O=s[O.stpid]).min=!1:O=s[O.pid]}O=s[n.id];if(n.options.childrenState===OrgChart.COLLAPSE_SUB_CHILDRENS)for(c=0;c<O.childrenIds.length;c++){(y=s[O.childrenIds[c]]).collapsed=!1;for(var x=0;x<y.childrenIds.length;x++){s[y.childrenIds[x]].collapsed=!0}}if(n.options.parentState===OrgChart.COLLAPSE_PARENT_SUB_CHILDREN_EXCEPT_CLICKED)if(m=s[O.pid])for(c=0;c<m.childrenIds.length;c++){var y;if((y=s[m.childrenIds[c]])!=O){y.collapsed=!1;for(x=0;x<y.childrenIds.length;x++){s[y.childrenIds[x]].collapsed=!0}}}}else if(i==OrgChart.action.insert)for(v=s[n.insertedNodeId];v;)b.push(v.id),null==v.pid&&null!=v.stpid?(v=s[v.stpid]).min=!1:v=s[v.pid];var _=[],k={},w=[],S={},I=[];for(c=0;c<l.length;c++)OrgChart.manager._iterate(l[c],l[c],s,0,_,k,w,S,"",b,I,t);if(i==OrgChart.action.collapse&&n&&Array.isArray(n.expandIds)&&Array.isArray(n.collapseIds))for(c=0;c<n.ids.length;c++){if(n.expandIds.has(n.collapseIds[c]))console.error(`id ${n.collapseIds[c]} exist in both collapseIds and expandIds`);else(v=s[n.collapseIds[c]])&&(v.collapsed=!0)}for(c=l.length-1;c>=0;c--)l[c].collapsed&&l.splice(c,1);for(c=0;c<I.length;c++){v=s[I[c]];var A=[],L=[],E=[],N={},M=0,T=0,R=0,B=[],U=[];for(x=0;x<v.children.length;x++){(D=v.children[x]).isAssistant?A.push(D.id):-1!=D.tags.indexOf("right-partner")?(D.isPartner=1,D.children=[],L.push(D.id)):-1!=D.tags.indexOf("left-partner")?(D.isPartner=2,D.children=[],E.push(D.id)):-1==D.tags.indexOf("partner")||M%2?-1!=D.tags.indexOf("partner")&&M%2?(D.isPartner=2,D.children=[],E.push(D.id),M++):D.parentPartner?(N[D.parentPartner.id]||(N[D.parentPartner.id]=[]),N[D.parentPartner.id].push(D.id)):A.push(D.id):(D.isPartner=1,D.children=[],L.push(D.id),M++)}v.children=[];var P=[];for(x=0;x<L.length;x++){N[(D=s[L[x]]).id]?v.children.push(D):v.children.splice(0,0,D);for(var F=0;F<D.childrenIds.length;F++)P.push(D.childrenIds[F])}var z=[];for(x=0;x<E.length;x++){N[(D=s[E[x]]).id]?v.children.push(D):v.children.splice(0,0,D);for(F=0;F<D.childrenIds.length;F++)z.push(D.childrenIds[F])}for(x=0;x<z.length;x++){(D=s[z[x]]).collapsed||(D.parentPartner=D.parent,D.parent=v,D.isChildOfPartner=!0,v.children.push(D))}for(x=E.length-1;x>=0;x--)if(N[E[x]])for(f=0;f<N[E[x]].length;f++)v.children.push(s[N[E[x]][f]]),T++,-1==U.indexOf(E[x])&&U.push(E[x]);for(x=0;x<A.length;x++){var D=s[A[x]];v.children.push(D)}for(x=0;x<L.length;x++)if(N[L[x]])for(f=0;f<N[L[x]].length;f++)v.children.push(s[N[L[x]][f]]),R++,-1==B.indexOf(L[x])&&B.push(L[x]);for(x=0;x<P.length;x++){(D=s[P[x]]).collapsed||(D.parentPartner=D.parent,D.parent=v,D.isChildOfPartner=!0,v.children.push(D))}v.partnerSeparation=Math.max(U.length,B.length)*e.partnerChildrenSplitSeparation+e.minPartnerSeparation,A.length||!T||R?A.length||T||!R?A.length||1!=T||1!=R?A.length||T||R?!A.length||T||R?A.length&&(T||R)?v.hasPartners=7:v.hasPartners=1:v.hasPartners=6:v.hasPartners=5:v.hasPartners=4:v.hasPartners=3:v.hasPartners=2}for(c=0;c<w.length;c++){var H=r[(v=s[w[c]]).lcn?v.lcn:"base"];for(x=0;x<v.subLevels;x++){var $=new OrgChart.node(v.id+"_sub_level_index_"+x,v.pid,[],"subLevel");if(OrgChart.manager._initDinamicNode($,v.lcn),m=v.parent)(mt=m.children.indexOf(v))>-1&&(m.children.splice(mt,1),m.children.splice(mt,0,$)),$.children.push(v),$.parent=m,v.parent=$,s[$.id]=$}}for(var j in k){(m=s[j]).hasAssistants=!0;$=new OrgChart.node(m.id+"_split_assitant_0",m.id,["assistant"],"split");OrgChart.manager._initDinamicNode($,m.lcn,!0),s[$.id]=$;var q=[];for(x=m.children.length-1;x>=0;x--){(D=m.children[x]).isAssistant?(D.parent=null,m.children.splice(x,1),q.splice(0,0,D.id)):D.isPartner||(D.parent&&S[D.parent.id]&&$&&D.parent.id!=$.id&&(Object.defineProperty(S,$.id,Object.getOwnPropertyDescriptor(S,D.parent.id)),delete S[D.parent.id]),D.parent=$,$.children.unshift(D),m.children.splice(x,1))}if(q.length%2){var Y=s[q[q.length-1]],X=new OrgChart.node(Y.id+"_mirror",m.pid,[],"mirror");OrgChart.manager._initDinamicNode(X,Y.lcn,!0),X.isAssistant=!0,X.w=Y.w,X.h=Y.h,s[X.id]=X,q.splice(q.length-1,0,X.id)}var V=1;for(x=q.length-1;x>=0;x--)if(x%2&&x!=q.length-1){var G=new OrgChart.node(m.id+"_split_assitant_"+V,m.pid,[],"split");OrgChart.manager._initDinamicNode(G,m.lcn,!0),s[G.id]=G,q.splice(x,0,G.id),V++}else x%2&&q.splice(x,0,$.id);for(x=0;x<q.length;x+=3){var W=null;W=0==x?m:s[q[x-2]];var J=s[q[x]],K=s[q[x+1]],Z=s[q[x+2]];J.parent=W,K.parent=W,Z.parent=W,W.children.push(J),W.children.push(K),W.children.push(Z)}}var Q=!1;for(var tt in r){if(0!=(H=r[tt]).layout){Q=!0;break}}var et=OrgChart.events.has("node-layout",t._event_id);if(Q||et){var rt={nodes:s,config:e,action:i,actionParams:n};if(w.length){var it=!1;for(var j in S){var nt=S[j];for(c=0;c<nt.length;c++){if((v=s[nt[c]]).subLevels){it=!0;break}}if(it)break}if(it){var at={},ot={},st={};for(var j in S){nt=S[j];var lt=!1,ht=null;for(c=0;c<nt.length;c++){var ct=nt[c];(null===ht||w.has(ct))&&(ht=s[ct].parent.id,lt||OrgChart.isNEU(s[ct].subLevels)||(lt=s[ct].subLevels>0)),at[ht]||(at[ht]=[]),at[ht].push(ct),lt&&(st[ht]=j,ot[ht]||(ot[ht]=[]),ot[ht].push(ct))}}for(var j in S={},ot)if(ot[j].length>OrgChart.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN){var dt=st[j];for(c=s[dt].children.length-1;c>=0;c--){D=s[dt].children[c];ot[j].has(D.id)&&s[dt].children.splice(c,1)}}for(var j in at)at[j].length>OrgChart.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN&&(S[j]=at[j])}}for(var j in S){for(var gt=m=s[j];gt.isSplit;)gt=s[gt.pid];for(;gt.isSubLevel;)gt=s[gt.pid];if(0!=(H=r[m.lcn?m.lcn:"base"]).layout||et){rt.pnode=m,rt.layout=H.layout,rt.layoutGridColumns=e.layoutGridColumns,rt.childrenIds=S[j],rt.lastChildrenPidIds=S,rt.subLevels=0,rt.layouts=[],OrgChart.events.publish("node-layout",[t,rt]),OrgChart.events.publish("layout",[rt]),rt.layouts.length||rt.layouts.push({layout:rt.layout,childrenIds:rt.childrenIds,subLevels:rt.subLevels,layoutGridColumns:rt.layoutGridColumns});for(var pt=0;pt<rt.layouts.length;pt++){var ut=rt.layouts[pt];for(OrgChart.isNEU(ut.subLevels)&&(ut.subLevels=0),OrgChart.isNEU(ut.layout)&&(ut.layout=H.layout),gt=m=s[j];gt.isSplit;)gt=s[gt.pid];for(;gt.isSubLevel;)gt=s[gt.pid];var ft=m;for(x=0;x<ut.subLevels;x++){$=new OrgChart.node(pt+"_sublevel_layout_"+x,ft.id,[],"subLevel");OrgChart.manager._initDinamicNode($,ft.lcn),$.parent=ft,ft.children.push($),s[$.id]=$,ft=$}if(ut.subLevels){for(x=0;x<ut.childrenIds.length;x++){var mt;D=s[ut.childrenIds[x]];-1!=(mt=m.children.indexOf(D))&&m.children.splice(mt,1),D.parent=ft,ft.children.push(D)}m=ft}if(ut.layout==OrgChart.layout.grid&&ut.childrenIds.length>2){"dynamic"==ut.layoutGridColumns&&(ut.layoutGridColumns=OrgChart._getDynamicGridCoulumns(ut.childrenIds.length));var Ct=m.id;for(c=m.children.length-1;c>=0;c--)for(x=0;x<ut.childrenIds.length;x++){ct=ut.childrenIds[x];if(m.children[c].id==ct){m.children.splice(c,1);break}}var bt=ut.layoutGridColumns;bt%2!=0&&bt>2&&bt--;for(c=0;c<ut.childrenIds.length;c+=bt){var vt=null;for(x=0;x<bt;x++){var Ot=c+bt>=ut.childrenIds.length;if(ut.childrenIds.length-1<c+x)break;(D=s[ct=ut.childrenIds[c+x]]).parent=s[Ct],s[Ct].children.push(D),Ot||(bt/2-1==x&&(vt=new OrgChart.node(ut.childrenIds[c+x-1]+"_grid_pseudo_node_"+ut.childrenIds[c+x+1],Ct,[],"subLevel"),OrgChart.manager._initDinamicNode(vt,m.lcn),vt.parent=s[Ct],s[Ct].children.push(vt),s[vt.id]=vt),bt-1==x&&(Ct=vt.id))}}}if(ut.layout==OrgChart.layout.mixed){var xt=ut.childrenIds;for(c=xt.length-1;c>=0;c--){m=(D=s[xt[c]]).parent,D.layout=OrgChart.layout.mixed;for(x=m.children.length-1;x>=0;x--)if(D.id==m.children[x].id){m.children.splice(x,1);break}if(c>0){var yt=s[xt[c-1]];D.parent=yt,D.layout=OrgChart.layout.mixed,yt.children.push(D)}else m.children.push(D)}}else if(ut.layout>1){$=new OrgChart.node(pt+"_"+m.id+"_split_0",gt.id,[],"split");OrgChart.manager._initDinamicNode($,m.lcn),s[$.id]=$,$.layout=ut.layout;var _t=[];for(c=ut.childrenIds.length-1;c>=0;c--){for(D=s[ut.childrenIds[c]],x=0;x<m.children.length;x++)m.children[x].id==D.id&&m.children.splice(x,1);if(D.parent=null,D.layout=ut.layout,ut.layout!=OrgChart.layout.treeRightOffset&&ut.layout!=OrgChart.layout.treeRight||_t.splice(0,0,D.id),ut.layout>2){var kt=new OrgChart.node(pt+"_"+D.id+"_mirror",gt.id,[],"mirror");OrgChart.manager._initDinamicNode(kt,D.lcn),kt.layout=ut.layout,s[kt.id]=kt,_t.splice(0,0,kt.id)}ut.layout!=OrgChart.layout.treeRightOffset&&ut.layout!=OrgChart.layout.treeRight&&_t.splice(0,0,D.id)}for(V=1,x=_t.length-1;x>=0;x--)if(x%2&&x!=_t.length-1){G=new OrgChart.node(pt+"_"+m.id+"_split_"+V,gt.id,[],"split");OrgChart.manager._initDinamicNode(G,m.lcn),G.layout=ut.layout,s[G.id]=G,_t.splice(x,0,G.id),V++}else x%2&&_t.splice(x,0,$.id);for(x=0;x<_t.length;x+=3){W=null;0==x&&(W=m);J=s[_t[x]],K=s[_t[x+1]],Z=s[_t[x+2]];0!=x&&(W=s[_t[x-3]]),0==x||K||(W=s[_t[x-2]]),J.parent=W,W.children.push(J),K&&(0!=x&&(W=s[_t[x-2]]),K.parent=W,W.children.push(K)),Z&&(0!=x&&(W=s[_t[x-1]]),Z.parent=W,W.children.push(Z))}}}}}}if(OrgChart.VERTICAL_CHILDREN_ASSISTANT)for(c=0;c<l.length;c++)OrgChart.manager._verticalAssistantIterate(l[c],s);rt={nodes:s,roots:l};return OrgChart.events.publish("nodes-initialized",[t,rt]),{nodes:rt.nodes,roots:rt.roots,rootList:h}},OrgChart.manager._getOrderSortArray=function(t){if("string"==typeof t)return[{field:t,desc:!1}];if(Array.isArray(t)){var e=[];for(var r of t)"string"==typeof r?e.push({field:r,desc:!1}):t instanceof Object?e.push(r):console.error("Unseported orderBy value!");return e}if(t instanceof Object)return[t];console.error("Unseported orderBy value!")},OrgChart.manager._getNodeWidth=function(t,e){switch(e.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:return t.w;case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:return t.h}return 0},OrgChart.manager._isVisible=function(t,e,r,i,n,a,o){var s=0;if("auto"==OrgChart.LAZY_LOADING_FACTOR){var l=a/n*2,h=o/n*2;s=l>h?Math.ceil(l):Math.ceil(h)}else s=OrgChart.LAZY_LOADING_FACTOR/n;if(null!=t.x&&null!=t.y){if(OrgChart._getLazyLoading(e)&&i!==OrgChart.action.exporting){function c(t,e){var r=t.x,i=t.y,n=t.w,a=t.h,o=e[0]-s,l=e[2]+s+e[0],h=e[1]-s,c=e[3]+s+e[1],d=r+n>o&&l>r;return d&&(d=i+a>h&&c>i),d}if(c(t,r))return!0;for(var d=0;d<t.children.length;d++)if(c(t.children[d],r))return!0;return!1}return!0}},OrgChart.manager.getAllFields=function(t){var e=[OrgChart.TAGS];for(var r in t.nodeBinding)e.push(t.nodeBinding[r]);for(r=0;r<t.nodes.length;r++)for(var i in t.nodes[r])i!==OrgChart.ID&&i!==OrgChart.TAGS&&i!==OrgChart.NODES&&i!==OrgChart.PID&&i!==OrgChart.STPID&&"movex"!==i&&"movey"!==i&&(t.nodeBinding[i]||e.has(i)||e.push(i));return e},OrgChart.manager._getMostDeepChild=function(t){if(t){var e=t;return function t(r){r.sl>e.sl&&(e=r);for(var i=0;i<r.children.length;i++)t(r.children[i])}(t),e}},OrgChart.manager._getResponse=function(t,e,r,i,n,a,o,s,l,h,c,d,g,p,u){var f=h[0],m=[],C={top:null,left:null,bottom:null,right:null,minX:null,maxX:null,minY:null,maxY:null},b=[[],[],[]],v=n-o+2*i.padding,O=a-s+2*i.padding,x=OrgChart.getScale(l,t,e,i.scaleInitial,i.scaleMax,i.scaleMin,v,O);if(C.top=s-i.padding,C.left=o-i.padding,C.bottom=a+i.padding-e/x,C.right=n+i.padding-t/x,C.maxX=n,C.minX=o,C.maxY=a,C.minY=s,0==h.length||null==l&&!u&&i.align==OrgChart.CENTER){var y=Math.ceil(t/x),_=Math.ceil(e/x),k=0,w=0;if(y-2*i.padding>=n-o)switch(k=(n+o)/2-y/2,i.orientation){case OrgChart.orientation.right:case OrgChart.orientation.right_top:k=(o-n)/2-y/2}else switch(k=f.x-y/2+OrgChart.manager._getNodeWidth(f,i)/2,i.orientation){case OrgChart.orientation.right:case OrgChart.orientation.right_top:(k=-(y/2-(o-n)/2))<i.padding-y&&(k=i.padding-y);break;case OrgChart.orientation.left:case OrgChart.orientation.bottom_left:case OrgChart.orientation.top_left:case OrgChart.orientation.left_top:(k=-(y/2-(n-o)/2))>-i.padding&&(k=-i.padding)}if(_-2*i.padding>=a-s)switch(w=(a+s)/2-_/2,i.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:w=(s-a)/2-_/2}else switch((w=-(_/2-(a-s)/2))>-i.padding&&(w=-i.padding),i.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:(w=-(_/2-(s-a)/2))<i.padding-_&&(w=i.padding-_);break;case OrgChart.orientation.left:case OrgChart.orientation.right:w=f.y-_/2+OrgChart.manager._getNodeWidth(f,i)/2}l=[k,w,y,_]}else if(null==l&&!u&&i.align==OrgChart.ORIENTATION){y=Math.ceil(t/x),_=Math.ceil(e/x),k=0,w=0;switch(i.orientation){case OrgChart.orientation.top:k=f.x-y/2+OrgChart.manager._getNodeWidth(f,i)/2,w=-i.padding;break;case OrgChart.orientation.bottom:k=f.x-y/2+OrgChart.manager._getNodeWidth(f,i)/2,w=i.padding-_;break;case OrgChart.orientation.left:k=-i.padding,w=f.y-_/2+OrgChart.manager._getNodeWidth(f,i)/2;break;case OrgChart.orientation.right:k=i.padding-y,w=f.y-_/2+OrgChart.manager._getNodeWidth(f,i)/2;break;case OrgChart.orientation.top_left:k=-i.padding,w=-i.padding;break;case OrgChart.orientation.right_top:k=i.padding-y,w=-i.padding;break;case OrgChart.orientation.left_top:k=-i.padding,w=-i.padding;break;case OrgChart.orientation.bottom_left:k=-i.padding,w=i.padding-_}l=[k,w,y,_],i.sticky&&(l[0]<C.left&&l[0]<C.right&&(l[0]=C.left>C.right?C.right:C.left),l[0]>C.right&&l[0]>C.left&&(l[0]=C.left>C.right?C.left:C.right),l[1]<C.top&&l[1]<C.bottom&&(l[1]=C.top>C.bottom?C.bottom:C.top),l[1]>C.bottom&&l[1]>C.top&&(l[1]=C.top>C.bottom?C.top:C.bottom))}if(c==OrgChart.action.centerNode||c==OrgChart.action.maximize){var S=g[d.id];1==d.options.horizontal&&(l[0]=S.x+S.w/2-l[2]/2),1==d.options.vertical&&(l[1]=S.y+S.h/2-l[3]/2),i.sticky&&(l[0]<C.left&&l[0]<C.right&&(l[0]=C.left>C.right?C.right:C.left),l[0]>C.right&&l[0]>C.left&&(l[0]=C.left>C.right?C.left:C.right),l[1]<C.top&&l[1]<C.bottom&&(l[1]=C.top>C.bottom?C.bottom:C.top),l[1]>C.bottom&&l[1]>C.top&&(l[1]=C.top>C.bottom?C.top:C.bottom))}if(i.sticky&&(c==OrgChart.action.insert||c==OrgChart.action.expand||c==OrgChart.action.collapse||c==OrgChart.action.update||c==OrgChart.action.centerNode)){var I=null;if(c==OrgChart.action.insert&&d&&null!=d.insertedNodeId&&null!=d.insertedNodeId)I=g[d.insertedNodeId];else if(c==OrgChart.action.update&&d&&null!=d.visId&&null!=d.visId)I=g[d.visId];else if(c!=OrgChart.action.expand&&c!=OrgChart.action.collapse||!d||null==d.id||null==d.id){if(c==OrgChart.action.centerNode){switch(i.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:d.options.vertical||(I=g[d.id]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:d.options.horizontal||(I=g[d.id])}I&&(I=OrgChart.manager._getMostDeepChild(I,g))}}else I=g[d.id],I=OrgChart.manager._getMostDeepChild(I,g);if(!OrgChart.FIXED_POSITION_ON_CLICK&&I)switch(i.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:var A=I.y+I.h-l[3]+i.padding;l[1]<A&&(l[1]=A);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:A=I.y-i.padding;l[1]>A&&(l[1]=A);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:A=I.x-i.padding;l[0]>A&&(l[0]=A);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:A=I.x+I.w-l[2]+i.padding;l[0]<A&&(l[0]=A)}}for(var L=0;L<h.length;L++)OrgChart.manager._iterate2(h[L],g,i,l,c,d,m,p,r,b,x,t,e);return{animations:b,boundary:C,viewBox:l,visibleNodeIds:m,nodes:g,allFields:OrgChart.manager.getAllFields(i)}},OrgChart.manager._iterate2=function(t,e,r,i,n,a,o,s,l,h,c,d,g){if(OrgChart.manager._isVisible(t,r,i,n,c,d,g)){o.push(t.id);var p=null;if((n==OrgChart.action.expand||n==OrgChart.action.collapse||n==OrgChart.action.maximize)&&s&&s[t.id]&&"expandCollapseToLevel"==a.method){if(p={x:(C=s[t.id]).x,y:C.y},C){p={x:C.x,y:C.y};for(var u=t,f=null;null!=u;)s[u.id]&&s[u.id].collapsed&&(f=u),u=u.parent;f&&f.parent&&(p={x:f.parent.x,y:f.parent.y})}if(b=e[a.id]){for(u=t.parent;null!=u;)u=u.parent;u&&(p={x:b.x+b.w/2-t.w/2,y:b.y+b.h/2-t.h/2})}}else if((n==OrgChart.action.expand||n==OrgChart.action.collapse)&&s&&s[t.id]){if(p={x:(C=s[t.id]).x,y:C.y},"all"==a.ids&&C){p={x:C.x,y:C.y};for(u=t,f=null;null!=u;)s[u.id]&&s[u.id].collapsed&&(f=u),u=u.parent;f&&f.parent&&(p={x:f.parent.x,y:f.parent.y})}if(b=e[a.id]){for(u=t.parent;null!=u&&-1==a.ids.indexOf(t.id)&&-1==a.ids.indexOf(u.id);)u=u.parent;u&&(p={x:b.x+b.w/2-t.w/2,y:b.y+b.h/2-t.h/2})}}else if(n==OrgChart.action.centerNode&&s&&s[t.id]){if(null!=(C=s[t.id]).x&&null!=C.y&&(p={x:C.x,y:C.y}),(m=e[a.id])&&m==t)(u=t.parent)&&u.id==a.id&&(p={x:m.x+m.w/2-t.w/2,y:m.y+m.h/2-t.h/2})}else if(n==OrgChart.action.maximize&&s&&s[t.id]){var m;if(null!=(C=s[t.id]).x&&null!=C.y&&(p={x:C.x,y:C.y}),(m=e[a.id])&&m==t)(u=t.parent)&&u.id==a.id&&(p={x:m.x+m.w/2-t.w/2,y:m.y+m.h/2-t.h/2})}else if(n==OrgChart.action.minimize&&s&&s[t.id]){p={x:(C=s[t.id]).x,y:C.y}}else if(n==OrgChart.action.insert&&a&&a.insertedNodeId==t.id&&t.parent)p={x:t.parent.x,y:t.parent.y};else if(n!=OrgChart.action.update&&n!=OrgChart.action.insert||!s)n!==OrgChart.action.exporting&&n!==OrgChart.action.init&&-1==l.indexOf(t.id)&&(h[0].push(t.id),h[1].push({opacity:0}),h[2].push({opacity:1}));else{var C,b;if((!(C=s[t.id])||OrgChart.isNEU(C.x)&&OrgChart.isNEU(C.y))&&a){if(b=e[a.id]){for(u=b;u&&u.id==t.id;)u=u.parent;u&&(p={x:b.x,y:b.y})}}else C&&(p={x:C.x,y:C.y})}if(null!=p&&null!=p.x&&null!=p.y)if(p.x!=t.x||p.y!=t.y)a&&a.dragNodeIdList&&-1!=a.dragNodeIdList.indexOf(t.id)||(h[0].push(t.id),h[1].push({transform:[1,0,0,1,p.x,p.y]}),h[2].push({transform:[1,0,0,1,t.x,t.y]}))}for(var v=0;v<t.stChildren.length;v++)OrgChart.manager._iterate2(t.stChildren[v],e,r,i,n,a,o,s,l,h,c,d,g);for(v=0;v<t.children.length;v++)OrgChart.manager._iterate2(t.children[v],e,r,i,n,a,o,s,l,h,c,d,g)},OrgChart.manager._addExpandedNodeIdsIterate=function(t,e,r){for(var i=0;i<t.childrenIds.length;i++)r.push(t.childrenIds[i]),OrgChart.manager._addExpandedNodeIdsIterate(e[t.childrenIds[i]],e,r)},OrgChart.manager._setMinMaxXYAdjustifyIterate=function(t,e,r,i,n,a,o,s){t.x+=a.x,t.y+=a.y;for(var l=0;l<t.stChildren.length;l++)OrgChart.manager._setMinMaxXYAdjustifyIterate(t.stChildren[l],t.stChildren[l],r,0,n,a,o,s);t.isPartner?t.sl=i-1:t.sl=i,null==n[e.id]&&(n[e.id]={}),null==n[e.id][t.sl]&&(n[e.id][t.sl]={minX:null,minY:null,maxX:null,maxY:null}),t.layout?(null==s[e.id]&&(s[e.id]={}),null==s[e.id][t.sl]&&(s[e.id][t.sl]=t)):OrgChart._setMinMaxXY(t,n[e.id][t.sl]),null!=t.movex&&(t.x+=t.movex),null!=t.movey&&(t.y+=t.movey),OrgChart._setMinMaxXY(t,r),i++;for(l=0;l<t.children.length;l++)OrgChart.manager._setMinMaxXYAdjustifyIterate(t.children[l],e,r,i,n,a,o,s)},OrgChart.manager._doNotChangePositionOfClickedNodeIfAny=function(t,e,r,i,n,a){if(r!=OrgChart.action.expand&&r!=OrgChart.action.collapse&&r!=OrgChart.action.minimize&&r!=OrgChart.action.maximize&&r!=OrgChart.action.centerNode&&r!=OrgChart.action.update&&r!=OrgChart.action.insert)return{x:0,y:0};if(r==OrgChart.action.update&&(!i||null==i.id)){if(!t||!t.length)return{x:0,y:0};i={id:t[0].id}}if(null==i.id)return{x:0,y:0};var o=i.id;(r==OrgChart.action.minimize&&e[o].parent||r==OrgChart.action.maximize&&e[o].parent)&&(o=e[o].pid);var s=e[o],l=n[o];if(!l)return{x:0,y:0};var h=null!=l.movex?l.movex:0,c=null!=l.movey?l.movey:0;return{x:(l.x?l.x-h:0)-s.x,y:(l.y?l.y-c:0)-s.y}},OrgChart.manager._verticalAssistantIterate=function(t,e){for(var r=0;r<t.stChildren.length;r++)OrgChart.manager._verticalAssistantIterate(t.stChildren[r],e);if(3==t.children.length)OrgChart.manager._verticalAssistantIterate(t.children[0],e),OrgChart.manager._verticalAssistantIterate(t.children[2],e),OrgChart.manager._verticalAssistantIterate(t.children[1],e);else for(r=0;r<t.children.length;r++)OrgChart.manager._verticalAssistantIterate(t.children[r],e);if(t.isAssistant&&t.isSplit&&t.children.length){for(var i=t.parent.children[0],n=t.parent.children[2],a=t.parent;!a.hasAssistants;)a=a.parent;var o={max:0},s={max:0};OrgChart.manager._verticalAssistantLevelCountIterate(i,0,o),OrgChart.manager._verticalAssistantLevelCountIterate(n,0,s);var l=Math.max(o.max,s.max),h=[];for(r=0;r<l;r++){var c=new OrgChart.node(t.parent.id+"_split_assitant_level_"+r,t.pid,[],"subLevel");OrgChart.manager._initDinamicNode(c,t.lcn,!0),r>0&&(h[r-1].children.push(c),c.parent=h[r-1]),e[c.id]=c,h.push(c)}if(h.length){for(var d=h[h.length-1],g=h[0],p=t.children.length-1;p>=0;p--){var u=t.children[p];d.children.unshift(u),u.parent=d,t.children.splice(p,1)}t.children.push(g),g.parent=t}}},OrgChart.manager._verticalAssistantLevelCountIterate=function(t,e,r){r.max<e&&(r.max=e),e++;for(var i=0;i<t.children.length;i++)OrgChart.manager._verticalAssistantLevelCountIterate(t.children[i],e,r)},OrgChart._addDottedLines=function(t){var e=t.nodes;if((t.groupDottedLines.length||t.dottedLines.length)&&(e=JSON.parse(JSON.stringify(e))),t.groupDottedLines.length)for(var r=[],i=0;i<t.groupDottedLines.length;i++){var n=t.groupDottedLines[i];null==n.rootId&&(n.rootId=n.to);var a=`balkan_group_dotted_${n.rootId}`;if(!r.has(a))for(var o=0;o<e.length;o++)if(e[o].id==n.rootId){(c=JSON.parse(JSON.stringify(e[o]))).id=`balkan_group_dotted_${n.rootId}_balkan_id_${e[o].id}`,c.pid=void 0,c.stpid=e[o].id,e.push(c),r.push(a),e[o].tags||(e[o].tags=[]),e[o].tags.push("group-dotted-lines"),e[o].tags.push("group-dotted-lines-"+a);break}for(o=0;o<e.length;o++)if(e[o].id==n.from){if((c=JSON.parse(JSON.stringify(e[o]))).id=`balkan_group_dotted_${n.rootId}_balkan_id_${e[o].id}`,c.pid=`balkan_group_dotted_${n.rootId}_balkan_id_${n.to}`,c.tags){var s=c.tags.indexOf("group-dotted-lines");-1!=s&&c.tags.splice(s,1)}if(c.tags||(c.tags=[]),c.tags.push("boc-dotted-connector"),n.tags)for(var l=0;l<n.tags.length;l++)c.tags.push(n.tags[l]);e.push(c);break}}if(t.dottedLines.length)for(i=0;i<t.dottedLines.length;i++){var h=t.dottedLines[i];null==h.rootId&&(h.rootId=h.to);for(o=0;o<e.length;o++)if(e[o].id==h.from){var c;if((c=JSON.parse(JSON.stringify(e[o]))).id=`balkan_dotted_${h.rootId}_balkan_id_${e[o].id}`,h.rootId==h.to?c.pid=h.to:c.pid=`balkan_dotted_${h.rootId}_balkan_id_${h.to}`,c.tags||(c.tags=[]),c.tags.push("boc-dotted-connector"),h.tags)for(l=0;l<h.tags.length;l++)c.tags.push(h.tags[l]);e.push(c);break}}return e},void 0===OrgChart&&(OrgChart={}),OrgChart.templates={},OrgChart.templates.base={defs:"",size:[250,120],expandCollapseSize:30,linkAdjuster:{fromX:0,fromY:0,toX:0,toY:0},ripple:{radius:0,color:"#e6e6e6",rect:null},assistanseLink:'<path stroke-linejoin="round" stroke="#aeaeae" stroke-width="2px" fill="none" d="M{xa},{ya} {xb},{yb} {xc},{yc} {xd},{yd} L{xe},{ye}"/>',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:'<circle cx="15" cy="15" r="15" fill="#ffffff" stroke="#aeaeae" stroke-width="1"></circle><line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#aeaeae"></line><line x1="15" y1="4" x2="15" y2="26" stroke-width="1" stroke="#aeaeae"></line>',minus:'<circle cx="15" cy="15" r="15" fill="#ffffff" stroke="#aeaeae" stroke-width="1"></circle><line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#aeaeae"></line>',nodeMenuButton:'<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,105)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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;" '+OrgChart.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" '+OrgChart.attr.width+'="290" x="0" y="0" style="font-size:10px;">{val}</text>',editFormHeaderColor:"#039BE5"},OrgChart.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 stroke-linejoin="round" stroke="#aeaeae" stroke-width="1px" fill="none" d="{rounded}" />',assistanseLink:'<path stroke-linejoin="round" stroke="#aeaeae" stroke-width="2px" fill="none" d="M{xa},{ya} {xb},{yb} {xc},{yc} {xd},{yd} L{xe},{ye}"/>',node:'<rect x="0" y="0" height="{h}" width="{w}" fill="#039BE5" stroke-width="1" stroke="#aeaeae" rx="7" ry="7"></rect>',plus:'<circle cx="15" cy="15" r="15" class="boc-fill" stroke="#aeaeae" stroke-width="1"></circle><line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#aeaeae"></line><line x1="15" y1="4" x2="15" y2="26" stroke-width="1" stroke="#aeaeae"></line>',minus:'<circle cx="15" cy="15" r="15" class="boc-fill" stroke="#aeaeae" stroke-width="1"></circle><line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#aeaeae"></line>',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:'<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,105)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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:OrgChart.templates.base.menuButton,img_0:'<clipPath id="{randId}"><circle cx="50" cy="30" r="40"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="10" y="-10" width="80" height="80"></image>',link_field_0:'<text text-anchor="middle" fill="#aeaeae" '+OrgChart.attr.width+'="290" x="0" y="0" style="font-size:10px;">{val}</text>',field_0:"<text "+OrgChart.attr.width+'="230" style="font-size: 18px;" fill="#ffffff" x="125" y="95" text-anchor="middle">{val}</text>',field_1:"<text "+OrgChart.attr.width+'="130" '+OrgChart.attr.text_overflow+'="multiline" style="font-size: 14px;" fill="#ffffff" x="230" y="30" text-anchor="end">{val}</text>',padding:[50,20,35,20],editFormHeaderColor:"#039BE5"},OrgChart.templates.split=Object.assign({},OrgChart.templates.ana),OrgChart.templates.split.size=[10,10],OrgChart.templates.split.node='<circle cx="5" cy="5" r="5" fill="none" stroke-width="1" stroke="#aeaeae"></circle>',OrgChart.templates.split.field_0="",OrgChart.templates.split.field_1="",OrgChart.templates.split.img_0="",OrgChart.templates.dot=Object.assign({},OrgChart.templates.split),OrgChart.templates.group=Object.assign({},OrgChart.templates.ana),OrgChart.templates.group.size=[250,120],OrgChart.templates.group.node='<rect rx="50" ry="50" x="0" y="0" height="{h}" width="{w}" fill="#f2f2f2" stroke-width="0"></rect>',OrgChart.templates.group.link='<path stroke="#aeaeae" stroke-width="1px" fill="none" d="M{xa},{ya} C{xb},{yb} {xc},{yc} {xd},{yd}"/>',OrgChart.templates.group.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,{ew},25)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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>',OrgChart.templates.group.field_0="<text "+OrgChart.attr.width+'="230" style="font-size: 18px;" fill="#aeaeae" x="{cw}" y="30" text-anchor="middle">{val}</text>',OrgChart.templates.group.field_1="",OrgChart.templates.group.ripple={radius:50,color:"#aeaeae"},OrgChart.templates.invisibleGroup=Object.assign({},OrgChart.templates.group),OrgChart.templates.invisibleGroup.node="",OrgChart.templates.invisibleGroup.padding=[0,0,0,0],OrgChart.templates.invisibleGroup.field_0="",OrgChart.templates.invisibleGroup.nodeMenuButton="",OrgChart.templates.mirror={linkAdjuster:{},link:"",node:"",nodeMenuButton:"",size:[0,0]},OrgChart.templates.ula=Object.assign({},OrgChart.templates.ana),OrgChart.templates.ula.field_0="<text "+OrgChart.attr.width+'="145" style="font-size: 18px;" fill="#039BE5" x="100" y="55">{val}</text>',OrgChart.templates.ula.field_1="<text "+OrgChart.attr.width+'="145" '+OrgChart.attr.text_overflow+'="multiline" style="font-size: 14px;" fill="#afafaf" x="100" y="76">{val}</text>',OrgChart.templates.ula.node='<rect x="0" y="0" height="{h}" width="{w}" fill="#ffffff" stroke-width="1" stroke="#aeaeae"></rect><line x1="0" y1="0" x2="250" y2="0" stroke-width="2" stroke="#039BE5"></line>',OrgChart.templates.ula.img_0='<clipPath id="{randId}"><circle cx="50" cy="60" r="40"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="10" y="20" width="80" height="80" ></image>',OrgChart.templates.ula.menu='<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,12)" '+OrgChart.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>',OrgChart.templates.ula.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,105)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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>',OrgChart.templates.olivia=Object.assign({},OrgChart.templates.ana),OrgChart.templates.olivia.defs='<style>\n #olivia_gradient {\n --color-stop-1: #ffffff;\n --color-stop-2: #eeeeee;\n --opacity-stop: 1;\n }\n .olivia-f0{\n font-size: 18px;\n fill: #757575;\n }\n .olivia-f1{\n font-size: 14px;\n fill: #757575;\n }\n .boc-dark .olivia-f0,.boc-dark .olivia-f1{\n fill: #aeaeae;\n }\n .boc-dark #olivia_gradient {\n --color-stop-1: #646464;\n --color-stop-2: #363636;\n --opacity-stop: 1;\n }\n </style>\n <linearGradient id="olivia_gradient" x1="0%" y1="0%" x2="0%" y2="100%"><stop offset="0%" stop-color="var(--color-stop-1)" stop-opacity="var(--opacity-stop)"/><stop offset="100%" stop-color="var(--color-stop-2)" stop-opacity="var(--opacity-stop)" /></linearGradient>',OrgChart.templates.olivia.field_0="<text "+OrgChart.attr.width+'="135" class="olivia-f0" x="100" y="55">{val}</text>',OrgChart.templates.olivia.field_1="<text "+OrgChart.attr.width+'="135" class="olivia-f1" x="100" y="76">{val}</text>',OrgChart.templates.olivia.node='<rect fill="url(#olivia_gradient)" x="0" y="0" height="{h}" width="{w}" stroke-width="1" stroke="#aeaeae" rx="7" ry="7"></rect>',OrgChart.templates.olivia.img_0='<clipPath id="{randId}"><circle cx="50" cy="60" r="40"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="10" y="20" width="80" height="80" ></image>',OrgChart.templates.olivia.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,105)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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>',OrgChart.templates.belinda=Object.assign({},OrgChart.templates.ana),OrgChart.templates.belinda.size=[180,180],OrgChart.templates.belinda.ripple={radius:90,color:"#e6e6e6",rect:null},OrgChart.templates.belinda.node='<circle cx="90" cy="90" r="90" fill="#039BE5" stroke-width="1" stroke="#aeaeae"></circle>',OrgChart.templates.belinda.img_0='<clipPath id="{randId}"><circle cx="90" cy="45" r="40"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="50" y="5" width="80" height="80" ></image>',OrgChart.templates.belinda.field_0="<text "+OrgChart.attr.width+'="170" style="font-size: 18px;" text-anchor="middle" fill="#ffffff" x="90" y="105">{val}</text>',OrgChart.templates.belinda.field_1="<text "+OrgChart.attr.width+'="160" style="font-size: 14px;" text-anchor="middle" fill="#ffffff" x="90" y="125">{val}</text>',OrgChart.templates.belinda.link='<path stroke="#aeaeae" stroke-width="1px" fill="none" d="M{xa},{ya} C{xb},{yb} {xc},{yc} {xd},{yd}"/>',OrgChart.templates.belinda.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,79,5)" '+OrgChart.attr.control_node_menu_id+'="{id}"><rect x="0" y="0" fill="#000000" fill-opacity="0" width="22" height="22"></rect><line stroke-width="2" stroke="#000" x1="0" y1="3" x2="22" y2="3"></line><line stroke-width="2" stroke="#000" x1="0" y1="9" x2="22" y2="9"></line><line stroke-width="2" stroke="#000" x1="0" y1="15" x2="22" y2="15"></line></g>',OrgChart.templates.rony=Object.assign({},OrgChart.templates.ana),OrgChart.templates.rony.svg='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="background-color:#E8E8E8;display:block;" width="{w}" height="{h}" viewBox="{viewBox}">{content}</svg>',OrgChart.templates.rony.defs='<filter id="{randId}" x="0" y="0" width="200%" height="200%"><feOffset result="offOut" in="SourceAlpha" dx="5" dy="5"></feOffset><feGaussianBlur result="blurOut" in="offOut" stdDeviation="5"></feGaussianBlur><feBlend in="SourceGraphic" in2="blurOut" mode="normal"></feBlend></filter>',OrgChart.templates.rony.size=[180,250],OrgChart.templates.rony.ripple={color:"#F57C00",radius:5,rect:null},OrgChart.templates.rony.img_0='<clipPath id="{randId}"><circle cx="90" cy="160" r="60"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="30" y="100" width="120" height="120"></image>',OrgChart.templates.rony.node='<rect filter="url(#{randId})" x="0" y="0" height="250" width="180" fill="#ffffff" stroke-width="0" rx="7" ry="7"></rect>',OrgChart.templates.rony.field_0="<text "+OrgChart.attr.width+'="165" style="font-size: 18px;" fill="#039BE5" x="90" y="40" text-anchor="middle">{val}</text>',OrgChart.templates.rony.field_1="<text "+OrgChart.attr.width+'="165" style="font-size: 14px;" fill="#F57C00" x="90" y="60" text-anchor="middle">{val}</text>',OrgChart.templates.rony.field_2="<text "+OrgChart.attr.width+'="165" style="font-size: 14px;" fill="#FFCA28" x="90" y="80" text-anchor="middle">{val}</text>',OrgChart.templates.rony.link='<path stroke="#039BE5" stroke-width="1px" fill="none" d="M{xa},{ya} {xb},{yb} {xc},{yc} L{xd},{yd}"/>',OrgChart.templates.rony.plus='<circle cx="15" cy="15" r="15" fill="#ffffff" stroke="#039BE5" stroke-width="1"></circle><line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#039BE5"></line><line x1="15" y1="4" x2="15" y2="26" stroke-width="1" stroke="#039BE5"></line>',OrgChart.templates.rony.minus='<circle cx="15" cy="15" r="15" fill="#ffffff" stroke="#039BE5" stroke-width="1"></circle><line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#039BE5"></line>',OrgChart.templates.rony.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,155,235)" '+OrgChart.attr.control_node_menu_id+'="{id}"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#F57C00"></circle><circle cx="7" cy="0" r="2" fill="#F57C00"></circle><circle cx="14" cy="0" r="2" fill="#F57C00"></circle></g>',OrgChart.templates.mery=Object.assign({},OrgChart.templates.ana),OrgChart.templates.mery.ripple={color:"#e6e6e6",radius:50,rect:null},OrgChart.templates.mery.node='<rect x="0" y="0" height="120" width="250" fill="#ffffff" stroke-width="1" stroke="#686868" rx="50" ry="50"></rect><rect x="0" y="45" height="30" width="250" fill="#039BE5" stroke-width="1"></rect>',OrgChart.templates.mery.link='<path stroke="#aeaeae" stroke-width="1px" fill="none" d="M{xa},{ya} C{xb},{yb} {xc},{yc} {xd},{yd}" />',OrgChart.templates.mery.img_0='<clipPath id="{randId}"><circle cx="125" cy="60" r="24"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="95" y="33" width="60" height="60"></image>',OrgChart.templates.mery.field_0="<text "+OrgChart.attr.width+'="220" style="font-size: 18px;" fill="#039BE5" x="125" y="30" text-anchor="middle">{val}</text>',OrgChart.templates.mery.field_1="<text "+OrgChart.attr.width+'="220" style="font-size: 14px;" fill="#039BE5" x="125" y="100" text-anchor="middle">{val}</text>',OrgChart.templates.mery.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,60)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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>',OrgChart.templates.polina=Object.assign({},OrgChart.templates.ana),OrgChart.templates.polina.size=[300,80],OrgChart.templates.polina.ripple={color:"#e6e6e6",radius:40,rect:null},OrgChart.templates.polina.node='<rect x="0" y="0" height="80" width="300" fill="#039BE5" stroke-width="1" stroke="#686868" rx="40" ry="40"></rect>',OrgChart.templates.polina.img_0='<clipPath id="{randId}"><circle cx="40" cy="40" r="35"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="0" y="0" width="80" height="80"></image>',OrgChart.templates.polina.field_0="<text "+OrgChart.attr.width+'="210" style="font-size: 18px;" fill="#ffffff" x="80" y="30" text-anchor="start">{val}</text>',OrgChart.templates.polina.field_1="<text "+OrgChart.attr.width+'="210" style="font-size: 14px;" fill="#ffffff" x="80" y="55" text-anchor="start">{val}</text>',OrgChart.templates.polina.link='<path stroke="#686868" stroke-width="1px" fill="none" d="M{xa},{ya} C{xb},{yb} {xc},{yc} {xd},{yd}" />',OrgChart.templates.polina.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,285,33)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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="0" cy="7" r="2" fill="#ffffff"></circle><circle cx="0" cy="14" r="2" fill="#ffffff"></circle></g>',OrgChart.templates.mila=Object.assign({},OrgChart.templates.ana),OrgChart.templates.mila.node='<rect x="0" y="0" height="120" width="250" fill="#039BE5" stroke-width="1" stroke="#aeaeae"></rect><rect x="-5" y="70" height="30" width="260" fill="#ffffff" stroke-width="1" stroke="#039BE5"></rect><line x1="-5" x2="0" y1="100" y2="105" stroke-width="1" stroke="#039BE5"/><line x1="255" x2="250" y1="100" y2="105" stroke-width="1" stroke="#039BE5"/>',OrgChart.templates.mila.img_0='<image preserveAspectRatio="xMidYMid slice" xlink:href="{val}" x="20" y="5" width="64" height="64"></image>',OrgChart.templates.mila.field_0="<text "+OrgChart.attr.width+'="240" style="font-size: 18px;" fill="#039BE5" x="125" y="92" text-anchor="middle">{val}</text>',OrgChart.templates.mila.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,110)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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>',OrgChart.templates.diva=Object.assign({},OrgChart.templates.ana),OrgChart.templates.diva.size=[200,170],OrgChart.templates.diva.node='<rect x="0" y="80" height="90" width="200" fill="#039BE5"></rect><circle cx="100" cy="50" fill="#ffffff" r="50" stroke="#039BE5" stroke-width="2"></circle>',OrgChart.templates.diva.img_0='<clipPath id="{randId}"><circle cx="100" cy="50" r="45"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="50" y="0" width="100" height="100"></image>',OrgChart.templates.diva.field_0="<text "+OrgChart.attr.width+'="185" style="font-size: 18px;" fill="#ffffff" x="100" y="125" text-anchor="middle">{val}</text>',OrgChart.templates.diva.field_1="<text "+OrgChart.attr.width+'="185" style="font-size: 14px;" fill="#ffffff" x="100" y="145" text-anchor="middle">{val}</text>',OrgChart.templates.diva.pointer='<g data-pointer="pointer" transform="matrix(0,0,0,0,100,100)"><radialGradient id="pointerGradient"><stop stop-color="#ffffff" offset="0" /><stop stop-color="#039BE5" offset="1" /></radialGradient><circle cx="16" cy="16" r="16" stroke-width="1" stroke="#acacac" fill="url(#pointerGradient)"></circle></g>',OrgChart.templates.diva.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,175,155)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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>',OrgChart.templates.luba=Object.assign({},OrgChart.templates.ana),OrgChart.templates.luba.svg='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:block;background-color: #2E2E2E;" width="{w}" height="{h}" viewBox="{viewBox}">{content}</svg>',OrgChart.templates.luba.defs='<linearGradient id="{randId}" x1="0%" y1="0%" x2="0%" y2="100%"><stop offset="0%" style="stop-color:#646464;stop-opacity:1" /><stop offset="100%" style="stop-color:#363636;stop-opacity:1" /></linearGradient>',OrgChart.templates.luba.node='<rect fill="url(#{randId})" x="0" y="0" height="120" width="250" stroke-width="1" stroke="#aeaeae" rx="7" ry="7"></rect>',OrgChart.templates.luba.img_0='<clipPath id="{randId}"><circle cx="50" cy="25" r="40"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="10" y="-15" width="80" height="80"></image>',OrgChart.templates.luba.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,105)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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>',OrgChart.templates.luba.field_0="<text "+OrgChart.attr.width+'="235" style="font-size: 18px;" fill="#aeaeae" x="125" y="90" text-anchor="middle">{val}</text>',OrgChart.templates.luba.field_1="<text "+OrgChart.attr.width+'="140" style="font-size: 14px;" fill="#aeaeae" x="240" y="30" text-anchor="end">{val}</text>',OrgChart.templates.luba.plus='<rect x="0" y="0" width="36" height="36" rx="12" ry="12" fill="#2E2E2E" stroke="#aeaeae" stroke-width="1"></rect><line x1="4" y1="18" x2="32" y2="18" stroke-width="1" stroke="#aeaeae"></line><line x1="18" y1="4" x2="18" y2="32" stroke-width="1" stroke="#aeaeae"></line>',OrgChart.templates.luba.minus='<rect x="0" y="0" width="36" height="36" rx="12" ry="12" fill="#2E2E2E" stroke="#aeaeae" stroke-width="1"></rect><line x1="4" y1="18" x2="32" y2="18" stroke-width="1" stroke="#aeaeae"></line>',OrgChart.templates.luba.expandCollapseSize=36,OrgChart.templates.isla=Object.assign({},OrgChart.templates.ana),OrgChart.templates.isla.defs='<filter x="-50%" y="-50%" width="200%" height="200%" filterUnits="objectBoundingBox" id="isla-shadow"><feOffset dx="0" dy="4" in="SourceAlpha" result="shadowOffsetOuter1" /><feGaussianBlur stdDeviation="10" in="shadowOffsetOuter1" result="shadowBlurOuter1" /><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0" in="shadowBlurOuter1" type="matrix" result="shadowMatrixOuter1" /><feMerge><feMergeNode in="shadowMatrixOuter1" /><feMergeNode in="SourceGraphic" /></feMerge></filter>',OrgChart.templates.isla.size=[180,120],OrgChart.templates.isla.node='<rect filter="url(#isla-shadow)" x="0" y="20" rx="7" ry="7" height="100" width="180" fill="#FFF" stroke-width="1" stroke="#039BE5" ></rect><rect x="25" y="75" rx="10" ry="10" height="20" width="130" fill="#039BE5" stroke-width="3" stroke="#039BE5"></rect><rect fill="#ffffff" stroke="#039BE5" stroke-width="1" x="70" y="0" rx="13" ry="13" width="40" height="40"></rect><circle stroke="#FFCA28" stroke-width="3" fill="none" cx="90" cy="12" r="8"></circle><path d="M75,34 C75,17 105,17 105,34" stroke="#FFCA28" stroke-width="3" fill="none"></path>',OrgChart.templates.isla.field_0="<text "+OrgChart.attr.width+'="120" style="font-size: 12px;" fill="#fff" x="90" y="90" text-anchor="middle">{val}</text>',OrgChart.templates.isla.field_1="<text "+OrgChart.attr.width+'="160" style="font-size: 13px;" fill="#039BE5" x="90" y="64" text-anchor="middle">{val}</text>',OrgChart.templates.isla.img_0='<clipPath id="{randId}"><rect filter="url(#isla-shadow)" fill="#ffffff" stroke="#039BE5" stroke-width="1" x="70" y="0" rx="13" ry="13" width="40" height="40"></rect></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="70" y="0" width="40" height="40"></image>',OrgChart.templates.isla.minus='<circle cx="15" cy="15" r="15" fill="#F57C00" stroke="#F57C00" stroke-width="1"></circle><line x1="8" y1="15" x2="22" y2="15" stroke-width="1" stroke="#ffffff"></line>',OrgChart.templates.isla.plus='<circle cx="15" cy="15" r="15" fill="#ffffff" stroke="#039BE5" stroke-width="1"></circle><line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#039BE5"></line><line x1="15" y1="4" x2="15" y2="26" stroke-width="1" stroke="#039BE5"></line>',OrgChart.templates.isla.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,83,45)" '+OrgChart.attr.control_node_menu_id+'="{id}"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#F57C00"></circle><circle cx="7" cy="0" r="2" fill="#F57C00"></circle><circle cx="14" cy="0" r="2" fill="#F57C00"></circle></g>',OrgChart.templates.isla.ripple={radius:0,color:"#F57C00",rect:{x:0,y:20,width:180,height:100}},OrgChart.templates.deborah=Object.assign({},OrgChart.templates.polina),OrgChart.templates.deborah.size=[150,150],OrgChart.templates.deborah.node='<rect x="0" y="0" height="150" width="150" fill="#039BE5" stroke-width="1" stroke="#686868" rx="15" ry="15"></rect>',OrgChart.templates.deborah.img_0='<clipPath id="{randId}"><rect fill="#ffffff" stroke="#039BE5" stroke-width="1" x="5" y="5" rx="15" ry="15" width="140" height="140"></rect></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="5" y="5" width="140" height="140"></image><rect x="3" y="5" height="30" width="144" fill="#039BE5" opacity="0.5" rx="3" ry="3"></rect><rect x="3" y="115" height="30" width="144" fill="#039BE5" opacity="0.5" rx="3" ry="3"></rect>',OrgChart.templates.deborah.field_0="<text "+OrgChart.attr.width+'="125" '+OrgChart.attr.text_overflow+'="ellipsis" style="font-size: 18px;" fill="#ffffff" x="15" y="25" text-anchor="start">{val}</text>',OrgChart.templates.deborah.field_1="<text "+OrgChart.attr.width+'="105" '+OrgChart.attr.text_overflow+'="ellipsis" style="font-size: 11px;" fill="#ffffff" x="15" y="135" text-anchor="start">{val}</text>',OrgChart.templates.deborah.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,125,130)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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>',OrgChart.templates.subLevel=Object.assign({},OrgChart.templates.base),OrgChart.templates.subLevel.size=[0,0],OrgChart.templates.subLevel.node="",OrgChart.templates.subLevel.plus="",OrgChart.templates.subLevel.minus="",OrgChart.templates.subLevel.nodeMenuButton="",OrgChart.templates.group_dotted_lines=Object.assign({},OrgChart.templates.group),OrgChart.templates.group_dotted_lines.size=[250,120],OrgChart.templates.group_dotted_lines.link='<path stroke-linejoin="round" stroke="#aeaeae" stroke-width="1px" fill="none" d="{rounded}" />',OrgChart.templates.group_dotted_lines.node='<rect rx="5" ry="5" x="0" y="0" height="{h}" width="{w}" fill="#e5e5e5" stroke-width="0"></rect>',OrgChart.templates.group_dotted_lines.nodeGroupDottedCloseButton='<g transform="matrix(1,0,0,1,{ew},0)"><circle cx="0.5" cy="21.5" r="12" fill="#F57C00"></circle>'+OrgChart.icon.close(25,25,"#fff",-13,8)+"</g>",OrgChart.templates.group_dotted_lines.field_0='<text data-width="230" style="font-size: 18px;" fill="#F57C00" x="20" y="30" text-anchor="start">Dotted Lines</text>',OrgChart.templates.group_dotted_lines.field_1="",OrgChart.templates.group_dotted_lines.img_0="",OrgChart.templates.group_dotted_lines.ripple.radius=5,OrgChart.templates.group_dotted_lines.min=Object.assign({},OrgChart.templates.olivia),OrgChart.templates.group_dotted_lines.min.nodeGroupDottedOpenButton='<g transform="matrix(1,0,0,1,220,10)"><rect x="0" y="0" width="22" height="22" stroke="#aeaeae" stroke-width="1" fill="#ffffff" rx="5" ry="5"></rect><text x="11" y="16" text-anchor="middle" style="font-size: 14px;" fill="#2A292E">{children-total-count}</text><rect x="0" y="0" width="22" height="22" style="opacity: 0" stroke="#aeaeae" stroke-width="1" fill="red" rx="5" ry="5"></rect></g>',OrgChart.ui={_defsIds:{},defs:function(t){var e="";for(var r in OrgChart.templates){var i=OrgChart.templates[r];i.defs&&(OrgChart.ui._defsIds[r]=OrgChart.randomId(),e+=i.defs.replaceAll("{randId}",OrgChart.ui._defsIds[r]))}return"<defs>"+e+t+"</defs>"},lonely:function(t){return t.nodes&&t.nodes.length?"":OrgChart.IT_IS_LONELY_HERE.replace("{link}",OrgChart.RES.IT_IS_LONELY_HERE_LINK)},pointer:function(t,e,r){if(e===OrgChart.action.exporting)return"";var i=OrgChart.t(t.template,!1,r),n=i.pointer;return n||(n=""),i.pointer},aiButton:function(t){return t.enableAI?'<div data-boc-ai-button class="boc-ai-button">AI</div>':""},node:function(t,e,r,i,n,a,o,s,l,h){var c=OrgChart.t(t.templateName,t.min,l),d=c.node.replaceAll("{w}",t.w).replaceAll("{h}",t.h);c.defs&&(d=d.replaceAll("{randId}",OrgChart.ui._defsIds[t.templateName])),null==o&&(o=i.nodeBinding);var g={node:t,data:e};for(var p in o){var u,f=o[p];e&&(u=e[f]);var m=OrgChart._lblIsImg(i,p);if(g.value=u,g.element=c[p],g.name=f,g.field=p,!1!==OrgChart.events.publish("field",[h,g])&&null!=g.value&&null!=g.value&&null!=g.element&&(!m||m&&!OrgChart.isNEU(g.value))){if(!m&&"string"==typeof g.value){var C=g.element;C&&(C=C.replaceAll("{ew}",t.w-(t.padding?t.padding[1]:0)).replaceAll("{cw}",t.w/2)),g.value=OrgChart.wrapText(g.value,C)}var b=g.element.replace("{val}",g.value);d+=b=b.replaceAll("{ew}",t.w-(t.padding?t.padding[1]:0)).replaceAll("{cw}",t.w/2).replaceAll("{randId}",OrgChart.randomId()).replaceAll("{randId2}",OrgChart.randomId())}}var v=OrgChart._getPosition(r,t,n,a),O="node";Array.isArray(t.tags)&&t.tags.length&&(O+=" "+t.tags.join(" ")),t.layout&&(O+=" tree-layout");var x="";t.lcn&&(x='lcn="'+t.lcn+'"');var y=OrgChart.nodeOpenTag.replace("{lcn}",x).replace("{id}",t.id).replace("{class}",O).replace("{sl}",t.sl).replace("{level}",t.level).replace("{x}",v.x).replace("{y}",v.y),_=OrgChart._getOpacity(r,t);return d=(y=y.replace("{opacity}",_))+(d+=OrgChart.ui.nodeBtns(i,t,s,c,h))+OrgChart.grCloseTag},nodeBtns:function(t,e,r,i,n){var a="";return null==t.nodeMenu||e.isSplit||r===OrgChart.action.exporting||(a+=i.nodeMenuButton.replace("{id}",e.id).replace("{cw}",e.w/2).replace("{ch}",e.h/2).replace("{ew}",e.w-(e.padding?e.padding[1]:0)).replace("{eh}",e.h-(e.padding?e.padding[2]:0))),null==t.nodeCircleMenu||e.isSplit||r===OrgChart.action.exporting||OrgChart.isNEU(i.nodeCircleMenuButton)||(a+='<g style="cursor:pointer;" transform="matrix(1,0,0,1,'+i.nodeCircleMenuButton.x+","+i.nodeCircleMenuButton.y+')" '+OrgChart.attr.control_node_circle_menu_id+'="'+e.id+'"><circle cx="0" cy="0" fill="'+i.nodeCircleMenuButton.color+'" r="'+i.nodeCircleMenuButton.radius+'" stroke-width="1" stroke="'+i.nodeCircleMenuButton.stroke+'"></circle><line x1="-'+i.nodeCircleMenuButton.radius/2+'" y1="-6" x2="'+i.nodeCircleMenuButton.radius/2+'" y2="-6" stroke-width="2" stroke="'+i.nodeCircleMenuButton.stroke+'"></line><line x1="-'+i.nodeCircleMenuButton.radius/2+'" y1="0" x2="'+i.nodeCircleMenuButton.radius/2+'" y2="0" stroke-width="2" stroke="'+i.nodeCircleMenuButton.stroke+'"></line><line x1="-'+i.nodeCircleMenuButton.radius/2+'" y1="6" x2="'+i.nodeCircleMenuButton.radius/2+'" y2="6" stroke-width="2" stroke="'+i.nodeCircleMenuButton.stroke+'"></line></g>'),a},expandCollapseBtn:function(t,e,r,i,n){var a="";if(i!==OrgChart.action.exporting&&!e.isSplit){var o=r[e.lcn?e.lcn:"base"],s=0,l=0,h=OrgChart.t(e.templateName,e.min,n);if(e.childrenIds.length>0){if(e.hasPartners){for(var c=!1,d=0;d<e.childrenIds.length;d++){var g=t.getNode(e.childrenIds[d]);!g||g.parentPartner||g.isPartner||(c=!0)}if(!c)return""}switch(o.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:s=e.x+e.w/2,l=e.y+e.h;break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:s=e.x+e.w/2,l=e.y;break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:s=e.x,l=e.y+e.h/2;break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:s=e.x+e.w,l=e.y+e.h/2}if(s-=h.expandCollapseSize/2,l-=h.expandCollapseSize/2,t.getCollapsedIds(e).length?(a+=OrgChart.expcollOpenTag.replace("{id}",e.id).replace("{x}",s).replace("{y}",l),a+=h.plus,a+=OrgChart.grCloseTag):(a+=OrgChart.expcollOpenTag.replace("{id}",e.id).replace("{x}",s).replace("{y}",l),a+=h.minus,a+=OrgChart.grCloseTag),-1!=a.indexOf("{collapsed-children-count}")){var p=OrgChart.collapsedChildrenCount(t,e);a=a.replace("{collapsed-children-count}",p)}if(-1!=a.indexOf("{collapsed-children-total-count}")){var u=OrgChart.collapsedChildrenTotalCount(t,e);a=a.replace("{collapsed-children-total-count}",u)}if(-1!=a.indexOf("{children-count}")){var f=OrgChart.childrenCount(t,e);a=a.replace("{children-count}",f)}if(-1!=a.indexOf("{children-total-count}")){var m=OrgChart.childrenTotalCount(t,e);a=a.replace("{children-total-count}",m)}}t._nodeHasHiddenParent(e)&&(a+=OrgChart.upOpenTag.replace("{id}",e.id).replace("{x}",e.x).replace("{y}",e.y),a+=h.up,a+=OrgChart.grCloseTag)}var C={html:a,node:e};return OrgChart.events.publish("renderbuttons",[t,C]),C.html},link:function(t,e,r,i,n,a,o){var s=t.lcn?t.lcn:"base",l=e._layoutConfigs[s],h=OrgChart.t(t.templateName,t.min,r),c=[],d=[],g=l.levelSeparation/2;t.layout>0&&(g=l.mixedHierarchyNodesSeparation/2);var p=0,u=OrgChart.getRootOf(t).id,f=i[u][t.sl],m=void 0;if(t.hasPartners){m={ids:[],indexes:{},ppnodes:{},lastLeft:null,firstRight:null,maxSidePartnersWithChildren:0,rightIds:[],leftIds:[],partnerChildrenSplitSeparation:e.config.partnerChildrenSplitSeparation};for(var C=0;C<t.children.length;C++){(v=t.children[C]).parentPartner?(m.ppnodes[v.id]=v.parentPartner,m.ids.push(v.id),1==v.parentPartner.isPartner?(-1==m.rightIds.indexOf(v.parentPartner.id)&&m.rightIds.push(v.parentPartner.id),m.indexes[v.id]=m.rightIds.indexOf(v.parentPartner.id),m.firstRight||(m.firstRight=v)):2==v.parentPartner.isPartner&&(-1==m.leftIds.indexOf(v.parentPartner.id)&&m.leftIds.push(v.parentPartner.id),m.indexes[v.id]=m.leftIds.indexOf(v.parentPartner.id),m.lastLeft=v)):v.isPartner||(m.lastLeft=v,m.firstRight||(m.firstRight=v))}m.maxSidePartnersWithChildren=Math.max(m.leftIds.length,m.rightIds.length),p=0==m.maxSidePartnersWithChildren?e.config.minPartnerSeparation/2:e.config.minPartnerSeparation/2+m.partnerChildrenSplitSeparation*m.maxSidePartnersWithChildren+m.partnerChildrenSplitSeparation/2}for(C=0;C<t.children.length;C++){var b,v=t.children[C],O=i[u][v.sl],x={xa:0,ya:0,xb:0,yb:0,xc:0,yc:0,xd:0,yd:0,x:0,y:0,rotate:0},y=(h=OrgChart.t(v.templateName,v.min,r)).link;if(v.isChildOfPartner)switch(l.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:var _=1==v.layout?void 0:O.minY-(O.minY-f.maxY)/2;x=OrgChart.ui._linkTopToBottom(v.parentPartner,v,h,g,_);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:_=1==v.layout?void 0:O.maxY-(O.maxY-f.minY)/2;x=OrgChart.ui._linkBottomToTop(v.parentPartner,v,h,g,_);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:_=1==v.layout?void 0:O.maxX-(O.maxX-f.minX)/2;x=OrgChart.ui._linkRightToLeft(v.parentPartner,v,h,g,_);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:_=1==v.layout?void 0:O.minX-(O.minX-f.maxX)/2;x=OrgChart.ui._linkLeftToRight(v.parentPartner,v,h,g,_)}else if(m&&-1!=m.ids.indexOf(v.id))switch(l.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:x=OrgChart.ui._linkPpTop(m,t,v,O,f,h);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:x=OrgChart.ui._linkPpBottom(m,t,v,O,f,h);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:x=OrgChart.ui._linkPpRight(m,t,v,O,f,h);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:x=OrgChart.ui._linkPpLeft(m,t,v,O,f,h)}else{var k=v.isAssistant&&v.rightNeighbor&&v.rightNeighbor.isAssistant&&v.parent==v.rightNeighbor.parent,w=v.isAssistant&&v.leftNeighbor&&v.leftNeighbor.isAssistant&&v.parent==v.leftNeighbor.parent;if((k||v.layout>1)&&v.rightNeighbor&&v.rightNeighbor.isSplit)switch(l.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:x=OrgChart.ui._linkRightToLeft(v.rightNeighbor,v,h,g);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:x=OrgChart.ui._linkBottomToTop(v.rightNeighbor,v,h,g)}else if((w||v.layout>1)&&v.leftNeighbor&&v.leftNeighbor.isSplit)switch(l.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:x=OrgChart.ui._linkLeftToRight(v.leftNeighbor,v,h,g);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:x=OrgChart.ui._linkTopToBottom(v.leftNeighbor,v,h,g)}else switch(l.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:if(1==v.isPartner)x=OrgChart.ui._linkLeftToRight(t,v,h,p);else if(2==v.isPartner)x=OrgChart.ui._linkRightToLeft(t,v,h,p);else{_=1==v.layout?void 0:O.minY-(O.minY-f.maxY)/2;x=OrgChart.ui._linkTopToBottom(t,v,h,g,_)}break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:if(1==v.isPartner)x=OrgChart.ui._linkLeftToRight(t,v,h,p);else if(2==v.isPartner)x=OrgChart.ui._linkRightToLeft(t,v,h,p);else{_=1==v.layout?void 0:O.maxY-(O.maxY-f.minY)/2;x=OrgChart.ui._linkBottomToTop(t,v,h,g,_)}break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:if(1==v.isPartner)x=OrgChart.ui._linkTopToBottom(t,v,h,p);else if(2==v.isPartner)x=OrgChart.ui._linkBottomToTop(t,v,h,p);else{_=1==v.layout?void 0:O.maxX-(O.maxX-f.minX)/2;x=OrgChart.ui._linkRightToLeft(t,v,h,g,_)}break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:if(1==v.isPartner)x=OrgChart.ui._linkTopToBottom(t,v,h,p);else if(2==v.isPartner)x=OrgChart.ui._linkBottomToTop(t,v,h,p);else{_=1==v.layout?void 0:O.minX-(O.minX-f.maxX)/2;x=OrgChart.ui._linkLeftToRight(t,v,h,g,_)}}}var S=OrgChart.ui._draggableLinkPath(e,t,v,x,g,l.orientation);if(S)b=S,y=y.replaceAll("{rounded}",S).replaceAll("{edge}",S).replaceAll("{curve}",b);else if(-1!=y.indexOf("{rounded}"))if(x.xa==x.xb&&x.xa==x.xc&&x.xa==x.xd||x.ya==x.yb&&x.ya==x.yc&&x.ya==x.yd)b="M"+x.xa+","+x.ya+" L"+x.xd+","+x.yd,y=y.replaceAll("{rounded}",b);else if(Math.abs(x.xa-x.xd)<=OrgChart.LINK_ROUNDED_CORNERS&&Math.abs(x.xa-x.xc)<=OrgChart.LINK_ROUNDED_CORNERS&&Math.abs(x.xa-x.xb)<=OrgChart.LINK_ROUNDED_CORNERS)b="M"+x.xa+","+x.ya+" L"+x.xa+","+x.yd,y=y.replaceAll("{rounded}",b);else if(Math.abs(x.ya-x.yd)<=OrgChart.LINK_ROUNDED_CORNERS&&Math.abs(x.ya-x.yc)<=OrgChart.LINK_ROUNDED_CORNERS&&Math.abs(x.ya-x.yb)<=OrgChart.LINK_ROUNDED_CORNERS)b="M"+x.xa+","+x.ya+" L"+x.xd+","+x.ya,y=y.replaceAll("{rounded}",b);else{var I=OrgChart.ui._roundedEdge(x.xa,x.ya,x.xb,x.yb,x.xc,x.yc),A=OrgChart.ui._roundedEdge(x.xb,x.yb,x.xc,x.yc,x.xd,x.yd);b="M"+I.x1+","+I.y1+" "+I.x2+","+I.y2+" Q"+I.qx1+","+I.qy1+" "+I.qx2+","+I.qy2+" L"+A.x2+","+A.y2+" Q"+A.qx1+","+A.qy1+" "+A.qx2+","+A.qy2+" L"+A.x3+","+A.y3,y=y.replaceAll("{rounded}",b)}else-1!=y.indexOf("{edge}")?(b="M"+x.xa+","+x.ya+" "+x.xb+","+x.yb+" "+x.xc+","+x.yc+" L"+x.xd+","+x.yd,y=y.replaceAll("{edge}",b)):-1!=y.indexOf("{curve}")?(b="M"+x.xa+","+x.ya+" C"+x.xb+","+x.yb+" "+x.xc+","+x.yc+" "+x.xd+","+x.yd,y=y.replaceAll("{curve}",b)):(b=y.replaceAll("{xa}",x.xa).replaceAll("{ya}",x.ya).replaceAll("{xb}",x.xb).replaceAll("{yb}",x.yb).replaceAll("{xc}",x.xc).replaceAll("{yc}",x.yc).replaceAll("{xd}",x.xd).replaceAll("{yd}",x.yd),y=b);c.push(OrgChart.linkOpenTag.replaceAll("{id}",t.id).replaceAll("{class}","link "+v.tags.join(" ")).replaceAll("{child-id}",v.id));var L={node:t,cnode:v,p:x,html:y,action:a};OrgChart.events.publish("render-link",[e,L]),c.push(L.html),o&&d.push({id:t.id,childId:v.id,html:L.html});var E="";for(var N in e.config.linkBinding){var M=e.config.linkBinding[N],T=e._get(v.id);if(T){var R=T[M];L.value=R,L.element=h[N],L.name=M,!1!==OrgChart.events.publish("label",[e,L])&&(OrgChart.isNEU(L.value)||OrgChart.isNEU(L.element)||(E+=L.element.replace("{val}",L.value)))}}if(""!=E){var B=x.x,U=x.y;null!=v.movey&&(U+=v.movey),E=OrgChart.linkFieldsOpenTag.replace("{x}",B).replace("{y}",U).replace("{rotate}",0)+E+OrgChart.grCloseTag,c.push(E)}c.push(OrgChart.grCloseTag)}return o?d:c.join("")},svg:function(t,e,r,i,n,a){return OrgChart.t(i.template,!1,a).svg.replace("{w}",t).replace("{h}",e).replace("{viewBox}",r).replace("{randId}",OrgChart.ui._defsIds[i.template]).replace("{mode}",i.mode).replace("{template}",i.template).replace("{content}",(function(){return n}))},menuButton:function(t){return null==t.menu?"":OrgChart.t(t.template,!1).menuButton.replaceAll("{p}",t.padding)},_roundedEdge:function(t,e,r,i,n,a){var o,s,l,h=OrgChart.LINK_ROUNDED_CORNERS,c=0;return t==r&&t==n||e==i&&e==a?(o=l=r,s=c=i):(t!=n&&r==n&&(o=l=r,s=i,e<a?c=i+h:e>a&&(c=i-h)),t<n&&r==n?r-=h:t>n&&r==n&&(r+=h),e!=a&&i==a&&(o=r,s=c=i,t<n?l=r+h:t>n&&(l=r-h)),e<a&&i==a?i-=h:e>a&&i==a&&(i+=h)),{x1:t,y1:e,x2:r,y2:i,x3:n,y3:a,qx1:o,qy1:s,qx2:l,qy2:c}},_linkTopToBottom:function(t,e,r,i,n){var a,o,s,l,h,c=0;return a=t.x+t.w/2+r.linkAdjuster.toX,o=t.y+t.h+r.linkAdjuster.toY,l=s=e.x+e.w/2+r.linkAdjuster.fromX,h=e.y+r.linkAdjuster.fromY,{xa:a,ya:o,xb:a,yb:c=t.rightNeighbor&&t.rightNeighbor.isAssistant&&"split"==e.templateName?t.rightNeighbor.y+t.rightNeighbor.h+i:"split"==t.templateName&&(e.isAssistant||e.layout>1)?h:"split"==e.templateName?o+i:null!=n?n:h-i,xc:s,yc:c,xd:l,yd:h,x:s,y:OrgChart.isNEU(e.parentPartner)?c+16:c,rotate:0}},_linkBottomToTop:function(t,e,r,i,n){var a,o,s,l,h,c=0;return a=t.x+t.w/2+r.linkAdjuster.toX,o=t.y+r.linkAdjuster.toY,l=s=e.x+e.w/2+r.linkAdjuster.fromX,h=e.y+e.h+r.linkAdjuster.fromY,{xa:a,ya:o,xb:a,yb:c=t.rightNeighbor&&t.rightNeighbor.isAssistant&&"split"==e.templateName?t.rightNeighbor.y-i:"split"==t.templateName&&(e.isAssistant||e.layout>1)?h:"split"==e.templateName?o-i:null!=n?n:h+i,xc:s,yc:c,xd:l,yd:h,x:s,y:c-14,rotate:0}},_linkRightToLeft:function(t,e,r,i,n){var a,o,s,l,h,c,d=0;return a=t.x+r.linkAdjuster.toX,o=t.y+t.h/2+r.linkAdjuster.toY,h=e.x+e.w+r.linkAdjuster.fromX,c=l=e.y+e.h/2+r.linkAdjuster.fromY,s=o,{xa:a,ya:o,xb:d=t.rightNeighbor&&t.rightNeighbor.isAssistant&&"split"==e.templateName?t.rightNeighbor.x-i:"split"==t.templateName&&(e.isAssistant||e.layout>1)?h:"split"==e.templateName?a-i:null!=n?n:h+i,yb:s,xc:d,yc:l,xd:h,yd:c,x:d-16,y:l,rotate:90}},_linkLeftToRight:function(t,e,r,i,n){var a,o,s,l,h,c,d=0;return a=t.x+t.w+r.linkAdjuster.toX,o=t.y+t.h/2+r.linkAdjuster.toY,h=e.x+r.linkAdjuster.fromX,c=l=e.y+e.h/2+r.linkAdjuster.fromY,s=o,{xa:a,ya:o,xb:d=t.rightNeighbor&&t.rightNeighbor.isAssistant&&"split"==e.templateName?t.rightNeighbor.x+t.rightNeighbor.w+i:"split"==t.templateName&&(e.isAssistant||e.layout>1)?h:"split"==e.templateName?a+i:null!=n?n:h-i,yb:s,xc:d,yc:l,xd:h,yd:c,x:d+14,y:l,rotate:270}},_linkPpTop:function(t,e,r,i,n,a){var o=t.ppnodes[r.id],s=o.y+o.h/2,l=i.minY-(i.minY-n.maxY)/2,h=(i.minY-n.maxY)/t.maxSidePartnersWithChildren/4,c=OrgChart.ui.__linkPpBottomTop(t,e,r,l,h,o),d=c.x;return l=c.mid,OrgChart.ui._linkTopToBottom({x:d,y:s,w:0,h:0},r,a,0,l)},_linkPpBottom:function(t,e,r,i,n,a){var o=t.ppnodes[r.id],s=o.y+o.h/2,l=i.maxY-(i.maxY-n.minY)/2,h=(i.maxY-n.minY)/t.maxSidePartnersWithChildren/4,c=OrgChart.ui.__linkPpBottomTop(t,e,r,l,h,o),d=c.x;return l=c.mid,OrgChart.ui._linkBottomToTop({x:d,y:s,w:0,h:0},r,a,0,l)},_linkPpLeft:function(t,e,r,i,n,a){var o=t.ppnodes[r.id],s=i.minX-(i.minX-n.maxX)/2,l=(i.minX-n.maxX)/t.maxSidePartnersWithChildren/4,h=o.x+o.w/2,c=OrgChart.ui.__linkPpLeftRight(t,e,r,s,l,o),d=c.y;return s=c.mid,OrgChart.ui._linkLeftToRight({x:h,y:d,w:0,h:0},r,a,0,s)},_linkPpRight:function(t,e,r,i,n,a){var o=t.ppnodes[r.id],s=i.maxX-(i.maxX-n.minX)/2,l=(i.maxX-n.minX)/t.maxSidePartnersWithChildren/4,h=o.x+o.w/2,c=OrgChart.ui.__linkPpLeftRight(t,e,r,s,l,o),d=c.y;return s=c.mid,OrgChart.ui._linkRightToLeft({x:h,y:d,w:0,h:0},r,a,0,s)},__linkPpBottomTop:function(t,e,r,i,n,a){var o=0;return 1==a.isPartner?(o=a.x-e.partnerSeparation/2+t.indexes[r.id]*t.partnerChildrenSplitSeparation-(t.rightIds.length-1)*t.partnerChildrenSplitSeparation/2,t.lastLeft&&o<t.lastLeft.x+t.lastLeft.w/2?o<r.x+r.w/2?i-=(t.indexes[r.id]+1)*n:i-=(t.rightIds.length-t.indexes[r.id])*n:o<r.x+r.w/2?i+=(t.rightIds.length-t.indexes[r.id])*n:i+=(t.indexes[r.id]+1)*n):2==a.isPartner&&(o=a.x+a.w+e.partnerSeparation/2+t.indexes[r.id]*t.partnerChildrenSplitSeparation-(t.leftIds.length-1)*t.partnerChildrenSplitSeparation/2,t.firstRight&&o>t.firstRight.x+t.firstRight.w/2?o<r.x+r.w/2?i-=(t.indexes[r.id]+1)*n:i-=(t.leftIds.length-t.indexes[r.id])*n:o<r.x+r.w/2?i+=(t.leftIds.length-t.indexes[r.id])*n:i+=(t.indexes[r.id]+1)*n),{x:o,mid:i}},__linkPpLeftRight:function(t,e,r,i,n,a){var o=0;return 1==a.isPartner?(o=a.y-e.partnerSeparation/2+t.indexes[r.id]*t.partnerChildrenSplitSeparation-(t.rightIds.length-1)*t.partnerChildrenSplitSeparation/2,t.lastLeft&&o<t.lastLeft.y+t.lastLeft.h/2?o<r.y+r.h/2?i-=(t.indexes[r.id]+1)*n:i-=(t.rightIds.length-t.indexes[r.id])*n:o<r.y+r.h/2?i+=(t.rightIds.length-t.indexes[r.id])*n:i+=(t.indexes[r.id]+1)*n):2==a.isPartner&&(o=a.y+a.h+e.partnerSeparation/2+t.indexes[r.id]*t.partnerChildrenSplitSeparation-(t.leftIds.length-1)*t.partnerChildrenSplitSeparation/2,t.firstRight&&o>t.firstRight.y+t.firstRight.h/2?o<r.y+r.h/2?i-=(t.indexes[r.id]+1)*n:i-=(t.leftIds.length-t.indexes[r.id])*n:o<r.y+r.h/2?i+=(t.leftIds.length-t.indexes[r.id])*n:i+=(t.indexes[r.id]+1)*n),{y:o,mid:i}},_draggableLinkPath:function(t,e,r,i,n,a){if(r.isPartner)return null;if(r.isAssistant)return null;if(OrgChart._isMoved(r)&&!OrgChart._isMoved(e)){var o=[];switch(a){case OrgChart.orientation.top:case OrgChart.orientation.top_left:if(i.yb+n/2<i.yd)return null;l=i.xa<i.xd?r.x-n/2:r.x+r.w+n/2,h=r.y-n/2;break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:if(i.yb-n/2>i.yd)return null;l=i.xa<i.xd?r.x-n/2:r.x+r.w+n/2,h=r.y+r.h+n/2;break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:if(i.xb-n/2>i.xd)return null;h=i.ya<i.yd?r.y-n/2:r.y+r.h+n/2,l=r.x+r.w+n/2;break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:if(i.xb+n/2<i.xd)return null;h=i.ya<i.yd?r.y-n/2:r.y+r.h+n/2,l=r.x-n/2}switch(a){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:o.push(["M",i.xa,i.ya]),o.push(["L",i.xb,i.yb]),o.push(["L",l,i.yb]),o.push(["L",l,h]),o.push(["L",i.xd,h]),o.push(["L",i.xd,i.yd]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:(o=[]).push(["M",i.xa,i.ya]),o.push(["L",i.xb,i.yb]),o.push(["L",i.xb,h]),o.push(["L",l,h]),o.push(["L",l,i.yd]),o.push(["L",i.xd,i.yd])}return OrgChart.roundPathCorners(o,OrgChart.LINK_ROUNDED_CORNERS,!1)}if(!OrgChart._isMoved(r)&&OrgChart._isMoved(e)){var s=!1;o=[];switch(a){case OrgChart.orientation.top:case OrgChart.orientation.top_left:if(i.ya+n/2>i.yb)s=!0,l=i.xa<i.xd?e.x+e.w+n/2:e.x-n/2,h=e.y+e.h+n;else{if(i.yb+n/2<i.yd)return null;l=i.xa<i.xd?r.x-n/2:r.x+r.w+n/2,h=r.y-n/2}break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:if(i.ya-n/2<i.yb)s=!0,l=i.xa<i.xd?e.x+e.w+n/2:e.x-n/2,h=e.y-n;else{if(i.yb-n/2>i.yd)return null;l=i.xa<i.xd?r.x-n/2:r.x+r.w+n/2,h=r.y+r.h+n/2}break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:if(i.xa-n/2<i.xb)s=!0,h=i.ya<i.yd?e.y+e.h+n/2:e.y-n/2,l=e.x-n;else{if(i.xb-n/2>i.xd)return null;h=i.ya<i.yd?r.y-n/2:r.y+r.h+n/2,l=r.x+r.w+n/2}break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:if(i.xa+n/2>i.xb)s=!0,h=i.ya<i.yd?e.y+e.h+n/2:e.y-n/2,l=e.x+e.w+n;else{if(i.xb+n/2<i.xd)return null;h=i.ya<i.yd?r.y-n/2:r.y+r.h+n/2,l=r.x-n/2}}if(s)switch(a){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:o.push(["M",i.xa,i.ya]),o.push(["L",i.xa,h]),o.push(["L",l,h]),o.push(["L",l,i.yc]),o.push(["L",i.xc,i.yc]),o.push(["L",i.xd,i.yd]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:o.push(["M",i.xa,i.ya]),o.push(["L",l,i.ya]),o.push(["L",l,h]),o.push(["L",i.xc,h]),o.push(["L",i.xc,i.yc]),o.push(["L",i.xd,i.yd])}else switch(a){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:o.push(["M",i.xa,i.ya]),o.push(["L",i.xb,i.yb]),o.push(["L",l,i.yb]),o.push(["L",l,h]),o.push(["L",i.xd,h]),o.push(["L",i.xd,i.yd]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:o.push(["M",i.xa,i.ya]),o.push(["L",i.xb,i.yb]),o.push(["L",i.xb,h]),o.push(["L",l,h]),o.push(["L",l,i.yd]),o.push(["L",i.xd,i.yd])}return OrgChart.roundPathCorners(o,OrgChart.LINK_ROUNDED_CORNERS,!1)}if(OrgChart._isMoved(r)&&OrgChart._isMoved(e)){o=[];switch(a){case OrgChart.orientation.top:case OrgChart.orientation.top_left:if(i.ya+n>i.yd){var l=i.xa<i.xd?e.x+e.w+n/2:e.x-n/2,h=e.y+e.h+n,c=r.y-n;o.push(["M",i.xa,i.ya]),o.push(["L",i.xa,h]),o.push(["L",l,h]),o.push(["L",l,c]),o.push(["L",i.xc,c]),o.push(["L",i.xd,i.yd])}else o.push(["M",i.xa,i.ya]),o.push(["L",i.xa,e.y+e.h+n]),o.push(["L",i.xc,e.y+e.h+n]),o.push(["L",i.xd,i.yd]);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:if(i.ya-n<i.yd){l=i.xa<i.xd?e.x+e.w+n/2:e.x-n/2,h=e.y-n,c=r.y+r.h+n;o.push(["M",i.xa,i.ya]),o.push(["L",i.xa,h]),o.push(["L",l,h]),o.push(["L",l,c]),o.push(["L",i.xc,c]),o.push(["L",i.xd,i.yd])}else o.push(["M",i.xa,i.ya]),o.push(["L",i.xa,e.y-n]),o.push(["L",i.xc,e.y-n]),o.push(["L",i.xd,i.yd]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:if(i.xa-n<i.xd){h=i.ya<i.yd?e.y+e.h+n/2:e.y-n/2,l=e.x-n;var d=r.x+r.w+n;o.push(["M",i.xa,i.ya]),o.push(["L",l,i.ya]),o.push(["L",l,h]),o.push(["L",d,h]),o.push(["L",d,i.yc]),o.push(["L",i.xd,i.yd])}else o.push(["M",i.xa,i.ya]),o.push(["L",e.x-n,i.ya]),o.push(["L",e.x-n,i.yc]),o.push(["L",i.xd,i.yd]);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:if(i.xa+n>i.xd){h=i.ya<i.yd?e.y+e.h+n/2:e.y-n/2,l=e.x+e.w+n,d=r.x-n;o.push(["M",i.xa,i.ya]),o.push(["L",l,i.ya]),o.push(["L",l,h]),o.push(["L",d,h]),o.push(["L",d,i.yc]),o.push(["L",i.xd,i.yd])}else o.push(["M",i.xa,i.ya]),o.push(["L",e.x+e.w+n,i.ya]),o.push(["L",e.x+e.w+n,i.yc]),o.push(["L",i.xd,i.yd])}return OrgChart.roundPathCorners(o,OrgChart.LINK_ROUNDED_CORNERS,!1)}return null}},void 0===OrgChart&&(OrgChart={}),OrgChart._validateConfig=function(t){return!!t||(console.error("config is not defined"),!1)},OrgChart._arrayContains=function(t,e){if(t&&Array.isArray(t))for(var r=t.length;r--;)if(t[r]===e)return!0;return!1},OrgChart._interceptions=function(t,e){if(!t)return[];if(!e)return[];var r=[];if(Array.isArray(t)&&Array.isArray(e))for(var i in t)for(var n in e)t[i]==e[n]&&r.push(t[i]);else if(Array.isArray(t)&&!Array.isArray(e))for(var i in t)for(var n in e)t[i]==n&&r.push(t[i]);else if(!Array.isArray(t)&&Array.isArray(e))for(var i in t)for(var n in e)i==e[n]&&r.push(e[n]);return r},OrgChart._getTags=function(t){return t.tags&&!Array.isArray(t.tags)?t.tags.split(","):t.tags&&Array.isArray(t.tags)?t.tags:[]},OrgChart._centerPointInPercent=function(t,e,r){var i=t.getBoundingClientRect(),n=e-i.left,a=r-i.top;return[n/(i.width/100),a/(i.height/100)]},OrgChart._trim=function(t){return t.replace(/^\s+|\s+$/g,"")},OrgChart._getTransform=function(t){var e=t.getAttribute("transform");return e=e.replace("matrix","").replace("(","").replace(")",""),OrgChart._browser().msie&&(e=e.replace(/ /g,",")),e="["+(e=OrgChart._trim(e))+"]",e=JSON.parse(e)},OrgChart.getScale=function(t,e,r,i,n,a,o,s){var l=1;if(t||i!==OrgChart.match.boundary)if(t||i!==OrgChart.match.width)if(t||i!==OrgChart.match.height)if(t){var h,c;l=(h=e/t[2])>(c=r/t[3])?c:h}else l=i;else l=r/s;else l=e/o;else l=(h=e/o)>(c=r/s)?c:h;return l&&l>n&&(l=n),l&&l<a&&(l=a),l},OrgChart.isObject=function(t){return t&&"object"==typeof t&&!Array.isArray(t)&&null!==t&&t.constructor&&"object"==t.constructor.name.toLowerCase()},OrgChart.fileUploadDialog=function(t){var e=document.createElement("INPUT");e.setAttribute("type","file"),e.style.display="none",e.onchange=function(){var e=this.files[0];t(e)},document.body.appendChild(e),e.click()},OrgChart.mergeDeep=function(t,e){if(OrgChart.isObject(t)&&OrgChart.isObject(e))for(var r in e)OrgChart.isObject(e[r])?(t[r]||Object.assign(t,{[r]:{}}),OrgChart.mergeDeep(t[r],e[r])):Object.assign(t,{[r]:e[r]});return t},OrgChart._lblIsImg=function(t,e){return!(!t.nodeBinding||"string"!=typeof e||-1==e.indexOf("img")||!t.nodeBinding[e])},OrgChart._getFistImgField=function(t){if(t.nodeBinding)for(var e in t.nodeBinding)if(-1!=e.indexOf("img"))return t.nodeBinding[e];return!1},OrgChart._fieldIsImg=function(t,e){if(t.nodeBinding)for(var r in t.nodeBinding)if(t.nodeBinding[r]==e)return OrgChart._lblIsImg(t,r);return!1},OrgChart._guid=function(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},OrgChart.htmlRipple=function(t){var e=document.createElement("style");e.type="text/css",e.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(e);var r,i,n,a=document.createElement("div");a.className="boc-ripple-container",t.addEventListener("mousedown",(function(e){var r,i,n,a,o;return i=document.createElement("span"),n=this.offsetWidth,r=this.getBoundingClientRect(),o=e.pageX-r.left-n/2,a="top:"+(e.pageY-r.top-n/2)+"px; left: "+o+"px; height: "+n+"px; width: "+n+"px;",t.rippleContainer.appendChild(i),i.setAttribute("style",a)})),t.addEventListener("mouseup",(r=function(){for(;this.rippleContainer.firstChild;)this.rippleContainer.removeChild(this.rippleContainer.firstChild)},i=2e3,n=void 0,function(){var t,e;return e=this,t=arguments,clearTimeout(n),n=setTimeout((function(){return r.apply(e,t)}),i)})),t.rippleContainer=a,t.appendChild(a)},OrgChart._moveToBoundaryArea=function(t,e,r,i){var n=e.slice(0);e[0]<r.left&&e[0]<r.right&&(n[0]=r.left>r.right?r.right:r.left),e[0]>r.right&&e[0]>r.left&&(n[0]=r.left>r.right?r.left:r.right),e[1]<r.top&&e[1]<r.bottom&&(n[1]=r.top>r.bottom?r.bottom:r.top),e[1]>r.bottom&&e[1]>r.top&&(n[1]=r.top>r.bottom?r.top:r.bottom),e[0]!==n[0]||e[1]!==n[1]?OrgChart.animate(t,{viewBox:e},{viewBox:n},300,OrgChart.anim.outPow,(function(){i&&i()})):i&&i()},OrgChart.randomId=function(){return"_"+("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4)},OrgChart._getClientXY=function(t){return-1==t.type.indexOf("touch")?{x:t.clientX,y:t.clientY}:t.changedTouches.length?{x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY}:void 0},OrgChart._getClientTouchesXY=function(t,e){return-1!=t.type.indexOf("touch")?t.touches.length<e+1?{x:null,y:null}:{x:t.touches[e].clientX,y:t.touches[e].clientY}:{x:t.clientX,y:t.clientY}},OrgChart._getOffset=function(t,e){t&&(e.x+=t.offsetLeft,e.y+=t.offsetTop,OrgChart._getOffset(t.offsetParent,e))},OrgChart._getTopLeft=function(t){var e={x:0,y:0};return OrgChart._getOffset(t,e),e},OrgChart._getOffsetXY=function(t,e){if(-1==e.type.indexOf("touch"))return{x:e.offsetX,y:e.offsetY};if(e.touches.length){var r=OrgChart._getTopLeft(t);return{x:e.touches[0].pageX-r.x,y:e.touches[0].pageY-r.y}}if(e.changedTouches.length){r=OrgChart._getTopLeft(t);return isNaN(r.x)||isNaN(r.y)?{x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}:{x:e.changedTouches[0].pageX-r.x,y:e.changedTouches[0].pageY-r.y}}},OrgChart._pinchMiddlePointInPercent=function(t,e,r,i){var n=OrgChart._getTopLeft(t),a=i.touches[0].pageX-n.x,o=i.touches[0].pageY-n.y,s=i.touches[1].pageX-n.x,l=i.touches[1].pageY-n.y;return[((a-s)/2+s)/(e/100),((o-l)/2+l)/(r/100)]},OrgChart._browser=function(){var t=!!window.opr&&!!window.opr.addons||!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,e="undefined"!=typeof InstallTrigger,r=/constructor/i.test(window.HTMLElement)||"[object SafariRemoteNotification]"===(!window.safari||void 0!==window.safari&&safari.pushNotification).toString(),i=!!document.documentMode,n=!i&&!!window.StyleMedia,a=!(!window.chrome||!window.chrome.webstore&&!window.chrome.runtime);return{opera:t,firefox:e,safari:r,msie:i,edge:n,chrome:a,blink:(a||t)&&!!window.CSS}},OrgChart._menuPosition=function(t,e,r){var i=t.getBoundingClientRect(),n=r.getBoundingClientRect(),a=e.getBoundingClientRect(),o=i.left-n.left,s=i.top-n.top;return i.top+a.height>n.top+n.height&&(s-=a.height),i.left-a.width<n.left&&(o+=a.width),{x:o,y:s}},OrgChart._getTemplate=function(t,e,r){if(Array.isArray(t))for(var i=0;i<t.length;i++){var n=e[t[i]];if(n&&n.template)return n.template}return r},OrgChart._getMin=function(t,e){if(t.tags&&t.tags.length&&e.tags)for(var r=0;r<t.tags.length;r++){var i=e.tags[t.tags[r]];if(i&&!0===i.min)return!0}return e.min},OrgChart._getSubLevels=function(t,e){if(t&&t.length)for(var r=0;r<t.length;r++){var i=e[t[r]];if(i&&i.subLevels)return i.subLevels}return 0},OrgChart._isHTML=function(t){var e=(new DOMParser).parseFromString(t,"text/html");return Array.from(e.body.childNodes).some((t=>1===t.nodeType))},OrgChart._getTestDiv=function(){var t=document.getElementById("orgchart_js_test_div");return t||((t=document.createElement("div")).id="orgchart_js_test_div",t.style.position="fixed",t.style.top="-10000px",t.style.left="-10000px",document.body.appendChild(t)),t},OrgChart._getLabelSize=function(t){var e=OrgChart._getTestDiv();return e.innerHTML="<svg>"+t+"</svg>",e.querySelector("text").getBoundingClientRect()},OrgChart.wrapText=function(t,e){var r=e.toLowerCase();if(-1==r.indexOf("<text"))return OrgChart._escapeHtml(t);if(-1==r.indexOf(OrgChart.attr.width))return OrgChart._escapeHtml(t);if(-1!=r.indexOf("foreignobject"))return OrgChart._escapeHtml(t);if(-1==e.indexOf(OrgChart.attr.width))return OrgChart._escapeHtml(t);if(OrgChart.ESCAPE_HTML&&"string"==typeof str&&OrgChart._isHTML(t))return OrgChart._escapeHtml(t);if(!OrgChart.ESCAPE_HTML&&OrgChart._isHTML(t))return t;var i=OrgChart._getTestDiv();e=e.replaceAll("{cw}",0),i.innerHTML="<svg>"+e+"</svg>";var n,a,o=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("text")[0],s=parseFloat(o.getAttribute("x")),l=parseFloat(o.getAttribute("y")),h=o.getAttribute("text-anchor"),c=o.getAttribute(OrgChart.attr.width),d=o.getAttribute(OrgChart.attr.text_overflow),g="http://www.w3.org/2000/svg",p=i.getElementsByTagName("svg")[0].getElementsByTagName("text")[0];d||(d="ellipsis");var u=d.split("-");if(u.length>1&&(n=parseInt(d.split("-")[1]),u.length>2&&"ellipsis"==u[2]&&(a=!0)),!c)return OrgChart._escapeHtml(t);if(c=parseFloat(c),s||(s=0),l||(l=0),s||(h="start"),"ellipsis"==d){p.removeChild(p.firstChild),p.textContent=t;for(var f=p.getComputedTextLength(),m=2;f>c;)p.textContent=t.substring(0,t.length-m),p.textContent+="...",f=p.getComputedTextLength(),m++;return m>2?`<title>${OrgChart._escapeHtml(t)}</title>${p.textContent}`:OrgChart._escapeHtml(t)}if(-1!=d.indexOf("multiline")){var C=t.split(" "),b=p.getBBox().height;p.textContent="";var v=document.createElementNS(g,"tspan"),O=document.createTextNode(C[0]);v.setAttributeNS(null,"x",s),v.setAttributeNS(null,"y",l),v.setAttributeNS(null,"text-anchor",h),v.appendChild(O),p.appendChild(v);m=1;for(var x=1,y=!1,_=1;_<C.length;_++){var k=v.firstChild.data.length;if(v.firstChild.data+=" "+C[_],v.getComputedTextLength()>c){if(v.firstChild.data=v.firstChild.data.slice(0,k),x++,n&&x>n){if(a&&p.children.length==n){var w=p.children[n-1].textContent;p.children[n-1].textContent=w.substring(0,w.length-3)+"...",y=!0}break}(v=document.createElementNS(g,"tspan")).setAttributeNS(null,"x",s),v.setAttributeNS(null,"y",l+b*m),v.setAttributeNS(null,"text-anchor",h),O=document.createTextNode(C[_]),v.appendChild(O),p.appendChild(v),m++}}var S="";if(null!=p.innerHTML)S=p.innerHTML,p.innerHTML="";else{var I="";for(_=p.childNodes.length-1;_>=0;_--)I=XMLSerializer().serializeToString(p.childNodes[_])+I,p.removeChild(p.childNodes[_]);S=I}return y?`<title>${OrgChart._escapeHtml(t)}</title>${S}`:S}},OrgChart._downloadFile=function(t,e,r,i,n){var a=new Blob([e],{type:t});if(1==i){var o=URL.createObjectURL(a);window.open(o,"_blank").focus()}else if(navigator.msSaveBlob)navigator.msSaveBlob(a,r);else{var s=document.createElement("a");if(void 0!==s.download){o=URL.createObjectURL(a);s.setAttribute("href",o);var l=r;l.toLowerCase().endsWith(n.toLowerCase())||(l=l+"."+n),s.setAttribute("download",l),s.style.visibility="hidden",document.body.appendChild(s),s.click(),document.body.removeChild(s)}}},OrgChart._getPosition=function(t,e,r,i){var n={x:e.x,y:e.y};if(null!=r&&(n.x=r),null!=i&&(n.y=r),t&&3==t.length){var a=t[0].indexOf(e.id);-1!=a&&null!=t[1][a].transform&&(null==r&&(n.x=t[1][a].transform[4]),null==i&&(n.y=t[1][a].transform[5]))}return n},OrgChart._getOpacity=function(t,e){var r=1;if(t&&3==t.length){var i=t[0].indexOf(e.id);-1!=i&&null!=t[1][i].opacity&&(r=t[1][i].opacity)}return r},OrgChart.t=function(t,e,r){var i=OrgChart.templates[t];null==i&&console.error(`Template "${t}" does not exist!`);var n=null;if(null!=r&&i.scaleLessThen){var a=[];for(var o in i.scaleLessThen){var s=parseFloat(o);r<s&&a.push(s)}if(a.length>0){a.sort((function(t,e){return t-e}));var l=i.scaleLessThen[a[0]];for(var h in l)null==n&&(n=Object.assign({},i)),n[h]=l[h]}}return e?null==n?i.min?i.min:i:n.min?n.min:n:null==n?i:n},OrgChart.setNodeSize=function(t){var e=OrgChart.t(t.templateName,t.min);t.w=e&&e.size?e.size[0]:0,t.h=e&&e.size?e.size[1]:0},OrgChart._imgs2base64=function(t,e,r,i){var n=t.getElementsByTagName(e),a=n.length;0==a&&i();for(var o=0;o<a;o++)!function(){var t=o,e=n[t];OrgChart._getDataUri(e.getAttribute(r),(function(n){n.success&&e.setAttribute(r,n.result),t==a-1&&i()}))}()},OrgChart._getDataUri=function(t,e){if(-1!=t.indexOf("base64"))e({success:!1});else{var r=new XMLHttpRequest;r.open("GET",t),r.responseType="blob",r.onload=function(){200===r.status?i.readAsDataURL(r.response):404===r.status&&e({success:!1,result:r.status})};var i=new FileReader;i.onloadend=function(){e({success:!0,result:i.result})},r.send()}},OrgChart._convertStringToArray=function(t,e){return-1!=OrgChart.ARRAY_FIELDS.indexOf(t)?OrgChart.isNEU(e)?[]:e.split(","):e},OrgChart._convertArrayToString=function(t){return!OrgChart.isNEU(t)&&Array.isArray(t)?t.join():t},OrgChart._csvToArray=function(t,e){e=e||OrgChart.CSV_DELIMITER;for(var r=new RegExp("(\\"+e+'|\\r?\\n|\\r|^)(?:"([^"]*(?:""[^"]*)*)"|([^"\\'+e+"\\r\\n]*))","gi"),i=[[]],n=null;n=r.exec(t);){var a,o=n[1];o.length&&o!==e&&i.push([]),a=n[2]?n[2].replace(new RegExp('""',"g"),'"'):n[3],i[i.length-1].push(a)}return i},OrgChart._json2xml=function(t){for(var e=document.implementation.createDocument("","",null),r=e.createElement("nodes"),i=0;i<t.length;i++){var n=e.createElement("node"),a=t[i];for(var o in a){var s=a[o];n.setAttribute(o,OrgChart._convertArrayToString(s))}r.appendChild(n)}return e.appendChild(r),'<?xml version="1.0" encoding="utf-8" ?>'+(new XMLSerializer).serializeToString(e.documentElement)},OrgChart._xml2json=function(t){for(var e=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("node"),r=[],i=0;i<e.length;i++){for(var n=e[i],a={},o=0;o<n.attributes.length;o++){var s=n.attributes[o];a[s.name]=OrgChart._convertStringToArray(s.name,s.value)}r.push(a)}return r},OrgChart.convertNodesToCsv=function(t){return OrgChart._json2csv(t)},OrgChart._json2csv=function(t){for(var e=[],r=function(t){for(var r="",i=0;i<e.length;i++){var n;(n="reportsTo"==e[i]?null:null==t[e[i]]?"":t[e[i]])instanceof Date&&(n=n.toLocaleString());var a=(n=null===n?"":n.toString()).replace(/"/g,'""'),o=new RegExp('("|;|\n)',"g");a.search(o)>=0&&(a='"'+a+'"'),i>0&&(r+=OrgChart.CSV_DELIMITER),r+=a}return r+"\n"},i="",n=0;n<t.length;n++)for(var a in t[n])OrgChart._arrayContains(e,a)||(e.push(a),i+=a+OrgChart.CSV_DELIMITER);i=i.substring(0,i.length-1),i+="\n";for(n=0;n<t.length;n++)i+=r(t[n]);return i=i.substring(0,i.length-1)},OrgChart.accentFold=function(t){return(t=t.toString().toLowerCase()).replace(/([àáâãäå])|([ç])|([èéêë])|([ìíîï])|([ñ])|([òóôõöø])|([ß])|([ùúûü])|([ÿ])|([æ])/g,(function(t,e,r,i,n,a,o,s,l,h,c){return e?"a":r?"c":i?"e":n?"i":a?"n":o?"o":s?"s":l?"u":h?"y":c?"ae":void 0}))},OrgChart.copy=function(t){if(null===t||"object"!=typeof t||"isActiveClone"in t)return t;if(t instanceof Date)var e=new t.constructor;else e=t.constructor();for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t.isActiveClone=null,e[r]=OrgChart.copy(t[r]),delete t.isActiveClone);return e},OrgChart._getScrollSensitivity=function(){var t=OrgChart._browser();return t.msie&&OrgChart.scroll.ie?OrgChart.scroll.ie:t.edge&&OrgChart.scroll.edge?OrgChart.scroll.edge:t.safari&&OrgChart.scroll.safari?OrgChart.scroll.safari:t.chrome&&OrgChart.scroll.chrome?OrgChart.scroll.chrome:t.firefox&&OrgChart.scroll.firefox?OrgChart.scroll.firefox:t.opera&&OrgChart.scroll.opera?OrgChart.scroll.opera:{smooth:OrgChart.scroll.smooth,speed:OrgChart.scroll.speed}},OrgChart.isMobile=function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},OrgChart.isTrial=function(){return void 0!==OrgChart.remote},OrgChart.childrenCount=function(t,e){for(var r=0,i=0;i<e.childrenIds.length;i++){t.nodes[e.childrenIds[i]]&&r++}return r},OrgChart.childrenTotalCount=function(t,e){for(var r=0,i=0;i<e.childrenIds.length;i++){var n=t.nodes[e.childrenIds[i]];n&&(r++,r+=OrgChart.childrenTotalCount(t,n))}return r},OrgChart.collapsedChildrenCount=function(t,e){for(var r=0,i=0;i<e.childrenIds.length;i++){var n=t.nodes[e.childrenIds[i]];n&&!0===n.collapsed&&r++}return r},OrgChart.collapsedChildrenTotalCount=function(t,e,r){for(var i=0,n=0;n<e.childrenIds.length;n++){var a=t.nodes[e.childrenIds[n]];a&&((r||!0===a.collapsed)&&i++,i+=OrgChart.collapsedChildrenTotalCount(t,a,!0))}return i},OrgChart._setMinMaxXY=function(t,e){(null==e.minX||null!=t.x&&t.x<e.minX)&&(e.minX=t.x),(null==e.minY||null!=t.y&&t.y<e.minY)&&(e.minY=t.y),(null==e.maxX||null!=t.x&&t.x+t.w>e.maxX)&&(e.maxX=t.x+t.w),(null==e.maxY||null!=t.y&&t.y+t.h>e.maxY)&&(e.maxY=t.y+t.h)},OrgChart.getStParentNodes=function(t,e){for(e||(e=[]);t.parent;)t=t.parent;return t.stParent&&(e.push(t.stParent),OrgChart.getStParentNodes(t.stParent,e)),e},OrgChart.getRootOf=function(t){for(;t&&t.parent;)t=t.parent;return t},OrgChart._getViewBox=function(t){var e=null;return t?(e=(e="["+(e=t.getAttribute("viewBox"))+"]").replace(/\ /g,","),e=JSON.parse(e)):null},OrgChart.isNEU=function(t){return null==t||""===t},OrgChart.gradientCircleForDefs=function(t,e,r,i){function n(t,e,r,i){var n=(i-90)*Math.PI/180;return{x:t+r*Math.cos(n),y:e+r*Math.sin(n)}}function a(t,e,r,i,a){var o=n(t,e,r,a),s=n(t,e,r,i),l=a-i<=180?"0":"1";return["M",o.x,o.y,"A",r,r,0,l,0,s.x,s.y].join(" ")}return Array.isArray(e)||(e=[e,e,e,e,e,e]),`<linearGradient id="${t}_linearColors1" x1="0" y1="0" x2="1" y2="1">\n <stop offset="0%" stop-color="${e[0]}"></stop>\n <stop offset="100%" stop-color="${e[1]}"></stop>\n </linearGradient>\n <linearGradient id="${t}_linearColors2" x1="0.5" y1="0" x2="0.5" y2="1">\n <stop offset="0%" stop-color="${e[1]}"></stop>\n <stop offset="100%" stop-color="${e[2]}"></stop>\n </linearGradient>\n <linearGradient id="${t}_linearColors3" x1="1" y1="0" x2="0" y2="1">\n <stop offset="0%" stop-color="${e[2]}"></stop>\n <stop offset="100%" stop-color="${e[3]}"></stop>\n </linearGradient>\n <linearGradient id="${t}_linearColors4" x1="1" y1="1" x2="0" y2="0">\n <stop offset="0%" stop-color="${e[3]}"></stop>\n <stop offset="100%" stop-color="${e[4]}"></stop>\n </linearGradient>\n <linearGradient id="${t}_linearColors5" x1="0.5" y1="1" x2="0.5" y2="0">\n <stop offset="0%" stop-color="${e[4]}"></stop>\n <stop offset="100%" stop-color="${e[5]}"></stop>\n </linearGradient>\n <linearGradient id="${t}_linearColors6" x1="0" y1="1" x2="1" y2="0">\n <stop offset="0%" stop-color="${e[5]}"></stop>\n <stop offset="100%" stop-color="${e[0]}"></stop>\n </linearGradient> \n <g id="${t}">\n <path stroke-width="${i}" fill="none" stroke="url(#${t}_linearColors1)" d="${a(r,r,r,1,60)}" />\n <path stroke-width="${i}" fill="none" stroke="url(#${t}_linearColors2)" d="${a(r,r,r,60,120)}"/>\n <path stroke-width="${i}" fill="none" stroke="url(#${t}_linearColors3)" d="${a(r,r,r,120,180)}" />\n <path stroke-width="${i}" fill="none" stroke="url(#${t}_linearColors4)" d="${a(r,r,r,180,240)}" />\n <path stroke-width="${i}" fill="none" stroke="url(#${t}_linearColors5)" d="${a(r,r,r,240,300)}" />\n <path stroke-width="${i}" fill="none" stroke="url(#${t}_linearColors6)" d="${a(r,r,r,300,1)}"/>\n </g>`},OrgChart._intersectionObserver=function(t,e){"function"==typeof IntersectionObserver?new IntersectionObserver((function(t,r){t.forEach((function(t){var r=t.intersectionRatio>0;0==t.intersectionRatio&&(r=t.isIntersecting),e(r)}))})).observe(t):e(!0)},OrgChart.convertCsvToNodes=function(t){for(var e=OrgChart._csvToArray(t),r=e[0],i=[],n=1;n<e.length;n++){for(var a={},o=0;o<e[n].length;o++){var s=r[o],l=e[n][o];a[r[o]]=OrgChart._convertStringToArray(s,l)}""!=a.id.trim()&&i.push(a)}return i},OrgChart._escapeHtml=function(t){return OrgChart.ESCAPE_HTML&&"string"==typeof t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):t},OrgChart._escapeDoubleQuotes=function(t){return"string"==typeof t?t.replace(/"/g,"""):t},OrgChart._escapeGreaterLessSign=function(t){return"string"==typeof t?t.replace(/</g,"<").replace(/>/g,">"):t},OrgChart.roundPathCorners=function(t,e,r){function i(t,e,r){var i=e.x-t.x,a=e.y-t.y,o=Math.sqrt(i*i+a*a);return n(t,e,Math.min(1,r/o))}function n(t,e,r){return{x:t.x+(e.x-t.x)*r,y:t.y+(e.y-t.y)*r}}function a(t,e){t.length>2&&(t[t.length-2]=e.x,t[t.length-1]=e.y)}function o(t){return{x:parseFloat(t[t.length-2]),y:parseFloat(t[t.length-1])}}Array.isArray(t)||(t=(t=t.split(/[,\s]/).reduce((function(t,e){var r=e.match("([a-zA-Z])(.+)");return r?(t.push(r[1]),t.push(r[2])):t.push(e),t}),[])).reduce((function(t,e){return parseFloat(e)==e&&t.length?t[t.length-1].push(e):t.push([e]),t}),[]));var s=[];if(t.length>1){var l=o(t[0]),h=null;"Z"==t[t.length-1][0]&&t[0].length>2&&(h=["L",l.x,l.y],t[t.length-1]=h),s.push(t[0]);for(var c=1;c<t.length;c++){var d=s[s.length-1],g=t[c],p=g==h?t[1]:t[c+1];if(p&&d&&d.length>2&&"L"==g[0]&&p.length>2&&"L"==p[0]){var u,f,m=o(d),C=o(g),b=o(p);r?(u=n(C,d.origPoint||m,e),f=n(C,p.origPoint||b,e)):(u=i(C,m,e),f=i(C,b,e)),a(g,u),g.origPoint=C,s.push(g);var v=n(u,C,.5),O=n(C,f,.5),x=["C",v.x,v.y,O.x,O.y,f.x,f.y];x.origPoint=C,s.push(x)}else s.push(g)}if(h){var y=o(s[s.length-1]);s.push(["Z"]),a(s[0],y)}}else s=t;return s.reduce((function(t,e){return t+e.join(" ")+" "}),"")},OrgChart._isMoved=function(t){return null!=t.movex||null!=t.movey},OrgChart._getDynamicGridCoulumns=function(t){for(var e=1;e<t&&!(t/e-e<=0);e++);return e%2!=0&&e>2&&e--,e},OrgChart._getLazyLoading=function(t){var e=t.lazyLoading;return"auto"==e&&(e=!!(t&&t.nodes&&t.nodes.length>700)),e},OrgChart.xScrollUI=function(t,e,r,i,n){this.element=t,this.requestParams=r,this.config=e,this.onSetViewBoxCallback=i,this.onDrawCallback=n,this.position=0,this.bar=null,this._event_id=OrgChart._guid()},OrgChart.xScrollUI.prototype.addListener=function(t){var e=this;if((this.config.mouseScrool==OrgChart.action.xScroll||this.config.mouseScrool==OrgChart.action.scroll)&&this.bar){var r=-1!==navigator.userAgent.indexOf("Mac OS"),i=OrgChart._getScrollSensitivity();!function(t,i,n){var a=!1;function o(){a=!0;var t=(e.position-e.bar.scrollLeft)/n;if(t>0)t++;else{if(0==t)return void(a=!1);t--}Math.ceil(e.bar.scrollLeft)==Math.ceil(e.position)?a=!1:(e.bar.scrollLeft+=t,s(o))}t.addEventListener("wheel",(function(t){if(t.ctrlKey)return;var n=0;if(e.config.mouseScrool==OrgChart.action.xScroll)(n=t.deltaX||t.wheelDeltaX)||(n=t.deltaY||t.wheelDeltaY);else if(e.config.mouseScrool==OrgChart.action.scroll&&!(n=r||!t.shiftKey?t.deltaX||t.wheelDeltaX:t.deltaY||t.wheelDeltaY))return;n=-n,n=Math.max(-1,Math.min(1,n)),e.position+=-n*i;var s=parseFloat(e.innerBar.clientWidth)-parseFloat(e.bar.clientWidth);e.position<0&&(e.position=0);e.position>s&&(e.position=s);a||o()}),{passive:!0});var s=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,20)}}(t,i.speed,i.smooth)}},OrgChart.xScrollUI.prototype.create=function(t){if(!0===this.config.showXScroll||this.config.mouseScrool===OrgChart.action.scroll||this.config.mouseScrool===OrgChart.action.xScroll){var e=this;this.bar&&this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),this.bar=document.createElement("div"),this.innerBar=document.createElement("div");this.requestParams();this.innerBar.innerHTML=" ",Object.assign(this.bar.style,{position:"absolute",left:0,bottom:0,width:t+"px","overflow-x":"scroll",height:"20px"}),this.element.appendChild(this.bar),this.bar.appendChild(this.innerBar),this.bar.addEventListener("scroll",(function(){if(this.ignore)this.ignore=!1;else{var t=e.requestParams(),r=(parseFloat(e.innerBar.clientWidth)-parseFloat(e.bar.clientWidth))/100,i=this.scrollLeft/r,n=(t.boundary.right-t.boundary.left)/100;t.viewBox[0]=i*n+t.boundary.left,e.onSetViewBoxCallback(t.viewBox),clearTimeout(this._timeout),this._timeout=setTimeout((function(){e.onDrawCallback()}),500)}}))}},OrgChart.xScrollUI.prototype.setPosition=function(){if(this.bar){var t=this.requestParams(),e=(Math.abs(t.boundary.maxX-t.boundary.minX)+2*this.config.padding)*t.scale;switch(this.config.orientation){case OrgChart.orientation.right:case OrgChart.orientation.right_top:e=Math.abs(t.boundary.minX*t.scale)}this.innerBar.style.width=e+"px";var r=(t.boundary.right-t.boundary.left)/100,i=(t.viewBox[0]-t.boundary.left)/r;i<0?i=0:i>100&&(i=100);var n=(parseFloat(this.innerBar.clientWidth)-parseFloat(this.bar.clientWidth))/100,a=i*n;this.bar.ignore=!0,this.bar.scrollLeft=a,this.position=this.bar.scrollLeft,this.bar.style.visibility=n<=0?"hidden":"",!0!==this.config.showXScroll&&(this.bar.style.visibility="hidden"),OrgChart.events.publish("change",[this,{isScrollBarVisible:"hidden"!=this.bar.style.visibility}])}},OrgChart.xScrollUI.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},OrgChart.yScrollUI=function(t,e,r,i,n){this.element=t,this.requestParams=r,this.config=e,this.onSetViewBoxCallback=i,this.onDrawCallback=n,this.position=0,this.bar=null,this._event_id=OrgChart._guid()},OrgChart.yScrollUI.prototype.addListener=function(t){var e=this;if((this.config.mouseScrool==OrgChart.action.yScroll||this.config.mouseScrool==OrgChart.action.scroll)&&this.bar){var r=-1!==navigator.userAgent.indexOf("Mac OS"),i=OrgChart._getScrollSensitivity();!function(t,i,n){var a=!1;function o(){a=!0;var t=(e.position-e.bar.scrollTop)/n;if(t>0)t++;else{if(0==t)return void(a=!1);t--}Math.ceil(e.bar.scrollTop)==Math.ceil(e.position)?a=!1:(e.bar.scrollTop+=t,s(o))}t.addEventListener("wheel",(function(t){if(t.ctrlKey)return;var n=0;if(e.config.mouseScrool==OrgChart.action.yScroll)(n=t.deltaY||t.wheelDeltaY)||(n=t.deltaX||t.wheelDeltaX);else if(e.config.mouseScrool==OrgChart.action.scroll&&!(n=r||!t.shiftKey?t.deltaY||t.wheelDeltaY:t.deltaX||t.wheelDeltaX))return;n=-n,n=Math.max(-1,Math.min(1,n)),e.position+=-n*i;var s=parseFloat(e.innerBar.clientHeight)-parseFloat(e.bar.clientHeight);e.position<0&&(e.position=0);e.position>s&&(e.position=s);a||o()}),{passive:!0});var s=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,20)}}(t,i.speed,i.smooth)}},OrgChart.yScrollUI.prototype.create=function(t){if(!0===this.config.showYScroll||this.config.mouseScrool===OrgChart.action.scroll||this.config.mouseScrool===OrgChart.action.yScroll){var e=this;this.bar&&this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),this.bar=document.createElement("div"),this.innerBar=document.createElement("div"),this.innerBar.innerHTML=" ",Object.assign(this.bar.style,{position:"absolute",right:0,bottom:0,height:t+"px","overflow-y":"scroll",width:"20px"}),this.element.appendChild(this.bar),this.bar.appendChild(this.innerBar),this.bar.addEventListener("scroll",(function(){if(this.ignore)this.ignore=!1;else{var t=e.requestParams(),r=(parseFloat(e.innerBar.clientHeight)-parseFloat(e.bar.clientHeight))/100,i=this.scrollTop/r,n=(t.boundary.bottom-t.boundary.top)/100;t.viewBox[1]=i*n+t.boundary.top,e.onSetViewBoxCallback(t.viewBox),clearTimeout(this._timeout),this._timeout=setTimeout((function(){e.onDrawCallback()}),500)}}))}},OrgChart.yScrollUI.prototype.setPosition=function(){if(this.bar){var t=this.requestParams(),e=(Math.abs(t.boundary.maxY-t.boundary.minY)+2*this.config.padding)*t.scale;switch(this.config.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:e=Math.abs(t.boundary.minY*t.scale)}this.innerBar.style.height=e+"px";var r=(t.boundary.bottom-t.boundary.top)/100,i=(t.viewBox[1]-t.boundary.top)/Math.abs(r);i<0?i=0:i>100&&(i=100);var n=(parseFloat(this.innerBar.clientHeight)-parseFloat(this.bar.clientHeight))/100,a=i*n;this.bar.ignore=!0,this.bar.scrollTop=a,this.position=this.bar.scrollTop,this.bar.style.visibility=n<=0?"hidden":"",!0!==this.config.showYScroll&&(this.bar.style.visibility="hidden"),OrgChart.events.publish("change",[this,{isScrollBarVisible:"hidden"!=this.bar.style.visibility}])}},OrgChart.yScrollUI.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},OrgChart.prototype.zoom=function(t,e,r,i){var n=this.getViewBox().slice(0),a=n,o=n[2],s=n[3];!0===t?(n[2]=n[2]/OrgChart.SCALE_FACTOR,n[3]=n[3]/OrgChart.SCALE_FACTOR):!1===t?(n[2]=n[2]*OrgChart.SCALE_FACTOR,n[3]=n[3]*OrgChart.SCALE_FACTOR):(n[2]=n[2]/t,n[3]=n[3]/t),e||(e=[50,50]),n[0]=a[0]-(n[2]-o)/(100/e[0]),n[1]=a[1]-(n[3]-s)/(100/e[1]);var l=this.getScale(n);if(n[2]=this.width()/l,n[3]=this.height()/l,!0===t&&l<this.config.scaleMax||!1===t&&l>this.config.scaleMin||0!=t&&1!=t&&l<this.config.scaleMax&&l>this.config.scaleMin){this._hideBeforeAnimation();var h=this;r?(clearTimeout(h._timeout),OrgChart.animate(this.getSvg(),{viewbox:this.getViewBox()},{viewbox:n},this.config.anim.duration,this.config.anim.func,(function(){clearTimeout(h._timeout),h._timeout=setTimeout((function(){h._draw(!0,OrgChart.action.zoom,null,i)}),500)}))):(this.setViewBox(n),clearTimeout(h._timeout),h._timeout=setTimeout((function(){h._draw(!0,OrgChart.action.zoom,null,i)}),500))}},OrgChart.loading={},OrgChart.loading.show=function(t){var e=document.createElement("div");e.id="boc-loading",e.innerHTML='<style>@-webkit-keyframes dot-keyframes {0% { opacity: .4; -webkit-transform: scale(1, 1);transform: scale(1, 1);}50% {opacity: 1;-webkit-transform: scale(1.2, 1.2);transform: scale(1.2, 1.2);}100% {opacity: .4;-webkit-transform: scale(1, 1);transform: scale(1, 1);}}@keyframes dot-keyframes {0% {opacity: .4;-webkit-transform: scale(1, 1);transform: scale(1, 1);}50% {opacity: 1;-webkit-transform: scale(1.2, 1.2);transform: scale(1.2, 1.2);}100% {opacity: .4;-webkit-transform: scale(1, 1);transform: scale(1, 1);}}.boc-loading-dots div {margin: 10px;} .boc-dot-1 {background-color: #039BE5;}.boc-dot-2 {background-color: #F57C00;}.boc-dot-3 {background-color: #FFCA28;} .boc-loading-dots {text-align: center;width: 100%; position: absolute; top: 0;}.boc-loading-dots--dot {-webkit-animation: dot-keyframes 1.5s infinite ease-in-out;animation: dot-keyframes 1.5s infinite ease-in-out; border-radius: 10px;display: inline-block;height: 10px;width: 10px;}.boc-loading-dots--dot:nth-child(2) {-webkit-animation-delay: .5s;animation-delay: .5s;}.boc-loading-dots--dot:nth-child(3) {-webkit-animation-delay: 1s;animation-delay: 1s;}</style><div class="boc-loading-dots"><div class="boc-loading-dots--dot boc-dot-1"></div><div class="boc-loading-dots--dot boc-dot-2"></div><div class="boc-loading-dots--dot boc-dot-3"></div></div>',t.element.appendChild(e)},OrgChart.loading.hide=function(t){var e=t.element.querySelector("#boc-loading");e&&e.parentNode.removeChild(e)},OrgChart.pdfPrevUI={},OrgChart.loc||(OrgChart.loc={}),OrgChart.loc.ppdfCmdTitle="PDF Preview",OrgChart.loc.ppdfSave="Save",OrgChart.loc.ppdfCancel="Cancel",OrgChart.loc.ppdfFormat="Format",OrgChart.loc.ppdfFitToDrwaing="Fit",OrgChart.loc.ppdfA4="A4",OrgChart.loc.ppdfA3="A3",OrgChart.loc.ppdfA2="A2",OrgChart.loc.ppdfA1="A1",OrgChart.loc.ppdfLetter="Letter",OrgChart.loc.ppdfLegal="Legal",OrgChart.loc.ppdfLayout="Layout",OrgChart.loc.ppdfPortrait="Portrait",OrgChart.loc.ppdfLandscape="Landscape",OrgChart.loc.ppdfFittopagewidth="Fit to page width",OrgChart.loc.ppdfMargin="Margin",OrgChart.loc.ppdfHeader="Header",OrgChart.loc.ppdfFooter="Footer",OrgChart.loc.ppdfScale="Scale",OrgChart.pdfPrevUI.show=function(t,e){OrgChart.pdfPrevUI.hide(t),e=t._defaultExportOptions(e,"pdf");var r=document.createElement("div");r.classList.add(t.config.mode),r.id="boc-ppdf-btns",Object.assign(r.style,{position:"absolute",top:0,left:0,"background-color":"#fff","z-index":5,margin:"0 0 0 -265px","box-shadow":"0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)",width:"265px",height:"100%","font-family":"Roboto,Helvetica",color:"#757575","text-align":"right",padding:"10px"}),t.element.appendChild(r),r.innerHTML="<h1>"+OrgChart.loc.ppdfCmdTitle+'</h1><div><button type="button" id="boc-prev-save" style="font-size: 14px; width: 90px;">'+OrgChart.loc.ppdfSave+'</button> <button type="button" id="boc-prev-cancel" style="width: 90px;font-size: 14px;">'+OrgChart.loc.ppdfCancel+'</button></div><div style="margin-top:30px; height:10px;border-bottom:1px solid #eeeeee;"></div><div style="padding-top:30px;"><label for="boc-size">'+OrgChart.loc.ppdfFormat+': </label><select id="boc-ppdf-size" style="color: #757575; width: 150px; font-size: 14px;" id="boc-size"><option value="fit">'+OrgChart.loc.ppdfFitToDrwaing+'</option><option value="A4">'+OrgChart.loc.ppdfA4+'</option><option value="A3">'+OrgChart.loc.ppdfA3+'</option><option value="A2">'+OrgChart.loc.ppdfA2+'</option><option value="A1">'+OrgChart.loc.ppdfA1+'</option><option value="Letter">'+OrgChart.loc.ppdfLetter+'</option><option value="Legal">'+OrgChart.loc.ppdfLegal+'</option></select></div><div style="padding-top:10px;"><label for="boc-ppdf-layout">'+OrgChart.loc.ppdfLayout+': </label><select id="boc-ppdf-layout" style="color: #757575; width: 150px;font-size: 14px;" ><option value="false">'+OrgChart.loc.ppdfPortrait+'</option><option value="true">'+OrgChart.loc.ppdfLandscape+'</option></select></div><div style="padding-top:10px;"><label for="boc-scale">'+OrgChart.loc.ppdfScale+': </label><select id="boc-ppdf-scale" style="color: #757575; width: 150px;font-size: 14px;" id="boc-scale"><option value="fit">'+OrgChart.loc.ppdfFittopagewidth+'</option><option value="10">10%</option><option value="20">20%</option><option value="30">30%</option><option value="40">40%</option><option value="50">50%</option><option value="60">60%</option><option value="70">70%</option><option value="80">80%</option><option value="90">90%</option><option value="100">100%</option><option value="110">110%</option><option value="120">120%</option><option value="130">130%</option><option value="140">140%</option><option value="150">150%</option><option value="160">160%</option><option value="170">170%</option><option value="180">180%</option><option value="190">190%</option><option value="200">200%</option></select></div><div style="margin-top:10px;margin-bottom:10px; height:10px;border-bottom:1px solid #eeeeee;"></div><div style="padding-top:10px;"><label for="boc-ppdf-header">'+OrgChart.loc.ppdfHeader+': </label><input id="boc-ppdf-header" type="text" style="color: #757575; width: 100px;font-size: 14px;" ></div><div style="padding-top:10px;"><label for="boc-ppdf-footer">'+OrgChart.loc.ppdfFooter+': </label><input id="boc-ppdf-footer" type="text" style="color: #757575; width: 100px;font-size: 14px;" ></div><div style="padding-top:10px;"><label for="boc-ppdf-margin">'+OrgChart.loc.ppdfMargin+': </label><input id="boc-ppdf-margin" type="text" style="color: #757575; width: 100px;font-size: 14px;" ></div>';var i=document.createElement("div");i.id="boc-ppdf-wrapper",Object.assign(i.style,{"overflow-y":"scroll","z-index":11,position:"absolute",top:0,left:"285px","background-color":"#eee",width:t.width()-270+"px",height:"100%"}),t.element.appendChild(i),i.innerHTML='<div id="boc-ppdf-content" style="width: 100%;margin-top:10px;margin-bottom:10px;opacity:0;"></div>';var n,a,o,s=t.element.querySelector("#boc-ppdf-size"),l=t.element.querySelector("#boc-ppdf-layout"),h=t.element.querySelector("#boc-ppdf-scale"),c=t.element.querySelector("#boc-ppdf-margin"),d=t.element.querySelector("#boc-ppdf-header"),g=t.element.querySelector("#boc-ppdf-footer");s.value=e.format,l.value=e.landscape,h.value=e.scale,c.value=e.margin,d.value=e.header,g.value=e.footer,OrgChart.animate(t.element.querySelector("#boc-ppdf-btns"),{margin:[0,0,0,-250]},{margin:[0,0,0,0]},300,OrgChart.anim.outSin,(function(){t.exportPDF(e,OrgChart.pdfPrevUI._handler)})),t.element.querySelector("#boc-prev-cancel").addEventListener("click",(function(){OrgChart.pdfPrevUI.hide(t)})),t.element.querySelector("#boc-prev-save").addEventListener("click",(function(){t.exportPDF(e),OrgChart.pdfPrevUI.hide(t)})),OrgChart.pdfPrevUI._showHide(s,l,h),s.addEventListener("change",(function(){OrgChart.animate(t.element.querySelector("#boc-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,(function(){t.element.querySelector("#boc-ppdf-content").innerHTML="",e.format=s.value,t.exportPDF(e,OrgChart.pdfPrevUI._handler),OrgChart.pdfPrevUI._showHide(s,l,h)}))})),l.addEventListener("change",(function(){OrgChart.animate(t.element.querySelector("#boc-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,(function(){t.element.querySelector("#boc-ppdf-content").innerHTML="",e.landscape="true"==l.value,t.exportPDF(e,OrgChart.pdfPrevUI._handler),OrgChart.pdfPrevUI._showHide(s,l,h)}))})),h.addEventListener("change",(function(){OrgChart.animate(t.element.querySelector("#boc-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,(function(){t.element.querySelector("#boc-ppdf-content").innerHTML="",e.scale=h.value,t.exportPDF(e,OrgChart.pdfPrevUI._handler),OrgChart.pdfPrevUI._showHide(s,l,h)}))})),c.addEventListener("keyup",(function(){clearTimeout(n),n=setTimeout((function(){OrgChart.animate(t.element.querySelector("#boc-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,(function(){t.element.querySelector("#boc-ppdf-content").innerHTML="";var r=c.value.split(",");if(4==r.length){for(var i=0;i<r.length;i++)r[i]=parseInt(r[i]);e.margin=r,t.exportPDF(e,OrgChart.pdfPrevUI._handler)}}))}),1e3)})),d.addEventListener("keyup",(function(){clearTimeout(a),a=setTimeout((function(){OrgChart.animate(t.element.querySelector("#boc-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,(function(){t.element.querySelector("#boc-ppdf-content").innerHTML="",e.header=d.value,t.exportPDF(e,OrgChart.pdfPrevUI._handler)}))}),1e3)})),g.addEventListener("keyup",(function(){clearTimeout(o),o=setTimeout((function(){OrgChart.animate(t.element.querySelector("#boc-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,(function(){t.element.querySelector("#boc-ppdf-content").innerHTML="",e.footer=g.value,t.exportPDF(e,OrgChart.pdfPrevUI._handler)}))}),1e3)}))},OrgChart.pdfPrevUI._showHide=function(t,e,r){"A4"==t.value||"A3"==t.value||"A2"==t.value||"A1"==t.value||"Letter"==t.value||"Legal"==t.value?(e.parentNode.style.display="block",r.parentNode.style.display="block"):(e.parentNode.style.display="none",r.parentNode.style.display="none")},OrgChart.pdfPrevUI._handler=function(t,e,r){var i=e.options,n=e.pages,a=i.margin[0],o=i.margin[2],s=document.createElement("div");s.classList.add(t.config.mode),s.innerHTML=r.outerHTML,OrgChart._browser().msie&&(s.innerHTML=(new XMLSerializer).serializeToString(r));for(var l=s.querySelector("svg"),h=t.element.querySelector("#boc-ppdf-content"),c=0;c<n.length;c++){var d=document.createElement("iframe");Object.assign(d.style,{display:"block",margin:"10px auto",border:"1px solid #eeeeee","box-shadow":"0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)"}),h.appendChild(d),l&&l.style.backgroundColor?d.style.backgroundColor=l.style.backgroundColor:d.style.backgroundColor="#fff";var g=d.contentWindow.document;g.open(),d.style.width=n[c].size.w+"px",d.style.height=n[c].size.h+"px",d.style.margin="10 auto",n[c].backgroundColor&&(d.style.backgroundColor=n[c].backgroundColor);var p=i.header;n[c].header&&(p=n[c].header),p&&(p=p.replace("{current-page}",c+1).replace("{total-pages}",n.length));var u=i.footer;n[c].footer&&(u=n[c].footer),u&&(u=u.replace("{current-page}",c+1).replace("{total-pages}",n.length)),n[c].html?g.write(OrgChart._exportHtml(n[c].html,e.styles,i,n[c].innerSize.w,n[c].innerSize.h,p,u,t.config.mode)):(l.setAttribute("viewBox",n[c].vb),g.write(OrgChart._exportHtml(s.innerHTML,e.styles,i,n[c].innerSize.w,n[c].innerSize.h,p,u,t.config.mode)));var f=g.getElementById("boc-header"),m=g.getElementById("boc-footer");if(f){var C=a-f.offsetHeight-7;f.style.top=C+"px"}if(m){var b=o-m.offsetHeight-7;m.style.bottom=b+"px"}g.close()}var v=t.element.querySelector("#boc-ppdf-content");OrgChart.animate(v,{opacity:0},{opacity:1},300,OrgChart.anim.outSin)},OrgChart.pdfPrevUI._getViewBox=function(t){var e=null;return t?(e=(e="["+(e=t.getAttribute("viewBox"))+"]").replace(/\ /g,","),e=JSON.parse(e)):null},OrgChart._exportHtml=function(t,e,r,i,n,a,o,s){for(var l="",h=0;h<r.margin.length;h++)l+=r.margin[h]+"px ";var c='<!DOCTYPE html><html style="margin:0;padding:0;"><head></head>'+e+'<body class="boc-'+s+'" style="margin:0; padding:0;"><div style="margin: '+l+";overflow:hidden;width:"+i+"px;height:"+n+'px">';return a&&(c+='<div id="boc-header" style="width:'+i+"px;color:#757575;position:absolute;left:"+r.margin[3]+'px;top:0;">'+a+"</div>"),c+=t,o&&(c+='<div id="boc-footer" style="width:'+i+"px;color:#757575;position:absolute;left:"+r.margin[3]+'px;bottom:0;">'+o+"</div>"),c+="</div>",c+="</body></html>"},OrgChart.pdfPrevUI.hide=function(t){var e=t.element.querySelector("#boc-ppdf-wrapper");if(e){e.parentNode.removeChild(e),e.style.opacity=0;var r=t.element.querySelector("#boc-ppdf-btns");r.parentNode.removeChild(r)}},void 0===OrgChart&&(OrgChart={}),OrgChart.events.on("renderdefs",(function(t,e){for(var r=0;r<t.config.clinks.length;r++){var i=t.config.clinks[r].template;i||(i="orange");var n=OrgChart.clinkTemplates[i];e.defs+=n.defs}})),OrgChart.events.on("prerender",(function(t,e){OrgChart.RENDER_CLINKS_BEFORE_NODES&&t._clink(t,e)})),OrgChart.events.on("render",(function(t,e){OrgChart.RENDER_CLINKS_BEFORE_NODES||t._clink(t,e)})),OrgChart.events.on("drag",(function(t,e,r,i){if(t instanceof OrgChart&&t.config.movable&&i)for(var n=0;n<i.length;n++){for(var a=i[n],o=t.element.querySelectorAll(`[data-c-l-from="${a}"]`),s=t.element.querySelectorAll(`[data-c-l-to="${a}"]`),l=0;l<o.length;l++)o[l].parentNode.removeChild(o[l]);for(l=0;l<s.length;l++)s[l].parentNode.removeChild(s[l])}})),OrgChart.prototype._clink=function(t,e){for(var r="",i=0;i<this.config.clinks.length;i++){var n=this.config.clinks[i],a=t.getNode(n.from),o=t.getNode(n.to);if(a&&-1!=e.res.visibleNodeIds.indexOf(a.id)&&(o&&-1!=e.res.visibleNodeIds.indexOf(o.id))){var s=a.x,l=a.y,h=o.x,c=o.y,d={},g={},p=s+a.w/2,u=h+o.w/2,f=l+a.h/2,m=c+o.h/2,C=1;switch(this.config.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:p<=u?(C=1,d.x=p+a.w/10,g.x=u-o.w/10):(C=-1,d.x=p-a.w/10,g.x=u+o.w/10),l==c?(C=1,d.y=l,g.y=c):l>c?(d.y=l,g.y=c+o.h):(d.y=l+a.h,g.y=c);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:p<=u?(C=-1,d.x=p+a.w/10,g.x=u+o.w/10):(C=1,d.x=p-a.w/10,g.x=u+o.w/10),l==c?(C=-1,d.y=l+a.h,g.y=c+o.h):l>c?(d.y=l,g.y=c+o.h):(d.y=l+a.h,g.y=c);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:f<=m?(C=-1,d.y=f+a.h/5,g.y=m+o.h/5):(C=1,d.y=f-a.h/5,g.y=m+o.h/5),s==h?(C=-1,d.x=s,g.x=h):s>h?(d.x=s,g.x=h+o.w):(d.x=s+a.w,g.x=h);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:f<=m?(C=1,d.y=f+a.h/5,g.y=m+o.h/5):(C=-1,d.y=f-a.h/5,g.y=m+o.h/5),s==h?(C=1,d.x=s+a.w,g.x=h+o.w):s>h?(d.x=s,g.x=h+o.w):(d.x=s+a.w,g.x=h)}var b=_(d,g,C),v=n.template;v||(v="orange");var O=OrgChart.clinkTemplates[v];if(n.label){var x=OrgChart.clinkLabelPosition(n,d,g,b);r+=O.label.replace("{x}",x.x).replace("{y}",x.y).replace("{val}",n.label)}var y="M"+d.x+","+d.y+"C"+d.x+","+d.y+" "+b.x+","+b.y+" "+g.x+","+g.y;r+=("<g "+OrgChart.attr.c_link_from+'="{from}" '+OrgChart.attr.c_link_to+'="{to}">').replace("{from}",a.id).replace("{to}",o.id)+O.link.replaceAll("{d}",y)+'<path stroke="transparent" stroke-width="15" fill="none" d="'+y+'" />',r+=OrgChart.grCloseTag}function _(t,e,r){null==r&&(r=1);var i=e.x-t.x,a=e.y-t.y,o=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))/3;return o=o/(Math.sqrt(i*i+a*a)*r)*OrgChart.clinkCurve(n),{x:t.x+i/2-a*o,y:t.y+a/2+i*o}}}e.content+=r},OrgChart.clinkLabelPosition=function(t,e,r,i){var n=(r.x-e.x)/2+e.x,a=(r.y-e.y)/2+e.y;return{x:(n-i.x)/2+i.x,y:(a-i.y)/2+i.y}},OrgChart.clinkCurve=function(t){return OrgChart.CLINK_CURVE},OrgChart.prototype.addClink=function(t,e,r,i){this._putInUndoStack(),this.clearRedo();for(var n=this.config.clinks.length-1;n>=0;n--){var a=this.config.clinks[n];a.from==t&&a.to==e&&this.config.clinks.splice(n,1)}return this.config.clinks.push({from:t,to:e,label:r,template:i}),this._ai.setContext(),OrgChart.events.publish("updated",[this]),this},OrgChart.prototype.removeClink=function(t,e){this._putInUndoStack(),this.clearRedo();for(var r=this.config.clinks.length-1;r>=0;r--){var i=this.config.clinks[r];i.from==t&&i.to==e&&this.config.clinks.splice(r,1)}return this._ai.setContext(),OrgChart.events.publish("updated",[this]),this},OrgChart.clinkTemplates={},OrgChart.clinkTemplates.orange={defs:'<marker id="arrowOrange" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path fill="#F57C00" d="M 0 0 L 10 5 L 0 10 z" /></marker><marker id="dotOrange" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="5" markerHeight="5"> <circle cx="5" cy="5" r="5" fill="#F57C00" /></marker>',link:'<path marker-start="url(#dotOrange)" marker-end="url(#arrowOrange)" stroke="#F57C00" stroke-width="2" fill="none" d="{d}" />',label:'<text fill="#F57C00" text-anchor="middle" x="{x}" y="{y}">{val}</text>'},OrgChart.clinkTemplates.blue={defs:'<marker id="arrowBlue" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path fill="#039BE5" d="M 0 0 L 10 5 L 0 10 z" /></marker><marker id="dotBlue" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="5" markerHeight="5"> <circle cx="5" cy="5" r="5" fill="#039BE5" /></marker>',link:'<path marker-start="url(#dotBlue)" marker-end="url(#arrowBlue)" stroke="#039BE5" stroke-width="2" fill="none" d="{d}" />',label:'<text fill="#039BE5" text-anchor="middle" x="{x}" y="{y}">{val}</text>'},OrgChart.clinkTemplates.yellow={defs:'<marker id="arrowYellow" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path fill="#FFCA28" d="M 0 0 L 10 5 L 0 10 z" /></marker><marker id="dotYellow" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="5" markerHeight="5"> <circle cx="5" cy="5" r="5" fill="#FFCA28" /></marker>',link:'<path marker-start="url(#dotYellow)" marker-end="url(#arrowYellow)" stroke="#FFCA28" stroke-width="2" fill="none" d="{d}" />',label:'<text fill="#FFCA28" text-anchor="middle" x="{x}" y="{y}">{val}</text>'},void 0===OrgChart&&(OrgChart={}),OrgChart.events.on("renderdefs",(function(t,e){for(var r=0;r<t.config.slinks.length;r++){var i=t.config.slinks[r].template;i||(i="orange");var n=OrgChart.slinkTemplates[i];e.defs+=n.defs}})),OrgChart.events.on("render",(function(t,e){t._slinks(t,e)})),OrgChart.events.on("drag",(function(t,e,r,i){if(t instanceof OrgChart&&t.config.movable&&i)for(var n=0;n<i.length;n++){for(var a=i[n],o=t.element.querySelectorAll(`[data-s-l-from="${a}"]`),s=t.element.querySelectorAll(`[data-s-l-to="${a}"]`),l=0;l<o.length;l++)o[l].parentNode.removeChild(o[l]);for(l=0;l<s.length;l++)s[l].parentNode.removeChild(s[l])}})),OrgChart.prototype._slinks=function(t,e){var r="",i=this.getScale(),n=e.res.boundary;function a(e,a,o){var l=[],h=null,c="left",d=e.lcn?e.lcn:"base",g=t._layoutConfigs[d];switch(g.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:a.x>e.x&&(c="right");break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:case OrgChart.orientation.right:case OrgChart.orientation.right_top:c="top",a.y>e.y&&(c="bottom")}var p=OrgChart.t(e.templateName,e.min,i),u=g.levelSeparation;e.parent&&e.parent.layout&&(u=g.mixedHierarchyNodesSeparation);var f={p:e.x+e.w/2+p.expandCollapseSize,q:e.y,r:e.x+e.w/2+p.expandCollapseSize,s:n.minY+u};if(e.sl==a.sl)switch(h=a,g.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:l.push([f.p,f.q]),l.push([f.p,f.q-u/3]),p=OrgChart.t(h.templateName,h.min,i),l.push([h.x+h.w/2+p.expandCollapseSize,l[l.length-1][1]]),l.push([l[l.length-1][0],h.y]);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:f.q=e.y+e.h,f.s=n.maxY-u,l.push([f.p,f.q]),l.push([f.r,e.y+e.h+u/3]),p=OrgChart.t(h.templateName,h.min,i),l.push([h.x+h.w/2+p.expandCollapseSize,l[l.length-1][1]]),l.push([l[l.length-1][0],h.y+h.h]);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:f.p=e.x,f.q=e.y+e.h/2+p.expandCollapseSize,f.r=n.minX-u,f.s=e.y+e.h/2+p.expandCollapseSize,l.push([f.p,f.q]),l.push([e.x-u/3,f.q]),p=OrgChart.t(h.templateName,h.min,i),l.push([l[l.length-1][0],h.y+h.h/2+p.expandCollapseSize]),l.push([h.x,l[l.length-1][1]]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:f.p=e.x+e.w,f.q=e.y+e.h/2+p.expandCollapseSize,f.r=n.maxX+u,f.s=e.y+e.h/2+p.expandCollapseSize,l.push([f.p,f.q]),l.push([e.x+e.w+u/3,f.q]),p=OrgChart.t(h.templateName,h.min,i),l.push([l[l.length-1][0],h.y+h.h/2+p.expandCollapseSize]),l.push([h.x+h.w,l[l.length-1][1]])}else{switch(g.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:l.push([f.p,f.q]),l.push([f.r,e.y-u/3]);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:f.q=e.y+e.h,f.s=n.maxY-u,l.push([f.p,f.q]),l.push([f.r,e.y+e.h+u/3]);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:f.p=e.x,f.q=e.y+e.h/2+p.expandCollapseSize,f.r=n.minX-u,f.s=e.y+e.h/2+p.expandCollapseSize,l.push([f.p,f.q]),l.push([e.x-u/3,f.q]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:f.p=e.x+e.w,f.q=e.y+e.h/2+p.expandCollapseSize,f.r=n.maxX+u,f.s=e.y+e.h/2+p.expandCollapseSize,l.push([f.p,f.q]),l.push([e.x+e.w+u/3,f.q])}for(var m=e,C=e;C.parent;)C=C.parent;for(;null==h;){var b=!1,v=m.parent,O=v.leftNeighbor,x=v.rightNeighbor;if(v.id==a.id?h=v:OrgChart._intersects(v,f,g)&&(f=OrgChart._addPoint(v,l,g,f,c),b=!0),v.id!=a.id){for(;O;){if(O.id==a.id){h=O;break}OrgChart._intersects(O,f,g)&&(f=OrgChart._addPoint(O,l,g,f,c),b=!0),O=O.leftNeighbor}for(;x;){if(x.id==a.id){h=x;break}OrgChart._intersects(x,f,g)&&(f=OrgChart._addPoint(x,l,g,f,c),b=!0),x=x.rightNeighbor}}if(!b){var y=l[l.length-1][0],_=0;if(v.parent){u=g.levelSeparation,v.parent.layout&&(u=g.mixedHierarchyNodesSeparation);var k=t.manager.bordersByRootIdAndLevel[C.id][v.parent.sl];switch(g.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:_=k.maxY+u*(2/3);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:_=k.minY-u*(2/3);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:y=k.maxX+u*(2/3),_=l[l.length-1][1];break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:y=k.minX-u*(2/3),_=l[l.length-1][1]}}l.push([y,_])}m=v}switch(p=OrgChart.t(h.templateName,h.min,i),l.splice(l.length-1,1),g.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:l.push([h.x+h.w/2+p.expandCollapseSize,l[l.length-1][1]]),l.push([l[l.length-1][0],h.y+h.h]);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:l.push([h.x+h.w/2+p.expandCollapseSize,l[l.length-1][1]]),l.push([l[l.length-1][0],h.y]);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:l.push([l[l.length-1][0],h.y+h.h/2+p.expandCollapseSize]),l.push([h.x+h.w,l[l.length-1][1]]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:l.push([l[l.length-1][0],h.y+h.h/2+p.expandCollapseSize]),l.push([h.x,l[l.length-1][1]])}}var w=s.template;w||(w="orange");var S,I,A=null;switch((p=OrgChart.slinkTemplates[w]).labelPosition){case"start":A={x:l[1][0],y:l[1][1]};break;case"middle":var L=Math.ceil(l.length/2);S=l[L],I=l[L-1],A={x:(S[0]+I[0])/2,y:(S[1]+I[1])/2};break;case"end":A={x:l[l.length-2][0],y:l[l.length-2][1]}}o&&(l=l.reverse()),l[0].unshift("M");for(var E=1;E<l.length;E++)l[E].unshift("L");var N=OrgChart.roundPathCorners(l,OrgChart.LINK_ROUNDED_CORNERS,!1);if(s.label){var M=p.label.replace("{x}",A.x).replace("{y}",A.y).replace("{val}",s.label),T=OrgChart._getLabelSize(M),R=-T.height/2;switch(g.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:R=T.height}r+=p.label.replace("{x}",A.x).replace("{y}",A.y+R).replace("{val}",s.label)}var B=e.id,U=a.id;o&&(B=a.id,U=e.id),r+=("<g "+OrgChart.attr.s_link_from+'="{from}" '+OrgChart.attr.s_link_to+'="{to}">').replace("{from}",B).replace("{to}",U)+p.link.replaceAll("{d}",N)+'<path stroke="transparent" stroke-width="15" fill="none" d="'+N+'" />',r+=OrgChart.grCloseTag}for(var o=0;o<this.config.slinks.length;o++){var s=this.config.slinks[o],l=t.getNode(s.from),h=t.getNode(s.to);l&&h&&-1!=e.res.visibleNodeIds.indexOf(h.id)&&-1!=e.res.visibleNodeIds.indexOf(l.id)&&(l.sl>=h.sl?a(l,h,!1):a(h,l,!0))}e.content+=r},OrgChart.prototype.addSlink=function(t,e,r,i){this._putInUndoStack(),this.clearRedo();for(var n=this.config.slinks.length-1;n>=0;n--){var a=this.config.slinks[n];a.from==t&&a.to==e&&this.config.slinks.splice(n,1)}return this.config.slinks.push({from:t,to:e,label:r,template:i}),this._ai.setContext(),OrgChart.events.publish("updated",[this]),this},OrgChart.prototype.removeSlink=function(t,e){this._putInUndoStack(),this.clearRedo();for(var r=this.config.slinks.length-1;r>=0;r--){var i=this.config.slinks[r];i.from==t&&i.to==e&&this.config.slinks.splice(r,1)}return this._ai.setContext(),OrgChart.events.publish("updated",[this]),this},OrgChart.slinkTemplates={},OrgChart.slinkTemplates.orange={defs:'<marker id="arrowSlinkOrange" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path fill="#F57C00" d="M 0 0 L 10 5 L 0 10 z" /></marker><marker id="dotSlinkOrange" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="5" markerHeight="5"> <circle cx="5" cy="5" r="5" fill="#F57C00" /></marker>',link:'<path stroke-dasharray="4, 2" marker-start="url(#dotSlinkOrange)" marker-end="url(#arrowSlinkOrange)" stroke-linejoin="round" stroke="#F57C00" stroke-width="2" fill="none" d="{d}" />',label:'<text dominant-baseline="middle" fill="#F57C00" alignment-baseline="middle" text-anchor="middle" x="{x}" y="{y}">{val}</text>',labelPosition:"middle"},OrgChart.slinkTemplates.blue={defs:'<marker id="arrowSlinkBlue" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path fill="#039BE5" d="M 0 0 L 10 5 L 0 10 z" /></marker><marker id="dotSlinkBlue" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="5" markerHeight="5"> <circle cx="5" cy="5" r="5" fill="#039BE5" /></marker>',link:'<path stroke-dasharray="4, 2" marker-start="url(#dotSlinkBlue)" marker-end="url(#arrowSlinkBlue)" stroke-linejoin="round" stroke="#039BE5" stroke-width="2" fill="none" d="{d}" />',label:'<text fill="#039BE5" text-anchor="middle" x="{x}" y="{y}">{val}</text>',labelPosition:"middle"},OrgChart.slinkTemplates.yellow={defs:'<marker id="arrowSlinkYellow" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path fill="#FFCA28" d="M 0 0 L 10 5 L 0 10 z" /></marker><marker id="dotSlinkYellow" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="5" markerHeight="5"> <circle cx="5" cy="5" r="5" fill="#FFCA28" /></marker>',link:'<path stroke-dasharray="4, 2" marker-start="url(#dotSlinkYellow)" marker-end="url(#arrowSlinkYellow)" stroke-linejoin="round" stroke="#FFCA28" stroke-width="2" fill="none" d="{d}" />',label:'<text fill="#FFCA28" text-anchor="middle" x="{x}" y="{y}">{val}</text>',labelPosition:"middle"},OrgChart._ai=function(t){this.instance=t,this.sessionId=null},OrgChart._ai.prototype.prompt=function(t,e){var r=this;(t=t.trim())&&(this.sessionId?r._prompt([{Role:"user",Text:t}],e):this.setContext((function(){r._prompt([{Role:"user",Text:t}],e)})))},OrgChart._ai.prototype._prompt=function(t,e){var r=this,i=[];for(var n of OrgChart.AI_SYSTEM_MESSAGES)i.push({Role:"system",Text:n});var a=this.instance.config.serverUrl+`/OrgChartJSAI/Prompt?client_messages=${encodeURIComponent(JSON.stringify(t))}&system_messages=${encodeURIComponent(JSON.stringify(i))}&sessionId=${this.sessionId}`;const o=new EventSource(a);o.onmessage=function(t){var i=JSON.parse(t.data);"end"==i.kind&&o.close(),"text"==i.kind&&(i.text,e&&e(i.text)),"assistant-message-with-tools"==i.kind?r.toolCalls(i.message,e):"error"==i.kind&&console.error(i.text)},o.onerror=function(t){console.error(t),o.close()}},OrgChart._ai.prototype.setContext=function(t){if(this.instance&&this.instance.config.enableAI&&this.instance.aiUI.canSetContext){this.sessionId=this.instance._event_id;var e=this.instance.config.serverUrl+"/OrgChartJSAI/SetContext",r=this.instance.config.aiChatTools.slice();for(var i of r)i.functionParameters=JSON.stringify(i.functionParameters);fetch(e,{method:"post",headers:{"Content-Type":"application/json","x-request-type":"ajax"},body:JSON.stringify({context:this.instance.config.nodes,sessionId:this.sessionId,chatTools:r})}).then((function(){t&&t()})).catch((function(t){console.error(t)}))}},OrgChart._ai.prototype.toolCalls=function(t,e){var r=this,i={toolCalls:t.ToolCalls};OrgChart.events.publish("ai-tool-calls",[this.instance,i]);var n=[],a=[],o=[],s=[],l=[],h=null,c=null,d=null,g=null,p=null;for(var u of i.toolCalls)null==u.FunctionResult&&("removeNode"==u.FunctionName?n.push(u):"addNode"==u.FunctionName?a.push(u):"updateNode"==u.FunctionName?o.push(u):"select"==u.FunctionName?s.push(u):"deselect"==u.FunctionName?l.push(u):"exportPDF"==u.FunctionName?h=u:"changeTemplate"==u.FunctionName?c=u:"addSlink"==u.FunctionName?d=u:"removeSlink"==u.FunctionName?g=u:"fit"==u.FunctionName&&(p=u));var f=!1;if(c&&(f=!0,u.FunctionResult="ok",this.instance.config.template=u.FunctionArguments.templateName),d){var m=this.instance.getNode(u.FunctionArguments.employeeId1),C=this.instance.getNode(u.FunctionArguments.employeeId2);m&&C&&m!=C?(f=!0,this.instance.addSlink(m.id,C.id),u.FunctionResult="ok"):u.FunctionResult=`Cannot add link between ${u.FunctionArguments.employeeId1} and ${u.FunctionArguments.employeeId2}`}if(g){m=this.instance.getNode(u.FunctionArguments.employeeId1),C=this.instance.getNode(u.FunctionArguments.employeeId2);m&&C&&m!=C?(f=!0,this.instance.removeSlink(m.id,C.id),u.FunctionResult="ok"):u.FunctionResult=`Cannot remove link between ${u.FunctionArguments.employeeId1} and ${u.FunctionArguments.employeeId2}`}for(var u of(p&&(this.instance.fit(),f=!1),n))f=!0,u.FunctionResult="ok",this.instance.remove(u.FunctionArguments.id);for(var u of a){f=!0,u.FunctionResult="ok",(b=JSON.parse(JSON.stringify(u.FunctionArguments))).isAssistant&&(b.tags=["assistant"]),delete b.isAssistant,OrgChart.isNEU(b.id)&&(b.id=this.instance.generateId()),this.instance.add(b)}for(var u of o){f=!0,u.FunctionResult="ok";var b=this.instance.get(u.FunctionArguments.id);for(var v in u.FunctionArguments)"id"!=v&&null!=u.FunctionArguments[v]&&(b[v]=u.FunctionArguments[v]);this.instance.update(b)}for(var u of s)for(var O of(u.FunctionResult="ok",u.FunctionArguments.ids)){var x=u.FunctionArguments.color;x||(x="#FFCA28");var y=this.instance.getNodeElement(O).firstChild;y&&(y.style.stroke=u.FunctionArguments.color,y.style.strokeWidth=5)}var _=function(){for(var t of l)if(t.FunctionResult="ok",t.FunctionArguments.ids)for(var e of t.FunctionArguments.ids){var i=r.instance.getNodeElement(e).firstChild;i&&(i.style.stroke="#aeaeae",i.style.strokeWidth=1)}else f=!0};f?(this.setContext(),this.instance.draw(OrgChart.action.update,void 0,_)):_();var k=function(){var t=[];for(var n of i.toolCalls)t.push({Role:"tool",Text:n.FunctionResult,Id:n.Id});r._prompt(t,e)};h?OrgChart.exportPDFFromCharts([{format:"A4",chartInstance:this.instance}],void 0,void 0,(function(t){u.FunctionResult="ok",OrgChart._downloadFile("application/pdf",t,"OrgChart.pdf",!1,"pdf"),k()})):k()},OrgChart.aiUI=function(){},OrgChart.aiUI.title="AI for OrgChart JS",OrgChart.aiUI.prototype.init=function(t){this.instance=t,this.canSetContext=!1,this.element=null,this.inputElement=null,this.btnSendElement=null,this.messagesElement=null;var e=this,r=this.instance.element.querySelector("[data-boc-ai-button]");r&&r.addEventListener("click",(function(t){e.show()}))},OrgChart.aiUI.prototype.show=function(t,e){this.hide(),this._create(),this.element.style.display="",this.canSetContext||(this.canSetContext=!0,this.instance._ai.setContext());var r=this;e||(this.interval=OrgChart.animate(this.element,{left:-20,opacity:0},{left:0,opacity:1},300,OrgChart.anim.outSin,(function(){t||r.inputElement.focus()})))},OrgChart.aiUI.prototype._create=function(){if(!this.element){var t=this,e="inp_"+this.instance.generateId();this.element=document.createElement("div"),this.element.setAttribute("data-boc-ai-form",""),this.element.style.opacity=0,this.element.classList.add("boc-ai-form"),this.element.classList.add(this.instance.config.mode),this.element.innerHTML=`<div class="boc-ai-container">\n <div data-boc-ai-close class="boc-ai-close">${OrgChart.icon.x(20,20,"#aeaeae")}</div>\n <div class="boc-ai-middle boc-ai-start">\n <div data-boc-ai-messages class="boc-ai-messages">\n <img src="https://orgchartjs.balkan.app/logo.svg"> \n <span>\n ${OrgChart.aiUI.title}\n </span>\n </div> \n </div>\n <div>\n <div class="boc-input" data-boc-input="">\n <label for="${e}">Message OrgChart</label>\n <input maxlength="256" id="${e}" name="${e}" type="text" value="" autocomplete="off"> \n <div data-boc-ai-send class="boc-ai-send">\n ${OrgChart.icon.send(20,20,"#aeaeae")}\n </div> \n </div>\n \n </div>\n </div>`,this.instance.element.appendChild(this.element),OrgChart.input.init(this.element);var r=this.instance.element.querySelector("[data-boc-ai-close] svg");r&&r.addEventListener("click",(function(e){t.hide()})),this.inputElement=this.element.querySelector("#"+e),this.btnSendElement=this.inputElement.parentNode.querySelector("[data-boc-ai-send]"),this.messagesElement=this.element.querySelector("[data-boc-ai-messages]"),this.inputElement.addEventListener("input",(function(t){this.value?this.parentNode.querySelector(".boc-ai-send").classList.add("boc-ai-send-cansend"):this.parentNode.querySelector(".boc-ai-send").classList.remove("boc-ai-send-cansend")})),this.element.querySelector("[data-boc-ai-send]").addEventListener("click",(function(e){t.sendUserInput()})),this.inputElement.addEventListener("keyup",(function(e){var r=window.event?window.event:e;switch(t.canSetContext||(t.canSetContext=!0,t.instance._ai.setContext()),r.key){case"Enter":t.sendUserInput();break;case"ArrowUp":if((i=OrgChart.aiUI._getSuggestions()).length)-1==(n=i.indexOf(t.inputElement.value))?n=i.length-1:n--,-1==n&&(n=i.length-1),t.inputElement.value=i[n];break;case"ArrowDown":var i,n;if((i=OrgChart.aiUI._getSuggestions()).length)-1==(n=i.indexOf(t.inputElement.value))?n=0:n++,n==i.length&&(n=0),t.inputElement.value=i[n]}}))}},OrgChart.aiUI.prototype.addUserMessage=function(t){this.btnSendElement.classList.remove("boc-ai-send-cansend");var e=this.element.querySelector(".boc-ai-start");e&&(e.classList.remove("boc-ai-start"),this.messagesElement.innerHTML="");var r=document.createElement("div");r.classList.add("boc-ai-user-message"),r.innerHTML=`<span class="boc-inner-user-message">${t}</span>`,this.messagesElement.appendChild(r)},OrgChart.aiUI.prototype.hide=function(){this.element&&(this.element.style.opacity=0,this.element.style.left="-20px",this.element.style.display="none")},OrgChart.aiUI.prototype.sendUserInput=function(){var t=this;OrgChart.aiUI._addSuggestion(this.inputElement.value),this.addUserMessage(this.inputElement.value);var e=document.createElement("div");e.classList.add("boc-ai-assistant-message");var r=document.createElement("span");r.classList.add("boc-inner-assistant-message"),e.appendChild(r),this.messagesElement.appendChild(e);var i="";this.instance._ai.prompt(this.inputElement.value,(function(e){i+=e;var n=marked.parse(i);r.innerHTML=n;var a=t.element.querySelector(".boc-ai-middle");a.scrollTo(0,a.scrollHeight)})),this.inputElement.value=""},OrgChart.aiUI._addSuggestion=function(t){t=t.trim();var e=OrgChart.aiUI._getSuggestions(),r=e.indexOf(t);-1!=r&&e.splice(r,1),e.push(t),localStorage.setItem("suggestions",JSON.stringify(e))},OrgChart.aiUI._getSuggestions=function(){var t=localStorage.getItem("suggestions");return t=t?JSON.parse(t):[]},function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).marked={})}(this,(function(t){"use strict";function e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function r(e){t.defaults=e}t.defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};const i={exec:()=>null};function n(t,e=""){let r="string"==typeof t?t:t.source;const i={replace:(t,e)=>{let n="string"==typeof e?e:e.source;return n=n.replace(a.caret,"$1"),r=r.replace(t,n),i},getRegex:()=>new RegExp(r,e)};return i}const a={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},o=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,s=/(?:[*+-]|\d{1,9}[.)])/,l=n(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,s).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),h=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,c=/(?!\s*\])(?:\\.|[^\[\]\\])+/,d=n(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",c).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),g=n(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,s).getRegex(),p="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",u=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,f=n("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",u).replace("tag",p).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),m=n(h).replace("hr",o).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",p).getRegex(),C={blockquote:n(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",m).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:d,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:o,html:f,lheading:l,list:g,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:m,table:i,text:/^[^\n]+/},b=n("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",o).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",p).getRegex(),v={...C,table:b,paragraph:n(h).replace("hr",o).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",b).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",p).getRegex()},O={...C,html:n("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",u).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:i,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:n(h).replace("hr",o).replace("heading"," *#{1,6} *[^\n]").replace("lheading",l).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},x=/^( {2,}|\\)\n(?!\s*$)/,y=/[\p{P}\p{S}]/u,_=/[\s\p{P}\p{S}]/u,k=/[^\s\p{P}\p{S}]/u,w=n(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,_).getRegex(),S=/(?!~)[\p{P}\p{S}]/u,I=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,A=n(I,"u").replace(/punct/g,y).getRegex(),L=n(I,"u").replace(/punct/g,S).getRegex(),E="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",N=n(E,"gu").replace(/notPunctSpace/g,k).replace(/punctSpace/g,_).replace(/punct/g,y).getRegex(),M=n(E,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,S).getRegex(),T=n("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,k).replace(/punctSpace/g,_).replace(/punct/g,y).getRegex(),R=n(/\\(punct)/,"gu").replace(/punct/g,y).getRegex(),B=n(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),U=n(u).replace("(?:--\x3e|$)","--\x3e").getRegex(),P=n("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",U).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),F=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,z=n(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",F).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),D=n(/^!?\[(label)\]\[(ref)\]/).replace("label",F).replace("ref",c).getRegex(),H=n(/^!?\[(ref)\](?:\[\])?/).replace("ref",c).getRegex(),$={_backpedal:i,anyPunctuation:R,autolink:B,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:x,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:i,emStrongLDelim:A,emStrongRDelimAst:N,emStrongRDelimUnd:T,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:z,nolink:H,punctuation:w,reflink:D,reflinkSearch:n("reflink|nolink(?!\\()","g").replace("reflink",D).replace("nolink",H).getRegex(),tag:P,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:i},j={...$,link:n(/^!?\[(label)\]\((.*?)\)/).replace("label",F).getRegex(),reflink:n(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",F).getRegex()},q={...$,emStrongRDelimAst:M,emStrongLDelim:L,url:n(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Y={...q,br:n(x).replace("{2,}","*").getRegex(),text:n(q.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},X={normal:C,gfm:v,pedantic:O},V={normal:$,gfm:q,breaks:Y,pedantic:j},G={"&":"&","<":"<",">":">",'"':""","'":"'"},W=t=>G[t];function J(t,e){if(e){if(a.escapeTest.test(t))return t.replace(a.escapeReplace,W)}else if(a.escapeTestNoEncode.test(t))return t.replace(a.escapeReplaceNoEncode,W);return t}function K(t){try{t=encodeURI(t).replace(a.percentDecode,"%")}catch{return null}return t}function Z(t,e){const r=t.replace(a.findPipe,((t,e,r)=>{let i=!1,n=e;for(;--n>=0&&"\\"===r[n];)i=!i;return i?"|":" |"})).split(a.splitPipe);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(a.slashPipe,"|");return r}function Q(t,e,r){const i=t.length;if(0===i)return"";let n=0;for(;n<i&&t.charAt(i-n-1)===e;)n++;return t.slice(0,i-n)}function tt(t,e,r,i,n){const a=e.href,o=e.title||null,s=t[1].replace(n.other.outputLinkReplace,"$1");if("!"!==t[0].charAt(0)){i.state.inLink=!0;const t={type:"link",raw:r,href:a,title:o,text:s,tokens:i.inlineTokens(s)};return i.state.inLink=!1,t}return{type:"image",raw:r,href:a,title:o,text:s}}class et{options;rules;lexer;constructor(e){this.options=e||t.defaults}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Q(t,"\n")}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const t=e[0],r=function(t,e,r){const i=t.match(r.other.indentCodeCompensation);if(null===i)return e;const n=i[1];return e.split("\n").map((t=>{const e=t.match(r.other.beginningSpace);if(null===e)return t;const[i]=e;return i.length>=n.length?t.slice(n.length):t})).join("\n")}(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){const e=Q(t,"#");this.options.pedantic?t=e.trim():e&&!this.rules.other.endingSpaceChar.test(e)||(t=e.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Q(e[0],"\n")}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let t=Q(e[0],"\n").split("\n"),r="",i="";const n=[];for(;t.length>0;){let e=!1;const a=[];let o;for(o=0;o<t.length;o++)if(this.rules.other.blockquoteStart.test(t[o]))a.push(t[o]),e=!0;else{if(e)break;a.push(t[o])}t=t.slice(o);const s=a.join("\n"),l=s.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}\n${s}`:s,i=i?`${i}\n${l}`:l;const h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,n,!0),this.lexer.state.top=h,0===t.length)break;const c=n.at(-1);if("code"===c?.type)break;if("blockquote"===c?.type){const e=c,a=e.raw+"\n"+t.join("\n"),o=this.blockquote(a);n[n.length-1]=o,r=r.substring(0,r.length-e.raw.length)+o.raw,i=i.substring(0,i.length-e.text.length)+o.text;break}if("list"!==c?.type);else{const e=c,a=e.raw+"\n"+t.join("\n"),o=this.list(a);n[n.length-1]=o,r=r.substring(0,r.length-c.raw.length)+o.raw,i=i.substring(0,i.length-e.raw.length)+o.raw,t=a.substring(n.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:r,tokens:n,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let r=e[1].trim();const i=r.length>1,n={type:"list",raw:"",ordered:i,start:i?+r.slice(0,-1):"",loose:!1,items:[]};r=i?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=i?r:"[*+-]");const a=this.rules.other.listItemRegex(r);let o=!1;for(;t;){let r=!1,i="",s="";if(!(e=a.exec(t)))break;if(this.rules.block.hr.test(t))break;i=e[0],t=t.substring(i.length);let l=e[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,(t=>" ".repeat(3*t.length))),h=t.split("\n",1)[0],c=!l.trim(),d=0;if(this.options.pedantic?(d=2,s=l.trimStart()):c?d=e[1].length+1:(d=e[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=l.slice(d),d+=e[1].length),c&&this.rules.other.blankLine.test(h)&&(i+=h+"\n",t=t.substring(h.length+1),r=!0),!r){const e=this.rules.other.nextBulletRegex(d),r=this.rules.other.hrRegex(d),n=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;t;){const g=t.split("\n",1)[0];let p;if(h=g,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),p=h):p=h.replace(this.rules.other.tabCharGlobal," "),n.test(h))break;if(a.test(h))break;if(o.test(h))break;if(e.test(h))break;if(r.test(h))break;if(p.search(this.rules.other.nonSpaceChar)>=d||!h.trim())s+="\n"+p.slice(d);else{if(c)break;if(l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(n.test(l))break;if(a.test(l))break;if(r.test(l))break;s+="\n"+h}c||h.trim()||(c=!0),i+=g+"\n",t=t.substring(g.length+1),l=p.slice(d)}}n.loose||(o?n.loose=!0:this.rules.other.doubleBlankLine.test(i)&&(o=!0));let g,p=null;this.options.gfm&&(p=this.rules.other.listIsTask.exec(s),p&&(g="[ ] "!==p[0],s=s.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:i,task:!!p,checked:g,loose:!1,text:s,tokens:[]}),n.raw+=i}const s=n.items.at(-1);if(!s)return;s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd(),n.raw=n.raw.trimEnd();for(let t=0;t<n.items.length;t++)if(this.lexer.state.top=!1,n.items[t].tokens=this.lexer.blockTokens(n.items[t].text,[]),!n.loose){const e=n.items[t].tokens.filter((t=>"space"===t.type)),r=e.length>0&&e.some((t=>this.rules.other.anyLine.test(t.raw)));n.loose=r}if(n.loose)for(let t=0;t<n.items.length;t++)n.items[t].loose=!0;return n}}html(t){const e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:"pre"===e[1]||"script"===e[1]||"style"===e[1],text:e[0]}}def(t){const e=this.rules.block.def.exec(t);if(e){const t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:r,title:i}}}table(t){const e=this.rules.block.table.exec(t);if(!e)return;if(!this.rules.other.tableDelimiter.test(e[2]))return;const r=Z(e[1]),i=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===i.length){for(const t of i)this.rules.other.tableAlignRight.test(t)?a.align.push("right"):this.rules.other.tableAlignCenter.test(t)?a.align.push("center"):this.rules.other.tableAlignLeft.test(t)?a.align.push("left"):a.align.push(null);for(let t=0;t<r.length;t++)a.header.push({text:r[t],tokens:this.lexer.inline(r[t]),header:!0,align:a.align[t]});for(const t of n)a.rows.push(Z(t,a.header.length).map(((t,e)=>({text:t,tokens:this.lexer.inline(t),header:!1,align:a.align[e]}))));return a}}lheading(t){const e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:"="===e[2].charAt(0)?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const t="\n"===e[1].charAt(e[1].length-1)?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const e=Q(t.slice(0,-1),"\\");if((t.length-e.length)%2==0)return}else{const t=function(t,e){if(-1===t.indexOf(e[1]))return-1;let r=0;for(let i=0;i<t.length;i++)if("\\"===t[i])i++;else if(t[i]===e[0])r++;else if(t[i]===e[1]&&(r--,r<0))return i;return-1}(e[2],"()");if(t>-1){const r=(0===e[0].indexOf("!")?5:4)+e[1].length+t;e[2]=e[2].substring(0,t),e[0]=e[0].substring(0,r).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){const t=this.rules.other.pedanticHrefTitle.exec(r);t&&(r=t[1],i=t[3])}else i=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(r=this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?r.slice(1):r.slice(1,-1)),tt(e,{href:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r,title:i?i.replace(this.rules.inline.anyPunctuation,"$1"):i},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){const t=e[(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!t){const t=r[0].charAt(0);return{type:"text",raw:t,text:t}}return tt(r,t,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(i&&(!i[3]||!r.match(this.rules.other.unicodeAlphaNumeric))&&(!i[1]&&!i[2]||!r||this.rules.inline.punctuation.exec(r))){const r=[...i[0]].length-1;let n,a,o=r,s=0;const l="*"===i[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,e=e.slice(-1*t.length+r);null!=(i=l.exec(e));){if(n=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!n)continue;if(a=[...n].length,i[3]||i[4]){o+=a;continue}if((i[5]||i[6])&&r%3&&!((r+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);const e=[...i[0]][0].length,l=t.slice(0,r+i.index+e+a);if(Math.min(r,a)%2){const t=l.slice(1,-1);return{type:"em",raw:l,text:t,tokens:this.lexer.inlineTokens(t)}}const h=l.slice(2,-2);return{type:"strong",raw:l,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(t),i=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&i&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(t){const e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){const e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let t,r;return"@"===e[2]?(t=e[1],r="mailto:"+t):(t=e[1],r=t),{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let t,r;if("@"===e[2])t=e[0],r="mailto:"+t;else{let i;do{i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??""}while(i!==e[0]);t=e[0],r="www."===e[1]?"http://"+e[0]:e[0]}return{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){const t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}}class rt{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||t.defaults,this.options.tokenizer=this.options.tokenizer||new et,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={other:a,block:X.normal,inline:V.normal};this.options.pedantic?(r.block=X.pedantic,r.inline=V.pedantic):this.options.gfm&&(r.block=X.gfm,this.options.breaks?r.inline=V.breaks:r.inline=V.gfm),this.tokenizer.rules=r}static get rules(){return{block:X,inline:V}}static lex(t,e){return new rt(e).lex(t)}static lexInline(t,e){return new rt(e).inlineTokens(t)}lex(t){t=t.replace(a.carriageReturn,"\n"),this.blockTokens(t,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const e=this.inlineQueue[t];this.inlineTokens(e.src,e.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],r=!1){for(this.options.pedantic&&(t=t.replace(a.tabCharGlobal," ").replace(a.spaceLine,""));t;){let i;if(this.options.extensions?.block?.some((r=>!!(i=r.call({lexer:this},t,e))&&(t=t.substring(i.raw.length),e.push(i),!0))))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);const r=e.at(-1);1===i.raw.length&&void 0!==r?r.raw+="\n":e.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);const r=e.at(-1);"paragraph"===r?.type||"text"===r?.type?(r.raw+="\n"+i.raw,r.text+="\n"+i.text,this.inlineQueue.at(-1).src=r.text):e.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length);const r=e.at(-1);"paragraph"===r?.type||"text"===r?.type?(r.raw+="\n"+i.raw,r.text+="\n"+i.raw,this.inlineQueue.at(-1).src=r.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),e.push(i);continue}let n=t;if(this.options.extensions?.startBlock){let e=1/0;const r=t.slice(1);let i;this.options.extensions.startBlock.forEach((t=>{i=t.call({lexer:this},r),"number"==typeof i&&i>=0&&(e=Math.min(e,i))})),e<1/0&&e>=0&&(n=t.substring(0,e+1))}if(this.state.top&&(i=this.tokenizer.paragraph(n))){const a=e.at(-1);r&&"paragraph"===a?.type?(a.raw+="\n"+i.raw,a.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):e.push(i),r=n.length!==t.length,t=t.substring(i.raw.length)}else if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length);const r=e.at(-1);"text"===r?.type?(r.raw+="\n"+i.raw,r.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):e.push(i)}else if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){let r=t,i=null;if(this.tokens.links){const t=Object.keys(this.tokens.links);if(t.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(r));)t.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(r));)r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(r));)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let n=!1,a="";for(;t;){let i;if(n||(a=""),n=!1,this.options.extensions?.inline?.some((r=>!!(i=r.call({lexer:this},t,e))&&(t=t.substring(i.raw.length),e.push(i),!0))))continue;if(i=this.tokenizer.escape(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.tag(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.link(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(i.raw.length);const r=e.at(-1);"text"===i.type&&"text"===r?.type?(r.raw+=i.raw,r.text+=i.text):e.push(i);continue}if(i=this.tokenizer.emStrong(t,r,a)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.codespan(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.br(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.del(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.autolink(t)){t=t.substring(i.raw.length),e.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(t))){t=t.substring(i.raw.length),e.push(i);continue}let o=t;if(this.options.extensions?.startInline){let e=1/0;const r=t.slice(1);let i;this.options.extensions.startInline.forEach((t=>{i=t.call({lexer:this},r),"number"==typeof i&&i>=0&&(e=Math.min(e,i))})),e<1/0&&e>=0&&(o=t.substring(0,e+1))}if(i=this.tokenizer.inlineText(o)){t=t.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(a=i.raw.slice(-1)),n=!0;const r=e.at(-1);"text"===r?.type?(r.raw+=i.raw,r.text+=i.text):e.push(i)}else if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}return e}}class it{options;parser;constructor(e){this.options=e||t.defaults}space(t){return""}code({text:t,lang:e,escaped:r}){const i=(e||"").match(a.notSpaceStart)?.[0],n=t.replace(a.endingNewline,"")+"\n";return i?'<pre><code class="language-'+J(i)+'">'+(r?n:J(n,!0))+"</code></pre>\n":"<pre><code>"+(r?n:J(n,!0))+"</code></pre>\n"}blockquote({tokens:t}){return`<blockquote>\n${this.parser.parse(t)}</blockquote>\n`}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>\n`}hr(t){return"<hr>\n"}list(t){const e=t.ordered,r=t.start;let i="";for(let e=0;e<t.items.length;e++){const r=t.items[e];i+=this.listitem(r)}const n=e?"ol":"ul";return"<"+n+(e&&1!==r?' start="'+r+'"':"")+">\n"+i+"</"+n+">\n"}listitem(t){let e="";if(t.task){const r=this.checkbox({checked:!!t.checked});t.loose?"paragraph"===t.tokens[0]?.type?(t.tokens[0].text=r+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&"text"===t.tokens[0].tokens[0].type&&(t.tokens[0].tokens[0].text=r+" "+J(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):e+=r+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>\n`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>\n`}table(t){let e="",r="";for(let e=0;e<t.header.length;e++)r+=this.tablecell(t.header[e]);e+=this.tablerow({text:r});let i="";for(let e=0;e<t.rows.length;e++){const n=t.rows[e];r="";for(let t=0;t<n.length;t++)r+=this.tablecell(n[t]);i+=this.tablerow({text:r})}return i&&(i=`<tbody>${i}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+i+"</table>\n"}tablerow({text:t}){return`<tr>\n${t}</tr>\n`}tablecell(t){const e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>\n`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${J(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:r}){const i=this.parser.parseInline(r),n=K(t);if(null===n)return i;let a='<a href="'+(t=n)+'"';return e&&(a+=' title="'+J(e)+'"'),a+=">"+i+"</a>",a}image({href:t,title:e,text:r}){const i=K(t);if(null===i)return J(r);let n=`<img src="${t=i}" alt="${r}"`;return e&&(n+=` title="${J(e)}"`),n+=">",n}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:J(t.text)}}class nt{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}}class at{options;renderer;textRenderer;constructor(e){this.options=e||t.defaults,this.options.renderer=this.options.renderer||new it,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new nt}static parse(t,e){return new at(e).parse(t)}static parseInline(t,e){return new at(e).parseInline(t)}parse(t,e=!0){let r="";for(let i=0;i<t.length;i++){const n=t[i];if(this.options.extensions?.renderers?.[n.type]){const t=n,e=this.options.extensions.renderers[t.type].call({parser:this},t);if(!1!==e||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(t.type)){r+=e||"";continue}}const a=n;switch(a.type){case"space":r+=this.renderer.space(a);continue;case"hr":r+=this.renderer.hr(a);continue;case"heading":r+=this.renderer.heading(a);continue;case"code":r+=this.renderer.code(a);continue;case"table":r+=this.renderer.table(a);continue;case"blockquote":r+=this.renderer.blockquote(a);continue;case"list":r+=this.renderer.list(a);continue;case"html":r+=this.renderer.html(a);continue;case"paragraph":r+=this.renderer.paragraph(a);continue;case"text":{let n=a,o=this.renderer.text(n);for(;i+1<t.length&&"text"===t[i+1].type;)n=t[++i],o+="\n"+this.renderer.text(n);r+=e?this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o,escaped:!0}]}):o;continue}default:{const t='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(t),"";throw new Error(t)}}}return r}parseInline(t,e=this.renderer){let r="";for(let i=0;i<t.length;i++){const n=t[i];if(this.options.extensions?.renderers?.[n.type]){const t=this.options.extensions.renderers[n.type].call({parser:this},n);if(!1!==t||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){r+=t||"";continue}}const a=n;switch(a.type){case"escape":case"text":r+=e.text(a);break;case"html":r+=e.html(a);break;case"link":r+=e.link(a);break;case"image":r+=e.image(a);break;case"strong":r+=e.strong(a);break;case"em":r+=e.em(a);break;case"codespan":r+=e.codespan(a);break;case"br":r+=e.br(a);break;case"del":r+=e.del(a);break;default:{const t='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(t),"";throw new Error(t)}}}return r}}class ot{options;block;constructor(e){this.options=e||t.defaults}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?rt.lex:rt.lexInline}provideParser(){return this.block?at.parse:at.parseInline}}class st{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=at;Renderer=it;TextRenderer=nt;Lexer=rt;Tokenizer=et;Hooks=ot;constructor(...t){this.use(...t)}walkTokens(t,e){let r=[];for(const i of t)switch(r=r.concat(e.call(this,i)),i.type){case"table":{const t=i;for(const i of t.header)r=r.concat(this.walkTokens(i.tokens,e));for(const i of t.rows)for(const t of i)r=r.concat(this.walkTokens(t.tokens,e));break}case"list":{const t=i;r=r.concat(this.walkTokens(t.items,e));break}default:{const t=i;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach((i=>{const n=t[i].flat(1/0);r=r.concat(this.walkTokens(n,e))})):t.tokens&&(r=r.concat(this.walkTokens(t.tokens,e)))}}return r}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach((t=>{const r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach((t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){const r=e.renderers[t.name];e.renderers[t.name]=r?function(...e){let i=t.renderer.apply(this,e);return!1===i&&(i=r.apply(this,e)),i}:t.renderer}if("tokenizer"in t){if(!t.level||"block"!==t.level&&"inline"!==t.level)throw new Error("extension level must be 'block' or 'inline'");const r=e[t.level];r?r.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&("block"===t.level?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:"inline"===t.level&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)})),r.extensions=e),t.renderer){const e=this.defaults.renderer||new it(this.defaults);for(const r in t.renderer){if(!(r in e))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const i=r,n=t.renderer[i],a=e[i];e[i]=(...t)=>{let r=n.apply(e,t);return!1===r&&(r=a.apply(e,t)),r||""}}r.renderer=e}if(t.tokenizer){const e=this.defaults.tokenizer||new et(this.defaults);for(const r in t.tokenizer){if(!(r in e))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const i=r,n=t.tokenizer[i],a=e[i];e[i]=(...t)=>{let r=n.apply(e,t);return!1===r&&(r=a.apply(e,t)),r}}r.tokenizer=e}if(t.hooks){const e=this.defaults.hooks||new ot;for(const r in t.hooks){if(!(r in e))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;const i=r,n=t.hooks[i],a=e[i];ot.passThroughHooks.has(r)?e[i]=t=>{if(this.defaults.async)return Promise.resolve(n.call(e,t)).then((t=>a.call(e,t)));const r=n.call(e,t);return a.call(e,r)}:e[i]=(...t)=>{let r=n.apply(e,t);return!1===r&&(r=a.apply(e,t)),r}}r.hooks=e}if(t.walkTokens){const e=this.defaults.walkTokens,i=t.walkTokens;r.walkTokens=function(t){let r=[];return r.push(i.call(this,t)),e&&(r=r.concat(e.call(this,t))),r}}this.defaults={...this.defaults,...r}})),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return rt.lex(t,e??this.defaults)}parser(t,e){return at.parse(t,e??this.defaults)}parseMarkdown(t){return(e,r)=>{const i={...r},n={...this.defaults,...i},a=this.onError(!!n.silent,!!n.async);if(!0===this.defaults.async&&!1===i.async)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==e)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof e)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));n.hooks&&(n.hooks.options=n,n.hooks.block=t);const o=n.hooks?n.hooks.provideLexer():t?rt.lex:rt.lexInline,s=n.hooks?n.hooks.provideParser():t?at.parse:at.parseInline;if(n.async)return Promise.resolve(n.hooks?n.hooks.preprocess(e):e).then((t=>o(t,n))).then((t=>n.hooks?n.hooks.processAllTokens(t):t)).then((t=>n.walkTokens?Promise.all(this.walkTokens(t,n.walkTokens)).then((()=>t)):t)).then((t=>s(t,n))).then((t=>n.hooks?n.hooks.postprocess(t):t)).catch(a);try{n.hooks&&(e=n.hooks.preprocess(e));let t=o(e,n);n.hooks&&(t=n.hooks.processAllTokens(t)),n.walkTokens&&this.walkTokens(t,n.walkTokens);let r=s(t,n);return n.hooks&&(r=n.hooks.postprocess(r)),r}catch(t){return a(t)}}}onError(t,e){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",t){const t="<p>An error occurred:</p><pre>"+J(r.message+"",!0)+"</pre>";return e?Promise.resolve(t):t}if(e)return Promise.reject(r);throw r}}}const lt=new st;function ht(t,e){return lt.parse(t,e)}ht.options=ht.setOptions=function(t){return lt.setOptions(t),ht.defaults=lt.defaults,r(ht.defaults),ht},ht.getDefaults=e,ht.defaults=t.defaults,ht.use=function(...t){return lt.use(...t),ht.defaults=lt.defaults,r(ht.defaults),ht},ht.walkTokens=function(t,e){return lt.walkTokens(t,e)},ht.parseInline=lt.parseInline,ht.Parser=at,ht.parser=at.parse,ht.Renderer=it,ht.TextRenderer=nt,ht.Lexer=rt,ht.lexer=rt.lex,ht.Tokenizer=et,ht.Hooks=ot,ht.parse=ht;const ct=ht.options,dt=ht.setOptions,gt=ht.use,pt=ht.walkTokens,ut=ht.parseInline,ft=ht,mt=at.parse,Ct=rt.lex;t.Hooks=ot,t.Lexer=rt,t.Marked=st,t.Parser=at,t.Renderer=it,t.TextRenderer=nt,t.Tokenizer=et,t.getDefaults=e,t.lexer=Ct,t.marked=ht,t.options=ct,t.parse=ft,t.parseInline=ut,t.parser=mt,t.setOptions=dt,t.use=gt,t.walkTokens=pt})),OrgChart.events.on("renderbuttons",(function(t,e){if(e.node&&e.node.tags&&e.node.tags.has("group-dotted-lines")){var r=t.getScale(),i=OrgChart.t(e.node.templateName,e.node.min,r),n="";e.node.min?(i.nodeGroupDottedOpenButton||console.error(`[${e.node.templateName}].nodeGroupDottedOpenButton is not defined`),n+=`<g style="cursor:pointer;" data-ctrl-n-dotted-open="${e.node.id}" transform="matrix(1,0,0,1,${e.node.x},${e.node.y})">`,n+=i.nodeGroupDottedOpenButton):(i.nodeGroupDottedCloseButton||console.error(`[${e.node.templateName}].nodeGroupDottedCloseButton is not defined`),n+=`<g style="cursor:pointer;" transform="matrix(1,0,0,1,${e.node.x},${e.node.y})" data-ctrl-n-dotted-close="${e.node.id}">`,n+=i.nodeGroupDottedCloseButton),n=(n+="</g>").replaceAll("{cw}",e.node.w/2).replaceAll("{ch}",e.node.h/2).replaceAll("{ew}",e.node.w-(e.node.padding?e.node.padding[1]:0)).replaceAll("{eh}",e.node.h-(e.node.padding?e.node.padding[2]:0));var a=t.getNode(e.node.stChildrenIds[0]);if(-1!=n.indexOf("{collapsed-children-count}")){var o=OrgChart.collapsedChildrenCount(t,a);n=n.replace("{collapsed-children-count}",o)}if(-1!=n.indexOf("{collapsed-children-total-count}")){var s=OrgChart.collapsedChildrenTotalCount(t,a);n=n.replace("{collapsed-children-total-count}",s)}if(-1!=n.indexOf("{children-count}")){var l=OrgChart.childrenCount(t,a);n=n.replace("{children-count}",l)}if(-1!=n.indexOf("{children-total-count}")){var h=OrgChart.childrenTotalCount(t,a);n=n.replace("{children-total-count}",h)}e.html+=n}})),OrgChart.events.on("redraw",(function(t,e){if(t.config.groupDottedLines.length){for(var r=t.element.querySelectorAll("[data-ctrl-n-dotted-close]"),i=0;i<r.length;i++)r[i].addEventListener("click",(function(){var e=this.getAttribute("data-ctrl-n-dotted-close");t.minimize(e)}));var n=t.element.querySelectorAll("[data-ctrl-n-dotted-open]");for(i=0;i<n.length;i++)n[i].addEventListener("click",(function(){var e=this.getAttribute("data-ctrl-n-dotted-open");t.maximize(e)}))}})),void 0===OrgChart&&(OrgChart={}),OrgChart.prototype.undo=function(t){if(this.config.undoRedoStorageName){var e=this.undoStepsCount();if(0!=e){this._putInRedoStack();var r=`${this.config.undoRedoStorageName}_undo_`+(e-1),i=sessionStorage.getItem(r);sessionStorage.removeItem(r);var n=JSON.parse(i);this.config.nodes=n.nodes,this.config.clinks=n.clinks,this.config.slinks=n.slinks,this.config.groupDottedLines=n.groupDottedLines,this.config.dottedLines=n.dottedLines,this._ai.setContext(),OrgChart.events.publish("updated",[this]),this.filterUI.update(),this.draw(OrgChart.action.update,void 0,t),this.undoRedoUI.refresh()}}},OrgChart.prototype.redo=function(t){if(this.config.undoRedoStorageName){var e=this.redoStepsCount();if(0!=e){this._putInUndoStack();var r=`${this.config.undoRedoStorageName}_redo_`+(e-1),i=sessionStorage.getItem(r);sessionStorage.removeItem(r);var n=JSON.parse(i);this.config.nodes=n.nodes,this.config.clinks=n.clinks,this.config.slinks=n.slinks,this.config.groupDottedLines=n.groupDottedLines,this.config.dottedLines=n.dottedLines,this._ai.setContext(),OrgChart.events.publish("updated",[this]),this.filterUI.update(),this.draw(OrgChart.action.update,void 0,t),this.undoRedoUI.refresh()}}},OrgChart.prototype.clearRedo=function(){if(this.config.undoRedoStorageName){for(var t=`${this.config.undoRedoStorageName}_redo_`,e=Object.keys(sessionStorage),r=0;-1!=e.indexOf(t+r);)sessionStorage.removeItem(t+r),r++;this.undoRedoUI.refresh()}},OrgChart.prototype.clearUndo=function(){if(this.config.undoRedoStorageName){for(var t=`${this.config.undoRedoStorageName}_undo_`,e=Object.keys(sessionStorage),r=0;-1!=e.indexOf(t+r);)sessionStorage.removeItem(t+r),r++;this.undoRedoUI.refresh()}},OrgChart.prototype.undoStepsCount=function(){for(var t=`${this.config.undoRedoStorageName}_undo_`,e=Object.keys(sessionStorage),r=0;-1!=e.indexOf(t+r);)r++;return r},OrgChart.prototype.redoStepsCount=function(){for(var t=`${this.config.undoRedoStorageName}_redo_`,e=Object.keys(sessionStorage),r=0;-1!=e.indexOf(t+r);)r++;return r},OrgChart.prototype._putInUndoStack=function(){if(this.config.undoRedoStorageName){var t=`${this.config.undoRedoStorageName}_undo_`+this.undoStepsCount();sessionStorage.setItem(t,JSON.stringify({nodes:this.config.nodes,clinks:this.config.clinks,slinks:this.config.slinks,groupDottedLines:this.config.groupDottedLines,dottedLines:this.config.dottedLines}))}},OrgChart.prototype._putInRedoStack=function(){if(this.config.undoRedoStorageName){var t=`${this.config.undoRedoStorageName}_redo_`+this.redoStepsCount();sessionStorage.setItem(t,JSON.stringify({nodes:this.config.nodes,clinks:this.config.clinks,slinks:this.config.slinks,groupDottedLines:this.config.groupDottedLines,dottedLines:this.config.dottedLines}))}},void 0===OrgChart&&(OrgChart={}),OrgChart.undoRedoUI=function(){this.instance=null,this._event_id=OrgChart._guid()},OrgChart.undoRedoUI.prototype.init=function(t){t.config.undoRedoStorageName&&(this.instance=t,this.refresh())},OrgChart.undoRedoUI.prototype.refresh=function(){var t=this;if(this.instance.config.undoRedoStorageName){var e={undoStepsCount:this.instance.undoStepsCount(),redoStepsCount:this.instance.redoStepsCount()};if(!1!==OrgChart.events.publish("change",[this,e])){var r=this.instance.element.querySelector("[data-undo]"),i=this.instance.element.querySelector("[data-redo]");if(!r||!i){var n=document.createElement("div");n.classList.add("boc-undo-redo"),n.innerHTML=`<span data-undo>${OrgChart.icon.undo(50,50,"")}<span class="boc-undo-i"></span></span>\n <span data-redo>${OrgChart.icon.redo(50,50,"")}<span class="boc-redo-i"></span></span>`,this.instance.element.appendChild(n),r=this.instance.element.querySelector("[data-undo]"),i=this.instance.element.querySelector("[data-redo]"),r.addEventListener("click",(function(){t.instance.undo()})),i.addEventListener("click",(function(){t.instance.redo()}))}e.undoStepsCount>0?(r.classList.add("boc-ur-clickable"),r.querySelector(".boc-undo-i").innerHTML=e.undoStepsCount,r.querySelector(".boc-undo-i").style.display="inline-block"):(r.classList.remove("boc-ur-clickable"),r.querySelector(".boc-undo-i").style.display="none"),e.redoStepsCount>0?(i.classList.add("boc-ur-clickable"),i.querySelector(".boc-redo-i").innerHTML=e.redoStepsCount,i.querySelector(".boc-redo-i").style.display="inline-block"):(i.classList.remove("boc-ur-clickable"),i.querySelector(".boc-redo-i").style.display="none")}}},OrgChart.undoRedoUI.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},OrgChart.undoRedoUI.prototype.onChange=function(t){return this.on("change",(function(e,r){return t.call(e,r)}))},OrgChart.events.on("redraw",(function(t,e){if(t.config.miniMap){if(t.manager.action!=OrgChart.action.move){OrgChart.miniMap._settings._scale=Math.min(OrgChart.miniMap.width/(t.response.boundary.maxX-t.response.boundary.minX),OrgChart.miniMap.height/(t.response.boundary.maxY-t.response.boundary.minY)),OrgChart.miniMap._settings._translateX=-t.response.boundary.minX*OrgChart.miniMap._settings._scale+(OrgChart.miniMap.width-(t.response.boundary.maxX-t.response.boundary.minX)*OrgChart.miniMap._settings._scale)/2,OrgChart.miniMap._settings._translateY=-t.response.boundary.minY*OrgChart.miniMap._settings._scale+(OrgChart.miniMap.height-(t.response.boundary.maxY-t.response.boundary.minY)*OrgChart.miniMap._settings._scale)/2;var r=t.getViewBox();OrgChart.miniMap._init(t),OrgChart.miniMap._drawMainCanvas(t),OrgChart.miniMap._drawRectSelectorCanvas(t,r);var i,n,a,o,s=t.element.querySelector('[data-id="mini-map-focus"]'),l=!1,h=null;s.onmousedown=function(t){var e,a,o,h=s.getBoundingClientRect(),c=h.left,d=h.top;if(i=parseInt(t.clientX-c),n=parseInt(t.clientY-d),e=n,a=(i-OrgChart.miniMap._settings._translateX)/OrgChart.miniMap._settings._scale,o=(e-OrgChart.miniMap._settings._translateY)/OrgChart.miniMap._settings._scale,a>r[0]&&a<r[0]+r[2]&&o>r[1]&&o<r[1]+r[3])return t.preventDefault(),t.stopPropagation(),void(l=!0)},s.onmousemove=function(e){if(l){e.preventDefault(),e.stopPropagation(),OrgChart.miniMap._mouseMove=!0;var c=s.getBoundingClientRect(),d=c.left,g=c.top;a=parseInt(e.clientX-d),o=parseInt(e.clientY-g);var p=(a-i)/OrgChart.miniMap._settings._scale,u=(o-n)/OrgChart.miniMap._settings._scale;r[0]=p+r[0],r[1]=u+r[1],t.setViewBox(r),h&&(clearTimeout(h),h=null),h=setTimeout((function(){t._draw(!0,OrgChart.action.move)}),300),OrgChart.miniMap._drawRectSelectorCanvas(t,r),i=a,n=o}},s.onmouseup=function(t){l&&(t.preventDefault(),t.stopPropagation(),l=!1)},s.onmouseout=function(t){l&&(t.preventDefault(),t.stopPropagation(),l=!1,OrgChart.miniMap._mouseMove=!1)},s.onclick=function(e){if(e.preventDefault(),e.stopPropagation(),OrgChart.miniMap._mouseMove)OrgChart.miniMap._mouseMove=!1;else{var i=s.getBoundingClientRect(),n=i.left,l=i.top;a=parseInt(e.clientX-n),o=parseInt(e.clientY-l);var c=a/OrgChart.miniMap._settings._scale,d=o/OrgChart.miniMap._settings._scale;r[0]=c-(r[0]+r[2]-r[0])/2-OrgChart.miniMap._settings._translateX/OrgChart.miniMap._settings._scale,r[1]=d-(r[1]+r[3]-r[1])/2-OrgChart.miniMap._settings._translateY/OrgChart.miniMap._settings._scale,t.setViewBox(r),h&&(clearTimeout(h),h=null),h=setTimeout((function(){t._draw(!0,OrgChart.action.move)}),300),OrgChart.miniMap._drawRectSelectorCanvas(t,r)}}}}else{var c=t.element.querySelector('[data-id="mini-map"]');c&&c.parentNode.removeChild(c)}})),OrgChart.miniMap={},OrgChart.miniMap._settings={_translateX:0,_translateY:0,_scale:1},OrgChart.miniMap._drawMainCanvas=function(t){var e=t.element.querySelector('[data-id="mini-map-main"]'),r=e.getContext("2d");OrgChart.miniMap._initCtx(t,e,1);var i=0,n=[];!function t(e,a){if(Array.isArray(a))for(var o=0;o<a.length;o++)t(e,a[o]);else{r.fillStyle=OrgChart.miniMap.colors[3],r.beginPath(),r.lineWidth="0.5",r.fillRect(a.x,a.y,a.w,a.h),r.strokeRect(a.x,a.y,a.w,a.h);for(o=0;o<a.stChildrenIds.length;o++)i++,n.includes(a.id)||(1==i?r.fillStyle=OrgChart.miniMap.colors[0]:2==i?r.fillStyle=OrgChart.miniMap.colors[1]:3==i&&(r.fillStyle=OrgChart.miniMap.colors[2]),r.beginPath(),r.fillRect(a.x,a.y,a.w,a.h),r.strokeRect(a.x,a.y,a.w,a.h),n.push(a.id)),t(e,e.getNode(a.stChildrenIds[o])),i--;for(o=0;o<a.childrenIds.length;o++)t(e,e.getNode(a.childrenIds[o]))}}(t,t.roots)},OrgChart.miniMap._drawRectSelectorCanvas=function(t,e){var r=t.element.querySelector('[data-id="mini-map-focus"]'),i=r.getContext("2d");OrgChart.miniMap._initCtx(t,r,OrgChart.miniMap.opacity);var n=e[0],a=e[1],o=e[2],s=e[3];i.lineWidth=.5/OrgChart.miniMap._settings._scale,i.strokeStyle=OrgChart.miniMap.focusStroke,i.globalAlpha=1,i.clearRect(n,a,o,s),i.strokeRect(n,a,o,s)},OrgChart.miniMap._initCtx=function(t,e,r){var i=e.getContext("2d");e.width=e.width,e.height=e.height,i.clearRect(0,0,OrgChart.miniMap.width,OrgChart.miniMap.height),i.globalAlpha=r,1!=r&&(i.fillStyle=OrgChart.miniMap.selectorBackgroundColor,i.fillRect(0,0,OrgChart.miniMap.width,OrgChart.miniMap.height)),i.translate(OrgChart.miniMap._settings._translateX,OrgChart.miniMap._settings._translateY),i.scale(OrgChart.miniMap._settings._scale,OrgChart.miniMap._settings._scale)},OrgChart.miniMap._init=function(t){if(!t.element.querySelector('[data-id="mini-map"]')){var e=document.createElement("canvas");e.width=OrgChart.miniMap.width,e.height=OrgChart.miniMap.height,e.setAttribute("data-id","mini-map-main"),e.style.display="inline-block",e.style.backgroundColor=OrgChart.miniMap.backgroundColor,e.style.position="absolute",e.style.top=0,e.style.left=0;var r=document.createElement("canvas");r.width=OrgChart.miniMap.width,r.height=OrgChart.miniMap.height,r.setAttribute("data-id","mini-map-focus"),r.style.display="inline-block",r.style.position="absolute",r.style.top=0,r.style.left=0;var i=document.createElement("div");i.setAttribute("data-id","mini-map"),i.style.position="absolute";for(var n=["top","right","left","bottom"],a=0;a<n.length;a++){var o=n[a];OrgChart.isNEU(OrgChart.miniMap.position[o])||("padding"==OrgChart.miniMap.position[o]?i.style[o]=t.config.padding+"px":i.style[o]=OrgChart.miniMap.position[o]+"px")}i.style.border=OrgChart.miniMap.border,i.style.padding=OrgChart.miniMap.padding+"px",i.style.backgroundColor=OrgChart.miniMap.backgroundColor;var s=document.createElement("div");s.style.position="relative",s.style.width=OrgChart.miniMap.width+"px",s.style.height=OrgChart.miniMap.height+"px",s.appendChild(e),s.appendChild(r),i.appendChild(s),t.element.appendChild(i);var l=function(e,r){t.__mouseScrollHandler(i,r)};t._addEvent(i,"DOMMouseScroll",l),t._addEvent(i,"mousewheel",l);var h=0,c=0,d=function(t){OrgChart.miniMap._mouseMove=!0;var e=t.clientX-h,r=t.clientY-c;if(!OrgChart.isNEU(i.style.left)){var n=parseFloat(i.style.left)+e;i.style.left=`${n}px`}if(!OrgChart.isNEU(i.style.right)){var a=parseFloat(i.style.right)-e;i.style.right=`${a}px`}if(!OrgChart.isNEU(i.style.bottom)){var o=parseFloat(i.style.bottom)-r;i.style.bottom=`${o}px`}if(!OrgChart.isNEU(i.style.top)){var s=parseFloat(i.style.top)+r;i.style.top=`${s}px`}h=t.clientX,c=t.clientY},g=function(){document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",g)};OrgChart.miniMap.draggable&&i.addEventListener("mousedown",(function(t){h=t.clientX,c=t.clientY,document.addEventListener("mousemove",d),document.addEventListener("mouseup",g)}))}},OrgChart.miniMap.colors=["#E0E0E0","#BDBDBD","#9E9E9E","#757575"],OrgChart.miniMap.selectorBackgroundColor="white",OrgChart.miniMap.backgroundColor="white",OrgChart.miniMap.focusStroke="#f57c00",OrgChart.miniMap.opacity=.4,OrgChart.miniMap.border="1px solid #aeaeae",OrgChart.miniMap.width=250,OrgChart.miniMap.height=140,OrgChart.miniMap.padding=5,OrgChart.miniMap.position={top:void 0,left:"padding",right:void 0,bottom:"padding"},OrgChart.miniMap.draggable=!0,OrgChart._search={},OrgChart._search.search=function(t,e,r,i,n,a,o){var s=[],l=e.toLowerCase(),h=l.split(" ");if(o&&h.length>1){var c=h[0];o[c]&&(r=[o[c]],h=(l=l.replace(c,"").trim()).split(" "))}h=h.filter((function(t,e,r){return r.indexOf(t)===e}));for(var d={},g=0;g<t.length;g++)for(var p=t[g],u=0;u<r.length;u++){var f=r[u];if(!OrgChart.isNEU(p[f])){var m=p[f];if(null!=(e=OrgChart._search.searchAndComputeScore(h,m,f,a))){var C=p.id;if(d[C]){if(d[C]&&d[C]<e.__score){d[C]=e.__score;for(var b=s.length-1;b>=0;b--)s[b].id==C&&s.splice(b,1);OrgChart._search.addNodeToResult(s,i,p,e,f,n)}}else d[C]=e.__score,OrgChart._search.addNodeToResult(s,i,p,e,f,n)}}}return s.sort((function(t,e){return t.__score<e.__score?1:t.__score>e.__score?-1:0})),s},OrgChart._search.addNodeToResult=function(t,e,r,i,n,a){var o={};o.id=r.id,OrgChart.isNEU(r[a])||(o[a]=r[a]);for(var s=0;s<e.length;s++){var l=e[s];OrgChart.isNEU(r[l])||OrgChart.isNEU(o[l])&&(o[l]=r[l])}null!=i&&(OrgChart.isNEU(o.__score)&&(o.__score=i.__score),OrgChart.isNEU(o.__searchField)&&(o.__searchField=n),OrgChart.isNEU(o.__searchMarks)&&(o.__searchMarks=i.__searchMarks)),t.push(o)},OrgChart._search.searchAndComputeScore=function(t,e,r,i){if(OrgChart.isNEU(e))return null;if(OrgChart.isNEU(t))return null;if(!t.length)return null;"string"!=typeof e&&(e=e.toString());var n=e.toLowerCase(),a=OrgChart._search.searchIndexesOf(n,t);if(!a.length)return null;for(var o=n.length/100,s=0,l=0,h=s>0?100:0,c=0,d=0;d<t.length;d++)for(var g=t[d],p=0;p<a.length;p++)if(-1!=g.indexOf(a[p].searchPhrase)){c++;break}var u=100/(t.length/c);if(a.length){l=a[0].start;for(p=0;p<a.length;p++)if(s+=a[p].length,a[p].start<l&&(l=a[p].start),p>=1&&a[p-1].start>a[p].start){h=0;break}}var f=0;0!=s&&(f=s/o);var m=s>0?100:0;0!=l&&(m=100-l/o);var C=0;i&&i[r]&&(C=i[r]),u&&(u=u/100*50),f>0&&(f=f/100*10),m>0&&(m=m/100*10),h>0&&(h=h/100*10),C>0&&(C=C/100*20);var b=Math.round(1e4*(u+f+m+h+C));a.sort((function(t,e){return t.start<e.start?-1:t.start>e.start?1:0}));for(p=a.length-1;p>=0;p--)for(d=0;d<a.length;d++)d<p&&a[d].start+a[d].length>a[p].start&&a.splice(p,1);var v=e;for(p=a.length-1;p>=0;p--)v=(v=v.insert(a[p].start+a[p].length,"</mark>")).insert(a[p].start,"<mark>");return{__searchMarks:v,__score:b}},OrgChart._search.searchIndexesOf=function(t,e){var r=[];if(!OrgChart.isNEU(t))for(var i=0;i<e.length;i++){var n=e[i];if(!OrgChart.isNEU(n))for(var a=0;(a=t.indexOf(n,a))>-1;)r.push({length:n.length,start:a,searchPhrase:n}),a+=n.length}return r.sort((function(t,e){return t.length<e.length?1:t.length>e.length||t.start<e.start?-1:t.start>e.start?1:0})),r=r.filter((function(t){for(var e=!1,i=0;i<r.length;i++){var n=r[i].start,a=r[i].start+r[i].length-1,o=t.start,s=t.start+t.length-1;if(n==o&&a==s){e=!1;break}if(n>=o&&a<=s){e=!0;break}if(n<=o&&a>=s){e=!0;break}}return!e}))},OrgChart.events.on("redraw",(function(t,e){if(t.config.state){var r=[],i=[];!function t(e){if(Array.isArray(e))for(var n=0;n<e.length;n++)t(e[n]);else{("string"!=typeof e.id||"string"==typeof e.id&&-1==e.id.indexOf("split")&&-1==e.id.indexOf("mirror"))&&(r.push(e.id),1==e.min&&i.push(e.id));for(n=0;n<e.stChildren.length;n++)t(e.stChildren[n]);for(n=0;n<e.children.length;n++)t(e.children[n])}}(t.roots),OrgChart.state._put(t.config.roots,t.width(),t.height(),t.response.viewBox,r,i,t.response.adjustify,t.config.state)}})),OrgChart.state={},OrgChart.state._buildStateNames=function(t){return{paramScale:t+"-scale",paramX:t+"-x",paramY:t+"-y",paramExp:t+"-exp",paramMin:t+"-min",paramRoots:t+"-roots",paramAdjustify:t+"-adjustify"}},OrgChart.state._put=function(t,e,r,i,n,a,o,s){if(s&&!OrgChart.isNEU(n)&&0!=n.length){var l=OrgChart.state._buildStateNames(s.name),h={roots:t,scale:Math.min(e/i[2],r/i[3]),x:i[0],y:i[1],exp:n,min:a,adjustify:o};if(s.writeToUrlParams){var c=new URLSearchParams(window.location.search);c.has(l.paramScale)?c.set(l.paramScale,h.scale):c.append(l.paramScale,h.scale),c.has(l.paramX)?c.set(l.paramX,h.x):c.append(l.paramX,h.x),c.has(l.paramY)?c.set(l.paramY,h.y):c.append(l.paramY,h.y),c.has(l.paramExp)?c.set(l.paramExp,h.exp.join("*")):c.append(l.paramExp,h.exp.join("*")),c.has(l.paramRoots)&&Array.isArray(h.roots)?c.set(l.paramRoots,h.roots.join("*")):Array.isArray(h.roots)&&c.append(l.paramRoots,h.roots.join("*")),c.has(l.paramMin)?c.set(l.paramMin,h.min.join("*")):c.append(l.paramMin,h.min.join("*")),c.has(l.paramAdjustify)?c.set(l.paramAdjustify,h.adjustify.x+"*"+h.adjustify.y):c.append(l.paramAdjustify,h.adjustify.x+"*"+h.adjustify.y),window.history.replaceState(null,null,"?"+c)}s.writeToIndexedDB&&(h.id=s.name,OrgChart.idb.put(h,(function(t){0==t&&console.error("Cannot write row - "+s.name)}))),s.writeToLocalStorage&&OrgChart.localStorage.setItem(s.name,JSON.stringify(h))}},OrgChart.state._get=function(t,e,r,i){if(t){var n=OrgChart.state._buildStateNames(t.name);if(t.readFromUrlParams){var a=new URLSearchParams(window.location.search);if(a.has(n.paramScale)&&a.has(n.paramX)&&a.has(n.paramY)&&a.has(n.paramExp)&&a.has(n.paramMin)&&a.has(n.paramAdjustify)){var o={},s=parseFloat(a.get(n.paramScale)),l=parseFloat(a.get(n.paramX)),h=parseFloat(a.get(n.paramY));(d=[])[0]=l,d[1]=h,d[2]=e/s,d[3]=r/s,o.vb=d,o.scale=s,o.x=l,o.y=h,o.roots=null,a.has(n.paramRoots)&&(o.roots=a.get(n.paramRoots).split("*")),o.exp=a.get(n.paramExp).split("*"),o.min=a.get(n.paramMin).split("*");var c=a.get(n.paramAdjustify).split("*");return o.adjustify={x:parseFloat(c[0]),y:parseFloat(c[1])},void i(o)}if(!t.readFromIndexedDB&&!t.readFromLocalStorage)return void i(null)}if(t.readFromLocalStorage){var d;if(null!=(o=OrgChart.localStorage.getItem(t.name)))return o=JSON.parse(o),(d=[])[0]=o.x,d[1]=o.y,d[2]=e/o.scale,d[3]=r/o.scale,o.vb=d,void i(o);if(!t.readFromIndexedDB)return void i(null)}t.readFromIndexedDB&&OrgChart.idb.read(t.name,(function(n,a){if(0==n)console.error("Cannot read from - "+t.name),i(null);else if(null==n)i(null);else{var o=[];o[0]=a.x,o[1]=a.y,o[2]=e/a.scale,o[3]=r/a.scale,a.vb=o,i(a)}}))}else i(null)},OrgChart.state.clear=function(t){if(!t)return!1;try{localStorage.removeItem(t);var e=OrgChart.state._buildStateNames(t),r=new URLSearchParams(window.location.search);r.has(e.paramScale)&&r.delete(e.paramScale),r.has(e.paramX)&&r.delete(e.paramX),r.has(e.paramY)&&r.delete(e.paramY),r.has(e.paramExp)&&r.delete(e.paramExp),r.has(e.paramRoots)&&r.delete(e.paramRoots),r.has(e.paramMin)&&r.delete(e.paramMin),r.has(e.paramAdjustify)&&r.delete(e.paramAdjustify),window.history.replaceState(null,null,"?"+r),OrgChart.idb.delete(t,(function(e){0==e&&console.error("Cannot delete row - "+t)}))}catch{}},OrgChart._magnify={},OrgChart.prototype.magnify=function(t,e,r,i,n){i||(i=this.config.anim);var a=this.getNode(t),o=this.getNodeElement(t);if(a||o){var s=OrgChart._magnify[t];if(s&&(null!=s.timer&&clearInterval(s.timer),null!=s.timerBack&&clearInterval(s.timerBack),o.setAttribute("transform","matrix("+s.transformStart.toString()+")"),OrgChart._magnify[t]=null),r)o=o.cloneNode(!0),this.getSvg().appendChild(o);var l=OrgChart._getTransform(o),h=JSON.parse(JSON.stringify(l));h[0]=e,h[3]=e;var c=a.w+a.w*(e-1),d=a.h+a.h*(e-1);h[4]+=(a.w-c)/2,h[5]+=(a.h-d)/2;var g=OrgChart.animate(o,{transform:l},{transform:h},i.duration,i.func);OrgChart._magnify[t]={timer:g,transformStart:l,nodeElement:o,front:r},n&&n(o)}},OrgChart.prototype.magnifyBack=function(t,e,r){e||(e=this.config.anim);var i=OrgChart._magnify[t];if(i){null!=i.timer&&clearInterval(i.timer),null!=i.timerBack&&clearInterval(i.timerBack);var n=OrgChart._getTransform(i.nodeElement);i.timerBack=OrgChart.animate(i.nodeElement,{transform:n},{transform:i.transformStart},e.duration,e.func,(function(t){var e=t[0].getAttribute(OrgChart.attr.node_id);OrgChart._magnify[e]&&OrgChart._magnify[e].front&&(t[0].parentNode.removeChild(t[0]),OrgChart._magnify[e]=null),r&&r(t[0])}))}},void 0===OrgChart&&(OrgChart={}),OrgChart.events.on("init",(function(t,e){if(t.config.keyNavigation&&(t._addEvent(window,"keydown",t._windowKeyDownHandler),OrgChart.isNEU(t._keyNavigationActiveNodeId)&&t.roots&&t.roots.length)){var r=t.roots[0].id;OrgChart.isNEU(t.config.keyNavigation.focusId)||(r=t.config.keyNavigation.focusId),t._keyNavigationActiveNodeId=r,t.center(t._keyNavigationActiveNodeId)}})),OrgChart.prototype._windowKeyDownHandler=function(t,e){for(var r=e.target,i=null;r&&r!=this.element;){if(r.hasAttribute&&r.hasAttribute(OrgChart.attr.node_id)){i=r.getAttribute(OrgChart.attr.node_id);break}r=r.parentNode}if(r){var n=i?this.getNode(i):null,a={node:n,data:i?this.get(i):null,event:e};if(!1!==OrgChart.events.publish("key-down",[this,a])&&n)if("KeyF"==e.code)this.searchUI.find("");else if("ArrowRight"==e.code||n.isAssistant&&"ArrowDown"==e.code||n.isPartner&&"ArrowDown"==e.code){if(l=this.getNode(n.pid)){var o=l.childrenIds.indexOf(n.id);if(++o<l.childrenIds.length){var s=l.childrenIds[o];this._keyNavigationActiveNodeId=s,this.center(s)}}}else if("ArrowLeft"==e.code){if(l=this.getNode(n.pid)){o=l.childrenIds.indexOf(n.id);if(--o>=0){s=l.childrenIds[o];this._keyNavigationActiveNodeId=s,this.center(s)}}}else if("ArrowUp"==e.code){var l;if(l=this.getNode(n.pid)){s=l.id;if(n.isAssistant||l.hasAssistants||n.isPartner||l.hasPartners){o=l.childrenIds.indexOf(n.id);--o>=0&&(s=l.childrenIds[o])}this._keyNavigationActiveNodeId=s,this.center(s)}}else if("ArrowDown"==e.code)n.childrenIds.length&&(this._keyNavigationActiveNodeId=n.childrenIds[0],this.center(n.childrenIds[0]));else if("Space"==e.code){var h=r.getAttribute(OrgChart.attr.node_id);return void this.toggleExpandCollapse(h,e)}}},OrgChart.events.on("redraw",(function(t,e){t.config.keyNavigation&&OrgChart._keyNavigation(t)})),OrgChart.events.on("click",(function(t,e){t.config&&t.config.keyNavigation&&(t._keyNavigationActiveNodeId=e.node.id,t.center(e.node.id))})),OrgChart._keyNavigation=function(t){var e=t.element.querySelector(":focus");if(e&&e.parentElement&&e.parentElement.hasAttribute(OrgChart.attr.node_id)){var r=e.parentElement;(n=(i=e).querySelector("title"))&&n.parentNode.removeChild(n),i.removeAttribute("tabindex")}if(!OrgChart.isNEU(t._keyNavigationActiveNodeId)&&((r=t.getNodeElement(t._keyNavigationActiveNodeId))&&r.children.length)){var i;(i=r.children[0]).setAttribute("tabindex",2);var n,a={text:"",id:t._keyNavigationActiveNodeId};if(OrgChart.events.publish("screen-reader-text",[t,a]),!OrgChart.isNEU(a.text))(n=document.createElementNS("http://www.w3.org/2000/svg","title")).innerHTML=a.text,i.appendChild(n);OrgChart.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&t.searchUI.hide(),i.focus()}},OrgChart.elements={},OrgChart.elements.textbox=function(t,e,r,i){var n=OrgChart.elements._vidrf(t,e,i);if(n.doNotRender)return{html:""};var a="";return e.btn&&(a=`<a href="#" data-input-btn="" class="boc-link boc-link-boc-button">${e.btn}</a>`),{html:`<div class="boc-form-field" style="min-width: ${r};">\n <div class="boc-input" data-boc-input="" ${n.disabledAttribute} ${n.vlidators}>\n <label for="${n.id}">${OrgChart._escapeGreaterLessSign(n.label)}</label>\n <input ${n.readOnlyAttribute} data-binding="${OrgChart._escapeDoubleQuotes(n.binding)}" maxlength="256" id="${n.id}" name="${n.id}" type="text" value="${OrgChart._escapeDoubleQuotes(n.value)}" autocomplete="off">\n ${a}\n </div>\n </div>`,id:n.id,value:n.value}},OrgChart.elements.checkbox=function(t,e,r,i){var n=OrgChart.elements._vidrf(t,e,i);if(n.doNotRender)return{html:""};var a=n.value?"checked":"",o=i?'onclick="return false;"':"";return{html:`<div class="boc-form-field" style="min-width: ${r};" >\n <label class="boc-checkbox" data-boc-input="" ${n.disabledAttribute}>\n <input ${a} ${o} data-binding="${OrgChart._escapeDoubleQuotes(n.binding)}" type="checkbox"><span class="boc-checkbox-checkmark" type="checkbox"></span>${OrgChart._escapeGreaterLessSign(n.label)}\n </label>\n </div>`,id:n.id,value:a}},OrgChart.elements.select=function(t,e,r,i){if(i)return OrgChart.elements.textbox(t,e,r,i);var n=OrgChart.elements._vidrf(t,e,i);return n.doNotRender?{html:""}:{html:`<div class="boc-form-field" style="min-width: ${r};">\n <div class="boc-input" data-boc-input="" ${n.disabledAttribute} ${n.vlidators}>\n <label for="${n.id}">${OrgChart._escapeGreaterLessSign(n.label)}</label>\n <select data-binding="${OrgChart._escapeDoubleQuotes(n.binding)}" ${n.readOnlyAttribute} id="${n.id}" name="${n.id}">\n ${function(){for(var t="",e=0;e<n.options.length;e++){var r=n.options[e];t+=`<option ${r.value==n.value?"selected":""} value="${OrgChart._escapeDoubleQuotes(r.value)}">${OrgChart._escapeGreaterLessSign(r.text)}</option>`}return t}()} \n </select>\n </div>\n </div>`,id:n.id,value:n.value}},OrgChart.elements.multiSelect=function(t,e,r,i){if(i)return OrgChart.elements.textbox(t,e,r,i);var n=OrgChart.elements._vidrf(t,e,i);return n.doNotRender?{html:""}:{html:`<div class="boc-form-field" style="min-width: ${r};">\n <div class="boc-input" data-boc-input="" ${n.disabledAttribute} ${n.vlidators}>\n <label for="${n.id}">${OrgChart._escapeGreaterLessSign(n.label)}</label>\n <select class="multiple" data-binding="${OrgChart._escapeDoubleQuotes(n.binding)}" ${n.readOnlyAttribute} id="${n.id}" name="${n.id}" multiple>\n ${function(){for(var t="",e=0;e<n.options.length;e++){var r=n.options[e];t+=`<option ${n.value.includes(r.value)?"selected":""} value="${OrgChart._escapeDoubleQuotes(r.value)}">${OrgChart._escapeGreaterLessSign(r.text)}</option>`}return t}()} \n </select>\n </div>\n </div>`,id:n.id,value:n.value}},OrgChart.elements.date=function(t,e,r,i){var n=OrgChart.elements._vidrf(t,e,i);return n.doNotRender?{html:""}:{html:`<div class="boc-form-field" style="min-width: ${r};">\n <div class="boc-input" data-boc-input="" ${n.disabledAttribute} ${n.vlidators}>\n <label for="${n.id}" class="hasval">${OrgChart._escapeGreaterLessSign(n.label)}</label>\n <input data-binding="${OrgChart._escapeDoubleQuotes(n.binding)}" ${n.readOnlyAttribute} maxlength="256" id="${n.id}" name="${n.id}" type="date" value="${OrgChart._escapeDoubleQuotes(n.value)}" autocomplete="off">\n </div>\n </div>`,id:n.id,value:n.value}},OrgChart.elements._vidrf=function(t,e,r){var i={};if(e.binding||(e.binding=""),e.label||(e.label=""),"select"!=e.type||Array.isArray(e.options)?i.options=e.options:i.options=[],i.value=t&&!OrgChart.isNEU(t[e.binding])?t[e.binding]:"",r&&i.options)for(var n=0;n<i.options.length;n++)if(i.options[n].value==i.value){i.value=i.options[n].text;break}if(i.id=OrgChart.elements.generateId(),i.disabledAttribute=r?"data-boc-input-disabled":"",i.readOnlyAttribute=r?"readonly":"",i.id=i.id,r&&OrgChart.isNEU(i.value)&&(i.doNotRender=!0),r&&"photo"==e.binding&&(i.id=null,i.doNotRender=!0),i.binding=e.binding,i.label=e.label,i.vlidators="",e.vlidators)for(var a in e.vlidators)i.vlidators+=`data-v-${a}="${e.vlidators[a]}" `;return i},OrgChart.elements.ids=[],OrgChart.elements.generateId=function(){for(;;){var t="_"+("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4);if(!OrgChart.elements.ids.has(t))return OrgChart.elements.ids.push(t),t}},OrgChart.input={},OrgChart.input._timeout=null,OrgChart.input.initWithTimeout=function(){OrgChart.input._timeout&&(clearTimeout(OrgChart.input._timeout),OrgChart.input._timeout=null),OrgChart.input._timeout=setTimeout(OrgChart.input.init,200)},OrgChart.input.init=function(t){var e;e=t?t.querySelectorAll("[data-boc-input]"):document.querySelectorAll("[data-boc-input]");for(var r=0;r<e.length;r++){var i=e[r],n=null;i.type&&"hidden"==i.type.toLowerCase()&&(n=i),n||(n=i.querySelector("input")),n||(n=i.querySelector("select"));var a=i.querySelector("label");a&&(n.value||"select-one"==n.type&&n.selectedOptions&&n.selectedOptions.length&&""==n.selectedOptions[0].value&&n.selectedOptions[0].innerHTML)&&a.classList.add("hasval"),"checkbox"!=n.type.toLowerCase()&&n.addEventListener("focus",(function(){this.classList.remove("boc-validation-error");var t=this.parentNode.querySelector("label");t.classList.add("focused");var e=t.querySelector(".boc-validation-error-message");e&&e.parentNode.removeChild(e)})),"checkbox"!=n.type.toLowerCase()&&n.addEventListener("blur",(function(){OrgChart.input.blurHandler(this)}))}},OrgChart.input.blurHandler=function(t){var e=t.parentNode.querySelector("label");e.classList.remove("focused"),t.value||"date"==t.type?e.classList.add("hasval"):e.classList.remove("hasval")},OrgChart.input.validate=function(t){var e=null;t.type&&"hidden"==t.type.toLowerCase()&&(e=t),e||(e=t.querySelector("input")),e||(e=t.querySelector("select"));var r=t.querySelector("label");if(e.classList.remove("boc-validation-error"),r){var i=r.querySelector(".boc-validation-error-message");i&&i.parentNode.removeChild(i)}!e.selectedOptions&&e.value&&(e.value=e.value.trim());var n=t.getAttribute("data-v-required"),a=t.getAttribute("data-v-password"),o=t.getAttribute("data-v-email"),s=t.getAttribute("data-v-emails");return n&&""==e.value?(r.innerHTML+='<span class="boc-validation-error-message"> '+n+"</span>",e.classList.add("boc-validation-error"),!1):a&&!OrgChart.input.validatePassword(e.value)?(r.innerHTML+='<span class="boc-validation-error-message"> '+a+"</span>",e.classList.add("boc-validation-error"),!1):o&&!OrgChart.input.isValidEmail(e.value)?(r.innerHTML+='<span class="boc-validation-error-message"> '+o+"</span>",e.classList.add("boc-validation-error"),!1):!(s&&!OrgChart.input.isValidEmails(e.value))||(r.innerHTML+='<span class="boc-validation-error-message"> '+s+"</span>",e.classList.add("boc-validation-error"),!1)},OrgChart.input.validateAndGetData=function(t){for(var e=t.querySelectorAll("[data-boc-input]"),r=!0,i=0;i<e.length;i++){var n=e[i];OrgChart.input.validate(n)||(r=!1)}if(!r)return!1;var a=t.querySelectorAll("[data-binding]"),o={};for(i=0;i<a.length;i++){var s=a[i],l=s.getAttribute("data-binding");if("checkbox"==s.type.toLowerCase())o[l]=s.checked;else if(s.selectedOptions&&s.hasAttribute("multiple")){var h=s.selectedOptions;o[l]=Array.from(h).map((({value:t})=>t))}else o[l]=s.value}return o},OrgChart.input.validatePassword=function(t){return t&&(t=t.trim()),!(t.length<5)&&(!(t.length>18)&&-1==t.indexOf(" "))},OrgChart.input.isValidEmails=function(t){if(t)for(var e=t.split(","),r=0;r<e.length;r++){var i=e[r].trim();if(!OrgChart.input.isValidEmail(i))return!1}return!0},OrgChart.input.isValidEmail=function(t){t&&(t=t.trim());return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(t).toLowerCase())};OrgChart.ui.css=function(){return'<style data-boc-styles>.boc-ai-form{position:fixed;top:0;left:0;height:100%;width:100%;box-shadow:rgba(0,0,0,.2) 0 6px 6px 0,rgba(0,0,0,.19) 0 13px 20px 0;display:flex;flex-direction:column;height:100%;width:400px}.boc-dark .boc-ai-form{color:#aeaeae}.boc-light .boc-ai-form{color:#757575}.boc-ai-messages{font-size:16px}@media screen and (max-width:1000px){.boc-ai-form{width:100%}}.boc-dark .boc-ai-form{background-color:#252526}.boc-light .boc-ai-form{background-color:#fff}.boc-ai-button{font-size:32px;position:absolute;top:20px;left:20px;cursor:pointer;padding:12px;border-radius:50%;user-select:none}.boc-dark .boc-ai-button{color:#aeaeae}.boc-light .boc-ai-button{color:#757575}.boc-ai-button:hover{color:#fff;background-color:#039be5}.boc-ai-container{padding:0 14px;display:grid;grid-template-rows:40px auto 80px;gap:10px;height:100%}.boc-ai-container .boc-input input{padding-right:50px}.boc-ai-close{text-align:end;margin-top:20px}.boc-ai-close svg{cursor:pointer}.boc-ai-start{text-align:center;display:flex;justify-content:center;align-items:center;user-select:none}.boc-ai-start span{font-weight:700;font-size:32px;font:"Segoe UI",Arial,sans-serif;background:linear-gradient(90deg,#039be5 28%,#f57c00,#ffca28);color:transparent!important;background-clip:text;display:inline-block;padding:10px 0}.boc-ai-send.boc-ai-send-cansend{cursor:pointer;background-color:#039be5}.boc-ai-send.boc-ai-send-cansend:hover{background-color:#f57c00}.boc-ai-send.boc-ai-send-cansend:active{background-color:#ffca28}.boc-ai-send{background-color:transparent;position:absolute;right:7px;top:7px;width:38px;height:38px;border-radius:50%;text-align:center;background-repeat:no-repeat;background-position:center;background-size:20px 20px}.boc-ai-send svg{display:block;margin:auto;height:100%}.boc-ai-user-message{text-align:end;margin:14px 0}.boc-inner-user-message{padding:7px;border-radius:7px;display:inline-block}.boc-ai-middle{overflow-y:auto}.boc-ai-middle::-webkit-scrollbar{display:none}.boc-button{background-color:#039be5;cursor:pointer;width:calc(100%);height:50px;color:#fff;padding-top:5px;padding-left:7px;padding-right:7px;text-align:center;text-transform:uppercase;border:1px solid #3fc0ff;display:inline-block;border-radius:5px}.boc-button.orange{background-color:#f57c00;border:1px solid #ffa03e}.boc-button.yellow{background-color:#ffca28;border:1px solid #ffdf7c}.boc-button.lower{text-transform:unset}.boc-button.transparent{background-color:transparent}.boc-button:hover{background-color:#35afea}.boc-button.orange:hover{background-color:#f79632}.boc-button.yellow:hover{background-color:#ffd452}.boc-button:active{transform:matrix(.98,0,0,.98,0,0)}.boc-button-icon{text-align:initial;cursor:pointer;margin-bottom:15px;color:#039be5}.boc-dark .boc-button-icon:hover{background-color:#2d2d2d}.boc-light .boc-button-icon:hover{background-color:#ececec}.boc-button-icon>img{height:24px;width:24px;vertical-align:middle;padding:7px}.boc-button:focus{outline:0}.boc-button-icon>img{filter:invert(46%) sepia(66%) saturate(2530%) hue-rotate(171deg) brightness(95%) contrast(98%)}.boc-light .boc-button.transparent{color:#039be5}.boc-light .boc-button.transparent:hover{color:#fff}.boc-button-loading{background-color:transparent;cursor:pointer;width:calc(100% - 2px);height:50px;color:#fff;text-align:center;text-transform:uppercase;border:1px solid #027cb7;display:inline-block;display:flex;justify-content:center;align-items:center;display:none}.boc-button-loading .boc-loading-dots div{margin:0 10px}.boc-link-boc-button{position:absolute;right:10px;top:-1px}@media screen and (max-width:1000px){.boc-link-boc-button{right:50px}}[data-boc-input-disabled] .boc-link-boc-button{display:none}[dir=rtl] .boc-link-boc-button{left:10px;right:unset}.boc-img-button{width:48px;height:48px;cursor:pointer;border-radius:50%;background-color:#039be5;background-repeat:no-repeat;background-size:24px 24px;background-position:center center;margin:3px;display:inline-block}.boc-img-button:hover{background-color:#f57c00}.boc-checkbox{display:block;position:relative;padding-left:35px;margin-bottom:12px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap}.boc-checkbox input{position:absolute;opacity:0;cursor:pointer;height:0;width:0}.boc-checkbox-checkmark{position:absolute;top:0;left:0;height:25px;width:25px;border-radius:5px}.boc-dark [data-boc-input-disabled] .boc-checkbox-checkmark,.boc-dark [data-boc-input-disabled].boc-checkbox input:checked~.boc-checkbox-checkmark,.boc-light [data-boc-input-disabled] .boc-checkbox-checkmark,.boc-light [data-boc-input-disabled].boc-checkbox input:checked~.boc-checkbox-checkmark{background-color:#aeaeae!important}[data-boc-input-disabled].boc-checkbox{cursor:default}[dir=rtl] .boc-checkbox-checkmark{right:0}[dir=rtl] .boc-checkbox{padding-left:unset;padding-right:35px}.boc-dark .boc-checkbox-checkmark{background-color:#333;border:1px solid #5b5b5b}.boc-light .boc-checkbox-checkmark{background-color:#fff;border:1px solid #c7c7c7}.boc-dark .boc-checkbox:hover input~.boc-checkbox-checkmark{background-color:#3c3c3c}.boc-light .boc-checkbox:hover input~.boc-checkbox-checkmark{background-color:#f8f9f9}.boc-dark .boc-checkbox input:checked~.boc-checkbox-checkmark{background-color:#039be5}.boc-light .boc-checkbox input:checked~.boc-checkbox-checkmark{background-color:#039be5}.boc-checkbox-checkmark:after{content:"";position:absolute;display:none}.boc-checkbox input:checked~.boc-checkbox-checkmark:after{display:block}.boc-checkbox .boc-checkbox-checkmark:after{left:9px;top:5px;width:5px;height:10px;border:solid #fff;border-width:0 3px 3px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.boc-filter{user-select:none}.boc-light .boc-filter{color:#757575}.boc-dark .boc-filter{color:#ccc}.boc-filter>div>div{display:inline-block;padding:3px 10px;cursor:pointer}.boc-filter-menu fieldset,.boc-filter>div,.filter-field-selected{border-radius:5px}.boc-filter-menu fieldset{overflow-y:auto;max-height:300px}.boc-filter>div.boc-filter-menu{padding:10px}.boc-light .boc-filter>div.boc-filter-menu,.boc-light .filter-field-selected{background-color:#f8f9f9}.boc-dark .boc-filter>div.boc-filter-menu,.boc-dark .filter-field-selected{background-color:#3c3c3c}.boc-light .boc-filter>div{background-color:#eee}.boc-dark .boc-filter>div{background-color:#333}.boc-form-perspective{transform-style:preserve-3d;perspective:500px;position:absolute;top:32px}.boc-form{box-shadow:rgba(0,0,0,.2) 0 6px 6px 0,rgba(0,0,0,.19) 0 13px 20px 0;padding:14px;transform-origin:top center;user-select:none;display:none;position:relative;max-height:calc(100vh - 100px);overflow-y:auto;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.boc-form-bottom{border-bottom-left-radius:unset;border-bottom-right-radius:unset;border-top-left-radius:5px;border-top-right-radius:5px}.boc-form .separator{margin:0 10px}@media screen and (max-width:1000px){.boc-form-perspective{min-width:100%;max-height:calc(100% - 32px);left:unset!important;right:unset!important;transform:none!important}.boc-form .set{max-height:calc(100vh - 74px)}.boc-form-fieldset{max-width:unset!important}}.boc-light .boc-form .separator{border-bottom:1px solid #c7c7c7}.boc-dark .boc-form .separator{border-bottom:1px solid #5b5b5b}.boc-light .boc-form{background-color:#fff}.boc-dark .boc-form{background-color:#252526}.boc-item{padding:6px 12px 6px 12px;display:flex;flex-direction:row}.boc-light .boc-form .boc-item.selected,.boc-light .boc-form .boc-item:hover{background-color:#0074e8;color:#fff}.boc-dark .boc-form .boc-item.selected,.boc-dark .boc-form .boc-item:hover{background-color:#094771;color:#fff}.boc-item.selected img,.boc-item:hover img{filter:invert(100%)}.boc-item.selected img{visibility:visible!important}.boc-form-fieldset{display:flex;flex-wrap:wrap;margin:0!important}.boc-form-field{flex:1 0 21%;margin:3px;min-width:200px}.boc-form-field-100{flex:1 0 96%;margin:3px;min-width:200px}.boc-input{position:relative}.boc-input>input,.boc-input>select{height:50px;padding:18px 10px 2px 9px;width:100%;box-sizing:border-box;border-style:solid;border-width:1px}.boc-input select{height:50px;padding:20px 5px 4px 5px}[data-boc-input-disabled].boc-input>input,[data-boc-input-disabled].boc-input>select{border-color:transparent!important}.boc-light [data-boc-input-disabled]>input,.boc-light [data-boc-input-disabled]>select{background-color:#fff!important}.boc-dark [data-boc-input-disabled]>input,.boc-dark [data-boc-input-disabled]>select{background-color:#252526!important}[data-boc-input-disabled]>select{appearance:none;padding-left:8px}.boc-input>label{display:inline-block;position:absolute;padding-left:10px;padding-right:10px;color:#acacac;cursor:text;-webkit-transition:all .1s ease-out;-moz-transition:all .1s ease-out;-ms-transition:all .1s ease-out;-o-transition:all .1s ease-out;transition:all .1 ease-out;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:initial;text-align:initial;white-space:nowrap}.boc-input>label{top:12px;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 14px)}.boc-input>label.focused,.boc-input>label.hasval{top:-1px}.boc-input>input,.boc-input>select{outline:0;border-radius:5px}.boc-dark .boc-input>label.focused,.boc-light .boc-input>label.focused{color:#039be5}.boc-dark .boc-input>input,.boc-dark .boc-input>select{color:#ccc;background-color:#333;border-color:#5b5b5b}.boc-light .boc-input>input,.boc-light .boc-input>select{color:#757575;background-color:#fff;border-color:#c7c7c7}.boc-light .boc-input>input:focus,.boc-light .boc-input>select:focus{border-color:#039be5;background-color:#f8f9f9}.boc-dark .boc-input>input:focus,.boc-dark .boc-input>select:focus{border-color:#039be5;background-color:#3c3c3c}.boc-dark .boc-input>input.boc-validation-error,.boc-dark .boc-input>select.boc-validation-error,.boc-light .boc-input>input.boc-validation-error,.boc-light .boc-input>select.boc-validation-error{border-color:#ca2a2a}.boc-dark .boc-validation-error-message,.boc-light .boc-validation-error-message{color:#ca2a2a}.boc-input select.multiple{height:initial}.boc-link{color:#039be5;cursor:pointer;text-decoration:underline}.boc-link:hover{color:#f57c00}.boc-dark ::-webkit-scrollbar,.boc-light ::-webkit-scrollbar{width:15px;height:15px}.boc-dark ::-webkit-scrollbar-corner{background:#1e1e1e}.boc-dark ::-webkit-scrollbar-track{background:#1e1e1e;border-left:1px solid #333;border-top:1px solid #333}.boc-dark ::-webkit-scrollbar-thumb{background:#424242}.boc-dark ::-webkit-scrollbar-thumb:hover{background:#4f4f4f}.boc-dark ::-webkit-scrollbar-thumb:active{background:#5e5e5e}.boc-light ::-webkit-scrollbar-corner{background:#fff}.boc-light ::-webkit-scrollbar-track{background:#fff;border-left:1px solid #ddd;border-top:1px solid #ddd}.boc-light ::-webkit-scrollbar-thumb{background:#c1c1c1}.boc-light ::-webkit-scrollbar-thumb:hover{background:#929292}.boc-light ::-webkit-scrollbar-thumb:active{background:#666}.boc-edit-form{position:fixed;top:0;right:0;height:100%;width:100%;box-shadow:rgba(0,0,0,.2) 0 6px 6px 0,rgba(0,0,0,.19) 0 13px 20px 0;display:flex;flex-direction:column;height:100%;width:400px}@media screen and (max-width:1000px){.boc-edit-form{width:100%}}.boc-dark .boc-edit-form{background-color:#252526}.boc-light .boc-edit-form{background-color:#fff}.boc-edit-form-header{height:200px;text-align:center;border-radius:10px}.export-service .boc-edit-form-header{border-radius:unset}.boc-edit-form-title{color:#fff;margin:0;padding:14px 17px 7px 17px}.boc-edit-form-avatar{border-radius:50%;width:150px;height:150px;position:absolute;top:75px;border:5px solid #fff;left:50%;transform:translateX(-50%);background-color:#cacaca;box-shadow:rgba(0,0,0,.2) 0 6px 6px 0,rgba(0,0,0,.19) 0 13px 20px 0}.boc-edit-form-close{position:absolute;right:14px;top:14px;width:34px;height:34px;cursor:pointer}.boc-edit-form-fields{flex-grow:1;overflow-y:auto;overflow-x:hidden}.boc-edit-form-fields-inner{margin:0 7px 20px 7px}.boc-ai-user-message{text-align:end;margin:14px 0}.boc-inner-user-message{padding:7px;border-radius:7px;display:inline-block}.dark .boc-inner-user-message{background-color:#333}.light .boc-inner-user-message{background-color:#f9f9f9}.boc-chart-menu{opacity:0;display:inline-block;position:absolute;text-align:left;user-select:none;min-width:270px;box-shadow:rgba(0,0,0,.2) 0 4px 8px 0,rgba(0,0,0,.19) 0 6px 20px 0;font:13px/28px Helvetica,"Segoe UI",Arial,sans-serif;border-radius:10px}.boc-chart-menu>div:hover img{filter:invert(100%)}.boc-chart-menu [data-item]{text-align:start;padding:7px 10px}.boc-dark .boc-chart-menu [data-item]{background-color:#252526;color:#acacac;border-bottom:1px solid #333}.boc-dark .boc-chart-menu [data-item]:hover{background-color:#094771!important;color:#fff!important}.boc-dark .boc-chart-menu [data-item]:hover svg{filter:brightness(0) invert(1)}.boc-light .boc-chart-menu [data-item]{background-color:#fff;color:#333;border-bottom:1px solid #c7c7c7}.boc-light .boc-chart-menu [data-item]:hover{background-color:#0074e8!important;color:#fff!important}.boc-light .boc-chart-menu [data-item]:hover svg{filter:brightness(0) invert(1)}.boc-chart-menu [data-item] svg{vertical-align:middle}.boc-chart-menu [data-item]:first-child{border-top-left-radius:7px;border-top-right-radius:7px}.boc-chart-menu [data-item]:last-child{border-bottom-width:0;border-bottom-style:none;border-bottom-left-radius:7px;border-bottom-right-radius:7px}.boc-search{position:absolute}@media screen and (max-width:500px){.boc-search{width:calc(100% - 30px);left:15px}}.boc-search .boc-input{margin-bottom:0}.boc-search-input{color:#7a7a7a;width:100%;border:none;outline:0;padding-top:10px;padding-right:47px}.boc-search-image-td{width:43px}.boc-search-text-td{padding-inline-end:7px;line-height:15px;text-align:start}.boc-search table{box-shadow:rgba(0,0,0,.2) 0 4px 8px 0,rgba(0,0,0,.19) 0 6px 20px 0;margin:0 3.5px 0 3.5px;width:calc(100% - 7px);border-radius:7px}.boc-search table tr:first-child td:first-child{border-top-left-radius:7px}.boc-search table tr:first-child td:last-child{border-top-right-radius:7px}[dir=rtl] .boc-search table tr:first-child td:first-child{border-top-left-radius:unset;border-top-right-radius:7px}[dir=rtl] .boc-search table tr:first-child td:last-child{border-top-right-radius:unset;border-top-left-radius:7px}.boc-search table tr:last-child td:first-child{border-bottom-left-radius:7px}.boc-search table tr:last-child td:last-child{border-bottom-right-radius:7px}[dir=rtl] .boc-search table tr:last-child td:first-child{border-bottom-left-radius:unset;border-bottom-right-radius:7px}[dir=rtl] .boc-search table tr:last-child td:last-child{border-bottom-right-radius:unset;border-bottom-left-radius:7px}.boc-dark .boc-search table{background-color:#252526;color:#acacac}.boc-search [data-search-item-id]{cursor:pointer}.boc-search-photo{margin:7px 7px 0 7px;width:32px;height:32px;background-size:cover;background-position:top center;border-radius:50%;display:inline-block;border:1px solid #8c8c8c}.boc-search [data-search-item-id]:hover .boc-link{color:#ffca28}.boc-search [data-search-item-id]:hover .boc-link:hover{color:#f57c00}.boc-dark .boc-search [data-search-item-id] td{border-top:1px solid #333}.boc-dark .boc-search [data-search-item-id]:hover,.boc-dark .boc-search [data-selected=yes]{background-color:#094771;color:#fff}.boc-light .boc-search table{background-color:#fff;color:#333}.boc-light .boc-search [data-search-item-id] td{border-top:1px solid #c7c7c7}.boc-light .boc-search [data-search-item-id]:hover,.boc-light .boc-search [data-selected=yes]{background-color:#0074e8;color:#fff}.boc-search [data-search-item-id]:first-child td{border-top:unset}.boc-ripple-container{position:absolute;top:0;right:0;bottom:0;left:0}.boc-drag-over rect{opacity:.5}.boc-ripple-container span{transform:scale(0);border-radius:100%;position:absolute;opacity:.75;background-color:#fff;animation:boc-ripple 1s}@-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)}}.boc-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:.4s;transition:.4s}.boc-slider:before{position:absolute;content:"";height:16px;width:16px;left:4px;bottom:4px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.boc-slider.round{border-radius:24px}.boc-slider.round:before{border-radius:50%}svg text:hover{cursor:default}svg.boc-cursor-grab,svg.boc-cursor-grab text:hover{cursor:grab}svg.boc-cursor-nodrop,svg.boc-cursor-nodrop text:hover{cursor:no-drop}svg.boc-cursor-copy,svg.boc-cursor-copy text:hover{cursor:copy}svg.boc-cursor-move,svg.boc-cursor-move text:hover{cursor:move}#boc-close-btn:focus,#boc-close-btn:hover{color:#000;text-decoration:none;cursor:pointer}#boc-id-select:focus{outline:.5px solid #aeaeae}#boc-sampleDialog #title:hover{cursor:default;background:gray}.boc-light{background-color:#fff;font:13px/28px Helvetica,"Segoe UI",Arial,sans-serif}.boc-dark{background-color:#1e1e1e;font:13px/28px Helvetica,"Segoe UI",Arial,sans-serif}.boc-light .boc-fill{fill:#fff}.boc-dark .boc-fill{fill:#1e1e1e}.boc-dark input,.boc-dark select,.boc-light input,.boc-light select{font:16px Helvetica,"Segoe UI",Arial,sans-serif}.boc-dark h1,.boc-light h1{font-size:30px;line-height:1}.boc-dark text,.boc-light text{user-select:none}.boc-edit-form{position:absolute;border-radius:10px}.export-service .boc-edit-form{border-radius:unset}.boc-dark .boc-edit-form{color:#acacac}.boc-light .boc-edit-form{color:#333}.boc-dark ::-webkit-calendar-picker-indicator{filter:invert(70%)}.boc-light ::-webkit-calendar-picker-indicator{filter:invert(50%)}.boc-edit-form-instruments{margin:42px 10px 0 10px;text-align:center;min-height:70px}.boc-img-button svg{position:relative;top:12px}.boc-light .boc-toolbar-container svg circle,.boc-light .boc-toolbar-container svg line,.boc-light .boc-toolbar-container svg path{stroke:#8c8c8c!important}.boc-dark .boc-toolbar-container svg circle,.boc-dark .boc-toolbar-container svg line,.boc-dark .boc-toolbar-container svg path{stroke:#8c8c8c!important}.boc-dark .boc-toolbar-container svg rect{fill:#252526!important}.boc-dark .boc-toolbar-container [data-tlbr=minus] svg{border-left:1px solid #5b5b5b!important;border-right:1px solid #5b5b5b!important;border-bottom:1px solid #5b5b5b!important}.boc-dark .boc-toolbar-container [data-tlbr=plus] svg{border-left:1px solid #5b5b5b!important;border-right:1px solid #5b5b5b!important;border-top:1px solid #5b5b5b!important}.boc-dark .boc-toolbar-container [data-tlbr]>svg{border:1px solid #5b5b5b!important;background-color:#252526!important}.boc-toolbar-layout{height:123px;padding-top:20px;position:absolute;width:100%;left:"0";bottom:"-145px"}.boc-light .boc-toolbar-layout{border-top:1px solid #c7c7c7;background-color:#f9f9f9}.boc-dark .boc-toolbar-layout{border-top:1px solid #5b5b5b;background-color:#2b2b2b}.boc-dotted-connector path{stroke-dasharray:7}.boc-undo-redo{position:absolute;top:23px;left:23px}@media screen and (max-width:500px){.boc-undo-redo{position:absolute;top:83px;left:23px}}.boc-light .boc-undo-redo path{fill:#cacaca}.boc-dark .boc-undo-redo path{fill:#5b5b5b}.boc-light .boc-undo-redo .boc-ur-clickable path{fill:#9c9c9c}.boc-dark .boc-undo-redo .boc-ur-clickable path{fill:#8c8c8c}.boc-undo-redo .boc-ur-clickable rect{cursor:pointer}.boc-undo-redo>span{position:relative;display:inline-block;user-select:none}.boc-undo-redo .boc-undo-i{left:-6px;top:-6px}.boc-undo-redo .boc-redo-i{right:-6px;bottom:6px}.boc-undo-redo>span>span{color:#fff;position:absolute;display:inline-block;min-width:20px;min-height:20px;border-radius:50%;line-height:20px;text-align:center;padding:1px;user-select:none;cursor:pointer}.boc-light .boc-undo-redo>span>span{background-color:#9c9c9c}.boc-dark .boc-undo-redo>span>span{background-color:#8c8c8c}</style>'},void 0===OrgChart&&(OrgChart={}),OrgChart.prototype.onField=function(t){return this.on("field",(function(e,r){return t.call(e,r)}))},OrgChart.prototype.onInit=function(t){return this.on("init",(function(e){return t.call(e)}))},OrgChart.prototype.onRedraw=function(t){return this.on("redraw",(function(e){return t.call(e)}))},OrgChart.prototype.onUpdateNode=function(t){return this.on("update",(function(e,r,i){var n={oldData:r,newData:i};return t.call(e,n)}))},OrgChart.prototype.onUpdated=function(t){return this.on("updated",(function(e){return t.call(e)}))},OrgChart.prototype.onRemoveNode=function(t){return this.on("remove",(function(e,r,i){var n={id:r,newPidsAndStpidsForIds:i};return t.call(e,n)}))},OrgChart.prototype.onAddNode=function(t){return this.on("add",(function(e,r){var i={data:r};return t.call(e,i)}))},OrgChart.prototype.onDrop=function(t){return this.on("drop",(function(e,r,i,n,a){var o={dragId:r,dropId:i,dragNodeElement:n,event:a};return t.call(e,o)}))},OrgChart.prototype.onDrag=function(t){return this.on("drag",(function(e,r,i,n){var a={dragId:r,event:i,nodeIds:n};return t.call(e,a)}))},OrgChart.prototype.onExpandCollpaseButtonClick=function(t){return this.on("expcollclick",(function(e,r,i,n){var a={collapsing:r,id:i,ids:n};return t.call(e,a)}))},OrgChart.prototype.onExportStart=function(t){return this.on("exportstart",(function(e,r){return t.call(e,r)}))},OrgChart.prototype.onExportEnd=function(t){return this.on("exportend",(function(e,r){return t.call(e,r)}))},OrgChart.prototype.onNodeClick=function(t){return this.on("click",(function(e,r){return t.call(e,r)}))},OrgChart.prototype.onNodeDoubleClick=function(t){return this.on("dbclick",(function(e,r){var i={data:r};return t.call(e,i)}))},OrgChart.prototype.onAIToolCalls=function(t){return this.on("ai-tool-calls",(function(e,r){return t.call(e,r)}))},OrgChart.filterUI=function(){},OrgChart.filterUI.prototype.init=function(t){this.instance=t,this.element=null,this.filterBy=null,this._event_id=OrgChart._guid()},OrgChart.filterUI.prototype.addFilterTag=function(t){if(!this.instance.config.filterBy)return!1;if(OrgChart.isNEU(t))return!1;if(null!==this.filterBy||"object"!=typeof this.instance.config.filterBy||Array.isArray(this.instance.config.filterBy)||(this.filterBy=JSON.parse(JSON.stringify(this.instance.config.filterBy))),null!=this.filterBy)for(var e in this.filterBy){var r=t[e];if(null!=r){var i=this.filterBy[e];if(null!=i){var n=i[r];if(null!=n&&!1===n.checked)return!0}}}return!1},OrgChart.filterUI.prototype.show=function(t){var e=this.element.querySelector('[data-filter-field="'+t+'"]');e&&e.click()},OrgChart.filterUI.prototype.hide=function(){var t=this.instance.element.querySelector("[data-filter-close]");t&&t.click()},OrgChart.filterUI.prototype.update=function(){if(this.instance.config.filterBy){var t={};if("all"==this.instance.config.filterBy)for(var e=OrgChart.manager.getAllFields(this.instance.config),r=0;r<e.length;r++){var i=e[r];"tags"!=i&&"id"!=i&&"pid"!=i&&"ppid"!=i&&"stpid"!=i&&(t[i]={})}else if(Array.isArray(this.instance.config.filterBy))for(r=0;r<this.instance.config.filterBy.length;r++)t[this.instance.config.filterBy[r]]={};else if("object"==typeof this.instance.config.filterBy)for(var n in this.instance.config.filterBy)t[n]={};for(var a in t){var o=t[a];for(r=0;r<this.instance.config.nodes.length;r++){var s=this.instance.config.nodes[r][a];null!=s&&(o[s]||(o[s]={checked:!0,text:s}))}}if(null!=this.filterBy)for(var l in t)if(this.filterBy[l])for(var h in t[l])this.filterBy[l][h]&&(t[l][h]=this.filterBy[l][h]);if(OrgChart.FILTER_ALPHABETICALLY){var c=Object.keys(t).sort(),d=t;t={};for(r=0;r<c.length;r++){t[g=c[r]]=d[g]}for(var a in t){o=t[a];t[a]={};for(c=Object.keys(o).sort(),r=0;r<c.length;r++){var g=c[r];t[a][g]=o[g]}}}this.filterBy=t;var p=this;this.element=this.instance.element.querySelector("[data-filter]"),this.element&&this.element.parentNode.removeChild(this.element),this.element=document.createElement("div"),this.element.setAttribute("data-filter",""),this.element.style.position="absolute",this.element.setAttribute("class","boc-filter"),this.instance.config.undoRedoStorageName?(this.element.style.top=0,this.element.style.left="50%",this.element.style.transform="translate(-50%)"):(this.element.style.top=this.instance.config.padding+"px",this.element.style.left=this.instance.config.padding+"px");var u="";for(var l in this.filterBy){var f={name:l,html:`<div data-filter-field="${l}">${l}</div>`};OrgChart.events.publish("add-filter",[p,f]),u+=f.html}this.element.innerHTML=`<div>${u}</div>`,this.element.addEventListener("click",(function(t){if(t.target.hasAttribute("data-filter-close")||t.target.hasAttribute("data-filter-field")){for(var e=t.target.getAttribute("data-filter-field"),r=p.instance.element.querySelectorAll("[data-filter-menu]"),i=0;i<r.length;i++)r[i].style.display="none";var n=p.instance.element.querySelectorAll(".filter-field-selected");for(i=0;i<n.length;i++)n[i].classList.remove("filter-field-selected");var a=p.instance.element.querySelector("[data-filter-close]");if(a&&a.parentNode.removeChild(a),t.target.hasAttribute("data-filter-close"))return;if(!t.target.hasAttribute("data-filter-field"))return;var o=p.instance.element.querySelector(`[data-filter-menu="${e}"]`);if(!o){var s="checked";for(var l in p.filterBy[e]){p.filterBy[e][l].checked||(s="")}var h={name:e,text:OrgChart.filterUI.all,value:e,checked:!0,html:`<div>\n <input data-all type="checkbox" id="${e}" name="${e}" ${s}>\n <label for="${e}">${OrgChart.filterUI.all}</label>\n </div>`};OrgChart.events.publish("add-item",[p,h]);var c=h.html;for(var d in p.filterBy[e]){var g=p.filterBy[e][d],u=g.text;null==u&&(u=d),h={name:e,text:u,value:d,checked:g.checked,html:`<div>\n <input type="checkbox" id="${e}_${d}" name="${d}" ${g.checked?"checked":""}>\n <label for="${e}_${d}">${u}</label>\n </div>`},OrgChart.events.publish("add-item",[p,h]),c+=h.html}o=document.createElement("div");var f=OrgChart.filterUI.textFilterBy;o.innerHTML=`<fieldset>\n <legend>${f} ${e}:</legend>\n ${c}\n </fieldset>`,o.setAttribute("data-filter-menu",e),o.classList.add("boc-filter-menu"),t.target.parentNode.parentNode.appendChild(o);var m=o.querySelectorAll("input");for(i=0;i<m.length;i++)m[i].addEventListener("change",(function(t){for(var e=t.target;e&&!e.hasAttribute("data-filter-menu");)e=e.parentNode;if(e){var r=e.getAttribute("data-filter-menu");if(t.target.hasAttribute("data-all")){for(var i=t.target.parentNode.parentNode.querySelectorAll("input"),n=0;n<i.length;n++)if(i[n]!=t.target)for(var a in i[n].checked=t.target.checked,p.filterBy[r])p.filterBy[r][a].checked=t.target.checked}else if(null!=p.filterBy[r][this.name]&&(p.filterBy[r][this.name].checked=this.checked),this.checked)for(var o=p.instance.config.nodes,s=0;s<o.length;s++)if(o[s][r]==this.name)for(var l=o[s];l;)if(OrgChart.isNEU(l.stpid))l=OrgChart.isNEU(l.pid)?null:p.instance._get(l.pid);else if((l=p.instance._get(l.stpid))[r]){var h=t.target.parentNode.parentNode.querySelector('[name="'+l[r]+'"]');h?(h.checked=this.checked,p.filterBy[r][l[r]].checked=this.checked):console.error('Cannot find element with selector: [name="'+l[r]+'"]')}var c=!0;for(var d in p.filterBy[r]){p.filterBy[r][d].checked||(c=!1)}e.querySelector("[data-all]").checked=c,p.instance.draw()}}))}o.style.display="block",t.target.classList.add("filter-field-selected"),(a=document.createElement("div")).classList.add("close"),a.innerHTML="x",a.setAttribute("data-filter-close",""),t.target.parentNode.appendChild(a),OrgChart.events.publish("show-items",[p,{name:e}])}})),this.instance.element.appendChild(this.element),OrgChart.events.publish("update",[this,{}])}},OrgChart.filterUI.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},OrgChart.filterUI.textFilterBy="Filter by",OrgChart.filterUI.all="[All]",void 0===OrgChart&&(OrgChart={}),void 0===OrgChart.remote&&(OrgChart.remote={}),OrgChart.LIMIT_NODES=!0,OrgChart.remote._fromResDTO=function(t,e,r,i,n){var a=e[t.id];t.x=a.p[0],t.y=a.p[1],t.w=a.p[2],t.h=a.p[3],null!=a.ln&&(t.leftNeighbor=n[a.ln]),null!=a.rn&&(t.rightNeighbor=n[a.rn]);for(var o=0;o<t.stChildren.length;o++)OrgChart.remote._fromResDTO(t.stChildren[o],e,r,i,n);for(o=0;o<t.children.length;o++)OrgChart.remote._fromResDTO(t.children[o],e,r,i,n)},OrgChart.remote._toReqDTO=function(t,e){var r={p:[t.id,null!=t.parent?t.parent.id:null,null!=t.stParent?t.stParent.id:null,t.w,t.h]};t.children.length>0&&(r.c=OrgChart.remote._convertToIdArray(t.children)),t.stChildren.length>0&&(r.v=OrgChart.remote._convertToIdArray(t.stChildren)),null!=t.layout&&0!=t.layout&&(r.l=t.layout),t.isAssistant&&(r.a=1),t.isSplit&&(r.s=t.isSplit),t.isMirror&&(r.im=t.isMirror),t.padding&&(r.q=t.padding),t.lcn&&(r.k=t.lcn),t.stContainerNodes&&(r.b=OrgChart.remote._convertToIdArray(t.stContainerNodes)),t.isPartner&&(r.i=t.isPartner),t.hasPartners&&(r.g=t.hasPartners),t.partnerSeparation&&(r.e=t.partnerSeparation),e.push(r);for(var i=0;i<t.stChildren.length;i++)OrgChart.remote._toReqDTO(t.stChildren[i],e);for(i=0;i<t.children.length;i++)OrgChart.remote._toReqDTO(t.children[i],e)},OrgChart.remote._toReqLayoutConfigsDTO=function(t){var e={};for(var r in t){var i=t[r];e[r]||(e[r]=[]),e[r][0]=i.orientation,e[r][1]=i.levelSeparation,e[r][2]=i.mixedHierarchyNodesSeparation,e[r][3]=i.subtreeSeparation,e[r][4]=i.siblingSeparation,e[r][5]=i.layout,e[r][6]=i.columns,e[r][7]=i.collapse,e[r][8]=i.assistantSeparation,e[r][9]=i.partnerNodeSeparation}return e},OrgChart.remote._convertToIdArray=function(t){for(var e=[],r=0;r<t.length;r++)e.push(t[r].id);return e},OrgChart.remote._setPositions=function(t,e,r,i){for(var n=[],a=[],o=OrgChart.remote._toReqLayoutConfigsDTO(e),s=0;s<t.length;s++)a.push(t[s].id),OrgChart.remote._toReqDTO(t[s],n);var l={n:n,c:o,r:a,v:"8.14.00"};if(OrgChart.LIMIT_NODES||(l.l=!0),null!=OrgChart.remote._fromReqDTO)OrgChart.remote._fromReqDTO(l.n,l.r,l.c,(function(e){for(var n=0;n<t.length;n++)OrgChart.remote._fromResDTO(t[n],e,0,t,i);r()}));else{l=JSON.stringify(l);var h=OrgChart.localStorage.getItem(l);h&&(h=JSON.parse(h)),h&&!h.limit?OrgChart.remote._proceed(t,h,i,r):OrgChart.remote._findRegion((function(e){OrgChart._ajax(e,"post",l,"json",(function(e){e.error?r(2):(OrgChart.remote._proceed(t,e,i,r),OrgChart.localStorage.setItem(l,JSON.stringify(e)))}))}))}},OrgChart.remote._proceed=function(t,e,r,i){if("string"==typeof e&&(e=JSON.parse(e)),e.limit&&1==e.limit)i(e.limit);else{for(var n=0;n<t.length;n++)OrgChart.remote._fromResDTO(t[n],e,0,t,r);i()}},OrgChart.remote._findRegion=function(t){var e=OrgChart.localStorage.getItem(OrgChart.FUNC_URL_NAME);if(e)t(e);else{for(var r=["defunc2","cusfunc2","bsfunc2","acfunc2","kcfunc2","safunc2","wifunc2"],i=[],n=0;n<r.length;n++)i.push(new XMLHttpRequest);for(n=0;n<r.length;n++)!function(){var e="https://"+r[n]+OrgChart.SERVER_PREFIX,a=i[n];a.onreadystatechange=function(){if(4==this.readyState&&200==this.status){OrgChart.localStorage.setItem(OrgChart.FUNC_URL_NAME,e),t(e);for(var r=0;r<i.length;r++)i[r].abort()}},a.open("GET",e,!0),a.send()}()}};
|
|
1
|
+
var OrgChart=function(t,e){("string"==typeof t||t instanceof String)&&(t=document.querySelector(t));var r=this;Object.defineProperty(this,"element",{get:()=>t,set(i){t=i,i&&r._constructor(e)}}),this.element=t};OrgChart.prototype._constructor=function(t){var e=this;if(this.config=OrgChart.mergeDeep(OrgChart._defaultConfig(t),t),this._layoutConfigs={base:{orientation:this.config.orientation,levelSeparation:this.config.levelSeparation,mixedHierarchyNodesSeparation:this.config.mixedHierarchyNodesSeparation,assistantSeparation:this.config.assistantSeparation,subtreeSeparation:this.config.subtreeSeparation,siblingSeparation:this.config.siblingSeparation,layout:this.config.layout,columns:this.config.columns,collapse:this.config.collapse,partnerNodeSeparation:this.config.partnerNodeSeparation}},this.config.tags)for(var r in this.config.tags){var i=this.config.tags[r];null!=i.subTreeConfig&&(this._layoutConfigs[r]={orientation:null!=i.subTreeConfig.orientation?i.subTreeConfig.orientation:this.config.orientation,levelSeparation:null!=i.subTreeConfig.levelSeparation?i.subTreeConfig.levelSeparation:this.config.levelSeparation,mixedHierarchyNodesSeparation:null!=i.subTreeConfig.mixedHierarchyNodesSeparation?i.subTreeConfig.mixedHierarchyNodesSeparation:this.config.mixedHierarchyNodesSeparation,assistantSeparation:null!=i.subTreeConfig.assistantSeparation?i.subTreeConfig.assistantSeparation:this.config.assistantSeparation,subtreeSeparation:null!=i.subTreeConfig.subtreeSeparation?i.subTreeConfig.subtreeSeparation:this.config.subtreeSeparation,siblingSeparation:null!=i.subTreeConfig.siblingSeparation?i.subTreeConfig.siblingSeparation:this.config.siblingSeparation,layout:null!=i.subTreeConfig.layout?i.subTreeConfig.layout:this.config.layout,columns:null!=i.subTreeConfig.columns?i.subTreeConfig.columns:this.config.columns,collapse:null!=i.subTreeConfig.collapse?i.subTreeConfig.collapse:this.config.collapse,partnerNodeSeparation:null!=i.subTreeConfig.partnerNodeSeparation?i.subTreeConfig.partnerNodeSeparation:this.config.partnerNodeSeparation})}this._event_id=OrgChart._guid(),OrgChart._validateConfig(this.config)&&(this._vScroll={},this.config.ui||(this.ui=OrgChart.ui),this.config.editUI?this.editUI=this.config.editUI:this.editUI=new OrgChart.editUI,this.editUI.init(this),this.config.filterUI?this.filterUI=this.config.filterUI:this.filterUI=new OrgChart.filterUI,this.filterUI.init(this),this.manager=new OrgChart.manager(this),this._ai=new OrgChart._ai(this),this.config.searchUI?this.searchUI=this.config.searchUI:this.searchUI=new OrgChart.searchUI,this.config.aiUI?this.aiUI=this.config.aiUI:this.aiUI=new OrgChart.aiUI,this.config.nodeMenuUI?this.nodeMenuUI=this.config.nodeMenuUI:this.nodeMenuUI=new OrgChart.menuUI,this.nodeMenuUI.init(this,this.config.nodeMenu),this.config.nodeCircleMenuUI?this.nodeCircleMenuUI=this.config.nodeCircleMenuUI:this.nodeCircleMenuUI=new OrgChart.circleMenuUI,this.nodeCircleMenuUI.init(this,this.config.nodeCircleMenu),this.config.nodeContextMenuUI?this.nodeContextMenuUI=this.config.nodeContextMenuUI:this.nodeContextMenuUI=new OrgChart.menuUI,this.nodeContextMenuUI.init(this,this.config.nodeContextMenu),this.config.toolbarUI?this.toolbarUI=this.config.toolbarUI:this.toolbarUI=new OrgChart.toolbarUI,this.config.notifierUI?this.notifierUI=this.config.notifierUI:this.notifierUI=new OrgChart.notifierUI,this.notifierUI.init(this),this.config.menuUI?this.menuUI=this.config.menuUI:this.menuUI=new OrgChart.menuUI,this.menuUI.init(this,this.config.menu),this.config.xScrollUI||(this.xScrollUI=new OrgChart.xScrollUI(this.element,this.config,(function(){return{boundary:e.response.boundary,scale:e.getScale(),viewBox:e.getViewBox(),padding:e.config.padding}}),(function(t){e.setViewBox(t)}),(function(){e._draw(!0,OrgChart.action.xScroll)}))),this.config.yScrollUI||(this.yScrollUI=new OrgChart.yScrollUI(this.element,this.config,(function(){return{boundary:e.response.boundary,scale:e.getScale(),viewBox:e.getViewBox(),padding:e.config.padding}}),(function(t){e.setViewBox(t)}),(function(){e._draw(!0,OrgChart.action.xScroll)}))),this.config.undoRedoUI?this.undoRedoUI=this.config.undoRedoUI:this.undoRedoUI=new OrgChart.undoRedoUI,this.element.classList.add("boc-"+this.config.mode),this._gragStartedId=null,this._timeout=null,this._touch=null,this._initialized=!1,this._loaded=!1,this._moveInterval=null,this._movePosition=null,this.response=null,this.nodes=null,this.isVisible=null,OrgChart._intersectionObserver(this.element,(function(t){e.isVisible=t,!1!==OrgChart.events.publish("visibility-change",[e])&&OrgChart.LAZY_LOADING&&e.isVisible&&(e._loaded?e._draw(!1,OrgChart.action.update):(e._setInitialSizeIfNotSet(),e._draw(!1,OrgChart.action.init)))})))},OrgChart._defaultConfig=function(t){return{interactive:!0,mode:"light",lazyLoading:"auto",enableDragDrop:!1,enableSearch:!0,enableAI:!1,enableTouch:!1,enablePan:!0,keyNavigation:!1,miniMap:!1,nodeMenu:null,nodeCircleMenu:null,nodeContextMenu:null,menu:null,toolbar:!1,sticky:!0,nodeMouseClick:OrgChart.action.details,nodeMouseDbClick:OrgChart.none,mouseScrool:OrgChart.action.zoom,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:OrgChart.orientation.top,layout:OrgChart.layout.normal,layoutGridColumns:"dynamic",scaleInitial:1,movable:null,scaleMin:.1,scaleMax:5,orderBy:null,editUI:null,aiUI:null,filterUI:null,searchUI:null,xScrollUI:null,yScrollUI:null,nodeMenuUI: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:OrgChart.CENTER,UI:null,anim:{func:OrgChart.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",cancelBtn:"Cancel",generateElementsFromFields:!0,focusBinding:null,buttons:{edit:{icon:OrgChart.icon.edit(24,24,"#fff"),text:"Edit",hideIfEditMode:!0,hideIfDetailsMode:!1},share:{icon:OrgChart.icon.share(24,24,"#fff"),text:"Share"},pdf:{icon:OrgChart.icon.pdf(24,24,"#fff"),text:"Save as PDF"},remove:{icon:OrgChart.icon.remove(24,24,"#fff"),text:"Remove",hideIfDetailsMode:!0}},elements:[]}}},OrgChart.prototype.load=function(t,e){var r=this;return this.config.nodes=t,this._draw(!1,OrgChart.action.init,void 0,(function(){r.filterUI.update(),e&&e()})),this},OrgChart.prototype.loadXML=function(t,e){var r=OrgChart._xml2json(t);return this.load(r,e)},OrgChart.prototype.getXML=function(){return OrgChart._json2xml(this.config.nodes)},OrgChart.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},OrgChart.prototype.removeListener=function(t,e){return OrgChart.events.remove(t,e,this._event_id)},OrgChart.prototype.draw=function(t,e,r){null==t&&(t=OrgChart.action.update),this._draw(!1,t,e,r)},OrgChart.prototype._draw=function(t,e,r,i){var n=this;if(!OrgChart.LAZY_LOADING||this.isVisible)if(OrgChart.LAZY_LOADING||this._initialized||(this._setInitialSizeIfNotSet(),0!=this.width()&&0!=this.height())){this._hideBeforeAnimationCompleted=!1;var a=e==OrgChart.action.init?null:this.getViewBox();this.manager.read(t,this.width(),this.height(),a,e,r,(function(t){if(!n.notifierUI.show(t.notif)){e!=OrgChart.action.exporting&&(n.nodes=t.nodes,n.visibleNodeIds=t.visibleNodeIds,n.roots=t.roots),n.editUI.fields=t.allFields;var a={defs:""};OrgChart.events.publish("renderdefs",[n,a]);var o=n.ui.defs(a.defs),s=n.getScale(t.viewBox);o+=n.ui.pointer(n.config,e,s);var l=n.getViewBox(),h=t.viewBox;a={content:o,res:t};OrgChart.events.publish("prerender",[n,a]),o=a.content;var c=[];if(OrgChart.RENDER_LINKS_BEFORE_NODES)for(var d=0;d<t.visibleNodeIds.length;d++){var g=t.nodes[t.visibleNodeIds[d]];OrgChart.getRootOf(g).stParent?c.push(g.id):o+=n.ui.link(g,n,s,t.bordersByRootIdAndLevel,t.nodes,e)}for(d=0;d<t.visibleNodeIds.length;d++){g=t.nodes[t.visibleNodeIds[d]];var p=n._get(g.id);OrgChart.RENDER_LINKS_BEFORE_NODES&&c.includes(g.id)&&(o+=n.ui.link(g,n,s,t.bordersByRootIdAndLevel,t.nodes,e)),o+=n.ui.node(g,p,t.animations,n.config,void 0,void 0,void 0,e,s,n)}for(d=0;d<t.visibleNodeIds.length;d++){g=t.nodes[t.visibleNodeIds[d]];OrgChart.RENDER_LINKS_BEFORE_NODES||(o+=n.ui.link(g,n,s,t.bordersByRootIdAndLevel,t.nodes,e)),o+=n.ui.expandCollapseBtn(n,g,n._layoutConfigs,e,s)}a={content:o,res:t};if(OrgChart.events.publish("render",[n,a]),o=a.content,t=a.res,o+=n.ui.lonely(n.config),e!==OrgChart.action.exporting){e!==OrgChart.action.centernode&&e!==OrgChart.action.insert&&e!==OrgChart.action.expand&&e!==OrgChart.action.collapse&&e!==OrgChart.action.update||(h=l),e===OrgChart.action.init&&null!=l&&(h=l),n.response=t;x=n.ui.svg(n.width(),n.height(),h,n.config,o);if(n._initialized){var u=n.getSvg(),f=u.parentNode;f.removeChild(u),f.insertAdjacentHTML("afterbegin",x),n._attachEventHandlers(),n.xScrollUI.addListener(n.getSvg()),n.yScrollUI.addListener(n.getSvg()),n.xScrollUI.setPosition(),n.yScrollUI.setPosition()}else n.element.innerHTML=n.ui.css()+x+n.ui.menuButton(n.config)+n.ui.aiButton(n.config),n._attachInitEventHandlers(),n._attachEventHandlers(),n.xScrollUI.create(n.width(),n.config.padding),n.xScrollUI.setPosition(),n.xScrollUI.addListener(n.getSvg()),n.yScrollUI.create(n.height(),n.config.padding),n.yScrollUI.setPosition(),n.yScrollUI.addListener(n.getSvg()),n.config.enableSearch&&n.searchUI.init(n),n.aiUI.init(n),n.toolbarUI.init(n,n.config.toolbar),n.undoRedoUI.init(n);var m=!1,C=n.response.animations;if(C[0].length>0){n._hideBeforeAnimation(C[0].length);for(d=0;d<C[0].length;d++)C[0][d]=n.getNodeElement(C[0][d]);OrgChart.animate(C[0],C[1],C[2],n.config.anim.duration,n.config.anim.func,(function(){m||(i&&i(),OrgChart.events.publish("redraw",[n]),n._showAfterAnimation(),m=!0)}))}e===OrgChart.action.centerNode?OrgChart.animate(n.getSvg(),{viewbox:l},{viewbox:n.response.viewBox},n.config.anim.duration,n.config.anim.func,(function(){n.ripple(r.options.rippleId),m||(i&&i(),OrgChart.events.publish("redraw",[n]),n._showAfterAnimation(),m=!0)}),(function(){n.xScrollUI.setPosition(),n.yScrollUI.setPosition()})):!l||!n.response||l[0]==n.response.viewBox[0]&&l[1]==n.response.viewBox[1]&&l[2]==n.response.viewBox[2]&&l[3]==n.response.viewBox[3]||e!==OrgChart.action.insert&&e!==OrgChart.action.expand&&e!==OrgChart.action.collapse&&e!==OrgChart.action.update&&e!==OrgChart.action.init?0==C[0].length&&(m||(i&&i(),OrgChart.events.publish("redraw",[n]),m=!0)):OrgChart.animate(n.getSvg(),{viewbox:l},{viewbox:n.response.viewBox},2*n.config.anim.duration,n.config.anim.func,(function(){n.xScrollUI.setPosition(),n.yScrollUI.setPosition(),m||(i&&i(),OrgChart.events.publish("redraw",[n]),m=!0)})),n._initialized||(n._initialized=!0,n.filterUI.update(),n._ai.setContext(),OrgChart.events.publish("init",[n])),!n._loaded&&t&&t.nodes&&Object.keys(t.nodes).length&&(n._loaded=!0)}else{var b=t.boundary,v=b.maxX-b.minX,O=b.maxY-b.minY,x=n.ui.svg(v,O,[b.minX,b.minY,v,O],n.config,o,s);i(x,t)}}}),(function(t){OrgChart.events.publish("ready",[n,t])}))}else console.error("Cannot load the chart with size 0! If you are using the OrgChart within tabs set OrgChart.LAZY_LOADING to true! ")},OrgChart.prototype._setInitialSizeIfNotSet=function(){this.element.style.overflow="hidden",this.element.style.position="relative",0==this.element.offsetHeight&&(this.element.style.height="100%",0==this.element.offsetHeight&&(this.element.style.height="700px")),0==this.element.offsetWidth&&(this.element.style.width="100%",0==this.element.offsetWidth&&(this.element.style.width="700px"))},OrgChart.prototype.width=function(){return this.element.offsetWidth},OrgChart.prototype.height=function(){return this.element.offsetHeight},OrgChart.prototype.getViewBox=function(){var t=this.getSvg();return OrgChart._getViewBox(t)},OrgChart.prototype.setViewBox=function(t){this.getSvg().setAttribute("viewBox",t.toString())},OrgChart.prototype.getScale=function(t){return t||(t=this.getViewBox()),OrgChart.getScale(t,this.width(),this.height(),this.config.scaleInitial,this.config.scaleMax,this.config.scaleMin)},OrgChart.prototype.setScale=function(t){t>this.config.scaleMax&&(t=this.config.scaleMax),t<this.config.scaleMin&&(t=this.config.scaleMin);var e=this.getViewBox().slice(0),r=this.width(),i=this.height(),n=r/e[2],a=i/e[3],o=n>a?a:n,s=e,l=e[2],h=e[3];return e[2]=e[2]/(t/o),e[3]=e[3]/(t/o),e[0]=s[0]-(e[2]-l)/2,e[1]=s[1]-(e[3]-h)/2,this.setViewBox(e),OrgChart.events.publish("redraw",[this]),t},OrgChart.prototype.ripple=function(t,e,r){var i=this.getNode(t);if(null!=i){var n=this.getNodeElement(t);if(null!=n){var a=this.getScale(),o=i.w/2,s=i.h/2;if(void 0!==e&&void 0!==r){var l=n.getBoundingClientRect();o=e/a-l.left/a,s=r/a-l.top/a}var h=i.w,c=i.h,d=h-o>o?h-o:o,g=c-s>s?c-s:s,p=d>g?d:g,u=document.createElementNS("http://www.w3.org/2000/svg","g"),f=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),m=document.createElementNS("http://www.w3.org/2000/svg","rect"),C=document.createElementNS("http://www.w3.org/2000/svg","circle"),b=OrgChart.randomId();f.setAttribute("id",b);var v={ripple:OrgChart.t(i.templateName,i.min,this.getScale()).ripple,node:i};OrgChart.events.publish("ripple",[this,v]),m.setAttribute("x",v.ripple.rect?v.ripple.rect.x:0),m.setAttribute("y",v.ripple.rect?v.ripple.rect.y:0),m.setAttribute("width",v.ripple.rect?v.ripple.rect.width:i.w),m.setAttribute("height",v.ripple.rect?v.ripple.rect.height:i.h),m.setAttribute("rx",v.ripple.radius),m.setAttribute("ry",v.ripple.radius),C.setAttribute("clip-path","url(#"+b+")"),C.setAttribute("cx",o),C.setAttribute("cy",s),C.setAttribute("r",0),C.setAttribute("fill",v.ripple.color),C.setAttribute("class","boc-ripple"),f.appendChild(m),u.appendChild(f),u.appendChild(C),n.appendChild(u),OrgChart.animate(C,{r:0,opacity:1},{r:p,opacity:0},500,OrgChart.anim.outPow,(function(){n.removeChild(u)}))}}},OrgChart.prototype.center=function(t,e,r){var i,n,a=t,o=!0,s=!0;e&&null!=e.parentState&&(i=e.parentState),e&&null!=e.childrenState&&(n=e.childrenState),e&&null!=e.rippleId&&(a=e.rippleId),e&&null!=e.vertical&&(o=e.vertical),e&&null!=e.horizontal&&(s=e.horizontal);var l={parentState:i,childrenState:n,rippleId:a,vertical:o,horizontal:s};this._draw(!1,OrgChart.action.centerNode,{id:t,options:l},r)},OrgChart.prototype.fit=function(t){this.config.scaleInitial=OrgChart.match.boundary,this._draw(!0,OrgChart.action.init,{method:"fit"},t)},OrgChart.prototype.toggleFullScreen=function(){var t=document.querySelector("["+OrgChart.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=OrgChart.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=OrgChart.toolbarUI.closeFullScreenIcon))},OrgChart.prototype.getNode=function(t){return this.nodes[t]},OrgChart.prototype.setLayout=function(t,e){e||(e="base"),this._layoutConfigs[e].layout=t,"base"==e&&(this.config.layout=t),this._draw(!1,OrgChart.action.update)},OrgChart.prototype.setOrientation=function(t,e,r){var i=this;e||(e="base"),this._layoutConfigs[e].orientation=t,"base"==e&&(this.config.orientation=t),this._draw(!1,OrgChart.action.update,void 0,(function(){OrgChart._moveToBoundaryArea(i.getSvg(),i.getViewBox(),i.response.boundary,(function(){i._draw(!0,OrgChart.action.pan),r&&r()}))}))},OrgChart.prototype.search=function(t,e,r){return OrgChart.isNEU(e)&&(e=this.searchUI._searchFields),OrgChart.isNEU(r)&&(r=e),OrgChart._search.search(this.config.nodes,t,e,r,this.config.searchDisplayField,this.config.searchFieldsWeight,this.searchUI._searchFieldsAbbreviation)},OrgChart.prototype._hideBeforeAnimation=function(t){if(1!=this._hideBeforeAnimationCompleted&&!(t&&t<OrgChart.ANIM_THRESHOLD)){var e=this.element.getElementsByTagName("text");if(e.length>OrgChart.TEXT_THRESHOLD)for(var r=0;r<e.length;r++)e[r].style.display="none";var i=this.element.getElementsByTagName("image");if(i.length>OrgChart.IMAGES_THRESHOLD)for(r=0;r<i.length;r++)i[r].style.display="none";var n=this.element.querySelectorAll("["+OrgChart.attr.link_id+"]");if(n.length>OrgChart.LINKS_THRESHOLD)for(r=0;r<n.length;r++)n[r].style.display="none";var a=this.element.querySelectorAll("["+OrgChart.attr.control_expcoll_id+"]");if(a.length>OrgChart.BUTTONS_THRESHOLD)for(r=0;r<a.length;r++)a[r].style.display="none";var o=this.element.querySelectorAll("["+OrgChart.attr.control_up_id+"]");if(o.length>OrgChart.BUTTONS_THRESHOLD)for(r=0;r<o.length;r++)o[r].style.display="none";this._hideBeforeAnimationCompleted=!0}},OrgChart.prototype._showAfterAnimation=function(){for(var t=this.element.getElementsByTagName("text"),e=0;e<t.length;e++)t[e].style.display="";var r=this.element.getElementsByTagName("image");for(e=0;e<r.length;e++)r[e].style.display="";var i=this.element.querySelectorAll("["+OrgChart.attr.link_id+"]");for(e=0;e<i.length;e++)i[e].style.display="";var n=this.element.querySelectorAll("["+OrgChart.attr.control_expcoll_id+"]");for(e=0;e<n.length;e++)n[e].style.display="";var a=this.element.querySelectorAll("["+OrgChart.attr.control_up_id+"]");for(e=0;e<a.length;e++)a[e].style.display="";this._hideBeforeAnimationCompleted=!1},OrgChart.prototype.isChild=function(t,e){for(var r=this.getNode(e);r;){if(r.id==t)return!0;r=r.parent?r.parent:r.stParent}return!1},OrgChart.prototype.getCollapsedIds=function(t){for(var e=[],r=0;r<t.childrenIds.length;r++){var i=this.getNode(t.childrenIds[r]);1==i.collapsed&&e.push(i.id)}return e},OrgChart.prototype.stateToUrl=function(){if(this.manager.state){var t={};return t.exp=this.manager.state.exp.join("*"),t.min=this.manager.state.min.join("*"),t.adjustify=this.manager.state.adjustify.x+"*"+this.manager.state.adjustify.y,t.scale=this.manager.state.scale,t.y=this.manager.state.x,t.x=this.manager.state.y,new URLSearchParams(t).toString()}return""},OrgChart.prototype.generateId=function(){for(;;){var t="_"+("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4);if(null==this.nodes||!this.nodes.hasOwnProperty(t))return t}},OrgChart.prototype.moveNodesToVisibleArea=function(t,e){for(var r=this,i=this.getSvg(),n=this.getViewBox(),a=null,o=null,s=null,l=null,h=0;h<t.length;h++){var c=this.nodes[t[h]];(null===a||a<c.x+c.w)&&(a=c.x+c.w),(null===o||o<c.y+c.h)&&(o=c.y+c.h),(null===s||s>c.x)&&(s=c.x),(null===l||l>c.y)&&(l=c.y)}var d=this.width(),g=this.height(),p=d/(b=a-s+2*this.config.padding),u=g/(v=o-l+2*this.config.padding),f=p>u?u:p,m=Math.ceil(d/f),C=Math.ceil(g/f),b=0,v=0;if(m-2*this.config.padding>=a-s)b=(a+s)/2-m/2;else switch(b=firstRoot.x-m/2+OrgChart.manager._getNodeWidth(firstRoot,this.config)/2,this.config.orientation){case OrgChart.orientation.right:case OrgChart.orientation.right_top:(b=-(m/2-(s-a)/2))<this.config.padding-m&&(b=this.config.padding-m);break;case OrgChart.orientation.left:case OrgChart.orientation.bottom_left:case OrgChart.orientation.top_left:case OrgChart.orientation.left_top:(b=-(m/2-(a-s)/2))>-this.config.padding&&(b=-this.config.padding)}if(C-2*this.config.padding>=o-l)v=(o+l)/2-C/2;else switch((v=-(C/2-(o-l)/2))>-this.config.padding&&(v=-this.config.padding),this.config.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:(v=-(C/2-(l-o)/2))<this.config.padding-C&&(v=this.config.padding-C);break;case OrgChart.orientation.left:case OrgChart.orientation.right:v=firstRoot.y-C/2+OrgChart.manager._getNodeWidth(firstRoot,this.config)/2}var O=[b,v,m,C];n[0]!==O[0]||n[1]!==O[1]?OrgChart.animate(i,{viewBox:n},{viewBox:O},this.config.anim.duration,this.config.anim.func,(function(){r.draw(OrgChart.action.update,void 0,e)})):e&&e()},OrgChart.prototype._nodeHasHiddenParent=function(t){return!t.parent&&!OrgChart.isNEU(t.pid)&&this.getNode(t.pid)},OrgChart.prototype.destroy=function(){this._removeEvent(window,"resize"),OrgChart.events.removeForEventId(this._event_id),this.element.innerHTML=null},OrgChart.localStorage={},OrgChart.localStorage.getItem=function(t){var e=localStorage.getItem("to_date");if(e){if((e=new Date(e))<new Date){for(var r=0,i=localStorage.length;r<i;++r){var n=localStorage.key(r);n&&n.startsWith&&n.startsWith('{"n"')&&localStorage.removeItem(n)}localStorage.removeItem("to_date")}}else(e=new Date).setDate(e.getDate()+5),e=e.toISOString(),localStorage.setItem("to_date",e);return localStorage.getItem(t)},OrgChart.localStorage.setItem=function(t,e){try{localStorage.setItem(t,e)}catch(t){t.code==t.QUOTA_EXCEEDED_ERR?(console.warn("Local storage quota exceeded"),localStorage.clear()):(console.error("Local storage error code:"+t.code),console.error(t))}},OrgChart.prototype.canUpdateLink=function(t,e){if(null==e||null==e)return!1;if(null==t||null==t)return!1;if(t==e)return!1;var r=this.getNode(e),i=this.getNode(t);return!(r&&i&&(r.isPartner||r.hasPartners&&i.isAssistant||r.hasAssistants&&i.isPartner))&&!this.isChild(t,e)},OrgChart.prototype._canUpdateLink=OrgChart.prototype.canUpdateLink,OrgChart.prototype.updateNode=function(t,e,r){var i=this,n=this.get(t.id);if(!0===r&&!1===OrgChart.events.publish("update",[this,n,t]))return!1;this.update(t),this._ai.setContext(),OrgChart.events.publish("updated",[this]),this.filterUI.update();var a=this.getNode(t.id),o=a.pid;null==o&&(o=a.stpid),this._draw(!1,OrgChart.action.update,{id:o},(function(){i.ripple(t.id),e&&e()}))},OrgChart.prototype.update=function(t){for(var e=0;e<this.config.nodes.length;e++)if(this.config.nodes[e].id==t.id){this._putInUndoStack(),this.clearRedo(),this.config.nodes[e]=t;break}return this},OrgChart.prototype.removeNode=function(t,e,r){var i=this;if(!this.canRemove(t))return!1;var n=this._getNewPidsAndStpidsForIds(t);if(!0===r&&!1===OrgChart.events.publish("remove",[this,t,n]))return!1;return this.remove(t),this._ai.setContext(),OrgChart.events.publish("updated",[this]),this.filterUI.update(),this._draw(!1,OrgChart.action.update,null,(function(){i.config.sticky&&OrgChart._moveToBoundaryArea(i.getSvg(),i.getViewBox(),i.response.boundary),e&&e()})),!0},OrgChart.prototype.remove=function(t){var e=this.get(t);if(e){this._putInUndoStack(),this.clearRedo();for(var r=this.config.nodes.length-1;r>=0;r--)this.config.nodes[r].pid!=t&&this.config.nodes[r].stpid!=t||(this.config.nodes[r].pid=e.pid,this.config.nodes[r].stpid=e.stpid),this.config.nodes[r].id==t&&this.config.nodes.splice(r,1)}return this},OrgChart.prototype._getNewPidsAndStpidsForIds=function(t){var e=this.get(t),r={},i={};if(e)for(var n=this.config.nodes.length-1;n>=0;n--)this.config.nodes[n].pid==t?r[this.config.nodes[n].id]=e.pid:this.config.nodes[n].stpid==t&&(i[this.config.nodes[n].id]=e.stpid);return{newPidsForIds:r,newStpidsForIds:i}},OrgChart.prototype.addNode=function(t,e,r){var i=this;if(!0===r&&!1===OrgChart.events.publish("add",[this,t]))return!1;this.add(t),this._ai.setContext(),OrgChart.events.publish("updated",[this]),this.filterUI.update(),i._draw(!1,OrgChart.action.insert,{id:t.pid,insertedNodeId:t.id},(function(){i.ripple(t.id),e&&e()}))},OrgChart.prototype.add=function(t){if(null==t.id&&console.error("Call addNode without id"),this._putInUndoStack(),this.clearRedo(),this.config.movable&&!OrgChart.isNEU(t.pid)){var e=this._get(t.pid);e&&(null!=e.movex&&(t.movex=e.movex),null!=e.movey&&(t.movey=e.movey))}return this.config.nodes.push(t),this},OrgChart.prototype.replaceIds=function(t,e){this._replaceIds(t),this._draw(!1,OrgChart.action.update,void 0,e)},OrgChart.prototype._replaceIds=function(t){for(var e=function(e){for(var r=0;r<e.length;r++){var i=e[r];for(var n in t){var a=t[n];i.from==n&&(i.from=a),i.to==n&&(i.to=a)}}},r=0;r<this.config.nodes.length;r++){var i=this.config.nodes[r];for(var n in t){var a=t[n];i.id==n&&(i.id=a),i.pid==n&&(i.pid=a),i.stpid==n&&(i.stpid=a),i.ppid==n&&(i.ppid=a)}}if(Array.isArray(this.config.roots))for(r=0;r<this.config.roots.length;r++)OrgChart.isNEU(t[this.config.roots[r]])||(this.config.roots[r]=t[this.config.roots[r]]);if(this.nodes)for(var o in this.nodes)if(!OrgChart.isNEU(t[o])){a=t[o];(s=this.nodes[o]).id=a,this.nodes[a]=s}if(this.manager.oldNodes)for(var o in this.manager.oldNodes)if(!OrgChart.isNEU(t[o])){a=t[o];(s=this.manager.oldNodes[o]).id=a,this.manager.oldNodes[a]=s}if(this.roots)for(var o in this.roots)if(!OrgChart.isNEU(t[o])){var s;a=t[o];(s=this.roots[o]).id=a,this.roots[a]=s}e(this.config.clinks),e(this.config.slinks),e(this.config.groupDottedLines),e(this.config.dottedLines)},OrgChart.prototype._get=function(t){var e=this.__get(t);if(e)return e;if((this.config.groupDottedLines.length||this.config.dottedLines.length)&&!OrgChart.isNEU(t)&&"string"==typeof t&&(-1!=t.indexOf("balkan_group_dotted_")||-1!=t.indexOf("balkan_dotted_"))){var r=(t=(t=t.replace("balkan_group_dotted_","")).replace("balkan_dotted_","")).indexOf("_balkan_id_");if(t=t.substring(r+11),e=this.__get(t))return e}return null},OrgChart.prototype.__get=function(t){for(var e=0;e<this.config.nodes.length;e++)if(this.config.nodes[e].id==t)return this.config.nodes[e];return null},OrgChart.prototype.get=function(t){var e=this._get(t);return null==e?null:JSON.parse(JSON.stringify(e))},OrgChart.prototype.canRemove=function(t){var e=this.getNode(t);return!!e&&(!e.hasPartners&&!e.hasAssistants)},void 0===OrgChart&&(OrgChart={}),OrgChart._ajax=function(t,e,r,i,n){null==i&&(i="arraybuffer");var a=new XMLHttpRequest;a.onload=function(t){4==a.readyState&&200===this.status&&(null==t.target?n(this.response):n(t.target.response))},a.onerror=function(t){n({error:t})},a.open(e,t),a.responseType=i,a.setRequestHeader("Content-Type","application/json"),null==r?a.send():a.send(r)},void 0===OrgChart&&(OrgChart={}),OrgChart.animate=function(t,e,r,i,n,a,o){var s,l=10,h=1,c=i/l+1;document.getElementsByTagName("g");return Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]),Array.isArray(r)||(r=[r]),s=setInterval((function(){for(var d=0;d<t.length;d++)for(var g in r[d]){var p=OrgChart._arrayContains(["top","left","right","bottom","width","height"],g.toLowerCase())?"px":"";switch(g.toLowerCase()){case"d":var u=n((h*l-l)/i)*(r[d][g][0]-e[d][g][0])+e[d][g][0],f=n((h*l-l)/i)*(r[d][g][1]-e[d][g][1])+e[d][g][1];t[d].setAttribute("d",t[d].getAttribute("d")+" L"+u+" "+f);break;case"r":var m=n((h*l-l)/i)*(r[d][g]-e[d][g])+e[d][g];t[d].setAttribute("r",m);break;case"x1":m=n((h*l-l)/i)*(r[d][g]-e[d][g])+e[d][g];t[d].setAttribute("x1",m);break;case"x2":m=n((h*l-l)/i)*(r[d][g]-e[d][g])+e[d][g];t[d].setAttribute("x2",m);break;case"y1":m=n((h*l-l)/i)*(r[d][g]-e[d][g])+e[d][g];t[d].setAttribute("y1",m);break;case"y2":m=n((h*l-l)/i)*(r[d][g]-e[d][g])+e[d][g];t[d].setAttribute("y2",m);break;case"rotate3d":if(r[d][g]){var C=e[d][g],b=r[d][g],v=[0,0,0,0];for(var O in C)v[O]=n((h*l-l)/i)*(b[O]-C[O])+C[O];t[d].style.transform="rotate3d("+v.toString()+"deg)"}break;case"transform":if(r[d][g]){C=e[d][g],b=r[d][g],v=[0,0,0,0,0,0];for(var O in C)v[O]=n((h*l-l)/i)*(b[O]-C[O])+C[O];t[d].hasAttribute("transform")?t[d].setAttribute("transform","matrix("+v.toString()+")"):t[d].style.transform="matrix("+v.toString()+")"}break;case"viewbox":if(r[d][g]){C=e[d][g],b=r[d][g],v=[0,0,0,0];for(var O in C)v[O]=n((h*l-l)/i)*(b[O]-C[O])+C[O];t[d].setAttribute("viewBox",v.toString())}break;case"margin":if(r[d][g]){C=e[d][g],b=r[d][g],v=[0,0,0,0];for(var O in C)v[O]=n((h*l-l)/i)*(b[O]-C[O])+C[O];var x="";for(O=0;O<v.length;O++)x+=parseInt(v[O])+"px ";t[d]&&t[d].style&&(t[d].style[g]=x)}break;case"scrolly":m=n((h*l-l)/i)*(r[d][g]-e[d][g])+e[d][g];t[d].scrollTo(0,m);break;default:m=n((h*l-l)/i)*(r[d][g]-e[d][g])+e[d][g];t[d]&&t[d].style&&(t[d].style[g]=m+p)}}o&&o(),(h+=1)>c+1&&(clearInterval(s),a&&a(t))}),l)},OrgChart.anim={},OrgChart.anim.inPow=function(t){return t<0?0:t>1?1:Math.pow(t,2)},OrgChart.anim.outPow=function(t){if(t<0)return 0;if(t>1)return 1;return-1*(Math.pow(t-1,2)+-1)},OrgChart.anim.inOutPow=function(t){if(t<0)return 0;if(t>1)return 1;if((t*=2)<1)return OrgChart.anim.inPow(t,2)/2;return-.5*(Math.pow(t-2,2)+-2)},OrgChart.anim.inSin=function(t){return t<0?0:t>1?1:1-Math.cos(t*(Math.PI/2))},OrgChart.anim.outSin=function(t){return t<0?0:t>1?1:Math.sin(t*(Math.PI/2))},OrgChart.anim.inOutSin=function(t){return t<0?0:t>1?1:-.5*(Math.cos(Math.PI*t)-1)},OrgChart.anim.inExp=function(t){return t<0?0:t>1?1:Math.pow(2,10*(t-1))},OrgChart.anim.outExp=function(t){return t<0?0:t>1?1:1-Math.pow(2,-10*t)},OrgChart.anim.inOutExp=function(t){return t<0?0:t>1?1:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,10*(-2*t+1)))},OrgChart.anim.inCirc=function(t){return t<0?0:t>1?1:-(Math.sqrt(1-t*t)-1)},OrgChart.anim.outCirc=function(t){return t<0?0:t>1?1:Math.sqrt(1-(t-1)*(t-1))},OrgChart.anim.inOutCirc=function(t){return t<0?0:t>1?1:t<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(2*t-2)*(2*t-2))+1)},OrgChart.anim.rebound=function(t){return t<0?0:t>1?1:t<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-1.5/2.75)*(t-1.5/2.75)+.75):t<2.5/2.75?1-(7.5625*(t-2.25/2.75)*(t-2.25/2.75)+.9375):1-(7.5625*(t-2.625/2.75)*(t-2.625/2.75)+.984375)},OrgChart.anim.inBack=function(t){return t<0?0:t>1?1:t*t*(2.70158*t-1.70158)},OrgChart.anim.outBack=function(t){return t<0?0:t>1?1:(t-1)*(t-1)*(2.70158*(t-1)+1.70158)+1},OrgChart.anim.inOutBack=function(t){return t<0?0:t>1?1:t<.5?4*t*t*(7.1898*t-2.5949)*.5:.5*((2*t-2)*(2*t-2)*(3.5949*(2*t-2)+2.5949)+2)},OrgChart.anim.impulse=function(t){var e=2*t;return e*Math.exp(1-e)},OrgChart.anim.expPulse=function(t){return Math.exp(-2*Math.pow(t,2))},void 0===OrgChart&&(OrgChart={}),OrgChart.prototype._attachInitEventHandlers=function(t){this._addEvent(window,"resize",this._resizeHandler)},OrgChart.prototype._attachEventHandlers=function(t){if(this.config.interactive){t=this.getSvg();this.config.enableTouch||OrgChart.isMobile()?(this._addEvent(t,"touchstart",this._globalMouseDownHandler),this._addEvent(t,"touchend",this._globalClickHandler)):(this._addEvent(t,"mousedown",this._globalMouseDownHandler),this._addEvent(t,"click",this._globalClickHandler),this._addEvent(t,"contextmenu",this._globalContextHandler),this._addEvent(t,"dblclick",this._globalDbClickHandler),this.config.mouseScrool!=OrgChart.action.none&&this._addEvent(t,"wheel",this._mouseScrollHandler));var e=this.getMenuButton();e&&this._addEvent(e,"click",this._menuClickHandler)}},OrgChart.prototype._addEvent=function(t,e,r,i){var n,a;(i||(i=""),t.getListenerList||(t.getListenerList={}),t.getListenerList[e+i])||(n=this,a=r,r=function(){if(a)return a.apply(n,[this,arguments[0]])},t.addEventListener?"mousewheel"==e||"wheel"==e?t.addEventListener(e,o,{passive:!1}):t.addEventListener(e,o,!1):t.attachEvent("on"+e,(function(){var e=r.call(t,window.event);return!1===e&&(window.event.returnValue=!1,window.event.cancelBubble=!0),e})),t.getListenerList[e+i]=o);function o(t){var e=r.apply(this,arguments);return!1===e&&(t.stopPropagation(),t.preventDefault()),e}},OrgChart.prototype._removeEvent=function(t,e){if(t.getListenerList[e]){var r=t.getListenerList[e];t.removeEventListener(e,r,!1),delete t.getListenerList[e]}},void 0===OrgChart&&(OrgChart={}),OrgChart.VERSION="8.16.18",OrgChart.orientation={},OrgChart.orientation.top=0,OrgChart.orientation.bottom=1,OrgChart.orientation.right=2,OrgChart.orientation.left=3,OrgChart.orientation.top_left=4,OrgChart.orientation.bottom_left=5,OrgChart.orientation.right_top=6,OrgChart.orientation.left_top=7,OrgChart.align={},OrgChart.align.center=OrgChart.CENTER=8,OrgChart.align.orientation=OrgChart.ORIENTATION=9,OrgChart.attr={},OrgChart.attr.l="data-l",OrgChart.attr.id="data-id",OrgChart.attr.sl="data-sl",OrgChart.attr.lbl="data-lbl",OrgChart.attr.val="data-val",OrgChart.attr.tlbr="data-tlbr",OrgChart.attr.item="data-item",OrgChart.attr.layout="data-layout",OrgChart.attr.node_id="data-n-id",OrgChart.attr.link_id="data-l-id",OrgChart.attr.field_name="data-f-name",OrgChart.attr.c_link_to="data-c-l-to",OrgChart.attr.c_link_from="data-c-l-from",OrgChart.attr.s_link_to="data-s-l-to",OrgChart.attr.s_link_from="data-s-l-from",OrgChart.attr.control_add="data-ctrl-add",OrgChart.attr.control_expcoll_id="data-ctrl-ec-id",OrgChart.attr.control_up_id="data-ctrl-up-id",OrgChart.attr.control_export_menu="data-ctrl-menu",OrgChart.attr.control_node_menu_id="data-ctrl-n-menu-id",OrgChart.attr.control_node_circle_menu_id="data-ctrl-n-c-menu-id",OrgChart.attr.control_node_circle_menu_name="data-ctrl-n-c-menu-name",OrgChart.attr.control_node_circle_menu_wrraper_id="data-ctrl-n-c-menu-wrapper-id",OrgChart.attr.width="data-width",OrgChart.attr.text_overflow="data-text-overflow",OrgChart.ID="id",OrgChart.PID="pid",OrgChart.STPID="stpid",OrgChart.TAGS="tags",OrgChart.NODES="nodes",OrgChart.ELASTIC="elastic",OrgChart.ASSISTANT="Assistant",OrgChart.action={},OrgChart.action.expand=0,OrgChart.action.collapse=1,OrgChart.action.maximize=101,OrgChart.action.minimize=102,OrgChart.action.expandCollapse=501,OrgChart.action.edit=1,OrgChart.action.zoom=2,OrgChart.action.ctrlZoom=22,OrgChart.action.scroll=41,OrgChart.action.xScroll=3,OrgChart.action.yScroll=4,OrgChart.action.none=5,OrgChart.action.init=6,OrgChart.action.update=7,OrgChart.action.move=70,OrgChart.action.pan=8,OrgChart.action.centerNode=9,OrgChart.action.resize=10,OrgChart.action.insert=11,OrgChart.action.insertfirst=12,OrgChart.action.details=13,OrgChart.action.exporting=14,OrgChart.none=400001,OrgChart.scroll={},OrgChart.scroll.visible=!0,OrgChart.scroll.smooth=12,OrgChart.scroll.speed=120,OrgChart.scroll.safari={smooth:12,speed:250},OrgChart.match={},OrgChart.match.height=100001,OrgChart.match.width=100002,OrgChart.match.boundary=100003,OrgChart.movable={},OrgChart.movable.node="node",OrgChart.movable.tree="tree",OrgChart.movable.detachTree="detachTree",OrgChart.layout={},OrgChart.layout.normal=OrgChart.normal=0,OrgChart.layout.mixed=OrgChart.mixed=1,OrgChart.layout.tree=OrgChart.tree=2,OrgChart.layout.treeLeftOffset=OrgChart.treeLeftOffset=3,OrgChart.layout.treeRightOffset=OrgChart.treeRightOffset=4,OrgChart.layout.treeLeft=5,OrgChart.layout.treeRight=6,OrgChart.layout.grid=-1,OrgChart.nodeOpenTag="<g "+OrgChart.attr.node_id+'="{id}" style="opacity: {opacity}" transform="matrix(1,0,0,1,{x},{y})" class="{class}" '+OrgChart.attr.sl+'="{sl}" '+OrgChart.attr.l+"={level} {lcn}>",OrgChart.linkOpenTag="<g "+OrgChart.attr.link_id+'="[{id}][{child-id}]" class="{class}">',OrgChart.expcollOpenTag="<g "+OrgChart.attr.control_expcoll_id+'="{id}" transform="matrix(1,0,0,1,{x},{y})" style="cursor:pointer;">',OrgChart.upOpenTag="<g "+OrgChart.attr.control_up_id+'="{id}" transform="matrix(1,0,0,1,{x},{y})" style="cursor:pointer;">',OrgChart.linkFieldsOpenTag='<g transform="matrix(1,0,0,1,{x},{y}) rotate({rotate})">',OrgChart.grCloseTag="</g>",OrgChart.A5w=420,OrgChart.A5h=595,OrgChart.A4w=595,OrgChart.A4h=842,OrgChart.A3w=842,OrgChart.A3h=1191,OrgChart.A2w=1191,OrgChart.A2h=1684,OrgChart.A1w=1684,OrgChart.A1h=2384,OrgChart.Letterw=612,OrgChart.Letterh=791,OrgChart.Legalw=612,OrgChart.Legalh=1009,OrgChart.COLLAPSE_PARENT_NEIGHBORS=1,OrgChart.COLLAPSE_SUB_CHILDRENS=2,OrgChart.COLLAPSE_PARENT_SUB_CHILDREN_EXCEPT_CLICKED=3,OrgChart.TEXT_THRESHOLD=4e3,OrgChart.IMAGES_THRESHOLD=1e3,OrgChart.LINKS_THRESHOLD=2e3,OrgChart.BUTTONS_THRESHOLD=700,OrgChart.ANIM_THRESHOLD=500,OrgChart.IT_IS_LONELY_HERE='<g transform="translate(-100, 0)" style="cursor:pointer;" '+OrgChart.attr.control_add+'="control-add"><text fill="#039be5">{link}</text></g>',OrgChart.RES={},OrgChart.IT_IS_LONELY_HERE_LINK=OrgChart.RES.IT_IS_LONELY_HERE_LINK="It's lonely here, add your first node",OrgChart.FIRE_DRAG_NOT_CLICK_IF_MOVE=3,OrgChart.STRING_TAGS=!1,OrgChart.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>",OrgChart.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>",OrgChart.SEARCH_PLACEHOLDER="Search... type ? to get help.",OrgChart.SEARCH_HELP_SYMBOL="?",OrgChart.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE=!1,OrgChart.SEARCH_RESULT_LIMIT=10,OrgChart.IMPORT_MESSAGE="Choose the columns (fields) in your data file that contain the required information.",OrgChart.FIXED_POSITION_ON_CLICK=!1,OrgChart.RENDER_LINKS_BEFORE_NODES=!1,OrgChart.RENDER_CLINKS_BEFORE_NODES=!1,OrgChart.MIXED_LAYOUT_ALL_NODES=!0,OrgChart.MIXED_LAYOUT_FOR_NODES_WITH_COLLAPSED_CHILDREN=!1,OrgChart.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN=1,OrgChart.LINK_ROUNDED_CORNERS=5,OrgChart.MOVE_STEP=5,OrgChart.CLINK_CURVE=1,OrgChart.MAX_DEPTH=200,OrgChart.SCALE_FACTOR=1.44,OrgChart.LAZY_LOADING_FACTOR="auto",OrgChart.HIDE_EDIT_FORM_ON_PAN=!0,OrgChart.LAZY_LOADING=!0,OrgChart.ARRAY_FIELDS=["tags"],OrgChart.CSV_DELIMITER=",",OrgChart.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>',OrgChart.ESCAPE_HTML=!1,OrgChart.VERTICAL_CHILDREN_ASSISTANT=!1,OrgChart.EXPORT_PAGES_CUT_NODES=!1,OrgChart.RESET_MOVABLE_ONEXPANDCOLLAPSE=!1,OrgChart.FILTER_ALPHABETICALLY=!0,OrgChart.SERVER_PREFIX=".azurewebsites.net/api/OrgChartJS",OrgChart.FUNC_URL_NAME="func-url-orgchartjs",OrgChart.MINIMUM_SYMBOLS_IN_SEARCH_INPUT=1,OrgChart.AI_SYSTEM_MESSAGES=[],"undefined"!=typeof module&&(module.exports=OrgChart),OrgChart._intersects=function(t,e,r){var i=t.x-r.siblingSeparation/4,n=t.y,a=t.x+t.w+r.siblingSeparation/4,o=t.y;switch(r.orientation){case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:i=t.x,n=t.y-r.siblingSeparation/4,a=t.x,o=t.y+t.h+r.siblingSeparation/4}var s,l,h,c=e.p,d=e.q,g=e.r,p=e.s;return 0!==(s=(a-i)*(p-d)-(g-c)*(o-n))&&(l=((n-o)*(g-i)+(a-i)*(p-n))/s,0<(h=((p-d)*(g-i)+(c-g)*(p-n))/s)&&h<1&&0<l&&l<1)},OrgChart._addPoint=function(t,e,r,i,n){switch(r.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:return OrgChart._addPointTop(t,e,r,i,n);case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:return OrgChart._addPointBottom(t,e,r,i,n);case OrgChart.orientation.left:case OrgChart.orientation.left_top:return OrgChart._addPointLeft(t,e,r,i,n);case OrgChart.orientation.right:case OrgChart.orientation.right_top:return OrgChart._addPointRight(t,e,r,i,n)}},OrgChart._addPointTop=function(t,e,r,i,n){var a,o,s;return"left"==n?a=t.leftNeighbor?t.x+(t.leftNeighbor.x+t.leftNeighbor.w-t.x)/2:t.x-r.siblingSeparation/2:"right"==n&&(a=t.rightNeighbor?t.x+t.w+(t.rightNeighbor.x-(t.x+t.w))/2:t.x+t.w+r.siblingSeparation/2),e.push([a,e[e.length-1][1]]),e.push([a,t.y-r.levelSeparation/3]),o=e[e.length-1][1],s=a,i.p=a,i.q=o,i.r=s,i},OrgChart._addPointBottom=function(t,e,r,i,n){var a,o,s;return"left"==n?a=t.leftNeighbor?t.x+(t.leftNeighbor.x+t.leftNeighbor.w-t.x)/2:t.x-r.siblingSeparation/2:"right"==n&&(a=t.rightNeighbor?t.x+t.w+(t.rightNeighbor.x-(t.x+t.w))/2:t.x+t.w+r.siblingSeparation/2),e.push([a,e[e.length-1][1]]),e.push([a,t.y+t.h+r.levelSeparation/3]),o=e[e.length-1][1],s=a,i.p=a,i.q=o,i.r=s,i},OrgChart._addPointLeft=function(t,e,r,i,n){var a,o=e[e.length-1][0];"bottom"==n?a=t.rightNeighbor?t.y+t.h+(t.rightNeighbor.y-(t.y+t.h))/2:t.y+t.h+r.siblingSeparation/2:"top"==n&&(a=t.leftNeighbor?t.y+(t.leftNeighbor.y+t.leftNeighbor.h-t.y)/2:t.y-r.siblingSeparation/2),e.push([e[e.length-1][0],a]),e.push([t.x-r.levelSeparation/3,a]),o=e[e.length-1][0];var s=a;return i.p=o,i.q=a,i.s=s,i},OrgChart._addPointRight=function(t,e,r,i,n){var a,o=e[e.length-1][0];"bottom"==n?a=t.rightNeighbor?t.y+t.h+(t.rightNeighbor.y-(t.y+t.h))/2:t.y+t.h+r.siblingSeparation/2:"top"==n&&(a=t.leftNeighbor?t.y+(t.leftNeighbor.y+t.leftNeighbor.h-t.y)/2:t.y-r.siblingSeparation/2),e.push([e[e.length-1][0],a]),e.push([t.x+t.w+r.levelSeparation/3,a]),o=e[e.length-1][0];var s=a;return i.p=o,i.q=a,i.s=s,i},OrgChart.editUI=function(){},OrgChart.editUI.prototype.init=function(t){this.obj=t,this.fields=null,this._event_id=OrgChart._guid()},OrgChart.editUI.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},OrgChart.editUI.prototype.show=function(t,e,r){if(this.hide(),!1===OrgChart.events.publish("show",[this,t]))return!1;var i=this,n=this.content(t,e,r);this.obj.element.appendChild(n.element),OrgChart.input.init(this.obj.element),OrgChart.events.publish("shown",[this,{nodeId:t}]),r?e||this._focusElement(n.focusId):this.interval=OrgChart.animate(n.element,{right:-20,opacity:0},{right:0,opacity:1},300,OrgChart.anim.outSin,(function(){e||i._focusElement(n.focusId)})),this.obj.element.querySelector("[data-edit-from-close]").addEventListener("click",(function(e){e.preventDefault(),!1!==OrgChart.events.publish("cancel",[i,{id:t}])&&i.hide()})),this.obj.element.querySelector("[data-edit-from-cancel]").addEventListener("click",(function(e){e.preventDefault(),!1!==OrgChart.events.publish("cancel",[i,{id:t}])&&i.hide()})),this.obj.element.querySelector("[data-edit-from-save]").addEventListener("click",(function(e){e.preventDefault();var r=OrgChart.input.validateAndGetData(n.element);if(!1!==r){var a=i.obj.get(t),o={data:OrgChart.mergeDeep(a,r)};if(!1===OrgChart.events.publish("save",[i,o]))return;i.obj.updateNode(o.data,null,!0),i.hide()}}));for(var a=this.obj.element.querySelectorAll("[data-input-btn]"),o=0;o<a.length;o++){a[o].addEventListener("click",(function(e){e.preventDefault(),OrgChart.events.publish("element-btn-click",[i,{input:this.parentNode.querySelector("input"),nodeId:t,event:e}])}))}this.obj.element.querySelector("[data-add-more-fields-btn]").addEventListener("click",(function(t){t.stopPropagation(),t.preventDefault();var e=this,r=OrgChart.elements.textbox({},{type:"textbox",label:i.obj.config.editForm.addMoreFieldName,btn:i.obj.config.editForm.addMoreBtn},"280px");e.parentNode.insertAdjacentHTML("beforebegin",r.html),e.style.display="none",OrgChart.input.init(e.parentNode.previousSibling);var n=document.getElementById(r.id);n.focus(),n.nextElementSibling.addEventListener("click",(function(t){t.stopPropagation(),t.preventDefault();var r=n.value,a=i.obj.element.querySelector('[data-binding="'+OrgChart._escapeDoubleQuotes(n.value)+'"]');if(OrgChart.isNEU(r)||a)n.focus();else{var o=OrgChart.elements.textbox({},{type:"textbox",label:r,binding:r},"280px");n.parentNode.parentNode.parentNode.removeChild(n.parentNode.parentNode),e.parentNode.insertAdjacentHTML("beforebegin",o.html),e.style.display="",OrgChart.input.init(e.parentNode.previousSibling),document.getElementById(o.id).focus()}}))})),this.obj.element.querySelector("[data-boc-edit-from-btns]").addEventListener("click",(function(e){for(var r=e.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:e};if(!1===OrgChart.events.publish("button-click",[i,o]))return!1;switch(a){case"edit":i.obj.editUI.show(t,!1,!0);break;case"pdf":i.obj.exportPDFProfile({id:t,filename:n.title}),i.hide();break;case"png":i.obj.exportPNGProfile({id:t,filename:n.title}),i.hide();break;case"share":i.obj.shareProfile(t);break;case"remove":i.obj.removeNode(t,null,!0),i.hide()}}}))},OrgChart.editUI.prototype._focusElement=function(t){var e=null;OrgChart.isNEU(this.obj.config.editForm.focusBinding)?OrgChart.isNEU(t)||(e=document.getElementById(t)):e=this.obj.element.querySelector('[data-binding="'+this.obj.config.editForm.focusBinding+'"]'),e&&(e.value&&e.value.length&&e.setSelectionRange(e.value.length,e.value.length),e.focus())},OrgChart.editUI.prototype.content=function(t,e,r,i,n){var a,o=this.obj.config.editForm.readOnly,s=JSON.parse(JSON.stringify(this.obj.config.editForm.elements)),l=this.obj.config.editForm.addMore,h=this.obj.config.editForm.saveAndCloseBtn,c=this.obj.config.editForm.cancelBtn,d=this.obj.config.editForm.buttons,g=this.obj.config.editForm.titleBinding,p=this.obj.config.editForm.photoBinding,u=this.obj.getNode(t),f=this.obj._get(t),m=OrgChart.t(u.templateName,u.min,this.obj.getScale()),C=f[g],b=f[p];if(this.obj.config.editForm.generateElementsFromFields)for(var v=0;v<this.fields.length;v++){var O=this.fields[v];if("tags"!=O){for(var x=!1,y=0;y<s.length;y++){if(Array.isArray(s[y])){for(var _=0;_<s[y].length;_++)if(O==s[y][_].binding){x=!0;break}}else if(O==s[y].binding){x=!0;break}if(x)break}x||s.push({type:"textbox",label:O,binding:O})}}OrgChart.isNEU(C)&&(C=""),b=OrgChart.isNEU(b)?OrgChart.icon.user(150,150,"#8C8C8C",0,0):`<img style="width: 100%;height:100%;border-radius: 50%;object-fit:cover;" src="${b}"></img>`;var k=!e,w=e?"display:none;":"",S=e||!l?"display:none;":"",I=m.editFormHeaderColor?`style="background-color:${m.editFormHeaderColor};"`:"",A=document.createElement("form");if(A.setAttribute("data-boc-edit-form",""),A.classList.add("boc-edit-form"),A.classList.add(this.obj.config.mode),A.classList.add(u.templateName.replaceAll(" ","")),A.classList.add(OrgChart.ui._defsIds[u.templateName]),Array.isArray(u.tags)&&u.tags.length)for(v=0;v<u.tags.length;v++)A.classList.add(u.tags[v].replaceAll(" ",""));A.style.display="flex",A.style.opacity=r?1:0,A.style.right=r?0:"-20px",i&&(A.style.width=i);var L=[],E=n?"":OrgChart.EDITFORM_CLOSE_BTN;return A.innerHTML=`<div>\n <div class="boc-edit-form-header" ${I}>\n ${E}\n ${OrgChart.editUI.renderHeaderContent(C,b,u,f)}\n </div>\n <div data-boc-edit-from-btns class="boc-edit-form-instruments">\n ${function(){if(n)return"";var t="";for(var r in d){var i=d[r];OrgChart.isNEU(i)||(k&&i.hideIfEditMode||e&&i.hideIfDetailsMode||o&&"Edit"==i.text||(t+=`<div data-edit-from-btn='${r}' class="boc-img-button" ${I} title="${i.text}">${i.icon}</div>`))}return t}()} \n </div>\n </div>\n <div class="boc-edit-form-fields">\n <div class="boc-edit-form-fields-inner">\n <div class="boc-form-fieldset">\n ${function(){for(var t="",r=0;r<s.length;r++){var i=s[r];if(Array.isArray(i)){t+='<div class="boc-form-field-100 boc-form-fieldset">';for(var n=0;n<i.length;n++){var o=i[n],l=OrgChart.elements[o.type](f,o,"unset",e);!OrgChart.isNEU(l.id)&&OrgChart.isNEU(a)&&OrgChart.isNEU(l.value)&&(a=l.id),OrgChart.isNEU(l.value)||L.push(`${o.label}: ${l.value}`),t+=l.html}t+="</div>"}else{l=OrgChart.elements[i.type](f,i,"280px",e);!OrgChart.isNEU(l.id)&&OrgChart.isNEU(a)&&OrgChart.isNEU(l.value)&&(a=l.id),OrgChart.isNEU(l.value)||L.push(`${i.label}: ${l.value}`),t+=l.html}}return t}()}\n\n <div class="boc-form-field" style="min-width: 280px; text-align:center; ${S}">\n <a data-add-more-fields-btn href="#" class="boc-link">${l}</a>\n </div>\n </div> \n </div>\n </div>\n <div class="boc-form-fieldset" style="padding: 14px 10px; ${w}">\n <div class="boc-form-field" style="min-width: initial;">\n <button data-edit-from-cancel type="button" class="boc-button transparent">${c}</button>\n </div>\n <div class="boc-form-field" style="min-width: initial;">\n <button type="submit" data-edit-from-save type="button" class="boc-button">${h}</button>\n </div>\n </div>`,{element:A,focusId:a,title:C,shareText:L.join("\n")}},OrgChart.editUI.prototype.hide=function(){if(!1===OrgChart.events.publish("hide",[this]))return!1;OrgChart.isNEU(this.interval)&&(clearInterval(this.interval),this.interval=null);var t=this.obj.element.querySelector("[data-boc-edit-form]");t&&t.parentNode&&t.parentNode.removeChild(t)},OrgChart.editUI.renderHeaderContent=function(t,e,r,i){return`<h1 class="boc-edit-form-title">${OrgChart._escapeGreaterLessSign(t)}</h1>\n <div id="boc-avatar" class="boc-edit-form-avatar">${e}</div>`},OrgChart.prototype.getSvg=function(){var t=this.element.getElementsByTagName("svg");return t&&t.length?t[0]:null},OrgChart.prototype.getPointerElement=function(){return this.element.querySelector("g[data-pointer]")},OrgChart.prototype.getNodeElement=function(t){return this.element.querySelector("["+OrgChart.attr.node_id+"='"+t+"']")},OrgChart.prototype.getMenuButton=function(){return this.element.querySelector("["+OrgChart.attr.control_export_menu+"]")},OrgChart.menuUI=function(){},OrgChart.menuUI.prototype.init=function(t,e){this.obj=t,this.wrapper=null,this.menu=e,this._event_id=OrgChart._guid()},OrgChart.menuUI.prototype.showStickIn=function(t,e,r,i){this._show(t,null,e,r,i)},OrgChart.menuUI.prototype.show=function(t,e,r,i,n){this._show(t,e,r,i,n)},OrgChart.menuUI.prototype._show=function(t,e,r,i,n){var a=this;this.hide();var o="";n||(n=this.menu);var s={firstNodeId:r,secondNodeId:i,menu:n};if(!1===OrgChart.events.publish("show",[this,s]))return!1;for(var l in n=s.menu){var h=n[l].icon,c=n[l].text;void 0===h&&(h=OrgChart.icon[l]?OrgChart.icon[l](24,24,"#7A7A7A"):""),"function"==typeof c&&(c=c()),"function"==typeof h&&(h=h()),o+="<div "+OrgChart.attr.item+'="'+l+'">'+h+"<span> "+c+"</span></div>"}if(""!=o){if(this.wrapper=document.createElement("div"),this.wrapper.className="boc-chart-menu",this.wrapper.style.left="-99999px",this.wrapper.style.top="-99999px",this.wrapper.innerHTML=o,this.obj.element.appendChild(this.wrapper),null==e){var d=OrgChart._menuPosition(t,this.wrapper,this.obj.getSvg());t=d.x,e=d.y}var g=t+45;this.wrapper.style.left=g+"px",this.wrapper.style.top=e+"px",this.wrapper.style.left=g-this.wrapper.offsetWidth+"px";var p=t-this.wrapper.offsetWidth;OrgChart.animate(this.wrapper,{opacity:0,left:g-this.wrapper.offsetWidth},{opacity:1,left:p},300,OrgChart.anim.inOutPow);for(var u=this.wrapper.getElementsByTagName("div"),f=0;f<u.length;f++){(l=u[f]).addEventListener("click",(function(t){var e,o=this.getAttribute(OrgChart.attr.item);if(void 0===n[o].onClick)if("add"===o){var s={id:a.obj.generateId(),pid:r};a.obj.addNode(s,null,!0)}else if("edit"===o){var l=a.obj.getNode(r);a.obj.editUI.show(l.id)}else if("details"===o){l=a.obj.getNode(r);a.obj.editUI.show(l.id,!0)}else"remove"===o?a.obj.removeNode(r,null,!0):"svg"===o?a.obj.exportSVG({filename:"OrgChart.svg",expandChildren:!1,nodeId:r}):"pdf"===o?a.obj.exportPDF({filename:"OrgChart.pdf",expandChildren:!1,nodeId:r}):"png"===o?a.obj.exportPNG({filename:"OrgChart.png",expandChildren:!1,nodeId:r}):"csv"===o?a.obj.exportCSV({nodeId:r}):"xml"===o?a.obj.exportXML({nodeId:r}):"json"===o?a.obj.exportJSON({nodeId:r}):"visio"===o&&a.obj.exportVisio({nodeId:r});else e=n[o].onClick.call(a.obj,r,i);0!=e&&a.hide()}))}}},OrgChart.menuUI.prototype.isVisible=function(){return null!=this.wrapper},OrgChart.menuUI.prototype.hide=function(){null!=this.wrapper&&(this.obj.element.removeChild(this.wrapper),this.wrapper=null)},OrgChart.menuUI.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},OrgChart.circleMenuUI=function(){},OrgChart.circleMenuUI.prototype.init=function(t,e){this.obj=t,this.menu=e,this._menu=null,this._buttonsInterval=[],this._linesInterval=[],this._event_id=OrgChart._guid()},OrgChart.circleMenuUI.prototype.show=function(t,e){this._show(t,e)},OrgChart.circleMenuUI.prototype._show=function(t,e){var r=this,i=this.obj.getNode(t),n=OrgChart.t(i.templateName,i.min,this.obj.getScale());if(!OrgChart.isNEU(n.nodeCircleMenuButton)){var a=this.obj.getSvg(),o=this.obj.element.querySelector("["+OrgChart.attr.control_node_circle_menu_id+'="'+t+'"]'),s=this.obj.getNodeElement(t),l=OrgChart._getTransform(o),h=OrgChart._getTransform(s),c=l[4]+h[4],d=l[5]+h[5],g=o.querySelectorAll("line"),p=this.obj.element.querySelector("["+OrgChart.attr.control_node_circle_menu_wrraper_id+"]");if(OrgChart.isNEU(p)||p.getAttribute(OrgChart.attr.control_node_circle_menu_wrraper_id)!=t){this.hide(),e||(e=this.menu);var u={nodeId:t,menu:e},f=OrgChart.events.publish("show",[this,u]);if(this._menu=e,!1===f)return!1;for(var m=0,C=Object.keys(u.menu).length,b=2*n.nodeCircleMenuButton.radius+4,v=2*Math.PI*b,O=v/C-(2*n.nodeCircleMenuButton.radius+2);O<0;)b+=8,O=(v=2*Math.PI*b)/C-(2*n.nodeCircleMenuButton.radius+2);for(var x in(p=document.createElementNS("http://www.w3.org/2000/svg","g")).setAttribute(OrgChart.attr.control_node_circle_menu_wrraper_id,t),p.setAttribute("transform","matrix(1,0,0,1,"+c+","+d+")"),a.appendChild(p),u.menu){var y=u.menu[x].icon,_=u.menu[x].color,k=u.menu[x].text;"function"==typeof y&&(y=y()),"function"==typeof _&&(_=_()),"function"==typeof k&&(k=k());var w=document.createElementNS("http://www.w3.org/2000/svg","g");w.setAttribute("transform","matrix(1,0,0,1,0,0)"),w.setAttribute(OrgChart.attr.control_node_circle_menu_name,x),w.style.cursor="pointer";var S=document.createElementNS("http://www.w3.org/2000/svg","title");OrgChart.isNEU(k)||(S.innerHTML=k);var I=document.createElementNS("http://www.w3.org/2000/svg","circle");I.setAttribute("cx",0),I.setAttribute("cy",0),I.setAttribute("r",n.nodeCircleMenuButton.radius),I.setAttribute("fill",_),I.setAttribute("stroke-width","1"),I.setAttribute("stroke",n.nodeCircleMenuButton.stroke),w.appendChild(I),w.appendChild(S),w.innerHTML+=y,p.appendChild(w);var A=w.getElementsByTagName("svg")[0];if(A.setAttribute("pointer-events","none"),A){var L=parseInt(A.getAttribute("width")),E=parseInt(A.getAttribute("height"));A.setAttribute("x",-L/2),A.setAttribute("y",-E/2)}var N=m*Math.PI/(C/2);m++;var M=Math.cos(N)*b,T=Math.sin(N)*b;this._buttonsInterval.push(OrgChart.animate(w,{transform:[1,0,0,1,0,0]},{transform:[1,0,0,1,M,T]},250,OrgChart.anim.outBack,(function(t){var e=t[0].getAttribute(OrgChart.attr.control_node_circle_menu_name),i=t[0].parentNode.getAttribute(OrgChart.attr.control_node_circle_menu_wrraper_id);t[0].addEventListener("mouseenter",(function(t){OrgChart.events.publish("mouseenter",[r,{from:i,menuItem:u.menu[e],menuItemName:e,event:t}])})),t[0].addEventListener("mouseout",(function(t){OrgChart.events.publish("mouseout",[r,{from:i,menuItem:u.menu[e],menuItemName:e,event:t}])}))})))}this._linesInterval.push(OrgChart.animate(g[0],{x1:-n.nodeCircleMenuButton.radius/2,y1:-6,x2:n.nodeCircleMenuButton.radius/2,y2:-6},{x1:-7,y1:-7,x2:7,y2:7},500,OrgChart.anim.inOutSin)),this._linesInterval.push(OrgChart.animate(g[1],{x1:-n.nodeCircleMenuButton.radius/2,y1:0,x2:n.nodeCircleMenuButton.radius/2,y2:0},{x1:0,y1:0,x2:0,y2:0},500,OrgChart.anim.inOutSin)),this._linesInterval.push(OrgChart.animate(g[2],{x1:-n.nodeCircleMenuButton.radius/2,y1:6,x2:n.nodeCircleMenuButton.radius/2,y2:6},{x1:-7,y1:7,x2:7,y2:-7},500,OrgChart.anim.inOutSin))}else this.hide()}},OrgChart.circleMenuUI.prototype.hide=function(){for(var t=this._buttonsInterval.length-1;t>=0;t--)clearInterval(this._buttonsInterval[t]),this._buttonsInterval.splice(t,1);this._buttonsInterval=[];for(t=this._linesInterval.length-1;t>=0;t--)clearInterval(this._linesInterval[t]),this._linesInterval.splice(t,1);this._linesInterval=[];var e=this.obj.element.querySelector("["+OrgChart.attr.control_node_circle_menu_wrraper_id+"]");if(null!=e){var r=e.getAttribute(OrgChart.attr.control_node_circle_menu_wrraper_id),i=this.obj.getNode(r),n=OrgChart.t(i.templateName,i.min,this.obj.getScale()),a=this.obj.element.querySelector("["+OrgChart.attr.control_node_circle_menu_id+'="'+r+'"]').querySelectorAll("line");a[0].setAttribute("x1",-n.nodeCircleMenuButton.radius/2),a[0].setAttribute("x2",n.nodeCircleMenuButton.radius/2),a[0].setAttribute("y1",-6),a[0].setAttribute("y2",-6),a[1].setAttribute("x1",-n.nodeCircleMenuButton.radius/2),a[1].setAttribute("x2",n.nodeCircleMenuButton.radius/2),a[1].setAttribute("y1",0),a[1].setAttribute("y2",0),a[2].setAttribute("x1",-n.nodeCircleMenuButton.radius/2),a[2].setAttribute("x2",n.nodeCircleMenuButton.radius/2),a[2].setAttribute("y1",6),a[2].setAttribute("y2",6),e.parentElement.removeChild(e),e=null}},OrgChart.circleMenuUI.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},void 0===OrgChart&&(OrgChart={}),OrgChart.idb={version:1,dbName:"BALKAN",tableName:"orgchart-js",keyPath:"id"},OrgChart.idb.db=null,OrgChart.idb._open=function(t){if(OrgChart._browser().msie)t&&t(!1);else if((navigator.userAgent.toLowerCase().indexOf("safari")>0||navigator.userAgent.toLowerCase().indexOf("firefox")>0)&&window.location!==window.parent.location)t&&t(!1);else{if(!window.indexedDB)return console.error("Your browser doesn't support a stable version of IndexedDB."),void(t&&t(!1));if(null==OrgChart.idb.db){var e=indexedDB.open(OrgChart.idb.dbName,OrgChart.idb.version);e.onerror=function(e){console.error("Cannot open database!"),t&&t(!1)},e.onsuccess=function(e){OrgChart.idb.db=e.target.result,t&&t(!0)},e.onupgradeneeded=function(t){var e=t.target.result;e.objectStoreNames.contains(OrgChart.idb.tableName)&&e.deleteObjectStore(OrgChart.idb.tableName);e.createObjectStore(OrgChart.idb.tableName,{keyPath:OrgChart.idb.keyPath})}}else t&&t(!0)}},OrgChart.idb.read=function(t,e){OrgChart.idb._open((function(r){if(r){var i=OrgChart.idb.db.transaction([OrgChart.idb.tableName]).objectStore(OrgChart.idb.tableName).get(t);i.onerror=function(t){console.error("Unable to retrieve data from database!"),e&&e(!1)},i.onsuccess=function(t){i.result?e&&e(!0,i.result):e&&e(null)}}else e&&e(!1)}))},OrgChart.idb.write=function(t,e){OrgChart.idb.read(t.id,(function(r){if(null==r){var i=OrgChart.idb.db.transaction([OrgChart.idb.tableName],"readwrite").objectStore(OrgChart.idb.tableName).add(t);i.onerror=function(t){console.error("Unable to add data to database!"),e&&e(!1)},i.onsuccess=function(t){e&&e(!0)}}else e&&e(r)}))},OrgChart.idb.put=function(t,e){OrgChart.idb._open((function(r){if(r){var i=OrgChart.idb.db.transaction([OrgChart.idb.tableName],"readwrite").objectStore(OrgChart.idb.tableName).put(t);i.onerror=function(t){console.error("Unable to put data to database!"),e&&e(!1)},i.onsuccess=function(t){e&&e(!0)}}else e&&e(!1)}))},OrgChart.idb.delete=function(t,e){OrgChart.idb._open((function(r){if(r){var i=OrgChart.idb.db.transaction([OrgChart.idb.tableName],"readwrite").objectStore(OrgChart.idb.tableName).delete(t);i.onerror=function(t){console.error("Unable to retrieve data from database!"),e&&e(!1)},i.onsuccess=function(t){i.error?e&&e(!1):e&&e(!0)}}else e&&e(!1)}))},OrgChart.toolbarUI=function(){},OrgChart.toolbarUI.expandAllIcon='<svg style="margin-bottom:7px;box-shadow: 0px 1px 4px rgba(0,0,0,0.3); border: 1px solid #cacaca;background-color: #f9f9f9;display: block;cursor: pointer;" width="32px" height="32px"><marker id="arrow" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="4" markerHeight="4" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#757575" /></marker><line x1="11" y1="11" x2="6" y2="6" stroke="#757575" stroke-width="2" marker-end="url(#arrow)" /><line x1="21" y1="11" x2="26" y2="6" stroke="#757575" stroke-width="2" marker-end="url(#arrow)" /><line x1="21" y1="21" x2="26" y2="26" stroke="#757575" stroke-width="2" marker-end="url(#arrow)" /><line x1="11" y1="21" x2="6" y2="26" stroke="#757575" stroke-width="2" marker-end="url(#arrow)" /><rect x="12" y="12" width="8" height="8" fill="#757575"></rect></svg>',OrgChart.toolbarUI.fitIcon='<svg style="margin-bottom:7px;box-shadow: 0px 1px 4px rgba(0,0,0,0.3); border: 1px solid #cacaca;background-color: #f9f9f9;display: block;cursor: pointer;" width="32px" height="32px"><path stroke-width="3" fill="none" stroke="#757575" d="M4,11 L4,4 L11,4"></path><path stroke-width="3" fill="none" stroke="#757575" d="M28,11 L28,4 L21,4"></path><path stroke-width="3" fill="none" stroke="#757575" d="M28,21 L28,28 L21,28"></path><path stroke-width="3" fill="none" stroke="#757575" d="M4,21 L4,28 L11,28"></path><circle cx="16" cy="16" r="5" fill="#757575"></circle></svg>',OrgChart.toolbarUI.openFullScreenIcon='<svg style="margin-bottom:7px;box-shadow: 0px 1px 4px rgba(0,0,0,0.3); border: 1px solid #cacaca;background-color: #f9f9f9;display: block;cursor: pointer;" width="32px" height="32px"><path stroke-width="3" fill="none" stroke="#757575" d="M4,11 L4,4 L11,4"></path><path stroke-width="3" fill="none" stroke="#757575" d="M28,11 L28,4 L21,4"></path><path stroke-width="3" fill="none" stroke="#757575" d="M28,21 L28,28 L21,28"></path><path stroke-width="3" fill="none" stroke="#757575" d="M4,21 L4,28 L11,28"></path><line x1="5" y1="5" x2="27" y2="27" stroke-width="3" stroke="#757575"></line><line x1="5" y1="27" x2="27" y2="5" stroke-width="3" stroke="#757575"></line></svg>',OrgChart.toolbarUI.closeFullScreenIcon='<svg style="margin-bottom:7px;box-shadow: 0px 1px 4px rgba(0,0,0,0.3); border: 1px solid #cacaca;background-color: #f9f9f9;display: block;cursor: pointer;" width="32px" height="32px"><path stroke-width="3" fill="none" stroke="#757575" d="M4,11 L4,4 L11,4"></path><path stroke-width="3" fill="none" stroke="#757575" d="M28,11 L28,4 L21,4"></path><path stroke-width="3" fill="none" stroke="#757575" d="M28,21 L28,28 L21,28"></path><path stroke-width="3" fill="none" stroke="#757575" d="M4,21 L4,28 L11,28"></path><rect x="11" y="11" width="10" height="10" stroke-width="3" fill="none" stroke="#757575" ></rect></svg>',OrgChart.toolbarUI.zoomInIcon='<svg style="box-shadow: 0px 1px 4px rgba(0,0,0,0.3); border-left: 1px solid #cacaca; border-right: 1px solid #cacaca; border-top: 1px solid #cacaca; background-color: #f9f9f9;display: block; cursor: pointer;" width="32px" height="32px" ><g><rect fill="#f9f9f9" x="0" y="0" width="32" height="32" ></rect><line x1="8" y1="16" x2="24" y2="16" stroke-width="3" stroke="#757575"></line><line x1="16" y1="8" x2="16" y2="24" stroke-width="3" stroke="#757575"></line></g><line x1="4" y1="32" x2="28" y2="32" stroke-width="1" stroke="#cacaca"></line></svg>',OrgChart.toolbarUI.zoomOutIcon='<svg style="box-shadow: 0px 1px 4px rgba(0,0,0,0.3); margin-bottom:7px; border-left: 1px solid #cacaca; border-right: 1px solid #cacaca; border-bottom: 1px solid #cacaca; background-color: #f9f9f9;display: block; cursor: pointer;" width="32px" height="32px" ><g><rect fill="#f9f9f9" x="0" y="0" width="32" height="32" ></rect><line x1="8" y1="16" x2="24" y2="16" stroke-width="3" stroke="#757575"></line></g></svg>',OrgChart.toolbarUI.layoutIcon="<svg "+OrgChart.attr.tlbr+'="layout" style="box-shadow: 0px 1px 4px rgba(0,0,0,0.3); border: 1px solid #cacaca;background-color: #f9f9f9;display: block;cursor: pointer;" width="32px" height="32px"><path stroke-width="3" fill="none" stroke="#757575" d="M8,24 L16,14 L24,24"></path><path stroke-width="3" fill="none" stroke="#757575" d="M8,16 L16,8 L24,16"></path></svg>',OrgChart.toolbarUI.prototype.init=function(t,e){if(e){this.obj=t,this.toolbar=e,this._visible=!1,this.div=document.createElement("div"),this.div.classList.add("boc-toolbar-container"),Object.assign(this.div.style,{position:"absolute",padding:"3px",right:this.obj.config.padding-10+"px",bottom:this.obj.config.padding-10+"px"}),e.expandAll&&(this.div.innerHTML+="<div "+OrgChart.attr.tlbr+'="expand">'+OrgChart.toolbarUI.expandAllIcon+"</div>"),e.fit&&(this.div.innerHTML+="<div "+OrgChart.attr.tlbr+'="fit">'+OrgChart.toolbarUI.fitIcon+"</div>"),e.zoom&&(this.div.innerHTML+="<div "+OrgChart.attr.tlbr+'="plus">'+OrgChart.toolbarUI.zoomInIcon+"</div>",this.div.innerHTML+="<div "+OrgChart.attr.tlbr+'="minus">'+OrgChart.toolbarUI.zoomOutIcon+"</div>"),e.layout&&(this.div.innerHTML+="<div "+OrgChart.attr.tlbr+'="layout">'+OrgChart.toolbarUI.layoutIcon+"</div>",this.layouts=document.createElement("div"),this.layouts.classList.add("boc-toolbar-layout"),this.layouts.innerHTML='<svg data-layout="normal" style="cursor: pointer;" width="110" height="100"><rect fill="#039BE5" x="35" y="0" width="50" height="27"></rect><rect fill="#F57C00" x="7" y="41" width="50" height="27"></rect><rect fill="#F57C00" x="63" y="41" width="50" height="27"></rect><line stroke="#000000" x1="60" x2="60" y1="27" y2="35" stroke-width="1"></line><line stroke="#000000" x1="32" x2="88" y1="35" y2="35" stroke-width="1"></line><line stroke="#000000" x1="32" x2="32" y1="35" y2="41" stroke-width="1"></line><line stroke="#000000" x1="88" x2="88" y1="35" y2="41" stroke-width="1"></line></svg>\n <svg data-layout="treeRightOffset" style="cursor: pointer;" width="110" height="100"><rect fill="#039BE5" x="35" y="0" width="50" height="27"></rect><rect fill="#F57C00" x="40" y="41" width="50" height="27"></rect><rect fill="#F57C00" x="40" y="73" width="50" height="27"></rect><line stroke="#000000" x1="60" x2="60" y1="27" y2="35" stroke-width="1"></line><line stroke="#000000" x1="60" x2="35" y1="35" y2="35" stroke-width="1"></line><line stroke="#000000" x1="35" x2="35" y1="35" y2="86" stroke-width="1"></line><line stroke="#000000" x1="35" x2="40" y1="86" y2="86" stroke-width="1"></line><line stroke="#000000" x1="35" x2="40" y1="54" y2="54" stroke-width="1"></line></svg>\n <svg data-layout="treeLeftOffset" style="cursor: pointer;" width="110" height="100"><rect fill="#039BE5" x="35" y="0" width="50" height="27"></rect><rect fill="#F57C00" x="30" y="41" width="50" height="27"></rect><rect fill="#F57C00" x="30" y="73" width="50" height="27"></rect><line stroke="#000000" x1="60" x2="60" y1="27" y2="35" stroke-width="1"></line><line stroke="#000000" x1="60" x2="85" y1="35" y2="35" stroke-width="1"></line><line stroke="#000000" x1="85" x2="85" y1="35" y2="86" stroke-width="1"></line><line stroke="#000000" x1="80" x2="85" y1="86" y2="86" stroke-width="1"></line><line stroke="#000000" x1="80" x2="85" y1="54" y2="54" stroke-width="1"></line></svg>\n <svg data-layout="mixed" style="cursor: pointer;" width="110" height="100"><rect fill="#039BE5" x="35" y="0" width="50" height="27"></rect><rect fill="#F57C00" x="35" y="41" width="50" height="27"></rect><rect fill="#F57C00" x="35" y="73" width="50" height="27"></rect><line stroke="#000000" x1="60" x2="60" y1="27" y2="41" stroke-width="1"></line><line stroke="#000000" x1="60" x2="60" y1="68" y2="73" stroke-width="1"></line></svg>\n <svg data-layout="tree" style="cursor: pointer;" width="110" height="100"><rect fill="#039BE5" x="35" y="0" width="50" height="27"></rect><rect fill="#F57C00" x="7" y="41" width="50" height="27"></rect><rect fill="#F57C00" x="35" y="73" width="50" height="27"></rect><rect fill="#F57C00" x="63" y="41" width="50" height="27"></rect><line stroke="#000000" x1="60" x2="60" y1="27" y2="73" stroke-width="1"></line><line stroke="#000000" x1="57" x2="63" y1="54" y2="54" stroke-width="1"></line></svg>\n <svg data-layout="grid" style="cursor: pointer;" width="110" height="100"><rect fill="#039BE5" x="35" y="0" width="50" height="27"></rect><rect fill="#F57C00" x="7" y="41" width="50" height="27"></rect><rect fill="#F57C00" x="7" y="73" width="50" height="27"></rect><rect fill="#F57C00" x="63" y="41" width="50" height="27"></rect><rect fill="#F57C00" x="63" y="73" width="50" height="27"></rect><line stroke="#000000" x1="60" x2="60" y1="27" y2="71" stroke-width="1"></line><line stroke="#000000" x1="32" x2="88" y1="39" y2="39" stroke-width="1"></line><line stroke="#000000" x1="32" x2="88" y1="71" y2="71" stroke-width="1"></line><line stroke="#000000" x1="32" x2="32" y1="71" y2="73" stroke-width="1"></line><line stroke="#000000" x1="88" x2="88" y1="71" y2="73" stroke-width="1"></line><line stroke="#000000" x1="32" x2="32" y1="39" y2="41" stroke-width="1"></line><line stroke="#000000" x1="88" x2="88" y1="39" y2="41" stroke-width="1"></line></svg>',this.obj.element.appendChild(this.layouts)),e.fullScreen&&(this.div.innerHTML+="<div "+OrgChart.attr.tlbr+'="fullScreen">'+OrgChart.toolbarUI.openFullScreenIcon+"</div>"),this.obj.element.appendChild(this.div),this.layoutBtn=this.div.querySelector("["+OrgChart.attr.tlbr+'="layout"]');var r=this.div.querySelector("["+OrgChart.attr.tlbr+'="plus"]'),i=this.div.querySelector("["+OrgChart.attr.tlbr+'="minus"]'),n=this.div.querySelector("["+OrgChart.attr.tlbr+'="fit"]'),a=this.div.querySelector("["+OrgChart.attr.tlbr+'="fullScreen"]'),o=this.div.querySelector("["+OrgChart.attr.tlbr+'="expand"]'),s=this;r&&r.addEventListener("click",(function(){s.obj.zoom(!0,null,!0)})),i&&i.addEventListener("click",(function(){s.obj.zoom(!1,null,!0)})),n&&n.addEventListener("click",(function(){s.obj.fit()})),a&&a.addEventListener("click",(function(){s.obj.toggleFullScreen()})),o&&o.addEventListener("click",(function(){s.obj.expand(null,"all")})),this.layoutBtn&&this.layoutBtn.addEventListener("click",(function(){s._visible?s.hideLayout():s.showLayout()})),this.layouts&&this.layouts.addEventListener("click",(function(t){for(var e=t.target;e;){if(e.hasAttribute&&e.hasAttribute(OrgChart.attr.layout)){e=e.getAttribute(OrgChart.attr.layout),s.obj.setLayout(OrgChart.layout[e]);break}e=e.parentNode}}))}},OrgChart.toolbarUI.prototype.showLayout=function(){this._visible=!0,this.layoutBtn.style.transform="rotate(180deg) translateX(0px) translateY(0px)",OrgChart.animate(this.div,{bottom:this.obj.config.padding-10},{bottom:this.obj.config.padding+135},this.obj.config.anim.duration,this.obj.config.anim.func),OrgChart.animate(this.layouts,{bottom:-145},{bottom:0},this.obj.config.anim.duration,this.obj.config.anim.func)},OrgChart.toolbarUI.prototype.hideLayout=function(){this._visible=!1,this.layoutBtn.style.transform="rotate(0deg) translateX(0px) translateY(0px)",OrgChart.animate(this.div,{bottom:this.obj.config.padding+135},{bottom:this.obj.config.padding-10},this.obj.config.anim.duration,this.obj.config.anim.func),OrgChart.animate(this.layouts,{bottom:0},{bottom:-145},this.obj.config.anim.duration,this.obj.config.anim.func)},OrgChart.notifierUI=function(){},OrgChart.notifierUI.prototype.init=function(t){this.obj=t},OrgChart.notifierUI.prototype.show=function(t,e){if(null==t)return!1;1==t&&(t=OrgChart.MAX_NODES_MESS,e="#FFCA28"),2==t&&(t=OrgChart.OFFLINE_MESS,e="#FFCA28");var r=document.createElement("div");r.innerHTML=t,Object.assign(r.style,{position:"absolute","background-color":e,color:"#ffffff",padding:"15px","border-radius":"40px",opacity:0,overflow:"hidden","white-space":"nowrap","text-align":"center"}),this.obj.element.appendChild(r);var i=this.obj.width()/2-r.offsetWidth/2,n=this.obj.height()/2-r.offsetHeight/2;r.style.left=i+"px",r.style.top=n+"px";var a=r.offsetWidth;return r.style.width="20px",OrgChart.animate(r,{opacity:0,width:10},{opacity:1,width:a},this.obj.config.anim.duration,this.obj.config.anim.func),!0},void 0===OrgChart&&(OrgChart={}),OrgChart.icon={},OrgChart.icon.png=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 550.801 550.801"><path fill="'+r+'" d="M146.747,276.708c0-13.998-9.711-22.352-26.887-22.352c-6.99,0-11.726,0.675-14.204,1.355v44.927 c2.932,0.676,6.539,0.896,11.52,0.896C135.449,301.546,146.747,292.28,146.747,276.708z"/><path fill="'+r+'" d="M488.426,197.019H475.2v-63.816c0-0.398-0.063-0.799-0.116-1.202c-0.021-2.534-0.827-5.023-2.562-6.995L366.325,3.694 c-0.032-0.031-0.063-0.042-0.085-0.076c-0.633-0.707-1.371-1.295-2.151-1.804c-0.231-0.155-0.464-0.285-0.706-0.419 c-0.676-0.369-1.393-0.675-2.131-0.896c-0.2-0.056-0.38-0.138-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.873v160.545 c0,17.043,13.824,30.87,30.873,30.87h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87v-160.54C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.513c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M234.344,335.86v45.831h-31.601V229.524h40.184 l31.611,55.759c9.025,16.031,18.064,34.983,24.825,52.154h0.675c-2.257-20.103-2.933-40.643-2.933-63.44v-44.473h31.614v152.167 h-36.117l-32.516-58.703c-9.049-16.253-18.971-35.892-26.438-53.727l-0.665,0.222C233.906,289.58,234.344,311.027,234.344,335.86z M71.556,381.691V231.56c10.613-1.804,25.516-3.159,46.506-3.159c21.215,0,36.353,4.061,46.509,12.192 c9.698,7.673,16.255,20.313,16.255,35.219c0,14.897-4.959,27.549-13.999,36.123c-11.738,11.063-29.123,16.031-49.441,16.031 c-4.522,0-8.593-0.231-11.736-0.675v54.411H71.556V381.691z M453.601,523.353H97.2V419.302h356.4V523.353z M485.652,374.688 c-10.61,3.607-30.713,8.585-50.805,8.585c-27.759,0-47.872-7.003-61.857-20.545c-13.995-13.1-21.684-32.97-21.452-55.318 c0.222-50.569,37.03-79.463,86.917-79.463c19.644,0,34.783,3.829,42.219,7.446l-7.214,27.543c-8.369-3.617-18.752-6.55-35.458-6.55 c-28.656,0-50.341,16.256-50.341,49.22c0,31.382,19.649,49.892,47.872,49.892c7.895,0,14.218-0.901,16.934-2.257v-31.835h-23.493 v-26.869h56.679V374.688z"/></svg>'},OrgChart.icon.pdf=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 550.801 550.801"><path fill="'+r+'" d="M160.381,282.225c0-14.832-10.299-23.684-28.474-23.684c-7.414,0-12.437,0.715-15.071,1.432V307.6 c3.114,0.707,6.942,0.949,12.192,0.949C148.419,308.549,160.381,298.74,160.381,282.225z"/><path fill="'+r+'" d="M272.875,259.019c-8.145,0-13.397,0.717-16.519,1.435v105.523c3.116,0.729,8.142,0.729,12.69,0.729 c33.017,0.231,54.554-17.946,54.554-56.474C323.842,276.719,304.215,259.019,272.875,259.019z"/><path fill="'+r+'" d="M488.426,197.019H475.2v-63.816c0-0.398-0.063-0.799-0.116-1.202c-0.021-2.534-0.827-5.023-2.562-6.995L366.325,3.694 c-0.032-0.031-0.063-0.042-0.085-0.076c-0.633-0.707-1.371-1.295-2.151-1.804c-0.231-0.155-0.464-0.285-0.706-0.419 c-0.676-0.369-1.393-0.675-2.131-0.896c-0.2-0.056-0.38-0.138-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.873v160.545 c0,17.043,13.824,30.87,30.873,30.87h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87v-160.54C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.513c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M362.359,309.023c0,30.876-11.243,52.165-26.82,65.333 c-16.971,14.117-42.82,20.814-74.396,20.814c-18.9,0-32.297-1.197-41.401-2.389V234.365c13.399-2.149,30.878-3.346,49.304-3.346 c30.612,0,50.478,5.508,66.039,17.226C351.828,260.69,362.359,280.547,362.359,309.023z M80.7,393.499V234.365 c11.241-1.904,27.042-3.346,49.296-3.346c22.491,0,38.527,4.308,49.291,12.928c10.292,8.131,17.215,21.534,17.215,37.328 c0,15.799-5.25,29.198-14.829,38.285c-12.442,11.728-30.865,16.996-52.407,16.996c-4.778,0-9.1-0.243-12.435-0.723v57.67H80.7 V393.499z M453.601,523.353H97.2V419.302h356.4V523.353z M484.898,262.127h-61.989v36.851h57.913v29.674h-57.913v64.848h-36.593 V232.216h98.582V262.127z"/></svg>'},OrgChart.icon.svg=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 550.801 550.801"><path fill="'+r+'" d="M488.426,197.019H475.2v-63.816c0-0.398-0.063-0.799-0.116-1.202c-0.021-2.534-0.827-5.023-2.562-6.995L366.325,3.694 c-0.032-0.031-0.063-0.042-0.085-0.076c-0.633-0.707-1.371-1.295-2.151-1.804c-0.231-0.155-0.464-0.285-0.706-0.419 c-0.676-0.369-1.393-0.675-2.131-0.896c-0.2-0.056-0.38-0.138-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.873v160.545 c0,17.043,13.824,30.87,30.873,30.87h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87v-160.54C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.513c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M338.871,225.672L284.545,386.96h-42.591 l-51.69-161.288h39.967l19.617,68.196c5.508,19.143,10.531,37.567,14.36,57.67h0.717c4.061-19.385,9.089-38.527,14.592-56.953 l20.585-68.918h38.77V225.672z M68.458,379.54l7.415-30.153c9.811,5.021,24.888,10.051,40.439,10.051 c16.751,0,25.607-6.935,25.607-17.465c0-10.052-7.662-15.795-27.05-22.734c-26.8-9.328-44.263-24.168-44.263-47.611 c0-27.524,22.971-48.579,61.014-48.579c18.188,0,31.591,3.823,41.159,8.131l-8.126,29.437c-6.465-3.116-17.945-7.657-33.745-7.657 c-15.791,0-23.454,7.183-23.454,15.552c0,10.296,9.089,14.842,29.917,22.731c28.468,10.536,41.871,25.365,41.871,48.094 c0,27.042-20.812,50.013-65.09,50.013C95.731,389.349,77.538,384.571,68.458,379.54z M453.601,523.353H97.2V419.302h356.4V523.353z M488.911,379.54c-11.243,3.823-32.537,9.103-53.831,9.103c-29.437,0-50.73-7.426-65.57-21.779 c-14.839-13.875-22.971-34.942-22.738-58.625c0.253-53.604,39.255-84.235,92.137-84.235c20.81,0,36.852,4.073,44.74,7.896 l-7.657,29.202c-8.859-3.829-19.849-6.95-37.567-6.95c-30.396,0-53.357,17.233-53.357,52.173c0,33.265,20.81,52.882,50.73,52.882 c8.375,0,15.072-0.96,17.94-2.395v-33.745h-24.875v-28.471h60.049V379.54L488.911,379.54z" /></svg>'},OrgChart.icon.csv=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 548.29 548.291" ><path fill="'+r+'" d="M486.2,196.121h-13.164V132.59c0-0.399-0.064-0.795-0.116-1.2c-0.021-2.52-0.824-5-2.551-6.96L364.656,3.677 c-0.031-0.034-0.064-0.044-0.085-0.075c-0.629-0.707-1.364-1.292-2.141-1.796c-0.231-0.157-0.462-0.286-0.704-0.419 c-0.672-0.365-1.386-0.672-2.121-0.893c-0.199-0.052-0.377-0.134-0.576-0.188C358.229,0.118,357.4,0,356.562,0H96.757 C84.893,0,75.256,9.649,75.256,21.502v174.613H62.093c-16.972,0-30.733,13.756-30.733,30.73v159.81 c0,16.966,13.761,30.736,30.733,30.736h13.163V526.79c0,11.854,9.637,21.501,21.501,21.501h354.777 c11.853,0,21.502-9.647,21.502-21.501V417.392H486.2c16.966,0,30.729-13.764,30.729-30.731v-159.81 C516.93,209.872,503.166,196.121,486.2,196.121z M96.757,21.502h249.053v110.006c0,5.94,4.818,10.751,10.751,10.751h94.973v53.861 H96.757V21.502z M258.618,313.18c-26.68-9.291-44.063-24.053-44.063-47.389c0-27.404,22.861-48.368,60.733-48.368 c18.107,0,31.447,3.811,40.968,8.107l-8.09,29.3c-6.43-3.107-17.862-7.632-33.59-7.632c-15.717,0-23.339,7.149-23.339,15.485 c0,10.247,9.047,14.769,29.78,22.632c28.341,10.479,41.681,25.239,41.681,47.874c0,26.909-20.721,49.786-64.792,49.786 c-18.338,0-36.449-4.776-45.497-9.77l7.38-30.016c9.772,5.014,24.775,10.006,40.264,10.006c16.671,0,25.488-6.908,25.488-17.396 C285.536,325.789,277.909,320.078,258.618,313.18z M69.474,302.692c0-54.781,39.074-85.269,87.654-85.269 c18.822,0,33.113,3.811,39.549,7.149l-7.392,28.816c-7.38-3.084-17.632-5.939-30.491-5.939c-28.822,0-51.206,17.375-51.206,53.099 c0,32.158,19.051,52.4,51.456,52.4c10.947,0,23.097-2.378,30.241-5.238l5.483,28.346c-6.672,3.34-21.674,6.919-41.208,6.919 C98.06,382.976,69.474,348.424,69.474,302.692z M451.534,520.962H96.757v-103.57h354.777V520.962z M427.518,380.583h-42.399 l-51.45-160.536h39.787l19.526,67.894c5.479,19.046,10.479,37.386,14.299,57.397h0.709c4.048-19.298,9.045-38.352,14.526-56.693 l20.487-68.598h38.599L427.518,380.583z" /></svg>'},OrgChart.icon.json=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 32 32" ><polygon fill="'+r+'" points="31 11 31 21 29 21 27 15 27 21 25 21 25 11 27 11 29 17 29 11 31 11"/><path fill="'+r+'" d="M21.3335,21h-2.667A1.6684,1.6684,0,0,1,17,19.3335v-6.667A1.6684,1.6684,0,0,1,18.6665,11h2.667A1.6684,1.6684,0,0,1,23,12.6665v6.667A1.6684,1.6684,0,0,1,21.3335,21ZM19,19h2V13H19Z"/><path fill="'+r+'" d="M13.3335,21H9V19h4V17H11a2.002,2.002,0,0,1-2-2V12.6665A1.6684,1.6684,0,0,1,10.6665,11H15v2H11v2h2a2.002,2.002,0,0,1,2,2v2.3335A1.6684,1.6684,0,0,1,13.3335,21Z"/><path fill="'+r+'" d="M5.3335,21H2.6665A1.6684,1.6684,0,0,1,1,19.3335V17H3v2H5V11H7v8.3335A1.6684,1.6684,0,0,1,5.3335,21Z"/><rect fill="'+r+'" id="_Transparent_Rectangle_" data-name="<Transparent Rectangle>" style="fill: none;" width="32" height="32"/></svg>'},OrgChart.icon.excel=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 512 512"><path fill="#ECEFF1" d="M496,432.011H272c-8.832,0-16-7.168-16-16s0-311.168,0-320s7.168-16,16-16h224 c8.832,0,16,7.168,16,16v320C512,424.843,504.832,432.011,496,432.011z" /><path fill="'+r+'" d="M336,176.011h-64c-8.832,0-16-7.168-16-16s7.168-16,16-16h64c8.832,0,16,7.168,16,16 S344.832,176.011,336,176.011z" /><path fill="'+r+'" d="M336,240.011h-64c-8.832,0-16-7.168-16-16s7.168-16,16-16h64c8.832,0,16,7.168,16,16 S344.832,240.011,336,240.011z" /><path fill="'+r+'" d="M336,304.011h-64c-8.832,0-16-7.168-16-16s7.168-16,16-16h64c8.832,0,16,7.168,16,16 S344.832,304.011,336,304.011z" /><path fill="'+r+'" d="M336,368.011h-64c-8.832,0-16-7.168-16-16s7.168-16,16-16h64c8.832,0,16,7.168,16,16 S344.832,368.011,336,368.011z" /><path fill="'+r+'" d="M432,176.011h-32c-8.832,0-16-7.168-16-16s7.168-16,16-16h32c8.832,0,16,7.168,16,16 S440.832,176.011,432,176.011z" /><path fill="'+r+'" d="M432,240.011h-32c-8.832,0-16-7.168-16-16s7.168-16,16-16h32c8.832,0,16,7.168,16,16 S440.832,240.011,432,240.011z" /><path fill="'+r+'" d="M432,304.011h-32c-8.832,0-16-7.168-16-16s7.168-16,16-16h32c8.832,0,16,7.168,16,16 S440.832,304.011,432,304.011z" /><path fill="'+r+'" d="M432,368.011h-32c-8.832,0-16-7.168-16-16s7.168-16,16-16h32c8.832,0,16,7.168,16,16 S440.832,368.011,432,368.011z" /><path fill="'+r+'" d="M282.208,19.691c-3.648-3.04-8.544-4.352-13.152-3.392l-256,48C5.472,65.707,0,72.299,0,80.011v352 c0,7.68,5.472,14.304,13.056,15.712l256,48c0.96,0.192,1.952,0.288,2.944,0.288c3.712,0,7.328-1.28,10.208-3.68 c3.68-3.04,5.792-7.584,5.792-12.32v-448C288,27.243,285.888,22.731,282.208,19.691z" /><path fill="#FAFAFA" d="M220.032,309.483l-50.592-57.824l51.168-65.792c5.44-6.976,4.16-17.024-2.784-22.464 c-6.944-5.44-16.992-4.16-22.464,2.784l-47.392,60.928l-39.936-45.632c-5.856-6.72-15.968-7.328-22.56-1.504 c-6.656,5.824-7.328,15.936-1.504,22.56l44,50.304L83.36,310.187c-5.44,6.976-4.16,17.024,2.784,22.464 c2.944,2.272,6.432,3.36,9.856,3.36c4.768,0,9.472-2.112,12.64-6.176l40.8-52.48l46.528,53.152 c3.168,3.648,7.584,5.504,12.032,5.504c3.744,0,7.488-1.312,10.528-3.968C225.184,326.219,225.856,316.107,220.032,309.483z" /></svg>'},OrgChart.icon.edit=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 528.899 528.899"><path fill="'+r+'" d="M328.883,89.125l107.59,107.589l-272.34,272.34L56.604,361.465L328.883,89.125z M518.113,63.177l-47.981-47.981 c-18.543-18.543-48.653-18.543-67.259,0l-45.961,45.961l107.59,107.59l53.611-53.611 C532.495,100.753,532.495,77.559,518.113,63.177z M0.3,512.69c-1.958,8.812,5.998,16.708,14.811,14.565l119.891-29.069 L27.473,390.597L0.3,512.69z" /></svg>'},OrgChart.icon.details=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 512 512"><path fill="'+r+'" d="M447.933,103.629c-0.034-3.076-1.224-6.09-3.485-8.352L352.683,3.511c-0.004-0.004-0.007-0.005-0.011-0.008 C350.505,1.338,347.511,0,344.206,0H89.278C75.361,0,64.04,11.32,64.04,25.237v461.525c0,13.916,11.32,25.237,25.237,25.237 h333.444c13.916,0,25.237-11.32,25.237-25.237V103.753C447.96,103.709,447.937,103.672,447.933,103.629z M356.194,40.931 l50.834,50.834h-49.572c-0.695,0-1.262-0.567-1.262-1.262V40.931z M423.983,486.763c0,0.695-0.566,1.261-1.261,1.261H89.278 c-0.695,0-1.261-0.566-1.261-1.261V25.237c0-0.695,0.566-1.261,1.261-1.261h242.94v66.527c0,13.916,11.322,25.239,25.239,25.239 h66.527V486.763z"/><path fill="'+r+'" d="M362.088,164.014H149.912c-6.62,0-11.988,5.367-11.988,11.988c0,6.62,5.368,11.988,11.988,11.988h212.175 c6.62,0,11.988-5.368,11.988-11.988C374.076,169.381,368.707,164.014,362.088,164.014z"/><path fill="'+r+'" d="M362.088,236.353H149.912c-6.62,0-11.988,5.368-11.988,11.988c0,6.62,5.368,11.988,11.988,11.988h212.175 c6.62,0,11.988-5.368,11.988-11.988C374.076,241.721,368.707,236.353,362.088,236.353z"/><path fill="'+r+'" d="M362.088,308.691H149.912c-6.62,0-11.988,5.368-11.988,11.988c0,6.621,5.368,11.988,11.988,11.988h212.175 c6.62,0,11.988-5.367,11.988-11.988C374.076,314.06,368.707,308.691,362.088,308.691z"/><path fill="'+r+'" d="M256,381.031H149.912c-6.62,0-11.988,5.368-11.988,11.988c0,6.621,5.368,11.988,11.988,11.988H256 c6.62,0,11.988-5.367,11.988-11.988C267.988,386.398,262.62,381.031,256,381.031z"/></svg>'},OrgChart.icon.remove=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 900.5 900.5"><path fill="'+r+'" d="M176.415,880.5c0,11.046,8.954,20,20,20h507.67c11.046,0,20-8.954,20-20V232.487h-547.67V880.5L176.415,880.5z M562.75,342.766h75v436.029h-75V342.766z M412.75,342.766h75v436.029h-75V342.766z M262.75,342.766h75v436.029h-75V342.766z"/><path fill="'+r+'" d="M618.825,91.911V20c0-11.046-8.954-20-20-20h-297.15c-11.046,0-20,8.954-20,20v71.911v12.5v12.5H141.874 c-11.046,0-20,8.954-20,20v50.576c0,11.045,8.954,20,20,20h34.541h547.67h34.541c11.046,0,20-8.955,20-20v-50.576 c0-11.046-8.954-20-20-20H618.825v-12.5V91.911z M543.825,112.799h-187.15v-8.389v-12.5V75h187.15v16.911v12.5V112.799z"/></svg>'},OrgChart.icon.add=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 922 922"><path fill="'+r+'" d="M922,453V81c0-11.046-8.954-20-20-20H410c-11.045,0-20,8.954-20,20v149h318c24.812,0,45,20.187,45,45v198h149 C913.046,473.001,922,464.046,922,453z" /><path fill="'+r+'" d="M557,667.001h151c11.046,0,20-8.954,20-20v-174v-198c0-11.046-8.954-20-20-20H390H216c-11.045,0-20,8.954-20,20v149h194 h122c24.812,0,45,20.187,45,45v4V667.001z" /><path fill="'+r+'" d="M0,469v372c0,11.046,8.955,20,20,20h492c11.046,0,20-8.954,20-20V692v-12.501V667V473v-4c0-11.046-8.954-20-20-20H390H196 h-12.5H171H20C8.955,449,0,457.955,0,469z" /></svg>'},OrgChart.icon.search=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 485.213 485.213"><path fill="'+r+'" d="M471.882,407.567L360.567,296.243c-16.586,25.795-38.536,47.734-64.331,64.321l111.324,111.324 c17.772,17.768,46.587,17.768,64.321,0C489.654,454.149,489.654,425.334,471.882,407.567z" /><path fill="'+r+'" d="M363.909,181.955C363.909,81.473,282.44,0,181.956,0C81.474,0,0.001,81.473,0.001,181.955s81.473,181.951,181.955,181.951 C282.44,363.906,363.909,282.437,363.909,181.955z M181.956,318.416c-75.252,0-136.465-61.208-136.465-136.46 c0-75.252,61.213-136.465,136.465-136.465c75.25,0,136.468,61.213,136.468,136.465 C318.424,257.208,257.206,318.416,181.956,318.416z" /><path fill="'+r+'" d="M75.817,181.955h30.322c0-41.803,34.014-75.814,75.816-75.814V75.816C123.438,75.816,75.817,123.437,75.817,181.955z" /></svg>'},OrgChart.icon.xml=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 550.801 550.801"><path fill="'+r+'" d="M488.426,197.019H475.2v-63.816c0-0.401-0.063-0.799-0.116-1.205c-0.021-2.534-0.827-5.023-2.562-6.992L366.325,3.691 c-0.032-0.031-0.063-0.042-0.085-0.073c-0.633-0.707-1.371-1.298-2.151-1.804c-0.231-0.158-0.464-0.287-0.706-0.422 c-0.676-0.366-1.393-0.675-2.131-0.896c-0.2-0.053-0.38-0.135-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.87v160.542 c0,17.044,13.824,30.876,30.873,30.876h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87V227.89C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.51c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M369.531,374.53h-32.058l-2.156-55.519 c-0.644-17.434-1.298-38.518-1.298-59.611h-0.633c-4.514,18.516-10.547,39.166-16.137,56.162l-17.645,56.601h-25.618 l-15.494-56.157c-4.725-16.996-9.671-37.658-13.123-56.6h-0.43c-0.854,19.585-1.508,41.961-2.586,60.038l-2.576,55.086h-30.343 l9.26-145.035h43.677l14.207,48.421c4.517,16.774,9.041,34.847,12.258,51.843h0.654c4.081-16.77,9.038-35.923,13.774-52.064 l15.493-48.199h42.82L369.531,374.53z M69.992,374.53l41.955-73.385l-40.444-71.65h37.655l12.688,26.465 c4.316,8.828,7.533,15.928,10.99,24.092h0.422c3.438-9.242,6.23-15.694,9.893-24.092l12.274-26.465h37.434l-40.89,70.796 l43.044,74.239h-37.866l-13.134-26.257c-5.376-10.108-8.817-17.639-12.909-26.04h-0.433c-3.009,8.401-6.674,15.932-11.19,26.04 l-12.042,26.257H69.992z M453.601,523.353H97.2V419.302h356.4V523.353z M485.325,374.53h-90.608V229.495h32.933v117.497h57.682 v27.538H485.325z"/></svg>'},OrgChart.icon.visio=function(t,e,r,i,n){return null==i&&(i=0),null==n&&(n=0),`<svg width="${t}" height="${e}" viewBox="0 0 24 24" x="${n}" x="${n}">\n <path fill="${r}" d="M24 7.609v9.556q0 .424-.302.726-.303.303-.726.303h-5.19q-.072 1.149-.556 2.135-.484.986-1.264 1.717-.78.732-1.803 1.15-1.022.417-2.159.417-1.016 0-1.96-.35-.943-.352-1.705-.969-.762-.617-1.295-1.47-.532-.852-.713-1.856H1.028q-.423 0-.726-.303Q0 18.363 0 17.94V7.609q0-.424.302-.726.303-.302.726-.302h5.238q-.072-.182-.072-.387 0-.424.302-.726L11.274.69q.303-.303.726-.303t.726.303l4.778 4.778q.302.302.302.726 0 .205-.072.387h5.238q.423 0 .726.302.302.302.302.726zM12 2.153l-4.04 4.04.387.388h3.012q.423 0 .726.302.302.302.302.726v2.238l3.653-3.653zM7.161 16.84l3.085-8.13H8.238q-.508 1.489-1.028 2.952-.52 1.464-1.004 2.964-.496-1.488-.992-2.958-.496-1.47-1.004-2.957H2.153l3.037 8.129zM12 22.065q.883 0 1.657-.333t1.355-.913q.58-.581.913-1.355.333-.774.333-1.658 0-.81-.302-1.548-.303-.738-.823-1.318-.52-.581-1.228-.944-.707-.363-1.518-.423v4.367q0 .423-.302.725-.303.303-.726.303H7.923q.206.677.593 1.246.387.568.92.98.532.41 1.185.64.653.23 1.379.23zm10.452-5.42V8.13h-6.158q-.133.133-.441.454-.309.32-.714.725-.405.406-.847.853-.441.448-.828.823-.387.375-.684.641-.296.266-.393.302v.097q.968.036 1.845.411t1.578.998q.702.623 1.186 1.446t.677 1.766Z"/>\n </svg>`},OrgChart.icon.link=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 512.092 512.092" ><path fill="'+r+'" d="M312.453,199.601c-6.066-6.102-12.792-11.511-20.053-16.128c-19.232-12.315-41.59-18.859-64.427-18.859 c-31.697-0.059-62.106,12.535-84.48,34.987L34.949,308.23c-22.336,22.379-34.89,52.7-34.91,84.318 c-0.042,65.98,53.41,119.501,119.39,119.543c31.648,0.11,62.029-12.424,84.395-34.816l89.6-89.6 c1.628-1.614,2.537-3.816,2.524-6.108c-0.027-4.713-3.87-8.511-8.583-8.484h-3.413c-18.72,0.066-37.273-3.529-54.613-10.581 c-3.195-1.315-6.867-0.573-9.301,1.877l-64.427,64.512c-20.006,20.006-52.442,20.006-72.448,0 c-20.006-20.006-20.006-52.442,0-72.448l108.971-108.885c19.99-19.965,52.373-19.965,72.363,0 c13.472,12.679,34.486,12.679,47.957,0c5.796-5.801,9.31-13.495,9.899-21.675C322.976,216.108,319.371,206.535,312.453,199.601z" /><path fill="'+r+'" d="M477.061,34.993c-46.657-46.657-122.303-46.657-168.96,0l-89.515,89.429c-2.458,2.47-3.167,6.185-1.792,9.387 c1.359,3.211,4.535,5.272,8.021,5.205h3.157c18.698-0.034,37.221,3.589,54.528,10.667c3.195,1.315,6.867,0.573,9.301-1.877 l64.256-64.171c20.006-20.006,52.442-20.006,72.448,0c20.006,20.006,20.006,52.442,0,72.448l-80.043,79.957l-0.683,0.768 l-27.989,27.819c-19.99,19.965-52.373,19.965-72.363,0c-13.472-12.679-34.486-12.679-47.957,0 c-5.833,5.845-9.35,13.606-9.899,21.845c-0.624,9.775,2.981,19.348,9.899,26.283c9.877,9.919,21.433,18.008,34.133,23.893 c1.792,0.853,3.584,1.536,5.376,2.304c1.792,0.768,3.669,1.365,5.461,2.048c1.792,0.683,3.669,1.28,5.461,1.792l5.035,1.365 c3.413,0.853,6.827,1.536,10.325,2.133c4.214,0.626,8.458,1.025,12.715,1.195h5.973h0.512l5.12-0.597 c1.877-0.085,3.84-0.512,6.059-0.512h2.901l5.888-0.853l2.731-0.512l4.949-1.024h0.939c20.961-5.265,40.101-16.118,55.381-31.403 l108.629-108.629C523.718,157.296,523.718,81.65,477.061,34.993z" /></svg>'},OrgChart.icon.happy=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 512 512"><path fill="'+r+'" d="M256,0C114.615,0,0,114.615,0,256s114.615,256,256,256s256-114.615,256-256S397.385,0,256,0z M256,480 C132.288,480,32,379.712,32,256S132.288,32,256,32s224,100.288,224,224S379.712,480,256,480z"/><path fill="'+r+'" d="M176,176c17.673,0,32,14.327,32,32h32c0-35.346-28.654-64-64-64c-35.346,0-64,28.654-64,64h32 C144,190.327,158.327,176,176,176z"/><path fill="'+r+'" d="M336,144c-35.346,0-64,28.654-64,64h32c0-17.673,14.327-32,32-32c17.673,0,32,14.327,32,32h32 C400,172.654,371.346,144,336,144z"/><path fill="'+r+'" d="M256,368c-53.019,0-96-42.981-96-96h-32c0,70.692,57.308,128,128,128s128-57.308,128-128h-32 C352,325.019,309.019,368,256,368z"/></svg>'},OrgChart.icon.sad=function(t,e,r){return'<svg width="'+t+'" height="'+e+'" viewBox="0 0 512 512"><path fill="'+r+'" d="M256,0C114.615,0,0,114.615,0,256s114.615,256,256,256s256-114.615,256-256S397.385,0,256,0z M256,480 C132.288,480,32,379.712,32,256S132.288,32,256,32s224,100.288,224,224S379.712,480,256,480z"/><path fill="'+r+'" d="M336,192c-17.673,0-32-14.327-32-32h-32c0,35.346,28.654,64,64,64c35.346,0,64-28.654,64-64h-32 C368,177.673,353.673,192,336,192z"/><path fill="'+r+'" d="M176,224c35.346,0,64-28.654,64-64h-32c0,17.673-14.327,32-32,32s-32-14.327-32-32h-32C112,195.346,140.654,224,176,224z "/><path fill="'+r+'" d="M256,256c-70.692,0-128,57.308-128,128h32c0-53.019,42.981-96,96-96s96,42.981,96,96h32C384,313.308,326.692,256,256,256 z"/></svg>'},OrgChart.icon.share=function(t,e,r,i,n){return null==i&&(i=0),null==n&&(n=0),`<svg width="${t}" height="${e}" x="${i}" y="${n}" viewBox="0 0 512 512">\n <path fill="${r}" d="M406,332c-29.641,0-55.761,14.581-72.167,36.755L191.99,296.124c2.355-8.027,4.01-16.346,4.01-25.124\n c0-11.906-2.441-23.225-6.658-33.636l148.445-89.328C354.307,167.424,378.589,180,406,180c49.629,0,90-40.371,90-90\n c0-49.629-40.371-90-90-90c-49.629,0-90,40.371-90,90c0,11.437,2.355,22.286,6.262,32.358l-148.887,89.59\n C156.869,193.136,132.937,181,106,181c-49.629,0-90,40.371-90,90c0,49.629,40.371,90,90,90c30.13,0,56.691-15.009,73.035-37.806\n l141.376,72.395C317.807,403.995,316,412.75,316,422c0,49.629,40.371,90,90,90c49.629,0,90-40.371,90-90\n C496,372.371,455.629,332,406,332z"/>\n </svg>`},OrgChart.icon.user=function(t,e,r,i,n){return OrgChart.isNEU(i)&&(i=0),OrgChart.isNEU(n)&&(n=0),`<svg width="${t}" height="${e}" x="${i}" y="${n}" viewBox="0 0 24 24">\n <path fill="${r}" d="M12 11.796C14.7189 11.796 16.9231 9.60308 16.9231 6.89801C16.9231 4.19294 14.7189 2.00005 12 2.00005C9.28106 2.00005 7.07692 4.19294 7.07692 6.89801C7.07692 9.60308 9.28106 11.796 12 11.796Z" fill="#030D45"/>\n <path fill="${r}" d="M14.5641 13.8369H9.4359C6.46154 13.8369 4 16.2859 4 19.245C4 19.9593 4.30769 20.5716 4.92308 20.8777C5.84615 21.3879 7.89744 22.0001 12 22.0001C16.1026 22.0001 18.1538 21.3879 19.0769 20.8777C19.5897 20.5716 20 19.9593 20 19.245C20 16.1838 17.5385 13.8369 14.5641 13.8369Z" fill="#030D45"/>\n </svg>`},OrgChart.icon.close=function(t,e,r,i,n){return null==i&&(i=0),null==n&&(n=0),`<svg width="${t}" height="${e}" x="${i}" y="${n}" viewBox="0 0 512 512">\n <path fill="${r}" d="m256 0c-141.49 0-256 114.5-256 256 0 141.49 114.5 256 256 256 141.49 0 256-114.5 256-256 0-141.49-114.5-256-256-256zm-12.284 317.397-58.121 58.132c-6.565 6.553-15.283 10.166-24.557 10.166-19.196 0-34.734-15.526-34.734-34.734 0-9.274 3.612-17.992 10.166-24.557l58.132-58.121c6.785-6.784 6.785-17.783 0-24.568l-58.132-58.121c-6.553-6.565-10.166-15.283-10.166-24.557 0-19.196 15.526-34.734 34.734-34.734 9.274 0 17.992 3.613 24.557 10.166l58.121 58.132c6.785 6.773 17.784 6.773 24.568 0l58.121-58.132c6.565-6.553 15.283-10.166 24.557-10.166 19.196 0 34.734 15.526 34.734 34.734 0 9.274-3.612 17.992-10.166 24.557l-58.132 58.121c-6.785 6.784-6.785 17.783 0 24.568l58.132 58.121c6.553 6.565 10.166 15.283 10.166 24.557 0 19.196-15.526 34.734-34.734 34.734-9.274 0-17.992-3.613-24.557-10.166l-58.121-58.132c-6.784-6.784-17.784-6.773-24.568 0z"/>\n </svg>`},OrgChart.icon.undo=function(t,e,r,i,n){return null==i&&(i=0),null==n&&(n=0),`<svg width="${t}" height="${e}" x="${i}" y="${n}" viewBox="0 0 24 24">\n <path fill-rule="evenodd" clip-rule="evenodd" fill="${r}" d="M3.46447 3.46447C2 4.92893 2 7.28595 2 12C2 16.714 2 19.0711 3.46447 20.5355C4.92893 22 7.28595 22 12 22C16.714 22 19.0711 22 20.5355 20.5355C22 19.0711 22 16.7141 22 12C22 7.28598 22 4.92893 20.5355 3.46447C19.0711 2 16.714 2 12 2C7.28595 2 4.92893 2 3.46447 3.46447ZM9.25871 7.97395C9.56308 7.693 9.58205 7.21851 9.3011 6.91414C9.02015 6.60978 8.54565 6.5908 8.24129 6.87175L5.99129 8.94867C5.83748 9.09065 5.75 9.29045 5.75 9.49977C5.75 9.7091 5.83748 9.9089 5.99129 10.0509L8.24129 12.1278C8.54565 12.4088 9.02015 12.3898 9.3011 12.0854C9.58205 11.781 9.56308 11.3065 9.25871 11.0256L8.41824 10.2498H14.0385C14.7376 10.2498 15.2069 10.2506 15.5652 10.2862C15.9116 10.3205 16.0724 10.3813 16.1787 10.4501C16.3272 10.5461 16.4537 10.6726 16.5497 10.8211C16.6184 10.9274 16.6793 11.0882 16.7136 11.4345C16.7491 11.7929 16.75 12.2622 16.75 12.9613C16.75 13.6604 16.7491 14.1298 16.7136 14.4881C16.6793 14.8344 16.6185 14.9952 16.5497 15.1015C16.4537 15.2501 16.3272 15.3765 16.1787 15.4726C16.0724 15.5413 15.9116 15.6021 15.5652 15.6365C15.2069 15.672 14.7376 15.6729 14.0385 15.6729H9.5C9.08579 15.6729 8.75 16.0086 8.75 16.4229C8.75 16.8371 9.08579 17.1729 9.5 17.1729H14.0758C14.7279 17.1729 15.2721 17.1729 15.7133 17.1291C16.1748 17.0834 16.6038 16.9839 16.9931 16.7322C17.3199 16.5209 17.5981 16.2427 17.8094 15.916C18.0611 15.5266 18.1605 15.0976 18.2063 14.6361C18.25 14.195 18.25 13.6508 18.25 12.9987V12.924C18.25 12.2718 18.25 11.7276 18.2063 11.2865C18.1605 10.825 18.0611 10.396 17.8093 10.0067C17.5981 9.6799 17.3199 9.40169 16.9931 9.19042C16.6038 8.9387 16.1748 8.83927 15.7133 8.7935C15.2721 8.74975 14.7279 8.74976 14.0758 8.74977L8.41824 8.74977L9.25871 7.97395Z" />\n <rect style="opacity: 0" x="2" y="2" width="20" height="20"></rect>\n </svg>`},OrgChart.icon.redo=function(t,e,r,i,n){return null==i&&(i=0),null==n&&(n=0),`<svg width="${t}" height="${e}" x="${i}" y="${n}" viewBox="0 0 24 24" >\n <path fill="#f9f9f9" fill-rule="evenodd" clip-rule="evenodd" fill="${r}" d="M3.46447 3.46447C2 4.92893 2 7.28595 2 12C2 16.714 2 19.0711 3.46447 20.5355C4.92893 22 7.28595 22 12 22C16.714 22 19.0711 22 20.5355 20.5355C22 19.0711 22 16.7141 22 12C22 7.28598 22 4.92893 20.5355 3.46447C19.0711 2 16.714 2 12 2C7.28595 2 4.92893 2 3.46447 3.46447ZM15.7587 6.87273C15.4543 6.59177 14.9799 6.61075 14.6989 6.91512C14.4179 7.21948 14.4369 7.69398 14.7413 7.97493L15.5818 8.75075H9.96155C7.63558 8.75075 5.75 10.6363 5.75 12.9623C5.75 15.2883 7.63557 17.1738 9.96154 17.1738H14.5C14.9142 17.1738 15.25 16.838 15.25 16.4238C15.25 16.0096 14.9142 15.6738 14.5 15.6738H9.96154C8.464 15.6738 7.25 14.4598 7.25 12.9623C7.25 11.4647 8.464 10.2508 9.96155 10.2508H15.5818L14.7413 11.0266C14.4369 11.3075 14.4179 11.782 14.6989 12.0864C14.9799 12.3908 15.4543 12.4097 15.7587 12.1288L18.0087 10.0519C18.1625 9.90987 18.25 9.71007 18.25 9.50075C18.25 9.29143 18.1625 9.09163 18.0087 8.94965L15.7587 6.87273Z"/>\n <rect style="opacity: 0" x="2" y="2" width="20" height="20"></rect> \n </svg>`},OrgChart.icon.send=function(t,e,r,i,n){return null==i&&(i=0),null==n&&(n=0),`<svg width="${t}" height="${e}" x="${i}" y="${n}" viewBox="0 0 24 24" >\n <path fill="none" stroke="${r}" stroke-width="2" d="M10.3009 13.6949L20.102 3.89742M10.5795 14.1355L12.8019 18.5804C13.339 19.6545 13.6075 20.1916 13.9458 20.3356C14.2394 20.4606 14.575 20.4379 14.8492 20.2747C15.1651 20.0866 15.3591 19.5183 15.7472 18.3818L19.9463 6.08434C20.2845 5.09409 20.4535 4.59896 20.3378 4.27142C20.2371 3.98648 20.013 3.76234 19.7281 3.66167C19.4005 3.54595 18.9054 3.71502 17.9151 4.05315L5.61763 8.2523C4.48114 8.64037 3.91289 8.83441 3.72478 9.15032C3.56153 9.42447 3.53891 9.76007 3.66389 10.0536C3.80791 10.3919 4.34498 10.6605 5.41912 11.1975L9.86397 13.42C10.041 13.5085 10.1295 13.5527 10.2061 13.6118C10.2742 13.6643 10.3352 13.7253 10.3876 13.7933C10.4468 13.87 10.491 13.9585 10.5795 14.1355Z" />\n </svg>`},OrgChart.icon.x=function(t,e,r,i,n){return null==i&&(i=0),null==n&&(n=0),`<svg width="${t}" height="${e}" x="${i}" y="${n}" viewBox="0 0 24 24">\n <line x1="0" y1="0" x2="24" y2="24" stroke-width="3" stroke="${r}"></line>\n <line x1="24" y1="0" x2="0" y2="24" stroke-width="3" stroke="${r}"></line>\n </svg>`},OrgChart.prototype.exportPDFProfile=function(t,e){t=this._defaultExportProfileOptions(t,"pdf"),this._exportProfile(t,e)},OrgChart.prototype.exportPDFPreview=function(t){OrgChart.pdfPrevUI.show(this,t)},OrgChart.prototype.exportPNGProfile=function(t,e){t=this._defaultExportProfileOptions(t,"png"),this._exportProfile(t,e)},OrgChart.prototype.shareProfile=function(t){var e;"object"==typeof t?t=(e=t).focusId:e=this.editUI.content(t,!0,!0,"100%",!0);var r=new URL(window.location.href);r.searchParams.append("nodeId",t);var i={title:e.title,text:e.shareText,url:r.href};try{navigator.share(i)}catch(t){console.error("error: "+t)}},OrgChart.prototype.exportPDF=function(t,e){t=this._defaultExportOptions(t,"pdf"),this._export(t,e)},OrgChart._exportPDFFromChartsFetchWithCallback=function(t,e){t.type&&"profile"==t.type.toLowerCase()?t.chartInstance.exportPDFProfile(t,(function(t,r){e(r)})):t.chartInstance.exportPDF(t,(function(t,r){e(r)}))},OrgChart._exportPDFFromChartsFetchSequentially=function(t,e,r,i,n,a){if(t>=e.length){var o=[];for(var s of e)-1==o.indexOf(s.chartInstance)&&o.push(s.chartInstance),delete s.chartInstance;for(var l of(r=JSON.stringify(r),o))OrgChart.loading.show(l);return null==i&&(i="OrgChart.pdf"),null==n&&(n=!1),void OrgChart._ajax(l.config.exportUrl+"/v4","POST",r,"arraybuffer",(function(t){for(var e of o)OrgChart.loading.hide(e);a?a(t):OrgChart._downloadFile("application/pdf",t,i,n,"pdf")}))}OrgChart._exportPDFFromChartsFetchWithCallback(e[t],(function(o){r.push(o),OrgChart._exportPDFFromChartsFetchSequentially(t+1,e,r,i,n,a)}))},OrgChart.exportPDFFromCharts=function(t,e,r,i){OrgChart._exportPDFFromChartsFetchSequentially(0,t,[],e,r,i)},OrgChart.prototype.exportPNG=function(t,e){t=this._defaultExportOptions(t,"png"),this._export(t,e)},OrgChart.prototype.exportSVG=function(t,e){t=this._defaultExportOptions(t,"svg"),this._export(t,e)},OrgChart.prototype.exportVisio=function(t,e){t=this._defaultExportOptions(t,"visio"),this._export(t,e)},OrgChart.prototype._defaultExportOptions=function(t,e){return null==t&&(t={}),"svg"==e?(t.ext="svg",t.mime="image/svg+xml"):"visio"==e?(t.ext="vsdx",t.mime="application/vnd.visio"):"pdf"==e?(t.mime="application/pdf",t.ext="pdf"):"png"==e&&(t.mime="image/png",t.ext="png"),null==t.margin&&(t.margin=[50,40,50,40]),null==t.padding&&(t.padding="visio"==e?25:0),null==t.landscape&&(t.landscape=!1),null==t.filename&&(t.filename="OrgChart."+t.ext),null==t.scale&&(t.scale="fit"),null==t.format&&(t.format="fit"),null==t.header&&(t.header=""),"pdf"==e&&null==t.footer?t.footer="Page {current-page} of {total-pages}":null==t.footer&&(t.footer=""),null==t.openInNewTab&&(t.openInNewTab=!1),null==t.mode&&(t.mode="boc-"+this.config.mode),t},OrgChart.prototype._export=function(t,e){var r=this,i={id:t.nodeId,expandChildren:t.expandChildren,parentLevels:t.parentLevels,childLevels:t.childLevels,min:t.min};t.margin&&t.margin[0]<2&&(t.margin[0]=2),t.margin&&t.margin[1]<2&&(t.margin[1]=2),t.margin&&t.margin[2]<2&&(t.margin[2]=2),t.margin&&t.margin[3]<2&&(t.margin[3]=2),this._draw(!1,OrgChart.action.exporting,i,(function(i,n){var a=document.createElement("div");if(a.innerHTML=i,t.padding>0){var o=a.querySelector("svg"),s=OrgChart._getViewBox(o);s[0]-=t.padding,s[1]-=t.padding,s[2]+=2*t.padding,s[3]+=2*t.padding,o.setAttribute("viewBox",s.join()),o.setAttribute("width",s[2]),o.setAttribute("height",s[3])}if("svg"==t.ext||"vsdx"==t.ext){(o=a.querySelector("svg")).classList.add("boc-"+r.config.mode);var l={content:a.innerHTML,options:t,styles:""};if(!e){var h=OrgChart.events.publish("exportstart",[r,l]);if(!1===h)return!1}var c=r.element.querySelector("[data-boc-styles]");if(c&&(l.styles+=c.outerHTML),l.styles&&(a.childNodes[0].insertAdjacentHTML("afterbegin",l.styles),l.content=a.innerHTML),"svg"==t.ext)if(e)e(l);else{if(!1===(h=OrgChart.events.publish("exportend",[r,l])))return!1;OrgChart._downloadFile(t.mime,l.content,l.options.filename,l.options.openInNewTab,l.options.ext)}else if("vsdx"==t.ext){OrgChart.loading.show(r);var d=JSON.stringify({svg:l.content,fileName:l.options.filename});OrgChart._ajax(r.config.serverUrl+"/Export/Visio","POST",d,"arraybuffer",(function(i){if(OrgChart.loading.hide(r),e)e(l,i);else{if(!1===OrgChart.events.publish("exportend",[r,i]))return!1;OrgChart._downloadFile(t.mime,i,l.options.filename,l.options.openInNewTab,l.options.ext)}}))}}else r._pages(t,a.querySelector("svg"),n,(function(i){var n={content:a.innerHTML,options:t,pages:i,styles:""},o=OrgChart.events.publish("exportstart",[r,n]),s=r.element.querySelector("[data-boc-styles]");if(s&&(n.styles+=s.outerHTML),!1===o)return!1;e||OrgChart.loading.show(r),e?e(r,n,a.querySelector("svg")):(n=JSON.stringify(n),OrgChart._ajax(r.config.exportUrl+"/v4","POST",n,"arraybuffer",(function(e){var i=OrgChart.events.publish("exportend",[r,e]);if(OrgChart.loading.hide(r),!1===i)return!1;OrgChart._downloadFile(t.mime,e,t.filename,t.openInNewTab,t.ext)})))}))}))},OrgChart.prototype.exportCSV=function(t){var e=OrgChart._defaultExportProfileOptionsForCSV_SVG_JSON(t,"csv"),r=this.getNode(e.nodeId),i=null;r?(i=[],OrgChart._exportIterateForJSON_XML_CSV(this,r,e,i)):!1===e.min||!1===e.expandChildren?OrgChart._exportIterateForJSON_XML_CSV(this,this.roots,e,i):i=JSON.parse(JSON.stringify(this.config.nodes));var n={ext:"csv",filename:t,options:e,nodes:i};if(!1===OrgChart.events.publish("exportstart",[this,n]))return!1;var a=OrgChart._json2csv(n.nodes),o={ext:n.ext,filename:n.filename,options:e,nodes:n.nodes,content:a};if(!1===OrgChart.events.publish("exportend",[this,o]))return!1;OrgChart._downloadFile("text/csv;charset=utf-8;","\ufeff"+o.content,o.options.filename,o.options.openInNewTab,o.ext)},OrgChart.prototype.exportXML=function(t){var e=OrgChart._defaultExportProfileOptionsForCSV_SVG_JSON(t,"xml"),r=this.getNode(e.nodeId),i=null;r?(i=[],OrgChart._exportIterateForJSON_XML_CSV(this,r,e,i)):!1===e.min||!1===e.expandChildren?OrgChart._exportIterateForJSON_XML_CSV(this,this.roots,e,i):i=JSON.parse(JSON.stringify(this.config.nodes));var n={ext:"xml",filename:t,options:e,nodes:i};if(!1===OrgChart.events.publish("exportstart",[this,n]))return!1;var a=OrgChart._json2xml(n.nodes),o={ext:n.ext,filename:n.filename,options:e,nodes:n.nodes,content:a};if(!1===OrgChart.events.publish("exportend",[this,o]))return!1;OrgChart._downloadFile("application/xml",o.content,o.options.filename,o.options.openInNewTab,o.ext)},OrgChart.prototype.exportJSON=function(t){var e=OrgChart._defaultExportProfileOptionsForCSV_SVG_JSON(t,"json"),r=this.getNode(e.nodeId),i=null;r?(i=[],OrgChart._exportIterateForJSON_XML_CSV(this,r,e,i)):!1===e.min||!1===e.expandChildren?OrgChart._exportIterateForJSON_XML_CSV(this,this.roots,e,i):i=JSON.parse(JSON.stringify(this.config.nodes));var n={ext:"json",filename:e.filename,options:e,nodes:i};if(!1===OrgChart.events.publish("exportstart",[this,n]))return!1;var a={ext:n.ext,filename:n.filename,options:e,nodes:n.nodes,content:JSON.stringify(n.nodes)};if(!1===OrgChart.events.publish("exportend",[this,a]))return!1;OrgChart._downloadFile("application/json",a.content,a.options.filename,a.options.openInNewTab,a.ext)},OrgChart._exportIterateForJSON_XML_CSV=function(t,e,r,i){if(Array.isArray(e))for(var n=0;n<e.length;n++)OrgChart._exportIterateForJSON_XML_CSV(t,e[n],r,i);else{var a=t.get(e.id);if(i.push(a),r.min)for(n=0;n<e.stChildrenIds.length;n++)OrgChart._exportIterateForJSON_XML_CSV(t,t.getNode(e.stChildrenIds[n]),r,i);else for(n=0;n<e.stChildren.length;n++)OrgChart._exportIterateForJSON_XML_CSV(t,e.stChildren[n],r,i);if(r.expandChildren)for(n=0;n<e.childrenIds.length;n++)OrgChart._exportIterateForJSON_XML_CSV(t,t.getNode(e.childrenIds[n]),r,i);else for(n=0;n<e.children.length;n++)OrgChart._exportIterateForJSON_XML_CSV(t,e.children[n],r,i)}},OrgChart.prototype._pages=function(t,e,r,i){"A5"==t.format&&"fit"!=t.scale||"A4"==t.format&&"fit"!=t.scale||"A3"==t.format&&"fit"!=t.scale||"A2"==t.format&&"fit"!=t.scale||"A1"==t.format&&"fit"!=t.scale||"Letter"==t.format&&"fit"!=t.scale||"Legal"==t.format&&"fit"!=t.scale?i(this._pagesA100(t,e,t.scale)):"A5"==t.format&&"fit"==t.scale||"A4"==t.format&&"fit"==t.scale||"A3"==t.format&&"fit"==t.scale||"A2"==t.format&&"fit"==t.scale||"A1"==t.format&&"fit"==t.scale||"Letter"==t.format&&"fit"==t.scale||"Legal"==t.format&&"fit"==t.scale?i(this._pagesAfit(t,e,r)):"fit"==t.format&&i(this._pagesFit(t,e))},OrgChart.prototype._pagesFit=function(t,e){var r=e.getAttribute("width"),i=e.getAttribute("height"),n=OrgChart._getViewBox(e),a={w:parseFloat(r),h:parseFloat(i)};return[{vb:n,size:{w:a.w+(t.margin[1]+t.margin[3]),h:a.h+(t.margin[0]+t.margin[2])},innerSize:a}]},OrgChart.prototype._pagesAfit=function(t,e,r){var i=e.getAttribute("width"),n=0,a=0;switch(t.format){case"A5":n=OrgChart.A5w,a=OrgChart.A5h;break;case"A4":n=OrgChart.A4w,a=OrgChart.A4h;break;case"A3":n=OrgChart.A3w,a=OrgChart.A3h;break;case"A2":n=OrgChart.A2w,a=OrgChart.A2h;break;case"A1":n=OrgChart.A1w,a=OrgChart.A1h;break;case"Letter":n=OrgChart.Letterw,a=OrgChart.Letterh;break;case"Legal":n=OrgChart.Legalw,a=OrgChart.Legalh}var o=t.landscape?a-(t.margin[1]+t.margin[3]):n-(t.margin[1]+t.margin[3]),s=(t.landscape?(t.margin[0],t.margin[2]):(t.margin[0],t.margin[2]),o/i);return this._pagesA100(t,e,100*s,r)},OrgChart.prototype._pagesA100=function(t,e,r,i){var n=OrgChart._getViewBox(e),a=0,o=0;switch(t.format){case"A5":a=OrgChart.A5w,o=OrgChart.A5h;break;case"A4":a=OrgChart.A4w,o=OrgChart.A4h;break;case"A3":a=OrgChart.A3w,o=OrgChart.A3h;break;case"A2":a=OrgChart.A2w,o=OrgChart.A2h;break;case"A1":a=OrgChart.A1w,o=OrgChart.A1h;break;case"Letter":a=OrgChart.Letterw,o=OrgChart.Letterh;break;case"Legal":a=OrgChart.Legalw,o=OrgChart.Legalh}var s=n[0],l=n[1],h=n[2],c=n[3],d={w:t.landscape?o-(t.margin[1]+t.margin[3]):a-(t.margin[1]+t.margin[3]),h:t.landscape?a-(t.margin[0]+t.margin[2]):o-(t.margin[0]+t.margin[2])},g={w:t.landscape?o:a,h:t.landscape?a:o};e.setAttribute("width",d.w),e.setAttribute("height",d.h);var p=d.w*(100/r),u=d.h*(100/r),f=s,m=l,C=[],b=!0;if(!OrgChart.EXPORT_PAGES_CUT_NODES&&"fit"==t.scale){e.setAttribute("preserveAspectRatio","xMinYMin");for(var v=Object.keys(i.bordersByRootIdAndLevel),O=i.bordersByRootIdAndLevel[v[0]],x=Object.keys(O).length,y=1;y<v.length;y++)x<Object.keys(i.bordersByRootIdAndLevel[v[y]]).length&&(O=i.bordersByRootIdAndLevel[v[y]],x=Object.keys(O).length);for(var _=0,k=0;;){for(k=_;!(x<=_);){if((O[_].maxY-O[_].minY)/(100/r)>d.h){b=!1;break}var w=(O[_].minY-O[k].minY)/(100/r);if(_==x-1&&(w=(O[_].maxY-O[k].minY)/(100/r)),w>d.h)break;_++}if(!b)break;var S=(_==x?O[_-1].maxY:O[_-1].minY)-O[k].minY;if(0==S){b=!1;break}if(I=(I=[f,O[k].minY,p,S]).join(),C.push({vb:I,innerSize:{w:d.x,h:S/(100/r)-1},size:g}),_==x)break;_--}C.length&&(C[C.length-1].innerSize.h+=1)}if(!b||OrgChart.EXPORT_PAGES_CUT_NODES||"fit"!=t.scale)for(e.setAttribute("preserveAspectRatio","xMinYMin slice"),C=[];f<h+s;){for(;m<c+l;){var I;I=(I=[f,m,p,u]).join(),C.push({vb:I,innerSize:d,size:g}),m+=u}f+=p,m=l}return C},OrgChart.prototype._defaultExportProfileOptions=function(t,e){return OrgChart.isNEU(t)||null==t.id||null!=t.nodeId||(t.nodeId=t.id),(OrgChart.isNEU(t)||OrgChart.isNEU(t.nodeId))&&console.error("options.nodeId is not defilned"),"svg"==e?(t.ext="svg",t.mime="image/svg+xml"):"pdf"==e?(t.mime="application/pdf",t.ext="pdf"):"png"==e&&(t.mime="image/png",t.ext="png"),null==t.margin&&(t.margin=[50,40,50,40]),null==t.padding&&(t.padding=0),null==t.landscape&&(t.landscape=!1),null==t.filename&&(t.filename="Profile."+t.ext),null==t.scale&&(t.scale="fit"),null==t.format&&(t.format="A4"),null==t.header&&(t.header=""),null==t.footer&&(t.footer=""),null==t.openInNewTab&&(t.openInNewTab=!1),null==t.mode&&(t.mode="boc-"+this.config.mode),t},OrgChart._defaultExportProfileOptionsForCSV_SVG_JSON=function(t,e){return OrgChart.isNEU(t)&&(t={}),"string"==typeof t&&(t={filename:t}),OrgChart.isNEU(t.filename)&&(t.filename=`OrgChart.${e}`),OrgChart.isNEU(t.expandChildren)&&(t.expandChildren=!0),OrgChart.isNEU(t.min)&&(t.min=!0),OrgChart.isNEU(t.openInNewTab)&&(t.openInNewTab=!1),t},OrgChart.prototype._exportProfile=function(t,e){var r=this,i=0,n=0;switch(t.format){case"A5":i=OrgChart.A5w,n=OrgChart.A5h;break;case"A4":i=OrgChart.A4w,n=OrgChart.A4h;break;case"A3":i=OrgChart.A3w,n=OrgChart.A3h;break;case"A2":i=OrgChart.A2w,n=OrgChart.A2h;break;case"A1":i=OrgChart.A1w,n=OrgChart.A1h;break;case"Letter":i=OrgChart.Letterw,n=OrgChart.Letterh;break;case"Legal":i=OrgChart.Legalw,n=OrgChart.Legalh}var a={w:t.landscape?n-(t.margin[1]+t.margin[3]):i-(t.margin[1]+t.margin[3]),h:t.landscape?i-(t.margin[0]+t.margin[2]):n-(t.margin[0]+t.margin[2])},o={w:t.landscape?n:i,h:t.landscape?i:n},s=this.editUI.content(t.nodeId,!0,!0,"100%",!0).element;OrgChart.input.init(s);var l={content:s.outerHTML,options:t,pages:[{vb:"",innerSize:a,size:o}],styles:""};if(!1===OrgChart.events.publish("exportstart",[r,l]))return!1;e||OrgChart.loading.show(r);var h=this.element.querySelector("[data-boc-styles]");h&&(l.styles+=h.outerHTML);var c=this.getSvg().querySelector("defs");if(c)for(var d=0;d<c.children.length;d++)"style"==c.children[d].nodeName.toLowerCase()&&(l.styles+=c.children[d].outerHTML);e?e(r,l,s):(l=JSON.stringify(l),OrgChart._ajax(this.config.exportUrl+"/v4","POST",l,"arraybuffer",(function(e){var i=OrgChart.events.publish("exportend",[r,e]);if(OrgChart.loading.hide(r),!1===i)return!1;OrgChart._downloadFile(t.mime,e,t.filename,t.openInNewTab,t.ext)})))},void 0===OrgChart&&(OrgChart={}),OrgChart.events=function(){var t={};return{on:function(e,r,i){Array.isArray(t[e])||(t[e]=[]),t[e].push({listener:r,event_id:i})},removeAll:function(e){Array.isArray(t[e])||(t[e]=[]),t[e]=[]},remove:function(e,r,i){var n=!1;if(t[e]&&Array.isArray(t[e])&&t[e].length>0)for(var a=t[e].length-1;a>=0;a--)(!OrgChart.isNEU(i)&&!OrgChart.isNEU(r)&&t[e][a].event_id==i&&t[e][a].listener==r||!OrgChart.isNEU(i)&&OrgChart.isNEU(r)&&t[e][a].event_id==i||OrgChart.isNEU(i)&&!OrgChart.isNEU(r)&&t[e][a].listener==r||OrgChart.isNEU(i)&&OrgChart.isNEU(r))&&(t[e].splice(a,1),n=!0);return n},has:function(e,r){if(t[e]&&Array.isArray(t[e])&&t[e].length>0){if(OrgChart.isNEU(r))return!0;for(var i=0;i<t[e].length;i++)if(t[e][i].event_id==r)return!0}return!1},removeForEventId:function(e){for(var r in t)if(Array.isArray(t[r]))for(var i=t[r].length-1;i>=0;i--)t[r][i].event_id==e&&t[r].splice(i,1)},publish:function(e,r){if(t[e]){for(var i=[],n=0;n<t[e].length;n++){var a=t[e][n];null!=a.event_id&&a.event_id!=r[0]._event_id||i.push(a.listener)}if(i.length>0){var o=!0;for(n=0;n<i.length&&(1==r.length?o=i[n](r[0])&&o:2==r.length?o=i[n](r[0],r[1])&&o:3==r.length?o=i[n](r[0],r[1],r[2])&&o:4==r.length?o=i[n](r[0],r[1],r[2],r[3])&&o:5==r.length&&(o=i[n](r[0],r[1],r[2],r[3],r[4])&&o),!1!==o);n++);return o}}}}}(),OrgChart.prototype.importCSV=function(){var t=this,e=document.createElement("INPUT");e.setAttribute("type","file"),e.setAttribute("accept",".csv"),e.style.display="none",e.onchange=function(e){var r=e.target,i=new FileReader;i.onload=function(){var e=i.result,r=OrgChart._csvToArray(e),n=[],a=r[0];OrgChart._importSetColumnNames(a,(function(e){for(var i=1;i<r.length;i++){for(var a={},o=0;o<r[i].length;o++){var s=e[o],l=r[i][o];a[s]=OrgChart._convertStringToArray(s,l)}""!=a.id.trim()&&n.push(a)}var h={nodes:n,columnNames:r[0]};0!=OrgChart.events.publish("import",[t,h])&&(t._putInUndoStack(),t.clearRedo(),t.config.nodes=h.nodes,t._ai.setContext(),OrgChart.events.publish("updated",[t]),t.filterUI.update(),t.draw())}))},i.readAsText(r.files[0])},e.click()},OrgChart._importSetColumnNames=function(t,e){if(-1==t.indexOf("id")||-1==t.indexOf("pid")){var r=document.createElement("DIV"),i=document.createElement("P");i.style.padding="5px",i.style.color="rgb(122, 122, 122)",i.innerHTML=OrgChart.IMPORT_MESSAGE,r.appendChild(i);var n=document.createElement("div"),a=document.createElement("div"),o=document.createElement("div"),s=document.createElement("span");n.setAttribute("id","boc-sampleDialog"),n.style.height="260px",n.style.width="400px",n.style.background="white",n.style.border="0.5px solid grey",n.style.position="fixed",n.style.overflow="hidden",n.style.zIndex="99",a.setAttribute("id","title"),a.style.backgroundColor="#e5e5e5",a.style.fontWeight="bold",a.style.color="rgb(122, 122, 122)",a.style.height="20px",a.style.padding="3px 0 0 7px",s.setAttribute("id","close"),s.style.cursor="pointer",s.style.position="absolute",s.style.color="rgb(122, 122, 122)",s.style.fontWeight="bold",s.style.top="2px",s.style.zIndex=100,o.setAttribute("id","content"),o.style.padding="2px",a.innerHTML="Import Organizational Chart Data",s.innerHTML="×";var l=document.createElement("HR");l.style.height="0.1px",l.style.backgroundColor="#aeaeae",l.style.border="none",l.style.margin="0",n.appendChild(a),n.appendChild(l),o.appendChild(r),n.appendChild(o),n.appendChild(s),document.body.appendChild(n),OrgChart._importCenter(n),s.style.left=n.offsetWidth-20+"px";var h=document.createElement("div");h.setAttribute("id","overlay"),h.style.width="100%",h.style.height="100%",h.style.left=0,h.style.top=0,h.style.position="fixed",h.style.background="grey",h.style.opacity="0.5",h.style.zIndex=98,document.body.appendChild(h),n._overlay=h;var c=document.createElement("LABEL"),d=document.createTextNode("Name:");c.setAttribute("for","boc-id-select"),c.appendChild(d),c.style.fontSize="16px",c.style.color="rgb(122, 122, 122)",c.style.padding="5px",c.style.margin="5px",c.style.width="30%",c.style.textAlign="right",c.style.display="inline-block",r.appendChild(c);var g=document.createElement("SELECT");g.id="boc-id-select",g.style.fontSize="16px",g.style.color="rgb(122, 122, 122)",g.style.padding="5px",g.style.margin="5px",g.style.width="60%",g.style.border="1px solid #aeaeae",r.appendChild(g);var p=document.createElement("BR");r.appendChild(p);for(var u=0;u<t.length;u++){(v=document.createElement("option")).setAttribute("value",t[u]);var f=document.createTextNode(t[u]);v.appendChild(f),g.appendChild(v)}var m=document.createElement("LABEL"),C=document.createTextNode("Reports to:");m.setAttribute("for","pid-select"),m.appendChild(C),m.style.fontSize="16px",m.style.color="rgb(122, 122, 122)",m.style.padding="5px",m.style.margin="5px",m.style.width="30%",m.style.textAlign="right",m.style.display="inline-block",r.appendChild(m);var b=document.createElement("SELECT");b.id="pid-select",b.style.fontSize="16px",b.style.color="rgb(122, 122, 122)",b.style.padding="5px",b.style.margin="5px",b.style.width="60%",b.style.border="1px solid #aeaeae",r.appendChild(b);for(u=0;u<t.length;u++){var v;(v=document.createElement("option")).setAttribute("value",t[u]);f=document.createTextNode(t[u]);v.appendChild(f),b.appendChild(v)}var O=document.createElement("BUTTON");O.innerHTML="Import",O.style.fontSize="16px",O.style.color="rgb(122, 122, 122)",O.style.padding="5px 20px",O.style.margin="20px auto",O.style.display="block",O.onclick=function(){n.style.display="none",n._overlay&&n._overlay.parentNode.removeChild(n._overlay);var r=g.options[g.selectedIndex].value,i=t.indexOf(r);t[i]="id";var a=b.options[b.selectedIndex].value,o=t.indexOf(a);t[o]="pid",e(t)};var x=document.createElement("DIV");return x.appendChild(O),r.appendChild(x),s.onclick=function(t){n._overlay&&n._overlay.parentNode.removeChild(n._overlay),n.parentNode.removeChild(n),t.stopPropagation()},a.onmousedown=function(t){t=t||window.event,n._dragging=!0,n._originalLeft=n.offsetLeft,n._originalTop=n.offsetTop,n._mouseLeft=t.clientX,n._mouseTop=t.clientY},document.onmousemove=function(t){t=t||window.event,n._dragging&&(n.style.left=n._originalLeft+t.clientX-n._mouseLeft+"px",n.style.top=n._originalTop+t.clientY-n._mouseTop+"px")},document.onmouseup=function(t){t=t||window.event,n._dragging&&(n.style.left=n._originalLeft+t.clientX-n._mouseLeft+"px",n.style.top=n._originalTop+t.clientY-n._mouseTop+"px",n._dragging=!1)},n}e(t)},OrgChart._importCenter=function(t){t&&(t.style.left=(window.innerWidth-t.offsetWidth)/2+"px",t.style.top=(window.innerHeight-t.offsetHeight)/2+"px")},OrgChart.prototype.importXML=function(){var t=this,e=document.createElement("INPUT");e.setAttribute("type","file"),e.setAttribute("accept",".xml"),e.style.display="none",e.onchange=function(e){var r=e.target,i=new FileReader;i.onload=function(){var e=i.result,r=OrgChart._xml2json(e);0!=OrgChart.events.publish("import",[t,r])&&(t._putInUndoStack(),t.clearRedo(),t.config.nodes=r,t._ai.setContext(),OrgChart.events.publish("updated",[t]),t.filterUI.update(),t.draw())},i.readAsText(r.files[0])},e.click()},OrgChart.prototype.importJSON=function(){var t=this,e=document.createElement("INPUT");e.setAttribute("type","file"),e.setAttribute("accept",".json"),e.style.display="none",e.onchange=function(e){var r=e.target,i=new FileReader;i.onload=function(){var e=i.result,r=JSON.parse(e);0!=OrgChart.events.publish("import",[t,r])&&(t._putInUndoStack(),t.clearRedo(),t.config.nodes=r,t._ai.setContext(),OrgChart.events.publish("updated",[t]),t.filterUI.update(),t.draw())},i.readAsText(r.files[0])},e.click()},OrgChart.prototype.expand=function(t,e,r){this._resetMovableNodes();var i={id:t,ids:e};this._draw(!1,OrgChart.action.expand,i,r)},OrgChart.prototype.collapse=function(t,e,r){this._resetMovableNodes();var i={id:t,ids:e};this._draw(!1,OrgChart.action.collapse,i,r)},OrgChart.prototype.expandCollapse=function(t,e,r,i){this._resetMovableNodes(),Array.isArray(e)||(e=[]),Array.isArray(r)||(r=[]);var n={id:t,expandIds:e,collapseIds:r,ids:e.concat(r)};this._draw(!1,OrgChart.action.collapse,n,i)},OrgChart.prototype.changeRoots=function(t,e,r){this.config.roots=e;var i={id:t,changeRoots:e};this._draw(!1,OrgChart.action.update,i,r)},OrgChart.prototype._resetMovableNodes=function(){if(OrgChart.RESET_MOVABLE_ONEXPANDCOLLAPSE&&null!=this.config.movable){for(var t=!1,e=0;e<this.config.nodes.length;e++){var r=this.config.nodes[e];null!=r.movex&&(r.movex=0,t=!0),null!=r.movey&&(r.movey=0,t=!0)}t&&(this._ai.setContext(),OrgChart.events.publish("updated",[this]))}},OrgChart.prototype.maximize=function(t,e,r,i){var n=this,a={id:t,options:{}};OrgChart.isNEU(a.id)&&(a.id=this.roots[0].id,a.all=!0),a.options.horizontal=!1,a.options.vertical=!1,e&&(a.options.horizontal=e),r&&(a.options.vertical=r),this._draw(!1,OrgChart.action.maximize,a,(function(){n.ripple(t),i&&i()}))},OrgChart.prototype.minimize=function(t,e){var r=this,i={id:t};OrgChart.isNEU(i.id)&&(i.id=this.roots[0].id,i.all=!0),this._draw(!1,OrgChart.action.minimize,i,(function(){r.ripple(t),e&&e()}))},OrgChart.prototype._expCollHandler=function(t){this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var e=this.getNode(t),r=this.getCollapsedIds(e);if(r.length){if(!1===OrgChart.events.publish("expcollclick",[this,!1,t,r]))return!1;this.expand(t,r,!1)}else{if(!1===OrgChart.events.publish("expcollclick",[this,!0,t,e.childrenIds]))return!1;this.collapse(t,e.childrenIds,!1)}},OrgChart.prototype._upHandler=function(t){this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var e=this._upHandlerCreateArgs(t);if(!1===OrgChart.events.publish("up-click",[this,e]))return!1;this.changeRoots(e.id,e.roots,!1)},OrgChart.prototype._upHandlerCreateArgs=function(t){var e,r=this.getNode(t),i=Object.assign([],this.config.roots),n=this.getNode(r.pid);if(n&&(e=n),e){if(Array.isArray(i)){var a=i.indexOf(r.id);-1!=a&&i.splice(a,1)}else i=[];i.push(e.id)}return{id:r.id,roots:i}},String.prototype.replaceAll||(String.prototype.replaceAll=function(t,e){return this.replace(new RegExp(t,"g"),e)}),String.prototype.endsWith||(String.prototype.endsWith=function(t){return-1!==this.indexOf(t,this.length-t.length)}),String.prototype.splice||(String.prototype.splice=function(t,e,r){return this.slice(0,t)+r+this.slice(t+Math.abs(e))}),String.prototype.insert||(String.prototype.insert=function(t,e){return t>0?this.substring(0,t)+e+this.substr(t):e+this}),Array.prototype.unique||Object.defineProperty(Array.prototype,"unique",{value:function(){for(var t=this.concat(),e=0;e<t.length;++e)for(var r=e+1;r<t.length;++r)t[e]===t[r]&&t.splice(r--,1);return t},writable:!0,configurable:!0,enumerable:!1}),Array.prototype.has||Object.defineProperty(Array.prototype,"has",{value:function(t){for(var e=0;e<this.length;e++)if(this[e]==t)return!0;return!1},writable:!0,configurable:!0,enumerable:!1}),Array.prototype.compare||Object.defineProperty(Array.prototype,"compare",{value:function(t){if(this.length!=t.length)return!1;for(var e=0;e<this.length;e++)if(!t.has(this[e]))return!1;return!0},writable:!0,configurable:!0,enumerable:!1}),Object.assign||Object.defineProperty(Object,"assign",{value:function(t,e){"use strict";if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])}return r},writable:!0,configurable:!0}),OrgChart.prototype._globalMouseDownHandler=function(t,e){var r={move:"mousemove",up:"mouseup",leave:"mouseleave"};if(-1!=e.type.indexOf("touch")&&(1==e.touches.length?this._touch={x:e.touches[0].clientX,y:e.touches[0].clientY}:this._touch=null,r={move:"touchmove",up:"touchend",touchstart:"touchstart"}),t==e.target)return e.stopPropagation(),e.preventDefault(),void this._mouseDownHandler(t,e,r);if(this.config.nodeMouseClick==OrgChart.action.pan){for(var i=e.target;i!=t&&!i.hasAttribute(OrgChart.attr.control_expcoll_id)&&!i.hasAttribute(OrgChart.attr.control_up_id);)i=i.parentNode;if(!i.hasAttribute(OrgChart.attr.control_expcoll_id)&&!i.hasAttribute(OrgChart.attr.control_up_id))return e.stopPropagation(),e.preventDefault(),void this._mouseDownHandler(t,e,r)}for(var n=e.target;n!=t;){if(n.hasAttribute(OrgChart.attr.node_id))return void this._nodeMouseDownHandler(n,e,r);if(n.hasAttribute(OrgChart.attr.control_node_circle_menu_name))return e.stopPropagation(),e.preventDefault(),void this._nodeCircleNodeMenuItemMouseDownHandler(n,e,r);n=n.parentNode}},OrgChart.prototype._globalClickHandler=function(t,e){if(-1!=e.type.indexOf("touch")&&this._touch&&1==e.changedTouches.length){if(e.changedTouches.length){var r={x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY},i=OrgChart.t(this.config.template,!1,this.getScale()).size,n=this.getScale(),a=Math.abs(r.x-this._touch.x)/n,o=Math.abs(r.y-this._touch.y)/n;if(this._touch=null,a>i[0]/10)return;if(o>i[1]/10)return}}else if(-1!=e.type.indexOf("touch")&&null==this._touch)return;for(var s=e.target;s!=t;){if(s.hasAttribute(OrgChart.attr.control_expcoll_id)){var l=s.getAttribute(OrgChart.attr.control_expcoll_id),h=this.getNode(l);return void this._expCollHandler(h.id)}if(s.hasAttribute(OrgChart.attr.node_id)){l=s.getAttribute(OrgChart.attr.node_id),h=this.getNode(l);return void this._nodeClickHandler(h.id,e)}if(s.hasAttribute(OrgChart.attr.control_node_menu_id)){e.stopPropagation(),e.preventDefault();l=s.getAttribute(OrgChart.attr.control_node_menu_id),h=this.getNode(l);return void this._nodeMenuClickHandler(h.id,s,e)}if(s.hasAttribute(OrgChart.attr.control_node_circle_menu_id)){e.stopPropagation(),e.preventDefault();l=s.getAttribute(OrgChart.attr.control_node_circle_menu_id);return void this._nodeCircleMenuClickHandler(l)}if(s.hasAttribute(OrgChart.attr.control_node_circle_menu_name))return e.stopPropagation(),e.preventDefault(),void this._nodeCircleMenuItemClickHandler(s,e);if(s.hasAttribute(OrgChart.attr.control_add))return void this._lonelyButtonHandler();if(s.hasAttribute(OrgChart.attr.control_up_id)){l=s.getAttribute(OrgChart.attr.control_up_id);return e.stopPropagation(),e.preventDefault(),void this._upHandler(l)}if(s.hasAttribute(OrgChart.attr.c_link_from))return void OrgChart.events.publish("clink-click",[this,{from:s.getAttribute(OrgChart.attr.c_link_from),to:s.getAttribute(OrgChart.attr.c_link_to),event:e}]);if(s.hasAttribute(OrgChart.attr.s_link_from))return void OrgChart.events.publish("slink-click",[this,{from:s.getAttribute(OrgChart.attr.s_link_from),to:s.getAttribute(OrgChart.attr.s_link_to),event:e}]);s=s.parentNode}},OrgChart.prototype._globalContextHandler=function(t,e){for(var r=e.target;r!=t;){if(r.hasAttribute(OrgChart.attr.node_id)){var i=r.getAttribute(OrgChart.attr.node_id),n=this.getNode(i);return void this._nodeContextHandler(n.id,e)}r=r.parentNode}},OrgChart.prototype._nodeContextHandler=function(t,e){e.preventDefault(),OrgChart.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var r=this.get(t),i=null;if(null!=r&&Array.isArray(r.tags))for(var n=0;n<r.tags.length;n++){var a=r.tags[n];this.config.tags[a]&&this.config.tags[a].nodeContextMenu&&(i=this.config.tags[a].nodeContextMenu)}var o=this.element.getBoundingClientRect(),s=e.clientX-o.left,l=e.clientY-o.top;this.nodeContextMenuUI.show(s,l,t,null,i)},OrgChart.prototype._globalDbClickHandler=function(t,e){for(var r=e.target;r!=t;){if(r.hasAttribute(OrgChart.attr.node_id)){var i=r.getAttribute(OrgChart.attr.node_id),n=this.getNode(i);return void this._nodeDbClickHandler(n.id,e)}r=r.parentNode}},OrgChart.prototype._mouseScrollHandler=function(t,e){this.__mouseScrollHandler(this.getSvg(),e)},OrgChart.prototype.__mouseScrollHandler=function(t,e){if(e.ctrlKey){if(this.config.mouseScrool==OrgChart.action.zoom)return}else{if(this.config.mouseScrool==OrgChart.action.ctrlZoom)return;if(this.config.mouseScrool!=OrgChart.action.zoom)return}if(e.preventDefault(),!navigator.hardwareConcurrency||navigator.hardwareConcurrency<9){let i=e.deltaY/1e3;i=Math.abs(i)<.1?.1*e.deltaY/Math.abs(e.deltaY):i;var r=OrgChart._centerPointInPercent(t,e.pageX,e.pageY);this.zoom(1-i,r)}else{var i=this,n=!1,a=this.config.zoom.speed,o=this.config.zoom.smooth,s=0,l=this.getScale();r=OrgChart._centerPointInPercent(t,e.pageX,e.pageY);var h=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,20)};e.preventDefault();var c=e.delta||e.wheelDelta;void 0===c&&(c=-e.detail),c=Math.max(-1,Math.min(1,c)),s+=-c*a,n||function t(){n=!0;var e=(s-l)/o;e>0?e++:e--,l+=e,i.zoom(1-e/12/50,r),parseInt(l)==parseInt(s)?n=!1:h(t)}()}},OrgChart.prototype._nodeCircleNodeMenuItemMouseDownHandler=function(t,e,r){var i=t.parentNode.getAttribute(OrgChart.attr.control_node_circle_menu_wrraper_id),n=t.getAttribute(OrgChart.attr.control_node_circle_menu_name),a=this.nodeCircleMenuUI._menu[n];if(a.draggable){var o=this,s=OrgChart._getClientXY(e),l=this.getNode(i);t._dragEventFired=!1;var h=o.getScale(),c=null,d=null;this._gragStartedId=i,document.body.style.mozUserSelect=document.body.style.webkitUserSelect=document.body.style.userSelect="none";var g=this.getSvg(),p={x:s.x,y:s.y},u=t.cloneNode(!0);g.insertBefore(u,g.firstChild);var f=OrgChart._getTransform(u),m=f[4],C=f[5],b=function(t){for(;t&&!t.hasAttribute(OrgChart.attr.control_node_circle_menu_wrraper_id);)t=t.parentNode;if(t){var e=OrgChart._getTransform(t);return{x:e[4],y:e[5]}}console.error("cannot find parent"+OrgChart.attr.control_node_circle_menu_wrraper_id)}(t);u.setAttribute("transform","matrix(1,0,0,1,"+(m+b.x)+","+(C+b.y)+")"),u.style.opacity=.7;var v=function(t,e){if(null!=t){e.classList.remove("boc-drag-over");for(var r=OrgChart.getStParentNodes(o.getNode(c)),i=0;i<r.length;i++){var n=o.getNodeElement(r[i].id);n&&(n.style.opacity=1)}}},O=function(e){if(p){var r=OrgChart._getClientXY(e),i=e.target;OrgChart.isMobile()&&(i=document.elementFromPoint(r.x,r.y)),r.x+=b.x*h,r.y+=b.y*h;var s=OrgChart._getOffsetXY(o.element,e),l={left:o.width()-(s.x+o.config.padding)<0,right:s.x-o.config.padding<0,up:o.height()-(s.y+o.config.padding)<0,down:s.y-o.config.padding<0};if(l.left||l.right||l.up||l.down){g.classList&&(g.classList.remove("boc-cursor-grab"),g.classList.add("boc-cursor-move"),g.classList.remove("boc-cursor-nodrop"),g.classList.remove("boc-cursor-copy"));var O=f[4],y=f[5],_=p.x,k=p.y,w=r.x,S=r.y;o.moveStart(l,(function(t){f[4]=O+t.x,f[5]=y+t.y,p.x=_-t.xWithoutScale,p.y=k-t.yWithoutScale,r.x=w-t.xWithoutScale,r.y=S-t.yWithoutScale,u.setAttribute("transform","matrix("+f.toString()+")")}))}else{for(o.moveEnd(),g.classList&&(g.classList.add("boc-cursor-grab"),g.classList.remove("boc-cursor-move"),g.classList.remove("boc-cursor-nodrop"),g.classList.remove("boc-cursor-copy")),v(c,d),c=null,d=null;null!=i&&i!=g;){if(i.hasAttribute&&i.hasAttribute(OrgChart.attr.node_id)){var I=i.getAttribute(OrgChart.attr.node_id);c=I,d=i;break}i=i.parentNode}if(null!=c){d.classList.add("boc-drag-over");for(var A=o.getNode(c),L=OrgChart.getStParentNodes(A),E=0;E<L.length;E++){var N=o.getNodeElement(L[E].id);N&&(N.style.opacity=.1)}g.classList.remove("boc-cursor-grab"),g.classList.remove("boc-cursor-move"),g.classList.add("boc-cursor-copy"),g.classList.remove("boc-cursor-nodrop")}var M=(r.x-p.x)/h,T=(r.y-p.y)/h;if(f[4]=m+M,f[5]=C+T,!t._dragEventFired&&(Math.abs(r.x-p.x)>OrgChart.FIRE_DRAG_NOT_CLICK_IF_MOVE||Math.abs(r.y-p.y)>OrgChart.FIRE_DRAG_NOT_CLICK_IF_MOVE))!1===OrgChart.events.publish("drag",[o.nodeCircleMenuUI,{from:I,menuItem:a,menuItemName:n}])&&x(),t._dragEventFired=!0;u.setAttribute("transform","matrix("+f.toString()+")")}}},x=function(e){if(o.moveEnd(),g.classList&&(g.classList.remove("boc-cursor-grab"),g.classList.remove("boc-cursor-move"),g.classList.remove("boc-cursor-nodrop"),g.classList.remove("boc-cursor-copy")),g.removeEventListener(r.move,O),g.removeEventListener(r.up,x),r.leave&&g.removeEventListener(r.leave,x),l.id==c||null==c)return g.removeChild(u),o._gragStartedId=null,void(t._dragEventFired&&OrgChart.events.publish("drop",[o.nodeCircleMenuUI,{from:l.id,menuItemName:n,menuItem:a,event:e}]));var i=o.getNode(c);OrgChart.events.publish("drop",[o.nodeCircleMenuUI,{from:l.id,to:i.id,menuItem:a,menuItemName:n,event:e}]),v(c,d),g.removeChild(u),o._gragStartedId=null};g.addEventListener(r.move,O),g.addEventListener(r.up,x),r.leave&&g.addEventListener(r.leave,x)}},OrgChart.prototype._nodeMouseDownHandler=function(t,e,r){var i=t.getAttribute(OrgChart.attr.node_id),n=this.getNode(i);this.config.movable&&!OrgChart.getRootOf(n).stParent?this._movableHandler(t,e,r):this.config.enableDragDrop&&this._dragDropHandler(t,e,r)},OrgChart.prototype._movableHandler=function(t,e,r){var i=this,n=t.getAttribute(OrgChart.attr.node_id),a=[],o=function(t,e){if(Array.isArray(t))for(var r=0;r<t.length;r++)o(t[r],e);else{e.push(t.id);for(r=0;r<t.stChildren.length;r++)o(t.stChildren[r],e);for(r=0;r<t.children.length;r++)o(t.children[r],e)}},s=function(t,e){if(Array.isArray(t))for(var r=0;r<t.length;r++)o(t[r],e);else{e.push(t.id);for(r=0;r<t.stChildrenIds.length;r++)s(i.getNode(t.stChildrenIds[r]),e);for(r=0;r<t.childrenIds.length;r++)s(i.getNode(t.childrenIds[r]),e)}},l=this.getNode(n);o(l,a);for(var h=this.getSvg(),c=OrgChart._getClientXY(e),d=[],g=[],p=[],u=[],f=[],m=[],C=[],b=[],v=0;v<a.length;v++){var O=this.getNode(a[v]);d.push(O),p.push({x:O.x,y:O.y});var x=this.getNodeElement(a[v]);if(x){f.push(x);var y=OrgChart._getTransform(x);u.push({x:y[4],y:y[5]}),g.push(y);var _=this.element.querySelector(`[data-ctrl-ec-id="${a[v]}"]`);if(_){m.push(_);var k=OrgChart._getTransform(_);C.push(k),b.push({x:k[4],y:k[5]})}else m.push(null),C.push(null),b.push(null);if(this.config.movable==OrgChart.movable.node)break}}t._dragEventFired=!1;var w=null,S=null;this._gragStartedId=a[0],document.body.style.mozUserSelect=document.body.style.webkitUserSelect=document.body.style.userSelect="none";var I={x:c.x,y:c.y},A=i.getScale(),L=function(t,e){if(null!=t){e.classList.remove("boc-drag-over");for(var r=i.getNode(w),n=OrgChart.getStParentNodes(r),a=0;a<n.length;a++){var o=i.getNodeElement(n[a].id);o&&(o.style.opacity=1)}}},E=function(e){if(I){var r=OrgChart._getClientXY(e),o=e.target;OrgChart.isMobile()&&(o=document.elementFromPoint(r.x,r.y));var s=OrgChart._getOffsetXY(i.element,e),c={left:i.width()-(s.x+i.config.padding)<0,right:s.x-i.config.padding<0,up:i.height()-(s.y+i.config.padding)<0,down:s.y-i.config.padding<0};if(c.left||c.right||c.up||c.down){h.classList&&(h.classList.remove("boc-cursor-grab"),h.classList.add("boc-cursor-move"),h.classList.remove("boc-cursor-nodrop"),h.classList.remove("boc-cursor-copy"));for(var v=[],O=[],x=[],y=[],_=0;_<g.length;_++)v.push(g[_][4]),O.push(g[_][5]),C[_]?(x.push(C[_][4]),y.push(C[_][5])):(x.push(null),y.push(null));var k=I.x,E=I.y,M=r.x,T=r.y;i.moveStart(c,(function(t){for(var e=0;e<g.length;e++){var n=v[e],a=O[e],o=x[e],s=y[e];g[e][4]=n+t.x,g[e][5]=a+t.y,I.x=k-t.xWithoutScale,I.y=E-t.yWithoutScale,r.x=M-t.xWithoutScale,r.y=T-t.yWithoutScale,d[e].x=n+t.x,d[e].y=a+t.y,d[e].movex=t.x,d[e].movey=t.y,C[e]&&(C[e][4]=o+t.x,C[e][5]=s+t.y);for(var l=OrgChart.ui.link(d[e],i,A,i.response.bordersByRootIdAndLevel,i.nodes,OrgChart.action.update,!0),h=0;h<l.length;h++){var c=l[h];(p=i.element.querySelector(`[data-l-id="[${c.id}][${c.childId}]"]`))&&(p.innerHTML=c.html)}if(d[e].parent)for(l=OrgChart.ui.link(d[e].parent,i,A,i.response.bordersByRootIdAndLevel,i.nodes,OrgChart.action.update,!0),h=0;h<l.length;h++){var p;c=l[h];(p=i.element.querySelector(`[data-l-id="[${c.id}][${c.childId}]"]`))&&(p.innerHTML=c.html)}f[e].setAttribute("transform","matrix("+g[e].toString()+")"),m[e]&&m[e].setAttribute("transform","matrix("+C[e].toString()+")")}}))}else{if(i.moveEnd(),h.classList&&(h.classList.add("boc-cursor-grab"),h.classList.remove("boc-cursor-move"),h.classList.remove("boc-cursor-nodrop"),h.classList.remove("boc-cursor-copy")),L(w,S),w=null,S=null,i.config.enableDragDrop)for(;null!=o&&o!=h;){if(o.hasAttribute&&o.hasAttribute(OrgChart.attr.node_id)){var R=o.getAttribute(OrgChart.attr.node_id);if(i._gragStartedId&&R!=i._gragStartedId){w=R,S=o;break}}o=o.parentNode}if(null!=w){S.classList.add("boc-drag-over");for(var B=i.getNode(w),U=OrgChart.getStParentNodes(B),P=0;P<U.length;P++){var F=i.getNodeElement(U[P].id);F&&(F.style.opacity=.1)}!i.canUpdateLink(d[0].id,w)&&h.classList?(h.classList.remove("boc-cursor-grab"),h.classList.remove("boc-cursor-move"),h.classList.remove("boc-cursor-copy"),h.classList.add("boc-cursor-nodrop")):h.classList&&(h.classList.remove("boc-cursor-grab"),h.classList.remove("boc-cursor-move"),h.classList.add("boc-cursor-copy"),h.classList.remove("boc-cursor-nodrop"))}var z=(r.x-I.x)/A,D=(r.y-I.y)/A;for(_=0;_<g.length;_++){g[_][4]=u[_].x+z,g[_][5]=u[_].y+D,C[_]&&(C[_][4]=b[_].x+z,C[_][5]=b[_].y+D),d[_].x=p[_].x+z,d[_].y=p[_].y+D;var H=OrgChart.ui.link(d[_],i,A,i.response.bordersByRootIdAndLevel,i.nodes,OrgChart.action.update,!0);for(P=0;P<H.length;P++){var $=H[P];(j=i.element.querySelector(`[data-l-id="[${$.id}][${$.childId}]"]`))&&(j.innerHTML=$.html)}}if(l.parent)if(i.config.movable==OrgChart.movable.detachTree)(j=i.element.querySelector(`[data-l-id="[${l.parent.id}][${l.id}]"]`))&&j.parentElement.removeChild(j);else for(H=OrgChart.ui.link(l.parent,i,A,i.response.bordersByRootIdAndLevel,i.nodes,OrgChart.action.update,!0),P=0;P<H.length;P++){var j;$=H[P];(j=i.element.querySelector(`[data-l-id="[${$.id}][${$.childId}]"]`))&&(j.innerHTML=$.html)}if(!t._dragEventFired&&(Math.abs(r.x-I.x)>OrgChart.FIRE_DRAG_NOT_CLICK_IF_MOVE||Math.abs(r.y-I.y)>OrgChart.FIRE_DRAG_NOT_CLICK_IF_MOVE)){if(!1===OrgChart.events.publish("drag",[i,n,e,a])&&N(),i.config.enableDragDrop)for(_=0;_<f.length;_++)h.insertBefore(f[_],h.firstChild);t._dragEventFired=!0}for(_=0;_<g.length;_++)f[_].setAttribute("transform","matrix("+g[_].toString()+")"),m[_]&&m[_].setAttribute("transform","matrix("+C[_].toString()+")")}}},N=function(e){for(var n=0;n<d.length;n++)d[n].x=p[n].x,d[n].y=p[n].y;if(i.moveEnd(),h.classList&&(h.classList.remove("boc-cursor-grab"),h.classList.remove("boc-cursor-move"),h.classList.remove("boc-cursor-nodrop"),h.classList.remove("boc-cursor-copy")),h.removeEventListener(r.move,E),h.removeEventListener(r.up,N),r.leave&&h.removeEventListener(r.leave,N),d[0].id!=w&&null!=w){var a=i.getNode(w);if(!1===(o=OrgChart.events.publish("drop",[i,d[0].id,a.id,f[0],e])))return L(w,S),void(i._gragStartedId=null);if(i.canUpdateLink(d[0].id,w))(C=i.get(d[0].id)).pid=w,C.stpid=null,i.updateNode(C,null,!0);else L(w,S);i._gragStartedId=null}else{if(t._dragEventFired){var o=OrgChart.events.publish("drop",[i,d[0].id,void 0,f[0],e]);if(i.config.movable&&!1!==o)if(i.config.movable==OrgChart.movable.detachTree){var c=OrgChart._getTransform(i.getNodeElement(l.id));(C=i.get(l.id)).pid=null,C.stpid=null,i.updateNode(C,null,!0)}else{var g=[];i.config.movable==OrgChart.movable.node?g.push(l.id):s(l,g);var u=(c=OrgChart._getTransform(i.getNodeElement(l.id)))[4]-l.x,m=c[5]-l.y;for(n=0;n<g.length;n++){var C;(C=i.get(g[n]))&&(null!=C.movex?C.movex+=u:C.movex=u,null!=C.movey?C.movey+=m:C.movey=m,i.update(C))}i._ai.setContext(),OrgChart.events.publish("updated",[i]),i.draw(OrgChart.action.update,{dragNodeIdList:g})}}i._gragStartedId=null}};h.addEventListener(r.move,E),h.addEventListener(r.up,N),r.leave&&h.addEventListener(r.leave,N)},OrgChart.prototype._dragDropHandler=function(t,e,r){var i=OrgChart._getClientXY(e),n=t.getAttribute(OrgChart.attr.node_id),a=this.getNode(n);t._dragEventFired=!1;var o=null,s=null;this._gragStartedId=n,this.element.style.mozUserSelect=this.element.style.webkitUserSelect=this.element.style.userSelect="none";var l=this,h=this.getSvg(),c={x:i.x,y:i.y},d=OrgChart._getTransform(t),g=d[4],p=d[5],u=l.getScale(),f=t.cloneNode(!0);f.setAttribute("data-n-id","draging"),h.insertBefore(f,h.firstChild),f.style.opacity=.7;var m=function(t,e){if(null!=t){e.classList.remove("boc-drag-over");for(var r=l.getNode(o),i=OrgChart.getStParentNodes(r),n=0;n<i.length;n++){var a=l.getNodeElement(i[n].id);a&&(a.style.opacity=1)}}},C=function(e){if(c){var r=OrgChart._getClientXY(e),i=e.target;OrgChart.isMobile()&&(i=document.elementFromPoint(r.x,r.y));var n=OrgChart._getOffsetXY(l.element,e),C={left:l.width()-(n.x+l.config.padding)<0,right:n.x-l.config.padding<0,up:l.height()-(n.y+l.config.padding)<0,down:n.y-l.config.padding<0};if(C.left||C.right||C.up||C.down){h.classList&&(h.classList.remove("boc-cursor-grab"),h.classList.add("boc-cursor-move"),h.classList.remove("boc-cursor-nodrop"),h.classList.remove("boc-cursor-copy"));var v=d[4],O=d[5],x=c.x,y=c.y,_=r.x,k=r.y;l.moveStart(C,(function(t){d[4]=v+t.x,d[5]=O+t.y,c.x=x-t.xWithoutScale,c.y=y-t.yWithoutScale,r.x=_-t.xWithoutScale,r.y=k-t.yWithoutScale,f.setAttribute("transform","matrix("+d.toString()+")")}))}else{if(l.moveEnd(),h.classList&&(h.classList.add("boc-cursor-grab"),h.classList.remove("boc-cursor-move"),h.classList.remove("boc-cursor-nodrop"),h.classList.remove("boc-cursor-copy")),m(o,s),o=null,s=null,l.config.enableDragDrop)for(;null!=i&&i!=h;){if(i.hasAttribute&&i.hasAttribute(OrgChart.attr.node_id)){var w=i.getAttribute(OrgChart.attr.node_id);if(l._gragStartedId&&w!=l._gragStartedId){o=w,s=i;break}}i=i.parentNode}if("draging"==o&&(o=null,s=null),null!=o){s.classList.add("boc-drag-over");for(var S=l.getNode(o),I=OrgChart.getStParentNodes(S),A=0;A<I.length;A++){var L=l.getNodeElement(I[A].id);L&&(L.style.opacity=.1)}!l.canUpdateLink(a.id,o)&&h.classList?(h.classList.remove("boc-cursor-grab"),h.classList.remove("boc-cursor-move"),h.classList.remove("boc-cursor-copy"),h.classList.add("boc-cursor-nodrop")):h.classList&&(h.classList.remove("boc-cursor-grab"),h.classList.remove("boc-cursor-move"),h.classList.add("boc-cursor-copy"),h.classList.remove("boc-cursor-nodrop"))}var E=(r.x-c.x)/u,N=(r.y-c.y)/u;if(d[4]=g+E,d[5]=p+N,!t._dragEventFired&&(Math.abs(r.x-c.x)>OrgChart.FIRE_DRAG_NOT_CLICK_IF_MOVE||Math.abs(r.y-c.y)>OrgChart.FIRE_DRAG_NOT_CLICK_IF_MOVE))!1===OrgChart.events.publish("drag",[l,w,e])&&b(),t._dragEventFired=!0;f.setAttribute("transform","matrix("+d.toString()+")")}}},b=function(e){if(l.moveEnd(),h.classList&&(h.classList.remove("boc-cursor-grab"),h.classList.remove("boc-cursor-move"),h.classList.remove("boc-cursor-nodrop"),h.classList.remove("boc-cursor-copy")),h.removeEventListener(r.move,C),h.removeEventListener(r.up,b),r.leave&&h.removeEventListener(r.leave,b),a.id==o||null==o)return t._dragEventFired&&OrgChart.events.publish("drop",[l,a.id,void 0,f,e]),h.removeChild(f),void(l._gragStartedId=null);var i=l.getNode(o);if(!1===OrgChart.events.publish("drop",[l,a.id,i.id,f,e]))return m(o,s),h.removeChild(f),void(l._gragStartedId=null);if(l.canUpdateLink(a.id,o)){var n=l.get(a.id);n.pid=o,n.stpid=null,null!=n.movex&&(n.movex=void 0),null!=n.movey&&(n.movey=void 0),l.updateNode(n,null,!0)}else h.removeChild(f),m(o,s);l._gragStartedId=null};h.addEventListener(r.move,C),h.addEventListener(r.up,b),r.leave&&h.addEventListener(r.leave,b)},OrgChart.prototype._resizeHandler=function(t,e){if(this.isVisible){var r=this.getViewBox(),i=this.getSvg(),n=i.getAttribute("width"),a=i.getAttribute("height"),o=n/r[2],s=a/r[3],l=o>s?s:o;i.setAttribute("width",this.width()),i.setAttribute("height",this.height()),r[2]=this.width()/l,r[3]=this.height()/l,this.setViewBox(r),this.xScrollUI.create(this.width()),this.yScrollUI.create(this.height()),this._draw(!1,OrgChart.action.resize)}},OrgChart.prototype._nodeDbClickHandler=function(t,e){if(!1===OrgChart.events.publish("dbclick",[this,this.get(t)]))return!1;this._commonClickHandler(t,e,this.config.nodeMouseDbClick)},OrgChart.prototype._nodeClickHandler=function(t,e){var r=this.getNodeElement(t);if(r&&r._dragEventFired)r._dragEventFired=!1;else{if(!1===OrgChart.events.publish("click",[this,{node:this.getNode(t),event:e}]))return!1;this._commonClickHandler(t,e,this.config.nodeMouseClick)}},OrgChart.prototype._nodeCircleMenuItemClickHandler=function(t,e){var r=t.parentNode.getAttribute(OrgChart.attr.control_node_circle_menu_wrraper_id),i=t.getAttribute(OrgChart.attr.control_node_circle_menu_name),n=this.nodeCircleMenuUI._menu[i];OrgChart.events.publish("click",[this.nodeCircleMenuUI,{nodeId:r,menuItemName:i,menuItem:n,event:e}])},OrgChart.prototype._nodeCircleMenuClickHandler=function(t){OrgChart.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide();var e=this.getNode(t),r=null;if(Array.isArray(e.tags))for(var i=0;i<e.tags.length;i++){var n=e.tags[i];this.config.tags[n]&&this.config.tags[n].nodeCircleMenu&&(r=this.config.tags[n].nodeCircleMenu)}this.nodeCircleMenuUI.show(t,r)},OrgChart.prototype._commonClickHandler=function(t,e,r){var i;(OrgChart.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide(),r==OrgChart.action.expandCollapse&&this.toggleExpandCollapse(t,e),r==OrgChart.action.edit)&&((i=this.getNode(t))&&(this.editUI.show(i.id),this.ripple(i.id,e.clientX,e.clientY)));r==OrgChart.action.details&&((i=this.getNode(t))&&(this.editUI.show(i.id,!0),this.ripple(i.id,e.clientX,e.clientY)))},OrgChart.prototype._menuHandlerMouseDownHandler=function(t,e){e.stopPropagation(),e.preventDefault()},OrgChart.prototype._nodeMenuClickHandler=function(t,e,r){OrgChart.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var i=this.getNode(t),n=null;if(Array.isArray(i.tags))for(var a=0;a<i.tags.length;a++){var o=i.tags[a];this.config.tags[o]&&this.config.tags[o].nodeMenu&&(n=this.config.tags[o].nodeMenu)}this.nodeMenuUI.showStickIn(e,t,null,n)},OrgChart.prototype._menuClickHandler=function(t,e){e.stopPropagation(),e.preventDefault(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.show(t.offsetLeft,t.offsetTop)},OrgChart.prototype._lonelyButtonHandler=function(){var t={id:this.generateId()};!1!==this.addNode(t,null,!0)&&this.center(t.id)},OrgChart.prototype.toggleExpandCollapse=function(t,e){var r=this.getNode(t),i=this.getCollapsedIds(r);if(i.length){if(!1===OrgChart.events.publish("expcollclick",[this,!1,t,i]))return!1;this.expand(t,i,!1)}else{if(!1===OrgChart.events.publish("expcollclick",[this,!0,t,r.childrenIds]))return!1;this.collapse(t,r.childrenIds,!1)}e&&this.ripple(r.id,e.clientX,e.clientY)},OrgChart.prototype._move=function(t,e,r){r[0]=e,r[1]=t,this.setViewBox(r),this.xScrollUI.setPosition(),this.yScrollUI.setPosition()},OrgChart.prototype.moveStart=function(t,e,r,i){if(t){if(!this._moveInterval){var n=this,a=this.getViewBox().slice(0),o=this.getScale(),s=0,l=0,h=1;OrgChart.isNEU(r)&&(r=OrgChart.anim.inSin),OrgChart.isNEU(i)&&(i=3e3),this._moveInterval=setInterval((function(){var c={x:0,y:0,xWithoutScale:0,yWithoutScale:0};t.left?(s++,c.x=s*OrgChart.MOVE_STEP/o,c.xWithoutScale=s*OrgChart.MOVE_STEP):t.right&&(s++,c.x=-s*OrgChart.MOVE_STEP/o,c.xWithoutScale=-s*OrgChart.MOVE_STEP),t.up?(l++,c.y=l*OrgChart.MOVE_STEP/o,c.yWithoutScale=l*OrgChart.MOVE_STEP):t.down&&(l++,c.y=-l*OrgChart.MOVE_STEP/o,c.yWithoutScale=-l*OrgChart.MOVE_STEP);var d=r((10*h-10)/i);c.x=c.x*d,c.xWithoutScale=c.xWithoutScale*d,c.y=c.y*d,c.yWithoutScale=c.yWithoutScale*d,n.setViewBox([a[0]+c.x,a[1]+c.y,a[2],a[3]]),e&&e(c),h+=1}),10)}}else console.error("movePosition parameter not defined")},OrgChart.prototype.moveEnd=function(){this._moveInterval&&(clearInterval(this._moveInterval),this._moveInterval=null)},void 0===OrgChart&&(OrgChart={}),OrgChart.node=function(t,e,r,i){this.templateName=i,this.id=t,this.pid=e,this.children=[],this.childrenIds=[],this.parent=null,this.stpid=null,this.stParent=null,this.stChildren=[],this.stChildrenIds=[],this.tags=r,this.tags||(this.tags=[])},OrgChart.prototype._mouseDownHandler=function(t,e,r){var i=this;OrgChart.HIDE_EDIT_FORM_ON_PAN&&this.editUI.hide(),OrgChart.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var n=this.getViewBox(),a=this.getScale(),o=OrgChart._getClientTouchesXY(e,0),s=OrgChart._getClientTouchesXY(e,1),l={diffX:0,diffY:0,x0:o.x,y0:o.y,type:"pan",viewBoxLeft:n[0],viewBoxTop:n[1]};e.touches&&e.touches.length>1&&(l.type="pinch",l.dist=Math.sqrt((o.x-s.x)*(o.x-s.x)+(o.y-s.y)*(o.y-s.y))),"pan"==l.type&&(this._hideBeforeAnimation(),this._changeCursorOnPanStart(n,a,e));var h=function(t){var e=OrgChart._getClientTouchesXY(t,0);if(l&&"pan"==l.type){i._hideBeforeAnimation(),l.diffX=e.x-l.x0,l.diffY=e.y-l.y0;var r=-l.diffY/a+l.viewBoxTop,o=-l.diffX/a+l.viewBoxLeft;i._move(r,o,n)}else if(l&&"pinch"==l.type){var s=OrgChart._getClientTouchesXY(t,1),h=Math.sqrt((e.x-s.x)*(e.x-s.x)+(e.y-s.y)*(e.y-s.y)),c=1+(h-l.dist)/(l.dist/100)/100;l.dist=h;var d=OrgChart._pinchMiddlePointInPercent(i.element,i.width(),i.height(),t);i.zoom(c,d)}},c=function(){"pan"==l.type&&i.config.sticky?setTimeout((function(){OrgChart._moveToBoundaryArea(t,i.getViewBox(),i.response.boundary,(function(){i._draw(!0,OrgChart.action.pan)}))}),0):"pan"!=l.type||i.config.sticky||setTimeout((function(){i._draw(!0,OrgChart.action.pan)}),0),"pan"==l.type&&i._changeCursorOnPanEnd(),l=null,t.removeEventListener(r.move,h),t.removeEventListener(r.up,c),r.leave&&t.removeEventListener(r.leave,c),r.touchstart&&t.removeEventListener(r.touchstart,c)};this.config.enablePan&&(t.addEventListener(r.move,h),t.addEventListener(r.up,c),r.leave&&t.addEventListener(r.leave,c),r.touchstart&&t.addEventListener(r.touchstart,c))},OrgChart.prototype._changeCursorOnPanStart=function(t,e,r){var i=this.getPointerElement();if(i){var n=OrgChart._getOffsetXY(this.element,r),a=n.x/e+t[0]-16/e,o=n.y/e+t[1]-16/e;i.style.display="inherit",i.setAttribute("transform","matrix(0,0,0,0,"+a+","+o+")"),OrgChart.animate(i,{transform:[0,0,0,0,a,o],opacity:0},{transform:[1/e,0,0,1/e,a,o],opacity:1},300,OrgChart.anim.outBack)}else this.element.style.cursor="move"},OrgChart.prototype._changeCursorOnPanEnd=function(){var t=this.getPointerElement();t?t.style.display="none":this.element.style.cursor="initial"},OrgChart.searchUI=function(){this.lastSearch=[],this._searchAfterEnterPress=!1,this._event_id=OrgChart._guid(),this.instance=null},OrgChart.searchUI.prototype.init=function(t){this.instance=t,this.obj=this.instance,this._initSearchFields();var e=this,r=this.instance.config.padding-10,i=this.instance.config.padding-10,n=this.instance.getMenuButton();if(n){var a=n.getBoundingClientRect(),o=this.instance.getSvg().getBoundingClientRect();r=o.right-a.left+10,i=a.top-o.top-10}var s=document.createElement("div");s.classList.add("boc-search"),s.style.right=r+"px",s.style.top=i+"px";var l=OrgChart.elements.textbox({},{label:OrgChart.SEARCH_PLACEHOLDER,btn:"X"},"320px");s.innerHTML+=l.html,this.xBtn=s.querySelector("[data-input-btn]"),this.xBtn.style.display="none",this.searchTableWrapper=document.createElement("div"),s.appendChild(this.searchTableWrapper);var h=this.instance.getSvg().nextSibling;this.instance.element.insertBefore(s,h),OrgChart.input.init(s),this.input=document.getElementById(l.id),this.xBtn.addEventListener("click",(function(t){t.preventDefault(),e.hide()})),this.input.addEventListener("keypress",(function(t){"Enter"==t.key&&t.preventDefault()})),this.input.addEventListener("focus",(function(t){e.xBtn.style.display="",e._search()})),this.input.addEventListener("blur",(function(t){OrgChart.isNEU(e.input.value)&&OrgChart.SEARCH_HELP_SYMBOL!=e.input.value&&(e.xBtn.style.display="none")})),this.input.addEventListener("keydown",(function(t){("ArrowDown"==t.key||"ArrowUp"==t.key)&&t.preventDefault()})),this.input.addEventListener("keyup",(function(t){"ArrowDown"==t.key?c():"ArrowUp"==t.key?d():"Enter"==t.key?e._enterHandler():"Escape"==t.key?e.hide():this.value.length>=OrgChart.MINIMUM_SYMBOLS_IN_SEARCH_INPUT&&e._search()}));var c=function(){var t=e.instance.element.querySelectorAll("[data-search-item-id]"),r=e.instance.element.querySelector('[data-selected="yes"]');null==r&&t.length>0?t[0].setAttribute("data-selected","yes"):t.length>0&&r.nextSibling&&r.nextSibling.setAttribute&&(r.removeAttribute("data-selected"),r.nextSibling.setAttribute("data-selected","yes"))},d=function(){var t=e.instance.element.querySelectorAll("[data-search-item-id]"),r=e.instance.element.querySelector('[data-selected="yes"]');null==r&&t.length>0?t[t.length-1].setAttribute("data-selected","yes"):t.length>0&&r.previousSibling&&r.previousSibling.setAttribute&&(r.removeAttribute("data-selected"),r.previousSibling.setAttribute("data-selected","yes"))}},OrgChart.searchUI.prototype._enterHandler=function(){var t=this.instance.element.querySelector('[data-selected="yes"]');if(t){if(t.hasAttribute("data-search-item-id")){var e=t.getAttribute("data-search-item-id");if(this.input.value!=OrgChart.SEARCH_HELP_SYMBOL){var r=OrgChart.events.publish("",[this.instance,e]),i=OrgChart.events.publish("searchclick",[this,{nodeId:e}]);!1===r&&(i=!1),0!=i&&this.instance.center(e)}else this.input.value=e+" ",this.searchTableWrapper.innerHTML=""}}else this._searchAfterEnterPress=!0,this.__search(),this.searchTableWrapper.innerHTML="",this.instance.draw()},OrgChart.searchUI.prototype._initSearchFields=function(){if(null==this.instance.config.searchFields){this._searchFields=[];for(var t=0;t<this.instance.response.allFields.length;t++){var e=this.instance.response.allFields[t];"tags"==e||OrgChart._fieldIsImg(this.instance.config,e)||-1==this._searchFields.indexOf(e)&&this._searchFields.push(e)}}else this._searchFields=this.instance.config.searchFields;if(null==this.instance.config.searchFieldsAbbreviation){this.searchFieldsAbbreviation={};for(t=0;t<this._searchFields.length;t++){for(var r=this._searchFields[t],i=0,n=r.slice(0,i+1).toLowerCase();this.searchFieldsAbbreviation[n];)i++,n=r.slice(0,i+1).toLowerCase();this.searchFieldsAbbreviation[n]=r}}else this.searchFieldsAbbreviation=this.instance.config.searchFieldsAbbreviation;this._searchFieldsAbbreviation=this.searchFieldsAbbreviation},OrgChart.searchUI.prototype.find=function(t){this.input&&(this.input.value=t,document.activeElement==this.input?this._search(t):this.input.focus())},OrgChart.searchUI.prototype.addMatchTag=function(t){if(this._searchAfterEnterPress){for(var e=0;e<this.lastSearch.length;e++)if(this.lastSearch[e].id==t)return!0;return!1}return null},OrgChart.searchUI.prototype.__search=function(){this.lastSearch=OrgChart._search.search(this.instance.config.nodes,this.input.value,this._searchFields,this._searchFields,this.instance.config.searchDisplayField,this.instance.config.searchFieldsWeight,this.searchFieldsAbbreviation)},OrgChart.searchUI.prototype._search=function(){var t,e=this;if(this._searchAfterEnterPress=!1,this.input.value==OrgChart.SEARCH_HELP_SYMBOL)t=this.helpView();else{this.__search();var r=OrgChart._getFistImgField(this.instance.config);t=`<table border="0" cellspacing="0" cellpadding="0">\n <tbody>\n ${function(){for(var t="",i=0;i<e.lastSearch.length&&!(i>=OrgChart.SEARCH_RESULT_LIMIT);i++){var n=e.lastSearch[i],a="";if(r){var o=e.instance._get(n.id);"function"==typeof r?a=r(e.instance,e.instance.getNode(n.id),o):o[r]&&(a=o[r])}var s="",l="";e.instance.config.searchDisplayField==n.__searchField?s=n.__searchMarks:e.instance.config.searchDisplayField?(s=n[e.instance.config.searchDisplayField],OrgChart.isNEU(s)&&(s=""),l=n.__searchMarks):s=n.__searchMarks;var h={img:a,nodeId:n.id,first:s,second:l,searchItem:n,html:OrgChart.searchUI.createItem(a,n.id,s,l)};OrgChart.events.publish("add-item",[e,h]),t+=h.html}return t}()} \n </tbody>\n </table>`}this.searchTableWrapper.innerHTML=t;for(var i=this.instance.element.querySelectorAll("[data-search-item-id]"),n=0;n<i.length;n++)i[n].addEventListener("click",(function(){if(this.hasAttribute("data-search-item-id")){var t=this.getAttribute("data-search-item-id");if(e.input.value!=OrgChart.SEARCH_HELP_SYMBOL){var r=OrgChart.events.publish("searchclick",[e.instance,t]),i=OrgChart.events.publish("searchclick",[e,{nodeId:t}]);if(!1===r&&(i=!1),!1!==i){e.instance.center(this.getAttribute("data-search-item-id"));var n=e.instance.element.querySelector('[data-selected="yes"]');n&&n.removeAttribute("data-selected"),this.setAttribute("data-selected","yes"),e.input.focus()}}else e.input.value=t+" ",e.searchTableWrapper.innerHTML="",e.input.focus()}}));OrgChart.events.publish("show-items",[this,{}])},OrgChart.searchUI.prototype.helpView=function(){var t='<table border="0" cellspacing="0" cellpadding="0">';for(var e in this.searchFieldsAbbreviation)t+=`<tr data-search-item-id="${e}" style="height: 50px;"><td class="boc-search-image-td" style="text-align: center;">${e}</td><td class="boc-search-text-td">${this.searchFieldsAbbreviation[e]}</td></tr>`;return t+="</table>"},OrgChart.searchUI.createItem=function(t,e,r,i){return r&&(r="<b>"+r+"</b>"),`<tr data-search-item-id="${e}">\n <td class="boc-search-image-td">\n ${t=t?`<div class="boc-search-photo" style="background-image: url(${t})"></div>`:`<div class="boc-search-photo">${OrgChart.icon.user(32,32,"#aeaeae")}</div>`}\n </td>\n <td class="boc-search-text-td">${r} <br/>${i}</td>\n </tr>`},OrgChart.searchUI.prototype.hide=function(){if(!1===OrgChart.events.publish("hide",[this]))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&&(this.input.value="",document.activeElement==this.input&&this.input.blur(),document.activeElement==this.xBtn&&OrgChart.input.blurHandler(this.input))},OrgChart.searchUI.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},void 0===OrgChart&&(OrgChart={}),OrgChart.manager=function(t){this.config=t.config,this.layoutConfigs=t._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=t,this._fixAdjustForExport={x:0,y:0}},OrgChart.manager.prototype.read=function(t,e,r,i,n,a,o,s){var l=this;OrgChart.state._get(this.config.state,e,r,(function(h){l.state=h,l.action=n,l.actionParams=a,n!=OrgChart.action.init||!l.state||a&&a.method&&"fit"==a.method?(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 c=l.maxX,d=l.maxY,g=l.minX,p=l.minY,u=l.bordersByRootIdAndLevel,f=l.roots,m=l.nodes;if(t){var C=OrgChart.manager._getResponse(e,r,l.visibleNodeIds,l.config,c,d,g,p,l.viewBox,f,l.action,l.actionParams,m,l.oldNodes,l.vbIsInitializedFromState);n!=OrgChart.action.exporting&&(l.maxX=c,l.maxY=d,l.minX=g,l.minY=p,l.roots=f,l.nodes=m,l.visibleNodeIds=C.visibleNodeIds),C.bordersByRootIdAndLevel=u,C.roots=f,C.adjustify={x:0,y:0},l.state&&(C.adjustify=l.state.adjustify),o(C)}else l.oldNodes=m||null,l._read((function(t){c=t.maxX,d=t.maxY,g=t.minX,p=t.minY,u=t.bordersByRootIdAndLevel,f=t.roots,m=t.nodes;var i=OrgChart.manager._getResponse(e,r,l.visibleNodeIds,l.config,c,d,g,p,l.viewBox,f,l.action,l.actionParams,m,l.oldNodes,l.vbIsInitializedFromState);i.notif=t.limit,i.roots=f,i.bordersByRootIdAndLevel=u,i.adjustify=t.adjustify,n!=OrgChart.action.exporting&&(l.maxX=c,l.maxY=d,l.minX=g,l.minY=p,l.roots=f,l.nodes=m,l.visibleNodeIds=i.visibleNodeIds,l.bordersByRootIdAndLevel=u,l.rootList=t.rootList),o(i)}),s)}))},OrgChart.manager.prototype._read=function(t,e){var r=this,i=OrgChart.manager._createNodes(this.instance);e(i);var n=i.nodes,a=i.roots,o=OrgChart.remote;null==o&&(o=OrgChart.local),o._setPositions(a,r.layoutConfigs,(function(e){var o=OrgChart.manager._doNotChangePositionOfClickedNodeIfAny(a,n,r.action,r.actionParams,r.oldNodes,r.config.orientation);r.state&&r.action==OrgChart.action.init&&(o=r.state.adjustify),r.action==OrgChart.action.exporting?o=r._fixAdjustForExport:r._fixAdjustForExport=o;for(var s={minX:null,minY:null,maxX:null,maxY:null},l={},h=[],c=0;c<a.length;c++)OrgChart.manager._setMinMaxXYAdjustifyIterate(a[c],a[c],s,0,l,o,r.config.orientation,h);for(var d in h)for(var g in h[d]){var p=l[d][g],u=h[d][g];null==p.minX&&null==p.minY&&null==p.maxX&&null==p.maxY&&OrgChart._setMinMaxXY(u,p)}t({minX:s.minX,minY:s.minY,maxX:s.maxX,maxY:s.maxY,bordersByRootIdAndLevel:l,nodes:n,roots:a,rootList:i.rootList,limit:e,adjustify:o})}),n)},void 0===OrgChart&&(OrgChart={}),OrgChart.manager._initDinamicNode=function(t,e,r){e&&(t.lcn=e),r&&(t.isAssistant=!0);var i=OrgChart.t(t.templateName);t.w=i&&i.size?i.size[0]:0,t.h=i&&i.size?i.size[1]:0,t.isSplit="split"==t.templateName,t.isMirror="mirror"==t.templateName,t.isSubLevel="subLevel"==t.templateName},OrgChart.manager._setCollpasedProperty=function(t,e,r,i,n,a,o,s){if(null==t.collapsed&&e.collapse&&e.collapse.allChildren?t.collapsed=!0:null==t.collapsed&&(t.collapsed=!1),n==OrgChart.action.expand&&-1!=r.ids.indexOf(t.id)&&(t.collapsed=!1),n==OrgChart.action.collapse&&(r.expandIds||r.collapseIds)?r.expandIds&&-1!=r.expandIds.indexOf(t.id)?t.collapsed=!1:r.collapseIds&&-1!=r.collapseIds.indexOf(t.id)&&(t.collapsed=!0):n==OrgChart.action.collapse&&-1!=r.ids.indexOf(t.id)&&(t.collapsed=!0),n==OrgChart.action.expand&&"all"==r.ids&&(t.collapsed=!1),n!=OrgChart.action.exporting||null==r.parentLevels&&null==r.childLevels||null==r.id)n==OrgChart.action.exporting&&r.expandChildren&&(t.collapsed=!1);else if(null!=r.id&&(r.parentLevels||r.childLevels)){var l=s[r.id];if(l==t)t.collapsed=!1;else{for(var h=!1,c=-1,d=!1,g=-1;l;){if(c++,l==t){h=!0;break}l=s[l.pid]}l=s[r.id];for(var p=s[t.id];p;){if(g++,p==l){d=!0;break}p=s[p.pid]}null!=r.parentLevels&&h&&c<=r.parentLevels||null!=r.childLevels&&d&&g<=r.childLevels||d&&r.expandChildren?t.collapsed=!1:t.collapsed=!0}}n==OrgChart.action.init&&null!=o?t.collapsed=!o.exp.has(t.id):n==OrgChart.action.init?-1!=t.tags.indexOf("left-partner")||-1!=t.tags.indexOf("right-partner")||-1!=t.tags.indexOf("partner")||t.parentPartner?t.collapsed=e.collapse&&a>=e.collapse.level&&-1==i.indexOf(t.id):t.collapsed=e.collapse&&a>=e.collapse.level-1&&-1==i.indexOf(t.id):n==OrgChart.action.centerNode||n==OrgChart.action.insert||n==OrgChart.action.expand||n==OrgChart.action.collapse?i.has(t.id)&&(t.collapsed=!1):n==OrgChart.action.update&&r&&r.changeRoots&&r.changeRoots.has(t.id)&&(t.collapsed=!1)},OrgChart.manager._initNode=function(t,e,r,i,n,a,o){var s=o.manager.config,l=o.manager.layoutConfigs,h=o.manager.action,c=o.manager.actionParams,d=o.manager.state,g=l[r||"base"];null==t.parent&&OrgChart.manager._setCollpasedProperty(t,g,c,n,h,i-1,d,e);for(var p=0;p<t.childrenIds.length;p++){var u=e[t.childrenIds[p]];if(OrgChart.manager._setCollpasedProperty(u,g,c,n,h,i,d,e),!u.collapsed){if(u.parent=t,null!=u.ppid){var f=e[u.ppid];f&&(u.parentPartner=f)}(-1!=u.tags.indexOf("left-partner")||-1!=u.tags.indexOf("right-partner")||-1!=u.tags.indexOf("partner")||u.parentPartner)&&-1==a.indexOf(t.id)&&a.push(t.id),t.children.push(u)}}if(h!=OrgChart.action.minimize||t.min?h==OrgChart.action.maximize&&!0===t.min?(c.all||c.id==t.id)&&(t.min=!1):h==OrgChart.action.exporting&&!1===c.min?t.min=!1:h==OrgChart.action.init&&null!=d&&(t.min=d.min.has(t.id)):(c.all||c.id==t.id)&&(t.min=!0),!t.min)for(p=0;p<t.stChildrenIds.length;p++){u=e[t.stChildrenIds[p]];t.tags&&t.tags.has("filter")||(u.stParent=t,t.stChildren.push(u))}null!=i&&(t.level=i),r&&(t.lcn=r);var m=OrgChart._getSubLevels(t.tags,s.tags);m>0&&(t.subLevels=m),-1!=t.tags.indexOf("assistant")&&null!=t.parent&&(t.isAssistant=!0);var C=OrgChart.t(t.templateName,t.min);t.w=C&&C.size?C.size[0]:0,t.h=C&&C.size?C.size[1]:0,t.padding=C&&C.padding?C.padding:[0,0,0,0];var b={node:t};OrgChart.events.publish("node-initialized",[o,b])},OrgChart.manager._iterate=function(t,e,r,i,n,a,o,s,l,h,c,d){var g=d.manager.layoutConfigs;if(OrgChart.manager._initNode(e,r,l,i,h,c,d),e.isAssistant&&(a[e.pid]||(a[e.pid]=[]),a[e.pid].push(e.id)),e.subLevels>0&&o.push(e.id),OrgChart.MIXED_LAYOUT_FOR_NODES_WITH_COLLAPSED_CHILDREN&&!e.isAssistant&&e.parent){if(e.parent&&e.parent.children.length&&e.parent.children[e.parent.children.length-1]==e){for(var p=[],u=0,f=0,m=0;m<e.parent.children.length;m++){-1==(C=e.parent.children[m]).tags.indexOf("partner")&&-1==C.tags.indexOf("left-partner")&&-1==C.tags.indexOf("right-partner")&&-1==C.tags.indexOf("assistant")&&0==C.children.length?p.push(C.id):-1!=C.tags.indexOf("assistant")?u++:-1==C.tags.indexOf("partner")&&-1==C.tags.indexOf("left-partner")&&-1==C.tags.indexOf("right-partner")||f++}(OrgChart.MIXED_LAYOUT_ALL_NODES&&p.length>1&&p.length==e.parent.children.length-u-f||!OrgChart.MIXED_LAYOUT_ALL_NODES&&p.length>1)&&(s[e.pid]=p)}}else if(!e.isAssistant&&0==e.childrenIds.length&&e.parent&&!s[e.pid]){for(p=[],u=0,f=0,m=0;m<e.parent.children.length;m++){var C;-1==(C=e.parent.children[m]).tags.indexOf("partner")&&-1==C.tags.indexOf("left-partner")&&-1==C.tags.indexOf("right-partner")&&-1==C.tags.indexOf("assistant")&&0==C.childrenIds.length?p.push(C.id):-1!=C.tags.indexOf("assistant")?u++:-1==C.tags.indexOf("partner")&&-1==C.tags.indexOf("left-partner")&&-1==C.tags.indexOf("right-partner")||f++}(OrgChart.MIXED_LAYOUT_ALL_NODES&&p.length>OrgChart.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN&&p.length==e.parent.childrenIds.length-u-f||!OrgChart.MIXED_LAYOUT_ALL_NODES&&p.length>OrgChart.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN)&&(s[e.pid]=p)}e.stChildren.length&&(t.stContainerNodes||(t.stContainerNodes=[]),t.stContainerNodes.push(e));for(var b=0;b<e.stChildren.length;b++){var v="";for(m=0;m<e.tags.length;m++)if(g[e.tags[m]]){v=e.tags[m];break}n.push(e.stChildren[b].id),OrgChart.manager._iterate(t,e.stChildren[b],r,0,n,a,o,s,v,h,c,d)}i++;for(b=0;b<e.children.length;b++)OrgChart.manager._iterate(t,e.children[b],r,i,n,a,o,s,l,h,c,d)},OrgChart.manager.__createNodes=function(t,e,r,i,n,a,o,s){for(var l=[],h=OrgChart._addDottedLines(r),c=0;c<h.length;c++){var d,g=h[c];d=OrgChart.STRING_TAGS?g.tags?g.tags.split(","):[]:Array.isArray(g.tags)?g.tags.slice(0):[],s.filterUI.addFilterTag(g)&&d.unshift("filter");var p=s.searchUI.addMatchTag(g.id);!0===p?d.unshift("match"):!1===p&&d.unshift("no-match");var u=OrgChart._getTemplate(d,r.tags,r.template),f=new OrgChart.node(g.id,g.pid,d,u);OrgChart.isNEU(g.ppid)||(f.ppid=g.ppid),OrgChart.isNEU(g.stpid)||(f.stpid=g.stpid),null!=g.movex&&(f.movex=g.movex),null!=g.movey&&(f.movey=g.movey),t[g.id]=f,l.push(g.id)}if(null!=r.orderBy){var m=OrgChart.manager._getOrderSortArray(r.orderBy);l.sort((function(t,e){var r,i;for(var n of h)if(n.id==t&&(r=n),n.id==e&&(i=n),r&&i)break;for(var a=0;a<m.length;a++){var o=r[m[a].field],s=i[m[a].field],l=o,c=s;if(null==l&&(l=""),null==c&&(c=""),"string"==typeof l&&"string"==typeof c){var d=l.localeCompare(c);if(m[a].desc&&(d*=-1),0!==d)return d}else{d=o<s?-1:o>s?1:0;if(m[a].desc&&(d*=-1),0!==d)return d}}}))}for(c=0;c<l.length;c++){var C=l[c],b=(f=t[C],a?a[C]:null),v=t[f.stpid],O=t[f.pid];if(v||(f.stpid=null),O||(f.pid=null),v){var x=a?a[v.id]:null;x&&(v.min=x.min),v.stChildrenIds.push(f.id)}else O?(b&&(f.collapsed=b.collapsed,f.min=b.min),O.childrenIds.push(f.id)):(b&&(f.collapsed=b.collapsed,f.min=b.min),e.push(f),o.push(f.id));i==OrgChart.action.init&&(f.min=OrgChart._getMin(f,r))}},OrgChart.manager._createNodes=function(t){var e=t.manager.config,r=t.manager.layoutConfigs,i=t.manager.action,n=t.manager.actionParams,a=t.manager.oldNodes,o=t.manager.state,s={},l=[],h=[];if(OrgChart.manager.__createNodes(s,l,e,i,n,a,h,t),null!=e.roots){l=[];for(var c=0;c<e.roots.length;c++){var d=s[e.roots[c]];if(d&&i==OrgChart.action.centerNode){for(var g=d;null!=g.pid||null!=g.stpid;)g=null==g.pid&&null!=g.stpid?s[g.stpid]:s[g.pid];for(var p=s[n.id];(null!=p.pid||null!=p.stpid)&&p!=d;)p=null==p.pid&&null!=p.stpid?s[p.stpid]:s[p.pid];g==p&&(d=g)}if(d){for(var u=!1,f=0;f<l.length;f++)if(l[f].id==d.id){u=!0;break}if(!u){if(!OrgChart.isNEU(d.pid))(mt=(m=s[d.pid]).childrenIds.indexOf(d.id))>-1&&m.childrenIds.splice(mt,1);l.push(d)}}}e.roots=[];for(c=0;c<l.length;c++)e.roots.push(l[c].id)}if(i==OrgChart.action.exporting&&null!=n.id)if(n.parentLevels){for(var m=s[n.id],C=0;C<n.parentLevels&&s[m.pid];)C++,m=s[m.pid];m.pid=null,l=[m]}else{(v=s[n.id])&&(v.pid=null,l=[v])}var b=[];if(i==OrgChart.action.init&&e.expand&&e.expand.nodes&&null==o)for(c=0;c<e.expand.nodes.length;c++){var v=s[e.expand.nodes[c]];for(!0===e.expand.allChildren&&OrgChart.manager._addExpandedNodeIdsIterate(v,s,b);v;)b.push(v.id),null==v.pid&&null!=v.stpid?(v=s[v.stpid]).min=!1:v=s[v.pid]}else if(i==OrgChart.action.expand&&n.ids&&"all"!=n.ids||i==OrgChart.action.collapse&&n&&n.expandIds){nt=i==OrgChart.action.expand?n.ids:n.expandIds;for(c=0;c<nt.length;c++)for(m=s[(v=s[nt[c]]).pid];m;)b.push(m.id),null==m.pid&&null!=m.stpid?(m=s[m.stpid]).min=!1:m=s[m.pid]}else if(i==OrgChart.action.centerNode){for(var O=s[n.id];O;){if(b.push(O.id),n.options.parentState===OrgChart.COLLAPSE_PARENT_NEIGHBORS&&O)for(c=0;c<O.childrenIds.length;c++){(D=s[O.childrenIds[c]]).collapsed=!0}null==O.pid&&null!=O.stpid?(O=s[O.stpid]).min=!1:O=s[O.pid]}O=s[n.id];if(n.options.childrenState===OrgChart.COLLAPSE_SUB_CHILDRENS)for(c=0;c<O.childrenIds.length;c++){(y=s[O.childrenIds[c]]).collapsed=!1;for(var x=0;x<y.childrenIds.length;x++){s[y.childrenIds[x]].collapsed=!0}}if(n.options.parentState===OrgChart.COLLAPSE_PARENT_SUB_CHILDREN_EXCEPT_CLICKED)if(m=s[O.pid])for(c=0;c<m.childrenIds.length;c++){var y;if((y=s[m.childrenIds[c]])!=O){y.collapsed=!1;for(x=0;x<y.childrenIds.length;x++){s[y.childrenIds[x]].collapsed=!0}}}}else if(i==OrgChart.action.insert)for(v=s[n.insertedNodeId];v;)b.push(v.id),null==v.pid&&null!=v.stpid?(v=s[v.stpid]).min=!1:v=s[v.pid];var _=[],k={},w=[],S={},I=[];for(c=0;c<l.length;c++)OrgChart.manager._iterate(l[c],l[c],s,0,_,k,w,S,"",b,I,t);if(i==OrgChart.action.collapse&&n&&Array.isArray(n.expandIds)&&Array.isArray(n.collapseIds))for(c=0;c<n.ids.length;c++){if(n.expandIds.has(n.collapseIds[c]))console.error(`id ${n.collapseIds[c]} exist in both collapseIds and expandIds`);else(v=s[n.collapseIds[c]])&&(v.collapsed=!0)}for(c=l.length-1;c>=0;c--)l[c].collapsed&&l.splice(c,1);for(c=0;c<I.length;c++){v=s[I[c]];var A=[],L=[],E=[],N={},M=0,T=0,R=0,B=[],U=[];for(x=0;x<v.children.length;x++){(D=v.children[x]).isAssistant?A.push(D.id):-1!=D.tags.indexOf("right-partner")?(D.isPartner=1,D.children=[],L.push(D.id)):-1!=D.tags.indexOf("left-partner")?(D.isPartner=2,D.children=[],E.push(D.id)):-1==D.tags.indexOf("partner")||M%2?-1!=D.tags.indexOf("partner")&&M%2?(D.isPartner=2,D.children=[],E.push(D.id),M++):D.parentPartner?(N[D.parentPartner.id]||(N[D.parentPartner.id]=[]),N[D.parentPartner.id].push(D.id)):A.push(D.id):(D.isPartner=1,D.children=[],L.push(D.id),M++)}v.children=[];var P=[];for(x=0;x<L.length;x++){N[(D=s[L[x]]).id]?v.children.push(D):v.children.splice(0,0,D);for(var F=0;F<D.childrenIds.length;F++)P.push(D.childrenIds[F])}var z=[];for(x=0;x<E.length;x++){N[(D=s[E[x]]).id]?v.children.push(D):v.children.splice(0,0,D);for(F=0;F<D.childrenIds.length;F++)z.push(D.childrenIds[F])}for(x=0;x<z.length;x++){(D=s[z[x]]).collapsed||(D.parentPartner=D.parent,D.parent=v,D.isChildOfPartner=!0,v.children.push(D))}for(x=E.length-1;x>=0;x--)if(N[E[x]])for(f=0;f<N[E[x]].length;f++)v.children.push(s[N[E[x]][f]]),T++,-1==U.indexOf(E[x])&&U.push(E[x]);for(x=0;x<A.length;x++){var D=s[A[x]];v.children.push(D)}for(x=0;x<L.length;x++)if(N[L[x]])for(f=0;f<N[L[x]].length;f++)v.children.push(s[N[L[x]][f]]),R++,-1==B.indexOf(L[x])&&B.push(L[x]);for(x=0;x<P.length;x++){(D=s[P[x]]).collapsed||(D.parentPartner=D.parent,D.parent=v,D.isChildOfPartner=!0,v.children.push(D))}v.partnerSeparation=Math.max(U.length,B.length)*e.partnerChildrenSplitSeparation+e.minPartnerSeparation,A.length||!T||R?A.length||T||!R?A.length||1!=T||1!=R?A.length||T||R?!A.length||T||R?A.length&&(T||R)?v.hasPartners=7:v.hasPartners=1:v.hasPartners=6:v.hasPartners=5:v.hasPartners=4:v.hasPartners=3:v.hasPartners=2}for(c=0;c<w.length;c++){var H=r[(v=s[w[c]]).lcn?v.lcn:"base"];for(x=0;x<v.subLevels;x++){var $=new OrgChart.node(v.id+"_sub_level_index_"+x,v.pid,[],"subLevel");if(OrgChart.manager._initDinamicNode($,v.lcn),m=v.parent)(mt=m.children.indexOf(v))>-1&&(m.children.splice(mt,1),m.children.splice(mt,0,$)),$.children.push(v),$.parent=m,v.parent=$,s[$.id]=$}}for(var j in k){(m=s[j]).hasAssistants=!0;$=new OrgChart.node(m.id+"_split_assitant_0",m.id,["assistant"],"split");null!=m.movex&&($.movex=m.movex),null!=m.movey&&($.movey=m.movey),OrgChart.manager._initDinamicNode($,m.lcn,!0),s[$.id]=$;var q=[];for(x=m.children.length-1;x>=0;x--){(D=m.children[x]).isAssistant?(D.parent=null,m.children.splice(x,1),q.splice(0,0,D.id)):D.isPartner||(D.parent&&S[D.parent.id]&&$&&D.parent.id!=$.id&&(Object.defineProperty(S,$.id,Object.getOwnPropertyDescriptor(S,D.parent.id)),delete S[D.parent.id]),D.parent=$,$.children.unshift(D),m.children.splice(x,1))}if(q.length%2){var Y=s[q[q.length-1]],X=new OrgChart.node(Y.id+"_mirror",m.pid,[],"mirror");OrgChart.manager._initDinamicNode(X,Y.lcn,!0),X.isAssistant=!0,X.w=Y.w,X.h=Y.h,s[X.id]=X,q.splice(q.length-1,0,X.id)}var V=1;for(x=q.length-1;x>=0;x--)if(x%2&&x!=q.length-1){var G=new OrgChart.node(m.id+"_split_assitant_"+V,m.pid,[],"split");OrgChart.manager._initDinamicNode(G,m.lcn,!0),s[G.id]=G,q.splice(x,0,G.id),V++}else x%2&&q.splice(x,0,$.id);for(x=0;x<q.length;x+=3){var W=null;W=0==x?m:s[q[x-2]];var J=s[q[x]],K=s[q[x+1]],Z=s[q[x+2]];J.parent=W,K.parent=W,Z.parent=W,W.children.push(J),W.children.push(K),W.children.push(Z)}}var Q=!1;for(var tt in r){if(0!=(H=r[tt]).layout){Q=!0;break}}var et=OrgChart.events.has("node-layout",t._event_id);if(Q||et){var rt={nodes:s,config:e,action:i,actionParams:n};if(w.length){var it=!1;for(var j in S){var nt=S[j];for(c=0;c<nt.length;c++){if((v=s[nt[c]]).subLevels){it=!0;break}}if(it)break}if(it){var at={},ot={},st={};for(var j in S){nt=S[j];var lt=!1,ht=null;for(c=0;c<nt.length;c++){var ct=nt[c];(null===ht||w.has(ct))&&(ht=s[ct].parent.id,lt||OrgChart.isNEU(s[ct].subLevels)||(lt=s[ct].subLevels>0)),at[ht]||(at[ht]=[]),at[ht].push(ct),lt&&(st[ht]=j,ot[ht]||(ot[ht]=[]),ot[ht].push(ct))}}for(var j in S={},ot)if(ot[j].length>OrgChart.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN){var dt=st[j];for(c=s[dt].children.length-1;c>=0;c--){D=s[dt].children[c];ot[j].has(D.id)&&s[dt].children.splice(c,1)}}for(var j in at)at[j].length>OrgChart.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN&&(S[j]=at[j])}}for(var j in S){for(var gt=m=s[j];gt.isSplit;)gt=s[gt.pid];for(;gt.isSubLevel;)gt=s[gt.pid];if(0!=(H=r[m.lcn?m.lcn:"base"]).layout||et){rt.pnode=m,rt.layout=H.layout,rt.layoutGridColumns=e.layoutGridColumns,rt.childrenIds=S[j],rt.lastChildrenPidIds=S,rt.subLevels=0,rt.layouts=[],OrgChart.events.publish("node-layout",[t,rt]),OrgChart.events.publish("layout",[rt]),rt.layouts.length||rt.layouts.push({layout:rt.layout,childrenIds:rt.childrenIds,subLevels:rt.subLevels,layoutGridColumns:rt.layoutGridColumns});for(var pt=0;pt<rt.layouts.length;pt++){var ut=rt.layouts[pt];for(OrgChart.isNEU(ut.subLevels)&&(ut.subLevels=0),OrgChart.isNEU(ut.layout)&&(ut.layout=H.layout),gt=m=s[j];gt.isSplit;)gt=s[gt.pid];for(;gt.isSubLevel;)gt=s[gt.pid];var ft=m;for(x=0;x<ut.subLevels;x++){$=new OrgChart.node(pt+"_sublevel_layout_"+x,ft.id,[],"subLevel");OrgChart.manager._initDinamicNode($,ft.lcn),$.parent=ft,ft.children.push($),s[$.id]=$,ft=$}if(ut.subLevels){for(x=0;x<ut.childrenIds.length;x++){var mt;D=s[ut.childrenIds[x]];-1!=(mt=m.children.indexOf(D))&&m.children.splice(mt,1),D.parent=ft,ft.children.push(D)}m=ft}if(ut.layout==OrgChart.layout.grid&&ut.childrenIds.length>2){"dynamic"==ut.layoutGridColumns&&(ut.layoutGridColumns=OrgChart._getDynamicGridCoulumns(ut.childrenIds.length));var Ct=m.id;for(c=m.children.length-1;c>=0;c--)for(x=0;x<ut.childrenIds.length;x++){ct=ut.childrenIds[x];if(m.children[c].id==ct){m.children.splice(c,1);break}}var bt=ut.layoutGridColumns;bt%2!=0&&bt>2&&bt--;for(c=0;c<ut.childrenIds.length;c+=bt){var vt=null;for(x=0;x<bt;x++){var Ot=c+bt>=ut.childrenIds.length;if(ut.childrenIds.length-1<c+x)break;(D=s[ct=ut.childrenIds[c+x]]).parent=s[Ct],s[Ct].children.push(D),Ot||(bt/2-1==x&&(vt=new OrgChart.node(ut.childrenIds[c+x-1]+"_grid_pseudo_node_"+ut.childrenIds[c+x+1],Ct,[],"subLevel"),OrgChart.manager._initDinamicNode(vt,m.lcn),vt.parent=s[Ct],s[Ct].children.push(vt),s[vt.id]=vt),bt-1==x&&(Ct=vt.id))}}}if(ut.layout==OrgChart.layout.mixed){var xt=ut.childrenIds;for(c=xt.length-1;c>=0;c--){m=(D=s[xt[c]]).parent,D.layout=OrgChart.layout.mixed;for(x=m.children.length-1;x>=0;x--)if(D.id==m.children[x].id){m.children.splice(x,1);break}if(c>0){var yt=s[xt[c-1]];D.parent=yt,D.layout=OrgChart.layout.mixed,yt.children.push(D)}else m.children.push(D)}}else if(ut.layout>1){$=new OrgChart.node(pt+"_"+m.id+"_split_0",gt.id,[],"split");null!=m.movex&&($.movex=m.movex),null!=m.movey&&($.movey=m.movey),OrgChart.manager._initDinamicNode($,m.lcn),s[$.id]=$,$.layout=ut.layout;var _t=[];for(c=ut.childrenIds.length-1;c>=0;c--){for(D=s[ut.childrenIds[c]],x=0;x<m.children.length;x++)m.children[x].id==D.id&&m.children.splice(x,1);if(D.parent=null,D.layout=ut.layout,ut.layout!=OrgChart.layout.treeRightOffset&&ut.layout!=OrgChart.layout.treeRight||_t.splice(0,0,D.id),ut.layout>2){var kt=new OrgChart.node(pt+"_"+D.id+"_mirror",gt.id,[],"mirror");OrgChart.manager._initDinamicNode(kt,D.lcn),kt.layout=ut.layout,s[kt.id]=kt,_t.splice(0,0,kt.id)}ut.layout!=OrgChart.layout.treeRightOffset&&ut.layout!=OrgChart.layout.treeRight&&_t.splice(0,0,D.id)}for(V=1,x=_t.length-1;x>=0;x--)if(x%2&&x!=_t.length-1){G=new OrgChart.node(pt+"_"+m.id+"_split_"+V,gt.id,[],"split");OrgChart.manager._initDinamicNode(G,m.lcn),G.layout=ut.layout,s[G.id]=G,_t.splice(x,0,G.id),V++}else x%2&&_t.splice(x,0,$.id);for(x=0;x<_t.length;x+=3){W=null;0==x&&(W=m);J=s[_t[x]],K=s[_t[x+1]],Z=s[_t[x+2]];0!=x&&(W=s[_t[x-3]]),0==x||K||(W=s[_t[x-2]]),J.parent=W,W.children.push(J),K&&(0!=x&&(W=s[_t[x-2]]),K.parent=W,W.children.push(K)),Z&&(0!=x&&(W=s[_t[x-1]]),Z.parent=W,W.children.push(Z))}}}}}}if(OrgChart.VERTICAL_CHILDREN_ASSISTANT)for(c=0;c<l.length;c++)OrgChart.manager._verticalAssistantIterate(l[c],s);rt={nodes:s,roots:l};return OrgChart.events.publish("nodes-initialized",[t,rt]),{nodes:rt.nodes,roots:rt.roots,rootList:h}},OrgChart.manager._getOrderSortArray=function(t){if("string"==typeof t)return[{field:t,desc:!1}];if(Array.isArray(t)){var e=[];for(var r of t)"string"==typeof r?e.push({field:r,desc:!1}):t instanceof Object?e.push(r):console.error("Unseported orderBy value!");return e}if(t instanceof Object)return[t];console.error("Unseported orderBy value!")},OrgChart.manager._getNodeWidth=function(t,e){switch(e.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:return t.w;case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:return t.h}return 0},OrgChart.manager._isVisible=function(t,e,r,i,n,a,o){var s=0;if("auto"==OrgChart.LAZY_LOADING_FACTOR){var l=a/n*2,h=o/n*2;s=l>h?Math.ceil(l):Math.ceil(h)}else s=OrgChart.LAZY_LOADING_FACTOR/n;if(null!=t.x&&null!=t.y){if(OrgChart._getLazyLoading(e)&&i!==OrgChart.action.exporting){function c(t,e){var r=t.x,i=t.y,n=t.w,a=t.h,o=e[0]-s,l=e[2]+s+e[0],h=e[1]-s,c=e[3]+s+e[1],d=r+n>o&&l>r;return d&&(d=i+a>h&&c>i),d}if(c(t,r))return!0;for(var d=0;d<t.children.length;d++)if(c(t.children[d],r))return!0;return!1}return!0}},OrgChart.manager.getAllFields=function(t){var e=[OrgChart.TAGS];for(var r in t.nodeBinding)e.push(t.nodeBinding[r]);for(r=0;r<t.nodes.length;r++)for(var i in t.nodes[r])i!==OrgChart.ID&&i!==OrgChart.TAGS&&i!==OrgChart.NODES&&i!==OrgChart.PID&&i!==OrgChart.STPID&&"movex"!==i&&"movey"!==i&&(t.nodeBinding[i]||e.has(i)||e.push(i));return e},OrgChart.manager._getMostDeepChild=function(t){if(t){var e=t;return function t(r){r.sl>e.sl&&(e=r);for(var i=0;i<r.children.length;i++)t(r.children[i])}(t),e}},OrgChart.manager._getResponse=function(t,e,r,i,n,a,o,s,l,h,c,d,g,p,u){var f=h[0],m=[],C={top:null,left:null,bottom:null,right:null,minX:null,maxX:null,minY:null,maxY:null},b=[[],[],[]],v=n-o+2*i.padding,O=a-s+2*i.padding,x=OrgChart.getScale(l,t,e,i.scaleInitial,i.scaleMax,i.scaleMin,v,O);if(C.top=s-i.padding,C.left=o-i.padding,C.bottom=a+i.padding-e/x,C.right=n+i.padding-t/x,C.maxX=n,C.minX=o,C.maxY=a,C.minY=s,0==h.length||null==l&&!u&&i.align==OrgChart.CENTER){var y=Math.ceil(t/x),_=Math.ceil(e/x),k=0,w=0;if(y-2*i.padding>=n-o)switch(k=(n+o)/2-y/2,i.orientation){case OrgChart.orientation.right:case OrgChart.orientation.right_top:k=(o-n)/2-y/2}else switch(k=f.x-y/2+OrgChart.manager._getNodeWidth(f,i)/2,i.orientation){case OrgChart.orientation.right:case OrgChart.orientation.right_top:(k=-(y/2-(o-n)/2))<i.padding-y&&(k=i.padding-y);break;case OrgChart.orientation.left:case OrgChart.orientation.bottom_left:case OrgChart.orientation.top_left:case OrgChart.orientation.left_top:(k=-(y/2-(n-o)/2))>-i.padding&&(k=-i.padding)}if(_-2*i.padding>=a-s)switch(w=(a+s)/2-_/2,i.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:w=(s-a)/2-_/2}else switch((w=-(_/2-(a-s)/2))>-i.padding&&(w=-i.padding),i.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:(w=-(_/2-(s-a)/2))<i.padding-_&&(w=i.padding-_);break;case OrgChart.orientation.left:case OrgChart.orientation.right:w=f.y-_/2+OrgChart.manager._getNodeWidth(f,i)/2}l=[k,w,y,_]}else if(null==l&&!u&&i.align==OrgChart.ORIENTATION){y=Math.ceil(t/x),_=Math.ceil(e/x),k=0,w=0;switch(i.orientation){case OrgChart.orientation.top:k=f.x-y/2+OrgChart.manager._getNodeWidth(f,i)/2,w=-i.padding;break;case OrgChart.orientation.bottom:k=f.x-y/2+OrgChart.manager._getNodeWidth(f,i)/2,w=i.padding-_;break;case OrgChart.orientation.left:k=-i.padding,w=f.y-_/2+OrgChart.manager._getNodeWidth(f,i)/2;break;case OrgChart.orientation.right:k=i.padding-y,w=f.y-_/2+OrgChart.manager._getNodeWidth(f,i)/2;break;case OrgChart.orientation.top_left:k=-i.padding,w=-i.padding;break;case OrgChart.orientation.right_top:k=i.padding-y,w=-i.padding;break;case OrgChart.orientation.left_top:k=-i.padding,w=-i.padding;break;case OrgChart.orientation.bottom_left:k=-i.padding,w=i.padding-_}l=[k,w,y,_],i.sticky&&(l[0]<C.left&&l[0]<C.right&&(l[0]=C.left>C.right?C.right:C.left),l[0]>C.right&&l[0]>C.left&&(l[0]=C.left>C.right?C.left:C.right),l[1]<C.top&&l[1]<C.bottom&&(l[1]=C.top>C.bottom?C.bottom:C.top),l[1]>C.bottom&&l[1]>C.top&&(l[1]=C.top>C.bottom?C.top:C.bottom))}if(c==OrgChart.action.centerNode||c==OrgChart.action.maximize){var S=g[d.id];1==d.options.horizontal&&(l[0]=S.x+S.w/2-l[2]/2),1==d.options.vertical&&(l[1]=S.y+S.h/2-l[3]/2),i.sticky&&(l[0]<C.left&&l[0]<C.right&&(l[0]=C.left>C.right?C.right:C.left),l[0]>C.right&&l[0]>C.left&&(l[0]=C.left>C.right?C.left:C.right),l[1]<C.top&&l[1]<C.bottom&&(l[1]=C.top>C.bottom?C.bottom:C.top),l[1]>C.bottom&&l[1]>C.top&&(l[1]=C.top>C.bottom?C.top:C.bottom))}if(i.sticky&&(c==OrgChart.action.insert||c==OrgChart.action.expand||c==OrgChart.action.collapse||c==OrgChart.action.update||c==OrgChart.action.centerNode)){var I=null;if(c==OrgChart.action.insert&&d&&null!=d.insertedNodeId&&null!=d.insertedNodeId)I=g[d.insertedNodeId];else if(c==OrgChart.action.update&&d&&null!=d.visId&&null!=d.visId)I=g[d.visId];else if(c!=OrgChart.action.expand&&c!=OrgChart.action.collapse||!d||null==d.id||null==d.id){if(c==OrgChart.action.centerNode){switch(i.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:d.options.vertical||(I=g[d.id]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:d.options.horizontal||(I=g[d.id])}I&&(I=OrgChart.manager._getMostDeepChild(I,g))}}else I=g[d.id],I=OrgChart.manager._getMostDeepChild(I,g);if(!OrgChart.FIXED_POSITION_ON_CLICK&&I)switch(i.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:var A=I.y+I.h-l[3]+i.padding;l[1]<A&&(l[1]=A);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:A=I.y-i.padding;l[1]>A&&(l[1]=A);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:A=I.x-i.padding;l[0]>A&&(l[0]=A);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:A=I.x+I.w-l[2]+i.padding;l[0]<A&&(l[0]=A)}}for(var L=0;L<h.length;L++)OrgChart.manager._iterate2(h[L],g,i,l,c,d,m,p,r,b,x,t,e);return{animations:b,boundary:C,viewBox:l,visibleNodeIds:m,nodes:g,allFields:OrgChart.manager.getAllFields(i)}},OrgChart.manager._iterate2=function(t,e,r,i,n,a,o,s,l,h,c,d,g){if(OrgChart.manager._isVisible(t,r,i,n,c,d,g)){o.push(t.id);var p=null;if((n==OrgChart.action.expand||n==OrgChart.action.collapse||n==OrgChart.action.maximize)&&s&&s[t.id]&&"expandCollapseToLevel"==a.method){if(p={x:(C=s[t.id]).x,y:C.y},C){p={x:C.x,y:C.y};for(var u=t,f=null;null!=u;)s[u.id]&&s[u.id].collapsed&&(f=u),u=u.parent;f&&f.parent&&(p={x:f.parent.x,y:f.parent.y})}if(b=e[a.id]){for(u=t.parent;null!=u;)u=u.parent;u&&(p={x:b.x+b.w/2-t.w/2,y:b.y+b.h/2-t.h/2})}}else if((n==OrgChart.action.expand||n==OrgChart.action.collapse)&&s&&s[t.id]){if(p={x:(C=s[t.id]).x,y:C.y},"all"==a.ids&&C){p={x:C.x,y:C.y};for(u=t,f=null;null!=u;)s[u.id]&&s[u.id].collapsed&&(f=u),u=u.parent;f&&f.parent&&(p={x:f.parent.x,y:f.parent.y})}if(b=e[a.id]){for(u=t.parent;null!=u&&-1==a.ids.indexOf(t.id)&&-1==a.ids.indexOf(u.id);)u=u.parent;u&&(p={x:b.x+b.w/2-t.w/2,y:b.y+b.h/2-t.h/2})}}else if(n==OrgChart.action.centerNode&&s&&s[t.id]){if(null!=(C=s[t.id]).x&&null!=C.y&&(p={x:C.x,y:C.y}),(m=e[a.id])&&m==t)(u=t.parent)&&u.id==a.id&&(p={x:m.x+m.w/2-t.w/2,y:m.y+m.h/2-t.h/2})}else if(n==OrgChart.action.maximize&&s&&s[t.id]){var m;if(null!=(C=s[t.id]).x&&null!=C.y&&(p={x:C.x,y:C.y}),(m=e[a.id])&&m==t)(u=t.parent)&&u.id==a.id&&(p={x:m.x+m.w/2-t.w/2,y:m.y+m.h/2-t.h/2})}else if(n==OrgChart.action.minimize&&s&&s[t.id]){p={x:(C=s[t.id]).x,y:C.y}}else if(n==OrgChart.action.insert&&a&&a.insertedNodeId==t.id&&t.parent)p={x:t.parent.x,y:t.parent.y};else if(n!=OrgChart.action.update&&n!=OrgChart.action.insert||!s)n!==OrgChart.action.exporting&&n!==OrgChart.action.init&&-1==l.indexOf(t.id)&&(h[0].push(t.id),h[1].push({opacity:0}),h[2].push({opacity:1}));else{var C,b;if((!(C=s[t.id])||OrgChart.isNEU(C.x)&&OrgChart.isNEU(C.y))&&a){if(b=e[a.id]){for(u=b;u&&u.id==t.id;)u=u.parent;u&&(p={x:b.x,y:b.y})}}else C&&(p={x:C.x,y:C.y})}if(null!=p&&null!=p.x&&null!=p.y)if(p.x!=t.x||p.y!=t.y)a&&a.dragNodeIdList&&-1!=a.dragNodeIdList.indexOf(t.id)||(h[0].push(t.id),h[1].push({transform:[1,0,0,1,p.x,p.y]}),h[2].push({transform:[1,0,0,1,t.x,t.y]}))}for(var v=0;v<t.stChildren.length;v++)OrgChart.manager._iterate2(t.stChildren[v],e,r,i,n,a,o,s,l,h,c,d,g);for(v=0;v<t.children.length;v++)OrgChart.manager._iterate2(t.children[v],e,r,i,n,a,o,s,l,h,c,d,g)},OrgChart.manager._addExpandedNodeIdsIterate=function(t,e,r){for(var i=0;i<t.childrenIds.length;i++)r.push(t.childrenIds[i]),OrgChart.manager._addExpandedNodeIdsIterate(e[t.childrenIds[i]],e,r)},OrgChart.manager._setMinMaxXYAdjustifyIterate=function(t,e,r,i,n,a,o,s){t.x+=a.x,t.y+=a.y;for(var l=0;l<t.stChildren.length;l++)OrgChart.manager._setMinMaxXYAdjustifyIterate(t.stChildren[l],t.stChildren[l],r,0,n,a,o,s);t.isPartner?t.sl=i-1:t.sl=i,null==n[e.id]&&(n[e.id]={}),null==n[e.id][t.sl]&&(n[e.id][t.sl]={minX:null,minY:null,maxX:null,maxY:null}),t.layout?(null==s[e.id]&&(s[e.id]={}),null==s[e.id][t.sl]&&(s[e.id][t.sl]=t)):OrgChart._setMinMaxXY(t,n[e.id][t.sl]),null!=t.movex&&(t.x+=t.movex),null!=t.movey&&(t.y+=t.movey),OrgChart._setMinMaxXY(t,r),i++;for(l=0;l<t.children.length;l++)OrgChart.manager._setMinMaxXYAdjustifyIterate(t.children[l],e,r,i,n,a,o,s)},OrgChart.manager._doNotChangePositionOfClickedNodeIfAny=function(t,e,r,i,n,a){if(r!=OrgChart.action.expand&&r!=OrgChart.action.collapse&&r!=OrgChart.action.minimize&&r!=OrgChart.action.maximize&&r!=OrgChart.action.centerNode&&r!=OrgChart.action.update&&r!=OrgChart.action.insert)return{x:0,y:0};if(r==OrgChart.action.update&&(!i||null==i.id)){if(!t||!t.length)return{x:0,y:0};i={id:t[0].id}}if(null==i.id)return{x:0,y:0};var o=i.id;(r==OrgChart.action.minimize&&e[o].parent||r==OrgChart.action.maximize&&e[o].parent)&&(o=e[o].pid);var s=e[o],l=n[o];if(!l)return{x:0,y:0};var h=null!=l.movex?l.movex:0,c=null!=l.movey?l.movey:0;return{x:(l.x?l.x-h:0)-s.x,y:(l.y?l.y-c:0)-s.y}},OrgChart.manager._verticalAssistantIterate=function(t,e){for(var r=0;r<t.stChildren.length;r++)OrgChart.manager._verticalAssistantIterate(t.stChildren[r],e);if(3==t.children.length)OrgChart.manager._verticalAssistantIterate(t.children[0],e),OrgChart.manager._verticalAssistantIterate(t.children[2],e),OrgChart.manager._verticalAssistantIterate(t.children[1],e);else for(r=0;r<t.children.length;r++)OrgChart.manager._verticalAssistantIterate(t.children[r],e);if(t.isAssistant&&t.isSplit&&t.children.length){for(var i=t.parent.children[0],n=t.parent.children[2],a=t.parent;!a.hasAssistants;)a=a.parent;var o={max:0},s={max:0};OrgChart.manager._verticalAssistantLevelCountIterate(i,0,o),OrgChart.manager._verticalAssistantLevelCountIterate(n,0,s);var l=Math.max(o.max,s.max),h=[];for(r=0;r<l;r++){var c=new OrgChart.node(t.parent.id+"_split_assitant_level_"+r,t.pid,[],"subLevel");OrgChart.manager._initDinamicNode(c,t.lcn,!0),r>0&&(h[r-1].children.push(c),c.parent=h[r-1]),e[c.id]=c,h.push(c)}if(h.length){for(var d=h[h.length-1],g=h[0],p=t.children.length-1;p>=0;p--){var u=t.children[p];d.children.unshift(u),u.parent=d,t.children.splice(p,1)}t.children.push(g),g.parent=t}}},OrgChart.manager._verticalAssistantLevelCountIterate=function(t,e,r){r.max<e&&(r.max=e),e++;for(var i=0;i<t.children.length;i++)OrgChart.manager._verticalAssistantLevelCountIterate(t.children[i],e,r)},OrgChart._addDottedLines=function(t){var e=t.nodes;if((t.groupDottedLines.length||t.dottedLines.length)&&(e=JSON.parse(JSON.stringify(e))),t.groupDottedLines.length)for(var r=[],i=0;i<t.groupDottedLines.length;i++){var n=t.groupDottedLines[i];null==n.rootId&&(n.rootId=n.to);var a=`balkan_group_dotted_${n.rootId}`;if(!r.has(a))for(var o=0;o<e.length;o++)if(e[o].id==n.rootId){(c=JSON.parse(JSON.stringify(e[o]))).id=`balkan_group_dotted_${n.rootId}_balkan_id_${e[o].id}`,c.pid=void 0,c.stpid=e[o].id,e.push(c),r.push(a),e[o].tags||(e[o].tags=[]),e[o].tags.push("group-dotted-lines"),e[o].tags.push("group-dotted-lines-"+a);break}for(o=0;o<e.length;o++)if(e[o].id==n.from){if((c=JSON.parse(JSON.stringify(e[o]))).id=`balkan_group_dotted_${n.rootId}_balkan_id_${e[o].id}`,c.pid=`balkan_group_dotted_${n.rootId}_balkan_id_${n.to}`,c.tags){var s=c.tags.indexOf("group-dotted-lines");-1!=s&&c.tags.splice(s,1)}if(c.tags||(c.tags=[]),c.tags.push("boc-dotted-connector"),n.tags)for(var l=0;l<n.tags.length;l++)c.tags.push(n.tags[l]);e.push(c);break}}if(t.dottedLines.length)for(i=0;i<t.dottedLines.length;i++){var h=t.dottedLines[i];null==h.rootId&&(h.rootId=h.to);for(o=0;o<e.length;o++)if(e[o].id==h.from){var c;if((c=JSON.parse(JSON.stringify(e[o]))).id=`balkan_dotted_${h.rootId}_balkan_id_${e[o].id}`,h.rootId==h.to?c.pid=h.to:c.pid=`balkan_dotted_${h.rootId}_balkan_id_${h.to}`,c.tags||(c.tags=[]),c.tags.push("boc-dotted-connector"),h.tags)for(l=0;l<h.tags.length;l++)c.tags.push(h.tags[l]);e.push(c);break}}return e},void 0===OrgChart&&(OrgChart={}),OrgChart.templates={},OrgChart.templates.base={defs:"",size:[250,120],expandCollapseSize:30,linkAdjuster:{fromX:0,fromY:0,toX:0,toY:0},ripple:{radius:0,color:"#e6e6e6",rect:null},assistanseLink:'<path stroke-linejoin="round" stroke="#aeaeae" stroke-width="2px" fill="none" d="M{xa},{ya} {xb},{yb} {xc},{yc} {xd},{yd} L{xe},{ye}"/>',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:'<circle cx="15" cy="15" r="15" fill="#ffffff" stroke="#aeaeae" stroke-width="1"></circle><line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#aeaeae"></line><line x1="15" y1="4" x2="15" y2="26" stroke-width="1" stroke="#aeaeae"></line>',minus:'<circle cx="15" cy="15" r="15" fill="#ffffff" stroke="#aeaeae" stroke-width="1"></circle><line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#aeaeae"></line>',nodeMenuButton:'<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,105)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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;" '+OrgChart.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" '+OrgChart.attr.width+'="290" x="0" y="0" style="font-size:10px;">{val}</text>',editFormHeaderColor:"#039BE5"},OrgChart.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 stroke-linejoin="round" stroke="#aeaeae" stroke-width="1px" fill="none" d="{rounded}" />',assistanseLink:'<path stroke-linejoin="round" stroke="#aeaeae" stroke-width="2px" fill="none" d="M{xa},{ya} {xb},{yb} {xc},{yc} {xd},{yd} L{xe},{ye}"/>',node:'<rect x="0" y="0" height="{h}" width="{w}" fill="#039BE5" stroke-width="1" stroke="#aeaeae" rx="7" ry="7"></rect>',plus:'<circle cx="15" cy="15" r="15" class="boc-fill" stroke="#aeaeae" stroke-width="1"></circle><line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#aeaeae"></line><line x1="15" y1="4" x2="15" y2="26" stroke-width="1" stroke="#aeaeae"></line>',minus:'<circle cx="15" cy="15" r="15" class="boc-fill" stroke="#aeaeae" stroke-width="1"></circle><line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#aeaeae"></line>',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:'<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,105)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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:OrgChart.templates.base.menuButton,img_0:'<clipPath id="{randId}"><circle cx="50" cy="30" r="40"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="10" y="-10" width="80" height="80"></image>',link_field_0:'<text text-anchor="middle" fill="#aeaeae" '+OrgChart.attr.width+'="290" x="0" y="0" style="font-size:10px;">{val}</text>',field_0:"<text "+OrgChart.attr.width+'="230" style="font-size: 18px;" fill="#ffffff" x="125" y="95" text-anchor="middle">{val}</text>',field_1:"<text "+OrgChart.attr.width+'="130" '+OrgChart.attr.text_overflow+'="multiline" style="font-size: 14px;" fill="#ffffff" x="230" y="30" text-anchor="end">{val}</text>',padding:[50,20,35,20],editFormHeaderColor:"#039BE5"},OrgChart.templates.split=Object.assign({},OrgChart.templates.ana),OrgChart.templates.split.size=[10,10],OrgChart.templates.split.node='<circle cx="5" cy="5" r="5" fill="none" stroke-width="1" stroke="#aeaeae"></circle>',OrgChart.templates.split.field_0="",OrgChart.templates.split.field_1="",OrgChart.templates.split.img_0="",OrgChart.templates.dot=Object.assign({},OrgChart.templates.split),OrgChart.templates.group=Object.assign({},OrgChart.templates.ana),OrgChart.templates.group.size=[250,120],OrgChart.templates.group.node='<rect rx="50" ry="50" x="0" y="0" height="{h}" width="{w}" fill="#f2f2f2" stroke-width="0"></rect>',OrgChart.templates.group.link='<path stroke="#aeaeae" stroke-width="1px" fill="none" d="M{xa},{ya} C{xb},{yb} {xc},{yc} {xd},{yd}"/>',OrgChart.templates.group.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,{ew},25)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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>',OrgChart.templates.group.field_0="<text "+OrgChart.attr.width+'="230" style="font-size: 18px;" fill="#aeaeae" x="{cw}" y="30" text-anchor="middle">{val}</text>',OrgChart.templates.group.field_1="",OrgChart.templates.group.ripple={radius:50,color:"#aeaeae"},OrgChart.templates.invisibleGroup=Object.assign({},OrgChart.templates.group),OrgChart.templates.invisibleGroup.node="",OrgChart.templates.invisibleGroup.padding=[0,0,0,0],OrgChart.templates.invisibleGroup.field_0="",OrgChart.templates.invisibleGroup.nodeMenuButton="",OrgChart.templates.mirror={linkAdjuster:{},link:"",node:"",nodeMenuButton:"",size:[0,0]},OrgChart.templates.ula=Object.assign({},OrgChart.templates.ana),OrgChart.templates.ula.field_0="<text "+OrgChart.attr.width+'="145" style="font-size: 18px;" fill="#039BE5" x="100" y="55">{val}</text>',OrgChart.templates.ula.field_1="<text "+OrgChart.attr.width+'="145" '+OrgChart.attr.text_overflow+'="multiline" style="font-size: 14px;" fill="#afafaf" x="100" y="76">{val}</text>',OrgChart.templates.ula.node='<rect x="0" y="0" height="{h}" width="{w}" fill="#ffffff" stroke-width="1" stroke="#aeaeae"></rect><line x1="0" y1="0" x2="250" y2="0" stroke-width="2" stroke="#039BE5"></line>',OrgChart.templates.ula.img_0='<clipPath id="{randId}"><circle cx="50" cy="60" r="40"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="10" y="20" width="80" height="80" ></image>',OrgChart.templates.ula.menu='<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,12)" '+OrgChart.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>',OrgChart.templates.ula.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,105)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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>',OrgChart.templates.olivia=Object.assign({},OrgChart.templates.ana),OrgChart.templates.olivia.defs='<style>\n #olivia_gradient {\n --color-stop-1: #ffffff;\n --color-stop-2: #eeeeee;\n --opacity-stop: 1;\n }\n .olivia-f0{\n font-size: 18px;\n fill: #757575;\n }\n .olivia-f1{\n font-size: 14px;\n fill: #757575;\n }\n .boc-dark .olivia-f0,.boc-dark .olivia-f1{\n fill: #aeaeae;\n }\n .boc-dark #olivia_gradient {\n --color-stop-1: #646464;\n --color-stop-2: #363636;\n --opacity-stop: 1;\n }\n </style>\n <linearGradient id="olivia_gradient" x1="0%" y1="0%" x2="0%" y2="100%"><stop offset="0%" stop-color="var(--color-stop-1)" stop-opacity="var(--opacity-stop)"/><stop offset="100%" stop-color="var(--color-stop-2)" stop-opacity="var(--opacity-stop)" /></linearGradient>',OrgChart.templates.olivia.field_0="<text "+OrgChart.attr.width+'="135" class="olivia-f0" x="100" y="55">{val}</text>',OrgChart.templates.olivia.field_1="<text "+OrgChart.attr.width+'="135" class="olivia-f1" x="100" y="76">{val}</text>',OrgChart.templates.olivia.node='<rect fill="url(#olivia_gradient)" x="0" y="0" height="{h}" width="{w}" stroke-width="1" stroke="#aeaeae" rx="7" ry="7"></rect>',OrgChart.templates.olivia.img_0='<clipPath id="{randId}"><circle cx="50" cy="60" r="40"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="10" y="20" width="80" height="80" ></image>',OrgChart.templates.olivia.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,105)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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>',OrgChart.templates.belinda=Object.assign({},OrgChart.templates.ana),OrgChart.templates.belinda.size=[180,180],OrgChart.templates.belinda.ripple={radius:90,color:"#e6e6e6",rect:null},OrgChart.templates.belinda.node='<circle cx="90" cy="90" r="90" fill="#039BE5" stroke-width="1" stroke="#aeaeae"></circle>',OrgChart.templates.belinda.img_0='<clipPath id="{randId}"><circle cx="90" cy="45" r="40"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="50" y="5" width="80" height="80" ></image>',OrgChart.templates.belinda.field_0="<text "+OrgChart.attr.width+'="170" style="font-size: 18px;" text-anchor="middle" fill="#ffffff" x="90" y="105">{val}</text>',OrgChart.templates.belinda.field_1="<text "+OrgChart.attr.width+'="160" style="font-size: 14px;" text-anchor="middle" fill="#ffffff" x="90" y="125">{val}</text>',OrgChart.templates.belinda.link='<path stroke="#aeaeae" stroke-width="1px" fill="none" d="M{xa},{ya} C{xb},{yb} {xc},{yc} {xd},{yd}"/>',OrgChart.templates.belinda.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,79,5)" '+OrgChart.attr.control_node_menu_id+'="{id}"><rect x="0" y="0" fill="#000000" fill-opacity="0" width="22" height="22"></rect><line stroke-width="2" stroke="#000" x1="0" y1="3" x2="22" y2="3"></line><line stroke-width="2" stroke="#000" x1="0" y1="9" x2="22" y2="9"></line><line stroke-width="2" stroke="#000" x1="0" y1="15" x2="22" y2="15"></line></g>',OrgChart.templates.rony=Object.assign({},OrgChart.templates.ana),OrgChart.templates.rony.svg='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="background-color:#E8E8E8;display:block;" width="{w}" height="{h}" viewBox="{viewBox}">{content}</svg>',OrgChart.templates.rony.defs='<filter id="{randId}" x="0" y="0" width="200%" height="200%"><feOffset result="offOut" in="SourceAlpha" dx="5" dy="5"></feOffset><feGaussianBlur result="blurOut" in="offOut" stdDeviation="5"></feGaussianBlur><feBlend in="SourceGraphic" in2="blurOut" mode="normal"></feBlend></filter>',OrgChart.templates.rony.size=[180,250],OrgChart.templates.rony.ripple={color:"#F57C00",radius:5,rect:null},OrgChart.templates.rony.img_0='<clipPath id="{randId}"><circle cx="90" cy="160" r="60"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="30" y="100" width="120" height="120"></image>',OrgChart.templates.rony.node='<rect filter="url(#{randId})" x="0" y="0" height="250" width="180" fill="#ffffff" stroke-width="0" rx="7" ry="7"></rect>',OrgChart.templates.rony.field_0="<text "+OrgChart.attr.width+'="165" style="font-size: 18px;" fill="#039BE5" x="90" y="40" text-anchor="middle">{val}</text>',OrgChart.templates.rony.field_1="<text "+OrgChart.attr.width+'="165" style="font-size: 14px;" fill="#F57C00" x="90" y="60" text-anchor="middle">{val}</text>',OrgChart.templates.rony.field_2="<text "+OrgChart.attr.width+'="165" style="font-size: 14px;" fill="#FFCA28" x="90" y="80" text-anchor="middle">{val}</text>',OrgChart.templates.rony.link='<path stroke="#039BE5" stroke-width="1px" fill="none" d="M{xa},{ya} {xb},{yb} {xc},{yc} L{xd},{yd}"/>',OrgChart.templates.rony.plus='<circle cx="15" cy="15" r="15" fill="#ffffff" stroke="#039BE5" stroke-width="1"></circle><line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#039BE5"></line><line x1="15" y1="4" x2="15" y2="26" stroke-width="1" stroke="#039BE5"></line>',OrgChart.templates.rony.minus='<circle cx="15" cy="15" r="15" fill="#ffffff" stroke="#039BE5" stroke-width="1"></circle><line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#039BE5"></line>',OrgChart.templates.rony.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,155,235)" '+OrgChart.attr.control_node_menu_id+'="{id}"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#F57C00"></circle><circle cx="7" cy="0" r="2" fill="#F57C00"></circle><circle cx="14" cy="0" r="2" fill="#F57C00"></circle></g>',OrgChart.templates.mery=Object.assign({},OrgChart.templates.ana),OrgChart.templates.mery.ripple={color:"#e6e6e6",radius:50,rect:null},OrgChart.templates.mery.node='<rect x="0" y="0" height="120" width="250" fill="#ffffff" stroke-width="1" stroke="#686868" rx="50" ry="50"></rect><rect x="0" y="45" height="30" width="250" fill="#039BE5" stroke-width="1"></rect>',OrgChart.templates.mery.link='<path stroke="#aeaeae" stroke-width="1px" fill="none" d="M{xa},{ya} C{xb},{yb} {xc},{yc} {xd},{yd}" />',OrgChart.templates.mery.img_0='<clipPath id="{randId}"><circle cx="125" cy="60" r="24"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="95" y="33" width="60" height="60"></image>',OrgChart.templates.mery.field_0="<text "+OrgChart.attr.width+'="220" style="font-size: 18px;" fill="#039BE5" x="125" y="30" text-anchor="middle">{val}</text>',OrgChart.templates.mery.field_1="<text "+OrgChart.attr.width+'="220" style="font-size: 14px;" fill="#039BE5" x="125" y="100" text-anchor="middle">{val}</text>',OrgChart.templates.mery.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,60)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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>',OrgChart.templates.polina=Object.assign({},OrgChart.templates.ana),OrgChart.templates.polina.size=[300,80],OrgChart.templates.polina.ripple={color:"#e6e6e6",radius:40,rect:null},OrgChart.templates.polina.node='<rect x="0" y="0" height="80" width="300" fill="#039BE5" stroke-width="1" stroke="#686868" rx="40" ry="40"></rect>',OrgChart.templates.polina.img_0='<clipPath id="{randId}"><circle cx="40" cy="40" r="35"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="0" y="0" width="80" height="80"></image>',OrgChart.templates.polina.field_0="<text "+OrgChart.attr.width+'="210" style="font-size: 18px;" fill="#ffffff" x="80" y="30" text-anchor="start">{val}</text>',OrgChart.templates.polina.field_1="<text "+OrgChart.attr.width+'="210" style="font-size: 14px;" fill="#ffffff" x="80" y="55" text-anchor="start">{val}</text>',OrgChart.templates.polina.link='<path stroke="#686868" stroke-width="1px" fill="none" d="M{xa},{ya} C{xb},{yb} {xc},{yc} {xd},{yd}" />',OrgChart.templates.polina.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,285,33)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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="0" cy="7" r="2" fill="#ffffff"></circle><circle cx="0" cy="14" r="2" fill="#ffffff"></circle></g>',OrgChart.templates.mila=Object.assign({},OrgChart.templates.ana),OrgChart.templates.mila.node='<rect x="0" y="0" height="120" width="250" fill="#039BE5" stroke-width="1" stroke="#aeaeae"></rect><rect x="-5" y="70" height="30" width="260" fill="#ffffff" stroke-width="1" stroke="#039BE5"></rect><line x1="-5" x2="0" y1="100" y2="105" stroke-width="1" stroke="#039BE5"/><line x1="255" x2="250" y1="100" y2="105" stroke-width="1" stroke="#039BE5"/>',OrgChart.templates.mila.img_0='<image preserveAspectRatio="xMidYMid slice" xlink:href="{val}" x="20" y="5" width="64" height="64"></image>',OrgChart.templates.mila.field_0="<text "+OrgChart.attr.width+'="240" style="font-size: 18px;" fill="#039BE5" x="125" y="92" text-anchor="middle">{val}</text>',OrgChart.templates.mila.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,110)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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>',OrgChart.templates.diva=Object.assign({},OrgChart.templates.ana),OrgChart.templates.diva.size=[200,170],OrgChart.templates.diva.node='<rect x="0" y="80" height="90" width="200" fill="#039BE5"></rect><circle cx="100" cy="50" fill="#ffffff" r="50" stroke="#039BE5" stroke-width="2"></circle>',OrgChart.templates.diva.img_0='<clipPath id="{randId}"><circle cx="100" cy="50" r="45"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="50" y="0" width="100" height="100"></image>',OrgChart.templates.diva.field_0="<text "+OrgChart.attr.width+'="185" style="font-size: 18px;" fill="#ffffff" x="100" y="125" text-anchor="middle">{val}</text>',OrgChart.templates.diva.field_1="<text "+OrgChart.attr.width+'="185" style="font-size: 14px;" fill="#ffffff" x="100" y="145" text-anchor="middle">{val}</text>',OrgChart.templates.diva.pointer='<g data-pointer="pointer" transform="matrix(0,0,0,0,100,100)"><radialGradient id="pointerGradient"><stop stop-color="#ffffff" offset="0" /><stop stop-color="#039BE5" offset="1" /></radialGradient><circle cx="16" cy="16" r="16" stroke-width="1" stroke="#acacac" fill="url(#pointerGradient)"></circle></g>',OrgChart.templates.diva.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,175,155)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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>',OrgChart.templates.luba=Object.assign({},OrgChart.templates.ana),OrgChart.templates.luba.svg='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:block;background-color: #2E2E2E;" width="{w}" height="{h}" viewBox="{viewBox}">{content}</svg>',OrgChart.templates.luba.defs='<linearGradient id="{randId}" x1="0%" y1="0%" x2="0%" y2="100%"><stop offset="0%" style="stop-color:#646464;stop-opacity:1" /><stop offset="100%" style="stop-color:#363636;stop-opacity:1" /></linearGradient>',OrgChart.templates.luba.node='<rect fill="url(#{randId})" x="0" y="0" height="120" width="250" stroke-width="1" stroke="#aeaeae" rx="7" ry="7"></rect>',OrgChart.templates.luba.img_0='<clipPath id="{randId}"><circle cx="50" cy="25" r="40"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="10" y="-15" width="80" height="80"></image>',OrgChart.templates.luba.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,105)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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>',OrgChart.templates.luba.field_0="<text "+OrgChart.attr.width+'="235" style="font-size: 18px;" fill="#aeaeae" x="125" y="90" text-anchor="middle">{val}</text>',OrgChart.templates.luba.field_1="<text "+OrgChart.attr.width+'="140" style="font-size: 14px;" fill="#aeaeae" x="240" y="30" text-anchor="end">{val}</text>',OrgChart.templates.luba.plus='<rect x="0" y="0" width="36" height="36" rx="12" ry="12" fill="#2E2E2E" stroke="#aeaeae" stroke-width="1"></rect><line x1="4" y1="18" x2="32" y2="18" stroke-width="1" stroke="#aeaeae"></line><line x1="18" y1="4" x2="18" y2="32" stroke-width="1" stroke="#aeaeae"></line>',OrgChart.templates.luba.minus='<rect x="0" y="0" width="36" height="36" rx="12" ry="12" fill="#2E2E2E" stroke="#aeaeae" stroke-width="1"></rect><line x1="4" y1="18" x2="32" y2="18" stroke-width="1" stroke="#aeaeae"></line>',OrgChart.templates.luba.expandCollapseSize=36,OrgChart.templates.isla=Object.assign({},OrgChart.templates.ana),OrgChart.templates.isla.defs='<filter x="-50%" y="-50%" width="200%" height="200%" filterUnits="objectBoundingBox" id="isla-shadow"><feOffset dx="0" dy="4" in="SourceAlpha" result="shadowOffsetOuter1" /><feGaussianBlur stdDeviation="10" in="shadowOffsetOuter1" result="shadowBlurOuter1" /><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0" in="shadowBlurOuter1" type="matrix" result="shadowMatrixOuter1" /><feMerge><feMergeNode in="shadowMatrixOuter1" /><feMergeNode in="SourceGraphic" /></feMerge></filter>',OrgChart.templates.isla.size=[180,120],OrgChart.templates.isla.node='<rect filter="url(#isla-shadow)" x="0" y="20" rx="7" ry="7" height="100" width="180" fill="#FFF" stroke-width="1" stroke="#039BE5" ></rect><rect x="25" y="75" rx="10" ry="10" height="20" width="130" fill="#039BE5" stroke-width="3" stroke="#039BE5"></rect><rect fill="#ffffff" stroke="#039BE5" stroke-width="1" x="70" y="0" rx="13" ry="13" width="40" height="40"></rect><circle stroke="#FFCA28" stroke-width="3" fill="none" cx="90" cy="12" r="8"></circle><path d="M75,34 C75,17 105,17 105,34" stroke="#FFCA28" stroke-width="3" fill="none"></path>',OrgChart.templates.isla.field_0="<text "+OrgChart.attr.width+'="120" style="font-size: 12px;" fill="#fff" x="90" y="90" text-anchor="middle">{val}</text>',OrgChart.templates.isla.field_1="<text "+OrgChart.attr.width+'="160" style="font-size: 13px;" fill="#039BE5" x="90" y="64" text-anchor="middle">{val}</text>',OrgChart.templates.isla.img_0='<clipPath id="{randId}"><rect filter="url(#isla-shadow)" fill="#ffffff" stroke="#039BE5" stroke-width="1" x="70" y="0" rx="13" ry="13" width="40" height="40"></rect></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="70" y="0" width="40" height="40"></image>',OrgChart.templates.isla.minus='<circle cx="15" cy="15" r="15" fill="#F57C00" stroke="#F57C00" stroke-width="1"></circle><line x1="8" y1="15" x2="22" y2="15" stroke-width="1" stroke="#ffffff"></line>',OrgChart.templates.isla.plus='<circle cx="15" cy="15" r="15" fill="#ffffff" stroke="#039BE5" stroke-width="1"></circle><line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#039BE5"></line><line x1="15" y1="4" x2="15" y2="26" stroke-width="1" stroke="#039BE5"></line>',OrgChart.templates.isla.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,83,45)" '+OrgChart.attr.control_node_menu_id+'="{id}"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#F57C00"></circle><circle cx="7" cy="0" r="2" fill="#F57C00"></circle><circle cx="14" cy="0" r="2" fill="#F57C00"></circle></g>',OrgChart.templates.isla.ripple={radius:0,color:"#F57C00",rect:{x:0,y:20,width:180,height:100}},OrgChart.templates.deborah=Object.assign({},OrgChart.templates.polina),OrgChart.templates.deborah.size=[150,150],OrgChart.templates.deborah.node='<rect x="0" y="0" height="150" width="150" fill="#039BE5" stroke-width="1" stroke="#686868" rx="15" ry="15"></rect>',OrgChart.templates.deborah.img_0='<clipPath id="{randId}"><rect fill="#ffffff" stroke="#039BE5" stroke-width="1" x="5" y="5" rx="15" ry="15" width="140" height="140"></rect></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="5" y="5" width="140" height="140"></image><rect x="3" y="5" height="30" width="144" fill="#039BE5" opacity="0.5" rx="3" ry="3"></rect><rect x="3" y="115" height="30" width="144" fill="#039BE5" opacity="0.5" rx="3" ry="3"></rect>',OrgChart.templates.deborah.field_0="<text "+OrgChart.attr.width+'="125" '+OrgChart.attr.text_overflow+'="ellipsis" style="font-size: 18px;" fill="#ffffff" x="15" y="25" text-anchor="start">{val}</text>',OrgChart.templates.deborah.field_1="<text "+OrgChart.attr.width+'="105" '+OrgChart.attr.text_overflow+'="ellipsis" style="font-size: 11px;" fill="#ffffff" x="15" y="135" text-anchor="start">{val}</text>',OrgChart.templates.deborah.nodeMenuButton='<g style="cursor:pointer;" transform="matrix(1,0,0,1,125,130)" '+OrgChart.attr.control_node_menu_id+'="{id}"><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>',OrgChart.templates.subLevel=Object.assign({},OrgChart.templates.base),OrgChart.templates.subLevel.size=[0,0],OrgChart.templates.subLevel.node="",OrgChart.templates.subLevel.plus="",OrgChart.templates.subLevel.minus="",OrgChart.templates.subLevel.nodeMenuButton="",OrgChart.templates.group_dotted_lines=Object.assign({},OrgChart.templates.group),OrgChart.templates.group_dotted_lines.size=[250,120],OrgChart.templates.group_dotted_lines.link='<path stroke-linejoin="round" stroke="#aeaeae" stroke-width="1px" fill="none" d="{rounded}" />',OrgChart.templates.group_dotted_lines.node='<rect rx="5" ry="5" x="0" y="0" height="{h}" width="{w}" fill="#e5e5e5" stroke-width="0"></rect>',OrgChart.templates.group_dotted_lines.nodeGroupDottedCloseButton='<g transform="matrix(1,0,0,1,{ew},0)"><circle cx="0.5" cy="21.5" r="12" fill="#F57C00"></circle>'+OrgChart.icon.close(25,25,"#fff",-13,8)+"</g>",OrgChart.templates.group_dotted_lines.field_0='<text data-width="230" style="font-size: 18px;" fill="#F57C00" x="20" y="30" text-anchor="start">Dotted Lines</text>',OrgChart.templates.group_dotted_lines.field_1="",OrgChart.templates.group_dotted_lines.img_0="",OrgChart.templates.group_dotted_lines.ripple.radius=5,OrgChart.templates.group_dotted_lines.min=Object.assign({},OrgChart.templates.olivia),OrgChart.templates.group_dotted_lines.min.nodeGroupDottedOpenButton='<g transform="matrix(1,0,0,1,220,10)"><rect x="0" y="0" width="22" height="22" stroke="#aeaeae" stroke-width="1" fill="#ffffff" rx="5" ry="5"></rect><text x="11" y="16" text-anchor="middle" style="font-size: 14px;" fill="#2A292E">{children-total-count}</text><rect x="0" y="0" width="22" height="22" style="opacity: 0" stroke="#aeaeae" stroke-width="1" fill="red" rx="5" ry="5"></rect></g>',OrgChart.ui={_defsIds:{},defs:function(t){var e="";for(var r in OrgChart.templates){var i=OrgChart.templates[r];i.defs&&(OrgChart.ui._defsIds[r]=OrgChart.randomId(),e+=i.defs.replaceAll("{randId}",OrgChart.ui._defsIds[r]))}return"<defs>"+e+t+"</defs>"},lonely:function(t){return t.nodes&&t.nodes.length?"":OrgChart.IT_IS_LONELY_HERE.replace("{link}",OrgChart.RES.IT_IS_LONELY_HERE_LINK)},pointer:function(t,e,r){if(e===OrgChart.action.exporting)return"";var i=OrgChart.t(t.template,!1,r),n=i.pointer;return n||(n=""),i.pointer},aiButton:function(t){return t.enableAI?'<div data-boc-ai-button class="boc-ai-button">AI</div>':""},node:function(t,e,r,i,n,a,o,s,l,h){var c=OrgChart.t(t.templateName,t.min,l),d=c.node.replaceAll("{w}",t.w).replaceAll("{h}",t.h);c.defs&&(d=d.replaceAll("{randId}",OrgChart.ui._defsIds[t.templateName])),null==o&&(o=i.nodeBinding);var g={node:t,data:e};for(var p in o){var u,f=o[p];e&&(u=e[f]);var m=OrgChart._lblIsImg(i,p);if(g.value=u,g.element=c[p],g.name=f,g.field=p,!1!==OrgChart.events.publish("field",[h,g])&&null!=g.value&&null!=g.value&&null!=g.element&&(!m||m&&!OrgChart.isNEU(g.value))){if(!m&&"string"==typeof g.value){var C=g.element;C&&(C=C.replaceAll("{ew}",t.w-(t.padding?t.padding[1]:0)).replaceAll("{cw}",t.w/2)),g.value=OrgChart.wrapText(g.value,C)}var b=g.element.replace("{val}",g.value);d+=b=b.replaceAll("{ew}",t.w-(t.padding?t.padding[1]:0)).replaceAll("{cw}",t.w/2).replaceAll("{randId}",OrgChart.randomId()).replaceAll("{randId2}",OrgChart.randomId())}}var v=OrgChart._getPosition(r,t,n,a),O="node";Array.isArray(t.tags)&&t.tags.length&&(O+=" "+t.tags.join(" ")),t.layout&&(O+=" tree-layout");var x="";t.lcn&&(x='lcn="'+t.lcn+'"');var y=OrgChart.nodeOpenTag.replace("{lcn}",x).replace("{id}",t.id).replace("{class}",O).replace("{sl}",t.sl).replace("{level}",t.level).replace("{x}",v.x).replace("{y}",v.y),_=OrgChart._getOpacity(r,t);return d=(y=y.replace("{opacity}",_))+(d+=OrgChart.ui.nodeBtns(i,t,s,c,h))+OrgChart.grCloseTag},nodeBtns:function(t,e,r,i,n){var a="";return null==t.nodeMenu||e.isSplit||r===OrgChart.action.exporting||(a+=i.nodeMenuButton.replace("{id}",e.id).replace("{cw}",e.w/2).replace("{ch}",e.h/2).replace("{ew}",e.w-(e.padding?e.padding[1]:0)).replace("{eh}",e.h-(e.padding?e.padding[2]:0))),null==t.nodeCircleMenu||e.isSplit||r===OrgChart.action.exporting||OrgChart.isNEU(i.nodeCircleMenuButton)||(a+='<g style="cursor:pointer;" transform="matrix(1,0,0,1,'+i.nodeCircleMenuButton.x+","+i.nodeCircleMenuButton.y+')" '+OrgChart.attr.control_node_circle_menu_id+'="'+e.id+'"><circle cx="0" cy="0" fill="'+i.nodeCircleMenuButton.color+'" r="'+i.nodeCircleMenuButton.radius+'" stroke-width="1" stroke="'+i.nodeCircleMenuButton.stroke+'"></circle><line x1="-'+i.nodeCircleMenuButton.radius/2+'" y1="-6" x2="'+i.nodeCircleMenuButton.radius/2+'" y2="-6" stroke-width="2" stroke="'+i.nodeCircleMenuButton.stroke+'"></line><line x1="-'+i.nodeCircleMenuButton.radius/2+'" y1="0" x2="'+i.nodeCircleMenuButton.radius/2+'" y2="0" stroke-width="2" stroke="'+i.nodeCircleMenuButton.stroke+'"></line><line x1="-'+i.nodeCircleMenuButton.radius/2+'" y1="6" x2="'+i.nodeCircleMenuButton.radius/2+'" y2="6" stroke-width="2" stroke="'+i.nodeCircleMenuButton.stroke+'"></line></g>'),a},expandCollapseBtn:function(t,e,r,i,n){var a="";if(i!==OrgChart.action.exporting&&!e.isSplit){var o=r[e.lcn?e.lcn:"base"],s=0,l=0,h=OrgChart.t(e.templateName,e.min,n);if(e.childrenIds.length>0){if(e.hasPartners){for(var c=!1,d=0;d<e.childrenIds.length;d++){var g=t.getNode(e.childrenIds[d]);!g||g.parentPartner||g.isPartner||(c=!0)}if(!c)return""}switch(o.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:s=e.x+e.w/2,l=e.y+e.h;break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:s=e.x+e.w/2,l=e.y;break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:s=e.x,l=e.y+e.h/2;break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:s=e.x+e.w,l=e.y+e.h/2}if(s-=h.expandCollapseSize/2,l-=h.expandCollapseSize/2,t.getCollapsedIds(e).length?(a+=OrgChart.expcollOpenTag.replace("{id}",e.id).replace("{x}",s).replace("{y}",l),a+=h.plus,a+=OrgChart.grCloseTag):(a+=OrgChart.expcollOpenTag.replace("{id}",e.id).replace("{x}",s).replace("{y}",l),a+=h.minus,a+=OrgChart.grCloseTag),-1!=a.indexOf("{collapsed-children-count}")){var p=OrgChart.collapsedChildrenCount(t,e);a=a.replace("{collapsed-children-count}",p)}if(-1!=a.indexOf("{collapsed-children-total-count}")){var u=OrgChart.collapsedChildrenTotalCount(t,e);a=a.replace("{collapsed-children-total-count}",u)}if(-1!=a.indexOf("{children-count}")){var f=OrgChart.childrenCount(t,e);a=a.replace("{children-count}",f)}if(-1!=a.indexOf("{children-total-count}")){var m=OrgChart.childrenTotalCount(t,e);a=a.replace("{children-total-count}",m)}}t._nodeHasHiddenParent(e)&&(a+=OrgChart.upOpenTag.replace("{id}",e.id).replace("{x}",e.x).replace("{y}",e.y),a+=h.up,a+=OrgChart.grCloseTag)}var C={html:a,node:e};return OrgChart.events.publish("renderbuttons",[t,C]),C.html},link:function(t,e,r,i,n,a,o){var s=t.lcn?t.lcn:"base",l=e._layoutConfigs[s],h=OrgChart.t(t.templateName,t.min,r),c=[],d=[],g=l.levelSeparation/2;t.layout>0&&(g=l.mixedHierarchyNodesSeparation/2);var p=0,u=OrgChart.getRootOf(t).id,f=i[u][t.sl],m=void 0;if(t.hasPartners){m={ids:[],indexes:{},ppnodes:{},lastLeft:null,firstRight:null,maxSidePartnersWithChildren:0,rightIds:[],leftIds:[],partnerChildrenSplitSeparation:e.config.partnerChildrenSplitSeparation};for(var C=0;C<t.children.length;C++){(v=t.children[C]).parentPartner?(m.ppnodes[v.id]=v.parentPartner,m.ids.push(v.id),1==v.parentPartner.isPartner?(-1==m.rightIds.indexOf(v.parentPartner.id)&&m.rightIds.push(v.parentPartner.id),m.indexes[v.id]=m.rightIds.indexOf(v.parentPartner.id),m.firstRight||(m.firstRight=v)):2==v.parentPartner.isPartner&&(-1==m.leftIds.indexOf(v.parentPartner.id)&&m.leftIds.push(v.parentPartner.id),m.indexes[v.id]=m.leftIds.indexOf(v.parentPartner.id),m.lastLeft=v)):v.isPartner||(m.lastLeft=v,m.firstRight||(m.firstRight=v))}m.maxSidePartnersWithChildren=Math.max(m.leftIds.length,m.rightIds.length),p=0==m.maxSidePartnersWithChildren?e.config.minPartnerSeparation/2:e.config.minPartnerSeparation/2+m.partnerChildrenSplitSeparation*m.maxSidePartnersWithChildren+m.partnerChildrenSplitSeparation/2}for(C=0;C<t.children.length;C++){var b,v=t.children[C],O=i[u][v.sl],x={xa:0,ya:0,xb:0,yb:0,xc:0,yc:0,xd:0,yd:0,x:0,y:0,rotate:0},y=(h=OrgChart.t(v.templateName,v.min,r)).link;if(v.isChildOfPartner)switch(l.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:var _=1==v.layout?void 0:O.minY-(O.minY-f.maxY)/2;x=OrgChart.ui._linkTopToBottom(v.parentPartner,v,h,g,_);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:_=1==v.layout?void 0:O.maxY-(O.maxY-f.minY)/2;x=OrgChart.ui._linkBottomToTop(v.parentPartner,v,h,g,_);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:_=1==v.layout?void 0:O.maxX-(O.maxX-f.minX)/2;x=OrgChart.ui._linkRightToLeft(v.parentPartner,v,h,g,_);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:_=1==v.layout?void 0:O.minX-(O.minX-f.maxX)/2;x=OrgChart.ui._linkLeftToRight(v.parentPartner,v,h,g,_)}else if(m&&-1!=m.ids.indexOf(v.id))switch(l.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:x=OrgChart.ui._linkPpTop(m,t,v,O,f,h);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:x=OrgChart.ui._linkPpBottom(m,t,v,O,f,h);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:x=OrgChart.ui._linkPpRight(m,t,v,O,f,h);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:x=OrgChart.ui._linkPpLeft(m,t,v,O,f,h)}else{var k=v.isAssistant&&v.rightNeighbor&&v.rightNeighbor.isAssistant&&v.parent==v.rightNeighbor.parent,w=v.isAssistant&&v.leftNeighbor&&v.leftNeighbor.isAssistant&&v.parent==v.leftNeighbor.parent;if((k||v.layout>1)&&v.rightNeighbor&&v.rightNeighbor.isSplit)switch(l.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:x=OrgChart.ui._linkRightToLeft(v.rightNeighbor,v,h,g);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:x=OrgChart.ui._linkBottomToTop(v.rightNeighbor,v,h,g)}else if((w||v.layout>1)&&v.leftNeighbor&&v.leftNeighbor.isSplit)switch(l.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:x=OrgChart.ui._linkLeftToRight(v.leftNeighbor,v,h,g);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:x=OrgChart.ui._linkTopToBottom(v.leftNeighbor,v,h,g)}else switch(l.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:if(1==v.isPartner)x=OrgChart.ui._linkLeftToRight(t,v,h,p);else if(2==v.isPartner)x=OrgChart.ui._linkRightToLeft(t,v,h,p);else{_=1==v.layout?void 0:O.minY-(O.minY-f.maxY)/2;x=OrgChart.ui._linkTopToBottom(t,v,h,g,_)}break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:if(1==v.isPartner)x=OrgChart.ui._linkLeftToRight(t,v,h,p);else if(2==v.isPartner)x=OrgChart.ui._linkRightToLeft(t,v,h,p);else{_=1==v.layout?void 0:O.maxY-(O.maxY-f.minY)/2;x=OrgChart.ui._linkBottomToTop(t,v,h,g,_)}break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:if(1==v.isPartner)x=OrgChart.ui._linkTopToBottom(t,v,h,p);else if(2==v.isPartner)x=OrgChart.ui._linkBottomToTop(t,v,h,p);else{_=1==v.layout?void 0:O.maxX-(O.maxX-f.minX)/2;x=OrgChart.ui._linkRightToLeft(t,v,h,g,_)}break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:if(1==v.isPartner)x=OrgChart.ui._linkTopToBottom(t,v,h,p);else if(2==v.isPartner)x=OrgChart.ui._linkBottomToTop(t,v,h,p);else{_=1==v.layout?void 0:O.minX-(O.minX-f.maxX)/2;x=OrgChart.ui._linkLeftToRight(t,v,h,g,_)}}}var S=OrgChart.ui._draggableLinkPath(e,t,v,x,g,l.orientation);if(S)b=S,y=y.replaceAll("{rounded}",S).replaceAll("{edge}",S).replaceAll("{curve}",b);else if(-1!=y.indexOf("{rounded}"))if(x.xa==x.xb&&x.xa==x.xc&&x.xa==x.xd||x.ya==x.yb&&x.ya==x.yc&&x.ya==x.yd)b="M"+x.xa+","+x.ya+" L"+x.xd+","+x.yd,y=y.replaceAll("{rounded}",b);else if(Math.abs(x.xa-x.xd)<=OrgChart.LINK_ROUNDED_CORNERS&&Math.abs(x.xa-x.xc)<=OrgChart.LINK_ROUNDED_CORNERS&&Math.abs(x.xa-x.xb)<=OrgChart.LINK_ROUNDED_CORNERS)b="M"+x.xa+","+x.ya+" L"+x.xa+","+x.yd,y=y.replaceAll("{rounded}",b);else if(Math.abs(x.ya-x.yd)<=OrgChart.LINK_ROUNDED_CORNERS&&Math.abs(x.ya-x.yc)<=OrgChart.LINK_ROUNDED_CORNERS&&Math.abs(x.ya-x.yb)<=OrgChart.LINK_ROUNDED_CORNERS)b="M"+x.xa+","+x.ya+" L"+x.xd+","+x.ya,y=y.replaceAll("{rounded}",b);else{var I=OrgChart.ui._roundedEdge(x.xa,x.ya,x.xb,x.yb,x.xc,x.yc),A=OrgChart.ui._roundedEdge(x.xb,x.yb,x.xc,x.yc,x.xd,x.yd);b="M"+I.x1+","+I.y1+" "+I.x2+","+I.y2+" Q"+I.qx1+","+I.qy1+" "+I.qx2+","+I.qy2+" L"+A.x2+","+A.y2+" Q"+A.qx1+","+A.qy1+" "+A.qx2+","+A.qy2+" L"+A.x3+","+A.y3,y=y.replaceAll("{rounded}",b)}else-1!=y.indexOf("{edge}")?(b="M"+x.xa+","+x.ya+" "+x.xb+","+x.yb+" "+x.xc+","+x.yc+" L"+x.xd+","+x.yd,y=y.replaceAll("{edge}",b)):-1!=y.indexOf("{curve}")?(b="M"+x.xa+","+x.ya+" C"+x.xb+","+x.yb+" "+x.xc+","+x.yc+" "+x.xd+","+x.yd,y=y.replaceAll("{curve}",b)):(b=y.replaceAll("{xa}",x.xa).replaceAll("{ya}",x.ya).replaceAll("{xb}",x.xb).replaceAll("{yb}",x.yb).replaceAll("{xc}",x.xc).replaceAll("{yc}",x.yc).replaceAll("{xd}",x.xd).replaceAll("{yd}",x.yd),y=b);c.push(OrgChart.linkOpenTag.replaceAll("{id}",t.id).replaceAll("{class}","link "+v.tags.join(" ")).replaceAll("{child-id}",v.id));var L={node:t,cnode:v,p:x,html:y,action:a};OrgChart.events.publish("render-link",[e,L]),c.push(L.html),o&&d.push({id:t.id,childId:v.id,html:L.html});var E="";for(var N in e.config.linkBinding){var M=e.config.linkBinding[N],T=e._get(v.id);if(T){var R=T[M];L.value=R,L.element=h[N],L.name=M,!1!==OrgChart.events.publish("label",[e,L])&&(OrgChart.isNEU(L.value)||OrgChart.isNEU(L.element)||(E+=L.element.replace("{val}",L.value)))}}if(""!=E){var B=x.x,U=x.y;null!=v.movey&&(U+=v.movey),E=OrgChart.linkFieldsOpenTag.replace("{x}",B).replace("{y}",U).replace("{rotate}",0)+E+OrgChart.grCloseTag,c.push(E)}c.push(OrgChart.grCloseTag)}return o?d:c.join("")},svg:function(t,e,r,i,n,a){return OrgChart.t(i.template,!1,a).svg.replace("{w}",t).replace("{h}",e).replace("{viewBox}",r).replace("{randId}",OrgChart.ui._defsIds[i.template]).replace("{mode}",i.mode).replace("{template}",i.template).replace("{content}",(function(){return n}))},menuButton:function(t){return null==t.menu?"":OrgChart.t(t.template,!1).menuButton.replaceAll("{p}",t.padding)},_roundedEdge:function(t,e,r,i,n,a){var o,s,l,h=OrgChart.LINK_ROUNDED_CORNERS,c=0;return t==r&&t==n||e==i&&e==a?(o=l=r,s=c=i):(t!=n&&r==n&&(o=l=r,s=i,e<a?c=i+h:e>a&&(c=i-h)),t<n&&r==n?r-=h:t>n&&r==n&&(r+=h),e!=a&&i==a&&(o=r,s=c=i,t<n?l=r+h:t>n&&(l=r-h)),e<a&&i==a?i-=h:e>a&&i==a&&(i+=h)),{x1:t,y1:e,x2:r,y2:i,x3:n,y3:a,qx1:o,qy1:s,qx2:l,qy2:c}},_linkTopToBottom:function(t,e,r,i,n){var a,o,s,l,h,c=0;return a=t.x+t.w/2+r.linkAdjuster.toX,o=t.y+t.h+r.linkAdjuster.toY,l=s=e.x+e.w/2+r.linkAdjuster.fromX,h=e.y+r.linkAdjuster.fromY,{xa:a,ya:o,xb:a,yb:c=t.rightNeighbor&&t.rightNeighbor.isAssistant&&"split"==e.templateName?t.rightNeighbor.y+t.rightNeighbor.h+i:"split"==t.templateName&&(e.isAssistant||e.layout>1)?h:"split"==e.templateName?o+i:null!=n?n:h-i,xc:s,yc:c,xd:l,yd:h,x:s,y:OrgChart.isNEU(e.parentPartner)?c+16:c,rotate:0}},_linkBottomToTop:function(t,e,r,i,n){var a,o,s,l,h,c=0;return a=t.x+t.w/2+r.linkAdjuster.toX,o=t.y+r.linkAdjuster.toY,l=s=e.x+e.w/2+r.linkAdjuster.fromX,h=e.y+e.h+r.linkAdjuster.fromY,{xa:a,ya:o,xb:a,yb:c=t.rightNeighbor&&t.rightNeighbor.isAssistant&&"split"==e.templateName?t.rightNeighbor.y-i:"split"==t.templateName&&(e.isAssistant||e.layout>1)?h:"split"==e.templateName?o-i:null!=n?n:h+i,xc:s,yc:c,xd:l,yd:h,x:s,y:c-14,rotate:0}},_linkRightToLeft:function(t,e,r,i,n){var a,o,s,l,h,c,d=0;return a=t.x+r.linkAdjuster.toX,o=t.y+t.h/2+r.linkAdjuster.toY,h=e.x+e.w+r.linkAdjuster.fromX,c=l=e.y+e.h/2+r.linkAdjuster.fromY,s=o,{xa:a,ya:o,xb:d=t.rightNeighbor&&t.rightNeighbor.isAssistant&&"split"==e.templateName?t.rightNeighbor.x-i:"split"==t.templateName&&(e.isAssistant||e.layout>1)?h:"split"==e.templateName?a-i:null!=n?n:h+i,yb:s,xc:d,yc:l,xd:h,yd:c,x:d-16,y:l,rotate:90}},_linkLeftToRight:function(t,e,r,i,n){var a,o,s,l,h,c,d=0;return a=t.x+t.w+r.linkAdjuster.toX,o=t.y+t.h/2+r.linkAdjuster.toY,h=e.x+r.linkAdjuster.fromX,c=l=e.y+e.h/2+r.linkAdjuster.fromY,s=o,{xa:a,ya:o,xb:d=t.rightNeighbor&&t.rightNeighbor.isAssistant&&"split"==e.templateName?t.rightNeighbor.x+t.rightNeighbor.w+i:"split"==t.templateName&&(e.isAssistant||e.layout>1)?h:"split"==e.templateName?a+i:null!=n?n:h-i,yb:s,xc:d,yc:l,xd:h,yd:c,x:d+14,y:l,rotate:270}},_linkPpTop:function(t,e,r,i,n,a){var o=t.ppnodes[r.id],s=o.y+o.h/2,l=i.minY-(i.minY-n.maxY)/2,h=(i.minY-n.maxY)/t.maxSidePartnersWithChildren/4,c=OrgChart.ui.__linkPpBottomTop(t,e,r,l,h,o),d=c.x;return l=c.mid,OrgChart.ui._linkTopToBottom({x:d,y:s,w:0,h:0},r,a,0,l)},_linkPpBottom:function(t,e,r,i,n,a){var o=t.ppnodes[r.id],s=o.y+o.h/2,l=i.maxY-(i.maxY-n.minY)/2,h=(i.maxY-n.minY)/t.maxSidePartnersWithChildren/4,c=OrgChart.ui.__linkPpBottomTop(t,e,r,l,h,o),d=c.x;return l=c.mid,OrgChart.ui._linkBottomToTop({x:d,y:s,w:0,h:0},r,a,0,l)},_linkPpLeft:function(t,e,r,i,n,a){var o=t.ppnodes[r.id],s=i.minX-(i.minX-n.maxX)/2,l=(i.minX-n.maxX)/t.maxSidePartnersWithChildren/4,h=o.x+o.w/2,c=OrgChart.ui.__linkPpLeftRight(t,e,r,s,l,o),d=c.y;return s=c.mid,OrgChart.ui._linkLeftToRight({x:h,y:d,w:0,h:0},r,a,0,s)},_linkPpRight:function(t,e,r,i,n,a){var o=t.ppnodes[r.id],s=i.maxX-(i.maxX-n.minX)/2,l=(i.maxX-n.minX)/t.maxSidePartnersWithChildren/4,h=o.x+o.w/2,c=OrgChart.ui.__linkPpLeftRight(t,e,r,s,l,o),d=c.y;return s=c.mid,OrgChart.ui._linkRightToLeft({x:h,y:d,w:0,h:0},r,a,0,s)},__linkPpBottomTop:function(t,e,r,i,n,a){var o=0;return 1==a.isPartner?(o=a.x-e.partnerSeparation/2+t.indexes[r.id]*t.partnerChildrenSplitSeparation-(t.rightIds.length-1)*t.partnerChildrenSplitSeparation/2,t.lastLeft&&o<t.lastLeft.x+t.lastLeft.w/2?o<r.x+r.w/2?i-=(t.indexes[r.id]+1)*n:i-=(t.rightIds.length-t.indexes[r.id])*n:o<r.x+r.w/2?i+=(t.rightIds.length-t.indexes[r.id])*n:i+=(t.indexes[r.id]+1)*n):2==a.isPartner&&(o=a.x+a.w+e.partnerSeparation/2+t.indexes[r.id]*t.partnerChildrenSplitSeparation-(t.leftIds.length-1)*t.partnerChildrenSplitSeparation/2,t.firstRight&&o>t.firstRight.x+t.firstRight.w/2?o<r.x+r.w/2?i-=(t.indexes[r.id]+1)*n:i-=(t.leftIds.length-t.indexes[r.id])*n:o<r.x+r.w/2?i+=(t.leftIds.length-t.indexes[r.id])*n:i+=(t.indexes[r.id]+1)*n),{x:o,mid:i}},__linkPpLeftRight:function(t,e,r,i,n,a){var o=0;return 1==a.isPartner?(o=a.y-e.partnerSeparation/2+t.indexes[r.id]*t.partnerChildrenSplitSeparation-(t.rightIds.length-1)*t.partnerChildrenSplitSeparation/2,t.lastLeft&&o<t.lastLeft.y+t.lastLeft.h/2?o<r.y+r.h/2?i-=(t.indexes[r.id]+1)*n:i-=(t.rightIds.length-t.indexes[r.id])*n:o<r.y+r.h/2?i+=(t.rightIds.length-t.indexes[r.id])*n:i+=(t.indexes[r.id]+1)*n):2==a.isPartner&&(o=a.y+a.h+e.partnerSeparation/2+t.indexes[r.id]*t.partnerChildrenSplitSeparation-(t.leftIds.length-1)*t.partnerChildrenSplitSeparation/2,t.firstRight&&o>t.firstRight.y+t.firstRight.h/2?o<r.y+r.h/2?i-=(t.indexes[r.id]+1)*n:i-=(t.leftIds.length-t.indexes[r.id])*n:o<r.y+r.h/2?i+=(t.leftIds.length-t.indexes[r.id])*n:i+=(t.indexes[r.id]+1)*n),{y:o,mid:i}},_draggableLinkPath:function(t,e,r,i,n,a){if(r.leftNeighbor&&r.leftNeighbor.isSplit||r.rightNeighbor&&r.rightNeighbor.isSplit)return null;if(r.isPartner)return null;if(r.isAssistant)return null;if(OrgChart._isMoved(r)&&!OrgChart._isMoved(e)){var o=[];switch(a){case OrgChart.orientation.top:case OrgChart.orientation.top_left:if(i.yb+n/2<i.yd)return null;l=i.xa<i.xd?r.x-n/2:r.x+r.w+n/2,h=r.y-n/2;break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:if(i.yb-n/2>i.yd)return null;l=i.xa<i.xd?r.x-n/2:r.x+r.w+n/2,h=r.y+r.h+n/2;break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:if(i.xb-n/2>i.xd)return null;h=i.ya<i.yd?r.y-n/2:r.y+r.h+n/2,l=r.x+r.w+n/2;break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:if(i.xb+n/2<i.xd)return null;h=i.ya<i.yd?r.y-n/2:r.y+r.h+n/2,l=r.x-n/2}switch(a){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:o.push(["M",i.xa,i.ya]),o.push(["L",i.xb,i.yb]),o.push(["L",l,i.yb]),o.push(["L",l,h]),o.push(["L",i.xd,h]),o.push(["L",i.xd,i.yd]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:(o=[]).push(["M",i.xa,i.ya]),o.push(["L",i.xb,i.yb]),o.push(["L",i.xb,h]),o.push(["L",l,h]),o.push(["L",l,i.yd]),o.push(["L",i.xd,i.yd])}return OrgChart.roundPathCorners(o,OrgChart.LINK_ROUNDED_CORNERS,!1)}if(!OrgChart._isMoved(r)&&OrgChart._isMoved(e)){var s=!1;o=[];switch(a){case OrgChart.orientation.top:case OrgChart.orientation.top_left:if(i.ya+n/2>i.yb)s=!0,l=i.xa<i.xd?e.x+e.w+n/2:e.x-n/2,h=e.y+e.h+n;else{if(i.yb+n/2<i.yd)return null;l=i.xa<i.xd?r.x-n/2:r.x+r.w+n/2,h=r.y-n/2}break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:if(i.ya-n/2<i.yb)s=!0,l=i.xa<i.xd?e.x+e.w+n/2:e.x-n/2,h=e.y-n;else{if(i.yb-n/2>i.yd)return null;l=i.xa<i.xd?r.x-n/2:r.x+r.w+n/2,h=r.y+r.h+n/2}break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:if(i.xa-n/2<i.xb)s=!0,h=i.ya<i.yd?e.y+e.h+n/2:e.y-n/2,l=e.x-n;else{if(i.xb-n/2>i.xd)return null;h=i.ya<i.yd?r.y-n/2:r.y+r.h+n/2,l=r.x+r.w+n/2}break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:if(i.xa+n/2>i.xb)s=!0,h=i.ya<i.yd?e.y+e.h+n/2:e.y-n/2,l=e.x+e.w+n;else{if(i.xb+n/2<i.xd)return null;h=i.ya<i.yd?r.y-n/2:r.y+r.h+n/2,l=r.x-n/2}}if(s)switch(a){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:o.push(["M",i.xa,i.ya]),o.push(["L",i.xa,h]),o.push(["L",l,h]),o.push(["L",l,i.yc]),o.push(["L",i.xc,i.yc]),o.push(["L",i.xd,i.yd]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:o.push(["M",i.xa,i.ya]),o.push(["L",l,i.ya]),o.push(["L",l,h]),o.push(["L",i.xc,h]),o.push(["L",i.xc,i.yc]),o.push(["L",i.xd,i.yd])}else switch(a){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:o.push(["M",i.xa,i.ya]),o.push(["L",i.xb,i.yb]),o.push(["L",l,i.yb]),o.push(["L",l,h]),o.push(["L",i.xd,h]),o.push(["L",i.xd,i.yd]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:o.push(["M",i.xa,i.ya]),o.push(["L",i.xb,i.yb]),o.push(["L",i.xb,h]),o.push(["L",l,h]),o.push(["L",l,i.yd]),o.push(["L",i.xd,i.yd])}return OrgChart.roundPathCorners(o,OrgChart.LINK_ROUNDED_CORNERS,!1)}if(OrgChart._isMoved(r)&&OrgChart._isMoved(e)){o=[];switch(a){case OrgChart.orientation.top:case OrgChart.orientation.top_left:if(i.ya+n>i.yd){var l=i.xa<i.xd?e.x+e.w+n/2:e.x-n/2,h=e.y+e.h+n,c=r.y-n;o.push(["M",i.xa,i.ya]),o.push(["L",i.xa,h]),o.push(["L",l,h]),o.push(["L",l,c]),o.push(["L",i.xc,c]),o.push(["L",i.xd,i.yd])}else o.push(["M",i.xa,i.ya]),o.push(["L",i.xa,e.y+e.h+n]),o.push(["L",i.xc,e.y+e.h+n]),o.push(["L",i.xd,i.yd]);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:if(i.ya-n<i.yd){l=i.xa<i.xd?e.x+e.w+n/2:e.x-n/2,h=e.y-n,c=r.y+r.h+n;o.push(["M",i.xa,i.ya]),o.push(["L",i.xa,h]),o.push(["L",l,h]),o.push(["L",l,c]),o.push(["L",i.xc,c]),o.push(["L",i.xd,i.yd])}else o.push(["M",i.xa,i.ya]),o.push(["L",i.xa,e.y-n]),o.push(["L",i.xc,e.y-n]),o.push(["L",i.xd,i.yd]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:if(i.xa-n<i.xd){h=i.ya<i.yd?e.y+e.h+n/2:e.y-n/2,l=e.x-n;var d=r.x+r.w+n;o.push(["M",i.xa,i.ya]),o.push(["L",l,i.ya]),o.push(["L",l,h]),o.push(["L",d,h]),o.push(["L",d,i.yc]),o.push(["L",i.xd,i.yd])}else o.push(["M",i.xa,i.ya]),o.push(["L",e.x-n,i.ya]),o.push(["L",e.x-n,i.yc]),o.push(["L",i.xd,i.yd]);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:if(i.xa+n>i.xd){h=i.ya<i.yd?e.y+e.h+n/2:e.y-n/2,l=e.x+e.w+n,d=r.x-n;o.push(["M",i.xa,i.ya]),o.push(["L",l,i.ya]),o.push(["L",l,h]),o.push(["L",d,h]),o.push(["L",d,i.yc]),o.push(["L",i.xd,i.yd])}else o.push(["M",i.xa,i.ya]),o.push(["L",e.x+e.w+n,i.ya]),o.push(["L",e.x+e.w+n,i.yc]),o.push(["L",i.xd,i.yd])}return OrgChart.roundPathCorners(o,OrgChart.LINK_ROUNDED_CORNERS,!1)}return null}},void 0===OrgChart&&(OrgChart={}),OrgChart._validateConfig=function(t){return!!t||(console.error("config is not defined"),!1)},OrgChart._arrayContains=function(t,e){if(t&&Array.isArray(t))for(var r=t.length;r--;)if(t[r]===e)return!0;return!1},OrgChart._interceptions=function(t,e){if(!t)return[];if(!e)return[];var r=[];if(Array.isArray(t)&&Array.isArray(e))for(var i in t)for(var n in e)t[i]==e[n]&&r.push(t[i]);else if(Array.isArray(t)&&!Array.isArray(e))for(var i in t)for(var n in e)t[i]==n&&r.push(t[i]);else if(!Array.isArray(t)&&Array.isArray(e))for(var i in t)for(var n in e)i==e[n]&&r.push(e[n]);return r},OrgChart._getTags=function(t){return t.tags&&!Array.isArray(t.tags)?t.tags.split(","):t.tags&&Array.isArray(t.tags)?t.tags:[]},OrgChart._centerPointInPercent=function(t,e,r){var i=t.getBoundingClientRect(),n=e-i.left,a=r-i.top;return[n/(i.width/100),a/(i.height/100)]},OrgChart._trim=function(t){return t.replace(/^\s+|\s+$/g,"")},OrgChart._getTransform=function(t){var e=t.getAttribute("transform");return e=e.replace("matrix","").replace("(","").replace(")",""),OrgChart._browser().msie&&(e=e.replace(/ /g,",")),e="["+(e=OrgChart._trim(e))+"]",e=JSON.parse(e)},OrgChart.getScale=function(t,e,r,i,n,a,o,s){var l=1;if(t||i!==OrgChart.match.boundary)if(t||i!==OrgChart.match.width)if(t||i!==OrgChart.match.height)if(t){var h,c;l=(h=e/t[2])>(c=r/t[3])?c:h}else l=i;else l=r/s;else l=e/o;else l=(h=e/o)>(c=r/s)?c:h;return l&&l>n&&(l=n),l&&l<a&&(l=a),l},OrgChart.isObject=function(t){return t&&"object"==typeof t&&!Array.isArray(t)&&null!==t&&t.constructor&&"object"==t.constructor.name.toLowerCase()},OrgChart.fileUploadDialog=function(t){var e=document.createElement("INPUT");e.setAttribute("type","file"),e.style.display="none",e.onchange=function(){var e=this.files[0];t(e)},document.body.appendChild(e),e.click()},OrgChart.mergeDeep=function(t,e){if(OrgChart.isObject(t)&&OrgChart.isObject(e))for(var r in e)OrgChart.isObject(e[r])?(t[r]||Object.assign(t,{[r]:{}}),OrgChart.mergeDeep(t[r],e[r])):Object.assign(t,{[r]:e[r]});return t},OrgChart._lblIsImg=function(t,e){return!(!t.nodeBinding||"string"!=typeof e||-1==e.indexOf("img")||!t.nodeBinding[e])},OrgChart._getFistImgField=function(t){if(t.nodeBinding)for(var e in t.nodeBinding)if(-1!=e.indexOf("img"))return t.nodeBinding[e];return!1},OrgChart._fieldIsImg=function(t,e){if(t.nodeBinding)for(var r in t.nodeBinding)if(t.nodeBinding[r]==e)return OrgChart._lblIsImg(t,r);return!1},OrgChart._guid=function(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},OrgChart.htmlRipple=function(t){var e=document.createElement("style");e.type="text/css",e.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(e);var r,i,n,a=document.createElement("div");a.className="boc-ripple-container",t.addEventListener("mousedown",(function(e){var r,i,n,a,o;return i=document.createElement("span"),n=this.offsetWidth,r=this.getBoundingClientRect(),o=e.pageX-r.left-n/2,a="top:"+(e.pageY-r.top-n/2)+"px; left: "+o+"px; height: "+n+"px; width: "+n+"px;",t.rippleContainer.appendChild(i),i.setAttribute("style",a)})),t.addEventListener("mouseup",(r=function(){for(;this.rippleContainer.firstChild;)this.rippleContainer.removeChild(this.rippleContainer.firstChild)},i=2e3,n=void 0,function(){var t,e;return e=this,t=arguments,clearTimeout(n),n=setTimeout((function(){return r.apply(e,t)}),i)})),t.rippleContainer=a,t.appendChild(a)},OrgChart._moveToBoundaryArea=function(t,e,r,i){var n=e.slice(0);e[0]<r.left&&e[0]<r.right&&(n[0]=r.left>r.right?r.right:r.left),e[0]>r.right&&e[0]>r.left&&(n[0]=r.left>r.right?r.left:r.right),e[1]<r.top&&e[1]<r.bottom&&(n[1]=r.top>r.bottom?r.bottom:r.top),e[1]>r.bottom&&e[1]>r.top&&(n[1]=r.top>r.bottom?r.top:r.bottom),e[0]!==n[0]||e[1]!==n[1]?OrgChart.animate(t,{viewBox:e},{viewBox:n},300,OrgChart.anim.outPow,(function(){i&&i()})):i&&i()},OrgChart.randomId=function(){return"_"+("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4)},OrgChart._getClientXY=function(t){return-1==t.type.indexOf("touch")?{x:t.clientX,y:t.clientY}:t.changedTouches.length?{x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY}:void 0},OrgChart._getClientTouchesXY=function(t,e){return-1!=t.type.indexOf("touch")?t.touches.length<e+1?{x:null,y:null}:{x:t.touches[e].clientX,y:t.touches[e].clientY}:{x:t.clientX,y:t.clientY}},OrgChart._getOffset=function(t,e){t&&(e.x+=t.offsetLeft,e.y+=t.offsetTop,OrgChart._getOffset(t.offsetParent,e))},OrgChart._getTopLeft=function(t){var e={x:0,y:0};return OrgChart._getOffset(t,e),e},OrgChart._getOffsetXY=function(t,e){if(-1==e.type.indexOf("touch"))return{x:e.offsetX,y:e.offsetY};if(e.touches.length){var r=OrgChart._getTopLeft(t);return{x:e.touches[0].pageX-r.x,y:e.touches[0].pageY-r.y}}if(e.changedTouches.length){r=OrgChart._getTopLeft(t);return isNaN(r.x)||isNaN(r.y)?{x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}:{x:e.changedTouches[0].pageX-r.x,y:e.changedTouches[0].pageY-r.y}}},OrgChart._pinchMiddlePointInPercent=function(t,e,r,i){var n=OrgChart._getTopLeft(t),a=i.touches[0].pageX-n.x,o=i.touches[0].pageY-n.y,s=i.touches[1].pageX-n.x,l=i.touches[1].pageY-n.y;return[((a-s)/2+s)/(e/100),((o-l)/2+l)/(r/100)]},OrgChart._browser=function(){var t=!!window.opr&&!!window.opr.addons||!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,e="undefined"!=typeof InstallTrigger,r=/constructor/i.test(window.HTMLElement)||"[object SafariRemoteNotification]"===(!window.safari||void 0!==window.safari&&safari.pushNotification).toString(),i=!!document.documentMode,n=!i&&!!window.StyleMedia,a=!(!window.chrome||!window.chrome.webstore&&!window.chrome.runtime);return{opera:t,firefox:e,safari:r,msie:i,edge:n,chrome:a,blink:(a||t)&&!!window.CSS}},OrgChart._menuPosition=function(t,e,r){var i=t.getBoundingClientRect(),n=r.getBoundingClientRect(),a=e.getBoundingClientRect(),o=i.left-n.left,s=i.top-n.top;return i.top+a.height>n.top+n.height&&(s-=a.height),i.left-a.width<n.left&&(o+=a.width),{x:o,y:s}},OrgChart._getTemplate=function(t,e,r){if(Array.isArray(t))for(var i=0;i<t.length;i++){var n=e[t[i]];if(n&&n.template)return n.template}return r},OrgChart._getMin=function(t,e){if(t.tags&&t.tags.length&&e.tags)for(var r=0;r<t.tags.length;r++){var i=e.tags[t.tags[r]];if(i&&!0===i.min)return!0}return e.min},OrgChart._getSubLevels=function(t,e){if(t&&t.length)for(var r=0;r<t.length;r++){var i=e[t[r]];if(i&&i.subLevels)return i.subLevels}return 0},OrgChart._isHTML=function(t){var e=(new DOMParser).parseFromString(t,"text/html");return Array.from(e.body.childNodes).some((t=>1===t.nodeType))},OrgChart._getTestDiv=function(){var t=document.getElementById("orgchart_js_test_div");return t||((t=document.createElement("div")).id="orgchart_js_test_div",t.style.position="fixed",t.style.top="-10000px",t.style.left="-10000px",document.body.appendChild(t)),t},OrgChart._getLabelSize=function(t){var e=OrgChart._getTestDiv();return e.innerHTML="<svg>"+t+"</svg>",e.querySelector("text").getBoundingClientRect()},OrgChart.wrapText=function(t,e){var r=e.toLowerCase();if(-1==r.indexOf("<text"))return OrgChart._escapeHtml(t);if(-1==r.indexOf(OrgChart.attr.width))return OrgChart._escapeHtml(t);if(-1!=r.indexOf("foreignobject"))return OrgChart._escapeHtml(t);if(-1==e.indexOf(OrgChart.attr.width))return OrgChart._escapeHtml(t);if(OrgChart.ESCAPE_HTML&&"string"==typeof str&&OrgChart._isHTML(t))return OrgChart._escapeHtml(t);if(!OrgChart.ESCAPE_HTML&&OrgChart._isHTML(t))return t;var i=OrgChart._getTestDiv();e=e.replaceAll("{cw}",0),i.innerHTML="<svg>"+e+"</svg>";var n,a,o=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("text")[0],s=parseFloat(o.getAttribute("x")),l=parseFloat(o.getAttribute("y")),h=o.getAttribute("text-anchor"),c=o.getAttribute(OrgChart.attr.width),d=o.getAttribute(OrgChart.attr.text_overflow),g="http://www.w3.org/2000/svg",p=i.getElementsByTagName("svg")[0].getElementsByTagName("text")[0];d||(d="ellipsis");var u=d.split("-");if(u.length>1&&(n=parseInt(d.split("-")[1]),u.length>2&&"ellipsis"==u[2]&&(a=!0)),!c)return OrgChart._escapeHtml(t);if(c=parseFloat(c),s||(s=0),l||(l=0),s||(h="start"),"ellipsis"==d){p.removeChild(p.firstChild),p.textContent=t;for(var f=p.getComputedTextLength(),m=2;f>c;)p.textContent=t.substring(0,t.length-m),p.textContent+="...",f=p.getComputedTextLength(),m++;return m>2?`<title>${OrgChart._escapeHtml(t)}</title>${p.textContent}`:OrgChart._escapeHtml(t)}if(-1!=d.indexOf("multiline")){var C=t.split(" "),b=p.getBBox().height;p.textContent="";var v=document.createElementNS(g,"tspan"),O=document.createTextNode(C[0]);v.setAttributeNS(null,"x",s),v.setAttributeNS(null,"y",l),v.setAttributeNS(null,"text-anchor",h),v.appendChild(O),p.appendChild(v);m=1;for(var x=1,y=!1,_=1;_<C.length;_++){var k=v.firstChild.data.length;if(v.firstChild.data+=" "+C[_],v.getComputedTextLength()>c){if(v.firstChild.data=v.firstChild.data.slice(0,k),x++,n&&x>n){if(a&&p.children.length==n){var w=p.children[n-1].textContent;p.children[n-1].textContent=w.substring(0,w.length-3)+"...",y=!0}break}(v=document.createElementNS(g,"tspan")).setAttributeNS(null,"x",s),v.setAttributeNS(null,"y",l+b*m),v.setAttributeNS(null,"text-anchor",h),O=document.createTextNode(C[_]),v.appendChild(O),p.appendChild(v),m++}}var S="";if(null!=p.innerHTML)S=p.innerHTML,p.innerHTML="";else{var I="";for(_=p.childNodes.length-1;_>=0;_--)I=XMLSerializer().serializeToString(p.childNodes[_])+I,p.removeChild(p.childNodes[_]);S=I}return y?`<title>${OrgChart._escapeHtml(t)}</title>${S}`:S}},OrgChart._downloadFile=function(t,e,r,i,n){var a=new Blob([e],{type:t});if(1==i){var o=URL.createObjectURL(a);window.open(o,"_blank").focus()}else if(navigator.msSaveBlob)navigator.msSaveBlob(a,r);else{var s=document.createElement("a");if(void 0!==s.download){o=URL.createObjectURL(a);s.setAttribute("href",o);var l=r;l.toLowerCase().endsWith(n.toLowerCase())||(l=l+"."+n),s.setAttribute("download",l),s.style.visibility="hidden",document.body.appendChild(s),s.click(),document.body.removeChild(s)}}},OrgChart._getPosition=function(t,e,r,i){var n={x:e.x,y:e.y};if(null!=r&&(n.x=r),null!=i&&(n.y=r),t&&3==t.length){var a=t[0].indexOf(e.id);-1!=a&&null!=t[1][a].transform&&(null==r&&(n.x=t[1][a].transform[4]),null==i&&(n.y=t[1][a].transform[5]))}return n},OrgChart._getOpacity=function(t,e){var r=1;if(t&&3==t.length){var i=t[0].indexOf(e.id);-1!=i&&null!=t[1][i].opacity&&(r=t[1][i].opacity)}return r},OrgChart.t=function(t,e,r){var i=OrgChart.templates[t];null==i&&console.error(`Template "${t}" does not exist!`);var n=null;if(null!=r&&i.scaleLessThen){var a=[];for(var o in i.scaleLessThen){var s=parseFloat(o);r<s&&a.push(s)}if(a.length>0){a.sort((function(t,e){return t-e}));var l=i.scaleLessThen[a[0]];for(var h in l)null==n&&(n=Object.assign({},i)),n[h]=l[h]}}return e?null==n?i.min?i.min:i:n.min?n.min:n:null==n?i:n},OrgChart.setNodeSize=function(t){var e=OrgChart.t(t.templateName,t.min);t.w=e&&e.size?e.size[0]:0,t.h=e&&e.size?e.size[1]:0},OrgChart._imgs2base64=function(t,e,r,i){var n=t.getElementsByTagName(e),a=n.length;0==a&&i();for(var o=0;o<a;o++)!function(){var t=o,e=n[t];OrgChart._getDataUri(e.getAttribute(r),(function(n){n.success&&e.setAttribute(r,n.result),t==a-1&&i()}))}()},OrgChart._getDataUri=function(t,e){if(-1!=t.indexOf("base64"))e({success:!1});else{var r=new XMLHttpRequest;r.open("GET",t),r.responseType="blob",r.onload=function(){200===r.status?i.readAsDataURL(r.response):404===r.status&&e({success:!1,result:r.status})};var i=new FileReader;i.onloadend=function(){e({success:!0,result:i.result})},r.send()}},OrgChart._convertStringToArray=function(t,e){return-1!=OrgChart.ARRAY_FIELDS.indexOf(t)?OrgChart.isNEU(e)?[]:e.split(","):e},OrgChart._convertArrayToString=function(t){return!OrgChart.isNEU(t)&&Array.isArray(t)?t.join():t},OrgChart._csvToArray=function(t,e){e=e||OrgChart.CSV_DELIMITER;for(var r=new RegExp("(\\"+e+'|\\r?\\n|\\r|^)(?:"([^"]*(?:""[^"]*)*)"|([^"\\'+e+"\\r\\n]*))","gi"),i=[[]],n=null;n=r.exec(t);){var a,o=n[1];o.length&&o!==e&&i.push([]),a=n[2]?n[2].replace(new RegExp('""',"g"),'"'):n[3],i[i.length-1].push(a)}return i},OrgChart._json2xml=function(t){for(var e=document.implementation.createDocument("","",null),r=e.createElement("nodes"),i=0;i<t.length;i++){var n=e.createElement("node"),a=t[i];for(var o in a){var s=a[o];n.setAttribute(o,OrgChart._convertArrayToString(s))}r.appendChild(n)}return e.appendChild(r),'<?xml version="1.0" encoding="utf-8" ?>'+(new XMLSerializer).serializeToString(e.documentElement)},OrgChart._xml2json=function(t){for(var e=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("node"),r=[],i=0;i<e.length;i++){for(var n=e[i],a={},o=0;o<n.attributes.length;o++){var s=n.attributes[o];a[s.name]=OrgChart._convertStringToArray(s.name,s.value)}r.push(a)}return r},OrgChart.convertNodesToCsv=function(t){return OrgChart._json2csv(t)},OrgChart._json2csv=function(t){for(var e=[],r=function(t){for(var r="",i=0;i<e.length;i++){var n;(n="reportsTo"==e[i]?null:null==t[e[i]]?"":t[e[i]])instanceof Date&&(n=n.toLocaleString());var a=(n=null===n?"":n.toString()).replace(/"/g,'""'),o=new RegExp('("|;|\n)',"g");a.search(o)>=0&&(a='"'+a+'"'),i>0&&(r+=OrgChart.CSV_DELIMITER),r+=a}return r+"\n"},i="",n=0;n<t.length;n++)for(var a in t[n])OrgChart._arrayContains(e,a)||(e.push(a),i+=a+OrgChart.CSV_DELIMITER);i=i.substring(0,i.length-1),i+="\n";for(n=0;n<t.length;n++)i+=r(t[n]);return i=i.substring(0,i.length-1)},OrgChart.accentFold=function(t){return(t=t.toString().toLowerCase()).replace(/([àáâãäå])|([ç])|([èéêë])|([ìíîï])|([ñ])|([òóôõöø])|([ß])|([ùúûü])|([ÿ])|([æ])/g,(function(t,e,r,i,n,a,o,s,l,h,c){return e?"a":r?"c":i?"e":n?"i":a?"n":o?"o":s?"s":l?"u":h?"y":c?"ae":void 0}))},OrgChart.copy=function(t){if(null===t||"object"!=typeof t||"isActiveClone"in t)return t;if(t instanceof Date)var e=new t.constructor;else e=t.constructor();for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t.isActiveClone=null,e[r]=OrgChart.copy(t[r]),delete t.isActiveClone);return e},OrgChart._getScrollSensitivity=function(){var t=OrgChart._browser();return t.msie&&OrgChart.scroll.ie?OrgChart.scroll.ie:t.edge&&OrgChart.scroll.edge?OrgChart.scroll.edge:t.safari&&OrgChart.scroll.safari?OrgChart.scroll.safari:t.chrome&&OrgChart.scroll.chrome?OrgChart.scroll.chrome:t.firefox&&OrgChart.scroll.firefox?OrgChart.scroll.firefox:t.opera&&OrgChart.scroll.opera?OrgChart.scroll.opera:{smooth:OrgChart.scroll.smooth,speed:OrgChart.scroll.speed}},OrgChart.isMobile=function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},OrgChart.isTrial=function(){return void 0!==OrgChart.remote},OrgChart.childrenCount=function(t,e){for(var r=0,i=0;i<e.childrenIds.length;i++){t.nodes[e.childrenIds[i]]&&r++}return r},OrgChart.childrenTotalCount=function(t,e){for(var r=0,i=0;i<e.childrenIds.length;i++){var n=t.nodes[e.childrenIds[i]];n&&(r++,r+=OrgChart.childrenTotalCount(t,n))}return r},OrgChart.collapsedChildrenCount=function(t,e){for(var r=0,i=0;i<e.childrenIds.length;i++){var n=t.nodes[e.childrenIds[i]];n&&!0===n.collapsed&&r++}return r},OrgChart.collapsedChildrenTotalCount=function(t,e,r){for(var i=0,n=0;n<e.childrenIds.length;n++){var a=t.nodes[e.childrenIds[n]];a&&((r||!0===a.collapsed)&&i++,i+=OrgChart.collapsedChildrenTotalCount(t,a,!0))}return i},OrgChart._setMinMaxXY=function(t,e){(null==e.minX||null!=t.x&&t.x<e.minX)&&(e.minX=t.x),(null==e.minY||null!=t.y&&t.y<e.minY)&&(e.minY=t.y),(null==e.maxX||null!=t.x&&t.x+t.w>e.maxX)&&(e.maxX=t.x+t.w),(null==e.maxY||null!=t.y&&t.y+t.h>e.maxY)&&(e.maxY=t.y+t.h)},OrgChart.getStParentNodes=function(t,e){for(e||(e=[]);t.parent;)t=t.parent;return t.stParent&&(e.push(t.stParent),OrgChart.getStParentNodes(t.stParent,e)),e},OrgChart.getRootOf=function(t){for(;t&&t.parent;)t=t.parent;return t},OrgChart._getViewBox=function(t){var e=null;return t?(e=(e="["+(e=t.getAttribute("viewBox"))+"]").replace(/\ /g,","),e=JSON.parse(e)):null},OrgChart.isNEU=function(t){return null==t||""===t},OrgChart.gradientCircleForDefs=function(t,e,r,i){function n(t,e,r,i){var n=(i-90)*Math.PI/180;return{x:t+r*Math.cos(n),y:e+r*Math.sin(n)}}function a(t,e,r,i,a){var o=n(t,e,r,a),s=n(t,e,r,i),l=a-i<=180?"0":"1";return["M",o.x,o.y,"A",r,r,0,l,0,s.x,s.y].join(" ")}return Array.isArray(e)||(e=[e,e,e,e,e,e]),`<linearGradient id="${t}_linearColors1" x1="0" y1="0" x2="1" y2="1">\n <stop offset="0%" stop-color="${e[0]}"></stop>\n <stop offset="100%" stop-color="${e[1]}"></stop>\n </linearGradient>\n <linearGradient id="${t}_linearColors2" x1="0.5" y1="0" x2="0.5" y2="1">\n <stop offset="0%" stop-color="${e[1]}"></stop>\n <stop offset="100%" stop-color="${e[2]}"></stop>\n </linearGradient>\n <linearGradient id="${t}_linearColors3" x1="1" y1="0" x2="0" y2="1">\n <stop offset="0%" stop-color="${e[2]}"></stop>\n <stop offset="100%" stop-color="${e[3]}"></stop>\n </linearGradient>\n <linearGradient id="${t}_linearColors4" x1="1" y1="1" x2="0" y2="0">\n <stop offset="0%" stop-color="${e[3]}"></stop>\n <stop offset="100%" stop-color="${e[4]}"></stop>\n </linearGradient>\n <linearGradient id="${t}_linearColors5" x1="0.5" y1="1" x2="0.5" y2="0">\n <stop offset="0%" stop-color="${e[4]}"></stop>\n <stop offset="100%" stop-color="${e[5]}"></stop>\n </linearGradient>\n <linearGradient id="${t}_linearColors6" x1="0" y1="1" x2="1" y2="0">\n <stop offset="0%" stop-color="${e[5]}"></stop>\n <stop offset="100%" stop-color="${e[0]}"></stop>\n </linearGradient> \n <g id="${t}">\n <path stroke-width="${i}" fill="none" stroke="url(#${t}_linearColors1)" d="${a(r,r,r,1,60)}" />\n <path stroke-width="${i}" fill="none" stroke="url(#${t}_linearColors2)" d="${a(r,r,r,60,120)}"/>\n <path stroke-width="${i}" fill="none" stroke="url(#${t}_linearColors3)" d="${a(r,r,r,120,180)}" />\n <path stroke-width="${i}" fill="none" stroke="url(#${t}_linearColors4)" d="${a(r,r,r,180,240)}" />\n <path stroke-width="${i}" fill="none" stroke="url(#${t}_linearColors5)" d="${a(r,r,r,240,300)}" />\n <path stroke-width="${i}" fill="none" stroke="url(#${t}_linearColors6)" d="${a(r,r,r,300,1)}"/>\n </g>`},OrgChart._intersectionObserver=function(t,e){"function"==typeof IntersectionObserver?new IntersectionObserver((function(t,r){t.forEach((function(t){var r=t.intersectionRatio>0;0==t.intersectionRatio&&(r=t.isIntersecting),e(r)}))})).observe(t):e(!0)},OrgChart.convertCsvToNodes=function(t){for(var e=OrgChart._csvToArray(t),r=e[0],i=[],n=1;n<e.length;n++){for(var a={},o=0;o<e[n].length;o++){var s=r[o],l=e[n][o];a[r[o]]=OrgChart._convertStringToArray(s,l)}""!=a.id.trim()&&i.push(a)}return i},OrgChart._escapeHtml=function(t){return OrgChart.ESCAPE_HTML&&"string"==typeof t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):t},OrgChart._escapeDoubleQuotes=function(t){return"string"==typeof t?t.replace(/"/g,"""):t},OrgChart._escapeGreaterLessSign=function(t){return"string"==typeof t?t.replace(/</g,"<").replace(/>/g,">"):t},OrgChart.roundPathCorners=function(t,e,r){function i(t,e,r){var i=e.x-t.x,a=e.y-t.y,o=Math.sqrt(i*i+a*a);return n(t,e,Math.min(1,r/o))}function n(t,e,r){return{x:t.x+(e.x-t.x)*r,y:t.y+(e.y-t.y)*r}}function a(t,e){t.length>2&&(t[t.length-2]=e.x,t[t.length-1]=e.y)}function o(t){return{x:parseFloat(t[t.length-2]),y:parseFloat(t[t.length-1])}}Array.isArray(t)||(t=(t=t.split(/[,\s]/).reduce((function(t,e){var r=e.match("([a-zA-Z])(.+)");return r?(t.push(r[1]),t.push(r[2])):t.push(e),t}),[])).reduce((function(t,e){return parseFloat(e)==e&&t.length?t[t.length-1].push(e):t.push([e]),t}),[]));var s=[];if(t.length>1){var l=o(t[0]),h=null;"Z"==t[t.length-1][0]&&t[0].length>2&&(h=["L",l.x,l.y],t[t.length-1]=h),s.push(t[0]);for(var c=1;c<t.length;c++){var d=s[s.length-1],g=t[c],p=g==h?t[1]:t[c+1];if(p&&d&&d.length>2&&"L"==g[0]&&p.length>2&&"L"==p[0]){var u,f,m=o(d),C=o(g),b=o(p);r?(u=n(C,d.origPoint||m,e),f=n(C,p.origPoint||b,e)):(u=i(C,m,e),f=i(C,b,e)),a(g,u),g.origPoint=C,s.push(g);var v=n(u,C,.5),O=n(C,f,.5),x=["C",v.x,v.y,O.x,O.y,f.x,f.y];x.origPoint=C,s.push(x)}else s.push(g)}if(h){var y=o(s[s.length-1]);s.push(["Z"]),a(s[0],y)}}else s=t;return s.reduce((function(t,e){return t+e.join(" ")+" "}),"")},OrgChart._isMoved=function(t){return null!=t.movex||null!=t.movey},OrgChart._getDynamicGridCoulumns=function(t){for(var e=1;e<t&&!(t/e-e<=0);e++);return e%2!=0&&e>2&&e--,e},OrgChart._getLazyLoading=function(t){var e=t.lazyLoading;return"auto"==e&&(e=!!(t&&t.nodes&&t.nodes.length>700)),e},OrgChart.xScrollUI=function(t,e,r,i,n){this.element=t,this.requestParams=r,this.config=e,this.onSetViewBoxCallback=i,this.onDrawCallback=n,this.position=0,this.bar=null,this._event_id=OrgChart._guid()},OrgChart.xScrollUI.prototype.addListener=function(t){var e=this;if((this.config.mouseScrool==OrgChart.action.xScroll||this.config.mouseScrool==OrgChart.action.scroll)&&this.bar){var r=-1!==navigator.userAgent.indexOf("Mac OS"),i=OrgChart._getScrollSensitivity();!function(t,i,n){var a=!1;function o(){a=!0;var t=(e.position-e.bar.scrollLeft)/n;if(t>0)t++;else{if(0==t)return void(a=!1);t--}Math.ceil(e.bar.scrollLeft)==Math.ceil(e.position)?a=!1:(e.bar.scrollLeft+=t,s(o))}t.addEventListener("wheel",(function(t){if(t.ctrlKey)return;var n=0;if(e.config.mouseScrool==OrgChart.action.xScroll)(n=t.deltaX||t.wheelDeltaX)||(n=t.deltaY||t.wheelDeltaY);else if(e.config.mouseScrool==OrgChart.action.scroll&&!(n=r||!t.shiftKey?t.deltaX||t.wheelDeltaX:t.deltaY||t.wheelDeltaY))return;n=-n,n=Math.max(-1,Math.min(1,n)),e.position+=-n*i;var s=parseFloat(e.innerBar.clientWidth)-parseFloat(e.bar.clientWidth);e.position<0&&(e.position=0);e.position>s&&(e.position=s);a||o()}),{passive:!0});var s=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,20)}}(t,i.speed,i.smooth)}},OrgChart.xScrollUI.prototype.create=function(t){if(!0===this.config.showXScroll||this.config.mouseScrool===OrgChart.action.scroll||this.config.mouseScrool===OrgChart.action.xScroll){var e=this;this.bar&&this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),this.bar=document.createElement("div"),this.innerBar=document.createElement("div");this.requestParams();this.innerBar.innerHTML=" ",Object.assign(this.bar.style,{position:"absolute",left:0,bottom:0,width:t+"px","overflow-x":"scroll",height:"20px"}),this.element.appendChild(this.bar),this.bar.appendChild(this.innerBar),this.bar.addEventListener("scroll",(function(){if(this.ignore)this.ignore=!1;else{var t=e.requestParams(),r=(parseFloat(e.innerBar.clientWidth)-parseFloat(e.bar.clientWidth))/100,i=this.scrollLeft/r,n=(t.boundary.right-t.boundary.left)/100;t.viewBox[0]=i*n+t.boundary.left,e.onSetViewBoxCallback(t.viewBox),clearTimeout(this._timeout),this._timeout=setTimeout((function(){e.onDrawCallback()}),500)}}))}},OrgChart.xScrollUI.prototype.setPosition=function(){if(this.bar){var t=this.requestParams(),e=(Math.abs(t.boundary.maxX-t.boundary.minX)+2*this.config.padding)*t.scale;switch(this.config.orientation){case OrgChart.orientation.right:case OrgChart.orientation.right_top:e=Math.abs(t.boundary.minX*t.scale)}this.innerBar.style.width=e+"px";var r=(t.boundary.right-t.boundary.left)/100,i=(t.viewBox[0]-t.boundary.left)/r;i<0?i=0:i>100&&(i=100);var n=(parseFloat(this.innerBar.clientWidth)-parseFloat(this.bar.clientWidth))/100,a=i*n;this.bar.ignore=!0,this.bar.scrollLeft=a,this.position=this.bar.scrollLeft,this.bar.style.visibility=n<=0?"hidden":"",!0!==this.config.showXScroll&&(this.bar.style.visibility="hidden"),OrgChart.events.publish("change",[this,{isScrollBarVisible:"hidden"!=this.bar.style.visibility}])}},OrgChart.xScrollUI.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},OrgChart.yScrollUI=function(t,e,r,i,n){this.element=t,this.requestParams=r,this.config=e,this.onSetViewBoxCallback=i,this.onDrawCallback=n,this.position=0,this.bar=null,this._event_id=OrgChart._guid()},OrgChart.yScrollUI.prototype.addListener=function(t){var e=this;if((this.config.mouseScrool==OrgChart.action.yScroll||this.config.mouseScrool==OrgChart.action.scroll)&&this.bar){var r=-1!==navigator.userAgent.indexOf("Mac OS"),i=OrgChart._getScrollSensitivity();!function(t,i,n){var a=!1;function o(){a=!0;var t=(e.position-e.bar.scrollTop)/n;if(t>0)t++;else{if(0==t)return void(a=!1);t--}Math.ceil(e.bar.scrollTop)==Math.ceil(e.position)?a=!1:(e.bar.scrollTop+=t,s(o))}t.addEventListener("wheel",(function(t){if(t.ctrlKey)return;var n=0;if(e.config.mouseScrool==OrgChart.action.yScroll)(n=t.deltaY||t.wheelDeltaY)||(n=t.deltaX||t.wheelDeltaX);else if(e.config.mouseScrool==OrgChart.action.scroll&&!(n=r||!t.shiftKey?t.deltaY||t.wheelDeltaY:t.deltaX||t.wheelDeltaX))return;n=-n,n=Math.max(-1,Math.min(1,n)),e.position+=-n*i;var s=parseFloat(e.innerBar.clientHeight)-parseFloat(e.bar.clientHeight);e.position<0&&(e.position=0);e.position>s&&(e.position=s);a||o()}),{passive:!0});var s=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,20)}}(t,i.speed,i.smooth)}},OrgChart.yScrollUI.prototype.create=function(t){if(!0===this.config.showYScroll||this.config.mouseScrool===OrgChart.action.scroll||this.config.mouseScrool===OrgChart.action.yScroll){var e=this;this.bar&&this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),this.bar=document.createElement("div"),this.innerBar=document.createElement("div"),this.innerBar.innerHTML=" ",Object.assign(this.bar.style,{position:"absolute",right:0,bottom:0,height:t+"px","overflow-y":"scroll",width:"20px"}),this.element.appendChild(this.bar),this.bar.appendChild(this.innerBar),this.bar.addEventListener("scroll",(function(){if(this.ignore)this.ignore=!1;else{var t=e.requestParams(),r=(parseFloat(e.innerBar.clientHeight)-parseFloat(e.bar.clientHeight))/100,i=this.scrollTop/r,n=(t.boundary.bottom-t.boundary.top)/100;t.viewBox[1]=i*n+t.boundary.top,e.onSetViewBoxCallback(t.viewBox),clearTimeout(this._timeout),this._timeout=setTimeout((function(){e.onDrawCallback()}),500)}}))}},OrgChart.yScrollUI.prototype.setPosition=function(){if(this.bar){var t=this.requestParams(),e=(Math.abs(t.boundary.maxY-t.boundary.minY)+2*this.config.padding)*t.scale;switch(this.config.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:e=Math.abs(t.boundary.minY*t.scale)}this.innerBar.style.height=e+"px";var r=(t.boundary.bottom-t.boundary.top)/100,i=(t.viewBox[1]-t.boundary.top)/Math.abs(r);i<0?i=0:i>100&&(i=100);var n=(parseFloat(this.innerBar.clientHeight)-parseFloat(this.bar.clientHeight))/100,a=i*n;this.bar.ignore=!0,this.bar.scrollTop=a,this.position=this.bar.scrollTop,this.bar.style.visibility=n<=0?"hidden":"",!0!==this.config.showYScroll&&(this.bar.style.visibility="hidden"),OrgChart.events.publish("change",[this,{isScrollBarVisible:"hidden"!=this.bar.style.visibility}])}},OrgChart.yScrollUI.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},OrgChart.prototype.zoom=function(t,e,r,i){var n=this.getViewBox().slice(0),a=n,o=n[2],s=n[3];!0===t?(n[2]=n[2]/OrgChart.SCALE_FACTOR,n[3]=n[3]/OrgChart.SCALE_FACTOR):!1===t?(n[2]=n[2]*OrgChart.SCALE_FACTOR,n[3]=n[3]*OrgChart.SCALE_FACTOR):(n[2]=n[2]/t,n[3]=n[3]/t),e||(e=[50,50]),n[0]=a[0]-(n[2]-o)/(100/e[0]),n[1]=a[1]-(n[3]-s)/(100/e[1]);var l=this.getScale(n);if(n[2]=this.width()/l,n[3]=this.height()/l,!0===t&&l<this.config.scaleMax||!1===t&&l>this.config.scaleMin||0!=t&&1!=t&&l<this.config.scaleMax&&l>this.config.scaleMin){this._hideBeforeAnimation();var h=this;r?(clearTimeout(h._timeout),OrgChart.animate(this.getSvg(),{viewbox:this.getViewBox()},{viewbox:n},this.config.anim.duration,this.config.anim.func,(function(){clearTimeout(h._timeout),h._timeout=setTimeout((function(){h._draw(!0,OrgChart.action.zoom,null,i)}),500)}))):(this.setViewBox(n),clearTimeout(h._timeout),h._timeout=setTimeout((function(){h._draw(!0,OrgChart.action.zoom,null,i)}),500))}},OrgChart.loading={},OrgChart.loading.show=function(t){var e=document.createElement("div");e.id="boc-loading",e.innerHTML='<style>@-webkit-keyframes dot-keyframes {0% { opacity: .4; -webkit-transform: scale(1, 1);transform: scale(1, 1);}50% {opacity: 1;-webkit-transform: scale(1.2, 1.2);transform: scale(1.2, 1.2);}100% {opacity: .4;-webkit-transform: scale(1, 1);transform: scale(1, 1);}}@keyframes dot-keyframes {0% {opacity: .4;-webkit-transform: scale(1, 1);transform: scale(1, 1);}50% {opacity: 1;-webkit-transform: scale(1.2, 1.2);transform: scale(1.2, 1.2);}100% {opacity: .4;-webkit-transform: scale(1, 1);transform: scale(1, 1);}}.boc-loading-dots div {margin: 10px;} .boc-dot-1 {background-color: #039BE5;}.boc-dot-2 {background-color: #F57C00;}.boc-dot-3 {background-color: #FFCA28;} .boc-loading-dots {text-align: center;width: 100%; position: absolute; top: 0;}.boc-loading-dots--dot {-webkit-animation: dot-keyframes 1.5s infinite ease-in-out;animation: dot-keyframes 1.5s infinite ease-in-out; border-radius: 10px;display: inline-block;height: 10px;width: 10px;}.boc-loading-dots--dot:nth-child(2) {-webkit-animation-delay: .5s;animation-delay: .5s;}.boc-loading-dots--dot:nth-child(3) {-webkit-animation-delay: 1s;animation-delay: 1s;}</style><div class="boc-loading-dots"><div class="boc-loading-dots--dot boc-dot-1"></div><div class="boc-loading-dots--dot boc-dot-2"></div><div class="boc-loading-dots--dot boc-dot-3"></div></div>',t.element.appendChild(e)},OrgChart.loading.hide=function(t){var e=t.element.querySelector("#boc-loading");e&&e.parentNode.removeChild(e)},OrgChart.pdfPrevUI={},OrgChart.loc||(OrgChart.loc={}),OrgChart.loc.ppdfCmdTitle="PDF Preview",OrgChart.loc.ppdfSave="Save",OrgChart.loc.ppdfCancel="Cancel",OrgChart.loc.ppdfFormat="Format",OrgChart.loc.ppdfFitToDrwaing="Fit",OrgChart.loc.ppdfA4="A4",OrgChart.loc.ppdfA3="A3",OrgChart.loc.ppdfA2="A2",OrgChart.loc.ppdfA1="A1",OrgChart.loc.ppdfLetter="Letter",OrgChart.loc.ppdfLegal="Legal",OrgChart.loc.ppdfLayout="Layout",OrgChart.loc.ppdfPortrait="Portrait",OrgChart.loc.ppdfLandscape="Landscape",OrgChart.loc.ppdfFittopagewidth="Fit to page width",OrgChart.loc.ppdfMargin="Margin",OrgChart.loc.ppdfHeader="Header",OrgChart.loc.ppdfFooter="Footer",OrgChart.loc.ppdfScale="Scale",OrgChart.pdfPrevUI.show=function(t,e){OrgChart.pdfPrevUI.hide(t),e=t._defaultExportOptions(e,"pdf");var r=document.createElement("div");r.classList.add(t.config.mode),r.id="boc-ppdf-btns",Object.assign(r.style,{position:"absolute",top:0,left:0,"background-color":"#fff","z-index":5,margin:"0 0 0 -265px","box-shadow":"0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)",width:"265px",height:"100%","font-family":"Roboto,Helvetica",color:"#757575","text-align":"right",padding:"10px"}),t.element.appendChild(r),r.innerHTML="<h1>"+OrgChart.loc.ppdfCmdTitle+'</h1><div><button type="button" id="boc-prev-save" style="font-size: 14px; width: 90px;">'+OrgChart.loc.ppdfSave+'</button> <button type="button" id="boc-prev-cancel" style="width: 90px;font-size: 14px;">'+OrgChart.loc.ppdfCancel+'</button></div><div style="margin-top:30px; height:10px;border-bottom:1px solid #eeeeee;"></div><div style="padding-top:30px;"><label for="boc-size">'+OrgChart.loc.ppdfFormat+': </label><select id="boc-ppdf-size" style="color: #757575; width: 150px; font-size: 14px;" id="boc-size"><option value="fit">'+OrgChart.loc.ppdfFitToDrwaing+'</option><option value="A4">'+OrgChart.loc.ppdfA4+'</option><option value="A3">'+OrgChart.loc.ppdfA3+'</option><option value="A2">'+OrgChart.loc.ppdfA2+'</option><option value="A1">'+OrgChart.loc.ppdfA1+'</option><option value="Letter">'+OrgChart.loc.ppdfLetter+'</option><option value="Legal">'+OrgChart.loc.ppdfLegal+'</option></select></div><div style="padding-top:10px;"><label for="boc-ppdf-layout">'+OrgChart.loc.ppdfLayout+': </label><select id="boc-ppdf-layout" style="color: #757575; width: 150px;font-size: 14px;" ><option value="false">'+OrgChart.loc.ppdfPortrait+'</option><option value="true">'+OrgChart.loc.ppdfLandscape+'</option></select></div><div style="padding-top:10px;"><label for="boc-scale">'+OrgChart.loc.ppdfScale+': </label><select id="boc-ppdf-scale" style="color: #757575; width: 150px;font-size: 14px;" id="boc-scale"><option value="fit">'+OrgChart.loc.ppdfFittopagewidth+'</option><option value="10">10%</option><option value="20">20%</option><option value="30">30%</option><option value="40">40%</option><option value="50">50%</option><option value="60">60%</option><option value="70">70%</option><option value="80">80%</option><option value="90">90%</option><option value="100">100%</option><option value="110">110%</option><option value="120">120%</option><option value="130">130%</option><option value="140">140%</option><option value="150">150%</option><option value="160">160%</option><option value="170">170%</option><option value="180">180%</option><option value="190">190%</option><option value="200">200%</option></select></div><div style="margin-top:10px;margin-bottom:10px; height:10px;border-bottom:1px solid #eeeeee;"></div><div style="padding-top:10px;"><label for="boc-ppdf-header">'+OrgChart.loc.ppdfHeader+': </label><input id="boc-ppdf-header" type="text" style="color: #757575; width: 100px;font-size: 14px;" ></div><div style="padding-top:10px;"><label for="boc-ppdf-footer">'+OrgChart.loc.ppdfFooter+': </label><input id="boc-ppdf-footer" type="text" style="color: #757575; width: 100px;font-size: 14px;" ></div><div style="padding-top:10px;"><label for="boc-ppdf-margin">'+OrgChart.loc.ppdfMargin+': </label><input id="boc-ppdf-margin" type="text" style="color: #757575; width: 100px;font-size: 14px;" ></div>';var i=document.createElement("div");i.id="boc-ppdf-wrapper",Object.assign(i.style,{"overflow-y":"scroll","z-index":11,position:"absolute",top:0,left:"285px","background-color":"#eee",width:t.width()-270+"px",height:"100%"}),t.element.appendChild(i),i.innerHTML='<div id="boc-ppdf-content" style="width: 100%;margin-top:10px;margin-bottom:10px;opacity:0;"></div>';var n,a,o,s=t.element.querySelector("#boc-ppdf-size"),l=t.element.querySelector("#boc-ppdf-layout"),h=t.element.querySelector("#boc-ppdf-scale"),c=t.element.querySelector("#boc-ppdf-margin"),d=t.element.querySelector("#boc-ppdf-header"),g=t.element.querySelector("#boc-ppdf-footer");s.value=e.format,l.value=e.landscape,h.value=e.scale,c.value=e.margin,d.value=e.header,g.value=e.footer,OrgChart.animate(t.element.querySelector("#boc-ppdf-btns"),{margin:[0,0,0,-250]},{margin:[0,0,0,0]},300,OrgChart.anim.outSin,(function(){t.exportPDF(e,OrgChart.pdfPrevUI._handler)})),t.element.querySelector("#boc-prev-cancel").addEventListener("click",(function(){OrgChart.pdfPrevUI.hide(t)})),t.element.querySelector("#boc-prev-save").addEventListener("click",(function(){t.exportPDF(e),OrgChart.pdfPrevUI.hide(t)})),OrgChart.pdfPrevUI._showHide(s,l,h),s.addEventListener("change",(function(){OrgChart.animate(t.element.querySelector("#boc-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,(function(){t.element.querySelector("#boc-ppdf-content").innerHTML="",e.format=s.value,t.exportPDF(e,OrgChart.pdfPrevUI._handler),OrgChart.pdfPrevUI._showHide(s,l,h)}))})),l.addEventListener("change",(function(){OrgChart.animate(t.element.querySelector("#boc-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,(function(){t.element.querySelector("#boc-ppdf-content").innerHTML="",e.landscape="true"==l.value,t.exportPDF(e,OrgChart.pdfPrevUI._handler),OrgChart.pdfPrevUI._showHide(s,l,h)}))})),h.addEventListener("change",(function(){OrgChart.animate(t.element.querySelector("#boc-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,(function(){t.element.querySelector("#boc-ppdf-content").innerHTML="",e.scale=h.value,t.exportPDF(e,OrgChart.pdfPrevUI._handler),OrgChart.pdfPrevUI._showHide(s,l,h)}))})),c.addEventListener("keyup",(function(){clearTimeout(n),n=setTimeout((function(){OrgChart.animate(t.element.querySelector("#boc-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,(function(){t.element.querySelector("#boc-ppdf-content").innerHTML="";var r=c.value.split(",");if(4==r.length){for(var i=0;i<r.length;i++)r[i]=parseInt(r[i]);e.margin=r,t.exportPDF(e,OrgChart.pdfPrevUI._handler)}}))}),1e3)})),d.addEventListener("keyup",(function(){clearTimeout(a),a=setTimeout((function(){OrgChart.animate(t.element.querySelector("#boc-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,(function(){t.element.querySelector("#boc-ppdf-content").innerHTML="",e.header=d.value,t.exportPDF(e,OrgChart.pdfPrevUI._handler)}))}),1e3)})),g.addEventListener("keyup",(function(){clearTimeout(o),o=setTimeout((function(){OrgChart.animate(t.element.querySelector("#boc-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,(function(){t.element.querySelector("#boc-ppdf-content").innerHTML="",e.footer=g.value,t.exportPDF(e,OrgChart.pdfPrevUI._handler)}))}),1e3)}))},OrgChart.pdfPrevUI._showHide=function(t,e,r){"A4"==t.value||"A3"==t.value||"A2"==t.value||"A1"==t.value||"Letter"==t.value||"Legal"==t.value?(e.parentNode.style.display="block",r.parentNode.style.display="block"):(e.parentNode.style.display="none",r.parentNode.style.display="none")},OrgChart.pdfPrevUI._handler=function(t,e,r){var i=e.options,n=e.pages,a=i.margin[0],o=i.margin[2],s=document.createElement("div");s.classList.add(t.config.mode),s.innerHTML=r.outerHTML,OrgChart._browser().msie&&(s.innerHTML=(new XMLSerializer).serializeToString(r));for(var l=s.querySelector("svg"),h=t.element.querySelector("#boc-ppdf-content"),c=0;c<n.length;c++){var d=document.createElement("iframe");Object.assign(d.style,{display:"block",margin:"10px auto",border:"1px solid #eeeeee","box-shadow":"0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)"}),h.appendChild(d),l&&l.style.backgroundColor?d.style.backgroundColor=l.style.backgroundColor:d.style.backgroundColor="#fff";var g=d.contentWindow.document;g.open(),d.style.width=n[c].size.w+"px",d.style.height=n[c].size.h+"px",d.style.margin="10 auto",n[c].backgroundColor&&(d.style.backgroundColor=n[c].backgroundColor);var p=i.header;n[c].header&&(p=n[c].header),p&&(p=p.replace("{current-page}",c+1).replace("{total-pages}",n.length));var u=i.footer;n[c].footer&&(u=n[c].footer),u&&(u=u.replace("{current-page}",c+1).replace("{total-pages}",n.length)),n[c].html?g.write(OrgChart._exportHtml(n[c].html,e.styles,i,n[c].innerSize.w,n[c].innerSize.h,p,u,t.config.mode)):(l.setAttribute("viewBox",n[c].vb),g.write(OrgChart._exportHtml(s.innerHTML,e.styles,i,n[c].innerSize.w,n[c].innerSize.h,p,u,t.config.mode)));var f=g.getElementById("boc-header"),m=g.getElementById("boc-footer");if(f){var C=a-f.offsetHeight-7;f.style.top=C+"px"}if(m){var b=o-m.offsetHeight-7;m.style.bottom=b+"px"}g.close()}var v=t.element.querySelector("#boc-ppdf-content");OrgChart.animate(v,{opacity:0},{opacity:1},300,OrgChart.anim.outSin)},OrgChart.pdfPrevUI._getViewBox=function(t){var e=null;return t?(e=(e="["+(e=t.getAttribute("viewBox"))+"]").replace(/\ /g,","),e=JSON.parse(e)):null},OrgChart._exportHtml=function(t,e,r,i,n,a,o,s){for(var l="",h=0;h<r.margin.length;h++)l+=r.margin[h]+"px ";var c='<!DOCTYPE html><html style="margin:0;padding:0;"><head></head>'+e+'<body class="boc-'+s+'" style="margin:0; padding:0;"><div style="margin: '+l+";overflow:hidden;width:"+i+"px;height:"+n+'px">';return a&&(c+='<div id="boc-header" style="width:'+i+"px;color:#757575;position:absolute;left:"+r.margin[3]+'px;top:0;">'+a+"</div>"),c+=t,o&&(c+='<div id="boc-footer" style="width:'+i+"px;color:#757575;position:absolute;left:"+r.margin[3]+'px;bottom:0;">'+o+"</div>"),c+="</div>",c+="</body></html>"},OrgChart.pdfPrevUI.hide=function(t){var e=t.element.querySelector("#boc-ppdf-wrapper");if(e){e.parentNode.removeChild(e),e.style.opacity=0;var r=t.element.querySelector("#boc-ppdf-btns");r.parentNode.removeChild(r)}},void 0===OrgChart&&(OrgChart={}),OrgChart.events.on("renderdefs",(function(t,e){for(var r=0;r<t.config.clinks.length;r++){var i=t.config.clinks[r].template;i||(i="orange");var n=OrgChart.clinkTemplates[i];e.defs+=n.defs}})),OrgChart.events.on("prerender",(function(t,e){OrgChart.RENDER_CLINKS_BEFORE_NODES&&t._clink(t,e)})),OrgChart.events.on("render",(function(t,e){OrgChart.RENDER_CLINKS_BEFORE_NODES||t._clink(t,e)})),OrgChart.events.on("drag",(function(t,e,r,i){if(t instanceof OrgChart&&t.config.movable&&i)for(var n=0;n<i.length;n++){for(var a=i[n],o=t.element.querySelectorAll(`[data-c-l-from="${a}"]`),s=t.element.querySelectorAll(`[data-c-l-to="${a}"]`),l=0;l<o.length;l++)o[l].parentNode.removeChild(o[l]);for(l=0;l<s.length;l++)s[l].parentNode.removeChild(s[l])}})),OrgChart.prototype._clink=function(t,e){for(var r="",i=0;i<this.config.clinks.length;i++){var n=this.config.clinks[i],a=t.getNode(n.from),o=t.getNode(n.to);if(a&&-1!=e.res.visibleNodeIds.indexOf(a.id)&&(o&&-1!=e.res.visibleNodeIds.indexOf(o.id))){var s=a.x,l=a.y,h=o.x,c=o.y,d={},g={},p=s+a.w/2,u=h+o.w/2,f=l+a.h/2,m=c+o.h/2,C=1;switch(this.config.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:p<=u?(C=1,d.x=p+a.w/10,g.x=u-o.w/10):(C=-1,d.x=p-a.w/10,g.x=u+o.w/10),l==c?(C=1,d.y=l,g.y=c):l>c?(d.y=l,g.y=c+o.h):(d.y=l+a.h,g.y=c);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:p<=u?(C=-1,d.x=p+a.w/10,g.x=u+o.w/10):(C=1,d.x=p-a.w/10,g.x=u+o.w/10),l==c?(C=-1,d.y=l+a.h,g.y=c+o.h):l>c?(d.y=l,g.y=c+o.h):(d.y=l+a.h,g.y=c);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:f<=m?(C=-1,d.y=f+a.h/5,g.y=m+o.h/5):(C=1,d.y=f-a.h/5,g.y=m+o.h/5),s==h?(C=-1,d.x=s,g.x=h):s>h?(d.x=s,g.x=h+o.w):(d.x=s+a.w,g.x=h);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:f<=m?(C=1,d.y=f+a.h/5,g.y=m+o.h/5):(C=-1,d.y=f-a.h/5,g.y=m+o.h/5),s==h?(C=1,d.x=s+a.w,g.x=h+o.w):s>h?(d.x=s,g.x=h+o.w):(d.x=s+a.w,g.x=h)}var b=_(d,g,C),v=n.template;v||(v="orange");var O=OrgChart.clinkTemplates[v];if(n.label){var x=OrgChart.clinkLabelPosition(n,d,g,b);r+=O.label.replace("{x}",x.x).replace("{y}",x.y).replace("{val}",n.label)}var y="M"+d.x+","+d.y+"C"+d.x+","+d.y+" "+b.x+","+b.y+" "+g.x+","+g.y;r+=("<g "+OrgChart.attr.c_link_from+'="{from}" '+OrgChart.attr.c_link_to+'="{to}">').replace("{from}",a.id).replace("{to}",o.id)+O.link.replaceAll("{d}",y)+'<path stroke="transparent" stroke-width="15" fill="none" d="'+y+'" />',r+=OrgChart.grCloseTag}function _(t,e,r){null==r&&(r=1);var i=e.x-t.x,a=e.y-t.y,o=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))/3;return o=o/(Math.sqrt(i*i+a*a)*r)*OrgChart.clinkCurve(n),{x:t.x+i/2-a*o,y:t.y+a/2+i*o}}}e.content+=r},OrgChart.clinkLabelPosition=function(t,e,r,i){var n=(r.x-e.x)/2+e.x,a=(r.y-e.y)/2+e.y;return{x:(n-i.x)/2+i.x,y:(a-i.y)/2+i.y}},OrgChart.clinkCurve=function(t){return OrgChart.CLINK_CURVE},OrgChart.prototype.addClink=function(t,e,r,i){this._putInUndoStack(),this.clearRedo();for(var n=this.config.clinks.length-1;n>=0;n--){var a=this.config.clinks[n];a.from==t&&a.to==e&&this.config.clinks.splice(n,1)}return this.config.clinks.push({from:t,to:e,label:r,template:i}),this._ai.setContext(),OrgChart.events.publish("updated",[this]),this},OrgChart.prototype.removeClink=function(t,e){this._putInUndoStack(),this.clearRedo();for(var r=this.config.clinks.length-1;r>=0;r--){var i=this.config.clinks[r];i.from==t&&i.to==e&&this.config.clinks.splice(r,1)}return this._ai.setContext(),OrgChart.events.publish("updated",[this]),this},OrgChart.clinkTemplates={},OrgChart.clinkTemplates.orange={defs:'<marker id="arrowOrange" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path fill="#F57C00" d="M 0 0 L 10 5 L 0 10 z" /></marker><marker id="dotOrange" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="5" markerHeight="5"> <circle cx="5" cy="5" r="5" fill="#F57C00" /></marker>',link:'<path marker-start="url(#dotOrange)" marker-end="url(#arrowOrange)" stroke="#F57C00" stroke-width="2" fill="none" d="{d}" />',label:'<text fill="#F57C00" text-anchor="middle" x="{x}" y="{y}">{val}</text>'},OrgChart.clinkTemplates.blue={defs:'<marker id="arrowBlue" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path fill="#039BE5" d="M 0 0 L 10 5 L 0 10 z" /></marker><marker id="dotBlue" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="5" markerHeight="5"> <circle cx="5" cy="5" r="5" fill="#039BE5" /></marker>',link:'<path marker-start="url(#dotBlue)" marker-end="url(#arrowBlue)" stroke="#039BE5" stroke-width="2" fill="none" d="{d}" />',label:'<text fill="#039BE5" text-anchor="middle" x="{x}" y="{y}">{val}</text>'},OrgChart.clinkTemplates.yellow={defs:'<marker id="arrowYellow" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path fill="#FFCA28" d="M 0 0 L 10 5 L 0 10 z" /></marker><marker id="dotYellow" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="5" markerHeight="5"> <circle cx="5" cy="5" r="5" fill="#FFCA28" /></marker>',link:'<path marker-start="url(#dotYellow)" marker-end="url(#arrowYellow)" stroke="#FFCA28" stroke-width="2" fill="none" d="{d}" />',label:'<text fill="#FFCA28" text-anchor="middle" x="{x}" y="{y}">{val}</text>'},void 0===OrgChart&&(OrgChart={}),OrgChart.events.on("renderdefs",(function(t,e){for(var r=0;r<t.config.slinks.length;r++){var i=t.config.slinks[r].template;i||(i="orange");var n=OrgChart.slinkTemplates[i];e.defs+=n.defs}})),OrgChart.events.on("render",(function(t,e){t._slinks(t,e)})),OrgChart.events.on("drag",(function(t,e,r,i){if(t instanceof OrgChart&&t.config.movable&&i)for(var n=0;n<i.length;n++){for(var a=i[n],o=t.element.querySelectorAll(`[data-s-l-from="${a}"]`),s=t.element.querySelectorAll(`[data-s-l-to="${a}"]`),l=0;l<o.length;l++)o[l].parentNode.removeChild(o[l]);for(l=0;l<s.length;l++)s[l].parentNode.removeChild(s[l])}})),OrgChart.prototype._slinks=function(t,e){var r="",i=this.getScale(),n=e.res.boundary;function a(e,a,o){var l=[],h=null,c="left",d=e.lcn?e.lcn:"base",g=t._layoutConfigs[d];switch(g.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:a.x>e.x&&(c="right");break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:case OrgChart.orientation.right:case OrgChart.orientation.right_top:c="top",a.y>e.y&&(c="bottom")}var p=OrgChart.t(e.templateName,e.min,i),u=g.levelSeparation;e.parent&&e.parent.layout&&(u=g.mixedHierarchyNodesSeparation);var f={p:e.x+e.w/2+p.expandCollapseSize,q:e.y,r:e.x+e.w/2+p.expandCollapseSize,s:n.minY+u};if(e.sl==a.sl)switch(h=a,g.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:l.push([f.p,f.q]),l.push([f.p,f.q-u/3]),p=OrgChart.t(h.templateName,h.min,i),l.push([h.x+h.w/2+p.expandCollapseSize,l[l.length-1][1]]),l.push([l[l.length-1][0],h.y]);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:f.q=e.y+e.h,f.s=n.maxY-u,l.push([f.p,f.q]),l.push([f.r,e.y+e.h+u/3]),p=OrgChart.t(h.templateName,h.min,i),l.push([h.x+h.w/2+p.expandCollapseSize,l[l.length-1][1]]),l.push([l[l.length-1][0],h.y+h.h]);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:f.p=e.x,f.q=e.y+e.h/2+p.expandCollapseSize,f.r=n.minX-u,f.s=e.y+e.h/2+p.expandCollapseSize,l.push([f.p,f.q]),l.push([e.x-u/3,f.q]),p=OrgChart.t(h.templateName,h.min,i),l.push([l[l.length-1][0],h.y+h.h/2+p.expandCollapseSize]),l.push([h.x,l[l.length-1][1]]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:f.p=e.x+e.w,f.q=e.y+e.h/2+p.expandCollapseSize,f.r=n.maxX+u,f.s=e.y+e.h/2+p.expandCollapseSize,l.push([f.p,f.q]),l.push([e.x+e.w+u/3,f.q]),p=OrgChart.t(h.templateName,h.min,i),l.push([l[l.length-1][0],h.y+h.h/2+p.expandCollapseSize]),l.push([h.x+h.w,l[l.length-1][1]])}else{switch(g.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:l.push([f.p,f.q]),l.push([f.r,e.y-u/3]);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:f.q=e.y+e.h,f.s=n.maxY-u,l.push([f.p,f.q]),l.push([f.r,e.y+e.h+u/3]);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:f.p=e.x,f.q=e.y+e.h/2+p.expandCollapseSize,f.r=n.minX-u,f.s=e.y+e.h/2+p.expandCollapseSize,l.push([f.p,f.q]),l.push([e.x-u/3,f.q]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:f.p=e.x+e.w,f.q=e.y+e.h/2+p.expandCollapseSize,f.r=n.maxX+u,f.s=e.y+e.h/2+p.expandCollapseSize,l.push([f.p,f.q]),l.push([e.x+e.w+u/3,f.q])}for(var m=e,C=e;C.parent;)C=C.parent;for(;null==h;){var b=!1,v=m.parent,O=v.leftNeighbor,x=v.rightNeighbor;if(v.id==a.id?h=v:OrgChart._intersects(v,f,g)&&(f=OrgChart._addPoint(v,l,g,f,c),b=!0),v.id!=a.id){for(;O;){if(O.id==a.id){h=O;break}OrgChart._intersects(O,f,g)&&(f=OrgChart._addPoint(O,l,g,f,c),b=!0),O=O.leftNeighbor}for(;x;){if(x.id==a.id){h=x;break}OrgChart._intersects(x,f,g)&&(f=OrgChart._addPoint(x,l,g,f,c),b=!0),x=x.rightNeighbor}}if(!b){var y=l[l.length-1][0],_=0;if(v.parent){u=g.levelSeparation,v.parent.layout&&(u=g.mixedHierarchyNodesSeparation);var k=t.manager.bordersByRootIdAndLevel[C.id][v.parent.sl];switch(g.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:_=k.maxY+u*(2/3);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:_=k.minY-u*(2/3);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:y=k.maxX+u*(2/3),_=l[l.length-1][1];break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:y=k.minX-u*(2/3),_=l[l.length-1][1]}}l.push([y,_])}m=v}switch(p=OrgChart.t(h.templateName,h.min,i),l.splice(l.length-1,1),g.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:l.push([h.x+h.w/2+p.expandCollapseSize,l[l.length-1][1]]),l.push([l[l.length-1][0],h.y+h.h]);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:l.push([h.x+h.w/2+p.expandCollapseSize,l[l.length-1][1]]),l.push([l[l.length-1][0],h.y]);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:l.push([l[l.length-1][0],h.y+h.h/2+p.expandCollapseSize]),l.push([h.x+h.w,l[l.length-1][1]]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:l.push([l[l.length-1][0],h.y+h.h/2+p.expandCollapseSize]),l.push([h.x,l[l.length-1][1]])}}var w=s.template;w||(w="orange");var S,I,A=null;switch((p=OrgChart.slinkTemplates[w]).labelPosition){case"start":A={x:l[1][0],y:l[1][1]};break;case"middle":var L=Math.ceil(l.length/2);S=l[L],I=l[L-1],A={x:(S[0]+I[0])/2,y:(S[1]+I[1])/2};break;case"end":A={x:l[l.length-2][0],y:l[l.length-2][1]}}o&&(l=l.reverse()),l[0].unshift("M");for(var E=1;E<l.length;E++)l[E].unshift("L");var N=OrgChart.roundPathCorners(l,OrgChart.LINK_ROUNDED_CORNERS,!1);if(s.label){var M=p.label.replace("{x}",A.x).replace("{y}",A.y).replace("{val}",s.label),T=OrgChart._getLabelSize(M),R=-T.height/2;switch(g.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:R=T.height}r+=p.label.replace("{x}",A.x).replace("{y}",A.y+R).replace("{val}",s.label)}var B=e.id,U=a.id;o&&(B=a.id,U=e.id),r+=("<g "+OrgChart.attr.s_link_from+'="{from}" '+OrgChart.attr.s_link_to+'="{to}">').replace("{from}",B).replace("{to}",U)+p.link.replaceAll("{d}",N)+'<path stroke="transparent" stroke-width="15" fill="none" d="'+N+'" />',r+=OrgChart.grCloseTag}for(var o=0;o<this.config.slinks.length;o++){var s=this.config.slinks[o],l=t.getNode(s.from),h=t.getNode(s.to);l&&h&&-1!=e.res.visibleNodeIds.indexOf(h.id)&&-1!=e.res.visibleNodeIds.indexOf(l.id)&&(l.sl>=h.sl?a(l,h,!1):a(h,l,!0))}e.content+=r},OrgChart.prototype.addSlink=function(t,e,r,i){this._putInUndoStack(),this.clearRedo();for(var n=this.config.slinks.length-1;n>=0;n--){var a=this.config.slinks[n];a.from==t&&a.to==e&&this.config.slinks.splice(n,1)}return this.config.slinks.push({from:t,to:e,label:r,template:i}),this._ai.setContext(),OrgChart.events.publish("updated",[this]),this},OrgChart.prototype.removeSlink=function(t,e){this._putInUndoStack(),this.clearRedo();for(var r=this.config.slinks.length-1;r>=0;r--){var i=this.config.slinks[r];i.from==t&&i.to==e&&this.config.slinks.splice(r,1)}return this._ai.setContext(),OrgChart.events.publish("updated",[this]),this},OrgChart.slinkTemplates={},OrgChart.slinkTemplates.orange={defs:'<marker id="arrowSlinkOrange" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path fill="#F57C00" d="M 0 0 L 10 5 L 0 10 z" /></marker><marker id="dotSlinkOrange" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="5" markerHeight="5"> <circle cx="5" cy="5" r="5" fill="#F57C00" /></marker>',link:'<path stroke-dasharray="4, 2" marker-start="url(#dotSlinkOrange)" marker-end="url(#arrowSlinkOrange)" stroke-linejoin="round" stroke="#F57C00" stroke-width="2" fill="none" d="{d}" />',label:'<text dominant-baseline="middle" fill="#F57C00" alignment-baseline="middle" text-anchor="middle" x="{x}" y="{y}">{val}</text>',labelPosition:"middle"},OrgChart.slinkTemplates.blue={defs:'<marker id="arrowSlinkBlue" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path fill="#039BE5" d="M 0 0 L 10 5 L 0 10 z" /></marker><marker id="dotSlinkBlue" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="5" markerHeight="5"> <circle cx="5" cy="5" r="5" fill="#039BE5" /></marker>',link:'<path stroke-dasharray="4, 2" marker-start="url(#dotSlinkBlue)" marker-end="url(#arrowSlinkBlue)" stroke-linejoin="round" stroke="#039BE5" stroke-width="2" fill="none" d="{d}" />',label:'<text fill="#039BE5" text-anchor="middle" x="{x}" y="{y}">{val}</text>',labelPosition:"middle"},OrgChart.slinkTemplates.yellow={defs:'<marker id="arrowSlinkYellow" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path fill="#FFCA28" d="M 0 0 L 10 5 L 0 10 z" /></marker><marker id="dotSlinkYellow" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="5" markerHeight="5"> <circle cx="5" cy="5" r="5" fill="#FFCA28" /></marker>',link:'<path stroke-dasharray="4, 2" marker-start="url(#dotSlinkYellow)" marker-end="url(#arrowSlinkYellow)" stroke-linejoin="round" stroke="#FFCA28" stroke-width="2" fill="none" d="{d}" />',label:'<text fill="#FFCA28" text-anchor="middle" x="{x}" y="{y}">{val}</text>',labelPosition:"middle"},OrgChart._ai=function(t){this.instance=t,this.sessionId=null},OrgChart._ai.prototype.prompt=function(t,e){var r=this;(t=t.trim())&&(this.sessionId?r._prompt([{Role:"user",Text:t}],e):this.setContext((function(){r._prompt([{Role:"user",Text:t}],e)})))},OrgChart._ai.prototype._prompt=function(t,e){var r=this,i=[];for(var n of OrgChart.AI_SYSTEM_MESSAGES)i.push({Role:"system",Text:n});var a=this.instance.config.serverUrl+`/OrgChartJSAI/Prompt?client_messages=${encodeURIComponent(JSON.stringify(t))}&system_messages=${encodeURIComponent(JSON.stringify(i))}&sessionId=${this.sessionId}`;const o=new EventSource(a);o.onmessage=function(t){var i=JSON.parse(t.data);"end"==i.kind&&o.close(),"text"==i.kind&&(i.text,e&&e(i.text)),"assistant-message-with-tools"==i.kind?r.toolCalls(i.message,e):"error"==i.kind&&console.error(i.text)},o.onerror=function(t){console.error(t),o.close()}},OrgChart._ai.prototype.setContext=function(t){if(this.instance&&this.instance.config.enableAI&&this.instance.aiUI.canSetContext){this.sessionId=this.instance._event_id;var e=this.instance.config.serverUrl+"/OrgChartJSAI/SetContext",r=this.instance.config.aiChatTools.slice();for(var i of r)i.functionParameters=JSON.stringify(i.functionParameters);fetch(e,{method:"post",headers:{"Content-Type":"application/json","x-request-type":"ajax"},body:JSON.stringify({context:this.instance.config.nodes,sessionId:this.sessionId,chatTools:r})}).then((function(){t&&t()})).catch((function(t){console.error(t)}))}},OrgChart._ai.prototype.toolCalls=function(t,e){var r=this,i={toolCalls:t.ToolCalls};OrgChart.events.publish("ai-tool-calls",[this.instance,i]);var n=[],a=[],o=[],s=[],l=[],h=null,c=null,d=null,g=null,p=null;for(var u of i.toolCalls)null==u.FunctionResult&&("removeNode"==u.FunctionName?n.push(u):"addNode"==u.FunctionName?a.push(u):"updateNode"==u.FunctionName?o.push(u):"select"==u.FunctionName?s.push(u):"deselect"==u.FunctionName?l.push(u):"exportPDF"==u.FunctionName?h=u:"changeTemplate"==u.FunctionName?c=u:"addSlink"==u.FunctionName?d=u:"removeSlink"==u.FunctionName?g=u:"fit"==u.FunctionName&&(p=u));var f=!1;if(c&&(f=!0,u.FunctionResult="ok",this.instance.config.template=u.FunctionArguments.templateName),d){var m=this.instance.getNode(u.FunctionArguments.employeeId1),C=this.instance.getNode(u.FunctionArguments.employeeId2);m&&C&&m!=C?(f=!0,this.instance.addSlink(m.id,C.id),u.FunctionResult="ok"):u.FunctionResult=`Cannot add link between ${u.FunctionArguments.employeeId1} and ${u.FunctionArguments.employeeId2}`}if(g){m=this.instance.getNode(u.FunctionArguments.employeeId1),C=this.instance.getNode(u.FunctionArguments.employeeId2);m&&C&&m!=C?(f=!0,this.instance.removeSlink(m.id,C.id),u.FunctionResult="ok"):u.FunctionResult=`Cannot remove link between ${u.FunctionArguments.employeeId1} and ${u.FunctionArguments.employeeId2}`}for(var u of(p&&(this.instance.fit(),f=!1),n))f=!0,u.FunctionResult="ok",this.instance.remove(u.FunctionArguments.id);for(var u of a){f=!0,u.FunctionResult="ok",(b=JSON.parse(JSON.stringify(u.FunctionArguments))).isAssistant&&(b.tags=["assistant"]),delete b.isAssistant,OrgChart.isNEU(b.id)&&(b.id=this.instance.generateId()),this.instance.add(b)}for(var u of o){f=!0,u.FunctionResult="ok";var b=this.instance.get(u.FunctionArguments.id);for(var v in u.FunctionArguments)"id"!=v&&null!=u.FunctionArguments[v]&&(b[v]=u.FunctionArguments[v]);this.instance.update(b)}for(var u of s)for(var O of(u.FunctionResult="ok",u.FunctionArguments.ids)){var x=u.FunctionArguments.color;x||(x="#FFCA28");var y=this.instance.getNodeElement(O).firstChild;y&&(y.style.stroke=u.FunctionArguments.color,y.style.strokeWidth=5)}var _=function(){for(var t of l)if(t.FunctionResult="ok",t.FunctionArguments.ids)for(var e of t.FunctionArguments.ids){var i=r.instance.getNodeElement(e).firstChild;i&&(i.style.stroke="#aeaeae",i.style.strokeWidth=1)}else f=!0};f?(this.setContext(),this.instance.draw(OrgChart.action.update,void 0,_)):_();var k=function(){var t=[];for(var n of i.toolCalls)t.push({Role:"tool",Text:n.FunctionResult,Id:n.Id});r._prompt(t,e)};h?OrgChart.exportPDFFromCharts([{format:"A4",chartInstance:this.instance}],void 0,void 0,(function(t){u.FunctionResult="ok",OrgChart._downloadFile("application/pdf",t,"OrgChart.pdf",!1,"pdf"),k()})):k()},OrgChart.aiUI=function(){},OrgChart.aiUI.title="AI for OrgChart JS",OrgChart.aiUI.prototype.init=function(t){this.instance=t,this.canSetContext=!1,this.element=null,this.inputElement=null,this.btnSendElement=null,this.messagesElement=null;var e=this,r=this.instance.element.querySelector("[data-boc-ai-button]");r&&r.addEventListener("click",(function(t){e.show()}))},OrgChart.aiUI.prototype.show=function(t,e){this.hide(),this._create(),this.element.style.display="",this.canSetContext||(this.canSetContext=!0,this.instance._ai.setContext());var r=this;e||(this.interval=OrgChart.animate(this.element,{left:-20,opacity:0},{left:0,opacity:1},300,OrgChart.anim.outSin,(function(){t||r.inputElement.focus()})))},OrgChart.aiUI.prototype._create=function(){if(!this.element){var t=this,e="inp_"+this.instance.generateId();this.element=document.createElement("div"),this.element.setAttribute("data-boc-ai-form",""),this.element.style.opacity=0,this.element.classList.add("boc-ai-form"),this.element.classList.add(this.instance.config.mode),this.element.innerHTML=`<div class="boc-ai-container">\n <div data-boc-ai-close class="boc-ai-close">${OrgChart.icon.x(20,20,"#aeaeae")}</div>\n <div class="boc-ai-middle boc-ai-start">\n <div data-boc-ai-messages class="boc-ai-messages">\n <img src="https://orgchartjs.balkan.app/logo.svg"> \n <span>\n ${OrgChart.aiUI.title}\n </span>\n </div> \n </div>\n <div>\n <div class="boc-input" data-boc-input="">\n <label for="${e}">Message OrgChart</label>\n <input maxlength="256" id="${e}" name="${e}" type="text" value="" autocomplete="off"> \n <div data-boc-ai-send class="boc-ai-send">\n ${OrgChart.icon.send(20,20,"#aeaeae")}\n </div> \n </div>\n \n </div>\n </div>`,this.instance.element.appendChild(this.element),OrgChart.input.init(this.element);var r=this.instance.element.querySelector("[data-boc-ai-close] svg");r&&r.addEventListener("click",(function(e){t.hide()})),this.inputElement=this.element.querySelector("#"+e),this.btnSendElement=this.inputElement.parentNode.querySelector("[data-boc-ai-send]"),this.messagesElement=this.element.querySelector("[data-boc-ai-messages]"),this.inputElement.addEventListener("input",(function(t){this.value?this.parentNode.querySelector(".boc-ai-send").classList.add("boc-ai-send-cansend"):this.parentNode.querySelector(".boc-ai-send").classList.remove("boc-ai-send-cansend")})),this.element.querySelector("[data-boc-ai-send]").addEventListener("click",(function(e){t.sendUserInput()})),this.inputElement.addEventListener("keyup",(function(e){var r=window.event?window.event:e;switch(t.canSetContext||(t.canSetContext=!0,t.instance._ai.setContext()),r.key){case"Enter":t.sendUserInput();break;case"ArrowUp":if((i=OrgChart.aiUI._getSuggestions()).length)-1==(n=i.indexOf(t.inputElement.value))?n=i.length-1:n--,-1==n&&(n=i.length-1),t.inputElement.value=i[n];break;case"ArrowDown":var i,n;if((i=OrgChart.aiUI._getSuggestions()).length)-1==(n=i.indexOf(t.inputElement.value))?n=0:n++,n==i.length&&(n=0),t.inputElement.value=i[n]}}))}},OrgChart.aiUI.prototype.addUserMessage=function(t){this.btnSendElement.classList.remove("boc-ai-send-cansend");var e=this.element.querySelector(".boc-ai-start");e&&(e.classList.remove("boc-ai-start"),this.messagesElement.innerHTML="");var r=document.createElement("div");r.classList.add("boc-ai-user-message"),r.innerHTML=`<span class="boc-inner-user-message">${t}</span>`,this.messagesElement.appendChild(r)},OrgChart.aiUI.prototype.hide=function(){this.element&&(this.element.style.opacity=0,this.element.style.left="-20px",this.element.style.display="none")},OrgChart.aiUI.prototype.sendUserInput=function(){var t=this;OrgChart.aiUI._addSuggestion(this.inputElement.value),this.addUserMessage(this.inputElement.value);var e=document.createElement("div");e.classList.add("boc-ai-assistant-message");var r=document.createElement("span");r.classList.add("boc-inner-assistant-message"),e.appendChild(r),this.messagesElement.appendChild(e);var i="";this.instance._ai.prompt(this.inputElement.value,(function(e){i+=e;var n=marked.parse(i);r.innerHTML=n;var a=t.element.querySelector(".boc-ai-middle");a.scrollTo(0,a.scrollHeight)})),this.inputElement.value=""},OrgChart.aiUI._addSuggestion=function(t){t=t.trim();var e=OrgChart.aiUI._getSuggestions(),r=e.indexOf(t);-1!=r&&e.splice(r,1),e.push(t),localStorage.setItem("suggestions",JSON.stringify(e))},OrgChart.aiUI._getSuggestions=function(){var t=localStorage.getItem("suggestions");return t=t?JSON.parse(t):[]},function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).marked={})}(this,(function(t){"use strict";function e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function r(e){t.defaults=e}t.defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};const i={exec:()=>null};function n(t,e=""){let r="string"==typeof t?t:t.source;const i={replace:(t,e)=>{let n="string"==typeof e?e:e.source;return n=n.replace(a.caret,"$1"),r=r.replace(t,n),i},getRegex:()=>new RegExp(r,e)};return i}const a={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},o=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,s=/(?:[*+-]|\d{1,9}[.)])/,l=n(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,s).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),h=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,c=/(?!\s*\])(?:\\.|[^\[\]\\])+/,d=n(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",c).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),g=n(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,s).getRegex(),p="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",u=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,f=n("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",u).replace("tag",p).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),m=n(h).replace("hr",o).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",p).getRegex(),C={blockquote:n(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",m).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:d,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:o,html:f,lheading:l,list:g,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:m,table:i,text:/^[^\n]+/},b=n("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",o).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",p).getRegex(),v={...C,table:b,paragraph:n(h).replace("hr",o).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",b).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",p).getRegex()},O={...C,html:n("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",u).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:i,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:n(h).replace("hr",o).replace("heading"," *#{1,6} *[^\n]").replace("lheading",l).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},x=/^( {2,}|\\)\n(?!\s*$)/,y=/[\p{P}\p{S}]/u,_=/[\s\p{P}\p{S}]/u,k=/[^\s\p{P}\p{S}]/u,w=n(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,_).getRegex(),S=/(?!~)[\p{P}\p{S}]/u,I=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,A=n(I,"u").replace(/punct/g,y).getRegex(),L=n(I,"u").replace(/punct/g,S).getRegex(),E="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",N=n(E,"gu").replace(/notPunctSpace/g,k).replace(/punctSpace/g,_).replace(/punct/g,y).getRegex(),M=n(E,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,S).getRegex(),T=n("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,k).replace(/punctSpace/g,_).replace(/punct/g,y).getRegex(),R=n(/\\(punct)/,"gu").replace(/punct/g,y).getRegex(),B=n(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),U=n(u).replace("(?:--\x3e|$)","--\x3e").getRegex(),P=n("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",U).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),F=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,z=n(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",F).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),D=n(/^!?\[(label)\]\[(ref)\]/).replace("label",F).replace("ref",c).getRegex(),H=n(/^!?\[(ref)\](?:\[\])?/).replace("ref",c).getRegex(),$={_backpedal:i,anyPunctuation:R,autolink:B,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:x,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:i,emStrongLDelim:A,emStrongRDelimAst:N,emStrongRDelimUnd:T,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:z,nolink:H,punctuation:w,reflink:D,reflinkSearch:n("reflink|nolink(?!\\()","g").replace("reflink",D).replace("nolink",H).getRegex(),tag:P,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:i},j={...$,link:n(/^!?\[(label)\]\((.*?)\)/).replace("label",F).getRegex(),reflink:n(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",F).getRegex()},q={...$,emStrongRDelimAst:M,emStrongLDelim:L,url:n(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Y={...q,br:n(x).replace("{2,}","*").getRegex(),text:n(q.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},X={normal:C,gfm:v,pedantic:O},V={normal:$,gfm:q,breaks:Y,pedantic:j},G={"&":"&","<":"<",">":">",'"':""","'":"'"},W=t=>G[t];function J(t,e){if(e){if(a.escapeTest.test(t))return t.replace(a.escapeReplace,W)}else if(a.escapeTestNoEncode.test(t))return t.replace(a.escapeReplaceNoEncode,W);return t}function K(t){try{t=encodeURI(t).replace(a.percentDecode,"%")}catch{return null}return t}function Z(t,e){const r=t.replace(a.findPipe,((t,e,r)=>{let i=!1,n=e;for(;--n>=0&&"\\"===r[n];)i=!i;return i?"|":" |"})).split(a.splitPipe);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(a.slashPipe,"|");return r}function Q(t,e,r){const i=t.length;if(0===i)return"";let n=0;for(;n<i&&t.charAt(i-n-1)===e;)n++;return t.slice(0,i-n)}function tt(t,e,r,i,n){const a=e.href,o=e.title||null,s=t[1].replace(n.other.outputLinkReplace,"$1");if("!"!==t[0].charAt(0)){i.state.inLink=!0;const t={type:"link",raw:r,href:a,title:o,text:s,tokens:i.inlineTokens(s)};return i.state.inLink=!1,t}return{type:"image",raw:r,href:a,title:o,text:s}}class et{options;rules;lexer;constructor(e){this.options=e||t.defaults}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Q(t,"\n")}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const t=e[0],r=function(t,e,r){const i=t.match(r.other.indentCodeCompensation);if(null===i)return e;const n=i[1];return e.split("\n").map((t=>{const e=t.match(r.other.beginningSpace);if(null===e)return t;const[i]=e;return i.length>=n.length?t.slice(n.length):t})).join("\n")}(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){const e=Q(t,"#");this.options.pedantic?t=e.trim():e&&!this.rules.other.endingSpaceChar.test(e)||(t=e.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Q(e[0],"\n")}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let t=Q(e[0],"\n").split("\n"),r="",i="";const n=[];for(;t.length>0;){let e=!1;const a=[];let o;for(o=0;o<t.length;o++)if(this.rules.other.blockquoteStart.test(t[o]))a.push(t[o]),e=!0;else{if(e)break;a.push(t[o])}t=t.slice(o);const s=a.join("\n"),l=s.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}\n${s}`:s,i=i?`${i}\n${l}`:l;const h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,n,!0),this.lexer.state.top=h,0===t.length)break;const c=n.at(-1);if("code"===c?.type)break;if("blockquote"===c?.type){const e=c,a=e.raw+"\n"+t.join("\n"),o=this.blockquote(a);n[n.length-1]=o,r=r.substring(0,r.length-e.raw.length)+o.raw,i=i.substring(0,i.length-e.text.length)+o.text;break}if("list"!==c?.type);else{const e=c,a=e.raw+"\n"+t.join("\n"),o=this.list(a);n[n.length-1]=o,r=r.substring(0,r.length-c.raw.length)+o.raw,i=i.substring(0,i.length-e.raw.length)+o.raw,t=a.substring(n.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:r,tokens:n,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let r=e[1].trim();const i=r.length>1,n={type:"list",raw:"",ordered:i,start:i?+r.slice(0,-1):"",loose:!1,items:[]};r=i?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=i?r:"[*+-]");const a=this.rules.other.listItemRegex(r);let o=!1;for(;t;){let r=!1,i="",s="";if(!(e=a.exec(t)))break;if(this.rules.block.hr.test(t))break;i=e[0],t=t.substring(i.length);let l=e[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,(t=>" ".repeat(3*t.length))),h=t.split("\n",1)[0],c=!l.trim(),d=0;if(this.options.pedantic?(d=2,s=l.trimStart()):c?d=e[1].length+1:(d=e[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=l.slice(d),d+=e[1].length),c&&this.rules.other.blankLine.test(h)&&(i+=h+"\n",t=t.substring(h.length+1),r=!0),!r){const e=this.rules.other.nextBulletRegex(d),r=this.rules.other.hrRegex(d),n=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;t;){const g=t.split("\n",1)[0];let p;if(h=g,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),p=h):p=h.replace(this.rules.other.tabCharGlobal," "),n.test(h))break;if(a.test(h))break;if(o.test(h))break;if(e.test(h))break;if(r.test(h))break;if(p.search(this.rules.other.nonSpaceChar)>=d||!h.trim())s+="\n"+p.slice(d);else{if(c)break;if(l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(n.test(l))break;if(a.test(l))break;if(r.test(l))break;s+="\n"+h}c||h.trim()||(c=!0),i+=g+"\n",t=t.substring(g.length+1),l=p.slice(d)}}n.loose||(o?n.loose=!0:this.rules.other.doubleBlankLine.test(i)&&(o=!0));let g,p=null;this.options.gfm&&(p=this.rules.other.listIsTask.exec(s),p&&(g="[ ] "!==p[0],s=s.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:i,task:!!p,checked:g,loose:!1,text:s,tokens:[]}),n.raw+=i}const s=n.items.at(-1);if(!s)return;s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd(),n.raw=n.raw.trimEnd();for(let t=0;t<n.items.length;t++)if(this.lexer.state.top=!1,n.items[t].tokens=this.lexer.blockTokens(n.items[t].text,[]),!n.loose){const e=n.items[t].tokens.filter((t=>"space"===t.type)),r=e.length>0&&e.some((t=>this.rules.other.anyLine.test(t.raw)));n.loose=r}if(n.loose)for(let t=0;t<n.items.length;t++)n.items[t].loose=!0;return n}}html(t){const e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:"pre"===e[1]||"script"===e[1]||"style"===e[1],text:e[0]}}def(t){const e=this.rules.block.def.exec(t);if(e){const t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:r,title:i}}}table(t){const e=this.rules.block.table.exec(t);if(!e)return;if(!this.rules.other.tableDelimiter.test(e[2]))return;const r=Z(e[1]),i=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===i.length){for(const t of i)this.rules.other.tableAlignRight.test(t)?a.align.push("right"):this.rules.other.tableAlignCenter.test(t)?a.align.push("center"):this.rules.other.tableAlignLeft.test(t)?a.align.push("left"):a.align.push(null);for(let t=0;t<r.length;t++)a.header.push({text:r[t],tokens:this.lexer.inline(r[t]),header:!0,align:a.align[t]});for(const t of n)a.rows.push(Z(t,a.header.length).map(((t,e)=>({text:t,tokens:this.lexer.inline(t),header:!1,align:a.align[e]}))));return a}}lheading(t){const e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:"="===e[2].charAt(0)?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const t="\n"===e[1].charAt(e[1].length-1)?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const e=Q(t.slice(0,-1),"\\");if((t.length-e.length)%2==0)return}else{const t=function(t,e){if(-1===t.indexOf(e[1]))return-1;let r=0;for(let i=0;i<t.length;i++)if("\\"===t[i])i++;else if(t[i]===e[0])r++;else if(t[i]===e[1]&&(r--,r<0))return i;return-1}(e[2],"()");if(t>-1){const r=(0===e[0].indexOf("!")?5:4)+e[1].length+t;e[2]=e[2].substring(0,t),e[0]=e[0].substring(0,r).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){const t=this.rules.other.pedanticHrefTitle.exec(r);t&&(r=t[1],i=t[3])}else i=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(r=this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?r.slice(1):r.slice(1,-1)),tt(e,{href:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r,title:i?i.replace(this.rules.inline.anyPunctuation,"$1"):i},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){const t=e[(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!t){const t=r[0].charAt(0);return{type:"text",raw:t,text:t}}return tt(r,t,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(i&&(!i[3]||!r.match(this.rules.other.unicodeAlphaNumeric))&&(!i[1]&&!i[2]||!r||this.rules.inline.punctuation.exec(r))){const r=[...i[0]].length-1;let n,a,o=r,s=0;const l="*"===i[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,e=e.slice(-1*t.length+r);null!=(i=l.exec(e));){if(n=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!n)continue;if(a=[...n].length,i[3]||i[4]){o+=a;continue}if((i[5]||i[6])&&r%3&&!((r+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);const e=[...i[0]][0].length,l=t.slice(0,r+i.index+e+a);if(Math.min(r,a)%2){const t=l.slice(1,-1);return{type:"em",raw:l,text:t,tokens:this.lexer.inlineTokens(t)}}const h=l.slice(2,-2);return{type:"strong",raw:l,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(t),i=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&i&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(t){const e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){const e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let t,r;return"@"===e[2]?(t=e[1],r="mailto:"+t):(t=e[1],r=t),{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let t,r;if("@"===e[2])t=e[0],r="mailto:"+t;else{let i;do{i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??""}while(i!==e[0]);t=e[0],r="www."===e[1]?"http://"+e[0]:e[0]}return{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){const t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}}class rt{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||t.defaults,this.options.tokenizer=this.options.tokenizer||new et,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={other:a,block:X.normal,inline:V.normal};this.options.pedantic?(r.block=X.pedantic,r.inline=V.pedantic):this.options.gfm&&(r.block=X.gfm,this.options.breaks?r.inline=V.breaks:r.inline=V.gfm),this.tokenizer.rules=r}static get rules(){return{block:X,inline:V}}static lex(t,e){return new rt(e).lex(t)}static lexInline(t,e){return new rt(e).inlineTokens(t)}lex(t){t=t.replace(a.carriageReturn,"\n"),this.blockTokens(t,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const e=this.inlineQueue[t];this.inlineTokens(e.src,e.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],r=!1){for(this.options.pedantic&&(t=t.replace(a.tabCharGlobal," ").replace(a.spaceLine,""));t;){let i;if(this.options.extensions?.block?.some((r=>!!(i=r.call({lexer:this},t,e))&&(t=t.substring(i.raw.length),e.push(i),!0))))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);const r=e.at(-1);1===i.raw.length&&void 0!==r?r.raw+="\n":e.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);const r=e.at(-1);"paragraph"===r?.type||"text"===r?.type?(r.raw+="\n"+i.raw,r.text+="\n"+i.text,this.inlineQueue.at(-1).src=r.text):e.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length);const r=e.at(-1);"paragraph"===r?.type||"text"===r?.type?(r.raw+="\n"+i.raw,r.text+="\n"+i.raw,this.inlineQueue.at(-1).src=r.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),e.push(i);continue}let n=t;if(this.options.extensions?.startBlock){let e=1/0;const r=t.slice(1);let i;this.options.extensions.startBlock.forEach((t=>{i=t.call({lexer:this},r),"number"==typeof i&&i>=0&&(e=Math.min(e,i))})),e<1/0&&e>=0&&(n=t.substring(0,e+1))}if(this.state.top&&(i=this.tokenizer.paragraph(n))){const a=e.at(-1);r&&"paragraph"===a?.type?(a.raw+="\n"+i.raw,a.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):e.push(i),r=n.length!==t.length,t=t.substring(i.raw.length)}else if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length);const r=e.at(-1);"text"===r?.type?(r.raw+="\n"+i.raw,r.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):e.push(i)}else if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){let r=t,i=null;if(this.tokens.links){const t=Object.keys(this.tokens.links);if(t.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(r));)t.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(r));)r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(r));)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let n=!1,a="";for(;t;){let i;if(n||(a=""),n=!1,this.options.extensions?.inline?.some((r=>!!(i=r.call({lexer:this},t,e))&&(t=t.substring(i.raw.length),e.push(i),!0))))continue;if(i=this.tokenizer.escape(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.tag(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.link(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(i.raw.length);const r=e.at(-1);"text"===i.type&&"text"===r?.type?(r.raw+=i.raw,r.text+=i.text):e.push(i);continue}if(i=this.tokenizer.emStrong(t,r,a)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.codespan(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.br(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.del(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.autolink(t)){t=t.substring(i.raw.length),e.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(t))){t=t.substring(i.raw.length),e.push(i);continue}let o=t;if(this.options.extensions?.startInline){let e=1/0;const r=t.slice(1);let i;this.options.extensions.startInline.forEach((t=>{i=t.call({lexer:this},r),"number"==typeof i&&i>=0&&(e=Math.min(e,i))})),e<1/0&&e>=0&&(o=t.substring(0,e+1))}if(i=this.tokenizer.inlineText(o)){t=t.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(a=i.raw.slice(-1)),n=!0;const r=e.at(-1);"text"===r?.type?(r.raw+=i.raw,r.text+=i.text):e.push(i)}else if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}return e}}class it{options;parser;constructor(e){this.options=e||t.defaults}space(t){return""}code({text:t,lang:e,escaped:r}){const i=(e||"").match(a.notSpaceStart)?.[0],n=t.replace(a.endingNewline,"")+"\n";return i?'<pre><code class="language-'+J(i)+'">'+(r?n:J(n,!0))+"</code></pre>\n":"<pre><code>"+(r?n:J(n,!0))+"</code></pre>\n"}blockquote({tokens:t}){return`<blockquote>\n${this.parser.parse(t)}</blockquote>\n`}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>\n`}hr(t){return"<hr>\n"}list(t){const e=t.ordered,r=t.start;let i="";for(let e=0;e<t.items.length;e++){const r=t.items[e];i+=this.listitem(r)}const n=e?"ol":"ul";return"<"+n+(e&&1!==r?' start="'+r+'"':"")+">\n"+i+"</"+n+">\n"}listitem(t){let e="";if(t.task){const r=this.checkbox({checked:!!t.checked});t.loose?"paragraph"===t.tokens[0]?.type?(t.tokens[0].text=r+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&"text"===t.tokens[0].tokens[0].type&&(t.tokens[0].tokens[0].text=r+" "+J(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):e+=r+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>\n`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>\n`}table(t){let e="",r="";for(let e=0;e<t.header.length;e++)r+=this.tablecell(t.header[e]);e+=this.tablerow({text:r});let i="";for(let e=0;e<t.rows.length;e++){const n=t.rows[e];r="";for(let t=0;t<n.length;t++)r+=this.tablecell(n[t]);i+=this.tablerow({text:r})}return i&&(i=`<tbody>${i}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+i+"</table>\n"}tablerow({text:t}){return`<tr>\n${t}</tr>\n`}tablecell(t){const e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>\n`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${J(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:r}){const i=this.parser.parseInline(r),n=K(t);if(null===n)return i;let a='<a href="'+(t=n)+'"';return e&&(a+=' title="'+J(e)+'"'),a+=">"+i+"</a>",a}image({href:t,title:e,text:r}){const i=K(t);if(null===i)return J(r);let n=`<img src="${t=i}" alt="${r}"`;return e&&(n+=` title="${J(e)}"`),n+=">",n}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:J(t.text)}}class nt{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}}class at{options;renderer;textRenderer;constructor(e){this.options=e||t.defaults,this.options.renderer=this.options.renderer||new it,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new nt}static parse(t,e){return new at(e).parse(t)}static parseInline(t,e){return new at(e).parseInline(t)}parse(t,e=!0){let r="";for(let i=0;i<t.length;i++){const n=t[i];if(this.options.extensions?.renderers?.[n.type]){const t=n,e=this.options.extensions.renderers[t.type].call({parser:this},t);if(!1!==e||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(t.type)){r+=e||"";continue}}const a=n;switch(a.type){case"space":r+=this.renderer.space(a);continue;case"hr":r+=this.renderer.hr(a);continue;case"heading":r+=this.renderer.heading(a);continue;case"code":r+=this.renderer.code(a);continue;case"table":r+=this.renderer.table(a);continue;case"blockquote":r+=this.renderer.blockquote(a);continue;case"list":r+=this.renderer.list(a);continue;case"html":r+=this.renderer.html(a);continue;case"paragraph":r+=this.renderer.paragraph(a);continue;case"text":{let n=a,o=this.renderer.text(n);for(;i+1<t.length&&"text"===t[i+1].type;)n=t[++i],o+="\n"+this.renderer.text(n);r+=e?this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o,escaped:!0}]}):o;continue}default:{const t='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(t),"";throw new Error(t)}}}return r}parseInline(t,e=this.renderer){let r="";for(let i=0;i<t.length;i++){const n=t[i];if(this.options.extensions?.renderers?.[n.type]){const t=this.options.extensions.renderers[n.type].call({parser:this},n);if(!1!==t||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){r+=t||"";continue}}const a=n;switch(a.type){case"escape":case"text":r+=e.text(a);break;case"html":r+=e.html(a);break;case"link":r+=e.link(a);break;case"image":r+=e.image(a);break;case"strong":r+=e.strong(a);break;case"em":r+=e.em(a);break;case"codespan":r+=e.codespan(a);break;case"br":r+=e.br(a);break;case"del":r+=e.del(a);break;default:{const t='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(t),"";throw new Error(t)}}}return r}}class ot{options;block;constructor(e){this.options=e||t.defaults}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?rt.lex:rt.lexInline}provideParser(){return this.block?at.parse:at.parseInline}}class st{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=at;Renderer=it;TextRenderer=nt;Lexer=rt;Tokenizer=et;Hooks=ot;constructor(...t){this.use(...t)}walkTokens(t,e){let r=[];for(const i of t)switch(r=r.concat(e.call(this,i)),i.type){case"table":{const t=i;for(const i of t.header)r=r.concat(this.walkTokens(i.tokens,e));for(const i of t.rows)for(const t of i)r=r.concat(this.walkTokens(t.tokens,e));break}case"list":{const t=i;r=r.concat(this.walkTokens(t.items,e));break}default:{const t=i;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach((i=>{const n=t[i].flat(1/0);r=r.concat(this.walkTokens(n,e))})):t.tokens&&(r=r.concat(this.walkTokens(t.tokens,e)))}}return r}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach((t=>{const r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach((t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){const r=e.renderers[t.name];e.renderers[t.name]=r?function(...e){let i=t.renderer.apply(this,e);return!1===i&&(i=r.apply(this,e)),i}:t.renderer}if("tokenizer"in t){if(!t.level||"block"!==t.level&&"inline"!==t.level)throw new Error("extension level must be 'block' or 'inline'");const r=e[t.level];r?r.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&("block"===t.level?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:"inline"===t.level&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)})),r.extensions=e),t.renderer){const e=this.defaults.renderer||new it(this.defaults);for(const r in t.renderer){if(!(r in e))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const i=r,n=t.renderer[i],a=e[i];e[i]=(...t)=>{let r=n.apply(e,t);return!1===r&&(r=a.apply(e,t)),r||""}}r.renderer=e}if(t.tokenizer){const e=this.defaults.tokenizer||new et(this.defaults);for(const r in t.tokenizer){if(!(r in e))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const i=r,n=t.tokenizer[i],a=e[i];e[i]=(...t)=>{let r=n.apply(e,t);return!1===r&&(r=a.apply(e,t)),r}}r.tokenizer=e}if(t.hooks){const e=this.defaults.hooks||new ot;for(const r in t.hooks){if(!(r in e))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;const i=r,n=t.hooks[i],a=e[i];ot.passThroughHooks.has(r)?e[i]=t=>{if(this.defaults.async)return Promise.resolve(n.call(e,t)).then((t=>a.call(e,t)));const r=n.call(e,t);return a.call(e,r)}:e[i]=(...t)=>{let r=n.apply(e,t);return!1===r&&(r=a.apply(e,t)),r}}r.hooks=e}if(t.walkTokens){const e=this.defaults.walkTokens,i=t.walkTokens;r.walkTokens=function(t){let r=[];return r.push(i.call(this,t)),e&&(r=r.concat(e.call(this,t))),r}}this.defaults={...this.defaults,...r}})),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return rt.lex(t,e??this.defaults)}parser(t,e){return at.parse(t,e??this.defaults)}parseMarkdown(t){return(e,r)=>{const i={...r},n={...this.defaults,...i},a=this.onError(!!n.silent,!!n.async);if(!0===this.defaults.async&&!1===i.async)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==e)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof e)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));n.hooks&&(n.hooks.options=n,n.hooks.block=t);const o=n.hooks?n.hooks.provideLexer():t?rt.lex:rt.lexInline,s=n.hooks?n.hooks.provideParser():t?at.parse:at.parseInline;if(n.async)return Promise.resolve(n.hooks?n.hooks.preprocess(e):e).then((t=>o(t,n))).then((t=>n.hooks?n.hooks.processAllTokens(t):t)).then((t=>n.walkTokens?Promise.all(this.walkTokens(t,n.walkTokens)).then((()=>t)):t)).then((t=>s(t,n))).then((t=>n.hooks?n.hooks.postprocess(t):t)).catch(a);try{n.hooks&&(e=n.hooks.preprocess(e));let t=o(e,n);n.hooks&&(t=n.hooks.processAllTokens(t)),n.walkTokens&&this.walkTokens(t,n.walkTokens);let r=s(t,n);return n.hooks&&(r=n.hooks.postprocess(r)),r}catch(t){return a(t)}}}onError(t,e){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",t){const t="<p>An error occurred:</p><pre>"+J(r.message+"",!0)+"</pre>";return e?Promise.resolve(t):t}if(e)return Promise.reject(r);throw r}}}const lt=new st;function ht(t,e){return lt.parse(t,e)}ht.options=ht.setOptions=function(t){return lt.setOptions(t),ht.defaults=lt.defaults,r(ht.defaults),ht},ht.getDefaults=e,ht.defaults=t.defaults,ht.use=function(...t){return lt.use(...t),ht.defaults=lt.defaults,r(ht.defaults),ht},ht.walkTokens=function(t,e){return lt.walkTokens(t,e)},ht.parseInline=lt.parseInline,ht.Parser=at,ht.parser=at.parse,ht.Renderer=it,ht.TextRenderer=nt,ht.Lexer=rt,ht.lexer=rt.lex,ht.Tokenizer=et,ht.Hooks=ot,ht.parse=ht;const ct=ht.options,dt=ht.setOptions,gt=ht.use,pt=ht.walkTokens,ut=ht.parseInline,ft=ht,mt=at.parse,Ct=rt.lex;t.Hooks=ot,t.Lexer=rt,t.Marked=st,t.Parser=at,t.Renderer=it,t.TextRenderer=nt,t.Tokenizer=et,t.getDefaults=e,t.lexer=Ct,t.marked=ht,t.options=ct,t.parse=ft,t.parseInline=ut,t.parser=mt,t.setOptions=dt,t.use=gt,t.walkTokens=pt})),OrgChart.events.on("renderbuttons",(function(t,e){if(e.node&&e.node.tags&&e.node.tags.has("group-dotted-lines")){var r=t.getScale(),i=OrgChart.t(e.node.templateName,e.node.min,r),n="";e.node.min?(i.nodeGroupDottedOpenButton||console.error(`[${e.node.templateName}].nodeGroupDottedOpenButton is not defined`),n+=`<g style="cursor:pointer;" data-ctrl-n-dotted-open="${e.node.id}" transform="matrix(1,0,0,1,${e.node.x},${e.node.y})">`,n+=i.nodeGroupDottedOpenButton):(i.nodeGroupDottedCloseButton||console.error(`[${e.node.templateName}].nodeGroupDottedCloseButton is not defined`),n+=`<g style="cursor:pointer;" transform="matrix(1,0,0,1,${e.node.x},${e.node.y})" data-ctrl-n-dotted-close="${e.node.id}">`,n+=i.nodeGroupDottedCloseButton),n=(n+="</g>").replaceAll("{cw}",e.node.w/2).replaceAll("{ch}",e.node.h/2).replaceAll("{ew}",e.node.w-(e.node.padding?e.node.padding[1]:0)).replaceAll("{eh}",e.node.h-(e.node.padding?e.node.padding[2]:0));var a=t.getNode(e.node.stChildrenIds[0]);if(-1!=n.indexOf("{collapsed-children-count}")){var o=OrgChart.collapsedChildrenCount(t,a);n=n.replace("{collapsed-children-count}",o)}if(-1!=n.indexOf("{collapsed-children-total-count}")){var s=OrgChart.collapsedChildrenTotalCount(t,a);n=n.replace("{collapsed-children-total-count}",s)}if(-1!=n.indexOf("{children-count}")){var l=OrgChart.childrenCount(t,a);n=n.replace("{children-count}",l)}if(-1!=n.indexOf("{children-total-count}")){var h=OrgChart.childrenTotalCount(t,a);n=n.replace("{children-total-count}",h)}e.html+=n}})),OrgChart.events.on("redraw",(function(t,e){if(t.config.groupDottedLines.length){for(var r=t.element.querySelectorAll("[data-ctrl-n-dotted-close]"),i=0;i<r.length;i++)r[i].addEventListener("click",(function(){var e=this.getAttribute("data-ctrl-n-dotted-close");t.minimize(e)}));var n=t.element.querySelectorAll("[data-ctrl-n-dotted-open]");for(i=0;i<n.length;i++)n[i].addEventListener("click",(function(){var e=this.getAttribute("data-ctrl-n-dotted-open");t.maximize(e)}))}})),void 0===OrgChart&&(OrgChart={}),OrgChart.prototype.undo=function(t){if(this.config.undoRedoStorageName){var e=this.undoStepsCount();if(0!=e){this._putInRedoStack();var r=`${this.config.undoRedoStorageName}_undo_`+(e-1),i=sessionStorage.getItem(r);sessionStorage.removeItem(r);var n=JSON.parse(i);this.config.nodes=n.nodes,this.config.clinks=n.clinks,this.config.slinks=n.slinks,this.config.groupDottedLines=n.groupDottedLines,this.config.dottedLines=n.dottedLines,this._ai.setContext(),OrgChart.events.publish("updated",[this]),this.filterUI.update(),this.draw(OrgChart.action.update,void 0,t),this.undoRedoUI.refresh()}}},OrgChart.prototype.redo=function(t){if(this.config.undoRedoStorageName){var e=this.redoStepsCount();if(0!=e){this._putInUndoStack();var r=`${this.config.undoRedoStorageName}_redo_`+(e-1),i=sessionStorage.getItem(r);sessionStorage.removeItem(r);var n=JSON.parse(i);this.config.nodes=n.nodes,this.config.clinks=n.clinks,this.config.slinks=n.slinks,this.config.groupDottedLines=n.groupDottedLines,this.config.dottedLines=n.dottedLines,this._ai.setContext(),OrgChart.events.publish("updated",[this]),this.filterUI.update(),this.draw(OrgChart.action.update,void 0,t),this.undoRedoUI.refresh()}}},OrgChart.prototype.clearRedo=function(){if(this.config.undoRedoStorageName){for(var t=`${this.config.undoRedoStorageName}_redo_`,e=Object.keys(sessionStorage),r=0;-1!=e.indexOf(t+r);)sessionStorage.removeItem(t+r),r++;this.undoRedoUI.refresh()}},OrgChart.prototype.clearUndo=function(){if(this.config.undoRedoStorageName){for(var t=`${this.config.undoRedoStorageName}_undo_`,e=Object.keys(sessionStorage),r=0;-1!=e.indexOf(t+r);)sessionStorage.removeItem(t+r),r++;this.undoRedoUI.refresh()}},OrgChart.prototype.undoStepsCount=function(){for(var t=`${this.config.undoRedoStorageName}_undo_`,e=Object.keys(sessionStorage),r=0;-1!=e.indexOf(t+r);)r++;return r},OrgChart.prototype.redoStepsCount=function(){for(var t=`${this.config.undoRedoStorageName}_redo_`,e=Object.keys(sessionStorage),r=0;-1!=e.indexOf(t+r);)r++;return r},OrgChart.prototype._putInUndoStack=function(){if(this.config.undoRedoStorageName){var t=`${this.config.undoRedoStorageName}_undo_`+this.undoStepsCount();sessionStorage.setItem(t,JSON.stringify({nodes:this.config.nodes,clinks:this.config.clinks,slinks:this.config.slinks,groupDottedLines:this.config.groupDottedLines,dottedLines:this.config.dottedLines}))}},OrgChart.prototype._putInRedoStack=function(){if(this.config.undoRedoStorageName){var t=`${this.config.undoRedoStorageName}_redo_`+this.redoStepsCount();sessionStorage.setItem(t,JSON.stringify({nodes:this.config.nodes,clinks:this.config.clinks,slinks:this.config.slinks,groupDottedLines:this.config.groupDottedLines,dottedLines:this.config.dottedLines}))}},void 0===OrgChart&&(OrgChart={}),OrgChart.undoRedoUI=function(){this.instance=null,this._event_id=OrgChart._guid()},OrgChart.undoRedoUI.prototype.init=function(t){t.config.undoRedoStorageName&&(this.instance=t,this.refresh())},OrgChart.undoRedoUI.prototype.refresh=function(){var t=this;if(this.instance.config.undoRedoStorageName){var e={undoStepsCount:this.instance.undoStepsCount(),redoStepsCount:this.instance.redoStepsCount()};if(!1!==OrgChart.events.publish("change",[this,e])){var r=this.instance.element.querySelector("[data-undo]"),i=this.instance.element.querySelector("[data-redo]");if(!r||!i){var n=document.createElement("div");n.classList.add("boc-undo-redo"),n.innerHTML=`<span data-undo>${OrgChart.icon.undo(50,50,"")}<span class="boc-undo-i"></span></span>\n <span data-redo>${OrgChart.icon.redo(50,50,"")}<span class="boc-redo-i"></span></span>`,this.instance.element.appendChild(n),r=this.instance.element.querySelector("[data-undo]"),i=this.instance.element.querySelector("[data-redo]"),r.addEventListener("click",(function(){t.instance.undo()})),i.addEventListener("click",(function(){t.instance.redo()}))}e.undoStepsCount>0?(r.classList.add("boc-ur-clickable"),r.querySelector(".boc-undo-i").innerHTML=e.undoStepsCount,r.querySelector(".boc-undo-i").style.display="inline-block"):(r.classList.remove("boc-ur-clickable"),r.querySelector(".boc-undo-i").style.display="none"),e.redoStepsCount>0?(i.classList.add("boc-ur-clickable"),i.querySelector(".boc-redo-i").innerHTML=e.redoStepsCount,i.querySelector(".boc-redo-i").style.display="inline-block"):(i.classList.remove("boc-ur-clickable"),i.querySelector(".boc-redo-i").style.display="none")}}},OrgChart.undoRedoUI.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},OrgChart.undoRedoUI.prototype.onChange=function(t){return this.on("change",(function(e,r){return t.call(e,r)}))},OrgChart.events.on("redraw",(function(t,e){if(t.config.miniMap){if(t.manager.action!=OrgChart.action.move){OrgChart.miniMap._settings._scale=Math.min(OrgChart.miniMap.width/(t.response.boundary.maxX-t.response.boundary.minX),OrgChart.miniMap.height/(t.response.boundary.maxY-t.response.boundary.minY)),OrgChart.miniMap._settings._translateX=-t.response.boundary.minX*OrgChart.miniMap._settings._scale+(OrgChart.miniMap.width-(t.response.boundary.maxX-t.response.boundary.minX)*OrgChart.miniMap._settings._scale)/2,OrgChart.miniMap._settings._translateY=-t.response.boundary.minY*OrgChart.miniMap._settings._scale+(OrgChart.miniMap.height-(t.response.boundary.maxY-t.response.boundary.minY)*OrgChart.miniMap._settings._scale)/2;var r=t.getViewBox();OrgChart.miniMap._init(t),OrgChart.miniMap._drawMainCanvas(t),OrgChart.miniMap._drawRectSelectorCanvas(t,r);var i,n,a,o,s=t.element.querySelector('[data-id="mini-map-focus"]'),l=!1,h=null;s.onmousedown=function(t){var e,a,o,h=s.getBoundingClientRect(),c=h.left,d=h.top;if(i=parseInt(t.clientX-c),n=parseInt(t.clientY-d),e=n,a=(i-OrgChart.miniMap._settings._translateX)/OrgChart.miniMap._settings._scale,o=(e-OrgChart.miniMap._settings._translateY)/OrgChart.miniMap._settings._scale,a>r[0]&&a<r[0]+r[2]&&o>r[1]&&o<r[1]+r[3])return t.preventDefault(),t.stopPropagation(),void(l=!0)},s.onmousemove=function(e){if(l){e.preventDefault(),e.stopPropagation(),OrgChart.miniMap._mouseMove=!0;var c=s.getBoundingClientRect(),d=c.left,g=c.top;a=parseInt(e.clientX-d),o=parseInt(e.clientY-g);var p=(a-i)/OrgChart.miniMap._settings._scale,u=(o-n)/OrgChart.miniMap._settings._scale;r[0]=p+r[0],r[1]=u+r[1],t.setViewBox(r),h&&(clearTimeout(h),h=null),h=setTimeout((function(){t._draw(!0,OrgChart.action.move)}),300),OrgChart.miniMap._drawRectSelectorCanvas(t,r),i=a,n=o}},s.onmouseup=function(t){l&&(t.preventDefault(),t.stopPropagation(),l=!1)},s.onmouseout=function(t){l&&(t.preventDefault(),t.stopPropagation(),l=!1,OrgChart.miniMap._mouseMove=!1)},s.onclick=function(e){if(e.preventDefault(),e.stopPropagation(),OrgChart.miniMap._mouseMove)OrgChart.miniMap._mouseMove=!1;else{var i=s.getBoundingClientRect(),n=i.left,l=i.top;a=parseInt(e.clientX-n),o=parseInt(e.clientY-l);var c=a/OrgChart.miniMap._settings._scale,d=o/OrgChart.miniMap._settings._scale;r[0]=c-(r[0]+r[2]-r[0])/2-OrgChart.miniMap._settings._translateX/OrgChart.miniMap._settings._scale,r[1]=d-(r[1]+r[3]-r[1])/2-OrgChart.miniMap._settings._translateY/OrgChart.miniMap._settings._scale,t.setViewBox(r),h&&(clearTimeout(h),h=null),h=setTimeout((function(){t._draw(!0,OrgChart.action.move)}),300),OrgChart.miniMap._drawRectSelectorCanvas(t,r)}}}}else{var c=t.element.querySelector('[data-id="mini-map"]');c&&c.parentNode.removeChild(c)}})),OrgChart.miniMap={},OrgChart.miniMap._settings={_translateX:0,_translateY:0,_scale:1},OrgChart.miniMap._drawMainCanvas=function(t){var e=t.element.querySelector('[data-id="mini-map-main"]'),r=e.getContext("2d");OrgChart.miniMap._initCtx(t,e,1);var i=0,n=[];!function t(e,a){if(Array.isArray(a))for(var o=0;o<a.length;o++)t(e,a[o]);else{r.fillStyle=OrgChart.miniMap.colors[3],r.beginPath(),r.lineWidth="0.5",r.fillRect(a.x,a.y,a.w,a.h),r.strokeRect(a.x,a.y,a.w,a.h);for(o=0;o<a.stChildrenIds.length;o++)i++,n.includes(a.id)||(1==i?r.fillStyle=OrgChart.miniMap.colors[0]:2==i?r.fillStyle=OrgChart.miniMap.colors[1]:3==i&&(r.fillStyle=OrgChart.miniMap.colors[2]),r.beginPath(),r.fillRect(a.x,a.y,a.w,a.h),r.strokeRect(a.x,a.y,a.w,a.h),n.push(a.id)),t(e,e.getNode(a.stChildrenIds[o])),i--;for(o=0;o<a.childrenIds.length;o++)t(e,e.getNode(a.childrenIds[o]))}}(t,t.roots)},OrgChart.miniMap._drawRectSelectorCanvas=function(t,e){var r=t.element.querySelector('[data-id="mini-map-focus"]'),i=r.getContext("2d");OrgChart.miniMap._initCtx(t,r,OrgChart.miniMap.opacity);var n=e[0],a=e[1],o=e[2],s=e[3];i.lineWidth=.5/OrgChart.miniMap._settings._scale,i.strokeStyle=OrgChart.miniMap.focusStroke,i.globalAlpha=1,i.clearRect(n,a,o,s),i.strokeRect(n,a,o,s)},OrgChart.miniMap._initCtx=function(t,e,r){var i=e.getContext("2d");e.width=e.width,e.height=e.height,i.clearRect(0,0,OrgChart.miniMap.width,OrgChart.miniMap.height),i.globalAlpha=r,1!=r&&(i.fillStyle=OrgChart.miniMap.selectorBackgroundColor,i.fillRect(0,0,OrgChart.miniMap.width,OrgChart.miniMap.height)),i.translate(OrgChart.miniMap._settings._translateX,OrgChart.miniMap._settings._translateY),i.scale(OrgChart.miniMap._settings._scale,OrgChart.miniMap._settings._scale)},OrgChart.miniMap._init=function(t){if(!t.element.querySelector('[data-id="mini-map"]')){var e=document.createElement("canvas");e.width=OrgChart.miniMap.width,e.height=OrgChart.miniMap.height,e.setAttribute("data-id","mini-map-main"),e.style.display="inline-block",e.style.backgroundColor=OrgChart.miniMap.backgroundColor,e.style.position="absolute",e.style.top=0,e.style.left=0;var r=document.createElement("canvas");r.width=OrgChart.miniMap.width,r.height=OrgChart.miniMap.height,r.setAttribute("data-id","mini-map-focus"),r.style.display="inline-block",r.style.position="absolute",r.style.top=0,r.style.left=0;var i=document.createElement("div");i.setAttribute("data-id","mini-map"),i.style.position="absolute";for(var n=["top","right","left","bottom"],a=0;a<n.length;a++){var o=n[a];OrgChart.isNEU(OrgChart.miniMap.position[o])||("padding"==OrgChart.miniMap.position[o]?i.style[o]=t.config.padding+"px":i.style[o]=OrgChart.miniMap.position[o]+"px")}i.style.border=OrgChart.miniMap.border,i.style.padding=OrgChart.miniMap.padding+"px",i.style.backgroundColor=OrgChart.miniMap.backgroundColor;var s=document.createElement("div");s.style.position="relative",s.style.width=OrgChart.miniMap.width+"px",s.style.height=OrgChart.miniMap.height+"px",s.appendChild(e),s.appendChild(r),i.appendChild(s),t.element.appendChild(i);var l=function(e,r){t.__mouseScrollHandler(i,r)};t._addEvent(i,"DOMMouseScroll",l),t._addEvent(i,"mousewheel",l);var h=0,c=0,d=function(t){OrgChart.miniMap._mouseMove=!0;var e=t.clientX-h,r=t.clientY-c;if(!OrgChart.isNEU(i.style.left)){var n=parseFloat(i.style.left)+e;i.style.left=`${n}px`}if(!OrgChart.isNEU(i.style.right)){var a=parseFloat(i.style.right)-e;i.style.right=`${a}px`}if(!OrgChart.isNEU(i.style.bottom)){var o=parseFloat(i.style.bottom)-r;i.style.bottom=`${o}px`}if(!OrgChart.isNEU(i.style.top)){var s=parseFloat(i.style.top)+r;i.style.top=`${s}px`}h=t.clientX,c=t.clientY},g=function(){document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",g)};OrgChart.miniMap.draggable&&i.addEventListener("mousedown",(function(t){h=t.clientX,c=t.clientY,document.addEventListener("mousemove",d),document.addEventListener("mouseup",g)}))}},OrgChart.miniMap.colors=["#E0E0E0","#BDBDBD","#9E9E9E","#757575"],OrgChart.miniMap.selectorBackgroundColor="white",OrgChart.miniMap.backgroundColor="white",OrgChart.miniMap.focusStroke="#f57c00",OrgChart.miniMap.opacity=.4,OrgChart.miniMap.border="1px solid #aeaeae",OrgChart.miniMap.width=250,OrgChart.miniMap.height=140,OrgChart.miniMap.padding=5,OrgChart.miniMap.position={top:void 0,left:"padding",right:void 0,bottom:"padding"},OrgChart.miniMap.draggable=!0,OrgChart._search={},OrgChart._search.search=function(t,e,r,i,n,a,o){var s=[],l=e.toLowerCase(),h=l.split(" ");if(o&&h.length>1){var c=h[0];o[c]&&(r=[o[c]],h=(l=l.replace(c,"").trim()).split(" "))}h=h.filter((function(t,e,r){return r.indexOf(t)===e}));for(var d={},g=0;g<t.length;g++)for(var p=t[g],u=0;u<r.length;u++){var f=r[u];if(!OrgChart.isNEU(p[f])){var m=p[f];if(null!=(e=OrgChart._search.searchAndComputeScore(h,m,f,a))){var C=p.id;if(d[C]){if(d[C]&&d[C]<e.__score){d[C]=e.__score;for(var b=s.length-1;b>=0;b--)s[b].id==C&&s.splice(b,1);OrgChart._search.addNodeToResult(s,i,p,e,f,n)}}else d[C]=e.__score,OrgChart._search.addNodeToResult(s,i,p,e,f,n)}}}return s.sort((function(t,e){return t.__score<e.__score?1:t.__score>e.__score?-1:0})),s},OrgChart._search.addNodeToResult=function(t,e,r,i,n,a){var o={};o.id=r.id,OrgChart.isNEU(r[a])||(o[a]=r[a]);for(var s=0;s<e.length;s++){var l=e[s];OrgChart.isNEU(r[l])||OrgChart.isNEU(o[l])&&(o[l]=r[l])}null!=i&&(OrgChart.isNEU(o.__score)&&(o.__score=i.__score),OrgChart.isNEU(o.__searchField)&&(o.__searchField=n),OrgChart.isNEU(o.__searchMarks)&&(o.__searchMarks=i.__searchMarks)),t.push(o)},OrgChart._search.searchAndComputeScore=function(t,e,r,i){if(OrgChart.isNEU(e))return null;if(OrgChart.isNEU(t))return null;if(!t.length)return null;"string"!=typeof e&&(e=e.toString());var n=e.toLowerCase(),a=OrgChart._search.searchIndexesOf(n,t);if(!a.length)return null;for(var o=n.length/100,s=0,l=0,h=s>0?100:0,c=0,d=0;d<t.length;d++)for(var g=t[d],p=0;p<a.length;p++)if(-1!=g.indexOf(a[p].searchPhrase)){c++;break}var u=100/(t.length/c);if(a.length){l=a[0].start;for(p=0;p<a.length;p++)if(s+=a[p].length,a[p].start<l&&(l=a[p].start),p>=1&&a[p-1].start>a[p].start){h=0;break}}var f=0;0!=s&&(f=s/o);var m=s>0?100:0;0!=l&&(m=100-l/o);var C=0;i&&i[r]&&(C=i[r]),u&&(u=u/100*50),f>0&&(f=f/100*10),m>0&&(m=m/100*10),h>0&&(h=h/100*10),C>0&&(C=C/100*20);var b=Math.round(1e4*(u+f+m+h+C));a.sort((function(t,e){return t.start<e.start?-1:t.start>e.start?1:0}));for(p=a.length-1;p>=0;p--)for(d=0;d<a.length;d++)d<p&&a[d].start+a[d].length>a[p].start&&a.splice(p,1);var v=e;for(p=a.length-1;p>=0;p--)v=(v=v.insert(a[p].start+a[p].length,"</mark>")).insert(a[p].start,"<mark>");return{__searchMarks:v,__score:b}},OrgChart._search.searchIndexesOf=function(t,e){var r=[];if(!OrgChart.isNEU(t))for(var i=0;i<e.length;i++){var n=e[i];if(!OrgChart.isNEU(n))for(var a=0;(a=t.indexOf(n,a))>-1;)r.push({length:n.length,start:a,searchPhrase:n}),a+=n.length}return r.sort((function(t,e){return t.length<e.length?1:t.length>e.length||t.start<e.start?-1:t.start>e.start?1:0})),r=r.filter((function(t){for(var e=!1,i=0;i<r.length;i++){var n=r[i].start,a=r[i].start+r[i].length-1,o=t.start,s=t.start+t.length-1;if(n==o&&a==s){e=!1;break}if(n>=o&&a<=s){e=!0;break}if(n<=o&&a>=s){e=!0;break}}return!e}))},OrgChart.events.on("redraw",(function(t,e){if(t.config.state){var r=[],i=[];!function t(e){if(Array.isArray(e))for(var n=0;n<e.length;n++)t(e[n]);else{("string"!=typeof e.id||"string"==typeof e.id&&-1==e.id.indexOf("split")&&-1==e.id.indexOf("mirror"))&&(r.push(e.id),1==e.min&&i.push(e.id));for(n=0;n<e.stChildren.length;n++)t(e.stChildren[n]);for(n=0;n<e.children.length;n++)t(e.children[n])}}(t.roots),OrgChart.state._put(t.config.roots,t.width(),t.height(),t.response.viewBox,r,i,t.response.adjustify,t.config.state)}})),OrgChart.state={},OrgChart.state._buildStateNames=function(t){return{paramScale:t+"-scale",paramX:t+"-x",paramY:t+"-y",paramExp:t+"-exp",paramMin:t+"-min",paramRoots:t+"-roots",paramAdjustify:t+"-adjustify"}},OrgChart.state._put=function(t,e,r,i,n,a,o,s){if(s&&!OrgChart.isNEU(n)&&0!=n.length){var l=OrgChart.state._buildStateNames(s.name),h={roots:t,scale:Math.min(e/i[2],r/i[3]),x:i[0],y:i[1],exp:n,min:a,adjustify:o};if(s.writeToUrlParams){var c=new URLSearchParams(window.location.search);c.has(l.paramScale)?c.set(l.paramScale,h.scale):c.append(l.paramScale,h.scale),c.has(l.paramX)?c.set(l.paramX,h.x):c.append(l.paramX,h.x),c.has(l.paramY)?c.set(l.paramY,h.y):c.append(l.paramY,h.y),c.has(l.paramExp)?c.set(l.paramExp,h.exp.join("*")):c.append(l.paramExp,h.exp.join("*")),c.has(l.paramRoots)&&Array.isArray(h.roots)?c.set(l.paramRoots,h.roots.join("*")):Array.isArray(h.roots)&&c.append(l.paramRoots,h.roots.join("*")),c.has(l.paramMin)?c.set(l.paramMin,h.min.join("*")):c.append(l.paramMin,h.min.join("*")),c.has(l.paramAdjustify)?c.set(l.paramAdjustify,h.adjustify.x+"*"+h.adjustify.y):c.append(l.paramAdjustify,h.adjustify.x+"*"+h.adjustify.y),window.history.replaceState(null,null,"?"+c)}s.writeToIndexedDB&&(h.id=s.name,OrgChart.idb.put(h,(function(t){0==t&&console.error("Cannot write row - "+s.name)}))),s.writeToLocalStorage&&OrgChart.localStorage.setItem(s.name,JSON.stringify(h))}},OrgChart.state._get=function(t,e,r,i){if(t){var n=OrgChart.state._buildStateNames(t.name);if(t.readFromUrlParams){var a=new URLSearchParams(window.location.search);if(a.has(n.paramScale)&&a.has(n.paramX)&&a.has(n.paramY)&&a.has(n.paramExp)&&a.has(n.paramMin)&&a.has(n.paramAdjustify)){var o={},s=parseFloat(a.get(n.paramScale)),l=parseFloat(a.get(n.paramX)),h=parseFloat(a.get(n.paramY));(d=[])[0]=l,d[1]=h,d[2]=e/s,d[3]=r/s,o.vb=d,o.scale=s,o.x=l,o.y=h,o.roots=null,a.has(n.paramRoots)&&(o.roots=a.get(n.paramRoots).split("*")),o.exp=a.get(n.paramExp).split("*"),o.min=a.get(n.paramMin).split("*");var c=a.get(n.paramAdjustify).split("*");return o.adjustify={x:parseFloat(c[0]),y:parseFloat(c[1])},void i(o)}if(!t.readFromIndexedDB&&!t.readFromLocalStorage)return void i(null)}if(t.readFromLocalStorage){var d;if(null!=(o=OrgChart.localStorage.getItem(t.name)))return o=JSON.parse(o),(d=[])[0]=o.x,d[1]=o.y,d[2]=e/o.scale,d[3]=r/o.scale,o.vb=d,void i(o);if(!t.readFromIndexedDB)return void i(null)}t.readFromIndexedDB&&OrgChart.idb.read(t.name,(function(n,a){if(0==n)console.error("Cannot read from - "+t.name),i(null);else if(null==n)i(null);else{var o=[];o[0]=a.x,o[1]=a.y,o[2]=e/a.scale,o[3]=r/a.scale,a.vb=o,i(a)}}))}else i(null)},OrgChart.state.clear=function(t){if(!t)return!1;try{localStorage.removeItem(t);var e=OrgChart.state._buildStateNames(t),r=new URLSearchParams(window.location.search);r.has(e.paramScale)&&r.delete(e.paramScale),r.has(e.paramX)&&r.delete(e.paramX),r.has(e.paramY)&&r.delete(e.paramY),r.has(e.paramExp)&&r.delete(e.paramExp),r.has(e.paramRoots)&&r.delete(e.paramRoots),r.has(e.paramMin)&&r.delete(e.paramMin),r.has(e.paramAdjustify)&&r.delete(e.paramAdjustify),window.history.replaceState(null,null,"?"+r),OrgChart.idb.delete(t,(function(e){0==e&&console.error("Cannot delete row - "+t)}))}catch{}},OrgChart._magnify={},OrgChart.prototype.magnify=function(t,e,r,i,n){i||(i=this.config.anim);var a=this.getNode(t),o=this.getNodeElement(t);if(a||o){var s=OrgChart._magnify[t];if(s&&(null!=s.timer&&clearInterval(s.timer),null!=s.timerBack&&clearInterval(s.timerBack),o.setAttribute("transform","matrix("+s.transformStart.toString()+")"),OrgChart._magnify[t]=null),r)o=o.cloneNode(!0),this.getSvg().appendChild(o);var l=OrgChart._getTransform(o),h=JSON.parse(JSON.stringify(l));h[0]=e,h[3]=e;var c=a.w+a.w*(e-1),d=a.h+a.h*(e-1);h[4]+=(a.w-c)/2,h[5]+=(a.h-d)/2;var g=OrgChart.animate(o,{transform:l},{transform:h},i.duration,i.func);OrgChart._magnify[t]={timer:g,transformStart:l,nodeElement:o,front:r},n&&n(o)}},OrgChart.prototype.magnifyBack=function(t,e,r){e||(e=this.config.anim);var i=OrgChart._magnify[t];if(i){null!=i.timer&&clearInterval(i.timer),null!=i.timerBack&&clearInterval(i.timerBack);var n=OrgChart._getTransform(i.nodeElement);i.timerBack=OrgChart.animate(i.nodeElement,{transform:n},{transform:i.transformStart},e.duration,e.func,(function(t){var e=t[0].getAttribute(OrgChart.attr.node_id);OrgChart._magnify[e]&&OrgChart._magnify[e].front&&(t[0].parentNode.removeChild(t[0]),OrgChart._magnify[e]=null),r&&r(t[0])}))}},void 0===OrgChart&&(OrgChart={}),OrgChart.events.on("init",(function(t,e){if(t.config.keyNavigation&&(t._addEvent(window,"keydown",t._windowKeyDownHandler),OrgChart.isNEU(t._keyNavigationActiveNodeId)&&t.roots&&t.roots.length)){var r=t.roots[0].id;OrgChart.isNEU(t.config.keyNavigation.focusId)||(r=t.config.keyNavigation.focusId),t._keyNavigationActiveNodeId=r,t.center(t._keyNavigationActiveNodeId)}})),OrgChart.prototype._windowKeyDownHandler=function(t,e){for(var r=e.target,i=null;r&&r!=this.element;){if(r.hasAttribute&&r.hasAttribute(OrgChart.attr.node_id)){i=r.getAttribute(OrgChart.attr.node_id);break}r=r.parentNode}if(r){var n=i?this.getNode(i):null,a={node:n,data:i?this.get(i):null,event:e};if(!1!==OrgChart.events.publish("key-down",[this,a])&&n)if("KeyF"==e.code)this.searchUI.find("");else if("ArrowRight"==e.code||n.isAssistant&&"ArrowDown"==e.code||n.isPartner&&"ArrowDown"==e.code){if(l=this.getNode(n.pid)){var o=l.childrenIds.indexOf(n.id);if(++o<l.childrenIds.length){var s=l.childrenIds[o];this._keyNavigationActiveNodeId=s,this.center(s)}}}else if("ArrowLeft"==e.code){if(l=this.getNode(n.pid)){o=l.childrenIds.indexOf(n.id);if(--o>=0){s=l.childrenIds[o];this._keyNavigationActiveNodeId=s,this.center(s)}}}else if("ArrowUp"==e.code){var l;if(l=this.getNode(n.pid)){s=l.id;if(n.isAssistant||l.hasAssistants||n.isPartner||l.hasPartners){o=l.childrenIds.indexOf(n.id);--o>=0&&(s=l.childrenIds[o])}this._keyNavigationActiveNodeId=s,this.center(s)}}else if("ArrowDown"==e.code)n.childrenIds.length&&(this._keyNavigationActiveNodeId=n.childrenIds[0],this.center(n.childrenIds[0]));else if("Space"==e.code){var h=r.getAttribute(OrgChart.attr.node_id);return void this.toggleExpandCollapse(h,e)}}},OrgChart.events.on("redraw",(function(t,e){t.config.keyNavigation&&OrgChart._keyNavigation(t)})),OrgChart.events.on("click",(function(t,e){t.config&&t.config.keyNavigation&&(t._keyNavigationActiveNodeId=e.node.id,t.center(e.node.id))})),OrgChart._keyNavigation=function(t){var e=t.element.querySelector(":focus");if(e&&e.parentElement&&e.parentElement.hasAttribute(OrgChart.attr.node_id)){var r=e.parentElement;(n=(i=e).querySelector("title"))&&n.parentNode.removeChild(n),i.removeAttribute("tabindex")}if(!OrgChart.isNEU(t._keyNavigationActiveNodeId)&&((r=t.getNodeElement(t._keyNavigationActiveNodeId))&&r.children.length)){var i;(i=r.children[0]).setAttribute("tabindex",2);var n,a={text:"",id:t._keyNavigationActiveNodeId};if(OrgChart.events.publish("screen-reader-text",[t,a]),!OrgChart.isNEU(a.text))(n=document.createElementNS("http://www.w3.org/2000/svg","title")).innerHTML=a.text,i.appendChild(n);OrgChart.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&t.searchUI.hide(),i.focus()}},OrgChart.elements={},OrgChart.elements.textbox=function(t,e,r,i){var n=OrgChart.elements._vidrf(t,e,i);if(n.doNotRender)return{html:""};var a="";return e.btn&&(a=`<a href="#" data-input-btn="" class="boc-link boc-link-boc-button">${e.btn}</a>`),{html:`<div class="boc-form-field" style="min-width: ${r};">\n <div class="boc-input" data-boc-input="" ${n.disabledAttribute} ${n.vlidators}>\n <label for="${n.id}">${OrgChart._escapeGreaterLessSign(n.label)}</label>\n <input ${n.readOnlyAttribute} data-binding="${OrgChart._escapeDoubleQuotes(n.binding)}" maxlength="256" id="${n.id}" name="${n.id}" type="text" value="${OrgChart._escapeDoubleQuotes(n.value)}" autocomplete="off">\n ${a}\n </div>\n </div>`,id:n.id,value:n.value}},OrgChart.elements.checkbox=function(t,e,r,i){var n=OrgChart.elements._vidrf(t,e,i);if(n.doNotRender)return{html:""};var a=n.value?"checked":"",o=i?'onclick="return false;"':"";return{html:`<div class="boc-form-field" style="min-width: ${r};" >\n <label class="boc-checkbox" data-boc-input="" ${n.disabledAttribute}>\n <input ${a} ${o} data-binding="${OrgChart._escapeDoubleQuotes(n.binding)}" type="checkbox"><span class="boc-checkbox-checkmark" type="checkbox"></span>${OrgChart._escapeGreaterLessSign(n.label)}\n </label>\n </div>`,id:n.id,value:a}},OrgChart.elements.select=function(t,e,r,i){if(i)return OrgChart.elements.textbox(t,e,r,i);var n=OrgChart.elements._vidrf(t,e,i);return n.doNotRender?{html:""}:{html:`<div class="boc-form-field" style="min-width: ${r};">\n <div class="boc-input" data-boc-input="" ${n.disabledAttribute} ${n.vlidators}>\n <label for="${n.id}">${OrgChart._escapeGreaterLessSign(n.label)}</label>\n <select data-binding="${OrgChart._escapeDoubleQuotes(n.binding)}" ${n.readOnlyAttribute} id="${n.id}" name="${n.id}">\n ${function(){for(var t="",e=0;e<n.options.length;e++){var r=n.options[e];t+=`<option ${r.value==n.value?"selected":""} value="${OrgChart._escapeDoubleQuotes(r.value)}">${OrgChart._escapeGreaterLessSign(r.text)}</option>`}return t}()} \n </select>\n </div>\n </div>`,id:n.id,value:n.value}},OrgChart.elements.multiSelect=function(t,e,r,i){if(i)return OrgChart.elements.textbox(t,e,r,i);var n=OrgChart.elements._vidrf(t,e,i);return n.doNotRender?{html:""}:{html:`<div class="boc-form-field" style="min-width: ${r};">\n <div class="boc-input" data-boc-input="" ${n.disabledAttribute} ${n.vlidators}>\n <label for="${n.id}">${OrgChart._escapeGreaterLessSign(n.label)}</label>\n <select class="multiple" data-binding="${OrgChart._escapeDoubleQuotes(n.binding)}" ${n.readOnlyAttribute} id="${n.id}" name="${n.id}" multiple>\n ${function(){for(var t="",e=0;e<n.options.length;e++){var r=n.options[e];t+=`<option ${n.value.includes(r.value)?"selected":""} value="${OrgChart._escapeDoubleQuotes(r.value)}">${OrgChart._escapeGreaterLessSign(r.text)}</option>`}return t}()} \n </select>\n </div>\n </div>`,id:n.id,value:n.value}},OrgChart.elements.date=function(t,e,r,i){var n=OrgChart.elements._vidrf(t,e,i);return n.doNotRender?{html:""}:{html:`<div class="boc-form-field" style="min-width: ${r};">\n <div class="boc-input" data-boc-input="" ${n.disabledAttribute} ${n.vlidators}>\n <label for="${n.id}" class="hasval">${OrgChart._escapeGreaterLessSign(n.label)}</label>\n <input data-binding="${OrgChart._escapeDoubleQuotes(n.binding)}" ${n.readOnlyAttribute} maxlength="256" id="${n.id}" name="${n.id}" type="date" value="${OrgChart._escapeDoubleQuotes(n.value)}" autocomplete="off">\n </div>\n </div>`,id:n.id,value:n.value}},OrgChart.elements._vidrf=function(t,e,r){var i={};if(e.binding||(e.binding=""),e.label||(e.label=""),"select"!=e.type||Array.isArray(e.options)?i.options=e.options:i.options=[],i.value=t&&!OrgChart.isNEU(t[e.binding])?t[e.binding]:"",r&&i.options)for(var n=0;n<i.options.length;n++)if(i.options[n].value==i.value){i.value=i.options[n].text;break}if(i.id=OrgChart.elements.generateId(),i.disabledAttribute=r?"data-boc-input-disabled":"",i.readOnlyAttribute=r?"readonly":"",i.id=i.id,r&&OrgChart.isNEU(i.value)&&(i.doNotRender=!0),r&&"photo"==e.binding&&(i.id=null,i.doNotRender=!0),i.binding=e.binding,i.label=e.label,i.vlidators="",e.vlidators)for(var a in e.vlidators)i.vlidators+=`data-v-${a}="${e.vlidators[a]}" `;return i},OrgChart.elements.ids=[],OrgChart.elements.generateId=function(){for(;;){var t="_"+("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4);if(!OrgChart.elements.ids.has(t))return OrgChart.elements.ids.push(t),t}},OrgChart.input={},OrgChart.input._timeout=null,OrgChart.input.initWithTimeout=function(){OrgChart.input._timeout&&(clearTimeout(OrgChart.input._timeout),OrgChart.input._timeout=null),OrgChart.input._timeout=setTimeout(OrgChart.input.init,200)},OrgChart.input.init=function(t){var e;e=t?t.querySelectorAll("[data-boc-input]"):document.querySelectorAll("[data-boc-input]");for(var r=0;r<e.length;r++){var i=e[r],n=null;i.type&&"hidden"==i.type.toLowerCase()&&(n=i),n||(n=i.querySelector("input")),n||(n=i.querySelector("select"));var a=i.querySelector("label");a&&(n.value||"select-one"==n.type&&n.selectedOptions&&n.selectedOptions.length&&""==n.selectedOptions[0].value&&n.selectedOptions[0].innerHTML)&&a.classList.add("hasval"),"checkbox"!=n.type.toLowerCase()&&n.addEventListener("focus",(function(){this.classList.remove("boc-validation-error");var t=this.parentNode.querySelector("label");t.classList.add("focused");var e=t.querySelector(".boc-validation-error-message");e&&e.parentNode.removeChild(e)})),"checkbox"!=n.type.toLowerCase()&&n.addEventListener("blur",(function(){OrgChart.input.blurHandler(this)}))}},OrgChart.input.blurHandler=function(t){var e=t.parentNode.querySelector("label");e.classList.remove("focused"),t.value||"date"==t.type?e.classList.add("hasval"):e.classList.remove("hasval")},OrgChart.input.validate=function(t){var e=null;t.type&&"hidden"==t.type.toLowerCase()&&(e=t),e||(e=t.querySelector("input")),e||(e=t.querySelector("select"));var r=t.querySelector("label");if(e.classList.remove("boc-validation-error"),r){var i=r.querySelector(".boc-validation-error-message");i&&i.parentNode.removeChild(i)}!e.selectedOptions&&e.value&&(e.value=e.value.trim());var n=t.getAttribute("data-v-required"),a=t.getAttribute("data-v-password"),o=t.getAttribute("data-v-email"),s=t.getAttribute("data-v-emails");return n&&""==e.value?(r.innerHTML+='<span class="boc-validation-error-message"> '+n+"</span>",e.classList.add("boc-validation-error"),!1):a&&!OrgChart.input.validatePassword(e.value)?(r.innerHTML+='<span class="boc-validation-error-message"> '+a+"</span>",e.classList.add("boc-validation-error"),!1):o&&!OrgChart.input.isValidEmail(e.value)?(r.innerHTML+='<span class="boc-validation-error-message"> '+o+"</span>",e.classList.add("boc-validation-error"),!1):!(s&&!OrgChart.input.isValidEmails(e.value))||(r.innerHTML+='<span class="boc-validation-error-message"> '+s+"</span>",e.classList.add("boc-validation-error"),!1)},OrgChart.input.validateAndGetData=function(t){for(var e=t.querySelectorAll("[data-boc-input]"),r=!0,i=0;i<e.length;i++){var n=e[i];OrgChart.input.validate(n)||(r=!1)}if(!r)return!1;var a=t.querySelectorAll("[data-binding]"),o={};for(i=0;i<a.length;i++){var s=a[i],l=s.getAttribute("data-binding");if("checkbox"==s.type.toLowerCase())o[l]=s.checked;else if(s.selectedOptions&&s.hasAttribute("multiple")){var h=s.selectedOptions;o[l]=Array.from(h).map((({value:t})=>t))}else o[l]=s.value}return o},OrgChart.input.validatePassword=function(t){return t&&(t=t.trim()),!(t.length<5)&&(!(t.length>18)&&-1==t.indexOf(" "))},OrgChart.input.isValidEmails=function(t){if(t)for(var e=t.split(","),r=0;r<e.length;r++){var i=e[r].trim();if(!OrgChart.input.isValidEmail(i))return!1}return!0},OrgChart.input.isValidEmail=function(t){t&&(t=t.trim());return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(t).toLowerCase())};OrgChart.ui.css=function(){return'<style data-boc-styles>.boc-ai-form{position:fixed;top:0;left:0;height:100%;width:100%;box-shadow:rgba(0,0,0,.2) 0 6px 6px 0,rgba(0,0,0,.19) 0 13px 20px 0;display:flex;flex-direction:column;height:100%;width:400px}.boc-dark .boc-ai-form{color:#aeaeae}.boc-light .boc-ai-form{color:#757575}.boc-ai-messages{font-size:16px}@media screen and (max-width:1000px){.boc-ai-form{width:100%}}.boc-dark .boc-ai-form{background-color:#252526}.boc-light .boc-ai-form{background-color:#fff}.boc-ai-button{font-size:32px;position:absolute;top:20px;left:20px;cursor:pointer;padding:12px;border-radius:50%;user-select:none}.boc-dark .boc-ai-button{color:#aeaeae}.boc-light .boc-ai-button{color:#757575}.boc-ai-button:hover{color:#fff;background-color:#039be5}.boc-ai-container{padding:0 14px;display:grid;grid-template-rows:40px auto 80px;gap:10px;height:100%}.boc-ai-container .boc-input input{padding-right:50px}.boc-ai-close{text-align:end;margin-top:20px}.boc-ai-close svg{cursor:pointer}.boc-ai-start{text-align:center;display:flex;justify-content:center;align-items:center;user-select:none}.boc-ai-start span{font-weight:700;font-size:32px;font:"Segoe UI",Arial,sans-serif;background:linear-gradient(90deg,#039be5 28%,#f57c00,#ffca28);color:transparent!important;background-clip:text;display:inline-block;padding:10px 0}.boc-ai-send.boc-ai-send-cansend{cursor:pointer;background-color:#039be5}.boc-ai-send.boc-ai-send-cansend:hover{background-color:#f57c00}.boc-ai-send.boc-ai-send-cansend:active{background-color:#ffca28}.boc-ai-send{background-color:transparent;position:absolute;right:7px;top:7px;width:38px;height:38px;border-radius:50%;text-align:center;background-repeat:no-repeat;background-position:center;background-size:20px 20px}.boc-ai-send svg{display:block;margin:auto;height:100%}.boc-ai-user-message{text-align:end;margin:14px 0}.boc-inner-user-message{padding:7px;border-radius:7px;display:inline-block}.boc-ai-middle{overflow-y:auto}.boc-ai-middle::-webkit-scrollbar{display:none}.boc-button{background-color:#039be5;cursor:pointer;width:calc(100%);height:50px;color:#fff;padding-top:5px;padding-left:7px;padding-right:7px;text-align:center;text-transform:uppercase;border:1px solid #3fc0ff;display:inline-block;border-radius:5px}.boc-button.orange{background-color:#f57c00;border:1px solid #ffa03e}.boc-button.yellow{background-color:#ffca28;border:1px solid #ffdf7c}.boc-button.lower{text-transform:unset}.boc-button.transparent{background-color:transparent}.boc-button:hover{background-color:#35afea}.boc-button.orange:hover{background-color:#f79632}.boc-button.yellow:hover{background-color:#ffd452}.boc-button:active{transform:matrix(.98,0,0,.98,0,0)}.boc-button-icon{text-align:initial;cursor:pointer;margin-bottom:15px;color:#039be5}.boc-dark .boc-button-icon:hover{background-color:#2d2d2d}.boc-light .boc-button-icon:hover{background-color:#ececec}.boc-button-icon>img{height:24px;width:24px;vertical-align:middle;padding:7px}.boc-button:focus{outline:0}.boc-button-icon>img{filter:invert(46%) sepia(66%) saturate(2530%) hue-rotate(171deg) brightness(95%) contrast(98%)}.boc-light .boc-button.transparent{color:#039be5}.boc-light .boc-button.transparent:hover{color:#fff}.boc-button-loading{background-color:transparent;cursor:pointer;width:calc(100% - 2px);height:50px;color:#fff;text-align:center;text-transform:uppercase;border:1px solid #027cb7;display:inline-block;display:flex;justify-content:center;align-items:center;display:none}.boc-button-loading .boc-loading-dots div{margin:0 10px}.boc-link-boc-button{position:absolute;right:10px;top:-1px}@media screen and (max-width:1000px){.boc-link-boc-button{right:50px}}[data-boc-input-disabled] .boc-link-boc-button{display:none}[dir=rtl] .boc-link-boc-button{left:10px;right:unset}.boc-img-button{width:48px;height:48px;cursor:pointer;border-radius:50%;background-color:#039be5;background-repeat:no-repeat;background-size:24px 24px;background-position:center center;margin:3px;display:inline-block}.boc-img-button:hover{background-color:#f57c00}.boc-checkbox{display:block;position:relative;padding-left:35px;margin-bottom:12px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap}.boc-checkbox input{position:absolute;opacity:0;cursor:pointer;height:0;width:0}.boc-checkbox-checkmark{position:absolute;top:0;left:0;height:25px;width:25px;border-radius:5px}.boc-dark [data-boc-input-disabled] .boc-checkbox-checkmark,.boc-dark [data-boc-input-disabled].boc-checkbox input:checked~.boc-checkbox-checkmark,.boc-light [data-boc-input-disabled] .boc-checkbox-checkmark,.boc-light [data-boc-input-disabled].boc-checkbox input:checked~.boc-checkbox-checkmark{background-color:#aeaeae!important}[data-boc-input-disabled].boc-checkbox{cursor:default}[dir=rtl] .boc-checkbox-checkmark{right:0}[dir=rtl] .boc-checkbox{padding-left:unset;padding-right:35px}.boc-dark .boc-checkbox-checkmark{background-color:#333;border:1px solid #5b5b5b}.boc-light .boc-checkbox-checkmark{background-color:#fff;border:1px solid #c7c7c7}.boc-dark .boc-checkbox:hover input~.boc-checkbox-checkmark{background-color:#3c3c3c}.boc-light .boc-checkbox:hover input~.boc-checkbox-checkmark{background-color:#f8f9f9}.boc-dark .boc-checkbox input:checked~.boc-checkbox-checkmark{background-color:#039be5}.boc-light .boc-checkbox input:checked~.boc-checkbox-checkmark{background-color:#039be5}.boc-checkbox-checkmark:after{content:"";position:absolute;display:none}.boc-checkbox input:checked~.boc-checkbox-checkmark:after{display:block}.boc-checkbox .boc-checkbox-checkmark:after{left:9px;top:5px;width:5px;height:10px;border:solid #fff;border-width:0 3px 3px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.boc-filter{user-select:none}.boc-light .boc-filter{color:#757575}.boc-dark .boc-filter{color:#ccc}.boc-filter>div>div{display:inline-block;padding:3px 10px;cursor:pointer}.boc-filter-menu fieldset,.boc-filter>div,.filter-field-selected{border-radius:5px}.boc-filter-menu fieldset{overflow-y:auto;max-height:300px}.boc-filter>div.boc-filter-menu{padding:10px}.boc-light .boc-filter>div.boc-filter-menu,.boc-light .filter-field-selected{background-color:#f8f9f9}.boc-dark .boc-filter>div.boc-filter-menu,.boc-dark .filter-field-selected{background-color:#3c3c3c}.boc-light .boc-filter>div{background-color:#eee}.boc-dark .boc-filter>div{background-color:#333}.boc-form-perspective{transform-style:preserve-3d;perspective:500px;position:absolute;top:32px}.boc-form{box-shadow:rgba(0,0,0,.2) 0 6px 6px 0,rgba(0,0,0,.19) 0 13px 20px 0;padding:14px;transform-origin:top center;user-select:none;display:none;position:relative;max-height:calc(100vh - 100px);overflow-y:auto;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.boc-form-bottom{border-bottom-left-radius:unset;border-bottom-right-radius:unset;border-top-left-radius:5px;border-top-right-radius:5px}.boc-form .separator{margin:0 10px}@media screen and (max-width:1000px){.boc-form-perspective{min-width:100%;max-height:calc(100% - 32px);left:unset!important;right:unset!important;transform:none!important}.boc-form .set{max-height:calc(100vh - 74px)}.boc-form-fieldset{max-width:unset!important}}.boc-light .boc-form .separator{border-bottom:1px solid #c7c7c7}.boc-dark .boc-form .separator{border-bottom:1px solid #5b5b5b}.boc-light .boc-form{background-color:#fff}.boc-dark .boc-form{background-color:#252526}.boc-item{padding:6px 12px 6px 12px;display:flex;flex-direction:row}.boc-light .boc-form .boc-item.selected,.boc-light .boc-form .boc-item:hover{background-color:#0074e8;color:#fff}.boc-dark .boc-form .boc-item.selected,.boc-dark .boc-form .boc-item:hover{background-color:#094771;color:#fff}.boc-item.selected img,.boc-item:hover img{filter:invert(100%)}.boc-item.selected img{visibility:visible!important}.boc-form-fieldset{display:flex;flex-wrap:wrap;margin:0!important}.boc-form-field{flex:1 0 21%;margin:3px;min-width:200px}.boc-form-field-100{flex:1 0 96%;margin:3px;min-width:200px}.boc-input{position:relative}.boc-input>input,.boc-input>select{height:50px;padding:18px 10px 2px 9px;width:100%;box-sizing:border-box;border-style:solid;border-width:1px}.boc-input select{height:50px;padding:20px 5px 4px 5px}[data-boc-input-disabled].boc-input>input,[data-boc-input-disabled].boc-input>select{border-color:transparent!important}.boc-light [data-boc-input-disabled]>input,.boc-light [data-boc-input-disabled]>select{background-color:#fff!important}.boc-dark [data-boc-input-disabled]>input,.boc-dark [data-boc-input-disabled]>select{background-color:#252526!important}[data-boc-input-disabled]>select{appearance:none;padding-left:8px}.boc-input>label{display:inline-block;position:absolute;padding-left:10px;padding-right:10px;color:#acacac;cursor:text;-webkit-transition:all .1s ease-out;-moz-transition:all .1s ease-out;-ms-transition:all .1s ease-out;-o-transition:all .1s ease-out;transition:all .1 ease-out;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:initial;text-align:initial;white-space:nowrap}.boc-input>label{top:12px;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 14px)}.boc-input>label.focused,.boc-input>label.hasval{top:-1px}.boc-input>input,.boc-input>select{outline:0;border-radius:5px}.boc-dark .boc-input>label.focused,.boc-light .boc-input>label.focused{color:#039be5}.boc-dark .boc-input>input,.boc-dark .boc-input>select{color:#ccc;background-color:#333;border-color:#5b5b5b}.boc-light .boc-input>input,.boc-light .boc-input>select{color:#757575;background-color:#fff;border-color:#c7c7c7}.boc-light .boc-input>input:focus,.boc-light .boc-input>select:focus{border-color:#039be5;background-color:#f8f9f9}.boc-dark .boc-input>input:focus,.boc-dark .boc-input>select:focus{border-color:#039be5;background-color:#3c3c3c}.boc-dark .boc-input>input.boc-validation-error,.boc-dark .boc-input>select.boc-validation-error,.boc-light .boc-input>input.boc-validation-error,.boc-light .boc-input>select.boc-validation-error{border-color:#ca2a2a}.boc-dark .boc-validation-error-message,.boc-light .boc-validation-error-message{color:#ca2a2a}.boc-input select.multiple{height:initial}.boc-link{color:#039be5;cursor:pointer;text-decoration:underline}.boc-link:hover{color:#f57c00}.boc-dark ::-webkit-scrollbar,.boc-light ::-webkit-scrollbar{width:15px;height:15px}.boc-dark ::-webkit-scrollbar-corner{background:#1e1e1e}.boc-dark ::-webkit-scrollbar-track{background:#1e1e1e;border-left:1px solid #333;border-top:1px solid #333}.boc-dark ::-webkit-scrollbar-thumb{background:#424242}.boc-dark ::-webkit-scrollbar-thumb:hover{background:#4f4f4f}.boc-dark ::-webkit-scrollbar-thumb:active{background:#5e5e5e}.boc-light ::-webkit-scrollbar-corner{background:#fff}.boc-light ::-webkit-scrollbar-track{background:#fff;border-left:1px solid #ddd;border-top:1px solid #ddd}.boc-light ::-webkit-scrollbar-thumb{background:#c1c1c1}.boc-light ::-webkit-scrollbar-thumb:hover{background:#929292}.boc-light ::-webkit-scrollbar-thumb:active{background:#666}.boc-edit-form{position:fixed;top:0;right:0;height:100%;width:100%;box-shadow:rgba(0,0,0,.2) 0 6px 6px 0,rgba(0,0,0,.19) 0 13px 20px 0;display:flex;flex-direction:column;height:100%;width:400px}@media screen and (max-width:1000px){.boc-edit-form{width:100%}}.boc-dark .boc-edit-form{background-color:#252526}.boc-light .boc-edit-form{background-color:#fff}.boc-edit-form-header{height:200px;text-align:center;border-radius:10px}.export-service .boc-edit-form-header{border-radius:unset}.boc-edit-form-title{color:#fff;margin:0;padding:14px 17px 7px 17px}.boc-edit-form-avatar{border-radius:50%;width:150px;height:150px;position:absolute;top:75px;border:5px solid #fff;left:50%;transform:translateX(-50%);background-color:#cacaca;box-shadow:rgba(0,0,0,.2) 0 6px 6px 0,rgba(0,0,0,.19) 0 13px 20px 0}.boc-edit-form-close{position:absolute;right:14px;top:14px;width:34px;height:34px;cursor:pointer}.boc-edit-form-fields{flex-grow:1;overflow-y:auto;overflow-x:hidden}.boc-edit-form-fields-inner{margin:0 7px 20px 7px}.boc-ai-user-message{text-align:end;margin:14px 0}.boc-inner-user-message{padding:7px;border-radius:7px;display:inline-block}.dark .boc-inner-user-message{background-color:#333}.light .boc-inner-user-message{background-color:#f9f9f9}.boc-chart-menu{opacity:0;display:inline-block;position:absolute;text-align:left;user-select:none;min-width:270px;box-shadow:rgba(0,0,0,.2) 0 4px 8px 0,rgba(0,0,0,.19) 0 6px 20px 0;font:13px/28px Helvetica,"Segoe UI",Arial,sans-serif;border-radius:10px}.boc-chart-menu>div:hover img{filter:invert(100%)}.boc-chart-menu [data-item]{text-align:start;padding:7px 10px}.boc-dark .boc-chart-menu [data-item]{background-color:#252526;color:#acacac;border-bottom:1px solid #333}.boc-dark .boc-chart-menu [data-item]:hover{background-color:#094771!important;color:#fff!important}.boc-dark .boc-chart-menu [data-item]:hover svg{filter:brightness(0) invert(1)}.boc-light .boc-chart-menu [data-item]{background-color:#fff;color:#333;border-bottom:1px solid #c7c7c7}.boc-light .boc-chart-menu [data-item]:hover{background-color:#0074e8!important;color:#fff!important}.boc-light .boc-chart-menu [data-item]:hover svg{filter:brightness(0) invert(1)}.boc-chart-menu [data-item] svg{vertical-align:middle}.boc-chart-menu [data-item]:first-child{border-top-left-radius:7px;border-top-right-radius:7px}.boc-chart-menu [data-item]:last-child{border-bottom-width:0;border-bottom-style:none;border-bottom-left-radius:7px;border-bottom-right-radius:7px}.boc-search{position:absolute}@media screen and (max-width:500px){.boc-search{width:calc(100% - 30px);left:15px}}.boc-search .boc-input{margin-bottom:0}.boc-search-input{color:#7a7a7a;width:100%;border:none;outline:0;padding-top:10px;padding-right:47px}.boc-search-image-td{width:43px}.boc-search-text-td{padding-inline-end:7px;line-height:15px;text-align:start}.boc-search table{box-shadow:rgba(0,0,0,.2) 0 4px 8px 0,rgba(0,0,0,.19) 0 6px 20px 0;margin:0 3.5px 0 3.5px;width:calc(100% - 7px);border-radius:7px}.boc-search table tr:first-child td:first-child{border-top-left-radius:7px}.boc-search table tr:first-child td:last-child{border-top-right-radius:7px}[dir=rtl] .boc-search table tr:first-child td:first-child{border-top-left-radius:unset;border-top-right-radius:7px}[dir=rtl] .boc-search table tr:first-child td:last-child{border-top-right-radius:unset;border-top-left-radius:7px}.boc-search table tr:last-child td:first-child{border-bottom-left-radius:7px}.boc-search table tr:last-child td:last-child{border-bottom-right-radius:7px}[dir=rtl] .boc-search table tr:last-child td:first-child{border-bottom-left-radius:unset;border-bottom-right-radius:7px}[dir=rtl] .boc-search table tr:last-child td:last-child{border-bottom-right-radius:unset;border-bottom-left-radius:7px}.boc-dark .boc-search table{background-color:#252526;color:#acacac}.boc-search [data-search-item-id]{cursor:pointer}.boc-search-photo{margin:7px 7px 0 7px;width:32px;height:32px;background-size:cover;background-position:top center;border-radius:50%;display:inline-block;border:1px solid #8c8c8c}.boc-search [data-search-item-id]:hover .boc-link{color:#ffca28}.boc-search [data-search-item-id]:hover .boc-link:hover{color:#f57c00}.boc-dark .boc-search [data-search-item-id] td{border-top:1px solid #333}.boc-dark .boc-search [data-search-item-id]:hover,.boc-dark .boc-search [data-selected=yes]{background-color:#094771;color:#fff}.boc-light .boc-search table{background-color:#fff;color:#333}.boc-light .boc-search [data-search-item-id] td{border-top:1px solid #c7c7c7}.boc-light .boc-search [data-search-item-id]:hover,.boc-light .boc-search [data-selected=yes]{background-color:#0074e8;color:#fff}.boc-search [data-search-item-id]:first-child td{border-top:unset}.boc-ripple-container{position:absolute;top:0;right:0;bottom:0;left:0}.boc-drag-over rect{opacity:.5}.boc-ripple-container span{transform:scale(0);border-radius:100%;position:absolute;opacity:.75;background-color:#fff;animation:boc-ripple 1s}@-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)}}.boc-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:.4s;transition:.4s}.boc-slider:before{position:absolute;content:"";height:16px;width:16px;left:4px;bottom:4px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.boc-slider.round{border-radius:24px}.boc-slider.round:before{border-radius:50%}svg text:hover{cursor:default}svg.boc-cursor-grab,svg.boc-cursor-grab text:hover{cursor:grab}svg.boc-cursor-nodrop,svg.boc-cursor-nodrop text:hover{cursor:no-drop}svg.boc-cursor-copy,svg.boc-cursor-copy text:hover{cursor:copy}svg.boc-cursor-move,svg.boc-cursor-move text:hover{cursor:move}#boc-close-btn:focus,#boc-close-btn:hover{color:#000;text-decoration:none;cursor:pointer}#boc-id-select:focus{outline:.5px solid #aeaeae}#boc-sampleDialog #title:hover{cursor:default;background:gray}.boc-light{background-color:#fff;font:13px/28px Helvetica,"Segoe UI",Arial,sans-serif}.boc-dark{background-color:#1e1e1e;font:13px/28px Helvetica,"Segoe UI",Arial,sans-serif}.boc-light .boc-fill{fill:#fff}.boc-dark .boc-fill{fill:#1e1e1e}.boc-dark input,.boc-dark select,.boc-light input,.boc-light select{font:16px Helvetica,"Segoe UI",Arial,sans-serif}.boc-dark h1,.boc-light h1{font-size:30px;line-height:1}.boc-dark text,.boc-light text{user-select:none}.boc-edit-form{position:absolute;border-radius:10px}.export-service .boc-edit-form{border-radius:unset}.boc-dark .boc-edit-form{color:#acacac}.boc-light .boc-edit-form{color:#333}.boc-dark ::-webkit-calendar-picker-indicator{filter:invert(70%)}.boc-light ::-webkit-calendar-picker-indicator{filter:invert(50%)}.boc-edit-form-instruments{margin:42px 10px 0 10px;text-align:center;min-height:70px}.boc-img-button svg{position:relative;top:12px}.boc-light .boc-toolbar-container svg circle,.boc-light .boc-toolbar-container svg line,.boc-light .boc-toolbar-container svg path{stroke:#8c8c8c!important}.boc-dark .boc-toolbar-container svg circle,.boc-dark .boc-toolbar-container svg line,.boc-dark .boc-toolbar-container svg path{stroke:#8c8c8c!important}.boc-dark .boc-toolbar-container svg rect{fill:#252526!important}.boc-dark .boc-toolbar-container [data-tlbr=minus] svg{border-left:1px solid #5b5b5b!important;border-right:1px solid #5b5b5b!important;border-bottom:1px solid #5b5b5b!important}.boc-dark .boc-toolbar-container [data-tlbr=plus] svg{border-left:1px solid #5b5b5b!important;border-right:1px solid #5b5b5b!important;border-top:1px solid #5b5b5b!important}.boc-dark .boc-toolbar-container [data-tlbr]>svg{border:1px solid #5b5b5b!important;background-color:#252526!important}.boc-toolbar-layout{height:123px;padding-top:20px;position:absolute;width:100%;left:"0";bottom:"-145px"}.boc-light .boc-toolbar-layout{border-top:1px solid #c7c7c7;background-color:#f9f9f9}.boc-dark .boc-toolbar-layout{border-top:1px solid #5b5b5b;background-color:#2b2b2b}.boc-dotted-connector path{stroke-dasharray:7}.boc-undo-redo{position:absolute;top:23px;left:23px}@media screen and (max-width:500px){.boc-undo-redo{position:absolute;top:83px;left:23px}}.boc-light .boc-undo-redo path{fill:#cacaca}.boc-dark .boc-undo-redo path{fill:#5b5b5b}.boc-light .boc-undo-redo .boc-ur-clickable path{fill:#9c9c9c}.boc-dark .boc-undo-redo .boc-ur-clickable path{fill:#8c8c8c}.boc-undo-redo .boc-ur-clickable rect{cursor:pointer}.boc-undo-redo>span{position:relative;display:inline-block;user-select:none}.boc-undo-redo .boc-undo-i{left:-6px;top:-6px}.boc-undo-redo .boc-redo-i{right:-6px;bottom:6px}.boc-undo-redo>span>span{color:#fff;position:absolute;display:inline-block;min-width:20px;min-height:20px;border-radius:50%;line-height:20px;text-align:center;padding:1px;user-select:none;cursor:pointer}.boc-light .boc-undo-redo>span>span{background-color:#9c9c9c}.boc-dark .boc-undo-redo>span>span{background-color:#8c8c8c}</style>'},void 0===OrgChart&&(OrgChart={}),OrgChart.prototype.onField=function(t){return this.on("field",(function(e,r){return t.call(e,r)}))},OrgChart.prototype.onInit=function(t){return this.on("init",(function(e){return t.call(e)}))},OrgChart.prototype.onRedraw=function(t){return this.on("redraw",(function(e){return t.call(e)}))},OrgChart.prototype.onUpdateNode=function(t){return this.on("update",(function(e,r,i){var n={oldData:r,newData:i};return t.call(e,n)}))},OrgChart.prototype.onUpdated=function(t){return this.on("updated",(function(e){return t.call(e)}))},OrgChart.prototype.onRemoveNode=function(t){return this.on("remove",(function(e,r,i){var n={id:r,newPidsAndStpidsForIds:i};return t.call(e,n)}))},OrgChart.prototype.onAddNode=function(t){return this.on("add",(function(e,r){var i={data:r};return t.call(e,i)}))},OrgChart.prototype.onDrop=function(t){return this.on("drop",(function(e,r,i,n,a){var o={dragId:r,dropId:i,dragNodeElement:n,event:a};return t.call(e,o)}))},OrgChart.prototype.onDrag=function(t){return this.on("drag",(function(e,r,i,n){var a={dragId:r,event:i,nodeIds:n};return t.call(e,a)}))},OrgChart.prototype.onExpandCollpaseButtonClick=function(t){return this.on("expcollclick",(function(e,r,i,n){var a={collapsing:r,id:i,ids:n};return t.call(e,a)}))},OrgChart.prototype.onExportStart=function(t){return this.on("exportstart",(function(e,r){return t.call(e,r)}))},OrgChart.prototype.onExportEnd=function(t){return this.on("exportend",(function(e,r){return t.call(e,r)}))},OrgChart.prototype.onNodeClick=function(t){return this.on("click",(function(e,r){return t.call(e,r)}))},OrgChart.prototype.onNodeDoubleClick=function(t){return this.on("dbclick",(function(e,r){var i={data:r};return t.call(e,i)}))},OrgChart.prototype.onAIToolCalls=function(t){return this.on("ai-tool-calls",(function(e,r){return t.call(e,r)}))},OrgChart.filterUI=function(){},OrgChart.filterUI.prototype.init=function(t){this.instance=t,this.element=null,this.filterBy=null,this._event_id=OrgChart._guid()},OrgChart.filterUI.prototype.addFilterTag=function(t){if(!this.instance.config.filterBy)return!1;if(OrgChart.isNEU(t))return!1;if(null!==this.filterBy||"object"!=typeof this.instance.config.filterBy||Array.isArray(this.instance.config.filterBy)||(this.filterBy=JSON.parse(JSON.stringify(this.instance.config.filterBy))),null!=this.filterBy)for(var e in this.filterBy){var r=t[e];if(null!=r){var i=this.filterBy[e];if(null!=i){var n=i[r];if(null!=n&&!1===n.checked)return!0}}}return!1},OrgChart.filterUI.prototype.show=function(t){var e=this.element.querySelector('[data-filter-field="'+t+'"]');e&&e.click()},OrgChart.filterUI.prototype.hide=function(){var t=this.instance.element.querySelector("[data-filter-close]");t&&t.click()},OrgChart.filterUI.prototype.update=function(){if(this.instance.config.filterBy){var t={};if("all"==this.instance.config.filterBy)for(var e=OrgChart.manager.getAllFields(this.instance.config),r=0;r<e.length;r++){var i=e[r];"tags"!=i&&"id"!=i&&"pid"!=i&&"ppid"!=i&&"stpid"!=i&&(t[i]={})}else if(Array.isArray(this.instance.config.filterBy))for(r=0;r<this.instance.config.filterBy.length;r++)t[this.instance.config.filterBy[r]]={};else if("object"==typeof this.instance.config.filterBy)for(var n in this.instance.config.filterBy)t[n]={};for(var a in t){var o=t[a];for(r=0;r<this.instance.config.nodes.length;r++){var s=this.instance.config.nodes[r][a];null!=s&&(o[s]||(o[s]={checked:!0,text:s}))}}if(null!=this.filterBy)for(var l in t)if(this.filterBy[l])for(var h in t[l])this.filterBy[l][h]&&(t[l][h]=this.filterBy[l][h]);if(OrgChart.FILTER_ALPHABETICALLY){var c=Object.keys(t).sort(),d=t;t={};for(r=0;r<c.length;r++){t[g=c[r]]=d[g]}for(var a in t){o=t[a];t[a]={};for(c=Object.keys(o).sort(),r=0;r<c.length;r++){var g=c[r];t[a][g]=o[g]}}}this.filterBy=t;var p=this;this.element=this.instance.element.querySelector("[data-filter]"),this.element&&this.element.parentNode.removeChild(this.element),this.element=document.createElement("div"),this.element.setAttribute("data-filter",""),this.element.style.position="absolute",this.element.setAttribute("class","boc-filter"),this.instance.config.undoRedoStorageName?(this.element.style.top=0,this.element.style.left="50%",this.element.style.transform="translate(-50%)"):(this.element.style.top=this.instance.config.padding+"px",this.element.style.left=this.instance.config.padding+"px");var u="";for(var l in this.filterBy){var f={name:l,html:`<div data-filter-field="${l}">${l}</div>`};OrgChart.events.publish("add-filter",[p,f]),u+=f.html}this.element.innerHTML=`<div>${u}</div>`,this.element.addEventListener("click",(function(t){if(t.target.hasAttribute("data-filter-close")||t.target.hasAttribute("data-filter-field")){for(var e=t.target.getAttribute("data-filter-field"),r=p.instance.element.querySelectorAll("[data-filter-menu]"),i=0;i<r.length;i++)r[i].style.display="none";var n=p.instance.element.querySelectorAll(".filter-field-selected");for(i=0;i<n.length;i++)n[i].classList.remove("filter-field-selected");var a=p.instance.element.querySelector("[data-filter-close]");if(a&&a.parentNode.removeChild(a),t.target.hasAttribute("data-filter-close"))return;if(!t.target.hasAttribute("data-filter-field"))return;var o=p.instance.element.querySelector(`[data-filter-menu="${e}"]`);if(!o){var s="checked";for(var l in p.filterBy[e]){p.filterBy[e][l].checked||(s="")}var h={name:e,text:OrgChart.filterUI.all,value:e,checked:!0,html:`<div>\n <input data-all type="checkbox" id="${e}" name="${e}" ${s}>\n <label for="${e}">${OrgChart.filterUI.all}</label>\n </div>`};OrgChart.events.publish("add-item",[p,h]);var c=h.html;for(var d in p.filterBy[e]){var g=p.filterBy[e][d],u=g.text;null==u&&(u=d),h={name:e,text:u,value:d,checked:g.checked,html:`<div>\n <input type="checkbox" id="${e}_${d}" name="${d}" ${g.checked?"checked":""}>\n <label for="${e}_${d}">${u}</label>\n </div>`},OrgChart.events.publish("add-item",[p,h]),c+=h.html}o=document.createElement("div");var f=OrgChart.filterUI.textFilterBy;o.innerHTML=`<fieldset>\n <legend>${f} ${e}:</legend>\n ${c}\n </fieldset>`,o.setAttribute("data-filter-menu",e),o.classList.add("boc-filter-menu"),t.target.parentNode.parentNode.appendChild(o);var m=o.querySelectorAll("input");for(i=0;i<m.length;i++)m[i].addEventListener("change",(function(t){for(var e=t.target;e&&!e.hasAttribute("data-filter-menu");)e=e.parentNode;if(e){var r=e.getAttribute("data-filter-menu");if(t.target.hasAttribute("data-all")){for(var i=t.target.parentNode.parentNode.querySelectorAll("input"),n=0;n<i.length;n++)if(i[n]!=t.target)for(var a in i[n].checked=t.target.checked,p.filterBy[r])p.filterBy[r][a].checked=t.target.checked}else if(null!=p.filterBy[r][this.name]&&(p.filterBy[r][this.name].checked=this.checked),this.checked)for(var o=p.instance.config.nodes,s=0;s<o.length;s++)if(o[s][r]==this.name)for(var l=o[s];l;)if(OrgChart.isNEU(l.stpid))l=OrgChart.isNEU(l.pid)?null:p.instance._get(l.pid);else if((l=p.instance._get(l.stpid))[r]){var h=t.target.parentNode.parentNode.querySelector('[name="'+l[r]+'"]');h?(h.checked=this.checked,p.filterBy[r][l[r]].checked=this.checked):console.error('Cannot find element with selector: [name="'+l[r]+'"]')}var c=!0;for(var d in p.filterBy[r]){p.filterBy[r][d].checked||(c=!1)}e.querySelector("[data-all]").checked=c,p.instance.draw()}}))}o.style.display="block",t.target.classList.add("filter-field-selected"),(a=document.createElement("div")).classList.add("close"),a.innerHTML="x",a.setAttribute("data-filter-close",""),t.target.parentNode.appendChild(a),OrgChart.events.publish("show-items",[p,{name:e}])}})),this.instance.element.appendChild(this.element),OrgChart.events.publish("update",[this,{}])}},OrgChart.filterUI.prototype.on=function(t,e){return OrgChart.events.on(t,e,this._event_id),this},OrgChart.filterUI.textFilterBy="Filter by",OrgChart.filterUI.all="[All]",void 0===OrgChart&&(OrgChart={}),void 0===OrgChart.remote&&(OrgChart.remote={}),OrgChart.LIMIT_NODES=!0,OrgChart.remote._fromResDTO=function(t,e,r,i,n){var a=e[t.id];t.x=a.p[0],t.y=a.p[1],t.w=a.p[2],t.h=a.p[3],null!=a.ln&&(t.leftNeighbor=n[a.ln]),null!=a.rn&&(t.rightNeighbor=n[a.rn]);for(var o=0;o<t.stChildren.length;o++)OrgChart.remote._fromResDTO(t.stChildren[o],e,r,i,n);for(o=0;o<t.children.length;o++)OrgChart.remote._fromResDTO(t.children[o],e,r,i,n)},OrgChart.remote._toReqDTO=function(t,e){var r={p:[t.id,null!=t.parent?t.parent.id:null,null!=t.stParent?t.stParent.id:null,t.w,t.h]};t.children.length>0&&(r.c=OrgChart.remote._convertToIdArray(t.children)),t.stChildren.length>0&&(r.v=OrgChart.remote._convertToIdArray(t.stChildren)),null!=t.layout&&0!=t.layout&&(r.l=t.layout),t.isAssistant&&(r.a=1),t.isSplit&&(r.s=t.isSplit),t.isMirror&&(r.im=t.isMirror),t.padding&&(r.q=t.padding),t.lcn&&(r.k=t.lcn),t.stContainerNodes&&(r.b=OrgChart.remote._convertToIdArray(t.stContainerNodes)),t.isPartner&&(r.i=t.isPartner),t.hasPartners&&(r.g=t.hasPartners),t.partnerSeparation&&(r.e=t.partnerSeparation),e.push(r);for(var i=0;i<t.stChildren.length;i++)OrgChart.remote._toReqDTO(t.stChildren[i],e);for(i=0;i<t.children.length;i++)OrgChart.remote._toReqDTO(t.children[i],e)},OrgChart.remote._toReqLayoutConfigsDTO=function(t){var e={};for(var r in t){var i=t[r];e[r]||(e[r]=[]),e[r][0]=i.orientation,e[r][1]=i.levelSeparation,e[r][2]=i.mixedHierarchyNodesSeparation,e[r][3]=i.subtreeSeparation,e[r][4]=i.siblingSeparation,e[r][5]=i.layout,e[r][6]=i.columns,e[r][7]=i.collapse,e[r][8]=i.assistantSeparation,e[r][9]=i.partnerNodeSeparation}return e},OrgChart.remote._convertToIdArray=function(t){for(var e=[],r=0;r<t.length;r++)e.push(t[r].id);return e},OrgChart.remote._setPositions=function(t,e,r,i){for(var n=[],a=[],o=OrgChart.remote._toReqLayoutConfigsDTO(e),s=0;s<t.length;s++)a.push(t[s].id),OrgChart.remote._toReqDTO(t[s],n);var l={n:n,c:o,r:a,v:"8.14.00"};if(OrgChart.LIMIT_NODES||(l.l=!0),null!=OrgChart.remote._fromReqDTO)OrgChart.remote._fromReqDTO(l.n,l.r,l.c,(function(e){for(var n=0;n<t.length;n++)OrgChart.remote._fromResDTO(t[n],e,0,t,i);r()}));else{l=JSON.stringify(l);var h=OrgChart.localStorage.getItem(l);h&&(h=JSON.parse(h)),h&&!h.limit?OrgChart.remote._proceed(t,h,i,r):OrgChart.remote._findRegion((function(e){OrgChart._ajax(e,"post",l,"json",(function(e){e.error?r(2):(OrgChart.remote._proceed(t,e,i,r),OrgChart.localStorage.setItem(l,JSON.stringify(e)))}))}))}},OrgChart.remote._proceed=function(t,e,r,i){if("string"==typeof e&&(e=JSON.parse(e)),e.limit&&1==e.limit)i(e.limit);else{for(var n=0;n<t.length;n++)OrgChart.remote._fromResDTO(t[n],e,0,t,r);i()}},OrgChart.remote._findRegion=function(t){var e=OrgChart.localStorage.getItem(OrgChart.FUNC_URL_NAME);if(e)t(e);else{for(var r=["defunc2","cusfunc2","bsfunc2","acfunc2","kcfunc2","safunc2","wifunc2"],i=[],n=0;n<r.length;n++)i.push(new XMLHttpRequest);for(n=0;n<r.length;n++)!function(){var e="https://"+r[n]+OrgChart.SERVER_PREFIX,a=i[n];a.onreadystatechange=function(){if(4==this.readyState&&200==this.status){OrgChart.localStorage.setItem(OrgChart.FUNC_URL_NAME,e),t(e);for(var r=0;r<i.length;r++)i[r].abort()}},a.open("GET",e,!0),a.send()}()}};
|