think/packages/client/public/diagram.min.js

1 line
1.6 MiB
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

window.urlParams=window.urlParams||{},window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760,window.MAX_AREA=window.MAX_AREA||225e6,window.mxBasePath="/diagram",window.RESOURCES_PATH="/diagram/resources",window.STENCIL_PATH="/diagram/stencils",window.IMAGE_PATH="/diagram/images";var HoverIcons=function(){},mxCellEditorGetInitialValue=function(){},mxCellEditorGetCurrentValue=function(){},mxGraphHandlerIsValidDropTarget=function(){},Format=function(){},BaseFormatPanel=function(){},ArrangePanel=function(){},TextFormatPanel=function(){},StyleFormatPanel=function(){},DiagramStylePanel=function(){},DiagramFormatPanel=function(){},Menus=function(){},mxJSColor={dir:"",bindClass:"color",binding:!0,preloading:!0,install:function(){},init:function(){mxJSColor.preloading&&mxJSColor.preload()},getDir:function(){var t;return mxJSColor.dir||(t=mxJSColor.detectDir(),mxJSColor.dir=!1!==t?t:"jscolor/"),mxJSColor.dir},detectDir:function(){for(var t=location.href,e=document.getElementsByTagName("base"),n=0;n<e.length;n+=1)e[n].href&&(t=e[n].href);for(e=document.getElementsByTagName("script"),n=0;n<e.length;n+=1)if(e[n].src&&/(^|\/)jscolor\.js([?#].*)?$/i.test(e[n].src)){var i=new mxJSColor.URI(e[n].src).toAbsolute(t);return i.path=i.path.replace(/[^\/]+$/,""),i.query=null,i.fragment=null,i.toString()}return!1},preload:function(){for(var t in mxJSColor.imgRequire)mxJSColor.imgRequire.hasOwnProperty(t)&&mxJSColor.loadImage(t)},images:{pad:[181,101],sld:[16,101],cross:[15,15],arrow:[7,11]},imgRequire:{},imgLoaded:{},requireImage:function(t){mxJSColor.imgRequire[t]=!0},loadImage:function(t){mxJSColor.imgLoaded[t]||(mxJSColor.imgLoaded[t]=new Image,mxJSColor.imgLoaded[t].src=mxJSColor.getDir()+t)},fetchElement:function(t){return"string"==typeof t?document.getElementById(t):t},addEvent:function(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on"+e,n)},fireEvent:function(t,e){var n;t&&(document.createEvent?((n=document.createEvent("HTMLEvents")).initEvent(e,!0,!0),t.dispatchEvent(n)):document.createEventObject?(n=document.createEventObject(),t.fireEvent("on"+e,n)):t["on"+e]&&t["on"+e]())},getElementPos:function(t){var e=t,n=t,i=0,l=0;if(e.offsetParent)for(;i+=e.offsetLeft,l+=e.offsetTop,e=e.offsetParent;);for(;(n=n.parentNode)&&"BODY"!==n.nodeName.toUpperCase();)i-=n.scrollLeft,l-=n.scrollTop;return[i,l]},getElementSize:function(t){return[t.offsetWidth,t.offsetHeight]},getRelMousePos:function(t){var e=0,n=0;return"number"==typeof(t=t||window.event).offsetX?(e=t.offsetX,n=t.offsetY):"number"==typeof t.layerX&&(e=t.layerX,n=t.layerY),{x:e,y:n}},getViewPos:function(){return"number"==typeof window.pageYOffset?[window.pageXOffset,window.pageYOffset]:document.body&&(document.body.scrollLeft||document.body.scrollTop)?[document.body.scrollLeft,document.body.scrollTop]:document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)?[document.documentElement.scrollLeft,document.documentElement.scrollTop]:[0,0]},getViewSize:function(){return"number"==typeof window.innerWidth?[window.innerWidth,window.innerHeight]:document.body&&(document.body.clientWidth||document.body.clientHeight)?[document.body.clientWidth,document.body.clientHeight]:document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)?[document.documentElement.clientWidth,document.documentElement.clientHeight]:[0,0]},URI:function(t){function i(t){for(var e,n="";t;)"../"===t.substr(0,3)||"./"===t.substr(0,2)?t=t.replace(/^\.+/,"").substr(1):"/./"===t.substr(0,3)||"/."===t?t="/"+t.substr(3):"/../"===t.substr(0,4)||"/.."===t?(t="/"+t.substr(4),n=n.replace(/\/?[^\/]*$/,"")):"."===t||".."===t?t="":(e=t.match(/^\/?[^\/]*/)[0],t=t.substr(e.length),n+=e);return n}this.scheme=null,this.authority=null,this.path="",this.query=null,this.fragment=null,this.parse=function(t){t=t.match(/^(([A-Za-z][0-9A-Za-z+.-]*)(:))?((\/\/)([^\/?#]*))?([^?#]*)((\?)([^#]*))?((#)(.*))?/);return this.scheme=t[3]?t[2]:null,this.authority=t[5]?t[6]:null,this.path=t[7],this.query=t[9]?t[10]:null,this.fragment=t[12]?t[13]:null,this},this.toString=function(){var t="";return null!==this.scheme&&(t=t+this.scheme+":"),null!==this.authority&&(t=t+"//"+this.authority),null!==this.path&&(t+=this.path),null!==this.query&&(t=t+"?"+this.query),null!==this.fragment&&(t=t+"#"+this.fragment),t},this.toAbsolute=function(t){var t=new mxJSColor.URI(t),e=this,n=new mxJSColor.URI;return null!==t.scheme&&(null!==e.scheme&&e.scheme.toLowerCase()===t.scheme.toLowerCase()&&(e.scheme=null),null!==e.scheme?(n.scheme=e.scheme,n.authority=e.authority,n.path=i(e.path),n.query=e.query):(null!==e.authority?(n.authority=e.authority,n.path=i(e.path),n.query=e.query):(""===e.path?(n.path=t.path,null!==e.query?n.query=e.query:n.query=t.query):("/"===e.path.substr(0,1)?n.path=i(e.path):(null!==t.authority&&""===t.path?n.path="/"+e.path:n.path=t.path.replace(/[^\/]+$/,"")+e.path,n.path=i(n.path)),n.query=e.query),n.authority=t.authority),n.scheme=t.scheme),n.fragment=e.fragment,n)},t&&this.parse(t)},color:function(target,prop){for(var p in this.required=!0,this.adjust=!0,this.hash=!1,this.caps=!0,this.slider=!0,this.valueElement=target,this.styleElement=target,this.onImmediateChange=null,this.hsv=[0,0,1],this.rgb=[1,1,1],this.pickerOnfocus=!0,this.pickerMode="HSV",this.pickerPosition="bottom",this.pickerSmartPosition=!0,this.pickerButtonHeight=20,this.pickerClosable=!1,this.pickerCloseText="Close",this.pickerButtonColor="ButtonText",this.pickerFace=0,this.pickerFaceColor="ThreeDFace",this.pickerBorder=1,this.pickerBorderColor="ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight",this.pickerInset=1,this.pickerInsetColor="ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow",this.pickerZIndex=1e4,prop)prop.hasOwnProperty(p)&&(this[p]=prop[p]);function RGB_HSV(t,e,n){var i=Math.min(Math.min(t,e),n),l=Math.max(Math.max(t,e),n),s=l-i;if(0==s)return[null,0,l];t=t===i?3+(n-e)/s:e===i?5+(t-n)/s:1+(e-t)/s;return[6==t?0:t,s/l,l]}function HSV_RGB(t,e,n){if(null===t)return[n,n,n];var i=Math.floor(t),l=n*(1-e),s=n*(1-e*(i%2?t-i:1-(t-i)));switch(i){case 6:case 0:return[n,s,l];case 1:return[s,n,l];case 2:return[l,n,s];case 3:return[l,s,n];case 4:return[s,l,n];case 5:return[n,l,s]}}function removePicker(){delete mxJSColor.picker.owner,document.getElementsByTagName("body")[0].removeChild(mxJSColor.picker.boxB)}function drawPicker(t,e){if(!mxJSColor.picker){mxJSColor.picker={box:document.createElement("div"),boxB:document.createElement("div"),pad:document.createElement("div"),padB:document.createElement("div"),padM:document.createElement("div"),sld:document.createElement("div"),sldB:document.createElement("div"),sldM:document.createElement("div"),btn:document.createElement("div"),btnS:document.createElement("span"),btnT:document.createTextNode(THIS.pickerCloseText)};for(var n=0;n<mxJSColor.images.sld[1];n+=4){var i=document.createElement("div");i.style.height="4px",i.style.fontSize="1px",i.style.lineHeight="0",mxJSColor.picker.sld.appendChild(i)}mxJSColor.picker.sldB.appendChild(mxJSColor.picker.sld),mxJSColor.picker.box.appendChild(mxJSColor.picker.sldB),mxJSColor.picker.box.appendChild(mxJSColor.picker.sldM),mxJSColor.picker.padB.appendChild(mxJSColor.picker.pad),mxJSColor.picker.box.appendChild(mxJSColor.picker.padB),mxJSColor.picker.box.appendChild(mxJSColor.picker.padM),mxJSColor.picker.btnS.appendChild(mxJSColor.picker.btnT),mxJSColor.picker.btn.appendChild(mxJSColor.picker.btnS),mxJSColor.picker.box.appendChild(mxJSColor.picker.btn),mxJSColor.picker.boxB.appendChild(mxJSColor.picker.box)}var l=mxJSColor.picker;l.box.onmouseup=l.box.onmouseout=function(){mxClient.IS_TOUCH||target.focus()},l.box.onmousedown=function(){abortBlur=!0},l.box.onmousemove=function(t){(holdPad||holdSld)&&(holdPad&&setPad(t),holdSld&&setSld(t),document.selection?document.selection.empty():window.getSelection&&window.getSelection().removeAllRanges(),dispatchImmediateChange())},l.padM.onmouseup=l.padM.onmouseout=function(){holdPad&&(holdPad=!1,mxJSColor.fireEvent(valueElement,"change"))},l.padM.onmousedown=function(t){switch(modeID){case 0:0===THIS.hsv[2]&&THIS.fromHSV(null,null,1);break;case 1:0===THIS.hsv[1]&&THIS.fromHSV(null,1,null)}holdPad=!0,setPad(t),dispatchImmediateChange()},l.sldM.onmouseup=l.sldM.onmouseout=function(){holdSld&&(holdSld=!1,mxJSColor.fireEvent(valueElement,"change"))},l.sldM.onmousedown=function(t){holdSld=!0,setSld(t),dispatchImmediateChange()};var s,o=getPickerDims(THIS);l.box.style.width=o[0]+"px",l.box.style.height=o[1]+"px",l.boxB.style.position="absolute",l.boxB.style.clear="both",l.boxB.style.left=t+"px",l.boxB.style.top=e+"px",l.boxB.style.zIndex=THIS.pickerZIndex,l.boxB.style.border=THIS.pickerBorder+"px solid",l.boxB.style.borderColor=THIS.pickerBorderColor,l.boxB.style.background=THIS.pickerFaceColor,l.pad.style.width=mxJSColor.images.pad[0]+"px",l.pad.style.height=mxJSColor.images.pad[1]+"px",l.padB.style.position="absolute",l.padB.style.left=THIS.pickerFace+"px",l.padB.style.top=THIS.pickerFace+"px",l.padB.style.border=THIS.pickerInset+"px solid",l.padB.style.borderColor=THIS.pickerInsetColor,l.padM.style.position="absolute",l.padM.style.left="0",l.padM.style.top="0",l.padM.style.width=THIS.pickerFace+2*THIS.pickerInset+mxJSColor.images.pad[0]+mxJSColor.images.arrow[0]+"px",l.padM.style.height=l.box.style.height,l.padM.style.cursor="crosshair",l.sld.style.overflow="hidden",l.sld.style.width=mxJSColor.images.sld[0]+"px",l.sld.style.height=mxJSColor.images.sld[1]+"px",l.sldB.style.display=THIS.slider?"block":"none",l.sldB.style.position="absolute",l.sldB.style.right=THIS.pickerFace+"px",l.sldB.style.top=THIS.pickerFace+"px",l.sldB.style.border=THIS.pickerInset+"px solid",l.sldB.style.borderColor=THIS.pickerInsetColor,l.sldM.style.display=THIS.slider?"block":"none",l.sldM.style.position="absolute",l.sldM.style.right="0",l.sldM.style.top="0",l.sldM.style.width=mxJSColor.images.sld[0]+mxJSColor.images.arrow[0]+THIS.pickerFace+2*THIS.pickerInset+"px",l.sldM.style.height=l.box.style.height;try{l.sldM.style.cursor="pointer"}catch(t){l.sldM.style.cursor="hand"}l.btn.style.display=THIS.pickerClosable?"block":"none",l.btn.style.position="absolute",l.btn.style.left=THIS.pickerFace+"px",l.btn.style.bottom=THIS.pickerFace+"px",l.btn.style.padding="0 15px",l.btn.style.height="18px",l.btn.style.border=THIS.pickerInset+"px solid",s=(s=THIS.pickerInsetColor.split(/\s+/)).length<2?s[0]:s[1]+" "+s[0]+" "+s[0]+" "+s[1],l.btn.style.borderColor=s,l.btn.style.color=THIS.pickerButtonColor,l.btn.style.font="12px sans-serif",l.btn.style.textAlign="center";try{l.btn.style.cursor="pointer"}catch(t){l.btn.style.cursor="hand"}switch(l.btn.onmousedown=function(){THIS.hidePicker()},l.btnS.style.lineHeight=l.btn.style.height,modeID){case 0:var r="hs";break;case 1:r="hv"}e={arrow:"url('data:image/gif;base64,R0lGODlhBwALAKECAAAAAP///6g8eKg8eCH5BAEKAAIALAAAAAAHAAsAAAITTIQYcLnsgGxvijrxqdQq6DRJAQA7')",cross:"url('data:image/gif;base64,R0lGODlhDwAPAKEBAAAAAP///////////yH5BAEKAAIALAAAAAAPAA8AAAIklB8Qx53b4otSUWcvyiz4/4AeQJbmKY4p1HHapBlwPL/uVRsFADs=')",hs:"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALUAAABlCAIAAACEDzXRAAAKQ0lEQVR42u2d23IjKwxFBeRh5v8/9uQlzXlI2gGELoCEm6pxubp6PI69WoV3C20uIQPAH4A/AH/p41/pDcTxP4BPGDtq3vYJGPpv8craeRdo/fyTI8ZhHnodOGgcV/3rnx8QI0SABO2xfAbiCfVR8Wj+CD8jenbRJNyGOxLoAaH1iLu4EUEHAv1+MsQ4zLE4AiIOcpibv4u9OET6+cP4ASnJ1JH4/G60A9km+GbBxLlpKAkADoR2JnaBrvWD/x1GCZn9EYLEHqVfI6Efx0D7E9tDF/rBSJ54l8FqTUse0J+EvxPrdK0fD4aOLXQi7zyGxMaRvvWjjH2U8o9I44OKnf+wyCpHoR/Phk6d/COq8481YrNI3/qR2B+kMl1Fl6J8o/JrU/GEA6HdiB2ha/0YBVx7rFwNHAj9JuIl6EI/qKyJug4Yvg7xA0QEpB8nQe8itoQu9EOT8M3mTsqUSUzykH6cBO1PbA9d91+ShDzV9xrtcgW21IT6L0yfcS90FKCdw+wS6Q9ISWjVfLTVVT2mdiPGGRduFKWm7dBStWlLmI0j/QExdgp7gT5qCu2BLKiLqtc94hI7PB8auQP4KuyIvSJ960fUqXWcd2F48Khr1bHSj2dDp/afmg7tMrFxpG/9mHMFuqrH3spFw0s0Bgr9OAzamdgFutaPpMuqo6WVEXWJdSL14xhof2J76MKfS2yXWGOVB1WXXGOVdxFSx587CXoLsTE0689RH7VW4RMLeKI9wPpzz4XeS2wDzdbXR52AWStjwiSAA6HdiB2h1f6cqT0whzzuzz0LejuxATTy90Xt40v7CzdGRvKS4O/zQ0AiXaRW5x/dv4vS4A/a308LYR5pFquRRvlHIrKWoCj5woCVId4eR/KPNDjURg2tdEC7rSQN5B9DYR70X5YivVxft7AyrOvrD4V2JnaBJurr+qpemLEywlRhT6qvPx16C7ExdK0fSjcj0maAzsqgBt7rfIxGP46B9iT2gi70I842bNj0U4wd/WAG/L5VP3p0W4iNoYv6Oh6eoJmSMW5laIzF8iT1TtgeV9RZoZ7QvdEUzsQu0CP+HOMKDFoZvDFg6s89CNqf2B5a4e8Hts84W0pgeohBtspBXYp8H3Tk/H23MBtHuvbn5mp7dlU9TUkP+XNJMabzHdCIbnuYDSItzZ+bdgUWrAwNPhwInRxw1/wXuYGj+4vo7flboRpjEQ6EjgojYK9/K04NFfNTauEBypXQWQLAfqQoHl9CfvpQ6C3ExtC9/q2YW2u6X1JWzfsYFPKX3L99LrQ/sT10XR+jKh+UN2AxlDOyXfLQaxxf/fkvT4d2JnaBZv258M6h4IFu2Em7/sezoLcQG0Mjfy6xrqLnVBLGWHw1i69WP5LCCn0TNEL3DLNXpCV/n5oo5jAVLY5Em6i8Pwm6uSNuCrNxpNX+nDira20qqyZriv384xhoZ2IX6Lr/wg8eiwpXYGQqPEgjsBrX+er3X46B9ie2h6bX/4i6IfcLS2mIY++7TfoCuLj6hwgN89CwBJ3Gx8rOVsn0kQ48tDS/4X1L8SzMb3BbkGdtwsD05AbP9YOU8xui+uljZei/P/3qx2HQbsSO0Ar/lveHLZYCVK4GeN1P5N+eAb2R2Aya9ueUY+8dlhLtdhWvgfEfz4AeGf9hR2wcaeTPpacvRdzLTx8J/Qq1Ij995PrJ3/mp0p8LO5YyF0s215g/9yxoZ2IXaLo+FiwtgTlvIAznp4+G3khsBk3Pf5mYvqOwMqZnNnw3i9cRDoT2JPaCZuvreskDuXkHxfQMvfbBgdBbiI2hC/3QLCg6lESZZkrfJ7nSj3gWNEMcRkYJsf5L0BXENBl1WV8/aquMLM9/eSJ0UtxZmFGGg4MigZ75ovHnvsOcUX09zRbzjCrU/K/Rev0gT2i2vu4cZrNI1+sH2e49Yb3lRC6e9fSS9ETohjj7hdkx0rQ/57/rxIrhBQdCv494Hlrtz1lo30Qjz1z+cRh02ndTNIMm1j8NxtmePs+76i+/esJHrH/6dGh/YntoRf9l2RtQWgJXzY4bdtbqx0OhnYldoHv7I79jf4+rOGGaRWr14yToLcTG0Ky/v32rjAsdX9S5vgI4ENqT2Asa7Z/9vq0yStiGNNVHkOe/RGmqwBQ0jEDHFpoJ85BLN+jPaRoHGWl2/2yx3msxVRHjZ0Td4GfV/Bf9bCM1dBiBfrHeJ1HR6dKEedDf5yPdBLilp/efC3Ribb1VxlUHGQe8iTb0598+Hdqf2B6a3b9SOerezsoIBWaJ3IBn1fp0j4PeQmwMzc5/idLK3UZWRkmKX2zA4Vc/DoPeSGwGrdvfY24RpKmVjrLuCQdCuxE7Qkv64TZ3Z44dVPrxUOh3EK9C1/lHGpz7ZzpVsYTF7K8Hyj+Ogd5FbAk9uL9H9LIyYg821sjo13gYtD+xPbRU/9Ds/b1sZTTIr5OStMGHA6GdiV2gUf2UmQcfJdUbXOoe6HoN1A0b2uQD4EBosXJqQTwKnXvXAEX+oZlfGaS9ewetDGCLeV1exH4e9Mr+2TDpv2iggYFW+LdBsTbngv/yUroGH0jleEX7MOgtxMbQ7PzKoMuajKyM8pYIiB194HnQzsQu0Gp/LvpulVHylsgK/TgG2p/YHrqXf6T3bJUBhfxFWUDPg95CbAytm/+ycasM9WOxWu0PnTniLWE2iLRi/4Z3bJXRvY76s0+Arl93I3aMNOHPBce2PdSkL7Kpnwe9l9gGutCPoFgkUtytXAGbex0vKCznSOs00o+ToLcQG0N/QErCrG6jrTIynVUDwo896vCzssPrNnAYtD+xPfR9fwmKeu/CVhm5OAn1STPkvhxBW1KXjeP60Y/DoJ2JXaAL/RCPy+PXc80L9d7OV294dVPbC/fb4EDoLcTG0IV+TCDrrIxMHIFg512BWj9OgvYk9oK+9SMoZG55q/JMiGS40/sLjacu28T3MVfd0Aha+u3QJXr+0Q//MBtHutaPQOzh3H0RBoZS5OJ/MjqJ9x2vQb7qgSuvX0StH0+FLptzrvTDh9gl0oV+iAbi2lAsqNmbK3yBAyLNdbRzW8Y6Btqf2B76A2IURE2zZY16KGfZlwqofJSL4feABka+xCNX+ekx0LuILaFr/Zit7s4ZA7y5Qg2sDr/t4zDodxCvQt/6occctDKGriMPzH85D9qN2BG61g/QwcLSVDSGl78C6LePY6A3EptBf0BKcjWWH/GqyJqoxKnMufEVBLJxAJwJ7U9sDH3fX0CxnIB4orMyuilTyRh6g+0bfDgQ2p/YHrrQD+jV6qb/SdRrMit8TRWwyEabxgFwJrQnsQt0rR+LR3VqFNiGHRBv73ge9EZiM+haPyicuRcVmIxzAMTMl9wfi3sGtBuxF3ShH92C29yJTteU+ohbRrZk3Qe9hdgY+tYPnOqanA+mTN33ZGKE06HQbsQu0LV+MF8+94rU5dK8B8/KyJaI+6D9ie2hC/3Q12QnSnYLn5p9P/6d0D7EltAh5wz/Hv8exON/LUjHOuz5CksAAAAASUVORK5CYII=')",hv:"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALUAAABlCAIAAACEDzXRAAAK+ElEQVR42u2d7ZLkrA2FD55N5d2q3P+tZv8A+fFu92JAXyD1mCRdXS6Pd7bnsQqrhY4EqQL4C/gL+Ekff0q/QBz/DfyC7aj5tV8YoX82V/bOp0D757844tHMpuvgoEe76q//+pExe9X7scyO3TtPjtPL3bv74Dr8cd2r/X/tu9zPp/T5ds7gtp8xfnyH0BmTJQZhh6mlR5NLNi4zm5Th709M3oyPytq5DoOjStRZRi6EUabWrtxAPgY6gBgIg/5RMBvpDH6RnsaGk/cZhX4Ix+ewcp7jMGhvYiAMevh+qQP+lL1I7q95FMsMv8689Qg+emvWVXtDlyjoHeLcEwNhlr77D9DIhcAfzNteoZALwVtodnUI4gqdY6HXiEd7IszSPzIzgKs6UhoN/noUM7gHkr8JdrSfBx1GDIRBE/6DH+TqG1qm236dB70zbhAGPZvfUuELRVrJsZ3ZSSJ1E1ix/HnQfsRAGPQwf9FETWKQd38UNQHfRrR3HrQ3MRAGPeQ/9LOuyqaa7lOBLPGuzhYXoMs6dHGADjAzEGbp2fyWYhftPORuihQyMeBSZmwZuq5DVzdoVzMDYZZ+fb/U2ZHP7VE2b1J5Y1aP+QAmq0ek28+DdiEeJYvZNR9o2n9AQc3PyjP3j0UBDrP/OAZ6h3i8Ad2EdgW6iU+rTiFQagOvR3FNEpi6PCn+OAM6gBgIg777DyZ2KrrYOs8fxawLqYuz/vJQaG9iIAx6yI9Vi1Q+Hd65l7oy++saqbxqUwnHQLsSA2HQRP0HFDk8USHIshggpvo8kpCPhvYgBsKgfxS9MGDXCbxkgA395UHQYcRAGDTtP7BKbZS6vAWN86C3iZX63Ao0HX8wcy/G66n1/SoVJmBRygAtZVTVFFcZ6hU2Q70XNPFmzoK+nx0tTcxfNLm9QiSZFPVBVRIGYNNfxG9zZpRYoKtOzVBXnq6Z2Rh/bFnaor98Nr/upL88DjqAeDO/zuovhREG6lJuj01V61N6dVF/OQPalVhZn7wC/fIfVToWs45BtQqIHybisGrGo6FjiKn+Bgdou/+w+D69y/sm/5Fl6Pws/zGlQxg0EX+IuZvxJE9OqH+pdMPRdEKg1l+gG9FsQUVRNEdp6mx0+osHMRAGzfa/8NqAn9TFSAJ2/eUAaG9ivT5nhib6X/iSSGVuL2tTepraSEv+4wDoHeIs6PvZEZqtX7dm9XKfx5tdMyT2XPOnz4XeSZ4O+txaCpWvX68B2oCuFe3j+ssedNmCrgHQUn5s19Ib+q1CWxSbFD+u3+5BV39o5WjgJVyEWZqt/wDbkye6vy+bvyusmqGWMs6AdiUGwqDZ+rGqm+KO1F/CVFEzud2Yvzwd2ptY7H9Zh1bXnxZ2Vl5n1F/azMcoDDjVnz4ROoAYCIPerl+v9NjOqlUpvqN+/fuhXYmV63/s1K/rGzOqQjj6uj2KeSO/7tT/8hRoF+KGtfMf/LpYK9D2/jlGfu68Xp4n1wv9SWH9c4+D3iG2+I9daCL+qIrEjRhbf6n0ObGla7v/9lnQAcRAGPQwfxG1AbGE7JpMBcTiMVESMPbvPxramxgIg57l103JPCpwurhUQp2x79X8Kutm96D5JBNs0HozV4EYCLM0W7+un6TvSV1PWoonbyXXY6C3+2831w/ybcZoxna2/I8w/eUp0GHEQBi0Zf1C5WqA1+tdBFVR8xe21y98NLQTsajfrkNvrH9adl21UnV2Xf/0KdA7xPk1LHT1H1vQrusnv8FfwzsTqYQnrZ/8DdCO6ydff75fotdP1i8MLmZtLoPUJbYaOa2//hToAGKlPrcCTccfenmg2kK96qm8nA3tRAyEQRP9L2stO2/e11HcdWJtbSydeZ8IHUMMhEET/S/wcX/7/g6qB/I8aFdiIAz6Hn8ou3Y0UZP0VV43lueUusiXWJH++I8C1SqoS9BKMxddOE3EH5mW+DXpsmqc3xbjrOtva6c+qrZOvALmt2K1bxJaSSL39yhGfe5lZihq7fkqQ7LEUJ0f216KJ69m8vzS6h9cPyiSuMt/FLn/ZR1anV9XJnvT7Z1jNp7wHA08dPaE9t3co4VGmKUV+3tsCF7ftLnHqdDLoydOTlTs76EhTeRX+ae89XnQfsRKfW4Feml/jwJcd/xr5vvKSslK2P4eD4L2JgbCoO37e1x3/HFsJ9Wj6KRmnAcdQAyEQbPrw4CmvljefHsU14QBv/rkJ0K7Emvyp6v7e2Rr4f2b+prdQbrdhDLT+5H9PR4BHUMMhEHT/kPP3iE3Y9u6rbp9ZSm92SlcC3SxSF3VwG0ycx6ObP/LlqXp9aVE3/fm7cAbdjFPrXR5VRV/gLXzG3pqbR20fv1TKf6oG2YeB4pifctFS1v29+iMPBq8s7a6zqYE7u/xRGhv4kBoYn0HTUl1Gqg79iSvmqYUizz0l2dBuxJr1qdbhCb6G0TY8WLHDnnVtKprz9heauW50E7EgdBL+3tMYWdv93r7jfWlvh86jBgIg5b6o9bwFaM6skXqPOg94kBoqb8SLO+I/37dv8qzsfEPW/rLGdB+xEAYtKI/e6TueMsdvLmD5f09XPWXDegSAr1JjJ440NKW9R066vcJBvDXiWlL+LD9PTagsz+0C/GAHmVpdn0YKneTBuT2R/SjWtxVsUguz74+/9OhTcRpdgPQQtcdaMX+HhT1FPmOXzaEAWzt7/FQ6GVicMTQzVxWoNX6y9vZdXcAckiLqmJVLMy5tz7dc6FdiQOhJf2Fj50w4N9toNl1Qi8creovz4IOINbkTxehjft7tMgttfQoWmcD8Nzf43HQ3sSB0Pb9PTr3Bxq8GpJ5wft7oOEuwkcVabWEj+zvYSEGwqDt+3uoCt4nUdNCes81FUlxJw7ac6sMN+INS394f4/xVu7X3feb8Njf49ugHYmHRz4KmvYfplF9za+LiwB6P43nQXsQB0LT8Ueazb3QqM6F9tP3R7EqFoksPvt7HAPtSgyEQQ/6S6IDawx3MI1P6+8lB1C5VnRNS4Z6/pIGm8dAF2l5N/X8xWTmOpu/NMRAmKXv+ktqTjpTd1X3bflsC95SX+QGAlS9/dL+HiN0u9vwB6HV+Q+rmTEIRXdiIMzSs++XdEcGbfDW2mnAr6oNocWuHV3+9DBoV2IgDLrZ3yMRRxD4vDDQPIoLvGr95TDoGGIgDJr2H9NUMO7UU/y/kdPvR5HZXUKT9TX6j2Ogd4jfbuP68yFKVvv+6vP4Aw1+uiNjoL6avOrVPBQXuWlzYS/CVv9xGPQ+cTtQUu8/nKFn/S+JjrDe7Bhg093azaNYFdn0vfqxw6C9iYEwaKL+tJ0A1iETk5oKfAy1ke9RnQSPptmvxlJ/ehi0HzEQBq2oX+ez/lRtdf1t6r0k+rIEcxj0HjEQBv3qfzHdStK+TYx2/eUw6DBiq/H2+18qi8zfBCamhg4Tu/1zwdCmO/EjnkJjPj6cLU3UJ6cBvxJG7tjRN2nwKWS+TFcRnJ4KbSVOAnEU9FA/Np17TUdyndXb3++AArSeqPWXM6C9iYEw6Hv9aWKRp+LBPUzqqEGk+Hd+pPNMZ0DHEEdB0+snd7lfPq9NpH/55K3+aAnpToJ2InbBnUOnf3Vad5r9uHyRSB5vXhwE+pOgY4ijoGf9L2nwgxoXOWtVrAT78okiBDkD2pXYkbUHSf+kipO8zof43OX8aOgY4hDo9A8ef+9KVcz41678F0AnzytR0OnSxFHJ6Xd0oZvTavfnQfsRf9bS/3/9z77+A2DdeCv3ceV0AAAAAElFTkSuQmCC')"};l.padM.style.backgroundImage=e.cross,l.padM.style.backgroundRepeat="no-repeat",l.sldM.style.backgroundImage=e.arrow,l.sldM.style.backgroundRepeat="no-repeat",l.pad.style.backgroundImage=e[r],l.pad.style.backgroundRepeat="no-repeat",l.pad.style.backgroundPosition="0 0",redrawPad(),redrawSld(),mxJSColor.picker.owner=THIS,document.getElementsByTagName("body")[0].appendChild(l.boxB)}function getPickerDims(t){return[2*t.pickerInset+2*t.pickerFace+mxJSColor.images.pad[0]+(t.slider?2*t.pickerInset+2*mxJSColor.images.arrow[0]+mxJSColor.images.sld[0]:0),t.pickerClosable?4*t.pickerInset+3*t.pickerFace+mxJSColor.images.pad[1]+t.pickerButtonHeight:2*t.pickerInset+2*t.pickerFace+mxJSColor.images.pad[1]]}function redrawPad(){switch(modeID){case 0:var t=1;break;case 1:t=2}var e=Math.round(THIS.hsv[0]/6*(mxJSColor.images.pad[0]-1)),n=Math.round((1-THIS.hsv[t])*(mxJSColor.images.pad[1]-1));mxJSColor.picker.padM.style.backgroundPosition=THIS.pickerFace+THIS.pickerInset+e-Math.floor(mxJSColor.images.cross[0]/2)+"px "+(THIS.pickerFace+THIS.pickerInset+n-Math.floor(mxJSColor.images.cross[1]/2))+"px";var i=mxJSColor.picker.sld.childNodes;switch(modeID){case 0:for(var l=HSV_RGB(THIS.hsv[0],THIS.hsv[1],1),s=0;s<i.length;s+=1)i[s].style.backgroundColor="rgb("+l[0]*(1-s/i.length)*100+"%,"+l[1]*(1-s/i.length)*100+"%,"+l[2]*(1-s/i.length)*100+"%)";break;case 1:var o,r=[THIS.hsv[2],0,0],a=(s=Math.floor(THIS.hsv[0]))%2?THIS.hsv[0]-s:1-(THIS.hsv[0]-s);switch(s){case 6:case 0:l=[0,1,2];break;case 1:l=[1,0,2];break;case 2:l=[2,0,1];break;case 3:l=[2,1,0];break;case 4:l=[1,2,0];break;case 5:l=[0,2,1]}for(s=0;s<i.length;s+=1)o=1-1/(i.length-1)*s,r[1]=r[0]*(1-o*a),r[2]=r[0]*(1-o),i[s].style.backgroundColor="rgb("+100*r[l[0]]+"%,"+100*r[l[1]]+"%,"+100*r[l[2]]+"%)"}}function redrawSld(){switch(modeID){case 0:var t=2;break;case 1:t=1}var e=Math.round((1-THIS.hsv[t])*(mxJSColor.images.sld[1]-1));mxJSColor.picker.sldM.style.backgroundPosition="0 "+(THIS.pickerFace+THIS.pickerInset+e-Math.floor(mxJSColor.images.arrow[1]/2))+"px"}function isPickerOwner(){return mxJSColor.picker&&mxJSColor.picker.owner===THIS}function blurTarget(){valueElement===target&&THIS.importColor(),THIS.pickerOnfocus&&THIS.hidePicker()}function blurValue(){valueElement!==target&&THIS.importColor()}function setPad(t){var t=mxJSColor.getRelMousePos(t),e=t.x-THIS.pickerFace-THIS.pickerInset,n=t.y-THIS.pickerFace-THIS.pickerInset;switch(modeID){case 0:THIS.fromHSV(e*(6/(mxJSColor.images.pad[0]-1)),1-n/(mxJSColor.images.pad[1]-1),null,leaveSld);break;case 1:THIS.fromHSV(e*(6/(mxJSColor.images.pad[0]-1)),null,1-n/(mxJSColor.images.pad[1]-1),leaveSld)}}function setSld(t){var e=mxJSColor.getRelMousePos(t).y-THIS.pickerFace-THIS.pickerInset;switch(modeID){case 0:THIS.fromHSV(null,null,1-e/(mxJSColor.images.sld[1]-1),leavePad);break;case 1:THIS.fromHSV(null,1-e/(mxJSColor.images.sld[1]-1),null,leavePad)}}function dispatchImmediateChange(){THIS.onImmediateChange&&("string"==typeof THIS.onImmediateChange?eval(THIS.onImmediateChange):THIS.onImmediateChange(THIS))}this.hidePicker=function(){isPickerOwner()&&removePicker()},this.showPicker=function(){if(!isPickerOwner()){var t,e,n,i=mxJSColor.getElementPos(target),l=mxJSColor.getElementSize(target),s=mxJSColor.getViewPos(),o=mxJSColor.getViewSize(),r=getPickerDims(this);switch(this.pickerPosition.toLowerCase()){case"left":e=0,n=-(t=1);break;case"right":e=0,n=t=1;break;case"top":t=0,n=-(e=1);break;default:t=0,n=e=1}var a=(l[e]+r[e])/2;this.pickerSmartPosition?(-s[t]+i[t]+r[t]>o[t]&&-s[t]+i[t]+l[t]/2>o[t]/2&&0<=i[t]+l[t]-r[t]?(i[t],l[t],r[t]):i[t],-s[e]+i[e]+l[e]+r[e]-a+a*n>o[e]?-s[e]+i[e]+l[e]/2>o[e]/2&&0<=i[e]+l[e]-a-a*n?(i[e],l[e]):(i[e],l[e]):0<=i[e]+l[e]-a+a*n?(i[e],l[e]):(i[e],l[e])):(i[t],i[e],l[e]),drawPicker(0,0)}},this.importColor=function(){valueElement?this.adjust?!this.required&&/^\s*$/.test(valueElement.value)?(valueElement.value="",styleElement.style.backgroundImage=styleElement.jscStyle.backgroundImage,styleElement.style.backgroundColor=styleElement.jscStyle.backgroundColor,styleElement.style.color=styleElement.jscStyle.color,this.exportColor(leaveValue|leaveStyle)):this.fromString(valueElement.value)||this.exportColor():this.fromString(valueElement.value,leaveValue)||(styleElement.style.backgroundImage=styleElement.jscStyle.backgroundImage,styleElement.style.backgroundColor=styleElement.jscStyle.backgroundColor,styleElement.style.color=styleElement.jscStyle.color,this.exportColor(leaveValue|leaveStyle)):this.exportColor()},this.exportColor=function(t){var e;t&leaveValue||!valueElement||(e=this.toString(),this.caps&&(e=e.toUpperCase()),this.hash&&(e="#"+e),valueElement.value=e),t&leaveStyle||!styleElement||(styleElement.style.backgroundImage="none",styleElement.style.backgroundColor="#"+this.toString(),styleElement.style.color=.213*this.rgb[0]+.715*this.rgb[1]+.072*this.rgb[2]<.5?"#FFF":"#000"),t&leavePad||!isPickerOwner()||redrawPad(),t&leaveSld||!isPickerOwner()||redrawSld()},this.fromHSV=function(t,e,n,i){t<0&&(t=0)||6<t&&(t=6),e<0&&(e=0)||1<e&&(e=1),n<0&&(n=0)||1<n&&(n=1),this.rgb=HSV_RGB(null===t?this.hsv[0]:this.hsv[0]=t,null===e?this.hsv[1]:this.hsv[1]=e,null===n?this.hsv[2]:this.hsv[2]=n),this.exportColor(i)},this.fromRGB=function(t,e,n,i){t<0&&(t=0)||1<t&&(t=1),e<0&&(e=0)||1<e&&(e=1),n<0&&(n=0)||1<n&&(n=1);n=RGB_HSV(null===t?this.rgb[0]:this.rgb[0]=t,null===e?this.rgb[1]:this.rgb[1]=e,null===n?this.rgb[2]:this.rgb[2]=n);null!==n[0]&&(this.hsv[0]=n[0]),0!==n[2]&&(this.hsv[1]=n[1]),this.hsv[2]=n[2],this.exportColor(i)},this.fromString=function(t,e){t=t.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i);return!!t&&(6===t[1].length?this.fromRGB(parseInt(t[1].substr(0,2),16)/255,parseInt(t[1].substr(2,2),16)/255,parseInt(t[1].substr(4,2),16)/255,e):this.fromRGB(parseInt(t[1].charAt(0)+t[1].charAt(0),16)/255,parseInt(t[1].charAt(1)+t[1].charAt(1),16)/255,parseInt(t[1].charAt(2)+t[1].charAt(2),16)/255,e),!0)},this.toString=function(){return(256|Math.round(255*this.rgb[0])).toString(16).substr(1)+(256|Math.round(255*this.rgb[1])).toString(16).substr(1)+(256|Math.round(255*this.rgb[2])).toString(16).substr(1)};var THIS=this,modeID="hvs"===this.pickerMode.toLowerCase()?1:0,abortBlur=!1,valueElement=mxJSColor.fetchElement(this.valueElement),styleElement=mxJSColor.fetchElement(this.styleElement),holdPad=!1,holdSld=!1,leaveValue=1,leaveStyle=2,leavePad=4,leaveSld=8,updateField;switch(valueElement&&(updateField=function(){THIS.fromString(valueElement.value,leaveValue),dispatchImmediateChange()},mxJSColor.addEvent(valueElement,"keyup",updateField),mxJSColor.addEvent(valueElement,"input",updateField),mxJSColor.addEvent(valueElement,"blur",blurValue),valueElement.setAttribute("autocomplete","off")),styleElement&&(styleElement.jscStyle={backgroundImage:styleElement.style.backgroundImage,backgroundColor:styleElement.style.backgroundColor,color:styleElement.style.color}),modeID){case 0:mxJSColor.requireImage("hs.png");break;case 1:mxJSColor.requireImage("hv.png")}mxJSColor.requireImage("cross.gif"),mxJSColor.requireImage("arrow.gif"),this.importColor()}};mxJSColor.install(),window.mxBasePath=window.mxBasePath||"/",window.mxLanguage=window.mxLanguage||urlParams.lang,window.mxLanguages=window.mxLanguages||["de","se"],function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pako=t()}(function(){return function i(l,s,o){function r(e,t){if(!s[e]){if(!l[e]){var n="function"==typeof require&&require;if(!t&&n)return n(e,!0);if(a)return a(e,!0);n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}n=s[e]={exports:{}};l[e][0].call(n.exports,function(t){return r(l[e][1][t]||t)},n,n.exports,i,l,s,o)}return s[e].exports}for(var a="function"==typeof require&&require,t=0;t<o.length;t++)r(o[t]);return r}({1:[function(t,e,n){"use strict";var o=t("./zlib/deflate"),r=t("./utils/common"),a=t("./utils/strings"),i=t("./zlib/messages"),l=t("./zlib/zstream"),h=Object.prototype.toString,d=0,s=-1,u=0,p=8;function m(t){if(!(this instanceof m))return new m(t);this.options=r.assign({level:s,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:u,to:""},t||{});var e=this.options;e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;t=o.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(t!==d)throw new Error(i[t]);if(e.header&&o.deflateSetHeader(this.strm,e.header),e.dictionary){e="string"==typeof e.dictionary?a.string2buf(e.dictionary):"[object ArrayBuffer]"===h.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary;if((t=o.deflateSetDictionary(this.strm,e))!==d)throw new Error(i[t]);this._dict_set=!0}}function c(t,e){e=new m(e);if(e.push(t,!0),e.err)throw e.msg||i[e.err];return e.result}m.prototype.push=function(t,e){var n,i,l=this.strm,s=this.options.chunkSize;if(this.ended)return!1;i=e===~~e?e:!0===e?4:0,"string"==typeof t?l.input=a.string2buf(t):"[object ArrayBuffer]"===h.call(t)?l.input=new Uint8Array(t):l.input=t,l.next_in=0,l.avail_in=l.input.length;do{if(0===l.avail_out&&(l.output=new r.Buf8(s),l.next_out=0,l.avail_out=s),1!==(n=o.deflate(l,i))&&n!==d)return this.onEnd(n),!(this.ended=!0)}while(0!==l.avail_out&&(0!==l.avail_in||4!==i&&2!==i)||("string"===this.options.to?this.onData(a.buf2binstring(r.shrinkBuf(l.output,l.next_out))):this.onData(r.shrinkBuf(l.output,l.next_out))),(0<l.avail_in||0===l.avail_out)&&1!==n);return 4===i?(n=o.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===d):2!==i||(this.onEnd(d),!(l.avail_out=0))},m.prototype.onData=function(t){this.chunks.push(t)},m.prototype.onEnd=function(t){t===d&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Deflate=m,n.deflate=c,n.deflateRaw=function(t,e){return(e=e||{}).raw=!0,c(t,e)},n.gzip=function(t,e){return(e=e||{}).gzip=!0,c(t,e)}},{"./utils/common":3,"./utils/strings":4,"./zlib/deflate":8,"./zlib/messages":13,"./zlib/zstream":15}],2:[function(t,e,n){"use strict";var u=t("./zlib/inflate"),p=t("./utils/common"),m=t("./utils/strings"),c=t("./zlib/constants"),i=t("./zlib/messages"),l=t("./zlib/zstream"),s=t("./zlib/gzheader"),g=Object.prototype.toString;function o(t){if(!(this instanceof o))return new o(t);this.options=p.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&0<=e.windowBits&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(0<=e.windowBits&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),15<e.windowBits&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;t=u.inflateInit2(this.strm,e.windowBits);if(t!==c.Z_OK)throw new Error(i[t]);if(this.header=new s,u.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=m.string2buf(e.dictionary):"[object ArrayBuffer]"===g.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=u.inflateSetDictionary(this.strm,e.dictionary))!==c.Z_OK))throw new Error(i[t])}function r(t,e){e=new o(e);if(e.push(t,!0),e.err)throw e.msg||i[e.err];return e.result}o.prototype.push=function(t,e){var n,i,l,s,o,r=this.strm,a=this.options.chunkSize,h=this.options.dictionary,d=!1;if(this.ended)return!1;i=e===~~e?e:!0===e?c.Z_FINISH:c.Z_NO_FLUSH,"string"==typeof t?r.input=m.binstring2buf(t):"[object ArrayBuffer]"===g.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(0===r.avail_out&&(r.output=new p.Buf8(a),r.next_out=0,r.avail_out=a),(n=u.inflate(r,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&h&&(n=u.inflateSetDictionary(this.strm,h)),n===c.Z_BUF_ERROR&&!0===d&&(n=c.Z_OK,d=!1),n!==c.Z_STREAM_END&&n!==c.Z_OK)return this.onEnd(n),!(this.ended=!0)}while(r.next_out&&(0!==r.avail_out&&n!==c.Z_STREAM_END&&(0!==r.avail_in||i!==c.Z_FINISH&&i!==c.Z_SYNC_FLUSH)||("string"===this.options.to?(l=m.utf8border(r.output,r.next_out),s=r.next_out-l,o=m.buf2string(r.output,l),r.next_out=s,r.avail_out=a-s,s&&p.arraySet(r.output,r.output,l,s,0),this.onData(o)):this.onData(p.shrinkBuf(r.output,r.next_out)))),0===r.avail_in&&0===r.avail_out&&(d=!0),(0<r.avail_in||0===r.avail_out)&&n!==c.Z_STREAM_END);return n===c.Z_STREAM_END&&(i=c.Z_FINISH),i===c.Z_FINISH?(n=u.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===c.Z_OK):i!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),!(r.avail_out=0))},o.prototype.onData=function(t){this.chunks.push(t)},o.prototype.onEnd=function(t){t===c.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=p.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Inflate=o,n.inflate=r,n.inflateRaw=function(t,e){return(e=e||{}).raw=!0,r(t,e)},n.ungzip=r},{"./utils/common":3,"./utils/strings":4,"./zlib/constants":6,"./zlib/gzheader":9,"./zlib/inflate":11,"./zlib/messages":13,"./zlib/zstream":15}],3:[function(t,e,n){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(t){for(var e,n,i=Array.prototype.slice.call(arguments,1);i.length;){var l=i.shift();if(l){if("object"!=typeof l)throw new TypeError(l+"must be non-object");for(var s in l)e=l,n=s,Object.prototype.hasOwnProperty.call(e,n)&&(t[s]=l[s])}}return t},n.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var l={arraySet:function(t,e,n,i,l){if(e.subarray&&t.subarray)t.set(e.subarray(n,n+i),l);else for(var s=0;s<i;s++)t[l+s]=e[n+s]},flattenChunks:function(t){for(var e,n,i,l,s=e=0,o=t.length;s<o;s++)e+=t[s].length;for(l=new Uint8Array(e),s=n=0,o=t.length;s<o;s++)i=t[s],l.set(i,n),n+=i.length;return l}},s={arraySet:function(t,e,n,i,l){for(var s=0;s<i;s++)t[l+s]=e[n+s]},flattenChunks:function(t){return[].concat.apply([],t)}};n.setTyped=function(t){t?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,l)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,s))},n.setTyped(i)},{}],4:[function(t,e,n){"use strict";var a=t("./common"),l=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(t){l=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){s=!1}for(var h=new a.Buf8(256),i=0;i<256;i++)h[i]=252<=i?6:248<=i?5:240<=i?4:224<=i?3:192<=i?2:1;function d(t,e){if(e<65534&&(t.subarray&&s||!t.subarray&&l))return String.fromCharCode.apply(null,a.shrinkBuf(t,e));for(var n="",i=0;i<e;i++)n+=String.fromCharCode(t[i]);return n}h[254]=h[254]=1,n.string2buf=function(t){for(var e,n,i,l,s=t.length,o=0,r=0;r<s;r++)55296==(64512&(n=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(i=t.charCodeAt(r+1)))&&(n=65536+(n-55296<<10)+(i-56320),r++),o+=n<128?1:n<2048?2:n<65536?3:4;for(e=new a.Buf8(o),r=l=0;l<o;r++)55296==(64512&(n=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(i=t.charCodeAt(r+1)))&&(n=65536+(n-55296<<10)+(i-56320),r++),n<128?e[l++]=n:(n<2048?e[l++]=192|n>>>6:(n<65536?e[l++]=224|n>>>12:(e[l++]=240|n>>>18,e[l++]=128|n>>>12&63),e[l++]=128|n>>>6&63),e[l++]=128|63&n);return e},n.buf2binstring=function(t){return d(t,t.length)},n.binstring2buf=function(t){for(var e=new a.Buf8(t.length),n=0,i=e.length;n<i;n++)e[n]=t.charCodeAt(n);return e},n.buf2string=function(t,e){for(var n,i,l,s=e||t.length,o=new Array(2*s),r=n=0;r<s;)if((i=t[r++])<128)o[n++]=i;else if(4<(l=h[i]))o[n++]=65533,r+=l-1;else{for(i&=2===l?31:3===l?15:7;1<l&&r<s;)i=i<<6|63&t[r++],l--;1<l?o[n++]=65533:i<65536?o[n++]=i:(i-=65536,o[n++]=55296|i>>10&1023,o[n++]=56320|1023&i)}return d(o,n)},n.utf8border=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;0<=n&&128==(192&t[n]);)n--;return!(n<0)&&0!==n&&n+h[t[n]]>e?n:e}},{"./common":3}],5:[function(t,e,n){"use strict";e.exports=function(t,e,n,i){for(var l=65535&t|0,s=t>>>16&65535|0,o=0;0!==n;){for(n-=o=2e3<n?2e3:n;s=s+(l=l+e[i++]|0)|0,--o;);l%=65521,s%=65521}return l|s<<16|0}},{}],6:[function(t,e,n){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],7:[function(t,e,n){"use strict";var r=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();e.exports=function(t,e,n,i){var l=r,s=i+n;t^=-1;for(var o=i;o<s;o++)t=t>>>8^l[255&(t^e[o])];return-1^t}},{}],8:[function(t,e,n){"use strict";var r,u=t("../utils/common"),a=t("./trees"),p=t("./adler32"),m=t("./crc32"),i=t("./messages"),h=0,d=0,c=-2,l=2,g=8,s=286,o=30,x=19,y=2*s+1,f=15,C=3,v=258,E=v+C+1,S=42,w=113;function b(t,e){return t.msg=i[e],e}function T(t){return(t<<1)-(4<t?9:0)}function A(t){for(var e=t.length;0<=--e;)t[e]=0}function L(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(u.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function I(t,e){a._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,L(t.strm)}function M(t,e){t.pending_buf[t.pending++]=e}function R(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function P(t,e){var n,i,l=t.max_chain_length,s=t.strstart,o=t.prev_length,r=t.nice_match,a=t.strstart>t.w_size-E?t.strstart-(t.w_size-E):0,h=t.window,d=t.w_mask,u=t.prev,p=t.strstart+v,m=h[s+o-1],c=h[s+o];t.prev_length>=t.good_match&&(l>>=2),r>t.lookahead&&(r=t.lookahead);do{if(h[(n=e)+o]===c&&h[n+o-1]===m&&h[n]===h[s]&&h[++n]===h[s+1]){for(s+=2,n++;h[++s]===h[++n]&&h[++s]===h[++n]&&h[++s]===h[++n]&&h[++s]===h[++n]&&h[++s]===h[++n]&&h[++s]===h[++n]&&h[++s]===h[++n]&&h[++s]===h[++n]&&s<p;);if(i=v-(p-s),s=p-v,o<i){if(t.match_start=e,r<=(o=i))break;m=h[s+o-1],c=h[s+o]}}}while((e=u[e&d])>a&&0!=--l);return o<=t.lookahead?o:t.lookahead}function O(t){var e,n,i,l,s,o,r,a,h,d=t.w_size;do{if(l=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-E)){for(u.arraySet(t.window,t.window,d,d,0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=n=t.hash_size;i=t.head[--e],t.head[e]=d<=i?i-d:0,--n;);for(e=n=d;i=t.prev[--e],t.prev[e]=d<=i?i-d:0,--n;);l+=d}if(0===t.strm.avail_in)break;if(o=t.strm,r=t.window,a=t.strstart+t.lookahead,h=void 0,l<(h=o.avail_in)&&(h=l),n=0===h?0:(o.avail_in-=h,u.arraySet(r,o.input,o.next_in,h,a),1===o.state.wrap?o.adler=p(o.adler,r,h,a):2===o.state.wrap&&(o.adler=m(o.adler,r,h,a)),o.next_in+=h,o.total_in+=h,h),t.lookahead+=n,t.lookahead+t.insert>=C)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+C-1])&t.hash_mask,t.prev[s&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=s,s++,t.insert--,!(t.lookahead+t.insert<C)););}while(t.lookahead<E&&0!==t.strm.avail_in)}function U(t,e){for(var n,i;;){if(t.lookahead<E){if(O(t),t.lookahead<E&&e===h)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=C&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-E&&(t.match_length=P(t,n)),t.match_length>=C)if(i=a._tr_tally(t,t.strstart-t.match_start,t.match_length-C),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=C){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,0!=--t.match_length;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(I(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<C-1?t.strstart:C-1,4===e?(I(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(I(t,!1),0===t.strm.avail_out)?1:2}function N(t,e){for(var n,i,l;;){if(t.lookahead<E){if(O(t),t.lookahead<E&&e===h)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=C&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=C-1,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-E&&(t.match_length=P(t,n),t.match_length<=5&&(1===t.strategy||t.match_length===C&&4096<t.strstart-t.match_start)&&(t.match_length=C-1)),t.prev_length>=C&&t.match_length<=t.prev_length){for(l=t.strstart+t.lookahead-C,i=a._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-C),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=l&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!=--t.prev_length;);if(t.match_available=0,t.match_length=C-1,t.strstart++,i&&(I(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((i=a._tr_tally(t,0,t.window[t.strstart-1]))&&I(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=a._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<C-1?t.strstart:C-1,4===e?(I(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(I(t,!1),0===t.strm.avail_out)?1:2}function H(t,e,n,i,l){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=i,this.func=l}function _(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=g,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new u.Buf16(2*y),this.dyn_dtree=new u.Buf16(2*(2*o+1)),this.bl_tree=new u.Buf16(2*(2*x+1)),A(this.dyn_ltree),A(this.dyn_dtree),A(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new u.Buf16(f+1),this.heap=new u.Buf16(2*s+1),A(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new u.Buf16(2*s+1),A(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function D(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=l,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?S:w,t.adler=2===e.wrap?0:1,e.last_flush=h,a._tr_init(e),d):b(t,c)}function G(t){var e=D(t);return e===d&&((t=t.state).window_size=2*t.w_size,A(t.head),t.max_lazy_match=r[t.level].max_lazy,t.good_match=r[t.level].good_length,t.nice_match=r[t.level].nice_length,t.max_chain_length=r[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=C-1,t.match_available=0,t.ins_h=0),e}function k(t,e,n,i,l,s){if(!t)return c;var o=1;if(-1===e&&(e=6),i<0?(o=0,i=-i):15<i&&(o=2,i-=16),l<1||9<l||n!==g||i<8||15<i||e<0||9<e||s<0||4<s)return b(t,c);8===i&&(i=9);var r=new _;return(t.state=r).strm=t,r.wrap=o,r.gzhead=null,r.w_bits=i,r.w_size=1<<r.w_bits,r.w_mask=r.w_size-1,r.hash_bits=l+7,r.hash_size=1<<r.hash_bits,r.hash_mask=r.hash_size-1,r.hash_shift=~~((r.hash_bits+C-1)/C),r.window=new u.Buf8(2*r.w_size),r.head=new u.Buf16(r.hash_size),r.prev=new u.Buf16(r.w_size),r.lit_bufsize=1<<l+6,r.pending_buf_size=4*r.lit_bufsize,r.pending_buf=new u.Buf8(r.pending_buf_size),r.d_buf=+r.lit_bufsize,r.l_buf=3*r.lit_bufsize,r.level=e,r.strategy=s,r.method=n,G(t)}r=[new H(0,0,0,0,function(t,e){var n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(O(t),0===t.lookahead&&e===h)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+n;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,I(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-E&&(I(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(I(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(I(t,!1),t.strm.avail_out),1)}),new H(4,4,8,4,U),new H(4,5,16,8,U),new H(4,6,32,32,U),new H(4,4,16,16,N),new H(8,16,32,32,N),new H(8,16,128,128,N),new H(8,32,128,256,N),new H(32,128,258,1024,N),new H(32,258,258,4096,N)],n.deflateInit=function(t,e){return k(t,e,g,15,8,0)},n.deflateInit2=k,n.deflateReset=G,n.deflateResetKeep=D,n.deflateSetHeader=function(t,e){return!t||!t.state||2!==t.state.wrap?c:(t.state.gzhead=e,d)},n.deflate=function(t,e){var n,i,l,s;if(!t||!t.state||5<e||e<0)return t?b(t,c):c;if(n=t.state,!t.output||!t.input&&0!==t.avail_in||666===n.status&&4!==e)return b(t,0===t.avail_out?-5:c);if(n.strm=t,o=n.last_flush,n.last_flush=e,n.status===S&&(2===n.wrap?(t.adler=0,M(n,31),M(n,139),M(n,8),n.gzhead?(M(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),M(n,255&n.gzhead.time),M(n,n.gzhead.time>>8&255),M(n,n.gzhead.time>>16&255),M(n,n.gzhead.time>>24&255),M(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),M(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(M(n,255&n.gzhead.extra.length),M(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=m(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(M(n,0),M(n,0),M(n,0),M(n,0),M(n,0),M(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),M(n,3),n.status=w)):(s=g+(n.w_bits-8<<4)<<8,s|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(s|=32),s+=31-s%31,n.status=w,R(n,s),0!==n.strstart&&(R(n,t.adler>>>16),R(n,65535&t.adler)),t.adler=1)),69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(t.adler=m(t.adler,n.pending_buf,n.pending-i,i)),L(t),i=n.pending,n.pending!==n.pending_buf_size));)M(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(t.adler=m(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(t.adler=m(t.adler,n.pending_buf,n.pending-i,i)),L(t),i=n.pending,n.pending===n.pending_buf_size)){l=1;break}}while(M(n,l=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0),0!==l);n.gzhead.hcrc&&n.pending>i&&(t.adler=m(t.adler,n.pending_buf,n.pending-i,i)),0===l&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(t.adler=m(t.adler,n.pending_buf,n.pending-i,i)),L(t),i=n.pending,n.pending===n.pending_buf_size)){l=1;break}}while(M(n,l=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0),0!==l);n.gzhead.hcrc&&n.pending>i&&(t.adler=m(t.adler,n.pending_buf,n.pending-i,i)),0===l&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&L(t),n.pending+2<=n.pending_buf_size&&(M(n,255&t.adler),M(n,t.adler>>8&255),t.adler=0,n.status=w)):n.status=w),0!==n.pending){if(L(t),0===t.avail_out)return n.last_flush=-1,d}else if(0===t.avail_in&&T(e)<=T(o)&&4!==e)return b(t,-5);if(666===n.status&&0!==t.avail_in)return b(t,-5);if(0!==t.avail_in||0!==n.lookahead||e!==h&&666!==n.status){var o=2===n.strategy?function(t,e){for(var n;;){if(0===t.lookahead&&(O(t),0===t.lookahead)){if(e===h)return 1;break}if(t.match_length=0,n=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(I(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(I(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(I(t,!1),0===t.strm.avail_out)?1:2}(n,e):3===n.strategy?function(t,e){for(var n,i,l,s,o=t.window;;){if(t.lookahead<=v){if(O(t),t.lookahead<=v&&e===h)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=C&&0<t.strstart&&(i=o[l=t.strstart-1])===o[++l]&&i===o[++l]&&i===o[++l]){for(s=t.strstart+v;i===o[++l]&&i===o[++l]&&i===o[++l]&&i===o[++l]&&i===o[++l]&&i===o[++l]&&i===o[++l]&&i===o[++l]&&l<s;);t.match_length=v-(s-l),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=C?(n=a._tr_tally(t,1,t.match_length-C),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(I(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(I(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(I(t,!1),0===t.strm.avail_out)?1:2}(n,e):r[n.level].func(n,e);if(3!==o&&4!==o||(n.status=666),1===o||3===o)return 0===t.avail_out&&(n.last_flush=-1),d;if(2===o&&(1===e?a._tr_align(n):5!==e&&(a._tr_stored_block(n,0,0,!1),3===e&&(A(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),L(t),0===t.avail_out))return n.last_flush=-1,d}return 4!==e?d:n.wrap<=0?1:(2===n.wrap?(M(n,255&t.adler),M(n,t.adler>>8&255),M(n,t.adler>>16&255),M(n,t.adler>>24&255),M(n,255&t.total_in),M(n,t.total_in>>8&255),M(n,t.total_in>>16&255),M(n,t.total_in>>24&255)):(R(n,t.adler>>>16),R(n,65535&t.adler)),L(t),0<n.wrap&&(n.wrap=-n.wrap),0!==n.pending?d:1)},n.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==S&&69!==e&&73!==e&&91!==e&&103!==e&&e!==w&&666!==e?b(t,c):(t.state=null,e===w?b(t,-3):d):c},n.deflateSetDictionary=function(t,e){var n,i,l,s,o,r,a,h=e.length;if(!t||!t.state)return c;if(2===(s=(n=t.state).wrap)||1===s&&n.status!==S||n.lookahead)return c;for(1===s&&(t.adler=p(t.adler,e,h,0)),n.wrap=0,h>=n.w_size&&(0===s&&(A(n.head),n.strstart=0,n.block_start=0,n.insert=0),a=new u.Buf8(n.w_size),u.arraySet(a,e,h-n.w_size,n.w_size,0),e=a,h=n.w_size),o=t.avail_in,r=t.next_in,a=t.input,t.avail_in=h,t.next_in=0,t.input=e,O(n);n.lookahead>=C;){for(i=n.strstart,l=n.lookahead-(C-1);n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+C-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++,--l;);n.strstart=i,n.lookahead=C-1,O(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=C-1,n.match_available=0,t.next_in=r,t.input=a,t.avail_in=o,n.wrap=s,d},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":3,"./adler32":5,"./crc32":7,"./messages":13,"./trees":14}],9:[function(t,e,n){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],10:[function(t,e,n){"use strict";e.exports=function(t,e){var n,i,l,s,o,r,a=t.state,h=t.next_in,d=t.input,u=h+(t.avail_in-5),p=t.next_out,m=t.output,c=p-(e-t.avail_out),g=p+(t.avail_out-257),x=a.dmax,y=a.wsize,f=a.whave,C=a.wnext,v=a.window,E=a.hold,S=a.bits,w=a.lencode,b=a.distcode,T=(1<<a.lenbits)-1,A=(1<<a.distbits)-1;t:do{S<15&&(E+=d[h++]<<S,S+=8,E+=d[h++]<<S,S+=8),n=w[E&T];e:for(;;){if(E>>>=i=n>>>24,S-=i,0==(i=n>>>16&255))m[p++]=65535&n;else{if(!(16&i)){if(0==(64&i)){n=w[(65535&n)+(E&(1<<i)-1)];continue e}if(32&i){a.mode=12;break t}t.msg="invalid literal/length code",a.mode=30;break t}l=65535&n,(i&=15)&&(S<i&&(E+=d[h++]<<S,S+=8),l+=E&(1<<i)-1,E>>>=i,S-=i),S<15&&(E+=d[h++]<<S,S+=8,E+=d[h++]<<S,S+=8),n=b[E&A];n:for(;;){if(E>>>=i=n>>>24,S-=i,!(16&(i=n>>>16&255))){if(0==(64&i)){n=b[(65535&n)+(E&(1<<i)-1)];continue n}t.msg="invalid distance code",a.mode=30;break t}if(s=65535&n,S<(i&=15)&&(E+=d[h++]<<S,(S+=8)<i&&(E+=d[h++]<<S,S+=8)),x<(s+=E&(1<<i)-1)){t.msg="invalid distance too far back",a.mode=30;break t}if(E>>>=i,S-=i,(i=p-c)<s){if(f<(i=s-i)&&a.sane){t.msg="invalid distance too far back",a.mode=30;break t}if(r=v,(o=0)===C){if(o+=y-i,i<l){for(l-=i;m[p++]=v[o++],--i;);o=p-s,r=m}}else if(C<i){if(o+=y+C-i,(i-=C)<l){for(l-=i;m[p++]=v[o++],--i;);if(o=0,C<l){for(l-=i=C;m[p++]=v[o++],--i;);o=p-s,r=m}}}else if(o+=C-i,i<l){for(l-=i;m[p++]=v[o++],--i;);o=p-s,r=m}for(;2<l;)m[p++]=r[o++],m[p++]=r[o++],m[p++]=r[o++],l-=3;l&&(m[p++]=r[o++],1<l&&(m[p++]=r[o++]))}else{for(o=p-s;m[p++]=m[o++],m[p++]=m[o++],m[p++]=m[o++],2<(l-=3););l&&(m[p++]=m[o++],1<l&&(m[p++]=m[o++]))}break}}break}}while(h<u&&p<g);h-=l=S>>3,E&=(1<<(S-=l<<3))-1,t.next_in=h,t.next_out=p,t.avail_in=h<u?u-h+5:5-(h-u),t.avail_out=p<g?g-p+257:257-(p-g),a.hold=E,a.bits=S}},{}],11:[function(t,e,n){"use strict";var M=t("../utils/common"),R=t("./adler32"),P=t("./crc32"),O=t("./inffast"),U=t("./inftrees"),N=1,H=2,_=0,D=-2,G=1,i=852,l=592;function k(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function s(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new M.Buf16(320),this.work=new M.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=G,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new M.Buf32(i),e.distcode=e.distdyn=new M.Buf32(l),e.sane=1,e.back=-1,_):D}function r(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,o(t)):D}function a(t,e){var n,i;return t&&t.state?(i=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15<e)?D:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=n,i.wbits=e,r(t))):D}function h(t,e){var n;return t?(n=new s,(t.state=n).window=null,(e=a(t,e))!==_&&(t.state=null),e):D}var V,F,B=!0;function z(t,e,n,i){var l=t.state;return null===l.window&&(l.wsize=1<<l.wbits,l.wnext=0,l.whave=0,l.window=new M.Buf8(l.wsize)),i>=l.wsize?(M.arraySet(l.window,e,n-l.wsize,l.wsize,0),l.wnext=0,l.whave=l.wsize):(i<(t=l.wsize-l.wnext)&&(t=i),M.arraySet(l.window,e,n-i,t,l.wnext),(i-=t)?(M.arraySet(l.window,e,n-i,i,0),l.wnext=i,l.whave=l.wsize):(l.wnext+=t,l.wnext===l.wsize&&(l.wnext=0),l.whave<l.wsize&&(l.whave+=t))),0}n.inflateReset=r,n.inflateReset2=a,n.inflateResetKeep=o,n.inflateInit=function(t){return h(t,15)},n.inflateInit2=h,n.inflate=function(t,e){var n,i,l,s,o,r,a,h,d,u,p,m,c,g,x,y,f,C,v,E,S,w,b,T,A=0,L=new M.Buf8(4),I=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return D;12===(n=t.state).mode&&(n.mode=13),o=t.next_out,l=t.output,a=t.avail_out,s=t.next_in,i=t.input,r=t.avail_in,h=n.hold,d=n.bits,u=r,p=a,w=_;t:for(;;)switch(n.mode){case G:if(0===n.wrap){n.mode=13;break}for(;d<16;){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}if(2&n.wrap&&35615===h){L[n.check=0]=255&h,L[1]=h>>>8&255,n.check=P(n.check,L,2,0),d=h=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",n.mode=30;break}if(8!=(15&h)){t.msg="unknown compression method",n.mode=30;break}if(d-=4,S=8+(15&(h>>>=4)),0===n.wbits)n.wbits=S;else if(S>n.wbits){t.msg="invalid window size",n.mode=30;break}n.dmax=1<<S,t.adler=n.check=1,n.mode=512&h?10:12,d=h=0;break;case 2:for(;d<16;){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}if(n.flags=h,8!=(255&n.flags)){t.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=h>>8&1),512&n.flags&&(L[0]=255&h,L[1]=h>>>8&255,n.check=P(n.check,L,2,0)),d=h=0,n.mode=3;case 3:for(;d<32;){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}n.head&&(n.head.time=h),512&n.flags&&(L[0]=255&h,L[1]=h>>>8&255,L[2]=h>>>16&255,L[3]=h>>>24&255,n.check=P(n.check,L,4,0)),d=h=0,n.mode=4;case 4:for(;d<16;){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}n.head&&(n.head.xflags=255&h,n.head.os=h>>8),512&n.flags&&(L[0]=255&h,L[1]=h>>>8&255,n.check=P(n.check,L,2,0)),d=h=0,n.mode=5;case 5:if(1024&n.flags){for(;d<16;){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}n.length=h,n.head&&(n.head.extra_len=h),512&n.flags&&(L[0]=255&h,L[1]=h>>>8&255,n.check=P(n.check,L,2,0)),d=h=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(r<(m=n.length)&&(m=r),m&&(n.head&&(S=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),M.arraySet(n.head.extra,i,s,m,S)),512&n.flags&&(n.check=P(n.check,i,m,s)),r-=m,s+=m,n.length-=m),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===r)break t;for(m=0;S=i[s+m++],n.head&&S&&n.length<65536&&(n.head.name+=String.fromCharCode(S)),S&&m<r;);if(512&n.flags&&(n.check=P(n.check,i,m,s)),r-=m,s+=m,S)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===r)break t;for(m=0;S=i[s+m++],n.head&&S&&n.length<65536&&(n.head.comment+=String.fromCharCode(S)),S&&m<r;);if(512&n.flags&&(n.check=P(n.check,i,m,s)),r-=m,s+=m,S)break t}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;d<16;){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}if(h!==(65535&n.check)){t.msg="header crc mismatch",n.mode=30;break}d=h=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=12;break;case 10:for(;d<32;){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}t.adler=n.check=k(h),d=h=0,n.mode=11;case 11:if(0===n.havedict)return t.next_out=o,t.avail_out=a,t.next_in=s,t.avail_in=r,n.hold=h,n.bits=d,2;t.adler=n.check=1,n.mode=12;case 12:if(5===e||6===e)break t;case 13:if(n.last){h>>>=7&d,d-=7&d,n.mode=27;break}for(;d<3;){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}switch(n.last=1&h,--d,3&(h>>>=1)){case 0:n.mode=14;break;case 1:if(function(t){if(B){var e;for(V=new M.Buf32(512),F=new M.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(U(N,t.lens,0,288,V,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;U(H,t.lens,0,32,F,0,t.work,{bits:5}),B=!1}t.lencode=V,t.lenbits=9,t.distcode=F,t.distbits=5}(n),n.mode=20,6!==e)break;h>>>=2,d-=2;break t;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=30}h>>>=2,d-=2;break;case 14:for(h>>>=7&d,d-=7&d;d<32;){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}if((65535&h)!=(h>>>16^65535)){t.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&h,d=h=0,n.mode=15,6===e)break t;case 15:n.mode=16;case 16:if(m=n.length){if(r<m&&(m=r),a<m&&(m=a),0===m)break t;M.arraySet(l,i,s,m,o),r-=m,s+=m,a-=m,o+=m,n.length-=m;break}n.mode=12;break;case 17:for(;d<14;){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}if(n.nlen=257+(31&h),h>>>=5,d-=5,n.ndist=1+(31&h),h>>>=5,d-=5,n.ncode=4+(15&h),h>>>=4,d-=4,286<n.nlen||30<n.ndist){t.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;d<3;){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}n.lens[I[n.have++]]=7&h,h>>>=3,d-=3}for(;n.have<19;)n.lens[I[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,b={bits:n.lenbits},w=U(0,n.lens,0,19,n.lencode,0,n.work,b),n.lenbits=b.bits,w){t.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;y=(A=n.lencode[h&(1<<n.lenbits)-1])>>>16&255,f=65535&A,!((x=A>>>24)<=d);){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}if(f<16)h>>>=x,d-=x,n.lens[n.have++]=f;else{if(16===f){for(T=x+2;d<T;){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}if(h>>>=x,d-=x,0===n.have){t.msg="invalid bit length repeat",n.mode=30;break}S=n.lens[n.have-1],m=3+(3&h),h>>>=2,d-=2}else if(17===f){for(T=x+3;d<T;){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}d-=x,S=0,m=3+(7&(h>>>=x)),h>>>=3,d-=3}else{for(T=x+7;d<T;){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}d-=x,S=0,m=11+(127&(h>>>=x)),h>>>=7,d-=7}if(n.have+m>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=30;break}for(;m--;)n.lens[n.have++]=S}}if(30===n.mode)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,b={bits:n.lenbits},w=U(N,n.lens,0,n.nlen,n.lencode,0,n.work,b),n.lenbits=b.bits,w){t.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,b={bits:n.distbits},w=U(H,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,b),n.distbits=b.bits,w){t.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===e)break t;case 20:n.mode=21;case 21:if(6<=r&&258<=a){t.next_out=o,t.avail_out=a,t.next_in=s,t.avail_in=r,n.hold=h,n.bits=d,O(t,p),o=t.next_out,l=t.output,a=t.avail_out,s=t.next_in,i=t.input,r=t.avail_in,h=n.hold,d=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;y=(A=n.lencode[h&(1<<n.lenbits)-1])>>>16&255,f=65535&A,!((x=A>>>24)<=d);){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}if(y&&0==(240&y)){for(C=x,v=y,E=f;y=(A=n.lencode[E+((h&(1<<C+v)-1)>>C)])>>>16&255,f=65535&A,!(C+(x=A>>>24)<=d);){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}h>>>=C,d-=C,n.back+=C}if(h>>>=x,d-=x,n.back+=x,n.length=f,0===y){n.mode=26;break}if(32&y){n.back=-1,n.mode=12;break}if(64&y){t.msg="invalid literal/length code",n.mode=30;break}n.extra=15&y,n.mode=22;case 22:if(n.extra){for(T=n.extra;d<T;){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}n.length+=h&(1<<n.extra)-1,h>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;y=(A=n.distcode[h&(1<<n.distbits)-1])>>>16&255,f=65535&A,!((x=A>>>24)<=d);){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}if(0==(240&y)){for(C=x,v=y,E=f;y=(A=n.distcode[E+((h&(1<<C+v)-1)>>C)])>>>16&255,f=65535&A,!(C+(x=A>>>24)<=d);){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}h>>>=C,d-=C,n.back+=C}if(h>>>=x,d-=x,n.back+=x,64&y){t.msg="invalid distance code",n.mode=30;break}n.offset=f,n.extra=15&y,n.mode=24;case 24:if(n.extra){for(T=n.extra;d<T;){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}n.offset+=h&(1<<n.extra)-1,h>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===a)break t;if(m=p-a,n.offset>m){if((m=n.offset-m)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=30;break}c=m>n.wnext?(m-=n.wnext,n.wsize-m):n.wnext-m,m>n.length&&(m=n.length),g=n.window}else g=l,c=o-n.offset,m=n.length;for(a<m&&(m=a),a-=m,n.length-=m;l[o++]=g[c++],--m;);0===n.length&&(n.mode=21);break;case 26:if(0===a)break t;l[o++]=n.length,a--,n.mode=21;break;case 27:if(n.wrap){for(;d<32;){if(0===r)break t;r--,h|=i[s++]<<d,d+=8}if(p-=a,t.total_out+=p,n.total+=p,p&&(t.adler=n.check=(n.flags?P:R)(n.check,l,p,o-p)),p=a,(n.flags?h:k(h))!==n.check){t.msg="incorrect data check",n.mode=30;break}d=h=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;d<32;){if(0===r)break t;r--,h+=i[s++]<<d,d+=8}if(h!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=30;break}d=h=0}n.mode=29;case 29:w=1;break t;case 30:w=-3;break t;case 31:return-4;case 32:default:return D}return t.next_out=o,t.avail_out=a,t.next_in=s,t.avail_in=r,n.hold=h,n.bits=d,(n.wsize||p!==t.avail_out&&n.mode<30&&(n.mode<27||4!==e))&&z(t,t.output,t.next_out,p-t.avail_out)?(n.mode=31,-4):(u-=t.avail_in,p-=t.avail_out,t.total_in+=u,t.total_out+=p,n.total+=p,n.wrap&&p&&(t.adler=n.check=(n.flags?P:R)(n.check,l,p,t.next_out-p)),t.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0==u&&0===p||4===e)&&w===_&&(w=-5),w)},n.inflateEnd=function(t){if(!t||!t.state)return D;var e=t.state;return e.window&&(e.window=null),t.state=null,_},n.inflateGetHeader=function(t,e){var n;return!t||!t.state||0==(2&(n=t.state).wrap)?D:((n.head=e).done=!1,_)},n.inflateSetDictionary=function(t,e){var n,i=e.length;return!t||!t.state||0!==(n=t.state).wrap&&11!==n.mode?D:11===n.mode&&R(1,e,i,0)!==n.check?-3:z(t,e,i,i)?(n.mode=31,-4):(n.havedict=1,_)},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":3,"./adler32":5,"./crc32":7,"./inffast":10,"./inftrees":12}],12:[function(t,e,n){"use strict";var N=t("../utils/common"),H=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],_=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],D=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],G=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,n,i,l,s,o,r){for(var a,h,d,u,p,m,c,g,x,y=r.bits,f=0,C=0,v=0,E=0,S=0,w=0,b=0,T=0,A=0,L=0,I=null,M=0,R=new N.Buf16(16),P=new N.Buf16(16),O=null,U=0,f=0;f<=15;f++)R[f]=0;for(C=0;C<i;C++)R[e[n+C]]++;for(S=y,E=15;1<=E&&0===R[E];E--);if(E<S&&(S=E),0===E)return l[s++]=20971520,l[s++]=20971520,r.bits=1,0;for(v=1;v<E&&0===R[v];v++);for(S<v&&(S=v),f=T=1;f<=15;f++)if(T<<=1,(T-=R[f])<0)return-1;if(0<T&&(0===t||1!==E))return-1;for(P[1]=0,f=1;f<15;f++)P[f+1]=P[f]+R[f];for(C=0;C<i;C++)0!==e[n+C]&&(o[P[e[n+C]]++]=C);if(m=0===t?(I=O=o,19):1===t?(I=H,M-=257,O=_,U-=257,256):(I=D,O=G,-1),f=v,p=s,b=C=L=0,d=-1,u=(A=1<<(w=S))-1,1===t&&852<A||2===t&&592<A)return 1;for(;;){for(c=f-b,x=o[C]<m?(g=0,o[C]):o[C]>m?(g=O[U+o[C]],I[M+o[C]]):(g=96,0),a=1<<f-b,v=h=1<<w;l[p+(L>>b)+(h-=a)]=c<<24|g<<16|x|0,0!==h;);for(a=1<<f-1;L&a;)a>>=1;if(0!==a?(L&=a-1,L+=a):L=0,C++,0==--R[f]){if(f===E)break;f=e[n+o[C]]}if(S<f&&(L&u)!==d){for(0===b&&(b=S),p+=v,T=1<<(w=f-b);w+b<E&&!((T-=R[w+b])<=0);)w++,T<<=1;if(A+=1<<w,1===t&&852<A||2===t&&592<A)return 1;l[d=L&u]=S<<24|w<<16|p-s|0}}return 0!==L&&(l[p+L]=f-b<<24|64<<16|0),r.bits=S,0}},{"../utils/common":3}],13:[function(t,e,n){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],14:[function(t,e,n){"use strict";var l=t("../utils/common");function i(t){for(var e=t.length;0<=--e;)t[e]=0}var x=15,s=16,a=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],h=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],r=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],d=new Array(576);i(d);var u=new Array(60);i(u);var p=new Array(512);i(p);var m=new Array(256);i(m);var c=new Array(29);i(c);var g,y,f,C=new Array(30);function v(t,e,n,i,l){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=i,this.max_length=l,this.has_stree=t&&t.length}function E(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function S(t){return t<256?p[t]:p[256+(t>>>7)]}function w(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function b(t,e,n){t.bi_valid>s-n?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>s-t.bi_valid,t.bi_valid+=n-s):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)}function T(t,e,n){b(t,n[2*e],n[2*e+1])}function A(t,e){for(var n=0;n|=1&t,t>>>=1,n<<=1,0<--e;);return n>>>1}function L(t,e,n){for(var i,l=new Array(x+1),s=0,o=1;o<=x;o++)l[o]=s=s+n[o-1]<<1;for(i=0;i<=e;i++){var r=t[2*i+1];0!==r&&(t[2*i]=A(l[r]++,r))}}function I(t){for(var e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function M(t){8<t.bi_valid?w(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function R(t,e,n,i){var l=2*e,s=2*n;return t[l]<t[s]||t[l]===t[s]&&i[e]<=i[n]}function P(t,e,n){for(var i=t.heap[n],l=n<<1;l<=t.heap_len&&(l<t.heap_len&&R(e,t.heap[l+1],t.heap[l],t.depth)&&l++,!R(e,i,t.heap[l],t.depth));)t.heap[n]=t.heap[l],n=l,l<<=1;t.heap[n]=i}function O(t,e,n){var i,l,s,o,r=0;if(0!==t.last_lit)for(;i=t.pending_buf[t.d_buf+2*r]<<8|t.pending_buf[t.d_buf+2*r+1],l=t.pending_buf[t.l_buf+r],r++,0==i?T(t,l,e):(T(t,(s=m[l])+256+1,e),0!==(o=a[s])&&b(t,l-=c[s],o),T(t,s=S(--i),n),0!==(o=h[s])&&b(t,i-=C[s],o)),r<t.last_lit;);T(t,256,e)}function U(t,g){var e,n,i,l=g.dyn_tree,s=g.stat_desc.static_tree,o=g.stat_desc.has_stree,r=g.stat_desc.elems,a=-1;for(t.heap_len=0,t.heap_max=573,e=0;e<r;e++)0!==l[2*e]?(t.heap[++t.heap_len]=a=e,t.depth[e]=0):l[2*e+1]=0;for(;t.heap_len<2;)l[2*(i=t.heap[++t.heap_len]=a<2?++a:0)]=1,t.depth[i]=0,t.opt_len--,o&&(t.static_len-=s[2*i+1]);for(g.max_code=a,e=t.heap_len>>1;1<=e;e--)P(t,l,e);for(i=r;e=t.heap[1],t.heap[1]=t.heap[t.heap_len--],P(t,l,1),n=t.heap[1],t.heap[--t.heap_max]=e,t.heap[--t.heap_max]=n,l[2*i]=l[2*e]+l[2*n],t.depth[i]=(t.depth[e]>=t.depth[n]?t.depth[e]:t.depth[n])+1,l[2*e+1]=l[2*n+1]=i,t.heap[1]=i++,P(t,l,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t){for(var e,n,i,l,s,o=g.dyn_tree,r=g.max_code,a=g.stat_desc.static_tree,h=g.stat_desc.has_stree,d=g.stat_desc.extra_bits,u=g.stat_desc.extra_base,p=g.stat_desc.max_length,m=0,c=0;c<=x;c++)t.bl_count[c]=0;for(o[2*t.heap[t.heap_max]+1]=0,e=t.heap_max+1;e<573;e++)p<(c=o[2*o[2*(n=t.heap[e])+1]+1]+1)&&(c=p,m++),o[2*n+1]=c,r<n||(t.bl_count[c]++,l=0,u<=n&&(l=d[n-u]),s=o[2*n],t.opt_len+=s*(c+l),h&&(t.static_len+=s*(a[2*n+1]+l)));if(0!==m){do{for(c=p-1;0===t.bl_count[c];)c--}while(t.bl_count[c]--,t.bl_count[c+1]+=2,t.bl_count[p]--,0<(m-=2));for(c=p;0!==c;c--)for(n=t.bl_count[c];0!==n;)r<(i=t.heap[--e])||(o[2*i+1]!==c&&(t.opt_len+=(c-o[2*i+1])*o[2*i],o[2*i+1]=c),n--)}}(t),L(l,a,t.bl_count)}function N(t,e,n){var i,l,s=-1,o=e[1],r=0,a=7,h=4;for(0===o&&(a=138,h=3),e[2*(n+1)+1]=65535,i=0;i<=n;i++)l=o,o=e[2*(i+1)+1],++r<a&&l===o||(r<h?t.bl_tree[2*l]+=r:0!==l?(l!==s&&t.bl_tree[2*l]++,t.bl_tree[32]++):r<=10?t.bl_tree[34]++:t.bl_tree[36]++,s=l,h=(r=0)===o?(a=138,3):l===o?(a=6,3):(a=7,4))}function H(t,e,n){var i,l,s=-1,o=e[1],r=0,a=7,h=4;for(0===o&&(a=138,h=3),i=0;i<=n;i++)if(l=o,o=e[2*(i+1)+1],!(++r<a&&l===o)){if(r<h)for(;T(t,l,t.bl_tree),0!=--r;);else 0!==l?(l!==s&&(T(t,l,t.bl_tree),r--),T(t,16,t.bl_tree),b(t,r-3,2)):r<=10?(T(t,17,t.bl_tree),b(t,r-3,3)):(T(t,18,t.bl_tree),b(t,r-11,7));s=l,h=(r=0)===o?(a=138,3):l===o?(a=6,3):(a=7,4)}}i(C);var _=!1;function D(t,e,n,i){b(t,0+(i?1:0),3),e=e,n=n,M(t=t),w(t,n),w(t,~n),l.arraySet(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}n._tr_init=function(t){_||(function(){for(var t,e,n,i,l=new Array(x+1),s=n=0;s<28;s++)for(c[s]=n,t=0;t<1<<a[s];t++)m[n++]=s;for(m[n-1]=s,s=i=0;s<16;s++)for(C[s]=i,t=0;t<1<<h[s];t++)p[i++]=s;for(i>>=7;s<30;s++)for(C[s]=i<<7,t=0;t<1<<h[s]-7;t++)p[256+i++]=s;for(e=0;e<=x;e++)l[e]=0;for(t=0;t<=143;)d[2*t+1]=8,t++,l[8]++;for(;t<=255;)d[2*t+1]=9,t++,l[9]++;for(;t<=279;)d[2*t+1]=7,t++,l[7]++;for(;t<=287;)d[2*t+1]=8,t++,l[8]++;for(L(d,287,l),t=0;t<30;t++)u[2*t+1]=5,u[2*t]=A(t,5);g=new v(d,a,257,286,x),y=new v(u,h,0,30,x),f=new v(new Array(0),o,0,19,7)}(),_=!0),t.l_desc=new E(t.dyn_ltree,g),t.d_desc=new E(t.dyn_dtree,y),t.bl_desc=new E(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,I(t)},n._tr_stored_block=D,n._tr_flush_block=function(t,e,n,i){var l,s,o=0;0<t.level?(2===t.strm.data_type&&(t.strm.data_type=function(t){for(var e=4093624447,n=0;n<=31;n++,e>>>=1)if(1&e&&0!==t.dyn_ltree[2*n])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(n=32;n<256;n++)if(0!==t.dyn_ltree[2*n])return 1;return 0}(t)),U(t,t.l_desc),U(t,t.d_desc),o=function(t){var e;for(N(t,t.dyn_ltree,t.l_desc.max_code),N(t,t.dyn_dtree,t.d_desc.max_code),U(t,t.bl_desc),e=18;3<=e&&0===t.bl_tree[2*r[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),l=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=l&&(l=s)):l=s=n+5,n+4<=l&&-1!==e?D(t,e,n,i):4===t.strategy||s===l?(b(t,2+(i?1:0),3),O(t,d,u)):(b(t,4+(i?1:0),3),function(t,e,n,i){var l;for(b(t,e-257,5),b(t,n-1,5),b(t,i-4,4),l=0;l<i;l++)b(t,t.bl_tree[2*r[l]+1],3);H(t,t.dyn_ltree,e-1),H(t,t.dyn_dtree,n-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),O(t,t.dyn_ltree,t.dyn_dtree)),I(t),i&&M(t)},n._tr_tally=function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(m[n]+256+1)]++,t.dyn_dtree[2*S(e)]++),t.last_lit===t.lit_bufsize-1},n._tr_align=function(t){b(t,2,3),T(t,256,d),16===(t=t).bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{"../utils/common":3}],15:[function(t,e,n){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/":[function(t,e,n){"use strict";var i={};(0,t("./lib/utils/common").assign)(i,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=i},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")});var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(t,e){var n,i,l,s,o,r,a="",h=0;for((e=null!=e&&e)||(t=Base64._utf8_encode(t));h<t.length;)l=(r=t.charCodeAt(h++))>>2,s=(3&r)<<4|(n=t.charCodeAt(h++))>>4,o=(15&n)<<2|(i=t.charCodeAt(h++))>>6,r=63&i,isNaN(n)?o=r=64:isNaN(i)&&(r=64),a=a+this._keyStr.charAt(l)+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(r);return a},decode:function(t,e){e=null!=e&&e;var n,i,l,s,o,r="",a=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");a<t.length;)n=this._keyStr.indexOf(t.charAt(a++))<<2|(l=this._keyStr.indexOf(t.charAt(a++)))>>4,i=(15&l)<<4|(s=this._keyStr.indexOf(t.charAt(a++)))>>2,l=(3&s)<<6|(o=this._keyStr.indexOf(t.charAt(a++))),r+=String.fromCharCode(n),64!=s&&(r+=String.fromCharCode(i)),64!=o&&(r+=String.fromCharCode(l));return e||(r=Base64._utf8_decode(r)),r},_utf8_encode:function(t){t=t.replace(/\r\n/g,"\n");for(var e="",n=0;n<t.length;n++){var i=t.charCodeAt(n);i<128?e+=String.fromCharCode(i):(127<i&&i<2048?e+=String.fromCharCode(i>>6|192):(e+=String.fromCharCode(i>>12|224),e+=String.fromCharCode(i>>6&63|128)),e+=String.fromCharCode(63&i|128))}return e},_utf8_decode:function(t){for(var e="",n=0,i=c1=c2=0;n<t.length;)(i=t.charCodeAt(n))<128?(e+=String.fromCharCode(i),n++):191<i&&i<224?(c2=t.charCodeAt(n+1),e+=String.fromCharCode((31&i)<<6|63&c2),n+=2):(c2=t.charCodeAt(n+1),c3=t.charCodeAt(n+2),e+=String.fromCharCode((15&i)<<12|(63&c2)<<6|63&c3),n+=3);return e}};!function(){var t,s,I,e,n,a,i,h,k=void 0,V=!0,F=null,B=!1,M={animation:{cssPropBits:517,cssLitGroup:[(c=["aliceblue,antiquewhite,aqua,aquamarine,azure,beige,bisque,black,blanchedalmond,blue,blueviolet,brown,burlywood,cadetblue,chartreuse,chocolate,coral,cornflowerblue,cornsilk,crimson,cyan,darkblue,darkcyan,darkgoldenrod,darkgray,darkgreen,darkkhaki,darkmagenta,darkolivegreen,darkorange,darkorchid,darkred,darksalmon,darkseagreen,darkslateblue,darkslategray,darkturquoise,darkviolet,deeppink,deepskyblue,dimgray,dodgerblue,firebrick,floralwhite,forestgreen,fuchsia,gainsboro,ghostwhite,gold,goldenrod,gray,green,greenyellow,honeydew,hotpink,indianred,indigo,ivory,khaki,lavender,lavenderblush,lawngreen,lemonchiffon,lightblue,lightcoral,lightcyan,lightgoldenrodyellow,lightgreen,lightgrey,lightpink,lightsalmon,lightseagreen,lightskyblue,lightslategray,lightsteelblue,lightyellow,lime,limegreen,linen,magenta,maroon,mediumaquamarine,mediumblue,mediumorchid,mediumpurple,mediumseagreen,mediumslateblue,mediumspringgreen,mediumturquoise,mediumvioletred,midnightblue,mintcream,mistyrose,moccasin,navajowhite,navy,oldlace,olive,olivedrab,orange,orangered,orchid,palegoldenrod,palegreen,paleturquoise,palevioletred,papayawhip,peachpuff,peru,pink,plum,powderblue,purple,red,rosybrown,royalblue,saddlebrown,salmon,sandybrown,seagreen,seashell,sienna,silver,skyblue,slateblue,slategray,snow,springgreen,steelblue,tan,teal,thistle,tomato,transparent,turquoise,violet,wheat,white,whitesmoke,yellow,yellowgreen".split(","),"all-scroll,col-resize,crosshair,default,e-resize,hand,help,move,n-resize,ne-resize,no-drop,not-allowed,nw-resize,pointer,progress,row-resize,s-resize,se-resize,sw-resize,text,vertical-text,w-resize,wait".split(","),"armenian,decimal,decimal-leading-zero,disc,georgian,lower-alpha,lower-greek,lower-latin,lower-roman,square,upper-alpha,upper-latin,upper-roman".split(","),"100,200,300,400,500,600,700,800,900,bold,bolder,lighter".split(","),"block-level,inline-level,table-caption,table-cell,table-column,table-column-group,table-footer-group,table-header-group,table-row,table-row-group".split(","),"condensed,expanded,extra-condensed,extra-expanded,narrower,semi-condensed,semi-expanded,ultra-condensed,ultra-expanded,wider".split(","),"inherit,inline,inline-block,inline-box,inline-flex,inline-grid,inline-list-item,inline-stack,inline-table,run-in".split(","),"behind,center-left,center-right,far-left,far-right,left-side,leftwards,right-side,rightwards".split(","),"large,larger,small,smaller,x-large,x-small,xx-large,xx-small".split(","),"dashed,dotted,double,groove,outset,ridge,solid".split(","),"ease,ease-in,ease-in-out,ease-out,linear,step-end,step-start".split(","),"at,closest-corner,closest-side,ellipse,farthest-corner,farthest-side".split(","),"baseline,middle,sub,super,text-bottom,text-top".split(","),"caption,icon,menu,message-box,small-caption,status-bar".split(","),"fast,faster,slow,slower,x-fast,x-slow".split(","),["above","below","higher","level","lower"],["cursive","fantasy","monospace","sans-serif","serif"],["loud","silent","soft","x-loud","x-soft"],["no-repeat","repeat-x","repeat-y","round","space"],["blink","line-through","overline","underline"],["block","flex","grid","table"],["high","low","x-high","x-low"],["nowrap","pre","pre-line","pre-wrap"],["absolute","relative","static"],["alternate","alternate-reverse","reverse"],["border-box","content-box","padding-box"],["capitalize","lowercase","uppercase"],["child","female","male"],["=","opacity"],["backwards","forwards"],["bidi-override","embed"],["bottom","top"],["break-all","keep-all"],["clip","ellipsis"],["contain","cover"],["continuous","digits"],["end","start"],["flat","preserve-3d"],["hide","show"],["horizontal","vertical"],["inside","outside"],["italic","oblique"],["left","right"],["ltr","rtl"],["no-content","no-display"],["paused","running"],["suppress","unrestricted"],["thick","thin"],[","],["/"],["all"],["always"],["auto"],["avoid"],["both"],["break-word"],["center"],["circle"],["code"],["collapse"],["contents"],["fixed"],["hidden"],["infinite"],["inset"],["invert"],["justify"],["list-item"],["local"],["medium"],["mix"],["none"],["normal"],["once"],["repeat"],["scroll"],["separate"],["small-caps"],["spell-out"],["to"],["visible"]])[10],c[24],c[29],c[45],c[48],c[54],c[63],c[71],c[72]],cssFns:["cubic-bezier()","steps()"]},"animation-delay":{cssPropBits:5,cssLitGroup:[c[48]],cssFns:[]},"animation-direction":{cssPropBits:0,cssLitGroup:[c[24],c[48],c[72]],cssFns:[]},"animation-duration":"animation-delay","animation-fill-mode":{cssPropBits:0,cssLitGroup:[c[29],c[48],c[54],c[71]],cssFns:[]},"animation-iteration-count":{cssPropBits:5,cssLitGroup:[c[48],c[63]],cssFns:[]},"animation-name":{cssPropBits:512,cssLitGroup:[c[48],c[71]],cssFns:[]},"animation-play-state":{cssPropBits:0,cssLitGroup:[c[45],c[48]],cssFns:[]},"animation-timing-function":{cssPropBits:0,cssLitGroup:[c[10],c[48]],cssFns:["cubic-bezier()","steps()"]},appearance:{cssPropBits:0,cssLitGroup:[c[71]],cssFns:[]},azimuth:{cssPropBits:5,cssLitGroup:[c[7],c[42],c[56]],cssFns:[]},"backface-visibility":{cssPropBits:0,cssLitGroup:[c[59],c[62],c[80]],cssFns:[]},background:{cssPropBits:23,cssLitGroup:[c[0],c[18],c[25],c[31],c[34],c[42],c[48],c[49],c[52],c[56],c[61],c[68],c[71],c[74],c[75]],cssFns:"image(),linear-gradient(),radial-gradient(),repeating-linear-gradient(),repeating-radial-gradient(),rgb(),rgba()".split(",")},"background-attachment":{cssPropBits:0,cssLitGroup:[c[48],c[61],c[68],c[75]],cssFns:[]},"background-color":{cssPropBits:2,cssLitGroup:[c[0]],cssFns:["rgb()","rgba()"]},"background-image":{cssPropBits:16,cssLitGroup:[c[48],c[71]],cssFns:["image()","linear-gradient()","radial-gradient()","repeating-linear-gradient()","repeating-radial-gradient()"]},"background-position":{cssPropBits:5,cssLitGroup:[c[31],c[42],c[48],c[56]],cssFns:[]},"background-repeat":{cssPropBits:0,cssLitGroup:[c[18],c[48],c[74]],cssFns:[]},"background-size":{cssPropBits:5,cssLitGroup:[c[34],c[48],c[52]],cssFns:[]},border:{cssPropBits:7,cssLitGroup:[c[0],c[9],c[47],c[62],c[64],c[69],c[71]],cssFns:["rgb()","rgba()"]},"border-bottom":"border","border-bottom-color":"background-color","border-bottom-left-radius":{cssPropBits:5,cssFns:[]},"border-bottom-right-radius":"border-bottom-left-radius","border-bottom-style":{cssPropBits:0,cssLitGroup:[c[9],c[62],c[64],c[71]],cssFns:[]},"border-bottom-width":{cssPropBits:5,cssLitGroup:[c[47],c[69]],cssFns:[]},"border-collapse":{cssPropBits:0,cssLitGroup:[c[59],c[76]],cssFns:[]},"border-color":"background-color","border-left":"border","border-left-color":"background-color","border-left-style":"border-bottom-style","border-left-width":"border-bottom-width","border-radius":{cssPropBits:5,cssLitGroup:[c[49]],cssFns:[]},"border-right":"border","border-right-color":"background-color","border-right-style":"border-bottom-style","border-right-width":"border-bottom-width","border-spacing":"border-bottom-left-radius","border-style":"border-bottom-style","border-top":"border","border-top-color":"background-color","border-top-left-radius":"border-bottom-left-radius","border-top-right-radius":"border-bottom-left-radius","border-top-style":"border-bottom-style","border-top-width":"border-bottom-width","border-width":"border-bottom-width",bottom:{cssPropBits:5,cssLitGroup:[c[52]],cssFns:[]},box:{cssPropBits:0,cssLitGroup:[c[60],c[71],c[72]],cssFns:[]},"box-shadow":{cssPropBits:7,cssLitGroup:[c[0],c[48],c[64],c[71]],cssFns:["rgb()","rgba()"]},"box-sizing":{cssPropBits:0,cssLitGroup:[c[25]],cssFns:[]},"caption-side":{cssPropBits:0,cssLitGroup:[c[31]],cssFns:[]},clear:{cssPropBits:0,cssLitGroup:[c[42],c[54],c[71]],cssFns:[]},clip:{cssPropBits:0,cssLitGroup:[c[52]],cssFns:["rect()"]},color:"background-color",content:{cssPropBits:8,cssLitGroup:[c[71],c[72]],cssFns:[]},cue:{cssPropBits:16,cssLitGroup:[c[71]],cssFns:[]},"cue-after":"cue","cue-before":"cue",cursor:{cssPropBits:16,cssLitGroup:[c[1],c[48],c[52]],cssFns:[]},direction:{cssPropBits:0,cssLitGroup:[c[43]],cssFns:[]},display:{cssPropBits:0,cssLitGroup:[c[4],c[6],c[20],c[52],c[67],c[71]],cssFns:[]},"display-extras":{cssPropBits:0,cssLitGroup:[c[67],c[71]],cssFns:[]},"display-inside":{cssPropBits:0,cssLitGroup:[c[20],c[52]],cssFns:[]},"display-outside":{cssPropBits:0,cssLitGroup:[c[4],c[71]],cssFns:[]},elevation:{cssPropBits:5,cssLitGroup:[c[15]],cssFns:[]},"empty-cells":{cssPropBits:0,cssLitGroup:[c[38]],cssFns:[]},filter:{cssPropBits:0,cssFns:["alpha()"]},float:{cssPropBits:0,cssLitGroup:[c[42],c[71]],cssFns:[]},font:{cssPropBits:73,cssLitGroup:[c[3],c[8],c[13],c[16],c[41],c[48],c[49],c[69],c[72],c[77]],cssFns:[]},"font-family":{cssPropBits:72,cssLitGroup:[c[16],c[48]],cssFns:[]},"font-size":{cssPropBits:1,cssLitGroup:[c[8],c[69]],cssFns:[]},"font-stretch":{cssPropBits:0,cssLitGroup:[c[5],c[72]],cssFns:[]},"font-style":{cssPropBits:0,cssLitGroup:[c[41],c[72]],cssFns:[]},"font-variant":{cssPropBits:0,cssLitGroup:[c[72],c[77]],cssFns:[]},"font-weight":{cssPropBits:0,cssLitGroup:[c[3],c[72]],cssFns:[]},height:"bottom",left:"bottom","letter-spacing":{cssPropBits:5,cssLitGroup:[c[72]],cssFns:[]},"line-height":{cssPropBits:1,cssLitGroup:[c[72]],cssFns:[]},"list-style":{cssPropBits:16,cssLitGroup:[c[2],c[40],c[57],c[71]],cssFns:["image()","linear-gradient()","radial-gradient()","repeating-linear-gradient()","repeating-radial-gradient()"]},"list-style-image":{cssPropBits:16,cssLitGroup:[c[71]],cssFns:["image()","linear-gradient()","radial-gradient()","repeating-linear-gradient()","repeating-radial-gradient()"]},"list-style-position":{cssPropBits:0,cssLitGroup:[c[40]],cssFns:[]},"list-style-type":{cssPropBits:0,cssLitGroup:[c[2],c[57],c[71]],cssFns:[]},margin:"bottom","margin-bottom":"bottom","margin-left":"bottom","margin-right":"bottom","margin-top":"bottom","max-height":{cssPropBits:1,cssLitGroup:[c[52],c[71]],cssFns:[]},"max-width":"max-height","min-height":{cssPropBits:1,cssLitGroup:[c[52]],cssFns:[]},"min-width":"min-height",opacity:{cssPropBits:1,cssFns:[]},outline:{cssPropBits:7,cssLitGroup:[c[0],c[9],c[47],c[62],c[64],c[65],c[69],c[71]],cssFns:["rgb()","rgba()"]},"outline-color":{cssPropBits:2,cssLitGroup:[c[0],c[65]],cssFns:["rgb()","rgba()"]},"outline-style":"border-bottom-style","outline-width":"border-bottom-width",overflow:{cssPropBits:0,cssLitGroup:[c[52],c[62],c[75],c[80]],cssFns:[]},"overflow-wrap":{cssPropBits:0,cssLitGroup:[c[55],c[72]],cssFns:[]},"overflow-x":{cssPropBits:0,cssLitGroup:[c[44],c[52],c[62],c[75],c[80]],cssFns:[]},"overflow-y":"overflow-x",padding:"opacity","padding-bottom":"opacity","padding-left":"opacity","padding-right":"opacity","padding-top":"opacity","page-break-after":{cssPropBits:0,cssLitGroup:[c[42],c[51],c[52],c[53]],cssFns:[]},"page-break-before":"page-break-after","page-break-inside":{cssPropBits:0,cssLitGroup:[c[52],c[53]],cssFns:[]},pause:"border-bottom-left-radius","pause-after":"border-bottom-left-radius","pause-before":"border-bottom-left-radius",perspective:{cssPropBits:5,cssLitGroup:[c[71]],cssFns:[]},"perspective-origin":{cssPropBits:5,cssLitGroup:[c[31],c[42],c[56]],cssFns:[]},pitch:{cssPropBits:5,cssLitGroup:[c[21],c[69]],cssFns:[]},"pitch-range":"border-bottom-left-radius","play-during":{cssPropBits:16,cssLitGroup:[c[52],c[70],c[71],c[74]],cssFns:[]},position:{cssPropBits:0,cssLitGroup:[c[23]],cssFns:[]},quotes:{cssPropBits:8,cssLitGroup:[c[71]],cssFns:[]},resize:{cssPropBits:0,cssLitGroup:[c[39],c[54],c[71]],cssFns:[]},richness:"border-bottom-left-radius",right:"bottom",speak:{cssPropBits:0,cssLitGroup:[c[71],c[72],c[78]],cssFns:[]},"speak-header":{cssPropBits:0,cssLitGroup:[c[51],c[73]],cssFns:[]},"speak-numeral":{cssPropBits:0,cssLitGroup:[c[35]],cssFns:[]},"speak-punctuation":{cssPropBits:0,cssLitGroup:[c[58],c[71]],cssFns:[]},"speech-rate":{cssPropBits:5,cssLitGroup:[c[14],c[69]],cssFns:[]},stress:"border-bottom-left-radius","table-layout":{cssPropBits:0,cssLitGroup:[c[52],c[61]],cssFns:[]},"text-align":{cssPropBits:0,cssLitGroup:[c[42],c[56],c[66]],cssFns:[]},"text-decoration":{cssPropBits:0,cssLitGroup:[c[19],c[71]],cssFns:[]},"text-indent":"border-bottom-left-radius","text-overflow":{cssPropBits:8,cssLitGroup:[c[33]],cssFns:[]},"text-shadow":"box-shadow","text-transform":{cssPropBits:0,cssLitGroup:[c[26],c[71]],cssFns:[]},"text-wrap":{cssPropBits:0,cssLitGroup:[c[46],c[71],c[72]],cssFns:[]},top:"bottom",transform:{cssPropBits:0,cssLitGroup:[c[71]],cssFns:"matrix(),perspective(),rotate(),rotate3d(),rotatex(),rotatey(),rotatez(),scale(),scale3d(),scalex(),scaley(),scalez(),skew(),skewx(),skewy(),translate(),translate3d(),translatex(),translatey(),translatez()".split(",")},"transform-origin":"perspective-origin","transform-style":{cssPropBits:0,cssLitGroup:[c[37]],cssFns:[]},transition:{cssPropBits:1029,cssLitGroup:[c[10],c[48],c[50],c[71]],cssFns:["cubic-bezier()","steps()"]},"transition-delay":"animation-delay","transition-duration":"animation-delay","transition-property":{cssPropBits:1024,cssLitGroup:[c[48],c[50]],cssFns:[]},"transition-timing-function":"animation-timing-function","unicode-bidi":{cssPropBits:0,cssLitGroup:[c[30],c[72]],cssFns:[]},"vertical-align":{cssPropBits:5,cssLitGroup:[c[12],c[31]],cssFns:[]},visibility:"backface-visibility","voice-family":{cssPropBits:8,cssLitGroup:[c[27],c[48]],cssFns:[]},volume:{cssPropBits:1,cssLitGroup:[c[17],c[69]],cssFns:[]},"white-space":{cssPropBits:0,cssLitGroup:[c[22],c[72]],cssFns:[]},width:"min-height","word-break":{cssPropBits:0,cssLitGroup:[c[32],c[72],c[55]],cssFns:[]},"word-spacing":"letter-spacing","word-wrap":"overflow-wrap","z-index":"bottom",zoom:"line-height","cubic-bezier()":"animation-delay","steps()":{cssPropBits:5,cssLitGroup:[c[36],c[48]],cssFns:[]},"image()":{cssPropBits:18,cssLitGroup:[c[0],c[48]],cssFns:["rgb()","rgba()"]},"linear-gradient()":{cssPropBits:7,cssLitGroup:[c[0],c[31],c[42],c[48],c[79]],cssFns:["rgb()","rgba()"]},"radial-gradient()":{cssPropBits:7,cssLitGroup:[c[0],c[11],c[31],c[42],c[48],c[56],c[57]],cssFns:["rgb()","rgba()"]},"repeating-linear-gradient()":"linear-gradient()","repeating-radial-gradient()":"radial-gradient()","rgb()":{cssPropBits:1,cssLitGroup:[c[48]],cssFns:[]},"rgba()":"rgb()","rect()":{cssPropBits:5,cssLitGroup:[c[48],c[52]],cssFns:[]},"alpha()":{cssPropBits:1,cssLitGroup:[c[28]],cssFns:[]},"matrix()":"animation-delay","perspective()":"border-bottom-left-radius","rotate()":"border-bottom-left-radius","rotate3d()":"animation-delay","rotatex()":"border-bottom-left-radius","rotatey()":"border-bottom-left-radius","rotatez()":"border-bottom-left-radius","scale()":"animation-delay","scale3d()":"animation-delay","scalex()":"border-bottom-left-radius","scaley()":"border-bottom-left-radius","scalez()":"border-bottom-left-radius","skew()":"animation-delay","skewx()":"border-bottom-left-radius","skewy()":"border-bottom-left-radius","translate()":"animation-delay","translate3d()":"animation-delay","translatex()":"border-bottom-left-radius","translatey()":"border-bottom-left-radius","translatez()":"border-bottom-left-radius"};for(t in M)"string"==typeof M[t]&&Object.hasOwnProperty.call(M,t)&&(M[t]=M[M[t]]);function l(t){var e=parseInt(t.substring(1),16);return 65535<e?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):e==e?String.fromCharCode(e):t[1]<" "?"":t[1]}function d(t,e){return'"'+t.replace(/[\u0000-\u001f\\\"<>]/g,e)+'"'}function u(t){return e[t]||(e[t]="\\"+t.charCodeAt(0).toString(16)+" ")}function p(t){return n[t]||(n[t]=(t<""?"%0":"%")+t.charCodeAt(0).toString(16))}"undefined"!=typeof window&&(window.cssSchema=M),e={"\\":"\\\\"},n={"\\":"%5c"},a=RegExp("\\uFEFF|U[+][0-9A-F?]{1,6}(?:-[0-9A-F]{1,6})?|url[(][\\t\\n\\f ]*(?:\"(?:'|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*\"|'(?:\"|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*'|(?:[\\t\\x21\\x23-\\x26\\x28-\\x5b\\x5d-\\x7e]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*)[\\t\\n\\f ]*[)]|(?!url[(])-?(?:[a-zA-Z_]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))(?:[a-zA-Z0-9_-]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*[(]|(?:@?-?(?:[a-zA-Z_]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))|#)(?:[a-zA-Z0-9_-]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*|\"(?:'|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*\"|'(?:\"|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*'|[-+]?(?:[0-9]+(?:[.][0-9]+)?|[.][0-9]+)(?:%|-?(?:[a-zA-Z_]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))(?:[a-zA-Z0-9_-]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*)?|\x3c!--|--\x3e|[\\t\\n\\f ]+|/(?:[*][^*]*[*]+(?:[^/][^*]*[*]+)*/|/[^\\n\\f]*)|[~|^$*]=|[^\"'\\\\/]|/(?![/*])","gi"),i=RegExp("\\\\(?:(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff])|[\\n\\f])","g"),h=RegExp("^url\\([\\t\\n\\f ]*[\"']?|[\"']?[\\t\\n\\f ]*\\)$","gi"),I=function(t){return t.replace(i,l)},s=function(t){for(var e=0,n=" ",i=0,l=(t=(""+t).replace(/\r\n?/g,"\n").match(a)||[]).length;i<l;++i){var s=I(t[i]),o=s.length,r=s.charCodeAt(0);n==(s=34==r||39==r?d(s.substring(1,o-1),u):47==r&&1<o||"\\"==s||"--\x3e"==s||"\x3c!--"==s||"\ufeff"==s||r<=32?" ":/url\(/i.test(s)?"url("+d(s.replace(h,""),p)+")":s)&&" "==s||(t[e++]=n=s)}return t.length=e,t},"undefined"!=typeof window&&(window.lexCss=s,window.decodeCss=I);var z=function(){function n(t){return(t=(""+t).match(s))?new h(e(t[1]),e(t[2]),e(t[3]),e(t[4]),e(t[5]),e(t[6]),e(t[7])):F}function r(t,e){return"string"==typeof t?encodeURI(t).replace(e,a):F}function a(t){return t=t.charCodeAt(0),"%"+"0123456789ABCDEF".charAt(t>>4&15)+"0123456789ABCDEF".charAt(15&t)}function o(t){if(t===F)return F;for(var e,t=t.replace(/(^|\/)\.(?:\/|$)/g,"$1").replace(/\/{2,}/g,"/"),n=l;(e=t.replace(n,"$1"))!=t;t=e);return t}function i(t,e){var n=t.T(),i=e.K();i?n.ga(e.j):i=e.X(),i?n.da(e.n):i=e.Y(),i?n.ea(e.k):i=e.$();var l=e.g,s=o(l);return i?(n.ca(e.V()),s=s&&s.replace(d,"")):(i=!!l)?47!==s.charCodeAt(0)&&(s=o(n.g||"").replace(d,""),s=o(((t=s.lastIndexOf("/")+1)?s.substring(0,t):"")+o(l)).replace(d,"")):(s=s&&s.replace(d,""))!==l&&n.G(s),i?n.G(s):i=e.aa(),i?n.O(e.l):i=e.Z(),i&&n.fa(e.o),n}function h(t,e,n,i,l,s,o){this.j=t,this.n=e,this.k=n,this.h=i,this.g=l,this.l=s,this.o=o}function e(t){return"string"==typeof t&&0<t.length?t:F}var l=RegExp(/(\/|^)(?:[^./][^/]*|\.{2,}(?:[^./][^/]*)|\.{3,}[^/]*)\/\.\.(?:\/|$)/),d=/^(?:\.\.\/)*(?:\.\.$)?/;h.prototype.toString=function(){var t=[];return F!==this.j&&t.push(this.j,":"),F!==this.k&&(t.push("//"),F!==this.n&&t.push(this.n,"@"),t.push(this.k),F!==this.h&&t.push(":",this.h.toString())),F!==this.g&&t.push(this.g),F!==this.l&&t.push("?",this.l),F!==this.o&&t.push("#",this.o),t.join("")},h.prototype.T=function(){return new h(this.j,this.n,this.k,this.h,this.g,this.l,this.o)},h.prototype.W=function(){return this.j&&decodeURIComponent(this.j).toLowerCase()},h.prototype.ga=function(t){this.j=t||F},h.prototype.K=function(){return F!==this.j},h.prototype.da=function(t){this.n=t||F},h.prototype.X=function(){return F!==this.n},h.prototype.ea=function(t){this.k=t||F,this.G(this.g)},h.prototype.Y=function(){return F!==this.k},h.prototype.V=function(){return this.h&&decodeURIComponent(this.h)},h.prototype.ca=function(t){if(t){if((t=Number(t))!==(65535&t))throw Error("Bad port number "+t);this.h=""+t}else this.h=F},h.prototype.$=function(){return F!==this.h},h.prototype.U=function(){return this.g&&decodeURIComponent(this.g)},h.prototype.G=function(t){t?(t=""+t,this.g=!this.k||/^\//.test(t)?t:"/"+t):this.g=F},h.prototype.O=function(t){this.l=t||F},h.prototype.aa=function(){return F!==this.l},h.prototype.ba=function(t){if("object"==typeof t&&!(t instanceof Array)&&(t instanceof Object||"[object Array]"!==Object.prototype.toString.call(t))){var e,n=[],i=-1;for(e in t){var l=t[e];"string"==typeof l&&(n[++i]=e,n[++i]=l)}t=n}for(var n=[],i="",s=0;s<t.length;)e=t[s++],l=t[s++],n.push(i,encodeURIComponent(e.toString())),i="&",l&&n.push("=",encodeURIComponent(l.toString()));this.l=n.join("")},h.prototype.fa=function(t){this.o=t||F},h.prototype.Z=function(){return F!==this.o};var s=/^(?:([^:/?#]+):)?(?:\/\/(?:([^/?#]*)@)?([^/?#:@]*)(?::([0-9]+))?)?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/,u=/[#\/\?@]/g,p=/[\#\?]/g;return h.parse=n,h.create=function(t,e,n,i,l,s,o){return t=new h(r(t,u),r(e,u),"string"==typeof n?encodeURIComponent(n):F,0<i?i.toString():F,r(l,p),F,"string"==typeof o?encodeURIComponent(o):F),s&&("string"==typeof s?t.O(s.replace(/[^?&=0-9A-Za-z_\-~.%]/g,a)):t.ba(s)),t},h.N=i,h.ma=o,h.ha={ua:function(t){return/\.html$/.test(n(t).U())?"text/html":"application/javascript"},N:function(t,e){return t?i(n(t),n(e)).toString():""+e}},h}();"undefined"!=typeof window&&(window.URI=z);var m,y,o,C=k,v=k,E=k;!function(){function w(t){return"string"==typeof t?'url("'+t.replace(n,e)+'")':'url("about:blank")'}function e(t){return i[t]}function b(t,e){return t?z.ha.N(t,e):e}function T(t,e,n){if(!n)return F;var i=(""+t).match(l);return!i||i[1]&&!s.test(i[1])?F:n(t,e)}function A(t){return t.replace(/^-(?:apple|css|epub|khtml|moz|mso?|o|rim|wap|webkit|xv)-(?=[a-z])/,"")}var L,n=/[\n\f\r\"\'()*<>]/g,i={"\n":"%0a","\f":"%0c","\r":"%0d",'"':"%22","'":"%27","(":"%28",")":"%29","*":"%2a","<":"%3c",">":"%3e"},l=/^(?:([^:/?# ]+):)?/,s=/^(?:https?|mailto|data)$/i;L={},C=function t(e,n,i,l,s){var e=A(e),o=M[e];if(o&&"object"==typeof o){for(var r=o.cssPropBits,a=80&r,h=1536&r,d=NaN,u=0,p=0;u<n.length;++u){var m,c,g,x,y,f=n[u].toLowerCase(),C=f.charCodeAt(0);if(32===C)f="";else if(34===C)f=16==a?i?w(T(b(l,I(n[u].substring(1,f.length-1))),e,i)):"":8&r&&!(a&a-1)?f:"";else if("inherit"!==f){if(x=o.cssLitGroup){if(!(y=o.cssLitMap)){y={};for(var v=x.length;0<=--v;)for(var E=x[v],S=E.length;0<=--S;)y[E[S]]=L;y=o.cssLitMap=y}x=y}else x=L;if(x[A(f)]!==L)if(35===C&&/^#(?:[0-9a-f]{3}){1,2}$/.test(f))f=2&r?f:"";else if(48<=C&&C<=57)f=1&r?f:"";else if(c=48<=(m=f.charCodeAt(1))&&m<=57,g=48<=(g=f.charCodeAt(2))&&g<=57,43===C&&(c||46===m&&g))f=1&r?(c?"":"0")+f.substring(1):"";else if(45===C&&(c||46===m&&g))f=4&r?(c?"-":"-0")+f.substring(1):1&r?"0":"";else if(46===C&&c)f=1&r?"0"+f:"";else if('url("'===f.substring(0,5))f=i&&16&r?w(T(b(l,n[u].substring(5,f.length-2)),e,i)):"";else if("("===f.charAt(f.length-1))t:{for(v=(y=u)+(f=1),C=(x=n).length;v<C&&f;)f+=")"===(E=x[v++])?-1:/^[^"']*\($/.test(E);if(!f)for(C=A(f=x[y].toLowerCase()),x=x.splice(y,v-y,""),v=0,E=(y=o.cssFns).length;v<E;++v)if(y[v].substring(0,C.length)==C){x[0]=x[x.length-1]="",t(y[v],x,i,l),f=f+x.join(" ")+")";break t}f=""}else f=h&&/^-?[a-z_][\w\-]*$/.test(f)&&!/__$/.test(f)?s&&512==h?n[u]+s:1024==h&&M[f]&&"number"==typeof M[f].oa?f:"":/^\w+$/.test(f)&&64==a&&8&r?d+1===p?(n[d]=n[d].substring(0,n[d].length-1)+" "+f+'"',""):(d=p,'"'+f+'"'):""}f&&(n[p++]=f)}1===p&&'url("about:blank")'===n[0]&&(p=0),n.length=p}else n.length=0};var o,r,f=RegExp("^(active|after|before|blank|checked|default|disabled|drop|empty|enabled|first|first-child|first-letter|first-line|first-of-type|fullscreen|focus|hover|in-range|indeterminate|invalid|last-child|last-of-type|left|link|only-child|only-of-type|optional|out-of-range|placeholder-shown|read-only|read-write|required|right|root|scope|user-error|valid|visited)$"),d={};function x(r,t,a,h,d,u,e){function n(){g=c.length&&c[c.length-1]===F}var p=k,m=e||[0],c=[],g=B;return y(t,{startStylesheet:function(){p=[]},endStylesheet:function(){},startAtrule:function(t,e){var n,i,l,s,o;g?t=F:"@media"===t?p.push("@media"," ",E(e)):"@keyframes"===t||"@-webkit-keyframes"===t?(o=e[0],t=1!==e.length||/__$|[^\w\-]/.test(o)?F:(p.push(t," ",o+a.L),"@keyframes")):"@import"===t&&0<e.length&&(t=F,"function"==typeof u?"not all"!==(n=E(e.slice(1)))&&(++m[0],i=[],p.push(i),l=T(b(r,(s=e[0],(o=/^\s*["]([^"]*)["]\s*$/.exec(s))||(o=/^\s*[']([^']*)[']\s*$/.exec(s))||(o=/^\s*url\s*[(]["]([^"]*)["][)]\s*$/.exec(s))||(o=/^\s*url\s*[(][']([^']*)['][)]\s*$/.exec(s))||(o=/^\s*url\s*[(]([^)]*)[)]\s*$/.exec(s))?o[1]:F)),function(t){var e=x(l,t.qa,a,h,d,u,m);--m[0],t=n?{toString:function(){return"@media "+n+" {"+e.result+"}"}}:e.result,i[0]=t,u(t,!!m[0])},d)):window.console&&window.console.log("@import "+e.join(" ")+" elided")),g=!t,c.push(t)},endAtrule:function(){c.pop(),g||p.push(";"),n()},startBlock:function(){g||p.push("{")},endBlock:function(){g||(p.push("}"),g=V)},startRuleset:function(t){var e;g||(e=k,"@keyframes"===c[c.length-1]?(e=t.join(" ").match(/^ *(?:from|to|\d+(?:\.\d+)?%) *(?:, *(?:from|to|\d+(?:\.\d+)?%) *)*$/i),g=!e,e=e&&e[0].replace(/ +/g,"")):(t=v(t,a))&&t.length?e=t.join(", "):g=V,g||p.push(e,"{")),c.push(F)},endRuleset:function(){c.pop(),g||p.push("}"),n()},declaration:function(t,e){var n,i;g||(n=B,2<=(i=e.length)&&"!"===e[i-2]&&"important"===e[i-1].toLowerCase()&&(n=V,e.length-=2),C(t,e,h,r,a.L),e.length&&p.push(t,":",e.join(" "),n?" !important;":";"))}}),{result:{toString:function(){return p.join("")}},va:!!m[0]}}d[">"]=d["+"]=d["~"]=d,v=function(c,g,r){function t(t,e){function n(t,e,n){var i,l,s,o=V,r="";t<e&&("*"===(h=c[t])?(++t,r=h):/^[a-zA-Z]/.test(h)&&(i=y(h.toLowerCase(),[]))&&("tagName"in i&&(h=i.tagName),++t,r=h));for(s=l=i="";o&&t<e;++t)if("#"===(h=c[t]).charAt(0))/^#_|__$|[^\w#:\-]/.test(h)?o=B:i+=h+x;else if("."===h)++t<e&&/^[0-9A-Za-z:_\-]+$/.test(h=c[t])&&!/^_|__$/.test(h)?i+="."+h:o=B;else if(t+1<e&&"["===c[t]){++t;var a,h,d=c[t++].toLowerCase();(h=S.m[r+"::"+d])!==+h&&(h=S.m["*::"+d]),g.ia?("string"!=typeof(a=g.ia(r,d))&&(o=B,a=d),o&&h!==+h&&(h=S.d.NONE)):(a=d,h!==+h&&(o=B));var u=d="",p=B;switch(/^[~^$*|]?=$/.test(c[t])&&(d=c[t++],u=c[t++],/^[0-9A-Za-z:_\-]+$/.test(u)?u='"'+u+'"':"]"===u&&(u='""',--t),/^"([^\"\\]|\\.)*"$/.test(u)||(o=B),(p="i"===c[t])&&++t),"]"!==c[t]&&(++t,o=B),h){case S.d.CLASSES:case S.d.LOCAL_NAME:case S.d.NONE:break;case S.d.GLOBAL_NAME:case S.d.ID:case S.d.IDREF:"="!==d&&"~="!==d&&"$="!==d||'""'==u||p?"|="===d||""===d||(o=B):u='"'+u.substring(1,u.length-1)+x+'"';break;case S.d.URI:case S.d.URI_FRAGMENT:""!==d&&(o=B);break;default:o=B}o&&(l+="["+a.replace(/[^\w-]/g,"\\$&")+d+u+(p?" i]":"]"))}else{if(!(t<e&&":"===c[t]))break;if(h=c[++t],!f.test(h))break;s+=":"+h}return t!==e&&(o=B),o&&(t=(r+i).replace(/[^ .*#\w-]/g,"\\$&")+l+s+n)&&m.push(t),o}" "===c[t]&&++t,e-1!==t&&" "===c[e]&&--e;for(var m=[],i=t,l=V,s=t;l&&s<e;++s){var o=c[s];d[o]!==d&&" "!==o||(n(i,s,o)?i=s+1:l=B)}return n(i,e,"")||(l=B),l?(m.length&&(i=m.join(""),a!==F&&(i="."+a+" "+i),h.push(i)),V):!r||r(c.slice(t,e))}for(var e,a=g.na,x=g.L,y=g.Aa,h=[],n=0,i=0,l=0;l<c.length;++l)("("==(e=c[l])||"["==e?(++i,V):")"==e||"]"==e?(i&&--i,V):" "!=c[l]||!i&&d[c[l-1]]!==d&&d[c[l+1]]!==d)&&(c[n++]=c[l]);for(c.length=n,n=c.length,l=i=0;l<n;++l)if(","===c[l]){if(!t(i,l))return F;i=l+1}return t(i,n)?h:F},o=/^\w/,r=RegExp("^(?:(?:(?:(?:only|not) )?(?:all|aural|braille|embossed|handheld|print|projection|screen|speech|tty|tv)|\\( (?:(?:min-|max-)?(?:(?:device-)?(?:aspect-ratio|height|width)|color(?:-index)?|monochrome|orientation|resolution)|grid|hover|luminosity|pointer|scan|script) (?:: -?(?:[a-z]\\w+(?:-\\w+)*|\\d+(?: / \\d+|(?:\\.\\d+)?(?:p[cxt]|[cem]m|in|dpi|dppx|dpcm|%)?)) )?\\))(?: and ?\\( (?:(?:min-|max-)?(?:(?:device-)?(?:aspect-ratio|height|width)|color(?:-index)?|monochrome|orientation|resolution)|grid|hover|luminosity|pointer|scan|script) (?:: -?(?:[a-z]\\w+(?:-\\w+)*|\\d+(?: / \\d+|(?:\\.\\d+)?(?:p[cxt]|[cem]m|in|dpi|dppx|dpcm|%)?)) )?\\))*)(?: , (?:(?:(?:(?:only|not) )?(?:all|aural|braille|embossed|handheld|print|projection|screen|speech|tty|tv)|\\( (?:(?:min-|max-)?(?:(?:device-)?(?:aspect-ratio|height|width)|color(?:-index)?|monochrome|orientation|resolution)|grid|hover|luminosity|pointer|scan|script) (?:: -?(?:[a-z]\\w+(?:-\\w+)*|\\d+(?: / \\d+|(?:\\.\\d+)?(?:p[cxt]|[cem]m|in|dpi|dppx|dpcm|%)?)) )?\\))(?: and ?\\( (?:(?:min-|max-)?(?:(?:device-)?(?:aspect-ratio|height|width)|color(?:-index)?|monochrome|orientation|resolution)|grid|hover|luminosity|pointer|scan|script) (?:: -?(?:[a-z]\\w+(?:-\\w+)*|\\d+(?: / \\d+|(?:\\.\\d+)?(?:p[cxt]|[cem]m|in|dpi|dppx|dpcm|%)?)) )?\\))*))*$","i"),E=function(t){for(var e=(t=t.slice()).length,n=0,i=0;i<e;++i){var l=t[i];" "!=l&&(t[n++]=l)}return t.length=n,(t=t.join(" ")).length?r.test(t)?o.test(t)?t:"not all , "+t:"not all":""},m=function(t,e,n,i){return x(t,e,n,i,k,k).result.toString()}}(),"undefined"!=typeof window&&(window.sanitizeCssProperty=C,window.sanitizeCssSelectorList=v,window.sanitizeStylesheet=m,window.sanitizeMediaQuery=E),function(){function r(t,e,n,i,l){for(var s,o=e++;e<n&&"{"!==t[e]&&";"!==t[e];)++e;return e<n&&(l||";"===t[e])&&(s=e,(l=1+o)<n&&" "===t[l]&&++l,l<s&&" "===t[s-1]&&--s,i.startAtrule&&i.startAtrule(t[o].toLowerCase(),t.slice(l,s)),e="{"===t[e]?function t(e,n,i,l){++n;for(l.startBlock&&l.startBlock();n<i;){var s=e[n].charAt(0);if("}"==s){++n;break}n=" "===s||";"===s?n+1:"@"===s?r(e,n,i,l,B):("{"===s?t:a)(e,n,i,l)}l.endBlock&&l.endBlock();return n}(t,e,n,i):e+1,i.endAtrule&&i.endAtrule()),e}function a(t,e,n,i){var l=e,s=h(t,e,n,V);if(s<0)return(s=~s)===l?s+1:s;var o=t[s];if("{"!==o)return s===l?s+1:s;for(e=s+1,l<s&&" "===t[s-1]&&--s,i.startRuleset&&i.startRuleset(t.slice(l,s));e<n;){if("}"===(o=t[e])){++e;break}e=" "===o?e+1:u(t,e,n,i)}return i.endRuleset&&i.endRuleset(),e}function h(t,e,n,i){for(var l,s=[],o=-1;e<n;++e)if("["===(l=t[e].charAt(0))||"("===l)s[++o]=l;else if("]"===l&&"["===s[o]||")"===l&&"("===s[o])--o;else if("{"===l||"}"===l||";"===l||"@"===l||":"===l&&!i)break;return 0<=o&&(e=~(e+1)),e}function d(t,e,n){for(;e<n&&";"!==t[e]&&"}"!==t[e];)++e;return e<n&&";"===t[e]?e+1:e}function u(t,e,n,i){var l=t[e++];if(!p.test(l))return d(t,e,n);if(e<n&&" "===t[e]&&++e,e==n||":"!==t[e])return d(t,e,n);++e<n&&" "===t[e]&&++e;var s=h(t,e,n,B);if(s<0)s=~s;else{for(var o=[],r=0,a=e;a<s;++a)" "!==(e=t[a])&&(o[r++]=e);if(s<n){for(;";"!==(e=t[s])&&"}"!==e&&(r=0,++s<n););";"===e&&++s}r&&i.declaration&&i.declaration(l.toLowerCase(),o)}return s}y=function(t,e){var n=s(t);e.startStylesheet&&e.startStylesheet();for(var i=0,l=n.length;i<l;)i=" "===n[i]?i+1:i<l?"@"===n[i].charAt(0)?r(n,i,l,e,V):a(n,i,l,e):i;e.endStylesheet&&e.endStylesheet()};var p=/^-?[a-z]/i;o=function(t,e){for(var n=s(t),i=0,l=n.length;i<l;)i=" "!==n[i]?u(n,i,l,e):i+1}}(),"undefined"!=typeof window&&(window.parseCssStylesheet=y,window.parseCssDeclarations=o);var S={d:{NONE:0,URI:1,URI_FRAGMENT:11,SCRIPT:2,STYLE:3,HTML:12,ID:4,IDREF:5,IDREFS:6,GLOBAL_NAME:7,LOCAL_NAME:8,CLASSES:9,FRAME_TARGET:10,MEDIA_QUERY:13}};S.atype=S.d,S.m={"*::class":9,"*::dir":0,"*::draggable":0,"*::hidden":0,"*::id":4,"*::inert":0,"*::itemprop":0,"*::itemref":6,"*::itemscope":0,"*::lang":0,"*::onblur":2,"*::onchange":2,"*::onclick":2,"*::ondblclick":2,"*::onerror":2,"*::onfocus":2,"*::onkeydown":2,"*::onkeypress":2,"*::onkeyup":2,"*::onload":2,"*::onmousedown":2,"*::onmousemove":2,"*::onmouseout":2,"*::onmouseover":2,"*::onmouseup":2,"*::onreset":2,"*::onscroll":2,"*::onselect":2,"*::onsubmit":2,"*::ontouchcancel":2,"*::ontouchend":2,"*::ontouchenter":2,"*::ontouchleave":2,"*::ontouchmove":2,"*::ontouchstart":2,"*::onunload":2,"*::spellcheck":0,"*::style":3,"*::tabindex":0,"*::title":0,"*::translate":0,"a::accesskey":0,"a::coords":0,"a::href":1,"a::hreflang":0,"a::name":7,"a::onblur":2,"a::onfocus":2,"a::shape":0,"a::target":10,"a::type":0,"area::accesskey":0,"area::alt":0,"area::coords":0,"area::href":1,"area::nohref":0,"area::onblur":2,"area::onfocus":2,"area::shape":0,"area::target":10,"audio::controls":0,"audio::loop":0,"audio::mediagroup":5,"audio::muted":0,"audio::preload":0,"audio::src":1,"bdo::dir":0,"blockquote::cite":1,"br::clear":0,"button::accesskey":0,"button::disabled":0,"button::name":8,"button::onblur":2,"button::onfocus":2,"button::type":0,"button::value":0,"canvas::height":0,"canvas::width":0,"caption::align":0,"col::align":0,"col::char":0,"col::charoff":0,"col::span":0,"col::valign":0,"col::width":0,"colgroup::align":0,"colgroup::char":0,"colgroup::charoff":0,"colgroup::span":0,"colgroup::valign":0,"colgroup::width":0,"command::checked":0,"command::command":5,"command::disabled":0,"command::icon":1,"command::label":0,"command::radiogroup":0,"command::type":0,"data::value":0,"del::cite":1,"del::datetime":0,"details::open":0,"dir::compact":0,"div::align":0,"dl::compact":0,"fieldset::disabled":0,"font::color":0,"font::face":0,"font::size":0,"form::accept":0,"form::action":1,"form::autocomplete":0,"form::enctype":0,"form::method":0,"form::name":7,"form::novalidate":0,"form::onreset":2,"form::onsubmit":2,"form::target":10,"h1::align":0,"h2::align":0,"h3::align":0,"h4::align":0,"h5::align":0,"h6::align":0,"hr::align":0,"hr::noshade":0,"hr::size":0,"hr::width":0,"iframe::align":0,"iframe::frameborder":0,"iframe::height":0,"iframe::marginheight":0,"iframe::marginwidth":0,"iframe::width":0,"img::align":0,"img::alt":0,"img::border":0,"img::height":0,"img::hspace":0,"img::ismap":0,"img::name":7,"img::src":1,"img::usemap":11,"img::vspace":0,"img::width":0,"input::accept":0,"input::accesskey":0,"input::align":0,"input::alt":0,"input::autocomplete":0,"input::checked":0,"input::disabled":0,"input::inputmode":0,"input::ismap":0,"input::list":5,"input::max":0,"input::maxlength":0,"input::min":0,"input::multiple":0,"input::name":8,"input::onblur":2,"input::onchange":2,"input::onfocus":2,"input::onselect":2,"input::pattern":0,"input::placeholder":0,"input::readonly":0,"input::required":0,"input::size":0,"input::src":1,"input::step":0,"input::type":0,"input::usemap":11,"input::value":0,"ins::cite":1,"ins::datetime":0,"label::accesskey":0,"label::for":5,"label::onblur":2,"label::onfocus":2,"legend::accesskey":0,"legend::align":0,"li::type":0,"li::value":0,"map::name":7,"menu::compact":0,"menu::label":0,"menu::type":0,"meter::high":0,"meter::low":0,"meter::max":0,"meter::min":0,"meter::value":0,"ol::compact":0,"ol::reversed":0,"ol::start":0,"ol::type":0,"optgroup::disabled":0,"optgroup::label":0,"option::disabled":0,"option::label":0,"option::selected":0,"option::value":0,"output::for":6,"output::name":8,"p::align":0,"pre::width":0,"progress::max":0,"progress::min":0,"progress::value":0,"q::cite":1,"select::autocomplete":0,"select::disabled":0,"select::multiple":0,"select::name":8,"select::onblur":2,"select::onchange":2,"select::onfocus":2,"select::required":0,"select::size":0,"source::type":0,"table::align":0,"table::bgcolor":0,"table::border":0,"table::cellpadding":0,"table::cellspacing":0,"table::frame":0,"table::rules":0,"table::summary":0,"table::width":0,"tbody::align":0,"tbody::char":0,"tbody::charoff":0,"tbody::valign":0,"td::abbr":0,"td::align":0,"td::axis":0,"td::bgcolor":0,"td::char":0,"td::charoff":0,"td::colspan":0,"td::headers":6,"td::height":0,"td::nowrap":0,"td::rowspan":0,"td::scope":0,"td::valign":0,"td::width":0,"textarea::accesskey":0,"textarea::autocomplete":0,"textarea::cols":0,"textarea::disabled":0,"textarea::inputmode":0,"textarea::name":8,"textarea::onblur":2,"textarea::onchange":2,"textarea::onfocus":2,"textarea::onselect":2,"textarea::placeholder":0,"textarea::readonly":0,"textarea::required":0,"textarea::rows":0,"textarea::wrap":0,"tfoot::align":0,"tfoot::char":0,"tfoot::charoff":0,"tfoot::valign":0,"th::abbr":0,"th::align":0,"th::axis":0,"th::bgcolor":0,"th::char":0,"th::charoff":0,"th::colspan":0,"th::headers":6,"th::height":0,"th::nowrap":0,"th::rowspan":0,"th::scope":0,"th::valign":0,"th::width":0,"thead::align":0,"thead::char":0,"thead::charoff":0,"thead::valign":0,"tr::align":0,"tr::bgcolor":0,"tr::char":0,"tr::charoff":0,"tr::valign":0,"track::default":0,"track::kind":0,"track::label":0,"track::srclang":0,"ul::compact":0,"ul::type":0,"video::controls":0,"video::height":0,"video::loop":0,"video::mediagroup":5,"video::muted":0,"video::poster":1,"video::preload":0,"video::src":1,"video::width":0},S.ATTRIBS=S.m,S.c={OPTIONAL_ENDTAG:1,EMPTY:2,CDATA:4,RCDATA:8,UNSAFE:16,FOLDABLE:32,SCRIPT:64,STYLE:128,VIRTUALIZED:256},S.eflags=S.c,S.f={a:0,abbr:0,acronym:0,address:0,applet:272,area:2,article:0,aside:0,audio:0,b:0,base:274,basefont:274,bdi:0,bdo:0,big:0,blockquote:0,body:305,br:2,button:0,canvas:0,caption:0,center:0,cite:0,code:0,col:2,colgroup:1,command:2,data:0,datalist:0,dd:1,del:0,details:0,dfn:0,dialog:272,dir:0,div:0,dl:0,dt:1,em:0,fieldset:0,figcaption:0,figure:0,font:0,footer:0,form:0,frame:274,frameset:272,h1:0,h2:0,h3:0,h4:0,h5:0,h6:0,head:305,header:0,hgroup:0,hr:2,html:305,i:0,iframe:4,img:2,input:2,ins:0,isindex:274,kbd:0,keygen:274,label:0,legend:0,li:1,link:274,map:0,mark:0,menu:0,meta:274,meter:0,nav:0,nobr:0,noembed:276,noframes:276,noscript:276,object:272,ol:0,optgroup:0,option:1,output:0,p:1,param:274,pre:0,progress:0,q:0,s:0,samp:0,script:84,section:0,select:0,small:0,source:2,span:0,strike:0,strong:0,style:148,sub:0,summary:0,sup:0,table:0,tbody:1,td:1,textarea:8,tfoot:1,th:1,thead:1,time:0,title:280,tr:1,track:2,tt:0,u:0,ul:0,var:0,video:0,wbr:2},S.ELEMENTS=S.f,S.Q={a:"HTMLAnchorElement",abbr:"HTMLElement",acronym:"HTMLElement",address:"HTMLElement",applet:"HTMLAppletElement",area:"HTMLAreaElement",article:"HTMLElement",aside:"HTMLElement",audio:"HTMLAudioElement",b:"HTMLElement",base:"HTMLBaseElement",basefont:"HTMLBaseFontElement",bdi:"HTMLElement",bdo:"HTMLElement",big:"HTMLElement",blockquote:"HTMLQuoteElement",body:"HTMLBodyElement",br:"HTMLBRElement",button:"HTMLButtonElement",canvas:"HTMLCanvasElement",caption:"HTMLTableCaptionElement",center:"HTMLElement",cite:"HTMLElement",code:"HTMLElement",col:"HTMLTableColElement",colgroup:"HTMLTableColElement",command:"HTMLCommandElement",data:"HTMLElement",datalist:"HTMLDataListElement",dd:"HTMLElement",del:"HTMLModElement",details:"HTMLDetailsElement",dfn:"HTMLElement",dialog:"HTMLDialogElement",dir:"HTMLDirectoryElement",div:"HTMLDivElement",dl:"HTMLDListElement",dt:"HTMLElement",em:"HTMLElement",fieldset:"HTMLFieldSetElement",figcaption:"HTMLElement",figure:"HTMLElement",font:"HTMLFontElement",footer:"HTMLElement",form:"HTMLFormElement",frame:"HTMLFrameElement",frameset:"HTMLFrameSetElement",h1:"HTMLHeadingElement",h2:"HTMLHeadingElement",h3:"HTMLHeadingElement",h4:"HTMLHeadingElement",h5:"HTMLHeadingElement",h6:"HTMLHeadingElement",head:"HTMLHeadElement",header:"HTMLElement",hgroup:"HTMLElement",hr:"HTMLHRElement",html:"HTMLHtmlElement",i:"HTMLElement",iframe:"HTMLIFrameElement",img:"HTMLImageElement",input:"HTMLInputElement",ins:"HTMLModElement",isindex:"HTMLUnknownElement",kbd:"HTMLElement",keygen:"HTMLKeygenElement",label:"HTMLLabelElement",legend:"HTMLLegendElement",li:"HTMLLIElement",link:"HTMLLinkElement",map:"HTMLMapElement",mark:"HTMLElement",menu:"HTMLMenuElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",nav:"HTMLElement",nobr:"HTMLElement",noembed:"HTMLElement",noframes:"HTMLElement",noscript:"HTMLElement",object:"HTMLObjectElement",ol:"HTMLOListElement",optgroup:"HTMLOptGroupElement",option:"HTMLOptionElement",output:"HTMLOutputElement",p:"HTMLParagraphElement",param:"HTMLParamElement",pre:"HTMLPreElement",progress:"HTMLProgressElement",q:"HTMLQuoteElement",s:"HTMLElement",samp:"HTMLElement",script:"HTMLScriptElement",section:"HTMLElement",select:"HTMLSelectElement",small:"HTMLElement",source:"HTMLSourceElement",span:"HTMLSpanElement",strike:"HTMLElement",strong:"HTMLElement",style:"HTMLStyleElement",sub:"HTMLElement",summary:"HTMLElement",sup:"HTMLElement",table:"HTMLTableElement",tbody:"HTMLTableSectionElement",td:"HTMLTableDataCellElement",textarea:"HTMLTextAreaElement",tfoot:"HTMLTableSectionElement",th:"HTMLTableHeaderCellElement",thead:"HTMLTableSectionElement",time:"HTMLTimeElement",title:"HTMLTitleElement",tr:"HTMLTableRowElement",track:"HTMLTrackElement",tt:"HTMLElement",u:"HTMLElement",ul:"HTMLUListElement",var:"HTMLElement",video:"HTMLVideoElement",wbr:"HTMLElement"},S.ELEMENT_DOM_INTERFACES=S.Q,S.P={NOT_LOADED:0,SAME_DOCUMENT:1,NEW_DOCUMENT:2},S.ueffects=S.P,S.J={"a::href":2,"area::href":2,"audio::src":1,"blockquote::cite":0,"command::icon":1,"del::cite":0,"form::action":2,"img::src":1,"input::src":1,"ins::cite":0,"q::cite":0,"video::poster":1,"video::src":1},S.URIEFFECTS=S.J,S.M={UNSANDBOXED:2,SANDBOXED:1,DATA:0},S.ltypes=S.M,S.I={"a::href":2,"area::href":2,"audio::src":2,"blockquote::cite":2,"command::icon":1,"del::cite":2,"form::action":2,"img::src":1,"input::src":1,"ins::cite":2,"q::cite":2,"video::poster":1,"video::src":2},S.LOADERTYPES=S.I,"undefined"!=typeof window&&(window.html4=S);var r=function(C){function e(t,e){return function(t){if(r.hasOwnProperty(t))return r[t];var e=t.match(h);return e?String.fromCharCode(parseInt(e[1],10)):(e=t.match(f))?String.fromCharCode(parseInt(e[1],16)):b&&w.test(t)?(b.innerHTML="&"+t+";",e=b.textContent,r[t]=e):"&"+t+";"}(e)}function u(t){return t.replace(A,e)}function p(t){return(""+t).replace(I,"&amp;").replace(R,"&lt;").replace(P,"&gt;").replace(O,"&#34;")}function d(t){return t.replace(M,"&amp;$1").replace(R,"&lt;").replace(P,"&gt;")}function n(t){var r={z:t.z||t.cdata,A:t.A||t.comment,B:t.B||t.endDoc,t:t.t||t.endTag,e:t.e||t.pcdata,F:t.F||t.rcdata,H:t.H||t.startDoc,w:t.w||t.startTag};return function(t,e){var n=/(<\/|<\!--|<[!?]|[&<>])/g,i=t+"";if(N)i=i.split(n);else{for(var l,s=[],o=0;(l=n.exec(i))!==F;)s.push(i.substring(o,l.index)),s.push(l[0]),o=l.index+l[0].length;s.push(i.substring(o)),i=s}a(r,i,0,{r:B,C:B},e)}}function v(t,e,n,i,l){return function(){a(t,e,n,i,l)}}function a(t,e,n,i,l){try{t.H&&0==n&&t.H(l);for(var s,o,r,a=e.length;n<a;){var h,d,u,p,m,c,g,x,y=e[n++],f=e[n];switch(y){case"&":L.test(f)?(t.e&&t.e("&"+f,l,_,v(t,e,n,i,l)),n++):t.e&&t.e("&amp;",l,_,v(t,e,n,i,l));break;case"</":(s=/^([-\w:]+)[^\'\"]*/.exec(f))?s[0].length===f.length&&">"===e[n+1]?(n+=2,r=s[1].toLowerCase(),t.t&&t.t(r,l,_,v(t,e,n,i,l))):(m=t,c=l,g=_,h=i,n=(d=S(u=e,p=n))?(m.t&&m.t(d.name,c,g,v(m,u,p,h,c)),d.next):u.length):t.e&&t.e("&lt;/",l,_,v(t,e,n,i,l));break;case"<":(s=/^([-\w:]+)\s*\/?/.exec(f))?s[0].length===f.length&&">"===e[n+1]?(n+=2,r=s[1].toLowerCase(),t.w&&t.w(r,[],l,_,v(t,e,n,i,l)),(d=C.f[r])&H&&(n=E(e,{name:r,next:n,c:d},t,l,_,i))):(p=t,m=l,c=_,g=i,n=(x=S(u=e,n))?(p.w&&p.w(x.name,x.R,m,c,v(p,u,x.next,g,m)),x.c&H?E(u,x,p,m,c,g):x.next):u.length):t.e&&t.e("&lt;",l,_,v(t,e,n,i,l));break;case"\x3c!--":if(!i.C){for(o=n+1;o<a&&(">"!==e[o]||!/--$/.test(e[o-1]));o++);o<a?(t.A&&(x=e.slice(n,o).join(""),t.A(x.substr(0,x.length-2),l,_,v(t,e,o+1,i,l))),n=o+1):i.C=V}i.C&&t.e&&t.e("&lt;!--",l,_,v(t,e,n,i,l));break;case"<!":if(/^\w/.test(f)){if(!i.r){for(o=n+1;o<a&&">"!==e[o];o++);o<a?n=o+1:i.r=V}i.r&&t.e&&t.e("&lt;!",l,_,v(t,e,n,i,l))}else t.e&&t.e("&lt;!",l,_,v(t,e,n,i,l));break;case"<?":if(!i.r){for(o=n+1;o<a&&">"!==e[o];o++);o<a?n=o+1:i.r=V}i.r&&t.e&&t.e("&lt;?",l,_,v(t,e,n,i,l));break;case">":t.e&&t.e("&gt;",l,_,v(t,e,n,i,l));break;case"":break;default:t.e&&t.e(y,l,_,v(t,e,n,i,l))}}t.B&&t.B(l)}catch(t){if(t!==_)throw t}}function E(t,e,n,i,l,s){var o=t.length;D.hasOwnProperty(e.name)||(D[e.name]=RegExp("^"+e.name+"(?:[\\s\\/]|$)","i"));for(var r=D[e.name],a=e.next,h=e.next+1;h<o&&("</"!==t[h-1]||!r.test(t[h]));h++);if(h<o&&--h,o=t.slice(a,h).join(""),e.c&C.c.CDATA)n.z&&n.z(o,i,l,v(n,t,h,s,i));else{if(!(e.c&C.c.RCDATA))throw Error("bug");n.F&&n.F(d(o),i,l,v(n,t,h,s,i))}return h}function S(t,e){var n=/^([-\w:]+)/.exec(t[e]),i={};i.name=n[1].toLowerCase(),i.c=C.f[i.name];for(var l=t[e].substr(n[0].length),s=e+1,o=t.length;s<o&&">"!==t[s];s++)l+=t[s];if(!(o<=s)){for(var r=[];""!==l;)if(n=U.exec(l))if(n[4]&&!n[5]||n[6]&&!n[7]){for(var n=n[4]||n[6],a=B,l=[l,t[s++]];s<o;s++){if(a){if(">"===t[s])break}else 0<=t[s].indexOf(n)&&(a=V);l.push(t[s])}if(o<=s)break;l=l.join("")}else{var h,a=n[1].toLowerCase(),d=n[2]?(34!==(h=(d=n[3]).charCodeAt(0))&&39!==h||(d=d.substr(1,d.length-2)),u(d.replace(T,""))):"";r.push(a,d),l=l.substr(n[0].length)}else l=l.replace(/^[\s\S][^a-z\s]*/,"");return i.R=r,i.next=s+1,i}}function i(h){function t(t,e){u||e.push(t)}var d,u;return n({startDoc:function(){d=[],u=B},startTag:function(t,e,n){if(!u&&C.f.hasOwnProperty(t)){var i=C.f[t];if(!(i&C.c.FOLDABLE)){var l,s,o=h(t,e);if(o){if("object"!=typeof o)throw Error("tagPolicy did not return object (old API?)");if(!("attribs"in o))throw Error("tagPolicy gave no attribs");e=o.attribs,o="tagName"in o?(l=o.tagName,C.f[l]):(l=t,i),i&C.c.OPTIONAL_ENDTAG&&(!(s=d[d.length-1])||s.D!==t||s.v===l&&t===l||n.push("</",s.v,">")),i&C.c.EMPTY||d.push({D:t,v:l}),n.push("<",l),t=0;for(s=e.length;t<s;t+=2){var r=e[t],a=e[t+1];a!==F&&a!==k&&n.push(" ",r,'="',p(a),'"')}n.push(">"),i&C.c.EMPTY&&!(o&C.c.EMPTY)&&n.push("</",l,">")}else u=!(i&C.c.EMPTY)}}},endTag:function(t,e){if(u)u=B;else if(C.f.hasOwnProperty(t)){var n=C.f[t];if(!(n&(C.c.EMPTY|C.c.FOLDABLE))){if(n&C.c.OPTIONAL_ENDTAG)for(n=d.length;0<=--n;){var i=d[n].D;if(i===t)break;if(!(C.f[i]&C.c.OPTIONAL_ENDTAG))return}else for(n=d.length;0<=--n&&d[n].D!==t;);if(!(n<0)){for(i=d.length;--i>n;){var l=d[i].v;C.f[l]&C.c.OPTIONAL_ENDTAG||e.push("</",l,">")}n<d.length&&(t=d[n].v),d.length=n,e.push("</",t,">")}}}},pcdata:t,rcdata:t,cdata:t,endDoc:function(t){for(;d.length;d.length--)t.push("</",d[d.length-1].v,">")}})}function m(t,e,n,i,l){if(!l)return F;try{var s=z.parse(""+t);if(s&&(!s.K()||G.test(s.W()))){s=l(s,e,n,i);return s?s.toString():F}}catch(t){}return F}function c(t,e,n,i,l){var s;n||t(e+" removed",{S:"removed",tagName:e}),i!==l&&(s="changed",i&&!l?s="removed":!i&&l&&(s="added"),t(e+"."+n+" "+s,{S:s,tagName:e,la:n,oldValue:i,newValue:l}))}function g(t,e,n){return e=e+"::"+n,t.hasOwnProperty(e)?t[e]:(e="*::"+n,t.hasOwnProperty(e)?t[e]:void 0)}function s(t,e,i,n,l){for(var s=0;s<e.length;s+=2){var o=e[s],r=e[s+1],a=r,h=F,d=t+"::"+o;if((C.m.hasOwnProperty(d)||(d="*::"+o,C.m.hasOwnProperty(d)))&&(h=C.m[d]),h!==F)switch(h){case C.d.NONE:break;case C.d.SCRIPT:r=F,l&&c(l,t,o,a,r);break;case C.d.STYLE:if(void 0===x){r=F,l&&c(l,t,o,a,r);break}var u=[];x(r,{declaration:function(t,e){var n=t.toLowerCase();y(n,e,i?function(t){return m(t,C.P.ja,C.M.ka,{TYPE:"CSS",CSS_PROP:n},i)}:F),e.length&&u.push(n+": "+e.join(" "))}}),r=0<u.length?u.join(" ; "):F,l&&c(l,t,o,a,r);break;case C.d.ID:case C.d.IDREF:case C.d.IDREFS:case C.d.GLOBAL_NAME:case C.d.LOCAL_NAME:case C.d.CLASSES:r=n?n(r):r,l&&c(l,t,o,a,r);break;case C.d.URI:r=m(r,g(C.J,t,o),g(C.I,t,o),{TYPE:"MARKUP",XML_ATTR:o,XML_TAG:t},i),l&&c(l,t,o,a,r);break;case C.d.URI_FRAGMENT:r&&"#"===r.charAt(0)?(r=r.substring(1),(r=n?n(r):r)!==F&&r!==k&&(r="#"+r)):r=F,l&&c(l,t,o,a,r);break;default:r=F,l&&c(l,t,o,a,r)}else r=F,l&&c(l,t,o,a,r);e[s+1]=r}return e}function l(n,i,l){return function(t,e){if(!(C.f[t]&C.c.UNSAFE))return{attribs:s(t,e,n,i,l)};l&&c(l,t,k,k,k)}}function o(t,e){var n=[];return i(e)(t,n),n.join("")}var x,y;"undefined"!=typeof window&&(x=window.parseCssDeclarations,y=window.sanitizeCssProperty);var r={lt:"<",LT:"<",gt:">",GT:">",amp:"&",AMP:"&",quot:'"',apos:"'",nbsp:" "},h=/^#(\d+)$/,f=/^#x([0-9A-Fa-f]+)$/,w=/^[A-Za-z][A-za-z0-9]+$/,b="undefined"!=typeof window&&window.document?window.document.createElement("textarea"):F,T=/\0/g,A=/&(#[0-9]+|#[xX][0-9A-Fa-f]+|\w+);/g,L=/^(#[0-9]+|#[xX][0-9A-Fa-f]+|\w+);/,I=/&/g,M=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,R=/[<]/g,P=/>/g,O=/\"/g,U=/^\s*([-.:\w]+)(?:\s*(=)\s*((")[^"]*("|$)|(')[^']*('|$)|(?=[a-z][-\w]*\s*=)|[^"'\s]*))?/i,N=3==="a,b".split(/(,)/).length,H=C.c.CDATA|C.c.RCDATA,_={},D={},G=/^(?:https?|mailto|data)$/i,t={};return t.pa=t.escapeAttrib=p,t.ra=t.makeHtmlSanitizer=i,t.sa=t.makeSaxParser=n,t.ta=t.makeTagPolicy=l,t.wa=t.normalizeRCData=d,t.xa=t.sanitize=function(t,e,n,i){return o(t,l(e,n,i))},t.ya=t.sanitizeAttribs=s,t.za=t.sanitizeWithPolicy=o,t.Ba=t.unescapeEntities=u,t}(S),c=r.sanitize;"undefined"!=typeof window&&(window.html=r,window.html_sanitize=c)}();var mxClient={VERSION:"4.2.2",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&navigator.userAgent.indexOf("MSIE")<0&&navigator.userAgent.indexOf("Edge/")<0,IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&navigator.userAgent.indexOf("Presto/2.4.")<0&&navigator.userAgent.indexOf("Presto/2.3.")<0&&navigator.userAgent.indexOf("Presto/2.2.")<0&&navigator.userAgent.indexOf("Presto/2.1.")<0&&navigator.userAgent.indexOf("Presto/2.0.")<0&&navigator.userAgent.indexOf("Presto/1.")<0,IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:"undefined"!=typeof InstallTrigger,IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&navigator.userAgent.indexOf("Firefox/1.")<0&&navigator.userAgent.indexOf("Firefox/2.")<0||0<=navigator.userAgent.indexOf("Iceweasel/")&&navigator.userAgent.indexOf("Iceweasel/1.")<0&&navigator.userAgent.indexOf("Iceweasel/2.")<0||0<=navigator.userAgent.indexOf("SeaMonkey/")&&navigator.userAgent.indexOf("SeaMonkey/1.")<0||0<=navigator.userAgent.indexOf("Iceape/")&&navigator.userAgent.indexOf("Iceape/1.")<0,IS_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!=document.createElementNS("http://www.w3.org/2000/svg","foreignObject")||0<=navigator.userAgent.indexOf("Opera/"),IS_WIN:0<navigator.appVersion.indexOf("Win"),IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:null!=window.PointerEvent&&!(0<navigator.appVersion.indexOf("Mac")),IS_LOCAL:document.location.href.indexOf("http://")<0&&document.location.href.indexOf("https://")<0,defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(t,e,n,i){var l;n=n||document,mxClient.IS_IE6?n.write('<link rel="'+t+'" href="'+e+'" charset="UTF-8" type="text/css"/>'):((l=n.createElement("link")).setAttribute("rel",t),l.setAttribute("href",e),l.setAttribute("charset","UTF-8"),l.setAttribute("type","text/css"),i&&l.setAttribute("id",i),n.getElementsByTagName("head")[0].appendChild(l))},loadResources:function(t,e){var n=mxClient.defaultBundles.length;function i(){0==--n&&t()}for(var l=0;l<mxClient.defaultBundles.length;l++)mxResources.add(mxClient.defaultBundles[l],e,i)},include:function(t){document.write('<script src="'+t+'"><\/script>')}};"undefined"==typeof mxLoadResources&&(window.mxLoadResources=!0),"undefined"==typeof mxForceIncludes&&(window.mxForceIncludes=!1),"undefined"==typeof mxResourceExtension&&(window.mxResourceExtension=".txt"),"undefined"==typeof mxLoadStylesheets&&(window.mxLoadStylesheets=!0),mxClient.basePath=window.mxBasePath||".","undefined"!=typeof mxImageBasePath&&0<mxImageBasePath.length?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images","undefined"!=typeof mxLanguage&&null!=mxLanguage?mxClient.language=mxLanguage:mxClient.language=mxClient.IS_IE?navigator.userLanguage:navigator.language,"undefined"!=typeof mxDefaultLanguage&&null!=mxDefaultLanguage?mxClient.defaultLanguage=mxDefaultLanguage:mxClient.defaultLanguage="en","undefined"!=typeof mxLanguages&&null!=mxLanguages&&(mxClient.languages=mxLanguages),mxClient.IS_VML&&(mxClient.IS_SVG?mxClient.IS_VML=!1:(null!=document.namespaces&&(8==document.documentMode?(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office"))),mxClient.IS_QUIRKS&&30<=document.styleSheets.length?function(){var t=document.createElement("style");t.type="text/css",t.styleSheet.cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",document.getElementsByTagName("head")[0].appendChild(t)}():document.createStyleSheet().cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}"));var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){var t,e,n,i,l,s;null==mxLog.window&&null!=document.body&&(t=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,(e=document.createElement("table")).setAttribute("width","100%"),e.setAttribute("height","100%"),s=document.createElement("tbody"),l=document.createElement("tr"),(n=document.createElement("td")).style.verticalAlign="top",mxLog.textarea=document.createElement("textarea"),mxLog.textarea.setAttribute("wrap","off"),mxLog.textarea.setAttribute("readOnly","true"),mxLog.textarea.style.height="100%",mxLog.textarea.style.resize="none",mxLog.textarea.value=mxLog.buffer,mxClient.IS_NS&&"BackCompat"!=document.compatMode?mxLog.textarea.style.width="99%":mxLog.textarea.style.width="100%",n.appendChild(mxLog.textarea),l.appendChild(n),s.appendChild(l),l=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),l.appendChild(mxLog.td),s.appendChild(l),e.appendChild(s),mxLog.addButton("Info",function(t){mxLog.info()}),mxLog.addButton("DOM",function(t){var e=mxUtils.getInnerHtml(document.body);mxLog.debug(e)}),mxLog.addButton("Trace",function(t){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")}),mxLog.addButton("Copy",function(t){try{mxUtils.copy(mxLog.textarea.value)}catch(t){mxUtils.alert(t)}}),mxLog.addButton("Show",function(t){try{mxUtils.popup(mxLog.textarea.value)}catch(t){mxUtils.alert(t)}}),mxLog.addButton("Clear",function(t){mxLog.textarea.value=""}),s=l=0,s="number"==typeof window.innerWidth?(l=window.innerHeight,window.innerWidth):(l=document.documentElement.clientHeight||document.body.clientHeight,document.body.clientWidth),mxLog.window=new mxWindow(t,e,Math.max(0,s-320),Math.max(0,l-210),300,160),mxLog.window.setMaximizable(!0),mxLog.window.setScrollable(!1),mxLog.window.setResizable(!0),mxLog.window.setClosable(!0),mxLog.window.destroyOnClose=!1,(!mxClient.IS_NS&&!mxClient.IS_IE||mxClient.IS_GC||mxClient.IS_SF||"BackCompat"==document.compatMode)&&11!=document.documentMode||(i=mxLog.window.getElement(),l=function(t,e){mxLog.textarea.style.height=Math.max(0,i.offsetHeight-70)+"px"},mxLog.window.addListener(mxEvent.RESIZE_END,l),mxLog.window.addListener(mxEvent.MAXIMIZE,l),mxLog.window.addListener(mxEvent.NORMALIZE,l),mxLog.textarea.style.height="92px"))},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(t,e){var n=document.createElement("button");mxUtils.write(n,t),mxEvent.addListener(n,"click",e),mxLog.td.appendChild(n)},isVisible:function(){return null!=mxLog.window&&mxLog.window.isVisible()},show:function(){mxLog.setVisible(!0)},setVisible:function(t){null==mxLog.window&&mxLog.init(),null!=mxLog.window&&mxLog.window.setVisible(t)},enter:function(t){if(mxLog.TRACE)return mxLog.writeln("Entering "+t),(new Date).getTime()},leave:function(t,e){mxLog.TRACE&&(e=0!=e?" ("+((new Date).getTime()-e)+" ms)":"",mxLog.writeln("Leaving "+t+e))},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var t="",e=0;e<arguments.length;e++)t+=arguments[e],e<arguments.length-1&&(t+=" ");null!=mxLog.textarea?(mxLog.textarea.value=mxLog.textarea.value+t,null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/2.5")&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=t},writeln:function(){for(var t="",e=0;e<arguments.length;e++)t+=arguments[e],e<arguments.length-1&&(t+=" ");mxLog.write(t+"\n")}},mxObjectIdentity={FIELD_NAME:"mxObjectId",counter:0,get:function(t){return null==t?null:(null==t[mxObjectIdentity.FIELD_NAME]&&("object"==typeof t?(e=mxUtils.getFunctionName(t.constructor),t[mxObjectIdentity.FIELD_NAME]=e+"#"+mxObjectIdentity.counter++):"function"==typeof t&&(t[mxObjectIdentity.FIELD_NAME]="Function#"+mxObjectIdentity.counter++)),t[mxObjectIdentity.FIELD_NAME]);var e},clear:function(t){"object"!=typeof t&&"function"!=typeof t||delete t[mxObjectIdentity.FIELD_NAME]}};function mxDictionary(){this.clear()}mxDictionary.prototype.map=null,mxDictionary.prototype.clear=function(){this.map={}},mxDictionary.prototype.get=function(t){t=mxObjectIdentity.get(t);return this.map[t]},mxDictionary.prototype.put=function(t,e){var n=mxObjectIdentity.get(t),t=this.map[n];return this.map[n]=e,t},mxDictionary.prototype.remove=function(t){var e=mxObjectIdentity.get(t),t=this.map[e];return delete this.map[e],t},mxDictionary.prototype.getKeys=function(){var t,e=[];for(t in this.map)e.push(t);return e},mxDictionary.prototype.getValues=function(){var t,e=[];for(t in this.map)e.push(this.map[t]);return e},mxDictionary.prototype.visit=function(t){for(var e in this.map)t(e,this.map[e])};var mxResources={resources:{},extension:mxResourceExtension,resourcesEncoded:!1,loadDefaultBundle:!0,loadSpecialBundle:!0,isLanguageSupported:function(t){return null==mxClient.languages||0<=mxUtils.indexOf(mxClient.languages,t)},getDefaultBundle:function(t,e){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(e)?t+mxResources.extension:null},getSpecialBundle:function(t,e){var n;return null!=mxClient.languages&&this.isLanguageSupported(e)||0<(n=e.indexOf("-"))&&(e=e.substring(0,n)),mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(e)&&e!=mxClient.defaultLanguage?t+"_"+e+mxResources.extension:null},add:function(t,e,n){if((e=null!=e?e:null!=mxClient.language?mxClient.language.toLowerCase():mxConstants.NONE)!=mxConstants.NONE){function i(){if(null!=s)if(n)mxUtils.get(s,function(t){mxResources.parse(t.getText()),n()},function(){n()});else try{var t=mxUtils.load(s);t.isReady()&&mxResources.parse(t.getText())}catch(t){}else null!=n&&n()}var l=mxResources.getDefaultBundle(t,e),s=mxResources.getSpecialBundle(t,e);if(null!=l)if(n)mxUtils.get(l,function(t){mxResources.parse(t.getText()),i()},function(){i()});else try{var o=mxUtils.load(l);o.isReady()&&mxResources.parse(o.getText()),i()}catch(t){}else i()}},parse:function(t){if(null!=t)for(var e,n,i,l=t.split("\n"),s=0;s<l.length;s++)"#"==l[s].charAt(0)||0<(e=l[s].indexOf("="))&&(n=l[s].substring(0,e),i=l[s].length,13==l[s].charCodeAt(i-1)&&i--,i=l[s].substring(e+1,i),this.resourcesEncoded?(i=i.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[n]=unescape(i)):mxResources.resources[n]=i)},get:function(t,e,n){t=mxResources.resources[t];return null==t&&(t=n),null!=t&&null!=e&&(t=mxResources.replacePlaceholders(t,e)),t},replacePlaceholders:function(t,e){for(var n=[],i=null,l=0;l<t.length;l++){var s=t.charAt(l);"{"==s?i="":null!=i&&"}"==s?(0<=(i=parseInt(i)-1)&&i<e.length&&n.push(e[i]),i=null):null!=i?i+=s:n.push(s)}return n.join("")},loadResources:function(t){mxResources.add(mxClient.basePath+"/resources/graph",null,function(){})}};function mxPoint(t,e){this.x=null!=t?t:0,this.y=null!=e?e:0}function mxRectangle(t,e,n,i){mxPoint.call(this,t,e),this.width=null!=n?n:0,this.height=null!=i?i:0}mxPoint.prototype.x=null,mxPoint.prototype.y=null,mxPoint.prototype.equals=function(t){return null!=t&&t.x==this.x&&t.y==this.y},mxPoint.prototype.clone=function(){return mxUtils.clone(this)},mxRectangle.prototype=new mxPoint,mxRectangle.prototype.constructor=mxRectangle,mxRectangle.prototype.width=null,mxRectangle.prototype.height=null,mxRectangle.prototype.setRect=function(t,e,n,i){this.x=t,this.y=e,this.width=n,this.height=i},mxRectangle.prototype.getCenterX=function(){return this.x+this.width/2},mxRectangle.prototype.getCenterY=function(){return this.y+this.height/2},mxRectangle.prototype.add=function(t){var e,n,i;null!=t&&(e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),i=Math.max(this.x+this.width,t.x+t.width),t=Math.max(this.y+this.height,t.y+t.height),this.x=e,this.y=n,this.width=i-e,this.height=t-n)},mxRectangle.prototype.intersect=function(t){var e,n,i,l;null!=t&&(e=this.x+this.width,n=t.x+t.width,i=this.y+this.height,l=t.y+t.height,this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.width=Math.min(e,n)-this.x,this.height=Math.min(i,l)-this.y)},mxRectangle.prototype.grow=function(t){return this.x-=t,this.y-=t,this.width+=2*t,this.height+=2*t,this},mxRectangle.prototype.getPoint=function(){return new mxPoint(this.x,this.y)},mxRectangle.prototype.rotate90=function(){var t=(this.width-this.height)/2;this.x+=t,this.y-=t;t=this.width;this.width=this.height,this.height=t},mxRectangle.prototype.equals=function(t){return null!=t&&t.x==this.x&&t.y==this.y&&t.width==this.width&&t.height==this.height},mxRectangle.fromRectangle=function(t){return new mxRectangle(t.x,t.y,t.width,t.height)};var mxEffects={animateChanges:function(a,h,d){var u=0,p=function(){for(var t=!1,e=0;e<h.length;e++){var n,i,l,s,o,r=h[e];!(r instanceof mxGeometryChange||r instanceof mxTerminalChange||r instanceof mxValueChange||r instanceof mxChildChange||r instanceof mxStyleChange)||null!=(n=a.getView().getState(r.cell||r.child,!1))&&(t=!0,r.constructor!=mxGeometryChange||a.model.isEdge(r.cell)?mxUtils.setOpacity(n.shape.node,100*u/10):(o=a.getView().scale,i=(r.geometry.x-r.previous.x)*o,l=(r.geometry.y-r.previous.y)*o,s=(r.geometry.width-r.previous.width)*o,o=(r.geometry.height-r.previous.height)*o,0==u?(n.x-=i,n.y-=l,n.width-=s,n.height-=o):(n.x+=i/10,n.y+=l/10,n.width+=s/10,n.height+=o/10),a.cellRenderer.redraw(n),mxEffects.cascadeOpacity(a,r.cell,100*u/10)))}u<10&&t?(u++,window.setTimeout(p,m)):null!=d&&d()},m=30;p()},cascadeOpacity:function(t,e,n){for(var i=t.model.getChildCount(e),l=0;l<i;l++){var s=t.model.getChildAt(e,l),o=t.getView().getState(s);null!=o&&(mxUtils.setOpacity(o.shape.node,n),mxEffects.cascadeOpacity(t,s,n))}var r=t.model.getEdges(e);if(null!=r)for(l=0;l<r.length;l++){var a=t.getView().getState(r[l]);null!=a&&mxUtils.setOpacity(a.shape.node,n)}},fadeOut:function(t,e,n,i,l,s){i=i||40,l=l||30;var o,r=e||100;mxUtils.setOpacity(t,r),s||null==s?(o=function(){r=Math.max(r-i,0),mxUtils.setOpacity(t,r),0<r?window.setTimeout(o,l):(t.style.visibility="hidden",n&&t.parentNode&&t.parentNode.removeChild(t))},window.setTimeout(o,l)):(t.style.visibility="hidden",n&&t.parentNode&&t.parentNode.removeChild(t))}},mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(t){null!=t.style&&(t.style.cursor="");var e=t.childNodes;if(null!=e)for(var n=e.length,i=0;i<n;i+=1)mxUtils.removeCursors(e[i])},getCurrentStyle:mxClient.IS_IE&&(null==document.documentMode||document.documentMode<9)?function(t){return null!=t?t.currentStyle:null}:function(t){return null!=t?window.getComputedStyle(t,""):null},parseCssNumber:function(t){return"thin"==t?t="2":"medium"==t?t="4":"thick"==t&&(t="6"),t=parseFloat(t),isNaN(t)&&(t=0),t},setPrefixedStyle:function(){var i=null;return mxClient.IS_OT?i="O":mxClient.IS_SF||mxClient.IS_GC?i="Webkit":mxClient.IS_MT?i="Moz":mxClient.IS_IE&&9<=document.documentMode&&document.documentMode<10&&(i="ms"),function(t,e,n){t[e]=n,null!=i&&0<e.length&&(t[e=i+e.substring(0,1).toUpperCase()+e.substring(1)]=n)}}(),hasScrollbars:function(t){t=mxUtils.getCurrentStyle(t);return null!=t&&("scroll"==t.overflow||"auto"==t.overflow)},bind:function(t,e){return function(){return e.apply(t,arguments)}},eval:function(expr){var result=null;if(0<=expr.indexOf("function"))try{eval("var _mxJavaScriptExpression="+expr),result=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(e){mxLog.warn(e.message+" while evaluating "+expr)}else try{result=eval(expr)}catch(e){mxLog.warn(e.message+" while evaluating "+expr)}return result},findNode:function(t,e,n){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var i=t.getAttribute(e);if(null!=i&&i==n)return t}for(t=t.firstChild;null!=t;){var l=mxUtils.findNode(t,e,n);if(null!=l)return l;t=t.nextSibling}return null},getFunctionName:function(t){var e=null;return null!=t&&(null!=t.name?e=t.name:(e=mxUtils.trim(t.toString()),!/^function\s/.test(e)||0<(t=(e=mxUtils.ltrim(e.substring(9))).indexOf("("))&&(e=e.substring(0,t)))),e},indexOf:function(t,e){if(null!=t&&null!=e)for(var n=0;n<t.length;n++)if(t[n]==e)return n;return-1},forEach:function(t,e){if(null!=t&&null!=e)for(var n=0;n<t.length;n++)e(t[n]);return t},remove:function(t,e){var n,i=null;if("object"==typeof e)for(var l=mxUtils.indexOf(e,t);0<=l;)e.splice(l,1),i=t,l=mxUtils.indexOf(e,t);for(n in e)e[n]==t&&(delete e[n],i=t);return i},isNode:function(t,e,n,i){return!(null==t||isNaN(t.nodeType)||null!=e&&t.nodeName.toLowerCase()!=e.toLowerCase())&&(null==n||t.getAttribute(n)==i)},isAncestorNode:function(t,e){for(var n=e;null!=n;){if(n==t)return!0;n=n.parentNode}return!1},getChildNodes:function(t,e){e=e||mxConstants.NODETYPE_ELEMENT;for(var n=[],i=t.firstChild;null!=i;)i.nodeType==e&&n.push(i),i=i.nextSibling;return n},importNode:function(t,e,n){return mxClient.IS_IE&&(null==document.documentMode||document.documentMode<10)?mxUtils.importNodeImplementation(t,e,n):t.importNode(e,n)},importNodeImplementation:function(t,e,n){switch(e.nodeType){case 1:var i=t.createElement(e.nodeName);if(e.attributes&&0<e.attributes.length)for(var l=0;l<e.attributes.length;l++)i.setAttribute(e.attributes[l].nodeName,e.getAttribute(e.attributes[l].nodeName));if(n&&e.childNodes&&0<e.childNodes.length)for(l=0;l<e.childNodes.length;l++)i.appendChild(mxUtils.importNodeImplementation(t,e.childNodes[l],n));return i;case 3:case 4:case 8:return t.createTextNode(null!=e.nodeValue?e.nodeValue:e.value)}},createXmlDocument:function(){var t=null;return document.implementation&&document.implementation.createDocument?t=document.implementation.createDocument("","",null):"ActiveXObject"in window&&(t=mxUtils.createMsXmlDocument()),t},createMsXmlDocument:function(){var t=new ActiveXObject("Microsoft.XMLDOM");return t.async=!1,t.validateOnParse=!1,t.resolveExternals=!1,t},parseXml:window.DOMParser?function(t){return(new DOMParser).parseFromString(t,"text/xml")}:function(t){var e=mxUtils.createMsXmlDocument();return e.loadXML(t),e},clearSelection:document.selection?function(){document.selection.empty()}:window.getSelection?function(){window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges()}:function(){},removeWhitespace:function(t,e){for(var n=e?t.previousSibling:t.nextSibling;null!=n&&n.nodeType==mxConstants.NODETYPE_TEXT;){var i=e?n.previousSibling:n.nextSibling,l=mxUtils.getTextContent(n);0==mxUtils.trim(l).length&&n.parentNode.removeChild(n),n=i}},htmlEntities:function(t,e){return t=(t=(t=(t=(t=(t=String(t||"")).replace(/&/g,"&amp;")).replace(/"/g,"&quot;")).replace(/\'/g,"&#39;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;"),null!=e&&!e||(t=t.replace(/\n/g,"&#xa;")),t},isVml:function(t){return null!=t&&"urn:schemas-microsoft-com:vml"==t.tagUrn},getXml:function(t,e){var n="";return mxClient.IS_IE||mxClient.IS_IE11?n=mxUtils.getPrettyXml(t,"","",""):null!=window.XMLSerializer?n=(new XMLSerializer).serializeToString(t):null!=t.xml&&(n=t.xml.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,"\n")),e=e||"&#xa;",n=n.replace(/\n/g,e)},getPrettyXml:function(t,e,n,i,l){var s,o=[];if(null!=t)if(e=null!=e?e:" ",n=null!=n?n:"",i=null!=i?i:"\n",null!=t.namespaceURI&&t.namespaceURI!=l&&(l=t.namespaceURI,null==t.getAttribute("xmlns")&&t.setAttribute("xmlns",t.namespaceURI)),t.nodeType==mxConstants.NODETYPE_DOCUMENT)o.push(mxUtils.getPrettyXml(t.documentElement,e,n,i,l));else if(t.nodeType==mxConstants.NODETYPE_DOCUMENT_FRAGMENT){if(null!=(r=t.firstChild))for(;null!=r;)o.push(mxUtils.getPrettyXml(r,e,n,i,l)),r=r.nextSibling}else if(t.nodeType==mxConstants.NODETYPE_COMMENT)0<(s=mxUtils.getTextContent(t)).length&&o.push(n+"\x3c!--"+s+"--\x3e"+i);else if(t.nodeType==mxConstants.NODETYPE_TEXT)0<(s=mxUtils.trim(mxUtils.getTextContent(t))).length&&o.push(n+mxUtils.htmlEntities(s,!1)+i);else if(t.nodeType==mxConstants.NODETYPE_CDATA)0<(s=mxUtils.getTextContent(t)).length&&o.push(n+"<![CDATA["+s+"]]"+i);else{o.push(n+"<"+t.nodeName);var r,a=t.attributes;if(null!=a)for(var h=0;h<a.length;h++){var d=mxUtils.htmlEntities(a[h].value);o.push(" "+a[h].nodeName+'="'+d+'"')}if(null!=(r=t.firstChild)){for(o.push(">"+i);null!=r;)o.push(mxUtils.getPrettyXml(r,e,n+e,i,l)),r=r.nextSibling;o.push(n+"</"+t.nodeName+">"+i)}else o.push(" />"+i)}return o.join("")},extractTextWithWhitespace:function(t){var l=["BLOCKQUOTE","DIV","H1","H2","H3","H4","H5","H6","OL","P","PRE","TABLE","UL"],s=[];return function t(e){if(1!=e.length||"BR"!=e[0].nodeName&&"\n"!=e[0].innerHTML)for(var n=0;n<e.length;n++){var i=e[n];"BR"==i.nodeName||"\n"==i.innerHTML||(1==e.length||0==n)&&"DIV"==i.nodeName&&"<br>"==i.innerHTML.toLowerCase()?s.push("\n"):(3===i.nodeType||4===i.nodeType?0<i.nodeValue.length&&s.push(i.nodeValue):8!==i.nodeType&&0<i.childNodes.length&&t(i.childNodes),n<e.length-1&&0<=mxUtils.indexOf(l,e[n+1].nodeName)&&s.push("\n"))}}(t),s.join("")},replaceTrailingNewlines:function(t,e){for(var n="";0<t.length&&"\n"==t.charAt(t.length-1);)t=t.substring(0,t.length-1),n+=e;return t+n},getTextContent:function(t){return mxClient.IS_IE&&void 0!==t.innerText?t.innerText:null!=t?t[void 0===t.textContent?"text":"textContent"]:""},setTextContent:function(t,e){void 0!==t.innerText?t.innerText=e:t[void 0===t.textContent?"text":"textContent"]=e},getInnerHtml:mxClient.IS_IE?function(t){return null!=t?t.innerHTML:""}:function(t){return null==t?"":(new XMLSerializer).serializeToString(t)},getOuterHtml:mxClient.IS_IE?function(t){if(null==t)return"";if(null!=t.outerHTML)return t.outerHTML;var e=[];e.push("<"+t.nodeName);var n=t.attributes;if(null!=n)for(var i=0;i<n.length;i++){var l=n[i].value;null!=l&&0<l.length&&(e.push(" "),e.push(n[i].nodeName),e.push('="'),e.push(l),e.push('"'))}return 0==t.innerHTML.length?e.push("/>"):(e.push(">"),e.push(t.innerHTML),e.push("</"+t.nodeName+">")),e.join("")}:function(t){return null==t?"":(new XMLSerializer).serializeToString(t)},write:function(t,e){e=t.ownerDocument.createTextNode(e);return null!=t&&t.appendChild(e),e},writeln:function(t,e){e=t.ownerDocument.createTextNode(e);return null!=t&&(t.appendChild(e),t.appendChild(document.createElement("br"))),e},br:function(t,e){e=e||1;for(var n=null,i=0;i<e;i++)null!=t&&(n=t.ownerDocument.createElement("br"),t.appendChild(n));return n},button:function(t,e,n){n=(n=null!=n?n:document).createElement("button");return mxUtils.write(n,t),mxEvent.addListener(n,"click",function(t){e(t)}),n},para:function(t,e){var n=document.createElement("p");return mxUtils.write(n,e),null!=t&&t.appendChild(n),n},addTransparentBackgroundFilter:function(t){t.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mxClient.imageBasePath+"/transparent.gif', sizingMethod='scale')"},linkAction:function(t,e,n,i,l){return mxUtils.link(t,e,function(){n.execute(i)},l)},linkInvoke:function(t,e,n,i,l,s){return mxUtils.link(t,e,function(){n[i](l)},s)},link:function(t,e,n,i){var l=document.createElement("span");return l.style.color="blue",l.style.textDecoration="underline",l.style.cursor="pointer",null!=i&&(l.style.paddingLeft=i+"px"),mxEvent.addListener(l,"click",n),mxUtils.write(l,e),null!=t&&t.appendChild(l),l},getDocumentSize:function(){var t=document.body,e=document.documentElement;try{return new mxRectangle(0,0,t.clientWidth||e.clientWidth,Math.max(t.clientHeight||0,e.clientHeight))}catch(t){return new mxRectangle}},fit:function(t){var e=mxUtils.getDocumentSize(),n=parseInt(t.offsetLeft),i=parseInt(t.offsetWidth),l=mxUtils.getDocumentScrollOrigin(t.ownerDocument),s=l.x,o=l.y,l=(document.body,document.documentElement,s+e.width);l<n+i&&(t.style.left=Math.max(s,l-i)+"px");l=parseInt(t.offsetTop),i=parseInt(t.offsetHeight),e=o+e.height;e<l+i&&(t.style.top=Math.max(o,e-i)+"px")},load:function(t){t=new mxXmlRequest(t,null,"GET",!1);return t.send(),t},get:function(t,e,n,i,l,s,o){var t=new mxXmlRequest(t,null,"GET"),r=t.setRequestHeaders;return o&&(t.setRequestHeaders=function(t,e){for(var n in r.apply(this,arguments),o)t.setRequestHeader(n,o[n])}),null!=i&&t.setBinary(i),t.send(e,n,l,s),t},getAll:function(t,i,e){function l(){0==n&&null!=e&&e(),n++}for(var s=t.length,o=[],n=0,r=0;r<t.length;r++)!function(t,n){mxUtils.get(t,function(t){var e=t.getStatus();e<200||299<e?l():(o[n]=t,0==--s&&i(o))},l)}(t[r],r);0==s&&i(o)},post:function(t,e,n,i){return new mxXmlRequest(t,e).send(n,i)},submit:function(t,e,n,i){return new mxXmlRequest(t,e).simulate(n,i)},loadInto:function(t,e,n){mxClient.IS_IE?e.onreadystatechange=function(){4==e.readyState&&n()}:e.addEventListener("load",n,!1),e.load(t)},getValue:function(t,e,n){e=null!=t?t[e]:null;return null==e&&(e=n),e},getNumber:function(t,e,n){e=null!=t?t[e]:null;return null==e&&(e=n||0),Number(e)},getColor:function(t,e,n){e=null!=t?t[e]:null;return null==e?e=n:e==mxConstants.NONE&&(e=null),e},clone:function(t,e,n){n=null!=n&&n;var i=null;if(null!=t&&"function"==typeof t.constructor)for(var l in i=new t.constructor,t)l!=mxObjectIdentity.FIELD_NAME&&(null==e||mxUtils.indexOf(e,l)<0)&&(n||"object"!=typeof t[l]?i[l]=t[l]:i[l]=mxUtils.clone(t[l]));return i},equalPoints:function(t,e){if(null==t&&null!=e||null!=t&&null==e||null!=t&&null!=e&&t.length!=e.length)return!1;if(null!=t&&null!=e)for(var n=0;n<t.length;n++)if(null!=t[n]&&null==e[n]||null==t[n]&&null!=e[n]||null!=t[n]&&null!=e[n]&&(t[n].x!=e[n].x||t[n].y!=e[n].y))return!1;return!0},equalEntries:function(t,e){var n=0;if(null==t&&null!=e||null!=t&&null==e||null!=t&&null!=e&&t.length!=e.length)return!1;if(null!=t&&null!=e){for(var i in e)n++;for(var i in t)if(n--,!(mxUtils.isNaN(t[i])&&mxUtils.isNaN(e[i])||t[i]==e[i]))return!1}return 0==n},removeDuplicates:function(t){for(var e=new mxDictionary,n=[],i=0;i<t.length;i++)e.get(t[i])||(n.push(t[i]),e.put(t[i],!0));return n},isNaN:function(t){return"number"==typeof t&&isNaN(t)},extend:function(t,e){function n(){}n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t},toString:function(t){var e,n="";for(e in t)try{null==t[e]?n+=e+" = [null]\n":"function"==typeof t[e]?n+=e+" => [Function]\n":"object"==typeof t[e]?n+=e+" => ["+mxUtils.getFunctionName(t[e].constructor)+"]\n":n+=e+" = "+t[e]+"\n"}catch(t){n+=e+"="+t.message}return n},toRadians:function(t){return Math.PI*t/180},toDegree:function(t){return 180*t/Math.PI},arcToCurves:function(t,e,n,i,l,s,o,r,a){if(r-=t,a-=e,0===n||0===i)return U;var h=o,d=l;n=Math.abs(n),i=Math.abs(i);var u=-r/2,p=-a/2,m=Math.cos(d*Math.PI/180),c=Math.sin(d*Math.PI/180),g=m*u+c*p,x=-1*c*u+m*p,o=g*g,l=x*x,d=n*n,u=i*i,p=o/d+l/u,o=(u=1<p?(n=Math.sqrt(p)*n,i=Math.sqrt(p)*i,0):(s===h?-1:1)*Math.sqrt((d*u-d*l-u*o)/(d*l+u*o)))*n*x/i,u=-1*u*i*g/n,y=m*o-c*u+r/2,f=c*o+m*u+a/2,a=Math.atan2((x-u)/i,(g-o)/n)-Math.atan2(0,1),C=0<=a?a:2*Math.PI+a,a=0<=(a=Math.atan2((-x-u)/i,(-g-o)/n)-Math.atan2((x-u)/i,(g-o)/n))?a:2*Math.PI+a;0==h&&0<a?a-=2*Math.PI:0!=h&&a<0&&(a+=2*Math.PI);for(var v,E,h=2*a/Math.PI,S=Math.ceil(h<0?-1*h:h),w=a/S,b=8/3*Math.sin(w/4)*Math.sin(w/4)/Math.sin(w/2),T=m*n,A=m*i,L=c*n,I=c*i,M=Math.cos(C),R=Math.sin(C),P=-b*(T*R+I*M),O=-b*(L*R-A*M),U=[],N=0;N<S;++N){C+=w,v=T*(M=Math.cos(C))-I*(R=Math.sin(C))+y,E=L*M+A*R+f;var H=-b*(T*R+I*M),_=-b*(L*R-A*M),D=6*N;U[D]=Number(P+t),U[1+D]=Number(O+e),U[2+D]=Number(v-H+t),U[3+D]=Number(E-_+e),U[4+D]=Number(v+t),U[5+D]=Number(E+e),P=v+H,O=E+_}return U},getBoundingBox:function(t,e,n){var i,l,s,o,r=null;return null!=t&&null!=e&&0!=e&&(o=mxUtils.toRadians(e),i=Math.cos(o),l=Math.sin(o),n=null!=n?n:new mxPoint(t.x+t.width/2,t.y+t.height/2),s=new mxPoint(t.x,t.y),e=new mxPoint(t.x+t.width,t.y),o=new mxPoint(e.x,t.y+t.height),t=new mxPoint(t.x,o.y),s=mxUtils.getRotatedPoint(s,i,l,n),e=mxUtils.getRotatedPoint(e,i,l,n),o=mxUtils.getRotatedPoint(o,i,l,n),t=mxUtils.getRotatedPoint(t,i,l,n),(r=new mxRectangle(s.x,s.y,0,0)).add(new mxRectangle(e.x,e.y,0,0)),r.add(new mxRectangle(o.x,o.y,0,0)),r.add(new mxRectangle(t.x,t.y,0,0))),r},getRotatedPoint:function(t,e,n,i){i=null!=i?i:new mxPoint;var l=t.x-i.x,s=t.y-i.y,t=s*e+l*n;return new mxPoint(l*e-s*n+i.x,t+i.y)},getPortConstraints:function(t,e,n,i){n=mxUtils.getValue(t.style,mxConstants.STYLE_PORT_CONSTRAINT,mxUtils.getValue(e.style,n?mxConstants.STYLE_SOURCE_PORT_CONSTRAINT:mxConstants.STYLE_TARGET_PORT_CONSTRAINT,null));if(null==n)return i;var i=n.toString(),l=mxConstants.DIRECTION_MASK_NONE,n=0;1==mxUtils.getValue(t.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,0)&&(n=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0));t=0;if(45<n?t=135<=n?2:1:n<-45&&(t=n<=-135?2:3),0<=i.indexOf(mxConstants.DIRECTION_NORTH))switch(t){case 0:l|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:l|=mxConstants.DIRECTION_MASK_EAST;break;case 2:l|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:l|=mxConstants.DIRECTION_MASK_WEST}if(0<=i.indexOf(mxConstants.DIRECTION_WEST))switch(t){case 0:l|=mxConstants.DIRECTION_MASK_WEST;break;case 1:l|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:l|=mxConstants.DIRECTION_MASK_EAST;break;case 3:l|=mxConstants.DIRECTION_MASK_SOUTH}if(0<=i.indexOf(mxConstants.DIRECTION_SOUTH))switch(t){case 0:l|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:l|=mxConstants.DIRECTION_MASK_WEST;break;case 2:l|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:l|=mxConstants.DIRECTION_MASK_EAST}if(0<=i.indexOf(mxConstants.DIRECTION_EAST))switch(t){case 0:l|=mxConstants.DIRECTION_MASK_EAST;break;case 1:l|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:l|=mxConstants.DIRECTION_MASK_WEST;break;case 3:l|=mxConstants.DIRECTION_MASK_NORTH}return l},reversePortConstraints:function(t){var e=(t&mxConstants.DIRECTION_MASK_WEST)<<3;return e|=(t&mxConstants.DIRECTION_MASK_NORTH)<<1,e|=(t&mxConstants.DIRECTION_MASK_SOUTH)>>1,e|=(t&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(t,e,n){var i=-1;if(0<t.absolutePoints.length)for(var l=t.absolutePoints[0],s=null,o=1;o<t.absolutePoints.length;o++){var r=t.absolutePoints[o],a=mxUtils.ptSegDistSq(l.x,l.y,r.x,r.y,e,n);(null==s||a<s)&&(s=a,i=o-1),l=r}return i},getDirectedBounds:function(t,e,n,i,l){var s=mxUtils.getValue(n,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);i=null!=i?i:mxUtils.getValue(n,mxConstants.STYLE_FLIPH,!1),l=null!=l?l:mxUtils.getValue(n,mxConstants.STYLE_FLIPV,!1),e.x=Math.round(Math.max(0,Math.min(t.width,e.x))),e.y=Math.round(Math.max(0,Math.min(t.height,e.y))),e.width=Math.round(Math.max(0,Math.min(t.width,e.width))),e.height=Math.round(Math.max(0,Math.min(t.height,e.height))),(l&&(s==mxConstants.DIRECTION_SOUTH||s==mxConstants.DIRECTION_NORTH)||i&&(s==mxConstants.DIRECTION_EAST||s==mxConstants.DIRECTION_WEST))&&(o=e.x,e.x=e.width,e.width=o),(i&&(s==mxConstants.DIRECTION_SOUTH||s==mxConstants.DIRECTION_NORTH)||l&&(s==mxConstants.DIRECTION_EAST||s==mxConstants.DIRECTION_WEST))&&(o=e.y,e.y=e.height,e.height=o);var o=mxRectangle.fromRectangle(e);return s==mxConstants.DIRECTION_SOUTH?(o.y=e.x,o.x=e.height,o.width=e.y,o.height=e.width):s==mxConstants.DIRECTION_WEST?(o.y=e.height,o.x=e.width,o.width=e.x,o.height=e.y):s==mxConstants.DIRECTION_NORTH&&(o.y=e.width,o.x=e.y,o.width=e.height,o.height=e.x),new mxRectangle(t.x+o.x,t.y+o.y,t.width-o.width-o.x,t.height-o.height-o.y)},getPerimeterPoint:function(t,e,n){for(var i=null,l=0;l<t.length-1;l++){var s,o=mxUtils.intersection(t[l].x,t[l].y,t[l+1].x,t[l+1].y,e.x,e.y,n.x,n.y);null!=o&&(s=n.x-o.x,null!=(s={p:o,distSq:(o=n.y-o.y)*o+s*s})&&(null==i||i.distSq>s.distSq)&&(i=s))}return null!=i?i.p:null},rectangleIntersectsSegment:function(t,e,n){var i=t.y,l=t.x,s=i+t.height,o=l+t.width,r=e.x,a=n.x;if(e.x>n.x&&(r=n.x,a=e.x),o<a&&(a=o),r<l&&(r=l),a<r)return!1;var h,t=e.y,o=n.y,l=n.x-e.x;return 1e-7<Math.abs(l)&&(t=(l=(n.y-e.y)/l)*r+(h=e.y-l*e.x),o=l*a+h),o<t&&(h=o,o=t,t=h),s<o&&(o=s),t<i&&(t=i),!(o<t)},contains:function(t,e,n){return t.x<=e&&t.x+t.width>=e&&t.y<=n&&t.y+t.height>=n},intersects:function(t,e){var n=t.width,i=t.height,l=e.width,s=e.height;if(l<=0||s<=0||n<=0||i<=0)return!1;var o=t.x,r=t.y,t=e.x,e=e.y;return s+=e,n+=o,i+=r,((l+=t)<t||o<l)&&(s<e||r<s)&&(n<o||t<n)&&(i<r||e<i)},intersectsHotspot:function(t,e,n,i,l,s){if(l=null!=l?l:0,s=null!=s?s:0,0<(i=null!=i?i:1)){var o=t.getCenterX(),r=t.getCenterY(),a=t.width,h=t.height,d=mxUtils.getValue(t.style,mxConstants.STYLE_STARTSIZE)*t.view.scale;0<d&&(mxUtils.getValue(t.style,mxConstants.STYLE_HORIZONTAL,!0)?(r=t.y+d/2,h=d):(o=t.x+d/2,a=d)),a=Math.max(l,a*i),h=Math.max(l,h*i),0<s&&(a=Math.min(a,s),h=Math.min(h,s));r=new mxRectangle(o-a/2,r-h/2,a,h),a=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0);return 0!=a&&(h=Math.cos(-a),a=Math.sin(-a),o=new mxPoint(t.getCenterX(),t.getCenterY()),e=(o=mxUtils.getRotatedPoint(new mxPoint(e,n),h,a,o)).x,n=o.y),mxUtils.contains(r,e,n)}return!0},getOffset:function(t,e,n=!1){var i=0,l=0;if(n)i=t.offsetLeft,l=t.offsetTop;else{for(var s=!1,o=t,r=document.body,a=document.documentElement;null!=o&&o!=r&&o!=a&&!s;){var h=mxUtils.getCurrentStyle(o);null!=h&&(s=s||"fixed"==h.position),o=o.parentNode}e||s||(i+=(e=mxUtils.getDocumentScrollOrigin(t.ownerDocument)).x,l+=e.y);t=t.getBoundingClientRect();null!=t&&(i+=t.left,l+=t.top)}return new mxPoint(i,l)},getDocumentScrollOrigin:function(t){if(mxClient.IS_QUIRKS)return new mxPoint(t.body.scrollLeft,t.body.scrollTop);t=t.defaultView||t.parentWindow;return new mxPoint(null!=t&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=t&&void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},getScrollOrigin:function(t,e,n){e=null!=e&&e,n=null==n||n;for(var i=null!=t?t.ownerDocument:document,l=i.body,s=i.documentElement,o=new mxPoint,r=!1;null!=t&&t!=l&&t!=s;){isNaN(t.scrollLeft)||isNaN(t.scrollTop)||(o.x+=t.scrollLeft,o.y+=t.scrollTop);var a=mxUtils.getCurrentStyle(t);null!=a&&(r=r||"fixed"==a.position),t=e?t.parentNode:null}return!r&&n&&(i=mxUtils.getDocumentScrollOrigin(i),o.x+=i.x,o.y+=i.y),o},convertPoint:function(t,e,n){var i=mxUtils.getScrollOrigin(t,!1),t=mxUtils.getOffset(t);return t.x-=i.x,t.y-=i.y,new mxPoint(e-t.x,n-t.y)},ltrim:function(t,e){return e=e||"\\s",null!=t?t.replace(new RegExp("^["+e+"]+","g"),""):null},rtrim:function(t,e){return e=e||"\\s",null!=t?t.replace(new RegExp("["+e+"]+$","g"),""):null},trim:function(t,e){return mxUtils.ltrim(mxUtils.rtrim(t,e),e)},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)&&("string"!=typeof t||t.toLowerCase().indexOf("0x")<0)},isInteger:function(t){return String(parseInt(t))===String(t)},mod:function(t,e){return(t%e+e)%e},intersection:function(t,e,n,i,l,s,o,r){var a=(r-s)*(n-t)-(o-l)*(i-e),r=((o-l)*(e-s)-(r-s)*(t-l))/a,a=((n-t)*(e-s)-(i-e)*(t-l))/a;return 0<=r&&r<=1&&0<=a&&a<=1?new mxPoint(t+r*(n-t),e+r*(i-e)):null},ptSegDistSq:function(t,e,n,i,l,s){e=(l-=t)*(n-=t)+(s-=e)*(i-=e),i=e<=0||(e=(l=n-l)*n+(s=i-s)*i)<=0?0:e*e/(n*n+i*i),i=l*l+s*s-i;return i<0&&(i=0),i},ptLineDist:function(t,e,n,i,l,s){return Math.abs((i-e)*l-(n-t)*s+n*e-i*t)/Math.sqrt((i-e)*(i-e)+(n-t)*(n-t))},relativeCcw:function(t,e,n,i,l,s){t=(l-=t)*(i-=e)-(s-=e)*(n-=t);return 0==t&&0<(t=l*n+s*i)&&(t=(l-=n)*n+(s-=i)*i)<0&&(t=0),t<0?-1:0<t?1:0},animateChanges:function(t,e){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(t,e,n){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(t,e,n,i,l,s){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(t,e){mxUtils.isVml(t)?t.style.filter=100<=e?"":"alpha(opacity="+e/5+")":mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?t.style.filter=100<=e?"":"alpha(opacity="+e+")":t.style.opacity=e/100},createImage:function(t){var e=null;return mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?((e=document.createElement(mxClient.VML_PREFIX+":image")).setAttribute("src",t),e.style.borderStyle="none"):((e=document.createElement("img")).setAttribute("src",t),e.setAttribute("border","0")),e},sortCells:function(t,i){i=null==i||i;var l=new mxDictionary;return t.sort(function(t,e){var n=l.get(t);null==n&&(n=mxCellPath.create(t).split(mxCellPath.PATH_SEPARATOR),l.put(t,n));t=l.get(e);null==t&&(t=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),l.put(e,t));t=mxCellPath.compare(n,t);return 0==t?0:0<t==i?1:-1}),t},getStylename:function(t){if(null!=t){t=t.split(";")[0];if(t.indexOf("=")<0)return t}return""},getStylenames:function(t){var e=[];if(null!=t)for(var n=t.split(";"),i=0;i<n.length;i++)n[i].indexOf("=")<0&&e.push(n[i]);return e},indexOfStylename:function(t,e){if(null!=t&&null!=e)for(var n=t.split(";"),i=0,l=0;l<n.length;l++){if(n[l]==e)return i;i+=n[l].length+1}return-1},addStylename:function(t,e){return mxUtils.indexOfStylename(t,e)<0&&(null==t?t="":0<t.length&&";"!=t.charAt(t.length-1)&&(t+=";"),t+=e),t},removeStylename:function(t,e){var n=[];if(null!=t)for(var i=t.split(";"),l=0;l<i.length;l++)i[l]!=e&&n.push(i[l]);return n.join(";")},removeAllStylenames:function(t){var e=[];if(null!=t)for(var n=t.split(";"),i=0;i<n.length;i++)0<=n[i].indexOf("=")&&e.push(n[i]);return e.join(";")},setCellStyles:function(t,e,n,i){if(null!=e&&0<e.length){t.beginUpdate();try{for(var l,s=0;s<e.length;s++)null!=e[s]&&(l=mxUtils.setStyle(t.getStyle(e[s]),n,i),t.setStyle(e[s],l))}finally{t.endUpdate()}}},setStyle:function(t,e,n){var i,l,s,o=null!=n&&(void 0===n.length||0<n.length);return null==t||0==t.length?o&&(t=e+"="+n+";"):t.substring(0,e.length+1)==e+"="?(s=t.indexOf(";"),t=o?e+"="+n+(s<0?";":t.substring(s)):s<0||s==t.length-1?"":t.substring(s+1)):(i=t.indexOf(";"+e+"="))<0?o&&(l=";"==t.charAt(t.length-1)?"":";",t=t+l+e+"="+n+";"):(s=t.indexOf(";",i+1),t=o?t.substring(0,i+1)+e+"="+n+(s<0?";":t.substring(s)):t.substring(0,i)+(s<0?";":t.substring(s))),t},setCellStyleFlags:function(t,e,n,i,l){if(null!=e&&0<e.length){t.beginUpdate();try{for(var s,o=0;o<e.length;o++)null!=e[o]&&(s=mxUtils.setStyleFlag(t.getStyle(e[o]),n,i,l),t.setStyle(e[o],s))}finally{t.endUpdate()}}},setStyleFlag:function(t,e,n,i){var l,s,o;return t=null==t||0==t.length?i||null==i?e+"="+n:e+"=0":(l=t.indexOf(e+"="))<0?(s=";"==t.charAt(t.length-1)?"":";",i||null==i?t+s+e+"="+n:t+s+e+"=0"):(o="",o=(s=t.indexOf(";",l))<0?t.substring(l+e.length+1):t.substring(l+e.length+1,s),o=null==i?parseInt(o)^n:i?parseInt(o)|n:parseInt(o)&~n,t.substring(0,l)+e+"="+o+(0<=s?t.substring(s):""))},getAlignmentAsPoint:function(t,e){var n=-.5,i=-.5;return t==mxConstants.ALIGN_LEFT?n=0:t==mxConstants.ALIGN_RIGHT&&(n=-1),e==mxConstants.ALIGN_TOP?i=0:e==mxConstants.ALIGN_BOTTOM&&(i=-1),new mxPoint(n,i)},getSizeForString:function(t,e,n,i,l){e=null!=e?e:mxConstants.DEFAULT_FONTSIZE,n=null!=n?n:mxConstants.DEFAULT_FONTFAMILY;var s=document.createElement("div");s.style.fontFamily=n,s.style.fontSize=Math.round(e)+"px",s.style.lineHeight=Math.round(e*mxConstants.LINE_HEIGHT)+"px",null!=l&&((l&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(s.style.fontWeight="bold"),(l&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(s.style.fontStyle="italic"),e=[],(l&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&e.push("underline"),(l&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&e.push("line-through"),0<e.length&&(s.style.textDecoration=e.join(" "))),s.style.position="absolute",s.style.visibility="hidden",s.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",s.style.zoom="1",null!=i?(s.style.width=i+"px",s.style.whiteSpace="normal"):s.style.whiteSpace="nowrap",s.innerHTML=t,document.body.appendChild(s);t=new mxRectangle(0,0,s.offsetWidth,s.offsetHeight);return document.body.removeChild(s),t},getViewXml:function(t,e,n,i,l){i=null!=i?i:0,l=null!=l?l:0,e=null!=e?e:1,null==n&&(n=[t.getModel().getRoot()]);var s=t.getView(),o=null,r=s.isEventsEnabled();s.setEventsEnabled(!1);var a=s.drawPane,h=s.overlayPane;t.dialect==mxConstants.DIALECT_SVG?(s.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),s.canvas.appendChild(s.drawPane),s.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(s.drawPane=s.drawPane.cloneNode(!1),s.canvas.appendChild(s.drawPane),s.overlayPane=s.overlayPane.cloneNode(!1)),s.canvas.appendChild(s.overlayPane);var d=s.getTranslate();s.translate=new mxPoint(i,l);n=new mxTemporaryCellStates(t.getView(),e,n);try{o=(new mxCodec).encode(t.getView())}finally{n.destroy(),s.translate=d,s.canvas.removeChild(s.drawPane),s.canvas.removeChild(s.overlayPane),s.drawPane=a,s.overlayPane=h,s.setEventsEnabled(r)}return o},getScaleForPageCount:function(t,e,n,i){if(t<1)return 1;i=null!=i?i:0;var l=(n=null!=n?n:mxConstants.PAGE_FORMAT_A4_PORTRAIT).width-2*i,n=n.height-2*i,i=e.getGraphBounds().clone(),e=e.getView().getScale();i.width/=e,i.height/=e;var e=i.width,i=e/i.height/(l/n),n=Math.sqrt(t),i=Math.sqrt(i),s=n*i,o=n/i;s<1&&t<o&&(u=o/t,o=t,s/=u),o<1&&t<s&&(u=s/t,s=t,o/=u);for(var r=Math.ceil(s)*Math.ceil(o),a=0;t<r;){var h=Math.floor(s)/s,d=Math.floor(o)/o;1==h&&(h=Math.floor(s-1)/s),1==d&&(d=Math.floor(o-1)/o);var u=1;if(s*=u=d<h?h:d,o*=u,r=Math.ceil(s)*Math.ceil(o),10<++a)break}return.99999*(l*s/e)},show:function(t,e,n,i,l,s){n=null!=n?n:0,i=null!=i?i:0,null==e?e=window.open().document:e.open(),9==document.documentMode&&e.writeln('\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=9"><![endif]--\x3e');var o=t.getGraphBounds(),r=Math.ceil(n-o.x),a=Math.ceil(i-o.y);if(null==l&&(l=Math.ceil(o.width+n)+Math.ceil(Math.ceil(o.x)-o.x)),null==s&&(s=Math.ceil(o.height+i)+Math.ceil(Math.ceil(o.y)-o.y)),mxClient.IS_IE||11==document.documentMode){for(var h="<html><head>",d=document.getElementsByTagName("base"),u=0;u<d.length;u++)h+=d[u].outerHTML;h+="<style>";for(u=0;u<document.styleSheets.length;u++)try{h+=document.styleSheets[u].cssText}catch(t){}h+='</style></head><body style="margin:0px;">',h+='<div style="position:absolute;overflow:hidden;width:'+l+"px;height:"+s+'px;"><div style="position:relative;left:'+r+"px;top:"+a+'px;">',h+=t.container.innerHTML,h+="</div></div></body><html>",e.writeln(h),e.close()}else{e.writeln("<html><head>");for(d=document.getElementsByTagName("base"),u=0;u<d.length;u++)e.writeln(mxUtils.getOuterHtml(d[u]));for(var p=document.getElementsByTagName("link"),u=0;u<p.length;u++)e.writeln(mxUtils.getOuterHtml(p[u]));for(var m=document.getElementsByTagName("style"),u=0;u<m.length;u++)e.writeln(mxUtils.getOuterHtml(m[u]));e.writeln('</head><body style="margin:0px;"></body></html>'),e.close();var c=e.createElement("div");c.position="absolute",c.overflow="hidden",c.style.width=l+"px",c.style.height=s+"px";var g=e.createElement("div");g.style.position="absolute",g.style.left=r+"px",g.style.top=a+"px";for(var x=t.container.firstChild,y=null;null!=x;){var f=x.cloneNode(!0);x==t.view.drawPane.ownerSVGElement?(c.appendChild(f),y=f):g.appendChild(f),x=x.nextSibling}e.body.appendChild(c),null!=g.firstChild&&e.body.appendChild(g),null!=y&&(y.style.minWidth="",y.style.minHeight="",y.firstChild.setAttribute("transform","translate("+r+","+a+")"))}return mxUtils.removeCursors(e.body),e},printScreen:function(t){var e=window.open();t.getGraphBounds();mxUtils.show(t,e.document);t=function(){e.focus(),e.print(),e.close()};mxClient.IS_GC?e.setTimeout(t,500):t()},popup:function(t,e){var n,i;e?((n=document.createElement("div")).style.overflow="scroll",n.style.width="636px",n.style.height="460px",(i=document.createElement("pre")).innerHTML=mxUtils.htmlEntities(t,!1).replace(/\n/g,"<br>").replace(/ /g,"&nbsp;"),n.appendChild(i),(n=new mxWindow("Popup Window",n,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight)/2-240,640,480,!1,!0)).setClosable(!0),n.setVisible(!0)):mxClient.IS_NS?((n=window.open()).document.writeln("<pre>"+mxUtils.htmlEntities(t)+"</pre"),n.document.close()):((i=(n=window.open()).document.createElement("pre")).innerHTML=mxUtils.htmlEntities(t,!1).replace(/\n/g,"<br>").replace(/ /g,"&nbsp;"),n.document.body.appendChild(i))},alert:function(t){alert(t)},prompt:function(t,e){return prompt(t,null!=e?e:"")},confirm:function(t){return confirm(t)},error:function(t,e,n,i){var l=document.createElement("div");l.style.padding="20px";var s=document.createElement("img");s.setAttribute("src",i||mxUtils.errorImage),s.setAttribute("valign","bottom"),s.style.verticalAlign="middle",l.appendChild(s),l.appendChild(document.createTextNode(" ")),l.appendChild(document.createTextNode(" ")),l.appendChild(document.createTextNode(" ")),mxUtils.write(l,t);var s=document.body.clientWidth,t=document.body.clientHeight||document.documentElement.clientHeight,o=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,l,(s-e)/2,t/4,e,null,!1,!0);return n&&(mxUtils.br(l),e=document.createElement("p"),n=document.createElement("button"),mxClient.IS_IE?n.style.cssText="float:right":n.setAttribute("style","float:right"),mxEvent.addListener(n,"click",function(t){o.destroy()}),mxUtils.write(n,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),e.appendChild(n),l.appendChild(e),mxUtils.br(l),o.setClosable(!0)),o.setVisible(!0),o},makeDraggable:function(t,e,n,l,i,s,o,r,a,h){n=new mxDragSource(t,n);return n.dragOffset=new mxPoint(null!=i?i:0,null!=s?s:mxConstants.TOOLTIP_VERTICAL_OFFSET),n.autoscroll=o,n.setGuidesEnabled(!1),null!=a&&(n.highlightDropTargets=a),null!=h&&(n.getDropTarget=h),n.getGraphForEvent=function(t){return"function"==typeof e?e(t):e},null!=l&&(n.createDragElement=function(){return l.cloneNode(!0)},r&&(n.createPreviewElement=function(t){var e=l.cloneNode(!0),n=parseInt(e.style.width),i=parseInt(e.style.height);return e.style.width=Math.round(n*t.view.scale)+"px",e.style.height=Math.round(i*t.view.scale)+"px",e})),n}},mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_VML:"vml",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"gray",VML_SHADOWCOLOR:"gray",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",OUTLINE_HIGHLIGHT_COLOR:"#00FF00",OUTLINE_HIGHLIGHT_STROKEWIDTH:5,HIGHLIGHT_STROKEWIDTH:3,HIGHLIGHT_SIZE:2,HIGHLIGHT_OPACITY:100,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_TERMINAL_HANDLE:"pointer",CURSOR_BEND_HANDLE:"crosshair",CURSOR_VIRTUAL_BEND_HANDLE:"crosshair",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",ABSOLUTE_LINE_HEIGHT:!1,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",STYLE_OVERFLOW:"overflow",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_DX:"exitDx",STYLE_EXIT_DY:"exitDy",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_DX:"entryDx",STYLE_ENTRY_DY:"entryDy",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_POINTER_EVENTS:"pointerEvents",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_MARGIN:"margin",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_WIDTH:"labelWidth",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_ENDFILL:"endFill",STYLE_STARTFILL:"startFill",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_FIX_DASH:"fixDash",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle",STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_STRIKETHROUGH:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_ARROW_CONNECTOR:"arrowConnector",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_CLASSIC_THIN:"classicThin",ARROW_BLOCK:"block",ARROW_BLOCK_THIN:"blockThin",ARROW_OPEN:"open",ARROW_OPEN_THIN:"openThin",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};function mxEventObject(t){this.name=t,this.properties=[];for(var e=1;e<arguments.length;e+=2)null!=arguments[e+1]&&(this.properties[arguments[e]]=arguments[e+1])}function mxMouseEvent(t,e){this.evt=t,this.state=e,this.sourceState=e}function mxEventSource(t){this.setEventSource(t)}mxEventObject.prototype.name=null,mxEventObject.prototype.properties=null,mxEventObject.prototype.consumed=!1,mxEventObject.prototype.getName=function(){return this.name},mxEventObject.prototype.getProperties=function(){return this.properties},mxEventObject.prototype.getProperty=function(t){return this.properties[t]},mxEventObject.prototype.isConsumed=function(){return this.consumed},mxEventObject.prototype.consume=function(){this.consumed=!0},mxMouseEvent.prototype.consumed=!1,mxMouseEvent.prototype.evt=null,mxMouseEvent.prototype.graphX=null,mxMouseEvent.prototype.graphY=null,mxMouseEvent.prototype.state=null,mxMouseEvent.prototype.sourceState=null,mxMouseEvent.prototype.getEvent=function(){return this.evt},mxMouseEvent.prototype.getSource=function(){return mxEvent.getSource(this.evt)},mxMouseEvent.prototype.isSource=function(t){return null!=t&&mxUtils.isAncestorNode(t.node,this.getSource())},mxMouseEvent.prototype.getX=function(){return mxEvent.getClientX(this.getEvent())},mxMouseEvent.prototype.getY=function(){return mxEvent.getClientY(this.getEvent())},mxMouseEvent.prototype.getGraphX=function(){return this.graphX},mxMouseEvent.prototype.getGraphY=function(){return this.graphY},mxMouseEvent.prototype.getState=function(){return this.state},mxMouseEvent.prototype.getCell=function(){var t=this.getState();return null!=t?t.cell:null},mxMouseEvent.prototype.isPopupTrigger=function(){return mxEvent.isPopupTrigger(this.getEvent())},mxMouseEvent.prototype.isConsumed=function(){return this.consumed},mxMouseEvent.prototype.consume=function(t){(t=null!=t?t:null!=this.evt.touches||mxEvent.isMouseEvent(this.evt))&&this.evt.preventDefault&&this.evt.preventDefault(),mxClient.IS_IE&&(this.evt.returnValue=!0),this.consumed=!0},mxEventSource.prototype.eventListeners=null,mxEventSource.prototype.eventsEnabled=!0,mxEventSource.prototype.eventSource=null,mxEventSource.prototype.isEventsEnabled=function(){return this.eventsEnabled},mxEventSource.prototype.setEventsEnabled=function(t){this.eventsEnabled=t},mxEventSource.prototype.getEventSource=function(){return this.eventSource},mxEventSource.prototype.setEventSource=function(t){this.eventSource=t},mxEventSource.prototype.addListener=function(t,e){null==this.eventListeners&&(this.eventListeners=[]),this.eventListeners.push(t),this.eventListeners.push(e)},mxEventSource.prototype.removeListener=function(t){if(null!=this.eventListeners)for(var e=0;e<this.eventListeners.length;)this.eventListeners[e+1]==t?this.eventListeners.splice(e,2):e+=2},mxEventSource.prototype.fireEvent=function(t,e){if(null!=this.eventListeners&&this.isEventsEnabled()){null==t&&(t=new mxEventObject),null==e&&(e=this.getEventSource()),null==e&&(e=this);for(var n=[e,t],i=0;i<this.eventListeners.length;i+=2){var l=this.eventListeners[i];null!=l&&l!=t.getName()||this.eventListeners[i+1].apply(this,n)}}};var mxEvent={addListener:function(){function i(t,e,n){null==t.mxListenerList&&(t.mxListenerList=[]),n={name:e,f:n},t.mxListenerList.push(n)}if(window.addEventListener){var l=!1;try{document.addEventListener("test",function(){},Object.defineProperty&&Object.defineProperty({},"passive",{get:function(){l=!0}}))}catch(t){}return function(t,e,n){t.addEventListener(e,n,!!l&&{passive:!1}),i(t,e,n)}}return function(t,e,n){t.attachEvent("on"+e,n),i(t,e,n)}}(),removeListener:function(){function i(t,e,n){if(null!=t.mxListenerList){for(var i=t.mxListenerList.length,l=0;l<i;l++)if(t.mxListenerList[l].f==n){t.mxListenerList.splice(l,1);break}0==t.mxListenerList.length&&(t.mxListenerList=null)}}return window.removeEventListener?function(t,e,n){t.removeEventListener(e,n,!1),i(t,0,n)}:function(t,e,n){t.detachEvent("on"+e,n),i(t,0,n)}}(),removeAllListeners:function(t){var e=t.mxListenerList;if(null!=e)for(;0<e.length;){var n=e[0];mxEvent.removeListener(t,n.name,n.f)}},addGestureListeners:function(t,e,n,i){null!=e&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),null!=n&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",n),null!=i&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",i),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=e&&mxEvent.addListener(t,"touchstart",e),null!=n&&mxEvent.addListener(t,"touchmove",n),null!=i&&mxEvent.addListener(t,"touchend",i))},removeGestureListeners:function(t,e,n,i){null!=e&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),null!=n&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",n),null!=i&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",i),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=e&&mxEvent.removeListener(t,"touchstart",e),null!=n&&mxEvent.removeListener(t,"touchmove",n),null!=i&&mxEvent.removeListener(t,"touchend",i))},redirectMouseEvents:function(t,n,e,i,l,s,o){function r(t){return"function"==typeof e?e(t):e}mxEvent.addGestureListeners(t,function(t){null!=i?i(t):mxEvent.isConsumed(t)||n.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,r(t)))},function(t){null!=l?l(t):mxEvent.isConsumed(t)||n.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,r(t)))},function(t){null!=s?s(t):mxEvent.isConsumed(t)||n.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t,r(t)))}),mxEvent.addListener(t,"dblclick",function(t){var e;null!=o?o(t):mxEvent.isConsumed(t)||(e=r(t),n.dblClick(t,null!=e?e.cell:null))})},release:function(t){try{if(null!=t){mxEvent.removeAllListeners(t);var e=t.childNodes;if(null!=e)for(var n=e.length,i=0;i<n;i+=1)mxEvent.release(e[i])}}catch(t){}},addMouseWheelListener:function(a,t){var n,h,d,u;null!=a&&(t=null!=t?t:window,mxClient.IS_SF&&!mxClient.IS_TOUCH?(n=1,mxEvent.addListener(t,"gesturestart",function(t){mxEvent.consume(t),n=1}),mxEvent.addListener(t,"gesturechange",function(t){mxEvent.consume(t);var e=n-t.scale;.2<Math.abs(e)&&(a(t,e<0,!0),n=t.scale)}),mxEvent.addListener(t,"gestureend",function(t){mxEvent.consume(t)})):(h=[],u=d=0,mxEvent.addGestureListeners(t,mxUtils.bind(this,function(t){mxEvent.isMouseEvent(t)||null==t.pointerId||h.push(t)}),mxUtils.bind(this,function(t){if(!mxEvent.isMouseEvent(t)&&2==h.length){for(var e=0;e<h.length;e++)if(t.pointerId==h[e].pointerId){h[e]=t;break}var n,i,l=Math.abs(h[0].clientX-h[1].clientX),s=Math.abs(h[0].clientY-h[1].clientY),o=Math.abs(l-d),r=Math.abs(s-u);(o>mxEvent.PINCH_THRESHOLD||r>mxEvent.PINCH_THRESHOLD)&&(n=h[0].clientX+(h[1].clientX-h[0].clientX)/2,i=h[0].clientY+(h[1].clientY-h[0].clientY)/2,a(h[0],r<o?d<l:u<s,!0,n,i),d=l,u=s)}}),mxUtils.bind(this,function(t){h=[],u=d=0}))),mxEvent.addListener(t,"wheel",function(t){null==t&&(t=window.event),t.ctrlKey&&t.preventDefault(),(.5<Math.abs(t.deltaX)||.5<Math.abs(t.deltaY))&&a(t,0==t.deltaY?0<-t.deltaX:0<-t.deltaY)}))},disableContextMenu:function(t){mxEvent.addListener(t,"contextmenu",function(t){return t.preventDefault&&t.preventDefault(),!1})},getSource:function(t){return null!=t.srcElement?t.srcElement:t.target},isConsumed:function(t){return null!=t.isConsumed&&t.isConsumed},isTouchEvent:function(t){return null!=t.pointerType?"touch"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_TOUCH:null!=t.mozInputSource?5==t.mozInputSource:0==t.type.indexOf("touch")},isPenEvent:function(t){return null!=t.pointerType?"pen"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_PEN:null!=t.mozInputSource?2==t.mozInputSource:0==t.type.indexOf("pen")},isMultiTouchEvent:function(t){return null!=t.type&&0==t.type.indexOf("touch")&&null!=t.touches&&1<t.touches.length},isMouseEvent:function(t){return null!=t.pointerType?"mouse"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE:null!=t.mozInputSource?1==t.mozInputSource:0==t.type.indexOf("mouse")},isLeftMouseButton:function(t){return"buttons"in t&&("mousedown"==t.type||"mousemove"==t.type)?1==t.buttons:"which"in t?1===t.which:1===t.button},isMiddleMouseButton:function(t){return"which"in t?2===t.which:4===t.button},isRightMouseButton:function(t){return"which"in t?3===t.which:2===t.button},isPopupTrigger:function(t){return mxEvent.isRightMouseButton(t)||mxClient.IS_MAC&&mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)&&!mxEvent.isMetaDown(t)&&!mxEvent.isAltDown(t)},isShiftDown:function(t){return null!=t&&t.shiftKey},isAltDown:function(t){return null!=t&&t.altKey},isControlDown:function(t){return null!=t&&t.ctrlKey},isMetaDown:function(t){return null!=t&&t.metaKey},getMainEvent:function(t){return"touchstart"!=t.type&&"touchmove"!=t.type||null==t.touches||null==t.touches[0]?"touchend"==t.type&&null!=t.changedTouches&&null!=t.changedTouches[0]&&(t=t.changedTouches[0]):t=t.touches[0],t},getClientX:function(t){return mxEvent.getMainEvent(t).clientX},getClientY:function(t){return mxEvent.getMainEvent(t).clientY},consume:function(t,e,n){n=null==n||n,(e=null==e||e)&&(t.preventDefault?(n&&t.stopPropagation(),t.preventDefault()):n&&(t.cancelBubble=!0)),t.isConsumed=!0,t.preventDefault||(t.returnValue=!1)},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,CUSTOM_HANDLE:-100,VIRTUAL_HANDLE:-1e5,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",SIZE:"size",SELECT:"select",FIRED:"fired",FIRE_MOUSE_EVENT:"fireMouseEvent",GESTURE:"gesture",TAP_AND_HOLD:"tapAndHold",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit",END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled",ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",EDITING_STARTED:"editingStarted",EDITING_STOPPED:"editingStopped",ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",DOUBLE_CLICK:"doubleClick",START:"start",RESET:"reset",PINCH_THRESHOLD:10};function mxXmlRequest(t,e,n,i,l,s){this.url=t,this.params=e,this.method=n||"POST",this.async=null==i||i,this.username=l,this.password=s}mxXmlRequest.prototype.url=null,mxXmlRequest.prototype.params=null,mxXmlRequest.prototype.method=null,mxXmlRequest.prototype.async=null,mxXmlRequest.prototype.binary=!1,mxXmlRequest.prototype.withCredentials=!1,mxXmlRequest.prototype.username=null,mxXmlRequest.prototype.password=null,mxXmlRequest.prototype.request=null,mxXmlRequest.prototype.decodeSimulateValues=!1,mxXmlRequest.prototype.isBinary=function(){return this.binary},mxXmlRequest.prototype.setBinary=function(t){this.binary=t},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.isReady=function(){return 4==this.request.readyState},mxXmlRequest.prototype.getDocumentElement=function(){var t=this.getXml();return null!=t?t.documentElement:null},mxXmlRequest.prototype.getXml=function(){var t=this.request.responseXML;return(9<=document.documentMode||null==t||null==t.documentElement)&&(t=mxUtils.parseXml(this.request.responseText)),t},mxXmlRequest.prototype.getStatus=function(){return null!=this.request?this.request.status:null},mxXmlRequest.prototype.create=window.XMLHttpRequest?function(){var t=new XMLHttpRequest;return this.isBinary()&&t.overrideMimeType&&t.overrideMimeType("text/plain; charset=x-user-defined"),t}:"undefined"!=typeof ActiveXObject?function(){return new ActiveXObject("Microsoft.XMLHTTP")}:void 0,mxXmlRequest.prototype.send=function(t,e,n,i){this.request=this.create(),null!=this.request&&(null!=t&&(this.request.onreadystatechange=mxUtils.bind(this,function(){this.isReady()&&(t(this),this.request.onreadystatechange=null)})),this.request.open(this.method,this.url,this.async,this.username,this.password),this.setRequestHeaders(this.request,this.params),window.XMLHttpRequest&&this.withCredentials&&(this.request.withCredentials="true"),!mxClient.IS_QUIRKS&&(null==document.documentMode||9<document.documentMode)&&window.XMLHttpRequest&&null!=n&&null!=i&&(this.request.timeout=n,this.request.ontimeout=i),this.request.send(this.params))},mxXmlRequest.prototype.setRequestHeaders=function(t,e){null!=e&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded")},mxXmlRequest.prototype.simulate=function(t,e){var n=null;(t=t||document)==document&&(n=window.onbeforeunload,window.onbeforeunload=null);var i=t.createElement("form");i.setAttribute("method",this.method),i.setAttribute("action",this.url),null!=e&&i.setAttribute("target",e),i.style.display="none",i.style.visibility="hidden";for(var l=0<this.params.indexOf("&")?this.params.split("&"):this.params.split(),s=0;s<l.length;s++){var o,r,a=l[s].indexOf("=");0<a&&(o=l[s].substring(0,a),r=l[s].substring(a+1),this.decodeSimulateValues&&(r=decodeURIComponent(r)),(a=t.createElement("textarea")).setAttribute("wrap","off"),a.setAttribute("name",o),mxUtils.write(a,r),i.appendChild(a))}t.body.appendChild(i),i.submit(),null!=i.parentNode&&i.parentNode.removeChild(i),null!=n&&(window.onbeforeunload=n)};var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,setCells:function(t){mxClipboard.cells=t},getCells:function(){return mxClipboard.cells},isEmpty:function(){return null==mxClipboard.getCells()},cut:function(t,e){return e=mxClipboard.copy(t,e),mxClipboard.insertCount=0,mxClipboard.removeCells(t,e),e},removeCells:function(t,e){t.removeCells(e)},copy:function(t,e){e=e||t.getSelectionCells();e=t.getExportableCells(t.model.getTopmostCells(e));return mxClipboard.insertCount=1,mxClipboard.setCells(t.cloneCells(e)),e},paste:function(t){var e,n,i=null;return mxClipboard.isEmpty()||(i=t.getImportableCells(mxClipboard.getCells()),e=mxClipboard.insertCount*mxClipboard.STEPSIZE,n=t.getDefaultParent(),i=t.importCells(i,e,e,n),mxClipboard.insertCount++,t.setSelectionCells(i)),i}};function mxWindow(t,e,n,i,l,s,o,r,a,h){null!=e&&(o=null==o||o,this.content=e,this.init(n,i,l,s,h),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(o),this.setTitle(t),null!=r&&!r||this.installMoveHandler(),null!=a&&null!=a.parentNode?a.parentNode.replaceChild(this.div,a):document.body.appendChild(this.div))}function mxForm(t){this.table=document.createElement("table"),this.table.className=t,this.body=document.createElement("tbody"),this.table.appendChild(this.body)}function mxImage(t,e,n){this.src=t,this.width=e,this.height=n}function mxDivResizer(t,e){"div"==t.nodeName.toLowerCase()&&(null==e&&(e=window),this.div=t,null!=(t=mxUtils.getCurrentStyle(t))&&(this.resizeWidth="auto"==t.width,this.resizeHeight="auto"==t.height),mxEvent.addListener(e,"resize",mxUtils.bind(this,function(t){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)})),this.resize())}function mxDragSource(t,e){this.element=t,this.dropHandler=e,mxEvent.addGestureListeners(t,mxUtils.bind(this,function(t){this.mouseDown(t)})),mxEvent.addListener(t,"dragstart",function(t){mxEvent.consume(t)}),this.eventConsumer=function(t,e){var n=e.getProperty("eventName"),e=e.getProperty("event");n!=mxEvent.MOUSE_DOWN&&e.consume()}}function mxToolbar(t){this.container=t}function mxUndoableEdit(t,e){this.source=t,this.changes=[],this.significant=null==e||e}function mxUndoManager(t){this.size=null!=t?t:100,this.clear()}mxWindow.prototype=new mxEventSource,mxWindow.prototype.constructor=mxWindow,mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif",mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif",mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif",mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif",mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif",mxWindow.prototype.visible=!1,mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40),mxWindow.prototype.destroyOnClose=!0,mxWindow.prototype.contentHeightCorrection=8==document.documentMode||7==document.documentMode?6:2,mxWindow.prototype.title=null,mxWindow.prototype.content=null,mxWindow.prototype.init=function(t,e,n,i,l){l=null!=l?l:"mxWindow",this.div=document.createElement("div"),this.div.className=l,this.div.style.left=t+"px",this.div.style.top=e+"px",this.table=document.createElement("table"),this.table.className=l,mxClient.IS_POINTER&&(this.div.style.touchAction="none"),null!=n&&(mxClient.IS_QUIRKS||(this.div.style.width=n+"px"),this.table.style.width=n+"px"),null!=i&&(mxClient.IS_QUIRKS||(this.div.style.height=i+"px"),this.table.style.height=i+"px");n=document.createElement("tbody"),i=document.createElement("tr");this.title=document.createElement("td"),this.title.className=l+"Title",this.buttons=document.createElement("div"),this.buttons.style.position="absolute",this.buttons.style.display="inline-block",this.buttons.style.right="4px",this.buttons.style.top="5px",this.title.appendChild(this.buttons),i.appendChild(this.title),n.appendChild(i),i=document.createElement("tr"),this.td=document.createElement("td"),this.td.className=l+"Pane",7==document.documentMode&&(this.td.style.height="100%"),this.contentWrapper=document.createElement("div"),this.contentWrapper.className=l+"Pane",this.contentWrapper.style.width="100%",this.contentWrapper.appendChild(this.content),!mxClient.IS_QUIRKS&&"DIV"==this.content.nodeName.toUpperCase()||(this.contentWrapper.style.height="100%"),this.td.appendChild(this.contentWrapper),i.appendChild(this.td),n.appendChild(i),this.table.appendChild(n),this.div.appendChild(this.table);n=mxUtils.bind(this,function(t){this.activate()});mxEvent.addGestureListeners(this.title,n),mxEvent.addGestureListeners(this.table,n),this.hide()},mxWindow.prototype.setTitle=function(t){for(var e=this.title.firstChild;null!=e;){var n=e.nextSibling;e.nodeType==mxConstants.NODETYPE_TEXT&&e.parentNode.removeChild(e),e=n}mxUtils.write(this.title,t||""),this.title.appendChild(this.buttons)},mxWindow.prototype.setScrollable=function(t){(null==navigator.userAgent||navigator.userAgent.indexOf("Presto/2.5")<0)&&(this.contentWrapper.style.overflow=t?"auto":"hidden")},mxWindow.prototype.activate=function(){var t,e;mxWindow.activeWindow!=this&&(t=null!=(t=mxUtils.getCurrentStyle(this.getElement()))?t.zIndex:3,!mxWindow.activeWindow||null!=(e=mxWindow.activeWindow.getElement())&&null!=e.style&&(e.style.zIndex=t),e=mxWindow.activeWindow,this.getElement().style.zIndex=parseInt(t)+1,(mxWindow.activeWindow=this).fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",e)))},mxWindow.prototype.getElement=function(){return this.div},mxWindow.prototype.fit=function(){mxUtils.fit(this.div)},mxWindow.prototype.isResizable=function(){return null!=this.resize&&"none"!=this.resize.style.display},mxWindow.prototype.setResizable=function(t){var i,l,s,o,e,n;t?null==this.resize?(this.resize=document.createElement("img"),this.resize.style.position="absolute",this.resize.style.bottom="2px",this.resize.style.right="2px",this.resize.setAttribute("src",this.resizeImage),this.resize.style.cursor="nw-resize",o=s=l=i=null,t=mxUtils.bind(this,function(t){this.activate(),i=mxEvent.getClientX(t),l=mxEvent.getClientY(t),s=this.div.offsetWidth,o=this.div.offsetHeight,mxEvent.addGestureListeners(document,null,e,n),this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",t)),mxEvent.consume(t)}),e=mxUtils.bind(this,function(t){var e,n;null!=i&&null!=l&&(e=mxEvent.getClientX(t)-i,n=mxEvent.getClientY(t)-l,this.setSize(s+e,o+n),this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",t)),mxEvent.consume(t))}),n=mxUtils.bind(this,function(t){null!=i&&null!=l&&(l=i=null,mxEvent.removeGestureListeners(document,null,e,n),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",t)),mxEvent.consume(t))}),mxEvent.addGestureListeners(this.resize,t,e,n),this.div.appendChild(this.resize)):this.resize.style.display="inline":null!=this.resize&&(this.resize.style.display="none")},mxWindow.prototype.setSize=function(t,e){t=Math.max(this.minimumSize.width,t),e=Math.max(this.minimumSize.height,e),mxClient.IS_QUIRKS||(this.div.style.width=t+"px",this.div.style.height=e+"px"),this.table.style.width=t+"px",this.table.style.height=e+"px",mxClient.IS_QUIRKS||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px")},mxWindow.prototype.setMinimizable=function(t){this.minimize.style.display=t?"":"none"},mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)},mxWindow.prototype.installMinimizeHandler=function(){this.minimize=document.createElement("img"),this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.minimize.style.cursor="pointer",this.minimize.style.marginLeft="2px",this.minimize.style.display="none",this.buttons.appendChild(this.minimize);var n=!1,i=null,l=null,t=mxUtils.bind(this,function(t){var e;this.activate(),n?(n=!1,this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=i,mxClient.IS_QUIRKS||(this.div.style.height=l),this.table.style.height=l,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",t))):(n=!0,this.minimize.setAttribute("src",this.normalizeImage),this.minimize.setAttribute("title","Normalize"),this.contentWrapper.style.display="none",i=this.maximize.style.display,this.maximize.style.display="none",l=this.table.style.height,0<(e=this.getMinimumSize()).height&&(mxClient.IS_QUIRKS||(this.div.style.height=e.height+"px"),this.table.style.height=e.height+"px"),0<e.width&&(mxClient.IS_QUIRKS||(this.div.style.width=e.width+"px"),this.table.style.width=e.width+"px"),null!=this.resize&&(this.resize.style.visibility="hidden"),this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",t))),mxEvent.consume(t)});mxEvent.addGestureListeners(this.minimize,t)},mxWindow.prototype.setMaximizable=function(t){this.maximize.style.display=t?"":"none"},mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img"),this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.maximize.style.cursor="default",this.maximize.style.marginLeft="2px",this.maximize.style.cursor="pointer",this.maximize.style.display="none",this.buttons.appendChild(this.maximize);var n=!1,i=null,l=null,s=null,o=null,r=null,t=mxUtils.bind(this,function(t){var e;this.activate(),"none"!=this.maximize.style.display&&(n?(n=!1,this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.contentWrapper.style.display="",this.minimize.style.display=r,this.div.style.left=i+"px",this.div.style.top=l+"px",mxClient.IS_QUIRKS||(this.div.style.height=s,this.div.style.width=o,"auto"!=mxUtils.getCurrentStyle(this.contentWrapper).overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px")),this.table.style.height=s,this.table.style.width=o,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",t))):(n=!0,this.maximize.setAttribute("src",this.normalizeImage),this.maximize.setAttribute("title","Normalize"),this.contentWrapper.style.display="",r=this.minimize.style.display,this.minimize.style.display="none",i=parseInt(this.div.style.left),l=parseInt(this.div.style.top),s=this.table.style.height,o=this.table.style.width,this.div.style.left="0px",this.div.style.top="0px",e=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0),mxClient.IS_QUIRKS||(this.div.style.width=document.body.clientWidth-2+"px",this.div.style.height=e-2+"px"),this.table.style.width=document.body.clientWidth-2+"px",this.table.style.height=e-2+"px",null!=this.resize&&(this.resize.style.visibility="hidden"),mxClient.IS_QUIRKS||"auto"!=mxUtils.getCurrentStyle(this.contentWrapper).overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"),this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",t))),mxEvent.consume(t))});mxEvent.addGestureListeners(this.maximize,t),mxEvent.addListener(this.title,"dblclick",t)},mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move",mxEvent.addGestureListeners(this.title,mxUtils.bind(this,function(t){var i=mxEvent.getClientX(t),l=mxEvent.getClientY(t),s=this.getX(),o=this.getY(),e=mxUtils.bind(this,function(t){var e=mxEvent.getClientX(t)-i,n=mxEvent.getClientY(t)-l;this.setLocation(s+e,o+n),this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",t)),mxEvent.consume(t)}),n=mxUtils.bind(this,function(t){mxEvent.removeGestureListeners(document,null,e,n),this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",t)),mxEvent.consume(t)});mxEvent.addGestureListeners(document,null,e,n),this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",t)),mxEvent.consume(t)})),mxClient.IS_POINTER&&(this.title.style.touchAction="none")},mxWindow.prototype.setLocation=function(t,e){this.div.style.left=t+"px",this.div.style.top=e+"px"},mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)},mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)},mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img"),this.closeImg.setAttribute("src",this.closeImage),this.closeImg.setAttribute("title","Close"),this.closeImg.style.marginLeft="2px",this.closeImg.style.cursor="pointer",this.closeImg.style.display="none",this.buttons.appendChild(this.closeImg),mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,function(t){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",t)),this.destroyOnClose?this.destroy():this.setVisible(!1),mxEvent.consume(t)}))},mxWindow.prototype.setImage=function(t){this.image=document.createElement("img"),this.image.setAttribute("src",t),this.image.setAttribute("align","left"),this.image.style.marginRight="4px",this.image.style.marginLeft="0px",this.image.style.marginTop="-2px",this.title.insertBefore(this.image,this.title.firstChild)},mxWindow.prototype.setClosable=function(t){this.closeImg.style.display=t?"":"none"},mxWindow.prototype.isVisible=function(){return null!=this.div&&"none"!=this.div.style.display},mxWindow.prototype.setVisible=function(t){null!=this.div&&this.isVisible()!=t&&(t?this.show():this.hide())},mxWindow.prototype.show=function(){this.div.style.display="",this.activate();var t=mxUtils.getCurrentStyle(this.contentWrapper);mxClient.IS_QUIRKS||"auto"!=t.overflow&&null==this.resize||"none"==this.contentWrapper.style.display||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"),this.fireEvent(new mxEventObject(mxEvent.SHOW))},mxWindow.prototype.hide=function(){this.div.style.display="none",this.fireEvent(new mxEventObject(mxEvent.HIDE))},mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY)),null!=this.div&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null),this.title=null,this.content=null,this.contentWrapper=null},mxForm.prototype.table=null,mxForm.prototype.body=!1,mxForm.prototype.getTable=function(){return this.table},mxForm.prototype.addButtons=function(t,e){var n=document.createElement("tr"),i=document.createElement("td");n.appendChild(i),i=document.createElement("td");var l=document.createElement("button");mxUtils.write(l,mxResources.get("ok")||"OK"),i.appendChild(l),mxEvent.addListener(l,"click",function(){t()}),l=document.createElement("button"),mxUtils.write(l,mxResources.get("cancel")||"Cancel"),i.appendChild(l),mxEvent.addListener(l,"click",function(){e()}),n.appendChild(i),this.body.appendChild(n)},mxForm.prototype.addText=function(t,e,n){var i=document.createElement("input");return i.setAttribute("type",n||"text"),i.value=e,this.addField(t,i)},mxForm.prototype.addCheckbox=function(t,e){var n=document.createElement("input");return n.setAttribute("type","checkbox"),this.addField(t,n),e&&(n.checked=!0),n},mxForm.prototype.addTextarea=function(t,e,n){var i=document.createElement("textarea");return mxClient.IS_NS&&n--,i.setAttribute("rows",n||2),i.value=e,this.addField(t,i)},mxForm.prototype.addCombo=function(t,e,n){var i=document.createElement("select");return null!=n&&i.setAttribute("size",n),e&&i.setAttribute("multiple","true"),this.addField(t,i)},mxForm.prototype.addOption=function(t,e,n,i){var l=document.createElement("option");mxUtils.writeln(l,e),l.setAttribute("value",n),i&&l.setAttribute("selected",i),t.appendChild(l)},mxForm.prototype.addField=function(t,e){var n=document.createElement("tr"),i=document.createElement("td");return mxUtils.write(i,t),n.appendChild(i),(i=document.createElement("td")).appendChild(e),n.appendChild(i),this.body.appendChild(n),e},mxImage.prototype.src=null,mxImage.prototype.width=null,mxImage.prototype.height=null,mxDivResizer.prototype.resizeWidth=!0,mxDivResizer.prototype.resizeHeight=!0,mxDivResizer.prototype.handlingResize=!1,mxDivResizer.prototype.resize=function(){var t=this.getDocumentWidth(),e=this.getDocumentHeight(),n=parseInt(this.div.style.left),i=parseInt(this.div.style.right),l=parseInt(this.div.style.top),s=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(n)&&!isNaN(i)&&0<=n&&0<=i&&0<t-i-n&&(this.div.style.width=t-i-n+"px"),this.resizeHeight&&!isNaN(l)&&!isNaN(s)&&0<=l&&0<=s&&0<e-l-s&&(this.div.style.height=e-l-s+"px")},mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth},mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight},mxDragSource.prototype.element=null,mxDragSource.prototype.dropHandler=null,mxDragSource.prototype.dragOffset=null,mxDragSource.prototype.dragElement=null,mxDragSource.prototype.previewElement=null,mxDragSource.prototype.previewOffset=null,mxDragSource.prototype.enabled=!0,mxDragSource.prototype.currentGraph=null,mxDragSource.prototype.currentDropTarget=null,mxDragSource.prototype.currentPoint=null,mxDragSource.prototype.currentGuide=null,mxDragSource.prototype.currentHighlight=null,mxDragSource.prototype.autoscroll=!0,mxDragSource.prototype.guidesEnabled=!0,mxDragSource.prototype.gridEnabled=!0,mxDragSource.prototype.highlightDropTargets=!0,mxDragSource.prototype.dragElementZIndex=100,mxDragSource.prototype.dragElementOpacity=70,mxDragSource.prototype.checkEventSource=!0,mxDragSource.prototype.isEnabled=function(){return this.enabled},mxDragSource.prototype.setEnabled=function(t){this.enabled=t},mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled},mxDragSource.prototype.setGuidesEnabled=function(t){this.guidesEnabled=t},mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled},mxDragSource.prototype.setGridEnabled=function(t){this.gridEnabled=t},mxDragSource.prototype.getGraphForEvent=function(t){return null},mxDragSource.prototype.getDropTarget=function(t,e,n,i){return t.getCellAt(e,n)},mxDragSource.prototype.createDragElement=function(t){return this.element.cloneNode(!0)},mxDragSource.prototype.createPreviewElement=function(t){return null},mxDragSource.prototype.isActive=function(){return null!=this.mouseMoveHandler},mxDragSource.prototype.reset=function(){null!=this.currentGraph&&(this.dragExit(this.currentGraph),this.currentGraph=null),this.removeDragElement(),this.removeListeners(),this.stopDrag()},mxDragSource.prototype.mouseDown=function(t){this.enabled&&!mxEvent.isConsumed(t)&&null==this.mouseMoveHandler&&(this.startDrag(t),this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove),this.mouseUpHandler=mxUtils.bind(this,this.mouseUp),mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),mxClient.IS_TOUCH&&!mxEvent.isMouseEvent(t)&&(this.eventSource=mxEvent.getSource(t),mxEvent.addGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler)))},mxDragSource.prototype.startDrag=function(t){this.dragElement=this.createDragElement(t),this.dragElement.style.position="absolute",this.dragElement.style.zIndex=this.dragElementZIndex,mxUtils.setOpacity(this.dragElement,this.dragElementOpacity),this.checkEventSource&&mxClient.IS_SVG&&(this.dragElement.style.pointerEvents="none")},mxDragSource.prototype.stopDrag=function(){this.removeDragElement()},mxDragSource.prototype.removeDragElement=function(){null!=this.dragElement&&(null!=this.dragElement.parentNode&&this.dragElement.parentNode.removeChild(this.dragElement),this.dragElement=null)},mxDragSource.prototype.getElementForEvent=function(t){return mxEvent.isTouchEvent(t)||mxEvent.isPenEvent(t)?document.elementFromPoint(mxEvent.getClientX(t),mxEvent.getClientY(t)):mxEvent.getSource(t)},mxDragSource.prototype.graphContainsEvent=function(t,e){var n=mxEvent.getClientX(e),i=mxEvent.getClientY(e),l=mxUtils.getOffset(t.container),s=mxUtils.getScrollOrigin(),o=this.getElementForEvent(e);if(this.checkEventSource)for(;null!=o&&o!=t.container;)o=o.parentNode;return null!=o&&n>=l.x-s.x&&i>=l.y-s.y&&n<=l.x-s.x+t.container.offsetWidth&&i<=l.y-s.y+t.container.offsetHeight},mxDragSource.prototype.mouseMove=function(t){var e,n,i=this.getGraphForEvent(t);null==i||this.graphContainsEvent(i,t)||(i=null),i!=this.currentGraph&&(null!=this.currentGraph&&this.dragExit(this.currentGraph,t),this.currentGraph=i,null!=this.currentGraph&&this.dragEnter(this.currentGraph,t)),null!=this.currentGraph&&this.dragOver(this.currentGraph,t),null==this.dragElement||null!=this.previewElement&&"visible"==this.previewElement.style.visibility?null!=this.dragElement&&(this.dragElement.style.visibility="hidden"):(e=mxEvent.getClientX(t),n=mxEvent.getClientY(t),null==this.dragElement.parentNode&&document.body.appendChild(this.dragElement),this.dragElement.style.visibility="visible",null!=this.dragOffset&&(e+=this.dragOffset.x,n+=this.dragOffset.y),i=mxUtils.getDocumentScrollOrigin(document),this.dragElement.style.left=e+i.x+"px",this.dragElement.style.top=n+i.y+"px"),mxEvent.consume(t)},mxDragSource.prototype.mouseUp=function(t){var e,n,i;null!=this.currentGraph&&(null==this.currentPoint||null!=this.previewElement&&"hidden"==this.previewElement.style.visibility||(e=this.currentGraph.view.scale,i=this.currentGraph.view.translate,n=this.currentPoint.x/e-i.x,i=this.currentPoint.y/e-i.y,this.drop(this.currentGraph,t,this.currentDropTarget,n,i)),this.dragExit(this.currentGraph),this.currentGraph=null),this.stopDrag(),this.removeListeners(),mxEvent.consume(t)},mxDragSource.prototype.removeListeners=function(){null!=this.eventSource&&(mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler),this.eventSource=null),mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),this.mouseMoveHandler=null,this.mouseUpHandler=null},mxDragSource.prototype.dragEnter=function(t,e){t.isMouseDown=!0,t.isMouseTrigger=mxEvent.isMouseEvent(e),this.previewElement=this.createPreviewElement(t),null!=this.previewElement&&this.checkEventSource&&mxClient.IS_SVG&&(this.previewElement.style.pointerEvents="none"),this.isGuidesEnabled()&&null!=this.previewElement&&(this.currentGuide=new mxGuide(t,t.graphHandler.getGuideStates())),this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(t,mxConstants.DROP_TARGET_COLOR)),t.addListener(mxEvent.FIRE_MOUSE_EVENT,this.eventConsumer)},mxDragSource.prototype.dragExit=function(t,e){this.currentDropTarget=null,this.currentPoint=null,t.isMouseDown=!1,t.removeListener(this.eventConsumer),null!=this.previewElement&&(null!=this.previewElement.parentNode&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null),null!=this.currentGuide&&(this.currentGuide.destroy(),this.currentGuide=null),null!=this.currentHighlight&&(this.currentHighlight.destroy(),this.currentHighlight=null)},mxDragSource.prototype.dragOver=function(t,e){var n,i,l,s=mxUtils.getOffset(t.container),o=mxUtils.getScrollOrigin(t.container),r=mxEvent.getClientX(e)-s.x+o.x-t.panDx,s=mxEvent.getClientY(e)-s.y+o.y-t.panDy;t.autoScroll&&(null==this.autoscroll||this.autoscroll)&&t.scrollPointToVisible(r,s,t.autoExtend),null!=this.currentHighlight&&t.isDropEnabled()&&(this.currentDropTarget=this.getDropTarget(t,r,s,e),n=t.getView().getState(this.currentDropTarget),this.currentHighlight.highlight(n)),null!=this.previewElement&&(null==this.previewElement.parentNode&&(t.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute"),o=this.isGridEnabled()&&t.isGridEnabledEvent(e),n=!0,null!=this.currentGuide&&this.currentGuide.isEnabledForEvent(e)?(i=new mxRectangle(0,0,parseInt(this.previewElement.style.width),parseInt(this.previewElement.style.height)),l=new mxPoint(r,s),n=!1,r=(l=this.currentGuide.move(i,l,o,!0)).x,s=l.y):o&&(i=t.view.scale,l=t.view.translate,o=t.gridSize/2,r=(t.snap(r/i-l.x-o)+l.x)*i,s=(t.snap(s/i-l.y-o)+l.y)*i),null!=this.currentGuide&&n&&this.currentGuide.hide(),null!=this.previewOffset&&(r+=this.previewOffset.x,s+=this.previewOffset.y),this.previewElement.style.left=Math.round(r)+"px",this.previewElement.style.top=Math.round(s)+"px",this.previewElement.style.visibility="visible"),this.currentPoint=new mxPoint(r,s)},mxDragSource.prototype.drop=function(t,e,n,i,l){this.dropHandler.apply(this,arguments),"hidden"!=t.container.style.visibility&&t.container.focus()},mxToolbar.prototype=new mxEventSource,mxToolbar.prototype.constructor=mxToolbar,mxToolbar.prototype.container=null,mxToolbar.prototype.enabled=!0,mxToolbar.prototype.noReset=!1,mxToolbar.prototype.updateDefaultMode=!0,mxToolbar.prototype.addItem=function(t,e,n,i,l,s){var o=document.createElement(null!=e?"img":"button"),r=l||(null!=s?"mxToolbarMode":"mxToolbarItem");o.className=r,o.setAttribute("src",e),null!=t&&(null!=e?o.setAttribute("title",t):mxUtils.write(o,t)),this.container.appendChild(o),null!=n&&(mxEvent.addListener(o,"click",n),mxClient.IS_TOUCH&&mxEvent.addListener(o,"touchend",n));n=mxUtils.bind(this,function(t){null!=i?o.setAttribute("src",e):o.style.backgroundColor=""});return mxEvent.addGestureListeners(o,mxUtils.bind(this,function(t){var e;null!=i?o.setAttribute("src",i):o.style.backgroundColor="gray",null!=s&&(null==this.menu&&(this.menu=new mxPopupMenu,this.menu.init()),e=this.currentImg,this.menu.isMenuShowing()&&this.menu.hideMenu(),e!=o&&(this.currentImg=o,this.menu.factoryMethod=s,e=new mxPoint(o.offsetLeft,o.offsetTop+o.offsetHeight),this.menu.popup(e.x,e.y,null,t),this.menu.isMenuShowing()&&(o.className=r+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this),o.className=r,this.currentImg=null})))}),null,n),mxEvent.addListener(o,"mouseout",n),o},mxToolbar.prototype.addCombo=function(t){var e=document.createElement("div");e.style.display="inline",e.className="mxToolbarComboContainer";var n=document.createElement("select");return n.className=t||"mxToolbarCombo",e.appendChild(n),this.container.appendChild(e),n},mxToolbar.prototype.addActionCombo=function(t,e){var n=document.createElement("select");return n.className=e||"mxToolbarCombo",this.addOption(n,t,null),mxEvent.addListener(n,"change",function(t){var e=n.options[n.selectedIndex];n.selectedIndex=0,null!=e.funct&&e.funct(t)}),this.container.appendChild(n),n},mxToolbar.prototype.addOption=function(t,e,n){var i=document.createElement("option");return mxUtils.writeln(i,e),"function"==typeof n?i.funct=n:i.setAttribute("value",n),t.appendChild(i),i},mxToolbar.prototype.addSwitchMode=function(t,e,n,i,l){var s=document.createElement("img");return s.initialClassName=l||"mxToolbarMode",s.className=s.initialClassName,s.setAttribute("src",e),s.altIcon=i,null!=t&&s.setAttribute("title",t),mxEvent.addListener(s,"click",mxUtils.bind(this,function(t){var e=this.selectedMode.altIcon;null!=e?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",e)):this.selectedMode.className=this.selectedMode.initialClassName,this.updateDefaultMode&&(this.defaultMode=s),null!=(e=(this.selectedMode=s).altIcon)?(s.altIcon=s.getAttribute("src"),s.setAttribute("src",e)):s.className=s.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT)),n()})),this.container.appendChild(s),null==this.defaultMode&&(this.defaultMode=s,this.selectMode(s),n()),s},mxToolbar.prototype.addMode=function(t,e,n,i,l,s){s=null==s||s;var o=document.createElement(null!=e?"img":"button");return o.initialClassName=l||"mxToolbarMode",o.className=o.initialClassName,o.setAttribute("src",e),o.altIcon=i,null!=t&&o.setAttribute("title",t),this.enabled&&s&&(mxEvent.addListener(o,"click",mxUtils.bind(this,function(t){this.selectMode(o,n),this.noReset=!1})),mxEvent.addListener(o,"dblclick",mxUtils.bind(this,function(t){this.selectMode(o,n),this.noReset=!0})),null==this.defaultMode&&(this.defaultMode=o,this.defaultFunction=n,this.selectMode(o,n))),this.container.appendChild(o),o},mxToolbar.prototype.selectMode=function(t,e){var n;this.selectedMode!=t&&(null!=this.selectedMode&&(null!=(n=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",n)):this.selectedMode.className=this.selectedMode.initialClassName),this.selectedMode=t,null!=(n=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",n)):this.selectedMode.className=this.selectedMode.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",e)))},mxToolbar.prototype.resetMode=function(t){!t&&this.noReset||this.selectedMode==this.defaultMode||this.selectMode(this.defaultMode,this.defaultFunction)},mxToolbar.prototype.addSeparator=function(t){return this.addItem(null,t,null)},mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)},mxToolbar.prototype.addLine=function(){var t=document.createElement("hr");t.style.marginRight="6px",t.setAttribute("size","1"),this.container.appendChild(t)},mxToolbar.prototype.destroy=function(){mxEvent.release(this.container),this.container=null,this.defaultMode=null,this.defaultFunction=null,(this.selectedMode=null)!=this.menu&&this.menu.destroy()},mxUndoableEdit.prototype.source=null,mxUndoableEdit.prototype.changes=null,mxUndoableEdit.prototype.significant=null,mxUndoableEdit.prototype.undone=!1,mxUndoableEdit.prototype.redone=!1,mxUndoableEdit.prototype.isEmpty=function(){return 0==this.changes.length},mxUndoableEdit.prototype.isSignificant=function(){return this.significant},mxUndoableEdit.prototype.add=function(t){this.changes.push(t)},mxUndoableEdit.prototype.notify=function(){},mxUndoableEdit.prototype.die=function(){},mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var t=this.changes.length-1;0<=t;t--){var e=this.changes[t];null!=e.execute?e.execute():null!=e.undo&&e.undo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",e))}this.undone=!0,this.redone=!1,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var t=this.changes.length,e=0;e<t;e++){var n=this.changes[e];null!=n.execute?n.execute():null!=n.redo&&n.redo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",n))}this.undone=!1,this.redone=!0,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoManager.prototype=new mxEventSource,mxUndoManager.prototype.constructor=mxUndoManager,mxUndoManager.prototype.size=null,mxUndoManager.prototype.history=null,mxUndoManager.prototype.indexOfNextAdd=0,mxUndoManager.prototype.isEmpty=function(){return 0==this.history.length},mxUndoManager.prototype.clear=function(){this.history=[],this.indexOfNextAdd=0,this.fireEvent(new mxEventObject(mxEvent.CLEAR))},mxUndoManager.prototype.canUndo=function(){return 0<this.indexOfNextAdd},mxUndoManager.prototype.undo=function(){for(;0<this.indexOfNextAdd;){var t=this.history[--this.indexOfNextAdd];if(t.undo(),t.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t));break}}},mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd<this.history.length},mxUndoManager.prototype.redo=function(){for(var t=this.history.length;this.indexOfNextAdd<t;){var e=this.history[this.indexOfNextAdd++];if(e.redo(),e.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.REDO,"edit",e));break}}},mxUndoManager.prototype.undoableEditHappened=function(t){this.trim(),0<this.size&&this.size==this.history.length&&this.history.shift(),this.history.push(t),this.indexOfNextAdd=this.history.length,this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",t))},mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd)for(var t=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),e=0;e<t.length;e++)t[e].die()};var mxUrlConverter=function(){};function mxPanningManager(s){this.thread=null,this.active=!1,this.tdx=0,this.tdy=0,this.t0x=0,this.t0y=0,this.dx=0,this.dy=0,this.scrollbars=!1,this.scrollLeft=0,this.scrollTop=0,this.mouseListener={mouseDown:function(t,e){},mouseMove:function(t,e){},mouseUp:mxUtils.bind(this,function(t,e){this.active&&this.stop()})},s.addMouseListener(this.mouseListener),this.mouseUpListener=mxUtils.bind(this,function(){this.active&&this.stop()}),mxEvent.addListener(document,"mouseup",this.mouseUpListener);var o=mxUtils.bind(this,function(){return this.scrollbars=mxUtils.hasScrollbars(s.container),this.scrollLeft=s.container.scrollLeft,this.scrollTop=s.container.scrollTop,window.setInterval(mxUtils.bind(this,function(){var t,e;this.tdx-=this.dx,this.tdy-=this.dy,this.scrollbars?(t=-s.container.scrollLeft-Math.ceil(this.dx),e=-s.container.scrollTop-Math.ceil(this.dy),s.panGraph(t,e),s.panDx=this.scrollLeft-s.container.scrollLeft,s.panDy=this.scrollTop-s.container.scrollTop,s.fireEvent(new mxEventObject(mxEvent.PAN))):s.panGraph(this.getDx(),this.getDy())}),this.delay)});this.isActive=function(){return active},this.getDx=function(){return Math.round(this.tdx)},this.getDy=function(){return Math.round(this.tdy)},this.start=function(){this.t0x=s.view.translate.x,this.t0y=s.view.translate.y,this.active=!0},this.panTo=function(t,e,n,i){this.active||this.start(),this.scrollLeft=s.container.scrollLeft,this.scrollTop=s.container.scrollTop,n=null!=n?n:0,i=null!=i?i:0;var l=s.container;this.dx=t+n-l.scrollLeft-l.clientWidth,this.dx<0&&Math.abs(this.dx)<this.border?this.dx=this.border+this.dx:this.handleMouseOut?this.dx=Math.max(this.dx,0):this.dx=0,0==this.dx&&(this.dx=t-l.scrollLeft,0<this.dx&&this.dx<this.border?this.dx=this.dx-this.border:this.handleMouseOut?this.dx=Math.min(0,this.dx):this.dx=0),this.dy=e+i-l.scrollTop-l.clientHeight,this.dy<0&&Math.abs(this.dy)<this.border?this.dy=this.border+this.dy:this.handleMouseOut?this.dy=Math.max(this.dy,0):this.dy=0,0==this.dy&&(this.dy=e-l.scrollTop,0<this.dy&&this.dy<this.border?this.dy=this.dy-this.border:this.handleMouseOut?this.dy=Math.min(0,this.dy):this.dy=0),0!=this.dx||0!=this.dy?(this.dx*=this.damper,this.dy*=this.damper,null==this.thread&&(this.thread=o())):null!=this.thread&&(window.clearInterval(this.thread),this.thread=null)},this.stop=function(){var t,e;this.active&&(this.active=!1,null!=this.thread&&(window.clearInterval(this.thread),this.thread=null),this.tdx=0,this.tdy=0,this.scrollbars?(s.panDx=0,s.panDy=0,s.fireEvent(new mxEventObject(mxEvent.PAN))):(t=s.panDx,e=s.panDy,0==t&&0==e||(s.panGraph(0,0),s.view.setTranslate(this.t0x+t/s.view.scale,this.t0y+e/s.view.scale))))},this.destroy=function(){s.removeMouseListener(this.mouseListener),mxEvent.removeListener(document,"mouseup",this.mouseUpListener)}}function mxPopupMenu(t,e){null!=(this.factoryMethod=t)&&this.init(e)}function mxAutoSaveManager(t){this.changeHandler=mxUtils.bind(this,function(t,e){this.isEnabled()&&this.graphModelChanged(e.getProperty("edit").changes)}),this.setGraph(t)}function mxAnimation(t){this.delay=null!=t?t:20}function mxMorphing(t,e,n,i){mxAnimation.call(this,i),this.graph=t,this.steps=null!=e?e:6,this.ease=null!=n?n:1.5}function mxImageBundle(t){this.images=[],this.alt=null!=t&&t}function mxImageExport(){}function mxAbstractCanvas2D(){this.converter=this.createUrlConverter(),this.reset()}function mxXmlCanvas2D(t){mxAbstractCanvas2D.call(this),this.root=t,this.writeDefaults()}function mxSvgCanvas2D(t,e){mxAbstractCanvas2D.call(this),this.root=t,this.gradients=[],this.defs=null,this.styleEnabled=null!=e&&e;e=null;if(t.ownerDocument!=document){for(var n=t;null!=n&&"svg"!=n.nodeName;)n=n.parentNode;e=n}null!=e&&(0<e.getElementsByTagName("defs").length&&(this.defs=e.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=e.firstChild?e.insertBefore(this.defs,e.firstChild):e.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxUrlConverter.prototype.enabled=!0,mxUrlConverter.prototype.baseUrl=null,mxUrlConverter.prototype.baseDomain=null,mxUrlConverter.prototype.updateBaseUrl=function(){this.baseDomain=location.protocol+"//"+location.host,this.baseUrl=this.baseDomain+location.pathname;var t=this.baseUrl.lastIndexOf("/");0<t&&(this.baseUrl=this.baseUrl.substring(0,t+1))},mxUrlConverter.prototype.isEnabled=function(){return this.enabled},mxUrlConverter.prototype.setEnabled=function(t){this.enabled=t},mxUrlConverter.prototype.getBaseUrl=function(){return this.baseUrl},mxUrlConverter.prototype.setBaseUrl=function(t){this.baseUrl=t},mxUrlConverter.prototype.getBaseDomain=function(){return this.baseDomain},mxUrlConverter.prototype.setBaseDomain=function(t){this.baseDomain=t},mxUrlConverter.prototype.isRelativeUrl=function(t){return null!=t&&"//"!=t.substring(0,2)&&"http://"!=t.substring(0,7)&&"https://"!=t.substring(0,8)&&"data:image"!=t.substring(0,10)&&"file://"!=t.substring(0,7)},mxUrlConverter.prototype.convert=function(t){return this.isEnabled()&&this.isRelativeUrl(t)&&(null==this.getBaseUrl()&&this.updateBaseUrl(),t="/"==t.charAt(0)?this.getBaseDomain()+t:this.getBaseUrl()+t),t},mxPanningManager.prototype.damper=1/6,mxPanningManager.prototype.delay=10,mxPanningManager.prototype.handleMouseOut=!0,mxPanningManager.prototype.border=0,mxPopupMenu.prototype=new mxEventSource,mxPopupMenu.prototype.constructor=mxPopupMenu,mxPopupMenu.prototype.submenuImage=mxClient.imageBasePath+"/submenu.gif",mxPopupMenu.prototype.zIndex=10006,mxPopupMenu.prototype.factoryMethod=null,mxPopupMenu.prototype.useLeftButtonForPopup=!1,mxPopupMenu.prototype.enabled=!0,mxPopupMenu.prototype.itemCount=0,mxPopupMenu.prototype.autoExpand=!1,mxPopupMenu.prototype.smartSeparators=!1,mxPopupMenu.prototype.labels=!0,mxPopupMenu.prototype.init=function(t){this.root=t||document.body,this.table=document.createElement("table"),this.table.className="mxPopupMenu",this.tbody=document.createElement("tbody"),this.table.appendChild(this.tbody),this.div=document.createElement("div"),this.div.className="mxPopupMenu",this.div.style.display="inline",this.div.style.zIndex=this.zIndex,this.div.appendChild(this.table),mxEvent.disableContextMenu(this.div)},mxPopupMenu.prototype.isEnabled=function(){return this.enabled},mxPopupMenu.prototype.setEnabled=function(t){this.enabled=t},mxPopupMenu.prototype.isPopupTrigger=function(t){return t.isPopupTrigger()||this.useLeftButtonForPopup&&mxEvent.isLeftMouseButton(t.getEvent())},mxPopupMenu.prototype.addItem=function(t,e,n,i,l,s,o,r){i=i||this,this.itemCount++,i.willAddSeparator&&(i.containsItems&&this.addSeparator(i,!0),i.willAddSeparator=!1),i.containsItems=!0;var a=document.createElement("tr");a.className="mxPopupMenuItem";var h,d,u=document.createElement("td");return u.className="mxPopupMenuIcon",null!=e?((h=document.createElement("img")).src=e,u.appendChild(h)):null!=l&&((h=document.createElement("div")).className=l,u.appendChild(h)),a.appendChild(u),this.labels&&((u=document.createElement("td")).className="mxPopupMenuItem"+(null==s||s?"":" mxDisabled"),mxUtils.write(u,t),u.align="left",a.appendChild(u),(u=document.createElement("td")).className="mxPopupMenuItem"+(null==s||s?"":" mxDisabled"),u.style.paddingRight="6px",u.style.textAlign="right",a.appendChild(u),null==i.div&&this.createSubmenu(i)),i.tbody.appendChild(a),0!=o&&0!=s&&(d=null,mxEvent.addGestureListeners(a,mxUtils.bind(this,function(t){this.eventReceiver=a,i.activeRow!=a&&i.activeRow!=i&&(null!=i.activeRow&&null!=i.activeRow.div.parentNode&&this.hideSubmenu(i),null!=a.div&&(this.showSubmenu(i,a),i.activeRow=a)),null==document.selection||!mxClient.IS_QUIRKS&&8!=document.documentMode||(d=document.selection.createRange()),mxEvent.consume(t)}),mxUtils.bind(this,function(t){i.activeRow!=a&&i.activeRow!=i&&(null!=i.activeRow&&null!=i.activeRow.div.parentNode&&this.hideSubmenu(i),this.autoExpand&&null!=a.div&&(this.showSubmenu(i,a),i.activeRow=a)),r||(a.className="mxPopupMenuItemHover")}),mxUtils.bind(this,function(t){if(this.eventReceiver==a){if(i.activeRow!=a&&this.hideMenu(),null!=d){try{d.select()}catch(t){}d=null}null!=n&&n(t)}this.eventReceiver=null,mxEvent.consume(t)})),r||mxEvent.addListener(a,"mouseout",mxUtils.bind(this,function(t){a.className="mxPopupMenuItem"}))),a},mxPopupMenu.prototype.addCheckmark=function(t,e){t=t.firstChild.nextSibling;t.style.backgroundImage="url('"+e+"')",t.style.backgroundRepeat="no-repeat",t.style.backgroundPosition="2px 50%"},mxPopupMenu.prototype.createSubmenu=function(t){t.table=document.createElement("table"),t.table.className="mxPopupMenu",t.tbody=document.createElement("tbody"),t.table.appendChild(t.tbody),t.div=document.createElement("div"),t.div.className="mxPopupMenu",t.div.style.position="absolute",t.div.style.display="inline",t.div.style.zIndex=this.zIndex,t.div.appendChild(t.table);var e=document.createElement("img");e.setAttribute("src",this.submenuImage),td=t.firstChild.nextSibling.nextSibling,td.appendChild(e)},mxPopupMenu.prototype.showSubmenu=function(t,e){var n,i,l,s,o;null!=e.div&&(e.div.style.left=t.div.offsetLeft+e.offsetLeft+e.offsetWidth-1+"px",e.div.style.top=t.div.offsetTop+e.offsetTop+"px",document.body.appendChild(e.div),n=parseInt(e.div.offsetLeft),i=parseInt(e.div.offsetWidth),l=mxUtils.getDocumentScrollOrigin(document),s=document.body,o=document.documentElement,l.x+(s.clientWidth||o.clientWidth)<n+i&&(e.div.style.left=Math.max(0,t.div.offsetLeft-i+(mxClient.IS_IE?6:-6))+"px"),mxUtils.fit(e.div))},mxPopupMenu.prototype.addSeparator=function(t,e){var n,i;t=t||this,this.smartSeparators&&!e?t.willAddSeparator=!0:null!=t.tbody&&(t.willAddSeparator=!1,n=document.createElement("tr"),(i=document.createElement("td")).className="mxPopupMenuIcon",i.style.padding="0 0 0 0px",n.appendChild(i),(e=document.createElement("td")).style.padding="0 0 0 0px",e.setAttribute("colSpan","2"),(i=document.createElement("hr")).setAttribute("size","1"),e.appendChild(i),n.appendChild(e),t.tbody.appendChild(n))},mxPopupMenu.prototype.popup=function(t,e,n,i){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){for(this.div.style.left=t+"px",this.div.style.top=e+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0,this.factoryMethod(this,n,i),0<this.itemCount&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}},mxPopupMenu.prototype.isMenuShowing=function(){return null!=this.div&&this.div.parentNode==document.body},mxPopupMenu.prototype.showMenu=function(){9<=document.documentMode&&(this.div.style.filter="none"),(this.root||document.body).appendChild(this.div)},mxPopupMenu.prototype.hideMenu=function(){null!=this.div&&(null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1,this.fireEvent(new mxEventObject(mxEvent.HIDE)))},mxPopupMenu.prototype.hideSubmenu=function(t){null!=t.activeRow&&(this.hideSubmenu(t.activeRow),null!=t.activeRow.div.parentNode&&t.activeRow.div.parentNode.removeChild(t.activeRow.div),t.activeRow=null)},mxPopupMenu.prototype.destroy=function(){null!=this.div&&(mxEvent.release(this.div),null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null)},mxAutoSaveManager.prototype=new mxEventSource,mxAutoSaveManager.prototype.constructor=mxAutoSaveManager,mxAutoSaveManager.prototype.graph=null,mxAutoSaveManager.prototype.autoSaveDelay=10,mxAutoSaveManager.prototype.autoSaveThrottle=2,mxAutoSaveManager.prototype.autoSaveThreshold=5,mxAutoSaveManager.prototype.ignoredChanges=0,mxAutoSaveManager.prototype.lastSnapshot=0,mxAutoSaveManager.prototype.enabled=!0,mxAutoSaveManager.prototype.changeHandler=null,mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled},mxAutoSaveManager.prototype.setEnabled=function(t){this.enabled=t},mxAutoSaveManager.prototype.setGraph=function(t){null!=this.graph&&this.graph.getModel().removeListener(this.changeHandler),this.graph=t,null!=this.graph&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)},mxAutoSaveManager.prototype.save=function(){},mxAutoSaveManager.prototype.graphModelChanged=function(t){var e=((new Date).getTime()-this.lastSnapshot)/1e3;e>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&e>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++},mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime(),this.ignoredChanges=0},mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)},mxAnimation.prototype=new mxEventSource,mxAnimation.prototype.constructor=mxAnimation,mxAnimation.prototype.delay=null,mxAnimation.prototype.thread=null,mxAnimation.prototype.isRunning=function(){return null!=this.thread},mxAnimation.prototype.startAnimation=function(){null==this.thread&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))},mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))},mxAnimation.prototype.stopAnimation=function(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))},mxMorphing.prototype=new mxAnimation,mxMorphing.prototype.constructor=mxMorphing,mxMorphing.prototype.graph=null,mxMorphing.prototype.steps=null,mxMorphing.prototype.step=0,mxMorphing.prototype.ease=null,mxMorphing.prototype.cells=null,mxMorphing.prototype.updateAnimation=function(){mxAnimation.prototype.updateAnimation.apply(this,arguments);var t=new mxCellStatePreview(this.graph);if(null!=this.cells)for(var e=0;e<this.cells.length;e++)this.animateCell(this.cells[e],t,!1);else this.animateCell(this.graph.getModel().getRoot(),t,!0);this.show(t),(t.isEmpty()||this.step++>=this.steps)&&this.stopAnimation()},mxMorphing.prototype.show=function(t){t.show()},mxMorphing.prototype.animateCell=function(t,e,n){var i,l,s=this.graph.getView().getState(t),o=null;if(null!=s&&(o=this.getDelta(s),!this.graph.getModel().isVertex(t)||0==o.x&&0==o.y||(i=this.graph.view.getTranslate(),l=this.graph.view.getScale(),o.x+=i.x*l,o.y+=i.y*l,e.moveState(s,-o.x/this.ease,-o.y/this.ease))),n&&!this.stopRecursion(s,o))for(var r=this.graph.getModel().getChildCount(t),a=0;a<r;a++)this.animateCell(this.graph.getModel().getChildAt(t,a),e,n)},mxMorphing.prototype.stopRecursion=function(t,e){return null!=e&&(0!=e.x||0!=e.y)},mxMorphing.prototype.getDelta=function(t){var e=this.getOriginForCell(t.cell),n=this.graph.getView().getTranslate(),i=this.graph.getView().getScale(),l=t.x/i-n.x,n=t.y/i-n.y;return new mxPoint((e.x-l)*i,(e.y-n)*i)},mxMorphing.prototype.getOriginForCell=function(t){var e,n,i=null;return null!=t&&(e=this.graph.getModel().getParent(t),n=this.graph.getCellGeometry(t),i=this.getOriginForCell(e),null!=n&&(n.relative?null!=(e=this.graph.getCellGeometry(e))&&(i.x+=n.x*e.width,i.y+=n.y*e.height):(i.x+=n.x,i.y+=n.y))),null==i&&(i=new mxPoint(-(n=this.graph.view.getTranslate()).x,-n.y)),i},mxImageBundle.prototype.images=null,mxImageBundle.prototype.alt=null,mxImageBundle.prototype.putImage=function(t,e,n){this.images[t]={value:e,fallback:n}},mxImageBundle.prototype.getImage=function(t){var e=null;return null==t||null!=(t=this.images[t])&&(e=this.alt?t.fallback:t.value),e},mxImageExport.prototype.includeOverlays=!1,mxImageExport.prototype.drawState=function(t,e){null!=t&&(this.visitStatesRecursive(t,e,mxUtils.bind(this,function(){this.drawCellState.apply(this,arguments)})),this.includeOverlays&&this.visitStatesRecursive(t,e,mxUtils.bind(this,function(){this.drawOverlays.apply(this,arguments)})))},mxImageExport.prototype.visitStatesRecursive=function(t,e,n){if(null!=t){n(t,e);for(var i=t.view.graph,l=i.model.getChildCount(t.cell),s=0;s<l;s++){var o=i.view.getState(i.model.getChildAt(t.cell,s));this.visitStatesRecursive(o,e,n)}}},mxImageExport.prototype.getLinkForCellState=function(t,e){return null},mxImageExport.prototype.drawCellState=function(t,e){var n=this.getLinkForCellState(t,e);null!=n&&e.setLink(n),this.drawShape(t,e),this.drawText(t,e),null!=n&&e.setLink(null)},mxImageExport.prototype.drawShape=function(t,e){t.shape instanceof mxShape&&t.shape.checkBounds()&&(e.save(),t.shape.beforePaint(e),t.shape.paint(e),t.shape.afterPaint(e),e.restore())},mxImageExport.prototype.drawText=function(t,e){null!=t.text&&t.text.checkBounds()&&(e.save(),t.text.beforePaint(e),t.text.paint(e),t.text.afterPaint(e),e.restore())},mxImageExport.prototype.drawOverlays=function(t,n){null!=t.overlays&&t.overlays.visit(function(t,e){e instanceof mxShape&&e.paint(n)})},mxAbstractCanvas2D.prototype.state=null,mxAbstractCanvas2D.prototype.states=null,mxAbstractCanvas2D.prototype.path=null,mxAbstractCanvas2D.prototype.rotateHtml=!0,mxAbstractCanvas2D.prototype.lastX=0,mxAbstractCanvas2D.prototype.lastY=0,mxAbstractCanvas2D.prototype.moveOp="M",mxAbstractCanvas2D.prototype.lineOp="L",mxAbstractCanvas2D.prototype.quadOp="Q",mxAbstractCanvas2D.prototype.curveOp="C",mxAbstractCanvas2D.prototype.closeOp="Z",mxAbstractCanvas2D.prototype.pointerEvents=!1,mxAbstractCanvas2D.prototype.createUrlConverter=function(){return new mxUrlConverter},mxAbstractCanvas2D.prototype.reset=function(){this.state=this.createState(),this.states=[]},mxAbstractCanvas2D.prototype.createState=function(){return{dx:0,dy:0,scale:1,alpha:1,fillAlpha:1,strokeAlpha:1,fillColor:null,gradientFillAlpha:1,gradientColor:null,gradientAlpha:1,gradientDirection:null,strokeColor:null,strokeWidth:1,dashed:!1,dashPattern:"3 3",fixDash:!1,lineCap:"flat",lineJoin:"miter",miterLimit:10,fontColor:"#000000",fontBackgroundColor:null,fontBorderColor:null,fontSize:mxConstants.DEFAULT_FONTSIZE,fontFamily:mxConstants.DEFAULT_FONTFAMILY,fontStyle:0,shadow:!1,shadowColor:mxConstants.SHADOWCOLOR,shadowAlpha:mxConstants.SHADOW_OPACITY,shadowDx:mxConstants.SHADOW_OFFSET_X,shadowDy:mxConstants.SHADOW_OFFSET_Y,rotation:0,rotationCx:0,rotationCy:0}},mxAbstractCanvas2D.prototype.format=function(t){return Math.round(parseFloat(t))},mxAbstractCanvas2D.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var t=this.state,e=2;e<arguments.length;e+=2)this.lastX=arguments[e-1],this.lastY=arguments[e],this.path.push(this.format((this.lastX+t.dx)*t.scale)),this.path.push(this.format((this.lastY+t.dy)*t.scale))},mxAbstractCanvas2D.prototype.rotatePoint=function(t,e,n,i,l){n*=Math.PI/180;return mxUtils.getRotatedPoint(new mxPoint(t,e),Math.cos(n),Math.sin(n),new mxPoint(i,l))},mxAbstractCanvas2D.prototype.save=function(){this.states.push(this.state),this.state=mxUtils.clone(this.state)},mxAbstractCanvas2D.prototype.restore=function(){0<this.states.length&&(this.state=this.states.pop())},mxAbstractCanvas2D.prototype.setLink=function(t){},mxAbstractCanvas2D.prototype.scale=function(t){this.state.scale*=t,this.state.strokeWidth*=t},mxAbstractCanvas2D.prototype.translate=function(t,e){this.state.dx+=t,this.state.dy+=e},mxAbstractCanvas2D.prototype.rotate=function(t,e,n,i,l){},mxAbstractCanvas2D.prototype.setAlpha=function(t){this.state.alpha=t},mxAbstractCanvas2D.prototype.setFillAlpha=function(t){this.state.fillAlpha=t},mxAbstractCanvas2D.prototype.setStrokeAlpha=function(t){this.state.strokeAlpha=t},mxAbstractCanvas2D.prototype.setFillColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fillColor=t,this.state.gradientColor=null},mxAbstractCanvas2D.prototype.setGradient=function(t,e,n,i,l,s,o,r,a){var h=this.state;h.fillColor=t,h.gradientFillAlpha=null!=r?r:1,h.gradientColor=e,h.gradientAlpha=null!=a?a:1,h.gradientDirection=o},mxAbstractCanvas2D.prototype.setStrokeColor=function(t){t==mxConstants.NONE&&(t=null),this.state.strokeColor=t},mxAbstractCanvas2D.prototype.setStrokeWidth=function(t){this.state.strokeWidth=t},mxAbstractCanvas2D.prototype.setDashed=function(t,e){this.state.dashed=t,this.state.fixDash=e},mxAbstractCanvas2D.prototype.setDashPattern=function(t){this.state.dashPattern=t},mxAbstractCanvas2D.prototype.setLineCap=function(t){this.state.lineCap=t},mxAbstractCanvas2D.prototype.setLineJoin=function(t){this.state.lineJoin=t},mxAbstractCanvas2D.prototype.setMiterLimit=function(t){this.state.miterLimit=t},mxAbstractCanvas2D.prototype.setFontColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontColor=t},mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontBackgroundColor=t},mxAbstractCanvas2D.prototype.setFontBorderColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontBorderColor=t},mxAbstractCanvas2D.prototype.setFontSize=function(t){this.state.fontSize=parseFloat(t)},mxAbstractCanvas2D.prototype.setFontFamily=function(t){this.state.fontFamily=t},mxAbstractCanvas2D.prototype.setFontStyle=function(t){null==t&&(t=0),this.state.fontStyle=t},mxAbstractCanvas2D.prototype.setShadow=function(t){this.state.shadow=t},mxAbstractCanvas2D.prototype.setShadowColor=function(t){t==mxConstants.NONE&&(t=null),this.state.shadowColor=t},mxAbstractCanvas2D.prototype.setShadowAlpha=function(t){this.state.shadowAlpha=t},mxAbstractCanvas2D.prototype.setShadowOffset=function(t,e){this.state.shadowDx=t,this.state.shadowDy=e},mxAbstractCanvas2D.prototype.begin=function(){this.lastX=0,this.lastY=0,this.path=[]},mxAbstractCanvas2D.prototype.moveTo=function(t,e){this.addOp(this.moveOp,t,e)},mxAbstractCanvas2D.prototype.lineTo=function(t,e){this.addOp(this.lineOp,t,e)},mxAbstractCanvas2D.prototype.quadTo=function(t,e,n,i){this.addOp(this.quadOp,t,e,n,i)},mxAbstractCanvas2D.prototype.curveTo=function(t,e,n,i,l,s){this.addOp(this.curveOp,t,e,n,i,l,s)},mxAbstractCanvas2D.prototype.arcTo=function(t,e,n,i,l,s,o){var r=mxUtils.arcToCurves(this.lastX,this.lastY,t,e,n,i,l,s,o);if(null!=r)for(var a=0;a<r.length;a+=6)this.curveTo(r[a],r[a+1],r[a+2],r[a+3],r[a+4],r[a+5])},mxAbstractCanvas2D.prototype.close=function(t,e,n,i,l,s){this.addOp(this.closeOp)},mxAbstractCanvas2D.prototype.end=function(){},mxUtils.extend(mxXmlCanvas2D,mxAbstractCanvas2D),mxXmlCanvas2D.prototype.textEnabled=!0,mxXmlCanvas2D.prototype.compressed=!0,mxXmlCanvas2D.prototype.writeDefaults=function(){var t=this.createElement("fontfamily");t.setAttribute("family",mxConstants.DEFAULT_FONTFAMILY),this.root.appendChild(t),(t=this.createElement("fontsize")).setAttribute("size",mxConstants.DEFAULT_FONTSIZE),this.root.appendChild(t),(t=this.createElement("shadowcolor")).setAttribute("color",mxConstants.SHADOWCOLOR),this.root.appendChild(t),(t=this.createElement("shadowalpha")).setAttribute("alpha",mxConstants.SHADOW_OPACITY),this.root.appendChild(t),(t=this.createElement("shadowoffset")).setAttribute("dx",mxConstants.SHADOW_OFFSET_X),t.setAttribute("dy",mxConstants.SHADOW_OFFSET_Y),this.root.appendChild(t)},mxXmlCanvas2D.prototype.format=function(t){return parseFloat(parseFloat(t).toFixed(2))},mxXmlCanvas2D.prototype.createElement=function(t){return this.root.ownerDocument.createElement(t)},mxXmlCanvas2D.prototype.save=function(){this.compressed&&mxAbstractCanvas2D.prototype.save.apply(this,arguments),this.root.appendChild(this.createElement("save"))},mxXmlCanvas2D.prototype.restore=function(){this.compressed&&mxAbstractCanvas2D.prototype.restore.apply(this,arguments),this.root.appendChild(this.createElement("restore"))},mxXmlCanvas2D.prototype.scale=function(t){var e=this.createElement("scale");e.setAttribute("scale",t),this.root.appendChild(e)},mxXmlCanvas2D.prototype.translate=function(t,e){var n=this.createElement("translate");n.setAttribute("dx",this.format(t)),n.setAttribute("dy",this.format(e)),this.root.appendChild(n)},mxXmlCanvas2D.prototype.rotate=function(t,e,n,i,l){var s=this.createElement("rotate");(0!=t||e||n)&&(s.setAttribute("theta",this.format(t)),s.setAttribute("flipH",e?"1":"0"),s.setAttribute("flipV",n?"1":"0"),s.setAttribute("cx",this.format(i)),s.setAttribute("cy",this.format(l)),this.root.appendChild(s))},mxXmlCanvas2D.prototype.setAlpha=function(t){if(this.compressed){if(this.state.alpha==t)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var e=this.createElement("alpha");e.setAttribute("alpha",this.format(t)),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setFillAlpha=function(t){if(this.compressed){if(this.state.fillAlpha==t)return;mxAbstractCanvas2D.prototype.setFillAlpha.apply(this,arguments)}var e=this.createElement("fillalpha");e.setAttribute("alpha",this.format(t)),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setStrokeAlpha=function(t){if(this.compressed){if(this.state.strokeAlpha==t)return;mxAbstractCanvas2D.prototype.setStrokeAlpha.apply(this,arguments)}var e=this.createElement("strokealpha");e.setAttribute("alpha",this.format(t)),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setFillColor=function(t){if(t==mxConstants.NONE&&(t=null),this.compressed){if(this.state.fillColor==t)return;mxAbstractCanvas2D.prototype.setFillColor.apply(this,arguments)}var e=this.createElement("fillcolor");e.setAttribute("color",null!=t?t:mxConstants.NONE),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setGradient=function(t,e,n,i,l,s,o,r,a){var h;null!=t&&null!=e&&(mxAbstractCanvas2D.prototype.setGradient.apply(this,arguments),(h=this.createElement("gradient")).setAttribute("c1",t),h.setAttribute("c2",e),h.setAttribute("x",this.format(n)),h.setAttribute("y",this.format(i)),h.setAttribute("w",this.format(l)),h.setAttribute("h",this.format(s)),null!=o&&h.setAttribute("direction",o),null!=r&&h.setAttribute("alpha1",r),null!=a&&h.setAttribute("alpha2",a),this.root.appendChild(h))},mxXmlCanvas2D.prototype.setStrokeColor=function(t){if(t==mxConstants.NONE&&(t=null),this.compressed){if(this.state.strokeColor==t)return;mxAbstractCanvas2D.prototype.setStrokeColor.apply(this,arguments)}var e=this.createElement("strokecolor");e.setAttribute("color",null!=t?t:mxConstants.NONE),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setStrokeWidth=function(t){if(this.compressed){if(this.state.strokeWidth==t)return;mxAbstractCanvas2D.prototype.setStrokeWidth.apply(this,arguments)}var e=this.createElement("strokewidth");e.setAttribute("width",this.format(t)),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setDashed=function(t,e){if(this.compressed){if(this.state.dashed==t)return;mxAbstractCanvas2D.prototype.setDashed.apply(this,arguments)}var n=this.createElement("dashed");n.setAttribute("dashed",t?"1":"0"),null!=e&&n.setAttribute("fixDash",e?"1":"0"),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setDashPattern=function(t){if(this.compressed){if(this.state.dashPattern==t)return;mxAbstractCanvas2D.prototype.setDashPattern.apply(this,arguments)}var e=this.createElement("dashpattern");e.setAttribute("pattern",t),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setLineCap=function(t){if(this.compressed){if(this.state.lineCap==t)return;mxAbstractCanvas2D.prototype.setLineCap.apply(this,arguments)}var e=this.createElement("linecap");e.setAttribute("cap",t),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setLineJoin=function(t){if(this.compressed){if(this.state.lineJoin==t)return;mxAbstractCanvas2D.prototype.setLineJoin.apply(this,arguments)}var e=this.createElement("linejoin");e.setAttribute("join",t),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setMiterLimit=function(t){if(this.compressed){if(this.state.miterLimit==t)return;mxAbstractCanvas2D.prototype.setMiterLimit.apply(this,arguments)}var e=this.createElement("miterlimit");e.setAttribute("limit",t),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setFontColor=function(t){if(this.textEnabled){if(t==mxConstants.NONE&&(t=null),this.compressed){if(this.state.fontColor==t)return;mxAbstractCanvas2D.prototype.setFontColor.apply(this,arguments)}var e=this.createElement("fontcolor");e.setAttribute("color",null!=t?t:mxConstants.NONE),this.root.appendChild(e)}},mxXmlCanvas2D.prototype.setFontBackgroundColor=function(t){if(this.textEnabled){if(t==mxConstants.NONE&&(t=null),this.compressed){if(this.state.fontBackgroundColor==t)return;mxAbstractCanvas2D.prototype.setFontBackgroundColor.apply(this,arguments)}var e=this.createElement("fontbackgroundcolor");e.setAttribute("color",null!=t?t:mxConstants.NONE),this.root.appendChild(e)}},mxXmlCanvas2D.prototype.setFontBorderColor=function(t){if(this.textEnabled){if(t==mxConstants.NONE&&(t=null),this.compressed){if(this.state.fontBorderColor==t)return;mxAbstractCanvas2D.prototype.setFontBorderColor.apply(this,arguments)}var e=this.createElement("fontbordercolor");e.setAttribute("color",null!=t?t:mxConstants.NONE),this.root.appendChild(e)}},mxXmlCanvas2D.prototype.setFontSize=function(t){if(this.textEnabled){if(this.compressed){if(this.state.fontSize==t)return;mxAbstractCanvas2D.prototype.setFontSize.apply(this,arguments)}var e=this.createElement("fontsize");e.setAttribute("size",t),this.root.appendChild(e)}},mxXmlCanvas2D.prototype.setFontFamily=function(t){if(this.textEnabled){if(this.compressed){if(this.state.fontFamily==t)return;mxAbstractCanvas2D.prototype.setFontFamily.apply(this,arguments)}var e=this.createElement("fontfamily");e.setAttribute("family",t),this.root.appendChild(e)}},mxXmlCanvas2D.prototype.setFontStyle=function(t){if(this.textEnabled){if(null==t&&(t=0),this.compressed){if(this.state.fontStyle==t)return;mxAbstractCanvas2D.prototype.setFontStyle.apply(this,arguments)}var e=this.createElement("fontstyle");e.setAttribute("style",t),this.root.appendChild(e)}},mxXmlCanvas2D.prototype.setShadow=function(t){if(this.compressed){if(this.state.shadow==t)return;mxAbstractCanvas2D.prototype.setShadow.apply(this,arguments)}var e=this.createElement("shadow");e.setAttribute("enabled",t?"1":"0"),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setShadowColor=function(t){if(this.compressed){if(t==mxConstants.NONE&&(t=null),this.state.shadowColor==t)return;mxAbstractCanvas2D.prototype.setShadowColor.apply(this,arguments)}var e=this.createElement("shadowcolor");e.setAttribute("color",null!=t?t:mxConstants.NONE),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setShadowAlpha=function(t){if(this.compressed){if(this.state.shadowAlpha==t)return;mxAbstractCanvas2D.prototype.setShadowAlpha.apply(this,arguments)}var e=this.createElement("shadowalpha");e.setAttribute("alpha",t),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setShadowOffset=function(t,e){if(this.compressed){if(this.state.shadowDx==t&&this.state.shadowDy==e)return;mxAbstractCanvas2D.prototype.setShadowOffset.apply(this,arguments)}var n=this.createElement("shadowoffset");n.setAttribute("dx",t),n.setAttribute("dy",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.rect=function(t,e,n,i){var l=this.createElement("rect");l.setAttribute("x",this.format(t)),l.setAttribute("y",this.format(e)),l.setAttribute("w",this.format(n)),l.setAttribute("h",this.format(i)),this.root.appendChild(l)},mxXmlCanvas2D.prototype.roundrect=function(t,e,n,i,l,s){var o=this.createElement("roundrect");o.setAttribute("x",this.format(t)),o.setAttribute("y",this.format(e)),o.setAttribute("w",this.format(n)),o.setAttribute("h",this.format(i)),o.setAttribute("dx",this.format(l)),o.setAttribute("dy",this.format(s)),this.root.appendChild(o)},mxXmlCanvas2D.prototype.ellipse=function(t,e,n,i){var l=this.createElement("ellipse");l.setAttribute("x",this.format(t)),l.setAttribute("y",this.format(e)),l.setAttribute("w",this.format(n)),l.setAttribute("h",this.format(i)),this.root.appendChild(l)},mxXmlCanvas2D.prototype.image=function(t,e,n,i,l,s,o,r){l=this.converter.convert(l);var a=this.createElement("image");a.setAttribute("x",this.format(t)),a.setAttribute("y",this.format(e)),a.setAttribute("w",this.format(n)),a.setAttribute("h",this.format(i)),a.setAttribute("src",l),a.setAttribute("aspect",s?"1":"0"),a.setAttribute("flipH",o?"1":"0"),a.setAttribute("flipV",r?"1":"0"),this.root.appendChild(a)},mxXmlCanvas2D.prototype.begin=function(){this.root.appendChild(this.createElement("begin")),this.lastX=0,this.lastY=0},mxXmlCanvas2D.prototype.moveTo=function(t,e){var n=this.createElement("move");n.setAttribute("x",this.format(t)),n.setAttribute("y",this.format(e)),this.root.appendChild(n),this.lastX=t,this.lastY=e},mxXmlCanvas2D.prototype.lineTo=function(t,e){var n=this.createElement("line");n.setAttribute("x",this.format(t)),n.setAttribute("y",this.format(e)),this.root.appendChild(n),this.lastX=t,this.lastY=e},mxXmlCanvas2D.prototype.quadTo=function(t,e,n,i){var l=this.createElement("quad");l.setAttribute("x1",this.format(t)),l.setAttribute("y1",this.format(e)),l.setAttribute("x2",this.format(n)),l.setAttribute("y2",this.format(i)),this.root.appendChild(l),this.lastX=n,this.lastY=i},mxXmlCanvas2D.prototype.curveTo=function(t,e,n,i,l,s){var o=this.createElement("curve");o.setAttribute("x1",this.format(t)),o.setAttribute("y1",this.format(e)),o.setAttribute("x2",this.format(n)),o.setAttribute("y2",this.format(i)),o.setAttribute("x3",this.format(l)),o.setAttribute("y3",this.format(s)),this.root.appendChild(o),this.lastX=l,this.lastY=s},mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))},mxXmlCanvas2D.prototype.text=function(t,e,n,i,l,s,o,r,a,h,d,u,p){var m;this.textEnabled&&null!=l&&(mxUtils.isNode(l)&&(l=mxUtils.getOuterHtml(l)),(m=this.createElement("text")).setAttribute("x",this.format(t)),m.setAttribute("y",this.format(e)),m.setAttribute("w",this.format(n)),m.setAttribute("h",this.format(i)),m.setAttribute("str",l),null!=s&&m.setAttribute("align",s),null!=o&&m.setAttribute("valign",o),m.setAttribute("wrap",r?"1":"0"),null==a&&(a=""),m.setAttribute("format",a),null!=h&&m.setAttribute("overflow",h),null!=d&&m.setAttribute("clip",d?"1":"0"),null!=u&&m.setAttribute("rotation",u),null!=p&&m.setAttribute("dir",p),this.root.appendChild(m))},mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))},mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))},mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))},mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D),function(){if(mxSvgCanvas2D.prototype.useDomParser=!mxClient.IS_IE&&"function"==typeof DOMParser&&"function"==typeof XMLSerializer,mxSvgCanvas2D.prototype.useDomParser)try{var t=(new DOMParser).parseFromString("test text","text/html");mxSvgCanvas2D.prototype.useDomParser=null!=t}catch(t){mxSvgCanvas2D.prototype.useDomParser=!1}mxSvgCanvas2D.prototype.useAbsoluteIds=!mxClient.IS_CHROMEAPP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&0<document.getElementsByTagName("base").length}(),mxSvgCanvas2D.prototype.node=null,mxSvgCanvas2D.prototype.matchHtmlAlignment=!0,mxSvgCanvas2D.prototype.textEnabled=!0,mxSvgCanvas2D.prototype.foEnabled=!0,mxSvgCanvas2D.prototype.foAltText="[Object]",mxSvgCanvas2D.prototype.foOffset=0,mxSvgCanvas2D.prototype.textOffset=0,mxSvgCanvas2D.prototype.imageOffset=0,mxSvgCanvas2D.prototype.strokeTolerance=0,mxSvgCanvas2D.prototype.minStrokeWidth=1,mxSvgCanvas2D.prototype.refCount=0,mxSvgCanvas2D.prototype.lineHeightCorrection=1,mxSvgCanvas2D.prototype.pointerEventsValue="all",mxSvgCanvas2D.prototype.fontMetricsPadding=10,mxSvgCanvas2D.prototype.cacheOffsetSize=!0,mxSvgCanvas2D.prototype.format=function(t){return parseFloat(parseFloat(t).toFixed(2))},mxSvgCanvas2D.prototype.getBaseUrl=function(){var t=window.location.href,e=t.lastIndexOf("#");return 0<e&&(t=t.substring(0,e)),t},mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments),this.gradients=[]},mxSvgCanvas2D.prototype.createStyle=function(t){var e=this.createElement("style");return e.setAttribute("type","text/css"),mxUtils.write(e,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}"),e},mxSvgCanvas2D.prototype.createElement=function(t,e){if(null!=this.root.ownerDocument.createElementNS)return this.root.ownerDocument.createElementNS(e||mxConstants.NS_SVG,t);t=this.root.ownerDocument.createElement(t);return null!=e&&t.setAttribute("xmlns",e),t},mxSvgCanvas2D.prototype.getAlternateText=function(t,e,n,i,l,s,o,r,a,h,d,u,p){return null!=s?this.foAltText:null},mxSvgCanvas2D.prototype.createAlternateContent=function(t,e,n,i,l,s,o,r,a,h,d,u,p){d=this.getAlternateText(t,e,n,i,l,s,o,r,a,h,d,u,p),u=this.state;if(null!=d&&0<u.fontSize){p=r==mxConstants.ALIGN_TOP?1:r==mxConstants.ALIGN_BOTTOM?0:.3,r=o==mxConstants.ALIGN_RIGHT?"end":o==mxConstants.ALIGN_LEFT?"start":"middle",o=this.createElement("text");o.setAttribute("x",Math.round(e+u.dx)),o.setAttribute("y",Math.round(n+u.dy+p*u.fontSize)),o.setAttribute("fill",u.fontColor||"black"),o.setAttribute("font-family",u.fontFamily),o.setAttribute("font-size",Math.round(u.fontSize)+"px"),"start"!=r&&o.setAttribute("text-anchor",r),(u.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&o.setAttribute("font-weight","bold"),(u.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&o.setAttribute("font-style","italic");r=[];return(u.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&r.push("underline"),(u.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&r.push("line-through"),0<r.length&&o.setAttribute("text-decoration",r.join(" ")),mxUtils.write(o,d),o}return null},mxSvgCanvas2D.prototype.createGradientId=function(t,e,n,i,l){"#"==t.charAt(0)&&(t=t.substring(1)),"#"==e.charAt(0)&&(e=e.substring(1)),t=t.toLowerCase()+"-"+n,e=e.toLowerCase()+"-"+i;n=null;return null==l||l==mxConstants.DIRECTION_SOUTH?n="s":l==mxConstants.DIRECTION_EAST?n="e":(i=t,t=e,e=i,l==mxConstants.DIRECTION_NORTH?n="s":l==mxConstants.DIRECTION_WEST&&(n="e")),"mx-gradient-"+t+"-"+e+"-"+n},mxSvgCanvas2D.prototype.getSvgGradient=function(t,e,n,i,l){var s=this.createGradientId(t,e,n,i,l),o=this.gradients[s];if(null==o){var r=this.root.ownerSVGElement,a=0,h=s+"-"+a;if(null!=r)for(o=r.ownerDocument.getElementById(h);null!=o&&o.ownerSVGElement!=r;)h=s+"-"+a++,o=r.ownerDocument.getElementById(h);else h="id"+ ++this.refCount;null==o&&((o=this.createSvgGradient(t,e,n,i,l)).setAttribute("id",h),(null!=this.defs?this.defs:r).appendChild(o)),this.gradients[s]=o}return o.getAttribute("id")},mxSvgCanvas2D.prototype.createSvgGradient=function(t,e,n,i,l){var s=this.createElement("linearGradient");s.setAttribute("x1","0%"),s.setAttribute("y1","0%"),s.setAttribute("x2","0%"),s.setAttribute("y2","0%"),null==l||l==mxConstants.DIRECTION_SOUTH?s.setAttribute("y2","100%"):l==mxConstants.DIRECTION_EAST?s.setAttribute("x2","100%"):l==mxConstants.DIRECTION_NORTH?s.setAttribute("y1","100%"):l==mxConstants.DIRECTION_WEST&&s.setAttribute("x1","100%");l=n<1?";stop-opacity:"+n:"",n=this.createElement("stop");return n.setAttribute("offset","0%"),n.setAttribute("style","stop-color:"+t+l),s.appendChild(n),l=i<1?";stop-opacity:"+i:"",(n=this.createElement("stop")).setAttribute("offset","100%"),n.setAttribute("style","stop-color:"+e+l),s.appendChild(n),s},mxSvgCanvas2D.prototype.addNode=function(t,e){var n=this.node,i=this.state;if(null!=n){if("path"==n.nodeName){if(!(null!=this.path&&0<this.path.length))return;n.setAttribute("d",this.path.join(" "))}t&&null!=i.fillColor?this.updateFill():this.styleEnabled||("ellipse"==n.nodeName&&mxClient.IS_FF?n.setAttribute("fill","transparent"):n.setAttribute("fill","none"),t=!1),e&&null!=i.strokeColor?this.updateStroke():this.styleEnabled||n.setAttribute("stroke","none"),null!=i.transform&&0<i.transform.length&&n.setAttribute("transform",i.transform),i.shadow&&this.root.appendChild(this.createShadow(n)),0<this.strokeTolerance&&!t&&this.root.appendChild(this.createTolerance(n)),this.pointerEvents?n.setAttribute("pointer-events",this.pointerEventsValue):this.pointerEvents||null!=this.originalRoot||n.setAttribute("pointer-events","none"),("rect"!=n.nodeName&&"path"!=n.nodeName&&"ellipse"!=n.nodeName||"none"!=n.getAttribute("fill")&&"transparent"!=n.getAttribute("fill")||"none"!=n.getAttribute("stroke")||"none"!=n.getAttribute("pointer-events"))&&this.root.appendChild(n),this.node=null}},mxSvgCanvas2D.prototype.updateFill=function(){var t,e,n=this.state;(n.alpha<1||n.fillAlpha<1)&&this.node.setAttribute("fill-opacity",n.alpha*n.fillAlpha),null!=n.fillColor&&(null!=n.gradientColor?(t=this.getSvgGradient(String(n.fillColor),String(n.gradientColor),n.gradientFillAlpha,n.gradientAlpha,n.gradientDirection),this.root.ownerDocument==document&&this.useAbsoluteIds?(e=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),this.node.setAttribute("fill","url("+e+"#"+t+")")):this.node.setAttribute("fill","url(#"+t+")")):this.node.setAttribute("fill",String(n.fillColor).toLowerCase()))},mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))},mxSvgCanvas2D.prototype.updateStroke=function(){var t=this.state;this.node.setAttribute("stroke",String(t.strokeColor).toLowerCase()),(t.alpha<1||t.strokeAlpha<1)&&this.node.setAttribute("stroke-opacity",t.alpha*t.strokeAlpha);var e=this.getCurrentStrokeWidth();1!=e&&this.node.setAttribute("stroke-width",e),"path"==this.node.nodeName&&this.updateStrokeAttributes(),t.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((t.fixDash?1:t.strokeWidth)*t.scale))},mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var t,e=this.state;null!=e.lineJoin&&"miter"!=e.lineJoin&&this.node.setAttribute("stroke-linejoin",e.lineJoin),null!=e.lineCap&&("flat"==(t=e.lineCap)&&(t="butt"),"butt"!=t&&this.node.setAttribute("stroke-linecap",t)),null==e.miterLimit||this.styleEnabled&&10==e.miterLimit||this.node.setAttribute("stroke-miterlimit",e.miterLimit)},mxSvgCanvas2D.prototype.createDashPattern=function(t){var e=[];if("string"==typeof this.state.dashPattern){var n=this.state.dashPattern.split(" ");if(0<n.length)for(var i=0;i<n.length;i++)e[i]=Number(n[i])*t}return e.join(" ")},mxSvgCanvas2D.prototype.createTolerance=function(t){var e=t.cloneNode(!0),t=parseFloat(e.getAttribute("stroke-width")||1)+this.strokeTolerance;return e.setAttribute("pointer-events","stroke"),e.setAttribute("visibility","hidden"),e.removeAttribute("stroke-dasharray"),e.setAttribute("stroke-width",t),e.setAttribute("fill","none"),e.setAttribute("stroke",mxClient.IS_OT?"none":"white"),e},mxSvgCanvas2D.prototype.createShadow=function(t){var e=t.cloneNode(!0),t=this.state;return"none"==e.getAttribute("fill")||mxClient.IS_FF&&"transparent"==e.getAttribute("fill")||e.setAttribute("fill",t.shadowColor),"none"!=e.getAttribute("stroke")&&e.setAttribute("stroke",t.shadowColor),e.setAttribute("transform","translate("+this.format(t.shadowDx*t.scale)+","+this.format(t.shadowDy*t.scale)+")"+(t.transform||"")),e.setAttribute("opacity",t.shadowAlpha),e},mxSvgCanvas2D.prototype.setLink=function(t){var e;null==t?this.root=this.originalRoot:(this.originalRoot=this.root,null==(e=this.createElement("a")).setAttributeNS||this.root.ownerDocument!=document&&null==document.documentMode?e.setAttribute("xlink:href",t):e.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",t),this.root.appendChild(e),this.root=e)},mxSvgCanvas2D.prototype.rotate=function(t,e,n,i,l){var s,o,r,a,h;(0!=t||e||n)&&(i+=(s=this.state).dx,l+=s.dy,i*=s.scale,l*=s.scale,s.transform=s.transform||"",e&&n?t+=180:e!=n&&(o=e?i:0,r=e?-1:1,a=n?l:0,h=n?-1:1,s.transform+="translate("+this.format(o)+","+this.format(a)+")scale("+this.format(r)+","+this.format(h)+")translate("+this.format(-o)+","+this.format(-a)+")"),(e?!n:n)&&(t*=-1),0!=t&&(s.transform+="rotate("+this.format(t)+","+this.format(i)+","+this.format(l)+")"),s.rotation=s.rotation+t,s.rotationCx=i,s.rotationCy=l)},mxSvgCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=this.createElement("path")},mxSvgCanvas2D.prototype.rect=function(t,e,n,i){var l=this.state,s=this.createElement("rect");s.setAttribute("x",this.format((t+l.dx)*l.scale)),s.setAttribute("y",this.format((e+l.dy)*l.scale)),s.setAttribute("width",this.format(n*l.scale)),s.setAttribute("height",this.format(i*l.scale)),this.node=s},mxSvgCanvas2D.prototype.roundrect=function(t,e,n,i,l,s){this.rect(t,e,n,i),0<l&&this.node.setAttribute("rx",this.format(l*this.state.scale)),0<s&&this.node.setAttribute("ry",this.format(s*this.state.scale))},mxSvgCanvas2D.prototype.ellipse=function(t,e,n,i){var l=this.state,s=this.createElement("ellipse");s.setAttribute("cx",this.format((t+n/2+l.dx)*l.scale)),s.setAttribute("cy",this.format((e+i/2+l.dy)*l.scale)),s.setAttribute("rx",n/2*l.scale),s.setAttribute("ry",i/2*l.scale),this.node=s},mxSvgCanvas2D.prototype.image=function(t,e,n,i,l,s,o,r){l=this.converter.convert(l),s=null==s||s,o=null!=o&&o,r=null!=r&&r;var a=this.state;t+=a.dx,e+=a.dy;var h=this.createElement("image");h.setAttribute("x",this.format(t*a.scale)+this.imageOffset),h.setAttribute("y",this.format(e*a.scale)+this.imageOffset),h.setAttribute("width",this.format(n*a.scale)),h.setAttribute("height",this.format(i*a.scale)),null==h.setAttributeNS?h.setAttribute("xlink:href",l):h.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",l),s||h.setAttribute("preserveAspectRatio","none"),(a.alpha<1||a.fillAlpha<1)&&h.setAttribute("opacity",a.alpha*a.fillAlpha);var d,u,p=this.state.transform||"";(o||r)&&(u=d=1,s=l=0,o&&(d=-1,l=-n-2*t),r&&(u=-1,s=-i-2*e),p+="scale("+d+","+u+")translate("+l*a.scale+","+s*a.scale+")"),0<p.length&&h.setAttribute("transform",p),this.pointerEvents||h.setAttribute("pointer-events","none"),this.root.appendChild(h)},mxSvgCanvas2D.prototype.convertHtml=function(t){if(this.useDomParser){var e=(new DOMParser).parseFromString(t,"text/html");null!=e&&("<body"==(t=(new XMLSerializer).serializeToString(e.body)).substring(0,5)&&(t=t.substring(t.indexOf(">",5)+1)),"</body>"==t.substring(t.length-7,t.length)&&(t=t.substring(0,t.length-7)))}else{if(null!=document.implementation&&null!=document.implementation.createDocument){var n=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null),i=n.createElement("body");n.documentElement.appendChild(i);var l=document.createElement("div");l.innerHTML=t;for(var s=l.firstChild;null!=s;){var o=s.nextSibling;i.appendChild(n.adoptNode(s)),s=o}return i.innerHTML}l=document.createElement("textarea");l.innerHTML=t.replace(/&amp;/g,"&amp;amp;").replace(/&#60;/g,"&amp;lt;").replace(/&#62;/g,"&amp;gt;").replace(/&lt;/g,"&amp;lt;").replace(/&gt;/g,"&amp;gt;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),t=l.value.replace(/&/g,"&amp;").replace(/&amp;lt;/g,"&lt;").replace(/&amp;gt;/g,"&gt;").replace(/&amp;amp;/g,"&amp;").replace(/<br>/g,"<br />").replace(/<hr>/g,"<hr />").replace(/(<img[^>]+)>/gm,"$1 />")}return t},mxSvgCanvas2D.prototype.createDiv=function(t){var e=t;if(mxUtils.isNode(e)||(e="<div><div>"+this.convertHtml(e)+"</div></div>"),mxClient.IS_IE||mxClient.IS_IE11||!document.createElementNS)return mxUtils.isNode(e)&&(e="<div><div>"+mxUtils.getXml(e)+"</div></div>"),e='<div xmlns="http://www.w3.org/1999/xhtml">'+e+"</div>",mxUtils.parseXml(e).documentElement;var n,i=document.createElementNS("http://www.w3.org/1999/xhtml","div");return mxUtils.isNode(e)?(t=(n=document.createElement("div")).cloneNode(!1),this.root.ownerDocument!=document?n.appendChild(e.cloneNode(!0)):n.appendChild(e),t.appendChild(n),i.appendChild(t)):i.innerHTML=e,i},mxSvgCanvas2D.prototype.updateText=function(t,e,n,i,l,s,o,r,a,h,d){null!=d&&null!=d.firstChild&&null!=d.firstChild.firstChild&&this.updateTextNodes(t,e,n,i,l,s,o,r,a,h,d.firstChild)},mxSvgCanvas2D.prototype.addForeignObject=function(t,e,n,i,l,s,o,r,a,h,d,u,p,m,c){var g=this.createElement("g"),x=this.createElement("foreignObject");x.setAttribute("style","overflow: visible; text-align: left;"),x.setAttribute("pointer-events","none"),m.ownerDocument!=document&&(m=mxUtils.importNodeImplementation(x.ownerDocument,m,!0)),x.appendChild(m),g.appendChild(x),this.updateTextNodes(t,e,n,i,s,o,r,h,d,u,g),this.root.ownerDocument==document||null!=(d=this.createAlternateContent(x,t,e,n,i,l,s,o,r,a,h,d,u))&&(x.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility"),(u=this.createElement("switch")).appendChild(x),u.appendChild(d),g.appendChild(u)),c.appendChild(g)},mxSvgCanvas2D.prototype.updateTextNodes=function(u,p,t,e,n,i,l,s,o,m,c){var g=this.state.scale;mxSvgCanvas2D.createCss(t+2,e,n,i,l,s,o,null!=this.state.fontBackgroundColor?this.state.fontBackgroundColor:null,null!=this.state.fontBorderColor?this.state.fontBorderColor:null,"display: flex; align-items: unsafe "+(i==mxConstants.ALIGN_TOP?"flex-start":i==mxConstants.ALIGN_BOTTOM?"flex-end":"center")+"; justify-content: unsafe "+(n==mxConstants.ALIGN_LEFT?"flex-start":n==mxConstants.ALIGN_RIGHT?"flex-end":"center")+"; ",this.getTextCss(),g,mxUtils.bind(this,function(t,e,n,i,l){u+=this.state.dx,p+=this.state.dy;var s=c.firstChild,o=s.firstChild,r=o.firstChild,a=r.firstChild,h=(this.rotateHtml?this.state.rotation:0)+(null!=m?m:0),d=(0!=this.foOffset?"translate("+this.foOffset+" "+this.foOffset+")":"")+(1!=g?"scale("+g+")":"");a.setAttribute("style",l),r.setAttribute("style",i),s.setAttribute("width",Math.ceil(1/Math.min(1,g)*100)+"%"),s.setAttribute("height",Math.ceil(1/Math.min(1,g)*100)+"%");e=Math.round(p+e);e<0?s.setAttribute("y",e):(s.removeAttribute("y"),n+="padding-top: "+e+"px; "),o.setAttribute("style",n+"margin-left: "+Math.round(u+t)+"px;"),(d+=0!=h?"rotate("+h+" "+u+" "+p+")":"")?c.setAttribute("transform",d):c.removeAttribute("transform"),1!=this.state.alpha?c.setAttribute("opacity",this.state.alpha):c.removeAttribute("opacity")}))},mxSvgCanvas2D.createCss=function(t,e,n,i,l,s,o,r,a,h,d,u,p){var m="box-sizing: border-box; font-size: 0; text-align: "+(n==mxConstants.ALIGN_LEFT?"left":n==mxConstants.ALIGN_RIGHT?"right":"center")+"; ",c=mxUtils.getAlignmentAsPoint(n,i),g="overflow: hidden; ",x="width: 1px; ",n="height: 1px; ",i=c.x*t,c=c.y*e;o?(x="width: "+Math.round(t)+"px; ",m+="max-height: "+Math.round(e)+"px; ",c=0):"fill"==s?(d+="width: 100%; height: 100%; ",m+=(x="width: "+Math.round(t)+"px; ")+(n="height: "+Math.round(e)+"px; ")):"width"==s?(d+="width: 100%; ",m+=x="width: "+Math.round(t)+"px; ",(c=0)<e&&(m+="max-height: "+Math.round(e)+"px; ")):(g="",c=0);e="";null!=r&&(e+="background-color: "+r+"; "),null!=a&&(e+="border: 1px solid "+a+"; "),""==g||o?d+=e:m+=e,l&&0<t?(d+="white-space: normal; word-wrap: "+mxConstants.WORD_WRAP+"; ",x="width: "+Math.round(t)+"px; ",""!=g&&"fill"!=s&&(c=0)):(d+="white-space: nowrap; ",""==g&&(i=0)),p(i,c,h+x+n,m+g,d,g)},mxSvgCanvas2D.prototype.getTextCss=function(){var t=this.state,e=mxConstants.ABSOLUTE_LINE_HEIGHT?t.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*this.lineHeightCorrection,n="display: inline-block; font-size: "+t.fontSize+"px; font-family: "+t.fontFamily+"; color: "+t.fontColor+"; line-height: "+e+"; pointer-events: "+(this.pointerEvents?this.pointerEventsValue:"none")+"; ";(t.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(n+="font-weight: bold; "),(t.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(n+="font-style: italic; ");e=[];return(t.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&e.push("underline"),(t.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&e.push("line-through"),0<e.length&&(n+="text-decoration: "+e.join(" ")+"; "),n},mxSvgCanvas2D.prototype.text=function(t,e,n,i,l,s,o,r,a,h,d,u,p){var m;this.textEnabled&&null!=l&&(u=null!=u?u:0,this.foEnabled&&"html"==a?null!=(m=this.createDiv(l))&&(null!=p&&m.setAttribute("dir",p),this.addForeignObject(t,e,n,i,l,s,o,r,a,h,d,u,p,m,this.root)):this.plainText(t+this.state.dx,e+this.state.dy,n,i,l,s,o,r,h,d,u,p))},mxSvgCanvas2D.prototype.createClip=function(t,e,n,i){for(var l="mx-clip-"+(t=Math.round(t))+"-"+(e=Math.round(e))+"-"+(n=Math.round(n))+"-"+(i=Math.round(i)),s=0,o=l+"-"+s;null!=document.getElementById(o);)o=l+"-"+ ++s;clip=this.createElement("clipPath"),clip.setAttribute("id",o);var r=this.createElement("rect");return r.setAttribute("x",t),r.setAttribute("y",e),r.setAttribute("width",n),r.setAttribute("height",i),clip.appendChild(r),clip},mxSvgCanvas2D.prototype.plainText=function(t,e,n,i,l,s,o,r,a,h,d,u){d=null!=d?d:0;var p=this.state,m=p.fontSize,c=this.createElement("g"),g=p.transform||"";this.updateFont(c),this.pointerEvents||null!=this.originalRoot||c.setAttribute("pointer-events","none"),0!=d&&(g+="rotate("+d+","+this.format(t*p.scale)+","+this.format(e*p.scale)+")"),null!=u&&c.setAttribute("direction",u),h&&0<n&&0<i&&(u=t,C=e,s==mxConstants.ALIGN_CENTER?u-=n/2:s==mxConstants.ALIGN_RIGHT&&(u-=n),"fill"!=a&&(o==mxConstants.ALIGN_MIDDLE?C-=i/2:o==mxConstants.ALIGN_BOTTOM&&(C-=i)),x=this.createClip(u*p.scale-2,C*p.scale-2,n*p.scale+4,i*p.scale+4),(null!=this.defs?this.defs:this.root).appendChild(x),mxClient.IS_CHROMEAPP||mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE||this.root.ownerDocument!=document?c.setAttribute("clip-path","url(#"+x.getAttribute("id")+")"):(u=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),c.setAttribute("clip-path","url("+u+"#"+x.getAttribute("id")+")")));var x=s==mxConstants.ALIGN_RIGHT?"end":s==mxConstants.ALIGN_CENTER?"middle":"start";"start"!=x&&c.setAttribute("text-anchor",x),this.styleEnabled&&m==mxConstants.DEFAULT_FONTSIZE||c.setAttribute("font-size",m*p.scale+"px"),0<g.length&&c.setAttribute("transform",g),p.alpha<1&&c.setAttribute("opacity",p.alpha);var y=l.split("\n"),f=Math.round(m*mxConstants.LINE_HEIGHT),g=m+(y.length-1)*f,C=e+m-1;o==mxConstants.ALIGN_MIDDLE?C-="fill"==a?i/2:(this.matchHtmlAlignment&&h&&0<i?Math.min(g,i):g)/2:o==mxConstants.ALIGN_BOTTOM&&(C-="fill"==a?i:(this.matchHtmlAlignment&&h&&0<i?Math.min(g,i):g)+1);for(var v,E=0;E<y.length;E++)0<y[E].length&&0<mxUtils.trim(y[E]).length&&((v=this.createElement("text")).setAttribute("x",this.format(t*p.scale)+this.textOffset),v.setAttribute("y",this.format(C*p.scale)+this.textOffset),mxUtils.write(v,y[E]),c.appendChild(v)),C+=f;this.root.appendChild(c),this.addTextBackground(c,l,t,e,n,"fill"==a?i:g,s,o,a)},mxSvgCanvas2D.prototype.updateFont=function(t){var e=this.state;t.setAttribute("fill",e.fontColor),this.styleEnabled&&e.fontFamily==mxConstants.DEFAULT_FONTFAMILY||t.setAttribute("font-family",e.fontFamily),(e.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&t.setAttribute("font-weight","bold"),(e.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&t.setAttribute("font-style","italic");var n=[];(e.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.push("underline"),(e.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&n.push("line-through"),0<n.length&&t.setAttribute("text-decoration",n.join(" "))},mxSvgCanvas2D.prototype.addTextBackground=function(t,e,n,i,l,s,o,r,a){var h=this.state;if(null!=h.fontBackgroundColor||null!=h.fontBorderColor){var d=null;if("fill"==a||"width"==a)o==mxConstants.ALIGN_CENTER?n-=l/2:o==mxConstants.ALIGN_RIGHT&&(n-=l),r==mxConstants.ALIGN_MIDDLE?i-=s/2:r==mxConstants.ALIGN_BOTTOM&&(i-=s),d=new mxRectangle((n+1)*h.scale,i*h.scale,(l-2)*h.scale,(s+2)*h.scale);else if(null!=t.getBBox&&this.root.ownerDocument==document)try{d=t.getBBox();var u=mxClient.IS_IE&&mxClient.IS_SVG,d=new mxRectangle(d.x,d.y+(u?0:1),d.width,d.height+(u?1:0))}catch(t){}null!=d&&0!=d.width&&0!=d.height||((a=document.createElement("div")).style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?h.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,a.style.fontSize=h.fontSize+"px",a.style.fontFamily=h.fontFamily,a.style.whiteSpace="nowrap",a.style.position="absolute",a.style.visibility="hidden",a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",(h.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a.style.fontWeight="bold"),(h.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a.style.fontStyle="italic"),e=mxUtils.htmlEntities(e,!1),a.innerHTML=e.replace(/\n/g,"<br/>"),document.body.appendChild(a),l=a.offsetWidth,s=a.offsetHeight,a.parentNode.removeChild(a),o==mxConstants.ALIGN_CENTER?n-=l/2:o==mxConstants.ALIGN_RIGHT&&(n-=l),r==mxConstants.ALIGN_MIDDLE?i-=s/2:r==mxConstants.ALIGN_BOTTOM&&(i-=s),d=new mxRectangle((n+1)*h.scale,(i+2)*h.scale,l*h.scale,(s+1)*h.scale)),null!=d&&((s=this.createElement("rect")).setAttribute("fill",h.fontBackgroundColor||"none"),s.setAttribute("stroke",h.fontBorderColor||"none"),s.setAttribute("x",Math.floor(d.x-1)),s.setAttribute("y",Math.floor(d.y-1)),s.setAttribute("width",Math.ceil(d.width+2)),s.setAttribute("height",Math.ceil(d.height)),h=null!=h.fontBorderColor?Math.max(1,this.format(h.scale)):0,s.setAttribute("stroke-width",h),this.root.ownerDocument==document&&1==mxUtils.mod(h,2)&&s.setAttribute("transform","translate(0.5, 0.5)"),t.insertBefore(s,t.firstChild))}},mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)};var mxVmlCanvas2D=function(t){mxAbstractCanvas2D.call(this),this.root=t};function mxGuide(t,e){this.graph=t,this.setStates(e)}function mxShape(t){this.stencil=t,this.initStyles()}function mxStencil(t){this.desc=t,this.parseDescription(),this.parseConstraints()}mxUtils.extend(mxVmlCanvas2D,mxAbstractCanvas2D),mxVmlCanvas2D.prototype.node=null,mxVmlCanvas2D.prototype.textEnabled=!0,mxVmlCanvas2D.prototype.moveOp="m",mxVmlCanvas2D.prototype.lineOp="l",mxVmlCanvas2D.prototype.curveOp="c",mxVmlCanvas2D.prototype.closeOp="x",mxVmlCanvas2D.prototype.rotatedHtmlBackground="",mxVmlCanvas2D.prototype.vmlScale=1,mxVmlCanvas2D.prototype.createElement=function(t){return document.createElement(t)},mxVmlCanvas2D.prototype.createVmlElement=function(t){return this.createElement(mxClient.VML_PREFIX+":"+t)},mxVmlCanvas2D.prototype.addNode=function(t,e){var n=this.node,i=this.state;if(null!=n){if("shape"==n.nodeName){if(!(null!=this.path&&0<this.path.length))return;n.path=this.path.join(" ")+" e",n.style.width=this.root.style.width,n.style.height=this.root.style.height,n.coordsize=parseInt(n.style.width)+" "+parseInt(n.style.height)}n.strokeweight=this.format(Math.max(1,i.strokeWidth*i.scale/this.vmlScale))+"px",i.shadow&&this.root.appendChild(this.createShadow(n,t&&null!=i.fillColor,e&&null!=i.strokeColor)),e&&null!=i.strokeColor?(n.stroked="true",n.strokecolor=i.strokeColor):n.stroked="false",n.appendChild(this.createStroke()),t&&null!=i.fillColor?n.appendChild(this.createFill()):!this.pointerEvents||"shape"==n.nodeName&&this.path[this.path.length-1]!=this.closeOp?n.filled="false":n.appendChild(this.createTransparentFill()),this.root.appendChild(n)}},mxVmlCanvas2D.prototype.createTransparentFill=function(){var t=this.createVmlElement("fill");return t.src=mxClient.imageBasePath+"/transparent.gif",t.type="tile",t},mxVmlCanvas2D.prototype.createFill=function(){var t,e=this.state,n=this.createVmlElement("fill");return n.color=e.fillColor,null!=e.gradientColor?(n.type="gradient",n.method="none",n.color2=e.gradientColor,t=180-e.rotation,e.gradientDirection==mxConstants.DIRECTION_WEST?t-=90+("x"==this.root.style.flip?180:0):e.gradientDirection==mxConstants.DIRECTION_EAST?t+=90+("x"==this.root.style.flip?180:0):e.gradientDirection==mxConstants.DIRECTION_NORTH?t-=180+("y"==this.root.style.flip?-180:0):t+="y"==this.root.style.flip?-180:0,"x"!=this.root.style.flip&&"y"!=this.root.style.flip||(t*=-1),n.angle=mxUtils.mod(t,360),n.opacity=e.alpha*e.gradientFillAlpha*100+"%",n.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",e.alpha*e.gradientAlpha*100+"%")):(e.alpha<1||e.fillAlpha<1)&&(n.opacity=e.alpha*e.fillAlpha*100+"%"),n},mxVmlCanvas2D.prototype.createStroke=function(){var t=this.state,e=this.createVmlElement("stroke");return e.endcap=t.lineCap||"flat",e.joinstyle=t.lineJoin||"miter",e.miterlimit=t.miterLimit||"10",(t.alpha<1||t.strokeAlpha<1)&&(e.opacity=t.alpha*t.strokeAlpha*100+"%"),t.dashed&&(e.dashstyle=this.getVmlDashStyle()),e},mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var t,e="dash";return"string"!=typeof this.state.dashPattern||0<(t=this.state.dashPattern.split(" ")).length&&1==t[0]&&(e="0 2"),e},mxVmlCanvas2D.prototype.createShadow=function(t,e,n){var i=this.state,l=-i.rotation*(Math.PI/180),s=Math.cos(l),o=Math.sin(l),r=i.shadowDx*i.scale,a=i.shadowDy*i.scale;"x"==this.root.style.flip?r*=-1:"y"==this.root.style.flip&&(a*=-1);l=t.cloneNode(!0);return l.style.marginLeft=Math.round(r*s-a*o)+"px",l.style.marginTop=Math.round(r*o+a*s)+"px",8==document.documentMode&&(l.strokeweight=t.strokeweight,"shape"==t.nodeName&&(l.path=this.path.join(" ")+" e",l.style.width=this.root.style.width,l.style.height=this.root.style.height,l.coordsize=parseInt(t.style.width)+" "+parseInt(t.style.height))),n?(l.strokecolor=i.shadowColor,l.appendChild(this.createShadowStroke())):l.stroked="false",e?l.appendChild(this.createShadowFill()):l.filled="false",l},mxVmlCanvas2D.prototype.createShadowFill=function(){var t=this.createVmlElement("fill");return t.color=this.state.shadowColor,t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.createShadowStroke=function(){var t=this.createStroke();return t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.rotate=function(t,e,n,i,l){e&&n?t+=180:e?this.root.style.flip="x":n&&(this.root.style.flip="y"),(e?!n:n)&&(t*=-1),this.root.style.rotation=t,this.state.rotation=this.state.rotation+t,this.state.rotationCx=i,this.state.rotationCy=l},mxVmlCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=this.createVmlElement("shape"),this.node.style.position="absolute"},mxVmlCanvas2D.prototype.quadTo=function(t,e,n,i){var l=this.state,s=(this.lastX+l.dx)*l.scale,o=(this.lastY+l.dy)*l.scale,t=(t+l.dx)*l.scale,e=(e+l.dy)*l.scale,n=(n+l.dx)*l.scale,i=(i+l.dy)*l.scale,s=s+2/3*(t-s),o=o+2/3*(e-o),t=n+2/3*(t-n),e=i+2/3*(e-i);this.path.push("c "+this.format(s)+" "+this.format(o)+" "+this.format(t)+" "+this.format(e)+" "+this.format(n)+" "+this.format(i)),this.lastX=n/l.scale-l.dx,this.lastY=i/l.scale-l.dy},mxVmlCanvas2D.prototype.createRect=function(t,e,n,i,l){var s=this.state,t=this.createVmlElement(t);return t.style.position="absolute",t.style.left=this.format((e+s.dx)*s.scale)+"px",t.style.top=this.format((n+s.dy)*s.scale)+"px",t.style.width=this.format(i*s.scale)+"px",t.style.height=this.format(l*s.scale)+"px",t},mxVmlCanvas2D.prototype.rect=function(t,e,n,i){this.node=this.createRect("rect",t,e,n,i)},mxVmlCanvas2D.prototype.roundrect=function(t,e,n,i,l,s){this.node=this.createRect("roundrect",t,e,n,i),this.node.setAttribute("arcsize",Math.max(100*l/n,100*s/i)+"%")},mxVmlCanvas2D.prototype.ellipse=function(t,e,n,i){this.node=this.createRect("oval",t,e,n,i)},mxVmlCanvas2D.prototype.image=function(t,e,n,i,l,s,o,r){var a,h=null;s?((h=this.createRect("rect",t,e,n,i)).stroked="false",(a=this.createVmlElement("fill")).aspect=s?"atmost":"ignore",a.rotate="true",a.type="frame",a.src=l,h.appendChild(a)):(h=this.createRect("image",t,e,n,i)).src=l,o&&r?h.style.rotation="180":o?h.style.flip="x":r&&(h.style.flip="y"),(this.state.alpha<1||this.state.fillAlpha<1)&&(h.style.filter+="alpha(opacity="+this.state.alpha*this.state.fillAlpha*100+")"),this.root.appendChild(h)},mxVmlCanvas2D.prototype.createDiv=function(t,e,n,i){var l=this.createElement("div"),s=this.state,o="";null!=s.fontBackgroundColor&&(o+="background-color:"+mxUtils.htmlEntities(s.fontBackgroundColor)+";"),null!=s.fontBorderColor&&(o+="border:1px solid "+mxUtils.htmlEntities(s.fontBorderColor)+";"),mxUtils.isNode(t)?l.appendChild(t):"fill"!=i&&"width"!=i?((i=this.createElement("div")).style.cssText=o,i.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",i.style.zoom="1",i.style.textDecoration="inherit",i.innerHTML=t,l.appendChild(i)):(l.style.cssText=o,l.innerHTML=t);t=l.style;return t.fontSize=s.fontSize/this.vmlScale+"px",t.fontFamily=s.fontFamily,t.color=s.fontColor,t.verticalAlign="top",t.textAlign=e||"left",t.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?s.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale+"px":mxConstants.LINE_HEIGHT,(s.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(t.fontWeight="bold"),(s.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(t.fontStyle="italic"),(s.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(t.textDecoration="underline"),l},mxVmlCanvas2D.prototype.text=function(t,e,n,i,l,s,o,r,a,h,d,u,p){var m,c,g,x,y,f,C,v,E,S,w,b,T;this.textEnabled&&null!=l&&(w=this.state,"html"==a?(null!=w.rotation&&(t=(f=this.rotatePoint(t,e,w.rotation,w.rotationCx,w.rotationCy)).x,e=f.y),8!=document.documentMode||mxClient.IS_EM?(t*=w.scale,e*=w.scale):(t+=w.dx,e+=w.dy,"fill"!=h&&o==mxConstants.ALIGN_TOP&&--e),(m=8!=document.documentMode||mxClient.IS_EM?this.createElement("div"):this.createVmlElement("group")).style.position="absolute",m.style.display="inline",m.style.left=this.format(t)+"px",m.style.top=this.format(e)+"px",m.style.zoom=w.scale,(c=this.createElement("div")).style.position="relative",c.style.display="inline",g=(C=mxUtils.getAlignmentAsPoint(s,o)).x,x=C.y,y=this.createDiv(l,s,o,h),b=this.createElement("div"),null!=p&&y.setAttribute("dir",p),r&&0<n?(d||(y.style.width=Math.round(n)+"px"),y.style.wordWrap=mxConstants.WORD_WRAP,y.style.whiteSpace="normal","break-word"==y.style.wordWrap&&null!=(v=y).firstChild&&"DIV"==v.firstChild.nodeName&&(v.firstChild.style.width="100%")):y.style.whiteSpace="nowrap",S=w.rotation+(u||0),this.rotateHtml&&0!=S?(b.style.display="inline",b.style.zoom="1",b.appendChild(y),8!=document.documentMode||mxClient.IS_EM||"DIV"==this.root.nodeName?m.appendChild(b):(c.appendChild(b),m.appendChild(c))):8!=document.documentMode||mxClient.IS_EM?(y.style.display="inline",m.appendChild(y)):(c.appendChild(y),m.appendChild(c)),"DIV"!=this.root.nodeName?((E=this.createVmlElement("rect")).stroked="false",E.filled="false",E.appendChild(m),this.root.appendChild(E)):this.root.appendChild(m),d?(y.style.overflow="hidden",y.style.width=Math.round(n)+"px",mxClient.IS_QUIRKS||(y.style.maxHeight=Math.round(i)+"px")):"fill"==h?(y.style.overflow="hidden",y.style.width=Math.max(0,n)+1+"px",y.style.height=Math.max(0,i)+1+"px"):"width"==h&&(y.style.overflow="hidden",y.style.width=Math.max(0,n)+1+"px",y.style.maxHeight=Math.max(0,i)+1+"px"),this.rotateHtml&&0!=S?(T=S*(Math.PI/180),f=parseFloat(parseFloat(Math.cos(T)).toFixed(8)),C=parseFloat(parseFloat(Math.sin(-T)).toFixed(8)),(T%=2*Math.PI)<0&&(T+=2*Math.PI),(T%=Math.PI)>Math.PI/2&&(T=Math.PI-T),E=Math.cos(T),S=Math.sin(T),8!=document.documentMode||mxClient.IS_EM||(y.style.display="inline-block",b.style.display="inline-block",c.style.display="inline-block"),y.style.visibility="hidden",y.style.position="absolute",document.body.appendChild(y),null!=(T=y).firstChild&&"DIV"==T.firstChild.nodeName&&(T=T.firstChild),v=T.offsetWidth+3,T=T.offsetHeight,d?(n=Math.min(n,v),T=Math.min(T,i)):n=v,r&&(y.style.width=n+"px"),mxClient.IS_QUIRKS&&(d||"width"==h)&&i<T&&(T=i,y.style.height=T+"px"),v=((i=T)-i*E+n*-S)/2-C*n*(g+.5)+f*i*(x+.5),E=(n-n*E+i*-S)/2+f*n*(g+.5)+C*i*(x+.5),"group"==m.nodeName&&"DIV"==this.root.nodeName?((S=this.createElement("div")).style.display="inline-block",S.style.position="absolute",S.style.left=this.format(t+(E-n/2)*w.scale)+"px",S.style.top=this.format(e+(v-i/2)*w.scale)+"px",m.parentNode.appendChild(S),S.appendChild(m)):(w=8!=document.documentMode||mxClient.IS_EM?w.scale:1,m.style.left=this.format(t+(E-n/2)*w)+"px",m.style.top=this.format(e+(v-i/2)*w)+"px"),b.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+f+", M12="+C+", M21="+-C+", M22="+f+", sizingMethod='auto expand')",b.style.backgroundColor=this.rotatedHtmlBackground,this.state.alpha<1&&(b.style.filter+="alpha(opacity="+100*this.state.alpha+")"),b.appendChild(y),y.style.position="",y.style.visibility=""):8!=document.documentMode||mxClient.IS_EM?(y.style.verticalAlign="top",this.state.alpha<1&&(m.style.filter="alpha(opacity="+100*this.state.alpha+")"),b=y.parentNode,y.style.visibility="hidden",document.body.appendChild(y),n=y.offsetWidth,T=y.offsetHeight,mxClient.IS_QUIRKS&&d&&i<T&&(T=i,y.style.height=T+"px"),i=T,y.style.visibility="",b.appendChild(y),m.style.left=this.format(t+n*g*this.state.scale)+"px",m.style.top=this.format(e+i*x*this.state.scale)+"px"):(this.state.alpha<1&&(y.style.filter="alpha(opacity="+100*this.state.alpha+")"),c.style.left=100*g+"%",c.style.top=100*x+"%")):this.plainText(t,e,n,i,mxUtils.htmlEntities(l,!1),s,o,r,a,h,d,u,p))},mxVmlCanvas2D.prototype.plainText=function(t,e,n,i,l,s,o,r,a,h,d,u,p){var m=this.state;t=(t+m.dx)*m.scale,e=(e+m.dy)*m.scale;var c=this.createVmlElement("shape");c.style.width="1px",c.style.height="1px",c.stroked="false";var g=this.createVmlElement("fill");g.color=m.fontColor,g.opacity=100*m.alpha+"%",c.appendChild(g);g=this.createVmlElement("path");g.textpathok="true",g.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0),c.appendChild(g);g=this.createVmlElement("textpath");g.style.cssText="v-text-align:"+s,g.style.align=s,g.style.fontFamily=m.fontFamily,g.string=l,g.on="true";s=m.fontSize*m.scale/this.vmlScale;g.style.fontSize=s+"px",(m.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(g.style.fontWeight="bold"),(m.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(g.style.fontStyle="italic"),(m.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(g.style.textDecoration="underline");m=s+(l.split("\n").length-1)*s*mxConstants.LINE_HEIGHT,l=0,s=0;o==mxConstants.ALIGN_BOTTOM?s=-m/2:o!=mxConstants.ALIGN_MIDDLE&&(s=m/2),null!=u&&(u=(c.style.rotation=u)*(Math.PI/180),l=Math.sin(u)*s,s=Math.cos(u)*s),c.appendChild(g),c.style.left=this.format(t-l)+"px",c.style.top=this.format(e+s)+"px",this.root.appendChild(c)},mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},mxGuide.prototype.graph=null,mxGuide.prototype.states=null,mxGuide.prototype.horizontal=!0,mxGuide.prototype.vertical=!0,mxGuide.prototype.guideX=null,mxGuide.prototype.guideY=null,mxGuide.prototype.rounded=!1,mxGuide.prototype.tolerance=2,mxGuide.prototype.setStates=function(t){this.states=t},mxGuide.prototype.isEnabledForEvent=function(t){return!0},mxGuide.prototype.getGuideTolerance=function(t){return t&&this.graph.gridEnabled?this.graph.gridSize/2:this.tolerance},mxGuide.prototype.createGuideShape=function(t){var e=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH);return e.isDashed=!0,e},mxGuide.prototype.isStateIgnored=function(t){return!1},mxGuide.prototype.move=function(l,s,t,e){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=l&&null!=s){var n=this.graph.getView().scale,i=this.getGuideTolerance(t)*n,n=l.clone();n.x+=s.x,n.y+=s.y;var o=!1,r=null,a=null,h=!1,d=null,u=null,p=i,m=i,c=n.x,g=n.x+n.width,x=n.getCenterX(),y=n.y,f=n.y+n.height,C=n.getCenterY();function v(t,e,n){var i=!1;n&&Math.abs(t-x)<p?(s.x=t-l.getCenterX(),p=Math.abs(t-x),i=!0):n||(Math.abs(t-c)<p?(s.x=t-l.x,p=Math.abs(t-c),i=!0):Math.abs(t-g)<p&&(s.x=t-l.x-l.width,p=Math.abs(t-g),i=!0)),i&&(r=e,a=t,null==this.guideX&&(this.guideX=this.createGuideShape(!0),this.guideX.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideX.pointerEvents=!1,this.guideX.init(this.graph.getView().getOverlayPane()))),o=o||i}function E(t,e,n){var i=!1;n&&Math.abs(t-C)<m?(s.y=t-l.getCenterY(),m=Math.abs(t-C),i=!0):n||(Math.abs(t-y)<m?(s.y=t-l.y,m=Math.abs(t-y),i=!0):Math.abs(t-f)<m&&(s.y=t-l.y-l.height,m=Math.abs(t-f),i=!0)),i&&(d=e,u=t,null==this.guideY&&(this.guideY=this.createGuideShape(!1),this.guideY.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideY.pointerEvents=!1,this.guideY.init(this.graph.getView().getOverlayPane()))),h=h||i}for(var S=0;S<this.states.length;S++){var w=this.states[S];null==w||this.isStateIgnored(w)||(this.horizontal&&(v.call(this,w.getCenterX(),w,!0),v.call(this,w.x,w,!1),v.call(this,w.x+w.width,w,!1),null==w.cell&&v.call(this,w.getCenterX(),w,!1)),this.vertical&&(E.call(this,w.getCenterY(),w,!0),E.call(this,w.y,w,!1),E.call(this,w.y+w.height,w,!1),null==w.cell&&E.call(this,w.getCenterY(),w,!1)))}this.graph.snapDelta(s,l,!t,o,h),s=this.getDelta(l,r,s.x,d,s.y);var b,T,t=this.graph.container;o||null==this.guideX?null!=this.guideX&&((T=b=null)!=r&&null!=l&&(b=Math.min(l.y+s.y-this.graph.panDy,r.y),T=Math.max(l.y+l.height+s.y-this.graph.panDy,r.y+r.height)),this.guideX.points=null!=b&&null!=T?[new mxPoint(a,b),new mxPoint(a,T)]:[new mxPoint(a,-this.graph.panDy),new mxPoint(a,t.scrollHeight-3-this.graph.panDy)],this.guideX.stroke=this.getGuideColor(r,!0),this.guideX.node.style.visibility="visible",this.guideX.redraw()):this.guideX.node.style.visibility="hidden",h||null==this.guideY?null!=this.guideY&&((T=b=null)!=d&&null!=l&&(b=Math.min(l.x+s.x-this.graph.panDx,d.x),T=Math.max(l.x+l.width+s.x-this.graph.panDx,d.x+d.width)),this.guideY.points=null!=b&&null!=T?[new mxPoint(b,u),new mxPoint(T,u)]:[new mxPoint(-this.graph.panDx,u),new mxPoint(t.scrollWidth-3-this.graph.panDx,u)],this.guideY.stroke=this.getGuideColor(d,!1),this.guideY.node.style.visibility="visible",this.guideY.redraw()):this.guideY.node.style.visibility="hidden"}return s},mxGuide.prototype.getDelta=function(t,e,n,i,l){var s=this.graph.view.scale;return(this.rounded||null!=e&&null==e.cell)&&(n=Math.round((t.x+n)/s)*s-t.x),(this.rounded||null!=i&&null==i.cell)&&(l=Math.round((t.y+l)/s)*s-t.y),new mxPoint(n,l)},mxGuide.prototype.getGuideColor=function(t,e){return mxConstants.GUIDE_COLOR},mxGuide.prototype.hide=function(){this.setVisible(!1)},mxGuide.prototype.setVisible=function(t){null!=this.guideX&&(this.guideX.node.style.visibility=t?"visible":"hidden"),null!=this.guideY&&(this.guideY.node.style.visibility=t?"visible":"hidden")},mxGuide.prototype.destroy=function(){null!=this.guideX&&(this.guideX.destroy(),this.guideX=null),null!=this.guideY&&(this.guideY.destroy(),this.guideY=null)},mxShape.prototype.dialect=null,mxShape.prototype.scale=1,mxShape.prototype.antiAlias=!0,mxShape.prototype.minSvgStrokeWidth=1,mxShape.prototype.bounds=null,mxShape.prototype.points=null,mxShape.prototype.node=null,mxShape.prototype.state=null,mxShape.prototype.style=null,mxShape.prototype.boundingBox=null,mxShape.prototype.stencil=null,mxShape.prototype.svgStrokeTolerance=8,mxShape.prototype.pointerEvents=!0,mxShape.prototype.svgPointerEvents="all",mxShape.prototype.shapePointerEvents=!1,mxShape.prototype.stencilPointerEvents=!1,mxShape.prototype.vmlScale=1,mxShape.prototype.outline=!1,mxShape.prototype.visible=!0,mxShape.prototype.useSvgBoundingBox=!1,mxShape.prototype.init=function(t){null==this.node&&(this.node=this.create(t),null!=t&&t.appendChild(this.node))},mxShape.prototype.initStyles=function(t){this.strokewidth=1,this.rotation=0,this.opacity=100,this.fillOpacity=100,this.strokeOpacity=100,this.flipH=!1,this.flipV=!1},mxShape.prototype.isParseVml=function(){return!0},mxShape.prototype.isHtmlAllowed=function(){return!1},mxShape.prototype.getSvgScreenOffset=function(){var t=this.stencil&&"inherit"!=this.stencil.strokewidth?Number(this.stencil.strokewidth):this.strokewidth;return 1==mxUtils.mod(Math.max(1,Math.round(t*this.scale)),2)?.5:0},mxShape.prototype.create=function(t){return null!=t&&null!=t.ownerSVGElement?this.createSvg(t):8==document.documentMode||!mxClient.IS_VML||this.dialect!=mxConstants.DIALECT_VML&&this.isHtmlAllowed()?this.createHtml(t):this.createVml(t)},mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")},mxShape.prototype.createVml=function(){var t=document.createElement(mxClient.VML_PREFIX+":group");return t.style.position="absolute",t},mxShape.prototype.createHtml=function(){var t=document.createElement("div");return t.style.position="absolute",t},mxShape.prototype.reconfigure=function(){this.redraw()},mxShape.prototype.redraw=function(){this.updateBoundsFromPoints(),this.visible&&this.checkBounds()?(this.node.style.visibility="visible",this.clear(),"DIV"!=this.node.nodeName||!this.isHtmlAllowed()&&mxClient.IS_VML?this.redrawShape():this.redrawHtmlShape(),this.updateBoundingBox()):(this.node.style.visibility="hidden",this.boundingBox=null)},mxShape.prototype.clear=function(){if(null!=this.node.ownerSVGElement)for(;null!=this.node.lastChild;)this.node.removeChild(this.node.lastChild);else this.node.style.cssText="position:absolute;"+(null!=this.cursor?"cursor:"+this.cursor+";":""),this.node.innerHTML=""},mxShape.prototype.updateBoundsFromPoints=function(){var t=this.points;if(null!=t&&0<t.length&&null!=t[0]){this.bounds=new mxRectangle(Number(t[0].x),Number(t[0].y),1,1);for(var e=1;e<this.points.length;e++)null!=t[e]&&this.bounds.add(new mxRectangle(Number(t[e].x),Number(t[e].y),1,1))}},mxShape.prototype.getLabelBounds=function(t){var e=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),n=t;e!=mxConstants.DIRECTION_SOUTH&&e!=mxConstants.DIRECTION_NORTH&&null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()&&(l=(n=n.clone()).width,n.width=n.height,n.height=l);var i=this.getLabelMargins(n);if(null==i)return t;var l,e="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,!1),n="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,!1);return null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()&&(l=i.x,i.x=i.height,i.height=i.width,i.width=i.y,i.y=l,l=e,e=n,n=l),mxUtils.getDirectedBounds(t,i,this.style,e,n)},mxShape.prototype.getLabelMargins=function(t){return null},mxShape.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&0<this.scale&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&0<this.bounds.width&&0<this.bounds.height},mxShape.prototype.createVmlGroup=function(){var t=document.createElement(mxClient.VML_PREFIX+":group");return t.style.position="absolute",t.style.width=this.node.style.width,t.style.height=this.node.style.height,t},mxShape.prototype.redrawShape=function(){var t=this.createCanvas();null!=t&&(t.pointerEvents=this.pointerEvents,this.beforePaint(t),this.paint(t),this.afterPaint(t),this.node!=t.root&&this.node.insertAdjacentHTML("beforeend",t.root.outerHTML),"DIV"==this.node.nodeName&&8==document.documentMode&&(this.node.style.filter="",mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(t))},mxShape.prototype.createCanvas=function(){var t=null;return null!=this.node.ownerSVGElement?t=this.createSvgCanvas():mxClient.IS_VML&&(this.updateVmlContainer(),t=this.createVmlCanvas()),null!=t&&this.outline&&(t.setStrokeWidth(this.strokewidth),t.setStrokeColor(this.stroke),null!=this.isDashed&&t.setDashed(this.isDashed),t.setStrokeWidth=function(){},t.setStrokeColor=function(){},t.setFillColor=function(){},t.setGradient=function(){},t.setDashed=function(){},t.text=function(){}),t},mxShape.prototype.createSvgCanvas=function(){var t=new mxSvgCanvas2D(this.node,!1);t.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,t.pointerEventsValue=this.svgPointerEvents;var e=this.getSvgScreenOffset();return 0!=e?this.node.setAttribute("transform","translate("+e+","+e+")"):this.node.removeAttribute("transform"),t.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(t.format=function(t){return Math.round(parseFloat(t))}),t},mxShape.prototype.createVmlCanvas=function(){var t,e=8==document.documentMode&&this.isParseVml()?this.createVmlGroup():this.node,n=new mxVmlCanvas2D(e,!1);""!=e.tagUrn&&(t=Math.max(1,Math.round(this.bounds.width)),i=Math.max(1,Math.round(this.bounds.height)),e.coordsize=t*this.vmlScale+","+i*this.vmlScale,n.scale(this.vmlScale),n.vmlScale=this.vmlScale);var i=this.scale;return n.translate(-Math.round(this.bounds.x/i),-Math.round(this.bounds.y/i)),n},mxShape.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px";var t=Math.max(1,Math.round(this.bounds.width)),e=Math.max(1,Math.round(this.bounds.height));this.node.style.width=t+"px",this.node.style.height=e+"px",this.node.style.overflow="visible"},mxShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node),this.updateHtmlFilters(this.node),this.updateHtmlColors(this.node)},mxShape.prototype.updateHtmlFilters=function(t){var e,n,i,l,s,o,r="";this.opacity<100&&(r+="alpha(opacity="+this.opacity+")"),this.isShadow&&(r+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.VML_SHADOWCOLOR+"')"),null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE&&(l=this.fill,s=this.gradient,e="0",n={east:0,south:1,west:2,north:3},i=null!=this.direction?n[this.direction]:0,null!=this.gradientDirection&&(i=mxUtils.mod(i+n[this.gradientDirection]-1,4)),1==i?(e="1",o=l,l=s,s=o):2==i?(o=l,l=s,s=o):3==i&&(e="1"),r+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+l+"', endColorStr='"+s+"', gradientType='"+e+"')"),t.style.filter=r},mxShape.prototype.updateHtmlColors=function(t){var e=this.stroke;null!=e&&e!=mxConstants.NONE?(t.style.borderColor=e,this.isDashed?t.style.borderStyle="dashed":0<this.strokewidth&&(t.style.borderStyle="solid"),t.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):t.style.borderWidth="0px",null!=(e=this.outline?null:this.fill)&&e!=mxConstants.NONE?(t.style.backgroundColor=e,t.style.backgroundImage="none"):this.pointerEvents?t.style.backgroundColor="transparent":8==document.documentMode?mxUtils.addTransparentBackgroundFilter(t):this.setTransparentBackgroundImage(t)},mxShape.prototype.updateHtmlBounds=function(t){var e=9<=document.documentMode?0:Math.ceil(this.strokewidth*this.scale);t.style.borderWidth=Math.max(1,e)+"px",t.style.overflow="hidden",t.style.left=Math.round(this.bounds.x-e/2)+"px",t.style.top=Math.round(this.bounds.y-e/2)+"px","CSS1Compat"==document.compatMode&&(e=-e),t.style.width=Math.round(Math.max(0,this.bounds.width+e))+"px",t.style.height=Math.round(Math.max(0,this.bounds.height+e))+"px"},mxShape.prototype.destroyCanvas=function(t){if(t instanceof mxSvgCanvas2D){for(var e in t.gradients){var n=t.gradients[e];null!=n&&(n.mxRefCount=(n.mxRefCount||0)+1)}this.releaseSvgGradients(this.oldGradients),this.oldGradients=t.gradients}},mxShape.prototype.beforePaint=function(t){},mxShape.prototype.afterPaint=function(t){},mxShape.prototype.paint=function(t){var e,n,i=!1;null!=t&&this.outline&&(e=t.stroke,t.stroke=function(){i=!0,e.apply(this,arguments)},n=t.fillAndStroke,t.fillAndStroke=function(){i=!0,n.apply(this,arguments)});var l=this.scale,s=this.bounds.x/l,o=this.bounds.y/l,r=this.bounds.width/l,a=this.bounds.height/l;this.isPaintBoundsInverted()&&(s+=d=(r-a)/2,o-=d,h=r,r=a,a=h),this.updateTransform(t,s,o,r,a),this.configureCanvas(t,s,o,r,a);var h,d=null;if((null==this.stencil&&null==this.points&&this.shapePointerEvents||null!=this.stencil&&this.stencilPointerEvents)&&(h=this.createBoundingBox(),this.dialect==mxConstants.DIALECT_SVG?(d=this.createTransparentSvgRectangle(h.x,h.y,h.width,h.height),this.node.appendChild(d)):((h=t.createRect("rect",h.x/l,h.y/l,h.width/l,h.height/l)).appendChild(t.createTransparentFill()),h.stroked="false",t.root.appendChild(h))),null!=this.stencil)this.stencil.drawShape(t,this,s,o,r,a);else if(t.setStrokeWidth(this.strokewidth),null!=this.points){for(var u=[],p=0;p<this.points.length;p++)null!=this.points[p]&&u.push(new mxPoint(this.points[p].x/l,this.points[p].y/l));this.paintEdgeShape(t,u)}else this.paintVertexShape(t,s,o,r,a);null!=d&&null!=t.state&&null!=t.state.transform&&d.setAttribute("transform",t.state.transform),null!=t&&this.outline&&!i&&(t.rect(s,o,r,a),t.stroke())},mxShape.prototype.configureCanvas=function(t,e,n,i,l){var s=null;null!=this.style&&(s=this.style.dashPattern),t.setAlpha(this.opacity/100),t.setFillAlpha(this.fillOpacity/100),t.setStrokeAlpha(this.strokeOpacity/100),null!=this.isShadow&&t.setShadow(this.isShadow),null!=this.isDashed&&t.setDashed(this.isDashed,null!=this.style&&1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1)),null!=s&&t.setDashPattern(s),null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(l=this.getGradientBounds(t,e,n,i,l),t.setGradient(this.fill,this.gradient,l.x,l.y,l.width,l.height,this.gradientDirection)):t.setFillColor(this.fill),t.setStrokeColor(this.stroke)},mxShape.prototype.getGradientBounds=function(t,e,n,i,l){return new mxRectangle(e,n,i,l)},mxShape.prototype.updateTransform=function(t,e,n,i,l){t.scale(this.scale),t.rotate(this.getShapeRotation(),this.flipH,this.flipV,e+i/2,n+l/2)},mxShape.prototype.paintVertexShape=function(t,e,n,i,l){this.paintBackground(t,e,n,i,l),this.outline&&null!=this.style&&0!=mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)||(t.setShadow(!1),this.paintForeground(t,e,n,i,l))},mxShape.prototype.paintBackground=function(t,e,n,i,l){},mxShape.prototype.paintForeground=function(t,e,n,i,l){},mxShape.prototype.paintEdgeShape=function(t,e){},mxShape.prototype.getArcSize=function(t,e){var n;return"1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?Math.min(t/2,Math.min(e/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,Math.min(t*n,e*n))},mxShape.prototype.paintGlassEffect=function(t,e,n,i,l,s){var o=Math.ceil(this.strokewidth/2);t.setGradient("#ffffff","#ffffff",e,n,i,.6*l,"south",.9,.1),t.begin(),s+=2*o,this.isRounded?(t.moveTo(e-o+s,n-o),t.quadTo(e-o,n-o,e-o,n-o+s),t.lineTo(e-o,n+.4*l),t.quadTo(e+.5*i,n+.7*l,e+i+o,n+.4*l),t.lineTo(e+i+o,n-o+s),t.quadTo(e+i+o,n-o,e+i+o-s,n-o)):(t.moveTo(e-o,n-o),t.lineTo(e-o,n+.4*l),t.quadTo(e+.5*i,n+.7*l,e+i+o,n+.4*l),t.lineTo(e+i+o,n-o)),t.close(),t.fill()},mxShape.prototype.addPoints=function(t,e,n,i,l,s,o){if(null!=e&&0<e.length){o=null==o||o;var r,a=e[e.length-1];l&&n&&(r=(e=e.slice())[0],r=new mxPoint(a.x+(r.x-a.x)/2,a.y+(r.y-a.y)/2),e.splice(0,0,r));var h=e[0],d=1;for(o?t.moveTo(h.x,h.y):t.lineTo(h.x,h.y);d<(l?e.length:e.length-1);){var u=e[mxUtils.mod(d,e.length)],p=h.x-u.x,m=h.y-u.y;if(n&&(0!=p||0!=m)&&(null==s||mxUtils.indexOf(s,d-1)<0)){var c=Math.sqrt(p*p+m*m),g=p*Math.min(i,c/2)/c,x=m*Math.min(i,c/2)/c,g=u.x+g,x=u.y+x;t.lineTo(g,x);for(var y=e[mxUtils.mod(d+1,e.length)];d<e.length-2&&0==Math.round(y.x-u.x)&&0==Math.round(y.y-u.y);)y=e[mxUtils.mod(d+2,e.length)],d++;p=y.x-u.x,m=y.y-u.y,c=Math.max(1,Math.sqrt(p*p+m*m));p=p*Math.min(i,c/2)/c,c=m*Math.min(i,c/2)/c,p=u.x+p,c=u.y+c;t.quadTo(u.x,u.y,p,c),u=new mxPoint(p,c)}else t.lineTo(u.x,u.y);h=u,d++}l?t.close():t.lineTo(a.x,a.y)}},mxShape.prototype.resetStyles=function(){this.initStyles(),this.spacing=0,delete this.fill,delete this.gradient,delete this.gradientDirection,delete this.stroke,delete this.startSize,delete this.endSize,delete this.startArrow,delete this.endArrow,delete this.direction,delete this.isShadow,delete this.isDashed,delete this.isRounded,delete this.glass},mxShape.prototype.apply=function(t){this.state=t,this.style=t.style,null!=this.style&&(this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,this.fill),this.gradient=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENTCOLOR,this.gradient),this.gradientDirection=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENT_DIRECTION,this.gradientDirection),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_OPACITY,this.opacity),this.fillOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_OPACITY,this.fillOpacity),this.strokeOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_STROKE_OPACITY,this.strokeOpacity),this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke),this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth),this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing),this.startSize=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,this.startSize),this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize),this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow),this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow),this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation),this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction),this.flipH=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0),this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0),null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV),this.direction!=mxConstants.DIRECTION_NORTH&&this.direction!=mxConstants.DIRECTION_SOUTH||(t=this.flipH,this.flipH=this.flipV,this.flipV=t),this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow),this.isDashed=1==mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed),this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded),this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass),this.fill==mxConstants.NONE&&(this.fill=null),this.gradient==mxConstants.NONE&&(this.gradient=null),this.stroke==mxConstants.NONE&&(this.stroke=null))},mxShape.prototype.setCursor=function(t){null==t&&(t=""),this.cursor=t,null!=this.node&&(this.node.style.cursor=t)},mxShape.prototype.getCursor=function(){return this.cursor},mxShape.prototype.isRoundable=function(){return!1},mxShape.prototype.updateBoundingBox=function(){if(this.useSvgBoundingBox&&null!=this.node&&null!=this.node.ownerSVGElement)try{var t=this.node.getBBox();if(0<t.width&&0<t.height)return this.boundingBox=new mxRectangle(t.x,t.y,t.width,t.height),void this.boundingBox.grow(this.strokewidth*this.scale/2)}catch(t){}var e,n;null!=this.bounds&&(null!=(e=this.createBoundingBox())&&(this.augmentBoundingBox(e),0!=(n=this.getShapeRotation())&&(e=mxUtils.getBoundingBox(e,n))),this.boundingBox=e)},mxShape.prototype.createBoundingBox=function(){var t=this.bounds.clone();return(null==this.stencil||this.direction!=mxConstants.DIRECTION_NORTH&&this.direction!=mxConstants.DIRECTION_SOUTH)&&!this.isPaintBoundsInverted()||t.rotate90(),t},mxShape.prototype.augmentBoundingBox=function(t){this.isShadow&&(t.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale),t.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale)),t.grow(this.strokewidth*this.scale/2)},mxShape.prototype.isPaintBoundsInverted=function(){return null==this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)},mxShape.prototype.getRotation=function(){return null!=this.rotation?this.rotation:0},mxShape.prototype.getTextRotation=function(){var t=this.getRotation();return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(t+=mxText.prototype.verticalTextRotation),t},mxShape.prototype.getShapeRotation=function(){var t=this.getRotation();return null!=this.direction&&(this.direction==mxConstants.DIRECTION_NORTH?t+=270:this.direction==mxConstants.DIRECTION_WEST?t+=180:this.direction==mxConstants.DIRECTION_SOUTH&&(t+=90)),t},mxShape.prototype.createTransparentSvgRectangle=function(t,e,n,i){var l=document.createElementNS(mxConstants.NS_SVG,"rect");return l.setAttribute("x",t),l.setAttribute("y",e),l.setAttribute("width",n),l.setAttribute("height",i),l.setAttribute("fill","none"),l.setAttribute("stroke","none"),l.setAttribute("pointer-events","all"),l},mxShape.prototype.setTransparentBackgroundImage=function(t){t.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"},mxShape.prototype.releaseSvgGradients=function(t){if(null!=t)for(var e in t){var n=t[e];null!=n&&(n.mxRefCount=(n.mxRefCount||0)-1,0==n.mxRefCount&&null!=n.parentNode&&n.parentNode.removeChild(n))}},mxShape.prototype.destroy=function(){null!=this.node&&(mxEvent.release(this.node),null!=this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null),this.releaseSvgGradients(this.oldGradients),this.oldGradients=null},mxUtils.extend(mxStencil,mxShape),mxStencil.defaultLocalized=!1,mxStencil.allowEval=!1,mxStencil.prototype.desc=null,mxStencil.prototype.constraints=null,mxStencil.prototype.aspect=null,mxStencil.prototype.w0=null,mxStencil.prototype.h0=null,mxStencil.prototype.bgNode=null,mxStencil.prototype.fgNode=null,mxStencil.prototype.strokewidth=null,mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0],this.bgNode=this.desc.getElementsByTagName("background")[0],this.w0=Number(this.desc.getAttribute("w")||100),this.h0=Number(this.desc.getAttribute("h")||100);var t=this.desc.getAttribute("aspect");this.aspect=null!=t?t:"variable";t=this.desc.getAttribute("strokewidth");this.strokewidth=null!=t?t:"1"},mxStencil.prototype.parseConstraints=function(){var t=this.desc.getElementsByTagName("connections")[0];if(null!=t){var e=mxUtils.getChildNodes(t);if(null!=e&&0<e.length){this.constraints=[];for(var n=0;n<e.length;n++)this.constraints.push(this.parseConstraint(e[n]))}}},mxStencil.prototype.parseConstraint=function(t){var e=Number(t.getAttribute("x")),n=Number(t.getAttribute("y")),i="1"==t.getAttribute("perimeter"),t=t.getAttribute("name");return new mxConnectionConstraint(new mxPoint(e,n),i,t)},mxStencil.prototype.evaluateTextAttribute=function(t,e,n){n=this.evaluateAttribute(t,e,n),t=t.getAttribute("localized");return(mxStencil.defaultLocalized&&null==t||"1"==t)&&(n=mxResources.get(n)),n},mxStencil.prototype.evaluateAttribute=function(t,e,n){e=t.getAttribute(e);return null==e&&(null==(t=mxUtils.getTextContent(t))||!mxStencil.allowEval||"function"==typeof(t=mxUtils.eval(t))&&(e=t(n))),e},mxStencil.prototype.drawShape=function(t,e,n,i,l,s){var o=t.states.slice(),r=mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,null),a=this.computeAspect(e.style,n,i,l,s,r),r=Math.min(a.width,a.height),r="inherit"==this.strokewidth?Number(mxUtils.getNumber(e.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*r;t.setStrokeWidth(r),null!=e.style&&"1"==mxUtils.getValue(e.style,mxConstants.STYLE_POINTER_EVENTS,"0")&&(t.setStrokeColor(mxConstants.NONE),t.rect(n,i,l,s),t.stroke(),t.setStrokeColor(e.stroke)),this.drawChildren(t,e,n,i,l,s,this.bgNode,a,!1,!0),this.drawChildren(t,e,n,i,l,s,this.fgNode,a,!0,!e.outline||null==e.style||0==mxUtils.getValue(e.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)),t.states.length!=o.length&&(t.states=o)},mxStencil.prototype.drawChildren=function(t,e,n,i,l,s,o,r,a,h){if(null!=o&&0<l&&0<s)for(var d=o.firstChild;null!=d;)d.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(t,e,d,r,a,h),d=d.nextSibling},mxStencil.prototype.computeAspect=function(t,e,n,i,l,s){var o=e,r=n,a=i/this.w0,e=l/this.h0,n=s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_SOUTH;return n&&(e=i/this.h0,a=l/this.w0,o+=s=(i-l)/2,r-=s),"fixed"==this.aspect&&(a=e=Math.min(a,e),n?(o+=(l-this.w0*a)/2,r+=(i-this.h0*e)/2):(o+=(i-this.w0*a)/2,r+=(l-this.h0*e)/2)),new mxRectangle(o,r,a,e)},mxStencil.prototype.drawNode=function(t,e,n,i,l,s){var o,r=n.nodeName,a=i.x,h=i.y,d=i.width,u=i.height,p=Math.min(d,u);if("save"==r)t.save();else if("restore"==r)t.restore();else if(s){if("path"==r){t.begin();var m=!0;if("1"==n.getAttribute("rounded")){m=!1;for(var c=Number(n.getAttribute("arcSize")),g=0,x=[],y=n.firstChild;null!=y;){if(y.nodeType==mxConstants.NODETYPE_ELEMENT){var f=y.nodeName;if("move"!=f&&"line"!=f){m=!0;break}"move"!=f&&0!=x.length||x.push([]),x[x.length-1].push(new mxPoint(a+Number(y.getAttribute("x"))*d,h+Number(y.getAttribute("y"))*u)),g++}y=y.nextSibling}if(!m&&0<g)for(var C=0;C<x.length;C++){var v=!1,E=x[C][0],S=x[C][x[C].length-1];E.x==S.x&&E.y==S.y&&(x[C].pop(),v=!0),this.addPoints(t,x[C],!0,c,v)}else m=!0}if(m)for(y=n.firstChild;null!=y;)y.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(t,e,y,i,l,s),y=y.nextSibling}else if("close"==r)t.close();else if("move"==r)t.moveTo(a+Number(n.getAttribute("x"))*d,h+Number(n.getAttribute("y"))*u);else if("line"==r)t.lineTo(a+Number(n.getAttribute("x"))*d,h+Number(n.getAttribute("y"))*u);else if("quad"==r)t.quadTo(a+Number(n.getAttribute("x1"))*d,h+Number(n.getAttribute("y1"))*u,a+Number(n.getAttribute("x2"))*d,h+Number(n.getAttribute("y2"))*u);else if("curve"==r)t.curveTo(a+Number(n.getAttribute("x1"))*d,h+Number(n.getAttribute("y1"))*u,a+Number(n.getAttribute("x2"))*d,h+Number(n.getAttribute("y2"))*u,a+Number(n.getAttribute("x3"))*d,h+Number(n.getAttribute("y3"))*u);else if("arc"==r)t.arcTo(Number(n.getAttribute("rx"))*d,Number(n.getAttribute("ry"))*u,Number(n.getAttribute("x-axis-rotation")),Number(n.getAttribute("large-arc-flag")),Number(n.getAttribute("sweep-flag")),a+Number(n.getAttribute("x"))*d,h+Number(n.getAttribute("y"))*u);else if("rect"==r)t.rect(a+Number(n.getAttribute("x"))*d,h+Number(n.getAttribute("y"))*u,Number(n.getAttribute("w"))*d,Number(n.getAttribute("h"))*u);else if("roundrect"==r){var w=Number(n.getAttribute("arcsize"));0==w&&(w=100*mxConstants.RECTANGLE_ROUNDING_FACTOR);var b=Number(n.getAttribute("w"))*d,T=Number(n.getAttribute("h"))*u,w=Number(w)/100,w=Math.min(b*w,T*w);t.roundrect(a+Number(n.getAttribute("x"))*d,h+Number(n.getAttribute("y"))*u,b,T,w,w)}else if("ellipse"==r)t.ellipse(a+Number(n.getAttribute("x"))*d,h+Number(n.getAttribute("y"))*u,Number(n.getAttribute("w"))*d,Number(n.getAttribute("h"))*u);else if("image"==r)e.outline||(o=this.evaluateAttribute(n,"src",e),t.image(a+Number(n.getAttribute("x"))*d,h+Number(n.getAttribute("y"))*u,Number(n.getAttribute("w"))*d,Number(n.getAttribute("h"))*u,o,!1,"1"==n.getAttribute("flipH"),"1"==n.getAttribute("flipV")));else if("text"==r)e.outline||(A=this.evaluateTextAttribute(n,"str",e),L="1"==n.getAttribute("vertical")?-90:0,"0"==n.getAttribute("align-shape")&&(I=e.rotation,w=1==mxUtils.getValue(e.style,mxConstants.STYLE_FLIPH,0),o=1==mxUtils.getValue(e.style,mxConstants.STYLE_FLIPV,0),!(w&&o||!w&&!o)?L+=I:L-=I),L-=n.getAttribute("rotation"),t.text(a+Number(n.getAttribute("x"))*d,h+Number(n.getAttribute("y"))*u,0,0,A,n.getAttribute("align")||"left",n.getAttribute("valign")||"top",!1,"",null,!1,L));else if("include-shape"==r){var A,L,I=mxStencilRegistry.getStencil(n.getAttribute("name"));null!=I&&(A=a+Number(n.getAttribute("x"))*d,L=h+Number(n.getAttribute("y"))*u,b=Number(n.getAttribute("w"))*d,T=Number(n.getAttribute("h"))*u,I.drawShape(t,e,A,L,b,T))}else if("fillstroke"==r)t.fillAndStroke();else if("fill"==r)t.fill();else if("stroke"==r)t.stroke();else if("strokewidth"==r){var M="1"==n.getAttribute("fixed")?1:p;t.setStrokeWidth(Number(n.getAttribute("width"))*M)}else if("dashed"==r)t.setDashed("1"==n.getAttribute("dashed"));else if("dashpattern"==r){M=n.getAttribute("pattern");if(null!=M){for(var R=M.split(" "),P=[],C=0;C<R.length;C++)0<R[C].length&&P.push(Number(R[C])*p);M=P.join(" "),t.setDashPattern(M)}}else"strokecolor"==r?t.setStrokeColor(n.getAttribute("color")):"linecap"==r?t.setLineCap(n.getAttribute("cap")):"linejoin"==r?t.setLineJoin(n.getAttribute("join")):"miterlimit"==r?t.setMiterLimit(Number(n.getAttribute("limit"))):"fillcolor"==r?t.setFillColor(n.getAttribute("color")):"alpha"==r||"fillalpha"==r||"strokealpha"==r?t.setAlpha(n.getAttribute("alpha")):"fontcolor"==r?t.setFontColor(n.getAttribute("color")):"fontstyle"==r?t.setFontStyle(n.getAttribute("style")):"fontfamily"==r?t.setFontFamily(n.getAttribute("family")):"fontsize"==r&&t.setFontSize(Number(n.getAttribute("size"))*p);!l||"fillstroke"!=r&&"fill"!=r&&"stroke"!=r||(l=!1,t.setShadow(!1))}};var mxStencilRegistry={stencils:{},addStencil:function(t,e){mxStencilRegistry.stencils[t]=e},getStencil:function(t){return mxStencilRegistry.stencils[t]}},mxMarker={markers:[],addMarker:function(t,e){mxMarker.markers[t]=e},createMarker:function(t,e,n,i,l,s,o,r,a,h){var d=mxMarker.markers[n];return null!=d?d(t,e,n,i,l,s,o,r,a,h):null}};function mxActor(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxCloud(t,e,n,i){mxActor.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxRectangleShape(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxEllipse(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxDoubleEllipse(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxRhombus(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxPolyline(t,e,n){mxShape.call(this),this.points=t,this.stroke=e,this.strokewidth=null!=n?n:1}function mxArrow(t,e,n,i,l,s,o){mxShape.call(this),this.points=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1,this.arrowWidth=null!=l?l:mxConstants.ARROW_WIDTH,this.spacing=null!=s?s:mxConstants.ARROW_SPACING,this.endSize=null!=o?o:mxConstants.ARROW_SIZE}function mxArrowConnector(t,e,n,i,l,s,o){mxShape.call(this),this.points=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1,this.arrowWidth=null!=l?l:mxConstants.ARROW_WIDTH,this.arrowSpacing=null!=s?s:mxConstants.ARROW_SPACING,this.startSize=mxConstants.ARROW_SIZE/5,this.endSize=mxConstants.ARROW_SIZE/5}function mxText(t,e,n,i,l,s,o,r,a,h,d,u,p,m,c,g,x,y,f,C,v){mxShape.call(this),this.value=t,this.bounds=e,this.color=null!=l?l:"black",this.align=null!=n?n:mxConstants.ALIGN_CENTER,this.valign=null!=i?i:mxConstants.ALIGN_MIDDLE,this.family=null!=s?s:mxConstants.DEFAULT_FONTFAMILY,this.size=null!=o?o:mxConstants.DEFAULT_FONTSIZE,this.fontStyle=null!=r?r:mxConstants.DEFAULT_FONTSTYLE,this.spacing=parseInt(a||2),this.spacingTop=this.spacing+parseInt(h||0),this.spacingRight=this.spacing+parseInt(d||0),this.spacingBottom=this.spacing+parseInt(u||0),this.spacingLeft=this.spacing+parseInt(p||0),this.horizontal=null==m||m,this.background=c,this.border=g,this.wrap=null!=x&&x,this.clipped=null!=y&&y,this.overflow=null!=f?f:"visible",this.labelPadding=null!=C?C:0,this.textDirection=v,this.rotation=0,this.updateMargin()}function mxTriangle(){mxActor.call(this)}function mxHexagon(){mxActor.call(this)}function mxLine(t,e,n,i){mxShape.call(this),this.bounds=t,this.stroke=e,this.strokewidth=null!=n?n:1,this.vertical=null!=i?i:this.vertical}function mxImageShape(t,e,n,i,l){mxShape.call(this),this.bounds=t,this.image=e,this.fill=n,this.stroke=i,this.strokewidth=null!=l?l:1,this.shadow=!1}function mxLabel(t,e,n,i){mxRectangleShape.call(this,t,e,n,i)}function mxCylinder(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxConnector(t,e,n){mxPolyline.call(this,t,e,n)}function mxSwimlane(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxGraphLayout(t){this.graph=t}function WeightedCellSorter(t,e){this.cell=t,this.weightedValue=e}function mxStackLayout(t,e,n,i,l,s){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.spacing=null!=n?n:0,this.x0=null!=i?i:0,this.y0=null!=l?l:0,this.border=null!=s?s:0}function mxPartitionLayout(t,e,n,i){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.spacing=n||0,this.border=i||0}function mxCompactTreeLayout(t,e,n){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.invert=null!=n&&n}function mxRadialTreeLayout(t){mxCompactTreeLayout.call(this,t,!1)}function mxFastOrganicLayout(t){mxGraphLayout.call(this,t)}function mxCircleLayout(t,e){mxGraphLayout.call(this,t),this.radius=null!=e?e:100}function mxParallelEdgeLayout(t){mxGraphLayout.call(this,t)}function mxCompositeLayout(t,e,n){mxGraphLayout.call(this,t),this.layouts=e,this.master=n}function mxEdgeLabelLayout(t,e){mxGraphLayout.call(this,t)}function mxGraphAbstractHierarchyCell(){this.x=[],this.y=[],this.temp=[]}function mxGraphHierarchyNode(t){mxGraphAbstractHierarchyCell.apply(this,arguments),this.cell=t,this.id=mxObjectIdentity.get(t),this.connectsAsTarget=[],this.connectsAsSource=[]}function mxGraphHierarchyEdge(t){mxGraphAbstractHierarchyCell.apply(this,arguments),this.edges=t,this.ids=[];for(var e=0;e<t.length;e++)this.ids.push(mxObjectIdentity.get(t[e]))}function mxGraphHierarchyModel(t,e,n,i,l){t.getGraph();this.tightenToSource=l,this.roots=n,this.parent=i,this.vertexMapper=new mxDictionary,this.edgeMapper=new mxDictionary,this.maxRank=0;var s=[];null==e&&(e=this.graph.getChildVertices(i)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(t,e,s);for(var o=0;o<e.length;o++){for(var r=s[o].connectsAsSource,a=0;a<r.length;a++){var h,d,u=r[a],p=u.edges;null!=p&&0<p.length&&(h=p[0],d=t.getVisibleTerminal(h,!1),p=this.vertexMapper.get(d),s[o]==p&&(d=t.getVisibleTerminal(h,!0),p=this.vertexMapper.get(d)),null!=p&&s[o]!=p&&(0==(u.target=p).connectsAsTarget.length&&(p.connectsAsTarget=[]),mxUtils.indexOf(p.connectsAsTarget,u)<0&&p.connectsAsTarget.push(u)))}s[o].temp[0]=1}}function mxSwimlaneModel(t,e,n,i,l){t.getGraph();this.tightenToSource=l,this.roots=n,this.parent=i,this.vertexMapper=new mxDictionary,this.edgeMapper=new mxDictionary,this.maxRank=0;var s=[];null==e&&(e=this.graph.getChildVertices(i)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(t,e,s);for(var o=0;o<e.length;o++){for(var r=s[o].connectsAsSource,a=0;a<r.length;a++){var h,d,u=r[a],p=u.edges;null!=p&&0<p.length&&(h=p[0],d=t.getVisibleTerminal(h,!1),p=this.vertexMapper.get(d),s[o]==p&&(d=t.getVisibleTerminal(h,!0),p=this.vertexMapper.get(d)),null!=p&&s[o]!=p&&(0==(u.target=p).connectsAsTarget.length&&(p.connectsAsTarget=[]),mxUtils.indexOf(p.connectsAsTarget,u)<0&&p.connectsAsTarget.push(u)))}s[o].temp[0]=1}}function mxHierarchicalLayoutStage(){}function mxMedianHybridCrossingReduction(t){this.layout=t}function MedianCellSorter(){}function mxMinimumCycleRemover(t){this.layout=t}function mxCoordinateAssignment(t,e,n,i,l,s){this.layout=t,this.intraCellSpacing=e,this.interRankCellSpacing=n,this.orientation=i,this.initialX=l,this.parallelEdgeSpacing=s}function mxSwimlaneOrdering(t){this.layout=t}function mxHierarchicalLayout(t,e,n){mxGraphLayout.call(this,t),this.orientation=null!=e?e:mxConstants.DIRECTION_NORTH,this.deterministic=null==n||n}!function(){function t(m){return m=null!=m?m:2,function(t,e,n,i,l,s,o,r,a,h){var d=l*a*1.118,u=s*a*1.118;l*=o+a,s*=o+a;var p=i.clone();p.x-=d,p.y-=u;a=n!=mxConstants.ARROW_CLASSIC&&n!=mxConstants.ARROW_CLASSIC_THIN?1:.75;return i.x+=-l*a-d,i.y+=-s*a-u,function(){t.begin(),t.moveTo(p.x,p.y),t.lineTo(p.x-l-s/m,p.y-s+l/m),n!=mxConstants.ARROW_CLASSIC&&n!=mxConstants.ARROW_CLASSIC_THIN||t.lineTo(p.x-3*l/4,p.y-3*s/4),t.lineTo(p.x+s/m-l,p.y-s-l/m),t.close(),h?t.fillAndStroke():t.stroke()}}}function e(m){return m=null!=m?m:2,function(t,e,n,i,l,s,o,r,a,h){var d=l*a*1.118,u=s*a*1.118;l*=o+a,s*=o+a;var p=i.clone();return p.x-=d,p.y-=u,i.x+=2*-d,i.y+=2*-u,function(){t.begin(),t.moveTo(p.x-l-s/m,p.y-s+l/m),t.lineTo(p.x,p.y),t.lineTo(p.x+s/m-l,p.y-s-l/m),t.stroke()}}}function n(t,e,n,i,l,s,o,r,a,h){var d=n==mxConstants.ARROW_DIAMOND?.7071:.9862,u=l*a*d,d=s*a*d;l*=o+a,s*=o+a;var p=i.clone();p.x-=u,p.y-=d,i.x+=-l-u,i.y+=-s-d;var m=n==mxConstants.ARROW_DIAMOND?2:3.4;return function(){t.begin(),t.moveTo(p.x,p.y),t.lineTo(p.x-l/2-s/m,p.y+l/m-s/2),t.lineTo(p.x-l,p.y-s),t.lineTo(p.x-l/2+s/m,p.y-s/2-l/m),t.close(),h?t.fillAndStroke():t.stroke()}}mxMarker.addMarker("classic",t(2)),mxMarker.addMarker("classicThin",t(3)),mxMarker.addMarker("block",t(2)),mxMarker.addMarker("blockThin",t(3)),mxMarker.addMarker("open",e(2)),mxMarker.addMarker("openThin",e(3)),mxMarker.addMarker("oval",function(t,e,n,i,l,s,o,r,a,h){var d=o/2,u=i.clone();return i.x-=l*d,i.y-=s*d,function(){t.ellipse(u.x-d,u.y-d,o,o),h?t.fillAndStroke():t.stroke()}}),mxMarker.addMarker("diamond",n),mxMarker.addMarker("diamondThin",n)}(),mxUtils.extend(mxActor,mxShape),mxActor.prototype.paintVertexShape=function(t,e,n,i,l){t.translate(e,n),t.begin(),this.redrawPath(t,e,n,i,l),t.fillAndStroke()},mxActor.prototype.redrawPath=function(t,e,n,i,l){var s=i/3;t.moveTo(0,l),t.curveTo(0,3*l/5,0,2*l/5,i/2,2*l/5),t.curveTo(i/2-s,2*l/5,i/2-s,0,i/2,0),t.curveTo(i/2+s,0,i/2+s,2*l/5,i/2,2*l/5),t.curveTo(i,2*l/5,i,3*l/5,i,l),t.close()},mxUtils.extend(mxCloud,mxActor),mxCloud.prototype.redrawPath=function(t,e,n,i,l){t.moveTo(.25*i,.25*l),t.curveTo(.05*i,.25*l,0,.5*l,.16*i,.55*l),t.curveTo(0,.66*l,.18*i,.9*l,.31*i,.8*l),t.curveTo(.4*i,l,.7*i,l,.8*i,.8*l),t.curveTo(i,.8*l,i,.6*l,.875*i,.5*l),t.curveTo(i,.3*l,.8*i,.1*l,.625*i,.2*l),t.curveTo(.5*i,.05*l,.3*i,.05*l,.25*i,.25*l),t.close()},mxUtils.extend(mxRectangleShape,mxShape),mxRectangleShape.prototype.isHtmlAllowed=function(){var t=!0;return null!=this.style&&(t="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),!this.isRounded&&!this.glass&&0==this.rotation&&(t||null!=this.fill&&this.fill!=mxConstants.NONE)},mxRectangleShape.prototype.paintBackground=function(t,e,n,i,l){var s,o=!0;null!=this.style&&(o="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),(o||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)&&(o||null!=this.fill&&this.fill!=mxConstants.NONE||(t.pointerEvents=!1),this.isRounded?(s=0,s="1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?Math.min(i/2,Math.min(l/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(o=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,Math.min(i*o,l*o)),t.roundrect(e,n,i,l,s,s)):t.rect(e,n,i,l),t.fillAndStroke())},mxRectangleShape.prototype.isRoundable=function(t,e,n,i,l){return!0},mxRectangleShape.prototype.paintForeground=function(t,e,n,i,l){this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(t,e,n,i,l,this.getArcSize(i+this.strokewidth,l+this.strokewidth))},mxUtils.extend(mxEllipse,mxShape),mxEllipse.prototype.paintVertexShape=function(t,e,n,i,l){t.ellipse(e,n,i,l),t.fillAndStroke()},mxUtils.extend(mxDoubleEllipse,mxShape),mxDoubleEllipse.prototype.vmlScale=10,mxDoubleEllipse.prototype.paintBackground=function(t,e,n,i,l){t.ellipse(e,n,i,l),t.fillAndStroke()},mxDoubleEllipse.prototype.paintForeground=function(t,e,n,i,l){var s;this.outline||(e+=s=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(i/5,l/5))),n+=s,l-=2*s,0<(i-=2*s)&&0<l&&t.ellipse(e,n,i,l),t.stroke())},mxDoubleEllipse.prototype.getLabelBounds=function(t){var e=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(t.width/5/this.scale,t.height/5/this.scale)))*this.scale;return new mxRectangle(t.x+e,t.y+e,t.width-2*e,t.height-2*e)},mxUtils.extend(mxRhombus,mxShape),mxRhombus.prototype.isRoundable=function(){return!0},mxRhombus.prototype.paintVertexShape=function(t,e,n,i,l){var s=i/2,o=l/2,r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,[new mxPoint(e+s,n),new mxPoint(e+i,n+o),new mxPoint(e+s,n+l),new mxPoint(e,n+o)],this.isRounded,r,!0),t.fillAndStroke()},mxUtils.extend(mxPolyline,mxShape),mxPolyline.prototype.getRotation=function(){return 0},mxPolyline.prototype.getShapeRotation=function(){return 0},mxPolyline.prototype.isPaintBoundsInverted=function(){return!1},mxPolyline.prototype.paintEdgeShape=function(t,e){var n=t.pointerEventsValue;t.pointerEventsValue="stroke",null==this.style||1!=this.style[mxConstants.STYLE_CURVED]?this.paintLine(t,e,this.isRounded):this.paintCurvedLine(t,e),t.pointerEventsValue=n},mxPolyline.prototype.paintLine=function(t,e,n){var i=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,e,n,i,!1),t.stroke()},mxPolyline.prototype.paintCurvedLine=function(t,e){t.begin();var n=e[0],i=e.length;t.moveTo(n.x,n.y);for(var l=1;l<i-2;l++){var s=e[l],o=e[l+1],r=(s.x+o.x)/2,a=(s.y+o.y)/2;t.quadTo(s.x,s.y,r,a)}s=e[i-2],o=e[i-1];t.quadTo(s.x,s.y,o.x,o.y),t.stroke()},mxUtils.extend(mxArrow,mxShape),mxArrow.prototype.augmentBoundingBox=function(t){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var e=Math.max(this.arrowWidth,this.endSize);t.grow((e/2+this.strokewidth)*this.scale)},mxArrow.prototype.paintEdgeShape=function(t,e){var n=mxConstants.ARROW_SPACING,i=mxConstants.ARROW_WIDTH,l=mxConstants.ARROW_SIZE,s=e[0],o=e[e.length-1],r=o.x-s.x,a=o.y-s.y,h=Math.sqrt(r*r+a*a),d=h-2*n-l,u=r/h,p=a/h,m=d*u,c=d*p,g=i*p/3,x=-i*u/3,e=s.x-g/2+n*u,l=s.y-x/2+n*p,r=e+g,a=l+x,h=r+m,d=a+c,i=h+g,s=d+x,m=i-3*g,c=s-3*x;t.begin(),t.moveTo(e,l),t.lineTo(r,a),t.lineTo(h,d),t.lineTo(i,s),t.lineTo(o.x-n*u,o.y-n*p),t.lineTo(m,c),t.lineTo(m+g,c+x),t.close(),t.fillAndStroke()},mxUtils.extend(mxArrowConnector,mxShape),mxArrowConnector.prototype.useSvgBoundingBox=!0,mxArrowConnector.prototype.isRoundable=function(){return!0},mxArrowConnector.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments),this.arrowSpacing=mxConstants.ARROW_SPACING},mxArrowConnector.prototype.apply=function(t){mxShape.prototype.apply.apply(this,arguments),null!=this.style&&(this.startSize=3*mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5),this.endSize=3*mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5))},mxArrowConnector.prototype.augmentBoundingBox=function(t){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var e=this.getEdgeWidth();this.isMarkerStart()&&(e=Math.max(e,this.getStartArrowWidth())),this.isMarkerEnd()&&(e=Math.max(e,this.getEndArrowWidth())),t.grow((e/2+this.strokewidth)*this.scale)},mxArrowConnector.prototype.paintEdgeShape=function(o,t){var e=this.strokewidth;this.outline&&(e=Math.max(1,mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth)));for(var n=this.getStartArrowWidth()+e,i=this.getEndArrowWidth()+e,r=this.outline?this.getEdgeWidth()+e:this.getEdgeWidth(),l=this.isOpenEnded(),s=this.isMarkerStart(),a=this.isMarkerEnd(),h=l?0:this.arrowSpacing+e/2,d=this.startSize+e,u=this.endSize+e,p=this.isArrowRounded(),m=t[t.length-1],c=1;c<t.length-1&&t[c].x==t[0].x&&t[c].y==t[0].y;)c++;var g=t[c].x-t[0].x,x=t[c].y-t[0].y,y=Math.sqrt(g*g+x*x);if(0!=y){var f=g/y,C=f,v=x/y,E=v,S=r*v,w=-r*f,b=[];p?o.setLineJoin("round"):2<t.length&&o.setMiterLimit(1.42),o.begin();var T,A,e=f,g=v;s&&!l?this.paintMarker(o,t[0].x,t[0].y,f,v,d,n,r,h,!0):(x=t[0].x+S/2+h*f,y=t[0].y+w/2+h*v,T=t[0].x-S/2+h*f,A=t[0].y-w/2+h*v,l?(o.moveTo(x,y),b.push(function(){o.lineTo(T,A)})):(o.moveTo(T,A),o.lineTo(x,y)));for(var L,I,M=0,R=0;R<t.length-2;R++){var P,O,U,N,H,_,D,G=mxUtils.relativeCcw(t[R].x,t[R].y,t[R+1].x,t[R+1].y,t[R+2].x,t[R+2].y),k=t[R+2].x-t[R+1].x,V=t[R+2].y-t[R+1].y;0!=(M=Math.sqrt(k*k+V*V))&&(U=f*(C=k/M)+v*(E=V/M),N=Math.max(Math.sqrt((1+U)/2),.04),_=f+C,H=v+E,0!=(D=Math.sqrt(_*_+H*H))&&(_/=D,H/=D,U=Math.max(N,Math.min(this.strokewidth/200+.04,.35)),D=0!=G&&p?Math.max(.1,U):Math.max(N,.06),P=t[R+1].x+H*r/2/D,O=t[R+1].y-_*r/2/D,U=t[R+1].x-H*r/2/D,N=t[R+1].y+_*r/2/D,0!=G&&p?-1==G?(H=U+v*r,_=N-f*r,D=U+E*r,G=N-C*r,o.lineTo(H,_),o.quadTo(P,O,D,G),function(t,e){b.push(function(){o.lineTo(t,e)})}(U,N)):(o.lineTo(P,O),function(t,e){var n=P-v*r,i=O+f*r,l=P-E*r,s=O+C*r;b.push(function(){o.quadTo(t,e,n,i)}),b.push(function(){o.lineTo(l,s)})}(U,N)):(o.lineTo(P,O),function(t,e){b.push(function(){o.lineTo(t,e)})}(U,N)),f=C,v=E))}S=r*E,w=-r*C,a&&!l?this.paintMarker(o,m.x,m.y,-f,-v,u,i,r,h,!1):(o.lineTo(m.x-h*C+S/2,m.y-h*E+w/2),L=m.x-h*C-S/2,I=m.y-h*E-w/2,l?(o.moveTo(L,I),b.splice(0,0,function(){o.moveTo(L,I)})):o.lineTo(L,I));for(R=b.length-1;0<=R;R--)b[R]();l?(o.end(),o.stroke()):(o.close(),o.fillAndStroke()),o.setShadow(!1),o.setMiterLimit(4),p&&o.setLineJoin("flat"),2<t.length&&(o.setMiterLimit(4),s&&!l&&(o.begin(),this.paintMarker(o,t[0].x,t[0].y,e,g,d,n,r,h,!0),o.stroke(),o.end()),a&&!l&&(o.begin(),this.paintMarker(o,m.x,m.y,-f,-v,u,i,r,h,!0),o.stroke(),o.end()))}},mxArrowConnector.prototype.paintMarker=function(t,e,n,i,l,s,o,r,a,h){var d=r/o,u=r*l/2,o=-r*i/2,r=(a+s)*i,s=(a+s)*l;h?t.moveTo(e-u+r,n-o+s):t.lineTo(e-u+r,n-o+s),t.lineTo(e-u/d+r,n-o/d+s),t.lineTo(e+a*i,n+a*l),t.lineTo(e+u/d+r,n+o/d+s),t.lineTo(e+u+r,n+o+s)},mxArrowConnector.prototype.isArrowRounded=function(){return this.isRounded},mxArrowConnector.prototype.getStartArrowWidth=function(){return mxConstants.ARROW_WIDTH},mxArrowConnector.prototype.getEndArrowWidth=function(){return mxConstants.ARROW_WIDTH},mxArrowConnector.prototype.getEdgeWidth=function(){return mxConstants.ARROW_WIDTH/3},mxArrowConnector.prototype.isOpenEnded=function(){return!1},mxArrowConnector.prototype.isMarkerStart=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE},mxArrowConnector.prototype.isMarkerEnd=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE},mxUtils.extend(mxText,mxShape),mxText.prototype.baseSpacingTop=0,mxText.prototype.baseSpacingBottom=0,mxText.prototype.baseSpacingLeft=0,mxText.prototype.baseSpacingRight=0,mxText.prototype.replaceLinefeeds=!0,mxText.prototype.verticalTextRotation=-90,mxText.prototype.ignoreClippedStringSize=!0,mxText.prototype.ignoreStringSize=!1,mxText.prototype.textWidthPadding=8!=document.documentMode||mxClient.IS_EM?3:4,mxText.prototype.lastValue=null,mxText.prototype.cacheEnabled=!0,mxText.prototype.isParseVml=function(){return!1},mxText.prototype.isHtmlAllowed=function(){return 8!=document.documentMode||mxClient.IS_EM},mxText.prototype.getSvgScreenOffset=function(){return 0},mxText.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&0<this.scale&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)},mxText.prototype.paint=function(t,e){var n,i,l=this.scale,s=this.bounds.x/l,o=this.bounds.y/l,r=this.bounds.width/l,a=this.bounds.height/l;this.updateTransform(t,s,o,r,a),this.configureCanvas(t,s,o,r,a),e?t.updateText(s,o,r,a,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.getTextRotation(),this.node):(i=(n=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML)||t instanceof mxVmlCanvas2D?"html":"",l=this.value,n||"html"!=i||(l=mxUtils.htmlEntities(l,!1)),"html"!=i||mxUtils.isNode(this.value)||(l=mxUtils.replaceTrailingNewlines(l,"<div><br></div>")),l=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==i?l.replace(/\n/g,"<br/>"):l,(e=this.textDirection)!=mxConstants.TEXT_DIRECTION_AUTO||n||(e=this.getAutoDirection()),e!=mxConstants.TEXT_DIRECTION_LTR&&e!=mxConstants.TEXT_DIRECTION_RTL&&(e=null),t.text(s,o,r,a,l,this.align,this.valign,this.wrap,i,this.overflow,this.clipped,this.getTextRotation(),e))},mxText.prototype.redraw=function(){var t;this.visible&&this.checkBounds()&&this.cacheEnabled&&this.lastValue==this.value&&(mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML)?"DIV"!=this.node.nodeName||!this.isHtmlAllowed()&&mxClient.IS_VML?null!=(t=this.createCanvas())&&null!=t.updateText?(t.pointerEvents=this.pointerEvents,this.paint(t,!0),this.destroyCanvas(t),this.updateBoundingBox()):mxShape.prototype.redraw.apply(this,arguments):(mxClient.IS_SVG?this.redrawHtmlShapeWithCss3():(this.updateSize(this.node,null==this.state||null==this.state.view.textDiv),mxClient.IS_IE&&(null==document.documentMode||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()),this.updateBoundingBox()):(mxShape.prototype.redraw.apply(this,arguments),mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML?this.lastValue=this.value:this.lastValue=null)},mxText.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments),this.color="black",this.align=mxConstants.ALIGN_CENTER,this.valign=mxConstants.ALIGN_MIDDLE,this.family=mxConstants.DEFAULT_FONTFAMILY,this.size=mxConstants.DEFAULT_FONTSIZE,this.fontStyle=mxConstants.DEFAULT_FONTSTYLE,this.spacing=2,this.spacingTop=2,this.spacingRight=2,this.spacingBottom=2,this.spacingLeft=2,this.horizontal=!0,delete this.background,delete this.border,this.textDirection=mxConstants.DEFAULT_TEXT_DIRECTION,delete this.margin},mxText.prototype.apply=function(t){var e=this.spacing;mxShape.prototype.apply.apply(this,arguments),null!=this.style&&(this.fontStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,this.fontStyle),this.family=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,this.family),this.size=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,this.size),this.color=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,this.color),this.align=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,this.align),this.valign=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,this.valign),this.spacing=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing)),this.spacingTop=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,this.spacingTop-e))+this.spacing,this.spacingRight=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,this.spacingRight-e))+this.spacing,this.spacingBottom=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,this.spacingBottom-e))+this.spacing,this.spacingLeft=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_LEFT,this.spacingLeft-e))+this.spacing,this.horizontal=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,this.horizontal),this.background=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,this.background),this.border=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,this.border),this.textDirection=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_OPACITY,100),this.updateMargin()),this.flipV=null,this.flipH=null},mxText.prototype.getAutoDirection=function(){var t=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(this.value);return null!=t&&0<t.length&&"z"<t[0]?mxConstants.TEXT_DIRECTION_RTL:mxConstants.TEXT_DIRECTION_LTR},mxText.prototype.getContentNode=function(){var t=this.node;return null!=t&&(t=(null==t.ownerSVGElement?this.node:t.firstChild.firstChild.firstChild).firstChild.firstChild),t},mxText.prototype.updateBoundingBox=function(){var t=this.node;this.boundingBox=this.bounds.clone();var e=this.getTextRotation(),n=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER):null,i=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE):null;if(!(this.ignoreStringSize||null==t||"fill"==this.overflow||this.clipped&&this.ignoreClippedStringSize&&n==mxConstants.ALIGN_CENTER&&i==mxConstants.ALIGN_MIDDLE)){var l=null,s=null;if(null!=t.ownerSVGElement)if(null!=t.firstChild&&null!=t.firstChild.firstChild&&"foreignObject"==t.firstChild.firstChild.nodeName)s=(t=t.firstChild.firstChild.firstChild.firstChild).offsetHeight*this.scale,l="width"==this.overflow?this.boundingBox.width:t.offsetWidth*this.scale;else try{var o=t.getBBox();return void("string"==typeof this.value&&0==mxUtils.trim(this.value)||0==o.width&&0==o.height?this.boundingBox=null:this.boundingBox=new mxRectangle(o.x,o.y,o.width,o.height))}catch(t){}else var r=null!=this.state?this.state.view.textDiv:null,s=(l=(null!=this.offsetWidth&&null!=this.offsetHeight||(null!=r&&(this.updateFont(r),this.updateSize(r,!1),this.updateInnerHtml(r),t=r),n=t,8!=document.documentMode||mxClient.IS_EM?null!=n.firstChild&&"DIV"==n.firstChild.nodeName&&(n=n.firstChild):(i=Math.round(this.bounds.width/this.scale),this.wrap&&0<i?(t.style.wordWrap=mxConstants.WORD_WRAP,t.style.whiteSpace="normal","break-word"!=t.style.wordWrap&&(0<(r=n.getElementsByTagName("div")).length&&(n=r[r.length-1]),l=n.offsetWidth+2,r=this.node.getElementsByTagName("div"),this.clipped&&(l=Math.min(i,l)),1<r.length&&(r[r.length-2].style.width=l+"px"))):t.style.whiteSpace="nowrap"),this.offsetWidth=n.offsetWidth+this.textWidthPadding,this.offsetHeight=n.offsetHeight),this.offsetWidth*this.scale),this.offsetHeight*this.scale);null!=l&&null!=s&&(this.boundingBox=new mxRectangle(this.bounds.x,this.bounds.y,l,s))}null!=this.boundingBox&&(0!=e?(e=mxUtils.getBoundingBox(new mxRectangle(this.margin.x*this.boundingBox.width,this.margin.y*this.boundingBox.height,this.boundingBox.width,this.boundingBox.height),e,new mxPoint(0,0)),this.unrotatedBoundingBox=mxRectangle.fromRectangle(this.boundingBox),this.unrotatedBoundingBox.x+=this.margin.x*this.unrotatedBoundingBox.width,this.unrotatedBoundingBox.y+=this.margin.y*this.unrotatedBoundingBox.height,this.boundingBox.x+=e.x,this.boundingBox.y+=e.y,this.boundingBox.width=e.width,this.boundingBox.height=e.height):(this.boundingBox.x+=this.margin.x*this.boundingBox.width,this.boundingBox.y+=this.margin.y*this.boundingBox.height,this.unrotatedBoundingBox=null))},mxText.prototype.getShapeRotation=function(){return 0},mxText.prototype.getTextRotation=function(){return null!=this.state&&null!=this.state.shape?this.state.shape.getTextRotation():0},mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&null!=this.state&&this.state.view.graph.model.isVertex(this.state.cell)},mxText.prototype.configureCanvas=function(t,e,n,i,l){mxShape.prototype.configureCanvas.apply(this,arguments),t.setFontColor(this.color),t.setFontBackgroundColor(this.background),t.setFontBorderColor(this.border),t.setFontFamily(this.family),t.setFontSize(this.size),t.setFontStyle(this.fontStyle)},mxText.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width="1px",this.node.style.height="1px",this.node.style.overflow="visible"},mxText.prototype.getHtmlValue=function(){var t=this.value;return this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"<div><br></div>"),t=this.replaceLinefeeds?t.replace(/\n/g,"<br/>"):t},mxText.prototype.getTextCss=function(){var t=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,e="display: inline-block; font-size: "+this.size+"px; font-family: "+this.family+"; color: "+this.color+"; line-height: "+t+"; pointer-events: "+(this.pointerEvents?"all":"none")+"; ";(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(e+="font-weight: bold; "),(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(e+="font-style: italic; ");t=[];return(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&t.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&t.push("line-through"),0<t.length&&(e+="text-decoration: "+t.join(" ")+"; "),e},mxText.prototype.redrawHtmlShape=function(){var t;mxClient.IS_SVG?this.redrawHtmlShapeWithCss3():((t=this.node.style).whiteSpace="normal",t.overflow="",t.width="",t.height="",this.updateValue(),this.updateFont(this.node),this.updateSize(this.node,null==this.state||null==this.state.view.textDiv),this.offsetWidth=null,this.offsetHeight=null,mxClient.IS_IE&&(null==document.documentMode||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform())},mxText.prototype.redrawHtmlShapeWithCss3=function(){var t=Math.max(0,Math.round(this.bounds.width/this.scale)),e=Math.max(0,Math.round(this.bounds.height/this.scale)),n="position: absolute; left: "+Math.round(this.bounds.x)+"px; top: "+Math.round(this.bounds.y)+"px; pointer-events: none; ",i=this.getTextCss();mxSvgCanvas2D.createCss(t+2,e,this.align,this.valign,this.wrap,this.overflow,this.clipped,null!=this.background?mxUtils.htmlEntities(this.background):null,null!=this.border?mxUtils.htmlEntities(this.border):null,n,i,this.scale,mxUtils.bind(this,function(t,e,n,i,l,s){var o=this.getTextRotation(),o=(1!=this.scale?"scale("+this.scale+") ":"")+(0!=o?"rotate("+o+"deg) ":"")+(0!=this.margin.x||0!=this.margin.y?"translate("+100*this.margin.x+"%,"+100*this.margin.y+"%)":"");""!=o&&(o="transform-origin: 0 0; transform: "+o+"; "),""==s?(n+=i,i="display:inline-block; min-width: 100%; "+o):(i+=o,mxClient.IS_SF&&(i+="-webkit-clip-path: content-box;")),this.opacity<100&&(l+="opacity: "+this.opacity/100+"; "),this.node.setAttribute("style",n);n=mxUtils.isNode(this.value)?this.value.outerHTML:this.getHtmlValue();null==this.node.firstChild&&(this.node.innerHTML="<div><div>"+n+"</div></div>"),this.node.firstChild.firstChild.setAttribute("style",l),this.node.firstChild.setAttribute("style",i)}))},mxText.prototype.updateHtmlTransform=function(){var t=this.getTextRotation(),e=this.node.style,n=this.margin.x,i=this.margin.y;0!=t?(mxUtils.setPrefixedStyle(e,"transformOrigin",100*-n+"% "+100*-i+"%"),mxUtils.setPrefixedStyle(e,"transform","translate("+100*n+"%,"+100*i+"%) scale("+this.scale+") rotate("+t+"deg)")):(mxUtils.setPrefixedStyle(e,"transformOrigin","0% 0%"),mxUtils.setPrefixedStyle(e,"transform","scale("+this.scale+") translate("+100*n+"%,"+100*i+"%)")),e.left=Math.round(this.bounds.x-Math.ceil(n*("fill"!=this.overflow&&"width"!=this.overflow?3:1)))+"px",e.top=Math.round(this.bounds.y-i*("fill"!=this.overflow?3:1))+"px",this.opacity<100?e.opacity=this.opacity/100:e.opacity=""},mxText.prototype.updateInnerHtml=function(t){var e;mxUtils.isNode(this.value)?t.innerHTML=this.value.outerHTML:(e=this.value,this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1)),e=mxUtils.replaceTrailingNewlines(e,"<div>&nbsp;</div>"),e='<div style="display:inline-block;_display:inline;">'+(e=this.replaceLinefeeds?e.replace(/\n/g,"<br/>"):e)+"</div>",t.innerHTML=e)},mxText.prototype.updateHtmlFilter=function(){var t=this.node.style,e=this.margin.x,n=this.margin.y,i=this.scale;mxUtils.setOpacity(this.node,this.opacity);var l=0,s=0,o=null!=this.state?this.state.view.textDiv:null,r=this.node;null!=o?(o.style.overflow="",o.style.height="",o.style.width="",this.updateFont(o),this.updateSize(o,!1),this.updateInnerHtml(o),a=Math.round(this.bounds.width/this.scale),this.wrap&&0<a?(o.style.whiteSpace="normal",o.style.wordWrap=mxConstants.WORD_WRAP,l=a,this.clipped&&(l=Math.min(l,this.bounds.width)),o.style.width=l+"px"):o.style.whiteSpace="nowrap",null!=(r=o).firstChild&&"DIV"==r.firstChild.nodeName&&(r=r.firstChild,this.wrap&&"break-word"==o.style.wordWrap&&(r.style.width="100%")),!this.clipped&&this.wrap&&0<a&&(l=r.offsetWidth+this.textWidthPadding,o.style.width=l+"px"),s=r.offsetHeight+2,mxClient.IS_QUIRKS&&null!=this.border&&this.border!=mxConstants.NONE&&(s+=3)):null!=r.firstChild&&"DIV"==r.firstChild.nodeName&&(s=(r=r.firstChild).offsetHeight),l=r.offsetWidth+this.textWidthPadding,this.clipped&&(s=Math.min(s,this.bounds.height));var a=this.bounds.width/i,h=this.bounds.height/i;"fill"==this.overflow?(s=h,l=a):"width"==this.overflow&&(s=r.scrollHeight,l=a),this.offsetWidth=l,this.offsetHeight=s,mxClient.IS_QUIRKS&&(this.clipped||"width"==this.overflow&&0<h)?(h=Math.min(h,s),t.height=Math.round(h)+"px"):h=s,"fill"!=this.overflow&&"width"!=this.overflow&&(this.clipped&&(l=Math.min(a,l)),a=l,(mxClient.IS_QUIRKS&&this.clipped||this.wrap)&&(t.width=Math.round(a)+"px")),h*=i,a*=i;var d=this.getTextRotation()*(Math.PI/180),u=parseFloat(parseFloat(Math.cos(d)).toFixed(8)),p=parseFloat(parseFloat(Math.sin(-d)).toFixed(8));(d%=2*Math.PI)<0&&(d+=2*Math.PI),(d%=Math.PI)>Math.PI/2&&(d=Math.PI-d);o=Math.cos(d),r=Math.sin(-d),s=a*-(e+.5),l=h*-(n+.5),e=(h-h*o+a*r)/2+p*s-u*l,l=(a-a*o+h*r)/2-u*s-p*l;0!=d&&(u="progid:DXImageTransform.Microsoft.Matrix(M11="+u+", M12="+p+", M21="+-p+", M22="+u+", sizingMethod='auto expand')",null!=t.filter&&0<t.filter.length?t.filter+=" "+u:t.filter=u);n=0;"fill"!=this.overflow&&mxClient.IS_QUIRKS&&(this.valign==mxConstants.ALIGN_TOP?--n:this.valign==mxConstants.ALIGN_BOTTOM?n+=2:n+=1),t.zoom=i,t.left=Math.round(this.bounds.x+l-a/2)+"px",t.top=Math.round(this.bounds.y+e-h/2+n)+"px"},mxText.prototype.updateValue=function(){var t,e,n,i;mxUtils.isNode(this.value)?(this.node.innerHTML="",this.node.appendChild(this.value)):(i=this.value,this.dialect!=mxConstants.DIALECT_STRICTHTML&&(i=mxUtils.htmlEntities(i,!1)),i=mxUtils.replaceTrailingNewlines(i,"<div><br></div>"),i=this.replaceLinefeeds?i.replace(/\n/g,"<br/>"):i,t=null!=this.background&&this.background!=mxConstants.NONE?this.background:null,e=null!=this.border&&this.border!=mxConstants.NONE?this.border:null,"fill"==this.overflow||"width"==this.overflow?(null!=t&&(this.node.style.backgroundColor=t),null!=e&&(this.node.style.border="1px solid "+e)):(n="",null!=t&&(n+="background-color:"+mxUtils.htmlEntities(t)+";"),null!=e&&(n+="border:1px solid "+mxUtils.htmlEntities(e)+";"),i='<div style="zoom:1;'+n+"display:inline-block;_display:inline;text-decoration:inherit;padding-bottom:1px;padding-right:1px;line-height:"+(mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT)+'">'+i+"</div>"),this.node.innerHTML=i,0<(n=this.node.getElementsByTagName("div")).length&&((i=this.textDirection)==mxConstants.TEXT_DIRECTION_AUTO&&this.dialect!=mxConstants.DIALECT_STRICTHTML&&(i=this.getAutoDirection()),i==mxConstants.TEXT_DIRECTION_LTR||i==mxConstants.TEXT_DIRECTION_RTL?n[n.length-1].setAttribute("dir",i):n[n.length-1].removeAttribute("dir")))},mxText.prototype.updateFont=function(t){var e=t.style;e.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,e.fontSize=this.size+"px",e.fontFamily=this.family,e.verticalAlign="top",e.color=this.color,(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?e.fontWeight="bold":e.fontWeight="",(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?e.fontStyle="italic":e.fontStyle="";t=[];(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&t.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&t.push("line-through"),e.textDecoration=t.join(" "),this.align==mxConstants.ALIGN_CENTER?e.textAlign="center":this.align==mxConstants.ALIGN_RIGHT?e.textAlign="right":e.textAlign="left"},mxText.prototype.updateSize=function(t,e){var n,i=Math.max(0,Math.round(this.bounds.width/this.scale)),l=Math.max(0,Math.round(this.bounds.height/this.scale)),s=t.style;this.clipped?(s.overflow="hidden",mxClient.IS_QUIRKS?s.width=i+"px":(s.maxHeight=l+"px",s.maxWidth=i+"px")):"fill"==this.overflow?(s.width=i+1+"px",s.height=l+1+"px",s.overflow="hidden"):"width"==this.overflow&&(s.width=i+1+"px",s.maxHeight=l+1+"px",s.overflow="hidden"),this.wrap&&0<i?(s.wordWrap=mxConstants.WORD_WRAP,s.whiteSpace="normal",s.width=i+"px",e&&"fill"!=this.overflow&&"width"!=this.overflow&&(null!=(n=t).firstChild&&"DIV"==n.firstChild.nodeName&&(n=n.firstChild,"break-word"==t.style.wordWrap&&(n.style.width="100%")),0==(l=n.offsetWidth)&&(e=t.parentNode,t.style.visibility="hidden",document.body.appendChild(t),l=n.offsetWidth,t.style.visibility="",e.appendChild(t)),l+=3,this.clipped&&(l=Math.min(l,i)),s.width=l+"px")):s.whiteSpace="nowrap"},mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)},mxText.prototype.getSpacing=function(){return new mxPoint(this.align==mxConstants.ALIGN_CENTER?(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?-this.spacingRight-this.baseSpacingRight:this.spacingLeft+this.baseSpacingLeft,this.valign==mxConstants.ALIGN_MIDDLE?(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?-this.spacingBottom-this.baseSpacingBottom:this.spacingTop+this.baseSpacingTop)},mxUtils.extend(mxTriangle,mxActor),mxTriangle.prototype.isRoundable=function(){return!0},mxTriangle.prototype.redrawPath=function(t,e,n,i,l){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,0),new mxPoint(i,.5*l),new mxPoint(0,l)],this.isRounded,s,!0)},mxUtils.extend(mxHexagon,mxActor),mxHexagon.prototype.redrawPath=function(t,e,n,i,l){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(.25*i,0),new mxPoint(.75*i,0),new mxPoint(i,.5*l),new mxPoint(.75*i,l),new mxPoint(.25*i,l),new mxPoint(0,.5*l)],this.isRounded,s,!0)},mxUtils.extend(mxLine,mxShape),mxLine.prototype.vertical=!1,mxLine.prototype.paintVertexShape=function(t,e,n,i,l){var s;t.begin(),this.vertical?(s=e+i/2,t.moveTo(s,n),t.lineTo(s,n+l)):(s=n+l/2,t.moveTo(e,s),t.lineTo(e+i,s)),t.stroke()},mxUtils.extend(mxImageShape,mxRectangleShape),mxImageShape.prototype.preserveImageAspect=!0,mxImageShape.prototype.getSvgScreenOffset=function(){return 0},mxImageShape.prototype.apply=function(t){mxShape.prototype.apply.apply(this,arguments),this.fill=null,this.stroke=null,(this.gradient=null)!=this.style&&(this.preserveImageAspect=1==mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1),this.flipH=this.flipH||1==mxUtils.getValue(this.style,"imageFlipH",0),this.flipV=this.flipV||1==mxUtils.getValue(this.style,"imageFlipV",0))},mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect},mxImageShape.prototype.createHtml=function(){var t=document.createElement("div");return t.style.position="absolute",t},mxImageShape.prototype.isRoundable=function(t,e,n,i,l){return!1},mxImageShape.prototype.paintVertexShape=function(t,e,n,i,l){var s,o;null!=this.image?(s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null),null!=s&&(t.setFillColor(s),t.setStrokeColor(o),t.rect(e,n,i,l),t.fillAndStroke()),t.image(e,n,i,l,this.image,this.preserveImageAspect,!1,!1),null!=(o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null))&&(t.setShadow(!1),t.setStrokeColor(o),t.rect(e,n,i,l),t.stroke())):mxRectangleShape.prototype.paintBackground.apply(this,arguments)},mxImageShape.prototype.redrawHtmlShape=function(){var t,e;this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px",this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px",this.node.innerHTML="",null!=this.image?(e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,""),t=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,""),this.node.style.backgroundColor=e,this.node.style.borderColor=t,e=mxClient.IS_IE6||(null==document.documentMode||document.documentMode<=8)&&0!=this.rotation,(t=document.createElement(e?mxClient.VML_PREFIX+":image":"img")).setAttribute("border","0"),t.style.position="absolute",t.src=this.image,e=this.opacity<100?"alpha(opacity="+this.opacity+")":"",this.node.style.filter=e,this.flipH&&this.flipV?e+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?e+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(e+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"),t.style.filter!=e&&(t.style.filter=e),"image"==t.nodeName?t.style.rotation=this.rotation:0!=this.rotation?mxUtils.setPrefixedStyle(t.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(t.style,"transform",""),t.style.width=this.node.style.width,t.style.height=this.node.style.height,this.node.style.backgroundImage="",this.node.appendChild(t)):this.setTransparentBackgroundImage(this.node)},mxUtils.extend(mxLabel,mxRectangleShape),mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE,mxLabel.prototype.spacing=2,mxLabel.prototype.indicatorSize=10,mxLabel.prototype.indicatorSpacing=2,mxLabel.prototype.init=function(t){mxShape.prototype.init.apply(this,arguments),null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.init(this.node))},mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorStrokeColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.redraw()),mxShape.prototype.redraw.apply(this,arguments)},mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape},mxLabel.prototype.paintForeground=function(t,e,n,i,l){this.paintImage(t,e,n,i,l),this.paintIndicator(t,e,n,i,l),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxLabel.prototype.paintImage=function(t,e,n,i,l){null!=this.image&&(l=this.getImageBounds(e,n,i,l),t.image(l.x,l.y,l.width,l.height,this.image,!1,!1,!1))},mxLabel.prototype.getImageBounds=function(t,e,n,i){var l=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),r=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),a=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;return l==mxConstants.ALIGN_CENTER?t+=(n-o)/2:l==mxConstants.ALIGN_RIGHT?t+=n-o-a:t+=a,s==mxConstants.ALIGN_TOP?e+=a:s==mxConstants.ALIGN_BOTTOM?e+=i-r-a:e+=(i-r)/2,new mxRectangle(t,e,o,r)},mxLabel.prototype.paintIndicator=function(t,e,n,i,l){null!=this.indicator?(this.indicator.bounds=this.getIndicatorBounds(e,n,i,l),this.indicator.paint(t)):null!=this.indicatorImage&&(l=this.getIndicatorBounds(e,n,i,l),t.image(l.x,l.y,l.width,l.height,this.indicatorImage,!1,!1,!1))},mxLabel.prototype.getIndicatorBounds=function(t,e,n,i){var l=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),r=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),a=this.spacing+5;return l==mxConstants.ALIGN_RIGHT?t+=n-o-a:l==mxConstants.ALIGN_CENTER?t+=(n-o)/2:t+=a,s==mxConstants.ALIGN_BOTTOM?e+=i-r-a:s==mxConstants.ALIGN_TOP?e+=a:e+=(i-r)/2,new mxRectangle(t,e,o,r)},mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);var t,e;null!=this.image&&((t=document.createElement("img")).style.position="relative",t.setAttribute("border","0"),(e=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height)).x-=this.bounds.x,e.y-=this.bounds.y,t.style.left=Math.round(e.x)+"px",t.style.top=Math.round(e.y)+"px",t.style.width=Math.round(e.width)+"px",t.style.height=Math.round(e.height)+"px",t.src=this.image,this.node.appendChild(t))},mxUtils.extend(mxCylinder,mxShape),mxCylinder.prototype.maxHeight=40,mxCylinder.prototype.svgStrokeTolerance=0,mxCylinder.prototype.paintVertexShape=function(t,e,n,i,l){t.translate(e,n),t.begin(),this.redrawPath(t,e,n,i,l,!1),t.fillAndStroke(),this.outline&&null!=this.style&&0!=mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)||(t.setShadow(!1),t.begin(),this.redrawPath(t,e,n,i,l,!0),t.stroke())},mxCylinder.prototype.getCylinderSize=function(t,e,n,i){return Math.min(this.maxHeight,Math.round(i/5))},mxCylinder.prototype.redrawPath=function(t,e,n,i,l,s){n=this.getCylinderSize(e,n,i,l);(s&&null!=this.fill||!s&&null==this.fill)&&(t.moveTo(0,n),t.curveTo(0,2*n,i,2*n,i,n),s||(t.stroke(),t.begin())),s||(t.moveTo(0,n),t.curveTo(0,-n/3,i,-n/3,i,n),t.lineTo(i,l-n),t.curveTo(i,l+n/3,0,l+n/3,0,l-n),t.close())},mxUtils.extend(mxConnector,mxPolyline),mxConnector.prototype.updateBoundingBox=function(){this.useSvgBoundingBox=null!=this.style&&1==this.style[mxConstants.STYLE_CURVED],mxShape.prototype.updateBoundingBox.apply(this,arguments)},mxConnector.prototype.paintEdgeShape=function(t,e){var n=this.createMarker(t,e,!0),i=this.createMarker(t,e,!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments),t.setFillColor(this.stroke),t.setShadow(!1),t.setDashed(!1),null!=n&&n(),null!=i&&i()},mxConnector.prototype.createMarker=function(t,e,n){var i=null,l=e.length,s=mxUtils.getValue(this.style,n?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW),o=n?e[1]:e[l-2],r=n?e[0]:e[l-1];if(null!=s&&null!=o&&null!=r){for(var a=1;a<l-1&&0==Math.round(o.x-r.x)&&0==Math.round(o.y-r.y);)o=n?e[1+a]:e[l-2-a],a++;var h=r.x-o.x,d=r.y-o.y,u=Math.max(1,Math.sqrt(h*h+d*d)),p=h/u,h=d/u,d=mxUtils.getNumber(this.style,n?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE),u=0!=this.style[n?mxConstants.STYLE_STARTFILL:mxConstants.STYLE_ENDFILL],i=mxMarker.createMarker(t,this,s,r,p,h,d,n,this.strokewidth,u)}return i},mxConnector.prototype.augmentBoundingBox=function(t){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var e=0;mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(e=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)+1),mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(e=Math.max(e,mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE))+1),t.grow(e*this.scale)},mxUtils.extend(mxSwimlane,mxShape),mxSwimlane.prototype.imageSize=16,mxSwimlane.prototype.isRoundable=function(t,e,n,i,l){return!0},mxSwimlane.prototype.getTitleSize=function(){return Math.max(0,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE))},mxSwimlane.prototype.getLabelBounds=function(t){var e,n=this.getTitleSize(),i=new mxRectangle(t.x,t.y,t.width,t.height),l=this.isHorizontal(),s=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0),o=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0),t=this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH,l=l==!t,s=!l&&s!=(this.direction==mxConstants.DIRECTION_SOUTH||this.direction==mxConstants.DIRECTION_WEST),o=l&&o!=(this.direction==mxConstants.DIRECTION_SOUTH||this.direction==mxConstants.DIRECTION_WEST);return t?(e=Math.min(i.width,n*this.scale),(s||o)&&(i.x+=i.width-e),i.width=e):(e=Math.min(i.height,n*this.scale),(s||o)&&(i.y+=i.height-e),i.height=e),i},mxSwimlane.prototype.getGradientBounds=function(t,e,n,i,l){var s=this.getTitleSize();return this.isHorizontal()?new mxRectangle(e,n,i,s=Math.min(s,l)):new mxRectangle(e,n,s=Math.min(s,i),l)},mxSwimlane.prototype.getSwimlaneArcSize=function(t,e,n){return"1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?Math.min(t/2,Math.min(e/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):n*(mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100)*3},mxSwimlane.prototype.isHorizontal=function(){return 1==mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)},mxSwimlane.prototype.paintVertexShape=function(t,e,n,i,l){var s=this.getTitleSize(),o=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE),r=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),a=0,s=this.isHorizontal()?Math.min(s,l):Math.min(s,i);t.translate(e,n),this.isRounded?(a=this.getSwimlaneArcSize(i,l,s),a=Math.min((this.isHorizontal()?l:i)-s,Math.min(s,a)),this.paintRoundedSwimlane(t,e,n,i,l,s,a,o,r)):this.paintSwimlane(t,e,n,i,l,s,o,r);r=mxUtils.getValue(this.style,mxConstants.STYLE_SEPARATORCOLOR,mxConstants.NONE);this.paintSeparator(t,e,n,i,l,s,r),null!=this.image&&(l=this.getImageBounds(e,n,i,l),t.image(l.x-e,l.y-n,l.width,l.height,this.image,!1,!1,!1)),this.glass&&(t.setShadow(!1),this.paintGlassEffect(t,0,0,i,s,a))},mxSwimlane.prototype.paintSwimlane=function(t,e,n,i,l,s,o,r){t.begin();var a=!0;null!=this.style&&(a="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),a||null!=this.fill&&this.fill!=mxConstants.NONE||(t.pointerEvents=!1),this.isHorizontal()?(t.moveTo(0,s),t.lineTo(0,0),t.lineTo(i,0),t.lineTo(i,s),t.fillAndStroke(),s<l&&(o!=mxConstants.NONE&&a||(t.pointerEvents=!1),o!=mxConstants.NONE&&t.setFillColor(o),t.begin(),t.moveTo(0,s),t.lineTo(0,l),t.lineTo(i,l),t.lineTo(i,s),o==mxConstants.NONE?t.stroke():t.fillAndStroke())):(t.moveTo(s,0),t.lineTo(0,0),t.lineTo(0,l),t.lineTo(s,l),t.fillAndStroke(),s<i&&(o!=mxConstants.NONE&&a||(t.pointerEvents=!1),o!=mxConstants.NONE&&t.setFillColor(o),t.begin(),t.moveTo(s,0),t.lineTo(i,0),t.lineTo(i,l),t.lineTo(s,l),o==mxConstants.NONE?t.stroke():t.fillAndStroke())),r&&this.paintDivider(t,e,n,i,l,s,o==mxConstants.NONE)},mxSwimlane.prototype.paintRoundedSwimlane=function(t,e,n,i,l,s,o,r,a){t.begin();var h=!0;null!=this.style&&(h="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),h||null!=this.fill&&this.fill!=mxConstants.NONE||(t.pointerEvents=!1),this.isHorizontal()?(t.moveTo(i,s),t.lineTo(i,o),t.quadTo(i,0,i-Math.min(i/2,o),0),t.lineTo(Math.min(i/2,o),0),t.quadTo(0,0,0,o),t.lineTo(0,s),t.fillAndStroke(),s<l&&(r!=mxConstants.NONE&&h||(t.pointerEvents=!1),r!=mxConstants.NONE&&t.setFillColor(r),t.begin(),t.moveTo(0,s),t.lineTo(0,l-o),t.quadTo(0,l,Math.min(i/2,o),l),t.lineTo(i-Math.min(i/2,o),l),t.quadTo(i,l,i,l-o),t.lineTo(i,s),r==mxConstants.NONE?t.stroke():t.fillAndStroke())):(t.moveTo(s,0),t.lineTo(o,0),t.quadTo(0,0,0,Math.min(l/2,o)),t.lineTo(0,l-Math.min(l/2,o)),t.quadTo(0,l,o,l),t.lineTo(s,l),t.fillAndStroke(),s<i&&(r!=mxConstants.NONE&&h||(t.pointerEvents=!1),r!=mxConstants.NONE&&t.setFillColor(r),t.begin(),t.moveTo(s,l),t.lineTo(i-o,l),t.quadTo(i,l,i,l-Math.min(l/2,o)),t.lineTo(i,Math.min(l/2,o)),t.quadTo(i,0,i-o,0),t.lineTo(s,0),r==mxConstants.NONE?t.stroke():t.fillAndStroke())),a&&this.paintDivider(t,e,n,i,l,s,r==mxConstants.NONE)},mxSwimlane.prototype.paintDivider=function(t,e,n,i,l,s,o){o||t.setShadow(!1),t.begin(),this.isHorizontal()?(t.moveTo(0,s),t.lineTo(i,s)):(t.moveTo(s,0),t.lineTo(s,l)),t.stroke()},mxSwimlane.prototype.paintSeparator=function(t,e,n,i,l,s,o){o!=mxConstants.NONE&&(t.setStrokeColor(o),t.setDashed(!0),t.begin(),this.isHorizontal()?(t.moveTo(i,s),t.lineTo(i,l)):(t.moveTo(s,0),t.lineTo(i,0)),t.stroke(),t.setDashed(!1))},mxSwimlane.prototype.getImageBounds=function(t,e,n,i){return this.isHorizontal()?new mxRectangle(t+n-this.imageSize,e,this.imageSize,this.imageSize):new mxRectangle(t,e,this.imageSize,this.imageSize)},mxGraphLayout.prototype.graph=null,mxGraphLayout.prototype.useBoundingBox=!0,mxGraphLayout.prototype.parent=null,mxGraphLayout.prototype.moveCell=function(t,e,n){},mxGraphLayout.prototype.resizeCell=function(t,e){},mxGraphLayout.prototype.execute=function(t){},mxGraphLayout.prototype.getGraph=function(){return this.graph},mxGraphLayout.prototype.getConstraint=function(t,e,n,i){return this.graph.getCurrentCellStyle(e)[t]},mxGraphLayout.traverse=function(t,e,n,i,l){if(null!=n&&null!=t&&(e=null==e||e,!(l=l||new mxDictionary).get(t))){l.put(t,!0);i=n(t,i);if(null==i||i){var s=this.graph.model.getEdgeCount(t);if(0<s)for(var o=0;o<s;o++){var r=this.graph.model.getEdgeAt(t,o),a=this.graph.model.getTerminal(r,!0)==t;e&&!a||(a=this.graph.view.getVisibleTerminal(r,!a),this.traverse(a,e,n,r,l))}}}},mxGraphLayout.prototype.isAncestor=function(t,e,n){if(!n)return this.graph.model.getParent(e)==t;if(e==t)return!1;for(;null!=e&&e!=t;)e=this.graph.model.getParent(e);return e==t},mxGraphLayout.prototype.isVertexMovable=function(t){return this.graph.isCellMovable(t)},mxGraphLayout.prototype.isVertexIgnored=function(t){return!this.graph.getModel().isVertex(t)||!this.graph.isCellVisible(t)},mxGraphLayout.prototype.isEdgeIgnored=function(t){var e=this.graph.getModel();return!e.isEdge(t)||!this.graph.isCellVisible(t)||null==e.getTerminal(t,!0)||null==e.getTerminal(t,!1)},mxGraphLayout.prototype.setEdgeStyleEnabled=function(t,e){this.graph.setCellStyles(mxConstants.STYLE_NOEDGESTYLE,e?"0":"1",[t])},mxGraphLayout.prototype.setOrthogonalEdge=function(t,e){this.graph.setCellStyles(mxConstants.STYLE_ORTHOGONAL,e?"1":"0",[t])},mxGraphLayout.prototype.getParentOffset=function(t){var e=new mxPoint;if(null!=t&&t!=this.parent){var n=this.graph.getModel();if(n.isAncestor(this.parent,t))for(var i=n.getGeometry(t);t!=this.parent;)e.x=e.x+i.x,e.y=e.y+i.y,t=n.getParent(t),i=n.getGeometry(t)}return e},mxGraphLayout.prototype.setEdgePoints=function(t,e){if(null!=t){var n=this.graph.model,i=n.getGeometry(t);if(null==i?(i=new mxGeometry).setRelative(!0):i=i.clone(),null!=this.parent&&null!=e)for(var l=n.getParent(t),s=this.getParentOffset(l),o=0;o<e.length;o++)e[o].x=e[o].x-s.x,e[o].y=e[o].y-s.y;i.points=e,n.setGeometry(t,i)}},mxGraphLayout.prototype.setVertexLocation=function(t,e,n){var i,l,s,o=this.graph.getModel(),r=o.getGeometry(t),a=null;return null!=r&&(a=new mxRectangle(e,n,r.width,r.height),!this.useBoundingBox||null!=(i=this.graph.getView().getState(t))&&null!=i.text&&null!=i.text.boundingBox&&(l=this.graph.getView().scale,s=i.text.boundingBox,i.text.boundingBox.x<i.x&&(e+=(i.x-s.x)/l,a.width=s.width),i.text.boundingBox.y<i.y&&(n+=(i.y-s.y)/l,a.height=s.height)),null==this.parent||null!=(s=o.getParent(t))&&s!=this.parent&&(e-=(s=this.getParentOffset(s)).x,n-=s.y),r.x==e&&r.y==n||((r=r.clone()).x=e,r.y=n,o.setGeometry(t,r))),a},mxGraphLayout.prototype.getVertexBounds=function(t){var e,n,i,l,s,o,r=this.graph.getModel().getGeometry(t);return!this.useBoundingBox||null!=(e=this.graph.getView().getState(t))&&null!=e.text&&null!=e.text.boundingBox&&(o=this.graph.getView().scale,n=e.text.boundingBox,i=Math.max(e.x-n.x,0)/o,l=Math.max(e.y-n.y,0)/o,s=Math.max(n.x+n.width-(e.x+e.width),0)/o,o=Math.max(n.y+n.height-(e.y+e.height),0)/o,r=new mxRectangle(r.x-i,r.y-l,r.width+i+s,r.height+l+o)),null!=this.parent&&(t=this.graph.getModel().getParent(t),r=r.clone(),null!=t&&t!=this.parent&&(t=this.getParentOffset(t),r.x=r.x+t.x,r.y=r.y+t.y)),new mxRectangle(r.x,r.y,r.width,r.height)},mxGraphLayout.prototype.arrangeGroups=function(t,e,n,i,l,s){return this.graph.updateGroupBounds(t,e,!0,n,i,l,s)},WeightedCellSorter.prototype.weightedValue=0,WeightedCellSorter.prototype.nudge=!1,WeightedCellSorter.prototype.visited=!1,WeightedCellSorter.prototype.rankIndex=null,WeightedCellSorter.prototype.cell=null,WeightedCellSorter.prototype.compare=function(t,e){return null!=t&&null!=e?e.weightedValue>t.weightedValue||!(e.weightedValue<t.weightedValue)&&e.nudge?-1:1:0},mxStackLayout.prototype=new mxGraphLayout,mxStackLayout.prototype.constructor=mxStackLayout,mxStackLayout.prototype.horizontal=null,mxStackLayout.prototype.spacing=null,mxStackLayout.prototype.x0=null,mxStackLayout.prototype.y0=null,mxStackLayout.prototype.border=0,mxStackLayout.prototype.marginTop=0,mxStackLayout.prototype.marginLeft=0,mxStackLayout.prototype.marginRight=0,mxStackLayout.prototype.marginBottom=0,mxStackLayout.prototype.keepFirstLocation=!1,mxStackLayout.prototype.fill=!1,mxStackLayout.prototype.resizeParent=!1,mxStackLayout.prototype.resizeParentMax=!1,mxStackLayout.prototype.resizeLast=!1,mxStackLayout.prototype.wrap=null,mxStackLayout.prototype.borderCollapse=!0,mxStackLayout.prototype.allowGaps=!1,mxStackLayout.prototype.gridSize=0,mxStackLayout.prototype.isHorizontal=function(){return this.horizontal},mxStackLayout.prototype.moveCell=function(t,e,n){var i=this.graph.getModel(),l=i.getParent(t),s=this.isHorizontal();if(null!=t&&null!=l){var o=0,r=0,a=i.getChildCount(l),h=s?e:n,n=this.graph.getView().getState(l);for(null!=n&&(h-=s?n.x:n.y),h/=this.graph.view.scale,o=0;o<a;o++){var d=i.getChildAt(l,o);if(d!=t){d=i.getGeometry(d);if(null!=d){d=s?d.x+d.width/2:d.y+d.height/2;if(r<=h&&h<d)break;r=d}}}n=l.getIndex(t),n=Math.max(0,o-(n<o?1:0));i.add(l,t,n)}},mxStackLayout.prototype.getParentSize=function(t){var e=this.graph.getModel(),n=e.getGeometry(t);return null!=this.graph.container&&(null==n&&e.isLayer(t)||t==this.graph.getView().currentRoot)&&(n=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1)),n},mxStackLayout.prototype.getLayoutCells=function(t){for(var e=this.graph.getModel(),n=e.getChildCount(t),i=[],l=0;l<n;l++){var s=e.getChildAt(t,l);!this.isVertexIgnored(s)&&this.isVertexMovable(s)&&i.push(s)}return this.allowGaps&&i.sort(mxUtils.bind(this,function(t,e){t=this.graph.getCellGeometry(t),e=this.graph.getCellGeometry(e);return this.horizontal?t.x==e.x?0:0<(t.x>e.x)?1:-1:t.y==e.y?0:0<(t.y>e.y)?1:-1})),i},mxStackLayout.prototype.snap=function(t){var e;return null!=this.gridSize&&0<this.gridSize&&1<(t=Math.max(t,this.gridSize))/this.gridSize&&(t+=(e=t%this.gridSize)>this.gridSize/2?this.gridSize-e:-e),t},mxStackLayout.prototype.execute=function(t){if(null!=t){var e=this.getParentSize(t),n=this.isHorizontal(),i=this.graph.getModel(),l=null;null!=e&&(l=n?e.height-this.marginTop-this.marginBottom:e.width-this.marginLeft-this.marginRight),l-=2*this.border;var s,o,r=this.x0+this.border+this.marginLeft,a=this.y0+this.border+this.marginTop;this.graph.isSwimlane(t)&&(o=this.graph.getCellStyle(t),s=mxUtils.getNumber(o,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE),o=1==mxUtils.getValue(o,mxConstants.STYLE_HORIZONTAL,!0),null!=e&&(s=o?Math.min(s,e.height):Math.min(s,e.width)),n==o&&(l-=s),o?a+=s:r+=s),i.beginUpdate();try{for(var h=0,d=null,u=0,p=null,m=this.getLayoutCells(t),c=0;c<m.length;c++){var g,x,y=m[c],f=i.getGeometry(y);null!=f&&(f=f.clone(),null!=this.wrap&&null!=d&&(n&&d.x+d.width+f.width+2*this.spacing>this.wrap||!n&&d.y+d.height+f.height+2*this.spacing>this.wrap)&&(d=null,n?a+=h+this.spacing:r+=h+this.spacing,h=0),h=Math.max(h,n?f.height:f.width),g=0,this.borderCollapse||(x=this.graph.getCellStyle(y),g=mxUtils.getNumber(x,mxConstants.STYLE_STROKEWIDTH,1)),null!=d?(x=u+this.spacing+Math.floor(g/2),n?f.x=this.snap((this.allowGaps?Math.max(x,f.x):x)-this.marginLeft)+this.marginLeft:f.y=this.snap((this.allowGaps?Math.max(x,f.y):x)-this.marginTop)+this.marginTop):this.keepFirstLocation||(n?f.x=this.allowGaps&&f.x>r?Math.max(this.snap(f.x-this.marginLeft)+this.marginLeft,r):r:f.y=this.allowGaps&&f.y>a?Math.max(this.snap(f.y-this.marginTop)+this.marginTop,a):a),n?f.y=a:f.x=r,this.fill&&null!=l&&(n?f.height=l:f.width=l),n?f.width=this.snap(f.width):f.height=this.snap(f.height),this.setChildGeometry(y,f),p=y,d=f,u=n?d.x+d.width+Math.floor(g/2):d.y+d.height+Math.floor(g/2))}this.resizeParent&&null!=e&&null!=d&&!this.graph.isCellCollapsed(t)?this.updateParentGeometry(t,e,d):this.resizeLast&&null!=e&&null!=d&&null!=p&&(n?d.width=e.width-d.x-this.spacing-this.marginRight-this.marginLeft:d.height=e.height-d.y-this.spacing-this.marginBottom,this.setChildGeometry(p,d))}finally{i.endUpdate()}}},mxStackLayout.prototype.setChildGeometry=function(t,e){var n=this.graph.getCellGeometry(t);null!=n&&e.x==n.x&&e.y==n.y&&e.width==n.width&&e.height==n.height||this.graph.getModel().setGeometry(t,e)},mxStackLayout.prototype.updateParentGeometry=function(t,e,n){var i,l=this.isHorizontal(),s=this.graph.getModel(),o=e.clone();l?(i=n.x+n.width+this.marginRight+this.border,this.resizeParentMax?o.width=Math.max(o.width,i):o.width=i):(i=n.y+n.height+this.marginBottom+this.border,this.resizeParentMax?o.height=Math.max(o.height,i):o.height=i),e.x==o.x&&e.y==o.y&&e.width==o.width&&e.height==o.height||s.setGeometry(t,o)},mxPartitionLayout.prototype=new mxGraphLayout,mxPartitionLayout.prototype.constructor=mxPartitionLayout,mxPartitionLayout.prototype.horizontal=null,mxPartitionLayout.prototype.spacing=null,mxPartitionLayout.prototype.border=null,mxPartitionLayout.prototype.resizeVertices=!0,mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal},mxPartitionLayout.prototype.moveCell=function(t,e,n){var i=this.graph.getModel(),l=i.getParent(t);if(null!=t&&null!=l){for(var s=0,o=0,r=i.getChildCount(l),s=0;s<r;s++){var a=i.getChildAt(l,s),a=this.getVertexBounds(a);if(null!=a){a=a.x+a.width/2;if(o<e&&e<a)break;o=a}}var h=l.getIndex(t),h=Math.max(0,s-(h<s?1:0));i.add(l,t,h)}},mxPartitionLayout.prototype.execute=function(t){var e=this.isHorizontal(),n=this.graph.getModel(),i=n.getGeometry(t);if(null!=this.graph.container&&(null==i&&n.isLayer(t)||t==this.graph.getView().currentRoot)&&(i=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1)),null!=i){for(var l=[],s=n.getChildCount(t),o=0;o<s;o++){var r=n.getChildAt(t,o);!this.isVertexIgnored(r)&&this.isVertexMovable(r)&&l.push(r)}var a=l.length;if(0<a){var h=this.border,d=this.border,u=e?i.height:i.width;u-=2*this.border;var p=this.graph.isSwimlane(t)?this.graph.getStartSize(t):new mxRectangle;u-=e?p.height:p.width,h+=p.width,d+=p.height;var p=this.border+(a-1)*this.spacing,m=e?(i.width-h-p)/a:(i.height-d-p)/a;if(0<m){n.beginUpdate();try{for(o=0;o<a;o++){var r=l[o],c=n.getGeometry(r);null!=c&&((c=c.clone()).x=h,c.y=d,e?(this.resizeVertices&&(c.width=m,c.height=u),h+=m+this.spacing):(this.resizeVertices&&(c.height=m,c.width=u),d+=m+this.spacing),n.setGeometry(r,c))}}finally{n.endUpdate()}}}}},mxCompactTreeLayout.prototype=new mxGraphLayout,mxCompactTreeLayout.prototype.constructor=mxCompactTreeLayout,mxCompactTreeLayout.prototype.horizontal=null,mxCompactTreeLayout.prototype.invert=null,mxCompactTreeLayout.prototype.resizeParent=!0,mxCompactTreeLayout.prototype.maintainParentLocation=!1,mxCompactTreeLayout.prototype.groupPadding=10,mxCompactTreeLayout.prototype.groupPaddingTop=0,mxCompactTreeLayout.prototype.groupPaddingRight=0,mxCompactTreeLayout.prototype.groupPaddingBottom=0,mxCompactTreeLayout.prototype.groupPaddingLeft=0,mxCompactTreeLayout.prototype.parentsChanged=null,mxCompactTreeLayout.prototype.moveTree=!1,mxCompactTreeLayout.prototype.visited=null,mxCompactTreeLayout.prototype.levelDistance=10,mxCompactTreeLayout.prototype.nodeDistance=20,mxCompactTreeLayout.prototype.resetEdges=!0,mxCompactTreeLayout.prototype.prefHozEdgeSep=5,mxCompactTreeLayout.prototype.prefVertEdgeOff=4,mxCompactTreeLayout.prototype.minEdgeJetty=8,mxCompactTreeLayout.prototype.channelBuffer=4,mxCompactTreeLayout.prototype.edgeRouting=!0,mxCompactTreeLayout.prototype.sortEdges=!1,mxCompactTreeLayout.prototype.alignRanks=!1,mxCompactTreeLayout.prototype.maxRankHeight=null,mxCompactTreeLayout.prototype.root=null,mxCompactTreeLayout.prototype.node=null,mxCompactTreeLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(t).length},mxCompactTreeLayout.prototype.isHorizontal=function(){return this.horizontal},mxCompactTreeLayout.prototype.execute=function(t,e){this.parent=t;var n,i,l,s,o,r,a=this.graph.getModel();if(null==e)if(0<this.graph.getEdges(t,a.getParent(t),this.invert,!this.invert,!1).length)this.root=t;else{var h=this.graph.findTreeRoots(t,!0,this.invert);if(0<h.length)for(var d=0;d<h.length;d++)if(!this.isVertexIgnored(h[d])&&0<this.graph.getEdges(h[d],null,this.invert,!this.invert,!1).length){this.root=h[d];break}}else this.root=e;if(null!=this.root){this.resizeParent?this.parentsChanged=new Object:this.parentsChanged=null,this.parentX=null,this.parentY=null,t!=this.root&&null!=a.isVertex(t)&&this.maintainParentLocation&&null!=(o=this.graph.getCellGeometry(t))&&(this.parentX=o.x,this.parentY=o.y),a.beginUpdate();try{this.visited=new Object,this.node=this.dfs(this.root,t),this.alignRanks&&(this.maxRankHeight=[],this.findRankHeights(this.node,0),this.setCellHeights(this.node,0)),null!=this.node&&(this.layout(this.node),i=n=this.graph.gridSize,this.moveTree||null!=(s=this.getVertexBounds(this.root))&&(n=s.x,i=s.y),(r=null)!=(r=this.isHorizontal()?this.horizontalLayout(this.node,n,i):this.verticalLayout(this.node,null,n,i))&&(s=l=0,r.x<0&&(l=Math.abs(n-r.x)),r.y<0&&(s=Math.abs(i-r.y)),0==l&&0==s||this.moveNode(this.node,l,s),this.resizeParent&&this.adjustParents(),this.edgeRouting&&this.localEdgeProcessing(this.node)),null!=this.parentX&&null!=this.parentY&&null!=(o=this.graph.getCellGeometry(t))&&((o=o.clone()).x=this.parentX,o.y=this.parentY,a.setGeometry(t,o)))}finally{a.endUpdate()}}},mxCompactTreeLayout.prototype.moveNode=function(t,e,n){t.x+=e,t.y+=n,this.apply(t);for(var i=t.child;null!=i;)this.moveNode(i,e,n),i=i.next},mxCompactTreeLayout.prototype.sortOutgoingEdges=function(i,t){var l=new mxDictionary;t.sort(function(t,e){var n=t.getTerminal(t.getTerminal(!1)==i),t=l.get(n);null==t&&(t=mxCellPath.create(n).split(mxCellPath.PATH_SEPARATOR),l.put(n,t));n=e.getTerminal(e.getTerminal(!1)==i),e=l.get(n);return null==e&&(e=mxCellPath.create(n).split(mxCellPath.PATH_SEPARATOR),l.put(n,e)),mxCellPath.compare(t,e)})},mxCompactTreeLayout.prototype.findRankHeights=function(t,e){(null==this.maxRankHeight[e]||this.maxRankHeight[e]<t.height)&&(this.maxRankHeight[e]=t.height);for(var n=t.child;null!=n;)this.findRankHeights(n,e+1),n=n.next},mxCompactTreeLayout.prototype.setCellHeights=function(t,e){null!=this.maxRankHeight[e]&&this.maxRankHeight[e]>t.height&&(t.height=this.maxRankHeight[e]);for(var n=t.child;null!=n;)this.setCellHeights(n,e+1),n=n.next},mxCompactTreeLayout.prototype.dfs=function(t,e){var n=mxCellPath.create(t),i=null;if(null!=t&&null==this.visited[n]&&!this.isVertexIgnored(t)){this.visited[n]=t,i=this.createNode(t);var l=this.graph.getModel(),s=null,o=this.graph.getEdges(t,e,this.invert,!this.invert,!1,!0),r=this.graph.getView();this.sortEdges&&this.sortOutgoingEdges(t,o);for(var a=0;a<o.length;a++){var h,d=o[a];this.isEdgeIgnored(d)||(this.resetEdges&&this.setEdgePoints(d,null),this.edgeRouting&&(this.setEdgeStyleEnabled(d,!1),this.setEdgePoints(d,null)),h=null!=(h=r.getState(d))?h.getVisibleTerminal(this.invert):r.getVisibleTerminal(d,this.invert),null!=(d=this.dfs(h,e))&&null!=l.getGeometry(h)&&(null==s?i.child=d:s.next=d,s=d))}}return i},mxCompactTreeLayout.prototype.layout=function(t){if(null!=t){for(var e=t.child;null!=e;)this.layout(e),e=e.next;null!=t.child?this.attachParent(t,this.join(t)):this.layoutLeaf(t)}},mxCompactTreeLayout.prototype.horizontalLayout=function(t,e,n,i){t.x+=e+t.offsetX,t.y+=n+t.offsetY,i=this.apply(t,i);var l=t.child;if(null!=l){i=this.horizontalLayout(l,t.x,t.y,i);for(var s=t.y+l.offsetY,o=l.next;null!=o;)i=this.horizontalLayout(o,t.x+l.offsetX,s,i),s+=o.offsetY,o=o.next}return i},mxCompactTreeLayout.prototype.verticalLayout=function(t,e,n,i,l){t.x+=n+t.offsetY,t.y+=i+t.offsetX,l=this.apply(t,l);var s=t.child;if(null!=s){l=this.verticalLayout(s,t,t.x,t.y,l);for(var o=t.x+s.offsetY,r=s.next;null!=r;)l=this.verticalLayout(r,t,o,t.y+s.offsetX,l),o+=r.offsetY,r=r.next}return l},mxCompactTreeLayout.prototype.attachParent=function(t,e){var n=this.nodeDistance+this.levelDistance,i=(e-t.width)/2-this.nodeDistance,e=i+t.width+2*this.nodeDistance-e;t.child.offsetX=n+t.height,t.child.offsetY=e,t.contour.upperHead=this.createLine(t.height,0,this.createLine(n,e,t.contour.upperHead)),t.contour.lowerHead=this.createLine(t.height,0,this.createLine(n,i,t.contour.lowerHead))},mxCompactTreeLayout.prototype.layoutLeaf=function(t){var e=2*this.nodeDistance;t.contour.upperTail=this.createLine(t.height+e,0),t.contour.upperHead=t.contour.upperTail,t.contour.lowerTail=this.createLine(0,-t.width-e),t.contour.lowerHead=this.createLine(t.height+e,0,t.contour.lowerTail)},mxCompactTreeLayout.prototype.join=function(t){var e=2*this.nodeDistance,n=t.child;t.contour=n.contour;for(var i=n.width+e,l=i,n=n.next;null!=n;){var s=this.merge(t.contour,n.contour);n.offsetY=s+i,n.offsetX=0,l+=s+(i=n.width+e),n=n.next}return l},mxCompactTreeLayout.prototype.merge=function(t,e){for(var n,i=0,l=0,s=0,o=t.lowerHead,r=e.upperHead;null!=r&&null!=o;){var a=this.offset(i,l,r.dx,r.dy,o.dx,o.dy);l+=a,s+=a,i+r.dx<=o.dx?(i+=r.dx,l+=r.dy,r=r.next):(i-=o.dx,l-=o.dy,o=o.next)}return null!=r?(n=this.bridge(t.upperTail,0,0,r,i,l),t.upperTail=null!=n.next?e.upperTail:n,t.lowerTail=e.lowerTail):null==(n=this.bridge(e.lowerTail,i,l,o,0,0)).next&&(t.lowerTail=n),t.lowerHead=e.lowerHead,s},mxCompactTreeLayout.prototype.offset=function(t,e,n,i,l,s){var o=0;return!(l<=t||t+n<=0)&&0<(o=0<l*i-n*s?t<0?t*i/n-e:0<t?t*s/l-e:-e:l<t+n?s-(e+(l-t)*i/n):t+n<l?(n+t)*s/l-(e+i):s-(e+i))?o:0},mxCompactTreeLayout.prototype.bridge=function(t,e,n,i,l,s){l=l+i.dx-e,e=0,e=0==i.dx?i.dy:l*i.dy/i.dx,l=this.createLine(l,e,i.next);return t.next=this.createLine(0,s+i.dy-e-n,l),l},mxCompactTreeLayout.prototype.createNode=function(t){var e=new Object;e.cell=t,e.x=0,e.y=0,e.width=0,e.height=0;t=this.getVertexBounds(t);return null!=t&&(this.isHorizontal()?(e.width=t.height,e.height=t.width):(e.width=t.width,e.height=t.height)),e.offsetX=0,e.offsetY=0,e.contour=new Object,e},mxCompactTreeLayout.prototype.apply=function(t,e){var n=this.graph.getModel(),i=t.cell,l=n.getGeometry(i);return null!=i&&null!=l&&(this.isVertexMovable(i)&&(l=this.setVertexLocation(i,t.x,t.y),this.resizeParent&&(n=n.getParent(i),i=mxCellPath.create(n),null==this.parentsChanged[i]&&(this.parentsChanged[i]=n))),e=null==e?new mxRectangle(l.x,l.y,l.width,l.height):new mxRectangle(Math.min(e.x,l.x),Math.min(e.y,l.y),Math.max(e.x+e.width,l.x+l.width),Math.max(e.y+e.height,l.y+l.height))),e},mxCompactTreeLayout.prototype.createLine=function(t,e,n){var i=new Object;return i.dx=t,i.dy=e,i.next=n,i},mxCompactTreeLayout.prototype.adjustParents=function(){var t,e=[];for(t in this.parentsChanged)e.push(this.parentsChanged[t]);this.arrangeGroups(mxUtils.sortCells(e,!0),this.groupPadding,this.groupPaddingTop,this.groupPaddingRight,this.groupPaddingBottom,this.groupPaddingLeft)},mxCompactTreeLayout.prototype.localEdgeProcessing=function(t){this.processNodeOutgoing(t);for(var e=t.child;null!=e;)this.localEdgeProcessing(e),e=e.next},mxCompactTreeLayout.prototype.processNodeOutgoing=function(t){for(var e=t.child,n=t.cell,i=0,l=[];null!=e;){i++;var s=e.x;this.horizontal&&(s=e.y),l.push(new WeightedCellSorter(e,s)),e=e.next}l.sort(WeightedCellSorter.prototype.compare);var o=t.width,r=(i+1)*this.prefHozEdgeSep;o>r+2*this.prefHozEdgeSep&&(o-=2*this.prefHozEdgeSep);var a=o/i,h=a/2;o>r+2*this.prefHozEdgeSep&&(h+=this.prefHozEdgeSep);for(var d=this.minEdgeJetty-this.prefVertEdgeOff,u=0,p=this.getVertexBounds(n),e=t.child,m=0;m<l.length;m++){for(var c=l[m].cell.cell,g=this.getVertexBounds(c),x=this.graph.getEdgesBetween(n,c,!1),y=[],f=0,C=0,v=0;v<x.length;v++)this.horizontal?(f=p.x+p.width,C=p.y+h,y.push(new mxPoint(f,C)),f=p.x+p.width+d,y.push(new mxPoint(f,C)),C=g.y+g.height/2):(f=p.x+h,C=p.y+p.height,y.push(new mxPoint(f,C)),C=p.y+p.height+d,y.push(new mxPoint(f,C)),f=g.x+g.width/2),y.push(new mxPoint(f,C)),this.setEdgePoints(x[v],y);m<i/2?d+=this.prefVertEdgeOff:i/2<m&&(d-=this.prefVertEdgeOff),h+=a,u=Math.max(u,d)}},mxUtils.extend(mxRadialTreeLayout,mxCompactTreeLayout),mxRadialTreeLayout.prototype.angleOffset=.5,mxRadialTreeLayout.prototype.rootx=0,mxRadialTreeLayout.prototype.rooty=0,mxRadialTreeLayout.prototype.levelDistance=120,mxRadialTreeLayout.prototype.nodeDistance=10,mxRadialTreeLayout.prototype.autoRadius=!1,mxRadialTreeLayout.prototype.sortEdges=!1,mxRadialTreeLayout.prototype.rowMinX=[],mxRadialTreeLayout.prototype.rowMaxX=[],mxRadialTreeLayout.prototype.rowMinCenX=[],mxRadialTreeLayout.prototype.rowMaxCenX=[],mxRadialTreeLayout.prototype.rowRadi=[],mxRadialTreeLayout.prototype.row=[],mxRadialTreeLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(t).length},mxRadialTreeLayout.prototype.execute=function(t,e){this.parent=t,this.useBoundingBox=!1,this.edgeRouting=!1,mxCompactTreeLayout.prototype.execute.apply(this,arguments);var n,i=null,l=this.getVertexBounds(this.root);for(n in this.centerX=l.x+l.width/2,this.centerY=l.y+l.height/2,this.visited){var s=this.getVertexBounds(this.visited[n]);(i=null!=i?i:s.clone()).add(s)}this.calcRowDims([this.node],0);for(var o=0,r=0,a=0;a<this.row.length;a++)var h=(this.centerX-this.rowMinX[a]-this.nodeDistance)/this.rowRadi[a],d=(this.rowMaxX[a]-this.centerX-this.nodeDistance)/this.rowRadi[a],o=Math.max(o,h),r=Math.max(r,d);for(a=0;a<this.row.length;a++)for(var u=this.centerX-this.nodeDistance-o*this.rowRadi[a],p=this.centerX+this.nodeDistance+r*this.rowRadi[a]-u,m=0;m<this.row[a].length;m++){var c=(x=this.row[a])[m],g=((s=this.getVertexBounds(c.cell)).x+s.width/2-u)/p,g=2*Math.PI*g;c.theta=g}for(a=this.row.length-2;0<=a;a--)for(var x=this.row[a],m=0;m<x.length;m++){for(var y,f,C=(c=x[m]).child,v=0,E=0;null!=C;)E+=C.theta,v++,C=C.next;0<v&&((y=E/v)>c.theta&&m<x.length-1?(f=x[m+1].theta,c.theta=Math.min(y,f-Math.PI/10)):y<c.theta&&0<m&&(f=x[m-1].theta,c.theta=Math.max(y,f+Math.PI/10)))}for(a=0;a<this.row.length;a++)for(m=0;m<this.row[a].length;m++){c=(x=this.row[a])[m],s=this.getVertexBounds(c.cell);this.setVertexLocation(c.cell,this.centerX-s.width/2+this.rowRadi[a]*Math.cos(c.theta),this.centerY-s.height/2+this.rowRadi[a]*Math.sin(c.theta))}},mxRadialTreeLayout.prototype.calcRowDims=function(t,e){if(null!=t&&0!=t.length){this.rowMinX[e]=this.centerX,this.rowMaxX[e]=this.centerX,this.rowMinCenX[e]=this.centerX,this.rowMaxCenX[e]=this.centerX;for(var n=!(this.row[e]=[]),i=0;i<t.length;i++)for(var l=null!=t[i]?t[i].child:null;null!=l;){var s=l.cell,s=this.getVertexBounds(s);this.rowMinX[e]=Math.min(s.x,this.rowMinX[e]),this.rowMaxX[e]=Math.max(s.x+s.width,this.rowMaxX[e]),this.rowMinCenX[e]=Math.min(s.x+s.width/2,this.rowMinCenX[e]),this.rowMaxCenX[e]=Math.max(s.x+s.width/2,this.rowMaxCenX[e]),this.rowRadi[e]=s.y-this.getVertexBounds(this.root).y,null!=l.child&&(n=!0),this.row[e].push(l),l=l.next}n&&this.calcRowDims(this.row[e],e+1)}},mxFastOrganicLayout.prototype=new mxGraphLayout,mxFastOrganicLayout.prototype.constructor=mxFastOrganicLayout,mxFastOrganicLayout.prototype.useInputOrigin=!0,mxFastOrganicLayout.prototype.resetEdges=!0,mxFastOrganicLayout.prototype.disableEdgeStyle=!0,mxFastOrganicLayout.prototype.forceConstant=50,mxFastOrganicLayout.prototype.forceConstantSquared=0,mxFastOrganicLayout.prototype.minDistanceLimit=2,mxFastOrganicLayout.prototype.maxDistanceLimit=500,mxFastOrganicLayout.prototype.minDistanceLimitSquared=4,mxFastOrganicLayout.prototype.initialTemp=200,mxFastOrganicLayout.prototype.temperature=0,mxFastOrganicLayout.prototype.maxIterations=0,mxFastOrganicLayout.prototype.iteration=0,mxFastOrganicLayout.prototype.vertexArray,mxFastOrganicLayout.prototype.dispX,mxFastOrganicLayout.prototype.dispY,mxFastOrganicLayout.prototype.cellLocation,mxFastOrganicLayout.prototype.radius,mxFastOrganicLayout.prototype.radiusSquared,mxFastOrganicLayout.prototype.isMoveable,mxFastOrganicLayout.prototype.neighbours,mxFastOrganicLayout.prototype.indices,mxFastOrganicLayout.prototype.allowedToRun=!0,mxFastOrganicLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(t).length},mxFastOrganicLayout.prototype.execute=function(t){var e=this.graph.getModel();this.vertexArray=[];for(var n=this.graph.getChildVertices(t),i=0;i<n.length;i++)this.isVertexIgnored(n[i])||this.vertexArray.push(n[i]);var l=this.useInputOrigin?this.graph.getBoundingBoxFromGeometry(this.vertexArray):null,s=this.vertexArray.length;this.indices=[],this.dispX=[],this.dispY=[],this.cellLocation=[],this.isMoveable=[],this.neighbours=[],this.radius=[],this.radiusSquared=[],this.forceConstant<.001&&(this.forceConstant=.001),this.forceConstantSquared=this.forceConstant*this.forceConstant;for(i=0;i<this.vertexArray.length;i++){var o=this.vertexArray[i];this.cellLocation[i]=[];var r=mxObjectIdentity.get(o);this.indices[r]=i;var a=(y=this.getVertexBounds(o)).width,h=y.height,d=y.x,u=y.y;this.cellLocation[i][0]=d+a/2,this.cellLocation[i][1]=u+h/2,this.radius[i]=Math.min(a,h),this.radiusSquared[i]=this.radius[i]*this.radius[i]}e.beginUpdate();try{for(i=0;i<s;i++){this.dispX[i]=0,this.dispY[i]=0,this.isMoveable[i]=this.isVertexMovable(this.vertexArray[i]);var p=this.graph.getConnections(this.vertexArray[i],t),n=this.graph.getOpposites(p,this.vertexArray[i]);this.neighbours[i]=[];for(var m=0;m<n.length;m++){this.resetEdges&&this.graph.resetEdge(p[m]),this.disableEdgeStyle&&this.setEdgeStyleEnabled(p[m],!1);var r=mxObjectIdentity.get(n[m]),c=this.indices[r];this.neighbours[i][m]=null!=c?c:i}}for(this.temperature=this.initialTemp,0==this.maxIterations&&(this.maxIterations=20*Math.sqrt(s)),this.iteration=0;this.iteration<this.maxIterations;this.iteration++){if(!this.allowedToRun)return;this.calcRepulsion(),this.calcAttraction(),this.calcPositions(),this.reduceTemperature()}for(var g=null,x=null,i=0;i<this.vertexArray.length;i++){var y,o=this.vertexArray[i];this.isVertexMovable(o)&&null!=(y=this.getVertexBounds(o))&&(this.cellLocation[i][0]-=y.width/2,this.cellLocation[i][1]-=y.height/2,d=this.graph.snap(Math.round(this.cellLocation[i][0])),u=this.graph.snap(Math.round(this.cellLocation[i][1])),this.setVertexLocation(o,d,u),g=null==g?d:Math.min(g,d),x=null==x?u:Math.min(x,u))}var f=1-(g||0),C=1-(x||0);null!=l&&(f+=l.x,C+=l.y),this.graph.moveCells(this.vertexArray,f,C)}finally{e.endUpdate()}},mxFastOrganicLayout.prototype.calcPositions=function(){for(var t,e,n=0;n<this.vertexArray.length;n++)this.isMoveable[n]&&((e=Math.sqrt(this.dispX[n]*this.dispX[n]+this.dispY[n]*this.dispY[n]))<.001&&(e=.001),t=this.dispX[n]/e*Math.min(e,this.temperature),e=this.dispY[n]/e*Math.min(e,this.temperature),this.dispX[n]=0,this.dispY[n]=0,this.cellLocation[n][0]+=t,this.cellLocation[n][1]+=e)},mxFastOrganicLayout.prototype.calcAttraction=function(){for(var t=0;t<this.vertexArray.length;t++)for(var e=0;e<this.neighbours[t].length;e++){var n,i,l,s,o=this.neighbours[t][e];t!=o&&this.isMoveable[t]&&this.isMoveable[o]&&((l=(s=this.cellLocation[t][0]-this.cellLocation[o][0])*s+(n=this.cellLocation[t][1]-this.cellLocation[o][1])*n-this.radiusSquared[t]-this.radiusSquared[o])<this.minDistanceLimitSquared&&(l=this.minDistanceLimitSquared),l=s/(i=Math.sqrt(l))*(s=l/this.forceConstant),s=n/i*s,this.dispX[t]-=l,this.dispY[t]-=s,this.dispX[o]+=l,this.dispY[o]+=s)}},mxFastOrganicLayout.prototype.calcRepulsion=function(){for(var t=this.vertexArray.length,e=0;e<t;e++)for(var n,i,l,s,o=e;o<t;o++){if(!this.allowedToRun)return;o!=e&&this.isMoveable[e]&&this.isMoveable[o]&&(s=this.cellLocation[e][0]-this.cellLocation[o][0],n=this.cellLocation[e][1]-this.cellLocation[o][1],0==s&&(s=.01+Math.random()),0==n&&(n=.01+Math.random()),(l=(i=Math.sqrt(s*s+n*n))-this.radius[e]-this.radius[o])>this.maxDistanceLimit||(l<this.minDistanceLimit&&(l=this.minDistanceLimit),l=s/i*(s=this.forceConstantSquared/l),s=n/i*s,this.dispX[e]+=l,this.dispY[e]+=s,this.dispX[o]-=l,this.dispY[o]-=s))}},mxFastOrganicLayout.prototype.reduceTemperature=function(){this.temperature=this.initialTemp*(1-this.iteration/this.maxIterations)},mxCircleLayout.prototype=new mxGraphLayout,mxCircleLayout.prototype.constructor=mxCircleLayout,mxCircleLayout.prototype.radius=null,mxCircleLayout.prototype.moveCircle=!1,mxCircleLayout.prototype.x0=0,mxCircleLayout.prototype.y0=0,mxCircleLayout.prototype.resetEdges=!0,mxCircleLayout.prototype.disableEdgeStyle=!0,mxCircleLayout.prototype.execute=function(t){var e=this.graph.getModel();e.beginUpdate();try{for(var n=0,i=null,l=null,s=[],o=e.getChildCount(t),r=0;r<o;r++){var a=e.getChildAt(t,r);this.isVertexIgnored(a)?this.isEdgeIgnored(a)||(this.resetEdges&&this.graph.resetEdge(a),this.disableEdgeStyle&&this.setEdgeStyleEnabled(a,!1)):(s.push(a),a=this.getVertexBounds(a),i=null==i?a.y:Math.min(i,a.y),l=null==l?a.x:Math.min(l,a.x),n=Math.max(n,Math.max(a.width,a.height)))}var h=this.getRadius(s.length,n);this.moveCircle&&(l=this.x0,i=this.y0),this.circle(s,h,l,i)}finally{e.endUpdate()}},mxCircleLayout.prototype.getRadius=function(t,e){return Math.max(t*e/Math.PI,this.radius)},mxCircleLayout.prototype.circle=function(t,e,n,i){for(var l=t.length,s=2*Math.PI/l,o=0;o<l;o++)this.isVertexMovable(t[o])&&this.setVertexLocation(t[o],Math.round(n+e+e*Math.sin(o*s)),Math.round(i+e+e*Math.cos(o*s)))},mxParallelEdgeLayout.prototype=new mxGraphLayout,mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout,mxParallelEdgeLayout.prototype.spacing=20,mxParallelEdgeLayout.prototype.checkOverlap=!1,mxParallelEdgeLayout.prototype.execute=function(t,e){var n=this.findParallels(t,e);this.graph.model.beginUpdate();try{for(var i in n){var l=n[i];1<l.length&&this.layout(l)}}finally{this.graph.model.endUpdate()}},mxParallelEdgeLayout.prototype.findParallels=function(t,e){var n=[],i=mxUtils.bind(this,function(t){var e;this.isEdgeIgnored(t)||null!=(e=this.getEdgeId(t))&&(null==n[e]&&(n[e]=[]),n[e].push(t))});if(null!=e)for(var l=0;l<e.length;l++)i(e[l]);else for(var s=this.graph.getModel(),o=s.getChildCount(t),l=0;l<o;l++)i(s.getChildAt(t,l));return n},mxParallelEdgeLayout.prototype.getEdgeId=function(t){var e=this.graph.getView(),n=e.getVisibleTerminal(t,!0),i=e.getVisibleTerminal(t,!1),e="";if(null==n||null==i)return null;if(n=mxObjectIdentity.get(n),i=mxObjectIdentity.get(i),this.checkOverlap){var l=this.graph.view.getState(t);if(null!=l&&null!=l.absolutePoints){for(var s=[],o=0;o<l.absolutePoints.length;o++){var r=l.absolutePoints[o];null!=r&&s.push(r.x,r.y)}e=s.join(",")}}return(i<n?i+"-"+n:n+"-"+i)+e},mxParallelEdgeLayout.prototype.layout=function(t){var e=t[0],n=this.graph.getView(),i=this.graph.getModel(),l=i.getGeometry(n.getVisibleTerminal(e,!0)),s=i.getGeometry(n.getVisibleTerminal(e,!1));if(l==s)for(var o=l.x+l.width+this.spacing,r=l.y+l.height/2,a=0;a<t.length;a++)this.route(t[a],o,r),o+=this.spacing;else if(null!=l&&null!=s){i=l.x+l.width/2,n=l.y+l.height/2,e=s.x+s.width/2-i,l=s.y+s.height/2-n,s=Math.sqrt(e*e+l*l);if(0<s){var o=i+e/2,r=n+l/2,h=l*this.spacing/s,d=e*this.spacing/s;o+=h*(t.length-1)/2,r-=d*(t.length-1)/2;for(a=0;a<t.length;a++)this.route(t[a],o,r),o-=h,r+=d}}},mxParallelEdgeLayout.prototype.route=function(t,e,n){this.graph.isCellMovable(t)&&this.setEdgePoints(t,[new mxPoint(e,n)])},mxCompositeLayout.prototype=new mxGraphLayout,mxCompositeLayout.prototype.constructor=mxCompositeLayout,mxCompositeLayout.prototype.layouts=null,mxCompositeLayout.prototype.master=null,mxCompositeLayout.prototype.moveCell=function(t,e,n){null!=this.master?this.master.moveCell.apply(this.master,arguments):this.layouts[0].moveCell.apply(this.layouts[0],arguments)},mxCompositeLayout.prototype.execute=function(t){var e=this.graph.getModel();e.beginUpdate();try{for(var n=0;n<this.layouts.length;n++)this.layouts[n].execute.apply(this.layouts[n],arguments)}finally{e.endUpdate()}},mxEdgeLabelLayout.prototype=new mxGraphLayout,mxEdgeLabelLayout.prototype.constructor=mxEdgeLabelLayout,mxEdgeLabelLayout.prototype.execute=function(t){for(var e=this.graph.view,n=this.graph.getModel(),i=[],l=[],s=n.getChildCount(t),o=0;o<s;o++){var r=n.getChildAt(t,o),a=e.getState(r);null!=a&&(this.isVertexIgnored(r)?this.isEdgeIgnored(r)||i.push(a):l.push(a))}this.placeLabels(l,i)},mxEdgeLabelLayout.prototype.placeLabels=function(t,e){var n=this.graph.getModel();n.beginUpdate();try{for(var i=0;i<e.length;i++){var l=e[i];if(null!=l&&null!=l.text&&null!=l.text.boundingBox)for(var s=0;s<t.length;s++){var o=t[s];null!=o&&this.avoid(l,o)}}}finally{n.endUpdate()}},mxEdgeLabelLayout.prototype.avoid=function(t,e){var n,i,l=this.graph.getModel(),s=t.text.boundingBox;mxUtils.intersects(s,e)&&(n=-s.y-s.height+e.y,i=-s.y+e.y+e.height,n=Math.abs(n)<Math.abs(i)?n:i,i=-s.x-s.width+e.x,e=-s.x+e.x+e.width,i=Math.abs(i)<Math.abs(e)?i:e,Math.abs(i)<Math.abs(n)?n=0:i=0,null!=(e=l.getGeometry(t.cell))&&(null!=(e=e.clone()).offset?(e.offset.x+=i,e.offset.y+=n):e.offset=new mxPoint(i,n),l.setGeometry(t.cell,e)))},mxGraphAbstractHierarchyCell.prototype.maxRank=-1,mxGraphAbstractHierarchyCell.prototype.minRank=-1,mxGraphAbstractHierarchyCell.prototype.x=null,mxGraphAbstractHierarchyCell.prototype.y=null,mxGraphAbstractHierarchyCell.prototype.width=0,mxGraphAbstractHierarchyCell.prototype.height=0,mxGraphAbstractHierarchyCell.prototype.nextLayerConnectedCells=null,mxGraphAbstractHierarchyCell.prototype.previousLayerConnectedCells=null,mxGraphAbstractHierarchyCell.prototype.temp=null,mxGraphAbstractHierarchyCell.prototype.getNextLayerConnectedCells=function(t){return null},mxGraphAbstractHierarchyCell.prototype.getPreviousLayerConnectedCells=function(t){return null},mxGraphAbstractHierarchyCell.prototype.isEdge=function(){return!1},mxGraphAbstractHierarchyCell.prototype.isVertex=function(){return!1},mxGraphAbstractHierarchyCell.prototype.getGeneralPurposeVariable=function(t){return null},mxGraphAbstractHierarchyCell.prototype.setGeneralPurposeVariable=function(t,e){return null},mxGraphAbstractHierarchyCell.prototype.setX=function(t,e){this.isVertex()?this.x[0]=e:this.isEdge()&&(this.x[t-this.minRank-1]=e)},mxGraphAbstractHierarchyCell.prototype.getX=function(t){return this.isVertex()?this.x[0]:this.isEdge()?this.x[t-this.minRank-1]:0},mxGraphAbstractHierarchyCell.prototype.setY=function(t,e){this.isVertex()?this.y[0]=e:this.isEdge()&&(this.y[t-this.minRank-1]=e)},mxGraphHierarchyNode.prototype=new mxGraphAbstractHierarchyCell,mxGraphHierarchyNode.prototype.constructor=mxGraphHierarchyNode,mxGraphHierarchyNode.prototype.cell=null,mxGraphHierarchyNode.prototype.id=null,mxGraphHierarchyNode.prototype.connectsAsTarget=null,mxGraphHierarchyNode.prototype.connectsAsSource=null,mxGraphHierarchyNode.prototype.hashCode=!1,mxGraphHierarchyNode.prototype.getRankValue=function(t){return this.maxRank},mxGraphHierarchyNode.prototype.getNextLayerConnectedCells=function(t){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[],this.nextLayerConnectedCells[0]=[];for(var e=0;e<this.connectsAsTarget.length;e++){var n=this.connectsAsTarget[e];-1==n.maxRank||n.maxRank==t+1?this.nextLayerConnectedCells[0].push(n.source):this.nextLayerConnectedCells[0].push(n)}}return this.nextLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.getPreviousLayerConnectedCells=function(t){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[],this.previousLayerConnectedCells[0]=[];for(var e=0;e<this.connectsAsSource.length;e++){var n=this.connectsAsSource[e];-1==n.minRank||n.minRank==t-1?this.previousLayerConnectedCells[0].push(n.target):this.previousLayerConnectedCells[0].push(n)}}return this.previousLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.isVertex=function(){return!0},mxGraphHierarchyNode.prototype.getGeneralPurposeVariable=function(t){return this.temp[0]},mxGraphHierarchyNode.prototype.setGeneralPurposeVariable=function(t,e){this.temp[0]=e},mxGraphHierarchyNode.prototype.isAncestor=function(t){if(null!=t&&null!=this.hashCode&&null!=t.hashCode&&this.hashCode.length<t.hashCode.length){if(this.hashCode==t.hashCode)return!0;if(null==this.hashCode||null==this.hashCode)return!1;for(var e=0;e<this.hashCode.length;e++)if(this.hashCode[e]!=t.hashCode[e])return!1;return!0}return!1},mxGraphHierarchyNode.prototype.getCoreCell=function(){return this.cell},mxGraphHierarchyEdge.prototype=new mxGraphAbstractHierarchyCell,mxGraphHierarchyEdge.prototype.constructor=mxGraphHierarchyEdge,mxGraphHierarchyEdge.prototype.edges=null,mxGraphHierarchyEdge.prototype.ids=null,mxGraphHierarchyEdge.prototype.source=null,mxGraphHierarchyEdge.prototype.target=null,mxGraphHierarchyEdge.prototype.isReversed=!1,mxGraphHierarchyEdge.prototype.invert=function(t){var e=this.source;this.source=this.target,this.target=e,this.isReversed=!this.isReversed},mxGraphHierarchyEdge.prototype.getNextLayerConnectedCells=function(t){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[];for(var e=0;e<this.temp.length;e++)this.nextLayerConnectedCells[e]=[],e==this.temp.length-1?this.nextLayerConnectedCells[e].push(this.source):this.nextLayerConnectedCells[e].push(this)}return this.nextLayerConnectedCells[t-this.minRank-1]},mxGraphHierarchyEdge.prototype.getPreviousLayerConnectedCells=function(t){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[];for(var e=0;e<this.temp.length;e++)this.previousLayerConnectedCells[e]=[],0==e?this.previousLayerConnectedCells[e].push(this.target):this.previousLayerConnectedCells[e].push(this)}return this.previousLayerConnectedCells[t-this.minRank-1]},mxGraphHierarchyEdge.prototype.isEdge=function(){return!0},mxGraphHierarchyEdge.prototype.getGeneralPurposeVariable=function(t){return this.temp[t-this.minRank-1]},mxGraphHierarchyEdge.prototype.setGeneralPurposeVariable=function(t,e){this.temp[t-this.minRank-1]=e},mxGraphHierarchyEdge.prototype.getCoreCell=function(){return null!=this.edges&&0<this.edges.length?this.edges[0]:null},mxGraphHierarchyModel.prototype.maxRank=null,mxGraphHierarchyModel.prototype.vertexMapper=null,mxGraphHierarchyModel.prototype.edgeMapper=null,mxGraphHierarchyModel.prototype.ranks=null,mxGraphHierarchyModel.prototype.roots=null,mxGraphHierarchyModel.prototype.parent=null,mxGraphHierarchyModel.prototype.dfsCount=0,mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1e8,mxGraphHierarchyModel.prototype.tightenToSource=!1,mxGraphHierarchyModel.prototype.createInternalCells=function(t,e,n){for(var i=t.getGraph(),l=0;l<e.length;l++){n[l]=new mxGraphHierarchyNode(e[l]),this.vertexMapper.put(e[l],n[l]);var s=t.getEdges(e[l]);n[l].connectsAsSource=[];for(var o=0;o<s.length;o++){var r=t.getVisibleTerminal(s[o],!1);if(r!=e[l]&&t.graph.model.isVertex(r)&&!t.isVertexIgnored(r)){var a=t.getEdgesBetween(e[l],r,!1),r=t.getEdgesBetween(e[l],r,!0);if(null!=a&&0<a.length&&null==this.edgeMapper.get(a[0])&&2*r.length>=a.length){for(var h=new mxGraphHierarchyEdge(a),d=0;d<a.length;d++){var u=a[d];this.edgeMapper.put(u,h),i.resetEdge(u),t.disableEdgeStyle&&(t.setEdgeStyleEnabled(u,!1),t.setOrthogonalEdge(u,!0))}h.source=n[l],mxUtils.indexOf(n[l].connectsAsSource,h)<0&&n[l].connectsAsSource.push(h)}}}n[l].temp[0]=0}},mxGraphHierarchyModel.prototype.initialRank=function(){var t=[];if(null!=this.roots)for(var e=0;e<this.roots.length;e++)null!=(h=this.vertexMapper.get(this.roots[e]))&&t.push(h);for(var n=this.vertexMapper.getValues(),e=0;e<n.length;e++)n[e].temp[0]=-1;for(var i,l=t.slice();0<t.length;){u=(h=t[0]).connectsAsTarget,i=h.connectsAsSource;for(var s=!0,o=this.SOURCESCANSTARTRANK,e=0;e<u.length;e++){if(5270620!=(m=u[e]).temp[0]){s=!1;break}var r=m.source,o=Math.min(o,r.temp[0]-1)}if(s){if(h.temp[0]=o,this.maxRank=Math.min(this.maxRank,o),null!=i)for(e=0;e<i.length;e++)(m=i[e]).temp[0]=5270620,-1==(r=m.target).temp[0]&&(t.push(r),r.temp[0]=-2);t.shift()}else{var a=t.shift();if(t.push(h),a==h&&1==t.length)break}}for(e=0;e<n.length;e++)n[e].temp[0]-=this.maxRank;for(e=0;e<l.length;e++)for(var h,d=0,u=(h=l[e]).connectsAsSource,p=0;p<u.length;p++){var m,r=(m=u[p]).target;h.temp[0]=Math.max(d,r.temp[0]+1),d=h.temp[0]}this.maxRank=this.SOURCESCANSTARTRANK-this.maxRank},mxGraphHierarchyModel.prototype.fixRanks=function(){var o=[];this.ranks=[];for(var t=0;t<this.maxRank+1;t++)o[t]=[],this.ranks[t]=o[t];var e=null;if(null!=this.roots)for(var n=this.roots,e=[],t=0;t<n.length;t++){var i=n[t],i=this.vertexMapper.get(i);e[t]=i}this.visit(function(t,e,n,i,l){if((0==l&&e.maxRank<0&&e.minRank<0&&(o[e.temp[0]].push(e),e.maxRank=e.temp[0],e.minRank=e.temp[0],e.temp[0]=o[e.maxRank].length-1),null!=t&&null!=n)&&1<t.maxRank-e.maxRank){n.maxRank=t.maxRank,n.minRank=e.maxRank,n.temp=[],n.x=[],n.y=[];for(var s=n.minRank+1;s<n.maxRank;s++)o[s].push(n),n.setGeneralPurposeVariable(s,o[s].length-1)}},e,!1,null)},mxGraphHierarchyModel.prototype.visit=function(t,e,n,i){if(null!=e){for(var l=0;l<e.length;l++){var s=e[l];null!=s&&(null==i&&(i=new Object),n?(s.hashCode=[],s.hashCode[0]=this.dfsCount,s.hashCode[1]=l,this.extendedDfs(null,s,null,t,i,s.hashCode,l,0)):this.dfs(null,s,null,t,i,0))}this.dfsCount++}},mxGraphHierarchyModel.prototype.dfs=function(t,e,n,i,l,s){if(null!=e){var o=e.id;if(null==l[o]){i(t,l[o]=e,n,s,0);for(var r=e.connectsAsSource.slice(),a=0;a<r.length;a++){var h=r[a],d=h.target;this.dfs(e,d,h,i,l,s+1)}}else i(t,e,n,s,1)}},mxGraphHierarchyModel.prototype.extendedDfs=function(t,e,n,i,l,s,o,r){if(null!=e){var a;null!=t&&(null!=e.hashCode&&e.hashCode[0]==t.hashCode[0]||(a=t.hashCode.length+1,e.hashCode=t.hashCode.slice(),e.hashCode[a-1]=o));o=e.id;if(null==l[o]){i(t,l[o]=e,n,r,0);for(var h=e.connectsAsSource.slice(),d=0;d<h.length;d++){var u=h[d],p=u.target;this.extendedDfs(e,p,u,i,l,e.hashCode,d,r+1)}}else i(t,e,n,r,1)}},mxSwimlaneModel.prototype.maxRank=null,mxSwimlaneModel.prototype.vertexMapper=null,mxSwimlaneModel.prototype.edgeMapper=null,mxSwimlaneModel.prototype.ranks=null,mxSwimlaneModel.prototype.roots=null,mxSwimlaneModel.prototype.parent=null,mxSwimlaneModel.prototype.dfsCount=0,mxSwimlaneModel.prototype.SOURCESCANSTARTRANK=1e8,mxSwimlaneModel.prototype.tightenToSource=!1,mxSwimlaneModel.prototype.ranksPerGroup=null,mxSwimlaneModel.prototype.createInternalCells=function(t,e,n){for(var i=t.getGraph(),l=t.swimlanes,s=0;s<e.length;s++){n[s]=new mxGraphHierarchyNode(e[s]),this.vertexMapper.put(e[s],n[s]),n[s].swimlaneIndex=-1;for(var o=0;o<l.length;o++)if(i.model.getParent(e[s])==l[o]){n[s].swimlaneIndex=o;break}var r=t.getEdges(e[s]);n[s].connectsAsSource=[];for(var a=0;a<r.length;a++){var h=t.getVisibleTerminal(r[a],!1);if(h!=e[s]&&t.graph.model.isVertex(h)&&!t.isVertexIgnored(h)){var d=t.getEdgesBetween(e[s],h,!1),h=t.getEdgesBetween(e[s],h,!0);if(null!=d&&0<d.length&&null==this.edgeMapper.get(d[0])&&2*h.length>=d.length){for(var u=new mxGraphHierarchyEdge(d),p=0;p<d.length;p++){var m=d[p];this.edgeMapper.put(m,u),i.resetEdge(m),t.disableEdgeStyle&&(t.setEdgeStyleEnabled(m,!1),t.setOrthogonalEdge(m,!0))}u.source=n[s],mxUtils.indexOf(n[s].connectsAsSource,u)<0&&n[s].connectsAsSource.push(u)}}}n[s].temp[0]=0}},mxSwimlaneModel.prototype.initialRank=function(){this.ranksPerGroup=[];var t=[],e=new Object;if(null!=this.roots)for(var n=0;n<this.roots.length;n++){var i=this.vertexMapper.get(this.roots[n]);this.maxChainDfs(null,i,null,e,0),null!=i&&t.push(i)}for(var l=[],s=[],n=this.ranksPerGroup.length-1;0<=n;n--)n==this.ranksPerGroup.length-1?l[n]=0:l[n]=s[n+1]+1,s[n]=l[n]+this.ranksPerGroup[n];this.maxRank=s[0];for(var o=this.vertexMapper.getValues(),n=0;n<o.length;n++)o[n].temp[0]=-1;for(t.slice();0<t.length;){for(var r=(i=t[0]).connectsAsTarget,a=i.connectsAsSource,h=!0,d=s[0],n=0;n<r.length;n++){if(5270620!=(p=r[n]).temp[0]){h=!1;break}var u=p.source,d=Math.min(d,u.temp[0]-1)}if(h){if(d>s[i.swimlaneIndex]&&(d=s[i.swimlaneIndex]),i.temp[0]=d,null!=a)for(var p,n=0;n<a.length;n++)(p=a[n]).temp[0]=5270620,-1==(u=p.target).temp[0]&&(t.push(u),u.temp[0]=-2);t.shift()}else{var m=t.shift();if(t.push(i),m==i&&1==t.length)break}}},mxSwimlaneModel.prototype.maxChainDfs=function(t,e,n,i,l){if(null!=e){var s=mxCellPath.create(e.cell);if(null==i[s]){s=(i[s]=e).swimlaneIndex;(null==this.ranksPerGroup[s]||this.ranksPerGroup[s]<l)&&(this.ranksPerGroup[s]=l);for(var o=e.connectsAsSource.slice(),r=0;r<o.length;r++){var a=o[r],h=a.target;e.swimlaneIndex<h.swimlaneIndex?this.maxChainDfs(e,h,a,mxUtils.clone(i,null,!0),0):e.swimlaneIndex==h.swimlaneIndex&&this.maxChainDfs(e,h,a,mxUtils.clone(i,null,!0),l+1)}}}},mxSwimlaneModel.prototype.fixRanks=function(){var o=[];this.ranks=[];for(var t=0;t<this.maxRank+1;t++)o[t]=[],this.ranks[t]=o[t];var e=null;if(null!=this.roots)for(var n=this.roots,e=[],t=0;t<n.length;t++){var i=n[t],i=this.vertexMapper.get(i);e[t]=i}this.visit(function(t,e,n,i,l){if((0==l&&e.maxRank<0&&e.minRank<0&&(o[e.temp[0]].push(e),e.maxRank=e.temp[0],e.minRank=e.temp[0],e.temp[0]=o[e.maxRank].length-1),null!=t&&null!=n)&&1<t.maxRank-e.maxRank){n.maxRank=t.maxRank,n.minRank=e.maxRank,n.temp=[],n.x=[],n.y=[];for(var s=n.minRank+1;s<n.maxRank;s++)o[s].push(n),n.setGeneralPurposeVariable(s,o[s].length-1)}},e,!1,null)},mxSwimlaneModel.prototype.visit=function(t,e,n,i){if(null!=e){for(var l=0;l<e.length;l++){var s=e[l];null!=s&&(null==i&&(i=new Object),n?(s.hashCode=[],s.hashCode[0]=this.dfsCount,s.hashCode[1]=l,this.extendedDfs(null,s,null,t,i,s.hashCode,l,0)):this.dfs(null,s,null,t,i,0))}this.dfsCount++}},mxSwimlaneModel.prototype.dfs=function(t,e,n,i,l,s){if(null!=e){var o=e.id;if(null==l[o]){i(t,l[o]=e,n,s,0);for(var r=e.connectsAsSource.slice(),a=0;a<r.length;a++){var h=r[a],d=h.target;this.dfs(e,d,h,i,l,s+1)}}else i(t,e,n,s,1)}},mxSwimlaneModel.prototype.extendedDfs=function(t,e,n,i,l,s,o,r){if(null!=e){var a;null!=t&&(null!=e.hashCode&&e.hashCode[0]==t.hashCode[0]||(a=t.hashCode.length+1,e.hashCode=t.hashCode.slice(),e.hashCode[a-1]=o));o=e.id;if(null==l[o]){i(t,l[o]=e,n,r,0);for(var h=e.connectsAsSource.slice(),d=e.connectsAsTarget.slice(),u=0;u<h.length;u++){var p=(m=h[u]).target;e.swimlaneIndex<=p.swimlaneIndex&&this.extendedDfs(e,p,m,i,l,e.hashCode,u,r+1)}for(u=0;u<d.length;u++){var m,p=(m=d[u]).source;e.swimlaneIndex<p.swimlaneIndex&&this.extendedDfs(e,p,m,i,l,e.hashCode,u,r+1)}}else i(t,e,n,r,1)}},mxHierarchicalLayoutStage.prototype.execute=function(t){},mxMedianHybridCrossingReduction.prototype=new mxHierarchicalLayoutStage,mxMedianHybridCrossingReduction.prototype.constructor=mxMedianHybridCrossingReduction,mxMedianHybridCrossingReduction.prototype.layout=null,mxMedianHybridCrossingReduction.prototype.maxIterations=24,mxMedianHybridCrossingReduction.prototype.nestedBestRanks=null,mxMedianHybridCrossingReduction.prototype.currentBestCrossings=0,mxMedianHybridCrossingReduction.prototype.iterationsWithoutImprovement=0,mxMedianHybridCrossingReduction.prototype.maxNoImprovementIterations=2,mxMedianHybridCrossingReduction.prototype.execute=function(t){var e=this.layout.getModel();this.nestedBestRanks=[];for(var n=0;n<e.ranks.length;n++)this.nestedBestRanks[n]=e.ranks[n].slice();for(var i=0,l=this.calculateCrossings(e),n=0;n<this.maxIterations&&i<this.maxNoImprovementIterations;n++){this.weightedMedian(n,e),this.transpose(n,e);var s=this.calculateCrossings(e);if(s<l){l=s;for(var o=i=0;o<this.nestedBestRanks.length;o++)for(var r=e.ranks[o],a=0;a<r.length;a++){var h=r[a];this.nestedBestRanks[o][h.getGeneralPurposeVariable(o)]=h}}else{i++;for(o=0;o<this.nestedBestRanks.length;o++)for(r=e.ranks[o],a=0;a<r.length;a++)(h=r[a]).setGeneralPurposeVariable(o,a)}if(0==l)break}for(var d=[],u=[],n=0;n<e.maxRank+1;n++)u[n]=[],d[n]=u[n];for(n=0;n<this.nestedBestRanks.length;n++)for(o=0;o<this.nestedBestRanks[n].length;o++)u[n].push(this.nestedBestRanks[n][o]);e.ranks=d},mxMedianHybridCrossingReduction.prototype.calculateCrossings=function(t){for(var e=t.ranks.length,n=0,i=1;i<e;i++)n+=this.calculateRankCrossing(i,t);return n},mxMedianHybridCrossingReduction.prototype.calculateRankCrossing=function(t,e){for(var n=0,i=e.ranks[t],l=e.ranks[t-1],s=[],o=0;o<i.length;o++){for(var r=i[o],a=r.getGeneralPurposeVariable(t),h=r.getPreviousLayerConnectedCells(t),d=[],u=0;u<h.length;u++){var p=h[u].getGeneralPurposeVariable(t-1);d.push(p)}d.sort(function(t,e){return t-e}),s[a]=d}for(var m=[],o=0;o<s.length;o++)m=m.concat(s[o]);for(var c=1;c<l.length;)c<<=1;var g=2*c-1;--c;for(var x=[],o=0;o<g;++o)x[o]=0;for(o=0;o<m.length;o++){var y=m[o]+c;for(++x[y];0<y;)y%2&&(n+=x[y+1]),++x[y=y-1>>1]}return n},mxMedianHybridCrossingReduction.prototype.transpose=function(t,e){for(var n=!0,i=0;n&&i++<10;)for(var l=t%2==1&&i%2==1,n=!1,s=0;s<e.ranks.length;s++){for(var o=e.ranks[s],r=[],a=0;a<o.length;a++){var h=o[a],d=h.getGeneralPurposeVariable(s);d<0&&(d=a),r[d]=h}for(var u=null,p=null,m=null,c=null,g=null,x=null,y=null,f=null,C=null,v=null,a=0;a<o.length-1;a++){if(0==a){u=(C=r[a]).getNextLayerConnectedCells(s),p=C.getPreviousLayerConnectedCells(s),g=[],x=[];for(var E=0;E<u.length;E++)g[E]=u[E].getGeneralPurposeVariable(s+1);for(E=0;E<p.length;E++)x[E]=p[E].getGeneralPurposeVariable(s-1)}else u=m,p=c,g=y,x=f,C=v;m=(v=r[a+1]).getNextLayerConnectedCells(s),c=v.getPreviousLayerConnectedCells(s),y=[],f=[];for(E=0;E<m.length;E++)y[E]=m[E].getGeneralPurposeVariable(s+1);for(E=0;E<c.length;E++)f[E]=c[E].getGeneralPurposeVariable(s-1);for(var S=0,w=0,E=0;E<g.length;E++)for(var b=0;b<y.length;b++)g[E]>y[b]&&S++,g[E]<y[b]&&w++;for(var T,E=0;E<x.length;E++)for(b=0;b<f.length;b++)x[E]>f[b]&&S++,x[E]<f[b]&&w++;(w<S||w==S&&l)&&(T=C.getGeneralPurposeVariable(s),C.setGeneralPurposeVariable(s,v.getGeneralPurposeVariable(s)),v.setGeneralPurposeVariable(s,T),m=u,c=p,y=g,f=x,v=C,l||(n=!0))}}},mxMedianHybridCrossingReduction.prototype.weightedMedian=function(t,e){var n=t%2==0;if(n)for(var i=e.maxRank-1;0<=i;i--)this.medianRank(i,n);else for(i=1;i<e.maxRank;i++)this.medianRank(i,n)},mxMedianHybridCrossingReduction.prototype.medianRank=function(t,e){for(var n=this.nestedBestRanks[t].length,i=[],l=[],s=0;s<n;s++){var o,r,a=this.nestedBestRanks[t][s],h=new MedianCellSorter;h.cell=a,r=e?t+1:t-1,null!=(o=e?a.getNextLayerConnectedCells(t):a.getPreviousLayerConnectedCells(t))&&0!=o.length?(h.medianValue=this.medianValue(o,r),i.push(h)):l[a.getGeneralPurposeVariable(t)]=!0}i.sort(MedianCellSorter.prototype.compare);for(s=0;s<n;s++)null==l[s]&&(a=i.shift().cell).setGeneralPurposeVariable(t,s)},mxMedianHybridCrossingReduction.prototype.medianValue=function(t,e){for(var n=[],i=0,l=0;l<t.length;l++){var s=t[l];n[i++]=s.getGeneralPurposeVariable(e)}if(n.sort(function(t,e){return t-e}),i%2==1)return n[Math.floor(i/2)];if(2==i)return(n[0]+n[1])/2;var o=i/2,r=n[o-1]-n[0],a=n[i-1]-n[o];return(n[o-1]*a+n[o]*r)/(r+a)},MedianCellSorter.prototype.medianValue=0,MedianCellSorter.prototype.cell=!1,MedianCellSorter.prototype.compare=function(t,e){return null!=t&&null!=e?e.medianValue>t.medianValue?-1:e.medianValue<t.medianValue?1:0:0},mxMinimumCycleRemover.prototype=new mxHierarchicalLayoutStage,mxMinimumCycleRemover.prototype.constructor=mxMinimumCycleRemover,mxMinimumCycleRemover.prototype.layout=null,mxMinimumCycleRemover.prototype.execute=function(t){for(var e=this.layout.getModel(),s=new Object,n=e.vertexMapper.getValues(),o=new Object,i=0;i<n.length;i++)o[n[i].id]=n[i];var l=null;if(null!=e.roots)for(var r=e.roots,l=[],i=0;i<r.length;i++)l[i]=e.vertexMapper.get(r[i]);e.visit(function(t,e,n,i,l){e.isAncestor(t)&&(n.invert(),mxUtils.remove(n,t.connectsAsSource),t.connectsAsTarget.push(n),mxUtils.remove(n,e.connectsAsTarget),e.connectsAsSource.push(n)),s[e.id]=e,delete o[e.id]},l,!0,null);var a=mxUtils.clone(s,null,!0);e.visit(function(t,e,n,i,l){e.isAncestor(t)&&(n.invert(),mxUtils.remove(n,t.connectsAsSource),e.connectsAsSource.push(n),t.connectsAsTarget.push(n),mxUtils.remove(n,e.connectsAsTarget)),s[e.id]=e,delete o[e.id]},o,!0,a)},mxCoordinateAssignment.prototype=new mxHierarchicalLayoutStage,mxCoordinateAssignment.prototype.constructor=mxCoordinateAssignment,mxCoordinateAssignment.prototype.layout=null,mxCoordinateAssignment.prototype.intraCellSpacing=30,mxCoordinateAssignment.prototype.interRankCellSpacing=100,mxCoordinateAssignment.prototype.parallelEdgeSpacing=10,mxCoordinateAssignment.prototype.maxIterations=8,mxCoordinateAssignment.prototype.prefHozEdgeSep=5,mxCoordinateAssignment.prototype.prefVertEdgeOff=2,mxCoordinateAssignment.prototype.minEdgeJetty=12,mxCoordinateAssignment.prototype.channelBuffer=4,mxCoordinateAssignment.prototype.jettyPositions=null,mxCoordinateAssignment.prototype.orientation=mxConstants.DIRECTION_NORTH,mxCoordinateAssignment.prototype.initialX=null,mxCoordinateAssignment.prototype.limitX=null,mxCoordinateAssignment.prototype.currentXDelta=null,mxCoordinateAssignment.prototype.widestRank=null,mxCoordinateAssignment.prototype.rankTopY=null,mxCoordinateAssignment.prototype.rankBottomY=null,mxCoordinateAssignment.prototype.widestRankValue=null,mxCoordinateAssignment.prototype.rankWidths=null,mxCoordinateAssignment.prototype.rankY=null,mxCoordinateAssignment.prototype.fineTuning=!0,mxCoordinateAssignment.prototype.nextLayerConnectedCache=null,mxCoordinateAssignment.prototype.previousLayerConnectedCache=null,mxCoordinateAssignment.prototype.groupPadding=10,mxCoordinateAssignment.prototype.printStatus=function(){var t=this.layout.getModel();mxLog.show(),mxLog.writeln("======Coord assignment debug=======");for(var e=0;e<t.ranks.length;e++){mxLog.write("Rank ",e," : ");for(var n=t.ranks[e],i=0;i<n.length;i++){var l=n[i];mxLog.write(l.getGeneralPurposeVariable(e)," ")}mxLog.writeln()}mxLog.writeln("====================================")},mxCoordinateAssignment.prototype.execute=function(t){this.jettyPositions=Object();var e=this.layout.getModel();this.currentXDelta=0,this.initialCoords(this.layout.getGraph(),e),this.fineTuning&&this.minNode(e);var n=1e8;if(this.fineTuning)for(var i=0;i<this.maxIterations;i++){if(0!=i&&(this.medianPos(i,e),this.minNode(e)),this.currentXDelta<n){for(var l=0;l<e.ranks.length;l++)for(var s=e.ranks[l],o=0;o<s.length;o++)(r=s[o]).setX(l,r.getGeneralPurposeVariable(l));n=this.currentXDelta}else for(l=0;l<e.ranks.length;l++)for(var r,s=e.ranks[l],o=0;o<s.length;o++)(r=s[o]).setGeneralPurposeVariable(l,r.getX(l));this.minPath(this.layout.getGraph(),e),this.currentXDelta=0}this.setCellLocations(this.layout.getGraph(),e)},mxCoordinateAssignment.prototype.minNode=function(t){for(var e=[],n=new mxDictionary,i=[],l=0;l<=t.maxRank;l++){i[l]=t.ranks[l];for(var s=0;s<i[l].length;s++){var o=i[l][s],r=new WeightedCellSorter(o,l);r.rankIndex=s,r.visited=!0,e.push(r),n.put(o,r)}}for(var a=10*e.length,h=0;0<e.length&&h<=a;){var d=e.shift(),u=d.cell,p=d.weightedValue,m=parseInt(d.rankIndex),c=u.getNextLayerConnectedCells(p),g=u.getPreviousLayerConnectedCells(p),x=c.length,y=g.length,f=this.medianXValue(c,p+1),C=this.medianXValue(g,p-1),v=x+y,E=u.getGeneralPurposeVariable(p),S=E;0<v&&(S=(f*x+C*y)/v);var w,b,y=!1;if(S<E-1?0==m||(w=(w=(v=i[p][m-1]).getGeneralPurposeVariable(p))+v.width/2+this.intraCellSpacing+u.width/2)<S?(u.setGeneralPurposeVariable(p,S),y=!0):w<u.getGeneralPurposeVariable(p)-1&&(u.setGeneralPurposeVariable(p,w),y=!0):E+1<S&&(m==i[p].length-1||S<(b=(b=(m=i[p][m+1]).getGeneralPurposeVariable(p))-m.width/2-this.intraCellSpacing-u.width/2)?(u.setGeneralPurposeVariable(p,S),y=!0):b>u.getGeneralPurposeVariable(p)+1&&(u.setGeneralPurposeVariable(p,b),y=!0)),y){for(l=0;l<c.length;l++){var T=c[l];null!=(A=n.get(T))&&0==A.visited&&(A.visited=!0,e.push(A))}for(l=0;l<g.length;l++){var A,T=g[l];null!=(A=n.get(T))&&0==A.visited&&(A.visited=!0,e.push(A))}}d.visited=!1,h++}},mxCoordinateAssignment.prototype.medianPos=function(t,e){if(t%2==0)for(var n=e.maxRank;0<n;n--)this.rankMedianPosition(n-1,e,n);else for(n=0;n<e.maxRank-1;n++)this.rankMedianPosition(n+1,e,n)},mxCoordinateAssignment.prototype.rankMedianPosition=function(t,e,n){for(var i=e.ranks[t],l=[],s=new Object,o=0;o<i.length;o++){var r=i[o];l[o]=new WeightedCellSorter,l[o].cell=r,l[o].rankIndex=o,s[r.id]=l[o];var a=null;a=n<t?r.getPreviousLayerConnectedCells(t):r.getNextLayerConnectedCells(t),l[o].weightedValue=this.calculatedWeightedValue(r,a)}l.sort(WeightedCellSorter.prototype.compare);for(o=0;o<l.length;o++){var h=l[o].cell,a=null,d=0;null!=(a=(n<t?h.getPreviousLayerConnectedCells(t):h.getNextLayerConnectedCells(t)).slice())&&(d=0<a.length?this.medianXValue(a,n):h.getGeneralPurposeVariable(t));for(var u,p=0,m=-1e8,c=l[o].rankIndex-1;0<=c;)null!=(g=s[i[c].id])&&(u=g.cell,g.visited?(m=u.getGeneralPurposeVariable(t)+u.width/2+this.intraCellSpacing+p+h.width/2,c=-1):(p+=u.width+this.intraCellSpacing,c--));for(var g,x,y=0,f=1e8,c=l[o].rankIndex+1;c<l.length;)null!=(g=s[i[c].id])&&(x=g.cell,g.visited?(f=x.getGeneralPurposeVariable(t)-x.width/2-this.intraCellSpacing-y-h.width/2,c=l.length):(y+=x.width+this.intraCellSpacing,c++));m<=d&&d<=f?h.setGeneralPurposeVariable(t,d):d<m?(h.setGeneralPurposeVariable(t,m),this.currentXDelta+=m-d):f<d&&(h.setGeneralPurposeVariable(t,f),this.currentXDelta+=d-f),l[o].visited=!0}},mxCoordinateAssignment.prototype.calculatedWeightedValue=function(t,e){for(var n=0,i=0;i<e.length;i++){var l=e[i];t.isVertex()&&l.isVertex()?n++:t.isEdge()&&l.isEdge()?n+=8:n+=2}return n},mxCoordinateAssignment.prototype.medianXValue=function(t,e){if(0==t.length)return 0;for(var n=[],i=0;i<t.length;i++)n[i]=t[i].getGeneralPurposeVariable(e);if(n.sort(function(t,e){return t-e}),t.length%2==1)return n[Math.floor(t.length/2)];var l=t.length/2;return(n[l-1]+n[l])/2},mxCoordinateAssignment.prototype.initialCoords=function(t,e){this.calculateWidestRank(t,e);for(var n=this.widestRank;0<=n;n--)n<e.maxRank&&this.rankCoordinates(n,t,e);for(n=this.widestRank+1;n<=e.maxRank;n++)0<n&&this.rankCoordinates(n,t,e)},mxCoordinateAssignment.prototype.rankCoordinates=function(t,e,n){for(var i=n.ranks[t],l=0,s=this.initialX+(this.widestRankValue-this.rankWidths[t])/2,o=!1,r=0;r<i.length;r++){var a,h=i[r];h.isVertex()?(null!=(a=this.layout.getVertexBounds(h.cell))?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(h.width=a.width,h.height=a.height):(h.width=a.height,h.height=a.width):o=!0,l=Math.max(l,h.height)):h.isEdge()&&(a=1,null!=h.edges?a=h.edges.length:mxLog.warn("edge.edges is null"),h.width=(a-1)*this.parallelEdgeSpacing),s+=h.width/2,h.setX(t,s),h.setGeneralPurposeVariable(t,s),s+=h.width/2,s+=this.intraCellSpacing}1==o&&mxLog.warn("At least one cell has no bounds")},mxCoordinateAssignment.prototype.calculateWidestRank=function(t,e){var n=-this.interRankCellSpacing,i=0;this.rankWidths=[],this.rankY=[];for(var l=e.maxRank;0<=l;l--){for(var s=0,o=e.ranks[l],r=this.initialX,a=!1,h=0;h<o.length;h++){var d,u=o[h];u.isVertex()?(null!=(d=this.layout.getVertexBounds(u.cell))?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(u.width=d.width,u.height=d.height):(u.width=d.height,u.height=d.width):a=!0,s=Math.max(s,u.height)):u.isEdge()&&(d=1,null!=u.edges?d=u.edges.length:mxLog.warn("edge.edges is null"),u.width=(d-1)*this.parallelEdgeSpacing),r+=u.width/2,u.setX(l,r),u.setGeneralPurposeVariable(l,r),r+=u.width/2,(r+=this.intraCellSpacing)>this.widestRankValue&&(this.widestRankValue=r,this.widestRank=l),this.rankWidths[l]=r}1==a&&mxLog.warn("At least one cell has no bounds"),this.rankY[l]=n;var p=s/2+i/2+this.interRankCellSpacing,i=s;this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?n+=p:n-=p;for(h=0;h<o.length;h++)o[h].setY(l,n)}},mxCoordinateAssignment.prototype.minPath=function(t,e){for(var n=e.edgeMapper.getValues(),i=0;i<n.length;i++){var l=n[i];if(!(l.maxRank-l.minRank-1<1)){for(var s=l.getGeneralPurposeVariable(l.minRank+1),o=!0,r=0,a=l.minRank+2;a<l.maxRank;a++){var h=l.getGeneralPurposeVariable(a);s!=h?(o=!1,s=h):r++}if(!o){for(var d=0,u=0,p=[],m=[],c=l.getGeneralPurposeVariable(l.minRank+1),a=l.minRank+1;a<l.maxRank-1;a++)c==(g=l.getX(a+1))||this.repositionValid(e,l,a+1,c)?(p[a-l.minRank-1]=c,d++):c=p[a-l.minRank-1]=g;c=l.getX(a);for(var g,a=l.maxRank-1;a>l.minRank+1;a--)c==(g=l.getX(a-1))||this.repositionValid(e,l,a-1,c)?(m[a-l.minRank-2]=c,u++):(m[a-l.minRank-2]=l.getX(a-1),c=g);if(r<u||r<d)if(d<=u)for(a=l.maxRank-2;a>l.minRank;a--)l.setX(a,m[a-l.minRank-1]);else if(u<d)for(a=l.minRank+2;a<l.maxRank;a++)l.setX(a,p[a-l.minRank-2])}}}},mxCoordinateAssignment.prototype.repositionValid=function(t,e,n,i){for(var l=t.ranks[n],s=-1,o=0;o<l.length;o++)if(e==l[o]){s=o;break}if(s<0)return!1;var r=e.getGeneralPurposeVariable(n);if(i<r){if(0==s)return!0;t=l[s-1];return t.getGeneralPurposeVariable(n)+t.width/2+this.intraCellSpacing+e.width/2<=i}if(r<i){if(s==l.length-1)return!0;r=l[s+1];return i<=r.getGeneralPurposeVariable(n)-r.width/2-this.intraCellSpacing-e.width/2}return!0},mxCoordinateAssignment.prototype.setCellLocations=function(t,e){this.rankTopY=[],this.rankBottomY=[];for(var n=0;n<e.ranks.length;n++)this.rankTopY[n]=Number.MAX_VALUE,this.rankBottomY[n]=-Number.MAX_VALUE;for(var i=e.vertexMapper.getValues(),n=0;n<i.length;n++)this.setVertexLocation(i[n]);this.layout.edgeStyle!=mxHierarchicalEdgeStyle.ORTHOGONAL&&this.layout.edgeStyle!=mxHierarchicalEdgeStyle.POLYLINE&&this.layout.edgeStyle!=mxHierarchicalEdgeStyle.CURVE||this.localEdgeProcessing(e);for(var l=e.edgeMapper.getValues(),n=0;n<l.length;n++)this.setEdgePosition(l[n])},mxCoordinateAssignment.prototype.localEdgeProcessing=function(t){for(var e=0;e<t.ranks.length;e++)for(var n=t.ranks[e],i=0;i<n.length;i++){var l=n[i];if(l.isVertex())for(var s=l.getPreviousLayerConnectedCells(e),o=e-1,r=0;r<2;r++){if(-1<o&&o<t.ranks.length&&null!=s&&0<s.length){for(var a=[],h=0;h<s.length;h++){var d=new WeightedCellSorter(s[h],s[h].getX(o));a.push(d)}a.sort(WeightedCellSorter.prototype.compare);for(var u=l.x[0]-l.width/2,p=u+l.width,m=0,c=[],h=0;h<a.length;h++){var g,x=a[h].cell;if(x.isVertex()){g=0==r?l.connectsAsSource:l.connectsAsTarget;for(var y=0;y<g.length;y++)g[y].source!=x&&g[y].target!=x||(m+=g[y].edges.length,c.push(g[y]))}else m+=x.edges.length,c.push(x)}var f=(m+1)*this.prefHozEdgeSep;l.width>f+2*this.prefHozEdgeSep&&(u+=this.prefHozEdgeSep,p-=this.prefHozEdgeSep);for(var C=(p-u)/m,v=u+C/2,E=this.minEdgeJetty-this.prefVertEdgeOff,S=0,h=0;h<c.length;h++){var w=c[h].edges.length,b=this.jettyPositions[c[h].ids[0]];null==b&&(b=[],this.jettyPositions[c[h].ids[0]]=b),h<m/2?E+=this.prefVertEdgeOff:m/2<h&&(E-=this.prefVertEdgeOff);for(var T=0;T<w;T++)b[4*T+2*r]=v,v+=C,b[4*T+2*r+1]=E;S=Math.max(S,E)}}s=l.getNextLayerConnectedCells(e),o=e+1}}},mxCoordinateAssignment.prototype.setEdgePosition=function(t){var e=0;if(101207!=t.temp[0]){var n=t.maxRank,i=t.minRank;n==i&&(n=t.source.maxRank,i=t.target.minRank);for(var l=0,s=this.jettyPositions[t.ids[0]],o=(t.isReversed?t.target:t.source).cell,r=this.layout.graph,a=this.orientation==mxConstants.DIRECTION_EAST||this.orientation==mxConstants.DIRECTION_SOUTH,h=0;h<t.edges.length;h++){var d=t.edges[h],u=this.layout.getVisibleTerminal(d,!0),p=[],m=t.isReversed;u!=o&&(m=!m),null!=s&&(y=m?2:0,C=m?(a?this.rankBottomY:this.rankTopY)[i]:(a?this.rankTopY:this.rankBottomY)[n],f=s[4*l+1+y],m!=a&&(f=-f),C+=f,v=s[4*l+y],E=r.model.getTerminal(d,!0),this.layout.isPort(E)&&r.model.getParent(E)==u&&(v=null!=(S=r.view.getState(E))?S.x:u.geometry.x+t.source.width*E.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(p.push(new mxPoint(v,C)),this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&p.push(new mxPoint(v,C+f))):(p.push(new mxPoint(C,v)),this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&p.push(new mxPoint(C+f,v))));var u=t.x.length-1,c=-1,g=-1,x=t.maxRank-1;m&&(u=0,c=t.x.length,g=1,x=t.minRank+1);for(var y,f,C,v,E,S,w=u;t.maxRank!=t.minRank&&w!=c;w+=g){var b,T=t.x[w]+e,A=(this.rankTopY[x]+this.rankBottomY[x+1])/2,L=(this.rankTopY[x-1]+this.rankBottomY[x])/2;m&&(b=A,A=L,L=b),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(p.push(new mxPoint(T,A)),p.push(new mxPoint(T,L))):(p.push(new mxPoint(A,T)),p.push(new mxPoint(L,T))),this.limitX=Math.max(this.limitX,T),x+=g}null!=s&&(y=m?2:0,E=m?(a?this.rankTopY:this.rankBottomY)[n]:(a?this.rankBottomY:this.rankTopY)[i],f=s[4*l+3-y],m!=a&&(f=-f),C=E-f,v=s[4*l+2-y],u=r.model.getTerminal(d,!1),E=this.layout.getVisibleTerminal(d,!1),this.layout.isPort(u)&&r.model.getParent(u)==E&&(v=null!=(S=r.view.getState(u))?S.x:E.geometry.x+t.target.width*u.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&p.push(new mxPoint(v,C-f)),p.push(new mxPoint(v,C))):(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&p.push(new mxPoint(C-f,v)),p.push(new mxPoint(C,v)))),t.isReversed&&this.processReversedEdge(t,d),this.layout.setEdgePoints(d,p),e=0==e?this.parallelEdgeSpacing:0<e?-e:-e+this.parallelEdgeSpacing,l++}t.temp[0]=101207}},mxCoordinateAssignment.prototype.setVertexLocation=function(t){var e=t.cell,n=t.x[0]-t.width/2,i=t.y[0]-t.height/2;this.rankTopY[t.minRank]=Math.min(this.rankTopY[t.minRank],i),this.rankBottomY[t.minRank]=Math.max(this.rankBottomY[t.minRank],i+t.height),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(e,n,i):this.layout.setVertexLocation(e,i,n),this.limitX=Math.max(this.limitX,n+t.width)},mxCoordinateAssignment.prototype.processReversedEdge=function(t,e){},mxSwimlaneOrdering.prototype=new mxHierarchicalLayoutStage,mxSwimlaneOrdering.prototype.constructor=mxSwimlaneOrdering,mxSwimlaneOrdering.prototype.layout=null,mxSwimlaneOrdering.prototype.execute=function(t){var e=this.layout.getModel(),r=new Object,a=mxUtils.clone(e.vertexMapper,null,!0),n=null;if(null!=e.roots)for(var i=e.roots,n=[],l=0;l<i.length;l++)n[l]=e.vertexMapper.get(i[l]);e.visit(function(t,e,n,i,l){var s=null!=t&&t.swimlaneIndex==e.swimlaneIndex&&e.isAncestor(t),o=null!=t&&null!=n&&t.swimlaneIndex<e.swimlaneIndex&&n.source==e;s?(n.invert(),mxUtils.remove(n,t.connectsAsSource),e.connectsAsSource.push(n),t.connectsAsTarget.push(n),mxUtils.remove(n,e.connectsAsTarget)):o&&(n.invert(),mxUtils.remove(n,t.connectsAsTarget),e.connectsAsTarget.push(n),t.connectsAsSource.push(n),mxUtils.remove(n,e.connectsAsSource));n=mxCellPath.create(e.cell);r[n]=e,delete a[n]},n,!0,null)};var mxHierarchicalEdgeStyle={ORTHOGONAL:1,POLYLINE:2,STRAIGHT:3,CURVE:4};function mxSwimlaneLayout(t,e,n){mxGraphLayout.call(this,t),this.orientation=null!=e?e:mxConstants.DIRECTION_NORTH,this.deterministic=null==n||n}function mxGraphModel(t){this.currentEdit=this.createUndoableEdit(),null!=t?this.setRoot(t):this.clear()}function mxRootChange(t,e){this.model=t,this.root=e,this.previous=e}function mxChildChange(t,e,n,i){this.model=t,this.parent=e,this.previous=e,this.child=n,this.index=i,this.previousIndex=i}function mxTerminalChange(t,e,n,i){this.model=t,this.cell=e,this.terminal=n,this.previous=n,this.source=i}function mxValueChange(t,e,n){this.model=t,this.cell=e,this.value=n,this.previous=n}function mxStyleChange(t,e,n){this.model=t,this.cell=e,this.style=n,this.previous=n}function mxGeometryChange(t,e,n){this.model=t,this.cell=e,this.geometry=n,this.previous=n}function mxCollapseChange(t,e,n){this.model=t,this.cell=e,this.collapsed=n,this.previous=n}function mxVisibleChange(t,e,n){this.model=t,this.cell=e,this.visible=n,this.previous=n}function mxCellAttributeChange(t,e,n){this.cell=t,this.attribute=e,this.value=n,this.previous=n}function mxCell(t,e,n){this.value=t,this.setGeometry(e),this.setStyle(n),null!=this.onInit&&this.onInit()}function mxGeometry(t,e,n,i){mxRectangle.call(this,t,e,n,i)}mxHierarchicalLayout.prototype=new mxGraphLayout,mxHierarchicalLayout.prototype.constructor=mxHierarchicalLayout,mxHierarchicalLayout.prototype.roots=null,mxHierarchicalLayout.prototype.resizeParent=!1,mxHierarchicalLayout.prototype.maintainParentLocation=!1,mxHierarchicalLayout.prototype.moveParent=!1,mxHierarchicalLayout.prototype.parentBorder=0,mxHierarchicalLayout.prototype.intraCellSpacing=30,mxHierarchicalLayout.prototype.interRankCellSpacing=100,mxHierarchicalLayout.prototype.interHierarchySpacing=60,mxHierarchicalLayout.prototype.parallelEdgeSpacing=10,mxHierarchicalLayout.prototype.orientation=mxConstants.DIRECTION_NORTH,mxHierarchicalLayout.prototype.fineTuning=!0,mxHierarchicalLayout.prototype.tightenToSource=!0,mxHierarchicalLayout.prototype.disableEdgeStyle=!0,mxHierarchicalLayout.prototype.traverseAncestors=!0,mxHierarchicalLayout.prototype.model=null,mxHierarchicalLayout.prototype.edgesCache=null,mxHierarchicalLayout.prototype.edgeSourceTermCache=null,mxHierarchicalLayout.prototype.edgesTargetTermCache=null,mxHierarchicalLayout.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE,mxHierarchicalLayout.prototype.getModel=function(){return this.model},mxHierarchicalLayout.prototype.execute=function(t,e){this.parent=t;var n,i=this.graph.model;if(this.edgesCache=new mxDictionary,this.edgeSourceTermCache=new mxDictionary,this.edgesTargetTermCache=new mxDictionary,null==e||e instanceof Array||(e=[e]),null!=e||null!=t){if(this.parentX=null,this.parentY=null,t!=this.root&&null!=i.isVertex(t)&&this.maintainParentLocation&&null!=(n=this.graph.getCellGeometry(t))&&(this.parentX=n.x,this.parentY=n.y),null!=e){for(var l=[],s=0;s<e.length;s++)(null==t||i.isAncestor(t,e[s]))&&i.isVertex(e[s])&&l.push(e[s]);this.roots=l}i.beginUpdate();try{this.run(t),this.resizeParent&&!this.graph.isCellCollapsed(t)&&this.graph.updateGroupBounds([t],this.parentBorder,this.moveParent),null!=this.parentX&&null!=this.parentY&&null!=(n=this.graph.getCellGeometry(t))&&((n=n.clone()).x=this.parentX,n.y=this.parentY,i.setGeometry(t,n))}finally{i.endUpdate()}}},mxHierarchicalLayout.prototype.findRoots=function(t,e){var n=[];if(null!=t&&null!=e){var i,l=this.graph.model,s=null,o=-1e5;for(i in e){var r=e[i];if(l.isVertex(r)&&this.graph.isCellVisible(r)){for(var a=this.getEdges(r),h=0,d=0,u=0;u<a.length;u++)this.getVisibleTerminal(a[u],!0)==r?h++:d++;0==d&&0<h&&n.push(r);var p=h-d;o<p&&(o=p,s=r)}}0==n.length&&null!=s&&n.push(s)}return n},mxHierarchicalLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(null!=e)return e;for(var n=this.graph.model,i=[],l=this.graph.isCellCollapsed(t),s=n.getChildCount(t),o=0;o<s;o++){var r=n.getChildAt(t,o);!this.isPort(r)&&!l&&this.graph.isCellVisible(r)||(i=i.concat(n.getEdges(r,!0,!0)))}i=i.concat(n.getEdges(t,!0,!0));for(var a=[],o=0;o<i.length;o++){var h=this.getVisibleTerminal(i[o],!0),d=this.getVisibleTerminal(i[o],!1);(h==d||h!=d&&(d==t&&(null==this.parent||this.isAncestor(this.parent,h,this.traverseAncestors))||h==t&&(null==this.parent||this.isAncestor(this.parent,d,this.traverseAncestors))))&&a.push(i[o])}return this.edgesCache.put(t,a),a},mxHierarchicalLayout.prototype.getVisibleTerminal=function(t,e){var n=this.edgesTargetTermCache;e&&(n=this.edgeSourceTermCache);var i=n.get(t);if(null!=i)return i;var l=this.graph.view.getState(t),i=null!=l?l.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e);return null==i&&(i=null!=l?l.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e)),null!=i&&(this.isPort(i)&&(i=this.graph.model.getParent(i)),n.put(t,i)),i},mxHierarchicalLayout.prototype.run=function(t){var e=[],n=[];if(null==this.roots&&null!=t){var i=Object();this.filterDescendants(t,i),this.roots=[];var l=!0;for(h in i)if(null!=i[h]){l=!1;break}for(;!l;){for(var s=this.findRoots(t,i),o=0;o<s.length;o++){var r=Object();e.push(r),this.traverse(s[o],!0,null,n,r,e,i)}for(o=0;o<s.length;o++)this.roots.push(s[o]);for(h in l=!0,i)if(null!=i[h]){l=!1;break}}}else for(o=0;o<this.roots.length;o++){r=Object();e.push(r),this.traverse(this.roots[o],!0,null,n,r,e,null)}for(var a=0,o=0;o<e.length;o++){var h,d=[];for(h in r=e[o])d.push(r[h]);this.model=new mxGraphHierarchyModel(this,d,this.roots,t,this.tightenToSource),this.cycleStage(t),this.layeringStage(),this.crossingStage(t),a=this.placementStage(a,t)}},mxHierarchicalLayout.prototype.filterDescendants=function(t,e){var n=this.graph.model;if(n.isVertex(t)&&t!=this.parent&&this.graph.isCellVisible(t)&&(e[mxObjectIdentity.get(t)]=t),this.traverseAncestors||t==this.parent&&this.graph.isCellVisible(t))for(var i=n.getChildCount(t),l=0;l<i;l++){var s=n.getChildAt(t,l);this.isPort(s)||this.filterDescendants(s,e)}},mxHierarchicalLayout.prototype.isPort=function(t){return null!=t&&null!=t.geometry&&t.geometry.relative},mxHierarchicalLayout.prototype.getEdgesBetween=function(t,e,n){n=null!=n&&n;for(var i=this.getEdges(t),l=[],s=0;s<i.length;s++){var o=this.getVisibleTerminal(i[s],!0),r=this.getVisibleTerminal(i[s],!1);(o==t&&r==e||!n&&o==e&&r==t)&&l.push(i[s])}return l},mxHierarchicalLayout.prototype.traverse=function(t,e,n,i,l,s,o){if(null!=t&&null!=i){var r=mxObjectIdentity.get(t);if(null!=i[r]||null!=o&&null==o[r]){if(null==l[r])for(p=0;p<s.length;p++){var a=s[p];if(null!=a[r]){for(var h in a)l[h]=a[h];return s.splice(p,1),l}}}else{null==l[r]&&(l[r]=t),null==i[r]&&(i[r]=t),null!==o&&delete o[r];for(var d=this.getEdges(t),u=[],p=0;p<d.length;p++)u[p]=this.getVisibleTerminal(d[p],!0)==t;for(var p=0;p<d.length;p++)if(!e||u[p]){for(var m,c=this.getVisibleTerminal(d[p],!u[p]),g=1,x=0;x<d.length;x++)x!=p&&(m=u[x],this.getVisibleTerminal(d[x],!m)==c&&(m?g++:g--));0<=g&&(l=this.traverse(c,e,d[p],i,l,s,o))}}}return l},mxHierarchicalLayout.prototype.cycleStage=function(t){new mxMinimumCycleRemover(this).execute(t)},mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxHierarchicalLayout.prototype.crossingStage=function(t){new mxMedianHybridCrossingReduction(this).execute(t)},mxHierarchicalLayout.prototype.placementStage=function(t,e){t=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,t,this.parallelEdgeSpacing);return t.fineTuning=this.fineTuning,t.execute(e),t.limitX+this.interHierarchySpacing},mxSwimlaneLayout.prototype=new mxGraphLayout,mxSwimlaneLayout.prototype.constructor=mxSwimlaneLayout,mxSwimlaneLayout.prototype.roots=null,mxSwimlaneLayout.prototype.swimlanes=null,mxSwimlaneLayout.prototype.dummyVertexWidth=50,mxSwimlaneLayout.prototype.resizeParent=!1,mxSwimlaneLayout.prototype.maintainParentLocation=!1,mxSwimlaneLayout.prototype.moveParent=!1,mxSwimlaneLayout.prototype.parentBorder=30,mxSwimlaneLayout.prototype.intraCellSpacing=30,mxSwimlaneLayout.prototype.interRankCellSpacing=100,mxSwimlaneLayout.prototype.interHierarchySpacing=60,mxSwimlaneLayout.prototype.parallelEdgeSpacing=10,mxSwimlaneLayout.prototype.orientation=mxConstants.DIRECTION_NORTH,mxSwimlaneLayout.prototype.fineTuning=!0,mxSwimlaneLayout.prototype.tightenToSource=!0,mxSwimlaneLayout.prototype.disableEdgeStyle=!0,mxSwimlaneLayout.prototype.traverseAncestors=!0,mxSwimlaneLayout.prototype.model=null,mxSwimlaneLayout.prototype.edgesCache=null,mxHierarchicalLayout.prototype.edgeSourceTermCache=null,mxHierarchicalLayout.prototype.edgesTargetTermCache=null,mxHierarchicalLayout.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE,mxSwimlaneLayout.prototype.getModel=function(){return this.model},mxSwimlaneLayout.prototype.execute=function(t,e){this.parent=t;var n=this.graph.model;if(this.edgesCache=new mxDictionary,this.edgeSourceTermCache=new mxDictionary,this.edgesTargetTermCache=new mxDictionary,!(null==e||e.length<1)){null==t&&(t=n.getParent(e[0])),this.parentX=null,this.parentY=null,t!=this.root&&null!=n.isVertex(t)&&this.maintainParentLocation&&null!=(i=this.graph.getCellGeometry(t))&&(this.parentX=i.x,this.parentY=i.y),this.swimlanes=e;for(var i,l=[],s=0;s<e.length;s++){var o=this.graph.getChildCells(e[s]);null!=o&&0!=o.length||(o=this.graph.insertVertex(e[s],null,null,0,0,this.dummyVertexWidth,0),l.push(o))}n.beginUpdate();try{this.run(t),this.resizeParent&&!this.graph.isCellCollapsed(t)&&this.graph.updateGroupBounds([t],this.parentBorder,this.moveParent),null!=this.parentX&&null!=this.parentY&&null!=(i=this.graph.getCellGeometry(t))&&((i=i.clone()).x=this.parentX,i.y=this.parentY,n.setGeometry(t,i)),this.graph.removeCells(l)}finally{n.endUpdate()}}},mxSwimlaneLayout.prototype.updateGroupBounds=function(){var t,e=[],n=this.model;for(t in n.edgeMapper)for(var i=n.edgeMapper[t],l=0;l<i.edges.length;l++)e.push(i.edges[l]);for(var s=this.graph.getBoundingBoxFromGeometry(e,!0),o=[],l=0;l<this.swimlanes.length;l++){var r,a,h=this.swimlanes[l];null!=(d=this.graph.getCellGeometry(h))&&(u=this.graph.getChildCells(h),p=this.graph.isSwimlane(h)?this.graph.getStartSize(h):new mxRectangle,a=this.graph.getBoundingBoxFromGeometry(u),r=(o[l]=a).y+d.y-p.height-this.parentBorder,a=a.y+d.y+a.height,null==s?s=new mxRectangle(0,r,0,a-r):(s.y=Math.min(s.y,r),a=Math.max(s.y+s.height,a),s.height=a-s.y))}for(l=0;l<this.swimlanes.length;l++){var d,u,p,m,c,g,x,h=this.swimlanes[l];null!=(d=this.graph.getCellGeometry(h))&&(u=this.graph.getChildCells(h),p=this.graph.isSwimlane(h)?this.graph.getStartSize(h):new mxRectangle,m=d.clone(),x=0==l?this.parentBorder:this.interRankCellSpacing/2,c=p.width+x,g=o[l].x-c,x=s.y-this.parentBorder,m.x+=g,m.y=x,m.width=o[l].width+c+this.interRankCellSpacing/2,m.height=s.height+p.height+2*this.parentBorder,this.graph.model.setGeometry(h,m),this.graph.moveCells(u,-g,d.y-x))}},mxSwimlaneLayout.prototype.findRoots=function(t,e){var n=[];if(null!=t&&null!=e){var i,l=this.graph.model,s=null,o=-1e5;for(i in e){var r=e[i];if(null!=r&&l.isVertex(r)&&this.graph.isCellVisible(r)&&l.isAncestor(t,r)){for(var a=this.getEdges(r),h=0,d=0,u=0;u<a.length;u++){var p,m=this.getVisibleTerminal(a[u],!0);m==r?(p=this.getVisibleTerminal(a[u],!1),l.isAncestor(t,p)&&h++):l.isAncestor(t,m)&&d++}0==d&&0<h&&n.push(r);var c=h-d;o<c&&(o=c,s=r)}}0==n.length&&null!=s&&n.push(s)}return n},mxSwimlaneLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(null!=e)return e;for(var n=this.graph.model,i=[],l=this.graph.isCellCollapsed(t),s=n.getChildCount(t),o=0;o<s;o++){var r=n.getChildAt(t,o);!this.isPort(r)&&!l&&this.graph.isCellVisible(r)||(i=i.concat(n.getEdges(r,!0,!0)))}i=i.concat(n.getEdges(t,!0,!0));for(var a=[],o=0;o<i.length;o++){var h=this.getVisibleTerminal(i[o],!0),d=this.getVisibleTerminal(i[o],!1);(h==d||h!=d&&(d==t&&(null==this.parent||this.graph.isValidAncestor(h,this.parent,this.traverseAncestors))||h==t&&(null==this.parent||this.graph.isValidAncestor(d,this.parent,this.traverseAncestors))))&&a.push(i[o])}return this.edgesCache.put(t,a),a},mxSwimlaneLayout.prototype.getVisibleTerminal=function(t,e){var n=this.edgesTargetTermCache;e&&(n=this.edgeSourceTermCache);var i=n.get(t);if(null!=i)return i;var l=this.graph.view.getState(t),i=null!=l?l.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e);return null==i&&(i=null!=l?l.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e)),null!=i&&(this.isPort(i)&&(i=this.graph.model.getParent(i)),n.put(t,i)),i},mxSwimlaneLayout.prototype.run=function(t){var e=[],n=Object();if(null!=this.swimlanes&&0<this.swimlanes.length&&null!=t){for(var i=Object(),l=0;l<this.swimlanes.length;l++)this.filterDescendants(this.swimlanes[l],i);this.roots=[];var s=!0;for(h in i)if(null!=i[h]){s=!1;break}for(var o=0;!s&&o<this.swimlanes.length;){var r=this.findRoots(this.swimlanes[o],i);if(0!=r.length){for(l=0;l<r.length;l++){var a=Object();e.push(a),this.traverse(r[l],!0,null,n,a,e,i,o)}for(l=0;l<r.length;l++)this.roots.push(r[l]);for(h in s=!0,i)if(null!=i[h]){s=!1;break}}else o++}}else for(l=0;l<this.roots.length;l++){a=Object();e.push(a),this.traverse(this.roots[l],!0,null,n,a,e,null)}var h,d=[];for(h in n)d.push(n[h]);this.model=new mxSwimlaneModel(this,d,this.roots,t,this.tightenToSource),this.cycleStage(t),this.layeringStage(),this.crossingStage(t),this.placementStage(0,t)},mxSwimlaneLayout.prototype.filterDescendants=function(t,e){var n=this.graph.model;if(n.isVertex(t)&&t!=this.parent&&n.getParent(t)!=this.parent&&this.graph.isCellVisible(t)&&(e[mxObjectIdentity.get(t)]=t),this.traverseAncestors||t==this.parent&&this.graph.isCellVisible(t))for(var i=n.getChildCount(t),l=0;l<i;l++){var s=n.getChildAt(t,l);this.isPort(s)||this.filterDescendants(s,e)}},mxSwimlaneLayout.prototype.isPort=function(t){return!!t.geometry.relative},mxSwimlaneLayout.prototype.getEdgesBetween=function(t,e,n){n=null!=n&&n;for(var i=this.getEdges(t),l=[],s=0;s<i.length;s++){var o=this.getVisibleTerminal(i[s],!0),r=this.getVisibleTerminal(i[s],!1);(o==t&&r==e||!n&&o==e&&r==t)&&l.push(i[s])}return l},mxSwimlaneLayout.prototype.traverse=function(t,e,n,i,l,s,o,r){if(null!=t&&null!=i){var a=mxObjectIdentity.get(t);if(null!=i[a]||null!=o&&null==o[a]){if(null==l[a])for(m=0;m<s.length;m++){var h=s[m];if(null!=h[a]){for(var d in h)l[d]=h[d];return s.splice(m,1),l}}}else{null==l[a]&&(l[a]=t),null==i[a]&&(i[a]=t),null!==o&&delete o[a];for(var u=this.getEdges(t),p=this.graph.model,m=0;m<u.length;m++){var c=this.getVisibleTerminal(u[m],!0),g=c==t;g&&(c=this.getVisibleTerminal(u[m],!1));for(var x=0,x=0;x<this.swimlanes.length&&!p.isAncestor(this.swimlanes[x],c);x++);x>=this.swimlanes.length||(r<x||(!e||g)&&x==r)&&(l=this.traverse(c,e,u[m],i,l,s,o,x))}}}return l},mxSwimlaneLayout.prototype.cycleStage=function(t){new mxSwimlaneOrdering(this).execute(t)},mxSwimlaneLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxSwimlaneLayout.prototype.crossingStage=function(t){new mxMedianHybridCrossingReduction(this).execute(t)},mxSwimlaneLayout.prototype.placementStage=function(t,e){t=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,t,this.parallelEdgeSpacing);return t.fineTuning=this.fineTuning,t.execute(e),t.limitX+this.interHierarchySpacing},mxGraphModel.prototype=new mxEventSource,mxGraphModel.prototype.constructor=mxGraphModel,mxGraphModel.prototype.root=null,mxGraphModel.prototype.cells=null,mxGraphModel.prototype.maintainEdgeParent=!0,mxGraphModel.prototype.ignoreRelativeEdgeParent=!0,mxGraphModel.prototype.createIds=!0,mxGraphModel.prototype.prefix="",mxGraphModel.prototype.postfix="",mxGraphModel.prototype.nextId=0,mxGraphModel.prototype.currentEdit=null,mxGraphModel.prototype.updateLevel=0,mxGraphModel.prototype.endingUpdate=!1,mxGraphModel.prototype.clear=function(){this.setRoot(this.createRoot())},mxGraphModel.prototype.isCreateIds=function(){return this.createIds},mxGraphModel.prototype.setCreateIds=function(t){this.createIds=t},mxGraphModel.prototype.createRoot=function(){var t=new mxCell;return t.insert(new mxCell),t},mxGraphModel.prototype.getCell=function(t){return null!=this.cells?this.cells[t]:null},mxGraphModel.prototype.filterCells=function(t,e){var n=null;if(null!=t){n=[];for(var i=0;i<t.length;i++)e(t[i])&&n.push(t[i])}return n},mxGraphModel.prototype.getDescendants=function(t){return this.filterDescendants(null,t)},mxGraphModel.prototype.filterDescendants=function(t,e){var n=[];e=e||this.getRoot(),null!=t&&!t(e)||n.push(e);for(var i=this.getChildCount(e),l=0;l<i;l++)var s=this.getChildAt(e,l),n=n.concat(this.filterDescendants(t,s));return n},mxGraphModel.prototype.getRoot=function(t){var e=t||this.root;if(null!=t)for(;null!=t;)e=t,t=this.getParent(t);return e},mxGraphModel.prototype.setRoot=function(t){return this.execute(new mxRootChange(this,t)),t},mxGraphModel.prototype.rootChanged=function(t){var e=this.root;return this.root=t,this.nextId=0,this.cells=null,this.cellAdded(t),e},mxGraphModel.prototype.isRoot=function(t){return null!=t&&this.root==t},mxGraphModel.prototype.isLayer=function(t){return this.isRoot(this.getParent(t))},mxGraphModel.prototype.isAncestor=function(t,e){for(;null!=e&&e!=t;)e=this.getParent(e);return e==t},mxGraphModel.prototype.contains=function(t){return this.isAncestor(this.root,t)},mxGraphModel.prototype.getParent=function(t){return null!=t?t.getParent():null},mxGraphModel.prototype.add=function(t,e,n){var i;return e!=t&&null!=t&&null!=e&&(null==n&&(n=this.getChildCount(t)),i=t!=this.getParent(e),this.execute(new mxChildChange(this,t,e,n)),this.maintainEdgeParent&&i&&this.updateEdgeParents(e)),e},mxGraphModel.prototype.cellAdded=function(t){if(null!=t){if(null==t.getId()&&this.createIds&&t.setId(this.createId(t)),null!=t.getId()){var e=this.getCell(t.getId());if(e!=t){for(;null!=e;)t.setId(this.createId(t)),e=this.getCell(t.getId());null==this.cells&&(this.cells=new Object),this.cells[t.getId()]=t}}mxUtils.isNumeric(t.getId())&&(this.nextId=Math.max(this.nextId,t.getId()));for(var n=this.getChildCount(t),i=0;i<n;i++)this.cellAdded(this.getChildAt(t,i))}},mxGraphModel.prototype.createId=function(t){var e=this.nextId;return this.nextId++,this.prefix+e+this.postfix},mxGraphModel.prototype.updateEdgeParents=function(t,e){e=e||this.getRoot(t);for(var n=this.getChildCount(t),i=0;i<n;i++){var l=this.getChildAt(t,i);this.updateEdgeParents(l,e)}for(var s=this.getEdgeCount(t),o=[],i=0;i<s;i++)o.push(this.getEdgeAt(t,i));for(i=0;i<o.length;i++){var r=o[i];this.isAncestor(e,r)&&this.updateEdgeParent(r,e)}},mxGraphModel.prototype.updateEdgeParent=function(t,e){for(var n,i,l,s=this.getTerminal(t,!0),o=this.getTerminal(t,!1),r=null;null!=s&&!this.isEdge(s)&&null!=s.geometry&&s.geometry.relative;)s=this.getParent(s);for(;null!=o&&this.ignoreRelativeEdgeParent&&!this.isEdge(o)&&null!=o.geometry&&o.geometry.relative;)o=this.getParent(o);this.isAncestor(e,s)&&this.isAncestor(e,o)&&(null==(r=s==o?this.getParent(s):this.getNearestCommonAncestor(s,o))||this.getParent(r)==this.root&&!this.isAncestor(r,t)||this.getParent(t)==r||(null!=(l=this.getGeometry(t))&&(i=this.getOrigin(this.getParent(t)),e=(n=this.getOrigin(r)).x-i.x,i=n.y-i.y,(l=l.clone()).translate(-e,-i),this.setGeometry(t,l)),this.add(r,t,this.getChildCount(r))))},mxGraphModel.prototype.getOrigin=function(t){var e=null;return null!=t?(e=this.getOrigin(this.getParent(t)),this.isEdge(t)||null!=(t=this.getGeometry(t))&&(e.x+=t.x,e.y+=t.y)):e=new mxPoint,e},mxGraphModel.prototype.getNearestCommonAncestor=function(t,e){if(null!=t&&null!=e&&(null!=(n=mxCellPath.create(e))&&0<n.length)){var n,i=t,l=mxCellPath.create(i);for(n.length<l.length&&(i=e,e=l,l=n,n=e);null!=i;){var s=this.getParent(i);if(0==n.indexOf(l+mxCellPath.PATH_SEPARATOR)&&null!=s)return i;l=mxCellPath.getParentPath(l),i=s}}return null},mxGraphModel.prototype.remove=function(t){return t==this.root?this.setRoot(null):null!=this.getParent(t)&&this.execute(new mxChildChange(this,null,t)),t},mxGraphModel.prototype.cellRemoved=function(t){if(null!=t&&null!=this.cells){for(var e=this.getChildCount(t)-1;0<=e;e--)this.cellRemoved(this.getChildAt(t,e));null!=this.cells&&null!=t.getId()&&delete this.cells[t.getId()]}},mxGraphModel.prototype.parentForCellChanged=function(t,e,n){var i=this.getParent(t);null!=e?e==i&&i.getIndex(t)==n||e.insert(t,n):null!=i&&(l=i.getIndex(t),i.remove(l));var l=this.contains(e),e=this.contains(i);return l&&!e?this.cellAdded(t):e&&!l&&this.cellRemoved(t),i},mxGraphModel.prototype.getChildCount=function(t){return null!=t?t.getChildCount():0},mxGraphModel.prototype.getChildAt=function(t,e){return null!=t?t.getChildAt(e):null},mxGraphModel.prototype.getChildren=function(t){return null!=t?t.children:null},mxGraphModel.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraphModel.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraphModel.prototype.getChildCells=function(t,e,n){e=null!=e&&e,n=null!=n&&n;for(var i=this.getChildCount(t),l=[],s=0;s<i;s++){var o=this.getChildAt(t,s);(!n&&!e||n&&this.isEdge(o)||e&&this.isVertex(o))&&l.push(o)}return l},mxGraphModel.prototype.getTerminal=function(t,e){return null!=t?t.getTerminal(e):null},mxGraphModel.prototype.setTerminal=function(t,e,n){var i=e!=this.getTerminal(t,n);return this.execute(new mxTerminalChange(this,t,e,n)),this.maintainEdgeParent&&i&&this.updateEdgeParent(t,this.getRoot()),e},mxGraphModel.prototype.setTerminals=function(t,e,n){this.beginUpdate();try{this.setTerminal(t,e,!0),this.setTerminal(t,n,!1)}finally{this.endUpdate()}},mxGraphModel.prototype.terminalForCellChanged=function(t,e,n){var i=this.getTerminal(t,n);return null!=e?e.insertEdge(t,n):null!=i&&i.removeEdge(t,n),i},mxGraphModel.prototype.getEdgeCount=function(t){return null!=t?t.getEdgeCount():0},mxGraphModel.prototype.getEdgeAt=function(t,e){return null!=t?t.getEdgeAt(e):null},mxGraphModel.prototype.getDirectedEdgeCount=function(t,e,n){for(var i=0,l=this.getEdgeCount(t),s=0;s<l;s++){var o=this.getEdgeAt(t,s);o!=n&&this.getTerminal(o,e)==t&&i++}return i},mxGraphModel.prototype.getConnections=function(t){return this.getEdges(t,!0,!0,!1)},mxGraphModel.prototype.getIncomingEdges=function(t){return this.getEdges(t,!0,!1,!1)},mxGraphModel.prototype.getOutgoingEdges=function(t){return this.getEdges(t,!1,!0,!1)},mxGraphModel.prototype.getEdges=function(t,e,n,i){e=null==e||e,n=null==n||n,i=null==i||i;for(var l=this.getEdgeCount(t),s=[],o=0;o<l;o++){var r=this.getEdgeAt(t,o),a=this.getTerminal(r,!0),h=this.getTerminal(r,!1);(i&&a==h||a!=h&&(e&&h==t||n&&a==t))&&s.push(r)}return s},mxGraphModel.prototype.getEdgesBetween=function(t,e,n){n=null!=n&&n;var i=this.getEdgeCount(t),l=this.getEdgeCount(e),s=t,o=i;l<i&&(o=l,s=e);for(var r=[],a=0;a<o;a++){var h=this.getEdgeAt(s,a),d=this.getTerminal(h,!0),u=this.getTerminal(h,!1);(d==t&&u==e||!n&&(u==t&&d==e))&&r.push(h)}return r},mxGraphModel.prototype.getOpposites=function(t,e,n,i){n=null==n||n,i=null==i||i;var l=[];if(null!=t)for(var s=0;s<t.length;s++){var o=this.getTerminal(t[s],!0),r=this.getTerminal(t[s],!1);o==e&&null!=r&&r!=e&&i?l.push(r):r==e&&null!=o&&o!=e&&n&&l.push(o)}return l},mxGraphModel.prototype.getTopmostCells=function(t){for(var e=new mxDictionary,n=[],i=0;i<t.length;i++)e.put(t[i],!0);for(i=0;i<t.length;i++){for(var l=t[i],s=!0,o=this.getParent(l);null!=o;){if(e.get(o)){s=!1;break}o=this.getParent(o)}s&&n.push(l)}return n},mxGraphModel.prototype.isVertex=function(t){return null!=t&&t.isVertex()},mxGraphModel.prototype.isEdge=function(t){return null!=t&&t.isEdge()},mxGraphModel.prototype.isConnectable=function(t){return null!=t&&t.isConnectable()},mxGraphModel.prototype.getValue=function(t){return null!=t?t.getValue():null},mxGraphModel.prototype.setValue=function(t,e){return this.execute(new mxValueChange(this,t,e)),e},mxGraphModel.prototype.valueForCellChanged=function(t,e){return t.valueChanged(e)},mxGraphModel.prototype.getGeometry=function(t){return null!=t?t.getGeometry():null},mxGraphModel.prototype.setGeometry=function(t,e){return e!=this.getGeometry(t)&&this.execute(new mxGeometryChange(this,t,e)),e},mxGraphModel.prototype.geometryForCellChanged=function(t,e){var n=this.getGeometry(t);return t.setGeometry(e),n},mxGraphModel.prototype.getStyle=function(t){return null!=t?t.getStyle():null},mxGraphModel.prototype.setStyle=function(t,e){return e!=this.getStyle(t)&&this.execute(new mxStyleChange(this,t,e)),e},mxGraphModel.prototype.styleForCellChanged=function(t,e){var n=this.getStyle(t);return t.setStyle(e),n},mxGraphModel.prototype.isCollapsed=function(t){return null!=t&&t.isCollapsed()},mxGraphModel.prototype.setCollapsed=function(t,e){return e!=this.isCollapsed(t)&&this.execute(new mxCollapseChange(this,t,e)),e},mxGraphModel.prototype.collapsedStateForCellChanged=function(t,e){var n=this.isCollapsed(t);return t.setCollapsed(e),n},mxGraphModel.prototype.isVisible=function(t){return null!=t&&t.isVisible()},mxGraphModel.prototype.setVisible=function(t,e){return e!=this.isVisible(t)&&this.execute(new mxVisibleChange(this,t,e)),e},mxGraphModel.prototype.visibleStateForCellChanged=function(t,e){var n=this.isVisible(t);return t.setVisible(e),n},mxGraphModel.prototype.execute=function(t){t.execute(),this.beginUpdate(),this.currentEdit.add(t),this.fireEvent(new mxEventObject(mxEvent.EXECUTE,"change",t)),this.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",t)),this.endUpdate()},mxGraphModel.prototype.beginUpdate=function(){this.updateLevel++,this.fireEvent(new mxEventObject(mxEvent.BEGIN_UPDATE)),1==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.START_EDIT))},mxGraphModel.prototype.endUpdate=function(){if(this.updateLevel--,0==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.END_EDIT)),!this.endingUpdate){this.endingUpdate=0==this.updateLevel,this.fireEvent(new mxEventObject(mxEvent.END_UPDATE,"edit",this.currentEdit));try{var t;this.endingUpdate&&!this.currentEdit.isEmpty()&&(this.fireEvent(new mxEventObject(mxEvent.BEFORE_UNDO,"edit",this.currentEdit)),t=this.currentEdit,this.currentEdit=this.createUndoableEdit(),t.notify(),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t)))}finally{this.endingUpdate=!1}}},mxGraphModel.prototype.createUndoableEdit=function(t){var e=new mxUndoableEdit(this,null==t||t);return e.notify=function(){e.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",e,"changes",e.changes)),e.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",e,"changes",e.changes))},e},mxGraphModel.prototype.mergeChildren=function(t,e,n){n=null==n||n,this.beginUpdate();try{var i,l=new Object;for(i in this.mergeChildrenImpl(t,e,n,l),l){var s=l[i],o=this.getTerminal(s,!0);null!=o&&(o=l[mxCellPath.create(o)],this.setTerminal(s,o,!0)),null!=(o=this.getTerminal(s,!1))&&(o=l[mxCellPath.create(o)],this.setTerminal(s,o,!1))}}finally{this.endUpdate()}},mxGraphModel.prototype.mergeChildrenImpl=function(t,e,n,i){this.beginUpdate();try{for(var l=t.getChildCount(),s=0;s<l;s++){var o,r,a,h=t.getChildAt(s);"function"==typeof h.getId&&(null==(r=null==(o=h.getId())||this.isEdge(h)&&n?null:this.getCell(o))&&((a=h.clone()).setId(o),a.setTerminal(h.getTerminal(!0),!0),a.setTerminal(h.getTerminal(!1),!1),r=e.insert(a),this.cellAdded(r)),i[mxCellPath.create(h)]=r,this.mergeChildrenImpl(h,r,n,i))}}finally{this.endUpdate()}},mxGraphModel.prototype.getParents=function(t){var e=[];if(null!=t)for(var n=new mxDictionary,i=0;i<t.length;i++){var l=this.getParent(t[i]);null==l||n.get(l)||(n.put(l,!0),e.push(l))}return e},mxGraphModel.prototype.cloneCell=function(t,e){return null!=t?this.cloneCells([t],e)[0]:null},mxGraphModel.prototype.cloneCells=function(t,e,n){e=null==e||e,n=null!=n?n:new Object;for(var i=[],l=0;l<t.length;l++)null!=t[l]?i.push(this.cloneCellImpl(t[l],n,e)):i.push(null);for(l=0;l<i.length;l++)null!=i[l]&&this.restoreClone(i[l],t[l],n);return i},mxGraphModel.prototype.cloneCellImpl=function(t,e,n){var i=mxObjectIdentity.get(t),l=e[i];if(null==l&&(l=this.cellCloned(t),e[i]=l,n))for(var s=this.getChildCount(t),o=0;o<s;o++){var r=this.cloneCellImpl(this.getChildAt(t,o),e,!0);l.insert(r)}return l},mxGraphModel.prototype.cellCloned=function(t){return t.clone()},mxGraphModel.prototype.restoreClone=function(t,e,n){var i=this.getTerminal(e,!0);null!=i&&null!=(l=n[mxObjectIdentity.get(i)])&&l.insertEdge(t,!0);var l,i=this.getTerminal(e,!1);null!=i&&null!=(l=n[mxObjectIdentity.get(i)])&&l.insertEdge(t,!1);for(var s=this.getChildCount(t),o=0;o<s;o++)this.restoreClone(this.getChildAt(t,o),this.getChildAt(e,o),n)},mxRootChange.prototype.execute=function(){this.root=this.previous,this.previous=this.model.rootChanged(this.previous)},mxChildChange.prototype.execute=function(){var t,e;null!=this.child&&(e=null!=(t=this.model.getParent(this.child))?t.getIndex(this.child):0,null==this.previous&&this.connect(this.child,!1),t=this.model.parentForCellChanged(this.child,this.previous,this.previousIndex),null!=this.previous&&this.connect(this.child,!0),this.parent=this.previous,this.previous=t,this.index=this.previousIndex,this.previousIndex=e)},mxChildChange.prototype.connect=function(t,e){e=null==e||e;var n=t.getTerminal(!0),i=t.getTerminal(!1);null!=n&&(e?this.model.terminalForCellChanged(t,n,!0):this.model.terminalForCellChanged(t,null,!0)),null!=i&&(e?this.model.terminalForCellChanged(t,i,!1):this.model.terminalForCellChanged(t,null,!1)),t.setTerminal(n,!0),t.setTerminal(i,!1);for(var l=this.model.getChildCount(t),s=0;s<l;s++)this.connect(this.model.getChildAt(t,s),e)},mxTerminalChange.prototype.execute=function(){null!=this.cell&&(this.terminal=this.previous,this.previous=this.model.terminalForCellChanged(this.cell,this.previous,this.source))},mxValueChange.prototype.execute=function(){null!=this.cell&&(this.value=this.previous,this.previous=this.model.valueForCellChanged(this.cell,this.previous))},mxStyleChange.prototype.execute=function(){null!=this.cell&&(this.style=this.previous,this.previous=this.model.styleForCellChanged(this.cell,this.previous))},mxGeometryChange.prototype.execute=function(){null!=this.cell&&(this.geometry=this.previous,this.previous=this.model.geometryForCellChanged(this.cell,this.previous))},mxCollapseChange.prototype.execute=function(){null!=this.cell&&(this.collapsed=this.previous,this.previous=this.model.collapsedStateForCellChanged(this.cell,this.previous))},mxVisibleChange.prototype.execute=function(){null!=this.cell&&(this.visible=this.previous,this.previous=this.model.visibleStateForCellChanged(this.cell,this.previous))},mxCellAttributeChange.prototype.execute=function(){var t;null!=this.cell&&(t=this.cell.getAttribute(this.attribute),null==this.previous?this.cell.value.removeAttribute(this.attribute):this.cell.setAttribute(this.attribute,this.previous),this.previous=t)},mxCell.prototype.id=null,mxCell.prototype.value=null,mxCell.prototype.geometry=null,mxCell.prototype.style=null,mxCell.prototype.vertex=!1,mxCell.prototype.edge=!1,mxCell.prototype.connectable=!0,mxCell.prototype.visible=!0,mxCell.prototype.collapsed=!1,mxCell.prototype.parent=null,mxCell.prototype.source=null,mxCell.prototype.target=null,mxCell.prototype.children=null,mxCell.prototype.edges=null,mxCell.prototype.mxTransient=["id","value","parent","source","target","children","edges"],mxCell.prototype.getId=function(){return this.id},mxCell.prototype.setId=function(t){this.id=t},mxCell.prototype.getValue=function(){return this.value},mxCell.prototype.setValue=function(t){this.value=t},mxCell.prototype.valueChanged=function(t){var e=this.getValue();return this.setValue(t),e},mxCell.prototype.getGeometry=function(){return this.geometry},mxCell.prototype.setGeometry=function(t){this.geometry=t},mxCell.prototype.getStyle=function(){return this.style},mxCell.prototype.setStyle=function(t){this.style=t},mxCell.prototype.isVertex=function(){return 0!=this.vertex},mxCell.prototype.setVertex=function(t){this.vertex=t},mxCell.prototype.isEdge=function(){return 0!=this.edge},mxCell.prototype.setEdge=function(t){this.edge=t},mxCell.prototype.isConnectable=function(){return 0!=this.connectable},mxCell.prototype.setConnectable=function(t){this.connectable=t},mxCell.prototype.isVisible=function(){return 0!=this.visible},mxCell.prototype.setVisible=function(t){this.visible=t},mxCell.prototype.isCollapsed=function(){return 0!=this.collapsed},mxCell.prototype.setCollapsed=function(t){this.collapsed=t},mxCell.prototype.getParent=function(){return this.parent},mxCell.prototype.setParent=function(t){this.parent=t},mxCell.prototype.getTerminal=function(t){return t?this.source:this.target},mxCell.prototype.setTerminal=function(t,e){return e?this.source=t:this.target=t,t},mxCell.prototype.getChildCount=function(){return null==this.children?0:this.children.length},mxCell.prototype.getIndex=function(t){return mxUtils.indexOf(this.children,t)},mxCell.prototype.getChildAt=function(t){return null==this.children?null:this.children[t]},mxCell.prototype.insert=function(t,e){return null!=t&&(null==e&&(e=this.getChildCount(),t.getParent()==this&&e--),t.removeFromParent(),t.setParent(this),null==this.children?(this.children=[],this.children.push(t)):this.children.splice(e,0,t)),t},mxCell.prototype.remove=function(t){var e=null;return null!=this.children&&0<=t&&null!=(e=this.getChildAt(t))&&(this.children.splice(t,1),e.setParent(null)),e},mxCell.prototype.removeFromParent=function(){var t;null!=this.parent&&(t=this.parent.getIndex(this),this.parent.remove(t))},mxCell.prototype.getEdgeCount=function(){return null==this.edges?0:this.edges.length},mxCell.prototype.getEdgeIndex=function(t){return mxUtils.indexOf(this.edges,t)},mxCell.prototype.getEdgeAt=function(t){return null==this.edges?null:this.edges[t]},mxCell.prototype.insertEdge=function(t,e){return null!=t&&(t.removeFromTerminal(e),t.setTerminal(this,e),(null==this.edges||t.getTerminal(!e)!=this||mxUtils.indexOf(this.edges,t)<0)&&(null==this.edges&&(this.edges=[]),this.edges.push(t))),t},mxCell.prototype.removeEdge=function(t,e){var n;return null!=t&&(t.getTerminal(!e)==this||null==this.edges||0<=(n=this.getEdgeIndex(t))&&this.edges.splice(n,1),t.setTerminal(null,e)),t},mxCell.prototype.removeFromTerminal=function(t){var e=this.getTerminal(t);null!=e&&e.removeEdge(this,t)},mxCell.prototype.hasAttribute=function(t){var e=this.getValue();return null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.hasAttribute?e.hasAttribute(t):null!=e.getAttribute(t)},mxCell.prototype.getAttribute=function(t,e){var n=this.getValue(),t=null!=n&&n.nodeType==mxConstants.NODETYPE_ELEMENT?n.getAttribute(t):null;return null!=t?t:e},mxCell.prototype.setAttribute=function(t,e){var n=this.getValue();null!=n&&n.nodeType==mxConstants.NODETYPE_ELEMENT&&n.setAttribute(t,e)},mxCell.prototype.clone=function(){var t=mxUtils.clone(this,this.mxTransient);return t.setValue(this.cloneValue()),t},mxCell.prototype.cloneValue=function(){var t=this.getValue();return null!=t&&("function"==typeof t.clone?t=t.clone():isNaN(t.nodeType)||(t=t.cloneNode(!0))),t},mxGeometry.prototype=new mxRectangle,mxGeometry.prototype.constructor=mxGeometry,mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0,mxGeometry.prototype.alternateBounds=null,mxGeometry.prototype.sourcePoint=null,mxGeometry.prototype.targetPoint=null,mxGeometry.prototype.points=null,mxGeometry.prototype.offset=null,mxGeometry.prototype.relative=!1,mxGeometry.prototype.swap=function(){var t;null!=this.alternateBounds&&(t=new mxRectangle(this.x,this.y,this.width,this.height),this.x=this.alternateBounds.x,this.y=this.alternateBounds.y,this.width=this.alternateBounds.width,this.height=this.alternateBounds.height,this.alternateBounds=t)},mxGeometry.prototype.getTerminalPoint=function(t){return t?this.sourcePoint:this.targetPoint},mxGeometry.prototype.setTerminalPoint=function(t,e){return e?this.sourcePoint=t:this.targetPoint=t,t},mxGeometry.prototype.rotate=function(t,e){var t=mxUtils.toRadians(t),n=Math.cos(t),i=Math.sin(t);if(this.relative||(t=new mxPoint(this.getCenterX(),this.getCenterY()),l=mxUtils.getRotatedPoint(t,n,i,e),this.x=Math.round(l.x-this.width/2),this.y=Math.round(l.y-this.height/2)),null!=this.sourcePoint&&(l=mxUtils.getRotatedPoint(this.sourcePoint,n,i,e),this.sourcePoint.x=Math.round(l.x),this.sourcePoint.y=Math.round(l.y)),null!=this.targetPoint&&(l=mxUtils.getRotatedPoint(this.targetPoint,n,i,e),this.targetPoint.x=Math.round(l.x),this.targetPoint.y=Math.round(l.y)),null!=this.points)for(var l,s=0;s<this.points.length;s++)null!=this.points[s]&&(l=mxUtils.getRotatedPoint(this.points[s],n,i,e),this.points[s].x=Math.round(l.x),this.points[s].y=Math.round(l.y))},mxGeometry.prototype.translate=function(t,e){if(t=parseFloat(t),e=parseFloat(e),this.relative||(this.x=parseFloat(this.x)+t,this.y=parseFloat(this.y)+e),null!=this.sourcePoint&&(this.sourcePoint.x=parseFloat(this.sourcePoint.x)+t,this.sourcePoint.y=parseFloat(this.sourcePoint.y)+e),null!=this.targetPoint&&(this.targetPoint.x=parseFloat(this.targetPoint.x)+t,this.targetPoint.y=parseFloat(this.targetPoint.y)+e),this.TRANSLATE_CONTROL_POINTS&&null!=this.points)for(var n=0;n<this.points.length;n++)null!=this.points[n]&&(this.points[n].x=parseFloat(this.points[n].x)+t,this.points[n].y=parseFloat(this.points[n].y)+e)},mxGeometry.prototype.scale=function(t,e,n){if(t=parseFloat(t),e=parseFloat(e),null!=this.sourcePoint&&(this.sourcePoint.x=parseFloat(this.sourcePoint.x)*t,this.sourcePoint.y=parseFloat(this.sourcePoint.y)*e),null!=this.targetPoint&&(this.targetPoint.x=parseFloat(this.targetPoint.x)*t,this.targetPoint.y=parseFloat(this.targetPoint.y)*e),null!=this.points)for(var i=0;i<this.points.length;i++)null!=this.points[i]&&(this.points[i].x=parseFloat(this.points[i].x)*t,this.points[i].y=parseFloat(this.points[i].y)*e);this.relative||(this.x=parseFloat(this.x)*t,this.y=parseFloat(this.y)*e,n&&(e=t=Math.min(t,e)),this.width=parseFloat(this.width)*t,this.height=parseFloat(this.height)*e)},mxGeometry.prototype.equals=function(t){return mxRectangle.prototype.equals.apply(this,arguments)&&this.relative==t.relative&&(null==this.sourcePoint&&null==t.sourcePoint||null!=this.sourcePoint&&this.sourcePoint.equals(t.sourcePoint))&&(null==this.targetPoint&&null==t.targetPoint||null!=this.targetPoint&&this.targetPoint.equals(t.targetPoint))&&(null==this.points&&null==t.points||null!=this.points&&mxUtils.equalPoints(this.points,t.points))&&(null==this.alternateBounds&&null==t.alternateBounds||null!=this.alternateBounds&&this.alternateBounds.equals(t.alternateBounds))&&(null==this.offset&&null==t.offset||null!=this.offset&&this.offset.equals(t.offset))};var mxCellPath={PATH_SEPARATOR:".",create:function(t){var e="";if(null!=t)for(var n=t.getParent();null!=n;)e=n.getIndex(t)+mxCellPath.PATH_SEPARATOR+e,n=(t=n).getParent();var i=e.length;return 1<i&&(e=e.substring(0,i-1)),e},getParentPath:function(t){if(null!=t){var e=t.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(0<=e)return t.substring(0,e);if(0<t.length)return""}return null},resolve:function(t,e){var n=t;if(null!=e)for(var i=e.split(mxCellPath.PATH_SEPARATOR),l=0;l<i.length;l++)n=n.getChildAt(parseInt(i[l]));return n},compare:function(t,e){for(var n,i,l=Math.min(t.length,e.length),s=0,o=0;o<l;o++)if(t[o]!=e[o]){s=0==t[o].length||0==e[o].length?t[o]==e[o]?0:t[o]>e[o]?1:-1:(n=parseInt(t[o]))==(i=parseInt(e[o]))?0:i<n?1:-1;break}return 0==s&&(n=t.length)!=(i=e.length)&&(s=i<n?1:-1),s}},mxPerimeter={RectanglePerimeter:function(t,e,n,i){var l=t.getCenterX(),s=t.getCenterY(),o=n.x-l,r=n.y-s,a=Math.atan2(r,o),h=new mxPoint(0,0),d=Math.PI,r=Math.PI/2-a,o=Math.atan2(t.height,t.width);return a<-d+o||d-o<a?(h.x=t.x,h.y=s-t.width*Math.tan(a)/2):a<-o?(h.y=t.y,h.x=l-t.height*Math.tan(r)/2):a<o?(h.x=t.x+t.width,h.y=s+t.width*Math.tan(a)/2):(h.y=t.y+t.height,h.x=l+t.height*Math.tan(r)/2),i&&(n.x>=t.x&&n.x<=t.x+t.width?h.x=n.x:n.y>=t.y&&n.y<=t.y+t.height&&(h.y=n.y),n.x<t.x?h.x=t.x:n.x>t.x+t.width&&(h.x=t.x+t.width),n.y<t.y?h.y=t.y:n.y>t.y+t.height&&(h.y=t.y+t.height)),h},EllipsePerimeter:function(t,e,n,i){var l=t.x,s=t.y,o=t.width/2,r=t.height/2,a=l+o,h=s+r,d=n.x,u=n.y,p=parseInt(d-a),n=parseInt(u-h);if(0==p&&0!=n)return new mxPoint(a,h+r*n/Math.abs(n));if(0==p&&0==n)return new mxPoint(d,u);if(i){if(s<=u&&u<=s+t.height){var m=u-h,c=Math.sqrt(o*o*(1-m*m/(r*r)))||0;return d<=l&&(c=-c),new mxPoint(a+c,u)}if(l<=d&&d<=l+t.width){c=d-a,m=Math.sqrt(r*r*(1-c*c/(o*o)))||0;return u<=s&&(m=-m),new mxPoint(d,h+m)}}m=n/p,n=h-m*a,p=o*o*m*m+r*r,h=-2*a*p,o=o*o*m*m*a*a+r*r*a*a-o*o*r*r,r=Math.sqrt(h*h-4*p*o),o=(-h+r)/(2*p),h=(-h-r)/(2*p),r=m*o+n,p=m*h+n,m=0,n=0,n=Math.sqrt(Math.pow(o-d,2)+Math.pow(r-u,2))<Math.sqrt(Math.pow(h-d,2)+Math.pow(p-u,2))?(m=o,r):(m=h,p);return new mxPoint(m,n)},RhombusPerimeter:function(t,e,n,i){var l=t.x,s=t.y,o=t.width,r=t.height,a=l+o/2,h=s+r/2,d=n.x,u=n.y;if(a==d)return new mxPoint(a,u<h?s:s+r);if(h==u)return new mxPoint(d<a?l:l+o,h);t=a,n=h;return i&&(l<=d&&d<=l+o?t=d:s<=u&&u<=s+r&&(n=u)),d<a?u<h?mxUtils.intersection(d,u,t,n,a,s,l,h):mxUtils.intersection(d,u,t,n,a,s+r,l,h):u<h?mxUtils.intersection(d,u,t,n,a,s,l+o,h):mxUtils.intersection(d,u,t,n,a,s+r,l+o,h)},TrianglePerimeter:function(t,e,n,i){var l=null!=e?e.style[mxConstants.STYLE_DIRECTION]:null,s=l==mxConstants.DIRECTION_NORTH||l==mxConstants.DIRECTION_SOUTH,o=t.x,r=t.y,a=t.width,h=t.height,d=o+a/2,u=r+h/2,p=new mxPoint(o,r),m=new mxPoint(o+a,u),c=new mxPoint(o,r+h);l==mxConstants.DIRECTION_NORTH?(p=c,m=new mxPoint(d,r),c=new mxPoint(o+a,r+h)):l==mxConstants.DIRECTION_SOUTH?(m=new mxPoint(d,r+h),c=new mxPoint(o+a,r)):l==mxConstants.DIRECTION_WEST&&(p=new mxPoint(o+a,r),m=new mxPoint(o,u),c=new mxPoint(o+a,r+h));var g=n.x-d,x=n.y-u,y=s?Math.atan2(g,x):Math.atan2(x,g),e=s?Math.atan2(a,h):Math.atan2(h,a),t=null;return null==(t=(l==mxConstants.DIRECTION_NORTH||l==mxConstants.DIRECTION_WEST?-e<y&&y<e:y<-Math.PI+e||y>Math.PI-e)?i&&(s&&n.x>=p.x&&n.x<=c.x||!s&&n.y>=p.y&&n.y<=c.y)?s?new mxPoint(n.x,p.y):new mxPoint(p.x,n.y):l==mxConstants.DIRECTION_NORTH?new mxPoint(o+a/2+h*Math.tan(y)/2,r+h):l==mxConstants.DIRECTION_SOUTH?new mxPoint(o+a/2-h*Math.tan(y)/2,r):l==mxConstants.DIRECTION_WEST?new mxPoint(o+a,r+h/2+a*Math.tan(y)/2):new mxPoint(o,r+h/2-a*Math.tan(y)/2):(i&&(i=new mxPoint(d,u),n.y>=r&&n.y<=r+h?(i.x=s?d:l==mxConstants.DIRECTION_WEST?o+a:o,i.y=n.y):n.x>=o&&n.x<=o+a&&(i.x=n.x,i.y=s?l==mxConstants.DIRECTION_NORTH?r+h:r:u),g=n.x-i.x,x=n.y-i.y,d=i.x,u=i.y),s&&n.x<=o+a/2||!s&&n.y<=r+h/2?mxUtils.intersection(n.x,n.y,d,u,p.x,p.y,m.x,m.y):mxUtils.intersection(n.x,n.y,d,u,m.x,m.y,c.x,c.y)))&&(t=new mxPoint(d,u)),t},HexagonPerimeter:function(t,e,n,i){var l,s=t.x,o=t.y,r=t.width,a=t.height,h=t.getCenterX(),d=t.getCenterY(),u=n.x,p=n.y,m=u-h,c=p-d,g=-Math.atan2(c,m),x=Math.PI,y=Math.PI/2,f=new mxPoint(h,d),t=null!=e?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST,c=t==mxConstants.DIRECTION_NORTH||t==mxConstants.DIRECTION_SOUTH,m=new mxPoint,e=new mxPoint;if((u<s&&p<o||u<s&&o+a<p||s+r<u&&p<o||s+r<u&&o+a<p)&&(i=!1),i){if(c){if(u==h){if(p<=o)return new mxPoint(h,o);if(o+a<=p)return new mxPoint(h,o+a)}else if(u<s){if(p==o+a/4)return new mxPoint(s,o+a/4);if(p==o+3*a/4)return new mxPoint(s,o+3*a/4)}else if(s+r<u){if(p==o+a/4)return new mxPoint(s+r,o+a/4);if(p==o+3*a/4)return new mxPoint(s+r,o+3*a/4)}else if(u==s){if(p<d)return new mxPoint(s,o+a/4);if(d<p)return new mxPoint(s,o+3*a/4)}else if(u==s+r){if(p<d)return new mxPoint(s+r,o+a/4);if(d<p)return new mxPoint(s+r,o+3*a/4)}if(p==o)return new mxPoint(h,o);if(p==o+a)return new mxPoint(h,o+a);u<h?o+a/4<p&&p<o+3*a/4?(m=new mxPoint(s,o),e=new mxPoint(s,o+a)):p<o+a/4?(m=new mxPoint(s-Math.floor(.5*r),o+Math.floor(.5*a)),e=new mxPoint(s+r,o-Math.floor(.25*a))):o+3*a/4<p&&(m=new mxPoint(s-Math.floor(.5*r),o+Math.floor(.5*a)),e=new mxPoint(s+r,o+Math.floor(1.25*a))):h<u&&(o+a/4<p&&p<o+3*a/4?(m=new mxPoint(s+r,o),e=new mxPoint(s+r,o+a)):p<o+a/4?(m=new mxPoint(s,o-Math.floor(.25*a)),e=new mxPoint(s+Math.floor(1.5*r),o+Math.floor(.5*a))):o+3*a/4<p&&(m=new mxPoint(s+Math.floor(1.5*r),o+Math.floor(.5*a)),e=new mxPoint(s,o+Math.floor(1.25*a))))}else{if(p==d){if(u<=s)return new mxPoint(s,o+a/2);if(s+r<=u)return new mxPoint(s+r,o+a/2)}else if(p<o){if(u==s+r/4)return new mxPoint(s+r/4,o);if(u==s+3*r/4)return new mxPoint(s+3*r/4,o)}else if(o+a<p){if(u==s+r/4)return new mxPoint(s+r/4,o+a);if(u==s+3*r/4)return new mxPoint(s+3*r/4,o+a)}else if(p==o){if(u<h)return new mxPoint(s+r/4,o);if(h<u)return new mxPoint(s+3*r/4,o)}else if(p==o+a){if(u<h)return new mxPoint(s+r/4,o+a);if(d<p)return new mxPoint(s+3*r/4,o+a)}if(u==s)return new mxPoint(s,d);if(u==s+r)return new mxPoint(s+r,d);p<d?s+r/4<u&&u<s+3*r/4?(m=new mxPoint(s,o),e=new mxPoint(s+r,o)):u<s+r/4?(m=new mxPoint(s-Math.floor(.25*r),o+a),e=new mxPoint(s+Math.floor(.5*r),o-Math.floor(.5*a))):s+3*r/4<u&&(m=new mxPoint(s+Math.floor(.5*r),o-Math.floor(.5*a)),e=new mxPoint(s+Math.floor(1.25*r),o+a)):d<p&&(s+r/4<u&&u<s+3*r/4?(m=new mxPoint(s,o+a),e=new mxPoint(s+r,o+a)):u<s+r/4?(m=new mxPoint(s-Math.floor(.25*r),o),e=new mxPoint(s+Math.floor(.5*r),o+Math.floor(1.5*a))):s+3*r/4<u&&(m=new mxPoint(s+Math.floor(.5*r),o+Math.floor(1.5*a)),e=new mxPoint(s+Math.floor(1.25*r),o)))}t=h,i=d;s<=u&&u<=s+r?(t=u,i=p<d?o+a:o):o<=p&&p<=o+a&&(i=p,t=u<h?s+r:s),f=mxUtils.intersection(t,i,n.x,n.y,m.x,m.y,e.x,e.y)}else{if(c){if(g==(l=Math.atan2(a/4,r/2)))return new mxPoint(s+r,o+Math.floor(.25*a));if(g==y)return new mxPoint(s+Math.floor(.5*r),o);if(g==x-l)return new mxPoint(s,o+Math.floor(.25*a));if(g==-l)return new mxPoint(s+r,o+Math.floor(.75*a));if(g==-y)return new mxPoint(s+Math.floor(.5*r),o+a);if(g==-x+l)return new mxPoint(s,o+Math.floor(.75*a));g<l&&-l<g?(m=new mxPoint(s+r,o),e=new mxPoint(s+r,o+a)):l<g&&g<y?(m=new mxPoint(s,o-Math.floor(.25*a)),e=new mxPoint(s+Math.floor(1.5*r),o+Math.floor(.5*a))):y<g&&g<x-l?(m=new mxPoint(s-Math.floor(.5*r),o+Math.floor(.5*a)),e=new mxPoint(s+r,o-Math.floor(.25*a))):x-l<g&&g<=x||g<-x+l&&-x<=g?(m=new mxPoint(s,o),e=new mxPoint(s,o+a)):g<-l&&-y<g?(m=new mxPoint(s+Math.floor(1.5*r),o+Math.floor(.5*a)),e=new mxPoint(s,o+Math.floor(1.25*a))):g<-y&&-x+l<g&&(m=new mxPoint(s-Math.floor(.5*r),o+Math.floor(.5*a)),e=new mxPoint(s+r,o+Math.floor(1.25*a)))}else{if(g==(l=Math.atan2(a/2,r/4)))return new mxPoint(s+Math.floor(.75*r),o);if(g==x-l)return new mxPoint(s+Math.floor(.25*r),o);if(g==x||g==-x)return new mxPoint(s,o+Math.floor(.5*a));if(0==g)return new mxPoint(s+r,o+Math.floor(.5*a));if(g==-l)return new mxPoint(s+Math.floor(.75*r),o+a);if(g==-x+l)return new mxPoint(s+Math.floor(.25*r),o+a);0<g&&g<l?(m=new mxPoint(s+Math.floor(.5*r),o-Math.floor(.5*a)),e=new mxPoint(s+Math.floor(1.25*r),o+a)):l<g&&g<x-l?(m=new mxPoint(s,o),e=new mxPoint(s+r,o)):x-l<g&&g<x?(m=new mxPoint(s-Math.floor(.25*r),o+a),e=new mxPoint(s+Math.floor(.5*r),o-Math.floor(.5*a))):g<0&&-l<g?(m=new mxPoint(s+Math.floor(.5*r),o+Math.floor(1.5*a)),e=new mxPoint(s+Math.floor(1.25*r),o)):g<-l&&-x+l<g?(m=new mxPoint(s,o+a),e=new mxPoint(s+r,o+a)):g<-x+l&&-x<g&&(m=new mxPoint(s-Math.floor(.25*r),o),e=new mxPoint(s+Math.floor(.5*r),o+Math.floor(1.5*a)))}f=mxUtils.intersection(h,d,n.x,n.y,m.x,m.y,e.x,e.y)}return null==f?new mxPoint(h,d):f}};function mxPrintPreview(t,e,n,i,l,s,o,r,a){this.graph=t,this.scale=null!=e?e:1/t.pageScale,this.border=null!=i?i:0,this.pageFormat=mxRectangle.fromRectangle(null!=n?n:t.pageFormat),this.title=null!=r?r:"Printer-friendly version",this.x0=null!=l?l:0,this.y0=null!=s?s:0,this.borderColor=o,this.pageSelector=null==a||a}function mxStylesheet(){this.styles=new Object,this.putDefaultVertexStyle(this.createDefaultVertexStyle()),this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}function mxCellState(t,e,n){this.view=t,this.cell=e,this.style=null!=n?n:{},this.origin=new mxPoint,this.absoluteOffset=new mxPoint}function mxGraphSelectionModel(t){this.graph=t,this.cells=[]}function mxSelectionChange(t,e,n){this.selectionModel=t,this.added=null!=e?e.slice():null,this.removed=null!=n?n.slice():null}function mxCellEditor(t){this.graph=t,this.zoomHandler=mxUtils.bind(this,function(){this.graph.isEditing()&&this.resize()}),this.graph.view.addListener(mxEvent.SCALE,this.zoomHandler),this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.zoomHandler),this.changeHandler=mxUtils.bind(this,function(t){null!=this.editingCell&&null==this.graph.getView().getState(this.editingCell)&&this.stopEditing(!0)}),this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)}function mxCellRenderer(){}mxPrintPreview.prototype.graph=null,mxPrintPreview.prototype.pageFormat=null,mxPrintPreview.prototype.scale=null,mxPrintPreview.prototype.border=0,mxPrintPreview.prototype.marginTop=0,mxPrintPreview.prototype.marginBottom=0,mxPrintPreview.prototype.x0=0,mxPrintPreview.prototype.y0=0,mxPrintPreview.prototype.autoOrigin=!0,mxPrintPreview.prototype.printOverlays=!1,mxPrintPreview.prototype.printControls=!1,mxPrintPreview.prototype.printBackgroundImage=!1,mxPrintPreview.prototype.backgroundColor="#ffffff",mxPrintPreview.prototype.borderColor=null,mxPrintPreview.prototype.title=null,mxPrintPreview.prototype.pageSelector=null,mxPrintPreview.prototype.wnd=null,mxPrintPreview.prototype.targetWindow=null,mxPrintPreview.prototype.pageCount=0,mxPrintPreview.prototype.clipping=!0,mxPrintPreview.prototype.getWindow=function(){return this.wnd},mxPrintPreview.prototype.getDoctype=function(){var t="";return 5==document.documentMode?t='<meta http-equiv="X-UA-Compatible" content="IE=5">':8==document.documentMode?t='<meta http-equiv="X-UA-Compatible" content="IE=8">':8<document.documentMode&&(t='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]--\x3e'),t},mxPrintPreview.prototype.appendGraph=function(t,e,n,i,l,s){this.graph=t,this.scale=null!=e?e:1/t.pageScale,this.x0=n,this.y0=i,this.open(null,null,l,s)},mxPrintPreview.prototype.open=function(t,e,i,n){var l=this.graph.cellRenderer.initializeOverlay,s=null;try{this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(t,e){e.init(t.view.getDrawPane())}),this.printControls&&(this.graph.cellRenderer.initControl=function(t,e,n,i){e.dialect=t.view.graph.dialect,e.init(t.view.getDrawPane())}),this.wnd=null!=e?e:this.wnd;var o=!1;null==this.wnd&&(o=!0,this.wnd=window.open());var r=this.wnd.document;o&&(null!=(d=this.getDoctype())&&0<d.length&&r.writeln(d),mxClient.IS_VML?r.writeln('<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">'):("CSS1Compat"===document.compatMode&&r.writeln("<!DOCTYPE html>"),r.writeln("<html>")),r.writeln("<head>"),this.writeHead(r,t),r.writeln("</head>"),r.writeln('<body class="mxPage">'));var a=this.graph.getGraphBounds().clone(),h=this.graph.getView().getScale(),d=h/this.scale,u=this.graph.getView().getTranslate();this.autoOrigin||(this.x0-=u.x*this.scale,this.y0-=u.y*this.scale,a.width+=a.x,a.height+=a.y,a.x=0,a.y=0,this.border=0);var p=this.pageFormat.width-2*this.border,m=this.pageFormat.height-2*this.border;this.pageFormat.height+=this.marginTop+this.marginBottom,a.width/=d,a.height/=d;var c=Math.max(1,Math.ceil((a.width+this.x0)/p)),g=Math.max(1,Math.ceil((a.height+this.y0)/m));this.pageCount=c*g;var d=mxUtils.bind(this,function(){var t,e;this.pageSelector&&(1<g||1<c)&&(t=this.createPageSelector(g,c),r.body.appendChild(t),(mxClient.IS_IE&&null==r.documentMode||5==r.documentMode||8==r.documentMode||7==r.documentMode)&&(t.style.position="absolute",e=function(){t.style.top=(r.body.scrollTop||r.documentElement.scrollTop)+10+"px"},mxEvent.addListener(this.wnd,"scroll",function(t){e()}),mxEvent.addListener(this.wnd,"resize",function(t){e()})))}),x=mxUtils.bind(this,function(t,e){var n;null!=this.borderColor&&(t.style.borderColor=this.borderColor,t.style.borderStyle="solid",t.style.borderWidth="1px"),t.style.background=this.backgroundColor,(i||e)&&(t.style.pageBreakAfter="always"),o&&(mxClient.IS_IE||11<=document.documentMode||mxClient.IS_EDGE)?(r.writeln(t.outerHTML),t.parentNode.removeChild(t)):mxClient.IS_IE||11<=document.documentMode||mxClient.IS_EDGE?((n=r.createElement("div")).innerHTML=t.outerHTML,n=n.getElementsByTagName("div")[0],r.body.appendChild(n),t.parentNode.removeChild(t)):(t.parentNode.removeChild(t),r.body.appendChild(t)),(i||e)&&this.addPageBreak(r)}),y=this.getCoverPages(this.pageFormat.width,this.pageFormat.height);if(null!=y)for(var f=0;f<y.length;f++)x(y[f],!0);for(var C=this.getAppendices(this.pageFormat.width,this.pageFormat.height),f=0;f<g;f++)for(var v=f*m/this.scale-this.y0/this.scale+(a.y-u.y*h)/h,E=0;E<c;E++){if(null==this.wnd)return null;var S=E*p/this.scale-this.x0/this.scale+(a.x-u.x*h)/h,w=f*c+E+1,b=new mxRectangle(S,v,p,m);(s=this.renderPage(this.pageFormat.width,this.pageFormat.height,0,0,mxUtils.bind(this,function(t){this.addGraphFragment(-S,-v,this.scale,w,t,b),this.printBackgroundImage&&this.insertBackgroundImage(t,-S,-v)}),w)).setAttribute("id","mxPage-"+w),x(s,null!=C||f<g-1||E<c-1)}if(null!=C)for(f=0;f<C.length;f++)x(C[f],f<C.length-1);o&&!n&&(this.closeDocument(),d()),this.wnd.focus()}catch(t){null!=s&&null!=s.parentNode&&s.parentNode.removeChild(s)}finally{this.graph.cellRenderer.initializeOverlay=l}return this.wnd},mxPrintPreview.prototype.addPageBreak=function(t){var e=t.createElement("hr");e.className="mxPageBreak",t.body.appendChild(e)},mxPrintPreview.prototype.closeDocument=function(){try{var t;null!=this.wnd&&null!=this.wnd.document&&(t=this.wnd.document,this.writePostfix(t),t.writeln("</body>"),t.writeln("</html>"),t.close(),mxEvent.release(t.body))}catch(t){}},mxPrintPreview.prototype.writeHead=function(t,e){null!=this.title&&t.writeln("<title>"+this.title+"</title>"),mxClient.IS_VML&&t.writeln('<style type="text/css">v\\:*{behavior:url(#default#VML)}o\\:*{behavior:url(#default#VML)}</style>'),t.writeln('<style type="text/css">'),t.writeln("@media print {"),t.writeln(" * { -webkit-print-color-adjust: exact; }"),t.writeln(" table.mxPageSelector { display: none; }"),t.writeln(" hr.mxPageBreak { display: none; }"),t.writeln("}"),t.writeln("@media screen {"),t.writeln(" table.mxPageSelector { position: fixed; right: 10px; top: 10px;font-family: Arial; font-size:10pt; border: solid 1px darkgray;background: white; border-collapse:collapse; }"),t.writeln(" table.mxPageSelector td { border: solid 1px gray; padding:4px; }"),t.writeln(" body.mxPage { background: gray; }"),t.writeln("}"),null!=e&&t.writeln(e),t.writeln("</style>")},mxPrintPreview.prototype.writePostfix=function(t){},mxPrintPreview.prototype.createPageSelector=function(t,e){var n=this.wnd.document,i=n.createElement("table");i.className="mxPageSelector",i.setAttribute("border","0");for(var l=n.createElement("tbody"),s=0;s<t;s++){for(var o=n.createElement("tr"),r=0;r<e;r++){var a,h=s*e+r+1,d=n.createElement("td"),u=n.createElement("a");u.setAttribute("href","#mxPage-"+h),!mxClient.IS_NS||mxClient.IS_SF||mxClient.IS_GC||(a="var page = document.getElementById('mxPage-"+h+"');page.scrollIntoView(true);event.preventDefault();",u.setAttribute("onclick",a)),mxUtils.write(u,h,n),d.appendChild(u),o.appendChild(d)}l.appendChild(o)}return i.appendChild(l),i},mxPrintPreview.prototype.renderPage=function(t,e,n,i,l,s){var o=this.wnd.document,r=document.createElement("div"),a=null;try{var h,d,a=0!=n||0!=i?(r.style.position="relative",r.style.width=t+"px",r.style.height=e+"px",r.style.pageBreakInside="avoid",(d=document.createElement("div")).style.position="relative",d.style.top=this.border+"px",d.style.left=this.border+"px",d.style.width=t-2*this.border+"px",d.style.height=e-2*this.border+"px",d.style.overflow="hidden",(h=document.createElement("div")).style.position="relative",h.style.marginLeft=n+"px",h.style.marginTop=i+"px",8==o.documentMode&&(d.style.position="absolute",h.style.position="absolute"),10==o.documentMode&&(h.style.width="100%",h.style.height="100%"),d.appendChild(h),r.appendChild(d),document.body.appendChild(r),h):(r.style.width=t+"px",r.style.height=e+"px",r.style.overflow="hidden",r.style.pageBreakInside="avoid",8==o.documentMode&&(r.style.position="relative"),(d=document.createElement("div")).style.width=t-2*this.border+"px",d.style.height=e-2*this.border+"px",d.style.overflow="hidden",!mxClient.IS_IE||null!=o.documentMode&&5!=o.documentMode&&8!=o.documentMode&&7!=o.documentMode?(d.style.top=this.border+"px",d.style.left=this.border+"px"):(d.style.marginTop=this.border+"px",d.style.marginLeft=this.border+"px"),this.graph.dialect==mxConstants.DIALECT_VML&&(d.style.position="absolute"),r.appendChild(d),document.body.appendChild(r),d)}catch(t){throw r.parentNode.removeChild(r),r=null,t}return l(a),r},mxPrintPreview.prototype.getRoot=function(){var t=this.graph.view.currentRoot;return null==t&&(t=this.graph.getModel().getRoot()),t},mxPrintPreview.prototype.useCssTransforms=function(){return!mxClient.NO_FO&&!mxClient.IS_SF},mxPrintPreview.prototype.addGraphFragment=function(t,e,n,i,l,s){var o=this.graph.getView(),r=this.graph.container;this.graph.container=l;var a=o.getCanvas(),h=o.getBackgroundPane(),d=o.getDrawPane(),u=o.getOverlayPane(),p=n;this.graph.dialect==mxConstants.DIALECT_SVG?(o.createSvg(),this.useCssTransforms()&&((g=o.getDrawPane().parentNode).getAttribute("transform"),g.setAttribute("transformOrigin","0 0"),g.setAttribute("transform","scale("+n+","+n+")translate("+t+","+e+")"),n=1,e=t=0)):this.graph.dialect==mxConstants.DIALECT_VML?o.createVml():o.createHtml();var m=o.isEventsEnabled();o.setEventsEnabled(!1);var c=this.graph.isEnabled();this.graph.setEnabled(!1);var g=o.getTranslate();o.translate=new mxPoint(t,e);var x,y=this.graph.cellRenderer.redraw,f=o.states,e=o.scale;this.clipping&&(x=new mxRectangle((s.x+g.x)*e,(s.y+g.y)*e,s.width*e/p,s.height*e/p),this.graph.cellRenderer.redraw=function(t,e,n){if(null!=t){var i=f.get(t.cell);if(null!=i){i=o.getBoundingBox(i,!1);if(null!=i&&0<i.width&&0<i.height&&!mxUtils.intersects(x,i))return}}y.apply(this,arguments)});var C=null;try{var v=[this.getRoot()],C=new mxTemporaryCellStates(o,n,v,null,mxUtils.bind(this,function(t){return this.getLinkForCellState(t)}))}finally{if(mxClient.IS_IE)o.overlayPane.innerHTML="",o.canvas.style.overflow="hidden",o.canvas.style.position="relative",o.canvas.style.top=this.marginTop+"px",o.canvas.style.width=s.width+"px",o.canvas.style.height=s.height+"px";else for(var E=l.firstChild;null!=E;){var S=E.nextSibling,w=E.nodeName.toLowerCase();"svg"==w?(E.style.overflow="hidden",E.style.position="relative",E.style.top=this.marginTop+"px",E.setAttribute("width",s.width),E.setAttribute("height",s.height),E.style.width="",E.style.height=""):"default"!=E.style.cursor&&"div"!=w&&E.parentNode.removeChild(E),E=S}!this.printBackgroundImage||0<(l=l.getElementsByTagName("svg")).length&&(l[0].style.position="absolute"),o.overlayPane.parentNode.removeChild(o.overlayPane),this.graph.setEnabled(c),this.graph.container=r,this.graph.cellRenderer.redraw=y,o.canvas=a,o.backgroundPane=h,o.drawPane=d,o.overlayPane=u,o.translate=g,C.destroy(),o.setEventsEnabled(m)}},mxPrintPreview.prototype.getLinkForCellState=function(t){return this.graph.getLinkForCell(t.cell)},mxPrintPreview.prototype.insertBackgroundImage=function(t,e,n){var i,l=this.graph.backgroundImage;null!=l&&((i=document.createElement("img")).style.position="absolute",i.style.marginLeft=Math.round(e*this.scale)+"px",i.style.marginTop=Math.round(n*this.scale)+"px",i.setAttribute("width",Math.round(this.scale*l.width)),i.setAttribute("height",Math.round(this.scale*l.height)),i.src=l.src,t.insertBefore(i,t.firstChild))},mxPrintPreview.prototype.getCoverPages=function(){return null},mxPrintPreview.prototype.getAppendices=function(){return null},mxPrintPreview.prototype.print=function(t){t=this.open(t);null!=t&&t.print()},mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)},mxStylesheet.prototype.styles,mxStylesheet.prototype.createDefaultVertexStyle=function(){var t=new Object;return t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE,t[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_FILLCOLOR]="#C3D9FF",t[mxConstants.STYLE_STROKECOLOR]="#6482B9",t[mxConstants.STYLE_FONTCOLOR]="#774400",t},mxStylesheet.prototype.createDefaultEdgeStyle=function(){var t=new Object;return t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR,t[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_STROKECOLOR]="#6482B9",t[mxConstants.STYLE_FONTCOLOR]="#446299",t},mxStylesheet.prototype.putDefaultVertexStyle=function(t){this.putCellStyle("defaultVertex",t)},mxStylesheet.prototype.putDefaultEdgeStyle=function(t){this.putCellStyle("defaultEdge",t)},mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex},mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge},mxStylesheet.prototype.putCellStyle=function(t,e){this.styles[t]=e},mxStylesheet.prototype.getCellStyle=function(t,e){var n=e;if(null!=t&&0<t.length)for(var i=t.split(";"),n=null!=n&&";"!=t.charAt(0)?mxUtils.clone(n):new Object,l=0;l<i.length;l++){var s=i[l],o=s.indexOf("=");if(0<=o){var r=s.substring(0,o),o=s.substring(o+1);o==mxConstants.NONE?delete n[r]:mxUtils.isNumeric(o)?n[r]=parseFloat(o):n[r]=o}else{var a=this.styles[s];if(null!=a)for(var r in a)n[r]=a[r]}}return n},mxCellState.prototype=new mxRectangle,mxCellState.prototype.constructor=mxCellState,mxCellState.prototype.view=null,mxCellState.prototype.cell=null,mxCellState.prototype.style=null,mxCellState.prototype.invalidStyle=!1,mxCellState.prototype.invalid=!0,mxCellState.prototype.origin=null,mxCellState.prototype.absolutePoints=null,mxCellState.prototype.absoluteOffset=null,mxCellState.prototype.visibleSourceState=null,mxCellState.prototype.visibleTargetState=null,mxCellState.prototype.terminalDistance=0,mxCellState.prototype.length=0,mxCellState.prototype.segments=null,mxCellState.prototype.shape=null,mxCellState.prototype.text=null,mxCellState.prototype.unscaledWidth=null,mxCellState.prototype.unscaledHeight=null,mxCellState.prototype.getPerimeterBounds=function(t,e){var n;return t=t||0,e=null!=e?e:new mxRectangle(this.x,this.y,this.width,this.height),null!=this.shape&&null!=this.shape.stencil&&"fixed"==this.shape.stencil.aspect&&(n=this.shape.stencil.computeAspect(this.style,e.x,e.y,e.width,e.height),e.x=n.x,e.y=n.y,e.width=this.shape.stencil.w0*n.width,e.height=this.shape.stencil.h0*n.height),0!=t&&e.grow(t),e},mxCellState.prototype.setAbsoluteTerminalPoint=function(t,e){e?(null==this.absolutePoints&&(this.absolutePoints=[]),0==this.absolutePoints.length?this.absolutePoints.push(t):this.absolutePoints[0]=t):null==this.absolutePoints?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(t)):1==this.absolutePoints.length?this.absolutePoints.push(t):this.absolutePoints[this.absolutePoints.length-1]=t},mxCellState.prototype.setCursor=function(t){null!=this.shape&&this.shape.setCursor(t),null!=this.text&&this.text.setCursor(t)},mxCellState.prototype.getVisibleTerminal=function(t){t=this.getVisibleTerminalState(t);return null!=t?t.cell:null},mxCellState.prototype.getVisibleTerminalState=function(t){return t?this.visibleSourceState:this.visibleTargetState},mxCellState.prototype.setVisibleTerminalState=function(t,e){e?this.visibleSourceState=t:this.visibleTargetState=t},mxCellState.prototype.getCellBounds=function(){return this.cellBounds},mxCellState.prototype.getPaintBounds=function(){return this.paintBounds},mxCellState.prototype.updateCachedBounds=function(){var t=this.view.translate,e=this.view.scale;this.cellBounds=new mxRectangle(this.x/e-t.x,this.y/e-t.y,this.width/e,this.height/e),this.paintBounds=mxRectangle.fromRectangle(this.cellBounds),null!=this.shape&&this.shape.isPaintBoundsInverted()&&this.paintBounds.rotate90()},mxCellState.prototype.setState=function(t){this.view=t.view,this.cell=t.cell,this.style=t.style,this.absolutePoints=t.absolutePoints,this.origin=t.origin,this.absoluteOffset=t.absoluteOffset,this.boundingBox=t.boundingBox,this.terminalDistance=t.terminalDistance,this.segments=t.segments,this.length=t.length,this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.unscaledWidth=t.unscaledWidth,this.unscaledHeight=t.unscaledHeight},mxCellState.prototype.clone=function(){var t=new mxCellState(this.view,this.cell,this.style);if(null!=this.absolutePoints){t.absolutePoints=[];for(var e=0;e<this.absolutePoints.length;e++)t.absolutePoints[e]=this.absolutePoints[e].clone()}return null!=this.origin&&(t.origin=this.origin.clone()),null!=this.absoluteOffset&&(t.absoluteOffset=this.absoluteOffset.clone()),null!=this.boundingBox&&(t.boundingBox=this.boundingBox.clone()),t.terminalDistance=this.terminalDistance,t.segments=this.segments,t.length=this.length,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.unscaledWidth=this.unscaledWidth,t.unscaledHeight=this.unscaledHeight,t},mxCellState.prototype.destroy=function(){this.view.graph.cellRenderer.destroy(this)},mxGraphSelectionModel.prototype=new mxEventSource,mxGraphSelectionModel.prototype.constructor=mxGraphSelectionModel,mxGraphSelectionModel.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphSelectionModel.prototype.updatingSelectionResource="none"!=mxClient.language?"updatingSelection":"",mxGraphSelectionModel.prototype.graph=null,mxGraphSelectionModel.prototype.singleSelection=!1,mxGraphSelectionModel.prototype.isSingleSelection=function(){return this.singleSelection},mxGraphSelectionModel.prototype.setSingleSelection=function(t){this.singleSelection=t},mxGraphSelectionModel.prototype.isSelected=function(t){return null!=t&&0<=mxUtils.indexOf(this.cells,t)},mxGraphSelectionModel.prototype.isEmpty=function(){return 0==this.cells.length},mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)},mxGraphSelectionModel.prototype.setCell=function(t){null!=t&&this.setCells([t])},mxGraphSelectionModel.prototype.setCells=function(t){if(null!=t){this.singleSelection&&(t=[this.getFirstSelectableCell(t)]);for(var e=[],n=0;n<t.length;n++)this.graph.isCellSelectable(t[n])&&e.push(t[n]);this.changeSelection(e,this.cells)}},mxGraphSelectionModel.prototype.getFirstSelectableCell=function(t){if(null!=t)for(var e=0;e<t.length;e++)if(this.graph.isCellSelectable(t[e]))return t[e];return null},mxGraphSelectionModel.prototype.addCell=function(t){null!=t&&this.addCells([t])},mxGraphSelectionModel.prototype.addCells=function(t){if(null!=t){var e=null;this.singleSelection&&(e=this.cells,t=[this.getFirstSelectableCell(t)]);for(var n=[],i=0;i<t.length;i++)!this.isSelected(t[i])&&this.graph.isCellSelectable(t[i])&&n.push(t[i]);this.changeSelection(n,e)}},mxGraphSelectionModel.prototype.removeCell=function(t){null!=t&&this.removeCells([t])},mxGraphSelectionModel.prototype.removeCells=function(t){if(null!=t){for(var e=[],n=0;n<t.length;n++)this.isSelected(t[n])&&e.push(t[n]);this.changeSelection(null,e)}},mxGraphSelectionModel.prototype.changeSelection=function(t,e){(null!=t&&0<t.length&&null!=t[0]||null!=e&&0<e.length&&null!=e[0])&&((t=new mxSelectionChange(this,t,e)).execute(),(e=new mxUndoableEdit(this,!1)).add(t),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",e)))},mxGraphSelectionModel.prototype.cellAdded=function(t){null==t||this.isSelected(t)||this.cells.push(t)},mxGraphSelectionModel.prototype.cellRemoved=function(t){null==t||0<=(t=mxUtils.indexOf(this.cells,t))&&this.cells.splice(t,1)},mxSelectionChange.prototype.execute=function(){var t=mxLog.enter("mxSelectionChange.execute");if(window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource,null!=this.removed)for(var e=0;e<this.removed.length;e++)this.selectionModel.cellRemoved(this.removed[e]);if(null!=this.added)for(e=0;e<this.added.length;e++)this.selectionModel.cellAdded(this.added[e]);var n=this.added;this.added=this.removed,this.removed=n,window.status=mxResources.get(this.selectionModel.doneResource)||this.selectionModel.doneResource,mxLog.leave("mxSelectionChange.execute",t),this.selectionModel.fireEvent(new mxEventObject(mxEvent.CHANGE,"added",this.added,"removed",this.removed))},mxCellEditor.prototype.graph=null,mxCellEditor.prototype.textarea=null,mxCellEditor.prototype.editingCell=null,mxCellEditor.prototype.trigger=null,mxCellEditor.prototype.modified=!1,mxCellEditor.prototype.autoSize=!0,mxCellEditor.prototype.selectText=!0,mxCellEditor.prototype.emptyLabelText=mxClient.IS_FF?"<br>":"",mxCellEditor.prototype.escapeCancelsEditing=!0,mxCellEditor.prototype.textNode="",mxCellEditor.prototype.zIndex=5,mxCellEditor.prototype.minResize=new mxRectangle(0,20),mxCellEditor.prototype.wordWrapPadding=mxClient.IS_QUIRKS?2:mxClient.IS_IE11?0:1,mxCellEditor.prototype.blurEnabled=!1,mxCellEditor.prototype.initialValue=null,mxCellEditor.prototype.align=null,mxCellEditor.prototype.init=function(){this.textarea=document.createElement("div"),this.textarea.className="mxCellEditor mxPlainTextEditor",this.textarea.contentEditable=!0,mxClient.IS_GC&&(this.textarea.style.minHeight="1em"),this.textarea.style.position=this.isLegacyEditor()?"absolute":"relative",this.installListeners(this.textarea)},mxCellEditor.prototype.applyValue=function(t,e){this.graph.labelChanged(t.cell,e,this.trigger)},mxCellEditor.prototype.setAlign=function(t){null!=this.textarea&&(this.textarea.style.textAlign=t),this.align=t,this.resize()},mxCellEditor.prototype.getInitialValue=function(t,e){e=mxUtils.htmlEntities(this.graph.getEditingValue(t.cell,e),!1);return mxClient.IS_QUIRKS||8==document.documentMode||9==document.documentMode||10==document.documentMode||(e=mxUtils.replaceTrailingNewlines(e,"<div><br></div>")),e.replace(/\n/g,"<br>")},mxCellEditor.prototype.getCurrentValue=function(t){return mxUtils.extractTextWithWhitespace(this.textarea.childNodes)},mxCellEditor.prototype.isCancelEditingKeyEvent=function(t){return this.escapeCancelsEditing||mxEvent.isShiftDown(t)||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)},mxCellEditor.prototype.installListeners=function(e){mxEvent.addListener(e,"dragstart",mxUtils.bind(this,function(t){this.graph.stopEditing(!1),mxEvent.consume(t)})),mxEvent.addListener(e,"blur",mxUtils.bind(this,function(t){this.blurEnabled&&this.focusLost(t)})),mxEvent.addListener(e,"keydown",mxUtils.bind(this,function(t){mxEvent.isConsumed(t)||(this.isStopEditingEvent(t)?(this.graph.stopEditing(!1),mxEvent.consume(t)):27==t.keyCode&&(this.graph.stopEditing(this.isCancelEditingKeyEvent(t)),mxEvent.consume(t)))}));var t=mxUtils.bind(this,function(t){null!=this.editingCell&&this.clearOnChange&&e.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||8!=t.keyCode&&46!=t.keyCode)&&(this.clearOnChange=!1,e.innerHTML="")});mxEvent.addListener(e,"keypress",t),mxEvent.addListener(e,"paste",t);var n=mxUtils.bind(this,function(t){null!=this.editingCell&&(0==this.textarea.innerHTML.length||"<br>"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length):this.clearOnChange=!1)});mxEvent.addListener(e,mxClient.IS_IE11||mxClient.IS_IE?"keyup":"input",n),mxEvent.addListener(e,"cut",n),mxEvent.addListener(e,"paste",n);t=mxClient.IS_IE11||mxClient.IS_IE?"keydown":"input",n=mxUtils.bind(this,function(t){null!=this.editingCell&&this.autoSize&&!mxEvent.isConsumed(t)&&(null!=this.resizeThread&&window.clearTimeout(this.resizeThread),this.resizeThread=window.setTimeout(mxUtils.bind(this,function(){this.resizeThread=null,this.resize()}),0))});mxEvent.addListener(e,t,n),mxEvent.addListener(window,"resize",n),9<=document.documentMode?(mxEvent.addListener(e,"DOMNodeRemoved",n),mxEvent.addListener(e,"DOMNodeInserted",n)):(mxEvent.addListener(e,"cut",n),mxEvent.addListener(e,"paste",n))},mxCellEditor.prototype.isStopEditingEvent=function(t){return 113==t.keyCode||this.graph.isEnterStopsCellEditing()&&13==t.keyCode&&!mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)},mxCellEditor.prototype.isEventSource=function(t){return mxEvent.getSource(t)==this.textarea},mxCellEditor.prototype.resize=function(){var t,e,n,i,l,s,o,r,a,h,d,u=this.graph.getView().getState(this.editingCell);null==u?this.stopEditing(!0):null!=this.textarea&&(l=this.graph.getModel().isEdge(u.cell),t=this.graph.getView().scale,a=null,this.autoSize&&"fill"!=u.style[mxConstants.STYLE_OVERFLOW]?(e=mxUtils.getValue(u.style,mxConstants.STYLE_LABEL_WIDTH,null),null==(a=null!=u.text&&null==this.align?u.text.margin:null)&&(a=mxUtils.getAlignmentAsPoint(this.align||mxUtils.getValue(u.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(u.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE))),l?(this.bounds=new mxRectangle(u.absoluteOffset.x,u.absoluteOffset.y,0,0),null!=e&&(d=(parseFloat(e)+2)*t,this.bounds.width=d,this.bounds.x+=a.x*d)):(h=mxRectangle.fromRectangle(u),o=mxUtils.getValue(u.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),r=mxUtils.getValue(u.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),h=null!=u.shape&&o==mxConstants.ALIGN_CENTER&&r==mxConstants.ALIGN_MIDDLE?u.shape.getLabelBounds(h):h,null!=e&&(h.width=parseFloat(e)*t),u.view.graph.cellRenderer.legacySpacing&&"width"==u.style[mxConstants.STYLE_OVERFLOW]||(s=parseInt(u.style[mxConstants.STYLE_SPACING]||2)*t,n=(parseInt(u.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*t+s,i=(parseInt(u.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*t+s,l=(parseInt(u.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*t+s,s=(parseInt(u.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*t+s,o=mxUtils.getValue(u.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),r=mxUtils.getValue(u.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),h=new mxRectangle(h.x+s,h.y+n,h.width-(o==mxConstants.ALIGN_CENTER&&null==e?s+i:0),h.height-(r==mxConstants.ALIGN_MIDDLE?n+l:0))),this.bounds=new mxRectangle(h.x+u.absoluteOffset.x,h.y+u.absoluteOffset.y,h.width,h.height)),this.graph.isWrapping(u.cell)&&(2<=this.bounds.width||2<=this.bounds.height)&&this.textarea.innerHTML!=this.getEmptyLabelText()?(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal",d=Math.round(this.bounds.width/(document.documentMode,t))+this.wordWrapPadding,"relative"!=this.textarea.style.position?(this.textarea.style.width=d+"px",this.textarea.scrollWidth>d&&(this.textarea.style.width=this.textarea.scrollWidth+"px")):this.textarea.style.maxWidth=d+"px"):(this.textarea.style.whiteSpace="nowrap",this.textarea.style.width=""),8==document.documentMode&&(this.textarea.style.zoom="1",this.textarea.style.height="auto"),h=this.textarea.scrollWidth,d=this.textarea.scrollHeight,8==document.documentMode?(this.textarea.style.left=Math.max(0,Math.ceil((this.bounds.x-a.x*(this.bounds.width-(h+1)*t)+h*(t-1)*0+2*(a.x+.5))/t))+"px",this.textarea.style.top=Math.max(0,Math.ceil((this.bounds.y-a.y*(this.bounds.height-(d+.5)*t)+d*(t-1)*0+ +Math.abs(a.y+.5))/t))+"px",this.textarea.style.width=Math.round(h*t)+"px",this.textarea.style.height=Math.round(d*t)+"px"):mxClient.IS_QUIRKS?(this.textarea.style.left=Math.max(0,Math.ceil(this.bounds.x-a.x*(this.bounds.width-(h+1)*t)+h*(t-1)*0+2*(a.x+.5)))+"px",this.textarea.style.top=Math.max(0,Math.ceil(this.bounds.y-a.y*(this.bounds.height-(d+.5)*t)+d*(t-1)*0+ +Math.abs(a.y+.5)))+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-a.x*(this.bounds.width-2))+1)+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-a.y*(this.bounds.height-4)+(-1==a.y?3:0))+1)+"px")):(this.bounds=this.getEditorBounds(u),this.textarea.style.width=Math.round(this.bounds.width/t)+"px",this.textarea.style.height=Math.round(this.bounds.height/t)+"px",8==document.documentMode||mxClient.IS_QUIRKS?(this.textarea.style.left=Math.round(this.bounds.x)+"px",this.textarea.style.top=Math.round(this.bounds.y)+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x+1))+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y+1))+"px"),this.graph.isWrapping(u.cell)&&(2<=this.bounds.width||2<=this.bounds.height)&&this.textarea.innerHTML!=this.getEmptyLabelText()?(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal","fill"!=u.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=Math.round(this.bounds.width/t)+this.wordWrapPadding+"px")):(this.textarea.style.whiteSpace="nowrap","fill"!=u.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=""))),mxClient.IS_VML?this.textarea.style.zoom=t:(mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px"),mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+t+","+t+")"+(null==a?"":" translate("+100*a.x+"%,"+100*a.y+"%)"))))},mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())},mxCellEditor.prototype.getBackgroundColor=function(t){return null},mxCellEditor.prototype.isLegacyEditor=function(){if(mxClient.IS_VML)return!0;var t,e=!1;return mxClient.IS_SVG&&(null==(t=this.graph.view.getDrawPane().ownerSVGElement)||null!=(t=mxUtils.getCurrentStyle(t))&&(e="absolute"==t.position)),!e},mxCellEditor.prototype.startEditing=function(t,e){this.stopEditing(!0),(this.align=null)==this.textarea&&this.init(),null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.hideTooltip();var n=this.graph.getView().getState(t);if(null!=n){this.graph.getView().scale;var i=mxUtils.getValue(n.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),l=mxUtils.getValue(n.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),s=mxUtils.getValue(n.style,mxConstants.STYLE_FONTCOLOR,"black"),o=mxUtils.getValue(n.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),r=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,a=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,h=[];(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&h.push("underline"),(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&h.push("line-through"),this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(i*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT,this.textarea.style.backgroundColor=this.getBackgroundColor(n),this.textarea.style.textDecoration=h.join(" "),this.textarea.style.fontWeight=r?"bold":"normal",this.textarea.style.fontStyle=a?"italic":"",this.textarea.style.fontSize=Math.round(i)+"px",this.textarea.style.zIndex=this.zIndex,this.textarea.style.fontFamily=l,this.textarea.style.textAlign=o,this.textarea.style.outline="none",this.textarea.style.color=s;s=this.textDirection=mxUtils.getValue(n.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);s==mxConstants.TEXT_DIRECTION_AUTO&&(null==n||null==n.text||n.text.dialect==mxConstants.DIALECT_STRICTHTML||mxUtils.isNode(n.text.value)||(s=n.text.getAutoDirection())),s==mxConstants.TEXT_DIRECTION_LTR||s==mxConstants.TEXT_DIRECTION_RTL?this.textarea.setAttribute("dir",s):this.textarea.removeAttribute("dir"),this.textarea.innerHTML=this.getInitialValue(n,e)||"",this.initialValue=this.textarea.innerHTML,0==this.textarea.innerHTML.length||"<br>"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=!0):this.clearOnChange=this.textarea.innerHTML==this.getEmptyLabelText(),this.graph.container.appendChild(this.textarea),this.editingCell=t,this.trigger=e,(this.textNode=null)!=n.text&&this.isHideLabel(n)&&(this.textNode=n.text.node,this.textNode.style.visibility="hidden"),this.autoSize&&(this.graph.model.isEdge(n.cell)||"fill"!=n.style[mxConstants.STYLE_OVERFLOW])&&window.setTimeout(mxUtils.bind(this,function(){this.resize()}),0),this.resize();try{this.textarea.focus(),this.isSelectText()&&0<this.textarea.innerHTML.length&&(this.textarea.innerHTML!=this.getEmptyLabelText()||!this.clearOnChange)&&document.execCommand("selectAll",!1,null)}catch(t){}}},mxCellEditor.prototype.isSelectText=function(){return this.selectText},mxCellEditor.prototype.clearSelection=function(){var t=null;window.getSelection?t=window.getSelection():document.selection&&(t=document.selection),null!=t&&(t.empty?t.empty():t.removeAllRanges&&t.removeAllRanges())},mxCellEditor.prototype.stopEditing=function(t){if(t=t||!1,null!=this.editingCell){null!=this.textNode&&(this.textNode.style.visibility="visible",this.textNode=null);var e=t?null:this.graph.view.getState(this.editingCell),t=this.initialValue;if(this.initialValue=null,this.editingCell=null,this.trigger=null,this.bounds=null,this.textarea.blur(),this.clearSelection(),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.textarea.innerHTML="",this.clearOnChange=!1),null!=e&&(this.textarea.innerHTML!=t||null!=this.align)){this.prepareTextarea();var n=this.getCurrentValue(e);this.graph.getModel().beginUpdate();try{null!=n&&this.applyValue(e,n),null!=this.align&&this.graph.setCellStyles(mxConstants.STYLE_ALIGN,this.align,[e.cell])}finally{this.graph.getModel().endUpdate()}}mxEvent.release(this.textarea),this.textarea=null,this.align=null}},mxCellEditor.prototype.prepareTextarea=function(){null!=this.textarea.lastChild&&"BR"==this.textarea.lastChild.nodeName&&this.textarea.removeChild(this.textarea.lastChild)},mxCellEditor.prototype.isHideLabel=function(t){return!0},mxCellEditor.prototype.getMinimumSize=function(t){var e=this.graph.getView().scale;return new mxRectangle(0,0,null==t.text?30:t.text.size*e+20,"left"==this.textarea.style.textAlign?120:40)},mxCellEditor.prototype.getEditorBounds=function(t){var e,n,i,l=this.graph.getModel().isEdge(t.cell),s=this.graph.getView().scale,o=this.getMinimumSize(t),r=o.width,a=o.height,h=null;return!l&&t.view.graph.cellRenderer.legacySpacing&&"fill"==t.style[mxConstants.STYLE_OVERFLOW]?h=t.shape.getLabelBounds(mxRectangle.fromRectangle(t)):(n=parseInt(t.style[mxConstants.STYLE_SPACING]||0)*s,e=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*s+n,i=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*s+n,o=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*s+n,n=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*s+n,h=new mxRectangle(t.x,t.y,Math.max(r,t.width-n-i),Math.max(a,t.height-e-o)),i=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),o=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),h=null!=t.shape&&i==mxConstants.ALIGN_CENTER&&o==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(h):h,l?(h.x=t.absoluteOffset.x,h.y=t.absoluteOffset.y,null!=t.text&&null!=t.text.boundingBox&&(0<t.text.boundingBox.x&&(h.x=t.text.boundingBox.x),0<t.text.boundingBox.y&&(h.y=t.text.boundingBox.y))):null!=t.text&&null!=t.text.boundingBox&&(h.x=Math.min(h.x,t.text.boundingBox.x),h.y=Math.min(h.y,t.text.boundingBox.y)),h.x+=n,h.y+=e,null!=t.text&&null!=t.text.boundingBox&&(l?(h.width=Math.max(r,t.text.boundingBox.width),h.height=Math.max(a,t.text.boundingBox.height)):(h.width=Math.max(h.width,t.text.boundingBox.width),h.height=Math.max(h.height,t.text.boundingBox.height))),this.graph.getModel().isVertex(t.cell)&&((a=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER))==mxConstants.ALIGN_LEFT?h.x-=t.width:a==mxConstants.ALIGN_RIGHT&&(h.x+=t.width),(a=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))==mxConstants.ALIGN_TOP?h.y-=t.height:a==mxConstants.ALIGN_BOTTOM&&(h.y+=t.height))),new mxRectangle(Math.round(h.x),Math.round(h.y),Math.round(h.width),Math.round(h.height))},mxCellEditor.prototype.getEmptyLabelText=function(t){return this.emptyLabelText},mxCellEditor.prototype.getEditingCell=function(){return this.editingCell},mxCellEditor.prototype.destroy=function(){null!=this.textarea&&(mxEvent.release(this.textarea),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null),this.zoomHandler&&(this.graph.view.removeListener(this.zoomHandler),this.zoomHandler=null)},mxCellRenderer.defaultShapes=new Object,mxCellRenderer.prototype.defaultEdgeShape=mxConnector,mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape,mxCellRenderer.prototype.defaultTextShape=mxText,mxCellRenderer.prototype.legacyControlPosition=!0,mxCellRenderer.prototype.legacySpacing=!0,mxCellRenderer.prototype.antiAlias=!0,mxCellRenderer.prototype.minSvgStrokeWidth=1,mxCellRenderer.prototype.forceControlClickHandler=!1,mxCellRenderer.registerShape=function(t,e){mxCellRenderer.defaultShapes[t]=e},mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape),mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus),mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder),mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor),mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle),mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon),mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud),mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW_CONNECTOR,mxArrowConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane),mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape),mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel),mxCellRenderer.prototype.initializeShape=function(t){t.shape.dialect=t.view.graph.dialect,this.configureShape(t),t.shape.init(t.view.getDrawPane())},mxCellRenderer.prototype.createShape=function(t){var e,n=null;return null!=t.style&&(n=null!=(e=mxStencilRegistry.getStencil(t.style[mxConstants.STYLE_SHAPE]))?new mxShape(e):new(this.getShapeConstructor(t))),n},mxCellRenderer.prototype.createIndicatorShape=function(t){t.shape.indicatorShape=this.getShape(t.view.graph.getIndicatorShape(t))},mxCellRenderer.prototype.getShape=function(t){return null!=t?mxCellRenderer.defaultShapes[t]:null},mxCellRenderer.prototype.getShapeConstructor=function(t){var e=this.getShape(t.style[mxConstants.STYLE_SHAPE]);return null==e&&(e=t.view.graph.getModel().isEdge(t.cell)?this.defaultEdgeShape:this.defaultVertexShape),e},mxCellRenderer.prototype.configureShape=function(t){t.shape.apply(t),t.shape.image=t.view.graph.getImage(t),t.shape.indicatorColor=t.view.graph.getIndicatorColor(t),t.shape.indicatorStrokeColor=t.style[mxConstants.STYLE_INDICATOR_STROKECOLOR],t.shape.indicatorGradientColor=t.view.graph.getIndicatorGradientColor(t),t.shape.indicatorDirection=t.style[mxConstants.STYLE_INDICATOR_DIRECTION],t.shape.indicatorImage=t.view.graph.getIndicatorImage(t),this.postConfigureShape(t)},mxCellRenderer.prototype.postConfigureShape=function(t){null!=t.shape&&(this.resolveColor(t,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(t,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(t,"gradient",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(t,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(t,"fill",mxConstants.STYLE_FILLCOLOR))},mxCellRenderer.prototype.checkPlaceholderStyles=function(t){if(null!=t.style)for(var e=["inherit","swimlane","indicated"],n=[mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_FONTCOLOR],i=0;i<n.length;i++)if(0<=mxUtils.indexOf(e,t.style[n[i]]))return!0;return!1},mxCellRenderer.prototype.resolveColor=function(t,e,n){var i,l,s,o=n==mxConstants.STYLE_FONTCOLOR?t.text:t.shape;null!=o&&(l=t.view.graph,s=null,"inherit"==(i=o[e])?s=l.model.getParent(t.cell):"swimlane"==i?(o[e]=n==mxConstants.STYLE_STROKECOLOR||n==mxConstants.STYLE_FONTCOLOR?"#000000":"#ffffff",s=null!=l.model.getTerminal(t.cell,!1)?l.model.getTerminal(t.cell,!1):t.cell,s=l.getSwimlane(s),n=l.swimlaneIndicatorColorAttribute):"indicated"==i&&null!=t.shape?o[e]=t.shape.indicatorColor:n!=mxConstants.STYLE_FILLCOLOR&&i==mxConstants.STYLE_FILLCOLOR&&null!=t.shape?o[e]=t.style[mxConstants.STYLE_FILLCOLOR]:n!=mxConstants.STYLE_STROKECOLOR&&i==mxConstants.STYLE_STROKECOLOR&&null!=t.shape&&(o[e]=t.style[mxConstants.STYLE_STROKECOLOR]),null!=s&&(l=l.getView().getState(s),(o[e]=null)!=l&&(s=n==mxConstants.STYLE_FONTCOLOR?l.text:l.shape,o[e]=null!=s&&"indicatorColor"!=e?s[e]:l.style[n])))},mxCellRenderer.prototype.getLabelValue=function(t){return t.view.graph.getLabel(t.cell)},mxCellRenderer.prototype.createLabel=function(i,t){var e,l,n,s=i.view.graph;s.getModel().isEdge(i.cell);(0<i.style[mxConstants.STYLE_FONTSIZE]||null==i.style[mxConstants.STYLE_FONTSIZE])&&(e=s.isHtmlLabel(i.cell)||null!=t&&mxUtils.isNode(t),i.text=new this.defaultTextShape(t,new mxRectangle,i.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,s.getVerticalAlign(i),i.style[mxConstants.STYLE_FONTCOLOR],i.style[mxConstants.STYLE_FONTFAMILY],i.style[mxConstants.STYLE_FONTSIZE],i.style[mxConstants.STYLE_FONTSTYLE],i.style[mxConstants.STYLE_SPACING],i.style[mxConstants.STYLE_SPACING_TOP],i.style[mxConstants.STYLE_SPACING_RIGHT],i.style[mxConstants.STYLE_SPACING_BOTTOM],i.style[mxConstants.STYLE_SPACING_LEFT],i.style[mxConstants.STYLE_HORIZONTAL],i.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],i.style[mxConstants.STYLE_LABEL_BORDERCOLOR],s.isWrapping(i.cell)&&s.isHtmlLabel(i.cell),s.isLabelClipped(i.cell),i.style[mxConstants.STYLE_OVERFLOW],i.style[mxConstants.STYLE_LABEL_PADDING],mxUtils.getValue(i.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)),i.text.opacity=mxUtils.getValue(i.style,mxConstants.STYLE_TEXT_OPACITY,100),i.text.dialect=e?mxConstants.DIALECT_STRICTHTML:i.view.graph.dialect,i.text.style=i.style,i.text.state=i,this.initializeLabel(i,i.text),l=!1,n=function(t){var e,n=i;return(mxClient.IS_TOUCH||l)&&(e=mxEvent.getClientX(t),t=mxEvent.getClientY(t),t=mxUtils.convertPoint(s.container,e,t),n=s.view.getState(s.getCellAt(t.x,t.y))),n},mxEvent.addGestureListeners(i.text.node,mxUtils.bind(this,function(t){this.isLabelEvent(i,t)&&(s.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,i)),l=s.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(t).nodeName)}),mxUtils.bind(this,function(t){this.isLabelEvent(i,t)&&s.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,n(t)))}),mxUtils.bind(this,function(t){this.isLabelEvent(i,t)&&(s.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t,n(t))),l=!1)})),s.nativeDblClickEnabled&&mxEvent.addListener(i.text.node,"dblclick",mxUtils.bind(this,function(t){this.isLabelEvent(i,t)&&(s.dblClick(t,i.cell),mxEvent.consume(t))})))},mxCellRenderer.prototype.initializeLabel=function(t,e){mxClient.IS_SVG&&mxClient.NO_FO&&e.dialect!=mxConstants.DIALECT_SVG?e.init(t.view.graph.container):e.init(t.view.getDrawPane())},mxCellRenderer.prototype.createCellOverlays=function(t){var e=t.view.graph.getCellOverlays(t.cell),n=null;if(null!=e){n=new mxDictionary;for(var i=0;i<e.length;i++){var l,s=null!=t.overlays?t.overlays.remove(e[i]):null;null==s?((l=new mxImageShape(new mxRectangle,e[i].image.src)).dialect=t.view.graph.dialect,l.preserveImageAspect=!1,l.overlay=e[i],this.initializeOverlay(t,l),this.installCellOverlayListeners(t,e[i],l),null!=e[i].cursor&&(l.node.style.cursor=e[i].cursor),n.put(e[i],l)):n.put(e[i],s)}}null!=t.overlays&&t.overlays.visit(function(t,e){e.destroy()}),t.overlays=n},mxCellRenderer.prototype.initializeOverlay=function(t,e){e.init(t.view.getOverlayPane())},mxCellRenderer.prototype.installCellOverlayListeners=function(e,n,t){var i=e.view.graph;mxEvent.addListener(t.node,"click",function(t){i.isEditing()&&i.stopEditing(!i.isInvokesStopCellEditing()),n.fireEvent(new mxEventObject(mxEvent.CLICK,"event",t,"cell",e.cell))}),mxEvent.addGestureListeners(t.node,function(t){mxEvent.consume(t)},function(t){i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,e))}),mxClient.IS_TOUCH&&mxEvent.addListener(t.node,"touchend",function(t){n.fireEvent(new mxEventObject(mxEvent.CLICK,"event",t,"cell",e.cell))})},mxCellRenderer.prototype.createControl=function(t){var e,n=t.view.graph,i=n.getFoldingImage(t);n.foldingEnabled&&null!=i?null==t.control&&(e=new mxRectangle(0,0,i.width,i.height),t.control=new mxImageShape(e,i.src),t.control.preserveImageAspect=!1,t.control.dialect=n.dialect,this.initControl(t,t.control,!0,this.createControlClickHandler(t))):null!=t.control&&(t.control.destroy(),t.control=null)},mxCellRenderer.prototype.createControlClickHandler=function(n){var i=n.view.graph;return mxUtils.bind(this,function(t){var e;(this.forceControlClickHandler||i.isEnabled())&&(e=!i.isCellCollapsed(n.cell),i.foldCells(e,!1,[n.cell],null,t),mxEvent.consume(t))})},mxCellRenderer.prototype.initControl=function(e,t,n,i){var l=e.view.graph;l.isHtmlLabel(e.cell)&&mxClient.NO_FO&&l.dialect==mxConstants.DIALECT_SVG?(t.dialect=mxConstants.DIALECT_PREFERHTML,t.init(l.container),t.node.style.zIndex=1):t.init(e.view.getOverlayPane());var s,t=t.innerNode||t.node;return null==i||mxClient.IS_IOS||(l.isEnabled()&&(t.style.cursor="pointer"),mxEvent.addListener(t,"click",i)),n&&(s=null,mxEvent.addGestureListeners(t,function(t){s=new mxPoint(mxEvent.getClientX(t),mxEvent.getClientY(t)),l.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,e)),mxEvent.consume(t)},function(t){l.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,e))},function(t){l.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t,e)),mxEvent.consume(t)}),null!=i&&mxClient.IS_IOS&&t.addEventListener("touchend",function(t){var e;null!=s&&(e=l.tolerance,Math.abs(s.x-mxEvent.getClientX(t))<e&&Math.abs(s.y-mxEvent.getClientY(t))<e&&(i.call(i,t),mxEvent.consume(t)))},!0)),t},mxCellRenderer.prototype.isShapeEvent=function(t,e){return!0},mxCellRenderer.prototype.isLabelEvent=function(t,e){return!0},mxCellRenderer.prototype.installListeners=function(i){function e(t){var e,n=i;return(l.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(t).nodeName||mxClient.IS_TOUCH)&&(e=mxEvent.getClientX(t),t=mxEvent.getClientY(t),t=mxUtils.convertPoint(l.container,e,t),n=l.view.getState(l.getCellAt(t.x,t.y))),n}var l=i.view.graph;mxEvent.addGestureListeners(i.shape.node,mxUtils.bind(this,function(t){this.isShapeEvent(i,t)&&l.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,i))}),mxUtils.bind(this,function(t){this.isShapeEvent(i,t)&&l.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,e(t)))}),mxUtils.bind(this,function(t){this.isShapeEvent(i,t)&&l.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t,e(t)))})),l.nativeDblClickEnabled&&mxEvent.addListener(i.shape.node,"dblclick",mxUtils.bind(this,function(t){this.isShapeEvent(i,t)&&(l.dblClick(t,i.cell),mxEvent.consume(t))}))},mxCellRenderer.prototype.redrawLabel=function(t,e){var n,i=t.view.graph,l=this.getLabelValue(t),s=i.isWrapping(t.cell),o=i.isLabelClipped(t.cell),r=t.view.graph.isHtmlLabel(t.cell)||null!=l&&mxUtils.isNode(l)?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect,a=t.style[mxConstants.STYLE_OVERFLOW]||"visible";null==t.text||t.text.wrap==s&&t.text.clipped==o&&t.text.overflow==a&&t.text.dialect==r||(t.text.destroy(),t.text=null),null==t.text&&null!=l&&(mxUtils.isNode(l)||0<l.length)?this.createLabel(t,l):null==t.text||null!=l&&0!=l.length||(t.text.destroy(),t.text=null),null!=t.text&&(e&&(null!=t.text.lastValue&&this.isTextShapeInvalid(t,t.text)&&(t.text.lastValue=null),t.text.resetStyles(),t.text.apply(t),t.text.valign=i.getVerticalAlign(t)),n=this.getLabelBounds(t),i=this.getTextScale(t),this.resolveColor(t,"color",mxConstants.STYLE_FONTCOLOR),!e&&t.text.value==l&&t.text.isWrapping==s&&t.text.overflow==a&&t.text.isClipping==o&&t.text.scale==i&&t.text.dialect==r&&null!=t.text.bounds&&t.text.bounds.equals(n)||(t.text.dialect=r,t.text.value=l,t.text.bounds=n,t.text.scale=i,t.text.wrap=s,t.text.clipped=o,t.text.overflow=a,a=t.text.node.style.visibility,this.redrawLabelShape(t.text),t.text.node.style.visibility=a))},mxCellRenderer.prototype.isTextShapeInvalid=function(i,l){function t(t,e,n){return"spacingTop"==e||"spacingRight"==e||"spacingBottom"==e||"spacingLeft"==e?parseFloat(l[t])-parseFloat(l.spacing)!=(i.style[e]||n):l[t]!=(i.style[e]||n)}return t("fontStyle",mxConstants.STYLE_FONTSTYLE,mxConstants.DEFAULT_FONTSTYLE)||t("family",mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)||t("size",mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)||t("color",mxConstants.STYLE_FONTCOLOR,"black")||t("align",mxConstants.STYLE_ALIGN,"")||t("valign",mxConstants.STYLE_VERTICAL_ALIGN,"")||t("spacing",mxConstants.STYLE_SPACING,2)||t("spacingTop",mxConstants.STYLE_SPACING_TOP,0)||t("spacingRight",mxConstants.STYLE_SPACING_RIGHT,0)||t("spacingBottom",mxConstants.STYLE_SPACING_BOTTOM,0)||t("spacingLeft",mxConstants.STYLE_SPACING_LEFT,0)||t("horizontal",mxConstants.STYLE_HORIZONTAL,!0)||t("background",mxConstants.STYLE_LABEL_BACKGROUNDCOLOR)||t("border",mxConstants.STYLE_LABEL_BORDERCOLOR)||t("opacity",mxConstants.STYLE_TEXT_OPACITY,100)||t("textDirection",mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)},mxCellRenderer.prototype.redrawLabelShape=function(t){t.redraw()},mxCellRenderer.prototype.getTextScale=function(t){return t.view.scale},mxCellRenderer.prototype.getLabelBounds=function(t){var e,n,i=t.view.graph,l=t.view.scale,s=i.getModel().isEdge(t.cell),o=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y);s?(e=t.text.getSpacing(),o.x+=e.x*l,o.y+=e.y*l,null!=(e=i.getCellGeometry(t.cell))&&(o.width=Math.max(0,e.width*l),o.height=Math.max(0,e.height*l))):(t.text.isPaintBoundsInverted()&&(n=o.x,o.x=o.y,o.y=n),o.x+=t.x,o.y+=t.y,o.width=Math.max(1,t.width),o.height=Math.max(1,t.height)),t.text.isPaintBoundsInverted()&&(e=(t.width-t.height)/2,o.x+=e,o.y-=e,n=o.width,o.width=o.height,o.height=n),null!=t.shape&&(n=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),r=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),n==mxConstants.ALIGN_CENTER&&r==mxConstants.ALIGN_MIDDLE&&(o=t.shape.getLabelBounds(o)));var r=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);return null!=r&&(o.width=parseFloat(r)*l),s||this.rotateLabelBounds(t,o),o},mxCellRenderer.prototype.rotateLabelBounds=function(t,e){var n,i;e.y-=t.text.margin.y*e.height,e.x-=t.text.margin.x*e.width,this.legacySpacing&&("fill"==t.style[mxConstants.STYLE_OVERFLOW]||"width"==t.style[mxConstants.STYLE_OVERFLOW])||(l=t.view.scale,i=t.text.getSpacing(),e.x+=i.x*l,e.y+=i.y*l,n=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),s=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),i=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null),e.width=Math.max(0,e.width-(n==mxConstants.ALIGN_CENTER&&null==i?t.text.spacingLeft*l+t.text.spacingRight*l:0)),e.height=Math.max(0,e.height-(s==mxConstants.ALIGN_MIDDLE?t.text.spacingTop*l+t.text.spacingBottom*l:0)));var l,s=t.text.getTextRotation();0!=s&&null!=t&&t.view.graph.model.isVertex(t.cell)&&(l=t.getCenterX(),t=t.getCenterY(),e.x==l&&e.y==t||(s=s*(Math.PI/180),t=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(s),Math.sin(s),new mxPoint(l,t)),e.x=t.x,e.y=t.y))},mxCellRenderer.prototype.redrawCellOverlays=function(o,r){var a,t,h,d;this.createCellOverlays(o),null!=o.overlays&&(a=mxUtils.mod(mxUtils.getValue(o.style,mxConstants.STYLE_ROTATION,0),90),t=mxUtils.toRadians(a),h=Math.cos(t),d=Math.sin(t),o.overlays.visit(function(t,e){var n,i,l,s=e.overlay.getBounds(o);o.view.graph.getModel().isEdge(o.cell)||null!=o.shape&&0!=a&&(i=s.getCenterX(),l=s.getCenterY(),i=(n=mxUtils.getRotatedPoint(new mxPoint(i,l),h,d,new mxPoint(o.getCenterX(),o.getCenterY()))).x,l=n.y,s.x=Math.round(i-s.width/2),s.y=Math.round(l-s.height/2)),!r&&null!=e.bounds&&e.scale==o.view.scale&&e.bounds.equals(s)||(e.bounds=s,e.scale=o.view.scale,e.redraw())}))},mxCellRenderer.prototype.redrawControl=function(t,e){var n,i,l=t.view.graph.getFoldingImage(t);null!=t.control&&null!=l&&(n=this.getControlBounds(t,l.width,l.height),i=this.legacyControlPosition?mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0):t.shape.getTextRotation(),l=t.view.scale,!e&&t.control.scale==l&&t.control.bounds.equals(n)&&t.control.rotation==i||(t.control.rotation=i,t.control.bounds=n,t.control.scale=l,t.control.redraw()))},mxCellRenderer.prototype.getControlBounds=function(t,e,n){if(null==t.control)return null;var i,l,s=t.view.scale,o=t.getCenterX(),r=t.getCenterY();return t.view.graph.getModel().isEdge(t.cell)||(o=t.x+e*s,r=t.y+n*s,null!=t.shape&&(i=t.shape.getShapeRotation(),this.legacyControlPosition?i=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0):t.shape.isPaintBoundsInverted()&&(o+=l=(t.width-t.height)/2,r-=l),0!=i&&(l=mxUtils.toRadians(i),i=Math.cos(l),l=Math.sin(l),o=(l=mxUtils.getRotatedPoint(new mxPoint(o,r),i,l,new mxPoint(t.getCenterX(),t.getCenterY()))).x,r=l.y))),t.view.graph.getModel().isEdge(t.cell),new mxRectangle(Math.round(o-e/2*s),Math.round(r-n/2*s),Math.round(e*s),Math.round(n*s))},mxCellRenderer.prototype.insertStateAfter=function(t,e,n){for(var i=this.getShapesForState(t),l=0;l<i.length;l++)if(null!=i[l]&&null!=i[l].node){var s=i[l].node.parentNode!=t.view.getDrawPane()&&i[l].node.parentNode!=t.view.getOverlayPane(),o=s?n:e;if(null!=o&&o.nextSibling!=i[l].node)null==o.nextSibling?o.parentNode.appendChild(i[l].node):o.parentNode.insertBefore(i[l].node,o.nextSibling);else if(null==o)if(i[l].node.parentNode==t.view.graph.container){for(var r=t.view.canvas;null!=r&&r.parentNode!=t.view.graph.container;)r=r.parentNode;null!=r&&null!=r.nextSibling?r.nextSibling!=i[l].node&&i[l].node.parentNode.insertBefore(i[l].node,r.nextSibling):i[l].node.parentNode.appendChild(i[l].node)}else null!=i[l].node.parentNode&&null!=i[l].node.parentNode.firstChild&&i[l].node.parentNode.firstChild!=i[l].node&&i[l].node.parentNode.insertBefore(i[l].node,i[l].node.parentNode.firstChild);s?n=i[l].node:e=i[l].node}return[e,n]},mxCellRenderer.prototype.getShapesForState=function(t){return[t.shape,t.text,t.control]},mxCellRenderer.prototype.redraw=function(t,e,n){e=this.redrawShape(t,e,n);null==t.shape||null!=n&&!n||(this.redrawLabel(t,e),this.redrawCellOverlays(t,e),this.redrawControl(t,e))},mxCellRenderer.prototype.redrawShape=function(t,e,n){var i=t.view.graph.model,l=!1;return null!=t.shape&&null!=t.shape.style&&null!=t.style&&t.shape.style[mxConstants.STYLE_SHAPE]!=t.style[mxConstants.STYLE_SHAPE]&&(t.shape.destroy(),t.shape=null),null==t.shape&&null!=t.view.graph.container&&t.cell!=t.view.currentRoot&&(i.isVertex(t.cell)||i.isEdge(t.cell))?(t.shape=this.createShape(t),null!=t.shape&&(t.shape.minSvgStrokeWidth=this.minSvgStrokeWidth,t.shape.antiAlias=this.antiAlias,this.createIndicatorShape(t),this.initializeShape(t),this.createCellOverlays(t),this.installListeners(t),t.view.graph.selectionCellsHandler.updateHandler(t))):e||null==t.shape||mxUtils.equalEntries(t.shape.style,t.style)&&!this.checkPlaceholderStyles(t)||(t.shape.resetStyles(),this.configureShape(t),t.view.graph.selectionCellsHandler.updateHandler(t),e=!0),null!=t.shape&&t.shape.indicatorShape!=this.getShape(t.view.graph.getIndicatorShape(t))&&(null!=t.shape.indicator&&(t.shape.indicator.destroy(),t.shape.indicator=null),this.createIndicatorShape(t),null!=t.shape.indicatorShape&&(t.shape.indicator=new t.shape.indicatorShape,t.shape.indicator.dialect=t.shape.dialect,t.shape.indicator.init(t.node),e=!0)),null!=t.shape&&(this.createControl(t),(e||this.isShapeInvalid(t,t.shape))&&(null!=t.absolutePoints?(t.shape.points=t.absolutePoints.slice(),t.shape.bounds=null):(t.shape.points=null,t.shape.bounds=new mxRectangle(t.x,t.y,t.width,t.height)),t.shape.scale=t.view.scale,null==n||n?this.doRedrawShape(t):t.shape.updateBoundingBox(),l=!0)),l},mxCellRenderer.prototype.doRedrawShape=function(t){t.shape.redraw()},mxCellRenderer.prototype.isShapeInvalid=function(t,e){return null==e.bounds||e.scale!=t.view.scale||null==t.absolutePoints&&!e.bounds.equals(t)||null!=t.absolutePoints&&!mxUtils.equalPoints(e.points,t.absolutePoints)},mxCellRenderer.prototype.destroy=function(t){null!=t.shape&&(null!=t.text&&(t.text.destroy(),t.text=null),null!=t.overlays&&(t.overlays.visit(function(t,e){e.destroy()}),t.overlays=null),null!=t.control&&(t.control.destroy(),t.control=null),t.shape.destroy(),t.shape=null)};var mxEdgeStyle={EntityRelation:function(t,e,n,i,l){var s=t.view,o=s.graph,r=mxUtils.getValue(t.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*s.scale,a=t.absolutePoints,h=a[0],d=a[a.length-1],a=!1;if(null!=e&&((p=o.getCellGeometry(e.cell)).relative?a=p.x<=.5:null!=n&&(a=(null!=d?d.x:n.x+n.width)<(null!=h?h:e).x)),null!=h)(e=new mxCellState).x=h.x,e.y=h.y;else{if(null==e)return;(u=mxUtils.getPortConstraints(e,t,!0,mxConstants.DIRECTION_MASK_NONE))!=mxConstants.DIRECTION_MASK_NONE&&u!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(a=u==mxConstants.DIRECTION_MASK_WEST)}var u,p=!0;null!=n&&((o=o.getCellGeometry(n.cell)).relative?p=o.x<=.5:null!=e&&(p=(null!=h?h.x:e.x+e.width)<(null!=d?d:n).x)),null!=d?((n=new mxCellState).x=d.x,n.y=d.y):null!=n&&(u=mxUtils.getPortConstraints(n,t,!1,mxConstants.DIRECTION_MASK_NONE))!=mxConstants.DIRECTION_MASK_NONE&&u!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(p=u==mxConstants.DIRECTION_MASK_WEST),null!=e&&null!=n&&(d=a?e.x:e.x+e.width,t=s.getRoutingCenterY(e),u=p?n.x:n.x+n.width,e=s.getRoutingCenterY(n),s=r,n=new mxPoint(d+(a?-s:s),t),s=new mxPoint(u+(p?-s:s),e),a==p?(r=a?Math.min(d,u)-r:Math.max(d,u)+r,l.push(new mxPoint(r,t)),l.push(new mxPoint(r,e))):(n.x<s.x==a?(t=t+(e-t)/2,l.push(n),l.push(new mxPoint(n.x,t)),l.push(new mxPoint(s.x,t))):l.push(n),l.push(s)))},Loop:function(t,e,n,i,l){var s,o,r,a,h=t.absolutePoints,d=h[0],u=h[h.length-1];if(null==d||null==u)null!=e&&(a=(s=t.view).graph,null!=(m=null!=i&&0<i.length?i[0]:null)&&(m=s.transformControlPoint(t,m),mxUtils.contains(e,m.x,m.y)&&(m=null)),d=h=r=o=0,u=mxUtils.getValue(t.style,mxConstants.STYLE_SEGMENT,a.gridSize)*s.scale,(a=mxUtils.getValue(t.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST))==mxConstants.DIRECTION_NORTH||a==mxConstants.DIRECTION_SOUTH?(o=s.getRoutingCenterX(e),r=u):(h=s.getRoutingCenterY(e),d=u),null==m||m.x<e.x||m.x>e.x+e.width?null!=m?(o=m.x,d=Math.max(Math.abs(h-m.y),d)):a==mxConstants.DIRECTION_NORTH?h=e.y-2*r:a==mxConstants.DIRECTION_SOUTH?h=e.y+e.height+2*r:o=a==mxConstants.DIRECTION_EAST?e.x-2*d:e.x+e.width+2*d:null!=m&&(o=s.getRoutingCenterX(e),r=Math.max(Math.abs(o-m.x),d),h=m.y,d=0),l.push(new mxPoint(o-r,h-d)),l.push(new mxPoint(o+r,h+d)));else if(null!=i&&0<i.length)for(var p=0;p<i.length;p++){var m=i[p];m=t.view.transformControlPoint(t,m),l.push(new mxPoint(m.x,m.y))}},ElbowConnector:function(t,e,n,i,l){var s,o,r,a,h=null!=i&&0<i.length?i[0]:null,d=!1,u=!1;null!=e&&null!=n&&(null!=h?(s=Math.min(e.x,n.x),o=Math.max(e.x+e.width,n.x+n.width),r=Math.min(e.y,n.y),a=Math.max(e.y+e.height,n.y+n.height),d=(h=t.view.transformControlPoint(t,h)).y<r||h.y>a,u=h.x<s||h.x>o):(d=(s=Math.max(e.x,n.x))==(o=Math.min(e.x+e.width,n.x+n.width)))||(u=(r=Math.max(e.y,n.y))==(a=Math.min(e.y+e.height,n.y+n.height)))),u||!d&&t.style[mxConstants.STYLE_ELBOW]!=mxConstants.ELBOW_VERTICAL?mxEdgeStyle.SideToSide(t,e,n,i,l):mxEdgeStyle.TopToBottom(t,e,n,i,l)},SideToSide:function(t,e,n,i,l){var s=t.view,o=null!=i&&0<i.length?i[0]:null,r=t.absolutePoints,i=r[0],r=r[r.length-1];null!=o&&(o=s.transformControlPoint(t,o)),null!=i&&((e=new mxCellState).x=i.x,e.y=i.y),null!=r&&((n=new mxCellState).x=r.x,n.y=r.y),null!=e&&null!=n&&(i=Math.max(e.x,n.x),r=Math.min(e.x+e.width,n.x+n.width),i=null!=o?o.x:Math.round(r+(i-r)/2),r=s.getRoutingCenterY(e),s=s.getRoutingCenterY(n),null!=o&&(o.y>=e.y&&o.y<=e.y+e.height&&(r=o.y),o.y>=n.y&&o.y<=n.y+n.height&&(s=o.y)),mxUtils.contains(n,i,r)||mxUtils.contains(e,i,r)||l.push(new mxPoint(i,r)),mxUtils.contains(n,i,s)||mxUtils.contains(e,i,s)||l.push(new mxPoint(i,s)),1==l.length&&(null!=o?mxUtils.contains(n,i,o.y)||mxUtils.contains(e,i,o.y)||l.push(new mxPoint(i,o.y)):(o=Math.max(e.y,n.y),n=Math.min(e.y+e.height,n.y+n.height),l.push(new mxPoint(i,o+(n-o)/2)))))},TopToBottom:function(t,e,n,i,l){var s=t.view,o=null!=i&&0<i.length?i[0]:null,r=t.absolutePoints,i=r[0],r=r[r.length-1];null!=o&&(o=s.transformControlPoint(t,o)),null!=i&&((e=new mxCellState).x=i.x,e.y=i.y),null!=r&&((n=new mxCellState).x=r.x,n.y=r.y),null!=e&&null!=n&&(t=Math.max(e.y,n.y),i=Math.min(e.y+e.height,n.y+n.height),r=s.getRoutingCenterX(e),null!=o&&o.x>=e.x&&o.x<=e.x+e.width&&(r=o.x),i=null!=o?o.y:Math.round(i+(t-i)/2),mxUtils.contains(n,r,i)||mxUtils.contains(e,r,i)||l.push(new mxPoint(r,i)),r=null!=o&&o.x>=n.x&&o.x<=n.x+n.width?o.x:s.getRoutingCenterX(n),mxUtils.contains(n,r,i)||mxUtils.contains(e,r,i)||l.push(new mxPoint(r,i)),1==l.length&&(null!=o&&1==l.length?mxUtils.contains(n,o.x,i)||mxUtils.contains(e,o.x,i)||l.push(new mxPoint(o.x,i)):(o=Math.max(e.x,n.x),n=Math.min(e.x+e.width,n.x+n.width),l.push(new mxPoint(o+(n-o)/2,i)))))},SegmentConnector:function(e,t,n,i,l){var s=mxEdgeStyle.scalePointArray(e.absolutePoints,e.view.scale),o=mxEdgeStyle.scaleCellState(t,e.view.scale),r=mxEdgeStyle.scaleCellState(n,e.view.scale),a=0<l.length?l[0]:null,h=!0,d=null;function u(t){return t.x=Math.round(t.x*e.view.scale*10)/10,t.y=Math.round(t.y*e.view.scale*10)/10,(null==a||1<=Math.abs(a.x-t.x)||Math.abs(a.y-t.y)>=Math.max(1,e.view.scale))&&(l.push(t),a=t),a}var p=s[0];null==p&&null!=o?p=new mxPoint(e.view.getRoutingCenterX(o),e.view.getRoutingCenterY(o)):null!=p&&(p=p.clone());var m=s.length-1;if(null!=i&&0<i.length){for(var c=[],g=0;g<i.length;g++){var x=e.view.transformControlPoint(e,i[g],!0);null!=x&&c.push(x)}if(0==c.length)return;null!=p&&null!=c[0]&&(Math.abs(c[0].x-p.x)<1&&(c[0].x=p.x),Math.abs(c[0].y-p.y)<1&&(c[0].y=p.y));var y=s[m];null!=y&&null!=c[c.length-1]&&(Math.abs(c[c.length-1].x-y.x)<1&&(c[c.length-1].x=y.x),Math.abs(c[c.length-1].y-y.y)<1&&(c[c.length-1].y=y.y)),d=c[0];var f=o,C=s[0],v=d;null!=C&&(f=null);for(g=0;g<2;g++){var E=null!=C&&C.x==v.x,S=null!=C&&C.y==v.y,w=null!=f&&v.y>=f.y&&v.y<=f.y+f.height,b=null!=f&&v.x>=f.x&&v.x<=f.x+f.width,T=S||null==C&&w,A=E||null==C&&b;if(0!=g||!(T&&A||E&&S)){if(null!=C&&!S&&!E&&(w||b)){h=!w;break}if(A||T){h=T,1==g&&(h=c.length%2==0?T:A);break}}f=r,null!=(C=s[m])&&(f=null),v=c[c.length-1],E&&S&&(c=c.slice(1))}h&&(null!=s[0]&&s[0].y!=d.y||null==s[0]&&null!=o&&(d.y<o.y||d.y>o.y+o.height))?u(new mxPoint(p.x,d.y)):!h&&(null!=s[0]&&s[0].x!=d.x||null==s[0]&&null!=o&&(d.x<o.x||d.x>o.x+o.width))&&u(new mxPoint(d.x,p.y)),h?p.y=d.y:p.x=d.x;for(g=0;g<c.length;g++)h=!h,d=c[g],h?p.y=d.y:p.x=d.x,u(p.clone())}else d=p,h=!0;if(null==(p=s[m])&&null!=r&&(p=new mxPoint(e.view.getRoutingCenterX(r),e.view.getRoutingCenterY(r))),null!=p&&null!=d&&(h&&(null!=s[m]&&s[m].y!=d.y||null==s[m]&&null!=r&&(d.y<r.y||d.y>r.y+r.height))?u(new mxPoint(p.x,d.y)):!h&&(null!=s[m]&&s[m].x!=d.x||null==s[m]&&null!=r&&(d.x<r.x||d.x>r.x+r.width))&&u(new mxPoint(d.x,p.y))),null==s[0]&&null!=o)for(;1<l.length&&null!=l[1]&&mxUtils.contains(o,l[1].x,l[1].y);)l.splice(1,1);if(null==s[m]&&null!=r)for(;1<l.length&&null!=l[l.length-1]&&mxUtils.contains(r,l[l.length-1].x,l[l.length-1].y);)l.splice(l.length-1,1);null!=y&&null!=l[l.length-1]&&Math.abs(y.x-l[l.length-1].x)<=1&&Math.abs(y.y-l[l.length-1].y)<=1&&(l.splice(l.length-1,1),null!=l[l.length-1]&&(Math.abs(l[l.length-1].x-y.x)<1&&(l[l.length-1].x=y.x),Math.abs(l[l.length-1].y-y.y)<1&&(l[l.length-1].y=y.y)))},orthBuffer:10,orthPointsFallback:!0,dirVectors:[[-1,0],[0,-1],[1,0],[0,1],[-1,0],[0,-1],[1,0]],wayPoints1:[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],routePatterns:[[[513,2308,2081,2562],[513,1090,514,2184,2114,2561],[513,1090,514,2564,2184,2562],[513,2308,2561,1090,514,2568,2308]],[[514,1057,513,2308,2081,2562],[514,2184,2114,2561],[514,2184,2562,1057,513,2564,2184],[514,1057,513,2568,2308,2561]],[[1090,514,1057,513,2308,2081,2562],[2114,2561],[1090,2562,1057,513,2564,2184],[1090,514,1057,513,2308,2561,2568]],[[2081,2562],[1057,513,1090,514,2184,2114,2561],[1057,513,1090,514,2184,2562,2564],[1057,2561,1090,514,2568,2308]]],inlineRoutePatterns:[[null,[2114,2568],null,null],[null,[514,2081,2114,2568],null,null],[null,[2114,2561],null,null],[[2081,2562],[1057,2114,2568],[2184,2562],null]],vertexSeperations:[],limits:[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],LEFT_MASK:32,TOP_MASK:64,RIGHT_MASK:128,BOTTOM_MASK:256,LEFT:1,TOP:2,RIGHT:4,BOTTOM:8,SIDE_MASK:480,CENTER_MASK:512,SOURCE_MASK:1024,TARGET_MASK:2048,VERTEX_MASK:3072,getJettySize:function(t,e){var n=mxUtils.getValue(t.style,e?mxConstants.STYLE_SOURCE_JETTY_SIZE:mxConstants.STYLE_TARGET_JETTY_SIZE,mxUtils.getValue(t.style,mxConstants.STYLE_JETTY_SIZE,mxEdgeStyle.orthBuffer));return"auto"==n&&(n=mxUtils.getValue(t.style,e?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE?(e=mxUtils.getNumber(t.style,e?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE),Math.max(2,Math.ceil((e+mxEdgeStyle.orthBuffer)/mxEdgeStyle.orthBuffer))*mxEdgeStyle.orthBuffer):2*mxEdgeStyle.orthBuffer),n},scalePointArray:function(t,e){var n=[];if(null!=t)for(var i,l=0;l<t.length;l++)null!=t[l]?(i=new mxPoint(Math.round(t[l].x/e*10)/10,Math.round(t[l].y/e*10)/10),n[l]=i):n[l]=null;else n=null;return n},scaleCellState:function(t,e){var n=null;return null!=t?(n=t.clone()).setRect(Math.round(t.x/e*10)/10,Math.round(t.y/e*10)/10,Math.round(t.width/e*10)/10,Math.round(t.height/e*10)/10):n=null,n},OrthConnector:function(t,e,n,i,l){var s=t.view.graph,o=null!=h&&s.getModel().isEdge(h.cell),r=null!=d&&s.getModel().isEdge(d.cell),a=mxEdgeStyle.scalePointArray(t.absolutePoints,t.view.scale),h=mxEdgeStyle.scaleCellState(e,t.view.scale),d=mxEdgeStyle.scaleCellState(n,t.view.scale),u=a[0],p=a[a.length-1],m=(null!=h?h:u).x,c=(null!=h?h:u).y,g=null!=h?h.width:0,x=null!=h?h.height:0,y=(null!=d?d:p).x,f=(null!=d?d:p).y,C=null!=d?d.width:0,v=null!=d?d.height:0,E=mxEdgeStyle.getJettySize(t,!0),S=mxEdgeStyle.getJettySize(t,!1);null!=h&&d==h&&(E=S=Math.max(E,S));s=S+E,a=!1;if(null!=u&&null!=p&&(a=(U=p.x-u.x)*U+(M=p.y-u.y)*M<s*s),a||mxEdgeStyle.orthPointsFallback&&null!=i&&0<i.length||o||r)mxEdgeStyle.SegmentConnector(t,e,n,i,l);else{var w,b=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL],i=0;null!=h&&(b[0]=mxUtils.getPortConstraints(h,t,!0,mxConstants.DIRECTION_MASK_ALL),0!=(i=mxUtils.getValue(h.style,mxConstants.STYLE_ROTATION,0))&&(m=(w=mxUtils.getBoundingBox(new mxRectangle(m,c,g,x),i)).x,c=w.y,g=w.width,x=w.height)),null!=d&&(b[1]=mxUtils.getPortConstraints(d,t,!1,mxConstants.DIRECTION_MASK_ALL),0!=(i=mxUtils.getValue(d.style,mxConstants.STYLE_ROTATION,0))&&(y=(w=mxUtils.getBoundingBox(new mxRectangle(y,f,C,v),i)).x,f=w.y,C=w.width,v=w.height));for(var T=[0,0],A=[[m,c,g,x],[y,f,C,v]],L=[E,S],I=0;I<2;I++)mxEdgeStyle.limits[I][1]=A[I][0]-L[I],mxEdgeStyle.limits[I][2]=A[I][1]-L[I],mxEdgeStyle.limits[I][4]=A[I][0]+A[I][2]+L[I],mxEdgeStyle.limits[I][8]=A[I][1]+A[I][3]+L[I];var C=A[0][0]+A[0][2]/2,v=A[0][1]+A[0][3]/2,S=A[1][0]+A[1][2]/2,M=v-(A[1][1]+A[1][3]/2),R=0;(U=C-S)<0?R=M<0?2:1:M<=0&&(R=0==U?2:3);var P=null;null!=h&&(P=u);for(var O=[[.5,.5],[.5,.5]],I=0;I<2;I++)null!=P&&(O[I][0]=(P.x-A[I][0])/A[I][2],Math.abs(P.x-A[I][0])<=1?T[I]=mxConstants.DIRECTION_MASK_WEST:Math.abs(P.x-A[I][0]-A[I][2])<=1&&(T[I]=mxConstants.DIRECTION_MASK_EAST),O[I][1]=(P.y-A[I][1])/A[I][3],Math.abs(P.y-A[I][1])<=1?T[I]=mxConstants.DIRECTION_MASK_NORTH:Math.abs(P.y-A[I][1]-A[I][3])<=1&&(T[I]=mxConstants.DIRECTION_MASK_SOUTH)),(P=null)!=d&&(P=p);var M=A[0][1]-(A[1][1]+A[1][3]),U=A[0][0]-(A[1][0]+A[1][2]),h=A[1][1]-(A[0][1]+A[0][3]),u=A[1][0]-(A[0][0]+A[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(U-s,0),mxEdgeStyle.vertexSeperations[2]=Math.max(M-s,0),mxEdgeStyle.vertexSeperations[4]=Math.max(h-s,0),mxEdgeStyle.vertexSeperations[3]=Math.max(u-s,0);var N=[],H=[],_=[];H[0]=u<=U?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST,_[0]=h<=M?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH,H[1]=mxUtils.reversePortConstraints(H[0]),_[1]=mxUtils.reversePortConstraints(_[0]);for(var u=u<=U?U:u,M=h<=M?M:h,D=[[0,0],[0,0]],h=!1,I=0;I<2;I++)0==T[I]&&(0==(H[I]&b[I])&&(H[I]=mxUtils.reversePortConstraints(H[I])),0==(_[I]&b[I])&&(_[I]=mxUtils.reversePortConstraints(_[I])),D[I][0]=_[I],D[I][1]=H[I]);0<M&&0<u&&(0<(H[0]&b[0])&&0<(_[1]&b[1])?(D[0][0]=H[0],D[0][1]=_[0],D[1][0]=_[1],D[1][1]=H[1],h=!0):0<(_[0]&b[0])&&0<(H[1]&b[1])&&(D[0][0]=_[0],D[0][1]=H[0],D[1][0]=H[1],D[1][1]=_[1],h=!0)),0<M&&!h&&(D[0][0]=_[0],D[0][1]=H[0],D[1][0]=_[1],D[1][1]=H[1],h=!0),0<u&&!h&&(D[0][0]=H[0],D[0][1]=_[0],D[1][0]=H[1],D[1][1]=_[1],h=!0);for(I=0;I<2;I++)0==T[I]&&(0==(D[I][0]&b[I])&&(D[I][0]=D[I][1]),N[I]=D[I][0]&b[I],N[I]|=(D[I][1]&b[I])<<8,N[I]|=(D[1-I][I]&b[I])<<16,N[I]|=(D[1-I][1-I]&b[I])<<24,0==(15&N[I])&&(N[I]=N[I]<<8),0==(3840&N[I])&&(N[I]=15&N[I]|N[I]>>8),0==(983040&N[I])&&(N[I]=65535&N[I]|(251658240&N[I])>>8),T[I]=15&N[I],b[I]!=mxConstants.DIRECTION_MASK_WEST&&b[I]!=mxConstants.DIRECTION_MASK_NORTH&&b[I]!=mxConstants.DIRECTION_MASK_EAST&&b[I]!=mxConstants.DIRECTION_MASK_SOUTH||(T[I]=b[I]));u=T[0]==mxConstants.DIRECTION_MASK_EAST?3:T[0],h=T[1]==mxConstants.DIRECTION_MASK_EAST?3:T[1];(u-=R)<1&&(u+=4),(h-=R)<1&&(h+=4);var G=mxEdgeStyle.routePatterns[u-1][h-1];switch(mxEdgeStyle.wayPoints1[0][0]=A[0][0],mxEdgeStyle.wayPoints1[0][1]=A[0][1],T[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=E,mxEdgeStyle.wayPoints1[0][1]+=O[0][1]*A[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=O[0][0]*A[0][2],mxEdgeStyle.wayPoints1[0][1]+=A[0][3]+E;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=A[0][2]+E,mxEdgeStyle.wayPoints1[0][1]+=O[0][1]*A[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=O[0][0]*A[0][2],mxEdgeStyle.wayPoints1[0][1]-=E}for(var k=0,V=0<(T[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1,F=V,B=0,I=0;I<G.length;I++){var z=15&G[I],Y=z==mxConstants.DIRECTION_MASK_EAST?3:z;4<(Y+=R)&&(Y-=4);var W=mxEdgeStyle.dirVectors[Y-1];(B=0<Y%2?0:1)!=V&&(k++,mxEdgeStyle.wayPoints1[k][0]=mxEdgeStyle.wayPoints1[k-1][0],mxEdgeStyle.wayPoints1[k][1]=mxEdgeStyle.wayPoints1[k-1][1]);var j=0<(G[I]&mxEdgeStyle.TARGET_MASK),X=0<(G[I]&mxEdgeStyle.SOURCE_MASK),Z=(G[I]&mxEdgeStyle.SIDE_MASK)>>5;15<(Z<<=R)&&(Z>>=4);z=0<(G[I]&mxEdgeStyle.CENTER_MASK);(X||j)&&Z<9?(j=0,X=X?0:1,j=z&&0==B?A[X][0]+O[X][0]*A[X][2]:z?A[X][1]+O[X][1]*A[X][3]:mxEdgeStyle.limits[X][Z],0==B?0<(Z=(j-mxEdgeStyle.wayPoints1[k][0])*W[0])&&(mxEdgeStyle.wayPoints1[k][0]+=W[0]*Z):0<(j=(j-mxEdgeStyle.wayPoints1[k][1])*W[1])&&(mxEdgeStyle.wayPoints1[k][1]+=W[1]*j)):z&&(mxEdgeStyle.wayPoints1[k][0]+=W[0]*Math.abs(mxEdgeStyle.vertexSeperations[Y]/2),mxEdgeStyle.wayPoints1[k][1]+=W[1]*Math.abs(mxEdgeStyle.vertexSeperations[Y]/2)),0<k&&mxEdgeStyle.wayPoints1[k][B]==mxEdgeStyle.wayPoints1[k-1][B]?k--:V=B}for(I=0;I<=k;I++){if(I==k)if(((0<(T[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1)==F?0:1)!=(k+1)%2)break;l.push(new mxPoint(Math.round(mxEdgeStyle.wayPoints1[I][0]*t.view.scale*10)/10,Math.round(mxEdgeStyle.wayPoints1[I][1]*t.view.scale*10)/10))}for(var K=1;K<l.length;)null==l[K-1]||null==l[K]||l[K-1].x!=l[K].x||l[K-1].y!=l[K].y?K++:l.splice(K,1)}},getRoutePattern:function(t,e,n,i){var l=t[0]==mxConstants.DIRECTION_MASK_EAST?3:t[0],t=t[1]==mxConstants.DIRECTION_MASK_EAST?3:t[1];(l-=e)<1&&(l+=4),(t-=e)<1&&(t+=4);e=routePatterns[l-1][t-1];return 0!=n&&0!=i||null!=inlineRoutePatterns[l-1][t-1]&&(e=inlineRoutePatterns[l-1][t-1]),e}},mxStyleRegistry={values:[],putValue:function(t,e){mxStyleRegistry.values[t]=e},getValue:function(t){return mxStyleRegistry.values[t]},getName:function(t){for(var e in mxStyleRegistry.values)if(mxStyleRegistry.values[e]==t)return e;return null}};function mxGraphView(t){this.graph=t,this.translate=new mxPoint,this.graphBounds=new mxRectangle,this.states=new mxDictionary}function mxCurrentRootChange(t,e){if(this.view=t,this.root=e,this.previous=e,this.isUp=null==e,!this.isUp)for(var n=this.view.currentRoot,i=this.view.graph.getModel();null!=n;){if(n==e){this.isUp=!0;break}n=i.getParent(n)}}function mxGraph(t,e,n,i){this.mouseListeners=null,this.renderHint=n,mxClient.IS_SVG?this.dialect=mxConstants.DIALECT_SVG:n==mxConstants.RENDERING_HINT_EXACT&&mxClient.IS_VML?this.dialect=mxConstants.DIALECT_VML:n==mxConstants.RENDERING_HINT_FASTEST?this.dialect=mxConstants.DIALECT_STRICTHTML:n==mxConstants.RENDERING_HINT_FASTER?this.dialect=mxConstants.DIALECT_PREFERHTML:this.dialect=mxConstants.DIALECT_MIXEDHTML,this.model=null!=e?e:new mxGraphModel,this.multiplicities=[],this.imageBundles=[],this.cellRenderer=this.createCellRenderer(),this.setSelectionModel(this.createSelectionModel()),this.setStylesheet(null!=i?i:this.createStylesheet()),this.view=this.createGraphView(),this.graphModelChangeListener=mxUtils.bind(this,function(t,e){this.graphModelChanged(e.getProperty("edit").changes)}),this.model.addListener(mxEvent.CHANGE,this.graphModelChangeListener),this.createHandlers(),null!=t&&this.init(t),this.view.revalidate()}function mxCellOverlay(t,e,n,i,l,s){this.image=t,this.tooltip=e,this.align=null!=n?n:this.align,this.verticalAlign=null!=i?i:this.verticalAlign,this.offset=null!=l?l:new mxPoint,this.cursor=null!=s?s:"help"}function mxOutline(t,e){this.source=t,null!=e&&this.init(e)}function mxMultiplicity(t,e,n,i,l,s,o,r,a,h){this.source=t,this.type=e,this.attr=n,this.value=i,this.min=null!=l?l:0,this.max=null!=s?s:"n",this.validNeighbors=o,this.countError=mxResources.get(r)||r,this.typeError=mxResources.get(a)||a,this.validNeighborsAllowed=null==h||h}function mxLayoutManager(t){this.undoHandler=mxUtils.bind(this,function(t,e){this.isEnabled()&&this.beforeUndo(e.getProperty("edit"))}),this.moveHandler=mxUtils.bind(this,function(t,e){this.isEnabled()&&this.cellsMoved(e.getProperty("cells"),e.getProperty("event"))}),this.resizeHandler=mxUtils.bind(this,function(t,e){this.isEnabled()&&this.cellsResized(e.getProperty("cells"),e.getProperty("bounds"),e.getProperty("previous"))}),this.setGraph(t)}function mxSwimlaneManager(t,e,n,i){this.horizontal=null==e||e,this.addEnabled=null==n||n,this.resizeEnabled=null==i||i,this.addHandler=mxUtils.bind(this,function(t,e){this.isEnabled()&&this.isAddEnabled()&&this.cellsAdded(e.getProperty("cells"))}),this.resizeHandler=mxUtils.bind(this,function(t,e){this.isEnabled()&&this.isResizeEnabled()&&this.cellsResized(e.getProperty("cells"))}),this.setGraph(t)}function mxTemporaryCellStates(l,t,e,n,s){t=null!=t?t:1,this.view=l,this.oldValidateCellState=l.validateCellState,this.oldBounds=l.getGraphBounds(),this.oldStates=l.getStates(),this.oldScale=l.getScale(),this.oldDoRedrawShape=l.graph.cellRenderer.doRedrawShape;var o=this;if(null!=s&&(l.graph.cellRenderer.doRedrawShape=function(n){var i=n.shape.paint;n.shape.paint=function(t){var e=s(n);null!=e&&t.setLink(e),i.apply(this,arguments),null!=e&&t.setLink(null)},o.oldDoRedrawShape.apply(l.graph.cellRenderer,arguments),n.shape.paint=i}),l.validateCellState=function(t,e){return null==t||null==n||n(t)?o.oldValidateCellState.apply(l,arguments):null},l.setStates(new mxDictionary),l.setScale(t),null!=e){l.resetValidationState();for(var i=null,r=0;r<e.length;r++){var a=l.getBoundingBox(l.validateCellState(l.validateCell(e[r])));null==i?i=a:i.add(a)}l.setGraphBounds(i||new mxRectangle)}}function mxCellStatePreview(t){this.deltas=new mxDictionary,this.graph=t}function mxConnectionConstraint(t,e,n,i,l){this.point=t,this.perimeter=null==e||e,this.name=n,this.dx=i||0,this.dy=l||0}function mxGraphHandler(t){this.graph=t,this.graph.addMouseListener(this),this.panHandler=mxUtils.bind(this,function(){this.suspended||(this.updatePreview(),this.updateHint())}),this.graph.addListener(mxEvent.PAN,this.panHandler),this.escapeHandler=mxUtils.bind(this,function(t,e){this.reset()}),this.graph.addListener(mxEvent.ESCAPE,this.escapeHandler),this.refreshHandler=mxUtils.bind(this,function(t,e){this.refreshThread&&window.clearTimeout(this.refreshThread),this.refreshThread=window.setTimeout(mxUtils.bind(this,function(){var t,e;(this.refreshThread=null)==this.first||this.suspended||(t=this.currentDx,e=this.currentDy,this.currentDx=0,this.currentDy=0,this.updatePreview(),this.bounds=this.graph.getView().getBounds(this.cells),this.pBounds=this.getPreviewBounds(this.cells),null!=this.pBounds||this.livePreviewUsed?(this.currentDx=t,this.currentDy=e,this.updatePreview(),this.updateHint(),this.livePreviewUsed&&(this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!1,!0),this.updatePreview())):this.reset())}),0)}),this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.addListener(mxEvent.REFRESH,this.refreshHandler),this.keyHandler=mxUtils.bind(this,function(t){null==this.graph.container||"hidden"==this.graph.container.style.visibility||null==this.first||this.suspended||(t=this.graph.isCloneEvent(t)&&this.graph.isCellsCloneable()&&this.isCloneEnabled())!=this.cloning&&(this.cloning=t,this.checkPreview(),this.updatePreview())}),mxEvent.addListener(document,"keydown",this.keyHandler),mxEvent.addListener(document,"keyup",this.keyHandler)}function mxPanningHandler(t){null!=t&&(this.graph=t,this.graph.addMouseListener(this),this.forcePanningHandler=mxUtils.bind(this,function(t,e){var n=e.getProperty("eventName"),e=e.getProperty("event");n==mxEvent.MOUSE_DOWN&&this.isForcePanningEvent(e)&&(this.start(e),this.active=!0,this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",e)),e.consume())}),this.graph.addListener(mxEvent.FIRE_MOUSE_EVENT,this.forcePanningHandler),this.gestureHandler=mxUtils.bind(this,function(t,e){this.isPinchEnabled()&&(e=e.getProperty("event"),mxEvent.isConsumed(e)||"gesturestart"!=e.type?"gestureend"==e.type&&null!=this.initialScale&&(this.initialScale=null):(this.initialScale=this.graph.view.scale,this.active||null==this.mouseDownEvent||(this.start(this.mouseDownEvent),this.mouseDownEvent=null)),null!=this.initialScale&&this.zoomGraph(e))}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.mouseUpListener=mxUtils.bind(this,function(){this.active&&this.reset()}),mxEvent.addListener(document,"mouseup",this.mouseUpListener))}function mxPopupMenuHandler(t,e){null!=t&&(this.graph=t,this.factoryMethod=e,this.graph.addMouseListener(this),this.gestureHandler=mxUtils.bind(this,function(t,e){this.inTolerance=!1}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.init())}function mxCellMarker(t,e,n,i){mxEventSource.call(this),null!=t&&(this.graph=t,this.validColor=null!=e?e:mxConstants.DEFAULT_VALID_COLOR,this.invalidColor=null!=n?n:mxConstants.DEFAULT_INVALID_COLOR,this.hotspot=null!=i?i:mxConstants.DEFAULT_HOTSPOT,this.highlight=new mxCellHighlight(t))}function mxSelectionCellsHandler(t){mxEventSource.call(this),this.graph=t,this.handlers=new mxDictionary,this.graph.addMouseListener(this),this.refreshHandler=mxUtils.bind(this,function(t,e){this.isEnabled()&&this.refresh()}),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE,this.refreshHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.refreshHandler),this.graph.getView().addListener(mxEvent.DOWN,this.refreshHandler),this.graph.getView().addListener(mxEvent.UP,this.refreshHandler)}function mxConnectionHandler(t,e){mxEventSource.call(this),null!=t&&(this.graph=t,this.factoryMethod=e,this.init(),this.escapeHandler=mxUtils.bind(this,function(t,e){this.reset()}),this.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}function mxConstraintHandler(t){this.graph=t,this.resetHandler=mxUtils.bind(this,function(t,e){null!=this.currentFocus&&null==this.graph.view.getState(this.currentFocus.cell)?this.reset():this.redraw()}),this.graph.model.addListener(mxEvent.CHANGE,this.resetHandler),this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.resetHandler),this.graph.view.addListener(mxEvent.TRANSLATE,this.resetHandler),this.graph.view.addListener(mxEvent.SCALE,this.resetHandler),this.graph.addListener(mxEvent.ROOT,this.resetHandler)}function mxRubberband(t){null!=t&&(this.graph=t,this.graph.addMouseListener(this),this.forceRubberbandHandler=mxUtils.bind(this,function(t,e){var n=e.getProperty("eventName"),i=e.getProperty("event");n==mxEvent.MOUSE_DOWN&&this.isForceRubberbandEvent(i)&&(e=mxUtils.getOffset(this.graph.container),(n=mxUtils.getScrollOrigin(this.graph.container)).x-=e.x,n.y-=e.y,this.start(i.getX()+n.x,i.getY()+n.y),i.consume(!1))}),this.graph.addListener(mxEvent.FIRE_MOUSE_EVENT,this.forceRubberbandHandler),this.panHandler=mxUtils.bind(this,function(){this.repaint()}),this.graph.addListener(mxEvent.PAN,this.panHandler),this.gestureHandler=mxUtils.bind(this,function(t,e){null!=this.first&&this.reset()}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}function mxHandle(t,e,n,i){this.graph=t.view.graph,this.state=t,this.cursor=null!=e?e:this.cursor,this.image=null!=n?n:this.image,this.shape=null!=i?i:null,this.init()}function mxVertexHandler(t){null!=t&&(this.state=t,this.init(),this.escapeHandler=mxUtils.bind(this,function(t,e){this.livePreview&&null!=this.index&&(this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate()),this.reset()}),this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}function mxEdgeHandler(i){null!=i&&null!=i.shape&&(this.state=i,this.init(),this.escapeHandler=mxUtils.bind(this,function(t,e){var n=null!=this.index;this.reset(),n&&this.graph.cellRenderer.redraw(this.state,!1,i.view.isRendering())}),this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}function mxElbowEdgeHandler(t){mxEdgeHandler.call(this,t)}function mxEdgeSegmentHandler(t){mxEdgeHandler.call(this,t)}function mxKeyHandler(t,e){null!=t&&(this.graph=t,this.target=e||document.documentElement,this.normalKeys=[],this.shiftKeys=[],this.controlKeys=[],this.controlShiftKeys=[],this.keydownHandler=mxUtils.bind(this,function(t){this.keyDown(t)}),mxEvent.addListener(this.target,"keydown",this.keydownHandler),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}function mxTooltipHandler(t,e){null!=t&&(this.graph=t,this.delay=e||500,this.graph.addMouseListener(this))}function mxCellTracker(t,e,n){mxCellMarker.call(this,t,e),this.graph.addMouseListener(this),null!=n&&(this.getCell=n),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()}))}function mxCellHighlight(t,e,n,i){null!=t&&(this.graph=t,this.highlightColor=null!=e?e:mxConstants.DEFAULT_VALID_COLOR,this.strokeWidth=null!=n?n:mxConstants.HIGHLIGHT_STROKEWIDTH,this.dashed=null!=i&&i,this.opacity=mxConstants.HIGHLIGHT_OPACITY,this.repaintHandler=mxUtils.bind(this,function(){var t;null!=this.state&&(null==(t=this.graph.view.getState(this.state.cell))?this.hide():(this.state=t,this.repaint()))}),this.graph.getView().addListener(mxEvent.SCALE,this.repaintHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.repaintHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.repaintHandler),this.resetHandler=mxUtils.bind(this,function(){this.hide()}),this.graph.getView().addListener(mxEvent.DOWN,this.resetHandler),this.graph.getView().addListener(mxEvent.UP,this.resetHandler))}function mxDefaultKeyHandler(e){var n;null!=e&&(this.editor=e,this.handler=new mxKeyHandler(e.graph),n=this.handler.escape,this.handler.escape=function(t){n.apply(this,arguments),e.hideProperties(),e.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",t))})}function mxDefaultPopupMenu(t){this.config=t}function mxDefaultToolbar(t,e){this.editor=e,null!=t&&null!=e&&this.init(t)}function mxEditor(t){this.actions=[],this.addActions(),null!=document.body&&(this.cycleAttributeValues=[],this.popupHandler=new mxDefaultPopupMenu,this.undoManager=new mxUndoManager,this.graph=this.createGraph(),this.toolbar=this.createToolbar(),this.keyHandler=new mxDefaultKeyHandler(this),this.configure(t),this.graph.swimlaneIndicatorColorAttribute=this.cycleAttributeName,null!=this.onInit&&this.onInit(),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ELBOW,mxEdgeStyle.ElbowConnector),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ENTITY_RELATION,mxEdgeStyle.EntityRelation),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_LOOP,mxEdgeStyle.Loop),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SIDETOSIDE,mxEdgeStyle.SideToSide),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_TOPTOBOTTOM,mxEdgeStyle.TopToBottom),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ORTHOGONAL,mxEdgeStyle.OrthConnector),mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SEGMENT,mxEdgeStyle.SegmentConnector),mxStyleRegistry.putValue(mxConstants.PERIMETER_ELLIPSE,mxPerimeter.EllipsePerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_RECTANGLE,mxPerimeter.RectanglePerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_RHOMBUS,mxPerimeter.RhombusPerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_TRIANGLE,mxPerimeter.TrianglePerimeter),mxStyleRegistry.putValue(mxConstants.PERIMETER_HEXAGON,mxPerimeter.HexagonPerimeter),mxGraphView.prototype=new mxEventSource,mxGraphView.prototype.constructor=mxGraphView,mxGraphView.prototype.EMPTY_POINT=new mxPoint,mxGraphView.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphView.prototype.updatingDocumentResource="none"!=mxClient.language?"updatingDocument":"",mxGraphView.prototype.allowEval=!1,mxGraphView.prototype.captureDocumentGesture=!0,mxGraphView.prototype.optimizeVmlReflows=!0,mxGraphView.prototype.rendering=!0,mxGraphView.prototype.graph=null,mxGraphView.prototype.currentRoot=null,mxGraphView.prototype.graphBounds=null,mxGraphView.prototype.scale=1,mxGraphView.prototype.translate=null,mxGraphView.prototype.states=null,mxGraphView.prototype.updateStyle=!1,mxGraphView.prototype.lastNode=null,mxGraphView.prototype.lastHtmlNode=null,mxGraphView.prototype.lastForegroundNode=null,mxGraphView.prototype.lastForegroundHtmlNode=null,mxGraphView.prototype.getGraphBounds=function(){return this.graphBounds},mxGraphView.prototype.setGraphBounds=function(t){this.graphBounds=t},mxGraphView.prototype.getBounds=function(t){var e=null;if(null!=t&&0<t.length)for(var n,i=this.graph.getModel(),l=0;l<t.length;l++)!i.isVertex(t[l])&&!i.isEdge(t[l])||null!=(n=this.getState(t[l]))&&(null==e?e=mxRectangle.fromRectangle(n):e.add(n));return e},mxGraphView.prototype.setCurrentRoot=function(t){var e,n;return this.currentRoot!=t&&((e=new mxCurrentRootChange(this,t)).execute(),(n=new mxUndoableEdit(this,!0)).add(e),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",n)),this.graph.sizeDidChange()),t},mxGraphView.prototype.scaleAndTranslate=function(t,e,n){var i=this.scale,l=new mxPoint(this.translate.x,this.translate.y);this.scale==t&&this.translate.x==e&&this.translate.y==n||(this.scale=t,this.translate.x=e,this.translate.y=n,this.isEventsEnabled()&&this.viewStateChanged()),this.fireEvent(new mxEventObject(mxEvent.SCALE_AND_TRANSLATE,"scale",t,"previousScale",i,"translate",this.translate,"previousTranslate",l))},mxGraphView.prototype.getScale=function(){return this.scale},mxGraphView.prototype.setScale=function(t){var e=this.scale;this.scale!=t&&(this.scale=t,this.isEventsEnabled()&&this.viewStateChanged()),this.fireEvent(new mxEventObject(mxEvent.SCALE,"scale",t,"previousScale",e))},mxGraphView.prototype.getTranslate=function(){return this.translate},mxGraphView.prototype.setTranslate=function(t,e){var n=new mxPoint(this.translate.x,this.translate.y);this.translate.x==t&&this.translate.y==e||(this.translate.x=t,this.translate.y=e,this.isEventsEnabled()&&this.viewStateChanged()),this.fireEvent(new mxEventObject(mxEvent.TRANSLATE,"translate",this.translate,"previousTranslate",n))},mxGraphView.prototype.viewStateChanged=function(){this.revalidate(),this.graph.sizeDidChange()},mxGraphView.prototype.refresh=function(){null!=this.currentRoot&&this.clear(),this.revalidate()},mxGraphView.prototype.revalidate=function(){this.invalidate(),this.validate()},mxGraphView.prototype.clear=function(t,e,n){var i=this.graph.getModel();if(t=t||i.getRoot(),e=null!=e&&e,n=null==n||n,this.removeState(t),n&&(e||t!=this.currentRoot))for(var l=i.getChildCount(t),s=0;s<l;s++)this.clear(i.getChildAt(t,s),e);else this.invalidate(t)},mxGraphView.prototype.invalidate=function(t,e,n){var i=this.graph.getModel();t=t||i.getRoot(),e=null==e||e,n=null==n||n;var l=this.getState(t);if(null!=l&&(l.invalid=!0),!t.invalidating){if(t.invalidating=!0,e)for(var s=i.getChildCount(t),o=0;o<s;o++){var r=i.getChildAt(t,o);this.invalidate(r,e,n)}if(n)for(var a=i.getEdgeCount(t),o=0;o<a;o++)this.invalidate(i.getEdgeAt(t,o),e,n);delete t.invalidating}},mxGraphView.prototype.validate=function(t){var e=mxLog.enter("mxGraphView.validate");window.status=mxResources.get(this.updatingDocumentResource)||this.updatingDocumentResource,this.resetValidationState();var n=null;this.optimizeVmlReflows&&null!=this.canvas&&null==this.textDiv&&(8==document.documentMode&&!mxClient.IS_EM||mxClient.IS_QUIRKS)&&(this.placeholder=document.createElement("div"),this.placeholder.style.position="absolute",this.placeholder.style.width=this.canvas.clientWidth+"px",this.placeholder.style.height=this.canvas.clientHeight+"px",this.canvas.parentNode.appendChild(this.placeholder),n=this.drawPane.style.display,this.canvas.style.display="none",this.textDiv=document.createElement("div"),this.textDiv.style.position="absolute",this.textDiv.style.whiteSpace="nowrap",this.textDiv.style.visibility="hidden",this.textDiv.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",this.textDiv.style.zoom="1",document.body.appendChild(this.textDiv));t=this.getBoundingBox(this.validateCellState(this.validateCell(t||(null!=this.currentRoot?this.currentRoot:this.graph.getModel().getRoot()))));this.setGraphBounds(null!=t?t:this.getEmptyBounds()),this.validateBackground(),null!=n&&(this.canvas.style.display=n,this.textDiv.parentNode.removeChild(this.textDiv),null!=this.placeholder&&this.placeholder.parentNode.removeChild(this.placeholder),this.textDiv=null),this.resetValidationState(),window.status=mxResources.get(this.doneResource)||this.doneResource,mxLog.leave("mxGraphView.validate",e)},mxGraphView.prototype.getEmptyBounds=function(){return new mxRectangle(this.translate.x*this.scale,this.translate.y*this.scale)},mxGraphView.prototype.getBoundingBox=function(t,e){e=null==e||e;var n=null;if(null!=t&&(null!=t.shape&&null!=t.shape.boundingBox&&(n=t.shape.boundingBox.clone()),null!=t.text&&null!=t.text.boundingBox&&(null!=n?n.add(t.text.boundingBox):n=t.text.boundingBox.clone()),e))for(var i=this.graph.getModel(),l=i.getChildCount(t.cell),s=0;s<l;s++){var o=this.getBoundingBox(this.getState(i.getChildAt(t.cell,s)));null!=o&&(null==n?n=o:n.add(o))}return n},mxGraphView.prototype.createBackgroundPageShape=function(t){return new mxRectangleShape(t,"white","black")},mxGraphView.prototype.validateBackground=function(){this.validateBackgroundImage(),this.validateBackgroundPage()},mxGraphView.prototype.validateBackgroundImage=function(){var t,e=this.graph.getBackgroundImage();null!=e?(null!=this.backgroundImage&&this.backgroundImage.image==e.src||(null!=this.backgroundImage&&this.backgroundImage.destroy(),t=new mxRectangle(0,0,1,1),this.backgroundImage=new mxImageShape(t,e.src),this.backgroundImage.dialect=this.graph.dialect,this.backgroundImage.init(this.backgroundPane),this.backgroundImage.redraw(),8!=document.documentMode||mxClient.IS_EM||mxEvent.addGestureListeners(this.backgroundImage.node,mxUtils.bind(this,function(t){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t))}),mxUtils.bind(this,function(t){this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t))}),mxUtils.bind(this,function(t){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t))}))),this.redrawBackgroundImage(this.backgroundImage,e)):null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null)},mxGraphView.prototype.validateBackgroundPage=function(){var t;this.graph.pageVisible?(t=this.getBackgroundPageBounds(),null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(t),this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=this.graph.dialect,this.backgroundPageShape.init(this.backgroundPane),this.backgroundPageShape.redraw(),this.graph.nativeDblClickEnabled&&mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(t){this.graph.dblClick(t)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(t){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t))}),mxUtils.bind(this,function(t){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide(),this.graph.isMouseDown&&!mxEvent.isConsumed(t)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t))}),mxUtils.bind(this,function(t){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t))}))):(this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.bounds=t,this.backgroundPageShape.redraw())):null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)},mxGraphView.prototype.getBackgroundPageBounds=function(){var t=this.graph.pageFormat,e=this.scale*this.graph.pageScale;return new mxRectangle(this.scale*this.translate.x,this.scale*this.translate.y,t.width*e,t.height*e)},mxGraphView.prototype.redrawBackgroundImage=function(t,e){t.scale=this.scale,t.bounds.x=this.scale*this.translate.x,t.bounds.y=this.scale*this.translate.y,t.bounds.width=this.scale*e.width,t.bounds.height=this.scale*e.height,t.redraw()},mxGraphView.prototype.validateCell=function(t,e){if(e=null==e||e,null!=t)if(e=e&&this.graph.isCellVisible(t),null==this.getState(t,e)||e)for(var n=this.graph.getModel(),i=n.getChildCount(t),l=0;l<i;l++)this.validateCell(n.getChildAt(t,l),e&&(!this.isCellCollapsed(t)||t==this.currentRoot));else this.removeState(t);return t},mxGraphView.prototype.validateCellState=function(t,e){e=null==e||e;var n=null;if(null!=t&&null!=(n=this.getState(t))){var i=this.graph.getModel();if(n.invalid&&(n.invalid=!1,null!=n.style&&!n.invalidStyle||(n.style=this.graph.getCellStyle(n.cell),n.invalidStyle=!1),t!=this.currentRoot&&this.validateCellState(i.getParent(t),!1),n.setVisibleTerminalState(this.validateCellState(this.getVisibleTerminal(t,!0),!1),!0),n.setVisibleTerminalState(this.validateCellState(this.getVisibleTerminal(t,!1),!1),!1),this.updateCellState(n),t==this.currentRoot||n.invalid||(this.graph.cellRenderer.redraw(n,!1,this.isRendering()),n.updateCachedBounds())),e&&!n.invalid){null!=n.shape&&this.stateValidated(n);for(var l=i.getChildCount(t),s=0;s<l;s++)this.validateCellState(i.getChildAt(t,s))}}return n},mxGraphView.prototype.updateCellState=function(t){var e,n,i,l,s;t.absoluteOffset.x=0,t.absoluteOffset.y=0,t.origin.x=0,t.origin.y=0,t.length=0,t.cell!=this.currentRoot&&(e=this.graph.getModel(),null!=(n=this.getState(e.getParent(t.cell)))&&n.cell!=this.currentRoot&&(t.origin.x+=n.origin.x,t.origin.y+=n.origin.y),null!=(s=this.graph.getChildOffsetForCell(t.cell))&&(t.origin.x+=s.x,t.origin.y+=s.y),null!=(i=this.graph.getCellGeometry(t.cell))&&(e.isEdge(t.cell)||(s=null!=i.offset?i.offset:this.EMPTY_POINT,i.relative&&null!=n?e.isEdge(n.cell)?null!=(l=this.getPoint(n,i))&&(t.origin.x+=l.x/this.scale-n.origin.x-this.translate.x,t.origin.y+=l.y/this.scale-n.origin.y-this.translate.y):(t.origin.x+=i.x*n.unscaledWidth+s.x,t.origin.y+=i.y*n.unscaledHeight+s.y):(t.absoluteOffset.x=this.scale*s.x,t.absoluteOffset.y=this.scale*s.y,t.origin.x+=i.x,t.origin.y+=i.y)),t.x=this.scale*(this.translate.x+t.origin.x),t.y=this.scale*(this.translate.y+t.origin.y),t.width=this.scale*i.width,t.unscaledWidth=i.width,t.height=this.scale*i.height,t.unscaledHeight=i.height,e.isVertex(t.cell)&&this.updateVertexState(t,i),e.isEdge(t.cell)&&this.updateEdgeState(t,i))),t.updateCachedBounds()},mxGraphView.prototype.isCellCollapsed=function(t){return this.graph.isCellCollapsed(t)},mxGraphView.prototype.updateVertexState=function(t,e){var n,i=this.graph.getModel(),l=this.getState(i.getParent(t.cell));!e.relative||null==l||i.isEdge(l.cell)||0!=(n=mxUtils.toRadians(l.style[mxConstants.STYLE_ROTATION]||"0"))&&(e=Math.cos(n),i=Math.sin(n),n=new mxPoint(t.getCenterX(),t.getCenterY()),l=new mxPoint(l.getCenterX(),l.getCenterY()),l=mxUtils.getRotatedPoint(n,e,i,l),t.x=l.x-t.width/2,t.y=l.y-t.height/2),this.updateVertexLabelOffset(t)},mxGraphView.prototype.updateEdgeState=function(t,e){var n=t.getVisibleTerminalState(!0),i=t.getVisibleTerminalState(!1);null!=this.graph.model.getTerminal(t.cell,!0)&&null==n||null==n&&null==e.getTerminalPoint(!0)||null!=this.graph.model.getTerminal(t.cell,!1)&&null==i||null==i&&null==e.getTerminalPoint(!1)?this.clear(t.cell,!0):(this.updateFixedTerminalPoints(t,n,i),this.updatePoints(t,e.points,n,i),this.updateFloatingTerminalPoints(t,n,i),i=t.absolutePoints,t.cell!=this.currentRoot&&(null==i||i.length<2||null==i[0]||null==i[i.length-1])?this.clear(t.cell,!0):(this.updateEdgeBounds(t),this.updateEdgeLabelOffset(t)))},mxGraphView.prototype.updateVertexLabelOffset=function(t){var e,n=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);n==mxConstants.ALIGN_LEFT?(null!=(e=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null))?e*=this.scale:e=t.width,t.absoluteOffset.x-=e):n==mxConstants.ALIGN_RIGHT?t.absoluteOffset.x+=t.width:n==mxConstants.ALIGN_CENTER&&null!=(e=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null))&&(i=0,(n=mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER))==mxConstants.ALIGN_CENTER?i=.5:n==mxConstants.ALIGN_RIGHT&&(i=1),0!=i&&(t.absoluteOffset.x-=(e*this.scale-t.width)*i));var i=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);i==mxConstants.ALIGN_TOP?t.absoluteOffset.y-=t.height:i==mxConstants.ALIGN_BOTTOM&&(t.absoluteOffset.y+=t.height)},mxGraphView.prototype.resetValidationState=function(){this.lastNode=null,this.lastHtmlNode=null,this.lastForegroundNode=null,this.lastForegroundHtmlNode=null},mxGraphView.prototype.stateValidated=function(t){var e=this.graph.getModel().isEdge(t.cell)&&this.graph.keepEdgesInForeground||this.graph.getModel().isVertex(t.cell)&&this.graph.keepEdgesInBackground,n=e&&this.lastForegroundHtmlNode||this.lastHtmlNode,i=e&&this.lastForegroundNode||this.lastNode,n=this.graph.cellRenderer.insertStateAfter(t,i,n);e?(this.lastForegroundHtmlNode=n[1],this.lastForegroundNode=n[0]):(this.lastHtmlNode=n[1],this.lastNode=n[0])},mxGraphView.prototype.updateFixedTerminalPoints=function(t,e,n){this.updateFixedTerminalPoint(t,e,!0,this.graph.getConnectionConstraint(t,e,!0)),this.updateFixedTerminalPoint(t,n,!1,this.graph.getConnectionConstraint(t,n,!1))},mxGraphView.prototype.updateFixedTerminalPoint=function(t,e,n,i){t.setAbsoluteTerminalPoint(this.getFixedTerminalPoint(t,e,n,i),n)},mxGraphView.prototype.getFixedTerminalPoint=function(t,e,n,i){var l,s=null;return null!=i&&(s=this.graph.getConnectionPoint(e,i,!1)),null==s&&null==e&&(l=this.scale,i=this.translate,e=t.origin,null!=(s=this.graph.getCellGeometry(t.cell).getTerminalPoint(n))&&(s=new mxPoint(l*(i.x+s.x+e.x),l*(i.y+s.y+e.y)))),s},mxGraphView.prototype.updateBoundsFromStencil=function(t){var e,n=null;return null!=t&&null!=t.shape&&null!=t.shape.stencil&&"fixed"==t.shape.stencil.aspect&&(n=mxRectangle.fromRectangle(t),e=t.shape.stencil.computeAspect(t.style,t.x,t.y,t.width,t.height),t.setRect(e.x,e.y,t.shape.stencil.w0*e.width,t.shape.stencil.h0*e.height)),n},mxGraphView.prototype.updatePoints=function(t,e,n,i){if(null!=t){var l=[];l.push(t.absolutePoints[0]);var s=this.getEdgeStyle(t,e,n,i);if(null!=s){var o=this.getTerminalPort(t,n,!0),n=this.getTerminalPort(t,i,!1),i=this.updateBoundsFromStencil(o),r=this.updateBoundsFromStencil(n);s(t,o,n,e,l),null!=i&&o.setRect(i.x,i.y,i.width,i.height),null!=r&&n.setRect(r.x,r.y,r.width,r.height)}else if(null!=e)for(var a,h=0;h<e.length;h++)null!=e[h]&&(a=mxUtils.clone(e[h]),l.push(this.transformControlPoint(t,a)));r=t.absolutePoints;l.push(r[r.length-1]),t.absolutePoints=l}},mxGraphView.prototype.transformControlPoint=function(t,e,n){if(null==t||null==e)return null;t=t.origin,n=n?1:this.scale;return new mxPoint(n*(e.x+this.translate.x+t.x),n*(e.y+this.translate.y+t.y))},mxGraphView.prototype.isLoopStyleEnabled=function(t,e,n,i){var l=this.graph.getConnectionConstraint(t,n,!0),s=this.graph.getConnectionConstraint(t,i,!1);return!(!(null==e||e.length<2)||mxUtils.getValue(t.style,mxConstants.STYLE_ORTHOGONAL_LOOP,!1)&&(null!=l&&null!=l.point||null!=s&&null!=s.point))&&(null!=n&&n==i)},mxGraphView.prototype.getEdgeStyle=function(t,e,n,i){i=this.isLoopStyleEnabled(t,e,n,i)?mxUtils.getValue(t.style,mxConstants.STYLE_LOOP,this.graph.defaultLoopStyle):mxUtils.getValue(t.style,mxConstants.STYLE_NOEDGESTYLE,!1)?null:t.style[mxConstants.STYLE_EDGE];return"string"==typeof i&&(null==(t=mxStyleRegistry.getValue(i))&&this.isAllowEval()&&(t=mxUtils.eval(i)),i=t),"function"==typeof i?i:null},mxGraphView.prototype.updateFloatingTerminalPoints=function(t,e,n){var i=t.absolutePoints,l=i[0];null==i[i.length-1]&&null!=n&&this.updateFloatingTerminalPoint(t,n,e,!1),null==l&&null!=e&&this.updateFloatingTerminalPoint(t,e,n,!0)},mxGraphView.prototype.updateFloatingTerminalPoint=function(t,e,n,i){t.setAbsoluteTerminalPoint(this.getFloatingTerminalPoint(t,e,n,i),i)},mxGraphView.prototype.getFloatingTerminalPoint=function(t,e,n,i){e=this.getTerminalPort(t,e,i);var l=this.getNextPoint(t,n,i),s=this.graph.isOrthogonal(t),o=mxUtils.toRadians(Number(e.style[mxConstants.STYLE_ROTATION]||"0")),r=new mxPoint(e.getCenterX(),e.getCenterY());0!=o&&(a=Math.cos(-o),h=Math.sin(-o),l=mxUtils.getRotatedPoint(l,a,h,r));n=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0);n+=parseFloat(t.style[i?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);var a,h,n=this.getPerimeterPoint(e,l,0==o&&s,n);return 0!=o&&(a=Math.cos(o),h=Math.sin(o),n=mxUtils.getRotatedPoint(n,a,h,r)),n},mxGraphView.prototype.getTerminalPort=function(t,e,n){n=n?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT,n=mxUtils.getValue(t.style,n);return null==n||null!=(n=this.getState(this.graph.getModel().getCell(n)))&&(e=n),e},mxGraphView.prototype.getPerimeterPoint=function(t,e,n,i){var l,s,o=null;return null!=t&&(null==(l=this.getPerimeterFunction(t))||null==e||(0<(s=this.getPerimeterBounds(t,i)).width||0<s.height)&&(o=new mxPoint(e.x,e.y),e=i=!1,this.graph.model.isVertex(t.cell)&&(i=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPH,0),e=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPV,0),null!=t.shape&&null!=t.shape.stencil&&(i=1==mxUtils.getValue(t.style,"stencilFlipH",0)||i,e=1==mxUtils.getValue(t.style,"stencilFlipV",0)||e),i&&(o.x=2*s.getCenterX()-o.x),e&&(o.y=2*s.getCenterY()-o.y)),null!=(o=l(s,t,o,n))&&(i&&(o.x=2*s.getCenterX()-o.x),e&&(o.y=2*s.getCenterY()-o.y))),null==o&&(o=this.getPoint(t))),o},mxGraphView.prototype.getRoutingCenterX=function(t){var e=null!=t.style&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_X])||0;return t.getCenterX()+e*t.width},mxGraphView.prototype.getRoutingCenterY=function(t){var e=null!=t.style&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0;return t.getCenterY()+e*t.height},mxGraphView.prototype.getPerimeterBounds=function(t,e){return e=null!=e?e:0,null!=t&&(e+=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0)),t.getPerimeterBounds(e*this.scale)},mxGraphView.prototype.getPerimeterFunction=function(t){var e=t.style[mxConstants.STYLE_PERIMETER];return"string"==typeof e&&(null==(t=mxStyleRegistry.getValue(e))&&this.isAllowEval()&&(t=mxUtils.eval(e)),e=t),"function"==typeof e?e:null},mxGraphView.prototype.getNextPoint=function(t,e,n){var i=t.absolutePoints,l=null;return null!=i&&2<=i.length&&(t=i.length,l=i[n?Math.min(1,t-1):Math.max(0,t-2)]),null==l&&null!=e&&(l=new mxPoint(e.getCenterX(),e.getCenterY())),l},mxGraphView.prototype.getVisibleTerminal=function(t,e){for(var n=this.graph.getModel(),i=n.getTerminal(t,e),l=i;null!=i&&i!=this.currentRoot;)this.graph.isCellVisible(l)&&!this.isCellCollapsed(i)||(l=i),i=n.getParent(i);return null==l||n.contains(l)&&n.getParent(l)!=n.getRoot()&&l!=this.currentRoot||(l=null),l},mxGraphView.prototype.updateEdgeBounds=function(t){var e=t.absolutePoints,n=e[0],i=e[e.length-1];n.x!=i.x||n.y!=i.y?(p=i.x-n.x,m=i.y-n.y,t.terminalDistance=Math.sqrt(p*p+m*m)):t.terminalDistance=0;var l=0,s=[],o=n;if(null!=o){for(var r=o.x,a=o.y,h=r,d=a,u=1;u<e.length;u++){var p,m,c,g=e[u];null!=g&&(p=o.x-g.x,m=o.y-g.y,c=Math.sqrt(p*p+m*m),s.push(c),l+=c,o=g,r=Math.min(o.x,r),a=Math.min(o.y,a),h=Math.max(o.x,h),d=Math.max(o.y,d))}t.length=l,t.segments=s;t.x=r,t.y=a,t.width=Math.max(1,h-r),t.height=Math.max(1,d-a)}},mxGraphView.prototype.getPoint=function(t,e){var n=t.getCenterX(),i=t.getCenterY();if(null==t.segments||null!=e&&!e.relative)null!=e&&null!=(m=e.offset)&&(n+=m.x,i+=m.y);else{for(var l=null!=e?e.x/2:0,s=t.absolutePoints.length,o=Math.round((.5+l)*t.length),r=t.segments[0],a=0,h=1;o>=Math.round(a+r)&&h<s-1;)a+=r,r=t.segments[h++];var d,u,p,m,c=0==r?0:(o-a)/r,g=t.absolutePoints[h-1],x=t.absolutePoints[h];null!=g&&null!=x&&(u=d=p=0,null!=e&&(p=e.y,null!=(m=e.offset)&&(d=m.x,u=m.y)),l=x.x-g.x,e=x.y-g.y,m=0==r?0:e/r,x=0==r?0:l/r,n=g.x+l*c+(m*p+d)*this.scale,i=g.y+e*c-(x*p-u)*this.scale)}return new mxPoint(n,i)},mxGraphView.prototype.getRelativePoint=function(t,e,n){var i=this.graph.getModel().getGeometry(t.cell);if(null!=i){var l=t.absolutePoints.length;if(i.relative&&1<l){for(var s=t.length,o=t.segments,r=t.absolutePoints[0],a=t.absolutePoints[1],h=mxUtils.ptSegDistSq(r.x,r.y,a.x,a.y,e,n),d=0,u=0,p=0,m=2;m<l;m++){r=a,a=t.absolutePoints[m];var c=mxUtils.ptSegDistSq(r.x,r.y,a.x,a.y,e,n);p+=o[m-2],c<=h&&(h=c,u=m-1,d=p)}var g=o[u],r=t.absolutePoints[u],a=t.absolutePoints[u+1],x=r.x,y=r.y,f=a.x,C=a.y,v=e,E=n,i=x-f,x=y-C,y=0,E=(v=i-(v-=f))*i+(E=x-(E-=C))*x,y=E<=0?0:E*E/(i*i+x*x),y=Math.sqrt(y);g<y&&(y=g);g=Math.sqrt(mxUtils.ptSegDistSq(r.x,r.y,a.x,a.y,e,n));return-1==mxUtils.relativeCcw(r.x,r.y,a.x,a.y,e,n)&&(g=-g),new mxPoint((s/2-d-y)/s*-2,g/this.scale)}}return new mxPoint},mxGraphView.prototype.updateEdgeLabelOffset=function(t){var e,n,i,l,s,o=t.absolutePoints;t.absoluteOffset.x=t.getCenterX(),t.absoluteOffset.y=t.getCenterY(),null!=o&&0<o.length&&null!=t.segments&&((l=this.graph.getCellGeometry(t.cell)).relative?null!=(i=this.getPoint(t,l))&&(t.absoluteOffset=i):(e=o[0],s=o[o.length-1],null!=e&&null!=s&&(n=s.x-e.x,i=s.y-e.y,s=o=0,null!=(l=l.offset)&&(o=l.x,s=l.y),o=e.x+n/2+o*this.scale,s=e.y+i/2+s*this.scale,t.absoluteOffset.x=o,t.absoluteOffset.y=s)))},mxGraphView.prototype.getState=function(t,e){e=e||!1;var n=null;return null!=t&&(n=this.states.get(t),e&&(null==n||this.updateStyle)&&this.graph.isCellVisible(t)&&(null==n?(n=this.createState(t),this.states.put(t,n)):n.style=this.graph.getCellStyle(t))),n},mxGraphView.prototype.isRendering=function(){return this.rendering},mxGraphView.prototype.setRendering=function(t){this.rendering=t},mxGraphView.prototype.isAllowEval=function(){return this.allowEval},mxGraphView.prototype.setAllowEval=function(t){this.allowEval=t},mxGraphView.prototype.getStates=function(){return this.states},mxGraphView.prototype.setStates=function(t){this.states=t},mxGraphView.prototype.getCellStates=function(t){if(null==t)return this.states;for(var e=[],n=0;n<t.length;n++){var i=this.getState(t[n]);null!=i&&e.push(i)}return e},mxGraphView.prototype.removeState=function(t){var e=null;return null!=t&&null!=(e=this.states.remove(t))&&(this.graph.cellRenderer.destroy(e),e.invalid=!0,e.destroy()),e},mxGraphView.prototype.createState=function(t){return new mxCellState(this,t,this.graph.getCellStyle(t))},mxGraphView.prototype.getCanvas=function(){return this.canvas},mxGraphView.prototype.getBackgroundPane=function(){return this.backgroundPane},mxGraphView.prototype.getDrawPane=function(){return this.drawPane},mxGraphView.prototype.getOverlayPane=function(){return this.overlayPane},mxGraphView.prototype.getDecoratorPane=function(){return this.decoratorPane},mxGraphView.prototype.isContainerEvent=function(t){t=mxEvent.getSource(t);return t==this.graph.container||t.parentNode==this.backgroundPane||null!=t.parentNode&&t.parentNode.parentNode==this.backgroundPane||t==this.canvas.parentNode||t==this.canvas||t==this.backgroundPane||t==this.drawPane||t==this.overlayPane||t==this.decoratorPane},mxGraphView.prototype.isScrollEvent=function(t){var e=mxUtils.getOffset(this.graph.container),n=new mxPoint(t.clientX-e.x,t.clientY-e.y),t=this.graph.container.offsetWidth,e=this.graph.container.clientWidth;if(e<t&&n.x>e+2&&n.x<=t)return!0;e=this.graph.container.offsetHeight,t=this.graph.container.clientHeight;return t<e&&n.y>t+2&&n.y<=e},mxGraphView.prototype.init=function(){this.installListeners();var t=this.graph;t.dialect==mxConstants.DIALECT_SVG?this.createSvg():t.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()},mxGraphView.prototype.installListeners=function(){var e,i=this.graph,l=i.container;null!=l&&(mxClient.IS_TOUCH&&(mxEvent.addListener(l,"gesturestart",mxUtils.bind(this,function(t){i.fireGestureEvent(t),mxEvent.consume(t)})),mxEvent.addListener(l,"gesturechange",mxUtils.bind(this,function(t){i.fireGestureEvent(t),mxEvent.consume(t)})),mxEvent.addListener(l,"gestureend",mxUtils.bind(this,function(t){i.fireGestureEvent(t),mxEvent.consume(t)}))),e=null,mxEvent.addGestureListeners(l,mxUtils.bind(this,function(t){!this.isContainerEvent(t)||(mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_GC||mxClient.IS_OP||mxClient.IS_SF)&&this.isScrollEvent(t)||(i.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t)),e=t.pointerId)}),mxUtils.bind(this,function(t){!this.isContainerEvent(t)||null!=e&&t.pointerId!=e||i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t))}),mxUtils.bind(this,function(t){this.isContainerEvent(t)&&i.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t)),e=null})),mxEvent.addListener(l,"dblclick",mxUtils.bind(this,function(t){this.isContainerEvent(t)&&i.dblClick(t)})),i.addMouseListener({mouseDown:function(t,e){i.popupMenuHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,function(t){var e,n;null!=i.tooltipHandler&&i.tooltipHandler.isHideOnHover()&&i.tooltipHandler.hide(),this.captureDocumentGesture&&i.isMouseDown&&null!=i.container&&!this.isContainerEvent(t)&&"none"!=i.container.style.display&&"hidden"!=i.container.style.visibility&&!mxEvent.isConsumed(t)&&i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,(e=t,n=null,mxClient.IS_TOUCH&&(t=mxEvent.getClientX(e),e=mxEvent.getClientY(e),e=mxUtils.convertPoint(l,t,e),n=i.view.getState(i.getCellAt(e.x,e.y))),n)))}),this.endHandler=mxUtils.bind(this,function(t){this.captureDocumentGesture&&i.isMouseDown&&null!=i.container&&!this.isContainerEvent(t)&&"none"!=i.container.style.display&&"hidden"!=i.container.style.visibility&&i.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t))}),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler))},mxGraphView.prototype.createHtml=function(){var t=this.graph.container;null!=t&&(this.canvas=this.createHtmlPane("100%","100%"),this.canvas.style.overflow="hidden",this.backgroundPane=this.createHtmlPane("1px","1px"),this.drawPane=this.createHtmlPane("1px","1px"),this.overlayPane=this.createHtmlPane("1px","1px"),this.decoratorPane=this.createHtmlPane("1px","1px"),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),this.canvas.appendChild(this.decoratorPane),t.appendChild(this.canvas),this.updateContainerStyle(t),mxClient.IS_QUIRKS&&(t=mxUtils.bind(this,function(t){var e=this.getGraphBounds(),n=e.x+e.width+this.graph.border,e=e.y+e.height+this.graph.border;this.updateHtmlCanvasSize(n,e)}),mxEvent.addListener(window,"resize",t)))},mxGraphView.prototype.updateHtmlCanvasSize=function(t,e){var n,i;null!=this.graph.container&&(n=this.graph.container.offsetWidth,i=this.graph.container.offsetHeight,this.canvas.style.width=n<t?t+"px":"100%",this.canvas.style.height=i<e?e+"px":"100%")},mxGraphView.prototype.createHtmlPane=function(t,e){var n=document.createElement("DIV");return null!=t&&null!=e?(n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.style.width=t,n.style.height=e):n.style.position="relative",n},mxGraphView.prototype.createVml=function(){var t,e,n=this.graph.container;null!=n&&(t=n.offsetWidth,e=n.offsetHeight,this.canvas=this.createVmlPane(t,e),this.canvas.style.overflow="hidden",this.backgroundPane=this.createVmlPane(t,e),this.drawPane=this.createVmlPane(t,e),this.overlayPane=this.createVmlPane(t,e),this.decoratorPane=this.createVmlPane(t,e),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),this.canvas.appendChild(this.decoratorPane),n.appendChild(this.canvas))},mxGraphView.prototype.createVmlPane=function(t,e){var n=document.createElement(mxClient.VML_PREFIX+":group");return n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.style.width=t+"px",n.style.height=e+"px",n.setAttribute("coordsize",t+","+e),n.setAttribute("coordorigin","0,0"),n},mxGraphView.prototype.createSvg=function(){var t=this.graph.container;this.canvas=document.createElementNS(mxConstants.NS_SVG,"g"),this.backgroundPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.backgroundPane),this.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.drawPane),this.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.overlayPane),this.decoratorPane=document.createElementNS(mxConstants.NS_SVG,"g"),this.canvas.appendChild(this.decoratorPane);var e=document.createElementNS(mxConstants.NS_SVG,"svg");e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.display="block",e.appendChild(this.canvas),(mxClient.IS_IE||mxClient.IS_IE11)&&(e.style.overflow="hidden"),null!=t&&(t.appendChild(e),this.updateContainerStyle(t))},mxGraphView.prototype.updateContainerStyle=function(t){var e=mxUtils.getCurrentStyle(t);null!=e&&"static"==e.position&&(t.style.position="relative"),mxClient.IS_POINTER&&(t.style.touchAction="none")},mxGraphView.prototype.destroy=function(){var t=null!=this.canvas?this.canvas.ownerSVGElement:null;null==t&&(t=this.canvas),null!=t&&null!=t.parentNode&&(this.clear(this.currentRoot,!0),mxEvent.removeGestureListeners(document,null,this.moveHandler,this.endHandler),mxEvent.release(this.graph.container),t.parentNode.removeChild(t),this.moveHandler=null,this.endHandler=null,this.canvas=null,this.backgroundPane=null,this.drawPane=null,this.overlayPane=null,this.decoratorPane=null)},mxCurrentRootChange.prototype.execute=function(){var t=this.view.currentRoot;this.view.currentRoot=this.previous,this.previous=t;t=this.view.graph.getTranslateForRoot(this.view.currentRoot);null!=t&&(this.view.translate=new mxPoint(-t.x,-t.y)),this.isUp?(this.view.clear(this.view.currentRoot,!0),this.view.validate()):this.view.refresh();t=this.isUp?mxEvent.UP:mxEvent.DOWN;this.view.fireEvent(new mxEventObject(t,"root",this.view.currentRoot,"previous",this.previous)),this.isUp=!this.isUp},mxLoadResources?mxResources.add(mxClient.basePath+"/resources/graph"):mxClient.defaultBundles.push(mxClient.basePath+"/resources/graph"),mxGraph.prototype=new mxEventSource,mxGraph.prototype.constructor=mxGraph,mxGraph.prototype.mouseListeners=null,mxGraph.prototype.isMouseDown=!1,mxGraph.prototype.model=null,mxGraph.prototype.view=null,mxGraph.prototype.stylesheet=null,mxGraph.prototype.selectionModel=null,mxGraph.prototype.cellEditor=null,mxGraph.prototype.cellRenderer=null,mxGraph.prototype.multiplicities=null,mxGraph.prototype.renderHint=null,mxGraph.prototype.dialect=null,mxGraph.prototype.gridSize=10,mxGraph.prototype.gridEnabled=!0,mxGraph.prototype.portsEnabled=!0,mxGraph.prototype.nativeDblClickEnabled=!0,mxGraph.prototype.doubleTapEnabled=!0,mxGraph.prototype.doubleTapTimeout=500,mxGraph.prototype.doubleTapTolerance=25,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchTime=0,mxGraph.prototype.tapAndHoldEnabled=!0,mxGraph.prototype.tapAndHoldDelay=500,mxGraph.prototype.tapAndHoldInProgress=!1,mxGraph.prototype.tapAndHoldValid=!1,mxGraph.prototype.initialTouchX=0,mxGraph.prototype.initialTouchY=0,mxGraph.prototype.tolerance=4,mxGraph.prototype.defaultOverlap=.5,mxGraph.prototype.defaultParent=null,mxGraph.prototype.alternateEdgeStyle=null,mxGraph.prototype.backgroundImage=null,mxGraph.prototype.pageVisible=!1,mxGraph.prototype.pageBreaksVisible=!1,mxGraph.prototype.pageBreakColor="gray",mxGraph.prototype.pageBreakDashed=!0,mxGraph.prototype.minPageBreakDist=20,mxGraph.prototype.preferPageSize=!1,mxGraph.prototype.pageFormat=mxConstants.PAGE_FORMAT_A4_PORTRAIT,mxGraph.prototype.pageScale=1.5,mxGraph.prototype.enabled=!0,mxGraph.prototype.escapeEnabled=!0,mxGraph.prototype.invokesStopCellEditing=!0,mxGraph.prototype.enterStopsCellEditing=!1,mxGraph.prototype.useScrollbarsForPanning=!0,mxGraph.prototype.exportEnabled=!0,mxGraph.prototype.importEnabled=!0,mxGraph.prototype.cellsLocked=!1,mxGraph.prototype.cellsCloneable=!0,mxGraph.prototype.foldingEnabled=!0,mxGraph.prototype.cellsEditable=!0,mxGraph.prototype.cellsDeletable=!0,mxGraph.prototype.cellsMovable=!0,mxGraph.prototype.edgeLabelsMovable=!0,mxGraph.prototype.vertexLabelsMovable=!1,mxGraph.prototype.dropEnabled=!1,mxGraph.prototype.splitEnabled=!0,mxGraph.prototype.cellsResizable=!0,mxGraph.prototype.cellsBendable=!0,mxGraph.prototype.cellsSelectable=!0,mxGraph.prototype.cellsDisconnectable=!0,mxGraph.prototype.autoSizeCells=!1,mxGraph.prototype.autoSizeCellsOnAdd=!1,mxGraph.prototype.autoScroll=!0,mxGraph.prototype.ignoreScrollbars=!1,mxGraph.prototype.translateToScrollPosition=!1,mxGraph.prototype.timerAutoScroll=!1,mxGraph.prototype.allowAutoPanning=!1,mxGraph.prototype.autoExtend=!0,mxGraph.prototype.maximumGraphBounds=null,mxGraph.prototype.minimumGraphSize=null,mxGraph.prototype.minimumContainerSize=null,mxGraph.prototype.maximumContainerSize=null,mxGraph.prototype.resizeContainer=!1,mxGraph.prototype.border=0,mxGraph.prototype.keepEdgesInForeground=!1,mxGraph.prototype.keepEdgesInBackground=!1,mxGraph.prototype.allowNegativeCoordinates=!0,mxGraph.prototype.constrainChildren=!0,mxGraph.prototype.constrainRelativeChildren=!1,mxGraph.prototype.extendParents=!0,mxGraph.prototype.extendParentsOnAdd=!0,mxGraph.prototype.extendParentsOnMove=!1,mxGraph.prototype.recursiveResize=!1,mxGraph.prototype.collapseToPreferredSize=!0,mxGraph.prototype.zoomFactor=1.2,mxGraph.prototype.keepSelectionVisibleOnZoom=!1,mxGraph.prototype.centerZoom=!0,mxGraph.prototype.resetViewOnRootChange=!0,mxGraph.prototype.resetEdgesOnResize=!1,mxGraph.prototype.resetEdgesOnMove=!1,mxGraph.prototype.resetEdgesOnConnect=!0,mxGraph.prototype.allowLoops=!1,mxGraph.prototype.defaultLoopStyle=mxEdgeStyle.Loop,mxGraph.prototype.multigraph=!0,mxGraph.prototype.connectableEdges=!1,mxGraph.prototype.allowDanglingEdges=!0,mxGraph.prototype.cloneInvalidEdges=!1,mxGraph.prototype.disconnectOnMove=!0,mxGraph.prototype.labelsVisible=!0,mxGraph.prototype.htmlLabels=!1,mxGraph.prototype.swimlaneSelectionEnabled=!0,mxGraph.prototype.swimlaneNesting=!0,mxGraph.prototype.swimlaneIndicatorColorAttribute=mxConstants.STYLE_FILLCOLOR,mxGraph.prototype.imageBundles=null,mxGraph.prototype.minFitScale=.1,mxGraph.prototype.maxFitScale=8,mxGraph.prototype.panDx=0,mxGraph.prototype.panDy=0,mxGraph.prototype.collapsedImage=new mxImage(mxClient.imageBasePath+"/collapsed.gif",9,9),mxGraph.prototype.expandedImage=new mxImage(mxClient.imageBasePath+"/expanded.gif",9,9),mxGraph.prototype.warningImage=new mxImage(mxClient.imageBasePath+"/warning"+(mxClient.IS_MAC?".png":".gif"),16,16),mxGraph.prototype.alreadyConnectedResource="none"!=mxClient.language?"alreadyConnected":"",mxGraph.prototype.containsValidationErrorsResource="none"!=mxClient.language?"containsValidationErrors":"",mxGraph.prototype.collapseExpandResource="none"!=mxClient.language?"collapse-expand":"",mxGraph.prototype.init=function(t){this.container=t,this.cellEditor=this.createCellEditor(),this.view.init(),this.sizeDidChange(),mxEvent.addListener(t,"mouseleave",mxUtils.bind(this,function(t){null!=this.tooltipHandler&&null!=this.tooltipHandler.div&&this.tooltipHandler.div!=t.relatedTarget&&this.tooltipHandler.hide()})),mxClient.IS_IE&&(mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})),mxEvent.addListener(t,"selectstart",mxUtils.bind(this,function(t){return this.isEditing()||!this.isMouseDown&&!mxEvent.isShiftDown(t)}))),8==document.documentMode&&t.insertAdjacentHTML("beforeend","<"+mxClient.VML_PREFIX+':group style="DISPLAY: none;"></'+mxClient.VML_PREFIX+":group>")},mxGraph.prototype.createHandlers=function(){this.tooltipHandler=this.createTooltipHandler(),this.tooltipHandler.setEnabled(!1),this.selectionCellsHandler=this.createSelectionCellsHandler(),this.connectionHandler=this.createConnectionHandler(),this.connectionHandler.setEnabled(!1),this.graphHandler=this.createGraphHandler(),this.panningHandler=this.createPanningHandler(),this.panningHandler.panningEnabled=!1,this.popupMenuHandler=this.createPopupMenuHandler()},mxGraph.prototype.createTooltipHandler=function(){return new mxTooltipHandler(this)},mxGraph.prototype.createSelectionCellsHandler=function(){return new mxSelectionCellsHandler(this)},mxGraph.prototype.createConnectionHandler=function(){return new mxConnectionHandler(this)},mxGraph.prototype.createGraphHandler=function(){return new mxGraphHandler(this)},mxGraph.prototype.createPanningHandler=function(){return new mxPanningHandler(this)},mxGraph.prototype.createPopupMenuHandler=function(){return new mxPopupMenuHandler(this)},mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)},mxGraph.prototype.createStylesheet=function(){return new mxStylesheet},mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)},mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer},mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)},mxGraph.prototype.getModel=function(){return this.model},mxGraph.prototype.getView=function(){return this.view},mxGraph.prototype.getStylesheet=function(){return this.stylesheet},mxGraph.prototype.setStylesheet=function(t){this.stylesheet=t},mxGraph.prototype.getSelectionModel=function(){return this.selectionModel},mxGraph.prototype.setSelectionModel=function(t){this.selectionModel=t},mxGraph.prototype.getSelectionCellsForChanges=function(t,e){for(var i=new mxDictionary,l=[],s=mxUtils.bind(this,function(t){if(!i.get(t)&&this.model.contains(t))if(this.model.isEdge(t)||this.model.isVertex(t))i.put(t,!0),l.push(t);else for(var e=this.model.getChildCount(t),n=0;n<e;n++)s(this.model.getChildAt(t,n))}),n=0;n<t.length;n++){var o,r=t[n];r.constructor==mxRootChange||null!=e&&e(r)||(o=null,r instanceof mxChildChange?o=r.child:null!=r.cell&&r.cell instanceof mxCell&&(o=r.cell),null!=o&&s(o))}return l},mxGraph.prototype.graphModelChanged=function(t){for(var e=0;e<t.length;e++)this.processChange(t[e]);this.updateSelection(),this.view.validate(),this.sizeDidChange()},mxGraph.prototype.updateSelection=function(){for(var t=this.getSelectionCells(),e=[],n=0;n<t.length;n++)if(this.model.contains(t[n])&&this.isCellVisible(t[n]))for(var i=this.model.getParent(t[n]);null!=i&&i!=this.view.currentRoot;){if(this.isCellCollapsed(i)||!this.isCellVisible(i)){e.push(t[n]);break}i=this.model.getParent(i)}else e.push(t[n]);this.removeSelectionCells(e)},mxGraph.prototype.processChange=function(t){var e;t instanceof mxRootChange?(this.clearSelection(),this.setDefaultParent(null),this.removeStateForCell(t.previous),this.resetViewOnRootChange&&(this.view.scale=1,this.view.translate.x=0,this.view.translate.y=0),this.fireEvent(new mxEventObject(mxEvent.ROOT))):t instanceof mxChildChange?(e=this.model.getParent(t.child),this.view.invalidate(t.child,!0,!0),this.model.contains(e)&&!this.isCellCollapsed(e)||(this.view.invalidate(t.child,!0,!0),this.removeStateForCell(t.child),this.view.currentRoot==t.child&&this.home()),e!=t.previous&&(null!=e&&this.view.invalidate(e,!1,!1),null!=t.previous&&this.view.invalidate(t.previous,!1,!1))):t instanceof mxTerminalChange||t instanceof mxGeometryChange?(t instanceof mxTerminalChange||null==t.previous&&null!=t.geometry||null!=t.previous&&!t.previous.equals(t.geometry))&&this.view.invalidate(t.cell):t instanceof mxValueChange?this.view.invalidate(t.cell,!1,!1):t instanceof mxStyleChange?(this.view.invalidate(t.cell,!0,!0),null!=(e=this.view.getState(t.cell))&&(e.invalidStyle=!0)):null!=t.cell&&t.cell instanceof mxCell&&this.removeStateForCell(t.cell)},mxGraph.prototype.removeStateForCell=function(t){for(var e=this.model.getChildCount(t),n=0;n<e;n++)this.removeStateForCell(this.model.getChildAt(t,n));this.view.invalidate(t,!1,!0),this.view.removeState(t)},mxGraph.prototype.addCellOverlay=function(t,e){null==t.overlays&&(t.overlays=[]),t.overlays.push(e);var n=this.view.getState(t);return null!=n&&this.cellRenderer.redraw(n),this.fireEvent(new mxEventObject(mxEvent.ADD_OVERLAY,"cell",t,"overlay",e)),e},mxGraph.prototype.getCellOverlays=function(t){return t.overlays},mxGraph.prototype.removeCellOverlay=function(t,e){var n;return null==e?this.removeCellOverlays(t):0<=(n=mxUtils.indexOf(t.overlays,e))?(t.overlays.splice(n,1),0==t.overlays.length&&(t.overlays=null),null!=(n=this.view.getState(t))&&this.cellRenderer.redraw(n),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",t,"overlay",e))):e=null,e},mxGraph.prototype.removeCellOverlays=function(t){var e=t.overlays;if(null!=e){t.overlays=null;var n=this.view.getState(t);null!=n&&this.cellRenderer.redraw(n);for(var i=0;i<e.length;i++)this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",t,"overlay",e[i]))}return e},mxGraph.prototype.clearCellOverlays=function(t){t=null!=t?t:this.model.getRoot(),this.removeCellOverlays(t);for(var e=this.model.getChildCount(t),n=0;n<e;n++){var i=this.model.getChildAt(t,n);this.clearCellOverlays(i)}},mxGraph.prototype.setCellWarning=function(n,t,e,i){if(null!=t&&0<t.length){t=new mxCellOverlay(e=null!=e?e:this.warningImage,"<font color=red>"+t+"</font>");return i&&t.addListener(mxEvent.CLICK,mxUtils.bind(this,function(t,e){this.isEnabled()&&this.setSelectionCell(n)})),this.addCellOverlay(n,t)}return this.removeCellOverlays(n),null},mxGraph.prototype.startEditing=function(t){this.startEditingAtCell(null,t)},mxGraph.prototype.startEditingAtCell=function(t,e){null!=e&&mxEvent.isMultiTouchEvent(e)||(null==t&&(null==(t=this.getSelectionCell())||this.isCellEditable(t)||(t=null)),null!=t&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",t,"event",e)),this.cellEditor.startEditing(t,e),this.fireEvent(new mxEventObject(mxEvent.EDITING_STARTED,"cell",t,"event",e))))},mxGraph.prototype.getEditingValue=function(t,e){return this.convertValueToString(t)},mxGraph.prototype.stopEditing=function(t){this.cellEditor.stopEditing(t),this.fireEvent(new mxEventObject(mxEvent.EDITING_STOPPED,"cancel",t))},mxGraph.prototype.labelChanged=function(t,e,n){this.model.beginUpdate();try{var i=t.value;this.cellLabelChanged(t,e,this.isAutoSizeCell(t)),this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",t,"value",e,"old",i,"event",n))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellLabelChanged=function(t,e,n){this.model.beginUpdate();try{this.model.setValue(t,e),n&&this.cellSizeUpdated(t,!1)}finally{this.model.endUpdate()}},mxGraph.prototype.escape=function(t){this.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",t))},mxGraph.prototype.click=function(t){var n,e=t.getEvent(),i=t.getCell(),l=new mxEventObject(mxEvent.CLICK,"event",e,"cell",i);if(t.isConsumed()&&l.consume(),this.fireEvent(l),this.isEnabled()&&!mxEvent.isConsumed(e)&&!l.isConsumed()){if(null!=i)this.isTransparentClickEvent(e)&&(n=!1,null!=(l=this.getCellAt(t.graphX,t.graphY,null,null,null,mxUtils.bind(this,function(t){var e=this.isCellSelected(t.cell);return!(n=n||e)||e||t.cell!=i&&this.model.isAncestor(t.cell,i)})))&&(i=l));else if(this.isSwimlaneSelectionEnabled()&&!(null==(i=this.getSwimlaneAt(t.getGraphX(),t.getGraphY()))||this.isToggleEvent(e)&&mxEvent.isAltDown(e))){for(var s=i,o=[];null!=s;){s=this.model.getParent(s);var r=this.view.getState(s);this.isSwimlane(s)&&null!=r&&o.push(s)}if(0<o.length){(o=o.reverse()).splice(0,0,i),o.push(i);for(var a=0;a<o.length-1;a++)this.isCellSelected(o[a])&&(i=o[this.isToggleEvent(e)?a:a+1])}}null!=i?this.selectCellForEvent(i,e):this.isToggleEvent(e)||this.clearSelection()}},mxGraph.prototype.isSiblingSelected=function(t){for(var e=this.model,n=e.getParent(t),i=e.getChildCount(n),l=0;l<i;l++){var s=e.getChildAt(n,l);if(t!=s&&this.isCellSelected(s))return!0}return!1},mxGraph.prototype.dblClick=function(t,e){var n=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",t,"cell",e);this.fireEvent(n),!this.isEnabled()||mxEvent.isConsumed(t)||n.isConsumed()||null==e||!this.isCellEditable(e)||this.isEditing(e)||(this.startEditingAtCell(e,t),mxEvent.consume(t))},mxGraph.prototype.tapAndHold=function(t){var e=t.getEvent(),n=new mxEventObject(mxEvent.TAP_AND_HOLD,"event",e,"cell",t.getCell());this.fireEvent(n),n.isConsumed()&&(this.panningHandler.panningTrigger=!1),!this.isEnabled()||mxEvent.isConsumed(e)||n.isConsumed()||!this.connectionHandler.isEnabled()||null!=(n=this.view.getState(this.connectionHandler.marker.getCell(t)))&&(this.connectionHandler.marker.currentColor=this.connectionHandler.marker.validColor,this.connectionHandler.marker.markedState=n,this.connectionHandler.marker.mark(),this.connectionHandler.first=new mxPoint(t.getGraphX(),t.getGraphY()),this.connectionHandler.edgeState=this.connectionHandler.createEdgeState(t),this.connectionHandler.previous=n,this.connectionHandler.fireEvent(new mxEventObject(mxEvent.START,"state",this.connectionHandler.previous)))},mxGraph.prototype.scrollPointToVisible=function(t,e,n,i){var l,s,o,r,a,h;this.timerAutoScroll||!this.ignoreScrollbars&&!mxUtils.hasScrollbars(this.container)?this.allowAutoPanning&&!this.panningHandler.isActive()&&(null==this.panningManager&&(this.panningManager=this.createPanningManager()),this.panningManager.panTo(t+this.panDx,e+this.panDy)):(i=null!=i?i:20,t>=(l=this.container).scrollLeft&&e>=l.scrollTop&&t<=l.scrollLeft+l.clientWidth&&e<=l.scrollTop+l.clientHeight&&((o=l.scrollLeft+l.clientWidth-t)<i?(r=l.scrollLeft,l.scrollLeft+=i-o,n&&r==l.scrollLeft&&(this.dialect==mxConstants.DIALECT_SVG?(a=this.view.getDrawPane().ownerSVGElement,s=this.container.scrollWidth+i-o,a.style.width=s+"px"):(s=Math.max(l.clientWidth,l.scrollWidth)+i-o,this.view.getCanvas().style.width=s+"px"),l.scrollLeft+=i-o)):(o=t-l.scrollLeft)<i&&(l.scrollLeft-=i-o),(o=l.scrollTop+l.clientHeight-e)<i?(r=l.scrollTop,l.scrollTop+=i-o,r==l.scrollTop&&n&&(this.dialect==mxConstants.DIALECT_SVG?(a=this.view.getDrawPane().ownerSVGElement,h=this.container.scrollHeight+i-o,a.style.height=h+"px"):(h=Math.max(l.clientHeight,l.scrollHeight)+i-o,this.view.getCanvas().style.height=h+"px"),l.scrollTop+=i-o)):(o=e-l.scrollTop)<i&&(l.scrollTop-=i-o)))},mxGraph.prototype.createPanningManager=function(){return new mxPanningManager(this)},mxGraph.prototype.getBorderSizes=function(){var t=mxUtils.getCurrentStyle(this.container);return new mxRectangle(mxUtils.parseCssNumber(t.paddingLeft)+("none"!=t.borderLeftStyle?mxUtils.parseCssNumber(t.borderLeftWidth):0),mxUtils.parseCssNumber(t.paddingTop)+("none"!=t.borderTopStyle?mxUtils.parseCssNumber(t.borderTopWidth):0),mxUtils.parseCssNumber(t.paddingRight)+("none"!=t.borderRightStyle?mxUtils.parseCssNumber(t.borderRightWidth):0),mxUtils.parseCssNumber(t.paddingBottom)+("none"!=t.borderBottomStyle?mxUtils.parseCssNumber(t.borderBottomWidth):0))},mxGraph.prototype.getPreferredPageSize=function(t,e,n){this.view.scale;var i=this.view.translate,l=this.pageFormat,s=this.pageScale,s=new mxRectangle(0,0,Math.ceil(l.width*s),Math.ceil(l.height*s)),e=this.pageBreaksVisible?Math.ceil(e/s.width):1,n=this.pageBreaksVisible?Math.ceil(n/s.height):1;return new mxRectangle(0,0,e*s.width+2+i.x,n*s.height+2+i.y)},mxGraph.prototype.fit=function(t,e,n,i,l,s,o){if(null!=this.container){t=null!=t?t:this.getBorder(),e=null!=e&&e,n=null!=n?n:0,i=null==i||i,l=null!=l&&l,s=null!=s&&s;var r=this.getBorderSizes(),a=this.container.offsetWidth-r.x-r.width-1,h=null!=o?o:this.container.offsetHeight-r.y-r.height-1,d=this.view.getGraphBounds();if(0<d.width&&0<d.height){e&&null!=d.x&&null!=d.y&&((d=d.clone()).width+=d.x,d.height+=d.y,d.x=0,d.y=0);var u=this.view.scale,p=d.width/u,o=d.height/u;null!=this.backgroundImage&&(p=Math.max(p,this.backgroundImage.width-d.x/u),o=Math.max(o,this.backgroundImage.height-d.y/u));r=(e?t:2*t)+n+1;a-=r,h-=r;var m,o=l?h/o:s?a/p:Math.min(a/p,h/o);if(null!=this.minFitScale&&(o=Math.max(o,this.minFitScale)),null!=this.maxFitScale&&(o=Math.min(o,this.maxFitScale)),!i)return o;e?this.view.scale!=o&&this.view.setScale(o):mxUtils.hasScrollbars(this.container)?(this.view.setScale(o),null!=(m=this.getGraphBounds()).x&&(this.container.scrollLeft=m.x),null!=m.y&&(this.container.scrollTop=m.y)):(m=null!=d.x?Math.floor(this.view.translate.x-d.x/u+t/o+n/2):t,t=null!=d.y?Math.floor(this.view.translate.y-d.y/u+t/o+n/2):t,this.view.scaleAndTranslate(o,m,t))}}return this.view.scale},mxGraph.prototype.sizeDidChange=function(){var t,e,n,i=this.getGraphBounds();null!=this.container&&(e=this.getBorder(),t=Math.max(0,i.x)+i.width+2*e,e=Math.max(0,i.y)+i.height+2*e,null!=this.minimumContainerSize&&(t=Math.max(t,this.minimumContainerSize.width),e=Math.max(e,this.minimumContainerSize.height)),this.resizeContainer&&this.doResizeContainer(t,e),!(this.preferPageSize||!mxClient.IS_IE&&this.pageVisible)||null!=(n=this.getPreferredPageSize(i,Math.max(1,t),Math.max(1,e)))&&(t=n.width*this.view.scale,e=n.height*this.view.scale),null!=this.minimumGraphSize&&(t=Math.max(t,this.minimumGraphSize.width*this.view.scale),e=Math.max(e,this.minimumGraphSize.height*this.view.scale)),t=Math.ceil(t),e=Math.ceil(e),this.dialect==mxConstants.DIALECT_SVG?null!=(n=this.view.getDrawPane().ownerSVGElement)&&(n.style.minWidth=Math.max(1,t)+"px",n.style.minHeight=Math.max(1,e)+"px",n.style.width="100%",n.style.height="100%"):mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,t),Math.max(1,e)):(this.view.canvas.style.minWidth=Math.max(1,t)+"px",this.view.canvas.style.minHeight=Math.max(1,e)+"px"),this.updatePageBreaks(this.pageBreaksVisible,t,e)),this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",i))},mxGraph.prototype.doResizeContainer=function(t,e){null!=this.maximumContainerSize&&(t=Math.min(this.maximumContainerSize.width,t),e=Math.min(this.maximumContainerSize.height,e)),this.container.style.width=Math.ceil(t)+"px",this.container.style.height=Math.ceil(e)+"px"},mxGraph.prototype.updatePageBreaks=function(t,e,n){var i=this.view.scale,l=this.view.translate,s=this.pageFormat,o=i*this.pageScale,r=new mxRectangle(0,0,s.width*o,s.height*o),o=mxRectangle.fromRectangle(this.getGraphBounds());o.width=Math.max(1,o.width),o.height=Math.max(1,o.height),r.x=Math.floor((o.x-l.x*i)/r.width)*r.width+l.x*i,r.y=Math.floor((o.y-l.y*i)/r.height)*r.height+l.y*i,o.width=Math.ceil((o.width+(o.x-r.x))/r.width)*r.width,o.height=Math.ceil((o.height+(o.y-r.y))/r.height)*r.height;var a=(t=t&&Math.min(r.width,r.height)>this.minPageBreakDist)?Math.ceil(o.height/r.height)+1:0,h=t?Math.ceil(o.width/r.width)+1:0,d=(h-1)*r.width,u=(a-1)*r.height;null==this.horizontalPageBreaks&&0<a&&(this.horizontalPageBreaks=[]),null==this.verticalPageBreaks&&0<h&&(this.verticalPageBreaks=[]);o=mxUtils.bind(this,function(t){if(null!=t){for(var e=t==this.horizontalPageBreaks?a:h,n=0;n<=e;n++){var i=t==this.horizontalPageBreaks?[new mxPoint(Math.round(r.x),Math.round(r.y+n*r.height)),new mxPoint(Math.round(r.x+d),Math.round(r.y+n*r.height))]:[new mxPoint(Math.round(r.x+n*r.width),Math.round(r.y)),new mxPoint(Math.round(r.x+n*r.width),Math.round(r.y+u))];null!=t[n]?(t[n].points=i,t[n].redraw()):((i=new mxPolyline(i,this.pageBreakColor)).dialect=this.dialect,i.pointerEvents=!1,i.isDashed=this.pageBreakDashed,i.init(this.view.backgroundPane),i.redraw(),t[n]=i)}for(n=e;n<t.length;n++)t[n].destroy();t.splice(e,t.length-e)}});o(this.horizontalPageBreaks),o(this.verticalPageBreaks)},mxGraph.prototype.getCurrentCellStyle=function(t,e){e=e?null:this.view.getState(t);return null!=e?e.style:this.getCellStyle(t)},mxGraph.prototype.getCellStyle=function(t){var e=this.model.getStyle(t),n=null,n=this.model.isEdge(t)?this.stylesheet.getDefaultEdgeStyle():this.stylesheet.getDefaultVertexStyle();return null!=e&&(n=this.postProcessCellStyle(this.stylesheet.getCellStyle(e,n))),null==n&&(n=new Object),n},mxGraph.prototype.postProcessCellStyle=function(t){var e,n;return null!=t&&(n=t[mxConstants.STYLE_IMAGE],null!=(e=this.getImageFromBundles(n))?t[mxConstants.STYLE_IMAGE]=e:e=n,null!=e&&"data:image/"==e.substring(0,11)&&("data:image/svg+xml,<"==e.substring(0,20)?e=e.substring(0,19)+encodeURIComponent(e.substring(19)):"data:image/svg+xml,%3C"==e.substring(0,22)||0<(n=e.indexOf(","))&&";base64,"!=e.substring(n-7,n+1)&&(e=e.substring(0,n)+";base64,"+e.substring(n+1)),t[mxConstants.STYLE_IMAGE]=e)),t},mxGraph.prototype.setCellStyle=function(t,e){if(null!=(e=e||this.getSelectionCells())){this.model.beginUpdate();try{for(var n=0;n<e.length;n++)this.model.setStyle(e[n],t)}finally{this.model.endUpdate()}}},mxGraph.prototype.toggleCellStyle=function(t,e,n){return n=n||this.getSelectionCell(),this.toggleCellStyles(t,e,[n])},mxGraph.prototype.toggleCellStyles=function(t,e,n){e=null!=e&&e;var i,l=null;return null!=(n=n||this.getSelectionCells())&&0<n.length&&(i=this.getCurrentCellStyle(n[0]),l=mxUtils.getValue(i,t,e)?0:1,this.setCellStyles(t,l,n)),l},mxGraph.prototype.setCellStyles=function(t,e,n){n=n||this.getSelectionCells(),mxUtils.setCellStyles(this.model,n,t,e)},mxGraph.prototype.toggleCellStyleFlags=function(t,e,n){this.setCellStyleFlags(t,e,null,n)},mxGraph.prototype.setCellStyleFlags=function(t,e,n,i){var l;null!=(i=i||this.getSelectionCells())&&0<i.length&&(null==n&&(l=this.getCurrentCellStyle(i[0]),n=!((parseInt(l[t]||0)&e)==e)),mxUtils.setCellStyleFlags(this.model,i,t,e,n))},mxGraph.prototype.alignCells=function(t,e,n){if(null==e&&(e=this.getSelectionCells()),null!=e&&1<e.length){if(null==n)for(var i=0;i<e.length;i++)if(null!=(s=this.view.getState(e[i]))&&!this.model.isEdge(e[i]))if(null==n){if(t==mxConstants.ALIGN_CENTER){n=s.x+s.width/2;break}if(t==mxConstants.ALIGN_RIGHT)n=s.x+s.width;else if(t==mxConstants.ALIGN_TOP)n=s.y;else{if(t==mxConstants.ALIGN_MIDDLE){n=s.y+s.height/2;break}n=t==mxConstants.ALIGN_BOTTOM?s.y+s.height:s.x}}else n=t==mxConstants.ALIGN_RIGHT?Math.max(n,s.x+s.width):t==mxConstants.ALIGN_TOP?Math.min(n,s.y):t==mxConstants.ALIGN_BOTTOM?Math.max(n,s.y+s.height):Math.min(n,s.x);if(null!=n){var l=this.view.scale;this.model.beginUpdate();try{for(var s,o,i=0;i<e.length;i++)null!=(s=this.view.getState(e[i]))&&(null==(o=this.getCellGeometry(e[i]))||this.model.isEdge(e[i])||(o=o.clone(),t==mxConstants.ALIGN_CENTER?o.x+=(n-s.x-s.width/2)/l:t==mxConstants.ALIGN_RIGHT?o.x+=(n-s.x-s.width)/l:t==mxConstants.ALIGN_TOP?o.y+=(n-s.y)/l:t==mxConstants.ALIGN_MIDDLE?o.y+=(n-s.y-s.height/2)/l:t==mxConstants.ALIGN_BOTTOM?o.y+=(n-s.y-s.height)/l:o.x+=(n-s.x)/l,this.resizeCell(e[i],o)));this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",t,"cells",e))}finally{this.model.endUpdate()}}}return e},mxGraph.prototype.flipEdge=function(t){if(null!=t&&null!=this.alternateEdgeStyle){this.model.beginUpdate();try{var e=this.model.getStyle(t);null==e||0==e.length?this.model.setStyle(t,this.alternateEdgeStyle):this.model.setStyle(t,null),this.resetEdge(t),this.fireEvent(new mxEventObject(mxEvent.FLIP_EDGE,"edge",t))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.addImageBundle=function(t){this.imageBundles.push(t)},mxGraph.prototype.removeImageBundle=function(t){for(var e=[],n=0;n<this.imageBundles.length;n++)this.imageBundles[n]!=t&&e.push(this.imageBundles[n]);this.imageBundles=e},mxGraph.prototype.getImageFromBundles=function(t){if(null!=t)for(var e=0;e<this.imageBundles.length;e++){var n=this.imageBundles[e].getImage(t);if(null!=n)return n}return null},mxGraph.prototype.orderCells=function(t,e){null==e&&(e=mxUtils.sortCells(this.getSelectionCells(),!0)),this.model.beginUpdate();try{this.cellsOrdered(e,t),this.fireEvent(new mxEventObject(mxEvent.ORDER_CELLS,"back",t,"cells",e))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsOrdered=function(t,e){if(null!=t){this.model.beginUpdate();try{for(var n=0;n<t.length;n++){var i=this.model.getParent(t[n]);e?this.model.add(i,t[n],n):this.model.add(i,t[n],this.model.getChildCount(i)-1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ORDERED,"back",e,"cells",t))}finally{this.model.endUpdate()}}},mxGraph.prototype.groupCells=function(t,e,n){null==n&&(n=mxUtils.sortCells(this.getSelectionCells(),!0)),n=this.getCellsForGroup(n),null==t&&(t=this.createGroupCell(n));var i=this.getBoundsForGroup(t,n,e);if(1<n.length&&null!=i){var l=this.model.getParent(t);null==l&&(l=this.model.getParent(n[0])),this.model.beginUpdate();try{null==this.getCellGeometry(t)&&this.model.setGeometry(t,new mxGeometry);var s=this.model.getChildCount(l);this.cellsAdded([t],l,s,null,null,!1,!1,!1),s=this.model.getChildCount(t),this.cellsAdded(n,t,s,null,null,!1,!1,!1),this.cellsMoved(n,-i.x,-i.y,!1,!1,!1),this.cellsResized([t],[i],!1),this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",t,"border",e,"cells",n))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.getCellsForGroup=function(t){var e=[];if(null!=t&&0<t.length){var n=this.model.getParent(t[0]);e.push(t[0]);for(var i=1;i<t.length;i++)this.model.getParent(t[i])==n&&e.push(t[i])}return e},mxGraph.prototype.getBoundsForGroup=function(t,e,n){e=this.getBoundingBoxFromGeometry(e,!0);return null!=e&&(this.isSwimlane(t)&&(t=this.getStartSize(t),e.x-=t.width,e.y-=t.height,e.width+=t.width,e.height+=t.height),null!=n&&(e.x-=n,e.y-=n,e.width+=2*n,e.height+=2*n)),e},mxGraph.prototype.createGroupCell=function(t){var e=new mxCell("");return e.setVertex(!0),e.setConnectable(!1),e},mxGraph.prototype.ungroupCells=function(t){var e=[];if(null==t&&(t=this.getCellsForUngroup()),null!=t&&0<t.length){this.model.beginUpdate();try{for(var n=0;n<t.length;n++){var i=this.model.getChildren(t[n]);if(null!=i&&0<i.length){i=i.slice();var l=this.model.getParent(t[n]),s=this.model.getChildCount(l);this.cellsAdded(i,l,s,null,null,!0),e=e.concat(i);for(var o=0;o<i.length;o++){var r=this.view.getState(i[o]),a=this.getCellGeometry(i[o]);null!=r&&null!=a&&a.relative&&((a=a.clone()).x=r.origin.x,a.y=r.origin.y,a.relative=!1,this.model.setGeometry(i[o],a))}}}this.removeCellsAfterUngroup(t),this.fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS,"cells",t))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.getCellsForUngroup=function(){for(var t=this.getSelectionCells(),e=[],n=0;n<t.length;n++)this.model.isVertex(t[n])&&0<this.model.getChildCount(t[n])&&e.push(t[n]);return e},mxGraph.prototype.removeCellsAfterUngroup=function(t){this.cellsRemoved(this.addAllEdges(t))},mxGraph.prototype.removeCellsFromParent=function(t){null==t&&(t=this.getSelectionCells()),this.model.beginUpdate();try{var e=this.getDefaultParent(),n=this.model.getChildCount(e);this.cellsAdded(t,e,n,null,null,!0),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",t))}finally{this.model.endUpdate()}return t},mxGraph.prototype.updateGroupBounds=function(t,e,n,i,l,s,o){null==t&&(t=this.getSelectionCells()),e=null!=e?e:0,n=null!=n&&n,i=null!=i?i:0,l=null!=l?l:0,s=null!=s?s:0,o=null!=o?o:0,this.model.beginUpdate();try{for(var r=t.length-1;0<=r;r--){var a,h,d,u=this.getCellGeometry(t[r]);null==u||null!=(a=this.getChildCells(t[r]))&&0<a.length&&(null!=(h=this.getBoundingBoxFromGeometry(a,!0))&&0<h.width&&0<h.height&&(d=this.isSwimlane(t[r])?this.getActualStartSize(t[r],!0):new mxRectangle,u=u.clone(),n&&(u.x=Math.round(u.x+h.x-e-d.x-o),u.y=Math.round(u.y+h.y-e-d.y-i)),u.width=Math.round(h.width+2*e+d.x+o+l+d.width),u.height=Math.round(h.height+2*e+d.y+i+s+d.height),this.model.setGeometry(t[r],u),this.moveCells(a,e+d.x-h.x+o,e+d.y-h.y+i)))}}finally{this.model.endUpdate()}return t},mxGraph.prototype.getBoundingBox=function(t){var e=null;if(null!=t&&0<t.length)for(var n,i=0;i<t.length;i++)!this.model.isVertex(t[i])&&!this.model.isEdge(t[i])||null!=(n=this.view.getBoundingBox(this.view.getState(t[i]),!0))&&(null==e?e=mxRectangle.fromRectangle(n):e.add(n));return e},mxGraph.prototype.cloneCell=function(t,e,n,i){return this.cloneCells([t],e,n,i)[0]},mxGraph.prototype.cloneCells=function(t,e,n,i){e=null==e||e;var l=null;if(null!=t){for(var s=new mxDictionary,o=[],r=0;r<t.length;r++)s.put(t[r],!0),o.push(t[r]);if(0<o.length)for(var a=this.view.scale,h=this.view.translate,l=this.model.cloneCells(t,!0,n),r=0;r<t.length;r++)if(!e&&this.model.isEdge(l[r])&&null!=this.getEdgeValidationError(l[r],this.model.getTerminal(l[r],!0),this.model.getTerminal(l[r],!1)))l[r]=null;else{var d=this.model.getGeometry(l[r]);if(null!=d){var u=this.view.getState(t[r]),p=this.view.getState(this.model.getParent(t[r]));if(null!=u&&null!=p){var m=i?0:p.origin.x,c=i?0:p.origin.y;if(this.model.isEdge(l[r])){p=u.absolutePoints;if(null!=p){for(var g=this.model.getTerminal(t[r],!0);null!=g&&!s.get(g);)g=this.model.getParent(g);null==g&&null!=p[0]&&d.setTerminalPoint(new mxPoint(p[0].x/a-h.x,p[0].y/a-h.y),!0);for(var x=this.model.getTerminal(t[r],!1);null!=x&&!s.get(x);)x=this.model.getParent(x);u=p.length-1;null==x&&null!=p[u]&&d.setTerminalPoint(new mxPoint(p[u].x/a-h.x,p[u].y/a-h.y),!1);var y=d.points;if(null!=y)for(var f=0;f<y.length;f++)y[f].x+=m,y[f].y+=c}}else d.translate(m,c)}}}else l=[]}return l},mxGraph.prototype.insertVertex=function(t,e,n,i,l,s,o,r,a){a=this.createVertex(t,e,n,i,l,s,o,r,a);return this.addCell(a,t)},mxGraph.prototype.createVertex=function(t,e,n,i,l,s,o,r,a){o=new mxGeometry(i,l,s,o);o.relative=null!=a&&a;r=new mxCell(n,o,r);return r.setId(e),r.setVertex(!0),r.setConnectable(!0),r},mxGraph.prototype.insertEdge=function(t,e,n,i,l,s){s=this.createEdge(t,e,n,i,l,s);return this.addEdge(s,t,i,l)},mxGraph.prototype.createEdge=function(t,e,n,i,l,s){s=new mxCell(n,new mxGeometry,s);return s.setId(e),s.setEdge(!0),s.geometry.relative=!0,s},mxGraph.prototype.addEdge=function(t,e,n,i,l){return this.addCell(t,e,l,n,i)},mxGraph.prototype.addCell=function(t,e,n,i,l){return this.addCells([t],e,n,i,l)[0]},mxGraph.prototype.addCells=function(t,e,n,i,l,s){null==e&&(e=this.getDefaultParent()),null==n&&(n=this.model.getChildCount(e)),this.model.beginUpdate();try{this.cellsAdded(t,e,n,i,l,null!=s&&s,!0),this.fireEvent(new mxEventObject(mxEvent.ADD_CELLS,"cells",t,"parent",e,"index",n,"source",i,"target",l))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsAdded=function(t,e,n,i,l,s,o,r){if(null!=t&&null!=e&&null!=n){this.model.beginUpdate();try{for(var a,h,d,u,p=s?this.view.getState(e):null,m=null!=p?p.origin:null,c=new mxPoint(0,0),g=0;g<t.length;g++)null==t[g]?n--:(a=this.model.getParent(t[g]),null!=m&&t[g]!=e&&e!=a&&(d=null!=(h=this.view.getState(a))?h.origin:c,null!=(u=this.model.getGeometry(t[g]))&&(h=d.x-m.x,d=d.y-m.y,(u=u.clone()).translate(h,d),u.relative||!this.model.isVertex(t[g])||this.isAllowNegativeCoordinates()||(u.x=Math.max(0,u.x),u.y=Math.max(0,u.y)),this.model.setGeometry(t[g],u))),e==a&&n+g>this.model.getChildCount(e)&&n--,this.model.add(e,t[g],n+g),this.autoSizeCellsOnAdd&&this.autoSizeCell(t[g],!0),(null==r||r)&&this.isExtendParentsOnAdd(t[g])&&this.isExtendParent(t[g])&&this.extendParent(t[g]),null!=o&&!o||this.constrainChild(t[g]),null!=i&&this.cellConnected(t[g],i,!0),null!=l&&this.cellConnected(t[g],l,!1));this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",t,"parent",e,"index",n,"source",i,"target",l,"absolute",s))}finally{this.model.endUpdate()}}},mxGraph.prototype.autoSizeCell=function(t,e){if(e=null==e||e)for(var n=this.model.getChildCount(t),i=0;i<n;i++)this.autoSizeCell(this.model.getChildAt(t,i));this.getModel().isVertex(t)&&this.isAutoSizeCell(t)&&this.updateCellSize(t)},mxGraph.prototype.removeCells=function(t,e){if(e=null==e||e,null==t&&(t=this.getDeletableCells(this.getSelectionCells())),e)t=this.getDeletableCells(this.addAllEdges(t));else{t=t.slice();for(var n=this.getDeletableCells(this.getAllEdges(t)),i=new mxDictionary,l=0;l<t.length;l++)i.put(t[l],!0);for(l=0;l<n.length;l++)null!=this.view.getState(n[l])||i.get(n[l])||(i.put(n[l],!0),t.push(n[l]))}this.model.beginUpdate();try{this.cellsRemoved(t),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS,"cells",t,"includeEdges",e))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsRemoved=function(h){if(null!=h&&0<h.length){var d=this.view.scale,u=this.view.translate;this.model.beginUpdate();try{for(var t=new mxDictionary,p=0;p<h.length;p++)t.put(h[p],!0);for(p=0;p<h.length;p++){for(var e=this.getAllEdges([h[p]]),n=mxUtils.bind(this,function(t,e){var n=this.model.getGeometry(t);if(null!=n){for(var i,l,s,o=this.model.getTerminal(t,e),r=!1,a=o;null!=a;){if(h[p]==a){r=!0;break}a=this.model.getParent(a)}r&&(n=n.clone(),null!=(i=this.view.getState(t))&&null!=i.absolutePoints?(l=i.absolutePoints,s=e?0:l.length-1,n.setTerminalPoint(new mxPoint(l[s].x/d-u.x-i.origin.x,l[s].y/d-u.y-i.origin.y),e)):null!=(o=this.view.getState(o))&&n.setTerminalPoint(new mxPoint(o.getCenterX()/d-u.x,o.getCenterY()/d-u.y),e),this.model.setGeometry(t,n),this.model.setTerminal(t,null,e))}}),i=0;i<e.length;i++)t.get(e[i])||(t.put(e[i],!0),n(e[i],!0),n(e[i],!1));this.model.remove(h[p])}this.fireEvent(new mxEventObject(mxEvent.CELLS_REMOVED,"cells",h))}finally{this.model.endUpdate()}}},mxGraph.prototype.splitEdge=function(t,e,n,i,l,s,o,r){i=i||0,l=l||0,r=null!=r?r:this.model.getParent(t);var a,h,d,u,p=this.model.getTerminal(t,!0);this.model.beginUpdate();try{null==n&&(n=this.cloneCell(t),a=this.view.getState(t),null!=(h=this.getCellGeometry(n))&&null!=h.points&&null!=a&&(d=this.view.translate,u=this.view.scale,u=mxUtils.findNearestSegment(a,(i+d.x)*u,(l+d.y)*u),h.points=h.points.slice(0,u),null!=(h=this.getCellGeometry(t))&&null!=h.points&&((h=h.clone()).points=h.points.slice(u),this.model.setGeometry(t,h)))),this.cellsMoved(e,i,l,!1,!1),this.cellsAdded(e,r,this.model.getChildCount(r),null,null,!0),this.cellsAdded([n],r,this.model.getChildCount(r),p,e[0],!1),this.cellConnected(t,e[0],!0),this.fireEvent(new mxEventObject(mxEvent.SPLIT_EDGE,"edge",t,"cells",e,"newEdge",n,"dx",i,"dy",l))}finally{this.model.endUpdate()}return n},mxGraph.prototype.toggleCells=function(t,e,n){null==e&&(e=this.getSelectionCells()),n&&(e=this.addAllEdges(e)),this.model.beginUpdate();try{this.cellsToggled(e,t),this.fireEvent(new mxEventObject(mxEvent.TOGGLE_CELLS,"show",t,"cells",e,"includeEdges",n))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsToggled=function(t,e){if(null!=t&&0<t.length){this.model.beginUpdate();try{for(var n=0;n<t.length;n++)this.model.setVisible(t[n],e)}finally{this.model.endUpdate()}}},mxGraph.prototype.foldCells=function(t,e,n,i,l){e=null!=e&&e,null==n&&(n=this.getFoldableCells(this.getSelectionCells(),t)),this.stopEditing(!1),this.model.beginUpdate();try{this.cellsFolded(n,t,e,i),this.fireEvent(new mxEventObject(mxEvent.FOLD_CELLS,"collapse",t,"recurse",e,"cells",n))}finally{this.model.endUpdate()}return n},mxGraph.prototype.cellsFolded=function(t,e,n,i){if(null!=t&&0<t.length){this.model.beginUpdate();try{for(var l,s=0;s<t.length;s++)i&&!this.isCellFoldable(t[s],e)||e==this.isCellCollapsed(t[s])||(this.model.setCollapsed(t[s],e),this.swapBounds(t[s],e),this.isExtendParent(t[s])&&this.extendParent(t[s]),n&&(l=this.model.getChildren(t[s]),this.cellsFolded(l,e,n)),this.constrainChild(t[s]));this.fireEvent(new mxEventObject(mxEvent.CELLS_FOLDED,"cells",t,"collapse",e,"recurse",n))}finally{this.model.endUpdate()}}},mxGraph.prototype.swapBounds=function(t,e){var n;null==t||null!=(n=this.model.getGeometry(t))&&(n=n.clone(),this.updateAlternateBounds(t,n,e),n.swap(),this.model.setGeometry(t,n))},mxGraph.prototype.updateAlternateBounds=function(t,e,n){var i,l,s,o;null!=t&&null!=e&&(s=this.getCurrentCellStyle(t),null==e.alternateBounds&&(o=e,!this.collapseToPreferredSize||null!=(i=this.getPreferredSizeForCell(t))&&(o=i,0<(l=mxUtils.getValue(s,mxConstants.STYLE_STARTSIZE))&&(o.height=Math.max(o.height,l))),e.alternateBounds=new mxRectangle(0,0,o.width,o.height)),null!=e.alternateBounds&&(e.alternateBounds.x=e.x,e.alternateBounds.y=e.y,0!=(t=mxUtils.toRadians(s[mxConstants.STYLE_ROTATION]||0))&&(i=e.alternateBounds.getCenterX()-e.getCenterX(),l=e.alternateBounds.getCenterY()-e.getCenterY(),t=(o=Math.cos(t))*i-(s=Math.sin(t))*l,o=s*i+o*l,e.alternateBounds.x+=t-i,e.alternateBounds.y+=o-l)))},mxGraph.prototype.addAllEdges=function(t){var e=t.slice();return mxUtils.removeDuplicates(e.concat(this.getAllEdges(t)))},mxGraph.prototype.getAllEdges=function(t){var e=[];if(null!=t)for(var n=0;n<t.length;n++){for(var i=this.model.getEdgeCount(t[n]),l=0;l<i;l++)e.push(this.model.getEdgeAt(t[n],l));var s=this.model.getChildren(t[n]),e=e.concat(this.getAllEdges(s))}return e},mxGraph.prototype.updateCellSize=function(t,e){e=null!=e&&e,this.model.beginUpdate();try{this.cellSizeUpdated(t,e),this.fireEvent(new mxEventObject(mxEvent.UPDATE_CELL_SIZE,"cell",t,"ignoreChildren",e))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellSizeUpdated=function(t,e){if(null!=t){this.model.beginUpdate();try{var n,i,l,s,o,r=this.getPreferredSizeForCell(t),a=this.model.getGeometry(t);null!=r&&null!=a&&(s=this.isCellCollapsed(t),a=a.clone(),this.isSwimlane(t)?(n=this.getCellStyle(t),null==(i=this.model.getStyle(t))&&(i=""),mxUtils.getValue(n,mxConstants.STYLE_HORIZONTAL,!0)?(i=mxUtils.setStyle(i,mxConstants.STYLE_STARTSIZE,r.height+8),s&&(a.height=r.height+8),a.width=r.width):(i=mxUtils.setStyle(i,mxConstants.STYLE_STARTSIZE,r.width+8),s&&(a.width=r.width+8),a.height=r.height),this.model.setStyle(t,i)):((o=(l=this.view.createState(t)).style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER)==mxConstants.ALIGN_RIGHT?a.x+=a.width-r.width:o==mxConstants.ALIGN_CENTER&&(a.x+=Math.round((a.width-r.width)/2)),(o=this.getVerticalAlign(l))==mxConstants.ALIGN_BOTTOM?a.y+=a.height-r.height:o==mxConstants.ALIGN_MIDDLE&&(a.y+=Math.round((a.height-r.height)/2)),a.width=r.width,a.height=r.height),e||s||null!=(l=this.view.getBounds(this.model.getChildren(t)))&&(o=this.view.translate,r=this.view.scale,s=(l.x+l.width)/r-a.x-o.x,o=(l.y+l.height)/r-a.y-o.y,a.width=Math.max(a.width,s),a.height=Math.max(a.height,o)),this.cellsResized([t],[a],!1))}finally{this.model.endUpdate()}}},mxGraph.prototype.getPreferredSizeForCell=function(t,e){var n,i,l,s,o,r,a=null;return null!=t&&(s=(n=this.view.createState(t)).style,this.model.isEdge(t)||(i=s[mxConstants.STYLE_FONTSIZE]||mxConstants.DEFAULT_FONTSIZE,l=o=0,null==this.getImage(n)&&null==s[mxConstants.STYLE_IMAGE]||s[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_LABEL&&(s[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(o+=parseFloat(s[mxConstants.STYLE_IMAGE_WIDTH])||mxLabel.prototype.imageSize),s[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(l+=parseFloat(s[mxConstants.STYLE_IMAGE_HEIGHT])||mxLabel.prototype.imageSize)),o+=2*(s[mxConstants.STYLE_SPACING]||0),o+=s[mxConstants.STYLE_SPACING_LEFT]||0,o+=s[mxConstants.STYLE_SPACING_RIGHT]||0,l+=2*(s[mxConstants.STYLE_SPACING]||0),l+=s[mxConstants.STYLE_SPACING_TOP]||0,l+=s[mxConstants.STYLE_SPACING_BOTTOM]||0,null!=(t=this.getFoldingImage(n))&&(o+=t.width+8),a=null!=(t=this.cellRenderer.getLabelValue(n))&&0<t.length?(this.isHtmlLabel(n.cell)||(t=mxUtils.htmlEntities(t,!1)),t=t.replace(/\n/g,"<br>"),o=(r=mxUtils.getSizeForString(t,i,s[mxConstants.STYLE_FONTFAMILY],e,s[mxConstants.STYLE_FONTSTYLE])).width+o,r=r.height+l,mxUtils.getValue(s,mxConstants.STYLE_HORIZONTAL,!0)||(s=r,r=o,o=s),this.gridEnabled&&(o=this.snap(o+this.gridSize/2),r=this.snap(r+this.gridSize/2)),new mxRectangle(0,0,o,r)):new mxRectangle(0,0,r=4*this.gridSize,r))),a},mxGraph.prototype.resizeCell=function(t,e,n){return this.resizeCells([t],[e],n)[0]},mxGraph.prototype.resizeCells=function(t,e,n){n=null!=n?n:this.isRecursiveResize(),this.model.beginUpdate();try{var i=this.cellsResized(t,e,n);this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",t,"bounds",e,"previous",i))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsResized=function(t,e,n){n=null!=n&&n;var i=[];if(null!=t&&null!=e&&t.length==e.length){this.model.beginUpdate();try{for(var l=0;l<t.length;l++)i.push(this.cellResized(t[l],e[l],!1,n)),this.isExtendParent(t[l])&&this.extendParent(t[l]),this.constrainChild(t[l]);this.resetEdgesOnResize&&this.resetEdges(t),this.fireEvent(new mxEventObject(mxEvent.CELLS_RESIZED,"cells",t,"bounds",e,"previous",i))}finally{this.model.endUpdate()}}return i},mxGraph.prototype.cellResized=function(t,e,n,i){var l=this.model.getGeometry(t);if(null!=l&&(l.x!=e.x||l.y!=e.y||l.width!=e.width||l.height!=e.height)){var s=l.clone();!n&&s.relative?null!=(n=s.offset)&&(n.x+=e.x-s.x,n.y+=e.y-s.y):(s.x=e.x,s.y=e.y),s.width=e.width,s.height=e.height,s.relative||!this.model.isVertex(t)||this.isAllowNegativeCoordinates()||(s.x=Math.max(0,s.x),s.y=Math.max(0,s.y)),this.model.beginUpdate();try{i&&this.resizeChildCells(t,s),this.model.setGeometry(t,s),this.constrainChildCells(t)}finally{this.model.endUpdate()}}return l},mxGraph.prototype.resizeChildCells=function(t,e){for(var n=this.model.getGeometry(t),i=0!=n.width?e.width/n.width:1,l=0!=n.height?e.height/n.height:1,s=this.model.getChildCount(t),o=0;o<s;o++)this.scaleCell(this.model.getChildAt(t,o),i,l,!0)},mxGraph.prototype.constrainChildCells=function(t){for(var e=this.model.getChildCount(t),n=0;n<e;n++)this.constrainChild(this.model.getChildAt(t,n))},mxGraph.prototype.scaleCell=function(t,e,n,i){var l,s,o,r,a,h=this.model.getGeometry(t);null!=h&&(l=this.getCurrentCellStyle(t),s=(h=h.clone()).x,o=h.y,r=h.width,a=h.height,h.scale(e,n,"fixed"==l[mxConstants.STYLE_ASPECT]),"1"==l[mxConstants.STYLE_RESIZE_WIDTH]?h.width=r*e:"0"==l[mxConstants.STYLE_RESIZE_WIDTH]&&(h.width=r),"1"==l[mxConstants.STYLE_RESIZE_HEIGHT]?h.height=a*n:"0"==l[mxConstants.STYLE_RESIZE_HEIGHT]&&(h.height=a),this.isCellMovable(t)||(h.x=s,h.y=o),this.isCellResizable(t)||(h.width=r,h.height=a),this.model.isVertex(t)?this.cellResized(t,h,!0,i):this.model.setGeometry(t,h))},mxGraph.prototype.extendParent=function(t){var e,n;null!=t&&(e=this.model.getParent(t),n=this.getCellGeometry(e),null==e||null==n||this.isCellCollapsed(e)||null!=(t=this.getCellGeometry(t))&&!t.relative&&(n.width<t.x+t.width||n.height<t.y+t.height)&&((n=n.clone()).width=Math.max(n.width,t.x+t.width),n.height=Math.max(n.height,t.y+t.height),this.cellsResized([e],[n],!1)))},mxGraph.prototype.importCells=function(t,e,n,i,l,s){return this.moveCells(t,e,n,!0,i,l,s)},mxGraph.prototype.moveCells=function(t,e,n,i,l,s,o){if(e=null!=e?e:0,n=null!=n?n:0,i=null!=i&&i,null!=t&&(0!=e||0!=n||i||null!=l)){var r=t=this.model.getTopmostCells(t);this.model.beginUpdate();try{for(var a=new mxDictionary,h=0;h<t.length;h++)a.put(t[h],!0);for(var d=mxUtils.bind(this,function(t){for(;null!=t;){if(a.get(t))return!0;t=this.model.getParent(t)}return!1}),u=[],h=0;h<t.length;h++){var p=this.getCellGeometry(t[h]),m=this.model.getParent(t[h]);null!=p&&p.relative&&this.model.isEdge(m)&&(d(this.model.getTerminal(m,!0))||d(this.model.getTerminal(m,!1)))||u.push(t[h])}t=u,i&&(t=this.cloneCells(t,this.isCloneInvalidEdges(),o),null==l&&(l=this.getDefaultParent()));var c=this.isAllowNegativeCoordinates();if(null!=l&&this.setAllowNegativeCoordinates(!0),this.cellsMoved(t,e,n,!i&&this.isDisconnectOnMove()&&this.isAllowDanglingEdges(),null==l,this.isExtendParentsOnMove()&&null==l),this.setAllowNegativeCoordinates(c),null!=l){c=this.model.getChildCount(l);if(this.cellsAdded(t,l,c,null,null,!0),i)for(h=0;h<t.length;h++){p=this.getCellGeometry(t[h]),m=this.model.getParent(r[h]);null!=p&&p.relative&&this.model.isEdge(m)&&this.model.contains(m)&&this.model.add(m,t[h])}}this.fireEvent(new mxEventObject(mxEvent.MOVE_CELLS,"cells",t,"dx",e,"dy",n,"clone",i,"target",l,"event",s))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.cellsMoved=function(t,e,n,i,l,s){if(null!=t&&(0!=e||0!=n)){s=null!=s&&s,this.model.beginUpdate();try{i&&this.disconnectGraph(t);for(var o=0;o<t.length;o++)this.translateCell(t[o],e,n),s&&this.isExtendParent(t[o])?this.extendParent(t[o]):l&&this.constrainChild(t[o]);this.resetEdgesOnMove&&this.resetEdges(t),this.fireEvent(new mxEventObject(mxEvent.CELLS_MOVED,"cells",t,"dx",e,"dy",n,"disconnect",i))}finally{this.model.endUpdate()}}},mxGraph.prototype.translateCell=function(t,e,n){var i,l,s,o=this.model.getGeometry(t);null!=o&&(e=parseFloat(e),n=parseFloat(n),(o=o.clone()).translate(e,n),o.relative||!this.model.isVertex(t)||this.isAllowNegativeCoordinates()||(o.x=Math.max(0,parseFloat(o.x)),o.y=Math.max(0,parseFloat(o.y))),o.relative&&!this.model.isEdge(t)&&(i=this.model.getParent(t),l=0,this.model.isVertex(i)&&(s=this.getCurrentCellStyle(i),l=mxUtils.getValue(s,mxConstants.STYLE_ROTATION,0)),0!=l&&(s=mxUtils.toRadians(-l),l=Math.cos(s),s=Math.sin(s),e=(s=mxUtils.getRotatedPoint(new mxPoint(e,n),l,s,new mxPoint(0,0))).x,n=s.y),null==o.offset?o.offset=new mxPoint(e,n):(o.offset.x=parseFloat(o.offset.x)+e,o.offset.y=parseFloat(o.offset.y)+n)),this.model.setGeometry(t,o))},mxGraph.prototype.getCellContainmentArea=function(t){if(null!=t&&!this.model.isEdge(t)){var e=this.model.getParent(t);if(null!=e&&e!=this.getDefaultParent()){var n=this.model.getGeometry(e);if(null!=n){var i,l,s=0,o=0,r=n.width,a=n.height;return this.isSwimlane(e)&&(i=this.getStartSize(e),l=this.getCurrentCellStyle(e),t=mxUtils.getValue(l,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),n=1==mxUtils.getValue(l,mxConstants.STYLE_FLIPH,0),e=1==mxUtils.getValue(l,mxConstants.STYLE_FLIPV,0),t!=mxConstants.DIRECTION_SOUTH&&t!=mxConstants.DIRECTION_NORTH||(l=i.width,i.width=i.height,i.height=l),(t==mxConstants.DIRECTION_EAST&&!e||t==mxConstants.DIRECTION_NORTH&&!n||t==mxConstants.DIRECTION_WEST&&e||t==mxConstants.DIRECTION_SOUTH&&n)&&(s=i.width,o=i.height),r-=i.width,a-=i.height),new mxRectangle(s,o,r,a)}}}return null},mxGraph.prototype.getMaximumGraphBounds=function(){return this.maximumGraphBounds},mxGraph.prototype.constrainChild=function(t,e){if(e=null==e||e,null!=t){var n=this.getCellGeometry(t);if(null!=n&&(this.isConstrainRelativeChildren()||!n.relative)){var i=this.model.getParent(t),e=(this.getCellGeometry(i),this.getMaximumGraphBounds());if(null==e||null!=(h=this.getBoundingBoxFromGeometry([i],!1))&&((e=mxRectangle.fromRectangle(e)).x-=h.x,e.y-=h.y),!this.isConstrainChild(t)||null!=(a=this.getCellContainmentArea(t))&&(0<(r=this.getOverlap(t))&&((a=mxRectangle.fromRectangle(a)).x-=a.width*r,a.y-=a.height*r,a.width+=2*a.width*r,a.height+=2*a.height*r),null==e?e=a:(e=mxRectangle.fromRectangle(e)).intersect(a)),null!=e){var l=[t];if(!this.isCellCollapsed(t))for(var s=this.model.getDescendants(t),o=0;o<s.length;o++)this.isCellVisible(s[o])&&l.push(s[o]);var r,a,h=this.getBoundingBoxFromGeometry(l,!1);null!=h&&(r=0,(n=n.clone()).width>e.width&&(r=n.width-e.width,n.width-=r),h.x+h.width>e.x+e.width&&(r-=h.x+h.width-e.x-e.width-r),a=0,n.height>e.height&&(a=n.height-e.height,n.height-=a),h.y+h.height>e.y+e.height&&(a-=h.y+h.height-e.y-e.height-a),h.x<e.x&&(r-=h.x-e.x),h.y<e.y&&(a-=h.y-e.y),0==r&&0==a||(n.relative?(null==n.offset&&(n.offset=new mxPoint),n.offset.x+=r,n.offset.y+=a):(n.x+=r,n.y+=a)),this.model.setGeometry(t,n))}}}},mxGraph.prototype.resetEdges=function(t){if(null!=t){for(var e=new mxDictionary,n=0;n<t.length;n++)e.put(t[n],!0);this.model.beginUpdate();try{for(n=0;n<t.length;n++){var i=this.model.getEdges(t[n]);if(null!=i)for(var l=0;l<i.length;l++){var s=this.view.getState(i[l]),o=null!=s?s.getVisibleTerminal(!0):this.view.getVisibleTerminal(i[l],!0),s=null!=s?s.getVisibleTerminal(!1):this.view.getVisibleTerminal(i[l],!1);e.get(o)&&e.get(s)||this.resetEdge(i[l])}this.resetEdges(this.model.getChildren(t[n]))}}finally{this.model.endUpdate()}}},mxGraph.prototype.resetEdge=function(t){var e=this.model.getGeometry(t);return null!=e&&null!=e.points&&0<e.points.length&&((e=e.clone()).points=[],this.model.setGeometry(t,e)),t},mxGraph.prototype.getOutlineConstraint=function(t,e,n){if(null==e.shape)return null;var i=this.view.getPerimeterBounds(e),l=e.style[mxConstants.STYLE_DIRECTION];l!=mxConstants.DIRECTION_NORTH&&l!=mxConstants.DIRECTION_SOUTH||(i.x+=i.width/2-i.height/2,i.y+=i.height/2-i.width/2,o=i.width,i.width=i.height,i.height=o);var s=mxUtils.toRadians(e.shape.getShapeRotation());0!=s&&(u=Math.cos(-s),r=Math.sin(-s),a=new mxPoint(i.getCenterX(),i.getCenterY()),t=mxUtils.getRotatedPoint(t,u,r,a));var o,r,a,h=1,d=1,s=0,u=0;return this.getModel().isVertex(e.cell)&&(r=e.style[mxConstants.STYLE_FLIPH],a=e.style[mxConstants.STYLE_FLIPV],null!=e.shape&&null!=e.shape.stencil&&(r=1==mxUtils.getValue(e.style,"stencilFlipH",0)||r,a=1==mxUtils.getValue(e.style,"stencilFlipV",0)||a),l!=mxConstants.DIRECTION_NORTH&&l!=mxConstants.DIRECTION_SOUTH||(o=r,r=a,a=o),r&&(h=-1,s=-i.width),a&&(d=-1,u=-i.height)),t=new mxPoint((t.x-i.x)*h-s+i.x,(t.y-i.y)*d-u+i.y),new mxConnectionConstraint(new mxPoint(0==i.width?0:Math.round(1e3*(t.x-i.x)/i.width)/1e3,0==i.height?0:Math.round(1e3*(t.y-i.y)/i.height)/1e3),!1)},mxGraph.prototype.getAllConnectionConstraints=function(t,e){return null!=t&&null!=t.shape&&null!=t.shape.stencil?t.shape.stencil.constraints:null},mxGraph.prototype.getConnectionConstraint=function(t,e,n){var i=null,l=t.style[n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];null==l||null!=(o=t.style[n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y])&&(i=new mxPoint(parseFloat(l),parseFloat(o)));var s=!1,l=0,o=0;return null!=i&&(s=mxUtils.getValue(t.style,n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0),l=parseFloat(t.style[n?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX]),o=parseFloat(t.style[n?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY]),l=isFinite(l)?l:0,o=isFinite(o)?o:0),new mxConnectionConstraint(i,s,null,l,o)},mxGraph.prototype.setConnectionConstraint=function(t,e,n,i){if(null!=i){this.model.beginUpdate();try{null==i||null==i.point?(this.setCellStyles(n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t])):null!=i.point&&(this.setCellStyles(n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,i.point.x,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,i.point.y,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,i.dx,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,i.dy,[t]),i.perimeter?this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t]):this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[t]))}finally{this.model.endUpdate()}}},mxGraph.prototype.getConnectionPoint=function(t,e,n){n=null==n||n;var i,l,s,o,r,a,h,d=null;return null!=t&&null!=e.point&&(l=new mxPoint((i=this.view.getPerimeterBounds(t)).getCenterX(),i.getCenterY()),o=0,null!=(s=t.style[mxConstants.STYLE_DIRECTION])&&1==mxUtils.getValue(t.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(s==mxConstants.DIRECTION_NORTH?o+=270:s==mxConstants.DIRECTION_WEST?o+=180:s==mxConstants.DIRECTION_SOUTH&&(o+=90),s!=mxConstants.DIRECTION_NORTH&&s!=mxConstants.DIRECTION_SOUTH||i.rotate90()),r=this.view.scale,d=new mxPoint(i.x+e.point.x*i.width+e.dx*r,i.y+e.point.y*i.height+e.dy*r),r=t.style[mxConstants.STYLE_ROTATION]||0,e.perimeter?(0!=o&&(h=a=0,90==o?h=1:180==o?a=-1:270==o&&(h=-1),d=mxUtils.getRotatedPoint(d,a,h,l)),d=this.view.getPerimeterPoint(t,d,!1)):(r+=o,this.getModel().isVertex(t.cell)&&(e=1==t.style[mxConstants.STYLE_FLIPH],o=1==t.style[mxConstants.STYLE_FLIPV],null!=t.shape&&null!=t.shape.stencil&&(e=1==mxUtils.getValue(t.style,"stencilFlipH",0)||e,o=1==mxUtils.getValue(t.style,"stencilFlipV",0)||o),s!=mxConstants.DIRECTION_NORTH&&s!=mxConstants.DIRECTION_SOUTH||(s=e,e=o,o=s),e&&(d.x=2*i.getCenterX()-d.x),o&&(d.y=2*i.getCenterY()-d.y))),0!=r&&null!=d&&(r=mxUtils.toRadians(r),a=Math.cos(r),h=Math.sin(r),d=mxUtils.getRotatedPoint(d,a,h,l))),n&&null!=d&&(d.x=Math.round(d.x),d.y=Math.round(d.y)),d},mxGraph.prototype.connectCell=function(t,e,n,i){this.model.beginUpdate();try{var l=this.model.getTerminal(t,n);this.cellConnected(t,e,n,i),this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",t,"terminal",e,"source",n,"previous",l))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellConnected=function(t,e,n,i){if(null!=t){this.model.beginUpdate();try{var l,s,o=this.model.getTerminal(t,n);this.setConnectionConstraint(t,e,n,i),this.isPortsEnabled()&&(l=null,this.isPort(e)&&(l=e.getId(),e=this.getTerminalForPort(e,n)),s=n?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT,this.setCellStyles(s,l,[t])),this.model.setTerminal(t,e,n),this.resetEdgesOnConnect&&this.resetEdge(t),this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",t,"terminal",e,"source",n,"previous",o))}finally{this.model.endUpdate()}}},mxGraph.prototype.disconnectGraph=function(t){if(null!=t){this.model.beginUpdate();try{for(var e=this.view.scale,n=this.view.translate,i=new mxDictionary,l=0;l<t.length;l++)i.put(t[l],!0);for(l=0;l<t.length;l++)if(this.model.isEdge(t[l])){var s=this.model.getGeometry(t[l]);if(null!=s){var o=this.view.getState(t[l]),r=this.view.getState(this.model.getParent(t[l]));if(null!=o&&null!=r){s=s.clone();var a=-r.origin.x,h=-r.origin.y,r=o.absolutePoints,d=this.model.getTerminal(t[l],!0);if(null!=d&&this.isCellDisconnectable(t[l],d,!0)){for(;null!=d&&!i.get(d);)d=this.model.getParent(d);null==d&&(s.setTerminalPoint(new mxPoint(r[0].x/e-n.x+a,r[0].y/e-n.y+h),!0),this.model.setTerminal(t[l],null,!0))}var u=this.model.getTerminal(t[l],!1);if(null!=u&&this.isCellDisconnectable(t[l],u,!1)){for(;null!=u&&!i.get(u);)u=this.model.getParent(u);null==u&&(o=r.length-1,s.setTerminalPoint(new mxPoint(r[o].x/e-n.x+a,r[o].y/e-n.y+h),!1),this.model.setTerminal(t[l],null,!1))}this.model.setGeometry(t[l],s)}}}}finally{this.model.endUpdate()}}},mxGraph.prototype.getCurrentRoot=function(){return this.view.currentRoot},mxGraph.prototype.getTranslateForRoot=function(t){return null},mxGraph.prototype.isPort=function(t){return!1},mxGraph.prototype.getTerminalForPort=function(t,e){return this.model.getParent(t)},mxGraph.prototype.getChildOffsetForCell=function(t){return null},mxGraph.prototype.enterGroup=function(t){null!=(t=t||this.getSelectionCell())&&this.isValidRoot(t)&&(this.view.setCurrentRoot(t),this.clearSelection())},mxGraph.prototype.exitGroup=function(){var t=this.model.getRoot(),e=this.getCurrentRoot();if(null!=e){for(var n=this.model.getParent(e);n!=t&&!this.isValidRoot(n)&&this.model.getParent(n)!=t;)n=this.model.getParent(n);n==t||this.model.getParent(n)==t?this.view.setCurrentRoot(null):this.view.setCurrentRoot(n),null!=this.view.getState(e)&&this.setSelectionCell(e)}},mxGraph.prototype.home=function(){var t=this.getCurrentRoot();null!=t&&(this.view.setCurrentRoot(null),null!=this.view.getState(t)&&this.setSelectionCell(t))},mxGraph.prototype.isValidRoot=function(t){return null!=t},mxGraph.prototype.getGraphBounds=function(){return this.view.getGraphBounds()},mxGraph.prototype.getCellBounds=function(t,e,n){var i=[t];e&&(i=i.concat(this.model.getEdges(t)));var l=this.view.getBounds(i);if(n)for(var s=this.model.getChildCount(t),o=0;o<s;o++){var r=this.getCellBounds(this.model.getChildAt(t,o),e,!0);null!=l?l.add(r):l=r}return l},mxGraph.prototype.getBoundingBoxFromGeometry=function(t,e){e=null!=e&&e;var n=null;if(null!=t)for(var i=0;i<t.length;i++)if(e||this.model.isVertex(t[i])){var l=this.getCellGeometry(t[i]);if(null!=l){var s=null;if(this.model.isEdge(t[i])){function o(t){null!=t&&(null==a?a=new mxRectangle(t.x,t.y,0,0):a.add(new mxRectangle(t.x,t.y,0,0)))}null==this.model.getTerminal(t[i],!0)&&o(l.getTerminalPoint(!0)),null==this.model.getTerminal(t[i],!1)&&o(l.getTerminalPoint(!1));var r=l.points;if(null!=r&&0<r.length)for(var a=new mxRectangle(r[0].x,r[0].y,0,0),h=1;h<r.length;h++)o(r[h]);s=a}else{var d=this.model.getParent(t[i]);l.relative?this.model.isVertex(d)&&d!=this.view.currentRoot&&null!=(a=this.getBoundingBoxFromGeometry([d],!1))&&(s=new mxRectangle(l.x*a.width,l.y*a.height,l.width,l.height),0<=mxUtils.indexOf(t,d)&&(s.x+=a.x,s.y+=a.y)):(s=mxRectangle.fromRectangle(l),this.model.isVertex(d)&&0<=mxUtils.indexOf(t,d)&&null!=(a=this.getBoundingBoxFromGeometry([d],!1))&&(s.x+=a.x,s.y+=a.y)),null!=s&&null!=l.offset&&(s.x+=l.offset.x,s.y+=l.offset.y);l=this.getCurrentCellStyle(t[i]);null==s||0!=(l=mxUtils.getValue(l,mxConstants.STYLE_ROTATION,0))&&(s=mxUtils.getBoundingBox(s,l))}null!=s&&(null==n?n=mxRectangle.fromRectangle(s):n.add(s))}}return n},mxGraph.prototype.refresh=function(t){this.view.clear(t,null==t),this.view.validate(),this.sizeDidChange(),this.fireEvent(new mxEventObject(mxEvent.REFRESH))},mxGraph.prototype.snap=function(t){return this.gridEnabled&&(t=Math.round(t/this.gridSize)*this.gridSize),t},mxGraph.prototype.snapDelta=function(t,e,n,i,l){var s,o,r,a=this.view.translate,h=this.view.scale;return!n&&this.gridEnabled?(s=this.gridSize*h*.5,i||(o=e.x-(this.snap(e.x/h-a.x)+a.x)*h,Math.abs(t.x-o)<s?t.x=0:t.x=this.snap(t.x/h)*h-o),l||(r=e.y-(this.snap(e.y/h-a.y)+a.y)*h,Math.abs(t.y-r)<s?t.y=0:t.y=this.snap(t.y/h)*h-r)):(s=.5*h,i||(o=e.x-(Math.round(e.x/h-a.x)+a.x)*h,Math.abs(t.x-o)<s?t.x=0:t.x=Math.round(t.x/h)*h-o),l||(r=e.y-(Math.round(e.y/h-a.y)+a.y)*h,Math.abs(t.y-r)<s?t.y=0:t.y=Math.round(t.y/h)*h-r)),t},mxGraph.prototype.panGraph=function(t,e){if(this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container))this.container.scrollLeft=-t,this.container.scrollTop=-e;else{var n=this.view.getCanvas();if(this.dialect==mxConstants.DIALECT_SVG)if(0==t&&0==e){if(mxClient.IS_IE?n.setAttribute("transform","translate("+t+","+e+")"):n.removeAttribute("transform"),null!=this.shiftPreview1){for(var i=this.shiftPreview1.firstChild;null!=i;){var l=i.nextSibling;this.container.appendChild(i),i=l}for(null!=this.shiftPreview1.parentNode&&this.shiftPreview1.parentNode.removeChild(this.shiftPreview1),this.shiftPreview1=null,this.container.appendChild(n.parentNode),i=this.shiftPreview2.firstChild;null!=i;){l=i.nextSibling;this.container.appendChild(i),i=l}null!=this.shiftPreview2.parentNode&&this.shiftPreview2.parentNode.removeChild(this.shiftPreview2),this.shiftPreview2=null}}else{if(n.setAttribute("transform","translate("+t+","+e+")"),null==this.shiftPreview1){this.shiftPreview1=document.createElement("div"),this.shiftPreview1.style.position="absolute",this.shiftPreview1.style.overflow="visible",this.shiftPreview2=document.createElement("div"),this.shiftPreview2.style.position="absolute",this.shiftPreview2.style.overflow="visible";for(var s=this.shiftPreview1,i=this.container.firstChild;null!=i;){l=i.nextSibling;i!=n.parentNode?s.appendChild(i):s=this.shiftPreview2,i=l}null!=this.shiftPreview1.firstChild&&this.container.insertBefore(this.shiftPreview1,n.parentNode),null!=this.shiftPreview2.firstChild&&this.container.appendChild(this.shiftPreview2)}this.shiftPreview1.style.left=t+"px",this.shiftPreview1.style.top=e+"px",this.shiftPreview2.style.left=t+"px",this.shiftPreview2.style.top=e+"px"}else n.style.left=t+"px",n.style.top=e+"px";this.panDx=t,this.panDy=e,this.fireEvent(new mxEventObject(mxEvent.PAN))}},mxGraph.prototype.zoomIn=function(){this.zoom(this.zoomFactor)},mxGraph.prototype.zoomOut=function(){this.zoom(1/this.zoomFactor)},mxGraph.prototype.zoomActual=function(){1==this.view.scale?this.view.setTranslate(0,0):(this.view.translate.x=0,this.view.translate.y=0,this.view.setScale(1))},mxGraph.prototype.zoomTo=function(t,e){this.zoom(t/this.view.scale,e)},mxGraph.prototype.center=function(t,e,n,i){t=null==t||t,e=null==e||e,n=null!=n?n:.5,i=null!=i?i:.5;var l=mxUtils.hasScrollbars(this.container),s=2*this.getBorder(),o=this.container.clientWidth-s,r=this.container.clientHeight-s,a=this.getGraphBounds(),h=this.view.translate,d=this.view.scale,u=t?o-a.width:0,p=e?r-a.height:0;l?(a.x-=h.x,a.y-=h.y,o<(s=this.container.scrollWidth)&&(u=0),r<(l=this.container.scrollHeight)&&(p=0),this.view.setTranslate(Math.floor(u/2-a.x),Math.floor(p/2-a.y)),this.container.scrollLeft=(s-o)/2,this.container.scrollTop=(l-r)/2):this.view.setTranslate(t?Math.floor(h.x-a.x/d+u*n/d):h.x,e?Math.floor(h.y-a.y/d+p*i/d):h.y)},mxGraph.prototype.zoom=function(t,e){e=null!=e?e:this.centerZoom;var n,i,l,s,o,r,a=Math.round(this.view.scale*t*100)/100,h=this.view.getState(this.getSelectionCell());t=a/this.view.scale,this.keepSelectionVisibleOnZoom&&null!=h?(l=new mxRectangle(h.x*t,h.y*t,h.width*t,h.height*t),this.view.scale=a,this.scrollRectToVisible(l)||(this.view.revalidate(),this.view.setScale(a))):(n=mxUtils.hasScrollbars(this.container),e&&!n?(o=this.container.offsetWidth,r=this.container.offsetHeight,1<t?(o*=-(s=(t-1)/(2*a)),r*=-s):(o*=s=(1/t-1)/(2*this.view.scale),r*=s),this.view.scaleAndTranslate(a,this.view.translate.x+o,this.view.translate.y+r)):(i=this.view.translate.x,h=this.view.translate.y,l=this.container.scrollLeft,s=this.container.scrollTop,this.view.setScale(a),n&&(r=o=0,e&&(o=this.container.offsetWidth*(t-1)/2,r=this.container.offsetHeight*(t-1)/2),this.container.scrollLeft=(this.view.translate.x-i)*this.view.scale+Math.round(l*t+o),this.container.scrollTop=(this.view.translate.y-h)*this.view.scale+Math.round(s*t+r))))},mxGraph.prototype.zoomToRect=function(t){var e=this.container.clientWidth/t.width/(this.container.clientHeight/t.height);t.x=Math.max(0,t.x),t.y=Math.max(0,t.y);var n,i,l=Math.min(this.container.scrollWidth,t.x+t.width),s=Math.min(this.container.scrollHeight,t.y+t.height);t.width=l-t.x,t.height=s-t.y,e<1?(i=((n=t.height/e)-t.height)/2,t.height=n,i=Math.min(t.y,i),t.y=t.y-i,s=Math.min(this.container.scrollHeight,t.y+t.height),t.height=s-t.y):(o=((e=t.width*e)-t.width)/2,t.width=e,o=Math.min(t.x,o),t.x=t.x-o,l=Math.min(this.container.scrollWidth,t.x+t.width),t.width=l-t.x);var o=this.container.clientWidth/t.width,l=this.view.scale*o;mxUtils.hasScrollbars(this.container)?(this.view.setScale(l),this.container.scrollLeft=Math.round(t.x*o),this.container.scrollTop=Math.round(t.y*o)):this.view.scaleAndTranslate(l,this.view.translate.x-t.x/this.view.scale,this.view.translate.y-t.y/this.view.scale)},mxGraph.prototype.scrollCellToVisible=function(t,e){var n,i=-this.view.translate.x,l=-this.view.translate.y,t=this.view.getState(t);null!=t&&(t=new mxRectangle(i+t.x,l+t.y,t.width,t.height),e&&null!=this.container&&(e=this.container.clientWidth,n=this.container.clientHeight,t.x=t.getCenterX()-e/2,t.width=e,t.y=t.getCenterY()-n/2,t.height=n),n=new mxPoint(this.view.translate.x,this.view.translate.y),this.scrollRectToVisible(t)&&(t=new mxPoint(this.view.translate.x,this.view.translate.y),this.view.translate.x=n.x,this.view.translate.y=n.y,this.view.setTranslate(t.x,t.y)))},mxGraph.prototype.scrollRectToVisible=function(t){var e,n,i,l,s,o,r,a,h=!1;return null!=t&&(e=this.container.offsetWidth,n=this.container.offsetHeight,i=Math.min(e,t.width),l=Math.min(n,t.height),mxUtils.hasScrollbars(this.container)?(s=this.container,t.x+=this.view.translate.x,t.y+=this.view.translate.y,a=s.scrollLeft-t.x,r=Math.max(a-s.scrollLeft,0),0<a?s.scrollLeft-=a+2:0<(a=t.x+i-s.scrollLeft-s.clientWidth)&&(s.scrollLeft+=a+2),o=s.scrollTop-t.y,a=Math.max(0,o-s.scrollTop),0<o?s.scrollTop-=o+2:0<(o=t.y+l-s.scrollTop-s.clientHeight)&&(s.scrollTop+=o+2),this.useScrollbarsForPanning||0==r&&0==a||this.view.setTranslate(r,a)):(o=-this.view.translate.x,r=-this.view.translate.y,a=this.view.scale,t.x+i>o+e&&(this.view.translate.x-=(t.x+i-e-o)/a,h=!0),t.y+l>r+n&&(this.view.translate.y-=(t.y+l-n-r)/a,h=!0),t.x<o&&(this.view.translate.x+=(o-t.x)/a,h=!0),t.y<r&&(this.view.translate.y+=(r-t.y)/a,h=!0),h&&(this.view.refresh(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.refresh()))),h},mxGraph.prototype.getCellGeometry=function(t){return this.model.getGeometry(t)},mxGraph.prototype.isCellVisible=function(t){return this.model.isVisible(t)},mxGraph.prototype.isCellCollapsed=function(t){return this.model.isCollapsed(t)},mxGraph.prototype.isCellConnectable=function(t){return this.model.isConnectable(t)},mxGraph.prototype.isOrthogonal=function(t){var e=t.style[mxConstants.STYLE_ORTHOGONAL];if(null!=e)return e;t=this.view.getEdgeStyle(t);return t==mxEdgeStyle.SegmentConnector||t==mxEdgeStyle.ElbowConnector||t==mxEdgeStyle.SideToSide||t==mxEdgeStyle.TopToBottom||t==mxEdgeStyle.EntityRelation||t==mxEdgeStyle.OrthConnector},mxGraph.prototype.isLoop=function(t){var e=t.getVisibleTerminalState(!0),t=t.getVisibleTerminalState(!1);return null!=e&&e==t},mxGraph.prototype.isCloneEvent=function(t){return mxEvent.isControlDown(t)},mxGraph.prototype.isTransparentClickEvent=function(t){return!1},mxGraph.prototype.isToggleEvent=function(t){return mxClient.IS_MAC?mxEvent.isMetaDown(t):mxEvent.isControlDown(t)},mxGraph.prototype.isGridEnabledEvent=function(t){return null!=t&&!mxEvent.isAltDown(t)},mxGraph.prototype.isConstrainedEvent=function(t){return mxEvent.isShiftDown(t)},mxGraph.prototype.isIgnoreTerminalEvent=function(t){return!1},mxGraph.prototype.validationAlert=function(t){mxUtils.alert(t)},mxGraph.prototype.isEdgeValid=function(t,e,n){return null==this.getEdgeValidationError(t,e,n)},mxGraph.prototype.getEdgeValidationError=function(t,e,n){if(null!=t&&!this.isAllowDanglingEdges()&&(null==e||null==n))return"";if(null!=t&&null==this.model.getTerminal(t,!0)&&null==this.model.getTerminal(t,!1))return null;if(!this.allowLoops&&e==n&&null!=e)return"";if(!this.isValidConnection(e,n))return"";if(null==e||null==n)return this.allowDanglingEdges?null:"";var i,l="";this.multigraph||(1<(i=this.model.getEdgesBetween(e,n,!0)).length||1==i.length&&i[0]!=t)&&(l+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+"\n");var s=this.model.getDirectedEdgeCount(e,!0,t),o=this.model.getDirectedEdgeCount(n,!1,t);if(null!=this.multiplicities)for(var r,a=0;a<this.multiplicities.length;a++)null!=(r=this.multiplicities[a].check(this,t,e,n,s,o))&&(l+=r);return null!=(r=this.validateEdge(t,e,n))&&(l+=r),0<l.length?l:null},mxGraph.prototype.validateEdge=function(t,e,n){return null},mxGraph.prototype.validateGraph=function(t,e){t=null!=t?t:this.model.getRoot(),e=null!=e?e:new Object;for(var n=!0,i=this.model.getChildCount(t),l=0;l<i;l++){var s=this.model.getChildAt(t,l),o=e;this.isValidRoot(s)&&(o=new Object);o=this.validateGraph(s,o);null!=o?this.setCellWarning(s,o.replace(/\n/g,"<br>")):this.setCellWarning(s,null),n=n&&null==o}var r="";this.isCellCollapsed(t)&&!n&&(r+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n"),this.model.isEdge(t)?r+=this.getEdgeValidationError(t,this.model.getTerminal(t,!0),this.model.getTerminal(t,!1))||"":r+=this.getCellValidationError(t)||"";var a=this.validateCell(t,e);return null!=a&&(r+=a),null==this.model.getParent(t)&&this.view.validate(),0<r.length||!n?r:null},mxGraph.prototype.getCellValidationError=function(t){var e=this.model.getDirectedEdgeCount(t,!0),n=this.model.getDirectedEdgeCount(t,!1),i=this.model.getValue(t),l="";if(null!=this.multiplicities)for(var s=0;s<this.multiplicities.length;s++){var o=this.multiplicities[s];(o.source&&mxUtils.isNode(i,o.type,o.attr,o.value)&&(e>o.max||e<o.min)||!o.source&&mxUtils.isNode(i,o.type,o.attr,o.value)&&(n>o.max||n<o.min))&&(l+=o.countError+"\n")}return 0<l.length?l:null},mxGraph.prototype.validateCell=function(t,e){return null},mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage},mxGraph.prototype.setBackgroundImage=function(t){this.backgroundImage=t},mxGraph.prototype.getFoldingImage=function(t){if(null!=t&&this.foldingEnabled&&!this.getModel().isEdge(t.cell)){var e=this.isCellCollapsed(t.cell);if(this.isCellFoldable(t.cell,!e))return e?this.collapsedImage:this.expandedImage}return null},mxGraph.prototype.convertValueToString=function(t){t=this.model.getValue(t);if(null!=t){if(mxUtils.isNode(t))return t.nodeName;if("function"==typeof t.toString)return t.toString()}return""},mxGraph.prototype.getLabel=function(t){var e,n="";return this.labelsVisible&&null!=t&&(e=this.getCurrentCellStyle(t),mxUtils.getValue(e,mxConstants.STYLE_NOLABEL,!1)||(n=this.convertValueToString(t))),n},mxGraph.prototype.isHtmlLabel=function(t){return this.isHtmlLabels()},mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels},mxGraph.prototype.setHtmlLabels=function(t){this.htmlLabels=t},mxGraph.prototype.isWrapping=function(t){return"wrap"==this.getCurrentCellStyle(t)[mxConstants.STYLE_WHITE_SPACE]},mxGraph.prototype.isLabelClipped=function(t){return"hidden"==this.getCurrentCellStyle(t)[mxConstants.STYLE_OVERFLOW]},mxGraph.prototype.getTooltip=function(t,n,e,i){var l,s=null;return null!=t&&(null==t.control||n!=t.control.node&&n.parentNode!=t.control.node||(s=this.collapseExpandResource,s=mxUtils.htmlEntities(mxResources.get(s)||s).replace(/\\n/g,"<br>")),null==s&&null!=t.overlays&&t.overlays.visit(function(t,e){null!=s||n!=e.node&&n.parentNode!=e.node||(s=e.overlay.toString())}),null!=s||null!=(l=this.selectionCellsHandler.getHandler(t.cell))&&"function"==typeof l.getTooltipForNode&&(s=l.getTooltipForNode(n)),null==s&&(s=this.getTooltipForCell(t.cell))),s},mxGraph.prototype.getTooltipForCell=function(t){return null!=t&&null!=t.getTooltip?t.getTooltip():this.convertValueToString(t)},mxGraph.prototype.getLinkForCell=function(t){return null},mxGraph.prototype.getCursorForMouseEvent=function(t){return this.getCursorForCell(t.getCell())},mxGraph.prototype.getCursorForCell=function(t){return null},mxGraph.prototype.getStartSize=function(t,e){var n=new mxRectangle,t=this.getCurrentCellStyle(t,e),e=parseInt(mxUtils.getValue(t,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return mxUtils.getValue(t,mxConstants.STYLE_HORIZONTAL,!0)?n.height=e:n.width=e,n},mxGraph.prototype.getSwimlaneDirection=function(t){var e=mxUtils.getValue(t,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),n=1==mxUtils.getValue(t,mxConstants.STYLE_FLIPH,0),i=1==mxUtils.getValue(t,mxConstants.STYLE_FLIPV,0),t=mxUtils.getValue(t,mxConstants.STYLE_HORIZONTAL,!0)?0:3;e==mxConstants.DIRECTION_NORTH?t--:e==mxConstants.DIRECTION_WEST?t+=2:e==mxConstants.DIRECTION_SOUTH&&(t+=1);e=mxUtils.mod(t,2);return n&&1==e&&(t+=2),i&&0==e&&(t+=2),[mxConstants.DIRECTION_NORTH,mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST][mxUtils.mod(t,4)]},mxGraph.prototype.getActualStartSize=function(t,e){var n=new mxRectangle;return this.isSwimlane(t,e)&&(t=this.getCurrentCellStyle(t,e),e=parseInt(mxUtils.getValue(t,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),(t=this.getSwimlaneDirection(t))==mxConstants.DIRECTION_NORTH?n.y=e:t==mxConstants.DIRECTION_WEST?n.x=e:t==mxConstants.DIRECTION_SOUTH?n.height=e:n.width=e),n},mxGraph.prototype.getImage=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_IMAGE]:null},mxGraph.prototype.isTransparentState=function(t){var e,n,i=!1;return null!=t&&(e=mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),n=mxUtils.getValue(t.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE),i=e==mxConstants.NONE&&n==mxConstants.NONE&&null==this.getImage(t)),i},mxGraph.prototype.getVerticalAlign=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null},mxGraph.prototype.getIndicatorColor=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_COLOR]:null},mxGraph.prototype.getIndicatorGradientColor=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null},mxGraph.prototype.getIndicatorShape=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_SHAPE]:null},mxGraph.prototype.getIndicatorImage=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_IMAGE]:null},mxGraph.prototype.getBorder=function(){return this.border},mxGraph.prototype.setBorder=function(t){this.border=t},mxGraph.prototype.isSwimlane=function(t,e){return null!=t&&this.model.getParent(t)!=this.model.getRoot()&&!this.model.isEdge(t)&&this.getCurrentCellStyle(t,e)[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE},mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer},mxGraph.prototype.setResizeContainer=function(t){this.resizeContainer=t},mxGraph.prototype.isEnabled=function(){return this.enabled},mxGraph.prototype.setEnabled=function(t){this.enabled=t},mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled},mxGraph.prototype.setEscapeEnabled=function(t){this.escapeEnabled=t},mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing},mxGraph.prototype.setInvokesStopCellEditing=function(t){this.invokesStopCellEditing=t},mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing},mxGraph.prototype.setEnterStopsCellEditing=function(t){this.enterStopsCellEditing=t},mxGraph.prototype.isCellLocked=function(t){var e=this.model.getGeometry(t);return this.isCellsLocked()||null!=e&&this.model.isVertex(t)&&e.relative},mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked},mxGraph.prototype.setCellsLocked=function(t){this.cellsLocked=t},mxGraph.prototype.getCloneableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(t){return this.isCellCloneable(t)}))},mxGraph.prototype.isCellCloneable=function(t){t=this.getCurrentCellStyle(t);return this.isCellsCloneable()&&0!=t[mxConstants.STYLE_CLONEABLE]},mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable},mxGraph.prototype.setCellsCloneable=function(t){this.cellsCloneable=t},mxGraph.prototype.getExportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(t){return this.canExportCell(t)}))},mxGraph.prototype.canExportCell=function(t){return this.exportEnabled},mxGraph.prototype.getImportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(t){return this.canImportCell(t)}))},mxGraph.prototype.canImportCell=function(t){return this.importEnabled},mxGraph.prototype.isCellSelectable=function(t){return this.isCellsSelectable()},mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable},mxGraph.prototype.setCellsSelectable=function(t){this.cellsSelectable=t},mxGraph.prototype.getDeletableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(t){return this.isCellDeletable(t)}))},mxGraph.prototype.isCellDeletable=function(t){t=this.getCurrentCellStyle(t);return this.isCellsDeletable()&&0!=t[mxConstants.STYLE_DELETABLE]},mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable},mxGraph.prototype.setCellsDeletable=function(t){this.cellsDeletable=t},mxGraph.prototype.isLabelMovable=function(t){return!this.isCellLocked(t)&&(this.model.isEdge(t)&&this.edgeLabelsMovable||this.model.isVertex(t)&&this.vertexLabelsMovable)},mxGraph.prototype.isCellRotatable=function(t){return 0!=this.getCurrentCellStyle(t)[mxConstants.STYLE_ROTATABLE]},mxGraph.prototype.getMovableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(t){return this.isCellMovable(t)}))},mxGraph.prototype.isCellMovable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsMovable()&&!this.isCellLocked(t)&&0!=e[mxConstants.STYLE_MOVABLE]},mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable},mxGraph.prototype.setCellsMovable=function(t){this.cellsMovable=t},mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled},mxGraph.prototype.setGridEnabled=function(t){this.gridEnabled=t},mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled},mxGraph.prototype.setPortsEnabled=function(t){this.portsEnabled=t},mxGraph.prototype.getGridSize=function(){return this.gridSize},mxGraph.prototype.setGridSize=function(t){this.gridSize=t},mxGraph.prototype.getTolerance=function(){return this.tolerance},mxGraph.prototype.setTolerance=function(t){this.tolerance=t},mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable},mxGraph.prototype.setVertexLabelsMovable=function(t){this.vertexLabelsMovable=t},mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable},mxGraph.prototype.setEdgeLabelsMovable=function(t){this.edgeLabelsMovable=t},mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting},mxGraph.prototype.setSwimlaneNesting=function(t){this.swimlaneNesting=t},mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled},mxGraph.prototype.setSwimlaneSelectionEnabled=function(t){this.swimlaneSelectionEnabled=t},mxGraph.prototype.isMultigraph=function(){return this.multigraph},mxGraph.prototype.setMultigraph=function(t){this.multigraph=t},mxGraph.prototype.isAllowLoops=function(){return this.allowLoops},mxGraph.prototype.setAllowDanglingEdges=function(t){this.allowDanglingEdges=t},mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges},mxGraph.prototype.setConnectableEdges=function(t){this.connectableEdges=t},mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges},mxGraph.prototype.setCloneInvalidEdges=function(t){this.cloneInvalidEdges=t},mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges},mxGraph.prototype.setAllowLoops=function(t){this.allowLoops=t},mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove},mxGraph.prototype.setDisconnectOnMove=function(t){this.disconnectOnMove=t},mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled},mxGraph.prototype.setDropEnabled=function(t){this.dropEnabled=t},mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled},mxGraph.prototype.setSplitEnabled=function(t){this.splitEnabled=t},mxGraph.prototype.isCellResizable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsResizable()&&!this.isCellLocked(t)&&"0"!=mxUtils.getValue(e,mxConstants.STYLE_RESIZABLE,"1")},mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable},mxGraph.prototype.setCellsResizable=function(t){this.cellsResizable=t},mxGraph.prototype.isTerminalPointMovable=function(t,e){return!0},mxGraph.prototype.isCellBendable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsBendable()&&!this.isCellLocked(t)&&0!=e[mxConstants.STYLE_BENDABLE]},mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable},mxGraph.prototype.setCellsBendable=function(t){this.cellsBendable=t},mxGraph.prototype.isCellEditable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsEditable()&&!this.isCellLocked(t)&&0!=e[mxConstants.STYLE_EDITABLE]},mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable},mxGraph.prototype.setCellsEditable=function(t){this.cellsEditable=t},mxGraph.prototype.isCellDisconnectable=function(t,e,n){return this.isCellsDisconnectable()&&!this.isCellLocked(t)},mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable},mxGraph.prototype.setCellsDisconnectable=function(t){this.cellsDisconnectable=t},mxGraph.prototype.isValidSource=function(t){return null==t&&this.allowDanglingEdges||null!=t&&(!this.model.isEdge(t)||this.connectableEdges)&&this.isCellConnectable(t)},mxGraph.prototype.isValidTarget=function(t){return this.isValidSource(t)},mxGraph.prototype.isValidConnection=function(t,e){return this.isValidSource(t)&&this.isValidTarget(e)},mxGraph.prototype.setConnectable=function(t){this.connectionHandler.setEnabled(t)},mxGraph.prototype.isConnectable=function(){return this.connectionHandler.isEnabled()},mxGraph.prototype.setTooltips=function(t){this.tooltipHandler.setEnabled(t)},mxGraph.prototype.setPanning=function(t){this.panningHandler.panningEnabled=t},mxGraph.prototype.isEditing=function(t){if(null==this.cellEditor)return!1;var e=this.cellEditor.getEditingCell();return null==t?null!=e:t==e},mxGraph.prototype.isAutoSizeCell=function(t){t=this.getCurrentCellStyle(t);return this.isAutoSizeCells()||1==t[mxConstants.STYLE_AUTOSIZE]},mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells},mxGraph.prototype.setAutoSizeCells=function(t){this.autoSizeCells=t},mxGraph.prototype.isExtendParent=function(t){return!this.getModel().isEdge(t)&&this.isExtendParents()},mxGraph.prototype.isExtendParents=function(){return this.extendParents},mxGraph.prototype.setExtendParents=function(t){this.extendParents=t},mxGraph.prototype.isExtendParentsOnAdd=function(t){return this.extendParentsOnAdd},mxGraph.prototype.setExtendParentsOnAdd=function(t){this.extendParentsOnAdd=t},mxGraph.prototype.isExtendParentsOnMove=function(){return this.extendParentsOnMove},mxGraph.prototype.setExtendParentsOnMove=function(t){this.extendParentsOnMove=t},mxGraph.prototype.isRecursiveResize=function(t){return this.recursiveResize},mxGraph.prototype.setRecursiveResize=function(t){this.recursiveResize=t},mxGraph.prototype.isConstrainChild=function(t){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(t))},mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren},mxGraph.prototype.setConstrainChildren=function(t){this.constrainChildren=t},mxGraph.prototype.isConstrainRelativeChildren=function(){return this.constrainRelativeChildren},mxGraph.prototype.setConstrainRelativeChildren=function(t){this.constrainRelativeChildren=t},mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates},mxGraph.prototype.setAllowNegativeCoordinates=function(t){this.allowNegativeCoordinates=t},mxGraph.prototype.getOverlap=function(t){return this.isAllowOverlapParent(t)?this.defaultOverlap:0},mxGraph.prototype.isAllowOverlapParent=function(t){return!1},mxGraph.prototype.getFoldableCells=function(t,e){return this.model.filterCells(t,mxUtils.bind(this,function(t){return this.isCellFoldable(t,e)}))},mxGraph.prototype.isCellFoldable=function(t,e){var n=this.getCurrentCellStyle(t);return 0<this.model.getChildCount(t)&&0!=n[mxConstants.STYLE_FOLDABLE]},mxGraph.prototype.isValidDropTarget=function(t,e,n){return null!=t&&(this.isSplitEnabled()&&this.isSplitTarget(t,e,n)||!this.model.isEdge(t)&&(this.isSwimlane(t)||0<this.model.getChildCount(t)&&!this.isCellCollapsed(t)))},mxGraph.prototype.isSplitTarget=function(t,e,n){if(this.model.isEdge(t)&&null!=e&&1==e.length&&this.isCellConnectable(e[0])&&null==this.getEdgeValidationError(t,this.model.getTerminal(t,!0),e[0])){var i=this.model.getTerminal(t,!0),t=this.model.getTerminal(t,!1);return!this.model.isAncestor(e[0],i)&&!this.model.isAncestor(e[0],t)}return!1},mxGraph.prototype.getDropTarget=function(t,e,n,i){if(!this.isSwimlaneNesting())for(var l=0;l<t.length;l++)if(this.isSwimlane(t[l]))return null;var s=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e));s.x-=this.panDx,s.y-=this.panDy;s=this.getSwimlaneAt(s.x,s.y);if(null==n)n=s;else if(null!=s){for(var o=this.model.getParent(s);null!=o&&this.isSwimlane(o)&&o!=n;)o=this.model.getParent(o);o==n&&(n=s)}for(;null!=n&&!this.isValidDropTarget(n,t,e)&&!this.model.isLayer(n);)n=this.model.getParent(n);if(null==i||!i)for(var r=n;null!=r&&mxUtils.indexOf(t,r)<0;)r=this.model.getParent(r);return this.model.isLayer(n)||null!=r?null:n},mxGraph.prototype.getDefaultParent=function(){var t,e=this.getCurrentRoot();return null==e&&null==(e=this.defaultParent)&&(t=this.model.getRoot(),e=this.model.getChildAt(t,0)),e},mxGraph.prototype.setDefaultParent=function(t){this.defaultParent=t},mxGraph.prototype.getSwimlane=function(t){for(;null!=t&&!this.isSwimlane(t);)t=this.model.getParent(t);return t},mxGraph.prototype.getSwimlaneAt=function(t,e,n){if(null==n&&null==(n=this.getCurrentRoot())&&(n=this.model.getRoot()),null!=n)for(var i=this.model.getChildCount(n),l=0;l<i;l++){var s=this.model.getChildAt(n,l);if(null!=s){var o=this.getSwimlaneAt(t,e,s);if(null!=o)return o;if(this.isCellVisible(s)&&this.isSwimlane(s)){o=this.view.getState(s);if(this.intersects(o,t,e))return s}}}return null},mxGraph.prototype.getCellAt=function(t,e,n,i,l,s){if(i=null==i||i,l=null==l||l,null==n&&null==(n=this.getCurrentRoot())&&(n=this.getModel().getRoot()),null!=n)for(var o=this.model.getChildCount(n)-1;0<=o;o--){var r=this.model.getChildAt(n,o),a=this.getCellAt(t,e,r,i,l,s);if(null!=a)return a;if(this.isCellVisible(r)&&(l&&this.model.isEdge(r)||i&&this.model.isVertex(r))){a=this.view.getState(r);if(null!=a&&(null==s||!s(a,t,e))&&this.intersects(a,t,e))return r}}return null},mxGraph.prototype.intersects=function(t,e,n){if(null!=t){var i=t.absolutePoints;if(null!=i)for(var l=this.tolerance*this.tolerance,s=i[0],o=1;o<i.length;o++){var r=i[o];if(mxUtils.ptSegDistSq(s.x,s.y,r.x,r.y,e,n)<=l)return!0;s=r}else{var a,h,d=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0);if(0!=d&&(a=Math.cos(-d),h=Math.sin(-d),d=new mxPoint(t.getCenterX(),t.getCenterY()),e=(s=mxUtils.getRotatedPoint(new mxPoint(e,n),a,h,d)).x,n=s.y),mxUtils.contains(t,e,n))return!0}}return!1},mxGraph.prototype.hitsSwimlaneContent=function(t,e,n){var i=this.getView().getState(t),l=this.getStartSize(t);if(null!=i){t=this.getView().getScale();if(e-=i.x,n-=i.y,0<l.width&&0<e&&e>l.width*t)return!0;if(0<l.height&&0<n&&n>l.height*t)return!0}return!1},mxGraph.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraph.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraph.prototype.getChildCells=function(t,e,n){t=null!=t?t:this.getDefaultParent(),e=null!=e&&e,n=null!=n&&n;for(var i=this.model.getChildCells(t,e,n),l=[],s=0;s<i.length;s++)this.isCellVisible(i[s])&&l.push(i[s]);return l},mxGraph.prototype.getConnections=function(t,e){return this.getEdges(t,e,!0,!0,!1)},mxGraph.prototype.getIncomingEdges=function(t,e){return this.getEdges(t,e,!0,!1,!1)},mxGraph.prototype.getOutgoingEdges=function(t,e){return this.getEdges(t,e,!1,!0,!1)},mxGraph.prototype.getEdges=function(t,e,n,i,l,s){n=null==n||n,i=null==i||i,l=null==l||l,s=null!=s&&s;for(var o=[],r=this.isCellCollapsed(t),a=this.model.getChildCount(t),h=0;h<a;h++){var d=this.model.getChildAt(t,h);!r&&this.isCellVisible(d)||(o=o.concat(this.model.getEdges(d,n,i)))}o=o.concat(this.model.getEdges(t,n,i));for(var u=[],h=0;h<o.length;h++){var p=this.view.getState(o[h]),m=null!=p?p.getVisibleTerminal(!0):this.view.getVisibleTerminal(o[h],!0),p=null!=p?p.getVisibleTerminal(!1):this.view.getVisibleTerminal(o[h],!1);(l&&m==p||m!=p&&(n&&p==t&&(null==e||this.isValidAncestor(m,e,s))||i&&m==t&&(null==e||this.isValidAncestor(p,e,s))))&&u.push(o[h])}return u},mxGraph.prototype.isValidAncestor=function(t,e,n){return n?this.model.isAncestor(e,t):this.model.getParent(t)==e},mxGraph.prototype.getOpposites=function(t,e,n,i){n=null==n||n,i=null==i||i;var l=[],s=new mxDictionary;if(null!=t)for(var o=0;o<t.length;o++){var r=this.view.getState(t[o]),a=null!=r?r.getVisibleTerminal(!0):this.view.getVisibleTerminal(t[o],!0),r=null!=r?r.getVisibleTerminal(!1):this.view.getVisibleTerminal(t[o],!1);a==e&&null!=r&&r!=e&&i?s.get(r)||(s.put(r,!0),l.push(r)):r==e&&null!=a&&a!=e&&n&&(s.get(a)||(s.put(a,!0),l.push(a)))}return l},mxGraph.prototype.getEdgesBetween=function(t,e,n){n=null!=n&&n;for(var i=this.getEdges(t),l=[],s=0;s<i.length;s++){var o=this.view.getState(i[s]),r=null!=o?o.getVisibleTerminal(!0):this.view.getVisibleTerminal(i[s],!0),o=null!=o?o.getVisibleTerminal(!1):this.view.getVisibleTerminal(i[s],!1);(r==t&&o==e||!n&&r==e&&o==t)&&l.push(i[s])}return l},mxGraph.prototype.getPointForEvent=function(t,e){var n=mxUtils.convertPoint(this.container,mxEvent.getClientX(t),mxEvent.getClientY(t)),i=this.view.scale,t=this.view.translate,e=0!=e?this.gridSize/2:0;return n.x=this.snap(n.x/i-t.x-e),n.y=this.snap(n.y/i-t.y-e),n},mxGraph.prototype.getCells=function(t,e,n,i,l,s,o,r,a){if(s=null!=s?s:[],0<n||0<i||null!=o){var h=this.getModel(),d=t+n,u=e+i;if(null==l&&null==(l=this.getCurrentRoot())&&(l=h.getRoot()),null!=l)for(var p=h.getChildCount(l),m=0;m<p;m++){var c,g=h.getChildAt(l,m),x=this.view.getState(g);null==x||!this.isCellVisible(g)||null!=r&&r(x)||(c=x,0!=(x=mxUtils.getValue(x.style,mxConstants.STYLE_ROTATION)||0)&&(c=mxUtils.getBoundingBox(c,x)),(c=null!=o&&h.isVertex(g)&&mxUtils.intersects(o,c)||null==o&&(h.isEdge(g)||h.isVertex(g))&&c.x>=t&&c.y+c.height<=u&&c.y>=e&&c.x+c.width<=d)&&s.push(g),c&&!a||this.getCells(t,e,n,i,g,s,o,r,a))}}return s},mxGraph.prototype.getCellsBeyond=function(t,e,n,i,l){var s=[];if((i||l)&&(null==n&&(n=this.getDefaultParent()),null!=n))for(var o=this.model.getChildCount(n),r=0;r<o;r++){var a=this.model.getChildAt(n,r),h=this.view.getState(a);this.isCellVisible(a)&&null!=h&&(!i||h.x>=t)&&(!l||h.y>=e)&&s.push(a)}return s},mxGraph.prototype.findTreeRoots=function(t,e,n){e=null!=e&&e,n=null!=n&&n;var i=[];if(null!=t){for(var l=this.getModel(),s=l.getChildCount(t),o=null,r=0,a=0;a<s;a++){var h=l.getChildAt(t,a);if(this.model.isVertex(h)&&this.isCellVisible(h)){for(var d=this.getConnections(h,e?t:null),u=0,p=0,m=0;m<d.length;m++)this.view.getVisibleTerminal(d[m],!0)==h?u++:p++;(n&&0==u&&0<p||!n&&0==p&&0<u)&&i.push(h);var c=n?p-u:u-p;r<c&&(r=c,o=h)}}0==i.length&&null!=o&&i.push(o)}return i},mxGraph.prototype.traverse=function(t,e,n,i,l,s){if(null!=n&&null!=t&&(e=null==e||e,s=null!=s&&s,!(l=l||new mxDictionary).get(t))){l.put(t,!0);i=n(t,i);if(null==i||i){var o=this.model.getEdgeCount(t);if(0<o)for(var r=0;r<o;r++){var a=this.model.getEdgeAt(t,r),h=this.model.getTerminal(a,!0)==t;e&&!s!=h||(h=this.model.getTerminal(a,!h),this.traverse(h,e,n,a,l,s))}}}},mxGraph.prototype.isCellSelected=function(t){return this.getSelectionModel().isSelected(t)},mxGraph.prototype.isSelectionEmpty=function(){return this.getSelectionModel().isEmpty()},mxGraph.prototype.clearSelection=function(){return this.getSelectionModel().clear()},mxGraph.prototype.getSelectionCount=function(){return this.getSelectionModel().cells.length},mxGraph.prototype.getSelectionCell=function(){return this.getSelectionModel().cells[0]},mxGraph.prototype.getSelectionCells=function(){return this.getSelectionModel().cells.slice()},mxGraph.prototype.setSelectionCell=function(t){this.getSelectionModel().setCell(t)},mxGraph.prototype.setSelectionCells=function(t){this.getSelectionModel().setCells(t)},mxGraph.prototype.addSelectionCell=function(t){this.getSelectionModel().addCell(t)},mxGraph.prototype.addSelectionCells=function(t){this.getSelectionModel().addCells(t)},mxGraph.prototype.removeSelectionCell=function(t){this.getSelectionModel().removeCell(t)},mxGraph.prototype.removeSelectionCells=function(t){this.getSelectionModel().removeCells(t)},mxGraph.prototype.selectRegion=function(t,e){t=this.getCells(t.x,t.y,t.width,t.height);return this.selectCellsForEvent(t,e),t},mxGraph.prototype.selectNextCell=function(){this.selectCell(!0)},mxGraph.prototype.selectPreviousCell=function(){this.selectCell()},mxGraph.prototype.selectParentCell=function(){this.selectCell(!1,!0)},mxGraph.prototype.selectChildCell=function(){this.selectCell(!1,!1,!0)},mxGraph.prototype.selectCell=function(t,e,n){var i=this.selectionModel,l=0<i.cells.length?i.cells[0]:null;1<i.cells.length&&i.clear();var s,o=null!=l?this.model.getParent(l):this.getDefaultParent(),i=this.model.getChildCount(o);null==l&&0<i?(s=this.model.getChildAt(o,0),this.setSelectionCell(s)):null!=l&&!e||null==this.view.getState(o)||null==this.model.getGeometry(o)?null!=l&&n?0<this.model.getChildCount(l)&&(s=this.model.getChildAt(l,0),this.setSelectionCell(s)):0<i&&(l=o.getIndex(l),s=t?(l++,this.model.getChildAt(o,l%i)):(l=--l<0?i-1:l,this.model.getChildAt(o,l)),this.setSelectionCell(s)):this.getCurrentRoot()!=o&&this.setSelectionCell(o)},mxGraph.prototype.selectAll=function(e,t){e=e||this.getDefaultParent();t=t?this.model.filterDescendants(mxUtils.bind(this,function(t){return t!=e&&null!=this.view.getState(t)}),e):this.model.getChildren(e);null!=t&&this.setSelectionCells(t)},mxGraph.prototype.selectVertices=function(t,e){this.selectCells(!0,!1,t,e)},mxGraph.prototype.selectEdges=function(t){this.selectCells(!1,!0,t)},mxGraph.prototype.selectCells=function(e,n,t,i){t=t||this.getDefaultParent();var l=mxUtils.bind(this,function(t){return null!=this.view.getState(t)&&((i||0==this.model.getChildCount(t))&&this.model.isVertex(t)&&e&&!this.model.isEdge(this.model.getParent(t))||this.model.isEdge(t)&&n)}),t=this.model.filterDescendants(l,t);null!=t&&this.setSelectionCells(t)},mxGraph.prototype.selectCellForEvent=function(t,e){var n=this.isCellSelected(t);this.isToggleEvent(e)?n?this.removeSelectionCell(t):this.addSelectionCell(t):n&&1==this.getSelectionCount()||this.setSelectionCell(t)},mxGraph.prototype.selectCellsForEvent=function(t,e){this.isToggleEvent(e)?this.addSelectionCells(t):this.setSelectionCells(t)},mxGraph.prototype.createHandler=function(t){var e,n,i,l=null;return null!=t&&(l=this.model.isEdge(t.cell)?(e=t.getVisibleTerminalState(!0),i=t.getVisibleTerminalState(!1),n=this.getCellGeometry(t.cell),i=this.view.getEdgeStyle(t,null!=n?n.points:null,e,i),this.createEdgeHandler(t,i)):this.createVertexHandler(t)),l},mxGraph.prototype.createVertexHandler=function(t){return new mxVertexHandler(t)},mxGraph.prototype.createEdgeHandler=function(t,e){return e==mxEdgeStyle.Loop||e==mxEdgeStyle.ElbowConnector||e==mxEdgeStyle.SideToSide||e==mxEdgeStyle.TopToBottom?this.createElbowEdgeHandler(t):e==mxEdgeStyle.SegmentConnector||e==mxEdgeStyle.OrthConnector?this.createEdgeSegmentHandler(t):new mxEdgeHandler(t)},mxGraph.prototype.createEdgeSegmentHandler=function(t){return new mxEdgeSegmentHandler(t)},mxGraph.prototype.createElbowEdgeHandler=function(t){return new mxElbowEdgeHandler(t)},mxGraph.prototype.addMouseListener=function(t){null==this.mouseListeners&&(this.mouseListeners=[]),this.mouseListeners.push(t)},mxGraph.prototype.removeMouseListener=function(t){if(null!=this.mouseListeners)for(var e=0;e<this.mouseListeners.length;e++)if(this.mouseListeners[e]==t){this.mouseListeners.splice(e,1);break}},mxGraph.prototype.updateMouseEvent=function(t,e){var n;return null!=t.graphX&&null!=t.graphY||(n=mxUtils.convertPoint(this.container,t.getX(),t.getY()),t.graphX=n.x-this.panDx,t.graphY=n.y-this.panDy,null==t.getCell()&&this.isMouseDown&&e==mxEvent.MOUSE_MOVE&&(t.state=this.view.getState(this.getCellAt(n.x,n.y,null,null,null,function(t){return null==t.shape||t.shape.paintBackground!=mxRectangleShape.prototype.paintBackground||"1"==mxUtils.getValue(t.style,mxConstants.STYLE_POINTER_EVENTS,"1")||null!=t.shape.fill&&t.shape.fill!=mxConstants.NONE})))),t},mxGraph.prototype.getStateForTouchEvent=function(t){var e=mxEvent.getClientX(t),t=mxEvent.getClientY(t),t=mxUtils.convertPoint(this.container,e,t);return this.view.getState(this.getCellAt(t.x,t.y))},mxGraph.prototype.isEventIgnored=function(t,e,n){var i=mxEvent.isMouseEvent(e.getEvent()),l=!1;return e.getEvent()==this.lastEvent?l=!0:this.lastEvent=e.getEvent(),null!=this.eventSource&&t!=mxEvent.MOUSE_MOVE?(mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveRedirect,this.mouseUpRedirect),this.mouseMoveRedirect=null,this.mouseUpRedirect=null,this.eventSource=null):mxClient.IS_GC||null==this.eventSource||e.getSource()==this.eventSource?!mxClient.IS_TOUCH||t!=mxEvent.MOUSE_DOWN||i||mxEvent.isPenEvent(e.getEvent())||(this.eventSource=e.getSource(),this.mouseMoveRedirect=mxUtils.bind(this,function(t){this.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,this.getStateForTouchEvent(t)))}),this.mouseUpRedirect=mxUtils.bind(this,function(t){this.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t,this.getStateForTouchEvent(t)))}),mxEvent.addGestureListeners(this.eventSource,null,this.mouseMoveRedirect,this.mouseUpRedirect)):l=!0,this.isSyntheticEventIgnored(t,e,n)&&(l=!0),!mxEvent.isPopupTrigger(this.lastEvent)&&t!=mxEvent.MOUSE_MOVE&&2==this.lastEvent.detail||(t==mxEvent.MOUSE_UP&&this.isMouseDown?this.isMouseDown=!1:t!=mxEvent.MOUSE_DOWN||this.isMouseDown?!l&&((!mxClient.IS_FF||t!=mxEvent.MOUSE_MOVE)&&this.isMouseDown&&this.isMouseTrigger!=i||t==mxEvent.MOUSE_DOWN&&this.isMouseDown||t==mxEvent.MOUSE_UP&&!this.isMouseDown)&&(l=!0):(this.isMouseDown=!0,this.isMouseTrigger=i),l||t!=mxEvent.MOUSE_DOWN||(this.lastMouseX=e.getX(),this.lastMouseY=e.getY()),l)},mxGraph.prototype.isSyntheticEventIgnored=function(t,e,n){var i=!1,e=mxEvent.isMouseEvent(e.getEvent());return this.ignoreMouseEvents&&e&&t!=mxEvent.MOUSE_MOVE?(this.ignoreMouseEvents=t!=mxEvent.MOUSE_UP,i=!0):mxClient.IS_FF&&!e&&t==mxEvent.MOUSE_UP&&(this.ignoreMouseEvents=!0),i},mxGraph.prototype.isEventSourceIgnored=function(t,e){var n=e.getSource(),i=null!=n.nodeName?n.nodeName.toLowerCase():"",e=!mxEvent.isMouseEvent(e.getEvent())||mxEvent.isLeftMouseButton(e.getEvent());return t==mxEvent.MOUSE_DOWN&&e&&("select"==i||"option"==i||"input"==i&&"checkbox"!=n.type&&"radio"!=n.type&&"button"!=n.type&&"submit"!=n.type&&"file"!=n.type)},mxGraph.prototype.getEventState=function(t){return t},mxGraph.prototype.fireMouseEvent=function(t,e,n){if(this.isEventSourceIgnored(t,e))null!=this.tooltipHandler&&this.tooltipHandler.hide();else{if(null==n&&(n=this),e=this.updateMouseEvent(e,t),!this.nativeDblClickEnabled&&!mxEvent.isPopupTrigger(e.getEvent())||this.doubleTapEnabled&&mxClient.IS_TOUCH&&(mxEvent.isTouchEvent(e.getEvent())||mxEvent.isPenEvent(e.getEvent()))){var i=(new Date).getTime();if(!mxClient.IS_QUIRKS&&t==mxEvent.MOUSE_DOWN||mxClient.IS_QUIRKS&&t==mxEvent.MOUSE_UP&&!this.fireDoubleClick)if(null!=this.lastTouchEvent&&this.lastTouchEvent!=e.getEvent()&&i-this.lastTouchTime<this.doubleTapTimeout&&Math.abs(this.lastTouchX-e.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-e.getY())<this.doubleTapTolerance&&this.doubleClickCounter<2){this.doubleClickCounter++;var l=!1;if(t==mxEvent.MOUSE_UP?e.getCell()==this.lastTouchCell&&null!=this.lastTouchCell&&(this.lastTouchTime=0,s=this.lastTouchCell,this.lastTouchCell=null,mxClient.IS_QUIRKS&&e.getSource().fireEvent("ondblclick"),this.dblClick(e.getEvent(),s),l=!0):(this.fireDoubleClick=!0,this.lastTouchTime=0),!mxClient.IS_QUIRKS||l)return void mxEvent.consume(e.getEvent())}else null!=this.lastTouchEvent&&this.lastTouchEvent==e.getEvent()||(this.lastTouchCell=e.getCell(),this.lastTouchX=e.getX(),this.lastTouchY=e.getY(),this.lastTouchTime=i,this.lastTouchEvent=e.getEvent(),this.doubleClickCounter=0);else if((this.isMouseDown||t==mxEvent.MOUSE_UP)&&this.fireDoubleClick){this.fireDoubleClick=!1;var s=this.lastTouchCell;return this.lastTouchCell=null,this.isMouseDown=!1,void((null!=s||(mxEvent.isTouchEvent(e.getEvent())||mxEvent.isPenEvent(e.getEvent()))&&(mxClient.IS_GC||mxClient.IS_SF))&&Math.abs(this.lastTouchX-e.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-e.getY())<this.doubleTapTolerance?this.dblClick(e.getEvent(),s):mxEvent.consume(e.getEvent()))}}if(!this.isEventIgnored(t,e,n)){if(e.state=this.getEventState(e.getState()),this.fireEvent(new mxEventObject(mxEvent.FIRE_MOUSE_EVENT,"eventName",t,"event",e)),mxClient.IS_OP||mxClient.IS_SF||mxClient.IS_GC||mxClient.IS_IE11||mxClient.IS_IE&&mxClient.IS_SVG||e.getEvent().target!=this.container){if(t==mxEvent.MOUSE_MOVE&&this.isMouseDown&&this.autoScroll&&!mxEvent.isMultiTouchEvent(e.getEvent)?this.scrollPointToVisible(e.getGraphX(),e.getGraphY(),this.autoExtend):t==mxEvent.MOUSE_UP&&this.ignoreScrollbars&&this.translateToScrollPosition&&(0!=this.container.scrollLeft||0!=this.container.scrollTop)&&(i=this.view.scale,s=this.view.translate,this.view.setTranslate(s.x-this.container.scrollLeft/i,s.y-this.container.scrollTop/i),this.container.scrollLeft=0,this.container.scrollTop=0),null!=this.mouseListeners){var o=[n,e];e.getEvent().preventDefault||(e.getEvent().returnValue=!0);for(var r=0;r<this.mouseListeners.length;r++){var a=this.mouseListeners[r];t==mxEvent.MOUSE_DOWN?a.mouseDown.apply(a,o):t==mxEvent.MOUSE_MOVE?a.mouseMove.apply(a,o):t==mxEvent.MOUSE_UP&&a.mouseUp.apply(a,o)}}t==mxEvent.MOUSE_UP&&this.click(e)}(mxEvent.isTouchEvent(e.getEvent())||mxEvent.isPenEvent(e.getEvent()))&&t==mxEvent.MOUSE_DOWN&&this.tapAndHoldEnabled&&!this.tapAndHoldInProgress?(this.tapAndHoldInProgress=!0,this.initialTouchX=e.getGraphX(),this.initialTouchY=e.getGraphY(),this.tapAndHoldThread&&window.clearTimeout(this.tapAndHoldThread),this.tapAndHoldThread=window.setTimeout(mxUtils.bind(this,function(){this.tapAndHoldValid&&this.tapAndHold(e),this.tapAndHoldInProgress=!1,this.tapAndHoldValid=!1}),this.tapAndHoldDelay),this.tapAndHoldValid=!0):t==mxEvent.MOUSE_UP?(this.tapAndHoldInProgress=!1,this.tapAndHoldValid=!1):this.tapAndHoldValid&&(this.tapAndHoldValid=Math.abs(this.initialTouchX-e.getGraphX())<this.tolerance&&Math.abs(this.initialTouchY-e.getGraphY())<this.tolerance),t==mxEvent.MOUSE_DOWN&&this.isEditing()&&!this.cellEditor.isEventSource(e.getEvent())&&this.stopEditing(!this.isInvokesStopCellEditing()),this.consumeMouseEvent(t,e,n)}}},mxGraph.prototype.consumeMouseEvent=function(t,e,n){t==mxEvent.MOUSE_DOWN&&mxEvent.isTouchEvent(e.getEvent())&&e.consume(!1)},mxGraph.prototype.fireGestureEvent=function(t,e){this.lastTouchTime=0,this.fireEvent(new mxEventObject(mxEvent.GESTURE,"event",t,"cell",e))},mxGraph.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tooltipHandler&&this.tooltipHandler.destroy(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.destroy(),null!=this.panningHandler&&this.panningHandler.destroy(),null!=this.popupMenuHandler&&this.popupMenuHandler.destroy(),null!=this.connectionHandler&&this.connectionHandler.destroy(),null!=this.graphHandler&&this.graphHandler.destroy(),null!=this.cellEditor&&this.cellEditor.destroy(),null!=this.view&&this.view.destroy(),null!=this.model&&null!=this.graphModelChangeListener&&(this.model.removeListener(this.graphModelChangeListener),this.graphModelChangeListener=null),this.container=null)},mxCellOverlay.prototype=new mxEventSource,mxCellOverlay.prototype.constructor=mxCellOverlay,mxCellOverlay.prototype.image=null,mxCellOverlay.prototype.tooltip=null,mxCellOverlay.prototype.align=mxConstants.ALIGN_RIGHT,mxCellOverlay.prototype.verticalAlign=mxConstants.ALIGN_BOTTOM,mxCellOverlay.prototype.offset=null,mxCellOverlay.prototype.cursor=null,mxCellOverlay.prototype.defaultOverlap=.5,mxCellOverlay.prototype.getBounds=function(t){var e,n,i=t.view.graph.getModel().isEdge(t.cell),l=t.view.scale,s=null,o=this.image.width,r=this.image.height;return i?s=(e=t.absolutePoints).length%2==1?e[Math.floor(e.length/2)]:(i=e[(n=e.length/2)-1],n=e[n],new mxPoint(i.x+(n.x-i.x)/2,i.y+(n.y-i.y)/2)):(s=new mxPoint,this.align==mxConstants.ALIGN_LEFT?s.x=t.x:this.align==mxConstants.ALIGN_CENTER?s.x=t.x+t.width/2:s.x=t.x+t.width,this.verticalAlign==mxConstants.ALIGN_TOP?s.y=t.y:this.verticalAlign==mxConstants.ALIGN_MIDDLE?s.y=t.y+t.height/2:s.y=t.y+t.height),new mxRectangle(Math.round(s.x-(o*this.defaultOverlap-this.offset.x)*l),Math.round(s.y-(r*this.defaultOverlap-this.offset.y)*l),o*l,r*l)},mxCellOverlay.prototype.toString=function(){return this.tooltip},mxOutline.prototype.source=null,mxOutline.prototype.outline=null,mxOutline.prototype.graphRenderHint=mxConstants.RENDERING_HINT_FASTER,mxOutline.prototype.enabled=!0,mxOutline.prototype.showViewport=!0,mxOutline.prototype.border=10,mxOutline.prototype.sizerSize=8,mxOutline.prototype.labelsVisible=!1,mxOutline.prototype.updateOnPan=!1,mxOutline.prototype.sizerImage=null,mxOutline.prototype.minScale=1e-4,mxOutline.prototype.suspended=!1,mxOutline.prototype.forceVmlHandles=8==document.documentMode,mxOutline.prototype.createGraph=function(t){t=new mxGraph(t,this.source.getModel(),this.graphRenderHint,this.source.getStylesheet());return t.foldingEnabled=!1,t.autoScroll=!1,t},mxOutline.prototype.init=function(t){this.outline=this.createGraph(t);var e=this.outline.graphModelChanged;this.outline.graphModelChanged=mxUtils.bind(this,function(t){this.suspended||null==this.outline||e.apply(this.outline,arguments)}),mxClient.IS_SVG&&((n=this.outline.getView().getCanvas().parentNode).setAttribute("shape-rendering","optimizeSpeed"),n.setAttribute("image-rendering","optimizeSpeed")),this.outline.labelsVisible=this.labelsVisible,this.outline.setEnabled(!1),this.updateHandler=mxUtils.bind(this,function(t,e){this.suspended||this.active||this.update()}),this.source.getModel().addListener(mxEvent.CHANGE,this.updateHandler),this.outline.addMouseListener(this);var n=this.source.getView();n.addListener(mxEvent.SCALE,this.updateHandler),n.addListener(mxEvent.TRANSLATE,this.updateHandler),n.addListener(mxEvent.SCALE_AND_TRANSLATE,this.updateHandler),n.addListener(mxEvent.DOWN,this.updateHandler),n.addListener(mxEvent.UP,this.updateHandler),mxEvent.addListener(this.source.container,"scroll",this.updateHandler),this.panHandler=mxUtils.bind(this,function(t){this.updateOnPan&&this.updateHandler.apply(this,arguments)}),this.source.addListener(mxEvent.PAN,this.panHandler),this.refreshHandler=mxUtils.bind(this,function(t){this.outline.setStylesheet(this.source.getStylesheet()),this.outline.refresh()}),this.source.addListener(mxEvent.REFRESH,this.refreshHandler),this.bounds=new mxRectangle(0,0,0,0),this.selectionBorder=new mxRectangleShape(this.bounds,null,mxConstants.OUTLINE_COLOR,mxConstants.OUTLINE_STROKEWIDTH),this.selectionBorder.dialect=this.outline.dialect,this.forceVmlHandles&&(this.selectionBorder.isHtmlAllowed=function(){return!1}),this.selectionBorder.init(this.outline.getView().getOverlayPane());n=mxUtils.bind(this,function(t){var e=mxEvent.getSource(t),n=mxUtils.bind(this,function(t){this.outline.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t))}),i=mxUtils.bind(this,function(t){mxEvent.removeGestureListeners(e,null,n,i),this.outline.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t))});mxEvent.addGestureListeners(e,null,n,i),this.outline.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t))});mxEvent.addGestureListeners(this.selectionBorder.node,n),this.sizer=this.createSizer(),this.forceVmlHandles&&(this.sizer.isHtmlAllowed=function(){return!1}),this.sizer.init(this.outline.getView().getOverlayPane()),this.enabled&&(this.sizer.node.style.cursor="nwse-resize"),mxEvent.addGestureListeners(this.sizer.node,n),this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display,this.selectionBorder.node.style.cursor="move",this.update(!1)},mxOutline.prototype.isEnabled=function(){return this.enabled},mxOutline.prototype.setEnabled=function(t){this.enabled=t},mxOutline.prototype.setZoomEnabled=function(t){this.sizer.node.style.visibility=t?"visible":"hidden"},mxOutline.prototype.refresh=function(){this.update(!0)},mxOutline.prototype.createSizer=function(){return null==this.sizerImage?(t=new mxRectangleShape(new mxRectangle(0,0,this.sizerSize,this.sizerSize),mxConstants.OUTLINE_HANDLE_FILLCOLOR,mxConstants.OUTLINE_HANDLE_STROKECOLOR)).dialect=this.outline.dialect:(t=new mxImageShape(new mxRectangle(0,0,this.sizerImage.width,this.sizerImage.height),this.sizerImage.src)).dialect=this.outline.dialect,t;var t},mxOutline.prototype.getSourceContainerSize=function(){return new mxRectangle(0,0,this.source.container.scrollWidth,this.source.container.scrollHeight)},mxOutline.prototype.getOutlineOffset=function(t){return null},mxOutline.prototype.getSourceGraphBounds=function(){return this.source.getGraphBounds()},mxOutline.prototype.update=function(t){var e,n,i,l,s,o,r;null!=this.source&&null!=this.source.container&&null!=this.outline&&null!=this.outline.container&&(n=this.source.view.scale,i=new mxRectangle((s=this.getSourceGraphBounds()).x/n+this.source.panDx,s.y/n+this.source.panDy,s.width/n,s.height/n),o=new mxRectangle(0,0,this.source.container.clientWidth/n,this.source.container.clientHeight/n),(r=i.clone()).add(o),l=this.getSourceContainerSize(),e=Math.max(l.width/n,r.width),s=Math.max(l.height/n,r.height),o=Math.max(0,this.outline.container.clientWidth-this.border),l=Math.max(0,this.outline.container.clientHeight-this.border),n=Math.min(o/e,l/s),0<(r=isNaN(n)?this.minScale:Math.max(this.minScale,n))&&(this.outline.getView().scale!=r&&(this.outline.getView().scale=r,t=!0),(o=this.outline.getView()).currentRoot!=this.source.getView().currentRoot&&o.setCurrentRoot(this.source.getView().currentRoot),l=(e=this.source.view.translate).x+this.source.panDx,s=e.y+this.source.panDy,null!=(n=this.getOutlineOffset(r))&&(l+=n.x,s+=n.y),i.x<0&&(l-=i.x),i.y<0&&(s-=i.y),o.translate.x==l&&o.translate.y==s||(o.translate.x=l,o.translate.y=s,t=!0),n=o.translate,i=(r=this.source.getView().scale)/o.scale,l=1/o.scale,s=this.source.container,this.bounds=new mxRectangle((n.x-e.x-this.source.panDx)/l,(n.y-e.y-this.source.panDy)/l,s.clientWidth/i,s.clientHeight/i),this.bounds.x+=this.source.container.scrollLeft*o.scale/r,this.bounds.y+=this.source.container.scrollTop*o.scale/r,(o=this.selectionBorder.bounds).x==this.bounds.x&&o.y==this.bounds.y&&o.width==this.bounds.width&&o.height==this.bounds.height||(this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw()),o=this.sizer.bounds,r=new mxRectangle(this.bounds.x+this.bounds.width-o.width/2,this.bounds.y+this.bounds.height-o.height/2,o.width,o.height),o.x==r.x&&o.y==r.y&&o.width==r.width&&o.height==r.height||(this.sizer.bounds=r,"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw()),t&&this.outline.view.revalidate()))},mxOutline.prototype.mouseDown=function(t,e){var n;this.enabled&&this.showViewport&&(n=mxEvent.isMouseEvent(e.getEvent())?0:this.source.tolerance,n=this.source.allowHandleBoundsCheck&&(mxClient.IS_IE||0<n)?new mxRectangle(e.getGraphX()-n,e.getGraphY()-n,2*n,2*n):null,this.zoom=e.isSource(this.sizer)||null!=n&&mxUtils.intersects(shape.bounds,n),this.startX=e.getX(),this.startY=e.getY(),this.active=!0,this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)?(this.dx0=this.source.container.scrollLeft,this.dy0=this.source.container.scrollTop):(this.dx0=0,this.dy0=0)),e.consume()},mxOutline.prototype.mouseMove=function(t,e){var n,i,l,s;this.active&&(this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display,n=(l=this.getTranslateForEvent(e)).x,s=l.y,l=null,this.zoom?(s=n/((i=this.source.container).clientWidth/i.clientHeight),l=new mxRectangle(this.bounds.x,this.bounds.y,Math.max(1,this.bounds.width+n),Math.max(1,this.bounds.height+s)),this.selectionBorder.bounds=l,this.selectionBorder.redraw()):(i=this.outline.getView().scale,l=new mxRectangle(this.bounds.x+n,this.bounds.y+s,this.bounds.width,this.bounds.height),this.selectionBorder.bounds=l,this.selectionBorder.redraw(),n/=i,n*=this.source.getView().scale,s/=i,s*=this.source.getView().scale,this.source.panGraph(-n-this.dx0,-s-this.dy0)),s=this.sizer.bounds,this.sizer.bounds=new mxRectangle(l.x+l.width-s.width/2,l.y+l.height-s.height/2,s.width,s.height),"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw(),e.consume())},mxOutline.prototype.getTranslateForEvent=function(t){return new mxPoint(t.getX()-this.startX,t.getY()-this.startY)},mxOutline.prototype.mouseUp=function(t,e){var n,i,l,s;this.active&&(n=(l=this.getTranslateForEvent(e)).x,i=l.y,(0<Math.abs(n)||0<Math.abs(i))&&(this.zoom?(s=this.selectionBorder.bounds.width,l=this.source.getView().scale,this.source.zoomTo(Math.max(this.minScale,l-n*l/s),!1)):this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)||(this.source.panGraph(0,0),n/=this.outline.getView().scale,i/=this.outline.getView().scale,s=this.source.getView().translate,this.source.getView().setTranslate(s.x-n,s.y-i)),this.update(),e.consume()),this.index=null,this.active=!1)},mxOutline.prototype.destroy=function(){null!=this.source&&(this.source.removeListener(this.panHandler),this.source.removeListener(this.refreshHandler),this.source.getModel().removeListener(this.updateHandler),this.source.getView().removeListener(this.updateHandler),mxEvent.removeListener(this.source.container,"scroll",this.updateHandler),this.source=null),null!=this.outline&&(this.outline.removeMouseListener(this),this.outline.destroy(),this.outline=null),null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null),null!=this.sizer&&(this.sizer.destroy(),this.sizer=null)},mxMultiplicity.prototype.type=null,mxMultiplicity.prototype.attr=null,mxMultiplicity.prototype.value=null,mxMultiplicity.prototype.source=null,mxMultiplicity.prototype.min=null,mxMultiplicity.prototype.max=null,mxMultiplicity.prototype.validNeighbors=null,mxMultiplicity.prototype.validNeighborsAllowed=!0,mxMultiplicity.prototype.countError=null,mxMultiplicity.prototype.typeError=null,mxMultiplicity.prototype.check=function(t,e,n,i,l,s){var o="";return(this.source&&this.checkTerminal(t,n,e)||!this.source&&this.checkTerminal(t,i,e))&&(null!=this.countError&&(this.source&&(0==this.max||l>=this.max)||!this.source&&(0==this.max||s>=this.max))&&(o+=this.countError+"\n"),null!=this.validNeighbors&&null!=this.typeError&&0<this.validNeighbors.length&&(this.checkNeighbors(t,e,n,i)||(o+=this.typeError+"\n"))),0<o.length?o:null},mxMultiplicity.prototype.checkNeighbors=function(t,e,n,i){for(var l=t.model.getValue(n),s=t.model.getValue(i),o=!this.validNeighborsAllowed,r=this.validNeighbors,a=0;a<r.length;a++){if(this.source&&this.checkType(t,s,r[a])){o=this.validNeighborsAllowed;break}if(!this.source&&this.checkType(t,l,r[a])){o=this.validNeighborsAllowed;break}}return o},mxMultiplicity.prototype.checkTerminal=function(t,e,n){e=t.model.getValue(e);return this.checkType(t,e,this.type,this.attr,this.value)},mxMultiplicity.prototype.checkType=function(t,e,n,i,l){return null!=e&&(isNaN(e.nodeType)?e==n:mxUtils.isNode(e,n,i,l))},mxLayoutManager.prototype=new mxEventSource,mxLayoutManager.prototype.constructor=mxLayoutManager,mxLayoutManager.prototype.graph=null,mxLayoutManager.prototype.bubbling=!0,mxLayoutManager.prototype.enabled=!0,mxLayoutManager.prototype.undoHandler=null,mxLayoutManager.prototype.moveHandler=null,mxLayoutManager.prototype.resizeHandler=null,mxLayoutManager.prototype.isEnabled=function(){return this.enabled},mxLayoutManager.prototype.setEnabled=function(t){this.enabled=t},mxLayoutManager.prototype.isBubbling=function(){return this.bubbling},mxLayoutManager.prototype.setBubbling=function(t){this.bubbling=t},mxLayoutManager.prototype.getGraph=function(){return this.graph},mxLayoutManager.prototype.setGraph=function(t){null!=this.graph&&(this.graph.getModel().removeListener(this.undoHandler),this.graph.removeListener(this.moveHandler),this.graph.removeListener(this.resizeHandler)),this.graph=t,null!=this.graph&&(this.graph.getModel().addListener(mxEvent.BEFORE_UNDO,this.undoHandler),this.graph.addListener(mxEvent.MOVE_CELLS,this.moveHandler),this.graph.addListener(mxEvent.RESIZE_CELLS,this.resizeHandler))},mxLayoutManager.prototype.hasLayout=function(t){return this.getLayout(t,mxEvent.LAYOUT_CELLS)},mxLayoutManager.prototype.getLayout=function(t,e){return null},mxLayoutManager.prototype.beforeUndo=function(t){this.executeLayoutForCells(this.getCellsForChanges(t.changes))},mxLayoutManager.prototype.cellsMoved=function(t,e){if(null!=t&&null!=e)for(var n=mxUtils.convertPoint(this.getGraph().container,mxEvent.getClientX(e),mxEvent.getClientY(e)),i=this.getGraph().getModel(),l=0;l<t.length;l++){var s=this.getLayout(i.getParent(t[l]),mxEvent.MOVE_CELLS);null!=s&&s.moveCell(t[l],n.x,n.y)}},mxLayoutManager.prototype.cellsResized=function(t,e,n){if(null!=t&&null!=e)for(var i=this.getGraph().getModel(),l=0;l<t.length;l++){var s=this.getLayout(i.getParent(t[l]),mxEvent.RESIZE_CELLS);null!=s&&s.resizeCell(t[l],e[l],n[l])}},mxLayoutManager.prototype.getCellsForChanges=function(t){for(var e=[],n=0;n<t.length;n++){var i=t[n];if(i instanceof mxRootChange)return[];e=e.concat(this.getCellsForChange(i))}return e},mxLayoutManager.prototype.getCellsForChange=function(t){return t instanceof mxChildChange?this.addCellsWithLayout(t.child,this.addCellsWithLayout(t.previous)):t instanceof mxTerminalChange||t instanceof mxGeometryChange||t instanceof mxVisibleChange||t instanceof mxStyleChange?this.addCellsWithLayout(t.cell):[]},mxLayoutManager.prototype.addCellsWithLayout=function(t,e){return this.addDescendantsWithLayout(t,this.addAncestorsWithLayout(t,e))},mxLayoutManager.prototype.addAncestorsWithLayout=function(t,e){var n;return e=null!=e?e:[],null!=t&&(null!=this.hasLayout(t)&&e.push(t),this.isBubbling()&&(n=this.getGraph().getModel(),this.addAncestorsWithLayout(n.getParent(t),e))),e},mxLayoutManager.prototype.addDescendantsWithLayout=function(t,e){if(e=null!=e?e:[],null!=t&&this.hasLayout(t))for(var n=this.getGraph().getModel(),i=0;i<n.getChildCount(t);i++){var l=n.getChildAt(t,i);this.hasLayout(l)&&(e.push(l),this.addDescendantsWithLayout(l,e))}return e},mxLayoutManager.prototype.executeLayoutForCells=function(t){t=mxUtils.sortCells(t,!1);this.layoutCells(t,!0),this.layoutCells(t.reverse(),!1)},mxLayoutManager.prototype.layoutCells=function(t,e){if(0<t.length){var n=this.getGraph().getModel();n.beginUpdate();try{for(var i=null,l=0;l<t.length;l++)t[l]!=n.getRoot()&&t[l]!=i&&(this.executeLayout(t[l],e),i=t[l]);this.fireEvent(new mxEventObject(mxEvent.LAYOUT_CELLS,"cells",t))}finally{n.endUpdate()}}},mxLayoutManager.prototype.executeLayout=function(t,e){e=this.getLayout(t,e?mxEvent.BEGIN_UPDATE:mxEvent.END_UPDATE);null!=e&&e.execute(t)},mxLayoutManager.prototype.destroy=function(){this.setGraph(null)},mxSwimlaneManager.prototype=new mxEventSource,mxSwimlaneManager.prototype.constructor=mxSwimlaneManager,mxSwimlaneManager.prototype.graph=null,mxSwimlaneManager.prototype.enabled=!0,mxSwimlaneManager.prototype.horizontal=!0,mxSwimlaneManager.prototype.addEnabled=!0,mxSwimlaneManager.prototype.resizeEnabled=!0,mxSwimlaneManager.prototype.addHandler=null,mxSwimlaneManager.prototype.resizeHandler=null,mxSwimlaneManager.prototype.isEnabled=function(){return this.enabled},mxSwimlaneManager.prototype.setEnabled=function(t){this.enabled=t},mxSwimlaneManager.prototype.isHorizontal=function(){return this.horizontal},mxSwimlaneManager.prototype.setHorizontal=function(t){this.horizontal=t},mxSwimlaneManager.prototype.isAddEnabled=function(){return this.addEnabled},mxSwimlaneManager.prototype.setAddEnabled=function(t){this.addEnabled=t},mxSwimlaneManager.prototype.isResizeEnabled=function(){return this.resizeEnabled},mxSwimlaneManager.prototype.setResizeEnabled=function(t){this.resizeEnabled=t},mxSwimlaneManager.prototype.getGraph=function(){return this.graph},mxSwimlaneManager.prototype.setGraph=function(t){null!=this.graph&&(this.graph.removeListener(this.addHandler),this.graph.removeListener(this.resizeHandler)),this.graph=t,null!=this.graph&&(this.graph.addListener(mxEvent.ADD_CELLS,this.addHandler),this.graph.addListener(mxEvent.CELLS_RESIZED,this.resizeHandler))},mxSwimlaneManager.prototype.isSwimlaneIgnored=function(t){return!this.getGraph().isSwimlane(t)},mxSwimlaneManager.prototype.isCellHorizontal=function(t){if(this.graph.isSwimlane(t)){t=this.graph.getCellStyle(t);return 1==mxUtils.getValue(t,mxConstants.STYLE_HORIZONTAL,1)}return!this.isHorizontal()},mxSwimlaneManager.prototype.cellsAdded=function(t){if(null!=t){var e=this.getGraph().getModel();e.beginUpdate();try{for(var n=0;n<t.length;n++)this.isSwimlaneIgnored(t[n])||this.swimlaneAdded(t[n])}finally{e.endUpdate()}}},mxSwimlaneManager.prototype.swimlaneAdded=function(t){for(var e,n=this.getGraph().getModel(),i=n.getParent(t),l=n.getChildCount(i),s=null,o=0;o<l;o++){var r=n.getChildAt(i,o);if(r!=t&&!this.isSwimlaneIgnored(r)&&null!=(s=n.getGeometry(r)))break}null!=s&&(e=null!=i?this.isCellHorizontal(i):this.horizontal,this.resizeSwimlane(t,s.width,s.height,e))},mxSwimlaneManager.prototype.cellsResized=function(t){if(null!=t){var e=this.getGraph().getModel();e.beginUpdate();try{for(var n=0;n<t.length;n++)if(!this.isSwimlaneIgnored(t[n])){var i=e.getGeometry(t[n]);if(null!=i){for(var l=new mxRectangle(0,0,i.width,i.height),s=t[n],o=s;null!=o;){s=o,o=e.getParent(o);var r=this.graph.isSwimlane(o)?this.graph.getStartSize(o):new mxRectangle;l.width+=r.width,l.height+=r.height}i=null!=o?this.isCellHorizontal(o):this.horizontal;this.resizeSwimlane(s,l.width,l.height,i)}}}finally{e.endUpdate()}}},mxSwimlaneManager.prototype.resizeSwimlane=function(t,e,n,i){var l=this.getGraph().getModel();l.beginUpdate();try{var s=this.isCellHorizontal(t);this.isSwimlaneIgnored(t)||null!=(o=l.getGeometry(t))&&(i&&o.height!=n||!i&&o.width!=e)&&(o=o.clone(),i?o.height=n:o.width=e,l.setGeometry(t,o));var o=this.graph.isSwimlane(t)?this.graph.getStartSize(t):new mxRectangle;e-=o.width,n-=o.height;for(var r=l.getChildCount(t),a=0;a<r;a++){var h=l.getChildAt(t,a);this.resizeSwimlane(h,e,n,s)}}finally{l.endUpdate()}},mxSwimlaneManager.prototype.destroy=function(){this.setGraph(null)},mxTemporaryCellStates.prototype.view=null,mxTemporaryCellStates.prototype.oldStates=null,mxTemporaryCellStates.prototype.oldBounds=null,mxTemporaryCellStates.prototype.oldScale=null,mxTemporaryCellStates.prototype.destroy=function(){this.view.setScale(this.oldScale),this.view.setStates(this.oldStates),this.view.setGraphBounds(this.oldBounds),this.view.validateCellState=this.oldValidateCellState,this.view.graph.cellRenderer.doRedrawShape=this.oldDoRedrawShape},mxCellStatePreview.prototype.graph=null,mxCellStatePreview.prototype.deltas=null,mxCellStatePreview.prototype.count=0,mxCellStatePreview.prototype.isEmpty=function(){return 0==this.count},mxCellStatePreview.prototype.moveState=function(t,e,n,i,l){i=null==i||i,l=null==l||l;var s=this.deltas.get(t.cell);return null==s?(s={point:new mxPoint(e,n),state:t},this.deltas.put(t.cell,s),this.count++):i?(s.point.x+=e,s.point.y+=n):(s.point.x=e,s.point.y=n),l&&this.addEdges(t),s.point},mxCellStatePreview.prototype.show=function(n){this.deltas.visit(mxUtils.bind(this,function(t,e){this.translateState(e.state,e.point.x,e.point.y)})),this.deltas.visit(mxUtils.bind(this,function(t,e){this.revalidateState(e.state,e.point.x,e.point.y,n)}))},mxCellStatePreview.prototype.translateState=function(t,e,n){if(null!=t){var i,l=this.graph.getModel();l.isVertex(t.cell)&&(t.view.updateCellState(t),i=l.getGeometry(t.cell),0==e&&0==n||null==i||i.relative&&null==this.deltas.get(t.cell)||(t.x+=e,t.y+=n));for(var s=l.getChildCount(t.cell),o=0;o<s;o++)this.translateState(t.view.getState(l.getChildAt(t.cell,o)),e,n)}},mxCellStatePreview.prototype.revalidateState=function(t,e,n,i){if(null!=t){var l=this.graph.getModel();l.isEdge(t.cell)&&t.view.updateCellState(t);var s=this.graph.getCellGeometry(t.cell),o=t.view.getState(l.getParent(t.cell));0==e&&0==n||null==s||!s.relative||!l.isVertex(t.cell)||null!=o&&!l.isVertex(o.cell)&&null==this.deltas.get(t.cell)||(t.x+=e,t.y+=n),this.graph.cellRenderer.redraw(t),null!=i&&i(t);for(var r=l.getChildCount(t.cell),a=0;a<r;a++)this.revalidateState(this.graph.view.getState(l.getChildAt(t.cell,a)),e,n,i)}},mxCellStatePreview.prototype.addEdges=function(t){for(var e=this.graph.getModel(),n=e.getEdgeCount(t.cell),i=0;i<n;i++){var l=t.view.getState(e.getEdgeAt(t.cell,i));null!=l&&this.moveState(l,0,0)}},mxConnectionConstraint.prototype.point=null,mxConnectionConstraint.prototype.perimeter=null,mxConnectionConstraint.prototype.name=null,mxConnectionConstraint.prototype.dx=null,mxConnectionConstraint.prototype.dy=null,mxGraphHandler.prototype.graph=null,mxGraphHandler.prototype.maxCells=mxClient.IS_IE?20:50,mxGraphHandler.prototype.enabled=!0,mxGraphHandler.prototype.highlightEnabled=!0,mxGraphHandler.prototype.cloneEnabled=!0,mxGraphHandler.prototype.moveEnabled=!0,mxGraphHandler.prototype.guidesEnabled=!1,mxGraphHandler.prototype.handlesVisible=!0,mxGraphHandler.prototype.guide=null,mxGraphHandler.prototype.currentDx=null,mxGraphHandler.prototype.currentDy=null,mxGraphHandler.prototype.updateCursor=!0,mxGraphHandler.prototype.selectEnabled=!0,mxGraphHandler.prototype.removeCellsFromParent=!0,mxGraphHandler.prototype.removeEmptyParents=!1,mxGraphHandler.prototype.connectOnDrop=!1,mxGraphHandler.prototype.scrollOnMove=!0,mxGraphHandler.prototype.minimumSize=6,mxGraphHandler.prototype.previewColor="black",mxGraphHandler.prototype.htmlPreview=!1,mxGraphHandler.prototype.shape=null,mxGraphHandler.prototype.scaleGrid=!1,mxGraphHandler.prototype.rotationEnabled=!0,mxGraphHandler.prototype.maxLivePreview=0,mxGraphHandler.prototype.allowLivePreview=mxClient.IS_SVG,mxGraphHandler.prototype.isEnabled=function(){return this.enabled},mxGraphHandler.prototype.setEnabled=function(t){this.enabled=t},mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled},mxGraphHandler.prototype.setCloneEnabled=function(t){this.cloneEnabled=t},mxGraphHandler.prototype.isMoveEnabled=function(){return this.moveEnabled},mxGraphHandler.prototype.setMoveEnabled=function(t){this.moveEnabled=t},mxGraphHandler.prototype.isSelectEnabled=function(){return this.selectEnabled},mxGraphHandler.prototype.setSelectEnabled=function(t){this.selectEnabled=t},mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent},mxGraphHandler.prototype.setRemoveCellsFromParent=function(t){this.removeCellsFromParent=t},mxGraphHandler.prototype.isPropagateSelectionCell=function(t,e,n){var i=this.graph.model.getParent(t);if(e){e=this.graph.model.isEdge(t)?null:this.graph.getCellGeometry(t);return!this.graph.isSiblingSelected(t)&&(null!=e&&e.relative||!this.graph.isSwimlane(i))}return(!this.graph.isToggleEvent(n.getEvent())||!this.graph.isSiblingSelected(t)&&!this.graph.isCellSelected(t)&&!this.graph.isSwimlane(i)||this.graph.isCellSelected(i))&&(this.graph.isToggleEvent(n.getEvent())||!this.graph.isCellSelected(i))},mxGraphHandler.prototype.getInitialCellForEvent=function(t){var e=t.getState();if(!(this.graph.isToggleEvent(t.getEvent())&&mxEvent.isAltDown(t.getEvent())||null==e||this.graph.isCellSelected(e.cell)))for(var n=this.graph.model,i=this.graph.view.getState(n.getParent(e.cell));null!=i&&!this.graph.isCellSelected(i.cell)&&(n.isVertex(i.cell)||n.isEdge(i.cell))&&this.isPropagateSelectionCell(e.cell,!0,t);)e=i,i=this.graph.view.getState(this.graph.getModel().getParent(e.cell));return null!=e?e.cell:null},mxGraphHandler.prototype.isDelayedSelection=function(t,e){if(!this.graph.isToggleEvent(e.getEvent())||!mxEvent.isAltDown(e.getEvent()))for(;null!=t;){if(this.graph.selectionCellsHandler.isHandled(t))return this.graph.cellEditor.getEditingCell()!=t;t=this.graph.model.getParent(t)}return this.graph.isToggleEvent(e.getEvent())&&!mxEvent.isAltDown(e.getEvent())},mxGraphHandler.prototype.selectDelayed=function(t){var e;this.graph.popupMenuHandler.isPopupTrigger(t)||(null==(e=t.getCell())&&(e=this.cell),this.selectCellForEvent(e,t))},mxGraphHandler.prototype.selectCellForEvent=function(t,e){var n=this.graph.view.getState(t);if(null!=n)if(e.isSource(n.control))this.graph.selectCellForEvent(t,e.getEvent());else{if(!this.graph.isToggleEvent(e.getEvent())||!mxEvent.isAltDown(e.getEvent()))for(var i=this.graph.getModel(),l=i.getParent(t);null!=this.graph.view.getState(l)&&(i.isVertex(l)||i.isEdge(l))&&this.isPropagateSelectionCell(t,!1,e);)t=l,l=i.getParent(t);this.graph.selectCellForEvent(t,e.getEvent())}return t},mxGraphHandler.prototype.consumeMouseEvent=function(t,e){e.consume()},mxGraphHandler.prototype.mouseDown=function(t,e){var n,i,l;!e.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&null!=e.getState()&&!mxEvent.isMultiTouchEvent(e.getEvent())&&(n=this.getInitialCellForEvent(e),this.delayedSelection=this.isDelayedSelection(n,e),this.cell=null,this.isSelectEnabled()&&!this.delayedSelection&&this.graph.selectCellForEvent(n,e.getEvent()),this.isMoveEnabled()&&(l=(i=this.graph.model).getGeometry(n),this.graph.isCellMovable(n)&&(!i.isEdge(n)||1<this.graph.getSelectionCount()||null!=l.points&&0<l.points.length||null==i.getTerminal(n,!0)||null==i.getTerminal(n,!1)||this.graph.allowDanglingEdges||this.graph.isCloneEvent(e.getEvent())&&this.graph.isCellsCloneable())?this.start(n,e.getX(),e.getY()):this.delayedSelection&&(this.cell=n),this.cellWasClicked=!0,this.consumeMouseEvent(mxEvent.MOUSE_DOWN,e)))},mxGraphHandler.prototype.getGuideStates=function(){var t=this.graph.getDefaultParent(),e=this.graph.getModel(),n=mxUtils.bind(this,function(t){return null!=this.graph.view.getState(t)&&e.isVertex(t)&&null!=e.getGeometry(t)&&!e.getGeometry(t).relative});return this.graph.view.getCellStates(e.filterDescendants(n,t))},mxGraphHandler.prototype.getCells=function(t){return!this.delayedSelection&&this.graph.isCellMovable(t)?[t]:this.graph.getMovableCells(this.graph.getSelectionCells())},mxGraphHandler.prototype.getPreviewBounds=function(t){var e,t=this.getBoundingBox(t);return null!=t&&(t.width=Math.max(0,t.width-1),t.height=Math.max(0,t.height-1),t.width<this.minimumSize?(e=this.minimumSize-t.width,t.x-=e/2,t.width=this.minimumSize):(t.x=Math.round(t.x),t.width=Math.ceil(t.width)),this.graph.view.translate,this.graph.view.scale,t.height<this.minimumSize?(e=this.minimumSize-t.height,t.y-=e/2,t.height=this.minimumSize):(t.y=Math.round(t.y),t.height=Math.ceil(t.height))),t},mxGraphHandler.prototype.getBoundingBox=function(t){var e=null;if(null!=t&&0<t.length)for(var n,i,l=this.graph.getModel(),s=0;s<t.length;s++)!l.isVertex(t[s])&&!l.isEdge(t[s])||null!=(n=this.graph.view.getState(t[s]))&&(i=n,l.isVertex(t[s])&&null!=n.shape&&null!=n.shape.boundingBox&&(i=n.shape.boundingBox),null==e?e=mxRectangle.fromRectangle(i):e.add(i));return e},mxGraphHandler.prototype.createPreviewShape=function(t){t=new mxRectangleShape(t,null,this.previewColor);return t.isDashed=!0,this.htmlPreview?(t.dialect=mxConstants.DIALECT_STRICTHTML,t.init(this.graph.container)):(t.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,t.init(this.graph.getView().getOverlayPane()),t.pointerEvents=!1,mxClient.IS_IOS&&(t.getSvgScreenOffset=function(){return 0})),t},mxGraphHandler.prototype.start=function(t,e,n,i){this.cell=t,this.first=mxUtils.convertPoint(this.graph.container,e,n),this.cells=null!=i?i:this.getCells(this.cell),this.bounds=this.graph.getView().getBounds(this.cells),this.pBounds=this.getPreviewBounds(this.cells),this.allCells=new mxDictionary,this.cloning=!1;for(var l=this.cellCount=0;l<this.cells.length;l++)this.cellCount+=this.addStates(this.cells[l],this.allCells);if(this.guidesEnabled){this.guide=new mxGuide(this.graph,this.getGuideStates());for(var s=this.graph.model.getParent(t),o=this.graph.model.getChildCount(s)<2,r=new mxDictionary,a=this.graph.getOpposites(this.graph.getEdges(this.cell),this.cell),l=0;l<a.length;l++){var h=this.graph.view.getState(a[l]);null==h||r.get(h)||r.put(h,!0)}this.guide.isStateIgnored=mxUtils.bind(this,function(t){var e=this.graph.model.getParent(t.cell);return null!=t.cell&&(!this.cloning&&this.isCellMoving(t.cell)||t.cell!=(this.target||s)&&!o&&!r.get(t)&&(null==this.target||2<=this.graph.model.getChildCount(this.target))&&e!=(this.target||s))})}},mxGraphHandler.prototype.addStates=function(t,e){var n=this.graph.view.getState(t),i=0;if(null!=n&&null==e.get(t)){e.put(t,n),i++;for(var l=this.graph.model.getChildCount(t),s=0;s<l;s++)i+=this.addStates(this.graph.model.getChildAt(t,s),e)}return i},mxGraphHandler.prototype.isCellMoving=function(t){return null!=this.allCells.get(t)},mxGraphHandler.prototype.useGuidesForEvent=function(t){return null==this.guide||this.guide.isEnabledForEvent(t.getEvent())&&!this.graph.isConstrainedEvent(t.getEvent())},mxGraphHandler.prototype.snap=function(t){var e=this.scaleGrid?this.graph.view.scale:1;return t.x=this.graph.snap(t.x/e)*e,t.y=this.graph.snap(t.y/e)*e,t},mxGraphHandler.prototype.getDelta=function(t){t=mxUtils.convertPoint(this.graph.container,t.getX(),t.getY());return new mxPoint(t.x-this.first.x-this.graph.panDx,t.y-this.first.y-this.graph.panDy)},mxGraphHandler.prototype.updateHint=function(t){},mxGraphHandler.prototype.removeHint=function(){},mxGraphHandler.prototype.roundLength=function(t){return Math.round(100*t)/100},mxGraphHandler.prototype.isValidDropTarget=function(t,e){return this.graph.model.getParent(this.cell)!=t},mxGraphHandler.prototype.checkPreview=function(){this.livePreviewActive&&this.cloning?(this.resetLivePreview(),this.livePreviewActive=!1):this.maxLivePreview>=this.cellCount&&!this.livePreviewActive&&this.allowLivePreview?this.cloning&&this.livePreviewActive||(this.livePreviewActive=!0,this.livePreviewUsed=!0):this.livePreviewUsed||null!=this.shape||(this.shape=this.createPreviewShape(this.bounds))},mxGraphHandler.prototype.mouseMove=function(t,e){var n,i,l,s,o,r,a,h,d=this.graph;e.isConsumed()||!d.isMouseDown||null==this.cell||null==this.first||null==this.bounds||this.suspended?!this.isMoveEnabled()&&!this.isCloneEnabled()||!this.updateCursor||e.isConsumed()||null==e.getState()&&null==e.sourceState||d.isMouseDown||(null==(r=d.getCursorForMouseEvent(e))&&d.isEnabled()&&d.isCellMovable(e.getCell())&&(r=d.getModel().isEdge(e.getCell())?mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),null!=r&&null!=e.sourceState&&e.sourceState.setCursor(r)):mxEvent.isMultiTouchEvent(e.getEvent())?this.reset():(n=this.getDelta(e),h=d.tolerance,(null!=this.shape||this.livePreviewActive||Math.abs(n.x)>h||Math.abs(n.y)>h)&&(null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3)),i=d.isCloneEvent(e.getEvent())&&d.isCellsCloneable()&&this.isCloneEnabled(),l=d.isGridEnabledEvent(e.getEvent()),a=e.getCell(),s=!0,o=null,this.cloning=i,d.isDropEnabled()&&this.highlightEnabled&&(o=d.getDropTarget(this.cells,e.getEvent(),a,i)),r=!1,null!=(h=d.getView().getState(o))&&(i||this.isValidDropTarget(o,e))?(this.target!=o&&(this.target=o,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),r=!0):(this.target=null,this.connectOnDrop&&null!=a&&1==this.cells.length&&d.getModel().isVertex(a)&&d.isCellConnectable(a)&&null!=(h=d.getView().getState(a))&&(a=null==d.getEdgeValidationError(null,this.cell,a)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,this.setHighlightColor(a),r=!0)),null!=h&&r?this.highlight.highlight(h):this.highlight.hide(),null!=this.guide&&this.useGuidesForEvent(e)?(n=this.guide.move(this.bounds,n,l,i),s=!1):n=this.graph.snapDelta(n,this.bounds,!l,!1,!1),null!=this.guide&&s&&this.guide.hide(),d.isConstrainedEvent(e.getEvent())&&(Math.abs(n.x)>Math.abs(n.y)?n.y=0:n.x=0),this.checkPreview(),this.currentDx==n.x&&this.currentDy==n.y||(this.currentDx=n.x,this.currentDy=n.y,this.updatePreview())),this.updateHint(e),this.consumeMouseEvent(mxEvent.MOUSE_MOVE,e),mxEvent.consume(e.getEvent()))},mxGraphHandler.prototype.updatePreview=function(t){this.livePreviewUsed&&!t?null!=this.cells&&(this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!1),this.updateLivePreview(this.currentDx,this.currentDy)):this.updatePreviewShape()},mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&null!=this.pBounds&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx),Math.round(this.pBounds.y+this.currentDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())},mxGraphHandler.prototype.updateLivePreview=function(i,l){if(!this.suspended){var s=[];if(null!=this.allCells&&this.allCells.visit(mxUtils.bind(this,function(t,e){var n=this.graph.view.getState(e.cell);n!=e&&(e.destroy(),null!=n?this.allCells.put(e.cell,n):this.allCells.remove(e.cell),e=n),null!=e&&(n=e.clone(),s.push([e,n]),null!=e.shape&&(null==e.shape.originalPointerEvents&&(e.shape.originalPointerEvents=e.shape.pointerEvents),e.shape.pointerEvents=!1,null!=e.text&&(null==e.text.originalPointerEvents&&(e.text.originalPointerEvents=e.text.pointerEvents),e.text.pointerEvents=!1)),this.graph.model.isVertex(e.cell)&&(e.x+=i,e.y+=l,this.cloning?null!=e.text&&(e.text.updateBoundingBox(),null!=e.text.boundingBox&&(e.text.boundingBox.x+=i,e.text.boundingBox.y+=l),null!=e.text.unrotatedBoundingBox&&(e.text.unrotatedBoundingBox.x+=i,e.text.unrotatedBoundingBox.y+=l)):(e.view.graph.cellRenderer.redraw(e,!0),e.view.invalidate(e.cell),e.invalid=!1,null!=e.control&&null!=e.control.node&&(e.control.node.style.visibility="hidden"))))})),0==s.length)this.reset();else{for(var t=this.graph.view.scale,e=0;e<s.length;e++){var n=s[e][0];if(this.graph.model.isEdge(n.cell)){var o=this.graph.getCellGeometry(n.cell),r=[];if(null!=o&&null!=o.points)for(var a=0;a<o.points.length;a++)null!=o.points[a]&&r.push(new mxPoint(o.points[a].x+i/t,o.points[a].y+l/t));var h,d=n.visibleSourceState,u=n.visibleTargetState,p=s[e][1].absolutePoints;null!=d&&this.isCellMoving(d.cell)?n.view.updateFixedTerminalPoint(n,d,!0,this.graph.getConnectionConstraint(n,d,!0)):(h=p[0],n.setAbsoluteTerminalPoint(new mxPoint(h.x+i,h.y+l),!0),d=null),null!=u&&this.isCellMoving(u.cell)?n.view.updateFixedTerminalPoint(n,u,!1,this.graph.getConnectionConstraint(n,u,!1)):(p=p[p.length-1],n.setAbsoluteTerminalPoint(new mxPoint(p.x+i,p.y+l),!1),u=null),n.view.updatePoints(n,r,d,u),n.view.updateFloatingTerminalPoints(n,d,u),n.view.updateEdgeLabelOffset(n),n.invalid=!1,this.cloning||n.view.graph.cellRenderer.redraw(n,!0)}}this.graph.view.validate(),this.redrawHandles(s),this.resetPreviewStates(s)}}},mxGraphHandler.prototype.redrawHandles=function(t){for(var e=0;e<t.length;e++){var n=this.graph.selectionCellsHandler.getHandler(t[e][0].cell);null!=n&&n.redraw(!0)}},mxGraphHandler.prototype.resetPreviewStates=function(t){for(var e=0;e<t.length;e++)t[e][0].setState(t[e][1])},mxGraphHandler.prototype.suspend=function(){this.suspended||(this.livePreviewUsed&&this.updateLivePreview(0,0),null!=this.shape&&(this.shape.node.style.visibility="hidden"),null!=this.guide&&this.guide.setVisible(!1),this.suspended=!0)},mxGraphHandler.prototype.resume=function(){this.suspended&&(this.suspended=null,this.livePreviewUsed&&(this.livePreviewActive=!0),null!=this.shape&&(this.shape.node.style.visibility="visible"),null!=this.guide&&this.guide.setVisible(!0))},mxGraphHandler.prototype.resetLivePreview=function(){null!=this.allCells&&(this.allCells.visit(mxUtils.bind(this,function(t,e){null!=e.shape&&null!=e.shape.originalPointerEvents&&(e.shape.pointerEvents=e.shape.originalPointerEvents,e.shape.originalPointerEvents=null,(e.shape.bounds=null)!=e.text&&(e.text.pointerEvents=e.text.originalPointerEvents,e.text.originalPointerEvents=null)),null!=e.control&&null!=e.control.node&&"hidden"==e.control.node.style.visibility&&(e.control.node.style.visibility=""),this.cloning||null!=e.text&&e.text.updateBoundingBox(),e.view.invalidate(e.cell)})),this.graph.view.validate())};mxGraphHandler.prototype.setHandlesVisibleForCells=function(t,e,n){if(n||this.handlesVisible!=e){this.handlesVisible=e;for(var i=0;i<t.length;i++){var l=this.graph.selectionCellsHandler.getHandler(t[i]);null!=l&&(l.setHandlesVisible(e),e&&l.redraw())}}},mxGraphHandler.prototype.setHighlightColor=function(t){null!=this.highlight&&this.highlight.setHighlightColor(t)},mxGraphHandler.prototype.mouseUp=function(t,e){var n,i,l,s,o;e.isConsumed()||(this.livePreviewUsed&&this.resetLivePreview(),null==this.cell||null==this.first||null==this.shape&&!this.livePreviewUsed||null==this.currentDx||null==this.currentDy?this.isSelectEnabled()&&this.delayedSelection&&null!=this.cell&&this.selectDelayed(e):(n=this.graph,s=e.getCell(),this.connectOnDrop&&null==this.target&&null!=s&&n.getModel().isVertex(s)&&n.isCellConnectable(s)&&n.isEdgeValid(null,this.cell,s)?n.connectionHandler.connect(this.cell,s,e.getEvent()):(i=n.isCloneEvent(e.getEvent())&&n.isCellsCloneable()&&this.isCloneEnabled(),o=n.getView().scale,l=this.roundLength(this.currentDx/o),s=this.roundLength(this.currentDy/o),o=this.target,n.isSplitEnabled()&&n.isSplitTarget(o,this.cells,e.getEvent())?n.splitEdge(o,this.cells,null,l,s,e.getGraphX(),e.getGraphY()):this.moveCells(this.cells,l,s,i,this.target,e.getEvent())))),this.cellWasClicked&&this.consumeMouseEvent(mxEvent.MOUSE_UP,e),this.reset()},mxGraphHandler.prototype.reset=function(){this.livePreviewUsed&&(this.resetLivePreview(),this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!0)),this.destroyShapes(),this.removeHint(),this.delayedSelection=!1,this.livePreviewActive=null,this.livePreviewUsed=null,this.cellWasClicked=!1,this.suspended=null,this.currentDx=null,this.currentDy=null,this.cellCount=null,this.cloning=!1,this.allCells=null,this.pBounds=null,this.guides=null,this.target=null,this.first=null,this.cells=null,this.cell=null},mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(t,e,n){if(this.graph.getModel().isVertex(t)){var i=this.graph.getView().getState(t);if(null!=i){var l=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(n),mxEvent.getClientY(n)),s=mxUtils.toRadians(mxUtils.getValue(i.style,mxConstants.STYLE_ROTATION)||0);return 0!=s&&(t=Math.cos(-s),n=Math.sin(-s),s=new mxPoint(i.getCenterX(),i.getCenterY()),l=mxUtils.getRotatedPoint(l,t,n,s)),!mxUtils.contains(i,l.x,l.y)}}return!1},mxGraphHandler.prototype.moveCells=function(t,e,n,i,l,s){i&&(t=this.graph.getCloneableCells(t));var o=this.graph.getModel().getParent(this.cell);null==l&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(o,t,s)&&(l=this.graph.getDefaultParent()),i=i&&!this.graph.isCellLocked(l||this.graph.getDefaultParent()),this.graph.getModel().beginUpdate();try{var r=[];if(!i&&null!=l&&this.removeEmptyParents){for(var a=new mxDictionary,h=0;h<t.length;h++)a.put(t[h],!0);for(h=0;h<t.length;h++){var d=this.graph.model.getParent(t[h]);null==d||a.get(d)||(a.put(d,!0),r.push(d))}}t=this.graph.moveCells(t,e,n,i,l,s);for(var u=[],h=0;h<r.length;h++)this.shouldRemoveParent(r[h])&&u.push(r[h]);this.graph.removeCells(u,!1)}finally{this.graph.getModel().endUpdate()}i&&this.graph.setSelectionCells(t),this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(t[0])},mxGraphHandler.prototype.shouldRemoveParent=function(t){t=this.graph.view.getState(t);return null!=t&&(this.graph.model.isEdge(t.cell)||this.graph.model.isVertex(t.cell))&&this.graph.isCellDeletable(t.cell)&&0==this.graph.model.getChildCount(t.cell)&&this.graph.isTransparentState(t)},mxGraphHandler.prototype.destroyShapes=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.guide&&(this.guide.destroy(),this.guide=null),null!=this.highlight&&(this.highlight.destroy(),this.highlight=null)},mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.panHandler),null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null),null!=this.refreshHandler&&(this.graph.getModel().removeListener(this.refreshHandler),this.graph.removeListener(this.refreshHandler),this.refreshHandler=null),mxEvent.removeListener(document,"keydown",this.keyHandler),mxEvent.removeListener(document,"keyup",this.keyHandler),this.destroyShapes(),this.removeHint()},mxPanningHandler.prototype=new mxEventSource,mxPanningHandler.prototype.constructor=mxPanningHandler,mxPanningHandler.prototype.graph=null,mxPanningHandler.prototype.useLeftButtonForPanning=!1,mxPanningHandler.prototype.usePopupTrigger=!0,mxPanningHandler.prototype.ignoreCell=!1,mxPanningHandler.prototype.previewEnabled=!0,mxPanningHandler.prototype.useGrid=!1,mxPanningHandler.prototype.panningEnabled=!0,mxPanningHandler.prototype.pinchEnabled=!0,mxPanningHandler.prototype.maxScale=8,mxPanningHandler.prototype.minScale=.01,mxPanningHandler.prototype.dx=null,mxPanningHandler.prototype.dy=null,mxPanningHandler.prototype.startX=0,mxPanningHandler.prototype.startY=0,mxPanningHandler.prototype.isActive=function(){return this.active||null!=this.initialScale},mxPanningHandler.prototype.isPanningEnabled=function(){return this.panningEnabled},mxPanningHandler.prototype.setPanningEnabled=function(t){this.panningEnabled=t},mxPanningHandler.prototype.isPinchEnabled=function(){return this.pinchEnabled},mxPanningHandler.prototype.setPinchEnabled=function(t){this.pinchEnabled=t},mxPanningHandler.prototype.isPanningTrigger=function(t){var e=t.getEvent();return this.useLeftButtonForPanning&&null==t.getState()&&mxEvent.isLeftMouseButton(e)||mxEvent.isControlDown(e)&&mxEvent.isShiftDown(e)||this.usePopupTrigger&&mxEvent.isPopupTrigger(e)},mxPanningHandler.prototype.isForcePanningEvent=function(t){return this.ignoreCell||mxEvent.isMultiTouchEvent(t.getEvent())},mxPanningHandler.prototype.mouseDown=function(t,e){!(this.mouseDownEvent=e).isConsumed()&&this.isPanningEnabled()&&!this.active&&this.isPanningTrigger(e)&&(this.start(e),this.consumePanningTrigger(e))},mxPanningHandler.prototype.start=function(t){this.dx0=-this.graph.container.scrollLeft,this.dy0=-this.graph.container.scrollTop,this.startX=t.getX(),this.startY=t.getY(),this.dx=null,this.dy=null,this.panningTrigger=!0},mxPanningHandler.prototype.consumePanningTrigger=function(t){t.consume()},mxPanningHandler.prototype.mouseMove=function(t,e){var n;this.dx=e.getX()-this.startX,this.dy=e.getY()-this.startY,this.active?(this.previewEnabled&&(this.useGrid&&(this.dx=this.graph.snap(this.dx),this.dy=this.graph.snap(this.dy)),this.graph.panGraph(this.dx+this.dx0,this.dy+this.dy0)),this.fireEvent(new mxEventObject(mxEvent.PAN,"event",e))):this.panningTrigger&&(n=this.active,this.active=Math.abs(this.dx)>this.graph.tolerance||Math.abs(this.dy)>this.graph.tolerance,!n&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",e))),(this.active||this.panningTrigger)&&e.consume()},mxPanningHandler.prototype.mouseUp=function(t,e){var n,i;this.active&&(null!=this.dx&&null!=this.dy&&(this.graph.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.graph.container)||(n=this.graph.getView().scale,i=this.graph.getView().translate,this.graph.panGraph(0,0),this.panGraph(i.x+this.dx/n,i.y+this.dy/n)),e.consume()),this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",e))),this.reset()},mxPanningHandler.prototype.zoomGraph=function(t){var e=Math.round(this.initialScale*t.scale*100)/100;null!=this.minScale&&(e=Math.max(this.minScale,e)),null!=this.maxScale&&(e=Math.min(this.maxScale,e)),this.graph.view.scale!=e&&(this.graph.zoomTo(e),mxEvent.consume(t))},mxPanningHandler.prototype.reset=function(){this.panningTrigger=!1,this.mouseDownEvent=null,this.active=!1,this.dx=null,this.dy=null},mxPanningHandler.prototype.panGraph=function(t,e){this.graph.getView().setTranslate(t,e)},mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.forcePanningHandler),this.graph.removeListener(this.gestureHandler),mxEvent.removeListener(document,"mouseup",this.mouseUpListener)},mxPopupMenuHandler.prototype=new mxPopupMenu,mxPopupMenuHandler.prototype.constructor=mxPopupMenuHandler,mxPopupMenuHandler.prototype.graph=null,mxPopupMenuHandler.prototype.selectOnPopup=!0,mxPopupMenuHandler.prototype.clearSelectionOnBackground=!0,mxPopupMenuHandler.prototype.triggerX=null,mxPopupMenuHandler.prototype.triggerY=null,mxPopupMenuHandler.prototype.screenX=null,mxPopupMenuHandler.prototype.screenY=null,mxPopupMenuHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this),mxEvent.addGestureListeners(this.div,mxUtils.bind(this,function(t){this.graph.tooltipHandler.hide()}))},mxPopupMenuHandler.prototype.isSelectOnPopup=function(t){return this.selectOnPopup},mxPopupMenuHandler.prototype.mouseDown=function(t,e){this.isEnabled()&&!mxEvent.isMultiTouchEvent(e.getEvent())&&(this.hideMenu(),this.triggerX=e.getGraphX(),this.triggerY=e.getGraphY(),this.screenX=mxEvent.getMainEvent(e.getEvent()).screenX,this.screenY=mxEvent.getMainEvent(e.getEvent()).screenY,this.popupTrigger=this.isPopupTrigger(e),this.inTolerance=!0)},mxPopupMenuHandler.prototype.mouseMove=function(t,e){this.inTolerance&&null!=this.screenX&&null!=this.screenY&&(Math.abs(mxEvent.getMainEvent(e.getEvent()).screenX-this.screenX)>this.graph.tolerance||Math.abs(mxEvent.getMainEvent(e.getEvent()).screenY-this.screenY)>this.graph.tolerance)&&(this.inTolerance=!1)},mxPopupMenuHandler.prototype.mouseUp=function(t,e){var n,i;this.popupTrigger&&this.inTolerance&&null!=this.triggerX&&null!=this.triggerY&&(n=this.getCellForPopupEvent(e),this.graph.isEnabled()&&this.isSelectOnPopup(e)&&null!=n&&!this.graph.isCellSelected(n)?this.graph.setSelectionCell(n):this.clearSelectionOnBackground&&null==n&&this.graph.clearSelection(),this.graph.tooltipHandler.hide(),i=mxUtils.getScrollOrigin(),this.popup(e.getX()+i.x+1,e.getY()+i.y+1,n,e.getEvent()),e.consume()),this.popupTrigger=!1,this.inTolerance=!1},mxPopupMenuHandler.prototype.getCellForPopupEvent=function(t){return t.getCell()},mxPopupMenuHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.gestureHandler),mxPopupMenu.prototype.destroy.apply(this)},mxUtils.extend(mxCellMarker,mxEventSource),mxCellMarker.prototype.graph=null,mxCellMarker.prototype.enabled=!0,mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT,mxCellMarker.prototype.hotspotEnabled=!1,mxCellMarker.prototype.validColor=null,mxCellMarker.prototype.invalidColor=null,mxCellMarker.prototype.currentColor=null,mxCellMarker.prototype.validState=null,mxCellMarker.prototype.markedState=null,mxCellMarker.prototype.setEnabled=function(t){this.enabled=t},mxCellMarker.prototype.isEnabled=function(){return this.enabled},mxCellMarker.prototype.setHotspot=function(t){this.hotspot=t},mxCellMarker.prototype.getHotspot=function(){return this.hotspot},mxCellMarker.prototype.setHotspotEnabled=function(t){this.hotspotEnabled=t},mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled},mxCellMarker.prototype.hasValidState=function(){return null!=this.validState},mxCellMarker.prototype.getValidState=function(){return this.validState},mxCellMarker.prototype.getMarkedState=function(){return this.markedState},mxCellMarker.prototype.reset=function(){(this.validState=null)!=this.markedState&&(this.markedState=null,this.unmark())},mxCellMarker.prototype.process=function(t){var e=null;return this.isEnabled()&&(e=this.getState(t),this.setCurrentState(e,t)),e},mxCellMarker.prototype.setCurrentState=function(t,e,n){var i=null!=t&&this.isValidState(t);n=null!=n?n:this.getMarkerColor(e.getEvent(),t,i),this.validState=i?t:null,t==this.markedState&&n==this.currentColor||(this.currentColor=n,null!=t&&null!=this.currentColor?(this.markedState=t,this.mark()):null!=this.markedState&&(this.markedState=null,this.unmark()))},mxCellMarker.prototype.markCell=function(t,e){t=this.graph.getView().getState(t);null!=t&&(this.currentColor=null!=e?e:this.validColor,this.markedState=t,this.mark())},mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor),this.highlight.highlight(this.markedState),this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))},mxCellMarker.prototype.unmark=function(){this.mark()},mxCellMarker.prototype.isValidState=function(t){return!0},mxCellMarker.prototype.getMarkerColor=function(t,e,n){return n?this.validColor:this.invalidColor},mxCellMarker.prototype.getState=function(t){var e=this.graph.getView(),n=this.getCell(t),n=this.getStateToMark(e.getState(n));return null!=n&&this.intersects(n,t)?n:null},mxCellMarker.prototype.getCell=function(t){return t.getCell()},mxCellMarker.prototype.getStateToMark=function(t){return t},mxCellMarker.prototype.intersects=function(t,e){return!this.hotspotEnabled||mxUtils.intersectsHotspot(t,e.getGraphX(),e.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE)},mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),this.highlight.destroy()},mxUtils.extend(mxSelectionCellsHandler,mxEventSource),mxSelectionCellsHandler.prototype.graph=null,mxSelectionCellsHandler.prototype.enabled=!0,mxSelectionCellsHandler.prototype.refreshHandler=null,mxSelectionCellsHandler.prototype.maxHandlers=100,mxSelectionCellsHandler.prototype.handlers=null,mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled},mxSelectionCellsHandler.prototype.setEnabled=function(t){this.enabled=t},mxSelectionCellsHandler.prototype.getHandler=function(t){return this.handlers.get(t)},mxSelectionCellsHandler.prototype.isHandled=function(t){return null!=this.getHandler(t)},mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit(function(t,e){e.reset.apply(e)})},mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){return this.graph.getSelectionCells()},mxSelectionCellsHandler.prototype.refresh=function(){var t=this.handlers;this.handlers=new mxDictionary;for(var e=mxUtils.sortCells(this.getHandledSelectionCells(),!1),n=0;n<e.length;n++)null!=(i=this.graph.view.getState(e[n]))&&(null!=(l=t.remove(e[n]))&&(l.state!=i?(l.destroy(),l=null):this.isHandlerActive(l)||(null!=l.refresh&&l.refresh(),l.redraw())),null!=l&&this.handlers.put(e[n],l));t.visit(mxUtils.bind(this,function(t,e){this.fireEvent(new mxEventObject(mxEvent.REMOVE,"state",e.state)),e.destroy()}));for(var i,l,n=0;n<e.length;n++)null!=(i=this.graph.view.getState(e[n]))&&(null==(l=this.handlers.get(e[n]))?(l=this.graph.createHandler(i),this.fireEvent(new mxEventObject(mxEvent.ADD,"state",i)),this.handlers.put(e[n],l)):l.updateParentHighlight())},mxSelectionCellsHandler.prototype.isHandlerActive=function(t){return null!=t.index},mxSelectionCellsHandler.prototype.updateHandler=function(t){var e,n,i,l=this.handlers.remove(t.cell);null!=l&&(e=l.index,n=l.startX,i=l.startY,l.destroy(),null!=(l=this.graph.createHandler(t))&&(this.handlers.put(t.cell,l),null!=e&&null!=n&&null!=i&&l.start(n,i,e)))},mxSelectionCellsHandler.prototype.mouseDown=function(t,e){var n;this.graph.isEnabled()&&this.isEnabled()&&(n=[t,e],this.handlers.visit(function(t,e){e.mouseDown.apply(e,n)}))},mxSelectionCellsHandler.prototype.mouseMove=function(t,e){var n;this.graph.isEnabled()&&this.isEnabled()&&(n=[t,e],this.handlers.visit(function(t,e){e.mouseMove.apply(e,n)}))},mxSelectionCellsHandler.prototype.mouseUp=function(t,e){var n;this.graph.isEnabled()&&this.isEnabled()&&(n=[t,e],this.handlers.visit(function(t,e){e.mouseUp.apply(e,n)}))},mxSelectionCellsHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.refreshHandler&&(this.graph.getSelectionModel().removeListener(this.refreshHandler),this.graph.getModel().removeListener(this.refreshHandler),this.graph.getView().removeListener(this.refreshHandler),this.refreshHandler=null)},mxUtils.extend(mxConnectionHandler,mxEventSource),mxConnectionHandler.prototype.graph=null,mxConnectionHandler.prototype.factoryMethod=!0,mxConnectionHandler.prototype.moveIconFront=!1,mxConnectionHandler.prototype.moveIconBack=!1,mxConnectionHandler.prototype.connectImage=null,mxConnectionHandler.prototype.targetConnectImage=!1,mxConnectionHandler.prototype.enabled=!0,mxConnectionHandler.prototype.select=!0,mxConnectionHandler.prototype.createTarget=!1,mxConnectionHandler.prototype.marker=null,mxConnectionHandler.prototype.constraintHandler=null,mxConnectionHandler.prototype.error=null,mxConnectionHandler.prototype.waypointsEnabled=!1,mxConnectionHandler.prototype.ignoreMouseDown=!1,mxConnectionHandler.prototype.first=null,mxConnectionHandler.prototype.connectIconOffset=new mxPoint(0,mxConstants.TOOLTIP_VERTICAL_OFFSET),mxConnectionHandler.prototype.edgeState=null,mxConnectionHandler.prototype.changeHandler=null,mxConnectionHandler.prototype.drillHandler=null,mxConnectionHandler.prototype.mouseDownCounter=0,mxConnectionHandler.prototype.movePreviewAway=mxClient.IS_VML,mxConnectionHandler.prototype.outlineConnect=!1,mxConnectionHandler.prototype.livePreview=!1,mxConnectionHandler.prototype.cursor=null,mxConnectionHandler.prototype.insertBeforeSource=!1,mxConnectionHandler.prototype.isEnabled=function(){return this.enabled},mxConnectionHandler.prototype.setEnabled=function(t){this.enabled=t},mxConnectionHandler.prototype.isInsertBefore=function(t,e,n,i,l){return this.insertBeforeSource&&e!=n},mxConnectionHandler.prototype.isCreateTarget=function(t){return this.createTarget},mxConnectionHandler.prototype.setCreateTarget=function(t){this.createTarget=t},mxConnectionHandler.prototype.createShape=function(){var t=this.livePreview&&null!=this.edgeState?this.graph.cellRenderer.createShape(this.edgeState):new mxPolyline([],mxConstants.INVALID_COLOR);return t.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,t.scale=this.graph.view.scale,t.pointerEvents=!1,t.isDashed=!0,t.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(t.node,this.graph,null),t},mxConnectionHandler.prototype.init=function(){this.graph.addMouseListener(this),this.marker=this.createMarker(),this.constraintHandler=new mxConstraintHandler(this.graph),this.changeHandler=mxUtils.bind(this,function(t){null!=this.iconState&&(this.iconState=this.graph.getView().getState(this.iconState.cell)),null!=this.iconState?(this.redrawIcons(this.icons,this.iconState),this.constraintHandler.reset()):null!=this.previous&&null==this.graph.view.getState(this.previous.cell)&&this.reset()}),this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler),this.graph.getView().addListener(mxEvent.SCALE,this.changeHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,this.changeHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.changeHandler),this.drillHandler=mxUtils.bind(this,function(t){this.reset()}),this.graph.addListener(mxEvent.START_EDITING,this.drillHandler),this.graph.getView().addListener(mxEvent.DOWN,this.drillHandler),this.graph.getView().addListener(mxEvent.UP,this.drillHandler)},mxConnectionHandler.prototype.isConnectableCell=function(t){return!0},mxConnectionHandler.prototype.createMarker=function(){var i=new mxCellMarker(this.graph);return i.hotspotEnabled=!0,i.getCell=mxUtils.bind(this,function(t){var e,n=mxCellMarker.prototype.getCell.apply(i,arguments);return(this.error=null)==n&&null!=this.currentPoint&&(n=this.graph.getCellAt(this.currentPoint.x,this.currentPoint.y)),null==n||this.graph.isCellConnectable(n)||(e=this.graph.getModel().getParent(n),this.graph.getModel().isVertex(e)&&this.graph.isCellConnectable(e)&&(n=e)),(this.graph.isSwimlane(n)&&null!=this.currentPoint&&this.graph.hitsSwimlaneContent(n,this.currentPoint.x,this.currentPoint.y)||!this.isConnectableCell(n))&&(n=null),null!=n?this.isConnecting()?null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,n),null!=this.error&&0==this.error.length&&(n=null,this.isCreateTarget(t.getEvent())&&(this.error=null))):this.isValidSource(n,t)||(n=null):!this.isConnecting()||this.isCreateTarget(t.getEvent())||this.graph.allowDanglingEdges||(this.error=""),n}),i.isValidState=mxUtils.bind(this,function(t){return this.isConnecting()?null==this.error:mxCellMarker.prototype.isValidState.apply(i,arguments)}),i.getMarkerColor=mxUtils.bind(this,function(t,e,n){return null==this.connectImage||this.isConnecting()?mxCellMarker.prototype.getMarkerColor.apply(i,arguments):null}),i.intersects=mxUtils.bind(this,function(t,e){return!(null==this.connectImage&&!this.isConnecting())||mxCellMarker.prototype.intersects.apply(i,arguments)}),i},mxConnectionHandler.prototype.start=function(t,e,n,i){this.previous=t,this.first=new mxPoint(e,n),this.edgeState=null!=i?i:this.createEdgeState(null),this.marker.currentColor=this.marker.validColor,this.marker.markedState=t,this.marker.mark(),this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous))},mxConnectionHandler.prototype.isConnecting=function(){return null!=this.first&&null!=this.shape},mxConnectionHandler.prototype.isValidSource=function(t,e){return this.graph.isValidSource(t)},mxConnectionHandler.prototype.isValidTarget=function(t){return!0},mxConnectionHandler.prototype.validateConnection=function(t,e){return this.isValidTarget(e)?this.graph.getEdgeValidationError(null,t,e):""},mxConnectionHandler.prototype.getConnectImage=function(t){return this.connectImage},mxConnectionHandler.prototype.isMoveIconToFrontForState=function(t){return null!=t.text&&t.text.node.parentNode==this.graph.container||this.moveIconFront},mxConnectionHandler.prototype.createIcons=function(t){var e=this.getConnectImage(t);if(null==e||null==t)return null;this.iconState=t;var n=[],i=new mxImageShape(new mxRectangle(0,0,e.width,e.height),e.src,null,null,0);i.preserveImageAspect=!1,this.isMoveIconToFrontForState(t)?(i.dialect=mxConstants.DIALECT_STRICTHTML,i.init(this.graph.container)):(i.dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,i.init(this.graph.getView().getOverlayPane()),this.moveIconBack&&null!=i.node.previousSibling&&i.node.parentNode.insertBefore(i.node,i.node.parentNode.firstChild)),i.node.style.cursor=mxConstants.CURSOR_CONNECT;var l=mxUtils.bind(this,function(){return null!=this.currentState?this.currentState:t}),e=mxUtils.bind(this,function(t){mxEvent.isConsumed(t)||(this.icon=i,this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,l())))});return mxEvent.redirectMouseEvents(i.node,this.graph,l,e),n.push(i),this.redrawIcons(n,this.iconState),n},mxConnectionHandler.prototype.redrawIcons=function(t,e){null!=t&&null!=t[0]&&null!=e&&(e=this.getIconPosition(t[0],e),t[0].bounds.x=e.x,t[0].bounds.y=e.y,t[0].redraw())},mxConnectionHandler.prototype.getIconPosition=function(t,e){var n,i=this.graph.getView().scale,l=e.getCenterX(),s=e.getCenterY();return this.graph.isSwimlane(e.cell)&&(l=0!=(n=this.graph.getStartSize(e.cell)).width?e.x+n.width*i/2:l,s=0!=n.height?e.y+n.height*i/2:s,0!=(n=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0))&&(i=Math.cos(n),n=Math.sin(n),e=new mxPoint(e.getCenterX(),e.getCenterY()),l=(e=mxUtils.getRotatedPoint(new mxPoint(l,s),i,n,e)).x,s=e.y)),new mxPoint(l-t.bounds.width/2,s-t.bounds.height/2)},mxConnectionHandler.prototype.destroyIcons=function(){if(null!=this.icons){for(var t=0;t<this.icons.length;t++)this.icons[t].destroy();this.icons=null,this.icon=null,this.selectedIcon=null,this.iconState=null}},mxConnectionHandler.prototype.isStartEvent=function(t){return null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint||null!=this.previous&&null==this.error&&(null==this.icons||null!=this.icons&&null!=this.icon)},mxConnectionHandler.prototype.mouseDown=function(t,e){var n;this.mouseDownCounter++,this.isEnabled()&&this.graph.isEnabled()&&!e.isConsumed()&&!this.isConnecting()&&this.isStartEvent(e)&&(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(this.sourceConstraint=this.constraintHandler.currentConstraint,this.previous=this.constraintHandler.currentFocus,this.first=this.constraintHandler.currentPoint.clone()):this.first=new mxPoint(e.getGraphX(),e.getGraphY()),this.edgeState=this.createEdgeState(e),this.mouseDownCounter=1,this.waypointsEnabled&&null==this.shape&&(this.waypoints=null,this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState)),null==this.previous&&null!=this.edgeState&&(n=this.graph.getPointForEvent(e.getEvent()),this.edgeState.cell.geometry.setTerminalPoint(n,!0)),this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)),e.consume()),this.selectedIcon=this.icon,this.icon=null},mxConnectionHandler.prototype.isImmediateConnectSource=function(t){return!this.graph.isCellMovable(t.cell)},mxConnectionHandler.prototype.createEdgeState=function(t){return null},mxConnectionHandler.prototype.isOutlineConnectEvent=function(t){var e=mxUtils.getOffset(this.graph.container),n=t.getEvent(),i=mxEvent.getClientX(n),l=mxEvent.getClientY(n),s=document.documentElement,n=(window.pageXOffset||s.scrollLeft)-(s.clientLeft||0),s=(window.pageYOffset||s.scrollTop)-(s.clientTop||0),n=this.currentPoint.x-this.graph.container.scrollLeft+e.x-n,s=this.currentPoint.y-this.graph.container.scrollTop+e.y-s;return this.outlineConnect&&!mxEvent.isShiftDown(t.getEvent())&&(t.isSource(this.marker.highlight.shape)||mxEvent.isAltDown(t.getEvent())&&null!=t.getState()||this.marker.highlight.isHighlightAt(i,l)||(n!=i||s!=l)&&null==t.getState()&&this.marker.highlight.isHighlightAt(n,s))},mxConnectionHandler.prototype.updateCurrentState=function(t,e){var n;this.constraintHandler.update(t,null==this.first,!1,null==this.first||t.isSource(this.marker.highlight.shape)?null:e),null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint?(null!=this.marker.highlight&&null!=this.marker.highlight.state&&this.marker.highlight.state.cell==this.constraintHandler.currentFocus.cell?"transparent"!=this.marker.highlight.shape.stroke&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint()):this.marker.markCell(this.constraintHandler.currentFocus.cell,"transparent"),null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,this.constraintHandler.currentFocus.cell),null==this.error&&(this.currentState=this.constraintHandler.currentFocus),null==this.error&&(null==this.currentState||this.isCellEnabled(this.currentState.cell))||this.constraintHandler.reset())):(this.graph.isIgnoreTerminalEvent(t.getEvent())?(this.marker.reset(),this.currentState=null):(this.marker.process(t),this.currentState=this.marker.getValidState()),null==this.currentState||this.isCellEnabled(this.currentState.cell)||(this.constraintHandler.reset(),this.marker.reset(),this.currentState=null),n=this.isOutlineConnectEvent(t),null!=this.currentState&&n&&(t.isSource(this.marker.highlight.shape)&&(e=new mxPoint(t.getGraphX(),t.getGraphY())),n=this.graph.getOutlineConstraint(e,this.currentState,t),this.constraintHandler.setFocus(t,this.currentState,!1),this.constraintHandler.currentConstraint=n,this.constraintHandler.currentPoint=e),this.outlineConnect&&null!=this.marker.highlight&&null!=this.marker.highlight.shape&&(e=this.graph.view.scale,null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(this.marker.highlight.shape.stroke=mxConstants.OUTLINE_HIGHLIGHT_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/e/e,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.graph.isCellConnectable(t.getCell())&&this.marker.getValidState()!=t.getState()?(this.marker.highlight.shape.stroke="transparent",this.currentState=null):this.marker.highlight.shape.stroke=mxConstants.DEFAULT_VALID_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/e/e,this.marker.highlight.repaint())))},mxConnectionHandler.prototype.isCellEnabled=function(t){return!0},mxConnectionHandler.prototype.convertWaypoint=function(t){var e=this.graph.getView().getScale(),n=this.graph.getView().getTranslate();t.x=t.x/e-n.x,t.y=t.y/e-n.y},mxConnectionHandler.prototype.snapToPreview=function(t,e){var n,i;mxEvent.isAltDown(t.getEvent())||null==this.previous||(n=this.graph.gridSize*this.graph.view.scale/2,i=null!=this.sourceConstraint?this.first:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY()),Math.abs(i.x-t.getGraphX())<n&&(e.x=i.x),Math.abs(i.y-t.getGraphY())<n&&(e.y=i.y))},mxConnectionHandler.prototype.mouseMove=function(t,e){if(e.isConsumed()||!this.ignoreMouseDown&&null==this.first&&this.graph.isMouseDown)this.constraintHandler.reset();else{this.isEnabled()||null==this.currentState||(this.destroyIcons(),this.currentState=null);var n=this.graph.getView(),i=n.scale,l=n.translate,s=new mxPoint(e.getGraphX(),e.getGraphY());if(this.error=null,this.graph.isGridEnabledEvent(e.getEvent())&&(s=new mxPoint((this.graph.snap(s.x/i-l.x)+l.x)*i,(this.graph.snap(s.y/i-l.y)+l.y)*i)),this.snapToPreview(e,s),this.currentPoint=s,(null!=this.first||this.isEnabled()&&this.graph.isEnabled())&&(null!=this.shape||null==this.first||Math.abs(e.getGraphX()-this.first.x)>this.graph.tolerance||Math.abs(e.getGraphY()-this.first.y)>this.graph.tolerance)&&this.updateCurrentState(e,s),null!=this.first){var o=null,r=s;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(o=this.constraintHandler.currentConstraint,r=this.constraintHandler.currentPoint.clone()):null!=this.previous&&!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&(Math.abs(this.previous.getCenterX()-s.x)<Math.abs(this.previous.getCenterY()-s.y)?s.x=this.previous.getCenterX():s.y=this.previous.getCenterY());var a=this.first;if(null!=this.selectedIcon&&(n=this.selectedIcon.bounds.width,l=this.selectedIcon.bounds.height,null!=this.currentState&&this.targetConnectImage?(i=this.getIconPosition(this.selectedIcon,this.currentState),this.selectedIcon.bounds.x=i.x,this.selectedIcon.bounds.y=i.y):(l=new mxRectangle(e.getGraphX()+this.connectIconOffset.x,e.getGraphY()+this.connectIconOffset.y,n,l),this.selectedIcon.bounds=l),this.selectedIcon.redraw()),null!=this.edgeState?(this.updateEdgeState(r,o),r=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1],a=this.edgeState.absolutePoints[0]):(null!=this.currentState&&null==this.constraintHandler.currentConstraint&&null!=(h=this.getTargetPerimeterPoint(this.currentState,e))&&(r=h),null==this.sourceConstraint&&null!=this.previous&&(o=null!=this.waypoints&&0<this.waypoints.length?this.waypoints[0]:r,null!=(h=this.getSourcePerimeterPoint(this.previous,o,e))&&(a=h))),null==this.currentState&&this.movePreviewAway){var h=a;null!=this.edgeState&&2<=this.edgeState.absolutePoints.length&&(null!=(u=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2])&&(h=u));var d=r.x-h.x,u=r.y-h.y,h=Math.sqrt(d*d+u*u);if(0==h)return;this.originalPoint=r.clone(),r.x-=4*d/h,r.y-=4*u/h}else this.originalPoint=null;null==this.shape&&(d=Math.abs(e.getGraphX()-this.first.x),u=Math.abs(e.getGraphY()-this.first.y),(d>this.graph.tolerance||u>this.graph.tolerance)&&(this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState),this.updateCurrentState(e,s))),null!=this.shape&&(null!=this.edgeState?this.shape.points=this.edgeState.absolutePoints:(a=[a],null!=this.waypoints&&(a=a.concat(this.waypoints)),a.push(r),this.shape.points=a),this.drawPreview()),null!=this.cursor&&(this.graph.container.style.cursor=this.cursor),mxEvent.consume(e.getEvent()),e.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(),null!=this.currentState&&null==this.error&&null==this.constraintHandler.currentConstraint&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),e.consume())),this.previous=this.currentState):this.previous!=this.currentState||null==this.currentState||null!=this.icons||this.graph.isMouseDown||e.consume():this.constraintHandler.reset();if(!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){for(var p=!1,m=e.getSource(),c=0;c<this.icons.length&&!p;c++)p=m==this.icons[c].node||m.parentNode==this.icons[c].node;p||this.updateIcons(this.currentState,this.icons,e)}}},mxConnectionHandler.prototype.updateEdgeState=function(t,e){null!=this.sourceConstraint&&null!=this.sourceConstraint.point&&(this.edgeState.style[mxConstants.STYLE_EXIT_X]=this.sourceConstraint.point.x,this.edgeState.style[mxConstants.STYLE_EXIT_Y]=this.sourceConstraint.point.y),null!=e&&null!=e.point?(this.edgeState.style[mxConstants.STYLE_ENTRY_X]=e.point.x,this.edgeState.style[mxConstants.STYLE_ENTRY_Y]=e.point.y):(delete this.edgeState.style[mxConstants.STYLE_ENTRY_X],delete this.edgeState.style[mxConstants.STYLE_ENTRY_Y]),this.edgeState.absolutePoints=[null,null!=this.currentState?null:t],this.graph.view.updateFixedTerminalPoint(this.edgeState,this.previous,!0,this.sourceConstraint),null!=this.currentState&&(null==e&&(e=this.graph.getConnectionConstraint(this.edgeState,this.previous,!1)),this.edgeState.setAbsoluteTerminalPoint(null,!1),this.graph.view.updateFixedTerminalPoint(this.edgeState,this.currentState,!1,e));var n=null;if(null!=this.waypoints){n=[];for(var i=0;i<this.waypoints.length;i++){var l=this.waypoints[i].clone();this.convertWaypoint(l),n[i]=l}}this.graph.view.updatePoints(this.edgeState,n,this.previous,this.currentState),this.graph.view.updateFloatingTerminalPoints(this.edgeState,this.previous,this.currentState)},mxConnectionHandler.prototype.getTargetPerimeterPoint=function(t,e){var n,i=null,l=t.view,s=l.getPerimeterFunction(t);return null!=s?(n=null!=this.waypoints&&0<this.waypoints.length?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY()),null!=(n=s(l.getPerimeterBounds(t),this.edgeState,n,!1))&&(i=n)):i=new mxPoint(t.getCenterX(),t.getCenterY()),i},mxConnectionHandler.prototype.getSourcePerimeterPoint=function(t,e,n){var i,l,s=null,o=t.view,r=o.getPerimeterFunction(t),a=new mxPoint(t.getCenterX(),t.getCenterY());return null!=r?(l=-(i=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0))*(Math.PI/180),0!=i&&(e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(l),Math.sin(l),a)),null!=(e=r(o.getPerimeterBounds(t),t,e,!1))&&(0!=i&&(e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(-l),Math.sin(-l),a)),s=e)):s=a,s},mxConnectionHandler.prototype.updateIcons=function(t,e,n){},mxConnectionHandler.prototype.isStopEvent=function(t){return null!=t.getState()},mxConnectionHandler.prototype.addWaypointForEvent=function(t){var e=mxUtils.convertPoint(this.graph.container,t.getX(),t.getY()),n=Math.abs(e.x-this.first.x),i=Math.abs(e.y-this.first.y);(null!=this.waypoints||1<this.mouseDownCounter&&(n>this.graph.tolerance||i>this.graph.tolerance))&&(null==this.waypoints&&(this.waypoints=[]),i=this.graph.view.scale,e=new mxPoint(this.graph.snap(t.getGraphX()/i)*i,this.graph.snap(t.getGraphY()/i)*i),this.waypoints.push(e))},mxConnectionHandler.prototype.checkConstraints=function(t,e){return null==t||null==e||null==t.point||null==e.point||!t.point.equals(e.point)||t.dx!=e.dx||t.dy!=e.dy||t.perimeter!=e.perimeter},mxConnectionHandler.prototype.mouseUp=function(t,e){if(!e.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(e))return this.addWaypointForEvent(e),void e.consume();var n=this.sourceConstraint,i=this.constraintHandler.currentConstraint,l=null!=this.previous?this.previous.cell:null,s=null;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(s=this.constraintHandler.currentFocus.cell),null==s&&null!=this.currentState&&(s=this.currentState.cell),null!=this.error||null!=l&&null!=s&&l==s&&!this.checkConstraints(n,i)?(null!=this.previous&&null!=this.marker.validState&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,e.getEvent()),null!=this.error&&0<this.error.length&&this.graph.validationAlert(this.error)):this.connect(l,s,e.getEvent(),e.getCell()),this.destroyIcons(),e.consume()}null!=this.first&&this.reset()},mxConnectionHandler.prototype.reset=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.cursor&&null!=this.graph.container&&(this.graph.container.style.cursor=""),this.destroyIcons(),this.marker.reset(),this.constraintHandler.reset(),this.originalPoint=null,this.currentPoint=null,this.edgeState=null,this.previous=null,this.error=null,this.sourceConstraint=null,this.mouseDownCounter=0,this.first=null,this.fireEvent(new mxEventObject(mxEvent.RESET))},mxConnectionHandler.prototype.drawPreview=function(){this.updatePreview(null==this.error),this.shape.redraw()},mxConnectionHandler.prototype.updatePreview=function(t){this.shape.strokewidth=this.getEdgeWidth(t),this.shape.stroke=this.getEdgeColor(t)},mxConnectionHandler.prototype.getEdgeColor=function(t){return t?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR},mxConnectionHandler.prototype.getEdgeWidth=function(t){return t?3:1},mxConnectionHandler.prototype.connect=function(t,e,n,i){if(null!=e||this.isCreateTarget(n)||this.graph.allowDanglingEdges){var l=this.graph.getModel(),s=!1,o=null;l.beginUpdate();try{null!=t&&null==e&&!this.graph.isIgnoreTerminalEvent(n)&&this.isCreateTarget(n)&&null!=(e=this.createTargetVertex(n,t))&&(i=this.graph.getDropTarget([e],n,i),s=!0,null!=i&&this.graph.getModel().isEdge(i)?i=this.graph.getDefaultParent():null!=(h=this.graph.getView().getState(i))&&((d=l.getGeometry(e)).x-=h.origin.x,d.y-=h.origin.y),this.graph.addCell(e,i));var r=this.graph.getDefaultParent();null!=t&&null!=e&&l.getParent(t)==l.getParent(e)&&l.getParent(l.getParent(t))!=l.getRoot()&&(r=l.getParent(t),null!=t.geometry&&t.geometry.relative&&null!=e.geometry&&e.geometry.relative&&(r=l.getParent(r)));var a=null,h=null;if(null!=this.edgeState&&(a=this.edgeState.cell.value,h=this.edgeState.cell.style),null!=(o=this.insertEdge(r,null,a,t,e,h))){this.graph.setConnectionConstraint(o,t,!0,this.sourceConstraint),this.graph.setConnectionConstraint(o,e,!1,this.constraintHandler.currentConstraint),null!=this.edgeState&&l.setGeometry(o,this.edgeState.cell.geometry);r=l.getParent(t);if(this.isInsertBefore(o,t,e,n,i)){for(var d=t;null!=d.parent&&null!=d.geometry&&d.geometry.relative&&d.parent!=o.parent;)d=this.graph.model.getParent(d);null!=d&&null!=d.parent&&d.parent==o.parent&&l.add(r,o,d.parent.getIndex(d))}var u=l.getGeometry(o);if(null==u&&((u=new mxGeometry).relative=!0,l.setGeometry(o,u)),null!=this.waypoints&&0<this.waypoints.length){var p=this.graph.view.scale,m=this.graph.view.translate;u.points=[];for(var c=0;c<this.waypoints.length;c++){var g=this.waypoints[c];u.points.push(new mxPoint(g.x/p-m.x,g.y/p-m.y))}}null==e&&(r=this.graph.view.translate,p=this.graph.view.scale,(g=null!=this.originalPoint?new mxPoint(this.originalPoint.x/p-r.x,this.originalPoint.y/p-r.y):new mxPoint(this.currentPoint.x/p-r.x,this.currentPoint.y/p-r.y)).x-=this.graph.panDx/this.graph.view.scale,g.y-=this.graph.panDy/this.graph.view.scale,u.setTerminalPoint(g,!1)),this.fireEvent(new mxEventObject(mxEvent.CONNECT,"cell",o,"terminal",e,"event",n,"target",i,"terminalInserted",s))}}catch(t){mxLog.show(),mxLog.debug(t.message)}finally{l.endUpdate()}this.select&&this.selectCells(o,s?e:null)}},mxConnectionHandler.prototype.selectCells=function(t,e){this.graph.setSelectionCell(t)},mxConnectionHandler.prototype.insertEdge=function(t,e,n,i,l,s){if(null==this.factoryMethod)return this.graph.insertEdge(t,e,n,i,l,s);s=this.createEdge(n,i,l,s);return s=this.graph.addEdge(s,t,i,l)},mxConnectionHandler.prototype.createTargetVertex=function(t,e){for(var n=this.graph.getCellGeometry(e);null!=n&&n.relative;)e=this.graph.getModel().getParent(e),n=this.graph.getCellGeometry(e);var i,l,s,o,r,a=this.graph.cloneCell(e);return null!=(n=this.graph.getModel().getGeometry(a))&&(r=this.graph.view.translate,i=this.graph.view.scale,o=new mxPoint(this.currentPoint.x/i-r.x,this.currentPoint.y/i-r.y),n.x=Math.round(o.x-n.width/2-this.graph.panDx/i),n.y=Math.round(o.y-n.height/2-this.graph.panDy/i),0<(l=this.getAlignmentTolerance())&&(null!=(s=this.graph.view.getState(e))&&(o=s.x/i-r.x,r=s.y/i-r.y,Math.abs(o-n.x)<=l&&(n.x=Math.round(o)),Math.abs(r-n.y)<=l&&(n.y=Math.round(r))))),a},mxConnectionHandler.prototype.getAlignmentTolerance=function(t){return this.graph.isGridEnabled()?this.graph.gridSize/2:this.graph.tolerance},mxConnectionHandler.prototype.createEdge=function(t,e,n,i){var l=null;return null!=this.factoryMethod&&(l=this.factoryMethod(e,n,i)),null==l&&((l=new mxCell(t||"")).setEdge(!0),l.setStyle(i),(i=new mxGeometry).relative=!0,l.setGeometry(i)),l},mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null),null!=this.drillHandler&&(this.graph.removeListener(this.drillHandler),this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null),null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null)},mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5),mxConstraintHandler.prototype.graph=null,mxConstraintHandler.prototype.enabled=!0,mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR,mxConstraintHandler.prototype.isEnabled=function(){return this.enabled},mxConstraintHandler.prototype.setEnabled=function(t){this.enabled=t},mxConstraintHandler.prototype.reset=function(){if(null!=this.focusIcons){for(var t=0;t<this.focusIcons.length;t++)this.focusIcons[t].destroy();this.focusIcons=null}null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null),this.currentConstraint=null,this.currentFocusArea=null,this.currentPoint=null,this.currentFocus=null,this.focusPoints=null},mxConstraintHandler.prototype.getTolerance=function(t){return this.graph.getTolerance()},mxConstraintHandler.prototype.getImageForConstraint=function(t,e,n){return this.pointImage},mxConstraintHandler.prototype.isEventIgnored=function(t,e){return!1},mxConstraintHandler.prototype.isStateIgnored=function(t,e){return!1},mxConstraintHandler.prototype.destroyIcons=function(){if(null!=this.focusIcons){for(var t=0;t<this.focusIcons.length;t++)this.focusIcons[t].destroy();this.focusIcons=null,this.focusPoints=null}},mxConstraintHandler.prototype.destroyFocusHighlight=function(){null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null)},mxConstraintHandler.prototype.isKeepFocusEvent=function(t){return mxEvent.isShiftDown(t.getEvent())},mxConstraintHandler.prototype.getCellForEvent=function(t,e){var n=t.getCell();return null!=n||null==e||t.getGraphX()==e.x&&t.getGraphY()==e.y||(n=this.graph.getCellAt(e.x,e.y)),null==n||this.graph.isCellConnectable(n)||(e=this.graph.getModel().getParent(n),this.graph.getModel().isVertex(e)&&this.graph.isCellConnectable(e)&&(n=e)),this.graph.isCellLocked(n)?null:n},mxConstraintHandler.prototype.update=function(t,e,n,i){if(this.isEnabled()&&!this.isEventIgnored(t)){null==this.mouseleaveHandler&&null!=this.graph.container&&(this.mouseleaveHandler=mxUtils.bind(this,function(){this.reset()}),mxEvent.addListener(this.graph.container,"mouseleave",this.resetHandler));var l=this.getTolerance(t),s=new mxRectangle((null!=i?i.x:t.getGraphX())-l,(null!=i?i.y:t.getGraphY())-l,2*l,2*l),o=new mxRectangle(t.getGraphX()-l,t.getGraphY()-l,2*l,2*l),r=this.graph.view.getState(this.getCellForEvent(t,i));this.isKeepFocusEvent(t)||null!=this.currentFocusArea&&null!=this.currentFocus&&null==r&&this.graph.getModel().isVertex(this.currentFocus.cell)&&mxUtils.intersects(this.currentFocusArea,o)||r==this.currentFocus||(this.currentFocusArea=null,this.currentFocus=null,this.setFocus(t,r,e)),this.currentConstraint=null;var a=this.currentPoint=null;if(null!=this.focusIcons&&null!=this.constraints&&(null==r||this.currentFocus==r))for(var h=o.getCenterX(),d=o.getCenterY(),u=0;u<this.focusIcons.length;u++){var p=h-this.focusIcons[u].bounds.getCenterX(),m=d-this.focusIcons[u].bounds.getCenterY(),c=p*p+m*m;(this.intersects(this.focusIcons[u],o,e,n)||null!=i&&this.intersects(this.focusIcons[u],s,e,n))&&(null==a||c<a)&&(this.currentConstraint=this.constraints[u],this.currentPoint=this.focusPoints[u],a=c,(c=this.focusIcons[u].bounds.clone()).grow(mxConstants.HIGHLIGHT_SIZE+1),--c.width,--c.height,null==this.focusHighlight&&((p=this.createHighlightShape()).dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,p.pointerEvents=!1,p.init(this.graph.getView().getOverlayPane()),this.focusHighlight=p,m=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:r}),mxEvent.redirectMouseEvents(p.node,this.graph,m)),this.focusHighlight.bounds=c,this.focusHighlight.redraw())}null==this.currentConstraint&&this.destroyFocusHighlight()}else this.currentConstraint=null,this.currentFocus=null,this.currentPoint=null},mxConstraintHandler.prototype.redraw=function(){if(null!=this.currentFocus&&null!=this.constraints&&null!=this.focusIcons){var t=this.graph.view.getState(this.currentFocus.cell);this.currentFocus=t,this.currentFocusArea=new mxRectangle(t.x,t.y,t.width,t.height);for(var e=0;e<this.constraints.length;e++){var n=this.graph.getConnectionPoint(t,this.constraints[e]),i=this.getImageForConstraint(t,this.constraints[e],n),i=new mxRectangle(Math.round(n.x-i.width/2),Math.round(n.y-i.height/2),i.width,i.height);this.focusIcons[e].bounds=i,this.focusIcons[e].redraw(),this.currentFocusArea.add(this.focusIcons[e].bounds),this.focusPoints[e]=n}}},mxConstraintHandler.prototype.setFocus=function(t,e,n){if(this.constraints=null!=e&&!this.isStateIgnored(e,n)&&this.graph.isCellConnectable(e.cell)?this.isEnabled()&&this.graph.getAllConnectionConstraints(e,n)||[]:null,null!=this.constraints){if(this.currentFocus=e,this.currentFocusArea=new mxRectangle(e.x,e.y,e.width,e.height),null!=this.focusIcons){for(var i=0;i<this.focusIcons.length;i++)this.focusIcons[i].destroy();this.focusIcons=null,this.focusPoints=null}this.focusPoints=[],this.focusIcons=[];for(i=0;i<this.constraints.length;i++){var l=this.graph.getConnectionPoint(e,this.constraints[i]),s=this.getImageForConstraint(e,this.constraints[i],l),o=s.src,s=new mxImageShape(new mxRectangle(Math.round(l.x-s.width/2),Math.round(l.y-s.height/2),s.width,s.height),o);s.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,s.preserveImageAspect=!1,s.init(this.graph.getView().getDecoratorPane()),!mxClient.IS_QUIRKS&&8!=document.documentMode||mxEvent.addListener(s.node,"dragstart",function(t){return mxEvent.consume(t),!1}),null!=s.node.previousSibling&&s.node.parentNode.insertBefore(s.node,s.node.parentNode.firstChild);o=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:e});s.redraw(),mxEvent.redirectMouseEvents(s.node,this.graph,o),this.currentFocusArea.add(s.bounds),this.focusIcons.push(s),this.focusPoints.push(l)}this.currentFocusArea.grow(this.getTolerance(t))}else this.destroyIcons(),this.destroyFocusHighlight()},mxConstraintHandler.prototype.createHighlightShape=function(){var t=new mxRectangleShape(null,this.highlightColor,this.highlightColor,mxConstants.HIGHLIGHT_STROKEWIDTH);return t.opacity=mxConstants.HIGHLIGHT_OPACITY,t},mxConstraintHandler.prototype.intersects=function(t,e,n,i){return mxUtils.intersects(t.bounds,e)},mxConstraintHandler.prototype.destroy=function(){this.reset(),null!=this.resetHandler&&(this.graph.model.removeListener(this.resetHandler),this.graph.view.removeListener(this.resetHandler),this.graph.removeListener(this.resetHandler),this.resetHandler=null),null!=this.mouseleaveHandler&&null!=this.graph.container&&(mxEvent.removeListener(this.graph.container,"mouseleave",this.mouseleaveHandler),this.mouseleaveHandler=null)},mxRubberband.prototype.defaultOpacity=20,mxRubberband.prototype.enabled=!0,mxRubberband.prototype.div=null,mxRubberband.prototype.sharedDiv=null,mxRubberband.prototype.currentX=0,mxRubberband.prototype.currentY=0,mxRubberband.prototype.fadeOut=!1,mxRubberband.prototype.isEnabled=function(){return this.enabled},mxRubberband.prototype.setEnabled=function(t){this.enabled=t},mxRubberband.prototype.isForceRubberbandEvent=function(t){return mxEvent.isAltDown(t.getEvent())},mxRubberband.prototype.mouseDown=function(t,e){var n,i;!e.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&null==e.getState()&&!mxEvent.isMultiTouchEvent(e.getEvent())&&(n=mxUtils.getOffset(this.graph.container),(i=mxUtils.getScrollOrigin(this.graph.container)).x-=n.x,i.y-=n.y,this.start(e.getX()+i.x,e.getY()+i.y),e.consume(!1))},mxRubberband.prototype.start=function(t,e){this.first=new mxPoint(t,e);var n=this.graph.container;function i(t){var e=new mxMouseEvent(t),t=mxUtils.convertPoint(n,e.getX(),e.getY());return e.graphX=t.x,e.graphY=t.y,e}this.dragHandler=mxUtils.bind(this,function(t){this.mouseMove(this.graph,i(t))}),this.dropHandler=mxUtils.bind(this,function(t){this.mouseUp(this.graph,i(t))}),mxClient.IS_FF&&mxEvent.addGestureListeners(document,null,this.dragHandler,this.dropHandler)},mxRubberband.prototype.mouseMove=function(t,e){var n,i,l,s,o;e.isConsumed()||null==this.first||(o=mxUtils.getScrollOrigin(this.graph.container),s=mxUtils.getOffset(this.graph.container),o.x-=s.x,o.y-=s.y,n=e.getX()+o.x,i=e.getY()+o.y,l=this.first.x-n,s=this.first.y-i,o=this.graph.tolerance,(null!=this.div||Math.abs(l)>o||Math.abs(s)>o)&&(null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(n,i),e.consume()))},mxRubberband.prototype.createShape=function(){null==this.sharedDiv&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity)),this.graph.container.appendChild(this.sharedDiv);var t=this.sharedDiv;return mxClient.IS_SVG&&(!mxClient.IS_IE||10<=document.documentMode)&&this.fadeOut&&(this.sharedDiv=null),t},mxRubberband.prototype.isActive=function(t,e){return null!=this.div&&"none"!=this.div.style.display},mxRubberband.prototype.mouseUp=function(t,e){var n=this.isActive();this.reset(),n&&(this.execute(e.getEvent()),e.consume())},mxRubberband.prototype.execute=function(t){var e=new mxRectangle(this.x,this.y,this.width,this.height);this.graph.selectRegion(e,t)},mxRubberband.prototype.reset=function(){var t;null!=this.div&&(mxClient.IS_SVG&&(!mxClient.IS_IE||10<=document.documentMode)&&this.fadeOut?(t=this.div,mxUtils.setPrefixedStyle(t.style,"transition","all 0.2s linear"),t.style.pointerEvents="none",t.style.opacity=0,window.setTimeout(function(){t.parentNode.removeChild(t)},200)):this.div.parentNode.removeChild(this.div)),mxEvent.removeGestureListeners(document,null,this.dragHandler,this.dropHandler),this.dragHandler=null,this.dropHandler=null,this.currentX=0,this.currentY=0,this.first=null,this.div=null},mxRubberband.prototype.update=function(t,e){this.currentX=t,this.currentY=e,this.repaint()},mxRubberband.prototype.repaint=function(){var t,e;null!=this.div&&(t=this.currentX-this.graph.panDx,e=this.currentY-this.graph.panDy,this.x=Math.min(this.first.x,t),this.y=Math.min(this.first.y,e),this.width=Math.max(this.first.x,t)-this.x,this.height=Math.max(this.first.y,e)-this.y,t=mxClient.IS_VML?this.graph.panDx:0,e=mxClient.IS_VML?this.graph.panDy:0,this.div.style.left=this.x+t+"px",this.div.style.top=this.y+e+"px",this.div.style.width=Math.max(1,this.width)+"px",this.div.style.height=Math.max(1,this.height)+"px")},mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.forceRubberbandHandler),this.graph.removeListener(this.panHandler),this.reset(),null!=this.sharedDiv&&(this.sharedDiv=null))},mxHandle.prototype.cursor="default",mxHandle.prototype.image=null,mxHandle.prototype.ignoreGrid=!1,mxHandle.prototype.getPosition=function(t){},mxHandle.prototype.setPosition=function(t,e,n){},mxHandle.prototype.execute=function(t){},mxHandle.prototype.copyStyle=function(t){this.graph.setCellStyles(t,this.state.style[t],[this.state.cell])},mxHandle.prototype.processEvent=function(t){var e=this.graph.view.scale,n=this.graph.view.translate,i=new mxPoint(t.getGraphX()/e-n.x,t.getGraphY()/e-n.y);null!=this.shape&&null!=this.shape.bounds&&(i.x-=this.shape.bounds.width/e/4,i.y-=this.shape.bounds.height/e/4);n=-mxUtils.toRadians(this.getRotation()),e=-mxUtils.toRadians(this.getTotalRotation())-n,i=this.flipPoint(this.rotatePoint(this.snapPoint(this.rotatePoint(i,n),this.ignoreGrid||!this.graph.isGridEnabledEvent(t.getEvent())),e));this.setPosition(this.state.getPaintBounds(),i,t),this.redraw()},mxHandle.prototype.positionChanged=function(){null!=this.state.text&&this.state.text.apply(this.state),null!=this.state.shape&&this.state.shape.apply(this.state),this.graph.cellRenderer.redraw(this.state,!0)},mxHandle.prototype.getRotation=function(){return null!=this.state.shape?this.state.shape.getRotation():0},mxHandle.prototype.getTotalRotation=function(){return null!=this.state.shape?this.state.shape.getShapeRotation():0},mxHandle.prototype.init=function(){var t=this.isHtmlRequired();null!=this.image?(this.shape=new mxImageShape(new mxRectangle(0,0,this.image.width,this.image.height),this.image.src),this.shape.preserveImageAspect=!1):null==this.shape&&(this.shape=this.createShape(t)),this.initShape(t)},mxHandle.prototype.createShape=function(t){return new mxRectangleShape(new mxRectangle(0,0,mxConstants.HANDLE_SIZE,mxConstants.HANDLE_SIZE),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxHandle.prototype.initShape=function(t){t&&this.shape.isHtmlAllowed()?(this.shape.dialect=mxConstants.DIALECT_STRICTHTML,this.shape.init(this.graph.container)):(this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,null!=this.cursor&&this.shape.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(this.shape.node,this.graph,this.state),this.shape.node.style.cursor=this.cursor},mxHandle.prototype.redraw=function(){var t,e,n;null==this.shape||null==this.state.shape||null!=(t=this.getPosition(this.state.getPaintBounds()))&&(n=mxUtils.toRadians(this.getTotalRotation()),t=this.rotatePoint(this.flipPoint(t),n),e=this.graph.view.scale,n=this.graph.view.translate,this.shape.bounds.x=Math.floor((t.x+n.x)*e-this.shape.bounds.width/2),this.shape.bounds.y=Math.floor((t.y+n.y)*e-this.shape.bounds.height/2),this.shape.redraw())},mxHandle.prototype.isHtmlRequired=function(){return null!=this.state.text&&this.state.text.node.parentNode==this.graph.container},mxHandle.prototype.rotatePoint=function(t,e){var n=this.state.getCellBounds(),i=new mxPoint(n.getCenterX(),n.getCenterY()),n=Math.cos(e),e=Math.sin(e);return mxUtils.getRotatedPoint(t,n,e,i)},mxHandle.prototype.flipPoint=function(t){var e;return null!=this.state.shape&&(e=this.state.getCellBounds(),this.state.shape.flipH&&(t.x=2*e.x+e.width-t.x),this.state.shape.flipV&&(t.y=2*e.y+e.height-t.y)),t},mxHandle.prototype.snapPoint=function(t,e){return e||(t.x=this.graph.snap(t.x),t.y=this.graph.snap(t.y)),t},mxHandle.prototype.setVisible=function(t){null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display=t?"":"none")},mxHandle.prototype.reset=function(){this.setVisible(!0),this.state.style=this.graph.getCellStyle(this.state.cell),this.positionChanged()},mxHandle.prototype.destroy=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null)},mxVertexHandler.prototype.graph=null,mxVertexHandler.prototype.state=null,mxVertexHandler.prototype.singleSizer=!1,mxVertexHandler.prototype.index=null,mxVertexHandler.prototype.allowHandleBoundsCheck=!0,mxVertexHandler.prototype.handleImage=null,mxVertexHandler.prototype.handlesVisible=!0,mxVertexHandler.prototype.tolerance=0,mxVertexHandler.prototype.rotationEnabled=!1,mxVertexHandler.prototype.parentHighlightEnabled=!1,mxVertexHandler.prototype.rotationRaster=!0,mxVertexHandler.prototype.rotationCursor="crosshair",mxVertexHandler.prototype.livePreview=!1,mxVertexHandler.prototype.movePreviewToFront=!1,mxVertexHandler.prototype.manageSizers=!1,mxVertexHandler.prototype.constrainGroupByChildren=!1,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxVertexHandler.prototype.horizontalOffset=0,mxVertexHandler.prototype.verticalOffset=0,mxVertexHandler.prototype.init=function(){var t,e;this.graph=this.state.view.graph,this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.selectionBorder=this.createSelectionShape(this.bounds),this.selectionBorder.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.pointerEvents=!1,this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.selectionBorder.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state),this.graph.isCellMovable(this.state.cell)&&this.selectionBorder.setCursor(mxConstants.CURSOR_MOVABLE_VERTEX),(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)&&(t=this.graph.isCellResizable(this.state.cell),this.sizers=[],t||this.graph.isLabelMovable(this.state.cell)&&2<=this.state.width&&2<=this.state.height?(e=0,t&&(this.singleSizer||(this.sizers.push(this.createSizer("nw-resize",e++)),this.sizers.push(this.createSizer("n-resize",e++)),this.sizers.push(this.createSizer("ne-resize",e++)),this.sizers.push(this.createSizer("w-resize",e++)),this.sizers.push(this.createSizer("e-resize",e++)),this.sizers.push(this.createSizer("sw-resize",e++)),this.sizers.push(this.createSizer("s-resize",e++))),this.sizers.push(this.createSizer("se-resize",e++))),null==(e=this.graph.model.getGeometry(this.state.cell))||e.relative||this.graph.isSwimlane(this.state.cell)||!this.graph.isLabelMovable(this.state.cell)||(this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))):this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellResizable(this.state.cell)&&this.state.width<2&&this.state.height<2&&(this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,mxEvent.LABEL_HANDLE,null,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))),this.isRotationHandleVisible()&&(this.rotationShape=this.createSizer(this.rotationCursor,mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),this.sizers.push(this.rotationShape)),this.customHandles=this.createCustomHandles(),this.redraw(),this.constrainGroupByChildren&&this.updateMinBounds()},mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)},mxVertexHandler.prototype.isConstrainedEvent=function(t){return mxEvent.isShiftDown(t.getEvent())||"fixed"==this.state.style[mxConstants.STYLE_ASPECT]},mxVertexHandler.prototype.isCenteredEvent=function(t,e){return!1},mxVertexHandler.prototype.createCustomHandles=function(){return null},mxVertexHandler.prototype.updateMinBounds=function(){var t,e=this.graph.getChildCells(this.state.cell);0<e.length&&(this.minBounds=this.graph.view.getBounds(e),null!=this.minBounds&&(t=this.state.view.scale,e=this.state.view.translate,this.minBounds.x-=this.state.x,this.minBounds.y-=this.state.y,this.minBounds.x/=t,this.minBounds.y/=t,this.minBounds.width/=t,this.minBounds.height/=t,this.x0=this.state.x/t-e.x,this.y0=this.state.y/t-e.y))},mxVertexHandler.prototype.getSelectionBounds=function(t){return new mxRectangle(Math.round(t.x),Math.round(t.y),Math.round(t.width),Math.round(t.height))},mxVertexHandler.prototype.createParentHighlightShape=function(t){return this.createSelectionShape(t)},mxVertexHandler.prototype.createSelectionShape=function(t){t=new mxRectangleShape(mxRectangle.fromRectangle(t),null,this.getSelectionColor());return t.strokewidth=this.getSelectionStrokeWidth(),t.isDashed=this.isSelectionDashed(),t},mxVertexHandler.prototype.getSelectionColor=function(){return mxConstants.VERTEX_SELECTION_COLOR},mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH},mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED},mxVertexHandler.prototype.createSizer=function(t,e,n,i){n=new mxRectangle(0,0,n=n||mxConstants.HANDLE_SIZE,n),i=this.createSizerShape(n,e,i);return i.isHtmlAllowed()&&null!=this.state.text&&this.state.text.node.parentNode==this.graph.container?(--i.bounds.height,--i.bounds.width,i.dialect=mxConstants.DIALECT_STRICTHTML,i.init(this.graph.container)):(i.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,i.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(i.node,this.graph,this.state),this.graph.isEnabled()&&i.setCursor(t),this.isSizerVisible(e)||(i.visible=!1),i},mxVertexHandler.prototype.isSizerVisible=function(t){return!0},mxVertexHandler.prototype.createSizerShape=function(t,e,n){if(null==this.handleImage)return new(e==mxEvent.ROTATION_HANDLE?mxEllipse:mxRectangleShape)(t,n||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR);t=new mxImageShape(t=new mxRectangle(t.x,t.y,this.handleImage.width,this.handleImage.height),this.handleImage.src);return t.preserveImageAspect=!1,t},mxVertexHandler.prototype.moveSizerTo=function(t,e,n){null!=t&&(t.bounds.x=Math.floor(e-t.bounds.width/2),t.bounds.y=Math.floor(n-t.bounds.height/2),null!=t.node&&"none"!=t.node.style.display&&t.redraw())},mxVertexHandler.prototype.getHandleForEvent=function(n){var t=mxEvent.isMouseEvent(n.getEvent())?1:this.tolerance,i=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<t)?new mxRectangle(n.getGraphX()-t,n.getGraphY()-t,2*t,2*t):null,e=mxUtils.bind(this,function(t){var e=null!=t&&t.constructor!=mxImageShape&&this.allowHandleBoundsCheck?t.strokewidth+t.svgStrokeTolerance:null,e=null!=e?new mxRectangle(n.getGraphX()-Math.floor(e/2),n.getGraphY()-Math.floor(e/2),e,e):i;return null!=t&&(n.isSource(t)||null!=e&&mxUtils.intersects(t.bounds,e)&&"none"!=t.node.style.display&&"hidden"!=t.node.style.visibility)});if(e(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(e(this.labelShape))return mxEvent.LABEL_HANDLE;if(null!=this.sizers)for(var l=0;l<this.sizers.length;l++)if(e(this.sizers[l]))return l;if(null!=this.customHandles&&this.isCustomHandleEvent(n))for(l=this.customHandles.length-1;0<=l;l--)if(e(this.customHandles[l].shape))return mxEvent.CUSTOM_HANDLE-l;return null},mxVertexHandler.prototype.isCustomHandleEvent=function(t){return!0},mxVertexHandler.prototype.mouseDown=function(t,e){var n;e.isConsumed()||!this.graph.isEnabled()||null!=(n=this.getHandleForEvent(e))&&(this.start(e.getGraphX(),e.getGraphY(),n),e.consume())},mxVertexHandler.prototype.isLivePreviewBorder=function(){return null!=this.state.shape&&null==this.state.shape.fill&&null==this.state.shape.stroke},mxVertexHandler.prototype.start=function(t,e,n){if(null!=this.selectionBorder)if(this.livePreviewActive=this.livePreview&&0==this.graph.model.getChildCount(this.state.cell),this.inTolerance=!0,this.childOffsetX=0,this.childOffsetY=0,this.index=n,this.startX=t,this.startY=e,this.index<=mxEvent.CUSTOM_HANDLE&&this.isGhostPreview())this.ghostPreview=this.createGhostPreview();else{t=this.state.view.graph.model,e=t.getParent(this.state.cell);if(this.state.view.currentRoot!=e&&(t.isVertex(e)||t.isEdge(e))&&(this.parentState=this.state.view.graph.view.getState(e)),this.selectionBorder.node.style.display=n==mxEvent.ROTATION_HANDLE?"inline":"none",this.livePreviewActive&&!this.isLivePreviewBorder()||(this.preview=this.createSelectionShape(this.bounds),mxClient.IS_SVG&&0!=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")||null==this.state.text||this.state.text.node.parentNode!=this.graph.container?(this.preview.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane())):(this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container))),n==mxEvent.ROTATION_HANDLE&&(e=(t=this.getRotationHandlePosition()).x-this.state.getCenterX(),t=t.y-this.state.getCenterY(),this.startAngle=0!=e?180*Math.atan(t/e)/Math.PI+90:0,this.startDist=Math.sqrt(e*e+t*t)),this.livePreviewActive){this.hideSizers(),n==mxEvent.ROTATION_HANDLE?this.rotationShape.node.style.display="":n==mxEvent.LABEL_HANDLE?this.labelShape.node.style.display="":null!=this.sizers&&null!=this.sizers[n]?this.sizers[n].node.style.display="":n<=mxEvent.CUSTOM_HANDLE&&null!=this.customHandles&&this.customHandles[mxEvent.CUSTOM_HANDLE-n].setVisible(!0);var i=this.graph.getEdges(this.state.cell);this.edgeHandlers=[];for(var l=0;l<i.length;l++){var s=this.graph.selectionCellsHandler.getHandler(i[l]);null!=s&&this.edgeHandlers.push(s)}}}},mxVertexHandler.prototype.createGhostPreview=function(){var t=this.graph.cellRenderer.createShape(this.state);return t.init(this.graph.view.getOverlayPane()),t.scale=this.state.view.scale,t.bounds=this.bounds,t.outline=!0,t},mxVertexHandler.prototype.setHandlesVisible=function(t){if(this.handlesVisible=t,null!=this.sizers)for(var e=0;e<this.sizers.length;e++)this.sizers[e].node.style.display=t?"":"none";if(null!=this.customHandles)for(e=0;e<this.customHandles.length;e++)this.customHandles[e].setVisible(t)},mxVertexHandler.prototype.hideSizers=function(){this.setHandlesVisible(!1)},mxVertexHandler.prototype.checkTolerance=function(t){this.inTolerance&&null!=this.startX&&null!=this.startY&&(mxEvent.isMouseEvent(t.getEvent())||Math.abs(t.getGraphX()-this.startX)>this.graph.tolerance||Math.abs(t.getGraphY()-this.startY)>this.graph.tolerance)&&(this.inTolerance=!1)},mxVertexHandler.prototype.updateHint=function(t){},mxVertexHandler.prototype.removeHint=function(){},mxVertexHandler.prototype.roundAngle=function(t){return Math.round(10*t)/10},mxVertexHandler.prototype.roundLength=function(t){return Math.round(100*t)/100},mxVertexHandler.prototype.mouseMove=function(t,e){e.isConsumed()||null==this.index?this.graph.isMouseDown||null==this.getHandleForEvent(e)||e.consume(!1):(this.checkTolerance(e),this.inTolerance||(this.index<=mxEvent.CUSTOM_HANDLE?null!=this.customHandles&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].active=!0,null!=this.ghostPreview?(this.ghostPreview.apply(this.state),this.ghostPreview.strokewidth=this.getSelectionStrokeWidth()/this.ghostPreview.scale/this.ghostPreview.scale,this.ghostPreview.isDashed=this.isSelectionDashed(),this.ghostPreview.stroke=this.getSelectionColor(),this.ghostPreview.redraw(),null!=this.selectionBounds&&(this.selectionBorder.node.style.display="none")):(this.movePreviewToFront&&this.moveToFront(),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged())):this.index==mxEvent.LABEL_HANDLE?this.moveLabel(e):(this.index==mxEvent.ROTATION_HANDLE?this.rotateVertex(e):this.resizeVertex(e),this.updateHint(e))),e.consume())},mxVertexHandler.prototype.isGhostPreview=function(){return 0<this.state.view.graph.model.getChildCount(this.state.cell)},mxVertexHandler.prototype.moveLabel=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY()),n=this.graph.view.translate,i=this.graph.view.scale;this.graph.isGridEnabledEvent(t.getEvent())&&(e.x=(this.graph.snap(e.x/i-n.x)+n.x)*i,e.y=(this.graph.snap(e.y/i-n.y)+n.y)*i);i=null!=this.rotationShape?this.sizers.length-2:this.sizers.length-1;this.moveSizerTo(this.sizers[i],e.x,e.y)},mxVertexHandler.prototype.rotateVertex=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY()),n=this.state.x+this.state.width/2-e.x,i=this.state.y+this.state.height/2-e.y;this.currentAlpha=0!=n?180*Math.atan(i/n)/Math.PI+90:i<0?180:0,0<n&&(this.currentAlpha-=180),this.currentAlpha-=this.startAngle,this.rotationRaster&&this.graph.isGridEnabledEvent(t.getEvent())?(n=e.x-this.state.getCenterX(),i=e.y-this.state.getCenterY(),i=Math.sqrt(n*n+i*i),raster=i-this.startDist<2?15:i-this.startDist<25?5:1,this.currentAlpha=Math.round(this.currentAlpha/raster)*raster):this.currentAlpha=this.roundAngle(this.currentAlpha),this.selectionBorder.rotation=this.currentAlpha,this.selectionBorder.redraw(),this.livePreviewActive&&this.redrawHandles()},mxVertexHandler.prototype.resizeVertex=function(t){var e=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),n=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),i=new mxPoint(t.getGraphX(),t.getGraphY()),l=this.graph.view.translate,s=this.graph.view.scale,o=Math.cos(-n),r=Math.sin(-n),a=i.x-this.startX,h=i.y-this.startY,d=r*a+o*h;a=o*a-r*h,h=d;var u=this.graph.getCellGeometry(this.state.cell);this.unscaledBounds=this.union(u,a/s,h/s,this.index,this.graph.isGridEnabledEvent(t.getEvent()),1,new mxPoint(0,0),this.isConstrainedEvent(t),this.isCenteredEvent(this.state,t)),u.relative||(null!=(p=this.graph.getMaximumGraphBounds())&&null!=this.parentState&&((p=mxRectangle.fromRectangle(p)).x-=(this.parentState.x-l.x*s)/s,p.y-=(this.parentState.y-l.y*s)/s),!this.graph.isConstrainChild(this.state.cell)||null!=(i=this.graph.getCellContainmentArea(this.state.cell))&&(0<(d=this.graph.getOverlap(this.state.cell))&&((i=mxRectangle.fromRectangle(i)).x-=i.width*d,i.y-=i.height*d,i.width+=2*i.width*d,i.height+=2*i.height*d),null==p?p=i:(p=mxRectangle.fromRectangle(p)).intersect(i)),null!=p&&(this.unscaledBounds.x<p.x&&(this.unscaledBounds.width-=p.x-this.unscaledBounds.x,this.unscaledBounds.x=p.x),this.unscaledBounds.y<p.y&&(this.unscaledBounds.height-=p.y-this.unscaledBounds.y,this.unscaledBounds.y=p.y),this.unscaledBounds.x+this.unscaledBounds.width>p.x+p.width&&(this.unscaledBounds.width-=this.unscaledBounds.x+this.unscaledBounds.width-p.x-p.width),this.unscaledBounds.y+this.unscaledBounds.height>p.y+p.height&&(this.unscaledBounds.height-=this.unscaledBounds.y+this.unscaledBounds.height-p.y-p.height)));var p=this.bounds;this.bounds=new mxRectangle((null!=this.parentState?this.parentState.x:l.x*s)+this.unscaledBounds.x*s,(null!=this.parentState?this.parentState.y:l.y*s)+this.unscaledBounds.y*s,this.unscaledBounds.width*s,this.unscaledBounds.height*s),u.relative&&null!=this.parentState&&(this.bounds.x+=this.state.x-this.parentState.x,this.bounds.y+=this.state.y-this.parentState.y),o=Math.cos(n),r=Math.sin(n);u=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY()),n=o*(a=u.x-e.x)-r*(h=u.y-e.y)-a,u=r*a+o*h-h,e=this.bounds.x-this.state.x,a=this.bounds.y-this.state.y,h=o*e-r*a,a=r*e+o*a;this.bounds.x+=n,this.bounds.y+=u,this.unscaledBounds.x=this.roundLength(this.unscaledBounds.x+n/s),this.unscaledBounds.y=this.roundLength(this.unscaledBounds.y+u/s),this.unscaledBounds.width=this.roundLength(this.unscaledBounds.width),this.unscaledBounds.height=this.roundLength(this.unscaledBounds.height),this.graph.isCellCollapsed(this.state.cell)||0==n&&0==u?(this.childOffsetX=0,this.childOffsetY=0):(this.childOffsetX=this.state.x-this.bounds.x+h,this.childOffsetY=this.state.y-this.bounds.y+a),p.equals(this.bounds)||(this.livePreviewActive&&this.updateLivePreview(t),null!=this.preview?this.drawPreview():this.updateParentHighlight())},mxVertexHandler.prototype.updateLivePreview=function(t){var e=this.graph.view.scale,n=this.graph.view.translate,i=this.state.clone();this.state.x=this.bounds.x,this.state.y=this.bounds.y,this.state.origin=new mxPoint(this.state.x/e-n.x,this.state.y/e-n.y),this.state.width=this.bounds.width,this.state.height=this.bounds.height;e=new mxPoint((e=this.state.absoluteOffset).x,e.y);this.state.absoluteOffset.x=0,this.state.absoluteOffset.y=0;n=this.graph.getCellGeometry(this.state.cell);null!=n&&(null==(e=n.offset||this.EMPTY_POINT)||n.relative||(this.state.absoluteOffset.x=this.state.view.scale*e.x,this.state.absoluteOffset.y=this.state.view.scale*e.y),this.state.view.updateVertexLabelOffset(this.state)),this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate(),this.redrawHandles(),this.movePreviewToFront&&this.moveToFront(),null!=this.state.control&&null!=this.state.control.node&&(this.state.control.node.style.visibility="hidden"),this.state.setState(i)},mxVertexHandler.prototype.moveToFront=function(){(null!=this.state.text&&null!=this.state.text.node&&null!=this.state.text.node.nextSibling||null!=this.state.shape&&null!=this.state.shape.node&&null!=this.state.shape.node.nextSibling&&(null==this.state.text||this.state.shape.node.nextSibling!=this.state.text.node))&&(null!=this.state.shape&&null!=this.state.shape.node&&this.state.shape.node.parentNode.appendChild(this.state.shape.node),null!=this.state.text&&null!=this.state.text.node&&this.state.text.node.parentNode.appendChild(this.state.text.node))},mxVertexHandler.prototype.mouseUp=function(t,e){if(null!=this.index&&null!=this.state){var n,i,l,s,o,r,a=new mxPoint(e.getGraphX(),e.getGraphY()),h=this.index;(this.index=null)==this.ghostPreview&&(this.state.view.invalidate(this.state.cell,!1,!1),this.state.view.validate()),this.graph.getModel().beginUpdate();try{h<=mxEvent.CUSTOM_HANDLE?null!=this.customHandles&&(l=this.state.view.graph.getCellStyle(this.state.cell),this.customHandles[mxEvent.CUSTOM_HANDLE-h].active=!1,this.customHandles[mxEvent.CUSTOM_HANDLE-h].execute(e),null!=this.customHandles&&null!=this.customHandles[mxEvent.CUSTOM_HANDLE-h]&&(this.state.style=l,this.customHandles[mxEvent.CUSTOM_HANDLE-h].positionChanged())):h==mxEvent.ROTATION_HANDLE?null!=this.currentAlpha?0!=(s=this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0))&&this.rotateCell(this.state.cell,s):this.rotateClick():(n=this.graph.isGridEnabledEvent(e.getEvent()),r=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),i=Math.cos(-r),r=(o=Math.sin(-r))*(l=a.x-this.startX)+i*(s=a.y-this.startY),l=i*l-o*s,s=r,o=this.graph.view.scale,r=this.isRecursiveResize(this.state,e),this.resizeCell(this.state.cell,this.roundLength(l/o),this.roundLength(s/o),h,n,this.isConstrainedEvent(e),r))}finally{this.graph.getModel().endUpdate()}e.consume(),this.reset(),this.redrawHandles()}},mxVertexHandler.prototype.isRecursiveResize=function(t,e){return this.graph.isRecursiveResize(this.state)},mxVertexHandler.prototype.rotateClick=function(){},mxVertexHandler.prototype.rotateCell=function(t,e,n){if(0!=e){var i=this.graph.getModel();if(i.isVertex(t)||i.isEdge(t)){i.isEdge(t)||(s=(this.graph.getCurrentCellStyle(t)[mxConstants.STYLE_ROTATION]||0)+e,this.graph.setCellStyles(mxConstants.STYLE_ROTATION,s,[t]));var l=this.graph.getCellGeometry(t);if(null!=l){var s=this.graph.getCellGeometry(n);if(null==s||i.isEdge(n)||((l=l.clone()).rotate(e,new mxPoint(s.width/2,s.height/2)),i.setGeometry(t,l)),i.isVertex(t)&&!l.relative||i.isEdge(t))for(var o=i.getChildCount(t),r=0;r<o;r++)this.rotateCell(i.getChildAt(t,r),e,t)}}}},mxVertexHandler.prototype.reset=function(){if(null!=this.sizers&&null!=this.index&&null!=this.sizers[this.index]&&"none"==this.sizers[this.index].node.style.display&&(this.sizers[this.index].node.style.display=""),this.currentAlpha=null,this.inTolerance=null,(this.index=null)!=this.preview&&(this.preview.destroy(),this.preview=null),null!=this.ghostPreview&&(this.ghostPreview.destroy(),this.ghostPreview=null),this.livePreviewActive&&null!=this.sizers){for(var t=0;t<this.sizers.length;t++)null!=this.sizers[t]&&(this.sizers[t].node.style.display="");null!=this.state.control&&null!=this.state.control.node&&(this.state.control.node.style.visibility="")}if(null!=this.customHandles)for(t=0;t<this.customHandles.length;t++)this.customHandles[t].active?(this.customHandles[t].active=!1,this.customHandles[t].reset()):this.customHandles[t].setVisible(!0);null!=this.selectionBorder&&(this.selectionBorder.node.style.display="inline",this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.drawPreview()),this.removeHint(),this.redrawHandles(),this.edgeHandlers=null,this.handlesVisible=!0,this.unscaledBounds=null,this.livePreviewActive=null},mxVertexHandler.prototype.resizeCell=function(t,e,n,i,l,s,o){var r,a,h=this.graph.model.getGeometry(t);null!=h&&(i==mxEvent.LABEL_HANDLE?(a=-mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),r=Math.cos(a),i=Math.sin(a),a=this.graph.view.scale,i=mxUtils.getRotatedPoint(new mxPoint(Math.round((this.labelShape.bounds.getCenterX()-this.startX)/a),Math.round((this.labelShape.bounds.getCenterY()-this.startY)/a)),r,i),null==(h=h.clone()).offset?h.offset=i:(h.offset.x+=i.x,h.offset.y+=i.y),this.graph.model.setGeometry(t,h)):null!=this.unscaledBounds&&(a=this.graph.view.scale,0==this.childOffsetX&&0==this.childOffsetY||this.moveChildren(t,Math.round(this.childOffsetX/a),Math.round(this.childOffsetY/a)),this.graph.resizeCell(t,this.unscaledBounds,o)))},mxVertexHandler.prototype.moveChildren=function(t,e,n){for(var i=this.graph.getModel(),l=i.getChildCount(t),s=0;s<l;s++){var o=i.getChildAt(t,s),r=this.graph.getCellGeometry(o);null!=r&&((r=r.clone()).translate(e,n),i.setGeometry(o,r))}},mxVertexHandler.prototype.union=function(t,e,n,i,l,s,o,r,a){if(l=(null==l||l)&&this.graph.gridEnabled,this.singleSizer){var h=t.x+t.width+e,d=t.y+t.height+n;l&&(h=this.graph.snap(h/s)*s,d=this.graph.snap(d/s)*s);var u=new mxRectangle(t.x,t.y,0,0);return u.add(new mxRectangle(h,d,0,0)),u}var p=t.width,m=t.height,c=t.x-o.x*s,g=c+p,h=t.y-o.y*s,d=h+m,u=c+p/2,t=h+m/2;4<i?(d+=n,d=l?this.graph.snap(d/s)*s:Math.round(d/s)*s):i<3&&(h+=n,h=l?this.graph.snap(h/s)*s:Math.round(h/s)*s),0==i||3==i||5==i?(c+=e,c=l?this.graph.snap(c/s)*s:Math.round(c/s)*s):2!=i&&4!=i&&7!=i||(g+=e,g=l?this.graph.snap(g/s)*s:Math.round(g/s)*s);e=g-c,l=d-h;!r||null!=(r=this.graph.getCellGeometry(this.state.cell))&&(r=r.width/r.height,1==i||2==i||7==i||6==i?e=l*r:l=e/r,0==i&&(c=g-e,h=d-l)),a&&(c+=p=u-(c+(e+=e-p)/2),h+=m=t-(h+(l+=l-m)/2),g+=p,d+=m),e<0&&(c+=e,e=Math.abs(e)),l<0&&(h+=l,l=Math.abs(l));l=new mxRectangle(c+o.x*s,h+o.y*s,e,l);return null!=this.minBounds&&(l.width=Math.max(l.width,this.minBounds.x*s+this.minBounds.width*s+Math.max(0,this.x0*s-l.x)),l.height=Math.max(l.height,this.minBounds.y*s+this.minBounds.height*s+Math.max(0,this.y0*s-l.y))),l},mxVertexHandler.prototype.redraw=function(t){this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.drawPreview(),t||this.redrawHandles()},mxVertexHandler.prototype.getHandlePadding=function(){var t=new mxPoint(0,0),e=this.tolerance;return null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]&&(this.bounds.width<2*this.sizers[0].bounds.width+2*e||this.bounds.height<2*this.sizers[0].bounds.height+2*e)&&(e/=2,t.x=this.sizers[0].bounds.width+e,t.y=this.sizers[0].bounds.height+e),t},mxVertexHandler.prototype.getSizerBounds=function(){return this.bounds},mxVertexHandler.prototype.redrawHandles=function(){var t,e,n,i,l,s,o,r,a,h,d=this.getSizerBounds(),u=this.tolerance;if(this.horizontalOffset=0,this.verticalOffset=0,null!=this.customHandles)for(var p=0;p<this.customHandles.length;p++){var m=this.customHandles[p].shape.node.style.display;this.customHandles[p].redraw(),this.customHandles[p].shape.node.style.display=m,this.customHandles[p].shape.node.style.visibility=this.handlesVisible&&this.isCustomHandleVisible(this.customHandles[p])?"":"hidden"}if(null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]&&(null==this.index&&this.manageSizers&&8<=this.sizers.length&&(l=this.getHandlePadding(),this.horizontalOffset=l.x,this.verticalOffset=l.y,0==this.horizontalOffset&&0==this.verticalOffset||((d=new mxRectangle(d.x,d.y,d.width,d.height)).x-=this.horizontalOffset/2,d.width+=this.horizontalOffset,d.y-=this.verticalOffset/2,d.height+=this.verticalOffset),8<=this.sizers.length&&(d.width<2*this.sizers[0].bounds.width+2*u||d.height<2*this.sizers[0].bounds.height+2*u?(this.sizers[0].node.style.display="none",this.sizers[2].node.style.display="none",this.sizers[5].node.style.display="none",this.sizers[7].node.style.display="none"):this.handlesVisible&&(this.sizers[0].node.style.display="",this.sizers[2].node.style.display="",this.sizers[5].node.style.display="",this.sizers[7].node.style.display=""))),t=d.x+d.width,e=d.y+d.height,this.singleSizer?this.moveSizerTo(this.sizers[0],t,e):(n=d.x+d.width/2,i=d.y+d.height/2,8<=this.sizers.length?(l=["nw-resize","n-resize","ne-resize","e-resize","se-resize","s-resize","sw-resize","w-resize"],s=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),o=Math.cos(s),r=Math.sin(s),u=Math.round(4*s/Math.PI),a=new mxPoint(d.getCenterX(),d.getCenterY()),h=mxUtils.getRotatedPoint(new mxPoint(d.x,d.y),o,r,a),this.moveSizerTo(this.sizers[0],h.x,h.y),this.sizers[0].setCursor(l[mxUtils.mod(0+u,l.length)]),h.x=n,h.y=d.y,h=mxUtils.getRotatedPoint(h,o,r,a),this.moveSizerTo(this.sizers[1],h.x,h.y),this.sizers[1].setCursor(l[mxUtils.mod(1+u,l.length)]),h.x=t,h.y=d.y,h=mxUtils.getRotatedPoint(h,o,r,a),this.moveSizerTo(this.sizers[2],h.x,h.y),this.sizers[2].setCursor(l[mxUtils.mod(2+u,l.length)]),h.x=d.x,h.y=i,h=mxUtils.getRotatedPoint(h,o,r,a),this.moveSizerTo(this.sizers[3],h.x,h.y),this.sizers[3].setCursor(l[mxUtils.mod(7+u,l.length)]),h.x=t,h.y=i,h=mxUtils.getRotatedPoint(h,o,r,a),this.moveSizerTo(this.sizers[4],h.x,h.y),this.sizers[4].setCursor(l[mxUtils.mod(3+u,l.length)]),h.x=d.x,h.y=e,h=mxUtils.getRotatedPoint(h,o,r,a),this.moveSizerTo(this.sizers[5],h.x,h.y),this.sizers[5].setCursor(l[mxUtils.mod(6+u,l.length)]),h.x=n,h.y=e,h=mxUtils.getRotatedPoint(h,o,r,a),this.moveSizerTo(this.sizers[6],h.x,h.y),this.sizers[6].setCursor(l[mxUtils.mod(5+u,l.length)]),h.x=t,h.y=e,h=mxUtils.getRotatedPoint(h,o,r,a),this.moveSizerTo(this.sizers[7],h.x,h.y),this.sizers[7].setCursor(l[mxUtils.mod(4+u,l.length)]),h.x=n+this.state.absoluteOffset.x,h.y=i+this.state.absoluteOffset.y,h=mxUtils.getRotatedPoint(h,o,r,a),this.moveSizerTo(this.sizers[8],h.x,h.y)):2<=this.state.width&&2<=this.state.height?this.moveSizerTo(this.sizers[0],n+this.state.absoluteOffset.x,i+this.state.absoluteOffset.y):this.moveSizerTo(this.sizers[0],this.state.x,this.state.y))),null!=this.rotationShape&&(s=mxUtils.toRadians(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),o=Math.cos(s),r=Math.sin(s),a=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),h=mxUtils.getRotatedPoint(this.getRotationHandlePosition(),o,r,a),null!=this.rotationShape.node&&(this.moveSizerTo(this.rotationShape,h.x,h.y),this.rotationShape.node.style.visibility=this.state.view.graph.isEditing()||!this.handlesVisible?"hidden":"")),null!=this.selectionBorder&&(this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")),null!=this.edgeHandlers)for(p=0;p<this.edgeHandlers.length;p++)this.edgeHandlers[p].redraw()},mxVertexHandler.prototype.isCustomHandleVisible=function(t){return!this.graph.isEditing()&&1==this.state.view.graph.getSelectionCount()},mxVertexHandler.prototype.getRotationHandlePosition=function(){return new mxPoint(this.bounds.x+this.bounds.width/2,this.bounds.y+this.rotationHandleVSpacing)},mxVertexHandler.prototype.isParentHighlightVisible=function(){return!this.graph.isCellSelected(this.graph.model.getParent(this.state.cell))},mxVertexHandler.prototype.updateParentHighlight=function(){var t,e,n,i;this.isDestroyed()||(t=this.isParentHighlightVisible(),e=this.graph.model.getParent(this.state.cell),n=this.graph.view.getState(e),null!=this.parentHighlight?this.graph.model.isVertex(e)&&t?(i=this.parentHighlight.bounds,null==n||i.x==n.x&&i.y==n.y&&i.width==n.width&&i.height==n.height||(this.parentHighlight.bounds=mxRectangle.fromRectangle(n),this.parentHighlight.redraw())):(null!=n&&n.parentHighlight==this.parentHighlight&&(n.parentHighlight=null),this.parentHighlight.destroy(),this.parentHighlight=null):this.parentHighlightEnabled&&t&&this.graph.model.isVertex(e)&&null!=n&&null==n.parentHighlight&&(this.parentHighlight=this.createParentHighlightShape(n),this.parentHighlight.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.parentHighlight.pointerEvents=!1,this.parentHighlight.rotation=Number(n.style[mxConstants.STYLE_ROTATION]||"0"),this.parentHighlight.init(this.graph.getView().getOverlayPane()),this.parentHighlight.redraw(),n.parentHighlight=this.parentHighlight))},mxVertexHandler.prototype.drawPreview=function(){null!=this.preview&&(this.preview.bounds=this.bounds,this.preview.node.parentNode==this.graph.container&&(this.preview.bounds.width=Math.max(0,this.preview.bounds.width-1),this.preview.bounds.height=Math.max(0,this.preview.bounds.height-1)),this.preview.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.preview.redraw()),this.selectionBorder.bounds=this.getSelectionBorderBounds(),this.selectionBorder.redraw(),this.updateParentHighlight()},mxVertexHandler.prototype.getSelectionBorderBounds=function(){return this.bounds},mxVertexHandler.prototype.isDestroyed=function(){return null==this.selectionBorder},mxVertexHandler.prototype.destroy=function(){var t;if(null!=this.escapeHandler&&(this.state.view.graph.removeListener(this.escapeHandler),this.escapeHandler=null),null!=this.preview&&(this.preview.destroy(),this.preview=null),null!=this.parentHighlight&&(t=this.graph.model.getParent(this.state.cell),null!=(t=this.graph.view.getState(t))&&t.parentHighlight==this.parentHighlight&&(t.parentHighlight=null),this.parentHighlight.destroy(),this.parentHighlight=null),null!=this.ghostPreview&&(this.ghostPreview.destroy(),this.ghostPreview=null),null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null),this.labelShape=null,this.removeHint(),null!=this.sizers){for(var e=0;e<this.sizers.length;e++)this.sizers[e].destroy();this.sizers=null}if(null!=this.customHandles){for(e=0;e<this.customHandles.length;e++)this.customHandles[e].destroy();this.customHandles=null}},mxEdgeHandler.prototype.graph=null,mxEdgeHandler.prototype.state=null,mxEdgeHandler.prototype.marker=null,mxEdgeHandler.prototype.constraintHandler=null,mxEdgeHandler.prototype.error=null,mxEdgeHandler.prototype.shape=null,mxEdgeHandler.prototype.bends=null,mxEdgeHandler.prototype.labelShape=null,mxEdgeHandler.prototype.cloneEnabled=!0,mxEdgeHandler.prototype.addEnabled=!1,mxEdgeHandler.prototype.removeEnabled=!1,mxEdgeHandler.prototype.dblClickRemoveEnabled=!1,mxEdgeHandler.prototype.mergeRemoveEnabled=!1,mxEdgeHandler.prototype.straightRemoveEnabled=!1,mxEdgeHandler.prototype.virtualBendsEnabled=!1,mxEdgeHandler.prototype.virtualBendOpacity=20,mxEdgeHandler.prototype.parentHighlightEnabled=!1,mxEdgeHandler.prototype.preferHtml=!1,mxEdgeHandler.prototype.allowHandleBoundsCheck=!0,mxEdgeHandler.prototype.snapToTerminals=!1,mxEdgeHandler.prototype.handleImage=null,mxEdgeHandler.prototype.tolerance=0,mxEdgeHandler.prototype.outlineConnect=!1,mxEdgeHandler.prototype.manageLabelHandle=!1,mxEdgeHandler.prototype.init=function(){var t;this.graph=this.state.view.graph,this.marker=this.createMarker(),this.constraintHandler=new mxConstraintHandler(this.graph),this.points=[],this.abspoints=this.getSelectionPoints(this.state),this.shape=this.createSelectionShape(this.abspoints),this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,this.shape.init(this.graph.getView().getOverlayPane()),this.shape.pointerEvents=!1,this.shape.setCursor(mxConstants.CURSOR_MOVABLE_EDGE),mxEvent.redirectMouseEvents(this.shape.node,this.graph,this.state),this.preferHtml=null!=this.state.text&&this.state.text.node.parentNode==this.graph.container,this.preferHtml||(null!=(t=this.state.getVisibleTerminalState(!0))&&(this.preferHtml=null!=t.text&&t.text.node.parentNode==this.graph.container),this.preferHtml||null!=(t=this.state.getVisibleTerminalState(!1))&&(this.preferHtml=null!=t.text&&t.text.node.parentNode==this.graph.container)),(this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells||mxGraphHandler.prototype.maxCells<=0)&&(this.bends=this.createBends(),this.isVirtualBendsEnabled()&&(this.virtualBends=this.createVirtualBends())),this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y),this.labelShape=this.createLabelHandleShape(),this.initBend(this.labelShape),this.labelShape.setCursor(mxConstants.CURSOR_LABEL_HANDLE),this.customHandles=this.createCustomHandles(),this.updateParentHighlight(),this.redraw()},mxEdgeHandler.prototype.isParentHighlightVisible=mxVertexHandler.prototype.isParentHighlightVisible,mxEdgeHandler.prototype.updateParentHighlight=mxVertexHandler.prototype.updateParentHighlight,mxEdgeHandler.prototype.createCustomHandles=function(){return null},mxEdgeHandler.prototype.isVirtualBendsEnabled=function(t){return this.virtualBendsEnabled&&(null==this.state.style[mxConstants.STYLE_EDGE]||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.NONE||1==this.state.style[mxConstants.STYLE_NOEDGESTYLE])&&"arrow"!=mxUtils.getValue(this.state.style,mxConstants.STYLE_SHAPE,null)},mxEdgeHandler.prototype.isCellEnabled=function(t){return!0},mxEdgeHandler.prototype.isAddPointEvent=function(t){return mxEvent.isShiftDown(t)},mxEdgeHandler.prototype.isRemovePointEvent=function(t){return mxEvent.isShiftDown(t)},mxEdgeHandler.prototype.getSelectionPoints=function(t){return t.absolutePoints},mxEdgeHandler.prototype.createParentHighlightShape=function(t){t=new mxRectangleShape(mxRectangle.fromRectangle(t),null,this.getSelectionColor());return t.strokewidth=this.getSelectionStrokeWidth(),t.isDashed=this.isSelectionDashed(),t},mxEdgeHandler.prototype.createSelectionShape=function(t){var e=new this.state.shape.constructor;return e.outline=!0,e.apply(this.state),e.isDashed=this.isSelectionDashed(),e.stroke=this.getSelectionColor(),e.isShadow=!1,e},mxEdgeHandler.prototype.getSelectionColor=function(){return mxConstants.EDGE_SELECTION_COLOR},mxEdgeHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.EDGE_SELECTION_STROKEWIDTH},mxEdgeHandler.prototype.isSelectionDashed=function(){return mxConstants.EDGE_SELECTION_DASHED},mxEdgeHandler.prototype.isConnectableCell=function(t){return!0},mxEdgeHandler.prototype.getCellAt=function(t,e){return this.outlineConnect?null:this.graph.getCellAt(t,e)},mxEdgeHandler.prototype.createMarker=function(){var t=new mxCellMarker(this.graph),i=this;return t.getCell=function(t){var e=mxCellMarker.prototype.getCell.apply(this,arguments);e!=i.state.cell&&null!=e||null==i.currentPoint||(e=i.graph.getCellAt(i.currentPoint.x,i.currentPoint.y)),null==e||this.graph.isCellConnectable(e)||(n=this.graph.getModel().getParent(e),this.graph.getModel().isVertex(n)&&this.graph.isCellConnectable(n)&&(e=n));var n=i.graph.getModel();return(this.graph.isSwimlane(e)&&null!=i.currentPoint&&this.graph.hitsSwimlaneContent(e,i.currentPoint.x,i.currentPoint.y)||!i.isConnectableCell(e)||e==i.state.cell||null!=e&&!i.graph.connectableEdges&&n.isEdge(e)||n.isAncestor(i.state.cell,e))&&(e=null),this.graph.isCellConnectable(e)||(e=null),e},t.isValidState=function(t){var e=i.graph.getModel(),n=i.graph.view.getTerminalPort(t,i.graph.view.getState(e.getTerminal(i.state.cell,!i.isSource)),!i.isSource),e=null!=n?n.cell:null,n=i.isSource?t.cell:e,t=i.isSource?e:t.cell;return i.error=i.validateConnection(n,t),null==i.error},t},mxEdgeHandler.prototype.validateConnection=function(t,e){return this.graph.getEdgeValidationError(this.state.cell,t,e)},mxEdgeHandler.prototype.createBends=function(){for(var t,e,n,i=this.state.cell,l=[],s=0;s<this.abspoints.length;s++)this.isHandleVisible(s)&&(t=0==s,e=s==this.abspoints.length-1,((n=t||e)||this.graph.isCellBendable(i))&&mxUtils.bind(this,function(t){var e=this.createHandleShape(t);this.initBend(e,mxUtils.bind(this,mxUtils.bind(this,function(){this.dblClickRemoveEnabled&&this.removePoint(this.state,t)}))),this.isHandleEnabled(s)&&e.setCursor(n?mxConstants.CURSOR_TERMINAL_HANDLE:mxConstants.CURSOR_BEND_HANDLE),l.push(e),n||(this.points.push(new mxPoint(0,0)),e.node.style.visibility="hidden")})(s));return l},mxEdgeHandler.prototype.createVirtualBends=function(){var t=this.state.cell,e=(this.abspoints[0],[]);if(this.graph.isCellBendable(t))for(var n=1;n<this.abspoints.length;n++)mxUtils.bind(this,function(t){this.initBend(t),t.setCursor(mxConstants.CURSOR_VIRTUAL_BEND_HANDLE),e.push(t)})(this.createHandleShape());return e},mxEdgeHandler.prototype.isHandleEnabled=function(t){return!0},mxEdgeHandler.prototype.isHandleVisible=function(t){var e=this.state.getVisibleTerminalState(!0),n=this.state.getVisibleTerminalState(!1),i=this.graph.getCellGeometry(this.state.cell);return(null!=i?this.graph.view.getEdgeStyle(this.state,i.points,e,n):null)!=mxEdgeStyle.EntityRelation||0==t||t==this.abspoints.length-1},mxEdgeHandler.prototype.createHandleShape=function(t){if(null!=this.handleImage){var e=new mxImageShape(new mxRectangle(0,0,this.handleImage.width,this.handleImage.height),this.handleImage.src);return e.preserveImageAspect=!1,e}e=mxConstants.HANDLE_SIZE;return this.preferHtml&&--e,new mxRectangleShape(new mxRectangle(0,0,e,e),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxEdgeHandler.prototype.createLabelHandleShape=function(){if(null!=this.labelHandleImage){var t=new mxImageShape(new mxRectangle(0,0,this.labelHandleImage.width,this.labelHandleImage.height),this.labelHandleImage.src);return t.preserveImageAspect=!1,t}t=mxConstants.LABEL_HANDLE_SIZE;return new mxRectangleShape(new mxRectangle(0,0,t,t),mxConstants.LABEL_HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxEdgeHandler.prototype.initBend=function(t,e){this.preferHtml?(t.dialect=mxConstants.DIALECT_STRICTHTML,t.init(this.graph.container)):(t.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,t.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(t.node,this.graph,this.state,null,null,null,e),!mxClient.IS_QUIRKS&&8!=document.documentMode||mxEvent.addListener(t.node,"dragstart",function(t){return mxEvent.consume(t),!1}),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none")},mxEdgeHandler.prototype.getHandleForEvent=function(n){var t=null;if(null!=this.state){var e=mxEvent.isMouseEvent(n.getEvent())?1:this.tolerance,i=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<e)?new mxRectangle(n.getGraphX()-e,n.getGraphY()-e,2*e,2*e):null,l=null;function s(t){if(null!=t&&null!=t.node&&"none"!=t.node.style.display&&"hidden"!=t.node.style.visibility&&(n.isSource(t)||null!=i&&mxUtils.intersects(t.bounds,i))){var e=n.getGraphX()-t.bounds.getCenterX(),t=n.getGraphY()-t.bounds.getCenterY(),t=e*e+t*t;if(null==l||t<=l)return l=t,1}}if(null!=this.customHandles&&this.isCustomHandleEvent(n))for(var o=this.customHandles.length-1;0<=o;o--)if(s(this.customHandles[o].shape))return mxEvent.CUSTOM_HANDLE-o;if((n.isSource(this.state.text)||s(this.labelShape))&&(t=mxEvent.LABEL_HANDLE),null!=this.bends)for(o=0;o<this.bends.length;o++)s(this.bends[o])&&(t=o);if(null!=this.virtualBends&&this.isAddVirtualBendEvent(n))for(o=0;o<this.virtualBends.length;o++)s(this.virtualBends[o])&&(t=mxEvent.VIRTUAL_HANDLE-o)}return t},mxEdgeHandler.prototype.isAddVirtualBendEvent=function(t){return!0},mxEdgeHandler.prototype.isCustomHandleEvent=function(t){return!0},mxEdgeHandler.prototype.mouseDown=function(t,e){var n,i=this.getHandleForEvent(e);null!=this.bends&&null!=this.bends[i]&&(n=this.bends[i].bounds,this.snapPoint=new mxPoint(n.getCenterX(),n.getCenterY())),this.addEnabled&&null==i&&this.isAddPointEvent(e.getEvent())?(this.addPoint(this.state,e.getEvent()),e.consume()):null!=i&&!e.isConsumed()&&this.graph.isEnabled()&&(this.removeEnabled&&this.isRemovePointEvent(e.getEvent())?this.removePoint(this.state,i):i==mxEvent.LABEL_HANDLE&&!this.graph.isLabelMovable(e.getCell())||(i<=mxEvent.VIRTUAL_HANDLE&&mxUtils.setOpacity(this.virtualBends[mxEvent.VIRTUAL_HANDLE-i].node,100),this.start(e.getX(),e.getY(),i)),e.consume())},mxEdgeHandler.prototype.start=function(t,e,n){if(this.startX=t,this.startY=e,this.isSource=null!=this.bends&&0==n,this.isTarget=null!=this.bends&&n==this.bends.length-1,this.isLabel=n==mxEvent.LABEL_HANDLE,this.isSource||this.isTarget?(t=this.state.cell,(null==(e=this.graph.model.getTerminal(t,this.isSource))&&this.graph.isTerminalPointMovable(t,this.isSource)||null!=e&&this.graph.isCellDisconnectable(t,e,this.isSource))&&(this.index=n)):this.index=n,this.index<=mxEvent.CUSTOM_HANDLE&&this.index>mxEvent.VIRTUAL_HANDLE&&null!=this.customHandles)for(var i=0;i<this.customHandles.length;i++)i!=mxEvent.CUSTOM_HANDLE-this.index&&this.customHandles[i].setVisible(!1)},mxEdgeHandler.prototype.clonePreviewState=function(t,e){return this.state.clone()},mxEdgeHandler.prototype.getSnapToTerminalTolerance=function(){return this.graph.gridSize*this.graph.view.scale/2},mxEdgeHandler.prototype.updateHint=function(t,e){},mxEdgeHandler.prototype.removeHint=function(){},mxEdgeHandler.prototype.roundLength=function(t){return Math.round(t)},mxEdgeHandler.prototype.isSnapToTerminalsEvent=function(t){return this.snapToTerminals&&!mxEvent.isAltDown(t.getEvent())},mxEdgeHandler.prototype.getPointForEvent=function(t){var e=this.graph.getView(),n=e.scale,i=new mxPoint(this.roundLength(t.getGraphX()/n)*n,this.roundLength(t.getGraphY()/n)*n),l=this.getSnapToTerminalTolerance(),s=!1,o=!1;if(0<l&&this.isSnapToTerminalsEvent(t)){function r(t){var e;null!=t&&(e=t.x,Math.abs(i.x-e)<l&&(i.x=e,s=!0),t=t.y,Math.abs(i.y-t)<l&&(i.y=t,o=!0))}function a(t){null!=t&&r.call(this,new mxPoint(e.getRoutingCenterX(t),e.getRoutingCenterY(t)))}if(a.call(this,this.state.getVisibleTerminalState(!0)),a.call(this,this.state.getVisibleTerminalState(!1)),null!=this.state.absolutePoints)for(var h=0;h<this.state.absolutePoints.length;h++)r.call(this,this.state.absolutePoints[h])}return this.graph.isGridEnabledEvent(t.getEvent())&&(t=e.translate,s||(i.x=(this.graph.snap(i.x/n-t.x)+t.x)*n),o||(i.y=(this.graph.snap(i.y/n-t.y)+t.y)*n)),i},mxEdgeHandler.prototype.getPreviewTerminalState=function(t){if(this.constraintHandler.update(t,this.isSource,!0,t.isSource(this.marker.highlight.shape)?null:this.currentPoint),null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint){null!=this.marker.highlight&&null!=this.marker.highlight.state&&this.marker.highlight.state.cell==this.constraintHandler.currentFocus.cell?"transparent"!=this.marker.highlight.shape.stroke&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint()):this.marker.markCell(this.constraintHandler.currentFocus.cell,"transparent");var e=this.graph.getModel(),n=this.graph.view.getTerminalPort(this.state,this.graph.view.getState(e.getTerminal(this.state.cell,!this.isSource)),!this.isSource),e=null!=n?n.cell:null,n=this.isSource?this.constraintHandler.currentFocus.cell:e,e=this.isSource?e:this.constraintHandler.currentFocus.cell;this.error=this.validateConnection(n,e);e=null;return null==this.error&&(e=this.constraintHandler.currentFocus),null==this.error&&(null==e||this.isCellEnabled(e.cell))||this.constraintHandler.reset(),e}if(this.graph.isIgnoreTerminalEvent(t.getEvent()))return this.marker.reset(),null;this.marker.process(t);t=this.marker.getValidState();return null==t||this.isCellEnabled(t.cell)||(this.constraintHandler.reset(),this.marker.reset()),this.marker.getValidState()},mxEdgeHandler.prototype.getPreviewPoints=function(t,e){var n,i,l=this.graph.getCellGeometry(this.state.cell),s=null!=l.points?l.points.slice():null,l=new mxPoint(t.x,t.y),o=null;if(this.isSource||this.isTarget)this.graph.resetEdgesOnConnect&&(s=null);else if(this.convertPoint(l,!1),null==s)s=[l];else{if(this.index<=mxEvent.VIRTUAL_HANDLE&&s.splice(mxEvent.VIRTUAL_HANDLE-this.index,0,l),!this.isSource&&!this.isTarget){for(var r,a,h,d,u=0;u<this.bends.length;u++)u==this.index||null!=(r=this.bends[u])&&mxUtils.contains(r.bounds,t.x,t.y)&&(this.index<=mxEvent.VIRTUAL_HANDLE?s.splice(mxEvent.VIRTUAL_HANDLE-this.index,1):s.splice(this.index-1,1),o=s);null!=o||!this.straightRemoveEnabled||null!=e&&mxEvent.isAltDown(e.getEvent())||(a=this.graph.tolerance*this.graph.tolerance,(h=this.state.absolutePoints.slice())[this.index]=t,null!=(e=this.state.getVisibleTerminalState(!0))&&(null!=(d=this.graph.getConnectionConstraint(this.state,e,!0))&&null!=this.graph.getConnectionPoint(e,d)||(h[0]=new mxPoint(e.view.getRoutingCenterX(e),e.view.getRoutingCenterY(e)))),null!=(e=this.state.getVisibleTerminalState(!1))&&(null!=(d=this.graph.getConnectionConstraint(this.state,e,!1))&&null!=this.graph.getConnectionPoint(e,d)||(h[h.length-1]=new mxPoint(e.view.getRoutingCenterX(e),e.view.getRoutingCenterY(e)))),n=this.index,i=t,0<n&&n<h.length-1&&mxUtils.ptSegDistSq(h[n-1].x,h[n-1].y,h[n+1].x,h[n+1].y,i.x,i.y)<a&&(s.splice(n-1,1),o=s))}null==o&&this.index>mxEvent.VIRTUAL_HANDLE&&(s[this.index-1]=l)}return null!=o?o:s},mxEdgeHandler.prototype.isOutlineConnectEvent=function(t){var e=mxUtils.getOffset(this.graph.container),n=t.getEvent(),i=mxEvent.getClientX(n),l=mxEvent.getClientY(n),s=document.documentElement,n=(window.pageXOffset||s.scrollLeft)-(s.clientLeft||0),s=(window.pageYOffset||s.scrollTop)-(s.clientTop||0),n=this.currentPoint.x-this.graph.container.scrollLeft+e.x-n,s=this.currentPoint.y-this.graph.container.scrollTop+e.y-s;return this.outlineConnect&&!mxEvent.isShiftDown(t.getEvent())&&(t.isSource(this.marker.highlight.shape)||mxEvent.isAltDown(t.getEvent())&&null!=t.getState()||this.marker.highlight.isHighlightAt(i,l)||(n!=i||s!=l)&&null==t.getState()&&this.marker.highlight.isHighlightAt(n,s))},mxEdgeHandler.prototype.updatePreviewState=function(t,e,n,i,l){var s,o=this.isSource?n:this.state.getVisibleTerminalState(!0),r=this.isTarget?n:this.state.getVisibleTerminalState(!1),a=this.graph.getConnectionConstraint(t,o,!0),h=this.graph.getConnectionConstraint(t,r,!1),d=this.constraintHandler.currentConstraint;null==d&&l&&(null!=n?(i.isSource(this.marker.highlight.shape)&&(e=new mxPoint(i.getGraphX(),i.getGraphY())),d=this.graph.getOutlineConstraint(e,n,i),this.constraintHandler.setFocus(i,n,this.isSource),this.constraintHandler.currentConstraint=d,this.constraintHandler.currentPoint=e):d=new mxConnectionConstraint),this.outlineConnect&&null!=this.marker.highlight&&null!=this.marker.highlight.shape&&(s=this.graph.view.scale,null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(this.marker.highlight.shape.stroke=l?mxConstants.OUTLINE_HIGHLIGHT_COLOR:"transparent",this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/s/s,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.marker.highlight.shape.stroke=this.graph.isCellConnectable(i.getCell())&&this.marker.getValidState()!=i.getState()?"transparent":mxConstants.DEFAULT_VALID_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/s/s,this.marker.highlight.repaint())),this.isSource?a=d:this.isTarget&&(h=d),(this.isSource||this.isTarget)&&(null!=d&&null!=d.point?(t.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X]=d.point.x,t.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]=d.point.y):(delete t.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X],delete t.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y])),t.setVisibleTerminalState(o,!0),t.setVisibleTerminalState(r,!1),this.isSource&&null==o||t.view.updateFixedTerminalPoint(t,o,!0,a),this.isTarget&&null==r||t.view.updateFixedTerminalPoint(t,r,!1,h),(this.isSource||this.isTarget)&&null==n&&(t.setAbsoluteTerminalPoint(e,this.isSource),null==this.marker.getMarkedState()&&(this.error=this.graph.allowDanglingEdges?null:"")),t.view.updatePoints(t,this.points,o,r),t.view.updateFloatingTerminalPoints(t,o,r)},mxEdgeHandler.prototype.mouseMove=function(t,e){var n,i,l;null!=this.index&&null!=this.marker?(this.currentPoint=this.getPointForEvent(e),this.error=null,!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&null!=this.snapPoint&&(Math.abs(this.snapPoint.x-this.currentPoint.x)<Math.abs(this.snapPoint.y-this.currentPoint.y)?this.currentPoint.x=this.snapPoint.x:this.currentPoint.y=this.snapPoint.y),this.index<=mxEvent.CUSTOM_HANDLE&&this.index>mxEvent.VIRTUAL_HANDLE?null!=this.customHandles&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged(),null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display="none")):this.isLabel?(this.label.x=this.currentPoint.x,this.label.y=this.currentPoint.y):(this.points=this.getPreviewPoints(this.currentPoint,e),n=this.isSource||this.isTarget?this.getPreviewTerminalState(e):null,null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?this.currentPoint=this.constraintHandler.currentPoint.clone():this.outlineConnect&&((l=!(!this.isSource&&!this.isTarget)&&this.isOutlineConnectEvent(e))?n=this.marker.highlight.state:null!=n&&n!=e.getState()&&this.graph.isCellConnectable(e.getCell())&&null!=this.marker.highlight.shape&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint(),n=null)),null==n||this.isCellEnabled(n.cell)||(n=null,this.marker.reset()),i=this.clonePreviewState(this.currentPoint,null!=n?n.cell:null),this.updatePreviewState(i,this.currentPoint,n,e,l),l=null==this.error?this.marker.validColor:this.marker.invalidColor,this.setPreviewColor(l),this.abspoints=i.absolutePoints,this.active=!0,this.updateHint(e,this.currentPoint)),this.drawPreview(),mxEvent.consume(e.getEvent()),e.consume()):mxClient.IS_IE&&null!=this.getHandleForEvent(e)&&e.consume(!1)},mxEdgeHandler.prototype.mouseUp=function(t,e){if(null!=this.index&&null!=this.marker){null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display="");var n=this.state.cell,i=this.index;if(this.index=null,e.getX()!=this.startX||e.getY()!=this.startY){var l=!this.graph.isIgnoreTerminalEvent(e.getEvent())&&this.graph.isCloneEvent(e.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable();if(null!=this.error)0<this.error.length&&this.graph.validationAlert(this.error);else if(i<=mxEvent.CUSTOM_HANDLE&&i>mxEvent.VIRTUAL_HANDLE){if(null!=this.customHandles){(a=this.graph.getModel()).beginUpdate();try{this.customHandles[mxEvent.CUSTOM_HANDLE-i].execute(e),null!=this.shape&&null!=this.shape.node&&(this.shape.apply(this.state),this.shape.redraw())}finally{a.endUpdate()}}}else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget){var s,o,r=null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(r=this.constraintHandler.currentFocus.cell),null==r&&this.marker.hasValidState()&&null!=this.marker.highlight&&null!=this.marker.highlight.shape&&"transparent"!=this.marker.highlight.shape.stroke&&"white"!=this.marker.highlight.shape.stroke&&(r=this.marker.validState.cell),null!=r){var a,h,d=(a=this.graph.getModel()).getParent(n);a.beginUpdate();try{l&&(h=a.getGeometry(n),l=this.graph.cloneCell(n),a.add(d,l,a.getChildCount(d)),null!=h&&(h=h.clone(),a.setGeometry(l,h)),h=a.getTerminal(n,!this.isSource),this.graph.connectCell(l,h,!this.isSource),n=l),n=this.connect(n,r,this.isSource,l,e)}finally{a.endUpdate()}}else this.graph.isAllowDanglingEdges()&&((s=this.abspoints[this.isSource?0:this.abspoints.length-1]).x=this.roundLength(s.x/this.graph.view.scale-this.graph.view.translate.x),s.y=this.roundLength(s.y/this.graph.view.scale-this.graph.view.translate.y),null!=(o=this.graph.getView().getState(this.graph.getModel().getParent(n)))&&(s.x-=o.origin.x,s.y-=o.origin.y),s.x-=this.graph.panDx/this.graph.view.scale,s.y-=this.graph.panDy/this.graph.view.scale,n=this.changeTerminalPoint(n,s,this.isSource,l))}else this.active?n=this.changePoints(n,this.points,l):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().validate(this.state.cell))}else this.graph.isToggleEvent(e.getEvent())&&this.graph.selectCellForEvent(this.state.cell,e.getEvent());null!=this.marker&&(this.reset(),n!=this.state.cell&&this.graph.setSelectionCell(n)),e.consume()}},mxEdgeHandler.prototype.reset=function(){if(this.active&&this.refresh(),this.error=null,this.index=null,this.label=null,this.points=null,this.snapPoint=null,this.isLabel=!1,this.isSource=!1,this.isTarget=!1,this.active=!1,this.livePreview&&null!=this.sizers)for(var t=0;t<this.sizers.length;t++)null!=this.sizers[t]&&(this.sizers[t].node.style.display="");if(null!=this.marker&&this.marker.reset(),null!=this.constraintHandler&&this.constraintHandler.reset(),null!=this.customHandles)for(t=0;t<this.customHandles.length;t++)this.customHandles[t].reset();this.setPreviewColor(mxConstants.EDGE_SELECTION_COLOR),this.removeHint(),this.redraw()},mxEdgeHandler.prototype.setPreviewColor=function(t){null!=this.shape&&(this.shape.stroke=t)},mxEdgeHandler.prototype.convertPoint=function(t,e){var n=this.graph.getView().getScale(),i=this.graph.getView().getTranslate();e&&(t.x=this.graph.snap(t.x),t.y=this.graph.snap(t.y)),t.x=Math.round(t.x/n-i.x),t.y=Math.round(t.y/n-i.y);i=this.graph.getView().getState(this.graph.getModel().getParent(this.state.cell));return null!=i&&(t.x-=i.origin.x,t.y-=i.origin.y),t},mxEdgeHandler.prototype.moveLabel=function(t,e,n){var i,l,s,o,r=this.graph.getModel(),a=r.getGeometry(t.cell);null!=a&&(i=this.graph.getView().scale,(a=a.clone()).relative?(l=this.graph.getView().getRelativePoint(t,e,n),a.x=Math.round(1e4*l.x)/1e4,a.y=Math.round(l.y),a.offset=new mxPoint(0,0),l=this.graph.view.getPoint(t,a),a.offset=new mxPoint(Math.round((e-l.x)/i),Math.round((n-l.y)/i))):(o=(s=t.absolutePoints)[0],l=s[s.length-1],null!=o&&null!=l&&(s=o.x+(l.x-o.x)/2,o=o.y+(l.y-o.y)/2,a.offset=new mxPoint(Math.round((e-s)/i),Math.round((n-o)/i)),a.x=0,a.y=0)),r.setGeometry(t.cell,a))},mxEdgeHandler.prototype.connect=function(t,e,n,i,l){var s=this.graph.getModel();s.getParent(t);s.beginUpdate();try{var o=this.constraintHandler.currentConstraint;null==o&&(o=new mxConnectionConstraint),this.graph.connectCell(t,e,n,o)}finally{s.endUpdate()}return t},mxEdgeHandler.prototype.changeTerminalPoint=function(t,e,n,i){var l,s=this.graph.getModel();s.beginUpdate();try{i&&(l=s.getParent(t),o=s.getTerminal(t,!n),t=this.graph.cloneCell(t),s.add(l,t,s.getChildCount(l)),s.setTerminal(t,o,!n));var o=s.getGeometry(t);null!=o&&((o=o.clone()).setTerminalPoint(e,n),s.setGeometry(t,o),this.graph.connectCell(t,null,n,new mxConnectionConstraint))}finally{s.endUpdate()}return t},mxEdgeHandler.prototype.changePoints=function(t,e,n){var i,l,s=this.graph.getModel();s.beginUpdate();try{n&&(i=s.getParent(t),l=s.getTerminal(t,!0),o=s.getTerminal(t,!1),t=this.graph.cloneCell(t),s.add(i,t,s.getChildCount(i)),s.setTerminal(t,l,!0),s.setTerminal(t,o,!1));var o=s.getGeometry(t);null!=o&&((o=o.clone()).points=e,s.setGeometry(t,o))}finally{s.endUpdate()}return t},mxEdgeHandler.prototype.addPoint=function(t,e){var n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),i=this.graph.isGridEnabledEvent(e);this.convertPoint(n,i),this.addPointAt(t,n.x,n.y),mxEvent.consume(e)},mxEdgeHandler.prototype.addPointAt=function(t,e,n){var i,l=this.graph.getCellGeometry(t.cell),s=new mxPoint(e,n);null!=l&&(l=l.clone(),i=this.graph.view.translate,e=this.graph.view.scale,n=new mxPoint(i.x*e,i.y*e),i=this.graph.model.getParent(this.state.cell),this.graph.model.isVertex(i)&&(n=new mxPoint((i=this.graph.view.getState(i)).x,i.y)),n=mxUtils.findNearestSegment(t,s.x*e+n.x,s.y*e+n.y),null==l.points?l.points=[s]:l.points.splice(n,0,s),this.graph.getModel().setGeometry(t.cell,l),this.refresh(),this.redraw())},mxEdgeHandler.prototype.removePoint=function(t,e){var n;0<e&&e<this.abspoints.length-1&&(null!=(n=this.graph.getCellGeometry(this.state.cell))&&null!=n.points&&((n=n.clone()).points.splice(e-1,1),this.graph.getModel().setGeometry(t.cell,n),this.refresh(),this.redraw()))},mxEdgeHandler.prototype.getHandleFillColor=function(t){var e=0==t,n=this.state.cell,i=this.graph.getModel().getTerminal(n,e),t=mxConstants.HANDLE_FILLCOLOR;return null!=i&&!this.graph.isCellDisconnectable(n,i,e)||null==i&&!this.graph.isTerminalPointMovable(n,e)?t=mxConstants.LOCKED_HANDLE_FILLCOLOR:null!=i&&this.graph.isCellDisconnectable(n,i,e)&&(t=mxConstants.CONNECT_HANDLE_FILLCOLOR),t},mxEdgeHandler.prototype.redraw=function(t){if(null!=this.state){this.abspoints=this.state.absolutePoints.slice();var e=this.graph.getModel().getGeometry(this.state.cell);if(null!=e){var n=e.points;if(null!=this.bends&&0<this.bends.length&&null!=n){null==this.points&&(this.points=[]);for(var i=1;i<this.bends.length-1;i++)null!=this.bends[i]&&null!=this.abspoints[i]&&(this.points[i-1]=n[i-1])}}this.drawPreview(),t||this.redrawHandles()}},mxEdgeHandler.prototype.redrawHandles=function(){var t=this.state.cell,e=this.labelShape.bounds;this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y),this.labelShape.bounds=new mxRectangle(Math.round(this.label.x-e.width/2),Math.round(this.label.y-e.height/2),e.width,e.height);var n,i,l,s=this.graph.getLabel(t);if(this.labelShape.visible=null!=s&&0<s.length&&this.graph.isLabelMovable(t),null!=this.bends&&0<this.bends.length&&(l=this.abspoints.length-1,i=(n=this.abspoints[0]).x,s=n.y,e=this.bends[0].bounds,this.bends[0].bounds=new mxRectangle(Math.floor(i-e.width/2),Math.floor(s-e.height/2),e.width,e.height),this.bends[0].fill=this.getHandleFillColor(0),this.bends[0].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[0].bounds),i=(t=this.abspoints[l]).x,s=t.y,l=this.bends.length-1,e=this.bends[l].bounds,this.bends[l].bounds=new mxRectangle(Math.floor(i-e.width/2),Math.floor(s-e.height/2),e.width,e.height),this.bends[l].fill=this.getHandleFillColor(l),this.bends[l].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[l].bounds),this.redrawInnerBends(n,t)),null!=this.abspoints&&null!=this.virtualBends&&0<this.virtualBends.length)for(var o,r,a,h=this.abspoints[0],d=0;d<this.virtualBends.length;d++)null!=this.virtualBends[d]&&null!=this.abspoints[d+1]&&(o=this.abspoints[d+1],e=this.virtualBends[d],r=h.x+(o.x-h.x)/2,a=h.y+(o.y-h.y)/2,e.bounds=new mxRectangle(Math.floor(r-e.bounds.width/2),Math.floor(a-e.bounds.height/2),e.bounds.width,e.bounds.height),e.redraw(),mxUtils.setOpacity(e.node,this.virtualBendOpacity),h=o,this.manageLabelHandle&&this.checkLabelHandle(e.bounds));if(null!=this.labelShape&&this.labelShape.redraw(),null!=this.customHandles)for(d=0;d<this.customHandles.length;d++){var u=this.customHandles[d].shape.node.style.display;this.customHandles[d].redraw(),this.customHandles[d].shape.node.style.display=u,this.customHandles[d].shape.node.style.visibility=this.isCustomHandleVisible(this.customHandles[d])?"":"hidden"}},mxEdgeHandler.prototype.isCustomHandleVisible=function(t){return!this.graph.isEditing()&&1==this.state.view.graph.getSelectionCount()},mxEdgeHandler.prototype.setHandlesVisible=function(t){if(null!=this.bends)for(var e=0;e<this.bends.length;e++)this.bends[e].node.style.display=t?"":"none";if(null!=this.virtualBends)for(e=0;e<this.virtualBends.length;e++)this.virtualBends[e].node.style.display=t?"":"none";if(null!=this.labelShape&&(this.labelShape.node.style.display=t?"":"none"),null!=this.customHandles)for(e=0;e<this.customHandles.length;e++)this.customHandles[e].setVisible(t)},mxEdgeHandler.prototype.redrawInnerBends=function(t,e){for(var n,i,l,s=1;s<this.bends.length-1;s++)null!=this.bends[s]&&(null!=this.abspoints[s]?(n=this.abspoints[s].x,i=this.abspoints[s].y,l=this.bends[s].bounds,this.bends[s].node.style.visibility="visible",this.bends[s].bounds=new mxRectangle(Math.round(n-l.width/2),Math.round(i-l.height/2),l.width,l.height),this.manageLabelHandle?this.checkLabelHandle(this.bends[s].bounds):null==this.handleImage&&this.labelShape.visible&&mxUtils.intersects(this.bends[s].bounds,this.labelShape.bounds)&&(w=mxConstants.HANDLE_SIZE+3,h=mxConstants.HANDLE_SIZE+3,this.bends[s].bounds=new mxRectangle(Math.round(n-w/2),Math.round(i-h/2),w,h)),this.bends[s].redraw()):(this.bends[s].destroy(),this.bends[s]=null))},mxEdgeHandler.prototype.checkLabelHandle=function(t){var e;null!=this.labelShape&&(e=this.labelShape.bounds,mxUtils.intersects(t,e)&&(t.getCenterY()<e.getCenterY()?e.y=t.y+t.height:e.y=t.y-e.height))},mxEdgeHandler.prototype.drawPreview=function(){try{var t;this.isLabel&&(t=this.labelShape.bounds,t=new mxRectangle(Math.round(this.label.x-t.width/2),Math.round(this.label.y-t.height/2),t.width,t.height),this.labelShape.bounds.equals(t)||(this.labelShape.bounds=t,this.labelShape.redraw())),null==this.shape||mxUtils.equalPoints(this.shape.points,this.abspoints)||(this.shape.apply(this.state),this.shape.points=this.abspoints.slice(),this.shape.scale=this.state.view.scale,this.shape.isDashed=this.isSelectionDashed(),this.shape.stroke=this.getSelectionColor(),this.shape.strokewidth=this.getSelectionStrokeWidth()/this.shape.scale/this.shape.scale,this.shape.isShadow=!1,this.shape.redraw()),this.updateParentHighlight()}catch(t){}},mxEdgeHandler.prototype.refresh=function(){null!=this.state&&(this.abspoints=this.getSelectionPoints(this.state),this.points=[],null!=this.bends&&(this.destroyBends(this.bends),this.bends=this.createBends()),null!=this.virtualBends&&(this.destroyBends(this.virtualBends),this.virtualBends=this.createVirtualBends()),null!=this.customHandles&&(this.destroyBends(this.customHandles),this.customHandles=this.createCustomHandles()),null!=this.labelShape&&null!=this.labelShape.node&&null!=this.labelShape.node.parentNode&&this.labelShape.node.parentNode.appendChild(this.labelShape.node))},mxEdgeHandler.prototype.isDestroyed=function(){return null==this.shape},mxEdgeHandler.prototype.destroyBends=function(t){if(null!=t)for(var e=0;e<t.length;e++)null!=t[e]&&t[e].destroy()},mxEdgeHandler.prototype.destroy=function(){var t;null!=this.escapeHandler&&(this.state.view.graph.removeListener(this.escapeHandler),this.escapeHandler=null),null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.parentHighlight&&(t=this.graph.model.getParent(this.state.cell),null!=(t=this.graph.view.getState(t))&&t.parentHighlight==this.parentHighlight&&(t.parentHighlight=null),this.parentHighlight.destroy(),this.parentHighlight=null),null!=this.labelShape&&(this.labelShape.destroy(),this.labelShape=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),this.destroyBends(this.virtualBends),this.virtualBends=null,this.destroyBends(this.customHandles),this.customHandles=null,this.destroyBends(this.bends),this.bends=null,this.removeHint()},mxUtils.extend(mxElbowEdgeHandler,mxEdgeHandler),mxElbowEdgeHandler.prototype.flipEnabled=!0,mxElbowEdgeHandler.prototype.doubleClickOrientationResource="none"!=mxClient.language?"doubleClickOrientation":"",mxElbowEdgeHandler.prototype.createBends=function(){var t=[],e=this.createHandleShape(0);return this.initBend(e),e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE),t.push(e),t.push(this.createVirtualBend(mxUtils.bind(this,function(t){!mxEvent.isConsumed(t)&&this.flipEnabled&&(this.graph.flipEdge(this.state.cell,t),mxEvent.consume(t))}))),this.points.push(new mxPoint(0,0)),e=this.createHandleShape(2),this.initBend(e),e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE),t.push(e),t},mxElbowEdgeHandler.prototype.createVirtualBend=function(t){var e=this.createHandleShape();return this.initBend(e,t),e.setCursor(this.getCursorForBend()),this.graph.isCellBendable(this.state.cell)||(e.node.style.display="none"),e},mxElbowEdgeHandler.prototype.getCursorForBend=function(){return this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.TopToBottom||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_TOPTOBOTTOM||(this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.ElbowConnector||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_ELBOW)&&this.state.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL?"row-resize":"col-resize"},mxElbowEdgeHandler.prototype.getTooltipForNode=function(t){var e=null;return null==this.bends||null==this.bends[1]||t!=this.bends[1].node&&t.parentNode!=this.bends[1].node||(e=this.doubleClickOrientationResource,e=mxResources.get(e)||e),e},mxElbowEdgeHandler.prototype.convertPoint=function(t,e){var n=this.graph.getView().getScale(),i=this.graph.getView().getTranslate(),l=this.state.origin;return e&&(t.x=this.graph.snap(t.x),t.y=this.graph.snap(t.y)),t.x=Math.round(t.x/n-i.x-l.x),t.y=Math.round(t.y/n-i.y-l.y),t},mxElbowEdgeHandler.prototype.redrawInnerBends=function(t,e){var n=this.graph.getModel().getGeometry(this.state.cell),i=this.state.absolutePoints,l=null;1<i.length?(t=i[1],e=i[i.length-2]):null!=n.points&&0<n.points.length&&(l=i[0]),l=null==l?new mxPoint(t.x+(e.x-t.x)/2,t.y+(e.y-t.y)/2):new mxPoint(this.graph.getView().scale*(l.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(l.y+this.graph.getView().translate.y+this.state.origin.y));i=this.bends[1].bounds,e=i.width,t=i.height,i=new mxRectangle(Math.round(l.x-e/2),Math.round(l.y-t/2),e,t);this.manageLabelHandle?this.checkLabelHandle(i):null==this.handleImage&&this.labelShape.visible&&mxUtils.intersects(i,this.labelShape.bounds)&&(e=mxConstants.HANDLE_SIZE+3,t=mxConstants.HANDLE_SIZE+3,i=new mxRectangle(Math.floor(l.x-e/2),Math.floor(l.y-t/2),e,t)),this.bends[1].bounds=i,this.bends[1].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[1].bounds)},mxUtils.extend(mxEdgeSegmentHandler,mxElbowEdgeHandler),mxEdgeSegmentHandler.prototype.getCurrentPoints=function(){var t,e,n=this.state.absolutePoints;return null!=n&&(e=Math.max(1,this.graph.view.scale),(2==n.length||3==n.length&&(Math.abs(n[0].x-n[1].x)<e&&Math.abs(n[1].x-n[2].x)<e||Math.abs(n[0].y-n[1].y)<e&&Math.abs(n[1].y-n[2].y)<e))&&(t=n[0].x+(n[n.length-1].x-n[0].x)/2,e=n[0].y+(n[n.length-1].y-n[0].y)/2,n=[n[0],new mxPoint(t,e),new mxPoint(t,e),n[n.length-1]])),n},mxEdgeSegmentHandler.prototype.getPreviewPoints=function(t){if(this.isSource||this.isTarget)return mxElbowEdgeHandler.prototype.getPreviewPoints.apply(this,arguments);var e=this.getCurrentPoints(),n=this.convertPoint(e[0].clone(),!1);t=this.convertPoint(t.clone(),!1);for(var i,l,s,o,r,a=[],h=1;h<e.length;h++){var d=this.convertPoint(e[h].clone(),!1);h==this.index&&(0==Math.round(n.x-d.x)&&(n.x=t.x,d.x=t.x),0==Math.round(n.y-d.y)&&(n.y=t.y,d.y=t.y)),h<e.length-1&&a.push(d),n=d}return 1==a.length&&(i=this.state.getVisibleTerminalState(!0),l=this.state.getVisibleTerminalState(!1),s=this.state.view.getScale(),r=this.state.view.getTranslate(),o=a[0].x*s+r.x,r=a[0].y*s+r.y,(null!=i&&mxUtils.contains(i,o,r)||null!=l&&mxUtils.contains(l,o,r))&&(a=[t,t])),a},mxEdgeSegmentHandler.prototype.updatePreviewState=function(t,e,n,i){if(mxEdgeHandler.prototype.updatePreviewState.apply(this,arguments),!this.isSource&&!this.isTarget){e=this.convertPoint(e.clone(),!1);for(var l=t.absolutePoints,s=l[0],o=l[1],r=[],a=2;a<l.length;a++){var h=l[a];0==Math.round(s.x-o.x)&&0==Math.round(o.x-h.x)||0==Math.round(s.y-o.y)&&0==Math.round(o.y-h.y)||r.push(this.convertPoint(o.clone(),!1)),s=o,o=h}var d,u,p,m,c,g=this.state.getVisibleTerminalState(!0),x=this.state.getVisibleTerminalState(!1),y=this.state.absolutePoints;0!=r.length||0!=Math.round(l[0].x-l[l.length-1].x)&&0!=Math.round(l[0].y-l[l.length-1].y)?5==l.length&&2==r.length&&null!=g&&null!=x&&null!=y&&0==Math.round(y[0].x-y[y.length-1].x)&&(p=(d=this.graph.getView()).getScale(),m=d.getTranslate(),u=d.getRoutingCenterY(g)/p-m.y,null!=(y=this.graph.getConnectionConstraint(t,g,!0))&&null!=(c=this.graph.getConnectionPoint(g,y))&&(this.convertPoint(c,!1),u=c.y),p=d.getRoutingCenterY(x)/p-m.y,(m=this.graph.getConnectionConstraint(t,x,!1))&&null!=(c=this.graph.getConnectionPoint(x,m))&&(this.convertPoint(c,!1),p=c.y),r=[new mxPoint(e.x,u),new mxPoint(e.x,p)]):r=[e,e],this.points=r,t.view.updateFixedTerminalPoints(t,g,x),t.view.updatePoints(t,this.points,g,x),t.view.updateFloatingTerminalPoints(t,g,x)}},mxEdgeSegmentHandler.prototype.connect=function(t,e,n,i,l){var s=this.graph.getModel(),o=s.getGeometry(t),r=null;if(null!=o&&null!=o.points&&0<o.points.length)for(var a=this.abspoints,h=a[0],d=a[1],r=[],u=2;u<a.length;u++){var p=a[u];0==Math.round(h.x-d.x)&&0==Math.round(d.x-p.x)||0==Math.round(h.y-d.y)&&0==Math.round(d.y-p.y)||r.push(this.convertPoint(d.clone(),!1)),h=d,d=p}s.beginUpdate();try{null!=r&&null!=(o=s.getGeometry(t))&&((o=o.clone()).points=r,s.setGeometry(t,o)),t=mxEdgeHandler.prototype.connect.apply(this,arguments)}finally{s.endUpdate()}return t},mxEdgeSegmentHandler.prototype.getTooltipForNode=function(t){return null},mxEdgeSegmentHandler.prototype.start=function(t,e,n){mxEdgeHandler.prototype.start.apply(this,arguments),null==this.bends||null==this.bends[n]||this.isSource||this.isTarget||mxUtils.setOpacity(this.bends[n].node,100)},mxEdgeSegmentHandler.prototype.createBends=function(){var t=[],e=this.createHandleShape(0);this.initBend(e),e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE),t.push(e);var n=this.getCurrentPoints();if(this.graph.isCellBendable(this.state.cell)){null==this.points&&(this.points=[]);for(var i=0;i<n.length-1;i++){e=this.createVirtualBend(),t.push(e);var l=0==Math.round(n[i].x-n[i+1].x);0==Math.round(n[i].y-n[i+1].y)&&i<n.length-2&&(l=0==Math.round(n[i].x-n[i+2].x)),e.setCursor(l?"col-resize":"row-resize"),this.points.push(new mxPoint(0,0))}}e=this.createHandleShape(n.length);return this.initBend(e),e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE),t.push(e),t},mxEdgeSegmentHandler.prototype.redraw=function(){this.refresh(),mxEdgeHandler.prototype.redraw.apply(this,arguments)},mxEdgeSegmentHandler.prototype.redrawInnerBends=function(t,e){if(this.graph.isCellBendable(this.state.cell)){var n=this.getCurrentPoints();if(null!=n&&1<n.length){var i,l=!1;4==n.length&&0==Math.round(n[1].x-n[2].x)&&0==Math.round(n[1].y-n[2].y)&&(l=!0,0==Math.round(n[0].y-n[n.length-1].y)?(i=n[0].x+(n[n.length-1].x-n[0].x)/2,n[1]=new mxPoint(i,n[1].y),n[2]=new mxPoint(i,n[2].y)):(i=n[0].y+(n[n.length-1].y-n[0].y)/2,n[1]=new mxPoint(n[1].x,i),n[2]=new mxPoint(n[2].x,i)));for(var s,o,r=0;r<n.length-1;r++)null!=this.bends[r+1]&&(t=n[r],e=n[r+1],s=new mxPoint(t.x+(e.x-t.x)/2,t.y+(e.y-t.y)/2),o=this.bends[r+1].bounds,this.bends[r+1].bounds=new mxRectangle(Math.floor(s.x-o.width/2),Math.floor(s.y-o.height/2),o.width,o.height),this.bends[r+1].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[r+1].bounds));l&&(mxUtils.setOpacity(this.bends[1].node,this.virtualBendOpacity),mxUtils.setOpacity(this.bends[3].node,this.virtualBendOpacity))}}},mxKeyHandler.prototype.graph=null,mxKeyHandler.prototype.target=null,mxKeyHandler.prototype.normalKeys=null,mxKeyHandler.prototype.shiftKeys=null,mxKeyHandler.prototype.controlKeys=null,mxKeyHandler.prototype.controlShiftKeys=null,mxKeyHandler.prototype.enabled=!0,mxKeyHandler.prototype.isEnabled=function(){return this.enabled},mxKeyHandler.prototype.setEnabled=function(t){this.enabled=t},mxKeyHandler.prototype.bindKey=function(t,e){this.normalKeys[t]=e},mxKeyHandler.prototype.bindShiftKey=function(t,e){this.shiftKeys[t]=e},mxKeyHandler.prototype.bindControlKey=function(t,e){this.controlKeys[t]=e},mxKeyHandler.prototype.bindControlShiftKey=function(t,e){this.controlShiftKeys[t]=e},mxKeyHandler.prototype.isControlDown=function(t){return mxEvent.isControlDown(t)},mxKeyHandler.prototype.getFunction=function(t){return null==t||mxEvent.isAltDown(t)?null:(this.isControlDown(t)?mxEvent.isShiftDown(t)?this.controlShiftKeys:this.controlKeys:mxEvent.isShiftDown(t)?this.shiftKeys:this.normalKeys)[t.keyCode]},mxKeyHandler.prototype.isGraphEvent=function(t){var e=mxEvent.getSource(t);return!!(e==this.target||e.parentNode==this.target||null!=this.graph.cellEditor&&this.graph.cellEditor.isEventSource(t))||mxUtils.isAncestorNode(this.graph.container,e)},mxKeyHandler.prototype.keyDown=function(t){var e;this.isEnabledForEvent(t)&&(27==t.keyCode?this.escape(t):this.isEventIgnored(t)||null!=(e=this.getFunction(t))&&(e(t),mxEvent.consume(t)))},mxKeyHandler.prototype.isEnabledForEvent=function(t){return this.graph.isEnabled()&&!mxEvent.isConsumed(t)&&this.isGraphEvent(t)&&this.isEnabled()},mxKeyHandler.prototype.isEventIgnored=function(t){return this.graph.isEditing()},mxKeyHandler.prototype.escape=function(t){this.graph.isEscapeEnabled()&&this.graph.escape(t)},mxKeyHandler.prototype.destroy=function(){null!=this.target&&null!=this.keydownHandler&&(mxEvent.removeListener(this.target,"keydown",this.keydownHandler),this.keydownHandler=null),this.target=null},mxTooltipHandler.prototype.zIndex=10005,mxTooltipHandler.prototype.graph=null,mxTooltipHandler.prototype.delay=null,mxTooltipHandler.prototype.ignoreTouchEvents=!0,mxTooltipHandler.prototype.hideOnHover=!1,mxTooltipHandler.prototype.destroyed=!1,mxTooltipHandler.prototype.enabled=!0,mxTooltipHandler.prototype.isEnabled=function(){return this.enabled},mxTooltipHandler.prototype.setEnabled=function(t){this.enabled=t},mxTooltipHandler.prototype.isHideOnHover=function(){return this.hideOnHover},mxTooltipHandler.prototype.setHideOnHover=function(t){this.hideOnHover=t},mxTooltipHandler.prototype.init=function(){null!=document.body&&(this.div=document.createElement("div"),this.div.className="mxTooltip",this.div.style.visibility="hidden",document.body.appendChild(this.div),mxEvent.addGestureListeners(this.div,mxUtils.bind(this,function(t){"A"!=mxEvent.getSource(t).nodeName&&this.hideTooltip()})))},mxTooltipHandler.prototype.getStateForEvent=function(t){return t.getState()},mxTooltipHandler.prototype.mouseDown=function(t,e){this.reset(e,!1),this.hideTooltip()},mxTooltipHandler.prototype.mouseMove=function(t,e){var n;e.getX()==this.lastX&&e.getY()==this.lastY||(this.reset(e,!0),n=this.getStateForEvent(e),(this.isHideOnHover()||n!=this.state||e.getSource()!=this.node&&(!this.stateSource||null!=n&&this.stateSource==(e.isSource(n.shape)||!e.isSource(n.text))))&&this.hideTooltip()),this.lastX=e.getX(),this.lastY=e.getY()},mxTooltipHandler.prototype.mouseUp=function(t,e){this.reset(e,!0),this.hideTooltip()},mxTooltipHandler.prototype.resetTimer=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null)},mxTooltipHandler.prototype.reset=function(t,e,n){var i,l,s,o;this.ignoreTouchEvents&&!mxEvent.isMouseEvent(t.getEvent())||(this.resetTimer(),n=null!=n?n:this.getStateForEvent(t),e&&this.isEnabled()&&null!=n&&(null==this.div||"hidden"==this.div.style.visibility)&&(i=t.getSource(),l=t.getX(),s=t.getY(),o=t.isSource(n.shape)||t.isSource(n.text),this.thread=window.setTimeout(mxUtils.bind(this,function(){var t;this.graph.isEditing()||this.graph.popupMenuHandler.isMenuShowing()||this.graph.isMouseDown||(t=this.graph.getTooltip(n,i,l,s),this.show(t,l,s),this.state=n,this.node=i,this.stateSource=o)}),this.delay)))},mxTooltipHandler.prototype.hide=function(){this.resetTimer(),this.hideTooltip()},mxTooltipHandler.prototype.hideTooltip=function(){null!=this.div&&(this.div.style.visibility="hidden",this.div.innerHTML="")},mxTooltipHandler.prototype.show=function(t,e,n){var i;!this.destroyed&&null!=t&&0<t.length&&(null==this.div&&this.init(),i=mxUtils.getScrollOrigin(),this.div.style.zIndex=this.zIndex,this.div.style.left=e+i.x+"px",this.div.style.top=n+mxConstants.TOOLTIP_VERTICAL_OFFSET+i.y+"px",mxUtils.isNode(t)?(this.div.innerHTML="",this.div.appendChild(t)):this.div.innerHTML=t.replace(/\n/g,"<br>"),this.div.style.visibility="",mxUtils.fit(this.div))},mxTooltipHandler.prototype.destroy=function(){this.destroyed||(this.graph.removeMouseListener(this),mxEvent.release(this.div),null!=this.div&&null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.destroyed=!0,this.div=null)},mxUtils.extend(mxCellTracker,mxCellMarker),mxCellTracker.prototype.mouseDown=function(t,e){},mxCellTracker.prototype.mouseMove=function(t,e){this.isEnabled()&&this.process(e)},mxCellTracker.prototype.mouseUp=function(t,e){},mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))},mxCellHighlight.prototype.keepOnTop=!1,mxCellHighlight.prototype.graph=null,mxCellHighlight.prototype.state=null,mxCellHighlight.prototype.spacing=2,mxCellHighlight.prototype.resetHandler=null,mxCellHighlight.prototype.setHighlightColor=function(t){this.highlightColor=t,null!=this.shape&&(this.shape.stroke=t)},mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape(),this.repaint(),this.keepOnTop||this.shape.node.parentNode.firstChild==this.shape.node||this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)},mxCellHighlight.prototype.createShape=function(){var t=this.graph.cellRenderer.createShape(this.state);return t.svgStrokeTolerance=this.graph.tolerance,t.points=this.state.absolutePoints,t.apply(this.state),t.stroke=this.highlightColor,t.opacity=this.opacity,t.isDashed=this.dashed,t.isShadow=!1,t.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,t.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(t.node,this.graph,this.state),this.graph.dialect!=mxConstants.DIALECT_SVG?t.pointerEvents=!1:t.svgPointerEvents="stroke",t},mxCellHighlight.prototype.getStrokeWidth=function(t){return this.strokeWidth},mxCellHighlight.prototype.repaint=function(){null!=this.state&&null!=this.shape&&(this.shape.scale=this.state.view.scale,this.graph.model.isEdge(this.state.cell)?(this.shape.strokewidth=this.getStrokeWidth(),this.shape.points=this.state.absolutePoints,this.shape.outline=!1):(this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing),this.shape.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.shape.strokewidth=this.getStrokeWidth()/this.state.view.scale,this.shape.outline=!0),null!=this.state.shape&&this.shape.setCursor(this.state.shape.getCursor()),!mxClient.IS_QUIRKS&&8!=document.documentMode||("transparent"==this.shape.stroke?(this.shape.stroke="white",this.shape.opacity=1):this.shape.opacity=this.opacity),this.shape.redraw())},mxCellHighlight.prototype.hide=function(){this.highlight(null)},mxCellHighlight.prototype.highlight=function(t){this.state!=t&&(null!=this.shape&&(this.shape.destroy(),this.shape=null),this.state=t,null!=this.state&&this.drawHighlight())},mxCellHighlight.prototype.isHighlightAt=function(t,e){var n=!1;if(null!=this.shape&&null!=document.elementFromPoint&&!mxClient.IS_QUIRKS)for(var i=document.elementFromPoint(t,e);null!=i;){if(i==this.shape.node){n=!0;break}i=i.parentNode}return n},mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getView().removeListener(this.repaintHandler),this.graph.getModel().removeListener(this.repaintHandler),null!=this.shape&&(this.shape.destroy(),this.shape=null)},mxDefaultKeyHandler.prototype.editor=null,mxDefaultKeyHandler.prototype.handler=null,mxDefaultKeyHandler.prototype.bindAction=function(t,e,n){var i=mxUtils.bind(this,function(){this.editor.execute(e)});n?this.handler.bindControlKey(t,i):this.handler.bindKey(t,i)},mxDefaultKeyHandler.prototype.destroy=function(){this.handler.destroy(),this.handler=null},mxDefaultPopupMenu.prototype.imageBasePath=null,mxDefaultPopupMenu.prototype.config=null,mxDefaultPopupMenu.prototype.createMenu=function(t,e,n,i){var l,s;null!=this.config&&(l=this.createConditions(t,n,i),s=this.config.firstChild,this.addItems(t,e,n,i,l,s,null))},mxDefaultPopupMenu.prototype.addItems=function(t,e,n,i,l,s,o){for(var r,a,h,d,u,p,m=!1;null!=s;)"add"==s.nodeName?null!=(p=s.getAttribute("if"))&&!l[p]||(r=s.getAttribute("as"),r=mxResources.get(r)||r,a=mxUtils.eval(mxUtils.getTextContent(s)),h=s.getAttribute("action"),d=s.getAttribute("icon"),u=s.getAttribute("iconCls"),p=null==(p=s.getAttribute("enabled-if"))||l[p],m&&(e.addSeparator(o),m=!1),null!=d&&this.imageBasePath&&(d=this.imageBasePath+d),p=this.addAction(e,t,r,d,a,h,n,o,u,p),this.addItems(t,e,n,i,l,s.firstChild,p)):"separator"==s.nodeName&&(m=!0),s=s.nextSibling},mxDefaultPopupMenu.prototype.addAction=function(t,e,n,i,l,s,o,r,a,h){return t.addItem(n,i,function(t){"function"==typeof l&&l.call(e,e,o,t),null!=s&&e.execute(s,o,t)},r,a,h)},mxDefaultPopupMenu.prototype.createConditions=function(t,e,n){var i=t.graph.getModel(),l=i.getChildCount(e),s=[];s.nocell=null==e,s.ncells=1<t.graph.getSelectionCount(),s.notRoot=i.getRoot()!=i.getParent(t.graph.getDefaultParent()),s.cell=null!=e;i=null!=e&&1==t.graph.getSelectionCount();s.nonEmpty=i&&0<l,s.expandable=i&&t.graph.isCellFoldable(e,!1),s.collapsable=i&&t.graph.isCellFoldable(e,!0),s.validRoot=i&&t.graph.isValidRoot(e),s.emptyValidRoot=s.validRoot&&0==l,s.swimlane=i&&t.graph.isSwimlane(e);for(var o=this.config.getElementsByTagName("condition"),r=0;r<o.length;r++){var a=mxUtils.eval(mxUtils.getTextContent(o[r])),h=o[r].getAttribute("name");null!=h&&"function"==typeof a&&(s[h]=a(t,e,n))}return s},mxDefaultToolbar.prototype.editor=null,mxDefaultToolbar.prototype.toolbar=null,mxDefaultToolbar.prototype.resetHandler=null,mxDefaultToolbar.prototype.spacing=4,mxDefaultToolbar.prototype.connectOnDrop=!1,mxDefaultToolbar.prototype.init=function(t){null!=t&&(this.toolbar=new mxToolbar(t),this.toolbar.addListener(mxEvent.SELECT,mxUtils.bind(this,function(t,e){var n=e.getProperty("function");this.editor.insertFunction=null!=n?mxUtils.bind(this,function(){n.apply(this,arguments),this.toolbar.resetMode()}):null})),this.resetHandler=mxUtils.bind(this,function(){null!=this.toolbar&&this.toolbar.resetMode(!0)}),this.editor.graph.addListener(mxEvent.DOUBLE_CLICK,this.resetHandler),this.editor.addListener(mxEvent.ESCAPE,this.resetHandler))},mxDefaultToolbar.prototype.addItem=function(t,e,n,i){var l=mxUtils.bind(this,function(){null!=n&&0<n.length&&this.editor.execute(n)});return this.toolbar.addItem(t,e,l,i)},mxDefaultToolbar.prototype.addSeparator=function(t){t=t||mxClient.imageBasePath+"/separator.gif",this.toolbar.addSeparator(t)},mxDefaultToolbar.prototype.addCombo=function(){return this.toolbar.addCombo()},mxDefaultToolbar.prototype.addActionCombo=function(t){return this.toolbar.addActionCombo(t)},mxDefaultToolbar.prototype.addActionOption=function(t,e,n){var i=mxUtils.bind(this,function(){this.editor.execute(n)});this.addOption(t,e,i)},mxDefaultToolbar.prototype.addOption=function(t,e,n){return this.toolbar.addOption(t,e,n)},mxDefaultToolbar.prototype.addMode=function(t,e,n,i,l){var s=mxUtils.bind(this,function(){this.editor.setMode(n),null!=l&&l(this.editor)});return this.toolbar.addSwitchMode(t,e,s,i)},mxDefaultToolbar.prototype.addPrototype=function(t,e,n,i,l,s){var o=mxUtils.bind(this,function(){return"function"==typeof n?n():null!=n?this.editor.graph.cloneCell(n):null}),r=mxUtils.bind(this,function(t,e){"function"==typeof l?l(this.editor,o(),t,e):this.drop(o(),t,e),this.toolbar.resetMode(),mxEvent.consume(t)}),s=this.toolbar.addMode(t,e,r,i,null,s);return this.installDropHandler(s,function(t,e,n){r(e,n)}),s},mxDefaultToolbar.prototype.drop=function(t,e,n){var i=this.editor.graph,l=i.getModel();if(null!=n&&!l.isEdge(n)&&this.connectOnDrop&&i.isCellConnectable(n))this.connect(t,e,n);else{for(;null!=n&&!i.isValidDropTarget(n,[t],e);)n=l.getParent(n);this.insert(t,e,n)}},mxDefaultToolbar.prototype.insert=function(t,e,n){var i=this.editor.graph;if(i.canImportCell(t)){var l=mxEvent.getClientX(e),s=mxEvent.getClientY(e),s=mxUtils.convertPoint(i.container,l,s);return i.isSplitEnabled()&&i.isSplitTarget(n,[t],e)?i.splitEdge(n,[t],null,s.x,s.y):this.editor.addVertex(n,t,s.x,s.y)}return null},mxDefaultToolbar.prototype.connect=function(t,e,n){var i=this.editor.graph,l=i.getModel();if(null!=n&&i.isCellConnectable(t)&&i.isEdgeValid(null,n,t)){var s=null;l.beginUpdate();try{var o=l.getGeometry(n),r=l.getGeometry(t).clone();r.x=o.x+(o.width-r.width)/2,r.y=o.y+(o.height-r.height)/2;var a=this.spacing*i.gridSize,h=20*l.getDirectedEdgeCount(n,!0);this.editor.horizontalFlow?r.x+=(r.width+o.width)/2+a+h:r.y+=(r.height+o.height)/2+a+h,t.setGeometry(r);h=l.getParent(n);i.addCell(t,h),i.constrainChild(t),s=this.editor.createEdge(n,t),null==l.getGeometry(s)&&((r=new mxGeometry).relative=!0,l.setGeometry(s,r)),i.addEdge(s,h,n,t)}finally{l.endUpdate()}i.setSelectionCells([t,s]),i.scrollCellToVisible(t)}},mxDefaultToolbar.prototype.installDropHandler=function(e,n){var i=document.createElement("img");i.setAttribute("src",e.getAttribute("src"));var l=mxUtils.bind(this,function(t){i.style.width=2*e.offsetWidth+"px",i.style.height=2*e.offsetHeight+"px",mxUtils.makeDraggable(e,this.editor.graph,n,i),mxEvent.removeListener(i,"load",l)});mxClient.IS_IE?l():mxEvent.addListener(i,"load",l)},mxDefaultToolbar.prototype.destroy=function(){null!=this.resetHandler&&(this.editor.graph.removeListener("dblclick",this.resetHandler),this.editor.removeListener("escape",this.resetHandler),this.resetHandler=null),null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null)},mxEditor.prototype=new mxEventSource,mxEditor.prototype.constructor=mxEditor,mxEditor.prototype.askZoomResource="none"!=mxClient.language?"askZoom":"",mxEditor.prototype.lastSavedResource="none"!=mxClient.language?"lastSaved":"",mxEditor.prototype.currentFileResource="none"!=mxClient.language?"currentFile":"",mxEditor.prototype.propertiesResource="none"!=mxClient.language?"properties":"",mxEditor.prototype.tasksResource="none"!=mxClient.language?"tasks":"",mxEditor.prototype.helpResource="none"!=mxClient.language?"help":"",mxEditor.prototype.outlineResource="none"!=mxClient.language?"outline":"",mxEditor.prototype.outline=null,mxEditor.prototype.graph=null,mxEditor.prototype.graphRenderHint=null,mxEditor.prototype.toolbar=null,mxEditor.prototype.status=null,mxEditor.prototype.popupHandler=null,mxEditor.prototype.undoManager=null,mxEditor.prototype.keyHandler=null,mxEditor.prototype.actions=null,mxEditor.prototype.dblClickAction="edit",mxEditor.prototype.swimlaneRequired=!1,mxEditor.prototype.disableContextMenu=!0,mxEditor.prototype.insertFunction=null,mxEditor.prototype.forcedInserting=!1,mxEditor.prototype.templates=null,mxEditor.prototype.defaultEdge=null,mxEditor.prototype.defaultEdgeStyle=null,mxEditor.prototype.defaultGroup=null,mxEditor.prototype.groupBorderSize=null,mxEditor.prototype.filename=null,mxEditor.prototype.linefeed="&#xa;",mxEditor.prototype.postParameterName="xml",mxEditor.prototype.escapePostData=!0,mxEditor.prototype.urlPost=null,mxEditor.prototype.urlImage=null,mxEditor.prototype.horizontalFlow=!1,mxEditor.prototype.layoutDiagram=!1,mxEditor.prototype.swimlaneSpacing=0,mxEditor.prototype.maintainSwimlanes=!1,mxEditor.prototype.layoutSwimlanes=!1,mxEditor.prototype.cycleAttributeValues=null,mxEditor.prototype.cycleAttributeIndex=0,mxEditor.prototype.cycleAttributeName="fillColor",mxEditor.prototype.tasks=null,mxEditor.prototype.tasksWindowImage=null,mxEditor.prototype.tasksTop=20,mxEditor.prototype.help=null,mxEditor.prototype.helpWindowImage=null,mxEditor.prototype.urlHelp=null,mxEditor.prototype.helpWidth=300,mxEditor.prototype.helpHeight=260,mxEditor.prototype.propertiesWidth=240,mxEditor.prototype.propertiesHeight=null,mxEditor.prototype.movePropertiesDialog=!1,mxEditor.prototype.validating=!1,mxEditor.prototype.modified=!1,mxEditor.prototype.isModified=function(){return this.modified},mxEditor.prototype.setModified=function(t){this.modified=t},mxEditor.prototype.addActions=function(){this.addAction("save",function(t){t.save()}),this.addAction("print",function(t){new mxPrintPreview(t.graph,1).open()}),this.addAction("show",function(t){mxUtils.show(t.graph,null,10,10)}),this.addAction("exportImage",function(t){var e,n=t.getUrlImage();null==n||mxClient.IS_LOCAL?t.execute("show"):(e=mxUtils.getViewXml(t.graph,1),e=mxUtils.getXml(e,"\n"),mxUtils.submit(n,t.postParameterName+"="+encodeURIComponent(e),document,"_blank"))}),this.addAction("refresh",function(t){t.graph.refresh()}),this.addAction("cut",function(t){t.graph.isEnabled()&&mxClipboard.cut(t.graph)}),this.addAction("copy",function(t){t.graph.isEnabled()&&mxClipboard.copy(t.graph)}),this.addAction("paste",function(t){t.graph.isEnabled()&&mxClipboard.paste(t.graph)}),this.addAction("delete",function(t){t.graph.isEnabled()&&t.graph.removeCells()}),this.addAction("group",function(t){t.graph.isEnabled()&&t.graph.setSelectionCell(t.groupCells())}),this.addAction("ungroup",function(t){t.graph.isEnabled()&&t.graph.setSelectionCells(t.graph.ungroupCells())}),this.addAction("removeFromParent",function(t){t.graph.isEnabled()&&t.graph.removeCellsFromParent()}),this.addAction("undo",function(t){t.graph.isEnabled()&&t.undo()}),this.addAction("redo",function(t){t.graph.isEnabled()&&t.redo()}),this.addAction("zoomIn",function(t){t.graph.zoomIn()}),this.addAction("zoomOut",function(t){t.graph.zoomOut()}),this.addAction("actualSize",function(t){t.graph.zoomActual()}),this.addAction("fit",function(t){t.graph.fit()}),this.addAction("showProperties",function(t,e){t.showProperties(e)}),this.addAction("selectAll",function(t){t.graph.isEnabled()&&t.graph.selectAll()}),this.addAction("selectNone",function(t){t.graph.isEnabled()&&t.graph.clearSelection()}),this.addAction("selectVertices",function(t){t.graph.isEnabled()&&t.graph.selectVertices()}),this.addAction("selectEdges",function(t){t.graph.isEnabled()&&t.graph.selectEdges()}),this.addAction("edit",function(t,e){t.graph.isEnabled()&&t.graph.isCellEditable(e)&&t.graph.startEditingAtCell(e)}),this.addAction("toBack",function(t,e){t.graph.isEnabled()&&t.graph.orderCells(!0)}),this.addAction("toFront",function(t,e){t.graph.isEnabled()&&t.graph.orderCells(!1)}),this.addAction("enterGroup",function(t,e){t.graph.enterGroup(e)}),this.addAction("exitGroup",function(t){t.graph.exitGroup()}),this.addAction("home",function(t){t.graph.home()}),this.addAction("selectPrevious",function(t){t.graph.isEnabled()&&t.graph.selectPreviousCell()}),this.addAction("selectNext",function(t){t.graph.isEnabled()&&t.graph.selectNextCell()}),this.addAction("selectParent",function(t){t.graph.isEnabled()&&t.graph.selectParentCell()}),this.addAction("selectChild",function(t){t.graph.isEnabled()&&t.graph.selectChildCell()}),this.addAction("collapse",function(t){t.graph.isEnabled()&&t.graph.foldCells(!0)}),this.addAction("collapseAll",function(t){var e;t.graph.isEnabled()&&(e=t.graph.getChildVertices(),t.graph.foldCells(!0,!1,e))}),this.addAction("expand",function(t){t.graph.isEnabled()&&t.graph.foldCells(!1)}),this.addAction("expandAll",function(t){var e;t.graph.isEnabled()&&(e=t.graph.getChildVertices(),t.graph.foldCells(!1,!1,e))}),this.addAction("bold",function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_BOLD)}),this.addAction("italic",function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_ITALIC)}),this.addAction("underline",function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_UNDERLINE)}),this.addAction("alignCellsLeft",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_LEFT)}),this.addAction("alignCellsCenter",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_CENTER)}),this.addAction("alignCellsRight",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_RIGHT)}),this.addAction("alignCellsTop",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_TOP)}),this.addAction("alignCellsMiddle",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_MIDDLE)}),this.addAction("alignCellsBottom",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_BOTTOM)}),this.addAction("alignFontLeft",function(t){t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT)}),this.addAction("alignFontCenter",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER)}),this.addAction("alignFontRight",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_RIGHT)}),this.addAction("alignFontTop",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP)}),this.addAction("alignFontMiddle",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)}),this.addAction("alignFontBottom",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_BOTTOM)}),this.addAction("zoom",function(t){var e=100*t.graph.getView().scale,e=parseFloat(mxUtils.prompt(mxResources.get(t.askZoomResource)||t.askZoomResource,e))/100;isNaN(e)||t.graph.getView().setScale(e)}),this.addAction("toggleTasks",function(t){null!=t.tasks?t.tasks.setVisible(!t.tasks.isVisible()):t.showTasks()}),this.addAction("toggleHelp",function(t){null!=t.help?t.help.setVisible(!t.help.isVisible()):t.showHelp()}),this.addAction("toggleOutline",function(t){null==t.outline?t.showOutline():t.outline.setVisible(!t.outline.isVisible())}),this.addAction("toggleConsole",function(t){mxLog.setVisible(!mxLog.isVisible())})},mxEditor.prototype.configure=function(t){null!=t&&(new mxCodec(t.ownerDocument).decode(t,this),this.resetHistory())},mxEditor.prototype.resetFirstTime=function(){document.cookie="mxgraph=seen; expires=Fri, 27 Jul 2001 02:47:11 UTC; path=/"},mxEditor.prototype.resetHistory=function(){this.lastSnapshot=(new Date).getTime(),this.undoManager.clear(),this.ignoredChanges=0,this.setModified(!1)},mxEditor.prototype.addAction=function(t,e){this.actions[t]=e},mxEditor.prototype.execute=function(e,t,n){var i=this.actions[e];if(null!=i)try{var l=arguments;l[0]=this,i.apply(this,l)}catch(t){throw mxUtils.error("Cannot execute "+e+": "+t.message,280,!0),t}else mxUtils.error("Cannot find action "+e,280,!0)},mxEditor.prototype.addTemplate=function(t,e){this.templates[t]=e},mxEditor.prototype.getTemplate=function(t){return this.templates[t]},mxEditor.prototype.createGraph=function(){var t=new mxGraph(null,null,this.graphRenderHint);return t.setTooltips(!0),t.setPanning(!0),this.installDblClickHandler(t),this.installUndoHandler(t),this.installDrillHandler(t),this.installChangeHandler(t),this.installInsertHandler(t),t.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(t,e,n){return this.createPopupMenu(t,e,n)}),t.connectionHandler.factoryMethod=mxUtils.bind(this,function(t,e){return this.createEdge(t,e)}),this.createSwimlaneManager(t),this.createLayoutManager(t),t},mxEditor.prototype.createSwimlaneManager=function(t){t=new mxSwimlaneManager(t,!1);return t.isHorizontal=mxUtils.bind(this,function(){return this.horizontalFlow}),t.isEnabled=mxUtils.bind(this,function(){return this.maintainSwimlanes}),t},mxEditor.prototype.createLayoutManager=function(i){var t=new mxLayoutManager(i),l=this;return t.getLayout=function(t){var e=null,n=l.graph.getModel();return null!=n.getParent(t)&&(l.layoutSwimlanes&&i.isSwimlane(t)?(null==l.swimlaneLayout&&(l.swimlaneLayout=l.createSwimlaneLayout()),e=l.swimlaneLayout):l.layoutDiagram&&(i.isValidRoot(t)||null==n.getParent(n.getParent(t)))&&(null==l.diagramLayout&&(l.diagramLayout=l.createDiagramLayout()),e=l.diagramLayout)),e},t},mxEditor.prototype.setGraphContainer=function(t){null==this.graph.container&&(this.graph.init(t),this.rubberband=new mxRubberband(this.graph),this.disableContextMenu&&mxEvent.disableContextMenu(t),mxClient.IS_QUIRKS&&new mxDivResizer(t))},mxEditor.prototype.installDblClickHandler=function(i){i.addListener(mxEvent.DOUBLE_CLICK,mxUtils.bind(this,function(t,e){var n=e.getProperty("cell");null!=n&&i.isEnabled()&&null!=this.dblClickAction&&(this.execute(this.dblClickAction,n),e.consume())}))},mxEditor.prototype.installUndoHandler=function(n){var t=mxUtils.bind(this,function(t,e){e=e.getProperty("edit");this.undoManager.undoableEditHappened(e)});n.getModel().addListener(mxEvent.UNDO,t),n.getView().addListener(mxEvent.UNDO,t);t=function(t,e){e=e.getProperty("edit").changes;n.setSelectionCells(n.getSelectionCellsForChanges(e))};this.undoManager.addListener(mxEvent.UNDO,t),this.undoManager.addListener(mxEvent.REDO,t)},mxEditor.prototype.installDrillHandler=function(t){var e=mxUtils.bind(this,function(t){this.fireEvent(new mxEventObject(mxEvent.ROOT))});t.getView().addListener(mxEvent.DOWN,e),t.getView().addListener(mxEvent.UP,e)},mxEditor.prototype.installChangeHandler=function(s){var t=mxUtils.bind(this,function(t,e){this.setModified(!0),1==this.validating&&s.validateGraph();for(var n=e.getProperty("edit").changes,i=0;i<n.length;i++){var l=n[i];if(l instanceof mxRootChange||l instanceof mxValueChange&&l.cell==this.graph.model.root||l instanceof mxCellAttributeChange&&l.cell==this.graph.model.root){this.fireEvent(new mxEventObject(mxEvent.ROOT));break}}});s.getModel().addListener(mxEvent.CHANGE,t)},mxEditor.prototype.installInsertHandler=function(t){var n=this,e={mouseDown:function(t,e){null==n.insertFunction||e.isPopupTrigger()||!n.forcedInserting&&null!=e.getState()||(n.graph.clearSelection(),n.insertFunction(e.getEvent(),e.getCell()),this.isActive=!0,e.consume())},mouseMove:function(t,e){this.isActive&&e.consume()},mouseUp:function(t,e){this.isActive&&(this.isActive=!1,e.consume())}};t.addMouseListener(e)},mxEditor.prototype.createDiagramLayout=function(){var t=this.graph.gridSize,e=new mxStackLayout(this.graph,!this.horizontalFlow,this.swimlaneSpacing,2*t,2*t);return e.isVertexIgnored=function(t){return!e.graph.isSwimlane(t)},e},mxEditor.prototype.createSwimlaneLayout=function(){return new mxCompactTreeLayout(this.graph,this.horizontalFlow)},mxEditor.prototype.createToolbar=function(){return new mxDefaultToolbar(null,this)},mxEditor.prototype.setToolbarContainer=function(t){this.toolbar.init(t),mxClient.IS_QUIRKS&&new mxDivResizer(t)},mxEditor.prototype.setStatusContainer=function(t){null==this.status&&(this.status=t,this.addListener(mxEvent.SAVE,mxUtils.bind(this,function(){var t=(new Date).toLocaleString();this.setStatus((mxResources.get(this.lastSavedResource)||this.lastSavedResource)+": "+t)})),this.addListener(mxEvent.OPEN,mxUtils.bind(this,function(){this.setStatus((mxResources.get(this.currentFileResource)||this.currentFileResource)+": "+this.filename)})),mxClient.IS_QUIRKS&&new mxDivResizer(t))},mxEditor.prototype.setStatus=function(t){null!=this.status&&null!=t&&(this.status.innerHTML=t)},mxEditor.prototype.setTitleContainer=function(e){this.addListener(mxEvent.ROOT,mxUtils.bind(this,function(t){e.innerHTML=this.getTitle()})),mxClient.IS_QUIRKS&&new mxDivResizer(e)},mxEditor.prototype.treeLayout=function(t,e){null!=t&&new mxCompactTreeLayout(this.graph,e).execute(t)},mxEditor.prototype.getTitle=function(){for(var t="",e=this.graph,n=e.getCurrentRoot();null!=n&&null!=e.getModel().getParent(e.getModel().getParent(n));)e.isValidRoot(n)&&(t=" > "+e.convertValueToString(n)+t),n=e.getModel().getParent(n);return this.getRootTitle()+t},mxEditor.prototype.getRootTitle=function(){var t=this.graph.getModel().getRoot();return this.graph.convertValueToString(t)},mxEditor.prototype.undo=function(){this.undoManager.undo()},mxEditor.prototype.redo=function(){this.undoManager.redo()},mxEditor.prototype.groupCells=function(){var t=null!=this.groupBorderSize?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),t)},mxEditor.prototype.createGroup=function(){return this.graph.getModel().cloneCell(this.defaultGroup)},mxEditor.prototype.open=function(t){var e;null!=t&&(e=mxUtils.load(t).getXml(),this.readGraphModel(e.documentElement),this.filename=t,this.fireEvent(new mxEventObject(mxEvent.OPEN,"filename",t)))},mxEditor.prototype.readGraphModel=function(t){new mxCodec(t.ownerDocument).decode(t,this.graph.getModel()),this.resetHistory()},mxEditor.prototype.save=function(t,e){null!=(t=t||this.getUrlPost())&&0<t.length&&(e=this.writeGraphModel(e),this.postDiagram(t,e),this.setModified(!1)),this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",t))},mxEditor.prototype.postDiagram=function(e,n){this.escapePostData&&(n=encodeURIComponent(n)),mxUtils.post(e,this.postParameterName+"="+n,mxUtils.bind(this,function(t){this.fireEvent(new mxEventObject(mxEvent.POST,"request",t,"url",e,"data",n))}))},mxEditor.prototype.writeGraphModel=function(t){t=null!=t?t:this.linefeed;var e=(new mxCodec).encode(this.graph.getModel());return mxUtils.getXml(e,t)},mxEditor.prototype.getUrlPost=function(){return this.urlPost},mxEditor.prototype.getUrlImage=function(){return this.urlImage},mxEditor.prototype.swapStyles=function(t,e){var n=this.graph.getStylesheet().styles[e];this.graph.getView().getStylesheet().putCellStyle(e,this.graph.getStylesheet().styles[t]),this.graph.getStylesheet().putCellStyle(t,n),this.graph.refresh()},mxEditor.prototype.showProperties=function(t){var e,n,i;null==(t=t||this.graph.getSelectionCell())&&null==(t=this.graph.getCurrentRoot())&&(t=this.graph.getModel().getRoot()),null!=t&&(this.graph.stopEditing(!0),e=(i=mxUtils.getOffset(this.graph.container)).x+10,n=i.y,null==this.properties||this.movePropertiesDialog?null!=(i=this.graph.getCellBounds(t))&&(e+=i.x+Math.min(200,i.width),n+=i.y):(e=this.properties.getX(),n=this.properties.getY()),this.hideProperties(),null!=(t=this.createProperties(t))&&(this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,t,e,n,this.propertiesWidth,this.propertiesHeight,!1),this.properties.setVisible(!0)))},mxEditor.prototype.isPropertiesVisible=function(){return null!=this.properties},mxEditor.prototype.createProperties=function(n){var i=this.graph.getModel(),t=i.getValue(n);if(mxUtils.isNode(t)){var e=new mxForm("properties");e.addText("ID",n.getId()).setAttribute("readonly","true");var l=null,s=null,o=null,r=null,a=null;i.isVertex(n)&&null!=(l=i.getGeometry(n))&&(s=e.addText("top",l.y),o=e.addText("left",l.x),r=e.addText("width",l.width),a=e.addText("height",l.height));for(var h=i.getStyle(n),d=e.addText("Style",h||""),u=t.attributes,p=[],m=0;m<u.length;m++){var c=u[m].value;p[m]=e.addTextarea(u[m].nodeName,c,"label"==u[m].nodeName?4:2)}h=mxUtils.bind(this,function(){this.hideProperties(),i.beginUpdate();try{null!=l&&((l=l.clone()).x=parseFloat(o.value),l.y=parseFloat(s.value),l.width=parseFloat(r.value),l.height=parseFloat(a.value),i.setGeometry(n,l)),0<d.value.length?i.setStyle(n,d.value):i.setStyle(n,null);for(var t=0;t<u.length;t++){var e=new mxCellAttributeChange(n,u[t].nodeName,p[t].value);i.execute(e)}this.graph.isAutoSizeCell(n)&&this.graph.updateCellSize(n)}finally{i.endUpdate()}}),t=mxUtils.bind(this,function(){this.hideProperties()});return e.addButtons(h,t),e.table}return null},mxEditor.prototype.hideProperties=function(){null!=this.properties&&(this.properties.destroy(),this.properties=null)},mxEditor.prototype.showTasks=function(){var e,t,n;null==this.tasks&&((e=document.createElement("div")).style.padding="4px",e.style.paddingLeft="20px",n=document.body.clientWidth,(t=new mxWindow(mxResources.get(this.tasksResource)||this.tasksResource,e,n-220,this.tasksTop,200)).setClosable(!0),t.destroyOnClose=!1,n=mxUtils.bind(this,function(t){mxEvent.release(e),e.innerHTML="",this.createTasks(e)}),this.graph.getModel().addListener(mxEvent.CHANGE,n),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,n),this.graph.addListener(mxEvent.ROOT,n),null!=this.tasksWindowImage&&t.setImage(this.tasksWindowImage),this.tasks=t,this.createTasks(e)),this.tasks.setVisible(!0)},mxEditor.prototype.refreshTasks=function(t){null!=this.tasks&&(t=this.tasks.content,mxEvent.release(t),t.innerHTML="",this.createTasks(t))},mxEditor.prototype.createTasks=function(t){},mxEditor.prototype.showHelp=function(t){var n,e,i,l;null==this.help&&((n=document.createElement("iframe")).setAttribute("src",mxResources.get("urlHelp")||this.urlHelp),n.setAttribute("height","100%"),n.setAttribute("width","100%"),n.setAttribute("frameBorder","0"),n.style.backgroundColor="white",e=document.body.clientWidth,l=document.body.clientHeight||document.documentElement.clientHeight,(i=new mxWindow(mxResources.get(this.helpResource)||this.helpResource,n,(e-this.helpWidth)/2,(l-this.helpHeight)/3,this.helpWidth,this.helpHeight)).setMaximizable(!0),i.setClosable(!0),i.destroyOnClose=!1,i.setResizable(!0),null!=this.helpWindowImage&&i.setImage(this.helpWindowImage),mxClient.IS_NS&&(l=function(t){var e=i.div.offsetHeight;n.setAttribute("height",e-26+"px")},i.addListener(mxEvent.RESIZE_END,l),i.addListener(mxEvent.MAXIMIZE,l),i.addListener(mxEvent.NORMALIZE,l),i.addListener(mxEvent.SHOW,l)),this.help=i),this.help.setVisible(!0)},mxEditor.prototype.showOutline=function(){var t,e,n;null==this.outline&&((t=document.createElement("div")).style.overflow="hidden",t.style.position="relative",t.style.width="100%",t.style.height="100%",t.style.background="white",t.style.cursor="move",8==document.documentMode&&(t.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=100)"),e=new mxWindow(mxResources.get(this.outlineResource)||this.outlineResource,t,600,480,200,200,!1),n=new mxOutline(this.graph,t),e.setClosable(!0),e.setResizable(!0),e.destroyOnClose=!1,e.addListener(mxEvent.RESIZE_END,function(){n.update()}),this.outline=e,this.outline.outline=n),this.outline.setVisible(!0),this.outline.outline.update(!0)},mxEditor.prototype.setMode=function(t){"select"==t?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!1)):"connect"==t?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!0)):"pan"==t&&(this.graph.panningHandler.useLeftButtonForPanning=!0,this.graph.setConnectable(!1))},mxEditor.prototype.createPopupMenu=function(t,e,n){this.popupHandler.createMenu(this,t,e,n)},mxEditor.prototype.createEdge=function(t,e){var n=null;null!=this.defaultEdge?n=this.graph.getModel().cloneCell(this.defaultEdge):((n=new mxCell("")).setEdge(!0),(i=new mxGeometry).relative=!0,n.setGeometry(i));var i=this.getEdgeStyle();return null!=i&&n.setStyle(i),n},mxEditor.prototype.getEdgeStyle=function(){return this.defaultEdgeStyle},mxEditor.prototype.consumeCycleAttribute=function(t){return null!=this.cycleAttributeValues&&0<this.cycleAttributeValues.length&&this.graph.isSwimlane(t)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null},mxEditor.prototype.cycleAttribute=function(t){var e;null==this.cycleAttributeName||null!=(e=this.consumeCycleAttribute(t))&&t.setStyle(t.getStyle()+";"+this.cycleAttributeName+"="+e)},mxEditor.prototype.addVertex=function(t,e,n,i){for(var l=this.graph.getModel();null!=t&&!this.graph.isValidDropTarget(t);)t=l.getParent(t);t=null!=t?t:this.graph.getSwimlaneAt(n,i);var s,o,r,a,h=this.graph.getView().scale,d=l.getGeometry(e),u=l.getGeometry(t);if(this.graph.isSwimlane(e)&&!this.graph.swimlaneNesting)t=null;else{if(null==t&&this.swimlaneRequired)return null;null!=t&&null!=u&&(null!=(s=this.graph.getView().getState(t))?(n-=s.origin.x*h,i-=s.origin.y*h,this.graph.isConstrainedMoving&&(o=d.width,r=d.height,(a=s.x+s.width)<n+o&&(n-=n+o-a),(a=s.y+s.height)<i+r&&(i-=i+r-a))):null!=u&&(n-=u.x*h,i-=u.y*h))}(d=d.clone()).x=this.graph.snap(n/h-this.graph.getView().translate.x-this.graph.gridSize/2),d.y=this.graph.snap(i/h-this.graph.getView().translate.y-this.graph.gridSize/2),e.setGeometry(d),null==t&&(t=this.graph.getDefaultParent()),this.cycleAttribute(e),this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",e,"parent",t)),l.beginUpdate();try{null!=(e=this.graph.addCell(e,t))&&(this.graph.constrainChild(e),this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",e)))}finally{l.endUpdate()}return null!=e&&(this.graph.setSelectionCell(e),this.graph.scrollCellToVisible(e),this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",e))),e},mxEditor.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tasks&&this.tasks.destroy(),null!=this.outline&&this.outline.destroy(),null!=this.properties&&this.properties.destroy(),null!=this.keyHandler&&this.keyHandler.destroy(),null!=this.rubberband&&this.rubberband.destroy(),null!=this.toolbar&&this.toolbar.destroy(),null!=this.graph&&this.graph.destroy(),this.status=null,this.templates=null)};var mxCodecRegistry={codecs:[],aliases:[],register:function(t){var e,n;return null!=t&&(e=t.getName(),mxCodecRegistry.codecs[e]=t,(n=mxUtils.getFunctionName(t.template.constructor))!=e&&mxCodecRegistry.addAlias(n,e)),t},addAlias:function(t,e){mxCodecRegistry.aliases[t]=e},getCodec:function(t){var e=null;if(null!=t){var n=mxUtils.getFunctionName(t),i=mxCodecRegistry.aliases[n];if(null!=i&&(n=i),null==(e=mxCodecRegistry.codecs[n]))try{e=new mxObjectCodec(new t),mxCodecRegistry.register(e)}catch(t){}}return e}};function mxCodec(t){this.document=t||mxUtils.createXmlDocument(),this.objects=[]}function mxObjectCodec(t,e,n,i){for(var l in this.template=t,this.exclude=null!=e?e:[],this.idrefs=null!=n?n:[],this.mapping=null!=i?i:[],this.reverse=new Object,this.mapping)this.reverse[this.mapping[l]]=l}mxCodec.prototype.document=null,mxCodec.prototype.objects=null,mxCodec.prototype.elements=null,mxCodec.prototype.encodeDefaults=!1,mxCodec.prototype.putObject=function(t,e){return this.objects[t]=e},mxCodec.prototype.getObject=function(t){var e=null;return null!=t&&null==(e=this.objects[t])&&(null!=(e=this.lookup(t))||null!=(t=this.getElementById(t))&&(e=this.decode(t))),e},mxCodec.prototype.lookup=function(t){return null},mxCodec.prototype.getElementById=function(t){return this.updateElements(),this.elements[t]},mxCodec.prototype.updateElements=function(){null==this.elements&&(this.elements=new Object,null!=this.document.documentElement&&this.addElement(this.document.documentElement))},mxCodec.prototype.addElement=function(t){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var e=t.getAttribute("id");if(null!=e)if(null==this.elements[e])this.elements[e]=t;else if(this.elements[e]!=t)throw new Error(e+": Duplicate ID")}for(t=t.firstChild;null!=t;)this.addElement(t),t=t.nextSibling},mxCodec.prototype.getId=function(t){var e=null;return null!=t&&null==(e=this.reference(t))&&t instanceof mxCell&&null==(e=t.getId())&&0==(e=mxCellPath.create(t)).length&&(e="root"),e},mxCodec.prototype.reference=function(t){return null},mxCodec.prototype.encode=function(t){var e,n=null;return null!=t&&null!=t.constructor&&(null!=(e=mxCodecRegistry.getCodec(t.constructor))?n=e.encode(this,t):mxUtils.isNode(t)?n=mxUtils.importNode(this.document,t,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(t.constructor))),n},mxCodec.prototype.decode=function(t,e){this.updateElements();var n=null;if(null!=t&&t.nodeType==mxConstants.NODETYPE_ELEMENT){var i=null;try{i=window[t.nodeName]}catch(t){}var l=mxCodecRegistry.getCodec(i);null!=l?n=l.decode(this,t,e):(n=t.cloneNode(!0)).removeAttribute("as")}return n},mxCodec.prototype.encodeCell=function(t,e,n){if(e.appendChild(this.encode(t)),null==n||n)for(var i=t.getChildCount(),l=0;l<i;l++)this.encodeCell(t.getChildAt(l),e)},mxCodec.prototype.isCellCodec=function(t){return null!=t&&"function"==typeof t.isCellCodec&&t.isCellCodec()},mxCodec.prototype.decodeCell=function(t,e){e=null==e||e;var n=null;if(null!=t&&t.nodeType==mxConstants.NODETYPE_ELEMENT){var i=mxCodecRegistry.getCodec(t.nodeName);if(!this.isCellCodec(i))for(var l=t.firstChild;null!=l&&!this.isCellCodec(i);)i=mxCodecRegistry.getCodec(l.nodeName),l=l.nextSibling;this.isCellCodec(i)||(i=mxCodecRegistry.getCodec(mxCell)),n=i.decode(this,t),e&&this.insertIntoGraph(n)}return n},mxCodec.prototype.insertIntoGraph=function(t){var e=t.parent,n=t.getTerminal(!0),i=t.getTerminal(!1);if(t.setTerminal(null,!1),t.setTerminal(null,!0),(t.parent=null)!=e){if(e==t)throw new Error(e.id+": Self Reference");e.insert(t)}null!=n&&n.insertEdge(t,!0),null!=i&&i.insertEdge(t,!1)},mxCodec.prototype.setAttribute=function(t,e,n){null!=e&&null!=n&&t.setAttribute(e,n)},mxObjectCodec.allowEval=!1,mxObjectCodec.prototype.template=null,mxObjectCodec.prototype.exclude=null,mxObjectCodec.prototype.idrefs=null,mxObjectCodec.prototype.mapping=null,mxObjectCodec.prototype.reverse=null,mxObjectCodec.prototype.getName=function(){return mxUtils.getFunctionName(this.template.constructor)},mxObjectCodec.prototype.cloneTemplate=function(){return new this.template.constructor},mxObjectCodec.prototype.getFieldName=function(t){var e;return null==t||null!=(e=this.reverse[t])&&(t=e),t},mxObjectCodec.prototype.getAttributeName=function(t){var e;return null==t||null!=(e=this.mapping[t])&&(t=e),t},mxObjectCodec.prototype.isExcluded=function(t,e,n,i){return e==mxObjectIdentity.FIELD_NAME||0<=mxUtils.indexOf(this.exclude,e)},mxObjectCodec.prototype.isReference=function(t,e,n,i){return 0<=mxUtils.indexOf(this.idrefs,e)},mxObjectCodec.prototype.encode=function(t,e){var n=t.document.createElement(this.getName());return e=this.beforeEncode(t,e,n),this.encodeObject(t,e,n),this.afterEncode(t,e,n)},mxObjectCodec.prototype.encodeObject=function(t,e,n){for(var i in t.setAttribute(n,"id",t.getId(e)),e){var l=i,s=e[l];null==s||this.isExcluded(e,l,s,!0)||(mxUtils.isInteger(l)&&(l=null),this.encodeValue(t,e,l,s,n))}},mxObjectCodec.prototype.encodeValue=function(t,e,n,i,l){if(null!=i){if(this.isReference(e,n,i,!0)){var s=t.getId(i);if(null==s)return void mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+n+"="+i);i=s}s=this.template[n];null!=n&&!t.encodeDefaults&&s==i||(n=this.getAttributeName(n),this.writeAttribute(t,e,n,i,l))}},mxObjectCodec.prototype.writeAttribute=function(t,e,n,i,l){"object"!=typeof i?this.writePrimitiveAttribute(t,e,n,i,l):this.writeComplexAttribute(t,e,n,i,l)},mxObjectCodec.prototype.writePrimitiveAttribute=function(t,e,n,i,l){i=this.convertAttributeToXml(t,e,n,i,l),null==n?(e=t.document.createElement("add"),"function"==typeof i?e.appendChild(t.document.createTextNode(i)):t.setAttribute(e,"value",i),l.appendChild(e)):"function"!=typeof i&&t.setAttribute(l,n,i)},mxObjectCodec.prototype.writeComplexAttribute=function(t,e,n,i,l){t=t.encode(i);null!=t?(null!=n&&t.setAttribute("as",n),l.appendChild(t)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+n+": "+i)},mxObjectCodec.prototype.convertAttributeToXml=function(t,e,n,i){return this.isBooleanAttribute(t,e,n,i)&&(i=1==i?"1":"0"),i},mxObjectCodec.prototype.isBooleanAttribute=function(t,e,n,i){return void 0===i.length&&(1==i||0==i)},mxObjectCodec.prototype.convertAttributeFromXml=function(t,e,n){var i=e.value;return this.isNumericAttribute(t,e,n)&&(i=parseFloat(i),!isNaN(i)&&isFinite(i)||(i=0)),i},mxObjectCodec.prototype.isNumericAttribute=function(t,e,n){return n.constructor==mxGeometry&&("x"==e.name||"y"==e.name||"width"==e.name||"height"==e.name)||n.constructor==mxPoint&&("x"==e.name||"y"==e.name)||mxUtils.isNumeric(e.value)},mxObjectCodec.prototype.beforeEncode=function(t,e,n){return e},mxObjectCodec.prototype.afterEncode=function(t,e,n){return n},mxObjectCodec.prototype.decode=function(t,e,n){var i=e.getAttribute("id"),l=t.objects[i];return null==l&&(l=n||this.cloneTemplate(),null!=i&&t.putObject(i,l)),e=this.beforeDecode(t,e,l),this.decodeNode(t,e,l),this.afterDecode(t,e,l)},mxObjectCodec.prototype.decodeNode=function(t,e,n){null!=e&&(this.decodeAttributes(t,e,n),this.decodeChildren(t,e,n))},mxObjectCodec.prototype.decodeAttributes=function(t,e,n){var i=e.attributes;if(null!=i)for(var l=0;l<i.length;l++)this.decodeAttribute(t,i[l],n)},mxObjectCodec.prototype.isIgnoredAttribute=function(t,e,n){return"as"==e.nodeName||"id"==e.nodeName},mxObjectCodec.prototype.decodeAttribute=function(t,e,n){if(!this.isIgnoredAttribute(t,e,n)){var i=e.nodeName,l=this.convertAttributeFromXml(t,e,n),e=this.getFieldName(i);if(this.isReference(n,e,l,!1)){t=t.getObject(l);if(null==t)return void mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+i+"="+l);l=t}this.isExcluded(n,i,l,!1)||(n[i]=l)}},mxObjectCodec.prototype.decodeChildren=function(t,e,n){for(var i=e.firstChild;null!=i;){var l=i.nextSibling;i.nodeType!=mxConstants.NODETYPE_ELEMENT||this.processInclude(t,i,n)||this.decodeChild(t,i,n),i=l}},mxObjectCodec.prototype.decodeChild=function(t,e,n){var i=this.getFieldName(e.getAttribute("as"));if(null==i||!this.isExcluded(n,i,e,!1)){var l=this.getFieldTemplate(n,i,e),s=null;"add"==e.nodeName?null==(s=e.getAttribute("value"))&&mxObjectCodec.allowEval&&(s=mxUtils.eval(mxUtils.getTextContent(e))):s=t.decode(e,l);try{this.addObjectValue(n,i,s,l)}catch(t){throw new Error(t.message+" for "+e.nodeName)}}},mxObjectCodec.prototype.getFieldTemplate=function(t,e,n){e=t[e];return e instanceof Array&&0<e.length&&(e=null),e},mxObjectCodec.prototype.addObjectValue=function(t,e,n,i){null!=n&&n!=i&&(null!=e&&0<e.length?t[e]=n:t.push(n))},mxObjectCodec.prototype.processInclude=function(t,e,n){if("include"!=e.nodeName)return!1;var i=e.getAttribute("name");if(null!=i)try{var l=mxUtils.load(i).getDocumentElement();null!=l&&t.decode(l,n)}catch(t){}return!0},mxObjectCodec.prototype.beforeDecode=function(t,e,n){return e},mxObjectCodec.prototype.afterDecode=function(t,e,n){return n},mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);return t.isCellCodec=function(){return!0},t.isNumericAttribute=function(t,e,n){return"value"!==e.nodeName&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)},t.isExcluded=function(t,e,n,i){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||i&&"value"==e&&n.nodeType==mxConstants.NODETYPE_ELEMENT},t.afterEncode=function(t,e,n){var i;return null!=e.value&&e.value.nodeType==mxConstants.NODETYPE_ELEMENT&&(i=n,(n=mxUtils.importNode(t.document,e.value,!0)).appendChild(i),e=i.getAttribute("id"),n.setAttribute("id",e),i.removeAttribute("id")),n},t.beforeDecode=function(t,e,n){var i=e.cloneNode(!0),l=this.getName();if(e.nodeName!=l?(i=null!=(l=e.getElementsByTagName(l)[0])&&l.parentNode==e?(mxUtils.removeWhitespace(l,!0),mxUtils.removeWhitespace(l,!1),l.parentNode.removeChild(l),l):null,n.value=e.cloneNode(!0),null!=(l=n.value.getAttribute("id"))&&(n.setId(l),n.value.removeAttribute("id"))):n.setId(e.getAttribute("id")),null!=i)for(var s=0;s<this.idrefs.length;s++){var o,r=this.idrefs[s],a=i.getAttribute(r);null!=a&&(i.removeAttribute(r),null!=(o=t.objects[a]||t.lookup(a))||null!=(a=t.getElementById(a))&&(o=(mxCodecRegistry.codecs[a.nodeName]||this).decode(t,a)),n[r]=o)}return i},t}()),mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxGraphModel);return t.encodeObject=function(t,e,n){var i=t.document.createElement("root");t.encodeCell(e.getRoot(),i),n.appendChild(i)},t.decodeChild=function(t,e,n){"root"==e.nodeName?this.decodeRoot(t,e,n):mxObjectCodec.prototype.decodeChild.apply(this,arguments)},t.decodeRoot=function(t,e,n){for(var i=null,l=e.firstChild;null!=l;){var s=t.decodeCell(l);null!=s&&null==s.getParent()&&(i=s),l=l.nextSibling}null!=i&&n.setRoot(i)},t}()),mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxRootChange,["model","previous","root"]);return t.afterEncode=function(t,e,n){return t.encodeCell(e.root,n),n},t.beforeDecode=function(t,e,n){if(null!=e.firstChild&&e.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var i=(e=e.cloneNode(!0)).firstChild;n.root=t.decodeCell(i,!1);var l=i.nextSibling;for(i.parentNode.removeChild(i),i=l;null!=i;)l=i.nextSibling,t.decodeCell(i),i.parentNode.removeChild(i),i=l}return e},t.afterDecode=function(t,e,n){return n.previous=n.root,n},t}()),mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxChildChange,["model","child","previousIndex"],["parent","previous"]);return t.isReference=function(t,e,n,i){return!("child"!=e||i&&!t.model.contains(t.previous))||0<=mxUtils.indexOf(this.idrefs,e)},t.isExcluded=function(t,e,n,i){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||i&&null!=n&&("previous"==e||"parent"==e)&&!t.model.contains(n)},t.afterEncode=function(t,e,n){return this.isReference(e,"child",e.child,!0)?n.setAttribute("child",t.getId(e.child)):t.encodeCell(e.child,n),n},t.beforeDecode=function(t,e,n){if(null!=e.firstChild&&e.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var i=(e=e.cloneNode(!0)).firstChild;n.child=t.decodeCell(i,!1);var l=i.nextSibling;for(i.parentNode.removeChild(i),i=l;null!=i;){var s,l=i.nextSibling;i.nodeType==mxConstants.NODETYPE_ELEMENT&&(s=i.getAttribute("id"),null==t.lookup(s)&&t.decodeCell(i)),i.parentNode.removeChild(i),i=l}}else{var o=e.getAttribute("child");n.child=t.getObject(o)}return e},t.afterDecode=function(t,e,n){return null!=n.child&&(null!=n.child.parent&&null!=n.previous&&n.child.parent!=n.previous&&(n.previous=n.child.parent),n.child.parent=n.previous,n.previous=n.parent,n.previousIndex=n.index),n},t}()),mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);return t.afterDecode=function(t,e,n){return n.previous=n.terminal,n},t}());var mxGenericChangeCodec=function(t,i){t=new mxObjectCodec(t,["model","previous"],["cell"]);return t.afterDecode=function(t,e,n){return mxUtils.isNode(n.cell)&&(n.cell=t.decodeCell(n.cell,!1)),n.previous=n[i],n},t};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value")),mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style")),mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed")),mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value")),mxCodecRegistry.register(new mxObjectCodec(new mxGraph,["graphListeners","eventListeners","view","container","cellRenderer","editor","selection"])),mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxGraphView);return t.encode=function(t,e){return this.encodeCell(t,e,e.graph.getModel().getRoot())},t.encodeCell=function(t,e,n){var i=e.graph.getModel(),l=e.getState(n),s=i.getParent(n);if(null==s||null!=l){var o=i.getChildCount(n),r=e.graph.getCellGeometry(n),a=null;if(s==i.getRoot()?a="layer":null==s?a="graph":i.isEdge(n)?a="edge":0<o&&null!=r?a="group":i.isVertex(n)&&(a="vertex"),null!=a){var h=t.document.createElement(a);if(null!=e.graph.getLabel(n)&&(h.setAttribute("label",e.graph.getLabel(n)),e.graph.isHtmlLabel(n)&&h.setAttribute("html",!0)),null==s){s=e.getGraphBounds();null!=s&&(h.setAttribute("x",Math.round(s.x)),h.setAttribute("y",Math.round(s.y)),h.setAttribute("width",Math.round(s.width)),h.setAttribute("height",Math.round(s.height))),h.setAttribute("scale",e.scale)}else if(null!=l&&null!=r){for(var d in l.style){var u=l.style[d];"function"==typeof u&&"object"==typeof u&&(u=mxStyleRegistry.getName(u)),null!=u&&"function"!=typeof u&&"object"!=typeof u&&h.setAttribute(d,u)}var p=l.absolutePoints;if(null!=p&&0<p.length){for(var m=Math.round(p[0].x)+","+Math.round(p[0].y),d=1;d<p.length;d++)m+=" "+Math.round(p[d].x)+","+Math.round(p[d].y);h.setAttribute("points",m)}else h.setAttribute("x",Math.round(l.x)),h.setAttribute("y",Math.round(l.y)),h.setAttribute("width",Math.round(l.width)),h.setAttribute("height",Math.round(l.height));r=l.absoluteOffset;null!=r&&(0!=r.x&&h.setAttribute("dx",Math.round(r.x)),0!=r.y&&h.setAttribute("dy",Math.round(r.y)))}for(d=0;d<o;d++){var c=this.encodeCell(t,e,i.getChildAt(n,d));null!=c&&h.appendChild(c)}}}return h},t}());var mxStylesheetCodec=mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxStylesheet);return t.encode=function(t,e){var n,i=t.document.createElement(this.getName());for(n in e.styles){var l=e.styles[n],s=t.document.createElement("add");if(null!=n){for(var o in s.setAttribute("as",n),l){var r,a=this.getStringValue(o,l[o]);null!=a&&((r=t.document.createElement("add")).setAttribute("value",a),r.setAttribute("as",o),s.appendChild(r))}0<s.childNodes.length&&i.appendChild(s)}}return i},t.getStringValue=function(t,e){var n=typeof e;return"function"==n?e=mxStyleRegistry.getName(e):"object"==n&&(e=null),e},t.decode=function(t,e,n){var i=n||new this.template.constructor,n=e.getAttribute("id");for(null!=n&&(t.objects[n]=i),e=e.firstChild;null!=e;){if(!this.processInclude(t,e,i)&&"add"==e.nodeName){var l=e.getAttribute("as");if(null!=l){var s=e.getAttribute("extend"),o=null!=s?mxUtils.clone(i.styles[s]):null;null==o&&(null!=s&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+s+" not found to extend"),o=new Object);for(var r,a,h,d=e.firstChild;null!=d;)d.nodeType==mxConstants.NODETYPE_ELEMENT&&(r=d.getAttribute("as"),"add"==d.nodeName?((h=null)!=(a=mxUtils.getTextContent(d))&&0<a.length&&mxStylesheetCodec.allowEval?h=mxUtils.eval(a):(h=d.getAttribute("value"),mxUtils.isNumeric(h)&&(h=parseFloat(h))),null!=h&&(o[r]=h)):"remove"==d.nodeName&&delete o[r]),d=d.nextSibling;i.putCellStyle(l,o)}}e=e.nextSibling}return i},t}());mxStylesheetCodec.allowEval=!0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultKeyHandler);return t.encode=function(t,e){return null},t.decode=function(t,e,n){if(null!=n){var i,l,s;n.editor;for(e=e.firstChild;null!=e;)this.processInclude(t,e,n)||"add"!=e.nodeName||(i=e.getAttribute("as"),l=e.getAttribute("action"),s=e.getAttribute("control"),n.bindAction(i,l,s)),e=e.nextSibling}return n},t}());var mxDefaultToolbarCodec=mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultToolbar);return t.encode=function(t,e){return null},t.decode=function(t,e,n){if(null!=n){var i=n.editor;for(e=e.firstChild;null!=e;){if(e.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(t,e,n))if("separator"==e.nodeName)n.addSeparator();else if("br"==e.nodeName)n.toolbar.addBreak();else if("hr"==e.nodeName)n.toolbar.addLine();else if("add"==e.nodeName){var l=e.getAttribute("as"),l=mxResources.get(l)||l,s=e.getAttribute("icon"),o=e.getAttribute("pressedIcon"),r=e.getAttribute("action"),a=e.getAttribute("mode"),h=e.getAttribute("template"),d="0"!=e.getAttribute("toggle"),u=mxUtils.getTextContent(e),p=null;if(null!=r)p=n.addItem(l,s,r,o);else if(null!=a)var m=mxDefaultToolbarCodec.allowEval?mxUtils.eval(u):null,p=n.addMode(l,s,a,o,m);else if(null!=h||null!=u&&0<u.length){r=i.templates[h],a=e.getAttribute("style");null!=r&&null!=a&&(r=i.graph.cloneCell(r)).setStyle(a);a=null;null!=u&&0<u.length&&mxDefaultToolbarCodec.allowEval&&(a=mxUtils.eval(u)),p=n.addPrototype(l,s,r,o,a,d)}else{var c=mxUtils.getChildNodes(e);if(0<c.length)if(null==s)for(var g,x=n.addActionCombo(l),y=0;y<c.length;y++)"separator"==(v=c[y]).nodeName?n.addOption(x,"---"):"add"==v.nodeName&&(E=v.getAttribute("as"),g=v.getAttribute("action"),n.addActionOption(x,E,g));else{var f=null,C=n.addPrototype(l,s,function(){var t=i.templates[f.value];if(null==t)return mxLog.warn("Template "+t+" not found"),null;var e=t.clone(),t=f.options[f.selectedIndex].cellStyle;return null!=t&&e.setStyle(t),e},null,null,d),f=n.addCombo();mxEvent.addListener(f,"change",function(){n.toolbar.selectMode(C,function(t){t=mxUtils.convertPoint(i.graph.container,mxEvent.getClientX(t),mxEvent.getClientY(t));return i.addVertex(null,m(),t.x,t.y)}),n.toolbar.noReset=!1});for(var v,E,S,y=0;y<c.length;y++)"separator"==(v=c[y]).nodeName?n.addOption(f,"---"):"add"==v.nodeName&&(E=v.getAttribute("as"),S=v.getAttribute("template"),n.addOption(f,E,S||h).cellStyle=v.getAttribute("style"))}}null==p||null!=(d=e.getAttribute("id"))&&0<d.length&&p.setAttribute("id",d)}e=e.nextSibling}}return n},t}());function ChangeGridColor(t,e){this.ui=t,this.color=e}function ChangePageSetup(t,e,n,i,l){this.ui=t,this.color=e,this.previousColor=e,this.image=n,this.previousImage=n,this.format=i,this.previousFormat=i,this.pageScale=l,this.previousPageScale=l,this.ignoreColor=!1,this.ignoreImage=!1}function Dialog(e,n,i,l,t,s,o,r,a,h,d){var u=0;mxClient.IS_VML&&(null==document.documentMode||document.documentMode<8)&&(u=80);var p=i+=u,m=l+=u,c=mxUtils.getDocumentSize();null!=window.innerHeight&&(c.height=window.innerHeight);var g=c.height,x=Math.max(1,Math.round((c.width-i-64)/2)),y=Math.max(1,Math.round((g-l-e.footerHeight)/3));mxClient.IS_QUIRKS||(n.style.maxHeight="100%"),i=null!=document.body?Math.min(i,document.body.scrollWidth-64):i,l=Math.min(l,g-64),0<e.dialogs.length&&(this.zIndex+=2*e.dialogs.length),null==this.bg&&(this.bg=e.createDiv("background"),this.bg.style.position="absolute",this.bg.style.background=Dialog.backdropColor,this.bg.style.height=g+"px",this.bg.style.right="0px",this.bg.style.zIndex=this.zIndex-2,mxUtils.setOpacity(this.bg,this.bgOpacity),mxClient.IS_QUIRKS&&new mxDivResizer(this.bg));c=mxUtils.getDocumentScrollOrigin(document);this.bg.style.left=c.x+"px",this.bg.style.top=c.y+"px",x+=c.x,y+=c.y,t&&document.body.appendChild(this.bg);var f,C=e.createDiv(a?"geTransDialog":"geDialog"),a=this.getPosition(x,y,i,l),x=a.x,y=a.y;C.style.width=i+"px",C.style.height=l+"px",C.style.left=x+"px",C.style.top=y+"px",C.style.zIndex=this.zIndex,C.appendChild(n),document.body.appendChild(C),!r&&n.clientHeight>C.clientHeight-64&&(n.style.overflowY="auto"),s&&((s=document.createElement("img")).setAttribute("src",Dialog.prototype.closeImage),s.setAttribute("title",mxResources.get("close")),s.className="geDialogClose",s.style.top=y+14+"px",s.style.left=x+i+38-u+"px",s.style.zIndex=this.zIndex,mxEvent.addListener(s,"click",mxUtils.bind(this,function(){e.hideDialog(!0)})),document.body.appendChild(s),this.dialogImg=s,d||(f=!1,mxEvent.addGestureListeners(this.bg,mxUtils.bind(this,function(t){f=!0}),null,mxUtils.bind(this,function(t){f&&(e.hideDialog(!0),f=!1)})))),this.resizeListener=mxUtils.bind(this,function(){null==h||null!=(t=h())&&(p=i=t.w,m=l=t.h);var t=mxUtils.getDocumentSize();g=t.height,this.bg.style.height=g+"px",x=Math.max(1,Math.round((t.width-i-64)/2)),y=Math.max(1,Math.round((g-l-e.footerHeight)/3)),i=null!=document.body?Math.min(p,document.body.scrollWidth-64):p,l=Math.min(m,g-64);t=this.getPosition(x,y,i,l);x=t.x,y=t.y,C.style.left=x+"px",C.style.top=y+"px",C.style.width=i+"px",C.style.height=l+"px",!r&&n.clientHeight>C.clientHeight-64&&(n.style.overflowY="auto"),null!=this.dialogImg&&(this.dialogImg.style.top=y+14+"px",this.dialogImg.style.left=x+i+38-u+"px")}),mxEvent.addListener(window,"resize",this.resizeListener),this.onDialogClose=o,this.container=C,e.editor.fireEvent(new mxEventObject("showDialog"))}mxDefaultToolbarCodec.allowEval=!0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultPopupMenu);return t.encode=function(t,e){return null},t.decode=function(t,e,n){var i=e.getElementsByTagName("include")[0];return null!=i?this.processInclude(t,i,n):null!=n&&(n.config=e),n},t}()),mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxEditor,["modified","lastSnapshot","ignoredChanges","undoManager","graphContainer","toolbarContainer"]);return t.afterDecode=function(t,e,n){var i=e.getAttribute("defaultEdge");null!=i&&(e.removeAttribute("defaultEdge"),n.defaultEdge=n.templates[i]);i=e.getAttribute("defaultGroup");return null!=i&&(e.removeAttribute("defaultGroup"),n.defaultGroup=n.templates[i]),n},t.decodeChild=function(t,e,n){if("Array"==e.nodeName){if("templates"==e.getAttribute("as"))return void this.decodeTemplates(t,e,n)}else if("ui"==e.nodeName)return void this.decodeUi(t,e,n);mxObjectCodec.prototype.decodeChild.apply(this,arguments)},t.decodeUi=function(t,e,n){for(var i,l,s,o,r,a,h,d=e.firstChild;null!=d;)"add"==d.nodeName?(i=d.getAttribute("as"),a=d.getAttribute("element"),l=d.getAttribute("style"),(h=null)!=a?null!=(h=document.getElementById(a))&&null!=l&&(h.style.cssText+=";"+l):(s=parseInt(d.getAttribute("x")),o=parseInt(d.getAttribute("y")),r=d.getAttribute("width"),a=d.getAttribute("height"),(h=document.createElement("div")).style.cssText=l,new mxWindow(mxResources.get(i)||i,h,s,o,r,a,!1,!0).setVisible(!0)),"graph"==i?n.setGraphContainer(h):"toolbar"==i?n.setToolbarContainer(h):"title"==i?n.setTitleContainer(h):"status"==i?n.setStatusContainer(h):"map"==i&&n.setMapContainer(h)):"resource"==d.nodeName?mxResources.add(d.getAttribute("basename")):"stylesheet"==d.nodeName&&mxClient.link("stylesheet",d.getAttribute("name")),d=d.nextSibling},t.decodeTemplates=function(t,e,n){null==n.templates&&(n.templates=[]);for(var i=mxUtils.getChildNodes(e),l=0;l<i.length;l++){for(var s=i[l].getAttribute("as"),o=i[l].firstChild;null!=o&&1!=o.nodeType;)o=o.nextSibling;null!=o&&(n.templates[s]=t.decodeCell(o))}},t}()),EditorUi=function(t,e,n){mxEventSource.call(this),this.destroyFunctions=[],this.editor=t||new Editor,this.container=e||document.body;var v=this.editor.graph;if(v.lightbox=n,this.initialDefaultVertexStyle=mxUtils.clone(v.defaultVertexStyle),this.initialDefaultEdgeStyle=mxUtils.clone(v.defaultEdgeStyle),v.useCssTransforms&&(this.lazyZoomDelay=0),mxClient.IS_SVG?mxPopupMenu.prototype.submenuImage="data:image/gif;base64,R0lGODlhCQAJAIAAAP///zMzMyH5BAEAAAAALAAAAAAJAAkAAAIPhI8WebHsHopSOVgb26AAADs=":(new Image).src=mxPopupMenu.prototype.submenuImage,mxClient.IS_SVG||null==mxConnectionHandler.prototype.connectImage||((new Image).src=mxConnectionHandler.prototype.connectImage.src),this.footerHeight=0,this.editor.chromeless&&!this.editor.editable&&(this.footerHeight=0,v.isEnabled=function(){return!1},v.panningHandler.isForcePanningEvent=function(t){return!mxEvent.isPopupTrigger(t.getEvent())}),this.actions=new Actions(this),this.menus=this.createMenus(),!v.standalone){this.createDivs(),this.createUi(),this.refresh();var i,l,s=mxUtils.bind(this,function(t){return null==t&&(t=window.event),v.isEditing()||null!=t&&this.isSelectionAllowed(t)});this.container==document.body&&(this.menubarContainer.onselectstart=s,this.menubarContainer.onmousedown=s,this.toolbarContainer.onselectstart=s,this.toolbarContainer.onmousedown=s,this.diagramContainer.onselectstart=s,this.diagramContainer.onmousedown=s,this.sidebarContainer.onselectstart=s,this.sidebarContainer.onmousedown=s,this.formatContainer.onselectstart=s,this.formatContainer.onmousedown=s,null!=this.tabContainer&&(this.tabContainer.onselectstart=s)),!this.editor.chromeless||this.editor.editable?(i=function(t){if(null!=t){var e=mxEvent.getSource(t);if("A"==e.nodeName)for(;null!=e;){if("geHint"==e.className)return!0;e=e.parentNode}}return s(t)},mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?mxEvent.addListener(this.diagramContainer,"contextmenu",i):this.diagramContainer.oncontextmenu=i):v.panningHandler.usePopupTrigger=!1,v.init(this.diagramContainer),!mxClient.IS_SVG||null==v.view.getDrawPane()||null!=(i=v.view.getDrawPane().ownerSVGElement)&&(i.style.position="absolute"),this.hoverIcons=this.createHoverIcons(),null!=v.graphHandler&&(l=v.graphHandler.start,v.graphHandler.start=function(){null!=x.hoverIcons&&x.hoverIcons.reset(),l.apply(this,arguments)}),mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(t){var e=mxUtils.getOffset(this.diagramContainer);0<mxEvent.getClientX(t)-e.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(t)-e.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var o=!1,r=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(t,e){return o||r.apply(this,arguments)},this.keydownHandler=mxUtils.bind(this,function(t){32!=t.which||v.isEditing()?mxEvent.isConsumed(t)||27!=t.keyCode||this.hideDialog(null,!0):(o=!0,this.hoverIcons.reset(),v.container.style.cursor="move",v.isEditing()||mxEvent.getSource(t)!=v.container||mxEvent.consume(t))}),mxEvent.addListener(document,"keydown",this.keydownHandler),this.keyupHandler=mxUtils.bind(this,function(t){v.container.style.cursor="",o=!1}),mxEvent.addListener(document,"keyup",this.keyupHandler);var a=v.panningHandler.isForcePanningEvent;v.panningHandler.isForcePanningEvent=function(t){return a.apply(this,arguments)||o||mxEvent.isMouseEvent(t.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(t.getEvent()))&&(!mxEvent.isControlDown(t.getEvent())&&mxEvent.isRightMouseButton(t.getEvent())||mxEvent.isMiddleMouseButton(t.getEvent()))};var h=v.cellEditor.isStopEditingEvent;v.cellEditor.isStopEditingEvent=function(t){return h.apply(this,arguments)||13==t.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(t)||mxClient.IS_MAC&&mxEvent.isMetaDown(t)||mxClient.IS_SF&&mxEvent.isShiftDown(t))};var d=v.isZoomWheelEvent,u=!(v.isZoomWheelEvent=function(){return o||d.apply(this,arguments)}),p=null,m=null,c=null,g=mxUtils.bind(this,function(){if(null!=this.toolbar&&u!=v.cellEditor.isContentEditing()){for(var t=this.toolbar.container.firstChild,e=[];null!=t;){var n=t.nextSibling;mxUtils.indexOf(this.toolbar.staticElements,t)<0&&(t.parentNode.removeChild(t),e.push(t)),t=n}var i=this.toolbar.fontMenu,l=this.toolbar.sizeMenu;if(null==c)this.toolbar.createTextToolbar();else{for(var s=0;s<c.length;s++)this.toolbar.container.appendChild(c[s]);this.toolbar.fontMenu=p,this.toolbar.sizeMenu=m}u=v.cellEditor.isContentEditing(),p=i,m=l,c=e}}),x=this,y=v.cellEditor.startEditing;v.cellEditor.startEditing=function(){var e,t;y.apply(this,arguments),g(),v.cellEditor.isContentEditing()&&(e=!1,t=function(){e||(e=!0,window.setTimeout(function(){var t=v.getSelectedEditingElement();null==t||null!=(t=mxUtils.getCurrentStyle(t))&&null!=x.toolbar&&(x.toolbar.setFontName(Graph.stripQuotes(t.fontFamily)),x.toolbar.setFontSize(parseInt(t.fontSize))),e=!1},0))},mxEvent.addListener(v.cellEditor.textarea,"input",t),mxEvent.addListener(v.cellEditor.textarea,"touchend",t),mxEvent.addListener(v.cellEditor.textarea,"mouseup",t),mxEvent.addListener(v.cellEditor.textarea,"keyup",t),t())};var f=v.cellEditor.stopEditing;if(v.cellEditor.stopEditing=function(t,e){try{f.apply(this,arguments),g()}catch(t){x.handleError(t)}},v.container.setAttribute("tabindex","0"),v.container.style.cursor="default",window.self===window.top&&null!=v.container.parentNode)try{v.container.focus()}catch(t){}var C=v.fireMouseEvent;v.fireMouseEvent=function(t,e,n){t==mxEvent.MOUSE_DOWN&&this.container.focus(),C.apply(this,arguments)},v.popupMenuHandler.autoExpand=!0,null!=this.menus&&(v.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(t,e,n){this.menus.createPopupMenu(t,e,n)})),mxEvent.addGestureListeners(document,mxUtils.bind(this,function(t){v.popupMenuHandler.hideMenu()})),this.keyHandler=this.createKeyHandler(t),this.getKeyHandler=function(){return keyHandler};var E=["rounded","shadow","glass","dashed","dashPattern","labelBackgroundColor","comic","sketch","fillWeight","hachureGap","hachureAngle","jiggle","disableMultiStroke","disableMultiStrokeFill","fillStyle","curveFitting","simplification","sketchStyle"],S=["shape","edgeStyle","curved","rounded","elbow","jumpStyle","jumpSize","comic","sketch","fillWeight","hachureGap","hachureAngle","jiggle","disableMultiStroke","disableMultiStrokeFill","fillStyle","curveFitting","simplification","sketchStyle"];this.setDefaultStyle=function(t){try{var e=v.view.getState(t);if(null!=e){var n=t.clone();n.style="";var i=v.getCellStyle(n),l=[],s=[];for(a in e.style)i[a]!=e.style[a]&&(l.push(e.style[a]),s.push(a));for(var n=v.getModel().getStyle(e.cell),o=null!=n?n.split(";"):[],r=0;r<o.length;r++){var a,h=o[r],d=h.indexOf("=");0<=d&&(a=h.substring(0,d),d=h.substring(d+1),null!=i[a]&&"none"==d&&(l.push(d),s.push(a)))}v.getModel().isEdge(e.cell)?v.currentEdgeStyle={}:v.currentVertexStyle={},this.fireEvent(new mxEventObject("styleChanged","keys",s,"values",l,"cells",[e.cell]))}}catch(t){this.handleError(t)}},this.clearDefaultStyle=function(){v.currentEdgeStyle=mxUtils.clone(v.defaultEdgeStyle),v.currentVertexStyle=mxUtils.clone(v.defaultVertexStyle),this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};for(var w=["fontFamily","fontSource","fontSize","fontColor"],b=["edgeStyle","startArrow","startFill","startSize","endArrow","endFill","endSize"],T=[["startArrow","startFill","startSize","sourcePerimeterSpacing","endArrow","endFill","endSize","targetPerimeterSpacing"],["strokeColor","strokeWidth"],["fillColor","gradientColor"],w,["opacity"],["align"],["html"]],A=0;A<T.length;A++)for(var L=0;L<T[A].length;L++)E.push(T[A][L]);for(A=0;A<S.length;A++)mxUtils.indexOf(E,S[A])<0&&E.push(S[A]);function I(t,e,n){(n=null!=n?n:v.getModel()).beginUpdate();try{for(var i=0;i<t.length;i++){var l=t[i];if(e)r=["fontSize","fontFamily","fontColor"];else for(var s=n.getStyle(l),o=null!=s?s.split(";"):[],r=E.slice(),a=0;a<o.length;a++){var h=o[a],d=h.indexOf("=");if(0<=d){var u=h.substring(0,d),d=mxUtils.indexOf(r,u);0<=d&&r.splice(d,1);for(var p=0;p<T.length;p++){var m=T[p];if(0<=mxUtils.indexOf(m,u))for(var c=0;c<m.length;c++){var g=mxUtils.indexOf(r,m[c]);0<=g&&r.splice(g,1)}}}}for(var x=n.isEdge(l),y=x?v.currentEdgeStyle:v.currentVertexStyle,f=n.getStyle(l),a=0;a<r.length;a++){var C=y[u=r[a]];null==C||"shape"==u&&!x||(!x||mxUtils.indexOf(S,u)<0)&&(f=mxUtils.setStyle(f,u,C))}n.setStyle(l,f)}}finally{n.endUpdate()}}v.addListener("cellsInserted",function(t,e){I(e.getProperty("cells"))}),v.addListener("textInserted",function(t,e){I(e.getProperty("cells"),!0)}),this.insertHandler=I,v.connectionHandler.addListener(mxEvent.CONNECT,function(t,e){var n=[e.getProperty("cell")];e.getProperty("terminalInserted")&&n.push(e.getProperty("terminal")),I(n)}),this.addListener("styleChanged",mxUtils.bind(this,function(t,e){var n=e.getProperty("cells"),i=!1,l=!1;if(0<n.length)for(var s=0;s<n.length&&(i=v.getModel().isVertex(n[s])||i,!(l=v.getModel().isEdge(n[s])||l)||!i);s++);else l=i=!0;for(var o,r=e.getProperty("keys"),a=e.getProperty("values"),s=0;s<r.length;s++){var h=0<=mxUtils.indexOf(w,r[s]);("strokeColor"!=r[s]||null!=a[s]&&"none"!=a[s])&&(0<=mxUtils.indexOf(S,r[s])?l||0<=mxUtils.indexOf(b,r[s])?null==a[s]?delete v.currentEdgeStyle[r[s]]:v.currentEdgeStyle[r[s]]=a[s]:i&&0<=mxUtils.indexOf(E,r[s])&&(null==a[s]?delete v.currentVertexStyle[r[s]]:v.currentVertexStyle[r[s]]=a[s]):0<=mxUtils.indexOf(E,r[s])&&((i||h)&&(null==a[s]?delete v.currentVertexStyle[r[s]]:v.currentVertexStyle[r[s]]=a[s]),(l||h||0<=mxUtils.indexOf(b,r[s]))&&(null==a[s]?delete v.currentEdgeStyle[r[s]]:v.currentEdgeStyle[r[s]]=a[s])))}null!=this.toolbar&&(this.toolbar.setFontName(v.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(v.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu&&(o=this.toolbar.edgeStyleMenu.getElementsByTagName("div")[0],"orthogonalEdgeStyle"==v.currentEdgeStyle.edgeStyle&&"1"==v.currentEdgeStyle.curved?o.className="geSprite geSprite-curved":"straight"==v.currentEdgeStyle.edgeStyle||"none"==v.currentEdgeStyle.edgeStyle||null==v.currentEdgeStyle.edgeStyle?o.className="geSprite geSprite-straight":"entityRelationEdgeStyle"==v.currentEdgeStyle.edgeStyle?o.className="geSprite geSprite-entity":"elbowEdgeStyle"==v.currentEdgeStyle.edgeStyle?o.className="geSprite geSprite-"+("vertical"==v.currentEdgeStyle.elbow?"verticalelbow":"horizontalelbow"):"isometricEdgeStyle"==v.currentEdgeStyle.edgeStyle?o.className="geSprite geSprite-"+("vertical"==v.currentEdgeStyle.elbow?"verticalisometric":"horizontalisometric"):o.className="geSprite geSprite-orthogonal"),null!=this.toolbar.edgeShapeMenu&&(o=this.toolbar.edgeShapeMenu.getElementsByTagName("div")[0],"link"==v.currentEdgeStyle.shape?o.className="geSprite geSprite-linkedge":"flexArrow"==v.currentEdgeStyle.shape?o.className="geSprite geSprite-arrow":"arrow"==v.currentEdgeStyle.shape?o.className="geSprite geSprite-simplearrow":o.className="geSprite geSprite-connection"),null!=this.toolbar.lineStartMenu&&(this.toolbar.lineStartMenu.getElementsByTagName("div")[0].className=this.getCssClassForMarker("start",v.currentEdgeStyle.shape,v.currentEdgeStyle[mxConstants.STYLE_STARTARROW],mxUtils.getValue(v.currentEdgeStyle,"startFill","1"))),null!=this.toolbar.lineEndMenu&&(this.toolbar.lineEndMenu.getElementsByTagName("div")[0].className=this.getCssClassForMarker("end",v.currentEdgeStyle.shape,v.currentEdgeStyle[mxConstants.STYLE_ENDARROW],mxUtils.getValue(v.currentEdgeStyle,"endFill","1"))))})),null!=this.toolbar&&(t=mxUtils.bind(this,function(){var t=v.currentVertexStyle.fontFamily||"Helvetica",e=String(v.currentVertexStyle.fontSize||"12"),n=v.getView().getState(v.getSelectionCell());null!=n&&(t=n.style[mxConstants.STYLE_FONTFAMILY]||t,e=n.style[mxConstants.STYLE_FONTSIZE]||e,10<t.length&&(t=t.substring(0,8)+"...")),this.toolbar.setFontName(t),this.toolbar.setFontSize(e)}),v.getSelectionModel().addListener(mxEvent.CHANGE,t),v.getModel().addListener(mxEvent.CHANGE,t)),v.addListener(mxEvent.CELLS_ADDED,function(t,e){var n=e.getProperty("cells"),e=e.getProperty("parent");v.getModel().isLayer(e)&&!v.isCellVisible(e)&&null!=n&&0<n.length&&v.getModel().setVisible(e,!0)}),this.gestureHandler=mxUtils.bind(this,function(t){null!=this.currentMenu&&mxEvent.getSource(t)!=this.currentMenu.div&&this.hideCurrentMenu()}),mxEvent.addGestureListeners(document,this.gestureHandler),this.resizeHandler=mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.refresh()}),0)}),mxEvent.addListener(window,"resize",this.resizeHandler),this.orientationChangeHandler=mxUtils.bind(this,function(){this.refresh()}),mxEvent.addListener(window,"orientationchange",this.orientationChangeHandler),mxClient.IS_IOS&&!window.navigator.standalone&&(this.scrollHandler=mxUtils.bind(this,function(){window.scrollTo(0,0)}),mxEvent.addListener(window,"scroll",this.scrollHandler)),this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.resetScrollbars()})),this.addListener("gridEnabledChanged",mxUtils.bind(this,function(){v.view.validateBackground()})),this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){v.view.validateBackground()})),v.addListener("gridSizeChanged",mxUtils.bind(this,function(){v.isGridEnabled()&&v.view.validateBackground()})),this.editor.resetGraph()}this.init(),v.standalone||this.open()},mxUtils.extend(EditorUi,mxEventSource),EditorUi.compactUi=!0,EditorUi.prototype.splitSize=mxClient.IS_TOUCH||mxClient.IS_POINTER?12:8,EditorUi.prototype.menubarHeight=30,EditorUi.prototype.formatEnabled=!0,EditorUi.prototype.formatWidth=240,EditorUi.prototype.toolbarHeight=38,EditorUi.prototype.footerHeight=28,EditorUi.prototype.sidebarFooterHeight=34,EditorUi.prototype.hsplitPosition=screen.width<=640?118:"large"!=urlParams["sidebar-entries"]?212:240,EditorUi.prototype.allowAnimation=!0,EditorUi.prototype.lightboxMaxFitScale=2,EditorUi.prototype.lightboxVerticalDivider=4,EditorUi.prototype.hsplitClickEnabled=!1,EditorUi.prototype.init=function(){var t,e,n=this.editor.graph;n.standalone||("0"!=urlParams["shape-picker"]&&this.installShapePicker(),mxEvent.addListener(n.container,"scroll",mxUtils.bind(this,function(){n.tooltipHandler.hide(),null!=n.connectionHandler&&null!=n.connectionHandler.constraintHandler&&n.connectionHandler.constraintHandler.reset()})),n.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){n.tooltipHandler.hide();var t=n.getRubberband();null!=t&&t.cancel()})),mxEvent.addListener(n.container,"keydown",mxUtils.bind(this,function(t){this.onKeyDown(t)})),mxEvent.addListener(n.container,"keypress",mxUtils.bind(this,function(t){this.onKeyPress(t)})),this.addUndoListener(),this.addBeforeUnloadListener(),n.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()})),n.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()})),t=n.setDefaultParent,(e=this).editor.graph.setDefaultParent=function(){t.apply(this,arguments),e.updateActionStates()},n.editLink=e.actions.get("editLink").funct,this.updateActionStates(),this.initClipboard(),this.initCanvas(),null!=this.format&&this.format.init())},EditorUi.prototype.installShapePicker=function(){var a=this.editor.graph,h=this;a.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(t,e){"mouseDown"==e.getProperty("eventName")&&h.hideShapePicker()})),a.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){h.hideShapePicker(!0)})),a.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){h.hideShapePicker(!0)})),a.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){h.hideShapePicker(!0)}));var t=a.popupMenuHandler.isMenuShowing;a.popupMenuHandler.isMenuShowing=function(){return t.apply(this,arguments)||null!=h.shapePicker};var e,n,i=a.dblClick;a.dblClick=function(t,e){var n;this.isEnabled()&&(null!=e||null==h.sidebar||mxEvent.isShiftDown(t)?i.apply(this,arguments):(mxEvent.consume(t),n=mxUtils.convertPoint(this.container,mxEvent.getClientX(t),mxEvent.getClientY(t)),window.setTimeout(mxUtils.bind(this,function(){h.showShapePicker(n.x,n.y)}),30)))},null!=this.hoverIcons&&(e=this.hoverIcons.drag,this.hoverIcons.drag=function(){h.hideShapePicker(),e.apply(this,arguments)},n=this.hoverIcons.execute,this.hoverIcons.execute=function(s,o,r){var e=r.getEvent();this.graph.isCloneEvent(e)||mxEvent.isShiftDown(e)?n.apply(this,arguments):this.graph.connectVertex(s.cell,o,this.graph.defaultEdgeLength,e,null,null,mxUtils.bind(this,function(t,e,n){var i=a.getCompositeParent(s.cell),l=a.getCellGeometry(i);for(r.consume();null!=i&&a.model.isVertex(i)&&null!=l&&l.relative;)cell=i,i=a.model.getParent(cell),l=a.getCellGeometry(i);window.setTimeout(mxUtils.bind(this,function(){h.showShapePicker(r.getGraphX(),r.getGraphY(),i,mxUtils.bind(this,function(t){n(t)}),o)}),30)}),mxUtils.bind(this,function(t){this.graph.selectCellsForConnectVertex(t,e,this)}))})},EditorUi.prototype.showShapePicker=function(n,i,t,l,e){var s=this.getCellsForShapePicker(t);if(null!=s&&0<s.length){var o=this,r=this.editor.graph,a=document.createElement("div"),h=r.view.getState(t),d=null==t||null!=h&&r.isTransparentState(h)?null:r.copyStyle(t);a.className="geToolbarContainer geSidebarContainer geSidebar",a.style.cssText="position:absolute;left:"+n+"px;top:"+i+"px;width:140px;border-radius:10px;padding:4px;text-align:center;box-shadow:0px 0px 3px 1px #d1d1d1;padding: 6px 0 8px 0;",mxUtils.setPrefixedStyle(a.style,"transform","translate(-22px,-22px)"),null!=r.background&&r.background!=mxConstants.NONE&&(a.style.backgroundColor=r.background),r.container.appendChild(a);for(var u=mxUtils.bind(this,function(e){var t=document.createElement("a");t.className="geItem",t.style.cssText="position:relative;display:inline-block;position:relative;width:30px;height:30px;cursor:pointer;overflow:hidden;padding:3px 0 0 3px;",a.appendChild(t),null!=d?this.sidebar.graph.pasteStyle(d,[e]):o.insertHandler([e],""!=e.value,this.sidebar.graph.model),this.sidebar.createThumb([e],25,25,t,null,!0,!1,e.geometry.width,e.geometry.height),mxEvent.addListener(t,"click",function(){var t=r.cloneCell(e);if(null!=l)l(t);else{t.geometry.x=r.snap(Math.round(n/r.view.scale)-r.view.translate.x-e.geometry.width/2),t.geometry.y=r.snap(Math.round(i/r.view.scale)-r.view.translate.y-e.geometry.height/2),r.model.beginUpdate();try{r.addCell(t)}finally{r.model.endUpdate()}r.setSelectionCell(t),r.scrollCellToVisible(t),r.startEditingAtCell(t),null!=o.hoverIcons&&o.hoverIcons.update(r.view.getState(t))}o.hideShapePicker()})}),p=0;p<s.length;p++)u(s[p]);null!=o.hoverIcons&&o.hoverIcons.reset(),r.popupMenuHandler.hideMenu(),r.tooltipHandler.hideTooltip(),this.hideCurrentMenu(),this.hideShapePicker(),this.shapePickerCallback=l,this.shapePicker=a}},EditorUi.prototype.getCellsForShapePicker=function(t){var e=mxUtils.bind(this,function(t,e,n,i){return this.editor.graph.createVertex(null,null,i||"",0,0,e||120,n||60,t,!1)});return[null!=t?this.editor.graph.cloneCell(t):e("text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;",40,20,"Text"),e("whiteSpace=wrap;html=1;"),e("ellipse;whiteSpace=wrap;html=1;",120,80),e("rhombus;whiteSpace=wrap;html=1;",80,80),e("shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;"),e("shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,60),e("shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;",120,80),e("shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,80),e("shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;"),e("shape=cube;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;darkOpacity=0.05;darkOpacity2=0.1;",120,80),e("shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;darkOpacity=0.05;",80,100),e("triangle;whiteSpace=wrap;html=1;",60,80),e("shape=document;whiteSpace=wrap;html=1;boundedLbl=1;",120,80),e("shape=tape;whiteSpace=wrap;html=1;",120,100),e("ellipse;shape=cloud;whiteSpace=wrap;html=1;",120,80),e("shape=cylinder;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;",60,80)]},EditorUi.prototype.hideShapePicker=function(t){null!=this.shapePicker&&(this.shapePicker.parentNode.removeChild(this.shapePicker),this.shapePicker=null,t||null==this.shapePickerCallback||this.shapePickerCallback(),this.shapePickerCallback=null)},EditorUi.prototype.onKeyDown=function(t){var e=this.editor.graph;9!=t.which||!e.isEnabled()||mxEvent.isAltDown(t)||e.isEditing()&&mxEvent.isShiftDown(t)||(e.isEditing()?e.stopEditing(!1):e.selectCell(!mxEvent.isShiftDown(t)),mxEvent.consume(t))},EditorUi.prototype.onKeyPress=function(t){var e=this.editor.graph;!this.isImmediateEditingEvent(t)||e.isEditing()||e.isSelectionEmpty()||0===t.which||27===t.which||mxEvent.isAltDown(t)||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)||(e.escape(),e.startEditing(),!mxClient.IS_FF||null!=(e=e.cellEditor).textarea&&(e.textarea.innerHTML=String.fromCharCode(t.which),(t=document.createRange()).selectNodeContents(e.textarea),t.collapse(!1),(e=window.getSelection()).removeAllRanges(),e.addRange(t)))},EditorUi.prototype.isImmediateEditingEvent=function(t){return!0},EditorUi.prototype.getCssClassForMarker=function(t,e,n,i){return"flexArrow"==e?null!=n&&n!=mxConstants.NONE?"geSprite geSprite-"+t+"blocktrans":"geSprite geSprite-noarrow":"box"==n||"halfCircle"==n?"geSprite geSvgSprite geSprite-"+n+("end"==t?" geFlipSprite":""):n==mxConstants.ARROW_CLASSIC?"1"==i?"geSprite geSprite-"+t+"classic":"geSprite geSprite-"+t+"classictrans":n==mxConstants.ARROW_CLASSIC_THIN?"1"==i?"geSprite geSprite-"+t+"classicthin":"geSprite geSprite-"+t+"classicthintrans":n==mxConstants.ARROW_OPEN?"geSprite geSprite-"+t+"open":n==mxConstants.ARROW_OPEN_THIN?"geSprite geSprite-"+t+"openthin":n==mxConstants.ARROW_BLOCK?"1"==i?"geSprite geSprite-"+t+"block":"geSprite geSprite-"+t+"blocktrans":n==mxConstants.ARROW_BLOCK_THIN?"1"==i?"geSprite geSprite-"+t+"blockthin":"geSprite geSprite-"+t+"blockthintrans":n==mxConstants.ARROW_OVAL?"1"==i?"geSprite geSprite-"+t+"oval":"geSprite geSprite-"+t+"ovaltrans":n==mxConstants.ARROW_DIAMOND?"1"==i?"geSprite geSprite-"+t+"diamond":"geSprite geSprite-"+t+"diamondtrans":n==mxConstants.ARROW_DIAMOND_THIN?"1"==i?"geSprite geSprite-"+t+"thindiamond":"geSprite geSprite-"+t+"thindiamondtrans":"openAsync"==n?"geSprite geSprite-"+t+"openasync":"dash"==n?"geSprite geSprite-"+t+"dash":"cross"==n?"geSprite geSprite-"+t+"cross":"async"==n?"1"==i?"geSprite geSprite-"+t+"async":"geSprite geSprite-"+t+"asynctrans":"circle"==n||"circlePlus"==n?"1"==i||"circle"==n?"geSprite geSprite-"+t+"circle":"geSprite geSprite-"+t+"circleplus":"ERone"==n?"geSprite geSprite-"+t+"erone":"ERmandOne"==n?"geSprite geSprite-"+t+"eronetoone":"ERmany"==n?"geSprite geSprite-"+t+"ermany":"ERoneToMany"==n?"geSprite geSprite-"+t+"eronetomany":"ERzeroToOne"==n?"geSprite geSprite-"+t+"eroneopt":"ERzeroToMany"==n?"geSprite geSprite-"+t+"ermanyopt":"geSprite geSprite-noarrow"},EditorUi.prototype.createMenus=function(){return null},EditorUi.prototype.updatePasteActionStates=function(){var t=this.editor.graph,e=this.actions.get("paste"),n=this.actions.get("pasteHere");e.setEnabled(this.editor.graph.cellEditor.isContentEditing()||!mxClipboard.isEmpty()&&t.isEnabled()&&!t.isCellLocked(t.getDefaultParent())),n.setEnabled(e.isEnabled())},EditorUi.prototype.initClipboard=function(){var d=this,e=mxClipboard.cut;mxClipboard.cut=function(t){t.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):e.apply(this,arguments),d.updatePasteActionStates()};mxClipboard.copy;mxClipboard.copy=function(t){var e=null;if(t.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{e=e||t.getSelectionCells(),e=t.getExportableCells(t.model.getTopmostCells(e));for(var n=new Object,i=t.createCellLookup(e),l=t.cloneCells(e,null,n),s=new mxGraphModel,o=s.getChildAt(s.getRoot(),0),r=0;r<l.length;r++){s.add(o,l[r]);var a,h=t.view.getState(e[r]);null==h||null!=(a=t.getCellGeometry(l[r]))&&a.relative&&!s.isEdge(e[r])&&null==i[mxObjectIdentity.get(s.getParent(e[r]))]&&(a.offset=null,a.relative=!1,a.x=h.x/h.view.scale-h.view.translate.x,a.y=h.y/h.view.scale-h.view.translate.y)}t.updateCustomLinks(t.createCellMapping(n,i),l),mxClipboard.insertCount=1,mxClipboard.setCells(l)}return d.updatePasteActionStates(),e};var n=mxClipboard.paste;mxClipboard.paste=function(t){var e=null;return t.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):e=n.apply(this,arguments),d.updatePasteActionStates(),e};var t=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){t.apply(this,arguments),d.updatePasteActionStates()};var i=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(t,e){i.apply(this,arguments),d.updatePasteActionStates()},this.updatePasteActionStates()},EditorUi.prototype.lazyZoomDelay=20,EditorUi.prototype.wheelZoomDelay=400,EditorUi.prototype.buttonZoomDelay=600,EditorUi.prototype.initCanvas=function(){var m=this.editor.graph;m.timerAutoScroll=!0,m.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((m.container.offsetWidth-34)/m.view.scale)),Math.max(0,Math.round((m.container.offsetHeight-34)/m.view.scale)))},m.view.getBackgroundPageBounds=function(){var t=this.graph.getPageLayout(),e=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+t.x*e.width),this.scale*(this.translate.y+t.y*e.height),this.scale*t.width*e.width,this.scale*t.height*e.height)},m.getPreferredPageSize=function(t,e,n){var i=this.getPageLayout(),l=this.getPageSize();return new mxRectangle(0,0,i.width*l.width,i.height*l.height)};var n,o,s=null,r=this;if(this.editor.isChromelessView()){s=mxUtils.bind(this,function(t,e,n,i){var l,s,o,r,a,h,d,u,p;null==m.container||m.isViewer()||(n=null!=n?n:0,i=null!=i?i:0,l=m.pageVisible?m.view.getBackgroundPageBounds():m.getGraphBounds(),s=mxUtils.hasScrollbars(m.container),u=m.view.translate,o=m.view.scale,(r=mxRectangle.fromRectangle(l)).x=r.x/o-u.x,r.y=r.y/o-u.y,r.width/=o,r.height/=o,a=m.container.scrollTop,h=m.container.scrollLeft,p=mxClient.IS_QUIRKS||8<=document.documentMode?20:14,8!=document.documentMode&&9!=document.documentMode||(p+=3),d=m.container.offsetWidth-p,u=m.container.offsetHeight-p,t=(d-(p=t?Math.max(.3,Math.min(e||1,d/r.width)):o)*r.width)/2/p,e=0==this.lightboxVerticalDivider?0:(u-p*r.height)/this.lightboxVerticalDivider/p,s&&(t=Math.max(t,0),e=Math.max(e,0)),s||l.width<d||l.height<u?(m.view.scaleAndTranslate(p,Math.floor(t-r.x),Math.floor(e-r.y)),m.container.scrollTop=a*p/o,m.container.scrollLeft=h*p/o):0==n&&0==i||(p=m.view.translate,m.view.setTranslate(Math.floor(p.x+n/o),Math.floor(p.y+i/o))))}),this.chromelessResize=s,this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var t=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});if(mxEvent.addListener(window,"resize",t),this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",t)}),this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)})),this.actions.get("zoomIn").funct=mxUtils.bind(this,function(t){m.zoomIn(),this.chromelessResize(!1)}),this.actions.get("zoomOut").funct=mxUtils.bind(this,function(t){m.zoomOut(),this.chromelessResize(!1)}),"0"!=urlParams.toolbar){var e=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));this.chromelessToolbar=document.createElement("div"),this.chromelessToolbar.style.position="fixed",this.chromelessToolbar.style.overflow="hidden",this.chromelessToolbar.style.boxSizing="border-box",this.chromelessToolbar.style.whiteSpace="nowrap",this.chromelessToolbar.style.backgroundColor="#000000",this.chromelessToolbar.style.padding="10px 10px 8px 10px",this.chromelessToolbar.style.left=m.isViewer()?"0":"50%",mxClient.IS_VML||(mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","20px"),mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out"));var i=mxUtils.bind(this,function(){var t=mxUtils.getCurrentStyle(m.container);m.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=t?parseInt(t["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",i),i();var l,a,h,d,u=mxUtils.bind(this,function(t,e,n){0;var i=document.createElement("span");i.style.paddingLeft="8px",i.style.paddingRight="8px",i.style.cursor="pointer",mxEvent.addListener(i,"click",t),null!=n&&i.setAttribute("title",n);n=document.createElement("img");return n.setAttribute("border","0"),n.setAttribute("src",e),i.appendChild(n),this.chromelessToolbar.appendChild(i),i});null!=e.backBtn&&u(mxUtils.bind(this,function(t){window.location.href=e.backBtn.url,mxEvent.consume(t)}),Editor.backLargeImage,mxResources.get("back",null,"Back")),this.isPagesEnabled()&&(l=u(mxUtils.bind(this,function(t){this.actions.get("previousPage").funct(),mxEvent.consume(t)}),Editor.previousLargeImage,mxResources.get("previousPage")),(a=document.createElement("div")).style.display="inline-block",a.style.verticalAlign="top",a.style.fontFamily="Helvetica,Arial",a.style.marginTop="8px",a.style.fontSize="14px",a.style.color="#ffffff",this.chromelessToolbar.appendChild(a),h=u(mxUtils.bind(this,function(t){this.actions.get("nextPage").funct(),mxEvent.consume(t)}),Editor.nextLargeImage,mxResources.get("nextPage")),d=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&(a.innerHTML="",mxUtils.write(a,mxUtils.indexOf(this.pages,this.currentPage)+1+" / "+this.pages.length))}),l.style.paddingLeft="0px",l.style.paddingRight="4px",h.style.paddingLeft="4px",h.style.paddingRight="0px",i=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(h.style.display="",l.style.display="",a.style.display="inline-block"):(h.style.display="none",l.style.display="none",a.style.display="none"),d()}),this.editor.addListener("resetGraphView",i),this.editor.addListener("pageSelected",d)),u(mxUtils.bind(this,function(t){this.actions.get("zoomOut").funct(),mxEvent.consume(t)}),Editor.zoomOutLargeImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)"),u(mxUtils.bind(this,function(t){this.actions.get("zoomIn").funct(),mxEvent.consume(t)}),Editor.zoomInLargeImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)"),u(mxUtils.bind(this,function(t){m.isLightboxView()?(1==m.view.scale?this.lightboxFit():m.zoomTo(1),this.chromelessResize(!1)):this.chromelessResize(!0),mxEvent.consume(t)}),Editor.actualSizeLargeImage,mxResources.get("fit"));var p,c,g=null,x=null,y=mxUtils.bind(this,function(t){null!=g&&(window.clearTimeout(g),g=null),null!=x&&(window.clearTimeout(x),x=null),g=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0),g=null,x=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none",x=null}),600)}),t||200)}),f=mxUtils.bind(this,function(t){null!=g&&(window.clearTimeout(g),g=null),null!=x&&(window.clearTimeout(x),x=null),this.chromelessToolbar.style.display="",mxUtils.setOpacity(this.chromelessToolbar,t||30)});if("1"==urlParams.layers&&(this.layersDialog=null,p=u(mxUtils.bind(this,function(t){var e;null!=this.layersDialog?(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null):(this.layersDialog=m.createLayersDialog(),mxEvent.addListener(this.layersDialog,"mouseleave",mxUtils.bind(this,function(){this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null})),e=p.getBoundingClientRect(),mxUtils.setPrefixedStyle(this.layersDialog.style,"borderRadius","5px"),this.layersDialog.style.position="fixed",this.layersDialog.style.fontFamily="Helvetica,Arial",this.layersDialog.style.backgroundColor="#000000",this.layersDialog.style.width="160px",this.layersDialog.style.padding="4px 2px 4px 2px",this.layersDialog.style.color="#ffffff",mxUtils.setOpacity(this.layersDialog,70),this.layersDialog.style.left=e.left+"px",this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px",e=mxUtils.getCurrentStyle(this.editor.graph.container),this.layersDialog.style.zIndex=e.zIndex,document.body.appendChild(this.layersDialog)),mxEvent.consume(t)}),Editor.layersLargeImage,mxResources.get("layers")),(c=m.getModel()).addListener(mxEvent.CHANGE,function(){p.style.display=1<c.getChildCount(c.root)?"":"none"})),"1"!=urlParams.openInSameWin&&this.addChromelessToolbarItems(u),null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||u(mxUtils.bind(this,function(t){null!=this.editor.editButtonFunc?this.editor.editButtonFunc():"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):m.openLink(this.editor.editButtonLink,"editWindow"),mxEvent.consume(t)}),Editor.editLargeImage,mxResources.get("edit")),null!=this.lightboxToolbarActions)for(var C=0;C<this.lightboxToolbarActions.length;C++){var v=this.lightboxToolbarActions[C];u(v.fn,v.icon,v.tooltip)}null!=e.refreshBtn&&u(mxUtils.bind(this,function(t){e.refreshBtn.url?window.location.href=e.refreshBtn.url:window.location.reload(),mxEvent.consume(t)}),Editor.refreshLargeImage,mxResources.get("refresh",null,"Refresh")),null!=e.fullscreenBtn&&window.self!==window.top&&u(mxUtils.bind(this,function(t){e.fullscreenBtn.url?m.openLink(e.fullscreenBtn.url):m.openLink(window.location.href),mxEvent.consume(t)}),Editor.fullscreenLargeImage,mxResources.get("openInNewWindow",null,"Open in New Window")),(e.closeBtn&&window.self===window.top||m.lightbox&&("1"==urlParams.close||this.container!=document.body))&&u(mxUtils.bind(this,function(t){"1"==urlParams.close||e.closeBtn?window.close():(this.destroy(),mxEvent.consume(t))}),Editor.closeLargeImage,mxResources.get("close")+" (Escape)"),this.chromelessToolbar.style.display="none",m.isViewer()||mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)"),m.container.appendChild(this.chromelessToolbar),mxEvent.addListener(m.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(t){mxEvent.isTouchEvent(t)||(mxEvent.isShiftDown(t)||f(30),y())})),mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(t){mxEvent.consume(t)}),mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(t){mxEvent.isShiftDown(t)?y():f(100)})),mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(t){mxEvent.isShiftDown(t)?y():f(100),mxEvent.consume(t)})),mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(t){mxEvent.isTouchEvent(t)||f(30)}));var E=m.getTolerance();m.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(t,e){this.startX=e.getGraphX(),this.startY=e.getGraphY(),this.scrollLeft=m.container.scrollLeft,this.scrollTop=m.container.scrollTop},mouseMove:function(t,e){},mouseUp:function(t,e){mxEvent.isTouchEvent(e.getEvent())&&Math.abs(this.scrollLeft-m.container.scrollLeft)<E&&Math.abs(this.scrollTop-m.container.scrollTop)<E&&Math.abs(this.startX-e.getGraphX())<E&&Math.abs(this.startY-e.getGraphY())<E&&(0<parseFloat(r.chromelessToolbar.style.opacity||0)?y():f(30))}})}this.editor.editable||this.addChromelessClickHandler()}else this.editor.extendCanvas&&(n=m.view.validate,m.view.validate=function(){var t,e;null!=this.graph.container&&mxUtils.hasScrollbars(this.graph.container)&&(t=this.graph.getPagePadding(),e=this.graph.getPageSize(),this.translate.x,this.translate.y,this.translate.x=t.x-(this.x0||0)*e.width,this.translate.y=t.y-(this.y0||0)*e.height),n.apply(this,arguments)},m.isViewer()||(o=m.sizeDidChange,m.sizeDidChange=function(){if(null!=this.container&&mxUtils.hasScrollbars(this.container)){var t=this.getPageLayout(),e=this.getPagePadding(),n=this.getPageSize(),i=Math.ceil(2*e.x+t.width*n.width),l=Math.ceil(2*e.y+t.height*n.height),s=m.minimumGraphSize;null!=s&&s.width==i&&s.height==l||(m.minimumGraphSize=new mxRectangle(0,0,i,l));l=e.x-t.x*n.width,e=e.y-t.y*n.height;if(!this.autoTranslate&&(this.view.translate.x!=l||this.view.translate.y!=e)){this.autoTranslate=!0,this.view.x0=t.x,this.view.y0=t.y;n=m.view.translate.x,t=m.view.translate.y;return m.view.setTranslate(l,e),m.container.scrollLeft+=Math.round((l-n)*m.view.scale),m.container.scrollTop+=Math.round((e-t)*m.view.scale),void(this.autoTranslate=!1)}o.apply(this,arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}));var S=m.view.getBackgroundPane(),w=m.view.getDrawPane();m.cumulativeZoomFactor=1;function b(t){null!=T&&window.clearTimeout(T),window.setTimeout(function(){m.isMouseDown&&!I||(T=window.setTimeout(mxUtils.bind(this,function(){m.isFastZoomEnabled()&&(null!=m.view.backgroundPageShape&&null!=m.view.backgroundPageShape.node&&(mxUtils.setPrefixedStyle(m.view.backgroundPageShape.node.style,"transform-origin",null),mxUtils.setPrefixedStyle(m.view.backgroundPageShape.node.style,"transform",null)),w.style.transformOrigin="",S.style.transformOrigin="",mxClient.IS_SF?(w.style.transform="scale(1)",S.style.transform="scale(1)",window.setTimeout(function(){w.style.transform="",S.style.transform=""},0)):(w.style.transform="",S.style.transform=""),m.view.getDecoratorPane().style.opacity="",m.view.getOverlayPane().style.opacity="");var t=new mxPoint(m.container.scrollLeft,m.container.scrollTop),e=mxUtils.getOffset(m.container),n=m.view.scale,i=0,l=0;null!=A&&(i=m.container.offsetWidth/2-A.x+e.x,l=m.container.offsetHeight/2-A.y+e.y),m.zoom(m.cumulativeZoomFactor),m.view.scale!=n&&(null!=L&&(i+=t.x-L.x,l+=t.y-L.y),null!=s&&r.chromelessResize(!1,null,i*(m.cumulativeZoomFactor-1),l*(m.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(m.container)||0==i&&0==l||(m.container.scrollLeft-=i*(m.cumulativeZoomFactor-1),m.container.scrollTop-=l*(m.cumulativeZoomFactor-1))),null!=M&&w.setAttribute("filter",M),m.cumulativeZoomFactor=1,M=I=A=L=T=null}),null!=t?t:m.isFastZoomEnabled()?r.wheelZoomDelay:r.lazyZoomDelay))},0)}var T=null,A=null,L=null,I=null,M=null;m.lazyZoom=function(t,e,n){var i;(e=e||!m.scrollbars)&&(A=new mxPoint(m.container.offsetLeft+m.container.clientWidth/2,m.container.offsetTop+m.container.clientHeight/2)),t?this.view.scale*this.cumulativeZoomFactor<=.15?this.cumulativeZoomFactor*=(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale):this.view.scale*this.cumulativeZoomFactor<=.15?this.cumulativeZoomFactor*=(this.view.scale-.05)/this.view.scale:(this.cumulativeZoomFactor/=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale),this.cumulativeZoomFactor=Math.max(.05,Math.min(this.view.scale*this.cumulativeZoomFactor,160))/this.view.scale,m.isFastZoomEnabled()&&(null==M&&""!=w.getAttribute("filter")&&(M=w.getAttribute("filter"),w.removeAttribute("filter")),L=new mxPoint(m.container.scrollLeft,m.container.scrollTop),i=e?m.container.scrollLeft+m.container.clientWidth/2:A.x+m.container.scrollLeft-m.container.offsetLeft,t=e?m.container.scrollTop+m.container.clientHeight/2:A.y+m.container.scrollTop-m.container.offsetTop,w.style.transformOrigin=i+"px "+t+"px",w.style.transform="scale("+this.cumulativeZoomFactor+")",S.style.transformOrigin=i+"px "+t+"px",S.style.transform="scale("+this.cumulativeZoomFactor+")",null!=m.view.backgroundPageShape&&null!=m.view.backgroundPageShape.node&&(t=m.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(t.style,"transform-origin",(e?m.container.clientWidth/2+m.container.scrollLeft-t.offsetLeft+"px":A.x+m.container.scrollLeft-t.offsetLeft-m.container.offsetLeft+"px")+" "+(e?m.container.clientHeight/2+m.container.scrollTop-t.offsetTop+"px":A.y+m.container.scrollTop-t.offsetTop-m.container.offsetTop+"px")),mxUtils.setPrefixedStyle(t.style,"transform","scale("+this.cumulativeZoomFactor+")")),m.view.getDecoratorPane().style.opacity="0",m.view.getOverlayPane().style.opacity="0",null!=r.hoverIcons&&r.hoverIcons.reset()),b(n)},mxEvent.addGestureListeners(m.container,function(t){null!=T&&window.clearTimeout(T)},null,function(t){1!=m.cumulativeZoomFactor&&b(0)}),mxEvent.addListener(m.container,"scroll",function(t){null==T||m.isMouseDown||1==m.cumulativeZoomFactor||b(0)}),mxEvent.addMouseWheelListener(mxUtils.bind(this,function(t,e,n,i,l){if(null==this.dialogs||0==this.dialogs.length)if(m.scrollbars||n||!m.isScrollWheelEvent(t)){if(n||m.isZoomWheelEvent(t))for(var s=mxEvent.getSource(t);null!=s;){if(s==m.container)return m.tooltipHandler.hideTooltip(),A=null!=i&&null!=l?new mxPoint(i,l):new mxPoint(mxEvent.getClientX(t),mxEvent.getClientY(t)),I=n,m.lazyZoom(e),mxEvent.consume(t),!1;s=s.parentNode}}else{var o=m.view.getTranslate(),r=40/m.view.scale;mxEvent.isShiftDown(t)?m.view.setTranslate(o.x+(e?-r:r),o.y):m.view.setTranslate(o.x,o.y+(e?r:-r))}}),m.container),m.panningHandler.zoomGraph=function(t){m.cumulativeZoomFactor=t.scale,m.lazyZoom(0<t.scale,!0),mxEvent.consume(t)}},EditorUi.prototype.addChromelessToolbarItems=function(t){t(mxUtils.bind(this,function(t){this.actions.get("print").funct(),mxEvent.consume(t)}),Editor.printLargeImage,mxResources.get("print"))},EditorUi.prototype.isPagesEnabled=function(){return this.editor.editable||"1"!=urlParams["hide-pages"]},EditorUi.prototype.createTemporaryGraph=function(t){var e=new Graph(document.createElement("div"));return e.stylesheet.styles=mxUtils.clone(t.styles),e.resetViewOnRootChange=!1,e.setConnectable(!1),e.gridEnabled=!1,e.autoScroll=!1,e.setTooltips(!1),e.setEnabled(!1),e.container.style.visibility="hidden",e.container.style.position="absolute",e.container.style.overflow="hidden",e.container.style.height="1px",e.container.style.width="1px",e},EditorUi.prototype.addChromelessClickHandler=function(){var t=urlParams.highlight;null!=t&&0<t.length&&(t="#"+t),this.editor.graph.addClickHandler(t)},EditorUi.prototype.toggleFormatPanel=function(t){t=null!=t?t:0==this.formatWidth,null!=this.format&&(this.formatWidth=t?240:0,this.formatContainer.style.display=t?"":"none",this.refresh(),this.format.refresh(),this.fireEvent(new mxEventObject("formatWidthChanged")))},EditorUi.prototype.lightboxFit=function(t){var e,n;this.isDiagramEmpty()?this.editor.graph.view.setScale(1):(n=60,null!=(e=urlParams.border)&&(n=parseInt(e)),this.editor.graph.maxFitScale=this.lightboxMaxFitScale,this.editor.graph.fit(n,null,null,null,null,null,t),this.editor.graph.maxFitScale=null)},EditorUi.prototype.isDiagramEmpty=function(){var t=this.editor.graph.getModel();return 1==t.getChildCount(t.root)&&0==t.getChildCount(t.getChildAt(t.root,0))},EditorUi.prototype.isSelectionAllowed=function(t){return"SELECT"==mxEvent.getSource(t).nodeName||"INPUT"==mxEvent.getSource(t).nodeName&&mxUtils.isAncestorNode(this.formatContainer,mxEvent.getSource(t))},EditorUi.prototype.addBeforeUnloadListener=function(){window.onbeforeunload=mxUtils.bind(this,function(){this.editor.isChromelessView()})},EditorUi.prototype.onBeforeUnload=function(){if(this.editor.modified)return mxResources.get("allChangesLost")},EditorUi.prototype.open=function(){try{null!=window.opener&&null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(t,e){try{var n=mxUtils.parseXml(t);return this.editor.setGraphXml(n.documentElement),this.editor.setModified(!1),this.editor.undoManager.clear(),void(null!=e&&(this.editor.setFilename(e),this.updateDocumentTitle()))}catch(t){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+t.message)}}))}catch(t){}this.editor.graph.view.validate(),this.editor.graph.sizeDidChange(),this.editor.fireEvent(new mxEventObject("resetGraphView"))},EditorUi.prototype.showPopupMenu=function(t,e,n,i){this.editor.graph.popupMenuHandler.hideMenu();var l=new mxPopupMenu(t,this.container);l.div.className+=" geMenubarMenu",l.smartSeparators=!0,l.showDisabled=!0,l.autoExpand=!0,l.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(l,arguments),l.destroy()}),l.popup(e,n,null,i),this.setCurrentMenu(l)},EditorUi.prototype.setCurrentMenu=function(t,e){this.currentMenuElt=e,this.currentMenu=t},EditorUi.prototype.resetCurrentMenu=function(){this.currentMenuElt=null,this.currentMenu=null},EditorUi.prototype.hideCurrentMenu=function(){null!=this.currentMenu&&(this.currentMenu.hideMenu(),this.resetCurrentMenu())},EditorUi.prototype.updateDocumentTitle=function(){var t=this.editor.getOrCreateFilename();null!=this.editor.appName&&(t+=" - "+this.editor.appName),document.title=t},EditorUi.prototype.createHoverIcons=function(){return new HoverIcons(this.editor.graph)},EditorUi.prototype.redo=function(){try{this.editor.graph.isEditing()?document.execCommand("redo",!1,null):this.editor.undoManager.redo()}catch(t){}},EditorUi.prototype.undo=function(){try{var t,e=this.editor.graph;e.isEditing()?(t=e.cellEditor.textarea.innerHTML,document.execCommand("undo",!1,null),t==e.cellEditor.textarea.innerHTML&&(e.stopEditing(!0),this.editor.undoManager.undo())):this.editor.undoManager.undo()}catch(t){}},EditorUi.prototype.canRedo=function(){return this.editor.graph.isEditing()||this.editor.undoManager.canRedo()},EditorUi.prototype.canUndo=function(){return this.editor.graph.isEditing()||this.editor.undoManager.canUndo()},EditorUi.prototype.getEditBlankXml=function(){return mxUtils.getXml(this.editor.getGraphXml())},EditorUi.prototype.getUrl=function(t){var e,n=null!=t?t:window.location.pathname,i=0<n.indexOf("?")?1:0;for(e in urlParams)n+=0==i?"?":"&",n+=e+"="+urlParams[e],i++;return n},EditorUi.prototype.setScrollbars=function(t){var e=this.editor.graph,n=e.container.style.overflow;e.scrollbars=t,this.editor.updateGraphComponents(),n!=e.container.style.overflow&&(e.container.scrollTop=0,e.container.scrollLeft=0,e.view.scaleAndTranslate(1,0,0),this.resetScrollbars()),this.fireEvent(new mxEventObject("scrollbarsChanged"))},EditorUi.prototype.hasScrollbars=function(){return this.editor.graph.scrollbars},EditorUi.prototype.resetScrollbars=function(){var t,e,n,i=this.editor.graph;this.editor.extendCanvas?this.editor.isChromelessView()||(mxUtils.hasScrollbars(i.container)?i.pageVisible?(e=i.getPagePadding(),i.container.scrollTop=Math.floor(e.y-this.editor.initialTopSpacing)-1,i.container.scrollLeft=Math.floor(Math.min(e.x,(i.container.scrollWidth-i.container.clientWidth)/2))-1,0<(e=i.getGraphBounds()).width&&0<e.height&&(e.x>i.container.scrollLeft+.9*i.container.clientWidth&&(i.container.scrollLeft=Math.min(e.x+e.width-i.container.clientWidth,e.x-10)),e.y>i.container.scrollTop+.9*i.container.clientHeight&&(i.container.scrollTop=Math.min(e.y+e.height-i.container.clientHeight,e.y-10)))):(e=i.getGraphBounds(),n=Math.max(e.width,i.scrollTileSize.width*i.view.scale),t=Math.max(e.height,i.scrollTileSize.height*i.view.scale),i.container.scrollTop=Math.floor(Math.max(0,e.y-Math.max(20,(i.container.clientHeight-t)/4))),i.container.scrollLeft=Math.floor(Math.max(0,e.x-Math.max(0,(i.container.clientWidth-n)/2)))):(t=mxRectangle.fromRectangle(i.pageVisible?i.view.getBackgroundPageBounds():i.getGraphBounds()),e=i.view.translate,n=i.view.scale,t.x=t.x/n-e.x,t.y=t.y/n-e.y,t.width/=n,t.height/=n,n=i.pageVisible?0:Math.max(0,(i.container.clientHeight-t.height)/4),i.view.setTranslate(Math.floor(Math.max(0,(i.container.clientWidth-t.width)/2)-t.x+2),Math.floor(n-t.y+1)))):(i.container.scrollTop=0,i.container.scrollLeft=0,mxUtils.hasScrollbars(i.container)||i.view.setTranslate(0,0))},EditorUi.prototype.setPageVisible=function(t){var e=this.editor.graph,n=mxUtils.hasScrollbars(e.container),i=0,l=0;n&&(i=e.view.translate.x*e.view.scale-e.container.scrollLeft,l=e.view.translate.y*e.view.scale-e.container.scrollTop),e.pageVisible=t,e.pageBreaksVisible=t,e.preferPageSize=t,e.view.validateBackground(),n&&(t=e.getSelectionCells(),e.clearSelection(),e.setSelectionCells(t)),e.sizeDidChange(),n&&(e.container.scrollLeft=e.view.translate.x*e.view.scale-i,e.container.scrollTop=e.view.translate.y*e.view.scale-l),this.fireEvent(new mxEventObject("pageViewChanged"))},ChangeGridColor.prototype.execute=function(){var t=this.ui.editor.graph.view.gridColor;this.ui.setGridColor(this.color),this.color=t},function(){var t=new mxObjectCodec(new ChangeGridColor,["ui"]);mxCodecRegistry.register(t)}(),ChangePageSetup.prototype.execute=function(){var t,e=this.ui.editor.graph;this.ignoreColor||(this.color=this.previousColor,t=e.background,this.ui.setBackgroundColor(this.previousColor),this.previousColor=t),this.ignoreImage||(this.image=this.previousImage,t=e.backgroundImage,this.ui.setBackgroundImage(this.previousImage),this.previousImage=t),null!=this.previousFormat&&(this.format=this.previousFormat,t=e.pageFormat,this.previousFormat.width==t.width&&this.previousFormat.height==t.height||(this.ui.setPageFormat(this.previousFormat),this.previousFormat=t)),null!=this.foldingEnabled&&this.foldingEnabled!=this.ui.editor.graph.foldingEnabled&&(this.ui.setFoldingEnabled(this.foldingEnabled),this.foldingEnabled=!this.foldingEnabled),null!=this.previousPageScale&&(t=this.ui.editor.graph.pageScale,this.previousPageScale!=t&&(this.ui.setPageScale(this.previousPageScale),this.previousPageScale=t))},function(){var t=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat","previousPageScale"]);t.afterDecode=function(t,e,n){return n.previousColor=n.color,n.previousImage=n.image,n.previousFormat=n.format,n.previousPageScale=n.pageScale,null!=n.foldingEnabled&&(n.foldingEnabled=!n.foldingEnabled),n},mxCodecRegistry.register(t)}(),EditorUi.prototype.setBackgroundColor=function(t){this.editor.graph.background=t,this.editor.graph.view.validateBackground(),this.fireEvent(new mxEventObject("backgroundColorChanged"))},EditorUi.prototype.setFoldingEnabled=function(t){this.editor.graph.foldingEnabled=t,this.editor.graph.view.revalidate(),this.fireEvent(new mxEventObject("foldingEnabledChanged"))},EditorUi.prototype.setPageFormat=function(t){this.editor.graph.pageFormat=t,this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct(),this.fireEvent(new mxEventObject("pageFormatChanged"))},EditorUi.prototype.setPageScale=function(t){this.editor.graph.pageScale=t,this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct(),this.fireEvent(new mxEventObject("pageScaleChanged"))},EditorUi.prototype.setGridColor=function(t){this.editor.graph.view.gridColor=t,this.editor.graph.view.validateBackground(),this.fireEvent(new mxEventObject("gridColorChanged"))},EditorUi.prototype.addUndoListener=function(){var t=this.actions.get("undo"),e=this.actions.get("redo"),n=this.editor.undoManager,i=mxUtils.bind(this,function(){t.setEnabled(this.canUndo()),e.setEnabled(this.canRedo())});n.addListener(mxEvent.ADD,i),n.addListener(mxEvent.UNDO,i),n.addListener(mxEvent.REDO,i),n.addListener(mxEvent.CLEAR,i);var l=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){l.apply(this,arguments),i()};var s=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(t,e){s.apply(this,arguments),i()},i()},EditorUi.prototype.updateActionStates=function(){var t=this.editor.graph,e=!t.isSelectionEmpty(),n=!1,i=!1,l=!1,s=t.getSelectionCells();if(null!=s)for(var o=0;o<s.length;o++){var r=s[o];if(t.getModel().isEdge(r)&&(l=!0),t.getModel().isVertex(r)&&(n=!0,(0<t.getModel().getChildCount(r)||t.isContainer(r))&&(i=!0)),l&&n)break}for(var a=["cut","copy","bold","italic","underline","delete","duplicate","editStyle","editTooltip","editLink","backgroundColor","borderColor","edit","toFront","toBack","lockUnlock","solid","dashed","pasteSize","dotted","fillColor","gradientColor","shadow","fontColor","formattedText","rounded","toggleRounded","sharp","strokeColor"],o=0;o<a.length;o++)this.actions.get(a[o]).setEnabled(e);this.actions.get("setAsDefaultStyle").setEnabled(1==t.getSelectionCount()),this.actions.get("clearWaypoints").setEnabled(!t.isSelectionEmpty()),this.actions.get("copySize").setEnabled(1==t.getSelectionCount()),this.actions.get("turn").setEnabled(!t.isSelectionEmpty()),this.actions.get("curved").setEnabled(l),this.actions.get("rotation").setEnabled(n),this.actions.get("wordWrap").setEnabled(n),this.actions.get("autosize").setEnabled(n);var h=n&&1==t.getSelectionCount();this.actions.get("group").setEnabled(1<t.getSelectionCount()||h&&!t.isContainer(t.getSelectionCell())),this.actions.get("ungroup").setEnabled(i),this.actions.get("removeFromGroup").setEnabled(h&&t.getModel().isVertex(t.getModel().getParent(t.getSelectionCell())));t.view.getState(t.getSelectionCell());this.menus.get("navigation").setEnabled(e||null!=t.view.currentRoot),this.actions.get("collapsible").setEnabled(n&&(t.isContainer(t.getSelectionCell())||0<t.model.getChildCount(t.getSelectionCell()))),this.actions.get("home").setEnabled(null!=t.view.currentRoot),this.actions.get("exitGroup").setEnabled(null!=t.view.currentRoot),this.actions.get("enterGroup").setEnabled(1==t.getSelectionCount()&&t.isValidRoot(t.getSelectionCell()));h=1==t.getSelectionCount()&&t.isCellFoldable(t.getSelectionCell());this.actions.get("expand").setEnabled(h),this.actions.get("collapse").setEnabled(h),this.actions.get("editLink").setEnabled(1==t.getSelectionCount()),this.actions.get("openLink").setEnabled(1==t.getSelectionCount()&&null!=t.getLinkForCell(t.getSelectionCell())),this.actions.get("guides").setEnabled(t.isEnabled()),this.actions.get("grid").setEnabled(!this.editor.chromeless||this.editor.editable);h=t.isEnabled()&&!t.isCellLocked(t.getDefaultParent());this.menus.get("layout").setEnabled(h),this.menus.get("insert").setEnabled(h),this.menus.get("direction").setEnabled(h&&n),this.menus.get("align").setEnabled(h&&n&&1<t.getSelectionCount()),this.menus.get("distribute").setEnabled(h&&n&&1<t.getSelectionCount()),this.actions.get("selectVertices").setEnabled(h),this.actions.get("selectEdges").setEnabled(h),this.actions.get("selectAll").setEnabled(h),this.actions.get("selectNone").setEnabled(h),this.updatePasteActionStates()},EditorUi.prototype.zeroOffset=new mxPoint(0,0),EditorUi.prototype.getDiagramContainerOffset=function(){return this.zeroOffset},EditorUi.prototype.refresh=function(t){t=null==t||t;var e=mxClient.IS_IE&&(null==document.documentMode||5==document.documentMode),n=this.container.clientWidth,i=this.container.clientHeight;this.container==document.body&&(n=document.body.clientWidth||document.documentElement.clientWidth,i=e&&document.body.clientHeight||document.documentElement.clientHeight);var l=0;mxClient.IS_IOS&&!window.navigator.standalone&&window.innerHeight!=document.documentElement.clientHeight&&(l=document.documentElement.clientHeight-window.innerHeight,window.scrollTo(0,0));var s=Math.max(0,Math.min(this.hsplitPosition,n-this.splitSize-20)),o=0;null!=this.menubar&&(this.menubarContainer.style.height=this.menubarHeight+"px",o+=this.menubarHeight),null!=this.toolbar&&(this.toolbarContainer.style.top=this.menubarHeight+"px",this.toolbarContainer.style.height=this.toolbarHeight+"px",o+=this.toolbarHeight),0<o&&!mxClient.IS_QUIRKS&&(o+=1);var r=0;null!=this.sidebarFooterContainer&&(d=this.footerHeight+l,r=Math.max(0,Math.min(i-o-d,this.sidebarFooterHeight)),this.sidebarFooterContainer.style.width=s+"px",this.sidebarFooterContainer.style.height=r+"px",this.sidebarFooterContainer.style.bottom=d+"px");var a=null!=this.format?this.formatWidth:0;this.sidebarContainer.style.top=o+"px",this.sidebarContainer.style.width=s+"px",this.formatContainer.style.top=o+"px",this.formatContainer.style.width=a+"px",this.formatContainer.style.display=null!=this.format?"":"none";var h=this.getDiagramContainerOffset(),d=null!=this.hsplit.parentNode?s+this.splitSize:0;this.diagramContainer.style.left=d+h.x+"px",this.diagramContainer.style.top=o+h.y+"px",this.hsplit.style.top=this.sidebarContainer.style.top,this.hsplit.style.bottom=this.footerHeight+l+"px",this.hsplit.style.left=s+"px",null!=this.tabContainer&&(this.tabContainer.style.left=d+"px"),e?(this.menubarContainer.style.width=n+"px",this.toolbarContainer.style.width=this.menubarContainer.style.width,e=Math.max(0,i-this.footerHeight-this.menubarHeight-this.toolbarHeight),this.sidebarContainer.style.height=e-r+"px",this.formatContainer.style.height=e+"px",this.diagramContainer.style.width=null!=this.hsplit.parentNode?Math.max(0,n-s-this.splitSize-a)+"px":n+"px",i=Math.max(0,i-this.footerHeight-this.menubarHeight-this.toolbarHeight),null!=this.tabContainer&&(this.tabContainer.style.width=this.diagramContainer.style.width,this.tabContainer.style.bottom=this.footerHeight+l+"px",i-=this.tabContainer.clientHeight),this.diagramContainer.style.height=i+"px",this.hsplit.style.height=i+"px"):(this.footerHeight,this.diagramContainer.style.right=a+"px",a=0,null!=this.tabContainer&&(this.tabContainer.style.bottom=this.footerHeight+l+"px",this.tabContainer.style.right=this.diagramContainer.style.right,a=this.tabContainer.clientHeight),this.sidebarContainer.style.bottom=this.footerHeight+r+l+"px",this.formatContainer.style.bottom=this.footerHeight+l+"px",this.diagramContainer.style.bottom=this.footerHeight+l+a+"px"),t&&this.editor.graph.sizeDidChange()},EditorUi.prototype.createTabContainer=function(){return null},EditorUi.prototype.createDivs=function(){this.menubarContainer=this.createDiv("geMenubarContainer"),this.toolbarContainer=this.createDiv("geToolbarContainer"),this.sidebarContainer=this.createDiv("geSidebarContainer"),this.formatContainer=this.createDiv("geSidebarContainer geFormatContainer"),this.diagramContainer=this.createDiv("geDiagramContainer"),this.hsplit=this.createDiv("geHsplit"),this.hsplit.setAttribute("title",mxResources.get("collapseExpand")),this.menubarContainer.style.top="0px",this.menubarContainer.style.left="0px",this.menubarContainer.style.right="0px",this.toolbarContainer.style.left="0px",this.toolbarContainer.style.right="0px",this.sidebarContainer.style.left="0px",this.formatContainer.style.right="0px",this.formatContainer.style.zIndex="1",this.diagramContainer.style.right=(null!=this.format?this.formatWidth:0)+"px",this.hsplit.style.width=this.splitSize+"px",this.sidebarFooterContainer=this.createSidebarFooterContainer(),this.sidebarFooterContainer&&(this.sidebarFooterContainer.style.left="0px"),this.editor.chromeless?this.diagramContainer.style.border="none":this.tabContainer=this.createTabContainer()},EditorUi.prototype.createSidebarFooterContainer=function(){return null},EditorUi.prototype.createUi=function(){this.menubar=this.editor.chromeless?null:this.menus.createMenubar(this.createDiv("geMenubar")),null!=this.menubar&&this.menubarContainer.appendChild(this.menubar.container),null!=this.menubar&&(this.statusContainer=this.createStatusContainer(),this.editor.addListener("statusChanged",mxUtils.bind(this,function(){this.setStatusText(this.editor.getStatus())})),this.setStatusText(this.editor.getStatus()),this.menubar.container.appendChild(this.statusContainer),this.container.appendChild(this.menubarContainer)),this.sidebar=this.editor.chromeless?null:this.createSidebar(this.sidebarContainer),null!=this.sidebar&&this.container.appendChild(this.sidebarContainer),this.format=this.editor.chromeless||!this.formatEnabled?null:this.createFormat(this.formatContainer),null!=this.format&&this.container.appendChild(this.formatContainer);null!=this.sidebar&&this.sidebarFooterContainer&&this.container.appendChild(this.sidebarFooterContainer),this.container.appendChild(this.diagramContainer),null!=this.container&&null!=this.tabContainer&&this.container.appendChild(this.tabContainer),this.toolbar=this.editor.chromeless?null:this.createToolbar(this.createDiv("geToolbar")),null!=this.toolbar&&(this.toolbarContainer.appendChild(this.toolbar.container),this.container.appendChild(this.toolbarContainer)),null!=this.sidebar&&(this.container.appendChild(this.hsplit),this.addSplitHandler(this.hsplit,!0,0,mxUtils.bind(this,function(t){this.hsplitPosition=t,this.refresh()})))},EditorUi.prototype.createStatusContainer=function(){var t=document.createElement("a");return t.className="geItem geStatus",t},EditorUi.prototype.setStatusText=function(t){this.statusContainer.innerHTML=t},EditorUi.prototype.createToolbar=function(t){return new Toolbar(this,t)},EditorUi.prototype.createSidebar=function(t){return new Sidebar(this,t)},EditorUi.prototype.createFormat=function(t){return new Format(this,t)},EditorUi.prototype.createFooter=function(){return this.createDiv("geFooter")},EditorUi.prototype.createDiv=function(t){var e=document.createElement("div");return e.className=t,e},EditorUi.prototype.addSplitHandler=function(e,n,i,l){var s=null,o=null,r=!0,a=null;mxClient.IS_POINTER&&(e.style.touchAction="none");var h=mxUtils.bind(this,function(){var t=parseInt(n?e.style.left:e.style.bottom);return n||(t=t+i-this.footerHeight),t});function d(t){var e;null!=s&&(e=new mxPoint(mxEvent.getClientX(t),mxEvent.getClientY(t)),l(Math.max(0,o+(n?e.x-s.x:s.y-e.y)-i)),mxEvent.consume(t),o!=h()&&(r=!0,a=null))}function t(t){d(t),s=o=null}mxEvent.addGestureListeners(e,function(t){s=new mxPoint(mxEvent.getClientX(t),mxEvent.getClientY(t)),o=h(),r=!1,mxEvent.consume(t)}),mxEvent.addListener(e,"click",mxUtils.bind(this,function(t){var e;!r&&this.hsplitClickEnabled&&(e=null!=a?a-i:0,a=h(),l(e),mxEvent.consume(t))})),mxEvent.addGestureListeners(document,null,d,t),this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,d,t)})},EditorUi.prototype.handleError=function(t,e,n,i,l){var s,o=null!=t&&null!=t.error?t.error:t;null!=o||null!=e?(s=mxUtils.htmlEntities(mxResources.get("unknownError")),t=mxResources.get("ok"),e=null!=e?e:mxResources.get("error"),null!=o&&null!=o.message&&(s=mxUtils.htmlEntities(o.message)),this.showError(e,s,t,n,null,null,null,null,null,null,null,null,i?n:null)):null!=n&&n()},EditorUi.prototype.showError=function(t,e,n,i,l,s,o,r,a,h,d,u,p){a=new ErrorDialog(this,t,e,n||mxResources.get("ok"),i,l,s,o,u,r,a),e=Math.ceil(null!=e?e.length/50:1);this.showDialog(a.container,h||340,d||100+20*e,!0,!1,p),a.init()},EditorUi.prototype.showDialog=function(t,e,n,i,l,s,o,r,a,h){this.editor.graph.tooltipHandler.hideTooltip(),null==this.dialogs&&(this.dialogs=[]),this.dialog=new Dialog(this,t,e,n,i,l,s,o,r,a,h),this.dialogs.push(this.dialog)},EditorUi.prototype.hideDialog=function(t,e){var n;null!=this.dialogs&&0<this.dialogs.length&&(0!=(n=this.dialogs.pop()).close(t,e)?(this.dialog=0<this.dialogs.length?this.dialogs[this.dialogs.length-1]:null,this.editor.fireEvent(new mxEventObject("hideDialog")),null==this.dialog&&"hidden"!=this.editor.graph.container.style.visibility&&window.setTimeout(mxUtils.bind(this,function(){this.editor.graph.isEditing()&&null!=this.editor.graph.cellEditor.textarea?this.editor.graph.cellEditor.textarea.focus():(mxUtils.clearSelection(),this.editor.graph.container.focus())}),0)):this.dialogs.push(n))},EditorUi.prototype.ctrlEnter=function(){var t=this.editor.graph;if(t.isEnabled())try{for(var e=t.getSelectionCells(),n=new mxDictionary,i=[],l=0;l<e.length;l++){var s=t.isTableCell(e[l])?t.model.getParent(e[l]):e[l];null==s||n.get(s)||(n.put(s,!0),i.push(s))}t.setSelectionCells(t.duplicateCells(i,!1))}catch(t){this.handleError(t)}},EditorUi.prototype.pickColor=function(t,e){var n=this.editor.graph,i=n.cellEditor.saveSelection(),l=226+17*(Math.ceil(ColorDialog.prototype.presetColors.length/12)+Math.ceil(ColorDialog.prototype.defaultColors.length/12)),t=new ColorDialog(this,t||"none",function(t){n.cellEditor.restoreSelection(i),e(t)},function(){n.cellEditor.restoreSelection(i)});this.showDialog(t.container,230,l,!0,!1),t.init()},EditorUi.prototype.openFile=function(){window.openFile=new OpenFile(mxUtils.bind(this,function(t){this.hideDialog(t)})),this.showDialog(new OpenDialog(this).container,Editor.useLocalStorage?640:320,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null})},EditorUi.prototype.extractGraphModelFromHtml=function(t){var e=null;try{var n,i=t.indexOf("&lt;mxGraphModel ");0<=i&&(i<(n=t.lastIndexOf("&lt;/mxGraphModel&gt;"))&&(e=t.substring(i,n+21).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,"")))}catch(t){}return e},EditorUi.prototype.extractGraphModelFromEvent=function(t){var e=null,n=null;return null==t||null!=(t=null!=t.dataTransfer?t.dataTransfer:t.clipboardData)&&(10==document.documentMode||11==document.documentMode?n=t.getData("Text"):(n=0<=mxUtils.indexOf(t.types,"text/html")?t.getData("text/html"):null,mxUtils.indexOf(t.types,null==n||0==n.length)&&(n=t.getData("text/plain"))),null!=n&&(n=Graph.zapGremlins(mxUtils.trim(n)),null!=(t=this.extractGraphModelFromHtml(n))&&(n=t))),null!=n&&this.isCompatibleString(n)&&(e=n),e},EditorUi.prototype.isCompatibleString=function(t){return!1},EditorUi.prototype.saveFile=function(t){t||null==this.editor.filename?(t=new FilenameDialog(this,this.editor.getOrCreateFilename(),mxResources.get("save"),mxUtils.bind(this,function(t){this.save(t)}),null,mxUtils.bind(this,function(t){return null!=t&&0<t.length||(mxUtils.confirm(mxResources.get("invalidName")),!1)})),this.showDialog(t.container,300,100,!0,!0),t.init()):this.save(this.editor.getOrCreateFilename())},EditorUi.prototype.save=function(t){if(null!=t){this.editor.graph.isEditing()&&this.editor.graph.stopEditing();var e=mxUtils.getXml(this.editor.getGraphXml());try{if(Editor.useLocalStorage){if(null!=localStorage.getItem(t)&&!mxUtils.confirm(mxResources.get("replaceIt",[t])))return;localStorage.setItem(t,e),this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("saved"))+" "+new Date)}else{if(!(e.length<MAX_REQUEST_SIZE))return mxUtils.alert(mxResources.get("drawingTooLarge")),void mxUtils.popup(e);new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(t)+"&xml="+encodeURIComponent(e)).simulate(document,"_blank")}this.editor.setModified(!1),this.editor.setFilename(t),this.updateDocumentTitle()}catch(t){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("errorSavingFile")))}}},EditorUi.prototype.executeLayout=function(t,e,n){var i=this.editor.graph;if(i.isEnabled()){i.getModel().beginUpdate();try{t()}catch(t){throw t}finally{this.allowAnimation&&e&&(null==navigator.userAgent||navigator.userAgent.indexOf("Camino")<0)?((e=new mxMorphing(i)).addListener(mxEvent.DONE,mxUtils.bind(this,function(){i.getModel().endUpdate(),null!=n&&n()})),e.startAnimation()):(i.getModel().endUpdate(),null!=n&&n())}}},EditorUi.prototype.showImageDialog=function(t,e,n,i){var l,s=this.editor.graph.cellEditor,o=s.saveSelection(),r=mxUtils.prompt(t,e);s.restoreSelection(o),null!=r&&0<r.length?((l=new Image).onload=function(){n(r,l.width,l.height)},l.onerror=function(){n(null),mxUtils.alert(mxResources.get("fileNotFound"))},l.src=r):n(null)},EditorUi.prototype.showLinkDialog=function(t,e,n){n=new LinkDialog(this,t,e,n);this.showDialog(n.container,420,90,!0,!0),n.init()},EditorUi.prototype.showDataDialog=function(t){null!=t&&(t=new EditDataDialog(this,t),this.showDialog(t.container,480,420,!0,!1,null,!1),t.init())},EditorUi.prototype.showBackgroundImageDialog=function(t,e){t=null!=t?t:mxUtils.bind(this,function(t){t=new ChangePageSetup(this,null,t);t.ignoreColor=!0,this.editor.graph.model.execute(t)});var n=mxUtils.prompt(mxResources.get("backgroundImage"),null!=e?e.src:"");null!=n&&0<n.length?((e=new Image).onload=function(){t(new mxImage(n,e.width,e.height),!1)},e.onerror=function(){t(null,!0),mxUtils.alert(mxResources.get("fileNotFound"))},e.src=n):t(null)},EditorUi.prototype.setBackgroundImage=function(t){this.editor.graph.setBackgroundImage(t),this.editor.graph.view.validateBackgroundImage(),this.fireEvent(new mxEventObject("backgroundImageChanged"))},EditorUi.prototype.confirm=function(t,e,n){mxUtils.confirm(t)?null!=e&&e():null!=n&&n()},EditorUi.prototype.createOutline=function(t){var e=new mxOutline(this.editor.graph);return e.border=20,mxEvent.addListener(window,"resize",function(){e.update()}),this.addListener("pageFormatChanged",function(){e.update()}),e},EditorUi.prototype.altShiftActions={67:"clearWaypoints",65:"connectionArrows",76:"editLink",80:"connectionPoints",84:"editTooltip",86:"pasteSize",88:"copySize"},EditorUi.prototype.createKeyHandler=function(t){var n=this,p=this.editor.graph,s=new mxKeyHandler(p),e=s.isEventIgnored;s.isEventIgnored=function(t){return!(mxEvent.isShiftDown(t)&&9==t.keyCode)&&(!this.isControlDown(t)||mxEvent.isShiftDown(t)||90!=t.keyCode&&89!=t.keyCode&&188!=t.keyCode&&190!=t.keyCode&&85!=t.keyCode)&&(66!=t.keyCode&&73!=t.keyCode||!this.isControlDown(t)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&e.apply(this,arguments)},s.isEnabledForEvent=function(t){return!mxEvent.isConsumed(t)&&this.isGraphEvent(t)&&this.isEnabled()&&(null==n.dialogs||0==n.dialogs.length)},s.isControlDown=function(t){return mxEvent.isControlDown(t)||mxClient.IS_MAC&&t.metaKey};var i=[],l=null;function o(h,d,u){i.push(function(){if(!p.isSelectionEmpty()&&p.isEnabled())if(d=null!=d?d:1,u){p.getModel().beginUpdate();try{for(var t,e=p.getSelectionCells(),n=0;n<e.length;n++)p.getModel().isVertex(e[n])&&p.isCellResizable(e[n])&&(null!=(t=p.getCellGeometry(e[n]))&&(t=t.clone(),37==h?t.width=Math.max(0,t.width-d):38==h?t.height=Math.max(0,t.height-d):39==h?t.width+=d:40==h&&(t.height+=d),p.getModel().setGeometry(e[n],t)))}finally{p.getModel().endUpdate()}}else{var i=p.getSelectionCell(),l=p.model.getParent(i),s=null;if(1==p.getSelectionCount()&&p.model.isVertex(i)&&null!=p.layoutManager&&!p.isCellLocked(i)&&(s=p.layoutManager.getLayout(l)),null!=s&&s.constructor==mxStackLayout){var o=l.getIndex(i);37==h||38==h?p.model.add(l,i,Math.max(0,o-1)):39!=h&&40!=h||p.model.add(l,i,Math.min(p.model.getChildCount(l),o+1))}else{for(var e=p.getMovableCells(p.getSelectionCells()),r=[],n=0;n<e.length;n++){var a=p.getCurrentCellStyle(e[n]);"1"==mxUtils.getValue(a,"part","0")?(l=p.model.getParent(e[n]),p.model.isVertex(l)&&mxUtils.indexOf(e,l)<0&&r.push(l)):r.push(e[n])}0<r.length&&(e=r,o=i=0,37==h?i=-d:38==h?o=-d:39==h?i=d:40==h&&(o=d),p.moveCells(e,i,o))}}}),null!=l&&window.clearTimeout(l),l=window.setTimeout(function(){if(0<i.length){p.getModel().beginUpdate();try{for(var t=0;t<i.length;t++)i[t]();i=[]}finally{p.getModel().endUpdate()}}},200)}var r={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},a=s.getFunction;mxKeyHandler.prototype.getFunction=function(e){if(p.isEnabled()){if(mxEvent.isShiftDown(e)&&mxEvent.isAltDown(e)){var t=n.actions.get(n.altShiftActions[e.keyCode]);if(null!=t)return t.funct}if(9==e.keyCode&&mxEvent.isAltDown(e))return p.cellEditor.isContentEditing()?function(){document.execCommand("outdent",!1,null)}:mxEvent.isShiftDown(e)?function(){p.selectParentCell()}:function(){p.selectChildCell()};if(null!=r[e.keyCode]&&!p.isSelectionEmpty()){if(this.isControlDown(e)||!mxEvent.isShiftDown(e)||!mxEvent.isAltDown(e))return this.isControlDown(e)?function(){o(e.keyCode,mxEvent.isShiftDown(e)?p.gridSize:null,!0)}:function(){o(e.keyCode,mxEvent.isShiftDown(e)?p.gridSize:null)};if(p.model.isVertex(p.getSelectionCell()))return function(){var t=p.connectVertex(p.getSelectionCell(),r[e.keyCode],p.defaultEdgeLength,e,!0);null!=t&&0<t.length&&(1==t.length&&p.model.isEdge(t[0])?p.setSelectionCell(p.model.getTerminal(t[0],!1)):p.setSelectionCell(t[t.length-1]),p.scrollCellToVisible(p.getSelectionCell()),null!=n.hoverIcons&&n.hoverIcons.update(p.view.getState(p.getSelectionCell())))}}}return a.apply(this,arguments)},s.bindAction=mxUtils.bind(this,function(t,e,n,i){var l=this.actions.get(n);null!=l&&(n=function(){l.isEnabled()&&l.funct()},e?i?s.bindControlShiftKey(t,n):s.bindControlKey(t,n):i?s.bindShiftKey(t,n):s.bindKey(t,n))});var h=this,d=s.escape;return s.escape=function(t){d.apply(this,arguments)},s.enter=function(){},s.bindControlShiftKey(36,function(){p.exitGroup()}),s.bindControlShiftKey(35,function(){p.enterGroup()}),s.bindShiftKey(36,function(){p.home()}),s.bindKey(35,function(){p.refresh()}),s.bindAction(107,!0,"zoomIn"),s.bindAction(109,!0,"zoomOut"),s.bindAction(80,!0,"print"),s.bindAction(79,!0,"outline",!0),this.editor.chromeless&&!this.editor.editable||(s.bindControlKey(36,function(){p.isEnabled()&&p.foldCells(!0)}),s.bindControlKey(35,function(){p.isEnabled()&&p.foldCells(!1)}),s.bindControlKey(13,function(){h.ctrlEnter()}),s.bindAction(8,!1,"delete"),s.bindAction(8,!0,"deleteAll"),s.bindAction(8,!1,"deleteLabels",!0),s.bindAction(46,!1,"delete"),s.bindAction(46,!0,"deleteAll"),s.bindAction(46,!1,"deleteLabels",!0),s.bindAction(36,!1,"resetView"),s.bindAction(72,!0,"fitWindow",!0),s.bindAction(74,!0,"fitPage"),s.bindAction(74,!0,"fitTwoPages",!0),s.bindAction(48,!0,"customZoom"),s.bindAction(82,!0,"turn"),s.bindAction(82,!0,"clearDefaultStyle",!0),s.bindAction(83,!0,"save"),s.bindAction(83,!0,"saveAs",!0),s.bindAction(65,!0,"selectAll"),s.bindAction(65,!0,"selectNone",!0),s.bindAction(73,!0,"selectVertices",!0),s.bindAction(69,!0,"selectEdges",!0),s.bindAction(69,!0,"editStyle"),s.bindAction(66,!0,"bold"),s.bindAction(66,!0,"toBack",!0),s.bindAction(70,!0,"toFront",!0),s.bindAction(68,!0,"duplicate"),s.bindAction(68,!0,"setAsDefaultStyle",!0),s.bindAction(90,!0,"undo"),s.bindAction(89,!0,"autosize",!0),s.bindAction(88,!0,"cut"),s.bindAction(67,!0,"copy"),s.bindAction(86,!0,"paste"),s.bindAction(71,!0,"group"),s.bindAction(77,!0,"editData"),s.bindAction(71,!0,"grid",!0),s.bindAction(73,!0,"italic"),s.bindAction(76,!0,"lockUnlock"),s.bindAction(76,!0,"layers",!0),s.bindAction(80,!0,"formatPanel",!0),s.bindAction(85,!0,"underline"),s.bindAction(85,!0,"ungroup",!0),s.bindAction(190,!0,"superscript"),s.bindAction(188,!0,"subscript"),s.bindAction(9,!1,"indent",!0),s.bindKey(13,function(){p.isEnabled()&&p.startEditingAtCell()}),s.bindKey(113,function(){p.isEnabled()&&p.startEditingAtCell()})),mxClient.IS_WIN?s.bindAction(89,!0,"redo"):s.bindAction(90,!0,"redo",!0),s},EditorUi.prototype.destroy=function(){if(null!=this.editor&&(this.editor.destroy(),this.editor=null),null!=this.menubar&&(this.menubar.destroy(),this.menubar=null),null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null),null!=this.sidebar&&(this.sidebar.destroy(),this.sidebar=null),null!=this.keyHandler&&(this.keyHandler.destroy(),this.keyHandler=null),null!=this.keydownHandler&&(mxEvent.removeListener(document,"keydown",this.keydownHandler),this.keydownHandler=null),null!=this.keyupHandler&&(mxEvent.removeListener(document,"keyup",this.keyupHandler),this.keyupHandler=null),null!=this.resizeHandler&&(mxEvent.removeListener(window,"resize",this.resizeHandler),this.resizeHandler=null),null!=this.gestureHandler&&(mxEvent.removeGestureListeners(document,this.gestureHandler),this.gestureHandler=null),null!=this.orientationChangeHandler&&(mxEvent.removeListener(window,"orientationchange",this.orientationChangeHandler),this.orientationChangeHandler=null),null!=this.scrollHandler&&(mxEvent.removeListener(window,"scroll",this.scrollHandler),this.scrollHandler=null),null!=this.destroyFunctions){for(var t=0;t<this.destroyFunctions.length;t++)this.destroyFunctions[t]();this.destroyFunctions=null}for(var e=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.chromelessToolbar,this.hsplit,this.sidebarFooterContainer,this.layersDialog],t=0;t<e.length;t++)null!=e[t]&&null!=e[t].parentNode&&e[t].parentNode.removeChild(e[t])},Editor=function(t,e,n,i,l){mxEventSource.call(this),this.chromeless=null!=t?t:this.chromeless,this.initStencilRegistry(),this.graph=i||this.createGraph(e,n),this.editable=null!=l?l:!t,this.undoManager=this.createUndoManager(),this.status="",this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[Editor.pageCounter])+".xml"},this.getFilename=function(){return this.filename},this.setStatus=function(t){this.status=t,this.fireEvent(new mxEventObject("statusChanged"))},this.getStatus=function(){return this.status},this.graphChangeListener=function(t,e){e=null!=e?e.getProperty("edit"):null;null!=e&&e.ignoreEdit||this.setModified(!0)},this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)})),this.graph.resetViewOnRootChange=!1,this.init()},Editor.pageCounter=0,function(){try{for(var t=window;null!=t.opener&&void 0!==t.opener.Editor&&!isNaN(t.opener.Editor.pageCounter)&&t.opener!=t;)t=t.opener;null!=t&&(t.Editor.pageCounter++,Editor.pageCounter=t.Editor.pageCounter)}catch(t){}}(),Editor.useLocalStorage="undefined"!=typeof Storage&&mxClient.IS_IOS,Editor.moveImage=mxClient.IS_SVG?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI4cHgiIGhlaWdodD0iMjhweCI+PGc+PC9nPjxnPjxnPjxnPjxwYXRoIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIuNCwyLjQpc2NhbGUoMC44KXJvdGF0ZSg0NSwxMiwxMikiIHN0cm9rZT0iIzI5YjZmMiIgZmlsbD0iIzI5YjZmMiIgZD0iTTE1LDNsMi4zLDIuM2wtMi44OSwyLjg3bDEuNDIsMS40MkwxOC43LDYuN0wyMSw5VjNIMTV6IE0zLDlsMi4zLTIuM2wyLjg3LDIuODlsMS40Mi0xLjQyTDYuNyw1LjNMOSwzSDNWOXogTTksMjEgbC0yLjMtMi4zbDIuODktMi44N2wtMS40Mi0xLjQyTDUuMywxNy4zTDMsMTV2Nkg5eiBNMjEsMTVsLTIuMywyLjNsLTIuODctMi44OWwtMS40MiwxLjQybDIuODksMi44N0wxNSwyMWg2VjE1eiIvPjwvZz48L2c+PC9nPjwvc3ZnPgo=":IMAGE_PATH+"/move.png",Editor.rowMoveImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAEBAMAAACw6DhOAAAAGFBMVEUzMzP///9tbW1QUFCKiopBQUF8fHxfX1/IXlmXAAAAFElEQVQImWNgNVdzYBAUFBRggLMAEzYBy29kEPgAAAAASUVORK5CYII=":IMAGE_PATH+"/thumb_horz.png",Editor.helpImage=mxClient.IS_SVG?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSJub25lIiBkPSJNMCAwaDI0djI0SDB6Ii8+PHBhdGggZD0iTTExIDE4aDJ2LTJoLTJ2MnptMS0xNkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptMCAxOGMtNC40MSAwLTgtMy41OS04LThzMy41OS04IDgtOCA4IDMuNTkgOCA4LTMuNTkgOC04IDh6bTAtMTRjLTIuMjEgMC00IDEuNzktNCA0aDJjMC0xLjEuOS0yIDItMnMyIC45IDIgMmMwIDItMyAxLjc1LTMgNWgyYzAtMi4yNSAzLTIuNSAzLTUgMC0yLjIxLTEuNzktNC00LTR6Ii8+PC9zdmc+":IMAGE_PATH+"/help.png",Editor.checkmarkImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhFQAVAMQfAGxsbHx8fIqKioaGhvb29nJycvr6+sDAwJqamltbW5OTk+np6YGBgeTk5Ly8vJiYmP39/fLy8qWlpa6ursjIyOLi4vj4+N/f3+3t7fT09LCwsHZ2dubm5r6+vmZmZv///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OEY4NTZERTQ5QUFBMTFFMUE5MTVDOTM5MUZGMTE3M0QiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OEY4NTZERTU5QUFBMTFFMUE5MTVDOTM5MUZGMTE3M0QiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4Rjg1NkRFMjlBQUExMUUxQTkxNUM5MzkxRkYxMTczRCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4Rjg1NkRFMzlBQUExMUUxQTkxNUM5MzkxRkYxMTczRCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAB8ALAAAAAAVABUAAAVI4CeOZGmeaKqubKtylktSgCOLRyLd3+QJEJnh4VHcMoOfYQXQLBcBD4PA6ngGlIInEHEhPOANRkaIFhq8SuHCE1Hb8Lh8LgsBADs=":IMAGE_PATH+"/checkmark.gif",Editor.maximizeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVBAMAAABbObilAAAAElBMVEUAAAAAAAAAAAAAAAAAAAAAAADgKxmiAAAABXRSTlMA758vX1Pw3BoAAABJSURBVAjXY8AJQkODGBhUQ0MhbAUGBiYY24CBgRnGFmZgMISwgwwDGRhEhVVBbAVmEQYGRwMmBjIAQi/CTIRd6G5AuA3dzYQBAHj0EFdHkvV4AAAAAElFTkSuQmCC",Editor.zoomOutImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVBAMAAABbObilAAAAElBMVEUAAAAAAAAsLCxxcXEhISFgYGChjTUxAAAAAXRSTlMAQObYZgAAAEdJREFUCNdjIAMwCQrB2YKCggJQJqMwA7MglK1owMBgqABVApITgLJZXFxgbIQ4Qj3CHIT5ggoIe5kgNkM1KSDYKBKqxPkDAPo5BAZBE54hAAAAAElFTkSuQmCC",Editor.zoomInImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVBAMAAABbObilAAAAElBMVEUAAAAAAAAsLCwhISFxcXFgYGBavKaoAAAAAXRSTlMAQObYZgAAAElJREFUCNdjIAMwCQrB2YKCggJQJqMIA4sglK3owMzgqABVwsDMwCgAZTMbG8PYCHGEeoQ5CPMFFRD2MkFshmpSQLBRJFSJ8wcAEqcEM2uhl2MAAAAASUVORK5CYII=",Editor.zoomFitImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVBAMAAABbObilAAAAD1BMVEUAAAAAAAAwMDBwcHBgYGC1xl09AAAAAXRSTlMAQObYZgAAAEFJREFUCNdjIAMwCQrB2YKCggJQJqMwA7MglK1owMBgqABVApITwMdGqEeYgzBfUAFhLxPEZqgmBQQbRUKFOH8AAK5OA3lA+FFOAAAAAElFTkSuQmCC",Editor.layersImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAAaVBMVEUAAAAgICAICAgdHR0PDw8WFhYICAgLCwsXFxcvLy8ODg4uLi4iIiIqKiokJCQYGBgKCgonJycFBQUCAgIqKiocHBwcHBwODg4eHh4cHBwnJycJCQkUFBQqKiojIyMuLi4ZGRkgICAEBATOWYXAAAAAGnRSTlMAD7+fnz8/H7/ff18/77+vr5+fn39/b28fH2xSoKsAAACQSURBVBjTrYxJEsMgDARZZMAY73sgCcn/HxnhKtnk7j6oRq0psfuoyndZ/SuODkHPLzfVT6KeyPePnJ7KrnkRjWMXTn4SMnN8mXe2SSM3ts8L/ZUxxrbAULSYJJULE0Iw9pjpenoICcgcX61mGgTgtCv9Be99pzCoDhNQWQnchD1mup5++CYGcoQexajZbfwAj/0MD8ZOaUgAAAAASUVORK5CYII=",Editor.previousImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAAAh0lEQVQ4je3UsQnCUBCA4U8hpa1NsoEjpHQJS0dxADdwEMuMIJkgA1hYChbGQgMi+JC8q4L/AB/vDu7x74cWWEZhJU44RmA1zujR5GIbXF9YNrjD/Q0bDRY4fEBZ4P4LlgTnCbAf84pUM8/9hY08tMUtEoQ1LpEgrNBFglChFXR6Q6GfwwR6AGKJMF74Vtt3AAAAAElFTkSuQmCC",Editor.nextImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAAAi0lEQVQ4jeXUIQ7CUAwA0MeGxWI2yylwnALJUdBcgYvM7QYLmjOQIAkIPmJZghiIvypoUtX0tfnJL38X5ZfaEgUeUcManFBHgS0SLlhHggk3bCPBhCf2keCQR8wjwYTDp6YiZxJmOU1jGw7vGALescuBxsArNlOwd/CM1VSM/ut1qCIw+uOwiMJ+OF4CQzBCXm3hyAAAAABJRU5ErkJggg==",Editor.editImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCwALAIABAFdXV////yH5BAEAAAEALAAAAAALAAsAAAIZjB8AiKuc4jvLOGqzrjX6zmkWyChXaUJBAQA7":IMAGE_PATH+"/edit.gif",Editor.zoomOutLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAilBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////2N2iNAAAALXRSTlMA+vTcKMM96GRBHwXxi0YaX1HLrKWhiHpWEOnOr52Vb2xKSDcT19PKv5l/Ngdk8+viAAABJklEQVQ4y4WT2XaDMAxEvWD2nSSUNEnTJN3r//+9Sj7ILAY6L0ijC4ONYVZRpo6cByrz2YKSUGorGTpz71lPVHvT+avoB5wIkU/mxk8veceSuNoLg44IzziXjvpih72wKQnm8yc2UoiP/LAd8jQfe2Xf4Pq+2EyYIvv9wbzHHCgwxDdlBtWZOdqDfTCVgqpygQpsZaojVAVc9UjQxnAJDIBhiQv84tq3gMQCAVTxVoSibXJf8tMuc7e1TB/DCmejBNg/w1Y3c+AM5vv4w7xM59/oXamrHaLVqPQ+OTCnmMZxgz0SdL5zji0/ld6j88qGa5KIiBB6WeJGKfUKwSMKLuXgvl1TW0tm5R9UQL/efSDYsnzxD8CinhBsTTdugJatKpJwf8v+ADb8QmvW7AeAAAAAAElFTkSuQmCC",Editor.zoomInLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAilBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////2N2iNAAAALXRSTlMA+vTcKMM96GRBHwXxi0YaX1HLrKWhiHpWEOnOr52Vb2xKSDcT19PKv5l/Ngdk8+viAAABKElEQVQ4y4WT6WKCMBCENwkBwn2oFKvWqr3L+79es4EkQIDOH2d3Pxk2ABiJlB8JCXjqw4LikHVGLHTm3nM3UeVN5690GBBN0GwyV/3kkrUQR+WeKnREeKpzaXWd77CmJiXGfPIEI4V4yQ9TIW/ntlcMBe731Vts9w5TWG8F5j3mQI4hvrKpdGeYA7CX9qAcl650gVJartxRuhyHVghF8idQAIbFLvCLu28BsQEC6aKtCK6Pyb3JT7PmbmtNH8Ny56CotD/2qOs5cJbuffxgXmCib+xddVU5RNOhkvvkhTlFehzVWCOh3++MYElOhfdovaImnRYVmqDdsuhNp1QrBBE6uGC2+3ZNjGdg5B94oD+9uyVgWT79BwAxEBTWdOu3bWBVgsn/N/AHUD9IC01Oe40AAAAASUVORK5CYII=",Editor.actualSizeLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAilBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////2N2iNAAAALXRSTlMA+vTcKMM96GRBHwXxi0YaX1HLrKWhiHpWEOnOr52Vb2xKSDcT19PKv5l/Ngdk8+viAAABIUlEQVQ4y4WT2XqDIBCFBxDc9yTWNEnTJN3r+79eGT4BEbXnaubMr8dBBaM450dCQp4LWFAascGIRd48eB4cNYE7f6XjgGiCFs5c+dml6CFN6j1V6IQIlHPpdV/usKcmJcV88gQTRXjLD9Mhb+fWq8YG9/uCmTCFjeeDeY85UGKIUGUuqzN42kv7oCouq9oHamlzVR1lVfpAIu1QVRiW+sAv7r4FpAYIZZVsRXB9TP5Dfpo1d1trCgzz1iiptH/sUbdz4CzN9+mLeXHn3+hdddd4RDegsrvzwZwSs2GLPRJidAqCLTlVwaMPqpYMWjTWBB2WRW86pVkhSKyDK2bdt2tmagZG4sBD/evdLQHLEvQfAOKRoLCmG1FAB6uKmby+gz+REDn7O5+EwQAAAABJRU5ErkJggg==",Editor.printLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAXVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9RKvvlAAAAHnRSTlMAydnl77qbMLT093H7K4Nd4Ktn082+lYt5bkklEgP44nQSAAAApUlEQVQ4y73P2Q6DIBRF0cOgbRHHzhP//5m9mBAQKjG1cT0Yc7ITAMu1LNQgUZiQ2DYoNQ0sCQb6qgHAfRx48opq3J9AZ6xuF7uOew8Ik1OsCZRS2UAC9V+D9a+QZYxNA45YFQftPtSkATOhw7dAc0vPBwKWiIOjP0JZ0yMuQJ27g36DipOUsqRAM0dR8KD1/ILHaHSE/w8DIx09E3g/BTce6rHUB5sAPKvfF+JdAAAAAElFTkSuQmCC",Editor.layersLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAmVBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+/v7///+bnZkkAAAAMnRSTlMABPr8ByiD88KsTi/rvJb272mjeUA1CuPe1M/KjVxYHxMP6KZ0S9nYzGRGGRaznpGIbzaGUf0AAAHESURBVDjLbZLZYoIwEEVDgLCjbKIgAlqXqt3m/z+uNwu1rcyDhjl3ktnYL7OY254C0VX3yWFZfzDrOClbbgKxi0YDHjwl4jbnRkXxJS/C1YP3DbBhD1n7Ex4uaAqdVDb3yJ/4J/3nJD2to/ngQz/DfUvzMp4JJ5sSCaF5oXmemgQDfDxzbi+Kq4sU+vNcuAmx94JtyOP2DD4Epz2asWSCz4Z/4fECxyNj9zC9xNLHcdPEO+awDKeSaUu0W4twZQiO2hYVisTR3RCtK/c1X6t4xMEpiGqXqVntEBLolkZZsKY4QtwH6jzq67dEHlJysB1aNOD3XT7n1UkasQN59L4yC2RELMDSeCRtz3yV22Ub3ozIUTknYx8JWqDdQxbUes98cR2kZtUSveF/bAhcedwEWmlxIkpZUy4XOCb6VBjjxHvbwo/1lBAHHi2JCr0NI570QhyHq/DhJoE2lLgyA4RVe6KmZ47O/3b86MCP0HWa73A8/C3SUc5Qc1ajt6fgpXJ+RGpMvDSchepZDOOQRcZVIKcK90x2D7etqtI+56+u6n3sPriO6nfphitR4+O2m3EbM7lh3me1FM1o+LMI887rN+s3/wZdTFlpNVJiOAAAAABJRU5ErkJggg==",Editor.closeLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAUVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////8IN+deAAAAGnRSTlMAuvAIg/dDM/QlOeuFhj0S5s4vKgzjxJRQNiLSey0AAADNSURBVDjLfZLbEoMgDEQjRRRs1XqX///QNmOHJSnjPkHOGR7IEmeoGtJZstnwjqbRfIsmgEdtPCqe9Ynz7ZSc07rE2QiSc+qv8TvjRXA2PDUm3dpe82iJhOEUfxJJo3aCv+jKmRmH4lcCjCjeh9GWOdL/GZZkXH3PYYDrHBnfc4D/RVZf5sjoC1was+Y6HQxwaUxFvq/a0Pv343VCTxfBSRiB+ab3M3eiQZXmMNBJ3Y8pGRZtYQ7DgHMXJEdPLTaN/qBjzJOBc3nmNcbsA16bMR0oLqf+AAAAAElFTkSuQmCC",Editor.editLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAgVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9d3yJTAAAAKnRSTlMA+hzi3nRQWyXzkm0h2j3u54gzEgSXjlYoTBgJxL2loGpAOS3Jt7Wxm35Ga7gRAAAA6UlEQVQ4y63Q2XaCMBSF4Q0JBasoQ5DJqbXjfv8HbCK2BZNwo/8FXHx7rcMC7lQu0iX8qU/qtvAWCpoqH8dYzS0SwaV5eK/UAf8X9pd2CWKzuF5Jrftp1owXwnIGLUaL3PYndOHf4kNNXWrXK/m7CHunk7K8LE6YtBpcknwG9GKxnroY+ylBXcx4xKyx/u/EuXi509cP9V7OO1oyHnzrdFTcqLG/4ibBA5pIMr/4xvKzuQDkVy9wW8SgBFD6HDvuzMvrZcC9QlkfMzI7w64m+b4PqBMNHB05lH21PVxJo2/fBXxV4hB38PcD+5AkI4FuETsAAAAASUVORK5CYII=",Editor.previousLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAPFBMVEUAAAD////////////////////////////////////////////////////////////////////////////YSWgTAAAAE3RSTlMA7fci493c0MW8uJ6CZks4MxQHEZL6ewAAAFZJREFUOMvdkskRgDAMA4lDwg2B7b9XOlge/KKvdsa25KFb5XlRvxXC/DNBEv8IFNjBgGdDgXtFgTyhwDXiQAUHCvwa4Uv6mR6UR+1led2mVonvl+tML45qCQNQLIx7AAAAAElFTkSuQmCC",Editor.nextLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAPFBMVEUAAAD////////////////////////////////////////////////////////////////////////////YSWgTAAAAE3RSTlMA7fci493c0MW8uJ6CZks4MxQHEZL6ewAAAFRJREFUOMvd0skRgCAQBVEFwQ0V7fxzNQP6wI05v6pZ/kyj1b7FNgik2gQzzLcAwiUAigHOTwDHK4A1CmB5BJANJG1hQ9qafYcqFlZP3IFc9eVGrR+iIgkDQRUXIAAAAABJRU5ErkJggg==",Editor.refreshLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAolBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8ELnaCAAAANXRSTlMABfyE2QKU+dfNyyDyoVYKwnTv7N+6rntsYlFNQjEqEw316uSzf2c1JB3GvqebiVw6GAjQB4DQr10AAAE7SURBVDjLvZLXcoMwEABPIgRCx3TT3A3udqL//7UgAdGRcR4yk8k+idsdmgS/QyWEqD/axS2JDV33zlnzLHIzQ2MDq9OeJ3m8l76KKENYlxrmM/b65Ys1+8YxnTEZFIEY0vVhszFWfUGZDJpQTDznTgAe5k4XhQxILB7ruzBQn+kkyDXuHfRtjoYDEvH7J9Lz98dBZXXL94X0Ofco2PFlChKbjVzEdakoSlKjoNoqPYkJ/wUZAYwc+PpLj1Ei7+jdoBWlwQZoJv2H1w3CWgRvo7dd9DP5btgwCWz0M02+oVoxCcIWeY9PNmR6B++m9prMxYEISpCBYBlfy9bc745is7UUULAem1Ww7FfalsiA2uaJsgmWP3pQI9q9/yMLkaaHAp2fxhHff/cNq7dBdHXhGW7l+Mo2zU0Cf8knJ2xA0oJ8enwAAAAASUVORK5CYII=",Editor.backLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAclBMVEUAAAD////////////////+/v7////////////////////////////////////////////+/v7///////////////////////////////////////////////////////////////////////////////8vKLfTAAAAJXRSTlMACh7h9gby3NLIwzwZ55uVJgH57b+8tbCljYV1RRMQ46FrTzQw+vtxOQAAAJ5JREFUOMuF00cWgzAQA1DRDQFCbwFSdf8rZpdVrNH2z3tuMv7mldZQ2WN2yi8x+TT8JvyTkqvwpiKvwsOIrA1fWr+XGTklfj8dOQR+D3KyUF6QufBkJN0hfCazEv6sZBRCJDUcPasGKpu1RLtYE8lkHAPBQLoTsK/SfAyRw5FjAuhCzC2MSj0gJ+66lHatgXdKboD9tfREB5m9/+3iC9jHDYvsGNcUAAAAAElFTkSuQmCC",Editor.fullscreenLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAllBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AJcWoAAAAMXRSTlMA+wIFxPWPCIb446tnUxmsoIykgxTe29jQnpKBe2MNsZhVTR/KyLuWbFhEPjUq7L9z+bQj+gAAAWxJREFUOMttk4l2gkAMRTODCO4FtQgIbnWpS9v8/881iZFh8R51NO8GJ+gAjMN8zuTRFSw04cIOHQcqFHH6oaQFGxf0jeBjEgB8Y52TpW9Ag4zB5QICWOtHrgwGuFZBcw+gPP0MFS7+iiD5inOmDIQS9sZgTwUzwEzyxhxHVEEU7NdDUXsqUPtqjIgR2IZSCT4upzSeIeOdcMHnfDsx3giPoezfU6MrQGB5//SckLEG2xYscK4GfnUFqaix39zrwooaOD/cXoYuvHKQIc7pzd3HVPusp6t2FAW/RmjMonbl8vwHDeZo/GkleJC7e+p5XA/rAq1X/V10wKag04rBpa2/d0LL4OYYceOEtsG5jyMntI1wS+N1BGcQBl/CoLoPOl9ABrW/BP53e1bwSJHHlkIVchJwmHwyyfJ4kIvEnKtwkxNSEct83KSChT7WiWgDZ3ccZ0BM4tloJow2YUAtifNT3njnyD+y/pMsnP4DN3Y4yl1Gyk0AAAAASUVORK5CYII=",Editor.roughFillStyles=[{val:"auto",dispName:"Auto"},{val:"hachure",dispName:"Hachure"},{val:"solid",dispName:"Solid"},{val:"zigzag",dispName:"ZigZag"},{val:"cross-hatch",dispName:"Cross Hatch"},{val:"dots",dispName:"Dots"},{val:"dashed",dispName:"Dashed"},{val:"zigzag-line",dispName:"ZigZag Line"}],Editor.themes=null,Editor.ctrlKey=mxClient.IS_MAC?"Cmd":"Ctrl",Editor.hintOffset=20,Editor.popupsAllowed=!0,mxUtils.extend(Editor,mxEventSource),Editor.prototype.originalNoForeignObject=mxClient.NO_FO,Editor.prototype.transparentImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhMAAwAIAAAP///wAAACH5BAEAAAAALAAAAAAwADAAAAIxhI+py+0Po5y02ouz3rz7D4biSJbmiabqyrbuC8fyTNf2jef6zvf+DwwKh8Si8egpAAA7":IMAGE_PATH+"/transparent.gif",Editor.prototype.extendCanvas=!0,Editor.prototype.chromeless=!1,Editor.prototype.cancelFirst=!0,Editor.prototype.enabled=!0,Editor.prototype.filename=null,Editor.prototype.modified=!1,Editor.prototype.autosave=!0,Editor.prototype.initialTopSpacing=0,Editor.prototype.appName=document.title,Editor.prototype.editBlankUrl=window.location.protocol+"//"+window.location.host+"/",Editor.prototype.defaultGraphOverflow="hidden",Editor.prototype.init=function(){},Editor.prototype.isChromelessView=function(){return this.chromeless},Editor.prototype.setAutosave=function(t){this.autosave=t,this.fireEvent(new mxEventObject("autosaveChanged"))},Editor.prototype.getEditBlankUrl=function(t){return this.editBlankUrl+t},Editor.prototype.editAsNew=function(e,t){var n,i,t=null!=t?"?title="+encodeURIComponent(t):"";null!=urlParams.ui&&(t+=(0<t.length?"&":"?")+"ui="+urlParams.ui),void 0!==window.postMessage&&(null==document.documentMode||10<=document.documentMode)?(n=null,i=mxUtils.bind(this,function(t){"ready"==t.data&&t.source==n&&(mxEvent.removeListener(window,"message",i),n.postMessage(e,"*"))}),mxEvent.addListener(window,"message",i),n=this.graph.openLink(this.getEditBlankUrl(t+(0<t.length?"&":"?")+"client=1"),null,!0)):this.graph.openLink(this.getEditBlankUrl(t)+"#R"+encodeURIComponent(e))},Editor.prototype.createGraph=function(t,e){t=new Graph(null,e,null,null,t);return t.transparentBackground=!1,this.chromeless||(t.isBlankLink=function(t){return!this.isExternalProtocol(t)}),t},Editor.prototype.resetGraph=function(){this.graph.gridEnabled=!this.isChromelessView()||"1"==urlParams.grid,this.graph.graphHandler.guidesEnabled=!0,this.graph.setTooltips(!0),this.graph.setConnectable(!0),this.graph.foldingEnabled=!0,this.graph.scrollbars=this.graph.defaultScrollbars,this.graph.pageVisible=this.graph.defaultPageVisible,this.graph.pageBreaksVisible=this.graph.pageVisible,this.graph.preferPageSize=this.graph.pageBreaksVisible,this.graph.background=null,this.graph.pageScale=mxGraph.prototype.pageScale,this.graph.pageFormat=mxGraph.prototype.pageFormat,this.graph.currentScale=1,this.graph.currentTranslate.x=0,this.graph.currentTranslate.y=0,this.updateGraphComponents(),this.graph.view.setScale(1)},Editor.prototype.readGraphState=function(t){this.graph.gridEnabled="0"!=t.getAttribute("grid")&&(!this.isChromelessView()||"1"==urlParams.grid),this.graph.gridSize=parseFloat(t.getAttribute("gridSize"))||mxGraph.prototype.gridSize,this.graph.graphHandler.guidesEnabled="0"!=t.getAttribute("guides"),this.graph.setTooltips("0"!=t.getAttribute("tooltips")),this.graph.setConnectable("0"!=t.getAttribute("connect")),this.graph.connectionArrowsEnabled="0"!=t.getAttribute("arrows"),this.graph.foldingEnabled="0"!=t.getAttribute("fold"),this.isChromelessView()&&this.graph.foldingEnabled&&(this.graph.foldingEnabled="1"==urlParams.nav,this.graph.cellRenderer.forceControlClickHandler=this.graph.foldingEnabled);var e=parseFloat(t.getAttribute("pageScale"));!isNaN(e)&&0<e?this.graph.pageScale=e:this.graph.pageScale=mxGraph.prototype.pageScale,this.graph.isLightboxView()||this.graph.isViewer()?this.graph.pageVisible=!1:(n=t.getAttribute("page"),this.graph.pageVisible=null!=n?"0"!=n:this.graph.defaultPageVisible),this.graph.pageBreaksVisible=this.graph.pageVisible,this.graph.preferPageSize=this.graph.pageBreaksVisible;var e=parseFloat(t.getAttribute("pageWidth")),n=parseFloat(t.getAttribute("pageHeight"));isNaN(e)||isNaN(n)||(this.graph.pageFormat=new mxRectangle(0,0,e,n));t=t.getAttribute("background");null!=t&&0<t.length?this.graph.background=t:this.graph.background=null},Editor.prototype.setGraphXml=function(t){if(null!=t){var e=new mxCodec(t.ownerDocument);if("mxGraphModel"==t.nodeName){this.graph.model.beginUpdate();try{this.graph.model.clear(),this.graph.view.scale=1,this.readGraphState(t),this.updateGraphComponents(),e.decode(t,this.graph.getModel())}finally{this.graph.model.endUpdate()}this.fireEvent(new mxEventObject("resetGraphView"))}else{if("root"!=t.nodeName)throw{message:mxResources.get("cannotOpenFile"),node:t,toString:function(){return this.message}};this.resetGraph();var n=e.document.createElement("mxGraphModel");n.appendChild(t),e.decode(n,this.graph.getModel()),this.updateGraphComponents(),this.fireEvent(new mxEventObject("resetGraphView"))}}else this.resetGraph(),this.graph.model.clear(),this.fireEvent(new mxEventObject("resetGraphView"))},Editor.prototype.getGraphXml=function(t){var e=null;return e=(t=null==t||t)?new mxCodec(mxUtils.createXmlDocument()).encode(this.graph.getModel()):this.graph.encodeCells(mxUtils.sortCells(this.graph.model.getTopmostCells(this.graph.getSelectionCells()))),0==this.graph.view.translate.x&&0==this.graph.view.translate.y||(e.setAttribute("dx",Math.round(100*this.graph.view.translate.x)/100),e.setAttribute("dy",Math.round(100*this.graph.view.translate.y)/100)),e.setAttribute("grid",this.graph.isGridEnabled()?"1":"0"),e.setAttribute("gridSize",this.graph.gridSize),e.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0"),e.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0"),e.setAttribute("connect",this.graph.connectionHandler.isEnabled()?"1":"0"),e.setAttribute("arrows",this.graph.connectionArrowsEnabled?"1":"0"),e.setAttribute("fold",this.graph.foldingEnabled?"1":"0"),e.setAttribute("page",this.graph.pageVisible?"1":"0"),e.setAttribute("pageScale",this.graph.pageScale),e.setAttribute("pageWidth",this.graph.pageFormat.width),e.setAttribute("pageHeight",this.graph.pageFormat.height),null!=this.graph.background&&e.setAttribute("background",this.graph.background),e},Editor.prototype.updateGraphComponents=function(){var t=this.graph;null!=t.container&&(t.view.validateBackground(),t.container.style.overflow=t.scrollbars?"auto":this.defaultGraphOverflow,this.fireEvent(new mxEventObject("updateGraphComponents")))},Editor.prototype.setModified=function(t){this.modified=t},Editor.prototype.setFilename=function(t){this.filename=t},Editor.prototype.createUndoManager=function(){var s=this.graph,n=new mxUndoManager;this.undoListener=function(t,e){n.undoableEditHappened(e.getProperty("edit"))};var t=mxUtils.bind(this,function(t,e){this.undoListener.apply(this,arguments)});s.getModel().addListener(mxEvent.UNDO,t),s.getView().addListener(mxEvent.UNDO,t);t=function(t,e){var n=s.getSelectionCellsForChanges(e.getProperty("edit").changes,function(t){return!(t instanceof mxChildChange)});if(0<n.length){s.getModel();for(var i=[],l=0;l<n.length;l++)null!=s.view.getState(n[l])&&i.push(n[l]);s.setSelectionCells(i)}};return n.addListener(mxEvent.UNDO,t),n.addListener(mxEvent.REDO,t),n},Editor.prototype.initStencilRegistry=function(){},Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)},OpenFile=function(t){this.producer=null,this.consumer=null,this.done=t,this.args=null},OpenFile.prototype.setConsumer=function(t){this.consumer=t,this.execute()},OpenFile.prototype.setData=function(){this.args=arguments,this.execute()},OpenFile.prototype.error=function(t){this.cancel(!0),mxUtils.alert(t)},OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.args&&(this.cancel(!1),this.consumer.apply(this,this.args))},OpenFile.prototype.cancel=function(t){null!=this.done&&this.done(null==t||t)},Dialog.backdropColor="white",Dialog.prototype.zIndex=mxPopupMenu.prototype.zIndex-1,Dialog.prototype.noColorImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzRDlBMUUwODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzRDlBMUUxODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTNEOUExREU4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTNEOUExREY4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5xh3fmAAAABlBMVEX////MzMw46qqDAAAAGElEQVR42mJggAJGKGAYIIGBth8KAAIMAEUQAIElnLuQAAAAAElFTkSuQmCC":IMAGE_PATH+"/nocolor.png",Dialog.prototype.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJAQMAAADaX5RTAAAABlBMVEV7mr3///+wksspAAAAAnRSTlP/AOW3MEoAAAAdSURBVAgdY9jXwCDDwNDRwHCwgeExmASygSL7GgB12QiqNHZZIwAAAABJRU5ErkJggg==":IMAGE_PATH+"/close.png",Dialog.prototype.clearImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQAKAIABAMDAwP///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OUIzOEM1NzI4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OUIzOEM1NzM4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5QjM4QzU3MDg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5QjM4QzU3MTg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAAEALAAAAAANAAoAAAIXTGCJebD9jEOTqRlttXdrB32PJ2ncyRQAOw==":IMAGE_PATH+"/clear.gif",Dialog.prototype.lockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAMAAABhq6zVAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzdDMDZCODExNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzdDMDZCODIxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDozN0MwNkI3RjE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDozN0MwNkI4MDE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvqMCFYAAAAVUExURZmZmb+/v7KysqysrMzMzLGxsf///4g8N1cAAAAHdFJOU////////wAaSwNGAAAAPElEQVR42lTMQQ4AIQgEwUa0//9kTQirOweYOgDqAMbZUr10AGlAwx4/BJ2QJ4U0L5brYjovvpv32xZgAHZaATFtMbu4AAAAAElFTkSuQmCC":IMAGE_PATH+"/locked.png",Dialog.prototype.unlockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAMAAABhq6zVAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzdDMDZCN0QxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzdDMDZCN0UxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDozN0MwNkI3QjE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDozN0MwNkI3QzE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PkKMpVwAAAAYUExURZmZmbKysr+/v6ysrOXl5czMzLGxsf///zHN5lwAAAAIdFJOU/////////8A3oO9WQAAADxJREFUeNpUzFESACAEBNBVsfe/cZJU+8Mzs8CIABCidtfGOndnYsT40HDSiCcbPdoJo10o9aI677cpwACRoAF3dFNlswAAAABJRU5ErkJggg==":IMAGE_PATH+"/unlocked.png",Dialog.prototype.bgOpacity=80,Dialog.prototype.getPosition=function(t,e){return new mxPoint(t,e)},Dialog.prototype.close=function(t,e){if(null!=this.onDialogClose){if(0==this.onDialogClose(t,e))return!1;this.onDialogClose=null}null!=this.dialogImg&&(this.dialogImg.parentNode.removeChild(this.dialogImg),this.dialogImg=null),null!=this.bg&&null!=this.bg.parentNode&&this.bg.parentNode.removeChild(this.bg),mxEvent.removeListener(window,"resize",this.resizeListener),this.container.parentNode.removeChild(this.container)};var ErrorDialog=function(t,e,n,i,l,s,o,r,a,h,d){a=null==a||a;var u=document.createElement("div");u.style.textAlign="center",null!=e&&((p=document.createElement("div")).style.padding="0px",p.style.margin="0px",p.style.fontSize="18px",p.style.paddingBottom="16px",p.style.marginBottom="10px",p.style.borderBottom="1px solid #c0c0c0",p.style.color="gray",p.style.whiteSpace="nowrap",p.style.textOverflow="ellipsis",p.style.overflow="hidden",mxUtils.write(p,e),p.setAttribute("title",e),u.appendChild(p));var p=document.createElement("div");p.style.lineHeight="1.2em",p.style.padding="6px",p.innerHTML=n,u.appendChild(p);n=document.createElement("div");n.style.marginTop="12px",n.style.textAlign="center",null!=s&&((p=mxUtils.button(mxResources.get("tryAgain"),function(){t.hideDialog(),s()})).className="geBtn",n.appendChild(p),n.style.textAlign="center"),null!=h&&((h=mxUtils.button(h,function(){null!=d&&d()})).className="geBtn",n.appendChild(h));var m=mxUtils.button(i,function(){a&&t.hideDialog(),null!=l&&l()});m.className="geBtn",n.appendChild(m),null!=o&&((o=mxUtils.button(o,function(){a&&t.hideDialog(),null!=r&&r()})).className="geBtn gePrimaryBtn",n.appendChild(o)),this.init=function(){m.focus()},u.appendChild(n),this.container=u},PrintDialog=function(t,e){this.create(t,e)};PrintDialog.prototype.create=function(t){var e,r=t.editor.graph,n=document.createElement("table");n.style.width="100%",n.style.height="100%";var i=document.createElement("tbody"),l=document.createElement("tr"),a=document.createElement("input");a.setAttribute("type","checkbox"),(e=document.createElement("td")).setAttribute("colspan","2"),e.style.fontSize="10pt",e.appendChild(a);var s=document.createElement("span");mxUtils.write(s," "+mxResources.get("fitPage")),e.appendChild(s),mxEvent.addListener(s,"click",function(t){a.checked=!a.checked,h.checked=!a.checked,mxEvent.consume(t)}),mxEvent.addListener(a,"change",function(){h.checked=!a.checked}),l.appendChild(e),i.appendChild(l),l=l.cloneNode(!1);var h=document.createElement("input");h.setAttribute("type","checkbox"),(e=document.createElement("td")).style.fontSize="10pt",e.appendChild(h);s=document.createElement("span");mxUtils.write(s," "+mxResources.get("posterPrint")+":"),e.appendChild(s),mxEvent.addListener(s,"click",function(t){h.checked=!h.checked,a.checked=!h.checked,mxEvent.consume(t)}),l.appendChild(e);var d=document.createElement("input");d.setAttribute("value","1"),d.setAttribute("type","number"),d.setAttribute("min","1"),d.setAttribute("size","4"),d.setAttribute("disabled","disabled"),d.style.width="50px",(e=document.createElement("td")).style.fontSize="10pt",e.appendChild(d),mxUtils.write(e," "+mxResources.get("pages")+" (max)"),l.appendChild(e),i.appendChild(l),mxEvent.addListener(h,"change",function(){h.checked?d.removeAttribute("disabled"):d.setAttribute("disabled","disabled"),a.checked=!h.checked}),l=l.cloneNode(!1),e=document.createElement("td"),mxUtils.write(e,mxResources.get("pageScale")+":"),l.appendChild(e),e=document.createElement("td");var u=document.createElement("input");function o(t){var e=a.checked||h.checked,n=parseInt(u.value)/100;isNaN(n)&&(n=1,u.value="100%"),n*=.75;var i=r.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,l=1/r.pageScale;e&&(o=a.checked?1:parseInt(d.value),isNaN(o)||(l=mxUtils.getScaleForPageCount(o,r,i)));r.getGraphBounds();var s=0,o=0;(i=mxRectangle.fromRectangle(i)).width=Math.ceil(i.width*n),i.height=Math.ceil(i.height*n),l*=n,!e&&r.pageVisible?(s-=(n=r.getPageLayout()).x*i.width,o-=n.y*i.height):e=!0;e=PrintDialog.createPrintPreview(r,l,i,0,s,o,e);e.open(),t&&PrintDialog.printPreview(e)}u.setAttribute("value","100 %"),u.setAttribute("size","5"),u.style.width="50px",e.appendChild(u),l.appendChild(e),i.appendChild(l),l=document.createElement("tr"),(e=document.createElement("td")).colSpan=2,e.style.paddingTop="20px",e.setAttribute("align","right");s=mxUtils.button(mxResources.get("cancel"),function(){t.hideDialog()});s.className="geBtn",t.editor.cancelFirst&&e.appendChild(s),PrintDialog.previewEnabled&&((p=mxUtils.button(mxResources.get("preview"),function(){t.hideDialog(),o(!1)})).className="geBtn",e.appendChild(p));var p=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){t.hideDialog(),o(!0)});p.className="geBtn gePrimaryBtn",e.appendChild(p),t.editor.cancelFirst||e.appendChild(s),l.appendChild(e),i.appendChild(l),n.appendChild(i),this.container=n},PrintDialog.printPreview=function(t){try{var e;null!=t.wnd&&(e=function(){t.wnd.focus(),t.wnd.print(),t.wnd.close()},mxClient.IS_GC?window.setTimeout(e,500):e())}catch(t){}},PrintDialog.createPrintPreview=function(t,e,n,i,l,s,o){s=new mxPrintPreview(t,e,n,i,l,s);s.title=mxResources.get("preview"),s.printBackgroundImage=!0,s.autoOrigin=o;t=t.background;null!=t&&""!=t&&t!=mxConstants.NONE||(t="#ffffff"),s.backgroundColor=t;var r=s.writeHead;return s.writeHead=function(t){r.apply(this,arguments),t.writeln('<style type="text/css">'),t.writeln("@media screen {"),t.writeln(" body > div { padding:30px;box-sizing:content-box; }"),t.writeln("}"),t.writeln("</style>")},s},PrintDialog.previewEnabled=!0;var PageSetupDialog=function(i){var l=i.editor.graph,t=document.createElement("table");t.style.width="100%",t.style.height="100%";var e,n=document.createElement("tbody"),s=document.createElement("tr");(e=document.createElement("td")).style.verticalAlign="top",e.style.fontSize="10pt",mxUtils.write(e,mxResources.get("paperSize")+":"),s.appendChild(e),(e=document.createElement("td")).style.verticalAlign="top",e.style.fontSize="10pt";var o=PageSetupDialog.addPageFormatPanel(e,"pagesetupdialog",l.pageFormat);s.appendChild(e),n.appendChild(s),s=document.createElement("tr"),e=document.createElement("td"),mxUtils.write(e,mxResources.get("background")+":"),s.appendChild(e),(e=document.createElement("td")).style.whiteSpace="nowrap",document.createElement("input").setAttribute("type","text");var r=document.createElement("button");r.style.width="18px",r.style.height="18px",r.style.marginRight="20px",r.style.backgroundPosition="center center",r.style.backgroundRepeat="no-repeat";var a=l.background;function h(){null==a||a==mxConstants.NONE?(r.style.backgroundColor="",r.style.backgroundImage="url('"+Dialog.prototype.noColorImage+"')"):(r.style.backgroundColor=a,r.style.backgroundImage="")}h(),mxEvent.addListener(r,"click",function(t){i.pickColor(a||"none",function(t){a=t,h()}),mxEvent.consume(t)}),e.appendChild(r),mxUtils.write(e,mxResources.get("gridSize")+":");var d=document.createElement("input");d.setAttribute("type","number"),d.setAttribute("min","0"),d.style.width="40px",d.style.marginLeft="6px",d.value=l.getGridSize(),e.appendChild(d),mxEvent.addListener(d,"change",function(){var t=parseInt(d.value);d.value=Math.max(1,isNaN(t)?l.getGridSize():t)}),s.appendChild(e),n.appendChild(s),s=document.createElement("tr"),e=document.createElement("td"),mxUtils.write(e,mxResources.get("image")+":"),s.appendChild(e),e=document.createElement("td");var u=document.createElement("a");u.style.textDecoration="underline",u.style.cursor="pointer",u.style.color="#a0a0a0";var p=l.backgroundImage;function m(){null==p?(u.removeAttribute("title"),u.style.fontSize="",u.innerHTML=mxUtils.htmlEntities(mxResources.get("change"))+"..."):(u.setAttribute("title",p.src),u.style.fontSize="11px",u.innerHTML=mxUtils.htmlEntities(p.src.substring(0,42))+"...")}mxEvent.addListener(u,"click",function(t){i.showBackgroundImageDialog(function(t,e){e||(p=t,m())},p),mxEvent.consume(t)}),m(),e.appendChild(u),s.appendChild(e),n.appendChild(s),s=document.createElement("tr"),(e=document.createElement("td")).colSpan=2,e.style.paddingTop="16px",e.setAttribute("align","right");var c=mxUtils.button(mxResources.get("cancel"),function(){i.hideDialog()});c.className="geBtn",i.editor.cancelFirst&&e.appendChild(c);var g=mxUtils.button(mxResources.get("apply"),function(){i.hideDialog();var t=parseInt(d.value);isNaN(t)||l.gridSize===t||l.setGridSize(t);var e=new ChangePageSetup(i,a,p,o.get());e.ignoreColor=l.background==a;var n=null!=l.backgroundImage?l.backgroundImage.src:null,t=null!=p?p.src:null;e.ignoreImage=n===t,l.pageFormat.width==e.previousFormat.width&&l.pageFormat.height==e.previousFormat.height&&e.ignoreColor&&e.ignoreImage||l.model.execute(e)});g.className="geBtn gePrimaryBtn",e.appendChild(g),i.editor.cancelFirst||e.appendChild(c),s.appendChild(e),n.appendChild(s),t.appendChild(n),this.container=t};PageSetupDialog.addPageFormatPanel=function(t,e,o,i){var n="format-"+e,r=document.createElement("input");r.setAttribute("name",n),r.setAttribute("type","radio"),r.setAttribute("value","portrait");var a=document.createElement("input");a.setAttribute("name",n),a.setAttribute("type","radio"),a.setAttribute("value","landscape");var h=document.createElement("select");h.style.marginBottom="8px",h.style.width="202px";var d=document.createElement("div");d.style.marginLeft="4px",d.style.width="210px",d.style.height="24px",r.style.marginRight="6px",d.appendChild(r);e=document.createElement("span");e.style.maxWidth="100px",mxUtils.write(e,mxResources.get("portrait")),d.appendChild(e),a.style.marginLeft="10px",a.style.marginRight="6px",d.appendChild(a);n=document.createElement("span");n.style.width="100px",mxUtils.write(n,mxResources.get("landscape")),d.appendChild(n);var u=document.createElement("div");u.style.marginLeft="4px",u.style.width="210px",u.style.height="24px";var p=document.createElement("input");p.setAttribute("size","7"),p.style.textAlign="right",u.appendChild(p),mxUtils.write(u," in x ");var m=document.createElement("input");m.setAttribute("size","7"),m.style.textAlign="right",u.appendChild(m),mxUtils.write(u," in"),d.style.display="none",u.style.display="none";for(var l=new Object,c=PageSetupDialog.getFormats(),s=0;s<c.length;s++){var g=c[s];l[g.key]=g;var x=document.createElement("option");x.setAttribute("value",g.key),mxUtils.write(x,g.title),h.appendChild(x)}var y=!1;function f(t,e,n){if(n||p!=document.activeElement&&m!=document.activeElement){for(var i=!1,l=0;l<c.length;l++){var s=c[l];y?"custom"==s.key&&(h.value=s.key,y=!1):null!=s.format&&("a4"==s.key?826==o.width?(o=mxRectangle.fromRectangle(o)).width=827:826==o.height&&((o=mxRectangle.fromRectangle(o)).height=827):"a5"==s.key&&(584==o.width?(o=mxRectangle.fromRectangle(o)).width=583:584==o.height&&((o=mxRectangle.fromRectangle(o)).height=583)),o.width==s.format.width&&o.height==s.format.height?(h.value=s.key,r.setAttribute("checked","checked"),r.defaultChecked=!0,r.checked=!0,a.removeAttribute("checked"),a.defaultChecked=!1,i=!(a.checked=!1)):o.width==s.format.height&&o.height==s.format.width&&(h.value=s.key,r.removeAttribute("checked"),r.defaultChecked=!1,r.checked=!1,a.setAttribute("checked","checked"),a.defaultChecked=!0,i=a.checked=!0))}i?(d.style.display="",u.style.display="none"):(p.value=o.width/100,m.value=o.height/100,r.setAttribute("checked","checked"),h.value="custom",d.style.display="none",u.style.display="")}}f(),t.appendChild(h),mxUtils.br(t),t.appendChild(d),t.appendChild(u);function C(t,e){var n=l[h.value];null!=n.format?(p.value=n.format.width/100,m.value=n.format.height/100,u.style.display="none",d.style.display=""):(d.style.display="none",u.style.display=""),n=parseFloat(p.value),(isNaN(n)||n<=0)&&(p.value=o.width/100),n=parseFloat(m.value),(isNaN(n)||n<=0)&&(m.value=o.height/100),n=new mxRectangle(0,0,Math.floor(100*parseFloat(p.value)),Math.floor(100*parseFloat(m.value))),"custom"!=h.value&&a.checked&&(n=new mxRectangle(0,0,n.height,n.width)),e&&y||n.width==v.width&&n.height==v.height||(v=n,null!=i&&i(v))}var v=o;return mxEvent.addListener(e,"click",function(t){r.checked=!0,C(),mxEvent.consume(t)}),mxEvent.addListener(n,"click",function(t){a.checked=!0,C(),mxEvent.consume(t)}),mxEvent.addListener(p,"blur",C),mxEvent.addListener(p,"click",C),mxEvent.addListener(m,"blur",C),mxEvent.addListener(m,"click",C),mxEvent.addListener(a,"change",C),mxEvent.addListener(r,"change",C),mxEvent.addListener(h,"change",function(t){y="custom"==h.value,C(0,!0)}),C(),{set:function(t){o=t,f(0,0,!0)},get:function(){return v},widthInput:p,heightInput:m}},PageSetupDialog.getFormats=function(){return[{key:"letter",title:'US-Letter (8,5" x 11")',format:mxConstants.PAGE_FORMAT_LETTER_PORTRAIT},{key:"legal",title:'US-Legal (8,5" x 14")',format:new mxRectangle(0,0,850,1400)},{key:"tabloid",title:'US-Tabloid (11" x 17")',format:new mxRectangle(0,0,1100,1700)},{key:"executive",title:'US-Executive (7" x 10")',format:new mxRectangle(0,0,700,1e3)},{key:"a0",title:"A0 (841 mm x 1189 mm)",format:new mxRectangle(0,0,3300,4681)},{key:"a1",title:"A1 (594 mm x 841 mm)",format:new mxRectangle(0,0,2339,3300)},{key:"a2",title:"A2 (420 mm x 594 mm)",format:new mxRectangle(0,0,1654,2336)},{key:"a3",title:"A3 (297 mm x 420 mm)",format:new mxRectangle(0,0,1169,1654)},{key:"a4",title:"A4 (210 mm x 297 mm)",format:mxConstants.PAGE_FORMAT_A4_PORTRAIT},{key:"a5",title:"A5 (148 mm x 210 mm)",format:new mxRectangle(0,0,583,827)},{key:"a6",title:"A6 (105 mm x 148 mm)",format:new mxRectangle(0,0,413,583)},{key:"a7",title:"A7 (74 mm x 105 mm)",format:new mxRectangle(0,0,291,413)},{key:"b4",title:"B4 (250 mm x 353 mm)",format:new mxRectangle(0,0,980,1390)},{key:"b5",title:"B5 (176 mm x 250 mm)",format:new mxRectangle(0,0,690,980)},{key:"16-9",title:"16:9 (1600 x 900)",format:new mxRectangle(0,0,900,1600)},{key:"16-10",title:"16:10 (1920 x 1200)",format:new mxRectangle(0,0,1200,1920)},{key:"4-3",title:"4:3 (1600 x 1200)",format:new mxRectangle(0,0,1200,1600)},{key:"custom",title:mxResources.get("custom"),format:null}]};var FilenameDialog=function(n,t,e,i,l,s,o,r,a,h,d,u){var p,m;a=null==a||a;var c=document.createElement("table"),g=document.createElement("tbody");c.style.marginTop="8px",p=document.createElement("tr"),(m=document.createElement("td")).style.whiteSpace="nowrap",m.style.fontSize="10pt",m.style.width=d?"80px":"120px",mxUtils.write(m,(l||mxResources.get("filename"))+":"),p.appendChild(m);var x=document.createElement("input");x.setAttribute("value",t||""),x.style.marginLeft="4px",x.style.width=null!=u?u+"px":"180px";var y=mxUtils.button(e,function(){null!=s&&!s(x.value)||(a&&n.hideDialog(),i(x.value))});y.className="geBtn gePrimaryBtn",this.init=function(){var t,e;null==l&&null!=o||(x.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?x.select():document.execCommand("selectAll",!1,null),!Graph.fileSupport||null!=(t=c.parentNode)&&(n.editor.graph,e=null,mxEvent.addListener(t,"dragleave",function(t){null!=e&&(e.style.backgroundColor="",e=null),t.stopPropagation(),t.preventDefault()}),mxEvent.addListener(t,"dragover",mxUtils.bind(this,function(t){null==e&&(!mxClient.IS_IE||10<document.documentMode)&&((e=x).style.backgroundColor="#ebf2f9"),t.stopPropagation(),t.preventDefault()})),mxEvent.addListener(t,"drop",mxUtils.bind(this,function(t){null!=e&&(e.style.backgroundColor="",e=null),0<=mxUtils.indexOf(t.dataTransfer.types,"text/uri-list")&&(x.value=decodeURIComponent(t.dataTransfer.getData("text/uri-list")),y.click()),t.stopPropagation(),t.preventDefault()}))))},(m=document.createElement("td")).style.whiteSpace="nowrap",m.appendChild(x),p.appendChild(m),null==l&&null!=o||(g.appendChild(p),null!=d&&(null!=n.editor.diagramFileTypes&&((e=FilenameDialog.createFileTypes(n,x,n.editor.diagramFileTypes)).style.marginLeft="6px",e.style.width="74px",m.appendChild(e),x.style.width=null!=u?u-40+"px":"140px"),m.appendChild(FilenameDialog.createTypeHint(n,x,d)))),null!=o&&(p=document.createElement("tr"),(m=document.createElement("td")).colSpan=2,m.appendChild(o),p.appendChild(m),g.appendChild(p)),p=document.createElement("tr"),(m=document.createElement("td")).colSpan=2,m.style.paddingTop="20px",m.style.whiteSpace="nowrap",m.setAttribute("align","right");u=mxUtils.button(mxResources.get("cancel"),function(){n.hideDialog(),null!=h&&h()});u.className="geBtn",n.editor.cancelFirst&&m.appendChild(u),null!=r&&((d=mxUtils.button(mxResources.get("help"),function(){n.editor.graph.openLink(r)})).className="geBtn",m.appendChild(d)),mxEvent.addListener(x,"keypress",function(t){13==t.keyCode&&y.click()}),m.appendChild(y),n.editor.cancelFirst||m.appendChild(u),p.appendChild(m),g.appendChild(p),c.appendChild(g),this.container=c};function Sidebar(t,e){this.editorUi=t,this.container=e,this.palettes=new Object,this.taglist=new Object,this.showTooltips=!0,this.graph=t.createTemporaryGraph(this.editorUi.editor.graph.getStylesheet()),this.graph.cellRenderer.minSvgStrokeWidth=this.minThumbStrokeWidth,this.graph.cellRenderer.antiAlias=this.thumbAntiAlias,this.graph.container.style.visibility="hidden",this.graph.foldingEnabled=!1,document.body.appendChild(this.graph.container),this.pointerUpHandler=mxUtils.bind(this,function(){this.showTooltips=!0}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerup":"mouseup",this.pointerUpHandler),this.pointerDownHandler=mxUtils.bind(this,function(){this.showTooltips=!1,this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerdown":"mousedown",this.pointerDownHandler),this.pointerMoveHandler=mxUtils.bind(this,function(t){for(var e=mxEvent.getSource(t);null!=e;){if(e==this.currentElt)return;e=e.parentNode}this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.pointerMoveHandler),this.pointerOutHandler=mxUtils.bind(this,function(t){null==t.toElement&&null==t.relatedTarget&&this.hideTooltip()}),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerout":"mouseout",this.pointerOutHandler),mxEvent.addListener(e,"scroll",mxUtils.bind(this,function(){this.showTooltips=!0,this.hideTooltip()})),this.init()}function TableLayout(t){mxGraphLayout.call(this,t)}function Actions(t){this.editorUi=t,this.actions=new Object,this.init()}function Action(t,e,n,i,l){mxEventSource.call(this),this.label=t,this.funct=this.createFunction(e),this.enabled=null==n||n,this.iconCls=i,this.shortcut=l,this.visible=!0}function Menubar(t,e){this.editorUi=t,this.container=e}function Menu(t,e){mxEventSource.call(this),this.funct=t,this.enabled=null==e||e}function Toolbar(t,e){this.editorUi=t,this.container=e,this.staticElements=[],this.init(),this.gestureHandler=mxUtils.bind(this,function(t){null!=this.editorUi.currentMenu&&mxEvent.getSource(t)!=this.editorUi.currentMenu.div&&this.hideMenu()}),mxEvent.addGestureListeners(document,this.gestureHandler)}FilenameDialog.filenameHelpLink=null,FilenameDialog.createTypeHint=function(n,e,i){var l=document.createElement("img");l.style.cssText="vertical-align:top;height:16px;width:16px;margin-left:4px;background-repeat:no-repeat;background-position:center bottom;cursor:pointer;",mxUtils.setOpacity(l,70);function t(){l.setAttribute("src",Editor.helpImage),l.setAttribute("title",mxResources.get("help"));for(var t=0;t<i.length;t++)if(0<i[t].ext.length&&e.value.toLowerCase().substring(e.value.length-i[t].ext.length-1)=="."+i[t].ext){l.setAttribute("src",mxClient.imageBasePath+"/warning.png"),l.setAttribute("title",mxResources.get(i[t].title));break}}return mxEvent.addListener(e,"keyup",t),mxEvent.addListener(e,"change",t),mxEvent.addListener(l,"click",function(t){var e=l.getAttribute("title");l.getAttribute("src")==Editor.helpImage?n.editor.graph.openLink(FilenameDialog.filenameHelpLink):""!=e&&n.showError(null,e,mxResources.get("help"),function(){n.editor.graph.openLink(FilenameDialog.filenameHelpLink)},null,mxResources.get("ok"),null,null,null,340,90),mxEvent.consume(t)}),t(),l},FilenameDialog.createFileTypes=function(t,s,o){for(var r=document.createElement("select"),e=0;e<o.length;e++){var n=document.createElement("option");n.setAttribute("value",e),mxUtils.write(n,mxResources.get(o[e].description)+" (."+o[e].extension+")"),r.appendChild(n)}mxEvent.addListener(r,"change",function(t){var e=o[r.value].extension,n=s.value.lastIndexOf(".");0<n?(e=o[r.value].extension,s.value=s.value.substring(0,n+1)+e):s.value=s.value+"."+e,"createEvent"in document?((e=document.createEvent("HTMLEvents")).initEvent("change",!1,!0),s.dispatchEvent(e)):s.fireEvent("onchange")});function i(t){var e=s.value.lastIndexOf("."),n=0;if(0<e)for(var i=s.value.toLowerCase().substring(e+1),l=0;l<o.length;l++)if(i==o[l].extension){n=l;break}r.value=n}return mxEvent.addListener(s,"change",i),mxEvent.addListener(s,"keyup",i),i(),r},function(){mxGraphView.prototype.validateBackgroundPage=function(){var e=this.graph;if(null!=e.container&&!e.transparentBackground){if(e.pageVisible){var t=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var n=e.container.firstChild;null!=n&&n.nodeType!=mxConstants.NODETYPE_ELEMENT;)n=n.nextSibling;null!=n&&(this.backgroundPageShape=this.createBackgroundPageShape(t),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!mxClient.IS_QUIRKS,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(e.container),n.style.position="absolute",e.container.insertBefore(this.backgroundPageShape.node,n),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(t){e.dblClick(t)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(t){e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t))}),mxUtils.bind(this,function(t){null!=e.tooltipHandler&&e.tooltipHandler.isHideOnHover()&&e.tooltipHandler.hide(),e.isMouseDown&&!mxEvent.isConsumed(t)&&e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t))}),mxUtils.bind(this,function(t){e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=t,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null);this.validateBackgroundStyles()}},mxGraphView.prototype.validateBackgroundStyles=function(){var t,e,n=this.graph,i=null==n.background||n.background==mxConstants.NONE?n.defaultPageBackgroundColor:n.background,l=null!=i&&this.gridColor!=i.toLowerCase()?this.gridColor:"#ffffff",s="none",o="";n.isGridEnabled()&&(r=10,mxClient.IS_SVG?(s=unescape(encodeURIComponent(this.createSvgGrid(l))),s="url(data:image/svg+xml;base64,"+(s=window.btoa?btoa(s):Base64.encode(s,!0))+")",r=n.gridSize*this.scale*this.gridSteps):s="url("+this.gridImage+")",e=t=0,null!=n.view.backgroundPageShape&&(t=1+(l=this.getBackgroundPageBounds()).x,e=1+l.y),o=-Math.round(r-mxUtils.mod(this.translate.x*this.scale-t,r))+"px "+-Math.round(r-mxUtils.mod(this.translate.y*this.scale-e,r))+"px");var r=n.view.canvas;null!=r.ownerSVGElement&&(r=r.ownerSVGElement),null!=n.view.backgroundPageShape?(n.view.backgroundPageShape.node.style.backgroundPosition=o,n.view.backgroundPageShape.node.style.backgroundImage=s,n.view.backgroundPageShape.node.style.backgroundColor=i,n.container.className="geDiagramContainer geDiagramBackdrop",r.style.backgroundImage="none",r.style.backgroundColor=""):(n.container.className="geDiagramContainer",r.style.backgroundPosition=o,r.style.backgroundColor=i,r.style.backgroundImage=s)},mxGraphView.prototype.createSvgGrid=function(t){for(var e=this.graph.gridSize*this.scale;e<this.minGridSize;)e*=2;for(var n=this.gridSteps*e,i=[],l=1;l<this.gridSteps;l++){var s=l*e;i.push("M 0 "+s+" L "+n+" "+s+" M "+s+" 0 L "+s+" "+n)}return'<svg width="'+n+'" height="'+n+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+n+'" height="'+n+'" patternUnits="userSpaceOnUse"><path d="'+i.join(" ")+'" fill="none" stroke="'+t+'" opacity="0.2" stroke-width="1"/><path d="M '+n+" 0 L 0 0 0 "+n+'" fill="none" stroke="'+t+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var l=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(t,e){var n,i;l.apply(this,arguments),null!=this.shiftPreview1&&(null!=(n=this.view.canvas).ownerSVGElement&&(n=n.ownerSVGElement),i=this.gridSize*this.view.scale*this.view.gridSteps,i=-Math.round(i-mxUtils.mod(this.view.translate.x*this.view.scale+t,i))+"px "+-Math.round(i-mxUtils.mod(this.view.translate.y*this.view.scale+e,i))+"px",n.style.backgroundPosition=i)},mxGraph.prototype.updatePageBreaks=function(t,e,n){var i=this.view.scale,l=this.view.translate,s=this.pageFormat,o=i*this.pageScale,r=this.view.getBackgroundPageBounds();e=r.width,n=r.height;var a=new mxRectangle(i*l.x,i*l.y,s.width*o,s.height*o),h=(t=t&&Math.min(a.width,a.height)>this.minPageBreakDist)?Math.ceil(n/a.height)-1:0,d=t?Math.ceil(e/a.width)-1:0,u=r.x+e,p=r.y+n;null==this.horizontalPageBreaks&&0<h&&(this.horizontalPageBreaks=[]),null==this.verticalPageBreaks&&0<d&&(this.verticalPageBreaks=[]);n=mxUtils.bind(this,function(t){if(null!=t){for(var e=t==this.horizontalPageBreaks?h:d,n=0;n<=e;n++){var i=t==this.horizontalPageBreaks?[new mxPoint(Math.round(r.x),Math.round(r.y+(n+1)*a.height)),new mxPoint(Math.round(u),Math.round(r.y+(n+1)*a.height))]:[new mxPoint(Math.round(r.x+(n+1)*a.width),Math.round(r.y)),new mxPoint(Math.round(r.x+(n+1)*a.width),Math.round(p))];null!=t[n]?(t[n].points=i,t[n].redraw()):((i=new mxPolyline(i,this.pageBreakColor)).dialect=this.dialect,i.isDashed=this.pageBreakDashed,i.pointerEvents=!1,i.init(this.view.backgroundPane),i.redraw(),t[n]=i)}for(n=e;n<t.length;n++)t[n].destroy();t.splice(e,t.length-e)}});n(this.horizontalPageBreaks),n(this.verticalPageBreaks)};var s=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(t,e,n){for(var i=0;i<e.length;i++){if(this.graph.isTableCell(e[i])||this.graph.isTableRow(e[i]))return!1;if(this.graph.getModel().isVertex(e[i])){var l=this.graph.getCellGeometry(e[i]);if(null!=l&&l.relative)return!1}}return s.apply(this,arguments)};var t=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var n=t.apply(this,arguments);return n.intersects=mxUtils.bind(this,function(t,e){return!!this.isConnecting()||mxCellMarker.prototype.intersects.apply(n,arguments)}),n},mxGraphView.prototype.createBackgroundPageShape=function(t){return new mxRectangleShape(t,"#ffffff",this.graph.defaultPageBorderColor)},mxGraphView.prototype.getBackgroundPageBounds=function(){var t=this.getGraphBounds(),e=0<t.width?t.x/this.scale-this.translate.x:0,n=0<t.height?t.y/this.scale-this.translate.y:0,i=t.width/this.scale,l=t.height/this.scale,s=this.graph.pageFormat,o=this.graph.pageScale,r=s.width*o,t=s.height*o,s=Math.floor(Math.min(0,e)/r),o=Math.floor(Math.min(0,n)/t),i=Math.ceil(Math.max(1,e+i)/r)-s,l=Math.ceil(Math.max(1,n+l)/t)-o;return new mxRectangle(this.scale*(this.translate.x+s*r),this.scale*(this.translate.y+o*t),this.scale*i*r,this.scale*l*t)};var n=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(t,e){n.apply(this,arguments),this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=t+"px",this.view.backgroundPageShape.node.style.marginTop=e+"px")};var r=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(t,e,n,i,l,s){var o=r.apply(this,arguments);return null==s||s||mxEvent.addListener(o,"mousedown",function(t){mxEvent.consume(t)}),o};var o=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=function(t,e,n){var i,l=!1,s=this.graph.model.getParent(t);return e?(i=this.graph.model.isEdge(t)?null:this.graph.getCellGeometry(t),l=!this.graph.model.isEdge(s)&&!this.graph.isSiblingSelected(t)&&(null!=i&&i.relative||!this.graph.isContainer(s)||this.graph.isPart(t))):(l=o.apply(this,arguments),(this.graph.isTableCell(t)||this.graph.isTableRow(t))&&(i=s,this.graph.isTable(i)||(i=this.graph.model.getParent(i)),l=!this.graph.selectionCellsHandler.isHandled(i)||this.graph.isCellSelected(i)&&this.graph.isToggleEvent(n.getEvent())||this.graph.isCellSelected(t)&&!this.graph.isToggleEvent(n.getEvent())||this.graph.isTableCell(t)&&this.graph.isCellSelected(s))),l},mxPopupMenuHandler.prototype.getCellForPopupEvent=function(t){for(var e=t.getCell(),n=this.graph.getModel(),i=n.getParent(e),l=this.graph.view.getState(i),s=this.graph.isCellSelected(e);null!=l&&(n.isVertex(i)||n.isEdge(i));){var o=this.graph.isCellSelected(i),s=s||o;(o||!s&&(this.graph.isTableCell(e)||this.graph.isTableRow(e)))&&(e=i),i=n.getParent(i)}return e}}(),Sidebar.prototype.init=function(){var t=STENCIL_PATH;this.addSearchPalette(!0),this.addGeneralPalette(!0),this.addMiscPalette(!1),this.addAdvancedPalette(!1),this.addBasicPalette(t),this.setCurrentSearchEntryLibrary("arrows"),this.addStencilPalette("arrows",mxResources.get("arrows"),t+"/arrows.xml",";whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#000000;strokeWidth=2"),this.setCurrentSearchEntryLibrary(),this.addUmlPalette(!1),this.addBpmnPalette(t,!1),this.setCurrentSearchEntryLibrary("flowchart"),this.addStencilPalette("flowchart","Flowchart",t+"/flowchart.xml",";whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#000000;strokeWidth=2"),this.setCurrentSearchEntryLibrary(),this.setCurrentSearchEntryLibrary("clipart"),this.addImagePalette("clipart",mxResources.get("clipart"),t+"/clipart/","_128x128.png",["Earth_globe","Empty_Folder","Full_Folder","Gear","Lock","Software","Virus","Email","Database","Router_Icon","iPad","iMac","Laptop","MacBook","Monitor_Tower","Printer","Server_Tower","Workstation","Firewall_02","Wireless_Router_N","Credit_Card","Piggy_Bank","Graph","Safe","Shopping_Cart","Suit1","Suit2","Suit3","Pilot1","Worker1","Soldier1","Doctor1","Tech1","Security1","Telesales1"],null,{Wireless_Router_N:"wireless router switch wap wifi access point wlan",Router_Icon:"router switch"}),this.setCurrentSearchEntryLibrary()},Sidebar.prototype.collapsedImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQANAIABAJmZmf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNUQyRTJFNjZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNUQyRTJFNzZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFERjc3MEUxNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFERjc3MEUyNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAA0ADQAAAhSMj6lrwAjcC1GyahV+dcZJgeIIFgA7":IMAGE_PATH+"/collapsed.gif",Sidebar.prototype.expandedImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQANAIABAJmZmf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxREY3NzBERjZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxREY3NzBFMDZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFERjc3MERENkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFERjc3MERFNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAA0ADQAAAhGMj6nL3QAjVHIu6azbvPtWAAA7":IMAGE_PATH+"/expanded.gif",Sidebar.prototype.searchImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAEaSURBVHjabNGxS5VxFIfxz71XaWuQUJCG/gCHhgTD9VpEETg4aMOlQRp0EoezObgcd220KQiXmpretTAHQRBdojlQEJyukPdt+b1ywfvAGc7wnHP4nlZd1yKijQW8xzNc4Su+ZOYfQ3T6/f4YNvEJYzjELXp4VVXVz263+7cR2niBxAFeZ2YPi3iHR/gYERPDwhpOsd6sz8x/mfkNG3iOlWFhFj8y89J9KvzGXER0GuEaD42mgwHqUtoljbcRsTBCeINpfM/MgZLKPpaxFxGbOCqDXmILN7hoJrTKH+axhxmcYRxP0MIDnOBDZv5q1XUNIuJxifJp+UNV7t7BFM6xeic0RMQ4Bpl5W/ol7GISx/eEUUTECrbx+f8A8xhiZht9zsgAAAAASUVORK5CYII=":IMAGE_PATH+"/search.png",Sidebar.prototype.dragPreviewBorder="1px dashed black",Sidebar.prototype.enableTooltips=!0,Sidebar.prototype.tooltipBorder=16,Sidebar.prototype.tooltipDelay=300,Sidebar.prototype.dropTargetDelay=200,Sidebar.prototype.gearImage=STENCIL_PATH+"/clipart/Gear_128x128.png",Sidebar.prototype.thumbWidth=42,Sidebar.prototype.thumbHeight=42,Sidebar.prototype.minThumbStrokeWidth=1,Sidebar.prototype.thumbAntiAlias=!1,Sidebar.prototype.thumbPadding=5<=document.documentMode?2:3,Sidebar.prototype.thumbBorder=2,"large"!=urlParams["sidebar-entries"]&&(Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=1,Sidebar.prototype.thumbWidth=32,Sidebar.prototype.thumbHeight=30,Sidebar.prototype.minThumbStrokeWidth=1.3,Sidebar.prototype.thumbAntiAlias=!0),Sidebar.prototype.sidebarTitleSize=9,Sidebar.prototype.sidebarTitles=!1,Sidebar.prototype.tooltipTitles=!0,Sidebar.prototype.maxTooltipWidth=400,Sidebar.prototype.maxTooltipHeight=400,Sidebar.prototype.addStencilsToIndex=!0,Sidebar.prototype.defaultImageWidth=80,Sidebar.prototype.defaultImageHeight=80,Sidebar.prototype.getTooltipOffset=function(){return new mxPoint(0,0)},Sidebar.prototype.showTooltip=function(o,r,a,h,d,u){var t;this.enableTooltips&&this.showTooltips&&this.currentElt!=o&&(null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null),t=mxUtils.bind(this,function(){null==this.tooltip&&(this.tooltip=document.createElement("div"),this.tooltip.className="geSidebarTooltip",this.tooltip.style.zIndex=mxPopupMenu.prototype.zIndex-1,document.body.appendChild(this.tooltip),this.graph2=new Graph(this.tooltip,null,null,this.editorUi.editor.graph.getStylesheet()),this.graph2.resetViewOnRootChange=!1,this.graph2.foldingEnabled=!1,this.graph2.gridEnabled=!1,this.graph2.autoScroll=!1,this.graph2.setTooltips(!1),this.graph2.setConnectable(!1),this.graph2.setEnabled(!1),mxClient.IS_SVG||(this.graph2.view.canvas.style.position="relative")),this.graph2.model.clear(),this.graph2.view.setTranslate(this.tooltipBorder,this.tooltipBorder),a>this.maxTooltipWidth||h>this.maxTooltipHeight?this.graph2.view.scale=Math.round(100*Math.min(this.maxTooltipWidth/a,this.maxTooltipHeight/h))/100:this.graph2.view.scale=1,this.tooltip.style.display="block",this.graph2.labelsVisible=null==u||u;var t=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject;var e=this.graph2.cloneCells(r);this.editorUi.insertHandler(e,null,this.graph2.model),this.graph2.addCells(e),mxClient.NO_FO=t;var n=this.graph2.getGraphBounds(),i=n.width+2*this.tooltipBorder+4,l=n.height+2*this.tooltipBorder;mxClient.IS_QUIRKS?(l+=4,this.tooltip.style.overflow="hidden"):this.tooltip.style.overflow="visible",this.tooltip.style.width=i+"px";e=i;this.tooltipTitles&&null!=d&&0<d.length?(null==this.tooltipTitle?(this.tooltipTitle=document.createElement("div"),this.tooltipTitle.style.borderTop="1px solid gray",this.tooltipTitle.style.textAlign="center",this.tooltipTitle.style.width="100%",this.tooltipTitle.style.overflow="hidden",this.tooltipTitle.style.position="absolute",this.tooltipTitle.style.paddingTop="6px",this.tooltipTitle.style.bottom="6px",this.tooltip.appendChild(this.tooltipTitle)):this.tooltipTitle.innerHTML="",this.tooltipTitle.style.display="",mxUtils.write(this.tooltipTitle,d),e=Math.min(this.maxTooltipWidth,Math.max(i,this.tooltipTitle.scrollWidth+4)),l+=s=this.tooltipTitle.offsetHeight+10,mxClient.IS_SVG?this.tooltipTitle.style.marginTop=2-s+"px":(l-=6,this.tooltipTitle.style.top=l-s+"px")):null!=this.tooltipTitle&&null!=this.tooltipTitle.parentNode&&(this.tooltipTitle.style.display="none"),i<e&&(this.tooltip.style.width=e+"px"),this.tooltip.style.height=l+"px";var t=-Math.round(n.x-this.tooltipBorder)+(i<e?(e-i)/2:0),s=-Math.round(n.y-this.tooltipBorder),e=document.body,i=document.documentElement,n=this.getTooltipOffset(),e=Math.max(e.clientHeight||0,i.clientHeight),i=this.container.clientWidth+this.editorUi.splitSize+3+this.editorUi.container.offsetLeft+n.x,n=Math.min(e-l-20,Math.max(0,this.editorUi.container.offsetTop+this.container.offsetTop+o.offsetTop-this.container.scrollTop-l/2+16))+n.y;mxClient.IS_SVG?0!=t||0!=s?this.graph2.view.canvas.setAttribute("transform","translate("+t+","+s+")"):this.graph2.view.canvas.removeAttribute("transform"):(this.graph2.view.drawPane.style.left=t+"px",this.graph2.view.drawPane.style.top=s+"px"),this.tooltip.style.position="absolute",this.tooltip.style.left=i+"px",this.tooltip.style.top=n+"px"}),null!=this.tooltip&&"none"!=this.tooltip.style.display?t():this.thread=window.setTimeout(t,this.tooltipDelay),this.currentElt=o)},Sidebar.prototype.hideTooltip=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null),null!=this.tooltip&&(this.tooltip.style.display="none",this.currentElt=null)},Sidebar.prototype.addDataEntry=function(t,e,n,i,l){return this.addEntry(t,mxUtils.bind(this,function(){return this.createVertexTemplateFromData(l,e,n,i)}))},Sidebar.prototype.addEntries=function(t){for(var e=0;e<t.length;e++)mxUtils.bind(this,function(e){var n=e.data,t=null!=e.title?e.title:"";null!=e.tags&&(t+=" "+e.tags),null!=n&&0<t.length?this.addEntry(t,mxUtils.bind(this,function(){n=this.editorUi.convertDataUri(n);var t="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";return"fixed"==e.aspect&&(t+="aspect=fixed;"),this.createVertexTemplate(t+"image="+n,e.w,e.h,"",e.title||"",!1,!1,!0)})):null!=e.xml&&0<t.length&&this.addEntry(t,mxUtils.bind(this,function(){var t=this.editorUi.stringToCells(Graph.decompress(e.xml));return this.createVertexTemplateFromCells(t,e.w,e.h,e.title||"",!0,!1,!0)}))})(t[e])},Sidebar.prototype.setCurrentSearchEntryLibrary=function(t,e){this.currentSearchEntryLibrary=null!=t?{id:t,lib:e}:null},Sidebar.prototype.addEntry=function(t,e){if(null!=this.taglist&&null!=t&&0<t.length){null!=this.currentSearchEntryLibrary&&(e.parentLibraries=[this.currentSearchEntryLibrary]);for(var n=t.toLowerCase().replace(/[\/\,\(\)]/g," ").split(" "),i=[],l={},s=0;s<n.length;s++){null==l[n[s]]&&(l[n[s]]=!0,i.push(n[s]));var o=n[s].replace(/\.*\d*$/,"");o!=n[s]&&null==l[o]&&(l[o]=!0,i.push(o))}for(s=0;s<i.length;s++)this.addEntryForTag(i[s],e)}return e},Sidebar.prototype.addEntryForTag=function(t,e){var n;null!=t&&1<t.length&&("object"!=typeof(n=this.taglist[t])&&(n={entries:[]},this.taglist[t]=n),n.entries.push(e))},Sidebar.prototype.searchEntries=function(t,e,n,i,l){if(null!=this.taglist&&null!=t){for(var s=t.toLowerCase().split(" "),o=new mxDictionary,r=(n+1)*e,a=[],h=0,d=0;d<s.length;d++)if(0<s[d].length){var u=this.taglist[s[d]],p=new mxDictionary;if(null!=u)for(var m=u.entries,a=[],c=0;c<m.length;c++){u=m[c];if(0==h==(null==o.get(u))&&(p.put(u,u),a.push(u),d==s.length-1&&a.length==r))return void i(a.slice(n*e,r),r,!0,s)}else a=[];o=p,h++}t=a.length;i(a.slice(n*e,(n+1)*e),t,!1,s)}else i([],null,null,s)},Sidebar.prototype.filterTags=function(t){if(null==t)return null;for(var e=t.split(" "),n=[],i={},l=0;l<e.length;l++)null==i[e[l]]&&(i[e[l]]="1",n.push(e[l]));return n.join(" ")},Sidebar.prototype.cloneCell=function(t,e){t=t.clone();return null!=e&&(t.value=e),t},Sidebar.prototype.showPopupMenuForEntry=function(t,e,n){},Sidebar.prototype.addSearchPalette=function(t){var e=document.createElement("div");e.style.visibility="hidden",this.container.appendChild(e);var o=document.createElement("div");o.className="geSidebar",o.style.boxSizing="border-box",o.style.overflow="hidden",o.style.width="100%",o.style.padding="8px",o.style.paddingTop="14px",o.style.paddingBottom="0px",t||(o.style.display="none");var n=document.createElement("div");n.style.whiteSpace="nowrap",n.style.textOverflow="clip",n.style.paddingBottom="8px",n.style.cursor="default";var i=document.createElement("input");i.setAttribute("placeholder",mxResources.get("searchShapes")),i.setAttribute("type","text"),i.style.fontSize="12px",i.style.overflow="hidden",i.style.boxSizing="border-box",i.style.border="solid 1px #d5d5d5",i.style.borderRadius="4px",i.style.width="100%",i.style.outline="none",i.style.padding="6px",i.style.paddingRight="20px",n.appendChild(i);var l,s=document.createElement("img");s.setAttribute("src",Sidebar.prototype.searchImage),s.setAttribute("title",mxResources.get("search")),s.style.position="relative",s.style.left="-18px",mxClient.IS_QUIRKS?(i.style.height="28px",s.style.top="-4px"):s.style.top="1px",s.style.background="url('"+this.editorUi.editor.transparentImage+"')",n.appendChild(s),o.appendChild(n);var r=document.createElement("center"),a=mxUtils.button(mxResources.get("moreResults"),function(){l()});a.style.display="none",a.style.lineHeight="normal",a.style.fontSize="12px",a.style.padding="6px 12px 6px 12px",a.style.marginTop="4px",a.style.marginBottom="8px",r.style.paddingTop="4px",r.style.paddingBottom="4px",r.appendChild(a),o.appendChild(r);var h,d="",u=!1,p=!1,m=0,c=new Object,g=mxUtils.bind(this,function(){u=!1,this.currentSearch=null;for(var t=o.firstChild;null!=t;){var e=t.nextSibling;t!=n&&t!=r&&t.parentNode.removeChild(t),t=e}});mxEvent.addListener(s,"click",function(){s.getAttribute("src")==Dialog.prototype.closeImage&&(s.setAttribute("src",Sidebar.prototype.searchImage),s.setAttribute("title",mxResources.get("search")),a.style.display="none",i.value="",d="",g()),i.focus()}),l=mxUtils.bind(this,function(){var s;h=4*Math.max(1,Math.floor(this.container.clientWidth/(this.thumbWidth+10))),this.hideTooltip(),""!=i.value?null!=r.parentNode&&(d!=i.value&&(g(),d=i.value,c=new Object,p=!1,m=0),u||p||(a.setAttribute("disabled","true"),a.style.display="",a.style.cursor="wait",a.innerHTML=mxResources.get("loading")+"...",u=!0,s=new Object,this.currentSearch=s,this.searchEntries(d,h,m,mxUtils.bind(this,function(t,e,n,i){if(this.currentSearch==s){t=null!=t?t:[],u=!1,m++,this.insertSearchHint(o,d,h,m,t,e,n,i),0==t.length&&1==m&&(d=""),null!=r.parentNode&&r.parentNode.removeChild(r);for(var l=0;l<t.length;l++)mxUtils.bind(this,function(t){try{var n=t();null==c[n.innerHTML]?(c[n.innerHTML]=null!=t.parentLibraries?t.parentLibraries.slice():[],o.appendChild(n)):null!=t.parentLibraries&&(c[n.innerHTML]=c[n.innerHTML].concat(t.parentLibraries)),mxEvent.addGestureListeners(n,null,null,mxUtils.bind(this,function(t){var e=c[n.innerHTML];mxEvent.isPopupTrigger(t)&&this.showPopupMenuForEntry(n,e,t)})),mxEvent.disableContextMenu(n)}catch(t){}})(t[l]);n?(a.removeAttribute("disabled"),a.innerHTML=mxResources.get("moreResults")):(a.innerHTML=mxResources.get("reset"),a.style.display="none",p=!0),a.style.cursor="",o.appendChild(r)}}),mxUtils.bind(this,function(){a.style.cursor=""})))):(g(),i.value="",d="",c=new Object,a.style.display="none",p=!1,i.focus())}),mxEvent.addListener(i,"keydown",mxUtils.bind(this,function(t){13==t.keyCode&&(l(),mxEvent.consume(t))})),mxEvent.addListener(i,"keyup",mxUtils.bind(this,function(t){""==i.value?(s.setAttribute("src",Sidebar.prototype.searchImage),s.setAttribute("title",mxResources.get("search"))):(s.setAttribute("src",Dialog.prototype.closeImage),s.setAttribute("title",mxResources.get("reset"))),""==i.value?(p=!0,a.style.display="none"):i.value!=d?(a.style.display="none",p=!1):u||(a.style.display=p?"none":"")})),mxEvent.addListener(i,"mousedown",function(t){t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0}),mxEvent.addListener(i,"selectstart",function(t){t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0});t=document.createElement("div");t.appendChild(o),this.container.appendChild(t),this.palettes.search=[e,t]},Sidebar.prototype.insertSearchHint=function(t,e,n,i,l,s,o,r){0==l.length&&1==i&&((i=document.createElement("div")).className="geTitle",i.style.cssText="background-color:transparent;border-color:transparent;color:gray;padding:6px 0px 0px 0px !important;margin:4px 8px 4px 8px;text-align:center;cursor:default !important",mxUtils.write(i,mxResources.get("noResultsFor",[e])),t.appendChild(i))},Sidebar.prototype.addGeneralPalette=function(t){var e="line lines connector connectors connection connections arrow arrows ";this.setCurrentSearchEntryLibrary("general","general");e=[this.createVertexTemplateEntry("rounded=0;whiteSpace=wrap;html=1;",120,60,"","Rectangle",null,null,"rect rectangle box"),this.createVertexTemplateEntry("rounded=1;whiteSpace=wrap;html=1;",120,60,"","Rounded Rectangle",null,null,"rounded rect rectangle box"),this.createVertexTemplateEntry("text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;",40,20,"Text","Text",null,null,"text textbox textarea label"),this.createVertexTemplateEntry("text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;",190,120,"<h1>Heading</h1><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>","Textbox",null,null,"text textbox textarea"),this.createVertexTemplateEntry("ellipse;whiteSpace=wrap;html=1;",120,80,"","Ellipse",null,null,"oval ellipse state"),this.createVertexTemplateEntry("whiteSpace=wrap;html=1;aspect=fixed;",80,80,"","Square",null,null,"square"),this.createVertexTemplateEntry("ellipse;whiteSpace=wrap;html=1;aspect=fixed;",80,80,"","Circle",null,null,"circle"),this.createVertexTemplateEntry("shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;",120,60,"","Process",null,null,"process task"),this.createVertexTemplateEntry("rhombus;whiteSpace=wrap;html=1;",80,80,"","Diamond",null,null,"diamond rhombus if condition decision conditional question test"),this.createVertexTemplateEntry("shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,60,"","Parallelogram"),this.createVertexTemplateEntry("shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;",120,80,"","Hexagon",null,null,"hexagon preparation"),this.createVertexTemplateEntry("triangle;whiteSpace=wrap;html=1;",60,80,"","Triangle",null,null,"triangle logic inverter buffer"),this.createVertexTemplateEntry("shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;",60,80,"","Cylinder",null,null,"cylinder data database"),this.createVertexTemplateEntry("ellipse;shape=cloud;whiteSpace=wrap;html=1;",120,80,"","Cloud",null,null,"cloud network"),this.createVertexTemplateEntry("shape=document;whiteSpace=wrap;html=1;boundedLbl=1;",120,80,"","Document"),this.createVertexTemplateEntry("shape=internalStorage;whiteSpace=wrap;html=1;backgroundOutline=1;",80,80,"","Internal Storage"),this.createVertexTemplateEntry("shape=cube;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;darkOpacity=0.05;darkOpacity2=0.1;",120,80,"","Cube"),this.createVertexTemplateEntry("shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,80,"","Step"),this.createVertexTemplateEntry("shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,60,"","Trapezoid"),this.createVertexTemplateEntry("shape=tape;whiteSpace=wrap;html=1;",120,100,"","Tape"),this.createVertexTemplateEntry("shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;darkOpacity=0.05;",80,100,"","Note"),this.createVertexTemplateEntry("shape=card;whiteSpace=wrap;html=1;",80,100,"","Card"),this.createVertexTemplateEntry("shape=callout;whiteSpace=wrap;html=1;perimeter=calloutPerimeter;",120,80,"","Callout",null,null,"bubble chat thought speech message"),this.createVertexTemplateEntry("shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;",30,60,"Actor","Actor",!1,null,"user person human stickman"),this.createVertexTemplateEntry("shape=xor;whiteSpace=wrap;html=1;",60,80,"","Or",null,null,"logic or"),this.createVertexTemplateEntry("shape=or;whiteSpace=wrap;html=1;",60,80,"","And",null,null,"logic and"),this.createVertexTemplateEntry("shape=dataStorage;whiteSpace=wrap;html=1;fixedSize=1;",100,80,"","Data Storage"),this.addEntry("curve",mxUtils.bind(this,function(){var t=new mxCell("",new mxGeometry(0,0,50,50),"curved=1;endArrow=classic;html=1;");return t.geometry.setTerminalPoint(new mxPoint(0,50),!0),t.geometry.setTerminalPoint(new mxPoint(50,0),!1),t.geometry.points=[new mxPoint(50,50),new mxPoint(0,0)],t.geometry.relative=!0,t.edge=!0,this.createEdgeTemplateFromCells([t],t.geometry.width,t.geometry.height,"Curve")})),this.createEdgeTemplateEntry("shape=flexArrow;endArrow=classic;startArrow=classic;html=1;",50,50,"","Bidirectional Arrow",null,e+"bidirectional"),this.createEdgeTemplateEntry("shape=flexArrow;endArrow=classic;html=1;",50,50,"","Arrow",null,e+"directional directed"),this.createEdgeTemplateEntry("endArrow=none;dashed=1;html=1;",50,50,"","Dashed Line",null,e+"dashed undirected no"),this.createEdgeTemplateEntry("endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=2;",50,50,"","Dotted Line",null,e+"dotted undirected no"),this.createEdgeTemplateEntry("endArrow=none;html=1;",50,50,"","Line",null,e+"simple undirected plain blank no"),this.createEdgeTemplateEntry("endArrow=classic;startArrow=classic;html=1;",50,50,"","Bidirectional Connector",null,e+"bidirectional"),this.createEdgeTemplateEntry("endArrow=classic;html=1;",50,50,"","Directional Connector",null,e+"directional directed"),this.createEdgeTemplateEntry("shape=link;html=1;",100,0,"","Link",null,e+"link"),this.addEntry(e+"edge title",mxUtils.bind(this,function(){var t=new mxCell("",new mxGeometry(0,0,0,0),"endArrow=classic;html=1;");t.geometry.setTerminalPoint(new mxPoint(0,0),!0),t.geometry.setTerminalPoint(new mxPoint(100,0),!1),t.geometry.relative=!0,t.edge=!0;var e=new mxCell("Label",new mxGeometry(0,0,0,0),"edgeLabel;resizable=0;html=1;align=center;verticalAlign=middle;");return e.geometry.relative=!0,e.setConnectable(!1),e.vertex=!0,t.insert(e),this.createEdgeTemplateFromCells([t],100,0,"Connector with Label")})),this.addEntry(e+"edge title multiplicity",mxUtils.bind(this,function(){var t=new mxCell("",new mxGeometry(0,0,0,0),"endArrow=classic;html=1;");t.geometry.setTerminalPoint(new mxPoint(0,0),!0),t.geometry.setTerminalPoint(new mxPoint(160,0),!1),t.geometry.relative=!0,t.edge=!0;var e=new mxCell("Label",new mxGeometry(0,0,0,0),"edgeLabel;resizable=0;html=1;align=center;verticalAlign=middle;");e.geometry.relative=!0,e.setConnectable(!1),e.vertex=!0,t.insert(e);e=new mxCell("Source",new mxGeometry(-1,0,0,0),"edgeLabel;resizable=0;html=1;align=left;verticalAlign=bottom;");return e.geometry.relative=!0,e.setConnectable(!1),e.vertex=!0,t.insert(e),this.createEdgeTemplateFromCells([t],160,0,"Connector with 2 Labels")})),this.addEntry(e+"edge title multiplicity",mxUtils.bind(this,function(){var t=new mxCell("Label",new mxGeometry(0,0,0,0),"endArrow=classic;html=1;");t.geometry.setTerminalPoint(new mxPoint(0,0),!0),t.geometry.setTerminalPoint(new mxPoint(160,0),!1),t.geometry.relative=!0,t.edge=!0;var e=new mxCell("Label",new mxGeometry(0,0,0,0),"edgeLabel;resizable=0;html=1;align=center;verticalAlign=middle;");e.geometry.relative=!0,e.setConnectable(!1),e.vertex=!0,t.insert(e);e=new mxCell("Source",new mxGeometry(-1,0,0,0),"edgeLabel;resizable=0;html=1;align=left;verticalAlign=bottom;");e.geometry.relative=!0,e.setConnectable(!1),e.vertex=!0,t.insert(e);e=new mxCell("Target",new mxGeometry(1,0,0,0),"edgeLabel;resizable=0;html=1;align=right;verticalAlign=bottom;");return e.geometry.relative=!0,e.setConnectable(!1),e.vertex=!0,t.insert(e),this.createEdgeTemplateFromCells([t],160,0,"Connector with 3 Labels")})),this.addEntry(e+"edge shape symbol message mail email",mxUtils.bind(this,function(){var t=new mxCell("",new mxGeometry(0,0,0,0),"endArrow=classic;html=1;");t.geometry.setTerminalPoint(new mxPoint(0,0),!0),t.geometry.setTerminalPoint(new mxPoint(100,0),!1),t.geometry.relative=!0,t.edge=!0;var e=new mxCell("",new mxGeometry(0,0,20,14),"shape=message;html=1;outlineConnect=0;");return e.geometry.relative=!0,e.vertex=!0,e.geometry.offset=new mxPoint(-10,-7),t.insert(e),this.createEdgeTemplateFromCells([t],100,0,"Connector with Symbol")}))];this.addPaletteFunctions("general",mxResources.get("general"),null==t||t,e),this.setCurrentSearchEntryLibrary()},Sidebar.prototype.addMiscPalette=function(t){var n=this,e="line lines connector connectors connection connections arrow arrows ";this.setCurrentSearchEntryLibrary("general","misc");e=[this.createVertexTemplateEntry("text;strokeColor=none;fillColor=none;html=1;fontSize=24;fontStyle=1;verticalAlign=middle;align=center;",100,40,"Title","Title",null,null,"text heading title"),this.createVertexTemplateEntry("text;strokeColor=none;fillColor=none;html=1;whiteSpace=wrap;verticalAlign=middle;overflow=hidden;",100,80,"<ul><li>Value 1</li><li>Value 2</li><li>Value 3</li></ul>","Unordered List"),this.createVertexTemplateEntry("text;strokeColor=none;fillColor=none;html=1;whiteSpace=wrap;verticalAlign=middle;overflow=hidden;",100,80,"<ol><li>Value 1</li><li>Value 2</li><li>Value 3</li></ol>","Ordered List"),this.addDataEntry("table",180,120,"Table 1","7ZjJTsMwEIafJleUhZZybVgucAFewDTT2pLjiewpaXl6xolLVQFqWBJArZRKns2xv5H7y4myvFxdW1HJWyxAR9lllOUWkdpRucpB6yiNVRFlF1GaxvyL0qsPokkTjSthwVCXgrQteBJ6Ca2ndTha6+BwUlR+SOLRu6aSSl7mRcLDWiqC+0rMfLzmTbDPkbB0r569K2Z7hoaEMmBDzQy1FpVTzWRthlS6uBFrXNLmNRtrGpYHlmD14RYbV9jfNWAJZNecUquCZMiYtBhiCWohN2WBTSxc61i81m6J8SBAex9g1h0gL5mU0HcwI2EWXVi+ZVVYrB6EXQAFR4XKENjLJ6bhgm+utM5Ro0du0PgXEVYhqGG+qX1EIiyDYQOY10kbKKMpP4wpj09G0Yh3k7OdbG1+fLqlHI0jy432c4BwVIPr3MD0aw08/YH+nfbbP2N89rZ/324NMsq5xppNqYoCTFfG2V7G454Qjw4c8WoX7wDEx0fiO3/wAyA/O+pAbzqw3m3TELIwOZQTdPZrsnB+4IiHl4UkPiIfWheS5CgMfQvDZEBhSD5xY/7fZyjZf63u7dD0fKv++5B/QRwO5ia8h3mP6sDm9tNeE9v58vcC"),this.addDataEntry("table",180,120,"Table 2","7ZjBbqMwEIafhmuFISTptbTbS/eyrfbuBie2ZDzITEqyT79jMMlGWVTUBlqVSkTyjGeM+SbDLxPEab67t7yQPyETOojvgji1ANiM8l0qtA6iUGVBfBtEUUi/IPrRMcvq2bDgVhjskxA1CS9cb0XjaRwl7rV3lJIXboj82bluJOa0zVtGw0oqFI8FX7n5ih6CfCVyi4/qj3OFZK/AIFdGWJ+zAq15Uap6sSZCKp098D1ssb1Na7nobW4eKL/00Raqf02/f2FR7DoZ1C4P4F5ALtDuKaRSGUofsWw4hVKojWzTPLyQl41jc8g9IqWBp/p/wnF/wrRlVFz/EivkZtMH9jnMzELxxO1GoHcUoAwKe/dCNFpoa6V1ChpcTQwYdyOEwk9qsW5znwER8ha8B3NYtIaS3NBFmNLwKgkSepqUbHa06XLhFlMwJVr6J7g1BC+xEiX2LWD0tgLOLlC/2Vn9ftfDKGQXLaQxLvpYyHfXCIjpWkNFplRZJkxf2PGrsOcDsU46WV+2aT49690p5xHQzzvRx5NEf3j3j8B+8S0Rg0nE/rRMYyjGsrOVZl+0lRYfphjXnayTabEeXzFY2Ml+Pkn2Y0oGY9+aMbRmLEfUDHZ+EG+bafFFm4m9fiofrHvOD+Ut7eXEaH+AbnSfqK+nCX9A4SDz+DGxnjv51vgX"),this.addDataEntry("table title",180,120,"Table with Title 1","7ZhRb6MwDMc/Da8nAmPdvZbu9nJ7WfcFMnAhUohR4o12n34OpKumrmqlDXa6VqJS/Lcdkp8bWSFK82Z9Z2Vb32MJOkpvozS3iDSMmnUOWkdJrMooXURJEvMvSv4c8IreG7fSgqFTEpIh4UXqZxiUR/mkYVAdbXRQXS1bP6Tem85ranitC8HDrlYEy1YW3t/xTlhzJC0t1auX0piFAg1JZcCGpAK1lq1T/WyLPqJWuvwrN/hM2/dsrfmKs5dhMT5balUZHhe8Sz/lPOwCLMH6IIleChjuABsgu+GQTpVUh4ibgVZcg6rqbVoWROkGoXrP3YHlQWD7Oed0j/NBxLxkUlI/QEHSVKfQ3odZWmwfpa2AgtCi8qhuX5iGC9pKaZ2jRl8Tg8a/iLANTg2rbe4TEmETDBvAvE/aQ8nm/DCmPP6VRRnvJmdb7Gx+fLilHI0jy/8EPwdIRx04OrWAyecF3ATEoUzH6nn1DeW8GrecxvjoXTm/XClksiuNHZu1KkswpyJPj56Z65EQZ2eOeP0R7wTEry/E+4RkOuSzS1sYuy3MJmwLN+dygmY/1hZ+nzni6duCiC/Ip+4LQlwaw9iNQYgJO4PYv2j/p4dIHL9mj3ZqRr5l//uQf6A7nM1V+AjzEdsDm7svgr3vwwfDNw=="),this.addDataEntry("table title",180,150,"Table with Title 2","7Zhdb5swFIZ/DbcTHyVrbiFdb7Kbptq9Cw5YMj7IPi1kv37HYJK1FDWbQoOmSUSyz4dt3id+L/CitGrvNavL75Bz6UV3XpRqAOxHVZtyKb3QF7kXbbww9Onnhd8mskGX9WumucJzGsK+4YXJZ95HHtmT5H3U4EG6qClZbYfYZaOkxIrOuglo2JQC+a5mmc039CYUM8g07sRPG4p8CmSgkAnFtWvKQEpWG9GttukqSiHzLTvAMw77DLNkL1qeP0BjXLeGZkuLGde6p8V37qw2zaQoFI0zEsHumLiX5Bp5OylUF3Iq3XOoOOoDlTQix9JV3PZi+iUXRTm0xS7ITB8ojr0n3WngpH8fQzTCMEmAjoyCyQeeIVPFOTDGWuca6kemC44uUIOwUt29kBpHVYWUKUiwyBQouxFC7ZKS74feJ0CEaiDjhDku2okSJ/SQTKn/JfZiepuU5sFpTo8t15iCMqjpj2LX4Mxgww2eCzB8H+DBSewwfcQzugDOmxHO4KI8lbLVJ55/jMp/gwpI2r2EhqalyHOuztU8+vDS3MykcTzS+Ec3DP2Faz24U1+bGNpQqGLbd65mgNG+BvH7BZgLzupf8LO34JblZ6tP9LOvI5yX5bkcP1tdzc9uJ/1s4VrP52cTMK7gZ+v/fja3n60/0c8Cf8QzWvYl++s7tL6aoQXBpKMtXOz5HG2CxvyORtPTR4Uu9+qbwy8="),this.addDataEntry("crossfunctional cross-functional cross functional flowchart swimlane table",400,400,"Cross-Functional Flowchart","7ZhRb5swEMc/DY+bMCRt97jQpi+tVC2fwINbbMnYyD4C6aefjaHpBrTRlNCoTALJPp9t+P25O5kgTvL6XtOCPaoMRBDfBXGilULfyusEhAiikGdBfBtEUWjvIFqPjJJmNCyoBonHTIj8hB0VJXiL3dyYL+tSpsiVpM55LVSVMqrROxvci9bZMFq4JtKfzrRKGRfZA92rEjtr11tpVT1wCcYOhM5ViTKXry0G7RYb/uwWXDgDw9wCuSW2WTGOsClo6gYri8uvIGhheLN1s4KGtNSG7+AHGL+Os0JdUJm1nUJxiaDvdhZQt/EvJXHTvpTbjAq+lbadgnO1hhYSaIR6FHRjainfg8oB9d66VDxD5j0WoRcjZMC3DP8yUuMN25e5B91so5VuWMa4J+P3FJW2JtLXrOK5oNLJxZTmz/blqXhNp3mO5cpe9smS8OsyWNp5ie2TQ99ezl1joqRBTXmDAajBCgxejprHKBcNK7fvBPIz3hOSRCcQctET8olRA+8JmSopIW2j8GOD6Sji8TDxepT4C9yTE1+OEo/mQ5xcTYn8ahR5PB/k0c2UyK9HC8SbX/mnLBAnqAlD8XK+onDTE+/fw+TiQF9fTin4Nl/O0xYAEs6X9LR5n5Ae6S7xv1lr/yf+4cQ/pN75Ej/pH88/UZyQkRPzR6R+0j9Bz4f0xMm/f8adD+qzZn/bPfw5bMb++LH4Gw=="),this.createVertexTemplateEntry("text;html=1;strokeColor=#c0c0c0;fillColor=#ffffff;overflow=fill;rounded=0;",280,160,'<table border="1" width="100%" height="100%" cellpadding="4" style="width:100%;height:100%;border-collapse:collapse;"><tr style="background-color:#A7C942;color:#ffffff;border:1px solid #98bf21;"><th align="left">Title 1</th><th align="left">Title 2</th><th align="left">Title 3</th></tr><tr style="border:1px solid #98bf21;"><td>Value 1</td><td>Value 2</td><td>Value 3</td></tr><tr style="background-color:#EAF2D3;border:1px solid #98bf21;"><td>Value 4</td><td>Value 5</td><td>Value 6</td></tr><tr style="border:1px solid #98bf21;"><td>Value 7</td><td>Value 8</td><td>Value 9</td></tr><tr style="background-color:#EAF2D3;border:1px solid #98bf21;"><td>Value 10</td><td>Value 11</td><td>Value 12</td></tr></table>',"HTML Table 1"),this.createVertexTemplateEntry("text;html=1;strokeColor=#c0c0c0;fillColor=none;overflow=fill;",180,140,'<table border="0" width="100%" height="100%" style="width:100%;height:100%;border-collapse:collapse;"><tr><td align="center">Value 1</td><td align="center">Value 2</td><td align="center">Value 3</td></tr><tr><td align="center">Value 4</td><td align="center">Value 5</td><td align="center">Value 6</td></tr><tr><td align="center">Value 7</td><td align="center">Value 8</td><td align="center">Value 9</td></tr></table>',"HTML Table 2"),this.createVertexTemplateEntry("text;html=1;strokeColor=none;fillColor=none;overflow=fill;",180,140,'<table border="1" width="100%" height="100%" style="width:100%;height:100%;border-collapse:collapse;"><tr><td align="center">Value 1</td><td align="center">Value 2</td><td align="center">Value 3</td></tr><tr><td align="center">Value 4</td><td align="center">Value 5</td><td align="center">Value 6</td></tr><tr><td align="center">Value 7</td><td align="center">Value 8</td><td align="center">Value 9</td></tr></table>',"HTML Table 3"),this.createVertexTemplateEntry("text;html=1;strokeColor=none;fillColor=none;overflow=fill;",160,140,'<table border="1" width="100%" height="100%" cellpadding="4" style="width:100%;height:100%;border-collapse:collapse;"><tr><th align="center"><b>Title</b></th></tr><tr><td align="center">Section 1.1\nSection 1.2\nSection 1.3</td></tr><tr><td align="center">Section 2.1\nSection 2.2\nSection 2.3</td></tr></table>',"HTML Table 4"),this.addEntry("link hyperlink",mxUtils.bind(this,function(){var t=new mxCell("Link",new mxGeometry(0,0,60,40),"text;html=1;strokeColor=none;fillColor=none;whiteSpace=wrap;align=center;verticalAlign=middle;fontColor=#0000EE;fontStyle=4;");return t.vertex=!0,this.graph.setLinkForCell(t,"https://www.draw.io"),this.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Link")})),this.addEntry("timestamp date time text label",mxUtils.bind(this,function(){var t=new mxCell("%date{ddd mmm dd yyyy HH:MM:ss}%",new mxGeometry(0,0,160,20),"text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;overflow=hidden;");return t.vertex=!0,this.graph.setAttributeForCell(t,"placeholders","1"),this.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Timestamp")})),this.addEntry("variable placeholder metadata hello world text label",mxUtils.bind(this,function(){var t=new mxCell("%name% Text",new mxGeometry(0,0,80,20),"text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;overflow=hidden;");return t.vertex=!0,this.graph.setAttributeForCell(t,"placeholders","1"),this.graph.setAttributeForCell(t,"name","Variable"),this.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Variable")})),this.createVertexTemplateEntry("shape=ext;double=1;rounded=0;whiteSpace=wrap;html=1;",120,80,"","Double Rectangle",null,null,"rect rectangle box double"),this.createVertexTemplateEntry("shape=ext;double=1;rounded=1;whiteSpace=wrap;html=1;",120,80,"","Double Rounded Rectangle",null,null,"rounded rect rectangle box double"),this.createVertexTemplateEntry("ellipse;shape=doubleEllipse;whiteSpace=wrap;html=1;",100,60,"","Double Ellipse",null,null,"oval ellipse start end state double"),this.createVertexTemplateEntry("shape=ext;double=1;whiteSpace=wrap;html=1;aspect=fixed;",80,80,"","Double Square",null,null,"double square"),this.createVertexTemplateEntry("ellipse;shape=doubleEllipse;whiteSpace=wrap;html=1;aspect=fixed;",80,80,"","Double Circle",null,null,"double circle"),this.createVertexTemplateEntry("rounded=1;whiteSpace=wrap;html=1;strokeWidth=2;fillWeight=4;hachureGap=8;hachureAngle=45;fillColor=#1ba1e2;sketch=1;",120,60,"","Rectangle Sketch",!0,null,"rectangle rect box text sketch comic retro"),this.createVertexTemplateEntry("ellipse;whiteSpace=wrap;html=1;strokeWidth=2;fillWeight=2;hachureGap=8;fillColor=#990000;fillStyle=dots;sketch=1;",120,60,"","Ellipse Sketch",!0,null,"ellipse oval sketch comic retro"),this.createVertexTemplateEntry("rhombus;whiteSpace=wrap;html=1;strokeWidth=2;fillWeight=-1;hachureGap=8;fillStyle=cross-hatch;fillColor=#006600;sketch=1;",120,60,"","Diamond Sketch",!0,null,"diamond sketch comic retro"),this.createVertexTemplateEntry("html=1;whiteSpace=wrap;shape=isoCube2;backgroundOutline=1;isoAngle=15;",90,100,"","Isometric Cube",!0,null,"cube box iso isometric"),this.createVertexTemplateEntry("html=1;whiteSpace=wrap;aspect=fixed;shape=isoRectangle;",150,90,"","Isometric Square",!0,null,"rectangle rect box iso isometric"),this.createEdgeTemplateEntry("edgeStyle=isometricEdgeStyle;endArrow=none;html=1;",50,100,"","Isometric Edge 1"),this.createEdgeTemplateEntry("edgeStyle=isometricEdgeStyle;endArrow=none;html=1;elbow=vertical;",50,100,"","Isometric Edge 2"),this.createVertexTemplateEntry("shape=curlyBracket;whiteSpace=wrap;html=1;rounded=1;",20,120,"","Curly Bracket"),this.createVertexTemplateEntry("line;strokeWidth=2;html=1;",160,10,"","Horizontal Line"),this.createVertexTemplateEntry("line;strokeWidth=2;direction=south;html=1;",10,160,"","Vertical Line"),this.createVertexTemplateEntry("line;strokeWidth=4;html=1;perimeter=backbonePerimeter;points=[];outlineConnect=0;",160,10,"","Horizontal Backbone",!1,null,"backbone bus network"),this.createVertexTemplateEntry("line;strokeWidth=4;direction=south;html=1;perimeter=backbonePerimeter;points=[];outlineConnect=0;",10,160,"","Vertical Backbone",!1,null,"backbone bus network"),this.createVertexTemplateEntry("shape=crossbar;whiteSpace=wrap;html=1;rounded=1;",120,20,"","Crossbar",!1,null,"crossbar distance measure dimension unit"),this.createVertexTemplateEntry("shape=image;html=1;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=1;aspect=fixed;image="+this.gearImage,52,61,"","Image (Fixed Aspect)",!1,null,"fixed image icon symbol"),this.createVertexTemplateEntry("shape=image;html=1;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;image="+this.gearImage,50,60,"","Image (Variable Aspect)",!1,null,"strechted image icon symbol"),this.createVertexTemplateEntry("icon;html=1;image="+this.gearImage,60,60,"Icon","Icon",!1,null,"icon image symbol"),this.createVertexTemplateEntry("label;whiteSpace=wrap;html=1;image="+this.gearImage,140,60,"Label","Label 1",null,null,"label image icon symbol"),this.createVertexTemplateEntry("label;whiteSpace=wrap;html=1;align=center;verticalAlign=bottom;spacingLeft=0;spacingBottom=4;imageAlign=center;imageVerticalAlign=top;image="+this.gearImage,120,80,"Label","Label 2",null,null,"label image icon symbol"),this.addEntry("shape group container",function(){var t=new mxCell("Label",new mxGeometry(0,0,160,70),"html=1;whiteSpace=wrap;container=1;recursiveResize=0;collapsible=0;");t.vertex=!0;var e=new mxCell("",new mxGeometry(20,20,20,30),"triangle;html=1;whiteSpace=wrap;");return e.vertex=!0,t.insert(e),n.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Shape Group")}),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;left=0;right=0;fillColor=none;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;bottom=1;right=1;left=1;top=0;fillColor=none;routingCenterX=-0.5;",120,60,"","Partial Rectangle"),this.createEdgeTemplateEntry("edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;",50,50,"","Manual Line",null,e+"manual"),this.createEdgeTemplateEntry("shape=filledEdge;rounded=0;fixDash=1;endArrow=none;strokeWidth=10;fillColor=#ffffff;edgeStyle=orthogonalEdgeStyle;",60,40,"","Filled Edge"),this.createEdgeTemplateEntry("edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;",50,50,"","Horizontal Elbow",null,e+"elbow horizontal"),this.createEdgeTemplateEntry("edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;",50,50,"","Vertical Elbow",null,e+"elbow vertical")];this.addPaletteFunctions("misc",mxResources.get("misc"),null==t||t,e),this.setCurrentSearchEntryLibrary()},Sidebar.prototype.addAdvancedPalette=function(t){this.setCurrentSearchEntryLibrary("general","advanced"),this.addPaletteFunctions("advanced",mxResources.get("advanced"),null!=t&&t,this.createAdvancedShapes()),this.setCurrentSearchEntryLibrary()},Sidebar.prototype.addBasicPalette=function(t){this.setCurrentSearchEntryLibrary("basic"),this.addStencilPalette("basic",mxResources.get("basic"),t+"/basic.xml",";whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#000000;strokeWidth=2",null,null,null,null,[this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;top=0;bottom=0;fillColor=none;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;right=0;top=0;bottom=0;fillColor=none;routingCenterX=-0.5;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;bottom=0;right=0;fillColor=none;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;top=0;left=0;fillColor=none;",120,60,"","Partial Rectangle")]),this.setCurrentSearchEntryLibrary()},Sidebar.prototype.createAdvancedShapes=function(){var e=this,n=new mxCell("List Item",new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;");return n.vertex=!0,[this.createVertexTemplateEntry("shape=tapeData;whiteSpace=wrap;html=1;perimeter=ellipsePerimeter;",80,80,"","Tape Data"),this.createVertexTemplateEntry("shape=manualInput;whiteSpace=wrap;html=1;",80,80,"","Manual Input"),this.createVertexTemplateEntry("shape=loopLimit;whiteSpace=wrap;html=1;",100,80,"","Loop Limit"),this.createVertexTemplateEntry("shape=offPageConnector;whiteSpace=wrap;html=1;",80,80,"","Off Page Connector"),this.createVertexTemplateEntry("shape=delay;whiteSpace=wrap;html=1;",80,40,"","Delay"),this.createVertexTemplateEntry("shape=display;whiteSpace=wrap;html=1;",80,40,"","Display"),this.createVertexTemplateEntry("shape=singleArrow;direction=west;whiteSpace=wrap;html=1;",100,60,"","Arrow Left"),this.createVertexTemplateEntry("shape=singleArrow;whiteSpace=wrap;html=1;",100,60,"","Arrow Right"),this.createVertexTemplateEntry("shape=singleArrow;direction=north;whiteSpace=wrap;html=1;",60,100,"","Arrow Up"),this.createVertexTemplateEntry("shape=singleArrow;direction=south;whiteSpace=wrap;html=1;",60,100,"","Arrow Down"),this.createVertexTemplateEntry("shape=doubleArrow;whiteSpace=wrap;html=1;",100,60,"","Double Arrow"),this.createVertexTemplateEntry("shape=doubleArrow;direction=south;whiteSpace=wrap;html=1;",60,100,"","Double Arrow Vertical",null,null,"double arrow"),this.createVertexTemplateEntry("shape=actor;whiteSpace=wrap;html=1;",40,60,"","User",null,null,"user person human"),this.createVertexTemplateEntry("shape=cross;whiteSpace=wrap;html=1;",80,80,"","Cross"),this.createVertexTemplateEntry("shape=corner;whiteSpace=wrap;html=1;",80,80,"","Corner"),this.createVertexTemplateEntry("shape=tee;whiteSpace=wrap;html=1;",80,80,"","Tee"),this.createVertexTemplateEntry("shape=datastore;whiteSpace=wrap;html=1;",60,60,"","Data Store",null,null,"data store cylinder database"),this.createVertexTemplateEntry("shape=orEllipse;perimeter=ellipsePerimeter;whiteSpace=wrap;html=1;backgroundOutline=1;",80,80,"","Or",null,null,"or circle oval ellipse"),this.createVertexTemplateEntry("shape=sumEllipse;perimeter=ellipsePerimeter;whiteSpace=wrap;html=1;backgroundOutline=1;",80,80,"","Sum",null,null,"sum circle oval ellipse"),this.createVertexTemplateEntry("shape=lineEllipse;perimeter=ellipsePerimeter;whiteSpace=wrap;html=1;backgroundOutline=1;",80,80,"","Ellipse with horizontal divider",null,null,"circle oval ellipse"),this.createVertexTemplateEntry("shape=lineEllipse;line=vertical;perimeter=ellipsePerimeter;whiteSpace=wrap;html=1;backgroundOutline=1;",80,80,"","Ellipse with vertical divider",null,null,"circle oval ellipse"),this.createVertexTemplateEntry("shape=sortShape;perimeter=rhombusPerimeter;whiteSpace=wrap;html=1;",80,80,"","Sort",null,null,"sort"),this.createVertexTemplateEntry("shape=collate;whiteSpace=wrap;html=1;",80,80,"","Collate",null,null,"collate"),this.createVertexTemplateEntry("shape=switch;whiteSpace=wrap;html=1;",60,60,"","Switch",null,null,"switch router"),this.addEntry("process bar",function(){return e.createVertexTemplateFromData("zZXRaoMwFIafJpcDjbNrb2233rRQ8AkyPdPQaCRJV+3T7yTG2rUVBoOtgpDzn/xJzncCIdGyateKNeVW5iBI9EqipZLS9KOqXYIQhAY8J9GKUBrgT+jbRDZ02aBhCmrzEwPtDZ9MHKBXdkpmoDWKCVN9VptO+Kw+8kqwGqMkK7nIN6yTB7uTNizbD1FSSsVPsjYMC1qFKHxwIZZSSIVxLZ1/nJNar5+oQPMT7IYCrqUta1ENzuqGaeOFTArBGs3f3Vmtoo2Se7ja1h00kSoHK4bBIKUNy3hdoPYU0mF91i9mT8EEL2ocZ3gKa00ayWujLZY4IfHKFonVDLsRGgXuQ90zBmWgneyTk3yT1iArMKrDKUeem9L3ajHrbSXwohxsQd/ggOleKM7ese048J2/fwuim1uQGmhQCW8vQMkacP3GCQgBFMftHEsr7cYYe95CnmKTPMFbYD8CQ++DGQy+/M5X4ku5wHYmdIktfvk9tecpavThqS3m/0YtnqIWPTy1cD77K2wYjo+Ay317I74A",296,100,"Process Bar")}),this.createVertexTemplateEntry("swimlane;",200,200,"Container","Container",null,null,"container swimlane lane pool group"),this.addEntry("list group erd table",function(){var t=new mxCell("List",new mxGeometry(0,0,140,110),"swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=none;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;");return t.vertex=!0,t.insert(e.cloneCell(n,"Item 1")),t.insert(e.cloneCell(n,"Item 2")),t.insert(e.cloneCell(n,"Item 3")),e.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"List")}),this.addEntry("list item entry value group erd table",function(){return e.createVertexTemplateFromCells([e.cloneCell(n,"List Item")],n.geometry.width,n.geometry.height,"List Item")})]},Sidebar.prototype.addUmlPalette=function(t){var s=this,e=new mxCell("+ field: type",new mxGeometry(0,0,100,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;");e.vertex=!0;var i=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;");i.vertex=!0;var n="uml static class ";this.setCurrentSearchEntryLibrary("uml");n=[this.createVertexTemplateEntry("html=1;",110,50,"Object","Object",null,null,n+"object instance"),this.createVertexTemplateEntry("html=1;",110,50,"&laquo;interface&raquo;<br><b>Name</b>","Interface",null,null,n+"interface object instance annotated annotation"),this.addEntry(n+"object instance",function(){var t=new mxCell("Classname",new mxGeometry(0,0,160,90),"swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;");return t.vertex=!0,t.insert(e.clone()),t.insert(i.clone()),t.insert(s.cloneCell(e,"+ method(type): type")),s.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Class")}),this.addEntry(n+"section subsection",function(){var t=new mxCell("Classname",new mxGeometry(0,0,140,110),"swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=none;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;");return t.vertex=!0,t.insert(e.clone()),t.insert(e.clone()),t.insert(e.clone()),s.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Class 2")}),this.addEntry(n+"item member method function variable field attribute label",function(){return s.createVertexTemplateFromCells([s.cloneCell(e,"+ item: attribute")],e.geometry.width,e.geometry.height,"Item 1")}),this.addEntry(n+"item member method function variable field attribute label",function(){var t=new mxCell("item: attribute",new mxGeometry(0,0,120,e.geometry.height),"label;fontStyle=0;strokeColor=none;fillColor=none;align=left;verticalAlign=top;overflow=hidden;spacingLeft=28;spacingRight=4;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;imageWidth=16;imageHeight=16;image="+s.gearImage);return t.vertex=!0,s.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Item 2")}),this.addEntry(n+"divider hline line separator",function(){return s.createVertexTemplateFromCells([i.clone()],i.geometry.width,i.geometry.height,"Divider")}),this.addEntry(n+"spacer space gap separator",function(){var t=new mxCell("",new mxGeometry(0,0,20,14),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=4;spacingRight=4;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;");return t.vertex=!0,s.createVertexTemplateFromCells([t.clone()],t.geometry.width,t.geometry.height,"Spacer")}),this.createVertexTemplateEntry("text;align=center;fontStyle=1;verticalAlign=middle;spacingLeft=3;spacingRight=3;strokeColor=none;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;",80,26,"Title","Title",null,null,n+"title label"),this.addEntry(n+"component",function(){var t=new mxCell("&laquo;Annotation&raquo;<br/><b>Component</b>",new mxGeometry(0,0,180,90),"html=1;dropTarget=0;");t.vertex=!0;var e=new mxCell("",new mxGeometry(1,0,20,20),"shape=module;jettyWidth=8;jettyHeight=4;");return e.vertex=!0,e.geometry.relative=!0,e.geometry.offset=new mxPoint(-27,7),t.insert(e),s.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Component")}),this.addEntry(n+"component",function(){var t=new mxCell('<p style="margin:0px;margin-top:6px;text-align:center;"><b>Component</b></p><hr/><p style="margin:0px;margin-left:8px;">+ Attribute1: Type<br/>+ Attribute2: Type</p>',new mxGeometry(0,0,180,90),"align=left;overflow=fill;html=1;dropTarget=0;");t.vertex=!0;var e=new mxCell("",new mxGeometry(1,0,20,20),"shape=component;jettyWidth=8;jettyHeight=4;");return e.vertex=!0,e.geometry.relative=!0,e.geometry.offset=new mxPoint(-24,4),t.insert(e),s.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Component with Attributes")}),this.createVertexTemplateEntry("verticalAlign=top;align=left;spacingTop=8;spacingLeft=2;spacingRight=12;shape=cube;size=10;direction=south;fontStyle=4;html=1;",180,120,"Block","Block",null,null,n+"block"),this.createVertexTemplateEntry("shape=module;align=left;spacingLeft=20;align=center;verticalAlign=top;",100,50,"Module","Module",null,null,n+"module component"),this.createVertexTemplateEntry("shape=folder;fontStyle=1;spacingTop=10;tabWidth=40;tabHeight=14;tabPosition=left;html=1;",70,50,"package","Package",null,null,n+"package"),this.createVertexTemplateEntry("verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;",160,90,'<p style="margin:0px;margin-top:4px;text-align:center;text-decoration:underline;"><b>Object:Type</b></p><hr/><p style="margin:0px;margin-left:8px;">field1 = value1<br/>field2 = value2<br>field3 = value3</p>',"Object",null,null,n+"object instance"),this.createVertexTemplateEntry("verticalAlign=top;align=left;overflow=fill;html=1;",180,90,'<div style="box-sizing:border-box;width:100%;background:#e4e4e4;padding:2px;">Tablename</div><table style="width:100%;font-size:1em;" cellpadding="2" cellspacing="0"><tr><td>PK</td><td>uniqueId</td></tr><tr><td>FK1</td><td>foreignKey</td></tr><tr><td></td><td>fieldname</td></tr></table>',"Entity",null,null,"er entity table"),this.addEntry(n+"object instance",function(){var t=new mxCell('<p style="margin:0px;margin-top:4px;text-align:center;"><b>Class</b></p><hr size="1"/><div style="height:2px;"></div>',new mxGeometry(0,0,140,60),"verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;");return t.vertex=!0,s.createVertexTemplateFromCells([t.clone()],t.geometry.width,t.geometry.height,"Class 3")}),this.addEntry(n+"object instance",function(){var t=new mxCell('<p style="margin:0px;margin-top:4px;text-align:center;"><b>Class</b></p><hr size="1"/><div style="height:2px;"></div><hr size="1"/><div style="height:2px;"></div>',new mxGeometry(0,0,140,60),"verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;");return t.vertex=!0,s.createVertexTemplateFromCells([t.clone()],t.geometry.width,t.geometry.height,"Class 4")}),this.addEntry(n+"object instance",function(){var t=new mxCell('<p style="margin:0px;margin-top:4px;text-align:center;"><b>Class</b></p><hr size="1"/><p style="margin:0px;margin-left:4px;">+ field: Type</p><hr size="1"/><p style="margin:0px;margin-left:4px;">+ method(): Type</p>',new mxGeometry(0,0,160,90),"verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;");return t.vertex=!0,s.createVertexTemplateFromCells([t.clone()],t.geometry.width,t.geometry.height,"Class 5")}),this.addEntry(n+"object instance",function(){var t=new mxCell('<p style="margin:0px;margin-top:4px;text-align:center;"><i>&lt;&lt;Interface&gt;&gt;</i><br/><b>Interface</b></p><hr size="1"/><p style="margin:0px;margin-left:4px;">+ field1: Type<br/>+ field2: Type</p><hr size="1"/><p style="margin:0px;margin-left:4px;">+ method1(Type): Type<br/>+ method2(Type, Type): Type</p>',new mxGeometry(0,0,190,140),"verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;");return t.vertex=!0,s.createVertexTemplateFromCells([t.clone()],t.geometry.width,t.geometry.height,"Interface 2")}),this.createVertexTemplateEntry("shape=providedRequiredInterface;html=1;verticalLabelPosition=bottom;",20,20,"","Provided/Required Interface",null,null,"uml provided required interface lollipop notation"),this.createVertexTemplateEntry("shape=requiredInterface;html=1;verticalLabelPosition=bottom;",10,20,"","Required Interface",null,null,"uml required interface lollipop notation"),this.addEntry("uml lollipop notation provided required interface",function(){return s.createVertexTemplateFromData("zVTBrptADPyavVYEkt4b0uQd3pMq5dD2uAUD27dgZJwE8vX1spsQlETtpVWRIjFjex3PmFVJWvc70m31hjlYlXxWSUqI7N/qPgVrVRyZXCUbFceR/FS8fRJdjNGo1QQN/0lB7AuO2h7AM57oeLCBIDw0Obj8SCVrJK6wxEbbV8RWyIWQP4F52Juzq9AHRqEqrm2IQpN/IsKTwAYb8MzWWBuO9B0hL2E2BGsqIQyxvJ9rzApD7QBrYBokhcBqNsf5UbrzsLzmXUu/oJET42jwGat5QYcHyiDkTDLKy03TiRrFfSx08m+FrrQtUkOZvZdbFKThmwMfVhf4fQ43/W3uZriiPPT+KKhjwnf4anKuQv//wsg+NPJ7/9d9Xf7eVykwbeeMOFWGYd/qzEVO8tHP/Suw4a2ujXV/+gXsEdhkOgSC8os44BQt0tggicZHeG1N2QiXibhAV48epRayEDd8MT7Ct06TUaXVWq027tCuhcx5VZjebeeaoDNn/WMcb/p+j0AM/dNr6InLl4Lgzylsk6OCgRWYsuI592gNZh5OhgmcblPv7+1l+ws=",40,10,"Lollipop Notation")}),this.createVertexTemplateEntry("shape=umlBoundary;whiteSpace=wrap;html=1;",100,80,"Boundary Object","Boundary Object",null,null,"uml boundary object"),this.createVertexTemplateEntry("ellipse;shape=umlEntity;whiteSpace=wrap;html=1;",80,80,"Entity Object","Entity Object",null,null,"uml entity object"),this.createVertexTemplateEntry("ellipse;shape=umlControl;whiteSpace=wrap;html=1;",70,80,"Control Object","Control Object",null,null,"uml control object"),this.createVertexTemplateEntry("shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;",30,60,"Actor","Actor",!1,null,"uml actor"),this.createVertexTemplateEntry("ellipse;whiteSpace=wrap;html=1;",140,70,"Use Case","Use Case",null,null,"uml use case usecase"),this.addEntry("uml activity state start",function(){var t=new mxCell("",new mxGeometry(0,0,30,30),"ellipse;html=1;shape=startState;fillColor=#000000;strokeColor=#ff0000;");t.vertex=!0;var e=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;");return e.geometry.setTerminalPoint(new mxPoint(15,90),!1),e.geometry.relative=!0,e.edge=!0,t.insertEdge(e,!0),s.createVertexTemplateFromCells([t,e],30,90,"Start")}),this.addEntry("uml activity state",function(){var t=new mxCell("Activity",new mxGeometry(0,0,120,40),"rounded=1;whiteSpace=wrap;html=1;arcSize=40;fontColor=#000000;fillColor=#ffffc0;strokeColor=#ff0000;");t.vertex=!0;var e=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;");return e.geometry.setTerminalPoint(new mxPoint(60,100),!1),e.geometry.relative=!0,e.edge=!0,t.insertEdge(e,!0),s.createVertexTemplateFromCells([t,e],120,100,"Activity")}),this.addEntry("uml activity composite state",function(){var t=new mxCell("Composite State",new mxGeometry(0,0,160,60),"swimlane;html=1;fontStyle=1;align=center;verticalAlign=middle;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=0;resizeLast=1;container=0;fontColor=#000000;collapsible=0;rounded=1;arcSize=30;strokeColor=#ff0000;fillColor=#ffffc0;swimlaneFillColor=#ffffc0;dropTarget=0;");t.vertex=!0;var e=new mxCell("Subtitle",new mxGeometry(0,0,200,26),"text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;spacingLeft=4;spacingRight=4;whiteSpace=wrap;overflow=hidden;rotatable=0;fontColor=#000000;");e.vertex=!0,t.insert(e);e=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;");return e.geometry.setTerminalPoint(new mxPoint(80,120),!1),e.geometry.relative=!0,e.edge=!0,t.insertEdge(e,!0),s.createVertexTemplateFromCells([t,e],160,120,"Composite State")}),this.addEntry("uml activity condition",function(){var t=new mxCell("Condition",new mxGeometry(0,0,80,40),"rhombus;whiteSpace=wrap;html=1;fillColor=#ffffc0;strokeColor=#ff0000;");t.vertex=!0;var e=new mxCell("no",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;html=1;align=left;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;");e.geometry.setTerminalPoint(new mxPoint(180,20),!1),e.geometry.relative=!0,e.geometry.x=-1,e.edge=!0,t.insertEdge(e,!0);var n=new mxCell("yes",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;html=1;align=left;verticalAlign=top;endArrow=open;endSize=8;strokeColor=#ff0000;");return n.geometry.setTerminalPoint(new mxPoint(40,100),!1),n.geometry.relative=!0,n.geometry.x=-1,n.edge=!0,t.insertEdge(n,!0),s.createVertexTemplateFromCells([t,e,n],180,100,"Condition")}),this.addEntry("uml activity fork join",function(){var t=new mxCell("",new mxGeometry(0,0,200,10),"shape=line;html=1;strokeWidth=6;strokeColor=#ff0000;");t.vertex=!0;var e=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;html=1;verticalAlign=bottom;endArrow=open;endSize=8;strokeColor=#ff0000;");return e.geometry.setTerminalPoint(new mxPoint(100,80),!1),e.geometry.relative=!0,e.edge=!0,t.insertEdge(e,!0),s.createVertexTemplateFromCells([t,e],200,80,"Fork/Join")}),this.createVertexTemplateEntry("ellipse;html=1;shape=endState;fillColor=#000000;strokeColor=#ff0000;",30,30,"","End",null,null,"uml activity state end"),this.createVertexTemplateEntry("shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=1;collapsible=0;recursiveResize=0;outlineConnect=0;",100,300,":Object","Lifeline",null,null,"uml sequence participant lifeline"),this.createVertexTemplateEntry("shape=umlLifeline;participant=umlActor;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=1;collapsible=0;recursiveResize=0;verticalAlign=top;spacingTop=36;outlineConnect=0;",20,300,"","Actor Lifeline",null,null,"uml sequence participant lifeline actor"),this.createVertexTemplateEntry("shape=umlLifeline;participant=umlBoundary;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=1;collapsible=0;recursiveResize=0;verticalAlign=top;spacingTop=36;outlineConnect=0;",50,300,"","Boundary Lifeline",null,null,"uml sequence participant lifeline boundary"),this.createVertexTemplateEntry("shape=umlLifeline;participant=umlEntity;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=1;collapsible=0;recursiveResize=0;verticalAlign=top;spacingTop=36;outlineConnect=0;",40,300,"","Entity Lifeline",null,null,"uml sequence participant lifeline entity"),this.createVertexTemplateEntry("shape=umlLifeline;participant=umlControl;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=1;collapsible=0;recursiveResize=0;verticalAlign=top;spacingTop=36;outlineConnect=0;",40,300,"","Control Lifeline",null,null,"uml sequence participant lifeline control"),this.createVertexTemplateEntry("shape=umlFrame;whiteSpace=wrap;html=1;",300,200,"frame","Frame",null,null,"uml sequence frame"),this.createVertexTemplateEntry("shape=umlDestroy;whiteSpace=wrap;html=1;strokeWidth=3;",30,30,"","Destruction",null,null,"uml sequence destruction destroy"),this.addEntry("uml sequence invoke invocation call activation",function(){var t=new mxCell("",new mxGeometry(0,0,10,80),"html=1;points=[];perimeter=orthogonalPerimeter;");t.vertex=!0;var e=new mxCell("dispatch",new mxGeometry(0,0,0,0),"html=1;verticalAlign=bottom;startArrow=oval;endArrow=block;startSize=8;");return e.geometry.setTerminalPoint(new mxPoint(-60,0),!0),e.geometry.relative=!0,e.edge=!0,t.insertEdge(e,!1),s.createVertexTemplateFromCells([t,e],10,80,"Found Message")}),this.addEntry("uml sequence invoke call delegation synchronous invocation activation",function(){var t=new mxCell("",new mxGeometry(0,0,10,80),"html=1;points=[];perimeter=orthogonalPerimeter;");t.vertex=!0;var e=new mxCell("dispatch",new mxGeometry(0,0,0,0),"html=1;verticalAlign=bottom;endArrow=block;entryX=0;entryY=0;");e.geometry.setTerminalPoint(new mxPoint(-70,0),!0),e.geometry.relative=!0,e.edge=!0,t.insertEdge(e,!1);var n=new mxCell("return",new mxGeometry(0,0,0,0),"html=1;verticalAlign=bottom;endArrow=open;dashed=1;endSize=8;exitX=0;exitY=0.95;");return n.geometry.setTerminalPoint(new mxPoint(-70,76),!1),n.geometry.relative=!0,n.edge=!0,t.insertEdge(n,!0),s.createVertexTemplateFromCells([t,e,n],10,80,"Synchronous Invocation")}),this.addEntry("uml sequence self call recursion delegation activation",function(){var t=new mxCell("",new mxGeometry(0,20,10,40),"html=1;points=[];perimeter=orthogonalPerimeter;");t.vertex=!0;var e=new mxCell("self call",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;html=1;align=left;spacingLeft=2;endArrow=block;rounded=0;entryX=1;entryY=0;");return e.geometry.setTerminalPoint(new mxPoint(5,0),!0),e.geometry.points=[new mxPoint(30,0)],e.geometry.relative=!0,e.edge=!0,t.insertEdge(e,!1),s.createVertexTemplateFromCells([t,e],10,60,"Self Call")}),this.addEntry("uml sequence invoke call delegation callback activation",function(){return s.createVertexTemplateFromData("xZRNT8MwDIZ/Ta6oaymD47rBTkiTuMAxW6wmIm0q19s6fj1OE3V0Y2iCA4dK8euP2I+riGxedUuUjX52CqzIHkU2R+conKpuDtaKNDFKZAuRpgl/In264J303qSRCDVdk5CGhJ20WwhKEFo62ChoqritxURkReNMTa2X80LkC68AmgoIkEWHpF3pamlXR7WIFwASdBeb7KXY4RIc5+KBQ/ZGkY4RYY5Egyl1zLqLmmyDXQ6Zx4n5EIf+HkB2BmAjrV3LzftPIPw4hgNn1pQ1a2tH5Cp2QK1miG7vNeu4iJe4pdeY2BtvbCQDGlAljMCQxBJotJ8rWCFYSWY3LvUdmZi68rvkkLiU6QnL1m1xAzHoBOdw61WEb88II9AW67/ydQ2wq1Cy1aAGvOrFfPh6997qDA3g+dxzv3nIL6MPU/8T+kMw8+m4QPgdfrEJNo8PSQj/+s58Ag==",10,60,"Callback")}),this.createVertexTemplateEntry("html=1;points=[];perimeter=orthogonalPerimeter;",10,80,"","Activation",null,null,"uml sequence activation"),this.createVertexTemplateEntry("shape=partialRectangle;html=1;top=1;align=left;dashed=1;",200,20,"Template1 signature","Template signature",null,null,"template signature"),this.createVertexTemplateEntry("shape=partialRectangle;html=1;top=1;align=left;dashed=1;",200,50,"Template parameter 1\nTemplate parameter 2","Template signature",null,null,"template signature"),this.createVertexTemplateEntry("shape=note2;boundedLbl=1;whiteSpace=wrap;html=1;size=25;verticalAlign=top;align=center;",120,60,"Comment1 body","Note",null,null,"uml note"),this.addEntry("uml sequence self call recursion delegation activation",function(){var t=new mxCell("Constraint1 specification",new mxGeometry(0,0,160,60),"shape=note2;boundedLbl=1;whiteSpace=wrap;html=1;size=25;verticalAlign=top;align=center;");t.vertex=!0;var e=new mxCell("<<keyword>>",new mxGeometry(0,0,t.geometry.width,25),"resizeWidth=1;part=1;strokeColor=none;fillColor=none;align=left;spacingLeft=5;");return e.geometry.relative=!0,e.vertex=!0,t.insert(e),s.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Note")}),this.addEntry(n+"classifier",function(){var t=new mxCell("&lt;&lt;keyword&gt;&gt;<br><b>Classifier1</b><br>{abstract}",new mxGeometry(0,0,140,183),"swimlane;fontStyle=0;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=55;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=0;marginBottom=0;html=1;");t.vertex=!0;var e=new mxCell("attributes",new mxGeometry(0,0,140,20),"text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;");e.vertex=!0,t.insert(e);e=new mxCell("attribute1",new mxGeometry(0,0,140,20),"text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;");e.vertex=!0,t.insert(e);e=new mxCell("inherited attribute2",new mxGeometry(0,0,140,20),"text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fontColor=#808080;");e.vertex=!0,t.insert(e);e=new mxCell("...",new mxGeometry(0,0,140,20),"text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;");e.vertex=!0,t.insert(e),t.insert(i.clone());e=new mxCell("operations",new mxGeometry(0,0,140,20),"text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;");e.vertex=!0,t.insert(e);e=new mxCell("operation1",new mxGeometry(0,0,140,20),"text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;");return e.vertex=!0,t.insert(e),s.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Classifier")}),this.createVertexTemplateEntry("shape=process;fixedSize=1;size=5;fontStyle=1;",140,40,"Classifier1","Classifier",null,null,"classifier"),this.addEntry(n+"classifier",function(){var t=new mxCell("Classifier1",new mxGeometry(0,0,140,183),"swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=0;marginBottom=0;html=1;");t.vertex=!0;var e=new mxCell("internal structure",new mxGeometry(0,0,140,30),"html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;spacingLeft=4;spacingRight=4;rotatable=0;points=[[0,0.5],[1,0.5]];resizeWidth=1;");e.vertex=!0,t.insert(e);var n=new mxCell("",new mxGeometry(0,0,140,140),"strokeColor=none;fillColor=none;");n.vertex=!0,t.insert(n);var i=new mxCell("property1",new mxGeometry(0,0,100,30),"html=1;align=center;verticalAlign=middle;rotatable=0;");i.geometry.relative=!0,i.geometry.offset=new mxPoint(20,20),i.vertex=!0,n.insert(i);var l=new mxCell("property2",new mxGeometry(0,0,100,30),"html=1;align=center;verticalAlign=middle;rotatable=0;");l.geometry.relative=!0,l.geometry.offset=new mxPoint(20,90),l.vertex=!0,n.insert(l);e=new mxCell("connector1",new mxGeometry(0,0,0,0),"edgeStyle=none;endArrow=none;verticalAlign=middle;labelBackgroundColor=none;endSize=12;html=1;align=left;endFill=0;exitX=0.15;exitY=1;entryX=0.15;entryY=0;spacingLeft=4;");return e.geometry.relative=!0,e.edge=!0,i.insertEdge(e,!0),l.insertEdge(e,!1),n.insert(e),s.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Classifier")}),this.createVertexTemplateEntry("fontStyle=1;",140,30,"Association1","Association",null,null,"association"),this.addEntry(n+"classifier",function(){var t=new mxCell("Instance1",new mxGeometry(0,0,140,138),"swimlane;fontStyle=4;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=0;marginBottom=0;html=1;");t.vertex=!0;var e=new mxCell("slot1",new mxGeometry(0,0,140,30),"html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;rotatable=0;points=[[0,0.5],[1,0.5]];resizeWidth=1;");e.vertex=!0,t.insert(e),t.insert(i.clone());var n=new mxCell("internal structure",new mxGeometry(0,0,140,20),"html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;spacingLeft=4;spacingRight=4;rotatable=0;points=[[0,0.5],[1,0.5]];resizeWidth=1;");n.vertex=!0,t.insert(n);e=new mxCell("",new mxGeometry(0,0,140,50),"strokeColor=none;fillColor=none;");e.vertex=!0,t.insert(e);n=new mxCell("instance2",new mxGeometry(0,0,80,30),"html=1;align=center;verticalAlign=middle;rotatable=0;");return n.geometry.relative=!0,n.geometry.offset=new mxPoint(30,10),n.vertex=!0,e.insert(n),s.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Classifier")}),this.createVertexTemplateEntry("fontStyle=0;",120,40,"Instance1 value","Instance",null,null,"instance"),this.addEntry(n+"classifier",function(){var t=new mxCell("&lt;&lt;enumeration&gt;&gt;<br><b>Enum1</b>",new mxGeometry(0,0,140,70),"swimlane;fontStyle=0;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=40;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=0;marginBottom=0;html=1;");t.vertex=!0;var e=new mxCell("literal1",new mxGeometry(0,0,140,30),"text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;");return e.vertex=!0,t.insert(e),s.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Classifier")}),this.addEntry(n+"classifier",function(){var t=new mxCell("0..1",new mxGeometry(0,0,120,50),"align=right;verticalAlign=top;spacingRight=2;");t.vertex=!0;var e=new mxCell("Property1",new mxGeometry(0,1,120,30),"text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;resizeWidth=1;");return e.geometry.relative=!0,e.geometry.offset=new mxPoint(0,-30),e.vertex=!0,t.insert(e),s.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Classifier")}),this.createVertexTemplateEntry("fontStyle=0;dashed=1;",140,30,"Property1","Property",null,null,"property"),this.createVertexTemplateEntry("fontStyle=0;labelPosition=right;verticalLabelPosition=middle;align=left;verticalAlign=middle;spacingLeft=2;",30,30,"port1","Port",null,null,"port"),this.addEntry(n+"component",function(){var t=new mxCell("",new mxGeometry(0,0,140,200),"fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;marginBottom=0;");t.vertex=!0;var e=new mxCell("Component",new mxGeometry(0,0,140,40),"html=1;align=left;spacingLeft=4;verticalAlign=top;strokeColor=none;fillColor=none;");e.vertex=!0,t.insert(e);var n=new mxCell("",new mxGeometry(1,0,16,20),"shape=module;jettyWidth=10;jettyHeight=4;");n.vertex=!0,n.geometry.relative=!0,n.geometry.offset=new mxPoint(-25,9),e.insert(n),t.insert(i.clone());n=new mxCell("provided interfaces",new mxGeometry(0,0,140,25),"html=1;align=center;spacingLeft=4;verticalAlign=top;strokeColor=none;fillColor=none;");n.vertex=!0,t.insert(n);n=new mxCell("Interface1",new mxGeometry(0,0,140,25),"html=1;align=left;spacingLeft=4;verticalAlign=top;strokeColor=none;fillColor=none;");n.vertex=!0,t.insert(n),t.insert(i.clone());n=new mxCell("required interfaces",new mxGeometry(0,0,140,25),"html=1;align=center;spacingLeft=4;verticalAlign=top;strokeColor=none;fillColor=none;");n.vertex=!0,t.insert(n);n=new mxCell("Interface2",new mxGeometry(0,0,140,30),"html=1;align=left;spacingLeft=4;verticalAlign=top;strokeColor=none;fillColor=none;");return n.vertex=!0,t.insert(n),s.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Component")}),this.addEntry(n+"classifier",function(){var t=new mxCell("",new mxGeometry(0,0,270,230),"shape=ellipse;container=1;horizontal=1;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;html=1;dashed=1;collapsible=0;");t.vertex=!0;var e=new mxCell("Collaboration1",new mxGeometry(0,0,270,30),"html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;spacingLeft=4;spacingRight=4;rotatable=0;points=[[0,0.5],[1,0.5]];resizeWidth=1;");e.vertex=!0,t.insert(e);var n=new mxCell("",new mxGeometry(.145,0,192,8),"line;strokeWidth=1;fillColor=none;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;dashed=1;resizeWidth=1;");n.geometry.relative=!0,n.geometry.offset=new mxPoint(0,30),n.vertex=!0,t.insert(n);var i=new mxCell("Classifier1",new mxGeometry(0,0,100,30),"html=1;align=center;verticalAlign=middle;rotatable=0;");i.geometry.relative=!0,i.geometry.offset=new mxPoint(85,50),i.vertex=!0,t.insert(i);e=new mxCell("Collaboration use 1",new mxGeometry(0,0,140,30),"shape=ellipse;html=1;align=center;verticalAlign=middle;rotatable=0;dashed=1;");e.geometry.relative=!0,e.geometry.offset=new mxPoint(65,110),e.vertex=!0,t.insert(e);n=new mxCell("property1",new mxGeometry(0,0,0,0),"edgeStyle=none;endArrow=none;verticalAlign=middle;labelBackgroundColor=none;endSize=12;html=1;align=left;endFill=0;spacingLeft=4;");n.geometry.relative=!0,n.edge=!0,i.insertEdge(n,!0),e.insertEdge(n,!1),t.insert(n);i=new mxCell("Classifier2",new mxGeometry(0,0,100,30),"html=1;align=center;verticalAlign=middle;rotatable=0;");i.geometry.relative=!0,i.geometry.offset=new mxPoint(85,170),i.vertex=!0,t.insert(i);n=new mxCell("property1",new mxGeometry(0,0,0,0),"edgeStyle=none;endArrow=none;verticalAlign=middle;labelBackgroundColor=none;endSize=12;html=1;align=left;endFill=0;spacingLeft=4;");return n.geometry.relative=!0,n.edge=!0,e.insertEdge(n,!0),i.insertEdge(n,!1),t.insert(n),s.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Classifier")}),this.createVertexTemplateEntry("shape=folder;fontStyle=1;tabWidth=80;tabHeight=30;tabPosition=left;html=1;boundedLbl=1;",150,80,"Package1","Package",null,null,n+"package"),this.addEntry(n+"package",function(){var t=new mxCell("Package1",new mxGeometry(0,0,150,100),"shape=folder;fontStyle=1;tabWidth=110;tabHeight=30;tabPosition=left;html=1;boundedLbl=1;labelInHeader=1;");t.vertex=!0;var e=new mxCell("Packaged element1",new mxGeometry(0,0,110,30),"html=1;");return e.geometry.relative=!0,e.geometry.offset=new mxPoint(20,50),e.vertex=!0,t.insert(e),s.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Classifier")}),this.addEntry(n+"package",function(){var t=new mxCell("Model1",new mxGeometry(0,0,150,80),"shape=folder;fontStyle=1;tabWidth=110;tabHeight=30;tabPosition=left;html=1;boundedLbl=1;folderSymbol=triangle;");return t.vertex=!0,s.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Package")}),this.addEntry(n+"stereotype",function(){var t=new mxCell("",new mxGeometry(0,0,160,75),"shape=note2;size=25;childLayout=stackLayout;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=0;marginBottom=0;html=1;container=1;");t.vertex=!0;var e=new mxCell("&lt;&lt;stereotype1&gt;&gt;",new mxGeometry(0,0,160,25),"text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;");e.vertex=!0,t.insert(e);e=new mxCell("stereotype property 1",new mxGeometry(0,0,160,25),"text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;");e.vertex=!0,t.insert(e);e=new mxCell("stereotype property 2",new mxGeometry(0,0,160,25),"text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;");return e.vertex=!0,t.insert(e),s.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Stereotype")}),this.addEntry(n+"class",function(){var t=new mxCell("Class1",new mxGeometry(0,0,140,79),"swimlane;fontStyle=1;align=center;verticalAlign=middle;childLayout=stackLayout;horizontal=1;startSize=29;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=0;marginBottom=0;html=1;");t.vertex=!0;var e=new mxCell("&lt;&lt;stereotype1&gt;&gt;",new mxGeometry(0,0,140,25),"text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;");e.vertex=!0,t.insert(e);e=new mxCell("stereotype property 1",new mxGeometry(0,0,140,25),"text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;");return e.vertex=!0,t.insert(e),s.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Class")}),this.createVertexTemplateEntry("text;html=1;align=center;",200,25,"&lt;&lt;stereotype1, stereotype2...&gt;&gt;","Label",null,null,n+"label"),this.createVertexTemplateEntry("ellipse;",50,25,"icon","Icon",null,null,n+"icon"),this.addEntry(n+"region",function(){var t=new mxCell("",new mxGeometry(60,0,10,100),"line;strokeWidth=1;direction=south;html=1;dashed=1;dashPattern=20 20;");t.vertex=!0;var e=new mxCell("Region 1",new mxGeometry(0,40,60,20),"text;align=right;");e.vertex=!0;var n=new mxCell("Region 2",new mxGeometry(70,40,60,20),"text;align=left;");return n.vertex=!0,s.createVertexTemplateFromCells([t,e,n],130,t.geometry.height,"Region")}),this.addEntry(n+"State",function(){var t=new mxCell("State1<br>[invariant1]<br>&lt;&lt;extended/final&gt;&gt;",new mxGeometry(0,0,140,176),"swimlane;fontStyle=4;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=60;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=0;marginBottom=0;html=1;rounded=1;absoluteArcSize=1;arcSize=50;");t.vertex=!0;var e=new mxCell("",new mxGeometry(0,0,140,50),"fillColor=none;strokeColor=none;container=1;collapsible=0;");e.vertex=!0,t.insert(e);var n=new mxCell("State2",new mxGeometry(30,10,80,30),"html=1;align=center;verticalAlign=middle;rounded=1;absoluteArcSize=1;arcSize=10;");n.vertex=!0,e.insert(n),t.insert(i.clone());n=new mxCell("behavior1",new mxGeometry(0,0,140,25),"fillColor=none;strokeColor=none;align=left;verticalAlign=middle;spacingLeft=5;");n.vertex=!0,t.insert(n),t.insert(i.clone());n=new mxCell("transition1",new mxGeometry(0,0,140,25),"fillColor=none;strokeColor=none;align=left;verticalAlign=middle;spacingLeft=5;");return n.vertex=!0,t.insert(n),s.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"State")}),this.createVertexTemplateEntry("html=1;align=center;verticalAlign=top;rounded=1;absoluteArcSize=1;arcSize=10;dashed=1;",140,40,"State1","State",null,null,n+"state"),this.createVertexTemplateEntry("html=1;align=center;verticalAlign=top;rounded=1;absoluteArcSize=1;arcSize=10;dashed=0;",140,40,"State","State",null,null,n+"state"),this.createVertexTemplateEntry("shape=folder;align=center;verticalAlign=middle;fontStyle=0;tabWidth=100;tabHeight=30;tabPosition=left;html=1;boundedLbl=1;labelInHeader=1;rounded=1;absoluteArcSize=1;arcSize=10;",140,90,"State1","State",null,null,n+"state"),this.createVertexTemplateEntry("html=1;align=center;verticalAlign=top;rounded=1;absoluteArcSize=1;arcSize=10;dashed=0;",140,40,"State1, State2, ...","State",null,null,n+"state"),this.createVertexTemplateEntry("shape=umlState;rounded=1;verticalAlign=top;spacingTop=5;umlStateSymbol=collapseState;absoluteArcSize=1;arcSize=10;",140,60,"State1","State",null,null,n+"state"),this.addEntry(n+"State",function(){var t=new mxCell("State1",new mxGeometry(40,0,140,50),"shape=umlState;rounded=1;verticalAlign=middle;align=center;absoluteArcSize=1;arcSize=10;umlStateConnection=connPointRefEntry;boundedLbl=1;");t.vertex=!0;var e=new mxCell("Entry1",new mxGeometry(0,40,50,20),"text;verticalAlign=middle;align=center;");return e.vertex=!0,t.insert(e),s.createVertexTemplateFromCells([t,e],180,60,"State")}),this.addEntry(n+"State",function(){var t=new mxCell("State1",new mxGeometry(40,0,140,50),"shape=umlState;rounded=1;verticalAlign=middle;spacingTop=0;absoluteArcSize=1;arcSize=10;umlStateConnection=connPointRefExit;boundedLbl=1;");t.vertex=!0;var e=new mxCell("Exit1",new mxGeometry(0,40,50,20),"text;verticalAlign=middle;align=center;");return e.vertex=!0,t.insert(e),s.createVertexTemplateFromCells([t,e],180,60,"State")}),this.createVertexTemplateEntry("ellipse;fillColor=#000000;strokeColor=none;",30,30,"","Initial state",null,null,n+"initial state"),this.createVertexTemplateEntry("ellipse;html=1;shape=endState;fillColor=#000000;strokeColor=#000000;",30,30,"","Final state",null,null,n+"final state"),this.createVertexTemplateEntry("ellipse;fillColor=#ffffff;strokeColor=#000000;",30,30,"H","Shallow History",null,null,n+"shallow history"),this.createVertexTemplateEntry("ellipse;fillColor=#ffffff;strokeColor=#000000;",30,30,"H*","Deep History",null,null,n+"deep history"),this.createVertexTemplateEntry("ellipse;fillColor=#ffffff;strokeColor=#000000;",30,30,"","Entry Point",null,null,n+"entry point"),this.createVertexTemplateEntry("shape=sumEllipse;perimeter=ellipsePerimeter;whiteSpace=wrap;html=1;backgroundOutline=1;",30,30,"","Exit Point",null,null,n+"exit point"),this.createVertexTemplateEntry("ellipse;fillColor=#000000;strokeColor=none;",20,20,"","Junction",null,null,n+"junction"),this.createVertexTemplateEntry("rhombus;",30,30,"","Choice",null,null,n+"choice"),this.createVertexTemplateEntry("shape=umlDestroy;",30,30,"","Terminate",null,null,n+"terminate"),this.createVertexTemplateEntry("html=1;points=[];perimeter=orthogonalPerimeter;fillColor=#000000;strokeColor=none;",5,80,"","Join/Fork",null,null,n+"join fork"),this.createVertexTemplateEntry("text;align=center;verticalAlign=middle;dashed=0;fillColor=#ffffff;strokeColor=#000000;",140,40,"OpaqueAction1 spec.","Opaque Action",null,null,n+"opaque action"),this.createEdgeTemplateEntry("html=1;verticalAlign=bottom;startArrow=oval;startFill=1;endArrow=block;startSize=8;",60,0,"dispatch","Found Message 1",null,"uml sequence message call invoke dispatch"),this.createEdgeTemplateEntry("html=1;verticalAlign=bottom;startArrow=circle;startFill=1;endArrow=open;startSize=6;endSize=8;",80,0,"dispatch","Found Message 2",null,"uml sequence message call invoke dispatch"),this.createEdgeTemplateEntry("html=1;verticalAlign=bottom;endArrow=block;",80,0,"dispatch","Message",null,"uml sequence message call invoke dispatch"),this.addEntry("uml sequence return message",function(){var t=new mxCell("return",new mxGeometry(0,0,0,0),"html=1;verticalAlign=bottom;endArrow=open;dashed=1;endSize=8;");return t.geometry.setTerminalPoint(new mxPoint(80,0),!0),t.geometry.setTerminalPoint(new mxPoint(0,0),!1),t.geometry.relative=!0,t.edge=!0,s.createEdgeTemplateFromCells([t],80,0,"Return")}),this.addEntry("uml relation",function(){var t=new mxCell("name",new mxGeometry(0,0,0,0),"endArrow=block;endFill=1;html=1;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=top;");t.geometry.setTerminalPoint(new mxPoint(0,0),!0),t.geometry.setTerminalPoint(new mxPoint(160,0),!1),t.geometry.relative=!0,t.geometry.x=-1,t.edge=!0;var e=new mxCell("1",new mxGeometry(-1,0,0,0),"edgeLabel;resizable=0;html=1;align=left;verticalAlign=bottom;");return e.geometry.relative=!0,e.setConnectable(!1),e.vertex=!0,t.insert(e),s.createEdgeTemplateFromCells([t],160,0,"Relation 1")}),this.addEntry("uml association",function(){var t=new mxCell("",new mxGeometry(0,0,0,0),"endArrow=none;html=1;edgeStyle=orthogonalEdgeStyle;");t.geometry.setTerminalPoint(new mxPoint(0,0),!0),t.geometry.setTerminalPoint(new mxPoint(160,0),!1),t.geometry.relative=!0,t.edge=!0;var e=new mxCell("parent",new mxGeometry(-1,0,0,0),"edgeLabel;resizable=0;html=1;align=left;verticalAlign=bottom;");e.geometry.relative=!0,e.setConnectable(!1),e.vertex=!0,t.insert(e);e=new mxCell("child",new mxGeometry(1,0,0,0),"edgeLabel;resizable=0;html=1;align=right;verticalAlign=bottom;");return e.geometry.relative=!0,e.setConnectable(!1),e.vertex=!0,t.insert(e),s.createEdgeTemplateFromCells([t],160,0,"Association 1")}),this.addEntry("uml aggregation",function(){var t=new mxCell("1",new mxGeometry(0,0,0,0),"endArrow=open;html=1;endSize=12;startArrow=diamondThin;startSize=14;startFill=0;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=bottom;");return t.geometry.setTerminalPoint(new mxPoint(0,0),!0),t.geometry.setTerminalPoint(new mxPoint(160,0),!1),t.geometry.relative=!0,t.geometry.x=-1,t.geometry.y=3,t.edge=!0,s.createEdgeTemplateFromCells([t],160,0,"Aggregation 1")}),this.addEntry("uml composition",function(){var t=new mxCell("1",new mxGeometry(0,0,0,0),"endArrow=open;html=1;endSize=12;startArrow=diamondThin;startSize=14;startFill=1;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=bottom;");return t.geometry.setTerminalPoint(new mxPoint(0,0),!0),t.geometry.setTerminalPoint(new mxPoint(160,0),!1),t.geometry.relative=!0,t.geometry.x=-1,t.geometry.y=3,t.edge=!0,s.createEdgeTemplateFromCells([t],160,0,"Composition 1")}),this.addEntry("uml relation",function(){var t=new mxCell("Relation",new mxGeometry(0,0,0,0),"endArrow=open;html=1;endSize=12;startArrow=diamondThin;startSize=14;startFill=0;edgeStyle=orthogonalEdgeStyle;");t.geometry.setTerminalPoint(new mxPoint(0,0),!0),t.geometry.setTerminalPoint(new mxPoint(160,0),!1),t.geometry.relative=!0,t.edge=!0;var e=new mxCell("0..n",new mxGeometry(-1,0,0,0),"edgeLabel;resizable=0;html=1;align=left;verticalAlign=top;");e.geometry.relative=!0,e.setConnectable(!1),e.vertex=!0,t.insert(e);e=new mxCell("1",new mxGeometry(1,0,0,0),"edgeLabel;resizable=0;html=1;align=right;verticalAlign=top;");return e.geometry.relative=!0,e.setConnectable(!1),e.vertex=!0,t.insert(e),s.createEdgeTemplateFromCells([t],160,0,"Relation 2")}),this.createEdgeTemplateEntry("endArrow=open;endSize=12;dashed=1;html=1;",160,0,"Use","Dependency",null,"uml dependency use"),this.createEdgeTemplateEntry("endArrow=block;endSize=16;endFill=0;html=1;",160,0,"Extends","Generalization",null,"uml generalization extend"),this.createEdgeTemplateEntry("endArrow=block;startArrow=block;endFill=1;startFill=1;html=1;",160,0,"","Association 2",null,"uml association"),this.createEdgeTemplateEntry("endArrow=open;startArrow=circlePlus;endFill=0;startFill=0;endSize=8;html=1;",160,0,"","Inner Class",null,"uml inner class"),this.createEdgeTemplateEntry("endArrow=open;startArrow=cross;endFill=0;startFill=0;endSize=8;startSize=10;html=1;",160,0,"","Terminate",null,"uml terminate"),this.createEdgeTemplateEntry("endArrow=block;dashed=1;endFill=0;endSize=12;html=1;",160,0,"","Implementation",null,"uml realization implementation"),this.createEdgeTemplateEntry("endArrow=diamondThin;endFill=0;endSize=24;html=1;",160,0,"","Aggregation 2",null,"uml aggregation"),this.createEdgeTemplateEntry("endArrow=diamondThin;endFill=1;endSize=24;html=1;",160,0,"","Composition 2",null,"uml composition"),this.createEdgeTemplateEntry("endArrow=open;endFill=1;endSize=12;html=1;",160,0,"","Association 3",null,"uml association")];this.addPaletteFunctions("uml",mxResources.get("uml"),t||!1,n),this.setCurrentSearchEntryLibrary()},Sidebar.prototype.addBpmnPalette=function(t,e){var n=this;this.setCurrentSearchEntryLibrary("bpmn");var i=[this.createVertexTemplateEntry("shape=ext;rounded=1;html=1;whiteSpace=wrap;",120,80,"Task","Process",null,null,"bpmn task process"),this.createVertexTemplateEntry("shape=ext;rounded=1;html=1;whiteSpace=wrap;double=1;",120,80,"Transaction","Transaction",null,null,"bpmn transaction"),this.createVertexTemplateEntry("shape=ext;rounded=1;html=1;whiteSpace=wrap;dashed=1;dashPattern=1 4;",120,80,"Event\nSub-Process","Event Sub-Process",null,null,"bpmn event subprocess sub process sub-process"),this.createVertexTemplateEntry("shape=ext;rounded=1;html=1;whiteSpace=wrap;strokeWidth=3;",120,80,"Call Activity","Call Activity",null,null,"bpmn call activity"),this.addEntry("bpmn subprocess sub process sub-process",function(){var t=new mxCell("Sub-Process",new mxGeometry(0,0,120,80),"html=1;whiteSpace=wrap;rounded=1;dropTarget=0;");t.vertex=!0;var e=new mxCell("",new mxGeometry(.5,1,14,14),"html=1;shape=plus;outlineConnect=0;");return e.vertex=!0,e.geometry.relative=!0,e.geometry.offset=new mxPoint(-7,-14),t.insert(e),n.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Sub-Process")}),this.addEntry(this.getTagsForStencil("mxgraph.bpmn","loop","subprocess sub process sub-process looped").join(" "),function(){var t=new mxCell("Looped\nSub-Process",new mxGeometry(0,0,120,80),"html=1;whiteSpace=wrap;rounded=1;dropTarget=0;");t.vertex=!0;var e=new mxCell("",new mxGeometry(.5,1,14,14),"html=1;shape=mxgraph.bpmn.loop;outlineConnect=0;");e.vertex=!0,e.geometry.relative=!0,e.geometry.offset=new mxPoint(-15,-14),t.insert(e);e=new mxCell("",new mxGeometry(.5,1,14,14),"html=1;shape=plus;");return e.vertex=!0,e.geometry.relative=!0,e.geometry.offset=new mxPoint(1,-14),t.insert(e),n.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Looped Sub-Process")}),this.addEntry("bpmn receive task",function(){var t=new mxCell("Receive",new mxGeometry(0,0,120,80),"html=1;whiteSpace=wrap;rounded=1;dropTarget=0;");t.vertex=!0;var e=new mxCell("",new mxGeometry(0,0,20,14),"html=1;shape=message;outlineConnect=0;");return e.vertex=!0,e.geometry.relative=!0,e.geometry.offset=new mxPoint(7,7),t.insert(e),n.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Receive Task")}),this.addEntry(this.getTagsForStencil("mxgraph.bpmn","user_task").join(" "),function(){var t=new mxCell("User",new mxGeometry(0,0,120,80),"html=1;whiteSpace=wrap;rounded=1;dropTarget=0;");t.vertex=!0;var e=new mxCell("",new mxGeometry(0,0,14,14),"html=1;shape=mxgraph.bpmn.user_task;outlineConnect=0;");e.vertex=!0,e.geometry.relative=!0,e.geometry.offset=new mxPoint(7,7),t.insert(e);e=new mxCell("",new mxGeometry(.5,1,14,14),"html=1;shape=plus;outlineConnect=0;");return e.vertex=!0,e.geometry.relative=!0,e.geometry.offset=new mxPoint(-7,-14),t.insert(e),n.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"User Task")}),this.addEntry(this.getTagsForStencil("mxgraph.bpmn","timer_start","attached").join(" "),function(){var t=new mxCell("Process",new mxGeometry(0,0,120,80),"html=1;whiteSpace=wrap;rounded=1;dropTarget=0;");t.vertex=!0;var e=new mxCell("",new mxGeometry(1,1,30,30),"shape=mxgraph.bpmn.timer_start;perimeter=ellipsePerimeter;html=1;verticalLabelPosition=bottom;verticalAlign=top;outlineConnect=0;");return e.vertex=!0,e.geometry.relative=!0,e.geometry.offset=new mxPoint(-40,-15),t.insert(e),n.createVertexTemplateFromCells([t],120,95,"Attached Timer Event 1")}),this.addEntry(this.getTagsForStencil("mxgraph.bpmn","timer_start","attached").join(" "),function(){var t=new mxCell("Process",new mxGeometry(0,0,120,80),"html=1;whiteSpace=wrap;rounded=1;dropTarget=0;");t.vertex=!0;var e=new mxCell("",new mxGeometry(1,0,30,30),"shape=mxgraph.bpmn.timer_start;perimeter=ellipsePerimeter;html=1;labelPosition=right;align=left;outlineConnect=0;");return e.vertex=!0,e.geometry.relative=!0,e.geometry.offset=new mxPoint(-15,10),t.insert(e),n.createVertexTemplateFromCells([t],135,80,"Attached Timer Event 2")}),this.createVertexTemplateEntry("swimlane;html=1;horizontal=0;startSize=20;",320,240,"Pool","Pool",null,null,"bpmn pool"),this.createVertexTemplateEntry("swimlane;html=1;horizontal=0;swimlaneLine=0;",300,120,"Lane","Lane",null,null,"bpmn lane"),this.createVertexTemplateEntry("shape=hexagon;html=1;whiteSpace=wrap;perimeter=hexagonPerimeter;rounded=0;",60,50,"","Conversation",null,null,"bpmn conversation"),this.createVertexTemplateEntry("shape=hexagon;html=1;whiteSpace=wrap;perimeter=hexagonPerimeter;strokeWidth=4;rounded=0;",60,50,"","Call Conversation",null,null,"bpmn call conversation"),this.addEntry("bpmn subconversation sub conversation sub-conversation",function(){var t=new mxCell("",new mxGeometry(0,0,60,50),"shape=hexagon;whiteSpace=wrap;html=1;perimeter=hexagonPerimeter;rounded=0;dropTarget=0;");t.vertex=!0;var e=new mxCell("",new mxGeometry(.5,1,14,14),"html=1;shape=plus;");return e.vertex=!0,e.geometry.relative=!0,e.geometry.offset=new mxPoint(-7,-14),t.insert(e),n.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Sub-Conversation")}),this.addEntry("bpmn data object",function(){var t=new mxCell("",new mxGeometry(0,0,40,60),"shape=note;whiteSpace=wrap;size=16;html=1;dropTarget=0;");t.vertex=!0;var e=new mxCell("",new mxGeometry(0,0,14,14),"html=1;shape=singleArrow;arrowWidth=0.4;arrowSize=0.4;outlineConnect=0;");e.vertex=!0,e.geometry.relative=!0,e.geometry.offset=new mxPoint(2,2),t.insert(e);e=new mxCell("",new mxGeometry(.5,1,14,14),"html=1;whiteSpace=wrap;shape=parallelMarker;outlineConnect=0;");return e.vertex=!0,e.geometry.relative=!0,e.geometry.offset=new mxPoint(-7,-14),t.insert(e),n.createVertexTemplateFromCells([t],t.geometry.width,t.geometry.height,"Data Object")}),this.createVertexTemplateEntry("shape=datastore;whiteSpace=wrap;html=1;",60,60,"","Data Store",null,null,"bpmn data store"),this.createVertexTemplateEntry("shape=plus;html=1;outlineConnect=0;",14,14,"","Sub-Process Marker",null,null,"bpmn subprocess sub process sub-process marker"),this.createVertexTemplateEntry("shape=mxgraph.bpmn.loop;html=1;outlineConnect=0;",14,14,"","Loop Marker",null,null,"bpmn loop marker"),this.createVertexTemplateEntry("shape=parallelMarker;html=1;outlineConnect=0;",14,14,"","Parallel MI Marker",null,null,"bpmn parallel mi marker"),this.createVertexTemplateEntry("shape=parallelMarker;direction=south;html=1;outlineConnect=0;",14,14,"","Sequential MI Marker",null,null,"bpmn sequential mi marker"),this.createVertexTemplateEntry("shape=mxgraph.bpmn.ad_hoc;fillColor=#000000;html=1;outlineConnect=0;",14,14,"","Ad Hoc Marker",null,null,"bpmn ad hoc marker"),this.createVertexTemplateEntry("shape=mxgraph.bpmn.compensation;html=1;outlineConnect=0;",14,14,"","Compensation Marker",null,null,"bpmn compensation marker"),this.createVertexTemplateEntry("shape=message;whiteSpace=wrap;html=1;outlineConnect=0;fillColor=#000000;strokeColor=#ffffff;strokeWidth=2;",40,30,"","Send Task",null,null,"bpmn send task"),this.createVertexTemplateEntry("shape=message;whiteSpace=wrap;html=1;outlineConnect=0;",40,30,"","Receive Task",null,null,"bpmn receive task"),this.createVertexTemplateEntry("shape=mxgraph.bpmn.user_task;html=1;outlineConnect=0;",14,14,"","User Task",null,null,this.getTagsForStencil("mxgraph.bpmn","user_task").join(" ")),this.createVertexTemplateEntry("shape=mxgraph.bpmn.manual_task;html=1;outlineConnect=0;",14,14,"","Manual Task",null,null,this.getTagsForStencil("mxgraph.bpmn","user_task").join(" ")),this.createVertexTemplateEntry("shape=mxgraph.bpmn.business_rule_task;html=1;outlineConnect=0;",14,14,"","Business Rule Task",null,null,this.getTagsForStencil("mxgraph.bpmn","business_rule_task").join(" ")),this.createVertexTemplateEntry("shape=mxgraph.bpmn.service_task;html=1;outlineConnect=0;",14,14,"","Service Task",null,null,this.getTagsForStencil("mxgraph.bpmn","service_task").join(" ")),this.createVertexTemplateEntry("shape=mxgraph.bpmn.script_task;html=1;outlineConnect=0;",14,14,"","Script Task",null,null,this.getTagsForStencil("mxgraph.bpmn","script_task").join(" ")),this.createVertexTemplateEntry("html=1;shape=mxgraph.flowchart.annotation_2;align=left;labelPosition=right;",50,100,"","Annotation",null,null,this.getTagsForStencil("bpmn","annotation_1","bpmn business process model ").join(" ")),this.addDataEntry("crossfunctional cross-functional cross functional flowchart swimlane table",400,400,"Cross-Functional Flowchart","7ZhRb5swEMc/DY+bMCRt97jQpi+tVC2fwINbbMnYyD4C6aefjaHpBrTRlNCoTALJPp9t+P25O5kgTvL6XtOCPaoMRBDfBXGilULfyusEhAiikGdBfBtEUWjvIFqPjJJmNCyoBonHTIj8hB0VJXiL3dyYL+tSpsiVpM55LVSVMqrROxvci9bZMFq4JtKfzrRKGRfZA92rEjtr11tpVT1wCcYOhM5ViTKXry0G7RYb/uwWXDgDw9wCuSW2WTGOsClo6gYri8uvIGhheLN1s4KGtNSG7+AHGL+Os0JdUJm1nUJxiaDvdhZQt/EvJXHTvpTbjAq+lbadgnO1hhYSaIR6FHRjainfg8oB9d66VDxD5j0WoRcjZMC3DP8yUuMN25e5B91so5VuWMa4J+P3FJW2JtLXrOK5oNLJxZTmz/blqXhNp3mO5cpe9smS8OsyWNp5ie2TQ99ezl1joqRBTXmDAajBCgxejprHKBcNK7fvBPIz3hOSRCcQctET8olRA+8JmSopIW2j8GOD6Sji8TDxepT4C9yTE1+OEo/mQ5xcTYn8ahR5PB/k0c2UyK9HC8SbX/mnLBAnqAlD8XK+onDTE+/fw+TiQF9fTin4Nl/O0xYAEs6X9LR5n5Ae6S7xv1lr/yf+4cQ/pN75Ej/pH88/UZyQkRPzR6R+0j9Bz4f0xMm/f8adD+qzZn/bPfw5bMb++LH4Gw=="),this.addDataEntry("container swimlane pool horizontal",480,380,"Horizontal Pool 1","zZRLbsIwEIZP4709TlHXhJYNSEicwCIjbNWJkWNKwumZxA6IlrRUaisWlmb+eX8LM5mXzdyrnV66Ai2TL0zm3rkQrbLJ0VoG3BRMzhgAp8fgdSQq+ijfKY9VuKcAYsG7snuMyso5G8U6tDaJ9cGUVlXkTXUoacuZIHOjjS0WqnX7blYd1OZt8KYea3PE1bCI+CAtVUMq7/o5b46uCmroSn18WFMm+XCdse5GpLq0OPqAzejxvZQun6MrMfiWUg6mCDpmZM8RENdotjqVyUFUdRS259oLSzISztto5Se0i44gcHEn3i9A/IQB3GbQpmi69DskAn4BSTaGBB4Jicj+k8nTGBP5SExg8odMyL38eH3s6kM8AQ=="),this.addDataEntry("container swimlane pool horizontal",480,360,"Horizontal Pool 2","zZTBbsIwDIafJvfU6dDOlI0LSEg8QUQtEi1tUBJGy9PPbcJQWTsxaZs4VLJ//07sT1WYKKpm6eRBrW2JhokXJgpnbYhR1RRoDAOuSyYWDIDTx+B1opr1VX6QDutwTwPEhndpjhiVjbUmij60Jon+pCsja8rmKlQ05SKjcKe0KVeytcfuLh/k7u2SzR16fcbNZZDsRlrLhlTenWedPts6SJMEOseFLTkph6Fj212RbGlwdAGbyeV7KW2+RFthcC1ZTroMKjry5wiIK9R7ldrELInSR2H/2XtlSUHCOY5WfEG76ggCz+7E+w2InzCAcQapIf0fAySzESQZ/AKSfAoJPCKS9mbzf0H0NIVIPDAiyP8QEaXX97CvDZ7LDw=="),this.createVertexTemplateEntry("swimlane;startSize=20;horizontal=0;",320,120,"Lane","Horizontal Swimlane",null,null,"swimlane lane pool"),this.addDataEntry("container swimlane pool horizontal",360,480,"Vertical Pool 1","xZRBbsIwEEVP4709ThFrQssGJKSewCIjbNXGyDEl4fSdxKa0NJFQVTULSzP/e+T5b2EmS9esgjrqja/QMvnMZBm8j6lyTYnWMuCmYnLJADgdBi8jruhdflQBD/GRAUgD78qeMClb720S69jaLNZn46w6ULfQ0dGWS0HlThtbrVXrT91bdVS7t2u3CFibC26vi4g7aaMaUjmpNBbiKxnUQyfkjTBEbEZT9VKOtELvMIaWrpxNFXW6IWcpOddo9jqPFfMsqjoJ+8/ZGyQqMqdhZvIHs3WHBrh4kNvvIsNw5Da7OdgXAgKGCMz+gEAxRgCmINDcxZ2CyNMYETkhESj+jwi1t1+r9759ah8="),this.addDataEntry("container swimlane pool vertical",380,480,"Vertical Pool 2","xZTPbsIwDMafJvf86dDOlI0LSEg8QUQtEi1pUBJGy9PPbdJ1G1TqhXGoZH/219g/RSGitM3ay5PaugoMEW9ElN65mCLblGAM4VRXRKwI5xQ/wt8nqqyv0pP0UMc5Bp4Mn9KcISk750wSQ2xNFsNFWyNrzJYqWpxyxTA8KG2qjWzduTsrRHn4GLKlh6CvsBsGYX+krWxQpaiizcc9FjDnnaCc11dXR2lyxyjsuyPy3/Lg4CM0k8v3Ut58Dc5C9C22XHQVVeoQrwkQVaCPKtuKQZQhCcdv78gSg4zzPlpxg3bTEeSUzcR7Q2bWyvz+ytmQr8NPAow/ikAxRYA/kQAr/hPByxQC8cxLsHggAkzH56uv/XrdvgA="),this.createVertexTemplateEntry("swimlane;startSize=20;",120,320,"Lane","Vertical Swimlane",null,null,"swimlane lane pool"),this.createVertexTemplateEntry("rounded=1;arcSize=10;dashed=1;strokeColor=#000000;fillColor=none;gradientColor=none;dashPattern=8 3 1 3;strokeWidth=2;",200,200,"","Group",null,null,this.getTagsForStencil("bpmn","group","bpmn business process model ").join(" ")),this.createEdgeTemplateEntry("endArrow=block;endFill=1;endSize=6;html=1;",100,0,"","Sequence Flow",null,"bpmn sequence flow"),this.createEdgeTemplateEntry("startArrow=dash;startSize=8;endArrow=block;endFill=1;endSize=6;html=1;",100,0,"","Default Flow",null,"bpmn default flow"),this.createEdgeTemplateEntry("startArrow=diamondThin;startFill=0;startSize=14;endArrow=block;endFill=1;endSize=6;html=1;",100,0,"","Conditional Flow",null,"bpmn conditional flow"),this.createEdgeTemplateEntry("startArrow=oval;startFill=0;startSize=7;endArrow=block;endFill=0;endSize=10;dashed=1;html=1;",100,0,"","Message Flow 1",null,"bpmn message flow"),this.addEntry("bpmn message flow",function(){var t=new mxCell("",new mxGeometry(0,0,0,0),"startArrow=oval;startFill=0;startSize=7;endArrow=block;endFill=0;endSize=10;dashed=1;html=1;");t.geometry.setTerminalPoint(new mxPoint(0,0),!0),t.geometry.setTerminalPoint(new mxPoint(100,0),!1),t.geometry.relative=!0,t.edge=!0;var e=new mxCell("",new mxGeometry(0,0,20,14),"shape=message;html=1;outlineConnect=0;");return e.geometry.relative=!0,e.vertex=!0,e.geometry.offset=new mxPoint(-10,-7),t.insert(e),n.createEdgeTemplateFromCells([t],100,0,"Message Flow 2")}),this.createEdgeTemplateEntry("shape=link;html=1;",100,0,"","Link",null,"bpmn link")];this.addPaletteFunctions("bpmn","BPMN "+mxResources.get("general"),!1,i),this.setCurrentSearchEntryLibrary()},Sidebar.prototype.createTitle=function(t){var e=document.createElement("a");return e.setAttribute("title",mxResources.get("sidebarTooltip")),e.className="geTitle",mxUtils.write(e,t),e},Sidebar.prototype.createThumb=function(t,e,n,i,l,s,o,r,a){this.graph.labelsVisible=null==s||s;var h=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject,this.graph.view.scaleAndTranslate(1,0,0),this.graph.addCells(t);s=this.graph.getGraphBounds(),t=Math.floor(100*Math.min((e-2*this.thumbBorder)/s.width,(n-2*this.thumbBorder)/s.height))/100;this.graph.view.scaleAndTranslate(t,Math.floor((e-s.width*t)/2/t-s.x),Math.floor((n-s.height*t)/2/t-s.y));t=null;return this.graph.dialect!=mxConstants.DIALECT_SVG||mxClient.NO_FO||null==this.graph.view.getCanvas().ownerSVGElement?((t=this.graph.container.cloneNode(!1)).innerHTML=this.graph.container.innerHTML,!mxClient.IS_QUIRKS&&8!=document.documentMode||(t.firstChild.style.overflow="visible")):t=this.graph.view.getCanvas().ownerSVGElement.cloneNode(!0),this.graph.getModel().clear(),mxClient.NO_FO=h,mxClient.IS_IE6&&(i.style.backgroundImage="url("+this.editorUi.editor.transparentImage+")"),t.style.position="relative",t.style.overflow="hidden",t.style.left=this.thumbBorder+"px",t.style.top=this.thumbBorder+"px",t.style.width=e+"px",t.style.height=n+"px",t.style.visibility="",t.style.minWidth="",t.style.minHeight="",i.appendChild(t),this.sidebarTitles&&null!=l&&0!=o&&(o=mxClient.IS_QUIRKS?2*this.thumbPadding+2:0,i.style.height=this.thumbHeight+o+this.sidebarTitleSize+8+"px",(o=document.createElement("div")).style.fontSize=this.sidebarTitleSize+"px",o.style.color="#303030",o.style.textAlign="center",o.style.whiteSpace="nowrap",mxClient.IS_IE&&(o.style.height=this.sidebarTitleSize+12+"px"),o.style.paddingTop="4px",mxUtils.write(o,l),i.appendChild(o)),s},Sidebar.prototype.createItem=function(e,n,i,t,l,s,o){var r=document.createElement("a");r.className="geItem",r.style.overflow="hidden";var a=mxClient.IS_QUIRKS?8+2*this.thumbPadding:2*this.thumbBorder;r.style.width=this.thumbWidth+a+"px",r.style.height=this.thumbHeight+a+"px",r.style.padding=this.thumbPadding+"px",mxClient.IS_IE6&&(r.style.border="none"),mxEvent.addListener(r,"click",function(t){mxEvent.consume(t)}),this.createThumb(e,this.thumbWidth,this.thumbHeight,r,n,i,t,l,s);var h,d=new mxRectangle(0,0,l,s);return 1<e.length||e[0].vertex?(h=this.createDragSource(r,this.createDropHandler(e,!0,o,d),this.createDragPreview(l,s),e,d),this.addClickHandler(r,h,e),h.isGuidesEnabled=mxUtils.bind(this,function(){return this.editorUi.editor.graph.graphHandler.guidesEnabled})):null!=e[0]&&e[0].edge&&(h=this.createDragSource(r,this.createDropHandler(e,!1,o,d),this.createDragPreview(l,s),e,d),this.addClickHandler(r,h,e)),mxClient.IS_IOS||mxEvent.addGestureListeners(r,null,mxUtils.bind(this,function(t){mxEvent.isMouseEvent(t)&&this.showTooltip(r,e,d.width,d.height,n,i)})),r},Sidebar.prototype.updateShapes=function(t,e){var n=this.editorUi.editor.graph,i=n.getCellStyle(t),l=[];n.model.beginUpdate();try{for(var s=n.getModel().getStyle(t),o=["shadow","dashed","dashPattern","fontFamily","fontSize","fontColor","align","startFill","startSize","endFill","endSize","strokeColor","strokeWidth","fillColor","gradientColor","html","part","noEdgeStyle","edgeStyle","elbow","childLayout","recursiveResize","container","collapsible","connectable","comic","sketch","fillWeight","hachureGap","hachureAngle","jiggle","disableMultiStroke","disableMultiStrokeFill","fillStyle","curveFitting","simplification","sketchStyle"],r=0;r<e.length;r++){var a=e[r];if(n.getModel().isVertex(a)==n.getModel().isVertex(t)||n.getModel().isEdge(a)==n.getModel().isEdge(t)){var h=n.getCurrentCellStyle(e[r]);if(n.getModel().setStyle(a,s),"1"==mxUtils.getValue(h,"composite","0"))for(var d=n.model.getChildCount(a);0<=d;d--)n.model.remove(n.model.getChildAt(a,d));"umlLifeline"==h[mxConstants.STYLE_SHAPE]&&"umlLifeline"!=i[mxConstants.STYLE_SHAPE]&&(n.setCellStyles(mxConstants.STYLE_SHAPE,"umlLifeline",[a]),n.setCellStyles("participant",i[mxConstants.STYLE_SHAPE],[a]));for(d=0;d<o.length;d++){var u=h[o[d]];null!=u&&n.setCellStyles(o[d],u,[a])}l.push(a)}}}finally{n.model.endUpdate()}return l},Sidebar.prototype.createDropHandler=function(g,x,y,f){return y=null==y||y,mxUtils.bind(this,function(t,e,n,i,l,s){for(var o=s?null:mxEvent.isTouchEvent(e)||mxEvent.isPenEvent(e)?document.elementFromPoint(mxEvent.getClientX(e),mxEvent.getClientY(e)):mxEvent.getSource(e);null!=o&&o!=this.container;)o=o.parentNode;if(null==o&&t.isEnabled()){if(0<(g=t.getImportableCells(g)).length){t.stopEditing();var r,s=null!=n&&!mxEvent.isAltDown(e)&&t.isValidDropTarget(n,g,e),a=null;if(null==n||s||(n=null),!t.isCellLocked(n||t.getDefaultParent())){t.model.beginUpdate();try{if(i=Math.round(i),l=Math.round(l),x&&t.isSplitTarget(n,g,e)?(u=t.view.scale,p=(i+(d=t.view.translate).x)*u,m=(l+d.y)*u,r=t.cloneCells(g),t.splitEdge(n,r,null,i-f.width/2,l-f.height/2,p,m),a=r):0<g.length&&(a=t.importCells(g,i,l,n)),null!=t.layoutManager){var h=t.layoutManager.getLayout(n);if(null!=h)for(var d,u=t.view.scale,p=(i+(d=t.view.translate).x)*u,m=(l+d.y)*u,c=0;c<a.length;c++)h.moveCell(a[c],p,m)}!y||null!=e&&mxEvent.isShiftDown(e)||t.fireEvent(new mxEventObject("cellsInserted","cells",a))}catch(t){this.editorUi.handleError(t)}finally{t.model.endUpdate()}null!=a&&0<a.length&&(t.scrollCellToVisible(a[0]),t.setSelectionCells(a)),t.editAfterInsert&&null!=e&&mxEvent.isMouseEvent(e)&&null!=a&&1==a.length&&window.setTimeout(function(){t.startEditing(a[0])},0)}}mxEvent.consume(e)}})},Sidebar.prototype.createDragPreview=function(t,e){var n=document.createElement("div");return n.style.border=this.dragPreviewBorder,n.style.width=t+"px",n.style.height=e+"px",n},Sidebar.prototype.dropAndConnect=function(t,e,n,i,l){var s=this.getDropAndConnectGeometry(t,e[i],n,e),o=[];if(null!=s){var r=this.editorUi.editor.graph,a=null;r.model.beginUpdate();try{var h=r.getCellGeometry(t),d=r.getCellGeometry(e[i]),u=r.model.getParent(t),p=!0;null==r.layoutManager||null!=(c=r.layoutManager.getLayout(u))&&c.constructor==mxStackLayout&&(p=!1);var o=r.model.isEdge(t)?null:r.view.getState(u),m=0,c=0;null!=o&&(m=(g=o.origin).x,c=g.y,null!=(x=s.getTerminalPoint(!1))&&(x.x+=g.x,x.y+=g.y));var g,x=!r.isTableRow(t)&&!r.isTableCell(t)&&(r.model.isEdge(t)||null!=h&&!h.relative&&p),h=r.getCellAt((s.x+m+r.view.translate.x)*r.view.scale,(s.y+c+r.view.translate.y)*r.view.scale,null,null,null,function(t,e,n){return!r.isContainer(t.cell)});null!=h&&h!=u?null!=(o=r.view.getState(h))&&(g=o.origin,u=h,x=!0,r.model.isEdge(t)||(s.x-=g.x-m,s.y-=g.y-c)):p&&!r.isTableRow(t)&&!r.isTableCell(t)||(s.x+=m,s.y+=c),m=d.x,c=d.y,r.model.isEdge(e[i])&&(c=m=0),o=e=r.importCells(e,s.x-(x?m:0),s.y-(x?c:0),x?u:null),r.model.isEdge(t)?r.model.setTerminal(t,e[i],n==mxConstants.DIRECTION_NORTH):r.model.isEdge(e[i])?(r.model.setTerminal(e[i],t,!0),((p=r.getCellGeometry(e[i])).points=null)!=p.getTerminalPoint(!1)?p.setTerminalPoint(s.getTerminalPoint(!1),!1):x&&r.model.isVertex(u)&&(g=(u=r.view.getState(u)).cell!=r.view.currentRoot?u.origin:new mxPoint(0,0),r.cellsMoved(e,g.x,g.y,null,null,!0))):(d=r.getCellGeometry(e[i]),m=s.x-Math.round(d.x),c=s.y-Math.round(d.y),s.x=Math.round(d.x),s.y=Math.round(d.y),r.model.setGeometry(e[i],s),r.cellsMoved(e,m,c,null,null,!0),o=e.slice(),a=1==o.length?o[0]:null,e.push(r.insertEdge(null,null,"",t,e[i],r.createCurrentEdgeStyle()))),null!=l&&mxEvent.isShiftDown(l)||r.fireEvent(new mxEventObject("cellsInserted","cells",e))}catch(t){this.editorUi.handleError(t)}finally{r.model.endUpdate()}r.editAfterInsert&&null!=l&&mxEvent.isMouseEvent(l)&&null!=a&&window.setTimeout(function(){r.startEditing(a)},0)}return o},Sidebar.prototype.getDropAndConnectGeometry=function(t,e,n,i){var l,s,o,r=this.editorUi.editor.graph,a=r.view,h=1<i.length,d=r.getCellGeometry(t),i=r.getCellGeometry(e);return null!=d&&null!=i&&(i=i.clone(),r.model.isEdge(t)?(s=(l=(o=r.view.getState(t)).absolutePoints)[0],l=l[l.length-1],n==mxConstants.DIRECTION_NORTH?(i.x=s.x/a.scale-a.translate.x-i.width/2,i.y=s.y/a.scale-a.translate.y-i.height/2):(i.x=l.x/a.scale-a.translate.x-i.width/2,i.y=l.y/a.scale-a.translate.y-i.height/2)):(d.relative&&(o=r.view.getState(t),(d=d.clone()).x=(o.x-a.translate.x)/a.scale,d.y=(o.y-a.translate.y)/a.scale),o=r.defaultEdgeLength,r.model.isEdge(e)&&null!=i.getTerminalPoint(!0)&&null!=i.getTerminalPoint(!1)?(s=i.getTerminalPoint(!0),a=(l=i.getTerminalPoint(!1)).x-s.x,s=l.y-s.y,o=Math.sqrt(a*a+s*s),i.x=d.getCenterX(),i.y=d.getCenterY(),i.width=1,i.height=1,n==mxConstants.DIRECTION_NORTH?(i.height=o,i.y=d.y-o,i.setTerminalPoint(new mxPoint(i.x,i.y),!1)):n==mxConstants.DIRECTION_EAST?(i.width=o,i.x=d.x+d.width,i.setTerminalPoint(new mxPoint(i.x+i.width,i.y),!1)):n==mxConstants.DIRECTION_SOUTH?(i.height=o,i.y=d.y+d.height,i.setTerminalPoint(new mxPoint(i.x,i.y+i.height),!1)):n==mxConstants.DIRECTION_WEST&&(i.width=o,i.x=d.x-o,i.setTerminalPoint(new mxPoint(i.x,i.y),!1))):(!h&&45<i.width&&45<i.height&&45<d.width&&45<d.height&&(i.width=i.width*(d.height/i.height),i.height=d.height),i.x=d.x+d.width/2-i.width/2,i.y=d.y+d.height/2-i.height/2,n==mxConstants.DIRECTION_NORTH?i.y=i.y-d.height/2-i.height/2-o:n==mxConstants.DIRECTION_EAST?i.x=i.x+d.width/2+i.width/2+o:n==mxConstants.DIRECTION_SOUTH?i.y=i.y+d.height/2+i.height/2+o:n==mxConstants.DIRECTION_WEST&&(i.x=i.x-d.width/2-i.width/2-o),!r.model.isEdge(e)||null==i.getTerminalPoint(!0)||null==e.getTerminal(!1)||null!=(e=r.getCellGeometry(e.getTerminal(!1)))&&(n==mxConstants.DIRECTION_NORTH?(i.x-=e.getCenterX(),i.y-=e.getCenterY()+e.height/2):n==mxConstants.DIRECTION_EAST?(i.x-=e.getCenterX()-e.width/2,i.y-=e.getCenterY()):n==mxConstants.DIRECTION_SOUTH?(i.x-=e.getCenterX(),i.y-=e.getCenterY()-e.height/2):n==mxConstants.DIRECTION_WEST&&(i.x-=e.getCenterX()+e.width/2,i.y-=e.getCenterY()))))),i},Sidebar.prototype.isDropStyleEnabled=function(t,e){var n=!0;return null==e||1!=t.length||null!=(e=this.graph.getCellStyle(t[e]))&&(n=mxUtils.getValue(e,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE||mxUtils.getValue(e,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE)!=mxConstants.NONE),n},Sidebar.prototype.isDropStyleTargetIgnored=function(t){return this.graph.isSwimlane(t.cell)||this.graph.isTableCell(t.cell)||this.graph.isTableRow(t.cell)||this.graph.isTable(t.cell)},Sidebar.prototype.createDragSource=function(t,o,e,y,u){for(var n=this.editorUi,i=n.editor.graph,p=null,f=null,m=this,l=0;l<y.length&&(null==f&&i.model.isVertex(y[l])?f=l:null==p&&i.model.isEdge(y[l])&&null==i.model.getTerminal(y[l],!0)&&(p=l),null==f||null==p);l++);var C=this.isDropStyleEnabled(y,f),v=mxUtils.makeDraggable(t,i,mxUtils.bind(this,function(t,e,n,i,l){var s;null!=this.updateThread&&window.clearTimeout(this.updateThread),null!=y&&null!=w&&N==M?(s=t.isCellSelected(w.cell)?t.getSelectionCells():[w.cell],s=this.updateShapes(t.model.isEdge(w.cell)?y[0]:y[f],s),t.setSelectionCells(s)):null!=y&&null!=N&&null!=E&&N!=M?(s=t.model.isEdge(E.cell)||null==p?f:p,t.setSelectionCells(this.dropAndConnect(E.cell,y,U,s,e))):o.apply(this,arguments),null!=this.editorUi.hoverIcons&&this.editorUi.hoverIcons.update(t.view.getState(t.getSelectionCell()))}),e,0,0,i.autoscroll,!0,!0);i.addListener(mxEvent.ESCAPE,function(t,e){v.isActive()&&v.reset()});var s=v.mouseDown;function r(t,e){var n=null;return mxClient.IS_IE&&!mxClient.IS_SVG?(mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?((n=document.createElement(mxClient.VML_PREFIX+":image")).setAttribute("src",t.src),n.style.borderStyle="none"):((n=document.createElement("div")).style.backgroundImage="url("+t.src+")",n.style.backgroundPosition="center",n.style.backgroundRepeat="no-repeat"),n.style.width=t.width+4+"px",n.style.height=t.height+4+"px",n.style.display=mxClient.IS_QUIRKS?"inline":"inline-block"):((n=mxUtils.createImage(t.src)).style.width=t.width+"px",n.style.height=t.height+"px"),null!=e&&n.setAttribute("title",e),mxUtils.setOpacity(n,t==this.refreshTarget?30:20),n.style.position="absolute",n.style.cursor="crosshair",n}v.mouseDown=function(t){mxEvent.isPopupTrigger(t)||mxEvent.isMultiTouchEvent(t)||(i.stopEditing(),s.apply(this,arguments))};var E=null,S=null,w=null,b=!1,T=r(this.triangleUp,mxResources.get("connect")),A=r(this.triangleRight,mxResources.get("connect")),L=r(this.triangleDown,mxResources.get("connect")),I=r(this.triangleLeft,mxResources.get("connect")),M=r(this.refreshTarget,mxResources.get("replace")),R=null,P=r(this.roundDrop),O=r(this.roundDrop),U=mxConstants.DIRECTION_NORTH,N=null;function H(t,e,n,i){return null!=i.parentNode&&(mxUtils.contains(n,t,e)?(mxUtils.setOpacity(i,100),N=i):mxUtils.setOpacity(i,i==M?30:20)),n}var a=v.createPreviewElement;v.createPreviewElement=function(t){var e=a.apply(this,arguments);return mxClient.IS_SVG&&(e.style.pointerEvents="none"),this.previewElementWidth=e.style.width,this.previewElementHeight=e.style.height,e};var h=v.dragEnter;v.dragEnter=function(t,e){null!=n.hoverIcons&&n.hoverIcons.setDisplay("none"),h.apply(this,arguments)};var d=v.dragExit;v.dragExit=function(t,e){null!=n.hoverIcons&&n.hoverIcons.setDisplay(""),d.apply(this,arguments)},v.dragOver=function(t,e){var n,i,l,s,o,r,a,h,d;mxDragSource.prototype.dragOver.apply(this,arguments),null!=this.currentGuide&&null!=N&&this.currentGuide.hide(),null!=this.previewElement&&(n=t.view,null!=w&&N==M?(this.previewElement.style.display=t.model.isEdge(w.cell)?"none":"",this.previewElement.style.left=w.x+"px",this.previewElement.style.top=w.y+"px",this.previewElement.style.width=w.width+"px",this.previewElement.style.height=w.height+"px"):null!=E&&null!=N?(null!=v.currentHighlight&&null!=v.currentHighlight.state&&v.currentHighlight.hide(),i=t.model.isEdge(E.cell)||null==p?f:p,l=m.getDropAndConnectGeometry(E.cell,y[i],U,y),s=t.model.isEdge(E.cell)?null:t.getCellGeometry(E.cell),d=t.getCellGeometry(y[i]),o=t.model.getParent(E.cell),r=n.translate.x*n.scale,a=n.translate.y*n.scale,null!=s&&!s.relative&&t.model.isVertex(o)&&o!=n.currentRoot&&(r=(h=n.getState(o)).x,a=h.y),h=d.x,d=d.y,t.model.isEdge(y[i])&&(d=h=0),this.previewElement.style.left=(l.x-h)*n.scale+r+"px",this.previewElement.style.top=(l.y-d)*n.scale+a+"px",1==y.length&&(this.previewElement.style.width=l.width*n.scale+"px",this.previewElement.style.height=l.height*n.scale+"px"),this.previewElement.style.display=""):null!=v.currentHighlight.state&&t.model.isEdge(v.currentHighlight.state.cell)?(this.previewElement.style.left=Math.round(parseInt(this.previewElement.style.left)-u.width*n.scale/2)+"px",this.previewElement.style.top=Math.round(parseInt(this.previewElement.style.top)-u.height*n.scale/2)+"px"):(this.previewElement.style.width=this.previewElementWidth,this.previewElement.style.height=this.previewElementHeight,this.previewElement.style.display=""))};var _=(new Date).getTime(),D=0,G=null,k=this.editorUi.editor.graph.getCellStyle(y[0]);return v.getDropTarget=mxUtils.bind(this,function(i,t,e,n){var l=mxEvent.isAltDown(n)||null==y?null:i.getCellAt(t,e,null,null,null,function(t,e,n){return i.isContainer(t.cell)});null==l||this.graph.isCellConnectable(l)||this.graph.model.isEdge(l)||(o=this.graph.getModel().getParent(l),this.graph.getModel().isVertex(o)&&this.graph.isCellConnectable(o)&&(l=o)),i.isCellLocked(l)&&(l=null);var s=i.view.getState(l),o=N=null;G!=s?(_=(new Date).getTime(),D=0,G=s,null!=this.updateThread&&window.clearTimeout(this.updateThread),null!=s&&(this.updateThread=window.setTimeout(function(){null==N&&(G=s,v.getDropTarget(i,t,e,n))},this.dropTargetDelay+10))):D=(new Date).getTime()-_,C&&D<2500&&null!=s&&!mxEvent.isShiftDown(n)&&(mxUtils.getValue(s.style,mxConstants.STYLE_SHAPE)!=mxUtils.getValue(k,mxConstants.STYLE_SHAPE)&&(mxUtils.getValue(s.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE||mxUtils.getValue(s.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE)!=mxConstants.NONE||mxUtils.getValue(s.style,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.NONE)!=mxConstants.NONE)||"image"==mxUtils.getValue(k,mxConstants.STYLE_SHAPE)||1500<D||i.model.isEdge(s.cell))&&D>this.dropTargetDelay&&!this.isDropStyleTargetIgnored(s)&&(i.model.isVertex(s.cell)&&null!=f||i.model.isEdge(s.cell)&&i.model.isEdge(y[0]))?(w=s,r=new mxRectangle((r=i.model.isEdge(s.cell)?i.view.getPoint(s):new mxPoint(s.getCenterX(),s.getCenterY())).x-this.refreshTarget.width/2,r.y-this.refreshTarget.height/2,this.refreshTarget.width,this.refreshTarget.height),M.style.left=Math.floor(r.x)+"px",M.style.top=Math.floor(r.y)+"px",null==R&&(i.container.appendChild(M),R=M.parentNode),H(t,e,r,M)):null==w||!mxUtils.contains(w,t,e)||1500<D&&!mxEvent.isShiftDown(n)?(w=null)!=R&&(M.parentNode.removeChild(M),R=null):null!=w&&null!=R&&(r=new mxRectangle((r=i.model.isEdge(w.cell)?i.view.getPoint(w):new mxPoint(w.getCenterX(),w.getCenterY())).x-this.refreshTarget.width/2,r.y-this.refreshTarget.height/2,this.refreshTarget.width,this.refreshTarget.height),H(t,e,r,M)),b&&null!=E&&!mxEvent.isAltDown(n)&&null==N&&(o=mxRectangle.fromRectangle(E),i.model.isEdge(E.cell)?(d=E.absolutePoints,null!=P.parentNode&&(a=d[0],o.add(H(t,e,new mxRectangle(a.x-this.roundDrop.width/2,a.y-this.roundDrop.height/2,this.roundDrop.width,this.roundDrop.height),P))),null!=O.parentNode&&(h=d[d.length-1],o.add(H(t,e,new mxRectangle(h.x-this.roundDrop.width/2,h.y-this.roundDrop.height/2,this.roundDrop.width,this.roundDrop.height),O)))):(u=mxRectangle.fromRectangle(E),null!=E.shape&&null!=E.shape.boundingBox&&(u=mxRectangle.fromRectangle(E.shape.boundingBox)),u.grow(this.graph.tolerance),u.grow(HoverIcons.prototype.arrowSpacing),null!=(p=this.graph.selectionCellsHandler.getHandler(E.cell))&&(u.x-=p.horizontalOffset/2,u.y-=p.verticalOffset/2,u.width+=p.horizontalOffset,u.height+=p.verticalOffset,null!=p.rotationShape&&null!=p.rotationShape.node&&"hidden"!=p.rotationShape.node.style.visibility&&"none"!=p.rotationShape.node.style.display&&null!=p.rotationShape.boundingBox&&u.add(p.rotationShape.boundingBox)),o.add(H(t,e,new mxRectangle(E.getCenterX()-this.triangleUp.width/2,u.y-this.triangleUp.height,this.triangleUp.width,this.triangleUp.height),T)),o.add(H(t,e,new mxRectangle(u.x+u.width,E.getCenterY()-this.triangleRight.height/2,this.triangleRight.width,this.triangleRight.height),A)),o.add(H(t,e,new mxRectangle(E.getCenterX()-this.triangleDown.width/2,u.y+u.height,this.triangleDown.width,this.triangleDown.height),L)),o.add(H(t,e,new mxRectangle(u.x-this.triangleLeft.width,E.getCenterY()-this.triangleLeft.height/2,this.triangleLeft.width,this.triangleLeft.height),I))),null!=o&&o.grow(10)),U=mxConstants.DIRECTION_NORTH,N==A?U=mxConstants.DIRECTION_EAST:N==L||N==O?U=mxConstants.DIRECTION_SOUTH:N==I&&(U=mxConstants.DIRECTION_WEST),null!=w&&N==M&&(s=w);var r=(null==f||i.isCellConnectable(y[f]))&&(i.model.isEdge(l)&&null!=f||i.model.isVertex(l)&&i.isCellConnectable(l));if(null!=E&&5e3<=D||E!=s&&(null==o||!mxUtils.contains(o,t,e)||500<D&&null==N&&r))if(b=!1,null!=(E=D<5e3&&D>this.dropTargetDelay||i.model.isEdge(l)?s:null)&&r){for(var a,h,d,u,p,m=[P,O,T,A,L,I],c=0;c<m.length;c++)null!=m[c].parentNode&&m[c].parentNode.removeChild(m[c]);i.model.isEdge(l)?null!=(d=s.absolutePoints)&&(a=d[0],h=d[d.length-1],d=i.tolerance,new mxRectangle(t-d,e-d,2*d,2*d),P.style.left=Math.floor(a.x-this.roundDrop.width/2)+"px",P.style.top=Math.floor(a.y-this.roundDrop.height/2)+"px",O.style.left=Math.floor(h.x-this.roundDrop.width/2)+"px",O.style.top=Math.floor(h.y-this.roundDrop.height/2)+"px",null==i.model.getTerminal(l,!0)&&i.container.appendChild(P),null==i.model.getTerminal(l,!1)&&i.container.appendChild(O)):(u=mxRectangle.fromRectangle(s),null!=s.shape&&null!=s.shape.boundingBox&&(u=mxRectangle.fromRectangle(s.shape.boundingBox)),u.grow(this.graph.tolerance),u.grow(HoverIcons.prototype.arrowSpacing),null!=(p=this.graph.selectionCellsHandler.getHandler(s.cell))&&(u.x-=p.horizontalOffset/2,u.y-=p.verticalOffset/2,u.width+=p.horizontalOffset,u.height+=p.verticalOffset,null!=p.rotationShape&&null!=p.rotationShape.node&&"hidden"!=p.rotationShape.node.style.visibility&&"none"!=p.rotationShape.node.style.display&&null!=p.rotationShape.boundingBox&&u.add(p.rotationShape.boundingBox)),T.style.left=Math.floor(s.getCenterX()-this.triangleUp.width/2)+"px",T.style.top=Math.floor(u.y-this.triangleUp.height)+"px",A.style.left=Math.floor(u.x+u.width)+"px",A.style.top=Math.floor(s.getCenterY()-this.triangleRight.height/2)+"px",L.style.left=T.style.left,L.style.top=Math.floor(u.y+u.height)+"px",I.style.left=Math.floor(u.x-this.triangleLeft.width)+"px",I.style.top=A.style.top,"eastwest"!=s.style.portConstraint&&(i.container.appendChild(T),i.container.appendChild(L)),i.container.appendChild(A),i.container.appendChild(I)),null!=s&&null!=(S=i.selectionCellsHandler.getHandler(s.cell))&&null!=S.setHandlesVisible&&S.setHandlesVisible(!1),b=!0}else for(m=[P,O,T,A,L,I],c=0;c<m.length;c++)null!=m[c].parentNode&&m[c].parentNode.removeChild(m[c]);b||null==S||S.setHandlesVisible(!0);var g=mxEvent.isAltDown(n)&&!mxEvent.isShiftDown(n)||null!=w&&N==M?null:mxDragSource.prototype.getDropTarget.apply(this,arguments),x=i.getModel();if(null!=g&&(null!=N||!i.isSplitTarget(g,y,n))){for(;null!=g&&!i.isValidDropTarget(g,y,n)&&x.isVertex(x.getParent(g));)g=x.getParent(g);null!=g&&(i.view.currentRoot==g||!i.isValidRoot(g)&&0==i.getModel().getChildCount(g)||i.isCellLocked(g)||x.isEdge(g)||!i.isValidDropTarget(g,y,n))&&(g=null)}return g}),v.stopDrag=function(){mxDragSource.prototype.stopDrag.apply(this,arguments);for(var t=[P,O,M,T,A,L,I],e=0;e<t.length;e++)null!=t[e].parentNode&&t[e].parentNode.removeChild(t[e]);null!=E&&null!=S&&S.reset(),N=R=w=E=S=null},v},Sidebar.prototype.itemClicked=function(t,e,n,i){var l,s=this.editorUi.editor.graph;if(s.container.focus(),mxEvent.isAltDown(n)&&1==s.getSelectionCount()&&s.model.isVertex(s.getSelectionCell())){for(var o=null,r=0;r<t.length&&null==o;r++)s.model.isVertex(t[r])&&(o=r);null!=o&&(s.setSelectionCells(this.dropAndConnect(s.getSelectionCell(),t,mxEvent.isMetaDown(n)||mxEvent.isControlDown(n)?mxEvent.isShiftDown(n)?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH:mxEvent.isShiftDown(n)?mxConstants.DIRECTION_EAST:mxConstants.DIRECTION_SOUTH,o,n)),s.scrollCellToVisible(s.getSelectionCell()))}else mxEvent.isShiftDown(n)&&!s.isSelectionEmpty()?(this.updateShapes(t[0],s.getSelectionCells()),s.scrollCellToVisible(s.getSelectionCell())):(l=mxEvent.isAltDown(n)?s.getFreeInsertPoint():s.getCenterInsertPoint(s.getBoundingBoxFromGeometry(t,!0)),e.drop(s,n,null,l.x,l.y,!0))},Sidebar.prototype.addClickHandler=function(e,n,i){var t=this.editorUi.editor.graph,l=n.mouseDown,s=n.mouseMove,o=n.mouseUp,r=t.tolerance,a=null,h=this;n.mouseDown=function(t){l.apply(this,arguments),a=new mxPoint(mxEvent.getClientX(t),mxEvent.getClientY(t)),null!=this.dragElement&&(this.dragElement.style.display="none",mxUtils.setOpacity(e,50))},n.mouseMove=function(t){null!=this.dragElement&&"none"==this.dragElement.style.display&&null!=a&&(Math.abs(a.x-mxEvent.getClientX(t))>r||Math.abs(a.y-mxEvent.getClientY(t))>r)&&(this.dragElement.style.display="",mxUtils.setOpacity(e,100)),s.apply(this,arguments)},n.mouseUp=function(t){try{mxEvent.isPopupTrigger(t)||null!=this.currentGraph||null==this.dragElement||"none"!=this.dragElement.style.display||h.itemClicked(i,n,t,e),o.apply(n,arguments),mxUtils.setOpacity(e,100),a=null,h.currentElt=e}catch(t){n.reset(),h.editorUi.handleError(t)}}},Sidebar.prototype.createVertexTemplateEntry=function(t,e,n,i,l,s,o,r){return r=null!=r&&0<r.length?r:null!=l?l.toLowerCase():"",this.addEntry(r,mxUtils.bind(this,function(){return this.createVertexTemplate(t,e,n,i,l,s,o)}))},Sidebar.prototype.createVertexTemplate=function(t,e,n,i,l,s,o,r){t=[new mxCell(null!=i?i:"",new mxGeometry(0,0,e,n),t)];return t[0].vertex=!0,this.createVertexTemplateFromCells(t,e,n,l,s,o,r)},Sidebar.prototype.createVertexTemplateFromData=function(t,e,n,i,l,s,o){var r=mxUtils.parseXml(Graph.decompress(t)),a=new mxCodec(r),t=new mxGraphModel;a.decode(r.documentElement,t);t=this.graph.cloneCells(t.root.getChildAt(0).children);return this.createVertexTemplateFromCells(t,e,n,i,l,s,o)},Sidebar.prototype.createVertexTemplateFromCells=function(t,e,n,i,l,s,o){return this.createItem(t,i,l,s,e,n,o)},Sidebar.prototype.createEdgeTemplateEntry=function(t,e,n,i,l,s,o,r){return o=null!=o&&0<o.length?o:l.toLowerCase(),this.addEntry(o,mxUtils.bind(this,function(){return this.createEdgeTemplate(t,e,n,i,l,s,r)}))},Sidebar.prototype.createEdgeTemplate=function(t,e,n,i,l,s,o){t=new mxCell(null!=i?i:"",new mxGeometry(0,0,e,n),t);return t.geometry.setTerminalPoint(new mxPoint(0,n),!0),t.geometry.setTerminalPoint(new mxPoint(e,0),!1),t.geometry.relative=!0,t.edge=!0,this.createEdgeTemplateFromCells([t],e,n,l,s,o)},Sidebar.prototype.createEdgeTemplateFromCells=function(t,e,n,i,l,s){return this.createItem(t,i,l,!0,e,n,s)},Sidebar.prototype.addPaletteFunctions=function(t,e,n,i){this.addPalette(t,e,n,mxUtils.bind(this,function(t){for(var e=0;e<i.length;e++)t.appendChild(i[e](t))}))},Sidebar.prototype.addPalette=function(t,e,n,i){var l=this.createTitle(e);this.container.appendChild(l);e=document.createElement("div");e.className="geSidebar",mxClient.IS_POINTER&&(e.style.touchAction="none"),n?(i(e),i=null):e.style.display="none",this.addFoldingHandler(l,e,i);i=document.createElement("div");return i.appendChild(e),this.container.appendChild(i),null!=t&&(this.palettes[t]=[l,i]),e},Sidebar.prototype.addFoldingHandler=function(n,i,l){var s=!1;(!mxClient.IS_IE||8<=document.documentMode)&&(n.style.backgroundImage="none"==i.style.display?"url('"+this.collapsedImage+"')":"url('"+this.expandedImage+"')"),n.style.backgroundRepeat="no-repeat",n.style.backgroundPosition="0% 50%",mxEvent.addListener(n,"click",mxUtils.bind(this,function(t){var e;"none"==i.style.display?(s?i.style.display="block":(s=!0,null!=l?(n.style.cursor="wait",e=n.innerHTML,n.innerHTML=mxResources.get("loading")+"...",window.setTimeout(function(){i.style.display="block",n.style.cursor="",n.innerHTML=e;var t=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject,l(i,n),mxClient.NO_FO=t},mxClient.IS_FF?20:0)):i.style.display="block"),n.style.backgroundImage="url('"+this.expandedImage+"')"):(n.style.backgroundImage="url('"+this.collapsedImage+"')",i.style.display="none"),mxEvent.consume(t)})),mxClient.IS_QUIRKS||mxEvent.addListener(n,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(t){t.preventDefault()}))},Sidebar.prototype.removePalette=function(t){var e=this.palettes[t];if(null==e)return!1;this.palettes[t]=null;for(var n=0;n<e.length;n++)this.container.removeChild(e[n]);return!0},Sidebar.prototype.addImagePalette=function(t,e,s,o,n,i,l){for(var r=[],a=0;a<n.length;a++)mxUtils.bind(this,function(t,e,n){var i,l;null==n&&(i=t.lastIndexOf("/"),l=t.lastIndexOf("."),n=t.substring(0<=i?i+1:0,0<=l?l:t.length).replace(/[-_]/g," ")),r.push(this.createVertexTemplateEntry("image;html=1;image="+s+t+o,this.defaultImageWidth,this.defaultImageHeight,"",e,null!=e,null,this.filterTags(n)))})(n[a],null!=i?i[a]:null,null!=l?l[n[a]]:null);this.addPaletteFunctions(t,e,!1,r)},Sidebar.prototype.getTagsForStencil=function(t,e,n){for(var i=t.split("."),l=1;l<i.length;l++)i[l]=i[l].replace(/_/g," ");return i.push(e.replace(/_/g," ")),null!=n&&i.push(n),i.slice(1,i.length)},Sidebar.prototype.addStencilPalette=function(t,e,n,r,a,i,h,d,l,s){if(h=null!=h?h:1,this.addStencilsToIndex){var u=[];if(null!=l)for(var o=0;o<l.length;o++)u.push(l[o]);mxStencilRegistry.loadStencilSet(n,mxUtils.bind(this,function(t,e,n,i,l){var s,o;(null==a||mxUtils.indexOf(a,e)<0)&&(s=this.getTagsForStencil(t,e),null!=(o=null!=d?d[e]:null)&&s.push(o),u.push(this.createVertexTemplateEntry("shape="+t+e.toLowerCase()+r,Math.round(i*h),Math.round(l*h),"",e.replace(/_/g," "),null,null,this.filterTags(s.join(" ")))))}),!0,!0),this.addPaletteFunctions(t,e,!1,u)}else this.addPalette(t,e,!1,mxUtils.bind(this,function(s){if(null==r&&(r=""),null!=i&&i.call(this,s),null!=l)for(var t=0;t<l.length;t++)l[t](s);mxStencilRegistry.loadStencilSet(n,mxUtils.bind(this,function(t,e,n,i,l){(null==a||mxUtils.indexOf(a,e)<0)&&s.appendChild(this.createVertexTemplate("shape="+t+e.toLowerCase()+r,Math.round(i*h),Math.round(l*h),"",e.replace(/_/g," "),!0))}),!0)}))},Sidebar.prototype.destroy=function(){null!=this.graph&&(null!=this.graph.container&&null!=this.graph.container.parentNode&&this.graph.container.parentNode.removeChild(this.graph.container),this.graph.destroy(),this.graph=null),null!=this.pointerUpHandler&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointerup":"mouseup",this.pointerUpHandler),this.pointerUpHandler=null),null!=this.pointerDownHandler&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointerdown":"mousedown",this.pointerDownHandler),this.pointerDownHandler=null),null!=this.pointerMoveHandler&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.pointerMoveHandler),this.pointerMoveHandler=null),null!=this.pointerOutHandler&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointerout":"mouseout",this.pointerOutHandler),this.pointerOutHandler=null)},"undefined"!=typeof html4&&(html4.ATTRIBS["a::target"]=0,html4.ATTRIBS["source::src"]=0,html4.ATTRIBS["video::src"]=0),function(){var n=[["nbsp","160"],["shy","173"]],i=mxUtils.parseXml;mxUtils.parseXml=function(t){for(var e=0;e<n.length;e++)t=t.replace(new RegExp("&"+n[e][0]+";","g"),"&#"+n[e][1]+";");return i(t)}}(),Date.prototype.toISOString||function(){function t(t){t=String(t);return 1===t.length&&(t="0"+t),t}Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+t(this.getUTCMonth()+1)+"-"+t(this.getUTCDate())+"T"+t(this.getUTCHours())+":"+t(this.getUTCMinutes())+":"+t(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}}(),Date.now||(Date.now=function(){return(new Date).getTime()}),mxConstants.POINTS=1,mxConstants.MILLIMETERS=2,mxConstants.INCHES=3,mxConstants.PIXELS_PER_MM=3.937,mxConstants.PIXELS_PER_INCH=100,mxConstants.SHADOW_OPACITY=.25,mxConstants.SHADOWCOLOR="#000000",mxConstants.VML_SHADOWCOLOR="#d0d0d0",mxGraph.prototype.pageBreakColor="#c0c0c0",mxGraph.prototype.pageScale=1,function(){try{var t;null!=navigator&&null!=navigator.language&&(t=navigator.language.toLowerCase(),mxGraph.prototype.pageFormat="en-us"===t||"en-ca"===t||"es-mx"===t?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT)}catch(t){}}(),mxText.prototype.baseSpacingTop=5,mxText.prototype.baseSpacingBottom=1,mxGraphModel.prototype.ignoreRelativeEdgeParent=!1,mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=":IMAGE_PATH+"/grid.gif",mxGraphView.prototype.gridSteps=4,mxGraphView.prototype.minGridSize=4,mxGraphView.prototype.defaultGridColor="#d0d0d0",mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultGridColor,mxGraphView.prototype.unit=mxConstants.POINTS,mxGraphView.prototype.setUnit=function(t){this.unit!=t&&(this.unit=t,this.fireEvent(new mxEventObject("unitChanged","unit",t)))},mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]",mxShape.prototype.getConstraints=function(t,e,n){return null},window.Graph=function(t,e,n,i,l,s){mxGraph.call(this,t,e,n,i),this.themes=l||this.defaultThemes,this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle),this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle),this.standalone=null!=s&&s;var x,u,o,r,a,h,d,p,m,c,g,y,f,C,v,E,S,w,l=this.baseUrl,s=l.indexOf("//");this.domainUrl="",this.domainPathUrl="",0<s&&(0<(s=l.indexOf("/",s+2))&&(this.domainUrl=l.substring(0,s)),0<(s=l.lastIndexOf("/"))&&(this.domainPathUrl=l.substring(0,s+1))),this.isHtmlLabel=function(t){t=this.getCurrentCellStyle(t);return null!=t&&("1"==t.html||"wrap"==t[mxConstants.STYLE_WHITE_SPACE])},this.edgeMode&&(x={point:null,event:null,state:null,handle:null,selected:!1},this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(t,e){if("mouseDown"==e.getProperty("eventName")&&this.isEnabled()){var n,i=e.getProperty("event"),l=i.getState();if(!mxEvent.isAltDown(i.getEvent())&&null!=l)if(this.model.isEdge(l.cell))x.point=new mxPoint(i.getGraphX(),i.getGraphY()),x.selected=this.isCellSelected(l.cell),x.state=l,x.event=i,null!=l.text&&null!=l.text.boundingBox&&mxUtils.contains(l.text.boundingBox,i.getGraphX(),i.getGraphY())?x.handle=mxEvent.LABEL_HANDLE:null!=(n=this.selectionCellsHandler.getHandler(l.cell))&&null!=n.bends&&0<n.bends.length&&(x.handle=n.getHandleForEvent(i));else if(!this.panningHandler.isActive()&&!mxEvent.isControlDown(i.getEvent()))if(null==(n=this.selectionCellsHandler.getHandler(l.cell))||null==n.getHandleForEvent(i)){var s,o=new mxRectangle(i.getGraphX()-1,i.getGraphY()-1);o.grow(mxEvent.isTouchEvent(i.getEvent())?mxShape.prototype.svgStrokeTolerance-1:(mxShape.prototype.svgStrokeTolerance+1)/2),this.isTableCell(l.cell)&&!this.isCellSelected(l.cell)&&(s=this.model.getParent(l.cell),e=this.model.getParent(s),this.isCellSelected(e)||(mxUtils.intersects(o,new mxRectangle(l.x,l.y-2,l.width,3))&&this.model.getChildAt(e,0)!=s||mxUtils.intersects(o,new mxRectangle(l.x,l.y+l.height-2,l.width,3))||mxUtils.intersects(o,new mxRectangle(l.x-2,l.y,2,l.height))&&this.model.getChildAt(s,0)!=l.cell||mxUtils.intersects(o,new mxRectangle(l.x+l.width-2,l.y,2,l.height)))&&(s=this.selectionCellsHandler.isHandled(e),this.selectCellForEvent(e,i.getEvent()),null!=(n=this.selectionCellsHandler.getHandler(e))&&null!=(h=n.getHandleForEvent(i))&&(n.start(i.getGraphX(),i.getGraphY(),h),n.blockDelayedSelection=!s,i.consume())));for(var r,a,h,d=l;!i.isConsumed()&&null!=d&&(this.isTableCell(d.cell)||this.isTableRow(d.cell)||this.isTable(d.cell));)this.isSwimlane(d.cell)&&(r=this.getActualStartSize(d.cell),a=this.view.scale,((0<r.x||0<r.width)&&mxUtils.intersects(o,new mxRectangle(d.x+(r.x-r.width-1)*a+(0==r.x?d.width:0),d.y,1,d.height))||(0<r.y||0<r.height)&&mxUtils.intersects(o,new mxRectangle(d.x,d.y+(r.y-r.height-1)*a+(0==r.y?d.height:0),d.width,1)))&&(this.selectCellForEvent(d.cell,i.getEvent()),null!=(n=this.selectionCellsHandler.getHandler(d.cell))&&(h=mxEvent.CUSTOM_HANDLE-n.customHandles.length+1,n.start(i.getGraphX(),i.getGraphY(),h),i.consume()))),d=this.view.getState(this.model.getParent(d.cell))}}})),this.addMouseListener({mouseDown:function(t,e){},mouseMove:mxUtils.bind(this,function(t,e){var n,i=this.selectionCellsHandler.handlers.map;for(n in i)if(null!=i[n].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(e.getEvent())){var l=this.tolerance;if(null!=x.point&&null!=x.state&&null!=x.event){var s,o,r,a=x.state;(Math.abs(x.point.x-e.getGraphX())>l||Math.abs(x.point.y-e.getGraphY())>l)&&(null==(s=this.selectionCellsHandler.getHandler(a.cell))&&this.model.isEdge(a.cell)&&(s=this.createHandler(a)),null!=s&&null!=s.bends&&0<s.bends.length&&(r=s.getHandleForEvent(x.event),l=(o=this.view.getEdgeStyle(a))==mxEdgeStyle.EntityRelation,x.selected||x.handle!=mxEvent.LABEL_HANDLE||(r=x.handle),l&&0!=r&&r!=s.bends.length-1&&r!=mxEvent.LABEL_HANDLE?!l||null==a.visibleSourceState&&null==a.visibleTargetState||(this.graphHandler.reset(),e.consume()):r!=mxEvent.LABEL_HANDLE&&0!=r&&null==a.visibleSourceState&&r!=s.bends.length-1&&null==a.visibleTargetState||(l||r==mxEvent.LABEL_HANDLE||(null!=(h=a.absolutePoints)&&(null==o&&null==r||o==mxEdgeStyle.OrthConnector)&&null==(r=x.handle)&&((d=new mxRectangle(x.point.x,x.point.y)).grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(d,h[0].x,h[0].y)?r=0:mxUtils.contains(d,h[h.length-1].x,h[h.length-1].y)?r=s.bends.length-1:null!=o&&(2==h.length||3==h.length&&(0==Math.round(h[0].x-h[1].x)&&0==Math.round(h[1].x-h[2].x)||0==Math.round(h[0].y-h[1].y)&&0==Math.round(h[1].y-h[2].y)))?r=2:(r=mxUtils.findNearestSegment(a,x.point.x,x.point.y),null==o?r=mxEvent.VIRTUAL_HANDLE-r:r+=1)),null==r&&(r=mxEvent.VIRTUAL_HANDLE)),s.start(e.getGraphX(),e.getGraphX(),r),e.consume(),this.graphHandler.reset())),null!=s&&(this.selectionCellsHandler.isHandlerActive(s)?this.isCellSelected(a.cell)||(this.selectionCellsHandler.handlers.put(a.cell,s),this.selectCellForEvent(a.cell,e.getEvent())):this.isCellSelected(a.cell)||s.destroy()),x.selected=!1,x.handle=null,x.state=null,x.event=null,x.point=null)}else if(null!=(a=e.getState())){var h,d,u,p=null;if(this.model.isEdge(a.cell))(d=new mxRectangle(e.getGraphX(),e.getGraphY())).grow(mxEdgeHandler.prototype.handleImage.width/2),null!=(h=a.absolutePoints)&&(null!=a.text&&null!=a.text.boundingBox&&mxUtils.contains(a.text.boundingBox,e.getGraphX(),e.getGraphY())?p="move":mxUtils.contains(d,h[0].x,h[0].y)||mxUtils.contains(d,h[h.length-1].x,h[h.length-1].y)?p="pointer":null==a.visibleSourceState&&null==a.visibleTargetState||(p="crosshair",this.view.getEdgeStyle(a)==mxEdgeStyle.EntityRelation||!this.isOrthogonal(a)||(u=mxUtils.findNearestSegment(a,e.getGraphX(),e.getGraphY()))<h.length-1&&0<=u&&(p=0==Math.round(h[u].x-h[u+1].x)?"col-resize":"row-resize")));else if(!mxEvent.isControlDown(e.getEvent())){(d=new mxRectangle(e.getGraphX()-1,e.getGraphY()-1)).grow(mxShape.prototype.svgStrokeTolerance/2),this.isTableCell(a.cell)&&(u=this.model.getParent(a.cell),e=this.model.getParent(u),this.isCellSelected(e)||(mxUtils.intersects(d,new mxRectangle(a.x-2,a.y,2,a.height))&&this.model.getChildAt(u,0)!=a.cell||mxUtils.intersects(d,new mxRectangle(a.x+a.width-2,a.y,2,a.height))?p="col-resize":(mxUtils.intersects(d,new mxRectangle(a.x,a.y-2,a.width,3))&&this.model.getChildAt(e,0)!=u||mxUtils.intersects(d,new mxRectangle(a.x,a.y+a.height-2,a.width,3)))&&(p="row-resize")));for(var m,c,g=a;null==p&&null!=g&&(this.isTableCell(g.cell)||this.isTableRow(g.cell)||this.isTable(g.cell));)this.isSwimlane(g.cell)&&(m=this.getActualStartSize(g.cell),c=this.view.scale,(0<m.x||0<m.width)&&mxUtils.intersects(d,new mxRectangle(g.x+(m.x-m.width-1)*c+(0==m.x?g.width*c:0),g.y,1,g.height))?p="col-resize":(0<m.y||0<m.height)&&mxUtils.intersects(d,new mxRectangle(g.x,g.y+(m.y-m.height-1)*c+(0==m.y?g.height:0),g.width,1))&&(p="row-resize")),g=this.view.getState(this.model.getParent(g.cell))}null!=p&&a.setCursor(p)}}}),mouseUp:mxUtils.bind(this,function(t,e){x.state=null,x.event=null,x.point=null,x.handle=null})})),this.cellRenderer.getLabelValue=function(t){var e=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);return t.view.graph.isHtmlLabel(t.cell)&&(e=1!=t.style.html?mxUtils.htmlEntities(e,!1):t.view.graph.sanitizeHtml(e)),e},void 0!==mxVertexHandler&&(this.setConnectable(!0),this.setDropEnabled(!0),this.setPanning(!0),this.setTooltips(!0),this.setAllowLoops(!0),this.allowAutoPanning=!0,this.resetEdgesOnConnect=!1,this.constrainChildren=!1,this.constrainRelativeChildren=!0,this.graphHandler.scrollOnMove=!1,this.graphHandler.scaleGrid=!0,this.connectionHandler.setCreateTarget(!1),this.connectionHandler.insertBeforeSource=!0,this.connectionHandler.isValidSource=function(t,e){return!1},this.alternateEdgeStyle="vertical",null==i&&this.loadStylesheet(),u=this.graphHandler.getGuideStates,this.graphHandler.getGuideStates=function(){var t=u.apply(this,arguments);if(this.graph.pageVisible){for(var e=[],n=this.graph.pageFormat,i=this.graph.pageScale,l=n.width*i,s=n.height*i,o=this.graph.view.translate,r=this.graph.view.scale,a=this.graph.getPageLayout(),h=0;h<a.width;h++)e.push(new mxRectangle(((a.x+h)*l+o.x)*r,(a.y*s+o.y)*r,l*r,s*r));for(var d=1;d<a.height;d++)e.push(new mxRectangle((a.x*l+o.x)*r,((a.y+d)*s+o.y)*r,l*r,s*r));t=e.concat(t)}return t},mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex,mxGuide.prototype.getGuideColor=function(t,e){return null==t.cell?"#ffa500":mxConstants.GUIDE_COLOR},this.graphHandler.createPreviewShape=function(t){return this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor,mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)},o=this.graphHandler.getCells,this.graphHandler.getCells=function(t){for(var e=o.apply(this,arguments),n=new mxDictionary,i=[],l=0;l<e.length;l++){var s=this.graph.isTableCell(t)&&this.graph.isTableCell(e[l])&&this.graph.isCellSelected(e[l])?this.graph.model.getParent(e[l]):this.graph.isTableRow(t)&&this.graph.isTableRow(e[l])&&this.graph.isCellSelected(e[l])?e[l]:this.graph.getCompositeParent(e[l]);null==s||n.get(s)||(n.put(s,!0),i.push(s))}return i},r=this.graphHandler.start,this.graphHandler.start=function(t,e,n,i){var l=!1;this.graph.isTableCell(t)&&(this.graph.isCellSelected(t)?l=!0:t=this.graph.model.getParent(t)),l||this.graph.isTableRow(t)&&this.graph.isCellSelected(t)||(t=this.graph.getCompositeParent(t)),r.apply(this,arguments)},this.connectionHandler.createTargetVertex=function(t,e){return e=this.graph.getCompositeParent(e),mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)},a=new mxRubberband(this),this.getRubberband=function(){return a},h=(new Date).getTime(),d=0,p=this.connectionHandler.mouseMove,this.connectionHandler.mouseMove=function(){var t=this.currentState;p.apply(this,arguments),d=t!=this.currentState?(h=(new Date).getTime(),0):(new Date).getTime()-h},m=this.connectionHandler.isOutlineConnectEvent,this.connectionHandler.isOutlineConnectEvent=function(t){return null!=this.currentState&&t.getState()==this.currentState&&2e3<d||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&m.apply(this,arguments)},c=this.isToggleEvent,this.isToggleEvent=function(t){return c.apply(this,arguments)||!mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(t)},g=a.isForceRubberbandEvent,a.isForceRubberbandEvent=function(t){return g.apply(this,arguments)&&!mxEvent.isShiftDown(t.getEvent())&&!mxEvent.isControlDown(t.getEvent())||mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(t.getEvent())||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==t.getState()&&mxEvent.isTouchEvent(t.getEvent())},y=null,this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(y=this.container.style.cursor,this.container.style.cursor="move")})),this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=y)})),this.popupMenuHandler.autoExpand=!0,this.popupMenuHandler.isSelectOnPopup=function(t){return mxEvent.isMouseEvent(t.getEvent())},f=this.click,this.click=function(t){var e=null==t.state&&null!=t.sourceState&&this.isCellLocked(t.sourceState.cell);if(this.isEnabled()&&!e||t.isConsumed())return f.apply(this,arguments);var n=e?t.sourceState.cell:t.getCell();null==n||null!=(n=this.getClickableLinkForCell(n))&&(this.isCustomLink(n)?this.customLinkClicked(n):this.openLink(n)),this.isEnabled()&&e&&this.clearSelection()},this.tooltipHandler.getStateForEvent=function(t){return t.sourceState},C=this.tooltipHandler.show,this.tooltipHandler.show=function(){if(C.apply(this,arguments),null!=this.div)for(var t=this.div.getElementsByTagName("a"),e=0;e<t.length;e++)null!=t[e].getAttribute("href")&&null==t[e].getAttribute("target")&&t[e].setAttribute("target","_blank")},this.tooltipHandler.getStateForEvent=function(t){return t.sourceState},this.getCursorForMouseEvent,this.getCursorForMouseEvent=function(t){var e=null==t.state&&null!=t.sourceState&&this.isCellLocked(t.sourceState.cell);return this.getCursorForCell(e?t.sourceState.cell:t.getCell())},v=this.getCursorForCell,this.getCursorForCell=function(t){if(!this.isEnabled()||this.isCellLocked(t)){if(null!=this.getClickableLinkForCell(t))return"pointer";if(this.isCellLocked(t))return"default"}return v.apply(this,arguments)},this.selectRegion=function(t,e){t=this.getCells(t.x,t.y,t.width,t.height,null,null,null,function(t){return"1"==mxUtils.getValue(t.style,"locked","0")},!0);return this.selectCellsForEvent(t,e),t},E=this.graphHandler.shouldRemoveCellsFromParent,this.graphHandler.shouldRemoveCellsFromParent=function(t,e,n){return!this.graph.isCellSelected(t)&&E.apply(this,arguments)},this.isCellLocked=function(t){for(var e=this.view.getState(t);null!=e;){if("1"==mxUtils.getValue(e.style,"locked","0"))return!0;e=this.view.getState(this.model.getParent(e.cell))}return!1},S=null,this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(t,e){"mouseDown"==e.getProperty("eventName")&&(e=e.getProperty("event").getState(),S=null==e||this.isSelectionEmpty()||this.isCellSelected(e.cell)?null:this.getSelectionCells())})),this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(t,e){var n,i;mxEvent.isMultiTouchEvent(e)||(i=e.getProperty("event"),null==(n=e.getProperty("cell"))?(i=mxUtils.convertPoint(this.container,mxEvent.getClientX(i),mxEvent.getClientY(i)),a.start(i.x,i.y)):null!=S?this.addSelectionCells(S):1<this.getSelectionCount()&&this.isCellSelected(n)&&this.removeSelectionCell(n),S=null,e.consume())})),this.connectionHandler.selectCells=function(t,e){this.graph.setSelectionCell(e||t)},this.connectionHandler.constraintHandler.isStateIgnored=function(t,e){var n=t.view.graph;return e&&(n.isCellSelected(t.cell)||n.isTableRow(t.cell)&&n.selectionCellsHandler.isHandled(n.model.getParent(t.cell)))},this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var t=this.connectionHandler.constraintHandler;null!=t.currentFocus&&t.isStateIgnored(t.currentFocus,!0)&&(t.currentFocus=null,t.constraints=null,t.destroyIcons()),t.destroyFocusHighlight()})),Graph.touchStyle&&this.initTouch(),w=this.updateMouseEvent,this.updateMouseEvent=function(t){return null!=(t=w.apply(this,arguments)).state&&this.isCellLocked(t.getCell())&&(t.state=null),t}),this.currentTranslate=new mxPoint(0,0)},Graph.touchStyle=mxClient.IS_TOUCH||mxClient.IS_FF&&mxClient.IS_WIN||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints||null==window.urlParams||"1"==urlParams.touch,Graph.fileSupport=null!=window.File&&null!=window.FileReader&&null!=window.FileList&&(null==window.urlParams||"0"!=urlParams.filesupport),Graph.translateDiagram="1"==urlParams["translate-diagram"],Graph.diagramLanguage=null!=urlParams["diagram-language"]?urlParams["diagram-language"]:mxClient.language,Graph.lineJumpsEnabled=!0,Graph.defaultJumpSize=6,Graph.minTableColumnWidth=20,Graph.minTableRowHeight=20,Graph.foreignObjectWarningText="Viewer does not support full SVG 1.1",Graph.foreignObjectWarningLink="https://desk.draw.io/support/solutions/articles/16000042487",Graph.pasteStyles=["rounded","shadow","dashed","dashPattern","fontFamily","fontSource","fontSize","fontColor","fontStyle","align","verticalAlign","strokeColor","strokeWidth","fillColor","gradientColor","swimlaneFillColor","textOpacity","gradientDirection","glass","labelBackgroundColor","labelBorderColor","opacity","spacing","spacingTop","spacingLeft","spacingBottom","spacingRight","endFill","endArrow","endSize","targetPerimeterSpacing","startFill","startArrow","startSize","sourcePerimeterSpacing","arcSize","comic","sketch","fillWeight","hachureGap","hachureAngle","jiggle","disableMultiStroke","disableMultiStrokeFill","fillStyle","curveFitting","simplification","comicStyle"],Graph.createSvgImage=function(t,e,n,i,l){n=unescape(encodeURIComponent('<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+t+'px" height="'+e+'px" '+(null!=i&&null!=l?'viewBox="0 0 '+i+" "+l+'" ':"")+'version="1.1">'+n+"</svg>"));return new mxImage("data:image/svg+xml;base64,"+(window.btoa?btoa(n):Base64.encode(n,!0)),t,e)},Graph.zapGremlins=function(t){for(var e=0,n=[],i=0;i<t.length;i++){var l=t.charCodeAt(i);(32<=l||9==l||10==l||13==l)&&65535!=l&&65534!=l||(n.push(t.substring(e,i)),e=i+1)}return 0<e&&e<t.length&&n.push(t.substring(e)),0==n.length?t:n.join("")},Graph.stringToBytes=function(t){for(var e=new Array(t.length),n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e},Graph.bytesToString=function(t){for(var e=new Array(t.length),n=0;n<t.length;n++)e[n]=String.fromCharCode(t[n]);return e.join("")},Graph.base64EncodeUnicode=function(t){return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(t,e){return String.fromCharCode(parseInt(e,16))}))},Graph.base64DecodeUnicode=function(t){return decodeURIComponent(Array.prototype.map.call(atob(t),function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(""))},Graph.compressNode=function(t,e){t=mxUtils.getXml(t);return Graph.compress(e?t:Graph.zapGremlins(t))},Graph.compress=function(t,e){if(null==t||0==t.length||"undefined"==typeof pako)return t;t=e?pako.deflate(encodeURIComponent(t),{to:"string"}):pako.deflateRaw(encodeURIComponent(t),{to:"string"});return window.btoa?btoa(t):Base64.encode(t,!0)},Graph.decompress=function(t,e,n){if(null==t||0==t.length||"undefined"==typeof pako)return t;t=window.atob?atob(t):Base64.decode(t,!0),t=decodeURIComponent(e?pako.inflate(t,{to:"string"}):pako.inflateRaw(t,{to:"string"}));return n?t:Graph.zapGremlins(t)},Graph.removePasteFormatting=function(t){for(;null!=t;)null!=t.firstChild&&Graph.removePasteFormatting(t.firstChild),t.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=t.style&&(t.style.whiteSpace="","#000000"==t.style.color&&(t.style.color="")),t=t.nextSibling},Graph.sanitizeHtml=function(t,e){return html_sanitize(t,function(t){return null!=t&&"javascript:"!==t.toString().toLowerCase().substring(0,11)?t:null},function(t){return t})},Graph.stripQuotes=function(t){return null!=t&&("'"==t.charAt(0)&&(t=t.substring(1)),"'"==t.charAt(t.length-1)&&(t=t.substring(0,t.length-1)),'"'==t.charAt(0)&&(t=t.substring(1)),'"'==t.charAt(t.length-1)&&(t=t.substring(0,t.length-1))),t},Graph.isLink=function(t){return null!=t&&Graph.linkPattern.test(t)},Graph.linkPattern=new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i"),mxUtils.extend(Graph,mxGraph),Graph.prototype.minFitScale=null,Graph.prototype.maxFitScale=null,Graph.prototype.linkPolicy="frame"==urlParams.target?"blank":urlParams.target||"auto",Graph.prototype.linkTarget="frame"==urlParams.target?"_self":"_blank",Graph.prototype.linkRelation="nofollow noopener noreferrer",Graph.prototype.defaultScrollbars=!mxClient.IS_IOS,Graph.prototype.defaultPageVisible=!0,Graph.prototype.lightbox=!1,Graph.prototype.defaultPageBackgroundColor="#ffffff",Graph.prototype.defaultPageBorderColor="#ffffff",Graph.prototype.scrollTileSize=new mxRectangle(0,0,400,400),Graph.prototype.transparentBackground=!0,Graph.prototype.selectParentAfterDelete=!1,Graph.prototype.defaultEdgeLength=80,Graph.prototype.edgeMode=!1,Graph.prototype.connectionArrowsEnabled=!0,Graph.prototype.placeholderPattern=new RegExp("%(date{.*}|[^%^{^}]+)%","g"),Graph.prototype.absoluteUrlPattern=new RegExp("^(?:[a-z]+:)?//","i"),Graph.prototype.defaultThemeName="default",Graph.prototype.defaultThemes={},Graph.prototype.baseUrl=null!=urlParams.base?decodeURIComponent(urlParams.base):(window!=window.top?document.referrer:document.location.toString()).split("#")[0],Graph.prototype.editAfterInsert=!1,Graph.prototype.builtInProperties=["label","tooltip","placeholders","placeholder"],Graph.prototype.standalone=!1,Graph.prototype.init=function(t){mxGraph.prototype.init.apply(this,arguments),this.cellRenderer.initializeLabel=function(n,i){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var e=n.view.graph.tolerance,l=!0,s=null,t=mxUtils.bind(this,function(t){l=!0,s=new mxPoint(mxEvent.getClientX(t),mxEvent.getClientY(t))}),o=mxUtils.bind(this,function(t){l=l&&null!=s&&Math.abs(s.x-mxEvent.getClientX(t))<e&&Math.abs(s.y-mxEvent.getClientY(t))<e}),r=mxUtils.bind(this,function(t){if(l)for(var e=mxEvent.getSource(t);null!=e&&e!=i.node;){if("a"==e.nodeName.toLowerCase()){n.view.graph.labelLinkClicked(n,e,t);break}e=e.parentNode}});mxEvent.addGestureListeners(i.node,t,o,r),mxEvent.addListener(i.node,"click",function(t){mxEvent.consume(t)})},this.initLayoutManager()},function(){Graph.prototype.useCssTransforms=!1,Graph.prototype.currentScale=1,Graph.prototype.currentTranslate=new mxPoint(0,0),Graph.prototype.getVerticesAndEdges=function(e,n){e=null==e||e,n=null==n||n;var i=this.model;return i.filterDescendants(function(t){return e&&i.isVertex(t)||n&&i.isEdge(t)},i.getRoot())},Graph.prototype.getStartEditingCell=function(t,e){var n=this.getCellStyle(t),i=parseInt(mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE,0));if(this.isTable(t)&&(!this.isSwimlane(t)||0==i)&&""==this.getLabel(t)&&0<this.model.getChildCount(t)&&(t=this.model.getChildAt(t,0),n=this.getCellStyle(t),i=parseInt(mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE,0))),this.isTableRow(t)&&(!this.isSwimlane(t)||0==i)&&""==this.getLabel(t)&&0<this.model.getChildCount(t))for(var l=0;l<this.model.getChildCount(t);l++){var s=this.model.getChildAt(t,l);if(this.isCellEditable(s)){t=s;break}}return t},Graph.prototype.copyStyle=function(t){var e=null;if(null!=t){e=mxUtils.clone(this.getCurrentCellStyle(t));for(var t=this.model.getStyle(t),n=null!=t?t.split(";"):[],i=0;i<n.length;i++){var l,s=n[i],o=s.indexOf("=");0<=o&&(l=s.substring(0,o),o=s.substring(o+1),null==e[l]&&o==mxConstants.NONE&&(e[l]=mxConstants.NONE))}}return e},Graph.prototype.pasteStyle=function(t,e,n){n=null!=n?n:Graph.pasteStyles,this.model.beginUpdate();try{for(var i=0;i<e.length;i++)for(var l=this.getCurrentCellStyle(e[i]),s=0;s<n.length;s++){var o=l[n[s]],r=t[n[s]];o==r||null==o&&r==mxConstants.NONE||this.setCellStyles(n[s],r,[e[i]])}}finally{this.model.endUpdate()}},Graph.prototype.isFastZoomEnabled=function(){return"nocss"!=urlParams.zoom&&!mxClient.NO_FO&&!mxClient.IS_EDGE&&!this.useCssTransforms&&this.isCssTransformsSupported()},Graph.prototype.isCssTransformsSupported=function(){return!(this.dialect!=mxConstants.DIALECT_SVG||mxClient.NO_FO||this.lightbox&&mxClient.IS_SF)},Graph.prototype.getCellAt=function(t,e,n,i,l,s){return this.useCssTransforms&&(t=t/this.currentScale-this.currentTranslate.x,e=e/this.currentScale-this.currentTranslate.y),this.getScaledCellAt.apply(this,arguments)},Graph.prototype.getScaledCellAt=function(t,e,n,i,l,s){if(i=null==i||i,l=null==l||l,null==n&&null==(n=this.getCurrentRoot())&&(n=this.getModel().getRoot()),null!=n)for(var o=this.model.getChildCount(n)-1;0<=o;o--){var r=this.model.getChildAt(n,o),a=this.getScaledCellAt(t,e,r,i,l,s);if(null!=a)return a;if(this.isCellVisible(r)&&(l&&this.model.isEdge(r)||i&&this.model.isVertex(r))){a=this.view.getState(r);if(null!=a&&(null==s||!s(a,t,e))&&this.intersects(a,t,e))return r}}return null},Graph.prototype.isRecursiveVertexResize=function(t){return!this.isSwimlane(t.cell)&&0<this.model.getChildCount(t.cell)&&!this.isCellCollapsed(t.cell)&&"1"==mxUtils.getValue(t.style,"recursiveResize","1")&&null==mxUtils.getValue(t.style,"childLayout",null)},Graph.prototype.isPart=function(t){return"1"==mxUtils.getValue(this.getCurrentCellStyle(t),"part","0")||this.isTableCell(t)||this.isTableRow(t)},Graph.prototype.getCompositeParent=function(t){for(;this.isPart(t);){var e=this.model.getParent(t);if(!this.model.isVertex(e))break;t=e}return t},mxCellHighlight.prototype.getStrokeWidth=function(t){var e=this.strokeWidth;return this.graph.useCssTransforms&&(e/=this.graph.currentScale),e},mxGraphView.prototype.getGraphBounds=function(){var t,e,n=this.graphBounds;return this.graph.useCssTransforms&&(t=this.graph.currentTranslate,e=this.graph.currentScale,n=new mxRectangle((n.x+t.x)*e,(n.y+t.y)*e,n.width*e,n.height*e)),n},mxGraphView.prototype.viewStateChanged=function(){this.graph.useCssTransforms?this.validate():this.revalidate(),this.graph.sizeDidChange()};var e=mxGraphView.prototype.validate;mxGraphView.prototype.validate=function(t){this.graph.useCssTransforms&&(this.graph.currentScale=this.scale,this.graph.currentTranslate.x=this.translate.x,this.graph.currentTranslate.y=this.translate.y,this.scale=1,this.translate.x=0,this.translate.y=0),e.apply(this,arguments),this.graph.useCssTransforms&&(this.graph.updateCssTransform(),this.scale=this.graph.currentScale,this.translate.x=this.graph.currentTranslate.x,this.translate.y=this.graph.currentTranslate.y)};var i=mxGraph.prototype.getCellsForGroup;Graph.prototype.getCellsForGroup=function(t){t=i.apply(this,arguments);for(var e=[],n=0;n<t.length;n++)this.isTableRow(t[n])||this.isTableCell(t[n])||e.push(t[n]);return e};var l=mxGraph.prototype.getCellsForUngroup;Graph.prototype.getCellsForUngroup=function(t){t=l.apply(this,arguments);for(var e=[],n=0;n<t.length;n++)this.isTable(t[n])||this.isTableRow(t[n])||this.isTableCell(t[n])||e.push(t[n]);return e},Graph.prototype.updateCssTransform=function(){var t=this.view.getDrawPane();if(null!=t){var e=t.parentNode;if(this.useCssTransforms){var n=e.getAttribute("transform");e.setAttribute("transformOrigin","0 0");var i,l=Math.round(100*this.currentScale)/100,s=Math.round(100*this.currentTranslate.x)/100,t=Math.round(100*this.currentTranslate.y)/100;if(e.setAttribute("transform","scale("+l+","+l+")translate("+s+","+t+")"),n!=e.getAttribute("transform"))try{mxClient.IS_EDGE&&(i=e.style.display,e.style.display="none",e.getBBox(),e.style.display=i)}catch(t){}}else e.removeAttribute("transformOrigin"),e.removeAttribute("transform")}};var s=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){var t=this.graph.useCssTransforms,e=this.scale,n=this.translate;t&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate),s.apply(this,arguments),t&&(this.scale=e,this.translate=n)};var o=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(t,e,n){var i=this.useCssTransforms,l=this.view.scale,s=this.view.translate;i&&(this.view.scale=1,this.view.translate=new mxPoint(0,0),this.useCssTransforms=!1),o.apply(this,arguments),i&&(this.view.scale=l,this.view.translate=s,this.useCssTransforms=!0)}}(),Graph.prototype.isLightboxView=function(){return this.lightbox},Graph.prototype.isViewer=function(){return!1},Graph.prototype.labelLinkClicked=function(t,e,n){e=e.getAttribute("href");null!=e&&!this.isCustomLink(e)&&(mxEvent.isLeftMouseButton(n)&&!mxEvent.isPopupTrigger(n)||mxEvent.isTouchEvent(n))&&(this.isEnabled()&&!this.isCellLocked(t.cell)||(t=this.isBlankLink(e)?this.linkTarget:"_top",this.openLink(this.getAbsoluteUrl(e),t)),mxEvent.consume(n))},Graph.prototype.openLink=function(t,e,n){var i,l=window;try{"_self"==e&&window!=window.top?window.location.href=t:t.substring(0,this.baseUrl.length)==this.baseUrl&&"#"==t.charAt(this.baseUrl.length)&&"_top"==e&&window==window.top?(i=t.split("#")[1],window.location.hash=="#"+i&&(window.location.hash=""),window.location.hash=i):null==(l=window.open(t,null!=e?e:"_blank"))||n||(l.opener=null)}catch(t){}return l},Graph.prototype.getLinkTitle=function(t){return t.substring(t.lastIndexOf("/")+1)},Graph.prototype.isCustomLink=function(t){return"data:"==t.substring(0,5)},Graph.prototype.customLinkClicked=function(t){return!1},Graph.prototype.isExternalProtocol=function(t){return"mailto:"===t.substring(0,7)},Graph.prototype.isBlankLink=function(t){return!this.isExternalProtocol(t)&&("blank"===this.linkPolicy||"self"!==this.linkPolicy&&!this.isRelativeUrl(t)&&t.substring(0,this.domainUrl.length)!==this.domainUrl)},Graph.prototype.isRelativeUrl=function(t){return null!=t&&!this.absoluteUrlPattern.test(t)&&"data:"!==t.substring(0,5)&&!this.isExternalProtocol(t)},Graph.prototype.getAbsoluteUrl=function(t){return null!=t&&this.isRelativeUrl(t)&&(t="#"==t.charAt(0)?this.baseUrl+t:"/"==t.charAt(0)?this.domainUrl+t:this.domainPathUrl+t),t},Graph.prototype.initLayoutManager=function(){this.layoutManager=new mxLayoutManager(this),this.layoutManager.hasLayout=function(t,e){return null!=this.graph.getCellStyle(t).childLayout},this.layoutManager.getLayout=function(t,e){var n=this.graph.model.getParent(t);if(e!=mxEvent.BEGIN_UPDATE||this.hasLayout(n,e)){e=this.graph.getCellStyle(t);if("stackLayout"==e.childLayout){t=new mxStackLayout(this.graph,!0);return t.resizeParentMax="1"==mxUtils.getValue(e,"resizeParentMax","1"),t.horizontal="1"==mxUtils.getValue(e,"horizontalStack","1"),t.resizeParent="1"==mxUtils.getValue(e,"resizeParent","1"),t.resizeLast="1"==mxUtils.getValue(e,"resizeLast","0"),t.spacing=e.stackSpacing||t.spacing,t.border=e.stackBorder||t.border,t.marginLeft=e.marginLeft||0,t.marginRight=e.marginRight||0,t.marginTop=e.marginTop||0,t.marginBottom=e.marginBottom||0,t.allowGaps=e.allowGaps||0,t.fill=!0,t.allowGaps&&(t.gridSize=parseFloat(mxUtils.getValue(e,"stackUnitSize",20))),t}if("treeLayout"==e.childLayout){var i=new mxCompactTreeLayout(this.graph);return i.horizontal="1"==mxUtils.getValue(e,"horizontalTree","1"),i.resizeParent="1"==mxUtils.getValue(e,"resizeParent","1"),i.groupPadding=mxUtils.getValue(e,"parentPadding",20),i.levelDistance=mxUtils.getValue(e,"treeLevelDistance",30),i.maintainParentLocation=!0,i.edgeRouting=!1,i.resetEdges=!1,i}if("flowLayout"==e.childLayout){i=new mxHierarchicalLayout(this.graph,mxUtils.getValue(e,"flowOrientation",mxConstants.DIRECTION_EAST));return i.resizeParent="1"==mxUtils.getValue(e,"resizeParent","1"),i.parentBorder=mxUtils.getValue(e,"parentPadding",20),i.maintainParentLocation=!0,i.intraCellSpacing=mxUtils.getValue(e,"intraCellSpacing",mxHierarchicalLayout.prototype.intraCellSpacing),i.interRankCellSpacing=mxUtils.getValue(e,"interRankCellSpacing",mxHierarchicalLayout.prototype.interRankCellSpacing),i.interHierarchySpacing=mxUtils.getValue(e,"interHierarchySpacing",mxHierarchicalLayout.prototype.interHierarchySpacing),i.parallelEdgeSpacing=mxUtils.getValue(e,"parallelEdgeSpacing",mxHierarchicalLayout.prototype.parallelEdgeSpacing),i}if("circleLayout"==e.childLayout)return new mxCircleLayout(this.graph);if("organicLayout"==e.childLayout)return new mxFastOrganicLayout(this.graph);if("tableLayout"==e.childLayout)return new TableLayout(this.graph)}return null}},Graph.prototype.getPageSize=function(){return this.pageVisible?new mxRectangle(0,0,this.pageFormat.width*this.pageScale,this.pageFormat.height*this.pageScale):this.scrollTileSize},Graph.prototype.getPageLayout=function(){var t=this.getPageSize(),e=this.getGraphBounds();if(0==e.width||0==e.height)return new mxRectangle(0,0,1,1);var n=Math.floor(Math.ceil(e.x/this.view.scale-this.view.translate.x)/t.width),i=Math.floor(Math.ceil(e.y/this.view.scale-this.view.translate.y)/t.height);return new mxRectangle(n,i,Math.ceil((Math.floor((e.x+e.width)/this.view.scale)-this.view.translate.x)/t.width)-n,Math.ceil((Math.floor((e.y+e.height)/this.view.scale)-this.view.translate.y)/t.height)-i)},Graph.prototype.sanitizeHtml=function(t,e){return Graph.sanitizeHtml(t,e)},Graph.prototype.updatePlaceholders=function(){this.model;var t,e=!1;for(t in this.model.cells){var n=this.model.cells[t];this.isReplacePlaceholders(n)&&(this.view.invalidate(n,!1,!1),e=!0)}e&&this.view.validate()},Graph.prototype.isReplacePlaceholders=function(t){return null!=t.value&&"object"==typeof t.value&&"1"==t.value.getAttribute("placeholders")},Graph.prototype.isZoomWheelEvent=function(t){return mxEvent.isAltDown(t)||mxEvent.isMetaDown(t)&&mxClient.IS_MAC||mxEvent.isControlDown(t)},Graph.prototype.isScrollWheelEvent=function(t){return!this.isZoomWheelEvent(t)},Graph.prototype.isTransparentClickEvent=function(t){return mxEvent.isAltDown(t)||mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(t)},Graph.prototype.isIgnoreTerminalEvent=function(t){return mxEvent.isShiftDown(t)&&mxEvent.isControlDown(t)},Graph.prototype.isSplitTarget=function(t,e,n){return!this.model.isEdge(e[0])&&!mxEvent.isAltDown(n)&&!mxEvent.isShiftDown(n)&&mxGraph.prototype.isSplitTarget.apply(this,arguments)},Graph.prototype.getLabel=function(t){var e=mxGraph.prototype.getLabel.apply(this,arguments);return null!=e&&this.isReplacePlaceholders(t)&&null==t.getAttribute("placeholder")&&(e=this.replacePlaceholders(t,e)),e},Graph.prototype.isLabelMovable=function(t){var e=this.getCurrentCellStyle(t);return!this.isCellLocked(t)&&(this.model.isEdge(t)&&this.edgeLabelsMovable||this.model.isVertex(t)&&(this.vertexLabelsMovable||"1"==mxUtils.getValue(e,"labelMovable","0")))},Graph.prototype.setGridSize=function(t){this.gridSize=t,this.fireEvent(new mxEventObject("gridSizeChanged"))},Graph.prototype.setDefaultParent=function(t){this.defaultParent=t,this.fireEvent(new mxEventObject("defaultParentChanged"))},Graph.prototype.getClickableLinkForCell=function(t){do{var e=this.getLinkForCell(t);if(null!=e)return e}while(null!=(t=this.model.getParent(t)));return null},Graph.prototype.getGlobalVariable=function(t){var e=null;return"date"==t?e=(new Date).toLocaleDateString():"time"==t?e=(new Date).toLocaleTimeString():"timestamp"==t?e=(new Date).toLocaleString():"date{"==t.substring(0,5)&&(t=t.substring(5,t.length-1),e=this.formatDate(new Date,t)),e},Graph.prototype.formatDate=function(t,e,n){null==this.dateFormatCache&&(this.dateFormatCache={i18n:{dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]},masks:{default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});function i(t,e){for(t=String(t),e=e||2;t.length<e;)t="0"+t;return t}var l=this.dateFormatCache;if(1!=arguments.length||"[object String]"!=Object.prototype.toString.call(t)||/\d/.test(t)||(e=t,t=void 0),t=t?new Date(t):new Date,isNaN(t))throw SyntaxError("invalid date");"UTC:"==(e=String(l.masks[e]||e||l.masks.default)).slice(0,4)&&(e=e.slice(4),n=!0);var s=n?"getUTC":"get",o=t[s+"Date"](),r=t[s+"Day"](),a=t[s+"Month"](),h=t[s+"FullYear"](),d=t[s+"Hours"](),u=t[s+"Minutes"](),p=t[s+"Seconds"](),m=t[s+"Milliseconds"](),s=n?0:t.getTimezoneOffset(),c={d:o,dd:i(o),ddd:l.i18n.dayNames[r],dddd:l.i18n.dayNames[r+7],m:a+1,mm:i(a+1),mmm:l.i18n.monthNames[a],mmmm:l.i18n.monthNames[a+12],yy:String(h).slice(2),yyyy:h,h:d%12||12,hh:i(d%12||12),H:d,HH:i(d),M:u,MM:i(u),s:p,ss:i(p),l:i(m,3),L:i(99<m?Math.round(m/10):m),t:d<12?"a":"p",tt:d<12?"am":"pm",T:d<12?"A":"P",TT:d<12?"AM":"PM",Z:n?"UTC":(String(t).match(/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g)||[""]).pop().replace(/[^-+\dA-Z]/g,""),o:(0<s?"-":"+")+i(100*Math.floor(Math.abs(s)/60)+Math.abs(s)%60,4),S:["th","st","nd","rd"][3<o%10?0:(o%100-o%10!=10)*o%10]};return e.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(t){return t in c?c[t]:t.slice(1,t.length-1)})},Graph.prototype.createLayersDialog=function(){var l=document.createElement("div");l.style.position="absolute";for(var s=this.getModel(),t=s.getChildCount(s.root),e=0;e<t;e++)mxUtils.bind(this,function(t){var e=document.createElement("div");e.style.overflow="hidden",e.style.textOverflow="ellipsis",e.style.padding="2px",e.style.whiteSpace="nowrap";var n=document.createElement("input");n.style.display="inline-block",n.setAttribute("type","checkbox"),s.isVisible(t)&&(n.setAttribute("checked","checked"),n.defaultChecked=!0),e.appendChild(n);var i=this.convertValueToString(t)||mxResources.get("background")||"Background";e.setAttribute("title",i),mxUtils.write(e,i),l.appendChild(e),mxEvent.addListener(n,"click",function(){null!=n.getAttribute("checked")?n.removeAttribute("checked"):n.setAttribute("checked","checked"),s.setVisible(t,n.checked)})})(s.getChildAt(s.root,e));return l},Graph.prototype.replacePlaceholders=function(t,e,n,i){var l=[];if(null!=e){for(var s=0;match=this.placeholderPattern.exec(e);){var o=match[0];if(2<o.length&&"%label%"!=o&&"%tooltip%"!=o){var r=null;if(match.index>s&&"%"==e.charAt(match.index-1))r=o.substring(1);else{var a=o.substring(1,o.length-1);if("id"==a)r=t.id;else if(a.indexOf("{")<0)for(var h=t;null==r&&null!=h;)null!=h.value&&"object"==typeof h.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(r=h.getAttribute(a+"_"+Graph.diagramLanguage)),null==r&&(r=h.hasAttribute(a)?null!=h.getAttribute(a)?h.getAttribute(a):"":null)),h=this.model.getParent(h);null==r&&(r=this.getGlobalVariable(a)),null==r&&null!=n&&(r=n[a])}l.push(e.substring(s,match.index)+(null!=r?r:o)),s=match.index+o.length}}l.push(e.substring(s))}return l.join("")},Graph.prototype.restoreSelection=function(t){if(null!=t&&0<t.length){for(var e=[],n=0;n<t.length;n++){var i=this.model.getCell(t[n].id);null!=i&&e.push(i)}this.setSelectionCells(e)}else this.clearSelection()},Graph.prototype.selectCellsForConnectVertex=function(t,e,n){2==t.length&&this.model.isVertex(t[1])?(this.setSelectionCell(t[1]),this.scrollCellToVisible(t[1]),null!=n&&(mxEvent.isTouchEvent(e)?n.update(n.getState(this.view.getState(t[1]))):n.reset())):this.setSelectionCells(t)},Graph.prototype.isCloneConnectSource=function(t){var e=null;return null!=this.layoutManager&&(e=this.layoutManager.getLayout(this.model.getParent(t))),this.isTableRow(t)||this.isTableCell(t)||null!=e&&e.constructor==mxStackLayout},Graph.prototype.connectVertex=function(o,r,t,a,e,n,h,d){if(n=n||!1,o.geometry.relative&&this.model.isEdge(o.parent))return[];for(;o.geometry.relative&&this.model.isVertex(o.parent);)o=o.parent;var u=this.isCloneConnectSource(o),i=u?o:this.getCompositeParent(o),p=o.geometry.relative&&null!=o.parent.geometry?new mxPoint(o.parent.geometry.width*o.geometry.x,o.parent.geometry.height*o.geometry.y):new mxPoint(i.geometry.x,i.geometry.y);r==mxConstants.DIRECTION_NORTH?(p.x+=i.geometry.width/2,p.y-=t):r==mxConstants.DIRECTION_SOUTH?(p.x+=i.geometry.width/2,p.y+=i.geometry.height+t):(r==mxConstants.DIRECTION_WEST?p.x-=t:p.x+=i.geometry.width+t,p.y+=i.geometry.height/2);var l=this.view.getState(this.model.getParent(o)),s=this.view.scale,t=this.view.translate,i=t.x*s,t=t.y*s;null!=l&&this.model.isVertex(l.cell)&&(i=l.x,t=l.y),this.model.isVertex(o.parent)&&o.geometry.relative&&(p.x+=o.parent.geometry.x,p.y+=o.parent.geometry.y);var l=n?null:new mxRectangle(i+p.x*s,t+p.y*s).grow(40),n=null!=l?this.getCells(0,0,0,0,null,null,l):null,m=null!=n&&0<n.length?n.reverse()[0]:null,c=!1;null!=m&&this.model.isAncestor(m,o)&&(c=!0,m=null),null==m&&null!=(g=this.getSwimlaneAt(i+p.x*s,t+p.y*s))&&(c=!1,m=g);for(var g=m;null!=g;){if(this.isCellLocked(g)){m=null;break}g=this.model.getParent(g)}null!=m&&(l=this.view.getState(o),n=this.view.getState(m),null!=l&&null!=n&&mxUtils.intersects(l,n)&&(m=null));var x=!mxEvent.isShiftDown(a)||mxEvent.isControlDown(a)||e;x&&(r==mxConstants.DIRECTION_NORTH?p.y-=o.geometry.height/2:r==mxConstants.DIRECTION_SOUTH?p.y+=o.geometry.height/2:r==mxConstants.DIRECTION_WEST?p.x-=o.geometry.width/2:p.x+=o.geometry.width/2),null==m||this.isCellConnectable(m)||this.isSwimlane(m)||(v=this.getModel().getParent(m),this.getModel().isVertex(v)&&this.isCellConnectable(v)&&(m=v)),m!=o&&!this.model.isEdge(m)&&(this.isCellConnectable(m)||this.isSwimlane(m))||(m=null);var y=[],f=null!=m&&this.isSwimlane(m),C=f?null:m,v=mxUtils.bind(this,function(t){if(null==h||null!=t||null==m&&u){this.model.beginUpdate();try{if(null==C&&x){for(var e=null!=t?t:o,n=this.getCellGeometry(e);null!=n&&n.relative;)e=this.getModel().getParent(e),n=this.getCellGeometry(e);e=u?o:this.getCompositeParent(e),C=null!=t?t:this.duplicateCells([e],!1)[0],null!=t&&this.addCells([C],this.model.getParent(o),null,null,null,!0),null!=(n=this.getCellGeometry(C))&&(n.x=p.x-n.width/2,n.y=p.y-n.height/2),f?(this.addCells([C],m,null,null,null,!0),m=null):!x||null!=m||c||u||this.addCells([C],this.getDefaultParent(),null,null,null,!0)}var i=mxEvent.isControlDown(a)&&mxEvent.isShiftDown(a)&&x||null==m&&u?null:this.insertEdge(this.model.getParent(o),null,"",o,C,this.createCurrentEdgeStyle());if(null!=i&&this.connectionHandler.insertBeforeSource){for(var l=null,s=o;null!=s.parent&&null!=s.geometry&&s.geometry.relative&&s.parent!=i.parent;)s=this.model.getParent(s);null!=s&&null!=s.parent&&s.parent==i.parent&&(l=s.parent.getIndex(s),this.model.add(s.parent,i,l))}null==m&&null!=C&&null!=o.parent&&u&&r==mxConstants.DIRECTION_WEST&&(l=o.parent.getIndex(o),this.model.add(o.parent,C,l)),null!=i&&y.push(i),null==m&&null!=C&&y.push(C),null==C&&null!=i&&i.geometry.setTerminalPoint(p,!1),null!=i&&this.fireEvent(new mxEventObject("cellsInserted","cells",[i]))}finally{this.model.endUpdate()}}if(null==d)return y;d(y)});if(null==h||null!=C||!x||null==m&&u)return v(C);h(i+p.x*s,t+p.y*s,v)},Graph.prototype.getIndexableText=function(){var t,e=document.createElement("div"),n=[],i="";for(t in this.model.cells){var l=this.model.cells[t];(this.model.isVertex(l)||this.model.isEdge(l))&&(i=this.isHtmlLabel(l)?(e.innerHTML=this.sanitizeHtml(this.getLabel(l)),mxUtils.extractTextWithWhitespace([e])):this.getLabel(l),0<(i=mxUtils.trim(i.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," "))).length&&n.push(i))}return n.join(" ")},Graph.prototype.convertValueToString=function(t){var e=this.model.getValue(t);if(null==e||"object"!=typeof e)return mxGraph.prototype.convertValueToString.apply(this,arguments);var n=null;if(this.isReplacePlaceholders(t)&&null!=t.getAttribute("placeholder"))for(var i=t.getAttribute("placeholder"),l=t;null==n&&null!=l;)null!=l.value&&"object"==typeof l.value&&(n=l.hasAttribute(i)?null!=l.getAttribute(i)?l.getAttribute(i):"":null),l=this.model.getParent(l);else{n=null;Graph.translateDiagram&&null!=Graph.diagramLanguage&&(n=e.getAttribute("label_"+Graph.diagramLanguage)),null==n&&(n=e.getAttribute("label")||"")}return n||""},Graph.prototype.getLinksForState=function(t){return null!=t&&null!=t.text&&null!=t.text.node?t.text.node.getElementsByTagName("a"):null},Graph.prototype.getLinkForCell=function(t){if(null==t.value||"object"!=typeof t.value)return null;t=t.value.getAttribute("link");return null!=t&&"javascript:"===t.toLowerCase().substring(0,11)&&(t=t.substring(11)),t},Graph.prototype.getCellStyle=function(t){var e,n=mxGraph.prototype.getCellStyle.apply(this,arguments);return null!=t&&null!=this.layoutManager&&(e=this.model.getParent(t),this.model.isVertex(e)&&this.isCellCollapsed(t)&&(null!=(e=this.layoutManager.getLayout(e))&&e.constructor==mxStackLayout&&(n[mxConstants.STYLE_HORIZONTAL]=!e.horizontal))),n},Graph.prototype.updateAlternateBounds=function(t,e,n){var i;null==t||null==e||null==this.layoutManager||null==e.alternateBounds||null!=(i=this.layoutManager.getLayout(this.model.getParent(t)))&&i.constructor==mxStackLayout&&(i.horizontal?e.alternateBounds.height=0:e.alternateBounds.width=0),mxGraph.prototype.updateAlternateBounds.apply(this,arguments)},Graph.prototype.isMoveCellsEvent=function(t,e){return mxEvent.isShiftDown(t)||"1"==mxUtils.getValue(e.style,"moveCells","0")},Graph.prototype.foldCells=function(t,e,n,i,l){if(e=null!=e&&e,null==n&&(n=this.getFoldableCells(this.getSelectionCells(),t)),null!=n){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var s=0;s<n.length;s++){var o,r,a,h=this.view.getState(n[s]),d=this.getCellGeometry(n[s]);null!=h&&null!=d&&(o=Math.round(d.width-h.width/this.view.scale),0==(r=Math.round(d.height-h.height/this.view.scale))&&0==o||(a=this.model.getParent(n[s]),null==(d=this.layoutManager.getLayout(a))?null!=l&&this.isMoveCellsEvent(l,h)&&this.moveSiblings(h,a,o,r):null!=l&&mxEvent.isAltDown(l)||d.constructor!=mxStackLayout||d.resizeLast||this.resizeParentStacks(a,d,o,r)))}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(n)}},Graph.prototype.moveSiblings=function(t,e,n,i){this.model.beginUpdate();try{for(var l,s,o=this.getCellsBeyond(t.x,t.y,e,!0,!0),r=0;r<o.length;r++)o[r]!=t.cell&&(l=this.view.getState(o[r]),s=this.getCellGeometry(o[r]),null!=l&&null!=s&&((s=s.clone()).translate(Math.round(n*Math.max(0,Math.min(1,(l.x-t.x)/t.width))),Math.round(i*Math.max(0,Math.min(1,(l.y-t.y)/t.height)))),this.model.setGeometry(o[r],s)))}finally{this.model.endUpdate()}},Graph.prototype.resizeParentStacks=function(t,e,n,i){if(null!=this.layoutManager&&null!=e&&e.constructor==mxStackLayout&&!e.resizeLast){this.model.beginUpdate();try{for(var l=e.horizontal;null!=t&&null!=e&&e.constructor==mxStackLayout&&e.horizontal==l&&!e.resizeLast;){var s=this.getCellGeometry(t),o=this.view.getState(t);null!=o&&null!=s&&(s=s.clone(),e.horizontal?s.width+=n+Math.min(0,o.width/this.view.scale-s.width):s.height+=i+Math.min(0,o.height/this.view.scale-s.height),this.model.setGeometry(t,s)),t=this.model.getParent(t),e=this.layoutManager.getLayout(t)}}finally{this.model.endUpdate()}}},Graph.prototype.isContainer=function(t){var e=this.getCurrentCellStyle(t);return this.isSwimlane(t)?"0"!=e.container:"1"==e.container},Graph.prototype.isCellConnectable=function(t){var e=this.getCurrentCellStyle(t);return null!=e.connectable?"0"!=e.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments)},Graph.prototype.isLabelMovable=function(t){var e=this.getCurrentCellStyle(t);return null!=e.movableLabel?"0"!=e.movableLabel:mxGraph.prototype.isLabelMovable.apply(this,arguments)},Graph.prototype.selectAll=function(t){t=t||this.getDefaultParent(),this.isCellLocked(t)||mxGraph.prototype.selectAll.apply(this,arguments)},Graph.prototype.selectCells=function(t,e,n){n=n||this.getDefaultParent(),this.isCellLocked(n)||mxGraph.prototype.selectCells.apply(this,arguments)},Graph.prototype.getSwimlaneAt=function(t,e,n){var i=mxGraph.prototype.getSwimlaneAt.apply(this,arguments);return this.isCellLocked(i)&&(i=null),i},Graph.prototype.isCellFoldable=function(t){var e=this.getCurrentCellStyle(t);return this.foldingEnabled&&("1"==e.treeFolding||!this.isCellLocked(t)&&(this.isContainer(t)&&"0"!=e.collapsible||!this.isContainer(t)&&"1"==e.collapsible))},Graph.prototype.reset=function(){this.isEditing()&&this.stopEditing(!0),this.escape(),this.isSelectionEmpty()||this.clearSelection()},Graph.prototype.zoom=function(t,e){t=Math.max(.01,Math.min(this.view.scale*t,160))/this.view.scale,mxGraph.prototype.zoom.apply(this,arguments)},Graph.prototype.zoomIn=function(){this.view.scale<.15?this.zoom((this.view.scale+.01)/this.view.scale):this.zoom(Math.round(this.view.scale*this.zoomFactor*20)/20/this.view.scale)},Graph.prototype.zoomOut=function(){this.view.scale<=.15?this.zoom((this.view.scale-.01)/this.view.scale):this.zoom(Math.round(this.view.scale*(1/this.zoomFactor)*20)/20/this.view.scale)},Graph.prototype.fitWindow=function(t,e){e=null!=e?e:10;var n,i=this.container.clientWidth-e,l=this.container.clientHeight-e,s=Math.floor(20*Math.min(i/t.width,l/t.height))/20;this.zoomTo(s),mxUtils.hasScrollbars(this.container)&&(n=this.view.translate,this.container.scrollTop=(t.y+n.y)*s-Math.max((l-t.height*s)/2+e/2,0),this.container.scrollLeft=(t.x+n.x)*s-Math.max((i-t.width*s)/2+e/2,0))},Graph.prototype.getTooltipForCell=function(t){var e="";if(mxUtils.isNode(t.value)){var n=null;if(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(n=t.value.getAttribute("tooltip_"+Graph.diagramLanguage)),null==n&&(n=t.value.getAttribute("tooltip")),null!=n)null!=n&&this.isReplacePlaceholders(t)&&(n=this.replacePlaceholders(t,n)),e=this.sanitizeHtml(n);else{var i=this.builtInProperties,l=t.value.attributes,s=[];this.isEnabled()&&i.push("link");for(var o=0;o<l.length;o++)mxUtils.indexOf(i,l[o].nodeName)<0&&0<l[o].nodeValue.length&&s.push({name:l[o].nodeName,value:l[o].nodeValue});s.sort(function(t,e){return t.name<e.name?-1:t.name>e.name?1:0});for(o=0;o<s.length;o++)"link"==s[o].name&&this.isCustomLink(s[o].value)||(e+=("link"!=s[o].name?"<b>"+s[o].name+":</b> ":"")+mxUtils.htmlEntities(s[o].value)+"\n");0<e.length&&(e=e.substring(0,e.length-1),mxClient.IS_SVG&&(e='<div style="max-width:360px;">'+e+"</div>"))}}return e},Graph.prototype.stringToBytes=function(t){return Graph.stringToBytes(t)},Graph.prototype.bytesToString=function(t){return Graph.bytesToString(t)},Graph.prototype.compressNode=function(t){return Graph.compressNode(t)},Graph.prototype.compress=function(t,e){return Graph.compress(t,e)},Graph.prototype.decompress=function(t,e){return Graph.decompress(t,e)},Graph.prototype.zapGremlins=function(t){return Graph.zapGremlins(t)},HoverIcons=function(t){this.graph=t,this.init()},HoverIcons.prototype.arrowSpacing=2,HoverIcons.prototype.updateDelay=500,HoverIcons.prototype.activationDelay=140,HoverIcons.prototype.currentState=null,HoverIcons.prototype.activeArrow=null,HoverIcons.prototype.inactiveOpacity=15,HoverIcons.prototype.cssCursor="copy",HoverIcons.prototype.checkCollisions=!0,HoverIcons.prototype.arrowFill="#29b6f2",HoverIcons.prototype.triangleUp=mxClient.IS_SVG?Graph.createSvgImage(18,28,'<path d="m 6 26 L 12 26 L 12 12 L 18 12 L 9 1 L 1 12 L 6 12 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>'):new mxImage(IMAGE_PATH+"/triangle-up.png",26,14),HoverIcons.prototype.triangleRight=mxClient.IS_SVG?Graph.createSvgImage(26,18,'<path d="m 1 6 L 14 6 L 14 1 L 26 9 L 14 18 L 14 12 L 1 12 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>'):new mxImage(IMAGE_PATH+"/triangle-right.png",14,26),HoverIcons.prototype.triangleDown=mxClient.IS_SVG?Graph.createSvgImage(18,26,'<path d="m 6 1 L 6 14 L 1 14 L 9 26 L 18 14 L 12 14 L 12 1 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>'):new mxImage(IMAGE_PATH+"/triangle-down.png",26,14),HoverIcons.prototype.triangleLeft=mxClient.IS_SVG?Graph.createSvgImage(28,18,'<path d="m 1 9 L 12 1 L 12 6 L 26 6 L 26 12 L 12 12 L 12 18 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>'):new mxImage(IMAGE_PATH+"/triangle-left.png",14,26),HoverIcons.prototype.roundDrop=mxClient.IS_SVG?Graph.createSvgImage(26,26,'<circle cx="13" cy="13" r="12" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>'):new mxImage(IMAGE_PATH+"/round-drop.png",26,26),HoverIcons.prototype.refreshTarget=new mxImage(mxClient.IS_SVG?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjM2cHgiIGhlaWdodD0iMzZweCI+PGVsbGlwc2UgZmlsbD0iIzI5YjZmMiIgY3g9IjEyIiBjeT0iMTIiIHJ4PSIxMiIgcnk9IjEyIi8+PHBhdGggdHJhbnNmb3JtPSJzY2FsZSgwLjgpIHRyYW5zbGF0ZSgyLjQsIDIuNCkiIHN0cm9rZT0iI2ZmZiIgZmlsbD0iI2ZmZiIgZD0iTTEyIDZ2M2w0LTQtNC00djNjLTQuNDIgMC04IDMuNTgtOCA4IDAgMS41Ny40NiAzLjAzIDEuMjQgNC4yNkw2LjcgMTQuOGMtLjQ1LS44My0uNy0xLjc5LS43LTIuOCAwLTMuMzEgMi42OS02IDYtNnptNi43NiAxLjc0TDE3LjMgOS4yYy40NC44NC43IDEuNzkuNyAyLjggMCAzLjMxLTIuNjkgNi02IDZ2LTNsLTQgNCA0IDR2LTNjNC40MiAwIDgtMy41OCA4LTggMC0xLjU3LS40Ni0zLjAzLTEuMjQtNC4yNnoiLz48cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIi8+PC9zdmc+Cg==":IMAGE_PATH+"/refresh.png",38,38),HoverIcons.prototype.tolerance=mxClient.IS_TOUCH?6:0,HoverIcons.prototype.init=function(){this.arrowUp=this.createArrow(this.triangleUp,mxResources.get("plusTooltip")),this.arrowRight=this.createArrow(this.triangleRight,mxResources.get("plusTooltip")),this.arrowDown=this.createArrow(this.triangleDown,mxResources.get("plusTooltip")),this.arrowLeft=this.createArrow(this.triangleLeft,mxResources.get("plusTooltip")),this.elts=[this.arrowUp,this.arrowRight,this.arrowDown,this.arrowLeft],this.resetHandler=mxUtils.bind(this,function(){this.reset()}),this.repaintHandler=mxUtils.bind(this,function(){this.repaint()}),this.graph.selectionModel.addListener(mxEvent.CHANGE,this.resetHandler),this.graph.model.addListener(mxEvent.CHANGE,this.repaintHandler),this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler),this.graph.view.addListener(mxEvent.TRANSLATE,this.repaintHandler),this.graph.view.addListener(mxEvent.SCALE,this.repaintHandler),this.graph.view.addListener(mxEvent.DOWN,this.repaintHandler),this.graph.view.addListener(mxEvent.UP,this.repaintHandler),this.graph.addListener(mxEvent.ROOT,this.repaintHandler),this.graph.addListener(mxEvent.ESCAPE,this.resetHandler),mxEvent.addListener(this.graph.container,"scroll",this.resetHandler),this.graph.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){this.mouseDownPoint=null})),mxEvent.addListener(this.graph.container,"mouseleave",mxUtils.bind(this,function(t){null!=t.relatedTarget&&mxEvent.getSource(t)==this.graph.container&&this.setDisplay("none")})),this.graph.addListener(mxEvent.START_EDITING,mxUtils.bind(this,function(t){this.reset()}));var e=this.graph.click;this.graph.click=mxUtils.bind(this,function(t){e.apply(this.graph,arguments),null==this.currentState||this.graph.isCellSelected(this.currentState.cell)||!mxEvent.isTouchEvent(t.getEvent())||this.graph.model.isVertex(t.getCell())||this.reset()});var i=!1;this.graph.addMouseListener({mouseDown:mxUtils.bind(this,function(t,e){i=!1;var n=e.getEvent();this.isResetEvent(n)?this.reset():this.isActive()||(null==(e=this.getState(e.getState()))&&mxEvent.isTouchEvent(n)||this.update(e)),this.setDisplay("none")}),mouseMove:mxUtils.bind(this,function(t,e){var n=e.getEvent();this.isResetEvent(n)?this.reset():this.graph.isMouseDown||mxEvent.isTouchEvent(n)||this.update(this.getState(e.getState()),e.getGraphX(),e.getGraphY()),null!=this.graph.connectionHandler&&null!=this.graph.connectionHandler.shape&&(i=!0)}),mouseUp:mxUtils.bind(this,function(t,e){var n=e.getEvent();mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(n),mxEvent.getClientY(n));this.isResetEvent(n)?this.reset():this.isActive()&&!i&&null!=this.mouseDownPoint?this.click(this.currentState,this.getDirection(),e):this.isActive()?1==this.graph.getSelectionCount()&&this.graph.model.isEdge(this.graph.getSelectionCell())?this.reset():this.update(this.getState(this.graph.view.getState(this.graph.getCellAt(e.getGraphX(),e.getGraphY())))):mxEvent.isTouchEvent(n)||null!=this.bbox&&mxUtils.contains(this.bbox,e.getGraphX(),e.getGraphY())?(this.setDisplay(""),this.repaint()):mxEvent.isTouchEvent(n)||this.reset(),i=!1,this.resetActiveArrow()})})},HoverIcons.prototype.isResetEvent=function(t,e){return mxEvent.isAltDown(t)||null==this.activeArrow&&mxEvent.isShiftDown(t)||mxEvent.isPopupTrigger(t)&&!this.graph.isCloneEvent(t)},HoverIcons.prototype.createArrow=function(t,e){var n=null;return mxClient.IS_IE&&!mxClient.IS_SVG?(mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?((n=document.createElement(mxClient.VML_PREFIX+":image")).setAttribute("src",t.src),n.style.borderStyle="none"):((n=document.createElement("div")).style.backgroundImage="url("+t.src+")",n.style.backgroundPosition="center",n.style.backgroundRepeat="no-repeat"),n.style.width=t.width+4+"px",n.style.height=t.height+4+"px",n.style.display=mxClient.IS_QUIRKS?"inline":"inline-block"):((n=mxUtils.createImage(t.src)).style.width=t.width+"px",n.style.height=t.height+"px",n.style.padding=this.tolerance+"px"),null!=e&&n.setAttribute("title",e),n.style.position="absolute",n.style.cursor=this.cssCursor,mxEvent.addGestureListeners(n,mxUtils.bind(this,function(t){null==this.currentState||this.isResetEvent(t)||(this.mouseDownPoint=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(t),mxEvent.getClientY(t)),this.drag(t,this.mouseDownPoint.x,this.mouseDownPoint.y),this.activeArrow=n,this.setDisplay("none"),mxEvent.consume(t))})),mxEvent.redirectMouseEvents(n,this.graph,this.currentState),mxEvent.addListener(n,"mouseenter",mxUtils.bind(this,function(t){mxEvent.isMouseEvent(t)&&(null!=this.activeArrow&&this.activeArrow!=n&&mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.graph.connectionHandler.constraintHandler.reset(),mxUtils.setOpacity(n,100),this.activeArrow=n)})),mxEvent.addListener(n,"mouseleave",mxUtils.bind(this,function(t){this.graph.isMouseDown||this.resetActiveArrow()})),n},HoverIcons.prototype.resetActiveArrow=function(){null!=this.activeArrow&&(mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.activeArrow=null)},HoverIcons.prototype.getDirection=function(){var t=mxConstants.DIRECTION_EAST;return this.activeArrow==this.arrowUp?t=mxConstants.DIRECTION_NORTH:this.activeArrow==this.arrowDown?t=mxConstants.DIRECTION_SOUTH:this.activeArrow==this.arrowLeft&&(t=mxConstants.DIRECTION_WEST),t},HoverIcons.prototype.visitNodes=function(t){for(var e=0;e<this.elts.length;e++)null!=this.elts[e]&&t(this.elts[e])},HoverIcons.prototype.removeNodes=function(){this.visitNodes(function(t){null!=t.parentNode&&t.parentNode.removeChild(t)})},HoverIcons.prototype.setDisplay=function(e){this.visitNodes(function(t){t.style.display=e})},HoverIcons.prototype.isActive=function(){return null!=this.activeArrow&&null!=this.currentState},HoverIcons.prototype.drag=function(t,e,n){this.graph.popupMenuHandler.hideMenu(),this.graph.stopEditing(!1),null!=this.currentState&&(this.graph.connectionHandler.start(this.currentState,e,n),this.graph.isMouseTrigger=mxEvent.isMouseEvent(t),this.graph.isMouseDown=!0,null!=(n=this.graph.selectionCellsHandler.getHandler(this.currentState.cell))&&n.setHandlesVisible(!1),n=this.graph.connectionHandler.edgeState,null!=t&&mxEvent.isShiftDown(t)&&mxEvent.isControlDown(t)&&null!=n&&"orthogonalEdgeStyle"===mxUtils.getValue(n.style,mxConstants.STYLE_EDGE,null)&&(t=this.getDirection(),n.cell.style=mxUtils.setStyle(n.cell.style,"sourcePortConstraint",t),n.style.sourcePortConstraint=t))},HoverIcons.prototype.getStateAt=function(t,e,n){return this.graph.view.getState(this.graph.getCellAt(e,n))},HoverIcons.prototype.click=function(t,e,n){var i=n.getEvent(),l=n.getGraphX(),s=n.getGraphY(),s=this.getStateAt(t,l,s);null==s||!this.graph.model.isEdge(s.cell)||this.graph.isCloneEvent(i)||s.getVisibleTerminalState(!0)!=t&&s.getVisibleTerminalState(!1)!=t?null!=t&&this.execute(t,e,n):(this.graph.setSelectionCell(s.cell),this.reset()),n.consume()},HoverIcons.prototype.execute=function(t,e,n){n=n.getEvent();this.graph.selectCellsForConnectVertex(this.graph.connectVertex(t.cell,e,this.graph.defaultEdgeLength,n,this.graph.isCloneEvent(n),this.graph.isCloneEvent(n)),n,this)},HoverIcons.prototype.reset=function(t){(t=null==t||t)&&null!=this.updateThread&&window.clearTimeout(this.updateThread),this.mouseDownPoint=null,this.currentState=null,this.activeArrow=null,this.removeNodes(),this.bbox=null},HoverIcons.prototype.repaint=function(){var l,t,e,n,i,s,o;(this.bbox=null)!=this.currentState&&(this.currentState=this.getState(this.currentState),null!=this.currentState&&this.graph.model.isVertex(this.currentState.cell)&&this.graph.isCellConnectable(this.currentState.cell)?(o=mxRectangle.fromRectangle(this.currentState),null!=this.currentState.shape&&null!=this.currentState.shape.boundingBox&&(o=mxRectangle.fromRectangle(this.currentState.shape.boundingBox)),o.grow(this.graph.tolerance),o.grow(this.arrowSpacing),n=this.graph.selectionCellsHandler.getHandler(this.currentState.cell),this.graph.isTableRow(this.currentState.cell)&&(n=this.graph.selectionCellsHandler.getHandler(this.graph.model.getParent(this.currentState.cell))),(l=null)!=n&&(o.x-=n.horizontalOffset/2,o.y-=n.verticalOffset/2,o.width+=n.horizontalOffset,o.height+=n.verticalOffset,null!=n.rotationShape&&null!=n.rotationShape.node&&"hidden"!=n.rotationShape.node.style.visibility&&"none"!=n.rotationShape.node.style.display&&null!=n.rotationShape.boundingBox&&(l=n.rotationShape.boundingBox)),(i=mxUtils.bind(this,function(t,e,n){var i;null!=l&&(i=new mxRectangle(e,n,t.clientWidth,t.clientHeight),mxUtils.intersects(i,l)&&(t==this.arrowUp?n-=i.y+i.height-l.y:t==this.arrowRight?e+=l.x+l.width-i.x:t==this.arrowDown?n+=l.y+l.height-i.y:t==this.arrowLeft&&(e-=i.x+i.width-l.x))),t.style.left=e+"px",t.style.top=n+"px",mxUtils.setOpacity(t,this.inactiveOpacity)}))(this.arrowUp,Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance),Math.round(o.y-this.triangleUp.height-this.tolerance)),i(this.arrowRight,Math.round(o.x+o.width-this.tolerance),Math.round(this.currentState.getCenterY()-this.triangleRight.height/2-this.tolerance)),i(this.arrowDown,parseInt(this.arrowUp.style.left),Math.round(o.y+o.height-this.tolerance)),i(this.arrowLeft,Math.round(o.x-this.triangleLeft.width-this.tolerance),parseInt(this.arrowRight.style.top)),this.checkCollisions?(t=this.graph.getCellAt(o.x+o.width+this.triangleRight.width/2,this.currentState.getCenterY()),e=this.graph.getCellAt(o.x-this.triangleLeft.width/2,this.currentState.getCenterY()),n=this.graph.getCellAt(this.currentState.getCenterX(),o.y-this.triangleUp.height/2),i=this.graph.getCellAt(this.currentState.getCenterX(),o.y+o.height+this.triangleDown.height/2),null!=t&&t==e&&e==n&&n==i&&(i=n=e=t=null),s=this.graph.getCellGeometry(this.currentState.cell),(o=mxUtils.bind(this,function(t,e){var n=this.graph.model.isVertex(t)&&this.graph.getCellGeometry(t);null==t||this.graph.model.isAncestor(t,this.currentState.cell)||this.graph.isSwimlane(t)||!(null==n||null==s||n.height<3*s.height&&n.width<3*s.width)?e.style.visibility="visible":e.style.visibility="hidden"}))(t,this.arrowRight),o(e,this.arrowLeft),o(n,this.arrowUp),o(i,this.arrowDown)):(this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible"),this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),this.arrowRight.setAttribute("title",mxResources.get("plusTooltip")),this.arrowUp.setAttribute("title",mxResources.get("plusTooltip")),this.arrowDown.setAttribute("title",mxResources.get("plusTooltip"))):(this.arrowLeft.removeAttribute("title"),this.arrowRight.removeAttribute("title"),this.arrowUp.removeAttribute("title"),this.arrowDown.removeAttribute("title"))):this.reset(),null!=this.currentState&&(this.bbox=this.computeBoundingBox(),null!=this.bbox&&this.bbox.grow(10)))},HoverIcons.prototype.computeBoundingBox=function(){var e=this.graph.model.isEdge(this.currentState.cell)?null:mxRectangle.fromRectangle(this.currentState);return this.visitNodes(function(t){null!=t.parentNode&&(t=new mxRectangle(t.offsetLeft,t.offsetTop,t.offsetWidth,t.offsetHeight),null==e?e=t:e.add(t))}),e},HoverIcons.prototype.getState=function(t){var e,n;return null!=t&&(e=t.cell,this.graph.getModel().contains(e)?(this.graph.getModel().isVertex(e)&&!this.graph.isCellConnectable(e)&&(n=this.graph.getModel().getParent(e),this.graph.getModel().isVertex(n)&&this.graph.isCellConnectable(n)&&(e=n)),(this.graph.isCellLocked(e)||this.graph.model.isEdge(e))&&(e=null),null!=(t=this.graph.view.getState(e))&&null==t.style&&(t=null)):t=null),t},HoverIcons.prototype.update=function(t,e,n){var i;!this.graph.connectionArrowsEnabled||null!=t&&"0"==mxUtils.getValue(t.style,"allowArrows","1")?this.reset():(null!=t&&null!=t.cell.geometry&&t.cell.geometry.relative&&this.graph.model.isEdge(t.cell.parent)&&(t=null),i=null,this.prev!=t||this.isActive()?(this.startTime=(new Date).getTime(),this.prev=t,i=0,null!=this.updateThread&&window.clearTimeout(this.updateThread),null!=t&&(this.updateThread=window.setTimeout(mxUtils.bind(this,function(){this.isActive()||this.graph.isMouseDown||this.graph.panningHandler.isActive()||(this.prev=t,this.update(t,e,n))}),this.updateDelay+10))):null!=this.startTime&&(i=(new Date).getTime()-this.startTime),this.setDisplay(""),null!=this.currentState&&this.currentState!=t&&i<this.activationDelay&&null!=this.bbox&&!mxUtils.contains(this.bbox,e,n)?this.reset(!1):(null!=this.currentState||i>this.activationDelay)&&this.currentState!=t&&(i>this.updateDelay&&null!=t||null==this.bbox||null==e||null==n||!mxUtils.contains(this.bbox,e,n))&&(null!=t&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(t),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!=t&&this.graph.connectionHandler.constraintHandler.reset()):this.reset()))},HoverIcons.prototype.setCurrentState=function(t){"eastwest"!=t.style.portConstraint&&(this.graph.container.appendChild(this.arrowUp),this.graph.container.appendChild(this.arrowDown)),this.graph.container.appendChild(this.arrowRight),this.graph.container.appendChild(this.arrowLeft),this.currentState=t},Graph.prototype.createParent=function(t,e,n,i,l){t=this.cloneCell(t);for(var s=0;s<n;s++){var o=this.cloneCell(e),r=this.getCellGeometry(o);null!=r&&(r.x+=s*i,r.y+=s*l),t.insert(o)}return t},Graph.prototype.createTable=function(t,e,n,i,l,s,o,r,a){return n=null!=n?n:60,i=null!=i?i:40,s=null!=s?s:30,o=null!=o?o:"shape=table;html=1;whiteSpace=wrap;startSize="+(null!=l?s:"0")+";container=1;collapsible=0;childLayout=tableLayout;",r=null!=r?r:"shape=partialRectangle;html=1;whiteSpace=wrap;collapsible=0;dropTarget=0;pointerEvents=0;fillColor=none;top=0;left=0;bottom=0;right=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;",a=null!=a?a:"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;",this.createParent(this.createVertex(null,null,null!=l?l:"",0,0,e*n,t*i+(null!=l?s:0),o),this.createParent(this.createVertex(null,null,"",0,0,e*n,i,r),this.createVertex(null,null,"",0,0,n,i,a),e,n,0),t,0,i)},Graph.prototype.setTableValues=function(t,e,n){for(var i=this.model.getChildCells(t,!0),l=0;l<i.length;l++)if(null!=n&&(i[l].value=n[l]),null!=e)for(var s=this.model.getChildCells(i[l],!0),o=0;o<s.length;o++)null!=e[l][o]&&(s[o].value=e[l][o]);return t},Graph.prototype.createCrossFunctionalSwimlane=function(t,e,n,i,l,s,o,r,a){n=null!=n?n:120,i=null!=i?i:120,l=null!=l?l:40;var h="html=1;whiteSpace=wrap;collapsible=0;recursiveResize=0;expand=0;pointerEvents=0;";s=null!=s?s:"shape=table;childLayout=tableLayout;rowLines=0;columnLines=0;startSize="+l+";"+h,o=null!=o?o:"swimlane;horizontal=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;startSize="+l+";"+h,r=null!=r?r:"swimlane;connectable=0;startSize=40;"+h,a=null!=a?a:"swimlane;connectable=0;startSize=0;"+h;h=this.createVertex(null,null,"",0,0,e*n,t*i,s),s=mxUtils.getValue(this.getCellStyle(h),mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);h.geometry.width+=s,h.geometry.height+=s;o=this.createVertex(null,null,"",0,s,e*n+s,i,o);return h.insert(this.createParent(o,this.createVertex(null,null,"",s,0,n,i,r),e,n,0)),1<t?(o.geometry.y=i+s,this.createParent(h,this.createParent(o,this.createVertex(null,null,"",s,0,n,i,a),e,n,0),t-1,0,i)):h},Graph.prototype.isTableCell=function(t){return this.model.isVertex(t)&&this.isTableRow(this.model.getParent(t))},Graph.prototype.isTableRow=function(t){return this.model.isVertex(t)&&this.isTable(this.model.getParent(t))},Graph.prototype.isTable=function(t){t=this.getCellStyle(t);return null!=t&&"tableLayout"==t.childLayout},Graph.prototype.setTableRowHeight=function(t,e,n){n=null==n||n;var i=this.getModel();i.beginUpdate();try{var l,s,o,r=this.getCellGeometry(t);null!=r&&((r=r.clone()).height+=e,i.setGeometry(t,r),l=i.getParent(t),s=i.getChildCells(l,!0),n||(r=mxUtils.indexOf(s,t))<s.length-1&&(r=s[r+1],null!=(o=this.getCellGeometry(r))&&((o=o.clone()).y+=e,o.height-=e,i.setGeometry(r,o))),null!=(o=this.getCellGeometry(l))&&(n=n||t==s[s.length-1])&&((o=o.clone()).height+=e,i.setGeometry(l,o)),null!=this.layoutManager&&this.layoutManager.executeLayout(l,!0))}finally{i.endUpdate()}},Graph.prototype.setTableColumnWidth=function(t,e,n){n=null!=n&&n;var i=this.getModel(),l=i.getParent(t),s=i.getParent(l),o=i.getChildCells(l,!0),r=mxUtils.indexOf(o,t),a=r==o.length-1;i.beginUpdate();try{for(var h,d=i.getChildCells(s,!0),u=0;u<d.length;u++){l=d[u];var p=(o=i.getChildCells(l,!0))[r],m=this.getCellGeometry(p);null!=m&&((m=m.clone()).width+=e,i.setGeometry(p,m)),r<o.length-1&&(p=o[r+1],null!=(m=this.getCellGeometry(p))&&((m=m.clone()).x+=e,n||(m.width-=e),i.setGeometry(p,m)))}!a&&!n||null!=(h=this.getCellGeometry(s))&&((h=h.clone()).width+=e,i.setGeometry(s,h)),null!=this.layoutManager&&this.layoutManager.executeLayout(s,!0)}finally{i.endUpdate()}},TableLayout.prototype=new mxStackLayout,TableLayout.prototype.constructor=TableLayout,TableLayout.prototype.isHorizontal=function(){return!1},TableLayout.prototype.isVertexIgnored=function(t){return!this.graph.getModel().isVertex(t)||!this.graph.isCellVisible(t)},TableLayout.prototype.getSize=function(t,e){for(var n,i=0,l=0;l<t.length;l++)this.isVertexIgnored(t[l])||null!=(n=this.graph.getCellGeometry(t[l]))&&(i+=e?n.width:n.height);return i},TableLayout.prototype.getRowLayout=function(t,e){for(var n=this.graph.model.getChildCells(t,!0),t=this.graph.getActualStartSize(t,!0),i=this.getSize(n,!0),l=e-t.x-t.width,s=[],o=t.x,r=0;r<n.length;r++){var a=this.graph.getCellGeometry(n[r]);null!=a&&(o+=a.width*l/i,s.push(Math.round(o)))}return s},TableLayout.prototype.layoutRow=function(t,e,n,i){var l=this.graph.getModel(),s=l.getChildCells(t,!0),o=this.graph.getActualStartSize(t,!0),r=o.x,a=0;null!=e&&(e=e.slice()).splice(0,0,o.x);for(var h=0;h<s.length;h++){var d=this.graph.getCellGeometry(s[h]);null!=d&&((d=d.clone()).y=o.y,d.height=n-o.y-o.height,null!=e?(d.x=e[h],d.width=e[h+1]-d.x,h==s.length-1&&h<e.length-2&&(d.width=i-d.x-o.x-o.width)):(d.x=r,r+=d.width,h==s.length-1?d.width=i-o.x-o.width-a:a+=d.width),l.setGeometry(s[h],d))}return a},TableLayout.prototype.execute=function(t){if(null!=t){var e=this.graph.getActualStartSize(t,!0),n=this.graph.getCellGeometry(t),i=this.graph.getCellStyle(t),l="1"==mxUtils.getValue(i,"resizeLastRow","0"),s="1"==mxUtils.getValue(i,"resizeLast","0"),o="1"==mxUtils.getValue(i,"fixedRows","0"),r=this.graph.getModel(),a=0;r.beginUpdate();try{var h=n.height-e.y-e.height,d=n.width-e.x-e.width,u=r.getChildCells(t,!0),p=this.getSize(u,!1);if(0<h&&0<d&&0<u.length&&0<p){l&&null!=(m=this.graph.getCellGeometry(u[u.length-1]))&&((m=m.clone()).height=h-p+m.height,r.setGeometry(u[u.length-1],m));for(var m,c=s?null:this.getRowLayout(u[0],d),g=e.y,x=0;x<u.length;x++)null!=(m=this.graph.getCellGeometry(u[x]))&&((m=m.clone()).x=e.x,m.width=d,m.y=Math.round(g),g+=l||o?m.height:m.height/p*h,m.height=Math.round(g)-m.y,r.setGeometry(u[x],m)),a=Math.max(a,this.layoutRow(u[x],c,m.height,d));o&&h<p&&((n=n.clone()).height=g+e.height,r.setGeometry(t,n)),s&&d<a+Graph.minTableColumnWidth&&((n=n.clone()).width=a+e.width+e.x+Graph.minTableColumnWidth,r.setGeometry(t,n))}}finally{r.endUpdate()}}},function(){var t=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){t.apply(this,arguments),this.validEdges=[]};var i=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(t,e){e=null==e||e;var n=this.getState(t);return null!=n&&e&&this.graph.model.isEdge(n.cell)&&null!=n.style&&1!=n.style[mxConstants.STYLE_CURVED]&&!n.invalid&&this.updateLineJumps(n)&&this.graph.cellRenderer.redraw(n,!1,this.isRendering()),null!=(n=i.apply(this,arguments))&&e&&this.graph.model.isEdge(n.cell)&&null!=n.style&&1!=n.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(n),n};var n=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(t,e){return n.apply(this,arguments)||null!=t.routedPoints&&null!=e.routedPoints&&!mxUtils.equalPoints(e.routedPoints,t.routedPoints)};var e=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(t){e.apply(this,arguments),this.graph.model.isEdge(t.cell)&&1!=t.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(t)},mxGraphView.prototype.updateLineJumps=function(l){var t=l.absolutePoints;if(Graph.lineJumpsEnabled){var e=null!=l.routedPoints,s=null;if(null!=t&&null!=this.validEdges&&"none"!==mxUtils.getValue(l.style,"jumpStyle","none")){var n=.5*this.scale;function i(t,e,n){var i=new mxPoint(e,n);i.type=t,s.push(i);i=null!=l.routedPoints?l.routedPoints[s.length-1]:null;return null==i||i.type!=t||i.x!=e||i.y!=n}e=!1,s=[];for(var o=0;o<t.length-1;o++){for(var r=t[o+1],a=t[o],h=[],d=t[o+2];o<t.length-2&&mxUtils.ptSegDistSq(a.x,a.y,d.x,d.y,r.x,r.y)<+this.scale*this.scale;)r=d,d=t[++o+2];e=i(0,a.x,a.y)||e;for(var u=0;u<this.validEdges.length;u++){var p=this.validEdges[u],m=p.absolutePoints;if(null!=m&&mxUtils.intersects(l,p)&&"1"!=p.style.noJump)for(var c=0;c<m.length-1;c++){for(var g=m[c+1],x=m[c],d=m[c+2];c<m.length-2&&mxUtils.ptSegDistSq(x.x,x.y,d.x,d.y,g.x,g.y)<+this.scale*this.scale;)g=d,d=m[++c+2];if(null!=(E=mxUtils.intersection(a.x,a.y,r.x,r.y,x.x,x.y,g.x,g.y))&&(Math.abs(E.x-a.x)>n||Math.abs(E.y-a.y)>n)&&(Math.abs(E.x-r.x)>n||Math.abs(E.y-r.y)>n)&&(Math.abs(E.x-x.x)>n||Math.abs(E.y-x.y)>n)&&(Math.abs(E.x-g.x)>n||Math.abs(E.y-g.y)>n)){for(var y=E.x-a.x,f=E.y-a.y,C={distSq:y*y+f*f,x:E.x,y:E.y},v=0;v<h.length;v++)if(h[v].distSq>C.distSq){h.splice(v,0,C),C=null;break}null==C||0!=h.length&&h[h.length-1].x===C.x&&h[h.length-1].y===C.y||h.push(C)}}}for(c=0;c<h.length;c++)e=i(1,h[c].x,h[c].y)||e}var E,e=i(0,(E=t[t.length-1]).x,E.y)||e}return l.routedPoints=s,e}return!1};var y=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(t,e,n){if(this.routedPoints=null!=this.state?this.state.routedPoints:null,this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)y.apply(this,arguments);else{var i=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,l=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,s=mxUtils.getValue(this.style,"jumpStyle","none"),o=!0,r=null,a=null,h=[],d=null;t.begin();for(var u=0;u<this.state.routedPoints.length;u++){var p=this.state.routedPoints[u],m=new mxPoint(p.x/this.scale,p.y/this.scale);0==u?m=e[0]:u==this.state.routedPoints.length-1&&(m=e[e.length-1]);var c,g,x=!1;null!=r&&1==p.type?(g=(c=(g=this.state.routedPoints[u+1]).x/this.scale-m.x)*c+(p=g.y/this.scale-m.y)*p,null==d&&(d=new mxPoint(m.x-r.x,m.y-r.y),0<(a=Math.sqrt(d.x*d.x+d.y*d.y))?(d.x=d.x*l/a,d.y=d.y*l/a):d=null),l*l<g&&0<a&&l*l<(g=(c=r.x-m.x)*c+(p=r.y-m.y)*p)&&(c=new mxPoint(m.x-d.x,m.y-d.y),p=new mxPoint(m.x+d.x,m.y+d.y),h.push(c),this.addPoints(t,h,n,i,!1,null,o),g=Math.round(d.x)<0||0==Math.round(d.x)&&Math.round(d.y)<=0?1:-1,o=!1,"sharp"==s?(t.lineTo(c.x-d.y*g,c.y+d.x*g),t.lineTo(p.x-d.y*g,p.y+d.x*g),t.lineTo(p.x,p.y)):"arc"==s?(g*=1.3,t.curveTo(c.x-d.y*g,c.y+d.x*g,p.x-d.y*g,p.y+d.x*g,p.x,p.y)):(t.moveTo(p.x,p.y),o=!0),h=[p],x=!0)):d=null,x||(h.push(m),r=m)}this.addPoints(t,h,n,i,!1,null,o),t.stroke()}};var u=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(t,e,n,i){var l,s,o,r,a,h,d;null==e||null==t||"1"!=e.style.snapToPoint&&"1"!=t.style.snapToPoint?u.apply(this,arguments):(e=this.getTerminalPort(t,e,i),r=this.getNextPoint(t,n,i),l=this.graph.isOrthogonal(t),s=mxUtils.toRadians(Number(e.style[mxConstants.STYLE_ROTATION]||"0")),o=new mxPoint(e.getCenterX(),e.getCenterY()),0!=s&&(a=Math.cos(-s),h=Math.sin(-s),r=mxUtils.getRotatedPoint(r,a,h,o)),d=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0),d+=parseFloat(t.style[i?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0),d=this.getPerimeterPoint(e,r,0==s&&l,d),0!=s&&(a=Math.cos(s),h=Math.sin(s),d=mxUtils.getRotatedPoint(d,a,h,o)),t.setAbsoluteTerminalPoint(this.snapToAnchorPoint(t,e,n,i,d),i))},mxGraphView.prototype.snapToAnchorPoint=function(t,e,n,i,l){if(null!=e&&null!=t){var s=this.graph.getAllConnectionConstraints(e),o=null,r=null;if(null!=s)for(var a=0;a<s.length;a++){var h,d=this.graph.getConnectionPoint(e,s[a]);null!=d&&(h=(d.x-l.x)*(d.x-l.x)+(d.y-l.y)*(d.y-l.y),(null==r||h<r)&&(o=d,r=h))}null!=o&&(l=o)}return l};var l=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(t,e,n){var i=l.apply(this,arguments);return"1"==t.getAttribute("placeholders")&&null!=n.state&&(i=n.state.view.graph.replacePlaceholders(n.state.cell,i)),i};var s=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(t){if(null!=t.style&&"undefined"!=typeof pako){var e=mxUtils.getValue(t.style,mxConstants.STYLE_SHAPE,null);if(null!=e&&"string"==typeof e&&"stencil("==e.substring(0,8))try{var n=e.substring(8,e.length-1);return new mxShape(new mxStencil(mxUtils.parseXml(Graph.decompress(n)).documentElement))}catch(t){null!=window.console&&console.log("Error in shape: "+t)}}return s.apply(this,arguments)}}(),mxStencilRegistry.libraries={},mxStencilRegistry.dynamicLoading=!0,mxStencilRegistry.allowEval=!0,mxStencilRegistry.packages=[],mxStencilRegistry.getStencil=function(t){var e=mxStencilRegistry.stencils[t];if(null==e&&null==mxCellRenderer.defaultShapes[t]&&mxStencilRegistry.dynamicLoading){var n=mxStencilRegistry.getBasenameForStencil(t);if(null!=n){var i=mxStencilRegistry.libraries[n];if(null!=i){if(null==mxStencilRegistry.packages[n]){for(var l=0;l<i.length;l++){var s,o=i[l];if(".xml"==o.toLowerCase().substring(o.length-4,o.length))mxStencilRegistry.loadStencilSet(o,null);else if(".js"==o.toLowerCase().substring(o.length-3,o.length))try{!mxStencilRegistry.allowEval||null!=(s=mxUtils.load(o))&&200<=s.getStatus()&&s.getStatus()<=299&&eval.call(window,s.getText())}catch(t){null!=window.console&&console.log("error in getStencil:",o,t)}}mxStencilRegistry.packages[n]=1}}else n=n.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+n+".xml",null);e=mxStencilRegistry.stencils[t]}}return e},mxStencilRegistry.getBasenameForStencil=function(t){var e=null;if(null!=t&&"string"==typeof t){var n=t.split(".");if(0<n.length&&"mxgraph"==n[0]){e=n[1];for(var i=2;i<n.length-1;i++)e+="/"+n[i]}}return e},mxStencilRegistry.loadStencilSet=function(e,n,t,i){t=null!=t&&t;var l=mxStencilRegistry.packages[e];if(t||null==l){var s=!1;if(null==l)try{if(i)return void mxStencilRegistry.loadStencil(e,mxUtils.bind(this,function(t){null!=t&&null!=t.documentElement&&(mxStencilRegistry.packages[e]=t,s=!0,mxStencilRegistry.parseStencilSet(t.documentElement,n,s))}));l=mxStencilRegistry.loadStencil(e),mxStencilRegistry.packages[e]=l,s=!0}catch(t){null!=window.console&&console.log("error in loadStencilSet:",e,t)}null!=l&&null!=l.documentElement&&mxStencilRegistry.parseStencilSet(l.documentElement,n,s)}},mxStencilRegistry.loadStencil=function(t,e){if(null==e)return mxUtils.load(t).getXml();mxUtils.get(t,mxUtils.bind(this,function(t){e(200<=t.getStatus()&&t.getStatus()<=299?t.getXml():null)}))},mxStencilRegistry.parseStencilSets=function(t){for(var e=0;e<t.length;e++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(t[e]).documentElement)},mxStencilRegistry.parseStencilSet=function(t,e,n){if("stencils"==t.nodeName)for(var i=t.firstChild;null!=i;)"shapes"==i.nodeName&&mxStencilRegistry.parseStencilSet(i,e,n),i=i.nextSibling;else{n=null==n||n;var l,s,o,r=t.firstChild,a="",h=t.getAttribute("name");for(null!=h&&(a=h+".");null!=r;)r.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=(h=r.getAttribute("name"))&&(a=a.toLowerCase(),l=h.replace(/ /g,"_"),n&&mxStencilRegistry.addStencil(a+l.toLowerCase(),new mxStencil(r)),null!=e&&(s=r.getAttribute("w"),o=r.getAttribute("h"),e(a,l,h,s=null==s?80:parseInt(s,10),o=null==o?80:parseInt(o,10)))),r=r.nextSibling}},void 0!==mxVertexHandler&&function(){mxConstants.HANDLE_FILLCOLOR="#29b6f2",mxConstants.HANDLE_STROKECOLOR="#0088cf",mxConstants.VERTEX_SELECTION_COLOR="#00a8ff",mxConstants.OUTLINE_COLOR="#00a8ff",mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff",mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff",mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff",mxConstants.EDGE_SELECTION_COLOR="#00a8ff",mxConstants.DEFAULT_VALID_COLOR="#00a8ff",mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff",mxConstants.GUIDE_COLOR="#0088cf",mxConstants.HIGHLIGHT_OPACITY=30,mxConstants.HIGHLIGHT_SIZE=5,mxEdgeHandler.prototype.snapToTerminals=!0,mxGraphHandler.prototype.guidesEnabled=!0,mxGraphHandler.prototype.removeEmptyParents=!0,mxRubberband.prototype.fadeOut=!0,mxGuide.prototype.isEnabledForEvent=function(t){return!mxEvent.isAltDown(t)};var e=mxGraphLayout.prototype.isVertexIgnored;mxGraphLayout.prototype.isVertexIgnored=function(t){return e.apply(this,arguments)||this.graph.isTableRow(t)||this.graph.isTableCell(t)};var n=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(t){return this.graph.isCloneEvent(t)||n.apply(this,arguments)},mxConstraintHandler.prototype.createHighlightShape=function(){var t=new mxEllipse(null,this.highlightColor,this.highlightColor,0);return t.opacity=mxConstants.HIGHLIGHT_OPACITY,t},mxConnectionHandler.prototype.livePreview=!0,mxConnectionHandler.prototype.cursor="crosshair",mxConnectionHandler.prototype.createEdgeState=function(t){var e,n=this.graph.createCurrentEdgeStyle(),n=this.graph.createEdge(null,null,null,null,null,n),i=new mxCellState(this.graph.view,n,this.graph.getCellStyle(n));for(e in this.graph.currentEdgeStyle)i.style[e]=this.graph.currentEdgeStyle[e];return i};var i=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var t=i.apply(this,arguments);return t.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED],t},mxConnectionHandler.prototype.updatePreview=function(t){};var l=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var t=l.apply(this,arguments),n=t.getCell;return t.getCell=mxUtils.bind(this,function(t){var e=n.apply(this,arguments);return this.error=null,e}),t},Graph.prototype.defaultVertexStyle={},Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"},Graph.prototype.createCurrentEdgeStyle=function(){for(var t="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";",e=["shape","curved","rounded","comic","sketch","fillWeight","hachureGap","hachureAngle","jiggle","disableMultiStroke","disableMultiStrokeFill","fillStyle","curveFitting","simplification","comicStyle","jumpStyle","jumpSize"],n=0;n<e.length;n++)null!=this.currentEdgeStyle[e[n]]&&(t+=e[n]+"="+this.currentEdgeStyle[e[n]]+";");return null!=this.currentEdgeStyle.orthogonalLoop?t+="orthogonalLoop="+this.currentEdgeStyle.orthogonalLoop+";":null!=Graph.prototype.defaultEdgeStyle.orthogonalLoop&&(t+="orthogonalLoop="+Graph.prototype.defaultEdgeStyle.orthogonalLoop+";"),null!=this.currentEdgeStyle.jettySize?t+="jettySize="+this.currentEdgeStyle.jettySize+";":null!=Graph.prototype.defaultEdgeStyle.jettySize&&(t+="jettySize="+Graph.prototype.defaultEdgeStyle.jettySize+";"),"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(t+="elbow="+this.currentEdgeStyle.elbow+";"),null!=this.currentEdgeStyle.html?t+="html="+this.currentEdgeStyle.html+";":t+="html=1;",t},Graph.prototype.updateCellStyles=function(t,e,n){this.model.beginUpdate();try{for(var i,l=0;l<n.length;l++)(this.model.isVertex(n[l])||this.model.isEdge(n[l]))&&(this.setCellStyles(t,null,[n[l]]),e!=(null==(i=this.getCellStyle(n[l])[t])?mxConstants.NONE:i)&&this.setCellStyles(t,e,[n[l]]))}finally{this.model.endUpdate()}},Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)},Graph.prototype.loadStylesheet=function(){var t=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=t&&new mxCodec(t.ownerDocument).decode(t,this.getStylesheet())},Graph.prototype.createCellLookup=function(t,e){e=null!=e?e:new Object;for(var n=0;n<t.length;n++){var i=t[n];e[mxObjectIdentity.get(i)]=i.getId();for(var l=this.model.getChildCount(i),s=0;s<l;s++)this.createCellLookup([this.model.getChildAt(i,s)],e)}return e},Graph.prototype.createCellMapping=function(t,e,n){for(var i in n=null!=n?n:new Object,t){var l=e[i];null==n[l]&&(n[l]=t[i].getId()||"")}return n},Graph.prototype.importGraphModel=function(t,e,n,i){e=null!=e?e:0,n=null!=n?n:0;var l=new mxCodec(t.ownerDocument),s=new mxGraphModel;l.decode(t,s);var o=[],r=new Object,a=new Object;if(null!=(u=s.getChildren(this.cloneCell(s.root,this.isCloneInvalidEdges(),r)))){var h,d=this.createCellLookup([s.root]),u=u.slice();this.model.beginUpdate();try{if(1!=u.length||this.isCellLocked(this.getDefaultParent()))for(var p,m=0;m<u.length;m++)null!=(p=this.model.getChildren(this.moveCells([u[m]],e,n,!1,this.model.getRoot())[0]))&&(o=o.concat(p));else null!=(p=s.getChildren(u[0]))&&(o=this.moveCells(p,e,n,!1,this.getDefaultParent()),a[s.getChildAt(s.root,0).getId()]=this.getDefaultParent().getId());null!=o&&(this.createCellMapping(r,d,a),this.updateCustomLinks(a,o),i&&(this.isGridEnabled()&&(e=this.snap(e),n=this.snap(n)),null!=(h=this.getBoundingBoxFromGeometry(o,!0))&&this.moveCells(o,e-h.x,n-h.y)))}finally{this.model.endUpdate()}}return o},Graph.prototype.encodeCells=function(t){for(var e=new Object,n=this.cloneCells(t,null,e),i=new mxDictionary,l=0;l<t.length;l++)i.put(t[l],!0);for(var s=new mxCodec,o=new mxGraphModel,r=o.getChildAt(o.getRoot(),0),l=0;l<n.length;l++){o.add(r,n[l]);var a,h=this.view.getState(t[l]);null==h||null!=(a=this.getCellGeometry(n[l]))&&a.relative&&!this.model.isEdge(t[l])&&null==i.get(this.model.getParent(t[l]))&&(a.offset=null,a.relative=!1,a.x=h.x/h.view.scale-h.view.translate.x,a.y=h.y/h.view.scale-h.view.translate.y)}return this.updateCustomLinks(this.createCellMapping(e,this.createCellLookup(t)),n),s.encode(o)},Graph.prototype.isSwimlane=function(t,e){if(null==t||this.model.getParent(t)==this.model.getRoot()||this.model.isEdge(t))return!1;e=this.getCurrentCellStyle(t,e)[mxConstants.STYLE_SHAPE];return e==mxConstants.SHAPE_SWIMLANE||"table"==e};var s=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(t){var e=this.model.getParent(t);if(null!=e){var n=this.getCurrentCellStyle(e);if(null!=n.expand)return"0"!=n.expand}return s.apply(this,arguments)&&(null==e||!this.isTable(e))};var a=Graph.prototype.splitEdge;Graph.prototype.splitEdge=function(t,e,n,i,l,s,o,r){null==r&&(r=this.model.getParent(t),(this.isTable(r)||this.isTableRow(r))&&(r=this.getCellAt(s,o,null,!0,!1))),a.apply(this,[t,e,n,i,l,s,o,r])};var r=Graph.prototype.selectCell;Graph.prototype.selectCell=function(n,t,e){var i,l,s,o;t||e?r.apply(this,arguments):(i=this.getSelectionCell(),l=null,s=[],(o=mxUtils.bind(this,function(t){if(null!=this.view.getState(t)&&(this.model.isVertex(t)||this.model.isEdge(t)))if(s.push(t),t==i)l=s.length-1;else if(n&&null==i&&0<s.length||null!=l&&n&&s.length>l||!n&&0<l)return;for(var e=0;e<this.model.getChildCount(t);e++)o(this.model.getChildAt(t,e))}))(this.model.root),0<s.length&&(l=null!=l?mxUtils.mod(l+(n?1:-1),s.length):0,this.setSelectionCell(s[l])))};var S=Graph.prototype.moveCells;Graph.prototype.moveCells=function(t,e,n,i,l,s,o){if(o=null!=o?o:new Object,this.isTable(l)){for(var r=[],a=0;a<t.length;a++)this.isTable(t[a])?r=r.concat(this.model.getChildCells(t[a],!0).reverse()):r.push(t[a]);t=r}this.model.beginUpdate();try{for(var h=[],a=0;a<t.length;a++)if(null!=l&&this.isTableRow(t[a])){var d,u=this.model.getParent(t[a]),p=this.getCellGeometry(t[a]);if(this.isTable(u)&&h.push(u),null!=u&&null!=p&&this.isTable(u)&&this.isTable(l)&&(i||u!=l)){i||null!=(d=this.getCellGeometry(u))&&((d=d.clone()).height-=p.height,this.model.setGeometry(u,d)),null!=(d=this.getCellGeometry(l))&&((d=d.clone()).height+=p.height,this.model.setGeometry(l,d));p=this.model.getChildCells(l,!0);if(0<p.length){var m=i?this.cloneCell(t[a]):t[a],c=this.model.getChildCells(m,!0),g=this.model.getChildCells(p[0],!0),x=g.length-c.length;if(0<x)for(var y=0;y<x;y++){var f=this.cloneCell(c[c.length-1]);null!=f&&(f.value="",this.model.add(m,f))}else if(x<0)for(y=0;x<y;y--)this.model.remove(c[c.length+y-1]);c=this.model.getChildCells(m,!0);for(y=0;y<g.length;y++){var C=this.getCellGeometry(g[y]),v=this.getCellGeometry(c[y]);null!=C&&null!=v&&((v=v.clone()).width=C.width,this.model.setGeometry(c[y],v))}}}}for(var E=S.apply(this,arguments),a=0;a<h.length;a++)!i&&this.model.contains(h[a])&&0==this.model.getChildCount(h[a])&&this.model.remove(h[a]);i&&this.updateCustomLinks(this.createCellMapping(o,this.createCellLookup(t)),E)}finally{this.model.endUpdate()}return E};var h=Graph.prototype.removeCells;Graph.prototype.removeCells=function(t,e){var n=[];this.model.beginUpdate();try{for(var i=0;i<t.length;i++)if(this.isTableCell(t[i])){var l=this.model.getParent(t[i]),s=this.model.getParent(l);1==this.model.getChildCount(l)&&1==this.model.getChildCount(s)?mxUtils.indexOf(t,s)<0&&mxUtils.indexOf(n,s)<0&&n.push(s):this.labelChanged(t[i],"")}else{if(this.isTableRow(t[i])){s=this.model.getParent(t[i]);if(mxUtils.indexOf(t,s)<0&&mxUtils.indexOf(n,s)<0){for(var o=this.model.getChildCells(s,!0),r=0,a=0;a<o.length;a++)0<=mxUtils.indexOf(t,o[a])&&r++;r==o.length&&n.push(s)}}n.push(t[i])}n=h.apply(this,[n,e])}finally{this.model.endUpdate()}return n},Graph.prototype.updateCustomLinks=function(t,e){for(var n=0;n<e.length;n++)null!=e[n]&&this.updateCustomLinksForCell(t,e[n])},Graph.prototype.updateCustomLinksForCell=function(t,e){},Graph.prototype.getAllConnectionConstraints=function(t,e){if(null!=t){var n=mxUtils.getValue(t.style,"points",null);if(null!=n){var i=[];try{for(var l=JSON.parse(n),s=0;s<l.length;s++){var o=l[s];i.push(new mxConnectionConstraint(new mxPoint(o[0],o[1]),!(2<o.length)||"0"!=o[2],null,3<o.length?o[3]:0,4<o.length?o[4]:0))}}catch(t){}return i}if(null!=t.shape&&null!=t.shape.bounds){var r=t.shape.direction,a=t.shape.bounds,h=t.shape.scale,d=a.width/h,h=a.height/h;if(r!=mxConstants.DIRECTION_NORTH&&r!=mxConstants.DIRECTION_SOUTH||(o=d,d=h,h=o),null!=(n=t.shape.getConstraints(t.style,d,h)))return n;if(null!=t.shape.stencil&&null!=t.shape.stencil.constraints)return t.shape.stencil.constraints;if(null!=t.shape.constraints)return t.shape.constraints}}return null},Graph.prototype.flipEdge=function(t){var e;null!=t&&(e=this.getCurrentCellStyle(t),e=mxUtils.getValue(e,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL,this.setCellStyles(mxConstants.STYLE_ELBOW,e,[t]))},Graph.prototype.isValidRoot=function(t){for(var e=this.model.getChildCount(t),n=0,i=0;i<e;i++){var l=this.model.getChildAt(t,i);this.model.isVertex(l)&&(null==(l=this.getCellGeometry(l))||l.relative||n++)}return 0<n||this.isContainer(t)},Graph.prototype.isValidDropTarget=function(t,e,n){for(var i=this.getCurrentCellStyle(t),l=!0,s=!0,o=0;o<e.length&&s;o++)l=l&&this.isTable(e[o]),s=s&&this.isTableRow(e[o]);return("1"!=mxUtils.getValue(i,"part","0")||this.isContainer(t))&&"0"!=mxUtils.getValue(i,"dropTarget","1")&&(mxGraph.prototype.isValidDropTarget.apply(this,arguments)||this.isContainer(t))&&!this.isTableRow(t)&&(!this.isTable(t)||s||l)},Graph.prototype.createGroupCell=function(){var t=mxGraph.prototype.createGroupCell.apply(this,arguments);return t.setStyle("group"),t},Graph.prototype.isExtendParentsOnAdd=function(t){var e,n=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);return n&&null!=t&&null!=this.layoutManager&&(null==(e=this.model.getParent(t))||null!=(e=this.layoutManager.getLayout(e))&&e.constructor==mxStackLayout&&(n=!1)),n},Graph.prototype.getPreferredSizeForCell=function(t){var e=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);return null!=e&&(e.width+=10,e.height+=4,this.gridEnabled&&(e.width=this.snap(e.width),e.height=this.snap(e.height))),e},Graph.prototype.turnShapes=function(t,e){var n=this.getModel(),i=[];n.beginUpdate();try{for(var l=0;l<t.length;l++){var s,o,r,a,h,d,u,p,m=t[l];n.isEdge(m)?(s=n.getTerminal(m,!0),o=n.getTerminal(m,!1),n.setTerminal(m,o,!0),n.setTerminal(m,s,!1),null!=(d=n.getGeometry(m))&&(null!=(d=d.clone()).points&&d.points.reverse(),a=d.getTerminalPoint(!0),h=d.getTerminalPoint(!1),d.setTerminalPoint(a,!1),d.setTerminalPoint(h,!0),n.setGeometry(m,d),r=this.view.getState(m),a=this.view.getState(s),h=this.view.getState(o),null!=r&&(p=null!=a?this.getConnectionConstraint(r,a,!0):null,h=null!=h?this.getConnectionConstraint(r,h,!1):null,this.setConnectionConstraint(m,s,!0,h),this.setConnectionConstraint(m,o,!1,p)),i.push(m))):n.isVertex(m)&&null!=(d=this.getCellGeometry(m))&&(this.isTable(m)||this.isTableRow(m)||this.isTableCell(m)||this.isSwimlane(m)||((d=d.clone()).x+=d.width/2-d.height/2,d.y+=d.height/2-d.width/2,u=d.width,d.width=d.height,d.height=u,n.setGeometry(m,d)),null!=(p=this.view.getState(m))&&(u=[mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_NORTH],p=mxUtils.getValue(p.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),this.setCellStyles(mxConstants.STYLE_DIRECTION,u[mxUtils.mod(mxUtils.indexOf(u,p)+(e?-1:1),u.length)],[m])),i.push(m))}}finally{n.endUpdate()}return i},Graph.prototype.stencilHasPlaceholders=function(t){if(null!=t&&null!=t.fgNode)for(var e=t.fgNode.firstChild;null!=e;){if("text"==e.nodeName&&"1"==e.getAttribute("placeholders"))return!0;e=e.nextSibling}return!1};var o=Graph.prototype.processChange;Graph.prototype.processChange=function(t){var e,n;t instanceof mxGeometryChange&&(this.isTableCell(t.cell)||this.isTableRow(t.cell))&&(null==t.previous&&null!=t.geometry||null!=t.previous&&!t.previous.equals(t.geometry))&&(e=t.cell,this.isTableCell(e)&&(e=this.model.getParent(e)),this.isTableRow(e)&&(e=this.model.getParent(e)),null!=(n=this.view.getState(e))&&null!=n.shape&&(this.view.invalidate(e),n.shape.bounds=null)),o.apply(this,arguments),t instanceof mxValueChange&&null!=t.cell&&null!=t.cell.value&&"object"==typeof t.cell.value&&this.invalidateDescendantsWithPlaceholders(t.cell)},Graph.prototype.invalidateDescendantsWithPlaceholders=function(t){var e=this.model.getDescendants(t);if(0<e.length)for(var n=0;n<e.length;n++){var i=this.view.getState(e[n]);null!=i&&null!=i.shape&&null!=i.shape.stencil&&this.stencilHasPlaceholders(i.shape.stencil)?this.removeStateForCell(e[n]):this.isReplacePlaceholders(e[n])&&this.view.invalidate(e[n],!1,!1)}},Graph.prototype.replaceElement=function(t,e){for(var n=t.ownerDocument.createElement(null!=e?e:"span"),i=Array.prototype.slice.call(t.attributes);attr=i.pop();)n.setAttribute(attr.nodeName,attr.nodeValue);n.innerHTML=t.innerHTML,t.parentNode.replaceChild(n,t)},Graph.prototype.processElements=function(t,e){if(null!=t)for(var n=t.getElementsByTagName("*"),i=0;i<n.length;i++)e(n[i])},Graph.prototype.updateLabelElements=function(t,e,n){t=null!=t?t:this.getSelectionCells();for(var i=document.createElement("div"),l=0;l<t.length;l++)if(this.isHtmlLabel(t[l])){var s=this.convertValueToString(t[l]);if(null!=s&&0<s.length){i.innerHTML=s;for(var o=i.getElementsByTagName(null!=n?n:"*"),r=0;r<o.length;r++)e(o[r]);i.innerHTML!=s&&this.cellLabelChanged(t[l],i.innerHTML)}}},Graph.prototype.cellLabelChanged=function(t,e,n){e=Graph.zapGremlins(e),this.model.beginUpdate();try{if(null!=t.value&&"object"==typeof t.value){if(this.isReplacePlaceholders(t)&&null!=t.getAttribute("placeholder"))for(var i=t.getAttribute("placeholder"),l=t;null!=l;){if(l==this.model.getRoot()||null!=l.value&&"object"==typeof l.value&&l.hasAttribute(i)){this.setAttributeForCell(l,i,e);break}l=this.model.getParent(l)}var s=t.value.cloneNode(!0);Graph.translateDiagram&&null!=Graph.diagramLanguage&&s.hasAttribute("label_"+Graph.diagramLanguage)?s.setAttribute("label_"+Graph.diagramLanguage,e):s.setAttribute("label",e),e=s}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}},Graph.prototype.cellsRemoved=function(t){if(null!=t){for(var e=new mxDictionary,n=0;n<t.length;n++)e.put(t[n],!0);for(var i=[],n=0;n<t.length;n++){var l=this.model.getParent(t[n]);null==l||e.get(l)||(e.put(l,!0),i.push(l))}for(n=0;n<i.length;n++){var s=this.view.getState(i[n]);if(null!=s&&(this.model.isEdge(s.cell)||this.model.isVertex(s.cell))&&this.isCellDeletable(s.cell)&&this.isTransparentState(s)){for(var o=!0,r=0;r<this.model.getChildCount(s.cell)&&o;r++)e.get(this.model.getChildAt(s.cell,r))||(o=!1);o&&t.push(s.cell)}}}mxGraph.prototype.cellsRemoved.apply(this,arguments)},Graph.prototype.removeCellsAfterUngroup=function(t){for(var e=[],n=0;n<t.length;n++)this.isCellDeletable(t[n])&&this.isTransparentState(this.view.getState(t[n]))&&e.push(t[n]);t=e,mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)},Graph.prototype.setLinkForCell=function(t,e){this.setAttributeForCell(t,"link",e)},Graph.prototype.setTooltipForCell=function(t,e){var n="tooltip";Graph.translateDiagram&&null!=Graph.diagramLanguage&&mxUtils.isNode(t.value)&&t.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(n="tooltip_"+Graph.diagramLanguage),this.setAttributeForCell(t,n,e)},Graph.prototype.getAttributeForCell=function(t,e,n){e=null!=t.value&&"object"==typeof t.value?t.value.getAttribute(e):null;return null!=e?e:n},Graph.prototype.setAttributeForCell=function(t,e,n){var i=null;null!=t.value&&"object"==typeof t.value?i=t.value.cloneNode(!0):(i=mxUtils.createXmlDocument().createElement("UserObject")).setAttribute("label",t.value||""),null!=n?i.setAttribute(e,n):i.removeAttribute(e),this.model.setValue(t,i)};var d=Graph.prototype.getDropTarget;Graph.prototype.getDropTarget=function(t,e,n,i){this.getModel();if(mxEvent.isAltDown(e))return null;for(var l=0;l<t.length;l++)if(this.model.isEdge(this.model.getParent(t[l])))return null;for(var s=d.apply(this,arguments),o=!0,l=0;l<t.length&&o;l++)o=o&&this.isTableRow(t[l]);return o&&(this.isTableCell(s)&&(s=this.model.getParent(s)),this.isTableRow(s)&&(s=this.model.getParent(s)),this.isTable(s)||(s=null)),s},Graph.prototype.click=function(t){mxGraph.prototype.click.call(this,t),this.firstClickState=t.getState(),this.firstClickSource=t.getSource()},Graph.prototype.dblClick=function(t,e){this.isEnabled()&&(e=this.insertTextForEvent(t,e),mxGraph.prototype.dblClick.call(this,t,e))},Graph.prototype.insertTextForEvent=function(t,e){var n,i,l=mxUtils.convertPoint(this.container,mxEvent.getClientX(t),mxEvent.getClientY(t));return null==t||this.model.isVertex(e)||(n=this.model.isEdge(e)?this.view.getState(e):null,i=mxEvent.getSource(t),this.firstClickState!=n||this.firstClickSource!=i||null!=n&&null!=n.text&&null!=n.text.node&&null!=n.text.boundingBox&&(mxUtils.contains(n.text.boundingBox,l.x,l.y)||mxUtils.isAncestorNode(n.text.node,mxEvent.getSource(t)))||(null!=n||this.isCellLocked(this.getDefaultParent()))&&(null==n||this.isCellLocked(n.cell))||!(null!=n||mxClient.IS_VML&&i==this.view.getCanvas()||mxClient.IS_SVG&&i==this.view.getCanvas().ownerSVGElement)||(null==n&&(n=this.view.getState(this.getCellAt(l.x,l.y))),e=this.addText(l.x,l.y,n))),e},Graph.prototype.getInsertPoint=function(){var t,e,n=this.getGridSize(),i=this.container.scrollLeft/this.view.scale-this.view.translate.x,l=this.container.scrollTop/this.view.scale-this.view.translate.y;return this.pageVisible&&(t=this.getPageLayout(),e=this.getPageSize(),i=Math.max(i,t.x*e.width),l=Math.max(l,t.y*e.height)),new mxPoint(this.snap(i+n),this.snap(l+n))},Graph.prototype.getFreeInsertPoint=function(){var t=this.view,e=this.getGraphBounds(),n=this.getInsertPoint();return new mxPoint(this.snap(Math.round(Math.max(n.x,e.x/t.scale-t.translate.x+(0==e.width?2*this.gridSize:0)))),this.snap(Math.round(Math.max(n.y,(e.y+e.height)/t.scale-t.translate.y+2*this.gridSize))))},Graph.prototype.getCenterInsertPoint=function(t){return t=null!=t?t:new mxRectangle,mxUtils.hasScrollbars(this.container)?new mxPoint(this.snap(Math.round((this.container.scrollLeft+this.container.clientWidth/2)/this.view.scale-this.view.translate.x-t.width/2)),this.snap(Math.round((this.container.scrollTop+this.container.clientHeight/2)/this.view.scale-this.view.translate.y-t.height/2))):new mxPoint(this.snap(Math.round(this.container.clientWidth/2/this.view.scale-this.view.translate.x-t.width/2)),this.snap(Math.round(this.container.clientHeight/2/this.view.scale-this.view.translate.y-t.height/2)))},Graph.prototype.isMouseInsertPoint=function(){return!1},Graph.prototype.addText=function(t,e,n){var i=new mxCell;i.value="Text",i.geometry=new mxGeometry(0,0,0,0),i.vertex=!0;var l,s,o="html=1;align=center;verticalAlign=middle;resizable=0;points=[];";null!=n&&this.model.isEdge(n.cell)?(i.style="edgeLabel;"+o,i.geometry.relative=!0,i.connectable=!1,l=this.view.getRelativePoint(n,t,e),i.geometry.x=Math.round(1e4*l.x)/1e4,i.geometry.y=Math.round(l.y),i.geometry.offset=new mxPoint(0,0),l=this.view.getPoint(n,i.geometry),s=this.view.scale,i.geometry.offset=new mxPoint(Math.round((t-l.x)/s),Math.round((e-l.y)/s))):(s=this.view.translate,i.style="text;"+o,i.geometry.width=40,i.geometry.height=20,i.geometry.x=Math.round(t/this.view.scale)-s.x-(null!=n?n.origin.x:0),i.geometry.y=Math.round(e/this.view.scale)-s.y-(null!=n?n.origin.y:0),i.style+="autosize=1;"),this.getModel().beginUpdate();try{this.addCells([i],null!=n?n.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[i])),this.autoSizeCell(i)}finally{this.getModel().endUpdate()}return i},Graph.prototype.addClickHandler=function(t,s,o){var e=mxUtils.bind(this,function(){var t=this.container.getElementsByTagName("a");if(null!=t)for(var e=0;e<t.length;e++){var n=this.getAbsoluteUrl(t[e].getAttribute("href"));null!=n&&(t[e].setAttribute("rel",this.linkRelation),t[e].setAttribute("href",n),null!=s&&mxEvent.addGestureListeners(t[e],null,null,s))}});this.model.addListener(mxEvent.CHANGE,e),e();var n=this.container.style.cursor,r=this.getTolerance(),a=this,i={currentState:null,currentLink:null,highlight:null!=t&&""!=t&&t!=mxConstants.NONE?new mxCellHighlight(a,t,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(t){var e=t.sourceState;null!=e&&null!=a.getLinkForCell(e.cell)||(t=a.getCellAt(t.getGraphX(),t.getGraphY(),null,null,null,function(t,e,n){return null==a.getLinkForCell(t.cell)}),e=a.view.getState(t)),e!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=e,null!=this.currentState&&this.activate(this.currentState))},mouseDown:function(t,e){this.startX=e.getGraphX(),this.startY=e.getGraphY(),this.scrollLeft=a.container.scrollLeft,this.scrollTop=a.container.scrollTop,null==this.currentLink&&"auto"==a.container.style.overflow&&(a.container.style.cursor="move"),this.updateCurrentState(e)},mouseMove:function(t,e){if(a.isMouseDown){var n,i;null!=this.currentLink&&(n=Math.abs(this.startX-e.getGraphX()),i=Math.abs(this.startY-e.getGraphY()),(r<n||r<i)&&this.clear())}else{for(var l=e.getSource();null!=l&&"a"!=l.nodeName.toLowerCase();)l=l.parentNode;null!=l?this.clear():(null!=a.tooltipHandler&&null!=this.currentLink&&null!=this.currentState&&a.tooltipHandler.reset(e,!0,this.currentState),null!=this.currentState&&(e.getState()==this.currentState||null==e.sourceState)&&a.intersects(this.currentState,e.getGraphX(),e.getGraphY())||this.updateCurrentState(e))}},mouseUp:function(t,e){for(var n=e.getSource(),i=e.getEvent(),l=n;null!=l&&"a"!=l.nodeName.toLowerCase();)l=l.parentNode;null==l&&Math.abs(this.scrollLeft-a.container.scrollLeft)<r&&Math.abs(this.scrollTop-a.container.scrollTop)<r&&(null==e.sourceState||!e.isSource(e.sourceState.control))&&((mxEvent.isLeftMouseButton(i)||mxEvent.isMiddleMouseButton(i))&&!mxEvent.isPopupTrigger(i)||mxEvent.isTouchEvent(i))&&(null!=this.currentLink?(n=a.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&n||null==s||s(i,this.currentLink),mxEvent.isConsumed(i)||(n=mxEvent.isMiddleMouseButton(i)?"_blank":n?a.linkTarget:"_top",a.openLink(this.currentLink,n),e.consume())):null!=o&&!e.isConsumed()&&Math.abs(this.scrollLeft-a.container.scrollLeft)<r&&Math.abs(this.scrollTop-a.container.scrollTop)<r&&Math.abs(this.startX-e.getGraphX())<r&&Math.abs(this.startY-e.getGraphY())<r&&o(e.getEvent())),this.clear()},activate:function(t){this.currentLink=a.getAbsoluteUrl(a.getLinkForCell(t.cell)),null!=this.currentLink&&(a.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(t))},clear:function(){null!=a.container&&(a.container.style.cursor=n),this.currentState=null,(this.currentLink=null)!=this.highlight&&this.highlight.hide(),null!=a.tooltipHandler&&a.tooltipHandler.hide()}};a.click=function(t){},a.addMouseListener(i),mxEvent.addListener(document,"mouseleave",function(t){i.clear()})},Graph.prototype.duplicateCells=function(t,e){t=null!=t?t:this.getSelectionCells(),e=null==e||e;for(var n=0;n<t.length;n++)this.isTableCell(t[n])&&(t[n]=this.model.getParent(t[n]));t=this.model.getTopmostCells(t);var i=this.getModel(),l=this.gridSize,s=[];i.beginUpdate();try{for(var o=this.cloneCells(t,!1,null,!0),n=0;n<t.length;n++){var r,a=i.getParent(t[n]),h=this.moveCells([o[n]],l,l,!1)[0];s.push(h),e?i.add(a,o[n]):(r=a.getIndex(t[n]),i.add(a,o[n],r+1)),this.isTable(a)&&(h=this.getCellGeometry(o[n]),r=this.getCellGeometry(a),null!=h&&null!=r&&((r=r.clone()).height+=h.height,i.setGeometry(a,r)))}}finally{i.endUpdate()}return s},Graph.prototype.insertImage=function(t,e,n){if(null!=t&&null!=this.cellEditor.textarea){for(var i=this.cellEditor.textarea.getElementsByTagName("img"),l=[],s=0;s<i.length;s++)l.push(i[s]);document.execCommand("insertimage",!1,t);var o=this.cellEditor.textarea.getElementsByTagName("img");if(o.length==l.length+1)for(s=o.length-1;0<=s;s--)if(0==s||o[s]!=l[s-1]){o[s].setAttribute("width",e),o[s].setAttribute("height",n);break}}},Graph.prototype.insertLink=function(t){if(null!=this.cellEditor.textarea)if(0==t.length)document.execCommand("unlink",!1);else if(mxClient.IS_FF){for(var e=this.cellEditor.textarea.getElementsByTagName("a"),n=[],i=0;i<e.length;i++)n.push(e[i]);document.execCommand("createlink",!1,mxUtils.trim(t));var l=this.cellEditor.textarea.getElementsByTagName("a");if(l.length==n.length+1)for(i=l.length-1;0<=i;i--)if(l[i]!=n[i-1]){for(e=l[i].getElementsByTagName("a");0<e.length;){for(var s=e[0].parentNode;null!=e[0].firstChild;)s.insertBefore(e[0].firstChild,e[0]);s.removeChild(e[0])}break}}else document.execCommand("createlink",!1,mxUtils.trim(t))},Graph.prototype.isCellResizable=function(t){var e=mxGraph.prototype.isCellResizable.apply(this,arguments),n=this.getCurrentCellStyle(t);return!this.isTableCell(t)&&!this.isTableRow(t)&&(e||"0"!=mxUtils.getValue(n,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==n[mxConstants.STYLE_WHITE_SPACE])},Graph.prototype.distributeCells=function(n,t){if(null==t&&(t=this.getSelectionCells()),null!=t&&1<t.length){for(var e,i,l=[],s=null,o=null,r=0;r<t.length;r++)!this.getModel().isVertex(t[r])||null!=(e=this.view.getState(t[r]))&&(i=n?e.getCenterX():e.getCenterY(),s=null!=s?Math.max(s,i):i,o=null!=o?Math.min(o,i):i,l.push(e));if(2<l.length){l.sort(function(t,e){return n?t.x-e.x:t.y-e.y});var a=this.view.translate,h=this.view.scale;o=o/h-(n?a.x:a.y),s=s/h-(n?a.x:a.y),this.getModel().beginUpdate();try{for(var d=(s-o)/(l.length-1),u=o,r=1;r<l.length-1;r++){var p=this.view.getState(this.model.getParent(l[r].cell)),m=this.getCellGeometry(l[r].cell);u+=d,null!=m&&null!=p&&(m=m.clone(),n?m.x=Math.round(u-m.width/2)-p.origin.x:m.y=Math.round(u-m.height/2)-p.origin.y,this.getModel().setGeometry(l[r].cell,m))}}finally{this.getModel().endUpdate()}}}return t},Graph.prototype.isCloneEvent=function(t){return mxClient.IS_MAC&&mxEvent.isMetaDown(t)||mxEvent.isControlDown(t)},Graph.prototype.createSvgImageExport=function(){var t=new mxImageExport;return t.getLinkForCellState=mxUtils.bind(this,function(t,e){return this.getLinkForCell(t.cell)}),t},Graph.prototype.getSvg=function(t,e,n,i,l,s,o,r,a,h){var d=this.useCssTransforms;d&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{e=null!=e?e:1,n=null!=n?n:0,l=null==l||l,o=null==o||o;var u=(s=null==s||s)||i?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==u)throw Error(mxResources.get("drawingEmpty"));var p=this.view.scale,m=mxUtils.createXmlDocument(),c=null!=m.createElementNS?m.createElementNS(mxConstants.NS_SVG,"svg"):m.createElement("svg");null!=t&&(null!=c.style?c.style.backgroundColor=t:c.setAttribute("style","background-color:"+t)),null==m.createElementNS?(c.setAttribute("xmlns",mxConstants.NS_SVG),c.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):c.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);var g=e/p,x=Math.max(1,Math.ceil(u.width*g)+2*n)+(h?5:0),y=Math.max(1,Math.ceil(u.height*g)+2*n)+(h?5:0);c.setAttribute("version","1.1"),c.setAttribute("width",x+"px"),c.setAttribute("height",y+"px"),c.setAttribute("viewBox",(l?"-0.5 -0.5":"0 0")+" "+x+" "+y),m.appendChild(c);x=null!=m.createElementNS?m.createElementNS(mxConstants.NS_SVG,"g"):m.createElement("g");c.appendChild(x);y=this.createSvgCanvas(x);y.foOffset=l?-.5:0,y.textOffset=l?-.5:0,y.imageOffset=l?-.5:0,y.translate(Math.floor((n/e-u.x)/p),Math.floor((n/e-u.y)/p));var f=document.createElement("div"),C=y.getAlternateText;y.getAlternateText=function(t,e,n,i,l,s,o,r,a,h,d,u,p){if(!(null!=s&&0<this.state.fontSize))return C.apply(this,arguments);try{s=mxUtils.isNode(s)?s.innerText:(f.innerHTML=s,mxUtils.extractTextWithWhitespace(f.childNodes));for(var m=Math.ceil(2*i/this.state.fontSize),c=[],g=0,x=0;(0==m||g<m)&&x<s.length;){var y=s.charCodeAt(x);if(10==y||13==y){if(0<g)break}else c.push(s.charAt(x)),y<255&&g++;x++}return c.length<s.length&&1<s.length-c.length&&(s=mxUtils.trim(c.join(""))+"..."),s}catch(t){return C.apply(this,arguments)}};m=this.backgroundImage;null!=m&&(x=p/e,x=new mxRectangle((p=this.view.translate).x*x,p.y*x,m.width*x,m.height*x),mxUtils.intersects(u,x)&&y.image(p.x,p.y,m.width,m.height,m.src,!0)),y.scale(g),y.textEnabled=o;var v=(r=null!=r?r:this.createSvgImageExport()).drawCellState,E=r.getLinkForCellState;return r.getLinkForCellState=function(t,e){var n=E.apply(this,arguments);return null==n||t.view.graph.isCustomLink(n)?null:n},r.drawCellState=function(t,e){for(var n=t.view.graph,i=n.isCellSelected(t.cell),l=n.model.getParent(t.cell);!s&&!i&&null!=l;)i=n.isCellSelected(l),l=n.model.getParent(l);(s||i)&&v.apply(this,arguments)},r.drawState(this.getView().getState(this.model.root),y),this.updateSvgLinks(c,a,!0),this.addForeignObjectWarning(y,c),c}finally{d&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}},Graph.prototype.addForeignObjectWarning=function(t,e){var n,i,l;0<e.getElementsByTagName("foreignObject").length&&(n=t.createElement("switch"),(i=t.createElement("g")).setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility"),(l=t.createElement("a")).setAttribute("transform","translate(0,-5)"),null==l.setAttributeNS||e.ownerDocument!=document&&null==document.documentMode?(l.setAttribute("xlink:href",Graph.foreignObjectWarningLink),l.setAttribute("target","_blank")):(l.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Graph.foreignObjectWarningLink),l.setAttributeNS(mxConstants.NS_XLINK,"target","_blank")),(t=t.createElement("text")).setAttribute("text-anchor","middle"),t.setAttribute("font-size","10px"),t.setAttribute("x","50%"),t.setAttribute("y","100%"),mxUtils.write(t,Graph.foreignObjectWarningText),n.appendChild(i),l.appendChild(t),n.appendChild(l),e.appendChild(n))},Graph.prototype.updateSvgLinks=function(t,e,n){for(var i=t.getElementsByTagName("a"),l=0;l<i.length;l++){var s=i[l].getAttribute("href");null==s&&(s=i[l].getAttribute("xlink:href")),null!=s&&(null!=e&&/^https?:\/\//.test(s)?i[l].setAttribute("target",e):n&&this.isCustomLink(s)&&i[l].setAttribute("href","javascript:void(0);"))}},Graph.prototype.createSvgCanvas=function(t){t=new mxSvgCanvas2D(t);return t.pointerEvents=!0,t},Graph.prototype.getSelectedElement=function(){var t,e=null;return window.getSelection?(t=window.getSelection()).getRangeAt&&t.rangeCount&&(e=t.getRangeAt(0).commonAncestorContainer):document.selection&&(e=document.selection.createRange().parentElement()),e},Graph.prototype.getSelectedEditingElement=function(){for(var t=this.getSelectedElement();null!=t&&t.nodeType!=mxConstants.NODETYPE_ELEMENT;)t=t.parentNode;return null!=t&&t==this.cellEditor.textarea&&1==this.cellEditor.textarea.children.length&&this.cellEditor.textarea.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&(t=this.cellEditor.textarea.firstChild),t},Graph.prototype.getParentByName=function(t,e,n){for(;null!=t;){if(t.nodeName==e)return t;if(t==n)return null;t=t.parentNode}return t},Graph.prototype.getParentByNames=function(t,e,n){for(;null!=t;){if(0<=mxUtils.indexOf(e,t.nodeName))return t;if(t==n)return null;t=t.parentNode}return t},Graph.prototype.selectNode=function(t){var e,n=null;window.getSelection?(n=window.getSelection()).getRangeAt&&n.rangeCount&&((e=document.createRange()).selectNode(t),n.removeAllRanges(),n.addRange(e)):(n=document.selection)&&"Control"!=n.type&&((t=n.createRange()).collapse(!0),(e=n.createRange()).setEndPoint("StartToStart",t),e.select())},Graph.prototype.deleteCells=function(t,e){var n=null;if(null!=t&&0<t.length){this.model.beginUpdate();try{for(var i=0;i<t.length;i++){var l,s,o=this.model.getParent(t[i]);this.isTable(o)&&(l=this.getCellGeometry(t[i]),s=this.getCellGeometry(o),null!=l&&null!=s&&((s=s.clone()).height-=l.height,this.model.setGeometry(o,s)))}var r=this.selectParentAfterDelete?this.model.getParents(t):null;this.removeCells(t,e)}finally{this.model.endUpdate()}if(null!=r){n=[];for(i=0;i<r.length;i++)this.model.contains(r[i])&&(this.model.isVertex(r[i])||this.model.isEdge(r[i]))&&n.push(r[i])}}return n},Graph.prototype.insertTableColumn=function(t,e){var n=this.getModel();n.beginUpdate();try{var i=t,l=0;this.isTableCell(t)?(u=n.getParent(t),i=n.getParent(u),l=mxUtils.indexOf(n.getChildCells(u,!0),t)):(this.isTableRow(t)?i=n.getParent(t):t=n.getChildCells(i,!0)[0],e||(l=n.getChildCells(t,!0).length-1));for(var s=n.getChildCells(i,!0),o=Graph.minTableColumnWidth,r=0;r<s.length;r++){var a=n.getChildCells(s[r],!0)[l],h=n.cloneCell(a,!1),d=this.getCellGeometry(h);(h.value=null)!=d&&(o=d.width,null!=(a=this.getCellGeometry(s[r]))&&(d.height=a.height)),n.add(s[r],h,l+(e?0:1))}var u=this.getCellGeometry(i);null!=u&&((u=u.clone()).width+=o,n.setGeometry(i,u))}finally{n.endUpdate()}},Graph.prototype.insertTableRow=function(t,e){var n=this.getModel();n.beginUpdate();try{var i=t,l=t;this.isTableCell(t)?(l=n.getParent(t),i=n.getParent(l)):this.isTableRow(t)?i=n.getParent(t):l=(o=n.getChildCells(i,!0))[e?0:o.length-1];var s=n.getChildCells(l,!0),o=i.getIndex(l);(l=n.cloneCell(l,!1)).value=null;var r=this.getCellGeometry(l);if(null!=r){for(var a=0;a<s.length;a++){t=n.cloneCell(s[a],!1);l.insert(t),t.value=null;var h=this.getCellGeometry(t);null!=h&&(h.height=r.height)}n.add(i,l,o+(e?0:1));o=this.getCellGeometry(i);null!=o&&((o=o.clone()).height+=r.height,n.setGeometry(i,o))}}finally{n.endUpdate()}},Graph.prototype.deleteTableColumn=function(t){var e=this.getModel();e.beginUpdate();try{var n=t,i=t;this.isTableCell(t)&&(i=e.getParent(t)),this.isTableRow(i)&&(n=e.getParent(i));var l=e.getChildCells(n,!0);if(0==l.length)e.remove(n);else{this.isTableRow(i)||(i=l[0]);i=e.getChildCells(i,!0);if(i.length<=1)e.remove(n);else{var s=i.length-1;this.isTableCell(t)&&(s=mxUtils.indexOf(i,t));for(var o=0,r=0;r<l.length;r++){var a=e.getChildCells(l[r],!0)[s];e.remove(a);a=this.getCellGeometry(a);null!=a&&(o=Math.max(o,a.width))}i=this.getCellGeometry(n);null!=i&&((i=i.clone()).width-=o,e.setGeometry(n,i))}}}finally{e.endUpdate()}},Graph.prototype.deleteTableRow=function(t){var e=this.getModel();e.beginUpdate();try{var n=t,i=t;this.isTableCell(t)&&(t=i=e.getParent(t)),this.isTableRow(t)&&(n=e.getParent(i));var l=e.getChildCells(n,!0);l.length<=1?e.remove(n):(this.isTableRow(i)||(i=l[l.length-1]),e.remove(i),l=0,null!=(i=this.getCellGeometry(i))&&(l=i.height),null!=(i=this.getCellGeometry(n))&&((i=i.clone()).height-=l,e.setGeometry(n,i)))}finally{e.endUpdate()}},Graph.prototype.insertRow=function(t,e){for(var t=t.tBodies[0],n=t.rows[0].cells,i=0,l=0;l<n.length;l++){var s=n[l].getAttribute("colspan");i+=null!=s?parseInt(s):1}for(var o=t.insertRow(e),l=0;l<i;l++)mxUtils.br(o.insertCell(-1));return o.cells[0]},Graph.prototype.deleteRow=function(t,e){t.tBodies[0].deleteRow(e)},Graph.prototype.insertColumn=function(t,e){var n=t.tHead;if(null!=n)for(var i=0;i<n.rows.length;i++){var l=document.createElement("th");n.rows[i].appendChild(l),mxUtils.br(l)}for(var s=t.tBodies[0],o=0;o<s.rows.length;o++){var r=s.rows[o].insertCell(e);mxUtils.br(r)}return s.rows[0].cells[0<=e?e:s.rows[0].cells.length-1]},Graph.prototype.deleteColumn=function(t,e){if(0<=e)for(var n=t.tBodies[0].rows,i=0;i<n.length;i++)n[i].cells.length>e&&n[i].deleteCell(e)},Graph.prototype.pasteHtmlAtCaret=function(t){var e,n;if(window.getSelection){if((e=window.getSelection()).getRangeAt&&e.rangeCount){(n=e.getRangeAt(0)).deleteContents();var i=document.createElement("div");i.innerHTML=t;for(var l,s=document.createDocumentFragment();l=i.firstChild;)lastNode=s.appendChild(l);n.insertNode(s)}}else(e=document.selection)&&"Control"!=e.type&&e.createRange().pasteHTML(t)},Graph.prototype.createLinkForHint=function(e,t){function n(t,e){return t.length>e&&(t=t.substring(0,Math.round(e/2))+"..."+t.substring(t.length-Math.round(e/4))),t}e=null!=e?e:"javascript:void(0);",null!=t&&0!=t.length||(t=this.isCustomLink(e)?this.getLinkTitle(e):e);var i=document.createElement("a");return i.setAttribute("rel",this.linkRelation),i.setAttribute("href",this.getAbsoluteUrl(e)),i.setAttribute("title",n(this.isCustomLink(e)?this.getLinkTitle(e):e,80)),null!=this.linkTarget&&i.setAttribute("target",this.linkTarget),mxUtils.write(i,n(t,40)),this.isCustomLink(e)&&mxEvent.addListener(i,"click",mxUtils.bind(this,function(t){this.customLinkClicked(e),mxEvent.consume(t)})),i},Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first},this.addListener(mxEvent.START_EDITING,function(t,e){this.popupMenuHandler.hideMenu()});var n=this.updateMouseEvent,i=!(this.updateMouseEvent=function(t){var e;return t=n.apply(this,arguments),mxEvent.isTouchEvent(t.getEvent())&&null==t.getState()&&(null!=(e=this.getCellAt(t.graphX,t.graphY))&&this.isSwimlane(e)&&this.hitsSwimlaneContent(e,t.graphX,t.graphY)?e=null:(t.state=this.view.getState(e),null!=t.state&&null!=t.state.shape&&(this.container.style.cursor=t.state.shape.node.style.cursor))),null==t.getState()&&this.isEnabled()&&(this.container.style.cursor="default"),t}),l=!1,s=!1,o=this.fireMouseEvent;this.fireMouseEvent=function(t,e,n){t==mxEvent.MOUSE_DOWN&&(e=this.updateMouseEvent(e),i=this.isCellSelected(e.getCell()),l=this.isSelectionEmpty(),s=this.popupMenuHandler.isMenuShowing()),o.apply(this,arguments)},this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(t,e){this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==e.getState()||!e.isSource(e.getState().control))&&(this.popupMenuHandler.popupTrigger||!s&&!mxEvent.isMouseEvent(e.getEvent())&&(l&&null==e.getCell()&&this.isSelectionEmpty()||i&&this.isCellSelected(e.getCell()))),mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,arguments)})},mxCellEditor.prototype.isContentEditing=function(){var t=this.graph.view.getState(this.editingCell);return null!=t&&1==t.style.html},mxCellEditor.prototype.isTableSelected=function(){return null!=this.graph.getParentByName(this.graph.getSelectedElement(),"TABLE",this.textarea)},mxCellEditor.prototype.alignText=function(t,e){var n,i=null!=e&&mxEvent.isShiftDown(e);(i||null!=window.getSelection&&null!=window.getSelection().containsNode)&&(n=!0,this.graph.processElements(this.textarea,function(t){i||window.getSelection().containsNode(t,!0)?(t.removeAttribute("align"),t.style.textAlign=null):n=!1}),n&&this.graph.cellEditor.setAlign(t)),document.execCommand("justify"+t.toLowerCase(),!1,null)},mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var t=window.getSelection();if(t.getRangeAt&&t.rangeCount){for(var e=[],n=0,i=t.rangeCount;n<i;++n)e.push(t.getRangeAt(n));return e}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null},mxCellEditor.prototype.restoreSelection=function(t){try{if(t)if(window.getSelection){sel=window.getSelection(),sel.removeAllRanges();for(var e=0,n=t.length;e<n;++e)sel.addRange(t[e])}else document.selection&&t.select&&t.select()}catch(t){}};var u=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(t){null!=t.text&&(t.text.replaceLinefeeds="0"!=mxUtils.getValue(t.style,"nl2Br","1")),u.apply(this,arguments)};var p=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(t,e){this.isKeepFocusEvent(t)||!mxEvent.isAltDown(t.getEvent())?p.apply(this,arguments):this.reset()},mxGuide.prototype.createGuideShape=function(t){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)},mxCellEditor.prototype.escapeCancelsEditing=!1;var m=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(t,e){t=this.graph.getStartEditingCell(t,e),m.apply(this,arguments);var n=this.graph.view.getState(t);null!=n&&1==n.style.html?this.textarea.className="mxCellEditor geContentEditable":this.textarea.className="mxCellEditor mxPlainTextEditor",this.codeViewMode=!1,this.switchSelectionState=null,this.graph.setSelectionCell(t);var i=this.graph.getModel().getParent(t),n=this.graph.getCellGeometry(t);this.graph.getModel().isEdge(i)&&null!=n&&n.relative||this.graph.getModel().isEdge(t)?mxClient.IS_QUIRKS?this.textarea.style.border="gray dotted 1px":mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_FF&&mxClient.IS_WIN?this.textarea.style.outline="gray dotted 1px":this.textarea.style.outline="":mxClient.IS_QUIRKS&&(this.textarea.style.outline="none",this.textarea.style.border="")};var c=mxCellEditor.prototype.installListeners;mxCellEditor.prototype.installListeners=function(t){function l(t){for(var e=t.firstChild;null!=e;){var n=e.nextSibling;l(e),e=n}1==t.nodeType&&("BR"===t.nodeName||null!=t.firstChild)||3==t.nodeType&&0!=mxUtils.trim(mxUtils.getTextContent(t)).length?(3==t.nodeType&&mxUtils.setTextContent(t,mxUtils.getTextContent(t).replace(/\n|\r/g,"")),1==t.nodeType&&(t.removeAttribute("style"),t.removeAttribute("class"),t.removeAttribute("width"),t.removeAttribute("cellpadding"),t.removeAttribute("cellspacing"),t.removeAttribute("border"))):t.parentNode.removeChild(t)}c.apply(this,arguments),mxClient.IS_QUIRKS||7===document.documentMode||8===document.documentMode||mxEvent.addListener(this.textarea,"paste",mxUtils.bind(this,function(t){var e=function t(e,n){e=(n.originalNode=e).firstChild;for(var i=n.firstChild;null!=e&&null!=i;)t(e,i),e=e.nextSibling,i=i.nextSibling;return n}(this.textarea,this.textarea.cloneNode(!0));window.setTimeout(mxUtils.bind(this,function(){null!=this.textarea&&(0<=this.textarea.innerHTML.indexOf("<o:OfficeDocumentSettings>")||0<=this.textarea.innerHTML.indexOf("\x3c!--[if !mso]>")?function t(e,n){if(null!=e)if(n.originalNode!=e)l(e);else for(e=e.firstChild,n=n.firstChild;null!=e;){var i=e.nextSibling;null==n?l(e):(t(e,n),n=n.nextSibling),e=i}}(this.textarea,e):Graph.removePasteFormatting(this.textarea))}),0)}))},mxCellEditor.prototype.toggleViewMode=function(){var t,e,n,i,l,s,o,r,a,h=this.graph.view.getState(this.editingCell);null!=h&&(t=null!=h&&"0"!=mxUtils.getValue(h.style,"nl2Br","1"),e=this.saveSelection(),this.codeViewMode?(0<(r=mxUtils.extractTextWithWhitespace(this.textarea.childNodes)).length&&"\n"==r.charAt(r.length-1)&&(r=r.substring(0,r.length-1)),r=this.graph.sanitizeHtml(t?r.replace(/\n/g,"<br/>"):r,!0),this.textarea.className="mxCellEditor geContentEditable",a=mxUtils.getValue(h.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),n=mxUtils.getValue(h.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),i=mxUtils.getValue(h.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),l=(mxUtils.getValue(h.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,s=(mxUtils.getValue(h.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,o=[],(mxUtils.getValue(h.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&o.push("underline"),(mxUtils.getValue(h.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&o.push("line-through"),this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(a*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT,this.textarea.style.fontSize=Math.round(a)+"px",this.textarea.style.textDecoration=o.join(" "),this.textarea.style.fontWeight=l?"bold":"normal",this.textarea.style.fontStyle=s?"italic":"",this.textarea.style.fontFamily=n,this.textarea.style.textAlign=i,this.textarea.style.padding="0px",this.textarea.innerHTML!=r&&(this.textarea.innerHTML=r,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length)),this.codeViewMode=!1):(this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerHTML=""),r=mxUtils.htmlEntities(this.textarea.innerHTML),mxClient.IS_QUIRKS||8==document.documentMode||(r=mxUtils.replaceTrailingNewlines(r,"<div><br></div>")),r=this.graph.sanitizeHtml(t?r.replace(/\n/g,"").replace(/&lt;br\s*.?&gt;/g,"<br>"):r,!0),this.textarea.className="mxCellEditor mxPlainTextEditor",a=mxConstants.DEFAULT_FONTSIZE,this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(a*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT,this.textarea.style.fontSize=Math.round(a)+"px",this.textarea.style.textDecoration="",this.textarea.style.fontWeight="normal",this.textarea.style.fontStyle="",this.textarea.style.fontFamily=mxConstants.DEFAULT_FONTFAMILY,this.textarea.style.textAlign="left",this.textarea.style.padding="2px",this.textarea.innerHTML!=r&&(this.textarea.innerHTML=r),this.codeViewMode=!0),this.textarea.focus(),null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState),this.switchSelectionState=e,this.resize())};var g=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(t,e){var n,i;null!=this.textarea&&(t=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=t?(n=t.view.scale,this.bounds=mxRectangle.fromRectangle(t),0==this.bounds.width&&0==this.bounds.height&&(this.bounds.width=160*n,this.bounds.height=60*n,null==(i=null!=t.text?t.text.margin:null)&&(i=mxUtils.getAlignmentAsPoint(mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE))),this.bounds.x+=i.x*this.bounds.width,this.bounds.y+=i.y*this.bounds.height),this.textarea.style.width=Math.round((this.bounds.width-4)/n)+"px",this.textarea.style.height=Math.round((this.bounds.height-4)/n)+"px",this.textarea.style.overflow="auto",this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/n)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*n),this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/n)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*n),this.textarea.style.left=Math.round(this.bounds.x)+"px",this.textarea.style.top=Math.round(this.bounds.y)+"px",mxClient.IS_VML?this.textarea.style.zoom=n:mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+n+","+n+")")):(this.textarea.style.height="",this.textarea.style.overflow="",g.apply(this,arguments)))},mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue,mxCellEditor.prototype.getInitialValue=function(t,e){if("0"==mxUtils.getValue(t.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var n=this.graph.getEditingValue(t.cell,e);return"1"==mxUtils.getValue(t.style,"nl2Br","1")&&(n=n.replace(/\n/g,"<br/>")),n=this.graph.sanitizeHtml(n,!0)},mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue,mxCellEditor.prototype.getCurrentValue=function(t){if("0"==mxUtils.getValue(t.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);var e=this.graph.sanitizeHtml(this.textarea.innerHTML,!0);return e="1"==mxUtils.getValue(t.style,"nl2Br","1")?e.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"):e.replace(/\r\n/g,"").replace(/\n/g,"")};var x=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(t){this.codeViewMode&&this.toggleViewMode(),x.apply(this,arguments),this.focusContainer()},mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(t){}};var y=mxCellEditor.prototype.applyValue;function f(){var t=document.createElement("div");return t.className="geHint",t.style.whiteSpace="nowrap",t.style.position="absolute",t}function C(t,e){switch(e){case mxConstants.POINTS:return t;case mxConstants.MILLIMETERS:return(t/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.INCHES:return(t/mxConstants.PIXELS_PER_INCH).toFixed(2)}}mxCellEditor.prototype.applyValue=function(t,e){this.graph.getModel().beginUpdate();try{y.apply(this,arguments),""==e&&this.graph.isCellDeletable(t.cell)&&0==this.graph.model.getChildCount(t.cell)&&this.graph.isTransparentState(t)&&this.graph.removeCells([t.cell],!1)}finally{this.graph.getModel().endUpdate()}},mxCellEditor.prototype.getBackgroundColor=function(t){var e=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);return null!=e&&e!=mxConstants.NONE||null==t.cell.geometry||!(0<t.cell.geometry.width)||0==mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0)&&0!=mxUtils.getValue(t.style,mxConstants.STYLE_HORIZONTAL,1)||(e=mxUtils.getValue(t.style,mxConstants.STYLE_FILLCOLOR,null)),e==mxConstants.NONE&&(e=null),e},mxCellEditor.prototype.getMinimumSize=function(t){var e=this.graph.getView().scale;return new mxRectangle(0,0,null==t.text?30:t.text.size*e+20,30)},mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget,mxGraphHandler.prototype.isValidDropTarget=function(t,e){return mxGraphHandlerIsValidDropTarget.apply(this,arguments)&&!mxEvent.isAltDown(e.getEvent)},mxGraphView.prototype.formatUnitText=function(t){return t&&C(t,this.unit)},mxGraphHandler.prototype.updateHint=function(t){var e,n,i;null==this.pBounds||null==this.shape&&!this.livePreviewActive||(null==this.hint&&(this.hint=f(),this.graph.container.appendChild(this.hint)),i=this.graph.view.translate,n=this.graph.view.scale,e=this.roundLength((this.bounds.x+this.currentDx)/n-i.x),n=this.roundLength((this.bounds.y+this.currentDy)/n-i.y),i=this.graph.view.unit,this.hint.innerHTML=C(e,i)+", "+C(n,i),this.hint.style.left=this.pBounds.x+this.currentDx+Math.round((this.pBounds.width-this.hint.clientWidth)/2)+"px",this.hint.style.top=this.pBounds.y+this.currentDy+this.pBounds.height+Editor.hintOffset+"px")},mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(this.hint.parentNode.removeChild(this.hint),this.hint=null)};var v=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(t,e){v.apply(this,arguments);var n,i,l,s,o=this.graph.getCellStyle(t);null!=o.childLayout||null!=(s=null!=(n=this.graph.model.getParent(t))?this.graph.getCellGeometry(n):null)&&"stackLayout"==(o=this.graph.getCellStyle(n)).childLayout&&(i=parseFloat(mxUtils.getValue(o,"stackBorder",mxStackLayout.prototype.border)),l="1"==mxUtils.getValue(o,"horizontalStack","1"),o=this.graph.getActualStartSize(n),s=s.clone(),l?s.height=e.height+o.y+o.height+2*i:s.width=e.width+o.x+o.width+2*i,this.graph.model.setGeometry(n,s))};var E=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){var t=E.apply(this,arguments),e=new mxDictionary,n=this.graph.model,i=[];function l(t){e.get(t)||(e.put(t,!0),i.push(t))}for(var s=0;s<t.length;s++){var o=t[s];this.graph.isTableCell(o)?l(n.getParent(n.getParent(o))):this.graph.isTableRow(o)&&l(n.getParent(o)),l(o)}return i};var w=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(t){var e=w.apply(this,arguments);return e.stroke="#C0C0C0",e.strokewidth=1,e};var b=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(t){var e=b.apply(this,arguments);return e.stroke="#C0C0C0",e.strokewidth=1,e},mxVertexHandler.prototype.rotationHandleVSpacing=-12,mxVertexHandler.prototype.getRotationHandlePosition=function(){var t=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+t.x/2,this.bounds.y+this.rotationHandleVSpacing-t.y/2)},mxVertexHandler.prototype.isRecursiveResize=function(t,e){return this.graph.isRecursiveVertexResize(t)&&!mxEvent.isControlDown(e.getEvent())},mxVertexHandler.prototype.isCenteredEvent=function(t,e){return!(!this.graph.isSwimlane(t.cell)&&0<this.graph.model.getChildCount(t.cell)&&!this.graph.isCellCollapsed(t.cell)&&"1"==mxUtils.getValue(t.style,"recursiveResize","1")&&null==mxUtils.getValue(t.style,"childLayout",null))&&mxEvent.isControlDown(e.getEvent())||mxEvent.isMetaDown(e.getEvent())};var t=mxVertexHandler.prototype.isRotationHandleVisible;mxVertexHandler.prototype.isRotationHandleVisible=function(){return t.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)},mxVertexHandler.prototype.getSizerBounds=function(){return this.graph.isTableCell(this.state.cell)?this.graph.view.getState(this.graph.model.getParent(this.graph.model.getParent(this.state.cell))):this.bounds};var T=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){return T.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var A=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(t){return t.tableHandle||A.apply(this,arguments)&&(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))},mxVertexHandler.prototype.getSelectionBorderInset=function(){var t=0;return this.graph.isTableRow(this.state.cell)?t=1:this.graph.isTableCell(this.state.cell)&&(t=2),t};var L=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=function(){return L.apply(this,arguments).grow(-this.getSelectionBorderInset())};var I=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){var n=I.apply(this,arguments);if(this.graph.isTable(this.state.cell)){var r=this.graph,t=r.model,a=this.state,h=this.selectionBorder,d=this;null==n&&(n=[]);var l=r.view.getCellStates(t.getChildCells(this.state.cell,!0));if(0<l.length){for(var u=r.view.getCellStates(t.getChildCells(l[0].cell,!0)),e=0;e<u.length;e++)mxUtils.bind(this,function(e){var i=u[e],l=e<u.length-1?u[e+1]:null,t=new mxLine(new mxRectangle,mxConstants.NONE,1,!0);t.isDashed=h.isDashed,t.svgStrokeTolerance++;t=new mxHandle(i,"col-resize",null,t);t.tableHandle=!0;var s=0;t.shape.node.parentNode.insertBefore(t.shape.node,t.shape.node.parentNode.firstChild);var o=!(t.redraw=function(){var t;null!=this.shape&&null!=this.state.shape&&(t=r.getActualStartSize(a.cell),this.shape.stroke=0==s?mxConstants.NONE:h.stroke,this.shape.bounds.x=this.state.x+this.state.width+s*this.graph.view.scale,this.shape.bounds.width=1,this.shape.bounds.y=a.y+(e==u.length-1?0:t.y*this.graph.view.scale),this.shape.bounds.height=a.height-(e==u.length-1?0:(t.height+t.y)*this.graph.view.scale),this.shape.redraw())});t.setPosition=function(t,e,n){s=Math.max(Graph.minTableColumnWidth-t.width,e.x-t.x-t.width),o=mxEvent.isShiftDown(n.getEvent()),null==l||o||(s=Math.min((l.x+l.width-i.x-i.width)/r.view.scale-Graph.minTableColumnWidth,s))},t.execute=function(t){var e;0!=s?r.setTableColumnWidth(this.state.cell,s,o):d.blockDelayedSelection||(e=r.getCellAt(t.getGraphX(),t.getGraphY())||a.cell,r.graphHandler.selectCellForEvent(e,t)),s=0},t.reset=function(){s=0},n.push(t)})(e);for(e=0;e<l.length;e++)mxUtils.bind(this,function(t){var e=l[t],t=new mxLine(new mxRectangle,mxConstants.NONE,1);t.isDashed=h.isDashed,t.svgStrokeTolerance++;t=new mxHandle(e,"row-resize",null,t);t.tableHandle=!0;var i=0;t.shape.node.parentNode.insertBefore(t.shape.node,t.shape.node.parentNode.firstChild),t.redraw=function(){null!=this.shape&&null!=this.state.shape&&(this.shape.stroke=0==i?mxConstants.NONE:h.stroke,this.shape.bounds.x=this.state.x,this.shape.bounds.width=this.state.width,this.shape.bounds.y=this.state.y+this.state.height+i*this.graph.view.scale,this.shape.bounds.height=1,this.shape.redraw())},t.setPosition=function(t,e,n){i=Math.max(Graph.minTableRowHeight-t.height,e.y-t.y-t.height)},t.execute=function(t){var e;0!=i?r.setTableRowHeight(this.state.cell,i,!mxEvent.isShiftDown(t.getEvent())):d.blockDelayedSelection||(e=r.getCellAt(t.getGraphX(),t.getGraphY())||a.cell,r.graphHandler.selectCellForEvent(e,t)),i=0},t.reset=function(){i=0},n.push(t)})(e)}}return null!=n?n.reverse():null};var M=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(t){if(M.apply(this,arguments),null!=this.moveHandles)for(var e=0;e<this.moveHandles.length;e++)this.moveHandles[e].style.visibility=t?"":"hidden";if(null!=this.cornerHandles)for(e=0;e<this.cornerHandles.length;e++)this.cornerHandles[e].node.style.visibility=t?"":"hidden"},mxVertexHandler.prototype.refreshMoveHandles=function(){var n=this.graph.model;if(null!=this.moveHandles){for(var t=0;t<this.moveHandles.length;t++)this.moveHandles[t].parentNode.removeChild(this.moveHandles[t]);this.moveHandles=null}this.moveHandles=[];for(t=0;t<n.getChildCount(this.state.cell);t++)mxUtils.bind(this,function(e){var t;null!=e&&n.isVertex(e.cell)&&((t=mxUtils.createImage(Editor.rowMoveImage)).style.position="absolute",t.style.cursor="pointer",t.style.width="7px",t.style.height="4px",t.style.padding="4px 2px 4px 2px",t.rowState=e,mxEvent.addGestureListeners(t,mxUtils.bind(this,function(t){this.graph.popupMenuHandler.hideMenu(),this.graph.stopEditing(!1),!this.graph.isToggleEvent(t)&&this.graph.isCellSelected(e.cell)||this.graph.selectCellForEvent(e.cell,t),mxEvent.isPopupTrigger(t)||(this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(t),mxEvent.getClientY(t),this.graph.getSelectionCells()),this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(t),this.graph.isMouseDown=!0),mxEvent.consume(t)}),null,mxUtils.bind(this,function(t){mxEvent.isPopupTrigger(t)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(t),mxEvent.getClientY(t),e.cell,t),mxEvent.consume(t))})),this.moveHandles.push(t),this.graph.container.appendChild(t))})(this.graph.view.getState(n.getChildAt(this.state.cell,t)))},mxVertexHandler.prototype.refresh=function(){if(null!=this.customHandles){for(var t=0;t<this.customHandles.length;t++)this.customHandles[t].destroy();this.customHandles=this.createCustomHandles()}this.graph.isTable(this.state.cell)&&this.refreshMoveHandles()};var R=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var t=new mxPoint(0,0),e=this.tolerance,n=this.state.style.shape;null==mxCellRenderer.defaultShapes[n]&&null==mxStencilRegistry.getStencil(n)&&(n=mxConstants.SHAPE_RECTANGLE);var i=this.graph.isTable(this.state.cell)||this.graph.cellEditor.getEditingCell()==this.state.cell;if(!i&&null!=this.customHandles)for(var l=0;l<this.customHandles.length;l++)if(null!=this.customHandles[l].shape&&null!=this.customHandles[l].shape.bounds){var s=this.customHandles[l].shape.bounds,o=s.getCenterX(),r=s.getCenterY();if(Math.abs(this.state.x-o)<s.width/2||Math.abs(this.state.y-r)<s.height/2||Math.abs(this.state.x+this.state.width-o)<s.width/2||Math.abs(this.state.y+this.state.height-r)<s.height/2){i=!0;break}}return i&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(e/=2,this.graph.isTable(this.state.cell)&&(e+=7),t.x=this.sizers[0].bounds.width+e,t.y=this.sizers[0].bounds.height+e):t=R.apply(this,arguments),t},mxVertexHandler.prototype.updateHint=function(t){var e,n;this.index!=mxEvent.LABEL_HANDLE&&(null==this.hint&&(this.hint=f(),this.state.view.graph.container.appendChild(this.hint)),this.index==mxEvent.ROTATION_HANDLE?this.hint.innerHTML=this.currentAlpha+"&deg;":(e=this.state.view.scale,n=this.state.view.unit,this.hint.innerHTML=C(this.roundLength(this.bounds.width/e),n)+" x "+C(this.roundLength(this.bounds.height/e),n)),n=null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0",null==(n=mxUtils.getBoundingBox(this.bounds,n))&&(n=this.bounds),this.hint.style.left=n.x+Math.round((n.width-this.hint.clientWidth)/2)+"px",this.hint.style.top=n.y+n.height+Editor.hintOffset+"px",null!=this.linkHint&&(this.linkHint.style.display="none"))},mxVertexHandler.prototype.removeHint=function(){mxGraphHandler.prototype.removeHint.apply(this,arguments),null!=this.linkHint&&(this.linkHint.style.display="")};var P=mxEdgeHandler.prototype.mouseMove;mxEdgeHandler.prototype.mouseMove=function(t,e){P.apply(this,arguments),null!=this.linkHint&&"none"!=this.linkHint.style.display&&null!=this.graph.graphHandler&&null!=this.graph.graphHandler.first&&(this.linkHint.style.display="none")};var O,U=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(t,e){U.apply(this,arguments),null!=this.linkHint&&"none"==this.linkHint.style.display&&(this.linkHint.style.display="")},mxEdgeHandler.prototype.updateHint=function(t,e){null==this.hint&&(this.hint=f(),this.state.view.graph.container.appendChild(this.hint));var n=this.graph.view.translate,i=this.graph.view.scale,l=this.roundLength(e.x/i-n.x),i=this.roundLength(e.y/i-n.y),n=this.graph.view.unit;this.hint.innerHTML=C(l,n)+", "+C(i,n),this.hint.style.visibility="visible",(this.isSource||this.isTarget)&&(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(n=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*n.x)+"%, "+Math.round(100*n.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden")),this.hint.style.left=Math.round(t.getGraphX()-this.hint.clientWidth/2)+"px",this.hint.style.top=Math.max(t.getGraphY(),e.y)+Editor.hintOffset+"px",null!=this.linkHint&&(this.linkHint.style.display="none")},mxEdgeHandler.prototype.removeHint=mxVertexHandler.prototype.removeHint,HoverIcons.prototype.mainHandle=mxClient.IS_SVG?Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'" stroke-width="1"/>'):new mxImage(IMAGE_PATH+"/handle-main.png",17,17),HoverIcons.prototype.secondaryHandle=mxClient.IS_SVG?Graph.createSvgImage(16,16,'<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>'):new mxImage(IMAGE_PATH+"/handle-secondary.png",17,17),HoverIcons.prototype.fixedHandle=mxClient.IS_SVG?Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'" stroke-width="1"/><path d="m 7 7 L 11 11 M 7 11 L 11 7" stroke="#fff"/>'):new mxImage(IMAGE_PATH+"/handle-fixed.png",17,17),HoverIcons.prototype.terminalHandle=mxClient.IS_SVG?Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'" stroke-width="1"/><circle cx="9" cy="9" r="2" stroke="#fff" fill="transparent"/>'):new mxImage(IMAGE_PATH+"/handle-terminal.png",17,17),HoverIcons.prototype.rotationHandle=mxClient.IS_SVG?Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" fill="'+HoverIcons.prototype.arrowFill+'" d="M15.55 5.55L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42l1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z"/>',24,24):new mxImage(IMAGE_PATH+"/handle-rotate.png",16,16),mxClient.IS_SVG&&(mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="'+HoverIcons.prototype.arrowFill+'"/>')),mxVertexHandler.TABLE_HANDLE_COLOR="#fca000",mxVertexHandler.prototype.handleImage=HoverIcons.prototype.mainHandle,mxVertexHandler.prototype.secondaryHandleImage=HoverIcons.prototype.secondaryHandle,mxEdgeHandler.prototype.handleImage=HoverIcons.prototype.mainHandle,mxEdgeHandler.prototype.terminalHandleImage=HoverIcons.prototype.terminalHandle,mxEdgeHandler.prototype.fixedHandleImage=HoverIcons.prototype.fixedHandle,mxEdgeHandler.prototype.labelHandleImage=HoverIcons.prototype.secondaryHandle,mxOutline.prototype.sizerImage=HoverIcons.prototype.mainHandle,null!=window.Sidebar&&(Sidebar.prototype.triangleUp=HoverIcons.prototype.triangleUp,Sidebar.prototype.triangleRight=HoverIcons.prototype.triangleRight,Sidebar.prototype.triangleDown=HoverIcons.prototype.triangleDown,Sidebar.prototype.triangleLeft=HoverIcons.prototype.triangleLeft,Sidebar.prototype.refreshTarget=HoverIcons.prototype.refreshTarget,Sidebar.prototype.roundDrop=HoverIcons.prototype.roundDrop),mxClient.IS_SVG||((new Image).src=HoverIcons.prototype.mainHandle.src,(new Image).src=HoverIcons.prototype.fixedHandle.src,(new Image).src=HoverIcons.prototype.terminalHandle.src,(new Image).src=HoverIcons.prototype.secondaryHandle.src,(new Image).src=HoverIcons.prototype.rotationHandle.src,(new Image).src=HoverIcons.prototype.triangleUp.src,(new Image).src=HoverIcons.prototype.triangleRight.src,(new Image).src=HoverIcons.prototype.triangleDown.src,(new Image).src=HoverIcons.prototype.triangleLeft.src,(new Image).src=HoverIcons.prototype.refreshTarget.src,(new Image).src=HoverIcons.prototype.roundDrop.src),mxVertexHandler.prototype.rotationEnabled=!0,mxVertexHandler.prototype.manageSizers=!0,mxVertexHandler.prototype.livePreview=!0,mxGraphHandler.prototype.maxLivePreview=16,mxRubberband.prototype.defaultOpacity=30,mxConnectionHandler.prototype.outlineConnect=!0,mxCellHighlight.prototype.keepOnTop=!0,mxVertexHandler.prototype.parentHighlightEnabled=!0,mxEdgeHandler.prototype.parentHighlightEnabled=!0,mxEdgeHandler.prototype.dblClickRemoveEnabled=!0,mxEdgeHandler.prototype.straightRemoveEnabled=!0,mxEdgeHandler.prototype.virtualBendsEnabled=!0,mxEdgeHandler.prototype.mergeRemoveEnabled=!0,mxEdgeHandler.prototype.manageLabelHandle=!0,mxEdgeHandler.prototype.outlineConnect=!0,mxEdgeHandler.prototype.isAddVirtualBendEvent=function(t){return!mxEvent.isShiftDown(t.getEvent())},mxEdgeHandler.prototype.isCustomHandleEvent=function(t){return!mxEvent.isShiftDown(t.getEvent())},Graph.touchStyle?((mxClient.IS_TOUCH||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)&&(mxShape.prototype.svgStrokeTolerance=18,mxVertexHandler.prototype.tolerance=12,mxEdgeHandler.prototype.tolerance=12,Graph.prototype.tolerance=12,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxConstraintHandler.prototype.getTolerance=function(t){return mxEvent.isMouseEvent(t.getEvent())?4:this.graph.getTolerance()}),mxPanningHandler.prototype.isPanningTrigger=function(t){var e=t.getEvent();return null==t.getState()&&!mxEvent.isMouseEvent(e)||mxEvent.isPopupTrigger(e)&&(null==t.getState()||mxEvent.isControlDown(e)||mxEvent.isShiftDown(e))},O=mxGraphHandler.prototype.mouseDown,mxGraphHandler.prototype.mouseDown=function(t,e){O.apply(this,arguments),mxEvent.isTouchEvent(e.getEvent())&&this.graph.isCellSelected(e.getCell())&&1<this.graph.getSelectionCount()&&(this.delayedSelection=!1)}):mxPanningHandler.prototype.isPanningTrigger=function(t){var e=t.getEvent();return mxEvent.isLeftMouseButton(e)&&(this.useLeftButtonForPanning&&null==t.getState()||mxEvent.isControlDown(e)&&!mxEvent.isShiftDown(e))||this.usePopupTrigger&&mxEvent.isPopupTrigger(e)},mxRubberband.prototype.isSpaceEvent=function(t){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&mxEvent.isControlDown(t.getEvent())&&mxEvent.isShiftDown(t.getEvent())},mxRubberband.prototype.cancelled=!1,mxRubberband.prototype.cancel=function(){this.isActive()&&(this.cancelled=!0,this.reset())},mxRubberband.prototype.mouseUp=function(t,e){if(this.cancelled)this.cancelled=!1,e.consume();else{var n=null!=this.div&&"none"!=this.div.style.display,i=null,l=null,s=null,o=null;if(null!=this.first&&null!=this.currentX&&null!=this.currentY&&(i=this.first.x,l=this.first.y,s=(this.currentX-i)/this.graph.view.scale,o=(this.currentY-l)/this.graph.view.scale,mxEvent.isAltDown(e.getEvent())||(s=this.graph.snap(s),o=this.graph.snap(o),this.graph.isGridEnabled()||(Math.abs(s)<this.graph.tolerance&&(s=0),Math.abs(o)<this.graph.tolerance&&(o=0)))),this.reset(),n){if(mxEvent.isAltDown(e.getEvent())&&this.graph.isToggleEvent(e.getEvent())){var r=new mxRectangle(this.x,this.y,this.width,this.height),a=this.graph.getCells(r.x,r.y,r.width,r.height);this.graph.removeSelectionCells(a)}else if(this.isSpaceEvent(e)){this.graph.model.beginUpdate();try{for(var h,d,a=this.graph.getCellsBeyond(i,l,this.graph.getDefaultParent(),!0,!0),u=0;u<a.length;u++)this.graph.isCellMovable(a[u])&&(h=this.graph.view.getState(a[u]),d=this.graph.getCellGeometry(a[u]),null!=h&&null!=d&&((d=d.clone()).translate(s,o),this.graph.model.setGeometry(a[u],d)))}finally{this.graph.model.endUpdate()}}else{r=new mxRectangle(this.x,this.y,this.width,this.height);this.graph.selectRegion(r,e.getEvent())}e.consume()}}},mxRubberband.prototype.mouseMove=function(t,e){var n,i,l,s,o;e.isConsumed()||null==this.first||(l=mxUtils.getScrollOrigin(this.graph.container),i=mxUtils.getOffset(this.graph.container),l.x-=i.x,l.y-=i.y,s=e.getX()+l.x,o=e.getY()+l.y,n=this.first.x-s,i=this.first.y-o,l=this.graph.tolerance,(null!=this.div||Math.abs(n)>l||Math.abs(i)>l)&&(null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(s,o),this.isSpaceEvent(e)?(l=this.x+this.width,s=this.y+this.height,o=this.graph.view.scale,mxEvent.isAltDown(e.getEvent())||(this.width=this.graph.snap(this.width/o)*o,this.height=this.graph.snap(this.height/o)*o,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),this.height<this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=l-this.width),this.y<this.first.y&&(this.y=s-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor="white",this.div.style.left=this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=this.width<=0?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+"px",this.secondDiv.style.width=this.graph.container.clientWidth+"px",this.secondDiv.style.height=Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=this.height<=0?"1px 0px 0px 0px":"1px 0px 1px 0px"):(this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null)),e.consume()))};var N=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null),N.apply(this,arguments)};var H=(new Date).getTime(),_=0,D=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(t,e,n,i){D.apply(this,arguments),_=n!=this.currentTerminalState?(H=(new Date).getTime(),0):(new Date).getTime()-H,this.currentTerminalState=n};var G=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(t){return null!=this.currentTerminalState&&t.getState()==this.currentTerminalState&&2e3<_||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&G.apply(this,arguments)},mxEdgeHandler.prototype.createHandleShape=function(t,e){var n=null!=t&&0==t,i=this.state.getVisibleTerminalState(n),t=null!=t&&(0==t||t>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==t)?this.graph.getConnectionConstraint(this.state,i,n):null,i=null!=(null!=t?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(n),t):null)?this.fixedHandleImage:null!=t&&null!=i?this.terminalHandleImage:this.handleImage;if(null!=i){var l=new mxImageShape(new mxRectangle(0,0,i.width,i.height),i.src);return l.preserveImageAspect=!1,l}l=mxConstants.HANDLE_SIZE;return this.preferHtml&&--l,new mxRectangleShape(new mxRectangle(0,0,l,l),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var k=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(t,e,n){return this.handleImage=e==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:e==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage,k.apply(this,arguments)};var V=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(t){if(null!=t&&1==t.length){var e=this.graph.getModel(),n=e.getParent(t[0]),i=this.graph.getCellGeometry(t[0]);if(e.isEdge(n)&&null!=i&&i.relative){i=this.graph.view.getState(t[0]);if(null!=i&&i.width<2&&i.height<2&&null!=i.text&&null!=i.text.boundingBox)return mxRectangle.fromRectangle(i.text.boundingBox)}}return V.apply(this,arguments)};var F=mxGraphHandler.prototype.getGuideStates;mxGraphHandler.prototype.getGuideStates=function(){for(var t=F.apply(this,arguments),e=[],n=0;n<t.length;n++)"1"!=mxUtils.getValue(t[n].style,"part","0")&&e.push(t[n]);return e};var B=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(t){var e=this.graph.getModel(),n=e.getParent(t.cell),i=this.graph.getCellGeometry(t.cell);if(e.isEdge(n)&&null!=i&&i.relative&&t.width<2&&t.height<2&&null!=t.text&&null!=t.text.boundingBox){i=t.text.unrotatedBoundingBox||t.text.boundingBox;return new mxRectangle(Math.round(i.x),Math.round(i.y),Math.round(i.width),Math.round(i.height))}return B.apply(this,arguments)};var z=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(t,e){var n=this.graph.getModel(),i=n.getParent(this.state.cell),l=this.graph.getCellGeometry(this.state.cell);(this.getHandleForEvent(e)==mxEvent.ROTATION_HANDLE||!n.isEdge(i)||null==l||!l.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&z.apply(this,arguments)},mxVertexHandler.prototype.rotateClick=function(){var t=mxUtils.getValue(this.state.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),e=mxUtils.getValue(this.state.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);this.state.view.graph.model.isVertex(this.state.cell)&&t==mxConstants.NONE&&e==mxConstants.NONE?(e=mxUtils.mod(mxUtils.getValue(this.state.style,mxConstants.STYLE_ROTATION,0)+90,360),this.state.view.graph.setCellStyles(mxConstants.STYLE_ROTATION,e,[this.state.cell])):this.state.view.graph.turnShapes([this.state.cell])};var Y=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(t,e){Y.apply(this,arguments),null!=this.graph.graphHandler.first&&(null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none"),null!=this.linkHint&&"none"!=this.linkHint.style.display&&(this.linkHint.style.display="none"))};var W=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(t,e){W.apply(this,arguments),null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none"),null!=this.linkHint&&"none"==this.linkHint.style.display&&(this.linkHint.style.display=""),this.blockDelayedSelection=null};var j=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){j.apply(this,arguments);var t=!1;if(null!=this.rotationShape&&this.rotationShape.node.setAttribute("title",mxResources.get("rotateTooltip")),this.graph.isTable(this.state.cell))this.refreshMoveHandles();else if(1==this.graph.getSelectionCount()&&(this.graph.isTableCell(this.state.cell)||this.graph.isTableRow(this.state.cell))){this.cornerHandles=[];for(var e=0;e<4;e++){var n=new mxRectangleShape(new mxRectangle(0,0,6,6),"#ffffff",mxConstants.HANDLE_STROKECOLOR);n.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,n.init(this.graph.view.getOverlayPane()),this.cornerHandles.push(n)}}var i=mxUtils.bind(this,function(){null!=this.specialHandle&&(this.specialHandle.node.style.display=this.graph.isEnabled()&&this.graph.getSelectionCount()<this.graph.graphHandler.maxCells?"":"none"),this.redrawHandles()});this.changeHandler=mxUtils.bind(this,function(t,e){this.updateLinkHint(this.graph.getLinkForCell(this.state.cell),this.graph.getLinksForState(this.state)),i()}),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.changeHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler),this.editingHandler=mxUtils.bind(this,function(t,e){this.redrawHandles()}),this.graph.addListener(mxEvent.EDITING_STOPPED,this.editingHandler);var l=this.graph.getLinkForCell(this.state.cell),s=this.graph.getLinksForState(this.state);this.updateLinkHint(l,s),(null!=l||null!=s&&0<s.length)&&(t=!0),t&&this.redrawHandles()},mxVertexHandler.prototype.updateLinkHint=function(t,e){try{if(null==t&&(null==e||0==e.length)||1<this.graph.getSelectionCount())null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=t||null!=e&&0<e.length){var n;if(null==this.linkHint&&(this.linkHint=f(),this.linkHint.style.padding="6px 8px 6px 8px",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint)),this.linkHint.innerHTML="",null!=t&&(this.linkHint.appendChild(this.graph.createLinkForHint(t)),this.graph.isEnabled()&&"function"==typeof this.graph.editLink&&((n=document.createElement("img")).setAttribute("src",Editor.editImage),n.setAttribute("title",mxResources.get("editLink")),n.setAttribute("width","11"),n.setAttribute("height","11"),n.style.marginLeft="10px",n.style.marginBottom="-1px",n.style.cursor="pointer",this.linkHint.appendChild(n),mxEvent.addListener(n,"click",mxUtils.bind(this,function(t){this.graph.setSelectionCell(this.state.cell),this.graph.editLink(),mxEvent.consume(t)})),(n=document.createElement("img")).setAttribute("src",Dialog.prototype.clearImage),n.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")])),n.setAttribute("width","13"),n.setAttribute("height","10"),n.style.marginLeft="4px",n.style.marginBottom="-1px",n.style.cursor="pointer",this.linkHint.appendChild(n),mxEvent.addListener(n,"click",mxUtils.bind(this,function(t){this.graph.setLinkForCell(this.state.cell,null),mxEvent.consume(t)})))),null!=e)for(var i=0;i<e.length;i++){var l=document.createElement("div");l.style.marginTop=null!=t||0<i?"6px":"0px",l.appendChild(this.graph.createLinkForHint(e[i].getAttribute("href"),mxUtils.getTextContent(e[i]))),this.linkHint.appendChild(l)}}}catch(t){}},mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var X=mxEdgeHandler.prototype.init;mxEdgeHandler.prototype.init=function(){X.apply(this,arguments),this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});var n=mxUtils.bind(this,function(){null!=this.linkHint&&(this.linkHint.style.display=1==this.graph.getSelectionCount()?"":"none"),null!=this.labelShape&&(this.labelShape.node.style.display=this.graph.isEnabled()&&this.graph.getSelectionCount()<this.graph.graphHandler.maxCells?"":"none")});this.changeHandler=mxUtils.bind(this,function(t,e){this.updateLinkHint(this.graph.getLinkForCell(this.state.cell),this.graph.getLinksForState(this.state)),n(),this.redrawHandles()}),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.changeHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler);var t=this.graph.getLinkForCell(this.state.cell),e=this.graph.getLinksForState(this.state);(null!=t||null!=e&&0<e.length)&&(this.updateLinkHint(t,e),this.redrawHandles())};var Z=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){Z.apply(this,arguments),this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var K=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){if(null!=this.moveHandles)for(var t=0;t<this.moveHandles.length;t++)this.moveHandles[t].style.left=this.moveHandles[t].rowState.x+this.moveHandles[t].rowState.width-5+"px",this.moveHandles[t].style.top=this.moveHandles[t].rowState.y+this.moveHandles[t].rowState.height/2-6+"px";if(null!=this.cornerHandles){var e=this.getSelectionBorderInset(),n=this.cornerHandles,i=n[0].bounds.width/2,l=n[0].bounds.height/2;n[0].bounds.x=this.state.x-i+e,n[0].bounds.y=this.state.y-l+e,n[0].redraw(),n[1].bounds.x=n[0].bounds.x+this.state.width-2*e,n[1].bounds.y=n[0].bounds.y,n[1].redraw(),n[2].bounds.x=n[0].bounds.x,n[2].bounds.y=this.state.y+this.state.height-2*e,n[2].redraw(),n[3].bounds.x=n[1].bounds.x,n[3].bounds.y=n[2].bounds.y,n[3].redraw();for(t=0;t<this.cornerHandles.length;t++)this.cornerHandles[t].node.style.display=1==this.graph.getSelectionCount()?"":"none"}null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=null!=this.moveHandles||1!=this.graph.getSelectionCount()||null!=this.index&&this.index!=mxEvent.ROTATION_HANDLE?"none":""),K.apply(this),null!=this.state&&null!=this.linkHint&&(l=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),e=new mxRectangle(this.state.x,this.state.y-22,this.state.width+24,this.state.height+22),e=null!=(n=mxUtils.getBoundingBox(e,this.state.style[mxConstants.STYLE_ROTATION]||"0",l))?mxUtils.getBoundingBox(this.state,this.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,l=null!=this.state.text?this.state.text.boundingBox:null,null==n&&(n=this.state),n=n.y+n.height,null!=l&&(n=Math.max(n,l.y+l.height)),this.linkHint.style.left=Math.max(0,Math.round(e.x+(e.width-this.linkHint.clientWidth)/2))+"px",this.linkHint.style.top=Math.round(n+this.verticalOffset/2+Editor.hintOffset)+"px")};var Q=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){if(Q.apply(this,arguments),null!=this.moveHandles){for(var t=0;t<this.moveHandles.length;t++)null!=this.moveHandles[t]&&null!=this.moveHandles[t].parentNode&&this.moveHandles[t].parentNode.removeChild(this.moveHandles[t]);this.moveHandles=null}if(null!=this.cornerHandles){for(t=0;t<this.cornerHandles.length;t++)null!=this.cornerHandles[t]&&null!=this.cornerHandles[t].node&&null!=this.cornerHandles[t].node.parentNode&&this.cornerHandles[t].node.parentNode.removeChild(this.cornerHandles[t].node);this.cornerHandles=null}null!=this.linkHint&&(null!=this.linkHint.parentNode&&this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null),null!=this.changeHandler&&(this.graph.getSelectionModel().removeListener(this.changeHandler),this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null),null!=this.editingHandler&&(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var J=mxEdgeHandler.prototype.redrawHandles;mxEdgeHandler.prototype.redrawHandles=function(){var t;null!=this.marker&&(J.apply(this),null!=this.state&&null!=this.linkHint&&(t=this.state,null!=this.state.text&&null!=this.state.text.bounds&&(t=new mxRectangle(t.x,t.y,t.width,t.height)).add(this.state.text.bounds),this.linkHint.style.left=Math.max(0,Math.round(t.x+(t.width-this.linkHint.clientWidth)/2))+"px",this.linkHint.style.top=Math.round(t.y+t.height+Editor.hintOffset)+"px"))};var q=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=function(){q.apply(this,arguments),null!=this.linkHint&&(this.linkHint.style.visibility="")};var $=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){$.apply(this,arguments),null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}(),Format=function(t,e){this.editorUi=t,this.container=e},Format.prototype.labelIndex=0,Format.prototype.diagramIndex=0,Format.prototype.currentIndex=0,Format.prototype.showCloseButton=!0,Format.prototype.inactiveTabBackgroundColor="#f1f3f4",Format.prototype.roundableShapes=["label","rectangle","internalStorage","corner","parallelogram","swimlane","triangle","trapezoid","ext","step","tee","process","link","rhombus","offPageConnector","loopLimit","hexagon","manualInput","card","curlyBracket","singleArrow","callout","doubleArrow","flexArrow","umlLifeline"],Format.prototype.init=function(){var t=this.editorUi,e=t.editor,n=e.graph;this.update=mxUtils.bind(this,function(t,e){this.clearSelectionState(),this.refresh()}),n.getSelectionModel().addListener(mxEvent.CHANGE,this.update),n.addListener(mxEvent.EDITING_STARTED,this.update),n.addListener(mxEvent.EDITING_STOPPED,this.update),n.getModel().addListener(mxEvent.CHANGE,this.update),n.addListener(mxEvent.ROOT,mxUtils.bind(this,function(){this.refresh()})),t.addListener("styleChanged",mxUtils.bind(this,function(t,e){this.refresh()})),e.addListener("autosaveChanged",mxUtils.bind(this,function(){this.refresh()})),this.refresh()},Format.prototype.clearSelectionState=function(){this.selectionState=null},Format.prototype.getSelectionState=function(){return null==this.selectionState&&(this.selectionState=this.createSelectionState()),this.selectionState},Format.prototype.createSelectionState=function(){for(var t=this.editorUi.editor.graph.getSelectionCells(),e=this.initSelectionState(),n=0;n<t.length;n++)this.updateSelectionStateForCell(e,t[n],t);return e},Format.prototype.initSelectionState=function(){return{vertices:[],edges:[],x:null,y:null,width:null,height:null,style:{},containsImage:!1,containsLabel:!1,fill:!0,glass:!0,rounded:!0,autoSize:!1,image:!0,shadow:!0,lineJumps:!0,resizable:!0,table:!1,cell:!1,row:!1,movable:!0,rotatable:!0,stroke:!0}},Format.prototype.updateSelectionStateForCell=function(t,e,n){var i,l,s=this.editorUi.editor.graph;s.getModel().isVertex(e)?(t.resizable=t.resizable&&s.isCellResizable(e),t.rotatable=t.rotatable&&s.isCellRotatable(e),t.movable=t.movable&&s.isCellMovable(e)&&!s.isTableRow(e)&&!s.isTableCell(e),t.table=t.table||s.isTable(e),t.cell=t.cell||s.isTableCell(e),t.row=t.row||s.isTableRow(e),t.vertices.push(e),null!=(l=s.getCellGeometry(e))&&(0<l.width?null==t.width?t.width=l.width:t.width!=l.width&&(t.width=""):t.containsLabel=!0,0<l.height?null==t.height?t.height=l.height:t.height!=l.height&&(t.height=""):t.containsLabel=!0,l.relative&&null==l.offset||(i=(l.relative?l.offset:l).x,l=(l.relative?l.offset:l).y,null==t.x?t.x=i:t.x!=i&&(t.x=""),null==t.y?t.y=l:t.y!=l&&(t.y="")))):s.getModel().isEdge(e)&&(t.edges.push(e),t.resizable=!1,t.rotatable=!1,t.movable=!1);var o=s.view.getState(e);if(null!=o){t.autoSize=t.autoSize||this.isAutoSizeState(o),t.glass=t.glass&&this.isGlassState(o),t.rounded=t.rounded&&this.isRoundedState(o),t.lineJumps=t.lineJumps&&this.isLineJumpState(o),t.image=t.image&&this.isImageState(o),t.shadow=t.shadow&&this.isShadowState(o),t.fill=t.fill&&this.isFillState(o),t.stroke=t.stroke&&this.isStrokeState(o);var r,e=mxUtils.getValue(o.style,mxConstants.STYLE_SHAPE,null);for(r in t.containsImage=t.containsImage||"image"==e,o.style){var a=o.style[r];null!=a&&(null==t.style[r]?t.style[r]=a:t.style[r]!=a&&(t.style[r]=""))}}},Format.prototype.isFillState=function(t){return!this.isSpecialColor(t.style[mxConstants.STYLE_FILLCOLOR])&&(t.view.graph.model.isVertex(t.cell)||"arrow"==mxUtils.getValue(t.style,mxConstants.STYLE_SHAPE,null)||"filledEdge"==mxUtils.getValue(t.style,mxConstants.STYLE_SHAPE,null)||"flexArrow"==mxUtils.getValue(t.style,mxConstants.STYLE_SHAPE,null))},Format.prototype.isStrokeState=function(t){return!this.isSpecialColor(t.style[mxConstants.STYLE_STROKECOLOR])},Format.prototype.isSpecialColor=function(t){return 0<=mxUtils.indexOf([mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_FILLCOLOR,"inherit","swimlane","indicated"],t)},Format.prototype.isGlassState=function(t){t=mxUtils.getValue(t.style,mxConstants.STYLE_SHAPE,null);return"label"==t||"rectangle"==t||"internalStorage"==t||"ext"==t||"umlLifeline"==t||"swimlane"==t||"process"==t},Format.prototype.isRoundedState=function(t){return null!=t.shape?t.shape.isRoundable():0<=mxUtils.indexOf(this.roundableShapes,mxUtils.getValue(t.style,mxConstants.STYLE_SHAPE,null))},Format.prototype.isLineJumpState=function(t){var e=mxUtils.getValue(t.style,mxConstants.STYLE_SHAPE,null);return!mxUtils.getValue(t.style,mxConstants.STYLE_CURVED,!1)&&("connector"==e||"filledEdge"==e)},Format.prototype.isAutoSizeState=function(t){return"1"==mxUtils.getValue(t.style,mxConstants.STYLE_AUTOSIZE,null)},Format.prototype.isImageState=function(t){t=mxUtils.getValue(t.style,mxConstants.STYLE_SHAPE,null);return"label"==t||"image"==t},Format.prototype.isShadowState=function(t){return"image"!=mxUtils.getValue(t.style,mxConstants.STYLE_SHAPE,null)},Format.prototype.clear=function(){if(this.container.innerHTML="",null!=this.panels)for(var t=0;t<this.panels.length;t++)this.panels[t].destroy();this.panels=[]},Format.prototype.refresh=function(){var t,l,e,s,o,r,n,i,a,h,d,u,p;"0px"!=this.container.style.width&&(this.clear(),t=this.editorUi,l=t.editor.graph,(p=document.createElement("div")).style.whiteSpace="nowrap",p.style.color="rgb(112, 112, 112)",p.style.textAlign="left",p.style.cursor="default",(e=document.createElement("div")).className="geFormatSection",e.style.textAlign="center",e.style.fontWeight="bold",e.style.paddingTop="8px",e.style.fontSize="13px",e.style.borderWidth="0px 0px 1px 1px",e.style.borderStyle="solid",e.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",e.style.height=mxClient.IS_QUIRKS?"34px":"25px",e.style.overflow="hidden",e.style.width="100%",this.container.appendChild(p),mxEvent.addListener(e,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(t){t.preventDefault()})),s=this.getSelectionState().containsLabel,r=o=null,n=mxUtils.bind(this,function(e,n,i){var t=mxUtils.bind(this,function(t){o!=e&&(s?this.labelIndex=i:l.isSelectionEmpty()?this.diagramIndex=i:this.currentIndex=i,null!=o&&(o.style.backgroundColor=this.inactiveTabBackgroundColor,o.style.borderBottomWidth="1px"),(o=e).style.backgroundColor="",o.style.borderBottomWidth="0px",r!=n&&(null!=r&&(r.style.display="none"),(r=n).style.display=""))});mxEvent.addListener(e,"click",t),mxEvent.addListener(e,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(t){t.preventDefault()})),i==(s?this.labelIndex:l.isSelectionEmpty()?this.diagramIndex:this.currentIndex)&&t()}),i=0,l.isSelectionEmpty()?(mxUtils.write(e,mxResources.get("diagram")),e.style.borderLeftWidth="0px",p.appendChild(e),a=p.cloneNode(!1),this.panels.push(new DiagramFormatPanel(this,t,a)),this.container.appendChild(a),null!=Editor.styles&&(a.style.display="none",e.style.width=this.showCloseButton?"106px":"50%",e.style.cursor="pointer",e.style.backgroundColor=this.inactiveTabBackgroundColor,(h=e.cloneNode(!1)).style.borderLeftWidth="1px",h.style.borderRightWidth="1px",h.style.backgroundColor=this.inactiveTabBackgroundColor,n(e,a,i++),(u=p.cloneNode(!1)).style.display="none",mxUtils.write(h,mxResources.get("style")),p.appendChild(h),this.panels.push(new DiagramStylePanel(this,t,u)),this.container.appendChild(u),n(h,u,i++)),this.showCloseButton&&((h=e.cloneNode(!1)).style.borderLeftWidth="1px",h.style.borderRightWidth="1px",h.style.borderBottomWidth="1px",h.style.backgroundColor=this.inactiveTabBackgroundColor,h.style.position="absolute",h.style.right="0px",h.style.top="0px",h.style.width="25px",(d=document.createElement("img")).setAttribute("border","0"),d.setAttribute("src",Dialog.prototype.closeImage),d.setAttribute("title",mxResources.get("hide")),d.style.position="absolute",d.style.display="block",d.style.right="0px",d.style.top="8px",d.style.cursor="pointer",d.style.marginTop="1px",d.style.marginRight="6px",d.style.border="1px solid transparent",d.style.padding="1px",d.style.opacity=.5,h.appendChild(d),mxEvent.addListener(d,"click",function(){t.actions.get("formatPanel").funct()}),p.appendChild(h))):l.isEditing()?(mxUtils.write(e,mxResources.get("text")),p.appendChild(e),this.panels.push(new TextFormatPanel(this,t,p))):(e.style.backgroundColor=this.inactiveTabBackgroundColor,e.style.borderLeftWidth="1px",e.style.cursor="pointer",e.style.width=s?"50%":"33.3%",d=(h=e.cloneNode(!1)).cloneNode(!1),h.style.backgroundColor=this.inactiveTabBackgroundColor,d.style.backgroundColor=this.inactiveTabBackgroundColor,s?h.style.borderLeftWidth="0px":(e.style.borderLeftWidth="0px",mxUtils.write(e,mxResources.get("style")),p.appendChild(e),(u=p.cloneNode(!1)).style.display="none",this.panels.push(new StyleFormatPanel(this,t,u)),this.container.appendChild(u),n(e,u,i++)),mxUtils.write(h,mxResources.get("text")),p.appendChild(h),(u=p.cloneNode(!1)).style.display="none",this.panels.push(new TextFormatPanel(this,t,u)),this.container.appendChild(u),mxUtils.write(d,mxResources.get("arrange")),p.appendChild(d),(p=p.cloneNode(!1)).style.display="none",this.panels.push(new ArrangePanel(this,t,p)),this.container.appendChild(p),n(h,u,i++),n(d,p,i++)))},BaseFormatPanel=function(t,e,n){this.format=t,this.editorUi=e,this.container=n,this.listeners=[]},BaseFormatPanel.prototype.buttonBackgroundColor="white",BaseFormatPanel.prototype.getSelectionState=function(){for(var t=this.editorUi.editor.graph,e=t.getSelectionCells(),n=null,i=0;i<e.length;i++){var l=t.view.getState(e[i]);if(null!=l){l=mxUtils.getValue(l.style,mxConstants.STYLE_SHAPE,null);if(null!=l)if(null==n)n=l;else if(n!=l)return null}}return n},BaseFormatPanel.prototype.installInputHandler=function(l,s,o,r,a,h,d,u){h=null!=h?h:"",u=null!=u&&u;var p=this.editorUi,m=p.editor.graph;r=null!=r?r:1,a=null!=a?a:999;var c=null,g=!1,t=mxUtils.bind(this,function(t){var e=(u?parseFloat:parseInt)(l.value);if(isNaN(e)||s!=mxConstants.STYLE_ROTATION||(e=mxUtils.mod(Math.round(100*e),36e3)/100),e=Math.min(a,Math.max(r,isNaN(e)?o:e)),m.cellEditor.isContentEditing()&&d)g||(g=!0,null!=c&&(m.cellEditor.restoreSelection(c),c=null),d(e),l.value=e+h,g=!1);else if(e!=mxUtils.getValue(this.format.getSelectionState().style,s,o)){m.isEditing()&&m.stopEditing(!0),m.getModel().beginUpdate();try{var n=m.getSelectionCells();m.setCellStyles(s,e,n),s==mxConstants.STYLE_FONTSIZE&&m.updateLabelElements(m.getSelectionCells(),function(t){t.style.fontSize=e+"px",t.removeAttribute("size")});for(var i=0;i<n.length;i++)0==m.model.getChildCount(n[i])&&m.autoSizeCell(n[i],!1);p.fireEvent(new mxEventObject("styleChanged","keys",[s],"values",[e],"cells",n))}finally{m.getModel().endUpdate()}}l.value=e+h,mxEvent.consume(t)});return d&&m.cellEditor.isContentEditing()&&(mxEvent.addListener(l,"mousedown",function(){document.activeElement==m.cellEditor.textarea&&(c=m.cellEditor.saveSelection())}),mxEvent.addListener(l,"touchstart",function(){document.activeElement==m.cellEditor.textarea&&(c=m.cellEditor.saveSelection())})),mxEvent.addListener(l,"change",t),mxEvent.addListener(l,"blur",t),t},BaseFormatPanel.prototype.createPanel=function(){var t=document.createElement("div");return t.className="geFormatSection",t.style.padding="12px 0px 12px 18px",t},BaseFormatPanel.prototype.createTitle=function(t){var e=document.createElement("div");return e.style.padding="0px 0px 6px 0px",e.style.whiteSpace="nowrap",e.style.overflow="hidden",e.style.width="200px",e.style.fontWeight="bold",mxUtils.write(e,t),e},BaseFormatPanel.prototype.createStepper=function(n,i,l,t,e,s,o){l=null!=l?l:1,t=null!=t?t:8,mxClient.IS_QUIRKS?t-=2:(mxClient.IS_MT||8<=document.documentMode)&&(t+=1);var r=document.createElement("div");mxUtils.setPrefixedStyle(r.style,"borderRadius","3px"),r.style.border="1px solid rgb(192, 192, 192)",r.style.position="absolute";var a=document.createElement("div");a.style.borderBottom="1px solid rgb(192, 192, 192)",a.style.position="relative",a.style.height=t+"px",a.style.width="10px",a.className="geBtnUp",r.appendChild(a);var h,d=a.cloneNode(!1);return d.style.border="none",d.style.height=t+"px",d.className="geBtnDown",r.appendChild(d),mxEvent.addListener(d,"click",function(t){""==n.value&&(n.value=s||"2");var e=(o?parseFloat:parseInt)(n.value);isNaN(e)||(n.value=e-l,null!=i&&i(t)),mxEvent.consume(t)}),mxEvent.addListener(a,"click",function(t){""==n.value&&(n.value=s||"0");var e=(o?parseFloat:parseInt)(n.value);isNaN(e)||(n.value=e+l,null!=i&&i(t)),mxEvent.consume(t)}),e&&(h=null,mxEvent.addGestureListeners(r,function(t){!mxClient.IS_QUIRKS&&8!=document.documentMode||(h=document.selection.createRange()),mxEvent.consume(t)},null,function(t){if(null!=h){try{h.select()}catch(t){}h=null,mxEvent.consume(t)}})),r},BaseFormatPanel.prototype.createOption=function(t,e,n,i,l){var s=document.createElement("div");s.style.padding="6px 0px 1px 0px",s.style.whiteSpace="nowrap",s.style.overflow="hidden",s.style.width="200px",s.style.height=mxClient.IS_QUIRKS?"27px":"18px";var o=document.createElement("input");o.setAttribute("type","checkbox"),o.style.margin="0px 6px 0px 0px",s.appendChild(o);var r=document.createElement("span");mxUtils.write(r,t),s.appendChild(r);function a(t){h||(h=!0,t?(o.setAttribute("checked","checked"),o.defaultChecked=!0,o.checked=!0):(o.removeAttribute("checked"),o.defaultChecked=!1,o.checked=!1),d!=t&&(d=t,e()!=d&&n(d)),h=!1)}var h=!1,d=e();return mxEvent.addListener(s,"click",function(t){"disabled"!=o.getAttribute("disabled")&&((t=mxEvent.getSource(t))!=s&&t!=r||(o.checked=!o.checked),a(o.checked))}),a(d),null!=i&&(i.install(a),this.listeners.push(i)),null!=l&&l(s),s},BaseFormatPanel.prototype.createCellOption=function(t,n,i,l,s,o,r,a){l=null!=l?"null"==l?null:l:"1",s=null!=s?"null"==s?null:s:"0";var h=this.editorUi,d=h.editor.graph;return this.createOption(t,function(){var t=d.view.getState(d.getSelectionCell());return null!=t?mxUtils.getValue(t.style,n,i)!=s:null},function(t){if(a&&d.stopEditing(),null!=r)r.funct();else{d.getModel().beginUpdate();try{var e=t?l:s;d.setCellStyles(n,e,d.getSelectionCells()),null!=o&&o(d.getSelectionCells(),e),h.fireEvent(new mxEventObject("styleChanged","keys",[n],"values",[e],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}},{install:function(e){this.listener=function(){var t=d.view.getState(d.getSelectionCell());null!=t&&e(mxUtils.getValue(t.style,n,i)!=s)},d.getModel().addListener(mxEvent.CHANGE,this.listener)},destroy:function(){d.getModel().removeListener(this.listener)}})},BaseFormatPanel.prototype.createColorOption=function(t,i,l,s,e,o,r){var n=document.createElement("div");n.style.padding="6px 0px 1px 0px",n.style.whiteSpace="nowrap",n.style.overflow="hidden",n.style.width="200px",n.style.height=mxClient.IS_QUIRKS?"27px":"18px";var a=document.createElement("input");a.setAttribute("type","checkbox"),a.style.margin="0px 6px 0px 0px",r||n.appendChild(a);var h=document.createElement("span");mxUtils.write(h,t),n.appendChild(h);function d(t,e,n){p||(p=!0,t=/(^#?[a-zA-Z0-9]*$)/.test(t)?t:s,m.innerHTML='<div style="width:'+(mxClient.IS_QUIRKS?"30":"36")+"px;height:12px;margin:3px;border:1px solid black;background-color:"+mxUtils.htmlEntities(null!=t&&t!=mxConstants.NONE?t:s)+';"></div>',!mxClient.IS_QUIRKS&&8!=document.documentMode||(m.firstChild.style.margin="0px"),null!=t&&t!=mxConstants.NONE?(a.setAttribute("checked","checked"),a.defaultChecked=!0,a.checked=!0):(a.removeAttribute("checked"),a.defaultChecked=!1,a.checked=!1),m.style.display=a.checked||r?"":"none",null!=o&&o(t),e||(u=t,(n||r||i()!=u)&&l(u)),p=!1)}var u=i(),p=!1,m=null;return(m=mxUtils.button("",mxUtils.bind(this,function(t){this.editorUi.pickColor(u,function(t){d(t,null,!0)}),mxEvent.consume(t)}))).style.position="absolute",m.style.marginTop="-4px",m.style.right=mxClient.IS_QUIRKS?"0px":"20px",m.style.height="22px",m.className="geColorBtn",m.style.display=a.checked||r?"":"none",n.appendChild(m),mxEvent.addListener(n,"click",function(t){t=mxEvent.getSource(t);t!=a&&"INPUT"==t.nodeName||(t!=a&&(a.checked=!a.checked),a.checked||null==u||u==mxConstants.NONE||s==mxConstants.NONE||(s=u),d(a.checked?s:mxConstants.NONE))}),d(u,!0),null!=e&&(e.install(d),this.listeners.push(e)),n},BaseFormatPanel.prototype.createCellColorOption=function(t,n,e,i,l){var s=this.editorUi,o=s.editor.graph;return this.createColorOption(t,function(){var t=o.view.getState(o.getSelectionCell());return null!=t?mxUtils.getValue(t.style,n,null):null},function(t){o.getModel().beginUpdate();try{o.setCellStyles(n,t,o.getSelectionCells()),null!=l&&l(t),s.fireEvent(new mxEventObject("styleChanged","keys",[n],"values",[t],"cells",o.getSelectionCells()))}finally{o.getModel().endUpdate()}},e||mxConstants.NONE,{install:function(e){this.listener=function(){var t=o.view.getState(o.getSelectionCell());null!=t&&e(mxUtils.getValue(t.style,n,null))},o.getModel().addListener(mxEvent.CHANGE,this.listener)},destroy:function(){o.getModel().removeListener(this.listener)}},i)},BaseFormatPanel.prototype.addArrow=function(t,e){e=null!=e?e:10;var n=document.createElement("div");n.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",n.style.padding="6px",n.style.paddingRight="4px";var i=10-e;2==i?n.style.paddingTop="6px":0<i?n.style.paddingTop=6-i+"px":n.style.marginTop="-2px",n.style.height=e+"px",n.style.borderLeft="1px solid #a0a0a0",n.innerHTML='<img border="0" src="'+(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHBJREFUeNpidHB2ZyAGsACxDRBPIKCuA6TwCBB/h2rABu4A8SYmKCcXiP/iUFgAxL9gCi8A8SwsirZCMQMTkmANEH9E4v+CmsaArvAdyNFI/FlQ92EoBIE+qCRIUz168DBgsU4OqhinQpgHMABAgAEALY4XLIsJ20oAAAAASUVORK5CYII=":IMAGE_PATH+"/dropdown.png")+'" style="margin-bottom:4px;">',mxUtils.setOpacity(n,70);e=t.getElementsByTagName("div")[0];return null!=e&&(e.style.paddingRight="6px",e.style.marginLeft="4px",e.style.marginTop="-1px",e.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",mxUtils.setOpacity(e,60)),mxUtils.setOpacity(t,100),t.style.border="1px solid #a0a0a0",t.style.backgroundColor=this.buttonBackgroundColor,t.style.backgroundImage="none",t.style.width="auto",t.className+=" geColorBtn",mxUtils.setPrefixedStyle(t.style,"borderRadius","3px"),t.appendChild(n),e},BaseFormatPanel.prototype.addUnitInput=function(t,e,n,i,l,s,o,r,a){o=null!=o?o:0;var h=document.createElement("input");h.style.position="absolute",h.style.textAlign="right",h.style.marginTop="-2px",h.style.right=n+12+"px",h.style.width=i+"px",t.appendChild(h);a=this.createStepper(h,l,s,null,r,null,a);return a.style.marginTop=o-2+"px",a.style.right=n+"px",t.appendChild(a),h},BaseFormatPanel.prototype.createRelativeOption=function(t,i,e,l,n){e=null!=e?e:44;var s=this.editorUi.editor.graph,o=this.createPanel();o.style.paddingTop="10px",o.style.paddingBottom="10px",mxUtils.write(o,t),o.style.fontWeight="bold";var r,t=mxUtils.bind(this,function(t){var e,n;null!=l?l(a):(e=parseInt(a.value),e=Math.min(100,Math.max(0,isNaN(e)?100:e)),null!=(n=s.view.getState(s.getSelectionCell()))&&e!=mxUtils.getValue(n.style,i,100)&&(100==e&&(e=null),s.setCellStyles(i,e,s.getSelectionCells()),this.editorUi.fireEvent(new mxEventObject("styleChanged","keys",[i],"values",[e],"cells",s.getSelectionCells()))),a.value=(null!=e?e:"100")+" %"),mxEvent.consume(t)}),a=this.addUnitInput(o,"%",20,e,t,10,-15,null!=l);return null!=i&&(r=mxUtils.bind(this,function(t,e,n){!n&&a==document.activeElement||(n=this.format.getSelectionState(),n=parseInt(mxUtils.getValue(n.style,i,100)),a.value=isNaN(n)?"":n+" %")}),mxEvent.addListener(a,"keydown",function(t){13==t.keyCode?(s.container.focus(),mxEvent.consume(t)):27==t.keyCode&&(r(null,null,!0),s.container.focus(),mxEvent.consume(t))}),s.getModel().addListener(mxEvent.CHANGE,r),this.listeners.push({destroy:function(){s.getModel().removeListener(r)}}),r()),mxEvent.addListener(a,"blur",t),mxEvent.addListener(a,"change",t),null!=n&&n(a),o},BaseFormatPanel.prototype.addLabel=function(t,e,n,i){i=null!=i?i:61;var l=document.createElement("div");mxUtils.write(l,e),l.style.position="absolute",l.style.right=n+"px",l.style.width=i+"px",l.style.marginTop="6px",l.style.textAlign="center",t.appendChild(l)},BaseFormatPanel.prototype.addKeyHandler=function(t,e){mxEvent.addListener(t,"keydown",mxUtils.bind(this,function(t){13==t.keyCode?(this.editorUi.editor.graph.container.focus(),mxEvent.consume(t)):27==t.keyCode&&(null!=e&&e(null,null,!0),this.editorUi.editor.graph.container.focus(),mxEvent.consume(t))}))},BaseFormatPanel.prototype.styleButtons=function(t){for(var e=0;e<t.length;e++)mxUtils.setPrefixedStyle(t[e].style,"borderRadius","3px"),mxUtils.setOpacity(t[e],100),t[e].style.border="1px solid #a0a0a0",t[e].style.padding="4px",t[e].style.paddingTop="3px",t[e].style.paddingRight="1px",t[e].style.margin="1px",t[e].style.width="24px",t[e].style.height="20px",t[e].className+=" geColorBtn"},BaseFormatPanel.prototype.destroy=function(){if(null!=this.listeners){for(var t=0;t<this.listeners.length;t++)this.listeners[t].destroy();this.listeners=null}},ArrangePanel=function(t,e,n){BaseFormatPanel.call(this,t,e,n),this.init()},mxUtils.extend(ArrangePanel,BaseFormatPanel),ArrangePanel.prototype.init=function(){var t=this.editorUi.editor.graph,e=this.format.getSelectionState();this.container.appendChild(this.addLayerOps(this.createPanel())),this.addGeometry(this.container),this.addEdgeGeometry(this.container),e.containsLabel&&0!=e.edges.length||this.container.appendChild(this.addAngle(this.createPanel())),e.containsLabel||0!=e.edges.length||"rectangle"==e.style.shape||"label"==e.style.shape||this.container.appendChild(this.addFlip(this.createPanel())),1<e.vertices.length&&(this.container.appendChild(this.addAlign(this.createPanel())),this.container.appendChild(this.addDistribute(this.createPanel()))),(t.isTable(e.vertices[0])||t.isTableRow(e.vertices[0])||t.isTableCell(e.vertices[0]))&&this.container.appendChild(this.addTable(this.createPanel())),this.container.appendChild(this.addGroupOps(this.createPanel())),e.containsLabel&&((e=document.createElement("div")).style.width="100%",e.style.marginTop="0px",e.style.fontWeight="bold",e.style.padding="10px 0 0 18px",mxUtils.write(e,mxResources.get("style")),this.container.appendChild(e),new StyleFormatPanel(this.format,this.editorUi,this.container))},ArrangePanel.prototype.addTable=function(t){var e=this.editorUi,n=e.editor.graph,i=this.format.getSelectionState();t.style.paddingTop="6px",t.style.paddingBottom="10px";var l=document.createElement("div");l.style.marginTop="2px",l.style.marginBottom="8px",l.style.fontWeight="bold",mxUtils.write(l,mxResources.get("table")),t.appendChild(l);var s=document.createElement("div");s.style.position="relative",s.style.paddingLeft="0px",s.style.borderWidth="0px",s.className="geToolbarContainer";l=[e.toolbar.addButton("geSprite-insertcolumnbefore",mxResources.get("insertColumnBefore"),mxUtils.bind(this,function(){try{n.insertTableColumn(i.vertices[0],!0)}catch(t){e.handleError(t)}}),s),e.toolbar.addButton("geSprite-insertcolumnafter",mxResources.get("insertColumnAfter"),mxUtils.bind(this,function(){try{n.insertTableColumn(i.vertices[0],!1)}catch(t){e.handleError(t)}}),s),e.toolbar.addButton("geSprite-deletecolumn",mxResources.get("deleteColumn"),mxUtils.bind(this,function(){try{n.deleteTableColumn(i.vertices[0])}catch(t){e.handleError(t)}}),s),e.toolbar.addButton("geSprite-insertrowbefore",mxResources.get("insertRowBefore"),mxUtils.bind(this,function(){try{n.insertTableRow(i.vertices[0],!0)}catch(t){e.handleError(t)}}),s),e.toolbar.addButton("geSprite-insertrowafter",mxResources.get("insertRowAfter"),mxUtils.bind(this,function(){try{n.insertTableRow(i.vertices[0],!1)}catch(t){e.handleError(t)}}),s),e.toolbar.addButton("geSprite-deleterow",mxResources.get("deleteRow"),mxUtils.bind(this,function(){try{n.deleteTableRow(i.vertices[0])}catch(t){e.handleError(t)}}),s)];return this.styleButtons(l),t.appendChild(s),l[2].style.marginRight="9px",t},ArrangePanel.prototype.addLayerOps=function(t){var e=this.editorUi,n=mxUtils.button(mxResources.get("toFront"),function(t){e.actions.get("toFront").funct()});return n.setAttribute("title",mxResources.get("toFront")+" ("+this.editorUi.actions.get("toFront").shortcut+")"),n.style.width="100px",n.style.marginRight="2px",t.appendChild(n),(n=mxUtils.button(mxResources.get("toBack"),function(t){e.actions.get("toBack").funct()})).setAttribute("title",mxResources.get("toBack")+" ("+this.editorUi.actions.get("toBack").shortcut+")"),n.style.width="100px",t.appendChild(n),t},ArrangePanel.prototype.addGroupOps=function(t){var e,n=this.editorUi,i=n.editor.graph,l=i.getSelectionCell(),s=this.format.getSelectionState(),o=0,r=null;return t.style.paddingTop="8px",t.style.paddingBottom="6px",1<i.getSelectionCount()?((r=mxUtils.button(mxResources.get("group"),function(t){n.actions.get("group").funct()})).setAttribute("title",mxResources.get("group")+" ("+this.editorUi.actions.get("group").shortcut+")"),r.style.width="202px",r.style.marginBottom="2px",t.appendChild(r),o++):1!=i.getSelectionCount()||i.getModel().isEdge(l)||i.isSwimlane(l)||i.isTable(l)||s.row||s.cell||!(0<i.getModel().getChildCount(l))||((r=mxUtils.button(mxResources.get("ungroup"),function(t){n.actions.get("ungroup").funct()})).setAttribute("title",mxResources.get("ungroup")+" ("+this.editorUi.actions.get("ungroup").shortcut+")"),r.style.width="202px",r.style.marginBottom="2px",t.appendChild(r),o++),0<s.vertices.length&&(0<o&&(mxUtils.br(t),o=0),(r=mxUtils.button(mxResources.get("copySize"),function(t){n.actions.get("copySize").funct()})).setAttribute("title",mxResources.get("copySize")+" ("+this.editorUi.actions.get("copySize").shortcut+")"),r.style.width="202px",r.style.marginBottom="2px",t.appendChild(r),o++,null!=n.copiedSize&&((e=mxUtils.button(mxResources.get("pasteSize"),function(t){n.actions.get("pasteSize").funct()})).setAttribute("title",mxResources.get("pasteSize")+" ("+this.editorUi.actions.get("pasteSize").shortcut+")"),t.appendChild(e),o++,r.style.width="100px",r.style.marginBottom="2px",e.style.width="100px",e.style.marginBottom="2px")),1==i.getSelectionCount()&&i.getModel().isVertex(l)&&!s.row&&!s.cell&&i.getModel().isVertex(i.getModel().getParent(l))?(0<o&&mxUtils.br(t),(r=mxUtils.button(mxResources.get("removeFromGroup"),function(t){n.actions.get("removeFromGroup").funct()})).setAttribute("title",mxResources.get("removeFromGroup")),r.style.width="202px",r.style.marginBottom="2px",t.appendChild(r),o++):0<i.getSelectionCount()&&(0<o&&mxUtils.br(t),(r=mxUtils.button(mxResources.get("clearWaypoints"),mxUtils.bind(this,function(t){this.editorUi.actions.get("clearWaypoints").funct()}))).setAttribute("title",mxResources.get("clearWaypoints")+" ("+this.editorUi.actions.get("clearWaypoints").shortcut+")"),r.style.width="202px",r.style.marginBottom="2px",t.appendChild(r),o++),1==i.getSelectionCount()&&(0<o&&mxUtils.br(t),(r=mxUtils.button(mxResources.get("editData"),mxUtils.bind(this,function(t){this.editorUi.actions.get("editData").funct()}))).setAttribute("title",mxResources.get("editData")+" ("+this.editorUi.actions.get("editData").shortcut+")"),r.style.width="100px",r.style.marginBottom="2px",t.appendChild(r),o++,(r=mxUtils.button(mxResources.get("editLink"),mxUtils.bind(this,function(t){this.editorUi.actions.get("editLink").funct()}))).setAttribute("title",mxResources.get("editLink")),r.style.width="100px",r.style.marginLeft="2px",r.style.marginBottom="2px",t.appendChild(r),o++),0==o&&(t.style.display="none"),t},ArrangePanel.prototype.addAlign=function(t){var e=this.editorUi.editor.graph;t.style.paddingTop="6px",t.style.paddingBottom="12px",t.appendChild(this.createTitle(mxResources.get("align")));var n=document.createElement("div");n.style.position="relative",n.style.paddingLeft="0px",n.style.borderWidth="0px",n.className="geToolbarContainer",mxClient.IS_QUIRKS&&(t.style.height="60px");var i=this.editorUi.toolbar.addButton("geSprite-alignleft",mxResources.get("left"),function(){e.alignCells(mxConstants.ALIGN_LEFT)},n),l=this.editorUi.toolbar.addButton("geSprite-aligncenter",mxResources.get("center"),function(){e.alignCells(mxConstants.ALIGN_CENTER)},n),s=this.editorUi.toolbar.addButton("geSprite-alignright",mxResources.get("right"),function(){e.alignCells(mxConstants.ALIGN_RIGHT)},n),o=this.editorUi.toolbar.addButton("geSprite-aligntop",mxResources.get("top"),function(){e.alignCells(mxConstants.ALIGN_TOP)},n),r=this.editorUi.toolbar.addButton("geSprite-alignmiddle",mxResources.get("middle"),function(){e.alignCells(mxConstants.ALIGN_MIDDLE)},n),a=this.editorUi.toolbar.addButton("geSprite-alignbottom",mxResources.get("bottom"),function(){e.alignCells(mxConstants.ALIGN_BOTTOM)},n);return this.styleButtons([i,l,s,o,r,a]),s.style.marginRight="6px",t.appendChild(n),t},ArrangePanel.prototype.addFlip=function(t){var e=this.editorUi.editor.graph;t.style.paddingTop="6px",t.style.paddingBottom="10px";var n=document.createElement("div");n.style.marginTop="2px",n.style.marginBottom="8px",n.style.fontWeight="bold",mxUtils.write(n,mxResources.get("flip")),t.appendChild(n);n=mxUtils.button(mxResources.get("horizontal"),function(t){e.toggleCellStyles(mxConstants.STYLE_FLIPH,!1)});return n.setAttribute("title",mxResources.get("horizontal")),n.style.width="100px",n.style.marginRight="2px",t.appendChild(n),(n=mxUtils.button(mxResources.get("vertical"),function(t){e.toggleCellStyles(mxConstants.STYLE_FLIPV,!1)})).setAttribute("title",mxResources.get("vertical")),n.style.width="100px",t.appendChild(n),t},ArrangePanel.prototype.addDistribute=function(t){var e=this.editorUi.editor.graph;t.style.paddingTop="6px",t.style.paddingBottom="12px",t.appendChild(this.createTitle(mxResources.get("distribute")));var n=mxUtils.button(mxResources.get("horizontal"),function(t){e.distributeCells(!0)});return n.setAttribute("title",mxResources.get("horizontal")),n.style.width="100px",n.style.marginRight="2px",t.appendChild(n),(n=mxUtils.button(mxResources.get("vertical"),function(t){e.distributeCells(!1)})).setAttribute("title",mxResources.get("vertical")),n.style.width="100px",t.appendChild(n),t},ArrangePanel.prototype.addAngle=function(t){var e=this.editorUi,n=e.editor.graph,i=this.format.getSelectionState();t.style.paddingBottom="8px";var l=document.createElement("div");l.style.position="absolute",l.style.width="70px",l.style.marginTop="0px",l.style.fontWeight="bold";var s,o=null,r=null,a=null;return!i.rotatable||i.table||i.row||i.cell?t.style.paddingTop="8px":(mxUtils.write(l,mxResources.get("angle")),t.appendChild(l),o=this.addUnitInput(t,"°",20,44,function(){r.apply(this,arguments)}),mxUtils.br(t),t.style.paddingTop="10px"),i.containsLabel||(l=mxResources.get("reverse"),0<i.vertices.length&&0<i.edges.length?l=mxResources.get("turn")+" / "+l:0<i.vertices.length&&(l=mxResources.get("turn")),(a=mxUtils.button(l,function(t){e.actions.get("turn").funct(t)})).setAttribute("title",l+" ("+this.editorUi.actions.get("turn").shortcut+")"),a.style.width="202px",t.appendChild(a),null!=o&&(a.style.marginTop="8px")),null!=o&&(s=mxUtils.bind(this,function(t,e,n){!n&&document.activeElement==o||(i=this.format.getSelectionState(),n=parseFloat(mxUtils.getValue(i.style,mxConstants.STYLE_ROTATION,0)),o.value=isNaN(n)?"":n+"°")}),r=this.installInputHandler(o,mxConstants.STYLE_ROTATION,0,0,360,"°",null,!0),this.addKeyHandler(o,s),n.getModel().addListener(mxEvent.CHANGE,s),this.listeners.push({destroy:function(){n.getModel().removeListener(s)}}),s()),t},BaseFormatPanel.prototype.getUnit=function(){switch(this.editorUi.editor.graph.view.unit){case mxConstants.POINTS:return"pt";case mxConstants.INCHES:return'"';case mxConstants.MILLIMETERS:return"mm"}},BaseFormatPanel.prototype.inUnit=function(t){return this.editorUi.editor.graph.view.formatUnitText(t)},BaseFormatPanel.prototype.fromUnit=function(t){switch(this.editorUi.editor.graph.view.unit){case mxConstants.POINTS:return t;case mxConstants.INCHES:return t*mxConstants.PIXELS_PER_INCH;case mxConstants.MILLIMETERS:return t*mxConstants.PIXELS_PER_MM}},BaseFormatPanel.prototype.isFloatUnit=function(){return this.editorUi.editor.graph.view.unit!=mxConstants.POINTS},BaseFormatPanel.prototype.getUnitStep=function(){switch(this.editorUi.editor.graph.view.unit){case mxConstants.POINTS:return 1;case mxConstants.INCHES:return.1;case mxConstants.MILLIMETERS:return.5}},ArrangePanel.prototype.addGeometry=function(t){var i=this,e=this.editorUi,l=e.editor.graph,s=this.format.getSelectionState(),o=this.createPanel();o.style.paddingBottom="8px";var n,r,a,h,d=document.createElement("div");d.style.position="absolute",d.style.width="50px",d.style.marginTop="0px",d.style.fontWeight="bold",mxUtils.write(d,mxResources.get("size")),o.appendChild(d);var u=this.addUnitInput(o,this.getUnit(),84,44,function(){n.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit()),p=this.addUnitInput(o,this.getUnit(),20,44,function(){r.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit()),m=document.createElement("div");m.className="geSprite geSprite-fit",m.setAttribute("title",mxResources.get("autosize")+" ("+this.editorUi.actions.get("autosize").shortcut+")"),m.style.position="relative",m.style.cursor="pointer",m.style.marginTop="-3px",m.style.border="0px",m.style.left="42px",mxUtils.setOpacity(m,50),mxEvent.addListener(m,"mouseenter",function(){mxUtils.setOpacity(m,100)}),mxEvent.addListener(m,"mouseleave",function(){mxUtils.setOpacity(m,50)}),mxEvent.addListener(m,"click",function(){e.actions.get("autosize").funct()}),o.appendChild(m),s.row?(u.style.visibility="hidden",u.nextSibling.style.visibility="hidden"):this.addLabel(o,mxResources.get("width"),84),this.addLabel(o,mxResources.get("height"),20),mxUtils.br(o);var c=document.createElement("div");c.style.paddingTop="8px",c.style.paddingRight="20px",c.style.whiteSpace="nowrap",c.style.textAlign="right";var g=this.createCellOption(mxResources.get("constrainProportions"),mxConstants.STYLE_ASPECT,null,"fixed","null");g.style.width="100%",c.appendChild(g),s.cell||s.row?m.style.visibility="hidden":o.appendChild(c);var x=g.getElementsByTagName("input")[0];this.addKeyHandler(u,v),this.addKeyHandler(p,v),n=this.addGeometryHandler(u,function(t,e,n){return l.isTableCell(n)?(l.setTableColumnWidth(n,e-t.width,!0),!0):void(0<t.width&&(e=Math.max(1,i.fromUnit(e)),x.checked&&(t.height=Math.round(t.height*e*100/t.width)/100),t.width=e))}),r=this.addGeometryHandler(p,function(t,e,n){return l.isTableCell(n)&&(n=l.model.getParent(n)),l.isTableRow(n)?(l.setTableRowHeight(n,e-t.height),!0):void(0<t.height&&(e=Math.max(1,i.fromUnit(e)),x.checked&&(t.width=Math.round(t.width*e*100/t.height)/100),t.height=e))}),(s.resizable||s.row||s.cell)&&t.appendChild(o);var y=this.createPanel();y.style.paddingBottom="30px",(d=document.createElement("div")).style.position="absolute",d.style.width="70px",d.style.marginTop="0px",d.style.fontWeight="bold",mxUtils.write(d,mxResources.get("position")),y.appendChild(d);var f=this.addUnitInput(y,this.getUnit(),84,44,function(){a.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit()),C=this.addUnitInput(y,this.getUnit(),20,44,function(){h.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());mxUtils.br(y),this.addLabel(y,mxResources.get("left"),84),this.addLabel(y,mxResources.get("top"),20);var v=mxUtils.bind(this,function(t,e,n){(s=this.format.getSelectionState()).containsLabel||s.vertices.length!=l.getSelectionCount()||null==s.width||null==s.height?o.style.display="none":(o.style.display="",!n&&document.activeElement==u||(u.value=this.inUnit(s.width)+(""==s.width?"":" "+this.getUnit())),!n&&document.activeElement==p||(p.value=this.inUnit(s.height)+(""==s.height?"":" "+this.getUnit()))),s.vertices.length==l.getSelectionCount()&&null!=s.x&&null!=s.y?(y.style.display="",!n&&document.activeElement==f||(f.value=this.inUnit(s.x)+(""==s.x?"":" "+this.getUnit())),!n&&document.activeElement==C||(C.value=this.inUnit(s.y)+(""==s.y?"":" "+this.getUnit()))):y.style.display="none"});this.addKeyHandler(f,v),this.addKeyHandler(C,v),l.getModel().addListener(mxEvent.CHANGE,v),this.listeners.push({destroy:function(){l.getModel().removeListener(v)}}),v(),a=this.addGeometryHandler(f,function(t,e){e=i.fromUnit(e),t.relative?t.offset.x=e:t.x=e}),h=this.addGeometryHandler(C,function(t,e){e=i.fromUnit(e),t.relative?t.offset.y=e:t.y=e}),s.movable&&t.appendChild(y)},ArrangePanel.prototype.addGeometryHandler=function(o,r){var a=this.editorUi.editor.graph,h=null,d=this;function t(t){if(""!=o.value){var e=parseFloat(o.value);if(isNaN(e))o.value=h+" "+d.getUnit();else if(e!=h){a.getModel().beginUpdate();try{for(var n,i,l=a.getSelectionCells(),s=0;s<l.length;s++)!a.getModel().isVertex(l[s])||null!=(i=a.getCellGeometry(l[s]))&&(i=i.clone(),r(i,e,l[s])||(null!=(n=a.view.getState(l[s]))&&a.isRecursiveVertexResize(n)&&a.resizeChildCells(l[s],i),a.getModel().setGeometry(l[s],i),a.constrainChildCells(l[s])))}finally{a.getModel().endUpdate()}h=e,o.value=e+" "+d.getUnit()}}mxEvent.consume(t)}return mxEvent.addListener(o,"blur",t),mxEvent.addListener(o,"change",t),mxEvent.addListener(o,"focus",function(){h=o.value}),t},ArrangePanel.prototype.addEdgeGeometryHandler=function(s,o){var r=this.editorUi.editor.graph,a=null;function t(t){if(""!=s.value){var e=parseFloat(s.value);if(isNaN(e))s.value=a+" pt";else if(e!=a){r.getModel().beginUpdate();try{for(var n,i=r.getSelectionCells(),l=0;l<i.length;l++)!r.getModel().isEdge(i[l])||null!=(n=r.getCellGeometry(i[l]))&&(n=n.clone(),o(n,e),r.getModel().setGeometry(i[l],n))}finally{r.getModel().endUpdate()}a=e,s.value=e+" pt"}}mxEvent.consume(t)}return mxEvent.addListener(s,"blur",t),mxEvent.addListener(s,"change",t),mxEvent.addListener(s,"focus",function(){a=s.value}),t},ArrangePanel.prototype.addEdgeGeometry=function(t){var e,n=this.editorUi,s=n.editor.graph,o=this.format.getSelectionState(),r=this.createPanel(),i=document.createElement("div");i.style.position="absolute",i.style.width="70px",i.style.marginTop="0px",i.style.fontWeight="bold",mxUtils.write(i,mxResources.get("width")),r.appendChild(i);var a=this.addUnitInput(r,"pt",20,44,function(){e.apply(this,arguments)});function e(t){var e=parseInt(a.value);(e=Math.min(999,Math.max(1,isNaN(e)?1:e)))!=mxUtils.getValue(o.style,"width",mxCellRenderer.defaultShapes.flexArrow.prototype.defaultWidth)&&(s.setCellStyles("width",e,s.getSelectionCells()),n.fireEvent(new mxEventObject("styleChanged","keys",["width"],"values",[e],"cells",s.getSelectionCells()))),a.value=e+" pt",mxEvent.consume(t)}mxUtils.br(r),this.addKeyHandler(a,l),mxEvent.addListener(a,"blur",e),mxEvent.addListener(a,"change",e),t.appendChild(r);var h=this.createPanel();h.style.paddingBottom="30px",(i=document.createElement("div")).style.position="absolute",i.style.width="70px",i.style.marginTop="0px",i.style.fontWeight="bold",mxUtils.write(i,"Start"),h.appendChild(i);var d=this.addUnitInput(h,"pt",84,44,function(){g.apply(this,arguments)}),u=this.addUnitInput(h,"pt",20,44,function(){x.apply(this,arguments)});mxUtils.br(h),this.addLabel(h,mxResources.get("left"),84),this.addLabel(h,mxResources.get("top"),20),t.appendChild(h),this.addKeyHandler(d,l),this.addKeyHandler(u,l);var p=this.createPanel();p.style.paddingBottom="30px",(i=document.createElement("div")).style.position="absolute",i.style.width="70px",i.style.marginTop="0px",i.style.fontWeight="bold",mxUtils.write(i,"End"),p.appendChild(i);var m=this.addUnitInput(p,"pt",84,44,function(){y.apply(this,arguments)}),c=this.addUnitInput(p,"pt",20,44,function(){f.apply(this,arguments)});mxUtils.br(p),this.addLabel(p,mxResources.get("left"),84),this.addLabel(p,mxResources.get("top"),20),t.appendChild(p),this.addKeyHandler(m,l),this.addKeyHandler(c,l);var l=mxUtils.bind(this,function(t,e,n){o=this.format.getSelectionState();var i,l=s.getSelectionCell();"link"==o.style.shape||"flexArrow"==o.style.shape?(r.style.display="",!n&&document.activeElement==a||(i=mxUtils.getValue(o.style,"width",mxCellRenderer.defaultShapes.flexArrow.prototype.defaultWidth),a.value=i+" pt")):r.style.display="none",1==s.getSelectionCount()&&s.model.isEdge(l)?(null!=(i=s.model.getGeometry(l)).sourcePoint&&null==s.model.getTerminal(l,!0)?(d.value=i.sourcePoint.x,u.value=i.sourcePoint.y):h.style.display="none",null!=i.targetPoint&&null==s.model.getTerminal(l,!1)?(m.value=i.targetPoint.x,c.value=i.targetPoint.y):p.style.display="none"):(h.style.display="none",p.style.display="none")}),g=this.addEdgeGeometryHandler(d,function(t,e){t.sourcePoint.x=e}),x=this.addEdgeGeometryHandler(u,function(t,e){t.sourcePoint.y=e}),y=this.addEdgeGeometryHandler(m,function(t,e){t.targetPoint.x=e}),f=this.addEdgeGeometryHandler(c,function(t,e){t.targetPoint.y=e});s.getModel().addListener(mxEvent.CHANGE,l),this.listeners.push({destroy:function(){s.getModel().removeListener(l)}}),l()},TextFormatPanel=function(t,e,n){BaseFormatPanel.call(this,t,e,n),this.init()},mxUtils.extend(TextFormatPanel,BaseFormatPanel),TextFormatPanel.prototype.init=function(){this.container.style.borderBottom="none",this.addFont(this.container)},TextFormatPanel.prototype.addFont=function(t){var e=this.editorUi,c=e.editor.graph,g=this.format.getSelectionState(),n=this.createTitle(mxResources.get("font"));n.style.paddingLeft="18px",n.style.paddingTop="10px",n.style.paddingBottom="6px",t.appendChild(n);var i=this.createPanel();i.style.paddingTop="2px",i.style.paddingBottom="2px",i.style.position="relative",i.style.marginLeft="-2px",i.style.borderWidth="0px",i.className="geToolbarContainer",mxClient.IS_QUIRKS&&(i.style.display="block"),c.cellEditor.isContentEditing()&&(r=i.cloneNode(),(a=this.editorUi.toolbar.addMenu(mxResources.get("style"),mxResources.get("style"),!0,"formatBlock",r,null,!0)).style.color="rgb(112, 112, 112)",a.style.whiteSpace="nowrap",a.style.overflow="hidden",a.style.margin="0px",this.addArrow(a),a.style.width="192px",a.style.height="15px",a.getElementsByTagName("div")[0].style.cssFloat="right",t.appendChild(r)),t.appendChild(i);var l=this.createPanel();l.style.marginTop="8px",l.style.borderTop="1px solid #c0c0c0",l.style.paddingTop="6px",l.style.paddingBottom="6px";var x=this.editorUi.toolbar.addMenu("Helvetica",mxResources.get("fontFamily"),!0,"fontFamily",i,null,!0);x.style.color="rgb(112, 112, 112)",x.style.whiteSpace="nowrap",x.style.overflow="hidden",x.style.margin="0px",this.addArrow(x),x.style.width="192px",x.style.height="15px";var s=i.cloneNode(!1);s.style.marginLeft="-3px";var y=this.editorUi.toolbar.addItems(["bold","italic","underline"],s,!0);y[0].setAttribute("title",mxResources.get("bold")+" ("+this.editorUi.actions.get("bold").shortcut+")"),y[1].setAttribute("title",mxResources.get("italic")+" ("+this.editorUi.actions.get("italic").shortcut+")"),y[2].setAttribute("title",mxResources.get("underline")+" ("+this.editorUi.actions.get("underline").shortcut+")");var o=this.editorUi.toolbar.addItems(["vertical"],s,!0)[0];mxClient.IS_QUIRKS&&mxUtils.br(t),t.appendChild(s),this.styleButtons(y),this.styleButtons([o]);n=i.cloneNode(!1);n.style.marginLeft="-3px",n.style.paddingBottom="0px";var r,a=function(t){return function(){return t()}},f=this.editorUi.toolbar.addButton("geSprite-left",mxResources.get("left"),c.cellEditor.isContentEditing()?function(t){c.cellEditor.alignText(mxConstants.ALIGN_LEFT,t)}:a(this.editorUi.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT])),n),C=this.editorUi.toolbar.addButton("geSprite-center",mxResources.get("center"),c.cellEditor.isContentEditing()?function(t){c.cellEditor.alignText(mxConstants.ALIGN_CENTER,t)}:a(this.editorUi.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_CENTER])),n),v=this.editorUi.toolbar.addButton("geSprite-right",mxResources.get("right"),c.cellEditor.isContentEditing()?function(t){c.cellEditor.alignText(mxConstants.ALIGN_RIGHT,t)}:a(this.editorUi.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT])),n);this.styleButtons([f,C,v]),c.cellEditor.isContentEditing()&&(r=this.editorUi.toolbar.addButton("geSprite-removeformat",mxResources.get("strikethrough"),function(){document.execCommand("strikeThrough",!1,null)},s),this.styleButtons([r]),r.firstChild.style.background="url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0wIDBoMjR2MjRIMFYweiIvPjwvZGVmcz48Y2xpcFBhdGggaWQ9ImIiPjx1c2UgeGxpbms6aHJlZj0iI2EiIG92ZXJmbG93PSJ2aXNpYmxlIi8+PC9jbGlwUGF0aD48cGF0aCBjbGlwLXBhdGg9InVybCgjYikiIGZpbGw9IiMwMTAxMDEiIGQ9Ik03LjI0IDguNzVjLS4yNi0uNDgtLjM5LTEuMDMtLjM5LTEuNjcgMC0uNjEuMTMtMS4xNi40LTEuNjcuMjYtLjUuNjMtLjkzIDEuMTEtMS4yOS40OC0uMzUgMS4wNS0uNjMgMS43LS44My42Ni0uMTkgMS4zOS0uMjkgMi4xOC0uMjkuODEgMCAxLjU0LjExIDIuMjEuMzQuNjYuMjIgMS4yMy41NCAxLjY5Ljk0LjQ3LjQuODMuODggMS4wOCAxLjQzLjI1LjU1LjM4IDEuMTUuMzggMS44MWgtMy4wMWMwLS4zMS0uMDUtLjU5LS4xNS0uODUtLjA5LS4yNy0uMjQtLjQ5LS40NC0uNjgtLjItLjE5LS40NS0uMzMtLjc1LS40NC0uMy0uMS0uNjYtLjE2LTEuMDYtLjE2LS4zOSAwLS43NC4wNC0xLjAzLjEzLS4yOS4wOS0uNTMuMjEtLjcyLjM2LS4xOS4xNi0uMzQuMzQtLjQ0LjU1LS4xLjIxLS4xNS40My0uMTUuNjYgMCAuNDguMjUuODguNzQgMS4yMS4zOC4yNS43Ny40OCAxLjQxLjdINy4zOWMtLjA1LS4wOC0uMTEtLjE3LS4xNS0uMjV6TTIxIDEydi0ySDN2Mmg5LjYyYy4xOC4wNy40LjE0LjU1LjIuMzcuMTcuNjYuMzQuODcuNTEuMjEuMTcuMzUuMzYuNDMuNTcuMDcuMi4xMS40My4xMS42OSAwIC4yMy0uMDUuNDUtLjE0LjY2LS4wOS4yLS4yMy4zOC0uNDIuNTMtLjE5LjE1LS40Mi4yNi0uNzEuMzUtLjI5LjA4LS42My4xMy0xLjAxLjEzLS40MyAwLS44My0uMDQtMS4xOC0uMTNzLS42Ni0uMjMtLjkxLS40MmMtLjI1LS4xOS0uNDUtLjQ0LS41OS0uNzUtLjE0LS4zMS0uMjUtLjc2LS4yNS0xLjIxSDYuNGMwIC41NS4wOCAxLjEzLjI0IDEuNTguMTYuNDUuMzcuODUuNjUgMS4yMS4yOC4zNS42LjY2Ljk4LjkyLjM3LjI2Ljc4LjQ4IDEuMjIuNjUuNDQuMTcuOS4zIDEuMzguMzkuNDguMDguOTYuMTMgMS40NC4xMy44IDAgMS41My0uMDkgMi4xOC0uMjhzMS4yMS0uNDUgMS42Ny0uNzljLjQ2LS4zNC44Mi0uNzcgMS4wNy0xLjI3cy4zOC0xLjA3LjM4LTEuNzFjMC0uNi0uMS0xLjE0LS4zMS0xLjYxLS4wNS0uMTEtLjExLS4yMy0uMTctLjMzSDIxeiIvPjwvc3ZnPg==)",r.firstChild.style.backgroundPosition="2px 2px",r.firstChild.style.backgroundSize="18px 18px",this.styleButtons([r]));var E,S,w,b,T,A,L,h=this.editorUi.toolbar.addButton("geSprite-top",mxResources.get("top"),a(this.editorUi.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP])),n),d=this.editorUi.toolbar.addButton("geSprite-middle",mxResources.get("middle"),a(this.editorUi.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE])),n),u=this.editorUi.toolbar.addButton("geSprite-bottom",mxResources.get("bottom"),a(this.editorUi.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_BOTTOM])),n);this.styleButtons([h,d,u]),mxClient.IS_QUIRKS&&mxUtils.br(t),t.appendChild(n),c.cellEditor.isContentEditing()?(h.style.display="none",d.style.display="none",u.style.display="none",o.style.display="none",(w=this.editorUi.toolbar.addButton("geSprite-justifyfull",mxResources.get("block"),function(){1==w.style.opacity&&document.execCommand("justifyfull",!1,null)},n)).style.marginRight="9px",w.style.opacity=1,this.styleButtons([w,E=this.editorUi.toolbar.addButton("geSprite-subscript",mxResources.get("subscript")+" ("+Editor.ctrlKey+"+,)",function(){document.execCommand("subscript",!1,null)},n),S=this.editorUi.toolbar.addButton("geSprite-superscript",mxResources.get("superscript")+" ("+Editor.ctrlKey+"+.)",function(){document.execCommand("superscript",!1,null)},n)]),E.style.marginLeft="9px",(P=n.cloneNode(!1)).style.paddingTop="4px",Z=[this.editorUi.toolbar.addButton("geSprite-orderedlist",mxResources.get("numberedList"),function(){document.execCommand("insertorderedlist",!1,null)},P),this.editorUi.toolbar.addButton("geSprite-unorderedlist",mxResources.get("bulletedList"),function(){document.execCommand("insertunorderedlist",!1,null)},P),this.editorUi.toolbar.addButton("geSprite-outdent",mxResources.get("decreaseIndent"),function(){document.execCommand("outdent",!1,null)},P),this.editorUi.toolbar.addButton("geSprite-indent",mxResources.get("increaseIndent"),function(){document.execCommand("indent",!1,null)},P),this.editorUi.toolbar.addButton("geSprite-removeformat",mxResources.get("removeFormat"),function(){document.execCommand("removeformat",!1,null)},P),this.editorUi.toolbar.addButton("geSprite-code",mxResources.get("html"),function(){c.cellEditor.toggleViewMode()},P)],this.styleButtons(Z),Z[Z.length-2].style.marginLeft="9px",mxClient.IS_QUIRKS&&(mxUtils.br(t),P.style.height="40"),t.appendChild(P)):(y[2].style.marginRight="9px",v.style.marginRight="9px");n=i.cloneNode(!1);n.style.marginLeft="0px",n.style.paddingTop="8px",n.style.paddingBottom="4px",n.style.fontWeight="normal",mxUtils.write(n,mxResources.get("position"));var p=document.createElement("select");p.style.position="absolute",p.style.right="20px",p.style.width="97px",p.style.marginTop="-2px";for(var m=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],I={topLeft:[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_BOTTOM],top:[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_TOP,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_BOTTOM],topRight:[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM],left:[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_MIDDLE],center:[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE],right:[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE],bottomLeft:[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP],bottom:[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_TOP],bottomRight:[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP]},M=0;M<m.length;M++){var R=document.createElement("option");R.setAttribute("value",m[M]),mxUtils.write(R,mxResources.get(m[M])),p.appendChild(R)}n.appendChild(p);var P=i.cloneNode(!1);P.style.marginLeft="0px",P.style.paddingTop="4px",P.style.paddingBottom="4px",P.style.fontWeight="normal",mxUtils.write(P,mxResources.get("writingDirection"));var O=document.createElement("select");O.style.position="absolute",O.style.right="20px",O.style.width="97px",O.style.marginTop="-2px";for(var U=["automatic","leftToRight","rightToLeft"],N={automatic:null,leftToRight:mxConstants.TEXT_DIRECTION_LTR,rightToLeft:mxConstants.TEXT_DIRECTION_RTL},M=0;M<U.length;M++){var H=document.createElement("option");H.setAttribute("value",U[M]),mxUtils.write(H,mxResources.get(U[M])),O.appendChild(H)}P.appendChild(O),c.isEditing()||(t.appendChild(n),mxEvent.addListener(p,"change",function(t){c.getModel().beginUpdate();try{var e=I[p.value];null!=e&&(c.setCellStyles(mxConstants.STYLE_LABEL_POSITION,e[0],c.getSelectionCells()),c.setCellStyles(mxConstants.STYLE_VERTICAL_LABEL_POSITION,e[1],c.getSelectionCells()),c.setCellStyles(mxConstants.STYLE_ALIGN,e[2],c.getSelectionCells()),c.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,e[3],c.getSelectionCells()))}finally{c.getModel().endUpdate()}mxEvent.consume(t)}),t.appendChild(P),mxEvent.addListener(O,"change",function(t){c.setCellStyles(mxConstants.STYLE_TEXT_DIRECTION,N[O.value],c.getSelectionCells()),mxEvent.consume(t)}));var _=document.createElement("input");_.style.textAlign="right",_.style.marginTop="4px",mxClient.IS_QUIRKS||(_.style.position="absolute",_.style.right="32px"),_.style.width="40px",_.style.height=mxClient.IS_QUIRKS?"21px":"17px",s.appendChild(_);var D=null,n=this.installInputHandler(_,mxConstants.STYLE_FONTSIZE,Menus.prototype.defaultFontSize,1,999," pt",function(n){if(!window.getSelection||mxClient.IS_IE||mxClient.IS_IE11){if(window.getSelection||document.selection){var t=null;if(document.selection?t=document.selection.createRange().parentElement():0<(i=window.getSelection()).rangeCount&&(t=i.getRangeAt(0).commonAncestorContainer),null!=t&&function(t,e){for(;null!=e;){if(e===t)return 1;e=e.parentNode}}(c.cellEditor.textarea,t)){D=n,document.execCommand("fontSize",!1,"4");for(l=c.cellEditor.textarea.getElementsByTagName("font"),s=0;s<l.length;s++)if("4"==l[s].getAttribute("size")){l[s].removeAttribute("size"),l[s].style.fontSize=D+"px",window.setTimeout(function(){_.value=D+" pt",D=null},0);break}}}}else{var i,t=0<(i=window.getSelection()).rangeCount?i.getRangeAt(0).commonAncestorContainer:c.cellEditor.textarea;function e(t,e){null!=c.cellEditor.textarea&&t!=c.cellEditor.textarea&&c.cellEditor.textarea.contains(t)&&(e||i.containsNode(t,!0))&&("FONT"==t.nodeName?(t.removeAttribute("size"),t.style.fontSize=n+"px"):mxUtils.getCurrentStyle(t).fontSize!=n+"px"&&(mxUtils.getCurrentStyle(t.parentNode).fontSize!=n+"px"?t.style.fontSize=n+"px":t.style.fontSize=""))}if(t!=c.cellEditor.textarea&&t.nodeType==mxConstants.NODETYPE_ELEMENT||document.execCommand("fontSize",!1,"1"),t!=c.cellEditor.textarea&&(t=t.parentNode),null!=t&&t.nodeType==mxConstants.NODETYPE_ELEMENT){var l=t.getElementsByTagName("*");e(t);for(var s=0;s<l.length;s++)e(l[s])}_.value=n+" pt"}},!0),P=this.createStepper(_,n,1,10,!0,Menus.prototype.defaultFontSize);P.style.display=_.style.display,P.style.marginTop="4px",mxClient.IS_QUIRKS||(P.style.right="20px"),s.appendChild(P),x.getElementsByTagName("div")[0].style.cssFloat="right";var G=null,k="#ffffff",V=null,F="#000000",B=c.cellEditor.isContentEditing()?this.createColorOption(mxResources.get("backgroundColor"),function(){return k},function(t){document.execCommand("backcolor",!1,t!=mxConstants.NONE?t:"transparent")},"#ffffff",{install:function(t){G=t},destroy:function(){G=null}},null,!0):this.createCellColorOption(mxResources.get("backgroundColor"),mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"#ffffff",null,function(t){c.updateLabelElements(c.getSelectionCells(),function(t){t.style.backgroundColor=null})});B.style.fontWeight="bold";var z=this.createCellColorOption(mxResources.get("borderColor"),mxConstants.STYLE_LABEL_BORDERCOLOR,"#000000");z.style.fontWeight="bold";n=1<=g.vertices.length?c.stylesheet.getDefaultVertexStyle():c.stylesheet.getDefaultEdgeStyle(),s=c.cellEditor.isContentEditing()?this.createColorOption(mxResources.get("fontColor"),function(){return F},function(t){if(mxClient.IS_FF){for(var e=c.cellEditor.textarea.getElementsByTagName("font"),n=[],i=0;i<e.length;i++)n.push({node:e[i],color:e[i].getAttribute("color")});document.execCommand("forecolor",!1,t!=mxConstants.NONE?t:"transparent");for(var l=c.cellEditor.textarea.getElementsByTagName("font"),i=0;i<l.length;i++)if(i>=n.length||l[i]!=n[i].node||l[i]==n[i].node&&l[i].getAttribute("color")!=n[i].color){var s=l[i].firstChild;if(null!=s&&"A"==s.nodeName&&null==s.nextSibling&&null!=s.firstChild){l[i].parentNode.insertBefore(s,l[i]);for(e=s.firstChild;null!=e;){var o=e.nextSibling;l[i].appendChild(e),e=o}s.appendChild(l[i])}break}}else document.execCommand("forecolor",!1,t!=mxConstants.NONE?t:"transparent")},null!=n[mxConstants.STYLE_FONTCOLOR]?n[mxConstants.STYLE_FONTCOLOR]:"#000000",{install:function(t){V=t},destroy:function(){V=null}},null,!0):this.createCellColorOption(mxResources.get("fontColor"),mxConstants.STYLE_FONTCOLOR,null!=n[mxConstants.STYLE_FONTCOLOR]?n[mxConstants.STYLE_FONTCOLOR]:"#000000",function(t){t==mxConstants.NONE?B.style.display="none":B.style.display="",z.style.display=B.style.display},function(t){t==mxConstants.NONE?c.setCellStyles(mxConstants.STYLE_NOLABEL,"1",c.getSelectionCells()):c.setCellStyles(mxConstants.STYLE_NOLABEL,null,c.getSelectionCells()),c.updateCellStyles(mxConstants.STYLE_FONTCOLOR,t,c.getSelectionCells()),c.updateLabelElements(c.getSelectionCells(),function(t){t.removeAttribute("color"),t.style.color=null})});s.style.fontWeight="bold",l.appendChild(s),l.appendChild(B),c.cellEditor.isContentEditing()||l.appendChild(z),t.appendChild(l);P=this.createPanel();P.style.paddingTop="2px",P.style.paddingBottom="4px";n=this.createCellOption(mxResources.get("wordWrap"),mxConstants.STYLE_WHITE_SPACE,null,"wrap","null",null,null,!0);n.style.fontWeight="bold",g.containsLabel||g.autoSize||0!=g.edges.length||P.appendChild(n);s=this.createCellOption(mxResources.get("formattedText"),"html","0",null,null,null,e.actions.get("formattedText"));s.style.fontWeight="bold",P.appendChild(s);l=this.createPanel();l.style.paddingTop="10px",l.style.paddingBottom="28px",l.style.fontWeight="normal";n=document.createElement("div");n.style.position="absolute",n.style.width="70px",n.style.marginTop="0px",n.style.fontWeight="bold",mxUtils.write(n,mxResources.get("spacing")),l.appendChild(n);var Y=this.addUnitInput(l,"pt",91,44,function(){nt.apply(this,arguments)}),W=this.addUnitInput(l,"pt",20,44,function(){et.apply(this,arguments)});mxUtils.br(l),this.addLabel(l,mxResources.get("top"),91),this.addLabel(l,mxResources.get("global"),20),mxUtils.br(l),mxUtils.br(l);var j,X,Z,K=this.addUnitInput(l,"pt",162,44,function(){st.apply(this,arguments)}),Q=this.addUnitInput(l,"pt",91,44,function(){lt.apply(this,arguments)}),J=this.addUnitInput(l,"pt",20,44,function(){it.apply(this,arguments)});function q(t,e){mxClient.IS_IE&&(mxClient.IS_QUIRKS||document.documentMode<10)?t.style.filter=e?"progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#c5ecff', EndColorStr='#87d4fb', GradientType=0)":"":t.style.backgroundImage=e?"linear-gradient(#c5ecff 0px,#87d4fb 100%)":""}mxUtils.br(l),this.addLabel(l,mxResources.get("left"),162),this.addLabel(l,mxResources.get("bottom"),91),this.addLabel(l,mxResources.get("right"),20),c.cellEditor.isContentEditing()?(X=j=null,t.appendChild(this.createRelativeOption(mxResources.get("lineheight"),null,null,function(t){var e=""==t.value?120:parseInt(t.value),e=Math.max(0,isNaN(e)?120:e);null!=j&&(c.cellEditor.restoreSelection(j),j=null);for(var n=c.getSelectedElement();null!=n&&n.nodeType!=mxConstants.NODETYPE_ELEMENT;)n=n.parentNode;null!=n&&n==c.cellEditor.textarea&&null!=c.cellEditor.textarea.firstChild&&("P"!=c.cellEditor.textarea.firstChild.nodeName&&(c.cellEditor.textarea.innerHTML="<p>"+c.cellEditor.textarea.innerHTML+"</p>"),n=c.cellEditor.textarea.firstChild),null!=n&&null!=c.cellEditor.textarea&&n!=c.cellEditor.textarea&&c.cellEditor.textarea.contains(n)&&(n.style.lineHeight=e+"%"),t.value=e+" %"},function(t){X=t,mxEvent.addListener(t,"mousedown",function(){document.activeElement==c.cellEditor.textarea&&(j=c.cellEditor.saveSelection())}),mxEvent.addListener(t,"touchstart",function(){document.activeElement==c.cellEditor.textarea&&(j=c.cellEditor.saveSelection())}),t.value="120 %"})),(s=i.cloneNode(!1)).style.paddingLeft="0px",n=this.editorUi.toolbar.addItems(["link","image"],s,!0),Z=[this.editorUi.toolbar.addButton("geSprite-horizontalrule",mxResources.get("insertHorizontalRule"),function(){document.execCommand("inserthorizontalrule",!1)},s),this.editorUi.toolbar.addMenuFunctionInContainer(s,"geSprite-table",mxResources.get("table"),!1,mxUtils.bind(this,function(t){this.editorUi.menus.addInsertTableItem(t)}))],this.styleButtons(n),this.styleButtons(Z),(n=this.createPanel()).style.paddingTop="10px",n.style.paddingBottom="10px",n.appendChild(this.createTitle(mxResources.get("insert"))),n.appendChild(s),t.appendChild(n),mxClient.IS_QUIRKS&&(n.style.height="70"),(s=i.cloneNode(!1)).style.paddingLeft="0px",Z=[this.editorUi.toolbar.addButton("geSprite-insertcolumnbefore",mxResources.get("insertColumnBefore"),mxUtils.bind(this,function(){try{null!=T&&c.insertColumn(T,null!=A?A.cellIndex:0)}catch(t){this.editorUi.handleError(t)}}),s),this.editorUi.toolbar.addButton("geSprite-insertcolumnafter",mxResources.get("insertColumnAfter"),mxUtils.bind(this,function(){try{null!=T&&c.insertColumn(T,null!=A?A.cellIndex+1:-1)}catch(t){this.editorUi.handleError(t)}}),s),this.editorUi.toolbar.addButton("geSprite-deletecolumn",mxResources.get("deleteColumn"),mxUtils.bind(this,function(){try{null!=T&&null!=A&&c.deleteColumn(T,A.cellIndex)}catch(t){this.editorUi.handleError(t)}}),s),this.editorUi.toolbar.addButton("geSprite-insertrowbefore",mxResources.get("insertRowBefore"),mxUtils.bind(this,function(){try{null!=T&&null!=L&&c.insertRow(T,L.sectionRowIndex)}catch(t){this.editorUi.handleError(t)}}),s),this.editorUi.toolbar.addButton("geSprite-insertrowafter",mxResources.get("insertRowAfter"),mxUtils.bind(this,function(){try{null!=T&&null!=L&&c.insertRow(T,L.sectionRowIndex+1)}catch(t){this.editorUi.handleError(t)}}),s),this.editorUi.toolbar.addButton("geSprite-deleterow",mxResources.get("deleteRow"),mxUtils.bind(this,function(){try{null!=T&&null!=L&&c.deleteRow(T,L.sectionRowIndex)}catch(t){this.editorUi.handleError(t)}}),s)],this.styleButtons(Z),Z[2].style.marginRight="9px",(n=this.createPanel()).style.paddingTop="10px",n.style.paddingBottom="10px",n.appendChild(this.createTitle(mxResources.get("table"))),n.appendChild(s),mxClient.IS_QUIRKS&&(mxUtils.br(t),n.style.height="70"),(i=i.cloneNode(!1)).style.paddingLeft="0px",Z=[this.editorUi.toolbar.addButton("geSprite-strokecolor",mxResources.get("borderColor"),mxUtils.bind(this,function(n){var t;null!=T&&(t=T.style.borderColor.replace(/\brgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/g,function(t,e,n,i){return"#"+("0"+Number(e).toString(16)).substr(-2)+("0"+Number(n).toString(16)).substr(-2)+("0"+Number(i).toString(16)).substr(-2)}),this.editorUi.pickColor(t,function(t){var e=null==A||null!=n&&mxEvent.isShiftDown(n)?T:A;c.processElements(e,function(t){t.style.border=null}),null==t||t==mxConstants.NONE?(e.removeAttribute("border"),e.style.border="",e.style.borderCollapse=""):(e.setAttribute("border","1"),e.style.border="1px solid "+t,e.style.borderCollapse="collapse")}))}),i),this.editorUi.toolbar.addButton("geSprite-fillcolor",mxResources.get("backgroundColor"),mxUtils.bind(this,function(n){var t;null!=T&&(t=T.style.backgroundColor.replace(/\brgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/g,function(t,e,n,i){return"#"+("0"+Number(e).toString(16)).substr(-2)+("0"+Number(n).toString(16)).substr(-2)+("0"+Number(i).toString(16)).substr(-2)}),this.editorUi.pickColor(t,function(t){var e=null==A||null!=n&&mxEvent.isShiftDown(n)?T:A;c.processElements(e,function(t){t.style.backgroundColor=null}),null==t||t==mxConstants.NONE?e.style.backgroundColor="":e.style.backgroundColor=t}))}),i),this.editorUi.toolbar.addButton("geSprite-fit",mxResources.get("spacing"),function(){var t;null!=T&&(t=T.getAttribute("cellPadding")||0,t=new FilenameDialog(e,t,mxResources.get("apply"),mxUtils.bind(this,function(t){null!=t&&0<t.length?T.setAttribute("cellPadding",t):T.removeAttribute("cellPadding")}),mxResources.get("spacing")),e.showDialog(t.container,300,80,!0,!0),t.init())},i),this.editorUi.toolbar.addButton("geSprite-left",mxResources.get("left"),function(){null!=T&&T.setAttribute("align","left")},i),this.editorUi.toolbar.addButton("geSprite-center",mxResources.get("center"),function(){null!=T&&T.setAttribute("align","center")},i),this.editorUi.toolbar.addButton("geSprite-right",mxResources.get("right"),function(){null!=T&&T.setAttribute("align","right")},i)],this.styleButtons(Z),Z[2].style.marginRight="9px",mxClient.IS_QUIRKS&&(mxUtils.br(n),mxUtils.br(n)),n.appendChild(i),t.appendChild(n),b=n):(t.appendChild(P),t.appendChild(this.createRelativeOption(mxResources.get("opacity"),mxConstants.STYLE_TEXT_OPACITY)),t.appendChild(l));var $,tt=mxUtils.bind(this,function(t,e,n){g=this.format.getSelectionState();var i=mxUtils.getValue(g.style,mxConstants.STYLE_FONTSTYLE,0);q(y[0],(i&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD),q(y[1],(i&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC),q(y[2],(i&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE),x.firstChild.nodeValue=mxUtils.getValue(g.style,mxConstants.STYLE_FONTFAMILY,Menus.prototype.defaultFont),q(o,"0"==mxUtils.getValue(g.style,mxConstants.STYLE_HORIZONTAL,"1")),!n&&document.activeElement==_||(s=parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_FONTSIZE,Menus.prototype.defaultFontSize)),_.value=isNaN(s)?"":s+" pt");var l=mxUtils.getValue(g.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER);q(f,l==mxConstants.ALIGN_LEFT),q(C,l==mxConstants.ALIGN_CENTER),q(v,l==mxConstants.ALIGN_RIGHT);i=mxUtils.getValue(g.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);q(h,i==mxConstants.ALIGN_TOP),q(d,i==mxConstants.ALIGN_MIDDLE),q(u,i==mxConstants.ALIGN_BOTTOM);l=mxUtils.getValue(g.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),i=mxUtils.getValue(g.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);l==mxConstants.ALIGN_LEFT&&i==mxConstants.ALIGN_TOP?p.value="topLeft":l==mxConstants.ALIGN_CENTER&&i==mxConstants.ALIGN_TOP?p.value="top":l==mxConstants.ALIGN_RIGHT&&i==mxConstants.ALIGN_TOP?p.value="topRight":l==mxConstants.ALIGN_LEFT&&i==mxConstants.ALIGN_BOTTOM?p.value="bottomLeft":l==mxConstants.ALIGN_CENTER&&i==mxConstants.ALIGN_BOTTOM?p.value="bottom":l==mxConstants.ALIGN_RIGHT&&i==mxConstants.ALIGN_BOTTOM?p.value="bottomRight":l==mxConstants.ALIGN_LEFT?p.value="left":l==mxConstants.ALIGN_RIGHT?p.value="right":p.value="center";var s,l=mxUtils.getValue(g.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);l==mxConstants.TEXT_DIRECTION_RTL?O.value="rightToLeft":l==mxConstants.TEXT_DIRECTION_LTR?O.value="leftToRight":l==mxConstants.TEXT_DIRECTION_AUTO&&(O.value="automatic"),!n&&document.activeElement==W||(s=parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_SPACING,2)),W.value=isNaN(s)?"":s+" pt"),!n&&document.activeElement==Y||(s=parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_SPACING_TOP,0)),Y.value=isNaN(s)?"":s+" pt"),!n&&document.activeElement==J||(s=parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_SPACING_RIGHT,0)),J.value=isNaN(s)?"":s+" pt"),!n&&document.activeElement==Q||(s=parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_SPACING_BOTTOM,0)),Q.value=isNaN(s)?"":s+" pt"),!n&&document.activeElement==K||(s=parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_SPACING_LEFT,0)),K.value=isNaN(s)?"":s+" pt")}),et=this.installInputHandler(W,mxConstants.STYLE_SPACING,2,-999,999," pt"),nt=this.installInputHandler(Y,mxConstants.STYLE_SPACING_TOP,0,-999,999," pt"),it=this.installInputHandler(J,mxConstants.STYLE_SPACING_RIGHT,0,-999,999," pt"),lt=this.installInputHandler(Q,mxConstants.STYLE_SPACING_BOTTOM,0,-999,999," pt"),st=this.installInputHandler(K,mxConstants.STYLE_SPACING_LEFT,0,-999,999," pt");return this.addKeyHandler(_,tt),this.addKeyHandler(W,tt),this.addKeyHandler(Y,tt),this.addKeyHandler(J,tt),this.addKeyHandler(Q,tt),this.addKeyHandler(K,tt),c.getModel().addListener(mxEvent.CHANGE,tt),this.listeners.push({destroy:function(){c.getModel().removeListener(tt)}}),tt(),c.cellEditor.isContentEditing()&&($=!1,l=function(){$||($=!0,window.setTimeout(function(){var n=c.getSelectedEditingElement();if(null!=n){function t(t,e,n){if(null==n.style||null==e)return"";e=e.lineHeight;return null!=n.style.lineHeight&&"%"==n.style.lineHeight.substring(n.style.lineHeight.length-1)?parseInt(n.style.lineHeight)/100:"px"==e.substring(e.length-2)?parseFloat(e)/t:parseInt(e)}function e(t){t=null!=t?t.fontSize:null;return null!=t&&"px"==t.substring(t.length-2)?parseFloat(t):mxConstants.DEFAULT_FONTSIZE}var i,l,s=mxUtils.getCurrentStyle(n),o=e(s),r=t(o,s,n),a=n.getElementsByTagName("*");if(0<a.length&&window.getSelection&&!mxClient.IS_IE&&!mxClient.IS_IE11)for(var h,d=window.getSelection(),u=0;u<a.length;u++)d.containsNode(a[u],!0)&&(temp=mxUtils.getCurrentStyle(a[u]),(h=t(o=Math.max(e(temp),o),temp,a[u]))==r&&!isNaN(h)||(r=""));function p(t){if(null!=c.getParentByName(n,t,c.cellEditor.textarea))return!0;for(var e=n;null!=e&&1==e.childNodes.length;)if((e=e.childNodes[0]).nodeName==t)return!0;return!1}function m(t,e){if(null!=t&&null!=e){if(t==e)return!0;if(t.length>e.length+1)return t.substring(t.length-e.length-1,t.length)=="-"+e}return!1}null!=s&&(q(y[0],"bold"==s.fontWeight||400<s.fontWeight||p("B")||p("STRONG")),q(y[1],"italic"==s.fontStyle||p("I")||p("EM")),q(y[2],p("U")),q(S,p("SUP")),q(E,p("SUB")),c.cellEditor.isTableSelected()?(q(w,m(s.textAlign,"justify")),q(f,m(s.textAlign,"left")),q(C,m(s.textAlign,"center")),q(v,m(s.textAlign,"right"))):(l=c.cellEditor.align||mxUtils.getValue(g.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),m(s.textAlign,"justify")?(q(w,m(s.textAlign,"justify")),q(f,!1),q(C,!1),q(v,!1)):(q(w,!1),q(f,l==mxConstants.ALIGN_LEFT),q(C,l==mxConstants.ALIGN_CENTER),q(v,l==mxConstants.ALIGN_RIGHT))),T=c.getParentByName(n,"TABLE",c.cellEditor.textarea),L=null==T?null:c.getParentByName(n,"TR",T),A=null==T?null:c.getParentByNames(n,["TD","TH"],T),b.style.display=null!=T?"":"none",document.activeElement!=_&&("FONT"==n.nodeName&&"4"==n.getAttribute("size")&&null!=D?(n.removeAttribute("size"),n.style.fontSize=D+" pt",D=null):_.value=isNaN(o)?"":o+" pt",h=parseFloat(r),isNaN(h)?X.value="100 %":X.value=Math.round(100*h)+" %"),i=s.color.replace(/\brgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/g,function(t,e,n,i){return"#"+("0"+Number(e).toString(16)).substr(-2)+("0"+Number(n).toString(16)).substr(-2)+("0"+Number(i).toString(16)).substr(-2)}),l=s.backgroundColor.replace(/\brgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/g,function(t,e,n,i){return"#"+("0"+Number(e).toString(16)).substr(-2)+("0"+Number(n).toString(16)).substr(-2)+("0"+Number(i).toString(16)).substr(-2)}),null!=V&&(F="#"==i.charAt(0)?i:"#000000",V(F,!0)),null!=G&&(k="#"==l.charAt(0)?l:null,G(k,!0)),null!=x.firstChild&&(x.firstChild.nodeValue=Graph.stripQuotes(s.fontFamily)))}$=!1},0))},(mxClient.IS_FF||mxClient.IS_EDGE||mxClient.IS_IE||mxClient.IS_IE11)&&mxEvent.addListener(c.cellEditor.textarea,"DOMSubtreeModified",l),mxEvent.addListener(c.cellEditor.textarea,"input",l),mxEvent.addListener(c.cellEditor.textarea,"touchend",l),mxEvent.addListener(c.cellEditor.textarea,"mouseup",l),mxEvent.addListener(c.cellEditor.textarea,"keyup",l),this.listeners.push({destroy:function(){}}),l()),t},StyleFormatPanel=function(t,e,n){BaseFormatPanel.call(this,t,e,n),this.init()},mxUtils.extend(StyleFormatPanel,BaseFormatPanel),StyleFormatPanel.prototype.defaultStrokeColor="black",StyleFormatPanel.prototype.init=function(){this.editorUi.editor.graph;var t=this.format.getSelectionState();t.containsLabel||(t.containsImage&&1==t.vertices.length&&"image"==t.style.shape&&null!=t.style.image&&"data:image/svg+xml;"==t.style.image.substring(0,19)&&this.container.appendChild(this.addSvgStyles(this.createPanel())),t.containsImage&&"image"!=t.style.shape||this.container.appendChild(this.addFill(this.createPanel())),this.container.appendChild(this.addStroke(this.createPanel())),this.container.appendChild(this.addLineJumps(this.createPanel())),(e=this.createRelativeOption(mxResources.get("opacity"),mxConstants.STYLE_OPACITY,41)).style.paddingTop="8px",e.style.paddingBottom="8px",this.container.appendChild(e),this.container.appendChild(this.addEffects(this.createPanel())));var e=this.addEditOps(this.createPanel());null!=e.firstChild&&mxUtils.br(e),this.container.appendChild(this.addStyleOps(e))},StyleFormatPanel.prototype.getCssRules=function(t){var e=document.implementation.createHTMLDocument(""),n=document.createElement("style");return mxUtils.setTextContent(n,t),e.body.appendChild(n),n.sheet.cssRules},StyleFormatPanel.prototype.addSvgStyles=function(t){this.editorUi.editor.graph;var e=this.format.getSelectionState();t.style.paddingTop="6px",t.style.paddingBottom="6px",t.style.fontWeight="bold",t.style.display="none";try{var n=e.style.editableCssRules;if(null!=n){var i=new RegExp(n),n=e.style.image.substring(e.style.image.indexOf(",")+1),n=window.atob?atob(n):Base64.decode(n,!0),l=mxUtils.parseXml(n);if(null!=l)for(var s=l.getElementsByTagName("style"),o=0;o<s.length;o++)for(var r=this.getCssRules(mxUtils.getTextContent(s[o])),a=0;a<r.length;a++)this.addSvgRule(t,r[a],l,s[o],r,a,i)}}catch(t){}return t},StyleFormatPanel.prototype.addSvgRule=function(l,t,s,o,r,a,e){var h=this.editorUi.editor.graph;e.test(t.selectorText)&&((e=mxUtils.bind(this,function(t,i,e){var n=mxUtils.trim(t.style[i]);""!=n&&"url("!=n.substring(0,4)&&(t=this.createColorOption(e+" "+t.selectorText,function(){return(t=(t=n).match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&4===t.length?"#"+("0"+parseInt(t[1],10).toString(16)).slice(-2)+("0"+parseInt(t[2],10).toString(16)).slice(-2)+("0"+parseInt(t[3],10).toString(16)).slice(-2):"";var t},function(t){r[a].style[i]=t;for(var e="",n=0;n<r.length;n++)e+=r[n].cssText+" ";o.textContent=e;t=mxUtils.getXml(s.documentElement);h.setCellStyles(mxConstants.STYLE_IMAGE,"data:image/svg+xml,"+(window.btoa?btoa(t):Base64.encode(t,!0)),h.getSelectionCells())},"#ffffff",{install:function(t){},destroy:function(){}}),l.appendChild(t),l.style.display="")}))(t,"fill",mxResources.get("fill")),e(t,"stroke",mxResources.get("line")),e(t,"stop-color",mxResources.get("gradient")))},StyleFormatPanel.prototype.addEditOps=function(t){var e=this.format.getSelectionState(),n=null;return 1==this.editorUi.editor.graph.getSelectionCount()&&((n=mxUtils.button(mxResources.get("editStyle"),mxUtils.bind(this,function(t){this.editorUi.actions.get("editStyle").funct()}))).setAttribute("title",mxResources.get("editStyle")+" ("+this.editorUi.actions.get("editStyle").shortcut+")"),n.style.width="202px",n.style.marginBottom="2px",t.appendChild(n)),e.image&&((e=mxUtils.button(mxResources.get("editImage"),mxUtils.bind(this,function(t){this.editorUi.actions.get("image").funct()}))).setAttribute("title",mxResources.get("editImage")),e.style.marginBottom="2px",null==n?e.style.width="202px":(n.style.width="100px",e.style.width="100px",e.style.marginLeft="2px"),t.appendChild(e)),t},StyleFormatPanel.prototype.addFill=function(n){var e=this.editorUi.editor.graph,i=this.format.getSelectionState();n.style.paddingTop="6px",n.style.paddingBottom="6px";var l=document.createElement("select");l.style.position="absolute",l.style.marginTop="-2px",l.style.right=mxClient.IS_QUIRKS?"52px":"72px",l.style.width="70px";var s=l.cloneNode(!1);mxEvent.addListener(l,"click",function(t){mxEvent.consume(t)}),mxEvent.addListener(s,"click",function(t){mxEvent.consume(t)});var t=1<=i.vertices.length?e.stylesheet.getDefaultVertexStyle():e.stylesheet.getDefaultEdgeStyle(),o=this.createCellColorOption(mxResources.get("gradient"),mxConstants.STYLE_GRADIENTCOLOR,null!=t[mxConstants.STYLE_GRADIENTCOLOR]?t[mxConstants.STYLE_GRADIENTCOLOR]:"#ffffff",function(t){null==t||t==mxConstants.NONE?l.style.display="none":l.style.display=""},function(t){e.updateCellStyles(mxConstants.STYLE_GRADIENTCOLOR,t,e.getSelectionCells())}),r="image"==i.style.shape?mxConstants.STYLE_IMAGE_BACKGROUND:mxConstants.STYLE_FILLCOLOR,a="image"==i.style.shape?mxResources.get("background"):mxResources.get("fill"),t=1<=i.vertices.length?e.stylesheet.getDefaultVertexStyle():e.stylesheet.getDefaultEdgeStyle(),a=this.createCellColorOption(a,r,null!=t[r]?t[r]:"#ffffff",null,mxUtils.bind(this,function(t){e.updateCellStyles(r,t,e.getSelectionCells())}));a.style.fontWeight="bold";t=mxUtils.getValue(i.style,r,null);o.style.display=null!=t&&t!=mxConstants.NONE&&i.fill&&"image"!=i.style.shape?"":"none";for(var h=[mxConstants.DIRECTION_NORTH,mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST],d=0;d<h.length;d++){var u=document.createElement("option");u.setAttribute("value",h[d]),mxUtils.write(u,mxResources.get(h[d])),l.appendChild(u)}o.appendChild(l);for(d=0;d<Editor.roughFillStyles.length;d++){var p=document.createElement("option");p.setAttribute("value",Editor.roughFillStyles[d].val),mxUtils.write(p,Editor.roughFillStyles[d].dispName),s.appendChild(p)}a.appendChild(s);var m=mxUtils.bind(this,function(){i=this.format.getSelectionState();var t=mxUtils.getValue(i.style,mxConstants.STYLE_GRADIENT_DIRECTION,mxConstants.DIRECTION_SOUTH),e=mxUtils.getValue(i.style,"fillStyle","auto");""==t&&(t=mxConstants.DIRECTION_SOUTH),l.value=t,s.value=e,n.style.display=i.fill?"":"none";t=mxUtils.getValue(i.style,mxConstants.STYLE_FILLCOLOR,null);!i.fill||i.containsImage||null==t||t==mxConstants.NONE||"filledEdge"==i.style.shape?(s.style.display="none",o.style.display="none"):(s.style.display="1"==i.style.sketch?"":"none",o.style.display="1"!=i.style.sketch||"solid"==e||"auto"==e?"":"none")});e.getModel().addListener(mxEvent.CHANGE,m),this.listeners.push({destroy:function(){e.getModel().removeListener(m)}}),m(),mxEvent.addListener(l,"change",function(t){e.setCellStyles(mxConstants.STYLE_GRADIENT_DIRECTION,l.value,e.getSelectionCells()),mxEvent.consume(t)}),mxEvent.addListener(s,"change",function(t){e.setCellStyles("fillStyle",s.value,e.getSelectionCells()),mxEvent.consume(t)}),n.appendChild(a),n.appendChild(o);for(var c=this.getCustomColors(),d=0;d<c.length;d++)n.appendChild(this.createCellColorOption(c[d].title,c[d].key,c[d].defaultValue));return n},StyleFormatPanel.prototype.getCustomColors=function(){var t=this.format.getSelectionState(),e=[];return"swimlane"!=t.style.shape&&"table"!=t.style.shape||e.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"#ffffff"}),e},StyleFormatPanel.prototype.addStroke=function(t){var r=this.editorUi,a=r.editor.graph,h=this.format.getSelectionState();t.style.paddingTop="4px",t.style.paddingBottom="4px",t.style.whiteSpace="normal";var e=document.createElement("div");e.style.fontWeight="bold",h.stroke||(e.style.display="none");var d=document.createElement("select");d.style.position="absolute",d.style.marginTop="-2px",d.style.right="72px",d.style.width="80px";for(var n=["sharp","rounded","curved"],i=0;i<n.length;i++){var l=document.createElement("option");l.setAttribute("value",n[i]),mxUtils.write(l,mxResources.get(n[i])),d.appendChild(l)}mxEvent.addListener(d,"change",function(t){a.getModel().beginUpdate();try{var e=[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],n=["0",null];"rounded"==d.value?n=["1",null]:"curved"==d.value&&(n=[null,"1"]);for(var i=0;i<e.length;i++)a.setCellStyles(e[i],n[i],a.getSelectionCells());r.fireEvent(new mxEventObject("styleChanged","keys",e,"values",n,"cells",a.getSelectionCells()))}finally{a.getModel().endUpdate()}mxEvent.consume(t)}),mxEvent.addListener(d,"click",function(t){mxEvent.consume(t)});var u="image"==h.style.shape?mxConstants.STYLE_IMAGE_BORDER:mxConstants.STYLE_STROKECOLOR,s="image"==h.style.shape?mxResources.get("border"):mxResources.get("line"),o=1<=h.vertices.length?a.stylesheet.getDefaultVertexStyle():a.stylesheet.getDefaultEdgeStyle(),p=this.createCellColorOption(s,u,null!=o[u]?o[u]:"#000000",null,mxUtils.bind(this,function(t){a.updateCellStyles(u,t,a.getSelectionCells())}));p.appendChild(d),e.appendChild(p);var m=e.cloneNode(!1);m.style.fontWeight="normal",m.style.whiteSpace="nowrap",m.style.position="relative",m.style.paddingLeft="16px",m.style.marginBottom="2px",m.style.marginTop="2px",m.className="geToolbarContainer";var c=mxUtils.bind(this,function(t,e,n,i,l){i=this.editorUi.menus.styleChange(t,"",i,l,"geIcon",null),l=document.createElement("div");return l.style.width=e+"px",l.style.height="1px",l.style.borderBottom="1px "+n+" "+this.defaultStrokeColor,l.style.paddingTop="6px",i.firstChild.firstChild.style.padding="0px 4px 0px 4px",i.firstChild.firstChild.style.width=e+"px",i.firstChild.firstChild.appendChild(l),i}),g=this.editorUi.toolbar.addMenuFunctionInContainer(m,"geSprite-orthogonal",mxResources.get("pattern"),!1,mxUtils.bind(this,function(t){c(t,75,"solid",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],[null,null]).setAttribute("title",mxResources.get("solid")),c(t,75,"dashed",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],["1",null]).setAttribute("title",mxResources.get("dashed")),c(t,75,"dotted",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],["1","1 1"]).setAttribute("title",mxResources.get("dotted")+" (1)"),c(t,75,"dotted",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],["1","1 2"]).setAttribute("title",mxResources.get("dotted")+" (2)"),c(t,75,"dotted",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],["1","1 4"]).setAttribute("title",mxResources.get("dotted")+" (3)")})),x=m.cloneNode(!1),y=this.editorUi.toolbar.addMenuFunctionInContainer(x,"geSprite-connection",mxResources.get("connection"),!1,mxUtils.bind(this,function(t){this.editorUi.menus.styleChange(t,"",[mxConstants.STYLE_SHAPE,mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE,"width"],[null,null,null,null],"geIcon geSprite geSprite-connection",null,!0).setAttribute("title",mxResources.get("line")),this.editorUi.menus.styleChange(t,"",[mxConstants.STYLE_SHAPE,mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE,"width"],["link",null,null,null],"geIcon geSprite geSprite-linkedge",null,!0).setAttribute("title",mxResources.get("link")),this.editorUi.menus.styleChange(t,"",[mxConstants.STYLE_SHAPE,mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE,"width"],["flexArrow",null,null,null],"geIcon geSprite geSprite-arrow",null,!0).setAttribute("title",mxResources.get("arrow")),this.editorUi.menus.styleChange(t,"",[mxConstants.STYLE_SHAPE,mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE,"width"],["arrow",null,null,null],"geIcon geSprite geSprite-simplearrow",null,!0).setAttribute("title",mxResources.get("simpleArrow"))})),f=this.editorUi.toolbar.addMenuFunctionInContainer(x,"geSprite-orthogonal",mxResources.get("pattern"),!1,mxUtils.bind(this,function(t){c(t,33,"solid",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],[null,null]).setAttribute("title",mxResources.get("solid")),c(t,33,"dashed",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],["1",null]).setAttribute("title",mxResources.get("dashed")),c(t,33,"dotted",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],["1","1 1"]).setAttribute("title",mxResources.get("dotted")+" (1)"),c(t,33,"dotted",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],["1","1 2"]).setAttribute("title",mxResources.get("dotted")+" (2)"),c(t,33,"dotted",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],["1","1 4"]).setAttribute("title",mxResources.get("dotted")+" (3)")})),s=m.cloneNode(!1),C=document.createElement("input");C.style.textAlign="right",C.style.marginTop="2px",C.style.width="41px",C.setAttribute("title",mxResources.get("linewidth")),m.appendChild(C);var v=C.cloneNode(!0);function E(t){var e=parseInt(C.value);(e=Math.min(999,Math.max(1,isNaN(e)?1:e)))!=mxUtils.getValue(h.style,mxConstants.STYLE_STROKEWIDTH,1)&&(a.setCellStyles(mxConstants.STYLE_STROKEWIDTH,e,a.getSelectionCells()),r.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_STROKEWIDTH],"values",[e],"cells",a.getSelectionCells()))),C.value=e+" pt",mxEvent.consume(t)}function S(t){var e=parseInt(v.value);(e=Math.min(999,Math.max(1,isNaN(e)?1:e)))!=mxUtils.getValue(h.style,mxConstants.STYLE_STROKEWIDTH,1)&&(a.setCellStyles(mxConstants.STYLE_STROKEWIDTH,e,a.getSelectionCells()),r.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_STROKEWIDTH],"values",[e],"cells",a.getSelectionCells()))),v.value=e+" pt",mxEvent.consume(t)}x.appendChild(v);o=this.createStepper(C,E,1,9);o.style.display=C.style.display,o.style.marginTop="2px",m.appendChild(o);p=this.createStepper(v,S,1,9);p.style.display=v.style.display,p.style.marginTop="2px",x.appendChild(p),mxClient.IS_QUIRKS?(C.style.height="17px",v.style.height="17px"):(C.style.position="absolute",C.style.height="15px",C.style.left="141px",o.style.left="190px",v.style.position="absolute",v.style.left="141px",v.style.height="15px",p.style.left="190px"),mxEvent.addListener(C,"blur",E),mxEvent.addListener(C,"change",E),mxEvent.addListener(v,"blur",S),mxEvent.addListener(v,"change",S),mxClient.IS_QUIRKS&&(mxUtils.br(s),mxUtils.br(s));var w=this.editorUi.toolbar.addMenuFunctionInContainer(s,"geSprite-orthogonal",mxResources.get("waypoints"),!1,mxUtils.bind(this,function(t){"arrow"!=h.style.shape&&(this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],[null,null,null],"geIcon geSprite geSprite-straight",null,!0).setAttribute("title",mxResources.get("straight")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["orthogonalEdgeStyle",null,null],"geIcon geSprite geSprite-orthogonal",null,!0).setAttribute("title",mxResources.get("orthogonal")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["elbowEdgeStyle",null,null,null],"geIcon geSprite geSprite-horizontalelbow",null,!0).setAttribute("title",mxResources.get("simple")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["elbowEdgeStyle","vertical",null,null],"geIcon geSprite geSprite-verticalelbow",null,!0).setAttribute("title",mxResources.get("simple")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["isometricEdgeStyle",null,null,null],"geIcon geSprite geSprite-horizontalisometric",null,!0).setAttribute("title",mxResources.get("isometric")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["isometricEdgeStyle","vertical",null,null],"geIcon geSprite geSprite-verticalisometric",null,!0).setAttribute("title",mxResources.get("isometric")),"connector"==h.style.shape&&this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["orthogonalEdgeStyle","1",null],"geIcon geSprite geSprite-curved",null,!0).setAttribute("title",mxResources.get("curved")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["entityRelationEdgeStyle",null,null],"geIcon geSprite geSprite-entity",null,!0).setAttribute("title",mxResources.get("entityRelation")))})),b=this.editorUi.toolbar.addMenuFunctionInContainer(s,"geSprite-startclassic",mxResources.get("linestart"),!1,mxUtils.bind(this,function(t){var e;"connector"!=h.style.shape&&"flexArrow"!=h.style.shape&&"filledEdge"!=h.style.shape||((e=this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.NONE,0],"geIcon",null,!1)).setAttribute("title",mxResources.get("none")),e.firstChild.firstChild.innerHTML='<font style="font-size:10px;">'+mxUtils.htmlEntities(mxResources.get("none"))+"</font>","connector"==h.style.shape||"filledEdge"==h.style.shape?(this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_CLASSIC,1],"geIcon geSprite geSprite-startclassic",null,!1).setAttribute("title",mxResources.get("classic")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_CLASSIC_THIN,1],"geIcon geSprite geSprite-startclassicthin",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_OPEN,0],"geIcon geSprite geSprite-startopen",null,!1).setAttribute("title",mxResources.get("openArrow")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_OPEN_THIN,0],"geIcon geSprite geSprite-startopenthin",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],["openAsync",0],"geIcon geSprite geSprite-startopenasync",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_BLOCK,1],"geIcon geSprite geSprite-startblock",null,!1).setAttribute("title",mxResources.get("block")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_BLOCK_THIN,1],"geIcon geSprite geSprite-startblockthin",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],["async",1],"geIcon geSprite geSprite-startasync",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_OVAL,1],"geIcon geSprite geSprite-startoval",null,!1).setAttribute("title",mxResources.get("oval")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_DIAMOND,1],"geIcon geSprite geSprite-startdiamond",null,!1).setAttribute("title",mxResources.get("diamond")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_DIAMOND_THIN,1],"geIcon geSprite geSprite-startthindiamond",null,!1).setAttribute("title",mxResources.get("diamondThin")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_CLASSIC,0],"geIcon geSprite geSprite-startclassictrans",null,!1).setAttribute("title",mxResources.get("classic")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_CLASSIC_THIN,0],"geIcon geSprite geSprite-startclassicthintrans",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_BLOCK,0],"geIcon geSprite geSprite-startblocktrans",null,!1).setAttribute("title",mxResources.get("block")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_BLOCK_THIN,0],"geIcon geSprite geSprite-startblockthintrans",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],["async",0],"geIcon geSprite geSprite-startasynctrans",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_OVAL,0],"geIcon geSprite geSprite-startovaltrans",null,!1).setAttribute("title",mxResources.get("oval")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_DIAMOND,0],"geIcon geSprite geSprite-startdiamondtrans",null,!1).setAttribute("title",mxResources.get("diamond")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_DIAMOND_THIN,0],"geIcon geSprite geSprite-startthindiamondtrans",null,!1).setAttribute("title",mxResources.get("diamondThin")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],["box",0],"geIcon geSprite geSvgSprite geSprite-box",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],["halfCircle",0],"geIcon geSprite geSvgSprite geSprite-halfCircle",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],["dash",0],"geIcon geSprite geSprite-startdash",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],["cross",0],"geIcon geSprite geSprite-startcross",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],["circlePlus",0],"geIcon geSprite geSprite-startcircleplus",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],["circle",1],"geIcon geSprite geSprite-startcircle",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],["ERone",0],"geIcon geSprite geSprite-starterone",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],["ERmandOne",0],"geIcon geSprite geSprite-starteronetoone",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],["ERmany",0],"geIcon geSprite geSprite-startermany",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],["ERoneToMany",0],"geIcon geSprite geSprite-starteronetomany",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],["ERzeroToOne",1],"geIcon geSprite geSprite-starteroneopt",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW,"startFill"],["ERzeroToMany",1],"geIcon geSprite geSprite-startermanyopt",null,!1)):this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_BLOCK],"geIcon geSprite geSprite-startblocktrans",null,!1).setAttribute("title",mxResources.get("block")))})),T=this.editorUi.toolbar.addMenuFunctionInContainer(s,"geSprite-endclassic",mxResources.get("lineend"),!1,mxUtils.bind(this,function(t){var e;"connector"!=h.style.shape&&"flexArrow"!=h.style.shape&&"filledEdge"!=h.style.shape||((e=this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.NONE,0],"geIcon",null,!1)).setAttribute("title",mxResources.get("none")),e.firstChild.firstChild.innerHTML='<font style="font-size:10px;">'+mxUtils.htmlEntities(mxResources.get("none"))+"</font>","connector"==h.style.shape||"filledEdge"==h.style.shape?(this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_CLASSIC,1],"geIcon geSprite geSprite-endclassic",null,!1).setAttribute("title",mxResources.get("classic")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_CLASSIC_THIN,1],"geIcon geSprite geSprite-endclassicthin",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_OPEN,0],"geIcon geSprite geSprite-endopen",null,!1).setAttribute("title",mxResources.get("openArrow")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_OPEN_THIN,0],"geIcon geSprite geSprite-endopenthin",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],["openAsync",0],"geIcon geSprite geSprite-endopenasync",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_BLOCK,1],"geIcon geSprite geSprite-endblock",null,!1).setAttribute("title",mxResources.get("block")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_BLOCK_THIN,1],"geIcon geSprite geSprite-endblockthin",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],["async",1],"geIcon geSprite geSprite-endasync",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_OVAL,1],"geIcon geSprite geSprite-endoval",null,!1).setAttribute("title",mxResources.get("oval")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_DIAMOND,1],"geIcon geSprite geSprite-enddiamond",null,!1).setAttribute("title",mxResources.get("diamond")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_DIAMOND_THIN,1],"geIcon geSprite geSprite-endthindiamond",null,!1).setAttribute("title",mxResources.get("diamondThin")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_CLASSIC,0],"geIcon geSprite geSprite-endclassictrans",null,!1).setAttribute("title",mxResources.get("classic")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_CLASSIC_THIN,0],"geIcon geSprite geSprite-endclassicthintrans",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_BLOCK,0],"geIcon geSprite geSprite-endblocktrans",null,!1).setAttribute("title",mxResources.get("block")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_BLOCK_THIN,0],"geIcon geSprite geSprite-endblockthintrans",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],["async",0],"geIcon geSprite geSprite-endasynctrans",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_OVAL,0],"geIcon geSprite geSprite-endovaltrans",null,!1).setAttribute("title",mxResources.get("oval")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_DIAMOND,0],"geIcon geSprite geSprite-enddiamondtrans",null,!1).setAttribute("title",mxResources.get("diamond")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_DIAMOND_THIN,0],"geIcon geSprite geSprite-endthindiamondtrans",null,!1).setAttribute("title",mxResources.get("diamondThin")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],["box",0],"geIcon geSprite geSvgSprite geFlipSprite geSprite-box",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],["halfCircle",0],"geIcon geSprite geSvgSprite geFlipSprite geSprite-halfCircle",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],["dash",0],"geIcon geSprite geSprite-enddash",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],["cross",0],"geIcon geSprite geSprite-endcross",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],["circlePlus",0],"geIcon geSprite geSprite-endcircleplus",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],["circle",1],"geIcon geSprite geSprite-endcircle",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],["ERone",0],"geIcon geSprite geSprite-enderone",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],["ERmandOne",0],"geIcon geSprite geSprite-enderonetoone",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],["ERmany",0],"geIcon geSprite geSprite-endermany",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],["ERoneToMany",0],"geIcon geSprite geSprite-enderonetomany",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],["ERzeroToOne",1],"geIcon geSprite geSprite-enderoneopt",null,!1),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW,"endFill"],["ERzeroToMany",1],"geIcon geSprite geSprite-endermanyopt",null,!1)):this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_BLOCK],"geIcon geSprite geSprite-endblocktrans",null,!1).setAttribute("title",mxResources.get("block")))}));this.addArrow(y,8),this.addArrow(w),this.addArrow(b),this.addArrow(T);o=this.addArrow(g,9);o.className="geIcon",o.style.width="auto";p=this.addArrow(f,9);p.className="geIcon",p.style.width="22px";var A=document.createElement("div");A.style.width="85px",A.style.height="1px",A.style.borderBottom="1px solid "+this.defaultStrokeColor,A.style.marginBottom="9px",o.appendChild(A);var L=document.createElement("div");L.style.width="23px",L.style.height="1px",L.style.borderBottom="1px solid "+this.defaultStrokeColor,L.style.marginBottom="9px",p.appendChild(L),g.style.height="15px",f.style.height="15px",y.style.height="15px",w.style.height="17px",b.style.marginLeft="3px",b.style.height="17px",T.style.marginLeft="3px",T.style.height="17px",t.appendChild(e),t.appendChild(x),t.appendChild(m);p=m.cloneNode(!1);p.style.paddingBottom="6px",p.style.paddingTop="4px",p.style.fontWeight="normal";g=document.createElement("div");g.style.position="absolute",g.style.marginLeft="3px",g.style.marginBottom="12px",g.style.marginTop="2px",g.style.fontWeight="normal",g.style.width="76px",mxUtils.write(g,mxResources.get("lineend")),p.appendChild(g);var I=this.addUnitInput(p,"pt",74,33,function(){D.apply(this,arguments)}),M=this.addUnitInput(p,"pt",20,33,function(){_.apply(this,arguments)});mxUtils.br(p);f=document.createElement("div");f.style.height="8px",p.appendChild(f),g=g.cloneNode(!1),mxUtils.write(g,mxResources.get("linestart")),p.appendChild(g);var R=this.addUnitInput(p,"pt",74,33,function(){H.apply(this,arguments)}),P=this.addUnitInput(p,"pt",20,33,function(){N.apply(this,arguments)});mxUtils.br(p),this.addLabel(p,mxResources.get("spacing"),74,50),this.addLabel(p,mxResources.get("size"),20,50),mxUtils.br(p);e=e.cloneNode(!1);e.style.fontWeight="normal",e.style.position="relative",e.style.paddingLeft="16px",e.style.marginBottom="2px",e.style.marginTop="6px",e.style.borderWidth="0px",e.style.paddingBottom="18px",(g=document.createElement("div")).style.position="absolute",g.style.marginLeft="3px",g.style.marginBottom="12px",g.style.marginTop="1px",g.style.fontWeight="normal",g.style.width="120px",mxUtils.write(g,mxResources.get("perimeter")),e.appendChild(g);var O=this.addUnitInput(e,"pt",20,41,function(){G.apply(this,arguments)});h.edges.length==a.getSelectionCount()?(t.appendChild(s),mxClient.IS_QUIRKS&&(mxUtils.br(t),mxUtils.br(t)),t.appendChild(p)):h.vertices.length==a.getSelectionCount()&&(mxClient.IS_QUIRKS&&mxUtils.br(t),t.appendChild(e));var U=mxUtils.bind(this,function(t,e,n){h=this.format.getSelectionState();mxUtils.getValue(h.style,u,null);!n&&document.activeElement==C||(s=parseInt(mxUtils.getValue(h.style,mxConstants.STYLE_STROKEWIDTH,1)),C.value=isNaN(s)?"":s+" pt"),!n&&document.activeElement==v||(s=parseInt(mxUtils.getValue(h.style,mxConstants.STYLE_STROKEWIDTH,1)),v.value=isNaN(s)?"":s+" pt"),d.style.visibility="connector"==h.style.shape||"filledEdge"==h.style.shape?"":"hidden","1"==mxUtils.getValue(h.style,mxConstants.STYLE_CURVED,null)?d.value="curved":"1"==mxUtils.getValue(h.style,mxConstants.STYLE_ROUNDED,null)&&(d.value="rounded"),"1"==mxUtils.getValue(h.style,mxConstants.STYLE_DASHED,null)?null==mxUtils.getValue(h.style,mxConstants.STYLE_DASH_PATTERN,null)?A.style.borderBottom="1px dashed "+this.defaultStrokeColor:A.style.borderBottom="1px dotted "+this.defaultStrokeColor:A.style.borderBottom="1px solid "+this.defaultStrokeColor,L.style.borderBottom=A.style.borderBottom;var i=w.getElementsByTagName("div")[0];null!=i&&(o=mxUtils.getValue(h.style,mxConstants.STYLE_EDGE,null),"1"==mxUtils.getValue(h.style,mxConstants.STYLE_NOEDGESTYLE,null)&&(o=null),"orthogonalEdgeStyle"==o&&"1"==mxUtils.getValue(h.style,mxConstants.STYLE_CURVED,null)?i.className="geSprite geSprite-curved":i.className="straight"==o||"none"==o||null==o?"geSprite geSprite-straight":"entityRelationEdgeStyle"==o?"geSprite geSprite-entity":"elbowEdgeStyle"==o?"geSprite "+("vertical"==mxUtils.getValue(h.style,mxConstants.STYLE_ELBOW,null)?"geSprite-verticalelbow":"geSprite-horizontalelbow"):"isometricEdgeStyle"==o?"geSprite "+("vertical"==mxUtils.getValue(h.style,mxConstants.STYLE_ELBOW,null)?"geSprite-verticalisometric":"geSprite-horizontalisometric"):"geSprite geSprite-orthogonal");i=y.getElementsByTagName("div")[0];function l(t,e,n,i){n=n.getElementsByTagName("div")[0];return null!=n&&(n.className=r.getCssClassForMarker(i,h.style.shape,t,e),"geSprite geSprite-noarrow"==n.className&&(n.innerHTML=mxUtils.htmlEntities(mxResources.get("none")),n.style.backgroundImage="none",n.style.verticalAlign="top",n.style.marginTop="5px",n.style.fontSize="10px",n.style.filter="none",n.style.color=this.defaultStrokeColor,n.nextSibling.style.marginTop="0px")),n}null!=i&&("link"==h.style.shape?i.className="geSprite geSprite-linkedge":"flexArrow"==h.style.shape?i.className="geSprite geSprite-arrow":"arrow"==h.style.shape?i.className="geSprite geSprite-simplearrow":i.className="geSprite geSprite-connection"),h.edges.length==a.getSelectionCount()?(x.style.display="",m.style.display="none"):(x.style.display="none",m.style.display="");var s,o=l(mxUtils.getValue(h.style,mxConstants.STYLE_STARTARROW,null),mxUtils.getValue(h.style,"startFill","1"),b,"start"),i=l(mxUtils.getValue(h.style,mxConstants.STYLE_ENDARROW,null),mxUtils.getValue(h.style,"endFill","1"),T,"end");null!=o&&null!=i&&("arrow"==h.style.shape?(o.className="geSprite geSprite-noarrow",i.className="geSprite geSprite-endblocktrans"):"link"==h.style.shape&&(o.className="geSprite geSprite-noarrow",i.className="geSprite geSprite-noarrow")),mxUtils.setOpacity(w,"arrow"==h.style.shape?30:100),"connector"!=h.style.shape&&"flexArrow"!=h.style.shape&&"filledEdge"!=h.style.shape?(mxUtils.setOpacity(b,30),mxUtils.setOpacity(T,30)):(mxUtils.setOpacity(b,100),mxUtils.setOpacity(T,100)),!n&&document.activeElement==P||(s=parseInt(mxUtils.getValue(h.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)),P.value=isNaN(s)?"":s+" pt"),!n&&document.activeElement==R||(s=parseInt(mxUtils.getValue(h.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING,0)),R.value=isNaN(s)?"":s+" pt"),!n&&document.activeElement==M||(s=parseInt(mxUtils.getValue(h.style,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE)),M.value=isNaN(s)?"":s+" pt"),!n&&document.activeElement==R||(s=parseInt(mxUtils.getValue(h.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING,0)),I.value=isNaN(s)?"":s+" pt"),!n&&document.activeElement==O||(s=parseInt(mxUtils.getValue(h.style,mxConstants.STYLE_PERIMETER_SPACING,0)),O.value=isNaN(s)?"":s+" pt")}),N=this.installInputHandler(P,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE,0,999," pt"),H=this.installInputHandler(R,mxConstants.STYLE_SOURCE_PERIMETER_SPACING,0,-999,999," pt"),_=this.installInputHandler(M,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE,0,999," pt"),D=this.installInputHandler(I,mxConstants.STYLE_TARGET_PERIMETER_SPACING,0,-999,999," pt"),G=this.installInputHandler(O,mxConstants.STYLE_PERIMETER_SPACING,0,0,999," pt");return this.addKeyHandler(C,U),this.addKeyHandler(P,U),this.addKeyHandler(R,U),this.addKeyHandler(M,U),this.addKeyHandler(I,U),this.addKeyHandler(O,U),a.getModel().addListener(mxEvent.CHANGE,U),this.listeners.push({destroy:function(){a.getModel().removeListener(U)}}),U(),t},StyleFormatPanel.prototype.addLineJumps=function(t){var i=this.format.getSelectionState();if(Graph.lineJumpsEnabled&&0<i.edges.length&&0==i.vertices.length&&i.lineJumps){t.style.padding="8px 0px 24px 18px";var e=this.editorUi,n=e.editor.graph,l=document.createElement("div");l.style.position="absolute",l.style.fontWeight="bold",l.style.width="80px",mxUtils.write(l,mxResources.get("lineJumps")),t.appendChild(l);var s=document.createElement("select");s.style.position="absolute",s.style.marginTop="-2px",s.style.right="76px",s.style.width="62px";for(var o=["none","arc","gap","sharp"],r=0;r<o.length;r++){var a=document.createElement("option");a.setAttribute("value",o[r]),mxUtils.write(a,mxResources.get(o[r])),s.appendChild(a)}mxEvent.addListener(s,"change",function(t){n.getModel().beginUpdate();try{n.setCellStyles("jumpStyle",s.value,n.getSelectionCells()),e.fireEvent(new mxEventObject("styleChanged","keys",["jumpStyle"],"values",[s.value],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}mxEvent.consume(t)}),mxEvent.addListener(s,"click",function(t){mxEvent.consume(t)}),t.appendChild(s);var h=this.addUnitInput(t,"pt",22,33,function(){d.apply(this,arguments)}),d=this.installInputHandler(h,"jumpSize",Graph.defaultJumpSize,0,999," pt"),u=mxUtils.bind(this,function(t,e,n){i=this.format.getSelectionState(),s.value=mxUtils.getValue(i.style,"jumpStyle","none"),!n&&document.activeElement==h||(n=parseInt(mxUtils.getValue(i.style,"jumpSize",Graph.defaultJumpSize)),h.value=isNaN(n)?"":n+" pt")});this.addKeyHandler(h,u),n.getModel().addListener(mxEvent.CHANGE,u),this.listeners.push({destroy:function(){n.getModel().removeListener(u)}}),u()}else t.style.display="none";return t},StyleFormatPanel.prototype.addEffects=function(t){var e=this.editorUi.editor.graph,i=this.format.getSelectionState();t.style.paddingTop="0px",t.style.paddingBottom="2px";var n=document.createElement("table");mxClient.IS_QUIRKS&&(n.style.fontSize="1em"),n.style.width="100%",n.style.fontWeight="bold",n.style.paddingRight="20px";var l=document.createElement("tbody"),s=document.createElement("tr");s.style.padding="0px";var o=document.createElement("td");o.style.padding="0px",o.style.width="50%",o.setAttribute("valign","top");var r=o.cloneNode(!0);r.style.paddingLeft="8px",s.appendChild(o),s.appendChild(r),l.appendChild(s),n.appendChild(l),t.appendChild(n);var a=o,h=mxUtils.bind(this,function(t,e,n){n=this.createCellOption(t,e,n);n.style.width="100%",a.appendChild(n),a=a==o?r:o,0}),d=mxUtils.bind(this,function(t,e,n){i=this.format.getSelectionState(),o.innerHTML="",r.innerHTML="",a=o,i.rounded&&h(mxResources.get("rounded"),mxConstants.STYLE_ROUNDED,0),"swimlane"==i.style.shape&&h(mxResources.get("divider"),"swimlaneLine",1),i.containsImage||h(mxResources.get("shadow"),mxConstants.STYLE_SHADOW,0),i.glass&&h(mxResources.get("glass"),mxConstants.STYLE_GLASS,0),h(mxResources.get("sketch"),"sketch",0)});return e.getModel().addListener(mxEvent.CHANGE,d),this.listeners.push({destroy:function(){e.getModel().removeListener(d)}}),d(),t},StyleFormatPanel.prototype.addStyleOps=function(t){t.style.paddingTop="10px",t.style.paddingBottom="10px";var e=mxUtils.button(mxResources.get("setAsDefaultStyle"),mxUtils.bind(this,function(t){this.editorUi.actions.get("setAsDefaultStyle").funct()}));return e.setAttribute("title",mxResources.get("setAsDefaultStyle")+" ("+this.editorUi.actions.get("setAsDefaultStyle").shortcut+")"),e.style.width="202px",t.appendChild(e),t},DiagramStylePanel=function(t,e,n){BaseFormatPanel.call(this,t,e,n),this.init()},mxUtils.extend(DiagramStylePanel,BaseFormatPanel),DiagramStylePanel.prototype.init=function(){this.editorUi.editor.graph;this.container.appendChild(this.addView(this.createPanel()))},DiagramStylePanel.prototype.addView=function(t){var i=this.editorUi,h=i.editor.graph,d=h.getModel();t.style.whiteSpace="normal";var l="1"==h.currentVertexStyle.sketch&&"1"==h.currentEdgeStyle.sketch,u="1"==h.currentVertexStyle.rounded,p="1"==h.currentEdgeStyle.curved,e=document.createElement("div");e.style.paddingBottom="12px",e.style.marginRight="16px",t.style.paddingTop="8px";var n=document.createElement("table");mxClient.IS_QUIRKS&&(n.style.fontSize="1em"),n.style.width="100%",n.style.fontWeight="bold";var s=document.createElement("tbody"),o=document.createElement("tr");o.style.padding="0px",(w=document.createElement("td")).style.padding="0px",w.style.width="50%",w.setAttribute("valign","middle"),(b=w.cloneNode(!0)).style.paddingLeft="8px",o.appendChild(w),o.appendChild(b),s.appendChild(o),n.appendChild(s),w.appendChild(this.createOption(mxResources.get("sketch"),function(){return l},function(t){(l=t)?(h.currentEdgeStyle.sketch="1",h.currentVertexStyle.sketch="1"):(delete h.currentEdgeStyle.sketch,delete h.currentVertexStyle.sketch),h.updateCellStyles("sketch",t?"1":null,h.getVerticesAndEdges())},null,function(t){t.style.width="auto"})),b.appendChild(this.createOption(mxResources.get("rounded"),function(){return u},function(t){(u=t)?h.currentVertexStyle.rounded="1":delete h.currentVertexStyle.rounded,h.updateCellStyles("rounded",t?"1":null,h.getVerticesAndEdges(!0,!0))},null,function(t){t.style.width="auto"})),w=w.cloneNode(!1),b=b.cloneNode(!1),(o=o.cloneNode(!1)).appendChild(w),o.appendChild(b),s.appendChild(o),w.appendChild(this.createOption(mxResources.get("curved"),function(){return p},function(t){(p=t)?h.currentEdgeStyle.curved="1":delete h.currentEdgeStyle.curved,h.updateCellStyles("curved",t?"1":null,h.getVerticesAndEdges(!1,!0))},null,function(t){t.style.width="auto"})),e.appendChild(n),t.appendChild(e);var m=["fillColor","strokeColor","fontColor","gradientColor"],c=mxUtils.bind(this,function(t,e){var n=h.getVerticesAndEdges();d.beginUpdate();try{for(var i=0;i<n.length;i++){var l=h.getCellStyle(n[i]);null!=l.labelBackgroundColor&&h.updateCellStyles("labelBackgroundColor",null!=e?e.background:null,[n[i]]);for(var s=d.isEdge(n[i]),o=d.getStyle(n[i]),r=s?h.currentEdgeStyle:h.currentVertexStyle,a=0;a<t.length;a++)(null!=l[t[a]]&&l[t[a]]!=mxConstants.NONE||t[a]!=mxConstants.STYLE_FILLCOLOR&&t[a]!=mxConstants.STYLE_STROKECOLOR)&&(o=mxUtils.setStyle(o,t[a],r[t[a]]));d.setStyle(n[i],o)}}finally{d.endUpdate()}}),g=mxUtils.bind(this,function(t,e,n){if(null!=t)for(var i=0;i<e.length;i++)(null!=t[e[i]]&&t[e[i]]!=mxConstants.NONE||e[i]!=mxConstants.STYLE_FILLCOLOR&&e[i]!=mxConstants.STYLE_STROKECOLOR)&&(t[e[i]]=n[e[i]])}),x=mxUtils.bind(this,function(t,e,n,i,l){if(null!=t)for(var s in null!=n&&null!=e.labelBackgroundColor&&(i=null!=i?i.background:null,l=null!=l?l:h,null==i&&(i=l.background),null==i&&(i=l.defaultPageBackgroundColor),e.labelBackgroundColor=i),t)(null==n||null!=e[s]&&e[s]!=mxConstants.NONE||s!=mxConstants.STYLE_FILLCOLOR&&s!=mxConstants.STYLE_STROKECOLOR)&&(e[s]=t[s])}),e=mxUtils.button(mxResources.get("reset"),mxUtils.bind(this,function(t){var e=h.getVerticesAndEdges(!0,!0);if(0<e.length){d.beginUpdate();try{h.updateCellStyles("sketch",null,e),h.updateCellStyles("rounded",null,e),h.updateCellStyles("curved",null,h.getVerticesAndEdges(!1,!0))}finally{d.endUpdate()}}h.defaultVertexStyle=mxUtils.clone(i.initialDefaultVertexStyle),h.defaultEdgeStyle=mxUtils.clone(i.initialDefaultEdgeStyle),i.clearDefaultStyle()}));e.setAttribute("title",mxResources.get("reset")),e.style.textOverflow="ellipsis",e.style.maxWidth="90px",b.appendChild(e);var y=mxUtils.bind(this,function(l,s,o,r,t){var e=document.createElement("div");e.style.cssText="position:absolute;display:inline-block;width:100%;height:100%;overflow:hidden;pointer-events:none;",t.appendChild(e);var a=new Graph(e,null,null,h.getStylesheet());a.resetViewOnRootChange=!1,a.foldingEnabled=!1,a.gridEnabled=!1,a.autoScroll=!1,a.setTooltips(!1),a.setConnectable(!1),a.setPanning(!1),a.setEnabled(!1),a.getCellStyle=function(t){var e=mxUtils.clone(Graph.prototype.getCellStyle.apply(this,arguments)),n=h.stylesheet.getDefaultVertexStyle(),i=s;return d.isEdge(t)&&(n=h.stylesheet.getDefaultEdgeStyle(),i=o),g(e,m,n),x(l,e,t,r,a),x(i,e,t,r,a),e},a.model.beginUpdate();try{var n=a.insertVertex(a.getDefaultParent(),null,"Shape",14,8,70,40,"strokeWidth=2;"),n=a.insertEdge(a.getDefaultParent(),null,"Connector",n,n,"edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;endSize=5;strokeWidth=2;");n.geometry.points=[new mxPoint(32,70)],n.geometry.offset=new mxPoint(0,8)}finally{a.model.endUpdate()}}),f=document.createElement("div");f.style.position="relative",t.appendChild(f),null==this.format.cachedStyleEntries&&(this.format.cachedStyleEntries=[]);var r=mxUtils.bind(this,function(s,o,r,a,t){var n=this.format.cachedStyleEntries[t];null==n&&((n=document.createElement("div")).style.cssText="display:inline-block;position:relative;width:96px;height:90px;cursor:pointer;border:1px solid gray;margin:2px;overflow:hidden;",null!=a&&null!=a.background&&(n.style.backgroundColor=a.background),y(s,o,r,a,n),mxEvent.addGestureListeners(n,mxUtils.bind(this,function(t){n.style.opacity=.5}),null,mxUtils.bind(this,function(t){n.style.opacity=1,h.defaultVertexStyle=mxUtils.clone(i.initialDefaultVertexStyle),h.defaultEdgeStyle=mxUtils.clone(i.initialDefaultEdgeStyle),x(s,h.defaultVertexStyle),x(s,h.defaultEdgeStyle),x(o,h.defaultVertexStyle),x(r,h.defaultEdgeStyle),i.clearDefaultStyle(),l?(h.currentEdgeStyle.sketch="1",h.currentVertexStyle.sketch="1"):(h.currentEdgeStyle.sketch="0",h.currentVertexStyle.sketch="0"),h.currentVertexStyle.rounded=u?"1":"0",h.currentEdgeStyle.rounded="1",h.currentEdgeStyle.curved=p?"1":"0",d.beginUpdate();try{c(m,a);var e=new ChangePageSetup(i,null!=a?a.background:null);e.ignoreImage=!0,d.execute(e),d.execute(new ChangeGridColor(i,null!=a&&null!=a.gridColor?a.gridColor:h.view.defaultGridColor))}finally{d.endUpdate()}})),mxEvent.addListener(n,"mouseenter",mxUtils.bind(this,function(t){var l=h.getCellStyle,e=h.background,n=h.view.gridColor;h.background=null!=a?a.background:null,h.view.gridColor=null!=a&&null!=a.gridColor?a.gridColor:h.view.defaultGridColor,h.getCellStyle=function(t){var e=mxUtils.clone(l.apply(this,arguments)),n=h.stylesheet.getDefaultVertexStyle(),i=o;return d.isEdge(t)&&(n=h.stylesheet.getDefaultEdgeStyle(),i=r),g(e,m,n),x(s,e,t,a),x(i,e,t,a),e},h.refresh(),h.getCellStyle=l,h.background=e,h.view.gridColor=n})),mxEvent.addListener(n,"mouseleave",mxUtils.bind(this,function(t){h.refresh()})),this.format.cachedStyleEntries[t]=n),f.appendChild(n)}),a=Math.ceil(Editor.styles.length/10);this.format.currentStylePage=null!=this.format.currentStylePage?this.format.currentStylePage:0;var C=[],v=mxUtils.bind(this,function(){0<C.length&&(C[this.format.currentStylePage].style.background="#84d7ff");for(var t=10*this.format.currentStylePage;t<Math.min(10*(this.format.currentStylePage+1),Editor.styles.length);t++){var e=Editor.styles[t];r(e.commonStyle,e.vertexStyle,e.edgeStyle,e.graph,t)}}),E=mxUtils.bind(this,function(t){0<=t&&t<a&&(C[this.format.currentStylePage].style.background="transparent",f.innerHTML="",this.format.currentStylePage=t,v())});if(1<a){var S=document.createElement("div");S.style.whiteSpace="nowrap",S.style.position="relative",S.style.textAlign="center",S.style.paddingTop="4px",S.style.width="210px",t.style.paddingBottom="8px";for(var w,b,T=0;T<a;T++){var A=document.createElement("div");A.style.display="inline-block",A.style.width="6px",A.style.height="6px",A.style.marginLeft="4px",A.style.marginRight="3px",A.style.borderRadius="3px",A.style.cursor="pointer",A.style.background="transparent",A.style.border="1px solid #b5b6b7",mxUtils.bind(this,function(t,e){mxEvent.addListener(A,"click",mxUtils.bind(this,function(){E(t)}))})(T,A),S.appendChild(A),C.push(A)}function L(t){mxEvent.addListener(t,"mouseenter",function(){t.style.opacity="1"}),mxEvent.addListener(t,"mouseleave",function(){t.style.opacity="0.5"})}t.appendChild(S),v(),a<15&&((w=document.createElement("div")).style.cssText="position:absolute;left:0px;top:4px;bottom:0px;width:20px;margin:0px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);",mxEvent.addListener(w,"click",mxUtils.bind(this,function(){E(mxUtils.mod(this.format.currentStylePage-1,a))})),(b=document.createElement("div")).style.cssText="position:absolute;right:2px;top:4px;bottom:0px;width:20px;margin:0px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);",S.appendChild(w),S.appendChild(b),mxEvent.addListener(b,"click",mxUtils.bind(this,function(){E(mxUtils.mod(this.format.currentStylePage+1,a))})),L(w),L(b))}else v();return t},DiagramFormatPanel=function(t,e,n){BaseFormatPanel.call(this,t,e,n),this.init()},mxUtils.extend(DiagramFormatPanel,BaseFormatPanel),DiagramFormatPanel.showPageView=!0,DiagramFormatPanel.prototype.showBackgroundImageOption=!0,DiagramFormatPanel.prototype.init=function(){var t=this.editorUi.editor.graph;this.container.appendChild(this.addView(this.createPanel())),t.isEnabled()&&(this.container.appendChild(this.addOptions(this.createPanel())),this.container.appendChild(this.addPaperSize(this.createPanel())),this.container.appendChild(this.addStyleOps(this.createPanel())))},DiagramFormatPanel.prototype.addView=function(t){var e,n,i=this.editorUi,l=i.editor.graph;return t.appendChild(this.createTitle(mxResources.get("view"))),this.addGridOption(t),DiagramFormatPanel.showPageView&&t.appendChild(this.createOption(mxResources.get("pageView"),function(){return l.pageVisible},function(t){i.actions.get("pageView").funct()},{install:function(t){this.listener=function(){t(l.pageVisible)},i.addListener("pageViewChanged",this.listener)},destroy:function(){i.removeListener(this.listener)}})),l.isEnabled()&&(e=this.createColorOption(mxResources.get("background"),function(){return l.background},function(t){t=new ChangePageSetup(i,t);t.ignoreImage=!0,l.model.execute(t)},"#ffffff",{install:function(t){this.listener=function(){t(l.background)},i.addListener("backgroundColorChanged",this.listener)},destroy:function(){i.removeListener(this.listener)}}),this.showBackgroundImageOption&&((n=mxUtils.button(mxResources.get("image"),function(t){i.showBackgroundImageDialog(null,i.editor.graph.backgroundImage),mxEvent.consume(t)})).style.position="absolute",n.className="geColorBtn",n.style.marginTop="-4px",n.style.paddingBottom=11==document.documentMode||mxClient.IS_MT?"0px":"2px",n.style.height="22px",n.style.right=mxClient.IS_QUIRKS?"52px":"72px",n.style.width="56px",e.appendChild(n)),t.appendChild(e)),t},DiagramFormatPanel.prototype.addOptions=function(t){var e=this.editorUi,n=e.editor.graph;return t.appendChild(this.createTitle(mxResources.get("options"))),n.isEnabled()&&(t.appendChild(this.createOption(mxResources.get("connectionArrows"),function(){return n.connectionArrowsEnabled},function(t){e.actions.get("connectionArrows").funct()},{install:function(t){this.listener=function(){t(n.connectionArrowsEnabled)},e.addListener("connectionArrowsChanged",this.listener)},destroy:function(){e.removeListener(this.listener)}})),t.appendChild(this.createOption(mxResources.get("connectionPoints"),function(){return n.connectionHandler.isEnabled()},function(t){e.actions.get("connectionPoints").funct()},{install:function(t){this.listener=function(){t(n.connectionHandler.isEnabled())},e.addListener("connectionPointsChanged",this.listener)},destroy:function(){e.removeListener(this.listener)}})),t.appendChild(this.createOption(mxResources.get("guides"),function(){return n.graphHandler.guidesEnabled},function(t){e.actions.get("guides").funct()},{install:function(t){this.listener=function(){t(n.graphHandler.guidesEnabled)},e.addListener("guidesEnabledChanged",this.listener)},destroy:function(){e.removeListener(this.listener)}}))),t},DiagramFormatPanel.prototype.addGridOption=function(t){var n=this,i=this.editorUi,l=i.editor.graph,s=document.createElement("input");s.style.position="absolute",s.style.textAlign="right",s.style.width="38px",s.value=this.inUnit(l.getGridSize())+" "+this.getUnit();var o=this.createStepper(s,e,this.getUnitStep(),null,null,null,this.isFloatUnit());function e(t){var e=(n.isFloatUnit()?parseFloat:parseInt)(s.value);(e=n.fromUnit(Math.max(n.inUnit(1),isNaN(e)?n.inUnit(10):e)))!=l.getGridSize()&&l.setGridSize(e),s.value=n.inUnit(e)+" "+n.getUnit(),mxEvent.consume(t)}s.style.display=l.isGridEnabled()?"":"none",o.style.display=s.style.display,mxEvent.addListener(s,"keydown",function(t){13==t.keyCode?(l.container.focus(),mxEvent.consume(t)):27==t.keyCode&&(s.value=l.getGridSize(),l.container.focus(),mxEvent.consume(t))}),mxEvent.addListener(s,"blur",e),mxEvent.addListener(s,"change",e);function r(t,e){s.value=n.inUnit(l.getGridSize())+" "+n.getUnit(),n.format.refresh()}var a;l.view.addListener("unitChanged",r),this.listeners.push({destroy:function(){l.view.removeListener(r)}}),mxClient.IS_SVG?(s.style.marginTop="-2px",s.style.right="84px",o.style.marginTop="-16px",o.style.right="72px",(a=this.createColorOption(mxResources.get("grid"),function(){var t=l.view.gridColor;return l.isGridEnabled()?t:null},function(t){var e=l.isGridEnabled();t==mxConstants.NONE?l.setGridEnabled(!1):(l.setGridEnabled(!0),i.setGridColor(t)),s.style.display=l.isGridEnabled()?"":"none",o.style.display=s.style.display,e!=l.isGridEnabled()&&i.fireEvent(new mxEventObject("gridEnabledChanged"))},"#e0e0e0",{install:function(t){this.listener=function(){t(l.isGridEnabled()?l.view.gridColor:null)},i.addListener("gridColorChanged",this.listener),i.addListener("gridEnabledChanged",this.listener)},destroy:function(){i.removeListener(this.listener)}})).appendChild(s),a.appendChild(o),t.appendChild(a)):(s.style.marginTop="2px",s.style.right="32px",o.style.marginTop="2px",o.style.right="20px",t.appendChild(s),t.appendChild(o),t.appendChild(this.createOption(mxResources.get("grid"),function(){return l.isGridEnabled()},function(t){l.setGridEnabled(t),l.isGridEnabled()&&(l.view.gridColor="#e0e0e0"),i.fireEvent(new mxEventObject("gridEnabledChanged"))},{install:function(t){this.listener=function(){s.style.display=l.isGridEnabled()?"":"none",o.style.display=s.style.display,t(l.isGridEnabled())},i.addListener("gridEnabledChanged",this.listener)},destroy:function(){i.removeListener(this.listener)}})))},DiagramFormatPanel.prototype.addDocumentProperties=function(t){this.editorUi.editor.graph;return t.appendChild(this.createTitle(mxResources.get("options"))),t},DiagramFormatPanel.prototype.addPaperSize=function(t){var e=this.editorUi,n=e.editor.graph;t.appendChild(this.createTitle(mxResources.get("paperSize")));var i=PageSetupDialog.addPageFormatPanel(t,"formatpanel",n.pageFormat,function(t){null!=n.pageFormat&&n.pageFormat.width==t.width&&n.pageFormat.height==t.height||((t=new ChangePageSetup(e,null,null,t)).ignoreColor=!0,t.ignoreImage=!0,n.model.execute(t))});this.addKeyHandler(i.widthInput,function(){i.set(n.pageFormat)}),this.addKeyHandler(i.heightInput,function(){i.set(n.pageFormat)});function l(){i.set(n.pageFormat)}return e.addListener("pageFormatChanged",l),this.listeners.push({destroy:function(){e.removeListener(l)}}),n.getModel().addListener(mxEvent.CHANGE,l),this.listeners.push({destroy:function(){n.getModel().removeListener(l)}}),t},DiagramFormatPanel.prototype.addStyleOps=function(t){var e=mxUtils.button(mxResources.get("editData"),mxUtils.bind(this,function(t){this.editorUi.actions.get("editData").funct()}));return e.setAttribute("title",mxResources.get("editData")+" ("+this.editorUi.actions.get("editData").shortcut+")"),e.style.width="202px",e.style.marginBottom="2px",t.appendChild(e),mxUtils.br(t),(e=mxUtils.button(mxResources.get("clearDefaultStyle"),mxUtils.bind(this,function(t){this.editorUi.actions.get("clearDefaultStyle").funct()}))).setAttribute("title",mxResources.get("clearDefaultStyle")+" ("+this.editorUi.actions.get("clearDefaultStyle").shortcut+")"),e.style.width="202px",t.appendChild(e),t},DiagramFormatPanel.prototype.destroy=function(){BaseFormatPanel.prototype.destroy.apply(this,arguments),this.gridEnabledListener&&(this.editorUi.removeListener(this.gridEnabledListener),this.gridEnabledListener=null)},function(){function t(){mxSwimlane.call(this)}function e(){mxCylinder.call(this)}mxUtils.extend(t,mxSwimlane),t.prototype.getLabelBounds=function(t){return(0==this.getTitleSize()?mxShape:mxSwimlane).prototype.getLabelBounds.apply(this,arguments)},t.prototype.paintVertexShape=function(t,e,n,i,l){0==this.getTitleSize()?mxRectangleShape.prototype.paintBackground.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),t.translate(-e,-n)),this.paintForeground(t,e,n,i,l)},t.prototype.paintForeground=function(t,e,n,i,l){var o,r,a;null!=this.state&&(r=this.flipH,a=this.flipV,this.direction!=mxConstants.DIRECTION_NORTH&&this.direction!=mxConstants.DIRECTION_SOUTH||(o=r,r=a,a=o),t.rotate(-this.getShapeRotation(),r,a,e+i/2,n+l/2),s=this.scale,e=this.bounds.x/s,n=this.bounds.y/s,i=this.bounds.width/s,l=this.bounds.height/s,this.paintTableForeground(t,e,n,i,l))},t.prototype.paintTableForeground=function(t,e,n,i,l){var s=this.state.view.graph,o=s.getActualStartSize(this.state.cell),r=s.model.getChildCells(this.state.cell,!0);if(0<r.length){var a="0"!=mxUtils.getValue(this.state.style,"rowLines","1"),h="0"!=mxUtils.getValue(this.state.style,"columnLines","1");if(a)for(var d=1;d<r.length;d++)null!=(u=s.getCellGeometry(r[d]))&&(t.begin(),t.moveTo(e+o.x,n+u.y),t.lineTo(e+i-o.width,n+u.y),t.end(),t.stroke());if(h)for(var u,p=s.model.getChildCells(r[0],!0),d=1;d<p.length;d++)null!=(u=s.getCellGeometry(p[d]))&&(t.begin(),t.moveTo(e+u.x+o.x,n+o.y),t.lineTo(e+u.x+o.x,n+l-o.height),t.end(),t.stroke())}},mxCellRenderer.registerShape("table",t),mxUtils.extend(e,mxCylinder),e.prototype.size=20,e.prototype.darkOpacity=0,e.prototype.darkOpacity2=0,e.prototype.paintVertexShape=function(t,e,n,i,l){var s=Math.max(0,Math.min(i,Math.min(l,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),o=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),r=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity2",this.darkOpacity2))));t.translate(e,n),t.begin(),t.moveTo(0,0),t.lineTo(i-s,0),t.lineTo(i,s),t.lineTo(i,l),t.lineTo(s,l),t.lineTo(0,l-s),t.lineTo(0,0),t.close(),t.end(),t.fillAndStroke(),this.outline||(t.setShadow(!1),0!=o&&(t.setFillAlpha(Math.abs(o)),t.setFillColor(o<0?"#FFFFFF":"#000000"),t.begin(),t.moveTo(0,0),t.lineTo(i-s,0),t.lineTo(i,s),t.lineTo(s,s),t.close(),t.fill()),0!=r&&(t.setFillAlpha(Math.abs(r)),t.setFillColor(r<0?"#FFFFFF":"#000000"),t.begin(),t.moveTo(0,0),t.lineTo(s,s),t.lineTo(s,l),t.lineTo(0,l-s),t.close(),t.fill()),t.begin(),t.moveTo(s,l),t.lineTo(s,s),t.lineTo(0,0),t.moveTo(s,s),t.lineTo(i,s),t.end(),t.stroke())},e.prototype.getLabelMargins=function(t){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale;return new mxRectangle(e,e,0,0)}return null},mxCellRenderer.registerShape("cube",e);var r=Math.tan(mxUtils.toRadians(30)),a=(.5-r)/2;function n(){mxActor.call(this)}function i(){mxCylinder.call(this)}function l(){mxCylinder.call(this)}function o(){mxCylinder.call(this)}function h(){o.call(this)}function d(){mxShape.call(this)}function u(){mxShape.call(this)}function p(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function m(){mxActor.call(this)}function c(){mxCylinder.call(this)}function g(){mxCylinder.call(this)}function x(){mxActor.call(this)}function y(){mxActor.call(this)}function f(){mxActor.call(this)}mxUtils.extend(n,mxActor),n.prototype.size=20,n.prototype.redrawPath=function(t,e,n,i,l){var s=Math.min(i,l/r);t.translate((i-s)/2,(l-s)/2+s/4),t.moveTo(0,.25*s),t.lineTo(.5*s,s*a),t.lineTo(s,.25*s),t.lineTo(.5*s,(.5-a)*s),t.lineTo(0,.25*s),t.close(),t.end()},mxCellRenderer.registerShape("isoRectangle",n),mxUtils.extend(i,mxCylinder),i.prototype.size=20,i.prototype.redrawPath=function(t,e,n,i,l,s){var o=Math.min(i,l/(.5+r));s?(t.moveTo(0,.25*o),t.lineTo(.5*o,(.5-a)*o),t.lineTo(o,.25*o),t.moveTo(.5*o,(.5-a)*o),t.lineTo(.5*o,(1-a)*o)):(t.translate((i-o)/2,(l-o)/2),t.moveTo(0,.25*o),t.lineTo(.5*o,o*a),t.lineTo(o,.25*o),t.lineTo(o,.75*o),t.lineTo(.5*o,(1-a)*o),t.lineTo(0,.75*o),t.close()),t.end()},mxCellRenderer.registerShape("isoCube",i),mxUtils.extend(l,mxCylinder),l.prototype.redrawPath=function(t,e,n,i,l,s){var o=Math.min(l/2,Math.round(l/8)+this.strokewidth-1);(s&&null!=this.fill||!s&&null==this.fill)&&(t.moveTo(0,o),t.curveTo(0,2*o,i,2*o,i,o),s||(t.stroke(),t.begin()),t.translate(0,o/2),t.moveTo(0,o),t.curveTo(0,2*o,i,2*o,i,o),s||(t.stroke(),t.begin()),t.translate(0,o/2),t.moveTo(0,o),t.curveTo(0,2*o,i,2*o,i,o),s||(t.stroke(),t.begin()),t.translate(0,-o)),s||(t.moveTo(0,o),t.curveTo(0,-o/3,i,-o/3,i,o),t.lineTo(i,l-o),t.curveTo(i,l+o/3,0,l+o/3,0,l-o),t.close())},l.prototype.getLabelMargins=function(t){return new mxRectangle(0,2.5*Math.min(t.height/2,Math.round(t.height/8)+this.strokewidth-1),0,0)},mxCellRenderer.registerShape("datastore",l),mxUtils.extend(o,mxCylinder),o.prototype.size=30,o.prototype.darkOpacity=0,o.prototype.paintVertexShape=function(t,e,n,i,l){var s=Math.max(0,Math.min(i,Math.min(l,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),o=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));t.translate(e,n),t.begin(),t.moveTo(0,0),t.lineTo(i-s,0),t.lineTo(i,s),t.lineTo(i,l),t.lineTo(0,l),t.lineTo(0,0),t.close(),t.end(),t.fillAndStroke(),this.outline||(t.setShadow(!1),0!=o&&(t.setFillAlpha(Math.abs(o)),t.setFillColor(o<0?"#FFFFFF":"#000000"),t.begin(),t.moveTo(i-s,0),t.lineTo(i-s,s),t.lineTo(i,s),t.close(),t.fill()),t.begin(),t.moveTo(i-s,0),t.lineTo(i-s,s),t.lineTo(i,s),t.end(),t.stroke())},mxCellRenderer.registerShape("note",o),mxUtils.extend(h,o),mxCellRenderer.registerShape("note2",h),mxUtils.extend(d,mxShape),d.prototype.isoAngle=15,d.prototype.paintVertexShape=function(t,e,n,i,l){var s=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200,s=Math.min(i*Math.tan(s),.5*l);t.translate(e,n),t.begin(),t.moveTo(.5*i,0),t.lineTo(i,s),t.lineTo(i,l-s),t.lineTo(.5*i,l),t.lineTo(0,l-s),t.lineTo(0,s),t.close(),t.fillAndStroke(),t.setShadow(!1),t.begin(),t.moveTo(0,s),t.lineTo(.5*i,2*s),t.lineTo(i,s),t.moveTo(.5*i,2*s),t.lineTo(.5*i,l),t.stroke()},mxCellRenderer.registerShape("isoCube2",d),mxUtils.extend(u,mxShape),u.prototype.size=15,u.prototype.paintVertexShape=function(t,e,n,i,l){var s=Math.max(0,Math.min(.5*l,parseFloat(mxUtils.getValue(this.style,"size",this.size))));t.translate(e,n),0==s?(t.rect(0,0,i,l),t.fillAndStroke()):(t.begin(),t.moveTo(0,s),t.arcTo(.5*i,s,0,0,1,.5*i,0),t.arcTo(.5*i,s,0,0,1,i,s),t.lineTo(i,l-s),t.arcTo(.5*i,s,0,0,1,.5*i,l),t.arcTo(.5*i,s,0,0,1,0,l-s),t.close(),t.fillAndStroke(),t.setShadow(!1),t.begin(),t.moveTo(i,s),t.arcTo(.5*i,s,0,0,1,.5*i,2*s),t.arcTo(.5*i,s,0,0,1,0,s),t.stroke())},mxCellRenderer.registerShape("cylinder2",u),mxUtils.extend(p,mxCylinder),p.prototype.size=15,p.prototype.paintVertexShape=function(t,e,n,i,l){var s=Math.max(0,Math.min(.5*l,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),o=mxUtils.getValue(this.style,"lid",!0);t.translate(e,n),0==s?(t.rect(0,0,i,l),t.fillAndStroke()):(t.begin(),o?(t.moveTo(0,s),t.arcTo(.5*i,s,0,0,1,.5*i,0),t.arcTo(.5*i,s,0,0,1,i,s)):(t.moveTo(0,0),t.arcTo(.5*i,s,0,0,0,.5*i,s),t.arcTo(.5*i,s,0,0,0,i,0)),t.lineTo(i,l-s),t.arcTo(.5*i,s,0,0,1,.5*i,l),t.arcTo(.5*i,s,0,0,1,0,l-s),t.close(),t.fillAndStroke(),t.setShadow(!1),o&&(t.begin(),t.moveTo(i,s),t.arcTo(.5*i,s,0,0,1,.5*i,2*s),t.arcTo(.5*i,s,0,0,1,0,s),t.stroke()))},mxCellRenderer.registerShape("cylinder3",p),mxUtils.extend(m,mxActor),m.prototype.redrawPath=function(t,e,n,i,l){t.moveTo(0,0),t.quadTo(i/2,.5*l,i,0),t.quadTo(.5*i,l/2,i,l),t.quadTo(i/2,.5*l,0,l),t.quadTo(.5*i,l/2,0,0),t.end()},mxCellRenderer.registerShape("switch",m),mxUtils.extend(c,mxCylinder),c.prototype.tabWidth=60,c.prototype.tabHeight=20,c.prototype.tabPosition="right",c.prototype.arcSize=.1,c.prototype.paintVertexShape=function(t,e,n,i,l){t.translate(e,n);var s=Math.max(0,Math.min(i,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))),o=Math.max(0,Math.min(l,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight)))),r=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),a=mxUtils.getValue(this.style,"rounded",!1),e=mxUtils.getValue(this.style,"absoluteArcSize",!1),n=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));e||(n=Math.min(i,l)*n),n=Math.min(n,.5*i,.5*(l-o)),s=Math.max(s,n),s=Math.min(i-n,s),a||(n=0),t.begin(),"left"==r?(t.moveTo(Math.max(n,0),o),t.lineTo(Math.max(n,0),0),t.lineTo(s,0),t.lineTo(s,o)):(t.moveTo(i-s,o),t.lineTo(i-s,0),t.lineTo(i-Math.max(n,0),0),t.lineTo(i-Math.max(n,0),o)),a?(t.moveTo(0,n+o),t.arcTo(n,n,0,0,1,n,o),t.lineTo(i-n,o),t.arcTo(n,n,0,0,1,i,n+o),t.lineTo(i,l-n),t.arcTo(n,n,0,0,1,i-n,l),t.lineTo(n,l),t.arcTo(n,n,0,0,1,0,l-n)):(t.moveTo(0,o),t.lineTo(i,o),t.lineTo(i,l),t.lineTo(0,l)),t.close(),t.fillAndStroke(),t.setShadow(!1),"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(t.begin(),t.moveTo(i-30,o+20),t.lineTo(i-20,o+10),t.lineTo(i-10,o+20),t.close(),t.stroke())},mxCellRenderer.registerShape("folder",c),mxUtils.extend(g,mxCylinder),g.prototype.arcSize=.1,g.prototype.paintVertexShape=function(t,e,n,i,l){t.translate(e,n);var s=mxUtils.getValue(this.style,"rounded",!1),o=mxUtils.getValue(this.style,"absoluteArcSize",!1),e=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize)),n=mxUtils.getValue(this.style,"umlStateConnection",null);o||(e=Math.min(i,l)*e),e=Math.min(e,.5*i,.5*l),s||(e=0);s=null!=n?10:0;t.begin(),t.moveTo(s,e),t.arcTo(e,e,0,0,1,s+e,0),t.lineTo(i-e,0),t.arcTo(e,e,0,0,1,i,e),t.lineTo(i,l-e),t.arcTo(e,e,0,0,1,i-e,l),t.lineTo(s+e,l),t.arcTo(e,e,0,0,1,s,l-e),t.close(),t.fillAndStroke(),t.setShadow(!1),"collapseState"==mxUtils.getValue(this.style,"umlStateSymbol",null)&&(t.roundrect(i-40,l-20,10,10,3,3),t.stroke(),t.roundrect(i-20,l-20,10,10,3,3),t.stroke(),t.begin(),t.moveTo(i-30,l-15),t.lineTo(i-20,l-15),t.stroke()),"connPointRefEntry"==n?(t.ellipse(0,.5*l-10,20,20),t.fillAndStroke()):"connPointRefExit"==n&&(t.ellipse(0,.5*l-10,20,20),t.fillAndStroke(),t.begin(),t.moveTo(5,.5*l-5),t.lineTo(15,.5*l+5),t.moveTo(15,.5*l-5),t.lineTo(5,.5*l+5),t.stroke())},mxCellRenderer.registerShape("umlState",g),mxUtils.extend(x,mxActor),x.prototype.size=30,x.prototype.isRoundable=function(){return!0},x.prototype.redrawPath=function(t,e,n,i,l){var s=Math.max(0,Math.min(i,Math.min(l,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),o=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(s,0),new mxPoint(i,0),new mxPoint(i,l),new mxPoint(0,l),new mxPoint(0,s)],this.isRounded,o,!0),t.end()},mxCellRenderer.registerShape("card",x),mxUtils.extend(y,mxActor),y.prototype.size=.4,y.prototype.redrawPath=function(t,e,n,i,l){var s=l*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));t.moveTo(0,s/2),t.quadTo(i/4,1.4*s,i/2,s/2),t.quadTo(3*i/4,s*(1-1.4),i,s/2),t.lineTo(i,l-s/2),t.quadTo(3*i/4,l-1.4*s,i/2,l-s/2),t.quadTo(i/4,l-s*(1-1.4),0,l-s/2),t.lineTo(0,s/2),t.close(),t.end()},y.prototype.getLabelBounds=function(t){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var e=mxUtils.getValue(this.style,"size",this.size),n=t.width,i=t.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST){var l=i*e;return new mxRectangle(t.x,t.y+l,n,i-2*l)}e=n*e;return new mxRectangle(t.x+e,t.y,n-2*e,i)}return t},mxCellRenderer.registerShape("tape",y),mxUtils.extend(f,mxActor),f.prototype.size=.3,f.prototype.getLabelMargins=function(t){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*t.height):null},f.prototype.redrawPath=function(t,e,n,i,l){var s=l*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));t.moveTo(0,0),t.lineTo(i,0),t.lineTo(i,l-s/2),t.quadTo(3*i/4,l-1.4*s,i/2,l-s/2),t.quadTo(i/4,l-s*(1-1.4),0,l-s/2),t.lineTo(0,s/2),t.close(),t.end()},mxCellRenderer.registerShape("document",f);var C=mxCylinder.prototype.getCylinderSize;function v(){mxActor.call(this)}function E(){mxActor.call(this)}function S(){mxActor.call(this)}function w(){mxActor.call(this)}function b(t,e){this.canvas=t,this.canvas.setLineJoin("round"),this.canvas.setLineCap("round"),this.defaultVariation=e,this.originalLineTo=this.canvas.lineTo,this.canvas.lineTo=mxUtils.bind(this,b.prototype.lineTo),this.originalMoveTo=this.canvas.moveTo,this.canvas.moveTo=mxUtils.bind(this,b.prototype.moveTo),this.originalClose=this.canvas.close,this.canvas.close=mxUtils.bind(this,b.prototype.close),this.originalQuadTo=this.canvas.quadTo,this.canvas.quadTo=mxUtils.bind(this,b.prototype.quadTo),this.originalCurveTo=this.canvas.curveTo,this.canvas.curveTo=mxUtils.bind(this,b.prototype.curveTo),this.originalArcTo=this.canvas.arcTo,this.canvas.arcTo=mxUtils.bind(this,b.prototype.arcTo)}mxCylinder.prototype.getCylinderSize=function(t,e,n,i){var l=mxUtils.getValue(this.style,"size");return null!=l?i*Math.max(0,Math.min(1,l)):C.apply(this,arguments)},mxCylinder.prototype.getLabelMargins=function(t){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var e=2*mxUtils.getValue(this.style,"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale,t.height*e),0,0)}return null},p.prototype.getLabelMargins=function(t){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var e=mxUtils.getValue(this.style,"size",15);return mxUtils.getValue(this.style,"lid",!0)||(e/=2),new mxRectangle(0,Math.min(t.height*this.scale,2*e*this.scale),0,Math.max(0,.3*e*this.scale))}return null},c.prototype.getLabelMargins=function(t){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var e=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var n=mxUtils.getValue(this.style,"tabWidth",15)*this.scale,e=mxUtils.getValue(this.style,"tabHeight",15)*this.scale,i=mxUtils.getValue(this.style,"rounded",!1),l=mxUtils.getValue(this.style,"absoluteArcSize",!1),s=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));return l||(s=Math.min(t.width,t.height)*s),s=Math.min(s,.5*t.width,.5*(t.height-e)),i||(s=0),"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(s,0,Math.min(t.width,t.width-n),Math.min(t.height,t.height-e)):new mxRectangle(Math.min(t.width,t.width-n),0,s,Math.min(t.height,t.height-e))}return new mxRectangle(0,Math.min(t.height,e),0,0)}return null},g.prototype.getLabelMargins=function(t){if(mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=mxUtils.getValue(this.style,"umlStateConnection",null))return new mxRectangle(10*this.scale,0,0,0);return null},h.prototype.getLabelMargins=function(t){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var e=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(t.height*this.scale,e*this.scale),0,Math.max(0,e*this.scale))}return null},mxUtils.extend(v,mxActor),v.prototype.size=.2,v.prototype.fixedSize=20,v.prototype.isRoundable=function(){return!0},v.prototype.redrawPath=function(t,e,n,i,l){var s="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(i,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):i*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),o=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,l),new mxPoint(s,0),new mxPoint(i,0),new mxPoint(i-s,l)],this.isRounded,o,!0),t.end()},mxCellRenderer.registerShape("parallelogram",v),mxUtils.extend(E,mxActor),E.prototype.size=.2,E.prototype.fixedSize=20,E.prototype.isRoundable=function(){return!0},E.prototype.redrawPath=function(t,e,n,i,l){var s="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*i,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):i*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),o=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,l),new mxPoint(s,0),new mxPoint(i-s,0),new mxPoint(i,l)],this.isRounded,o,!0)},mxCellRenderer.registerShape("trapezoid",E),mxUtils.extend(S,mxActor),S.prototype.size=.5,S.prototype.redrawPath=function(t,e,n,i,l){t.setFillColor(null);var s=i*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),o=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(i,0),new mxPoint(s,0),new mxPoint(s,l/2),new mxPoint(0,l/2),new mxPoint(s,l/2),new mxPoint(s,l),new mxPoint(i,l)],this.isRounded,o,!1),t.end()},mxCellRenderer.registerShape("curlyBracket",S),mxUtils.extend(w,mxActor),w.prototype.redrawPath=function(t,e,n,i,l){t.setStrokeWidth(1),t.setFillColor(this.stroke);i/=5;t.rect(0,0,i,l),t.fillAndStroke(),t.rect(2*i,0,i,l),t.fillAndStroke(),t.rect(4*i,0,i,l),t.fillAndStroke()},mxCellRenderer.registerShape("parallelMarker",w),b.prototype.moveTo=function(t,e){this.originalMoveTo.apply(this.canvas,arguments),this.lastX=t,this.lastY=e,this.firstX=t,this.firstY=e},b.prototype.close=function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments)),this.originalClose.apply(this.canvas,arguments)},b.prototype.quadTo=function(t,e,n,i){this.originalQuadTo.apply(this.canvas,arguments),this.lastX=n,this.lastY=i},b.prototype.curveTo=function(t,e,n,i,l,s){this.originalCurveTo.apply(this.canvas,arguments),this.lastX=l,this.lastY=s},b.prototype.arcTo=function(t,e,n,i,l,s,o){this.originalArcTo.apply(this.canvas,arguments),this.lastX=s,this.lastY=o},b.prototype.lineTo=function(t,e){if(null!=this.lastX&&null!=this.lastY){var n=Math.abs(t-this.lastX),i=Math.abs(e-this.lastY),l=Math.sqrt(n*n+i*i);if(l<2)return this.originalLineTo.apply(this.canvas,arguments),this.lastX=t,void(this.lastY=e);var s=Math.round(l/10),o=this.defaultVariation;function r(t){return"number"==typeof t?t?t<0?-1:1:t==t?0:NaN:NaN}s<5&&(s=5,o/=3);for(var a=r(t-this.lastX)*n/s,h=r(e-this.lastY)*i/s,d=n/l,u=i/l,p=0;p<s;p++){var m=a*p+this.lastX,c=h*p+this.lastY,g=(Math.random()-.5)*o;this.originalLineTo.call(this.canvas,m-g*u,c-g*d)}this.originalLineTo.call(this.canvas,t,e),this.lastX=t,this.lastY=e}else this.originalLineTo.apply(this.canvas,arguments),this.lastX=t,this.lastY=e},b.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo,this.canvas.moveTo=this.originalMoveTo,this.canvas.close=this.originalClose,this.canvas.quadTo=this.originalQuadTo,this.canvas.curveTo=this.originalCurveTo,this.canvas.arcTo=this.originalArcTo},mxShape.prototype.defaultJiggle=1.5;var T=mxShape.prototype.beforePaint;mxShape.prototype.beforePaint=function(t){T.apply(this,arguments),null==t.handJiggle&&(t.handJiggle=this.createHandJiggle(t))};var A=mxShape.prototype.afterPaint;mxShape.prototype.afterPaint=function(t){A.apply(this,arguments),null!=t.handJiggle&&(t.handJiggle.destroy(),delete t.handJiggle)},mxShape.prototype.createComicCanvas=function(t){return new b(t,mxUtils.getValue(this.style,"jiggle",this.defaultJiggle))},mxShape.prototype.createHandJiggle=function(t){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")?null:this.createComicCanvas(t)},mxRhombus.prototype.defaultJiggle=2;var L=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.outline&&(null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")&&"0"==mxUtils.getValue(this.style,"sketch","1"==urlParams.rough?"1":"0"))&&L.apply(this,arguments)};var I=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(t,e,n,i,l){var s,o;null==t.handJiggle||t.handJiggle.constructor!=b?I.apply(this,arguments):(s=!0,null!=this.style&&(s="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),(s||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)&&(s||null!=this.fill&&this.fill!=mxConstants.NONE||(t.pointerEvents=!1),t.begin(),this.isRounded?(o=0,o="1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?Math.min(i/2,Math.min(l/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,Math.min(i*s,l*s)),t.moveTo(e+o,n),t.lineTo(e+i-o,n),t.quadTo(e+i,n,e+i,n+o),t.lineTo(e+i,n+l-o),t.quadTo(e+i,n+l,e+i-o,n+l),t.lineTo(e+o,n+l),t.quadTo(e,n+l,e,n+l-o),t.lineTo(e,n+o),t.quadTo(e,n,e+o,n)):(t.moveTo(e,n),t.lineTo(e+i,n),t.lineTo(e+i,n+l),t.lineTo(e,n+l),t.lineTo(e,n)),t.close(),t.end(),t.fillAndStroke()))};var M=mxRectangleShape.prototype.paintForeground;function R(){mxRectangleShape.call(this)}function P(){mxRectangleShape.call(this)}function O(){mxActor.call(this)}function U(){mxActor.call(this)}function N(){mxActor.call(this)}function H(){mxRectangleShape.call(this)}mxRectangleShape.prototype.paintForeground=function(t,e,n,i,l){null==t.handJiggle&&M.apply(this,arguments)},mxUtils.extend(R,mxRectangleShape),R.prototype.size=.1,R.prototype.fixedSize=!1,R.prototype.isHtmlAllowed=function(){return!1},R.prototype.getLabelBounds=function(t){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)!=(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST))return t;var e=t.width,n=t.height,i=new mxRectangle(t.x,t.y,e,n),l=e*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));return this.isRounded&&(t=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,l=Math.max(l,Math.min(e*t,n*t))),i.x+=Math.round(l),i.width-=Math.round(2*l),i},R.prototype.paintForeground=function(t,e,n,i,l){var s=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),o=parseFloat(mxUtils.getValue(this.style,"size",this.size));o=s?Math.max(0,Math.min(i,o)):i*Math.max(0,Math.min(1,o)),this.isRounded&&(s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,o=Math.max(o,Math.min(i*s,l*s))),o=Math.round(o),t.begin(),t.moveTo(e+o,n),t.lineTo(e+o,n+l),t.moveTo(e+i-o,n),t.lineTo(e+i-o,n+l),t.end(),t.stroke(),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxCellRenderer.registerShape("process",R),mxUtils.extend(P,mxRectangleShape),P.prototype.paintBackground=function(t,e,n,i,l){t.setFillColor(mxConstants.NONE),t.rect(e,n,i,l),t.fill()},P.prototype.paintForeground=function(t,e,n,i,l){},mxCellRenderer.registerShape("transparent",P),mxUtils.extend(O,mxHexagon),O.prototype.size=30,O.prototype.position=.5,O.prototype.position2=.5,O.prototype.base=20,O.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)},O.prototype.isRoundable=function(){return!0},O.prototype.redrawPath=function(t,e,n,i,l){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,o=Math.max(0,Math.min(l,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),r=i*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),a=i*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),h=Math.max(0,Math.min(i,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(t,[new mxPoint(0,0),new mxPoint(i,0),new mxPoint(i,l-o),new mxPoint(Math.min(i,r+h),l-o),new mxPoint(a,l),new mxPoint(Math.max(0,r),l-o),new mxPoint(0,l-o)],this.isRounded,s,!0,[4])},mxCellRenderer.registerShape("callout",O),mxUtils.extend(U,mxActor),U.prototype.size=.2,U.prototype.fixedSize=20,U.prototype.isRoundable=function(){return!0},U.prototype.redrawPath=function(t,e,n,i,l){var s="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(i,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):i*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),o=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,0),new mxPoint(i-s,0),new mxPoint(i,l/2),new mxPoint(i-s,l),new mxPoint(0,l),new mxPoint(s,l/2)],this.isRounded,o,!0),t.end()},mxCellRenderer.registerShape("step",U),mxUtils.extend(N,mxHexagon),N.prototype.size=.25,N.prototype.fixedSize=20,N.prototype.isRoundable=function(){return!0},N.prototype.redrawPath=function(t,e,n,i,l){var s="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*i,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):i*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),o=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(s,0),new mxPoint(i-s,0),new mxPoint(i,.5*l),new mxPoint(i-s,l),new mxPoint(s,l),new mxPoint(0,.5*l)],this.isRounded,o,!0)},mxCellRenderer.registerShape("hexagon",N),mxUtils.extend(H,mxRectangleShape),H.prototype.isHtmlAllowed=function(){return!1},H.prototype.paintForeground=function(t,e,n,i,l){var s=Math.min(i/5,l/5)+1;t.begin(),t.moveTo(e+i/2,n+s),t.lineTo(e+i/2,n+l-s),t.moveTo(e+s,n+l/2),t.lineTo(e+i-s,n+l/2),t.end(),t.stroke(),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxCellRenderer.registerShape("plus",H);var _,D,G,k,V=mxRhombus.prototype.paintVertexShape;function F(){mxRectangleShape.call(this)}function B(){mxCylinder.call(this)}function z(){mxShape.call(this)}function Y(){mxShape.call(this)}function W(){mxEllipse.call(this)}function j(){mxShape.call(this)}function X(){mxShape.call(this)}function Z(){mxRectangleShape.call(this)}function K(){mxShape.call(this)}function Q(){mxShape.call(this)}function J(){mxShape.call(this)}function q(){mxShape.call(this)}function $(){mxShape.call(this)}function tt(){mxCylinder.call(this)}function et(){mxCylinder.call(this)}function nt(){mxRectangleShape.call(this)}function it(){mxDoubleEllipse.call(this)}function lt(){it.call(this)}function st(){mxArrowConnector.call(this),this.spacing=0}function ot(){mxArrowConnector.call(this),this.spacing=0}function rt(){mxActor.call(this)}function at(){mxRectangleShape.call(this)}function ht(){mxActor.call(this)}function dt(){mxActor.call(this)}function ut(){mxActor.call(this)}function pt(){mxActor.call(this)}function mt(){mxActor.call(this)}function ct(){mxActor.call(this)}function gt(){mxActor.call(this)}function xt(){mxActor.call(this)}function yt(){mxActor.call(this)}function ft(){mxActor.call(this)}function Ct(){mxEllipse.call(this)}function vt(){mxEllipse.call(this)}function Et(){mxEllipse.call(this)}function St(){mxRhombus.call(this)}function wt(){mxEllipse.call(this)}function bt(){mxEllipse.call(this)}function Tt(){mxEllipse.call(this)}function At(){mxEllipse.call(this)}function Lt(){mxActor.call(this)}function It(){mxActor.call(this)}function Mt(){mxActor.call(this)}function Rt(){mxConnector.call(this)}function Pt(t,e,n,i,l,s,o,r,a,h){var o=o+a,d=i.clone();return i.x-=l*(2*o+a),i.y-=s*(2*o+a),l*=o+a,s*=o+a,function(){t.ellipse(d.x-l-o,d.y-s-o,2*o,2*o),h?t.fillAndStroke():t.stroke()}}function Ot(t,n,e,i,l,s,o){var r,a=new mxHandle(t,null,mxVertexHandler.prototype.secondaryHandleImage);return a.execute=function(t){for(var e=0;e<n.length;e++)this.copyStyle(n[e]);o&&o(t)},a.getPosition=e,a.setPosition=i,a.ignoreGrid=null==l||l,s&&(r=a.positionChanged,a.positionChanged=function(){r.apply(this,arguments),t.view.invalidate(this.state.cell),t.view.validate()}),a}function Ut(i,l){return Ot(i,[mxConstants.STYLE_ARCSIZE],function(t){var e=null!=l?l:t.height/8;if("1"==mxUtils.getValue(i.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var n=mxUtils.getValue(i.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(t.x+t.width-Math.min(t.width/2,n),t.y+e)}n=Math.max(0,parseFloat(mxUtils.getValue(i.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(t.x+t.width-Math.min(Math.max(t.width/2,t.height/2),Math.min(t.width,t.height)*n),t.y+e)},function(t,e,n){"1"==mxUtils.getValue(i.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(t.width,2*(t.x+t.width-e.x)))):(t=Math.min(50,Math.max(0,100*(t.width-e.x+t.x)/Math.min(t.width,t.height))),this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(t))})}function Nt(){return function(t){var e=[];return mxUtils.getValue(t.style,mxConstants.STYLE_ROUNDED,!1)&&e.push(Ut(t)),e}}function Ht(i,l,s){return i=null!=i?i:.5,function(t){var e=[Ot(t,["size"],function(t){var e=null!=s?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,n=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",e?s:l)));return new mxPoint(t.x+Math.min(.75*t.width*i,n*(e?.75:.75*t.width)),t.y+t.height/4)},function(t,e){t=(null!=s?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null)?e.x-t.x:Math.max(0,Math.min(i,(e.x-t.x)/t.width*.75));this.state.style.size=t},!1,!0)];return mxUtils.getValue(t.style,mxConstants.STYLE_ROUNDED,!1)&&e.push(Ut(t)),e}}function _t(i,n,l,s,o){return l=null!=l?l:.5,function(t){var e=[Ot(t,["size"],function(t){var e=null!=o?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,n=parseFloat(mxUtils.getValue(this.state.style,"size",e?o:i));return new mxPoint(t.x+Math.max(0,Math.min(.5*t.width,n*(e?1:t.width))),t.getCenterY())},function(t,e,n){t=(null!=o?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null)?e.x-t.x:Math.max(0,Math.min(l,(e.x-t.x)/t.width));this.state.style.size=t},!1,s)];return n&&mxUtils.getValue(t.style,mxConstants.STYLE_ROUNDED,!1)&&e.push(Ut(t)),e}}function Dt(n,i,l){return function(t){var e=[Ot(t,["size"],function(t){var e=Math.max(0,Math.min(t.width,Math.min(t.height,parseFloat(mxUtils.getValue(this.state.style,"size",i)))))*n;return new mxPoint(t.x+e,t.y+e)},function(t,e){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(t.width,e.x-t.x),Math.min(t.height,e.y-t.y)))/n)},!1)];return l&&mxUtils.getValue(t.style,mxConstants.STYLE_ROUNDED,!1)&&e.push(Ut(t)),e}}function Gt(n){return function(t){return[Ot(t,["size"],function(t){var e=Math.max(0,Math.min(.5*t.height,parseFloat(mxUtils.getValue(this.state.style,"size",n))));return new mxPoint(t.x,t.y+e)},function(t,e){this.state.style.size=Math.max(0,e.y-t.y)},!0)]}}function kt(i){return function(t){return[Ot(t,["arrowWidth","arrowSize"],function(t){var e=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",pt.prototype.arrowWidth))),n=Math.max(0,Math.min(i,mxUtils.getValue(this.state.style,"arrowSize",pt.prototype.arrowSize)));return new mxPoint(t.x+(1-n)*t.width,t.y+(1-e)*t.height/2)},function(t,e){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(t.y+t.height/2-e.y)/t.height*2)),this.state.style.arrowSize=Math.max(0,Math.min(i,(t.x+t.width-e.x)/t.width))})]}}function Vt(d,t,u,a,p){return Ot(d,t,function(t){var e=d.absolutePoints,n=e.length-1,i=d.view.translate,l=d.view.scale,s=u?e[0]:e[n],o=u?e[1]:e[n-1],r=o.x-s.x,e=o.y-s.y,n=Math.sqrt(r*r+e*e),o=a.call(this,n,r/n,e/n,s,o);return new mxPoint(o.x/l-i.x,o.y/l-i.y)},function(t,e,n){var i=d.absolutePoints,l=i.length-1,s=d.view.translate,o=d.view.scale,r=u?i[0]:i[l],a=u?i[1]:i[l-1],h=a.x-r.x,i=a.y-r.y,l=Math.sqrt(h*h+i*i);e.x=(e.x+s.x)*o,e.y=(e.y+s.y)*o,p.call(this,l,h/l,i/l,r,a,e,n)})}function Ft(o,t,r){return Vt(o,["width"],t,function(t,e,n,i,l){var s=o.shape.getEdgeWidth()*o.view.scale+r;return new mxPoint(i.x+e*t/4+n*s/2,i.y+n*t/4-e*s/2)},function(t,e,n,i,l,s){s=Math.sqrt(mxUtils.ptSegDistSq(i.x,i.y,l.x,l.y,s.x,s.y));o.style.width=Math.round(2*s)/o.view.scale-r})}mxRhombus.prototype.getLabelBounds=function(t){if(1!=this.style.double)return t;var e=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(t.x+e,t.y+e,t.width-2*e,t.height-2*e)},mxRhombus.prototype.paintVertexShape=function(t,e,n,i,l){var s;V.apply(this,arguments),this.outline||1!=this.style.double||(s=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0),e+=s,n+=s,l-=2*s,0<(i-=2*s)&&0<l&&(t.setShadow(!1),V.apply(this,[t,e,n,i,l])))},mxUtils.extend(F,mxRectangleShape),F.prototype.isHtmlAllowed=function(){return!1},F.prototype.getLabelBounds=function(t){if(1!=this.style.double)return t;var e=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(t.x+e,t.y+e,t.width-2*e,t.height-2*e)},F.prototype.paintForeground=function(t,e,n,i,l){if(null!=this.style){var s;this.outline||1!=this.style.double||(s=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0),e+=s,n+=s,l-=2*s,0<(i-=2*s)&&0<l&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)),t.setDashed(!1);var o,r,a,h,d,u,p,m,c=0,g=null;do{}while(null!=(g=mxCellRenderer.defaultShapes[this.style["symbol"+c]])&&(o=this.style["symbol"+c+"Align"],r=this.style["symbol"+c+"VerticalAlign"],a=this.style["symbol"+c+"Width"],h=this.style["symbol"+c+"Height"],d=this.style["symbol"+c+"Spacing"]||0,m=this.style["symbol"+c+"VSpacing"]||d,null!=(u=this.style["symbol"+c+"ArcSpacing"])&&(d+=p=this.getArcSize(i+this.strokewidth,l+this.strokewidth)*u,m+=p),u=e,p=n,o==mxConstants.ALIGN_CENTER?u+=(i-a)/2:o==mxConstants.ALIGN_RIGHT?u+=i-a-d:u+=d,r==mxConstants.ALIGN_MIDDLE?p+=(l-h)/2:r==mxConstants.ALIGN_BOTTOM?p+=l-h-m:p+=m,t.save(),(m=new g).style=this.style,g.prototype.paintVertexShape.call(m,t,u,p,a,h),t.restore()),c++,null!=g)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxCellRenderer.registerShape("ext",F),mxUtils.extend(B,mxCylinder),B.prototype.redrawPath=function(t,e,n,i,l,s){s?(t.moveTo(0,0),t.lineTo(i/2,l/2),t.lineTo(i,0),t.end()):(t.moveTo(0,0),t.lineTo(i,0),t.lineTo(i,l),t.lineTo(0,l),t.close())},mxCellRenderer.registerShape("message",B),mxUtils.extend(z,mxShape),z.prototype.paintBackground=function(t,e,n,i,l){t.translate(e,n),t.ellipse(i/4,0,i/2,l/4),t.fillAndStroke(),t.begin(),t.moveTo(i/2,l/4),t.lineTo(i/2,2*l/3),t.moveTo(i/2,l/3),t.lineTo(0,l/3),t.moveTo(i/2,l/3),t.lineTo(i,l/3),t.moveTo(i/2,2*l/3),t.lineTo(0,l),t.moveTo(i/2,2*l/3),t.lineTo(i,l),t.end(),t.stroke()},mxCellRenderer.registerShape("umlActor",z),mxUtils.extend(Y,mxShape),Y.prototype.getLabelMargins=function(t){return new mxRectangle(t.width/6,0,0,0)},Y.prototype.paintBackground=function(t,e,n,i,l){t.translate(e,n),t.begin(),t.moveTo(0,l/4),t.lineTo(0,3*l/4),t.end(),t.stroke(),t.begin(),t.moveTo(0,l/2),t.lineTo(i/6,l/2),t.end(),t.stroke(),t.ellipse(i/6,0,5*i/6,l),t.fillAndStroke()},mxCellRenderer.registerShape("umlBoundary",Y),mxUtils.extend(W,mxEllipse),W.prototype.paintVertexShape=function(t,e,n,i,l){mxEllipse.prototype.paintVertexShape.apply(this,arguments),t.begin(),t.moveTo(e+i/8,n+l),t.lineTo(e+7*i/8,n+l),t.end(),t.stroke()},mxCellRenderer.registerShape("umlEntity",W),mxUtils.extend(j,mxShape),j.prototype.paintVertexShape=function(t,e,n,i,l){t.translate(e,n),t.begin(),t.moveTo(i,0),t.lineTo(0,l),t.moveTo(0,0),t.lineTo(i,l),t.end(),t.stroke()},mxCellRenderer.registerShape("umlDestroy",j),mxUtils.extend(X,mxShape),X.prototype.getLabelBounds=function(t){return new mxRectangle(t.x,t.y+t.height/8,t.width,7*t.height/8)},X.prototype.paintBackground=function(t,e,n,i,l){t.translate(e,n),t.begin(),t.moveTo(3*i/8,l/8*1.1),t.lineTo(5*i/8,0),t.end(),t.stroke(),t.ellipse(0,l/8,i,7*l/8),t.fillAndStroke()},X.prototype.paintForeground=function(t,e,n,i,l){t.begin(),t.moveTo(3*i/8,l/8*1.1),t.lineTo(5*i/8,l/4),t.end(),t.stroke()},mxCellRenderer.registerShape("umlControl",X),mxUtils.extend(Z,mxRectangleShape),Z.prototype.size=40,Z.prototype.isHtmlAllowed=function(){return!1},Z.prototype.getLabelBounds=function(t){var e=Math.max(0,Math.min(t.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(t.x,t.y,t.width,e)},Z.prototype.paintBackground=function(t,e,n,i,l){var s=Math.max(0,Math.min(l,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),o=mxUtils.getValue(this.style,"participant");null==o||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,t,e,n,i,s):null!=(o=this.state.view.graph.cellRenderer.getShape(o))&&o!=Z&&((o=new o).apply(this.state),t.save(),o.paintVertexShape(t,e,n,i,s),t.restore()),s<l&&(t.setDashed(!0),t.begin(),t.moveTo(e+i/2,n+s),t.lineTo(e+i/2,n+l),t.end(),t.stroke())},Z.prototype.paintForeground=function(t,e,n,i,l){var s=Math.max(0,Math.min(l,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,t,e,n,i,Math.min(l,s))},mxCellRenderer.registerShape("umlLifeline",Z),mxUtils.extend(K,mxShape),K.prototype.width=60,K.prototype.height=30,K.prototype.corner=10,K.prototype.getLabelMargins=function(t){return new mxRectangle(0,0,t.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),t.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))},K.prototype.paintBackground=function(t,e,n,i,l){var s=this.corner,o=Math.min(i,Math.max(s,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),r=Math.min(l,Math.max(1.5*s,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),a=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);a!=mxConstants.NONE&&(t.setFillColor(a),t.rect(e,n,i,l),t.fill()),null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(t,e,n,i,l),t.setGradient(this.fill,this.gradient,e,n,i,l,this.gradientDirection)):t.setFillColor(this.fill),t.begin(),t.moveTo(e,n),t.lineTo(e+o,n),t.lineTo(e+o,n+Math.max(0,r-1.5*s)),t.lineTo(e+Math.max(0,o-s),n+r),t.lineTo(e,n+r),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(e+o,n),t.lineTo(e+i,n),t.lineTo(e+i,n+l),t.lineTo(e,n+l),t.lineTo(e,n+r),t.stroke()},mxCellRenderer.registerShape("umlFrame",K),mxPerimeter.LifelinePerimeter=function(t,e,n,i){var l=Z.prototype.size;null!=e&&(l=mxUtils.getValue(e.style,"size",l)*e.view.scale);e=parseFloat(e.style[mxConstants.STYLE_STROKEWIDTH]||1)*e.view.scale/2-1;return n.x<t.getCenterX()&&(e+=1,e*=-1),new mxPoint(t.getCenterX()+e,Math.min(t.y+t.height,Math.max(t.y+l,n.y)))},mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter),mxPerimeter.OrthogonalPerimeter=function(t,e,n,i){return i=!0,mxPerimeter.RectanglePerimeter.apply(this,arguments)},mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter),mxPerimeter.BackbonePerimeter=function(t,e,n,i){var l=parseFloat(e.style[mxConstants.STYLE_STROKEWIDTH]||1)*e.view.scale/2-1;return null!=e.style.backboneSize&&(l+=parseFloat(e.style.backboneSize)*e.view.scale/2-1),"south"==e.style[mxConstants.STYLE_DIRECTION]||"north"==e.style[mxConstants.STYLE_DIRECTION]?(n.x<t.getCenterX()&&(l+=1,l*=-1),new mxPoint(t.getCenterX()+l,Math.min(t.y+t.height,Math.max(t.y,n.y)))):(n.y<t.getCenterY()&&(l+=1,l*=-1),new mxPoint(Math.min(t.x+t.width,Math.max(t.x,n.x)),t.getCenterY()+l))},mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter),mxPerimeter.CalloutPerimeter=function(t,e,n,i){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(t,new mxRectangle(0,0,0,Math.max(0,Math.min(t.height,parseFloat(mxUtils.getValue(e.style,"size",O.prototype.size))*e.view.scale))),e.style),e,n,i)},mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter),mxPerimeter.ParallelogramPerimeter=function(t,e,n,i){var l="0"!=mxUtils.getValue(e.style,"fixedSize","0"),s=l?v.prototype.fixedSize:v.prototype.size;null!=e&&(s=mxUtils.getValue(e.style,"size",s)),l&&(s*=e.view.scale);var o=t.x,r=t.y,a=t.width,h=t.height,e=null!=e?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r=e==mxConstants.DIRECTION_NORTH||e==mxConstants.DIRECTION_SOUTH?(e=l?Math.max(0,Math.min(h,s)):h*Math.max(0,Math.min(1,s)),[new mxPoint(o,r),new mxPoint(o+a,r+e),new mxPoint(o+a,r+h),new mxPoint(o,r+h-e),new mxPoint(o,r)]):[new mxPoint(o+(s=l?Math.max(0,Math.min(.5*a,s)):a*Math.max(0,Math.min(1,s))),r),new mxPoint(o+a,r),new mxPoint(o+a-s,r+h),new mxPoint(o,r+h),new mxPoint(o+s,r)];t=new mxPoint(t.getCenterX(),t.getCenterY());return i&&(n.x<o||n.x>o+a?t.y=n.y:t.x=n.x),mxUtils.getPerimeterPoint(r,t,n)},mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter),mxPerimeter.TrapezoidPerimeter=function(t,e,n,i){var l="0"!=mxUtils.getValue(e.style,"fixedSize","0"),s=l?E.prototype.fixedSize:E.prototype.size;null!=e&&(s=mxUtils.getValue(e.style,"size",s)),l&&(s*=e.view.scale);var o,r,a=t.x,h=t.y,d=t.width,u=t.height,p=null!=e?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST,e=[];e=p==mxConstants.DIRECTION_EAST?[new mxPoint(a+(o=l?Math.max(0,Math.min(.5*d,s)):d*Math.max(0,Math.min(1,s))),h),new mxPoint(a+d-o,h),new mxPoint(a+d,h+u),new mxPoint(a,h+u),new mxPoint(a+o,h)]:p==mxConstants.DIRECTION_WEST?(o=l?Math.max(0,Math.min(d,s)):d*Math.max(0,Math.min(1,s)),[new mxPoint(a,h),new mxPoint(a+d,h),new mxPoint(a+d-o,h+u),new mxPoint(a+o,h+u),new mxPoint(a,h)]):p==mxConstants.DIRECTION_NORTH?[new mxPoint(a,h+(r=l?Math.max(0,Math.min(u,s)):u*Math.max(0,Math.min(1,s)))),new mxPoint(a+d,h),new mxPoint(a+d,h+u),new mxPoint(a,h+u-r),new mxPoint(a,h+r)]:(r=l?Math.max(0,Math.min(u,s)):u*Math.max(0,Math.min(1,s)),[new mxPoint(a,h),new mxPoint(a+d,h+r),new mxPoint(a+d,h+u-r),new mxPoint(a,h+u),new mxPoint(a,h)]);t=new mxPoint(t.getCenterX(),t.getCenterY());return i&&(n.x<a||n.x>a+d?t.y=n.y:t.x=n.x),mxUtils.getPerimeterPoint(e,t,n)},mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter),mxPerimeter.StepPerimeter=function(t,e,n,i){var l="0"!=mxUtils.getValue(e.style,"fixedSize","0"),s=l?U.prototype.fixedSize:U.prototype.size;null!=e&&(s=mxUtils.getValue(e.style,"size",s)),l&&(s*=e.view.scale);var o,r,a=t.x,h=t.y,d=t.width,u=t.height,p=t.getCenterX(),t=t.getCenterY(),e=null!=e?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;h=e==mxConstants.DIRECTION_EAST?(o=l?Math.max(0,Math.min(d,s)):d*Math.max(0,Math.min(1,s)),[new mxPoint(a,h),new mxPoint(a+d-o,h),new mxPoint(a+d,t),new mxPoint(a+d-o,h+u),new mxPoint(a,h+u),new mxPoint(a+o,t),new mxPoint(a,h)]):e==mxConstants.DIRECTION_WEST?[new mxPoint(a+(o=l?Math.max(0,Math.min(d,s)):d*Math.max(0,Math.min(1,s))),h),new mxPoint(a+d,h),new mxPoint(a+d-o,t),new mxPoint(a+d,h+u),new mxPoint(a+o,h+u),new mxPoint(a,t),new mxPoint(a+o,h)]:e==mxConstants.DIRECTION_NORTH?[new mxPoint(a,h+(r=l?Math.max(0,Math.min(u,s)):u*Math.max(0,Math.min(1,s)))),new mxPoint(p,h),new mxPoint(a+d,h+r),new mxPoint(a+d,h+u),new mxPoint(p,h+u-r),new mxPoint(a,h+u),new mxPoint(a,h+r)]:(r=l?Math.max(0,Math.min(u,s)):u*Math.max(0,Math.min(1,s)),[new mxPoint(a,h),new mxPoint(p,h+r),new mxPoint(a+d,h),new mxPoint(a+d,h+u-r),new mxPoint(p,h+u),new mxPoint(a,h+u-r),new mxPoint(a,h)]);t=new mxPoint(p,t);return i&&(n.x<a||n.x>a+d?t.y=n.y:t.x=n.x),mxUtils.getPerimeterPoint(h,t,n)},mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter),mxPerimeter.HexagonPerimeter2=function(t,e,n,i){var l="0"!=mxUtils.getValue(e.style,"fixedSize","0"),s=l?N.prototype.fixedSize:N.prototype.size;null!=e&&(s=mxUtils.getValue(e.style,"size",s)),l&&(s*=e.view.scale);var o=t.x,r=t.y,a=t.width,h=t.height,d=t.getCenterX(),t=t.getCenterY(),e=null!=e?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r=e==mxConstants.DIRECTION_NORTH||e==mxConstants.DIRECTION_SOUTH?(e=l?Math.max(0,Math.min(h,s)):h*Math.max(0,Math.min(1,s)),[new mxPoint(d,r),new mxPoint(o+a,r+e),new mxPoint(o+a,r+h-e),new mxPoint(d,r+h),new mxPoint(o,r+h-e),new mxPoint(o,r+e),new mxPoint(d,r)]):[new mxPoint(o+(s=l?Math.max(0,Math.min(a,s)):a*Math.max(0,Math.min(1,s))),r),new mxPoint(o+a-s,r),new mxPoint(o+a,t),new mxPoint(o+a-s,r+h),new mxPoint(o+s,r+h),new mxPoint(o,t),new mxPoint(o+s,r)];t=new mxPoint(d,t);return i&&(n.x<o||n.x>o+a?t.y=n.y:t.x=n.x),mxUtils.getPerimeterPoint(r,t,n)},mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2),mxUtils.extend(Q,mxShape),Q.prototype.size=10,Q.prototype.paintBackground=function(t,e,n,i,l){var s=parseFloat(mxUtils.getValue(this.style,"size",this.size));t.translate(e,n),t.ellipse((i-s)/2,0,s,s),t.fillAndStroke(),t.begin(),t.moveTo(i/2,s),t.lineTo(i/2,l),t.end(),t.stroke()},mxCellRenderer.registerShape("lollipop",Q),mxUtils.extend(J,mxShape),J.prototype.size=10,J.prototype.inset=2,J.prototype.paintBackground=function(t,e,n,i,l){var s=parseFloat(mxUtils.getValue(this.style,"size",this.size)),o=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;t.translate(e,n),t.begin(),t.moveTo(i/2,s+o),t.lineTo(i/2,l),t.end(),t.stroke(),t.begin(),t.moveTo((i-s)/2-o,s/2),t.quadTo((i-s)/2-o,s+o,i/2,s+o),t.quadTo((i+s)/2+o,s+o,(i+s)/2+o,s/2),t.end(),t.stroke()},mxCellRenderer.registerShape("requires",J),mxUtils.extend(q,mxShape),q.prototype.paintBackground=function(t,e,n,i,l){t.translate(e,n),t.begin(),t.moveTo(0,0),t.quadTo(i,0,i,l/2),t.quadTo(i,l,0,l),t.end(),t.stroke()},mxCellRenderer.registerShape("requiredInterface",q),mxUtils.extend($,mxShape),$.prototype.inset=2,$.prototype.paintBackground=function(t,e,n,i,l){var s=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;t.translate(e,n),t.ellipse(0,s,i-2*s,l-2*s),t.fillAndStroke(),t.begin(),t.moveTo(i/2,0),t.quadTo(i,0,i,l/2),t.quadTo(i,l,i/2,l),t.end(),t.stroke()},mxCellRenderer.registerShape("providedRequiredInterface",$),mxUtils.extend(tt,mxCylinder),tt.prototype.jettyWidth=20,tt.prototype.jettyHeight=10,tt.prototype.redrawPath=function(t,e,n,i,l,s){var o=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth)),r=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight)),a=o/2,h=a+o/2,d=Math.min(r,l-r),o=Math.min(d+2*r,l-r);s?(t.moveTo(a,d),t.lineTo(h,d),t.lineTo(h,d+r),t.lineTo(a,d+r),t.moveTo(a,o),t.lineTo(h,o),t.lineTo(h,o+r),t.lineTo(a,o+r)):(t.moveTo(a,0),t.lineTo(i,0),t.lineTo(i,l),t.lineTo(a,l),t.lineTo(a,o+r),t.lineTo(0,o+r),t.lineTo(0,o),t.lineTo(a,o),t.lineTo(a,d+r),t.lineTo(0,d+r),t.lineTo(0,d),t.lineTo(a,d),t.close()),t.end()},mxCellRenderer.registerShape("module",tt),mxUtils.extend(et,mxCylinder),et.prototype.jettyWidth=32,et.prototype.jettyHeight=12,et.prototype.redrawPath=function(t,e,n,i,l,s){var o=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth)),r=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight)),a=o/2,h=a+o/2,d=.3*l-r/2,o=.7*l-r/2;s?(t.moveTo(a,d),t.lineTo(h,d),t.lineTo(h,d+r),t.lineTo(a,d+r),t.moveTo(a,o),t.lineTo(h,o),t.lineTo(h,o+r),t.lineTo(a,o+r)):(t.moveTo(a,0),t.lineTo(i,0),t.lineTo(i,l),t.lineTo(a,l),t.lineTo(a,o+r),t.lineTo(0,o+r),t.lineTo(0,o),t.lineTo(a,o),t.lineTo(a,d+r),t.lineTo(0,d+r),t.lineTo(0,d),t.lineTo(a,d),t.close()),t.end()},mxCellRenderer.registerShape("component",et),mxUtils.extend(nt,mxRectangleShape),nt.prototype.paintForeground=function(t,e,n,i,l){var s=i/2,o=l/2,r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,[new mxPoint(e+s,n),new mxPoint(e+i,n+o),new mxPoint(e+s,n+l),new mxPoint(e,n+o)],this.isRounded,r,!0),t.stroke(),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxCellRenderer.registerShape("associativeEntity",nt),mxUtils.extend(it,mxDoubleEllipse),it.prototype.outerStroke=!0,it.prototype.paintVertexShape=function(t,e,n,i,l){var s=Math.min(4,Math.min(i/5,l/5));0<i&&0<l&&(t.ellipse(e+s,n+s,i-2*s,l-2*s),t.fillAndStroke()),t.setShadow(!1),this.outerStroke&&(t.ellipse(e,n,i,l),t.stroke())},mxCellRenderer.registerShape("endState",it),mxUtils.extend(lt,it),lt.prototype.outerStroke=!1,mxCellRenderer.registerShape("startState",lt),mxUtils.extend(st,mxArrowConnector),st.prototype.defaultWidth=4,st.prototype.isOpenEnded=function(){return!0},st.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)},st.prototype.isArrowRounded=function(){return this.isRounded},mxCellRenderer.registerShape("link",st),mxUtils.extend(ot,mxArrowConnector),ot.prototype.defaultWidth=10,ot.prototype.defaultArrowWidth=20,ot.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)},ot.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)},ot.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)},mxCellRenderer.registerShape("flexArrow",ot),mxUtils.extend(rt,mxActor),rt.prototype.size=30,rt.prototype.isRoundable=function(){return!0},rt.prototype.redrawPath=function(t,e,n,i,l){var s=Math.min(l,parseFloat(mxUtils.getValue(this.style,"size",this.size))),o=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,l),new mxPoint(0,s),new mxPoint(i,0),new mxPoint(i,l)],this.isRounded,o,!0),t.end()},mxCellRenderer.registerShape("manualInput",rt),mxUtils.extend(at,mxRectangleShape),at.prototype.dx=20,at.prototype.dy=20,at.prototype.isHtmlAllowed=function(){return!1},at.prototype.paintForeground=function(t,e,n,i,l){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var s=0;this.isRounded&&(o=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,s=Math.max(s,Math.min(i*o,l*o)));var o=Math.max(s,Math.min(i,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),s=Math.max(s,Math.min(l,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));t.begin(),t.moveTo(e,n+s),t.lineTo(e+i,n+s),t.end(),t.stroke(),t.begin(),t.moveTo(e+o,n),t.lineTo(e+o,n+l),t.end(),t.stroke()},mxCellRenderer.registerShape("internalStorage",at),mxUtils.extend(ht,mxActor),ht.prototype.dx=20,ht.prototype.dy=20,ht.prototype.redrawPath=function(t,e,n,i,l){var s=Math.max(0,Math.min(i,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),o=Math.max(0,Math.min(l,parseFloat(mxUtils.getValue(this.style,"dy",this.dy)))),r=(Math.min(i/2,Math.min(l,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2);this.addPoints(t,[new mxPoint(0,0),new mxPoint(i,0),new mxPoint(i,o),new mxPoint(s,o),new mxPoint(s,l),new mxPoint(0,l)],this.isRounded,r,!0),t.end()},mxCellRenderer.registerShape("corner",ht),mxUtils.extend(dt,mxActor),dt.prototype.redrawPath=function(t,e,n,i,l){t.moveTo(0,0),t.lineTo(0,l),t.end(),t.moveTo(i,0),t.lineTo(i,l),t.end(),t.moveTo(0,l/2),t.lineTo(i,l/2),t.end()},mxCellRenderer.registerShape("crossbar",dt),mxUtils.extend(ut,mxActor),ut.prototype.dx=20,ut.prototype.dy=20,ut.prototype.redrawPath=function(t,e,n,i,l){var s=Math.max(0,Math.min(i,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),o=Math.max(0,Math.min(l,parseFloat(mxUtils.getValue(this.style,"dy",this.dy)))),r=(Math.abs(i-s),Math.min(i/2,Math.min(l,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2);this.addPoints(t,[new mxPoint(0,0),new mxPoint(i,0),new mxPoint(i,o),new mxPoint((i+s)/2,o),new mxPoint((i+s)/2,l),new mxPoint((i-s)/2,l),new mxPoint((i-s)/2,o),new mxPoint(0,o)],this.isRounded,r,!0),t.end()},mxCellRenderer.registerShape("tee",ut),mxUtils.extend(pt,mxActor),pt.prototype.arrowWidth=.3,pt.prototype.arrowSize=.2,pt.prototype.redrawPath=function(t,e,n,i,l){var s=l*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),o=i*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize)))),r=(l-s)/2,a=r+s,s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,r),new mxPoint(i-o,r),new mxPoint(i-o,0),new mxPoint(i,l/2),new mxPoint(i-o,l),new mxPoint(i-o,a),new mxPoint(0,a)],this.isRounded,s,!0),t.end()},mxCellRenderer.registerShape("singleArrow",pt),mxUtils.extend(mt,mxActor),mt.prototype.redrawPath=function(t,e,n,i,l){var s=l*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",pt.prototype.arrowWidth)))),o=i*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",pt.prototype.arrowSize)))),r=(l-s)/2,a=r+s,s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,l/2),new mxPoint(o,0),new mxPoint(o,r),new mxPoint(i-o,r),new mxPoint(i-o,0),new mxPoint(i,l/2),new mxPoint(i-o,l),new mxPoint(i-o,a),new mxPoint(o,a),new mxPoint(o,l)],this.isRounded,s,!0),t.end()},mxCellRenderer.registerShape("doubleArrow",mt),mxUtils.extend(ct,mxActor),ct.prototype.size=.1,ct.prototype.fixedSize=20,ct.prototype.redrawPath=function(t,e,n,i,l){var s="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(i,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):i*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));t.moveTo(s,0),t.lineTo(i,0),t.quadTo(i-2*s,l/2,i,l),t.lineTo(s,l),t.quadTo(s-2*s,l/2,s,0),t.close(),t.end()},mxCellRenderer.registerShape("dataStorage",ct),mxUtils.extend(gt,mxActor),gt.prototype.redrawPath=function(t,e,n,i,l){t.moveTo(0,0),t.quadTo(i,0,i,l/2),t.quadTo(i,l,0,l),t.close(),t.end()},mxCellRenderer.registerShape("or",gt),mxUtils.extend(xt,mxActor),xt.prototype.redrawPath=function(t,e,n,i,l){t.moveTo(0,0),t.quadTo(i,0,i,l/2),t.quadTo(i,l,0,l),t.quadTo(i/2,l/2,0,0),t.close(),t.end()},mxCellRenderer.registerShape("xor",xt),mxUtils.extend(yt,mxActor),yt.prototype.size=20,yt.prototype.isRoundable=function(){return!0},yt.prototype.redrawPath=function(t,e,n,i,l){var s=Math.min(i/2,Math.min(l,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),o=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(s,0),new mxPoint(i-s,0),new mxPoint(i,.8*s),new mxPoint(i,l),new mxPoint(0,l),new mxPoint(0,.8*s)],this.isRounded,o,!0),t.end()},mxCellRenderer.registerShape("loopLimit",yt),mxUtils.extend(ft,mxActor),ft.prototype.size=3/8,ft.prototype.isRoundable=function(){return!0},ft.prototype.redrawPath=function(t,e,n,i,l){var s=l*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),o=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,0),new mxPoint(i,0),new mxPoint(i,l-s),new mxPoint(i/2,l),new mxPoint(0,l-s)],this.isRounded,o,!0),t.end()},mxCellRenderer.registerShape("offPageConnector",ft),mxUtils.extend(Ct,mxEllipse),Ct.prototype.paintVertexShape=function(t,e,n,i,l){mxEllipse.prototype.paintVertexShape.apply(this,arguments),t.begin(),t.moveTo(e+i/2,n+l),t.lineTo(e+i,n+l),t.end(),t.stroke()},mxCellRenderer.registerShape("tapeData",Ct),mxUtils.extend(vt,mxEllipse),vt.prototype.paintVertexShape=function(t,e,n,i,l){mxEllipse.prototype.paintVertexShape.apply(this,arguments),t.setShadow(!1),t.begin(),t.moveTo(e,n+l/2),t.lineTo(e+i,n+l/2),t.end(),t.stroke(),t.begin(),t.moveTo(e+i/2,n),t.lineTo(e+i/2,n+l),t.end(),t.stroke()},mxCellRenderer.registerShape("orEllipse",vt),mxUtils.extend(Et,mxEllipse),Et.prototype.paintVertexShape=function(t,e,n,i,l){mxEllipse.prototype.paintVertexShape.apply(this,arguments);t.setShadow(!1),t.begin(),t.moveTo(e+.145*i,n+.145*l),t.lineTo(e+.855*i,n+.855*l),t.end(),t.stroke(),t.begin(),t.moveTo(e+.855*i,n+.145*l),t.lineTo(e+.145*i,n+.855*l),t.end(),t.stroke()},mxCellRenderer.registerShape("sumEllipse",Et),mxUtils.extend(St,mxRhombus),St.prototype.paintVertexShape=function(t,e,n,i,l){mxRhombus.prototype.paintVertexShape.apply(this,arguments),t.setShadow(!1),t.begin(),t.moveTo(e,n+l/2),t.lineTo(e+i,n+l/2),t.end(),t.stroke()},mxCellRenderer.registerShape("sortShape",St),mxUtils.extend(wt,mxEllipse),wt.prototype.paintVertexShape=function(t,e,n,i,l){t.begin(),t.moveTo(e,n),t.lineTo(e+i,n),t.lineTo(e+i/2,n+l/2),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(e,n+l),t.lineTo(e+i,n+l),t.lineTo(e+i/2,n+l/2),t.close(),t.fillAndStroke()},mxCellRenderer.registerShape("collate",wt),mxUtils.extend(bt,mxEllipse),bt.prototype.paintVertexShape=function(t,e,n,i,l){var s=n+l-5;t.begin(),t.moveTo(e,n),t.lineTo(e,n+l),t.moveTo(e,s),t.lineTo(e+10,s-5),t.moveTo(e,s),t.lineTo(e+10,5+s),t.moveTo(e,s),t.lineTo(e+i,s),t.moveTo(e+i,n),t.lineTo(e+i,n+l),t.moveTo(e+i,s),t.lineTo(e+i-10,s-5),t.moveTo(e+i,s),t.lineTo(e+i-10,5+s),t.end(),t.stroke()},mxCellRenderer.registerShape("dimension",bt),mxUtils.extend(Tt,mxEllipse),Tt.prototype.paintVertexShape=function(t,e,n,i,l){var s;this.outline||t.setStrokeColor(null),null!=this.style&&(s=t.pointerEvents,"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||null!=this.fill&&this.fill!=mxConstants.NONE||(t.pointerEvents=!1),t.rect(e,n,i,l),t.fill(),t.pointerEvents=s,t.setStrokeColor(this.stroke),t.begin(),t.moveTo(e,n),this.outline||"1"==mxUtils.getValue(this.style,"top","1")?t.lineTo(e+i,n):t.moveTo(e+i,n),this.outline||"1"==mxUtils.getValue(this.style,"right","1")?t.lineTo(e+i,n+l):t.moveTo(e+i,n+l),this.outline||"1"==mxUtils.getValue(this.style,"bottom","1")?t.lineTo(e,n+l):t.moveTo(e,n+l),!this.outline&&"1"!=mxUtils.getValue(this.style,"left","1")||t.lineTo(e,n),t.end(),t.stroke())},mxCellRenderer.registerShape("partialRectangle",Tt),mxUtils.extend(At,mxEllipse),At.prototype.paintVertexShape=function(t,e,n,i,l){mxEllipse.prototype.paintVertexShape.apply(this,arguments),t.setShadow(!1),t.begin(),"vertical"==mxUtils.getValue(this.style,"line")?(t.moveTo(e+i/2,n),t.lineTo(e+i/2,n+l)):(t.moveTo(e,n+l/2),t.lineTo(e+i,n+l/2)),t.end(),t.stroke()},mxCellRenderer.registerShape("lineEllipse",At),mxUtils.extend(Lt,mxActor),Lt.prototype.redrawPath=function(t,e,n,i,l){var s=Math.min(i,l/2);t.moveTo(0,0),t.lineTo(i-s,0),t.quadTo(i,0,i,l/2),t.quadTo(i,l,i-s,l),t.lineTo(0,l),t.close(),t.end()},mxCellRenderer.registerShape("delay",Lt),mxUtils.extend(It,mxActor),It.prototype.size=.2,It.prototype.redrawPath=function(t,e,n,i,l){var s=Math.min(l,i),o=Math.max(0,Math.min(s,s*parseFloat(mxUtils.getValue(this.style,"size",this.size)))),r=(l-o)/2,a=r+o,s=(i-o)/2,o=s+o;t.moveTo(0,r),t.lineTo(s,r),t.lineTo(s,0),t.lineTo(o,0),t.lineTo(o,r),t.lineTo(i,r),t.lineTo(i,a),t.lineTo(o,a),t.lineTo(o,l),t.lineTo(s,l),t.lineTo(s,a),t.lineTo(0,a),t.close(),t.end()},mxCellRenderer.registerShape("cross",It),mxUtils.extend(Mt,mxActor),Mt.prototype.size=.25,Mt.prototype.redrawPath=function(t,e,n,i,l){var s=Math.min(i,l/2),o=Math.min(i-s,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*i);t.moveTo(0,l/2),t.lineTo(o,0),t.lineTo(i-s,0),t.quadTo(i,0,i,l/2),t.quadTo(i,l,i-s,l),t.lineTo(o,l),t.close(),t.end()},mxCellRenderer.registerShape("display",Mt),mxUtils.extend(Rt,mxConnector),Rt.prototype.origPaintEdgeShape=Rt.prototype.paintEdgeShape,Rt.prototype.paintEdgeShape=function(t,e,n){for(var i=[],l=0;l<e.length;l++)i.push(mxUtils.clone(e[l]));var s,o=t.state.dashed,r=t.state.fixDash;Rt.prototype.origPaintEdgeShape.apply(this,[t,i,n]),3<=t.state.strokeWidth&&(null!=(s=mxUtils.getValue(this.style,"fillColor",null))&&(t.setStrokeColor(s),t.setStrokeWidth(t.state.strokeWidth-2),t.setDashed(o,r),Rt.prototype.origPaintEdgeShape.apply(this,[t,e,n])))},mxCellRenderer.registerShape("filledEdge",Rt),void 0!==StyleFormatPanel&&(_=StyleFormatPanel.prototype.getCustomColors,StyleFormatPanel.prototype.getCustomColors=function(){var t=this.format.getSelectionState(),e=_.apply(this,arguments);return"umlFrame"==t.style.shape&&e.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"#ffffff"}),e}),mxMarker.addMarker("dash",function(t,e,n,i,l,s,o,r,a,h){var d=l*(o+a+1),u=s*(o+a+1);return function(){t.begin(),t.moveTo(i.x-d/2-u/2,i.y-u/2+d/2),t.lineTo(i.x+u/2-3*d/2,i.y-3*u/2-d/2),t.stroke()}}),mxMarker.addMarker("box",function(t,e,n,i,l,s,o,r,a,h){var d=l*(o+a+1),u=s*(o+a+1),p=i.x+d/2,m=i.y+u/2;return i.x-=d,i.y-=u,function(){t.begin(),t.moveTo(p-d/2-u/2,m-u/2+d/2),t.lineTo(p-d/2+u/2,m-u/2-d/2),t.lineTo(p+u/2-3*d/2,m-3*u/2-d/2),t.lineTo(p-u/2-3*d/2,m-3*u/2+d/2),t.close(),h?t.fillAndStroke():t.stroke()}}),mxMarker.addMarker("cross",function(t,e,n,i,l,s,o,r,a,h){var d=l*(o+a+1),u=s*(o+a+1);return function(){t.begin(),t.moveTo(i.x-d/2-u/2,i.y-u/2+d/2),t.lineTo(i.x+u/2-3*d/2,i.y-3*u/2-d/2),t.moveTo(i.x-d/2+u/2,i.y-u/2-d/2),t.lineTo(i.x-u/2-3*d/2,i.y-3*u/2+d/2),t.stroke()}}),mxMarker.addMarker("circle",Pt),mxMarker.addMarker("circlePlus",function(t,e,n,i,l,s,o,r,a,h){var d=i.clone(),u=Pt.apply(this,arguments),p=l*(o+2*a),m=s*(o+2*a);return function(){u.apply(this,arguments),t.begin(),t.moveTo(d.x-l*a,d.y-s*a),t.lineTo(d.x-2*p+l*a,d.y-2*m+s*a),t.moveTo(d.x-p-m+s*a,d.y-m+p-l*a),t.lineTo(d.x+m-p-s*a,d.y-m-p+l*a),t.stroke()}}),mxMarker.addMarker("halfCircle",function(t,e,n,i,l,s,o,r,a,h){var d=l*(o+a+1),u=s*(o+a+1),p=i.clone();return i.x-=d,i.y-=u,function(){t.begin(),t.moveTo(p.x-u,p.y+d),t.quadTo(i.x-u,i.y+d,i.x,i.y),t.quadTo(i.x+u,i.y-d,p.x+u,p.y-d),t.stroke()}}),mxMarker.addMarker("async",function(t,e,n,i,l,s,o,r,a,h){var d=l*a*1.118,u=s*a*1.118;l*=o+a,s*=o+a;var p=i.clone();p.x-=d,p.y-=u;return i.x+=-l-d,i.y+=-s-u,function(){t.begin(),t.moveTo(p.x,p.y),r?t.lineTo(p.x-l-s/2,p.y-s+l/2):t.lineTo(p.x+s/2-l,p.y-s-l/2),t.lineTo(p.x-l,p.y-s),t.close(),h?t.fillAndStroke():t.stroke()}}),mxMarker.addMarker("openAsync",(D=null!=(D=2)?D:2,function(t,e,n,i,l,s,o,r,a,h){l*=o+a,s*=o+a;var d=i.clone();return function(){t.begin(),t.moveTo(d.x,d.y),r?t.lineTo(d.x-l-s/D,d.y-s+l/D):t.lineTo(d.x+s/D-l,d.y-s-l/D),t.stroke()}})),void 0!==mxVertexHandler?(G={link:function(t){return[Ft(t,!0,10),Ft(t,!1,10)]},flexArrow:function(r){var a=r.view.graph.gridSize/r.view.scale,t=[];return mxUtils.getValue(r.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(t.push(Vt(r,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(t,e,n,i,l){var s=(r.shape.getEdgeWidth()-r.shape.strokewidth)*r.view.scale,o=3*mxUtils.getNumber(r.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*r.view.scale;return new mxPoint(i.x+e*(o+r.shape.strokewidth*r.view.scale)+n*s/2,i.y+n*(o+r.shape.strokewidth*r.view.scale)-e*s/2)},function(t,e,n,i,l,s,o){l=Math.sqrt(mxUtils.ptSegDistSq(i.x,i.y,l.x,l.y,s.x,s.y)),s=mxUtils.ptLineDist(i.x,i.y,i.x+n,i.y-e,s.x,s.y);r.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(s-r.shape.strokewidth)/3)/100/r.view.scale,r.style.width=Math.round(2*l)/r.view.scale,mxEvent.isControlDown(o.getEvent())&&(r.style[mxConstants.STYLE_ENDSIZE]=r.style[mxConstants.STYLE_STARTSIZE]),mxEvent.isAltDown(o.getEvent())||Math.abs(parseFloat(r.style[mxConstants.STYLE_STARTSIZE])-parseFloat(r.style[mxConstants.STYLE_ENDSIZE]))<a/6&&(r.style[mxConstants.STYLE_STARTSIZE]=r.style[mxConstants.STYLE_ENDSIZE])})),t.push(Vt(r,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(t,e,n,i,l){var s=(r.shape.getStartArrowWidth()-r.shape.strokewidth)*r.view.scale,o=3*mxUtils.getNumber(r.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*r.view.scale;return new mxPoint(i.x+e*(o+r.shape.strokewidth*r.view.scale)+n*s/2,i.y+n*(o+r.shape.strokewidth*r.view.scale)-e*s/2)},function(t,e,n,i,l,s,o){l=Math.sqrt(mxUtils.ptSegDistSq(i.x,i.y,l.x,l.y,s.x,s.y)),s=mxUtils.ptLineDist(i.x,i.y,i.x+n,i.y-e,s.x,s.y);r.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(s-r.shape.strokewidth)/3)/100/r.view.scale,r.style.startWidth=Math.max(0,Math.round(2*l)-r.shape.getEdgeWidth())/r.view.scale,mxEvent.isControlDown(o.getEvent())&&(r.style[mxConstants.STYLE_ENDSIZE]=r.style[mxConstants.STYLE_STARTSIZE],r.style.endWidth=r.style.startWidth),mxEvent.isAltDown(o.getEvent())||(Math.abs(parseFloat(r.style[mxConstants.STYLE_STARTSIZE])-parseFloat(r.style[mxConstants.STYLE_ENDSIZE]))<a/6&&(r.style[mxConstants.STYLE_STARTSIZE]=r.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(r.style.startWidth)-parseFloat(r.style.endWidth))<a&&(r.style.startWidth=r.style.endWidth))}))),mxUtils.getValue(r.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(t.push(Vt(r,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(t,e,n,i,l){var s=(r.shape.getEdgeWidth()-r.shape.strokewidth)*r.view.scale,o=3*mxUtils.getNumber(r.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*r.view.scale;return new mxPoint(i.x+e*(o+r.shape.strokewidth*r.view.scale)-n*s/2,i.y+n*(o+r.shape.strokewidth*r.view.scale)+e*s/2)},function(t,e,n,i,l,s,o){l=Math.sqrt(mxUtils.ptSegDistSq(i.x,i.y,l.x,l.y,s.x,s.y)),s=mxUtils.ptLineDist(i.x,i.y,i.x+n,i.y-e,s.x,s.y);r.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(s-r.shape.strokewidth)/3)/100/r.view.scale,r.style.width=Math.round(2*l)/r.view.scale,mxEvent.isControlDown(o.getEvent())&&(r.style[mxConstants.STYLE_STARTSIZE]=r.style[mxConstants.STYLE_ENDSIZE]),mxEvent.isAltDown(o.getEvent())||Math.abs(parseFloat(r.style[mxConstants.STYLE_ENDSIZE])-parseFloat(r.style[mxConstants.STYLE_STARTSIZE]))<a/6&&(r.style[mxConstants.STYLE_ENDSIZE]=r.style[mxConstants.STYLE_STARTSIZE])})),t.push(Vt(r,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(t,e,n,i,l){var s=(r.shape.getEndArrowWidth()-r.shape.strokewidth)*r.view.scale,o=3*mxUtils.getNumber(r.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*r.view.scale;return new mxPoint(i.x+e*(o+r.shape.strokewidth*r.view.scale)-n*s/2,i.y+n*(o+r.shape.strokewidth*r.view.scale)+e*s/2)},function(t,e,n,i,l,s,o){l=Math.sqrt(mxUtils.ptSegDistSq(i.x,i.y,l.x,l.y,s.x,s.y)),s=mxUtils.ptLineDist(i.x,i.y,i.x+n,i.y-e,s.x,s.y);r.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(s-r.shape.strokewidth)/3)/100/r.view.scale,r.style.endWidth=Math.max(0,Math.round(2*l)-r.shape.getEdgeWidth())/r.view.scale,mxEvent.isControlDown(o.getEvent())&&(r.style[mxConstants.STYLE_STARTSIZE]=r.style[mxConstants.STYLE_ENDSIZE],r.style.startWidth=r.style.endWidth),mxEvent.isAltDown(o.getEvent())||(Math.abs(parseFloat(r.style[mxConstants.STYLE_ENDSIZE])-parseFloat(r.style[mxConstants.STYLE_STARTSIZE]))<a/6&&(r.style[mxConstants.STYLE_ENDSIZE]=r.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(r.style.endWidth)-parseFloat(r.style.startWidth))<a&&(r.style.endWidth=r.style.startWidth))}))),t},swimlane:function(o){var t,e=[];return mxUtils.getValue(o.style,mxConstants.STYLE_ROUNDED)&&(t=parseFloat(mxUtils.getValue(o.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),e.push(Ut(o,t/2))),e.push(Ot(o,[mxConstants.STYLE_STARTSIZE],function(t){var e=parseFloat(mxUtils.getValue(o.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(o.style,mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(t.getCenterX(),t.y+Math.max(0,Math.min(t.height,e))):new mxPoint(t.x+Math.max(0,Math.min(t.width,e)),t.getCenterY())},function(t,e){o.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(t.height,e.y-t.y))):Math.round(Math.max(0,Math.min(t.width,e.x-t.x)))},!1,null,function(t){if(mxEvent.isControlDown(t.getEvent())){var e=o.view.graph;if(e.isTableRow(o.cell)||e.isTableCell(o.cell)){for(var n=e.getSwimlaneDirection(o.style),t=e.model.getParent(o.cell),i=e.model.getChildCells(t,!0),l=[],s=0;s<i.length;s++)i[s]!=o.cell&&e.isSwimlane(i[s])&&e.getSwimlaneDirection(e.getCurrentCellStyle(i[s]))==n&&l.push(i[s]);e.setCellStyles(mxConstants.STYLE_STARTSIZE,o.style[mxConstants.STYLE_STARTSIZE],l)}}})),e},label:Nt(),ext:Nt(),rectangle:Nt(),triangle:Nt(),rhombus:Nt(),umlLifeline:function(t){return[Ot(t,["size"],function(t){var e=Math.max(0,Math.min(t.height,parseFloat(mxUtils.getValue(this.state.style,"size",Z.prototype.size))));return new mxPoint(t.getCenterX(),t.y+e)},function(t,e){this.state.style.size=Math.round(Math.max(0,Math.min(t.height,e.y-t.y)))},!1)]},umlFrame:function(t){return[Ot(t,["width","height"],function(t){var e=Math.max(K.prototype.corner,Math.min(t.width,mxUtils.getValue(this.state.style,"width",K.prototype.width))),n=Math.max(1.5*K.prototype.corner,Math.min(t.height,mxUtils.getValue(this.state.style,"height",K.prototype.height)));return new mxPoint(t.x+e,t.y+n)},function(t,e){this.state.style.width=Math.round(Math.max(K.prototype.corner,Math.min(t.width,e.x-t.x))),this.state.style.height=Math.round(Math.max(1.5*K.prototype.corner,Math.min(t.height,e.y-t.y)))},!1)]},process:function(t){var e=[Ot(t,["size"],function(t){var e="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),n=parseFloat(mxUtils.getValue(this.state.style,"size",R.prototype.size));return new mxPoint(e?t.x+n:t.x+t.width*n,t.y+t.height/4)},function(t,e){t="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(.5*t.width,e.x-t.x)):Math.max(0,Math.min(.5,(e.x-t.x)/t.width));this.state.style.size=t},!1)];return mxUtils.getValue(t.style,mxConstants.STYLE_ROUNDED,!1)&&e.push(Ut(t)),e},cross:function(t){return[Ot(t,["size"],function(t){var e=Math.min(t.width,t.height),e=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",It.prototype.size)))*e/2;return new mxPoint(t.getCenterX()-e,t.getCenterY()-e)},function(t,e){var n=Math.min(t.width,t.height);this.state.style.size=Math.max(0,Math.min(1,Math.min(Math.max(0,t.getCenterY()-e.y)/n*2,Math.max(0,t.getCenterX()-e.x)/n*2)))})]},note:function(t){return[Ot(t,["size"],function(t){var e=Math.max(0,Math.min(t.width,Math.min(t.height,parseFloat(mxUtils.getValue(this.state.style,"size",o.prototype.size)))));return new mxPoint(t.x+t.width-e,t.y+e)},function(t,e){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(t.width,t.x+t.width-e.x),Math.min(t.height,e.y-t.y))))})]},note2:function(t){return[Ot(t,["size"],function(t){var e=Math.max(0,Math.min(t.width,Math.min(t.height,parseFloat(mxUtils.getValue(this.state.style,"size",h.prototype.size)))));return new mxPoint(t.x+t.width-e,t.y+e)},function(t,e){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(t.width,t.x+t.width-e.x),Math.min(t.height,e.y-t.y))))})]},manualInput:function(t){var e=[Ot(t,["size"],function(t){var e=Math.max(0,Math.min(t.height,mxUtils.getValue(this.state.style,"size",rt.prototype.size)));return new mxPoint(t.x+t.width/4,t.y+3*e/4)},function(t,e){this.state.style.size=Math.round(Math.max(0,Math.min(t.height,4*(e.y-t.y)/3)))},!1)];return mxUtils.getValue(t.style,mxConstants.STYLE_ROUNDED,!1)&&e.push(Ut(t)),e},dataStorage:function(t){return[Ot(t,["size"],function(t){var e="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),n=parseFloat(mxUtils.getValue(this.state.style,"size",e?ct.prototype.fixedSize:ct.prototype.size));return new mxPoint(t.x+t.width-n*(e?1:t.width),t.getCenterY())},function(t,e){t="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(t.width,t.x+t.width-e.x)):Math.max(0,Math.min(1,(t.x+t.width-e.x)/t.width));this.state.style.size=t},!1)]},callout:function(t){var e=[Ot(t,["size","position"],function(t){var e=Math.max(0,Math.min(t.height,mxUtils.getValue(this.state.style,"size",O.prototype.size))),n=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",O.prototype.position)));Math.max(0,Math.min(t.width,mxUtils.getValue(this.state.style,"base",O.prototype.base)));return new mxPoint(t.x+n*t.width,t.y+t.height-e)},function(t,e){Math.max(0,Math.min(t.width,mxUtils.getValue(this.state.style,"base",O.prototype.base)));this.state.style.size=Math.round(Math.max(0,Math.min(t.height,t.y+t.height-e.y))),this.state.style.position=Math.round(100*Math.max(0,Math.min(1,(e.x-t.x)/t.width)))/100},!1),Ot(t,["position2"],function(t){var e=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position2",O.prototype.position2)));return new mxPoint(t.x+e*t.width,t.y+t.height)},function(t,e){this.state.style.position2=Math.round(100*Math.max(0,Math.min(1,(e.x-t.x)/t.width)))/100},!1),Ot(t,["base"],function(t){var e=Math.max(0,Math.min(t.height,mxUtils.getValue(this.state.style,"size",O.prototype.size))),n=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",O.prototype.position))),i=Math.max(0,Math.min(t.width,mxUtils.getValue(this.state.style,"base",O.prototype.base)));return new mxPoint(t.x+Math.min(t.width,n*t.width+i),t.y+t.height-e)},function(t,e){var n=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",O.prototype.position)));this.state.style.base=Math.round(Math.max(0,Math.min(t.width,e.x-t.x-n*t.width)))},!1)];return mxUtils.getValue(t.style,mxConstants.STYLE_ROUNDED,!1)&&e.push(Ut(t)),e},internalStorage:function(t){var e=[Ot(t,["dx","dy"],function(t){var e=Math.max(0,Math.min(t.width,mxUtils.getValue(this.state.style,"dx",at.prototype.dx))),n=Math.max(0,Math.min(t.height,mxUtils.getValue(this.state.style,"dy",at.prototype.dy)));return new mxPoint(t.x+e,t.y+n)},function(t,e){this.state.style.dx=Math.round(Math.max(0,Math.min(t.width,e.x-t.x))),this.state.style.dy=Math.round(Math.max(0,Math.min(t.height,e.y-t.y)))},!1)];return mxUtils.getValue(t.style,mxConstants.STYLE_ROUNDED,!1)&&e.push(Ut(t)),e},module:function(t){return[Ot(t,["jettyWidth","jettyHeight"],function(t){var e=Math.max(0,Math.min(t.width,mxUtils.getValue(this.state.style,"jettyWidth",tt.prototype.jettyWidth))),n=Math.max(0,Math.min(t.height,mxUtils.getValue(this.state.style,"jettyHeight",tt.prototype.jettyHeight)));return new mxPoint(t.x+e/2,t.y+2*n)},function(t,e){this.state.style.jettyWidth=Math.round(2*Math.max(0,Math.min(t.width,e.x-t.x))),this.state.style.jettyHeight=Math.round(Math.max(0,Math.min(t.height,e.y-t.y))/2)})]},corner:function(t){return[Ot(t,["dx","dy"],function(t){var e=Math.max(0,Math.min(t.width,mxUtils.getValue(this.state.style,"dx",ht.prototype.dx))),n=Math.max(0,Math.min(t.height,mxUtils.getValue(this.state.style,"dy",ht.prototype.dy)));return new mxPoint(t.x+e,t.y+n)},function(t,e){this.state.style.dx=Math.round(Math.max(0,Math.min(t.width,e.x-t.x))),this.state.style.dy=Math.round(Math.max(0,Math.min(t.height,e.y-t.y)))},!1)]},tee:function(t){return[Ot(t,["dx","dy"],function(t){var e=Math.max(0,Math.min(t.width,mxUtils.getValue(this.state.style,"dx",ut.prototype.dx))),n=Math.max(0,Math.min(t.height,mxUtils.getValue(this.state.style,"dy",ut.prototype.dy)));return new mxPoint(t.x+(t.width+e)/2,t.y+n)},function(t,e){this.state.style.dx=Math.round(Math.max(0,2*Math.min(t.width/2,e.x-t.x-t.width/2))),this.state.style.dy=Math.round(Math.max(0,Math.min(t.height,e.y-t.y)))},!1)]},singleArrow:kt(1),doubleArrow:kt(.5),folder:function(t){return[Ot(t,["tabWidth","tabHeight"],function(t){var e=Math.max(0,Math.min(t.width,mxUtils.getValue(this.state.style,"tabWidth",c.prototype.tabWidth))),n=Math.max(0,Math.min(t.height,mxUtils.getValue(this.state.style,"tabHeight",c.prototype.tabHeight)));return mxUtils.getValue(this.state.style,"tabPosition",c.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(e=t.width-e),new mxPoint(t.x+e,t.y+n)},function(t,e){var n=Math.max(0,Math.min(t.width,e.x-t.x));mxUtils.getValue(this.state.style,"tabPosition",c.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(n=t.width-n),this.state.style.tabWidth=Math.round(n),this.state.style.tabHeight=Math.round(Math.max(0,Math.min(t.height,e.y-t.y)))},!1)]},document:function(t){return[Ot(t,["size"],function(t){var e=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",f.prototype.size))));return new mxPoint(t.x+3*t.width/4,t.y+(1-e)*t.height)},function(t,e){this.state.style.size=Math.max(0,Math.min(1,(t.y+t.height-e.y)/t.height))},!1)]},tape:function(t){return[Ot(t,["size"],function(t){var e=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",y.prototype.size))));return new mxPoint(t.getCenterX(),t.y+e*t.height/2)},function(t,e){this.state.style.size=Math.max(0,Math.min(1,(e.y-t.y)/t.height*2))},!1)]},isoCube2:function(t){return[Ot(t,["isoAngle"],function(t){var e=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.state.style,"isoAngle",d.isoAngle))))*Math.PI/200,e=Math.min(t.width*Math.tan(e),.5*t.height);return new mxPoint(t.x,t.y+e)},function(t,e){this.state.style.isoAngle=Math.max(0,50*(e.y-t.y)/t.height)},!0)]},cylinder2:Gt(u.prototype.size),cylinder3:Gt(p.prototype.size),offPageConnector:function(t){return[Ot(t,["size"],function(t){var e=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",ft.prototype.size))));return new mxPoint(t.getCenterX(),t.y+(1-e)*t.height)},function(t,e){this.state.style.size=Math.max(0,Math.min(1,(t.y+t.height-e.y)/t.height))},!1)]},step:_t(U.prototype.size,!0,null,!0,U.prototype.fixedSize),hexagon:_t(N.prototype.size,!0,.5,!0,N.prototype.fixedSize),curlyBracket:_t(S.prototype.size,!1),display:_t(Mt.prototype.size,!1),cube:Dt(1,e.prototype.size,!1),card:Dt(.5,x.prototype.size,!0),loopLimit:Dt(.5,yt.prototype.size,!0),trapezoid:Ht(.5,E.prototype.size,E.prototype.fixedSize),parallelogram:Ht(1,v.prototype.size,v.prototype.fixedSize)},Graph.createHandle=Ot,Graph.handleFactory=G,k=mxVertexHandler.prototype.createCustomHandles,mxVertexHandler.prototype.createCustomHandles=function(){var t,e=k.apply(this,arguments);return this.graph.isCellRotatable(this.state.cell)&&(t=this.state.style.shape,null==mxCellRenderer.defaultShapes[t]&&null==mxStencilRegistry.getStencil(t)?t=mxConstants.SHAPE_RECTANGLE:this.state.view.graph.isSwimlane(this.state.cell)&&(t=mxConstants.SHAPE_SWIMLANE),null==(t=G[t])&&null!=this.state.shape&&this.state.shape.isRoundable()&&(t=G[mxConstants.SHAPE_RECTANGLE]),null==t||null!=(t=t(this.state))&&(e=null==e?t:e.concat(t))),e},mxEdgeHandler.prototype.createCustomHandles=function(){var t=this.state.style.shape;null==mxCellRenderer.defaultShapes[t]&&null==mxStencilRegistry.getStencil(t)&&(t=mxConstants.SHAPE_CONNECTOR);t=G[t];return null!=t?t(this.state):null}):(Graph.createHandle=function(){},Graph.handleFactory={});var Bt=new mxPoint(1,0),zt=new mxPoint(1,0),Yt=mxUtils.toRadians(-30),Wt=Math.cos(Yt),Yt=Math.sin(Yt),Bt=mxUtils.getRotatedPoint(Bt,Wt,Yt),Wt=mxUtils.toRadians(-150),Yt=Math.cos(Wt),Wt=Math.sin(Wt),zt=mxUtils.getRotatedPoint(zt,Yt,Wt);mxEdgeStyle.IsometricConnector=function(t,e,n,i,l){var s=t.view,o=null!=i&&0<i.length?i[0]:null,r=t.absolutePoints,i=r[0],r=r[r.length-1];null!=o&&(o=s.transformControlPoint(t,o)),null==i&&null!=e&&(i=new mxPoint(e.getCenterX(),e.getCenterY())),null==r&&null!=n&&(r=new mxPoint(n.getCenterX(),n.getCenterY()));var a,h=Bt.x,d=Bt.y,u=zt.x,p=zt.y,m="horizontal"==mxUtils.getValue(t.style,"elbow","horizontal");function c(t,e,n){var i=t-a.x,t=e-a.y,e=(p*i-u*t)/(h*p-d*u),t=(d*i-h*t)/(d*u-h*p);a=m?(n&&(a=new mxPoint(a.x+h*e,a.y+d*e),l.push(a)),new mxPoint(a.x+u*t,a.y+p*t)):(n&&(a=new mxPoint(a.x+u*t,a.y+p*t),l.push(a)),new mxPoint(a.x+h*e,a.y+d*e)),l.push(a)}null!=r&&null!=i&&(a=i,null==o&&(o=new mxPoint(i.x+(r.x-i.x)/2,i.y+(r.y-i.y)/2)),c(o.x,o.y,!0),c(r.x,r.y,!1))},mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var jt=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(t,e){if(e!=mxEdgeStyle.IsometricConnector)return jt.apply(this,arguments);var n=new mxElbowEdgeHandler(t);return n.snapToTerminals=!1,n},n.prototype.constraints=[],i.prototype.getConstraints=function(t,e,n){var i=[],l=Math.tan(mxUtils.toRadians(30)),s=(.5-l)/2,l=Math.min(e,n/(.5+l)),e=(e-l)/2,n=(n-l)/2;return i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,n+.25*l)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e+.5*l,n+l*s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e+l,n+.25*l)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e+l,n+.75*l)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e+.5*l,n+(1-s)*l)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,n+.75*l)),i},d.prototype.getConstraints=function(t,e,n){var i=[],l=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200,l=Math.min(e*Math.tan(l),.5*n);return i.push(new mxConnectionConstraint(new mxPoint(.5,0),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,l)),i.push(new mxConnectionConstraint(new mxPoint(1,.5),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,n-l)),i.push(new mxConnectionConstraint(new mxPoint(.5,1),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,n-l)),i.push(new mxConnectionConstraint(new mxPoint(0,.5),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,l)),i},O.prototype.getConstraints=function(t,e,n){var i=[],l=(mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE),Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),s=(Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),e*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))));Math.max(0,Math.min(e,parseFloat(mxUtils.getValue(this.style,"base",this.base))));return i.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),i.push(new mxConnectionConstraint(new mxPoint(.25,0),!1)),i.push(new mxConnectionConstraint(new mxPoint(.5,0),!1)),i.push(new mxConnectionConstraint(new mxPoint(.75,0),!1)),i.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,.5*(n-l))),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,n-l)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,s,n)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,n-l)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(n-l))),2*l<=e&&i.push(new mxConnectionConstraint(new mxPoint(.5,0),!1)),i},mxRectangleShape.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0)],mxEllipse.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5))],Tt.prototype.constraints=mxRectangleShape.prototype.constraints,mxImageShape.prototype.constraints=mxRectangleShape.prototype.constraints,mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints,H.prototype.constraints=mxRectangleShape.prototype.constraints,mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints,o.prototype.getConstraints=function(t,e,n){var i=[],l=Math.max(0,Math.min(e,Math.min(n,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));return i.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(e-l),0)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e-l,0)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e-.5*l,.5*l)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,l)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,.5*(n+l))),i.push(new mxConnectionConstraint(new mxPoint(1,1),!1)),i.push(new mxConnectionConstraint(new mxPoint(.5,1),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,1),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,.5),!1)),2*l<=e&&i.push(new mxConnectionConstraint(new mxPoint(.5,0),!1)),i},x.prototype.getConstraints=function(t,e,n){var i=[],l=Math.max(0,Math.min(e,Math.min(n,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));return i.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(e+l),0)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,l,0)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*l,.5*l)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,l)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(n+l))),i.push(new mxConnectionConstraint(new mxPoint(0,1),!1)),i.push(new mxConnectionConstraint(new mxPoint(.5,1),!1)),i.push(new mxConnectionConstraint(new mxPoint(1,1),!1)),i.push(new mxConnectionConstraint(new mxPoint(1,.5),!1)),2*l<=e&&i.push(new mxConnectionConstraint(new mxPoint(.5,0),!1)),i},e.prototype.getConstraints=function(t,e,n){var i=[],l=Math.max(0,Math.min(e,Math.min(n,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));return i.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(e-l),0)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e-l,0)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e-.5*l,.5*l)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,l)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,.5*(n+l))),i.push(new mxConnectionConstraint(new mxPoint(1,1),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(e+l),n)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,l,n)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*l,n-.5*l)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,n-l)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(n-l))),i},p.prototype.getConstraints=function(t,e,n){var i=[],l=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"size",this.size))));return i.push(new mxConnectionConstraint(new mxPoint(.5,0),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,.5),!1)),i.push(new mxConnectionConstraint(new mxPoint(.5,1),!1)),i.push(new mxConnectionConstraint(new mxPoint(1,.5),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,l)),i.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,l)),i.push(new mxConnectionConstraint(new mxPoint(1,1),!1,null,0,-l)),i.push(new mxConnectionConstraint(new mxPoint(0,1),!1,null,0,-l)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,l+.5*(.5*n-l))),i.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,l+.5*(.5*n-l))),i.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,n-l-.5*(.5*n-l))),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,n-l-.5*(.5*n-l))),i.push(new mxConnectionConstraint(new mxPoint(.145,0),!1,null,0,.29*l)),i.push(new mxConnectionConstraint(new mxPoint(.855,0),!1,null,0,.29*l)),i.push(new mxConnectionConstraint(new mxPoint(.855,1),!1,null,0,.29*-l)),i.push(new mxConnectionConstraint(new mxPoint(.145,1),!1,null,0,.29*-l)),i},c.prototype.getConstraints=function(t,e,n){var i=[],l=Math.max(0,Math.min(e,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))),s=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?(i.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*l,0)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,l,0)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,l,s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(e+l),s))):(i.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e-.5*l,0)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e-l,0)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e-l,s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(e-l),s))),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,.25*(n-s)+s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,.5*(n-s)+s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,.75*(n-s)+s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,n)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.25*(n-s)+s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(n-s)+s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.75*(n-s)+s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,n)),i.push(new mxConnectionConstraint(new mxPoint(.25,1),!1)),i.push(new mxConnectionConstraint(new mxPoint(.5,1),!1)),i.push(new mxConnectionConstraint(new mxPoint(.75,1),!1)),i},at.prototype.constraints=mxRectangleShape.prototype.constraints,ct.prototype.constraints=mxRectangleShape.prototype.constraints,Ct.prototype.constraints=mxEllipse.prototype.constraints,vt.prototype.constraints=mxEllipse.prototype.constraints,Et.prototype.constraints=mxEllipse.prototype.constraints,At.prototype.constraints=mxEllipse.prototype.constraints,rt.prototype.constraints=mxRectangleShape.prototype.constraints,Lt.prototype.constraints=mxRectangleShape.prototype.constraints,Mt.prototype.getConstraints=function(t,e,n){var i=[],l=Math.min(e,n/2),s=Math.min(e-l,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*e);return i.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,s,0)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(s+e-l),0)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e-l,0)),i.push(new mxConnectionConstraint(new mxPoint(1,.5),!1,null)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e-l,n)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(s+e-l),n)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,s,n)),i},tt.prototype.getConstraints=function(t,e,n){var i=parseFloat(mxUtils.getValue(t,"jettyWidth",tt.prototype.jettyWidth))/2,l=parseFloat(mxUtils.getValue(t,"jettyHeight",tt.prototype.jettyHeight)),t=[new mxConnectionConstraint(new mxPoint(0,0),!1,null,i),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!1,null,i),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(n-.5*l,1.5*l)),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(n-.5*l,3.5*l))];return 5*l<n&&t.push(new mxConnectionConstraint(new mxPoint(0,.75),!1,null,i)),8*l<n&&t.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null,i)),15*l<n&&t.push(new mxConnectionConstraint(new mxPoint(0,.25),!1,null,i)),t},yt.prototype.constraints=mxRectangleShape.prototype.constraints,ft.prototype.constraints=mxRectangleShape.prototype.constraints,mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.3),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.7),!0),new mxConnectionConstraint(new mxPoint(.15,.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)],z.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.75,.1),!1),new mxConnectionConstraint(new mxPoint(0,1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,1),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1)],et.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)],mxActor.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.25,.2),!1),new mxConnectionConstraint(new mxPoint(.1,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.75,.25),!1),new mxConnectionConstraint(new mxPoint(.9,.5),!1),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)],m.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(.5,.25),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.5,.75),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)],y.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.35),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.65),!1),new mxConnectionConstraint(new mxPoint(1,.35),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,.65),!1),new mxConnectionConstraint(new mxPoint(.25,1),!1),new mxConnectionConstraint(new mxPoint(.75,0),!1)],U.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)],mxLine.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)],Q.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.5,1),!1)],mxDoubleEllipse.prototype.constraints=mxEllipse.prototype.constraints,mxRhombus.prototype.constraints=mxEllipse.prototype.constraints,mxTriangle.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0)],mxHexagon.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.375,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.625,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.375,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.625,1),!0)],mxCloud.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.25),!1),new mxConnectionConstraint(new mxPoint(.4,.1),!1),new mxConnectionConstraint(new mxPoint(.16,.55),!1),new mxConnectionConstraint(new mxPoint(.07,.4),!1),new mxConnectionConstraint(new mxPoint(.31,.8),!1),new mxConnectionConstraint(new mxPoint(.13,.77),!1),new mxConnectionConstraint(new mxPoint(.8,.8),!1),new mxConnectionConstraint(new mxPoint(.55,.95),!1),new mxConnectionConstraint(new mxPoint(.875,.5),!1),new mxConnectionConstraint(new mxPoint(.96,.7),!1),new mxConnectionConstraint(new mxPoint(.625,.2),!1),new mxConnectionConstraint(new mxPoint(.88,.25),!1)],v.prototype.constraints=mxRectangleShape.prototype.constraints,E.prototype.constraints=mxRectangleShape.prototype.constraints,f.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)],mxArrow.prototype.constraints=null,ut.prototype.getConstraints=function(t,e,n){var i=[],l=Math.max(0,Math.min(e,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),s=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));Math.abs(e-l);return i.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),i.push(new mxConnectionConstraint(new mxPoint(.5,0),!1)),i.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,.5*s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.75*e+.25*l,s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(e+l),s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(e+l),.5*(n+s))),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(e+l),n)),i.push(new mxConnectionConstraint(new mxPoint(.5,1),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(e-l),n)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(e-l),.5*(n+s))),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(e-l),s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*e-.25*l,s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*s)),i},ht.prototype.getConstraints=function(t,e,n){var i=[],l=Math.max(0,Math.min(e,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),s=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));return i.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),i.push(new mxConnectionConstraint(new mxPoint(.5,0),!1)),i.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,.5*s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(e+l),s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,l,s)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,l,.5*(n+s))),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,l,n)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*l,n)),i.push(new mxConnectionConstraint(new mxPoint(0,.5),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,1),!1)),i},dt.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)],pt.prototype.getConstraints=function(t,e,n){var i=[],l=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),s=e*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize)))),o=(n-l)/2;return i.push(new mxConnectionConstraint(new mxPoint(0,.5),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,o)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(e-s),o)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e-s,0)),i.push(new mxConnectionConstraint(new mxPoint(1,.5),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e-s,n)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(e-s),n-o)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,n-o)),i},mt.prototype.getConstraints=function(t,e,n){var i=[],l=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",pt.prototype.arrowWidth)))),s=e*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",pt.prototype.arrowSize)))),o=(n-l)/2;return i.push(new mxConnectionConstraint(new mxPoint(0,.5),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,s,0)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*e,o)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e-s,0)),i.push(new mxConnectionConstraint(new mxPoint(1,.5),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e-s,n)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*e,n-o)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,s,n)),i},It.prototype.getConstraints=function(t,e,n){var i=[],l=Math.min(n,e),s=Math.max(0,Math.min(l,l*parseFloat(mxUtils.getValue(this.style,"size",this.size)))),o=(n-s)/2,r=o+s,l=(e-s)/2,s=l+s;return i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,l,.5*o)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,l,0)),i.push(new mxConnectionConstraint(new mxPoint(.5,0),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,s,0)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,s,.5*o)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,s,o)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,l,n-.5*o)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,l,n)),i.push(new mxConnectionConstraint(new mxPoint(.5,1),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,s,n)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,s,n-.5*o)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,s,r)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(e+s),o)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,o)),i.push(new mxConnectionConstraint(new mxPoint(1,.5),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,r)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(e+s),r)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,l,r)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*l,o)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,o)),i.push(new mxConnectionConstraint(new mxPoint(0,.5),!1)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,r)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*l,r)),i.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,l,o)),i},Z.prototype.constraints=null,gt.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)],xt.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.175,.25),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.175,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)],q.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)],$.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)]}(),Actions.prototype.init=function(){function t(){return Action.prototype.isEnabled.apply(this,arguments)&&d.isEnabled()}var a=this.editorUi,h=a.editor,d=h.graph;this.addAction("new...",function(){d.openLink(a.getUrl())}),this.addAction("open...",function(){window.openNew=!0,window.openKey="open",a.openFile()}),this.addAction("import...",function(){window.openNew=!1,window.openKey="import",window.openFile=new OpenFile(mxUtils.bind(this,function(){a.hideDialog()})),window.openFile.setConsumer(mxUtils.bind(this,function(t,e){try{var n=mxUtils.parseXml(t);h.graph.setSelectionCells(h.graph.importGraphModel(n.documentElement))}catch(t){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+t.message)}})),a.showDialog(new OpenDialog(this).container,320,220,!0,!0,function(){window.openFile=null})}).isEnabled=t,this.addAction("save",function(){a.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=t,this.addAction("saveAs...",function(){a.saveFile(!0)},null,null,Editor.ctrlKey+"+Shift+S").isEnabled=t,this.addAction("export...",function(){a.showDialog(new ExportDialog(a).container,300,296,!0,!0)}),this.addAction("editDiagram...",function(){var t=new EditDiagramDialog(a);a.showDialog(t.container,620,420,!0,!1),t.init()}),this.addAction("pageSetup...",function(){a.showDialog(new PageSetupDialog(a).container,320,220,!0,!0)}).isEnabled=t,this.addAction("print...",function(){a.showDialog(new PrintDialog(a).container,300,180,!0,!0)},null,"sprite-print",Editor.ctrlKey+"+P"),this.addAction("preview",function(){mxUtils.show(d,null,10,10)}),this.addAction("undo",function(){a.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z"),this.addAction("redo",function(){a.redo()},null,"sprite-redo",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+Shift+Z"),this.addAction("cut",function(){mxClipboard.cut(d)},null,"sprite-cut",Editor.ctrlKey+"+X"),this.addAction("copy",function(){try{mxClipboard.copy(d)}catch(t){a.handleError(t)}},null,"sprite-copy",Editor.ctrlKey+"+C"),this.addAction("paste",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&mxClipboard.paste(d)},!1,"sprite-paste",Editor.ctrlKey+"+V"),this.addAction("pasteHere",function(t){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){d.getModel().beginUpdate();try{var e=mxClipboard.paste(d);if(null!=e){for(var n=!0,i=0;i<e.length&&n;i++)n=n&&d.model.isEdge(e[i]);var l=d.view.translate,s=d.view.scale,o=l.x,r=l.y,a=null;1!=e.length||!n||null!=(l=d.getCellGeometry(e[0]))&&(a=l.getTerminalPoint(!0)),null!=(a=null!=a?a:d.getBoundingBoxFromGeometry(e,n))&&(o=Math.round(d.snap(d.popupMenuHandler.triggerX/s-o)),r=Math.round(d.snap(d.popupMenuHandler.triggerY/s-r)),d.cellsMoved(e,o-a.x,r-a.y))}}finally{d.getModel().endUpdate()}}}),this.addAction("copySize",function(t){var e=d.getSelectionCell();d.isEnabled()&&null!=e&&d.getModel().isVertex(e)&&(null!=(e=d.getCellGeometry(e))&&(a.copiedSize=new mxRectangle(e.x,e.y,e.width,e.height)))},null,null,"Alt+Shift+X"),this.addAction("pasteSize",function(t){if(d.isEnabled()&&!d.isSelectionEmpty()&&null!=a.copiedSize){d.getModel().beginUpdate();try{for(var e,n=d.getSelectionCells(),i=0;i<n.length;i++)!d.getModel().isVertex(n[i])||null!=(e=d.getCellGeometry(n[i]))&&((e=e.clone()).width=a.copiedSize.width,e.height=a.copiedSize.height,d.getModel().setGeometry(n[i],e))}finally{d.getModel().endUpdate()}}},null,null,"Alt+Shift+V"),this.addAction("delete",function(t){t=null!=t&&mxEvent.isControlDown(t),d.escape(),null!=(t=d.deleteCells(d.getDeletableCells(d.getSelectionCells()),t))&&d.setSelectionCells(t)},null,null,"Delete"),this.addAction("deleteAll",function(){if(!d.isSelectionEmpty()){d.getModel().beginUpdate();try{for(var t=d.getSelectionCells(),e=0;e<t.length;e++)d.cellLabelChanged(t[e],"")}finally{d.getModel().endUpdate()}}}),this.addAction("deleteLabels",function(){if(!d.isSelectionEmpty()){d.getModel().beginUpdate();try{for(var t=d.getSelectionCells(),e=0;e<t.length;e++)d.cellLabelChanged(t[e],"")}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Delete"),this.addAction("duplicate",function(){try{d.setSelectionCells(d.duplicateCells()),d.scrollCellToVisible(d.getSelectionCell())}catch(t){a.handleError(t)}},null,null,Editor.ctrlKey+"+D"),this.put("turn",new Action(mxResources.get("turn")+" / "+mxResources.get("reverse"),function(t){d.turnShapes(d.getSelectionCells(),null!=t&&mxEvent.isShiftDown(t))},null,null,Editor.ctrlKey+"+R")),this.addAction("selectVertices",function(){d.selectVertices(null,!0)},null,null,Editor.ctrlKey+"+Shift+I"),this.addAction("selectEdges",function(){d.selectEdges()},null,null,Editor.ctrlKey+"+Shift+E"),this.addAction("selectAll",function(){d.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A"),this.addAction("selectNone",function(){d.clearSelection()},null,null,Editor.ctrlKey+"+Shift+A"),this.addAction("lockUnlock",function(){if(!d.isSelectionEmpty()){d.getModel().beginUpdate();try{var t=d.isCellMovable(d.getSelectionCell())?1:0;d.toggleCellStyles(mxConstants.STYLE_MOVABLE,t),d.toggleCellStyles(mxConstants.STYLE_RESIZABLE,t),d.toggleCellStyles(mxConstants.STYLE_ROTATABLE,t),d.toggleCellStyles(mxConstants.STYLE_DELETABLE,t),d.toggleCellStyles(mxConstants.STYLE_EDITABLE,t),d.toggleCellStyles("connectable",t)}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+L"),this.addAction("home",function(){d.home()},null,null,"Shift+Home"),this.addAction("exitGroup",function(){d.exitGroup()},null,null,Editor.ctrlKey+"+Shift+Home"),this.addAction("enterGroup",function(){d.enterGroup()},null,null,Editor.ctrlKey+"+Shift+End"),this.addAction("collapse",function(){d.foldCells(!0)},null,null,Editor.ctrlKey+"+Home"),this.addAction("expand",function(){d.foldCells(!1)},null,null,Editor.ctrlKey+"+End"),this.addAction("toFront",function(){d.orderCells(!1)},null,null,Editor.ctrlKey+"+Shift+F"),this.addAction("toBack",function(){d.orderCells(!0)},null,null,Editor.ctrlKey+"+Shift+B"),this.addAction("group",function(){var t;d.isEnabled()&&(1!=(t=mxUtils.sortCells(d.getSelectionCells(),!0)).length||d.isTable(t[0])||d.isTableRow(t[0])?1<(t=d.getCellsForGroup(t)).length&&d.setSelectionCell(d.groupCells(null,0,t)):d.setCellStyles("container","1"))},null,null,Editor.ctrlKey+"+G"),this.addAction("ungroup",function(){if(d.isEnabled()){var t=d.getSelectionCells();d.model.beginUpdate();try{var e=d.ungroupCells();if(null!=t)for(var n=0;n<t.length;n++)d.model.contains(t[n])&&(0==d.model.getChildCount(t[n])&&d.model.isVertex(t[n])&&d.setCellStyles("container","0",[t[n]]),e.push(t[n]))}finally{d.model.endUpdate()}d.setSelectionCells(e)}},null,null,Editor.ctrlKey+"+Shift+U"),this.addAction("removeFromGroup",function(){if(d.isEnabled()){var t=d.getSelectionCells();if(null!=t){for(var e=[],n=0;n<t.length;n++)d.isTableRow(t[n])||d.isTableCell(t[n])||e.push(t[n]);d.removeCellsFromParent(e)}}}),this.addAction("edit",function(){d.isEnabled()&&d.startEditingAtCell()},null,null,"F2/Enter"),this.addAction("editData...",function(){var t=d.getSelectionCell()||d.getModel().getRoot();a.showDataDialog(t)},null,null,Editor.ctrlKey+"+M"),this.addAction("editTooltip...",function(){var e,t,n;d.isEnabled()&&!d.isSelectionEmpty()&&(e=d.getSelectionCell(),n="",mxUtils.isNode(e.value)&&(t=null,Graph.translateDiagram&&null!=Graph.diagramLanguage&&e.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(t=e.value.getAttribute("tooltip_"+Graph.diagramLanguage)),null==t&&(t=e.value.getAttribute("tooltip")),null!=t&&(n=t)),n=new TextareaDialog(a,mxResources.get("editTooltip")+":",n,function(t){d.setTooltipForCell(e,t)}),a.showDialog(n.container,320,200,!0,!0),n.init())},null,null,"Alt+Shift+T"),this.addAction("openLink",function(){var t=d.getLinkForCell(d.getSelectionCell());null!=t&&d.openLink(t)}),this.addAction("editLink...",function(){var e,t;d.isEnabled()&&!d.isSelectionEmpty()&&(e=d.getSelectionCell(),t=d.getLinkForCell(e)||"",a.showLinkDialog(t,mxResources.get("apply"),function(t){t=mxUtils.trim(t),d.setLinkForCell(e,0<t.length?t:null)}))},null,null,"Alt+Shift+L"),this.put("insertImage",new Action(mxResources.get("image")+"...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&(d.clearSelection(),a.actions.get("image").funct())})).isEnabled=t,this.put("insertLink",new Action(mxResources.get("link")+"...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&a.showLinkDialog("",mxResources.get("insert"),function(t,e){if(0<(t=mxUtils.trim(t)).length){var n=null,i=d.getLinkTitle(t);null!=e&&0<e.length&&(n=e[0].iconUrl,30<(i=(i=e[0].name||e[0].type).charAt(0).toUpperCase()+i.substring(1)).length&&(i=i.substring(0,30)+"..."));var l=new mxCell(i,new mxGeometry(0,0,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=n?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+n:"spacing=10;"));l.vertex=!0;n=d.getCenterInsertPoint(d.getBoundingBoxFromGeometry([l],!0));l.geometry.x=n.x,l.geometry.y=n.y,d.setLinkForCell(l,t),d.cellSizeUpdated(l,!0),d.getModel().beginUpdate();try{l=d.addCell(l),d.fireEvent(new mxEventObject("cellsInserted","cells",[l]))}finally{d.getModel().endUpdate()}d.setSelectionCell(l),d.scrollCellToVisible(d.getSelectionCell())}})})).isEnabled=t,this.addAction("link...",mxUtils.bind(this,function(){if(d.isEnabled())if(d.cellEditor.isContentEditing()){var t=d.getSelectedElement(),e=d.getParentByName(t,"A",d.cellEditor.textarea),n="";if(null==e&&null!=t&&null!=t.getElementsByTagName)for(var i=t.getElementsByTagName("a"),l=0;l<i.length&&null==e;l++)i[l].textContent==t.textContent&&(e=i[l]);null!=e&&"A"==e.nodeName&&(n=e.getAttribute("href")||"",d.selectNode(e));var s=d.cellEditor.saveSelection();a.showLinkDialog(n,mxResources.get("apply"),mxUtils.bind(this,function(t){d.cellEditor.restoreSelection(s),null!=t&&d.insertLink(t)}))}else(d.isSelectionEmpty()?this.get("insertLink"):this.get("editLink")).funct()})).isEnabled=t,this.addAction("autosize",function(){var t=d.getSelectionCells();if(null!=t){d.getModel().beginUpdate();try{for(var e=0;e<t.length;e++){var n,i,l=t[e];d.getModel().getChildCount(l)?d.updateGroupBounds([l],20):(n=d.view.getState(l),i=d.getCellGeometry(l),d.getModel().isVertex(l)&&null!=n&&null!=n.text&&null!=i&&d.isWrapping(l)?((i=i.clone()).height=n.text.boundingBox.height/d.view.scale,d.getModel().setGeometry(l,i)):d.updateCellSize(l))}}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y"),this.addAction("formattedText",function(){var t=d.getView().getState(d.getSelectionCell());if(null!=t){d.stopEditing();var e="1"==t.style.html?null:"1";d.getModel().beginUpdate();try{for(var n,i,l,s=d.getSelectionCells(),o=0;o<s.length;o++)state=d.getView().getState(s[o]),null!=state&&("1"==(n=mxUtils.getValue(state.style,"html","0"))&&null==e?(l=d.convertValueToString(state.cell),"0"!=mxUtils.getValue(state.style,"nl2Br","1")&&(l=l.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n")),(i=document.createElement("div")).innerHTML=d.sanitizeHtml(l),l=mxUtils.extractTextWithWhitespace(i.childNodes),d.cellLabelChanged(state.cell,l),d.setCellStyles("html",e,[s[o]])):"0"==n&&"1"==e&&(l=mxUtils.htmlEntities(d.convertValueToString(state.cell),!1),"0"!=mxUtils.getValue(state.style,"nl2Br","1")&&(l=l.replace(/\n/g,"<br/>")),d.cellLabelChanged(state.cell,d.sanitizeHtml(l)),d.setCellStyles("html",e,[s[o]])));a.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=e?e:"0"],"cells",s))}finally{d.getModel().endUpdate()}}}),this.addAction("wordWrap",function(){var t=d.getView().getState(d.getSelectionCell()),e="wrap";d.stopEditing(),null!=t&&"wrap"==t.style[mxConstants.STYLE_WHITE_SPACE]&&(e=null),d.setCellStyles(mxConstants.STYLE_WHITE_SPACE,e)}),this.addAction("rotation",function(){var t="0",e=d.getView().getState(d.getSelectionCell());null!=e&&(t=e.style[mxConstants.STYLE_ROTATION]||t);t=new FilenameDialog(a,t,mxResources.get("apply"),function(t){null!=t&&0<t.length&&d.setCellStyles(mxConstants.STYLE_ROTATION,t)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");a.showDialog(t.container,375,80,!0,!0),t.init()}),this.addAction("resetView",function(){d.zoomTo(1),a.resetScrollbars()},null,null,"Home"),this.addAction("zoomIn",function(t){d.isFastZoomEnabled()?d.lazyZoom(!0,!0,a.buttonZoomDelay):d.zoomIn()},null,null,Editor.ctrlKey+" + (Numpad) / Alt+Mousewheel"),this.addAction("zoomOut",function(t){d.isFastZoomEnabled()?d.lazyZoom(!1,!0,a.buttonZoomDelay):d.zoomOut()},null,null,Editor.ctrlKey+" - (Numpad) / Alt+Mousewheel"),this.addAction("fitWindow",function(){var t=d.isSelectionEmpty()?d.getGraphBounds():d.getBoundingBox(d.getSelectionCells()),e=d.view.translate,n=d.view.scale;t.x=t.x/n-e.x,t.y=t.y/n-e.y,t.width/=n,t.height/=n,null!=d.backgroundImage&&t.add(new mxRectangle(0,0,d.backgroundImage.width,d.backgroundImage.height)),0==t.width||0==t.height?(d.zoomTo(1),a.resetScrollbars()):d.fitWindow(t)},null,null,Editor.ctrlKey+"+Shift+H"),this.addAction("fitPage",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var t=d.pageFormat,e=d.pageScale,n=d.container.clientWidth-10,i=d.container.clientHeight-10,e=Math.floor(20*Math.min(n/t.width/e,i/t.height/e))/20;d.zoomTo(e),mxUtils.hasScrollbars(d.container)&&(e=d.getPagePadding(),d.container.scrollTop=e.y*d.view.scale-1,d.container.scrollLeft=Math.min(e.x*d.view.scale,(d.container.scrollWidth-d.container.clientWidth)/2)-1)}),null,null,Editor.ctrlKey+"+J"),this.addAction("fitTwoPages",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var t=d.pageFormat,e=d.pageScale,n=d.container.clientWidth-10,i=d.container.clientHeight-10,e=Math.floor(20*Math.min(n/(2*t.width)/e,i/t.height/e))/20;d.zoomTo(e),mxUtils.hasScrollbars(d.container)&&(e=d.getPagePadding(),d.container.scrollTop=Math.min(e.y,(d.container.scrollHeight-d.container.clientHeight)/2),d.container.scrollLeft=Math.min(e.x,(d.container.scrollWidth-d.container.clientWidth)/2))}),null,null,Editor.ctrlKey+"+Shift+J"),this.addAction("fitPageWidth",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var t=d.pageFormat,e=d.pageScale,n=d.container.clientWidth-10,e=Math.floor(20*n/t.width/e)/20;d.zoomTo(e),mxUtils.hasScrollbars(d.container)&&(e=d.getPagePadding(),d.container.scrollLeft=Math.min(e.x*d.view.scale,(d.container.scrollWidth-d.container.clientWidth)/2))})),this.put("customZoom",new Action(mxResources.get("custom")+"...",mxUtils.bind(this,function(){var t=new FilenameDialog(this.editorUi,parseInt(100*d.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(t){t=parseInt(t);!isNaN(t)&&0<t&&d.zoomTo(t/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(t.container,300,80,!0,!0),t.init()}),null,null,Editor.ctrlKey+"+0")),this.addAction("pageScale...",mxUtils.bind(this,function(){var t=new FilenameDialog(this.editorUi,parseInt(100*d.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(t){t=parseInt(t);!isNaN(t)&&0<t&&((t=new ChangePageSetup(a,null,null,null,t/100)).ignoreColor=!0,t.ignoreImage=!0,d.model.execute(t))}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(t.container,300,80,!0,!0),t.init()}));var e=null;(e=this.addAction("grid",function(){d.setGridEnabled(!d.isGridEnabled()),a.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G")).setToggleAction(!0),e.setSelectedCallback(function(){return d.isGridEnabled()}),e.setEnabled(!1),(e=this.addAction("guides",function(){d.graphHandler.guidesEnabled=!d.graphHandler.guidesEnabled,a.fireEvent(new mxEventObject("guidesEnabledChanged"))})).setToggleAction(!0),e.setSelectedCallback(function(){return d.graphHandler.guidesEnabled}),e.setEnabled(!1),(e=this.addAction("tooltips",function(){d.tooltipHandler.setEnabled(!d.tooltipHandler.isEnabled()),a.fireEvent(new mxEventObject("tooltipsEnabledChanged"))})).setToggleAction(!0),e.setSelectedCallback(function(){return d.tooltipHandler.isEnabled()}),(e=this.addAction("collapseExpand",function(){var t=new ChangePageSetup(a);t.ignoreColor=!0,t.ignoreImage=!0,t.foldingEnabled=!d.foldingEnabled,d.model.execute(t)})).setToggleAction(!0),e.setSelectedCallback(function(){return d.foldingEnabled}),e.isEnabled=t,(e=this.addAction("scrollbars",function(){a.setScrollbars(!a.hasScrollbars())})).setToggleAction(!0),e.setSelectedCallback(function(){return d.scrollbars}),(e=this.addAction("pageView",mxUtils.bind(this,function(){a.setPageVisible(!d.pageVisible)}))).setToggleAction(!0),e.setSelectedCallback(function(){return d.pageVisible}),(e=this.addAction("connectionArrows",function(){d.connectionArrowsEnabled=!d.connectionArrowsEnabled,a.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,"Alt+Shift+A")).setToggleAction(!0),e.setSelectedCallback(function(){return d.connectionArrowsEnabled}),(e=this.addAction("connectionPoints",function(){d.setConnectable(!d.connectionHandler.isEnabled()),a.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+P")).setToggleAction(!0),e.setSelectedCallback(function(){return d.connectionHandler.isEnabled()}),(e=this.addAction("copyConnect",function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget()),a.fireEvent(new mxEventObject("copyConnectChanged"))})).setToggleAction(!0),e.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()}),e.isEnabled=t,(e=this.addAction("autosave",function(){a.editor.setAutosave(!a.editor.autosave)})).setToggleAction(!0),e.setSelectedCallback(function(){return a.editor.autosave}),e.isEnabled=t,e.visible=!1,this.addAction("help",function(){var t="";mxResources.isLanguageSupported(mxClient.language)&&(t="_"+mxClient.language),d.openLink(RESOURCES_PATH+"/help"+t+".html")});var n=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){n||(a.showDialog(new AboutDialog(a).container,320,280,!0,!0,function(){n=!1}),n=!0)}));var i=mxUtils.bind(this,function(t,n,i,e){return this.addAction(t,function(){if(null!=i&&d.cellEditor.isContentEditing())i();else{d.stopEditing(!1),d.getModel().beginUpdate();try{var t=d.getSelectionCells();d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,n,t),(n&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?d.updateLabelElements(d.getSelectionCells(),function(t){t.style.fontWeight=null,"B"==t.nodeName&&d.replaceElement(t)}):(n&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?d.updateLabelElements(d.getSelectionCells(),function(t){t.style.fontStyle=null,"I"==t.nodeName&&d.replaceElement(t)}):(n&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&d.updateLabelElements(d.getSelectionCells(),function(t){t.style.textDecoration=null,"U"==t.nodeName&&d.replaceElement(t)});for(var e=0;e<t.length;e++)0==d.model.getChildCount(t[e])&&d.autoSizeCell(t[e],!1)}finally{d.getModel().endUpdate()}}},null,null,e)});i("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B"),i("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I"),i("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U"),this.addAction("fontColor...",function(){a.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000")}),this.addAction("strokeColor...",function(){a.menus.pickColor(mxConstants.STYLE_STROKECOLOR)}),this.addAction("fillColor...",function(){a.menus.pickColor(mxConstants.STYLE_FILLCOLOR)}),this.addAction("gradientColor...",function(){a.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR)}),this.addAction("backgroundColor...",function(){a.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor")}),this.addAction("borderColor...",function(){a.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR)}),this.addAction("vertical",function(){a.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)}),this.addAction("shadow",function(){a.menus.toggleStyle(mxConstants.STYLE_SHADOW)}),this.addAction("solid",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,null),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),a.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}),this.addAction("dashed",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,"1"),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),a.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}),this.addAction("dotted",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,"1"),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,"1 4"),a.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}),this.addAction("sharp",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),d.setCellStyles(mxConstants.STYLE_CURVED,"0"),a.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}),this.addAction("rounded",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"1"),d.setCellStyles(mxConstants.STYLE_CURVED,"0"),a.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}),this.addAction("toggleRounded",function(){if(!d.isSelectionEmpty()&&d.isEnabled()){d.getModel().beginUpdate();try{var t=d.getSelectionCells(),t=d.getCurrentCellStyle(t[0]),t="1"==mxUtils.getValue(t,mxConstants.STYLE_ROUNDED,"0")?"0":"1";d.setCellStyles(mxConstants.STYLE_ROUNDED,t),d.setCellStyles(mxConstants.STYLE_CURVED,null),a.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[t,"0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}}),this.addAction("curved",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),d.setCellStyles(mxConstants.STYLE_CURVED,"1"),a.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}),this.addAction("collapsible",function(){var t=d.view.getState(d.getSelectionCell()),e="1";null!=t&&null!=d.getFoldingImage(t)&&(e="0"),d.setCellStyles("collapsible",e),a.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[e],"cells",d.getSelectionCells()))}),this.addAction("editStyle...",mxUtils.bind(this,function(){var t,e=d.getSelectionCells();null!=e&&0<e.length&&(t=d.getModel(),t=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",t.getStyle(e[0])||"",function(t){null!=t&&d.setCellStyle(mxUtils.trim(t),e)},null,null,400,220),this.editorUi.showDialog(t.container,420,300,!0,!0),t.init())}),null,null,Editor.ctrlKey+"+E"),this.addAction("setAsDefaultStyle",function(){d.isEnabled()&&!d.isSelectionEmpty()&&a.setDefaultStyle(d.getSelectionCell())},null,null,Editor.ctrlKey+"+Shift+D"),this.addAction("clearDefaultStyle",function(){d.isEnabled()&&a.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R"),this.addAction("addWaypoint",function(){var t=d.getSelectionCell();if(null!=t&&d.getModel().isEdge(t)){var e=h.graph.selectionCellsHandler.getHandler(t);if(e instanceof mxEdgeHandler){for(var n=d.view.translate,i=d.view.scale,l=n.x,s=n.y,o=d.getModel().getParent(t),r=d.getCellGeometry(o);d.getModel().isVertex(o)&&null!=r;)l+=r.x,s+=r.y,o=d.getModel().getParent(o),r=d.getCellGeometry(o);t=Math.round(d.snap(d.popupMenuHandler.triggerX/i-l)),i=Math.round(d.snap(d.popupMenuHandler.triggerY/i-s));e.addPointAt(e.state,t,i)}}}),this.addAction("removeWaypoint",function(){var t=a.actions.get("removeWaypoint");null!=t.handler&&t.handler.removePoint(t.handler.state,t.index)}),this.addAction("clearWaypoints",function(){var t=d.getSelectionCells();if(null!=t){t=d.addAllEdges(t),d.getModel().beginUpdate();try{for(var e=0;e<t.length;e++){var n,i=t[e];!d.getModel().isEdge(i)||null!=(n=d.getCellGeometry(i))&&((n=n.clone()).points=null,d.getModel().setGeometry(i,n))}}finally{d.getModel().endUpdate()}}},null,null,"Alt+Shift+C"),e=this.addAction("subscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,"),e=this.addAction("superscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+."),e=this.addAction("indent",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("indent",!1,null)}),null,null,"Shift+Tab"),this.addAction("image...",function(){var t,e,n,r;d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&(t=mxResources.get("image")+" ("+mxResources.get("url")+"):",n="",null!=(e=d.getView().getState(d.getSelectionCell()))&&(n=e.style[mxConstants.STYLE_IMAGE]||n),r=d.cellEditor.saveSelection(),a.showImageDialog(t,n,function(t,e,n){if(d.cellEditor.isContentEditing())d.cellEditor.restoreSelection(r),d.insertImage(t,e,n);else{var i=d.getSelectionCells();if(null!=t&&(0<t.length||0<i.length)){var l=null;d.getModel().beginUpdate();try{0==i.length&&(i=[d.insertVertex(d.getDefaultParent(),null,"",0,0,e,n,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")],s=d.getCenterInsertPoint(d.getBoundingBoxFromGeometry(i,!0)),i[0].geometry.x=s.x,i[0].geometry.y=s.y,l=i,d.fireEvent(new mxEventObject("cellsInserted","cells",l))),d.setCellStyles(mxConstants.STYLE_IMAGE,0<t.length?t:null,i);var s,o=d.getCurrentCellStyle(i[0]);"image"!=o[mxConstants.STYLE_SHAPE]&&"label"!=o[mxConstants.STYLE_SHAPE]?d.setCellStyles(mxConstants.STYLE_SHAPE,"image",i):0==t.length&&d.setCellStyles(mxConstants.STYLE_SHAPE,null,i),1==d.getSelectionCount()&&null!=e&&null!=n&&(s=i[0],null!=(o=d.getModel().getGeometry(s))&&((o=o.clone()).width=e,o.height=n,d.getModel().setGeometry(s,o)))}finally{d.getModel().endUpdate()}null!=l&&(d.setSelectionCells(l),d.scrollCellToVisible(l[0]))}}},d.cellEditor.isContentEditing(),!d.cellEditor.isContentEditing()))}).isEnabled=t,(e=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(a,document.body.offsetWidth-280,120,220,196),this.layersWindow.window.addListener("show",function(){a.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.addListener("hide",function(){a.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),a.fireEvent(new mxEventObject("layers")),this.layersWindow.init()):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+L")).setToggleAction(!0),e.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()})),(e=this.addAction("formatPanel",mxUtils.bind(this,function(){a.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+Shift+P")).setToggleAction(!0),e.setSelectedCallback(mxUtils.bind(this,function(){return 0<a.formatWidth})),(e=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(a,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",function(){a.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.addListener("hide",function(){a.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),a.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+O")).setToggleAction(!0),e.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}))},Actions.prototype.addAction=function(t,e,n,i,l){var s="..."==t.substring(t.length-3)?(t=t.substring(0,t.length-3),mxResources.get(t)+"..."):mxResources.get(t);return this.put(t,new Action(s,e,n,i,l))},Actions.prototype.put=function(t,e){return this.actions[t]=e},Actions.prototype.get=function(t){return this.actions[t]},mxUtils.extend(Action,mxEventSource),Action.prototype.createFunction=function(t){return t},Action.prototype.setEnabled=function(t){this.enabled!=t&&(this.enabled=t,this.fireEvent(new mxEventObject("stateChanged")))},Action.prototype.isEnabled=function(){return this.enabled},Action.prototype.setToggleAction=function(t){this.toggleAction=t},Action.prototype.setSelectedCallback=function(t){this.selectedCallback=t},Action.prototype.isSelected=function(){return this.selectedCallback()},Menus=function(t){this.editorUi=t,this.menus=new Object,this.init(),mxClient.IS_SVG||((new Image).src=this.checkmarkImage)},Menus.prototype.defaultFont="Helvetica",Menus.prototype.defaultFontSize="12",Menus.prototype.defaultMenuItems=["edit","view","arrange","extras"],Menus.prototype.defaultFonts=["Helvetica","Verdana","Times New Roman","Garamond","Comic Sans MS","Courier New","Georgia","Lucida Console","Tahoma"],Menus.prototype.init=function(){var s=this.editorUi.editor.graph,t=mxUtils.bind(s,s.isEnabled);this.customFonts=[],this.customFontSizes=[],this.put("fontFamily",new Menu(mxUtils.bind(this,function(e,n){for(var t=mxUtils.bind(this,function(t){this.styleChange(e,t,[mxConstants.STYLE_FONTFAMILY],[t],null,n,function(){document.execCommand("fontname",!1,t)},function(){s.updateLabelElements(s.getSelectionCells(),function(t){t.removeAttribute("face"),t.style.fontFamily=null,"PRE"==t.nodeName&&s.replaceElement(t,"div")})}).firstChild.nextSibling.style.fontFamily=t}),i=0;i<this.defaultFonts.length;i++)t(this.defaultFonts[i]);if(e.addSeparator(n),0<this.customFonts.length){for(i=0;i<this.customFonts.length;i++)t(this.customFonts[i]);e.addSeparator(n),e.addItem(mxResources.get("reset"),null,mxUtils.bind(this,function(){this.customFonts=[],this.editorUi.fireEvent(new mxEventObject("customFontsChanged"))}),n),e.addSeparator(n)}this.promptChange(e,mxResources.get("custom")+"...","",mxConstants.DEFAULT_FONTFAMILY,mxConstants.STYLE_FONTFAMILY,n,!0,mxUtils.bind(this,function(t){mxUtils.indexOf(this.customFonts,t)<0&&(this.customFonts.push(t),this.editorUi.fireEvent(new mxEventObject("customFontsChanged")))}))}))),this.put("formatBlock",new Menu(mxUtils.bind(this,function(n,i){function t(t,e){return n.addItem(t,null,mxUtils.bind(this,function(){null!=s.cellEditor.textarea&&(s.cellEditor.textarea.focus(),document.execCommand("formatBlock",!1,"<"+e+">"))}),i)}t(mxResources.get("normal"),"p"),t("","h1").firstChild.nextSibling.innerHTML='<h1 style="margin:0px;">'+mxResources.get("heading")+" 1</h1>",t("","h2").firstChild.nextSibling.innerHTML='<h2 style="margin:0px;">'+mxResources.get("heading")+" 2</h2>",t("","h3").firstChild.nextSibling.innerHTML='<h3 style="margin:0px;">'+mxResources.get("heading")+" 3</h3>",t("","h4").firstChild.nextSibling.innerHTML='<h4 style="margin:0px;">'+mxResources.get("heading")+" 4</h4>",t("","h5").firstChild.nextSibling.innerHTML='<h5 style="margin:0px;">'+mxResources.get("heading")+" 5</h5>",t("","h6").firstChild.nextSibling.innerHTML='<h6 style="margin:0px;">'+mxResources.get("heading")+" 6</h6>",t("","pre").firstChild.nextSibling.innerHTML='<pre style="margin:0px;">'+mxResources.get("formatted")+"</pre>",t("","blockquote").firstChild.nextSibling.innerHTML='<blockquote style="margin-top:0px;margin-bottom:0px;">'+mxResources.get("blockquote")+"</blockquote>"}))),this.put("fontSize",new Menu(mxUtils.bind(this,function(t,e){for(var n=[6,8,9,10,11,12,14,18,24,36,48,72],i=mxUtils.bind(this,function(n){this.styleChange(t,n,[mxConstants.STYLE_FONTSIZE],[n],null,e,function(){if(null!=s.cellEditor.textarea){document.execCommand("fontSize",!1,"3");for(var t=s.cellEditor.textarea.getElementsByTagName("font"),e=0;e<t.length;e++)if("3"==t[e].getAttribute("size")){t[e].removeAttribute("size"),t[e].style.fontSize=n+"px";break}}})}),l=0;l<n.length;l++)i(n[l]);if(t.addSeparator(e),0<this.customFontSizes.length){for(l=0;l<this.customFontSizes.length;l++)i(this.customFontSizes[l]);t.addSeparator(e),t.addItem(mxResources.get("reset"),null,mxUtils.bind(this,function(){this.customFontSizes=[]}),e),t.addSeparator(e)}this.promptChange(t,mxResources.get("custom")+"...","(pt)","12",mxConstants.STYLE_FONTSIZE,e,!0,mxUtils.bind(this,function(t){this.customFontSizes.push(t)}))}))),this.put("direction",new Menu(mxUtils.bind(this,function(t,e){t.addItem(mxResources.get("flipH"),null,function(){s.toggleCellStyles(mxConstants.STYLE_FLIPH,!1)},e),t.addItem(mxResources.get("flipV"),null,function(){s.toggleCellStyles(mxConstants.STYLE_FLIPV,!1)},e),this.addMenuItems(t,["-","rotation"],e)}))),this.put("align",new Menu(mxUtils.bind(this,function(t,e){t.addItem(mxResources.get("leftAlign"),null,function(){s.alignCells(mxConstants.ALIGN_LEFT)},e),t.addItem(mxResources.get("center"),null,function(){s.alignCells(mxConstants.ALIGN_CENTER)},e),t.addItem(mxResources.get("rightAlign"),null,function(){s.alignCells(mxConstants.ALIGN_RIGHT)},e),t.addSeparator(e),t.addItem(mxResources.get("topAlign"),null,function(){s.alignCells(mxConstants.ALIGN_TOP)},e),t.addItem(mxResources.get("middle"),null,function(){s.alignCells(mxConstants.ALIGN_MIDDLE)},e),t.addItem(mxResources.get("bottomAlign"),null,function(){s.alignCells(mxConstants.ALIGN_BOTTOM)},e)}))),this.put("distribute",new Menu(mxUtils.bind(this,function(t,e){t.addItem(mxResources.get("horizontal"),null,function(){s.distributeCells(!0)},e),t.addItem(mxResources.get("vertical"),null,function(){s.distributeCells(!1)},e)}))),this.put("layout",new Menu(mxUtils.bind(this,function(t,e){var i=mxUtils.bind(this,function(t,e){t=new FilenameDialog(this.editorUi,t,mxResources.get("apply"),function(t){e(parseFloat(t))},mxResources.get("spacing"));this.editorUi.showDialog(t.container,300,80,!0,!0),t.init()});t.addItem(mxResources.get("horizontalFlow"),null,mxUtils.bind(this,function(){var e=new mxHierarchicalLayout(s,mxConstants.DIRECTION_WEST);this.editorUi.executeLayout(function(){var t=s.getSelectionCells();e.execute(s.getDefaultParent(),0==t.length?null:t)},!0)}),e),t.addItem(mxResources.get("verticalFlow"),null,mxUtils.bind(this,function(){var e=new mxHierarchicalLayout(s,mxConstants.DIRECTION_NORTH);this.editorUi.executeLayout(function(){var t=s.getSelectionCells();e.execute(s.getDefaultParent(),0==t.length?null:t)},!0)}),e),t.addSeparator(e),t.addItem(mxResources.get("horizontalTree"),null,mxUtils.bind(this,function(){var e,n=s.getSelectionCell(),t=null;null==n||0==s.getModel().getChildCount(n)?0==s.getModel().getEdgeCount(n)&&(t=s.findTreeRoots(s.getDefaultParent())):t=s.findTreeRoots(n),null!=t&&0<t.length&&(n=t[0]),null!=n&&((e=new mxCompactTreeLayout(s,!0)).edgeRouting=!1,e.levelDistance=30,i(e.levelDistance,mxUtils.bind(this,function(t){e.levelDistance=t,this.editorUi.executeLayout(function(){e.execute(s.getDefaultParent(),n)},!0)})))}),e),t.addItem(mxResources.get("verticalTree"),null,mxUtils.bind(this,function(){var e,n=s.getSelectionCell(),t=null;null==n||0==s.getModel().getChildCount(n)?0==s.getModel().getEdgeCount(n)&&(t=s.findTreeRoots(s.getDefaultParent())):t=s.findTreeRoots(n),null!=t&&0<t.length&&(n=t[0]),null!=n&&((e=new mxCompactTreeLayout(s,!1)).edgeRouting=!1,e.levelDistance=30,i(e.levelDistance,mxUtils.bind(this,function(t){e.levelDistance=t,this.editorUi.executeLayout(function(){e.execute(s.getDefaultParent(),n)},!0)})))}),e),t.addItem(mxResources.get("radialTree"),null,mxUtils.bind(this,function(){var e,n=s.getSelectionCell(),t=null;null==n||0==s.getModel().getChildCount(n)?0==s.getModel().getEdgeCount(n)&&(t=s.findTreeRoots(s.getDefaultParent())):t=s.findTreeRoots(n),null!=t&&0<t.length&&(n=t[0]),null!=n&&((e=new mxRadialTreeLayout(s,!1)).levelDistance=80,e.autoRadius=!0,i(e.levelDistance,mxUtils.bind(this,function(t){e.levelDistance=t,this.editorUi.executeLayout(function(){e.execute(s.getDefaultParent(),n),s.isSelectionEmpty()||(n=s.getModel().getParent(n),s.getModel().isVertex(n)&&s.updateGroupBounds([n],2*s.gridSize,!0))},!0)})))}),e),t.addSeparator(e),t.addItem(mxResources.get("organic"),null,mxUtils.bind(this,function(){var e=new mxFastOrganicLayout(s);i(e.forceConstant,mxUtils.bind(this,function(t){e.forceConstant=t,this.editorUi.executeLayout(function(){var t=s.getSelectionCell();null!=t&&0!=s.getModel().getChildCount(t)||(t=s.getDefaultParent()),e.execute(t),s.getModel().isVertex(t)&&s.updateGroupBounds([t],2*s.gridSize,!0)},!0)}))}),e),t.addItem(mxResources.get("circle"),null,mxUtils.bind(this,function(){var e=new mxCircleLayout(s);this.editorUi.executeLayout(function(){var t=s.getSelectionCell();null!=t&&0!=s.getModel().getChildCount(t)||(t=s.getDefaultParent()),e.execute(t),s.getModel().isVertex(t)&&s.updateGroupBounds([t],2*s.gridSize,!0)},!0)}),e)}))),this.put("navigation",new Menu(mxUtils.bind(this,function(t,e){this.addMenuItems(t,["home","-","exitGroup","enterGroup","-","expand","collapse","-","collapsible"],e)}))),this.put("arrange",new Menu(mxUtils.bind(this,function(t,e){this.addMenuItems(t,["toFront","toBack","-"],e),this.addSubmenu("direction",t,e),this.addMenuItems(t,["turn","-"],e),this.addSubmenu("align",t,e),this.addSubmenu("distribute",t,e),t.addSeparator(e),this.addSubmenu("navigation",t,e),this.addSubmenu("insert",t,e),this.addSubmenu("layout",t,e),this.addMenuItems(t,["-","group","ungroup","removeFromGroup","-","clearWaypoints","autosize"],e)}))).isEnabled=t,this.put("insert",new Menu(mxUtils.bind(this,function(t,e){this.addMenuItems(t,["insertLink","insertImage"],e)}))),this.put("view",new Menu(mxUtils.bind(this,function(t,e){this.addMenuItems(t,(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers","-","pageView","pageScale","-","scrollbars","tooltips","-","grid","guides","-","connectionArrows","connectionPoints","-","resetView","zoomIn","zoomOut"],e))}))),this.put("viewPanels",new Menu(mxUtils.bind(this,function(t,e){null!=this.editorUi.format&&this.addMenuItems(t,["formatPanel"],e),this.addMenuItems(t,["outline","layers"],e)}))),this.put("viewZoom",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["resetView","-"],n);for(var t=[.25,.5,.75,1,1.25,1.5,2,3,4],i=0;i<t.length;i++)!function(t){e.addItem(100*t+"%",null,function(){s.zoomTo(t)},n)}(t[i]);this.addMenuItems(e,["-","fitWindow","fitPageWidth","fitPage","fitTwoPages","-","customZoom"],n)}))),this.put("file",new Menu(mxUtils.bind(this,function(t,e){this.addMenuItems(t,["new","open","-","save","saveAs","-","import","export","-","pageSetup","print"],e)}))),this.put("edit",new Menu(mxUtils.bind(this,function(t,e){this.addMenuItems(t,["undo","redo","-","cut","copy","paste","delete","-","duplicate","-","editData","editTooltip","-","editStyle","-","edit","-","editLink","openLink","-","selectVertices","selectEdges","selectAll","selectNone","-","lockUnlock"])}))),this.put("extras",new Menu(mxUtils.bind(this,function(t,e){this.addMenuItems(t,["copyConnect","collapseExpand","-","editDiagram"])}))),this.put("help",new Menu(mxUtils.bind(this,function(t,e){this.addMenuItems(t,["help","-","about"])})))},Menus.prototype.put=function(t,e){return this.menus[t]=e},Menus.prototype.get=function(t){return this.menus[t]},Menus.prototype.addSubmenu=function(t,e,n,i){var l=this.get(t);null!=l&&(l=l.isEnabled(),(e.showDisabled||l)&&(l=e.addItem(i||mxResources.get(t),null,null,n,null,l),this.addMenu(t,e,l)))},Menus.prototype.addMenu=function(t,e,n){var i=this.get(t);null!=i&&(e.showDisabled||i.isEnabled())&&this.get(t).execute(e,n)},Menus.prototype.addInsertTableCellItem=function(t,e){var i=this.editorUi.editor.graph;this.addInsertTableItem(t,mxUtils.bind(this,function(t,e,n){n=mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)?i.createCrossFunctionalSwimlane(e,n):i.createTable(e,n,null,null,mxEvent.isShiftDown(t)?"Table":null),t=mxEvent.isAltDown(t)?i.getFreeInsertPoint():i.getCenterInsertPoint(i.getBoundingBoxFromGeometry([n],!0)),t=i.importCells([n],t.x,t.y);null!=t&&0<t.length&&(i.scrollCellToVisible(t[0]),i.setSelectionCells(t))}),e)},Menus.prototype.addInsertTableItem=function(t,n,e){n=null!=n?n:mxUtils.bind(this,function(t,e,n){var i=this.editorUi.editor.graph,t=i.getParentByName(mxEvent.getSource(t),"TD");if(null!=t&&null!=i.cellEditor.textarea){i.getParentByName(t,"TR");for(var l=i.cellEditor.textarea.getElementsByTagName("table"),s=[],o=0;o<l.length;o++)s.push(l[o]);i.container.focus(),i.pasteHtmlAtCaret(function(t,e){for(var n=["<table>"],i=0;i<t;i++){n.push("<tr>");for(var l=0;l<e;l++)n.push("<td><br></td>");n.push("</tr>")}return n.push("</table>"),n.join("")}(e,n));var r=i.cellEditor.textarea.getElementsByTagName("table");if(r.length==s.length+1)for(o=r.length-1;0<=o;o--)if(0==o||r[o]!=s[o-1]){i.selectNode(r[o].rows[0].cells[0]);break}}});var r=this.editorUi.editor.graph,a=null,h=null;var e=t.addItem("",null,null,e,null,null,null,!0),d='<img src="'+mxClient.imageBasePath+'/transparent.gif" width="16" height="16"/>';e.firstChild.innerHTML="";var u=function(t,e){var n=document.createElement("table");n.setAttribute("border","1"),n.style.borderCollapse="collapse",n.style.borderStyle="solid",mxClient.IS_QUIRKS||n.setAttribute("cellPadding","8");for(var i=0;i<t;i++)for(var l=n.insertRow(i),s=0;s<e;s++){var o=l.insertCell(-1);mxClient.IS_QUIRKS&&(o.innerHTML=d)}return n}(5,5);e.firstChild.appendChild(u);var p=document.createElement("div");function i(t){var e=!1;if(null!=(h=r.getParentByName(mxEvent.getSource(t),"TD"))){a=r.getParentByName(h,"TR");var n=mxEvent.isMouseEvent(t)?2:4;!function(t,e,n){for(var i=t.rows.length;i<e;i++)for(var l=t.insertRow(i),s=0;s<t.rows[0].cells.length;s++){var o=l.insertCell(-1);mxClient.IS_QUIRKS&&(o.innerHTML=d)}for(i=0;i<t.rows.length;i++)for(s=(l=t.rows[i]).cells.length;s<n;s++){o=l.insertCell(-1);mxClient.IS_QUIRKS&&(o.innerHTML=d)}}(u,Math.min(20,a.sectionRowIndex+n),Math.min(20,h.cellIndex+n)),p.innerHTML=h.cellIndex+1+"x"+(a.sectionRowIndex+1);for(var i=0;i<u.rows.length;i++)for(var l=u.rows[i],s=0;s<l.cells.length;s++){var o=l.cells[s];i==a.sectionRowIndex&&s==h.cellIndex&&(e="blue"==o.style.backgroundColor),i<=a.sectionRowIndex&&s<=h.cellIndex?o.style.backgroundColor="blue":o.style.backgroundColor="transparent"}}return mxEvent.consume(t),e}p.style.padding="4px",p.style.fontSize=Menus.prototype.defaultFontSize+"px",p.innerHTML="1x1",e.firstChild.appendChild(p),mxEvent.addGestureListeners(u,null,null,mxUtils.bind(this,function(t){var e=i(t);null!=h&&null!=a&&e&&(n(t,a.sectionRowIndex+1,h.cellIndex+1),window.setTimeout(mxUtils.bind(this,function(){this.editorUi.hideCurrentMenu()}),0))})),mxEvent.addListener(u,"mouseover",i)},Menus.prototype.edgeStyleChange=function(t,e,r,a,n,i,h){return t.addItem(e,null,mxUtils.bind(this,function(){var t=this.editorUi.editor.graph;t.stopEditing(!1),t.getModel().beginUpdate();try{for(var e=t.getSelectionCells(),n=[],i=0;i<e.length;i++){var l,s=e[i];if(t.getModel().isEdge(s)){!h||null!=(l=t.getCellGeometry(s))&&((l=l.clone()).points=null,t.getModel().setGeometry(s,l));for(var o=0;o<r.length;o++)t.setCellStyles(r[o],a[o],[s]);n.push(s)}}this.editorUi.fireEvent(new mxEventObject("styleChanged","keys",r,"values",a,"cells",n))}finally{t.getModel().endUpdate()}}),i,n)},Menus.prototype.styleChange=function(t,e,n,i,l,s,o,r){var a=this.createStyleChangeFunction(n,i);return t.addItem(e,null,mxUtils.bind(this,function(){var t=this.editorUi.editor.graph;null!=o&&t.cellEditor.isContentEditing()?o():a(r)}),s,l)},Menus.prototype.createStyleChangeFunction=function(s,o){return mxUtils.bind(this,function(t){var e=this.editorUi.editor.graph;e.stopEditing(!1),e.getModel().beginUpdate();try{for(var n=e.getSelectionCells(),i=0;i<s.length;i++)if(e.setCellStyles(s[i],o[i],n),s[i]==mxConstants.STYLE_ALIGN&&e.updateLabelElements(n,function(t){t.removeAttribute("align"),t.style.textAlign=null}),s[i]==mxConstants.STYLE_FONTFAMILY)for(var l=0;l<n.length;l++)0==e.model.getChildCount(n[l])&&e.autoSizeCell(n[l],!1);null!=t&&t(),this.editorUi.fireEvent(new mxEventObject("styleChanged","keys",s,"values",o,"cells",n))}finally{e.getModel().endUpdate()}})},Menus.prototype.promptChange=function(t,e,i,l,s,n,o,r,a){return t.addItem(e,null,mxUtils.bind(this,function(){var e=this.editorUi.editor.graph,t=l,n=e.getView().getState(e.getSelectionCell());null!=n&&(t=n.style[s]||t);t=new FilenameDialog(this.editorUi,t,mxResources.get("apply"),mxUtils.bind(this,function(t){if(null!=t&&0<t.length){e.getModel().beginUpdate();try{e.stopEditing(!1),e.setCellStyles(s,t)}finally{e.getModel().endUpdate()}null!=r&&r(t)}}),mxResources.get("enterValue")+(0<i.length?" "+i:""));this.editorUi.showDialog(t.container,300,80,!0,!0),t.init()}),n,a,o)},Menus.prototype.pickColor=function(t,e,n){var i,l,s=this.editorUi.editor.graph,o=226+17*(Math.ceil(ColorDialog.prototype.presetColors.length/12)+Math.ceil(ColorDialog.prototype.defaultColors.length/12));null!=e&&s.cellEditor.isContentEditing()?(i=s.cellEditor.saveSelection(),l=new ColorDialog(this.editorUi,n||"000000",mxUtils.bind(this,function(t){s.cellEditor.restoreSelection(i),document.execCommand(e,!1,t!=mxConstants.NONE?t:"transparent")}),function(){s.cellEditor.restoreSelection(i)}),this.editorUi.showDialog(l.container,230,o,!0,!0),l.init()):(null==this.colorDialog&&(this.colorDialog=new ColorDialog(this.editorUi)),this.colorDialog.currentColorKey=t,n="none",null!=(l=s.getView().getState(s.getSelectionCell()))&&(n=l.style[t]||n),"none"==n?(n="ffffff",this.colorDialog.picker.fromString("ffffff"),this.colorDialog.colorInput.value="none"):this.colorDialog.picker.fromString(n),this.editorUi.showDialog(this.colorDialog.container,230,o,!0,!0),this.colorDialog.init())},Menus.prototype.toggleStyle=function(t,e){var n=this.editorUi.editor.graph,e=n.toggleCellStyles(t,e);this.editorUi.fireEvent(new mxEventObject("styleChanged","keys",[t],"values",[e],"cells",n.getSelectionCells()))},Menus.prototype.addMenuItem=function(t,e,n,i,l,s){var o=this.editorUi.actions.get(e);if(null!=o&&(t.showDisabled||o.isEnabled())&&o.visible){l=t.addItem(s||o.label,null,function(){o.funct(i)},n,l,o.isEnabled());return o.toggleAction&&o.isSelected()&&t.addCheckmark(l,Editor.checkmarkImage),this.addShortcut(l,o),l}return null},Menus.prototype.addShortcut=function(t,e){var n;null!=e.shortcut&&(n=t.firstChild.nextSibling.nextSibling,(t=document.createElement("span")).style.color="gray",mxUtils.write(t,e.shortcut),n.appendChild(t))},Menus.prototype.addMenuItems=function(t,e,n,i,l){for(var s=0;s<e.length;s++)"-"==e[s]?t.addSeparator(n):this.addMenuItem(t,e[s],n,i,null!=l?l[s]:null)},Menus.prototype.createPopupMenu=function(t,e,n){t.smartSeparators=!0,this.addPopupMenuHistoryItems(t,e,n),this.addPopupMenuEditItems(t,e,n),this.addPopupMenuStyleItems(t,e,n),this.addPopupMenuArrangeItems(t,e,n),this.addPopupMenuCellItems(t,e,n),this.addPopupMenuSelectionItems(t,e,n)},Menus.prototype.addPopupMenuHistoryItems=function(t,e,n){this.editorUi.editor.graph.isSelectionEmpty()&&this.addMenuItems(t,["undo","redo"],null,n)},Menus.prototype.addPopupMenuEditItems=function(t,e,n){this.editorUi.editor.graph.isSelectionEmpty()?this.addMenuItems(t,["pasteHere"],null,n):this.addMenuItems(t,["delete","-","cut","copy","-","duplicate"],null,n)},Menus.prototype.addPopupMenuStyleItems=function(t,e,n){1==this.editorUi.editor.graph.getSelectionCount()?this.addMenuItems(t,["-","setAsDefaultStyle"],null,n):this.editorUi.editor.graph.isSelectionEmpty()&&this.addMenuItems(t,["-","clearDefaultStyle"],null,n)},Menus.prototype.addPopupMenuArrangeItems=function(t,e,n){var i=this.editorUi.editor.graph;i.isSelectionEmpty()||this.addMenuItems(t,["-","toFront","toBack"],null,n),1<i.getSelectionCount()?this.addMenuItems(t,["-","group"],null,n):1==i.getSelectionCount()&&!i.getModel().isEdge(e)&&!i.isSwimlane(e)&&0<i.getModel().getChildCount(e)&&this.addMenuItems(t,["-","ungroup"],null,n)},Menus.prototype.addPopupMenuCellItems=function(t,e,n){var i=this.editorUi.editor.graph;e=i.getSelectionCell();var l,s,o,r,a,h=i.view.getState(e);t.addSeparator(),null!=h&&(a=!1,i.getModel().isEdge(e)&&"entityRelationEdgeStyle"!=mxUtils.getValue(h.style,mxConstants.STYLE_EDGE,null)&&"arrow"!=mxUtils.getValue(h.style,mxConstants.STYLE_SHAPE,null)&&(r=!1,(l=i.selectionCellsHandler.getHandler(e))instanceof mxEdgeHandler&&null!=l.bends&&2<l.bends.length&&(s=l.getHandleForEvent(i.updateMouseEvent(new mxMouseEvent(n))),(o=this.editorUi.actions.get("removeWaypoint")).handler=l,r=0<(o.index=s)&&s<l.bends.length-1),t.addSeparator(),this.addMenuItem(t,"turn",null,n,null,mxResources.get("reverse")),this.addMenuItems(t,[r?"removeWaypoint":"addWaypoint"],null,n),a=null!=(r=i.getModel().getGeometry(e))&&null!=r.points&&0<r.points.length),1==i.getSelectionCount()&&(a||i.getModel().isVertex(e)&&0<i.getModel().getEdgeCount(e))&&this.addMenuItems(t,["-","clearWaypoints"],null,n),1==i.getSelectionCount()&&(this.addMenuItems(t,["-","editStyle","editData","editLink"],null,n),i.getModel().isVertex(e)&&null!=mxUtils.getValue(h.style,mxConstants.STYLE_IMAGE,null)&&(t.addSeparator(),this.addMenuItem(t,"image",null,n).firstChild.nextSibling.innerHTML=mxResources.get("editImage")+"...")))},Menus.prototype.addPopupMenuSelectionItems=function(t,e,n){this.editorUi.editor.graph.isSelectionEmpty()&&this.addMenuItems(t,["-","selectVertices","selectEdges","selectAll"],null,n)},Menus.prototype.createMenubar=function(t){for(var n=new Menubar(this.editorUi,t),i=this.defaultMenuItems,l=0;l<i.length;l++)mxUtils.bind(this,function(t){var e=n.addMenu(mxResources.get(i[l]),mxUtils.bind(this,function(){t.funct.apply(this,arguments)}));this.menuCreated(t,e)})(this.get(i[l]));return n},Menus.prototype.menuCreated=function(t,e,n){null!=e&&(n=null!=n?n:"geItem",t.addListener("stateChanged",function(){e.enabled=t.enabled,t.enabled?(e.className=n,8==document.documentMode&&(e.style.color="")):(e.className=n+" mxDisabled",8==document.documentMode&&(e.style.color="#c3c3c3"))}))},Menubar.prototype.hideMenu=function(){this.editorUi.hideCurrentMenu()},Menubar.prototype.addMenu=function(t,e,n){var i=document.createElement("a");return i.className="geItem",mxUtils.write(i,t),this.addMenuHandler(i,e),null!=n?this.container.insertBefore(i,n):this.container.appendChild(i),i},Menubar.prototype.addMenuHandler=function(i,l){var s,e;null!=l&&(s=!0,e=mxUtils.bind(this,function(t){var e,n;(s&&null==i.enabled||i.enabled)&&(this.editorUi.editor.graph.popupMenuHandler.hideMenu(),(e=new mxPopupMenu(l,this.editorUi.container)).div.className+=" geMenubarMenu",e.smartSeparators=!0,e.showDisabled=!0,e.autoExpand=!0,e.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(e,arguments),this.editorUi.resetCurrentMenu(),e.destroy()}),n=mxUtils.getOffset(i,null,!0),e.popup(n.x,n.y+i.offsetHeight,null,t),this.editorUi.setCurrentMenu(e,i)),mxEvent.consume(t)}),mxEvent.addListener(i,"mousemove",mxUtils.bind(this,function(t){null!=this.editorUi.currentMenu&&this.editorUi.currentMenuElt!=i&&(this.editorUi.hideCurrentMenu(),e(t))})),mxEvent.addListener(i,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(t){s=this.currentElt!=i,t.preventDefault()})),mxEvent.addListener(i,"click",mxUtils.bind(this,function(t){e(t),s=!0})))},Menubar.prototype.destroy=function(){},mxUtils.extend(Menu,mxEventSource),Menu.prototype.isEnabled=function(){return this.enabled},Menu.prototype.setEnabled=function(t){this.enabled!=t&&(this.enabled=t,this.fireEvent(new mxEventObject("stateChanged")))},Menu.prototype.execute=function(t,e){this.funct(t,e)},EditorUi.prototype.createMenus=function(){return new Menus(this)},Toolbar.prototype.dropdownImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQANAIABAHt7e////yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpCREM1NkJFMjE0NEMxMUU1ODk1Q0M5MjQ0MTA4QjNDMSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpCREM1NkJFMzE0NEMxMUU1ODk1Q0M5MjQ0MTA4QjNDMSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkQzOUMzMjZCMTQ0QjExRTU4OTVDQzkyNDQxMDhCM0MxIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkQzOUMzMjZDMTQ0QjExRTU4OTVDQzkyNDQxMDhCM0MxIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAA0ADQAAAhGMj6nL3QAjVHIu6azbvPtWAAA7":IMAGE_PATH+"/dropdown.gif",Toolbar.prototype.dropdownImageHtml='<img border="0" style="position:absolute;right:4px;top:'+(EditorUi.compactUi?6:8)+'px;" src="'+Toolbar.prototype.dropdownImage+'" valign="middle"/>',Toolbar.prototype.selectedBackground="#d0d0d0",Toolbar.prototype.unselectedBackground="none",Toolbar.prototype.staticElements=null,Toolbar.prototype.init=function(){var t,e=screen.width;700<=(e-=740<screen.height?56:0)&&(t=this.addMenu("",mxResources.get("view")+" ("+mxResources.get("panTooltip")+")",!0,"viewPanels",null,!0),this.addDropDownArrow(t,"geSprite-formatpanel",38,50,-4,-3,36,-8),this.addSeparator());var n,i=this.addMenu("",mxResources.get("zoom")+" (Alt+Mousewheel)",!0,"viewZoom",null,!0);i.showDisabled=!0,i.style.whiteSpace="nowrap",i.style.position="relative",i.style.overflow="hidden",EditorUi.compactUi?i.style.width=mxClient.IS_QUIRKS?"58px":"50px":i.style.width=mxClient.IS_QUIRKS?"62px":"36px",420<=e&&(this.addSeparator(),(n=this.addItems(["zoomIn","zoomOut"]))[0].setAttribute("title",mxResources.get("zoomIn")+" ("+this.editorUi.actions.get("zoomIn").shortcut+")"),n[1].setAttribute("title",mxResources.get("zoomOut")+" ("+this.editorUi.actions.get("zoomOut").shortcut+")")),this.updateZoom=mxUtils.bind(this,function(){i.innerHTML=Math.round(100*this.editorUi.editor.graph.view.scale)+"%"+this.dropdownImageHtml,EditorUi.compactUi&&(i.getElementsByTagName("img")[0].style.right="1px",i.getElementsByTagName("img")[0].style.top="5px")}),this.editorUi.editor.graph.view.addListener(mxEvent.EVENT_SCALE,this.updateZoom),this.editorUi.editor.addListener("resetGraphView",this.updateZoom),(n=this.addItems(["-","undo","redo"]))[1].setAttribute("title",mxResources.get("undo")+" ("+this.editorUi.actions.get("undo").shortcut+")"),n[2].setAttribute("title",mxResources.get("redo")+" ("+this.editorUi.actions.get("redo").shortcut+")"),320<=e&&(n=this.addItems(["-","delete"]))[1].setAttribute("title",mxResources.get("delete")+" ("+this.editorUi.actions.get("delete").shortcut+")"),550<=e&&this.addItems(["-","toFront","toBack"]),740<=e&&(this.addItems(["-","fillColor"]),780<=e&&(this.addItems(["strokeColor"]),820<=e&&this.addItems(["shadow"]))),400<=e&&(this.addSeparator(),440<=e&&(this.edgeShapeMenu=this.addMenuFunction("",mxResources.get("connection"),!1,mxUtils.bind(this,function(t){this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_SHAPE,"width"],[null,null],"geIcon geSprite geSprite-connection",null,!0).setAttribute("title",mxResources.get("line")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_SHAPE,"width"],["link",null],"geIcon geSprite geSprite-linkedge",null,!0).setAttribute("title",mxResources.get("link")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_SHAPE,"width"],["flexArrow",null],"geIcon geSprite geSprite-arrow",null,!0).setAttribute("title",mxResources.get("arrow")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_SHAPE,"width"],["arrow",null],"geIcon geSprite geSprite-simplearrow",null,!0).setAttribute("title",mxResources.get("simpleArrow"))})),this.addDropDownArrow(this.edgeShapeMenu,"geSprite-connection",44,50,0,0,22,-4)),this.edgeStyleMenu=this.addMenuFunction("geSprite-orthogonal",mxResources.get("waypoints"),!1,mxUtils.bind(this,function(t){this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],[null,null,null],"geIcon geSprite geSprite-straight",null,!0).setAttribute("title",mxResources.get("straight")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["orthogonalEdgeStyle",null,null],"geIcon geSprite geSprite-orthogonal",null,!0).setAttribute("title",mxResources.get("orthogonal")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["elbowEdgeStyle",null,null,null],"geIcon geSprite geSprite-horizontalelbow",null,!0).setAttribute("title",mxResources.get("simple")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["elbowEdgeStyle","vertical",null,null],"geIcon geSprite geSprite-verticalelbow",null,!0).setAttribute("title",mxResources.get("simple")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["isometricEdgeStyle",null,null,null],"geIcon geSprite geSprite-horizontalisometric",null,!0).setAttribute("title",mxResources.get("isometric")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["isometricEdgeStyle","vertical",null,null],"geIcon geSprite geSprite-verticalisometric",null,!0).setAttribute("title",mxResources.get("isometric")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["orthogonalEdgeStyle","1",null],"geIcon geSprite geSprite-curved",null,!0).setAttribute("title",mxResources.get("curved")),this.editorUi.menus.edgeStyleChange(t,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["entityRelationEdgeStyle",null,null],"geIcon geSprite geSprite-entity",null,!0).setAttribute("title",mxResources.get("entityRelation"))})),this.addDropDownArrow(this.edgeStyleMenu,"geSprite-orthogonal",44,50,0,0,22,-4)),this.addSeparator();e=this.addMenu("",mxResources.get("insert")+" ("+mxResources.get("doubleClickTooltip")+")",!0,"insert",null,!0);this.addDropDownArrow(e,"geSprite-plus",38,48,-4,-3,36,-8),this.addTableDropDown()},Toolbar.prototype.addTableDropDown=function(){this.addSeparator();var t=this.addMenuFunction("geIcon geSprite geSprite-table",mxResources.get("table"),!1,mxUtils.bind(this,function(t){var e=this.editorUi.editor.graph,n=e.getSelectionCell();e.isTableCell(n)||e.isTableRow(n)||e.isTable(n)?(t.addItem("",null,mxUtils.bind(this,function(){try{e.insertTableColumn(n,!0)}catch(t){this.editorUi.handleError(t)}}),null,"geIcon geSprite geSprite-insertcolumnbefore").setAttribute("title",mxResources.get("insertColumnBefore")),t.addItem("",null,mxUtils.bind(this,function(){try{e.insertTableColumn(n,!1)}catch(t){this.editorUi.handleError(t)}}),null,"geIcon geSprite geSprite-insertcolumnafter").setAttribute("title",mxResources.get("insertColumnAfter")),t.addItem("Delete column",null,mxUtils.bind(this,function(){if(null!=n)try{e.deleteTableColumn(n)}catch(t){this.editorUi.handleError(t)}}),null,"geIcon geSprite geSprite-deletecolumn").setAttribute("title",mxResources.get("deleteColumn")),t.addItem("",null,mxUtils.bind(this,function(){try{e.insertTableRow(n,!0)}catch(t){this.editorUi.handleError(t)}}),null,"geIcon geSprite geSprite-insertrowbefore").setAttribute("title",mxResources.get("insertRowBefore")),t.addItem("",null,mxUtils.bind(this,function(){try{e.insertTableRow(n,!1)}catch(t){this.editorUi.handleError(t)}}),null,"geIcon geSprite geSprite-insertrowafter").setAttribute("title",mxResources.get("insertRowAfter")),t.addItem("",null,mxUtils.bind(this,function(){try{e.deleteTableRow(n)}catch(t){this.editorUi.handleError(t)}}),null,"geIcon geSprite geSprite-deleterow").setAttribute("title",mxResources.get("deleteRow"))):this.editorUi.menus.addInsertTableCellItem(t)}));t.style.position="relative",t.style.whiteSpace="nowrap",t.style.overflow="hidden",t.innerHTML='<div class="geSprite geSprite-table" style="margin-left:-2px;"></div>'+this.dropdownImageHtml,t.style.width=mxClient.IS_QUIRKS?"50px":"30px",EditorUi.compactUi&&(t.getElementsByTagName("img")[0].style.left="22px",t.getElementsByTagName("img")[0].style.top="5px");var e=this.editorUi.menus.get("insert");return null!=e&&"function"==typeof t.setEnabled&&e.addListener("stateChanged",function(){t.setEnabled(e.enabled)}),t},Toolbar.prototype.addDropDownArrow=function(t,e,n,i,l,s,o,r){o=null!=o?o:32,l=EditorUi.compactUi?l:r,t.style.whiteSpace="nowrap",t.style.overflow="hidden",t.style.position="relative",t.innerHTML='<div class="geSprite '+e+'" style="margin-left:'+l+"px;margin-top:"+s+'px;"></div>'+this.dropdownImageHtml,t.style.width=mxClient.IS_QUIRKS?i+"px":i-o+"px",mxClient.IS_QUIRKS&&(t.style.height=EditorUi.compactUi?"24px":"26px"),EditorUi.compactUi&&(t.getElementsByTagName("img")[0].style.left="24px",t.getElementsByTagName("img")[0].style.top="5px",t.style.width=mxClient.IS_QUIRKS?n+"px":n-10+"px")},Toolbar.prototype.setFontName=function(t){null!=this.fontMenu&&(this.fontMenu.innerHTML='<div style="width:60px;overflow:hidden;display:inline-block;">'+mxUtils.htmlEntities(t)+"</div>"+this.dropdownImageHtml)},Toolbar.prototype.setFontSize=function(t){null!=this.sizeMenu&&(this.sizeMenu.innerHTML='<div style="width:24px;overflow:hidden;display:inline-block;">'+mxUtils.htmlEntities(t)+"</div>"+this.dropdownImageHtml)},Toolbar.prototype.createTextToolbar=function(){var s=this.editorUi.editor.graph,t=this.addMenu("",mxResources.get("style"),!0,"formatBlock");t.style.position="relative",t.style.whiteSpace="nowrap",t.style.overflow="hidden",t.innerHTML=mxResources.get("style")+this.dropdownImageHtml,EditorUi.compactUi&&(t.style.paddingRight="18px",t.getElementsByTagName("img")[0].style.right="1px",t.getElementsByTagName("img")[0].style.top="5px"),this.addSeparator(),this.fontMenu=this.addMenu("",mxResources.get("fontFamily"),!0,"fontFamily"),this.fontMenu.style.position="relative",this.fontMenu.style.whiteSpace="nowrap",this.fontMenu.style.overflow="hidden",this.fontMenu.style.width=mxClient.IS_QUIRKS?"80px":"60px",this.setFontName(Menus.prototype.defaultFont),EditorUi.compactUi&&(this.fontMenu.style.paddingRight="18px",this.fontMenu.getElementsByTagName("img")[0].style.right="1px",this.fontMenu.getElementsByTagName("img")[0].style.top="5px"),this.addSeparator(),this.sizeMenu=this.addMenu(Menus.prototype.defaultFontSize,mxResources.get("fontSize"),!0,"fontSize"),this.sizeMenu.style.position="relative",this.sizeMenu.style.whiteSpace="nowrap",this.sizeMenu.style.overflow="hidden",this.sizeMenu.style.width=mxClient.IS_QUIRKS?"44px":"24px",this.setFontSize(Menus.prototype.defaultFontSize),EditorUi.compactUi&&(this.sizeMenu.style.paddingRight="18px",this.sizeMenu.getElementsByTagName("img")[0].style.right="1px",this.sizeMenu.getElementsByTagName("img")[0].style.top="5px");t=this.addItems(["-","undo","redo","-","bold","italic","underline"]);t[1].setAttribute("title",mxResources.get("undo")+" ("+this.editorUi.actions.get("undo").shortcut+")"),t[2].setAttribute("title",mxResources.get("redo")+" ("+this.editorUi.actions.get("redo").shortcut+")"),t[4].setAttribute("title",mxResources.get("bold")+" ("+this.editorUi.actions.get("bold").shortcut+")"),t[5].setAttribute("title",mxResources.get("italic")+" ("+this.editorUi.actions.get("italic").shortcut+")"),t[6].setAttribute("title",mxResources.get("underline")+" ("+this.editorUi.actions.get("underline").shortcut+")");t=this.addMenuFunction("",mxResources.get("align"),!1,mxUtils.bind(this,function(t){(e=t.addItem("",null,mxUtils.bind(this,function(t){s.cellEditor.alignText(mxConstants.ALIGN_LEFT,t)}),null,"geIcon geSprite geSprite-left")).setAttribute("title",mxResources.get("left")),(e=t.addItem("",null,mxUtils.bind(this,function(t){s.cellEditor.alignText(mxConstants.ALIGN_CENTER,t)}),null,"geIcon geSprite geSprite-center")).setAttribute("title",mxResources.get("center")),(e=t.addItem("",null,mxUtils.bind(this,function(t){s.cellEditor.alignText(mxConstants.ALIGN_RIGHT,t)}),null,"geIcon geSprite geSprite-right")).setAttribute("title",mxResources.get("right")),(e=t.addItem("",null,mxUtils.bind(this,function(){document.execCommand("justifyfull",!1,null)}),null,"geIcon geSprite geSprite-justifyfull")).setAttribute("title",mxResources.get("justifyfull")),(e=t.addItem("",null,mxUtils.bind(this,function(){document.execCommand("insertorderedlist",!1,null)}),null,"geIcon geSprite geSprite-orderedlist")).setAttribute("title",mxResources.get("numberedList")),(e=t.addItem("",null,mxUtils.bind(this,function(){document.execCommand("insertunorderedlist",!1,null)}),null,"geIcon geSprite geSprite-unorderedlist")).setAttribute("title",mxResources.get("bulletedList")),(e=t.addItem("",null,mxUtils.bind(this,function(){document.execCommand("outdent",!1,null)}),null,"geIcon geSprite geSprite-outdent")).setAttribute("title",mxResources.get("decreaseIndent")),(e=t.addItem("",null,mxUtils.bind(this,function(){document.execCommand("indent",!1,null)}),null,"geIcon geSprite geSprite-indent")).setAttribute("title",mxResources.get("increaseIndent"))}));t.style.position="relative",t.style.whiteSpace="nowrap",t.style.overflow="hidden",t.innerHTML='<div class="geSprite geSprite-left" style="margin-left:-2px;"></div>'+this.dropdownImageHtml,t.style.width=mxClient.IS_QUIRKS?"50px":"30px",EditorUi.compactUi&&(t.getElementsByTagName("img")[0].style.left="22px",t.getElementsByTagName("img")[0].style.top="5px");t=this.addMenuFunction("",mxResources.get("format"),!1,mxUtils.bind(this,function(t){(e=t.addItem("",null,this.editorUi.actions.get("subscript").funct,null,"geIcon geSprite geSprite-subscript")).setAttribute("title",mxResources.get("subscript")+" ("+Editor.ctrlKey+"+,)"),(e=t.addItem("",null,this.editorUi.actions.get("superscript").funct,null,"geIcon geSprite geSprite-superscript")).setAttribute("title",mxResources.get("superscript")+" ("+Editor.ctrlKey+"+.)"),(e=t.addItem("",null,this.editorUi.actions.get("fontColor").funct,null,"geIcon geSprite geSprite-fontcolor")).setAttribute("title",mxResources.get("fontColor")),(e=t.addItem("",null,this.editorUi.actions.get("backgroundColor").funct,null,"geIcon geSprite geSprite-fontbackground")).setAttribute("title",mxResources.get("backgroundColor")),(e=t.addItem("",null,mxUtils.bind(this,function(){document.execCommand("removeformat",!1,null)}),null,"geIcon geSprite geSprite-removeformat")).setAttribute("title",mxResources.get("removeFormat"))}));t.style.position="relative",t.style.whiteSpace="nowrap",t.style.overflow="hidden",t.innerHTML='<div class="geSprite geSprite-dots" style="margin-left:-2px;"></div>'+this.dropdownImageHtml,t.style.width=mxClient.IS_QUIRKS?"50px":"30px",EditorUi.compactUi&&(t.getElementsByTagName("img")[0].style.left="22px",t.getElementsByTagName("img")[0].style.top="5px"),this.addSeparator(),this.addButton("geIcon geSprite geSprite-code",mxResources.get("html"),function(){s.cellEditor.toggleViewMode(),0<s.cellEditor.textarea.innerHTML.length&&("&nbsp;"!=s.cellEditor.textarea.innerHTML||!s.cellEditor.clearOnChange)&&window.setTimeout(function(){document.execCommand("selectAll",!1,null)})}),this.addSeparator();t=this.addMenuFunction("",mxResources.get("insert"),!0,mxUtils.bind(this,function(t){t.addItem(mxResources.get("insertLink"),null,mxUtils.bind(this,function(){this.editorUi.actions.get("link").funct()})),t.addItem(mxResources.get("insertImage"),null,mxUtils.bind(this,function(){this.editorUi.actions.get("image").funct()})),t.addItem(mxResources.get("insertHorizontalRule"),null,mxUtils.bind(this,function(){document.execCommand("inserthorizontalrule",!1,null)}))}));t.style.whiteSpace="nowrap",t.style.overflow="hidden",t.style.position="relative",t.innerHTML='<div class="geSprite geSprite-plus" style="margin-left:-4px;margin-top:-3px;"></div>'+this.dropdownImageHtml,t.style.width=mxClient.IS_QUIRKS?"36px":"16px",EditorUi.compactUi&&(t.getElementsByTagName("img")[0].style.left="24px",t.getElementsByTagName("img")[0].style.top="5px",t.style.width=mxClient.IS_QUIRKS?"50px":"30px"),this.addSeparator();var e=this.addMenuFunction("geIcon geSprite geSprite-table",mxResources.get("table"),!1,mxUtils.bind(this,function(t){var e,n=s.getSelectedElement(),i=s.getParentByNames(n,["TD","TH"],s.cellEditor.text2),l=s.getParentByName(n,"TR",s.cellEditor.text2);null==l?this.editorUi.menus.addInsertTableItem(t):(e=s.getParentByName(l,"TABLE",s.cellEditor.text2),(n=t.addItem("",null,mxUtils.bind(this,function(){try{s.selectNode(s.insertColumn(e,null!=i?i.cellIndex:0))}catch(t){this.editorUi.handleError(t)}}),null,"geIcon geSprite geSprite-insertcolumnbefore")).setAttribute("title",mxResources.get("insertColumnBefore")),(n=t.addItem("",null,mxUtils.bind(this,function(){try{s.selectNode(s.insertColumn(e,null!=i?i.cellIndex+1:-1))}catch(t){this.editorUi.handleError(t)}}),null,"geIcon geSprite geSprite-insertcolumnafter")).setAttribute("title",mxResources.get("insertColumnAfter")),(n=t.addItem("Delete column",null,mxUtils.bind(this,function(){if(null!=i)try{s.deleteColumn(e,i.cellIndex)}catch(t){this.editorUi.handleError(t)}}),null,"geIcon geSprite geSprite-deletecolumn")).setAttribute("title",mxResources.get("deleteColumn")),(n=t.addItem("",null,mxUtils.bind(this,function(){try{s.selectNode(s.insertRow(e,l.sectionRowIndex))}catch(t){this.editorUi.handleError(t)}}),null,"geIcon geSprite geSprite-insertrowbefore")).setAttribute("title",mxResources.get("insertRowBefore")),(n=t.addItem("",null,mxUtils.bind(this,function(){try{s.selectNode(s.insertRow(e,l.sectionRowIndex+1))}catch(t){this.editorUi.handleError(t)}}),null,"geIcon geSprite geSprite-insertrowafter")).setAttribute("title",mxResources.get("insertRowAfter")),(n=t.addItem("",null,mxUtils.bind(this,function(){try{s.deleteRow(e,l.sectionRowIndex)}catch(t){this.editorUi.handleError(t)}}),null,"geIcon geSprite geSprite-deleterow")).setAttribute("title",mxResources.get("deleteRow")),(n=t.addItem("",null,mxUtils.bind(this,function(){var t=e.style.borderColor.replace(/\brgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/g,function(t,e,n,i){return"#"+("0"+Number(e).toString(16)).substr(-2)+("0"+Number(n).toString(16)).substr(-2)+("0"+Number(i).toString(16)).substr(-2)});this.editorUi.pickColor(t,function(t){null==t||t==mxConstants.NONE?(e.removeAttribute("border"),e.style.border="",e.style.borderCollapse=""):(e.setAttribute("border","1"),e.style.border="1px solid "+t,e.style.borderCollapse="collapse")})}),null,"geIcon geSprite geSprite-strokecolor")).setAttribute("title",mxResources.get("borderColor")),(n=t.addItem("",null,mxUtils.bind(this,function(){var t=e.style.backgroundColor.replace(/\brgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/g,function(t,e,n,i){return"#"+("0"+Number(e).toString(16)).substr(-2)+("0"+Number(n).toString(16)).substr(-2)+("0"+Number(i).toString(16)).substr(-2)});this.editorUi.pickColor(t,function(t){null==t||t==mxConstants.NONE?e.style.backgroundColor="":e.style.backgroundColor=t})}),null,"geIcon geSprite geSprite-fillcolor")).setAttribute("title",mxResources.get("backgroundColor")),(n=t.addItem("",null,mxUtils.bind(this,function(){var t=e.getAttribute("cellPadding")||0,t=new FilenameDialog(this.editorUi,t,mxResources.get("apply"),mxUtils.bind(this,function(t){null!=t&&0<t.length?e.setAttribute("cellPadding",t):e.removeAttribute("cellPadding")}),mxResources.get("spacing"));this.editorUi.showDialog(t.container,300,80,!0,!0),t.init()}),null,"geIcon geSprite geSprite-fit")).setAttribute("title",mxResources.get("spacing")),(n=t.addItem("",null,mxUtils.bind(this,function(){e.setAttribute("align","left")}),null,"geIcon geSprite geSprite-left")).setAttribute("title",mxResources.get("left")),(n=t.addItem("",null,mxUtils.bind(this,function(){e.setAttribute("align","center")}),null,"geIcon geSprite geSprite-center")).setAttribute("title",mxResources.get("center")),(n=t.addItem("",null,mxUtils.bind(this,function(){e.setAttribute("align","right")}),null,"geIcon geSprite geSprite-right")).setAttribute("title",mxResources.get("right")))}));e.style.position="relative",e.style.whiteSpace="nowrap",e.style.overflow="hidden",e.innerHTML='<div class="geSprite geSprite-table" style="margin-left:-2px;"></div>'+this.dropdownImageHtml,e.style.width=mxClient.IS_QUIRKS?"50px":"30px",EditorUi.compactUi&&(e.getElementsByTagName("img")[0].style.left="22px",e.getElementsByTagName("img")[0].style.top="5px")},Toolbar.prototype.hideMenu=function(){this.editorUi.hideCurrentMenu()},Toolbar.prototype.addMenu=function(t,e,n,i,l,s,o){var r=this.editorUi.menus.get(i),a=this.addMenuFunction(t,e,n,function(){r.funct.apply(r,arguments)},l,s);return o||"function"!=typeof a.setEnabled||r.addListener("stateChanged",function(){a.setEnabled(r.enabled)}),a},Toolbar.prototype.addMenuFunction=function(t,e,n,i,l,s){return this.addMenuFunctionInContainer(null!=l?l:this.container,t,e,n,i,s)},Toolbar.prototype.addMenuFunctionInContainer=function(t,e,n,i,l,s){e=i?this.createLabel(e):this.createButton(e);return this.initElement(e,n),this.addMenuHandler(e,i,l,s),t.appendChild(e),e},Toolbar.prototype.addSeparator=function(t){t=null!=t?t:this.container;var e=document.createElement("div");return e.className="geSeparator",t.appendChild(e),e},Toolbar.prototype.addItems=function(t,e,n){for(var i=[],l=0;l<t.length;l++){var s=t[l];"-"==s?i.push(this.addSeparator(e)):i.push(this.addItem("geSprite-"+s.toLowerCase(),s,e,n))}return i},Toolbar.prototype.addItem=function(t,e,n,i){var l=this.editorUi.actions.get(e),s=null;return null!=l&&(e=l.label,null!=l.shortcut&&(e+=" ("+l.shortcut+")"),s=this.addButton(t,e,l.funct,n),i||"function"!=typeof s.setEnabled||(s.setEnabled(l.enabled),l.addListener("stateChanged",function(){s.setEnabled(l.enabled)}))),s},Toolbar.prototype.addButton=function(t,e,n,i){t=this.createButton(t);return i=null!=i?i:this.container,this.initElement(t,e),this.addClickHandler(t,n),i.appendChild(t),t},Toolbar.prototype.initElement=function(t,e){null!=e&&t.setAttribute("title",e),this.addEnabledState(t)},Toolbar.prototype.addEnabledState=function(e){var n=e.className;e.setEnabled=function(t){e.enabled=t,e.className=t?n:n+" mxDisabled"},e.setEnabled(!0)},Toolbar.prototype.addClickHandler=function(e,n){null!=n&&(mxEvent.addListener(e,"click",function(t){e.enabled&&n(t),mxEvent.consume(t)}),mxEvent.addListener(e,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(t){t.preventDefault()})))},Toolbar.prototype.createButton=function(t){var e=document.createElement("a");e.className="geButton";var n=document.createElement("div");return null!=t&&(n.className="geSprite "+t),e.appendChild(n),e},Toolbar.prototype.createLabel=function(t,e){var n=document.createElement("a");return n.className="geLabel",mxUtils.write(n,t),n},Toolbar.prototype.addMenuHandler=function(n,i,l,s){var o,r,a;null!=l&&(o=this.editorUi.editor.graph,a=!(r=null),mxEvent.addListener(n,"click",mxUtils.bind(this,function(t){var e;a&&(null==n.enabled||n.enabled)&&(o.popupMenuHandler.hideMenu(),(r=new mxPopupMenu(l,this.editorUi.container)).div.className+=" geToolbarMenu",r.showDisabled=s,r.labels=i,r.autoExpand=!0,e=mxUtils.getOffset(n,null,!0),r.popup(e.x,e.y+60,null,t),this.editorUi.setCurrentMenu(r,n),!i&&r.div.scrollHeight>r.div.clientHeight&&(r.div.style.width="40px"),r.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(r,arguments),this.editorUi.resetCurrentMenu(),r.destroy()}),r.addListener(mxEvent.EVENT_HIDE,mxUtils.bind(this,function(){this.currentElt=null}))),a=!0,mxEvent.consume(t)})),mxEvent.addListener(n,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(t){a=this.currentElt!=n,t.preventDefault()})))},Toolbar.prototype.destroy=function(){null!=this.gestureHandler&&(mxEvent.removeGestureListeners(document,this.gestureHandler),this.gestureHandler=null)};var OpenDialog=function(){var t=document.createElement("iframe");t.style.backgroundColor="transparent",t.allowTransparency="true",t.style.borderStyle="none",t.style.borderWidth="0px",t.style.overflow="hidden",t.frameBorder="0";var e=mxClient.IS_VML&&(null==document.documentMode||document.documentMode<8)?20:0;t.setAttribute("width",(Editor.useLocalStorage?640:320)+e+"px"),t.setAttribute("height",(Editor.useLocalStorage?480:220)+e+"px"),t.setAttribute("src",OPEN_FORM),this.container=t},ColorDialog=function(e,t,n,i){this.editorUi=e;var d=document.createElement("input");d.style.marginBottom="10px",d.style.width="216px",mxClient.IS_IE&&(d.style.marginTop="10px",document.body.appendChild(d));var l=null!=n?n:this.createApplyFunction();function u(){var t=d.value;/(^#?[a-zA-Z0-9]*$)/.test(t)?("none"!=t&&"#"!=t.charAt(0)&&(t="#"+t),ColorDialog.addRecentColor("none"!=t?t.substring(1):t,12),l(t),e.hideDialog()):e.handleError({message:mxResources.get("invalidInput")})}this.init=function(){mxClient.IS_TOUCH||d.focus()};var p=new mxJSColor.color(d);p.pickerOnfocus=!1,p.showPicker();var s=document.createElement("div");mxJSColor.picker.box.style.position="relative",mxJSColor.picker.box.style.width="230px",mxJSColor.picker.box.style.height="100px",mxJSColor.picker.box.style.paddingBottom="10px",s.appendChild(mxJSColor.picker.box);var m=document.createElement("center");function c(){var t=o(0==ColorDialog.recentColors.length?["FFFFFF"]:ColorDialog.recentColors,11,"FFFFFF",!0);return t.style.marginBottom="8px",t}function o(t,e,n,i){e=null!=e?e:12;var l=document.createElement("table");l.style.borderCollapse="collapse",l.setAttribute("cellspacing","0"),l.style.marginBottom="20px",l.style.cellSpacing="0px";var s=document.createElement("tbody");l.appendChild(s);for(var o=t.length/e,r=0;r<o;r++){for(var a=document.createElement("tr"),h=0;h<e;h++)!function(t){var e=document.createElement("td");e.style.border="1px solid black",e.style.padding="0px",e.style.width="16px",e.style.height="16px",null==t&&(t=n),"none"==t?e.style.background="url('"+Dialog.prototype.noColorImage+"')":e.style.backgroundColor="#"+t,a.appendChild(e),null!=t&&(e.style.cursor="pointer",mxEvent.addListener(e,"click",function(){"none"==t?(p.fromString("ffffff"),d.value="none"):p.fromString(t)}),mxEvent.addListener(e,"dblclick",u))}(t[r*e+h]);s.appendChild(a)}return i&&((i=document.createElement("td")).setAttribute("title",mxResources.get("reset")),i.style.border="1px solid black",i.style.padding="0px",i.style.width="16px",i.style.height="16px",i.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')",i.style.backgroundPosition="center center",i.style.backgroundRepeat="no-repeat",i.style.cursor="pointer",a.appendChild(i),mxEvent.addListener(i,"click",function(){ColorDialog.resetRecentColors(),l.parentNode.replaceChild(c(),l)})),m.appendChild(l),l}s.appendChild(d),mxUtils.br(s),c();var r=o(this.presetColors);r.style.marginBottom="8px",(r=o(this.defaultColors)).style.marginBottom="16px",s.appendChild(m);var a=document.createElement("div");a.style.textAlign="right",a.style.whiteSpace="nowrap";n=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog(),null!=i&&i()});n.className="geBtn",e.editor.cancelFirst&&a.appendChild(n);r=mxUtils.button(mxResources.get("apply"),u);r.className="geBtn gePrimaryBtn",a.appendChild(r),e.editor.cancelFirst||a.appendChild(n),null!=t&&("none"==t?(p.fromString("ffffff"),d.value="none"):p.fromString(t)),s.appendChild(a),this.picker=p,this.colorInput=d,mxEvent.addListener(s,"keydown",function(t){27==t.keyCode&&(e.hideDialog(),null!=i&&i(),mxEvent.consume(t))}),this.container=s};ColorDialog.prototype.presetColors=["E6D0DE","CDA2BE","B5739D","E1D5E7","C3ABD0","A680B8","D4E1F5","A9C4EB","7EA6E0","D5E8D4","9AC7BF","67AB9F","D5E8D4","B9E0A5","97D077","FFF2CC","FFE599","FFD966","FFF4C3","FFCE9F","FFB570","F8CECC","F19C99","EA6B66"],ColorDialog.prototype.defaultColors=["none","FFFFFF","E6E6E6","CCCCCC","B3B3B3","999999","808080","666666","4D4D4D","333333","1A1A1A","000000","FFCCCC","FFE6CC","FFFFCC","E6FFCC","CCFFCC","CCFFE6","CCFFFF","CCE5FF","CCCCFF","E5CCFF","FFCCFF","FFCCE6","FF9999","FFCC99","FFFF99","CCFF99","99FF99","99FFCC","99FFFF","99CCFF","9999FF","CC99FF","FF99FF","FF99CC","FF6666","FFB366","FFFF66","B3FF66","66FF66","66FFB3","66FFFF","66B2FF","6666FF","B266FF","FF66FF","FF66B3","FF3333","FF9933","FFFF33","99FF33","33FF33","33FF99","33FFFF","3399FF","3333FF","9933FF","FF33FF","FF3399","FF0000","FF8000","FFFF00","80FF00","00FF00","00FF80","00FFFF","007FFF","0000FF","7F00FF","FF00FF","FF0080","CC0000","CC6600","CCCC00","66CC00","00CC00","00CC66","00CCCC","0066CC","0000CC","6600CC","CC00CC","CC0066","990000","994C00","999900","4D9900","009900","00994D","009999","004C99","000099","4C0099","990099","99004D","660000","663300","666600","336600","006600","006633","006666","003366","000066","330066","660066","660033","330000","331A00","333300","1A3300","003300","00331A","003333","001933","000033","190033","330033","33001A"],ColorDialog.prototype.createApplyFunction=function(){return mxUtils.bind(this,function(t){var e=this.editorUi.editor.graph;e.getModel().beginUpdate();try{e.setCellStyles(this.currentColorKey,t),this.editorUi.fireEvent(new mxEventObject("styleChanged","keys",[this.currentColorKey],"values",[t],"cells",e.getSelectionCells()))}finally{e.getModel().endUpdate()}})},ColorDialog.recentColors=[],ColorDialog.addRecentColor=function(t,e){null!=t&&(mxUtils.remove(t,ColorDialog.recentColors),ColorDialog.recentColors.splice(0,0,t),ColorDialog.recentColors.length>=e&&ColorDialog.recentColors.pop())},ColorDialog.resetRecentColors=function(){ColorDialog.recentColors=[]};var AboutDialog=function(t){var e=document.createElement("div");e.setAttribute("align","center");var n=document.createElement("h3");mxUtils.write(n,mxResources.get("about")+" GraphEditor"),e.appendChild(n);n=document.createElement("img");n.style.border="0px",n.setAttribute("width","176"),n.setAttribute("width","151"),n.setAttribute("src",IMAGE_PATH+"/logo.png"),e.appendChild(n),mxUtils.br(e),mxUtils.write(e,"Powered by mxGraph "+mxClient.VERSION),mxUtils.br(e);n=document.createElement("a");n.setAttribute("href","http://www.jgraph.com/"),n.setAttribute("target","_blank"),mxUtils.write(n,"www.jgraph.com"),e.appendChild(n),mxUtils.br(e),mxUtils.br(e);n=mxUtils.button(mxResources.get("close"),function(){t.hideDialog()});n.className="geBtn gePrimaryBtn",e.appendChild(n),this.container=e},TextareaDialog=function(t,e,n,i,l,s,o,r,a,h,d,u,p,m){o=null!=o?o:300,r=null!=r?r:120,h=null!=h&&h;var c,g=document.createElement("table"),x=document.createElement("tbody"),y=document.createElement("tr");(c=document.createElement("td")).style.fontSize="10pt",c.style.width="100px",mxUtils.write(c,e),y.appendChild(c),x.appendChild(y),y=document.createElement("tr"),c=document.createElement("td");var f=document.createElement("textarea");if(d&&f.setAttribute("wrap","off"),f.setAttribute("spellcheck","false"),f.setAttribute("autocorrect","off"),f.setAttribute("autocomplete","off"),f.setAttribute("autocapitalize","off"),mxUtils.write(f,n||""),f.style.resize="none",f.style.width=o+"px",f.style.height=r+"px",this.textarea=f,this.init=function(){f.focus(),f.scrollTop=0},c.appendChild(f),y.appendChild(c),x.appendChild(y),y=document.createElement("tr"),(c=document.createElement("td")).style.paddingTop="14px",c.style.whiteSpace="nowrap",c.setAttribute("align","right"),null!=p&&((r=mxUtils.button(mxResources.get("help"),function(){t.editor.graph.openLink(p)})).className="geBtn",c.appendChild(r)),null!=m)for(var C=0;C<m.length;C++)!function(t,e){(t=mxUtils.button(t,function(t){e(t,f)})).className="geBtn",c.appendChild(t)}(m[C][0],m[C][1]);s=mxUtils.button(s||mxResources.get("cancel"),function(){t.hideDialog(),null!=l&&l()});s.className="geBtn",t.editor.cancelFirst&&c.appendChild(s),null!=a&&a(c,f),null!=i&&((u=mxUtils.button(u||mxResources.get("apply"),function(){h||t.hideDialog(),i(f.value)})).className="geBtn gePrimaryBtn",c.appendChild(u)),t.editor.cancelFirst||c.appendChild(s),y.appendChild(c),x.appendChild(y),g.appendChild(x),this.container=g},EditDiagramDialog=function(l){var t=document.createElement("div");t.style.textAlign="right";var s=document.createElement("textarea");s.setAttribute("wrap","off"),s.setAttribute("spellcheck","false"),s.setAttribute("autocorrect","off"),s.setAttribute("autocomplete","off"),s.setAttribute("autocapitalize","off"),s.style.overflow="auto",s.style.resize="none",s.style.width="600px",s.style.height="360px",s.style.marginBottom="16px",s.value=mxUtils.getPrettyXml(l.editor.getGraphXml()),t.appendChild(s),this.init=function(){s.focus()},Graph.fileSupport&&(s.addEventListener("dragover",function(t){t.stopPropagation(),t.preventDefault()},!1),s.addEventListener("drop",function(t){var e,n;t.stopPropagation(),t.preventDefault(),0<t.dataTransfer.files.length?(e=t.dataTransfer.files[0],(n=new FileReader).onload=function(t){s.value=t.target.result},n.readAsText(e)):s.value=l.extractGraphModelFromEvent(t)},!1));var e=mxUtils.button(mxResources.get("cancel"),function(){l.hideDialog()});e.className="geBtn",l.editor.cancelFirst&&t.appendChild(e);var o=document.createElement("select");o.style.width="180px",o.className="geBtn",l.editor.graph.isEnabled()&&((n=document.createElement("option")).setAttribute("value","replace"),mxUtils.write(n,mxResources.get("replaceExistingDrawing")),o.appendChild(n));var n=document.createElement("option");n.setAttribute("value","new"),mxUtils.write(n,mxResources.get("openInNewWindow")),EditDiagramDialog.showNewWindowOption&&o.appendChild(n),l.editor.graph.isEnabled()&&((i=document.createElement("option")).setAttribute("value","import"),mxUtils.write(i,mxResources.get("addToExistingDrawing")),o.appendChild(i)),t.appendChild(o);var i=mxUtils.button(mxResources.get("ok"),function(){var t=Graph.zapGremlins(mxUtils.trim(s.value)),e=null;if("new"==o.value)l.hideDialog(),l.editor.editAsNew(t);else if("replace"==o.value){l.editor.graph.model.beginUpdate();try{l.editor.setGraphXml(mxUtils.parseXml(t).documentElement),l.hideDialog()}catch(t){e=t}finally{l.editor.graph.model.endUpdate()}}else if("import"==o.value){l.editor.graph.model.beginUpdate();try{var n=mxUtils.parseXml(t),i=new mxGraphModel;new mxCodec(n).decode(n.documentElement,i);i=i.getChildren(i.getChildAt(i.getRoot(),0));l.editor.graph.setSelectionCells(l.editor.graph.importCells(i)),l.hideDialog()}catch(t){e=t}finally{l.editor.graph.model.endUpdate()}}null!=e&&mxUtils.alert(e.message)});i.className="geBtn gePrimaryBtn",t.appendChild(i),l.editor.cancelFirst||t.appendChild(e),this.container=t};EditDiagramDialog.showNewWindowOption=!0;var ExportDialog=function(o){var t,r=o.editor.graph,e=r.getGraphBounds(),n=r.view.scale,i=Math.ceil(e.width/n),l=Math.ceil(e.height/n),s=document.createElement("table"),a=document.createElement("tbody");s.setAttribute("cellpadding",mxClient.IS_SF?"0":"2"),t=document.createElement("tr"),(e=document.createElement("td")).style.fontSize="10pt",e.style.width="100px",mxUtils.write(e,mxResources.get("filename")+":"),t.appendChild(e);var h=document.createElement("input");h.setAttribute("value",o.editor.getOrCreateFilename()),h.style.width="180px",(e=document.createElement("td")).appendChild(h),t.appendChild(e),a.appendChild(t),t=document.createElement("tr"),(e=document.createElement("td")).style.fontSize="10pt",mxUtils.write(e,mxResources.get("format")+":"),t.appendChild(e);var d=document.createElement("select");d.style.width="180px";n=document.createElement("option");n.setAttribute("value","png"),mxUtils.write(n,mxResources.get("formatPng")),d.appendChild(n);n=document.createElement("option");ExportDialog.showGifOption&&(n.setAttribute("value","gif"),mxUtils.write(n,mxResources.get("formatGif")),d.appendChild(n));n=document.createElement("option");n.setAttribute("value","jpg"),mxUtils.write(n,mxResources.get("formatJpg")),d.appendChild(n);n=document.createElement("option");n.setAttribute("value","pdf"),mxUtils.write(n,mxResources.get("formatPdf")),d.appendChild(n);n=document.createElement("option");n.setAttribute("value","svg"),mxUtils.write(n,mxResources.get("formatSvg")),d.appendChild(n),ExportDialog.showXmlOption&&((g=document.createElement("option")).setAttribute("value","xml"),mxUtils.write(g,mxResources.get("formatXml")),d.appendChild(g)),(e=document.createElement("td")).appendChild(d),t.appendChild(e),a.appendChild(t),t=document.createElement("tr"),(e=document.createElement("td")).style.fontSize="10pt",mxUtils.write(e,mxResources.get("zoom")+" (%):"),t.appendChild(e);var u=document.createElement("input");u.setAttribute("type","number"),u.setAttribute("value","100"),u.style.width="180px",(e=document.createElement("td")).appendChild(u),t.appendChild(e),a.appendChild(t),t=document.createElement("tr"),(e=document.createElement("td")).style.fontSize="10pt",mxUtils.write(e,mxResources.get("width")+":"),t.appendChild(e);var p=document.createElement("input");p.setAttribute("value",i),p.style.width="180px",(e=document.createElement("td")).appendChild(p),t.appendChild(e),a.appendChild(t),t=document.createElement("tr"),(e=document.createElement("td")).style.fontSize="10pt",mxUtils.write(e,mxResources.get("height")+":"),t.appendChild(e);var m=document.createElement("input");m.setAttribute("value",l),m.style.width="180px",(e=document.createElement("td")).appendChild(m),t.appendChild(e),a.appendChild(t),t=document.createElement("tr"),(e=document.createElement("td")).style.fontSize="10pt",mxUtils.write(e,mxResources.get("dpi")+":"),t.appendChild(e);var c=document.createElement("select");c.style.width="180px";n=document.createElement("option");n.setAttribute("value","100"),mxUtils.write(n,"100dpi"),c.appendChild(n);var g=document.createElement("option");g.setAttribute("value","200"),mxUtils.write(g,"200dpi"),c.appendChild(g);n=document.createElement("option");n.setAttribute("value","300"),mxUtils.write(n,"300dpi"),c.appendChild(n);g=document.createElement("option");g.setAttribute("value","400"),mxUtils.write(g,"400dpi"),c.appendChild(g);n=document.createElement("option");n.setAttribute("value","custom"),mxUtils.write(n,mxResources.get("custom")),c.appendChild(n);var x=document.createElement("input");x.style.width="180px",x.style.display="none",x.setAttribute("value","100"),x.setAttribute("type","number"),x.setAttribute("min","50"),x.setAttribute("step","50");var y=!1;mxEvent.addListener(c,"change",function(){"custom"==this.value?(this.style.display="none",x.style.display="",x.focus()):(x.value=this.value,y||(u.value=this.value))}),mxEvent.addListener(x,"change",function(){var t=parseInt(x.value);isNaN(t)||t<=0?x.style.backgroundColor="red":(x.style.backgroundColor="",y||(u.value=t))}),(e=document.createElement("td")).appendChild(c),e.appendChild(x),t.appendChild(e),a.appendChild(t),t=document.createElement("tr"),(e=document.createElement("td")).style.fontSize="10pt",mxUtils.write(e,mxResources.get("background")+":"),t.appendChild(e);var f=document.createElement("input");f.setAttribute("type","checkbox"),f.checked=null==r.background||r.background==mxConstants.NONE,(e=document.createElement("td")).appendChild(f),mxUtils.write(e,mxResources.get("transparent")),t.appendChild(e),a.appendChild(t),t=document.createElement("tr"),(e=document.createElement("td")).style.fontSize="10pt",mxUtils.write(e,mxResources.get("borderWidth")+":"),t.appendChild(e);var C=document.createElement("input");function v(){var t=h.value,e=t.lastIndexOf(".");h.value=0<e?t.substring(0,e+1)+d.value:t+"."+d.value,"xml"===d.value?(u.setAttribute("disabled","true"),p.setAttribute("disabled","true"),m.setAttribute("disabled","true"),C.setAttribute("disabled","true")):(u.removeAttribute("disabled"),p.removeAttribute("disabled"),m.removeAttribute("disabled"),C.removeAttribute("disabled")),"png"===d.value||"svg"===d.value||"pdf"===d.value?f.removeAttribute("disabled"):f.setAttribute("disabled","disabled"),"png"===d.value?(c.removeAttribute("disabled"),x.removeAttribute("disabled")):(c.setAttribute("disabled","disabled"),x.setAttribute("disabled","disabled"))}function E(){p.value*m.value>MAX_AREA||p.value<=0?p.style.backgroundColor="red":p.style.backgroundColor="",p.value*m.value>MAX_AREA||m.value<=0?m.style.backgroundColor="red":m.style.backgroundColor=""}C.setAttribute("type","number"),C.setAttribute("value",ExportDialog.lastBorderValue),C.style.width="180px",(e=document.createElement("td")).appendChild(C),t.appendChild(e),a.appendChild(t),s.appendChild(a),mxEvent.addListener(d,"change",v),v(),mxEvent.addListener(u,"change",function(){y=!0;var t=Math.max(0,parseFloat(u.value)||100)/100;u.value=parseFloat((100*t).toFixed(2)),0<i?(p.value=Math.floor(i*t),m.value=Math.floor(l*t)):(u.value="100",p.value=i,m.value=l),E()}),mxEvent.addListener(p,"change",function(){var t=parseInt(p.value)/i;0<t?(u.value=parseFloat((100*t).toFixed(2)),m.value=Math.floor(l*t)):(u.value="100",p.value=i,m.value=l),E()}),mxEvent.addListener(m,"change",function(){var t=parseInt(m.value)/l;0<t?(u.value=parseFloat((100*t).toFixed(2)),p.value=Math.floor(i*t)):(u.value="100",p.value=i,m.value=l),E()}),t=document.createElement("tr"),(e=document.createElement("td")).setAttribute("align","right"),e.style.paddingTop="22px",e.colSpan=2;g=mxUtils.button(mxResources.get("export"),mxUtils.bind(this,function(){var t,e,n,i,l,s;parseInt(u.value)<=0?mxUtils.alert(mxResources.get("drawingEmpty")):(t=h.value,e=d.value,n=Math.max(0,parseFloat(u.value)||100)/100,i=Math.max(0,parseInt(C.value)),l=r.background,s=Math.max(1,parseInt(x.value)),"svg"!=e&&"png"!=e&&"pdf"!=e||!f.checked?null!=l&&l!=mxConstants.NONE||(l="#ffffff"):l=null,ExportDialog.lastBorderValue=i,ExportDialog.exportFile(o,t,e,l,n,i,s))}));g.className="geBtn gePrimaryBtn";n=mxUtils.button(mxResources.get("cancel"),function(){o.hideDialog()});n.className="geBtn",o.editor.cancelFirst?(e.appendChild(n),e.appendChild(g)):(e.appendChild(g),e.appendChild(n)),t.appendChild(e),a.appendChild(t),s.appendChild(a),this.container=s};ExportDialog.lastBorderValue=0,ExportDialog.showGifOption=!0,ExportDialog.showXmlOption=!0,ExportDialog.exportFile=function(t,e,n,i,l,s,o){var r,a,h,d=t.editor.graph;"xml"==n?ExportDialog.saveLocalFile(t,mxUtils.getXml(t.editor.getGraphXml()),e,n):"svg"==n?ExportDialog.saveLocalFile(t,mxUtils.getXml(d.getSvg(i,l,s)),e,n):(r=d.getGraphBounds(),h=(a=mxUtils.createXmlDocument()).createElement("output"),a.appendChild(h),(a=new mxXmlCanvas2D(h)).translate(Math.floor((s/l-r.x)/d.view.scale),Math.floor((s/l-r.y)/d.view.scale)),a.scale(l/d.view.scale),(new mxImageExport).drawState(d.getView().getState(d.model.root),a),a="xml="+encodeURIComponent(mxUtils.getXml(h)),h=Math.ceil(r.width*l/d.view.scale+2*s),s=Math.ceil(r.height*l/d.view.scale+2*s),a.length<=MAX_REQUEST_SIZE&&h*s<MAX_AREA?(t.hideDialog(),new mxXmlRequest(EXPORT_URL,"format="+n+"&filename="+encodeURIComponent(e)+"&bg="+(null!=i?i:"none")+"&w="+h+"&h="+s+"&"+a+"&dpi="+o).simulate(document,"_blank")):mxUtils.alert(mxResources.get("drawingTooLarge")))},ExportDialog.saveLocalFile=function(t,e,n,i){e.length<MAX_REQUEST_SIZE?(t.hideDialog(),new mxXmlRequest(SAVE_URL,"xml="+encodeURIComponent(e)+"&filename="+encodeURIComponent(n)+"&format="+i).simulate(document,"_blank")):(mxUtils.alert(mxResources.get("drawingTooLarge")),mxUtils.popup(xml))};var EditDataDialog=function(n,i){var t=document.createElement("div"),l=n.editor.graph,s=l.getModel().getValue(i);mxUtils.isNode(s)||((L=mxUtils.createXmlDocument().createElement("object")).setAttribute("label",s||""),s=L);var e={};try{null!=(m=mxUtils.getValue(n.editor.graph.getCurrentCellStyle(i),"metaData",null))&&(e=JSON.parse(m))}catch(t){}var o=new mxForm("properties");o.table.style.width="100%";function r(t,e){var n=document.createElement("div");n.style.position="relative",n.style.paddingRight="20px",n.style.boxSizing="border-box",n.style.width="100%";var i=document.createElement("a"),l=mxUtils.createImage(Dialog.prototype.closeImage);l.style.height="9px",l.style.fontSize="9px",l.style.marginBottom=mxClient.IS_IE11?"-1px":"5px",i.className="geButton",i.setAttribute("title",mxResources.get("delete")),i.style.position="absolute",i.style.top="4px",i.style.right="0px",i.style.margin="0px",i.style.width="9px",i.style.height="9px",i.style.cursor="pointer",i.appendChild(l);var s,e=(s=e,function(){for(var t=0,e=0;e<h.length;e++){if(h[e]==s){d[e]=null,o.table.deleteRow(t+(null!=p?1:0));break}null!=d[e]&&t++}});mxEvent.addListener(i,"click",e),e=t.parentNode,n.appendChild(t),n.appendChild(i),e.appendChild(n)}for(var a=s.attributes,h=[],d=[],u=0,p=null!=EditDataDialog.getDisplayIdForCell?EditDataDialog.getDisplayIdForCell(n,i):null,m=[],c=l.getModel().getParent(i)==l.getModel().getRoot(),g=0;g<a.length;g++)!c&&"label"==a[g].nodeName||"placeholders"==a[g].nodeName||m.push({name:a[g].nodeName,value:a[g].nodeValue});m.sort(function(t,e){return t.name<e.name?-1:t.name>e.name?1:0}),null!=p&&((A=document.createElement("div")).style.width="100%",A.style.fontSize="11px",A.style.textAlign="center",mxUtils.write(A,p),o.addField(mxResources.get("id")+":",A));for(var x,y,f,g=0;g<m.length;g++)x=u,y=m[g].name,f=m[g].value,h[x]=y,d[x]=o.addTextarea(h[u]+":",f,2),d[x].style.width="100%",0<f.indexOf("\n")&&d[x].setAttribute("rows","2"),r(d[x],y),null!=e[y]&&0==e[y].editable&&d[x].setAttribute("disabled","disabled"),u++;var C=document.createElement("div");C.style.cssText="position:absolute;left:30px;right:30px;overflow-y:auto;top:30px;bottom:80px;",C.appendChild(o.table);var v=document.createElement("div");v.style.boxSizing="border-box",v.style.paddingRight="160px",v.style.whiteSpace="nowrap",v.style.marginTop="6px",v.style.width="100%";var E=document.createElement("input");E.setAttribute("placeholder",mxResources.get("enterPropertyName")),E.setAttribute("type","text"),E.setAttribute("size",mxClient.IS_IE||mxClient.IS_IE11?"36":"40"),E.style.boxSizing="border-box",E.style.marginLeft="2px",E.style.width="100%",v.appendChild(E),C.appendChild(v),t.appendChild(C);var S=mxUtils.button(mxResources.get("addProperty"),function(){var t=E.value;if(0<t.length&&"label"!=t&&"placeholders"!=t&&t.indexOf(":")<0)try{var e=mxUtils.indexOf(h,t);0<=e&&null!=d[e]?d[e].focus():(s.cloneNode(!1).setAttribute(t,""),0<=e&&(h.splice(e,1),d.splice(e,1)),h.push(t),(e=o.addTextarea(t+":","",2)).style.width="100%",d.push(e),r(e,t),e.focus()),S.setAttribute("disabled","disabled"),E.value=""}catch(t){mxUtils.alert(t)}else mxUtils.alert(mxResources.get("invalidName"))});this.init=function(){(0<d.length?d[0]:E).focus()},S.setAttribute("title",mxResources.get("addProperty")),S.setAttribute("disabled","disabled"),S.style.textOverflow="ellipsis",S.style.position="absolute",S.style.overflow="hidden",S.style.width="144px",S.style.right="0px",S.className="geBtn",v.appendChild(S);var w=mxUtils.button(mxResources.get("cancel"),function(){n.hideDialog.apply(n,arguments)});w.className="geBtn";var b=mxUtils.button(mxResources.get("apply"),function(){try{n.hideDialog.apply(n,arguments),s=s.cloneNode(!0);for(var t=!1,e=0;e<h.length;e++)null==d[e]?s.removeAttribute(h[e]):(s.setAttribute(h[e],d[e].value),t=t||"placeholder"==h[e]&&"1"==s.getAttribute("placeholders"));t&&s.removeAttribute("label"),l.getModel().setValue(i,s)}catch(t){mxUtils.alert(t)}});function T(){0<E.value.length?S.removeAttribute("disabled"):S.setAttribute("disabled","disabled")}b.className="geBtn gePrimaryBtn",mxEvent.addListener(E,"keyup",T),mxEvent.addListener(E,"change",T);var A,L=document.createElement("div");L.style.cssText="position:absolute;left:30px;right:30px;text-align:right;bottom:30px;height:40px;",(n.editor.graph.getModel().isVertex(i)||n.editor.graph.getModel().isEdge(i))&&((A=document.createElement("span")).style.marginRight="10px",(C=document.createElement("input")).setAttribute("type","checkbox"),C.style.marginRight="6px","1"==s.getAttribute("placeholders")&&(C.setAttribute("checked","checked"),C.defaultChecked=!0),mxEvent.addListener(C,"click",function(){"1"==s.getAttribute("placeholders")?s.removeAttribute("placeholders"):s.setAttribute("placeholders","1")}),A.appendChild(C),mxUtils.write(A,mxResources.get("placeholders")),null!=EditDataDialog.placeholderHelpLink&&((v=document.createElement("a")).setAttribute("href",EditDataDialog.placeholderHelpLink),v.setAttribute("title",mxResources.get("help")),v.setAttribute("target","_blank"),v.style.marginLeft="8px",v.style.cursor="help",C=document.createElement("img"),mxUtils.setOpacity(C,50),C.style.height="16px",C.style.width="16px",C.setAttribute("border","0"),C.setAttribute("valign","middle"),C.style.marginTop=mxClient.IS_IE11?"0px":"-4px",C.setAttribute("src",Editor.helpImage),v.appendChild(C),A.appendChild(v)),L.appendChild(A)),n.editor.cancelFirst?(L.appendChild(w),L.appendChild(b)):(L.appendChild(b),L.appendChild(w)),t.appendChild(L),this.container=t};EditDataDialog.getDisplayIdForCell=function(t,e){var n=null;return null!=t.editor.graph.getModel().getParent(e)&&(n=e.getId()),n},EditDataDialog.placeholderHelpLink=null;var LinkDialog=function(e,t,n,i){var l=document.createElement("div");mxUtils.write(l,mxResources.get("editLink")+":");var s=document.createElement("div");s.className="geTitle",s.style.backgroundColor="transparent",s.style.borderColor="transparent",s.style.whiteSpace="nowrap",s.style.textOverflow="clip",s.style.cursor="default",mxClient.IS_VML||(s.style.paddingRight="20px");var o=document.createElement("input");o.setAttribute("value",t),o.setAttribute("placeholder","http://www.example.com/"),o.setAttribute("type","text"),o.style.marginTop="6px",o.style.width="400px",o.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')",o.style.backgroundRepeat="no-repeat",o.style.backgroundPosition="100% 50%",o.style.paddingRight="14px";t=document.createElement("div");t.setAttribute("title",mxResources.get("reset")),t.style.position="relative",t.style.left="-16px",t.style.width="12px",t.style.height="14px",t.style.cursor="pointer",t.style.display=mxClient.IS_VML?"inline":"inline-block",t.style.top=(mxClient.IS_VML?0:3)+"px",t.style.background="url("+IMAGE_PATH+"/transparent.gif)",mxEvent.addListener(t,"click",function(){o.value="",o.focus()}),s.appendChild(o),s.appendChild(t),l.appendChild(s),this.init=function(){o.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?o.select():document.execCommand("selectAll",!1,null)};t=document.createElement("div");t.style.marginTop="18px",t.style.textAlign="right",mxEvent.addListener(o,"keypress",function(t){13==t.keyCode&&(e.hideDialog(),i(o.value))});s=mxUtils.button(mxResources.get("cancel"),function(){e.hideDialog()});s.className="geBtn",e.editor.cancelFirst&&t.appendChild(s);n=mxUtils.button(n,function(){e.hideDialog(),i(o.value)});n.className="geBtn gePrimaryBtn",t.appendChild(n),e.editor.cancelFirst||t.appendChild(s),l.appendChild(t),this.container=l},OutlineWindow=function(t,e,n,i,l){var s=t.editor.graph,o=document.createElement("div");o.style.position="absolute",o.style.width="100%",o.style.height="100%",o.style.border="1px solid whiteSmoke",o.style.overflow="hidden",this.window=new mxWindow(mxResources.get("outline"),o,e,n,i,l,!0,!0),this.window.minimumSize=new mxRectangle(0,0,80,80),this.window.destroyOnClose=!1,this.window.setMaximizable(!1),this.window.setResizable(!0),this.window.setClosable(!0),this.window.setVisible(!0),this.window.setLocation=function(t,e){var n=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,i=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;t=Math.max(0,Math.min(t,n-this.table.clientWidth)),e=Math.max(0,Math.min(e,i-this.table.clientHeight-48)),this.getX()==t&&this.getY()==e||mxWindow.prototype.setLocation.apply(this,arguments)};var r=mxUtils.bind(this,function(){var t=this.window.getX(),e=this.window.getY();this.window.setLocation(t,e)});mxEvent.addListener(window,"resize",r);var a=t.createOutline(this.window);this.destroy=function(){mxEvent.removeListener(window,"resize",r),this.window.destroy(),a.destroy()},this.window.addListener(mxEvent.RESIZE,mxUtils.bind(this,function(){a.update(!1),a.outline.sizeDidChange()})),this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit(),a.suspended=!1,a.outline.refresh(),a.update()})),this.window.addListener(mxEvent.HIDE,mxUtils.bind(this,function(){a.suspended=!0})),this.window.addListener(mxEvent.NORMALIZE,mxUtils.bind(this,function(){a.suspended=!1,a.update()})),this.window.addListener(mxEvent.MINIMIZE,mxUtils.bind(this,function(){a.suspended=!0}));var h,d,u=a.createGraph;function p(){a.outline.pageScale=s.pageScale,a.outline.pageFormat=s.pageFormat,a.outline.pageVisible=s.pageVisible,a.outline.background=null==s.background||s.background==mxConstants.NONE?s.defaultPageBackgroundColor:s.background;var t=mxUtils.getCurrentStyle(s.container);o.style.backgroundColor=t.backgroundColor,null!=s.view.backgroundPageShape&&null!=a.outline.view.backgroundPageShape&&(a.outline.view.backgroundPageShape.fill=s.view.backgroundPageShape.fill),a.outline.refresh()}a.createGraph=function(t){var e=u.apply(this,arguments);e.gridEnabled=!1,e.pageScale=s.pageScale,e.pageFormat=s.pageFormat,e.background=null==s.background||s.background==mxConstants.NONE?s.defaultPageBackgroundColor:s.background,e.pageVisible=s.pageVisible;var n=mxUtils.getCurrentStyle(s.container);return o.style.backgroundColor=n.backgroundColor,e},a.init(o),t.editor.addListener("resetGraphView",p),t.addListener("pageFormatChanged",p),t.addListener("backgroundColorChanged",p),t.addListener("backgroundImageChanged",p),t.addListener("pageViewChanged",function(){p(),a.update(!0)}),a.outline.dialect==mxConstants.DIALECT_SVG&&(h=t.actions.get("zoomIn"),d=t.actions.get("zoomOut"),mxEvent.addMouseWheelListener(function(t,e){for(var n=!1,i=mxEvent.getSource(t);null!=i;){if(i==a.outline.view.canvas.ownerSVGElement){n=!0;break}i=i.parentNode}n&&(e?h:d).funct()}))},LayersWindow=function(h,t,e,n,i){var d=h.editor.graph,l=document.createElement("div");l.style.userSelect="none",l.style.background="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor,l.style.border="1px solid whiteSmoke",l.style.height="100%",l.style.marginBottom="10px",l.style.overflow="auto";var s=EditorUi.compactUi?"26px":"30px",u=document.createElement("div");u.style.backgroundColor="white"==Dialog.backdropColor?"#dcdcdc":Dialog.backdropColor,u.style.position="absolute",u.style.overflow="auto",u.style.left="0px",u.style.right="0px",u.style.top="0px",u.style.bottom=parseInt(s)+7+"px",l.appendChild(u);var p=null,m=null;mxEvent.addListener(l,"dragover",function(t){t.dataTransfer.dropEffect="move",m=0,t.stopPropagation(),t.preventDefault()}),mxEvent.addListener(l,"drop",function(t){t.stopPropagation(),t.preventDefault()});var c=null,g=null,o=document.createElement("div");o.className="geToolbarContainer",o.style.position="absolute",o.style.bottom="0px",o.style.left="0px",o.style.right="0px",o.style.height=s,o.style.overflow="hidden",o.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px",o.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor,o.style.borderWidth="1px 0px 0px 0px",o.style.borderColor="#c3c3c3",o.style.borderStyle="solid",o.style.display="block",o.style.whiteSpace="nowrap",mxClient.IS_QUIRKS&&(o.style.filter="none");s=document.createElement("a");s.className="geButton",mxClient.IS_QUIRKS&&(s.style.filter="none");var r=s.cloneNode();r.innerHTML='<div class="geSprite geSprite-delete" style="display:inline-block;"></div>',mxEvent.addListener(r,"click",function(t){if(d.isEnabled()){d.model.beginUpdate();try{var e=d.model.root.getIndex(g);d.removeCells([g],!1),0==d.model.getChildCount(d.model.root)?(d.model.add(d.model.root,new mxCell),d.setDefaultParent(null)):0<e&&e<=d.model.getChildCount(d.model.root)?d.setDefaultParent(d.model.getChildAt(d.model.root,e-1)):d.setDefaultParent(null)}finally{d.model.endUpdate()}}mxEvent.consume(t)}),d.isEnabled()||(r.className="geButton mxDisabled"),o.appendChild(r);var a=s.cloneNode();a.setAttribute("title",mxUtils.trim(mxResources.get("moveSelectionTo",["..."]))),a.innerHTML='<div class="geSprite geSprite-insert" style="display:inline-block;"></div>',mxEvent.addListener(a,"click",function(t){var e;d.isEnabled()&&!d.isSelectionEmpty()&&(e=mxUtils.getOffset(a),h.showPopupMenu(mxUtils.bind(this,function(n,i){for(var t=c-1;0<=t;t--)mxUtils.bind(this,function(t){var e=n.addItem(d.convertValueToString(t)||mxResources.get("background"),null,mxUtils.bind(this,function(){d.moveCells(d.getSelectionCells(),0,0,!1,t)}),i);1==d.getSelectionCount()&&d.model.isAncestor(t,d.getSelectionCell())&&n.addCheckmark(e,Editor.checkmarkImage)})(d.model.getChildAt(d.model.root,t))}),e.x,e.y+a.offsetHeight,t))}),o.appendChild(a);var x=s.cloneNode();x.innerHTML='<div class="geSprite geSprite-dots" style="display:inline-block;"></div>',x.setAttribute("title",mxResources.get("rename")),mxEvent.addListener(x,"click",function(t){d.isEnabled()&&h.showDataDialog(g),mxEvent.consume(t)}),d.isEnabled()||(x.className="geButton mxDisabled"),o.appendChild(x);var y=s.cloneNode();y.innerHTML='<div class="geSprite geSprite-duplicate" style="display:inline-block;"></div>',mxEvent.addListener(y,"click",function(t){if(d.isEnabled()){var e=null;d.model.beginUpdate();try{e=d.cloneCell(g),d.cellLabelChanged(e,mxResources.get("untitledLayer")),e.setVisible(!0),e=d.addCell(e,d.model.root),d.setDefaultParent(e)}finally{d.model.endUpdate()}null==e||d.isCellLocked(e)||d.selectAll(e)}}),d.isEnabled()||(y.className="geButton mxDisabled"),o.appendChild(y);s=s.cloneNode();function f(){function e(e,t,n,i){var l=document.createElement("div");l.className="geToolbarContainer",l.style.overflow="hidden",l.style.position="relative",l.style.padding="4px",l.style.height="22px",l.style.display="block",l.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor,l.style.borderWidth="0px 0px 1px 0px",l.style.borderColor="#c3c3c3",l.style.borderStyle="solid",l.style.whiteSpace="nowrap",l.setAttribute("title",t);var s=document.createElement("div");s.style.display="inline-block",s.style.width="100%",s.style.textOverflow="ellipsis",s.style.overflow="hidden",mxEvent.addListener(l,"dragover",function(t){t.dataTransfer.dropEffect="move",m=e,t.stopPropagation(),t.preventDefault()}),mxEvent.addListener(l,"dragstart",function(t){p=l,mxClient.IS_FF&&t.dataTransfer.setData("Text","<layer/>")}),mxEvent.addListener(l,"dragend",function(t){null!=p&&null!=m&&d.addCell(n,d.model.root,m),m=p=null,t.stopPropagation(),t.preventDefault()});var o=document.createElement("img");o.setAttribute("draggable","false"),o.setAttribute("align","top"),o.setAttribute("border","0"),o.style.padding="4px",o.setAttribute("title",mxResources.get("lockUnlock"));var r=d.getCurrentCellStyle(n);"1"==mxUtils.getValue(r,"locked","0")?o.setAttribute("src",Dialog.prototype.lockedImage):o.setAttribute("src",Dialog.prototype.unlockedImage),d.isEnabled()&&(o.style.cursor="pointer"),mxEvent.addListener(o,"click",function(t){if(d.isEnabled()){var e=null;d.getModel().beginUpdate();try{e="1"==mxUtils.getValue(r,"locked","0")?null:"1",d.setCellStyles("locked",e,[n])}finally{d.getModel().endUpdate()}"1"==e&&d.removeSelectionCells(d.getModel().getDescendants(n)),mxEvent.consume(t)}}),s.appendChild(o);var a,o=document.createElement("input");o.setAttribute("type","checkbox"),o.setAttribute("title",mxResources.get("hideIt",[n.value||mxResources.get("background")])),o.style.marginLeft="4px",o.style.marginRight="6px",o.style.marginTop="4px",s.appendChild(o),d.model.isVisible(n)&&(o.setAttribute("checked","checked"),o.defaultChecked=!0),mxEvent.addListener(o,"click",function(t){d.model.setVisible(n,!d.model.isVisible(n)),mxEvent.consume(t)}),mxUtils.write(s,t),l.appendChild(s),d.isEnabled()&&((mxClient.IS_TOUCH||mxClient.IS_POINTER||mxClient.IS_VML||mxClient.IS_IE&&document.documentMode<10)&&((s=document.createElement("div")).style.display="block",s.style.textAlign="right",s.style.whiteSpace="nowrap",s.style.position="absolute",s.style.right="6px",s.style.top="6px",0<e&&((a=document.createElement("a")).setAttribute("title",mxResources.get("toBack")),a.className="geButton",a.style.cssFloat="none",a.innerHTML="&#9660;",a.style.width="14px",a.style.height="14px",a.style.fontSize="14px",a.style.margin="0px",a.style.marginTop="-1px",s.appendChild(a),mxEvent.addListener(a,"click",function(t){d.isEnabled()&&d.addCell(n,d.model.root,e-1),mxEvent.consume(t)})),0<=e&&e<c-1&&((a=document.createElement("a")).setAttribute("title",mxResources.get("toFront")),a.className="geButton",a.style.cssFloat="none",a.innerHTML="&#9650;",a.style.width="14px",a.style.height="14px",a.style.fontSize="14px",a.style.margin="0px",a.style.marginTop="-1px",s.appendChild(a),mxEvent.addListener(a,"click",function(t){d.isEnabled()&&d.addCell(n,d.model.root,e+1),mxEvent.consume(t)})),l.appendChild(s)),mxClient.IS_SVG&&(!mxClient.IS_IE||10<=document.documentMode)&&(l.setAttribute("draggable","true"),l.style.cursor="move")),mxEvent.addListener(l,"dblclick",function(t){var e=mxEvent.getSource(t).nodeName;"INPUT"!=e&&"IMG"!=e&&(function(e){var t;d.isEnabled()&&null!=e&&(t=d.convertValueToString(e),t=new FilenameDialog(h,t||mxResources.get("background"),mxResources.get("rename"),mxUtils.bind(this,function(t){null!=t&&d.cellLabelChanged(e,t)}),mxResources.get("enterName")),h.showDialog(t.container,300,100,!0,!0),t.init())}(n),mxEvent.consume(t))}),d.getDefaultParent()==n?(l.style.background="white"==Dialog.backdropColor?"#e6eff8":"#505759",l.style.fontWeight=d.isEnabled()?"bold":"",g=n):mxEvent.addListener(l,"click",function(t){d.isEnabled()&&(d.setDefaultParent(i),d.view.setCurrentRoot(null))}),u.appendChild(l)}c=d.model.getChildCount(d.model.root),u.innerHTML="";for(var n=c-1;0<=n;n--)mxUtils.bind(this,function(t){e(n,d.convertValueToString(t)||mxResources.get("background"),t,t)})(d.model.getChildAt(d.model.root,n));var t=d.convertValueToString(g)||mxResources.get("background");r.setAttribute("title",mxResources.get("removeIt",[t])),y.setAttribute("title",mxResources.get("duplicateIt",[t])),x.setAttribute("title",mxResources.get("editData")),d.isSelectionEmpty()&&(a.className="geButton mxDisabled")}s.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>',s.setAttribute("title",mxResources.get("addLayer")),mxEvent.addListener(s,"click",function(t){if(d.isEnabled()){d.model.beginUpdate();try{var e=d.addCell(new mxCell(mxResources.get("untitledLayer")),d.model.root);d.setDefaultParent(e)}finally{d.model.endUpdate()}}mxEvent.consume(t)}),d.isEnabled()||(s.className="geButton mxDisabled"),o.appendChild(s),l.appendChild(o),f(),d.model.addListener(mxEvent.CHANGE,f),d.addListener("defaultParentChanged",f),d.selectionModel.addListener(mxEvent.CHANGE,function(){d.isSelectionEmpty()?a.className="geButton mxDisabled":a.className="geButton"}),this.window=new mxWindow(mxResources.get("layers"),l,t,e,n,i,!0,!0),this.window.minimumSize=new mxRectangle(0,0,120,120),this.window.destroyOnClose=!1,this.window.setMaximizable(!1),this.window.setResizable(!0),this.window.setClosable(!0),this.window.setVisible(!0),this.init=function(){u.scrollTop=u.scrollHeight-u.clientHeight},this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()})),this.refreshLayers=f,this.window.setLocation=function(t,e){var n=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,i=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;t=Math.max(0,Math.min(t,n-this.table.clientWidth)),e=Math.max(0,Math.min(e,i-this.table.clientHeight-48)),this.getX()==t&&this.getY()==e||mxWindow.prototype.setLocation.apply(this,arguments)};var C=mxUtils.bind(this,function(){var t=this.window.getX(),e=this.window.getY();this.window.setLocation(t,e)});mxEvent.addListener(window,"resize",C),this.destroy=function(){mxEvent.removeListener(window,"resize",C),this.window.destroy()}};