diff --git a/OrgChart.js b/OrgChart.js index 656dff8..08cfebe 100644 --- a/OrgChart.js +++ b/OrgChart.js @@ -1 +1 @@ -var OrgChart=function(t,e){var r=this;if(this.element=t,this.config={lazyLoading:!0,enableDragDrop:!1,enableSearch:!0,enableTouch:!1,nodeMenu:null,nodeContextMenu:null,dragDropMenu:null,menu:null,toolbar:!1,sticky:!0,nodeMouseClick:OrgChart.action.details,nodeMouseDbClick:OrgChart.none,mouseScrool:OrgChart.action.zoom,showXScroll:OrgChart.none,showYScroll:OrgChart.none,template:"ana",tags:{},nodeBinding:{},linkBinding:{},searchFields:[],nodes:[],clinks:[],slinks:[],levelSeparation:60,siblingSeparation:20,subtreeSeparation:40,mixedHierarchyNodesSeparation:15,padding:30,orientation:OrgChart.orientation.top,layout:OrgChart.normal,scaleInitial:1,scaleMin:.1,scaleMax:5,orderBy:null,editUI:null,searchUI:null,xScrollUI:null,yScrollUI:null,nodeMenuUI:null,nodeContextMenuUI:null,toolbarUI:null,notifierUI:null,dragDropMenuUI:null,menuUI:null,exportUrl:"https://balkangraph.com/export",collapse:{},expand:{},align:OrgChart.CENTER,UI:null,anim:{func:OrgChart.anim.outPow,duration:200},zoom:{speed:120,smooth:12},roots:null,onUpdate:"",onRemove:"",onAdd:"",onRedraw:"",onImageUploaded:"",onUpdateTags:"",onClick:"",onDbClick:"",onExpCollClick:"",onExportStart:"",onExportEnd:"",onSearchClick:"",onReady:""},e)for(var i in this.config)"object"!=typeof e[i]||Array.isArray(e[i])?void 0!==e[i]&&(this.config[i]=e[i]):this.config[i]=OrgChart._mergeObject(this.config[i],e[i]);this._event_id=OrgChart._guid();for(var a=["onUpdate","onRemove","onAdd","onRedraw","onImageUploaded","onUpdateTags","onClick","onDbClick","onExpCollClick","onExportStart","onExportEnd","onSearchClick","onReady"],o=0;o');e={content:r,res:t};for(var n in OrgChart.events.publish("prerender",[b,e]),r=e.content,t.visibleNodes){var l=t.visibleNodes[n],s=b._get(n);r+=b.ui.node(l,s,t.animations,b.config,void 0,void 0,void 0,v,i,b),r+=b.ui.link(l,b,b.config,i),r+=b.ui.expandCollapse(l,b.config,v,i)}e={content:r,res:t};if(OrgChart.events.publish("render",[b,e]),r=e.content,r+=b.ui.lonely(b.config),v!==OrgChart.action.exporting){v!==OrgChart.action.centerNode&&v!==OrgChart.action.insert&&v!==OrgChart.action.expandCollapse&&v!==OrgChart.action.update||(o=a),v===OrgChart.action.init&&null!=a&&(o=a),b.response=t;O=b.ui.svg(b.width(),b.height(),o,b.config,r);if(b._initialized){var h=b.getSvg(),d=h.parentNode;d.removeChild(h),d.insertAdjacentHTML("afterbegin",O),b._attachEventHandlers(),b.xScrollUI.addListener(b.getSvg()),b.yScrollUI.addListener(b.getSvg()),b.xScrollUI.setPosition(),b.yScrollUI.setPosition()}else{b.element.innerHTML=b.ui.css()+b.ui.exportMenuButton(b.config)+O,b._attachInitEventHandlers(),b._attachEventHandlers(),b.xScrollUI.create(b.width(),b.config.padding),b.xScrollUI.setPosition(),b.xScrollUI.addListener(b.getSvg()),b.yScrollUI.create(b.height(),b.config.padding),b.yScrollUI.setPosition(),b.yScrollUI.addListener(b.getSvg()),b.config.enableSearch&&b.searchUI.addSearchControl(),b.toolbarUI.init(b,b.config.toolbar);var c=document.createElement("div");c.setAttribute("id","bg-tests"),b.element.appendChild(c)}var g=!1;b.notifierUI.show(t.notif);var p=b.response.animations;if(0OrgChart.TEXT_THRESHOLD)for(var r=0;rOrgChart.IMAGES_THRESHOLD)for(r=0;rOrgChart.LINKS_THRESHOLD)for(r=0;rOrgChart.EXPCOLL_THRESHOLD)for(r=0;r',OrgChart.linkOpenTag='',OrgChart.expcollOpenTag='',OrgChart.groupNodesOpenTag='',OrgChart.linkFieldsOpenTag='',OrgChart.grCloseTag="",OrgChart.IT_IS_LONELY_HERE='{link}',OrgChart.RES={},OrgChart.RES.IT_IS_LONELY_HERE_LINK="It's lonely here, add your first node",OrgChart.MAXIMIZE='',OrgChart.MINIMIZE='',OrgChart.MAX_NODES_MESS="The trial has expired or 200 nodes limit was reached!
See more",OrgChart.OFFLINE_MESS="The evaluation version requires intermet connection!
See more",OrgChart.SEARCH_PLACEHOLDER="Search",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.MIXED_LAYOUT_ALL_NODES=!0,OrgChart.CLINK_CURVE=1,OrgChart.REMOVE_GROUP_IF_HAS_ONE_NODE=!0,"undefined"!=typeof module&&(module.exports=OrgChart.VERSION),OrgChart.input=function(t,e,r,i,a){null==i&&(i=!1);var o=document.createElement("div"),n=document.createElement("div"),l=document.createElement("input"),s=document.createElement("hr"),h=document.createElement("button");if(h.innerHTML="Upload",h.style.position="absolute",h.style.right=0,o.style.margin="14px 14px 7px 14px",o.style.textAlign="left",o.style.position="relative",o.setAttribute("data-field-name",t),s.style.border="1px solid #d7d7d7",s.style.backgroundColor="#d7d7d7",s.style.display="block",s.style.width="100%",n.style.color="#bcbcbc",l.style.border="none",l.style.outline="none",l.style.width="100%",l.setAttribute("val",""),a&&(l.style.width="80%"),l.style.fontSize="16px",l.readOnly=i,null!=e&&null!=e&&(l.value=e),null!=r&&null!=r&&(l.placeholder=r),null!=t&&null!=t&&(n.innerHTML=t),n.setAttribute("lbl",""),l.style.color="#7a7a7a",i||l.addEventListener("focus",function(){var t=this.parentNode.getElementsByTagName("hr")[0];t.style.border="1px solid #039BE5",OrgChart.anim(t,{width:10},{width:o.clientWidth},250,OrgChart.anim.inOutSin)}),h.addEventListener("click",function(){var e=this,t=document.createElement("INPUT");t.setAttribute("type","file"),t.style.display="none",t.onchange=function(){var t=this.files[0];OrgChart.events.publish("imageuploaded",[t,e.parentNode.querySelector("input")])},document.body.appendChild(t),t.click()}),l.addEventListener("blur",function(){this.parentNode.getElementsByTagName("hr")[0].style.border="1px solid #d7d7d7"}),o.appendChild(n),o.appendChild(l),a&&o.appendChild(h),o.appendChild(s),OrgChart.addValidation){var d={wrapper:o,label:n,input:l,hr:s};OrgChart.addValidation(t,e,d)}return o},OrgChart._intersects=function(t,e,r){var i=t.x-r.siblingSeparation/4,a=t.y,o=t.x+t.w+r.siblingSeparation/4,n=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,a=t.y-r.siblingSeparation/4,o=t.x,n=t.y+t.h+r.siblingSeparation/4}var l,s,h,d=e.p,c=e.q,g=e.r,p=e.s;return 0!=(l=(o-i)*(p-c)-(g-d)*(n-a))&&(s=((a-n)*(g-i)+(o-i)*(p-a))/l,0<(h=((p-c)*(g-i)+(d-g)*(p-a))/l)&&h<1&&0',Object.assign(a.style,{cursor:"pointer",width:"34px",height:"34px",position:"absolute",top:"7px",right:"7px"}),Object.assign(o.style,{"overflow-x":"hidden","overflow-y":"auto"}),Object.assign(i.style,{"background-color":"#039BE5","min-height":"50px",textAlign:"center",position:"relative"}),Object.assign(n.style,{margin:"12px"}),this.wrapperElement.appendChild(e),e.appendChild(i),e.appendChild(o),o.appendChild(n),i.appendChild(a),OrgChart.htmlRipple(i);var l=this.fields,s=this.obj._get(t.id);t.isGroup&&(l=["Name"],s={Name:this.obj.config.tags[t.id].groupName});for(var h=0;h',this.wrapperElement.id="bgEditForm",Object.assign(a.style,{cursor:"pointer",width:"34px",height:"34px",position:"absolute",top:"7px",right:"7px"}),Object.assign(n.style,{"overflow-x":"hidden","overflow-y":"auto"}),Object.assign(r.style,{"background-color":"#039BE5","min-height":"50px",textAlign:"center",position:"relative"}),Object.assign(o.style,{margin:"14px 14px 7px",color:"#4285F4",cursor:"pointer"}),Object.assign(l.style,{margin:"14px 14px 7px",color:"rgb(188, 188, 188)"}),o.innerHTML="Add new field";var s=OrgChart._arrayContains(this.node.tags,"assistant")?"checked":"";l.setAttribute("data-field-name","isAssistant"),l.innerHTML='
Assistant
',this.wrapperElement.appendChild(e),e.appendChild(r),e.appendChild(n),r.appendChild(a),OrgChart.htmlRipple(r);var h=this.fields,d=this.obj._get(t.id);t.isGroup&&(h=["Name"],d={Name:this.obj.config.tags[t.id].groupName});for(var c=0;c'+h+"  "+d+""}if(""!=r){if(this.wrapper=document.createElement("div"),Object.assign(this.wrapper.style,{opacity:0,"background-color":"#FFFEFF","box-shadow":"#DCDCDC 0px 1px 2px 0px",display:"inline-block",border:"1px solid #D7D7D7;border-radius:5px","z-index":1e3,position:"absolute","text-align":"left","user-select":"none"}),this.wrapper.style.left="-99999px",this.wrapper.style.top="-99999px",this.wrapper.innerHTML=r,this.obj.element.appendChild(this.wrapper),null==e){var c=OrgChart._menuPosition(t,this.wrapper,this.obj.getSvg());t=c.x,e=c.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.anim(this.wrapper,{opacity:0,left:g-this.wrapper.offsetWidth},{opacity:1,left:p},300,OrgChart.anim.inOutPow);for(var f=this.wrapper.getElementsByTagName("div"),u=0;u',OrgChart.toolbarUI.fitIcon='',OrgChart.toolbarUI.zoomInIcon='',OrgChart.toolbarUI.zoomOutIcon='',OrgChart.toolbarUI.layoutIcon='',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("bg-toolbar-container"),Object.assign(this.div.style,{position:"absolute",padding:"3px",right:this.obj.config.padding+"px",bottom:this.obj.config.padding+"px"}),e.expandAll&&(this.div.innerHTML+='
'+OrgChart.toolbarUI.expandAllIcon+"
"),e.fit&&(this.div.innerHTML+='
'+OrgChart.toolbarUI.fitIcon+"
"),e.zoom&&(this.div.innerHTML+='
'+OrgChart.toolbarUI.zoomInIcon+"
",this.div.innerHTML+='
'+OrgChart.toolbarUI.zoomOutIcon+"
"),e.layout&&(this.div.innerHTML+='
'+OrgChart.toolbarUI.layoutIcon+"
",this.layouts=document.createElement("div"),this.layouts.innerHTML='',this.obj.element.appendChild(this.layouts),Object.assign(this.layouts.style,{position:"absolute",width:"100%",left:"0",bottom:"-145px","box-shadow":"0px 1px 4px rgba(0,0,0,0.3)","background-color":"#f9f9f9",height:"123px","padding-top":"20px","border-top":"1px solid #cacaca"})),this.obj.element.appendChild(this.div),this.layoutBtn=this.div.querySelector('[data-tlbr="layout"]');var r=this.div.querySelector('[data-tlbr="plus"]'),i=this.div.querySelector('[data-tlbr="minus"]'),a=this.div.querySelector('[data-tlbr="fit"]'),o=this.div.querySelector('[data-tlbr="expand"]'),n=this;r&&r.addEventListener("click",function(){n.obj.zoom(!0,null,!0)}),i&&i.addEventListener("click",function(){n.obj.zoom(!1,null,!0)}),a&&a.addEventListener("click",function(){n.obj.fit()}),o&&o.addEventListener("click",function(){n.obj.expand(null,"all")}),this.layoutBtn&&this.layoutBtn.addEventListener("click",function(){n._visible?n.hideLayout():n.showLayout()}),this.layouts&&this.layouts.addEventListener("click",function(t){for(var e=t.target;e;){if(e.hasAttribute("data-layout")){e=e.getAttribute("data-layout"),n.obj.setLayout(OrgChart[e]);break}e=e.parentNode}})}},OrgChart.toolbarUI.prototype.showLayout=function(){this._visible=!0,this.layoutBtn.style.transform="rotate(180deg) translateX(0px) translateY(0px)",OrgChart.anim(this.div,{bottom:this.obj.config.padding},{bottom:this.obj.config.padding+145},this.obj.config.anim.duration,this.obj.config.anim.func),OrgChart.anim(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.anim(this.div,{bottom:this.obj.config.padding+145},{bottom:this.obj.config.padding},this.obj.config.anim.duration,this.obj.config.anim.func),OrgChart.anim(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){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,a=this.obj.height()/2-r.offsetHeight/2;r.style.left=i+"px",r.style.top=a+"px";var o=r.offsetWidth;r.style.width="20px",OrgChart.anim(r,{opacity:0,width:10},{opacity:1,width:o},this.obj.config.anim.duration,this.obj.config.anim.func)}},OrgChart.icon={},OrgChart.icon.png=function(t,e,r){return''},OrgChart.icon.pdf=function(t,e,r){return''},OrgChart.icon.svg=function(t,e,r){return''},OrgChart.icon.csv=function(t,e,r){return''},OrgChart.icon.excel=function(t,e,r){return''},OrgChart.icon.edit=function(t,e,r){return''},OrgChart.icon.details=function(t,e,r){return''},OrgChart.icon.remove=function(t,e,r){return''},OrgChart.icon.add=function(t,e,r){return''},OrgChart.icon.search=function(t,e){return''},OrgChart.icon.addInGroup=function(t,e,r){return''},OrgChart.icon.addAsChild=function(t,e,r){return''},OrgChart.icon.xml=function(t,e,r){return''},OrgChart.prototype.exportPDF=function(t,e){t=this._defaultExportOptions(t,"pdf"),this._export(t,e)},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._defaultExportOptions=function(t,e){if(null==t&&(t={}),"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.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=""),null==t.footer&&(t.footer=""),null!=t.nodeId){var r=this.getBGNode(t.nodeId);r.isChildOfGroup&&(t.nodeId=r._groupParentNodeId)}return t},OrgChart.prototype._export=function(a,o){var n=this,t={id:a.nodeId,expandChildren:a.expandChildren};this._draw(!1,OrgChart.action.exporting,t,function(t){var r=document.createElement("div");if(r.innerHTML=t,"svg"==a.ext)if(o)o(a,r.innerHTML);else{var e={content:r.innerHTML,options:a},i=OrgChart.events.publish("exportstart",[n,e]);if(!1===i)return!1;if(OrgChart._downloadFile(a.mime,e.content,e.options.filename),!1===(i=OrgChart.events.publish("exportend",[n,e])))return!1}else OrgChart._imgs2base64(r,"image","xlink:href",function(){n._pages(a,r.querySelector("svg"),function(t){var e={content:r.innerHTML,options:a,pages:t};if(!1===OrgChart.events.publish("exportstart",[n,e]))return!1;o||OrgChart.loading.show(n),o?o(n,e,r.querySelector("svg")):(e=JSON.stringify(e),OrgChart._ajax(n.config.exportUrl+"/v3","POST",e,"arraybuffer",function(t){if(!1===OrgChart.events.publish("exportend",[n,t]))return!1;OrgChart.loading.hide(n),OrgChart._downloadFile(a.mime,t,a.filename)}))})})})},OrgChart.prototype.exportCSV=function(t){t||(t="OrgChart.csv");var e={ext:"csv",filename:t,nodes:JSON.parse(JSON.stringify(this.config.nodes))};if(!1===OrgChart.events.publish("exportstart",[this,e]))return!1;var r=OrgChart._json2csv(e.nodes),i={ext:e.ext,filename:e.filename,nodes:e.nodes,content:r};if(!1===OrgChart.events.publish("exportend",[this,i]))return!1;OrgChart._downloadFile("text/csv;charset=utf-8;","\ufeff"+i.content,i.filename)},OrgChart.prototype.exportXML=function(t){t||(t="OrgChart.xml");var e={ext:"xml",filename:t,nodes:JSON.parse(JSON.stringify(this.config.nodes))};if(!1===OrgChart.events.publish("exportstart",[this,e]))return!1;var r=OrgChart._json2xml(e.nodes),i={ext:e.ext,filename:e.filename,nodes:e.nodes,content:r};if(!1===OrgChart.events.publish("exportend",[this,i]))return!1;OrgChart._downloadFile("application/xml",i.content,i.filename)},OrgChart.prototype._pages=function(t,e,r){"fit2Levels"==t.format?this._pagesFit2Levels(t,r):"A42Levels"==t.format||"A32Levels"==t.format||"A22Levels"==t.format||"A12Levels"==t.format?this._pagesA2Levels(t,r):"A4"==t.format&&100==t.scale||"A3"==t.format&&100==t.scale||"A2"==t.format&&100==t.scale||"A1"==t.format&&100==t.scale?r(this._pagesA100(t,e)):"A4"==t.format&&"fit"==t.scale||"A3"==t.format&&"fit"==t.scale||"A2"==t.format&&"fit"==t.scale||"A1"==t.format&&"fit"==t.scale?r(this._pagesAfit(t,e)):"fit"==t.format&&r(this._pagesFit(t,e))},OrgChart.prototype._pagesA2Levels=function(n,l){var s=this,h=this.config.collapse,d=this.config.roots;this.config.collapse={level:2};var t={id:n.nodeId,expandChildren:n.expandChildren},c=[],g=[];for(var e in this.nodes){0!=(i=this.nodes[e]).childrenIds.length&&(i.isAssistant||"split"==i.templateName||g.push(i.id))}for(var r=0;ra[0]/10)return;if(l>a[1]/10)return}}else if(-1!=e.type.indexOf("touch")&&null==this._touch)return;for(var s=e.target;s!=t;){if(s.hasAttribute("control-expcoll-id")){var h=s.getAttribute("control-expcoll-id");return void this._expCollHandler(h)}if(s.hasAttribute("control-maxmin-id")){h=s.getAttribute("control-maxmin-id");return void this._maxMinHandler(h)}if(s.hasAttribute("node-id")){h=s.getAttribute("node-id");return void this._nodeClickHandler(h,e)}if(s.hasAttribute("control-node-menu-id")){h=s.getAttribute("control-node-menu-id");return void this._nodeMenuClickHandler(h,s,e)}if(s.hasAttribute("control-add"))return void this._lonelyButtonHandler();s=s.parentNode}},OrgChart.prototype._globalContextHandler=function(t,e){for(var r=e.target;r!=t;){if(r.hasAttribute("node-id")){var i=r.getAttribute("node-id");return void this._nodeContextHandler(i,e)}r=r.parentNode}},OrgChart.prototype._nodeContextHandler=function(t,e){e.preventDefault(),this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.dragDropMenuUI.hide(),this.menuUI.hide();var r=this.get(t),i=null;if(null!=r&&Array.isArray(r.tags))for(var a=0;a'),o+=OrgChart.searchUI.createItem(s,l)}r.innerHTML=o;var h=i.querySelectorAll("[data-search-item-id]");for(n=0;n
'+OrgChart.icon.search(32,32)+'
'},OrgChart.searchUI.createItem=function(t,e){return'
'+t+'
'+e.textId+'
'+e.textInNode+'
'},OrgChart.searchUI.createSearchIcon=function(t){return'
'+OrgChart.icon.search(32,32)+"
"},void 0===OrgChart&&(OrgChart={}),OrgChart.server=function(t){this.config=t,this.visibleNodes=null,this.viewBox=null,this.action=null,this.actionParams=null,this.groupChildren={},this.nodes={},this.oldNodes={},this.maxX=null,this.maxY=null,this.minX=null,this.minY=null,this.root=null},OrgChart.server.prototype.read=function(t,r,i,e,a,o,n,l){var s=this;this.viewBox=e,this.action=a,this.actionParams=o;var h=this.maxX,d=this.maxY,c=this.minX,g=this.minY,p=this.root,f=this.nodes,u=this.groupChildren;if(t){var C=OrgChart.server._getResponse(r,i,this.visibleNodes,this.config,h,d,c,g,this.viewBox,p,this.action,this.actionParams,f,u,this.oldNodes);a!=OrgChart.action.exporting&&(this.maxX=h,this.maxY=d,this.minX=c,this.minY=g,this.root=p,this.nodes=f,this.groupChildren=u,this.visibleNodes=C.visibleNodes),n(C)}else this.oldNodes=f||null,this._read(function(t){h=t.maxX,d=t.maxY,c=t.minX,g=t.minY,p=t.roots[0],f=t.nodes,u=t.groupChildren;var e=OrgChart.server._getResponse(r,i,s.visibleNodes,s.config,h,d,c,g,s.viewBox,p,s.action,s.actionParams,f,u,s.oldNodes);e.notif=t.limit,a!=OrgChart.action.exporting&&(s.maxX=h,s.maxY=d,s.minX=c,s.minY=g,s.root=p,s.nodes=f,s.groupChildren=u,s.visibleNodes=e.visibleNodes),n(e)},l)},OrgChart.server.prototype._read=function(a,t){var o=this,n=OrgChart.server._createNodes(this.config,this.action,this.actionParams,this.oldNodes);t(n);var l=n.nodes,s=n.roots,e=OrgChart.remote;null==e&&(e=OrgChart.local),e._walk(s,this.config,function(t){OrgChart.server._doNotChangePositionOfClickedNodeIfAny(s,l,o.action,o.actionParams,o.oldNodes,o.config.orientation);var e={minX:null,minY:null,maxX:null,maxY:null};for(var r in l){var i=l[r];OrgChart.server._setMinMaxXY(i,e)}a({minX:e.minX,minY:e.minY,maxX:e.maxX,maxY:e.maxY,nodes:l,roots:s,groupChildren:n.groupChildren,limit:t})})},OrgChart.server.prototype.find=function(t){var r=this;if(null==t||null==t||""==t)return[];t=OrgChart.accentFold(t);for(var e,i,a,o=function(t){for(var e in r.config.nodeBinding)if(r.config.nodeBinding[e]==t)return!0;return!1},n=[],l=[],s=0;se.weight?1:0});for(s=0;s").splice(a,0,"")),d!=OrgChart.TAGS&&(d==OrgChart.ID?u=u+c+", ":OrgChart._fieldIsImg(this.config,d)?m=c:o(d)&&!OrgChart._fieldIsImg(this.config,d)?f=f+c+", ":OrgChart._fieldIsImg(this.config,d)||(C=C+c+", "))}u=u.slice(0,u.length-2),f=f.slice(0,f.length-2),C=C.slice(0,C.length-2);var v=OrgChart._getTemplate(n[s].tags,this.config.tags,this.config.template);l.push({id:n[s].id,node:new OrgChart.node(n[s],null,[],v),textId:u,textInNode:f,text:C,img:m})}}return l},void 0===OrgChart&&(OrgChart={}),OrgChart.server._createNodes=function(t,e,r,i){for(var a=t.nodes,o={},n=[],l=[],s=[],h={},d=!1,c=0;c=i.collapse.level){var s=!1;if(Array.isArray(i.expand.nodes))if(i.expand.allChildren){for(l=e[t.pid];null!=l;){if(-1!=i.expand.nodes.indexOf(l.id)){s=!0;break}l=e[l.pid]}s||(s=-1!=i.expand.nodes.indexOf(t.id))}else s=-1!=i.expand.nodes.indexOf(t.id);!s&&i.collapse.allChildren?(o.push(t.id),t.state=OrgChart.COLLAPSE):s||i.collapse.allChildren||n!=i.collapse.level||(o.push(t.id),t.state=OrgChart.COLLAPSE)}}},OrgChart.server._initGroupStates=function(t,e,r,i,a){if(r==OrgChart.action.exporting&&1==a.expandChildren&&t)OrgChart.server._setNodeGroupState(t,OrgChart.EXPAND,i.orientation);else{if(r==OrgChart.action.init&&t&&t.isGroup){var o=i.tags[t.id].groupState;OrgChart.server._setNodeGroupState(t,o,i.orientation)}r==OrgChart.action.groupMaxMin&&OrgChart.server._setNodeGroupState(e[a.id],a.state,i.orientation)}},OrgChart.server._initNodeSize=function(t,e,r){var i=OrgChart.t(e),a=i.size[0],o=i.size[1];if(t.isGroup&&t.groupState==OrgChart.EXPAND){var n=t.bgnodes.length,l=0,s=null,h=o=a=0,d=0;switch(r){case OrgChart.orientation.top:case OrgChart.orientation.bottom:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom_left:if(i.columns)s=n/(l=i.columns),s=Math.ceil(s);else{for(;null==s||li.level&&(i=e);for(var r=0;r=t._groupSettings._columns-1?(i=0,a++):i++}},OrgChart.server._getResponse=function(t,e,r,i,a,o,n,l,s,h,d,c,g,p,f){var u={},C={top:null,left:null,bottom:null,right:null,minX:null,maxX:null,minY:null,maxY:null},m=[[],[],[]],O=a-n+2*i.padding,v=o-l+2*i.padding,x=OrgChart.getScale(s,t,e,i.scaleInitial,O,v);if(C.top=l-i.padding,C.left=n-i.padding,C.bottom=o+i.padding-e/x,C.right=a+i.padding-t/x,C.maxX=a,C.minX=n,C.maxY=o,C.minY=l,null==s&&i.align==OrgChart.CENTER){var y=Math.ceil(t/x),b=Math.ceil(e/x),w=0,_=0;if(y-2*i.padding>=a-n)switch(w=(a+n)/2-y/2,i.orientation){case OrgChart.orientation.right:case OrgChart.orientation.right_top:w=(n-a)/2-y/2}else switch(w=h.x-y/2+OrgChart.server._getNodeWidth(h,i)/2,i.orientation){case OrgChart.orientation.right:case OrgChart.orientation.right_top:(w=-(y/2-(n-a)/2))-i.padding&&(w=-i.padding)}if(b-2*i.padding>=o-l)switch(_=(o+l)/2-b/2,i.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:_=(l-o)/2-b/2}else switch((_=-(b/2-(o-l)/2))>-i.padding&&(_=-i.padding),i.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:(_=-(b/2-(l-o)/2))C.right?C.right:C.left),s[0]>C.right&&s[0]>C.left&&(s[0]=C.left>C.right?C.left:C.right),s[1]C.bottom?C.bottom:C.top),s[1]>C.bottom&&s[1]>C.top&&(s[1]=C.top>C.bottom?C.top:C.bottom)));if(d==OrgChart.action.insert||d==OrgChart.action.expandCollapse||d==OrgChart.action.update||d==OrgChart.action.centerNode){var k=null;if(d==OrgChart.action.insert&&c&&null!=c.insertedNodeId&&null!=c.insertedNodeId)(k=g[c.insertedNodeId])||(k=g[p[c.insertedNodeId]]);else if(d==OrgChart.action.update&&c&&null!=c.visId&&null!=c.visId)(k=g[c.visId])||(k=g[p[c.visId]]);else if(d==OrgChart.action.expandCollapse&&c&&null!=c.id&&null!=c.id)(k=g[c.id])||(k=g[p[c.id]]),k=OrgChart.server._getMostDeepChild(k,g);else if(d==OrgChart.action.centerNode){switch(i.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:c.options.vertical||(k=g[c.id]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:c.options.horizontal||(k=g[c.id])}k&&(k||(k=g[p[c.id]]),k=OrgChart.server._getMostDeepChild(k,g))}if(k)switch(i.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:var A=k.y+k.h-s[3]+i.padding;s[1]A&&(s[1]=A);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:A=k.x-i.padding;s[0]>A&&(s[0]=A);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:A=k.x+k.w-s[2]+i.padding;s[0]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.server._isNotNullEmptyUndefined=function(t){return null!=t&&null!=t&&""!==t},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:'',svg:'{content}',link:'',pointer:'',node:'',plus:'',minus:'',nodeMenuButton:'',exportMenuButton:'



',img_0:'',link_field_0:'{val}'},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:'{content}',link:'',assistanseLink:'',pointer:'',node:'',plus:'',minus:'',nodeMenuButton:'',exportMenuButton:'



',img_0:'',link_field_0:'{val}',field_0:'{val}',field_1:'{val}'},OrgChart.templates.split=Object.assign({},OrgChart.templates.ana),OrgChart.templates.split.size=[10,10],OrgChart.templates.split.node='',OrgChart.templates.group_orange=Object.assign({},OrgChart.templates.base),OrgChart.templates.group_orange.size=[250,120],OrgChart.templates.group_orange.node='',OrgChart.templates.group_orange.groupPadding=[50,10,10,10],OrgChart.templates.group_orange.groupNodesSeparation=10,OrgChart.templates.group_orange.groupName='{val}',OrgChart.templates.group_yellow=Object.assign({},OrgChart.templates.group_orange),OrgChart.templates.group_yellow.node='',OrgChart.templates.group_yellow.groupName='{val}',OrgChart.templates.group_grey=Object.assign({},OrgChart.templates.group_orange),OrgChart.templates.group_grey.node='',OrgChart.templates.group_grey.groupName='{val}',OrgChart.templates.group_grey_one_column=Object.assign({},OrgChart.templates.group_grey),OrgChart.templates.group_grey_one_column.columns=1,OrgChart.templates.ula=Object.assign({},OrgChart.templates.ana),OrgChart.templates.ula.field_0='{val}',OrgChart.templates.ula.field_1='{val}',OrgChart.templates.ula.node='',OrgChart.templates.ula.img_0='',OrgChart.templates.ula.menu='',OrgChart.templates.ula.nodeMenuButton='',OrgChart.templates.olivia=Object.assign({},OrgChart.templates.ana),OrgChart.templates.olivia.field_0='{val}',OrgChart.templates.olivia.field_1='{val}',OrgChart.templates.olivia.defs='',OrgChart.templates.olivia.node='',OrgChart.templates.olivia.img_0='',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='',OrgChart.templates.belinda.img_0='',OrgChart.templates.belinda.field_0='{val}',OrgChart.templates.belinda.field_1='{val}',OrgChart.templates.belinda.link='',OrgChart.templates.belinda.nodeMenuButton='',OrgChart.templates.rony=Object.assign({},OrgChart.templates.ana),OrgChart.templates.rony.svg='{content}',OrgChart.templates.rony.defs='',OrgChart.templates.rony.size=[180,250],OrgChart.templates.rony.ripple={color:"#F57C00",radius:5,rect:null},OrgChart.templates.rony.img_0='',OrgChart.templates.rony.node='',OrgChart.templates.rony.field_0='{val}',OrgChart.templates.rony.field_1='{val}',OrgChart.templates.rony.field_2='{val}',OrgChart.templates.rony.link='',OrgChart.templates.rony.plus='',OrgChart.templates.rony.minus='',OrgChart.templates.rony.nodeMenuButton='',OrgChart.templates.mery=Object.assign({},OrgChart.templates.ana),OrgChart.templates.mery.ripple={color:"#e6e6e6",radius:50,rect:null},OrgChart.templates.mery.node='',OrgChart.templates.mery.link='',OrgChart.templates.mery.img_0='',OrgChart.templates.mery.field_0='{val}',OrgChart.templates.mery.field_1='{val}',OrgChart.templates.mery.nodeMenuButton='',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='',OrgChart.templates.polina.img_0='',OrgChart.templates.polina.field_0='{val}',OrgChart.templates.polina.field_1='{val}',OrgChart.templates.polina.link='',OrgChart.templates.polina.nodeMenuButton='',OrgChart.templates.mila=Object.assign({},OrgChart.templates.ana),OrgChart.templates.mila.node='',OrgChart.templates.mila.img_0='',OrgChart.templates.mila.field_0='{val}',OrgChart.templates.mila.nodeMenuButton='',OrgChart.templates.diva=Object.assign({},OrgChart.templates.ana),OrgChart.templates.diva.size=[200,170],OrgChart.templates.diva.node='',OrgChart.templates.diva.img_0='',OrgChart.templates.diva.field_0='{val}',OrgChart.templates.diva.field_1='{val}',OrgChart.templates.diva.pointer='',OrgChart.templates.diva.nodeMenuButton='',OrgChart.templates.luba=Object.assign({},OrgChart.templates.ana),OrgChart.templates.luba.svg='{content}',OrgChart.templates.luba.defs='',OrgChart.templates.luba.node='',OrgChart.templates.luba.img_0='',OrgChart.templates.luba.nodeMenuButton='',OrgChart.templates.luba.field_0='{val}',OrgChart.templates.luba.field_1='{val}',OrgChart.templates.luba.plus='',OrgChart.templates.luba.minus='',OrgChart.templates.luba.expandCollapseSize=36,OrgChart.templates.derek=Object.assign({},OrgChart.templates.ana),OrgChart.templates.derek.link='',OrgChart.templates.derek.field_0='{val}',OrgChart.templates.derek.field_1='{val}',OrgChart.templates.derek.node='',OrgChart.templates.derek.defs=' ',OrgChart.templates.derek.img_0='',OrgChart.templates.derek.minus='',OrgChart.templates.derek.plus='',OrgChart.templates.derek.nodeMenuButton='',OrgChart.templates.isla=Object.assign({},OrgChart.templates.ana),OrgChart.templates.isla.defs='',OrgChart.templates.isla.size=[180,120],OrgChart.templates.isla.node='',OrgChart.templates.isla.field_0='{val}',OrgChart.templates.isla.field_1='{val}',OrgChart.templates.isla.img_0='',OrgChart.templates.isla.minus='',OrgChart.templates.isla.plus='',OrgChart.templates.isla.nodeMenuButton='',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='',OrgChart.templates.deborah.img_0='',OrgChart.templates.deborah.field_0='{val}',OrgChart.templates.deborah.field_1='{val}',OrgChart.templates.deborah.nodeMenuButton='',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.replace("{randId}",OrgChart.ui._defsIds[r])):e+=i.defs}return""+e+t+""},css:function(){return''},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){return e===OrgChart.action.exporting?"":OrgChart.t(t.template,r).pointer},node:function(t,e,r,i,a,o,n,l,s,h){var d=OrgChart.t(t.templateName,s),c=d.node.replaceAll("{w}",t.w).replaceAll("{h}",t.h);if(d.defs&&(c=c.replace("{randId}",OrgChart.ui._defsIds[t.templateName])),null==n&&(n=i.nodeBinding),t.isGroup){var g=i.tags[t.id].groupName;if(g){var p=d.groupName.replace("{elastic_width}",t.w-(d.groupPadding[3]+d.groupPadding[1]+45));g=OrgChart.wrapText(g,p),c+=p.replace("{val}",g).replaceAll("{randId}",OrgChart._randomId()).replaceAll("{randId2}",OrgChart._randomId())}}else for(var f in n){var u=n[f];if(e){var C=e[u];if("function"==typeof u&&(C=u(h,t)),null!=C&&null!=C&&null!=d[f])c+=(OrgChart._lblIsImg(i,f)||"string"!=typeof C||(C=OrgChart.wrapText(C,d[f])),d[f].replace("{val}",C)).replaceAll("{randId}",OrgChart._randomId()).replaceAll("{randId2}",OrgChart._randomId())}}var m=OrgChart._getPosition(r,t,a,o),O="node";Array.isArray(t.tags)&&t.tags.length&&(O+=" "+t.tags.join(" ")),t.layout&&(O+=" tree-layout");var v=OrgChart.nodeOpenTag.replace("{id}",t.id).replace("{class}",O).replace("{level}",t.level).replace("{x}",m.x).replace("{y}",m.y),x=OrgChart._getOpacity(r,t);v=v.replace("{opacity}",x),t.isGroup||null==i.nodeMenu||"split"==t.templateName||l===OrgChart.action.exporting||(c+=d.nodeMenuButton.replace("{id}",t.id));var y=OrgChart.ui._renderGroupedNodes(t,d,i,r,n,a,o,l,s,h);return t.isGroup&&l!=OrgChart.action.exporting&&(t.groupState==OrgChart.EXPAND?c+=OrgChart.MINIMIZE.replace("{x}",t.w-45).replace("{id}",t.id):c+=OrgChart.MAXIMIZE.replace("{x}",t.w-45).replace("{id}",t.id)),c=v+c+y+OrgChart.grCloseTag},_renderGroupedNodes:function(t,e,r,i,a,o,n,l,s,h){var d="";if(t.isGroup&&t.groupState==OrgChart.EXPAND){e.groupPadding||console.error("groupPadding is not defined in template "+t.templateName);for(var c=0;cr.right?r.right:r.left),e[0]>r.right&&e[0]>r.left&&(a[0]=r.left>r.right?r.left:r.right),e[1]r.bottom?r.bottom:r.top),e[1]>r.bottom&&e[1]>r.top&&(a[1]=r.top>r.bottom?r.top:r.bottom),e[0]!==a[0]||e[1]!==a[1]?OrgChart.anim(t,{viewBox:e},{viewBox:a},300,OrgChart.anim.outPow,function(){i&&i()}):i&&i()},OrgChart._randomId=function(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)},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.lengtha.top+a.height&&(l-=o.height),i.left-o.width",e.querySelector("text").getBoundingClientRect()},OrgChart.wrapText=function(t,e){if(-1==e.indexOf(""+e+"";var i=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("text")[0],a=parseFloat(i.getAttribute("x")),o=parseFloat(i.getAttribute("y")),n=i.getAttribute("text-anchor"),l=i.getAttribute("width"),s=i.getAttribute("text-overflow"),h="http://www.w3.org/2000/svg",d=r.getElementsByTagName("svg")[0].getElementsByTagName("text")[0];if(!l)return t;if(l=parseFloat(l),a||(a=0),o||(o=0),a||(n="start"),s||(s="ellipsis"),"ellipsis"==s){d.removeChild(d.firstChild),d.textContent=t;for(var c=d.getComputedTextLength(),g=2;l"+t+""+d.textContent:t}if("multiline"==s){var p=t.split(" "),f=d.getBBox().height;d.textContent="";var u=document.createElementNS(h,"tspan"),C=document.createTextNode(p[0]);u.setAttributeNS(null,"x",a),u.setAttributeNS(null,"y",o),u.setAttributeNS(null,"text-anchor",n),u.appendChild(C),d.appendChild(u);g=1;for(var m=1;ml)u.firstChild.data=u.firstChild.data.slice(0,O),(u=document.createElementNS(h,"tspan")).setAttributeNS(null,"x",a),u.setAttributeNS(null,"y",o+f*g),u.setAttributeNS(null,"text-anchor",n),C=document.createTextNode(p[m]),u.appendChild(C),d.appendChild(u),g++}var v="";if(null!=d.innerHTML)v=d.innerHTML,d.innerHTML="";else{var x="";for(m=d.childNodes.length-1;0<=m;m--)x=XMLSerializer().serializeToString(d.childNodes[m])+x,d.removeChild(d.childNodes[m]);v=x}return v}},OrgChart._downloadFile=function(t,e,r){var i=new Blob([e],{type:t});if(navigator.msSaveBlob)navigator.msSaveBlob(i,r);else{var a=document.createElement("a");if(void 0!==a.download){var o=URL.createObjectURL(i);a.setAttribute("href",o),a.setAttribute("download",r),a.style.visibility="hidden",document.body.appendChild(a),a.click(),document.body.removeChild(a)}}},OrgChart._getPosition=function(t,e,r,i){var a={x:e.x,y:e.y};if(null!=r&&(a.x=r),null!=i&&(a.y=i),t&&3==t.length){var o=t[0].indexOf(e.id);-1!=o&&null!=t[1][o].transform&&(null==r&&(a.x=t[1][o].transform[4]),null==i&&(a.y=t[1][o].transform[5]))}return a},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){var r=OrgChart.templates[t],i=null;if(null!=e&&r.scaleLessThen){var a=[];for(var o in r.scaleLessThen){var n=parseFloat(o);e'+(new XMLSerializer).serializeToString(e.documentElement)},OrgChart._xml2json=function(t){for(var e=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("node"),r=[],i=0;ir&&(n.pos=r),a||o()},!1);var r=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,20)}}(t,e.speed,e.smooth)}},OrgChart.xScrollUI.prototype.create=function(t){if(this.config.showXScroll===OrgChart.scroll.visible||this.config.mouseScrool===OrgChart.action.scroll||this.config.mouseScrool===OrgChart.action.xScroll){var a=this;this.bar&&this.bar.parentNode.removeChild(this.bar),this.bar=document.createElement("div"),this.config.showXScroll!==OrgChart.scroll.visible&&(this.bar.style.visibility="hidden"),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=a.requestParams(),e=(parseFloat(a.innerBar.clientWidth)-parseFloat(a.bar.clientWidth))/100,r=this.scrollLeft/e,i=(t.boundary.right-t.boundary.left)/100;t.viewBox[0]=r*i+t.boundary.left,a.onSetViewBoxCallback(t.viewBox),clearTimeout(this._timeout),this._timeout=setTimeout(function(){a.onDrawCallback()},500)}})}},OrgChart.xScrollUI.prototype.setPosition=function(){if(this.bar){var t=this.requestParams(),e=(t.boundary.maxY,t.scale,Math.abs(t.boundary.maxX-t.boundary.minX)*t.scale);switch(this.config.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:Math.abs(t.boundary.minY*t.scale);break;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:100r&&(n.pos=r),a||o()},!1);var r=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,20)}}(t,e.speed,e.smooth)}},OrgChart.yScrollUI.prototype.create=function(t){if(this.config.showYScroll===OrgChart.scroll.visible||this.config.mouseScrool===OrgChart.action.scroll||this.config.mouseScrool===OrgChart.action.yScroll){var a=this;this.bar&&this.bar.parentNode.removeChild(this.bar),this.bar=document.createElement("div"),this.config.showYScroll!==OrgChart.scroll.visible&&(this.bar.style.visibility="hidden"),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=a.requestParams(),e=(parseFloat(a.innerBar.clientHeight)-parseFloat(a.bar.clientHeight))/100,r=this.scrollTop/e,i=(t.boundary.bottom-t.boundary.top)/100;t.viewBox[1]=r*i+t.boundary.top,a.onSetViewBoxCallback(t.viewBox),clearTimeout(this._timeout),this._timeout=setTimeout(function(){a.onDrawCallback()},500)}})}},OrgChart.yScrollUI.prototype.setPosition=function(){if(this.bar){var t=this.requestParams(),e=t.boundary.maxY*t.scale;t.boundary.maxX,t.scale;switch(this.config.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:e=Math.abs(t.boundary.minY*t.scale);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:Math.abs(t.boundary.minX*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:100this.config.scaleMin||0!=t&&1!=t&&lthis.config.scaleMin){this._hideBeforeAnimation();var s=this;r?(clearTimeout(s._timeout),OrgChart.anim(this.getSvg(),{viewbox:this.getViewBox()},{viewbox:i},this.config.anim.duration,this.config.anim.func,function(){clearTimeout(s._timeout),s._timeout=setTimeout(function(){s._draw(!0,OrgChart.action.zoom)},500)})):(this.setViewBox(i),clearTimeout(s._timeout),s._timeout=setTimeout(function(){s._draw(!0,OrgChart.action.zoom)},500))}},OrgChart.loading={},OrgChart.loading.show=function(t){var e=document.createElement("div");e.id="bg-loading",e.innerHTML='
',t.element.appendChild(e)},OrgChart.loading.hide=function(t){var e=t.element.querySelector("#bg-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.ppdfFitToDrwaing2Levels="Fit (2 Levels Page)",OrgChart.loc.ppdfA4="A4",OrgChart.loc.ppdfA3="A3",OrgChart.loc.ppdfA2="A2",OrgChart.loc.ppdfA1="A1",OrgChart.loc.ppdfA42Levels="A4 (2 Levels Page)",OrgChart.loc.ppdfA32Levels="A3 (2 Levels Page)",OrgChart.loc.ppdfA22Levels="A2 (2 Levels Page)",OrgChart.loc.ppdfA12Levels="A1 (2 Levels Page)",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(r,i){i=r._defaultExportOptions(i,"pdf");var t=document.createElement("div");t.id="bg-ppdf-btns",Object.assign(t.style,{position:"absolute",top:0,left:0,"background-color":"#fff","z-index":5,margin:"0 0 0 -250px","box-shadow":"0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)",width:"250px",height:"100%","font-family":"Roboto,Helvetica",color:"#757575","text-align":"right",padding:"10px"}),r.element.appendChild(t),t.innerHTML="

"+OrgChart.loc.ppdfCmdTitle+'

 
';var e=document.createElement("div");e.id="bg-ppdf-wrapper",Object.assign(e.style,{"overflow-y":"scroll",position:"absolute",top:0,left:"270px","background-color":"#eee",width:r.width()-270+"px",height:"100%"}),r.element.appendChild(e),e.innerHTML='
';var a,o,n,l=r.element.querySelector("#bg-ppdf-size"),s=r.element.querySelector("#bg-ppdf-layout"),h=r.element.querySelector("#bg-ppdf-scale"),d=r.element.querySelector("#bg-ppdf-margin"),c=r.element.querySelector("#bg-ppdf-header"),g=r.element.querySelector("#bg-ppdf-footer");l.value=i.format,s.value=i.landscape,h.value=i.scale,d.value=i.margin,c.value=i.header,g.value=i.footer,OrgChart.anim(r.element.querySelector("#bg-ppdf-btns"),{margin:[0,0,0,-250]},{margin:[0,0,0,0]},300,OrgChart.anim.outSin,function(){r.exportPDF(i,OrgChart.pdfPrevUI._handler)}),r.element.querySelector("#bg-prev-cancel").addEventListener("click",function(){OrgChart.pdfPrevUI.hide(r)}),r.element.querySelector("#bg-prev-save").addEventListener("click",function(){r.exportPDF(i),OrgChart.pdfPrevUI.hide(r)}),OrgChart.pdfPrevUI._showHide(l,s,h),l.addEventListener("change",function(){OrgChart.anim(r.element.querySelector("#bg-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,function(){r.element.querySelector("#bg-ppdf-content").innerHTML="",i.format=l.value,r.exportPDF(i,OrgChart.pdfPrevUI._handler),OrgChart.pdfPrevUI._showHide(l,s,h)})}),s.addEventListener("change",function(){OrgChart.anim(r.element.querySelector("#bg-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,function(){r.element.querySelector("#bg-ppdf-content").innerHTML="",i.landscape="true"==s.value,r.exportPDF(i,OrgChart.pdfPrevUI._handler),OrgChart.pdfPrevUI._showHide(l,s,h)})}),h.addEventListener("change",function(){OrgChart.anim(r.element.querySelector("#bg-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,function(){r.element.querySelector("#bg-ppdf-content").innerHTML="",i.scale=h.value,r.exportPDF(i,OrgChart.pdfPrevUI._handler),OrgChart.pdfPrevUI._showHide(l,s,h)})}),d.addEventListener("keyup",function(){clearTimeout(a),a=setTimeout(function(){OrgChart.anim(r.element.querySelector("#bg-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,function(){r.element.querySelector("#bg-ppdf-content").innerHTML="";var t=d.value.split(",");if(4==t.length){for(var e=0;e';return a&&(s+='
'+a+"
"),s+=t,o&&(s+='"),s+="",s+=""},OrgChart.pdfPrevUI.hide=function(e){var r=e.element.querySelector("#bg-ppdf-wrapper");r&&OrgChart.anim(r,{opacity:1},{opacity:0},300,OrgChart.anim.inSin,function(){r.parentNode.removeChild(r);var t=e.element.querySelector("#bg-ppdf-btns");OrgChart.anim(t,{margin:[0,0,0,0]},{margin:[0,0,0,-280]},300,OrgChart.anim.inSin,function(){t.parentNode.removeChild(t)})})},void 0===OrgChart&&(OrgChart={}),OrgChart.events.on("renderdefs",function(t,e){for(var r=0;r'.replace("{from}",d.id).replace("{to}",c.id)+m.link.replace("{d}","M{a.x},{a.y} C{a.x},{a.y} {c.x},{c.y} {b.x},{b.y}").replaceAll("{b.x}",v.x).replaceAll("{b.y}",v.y).replaceAll("{a.x}",O.x).replaceAll("{a.y}",O.y).replaceAll("{c.x}",k.x).replaceAll("{c.y}",k.y);var S=(r=O,a=k,void 0,o=((i=v).x-r.x)/2+r.x,n=(i.y-r.y)/2+r.y,{x:(o-a.x)/2+a.x,y:(n-a.y)/2+a.y});h.label&&(l+=m.label.replace("{x}",S.x).replace("{y}",S.y).replace("{val}",h.label)),l+=OrgChart.grCloseTag}function I(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.CLINK_CURVE,{x:t.x+i/2-a*o,y:t.y+a/2+i*o}}}e.content+=l},OrgChart.prototype.addClink=function(t,e,r,i){return this.removeClink(t,e),this.config.clinks.push({from:t,to:e,label:r,template:i}),this},OrgChart.prototype.removeClink=function(t,e){for(var r=this.config.clinks.length-1;0<=r;r--){var i=this.config.clinks[r];i.from==t&&i.to==e&&this.config.clinks.splice(r,1)}return this},OrgChart.clinkTemplates={},OrgChart.clinkTemplates.orange={defs:' ',link:'',label:'{val}'},OrgChart.clinkTemplates.blue={defs:' ',link:'',label:'{val}'},OrgChart.clinkTemplates.yellow={defs:' ',link:'',label:'{val}'},void 0===OrgChart&&(OrgChart={}),OrgChart.events.on("renderdefs",function(t,e){for(var r=0;rt.x&&(a="right");break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:case OrgChart.orientation.right:case OrgChart.orientation.right_top:a="top",e.y>t.y&&(a="bottom")}var o=OrgChart.t(t.templateName,A),n=w.config.levelSeparation;(t.parent&&t.parent.layout==OrgChart.mixed||t.parent&&t.parent.layout==OrgChart.tree)&&(n=w.config.mixedHierarchyNodesSeparation);var l={p:t.x+t.w/2+o.expandCollapseSize,q:t.y,r:t.x+t.w/2+o.expandCollapseSize,s:S.minY+n};if(t.level==e.level)switch(i=e,w.config.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:r.push([l.p,l.q]),r.push([l.p,l.q-n/3]),o=OrgChart.t(i.templateName,A),r.push([i.x+i.w/2+o.expandCollapseSize,r[r.length-1][1]]),r.push([r[r.length-1][0],i.y]);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:l.q=t.y+t.h,l.s=S.maxY-n,r.push([l.p,l.q]),r.push([l.r,t.y+t.h+n/3]),o=OrgChart.t(i.templateName,A),r.push([i.x+i.w/2+o.expandCollapseSize,r[r.length-1][1]]),r.push([r[r.length-1][0],i.y+i.h]);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:l.p=t.x,l.q=t.y+t.h/2+o.expandCollapseSize,l.r=S.minX-n,l.s=t.y+t.h/2+o.expandCollapseSize,r.push([l.p,l.q]),r.push([t.x-n/3,l.q]),o=OrgChart.t(i.templateName,A),r.push([r[r.length-1][0],i.y+i.h/2+o.expandCollapseSize]),r.push([i.x,r[r.length-1][1]]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:l.p=t.x+t.w,l.q=t.y+t.h/2+o.expandCollapseSize,l.r=S.maxX+n,l.s=t.y+t.h/2+o.expandCollapseSize,r.push([l.p,l.q]),r.push([t.x+t.w+n/3,l.q]),o=OrgChart.t(i.templateName,A),r.push([r[r.length-1][0],i.y+i.h/2+o.expandCollapseSize]),r.push([i.x+i.w,r[r.length-1][1]])}else{switch(w.config.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:r.push([l.p,l.q]),r.push([l.r,t.y-n/3]);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:l.q=t.y+t.h,l.s=S.maxY-n,r.push([l.p,l.q]),r.push([l.r,t.y+t.h+n/3]);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:l.p=t.x,l.q=t.y+t.h/2+o.expandCollapseSize,l.r=S.minX-n,l.s=t.y+t.h/2+o.expandCollapseSize,r.push([l.p,l.q]),r.push([t.x-n/3,l.q]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:l.p=t.x+t.w,l.q=t.y+t.h/2+o.expandCollapseSize,l.r=S.maxX+n,l.s=t.y+t.h/2+o.expandCollapseSize,r.push([l.p,l.q]),r.push([t.x+t.w+n/3,l.q])}for(var s=t;null==i;){var h=!1,d=s.parent,c=d.leftNeighbor,g=d.rightNeighbor;if(d.id==e.id?i=d:OrgChart._intersects(d,l,w.config)&&(l=OrgChart._addPoint(d,r,w.config,l,a),h=!0),d.id!=e.id){for(;c;){if(c.id==e.id){i=c;break}OrgChart._intersects(c,l,w.config)&&(l=OrgChart._addPoint(c,r,w.config,l,a),h=!0),c=c.leftNeighbor}for(;g;){if(g.id==e.id){i=g;break}OrgChart._intersects(g,l,w.config)&&(l=OrgChart._addPoint(g,r,w.config,l,a),h=!0),g=g.rightNeighbor}}if(!h){var p=r[r.length-1][0],f=0;if(d.parent)switch(n=w.config.levelSeparation,d.parent.layout!=OrgChart.mixed&&d.parent.layout!=OrgChart.tree||(n=w.config.mixedHierarchyNodesSeparation),w.config.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:f=d.parent.y+d.parent.h+n*(2/3);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:f=d.parent.y-n*(2/3);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:p=d.parent.x+d.parent.w+n*(2/3),f=r[r.length-1][1];break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:p=d.parent.x-n*(2/3),f=r[r.length-1][1]}r.push([p,f])}s=d}switch(o=OrgChart.t(i.templateName,A),r.splice(r.length-1,1),w.config.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:r.push([i.x+i.w/2+o.expandCollapseSize,r[r.length-1][1]]),r.push([r[r.length-1][0],i.y+i.h]);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:r.push([i.x+i.w/2+o.expandCollapseSize,r[r.length-1][1]]),r.push([r[r.length-1][0],i.y]);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:r.push([r[r.length-1][0],i.y+i.h/2+o.expandCollapseSize]),r.push([i.x+i.w,r[r.length-1][1]]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:r.push([r[r.length-1][0],i.y+i.h/2+o.expandCollapseSize]),r.push([i.x,r[r.length-1][1]])}}var u=I.template;u||(u="orange");var C=null;switch((o=OrgChart.slinkTemplates[u]).labelPosition){case"start":C={x:r[1][0],y:r[1][1]};break;case"middle":var m=Math.ceil(r.length/2);C=function(t,e){return{x:(t[0]+e[0])/2,y:(t[1]+e[1])/2}}(r[m],r[m-1]);break;case"end":C={x:r[r.length-2][0],y:r[r.length-2][1]}}r[0]="M"+r[0].join(",");for(var O=1;O=i.level?t(r,i):t(i,r)}}},OrgChart.prototype.addSlink=function(t,e,r,i){return this.removeClink(t,e),this.config.slinks.push({from:t,to:e,label:r,template:i}),this},OrgChart.prototype.removeSlink=function(t,e){for(var r=this.config.slinks.length-1;0<=r;r--){var i=this.config.slinks[r];i.from==t&&i.to==e&&this.config.slinks.splice(r,1)}return this},OrgChart.slinkTemplates={},OrgChart.slinkTemplates.orange={defs:' ',link:'',label:'{val}',labelPosition:"middle"},OrgChart.slinkTemplates.blue={defs:' ',link:'',label:'{val}',labelPosition:"middle"},OrgChart.slinkTemplates.yellow={defs:' ',link:'',label:'{val}',labelPosition:"middle"}; \ No newline at end of file +var OrgChart=function(t,e){var r=this;if(this.element=t,this.config={lazyLoading:!0,enableDragDrop:!1,enableSearch:!0,enableTouch:!1,nodeMenu:null,nodeContextMenu:null,dragDropMenu:null,menu:null,toolbar:!1,sticky:!0,nodeMouseClick:OrgChart.action.details,nodeMouseDbClick:OrgChart.none,mouseScrool:OrgChart.action.zoom,showXScroll:OrgChart.none,showYScroll:OrgChart.none,template:"ana",tags:{},nodeBinding:{},linkBinding:{},searchFields:[],nodes:[],clinks:[],slinks:[],levelSeparation:60,siblingSeparation:20,subtreeSeparation:40,mixedHierarchyNodesSeparation:15,padding:30,orientation:OrgChart.orientation.top,layout:OrgChart.normal,scaleInitial:1,scaleMin:.1,scaleMax:5,orderBy:null,editUI:null,searchUI:null,xScrollUI:null,yScrollUI:null,nodeMenuUI:null,nodeContextMenuUI:null,toolbarUI:null,notifierUI:null,dragDropMenuUI:null,menuUI:null,exportUrl:"https://balkangraph.com/export",collapse:{},expand:{},align:OrgChart.CENTER,UI:null,anim:{func:OrgChart.anim.outPow,duration:200},zoom:{speed:120,smooth:12},roots:null,onUpdate:"",onRemove:"",onAdd:"",onRedraw:"",onImageUploaded:"",onUpdateTags:"",onClick:"",onDbClick:"",onExpCollClick:"",onExportStart:"",onExportEnd:"",onSearchClick:"",onReady:""},e)for(var i in this.config)"object"!=typeof e[i]||Array.isArray(e[i])?void 0!==e[i]&&(this.config[i]=e[i]):this.config[i]=OrgChart._mergeObject(this.config[i],e[i]);this._event_id=OrgChart._guid();for(var a=["onUpdate","onRemove","onAdd","onRedraw","onImageUploaded","onUpdateTags","onClick","onDbClick","onExpCollClick","onExportStart","onExportEnd","onSearchClick","onReady"],o=0;o');e={content:r,res:t};for(var n in OrgChart.events.publish("prerender",[b,e]),r=e.content,t.visibleNodes){var l=t.visibleNodes[n],s=b._get(n);r+=b.ui.node(l,s,t.animations,b.config,void 0,void 0,void 0,v,i,b),r+=b.ui.link(l,b,b.config,i),r+=b.ui.expandCollapse(l,b.config,v,i)}e={content:r,res:t};if(OrgChart.events.publish("render",[b,e]),r=e.content,r+=b.ui.lonely(b.config),v!==OrgChart.action.exporting){v!==OrgChart.action.centerNode&&v!==OrgChart.action.insert&&v!==OrgChart.action.expandCollapse&&v!==OrgChart.action.update||(o=a),v===OrgChart.action.init&&null!=a&&(o=a),b.response=t;O=b.ui.svg(b.width(),b.height(),o,b.config,r);if(b._initialized){var h=b.getSvg(),d=h.parentNode;d.removeChild(h),d.insertAdjacentHTML("afterbegin",O),b._attachEventHandlers(),b.xScrollUI.addListener(b.getSvg()),b.yScrollUI.addListener(b.getSvg()),b.xScrollUI.setPosition(),b.yScrollUI.setPosition()}else{b.element.innerHTML=b.ui.css()+b.ui.exportMenuButton(b.config)+O,b._attachInitEventHandlers(),b._attachEventHandlers(),b.xScrollUI.create(b.width(),b.config.padding),b.xScrollUI.setPosition(),b.xScrollUI.addListener(b.getSvg()),b.yScrollUI.create(b.height(),b.config.padding),b.yScrollUI.setPosition(),b.yScrollUI.addListener(b.getSvg()),b.config.enableSearch&&b.searchUI.addSearchControl(),b.toolbarUI.init(b,b.config.toolbar);var c=document.createElement("div");c.setAttribute("id","bg-tests"),b.element.appendChild(c)}var g=!1;b.notifierUI.show(t.notif);var p=b.response.animations;if(0OrgChart.TEXT_THRESHOLD)for(var r=0;rOrgChart.IMAGES_THRESHOLD)for(r=0;rOrgChart.LINKS_THRESHOLD)for(r=0;rOrgChart.EXPCOLL_THRESHOLD)for(r=0;r',OrgChart.linkOpenTag='',OrgChart.expcollOpenTag='',OrgChart.groupNodesOpenTag='',OrgChart.linkFieldsOpenTag='',OrgChart.grCloseTag="",OrgChart.IT_IS_LONELY_HERE='{link}',OrgChart.RES={},OrgChart.RES.IT_IS_LONELY_HERE_LINK="It's lonely here, add your first node",OrgChart.MAXIMIZE='',OrgChart.MINIMIZE='',OrgChart.MAX_NODES_MESS="The trial has expired or 200 nodes limit was reached!
See more",OrgChart.OFFLINE_MESS="The evaluation version requires intermet connection!
See more",OrgChart.SEARCH_PLACEHOLDER="Search",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.MIXED_LAYOUT_ALL_NODES=!0,OrgChart.CLINK_CURVE=1,OrgChart.REMOVE_GROUP_IF_HAS_ONE_NODE=!0,"undefined"!=typeof module&&(module.exports=OrgChart),OrgChart.input=function(t,e,r,i,a){null==i&&(i=!1);var o=document.createElement("div"),n=document.createElement("div"),l=document.createElement("input"),s=document.createElement("hr"),h=document.createElement("button");if(h.innerHTML="Upload",h.style.position="absolute",h.style.right=0,o.style.margin="14px 14px 7px 14px",o.style.textAlign="left",o.style.position="relative",o.setAttribute("data-field-name",t),s.style.border="1px solid #d7d7d7",s.style.backgroundColor="#d7d7d7",s.style.display="block",s.style.width="100%",n.style.color="#bcbcbc",l.style.border="none",l.style.outline="none",l.style.width="100%",l.setAttribute("val",""),a&&(l.style.width="80%"),l.style.fontSize="16px",l.readOnly=i,null!=e&&null!=e&&(l.value=e),null!=r&&null!=r&&(l.placeholder=r),null!=t&&null!=t&&(n.innerHTML=t),n.setAttribute("lbl",""),l.style.color="#7a7a7a",i||l.addEventListener("focus",function(){var t=this.parentNode.getElementsByTagName("hr")[0];t.style.border="1px solid #039BE5",OrgChart.anim(t,{width:10},{width:o.clientWidth},250,OrgChart.anim.inOutSin)}),h.addEventListener("click",function(){var e=this,t=document.createElement("INPUT");t.setAttribute("type","file"),t.style.display="none",t.onchange=function(){var t=this.files[0];OrgChart.events.publish("imageuploaded",[t,e.parentNode.querySelector("input")])},document.body.appendChild(t),t.click()}),l.addEventListener("blur",function(){this.parentNode.getElementsByTagName("hr")[0].style.border="1px solid #d7d7d7"}),o.appendChild(n),o.appendChild(l),a&&o.appendChild(h),o.appendChild(s),OrgChart.addValidation){var d={wrapper:o,label:n,input:l,hr:s};OrgChart.addValidation(t,e,d)}return o},OrgChart._intersects=function(t,e,r){var i=t.x-r.siblingSeparation/4,a=t.y,o=t.x+t.w+r.siblingSeparation/4,n=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,a=t.y-r.siblingSeparation/4,o=t.x,n=t.y+t.h+r.siblingSeparation/4}var l,s,h,d=e.p,c=e.q,g=e.r,p=e.s;return 0!=(l=(o-i)*(p-c)-(g-d)*(n-a))&&(s=((a-n)*(g-i)+(o-i)*(p-a))/l,0<(h=((p-c)*(g-i)+(d-g)*(p-a))/l)&&h<1&&0',Object.assign(a.style,{cursor:"pointer",width:"34px",height:"34px",position:"absolute",top:"7px",right:"7px"}),Object.assign(o.style,{"overflow-x":"hidden","overflow-y":"auto"}),Object.assign(i.style,{"background-color":"#039BE5","min-height":"50px",textAlign:"center",position:"relative"}),Object.assign(n.style,{margin:"12px"}),this.wrapperElement.appendChild(e),e.appendChild(i),e.appendChild(o),o.appendChild(n),i.appendChild(a),OrgChart.htmlRipple(i);var l=this.fields,s=this.obj._get(t.id);t.isGroup&&(l=["Name"],s={Name:this.obj.config.tags[t.id].groupName});for(var h=0;h',this.wrapperElement.id="bgEditForm",Object.assign(a.style,{cursor:"pointer",width:"34px",height:"34px",position:"absolute",top:"7px",right:"7px"}),Object.assign(n.style,{"overflow-x":"hidden","overflow-y":"auto"}),Object.assign(r.style,{"background-color":"#039BE5","min-height":"50px",textAlign:"center",position:"relative"}),Object.assign(o.style,{margin:"14px 14px 7px",color:"#4285F4",cursor:"pointer"}),Object.assign(l.style,{margin:"14px 14px 7px",color:"rgb(188, 188, 188)"}),o.innerHTML="Add new field";var s=OrgChart._arrayContains(this.node.tags,"assistant")?"checked":"";l.setAttribute("data-field-name","isAssistant"),l.innerHTML='
Assistant
',this.wrapperElement.appendChild(e),e.appendChild(r),e.appendChild(n),r.appendChild(a),OrgChart.htmlRipple(r);var h=this.fields,d=this.obj._get(t.id);t.isGroup&&(h=["Name"],d={Name:this.obj.config.tags[t.id].groupName});for(var c=0;c'+h+"  "+d+""}if(""!=r){if(this.wrapper=document.createElement("div"),Object.assign(this.wrapper.style,{opacity:0,"background-color":"#FFFEFF","box-shadow":"#DCDCDC 0px 1px 2px 0px",display:"inline-block",border:"1px solid #D7D7D7;border-radius:5px","z-index":1e3,position:"absolute","text-align":"left","user-select":"none"}),this.wrapper.style.left="-99999px",this.wrapper.style.top="-99999px",this.wrapper.innerHTML=r,this.obj.element.appendChild(this.wrapper),null==e){var c=OrgChart._menuPosition(t,this.wrapper,this.obj.getSvg());t=c.x,e=c.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.anim(this.wrapper,{opacity:0,left:g-this.wrapper.offsetWidth},{opacity:1,left:p},300,OrgChart.anim.inOutPow);for(var f=this.wrapper.getElementsByTagName("div"),u=0;u',OrgChart.toolbarUI.fitIcon='',OrgChart.toolbarUI.zoomInIcon='',OrgChart.toolbarUI.zoomOutIcon='',OrgChart.toolbarUI.layoutIcon='',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("bg-toolbar-container"),Object.assign(this.div.style,{position:"absolute",padding:"3px",right:this.obj.config.padding+"px",bottom:this.obj.config.padding+"px"}),e.expandAll&&(this.div.innerHTML+='
'+OrgChart.toolbarUI.expandAllIcon+"
"),e.fit&&(this.div.innerHTML+='
'+OrgChart.toolbarUI.fitIcon+"
"),e.zoom&&(this.div.innerHTML+='
'+OrgChart.toolbarUI.zoomInIcon+"
",this.div.innerHTML+='
'+OrgChart.toolbarUI.zoomOutIcon+"
"),e.layout&&(this.div.innerHTML+='
'+OrgChart.toolbarUI.layoutIcon+"
",this.layouts=document.createElement("div"),this.layouts.innerHTML='',this.obj.element.appendChild(this.layouts),Object.assign(this.layouts.style,{position:"absolute",width:"100%",left:"0",bottom:"-145px","box-shadow":"0px 1px 4px rgba(0,0,0,0.3)","background-color":"#f9f9f9",height:"123px","padding-top":"20px","border-top":"1px solid #cacaca"})),this.obj.element.appendChild(this.div),this.layoutBtn=this.div.querySelector('[data-tlbr="layout"]');var r=this.div.querySelector('[data-tlbr="plus"]'),i=this.div.querySelector('[data-tlbr="minus"]'),a=this.div.querySelector('[data-tlbr="fit"]'),o=this.div.querySelector('[data-tlbr="expand"]'),n=this;r&&r.addEventListener("click",function(){n.obj.zoom(!0,null,!0)}),i&&i.addEventListener("click",function(){n.obj.zoom(!1,null,!0)}),a&&a.addEventListener("click",function(){n.obj.fit()}),o&&o.addEventListener("click",function(){n.obj.expand(null,"all")}),this.layoutBtn&&this.layoutBtn.addEventListener("click",function(){n._visible?n.hideLayout():n.showLayout()}),this.layouts&&this.layouts.addEventListener("click",function(t){for(var e=t.target;e;){if(e.hasAttribute("data-layout")){e=e.getAttribute("data-layout"),n.obj.setLayout(OrgChart[e]);break}e=e.parentNode}})}},OrgChart.toolbarUI.prototype.showLayout=function(){this._visible=!0,this.layoutBtn.style.transform="rotate(180deg) translateX(0px) translateY(0px)",OrgChart.anim(this.div,{bottom:this.obj.config.padding},{bottom:this.obj.config.padding+145},this.obj.config.anim.duration,this.obj.config.anim.func),OrgChart.anim(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.anim(this.div,{bottom:this.obj.config.padding+145},{bottom:this.obj.config.padding},this.obj.config.anim.duration,this.obj.config.anim.func),OrgChart.anim(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){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,a=this.obj.height()/2-r.offsetHeight/2;r.style.left=i+"px",r.style.top=a+"px";var o=r.offsetWidth;r.style.width="20px",OrgChart.anim(r,{opacity:0,width:10},{opacity:1,width:o},this.obj.config.anim.duration,this.obj.config.anim.func)}},OrgChart.icon={},OrgChart.icon.png=function(t,e,r){return''},OrgChart.icon.pdf=function(t,e,r){return''},OrgChart.icon.svg=function(t,e,r){return''},OrgChart.icon.csv=function(t,e,r){return''},OrgChart.icon.excel=function(t,e,r){return''},OrgChart.icon.edit=function(t,e,r){return''},OrgChart.icon.details=function(t,e,r){return''},OrgChart.icon.remove=function(t,e,r){return''},OrgChart.icon.add=function(t,e,r){return''},OrgChart.icon.search=function(t,e){return''},OrgChart.icon.addInGroup=function(t,e,r){return''},OrgChart.icon.addAsChild=function(t,e,r){return''},OrgChart.icon.xml=function(t,e,r){return''},OrgChart.prototype.exportPDF=function(t,e){t=this._defaultExportOptions(t,"pdf"),this._export(t,e)},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._defaultExportOptions=function(t,e){if(null==t&&(t={}),"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.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=""),null==t.footer&&(t.footer=""),null!=t.nodeId){var r=this.getBGNode(t.nodeId);r.isChildOfGroup&&(t.nodeId=r._groupParentNodeId)}return t},OrgChart.prototype._export=function(a,o){var n=this,t={id:a.nodeId,expandChildren:a.expandChildren};this._draw(!1,OrgChart.action.exporting,t,function(t){var r=document.createElement("div");if(r.innerHTML=t,"svg"==a.ext)if(o)o(a,r.innerHTML);else{var e={content:r.innerHTML,options:a},i=OrgChart.events.publish("exportstart",[n,e]);if(!1===i)return!1;if(OrgChart._downloadFile(a.mime,e.content,e.options.filename),!1===(i=OrgChart.events.publish("exportend",[n,e])))return!1}else OrgChart._imgs2base64(r,"image","xlink:href",function(){n._pages(a,r.querySelector("svg"),function(t){var e={content:r.innerHTML,options:a,pages:t};if(!1===OrgChart.events.publish("exportstart",[n,e]))return!1;o||OrgChart.loading.show(n),o?o(n,e,r.querySelector("svg")):(e=JSON.stringify(e),OrgChart._ajax(n.config.exportUrl+"/v3","POST",e,"arraybuffer",function(t){if(!1===OrgChart.events.publish("exportend",[n,t]))return!1;OrgChart.loading.hide(n),OrgChart._downloadFile(a.mime,t,a.filename)}))})})})},OrgChart.prototype.exportCSV=function(t){t||(t="OrgChart.csv");var e={ext:"csv",filename:t,nodes:JSON.parse(JSON.stringify(this.config.nodes))};if(!1===OrgChart.events.publish("exportstart",[this,e]))return!1;var r=OrgChart._json2csv(e.nodes),i={ext:e.ext,filename:e.filename,nodes:e.nodes,content:r};if(!1===OrgChart.events.publish("exportend",[this,i]))return!1;OrgChart._downloadFile("text/csv;charset=utf-8;","\ufeff"+i.content,i.filename)},OrgChart.prototype.exportXML=function(t){t||(t="OrgChart.xml");var e={ext:"xml",filename:t,nodes:JSON.parse(JSON.stringify(this.config.nodes))};if(!1===OrgChart.events.publish("exportstart",[this,e]))return!1;var r=OrgChart._json2xml(e.nodes),i={ext:e.ext,filename:e.filename,nodes:e.nodes,content:r};if(!1===OrgChart.events.publish("exportend",[this,i]))return!1;OrgChart._downloadFile("application/xml",i.content,i.filename)},OrgChart.prototype._pages=function(t,e,r){"fit2Levels"==t.format?this._pagesFit2Levels(t,r):"A42Levels"==t.format||"A32Levels"==t.format||"A22Levels"==t.format||"A12Levels"==t.format?this._pagesA2Levels(t,r):"A4"==t.format&&100==t.scale||"A3"==t.format&&100==t.scale||"A2"==t.format&&100==t.scale||"A1"==t.format&&100==t.scale?r(this._pagesA100(t,e)):"A4"==t.format&&"fit"==t.scale||"A3"==t.format&&"fit"==t.scale||"A2"==t.format&&"fit"==t.scale||"A1"==t.format&&"fit"==t.scale?r(this._pagesAfit(t,e)):"fit"==t.format&&r(this._pagesFit(t,e))},OrgChart.prototype._pagesA2Levels=function(n,l){var s=this,h=this.config.collapse,d=this.config.roots;this.config.collapse={level:2};var t={id:n.nodeId,expandChildren:n.expandChildren},c=[],g=[];for(var e in this.nodes){0!=(i=this.nodes[e]).childrenIds.length&&(i.isAssistant||"split"==i.templateName||g.push(i.id))}for(var r=0;ra[0]/10)return;if(l>a[1]/10)return}}else if(-1!=e.type.indexOf("touch")&&null==this._touch)return;for(var s=e.target;s!=t;){if(s.hasAttribute("control-expcoll-id")){var h=s.getAttribute("control-expcoll-id");return void this._expCollHandler(h)}if(s.hasAttribute("control-maxmin-id")){h=s.getAttribute("control-maxmin-id");return void this._maxMinHandler(h)}if(s.hasAttribute("node-id")){h=s.getAttribute("node-id");return void this._nodeClickHandler(h,e)}if(s.hasAttribute("control-node-menu-id")){h=s.getAttribute("control-node-menu-id");return void this._nodeMenuClickHandler(h,s,e)}if(s.hasAttribute("control-add"))return void this._lonelyButtonHandler();s=s.parentNode}},OrgChart.prototype._globalContextHandler=function(t,e){for(var r=e.target;r!=t;){if(r.hasAttribute("node-id")){var i=r.getAttribute("node-id");return void this._nodeContextHandler(i,e)}r=r.parentNode}},OrgChart.prototype._nodeContextHandler=function(t,e){e.preventDefault(),this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.dragDropMenuUI.hide(),this.menuUI.hide();var r=this.get(t),i=null;if(null!=r&&Array.isArray(r.tags))for(var a=0;a'),o+=OrgChart.searchUI.createItem(s,l)}r.innerHTML=o;var h=i.querySelectorAll("[data-search-item-id]");for(n=0;n
'+OrgChart.icon.search(32,32)+'
'},OrgChart.searchUI.createItem=function(t,e){return'
'+t+'
'+e.textId+'
'+e.textInNode+'
'},OrgChart.searchUI.createSearchIcon=function(t){return'
'+OrgChart.icon.search(32,32)+"
"},void 0===OrgChart&&(OrgChart={}),OrgChart.server=function(t){this.config=t,this.visibleNodes=null,this.viewBox=null,this.action=null,this.actionParams=null,this.groupChildren={},this.nodes={},this.oldNodes={},this.maxX=null,this.maxY=null,this.minX=null,this.minY=null,this.root=null},OrgChart.server.prototype.read=function(t,r,i,e,a,o,n,l){var s=this;this.viewBox=e,this.action=a,this.actionParams=o;var h=this.maxX,d=this.maxY,c=this.minX,g=this.minY,p=this.root,f=this.nodes,u=this.groupChildren;if(t){var C=OrgChart.server._getResponse(r,i,this.visibleNodes,this.config,h,d,c,g,this.viewBox,p,this.action,this.actionParams,f,u,this.oldNodes);a!=OrgChart.action.exporting&&(this.maxX=h,this.maxY=d,this.minX=c,this.minY=g,this.root=p,this.nodes=f,this.groupChildren=u,this.visibleNodes=C.visibleNodes),n(C)}else this.oldNodes=f||null,this._read(function(t){h=t.maxX,d=t.maxY,c=t.minX,g=t.minY,p=t.roots[0],f=t.nodes,u=t.groupChildren;var e=OrgChart.server._getResponse(r,i,s.visibleNodes,s.config,h,d,c,g,s.viewBox,p,s.action,s.actionParams,f,u,s.oldNodes);e.notif=t.limit,a!=OrgChart.action.exporting&&(s.maxX=h,s.maxY=d,s.minX=c,s.minY=g,s.root=p,s.nodes=f,s.groupChildren=u,s.visibleNodes=e.visibleNodes),n(e)},l)},OrgChart.server.prototype._read=function(a,t){var o=this,n=OrgChart.server._createNodes(this.config,this.action,this.actionParams,this.oldNodes);t(n);var l=n.nodes,s=n.roots,e=OrgChart.remote;null==e&&(e=OrgChart.local),e._walk(s,this.config,function(t){OrgChart.server._doNotChangePositionOfClickedNodeIfAny(s,l,o.action,o.actionParams,o.oldNodes,o.config.orientation);var e={minX:null,minY:null,maxX:null,maxY:null};for(var r in l){var i=l[r];OrgChart.server._setMinMaxXY(i,e)}a({minX:e.minX,minY:e.minY,maxX:e.maxX,maxY:e.maxY,nodes:l,roots:s,groupChildren:n.groupChildren,limit:t})})},OrgChart.server.prototype.find=function(t){var r=this;if(null==t||null==t||""==t)return[];t=OrgChart.accentFold(t);for(var e,i,a,o=function(t){for(var e in r.config.nodeBinding)if(r.config.nodeBinding[e]==t)return!0;return!1},n=[],l=[],s=0;se.weight?1:0});for(s=0;s").splice(a,0,"")),d!=OrgChart.TAGS&&(d==OrgChart.ID?u=u+c+", ":OrgChart._fieldIsImg(this.config,d)?m=c:o(d)&&!OrgChart._fieldIsImg(this.config,d)?f=f+c+", ":OrgChart._fieldIsImg(this.config,d)||(C=C+c+", "))}u=u.slice(0,u.length-2),f=f.slice(0,f.length-2),C=C.slice(0,C.length-2);var v=OrgChart._getTemplate(n[s].tags,this.config.tags,this.config.template);l.push({id:n[s].id,node:new OrgChart.node(n[s],null,[],v),textId:u,textInNode:f,text:C,img:m})}}return l},void 0===OrgChart&&(OrgChart={}),OrgChart.server._createNodes=function(t,e,r,i){for(var a=t.nodes,o={},n=[],l=[],s=[],h={},d=!1,c=0;c=i.collapse.level){var s=!1;if(Array.isArray(i.expand.nodes))if(i.expand.allChildren){for(l=e[t.pid];null!=l;){if(-1!=i.expand.nodes.indexOf(l.id)){s=!0;break}l=e[l.pid]}s||(s=-1!=i.expand.nodes.indexOf(t.id))}else s=-1!=i.expand.nodes.indexOf(t.id);!s&&i.collapse.allChildren?(o.push(t.id),t.state=OrgChart.COLLAPSE):s||i.collapse.allChildren||n!=i.collapse.level||(o.push(t.id),t.state=OrgChart.COLLAPSE)}}},OrgChart.server._initGroupStates=function(t,e,r,i,a){if(r==OrgChart.action.exporting&&1==a.expandChildren&&t)OrgChart.server._setNodeGroupState(t,OrgChart.EXPAND,i.orientation);else{if(r==OrgChart.action.init&&t&&t.isGroup){var o=i.tags[t.id].groupState;OrgChart.server._setNodeGroupState(t,o,i.orientation)}r==OrgChart.action.groupMaxMin&&OrgChart.server._setNodeGroupState(e[a.id],a.state,i.orientation)}},OrgChart.server._initNodeSize=function(t,e,r){var i=OrgChart.t(e),a=i.size[0],o=i.size[1];if(t.isGroup&&t.groupState==OrgChart.EXPAND){var n=t.bgnodes.length,l=0,s=null,h=o=a=0,d=0;switch(r){case OrgChart.orientation.top:case OrgChart.orientation.bottom:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom_left:if(i.columns)s=n/(l=i.columns),s=Math.ceil(s);else{for(;null==s||li.level&&(i=e);for(var r=0;r=t._groupSettings._columns-1?(i=0,a++):i++}},OrgChart.server._getResponse=function(t,e,r,i,a,o,n,l,s,h,d,c,g,p,f){var u={},C={top:null,left:null,bottom:null,right:null,minX:null,maxX:null,minY:null,maxY:null},m=[[],[],[]],O=a-n+2*i.padding,v=o-l+2*i.padding,x=OrgChart.getScale(s,t,e,i.scaleInitial,O,v);if(C.top=l-i.padding,C.left=n-i.padding,C.bottom=o+i.padding-e/x,C.right=a+i.padding-t/x,C.maxX=a,C.minX=n,C.maxY=o,C.minY=l,null==s&&i.align==OrgChart.CENTER){var y=Math.ceil(t/x),b=Math.ceil(e/x),w=0,_=0;if(y-2*i.padding>=a-n)switch(w=(a+n)/2-y/2,i.orientation){case OrgChart.orientation.right:case OrgChart.orientation.right_top:w=(n-a)/2-y/2}else switch(w=h.x-y/2+OrgChart.server._getNodeWidth(h,i)/2,i.orientation){case OrgChart.orientation.right:case OrgChart.orientation.right_top:(w=-(y/2-(n-a)/2))-i.padding&&(w=-i.padding)}if(b-2*i.padding>=o-l)switch(_=(o+l)/2-b/2,i.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:_=(l-o)/2-b/2}else switch((_=-(b/2-(o-l)/2))>-i.padding&&(_=-i.padding),i.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:(_=-(b/2-(l-o)/2))C.right?C.right:C.left),s[0]>C.right&&s[0]>C.left&&(s[0]=C.left>C.right?C.left:C.right),s[1]C.bottom?C.bottom:C.top),s[1]>C.bottom&&s[1]>C.top&&(s[1]=C.top>C.bottom?C.top:C.bottom)));if(d==OrgChart.action.insert||d==OrgChart.action.expandCollapse||d==OrgChart.action.update||d==OrgChart.action.centerNode){var k=null;if(d==OrgChart.action.insert&&c&&null!=c.insertedNodeId&&null!=c.insertedNodeId)(k=g[c.insertedNodeId])||(k=g[p[c.insertedNodeId]]);else if(d==OrgChart.action.update&&c&&null!=c.visId&&null!=c.visId)(k=g[c.visId])||(k=g[p[c.visId]]);else if(d==OrgChart.action.expandCollapse&&c&&null!=c.id&&null!=c.id)(k=g[c.id])||(k=g[p[c.id]]),k=OrgChart.server._getMostDeepChild(k,g);else if(d==OrgChart.action.centerNode){switch(i.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:c.options.vertical||(k=g[c.id]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:case OrgChart.orientation.left:case OrgChart.orientation.left_top:c.options.horizontal||(k=g[c.id])}k&&(k||(k=g[p[c.id]]),k=OrgChart.server._getMostDeepChild(k,g))}if(k)switch(i.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:var A=k.y+k.h-s[3]+i.padding;s[1]A&&(s[1]=A);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:A=k.x-i.padding;s[0]>A&&(s[0]=A);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:A=k.x+k.w-s[2]+i.padding;s[0]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.server._isNotNullEmptyUndefined=function(t){return null!=t&&null!=t&&""!==t},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:'',svg:'{content}',link:'',pointer:'',node:'',plus:'',minus:'',nodeMenuButton:'',exportMenuButton:'



',img_0:'',link_field_0:'{val}'},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:'{content}',link:'',assistanseLink:'',pointer:'',node:'',plus:'',minus:'',nodeMenuButton:'',exportMenuButton:'



',img_0:'',link_field_0:'{val}',field_0:'{val}',field_1:'{val}'},OrgChart.templates.split=Object.assign({},OrgChart.templates.ana),OrgChart.templates.split.size=[10,10],OrgChart.templates.split.node='',OrgChart.templates.group_orange=Object.assign({},OrgChart.templates.base),OrgChart.templates.group_orange.size=[250,120],OrgChart.templates.group_orange.node='',OrgChart.templates.group_orange.groupPadding=[50,10,10,10],OrgChart.templates.group_orange.groupNodesSeparation=10,OrgChart.templates.group_orange.groupName='{val}',OrgChart.templates.group_yellow=Object.assign({},OrgChart.templates.group_orange),OrgChart.templates.group_yellow.node='',OrgChart.templates.group_yellow.groupName='{val}',OrgChart.templates.group_grey=Object.assign({},OrgChart.templates.group_orange),OrgChart.templates.group_grey.node='',OrgChart.templates.group_grey.groupName='{val}',OrgChart.templates.group_grey_one_column=Object.assign({},OrgChart.templates.group_grey),OrgChart.templates.group_grey_one_column.columns=1,OrgChart.templates.ula=Object.assign({},OrgChart.templates.ana),OrgChart.templates.ula.field_0='{val}',OrgChart.templates.ula.field_1='{val}',OrgChart.templates.ula.node='',OrgChart.templates.ula.img_0='',OrgChart.templates.ula.menu='',OrgChart.templates.ula.nodeMenuButton='',OrgChart.templates.olivia=Object.assign({},OrgChart.templates.ana),OrgChart.templates.olivia.field_0='{val}',OrgChart.templates.olivia.field_1='{val}',OrgChart.templates.olivia.defs='',OrgChart.templates.olivia.node='',OrgChart.templates.olivia.img_0='',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='',OrgChart.templates.belinda.img_0='',OrgChart.templates.belinda.field_0='{val}',OrgChart.templates.belinda.field_1='{val}',OrgChart.templates.belinda.link='',OrgChart.templates.belinda.nodeMenuButton='',OrgChart.templates.rony=Object.assign({},OrgChart.templates.ana),OrgChart.templates.rony.svg='{content}',OrgChart.templates.rony.defs='',OrgChart.templates.rony.size=[180,250],OrgChart.templates.rony.ripple={color:"#F57C00",radius:5,rect:null},OrgChart.templates.rony.img_0='',OrgChart.templates.rony.node='',OrgChart.templates.rony.field_0='{val}',OrgChart.templates.rony.field_1='{val}',OrgChart.templates.rony.field_2='{val}',OrgChart.templates.rony.link='',OrgChart.templates.rony.plus='',OrgChart.templates.rony.minus='',OrgChart.templates.rony.nodeMenuButton='',OrgChart.templates.mery=Object.assign({},OrgChart.templates.ana),OrgChart.templates.mery.ripple={color:"#e6e6e6",radius:50,rect:null},OrgChart.templates.mery.node='',OrgChart.templates.mery.link='',OrgChart.templates.mery.img_0='',OrgChart.templates.mery.field_0='{val}',OrgChart.templates.mery.field_1='{val}',OrgChart.templates.mery.nodeMenuButton='',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='',OrgChart.templates.polina.img_0='',OrgChart.templates.polina.field_0='{val}',OrgChart.templates.polina.field_1='{val}',OrgChart.templates.polina.link='',OrgChart.templates.polina.nodeMenuButton='',OrgChart.templates.mila=Object.assign({},OrgChart.templates.ana),OrgChart.templates.mila.node='',OrgChart.templates.mila.img_0='',OrgChart.templates.mila.field_0='{val}',OrgChart.templates.mila.nodeMenuButton='',OrgChart.templates.diva=Object.assign({},OrgChart.templates.ana),OrgChart.templates.diva.size=[200,170],OrgChart.templates.diva.node='',OrgChart.templates.diva.img_0='',OrgChart.templates.diva.field_0='{val}',OrgChart.templates.diva.field_1='{val}',OrgChart.templates.diva.pointer='',OrgChart.templates.diva.nodeMenuButton='',OrgChart.templates.luba=Object.assign({},OrgChart.templates.ana),OrgChart.templates.luba.svg='{content}',OrgChart.templates.luba.defs='',OrgChart.templates.luba.node='',OrgChart.templates.luba.img_0='',OrgChart.templates.luba.nodeMenuButton='',OrgChart.templates.luba.field_0='{val}',OrgChart.templates.luba.field_1='{val}',OrgChart.templates.luba.plus='',OrgChart.templates.luba.minus='',OrgChart.templates.luba.expandCollapseSize=36,OrgChart.templates.derek=Object.assign({},OrgChart.templates.ana),OrgChart.templates.derek.link='',OrgChart.templates.derek.field_0='{val}',OrgChart.templates.derek.field_1='{val}',OrgChart.templates.derek.node='',OrgChart.templates.derek.defs=' ',OrgChart.templates.derek.img_0='',OrgChart.templates.derek.minus='',OrgChart.templates.derek.plus='',OrgChart.templates.derek.nodeMenuButton='',OrgChart.templates.isla=Object.assign({},OrgChart.templates.ana),OrgChart.templates.isla.defs='',OrgChart.templates.isla.size=[180,120],OrgChart.templates.isla.node='',OrgChart.templates.isla.field_0='{val}',OrgChart.templates.isla.field_1='{val}',OrgChart.templates.isla.img_0='',OrgChart.templates.isla.minus='',OrgChart.templates.isla.plus='',OrgChart.templates.isla.nodeMenuButton='',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='',OrgChart.templates.deborah.img_0='',OrgChart.templates.deborah.field_0='{val}',OrgChart.templates.deborah.field_1='{val}',OrgChart.templates.deborah.nodeMenuButton='',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.replace("{randId}",OrgChart.ui._defsIds[r])):e+=i.defs}return""+e+t+""},css:function(){return''},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){return e===OrgChart.action.exporting?"":OrgChart.t(t.template,r).pointer},node:function(t,e,r,i,a,o,n,l,s,h){var d=OrgChart.t(t.templateName,s),c=d.node.replaceAll("{w}",t.w).replaceAll("{h}",t.h);if(d.defs&&(c=c.replace("{randId}",OrgChart.ui._defsIds[t.templateName])),null==n&&(n=i.nodeBinding),t.isGroup){var g=i.tags[t.id].groupName;if(g){var p=d.groupName.replace("{elastic_width}",t.w-(d.groupPadding[3]+d.groupPadding[1]+45));g=OrgChart.wrapText(g,p),c+=p.replace("{val}",g).replaceAll("{randId}",OrgChart._randomId()).replaceAll("{randId2}",OrgChart._randomId())}}else for(var f in n){var u=n[f];if(e){var C=e[u];if("function"==typeof u&&(C=u(h,t)),null!=C&&null!=C&&null!=d[f])c+=(OrgChart._lblIsImg(i,f)||"string"!=typeof C||(C=OrgChart.wrapText(C,d[f])),d[f].replace("{val}",C)).replaceAll("{randId}",OrgChart._randomId()).replaceAll("{randId2}",OrgChart._randomId())}}var m=OrgChart._getPosition(r,t,a,o),O="node";Array.isArray(t.tags)&&t.tags.length&&(O+=" "+t.tags.join(" ")),t.layout&&(O+=" tree-layout");var v=OrgChart.nodeOpenTag.replace("{id}",t.id).replace("{class}",O).replace("{level}",t.level).replace("{x}",m.x).replace("{y}",m.y),x=OrgChart._getOpacity(r,t);v=v.replace("{opacity}",x),t.isGroup||null==i.nodeMenu||"split"==t.templateName||l===OrgChart.action.exporting||(c+=d.nodeMenuButton.replace("{id}",t.id));var y=OrgChart.ui._renderGroupedNodes(t,d,i,r,n,a,o,l,s,h);return t.isGroup&&l!=OrgChart.action.exporting&&(t.groupState==OrgChart.EXPAND?c+=OrgChart.MINIMIZE.replace("{x}",t.w-45).replace("{id}",t.id):c+=OrgChart.MAXIMIZE.replace("{x}",t.w-45).replace("{id}",t.id)),c=v+c+y+OrgChart.grCloseTag},_renderGroupedNodes:function(t,e,r,i,a,o,n,l,s,h){var d="";if(t.isGroup&&t.groupState==OrgChart.EXPAND){e.groupPadding||console.error("groupPadding is not defined in template "+t.templateName);for(var c=0;cr.right?r.right:r.left),e[0]>r.right&&e[0]>r.left&&(a[0]=r.left>r.right?r.left:r.right),e[1]r.bottom?r.bottom:r.top),e[1]>r.bottom&&e[1]>r.top&&(a[1]=r.top>r.bottom?r.top:r.bottom),e[0]!==a[0]||e[1]!==a[1]?OrgChart.anim(t,{viewBox:e},{viewBox:a},300,OrgChart.anim.outPow,function(){i&&i()}):i&&i()},OrgChart._randomId=function(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)},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.lengtha.top+a.height&&(l-=o.height),i.left-o.width",e.querySelector("text").getBoundingClientRect()},OrgChart.wrapText=function(t,e){if(-1==e.indexOf(""+e+"";var i=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("text")[0],a=parseFloat(i.getAttribute("x")),o=parseFloat(i.getAttribute("y")),n=i.getAttribute("text-anchor"),l=i.getAttribute("width"),s=i.getAttribute("text-overflow"),h="http://www.w3.org/2000/svg",d=r.getElementsByTagName("svg")[0].getElementsByTagName("text")[0];if(!l)return t;if(l=parseFloat(l),a||(a=0),o||(o=0),a||(n="start"),s||(s="ellipsis"),"ellipsis"==s){d.removeChild(d.firstChild),d.textContent=t;for(var c=d.getComputedTextLength(),g=2;l"+t+""+d.textContent:t}if("multiline"==s){var p=t.split(" "),f=d.getBBox().height;d.textContent="";var u=document.createElementNS(h,"tspan"),C=document.createTextNode(p[0]);u.setAttributeNS(null,"x",a),u.setAttributeNS(null,"y",o),u.setAttributeNS(null,"text-anchor",n),u.appendChild(C),d.appendChild(u);g=1;for(var m=1;ml)u.firstChild.data=u.firstChild.data.slice(0,O),(u=document.createElementNS(h,"tspan")).setAttributeNS(null,"x",a),u.setAttributeNS(null,"y",o+f*g),u.setAttributeNS(null,"text-anchor",n),C=document.createTextNode(p[m]),u.appendChild(C),d.appendChild(u),g++}var v="";if(null!=d.innerHTML)v=d.innerHTML,d.innerHTML="";else{var x="";for(m=d.childNodes.length-1;0<=m;m--)x=XMLSerializer().serializeToString(d.childNodes[m])+x,d.removeChild(d.childNodes[m]);v=x}return v}},OrgChart._downloadFile=function(t,e,r){var i=new Blob([e],{type:t});if(navigator.msSaveBlob)navigator.msSaveBlob(i,r);else{var a=document.createElement("a");if(void 0!==a.download){var o=URL.createObjectURL(i);a.setAttribute("href",o),a.setAttribute("download",r),a.style.visibility="hidden",document.body.appendChild(a),a.click(),document.body.removeChild(a)}}},OrgChart._getPosition=function(t,e,r,i){var a={x:e.x,y:e.y};if(null!=r&&(a.x=r),null!=i&&(a.y=i),t&&3==t.length){var o=t[0].indexOf(e.id);-1!=o&&null!=t[1][o].transform&&(null==r&&(a.x=t[1][o].transform[4]),null==i&&(a.y=t[1][o].transform[5]))}return a},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){var r=OrgChart.templates[t],i=null;if(null!=e&&r.scaleLessThen){var a=[];for(var o in r.scaleLessThen){var n=parseFloat(o);e'+(new XMLSerializer).serializeToString(e.documentElement)},OrgChart._xml2json=function(t){for(var e=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("node"),r=[],i=0;ir&&(n.pos=r),a||o()},!1);var r=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,20)}}(t,e.speed,e.smooth)}},OrgChart.xScrollUI.prototype.create=function(t){if(this.config.showXScroll===OrgChart.scroll.visible||this.config.mouseScrool===OrgChart.action.scroll||this.config.mouseScrool===OrgChart.action.xScroll){var a=this;this.bar&&this.bar.parentNode.removeChild(this.bar),this.bar=document.createElement("div"),this.config.showXScroll!==OrgChart.scroll.visible&&(this.bar.style.visibility="hidden"),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=a.requestParams(),e=(parseFloat(a.innerBar.clientWidth)-parseFloat(a.bar.clientWidth))/100,r=this.scrollLeft/e,i=(t.boundary.right-t.boundary.left)/100;t.viewBox[0]=r*i+t.boundary.left,a.onSetViewBoxCallback(t.viewBox),clearTimeout(this._timeout),this._timeout=setTimeout(function(){a.onDrawCallback()},500)}})}},OrgChart.xScrollUI.prototype.setPosition=function(){if(this.bar){var t=this.requestParams(),e=(t.boundary.maxY,t.scale,Math.abs(t.boundary.maxX-t.boundary.minX)*t.scale);switch(this.config.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:Math.abs(t.boundary.minY*t.scale);break;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:100r&&(n.pos=r),a||o()},!1);var r=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,20)}}(t,e.speed,e.smooth)}},OrgChart.yScrollUI.prototype.create=function(t){if(this.config.showYScroll===OrgChart.scroll.visible||this.config.mouseScrool===OrgChart.action.scroll||this.config.mouseScrool===OrgChart.action.yScroll){var a=this;this.bar&&this.bar.parentNode.removeChild(this.bar),this.bar=document.createElement("div"),this.config.showYScroll!==OrgChart.scroll.visible&&(this.bar.style.visibility="hidden"),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=a.requestParams(),e=(parseFloat(a.innerBar.clientHeight)-parseFloat(a.bar.clientHeight))/100,r=this.scrollTop/e,i=(t.boundary.bottom-t.boundary.top)/100;t.viewBox[1]=r*i+t.boundary.top,a.onSetViewBoxCallback(t.viewBox),clearTimeout(this._timeout),this._timeout=setTimeout(function(){a.onDrawCallback()},500)}})}},OrgChart.yScrollUI.prototype.setPosition=function(){if(this.bar){var t=this.requestParams(),e=t.boundary.maxY*t.scale;t.boundary.maxX,t.scale;switch(this.config.orientation){case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:e=Math.abs(t.boundary.minY*t.scale);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:Math.abs(t.boundary.minX*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:100this.config.scaleMin||0!=t&&1!=t&&lthis.config.scaleMin){this._hideBeforeAnimation();var s=this;r?(clearTimeout(s._timeout),OrgChart.anim(this.getSvg(),{viewbox:this.getViewBox()},{viewbox:i},this.config.anim.duration,this.config.anim.func,function(){clearTimeout(s._timeout),s._timeout=setTimeout(function(){s._draw(!0,OrgChart.action.zoom)},500)})):(this.setViewBox(i),clearTimeout(s._timeout),s._timeout=setTimeout(function(){s._draw(!0,OrgChart.action.zoom)},500))}},OrgChart.loading={},OrgChart.loading.show=function(t){var e=document.createElement("div");e.id="bg-loading",e.innerHTML='
',t.element.appendChild(e)},OrgChart.loading.hide=function(t){var e=t.element.querySelector("#bg-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.ppdfFitToDrwaing2Levels="Fit (2 Levels Page)",OrgChart.loc.ppdfA4="A4",OrgChart.loc.ppdfA3="A3",OrgChart.loc.ppdfA2="A2",OrgChart.loc.ppdfA1="A1",OrgChart.loc.ppdfA42Levels="A4 (2 Levels Page)",OrgChart.loc.ppdfA32Levels="A3 (2 Levels Page)",OrgChart.loc.ppdfA22Levels="A2 (2 Levels Page)",OrgChart.loc.ppdfA12Levels="A1 (2 Levels Page)",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(r,i){i=r._defaultExportOptions(i,"pdf");var t=document.createElement("div");t.id="bg-ppdf-btns",Object.assign(t.style,{position:"absolute",top:0,left:0,"background-color":"#fff","z-index":5,margin:"0 0 0 -250px","box-shadow":"0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)",width:"250px",height:"100%","font-family":"Roboto,Helvetica",color:"#757575","text-align":"right",padding:"10px"}),r.element.appendChild(t),t.innerHTML="

"+OrgChart.loc.ppdfCmdTitle+'

 
';var e=document.createElement("div");e.id="bg-ppdf-wrapper",Object.assign(e.style,{"overflow-y":"scroll",position:"absolute",top:0,left:"270px","background-color":"#eee",width:r.width()-270+"px",height:"100%"}),r.element.appendChild(e),e.innerHTML='
';var a,o,n,l=r.element.querySelector("#bg-ppdf-size"),s=r.element.querySelector("#bg-ppdf-layout"),h=r.element.querySelector("#bg-ppdf-scale"),d=r.element.querySelector("#bg-ppdf-margin"),c=r.element.querySelector("#bg-ppdf-header"),g=r.element.querySelector("#bg-ppdf-footer");l.value=i.format,s.value=i.landscape,h.value=i.scale,d.value=i.margin,c.value=i.header,g.value=i.footer,OrgChart.anim(r.element.querySelector("#bg-ppdf-btns"),{margin:[0,0,0,-250]},{margin:[0,0,0,0]},300,OrgChart.anim.outSin,function(){r.exportPDF(i,OrgChart.pdfPrevUI._handler)}),r.element.querySelector("#bg-prev-cancel").addEventListener("click",function(){OrgChart.pdfPrevUI.hide(r)}),r.element.querySelector("#bg-prev-save").addEventListener("click",function(){r.exportPDF(i),OrgChart.pdfPrevUI.hide(r)}),OrgChart.pdfPrevUI._showHide(l,s,h),l.addEventListener("change",function(){OrgChart.anim(r.element.querySelector("#bg-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,function(){r.element.querySelector("#bg-ppdf-content").innerHTML="",i.format=l.value,r.exportPDF(i,OrgChart.pdfPrevUI._handler),OrgChart.pdfPrevUI._showHide(l,s,h)})}),s.addEventListener("change",function(){OrgChart.anim(r.element.querySelector("#bg-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,function(){r.element.querySelector("#bg-ppdf-content").innerHTML="",i.landscape="true"==s.value,r.exportPDF(i,OrgChart.pdfPrevUI._handler),OrgChart.pdfPrevUI._showHide(l,s,h)})}),h.addEventListener("change",function(){OrgChart.anim(r.element.querySelector("#bg-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,function(){r.element.querySelector("#bg-ppdf-content").innerHTML="",i.scale=h.value,r.exportPDF(i,OrgChart.pdfPrevUI._handler),OrgChart.pdfPrevUI._showHide(l,s,h)})}),d.addEventListener("keyup",function(){clearTimeout(a),a=setTimeout(function(){OrgChart.anim(r.element.querySelector("#bg-ppdf-content"),{opacity:1},{opacity:0},300,OrgChart.anim.inSin,function(){r.element.querySelector("#bg-ppdf-content").innerHTML="";var t=d.value.split(",");if(4==t.length){for(var e=0;e';return a&&(s+='
'+a+"
"),s+=t,o&&(s+='"),s+="",s+=""},OrgChart.pdfPrevUI.hide=function(e){var r=e.element.querySelector("#bg-ppdf-wrapper");r&&OrgChart.anim(r,{opacity:1},{opacity:0},300,OrgChart.anim.inSin,function(){r.parentNode.removeChild(r);var t=e.element.querySelector("#bg-ppdf-btns");OrgChart.anim(t,{margin:[0,0,0,0]},{margin:[0,0,0,-280]},300,OrgChart.anim.inSin,function(){t.parentNode.removeChild(t)})})},void 0===OrgChart&&(OrgChart={}),OrgChart.events.on("renderdefs",function(t,e){for(var r=0;r'.replace("{from}",d.id).replace("{to}",c.id)+m.link.replace("{d}","M{a.x},{a.y} C{a.x},{a.y} {c.x},{c.y} {b.x},{b.y}").replaceAll("{b.x}",v.x).replaceAll("{b.y}",v.y).replaceAll("{a.x}",O.x).replaceAll("{a.y}",O.y).replaceAll("{c.x}",k.x).replaceAll("{c.y}",k.y);var S=(r=O,a=k,void 0,o=((i=v).x-r.x)/2+r.x,n=(i.y-r.y)/2+r.y,{x:(o-a.x)/2+a.x,y:(n-a.y)/2+a.y});h.label&&(l+=m.label.replace("{x}",S.x).replace("{y}",S.y).replace("{val}",h.label)),l+=OrgChart.grCloseTag}function I(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.CLINK_CURVE,{x:t.x+i/2-a*o,y:t.y+a/2+i*o}}}e.content+=l},OrgChart.prototype.addClink=function(t,e,r,i){return this.removeClink(t,e),this.config.clinks.push({from:t,to:e,label:r,template:i}),this},OrgChart.prototype.removeClink=function(t,e){for(var r=this.config.clinks.length-1;0<=r;r--){var i=this.config.clinks[r];i.from==t&&i.to==e&&this.config.clinks.splice(r,1)}return this},OrgChart.clinkTemplates={},OrgChart.clinkTemplates.orange={defs:' ',link:'',label:'{val}'},OrgChart.clinkTemplates.blue={defs:' ',link:'',label:'{val}'},OrgChart.clinkTemplates.yellow={defs:' ',link:'',label:'{val}'},void 0===OrgChart&&(OrgChart={}),OrgChart.events.on("renderdefs",function(t,e){for(var r=0;rt.x&&(a="right");break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:case OrgChart.orientation.right:case OrgChart.orientation.right_top:a="top",e.y>t.y&&(a="bottom")}var o=OrgChart.t(t.templateName,A),n=w.config.levelSeparation;(t.parent&&t.parent.layout==OrgChart.mixed||t.parent&&t.parent.layout==OrgChart.tree)&&(n=w.config.mixedHierarchyNodesSeparation);var l={p:t.x+t.w/2+o.expandCollapseSize,q:t.y,r:t.x+t.w/2+o.expandCollapseSize,s:S.minY+n};if(t.level==e.level)switch(i=e,w.config.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:r.push([l.p,l.q]),r.push([l.p,l.q-n/3]),o=OrgChart.t(i.templateName,A),r.push([i.x+i.w/2+o.expandCollapseSize,r[r.length-1][1]]),r.push([r[r.length-1][0],i.y]);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:l.q=t.y+t.h,l.s=S.maxY-n,r.push([l.p,l.q]),r.push([l.r,t.y+t.h+n/3]),o=OrgChart.t(i.templateName,A),r.push([i.x+i.w/2+o.expandCollapseSize,r[r.length-1][1]]),r.push([r[r.length-1][0],i.y+i.h]);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:l.p=t.x,l.q=t.y+t.h/2+o.expandCollapseSize,l.r=S.minX-n,l.s=t.y+t.h/2+o.expandCollapseSize,r.push([l.p,l.q]),r.push([t.x-n/3,l.q]),o=OrgChart.t(i.templateName,A),r.push([r[r.length-1][0],i.y+i.h/2+o.expandCollapseSize]),r.push([i.x,r[r.length-1][1]]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:l.p=t.x+t.w,l.q=t.y+t.h/2+o.expandCollapseSize,l.r=S.maxX+n,l.s=t.y+t.h/2+o.expandCollapseSize,r.push([l.p,l.q]),r.push([t.x+t.w+n/3,l.q]),o=OrgChart.t(i.templateName,A),r.push([r[r.length-1][0],i.y+i.h/2+o.expandCollapseSize]),r.push([i.x+i.w,r[r.length-1][1]])}else{switch(w.config.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:r.push([l.p,l.q]),r.push([l.r,t.y-n/3]);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:l.q=t.y+t.h,l.s=S.maxY-n,r.push([l.p,l.q]),r.push([l.r,t.y+t.h+n/3]);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:l.p=t.x,l.q=t.y+t.h/2+o.expandCollapseSize,l.r=S.minX-n,l.s=t.y+t.h/2+o.expandCollapseSize,r.push([l.p,l.q]),r.push([t.x-n/3,l.q]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:l.p=t.x+t.w,l.q=t.y+t.h/2+o.expandCollapseSize,l.r=S.maxX+n,l.s=t.y+t.h/2+o.expandCollapseSize,r.push([l.p,l.q]),r.push([t.x+t.w+n/3,l.q])}for(var s=t;null==i;){var h=!1,d=s.parent,c=d.leftNeighbor,g=d.rightNeighbor;if(d.id==e.id?i=d:OrgChart._intersects(d,l,w.config)&&(l=OrgChart._addPoint(d,r,w.config,l,a),h=!0),d.id!=e.id){for(;c;){if(c.id==e.id){i=c;break}OrgChart._intersects(c,l,w.config)&&(l=OrgChart._addPoint(c,r,w.config,l,a),h=!0),c=c.leftNeighbor}for(;g;){if(g.id==e.id){i=g;break}OrgChart._intersects(g,l,w.config)&&(l=OrgChart._addPoint(g,r,w.config,l,a),h=!0),g=g.rightNeighbor}}if(!h){var p=r[r.length-1][0],f=0;if(d.parent)switch(n=w.config.levelSeparation,d.parent.layout!=OrgChart.mixed&&d.parent.layout!=OrgChart.tree||(n=w.config.mixedHierarchyNodesSeparation),w.config.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:f=d.parent.y+d.parent.h+n*(2/3);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:f=d.parent.y-n*(2/3);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:p=d.parent.x+d.parent.w+n*(2/3),f=r[r.length-1][1];break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:p=d.parent.x-n*(2/3),f=r[r.length-1][1]}r.push([p,f])}s=d}switch(o=OrgChart.t(i.templateName,A),r.splice(r.length-1,1),w.config.orientation){case OrgChart.orientation.top:case OrgChart.orientation.top_left:r.push([i.x+i.w/2+o.expandCollapseSize,r[r.length-1][1]]),r.push([r[r.length-1][0],i.y+i.h]);break;case OrgChart.orientation.bottom:case OrgChart.orientation.bottom_left:r.push([i.x+i.w/2+o.expandCollapseSize,r[r.length-1][1]]),r.push([r[r.length-1][0],i.y]);break;case OrgChart.orientation.left:case OrgChart.orientation.left_top:r.push([r[r.length-1][0],i.y+i.h/2+o.expandCollapseSize]),r.push([i.x+i.w,r[r.length-1][1]]);break;case OrgChart.orientation.right:case OrgChart.orientation.right_top:r.push([r[r.length-1][0],i.y+i.h/2+o.expandCollapseSize]),r.push([i.x,r[r.length-1][1]])}}var u=I.template;u||(u="orange");var C=null;switch((o=OrgChart.slinkTemplates[u]).labelPosition){case"start":C={x:r[1][0],y:r[1][1]};break;case"middle":var m=Math.ceil(r.length/2);C=function(t,e){return{x:(t[0]+e[0])/2,y:(t[1]+e[1])/2}}(r[m],r[m-1]);break;case"end":C={x:r[r.length-2][0],y:r[r.length-2][1]}}r[0]="M"+r[0].join(",");for(var O=1;O=i.level?t(r,i):t(i,r)}}},OrgChart.prototype.addSlink=function(t,e,r,i){return this.removeClink(t,e),this.config.slinks.push({from:t,to:e,label:r,template:i}),this},OrgChart.prototype.removeSlink=function(t,e){for(var r=this.config.slinks.length-1;0<=r;r--){var i=this.config.slinks[r];i.from==t&&i.to==e&&this.config.slinks.splice(r,1)}return this},OrgChart.slinkTemplates={},OrgChart.slinkTemplates.orange={defs:' ',link:'',label:'{val}',labelPosition:"middle"},OrgChart.slinkTemplates.blue={defs:' ',link:'',label:'{val}',labelPosition:"middle"},OrgChart.slinkTemplates.yellow={defs:' ',link:'',label:'{val}',labelPosition:"middle"};