var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var build={exports:{}};(function(module){(function(t,e){module.exports?module.exports=e():t.mxgraph=e()})(commonjsGlobal,function(){return function(opts){for(var name in opts)this[name]=opts[name];var __mxOutput={},mxClient={VERSION:"4.2.2",IS_IE:navigator.userAgent!=null&&navigator.userAgent.indexOf("MSIE")>=0,IS_IE6:navigator.userAgent!=null&&navigator.userAgent.indexOf("MSIE 6")>=0,IS_IE11:navigator.userAgent!=null&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:navigator.userAgent!=null&&!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:navigator.userAgent!=null&&navigator.userAgent.indexOf("MSIE")>=0&&(document.documentMode==null||document.documentMode==5),IS_EM:"spellcheck"in document.createElement("textarea")&&document.documentMode==8,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:navigator.userAgent!=null&&navigator.userAgent.indexOf("Mozilla/")>=0&&navigator.userAgent.indexOf("MSIE")<0&&navigator.userAgent.indexOf("Edge/")<0,IS_OP:navigator.userAgent!=null&&(navigator.userAgent.indexOf("Opera/")>=0||navigator.userAgent.indexOf("OPR/")>=0),IS_OT:navigator.userAgent!=null&&navigator.userAgent.indexOf("Presto/")>=0&&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:navigator.appVersion.indexOf("Android")>=0,IS_IOS:/iP(hone|od|ad)/.test(navigator.platform),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:window.chrome!=null&&chrome.app!=null&&chrome.app.runtime!=null,IS_FF:typeof InstallTrigger<"u",IS_MT:navigator.userAgent.indexOf("Firefox/")>=0&&navigator.userAgent.indexOf("Firefox/1.")<0&&navigator.userAgent.indexOf("Firefox/2.")<0||navigator.userAgent.indexOf("Iceweasel/")>=0&&navigator.userAgent.indexOf("Iceweasel/1.")<0&&navigator.userAgent.indexOf("Iceweasel/2.")<0||navigator.userAgent.indexOf("SeaMonkey/")>=0&&navigator.userAgent.indexOf("SeaMonkey/1.")<0||navigator.userAgent.indexOf("Iceape/")>=0&&navigator.userAgent.indexOf("Iceape/1.")<0,IS_VML:navigator.appName.toUpperCase()=="MICROSOFT INTERNET EXPLORER",IS_SVG:navigator.appName.toUpperCase()!="MICROSOFT INTERNET EXPLORER",NO_FO:!document.createElementNS||document.createElementNS("http://www.w3.org/2000/svg","foreignObject")!="[object SVGForeignObjectElement]"||navigator.userAgent.indexOf("Opera/")>=0,IS_WIN:navigator.appVersion.indexOf("Win")>0,IS_MAC:navigator.appVersion.indexOf("Mac")>0,IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:window.PointerEvent!=null&&!(navigator.appVersion.indexOf("Mac")>0),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,i,n){if(i=i||document,mxClient.IS_IE6)i.write('');else{var r=i.createElement("link");r.setAttribute("rel",t),r.setAttribute("href",e),r.setAttribute("charset","UTF-8"),r.setAttribute("type","text/css"),n&&r.setAttribute("id",n);var s=i.getElementsByTagName("head")[0];s.appendChild(r)}},loadResources:function(t,e){var i=mxClient.defaultBundles.length;function n(){--i==0&&t()}for(var r=0;r<\/script>')}};typeof mxLoadResources>"u"&&(mxLoadResources=!0),typeof mxForceIncludes>"u"&&(mxForceIncludes=!1),typeof mxResourceExtension>"u"&&(mxResourceExtension=".txt"),typeof mxLoadStylesheets>"u"&&(mxLoadStylesheets=!0),typeof mxBasePath<"u"&&mxBasePath.length>0?(mxBasePath.substring(mxBasePath.length-1)=="/"&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".",typeof mxImageBasePath<"u"&&mxImageBasePath.length>0?(mxImageBasePath.substring(mxImageBasePath.length-1)=="/"&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images",typeof mxLanguage<"u"&&mxLanguage!=null?mxClient.language=mxLanguage:mxClient.language=mxClient.IS_IE?navigator.userLanguage:navigator.language,typeof mxDefaultLanguage<"u"&&mxDefaultLanguage!=null?mxClient.defaultLanguage=mxDefaultLanguage:mxClient.defaultLanguage="en",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css"),typeof mxLanguages<"u"&&mxLanguages!=null&&(mxClient.languages=mxLanguages),mxClient.IS_VML&&(mxClient.IS_SVG?mxClient.IS_VML=!1:(document.namespaces!=null&&(document.documentMode==8?(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&&document.styleSheets.length>=30?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)}",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css"))),(mxForceIncludes||module.exports==null)&&(mxClient.include(mxClient.basePath+"/js/util/mxLog.js"),mxClient.include(mxClient.basePath+"/js/util/mxObjectIdentity.js"),mxClient.include(mxClient.basePath+"/js/util/mxDictionary.js"),mxClient.include(mxClient.basePath+"/js/util/mxResources.js"),mxClient.include(mxClient.basePath+"/js/util/mxPoint.js"),mxClient.include(mxClient.basePath+"/js/util/mxRectangle.js"),mxClient.include(mxClient.basePath+"/js/util/mxEffects.js"),mxClient.include(mxClient.basePath+"/js/util/mxUtils.js"),mxClient.include(mxClient.basePath+"/js/util/mxConstants.js"),mxClient.include(mxClient.basePath+"/js/util/mxEventObject.js"),mxClient.include(mxClient.basePath+"/js/util/mxMouseEvent.js"),mxClient.include(mxClient.basePath+"/js/util/mxEventSource.js"),mxClient.include(mxClient.basePath+"/js/util/mxEvent.js"),mxClient.include(mxClient.basePath+"/js/util/mxXmlRequest.js"),mxClient.include(mxClient.basePath+"/js/util/mxClipboard.js"),mxClient.include(mxClient.basePath+"/js/util/mxWindow.js"),mxClient.include(mxClient.basePath+"/js/util/mxForm.js"),mxClient.include(mxClient.basePath+"/js/util/mxImage.js"),mxClient.include(mxClient.basePath+"/js/util/mxDivResizer.js"),mxClient.include(mxClient.basePath+"/js/util/mxDragSource.js"),mxClient.include(mxClient.basePath+"/js/util/mxToolbar.js"),mxClient.include(mxClient.basePath+"/js/util/mxUndoableEdit.js"),mxClient.include(mxClient.basePath+"/js/util/mxUndoManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxUrlConverter.js"),mxClient.include(mxClient.basePath+"/js/util/mxPanningManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxPopupMenu.js"),mxClient.include(mxClient.basePath+"/js/util/mxAutoSaveManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxAnimation.js"),mxClient.include(mxClient.basePath+"/js/util/mxMorphing.js"),mxClient.include(mxClient.basePath+"/js/util/mxImageBundle.js"),mxClient.include(mxClient.basePath+"/js/util/mxImageExport.js"),mxClient.include(mxClient.basePath+"/js/util/mxAbstractCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxXmlCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxSvgCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxVmlCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxGuide.js"),mxClient.include(mxClient.basePath+"/js/shape/mxShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxStencil.js"),mxClient.include(mxClient.basePath+"/js/shape/mxStencilRegistry.js"),mxClient.include(mxClient.basePath+"/js/shape/mxMarker.js"),mxClient.include(mxClient.basePath+"/js/shape/mxActor.js"),mxClient.include(mxClient.basePath+"/js/shape/mxCloud.js"),mxClient.include(mxClient.basePath+"/js/shape/mxRectangleShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxEllipse.js"),mxClient.include(mxClient.basePath+"/js/shape/mxDoubleEllipse.js"),mxClient.include(mxClient.basePath+"/js/shape/mxRhombus.js"),mxClient.include(mxClient.basePath+"/js/shape/mxPolyline.js"),mxClient.include(mxClient.basePath+"/js/shape/mxArrow.js"),mxClient.include(mxClient.basePath+"/js/shape/mxArrowConnector.js"),mxClient.include(mxClient.basePath+"/js/shape/mxText.js"),mxClient.include(mxClient.basePath+"/js/shape/mxTriangle.js"),mxClient.include(mxClient.basePath+"/js/shape/mxHexagon.js"),mxClient.include(mxClient.basePath+"/js/shape/mxLine.js"),mxClient.include(mxClient.basePath+"/js/shape/mxImageShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxLabel.js"),mxClient.include(mxClient.basePath+"/js/shape/mxCylinder.js"),mxClient.include(mxClient.basePath+"/js/shape/mxConnector.js"),mxClient.include(mxClient.basePath+"/js/shape/mxSwimlane.js"),mxClient.include(mxClient.basePath+"/js/layout/mxGraphLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxStackLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxPartitionLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCompactTreeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxRadialTreeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxFastOrganicLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCircleLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxParallelEdgeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCompositeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxEdgeLabelLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphAbstractHierarchyCell.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyNode.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyEdge.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyModel.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxSwimlaneModel.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxHierarchicalLayoutStage.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMedianHybridCrossingReduction.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMinimumCycleRemover.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxCoordinateAssignment.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxSwimlaneOrdering.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxHierarchicalLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxSwimlaneLayout.js"),mxClient.include(mxClient.basePath+"/js/model/mxGraphModel.js"),mxClient.include(mxClient.basePath+"/js/model/mxCell.js"),mxClient.include(mxClient.basePath+"/js/model/mxGeometry.js"),mxClient.include(mxClient.basePath+"/js/model/mxCellPath.js"),mxClient.include(mxClient.basePath+"/js/view/mxPerimeter.js"),mxClient.include(mxClient.basePath+"/js/view/mxPrintPreview.js"),mxClient.include(mxClient.basePath+"/js/view/mxStylesheet.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellState.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraphSelectionModel.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellEditor.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellRenderer.js"),mxClient.include(mxClient.basePath+"/js/view/mxEdgeStyle.js"),mxClient.include(mxClient.basePath+"/js/view/mxStyleRegistry.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraphView.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraph.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellOverlay.js"),mxClient.include(mxClient.basePath+"/js/view/mxOutline.js"),mxClient.include(mxClient.basePath+"/js/view/mxMultiplicity.js"),mxClient.include(mxClient.basePath+"/js/view/mxLayoutManager.js"),mxClient.include(mxClient.basePath+"/js/view/mxSwimlaneManager.js"),mxClient.include(mxClient.basePath+"/js/view/mxTemporaryCellStates.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellStatePreview.js"),mxClient.include(mxClient.basePath+"/js/view/mxConnectionConstraint.js"),mxClient.include(mxClient.basePath+"/js/handler/mxGraphHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxPanningHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxPopupMenuHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellMarker.js"),mxClient.include(mxClient.basePath+"/js/handler/mxSelectionCellsHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxConnectionHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxConstraintHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxRubberband.js"),mxClient.include(mxClient.basePath+"/js/handler/mxHandle.js"),mxClient.include(mxClient.basePath+"/js/handler/mxVertexHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxEdgeHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxElbowEdgeHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxEdgeSegmentHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxKeyHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxTooltipHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellTracker.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellHighlight.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultKeyHandler.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultPopupMenu.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultToolbar.js"),mxClient.include(mxClient.basePath+"/js/editor/mxEditor.js"),mxClient.include(mxClient.basePath+"/js/io/mxCodecRegistry.js"),mxClient.include(mxClient.basePath+"/js/io/mxCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxObjectCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxCellCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxModelCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxRootChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxChildChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxTerminalChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGenericChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGraphCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGraphViewCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxStylesheetCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultKeyHandlerCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultToolbarCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultPopupMenuCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxEditorCodec.js")),__mxOutput.mxClient=typeof mxClient<"u"?mxClient:void 0;var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(mxLog.window==null&&document.body!=null){var t=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,e=document.createElement("table");e.setAttribute("width","100%"),e.setAttribute("height","100%");var i=document.createElement("tbody"),n=document.createElement("tr"),r=document.createElement("td");r.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&&document.compatMode!="BackCompat"?mxLog.textarea.style.width="99%":mxLog.textarea.style.width="100%",r.appendChild(mxLog.textarea),n.appendChild(r),i.appendChild(n),n=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),n.appendChild(mxLog.td),i.appendChild(n),e.appendChild(i),mxLog.addButton("Info",function(u){mxLog.info()}),mxLog.addButton("DOM",function(u){var p=mxUtils.getInnerHtml(document.body);mxLog.debug(p)}),mxLog.addButton("Trace",function(u){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")}),mxLog.addButton("Copy",function(u){try{mxUtils.copy(mxLog.textarea.value)}catch(p){mxUtils.alert(p)}}),mxLog.addButton("Show",function(u){try{mxUtils.popup(mxLog.textarea.value)}catch(p){mxUtils.alert(p)}}),mxLog.addButton("Clear",function(u){mxLog.textarea.value=""});var s=0,l=0;if(typeof window.innerWidth=="number"?(s=window.innerHeight,l=window.innerWidth):(s=document.documentElement.clientHeight||document.body.clientHeight,l=document.body.clientWidth),mxLog.window=new mxWindow(t,e,Math.max(0,l-320),Math.max(0,s-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&&document.compatMode!="BackCompat"||document.documentMode==11){var a=mxLog.window.getElement(),o=function(u,p){mxLog.textarea.style.height=Math.max(0,a.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,o),mxLog.window.addListener(mxEvent.MAXIMIZE,o),mxLog.window.addListener(mxEvent.NORMALIZE,o),mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(t,e){var i=document.createElement("button");mxUtils.write(i,t),mxEvent.addListener(i,"click",e),mxLog.td.appendChild(i)},isVisible:function(){return mxLog.window!=null?mxLog.window.isVisible():!1},show:function(){mxLog.setVisible(!0)},setVisible:function(t){mxLog.window==null&&mxLog.init(),mxLog.window!=null&&mxLog.window.setVisible(t)},enter:function(t){if(mxLog.TRACE)return mxLog.writeln("Entering "+t),new Date().getTime()},leave:function(t,e){if(mxLog.TRACE){var i=e!=0?" ("+(new Date().getTime()-e)+" ms)":"";mxLog.writeln("Leaving "+t+i)}},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=0&&(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=0:!0},getDefaultBundle:function(t,e){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(e)?t+mxResources.extension:null},getSpecialBundle:function(t,e){if(mxClient.languages==null||!this.isLanguageSupported(e)){var i=e.indexOf("-");i>0&&(e=e.substring(0,i))}return mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(e)&&e!=mxClient.defaultLanguage?t+"_"+e+mxResources.extension:null},add:function(t,e,i){if(e=e??(mxClient.language!=null?mxClient.language.toLowerCase():mxConstants.NONE),e!=mxConstants.NONE){var n=mxResources.getDefaultBundle(t,e),r=mxResources.getSpecialBundle(t,e),s=function(){if(r!=null)if(i)mxUtils.get(r,function(o){mxResources.parse(o.getText()),i()},function(){i()});else try{var a=mxUtils.load(r);a.isReady()&&mxResources.parse(a.getText())}catch{}else i!=null&&i()};if(n!=null)if(i)mxUtils.get(n,function(a){mxResources.parse(a.getText()),s()},function(){s()});else try{var l=mxUtils.load(n);l.isReady()&&mxResources.parse(l.getText()),s()}catch{}else s()}},parse:function(t){if(t!=null){for(var e=t.split(` `),i=0;i0){var r=e[i].substring(0,n),s=e[i].length;e[i].charCodeAt(s-1)==13&&s--;var l=e[i].substring(n+1,s);this.resourcesEncoded?(l=l.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[r]=unescape(l)):mxResources.resources[r]=l}}}},get:function(t,e,i){var n=mxResources.resources[t];return n==null&&(n=i),n!=null&&e!=null&&(n=mxResources.replacePlaceholders(n,e)),n},replacePlaceholders:function(t,e){for(var i=[],n=null,r=0;r=0&&n0?window.setTimeout(a,r):(t.style.visibility="hidden",i&&t.parentNode&&t.parentNode.removeChild(t))};window.setTimeout(a,r)}else t.style.visibility="hidden",i&&t.parentNode&&t.parentNode.removeChild(t)}};__mxOutput.mxEffects=typeof mxEffects<"u"?mxEffects:void 0;var mxUtils={errorResource:mxClient.language!="none"?"error":"",closeResource:mxClient.language!="none"?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(t){t.style!=null&&(t.style.cursor="");var e=t.childNodes;if(e!=null)for(var i=e.length,n=0;n=9&&document.documentMode<10&&(t="ms"),function(e,i,n){e[i]=n,t!=null&&i.length>0&&(i=t+i.substring(0,1).toUpperCase()+i.substring(1),e[i]=n)}}(),hasScrollbars:function(t){var e=mxUtils.getCurrentStyle(t);return e!=null&&(e.overflow=="scroll"||e.overflow=="auto")},bind:function(t,e){return function(){return e.apply(t,arguments)}},eval:function(expr){var result=null;if(expr.indexOf("function")>=0)try{eval("var _mxJavaScriptExpression="+expr),result=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(t){mxLog.warn(t.message+" while evaluating "+expr)}else try{result=eval(expr)}catch(t){mxLog.warn(t.message+" while evaluating "+expr)}return result},findNode:function(t,e,i){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var n=t.getAttribute(e);if(n!=null&&n==i)return t}for(t=t.firstChild;t!=null;){var r=mxUtils.findNode(t,e,i);if(r!=null)return r;t=t.nextSibling}return null},getFunctionName:function(t){var e=null;if(t!=null){if(t.name!=null)e=t.name;else if(e=mxUtils.trim(t.toString()),/^function\s/.test(e)){e=mxUtils.ltrim(e.substring(9));var i=e.indexOf("(");i>0&&(e=e.substring(0,i))}}return e},indexOf:function(t,e){if(t!=null&&e!=null){for(var i=0;i=0;)e.splice(n,1),i=t,n=mxUtils.indexOf(e,t);for(var r in e)e[r]==t&&(delete e[r],i=t);return i},isNode:function(t,e,i,n){return t!=null&&!isNaN(t.nodeType)&&(e==null||t.nodeName.toLowerCase()==e.toLowerCase())?i==null||t.getAttribute(i)==n:!1},isAncestorNode:function(t,e){for(var i=e;i!=null;){if(i==t)return!0;i=i.parentNode}return!1},getChildNodes:function(t,e){e=e||mxConstants.NODETYPE_ELEMENT;for(var i=[],n=t.firstChild;n!=null;)n.nodeType==e&&i.push(n),n=n.nextSibling;return i},importNode:function(t,e,i){return mxClient.IS_IE&&(document.documentMode==null||document.documentMode<10)?mxUtils.importNodeImplementation(t,e,i):t.importNode(e,i)},importNodeImplementation:function(t,e,i){switch(e.nodeType){case 1:{var n=t.createElement(e.nodeName);if(e.attributes&&e.attributes.length>0)for(var r=0;r0)for(var r=0;r/g,">"),(e==null||e)&&(t=t.replace(/\n/g," ")),t},isVml:function(t){return t!=null&&t.tagUrn=="urn:schemas-microsoft-com:vml"},getXml:function(t,e){var i="";if(mxClient.IS_IE||mxClient.IS_IE11)i=mxUtils.getPrettyXml(t,"","","");else if(window.XMLSerializer!=null){var n=new XMLSerializer;i=n.serializeToString(t)}else t.xml!=null&&(i=t.xml.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,` `));return e=e||" ",i=i.replace(/\n/g,e),i},getPrettyXml:function(t,e,i,n,r){var s=[];if(t!=null)if(e=e??" ",i=i??"",n=n??` `,t.namespaceURI!=null&&t.namespaceURI!=r&&(r=t.namespaceURI,t.getAttribute("xmlns")==null&&t.setAttribute("xmlns",t.namespaceURI)),t.nodeType==mxConstants.NODETYPE_DOCUMENT)s.push(mxUtils.getPrettyXml(t.documentElement,e,i,n,r));else if(t.nodeType==mxConstants.NODETYPE_DOCUMENT_FRAGMENT){var l=t.firstChild;if(l!=null)for(;l!=null;)s.push(mxUtils.getPrettyXml(l,e,i,n,r)),l=l.nextSibling}else if(t.nodeType==mxConstants.NODETYPE_COMMENT){var a=mxUtils.getTextContent(t);a.length>0&&s.push(i+""+n)}else if(t.nodeType==mxConstants.NODETYPE_TEXT){var a=mxUtils.trim(mxUtils.getTextContent(t));a.length>0&&s.push(i+mxUtils.htmlEntities(a,!1)+n)}else if(t.nodeType==mxConstants.NODETYPE_CDATA){var a=mxUtils.getTextContent(t);a.length>0&&s.push(i+""+n);l!=null;)s.push(mxUtils.getPrettyXml(l,e,i+e,n,r)),l=l.nextSibling;s.push(i+""+n)}else s.push(" />"+n)}return s.join("")},extractTextWithWhitespace:function(t){var e=["BLOCKQUOTE","DIV","H1","H2","H3","H4","H5","H6","OL","P","PRE","TABLE","UL"],i=[];function n(r){if(!(r.length==1&&(r[0].nodeName=="BR"||r[0].innerHTML==` `)))for(var s=0;s"?i.push(` `):(l.nodeType===3||l.nodeType===4?l.nodeValue.length>0&&i.push(l.nodeValue):l.nodeType!==8&&l.childNodes.length>0&&n(l.childNodes),s=0&&i.push(` `))}}return n(t),i.join("")},replaceTrailingNewlines:function(t,e){for(var i="";t.length>0&&t.charAt(t.length-1)==` `;)t=t.substring(0,t.length-1),i+=e;return t+i},getTextContent:function(t){return mxClient.IS_IE&&t.innerText!==void 0?t.innerText:t!=null?t[t.textContent===void 0?"text":"textContent"]:""},setTextContent:function(t,e){t.innerText!==void 0?t.innerText=e:t[t.textContent===void 0?"text":"textContent"]=e},getInnerHtml:function(){return mxClient.IS_IE?function(t){return t!=null?t.innerHTML:""}:function(t){if(t!=null){var e=new XMLSerializer;return e.serializeToString(t)}return""}}(),getOuterHtml:function(){return mxClient.IS_IE?function(t){if(t!=null){if(t.outerHTML!=null)return t.outerHTML;var e=[];e.push("<"+t.nodeName);var i=t.attributes;if(i!=null)for(var n=0;n0&&(e.push(" "),e.push(i[n].nodeName),e.push('="'),e.push(r),e.push('"'))}return t.innerHTML.length==0?e.push("/>"):(e.push(">"),e.push(t.innerHTML),e.push("")),e.join("")}return""}:function(t){if(t!=null){var e=new XMLSerializer;return e.serializeToString(t)}return""}}(),write:function(t,e){var i=t.ownerDocument,n=i.createTextNode(e);return t!=null&&t.appendChild(n),n},writeln:function(t,e){var i=t.ownerDocument,n=i.createTextNode(e);return t!=null&&(t.appendChild(n),t.appendChild(document.createElement("br"))),n},br:function(t,e){e=e||1;for(var i=null,n=0;na&&(t.style.left=Math.max(s,a-n)+"px");var o=parseInt(t.offsetTop),u=parseInt(t.offsetHeight),p=l+e.height;o+u>p&&(t.style.top=Math.max(l,p-u)+"px")},load:function(t){var e=new mxXmlRequest(t,null,"GET",!1);return e.send(),e},get:function(t,e,i,n,r,s,l){var a=new mxXmlRequest(t,null,"GET"),o=a.setRequestHeaders;return l&&(a.setRequestHeaders=function(u,p){o.apply(this,arguments);for(var m in l)u.setRequestHeader(m,l[m])}),n!=null&&a.setBinary(n),a.send(e,i,r,s),a},getAll:function(t,e,i){for(var n=t.length,r=[],s=0,l=function(){s==0&&i!=null&&i(),s++},a=0;a299?l():(r[u]=p,n--,n==0&&e(r))},l)})(t[a],a);n==0&&e(r)},post:function(t,e,i,n){return new mxXmlRequest(t,e).send(i,n)},submit:function(t,e,i,n){return new mxXmlRequest(t,e).simulate(i,n)},loadInto:function(t,e,i){mxClient.IS_IE?e.onreadystatechange=function(){e.readyState==4&&i()}:e.addEventListener("load",i,!1),e.load(t)},getValue:function(t,e,i){var n=t!=null?t[e]:null;return n==null&&(n=i),n},getNumber:function(t,e,i){var n=t!=null?t[e]:null;return n==null&&(n=i||0),Number(n)},getColor:function(t,e,i){var n=t!=null?t[e]:null;return n==null?n=i:n==mxConstants.NONE&&(n=null),n},clone:function(t,e,i){i=i??!1;var n=null;if(t!=null&&typeof t.constructor=="function"){n=new t.constructor;for(var r in t)r!=mxObjectIdentity.FIELD_NAME&&(e==null||mxUtils.indexOf(e,r)<0)&&(!i&&typeof t[r]=="object"?n[r]=mxUtils.clone(t[r]):n[r]=t[r])}return n},equalPoints:function(t,e){if(t==null&&e!=null||t!=null&&e==null||t!=null&&e!=null&&t.length!=e.length)return!1;if(t!=null&&e!=null){for(var i=0;i [Function] `;else if(typeof t[i]=="object"){var n=mxUtils.getFunctionName(t[i].constructor);e+=i+" => ["+n+`] `}else e+=i+" = "+t[i]+` `}catch(r){e+=i+"="+r.message}return e},toRadians:function(t){return Math.PI*t/180},toDegree:function(t){return t*180/Math.PI},arcToCurves:function(t,e,i,n,r,s,l,a,o){if(a-=t,o-=e,i===0||n===0)return N;var u=l,p=r;i=Math.abs(i),n=Math.abs(n);var m=-a/2,d=-o/2,x=Math.cos(p*Math.PI/180),f=Math.sin(p*Math.PI/180),g=x*m+f*d,c=-1*f*m+x*d,v=g*g,y=c*c,T=i*i,C=n*n,S=v/T+y/C,E;if(S>1)i=Math.sqrt(S)*i,n=Math.sqrt(S)*n,E=0;else{var L=1;s===u&&(L=-1),E=L*Math.sqrt((T*C-T*y-C*v)/(T*y+C*v))}var A=E*i*c/n,M=-1*E*n*g/i,I=x*A-f*M+a/2,P=f*A+x*M+o/2,R=Math.atan2((c-M)/n,(g-A)/i)-Math.atan2(0,1),O=R>=0?R:2*Math.PI+R;R=Math.atan2((-c-M)/n,(-g-A)/i)-Math.atan2((c-M)/n,(g-A)/i);var _=R>=0?R:2*Math.PI+R;u==0&&_>0?_-=2*Math.PI:u!=0&&_<0&&(_+=2*Math.PI);for(var b=_*2/Math.PI,k=Math.ceil(b<0?-1*b:b),G=_/k,B=8/3*Math.sin(G/4)*Math.sin(G/4)/Math.sin(G/2),j=x*i,H=x*n,W=f*i,X=f*n,V=Math.cos(O),Y=Math.sin(O),et=-B*(j*Y+X*V),q=-B*(W*Y-H*V),K=0,Z=0,N=[],D=0;D45?(u=1,o>=135&&(u=2)):o<-45&&(u=3,o<=-135&&(u=2)),s.indexOf(mxConstants.DIRECTION_NORTH)>=0)switch(u){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;break}if(s.indexOf(mxConstants.DIRECTION_WEST)>=0)switch(u){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;break}if(s.indexOf(mxConstants.DIRECTION_SOUTH)>=0)switch(u){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;break}if(s.indexOf(mxConstants.DIRECTION_EAST)>=0)switch(u){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;break}return l},reversePortConstraints:function(t){var e=0;return e=(t&mxConstants.DIRECTION_MASK_WEST)<<3,e|=(t&mxConstants.DIRECTION_MASK_NORTH)<<1,e|=(t&mxConstants.DIRECTION_MASK_SOUTH)>>1,e|=(t&mxConstants.DIRECTION_MASK_EAST)>>3,e},findNearestSegment:function(t,e,i){var n=-1;if(t.absolutePoints.length>0)for(var r=t.absolutePoints[0],s=null,l=1;lo.distSq)&&(n=o)}}return n!=null?n.p:null},rectangleIntersectsSegment:function(t,e,i){var n=t.y,r=t.x,s=n+t.height,l=r+t.width,a=e.x,o=i.x;if(e.x>i.x&&(a=i.x,o=e.x),o>l&&(o=l),ao)return!1;var u=e.y,p=i.y,m=i.x-e.x;if(Math.abs(m)>1e-7){var d=(i.y-e.y)/m,x=e.y-d*e.x;u=d*a+x,p=d*o+x}if(u>p){var f=p;p=u,u=f}return p>s&&(p=s),up)},contains:function(t,e,i){return t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i},intersects:function(t,e){var i=t.width,n=t.height,r=e.width,s=e.height;if(r<=0||s<=0||i<=0||n<=0)return!1;var l=t.x,a=t.y,o=e.x,u=e.y;return r+=o,s+=u,i+=l,n+=a,(rl)&&(sa)&&(io)&&(nu)},intersectsHotspot:function(t,e,i,n,r,s){if(n=n??1,r=r??0,s=s??0,n>0){var l=t.getCenterX(),a=t.getCenterY(),o=t.width,u=t.height,p=mxUtils.getValue(t.style,mxConstants.STYLE_STARTSIZE)*t.view.scale;p>0&&(mxUtils.getValue(t.style,mxConstants.STYLE_HORIZONTAL,!0)?(a=t.y+p/2,u=p):(l=t.x+p/2,o=p)),o=Math.max(r,o*n),u=Math.max(r,u*n),s>0&&(o=Math.min(o,s),u=Math.min(u,s));var m=new mxRectangle(l-o/2,a-u/2,o,u),d=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0);if(d!=0){var x=Math.cos(-d),f=Math.sin(-d),l=new mxPoint(t.getCenterX(),t.getCenterY()),g=mxUtils.getRotatedPoint(new mxPoint(e,i),x,f,l);e=g.x,i=g.y}return mxUtils.contains(m,e,i)}return!0},getOffset:function(t,e){for(var i=0,n=0,r=!1,s=t,l=document.body,a=document.documentElement;s!=null&&s!=l&&s!=a&&!r;){var o=mxUtils.getCurrentStyle(s);o!=null&&(r=r||o.position=="fixed"),s=s.parentNode}if(!e&&!r){var u=mxUtils.getDocumentScrollOrigin(t.ownerDocument);i+=u.x,n+=u.y}var p=t.getBoundingClientRect();return p!=null&&(i+=p.left,n+=p.top),new mxPoint(i,n)},getDocumentScrollOrigin:function(t){if(mxClient.IS_QUIRKS)return new mxPoint(t.body.scrollLeft,t.body.scrollTop);var e=t.defaultView||t.parentWindow,i=e!=null&&window.pageXOffset!==void 0?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,n=e!=null&&window.pageYOffset!==void 0?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;return new mxPoint(i,n)},getScrollOrigin:function(t,e,i){e=e??!1,i=i??!0;for(var n=t!=null?t.ownerDocument:document,r=n.body,s=n.documentElement,l=new mxPoint,a=!1;t!=null&&t!=r&&t!=s;){!isNaN(t.scrollLeft)&&!isNaN(t.scrollTop)&&(l.x+=t.scrollLeft,l.y+=t.scrollTop);var o=mxUtils.getCurrentStyle(t);o!=null&&(a=a||o.position=="fixed"),t=e?t.parentNode:null}if(!a&&i){var u=mxUtils.getDocumentScrollOrigin(n);l.x+=u.x,l.y+=u.y}return l},convertPoint:function(t,e,i){var n=mxUtils.getScrollOrigin(t,!1),r=mxUtils.getOffset(t);return r.x-=n.x,r.y-=n.y,new mxPoint(e-r.x,i-r.y)},ltrim:function(t,e){return e=e||"\\s",t!=null?t.replace(new RegExp("^["+e+"]+","g"),""):null},rtrim:function(t,e){return e=e||"\\s",t!=null?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)&&(typeof t!="string"||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,i,n,r,s,l,a){var o=(a-s)*(i-t)-(l-r)*(n-e),u=(l-r)*(e-s)-(a-s)*(t-r),p=(i-t)*(e-s)-(n-e)*(t-r),m=u/o,d=p/o;if(m>=0&&m<=1&&d>=0&&d<=1){var x=t+m*(i-t),f=e+m*(n-e);return new mxPoint(x,f)}return null},ptSegDistSq:function(t,e,i,n,r,s){i-=t,n-=e,r-=t,s-=e;var l=r*i+s*n,a;l<=0?a=0:(r=i-r,s=n-s,l=r*i+s*n,l<=0?a=0:a=l*l/(i*i+n*n));var o=r*r+s*s-a;return o<0&&(o=0),o},ptLineDist:function(t,e,i,n,r,s){return Math.abs((n-e)*r-(i-t)*s+i*e-n*t)/Math.sqrt((n-e)*(n-e)+(i-t)*(i-t))},relativeCcw:function(t,e,i,n,r,s){i-=t,n-=e,r-=t,s-=e;var l=r*n-s*i;return l==0&&(l=r*i+s*n,l>0&&(r-=i,s-=n,l=r*i+s*n,l<0&&(l=0))),l<0?-1:l>0?1:0},animateChanges:function(t,e){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(t,e,i){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(t,e,i,n,r,s){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(t,e){mxUtils.isVml(t)?e>=100?t.style.filter="":t.style.filter="alpha(opacity="+e/5+")":mxClient.IS_IE&&(typeof document.documentMode>"u"||document.documentMode<9)?e>=100?t.style.filter="":t.style.filter="alpha(opacity="+e+")":t.style.opacity=e/100},createImage:function(t){var e=null;return mxClient.IS_IE6&&document.compatMode!="CSS1Compat"?(e=document.createElement(mxClient.VML_PREFIX+":image"),e.setAttribute("src",t),e.style.borderStyle="none"):(e=document.createElement("img"),e.setAttribute("src",t),e.setAttribute("border","0")),e},sortCells:function(t,e){e=e??!0;var i=new mxDictionary;return t.sort(function(n,r){var s=i.get(n);s==null&&(s=mxCellPath.create(n).split(mxCellPath.PATH_SEPARATOR),i.put(n,s));var l=i.get(r);l==null&&(l=mxCellPath.create(r).split(mxCellPath.PATH_SEPARATOR),i.put(r,l));var a=mxCellPath.compare(s,l);return a==0?0:a>0==e?1:-1}),t},getStylename:function(t){if(t!=null){var e=t.split(";"),i=e[0];if(i.indexOf("=")<0)return i}return""},getStylenames:function(t){var e=[];if(t!=null)for(var i=t.split(";"),n=0;n0&&t.charAt(t.length-1)!=";"&&(t+=";"),t+=e),t},removeStylename:function(t,e){var i=[];if(t!=null)for(var n=t.split(";"),r=0;r=0&&e.push(i[n]);return e.join(";")},setCellStyles:function(t,e,i,n){if(e!=null&&e.length>0){t.beginUpdate();try{for(var r=0;r"u"||i.length>0);if(t==null||t.length==0)n&&(t=e+"="+i+";");else if(t.substring(0,e.length+1)==e+"="){var r=t.indexOf(";");n?t=e+"="+i+(r<0?";":t.substring(r)):t=r<0||r==t.length-1?"":t.substring(r+1)}else{var s=t.indexOf(";"+e+"=");if(s<0){if(n){var l=t.charAt(t.length-1)==";"?"":";";t=t+l+e+"="+i+";"}}else{var r=t.indexOf(";",s+1);n?t=t.substring(0,s+1)+e+"="+i+(r<0?";":t.substring(r)):t=t.substring(0,s)+(r<0?";":t.substring(r))}}return t},setCellStyleFlags:function(t,e,i,n,r){if(e!=null&&e.length>0){t.beginUpdate();try{for(var s=0;s=0?t.substring(l):"")}}return t},getAlignmentAsPoint:function(t,e){var i=-.5,n=-.5;return t==mxConstants.ALIGN_LEFT?i=0:t==mxConstants.ALIGN_RIGHT&&(i=-1),e==mxConstants.ALIGN_TOP?n=0:e==mxConstants.ALIGN_BOTTOM&&(n=-1),new mxPoint(i,n)},getSizeForString:function(t,e,i,n,r){e=e??mxConstants.DEFAULT_FONTSIZE,i=i??mxConstants.DEFAULT_FONTFAMILY;var s=document.createElement("div");if(s.style.fontFamily=i,s.style.fontSize=Math.round(e)+"px",s.style.lineHeight=Math.round(e*mxConstants.LINE_HEIGHT)+"px",r!=null){(r&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(s.style.fontWeight="bold"),(r&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(s.style.fontStyle="italic");var l=[];(r&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&l.push("underline"),(r&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&l.push("line-through"),l.length>0&&(s.style.textDecoration=l.join(" "))}s.style.position="absolute",s.style.visibility="hidden",s.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",s.style.zoom="1",n!=null?(s.style.width=n+"px",s.style.whiteSpace="normal"):s.style.whiteSpace="nowrap",s.innerHTML=t,document.body.appendChild(s);var a=new mxRectangle(0,0,s.offsetWidth,s.offsetHeight);return document.body.removeChild(s),a},getViewXml:function(t,e,i,n,r){if(n=n??0,r=r??0,e=e??1,i==null){var s=t.getModel();i=[s.getRoot()]}var l=t.getView(),a=null,o=l.isEventsEnabled();l.setEventsEnabled(!1);var u=l.drawPane,p=l.overlayPane;t.dialect==mxConstants.DIALECT_SVG?(l.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),l.canvas.appendChild(l.drawPane),l.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g"),l.canvas.appendChild(l.overlayPane)):(l.drawPane=l.drawPane.cloneNode(!1),l.canvas.appendChild(l.drawPane),l.overlayPane=l.overlayPane.cloneNode(!1),l.canvas.appendChild(l.overlayPane));var m=l.getTranslate();l.translate=new mxPoint(n,r);var d=new mxTemporaryCellStates(t.getView(),e,i);try{var x=new mxCodec;a=x.encode(t.getView())}finally{d.destroy(),l.translate=m,l.canvas.removeChild(l.drawPane),l.canvas.removeChild(l.overlayPane),l.drawPane=u,l.overlayPane=p,l.setEventsEnabled(o)}return a},getScaleForPageCount:function(t,e,i,n){if(t<1)return 1;i=i??mxConstants.PAGE_FORMAT_A4_PORTRAIT,n=n??0;var r=i.width-n*2,s=i.height-n*2,l=e.getGraphBounds().clone(),a=e.getView().getScale();l.width/=a,l.height/=a;var o=l.width,u=l.height,p=1,m=r/s,d=o/u,x=d/m,f=Math.sqrt(t),g=Math.sqrt(x),c=f*g,v=f/g;if(c<1&&v>t){var y=v/t;v=t,c/=y}if(v<1&&c>t){var y=c/t;c=t,v/=y}for(var T=Math.ceil(c)*Math.ceil(v),C=0;T>t;){var S=Math.floor(c)/c,E=Math.floor(v)/v;S==1&&(S=Math.floor(c-1)/c),E==1&&(E=Math.floor(v-1)/v);var y=1;if(S>E?y=S:y=E,c=c*y,v=v*y,T=Math.ceil(c)*Math.ceil(v),C++,C>10)break}var L=r*c;return p=L/o,p*.99999},show:function(t,e,i,n,r,s){if(i=i??0,n=n??0,e==null){var l=window.open();e=l.document}else e.open();document.documentMode==9&&e.writeln('');var a=t.getGraphBounds(),o=Math.ceil(i-a.x),u=Math.ceil(n-a.y);if(r==null&&(r=Math.ceil(a.width+i)+Math.ceil(Math.ceil(a.x)-a.x)),s==null&&(s=Math.ceil(a.height+n)+Math.ceil(Math.ceil(a.y)-a.y)),mxClient.IS_IE||document.documentMode==11){for(var p="",m=document.getElementsByTagName("base"),d=0;d";for(var d=0;d',p+='
',p+=t.container.innerHTML,p+="
",e.writeln(p),e.close()}else{e.writeln("");for(var m=document.getElementsByTagName("base"),d=0;d'),e.close();var g=e.createElement("div");g.position="absolute",g.overflow="hidden",g.style.width=r+"px",g.style.height=s+"px";var c=e.createElement("div");c.style.position="absolute",c.style.left=o+"px",c.style.top=u+"px";for(var v=t.container.firstChild,y=null;v!=null;){var T=v.cloneNode(!0);v==t.view.drawPane.ownerSVGElement?(g.appendChild(T),y=T):c.appendChild(T),v=v.nextSibling}e.body.appendChild(g),c.firstChild!=null&&e.body.appendChild(c),y!=null&&(y.style.minWidth="",y.style.minHeight="",y.firstChild.setAttribute("transform","translate("+o+","+u+")"))}return mxUtils.removeCursors(e.body),e},printScreen:function(t){var e=window.open();t.getGraphBounds(),mxUtils.show(t,e.document);var i=function(){e.focus(),e.print(),e.close()};mxClient.IS_GC?e.setTimeout(i,500):i()},popup:function(t,e){if(e){var i=document.createElement("div");i.style.overflow="scroll",i.style.width="636px",i.style.height="460px";var n=document.createElement("pre");n.innerHTML=mxUtils.htmlEntities(t,!1).replace(/\n/g,"
").replace(/ /g," "),i.appendChild(n);var r=document.body.clientWidth,s=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight),l=new mxWindow("Popup Window",i,r/2-320,s/2-240,640,480,!1,!0);l.setClosable(!0),l.setVisible(!0)}else if(mxClient.IS_NS){var l=window.open();l.document.writeln("
"+mxUtils.htmlEntities(t)+"").replace(/ /g," "),l.document.body.appendChild(n)}},alert:function(t){alert(t)},prompt:function(t,e){return prompt(t,e??"")},confirm:function(t){return confirm(t)},error:function(t,e,i,n){var r=document.createElement("div");r.style.padding="20px";var s=document.createElement("img");s.setAttribute("src",n||mxUtils.errorImage),s.setAttribute("valign","bottom"),s.style.verticalAlign="middle",r.appendChild(s),r.appendChild(document.createTextNode(" ")),r.appendChild(document.createTextNode(" ")),r.appendChild(document.createTextNode(" ")),mxUtils.write(r,t);var l=document.body.clientWidth,a=document.body.clientHeight||document.documentElement.clientHeight,o=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,r,(l-e)/2,a/4,e,null,!1,!0);if(i){mxUtils.br(r);var u=document.createElement("p"),p=document.createElement("button");mxClient.IS_IE?p.style.cssText="float:right":p.setAttribute("style","float:right"),mxEvent.addListener(p,"click",function(m){o.destroy()}),mxUtils.write(p,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),u.appendChild(p),r.appendChild(u),mxUtils.br(r),o.setClosable(!0)}return o.setVisible(!0),o},makeDraggable:function(t,e,i,n,r,s,l,a,o,u){var p=new mxDragSource(t,i);return p.dragOffset=new mxPoint(r??0,s??mxConstants.TOOLTIP_VERTICAL_OFFSET),p.autoscroll=l,p.setGuidesEnabled(!1),o!=null&&(p.highlightDropTargets=o),u!=null&&(p.getDropTarget=u),p.getGraphForEvent=function(m){return typeof e=="function"?e(m):e},n!=null&&(p.createDragElement=function(){return n.cloneNode(!0)},a&&(p.createPreviewElement=function(m){var d=n.cloneNode(!0),x=parseInt(d.style.width),f=parseInt(d.style.height);return d.style.width=Math.round(x*m.view.scale)+"px",d.style.height=Math.round(f*m.view.scale)+"px",d})),p}};__mxOutput.mxUtils=typeof mxUtils<"u"?mxUtils:void 0;var 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"};__mxOutput.mxConstants=typeof mxConstants<"u"?mxConstants:void 0;function mxEventObject(t){this.name=t,this.properties=[];for(var e=1;e0;){var i=e[0];mxEvent.removeListener(t,i.name,i.f)}},addGestureListeners:function(t,e,i,n){e!=null&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),i!=null&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",i),n!=null&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",n),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(e!=null&&mxEvent.addListener(t,"touchstart",e),i!=null&&mxEvent.addListener(t,"touchmove",i),n!=null&&mxEvent.addListener(t,"touchend",n))},removeGestureListeners:function(t,e,i,n){e!=null&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),i!=null&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",i),n!=null&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",n),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(e!=null&&mxEvent.removeListener(t,"touchstart",e),i!=null&&mxEvent.removeListener(t,"touchmove",i),n!=null&&mxEvent.removeListener(t,"touchend",n))},redirectMouseEvents:function(t,e,i,n,r,s,l){var a=function(o){return typeof i=="function"?i(o):i};mxEvent.addGestureListeners(t,function(o){n!=null?n(o):mxEvent.isConsumed(o)||e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(o,a(o)))},function(o){r!=null?r(o):mxEvent.isConsumed(o)||e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(o,a(o)))},function(o){s!=null?s(o):mxEvent.isConsumed(o)||e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(o,a(o)))}),mxEvent.addListener(t,"dblclick",function(o){if(l!=null)l(o);else if(!mxEvent.isConsumed(o)){var u=a(o);e.dblClick(o,u!=null?u.cell:null)}})},release:function(t){try{if(t!=null){mxEvent.removeAllListeners(t);var e=t.childNodes;if(e!=null)for(var i=e.length,n=0;n.5||Math.abs(a.deltaY)>.5)&&t(a,a.deltaY==0?-a.deltaX>0:-a.deltaY>0)};if(e=e??window,mxClient.IS_SF&&!mxClient.IS_TOUCH){var n=1;mxEvent.addListener(e,"gesturestart",function(a){mxEvent.consume(a),n=1}),mxEvent.addListener(e,"gesturechange",function(a){mxEvent.consume(a);var o=n-a.scale;Math.abs(o)>.2&&(t(a,o<0,!0),n=a.scale)}),mxEvent.addListener(e,"gestureend",function(a){mxEvent.consume(a)})}else{var r=[],s=0,l=0;mxEvent.addGestureListeners(e,mxUtils.bind(this,function(a){!mxEvent.isMouseEvent(a)&&a.pointerId!=null&&r.push(a)}),mxUtils.bind(this,function(a){if(!mxEvent.isMouseEvent(a)&&r.length==2){for(var o=0;omxEvent.PINCH_THRESHOLD||d>mxEvent.PINCH_THRESHOLD){var x=r[0].clientX+(r[1].clientX-r[0].clientX)/2,f=r[0].clientY+(r[1].clientY-r[0].clientY)/2;t(r[0],m>d?u>s:p>l,!0,x,f),s=u,l=p}}}),mxUtils.bind(this,function(a){r=[],s=0,l=0}))}mxEvent.addListener(e,"wheel",i)}},disableContextMenu:function(t){mxEvent.addListener(t,"contextmenu",function(e){return e.preventDefault&&e.preventDefault(),!1})},getSource:function(t){return t.srcElement!=null?t.srcElement:t.target},isConsumed:function(t){return t.isConsumed!=null&&t.isConsumed},isTouchEvent:function(t){return t.pointerType!=null?t.pointerType=="touch"||t.pointerType===t.MSPOINTER_TYPE_TOUCH:t.mozInputSource!=null?t.mozInputSource==5:t.type.indexOf("touch")==0},isPenEvent:function(t){return t.pointerType!=null?t.pointerType=="pen"||t.pointerType===t.MSPOINTER_TYPE_PEN:t.mozInputSource!=null?t.mozInputSource==2:t.type.indexOf("pen")==0},isMultiTouchEvent:function(t){return t.type!=null&&t.type.indexOf("touch")==0&&t.touches!=null&&t.touches.length>1},isMouseEvent:function(t){return t.pointerType!=null?t.pointerType=="mouse"||t.pointerType===t.MSPOINTER_TYPE_MOUSE:t.mozInputSource!=null?t.mozInputSource==1:t.type.indexOf("mouse")==0},isLeftMouseButton:function(t){return"buttons"in t&&(t.type=="mousedown"||t.type=="mousemove")?t.buttons==1:"which"in t?t.which===1:t.button===1},isMiddleMouseButton:function(t){return"which"in t?t.which===2:t.button===4},isRightMouseButton:function(t){return"which"in t?t.which===3:t.button===2},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 t!=null?t.shiftKey:!1},isAltDown:function(t){return t!=null?t.altKey:!1},isControlDown:function(t){return t!=null?t.ctrlKey:!1},isMetaDown:function(t){return t!=null?t.metaKey:!1},getMainEvent:function(t){return(t.type=="touchstart"||t.type=="touchmove")&&t.touches!=null&&t.touches[0]!=null?t=t.touches[0]:t.type=="touchend"&&t.changedTouches!=null&&t.changedTouches[0]!=null&&(t=t.changedTouches[0]),t},getClientX:function(t){return mxEvent.getMainEvent(t).clientX},getClientY:function(t){return mxEvent.getMainEvent(t).clientY},consume:function(t,e,i){e=e??!0,i=i??!0,e&&(t.preventDefault?(i&&t.stopPropagation(),t.preventDefault()):i&&(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};__mxOutput.mxEvent=typeof mxEvent<"u"?mxEvent:void 0;function mxXmlRequest(t,e,i,n,r,s){this.url=t,this.params=e,this.method=i||"POST",this.async=n??!0,this.username=r,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 this.request.readyState==4},mxXmlRequest.prototype.getDocumentElement=function(){var t=this.getXml();return t!=null?t.documentElement:null},mxXmlRequest.prototype.getXml=function(){var t=this.request.responseXML;return(document.documentMode>=9||t==null||t.documentElement==null)&&(t=mxUtils.parseXml(this.request.responseText)),t},mxXmlRequest.prototype.getStatus=function(){return this.request!=null?this.request.status:null},mxXmlRequest.prototype.create=function(){if(window.XMLHttpRequest)return function(){var t=new XMLHttpRequest;return this.isBinary()&&t.overrideMimeType&&t.overrideMimeType("text/plain; charset=x-user-defined"),t};if(typeof ActiveXObject<"u")return function(){return new ActiveXObject("Microsoft.XMLHTTP")}}(),mxXmlRequest.prototype.send=function(t,e,i,n){this.request=this.create(),this.request!=null&&(t!=null&&(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&&(document.documentMode==null||document.documentMode>9)&&window.XMLHttpRequest&&i!=null&&n!=null&&(this.request.timeout=i,this.request.ontimeout=n),this.request.send(this.params))},mxXmlRequest.prototype.setRequestHeaders=function(t,e){e!=null&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded")},mxXmlRequest.prototype.simulate=function(t,e){t=t||document;var i=null;t==document&&(i=window.onbeforeunload,window.onbeforeunload=null);var n=t.createElement("form");n.setAttribute("method",this.method),n.setAttribute("action",this.url),e!=null&&n.setAttribute("target",e),n.style.display="none",n.style.visibility="hidden";for(var r=this.params.indexOf("&")>0?this.params.split("&"):this.params.split(),s=0;s0){var a=r[s].substring(0,l),o=r[s].substring(l+1);this.decodeSimulateValues&&(o=decodeURIComponent(o));var u=t.createElement("textarea");u.setAttribute("wrap","off"),u.setAttribute("name",a),mxUtils.write(u,o),n.appendChild(u)}}t.body.appendChild(n),n.submit(),n.parentNode!=null&&n.parentNode.removeChild(n),i!=null&&(window.onbeforeunload=i)},__mxOutput.mxXmlRequest=typeof mxXmlRequest<"u"?mxXmlRequest:void 0;var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,setCells:function(t){mxClipboard.cells=t},getCells:function(){return mxClipboard.cells},isEmpty:function(){return mxClipboard.getCells()==null},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();var i=t.getExportableCells(t.model.getTopmostCells(e));return mxClipboard.insertCount=1,mxClipboard.setCells(t.cloneCells(i)),i},paste:function(t){var e=null;if(!mxClipboard.isEmpty()){e=t.getImportableCells(mxClipboard.getCells());var i=mxClipboard.insertCount*mxClipboard.STEPSIZE,n=t.getDefaultParent();e=t.importCells(e,i,i,n),mxClipboard.insertCount++,t.setSelectionCells(e)}return e}};__mxOutput.mxClipboard=typeof mxClipboard<"u"?mxClipboard:void 0;function mxWindow(t,e,i,n,r,s,l,a,o,u){e!=null&&(l=l??!0,this.content=e,this.init(i,n,r,s,u),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(l),this.setTitle(t),(a==null||a)&&this.installMoveHandler(),o!=null&&o.parentNode!=null?o.parentNode.replaceChild(this.div,o):document.body.appendChild(this.div))}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=document.documentMode==8||document.documentMode==7?6:2,mxWindow.prototype.title=null,mxWindow.prototype.content=null,mxWindow.prototype.init=function(t,e,i,n,r){r=r??"mxWindow",this.div=document.createElement("div"),this.div.className=r,this.div.style.left=t+"px",this.div.style.top=e+"px",this.table=document.createElement("table"),this.table.className=r,mxClient.IS_POINTER&&(this.div.style.touchAction="none"),i!=null&&(mxClient.IS_QUIRKS||(this.div.style.width=i+"px"),this.table.style.width=i+"px"),n!=null&&(mxClient.IS_QUIRKS||(this.div.style.height=n+"px"),this.table.style.height=n+"px");var s=document.createElement("tbody"),l=document.createElement("tr");this.title=document.createElement("td"),this.title.className=r+"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),l.appendChild(this.title),s.appendChild(l),l=document.createElement("tr"),this.td=document.createElement("td"),this.td.className=r+"Pane",document.documentMode==7&&(this.td.style.height="100%"),this.contentWrapper=document.createElement("div"),this.contentWrapper.className=r+"Pane",this.contentWrapper.style.width="100%",this.contentWrapper.appendChild(this.content),(mxClient.IS_QUIRKS||this.content.nodeName.toUpperCase()!="DIV")&&(this.contentWrapper.style.height="100%"),this.td.appendChild(this.contentWrapper),l.appendChild(this.td),s.appendChild(l),this.table.appendChild(s),this.div.appendChild(this.table);var a=mxUtils.bind(this,function(o){this.activate()});mxEvent.addGestureListeners(this.title,a),mxEvent.addGestureListeners(this.table,a),this.hide()},mxWindow.prototype.setTitle=function(t){for(var e=this.title.firstChild;e!=null;){var i=e.nextSibling;e.nodeType==mxConstants.NODETYPE_TEXT&&e.parentNode.removeChild(e),e=i}mxUtils.write(this.title,t||""),this.title.appendChild(this.buttons)},mxWindow.prototype.setScrollable=function(t){(navigator.userAgent==null||navigator.userAgent.indexOf("Presto/2.5")<0)&&(t?this.contentWrapper.style.overflow="auto":this.contentWrapper.style.overflow="hidden")},mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var t=mxUtils.getCurrentStyle(this.getElement()),e=t!=null?t.zIndex:3;if(mxWindow.activeWindow){var i=mxWindow.activeWindow.getElement();i!=null&&i.style!=null&&(i.style.zIndex=e)}var n=mxWindow.activeWindow;this.getElement().style.zIndex=parseInt(e)+1,mxWindow.activeWindow=this,this.fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",n))}},mxWindow.prototype.getElement=function(){return this.div},mxWindow.prototype.fit=function(){mxUtils.fit(this.div)},mxWindow.prototype.isResizable=function(){return this.resize!=null?this.resize.style.display!="none":!1},mxWindow.prototype.setResizable=function(t){if(t)if(this.resize==null){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";var e=null,i=null,n=null,r=null,s=mxUtils.bind(this,function(o){this.activate(),e=mxEvent.getClientX(o),i=mxEvent.getClientY(o),n=this.div.offsetWidth,r=this.div.offsetHeight,mxEvent.addGestureListeners(document,null,l,a),this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",o)),mxEvent.consume(o)}),l=mxUtils.bind(this,function(o){if(e!=null&&i!=null){var u=mxEvent.getClientX(o)-e,p=mxEvent.getClientY(o)-i;this.setSize(n+u,r+p),this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",o)),mxEvent.consume(o)}}),a=mxUtils.bind(this,function(o){e!=null&&i!=null&&(e=null,i=null,mxEvent.removeGestureListeners(document,null,l,a),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",o)),mxEvent.consume(o))});mxEvent.addGestureListeners(this.resize,s,l,a),this.div.appendChild(this.resize)}else this.resize.style.display="inline";else this.resize!=null&&(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 t=!1,e=null,i=null,n=mxUtils.bind(this,function(r){if(this.activate(),t)t=!1,this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=e,mxClient.IS_QUIRKS||(this.div.style.height=i),this.table.style.height=i,this.resize!=null&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",r));else{t=!0,this.minimize.setAttribute("src",this.normalizeImage),this.minimize.setAttribute("title","Normalize"),this.contentWrapper.style.display="none",e=this.maximize.style.display,this.maximize.style.display="none",i=this.table.style.height;var s=this.getMinimumSize();s.height>0&&(mxClient.IS_QUIRKS||(this.div.style.height=s.height+"px"),this.table.style.height=s.height+"px"),s.width>0&&(mxClient.IS_QUIRKS||(this.div.style.width=s.width+"px"),this.table.style.width=s.width+"px"),this.resize!=null&&(this.resize.style.visibility="hidden"),this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",r))}mxEvent.consume(r)});mxEvent.addGestureListeners(this.minimize,n)},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 t=!1,e=null,i=null,n=null,r=null,s=null,l=mxUtils.bind(this,function(a){if(this.activate(),this.maximize.style.display!="none"){if(t){if(t=!1,this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.contentWrapper.style.display="",this.minimize.style.display=s,this.div.style.left=e+"px",this.div.style.top=i+"px",!mxClient.IS_QUIRKS){this.div.style.height=n,this.div.style.width=r;var u=mxUtils.getCurrentStyle(this.contentWrapper);(u.overflow=="auto"||this.resize!=null)&&(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px")}this.table.style.height=n,this.table.style.width=r,this.resize!=null&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",a))}else{t=!0,this.maximize.setAttribute("src",this.normalizeImage),this.maximize.setAttribute("title","Normalize"),this.contentWrapper.style.display="",s=this.minimize.style.display,this.minimize.style.display="none",e=parseInt(this.div.style.left),i=parseInt(this.div.style.top),n=this.table.style.height,r=this.table.style.width,this.div.style.left="0px",this.div.style.top="0px";var o=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0);if(mxClient.IS_QUIRKS||(this.div.style.width=document.body.clientWidth-2+"px",this.div.style.height=o-2+"px"),this.table.style.width=document.body.clientWidth-2+"px",this.table.style.height=o-2+"px",this.resize!=null&&(this.resize.style.visibility="hidden"),!mxClient.IS_QUIRKS){var u=mxUtils.getCurrentStyle(this.contentWrapper);(u.overflow=="auto"||this.resize!=null)&&(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px")}this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",a))}mxEvent.consume(a)}});mxEvent.addGestureListeners(this.maximize,l),mxEvent.addListener(this.title,"dblclick",l)},mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move",mxEvent.addGestureListeners(this.title,mxUtils.bind(this,function(t){var e=mxEvent.getClientX(t),i=mxEvent.getClientY(t),n=this.getX(),r=this.getY(),s=mxUtils.bind(this,function(a){var o=mxEvent.getClientX(a)-e,u=mxEvent.getClientY(a)-i;this.setLocation(n+o,r+u),this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",a)),mxEvent.consume(a)}),l=mxUtils.bind(this,function(a){mxEvent.removeGestureListeners(document,null,s,l),this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",a)),mxEvent.consume(a)});mxEvent.addGestureListeners(document,null,s,l),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 this.div!=null?this.div.style.display!="none":!1},mxWindow.prototype.setVisible=function(t){this.div!=null&&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&&(t.overflow=="auto"||this.resize!=null)&&this.contentWrapper.style.display!="none"&&(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)),this.div!=null&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null),this.title=null,this.content=null,this.contentWrapper=null},__mxOutput.mxWindow=typeof mxWindow<"u"?mxWindow:void 0;function mxForm(t){this.table=document.createElement("table"),this.table.className=t,this.body=document.createElement("tbody"),this.table.appendChild(this.body)}mxForm.prototype.table=null,mxForm.prototype.body=!1,mxForm.prototype.getTable=function(){return this.table},mxForm.prototype.addButtons=function(t,e){var i=document.createElement("tr"),n=document.createElement("td");i.appendChild(n),n=document.createElement("td");var r=document.createElement("button");mxUtils.write(r,mxResources.get("ok")||"OK"),n.appendChild(r),mxEvent.addListener(r,"click",function(){t()}),r=document.createElement("button"),mxUtils.write(r,mxResources.get("cancel")||"Cancel"),n.appendChild(r),mxEvent.addListener(r,"click",function(){e()}),i.appendChild(n),this.body.appendChild(i)},mxForm.prototype.addText=function(t,e,i){var n=document.createElement("input");return n.setAttribute("type",i||"text"),n.value=e,this.addField(t,n)},mxForm.prototype.addCheckbox=function(t,e){var i=document.createElement("input");return i.setAttribute("type","checkbox"),this.addField(t,i),e&&(i.checked=!0),i},mxForm.prototype.addTextarea=function(t,e,i){var n=document.createElement("textarea");return mxClient.IS_NS&&i--,n.setAttribute("rows",i||2),n.value=e,this.addField(t,n)},mxForm.prototype.addCombo=function(t,e,i){var n=document.createElement("select");return i!=null&&n.setAttribute("size",i),e&&n.setAttribute("multiple","true"),this.addField(t,n)},mxForm.prototype.addOption=function(t,e,i,n){var r=document.createElement("option");mxUtils.writeln(r,e),r.setAttribute("value",i),n&&r.setAttribute("selected",n),t.appendChild(r)},mxForm.prototype.addField=function(t,e){var i=document.createElement("tr"),n=document.createElement("td");return mxUtils.write(n,t),i.appendChild(n),n=document.createElement("td"),n.appendChild(e),i.appendChild(n),this.body.appendChild(i),e},__mxOutput.mxForm=typeof mxForm<"u"?mxForm:void 0;function mxImage(t,e,i){this.src=t,this.width=e,this.height=i}mxImage.prototype.src=null,mxImage.prototype.width=null,mxImage.prototype.height=null,__mxOutput.mxImage=typeof mxImage<"u"?mxImage:void 0;function mxDivResizer(t,e){if(t.nodeName.toLowerCase()=="div"){e==null&&(e=window),this.div=t;var i=mxUtils.getCurrentStyle(t);i!=null&&(this.resizeWidth=i.width=="auto",this.resizeHeight=i.height=="auto"),mxEvent.addListener(e,"resize",mxUtils.bind(this,function(n){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)})),this.resize()}}mxDivResizer.prototype.resizeWidth=!0,mxDivResizer.prototype.resizeHeight=!0,mxDivResizer.prototype.handlingResize=!1,mxDivResizer.prototype.resize=function(){var t=this.getDocumentWidth(),e=this.getDocumentHeight(),i=parseInt(this.div.style.left),n=parseInt(this.div.style.right),r=parseInt(this.div.style.top),s=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(i)&&!isNaN(n)&&i>=0&&n>=0&&t-n-i>0&&(this.div.style.width=t-n-i+"px"),this.resizeHeight&&!isNaN(r)&&!isNaN(s)&&r>=0&&s>=0&&e-r-s>0&&(this.div.style.height=e-r-s+"px")},mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth},mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight},__mxOutput.mxDivResizer=typeof mxDivResizer<"u"?mxDivResizer:void 0;function mxDragSource(t,e){this.element=t,this.dropHandler=e,mxEvent.addGestureListeners(t,mxUtils.bind(this,function(i){this.mouseDown(i)})),mxEvent.addListener(t,"dragstart",function(i){mxEvent.consume(i)}),this.eventConsumer=function(i,n){var r=n.getProperty("eventName"),s=n.getProperty("event");r!=mxEvent.MOUSE_DOWN&&s.consume()}}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,i,n){return t.getCellAt(e,i)},mxDragSource.prototype.createDragElement=function(t){return this.element.cloneNode(!0)},mxDragSource.prototype.createPreviewElement=function(t){return null},mxDragSource.prototype.isActive=function(){return this.mouseMoveHandler!=null},mxDragSource.prototype.reset=function(){this.currentGraph!=null&&(this.dragExit(this.currentGraph),this.currentGraph=null),this.removeDragElement(),this.removeListeners(),this.stopDrag()},mxDragSource.prototype.mouseDown=function(t){this.enabled&&!mxEvent.isConsumed(t)&&this.mouseMoveHandler==null&&(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(){this.dragElement!=null&&(this.dragElement.parentNode!=null&&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 i=mxEvent.getClientX(e),n=mxEvent.getClientY(e),r=mxUtils.getOffset(t.container),s=mxUtils.getScrollOrigin(),l=this.getElementForEvent(e);if(this.checkEventSource)for(;l!=null&&l!=t.container;)l=l.parentNode;return l!=null&&i>=r.x-s.x&&n>=r.y-s.y&&i<=r.x-s.x+t.container.offsetWidth&&n<=r.y-s.y+t.container.offsetHeight},mxDragSource.prototype.mouseMove=function(t){var e=this.getGraphForEvent(t);if(e!=null&&!this.graphContainsEvent(e,t)&&(e=null),e!=this.currentGraph&&(this.currentGraph!=null&&this.dragExit(this.currentGraph,t),this.currentGraph=e,this.currentGraph!=null&&this.dragEnter(this.currentGraph,t)),this.currentGraph!=null&&this.dragOver(this.currentGraph,t),this.dragElement!=null&&(this.previewElement==null||this.previewElement.style.visibility!="visible")){var i=mxEvent.getClientX(t),n=mxEvent.getClientY(t);this.dragElement.parentNode==null&&document.body.appendChild(this.dragElement),this.dragElement.style.visibility="visible",this.dragOffset!=null&&(i+=this.dragOffset.x,n+=this.dragOffset.y);var r=mxUtils.getDocumentScrollOrigin(document);this.dragElement.style.left=i+r.x+"px",this.dragElement.style.top=n+r.y+"px"}else this.dragElement!=null&&(this.dragElement.style.visibility="hidden");mxEvent.consume(t)},mxDragSource.prototype.mouseUp=function(t){if(this.currentGraph!=null){if(this.currentPoint!=null&&(this.previewElement==null||this.previewElement.style.visibility!="hidden")){var e=this.currentGraph.view.scale,i=this.currentGraph.view.translate,n=this.currentPoint.x/e-i.x,r=this.currentPoint.y/e-i.y;this.drop(this.currentGraph,t,this.currentDropTarget,n,r)}this.dragExit(this.currentGraph),this.currentGraph=null}this.stopDrag(),this.removeListeners(),mxEvent.consume(t)},mxDragSource.prototype.removeListeners=function(){this.eventSource!=null&&(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),this.previewElement!=null&&this.checkEventSource&&mxClient.IS_SVG&&(this.previewElement.style.pointerEvents="none"),this.isGuidesEnabled()&&this.previewElement!=null&&(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),this.previewElement!=null&&(this.previewElement.parentNode!=null&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null),this.currentGuide!=null&&(this.currentGuide.destroy(),this.currentGuide=null),this.currentHighlight!=null&&(this.currentHighlight.destroy(),this.currentHighlight=null)},mxDragSource.prototype.dragOver=function(t,e){var i=mxUtils.getOffset(t.container),n=mxUtils.getScrollOrigin(t.container),r=mxEvent.getClientX(e)-i.x+n.x-t.panDx,s=mxEvent.getClientY(e)-i.y+n.y-t.panDy;if(t.autoScroll&&(this.autoscroll==null||this.autoscroll)&&t.scrollPointToVisible(r,s,t.autoExtend),this.currentHighlight!=null&&t.isDropEnabled()){this.currentDropTarget=this.getDropTarget(t,r,s,e);var l=t.getView().getState(this.currentDropTarget);this.currentHighlight.highlight(l)}if(this.previewElement!=null){this.previewElement.parentNode==null&&(t.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");var a=this.isGridEnabled()&&t.isGridEnabledEvent(e),o=!0;if(this.currentGuide!=null&&this.currentGuide.isEnabledForEvent(e)){var u=parseInt(this.previewElement.style.width),p=parseInt(this.previewElement.style.height),m=new mxRectangle(0,0,u,p),d=new mxPoint(r,s);d=this.currentGuide.move(m,d,a,!0),o=!1,r=d.x,s=d.y}else if(a){var x=t.view.scale,f=t.view.translate,g=t.gridSize/2;r=(t.snap(r/x-f.x-g)+f.x)*x,s=(t.snap(s/x-f.y-g)+f.y)*x}this.currentGuide!=null&&o&&this.currentGuide.hide(),this.previewOffset!=null&&(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,i,n,r){this.dropHandler.apply(this,arguments),t.container.style.visibility!="hidden"&&t.container.focus()},__mxOutput.mxDragSource=typeof mxDragSource<"u"?mxDragSource:void 0;function mxToolbar(t){this.container=t}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,i,n,r,s){var l=document.createElement(e!=null?"img":"button"),a=r||(s!=null?"mxToolbarMode":"mxToolbarItem");l.className=a,l.setAttribute("src",e),t!=null&&(e!=null?l.setAttribute("title",t):mxUtils.write(l,t)),this.container.appendChild(l),i!=null&&(mxEvent.addListener(l,"click",i),mxClient.IS_TOUCH&&mxEvent.addListener(l,"touchend",i));var o=mxUtils.bind(this,function(u){n!=null?l.setAttribute("src",e):l.style.backgroundColor=""});return mxEvent.addGestureListeners(l,mxUtils.bind(this,function(u){if(n!=null?l.setAttribute("src",n):l.style.backgroundColor="gray",s!=null){this.menu==null&&(this.menu=new mxPopupMenu,this.menu.init());var p=this.currentImg;if(this.menu.isMenuShowing()&&this.menu.hideMenu(),p!=l){this.currentImg=l,this.menu.factoryMethod=s;var m=new mxPoint(l.offsetLeft,l.offsetTop+l.offsetHeight);this.menu.popup(m.x,m.y,null,u),this.menu.isMenuShowing()&&(l.className=a+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this),l.className=a,this.currentImg=null})}}}),null,o),mxEvent.addListener(l,"mouseout",o),l},mxToolbar.prototype.addCombo=function(t){var e=document.createElement("div");e.style.display="inline",e.className="mxToolbarComboContainer";var i=document.createElement("select");return i.className=t||"mxToolbarCombo",e.appendChild(i),this.container.appendChild(e),i},mxToolbar.prototype.addActionCombo=function(t,e){var i=document.createElement("select");return i.className=e||"mxToolbarCombo",this.addOption(i,t,null),mxEvent.addListener(i,"change",function(n){var r=i.options[i.selectedIndex];i.selectedIndex=0,r.funct!=null&&r.funct(n)}),this.container.appendChild(i),i},mxToolbar.prototype.addOption=function(t,e,i){var n=document.createElement("option");return mxUtils.writeln(n,e),typeof i=="function"?n.funct=i:n.setAttribute("value",i),t.appendChild(n),n},mxToolbar.prototype.addSwitchMode=function(t,e,i,n,r){var s=document.createElement("img");return s.initialClassName=r||"mxToolbarMode",s.className=s.initialClassName,s.setAttribute("src",e),s.altIcon=n,t!=null&&s.setAttribute("title",t),mxEvent.addListener(s,"click",mxUtils.bind(this,function(l){var a=this.selectedMode.altIcon;a!=null?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",a)):this.selectedMode.className=this.selectedMode.initialClassName,this.updateDefaultMode&&(this.defaultMode=s),this.selectedMode=s;var a=s.altIcon;a!=null?(s.altIcon=s.getAttribute("src"),s.setAttribute("src",a)):s.className=s.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT)),i()})),this.container.appendChild(s),this.defaultMode==null&&(this.defaultMode=s,this.selectMode(s),i()),s},mxToolbar.prototype.addMode=function(t,e,i,n,r,s){s=s??!0;var l=document.createElement(e!=null?"img":"button");return l.initialClassName=r||"mxToolbarMode",l.className=l.initialClassName,l.setAttribute("src",e),l.altIcon=n,t!=null&&l.setAttribute("title",t),this.enabled&&s&&(mxEvent.addListener(l,"click",mxUtils.bind(this,function(a){this.selectMode(l,i),this.noReset=!1})),mxEvent.addListener(l,"dblclick",mxUtils.bind(this,function(a){this.selectMode(l,i),this.noReset=!0})),this.defaultMode==null&&(this.defaultMode=l,this.defaultFunction=i,this.selectMode(l,i))),this.container.appendChild(l),l},mxToolbar.prototype.selectMode=function(t,e){if(this.selectedMode!=t){if(this.selectedMode!=null){var i=this.selectedMode.altIcon;i!=null?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",i)):this.selectedMode.className=this.selectedMode.initialClassName}this.selectedMode=t;var i=this.selectedMode.altIcon;i!=null?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",i)):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!=null&&this.menu.destroy()},__mxOutput.mxToolbar=typeof mxToolbar<"u"?mxToolbar:void 0;function mxUndoableEdit(t,e){this.source=t,this.changes=[],this.significant=e??!0}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 this.changes.length==0},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,e=t-1;e>=0;e--){var i=this.changes[e];i.execute!=null?i.execute():i.undo!=null&&i.undo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",i))}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;e0},mxUndoManager.prototype.undo=function(){for(;this.indexOfNextAdd>0;){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.indexOfNextAdd0&&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;e0&&(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 t!=null&&t.substring(0,2)!="//"&&t.substring(0,7)!="http://"&&t.substring(0,8)!="https://"&&t.substring(0,10)!="data:image"&&t.substring(0,7)!="file://"},mxUrlConverter.prototype.convert=function(t){return this.isEnabled()&&this.isRelativeUrl(t)&&(this.getBaseUrl()==null&&this.updateBaseUrl(),t.charAt(0)=="/"?t=this.getBaseDomain()+t:t=this.getBaseUrl()+t),t},__mxOutput.mxUrlConverter=typeof mxUrlConverter<"u"?mxUrlConverter:void 0;function mxPanningManager(t){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(i,n){},mouseMove:function(i,n){},mouseUp:mxUtils.bind(this,function(i,n){this.active&&this.stop()})},t.addMouseListener(this.mouseListener),this.mouseUpListener=mxUtils.bind(this,function(){this.active&&this.stop()}),mxEvent.addListener(document,"mouseup",this.mouseUpListener);var e=mxUtils.bind(this,function(){return this.scrollbars=mxUtils.hasScrollbars(t.container),this.scrollLeft=t.container.scrollLeft,this.scrollTop=t.container.scrollTop,window.setInterval(mxUtils.bind(this,function(){if(this.tdx-=this.dx,this.tdy-=this.dy,this.scrollbars){var i=-t.container.scrollLeft-Math.ceil(this.dx),n=-t.container.scrollTop-Math.ceil(this.dy);t.panGraph(i,n),t.panDx=this.scrollLeft-t.container.scrollLeft,t.panDy=this.scrollTop-t.container.scrollTop,t.fireEvent(new mxEventObject(mxEvent.PAN))}else t.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=t.view.translate.x,this.t0y=t.view.translate.y,this.active=!0},this.panTo=function(i,n,r,s){this.active||this.start(),this.scrollLeft=t.container.scrollLeft,this.scrollTop=t.container.scrollTop,r=r??0,s=s??0;var l=t.container;this.dx=i+r-l.scrollLeft-l.clientWidth,this.dx<0&&Math.abs(this.dx)0&&this.dx0&&this.dya&&(e.div.style.left=Math.max(0,t.div.offsetLeft-n+(mxClient.IS_IE?6:-6))+"px"),mxUtils.fit(e.div)}},mxPopupMenu.prototype.addSeparator=function(t,e){if(t=t||this,this.smartSeparators&&!e)t.willAddSeparator=!0;else if(t.tbody!=null){t.willAddSeparator=!1;var i=document.createElement("tr"),n=document.createElement("td");n.className="mxPopupMenuIcon",n.style.padding="0 0 0 0px",i.appendChild(n);var r=document.createElement("td");r.style.padding="0 0 0 0px",r.setAttribute("colSpan","2");var s=document.createElement("hr");s.setAttribute("size","1"),r.appendChild(s),i.appendChild(r),t.tbody.appendChild(i)}},mxPopupMenu.prototype.popup=function(t,e,i,n){if(this.div!=null&&this.tbody!=null&&this.factoryMethod!=null){for(this.div.style.left=t+"px",this.div.style.top=e+"px";this.tbody.firstChild!=null;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0,this.factoryMethod(this,i,n),this.itemCount>0&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}},mxPopupMenu.prototype.isMenuShowing=function(){return this.div!=null&&this.div.parentNode==document.body},mxPopupMenu.prototype.showMenu=function(){document.documentMode>=9&&(this.div.style.filter="none"),document.body.appendChild(this.div),mxUtils.fit(this.div)},mxPopupMenu.prototype.hideMenu=function(){this.div!=null&&(this.div.parentNode!=null&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1,this.fireEvent(new mxEventObject(mxEvent.HIDE)))},mxPopupMenu.prototype.hideSubmenu=function(t){t.activeRow!=null&&(this.hideSubmenu(t.activeRow),t.activeRow.div.parentNode!=null&&t.activeRow.div.parentNode.removeChild(t.activeRow.div),t.activeRow=null)},mxPopupMenu.prototype.destroy=function(){this.div!=null&&(mxEvent.release(this.div),this.div.parentNode!=null&&this.div.parentNode.removeChild(this.div),this.div=null)},__mxOutput.mxPopupMenu=typeof mxPopupMenu<"u"?mxPopupMenu:void 0;function mxAutoSaveManager(t){this.changeHandler=mxUtils.bind(this,function(e,i){this.isEnabled()&&this.graphModelChanged(i.getProperty("edit").changes)}),this.setGraph(t)}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){this.graph!=null&&this.graph.getModel().removeListener(this.changeHandler),this.graph=t,this.graph!=null&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)},mxAutoSaveManager.prototype.save=function(){},mxAutoSaveManager.prototype.graphModelChanged=function(t){var e=new Date().getTime(),i=(e-this.lastSnapshot)/1e3;i>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&i>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)},__mxOutput.mxAutoSaveManager=typeof mxAutoSaveManager<"u"?mxAutoSaveManager:void 0;function mxAnimation(t){this.delay=t??20}mxAnimation.prototype=new mxEventSource,mxAnimation.prototype.constructor=mxAnimation,mxAnimation.prototype.delay=null,mxAnimation.prototype.thread=null,mxAnimation.prototype.isRunning=function(){return this.thread!=null},mxAnimation.prototype.startAnimation=function(){this.thread==null&&(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(){this.thread!=null&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))},__mxOutput.mxAnimation=typeof mxAnimation<"u"?mxAnimation:void 0;function mxMorphing(t,e,i,n){mxAnimation.call(this,n),this.graph=t,this.steps=e??6,this.ease=i??1.5}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(this.cells!=null)for(var e=0;e=this.steps)&&this.stopAnimation()},mxMorphing.prototype.show=function(t){t.show()},mxMorphing.prototype.animateCell=function(t,e,i){var n=this.graph.getView().getState(t),r=null;if(n!=null&&(r=this.getDelta(n),this.graph.getModel().isVertex(t)&&(r.x!=0||r.y!=0))){var s=this.graph.view.getTranslate(),l=this.graph.view.getScale();r.x+=s.x*l,r.y+=s.y*l,e.moveState(n,-r.x/this.ease,-r.y/this.ease)}if(i&&!this.stopRecursion(n,r))for(var a=this.graph.getModel().getChildCount(t),o=0;o2))for(var t=this.state,e=2;e0&&(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,i,n,r){},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,i,n,r,s,l,a,o){var u=this.state;u.fillColor=t,u.gradientFillAlpha=a??1,u.gradientColor=e,u.gradientAlpha=o??1,u.gradientDirection=l},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){t==null&&(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,i,n){this.addOp(this.quadOp,t,e,i,n)},mxAbstractCanvas2D.prototype.curveTo=function(t,e,i,n,r,s){this.addOp(this.curveOp,t,e,i,n,r,s)},mxAbstractCanvas2D.prototype.arcTo=function(t,e,i,n,r,s,l){var a=mxUtils.arcToCurves(this.lastX,this.lastY,t,e,i,n,r,s,l);if(a!=null)for(var o=0;o0&&(this.defs=i.getElementsByTagName("defs")[0]),this.defs==null&&(this.defs=this.createElement("defs"),i.firstChild!=null?i.insertBefore(this.defs,i.firstChild):i.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle())}}mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D),function(){if(mxSvgCanvas2D.prototype.useDomParser=!mxClient.IS_IE&&typeof DOMParser=="function"&&typeof XMLSerializer=="function",mxSvgCanvas2D.prototype.useDomParser)try{var t=new DOMParser().parseFromString("test text","text/html");mxSvgCanvas2D.prototype.useDomParser=t!=null}catch{mxSvgCanvas2D.prototype.useDomParser=!1}mxSvgCanvas2D.prototype.useAbsoluteIds=!mxClient.IS_CHROMEAPP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&document.getElementsByTagName("base").length>0}(),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 e>0&&(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(this.root.ownerDocument.createElementNS!=null)return this.root.ownerDocument.createElementNS(e||mxConstants.NS_SVG,t);var i=this.root.ownerDocument.createElement(t);return e!=null&&i.setAttribute("xmlns",e),i},mxSvgCanvas2D.prototype.getAlternateText=function(t,e,i,n,r,s,l,a,o,u,p,m,d){return s!=null?this.foAltText:null},mxSvgCanvas2D.prototype.createAlternateContent=function(t,e,i,n,r,s,l,a,o,u,p,m,d){var x=this.getAlternateText(t,e,i,n,r,s,l,a,o,u,p,m,d),f=this.state;if(x!=null&&f.fontSize>0){var g=a==mxConstants.ALIGN_TOP?1:a==mxConstants.ALIGN_BOTTOM?0:.3,c=l==mxConstants.ALIGN_RIGHT?"end":l==mxConstants.ALIGN_LEFT?"start":"middle",v=this.createElement("text");v.setAttribute("x",Math.round(e+f.dx)),v.setAttribute("y",Math.round(i+f.dy+g*f.fontSize)),v.setAttribute("fill",f.fontColor||"black"),v.setAttribute("font-family",f.fontFamily),v.setAttribute("font-size",Math.round(f.fontSize)+"px"),c!="start"&&v.setAttribute("text-anchor",c),(f.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&v.setAttribute("font-weight","bold"),(f.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&v.setAttribute("font-style","italic");var y=[];return(f.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&y.push("underline"),(f.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&y.push("line-through"),y.length>0&&v.setAttribute("text-decoration",y.join(" ")),mxUtils.write(v,x),v}else return null},mxSvgCanvas2D.prototype.createGradientId=function(t,e,i,n,r){t.charAt(0)=="#"&&(t=t.substring(1)),e.charAt(0)=="#"&&(e=e.substring(1)),t=t.toLowerCase()+"-"+i,e=e.toLowerCase()+"-"+n;var s=null;if(r==null||r==mxConstants.DIRECTION_SOUTH)s="s";else if(r==mxConstants.DIRECTION_EAST)s="e";else{var l=t;t=e,e=l,r==mxConstants.DIRECTION_NORTH?s="s":r==mxConstants.DIRECTION_WEST&&(s="e")}return"mx-gradient-"+t+"-"+e+"-"+s},mxSvgCanvas2D.prototype.getSvgGradient=function(t,e,i,n,r){var s=this.createGradientId(t,e,i,n,r),l=this.gradients[s];if(l==null){var a=this.root.ownerSVGElement,o=0,u=s+"-"+o;if(a!=null)for(l=a.ownerDocument.getElementById(u);l!=null&&l.ownerSVGElement!=a;)u=s+"-"+o++,l=a.ownerDocument.getElementById(u);else u="id"+ ++this.refCount;l==null&&(l=this.createSvgGradient(t,e,i,n,r),l.setAttribute("id",u),this.defs!=null?this.defs.appendChild(l):a.appendChild(l)),this.gradients[s]=l}return l.getAttribute("id")},mxSvgCanvas2D.prototype.createSvgGradient=function(t,e,i,n,r){var s=this.createElement("linearGradient");s.setAttribute("x1","0%"),s.setAttribute("y1","0%"),s.setAttribute("x2","0%"),s.setAttribute("y2","0%"),r==null||r==mxConstants.DIRECTION_SOUTH?s.setAttribute("y2","100%"):r==mxConstants.DIRECTION_EAST?s.setAttribute("x2","100%"):r==mxConstants.DIRECTION_NORTH?s.setAttribute("y1","100%"):r==mxConstants.DIRECTION_WEST&&s.setAttribute("x1","100%");var l=i<1?";stop-opacity:"+i:"",a=this.createElement("stop");return a.setAttribute("offset","0%"),a.setAttribute("style","stop-color:"+t+l),s.appendChild(a),l=n<1?";stop-opacity:"+n:"",a=this.createElement("stop"),a.setAttribute("offset","100%"),a.setAttribute("style","stop-color:"+e+l),s.appendChild(a),s},mxSvgCanvas2D.prototype.addNode=function(t,e){var i=this.node,n=this.state;if(i!=null){if(i.nodeName=="path")if(this.path!=null&&this.path.length>0)i.setAttribute("d",this.path.join(" "));else return;t&&n.fillColor!=null?this.updateFill():this.styleEnabled||(i.nodeName=="ellipse"&&mxClient.IS_FF?i.setAttribute("fill","transparent"):i.setAttribute("fill","none"),t=!1),e&&n.strokeColor!=null?this.updateStroke():this.styleEnabled||i.setAttribute("stroke","none"),n.transform!=null&&n.transform.length>0&&i.setAttribute("transform",n.transform),n.shadow&&this.root.appendChild(this.createShadow(i)),this.strokeTolerance>0&&!t&&this.root.appendChild(this.createTolerance(i)),this.pointerEvents?i.setAttribute("pointer-events",this.pointerEventsValue):!this.pointerEvents&&this.originalRoot==null&&i.setAttribute("pointer-events","none"),(i.nodeName!="rect"&&i.nodeName!="path"&&i.nodeName!="ellipse"||i.getAttribute("fill")!="none"&&i.getAttribute("fill")!="transparent"||i.getAttribute("stroke")!="none"||i.getAttribute("pointer-events")!="none")&&this.root.appendChild(i),this.node=null}},mxSvgCanvas2D.prototype.updateFill=function(){var t=this.state;if((t.alpha<1||t.fillAlpha<1)&&this.node.setAttribute("fill-opacity",t.alpha*t.fillAlpha),t.fillColor!=null)if(t.gradientColor!=null){var e=this.getSvgGradient(String(t.fillColor),String(t.gradientColor),t.gradientFillAlpha,t.gradientAlpha,t.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var i=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");this.node.setAttribute("fill","url("+i+"#"+e+")")}else this.node.setAttribute("fill","url(#"+e+")")}else this.node.setAttribute("fill",String(t.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();e!=1&&this.node.setAttribute("stroke-width",e),this.node.nodeName=="path"&&this.updateStrokeAttributes(),t.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((t.fixDash?1:t.strokeWidth)*t.scale))},mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var t=this.state;if(t.lineJoin!=null&&t.lineJoin!="miter"&&this.node.setAttribute("stroke-linejoin",t.lineJoin),t.lineCap!=null){var e=t.lineCap;e=="flat"&&(e="butt"),e!="butt"&&this.node.setAttribute("stroke-linecap",e)}t.miterLimit!=null&&(!this.styleEnabled||t.miterLimit!=10)&&this.node.setAttribute("stroke-miterlimit",t.miterLimit)},mxSvgCanvas2D.prototype.createDashPattern=function(t){var e=[];if(typeof this.state.dashPattern=="string"){var i=this.state.dashPattern.split(" ");if(i.length>0)for(var n=0;n0&&this.node.setAttribute("rx",this.format(r*this.state.scale)),s>0&&this.node.setAttribute("ry",this.format(s*this.state.scale))},mxSvgCanvas2D.prototype.ellipse=function(t,e,i,n){var r=this.state,s=this.createElement("ellipse");s.setAttribute("cx",this.format((t+i/2+r.dx)*r.scale)),s.setAttribute("cy",this.format((e+n/2+r.dy)*r.scale)),s.setAttribute("rx",i/2*r.scale),s.setAttribute("ry",n/2*r.scale),this.node=s},mxSvgCanvas2D.prototype.image=function(t,e,i,n,r,s,l,a){r=this.converter.convert(r),s=s??!0,l=l??!1,a=a??!1;var o=this.state;t+=o.dx,e+=o.dy;var u=this.createElement("image");u.setAttribute("x",this.format(t*o.scale)+this.imageOffset),u.setAttribute("y",this.format(e*o.scale)+this.imageOffset),u.setAttribute("width",this.format(i*o.scale)),u.setAttribute("height",this.format(n*o.scale)),u.setAttributeNS==null?u.setAttribute("xlink:href",r):u.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",r),s||u.setAttribute("preserveAspectRatio","none"),(o.alpha<1||o.fillAlpha<1)&&u.setAttribute("opacity",o.alpha*o.fillAlpha);var p=this.state.transform||"";if(l||a){var m=1,d=1,x=0,f=0;l&&(m=-1,x=-i-2*t),a&&(d=-1,f=-n-2*e),p+="scale("+m+","+d+")translate("+x*o.scale+","+f*o.scale+")"}p.length>0&&u.setAttribute("transform",p),this.pointerEvents||u.setAttribute("pointer-events","none"),this.root.appendChild(u)},mxSvgCanvas2D.prototype.convertHtml=function(t){if(this.useDomParser){var e=new DOMParser().parseFromString(t,"text/html");e!=null&&(t=new XMLSerializer().serializeToString(e.body),t.substring(0,5)=="",5)+1)),t.substring(t.length-7,t.length)==""&&(t=t.substring(0,t.length-7)))}else if(document.implementation!=null&&document.implementation.createDocument!=null){var i=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null),n=i.createElement("body");i.documentElement.appendChild(n);var r=document.createElement("div");r.innerHTML=t;for(var s=r.firstChild;s!=null;){var l=s.nextSibling;n.appendChild(i.adoptNode(s)),s=l}return n.innerHTML}else{var a=document.createElement("textarea");a.innerHTML=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(//g,">"),t=a.value.replace(/&/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/
/g,"
").replace(/
/g,"
").replace(/(]+)>/gm,"$1 />")}return t},mxSvgCanvas2D.prototype.createDiv=function(t){var e=t;if(mxUtils.isNode(e)||(e="
"+this.convertHtml(e)+"
"),!mxClient.IS_IE&&!mxClient.IS_IE11&&document.createElementNS){var i=document.createElementNS("http://www.w3.org/1999/xhtml","div");if(mxUtils.isNode(e)){var n=document.createElement("div"),r=n.cloneNode(!1);this.root.ownerDocument!=document?n.appendChild(e.cloneNode(!0)):n.appendChild(e),r.appendChild(n),i.appendChild(r)}else i.innerHTML=e;return i}else return mxUtils.isNode(e)&&(e="
"+mxUtils.getXml(e)+"
"),e='
'+e+"
",mxUtils.parseXml(e).documentElement},mxSvgCanvas2D.prototype.updateText=function(t,e,i,n,r,s,l,a,o,u,p){p!=null&&p.firstChild!=null&&p.firstChild.firstChild!=null&&this.updateTextNodes(t,e,i,n,r,s,l,a,o,u,p.firstChild)},mxSvgCanvas2D.prototype.addForeignObject=function(t,e,i,n,r,s,l,a,o,u,p,m,d,x,f){var g=this.createElement("g"),c=this.createElement("foreignObject");if(c.setAttribute("style","overflow: visible; text-align: left;"),c.setAttribute("pointer-events","none"),x.ownerDocument!=document&&(x=mxUtils.importNodeImplementation(c.ownerDocument,x,!0)),c.appendChild(x),g.appendChild(c),this.updateTextNodes(t,e,i,n,s,l,a,u,p,m,g),this.root.ownerDocument!=document){var v=this.createAlternateContent(c,t,e,i,n,r,s,l,a,o,u,p,m);if(v!=null){c.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var y=this.createElement("switch");y.appendChild(c),y.appendChild(v),g.appendChild(y)}}f.appendChild(g)},mxSvgCanvas2D.prototype.updateTextNodes=function(t,e,i,n,r,s,l,a,o,u,p){var m=this.state.scale;mxSvgCanvas2D.createCss(i+2,n,r,s,l,a,o,this.state.fontBackgroundColor!=null?this.state.fontBackgroundColor:null,this.state.fontBorderColor!=null?this.state.fontBorderColor:null,"display: flex; align-items: unsafe "+(s==mxConstants.ALIGN_TOP?"flex-start":s==mxConstants.ALIGN_BOTTOM?"flex-end":"center")+"; justify-content: unsafe "+(r==mxConstants.ALIGN_LEFT?"flex-start":r==mxConstants.ALIGN_RIGHT?"flex-end":"center")+"; ",this.getTextCss(),m,mxUtils.bind(this,function(d,x,f,g,c){t+=this.state.dx,e+=this.state.dy;var v=p.firstChild,y=v.firstChild,T=y.firstChild,C=T.firstChild,S=(this.rotateHtml?this.state.rotation:0)+(u??0),E=(this.foOffset!=0?"translate("+this.foOffset+" "+this.foOffset+")":"")+(m!=1?"scale("+m+")":"");C.setAttribute("style",c),T.setAttribute("style",g),v.setAttribute("width",Math.ceil(1/Math.min(1,m)*100)+"%"),v.setAttribute("height",Math.ceil(1/Math.min(1,m)*100)+"%");var L=Math.round(e+x);L<0?v.setAttribute("y",L):(v.removeAttribute("y"),f+="padding-top: "+L+"px; "),y.setAttribute("style",f+"margin-left: "+Math.round(t+d)+"px;"),E+=S!=0?"rotate("+S+" "+t+" "+e+")":"",E!=""?p.setAttribute("transform",E):p.removeAttribute("transform"),this.state.alpha!=1?p.setAttribute("opacity",this.state.alpha):p.removeAttribute("opacity")}))},mxSvgCanvas2D.createCss=function(t,e,i,n,r,s,l,a,o,u,p,m,d){var x="box-sizing: border-box; font-size: 0; text-align: "+(i==mxConstants.ALIGN_LEFT?"left":i==mxConstants.ALIGN_RIGHT?"right":"center")+"; ",f=mxUtils.getAlignmentAsPoint(i,n),g="overflow: hidden; ",c="width: 1px; ",v="height: 1px; ",y=f.x*t,T=f.y*e;l?(c="width: "+Math.round(t)+"px; ",x+="max-height: "+Math.round(e)+"px; ",T=0):s=="fill"?(c="width: "+Math.round(t)+"px; ",v="height: "+Math.round(e)+"px; ",p+="width: 100%; height: 100%; ",x+=c+v):s=="width"?(c="width: "+Math.round(t)+"px; ",p+="width: 100%; ",x+=c,T=0,e>0&&(x+="max-height: "+Math.round(e)+"px; ")):(g="",T=0);var C="";a!=null&&(C+="background-color: "+a+"; "),o!=null&&(C+="border: 1px solid "+o+"; "),g==""||l?p+=C:x+=C,r&&t>0?(p+="white-space: normal; word-wrap: "+mxConstants.WORD_WRAP+"; ",c="width: "+Math.round(t)+"px; ",g!=""&&s!="fill"&&(T=0)):(p+="white-space: nowrap; ",g==""&&(y=0)),d(y,T,u+c+v,x+g,p,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,i="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&&(i+="font-weight: bold; "),(t.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(i+="font-style: italic; ");var n=[];return(t.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.push("underline"),(t.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&n.push("line-through"),n.length>0&&(i+="text-decoration: "+n.join(" ")+"; "),i},mxSvgCanvas2D.prototype.text=function(t,e,i,n,r,s,l,a,o,u,p,m,d){if(this.textEnabled&&r!=null)if(m=m??0,this.foEnabled&&o=="html"){var x=this.createDiv(r);x!=null&&(d!=null&&x.setAttribute("dir",d),this.addForeignObject(t,e,i,n,r,s,l,a,o,u,p,m,d,x,this.root))}else this.plainText(t+this.state.dx,e+this.state.dy,i,n,r,s,l,a,u,p,m,d)},mxSvgCanvas2D.prototype.createClip=function(t,e,i,n){t=Math.round(t),e=Math.round(e),i=Math.round(i),n=Math.round(n);for(var r="mx-clip-"+t+"-"+e+"-"+i+"-"+n,s=0,l=r+"-"+s;document.getElementById(l)!=null;)l=r+"-"+ ++s;clip=this.createElement("clipPath"),clip.setAttribute("id",l);var a=this.createElement("rect");return a.setAttribute("x",t),a.setAttribute("y",e),a.setAttribute("width",i),a.setAttribute("height",n),clip.appendChild(a),clip},mxSvgCanvas2D.prototype.plainText=function(t,e,i,n,r,s,l,a,o,u,p,m){p=p??0;var d=this.state,x=d.fontSize,f=this.createElement("g"),g=d.transform||"";if(this.updateFont(f),!this.pointerEvents&&this.originalRoot==null&&f.setAttribute("pointer-events","none"),p!=0&&(g+="rotate("+p+","+this.format(t*d.scale)+","+this.format(e*d.scale)+")"),m!=null&&f.setAttribute("direction",m),u&&i>0&&n>0){var c=t,L=e;s==mxConstants.ALIGN_CENTER?c-=i/2:s==mxConstants.ALIGN_RIGHT&&(c-=i),o!="fill"&&(l==mxConstants.ALIGN_MIDDLE?L-=n/2:l==mxConstants.ALIGN_BOTTOM&&(L-=n));var v=this.createClip(c*d.scale-2,L*d.scale-2,i*d.scale+4,n*d.scale+4);if(this.defs!=null?this.defs.appendChild(v):this.root.appendChild(v),!mxClient.IS_CHROMEAPP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&this.root.ownerDocument==document){var y=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");f.setAttribute("clip-path","url("+y+"#"+v.getAttribute("id")+")")}else f.setAttribute("clip-path","url(#"+v.getAttribute("id")+")")}var T=s==mxConstants.ALIGN_RIGHT?"end":s==mxConstants.ALIGN_CENTER?"middle":"start";T!="start"&&f.setAttribute("text-anchor",T),(!this.styleEnabled||x!=mxConstants.DEFAULT_FONTSIZE)&&f.setAttribute("font-size",x*d.scale+"px"),g.length>0&&f.setAttribute("transform",g),d.alpha<1&&f.setAttribute("opacity",d.alpha);var C=r.split(` `),S=Math.round(x*mxConstants.LINE_HEIGHT),E=x+(C.length-1)*S,L=e+x-1;if(l==mxConstants.ALIGN_MIDDLE)if(o=="fill")L-=n/2;else{var A=(this.matchHtmlAlignment&&u&&n>0?Math.min(E,n):E)/2;L-=A}else if(l==mxConstants.ALIGN_BOTTOM)if(o=="fill")L-=n;else{var A=this.matchHtmlAlignment&&u&&n>0?Math.min(E,n):E;L-=A+1}for(var M=0;M0&&mxUtils.trim(C[M]).length>0){var I=this.createElement("text");I.setAttribute("x",this.format(t*d.scale)+this.textOffset),I.setAttribute("y",this.format(L*d.scale)+this.textOffset),mxUtils.write(I,C[M]),f.appendChild(I)}L+=S}this.root.appendChild(f),this.addTextBackground(f,r,t,e,i,o=="fill"?n:E,s,l,o)},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 i=[];(e.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(e.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&t.setAttribute("text-decoration",i.join(" "))},mxSvgCanvas2D.prototype.addTextBackground=function(t,e,i,n,r,s,l,a,o){var u=this.state;if(u.fontBackgroundColor!=null||u.fontBorderColor!=null){var p=null;if(o=="fill"||o=="width")l==mxConstants.ALIGN_CENTER?i-=r/2:l==mxConstants.ALIGN_RIGHT&&(i-=r),a==mxConstants.ALIGN_MIDDLE?n-=s/2:a==mxConstants.ALIGN_BOTTOM&&(n-=s),p=new mxRectangle((i+1)*u.scale,n*u.scale,(r-2)*u.scale,(s+2)*u.scale);else if(t.getBBox!=null&&this.root.ownerDocument==document)try{p=t.getBBox();var m=mxClient.IS_IE&&mxClient.IS_SVG;p=new mxRectangle(p.x,p.y+(m?0:1),p.width,p.height+(m?1:0))}catch{}if(p==null||p.width==0||p.height==0){var d=document.createElement("div");d.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?u.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,d.style.fontSize=u.fontSize+"px",d.style.fontFamily=u.fontFamily,d.style.whiteSpace="nowrap",d.style.position="absolute",d.style.visibility="hidden",d.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",d.style.zoom="1",(u.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(d.style.fontWeight="bold"),(u.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(d.style.fontStyle="italic"),e=mxUtils.htmlEntities(e,!1),d.innerHTML=e.replace(/\n/g,"
"),document.body.appendChild(d);var r=d.offsetWidth,s=d.offsetHeight;d.parentNode.removeChild(d),l==mxConstants.ALIGN_CENTER?i-=r/2:l==mxConstants.ALIGN_RIGHT&&(i-=r),a==mxConstants.ALIGN_MIDDLE?n-=s/2:a==mxConstants.ALIGN_BOTTOM&&(n-=s),p=new mxRectangle((i+1)*u.scale,(n+2)*u.scale,r*u.scale,(s+1)*u.scale)}if(p!=null){var x=this.createElement("rect");x.setAttribute("fill",u.fontBackgroundColor||"none"),x.setAttribute("stroke",u.fontBorderColor||"none"),x.setAttribute("x",Math.floor(p.x-1)),x.setAttribute("y",Math.floor(p.y-1)),x.setAttribute("width",Math.ceil(p.width+2)),x.setAttribute("height",Math.ceil(p.height));var f=u.fontBorderColor!=null?Math.max(1,this.format(u.scale)):0;x.setAttribute("stroke-width",f),this.root.ownerDocument==document&&mxUtils.mod(f,2)==1&&x.setAttribute("transform","translate(0.5, 0.5)"),t.insertBefore(x,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)},__mxOutput.mxSvgCanvas2D=typeof mxSvgCanvas2D<"u"?mxSvgCanvas2D:void 0;var mxVmlCanvas2D=function(t){mxAbstractCanvas2D.call(this),this.root=t};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 i=this.node,n=this.state;if(i!=null){if(i.nodeName=="shape")if(this.path!=null&&this.path.length>0)i.path=this.path.join(" ")+" e",i.style.width=this.root.style.width,i.style.height=this.root.style.height,i.coordsize=parseInt(i.style.width)+" "+parseInt(i.style.height);else return;i.strokeweight=this.format(Math.max(1,n.strokeWidth*n.scale/this.vmlScale))+"px",n.shadow&&this.root.appendChild(this.createShadow(i,t&&n.fillColor!=null,e&&n.strokeColor!=null)),e&&n.strokeColor!=null?(i.stroked="true",i.strokecolor=n.strokeColor):i.stroked="false",i.appendChild(this.createStroke()),t&&n.fillColor!=null?i.appendChild(this.createFill()):this.pointerEvents&&(i.nodeName!="shape"||this.path[this.path.length-1]==this.closeOp)?i.appendChild(this.createTransparentFill()):i.filled="false",this.root.appendChild(i)}},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=this.state,e=this.createVmlElement("fill");if(e.color=t.fillColor,t.gradientColor!=null){e.type="gradient",e.method="none",e.color2=t.gradientColor;var i=180-t.rotation;t.gradientDirection==mxConstants.DIRECTION_WEST?i-=90+(this.root.style.flip=="x"?180:0):t.gradientDirection==mxConstants.DIRECTION_EAST?i+=90+(this.root.style.flip=="x"?180:0):t.gradientDirection==mxConstants.DIRECTION_NORTH?i-=180+(this.root.style.flip=="y"?-180:0):i+=this.root.style.flip=="y"?-180:0,(this.root.style.flip=="x"||this.root.style.flip=="y")&&(i*=-1),e.angle=mxUtils.mod(i,360),e.opacity=t.alpha*t.gradientFillAlpha*100+"%",e.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",t.alpha*t.gradientAlpha*100+"%")}else(t.alpha<1||t.fillAlpha<1)&&(e.opacity=t.alpha*t.fillAlpha*100+"%");return e},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="dash";if(typeof this.state.dashPattern=="string"){var e=this.state.dashPattern.split(" ");e.length>0&&e[0]==1&&(t="0 2")}return t},mxVmlCanvas2D.prototype.createShadow=function(t,e,i){var n=this.state,r=-n.rotation*(Math.PI/180),s=Math.cos(r),l=Math.sin(r),a=n.shadowDx*n.scale,o=n.shadowDy*n.scale;this.root.style.flip=="x"?a*=-1:this.root.style.flip=="y"&&(o*=-1);var u=t.cloneNode(!0);return u.style.marginLeft=Math.round(a*s-o*l)+"px",u.style.marginTop=Math.round(a*l+o*s)+"px",document.documentMode==8&&(u.strokeweight=t.strokeweight,t.nodeName=="shape"&&(u.path=this.path.join(" ")+" e",u.style.width=this.root.style.width,u.style.height=this.root.style.height,u.coordsize=parseInt(t.style.width)+" "+parseInt(t.style.height))),i?(u.strokecolor=n.shadowColor,u.appendChild(this.createShadowStroke())):u.stroked="false",e?u.appendChild(this.createShadowFill()):u.filled="false",u},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,i,n,r){e&&i?t+=180:e?this.root.style.flip="x":i&&(this.root.style.flip="y"),(e?!i:i)&&(t*=-1),this.root.style.rotation=t,this.state.rotation=this.state.rotation+t,this.state.rotationCx=n,this.state.rotationCy=r},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,i,n){var r=this.state,s=(this.lastX+r.dx)*r.scale,l=(this.lastY+r.dy)*r.scale,a=(t+r.dx)*r.scale,o=(e+r.dy)*r.scale,u=(i+r.dx)*r.scale,p=(n+r.dy)*r.scale,m=s+2/3*(a-s),d=l+2/3*(o-l),x=u+2/3*(a-u),f=p+2/3*(o-p);this.path.push("c "+this.format(m)+" "+this.format(d)+" "+this.format(x)+" "+this.format(f)+" "+this.format(u)+" "+this.format(p)),this.lastX=u/r.scale-r.dx,this.lastY=p/r.scale-r.dy},mxVmlCanvas2D.prototype.createRect=function(t,e,i,n,r){var s=this.state,l=this.createVmlElement(t);return l.style.position="absolute",l.style.left=this.format((e+s.dx)*s.scale)+"px",l.style.top=this.format((i+s.dy)*s.scale)+"px",l.style.width=this.format(n*s.scale)+"px",l.style.height=this.format(r*s.scale)+"px",l},mxVmlCanvas2D.prototype.rect=function(t,e,i,n){this.node=this.createRect("rect",t,e,i,n)},mxVmlCanvas2D.prototype.roundrect=function(t,e,i,n,r,s){this.node=this.createRect("roundrect",t,e,i,n),this.node.setAttribute("arcsize",Math.max(r*100/i,s*100/n)+"%")},mxVmlCanvas2D.prototype.ellipse=function(t,e,i,n){this.node=this.createRect("oval",t,e,i,n)},mxVmlCanvas2D.prototype.image=function(t,e,i,n,r,s,l,a){var o=null;if(!s)o=this.createRect("image",t,e,i,n),o.src=r;else{o=this.createRect("rect",t,e,i,n),o.stroked="false";var u=this.createVmlElement("fill");u.aspect=s?"atmost":"ignore",u.rotate="true",u.type="frame",u.src=r,o.appendChild(u)}l&&a?o.style.rotation="180":l?o.style.flip="x":a&&(o.style.flip="y"),(this.state.alpha<1||this.state.fillAlpha<1)&&(o.style.filter+="alpha(opacity="+this.state.alpha*this.state.fillAlpha*100+")"),this.root.appendChild(o)},mxVmlCanvas2D.prototype.createDiv=function(t,e,i,n){var r=this.createElement("div"),s=this.state,l="";if(s.fontBackgroundColor!=null&&(l+="background-color:"+mxUtils.htmlEntities(s.fontBackgroundColor)+";"),s.fontBorderColor!=null&&(l+="border:1px solid "+mxUtils.htmlEntities(s.fontBorderColor)+";"),mxUtils.isNode(t))r.appendChild(t);else if(n!="fill"&&n!="width"){var a=this.createElement("div");a.style.cssText=l,a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",a.style.zoom="1",a.style.textDecoration="inherit",a.innerHTML=t,r.appendChild(a)}else r.style.cssText=l,r.innerHTML=t;var o=r.style;return o.fontSize=s.fontSize/this.vmlScale+"px",o.fontFamily=s.fontFamily,o.color=s.fontColor,o.verticalAlign="top",o.textAlign=e||"left",o.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?s.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale+"px":mxConstants.LINE_HEIGHT,(s.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(o.fontWeight="bold"),(s.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(o.fontStyle="italic"),(s.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(o.textDecoration="underline"),r},mxVmlCanvas2D.prototype.text=function(t,e,i,n,r,s,l,a,o,u,p,m,d){if(this.textEnabled&&r!=null){var x=this.state;if(o=="html"){if(x.rotation!=null){var f=this.rotatePoint(t,e,x.rotation,x.rotationCx,x.rotationCy);t=f.x,e=f.y}document.documentMode==8&&!mxClient.IS_EM?(t+=x.dx,e+=x.dy,u!="fill"&&l==mxConstants.ALIGN_TOP&&(e-=1)):(t*=x.scale,e*=x.scale);var g=document.documentMode==8&&!mxClient.IS_EM?this.createVmlElement("group"):this.createElement("div");g.style.position="absolute",g.style.display="inline",g.style.left=this.format(t)+"px",g.style.top=this.format(e)+"px",g.style.zoom=x.scale;var c=this.createElement("div");c.style.position="relative",c.style.display="inline";var v=mxUtils.getAlignmentAsPoint(s,l),y=v.x,T=v.y,C=this.createDiv(r,s,l,u),S=this.createElement("div");if(d!=null&&C.setAttribute("dir",d),a&&i>0){if(p||(C.style.width=Math.round(i)+"px"),C.style.wordWrap=mxConstants.WORD_WRAP,C.style.whiteSpace="normal",C.style.wordWrap=="break-word"){var E=C;E.firstChild!=null&&E.firstChild.nodeName=="DIV"&&(E.firstChild.style.width="100%")}}else C.style.whiteSpace="nowrap";var L=x.rotation+(m||0);if(this.rotateHtml&&L!=0?(S.style.display="inline",S.style.zoom="1",S.appendChild(C),document.documentMode==8&&!mxClient.IS_EM&&this.root.nodeName!="DIV"?(c.appendChild(S),g.appendChild(c)):g.appendChild(S)):document.documentMode==8&&!mxClient.IS_EM?(c.appendChild(C),g.appendChild(c)):(C.style.display="inline",g.appendChild(C)),this.root.nodeName!="DIV"){var A=this.createVmlElement("rect");A.stroked="false",A.filled="false",A.appendChild(g),this.root.appendChild(A)}else this.root.appendChild(g);if(p?(C.style.overflow="hidden",C.style.width=Math.round(i)+"px",mxClient.IS_QUIRKS||(C.style.maxHeight=Math.round(n)+"px")):u=="fill"?(C.style.overflow="hidden",C.style.width=Math.max(0,i)+1+"px",C.style.height=Math.max(0,n)+1+"px"):u=="width"&&(C.style.overflow="hidden",C.style.width=Math.max(0,i)+1+"px",C.style.maxHeight=Math.max(0,n)+1+"px"),this.rotateHtml&&L!=0){var M=L*(Math.PI/180),I=parseFloat(parseFloat(Math.cos(M)).toFixed(8)),P=parseFloat(parseFloat(Math.sin(-M)).toFixed(8));M%=2*Math.PI,M<0&&(M+=2*Math.PI),M%=Math.PI,M>Math.PI/2&&(M=Math.PI-M);var R=Math.cos(M),O=Math.sin(M);document.documentMode==8&&!mxClient.IS_EM&&(C.style.display="inline-block",S.style.display="inline-block",c.style.display="inline-block"),C.style.visibility="hidden",C.style.position="absolute",document.body.appendChild(C);var _=C;_.firstChild!=null&&_.firstChild.nodeName=="DIV"&&(_=_.firstChild);var E=_.offsetWidth+3,b=_.offsetHeight;p?(i=Math.min(i,E),b=Math.min(b,n)):i=E,a&&(C.style.width=i+"px"),mxClient.IS_QUIRKS&&(p||u=="width")&&b>n&&(b=n,C.style.height=b+"px"),n=b;var k=(n-n*R+i*-O)/2-P*i*(y+.5)+I*n*(T+.5),G=(i-i*R+n*-O)/2+I*i*(y+.5)+P*n*(T+.5);if(g.nodeName=="group"&&this.root.nodeName=="DIV"){var B=this.createElement("div");B.style.display="inline-block",B.style.position="absolute",B.style.left=this.format(t+(G-i/2)*x.scale)+"px",B.style.top=this.format(e+(k-n/2)*x.scale)+"px",g.parentNode.appendChild(B),B.appendChild(g)}else{var j=document.documentMode==8&&!mxClient.IS_EM?1:x.scale;g.style.left=this.format(t+(G-i/2)*j)+"px",g.style.top=this.format(e+(k-n/2)*j)+"px"}S.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+I+", M12="+P+", M21="+-P+", M22="+I+", sizingMethod='auto expand')",S.style.backgroundColor=this.rotatedHtmlBackground,this.state.alpha<1&&(S.style.filter+="alpha(opacity="+this.state.alpha*100+")"),S.appendChild(C),C.style.position="",C.style.visibility=""}else if(document.documentMode!=8||mxClient.IS_EM){C.style.verticalAlign="top",this.state.alpha<1&&(g.style.filter="alpha(opacity="+this.state.alpha*100+")");var H=C.parentNode;C.style.visibility="hidden",document.body.appendChild(C),i=C.offsetWidth;var b=C.offsetHeight;mxClient.IS_QUIRKS&&p&&b>n&&(b=n,C.style.height=b+"px"),n=b,C.style.visibility="",H.appendChild(C),g.style.left=this.format(t+i*y*this.state.scale)+"px",g.style.top=this.format(e+n*T*this.state.scale)+"px"}else this.state.alpha<1&&(C.style.filter="alpha(opacity="+this.state.alpha*100+")"),c.style.left=y*100+"%",c.style.top=T*100+"%"}else this.plainText(t,e,i,n,mxUtils.htmlEntities(r,!1),s,l,a,o,u,p,m,d)}},mxVmlCanvas2D.prototype.plainText=function(t,e,i,n,r,s,l,a,o,u,p,m,d){var x=this.state;t=(t+x.dx)*x.scale,e=(e+x.dy)*x.scale;var f=this.createVmlElement("shape");f.style.width="1px",f.style.height="1px",f.stroked="false";var g=this.createVmlElement("fill");g.color=x.fontColor,g.opacity=x.alpha*100+"%",f.appendChild(g);var c=this.createVmlElement("path");c.textpathok="true",c.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0),f.appendChild(c);var v=this.createVmlElement("textpath");v.style.cssText="v-text-align:"+s,v.style.align=s,v.style.fontFamily=x.fontFamily,v.string=r,v.on="true";var y=x.fontSize*x.scale/this.vmlScale;v.style.fontSize=y+"px",(x.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(v.style.fontWeight="bold"),(x.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(v.style.fontStyle="italic"),(x.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(v.style.textDecoration="underline");var T=r.split(` `),C=y+(T.length-1)*y*mxConstants.LINE_HEIGHT,S=0,E=0;if(l==mxConstants.ALIGN_BOTTOM?E=-C/2:l!=mxConstants.ALIGN_MIDDLE&&(E=C/2),m!=null){f.style.rotation=m;var L=m*(Math.PI/180);S=Math.sin(L)*E,E=Math.cos(L)*E}f.appendChild(v),f.style.left=this.format(t-S)+"px",f.style.top=this.format(e+E)+"px",this.root.appendChild(f)},mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},__mxOutput.mxVmlCanvas2D=typeof mxVmlCanvas2D<"u"?mxVmlCanvas2D:void 0;function mxGuide(t,e){this.graph=t,this.setStates(e)}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(t,e,i,n){if(this.states!=null&&(this.horizontal||this.vertical)&&t!=null&&e!=null){let R=function(_,b,k){var G=!1;k&&Math.abs(_-v)0&&t[0]!=null){this.bounds=new mxRectangle(Number(t[0].x),Number(t[0].y),1,1);for(var e=1;e0&&this.bounds!=null&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&this.bounds.width>0&&this.bounds.height>0},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();t!=null&&(t.pointerEvents=this.pointerEvents,this.beforePaint(t),this.paint(t),this.afterPaint(t),this.node!=t.root&&this.node.insertAdjacentHTML("beforeend",t.root.outerHTML),this.node.nodeName=="DIV"&&document.documentMode==8&&(this.node.style.filter="",mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(t))},mxShape.prototype.createCanvas=function(){var t=null;return this.node.ownerSVGElement!=null?t=this.createSvgCanvas():mxClient.IS_VML&&(this.updateVmlContainer(),t=this.createVmlCanvas()),t!=null&&this.outline&&(t.setStrokeWidth(this.strokewidth),t.setStrokeColor(this.stroke),this.isDashed!=null&&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 e!=0?this.node.setAttribute("transform","translate("+e+","+e+")"):this.node.removeAttribute("transform"),t.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(t.format=function(i){return Math.round(parseFloat(i))}),t},mxShape.prototype.createVmlCanvas=function(){var t=document.documentMode==8&&this.isParseVml()?this.createVmlGroup():this.node,e=new mxVmlCanvas2D(t);if(t.tagUrn!=""){var i=Math.max(1,Math.round(this.bounds.width)),n=Math.max(1,Math.round(this.bounds.height));t.coordsize=i*this.vmlScale+","+n*this.vmlScale,e.scale(this.vmlScale),e.vmlScale=this.vmlScale}var r=this.scale;return e.translate(-Math.round(this.bounds.x/r),-Math.round(this.bounds.y/r)),e},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="";if(this.opacity<100&&(e+="alpha(opacity="+this.opacity+")"),this.isShadow&&(e+="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+"')"),this.fill!=null&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var i=this.fill,n=this.gradient,r="0",s={east:0,south:1,west:2,north:3},l=this.direction!=null?s[this.direction]:0;if(this.gradientDirection!=null&&(l=mxUtils.mod(l+s[this.gradientDirection]-1,4)),l==1){r="1";var a=i;i=n,n=a}else if(l==2){var a=i;i=n,n=a}else l==3&&(r="1");e+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+i+"', endColorStr='"+n+"', gradientType='"+r+"')"}t.style.filter=e},mxShape.prototype.updateHtmlColors=function(t){var e=this.stroke;e!=null&&e!=mxConstants.NONE?(t.style.borderColor=e,this.isDashed?t.style.borderStyle="dashed":this.strokewidth>0&&(t.style.borderStyle="solid"),t.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):t.style.borderWidth="0px",e=this.outline?null:this.fill,e!=null&&e!=mxConstants.NONE?(t.style.backgroundColor=e,t.style.backgroundImage="none"):this.pointerEvents?t.style.backgroundColor="transparent":document.documentMode==8?mxUtils.addTransparentBackgroundFilter(t):this.setTransparentBackgroundImage(t)},mxShape.prototype.updateHtmlBounds=function(t){var e=document.documentMode>=9?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",document.compatMode=="CSS1Compat"&&(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 i=t.gradients[e];i!=null&&(i.mxRefCount=(i.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=!1;if(t!=null&&this.outline){var i=t.stroke;t.stroke=function(){e=!0,i.apply(this,arguments)};var n=t.fillAndStroke;t.fillAndStroke=function(){e=!0,n.apply(this,arguments)}}var r=this.scale,s=this.bounds.x/r,l=this.bounds.y/r,a=this.bounds.width/r,o=this.bounds.height/r;if(this.isPaintBoundsInverted()){var u=(a-o)/2;s+=u,l-=u;var p=a;a=o,o=p}this.updateTransform(t,s,l,a,o),this.configureCanvas(t,s,l,a,o);var m=null;if(this.stencil==null&&this.points==null&&this.shapePointerEvents||this.stencil!=null&&this.stencilPointerEvents){var d=this.createBoundingBox();if(this.dialect==mxConstants.DIALECT_SVG)m=this.createTransparentSvgRectangle(d.x,d.y,d.width,d.height),this.node.appendChild(m);else{var x=t.createRect("rect",d.x/r,d.y/r,d.width/r,d.height/r);x.appendChild(t.createTransparentFill()),x.stroked="false",t.root.appendChild(x)}}if(this.stencil!=null)this.stencil.drawShape(t,this,s,l,a,o);else if(t.setStrokeWidth(this.strokewidth),this.points!=null){for(var f=[],g=0;g0){l=l??!0;var a=e[e.length-1];if(r&&i){e=e.slice();var o=e[0],u=new mxPoint(a.x+(o.x-a.x)/2,a.y+(o.y-a.y)/2);e.splice(0,0,u)}var p=e[0],m=1;for(l?t.moveTo(p.x,p.y):t.lineTo(p.x,p.y);m<(r?e.length:e.length-1);){var d=e[mxUtils.mod(m,e.length)],x=p.x-d.x,f=p.y-d.y;if(i&&(x!=0||f!=0)&&(s==null||mxUtils.indexOf(s,m-1)<0)){var g=Math.sqrt(x*x+f*f),c=x*Math.min(n,g/2)/g,v=f*Math.min(n,g/2)/g,y=d.x+c,T=d.y+v;t.lineTo(y,T);for(var C=e[mxUtils.mod(m+1,e.length)];m0&&t.height>0){this.boundingBox=new mxRectangle(t.x,t.y,t.width,t.height),this.boundingBox.grow(this.strokewidth*this.scale/2);return}}catch{}if(this.bounds!=null){var e=this.createBoundingBox();if(e!=null){this.augmentBoundingBox(e);var i=this.getShapeRotation();i!=0&&(e=mxUtils.getBoundingBox(e,i))}this.boundingBox=e}},mxShape.prototype.createBoundingBox=function(){var t=this.bounds.clone();return(this.stencil!=null&&(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 this.stencil==null&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)},mxShape.prototype.getRotation=function(){return this.rotation!=null?this.rotation:0},mxShape.prototype.getTextRotation=function(){var t=this.getRotation();return mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)!=1&&(t+=mxText.prototype.verticalTextRotation),t},mxShape.prototype.getShapeRotation=function(){var t=this.getRotation();return this.direction!=null&&(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,i,n){var r=document.createElementNS(mxConstants.NS_SVG,"rect");return r.setAttribute("x",t),r.setAttribute("y",e),r.setAttribute("width",i),r.setAttribute("height",n),r.setAttribute("fill","none"),r.setAttribute("stroke","none"),r.setAttribute("pointer-events","all"),r},mxShape.prototype.setTransparentBackgroundImage=function(t){t.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"},mxShape.prototype.releaseSvgGradients=function(t){if(t!=null)for(var e in t){var i=t[e];i!=null&&(i.mxRefCount=(i.mxRefCount||0)-1,i.mxRefCount==0&&i.parentNode!=null&&i.parentNode.removeChild(i))}},mxShape.prototype.destroy=function(){this.node!=null&&(mxEvent.release(this.node),this.node.parentNode!=null&&this.node.parentNode.removeChild(this.node),this.node=null),this.releaseSvgGradients(this.oldGradients),this.oldGradients=null},__mxOutput.mxShape=typeof mxShape<"u"?mxShape:void 0;function mxStencil(t){this.desc=t,this.parseDescription(),this.parseConstraints()}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=t??"variable";var e=this.desc.getAttribute("strokewidth");this.strokewidth=e??"1"},mxStencil.prototype.parseConstraints=function(){var t=this.desc.getElementsByTagName("connections")[0];if(t!=null){var e=mxUtils.getChildNodes(t);if(e!=null&&e.length>0){this.constraints=[];for(var i=0;i0&&s>0)for(var p=l.firstChild;p!=null;)p.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(t,e,p,a,o,u),p=p.nextSibling},mxStencil.prototype.computeAspect=function(t,e,i,n,r,s){var l=e,a=i,o=n/this.w0,u=r/this.h0,p=s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_SOUTH;if(p){u=n/this.h0,o=r/this.w0;var m=(n-r)/2;l+=m,a-=m}return this.aspect=="fixed"&&(u=Math.min(o,u),o=u,p?(l+=(r-this.w0*o)/2,a+=(n-this.h0*u)/2):(l+=(n-this.w0*o)/2,a+=(r-this.h0*u)/2)),new mxRectangle(l,a,o,u)},mxStencil.prototype.drawNode=function(t,e,i,n,r,s){var l=i.nodeName,a=n.x,o=n.y,u=n.width,p=n.height,m=Math.min(u,p);if(l=="save")t.save();else if(l=="restore")t.restore();else if(s){if(l=="path"){t.begin();var d=!0;if(i.getAttribute("rounded")=="1"){d=!1;for(var x=Number(i.getAttribute("arcSize")),f=0,g=[],c=i.firstChild;c!=null;){if(c.nodeType==mxConstants.NODETYPE_ELEMENT){var v=c.nodeName;if(v=="move"||v=="line")(v=="move"||g.length==0)&&g.push([]),g[g.length-1].push(new mxPoint(a+Number(c.getAttribute("x"))*u,o+Number(c.getAttribute("y"))*p)),f++;else{d=!0;break}}c=c.nextSibling}if(!d&&f>0)for(var y=0;y0&&V.push(Number(X[y])*m);W=V.join(" "),t.setDashPattern(W)}}else l=="strokecolor"?t.setStrokeColor(i.getAttribute("color")):l=="linecap"?t.setLineCap(i.getAttribute("cap")):l=="linejoin"?t.setLineJoin(i.getAttribute("join")):l=="miterlimit"?t.setMiterLimit(Number(i.getAttribute("limit"))):l=="fillcolor"?t.setFillColor(i.getAttribute("color")):l=="alpha"||l=="fillalpha"||l=="strokealpha"?t.setAlpha(i.getAttribute("alpha")):l=="fontcolor"?t.setFontColor(i.getAttribute("color")):l=="fontstyle"?t.setFontStyle(i.getAttribute("style")):l=="fontfamily"?t.setFontFamily(i.getAttribute("family")):l=="fontsize"&&t.setFontSize(Number(i.getAttribute("size"))*m);r&&(l=="fillstroke"||l=="fill"||l=="stroke")&&(r=!1,t.setShadow(!1))}},__mxOutput.mxStencil=typeof mxStencil<"u"?mxStencil:void 0;var mxStencilRegistry={stencils:{},addStencil:function(t,e){mxStencilRegistry.stencils[t]=e},getStencil:function(t){return mxStencilRegistry.stencils[t]}};__mxOutput.mxStencilRegistry=typeof mxStencilRegistry<"u"?mxStencilRegistry:void 0;var mxMarker={markers:[],addMarker:function(t,e){mxMarker.markers[t]=e},createMarker:function(t,e,i,n,r,s,l,a,o,u){var p=mxMarker.markers[i];return p!=null?p(t,e,i,n,r,s,l,a,o,u):null}};(function(){function t(n){return n=n??2,function(r,s,l,a,o,u,p,m,d,x){var f=o*d*1.118,g=u*d*1.118;o=o*(p+d),u=u*(p+d);var c=a.clone();c.x-=f,c.y-=g;var v=l!=mxConstants.ARROW_CLASSIC&&l!=mxConstants.ARROW_CLASSIC_THIN?1:3/4;return a.x+=-o*v-f,a.y+=-u*v-g,function(){r.begin(),r.moveTo(c.x,c.y),r.lineTo(c.x-o-u/n,c.y-u+o/n),(l==mxConstants.ARROW_CLASSIC||l==mxConstants.ARROW_CLASSIC_THIN)&&r.lineTo(c.x-o*3/4,c.y-u*3/4),r.lineTo(c.x+u/n-o,c.y-u-o/n),r.close(),x?r.fillAndStroke():r.stroke()}}}mxMarker.addMarker("classic",t(2)),mxMarker.addMarker("classicThin",t(3)),mxMarker.addMarker("block",t(2)),mxMarker.addMarker("blockThin",t(3));function e(n){return n=n??2,function(r,s,l,a,o,u,p,m,d,x){var f=o*d*1.118,g=u*d*1.118;o=o*(p+d),u=u*(p+d);var c=a.clone();return c.x-=f,c.y-=g,a.x+=-f*2,a.y+=-g*2,function(){r.begin(),r.moveTo(c.x-o-u/n,c.y-u+o/n),r.lineTo(c.x,c.y),r.lineTo(c.x+u/n-o,c.y-u-o/n),r.stroke()}}}mxMarker.addMarker("open",e(2)),mxMarker.addMarker("openThin",e(3)),mxMarker.addMarker("oval",function(n,r,s,l,a,o,u,p,m,d){var x=u/2,f=l.clone();return l.x-=a*x,l.y-=o*x,function(){n.ellipse(f.x-x,f.y-x,u,u),d?n.fillAndStroke():n.stroke()}});function i(n,r,s,l,a,o,u,p,m,d){var x=s==mxConstants.ARROW_DIAMOND?.7071:.9862,f=a*m*x,g=o*m*x;a=a*(u+m),o=o*(u+m);var c=l.clone();c.x-=f,c.y-=g,l.x+=-a-f,l.y+=-o-g;var v=s==mxConstants.ARROW_DIAMOND?2:3.4;return function(){n.begin(),n.moveTo(c.x,c.y),n.lineTo(c.x-a/2-o/v,c.y+a/v-o/2),n.lineTo(c.x-a,c.y-o),n.lineTo(c.x-a/2+o/v,c.y-o/2-a/v),n.close(),d?n.fillAndStroke():n.stroke()}}mxMarker.addMarker("diamond",i),mxMarker.addMarker("diamondThin",i)})(),__mxOutput.mxMarker=typeof mxMarker<"u"?mxMarker:void 0;function mxActor(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxActor,mxShape),mxActor.prototype.paintVertexShape=function(t,e,i,n,r){t.translate(e,i),t.begin(),this.redrawPath(t,e,i,n,r),t.fillAndStroke()},mxActor.prototype.redrawPath=function(t,e,i,n,r){var s=n/3;t.moveTo(0,r),t.curveTo(0,3*r/5,0,2*r/5,n/2,2*r/5),t.curveTo(n/2-s,2*r/5,n/2-s,0,n/2,0),t.curveTo(n/2+s,0,n/2+s,2*r/5,n/2,2*r/5),t.curveTo(n,2*r/5,n,3*r/5,n,r),t.close()},__mxOutput.mxActor=typeof mxActor<"u"?mxActor:void 0;function mxCloud(t,e,i,n){mxActor.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxCloud,mxActor),mxCloud.prototype.redrawPath=function(t,e,i,n,r){t.moveTo(.25*n,.25*r),t.curveTo(.05*n,.25*r,0,.5*r,.16*n,.55*r),t.curveTo(0,.66*r,.18*n,.9*r,.31*n,.8*r),t.curveTo(.4*n,r,.7*n,r,.8*n,.8*r),t.curveTo(n,.8*r,n,.6*r,.875*n,.5*r),t.curveTo(n,.3*r,.8*n,.1*r,.625*n,.2*r),t.curveTo(.5*n,.05*r,.3*n,.05*r,.25*n,.25*r),t.close()},__mxOutput.mxCloud=typeof mxCloud<"u"?mxCloud:void 0;function mxRectangleShape(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxRectangleShape,mxShape),mxRectangleShape.prototype.isHtmlAllowed=function(){var t=!0;return this.style!=null&&(t=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")=="1"),!this.isRounded&&!this.glass&&this.rotation==0&&(t||this.fill!=null&&this.fill!=mxConstants.NONE)},mxRectangleShape.prototype.paintBackground=function(t,e,i,n,r){var s=!0;if(this.style!=null&&(s=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")=="1"),s||this.fill!=null&&this.fill!=mxConstants.NONE||this.stroke!=null&&this.stroke!=mxConstants.NONE){if(!s&&(this.fill==null||this.fill==mxConstants.NONE)&&(t.pointerEvents=!1),this.isRounded){var l=0;if(mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)=="1")l=Math.min(n/2,Math.min(r/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else{var a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.RECTANGLE_ROUNDING_FACTOR*100)/100;l=Math.min(n*a,r*a)}t.roundrect(e,i,n,r,l,l)}else t.rect(e,i,n,r);t.fillAndStroke()}},mxRectangleShape.prototype.isRoundable=function(t,e,i,n,r){return!0},mxRectangleShape.prototype.paintForeground=function(t,e,i,n,r){this.glass&&!this.outline&&this.fill!=null&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(t,e,i,n,r,this.getArcSize(n+this.strokewidth,r+this.strokewidth))},__mxOutput.mxRectangleShape=typeof mxRectangleShape<"u"?mxRectangleShape:void 0;function mxEllipse(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxEllipse,mxShape),mxEllipse.prototype.paintVertexShape=function(t,e,i,n,r){t.ellipse(e,i,n,r),t.fillAndStroke()},__mxOutput.mxEllipse=typeof mxEllipse<"u"?mxEllipse:void 0;function mxDoubleEllipse(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxDoubleEllipse,mxShape),mxDoubleEllipse.prototype.vmlScale=10,mxDoubleEllipse.prototype.paintBackground=function(t,e,i,n,r){t.ellipse(e,i,n,r),t.fillAndStroke()},mxDoubleEllipse.prototype.paintForeground=function(t,e,i,n,r){if(!this.outline){var s=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(n/5,r/5)));e+=s,i+=s,n-=2*s,r-=2*s,n>0&&r>0&&t.ellipse(e,i,n,r),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)},__mxOutput.mxDoubleEllipse=typeof mxDoubleEllipse<"u"?mxDoubleEllipse:void 0;function mxRhombus(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxRhombus,mxShape),mxRhombus.prototype.isRoundable=function(){return!0},mxRhombus.prototype.paintVertexShape=function(t,e,i,n,r){var s=n/2,l=r/2,a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,[new mxPoint(e+s,i),new mxPoint(e+n,i+l),new mxPoint(e+s,i+r),new mxPoint(e,i+l)],this.isRounded,a,!0),t.fillAndStroke()},__mxOutput.mxRhombus=typeof mxRhombus<"u"?mxRhombus:void 0;function mxPolyline(t,e,i){mxShape.call(this),this.points=t,this.stroke=e,this.strokewidth=i??1}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 i=t.pointerEventsValue;t.pointerEventsValue="stroke",this.style==null||this.style[mxConstants.STYLE_CURVED]!=1?this.paintLine(t,e,this.isRounded):this.paintCurvedLine(t,e),t.pointerEventsValue=i},mxPolyline.prototype.paintLine=function(t,e,i){var n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,e,i,n,!1),t.stroke()},mxPolyline.prototype.paintCurvedLine=function(t,e){t.begin();var i=e[0],n=e.length;t.moveTo(i.x,i.y);for(var r=1;r2&&t.setMiterLimit(1.42),t.begin();var P=y,R=S;if(a&&!l)this.paintMarker(t,e[0].x,e[0].y,y,S,p,n,s,u,!0);else{var O=e[0].x+A/2+u*y,_=e[0].y+M/2+u*S,b=e[0].x-A/2+u*y,k=e[0].y-M/2+u*S;l?(t.moveTo(O,_),I.push(function(){t.lineTo(b,k)})):(t.moveTo(b,k),t.lineTo(O,_))}for(var G=0,B=0,j=0,H=0;H=0;H--)I[H]();l?(t.end(),t.stroke()):(t.close(),t.fillAndStroke()),t.setShadow(!1),t.setMiterLimit(4),d&&t.setLineJoin("flat"),e.length>2&&(t.setMiterLimit(4),a&&!l&&(t.begin(),this.paintMarker(t,e[0].x,e[0].y,P,R,p,n,s,u,!0),t.stroke(),t.end()),o&&!l&&(t.begin(),this.paintMarker(t,x.x,x.y,-y,-S,m,r,s,u,!0),t.stroke(),t.end()))}},mxArrowConnector.prototype.paintMarker=function(t,e,i,n,r,s,l,a,o,u){var p=a/l,m=a*r/2,d=-a*n/2,x=(o+s)*n,f=(o+s)*r;u?t.moveTo(e-m+x,i-d+f):t.lineTo(e-m+x,i-d+f),t.lineTo(e-m/p+x,i-d/p+f),t.lineTo(e+o*n,i+o*r),t.lineTo(e+m/p+x,i+d/p+f),t.lineTo(e+m+x,i+d+f)},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},__mxOutput.mxArrowConnector=typeof mxArrowConnector<"u"?mxArrowConnector:void 0;function mxText(t,e,i,n,r,s,l,a,o,u,p,m,d,x,f,g,c,v,y,T,C){mxShape.call(this),this.value=t,this.bounds=e,this.color=r??"black",this.align=i??mxConstants.ALIGN_CENTER,this.valign=n??mxConstants.ALIGN_MIDDLE,this.family=s??mxConstants.DEFAULT_FONTFAMILY,this.size=l??mxConstants.DEFAULT_FONTSIZE,this.fontStyle=a??mxConstants.DEFAULT_FONTSTYLE,this.spacing=parseInt(o||2),this.spacingTop=this.spacing+parseInt(u||0),this.spacingRight=this.spacing+parseInt(p||0),this.spacingBottom=this.spacing+parseInt(m||0),this.spacingLeft=this.spacing+parseInt(d||0),this.horizontal=x??!0,this.background=f,this.border=g,this.wrap=c??!1,this.clipped=v??!1,this.overflow=y??"visible",this.labelPadding=T??0,this.textDirection=C,this.rotation=0,this.updateMargin()}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=document.documentMode==8&&!mxClient.IS_EM?4:3,mxText.prototype.lastValue=null,mxText.prototype.cacheEnabled=!0,mxText.prototype.isParseVml=function(){return!1},mxText.prototype.isHtmlAllowed=function(){return document.documentMode!=8||mxClient.IS_EM},mxText.prototype.getSvgScreenOffset=function(){return 0},mxText.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&this.scale>0&&this.bounds!=null&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)},mxText.prototype.paint=function(t,e){var i=this.scale,n=this.bounds.x/i,r=this.bounds.y/i,s=this.bounds.width/i,l=this.bounds.height/i;if(this.updateTransform(t,n,r,s,l),this.configureCanvas(t,n,r,s,l),e)t.updateText(n,r,s,l,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.getTextRotation(),this.node);else{var a=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML,o=a||t instanceof mxVmlCanvas2D?"html":"",u=this.value;!a&&o=="html"&&(u=mxUtils.htmlEntities(u,!1)),o=="html"&&!mxUtils.isNode(this.value)&&(u=mxUtils.replaceTrailingNewlines(u,"

")),u=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&o=="html"?u.replace(/\n/g,"
"):u;var p=this.textDirection;p==mxConstants.TEXT_DIRECTION_AUTO&&!a&&(p=this.getAutoDirection()),p!=mxConstants.TEXT_DIRECTION_LTR&&p!=mxConstants.TEXT_DIRECTION_RTL&&(p=null),t.text(n,r,s,l,u,this.align,this.valign,this.wrap,o,this.overflow,this.clipped,this.getTextRotation(),p)}},mxText.prototype.redraw=function(){if(this.visible&&this.checkBounds()&&this.cacheEnabled&&this.lastValue==this.value&&(mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML))if(this.node.nodeName=="DIV"&&(this.isHtmlAllowed()||!mxClient.IS_VML))mxClient.IS_SVG?this.redrawHtmlShapeWithCss3():(this.updateSize(this.node,this.state==null||this.state.view.textDiv==null),mxClient.IS_IE&&(document.documentMode==null||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()),this.updateBoundingBox();else{var t=this.createCanvas();t!=null&&t.updateText!=null?(t.pointerEvents=this.pointerEvents,this.paint(t,!0),this.destroyCanvas(t),this.updateBoundingBox()):mxShape.prototype.redraw.apply(this,arguments)}else 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),this.style!=null&&(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 t!=null&&t.length>0&&t[0]>"z"?mxConstants.TEXT_DIRECTION_RTL:mxConstants.TEXT_DIRECTION_LTR},mxText.prototype.getContentNode=function(){var t=this.node;return t!=null&&(t.ownerSVGElement==null?t=this.node.firstChild.firstChild:t=t.firstChild.firstChild.firstChild.firstChild.firstChild),t},mxText.prototype.updateBoundingBox=function(){var t=this.node;this.boundingBox=this.bounds.clone();var e=this.getTextRotation(),i=this.style!=null?mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER):null,n=this.style!=null?mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE):null;if(!this.ignoreStringSize&&t!=null&&this.overflow!="fill"&&(!this.clipped||!this.ignoreClippedStringSize||i!=mxConstants.ALIGN_CENTER||n!=mxConstants.ALIGN_MIDDLE)){var r=null,s=null;if(t.ownerSVGElement!=null)if(t.firstChild!=null&&t.firstChild.firstChild!=null&&t.firstChild.firstChild.nodeName=="foreignObject")t=t.firstChild.firstChild.firstChild.firstChild,s=t.offsetHeight*this.scale,this.overflow=="width"?r=this.boundingBox.width:r=t.offsetWidth*this.scale;else try{var l=t.getBBox();typeof this.value=="string"&&mxUtils.trim(this.value)==0?this.boundingBox=null:l.width==0&&l.height==0?this.boundingBox=null:this.boundingBox=new mxRectangle(l.x,l.y,l.width,l.height);return}catch{}else{var a=this.state!=null?this.state.view.textDiv:null;if(this.offsetWidth!=null&&this.offsetHeight!=null)r=this.offsetWidth*this.scale,s=this.offsetHeight*this.scale;else{a!=null&&(this.updateFont(a),this.updateSize(a,!1),this.updateInnerHtml(a),t=a);var o=t;if(document.documentMode==8&&!mxClient.IS_EM){var u=Math.round(this.bounds.width/this.scale);if(this.wrap&&u>0){if(t.style.wordWrap=mxConstants.WORD_WRAP,t.style.whiteSpace="normal",t.style.wordWrap!="break-word"){var p=o.getElementsByTagName("div");p.length>0&&(o=p[p.length-1]),r=o.offsetWidth+2,p=this.node.getElementsByTagName("div"),this.clipped&&(r=Math.min(u,r)),p.length>1&&(p[p.length-2].style.width=r+"px")}}else t.style.whiteSpace="nowrap"}else o.firstChild!=null&&o.firstChild.nodeName=="DIV"&&(o=o.firstChild);this.offsetWidth=o.offsetWidth+this.textWidthPadding,this.offsetHeight=o.offsetHeight,r=this.offsetWidth*this.scale,s=this.offsetHeight*this.scale}}r!=null&&s!=null&&(this.boundingBox=new mxRectangle(this.bounds.x,this.bounds.y,r,s))}if(this.boundingBox!=null)if(e!=0){var m=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+=m.x,this.boundingBox.y+=m.y,this.boundingBox.width=m.width,this.boundingBox.height=m.height}else 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 this.state!=null&&this.state.shape!=null?this.state.shape.getTextRotation():0},mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&this.state!=null&&this.state.view.graph.model.isVertex(this.state.cell)},mxText.prototype.configureCanvas=function(t,e,i,n,r){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,"

"),t=this.replaceLinefeeds?t.replace(/\n/g,"
"):t,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; ");var i=[];return(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&(e+="text-decoration: "+i.join(" ")+"; "),e},mxText.prototype.redrawHtmlShape=function(){if(mxClient.IS_SVG)this.redrawHtmlShapeWithCss3();else{var t=this.node.style;t.whiteSpace="normal",t.overflow="",t.width="",t.height="",this.updateValue(),this.updateFont(this.node),this.updateSize(this.node,this.state==null||this.state.view.textDiv==null),this.offsetWidth=null,this.offsetHeight=null,mxClient.IS_IE&&(document.documentMode==null||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)),i="position: absolute; left: "+Math.round(this.bounds.x)+"px; top: "+Math.round(this.bounds.y)+"px; pointer-events: none; ",n=this.getTextCss();mxSvgCanvas2D.createCss(t+2,e,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.background!=null?mxUtils.htmlEntities(this.background):null,this.border!=null?mxUtils.htmlEntities(this.border):null,i,n,this.scale,mxUtils.bind(this,function(r,s,l,a,o,u){var p=this.getTextRotation(),m=(this.scale!=1?"scale("+this.scale+") ":"")+(p!=0?"rotate("+p+"deg) ":"")+(this.margin.x!=0||this.margin.y!=0?"translate("+this.margin.x*100+"%,"+this.margin.y*100+"%)":"");m!=""&&(m="transform-origin: 0 0; transform: "+m+"; "),u==""?(l+=a,a="display:inline-block; min-width: 100%; "+m):(a+=m,mxClient.IS_SF&&(a+="-webkit-clip-path: content-box;")),this.opacity<100&&(o+="opacity: "+this.opacity/100+"; "),this.node.setAttribute("style",l);var d=mxUtils.isNode(this.value)?this.value.outerHTML:this.getHtmlValue();this.node.firstChild==null&&(this.node.innerHTML="
"+d+"
"),this.node.firstChild.firstChild.setAttribute("style",o),this.node.firstChild.setAttribute("style",a)}))},mxText.prototype.updateHtmlTransform=function(){var t=this.getTextRotation(),e=this.node.style,i=this.margin.x,n=this.margin.y;t!=0?(mxUtils.setPrefixedStyle(e,"transformOrigin",-i*100+"% "+-n*100+"%"),mxUtils.setPrefixedStyle(e,"transform","translate("+i*100+"%,"+n*100+"%) scale("+this.scale+") rotate("+t+"deg)")):(mxUtils.setPrefixedStyle(e,"transformOrigin","0% 0%"),mxUtils.setPrefixedStyle(e,"transform","scale("+this.scale+") translate("+i*100+"%,"+n*100+"%)")),e.left=Math.round(this.bounds.x-Math.ceil(i*(this.overflow!="fill"&&this.overflow!="width"?3:1)))+"px",e.top=Math.round(this.bounds.y-n*(this.overflow!="fill"?3:1))+"px",this.opacity<100?e.opacity=this.opacity/100:e.opacity=""},mxText.prototype.updateInnerHtml=function(t){if(mxUtils.isNode(this.value))t.innerHTML=this.value.outerHTML;else{var e=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1)),e=mxUtils.replaceTrailingNewlines(e,"
 
"),e=this.replaceLinefeeds?e.replace(/\n/g,"
"):e,e='
'+e+"
",t.innerHTML=e}},mxText.prototype.updateHtmlFilter=function(){var t=this.node.style,e=this.margin.x,T=this.margin.y,i=this.scale;mxUtils.setOpacity(this.node,this.opacity);var n=0,r=0,s=this.state!=null?this.state.view.textDiv:null,l=this.node;if(s!=null){s.style.overflow="",s.style.height="",s.style.width="",this.updateFont(s),this.updateSize(s,!1),this.updateInnerHtml(s);var a=Math.round(this.bounds.width/this.scale);this.wrap&&a>0?(s.style.whiteSpace="normal",s.style.wordWrap=mxConstants.WORD_WRAP,n=a,this.clipped&&(n=Math.min(n,this.bounds.width)),s.style.width=n+"px"):s.style.whiteSpace="nowrap",l=s,l.firstChild!=null&&l.firstChild.nodeName=="DIV"&&(l=l.firstChild,this.wrap&&s.style.wordWrap=="break-word"&&(l.style.width="100%")),!this.clipped&&this.wrap&&a>0&&(n=l.offsetWidth+this.textWidthPadding,s.style.width=n+"px"),r=l.offsetHeight+2,mxClient.IS_QUIRKS&&this.border!=null&&this.border!=mxConstants.NONE&&(r+=3)}else l.firstChild!=null&&l.firstChild.nodeName=="DIV"&&(l=l.firstChild,r=l.offsetHeight);n=l.offsetWidth+this.textWidthPadding,this.clipped&&(r=Math.min(r,this.bounds.height));var a=this.bounds.width/i,o=this.bounds.height/i;this.overflow=="fill"?(r=o,n=a):this.overflow=="width"&&(r=l.scrollHeight,n=a),this.offsetWidth=n,this.offsetHeight=r,mxClient.IS_QUIRKS&&(this.clipped||this.overflow=="width"&&o>0)?(o=Math.min(o,r),t.height=Math.round(o)+"px"):o=r,this.overflow!="fill"&&this.overflow!="width"&&(this.clipped&&(n=Math.min(a,n)),a=n,(mxClient.IS_QUIRKS&&this.clipped||this.wrap)&&(t.width=Math.round(a)+"px")),o*=i,a*=i;var u=this.getTextRotation()*(Math.PI/180),p=parseFloat(parseFloat(Math.cos(u)).toFixed(8)),m=parseFloat(parseFloat(Math.sin(-u)).toFixed(8));u%=2*Math.PI,u<0&&(u+=2*Math.PI),u%=Math.PI,u>Math.PI/2&&(u=Math.PI-u);var d=Math.cos(u),x=Math.sin(-u),f=a*-(e+.5),g=o*-(T+.5),c=(o-o*d+a*x)/2+m*f-p*g,v=(a-a*d+o*x)/2-p*f-m*g;if(u!=0){var y="progid:DXImageTransform.Microsoft.Matrix(M11="+p+", M12="+m+", M21="+-m+", M22="+p+", sizingMethod='auto expand')";t.filter!=null&&t.filter.length>0?t.filter+=" "+y:t.filter=y}var T=0;this.overflow!="fill"&&mxClient.IS_QUIRKS&&(this.valign==mxConstants.ALIGN_TOP?T-=1:this.valign==mxConstants.ALIGN_BOTTOM?T+=2:T+=1),t.zoom=i,t.left=Math.round(this.bounds.x+v-a/2)+"px",t.top=Math.round(this.bounds.y+c-o/2+T)+"px"},mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var t=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"

"),t=this.replaceLinefeeds?t.replace(/\n/g,"
"):t;var e=this.background!=null&&this.background!=mxConstants.NONE?this.background:null,i=this.border!=null&&this.border!=mxConstants.NONE?this.border:null;if(this.overflow=="fill"||this.overflow=="width")e!=null&&(this.node.style.backgroundColor=e),i!=null&&(this.node.style.border="1px solid "+i);else{var n="";e!=null&&(n+="background-color:"+mxUtils.htmlEntities(e)+";"),i!=null&&(n+="border:1px solid "+mxUtils.htmlEntities(i)+";");var r=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;t='
'+t+"
"}this.node.innerHTML=t;var s=this.node.getElementsByTagName("div");if(s.length>0){var l=this.textDirection;l==mxConstants.TEXT_DIRECTION_AUTO&&this.dialect!=mxConstants.DIALECT_STRICTHTML&&(l=this.getAutoDirection()),l==mxConstants.TEXT_DIRECTION_LTR||l==mxConstants.TEXT_DIRECTION_RTL?s[s.length-1].setAttribute("dir",l):s[s.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="";var i=[];(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),e.textDecoration=i.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 i=Math.max(0,Math.round(this.bounds.width/this.scale)),n=Math.max(0,Math.round(this.bounds.height/this.scale)),r=t.style;if(this.clipped?(r.overflow="hidden",mxClient.IS_QUIRKS?r.width=i+"px":(r.maxHeight=n+"px",r.maxWidth=i+"px")):this.overflow=="fill"?(r.width=i+1+"px",r.height=n+1+"px",r.overflow="hidden"):this.overflow=="width"&&(r.width=i+1+"px",r.maxHeight=n+1+"px",r.overflow="hidden"),this.wrap&&i>0){if(r.wordWrap=mxConstants.WORD_WRAP,r.whiteSpace="normal",r.width=i+"px",e&&this.overflow!="fill"&&this.overflow!="width"){var s=t;s.firstChild!=null&&s.firstChild.nodeName=="DIV"&&(s=s.firstChild,t.style.wordWrap=="break-word"&&(s.style.width="100%"));var l=s.offsetWidth;if(l==0){var a=t.parentNode;t.style.visibility="hidden",document.body.appendChild(t),l=s.offsetWidth,t.style.visibility="",a.appendChild(t)}l+=3,this.clipped&&(l=Math.min(l,i)),r.width=l+"px"}}else r.whiteSpace="nowrap"},mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)},mxText.prototype.getSpacing=function(){var t=0,e=0;return this.align==mxConstants.ALIGN_CENTER?t=(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?t=-this.spacingRight-this.baseSpacingRight:t=this.spacingLeft+this.baseSpacingLeft,this.valign==mxConstants.ALIGN_MIDDLE?e=(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?e=-this.spacingBottom-this.baseSpacingBottom:e=this.spacingTop+this.baseSpacingTop,new mxPoint(t,e)},__mxOutput.mxText=typeof mxText<"u"?mxText:void 0;function mxTriangle(){mxActor.call(this)}mxUtils.extend(mxTriangle,mxActor),mxTriangle.prototype.isRoundable=function(){return!0},mxTriangle.prototype.redrawPath=function(t,e,i,n,r){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,0),new mxPoint(n,.5*r),new mxPoint(0,r)],this.isRounded,s,!0)},__mxOutput.mxTriangle=typeof mxTriangle<"u"?mxTriangle:void 0;function mxHexagon(){mxActor.call(this)}mxUtils.extend(mxHexagon,mxActor),mxHexagon.prototype.redrawPath=function(t,e,i,n,r){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(.25*n,0),new mxPoint(.75*n,0),new mxPoint(n,.5*r),new mxPoint(.75*n,r),new mxPoint(.25*n,r),new mxPoint(0,.5*r)],this.isRounded,s,!0)},__mxOutput.mxHexagon=typeof mxHexagon<"u"?mxHexagon:void 0;function mxLine(t,e,i,n){mxShape.call(this),this.bounds=t,this.stroke=e,this.strokewidth=i??1,this.vertical=n??this.vertical}mxUtils.extend(mxLine,mxShape),mxLine.prototype.vertical=!1,mxLine.prototype.paintVertexShape=function(t,e,i,n,r){if(t.begin(),this.vertical){var s=e+n/2;t.moveTo(s,i),t.lineTo(s,i+r)}else{var s=i+r/2;t.moveTo(e,s),t.lineTo(e+n,s)}t.stroke()},__mxOutput.mxLine=typeof mxLine<"u"?mxLine:void 0;function mxImageShape(t,e,i,n,r){mxShape.call(this),this.bounds=t,this.image=e,this.fill=i,this.stroke=n,this.strokewidth=r??1,this.shadow=!1}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!=null&&(this.preserveImageAspect=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1)==1,this.flipH=this.flipH||mxUtils.getValue(this.style,"imageFlipH",0)==1,this.flipV=this.flipV||mxUtils.getValue(this.style,"imageFlipV",0)==1)},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,i,n,r){return!1},mxImageShape.prototype.paintVertexShape=function(t,e,i,n,r){if(this.image!=null){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),l=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);s!=null&&(t.setFillColor(s),t.setStrokeColor(l),t.rect(e,i,n,r),t.fillAndStroke()),t.image(e,i,n,r,this.image,this.preserveImageAspect,!1,!1);var l=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);l!=null&&(t.setShadow(!1),t.setStrokeColor(l),t.rect(e,i,n,r),t.stroke())}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)},mxImageShape.prototype.redrawHtmlShape=function(){if(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="",this.image!=null){var t=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,""),e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,"");this.node.style.backgroundColor=t,this.node.style.borderColor=e;var i=mxClient.IS_IE6||(document.documentMode==null||document.documentMode<=8)&&this.rotation!=0,n=document.createElement(i?mxClient.VML_PREFIX+":image":"img");n.setAttribute("border","0"),n.style.position="absolute",n.src=this.image;var r=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=r,this.flipH&&this.flipV?r+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?r+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(r+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"),n.style.filter!=r&&(n.style.filter=r),n.nodeName=="image"?n.style.rotation=this.rotation:this.rotation!=0?mxUtils.setPrefixedStyle(n.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(n.style,"transform",""),n.style.width=this.node.style.width,n.style.height=this.node.style.height,this.node.style.backgroundImage="",this.node.appendChild(n)}else this.setTransparentBackgroundImage(this.node)},__mxOutput.mxImageShape=typeof mxImageShape<"u"?mxImageShape:void 0;function mxLabel(t,e,i,n){mxRectangleShape.call(this,t,e,i,n)}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),this.indicatorShape!=null&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.init(this.node))},mxLabel.prototype.redraw=function(){this.indicator!=null&&(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)&&this.indicatorColor==null&&this.indicatorShape==null},mxLabel.prototype.paintForeground=function(t,e,i,n,r){this.paintImage(t,e,i,n,r),this.paintIndicator(t,e,i,n,r),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxLabel.prototype.paintImage=function(t,e,i,n,r){if(this.image!=null){var s=this.getImageBounds(e,i,n,r);t.image(s.x,s.y,s.width,s.height,this.image,!1,!1,!1)}},mxLabel.prototype.getImageBounds=function(t,e,i,n){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),a=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;return r==mxConstants.ALIGN_CENTER?t+=(i-l)/2:r==mxConstants.ALIGN_RIGHT?t+=i-l-o:t+=o,s==mxConstants.ALIGN_TOP?e+=o:s==mxConstants.ALIGN_BOTTOM?e+=n-a-o:e+=(n-a)/2,new mxRectangle(t,e,l,a)},mxLabel.prototype.paintIndicator=function(t,e,i,n,r){if(this.indicator!=null)this.indicator.bounds=this.getIndicatorBounds(e,i,n,r),this.indicator.paint(t);else if(this.indicatorImage!=null){var s=this.getIndicatorBounds(e,i,n,r);t.image(s.x,s.y,s.width,s.height,this.indicatorImage,!1,!1,!1)}},mxLabel.prototype.getIndicatorBounds=function(t,e,i,n){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),a=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),o=this.spacing+5;return r==mxConstants.ALIGN_RIGHT?t+=i-l-o:r==mxConstants.ALIGN_CENTER?t+=(i-l)/2:t+=o,s==mxConstants.ALIGN_BOTTOM?e+=n-a-o:s==mxConstants.ALIGN_TOP?e+=o:e+=(n-a)/2,new mxRectangle(t,e,l,a)},mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(this.image!=null){var t=document.createElement("img");t.style.position="relative",t.setAttribute("border","0");var e=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);e.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)}},__mxOutput.mxLabel=typeof mxLabel<"u"?mxLabel:void 0;function mxCylinder(t,e,i,n){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=i,this.strokewidth=n??1}mxUtils.extend(mxCylinder,mxShape),mxCylinder.prototype.maxHeight=40,mxCylinder.prototype.svgStrokeTolerance=0,mxCylinder.prototype.paintVertexShape=function(t,e,i,n,r){t.translate(e,i),t.begin(),this.redrawPath(t,e,i,n,r,!1),t.fillAndStroke(),(!this.outline||this.style==null||mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)==0)&&(t.setShadow(!1),t.begin(),this.redrawPath(t,e,i,n,r,!0),t.stroke())},mxCylinder.prototype.getCylinderSize=function(t,e,i,n){return Math.min(this.maxHeight,Math.round(n/5))},mxCylinder.prototype.redrawPath=function(t,e,i,n,r,s){var l=this.getCylinderSize(e,i,n,r);(s&&this.fill!=null||!s&&this.fill==null)&&(t.moveTo(0,l),t.curveTo(0,2*l,n,2*l,n,l),s||(t.stroke(),t.begin())),s||(t.moveTo(0,l),t.curveTo(0,-l/3,n,-l/3,n,l),t.lineTo(n,r-l),t.curveTo(n,r+l/3,0,r+l/3,0,r-l),t.close())},__mxOutput.mxCylinder=typeof mxCylinder<"u"?mxCylinder:void 0;function mxConnector(t,e,i){mxPolyline.call(this,t,e,i)}mxUtils.extend(mxConnector,mxPolyline),mxConnector.prototype.updateBoundingBox=function(){this.useSvgBoundingBox=this.style!=null&&this.style[mxConstants.STYLE_CURVED]==1,mxShape.prototype.updateBoundingBox.apply(this,arguments)},mxConnector.prototype.paintEdgeShape=function(t,e){var i=this.createMarker(t,e,!0),n=this.createMarker(t,e,!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments),t.setFillColor(this.stroke),t.setShadow(!1),t.setDashed(!1),i!=null&&i(),n!=null&&n()},mxConnector.prototype.createMarker=function(t,e,i){var n=null,r=e.length,s=mxUtils.getValue(this.style,i?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW),l=i?e[1]:e[r-2],a=i?e[0]:e[r-1];if(s!=null&&l!=null&&a!=null){for(var o=1;o0)for(var a=0;at.weightedValue?-1:e.weightedValueu)break;a=x}}}var f=r.getIndex(t);f=Math.max(0,l-(l>f?1:0)),n.add(r,t,f)}},mxStackLayout.prototype.getParentSize=function(t){var e=this.graph.getModel(),i=e.getGeometry(t);if(this.graph.container!=null&&(i==null&&e.isLayer(t)||t==this.graph.getView().currentRoot)){var n=this.graph.container.offsetWidth-1,r=this.graph.container.offsetHeight-1;i=new mxRectangle(0,0,n,r)}return i},mxStackLayout.prototype.getLayoutCells=function(t){for(var e=this.graph.getModel(),i=e.getChildCount(t),n=[],r=0;ru.x>0?1:-1:o.y==u.y?0:o.y>u.y>0?1:-1})),n},mxStackLayout.prototype.snap=function(t){if(this.gridSize!=null&&this.gridSize>0&&(t=Math.max(t,this.gridSize),t/this.gridSize>1)){var e=t%this.gridSize;t+=e>this.gridSize/2?this.gridSize-e:-e}return t},mxStackLayout.prototype.execute=function(t){if(t!=null){var e=this.getParentSize(t),i=this.isHorizontal(),n=this.graph.getModel(),r=null;e!=null&&(r=i?e.height-this.marginTop-this.marginBottom:e.width-this.marginLeft-this.marginRight),r-=2*this.border;var s=this.x0+this.border+this.marginLeft,l=this.y0+this.border+this.marginTop;if(this.graph.isSwimlane(t)){var a=this.graph.getCellStyle(t),o=mxUtils.getNumber(a,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE),u=mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)==1;e!=null&&(u?o=Math.min(o,e.height):o=Math.min(o,e.width)),i==u&&(r-=o),u?l+=o:s+=o}n.beginUpdate();try{for(var p=0,m=null,d=0,x=null,f=this.getLayoutCells(t),g=0;gthis.wrap||!i&&m.y+m.height+v.height+2*this.spacing>this.wrap)&&(m=null,i?l+=p+this.spacing:s+=p+this.spacing,p=0),p=Math.max(p,i?v.height:v.width);var y=0;if(!this.borderCollapse){var T=this.graph.getCellStyle(c);y=mxUtils.getNumber(T,mxConstants.STYLE_STROKEWIDTH,1)}if(m!=null){var C=d+this.spacing+Math.floor(y/2);i?v.x=this.snap((this.allowGaps?Math.max(C,v.x):C)-this.marginLeft)+this.marginLeft:v.y=this.snap((this.allowGaps?Math.max(C,v.y):C)-this.marginTop)+this.marginTop}else this.keepFirstLocation||(i?v.x=this.allowGaps&&v.x>s?Math.max(this.snap(v.x-this.marginLeft)+this.marginLeft,s):s:v.y=this.allowGaps&&v.y>l?Math.max(this.snap(v.y-this.marginTop)+this.marginTop,l):l);i?v.y=l:v.x=s,this.fill&&r!=null&&(i?v.height=r:v.width=r),i?v.width=this.snap(v.width):v.height=this.snap(v.height),this.setChildGeometry(c,v),x=c,m=v,i?d=m.x+m.width+Math.floor(y/2):d=m.y+m.height+Math.floor(y/2)}}this.resizeParent&&e!=null&&m!=null&&!this.graph.isCellCollapsed(t)?this.updateParentGeometry(t,e,m):this.resizeLast&&e!=null&&m!=null&&x!=null&&(i?m.width=e.width-m.x-this.spacing-this.marginRight-this.marginLeft:m.height=e.height-m.y-this.spacing-this.marginBottom,this.setChildGeometry(x,m))}finally{n.endUpdate()}}},mxStackLayout.prototype.setChildGeometry=function(t,e){var i=this.graph.getCellGeometry(t);(i==null||e.x!=i.x||e.y!=i.y||e.width!=i.width||e.height!=i.height)&&this.graph.getModel().setGeometry(t,e)},mxStackLayout.prototype.updateParentGeometry=function(t,e,i){var n=this.isHorizontal(),r=this.graph.getModel(),s=e.clone();if(n){var l=i.x+i.width+this.marginRight+this.border;this.resizeParentMax?s.width=Math.max(s.width,l):s.width=l}else{var l=i.y+i.height+this.marginBottom+this.border;this.resizeParentMax?s.height=Math.max(s.height,l):s.height=l}(e.x!=s.x||e.y!=s.y||e.width!=s.width||e.height!=s.height)&&r.setGeometry(t,s)},__mxOutput.mxStackLayout=typeof mxStackLayout<"u"?mxStackLayout:void 0;function mxPartitionLayout(t,e,i,n){mxGraphLayout.call(this,t),this.horizontal=e??!0,this.spacing=i||0,this.border=n||0}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,i){var n=this.graph.getModel(),r=n.getParent(t);if(t!=null&&r!=null){var s=0,l=0,a=n.getChildCount(r);for(s=0;se)break;l=p}}var m=r.getIndex(t);m=Math.max(0,s-(s>m?1:0)),n.add(r,t,m)}},mxPartitionLayout.prototype.execute=function(t){var e=this.isHorizontal(),i=this.graph.getModel(),n=i.getGeometry(t);if(this.graph.container!=null&&(n==null&&i.isLayer(t)||t==this.graph.getView().currentRoot)){var r=this.graph.container.offsetWidth-1,s=this.graph.container.offsetHeight-1;n=new mxRectangle(0,0,r,s)}if(n!=null){for(var l=[],a=i.getChildCount(t),o=0;o0){var m=this.border,d=this.border,x=e?n.height:n.width;x-=2*this.border;var f=this.graph.isSwimlane(t)?this.graph.getStartSize(t):new mxRectangle;x-=e?f.height:f.width,m=m+f.width,d=d+f.height;var g=this.border+(p-1)*this.spacing,c=e?(n.width-m-g)/p:(n.height-d-g)/p;if(c>0){i.beginUpdate();try{for(var o=0;o0)this.root=t;else{var n=this.graph.findTreeRoots(t,!0,this.invert);if(n.length>0){for(var r=0;r0){this.root=n[r];break}}}else this.root=e;if(this.root!=null){if(this.resizeParent?this.parentsChanged=new Object:this.parentsChanged=null,this.parentX=null,this.parentY=null,t!=this.root&&i.isVertex(t)!=null&&this.maintainParentLocation){var s=this.graph.getCellGeometry(t);s!=null&&(this.parentX=s.x,this.parentY=s.y)}i.beginUpdate();try{if(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)),this.node!=null){this.layout(this.node);var l=this.graph.gridSize,a=l;if(!this.moveTree){var o=this.getVertexBounds(this.root);o!=null&&(l=o.x,a=o.y)}var u=null;if(this.isHorizontal()?u=this.horizontalLayout(this.node,l,a):u=this.verticalLayout(this.node,null,l,a),u!=null){var p=0,m=0;u.x<0&&(p=Math.abs(l-u.x)),u.y<0&&(m=Math.abs(a-u.y)),(p!=0||m!=0)&&this.moveNode(this.node,p,m),this.resizeParent&&this.adjustParents(),this.edgeRouting&&this.localEdgeProcessing(this.node)}if(this.parentX!=null&&this.parentY!=null){var s=this.graph.getCellGeometry(t);s!=null&&(s=s.clone(),s.x=this.parentX,s.y=this.parentY,i.setGeometry(t,s))}}}finally{i.endUpdate()}}},mxCompactTreeLayout.prototype.moveNode=function(t,e,i){t.x+=e,t.y+=i,this.apply(t);for(var n=t.child;n!=null;)this.moveNode(n,e,i),n=n.next},mxCompactTreeLayout.prototype.sortOutgoingEdges=function(t,e){var i=new mxDictionary;e.sort(function(n,r){var s=n.getTerminal(n.getTerminal(!1)==t),l=i.get(s);l==null&&(l=mxCellPath.create(s).split(mxCellPath.PATH_SEPARATOR),i.put(s,l));var a=r.getTerminal(r.getTerminal(!1)==t),o=i.get(a);return o==null&&(o=mxCellPath.create(a).split(mxCellPath.PATH_SEPARATOR),i.put(a,o)),mxCellPath.compare(l,o)})},mxCompactTreeLayout.prototype.findRankHeights=function(t,e){(this.maxRankHeight[e]==null||this.maxRankHeight[e]t.height&&(t.height=this.maxRankHeight[e]);for(var i=t.child;i!=null;)this.setCellHeights(i,e+1),i=i.next},mxCompactTreeLayout.prototype.dfs=function(t,e){var i=mxCellPath.create(t),n=null;if(t!=null&&this.visited[i]==null&&!this.isVertexIgnored(t)){this.visited[i]=t,n=this.createNode(t);var r=this.graph.getModel(),s=null,l=this.graph.getEdges(t,e,this.invert,!this.invert,!1,!0),a=this.graph.getView();this.sortEdges&&this.sortOutgoingEdges(t,l);for(var o=0;o0)if(t<0){var o=t*n;l=o/i-e}else if(t>0){var o=t*s;l=o/r-e}else l=-e;else if(rt+i){var o=(i+t)*s;l=o/r-(e+n)}else l=s-(e+n);return l>0?l:0},mxCompactTreeLayout.prototype.bridge=function(t,e,i,n,r,s){var l=r+n.dx-e,a=0,o=0;n.dx==0?a=n.dy:(o=l*n.dy,a=o/n.dx);var u=this.createLine(l,a,n.next);return t.next=this.createLine(0,s+n.dy-a-i,u),u},mxCompactTreeLayout.prototype.createNode=function(t){var e=new Object;e.cell=t,e.x=0,e.y=0,e.width=0,e.height=0;var i=this.getVertexBounds(t);return i!=null&&(this.isHorizontal()?(e.width=i.height,e.height=i.width):(e.width=i.width,e.height=i.height)),e.offsetX=0,e.offsetY=0,e.contour=new Object,e},mxCompactTreeLayout.prototype.apply=function(t,e){var i=this.graph.getModel(),n=t.cell,r=i.getGeometry(n);if(n!=null&&r!=null){if(this.isVertexMovable(n)&&(r=this.setVertexLocation(n,t.x,t.y),this.resizeParent)){var s=i.getParent(n),l=mxCellPath.create(s);this.parentsChanged[l]==null&&(this.parentsChanged[l]=s)}e==null?e=new mxRectangle(r.x,r.y,r.width,r.height):e=new mxRectangle(Math.min(e.x,r.x),Math.min(e.y,r.y),Math.max(e.x+e.width,r.x+r.width),Math.max(e.y+e.height,r.y+r.height))}return e},mxCompactTreeLayout.prototype.createLine=function(t,e,i){var n=new Object;return n.dx=t,n.dy=e,n.next=i,n},mxCompactTreeLayout.prototype.adjustParents=function(){var t=[];for(var e in this.parentsChanged)t.push(this.parentsChanged[e]);this.arrangeGroups(mxUtils.sortCells(t,!0),this.groupPadding,this.groupPaddingTop,this.groupPaddingRight,this.groupPaddingBottom,this.groupPaddingLeft)},mxCompactTreeLayout.prototype.localEdgeProcessing=function(t){this.processNodeOutgoing(t);for(var e=t.child;e!=null;)this.localEdgeProcessing(e),e=e.next},mxCompactTreeLayout.prototype.processNodeOutgoing=function(t){for(var e=t.child,i=t.cell,n=0,r=[];e!=null;){n++;var s=e.x;this.horizontal&&(s=e.y),r.push(new WeightedCellSorter(e,s)),e=e.next}r.sort(WeightedCellSorter.prototype.compare);var l=t.width,a=(n+1)*this.prefHozEdgeSep;l>a+2*this.prefHozEdgeSep&&(l-=2*this.prefHozEdgeSep);var o=l/n,u=o/2;l>a+2*this.prefHozEdgeSep&&(u+=this.prefHozEdgeSep);var p=this.minEdgeJetty-this.prefVertEdgeOff,m=this.getVertexBounds(i);e=t.child;for(var d=0;dn/2&&(p-=this.prefVertEdgeOff),u+=o}},__mxOutput.mxCompactTreeLayout=typeof mxCompactTreeLayout<"u"?mxCompactTreeLayout:void 0;function mxRadialTreeLayout(t){mxCompactTreeLayout.call(this,t,!1)}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)||this.graph.getConnections(t).length==0},mxRadialTreeLayout.prototype.execute=function(t,e){this.parent=t,this.useBoundingBox=!1,this.edgeRouting=!1,mxCompactTreeLayout.prototype.execute.apply(this,arguments);var i=null,n=this.getVertexBounds(this.root);this.centerX=n.x+n.width/2,this.centerY=n.y+n.height/2;for(var r in this.visited){var s=this.getVertexBounds(this.visited[r]);i=i??s.clone(),i.add(s)}this.calcRowDims([this.node],0);for(var l=0,a=0,o=0;o=0;o--)for(var g=this.row[o],f=0;f0){var E=S/C;if(E>c.theta&&f0){var A=g[f-1].theta;c.theta=Math.max(E,A+Math.PI/10)}}}for(var o=0;othis.maxDistanceLimit)continue;l1&&this.layout(r)}}finally{this.graph.model.endUpdate()}},mxParallelEdgeLayout.prototype.findParallels=function(t,e){var i=[],n=mxUtils.bind(this,function(a){if(!this.isEdgeIgnored(a)){var o=this.getEdgeId(a);o!=null&&(i[o]==null&&(i[o]=[]),i[o].push(a))}});if(e!=null)for(var r=0;rn?n+"-"+i:i+"-"+n)+r}return null},mxParallelEdgeLayout.prototype.layout=function(t){var e=t[0],i=this.graph.getView(),n=this.graph.getModel(),r=n.getGeometry(i.getVisibleTerminal(e,!0)),s=n.getGeometry(i.getVisibleTerminal(e,!1));if(r==s)for(var l=r.x+r.width+this.spacing,a=r.y+r.height/2,o=0;o0){var l=u+x/2,a=p+f/2,c=f*this.spacing/g,v=x*this.spacing/g;l+=c*(t.length-1)/2,a-=v*(t.length-1)/2;for(var o=0;o0?this.edges[0]:null},__mxOutput.mxGraphHierarchyEdge=typeof mxGraphHierarchyEdge<"u"?mxGraphHierarchyEdge:void 0;function mxGraphHierarchyModel(t,e,i,n,r){t.getGraph(),this.tightenToSource=r,this.roots=i,this.parent=n,this.vertexMapper=new mxDictionary,this.edgeMapper=new mxDictionary,this.maxRank=0;var s=[];e==null&&(e=this.graph.getChildVertices(n)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(t,e,s);for(var l=0;l0){var m=p[0],d=t.getVisibleTerminal(m,!1),x=this.vertexMapper.get(d);s[l]==x&&(d=t.getVisibleTerminal(m,!0),x=this.vertexMapper.get(d)),x!=null&&s[l]!=x&&(u.target=x,x.connectsAsTarget.length==0&&(x.connectsAsTarget=[]),mxUtils.indexOf(x.connectsAsTarget,u)<0&&x.connectsAsTarget.push(u))}}s[l].temp[0]=1}}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,i){for(var n=t.getGraph(),r=0;r0&&this.edgeMapper.get(o[0])==null&&u.length*2>=o.length){for(var p=new mxGraphHierarchyEdge(o),m=0;m0;){var i=t[0],s,l;s=i.connectsAsTarget,l=i.connectsAsSource;for(var a=!0,o=this.SOURCESCANSTARTRANK,e=0;e1){o.maxRank=l.maxRank,o.minRank=a.maxRank,o.temp=[],o.x=[],o.y=[];for(var d=o.minRank+1;d0){var m=p[0],d=t.getVisibleTerminal(m,!1),x=this.vertexMapper.get(d);s[l]==x&&(d=t.getVisibleTerminal(m,!0),x=this.vertexMapper.get(d)),x!=null&&s[l]!=x&&(u.target=x,x.connectsAsTarget.length==0&&(x.connectsAsTarget=[]),mxUtils.indexOf(x.connectsAsTarget,u)<0&&x.connectsAsTarget.push(u))}}s[l].temp[0]=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,i){for(var n=t.getGraph(),r=t.swimlanes,s=0;s0&&this.edgeMapper.get(p[0])==null&&m.length*2>=p.length){for(var d=new mxGraphHierarchyEdge(p),x=0;x=0;i--)i==this.ranksPerGroup.length-1?r[i]=0:r[i]=s[i+1]+1,s[i]=r[i]+this.ranksPerGroup[i];this.maxRank=s[0];for(var l=this.vertexMapper.getValues(),i=0;i0;){var n=t[0],a,o;a=n.connectsAsTarget,o=n.connectsAsSource;for(var u=!0,p=s[0],i=0;is[n.swimlaneIndex]&&(p=s[n.swimlaneIndex]),n.temp[0]=p,o!=null)for(var i=0;i1){o.maxRank=l.maxRank,o.minRank=a.maxRank,o.temp=[],o.x=[],o.y=[];for(var d=o.minRank+1;d0;)T%2&&(i+=v[T+1]),T=T-1>>1,++v[T]}return i},mxMedianHybridCrossingReduction.prototype.transpose=function(t,e){for(var i=!0,n=0,r=10;i&&n++y[M]&&L++,c[E]T[M]&&L++,v[E]=0;n--)this.medianRank(n,i);else for(var n=1;nt.medianValue?-1:e.medianValue0&&u<=o;){var m=e.shift(),d=m.cell,x=m.weightedValue,f=parseInt(m.rankIndex),g=d.getNextLayerConnectedCells(x),c=d.getPreviousLayerConnectedCells(x),v=g.length,y=c.length,T=this.medianXValue(g,x+1),C=this.medianXValue(c,x-1),S=v+y,E=d.getGeneralPurposeVariable(x),L=E;S>0&&(L=(T*v+C*y)/S);var A=!1;if(LE+p){var P=n[x].length;if(f==P-1)d.setGeneralPurposeVariable(x,L),A=!0;else{var R=n[x][f+1],O=R.getGeneralPurposeVariable(x);O=O-R.width/2-this.intraCellSpacing-d.width/2,O>L?(d.setGeneralPurposeVariable(x,L),A=!0):O>d.getGeneralPurposeVariable(x)+p&&(d.setGeneralPurposeVariable(x,O),A=!0)}}if(A){for(var r=0;r0;n--)this.rankMedianPosition(n-1,e,n);else for(var n=0;n0?m=this.medianXValue(o,i):m=p.getGeneralPurposeVariable(t));for(var d=0,x=-1e8,f=r[l].rankIndex-1;f>=0;){var g=s[n[f].id];if(g!=null){var c=g.cell;g.visited?(x=c.getGeneralPurposeVariable(t)+c.width/2+this.intraCellSpacing+d+p.width/2,f=-1):(d+=c.width+this.intraCellSpacing,f--)}}for(var v=0,y=1e8,f=r[l].rankIndex+1;f=x&&m<=y?p.setGeneralPurposeVariable(t,m):my&&(p.setGeneralPurposeVariable(t,y),this.currentXDelta+=m-y),r[l].visited=!0}},mxCoordinateAssignment.prototype.calculatedWeightedValue=function(t,e){for(var i=0,n=0;n=0;i--)i0&&this.rankCoordinates(i,t,e)},mxCoordinateAssignment.prototype.rankCoordinates=function(t,e,i){for(var n=i.ranks[t],r=0,s=this.initialX+(this.widestRankValue-this.rankWidths[t])/2,l=!1,a=0;a=0;r--){for(var s=0,l=e.ranks[r],a=this.initialX,o=!1,u=0;uthis.widestRankValue&&(this.widestRankValue=a,this.widestRank=r),this.rankWidths[r]=a}o==!0&&mxLog.warn("At least one cell has no bounds"),this.rankY[r]=i;var x=s/2+n/2+this.interRankCellSpacing;n=s,this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?i+=x:i-=x;for(var u=0;ur.minRank+1;o--){var g=r.getX(o-1);f==g||this.repositionValid(e,r,o-1,f)?(x[o-r.minRank-2]=f,m++):(x[o-r.minRank-2]=r.getX(o-1),f=g)}if(m>a||p>a){if(m>=p)for(var o=r.maxRank-2;o>r.minRank;o--)r.setX(o,x[o-r.minRank-1]);else if(p>m)for(var o=r.minRank+2;oa){if(s==r.length-1)return!0;var p=r[s+1],m=p.getGeneralPurposeVariable(i);return m=m-p.width/2-this.intraCellSpacing-e.width/2,m>=n}return!0},mxCoordinateAssignment.prototype.setCellLocations=function(t,e){this.rankTopY=[],this.rankBottomY=[];for(var i=0;i-1&&l0){for(var o=[],u=0;uy+2*this.prefHozEdgeSep&&(m+=this.prefHozEdgeSep,d-=this.prefHozEdgeSep);for(var T=d-m,C=T/x,S=m+C/2,E=this.minEdgeJetty-this.prefVertEdgeOff,u=0;ux/2&&(E-=this.prefVertEdgeOff);for(var M=0;M0?e=-e:e=-e+this.parallelEdgeSpacing,r++}t.temp[0]=101207}},mxCoordinateAssignment.prototype.setVertexLocation=function(t){var e=t.cell,i=t.x[0]-t.width/2,n=t.y[0]-t.height/2;this.rankTopY[t.minRank]=Math.min(this.rankTopY[t.minRank],n),this.rankBottomY[t.minRank]=Math.max(this.rankBottomY[t.minRank],n+t.height),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(e,i,n):this.layout.setVertexLocation(e,n,i),this.limitX=Math.max(this.limitX,i+t.width)},mxCoordinateAssignment.prototype.processReversedEdge=function(t,e){},__mxOutput.mxCoordinateAssignment=typeof mxCoordinateAssignment<"u"?mxCoordinateAssignment:void 0;function mxSwimlaneOrdering(t){this.layout=t}mxSwimlaneOrdering.prototype=new mxHierarchicalLayoutStage,mxSwimlaneOrdering.prototype.constructor=mxSwimlaneOrdering,mxSwimlaneOrdering.prototype.layout=null,mxSwimlaneOrdering.prototype.execute=function(t){var e=this.layout.getModel(),i=new Object,n=mxUtils.clone(e.vertexMapper,null,!0),r=null;if(e.roots!=null){var s=e.roots;r=[];for(var l=0;l0&&i.push(a);var x=u-p;x>s&&(s=x,r=a)}}i.length==0&&r!=null&&i.push(r)}return i},mxHierarchicalLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(e!=null)return e;for(var i=this.graph.model,n=[],r=this.graph.isCellCollapsed(t),s=i.getChildCount(t),l=0;l=0&&(r=this.traverse(m,e,o[p],n,r,s,l))}}else if(r[a]==null)for(var p=0;p0&&i.push(a);var f=u-p;f>s&&(s=f,r=a)}}i.length==0&&r!=null&&i.push(r)}return i},mxSwimlaneLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(e!=null)return e;for(var i=this.graph.model,n=[],r=this.graph.isCellCollapsed(t),s=i.getChildCount(t),l=0;l0&&t!=null){for(var n=Object(),r=0;r=this.swimlanes.length||(f>a||(!e||x)&&f==a)&&(r=this.traverse(d,e,u[m],n,r,s,l,f))}}else if(r[o]==null)for(var m=0;m0){var n=t,r=mxCellPath.create(n);if(i.length=0;i--)this.cellRemoved(this.getChildAt(t,i));this.cells!=null&&t.getId()!=null&&delete this.cells[t.getId()]}},mxGraphModel.prototype.parentForCellChanged=function(t,e,i){var n=this.getParent(t);if(e!=null)(e!=n||n.getIndex(t)!=i)&&e.insert(t,i);else if(n!=null){var r=n.getIndex(t);n.remove(r)}var s=this.contains(e),l=this.contains(n);return s&&!l?this.cellAdded(t):l&&!s&&this.cellRemoved(t),n},mxGraphModel.prototype.getChildCount=function(t){return t!=null?t.getChildCount():0},mxGraphModel.prototype.getChildAt=function(t,e){return t!=null?t.getChildAt(e):null},mxGraphModel.prototype.getChildren=function(t){return t!=null?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,i){e=e??!1,i=i??!1;for(var n=this.getChildCount(t),r=[],s=0;s=0&&(e=this.getChildAt(t),e!=null&&(this.children.splice(t,1),e.setParent(null))),e},mxCell.prototype.removeFromParent=function(){if(this.parent!=null){var t=this.parent.getIndex(this);this.parent.remove(t)}},mxCell.prototype.getEdgeCount=function(){return this.edges==null?0:this.edges.length},mxCell.prototype.getEdgeIndex=function(t){return mxUtils.indexOf(this.edges,t)},mxCell.prototype.getEdgeAt=function(t){return this.edges==null?null:this.edges[t]},mxCell.prototype.insertEdge=function(t,e){return t!=null&&(t.removeFromTerminal(e),t.setTerminal(this,e),(this.edges==null||t.getTerminal(!e)!=this||mxUtils.indexOf(this.edges,t)<0)&&(this.edges==null&&(this.edges=[]),this.edges.push(t))),t},mxCell.prototype.removeEdge=function(t,e){if(t!=null){if(t.getTerminal(!e)!=this&&this.edges!=null){var i=this.getEdgeIndex(t);i>=0&&this.edges.splice(i,1)}t.setTerminal(null,e)}return t},mxCell.prototype.removeFromTerminal=function(t){var e=this.getTerminal(t);e!=null&&e.removeEdge(this,t)},mxCell.prototype.hasAttribute=function(t){var e=this.getValue();return e!=null&&e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.hasAttribute?e.hasAttribute(t):e.getAttribute(t)!=null},mxCell.prototype.getAttribute=function(t,e){var i=this.getValue(),n=i!=null&&i.nodeType==mxConstants.NODETYPE_ELEMENT?i.getAttribute(t):null;return n??e},mxCell.prototype.setAttribute=function(t,e){var i=this.getValue();i!=null&&i.nodeType==mxConstants.NODETYPE_ELEMENT&&i.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 t!=null&&(typeof t.clone=="function"?t=t.clone():isNaN(t.nodeType)||(t=t.cloneNode(!0))),t},__mxOutput.mxCell=typeof mxCell<"u"?mxCell:void 0;function mxGeometry(t,e,i,n){mxRectangle.call(this,t,e,i,n)}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(){if(this.alternateBounds!=null){var 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 i=mxUtils.toRadians(t),n=Math.cos(i),r=Math.sin(i);if(!this.relative){var s=new mxPoint(this.getCenterX(),this.getCenterY()),l=mxUtils.getRotatedPoint(s,n,r,e);this.x=Math.round(l.x-this.width/2),this.y=Math.round(l.y-this.height/2)}if(this.sourcePoint!=null){var l=mxUtils.getRotatedPoint(this.sourcePoint,n,r,e);this.sourcePoint.x=Math.round(l.x),this.sourcePoint.y=Math.round(l.y)}if(this.targetPoint!=null){var l=mxUtils.getRotatedPoint(this.targetPoint,n,r,e);this.targetPoint.x=Math.round(l.x),this.targetPoint.y=Math.round(l.y)}if(this.points!=null){for(var a=0;a1&&(e=e.substring(0,r-1)),e},getParentPath:function(t){if(t!=null){var e=t.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(e>=0)return t.substring(0,e);if(t.length>0)return""}return null},resolve:function(t,e){var i=t;if(e!=null)for(var n=e.split(mxCellPath.PATH_SEPARATOR),r=0;re[r]?1:-1;else{var s=parseInt(t[r]),l=parseInt(e[r]);n=s==l?0:s>l?1:-1}break}if(n==0){var s=t.length,l=e.length;s!=l&&(n=s>l?1:-1)}return n}};__mxOutput.mxCellPath=typeof mxCellPath<"u"?mxCellPath:void 0;var mxPerimeter={RectanglePerimeter:function(t,e,i,n){var r=t.getCenterX(),s=t.getCenterY(),l=i.x-r,a=i.y-s,o=Math.atan2(a,l),u=new mxPoint(0,0),p=Math.PI,m=Math.PI/2,d=m-o,x=Math.atan2(t.height,t.width);return o<-p+x||o>p-x?(u.x=t.x,u.y=s-t.width*Math.tan(o)/2):o<-x?(u.y=t.y,u.x=r-t.height*Math.tan(d)/2):o=t.x&&i.x<=t.x+t.width?u.x=i.x:i.y>=t.y&&i.y<=t.y+t.height&&(u.y=i.y),i.xt.x+t.width&&(u.x=t.x+t.width),i.yt.y+t.height&&(u.y=t.y+t.height)),u},EllipsePerimeter:function(t,e,i,n){var r=t.x,s=t.y,l=t.width/2,a=t.height/2,o=r+l,u=s+a,p=i.x,m=i.y,d=parseInt(p-o),x=parseInt(m-u);if(d==0&&x!=0)return new mxPoint(o,u+a*x/Math.abs(x));if(d==0&&x==0)return new mxPoint(p,m);if(n){if(m>=s&&m<=s+t.height){var f=m-u,g=Math.sqrt(l*l*(1-f*f/(a*a)))||0;return p<=r&&(g=-g),new mxPoint(o+g,m)}if(p>=r&&p<=r+t.width){var g=p-o,f=Math.sqrt(a*a*(1-g*g/(l*l)))||0;return m<=s&&(f=-f),new mxPoint(p,u+f)}}var c=x/d,v=u-c*o,y=l*l*c*c+a*a,T=-2*o*y,C=l*l*c*c*o*o+a*a*o*o-l*l*a*a,S=Math.sqrt(T*T-4*y*C),E=(-T+S)/(2*y),L=(-T-S)/(2*y),A=c*E+v,M=c*L+v,I=Math.sqrt(Math.pow(E-p,2)+Math.pow(A-m,2)),P=Math.sqrt(Math.pow(L-p,2)+Math.pow(M-m,2)),R=0,O=0;return Im?new mxPoint(o,s):new mxPoint(o,s+a);if(u==m)return o>p?new mxPoint(r,u):new mxPoint(r+l,u);var d=o,x=u;return n&&(p>=r&&p<=r+l?d=p:m>=s&&m<=s+a&&(x=m)),p-y&&vMath.PI-y;var C=null;if(T)n&&(s&&i.x>=d.x&&i.x<=f.x||!s&&i.y>=d.y&&i.y<=f.y)?s?C=new mxPoint(i.x,d.y):C=new mxPoint(d.x,i.y):r==mxConstants.DIRECTION_NORTH?C=new mxPoint(l+o/2+u*Math.tan(v)/2,a+u):r==mxConstants.DIRECTION_SOUTH?C=new mxPoint(l+o/2-u*Math.tan(v)/2,a):r==mxConstants.DIRECTION_WEST?C=new mxPoint(l+o,a+u/2+o*Math.tan(v)/2):C=new mxPoint(l,a+u/2-o*Math.tan(v)/2);else{if(n){var S=new mxPoint(p,m);i.y>=a&&i.y<=a+u?(S.x=s?p:r==mxConstants.DIRECTION_WEST?l+o:l,S.y=i.y):i.x>=l&&i.x<=l+o&&(S.x=i.x,S.y=s?r==mxConstants.DIRECTION_NORTH?a+u:a:m),g=i.x-S.x,c=i.y-S.y,p=S.x,m=S.y}s&&i.x<=l+o/2||!s&&i.y<=a+u/2?C=mxUtils.intersection(i.x,i.y,p,m,d.x,d.y,x.x,x.y):C=mxUtils.intersection(i.x,i.y,p,m,x.x,x.y,f.x,f.y)}return C==null&&(C=new mxPoint(p,m)),C},HexagonPerimeter:function(t,e,i,n){var r=t.x,s=t.y,l=t.width,a=t.height,o=t.getCenterX(),u=t.getCenterY(),p=i.x,m=i.y,d=p-o,x=m-u,f=-Math.atan2(x,d),g=Math.PI,c=Math.PI/2,v=new mxPoint(o,u),y=e!=null?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST,T=y==mxConstants.DIRECTION_NORTH||y==mxConstants.DIRECTION_SOUTH,C=new mxPoint,S=new mxPoint;if((ps+a||p>r+l&&mr+l&&m>s+a)&&(n=!1),n){if(T){if(p==o){if(m<=s)return new mxPoint(o,s);if(m>=s+a)return new mxPoint(o,s+a)}else if(pr+l){if(m==s+a/4)return new mxPoint(r+l,s+a/4);if(m==s+3*a/4)return new mxPoint(r+l,s+3*a/4)}else if(p==r){if(mu)return new mxPoint(r,s+3*a/4)}else if(p==r+l){if(mu)return new mxPoint(r+l,s+3*a/4)}if(m==s)return new mxPoint(o,s);if(m==s+a)return new mxPoint(o,s+a);ps+a/4&&ms+3*a/4&&(C=new mxPoint(r-Math.floor(.5*l),s+Math.floor(.5*a)),S=new mxPoint(r+l,s+Math.floor(1.25*a))):p>o&&(m>s+a/4&&ms+3*a/4&&(C=new mxPoint(r+Math.floor(1.5*l),s+Math.floor(.5*a)),S=new mxPoint(r,s+Math.floor(1.25*a))))}else{if(m==u){if(p<=r)return new mxPoint(r,s+a/2);if(p>=r+l)return new mxPoint(r+l,s+a/2)}else if(ms+a){if(p==r+l/4)return new mxPoint(r+l/4,s+a);if(p==r+3*l/4)return new mxPoint(r+3*l/4,s+a)}else if(m==s){if(po)return new mxPoint(r+3*l/4,s)}else if(m==s+a){if(pu)return new mxPoint(r+3*l/4,s+a)}if(p==r)return new mxPoint(r,u);if(p==r+l)return new mxPoint(r+l,u);mr+l/4&&pr+3*l/4&&(C=new mxPoint(r+Math.floor(.5*l),s-Math.floor(.5*a)),S=new mxPoint(r+Math.floor(1.25*l),s+a)):m>u&&(p>r+l/4&&pr+3*l/4&&(C=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a)),S=new mxPoint(r+Math.floor(1.25*l),s)))}var E=o,L=u;p>=r&&p<=r+l?(E=p,m=s&&m<=s+a&&(L=m,p-A?(C=new mxPoint(r+l,s),S=new mxPoint(r+l,s+a)):f>A&&fc&&fg-A&&f<=g||f<-g+A&&f>=-g?(C=new mxPoint(r,s),S=new mxPoint(r,s+a)):f<-A&&f>-c?(C=new mxPoint(r+Math.floor(1.5*l),s+Math.floor(.5*a)),S=new mxPoint(r,s+Math.floor(1.25*a))):f<-c&&f>-g+A&&(C=new mxPoint(r-Math.floor(.5*l),s+Math.floor(.5*a)),S=new mxPoint(r+l,s+Math.floor(1.25*a)))}else{var A=Math.atan2(a/2,l/4);if(f==A)return new mxPoint(r+Math.floor(.75*l),s);if(f==g-A)return new mxPoint(r+Math.floor(.25*l),s);if(f==g||f==-g)return new mxPoint(r,s+Math.floor(.5*a));if(f==0)return new mxPoint(r+l,s+Math.floor(.5*a));if(f==-A)return new mxPoint(r+Math.floor(.75*l),s+a);if(f==-g+A)return new mxPoint(r+Math.floor(.25*l),s+a);f>0&&fA&&fg-A&&f-A?(C=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a)),S=new mxPoint(r+Math.floor(1.25*l),s)):f<-A&&f>-g+A?(C=new mxPoint(r,s+a),S=new mxPoint(r+l,s+a)):f<-g+A&&f>-g&&(C=new mxPoint(r-Math.floor(.25*l),s),S=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a)))}v=mxUtils.intersection(o,u,i.x,i.y,C.x,C.y,S.x,S.y)}return v??new mxPoint(o,u)}};__mxOutput.mxPerimeter=typeof mxPerimeter<"u"?mxPerimeter:void 0;function mxPrintPreview(t,e,i,n,r,s,l,a,o){this.graph=t,this.scale=e??1/t.pageScale,this.border=n??0,this.pageFormat=mxRectangle.fromRectangle(i??t.pageFormat),this.title=a??"Printer-friendly version",this.x0=r??0,this.y0=s??0,this.borderColor=l,this.pageSelector=o??!0}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 document.documentMode==5?t='':document.documentMode==8?t='':document.documentMode>8&&(t=''),t},mxPrintPreview.prototype.appendGraph=function(t,e,i,n,r,s){this.graph=t,this.scale=e??1/t.pageScale,this.x0=i,this.y0=n,this.open(null,null,r,s)},mxPrintPreview.prototype.open=function(t,e,i,n){var r=this.graph.cellRenderer.initializeOverlay,s=null;try{this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(P,R){R.init(P.view.getDrawPane())}),this.printControls&&(this.graph.cellRenderer.initControl=function(P,R,O,_){R.dialect=P.view.graph.dialect,R.init(P.view.getDrawPane())}),this.wnd=e??this.wnd;var l=!1;this.wnd==null&&(l=!0,this.wnd=window.open());var a=this.wnd.document;if(l){var o=this.getDoctype();o!=null&&o.length>0&&a.writeln(o),mxClient.IS_VML?a.writeln(''):(document.compatMode==="CSS1Compat"&&a.writeln(""),a.writeln("")),a.writeln(""),this.writeHead(a,t),a.writeln(""),a.writeln('')}var u=this.graph.getGraphBounds().clone(),p=this.graph.getView().getScale(),m=p/this.scale,d=this.graph.getView().getTranslate();this.autoOrigin||(this.x0-=d.x*this.scale,this.y0-=d.y*this.scale,u.width+=u.x,u.height+=u.y,u.x=0,u.y=0,this.border=0);var x=this.pageFormat.width-this.border*2,f=this.pageFormat.height-this.border*2;this.pageFormat.height+=this.marginTop+this.marginBottom,u.width/=m,u.height/=m;var g=Math.max(1,Math.ceil((u.width+this.x0)/x)),c=Math.max(1,Math.ceil((u.height+this.y0)/f));this.pageCount=g*c;var v=mxUtils.bind(this,function(){if(this.pageSelector&&(c>1||g>1)){var P=this.createPageSelector(c,g);if(a.body.appendChild(P),mxClient.IS_IE&&a.documentMode==null||a.documentMode==5||a.documentMode==8||a.documentMode==7){P.style.position="absolute";var R=function(){P.style.top=(a.body.scrollTop||a.documentElement.scrollTop)+10+"px"};mxEvent.addListener(this.wnd,"scroll",function(O){R()}),mxEvent.addListener(this.wnd,"resize",function(O){R()})}}}),y=mxUtils.bind(this,function(P,R){if(this.borderColor!=null&&(P.style.borderColor=this.borderColor,P.style.borderStyle="solid",P.style.borderWidth="1px"),P.style.background=this.backgroundColor,(i||R)&&(P.style.pageBreakAfter="always"),l&&(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE))a.writeln(P.outerHTML),P.parentNode.removeChild(P);else if(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE){var O=a.createElement("div");O.innerHTML=P.outerHTML,O=O.getElementsByTagName("div")[0],a.body.appendChild(O),P.parentNode.removeChild(P)}else P.parentNode.removeChild(P),a.body.appendChild(P);(i||R)&&this.addPageBreak(a)}),T=this.getCoverPages(this.pageFormat.width,this.pageFormat.height);if(T!=null)for(var C=0;C"),t.writeln(""),t.close(),mxEvent.release(t.body)}}catch{}},mxPrintPreview.prototype.writeHead=function(t,e){this.title!=null&&t.writeln(""+this.title+""),mxClient.IS_VML&&t.writeln(''),mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",t),t.writeln('")},mxPrintPreview.prototype.writePostfix=function(t){},mxPrintPreview.prototype.createPageSelector=function(t,e){var i=this.wnd.document,n=i.createElement("table");n.className="mxPageSelector",n.setAttribute("border","0");for(var r=i.createElement("tbody"),s=0;s0&&b.height>0&&!mxUtils.intersects(C,b))return}}v.apply(this,arguments)}}var S=null;try{var E=[this.getRoot()];S=new mxTemporaryCellStates(l,i,E,null,mxUtils.bind(this,function(P){return this.getLinkForCellState(P)}))}finally{if(mxClient.IS_IE)l.overlayPane.innerHTML="",l.canvas.style.overflow="hidden",l.canvas.style.position="relative",l.canvas.style.top=this.marginTop+"px",l.canvas.style.width=s.width+"px",l.canvas.style.height=s.height+"px";else for(var L=r.firstChild;L!=null;){var A=L.nextSibling,M=L.nodeName.toLowerCase();M=="svg"?(L.style.overflow="hidden",L.style.position="relative",L.style.top=this.marginTop+"px",L.setAttribute("width",s.width),L.setAttribute("height",s.height),L.style.width="",L.style.height=""):L.style.cursor!="default"&&M!="div"&&L.parentNode.removeChild(L),L=A}if(this.printBackgroundImage){var I=r.getElementsByTagName("svg");I.length>0&&(I[0].style.position="absolute")}l.overlayPane.parentNode.removeChild(l.overlayPane),this.graph.setEnabled(g),this.graph.container=a,this.graph.cellRenderer.redraw=v,l.canvas=o,l.backgroundPane=u,l.drawPane=p,l.overlayPane=m,l.translate=c,S.destroy(),l.setEventsEnabled(f)}},mxPrintPreview.prototype.getLinkForCellState=function(t){return this.graph.getLinkForCell(t.cell)},mxPrintPreview.prototype.insertBackgroundImage=function(t,e,i){var n=this.graph.backgroundImage;if(n!=null){var r=document.createElement("img");r.style.position="absolute",r.style.marginLeft=Math.round(e*this.scale)+"px",r.style.marginTop=Math.round(i*this.scale)+"px",r.setAttribute("width",Math.round(this.scale*n.width)),r.setAttribute("height",Math.round(this.scale*n.height)),r.src=n.src,t.insertBefore(r,t.firstChild)}},mxPrintPreview.prototype.getCoverPages=function(){return null},mxPrintPreview.prototype.getAppendices=function(){return null},mxPrintPreview.prototype.print=function(t){var e=this.open(t);e!=null&&e.print()},mxPrintPreview.prototype.close=function(){this.wnd!=null&&(this.wnd.close(),this.wnd=null)},__mxOutput.mxPrintPreview=typeof mxPrintPreview<"u"?mxPrintPreview:void 0;function mxStylesheet(){this.styles=new Object,this.putDefaultVertexStyle(this.createDefaultVertexStyle()),this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}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 i=e;if(t!=null&&t.length>0){var n=t.split(";");i!=null&&t.charAt(0)!=";"?i=mxUtils.clone(i):i=new Object;for(var r=0;r=0){var a=s.substring(0,l),o=s.substring(l+1);o==mxConstants.NONE?delete i[a]:mxUtils.isNumeric(o)?i[a]=parseFloat(o):i[a]=o}else{var u=this.styles[s];if(u!=null)for(var a in u)i[a]=u[a]}}}return i},__mxOutput.mxStylesheet=typeof mxStylesheet<"u"?mxStylesheet:void 0;function mxCellState(t,e,i){this.view=t,this.cell=e,this.style=i??{},this.origin=new mxPoint,this.absoluteOffset=new mxPoint}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){if(t=t||0,e=e??new mxRectangle(this.x,this.y,this.width,this.height),this.shape!=null&&this.shape.stencil!=null&&this.shape.stencil.aspect=="fixed"){var i=this.shape.stencil.computeAspect(this.style,e.x,e.y,e.width,e.height);e.x=i.x,e.y=i.y,e.width=this.shape.stencil.w0*i.width,e.height=this.shape.stencil.h0*i.height}return t!=0&&e.grow(t),e},mxCellState.prototype.setAbsoluteTerminalPoint=function(t,e){e?(this.absolutePoints==null&&(this.absolutePoints=[]),this.absolutePoints.length==0?this.absolutePoints.push(t):this.absolutePoints[0]=t):this.absolutePoints==null?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(t)):this.absolutePoints.length==1?this.absolutePoints.push(t):this.absolutePoints[this.absolutePoints.length-1]=t},mxCellState.prototype.setCursor=function(t){this.shape!=null&&this.shape.setCursor(t),this.text!=null&&this.text.setCursor(t)},mxCellState.prototype.getVisibleTerminal=function(t){var e=this.getVisibleTerminalState(t);return e!=null?e.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),this.shape!=null&&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(this.absolutePoints!=null){t.absolutePoints=[];for(var e=0;e=0:!1},mxGraphSelectionModel.prototype.isEmpty=function(){return this.cells.length==0},mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)},mxGraphSelectionModel.prototype.setCell=function(t){t!=null&&this.setCells([t])},mxGraphSelectionModel.prototype.setCells=function(t){if(t!=null){this.singleSelection&&(t=[this.getFirstSelectableCell(t)]);for(var e=[],i=0;i0&&t[0]!=null||e!=null&&e.length>0&&e[0]!=null){var i=new mxSelectionChange(this,t,e);i.execute();var n=new mxUndoableEdit(this,!1);n.add(i),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",n))}},mxGraphSelectionModel.prototype.cellAdded=function(t){t!=null&&!this.isSelected(t)&&this.cells.push(t)},mxGraphSelectionModel.prototype.cellRemoved=function(t){if(t!=null){var e=mxUtils.indexOf(this.cells,t);e>=0&&this.cells.splice(e,1)}};function mxSelectionChange(t,e,i){this.selectionModel=t,this.added=e!=null?e.slice():null,this.removed=i!=null?i.slice():null}mxSelectionChange.prototype.execute=function(){var t=mxLog.enter("mxSelectionChange.execute");if(window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource,this.removed!=null)for(var e=0;e":"",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){this.textarea!=null&&(this.textarea.style.textAlign=t),this.align=t,this.resize()},mxCellEditor.prototype.getInitialValue=function(t,e){var i=mxUtils.htmlEntities(this.graph.getEditingValue(t.cell,e),!1);return!mxClient.IS_QUIRKS&&document.documentMode!=8&&document.documentMode!=9&&document.documentMode!=10&&(i=mxUtils.replaceTrailingNewlines(i,"

")),i.replace(/\n/g,"
")},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(t){mxEvent.addListener(t,"dragstart",mxUtils.bind(this,function(s){this.graph.stopEditing(!1),mxEvent.consume(s)})),mxEvent.addListener(t,"blur",mxUtils.bind(this,function(s){this.blurEnabled&&this.focusLost(s)})),mxEvent.addListener(t,"keydown",mxUtils.bind(this,function(s){mxEvent.isConsumed(s)||(this.isStopEditingEvent(s)?(this.graph.stopEditing(!1),mxEvent.consume(s)):s.keyCode==27&&(this.graph.stopEditing(this.isCancelEditingKeyEvent(s)),mxEvent.consume(s)))}));var e=mxUtils.bind(this,function(s){this.editingCell!=null&&this.clearOnChange&&t.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||s.keyCode!=8&&s.keyCode!=46)&&(this.clearOnChange=!1,t.innerHTML="")});mxEvent.addListener(t,"keypress",e),mxEvent.addListener(t,"paste",e);var i=mxUtils.bind(this,function(s){this.editingCell!=null&&(this.textarea.innerHTML.length==0||this.textarea.innerHTML=="
"?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=this.textarea.innerHTML.length>0):this.clearOnChange=!1)});mxEvent.addListener(t,!mxClient.IS_IE11&&!mxClient.IS_IE?"input":"keyup",i),mxEvent.addListener(t,"cut",i),mxEvent.addListener(t,"paste",i);var n=!mxClient.IS_IE11&&!mxClient.IS_IE?"input":"keydown",r=mxUtils.bind(this,function(s){this.editingCell!=null&&this.autoSize&&!mxEvent.isConsumed(s)&&(this.resizeThread!=null&&window.clearTimeout(this.resizeThread),this.resizeThread=window.setTimeout(mxUtils.bind(this,function(){this.resizeThread=null,this.resize()}),0))});mxEvent.addListener(t,n,r),mxEvent.addListener(window,"resize",r),document.documentMode>=9?(mxEvent.addListener(t,"DOMNodeRemoved",r),mxEvent.addListener(t,"DOMNodeInserted",r)):(mxEvent.addListener(t,"cut",r),mxEvent.addListener(t,"paste",r))},mxCellEditor.prototype.isStopEditingEvent=function(t){return t.keyCode==113||this.graph.isEnterStopsCellEditing()&&t.keyCode==13&&!mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)},mxCellEditor.prototype.isEventSource=function(t){return mxEvent.getSource(t)==this.textarea},mxCellEditor.prototype.resize=function(){var t=this.graph.getView().getState(this.editingCell);if(t==null)this.stopEditing(!0);else if(this.textarea!=null){var e=this.graph.getModel().isEdge(t.cell),i=this.graph.getView().scale,n=null;if(!this.autoSize||t.style[mxConstants.STYLE_OVERFLOW]=="fill")this.bounds=this.getEditorBounds(t),this.textarea.style.width=Math.round(this.bounds.width/i)+"px",this.textarea.style.height=Math.round(this.bounds.height/i)+"px",document.documentMode==8||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(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()?(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal",t.style[mxConstants.STYLE_OVERFLOW]!="fill"&&(this.textarea.style.width=Math.round(this.bounds.width/i)+this.wordWrapPadding+"px")):(this.textarea.style.whiteSpace="nowrap",t.style[mxConstants.STYLE_OVERFLOW]!="fill"&&(this.textarea.style.width=""));else{var r=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);if(n=t.text!=null&&this.align==null?t.text.margin:null,n==null&&(n=mxUtils.getAlignmentAsPoint(this.align||mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE))),e){if(this.bounds=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y,0,0),r!=null){var s=(parseFloat(r)+2)*i;this.bounds.width=s,this.bounds.x+=n.x*s}}else{var l=mxRectangle.fromRectangle(t),a=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),o=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(l=t.shape!=null&&a==mxConstants.ALIGN_CENTER&&o==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(l):l,r!=null&&(l.width=parseFloat(r)*i),!t.view.graph.cellRenderer.legacySpacing||t.style[mxConstants.STYLE_OVERFLOW]!="width"){var u=parseInt(t.style[mxConstants.STYLE_SPACING]||2)*i,p=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*i+u,m=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*i+u,d=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*i+u,x=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*i+u,a=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),o=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);l=new mxRectangle(l.x+x,l.y+p,l.width-(a==mxConstants.ALIGN_CENTER&&r==null?x+m:0),l.height-(o==mxConstants.ALIGN_MIDDLE?p+d:0))}this.bounds=new mxRectangle(l.x+t.absoluteOffset.x,l.y+t.absoluteOffset.y,l.width,l.height)}if(this.graph.isWrapping(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()){this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal";var s=Math.round(this.bounds.width/(document.documentMode==8,i))+this.wordWrapPadding;this.textarea.style.position!="relative"?(this.textarea.style.width=s+"px",this.textarea.scrollWidth>s&&(this.textarea.style.width=this.textarea.scrollWidth+"px")):this.textarea.style.maxWidth=s+"px"}else this.textarea.style.whiteSpace="nowrap",this.textarea.style.width="";document.documentMode==8&&(this.textarea.style.zoom="1",this.textarea.style.height="auto");var f=this.textarea.scrollWidth,g=this.textarea.scrollHeight;document.documentMode==8?(this.textarea.style.left=Math.max(0,Math.ceil((this.bounds.x-n.x*(this.bounds.width-(f+1)*i)+f*(i-1)*0+(n.x+.5)*2)/i))+"px",this.textarea.style.top=Math.max(0,Math.ceil((this.bounds.y-n.y*(this.bounds.height-(g+.5)*i)+g*(i-1)*0+Math.abs(n.y+.5)*1)/i))+"px",this.textarea.style.width=Math.round(f*i)+"px",this.textarea.style.height=Math.round(g*i)+"px"):mxClient.IS_QUIRKS?(this.textarea.style.left=Math.max(0,Math.ceil(this.bounds.x-n.x*(this.bounds.width-(f+1)*i)+f*(i-1)*0+(n.x+.5)*2))+"px",this.textarea.style.top=Math.max(0,Math.ceil(this.bounds.y-n.y*(this.bounds.height-(g+.5)*i)+g*(i-1)*0+Math.abs(n.y+.5)*1))+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-n.x*(this.bounds.width-2))+1)+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-n.y*(this.bounds.height-4)+(n.y==-1?3:0))+1)+"px")}mxClient.IS_VML?this.textarea.style.zoom=i:(mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px"),mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+i+","+i+")"+(n==null?"":" translate("+n.x*100+"%,"+n.y*100+"%)")))}},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=!1;if(mxClient.IS_SVG){var e=this.graph.view.getDrawPane().ownerSVGElement;if(e!=null){var i=mxUtils.getCurrentStyle(e);i!=null&&(t=i.position=="absolute")}}return!t},mxCellEditor.prototype.startEditing=function(t,e){this.stopEditing(!0),this.align=null,this.textarea==null&&this.init(),this.graph.tooltipHandler!=null&&this.graph.tooltipHandler.hideTooltip();var i=this.graph.getView().getState(t);if(i!=null){this.graph.getView().scale;var n=mxUtils.getValue(i.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),r=mxUtils.getValue(i.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),s=mxUtils.getValue(i.style,mxConstants.STYLE_FONTCOLOR,"black"),l=mxUtils.getValue(i.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),a=(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,o=(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,u=[];(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&u.push("underline"),(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&u.push("line-through"),this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(n*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT,this.textarea.style.backgroundColor=this.getBackgroundColor(i),this.textarea.style.textDecoration=u.join(" "),this.textarea.style.fontWeight=a?"bold":"normal",this.textarea.style.fontStyle=o?"italic":"",this.textarea.style.fontSize=Math.round(n)+"px",this.textarea.style.zIndex=this.zIndex,this.textarea.style.fontFamily=r,this.textarea.style.textAlign=l,this.textarea.style.outline="none",this.textarea.style.color=s;var p=this.textDirection=mxUtils.getValue(i.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);p==mxConstants.TEXT_DIRECTION_AUTO&&i!=null&&i.text!=null&&i.text.dialect!=mxConstants.DIALECT_STRICTHTML&&!mxUtils.isNode(i.text.value)&&(p=i.text.getAutoDirection()),p==mxConstants.TEXT_DIRECTION_LTR||p==mxConstants.TEXT_DIRECTION_RTL?this.textarea.setAttribute("dir",p):this.textarea.removeAttribute("dir"),this.textarea.innerHTML=this.getInitialValue(i,e)||"",this.initialValue=this.textarea.innerHTML,this.textarea.innerHTML.length==0||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,i.text!=null&&this.isHideLabel(i)&&(this.textNode=i.text.node,this.textNode.style.visibility="hidden"),this.autoSize&&(this.graph.model.isEdge(i.cell)||i.style[mxConstants.STYLE_OVERFLOW]!="fill")&&window.setTimeout(mxUtils.bind(this,function(){this.resize()}),0),this.resize();try{this.textarea.focus(),this.isSelectText()&&this.textarea.innerHTML.length>0&&(this.textarea.innerHTML!=this.getEmptyLabelText()||!this.clearOnChange)&&document.execCommand("selectAll",!1,null)}catch{}}},mxCellEditor.prototype.isSelectText=function(){return this.selectText},mxCellEditor.prototype.clearSelection=function(){var t=null;window.getSelection?t=window.getSelection():document.selection&&(t=document.selection),t!=null&&(t.empty?t.empty():t.removeAllRanges&&t.removeAllRanges())},mxCellEditor.prototype.stopEditing=function(t){if(t=t||!1,this.editingCell!=null){this.textNode!=null&&(this.textNode.style.visibility="visible",this.textNode=null);var e=t?null:this.graph.view.getState(this.editingCell),i=this.initialValue;if(this.initialValue=null,this.editingCell=null,this.trigger=null,this.bounds=null,this.textarea.blur(),this.clearSelection(),this.textarea.parentNode!=null&&this.textarea.parentNode.removeChild(this.textarea),this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.textarea.innerHTML="",this.clearOnChange=!1),e!=null&&(this.textarea.innerHTML!=i||this.align!=null)){this.prepareTextarea();var n=this.getCurrentValue(e);this.graph.getModel().beginUpdate();try{n!=null&&this.applyValue(e,n),this.align!=null&&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(){this.textarea.lastChild!=null&&this.textarea.lastChild.nodeName=="BR"&&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,t.text==null?30:t.text.size*e+20,this.textarea.style.textAlign=="left"?120:40)},mxCellEditor.prototype.getEditorBounds=function(t){var e=this.graph.getModel().isEdge(t.cell),i=this.graph.getView().scale,n=this.getMinimumSize(t),r=n.width,s=n.height,l=null;if(!e&&t.view.graph.cellRenderer.legacySpacing&&t.style[mxConstants.STYLE_OVERFLOW]=="fill")l=t.shape.getLabelBounds(mxRectangle.fromRectangle(t));else{var a=parseInt(t.style[mxConstants.STYLE_SPACING]||0)*i,o=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*i+a,u=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*i+a,p=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*i+a,m=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*i+a;l=new mxRectangle(t.x,t.y,Math.max(r,t.width-m-u),Math.max(s,t.height-o-p));var d=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),x=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(l=t.shape!=null&&d==mxConstants.ALIGN_CENTER&&x==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(l):l,e?(l.x=t.absoluteOffset.x,l.y=t.absoluteOffset.y,t.text!=null&&t.text.boundingBox!=null&&(t.text.boundingBox.x>0&&(l.x=t.text.boundingBox.x),t.text.boundingBox.y>0&&(l.y=t.text.boundingBox.y))):t.text!=null&&t.text.boundingBox!=null&&(l.x=Math.min(l.x,t.text.boundingBox.x),l.y=Math.min(l.y,t.text.boundingBox.y)),l.x+=m,l.y+=o,t.text!=null&&t.text.boundingBox!=null&&(e?(l.width=Math.max(r,t.text.boundingBox.width),l.height=Math.max(s,t.text.boundingBox.height)):(l.width=Math.max(l.width,t.text.boundingBox.width),l.height=Math.max(l.height,t.text.boundingBox.height))),this.graph.getModel().isVertex(t.cell)){var f=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);f==mxConstants.ALIGN_LEFT?l.x-=t.width:f==mxConstants.ALIGN_RIGHT&&(l.x+=t.width);var g=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);g==mxConstants.ALIGN_TOP?l.y-=t.height:g==mxConstants.ALIGN_BOTTOM&&(l.y+=t.height)}}return new mxRectangle(Math.round(l.x),Math.round(l.y),Math.round(l.width),Math.round(l.height))},mxCellEditor.prototype.getEmptyLabelText=function(t){return this.emptyLabelText},mxCellEditor.prototype.getEditingCell=function(){return this.editingCell},mxCellEditor.prototype.destroy=function(){this.textarea!=null&&(mxEvent.release(this.textarea),this.textarea.parentNode!=null&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null),this.changeHandler!=null&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null),this.zoomHandler&&(this.graph.view.removeListener(this.zoomHandler),this.zoomHandler=null)},__mxOutput.mxCellEditor=typeof mxCellEditor<"u"?mxCellEditor:void 0;function mxCellRenderer(){}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=null;if(t.style!=null){var i=mxStencilRegistry.getStencil(t.style[mxConstants.STYLE_SHAPE]);if(i!=null)e=new mxShape(i);else{var n=this.getShapeConstructor(t);e=new n}}return e},mxCellRenderer.prototype.createIndicatorShape=function(t){t.shape.indicatorShape=this.getShape(t.view.graph.getIndicatorShape(t))},mxCellRenderer.prototype.getShape=function(t){return t!=null?mxCellRenderer.defaultShapes[t]:null},mxCellRenderer.prototype.getShapeConstructor=function(t){var e=this.getShape(t.style[mxConstants.STYLE_SHAPE]);return e==null&&(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){t.shape!=null&&(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(t.style!=null){for(var e=["inherit","swimlane","indicated"],i=[mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_FONTCOLOR],n=0;n=0)return!0}return!1},mxCellRenderer.prototype.resolveColor=function(t,e,i){var n=i==mxConstants.STYLE_FONTCOLOR?t.text:t.shape;if(n!=null){var r=t.view.graph,s=n[e],l=null;if(s=="inherit"?l=r.model.getParent(t.cell):s=="swimlane"?(n[e]=i==mxConstants.STYLE_STROKECOLOR||i==mxConstants.STYLE_FONTCOLOR?"#000000":"#ffffff",r.model.getTerminal(t.cell,!1)!=null?l=r.model.getTerminal(t.cell,!1):l=t.cell,l=r.getSwimlane(l),i=r.swimlaneIndicatorColorAttribute):s=="indicated"&&t.shape!=null?n[e]=t.shape.indicatorColor:i!=mxConstants.STYLE_FILLCOLOR&&s==mxConstants.STYLE_FILLCOLOR&&t.shape!=null?n[e]=t.style[mxConstants.STYLE_FILLCOLOR]:i!=mxConstants.STYLE_STROKECOLOR&&s==mxConstants.STYLE_STROKECOLOR&&t.shape!=null&&(n[e]=t.style[mxConstants.STYLE_STROKECOLOR]),l!=null){var a=r.getView().getState(l);if(n[e]=null,a!=null){var o=i==mxConstants.STYLE_FONTCOLOR?a.text:a.shape;o!=null&&e!="indicatorColor"?n[e]=o[e]:n[e]=a.style[i]}}}},mxCellRenderer.prototype.getLabelValue=function(t){return t.view.graph.getLabel(t.cell)},mxCellRenderer.prototype.createLabel=function(t,e){var i=t.view.graph;if(i.getModel().isEdge(t.cell),t.style[mxConstants.STYLE_FONTSIZE]>0||t.style[mxConstants.STYLE_FONTSIZE]==null){var n=i.isHtmlLabel(t.cell)||e!=null&&mxUtils.isNode(e);t.text=new this.defaultTextShape(e,new mxRectangle,t.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,i.getVerticalAlign(t),t.style[mxConstants.STYLE_FONTCOLOR],t.style[mxConstants.STYLE_FONTFAMILY],t.style[mxConstants.STYLE_FONTSIZE],t.style[mxConstants.STYLE_FONTSTYLE],t.style[mxConstants.STYLE_SPACING],t.style[mxConstants.STYLE_SPACING_TOP],t.style[mxConstants.STYLE_SPACING_RIGHT],t.style[mxConstants.STYLE_SPACING_BOTTOM],t.style[mxConstants.STYLE_SPACING_LEFT],t.style[mxConstants.STYLE_HORIZONTAL],t.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],t.style[mxConstants.STYLE_LABEL_BORDERCOLOR],i.isWrapping(t.cell)&&i.isHtmlLabel(t.cell),i.isLabelClipped(t.cell),t.style[mxConstants.STYLE_OVERFLOW],t.style[mxConstants.STYLE_LABEL_PADDING],mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)),t.text.opacity=mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_OPACITY,100),t.text.dialect=n?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect,t.text.style=t.style,t.text.state=t,this.initializeLabel(t,t.text);var r=!1,s=function(l){var a=t;if(mxClient.IS_TOUCH||r){var o=mxEvent.getClientX(l),u=mxEvent.getClientY(l),p=mxUtils.convertPoint(i.container,o,u);a=i.view.getState(i.getCellAt(p.x,p.y))}return a};mxEvent.addGestureListeners(t.text.node,mxUtils.bind(this,function(l){this.isLabelEvent(t,l)&&(i.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(l,t)),r=i.dialect!=mxConstants.DIALECT_SVG&&mxEvent.getSource(l).nodeName=="IMG")}),mxUtils.bind(this,function(l){this.isLabelEvent(t,l)&&i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(l,s(l)))}),mxUtils.bind(this,function(l){this.isLabelEvent(t,l)&&(i.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(l,s(l))),r=!1)})),i.nativeDblClickEnabled&&mxEvent.addListener(t.text.node,"dblclick",mxUtils.bind(this,function(l){this.isLabelEvent(t,l)&&(i.dblClick(l,t.cell),mxEvent.consume(l))}))}},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,i=e.getCellOverlays(t.cell),n=null;if(i!=null){n=new mxDictionary;for(var r=0;r0)?this.createLabel(t,n):t.text!=null&&(n==null||n.length==0)&&(t.text.destroy(),t.text=null),t.text!=null){e&&(t.text.lastValue!=null&&this.isTextShapeInvalid(t,t.text)&&(t.text.lastValue=null),t.text.resetStyles(),t.text.apply(t),t.text.valign=i.getVerticalAlign(t));var u=this.getLabelBounds(t),p=this.getTextScale(t);if(this.resolveColor(t,"color",mxConstants.STYLE_FONTCOLOR),e||t.text.value!=n||t.text.isWrapping!=r||t.text.overflow!=o||t.text.isClipping!=s||t.text.scale!=p||t.text.dialect!=a||t.text.bounds==null||!t.text.bounds.equals(u)){t.text.dialect=a,t.text.value=n,t.text.bounds=u,t.text.scale=p,t.text.wrap=r,t.text.clipped=s,t.text.overflow=o;var m=t.text.node.style.visibility;this.redrawLabelShape(t.text),t.text.node.style.visibility=m}}},mxCellRenderer.prototype.isTextShapeInvalid=function(t,e){function i(n,r,s){var l=!1;return r=="spacingTop"||r=="spacingRight"||r=="spacingBottom"||r=="spacingLeft"?l=parseFloat(e[n])-parseFloat(e.spacing)!=(t.style[r]||s):l=e[n]!=(t.style[r]||s),l}return i("fontStyle",mxConstants.STYLE_FONTSTYLE,mxConstants.DEFAULT_FONTSTYLE)||i("family",mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)||i("size",mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)||i("color",mxConstants.STYLE_FONTCOLOR,"black")||i("align",mxConstants.STYLE_ALIGN,"")||i("valign",mxConstants.STYLE_VERTICAL_ALIGN,"")||i("spacing",mxConstants.STYLE_SPACING,2)||i("spacingTop",mxConstants.STYLE_SPACING_TOP,0)||i("spacingRight",mxConstants.STYLE_SPACING_RIGHT,0)||i("spacingBottom",mxConstants.STYLE_SPACING_BOTTOM,0)||i("spacingLeft",mxConstants.STYLE_SPACING_LEFT,0)||i("horizontal",mxConstants.STYLE_HORIZONTAL,!0)||i("background",mxConstants.STYLE_LABEL_BACKGROUNDCOLOR)||i("border",mxConstants.STYLE_LABEL_BORDERCOLOR)||i("opacity",mxConstants.STYLE_TEXT_OPACITY,100)||i("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=t.view.graph,i=t.view.scale,n=e.getModel().isEdge(t.cell),r=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y);if(n){var s=t.text.getSpacing();r.x+=s.x*i,r.y+=s.y*i;var l=e.getCellGeometry(t.cell);l!=null&&(r.width=Math.max(0,l.width*i),r.height=Math.max(0,l.height*i))}else{if(t.text.isPaintBoundsInverted()){var a=r.x;r.x=r.y,r.y=a}r.x+=t.x,r.y+=t.y,r.width=Math.max(1,t.width),r.height=Math.max(1,t.height)}if(t.text.isPaintBoundsInverted()){var o=(t.width-t.height)/2;r.x+=o,r.y-=o;var a=r.width;r.width=r.height,r.height=a}if(t.shape!=null){var u=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),p=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);u==mxConstants.ALIGN_CENTER&&p==mxConstants.ALIGN_MIDDLE&&(r=t.shape.getLabelBounds(r))}var m=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);return m!=null&&(r.width=parseFloat(m)*i),n||this.rotateLabelBounds(t,r),r},mxCellRenderer.prototype.rotateLabelBounds=function(t,e){if(e.y-=t.text.margin.y*e.height,e.x-=t.text.margin.x*e.width,!this.legacySpacing||t.style[mxConstants.STYLE_OVERFLOW]!="fill"&&t.style[mxConstants.STYLE_OVERFLOW]!="width"){var i=t.view.scale,n=t.text.getSpacing();e.x+=n.x*i,e.y+=n.y*i;var r=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),s=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),l=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);e.width=Math.max(0,e.width-(r==mxConstants.ALIGN_CENTER&&l==null?t.text.spacingLeft*i+t.text.spacingRight*i:0)),e.height=Math.max(0,e.height-(s==mxConstants.ALIGN_MIDDLE?t.text.spacingTop*i+t.text.spacingBottom*i:0))}var a=t.text.getTextRotation();if(a!=0&&t!=null&&t.view.graph.model.isVertex(t.cell)){var o=t.getCenterX(),u=t.getCenterY();if(e.x!=o||e.y!=u){var p=a*(Math.PI/180),m=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(p),Math.sin(p),new mxPoint(o,u));e.x=m.x,e.y=m.y}}},mxCellRenderer.prototype.redrawCellOverlays=function(t,e){if(this.createCellOverlays(t),t.overlays!=null){var i=mxUtils.mod(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),90),n=mxUtils.toRadians(i),r=Math.cos(n),s=Math.sin(n);t.overlays.visit(function(l,a){var o=a.overlay.getBounds(t);if(!t.view.graph.getModel().isEdge(t.cell)&&t.shape!=null&&i!=0){var u=o.getCenterX(),p=o.getCenterY(),m=mxUtils.getRotatedPoint(new mxPoint(u,p),r,s,new mxPoint(t.getCenterX(),t.getCenterY()));u=m.x,p=m.y,o.x=Math.round(u-o.width/2),o.y=Math.round(p-o.height/2)}(e||a.bounds==null||a.scale!=t.view.scale||!a.bounds.equals(o))&&(a.bounds=o,a.scale=t.view.scale,a.redraw())})}},mxCellRenderer.prototype.redrawControl=function(t,e){var i=t.view.graph.getFoldingImage(t);if(t.control!=null&&i!=null){var n=this.getControlBounds(t,i.width,i.height),r=this.legacyControlPosition?mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0):t.shape.getTextRotation(),s=t.view.scale;(e||t.control.scale!=s||!t.control.bounds.equals(n)||t.control.rotation!=r)&&(t.control.rotation=r,t.control.bounds=n,t.control.scale=s,t.control.redraw())}},mxCellRenderer.prototype.getControlBounds=function(t,e,i){if(t.control!=null){var n=t.view.scale,r=t.getCenterX(),s=t.getCenterY();if(!t.view.graph.getModel().isEdge(t.cell)&&(r=t.x+e*n,s=t.y+i*n,t.shape!=null)){var l=t.shape.getShapeRotation();if(this.legacyControlPosition)l=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0);else if(t.shape.isPaintBoundsInverted()){var a=(t.width-t.height)/2;r+=a,s-=a}if(l!=0){var o=mxUtils.toRadians(l),u=Math.cos(o),p=Math.sin(o),m=mxUtils.getRotatedPoint(new mxPoint(r,s),u,p,new mxPoint(t.getCenterX(),t.getCenterY()));r=m.x,s=m.y}}return t.view.graph.getModel().isEdge(t.cell)?new mxRectangle(Math.round(r-e/2*n),Math.round(s-i/2*n),Math.round(e*n),Math.round(i*n)):new mxRectangle(Math.round(r-e/2*n),Math.round(s-i/2*n),Math.round(e*n),Math.round(i*n))}return null},mxCellRenderer.prototype.insertStateAfter=function(t,e,i){for(var n=this.getShapesForState(t),r=0;r0)for(var o=0;o0?n[0]:null;u!=null&&(u=p.transformControlPoint(t,u),mxUtils.contains(e,u.x,u.y)&&(u=null));var d=0,x=0,f=0,g=0,c=mxUtils.getValue(t.style,mxConstants.STYLE_SEGMENT,m.gridSize)*p.scale,v=mxUtils.getValue(t.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);v==mxConstants.DIRECTION_NORTH||v==mxConstants.DIRECTION_SOUTH?(d=p.getRoutingCenterX(e),x=c):(f=p.getRoutingCenterY(e),g=c),u==null||u.xe.x+e.width?u!=null?(d=u.x,g=Math.max(Math.abs(f-u.y),g)):v==mxConstants.DIRECTION_NORTH?f=e.y-2*x:v==mxConstants.DIRECTION_SOUTH?f=e.y+e.height+2*x:v==mxConstants.DIRECTION_EAST?d=e.x-2*g:d=e.x+e.width+2*g:u!=null&&(d=p.getRoutingCenterX(e),x=Math.max(Math.abs(d-u.x),g),f=u.y,g=0),r.push(new mxPoint(d-x,f-g)),r.push(new mxPoint(d+x,f+g))}},ElbowConnector:function(t,e,i,n,r){var s=n!=null&&n.length>0?n[0]:null,l=!1,a=!1;if(e!=null&&i!=null)if(s!=null){var o=Math.min(e.x,i.x),u=Math.max(e.x+e.width,i.x+i.width),p=Math.min(e.y,i.y),m=Math.max(e.y+e.height,i.y+i.height);s=t.view.transformControlPoint(t,s),l=s.ym,a=s.xu}else{var o=Math.max(e.x,i.x),u=Math.min(e.x+e.width,i.x+i.width);if(l=o==u,!l){var p=Math.max(e.y,i.y),m=Math.min(e.y+e.height,i.y+i.height);a=p==m}}!a&&(l||t.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL)?mxEdgeStyle.TopToBottom(t,e,i,n,r):mxEdgeStyle.SideToSide(t,e,i,n,r)},SideToSide:function(t,e,i,n,r){var s=t.view,l=n!=null&&n.length>0?n[0]:null,a=t.absolutePoints,o=a[0],u=a[a.length-1];if(l!=null&&(l=s.transformControlPoint(t,l)),o!=null&&(e=new mxCellState,e.x=o.x,e.y=o.y),u!=null&&(i=new mxCellState,i.x=u.x,i.y=u.y),e!=null&&i!=null){var p=Math.max(e.x,i.x),m=Math.min(e.x+e.width,i.x+i.width),d=l!=null?l.x:Math.round(m+(p-m)/2),x=s.getRoutingCenterY(e),f=s.getRoutingCenterY(i);if(l!=null&&(l.y>=e.y&&l.y<=e.y+e.height&&(x=l.y),l.y>=i.y&&l.y<=i.y+i.height&&(f=l.y)),!mxUtils.contains(i,d,x)&&!mxUtils.contains(e,d,x)&&r.push(new mxPoint(d,x)),!mxUtils.contains(i,d,f)&&!mxUtils.contains(e,d,f)&&r.push(new mxPoint(d,f)),r.length==1)if(l!=null)!mxUtils.contains(i,d,l.y)&&!mxUtils.contains(e,d,l.y)&&r.push(new mxPoint(d,l.y));else{var g=Math.max(e.y,i.y),c=Math.min(e.y+e.height,i.y+i.height);r.push(new mxPoint(d,g+(c-g)/2))}}},TopToBottom:function(t,e,i,n,r){var s=t.view,l=n!=null&&n.length>0?n[0]:null,a=t.absolutePoints,o=a[0],u=a[a.length-1];if(l!=null&&(l=s.transformControlPoint(t,l)),o!=null&&(e=new mxCellState,e.x=o.x,e.y=o.y),u!=null&&(i=new mxCellState,i.x=u.x,i.y=u.y),e!=null&&i!=null){var p=Math.max(e.y,i.y),m=Math.min(e.y+e.height,i.y+i.height),d=s.getRoutingCenterX(e);l!=null&&l.x>=e.x&&l.x<=e.x+e.width&&(d=l.x);var x=l!=null?l.y:Math.round(m+(p-m)/2);if(!mxUtils.contains(i,d,x)&&!mxUtils.contains(e,d,x)&&r.push(new mxPoint(d,x)),l!=null&&l.x>=i.x&&l.x<=i.x+i.width?d=l.x:d=s.getRoutingCenterX(i),!mxUtils.contains(i,d,x)&&!mxUtils.contains(e,d,x)&&r.push(new mxPoint(d,x)),r.length==1)if(l!=null&&r.length==1)!mxUtils.contains(i,l.x,x)&&!mxUtils.contains(e,l.x,x)&&r.push(new mxPoint(l.x,x));else{var f=Math.max(e.x,i.x),g=Math.min(e.x+e.width,i.x+i.width);r.push(new mxPoint(f+(g-f)/2,x))}}},SegmentConnector:function(t,e,i,n,r){var s=mxEdgeStyle.scalePointArray(t.absolutePoints,t.view.scale),l=mxEdgeStyle.scaleCellState(e,t.view.scale),a=mxEdgeStyle.scaleCellState(i,t.view.scale),o=1,u=r.length>0?r[0]:null,p=!0,m=null;function d(R){return R.x=Math.round(R.x*t.view.scale*10)/10,R.y=Math.round(R.y*t.view.scale*10)/10,(u==null||Math.abs(u.x-R.x)>=o||Math.abs(u.y-R.y)>=Math.max(1,t.view.scale))&&(r.push(R),u=R),u}var x=s[0];x==null&&l!=null?x=new mxPoint(t.view.getRoutingCenterX(l),t.view.getRoutingCenterY(l)):x!=null&&(x=x.clone());var f=s.length-1;if(n!=null&&n.length>0){for(var g=[],c=0;c=T.y&&L.y<=T.y+T.height,P=T!=null&&L.x>=T.x&&L.x<=T.x+T.width;if(S=M||C==null&&I,E=A||C==null&&P,!(c==0&&(S&&E||A&&M))){if(C!=null&&!M&&!A&&(I||P)){p=!I;break}if(E||S){p=S,c==1&&(p=g.length%2==0?S:E);break}}T=a,C=s[f],C!=null&&(T=null),L=g[g.length-1],A&&M&&(g=g.slice(1))}p&&(s[0]!=null&&s[0].y!=m.y||s[0]==null&&l!=null&&(m.yl.y+l.height))?d(new mxPoint(x.x,m.y)):!p&&(s[0]!=null&&s[0].x!=m.x||s[0]==null&&l!=null&&(m.xl.x+l.width))&&d(new mxPoint(m.x,x.y)),p?x.y=m.y:x.x=m.x;for(var c=0;ca.y+a.height))?d(new mxPoint(x.x,m.y)):!p&&(s[f]!=null&&s[f].x!=m.x||s[f]==null&&a!=null&&(m.xa.x+a.width))&&d(new mxPoint(m.x,x.y))),s[0]==null&&l!=null)for(;r.length>1&&r[1]!=null&&mxUtils.contains(l,r[1].x,r[1].y);)r.splice(1,1);if(s[f]==null&&a!=null)for(;r.length>1&&r[r.length-1]!=null&&mxUtils.contains(a,r[r.length-1].x,r[r.length-1].y);)r.splice(r.length-1,1);y!=null&&r[r.length-1]!=null&&Math.abs(y.x-r[r.length-1].x)<=o&&Math.abs(y.y-r[r.length-1].y)<=o&&(r.splice(r.length-1,1),r[r.length-1]!=null&&(Math.abs(r[r.length-1].x-y.x)0||l||a){mxEdgeStyle.SegmentConnector(t,e,i,n,r);return}var M=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL],I=0;if(u!=null&&(M[0]=mxUtils.getPortConstraints(u,t,!0,mxConstants.DIRECTION_MASK_ALL),I=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION,0),I!=0)){var P=mxUtils.getBoundingBox(new mxRectangle(x,f,g,c),I);x=P.x,f=P.y,g=P.width,c=P.height}if(p!=null&&(M[1]=mxUtils.getPortConstraints(p,t,!1,mxConstants.DIRECTION_MASK_ALL),I=mxUtils.getValue(p.style,mxConstants.STYLE_ROTATION,0),I!=0)){var P=mxUtils.getBoundingBox(new mxRectangle(v,y,T,C),I);v=P.x,y=P.y,T=P.width,C=P.height}for(var R=[0,0],O=[[x,f,g,c],[v,y,T,C]],_=[S,E],b=0;b<2;b++)mxEdgeStyle.limits[b][1]=O[b][0]-_[b],mxEdgeStyle.limits[b][2]=O[b][1]-_[b],mxEdgeStyle.limits[b][4]=O[b][0]+O[b][2]+_[b],mxEdgeStyle.limits[b][8]=O[b][1]+O[b][3]+_[b];var k=O[0][0]+O[0][2]/2,G=O[0][1]+O[0][3]/2,B=O[1][0]+O[1][2]/2,j=O[1][1]+O[1][3]/2,H=k-B,W=G-j,X=0;H<0?W<0?X=2:X=1:W<=0&&(X=3,H==0&&(X=2));var V=null;u!=null&&(V=m);for(var Y=[[.5,.5],[.5,.5]],b=0;b<2;b++)V!=null&&(Y[b][0]=(V.x-O[b][0])/O[b][2],Math.abs(V.x-O[b][0])<=1?R[b]=mxConstants.DIRECTION_MASK_WEST:Math.abs(V.x-O[b][0]-O[b][2])<=1&&(R[b]=mxConstants.DIRECTION_MASK_EAST),Y[b][1]=(V.y-O[b][1])/O[b][3],Math.abs(V.y-O[b][1])<=1?R[b]=mxConstants.DIRECTION_MASK_NORTH:Math.abs(V.y-O[b][1]-O[b][3])<=1&&(R[b]=mxConstants.DIRECTION_MASK_SOUTH)),V=null,p!=null&&(V=d);var et=O[0][1]-(O[1][1]+O[1][3]),q=O[0][0]-(O[1][0]+O[1][2]),K=O[1][1]-(O[0][1]+O[0][3]),Z=O[1][0]-(O[0][0]+O[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(q-L,0),mxEdgeStyle.vertexSeperations[2]=Math.max(et-L,0),mxEdgeStyle.vertexSeperations[4]=Math.max(K-L,0),mxEdgeStyle.vertexSeperations[3]=Math.max(Z-L,0);var N=[],D=[],F=[];D[0]=q>=Z?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST,F[0]=et>=K?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH,D[1]=mxUtils.reversePortConstraints(D[0]),F[1]=mxUtils.reversePortConstraints(F[0]);for(var st=q>=Z?q:Z,J=et>=K?et:K,U=[[0,0],[0,0]],$=!1,b=0;b<2;b++)R[b]==0&&(D[b]&M[b]||(D[b]=mxUtils.reversePortConstraints(D[b])),F[b]&M[b]||(F[b]=mxUtils.reversePortConstraints(F[b])),U[b][0]=F[b],U[b][1]=D[b]);J>0&&st>0&&((D[0]&M[0])>0&&(F[1]&M[1])>0?(U[0][0]=D[0],U[0][1]=F[0],U[1][0]=F[1],U[1][1]=D[1],$=!0):(F[0]&M[0])>0&&(D[1]&M[1])>0&&(U[0][0]=F[0],U[0][1]=D[0],U[1][0]=D[1],U[1][1]=F[1],$=!0)),J>0&&!$&&(U[0][0]=F[0],U[0][1]=D[0],U[1][0]=F[1],U[1][1]=D[1],$=!0),st>0&&!$&&(U[0][0]=D[0],U[0][1]=F[0],U[1][0]=D[1],U[1][1]=F[1],$=!0);for(var b=0;b<2;b++)R[b]==0&&(U[b][0]&M[b]||(U[b][0]=U[b][1]),N[b]=U[b][0]&M[b],N[b]|=(U[b][1]&M[b])<<8,N[b]|=(U[1-b][b]&M[b])<<16,N[b]|=(U[1-b][1-b]&M[b])<<24,N[b]&15||(N[b]=N[b]<<8),N[b]&3840||(N[b]=N[b]&15|N[b]>>8),N[b]&983040||(N[b]=N[b]&65535|(N[b]&251658240)>>8),R[b]=N[b]&15,(M[b]==mxConstants.DIRECTION_MASK_WEST||M[b]==mxConstants.DIRECTION_MASK_NORTH||M[b]==mxConstants.DIRECTION_MASK_EAST||M[b]==mxConstants.DIRECTION_MASK_SOUTH)&&(R[b]=M[b]));var rt=R[0]==mxConstants.DIRECTION_MASK_EAST?3:R[0],tt=R[1]==mxConstants.DIRECTION_MASK_EAST?3:R[1];rt-=X,tt-=X,rt<1&&(rt+=4),tt<1&&(tt+=4);var Q=mxEdgeStyle.routePatterns[rt-1][tt-1];switch(mxEdgeStyle.wayPoints1[0][0]=O[0][0],mxEdgeStyle.wayPoints1[0][1]=O[0][1],R[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=S,mxEdgeStyle.wayPoints1[0][1]+=Y[0][1]*O[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=Y[0][0]*O[0][2],mxEdgeStyle.wayPoints1[0][1]+=O[0][3]+S;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=O[0][2]+S,mxEdgeStyle.wayPoints1[0][1]+=Y[0][1]*O[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=Y[0][0]*O[0][2],mxEdgeStyle.wayPoints1[0][1]-=S;break}for(var z=0,ut=(R[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1,mt=ut,it=0,b=0;b4&&(lt-=4);var ht=mxEdgeStyle.dirVectors[lt-1];it=lt%2>0?0:1,it!=ut&&(z++,mxEdgeStyle.wayPoints1[z][0]=mxEdgeStyle.wayPoints1[z-1][0],mxEdgeStyle.wayPoints1[z][1]=mxEdgeStyle.wayPoints1[z-1][1]);var vt=(Q[b]&mxEdgeStyle.TARGET_MASK)>0,ft=(Q[b]&mxEdgeStyle.SOURCE_MASK)>0,at=(Q[b]&mxEdgeStyle.SIDE_MASK)>>5;at=at<15&&(at=at>>4);var dt=(Q[b]&mxEdgeStyle.CENTER_MASK)>0;if((ft||vt)&&at<9){var pt=0,ot=ft?0:1;if(dt&&it==0?pt=O[ot][0]+Y[ot][0]*O[ot][2]:dt?pt=O[ot][1]+Y[ot][1]*O[ot][3]:pt=mxEdgeStyle.limits[ot][at],it==0){var yt=mxEdgeStyle.wayPoints1[z][0],gt=(pt-yt)*ht[0];gt>0&&(mxEdgeStyle.wayPoints1[z][0]+=ht[0]*gt)}else{var Ct=mxEdgeStyle.wayPoints1[z][1],ct=(pt-Ct)*ht[1];ct>0&&(mxEdgeStyle.wayPoints1[z][1]+=ht[1]*ct)}}else dt&&(mxEdgeStyle.wayPoints1[z][0]+=ht[0]*Math.abs(mxEdgeStyle.vertexSeperations[lt]/2),mxEdgeStyle.wayPoints1[z][1]+=ht[1]*Math.abs(mxEdgeStyle.vertexSeperations[lt]/2));z>0&&mxEdgeStyle.wayPoints1[z][it]==mxEdgeStyle.wayPoints1[z-1][it]?z--:ut=it}for(var b=0;b<=z;b++){if(b==z){var Et=(R[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1,St=Et==mt?0:1;if(St!=(z+1)%2)break}r.push(new mxPoint(Math.round(mxEdgeStyle.wayPoints1[b][0]*t.view.scale*10)/10,Math.round(mxEdgeStyle.wayPoints1[b][1]*t.view.scale*10)/10))}for(var nt=1;nt0){for(var i=this.graph.getModel(),n=0;n0||l.height>0){r=new mxPoint(e.x,e.y);var a=!1,o=!1;this.graph.model.isVertex(t.cell)&&(a=mxUtils.getValue(t.style,mxConstants.STYLE_FLIPH,0)==1,o=mxUtils.getValue(t.style,mxConstants.STYLE_FLIPV,0)==1,t.shape!=null&&t.shape.stencil!=null&&(a=mxUtils.getValue(t.style,"stencilFlipH",0)==1||a,o=mxUtils.getValue(t.style,"stencilFlipV",0)==1||o),a&&(r.x=2*l.getCenterX()-r.x),o&&(r.y=2*l.getCenterY()-r.y)),r=s(l,t,r,i),r!=null&&(a&&(r.x=2*l.getCenterX()-r.x),o&&(r.y=2*l.getCenterY()-r.y))}}r==null&&(r=this.getPoint(t))}return r},mxGraphView.prototype.getRoutingCenterX=function(t){var e=t.style!=null&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_X])||0;return t.getCenterX()+e*t.width},mxGraphView.prototype.getRoutingCenterY=function(t){var e=t.style!=null&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0;return t.getCenterY()+e*t.height},mxGraphView.prototype.getPerimeterBounds=function(t,e){return e=e??0,t!=null&&(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];if(typeof e=="string"){var i=mxStyleRegistry.getValue(e);i==null&&this.isAllowEval()&&(i=mxUtils.eval(e)),e=i}return typeof e=="function"?e:null},mxGraphView.prototype.getNextPoint=function(t,e,i){var n=t.absolutePoints,r=null;if(n!=null&&n.length>=2){var s=n.length;r=n[i?Math.min(1,s-1):Math.max(0,s-2)]}return r==null&&e!=null&&(r=new mxPoint(e.getCenterX(),e.getCenterY())),r},mxGraphView.prototype.getVisibleTerminal=function(t,e){for(var i=this.graph.getModel(),n=i.getTerminal(t,e),r=n;n!=null&&n!=this.currentRoot;)(!this.graph.isCellVisible(r)||this.isCellCollapsed(n))&&(r=n),n=i.getParent(n);return r!=null&&(!i.contains(r)||i.getParent(r)==i.getRoot()||r==this.currentRoot)&&(r=null),r},mxGraphView.prototype.updateEdgeBounds=function(t){var e=t.absolutePoints,i=e[0],n=e[e.length-1];if(i.x!=n.x||i.y!=n.y){var r=n.x-i.x,s=n.y-i.y;t.terminalDistance=Math.sqrt(r*r+s*s)}else t.terminalDistance=0;var l=0,a=[],o=i;if(o!=null){for(var u=o.x,p=o.y,m=u,d=p,x=1;x=Math.round(o+a)&&u1){for(var l=t.length,a=t.segments,o=t.absolutePoints[0],u=t.absolutePoints[1],p=mxUtils.ptSegDistSq(o.x,o.y,u.x,u.y,e,i),m=0,d=0,x=0,f=2;fc&&(P=c);var R=Math.sqrt(mxUtils.ptSegDistSq(o.x,o.y,u.x,u.y,e,i)),O=mxUtils.relativeCcw(o.x,o.y,u.x,u.y,e,i);return O==-1&&(R=-R),new mxPoint((l/2-x-P)/l*-2,R/this.scale)}}return new mxPoint},mxGraphView.prototype.updateEdgeLabelOffset=function(t){var e=t.absolutePoints;if(t.absoluteOffset.x=t.getCenterX(),t.absoluteOffset.y=t.getCenterY(),e!=null&&e.length>0&&t.segments!=null){var i=this.graph.getCellGeometry(t.cell);if(i.relative){var n=this.getPoint(t,i);n!=null&&(t.absoluteOffset=n)}else{var r=e[0],s=e[e.length-1];if(r!=null&&s!=null){var l=s.x-r.x,a=s.y-r.y,o=0,u=0,p=i.offset;p!=null&&(o=p.x,u=p.y);var m=r.x+l/2+o*this.scale,d=r.y+a/2+u*this.scale;t.absoluteOffset.x=m,t.absoluteOffset.y=d}}}},mxGraphView.prototype.getState=function(t,e){e=e||!1;var i=null;return t!=null&&(i=this.states.get(t),e&&(i==null||this.updateStyle)&&this.graph.isCellVisible(t)&&(i==null?(i=this.createState(t),this.states.put(t,i)):i.style=this.graph.getCellStyle(t))),i},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(t==null)return this.states;for(var e=[],i=0;ir&&i.x>r+2&&i.x<=n)return!0;var s=this.graph.container.offsetHeight,l=this.graph.container.clientHeight;return s>l&&i.y>l+2&&i.y<=s},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 t=this.graph,e=t.container;if(e!=null){mxClient.IS_TOUCH&&(mxEvent.addListener(e,"gesturestart",mxUtils.bind(this,function(r){t.fireGestureEvent(r),mxEvent.consume(r)})),mxEvent.addListener(e,"gesturechange",mxUtils.bind(this,function(r){t.fireGestureEvent(r),mxEvent.consume(r)})),mxEvent.addListener(e,"gestureend",mxUtils.bind(this,function(r){t.fireGestureEvent(r),mxEvent.consume(r)})));var i=null;mxEvent.addGestureListeners(e,mxUtils.bind(this,function(r){this.isContainerEvent(r)&&(!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_GC&&!mxClient.IS_OP&&!mxClient.IS_SF||!this.isScrollEvent(r))&&(t.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(r)),i=r.pointerId)}),mxUtils.bind(this,function(r){this.isContainerEvent(r)&&(i==null||r.pointerId==i)&&t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(r))}),mxUtils.bind(this,function(r){this.isContainerEvent(r)&&t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(r)),i=null})),mxEvent.addListener(e,"dblclick",mxUtils.bind(this,function(r){this.isContainerEvent(r)&&t.dblClick(r)}));var n=function(r){var s=null;if(mxClient.IS_TOUCH){var l=mxEvent.getClientX(r),a=mxEvent.getClientY(r),o=mxUtils.convertPoint(e,l,a);s=t.view.getState(t.getCellAt(o.x,o.y))}return s};t.addMouseListener({mouseDown:function(r,s){t.popupMenuHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,function(r){t.tooltipHandler!=null&&t.tooltipHandler.isHideOnHover()&&t.tooltipHandler.hide(),this.captureDocumentGesture&&t.isMouseDown&&t.container!=null&&!this.isContainerEvent(r)&&t.container.style.display!="none"&&t.container.style.visibility!="hidden"&&!mxEvent.isConsumed(r)&&t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(r,n(r)))}),this.endHandler=mxUtils.bind(this,function(r){this.captureDocumentGesture&&t.isMouseDown&&t.container!=null&&!this.isContainerEvent(r)&&t.container.style.display!="none"&&t.container.style.visibility!="hidden"&&t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(r))}),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler)}},mxGraphView.prototype.createHtml=function(){var t=this.graph.container;if(t!=null&&(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)){var e=mxUtils.bind(this,function(i){var n=this.getGraphBounds(),r=n.x+n.width+this.graph.border,s=n.y+n.height+this.graph.border;this.updateHtmlCanvasSize(r,s)});mxEvent.addListener(window,"resize",e)}},mxGraphView.prototype.updateHtmlCanvasSize=function(t,e){if(this.graph.container!=null){var i=this.graph.container.offsetWidth,n=this.graph.container.offsetHeight;i")},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,n=[],r=mxUtils.bind(this,function(o){if(!i.get(o)&&this.model.contains(o))if(this.model.isEdge(o)||this.model.isVertex(o))i.put(o,!0),n.push(o);else for(var u=this.model.getChildCount(o),p=0;p=0){t.overlays.splice(i,1),t.overlays.length==0&&(t.overlays=null);var n=this.view.getState(t);n!=null&&this.cellRenderer.redraw(n),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",t,"overlay",e))}else e=null}return e},mxGraph.prototype.removeCellOverlays=function(t){var e=t.overlays;if(e!=null){t.overlays=null;var i=this.view.getState(t);i!=null&&this.cellRenderer.redraw(i);for(var n=0;n0){i=i??this.warningImage;var r=new mxCellOverlay(i,""+e+"");return n&&r.addListener(mxEvent.CLICK,mxUtils.bind(this,function(s,l){this.isEnabled()&&this.setSelectionCell(t)})),this.addCellOverlay(t,r)}else this.removeCellOverlays(t);return null},mxGraph.prototype.startEditing=function(t){this.startEditingAtCell(null,t)},mxGraph.prototype.startEditingAtCell=function(t,e){(e==null||!mxEvent.isMultiTouchEvent(e))&&(t==null&&(t=this.getSelectionCell(),t!=null&&!this.isCellEditable(t)&&(t=null)),t!=null&&(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,i){this.model.beginUpdate();try{var n=t.value;this.cellLabelChanged(t,e,this.isAutoSizeCell(t)),this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",t,"value",e,"old",n,"event",i))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellLabelChanged=function(t,e,i){this.model.beginUpdate();try{this.model.setValue(t,e),i&&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 e=t.getEvent(),i=t.getCell(),n=new mxEventObject(mxEvent.CLICK,"event",e,"cell",i);if(t.isConsumed()&&n.consume(),this.fireEvent(n),this.isEnabled()&&!mxEvent.isConsumed(e)&&!n.isConsumed()){if(i!=null){if(this.isTransparentClickEvent(e)){var r=!1,s=this.getCellAt(t.graphX,t.graphY,null,null,null,mxUtils.bind(this,function(p){var m=this.isCellSelected(p.cell);return r=r||m,!r||m||p.cell!=i&&this.model.isAncestor(p.cell,i)}));s!=null&&(i=s)}}else if(this.isSwimlaneSelectionEnabled()&&(i=this.getSwimlaneAt(t.getGraphX(),t.getGraphY()),i!=null&&(!this.isToggleEvent(e)||!mxEvent.isAltDown(e)))){for(var l=i,a=[];l!=null;){l=this.model.getParent(l);var o=this.view.getState(l);this.isSwimlane(l)&&o!=null&&a.push(l)}if(a.length>0){a=a.reverse(),a.splice(0,0,i),a.push(i);for(var u=0;u=r.scrollLeft&&e>=r.scrollTop&&t<=r.scrollLeft+r.clientWidth&&e<=r.scrollTop+r.clientHeight){var s=r.scrollLeft+r.clientWidth-t;if(s0&&p.height>0){e&&p.x!=null&&p.y!=null&&(p=p.clone(),p.width+=p.x,p.height+=p.y,p.x=0,p.y=0);var m=this.view.scale,d=p.width/m,x=p.height/m;this.backgroundImage!=null&&(d=Math.max(d,this.backgroundImage.width-p.x/m),x=Math.max(x,this.backgroundImage.height-p.y/m));var f=(e?t:2*t)+i+1;o-=f,u-=f;var g=r?u/x:s?o/d:Math.min(o/d,u/x);if(this.minFitScale!=null&&(g=Math.max(g,this.minFitScale)),this.maxFitScale!=null&&(g=Math.min(g,this.maxFitScale)),n)if(e)this.view.scale!=g&&this.view.setScale(g);else if(mxUtils.hasScrollbars(this.container)){this.view.setScale(g);var y=this.getGraphBounds();y.x!=null&&(this.container.scrollLeft=y.x),y.y!=null&&(this.container.scrollTop=y.y)}else{var c=p.x!=null?Math.floor(this.view.translate.x-p.x/m+t/g+i/2):t,v=p.y!=null?Math.floor(this.view.translate.y-p.y/m+t/g+i/2):t;this.view.scaleAndTranslate(g,c,v)}else return g}}return this.view.scale},mxGraph.prototype.sizeDidChange=function(){var t=this.getGraphBounds();if(this.container!=null){var e=this.getBorder(),i=Math.max(0,t.x)+t.width+2*e,n=Math.max(0,t.y)+t.height+2*e;if(this.minimumContainerSize!=null&&(i=Math.max(i,this.minimumContainerSize.width),n=Math.max(n,this.minimumContainerSize.height)),this.resizeContainer&&this.doResizeContainer(i,n),this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var r=this.getPreferredPageSize(t,Math.max(1,i),Math.max(1,n));r!=null&&(i=r.width*this.view.scale,n=r.height*this.view.scale)}if(this.minimumGraphSize!=null&&(i=Math.max(i,this.minimumGraphSize.width*this.view.scale),n=Math.max(n,this.minimumGraphSize.height*this.view.scale)),i=Math.ceil(i),n=Math.ceil(n),this.dialect==mxConstants.DIALECT_SVG){var s=this.view.getDrawPane().ownerSVGElement;s!=null&&(s.style.minWidth=Math.max(1,i)+"px",s.style.minHeight=Math.max(1,n)+"px",s.style.width="100%",s.style.height="100%")}else mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,i),Math.max(1,n)):(this.view.canvas.style.minWidth=Math.max(1,i)+"px",this.view.canvas.style.minHeight=Math.max(1,n)+"px");this.updatePageBreaks(this.pageBreaksVisible,i,n)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",t))},mxGraph.prototype.doResizeContainer=function(t,e){this.maximumContainerSize!=null&&(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,i){var n=this.view.scale,r=this.view.translate,s=this.pageFormat,l=n*this.pageScale,a=new mxRectangle(0,0,s.width*l,s.height*l),o=mxRectangle.fromRectangle(this.getGraphBounds());o.width=Math.max(1,o.width),o.height=Math.max(1,o.height),a.x=Math.floor((o.x-r.x*n)/a.width)*a.width+r.x*n,a.y=Math.floor((o.y-r.y*n)/a.height)*a.height+r.y*n,o.width=Math.ceil((o.width+(o.x-a.x))/a.width)*a.width,o.height=Math.ceil((o.height+(o.y-a.y))/a.height)*a.height,t=t&&Math.min(a.width,a.height)>this.minPageBreakDist;var u=t?Math.ceil(o.height/a.height)+1:0,p=t?Math.ceil(o.width/a.width)+1:0,m=(p-1)*a.width,d=(u-1)*a.height;this.horizontalPageBreaks==null&&u>0&&(this.horizontalPageBreaks=[]),this.verticalPageBreaks==null&&p>0&&(this.verticalPageBreaks=[]);var x=mxUtils.bind(this,function(f){if(f!=null){for(var g=f==this.horizontalPageBreaks?u:p,c=0;c<=g;c++){var v=f==this.horizontalPageBreaks?[new mxPoint(Math.round(a.x),Math.round(a.y+c*a.height)),new mxPoint(Math.round(a.x+m),Math.round(a.y+c*a.height))]:[new mxPoint(Math.round(a.x+c*a.width),Math.round(a.y)),new mxPoint(Math.round(a.x+c*a.width),Math.round(a.y+d))];if(f[c]!=null)f[c].points=v,f[c].redraw();else{var y=new mxPolyline(v,this.pageBreakColor);y.dialect=this.dialect,y.pointerEvents=!1,y.isDashed=this.pageBreakDashed,y.init(this.view.backgroundPane),y.redraw(),f[c]=y}}for(var c=g;c0&&i.substring(n-7,n+1)!=";base64,"&&(i=i.substring(0,n)+";base64,"+i.substring(n+1))}t[mxConstants.STYLE_IMAGE]=i}}return t},mxGraph.prototype.setCellStyle=function(t,e){if(e=e||this.getSelectionCells(),e!=null){this.model.beginUpdate();try{for(var i=0;i0){var r=this.getCurrentCellStyle(i[0]);n=mxUtils.getValue(r,t,e)?0:1,this.setCellStyles(t,n,i)}return n},mxGraph.prototype.setCellStyles=function(t,e,i){i=i||this.getSelectionCells(),mxUtils.setCellStyles(this.model,i,t,e)},mxGraph.prototype.toggleCellStyleFlags=function(t,e,i){this.setCellStyleFlags(t,e,null,i)},mxGraph.prototype.setCellStyleFlags=function(t,e,i,n){if(n=n||this.getSelectionCells(),n!=null&&n.length>0){if(i==null){var r=this.getCurrentCellStyle(n[0]),s=parseInt(r[t]||0);i=(s&e)!=e}mxUtils.setCellStyleFlags(this.model,n,t,e,i)}},mxGraph.prototype.alignCells=function(t,e,i){if(e==null&&(e=this.getSelectionCells()),e!=null&&e.length>1){if(i==null)for(var n=0;n1&&n!=null){var r=this.model.getParent(t);r==null&&(r=this.model.getParent(i[0])),this.model.beginUpdate();try{this.getCellGeometry(t)==null&&this.model.setGeometry(t,new mxGeometry);var s=this.model.getChildCount(r);this.cellsAdded([t],r,s,null,null,!1,!1,!1),s=this.model.getChildCount(t),this.cellsAdded(i,t,s,null,null,!1,!1,!1),this.cellsMoved(i,-n.x,-n.y,!1,!1,!1),this.cellsResized([t],[n],!1),this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",t,"border",e,"cells",i))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.getCellsForGroup=function(t){var e=[];if(t!=null&&t.length>0){var i=this.model.getParent(t[0]);e.push(t[0]);for(var n=1;n0){this.model.beginUpdate();try{for(var i=0;i0){n=n.slice();var r=this.model.getParent(t[i]),s=this.model.getChildCount(r);this.cellsAdded(n,r,s,null,null,!0),e=e.concat(n);for(var l=0;l0&&e.push(t[i]);return e},mxGraph.prototype.removeCellsAfterUngroup=function(t){this.cellsRemoved(this.addAllEdges(t))},mxGraph.prototype.removeCellsFromParent=function(t){t==null&&(t=this.getSelectionCells()),this.model.beginUpdate();try{var e=this.getDefaultParent(),i=this.model.getChildCount(e);this.cellsAdded(t,e,i,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,i,n,r,s,l){t==null&&(t=this.getSelectionCells()),e=e??0,i=i??!1,n=n??0,r=r??0,s=s??0,l=l??0,this.model.beginUpdate();try{for(var a=t.length-1;a>=0;a--){var o=this.getCellGeometry(t[a]);if(o!=null){var u=this.getChildCells(t[a]);if(u!=null&&u.length>0){var p=this.getBoundingBoxFromGeometry(u,!0);if(p!=null&&p.width>0&&p.height>0){var m=this.isSwimlane(t[a])?this.getActualStartSize(t[a],!0):new mxRectangle;o=o.clone(),i&&(o.x=Math.round(o.x+p.x-e-m.x-l),o.y=Math.round(o.y+p.y-e-m.y-n)),o.width=Math.round(p.width+2*e+m.x+l+r+m.width),o.height=Math.round(p.height+2*e+m.y+n+s+m.height),this.model.setGeometry(t[a],o),this.moveCells(u,e+m.x-p.x+l,e+m.y-p.y+n)}}}}}finally{this.model.endUpdate()}return t},mxGraph.prototype.getBoundingBox=function(t){var e=null;if(t!=null&&t.length>0){for(var i=0;i0){var o=this.view.scale,u=this.view.translate;r=this.model.cloneCells(t,!0,i);for(var a=0;athis.model.getChildCount(e)&&i--,this.model.add(e,t[m],i+m),this.autoSizeCellsOnAdd&&this.autoSizeCell(t[m],!0),(a==null||a)&&this.isExtendParentsOnAdd(t[m])&&this.isExtendParent(t[m])&&this.extendParent(t[m]),(l==null||l)&&this.constrainChild(t[m]),n!=null&&this.cellConnected(t[m],n,!0),r!=null&&this.cellConnected(t[m],r,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",t,"parent",e,"index",i,"source",n,"target",r,"absolute",s))}finally{this.model.endUpdate()}}},mxGraph.prototype.autoSizeCell=function(t,e){if(e=e??!0,e)for(var i=this.model.getChildCount(t),n=0;n0){var e=this.view.scale,i=this.view.translate;this.model.beginUpdate();try{for(var n=new mxDictionary,r=0;r0){this.model.beginUpdate();try{for(var i=0;i0){this.model.beginUpdate();try{for(var r=0;r0&&(r.height=Math.max(r.height,l))}}e.alternateBounds=new mxRectangle(0,0,r.width,r.height)}if(e.alternateBounds!=null){e.alternateBounds.x=e.x,e.alternateBounds.y=e.y;var a=mxUtils.toRadians(n[mxConstants.STYLE_ROTATION]||0);if(a!=0){var o=e.alternateBounds.getCenterX()-e.getCenterX(),u=e.alternateBounds.getCenterY()-e.getCenterY(),p=Math.cos(a),m=Math.sin(a),d=p*o-m*u,x=m*o+p*u;e.alternateBounds.x+=d-o,e.alternateBounds.y+=x-u}}}},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(t!=null)for(var i=0;i0){this.isHtmlLabel(n.cell)||(u=mxUtils.htmlEntities(u,!1)),u=u.replace(/\n/g,"
");var p=mxUtils.getSizeForString(u,s,r[mxConstants.STYLE_FONTFAMILY],e,r[mxConstants.STYLE_FONTSTYLE]),m=p.width+l,d=p.height+a;if(!mxUtils.getValue(r,mxConstants.STYLE_HORIZONTAL,!0)){var x=d;d=m,m=x}this.gridEnabled&&(m=this.snap(m+this.gridSize/2),d=this.snap(d+this.gridSize/2)),i=new mxRectangle(0,0,m,d)}else{var f=4*this.gridSize;i=new mxRectangle(0,0,f,f)}}}return i},mxGraph.prototype.resizeCell=function(t,e,i){return this.resizeCells([t],[e],i)[0]},mxGraph.prototype.resizeCells=function(t,e,i){i=i??this.isRecursiveResize(),this.model.beginUpdate();try{var n=this.cellsResized(t,e,i);this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",t,"bounds",e,"previous",n))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsResized=function(t,e,i){i=i??!1;var n=[];if(t!=null&&e!=null&&t.length==e.length){this.model.beginUpdate();try{for(var r=0;r0&&(l=mxRectangle.fromRectangle(l),l.x-=l.width*a,l.y-=l.height*a,l.width+=2*l.width*a,l.height+=2*l.height*a),r==null?r=l:(r=mxRectangle.fromRectangle(r),r.intersect(l))}}if(r!=null){var o=[t];if(!this.isCellCollapsed(t))for(var u=this.model.getDescendants(t),p=0;pr.width&&(d=i.width-r.width,i.width-=d),m.x+m.width>r.x+r.width&&(d-=m.x+m.width-r.x-r.width-d);var x=0;i.height>r.height&&(x=i.height-r.height,i.height-=x),m.y+m.height>r.y+r.height&&(x-=m.y+m.height-r.y-r.height-x),m.x0&&(e=e.clone(),e.points=[],this.model.setGeometry(t,e)),t},mxGraph.prototype.getOutlineConstraint=function(t,e,i){if(e.shape!=null){var n=this.view.getPerimeterBounds(e),r=e.style[mxConstants.STYLE_DIRECTION];if(r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH){n.x+=n.width/2-n.height/2,n.y+=n.height/2-n.width/2;var s=n.width;n.width=n.height,n.height=s}var l=mxUtils.toRadians(e.shape.getShapeRotation());if(l!=0){var a=Math.cos(-l),o=Math.sin(-l),u=new mxPoint(n.getCenterX(),n.getCenterY());t=mxUtils.getRotatedPoint(t,a,o,u)}var p=1,m=1,d=0,x=0;if(this.getModel().isVertex(e.cell)){var f=e.style[mxConstants.STYLE_FLIPH],g=e.style[mxConstants.STYLE_FLIPV];if(e.shape!=null&&e.shape.stencil!=null&&(f=mxUtils.getValue(e.style,"stencilFlipH",0)==1||f,g=mxUtils.getValue(e.style,"stencilFlipV",0)==1||g),r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH){var s=f;f=g,g=s}f&&(p=-1,d=-n.width),g&&(m=-1,x=-n.height)}t=new mxPoint((t.x-n.x)*p-d+n.x,(t.y-n.y)*m-x+n.y);var c=n.width==0?0:Math.round((t.x-n.x)*1e3/n.width)/1e3,v=n.height==0?0:Math.round((t.y-n.y)*1e3/n.height)/1e3;return new mxConnectionConstraint(new mxPoint(c,v),!1)}return null},mxGraph.prototype.getAllConnectionConstraints=function(t,e){return t!=null&&t.shape!=null&&t.shape.stencil!=null?t.shape.stencil.constraints:null},mxGraph.prototype.getConnectionConstraint=function(t,e,i){var n=null,r=t.style[i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(r!=null){var s=t.style[i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];s!=null&&(n=new mxPoint(parseFloat(r),parseFloat(s)))}var l=!1,a=0,o=0;return n!=null&&(l=mxUtils.getValue(t.style,i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0),a=parseFloat(t.style[i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX]),o=parseFloat(t.style[i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY]),a=isFinite(a)?a:0,o=isFinite(o)?o:0),new mxConnectionConstraint(n,l,null,a,o)},mxGraph.prototype.setConnectionConstraint=function(t,e,i,n){if(n!=null){this.model.beginUpdate();try{n==null||n.point==null?(this.setCellStyles(i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,null,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t])):n.point!=null&&(this.setCellStyles(i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,n.point.x,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,n.point.y,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,n.dx,[t]),this.setCellStyles(i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,n.dy,[t]),n.perimeter?this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t]):this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[t]))}finally{this.model.endUpdate()}}},mxGraph.prototype.getConnectionPoint=function(t,e,i){i=i??!0;var n=null;if(t!=null&&e.point!=null){var r=this.view.getPerimeterBounds(t),s=new mxPoint(r.getCenterX(),r.getCenterY()),l=t.style[mxConstants.STYLE_DIRECTION],a=0;l!=null&&mxUtils.getValue(t.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)==1&&(l==mxConstants.DIRECTION_NORTH?a+=270:l==mxConstants.DIRECTION_WEST?a+=180:l==mxConstants.DIRECTION_SOUTH&&(a+=90),(l==mxConstants.DIRECTION_NORTH||l==mxConstants.DIRECTION_SOUTH)&&r.rotate90());var o=this.view.scale;n=new mxPoint(r.x+e.point.x*r.width+e.dx*o,r.y+e.point.y*r.height+e.dy*o);var u=t.style[mxConstants.STYLE_ROTATION]||0;if(e.perimeter){if(a!=0){var p=0,m=0;a==90?m=1:a==180?p=-1:a==270&&(m=-1),n=mxUtils.getRotatedPoint(n,p,m,s)}n=this.view.getPerimeterPoint(t,n,!1)}else if(u+=a,this.getModel().isVertex(t.cell)){var d=t.style[mxConstants.STYLE_FLIPH]==1,x=t.style[mxConstants.STYLE_FLIPV]==1;if(t.shape!=null&&t.shape.stencil!=null&&(d=mxUtils.getValue(t.style,"stencilFlipH",0)==1||d,x=mxUtils.getValue(t.style,"stencilFlipV",0)==1||x),l==mxConstants.DIRECTION_NORTH||l==mxConstants.DIRECTION_SOUTH){var f=d;d=x,x=f}d&&(n.x=2*r.getCenterX()-n.x),x&&(n.y=2*r.getCenterY()-n.y)}if(u!=0&&n!=null){var g=mxUtils.toRadians(u),p=Math.cos(g),m=Math.sin(g);n=mxUtils.getRotatedPoint(n,p,m,s)}}return i&&n!=null&&(n.x=Math.round(n.x),n.y=Math.round(n.y)),n},mxGraph.prototype.connectCell=function(t,e,i,n){this.model.beginUpdate();try{var r=this.model.getTerminal(t,i);this.cellConnected(t,e,i,n),this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",t,"terminal",e,"source",i,"previous",r))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellConnected=function(t,e,i,n){if(t!=null){this.model.beginUpdate();try{var r=this.model.getTerminal(t,i);if(this.setConnectionConstraint(t,e,i,n),this.isPortsEnabled()){var s=null;this.isPort(e)&&(s=e.getId(),e=this.getTerminalForPort(e,i));var l=i?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT;this.setCellStyles(l,s,[t])}this.model.setTerminal(t,e,i),this.resetEdgesOnConnect&&this.resetEdge(t),this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",t,"terminal",e,"source",i,"previous",r))}finally{this.model.endUpdate()}}},mxGraph.prototype.disconnectGraph=function(t){if(t!=null){this.model.beginUpdate();try{for(var e=this.view.scale,i=this.view.translate,n=new mxDictionary,r=0;r0)for(var o=new mxRectangle(a[0].x,a[0].y,0,0),u=1;u=0&&(s.x+=o.x,s.y+=o.y))}}else if(s=mxRectangle.fromRectangle(r),this.model.isVertex(p)&&mxUtils.indexOf(t,p)>=0){var o=this.getBoundingBoxFromGeometry([p],!1);o!=null&&(s.x+=o.x,s.y+=o.y)}s!=null&&r.offset!=null&&(s.x+=r.offset.x,s.y+=r.offset.y);var m=this.getCurrentCellStyle(t[n]);if(s!=null){var d=mxUtils.getValue(m,mxConstants.STYLE_ROTATION,0);d!=0&&(s=mxUtils.getBoundingBox(s,d))}}s!=null&&(i==null?i=mxRectangle.fromRectangle(s):i.add(s))}}}return i},mxGraph.prototype.refresh=function(t){this.view.clear(t,t==null),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,i,n,r){var s=this.view.translate,l=this.view.scale;if(!i&&this.gridEnabled){var a=this.gridSize*l*.5;if(!n){var o=e.x-(this.snap(e.x/l-s.x)+s.x)*l;Math.abs(t.x-o)l&&(m=0),f>a&&(d=0),this.view.setTranslate(Math.floor(m/2-o.x),Math.floor(d/2-o.y)),this.container.scrollLeft=(x-l)/2,this.container.scrollTop=(f-a)/2}},mxGraph.prototype.zoom=function(t,e){e=e??this.centerZoom;var i=Math.round(this.view.scale*t*100)/100,n=this.view.getState(this.getSelectionCell());if(t=i/this.view.scale,this.keepSelectionVisibleOnZoom&&n!=null){var r=new mxRectangle(n.x*t,n.y*t,n.width*t,n.height*t);this.view.scale=i,this.scrollRectToVisible(r)||(this.view.revalidate(),this.view.setScale(i))}else{var s=mxUtils.hasScrollbars(this.container);if(e&&!s){var l=this.container.offsetWidth,a=this.container.offsetHeight;if(t>1){var o=(t-1)/(i*2);l*=-o,a*=-o}else{var o=(1/t-1)/(this.view.scale*2);l*=o,a*=o}this.view.scaleAndTranslate(i,this.view.translate.x+l,this.view.translate.y+a)}else{var u=this.view.translate.x,p=this.view.translate.y,m=this.container.scrollLeft,d=this.container.scrollTop;if(this.view.setScale(i),s){var l=0,a=0;e&&(l=this.container.offsetWidth*(t-1)/2,a=this.container.offsetHeight*(t-1)/2),this.container.scrollLeft=(this.view.translate.x-u)*this.view.scale+Math.round(m*t+l),this.container.scrollTop=(this.view.translate.y-p)*this.view.scale+Math.round(d*t+a)}}}},mxGraph.prototype.zoomToRect=function(t){var e=this.container.clientWidth/t.width,i=this.container.clientHeight/t.height,n=e/i;t.x=Math.max(0,t.x),t.y=Math.max(0,t.y);var r=Math.min(this.container.scrollWidth,t.x+t.width),s=Math.min(this.container.scrollHeight,t.y+t.height);if(t.width=r-t.x,t.height=s-t.y,n<1){var l=t.height/n,a=(l-t.height)/2;t.height=l;var o=Math.min(t.y,a);t.y=t.y-o,s=Math.min(this.container.scrollHeight,t.y+t.height),t.height=s-t.y}else{var u=t.width*n,p=(u-t.width)/2;t.width=u;var m=Math.min(t.x,p);t.x=t.x-m,r=Math.min(this.container.scrollWidth,t.x+t.width),t.width=r-t.x}var d=this.container.clientWidth/t.width,x=this.view.scale*d;mxUtils.hasScrollbars(this.container)?(this.view.setScale(x),this.container.scrollLeft=Math.round(t.x*d),this.container.scrollTop=Math.round(t.y*d)):this.view.scaleAndTranslate(x,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 i=-this.view.translate.x,n=-this.view.translate.y,r=this.view.getState(t);if(r!=null){var s=new mxRectangle(i+r.x,n+r.y,r.width,r.height);if(e&&this.container!=null){var l=this.container.clientWidth,a=this.container.clientHeight;s.x=s.getCenterX()-l/2,s.width=l,s.y=s.getCenterY()-a/2,s.height=a}var o=new mxPoint(this.view.translate.x,this.view.translate.y);if(this.scrollRectToVisible(s)){var u=new mxPoint(this.view.translate.x,this.view.translate.y);this.view.translate.x=o.x,this.view.translate.y=o.y,this.view.setTranslate(u.x,u.y)}}},mxGraph.prototype.scrollRectToVisible=function(t){var e=!1;if(t!=null){var i=this.container.offsetWidth,n=this.container.offsetHeight,r=Math.min(i,t.width),s=Math.min(n,t.height);if(mxUtils.hasScrollbars(this.container)){var l=this.container;t.x+=this.view.translate.x,t.y+=this.view.translate.y;var a=l.scrollLeft-t.x,o=Math.max(a-l.scrollLeft,0);a>0?l.scrollLeft-=a+2:(a=t.x+r-l.scrollLeft-l.clientWidth,a>0&&(l.scrollLeft+=a+2));var u=l.scrollTop-t.y,p=Math.max(0,u-l.scrollTop);u>0?l.scrollTop-=u+2:(u=t.y+s-l.scrollTop-l.clientHeight,u>0&&(l.scrollTop+=u+2)),!this.useScrollbarsForPanning&&(o!=0||p!=0)&&this.view.setTranslate(o,p)}else{var m=-this.view.translate.x,d=-this.view.translate.y,x=this.view.scale;t.x+r>m+i&&(this.view.translate.x-=(t.x+r-i-m)/x,e=!0),t.y+s>d+n&&(this.view.translate.y-=(t.y+s-n-d)/x,e=!0),t.x1||r.length==1&&r[0]!=t)&&(n+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+` `)}var s=this.model.getDirectedEdgeCount(e,!0,t),l=this.model.getDirectedEdgeCount(i,!1,t);if(this.multiplicities!=null)for(var a=0;a0?n:null}return this.allowDanglingEdges?null:""},mxGraph.prototype.validateEdge=function(t,e,i){return null},mxGraph.prototype.validateGraph=function(t,e){t=t??this.model.getRoot(),e=e??new Object;for(var i=!0,n=this.model.getChildCount(t),r=0;r")):this.setCellWarning(s,null),i=i&&a==null}var o="";this.isCellCollapsed(t)&&!i&&(o+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+` `),this.model.isEdge(t)?o+=this.getEdgeValidationError(t,this.model.getTerminal(t,!0),this.model.getTerminal(t,!1))||"":o+=this.getCellValidationError(t)||"";var u=this.validateCell(t,e);return u!=null&&(o+=u),this.model.getParent(t)==null&&this.view.validate(),o.length>0||!i?o:null},mxGraph.prototype.getCellValidationError=function(t){var e=this.model.getDirectedEdgeCount(t,!0),i=this.model.getDirectedEdgeCount(t,!1),n=this.model.getValue(t),r="";if(this.multiplicities!=null)for(var s=0;sl.max||el.max||i0?r: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(t!=null&&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){var e=this.model.getValue(t);if(e!=null){if(mxUtils.isNode(e))return e.nodeName;if(typeof e.toString=="function")return e.toString()}return""},mxGraph.prototype.getLabel=function(t){var e="";if(this.labelsVisible&&t!=null){var i=this.getCurrentCellStyle(t);mxUtils.getValue(i,mxConstants.STYLE_NOLABEL,!1)||(e=this.convertValueToString(t))}return e},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 this.getCurrentCellStyle(t)[mxConstants.STYLE_WHITE_SPACE]=="wrap"},mxGraph.prototype.isLabelClipped=function(t){return this.getCurrentCellStyle(t)[mxConstants.STYLE_OVERFLOW]=="hidden"},mxGraph.prototype.getTooltip=function(t,e,i,n){var r=null;if(t!=null){if(t.control!=null&&(e==t.control.node||e.parentNode==t.control.node)&&(r=this.collapseExpandResource,r=mxUtils.htmlEntities(mxResources.get(r)||r).replace(/\\n/g,"
")),r==null&&t.overlays!=null&&t.overlays.visit(function(l,a){r==null&&(e==a.node||e.parentNode==a.node)&&(r=a.overlay.toString())}),r==null){var s=this.selectionCellsHandler.getHandler(t.cell);s!=null&&typeof s.getTooltipForNode=="function"&&(r=s.getTooltipForNode(e))}r==null&&(r=this.getTooltipForCell(t.cell))}return r},mxGraph.prototype.getTooltipForCell=function(t){var e=null;return t!=null&&t.getTooltip!=null?e=t.getTooltip():e=this.convertValueToString(t),e},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 i=new mxRectangle,n=this.getCurrentCellStyle(t,e),r=parseInt(mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return mxUtils.getValue(n,mxConstants.STYLE_HORIZONTAL,!0)?i.height=r:i.width=r,i},mxGraph.prototype.getSwimlaneDirection=function(t){var e=mxUtils.getValue(t,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),i=mxUtils.getValue(t,mxConstants.STYLE_FLIPH,0)==1,n=mxUtils.getValue(t,mxConstants.STYLE_FLIPV,0)==1,r=mxUtils.getValue(t,mxConstants.STYLE_HORIZONTAL,!0),s=r?0:3;e==mxConstants.DIRECTION_NORTH?s--:e==mxConstants.DIRECTION_WEST?s+=2:e==mxConstants.DIRECTION_SOUTH&&(s+=1);var l=mxUtils.mod(s,2);return i&&l==1&&(s+=2),n&&l==0&&(s+=2),[mxConstants.DIRECTION_NORTH,mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST][mxUtils.mod(s,4)]},mxGraph.prototype.getActualStartSize=function(t,e){var i=new mxRectangle;if(this.isSwimlane(t,e)){var n=this.getCurrentCellStyle(t,e),r=parseInt(mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),s=this.getSwimlaneDirection(n);s==mxConstants.DIRECTION_NORTH?i.y=r:s==mxConstants.DIRECTION_WEST?i.x=r:s==mxConstants.DIRECTION_SOUTH?i.height=r:i.width=r}return i},mxGraph.prototype.getImage=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_IMAGE]:null},mxGraph.prototype.isTransparentState=function(t){var e=!1;if(t!=null){var i=mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),n=mxUtils.getValue(t.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);e=i==mxConstants.NONE&&n==mxConstants.NONE&&this.getImage(t)==null}return e},mxGraph.prototype.getVerticalAlign=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null},mxGraph.prototype.getIndicatorColor=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_COLOR]:null},mxGraph.prototype.getIndicatorGradientColor=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null},mxGraph.prototype.getIndicatorShape=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_SHAPE]:null},mxGraph.prototype.getIndicatorImage=function(t){return t!=null&&t.style!=null?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 t!=null&&this.model.getParent(t)!=this.model.getRoot()&&!this.model.isEdge(t)?this.getCurrentCellStyle(t,e)[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE:!1},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()||e!=null&&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(e){return this.isCellCloneable(e)}))},mxGraph.prototype.isCellCloneable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsCloneable()&&e[mxConstants.STYLE_CLONEABLE]!=0},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(e){return this.canExportCell(e)}))},mxGraph.prototype.canExportCell=function(t){return this.exportEnabled},mxGraph.prototype.getImportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(e){return this.canImportCell(e)}))},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(e){return this.isCellDeletable(e)}))},mxGraph.prototype.isCellDeletable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsDeletable()&&e[mxConstants.STYLE_DELETABLE]!=0},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){var e=this.getCurrentCellStyle(t);return e[mxConstants.STYLE_ROTATABLE]!=0},mxGraph.prototype.getMovableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(e){return this.isCellMovable(e)}))},mxGraph.prototype.isCellMovable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsMovable()&&!this.isCellLocked(t)&&e[mxConstants.STYLE_MOVABLE]!=0},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)&&mxUtils.getValue(e,mxConstants.STYLE_RESIZABLE,"1")!="0"},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)&&e[mxConstants.STYLE_BENDABLE]!=0},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)&&e[mxConstants.STYLE_EDITABLE]!=0},mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable},mxGraph.prototype.setCellsEditable=function(t){this.cellsEditable=t},mxGraph.prototype.isCellDisconnectable=function(t,e,i){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 t==null&&this.allowDanglingEdges||t!=null&&(!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(this.cellEditor!=null){var e=this.cellEditor.getEditingCell();return t==null?e!=null:t==e}return!1},mxGraph.prototype.isAutoSizeCell=function(t){var e=this.getCurrentCellStyle(t);return this.isAutoSizeCells()||e[mxConstants.STYLE_AUTOSIZE]==1},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(i){return this.isCellFoldable(i,e)}))},mxGraph.prototype.isCellFoldable=function(t,e){var i=this.getCurrentCellStyle(t);return this.model.getChildCount(t)>0&&i[mxConstants.STYLE_FOLDABLE]!=0},mxGraph.prototype.isValidDropTarget=function(t,e,i){return t!=null&&(this.isSplitEnabled()&&this.isSplitTarget(t,e,i)||!this.model.isEdge(t)&&(this.isSwimlane(t)||this.model.getChildCount(t)>0&&!this.isCellCollapsed(t)))},mxGraph.prototype.isSplitTarget=function(t,e,i){if(this.model.isEdge(t)&&e!=null&&e.length==1&&this.isCellConnectable(e[0])&&this.getEdgeValidationError(t,this.model.getTerminal(t,!0),e[0])==null){var n=this.model.getTerminal(t,!0),r=this.model.getTerminal(t,!1);return!this.model.isAncestor(e[0],n)&&!this.model.isAncestor(e[0],r)}return!1},mxGraph.prototype.getDropTarget=function(t,e,i,n){if(!this.isSwimlaneNesting()){for(var r=0;r=0;a--){var o=this.model.getChildAt(i,a),u=this.getCellAt(t,e,o,n,r,s);if(u!=null)return u;if(this.isCellVisible(o)&&(r&&this.model.isEdge(o)||n&&this.model.isVertex(o))){var p=this.view.getState(o);if(p!=null&&(s==null||!s(p,t,e))&&this.intersects(p,t,e))return o}}return null},mxGraph.prototype.intersects=function(t,e,i){if(t!=null){var n=t.absolutePoints;if(n!=null)for(var r=this.tolerance*this.tolerance,s=n[0],l=1;l0&&e>0&&e>r.width*s)return!0;if(r.height>0&&i>0&&i>r.height*s)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,i){t=t??this.getDefaultParent(),e=e??!1,i=i??!1;for(var n=this.model.getChildCells(t,e,i),r=[],s=0;s0||n>0||l!=null){var u=this.getModel(),p=t+i,m=e+n;if(r==null&&(r=this.getCurrentRoot(),r==null&&(r=u.getRoot())),r!=null)for(var d=u.getChildCount(r),x=0;x=t&&v.y+v.height<=m&&v.y>=e&&v.x+v.width<=p;y&&s.push(f),(!y||o)&&this.getCells(t,e,i,n,f,s,l,a,o)}}}return s},mxGraph.prototype.getCellsBeyond=function(t,e,i,n,r){var s=[];if((n||r)&&(i==null&&(i=this.getDefaultParent()),i!=null))for(var l=this.model.getChildCount(i),a=0;a=t)&&(!r||u.y>=e)&&s.push(o)}return s},mxGraph.prototype.findTreeRoots=function(t,e,i){e=e??!1,i=i??!1;var n=[];if(t!=null){for(var r=this.getModel(),s=r.getChildCount(t),l=null,a=0,o=0;o0||!i&&d==0&&m>0)&&n.push(u);var g=i?d-m:m-d;g>a&&(a=g,l=u)}}n.length==0&&l!=null&&n.push(l)}return n},mxGraph.prototype.traverse=function(t,e,i,n,r,s){if(i!=null&&t!=null&&(e=e??!0,s=s??!1,r=r||new mxDictionary,!r.get(t))){r.put(t,!0);var l=i(t,n);if(l==null||l){var a=this.model.getEdgeCount(t);if(a>0)for(var o=0;o0?n.cells[0]:null;n.cells.length>1&&n.clear();var s=r!=null?this.model.getParent(r):this.getDefaultParent(),l=this.model.getChildCount(s);if(r==null&&l>0){var a=this.model.getChildAt(s,0);this.setSelectionCell(a)}else if((r==null||e)&&this.view.getState(s)!=null&&this.model.getGeometry(s)!=null)this.getCurrentRoot()!=s&&this.setSelectionCell(s);else if(r!=null&&i){var o=this.model.getChildCount(r);if(o>0){var a=this.model.getChildAt(r,0);this.setSelectionCell(a)}}else if(l>0){var u=s.getIndex(r);if(t){u++;var a=this.model.getChildAt(s,u%l);this.setSelectionCell(a)}else{u--;var p=u<0?l-1:u,a=this.model.getChildAt(s,p);this.setSelectionCell(a)}}},mxGraph.prototype.selectAll=function(t,e){t=t||this.getDefaultParent();var i=e?this.model.filterDescendants(mxUtils.bind(this,function(n){return n!=t&&this.view.getState(n)!=null}),t):this.model.getChildren(t);i!=null&&this.setSelectionCells(i)},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(t,e,i,n){i=i||this.getDefaultParent();var r=mxUtils.bind(this,function(l){return this.view.getState(l)!=null&&((n||this.model.getChildCount(l)==0)&&this.model.isVertex(l)&&t&&!this.model.isEdge(this.model.getParent(l))||this.model.isEdge(l)&&e)}),s=this.model.filterDescendants(r,i);s!=null&&this.setSelectionCells(s)},mxGraph.prototype.selectCellForEvent=function(t,e){var i=this.isCellSelected(t);this.isToggleEvent(e)?i?this.removeSelectionCell(t):this.addSelectionCell(t):(!i||this.getSelectionCount()!=1)&&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=null;if(t!=null)if(this.model.isEdge(t.cell)){var i=t.getVisibleTerminalState(!0),n=t.getVisibleTerminalState(!1),r=this.getCellGeometry(t.cell),s=this.view.getEdgeStyle(t,r!=null?r.points:null,i,n);e=this.createEdgeHandler(t,s)}else e=this.createVertexHandler(t);return e},mxGraph.prototype.createVertexHandler=function(t){return new mxVertexHandler(t)},mxGraph.prototype.createEdgeHandler=function(t,e){var i=null;return e==mxEdgeStyle.Loop||e==mxEdgeStyle.ElbowConnector||e==mxEdgeStyle.SideToSide||e==mxEdgeStyle.TopToBottom?i=this.createElbowEdgeHandler(t):e==mxEdgeStyle.SegmentConnector||e==mxEdgeStyle.OrthConnector?i=this.createEdgeSegmentHandler(t):i=new mxEdgeHandler(t),i},mxGraph.prototype.createEdgeSegmentHandler=function(t){return new mxEdgeSegmentHandler(t)},mxGraph.prototype.createElbowEdgeHandler=function(t){return new mxElbowEdgeHandler(t)},mxGraph.prototype.addMouseListener=function(t){this.mouseListeners==null&&(this.mouseListeners=[]),this.mouseListeners.push(t)},mxGraph.prototype.removeMouseListener=function(t){if(this.mouseListeners!=null){for(var e=0;e0){this.outline.getView().scale!=d&&(this.outline.getView().scale=d,t=!0);var x=this.outline.getView();x.currentRoot!=this.source.getView().currentRoot&&x.setCurrentRoot(this.source.getView().currentRoot);var f=this.source.view.translate,g=f.x+this.source.panDx,c=f.y+this.source.panDy,v=this.getOutlineOffset(d);v!=null&&(g+=v.x,c+=v.y),n.x<0&&(g=g-n.x),n.y<0&&(c=c-n.y),(x.translate.x!=g||x.translate.y!=c)&&(x.translate.x=g,x.translate.y=c,t=!0);var y=x.translate;d=this.source.getView().scale;var T=d/x.scale,C=1/x.scale,S=this.source.container;this.bounds=new mxRectangle((y.x-f.x-this.source.panDx)/C,(y.y-f.y-this.source.panDy)/C,S.clientWidth/T,S.clientHeight/T),this.bounds.x+=this.source.container.scrollLeft*x.scale/d,this.bounds.y+=this.source.container.scrollTop*x.scale/d;var E=this.selectionBorder.bounds;(E.x!=this.bounds.x||E.y!=this.bounds.y||E.width!=this.bounds.width||E.height!=this.bounds.height)&&(this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw());var E=this.sizer.bounds,L=new mxRectangle(this.bounds.x+this.bounds.width-E.width/2,this.bounds.y+this.bounds.height-E.height/2,E.width,E.height);(E.x!=L.x||E.y!=L.y||E.width!=L.width||E.height!=L.height)&&(this.sizer.bounds=L,this.sizer.node.style.visibility!="hidden"&&this.sizer.redraw()),t&&this.outline.view.revalidate()}}},mxOutline.prototype.mouseDown=function(t,e){if(this.enabled&&this.showViewport){var i=mxEvent.isMouseEvent(e.getEvent())?0:this.source.tolerance,n=this.source.allowHandleBoundsCheck&&(mxClient.IS_IE||i>0)?new mxRectangle(e.getGraphX()-i,e.getGraphY()-i,2*i,2*i):null;this.zoom=e.isSource(this.sizer)||n!=null&&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){if(this.active){this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display;var i=this.getTranslateForEvent(e),n=i.x,r=i.y,s=null;if(this.zoom){var a=this.source.container,o=a.clientWidth/a.clientHeight;r=n/o,s=new mxRectangle(this.bounds.x,this.bounds.y,Math.max(1,this.bounds.width+n),Math.max(1,this.bounds.height+r)),this.selectionBorder.bounds=s,this.selectionBorder.redraw()}else{var l=this.outline.getView().scale;s=new mxRectangle(this.bounds.x+n,this.bounds.y+r,this.bounds.width,this.bounds.height),this.selectionBorder.bounds=s,this.selectionBorder.redraw(),n/=l,n*=this.source.getView().scale,r/=l,r*=this.source.getView().scale,this.source.panGraph(-n-this.dx0,-r-this.dy0)}var u=this.sizer.bounds;this.sizer.bounds=new mxRectangle(s.x+s.width-u.width/2,s.y+s.height-u.height/2,u.width,u.height),this.sizer.node.style.visibility!="hidden"&&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){if(this.active){var i=this.getTranslateForEvent(e),n=i.x,r=i.y;if(Math.abs(n)>0||Math.abs(r)>0){if(this.zoom){var l=this.selectionBorder.bounds.width,a=this.source.getView().scale;this.source.zoomTo(Math.max(this.minScale,a-n*a/l),!1)}else if(!this.source.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.source.container)){this.source.panGraph(0,0),n/=this.outline.getView().scale,r/=this.outline.getView().scale;var s=this.source.getView().translate;this.source.getView().setTranslate(s.x-n,s.y-r)}this.update(),e.consume()}this.index=null,this.active=!1}},mxOutline.prototype.destroy=function(){this.source!=null&&(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),this.outline!=null&&(this.outline.removeMouseListener(this),this.outline.destroy(),this.outline=null),this.selectionBorder!=null&&(this.selectionBorder.destroy(),this.selectionBorder=null),this.sizer!=null&&(this.sizer.destroy(),this.sizer=null)},__mxOutput.mxOutline=typeof mxOutline<"u"?mxOutline:void 0;function mxMultiplicity(t,e,i,n,r,s,l,a,o,u){this.source=t,this.type=e,this.attr=i,this.value=n,this.min=r??0,this.max=s??"n",this.validNeighbors=l,this.countError=mxResources.get(a)||a,this.typeError=mxResources.get(o)||o,this.validNeighborsAllowed=u??!0}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,i,n,r,s){var l="";if((this.source&&this.checkTerminal(t,i,e)||!this.source&&this.checkTerminal(t,n,e))&&(this.countError!=null&&(this.source&&(this.max==0||r>=this.max)||!this.source&&(this.max==0||s>=this.max))&&(l+=this.countError+` `),this.validNeighbors!=null&&this.typeError!=null&&this.validNeighbors.length>0)){var a=this.checkNeighbors(t,e,i,n);a||(l+=this.typeError+` `)}return l.length>0?l:null},mxMultiplicity.prototype.checkNeighbors=function(t,e,i,n){for(var r=t.model.getValue(i),s=t.model.getValue(n),l=!this.validNeighborsAllowed,a=this.validNeighbors,o=0;o0){var i=this.getGraph().getModel();i.beginUpdate();try{for(var n=null,r=0;r1||r.points!=null&&r.points.length>0||n.getTerminal(i,!0)==null||n.getTerminal(i,!1)==null||this.graph.allowDanglingEdges||this.graph.isCloneEvent(e.getEvent())&&this.graph.isCellsCloneable())?this.start(i,e.getX(),e.getY()):this.delayedSelection&&(this.cell=i),this.cellWasClicked=!0,this.consumeMouseEvent(mxEvent.MOUSE_DOWN,e)}}},mxGraphHandler.prototype.getGuideStates=function(){var t=this.graph.getDefaultParent(),e=this.graph.getModel(),i=mxUtils.bind(this,function(n){return this.graph.view.getState(n)!=null&&e.isVertex(n)&&e.getGeometry(n)!=null&&!e.getGeometry(n).relative});return this.graph.view.getCellStates(e.filterDescendants(i,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=this.getBoundingBox(t);if(e!=null){if(e.width=Math.max(0,e.width-1),e.height=Math.max(0,e.height-1),e.width0){for(var i=this.graph.getModel(),n=0;n=2)&&m!=(this.target||s))})}},mxGraphHandler.prototype.addStates=function(t,e){var i=this.graph.view.getState(t),n=0;if(i!=null&&e.get(t)==null){e.put(t,i),n++;for(var r=this.graph.model.getChildCount(t),s=0;s=this.cellCount&&!this.livePreviewActive&&this.allowLivePreview?(!this.cloning||!this.livePreviewActive)&&(this.livePreviewActive=!0,this.livePreviewUsed=!0):!this.livePreviewUsed&&this.shape==null&&(this.shape=this.createPreviewShape(this.bounds))},mxGraphHandler.prototype.mouseMove=function(t,e){var i=this.graph;if(!e.isConsumed()&&i.isMouseDown&&this.cell!=null&&this.first!=null&&this.bounds!=null&&!this.suspended){if(mxEvent.isMultiTouchEvent(e.getEvent())){this.reset();return}var n=this.getDelta(e),r=i.tolerance;if(this.shape!=null||this.livePreviewActive||Math.abs(n.x)>r||Math.abs(n.y)>r){this.highlight==null&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3));var s=i.isCloneEvent(e.getEvent())&&i.isCellsCloneable()&&this.isCloneEnabled(),l=i.isGridEnabledEvent(e.getEvent()),a=e.getCell(),o=!0,u=null;this.cloning=s,i.isDropEnabled()&&this.highlightEnabled&&(u=i.getDropTarget(this.cells,e.getEvent(),a,s));var p=i.getView().getState(u),m=!1;if(p!=null&&(s||this.isValidDropTarget(u,e)))this.target!=u&&(this.target=u,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),m=!0;else if(this.target=null,this.connectOnDrop&&a!=null&&this.cells.length==1&&i.getModel().isVertex(a)&&i.isCellConnectable(a)&&(p=i.getView().getState(a),p!=null)){var d=i.getEdgeValidationError(null,this.cell,a),x=d==null?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR;this.setHighlightColor(x),m=!0}p!=null&&m?this.highlight.highlight(p):this.highlight.hide(),this.guide!=null&&this.useGuidesForEvent(e)?(n=this.guide.move(this.bounds,n,l,s),o=!1):n=this.graph.snapDelta(n,this.bounds,!l,!1,!1),this.guide!=null&&o&&this.guide.hide(),i.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())}else if((this.isMoveEnabled()||this.isCloneEnabled())&&this.updateCursor&&!e.isConsumed()&&(e.getState()!=null||e.sourceState!=null)&&!i.isMouseDown){var f=i.getCursorForMouseEvent(e);f==null&&i.isEnabled()&&i.isCellMovable(e.getCell())&&(i.getModel().isEdge(e.getCell())?f=mxConstants.CURSOR_MOVABLE_EDGE:f=mxConstants.CURSOR_MOVABLE_VERTEX),f!=null&&e.sourceState!=null&&e.sourceState.setCursor(f)}},mxGraphHandler.prototype.updatePreview=function(t){this.livePreviewUsed&&!t?this.cells!=null&&(this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!1),this.updateLivePreview(this.currentDx,this.currentDy)):this.updatePreviewShape()},mxGraphHandler.prototype.updatePreviewShape=function(){this.shape!=null&&this.pBounds!=null&&(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(t,e){if(!this.suspended){var i=[];if(this.allCells!=null&&this.allCells.visit(mxUtils.bind(this,function(f,g){var c=this.graph.view.getState(g.cell);if(c!=g&&(g.destroy(),c!=null?this.allCells.put(g.cell,c):this.allCells.remove(g.cell),g=c),g!=null){var v=g.clone();i.push([g,v]),g.shape!=null&&(g.shape.originalPointerEvents==null&&(g.shape.originalPointerEvents=g.shape.pointerEvents),g.shape.pointerEvents=!1,g.text!=null&&(g.text.originalPointerEvents==null&&(g.text.originalPointerEvents=g.text.pointerEvents),g.text.pointerEvents=!1)),this.graph.model.isVertex(g.cell)&&(g.x+=t,g.y+=e,this.cloning?g.text!=null&&(g.text.updateBoundingBox(),g.text.boundingBox!=null&&(g.text.boundingBox.x+=t,g.text.boundingBox.y+=e),g.text.unrotatedBoundingBox!=null&&(g.text.unrotatedBoundingBox.x+=t,g.text.unrotatedBoundingBox.y+=e)):(g.view.graph.cellRenderer.redraw(g,!0),g.view.invalidate(g.cell),g.invalid=!1,g.control!=null&&g.control.node!=null&&(g.control.node.style.visibility="hidden")))}})),i.length==0)this.reset();else{for(var n=this.graph.view.scale,r=0;rthis.graph.tolerance||Math.abs(this.dy)>this.graph.tolerance,!i&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",e))}(this.active||this.panningTrigger)&&e.consume()},mxPanningHandler.prototype.mouseUp=function(t,e){if(this.active){if(this.dx!=null&&this.dy!=null){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){var i=this.graph.getView().scale,n=this.graph.getView().translate;this.graph.panGraph(0,0),this.panGraph(n.x+this.dx/i,n.y+this.dy/i)}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;this.minScale!=null&&(e=Math.max(this.minScale,e)),this.maxScale!=null&&(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)},__mxOutput.mxPanningHandler=typeof mxPanningHandler<"u"?mxPanningHandler:void 0;function mxPopupMenuHandler(t,e){t!=null&&(this.graph=t,this.factoryMethod=e,this.graph.addMouseListener(this),this.gestureHandler=mxUtils.bind(this,function(i,n){this.inTolerance=!1}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.init())}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&&this.screenX!=null&&this.screenY!=null&&(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){if(this.popupTrigger&&this.inTolerance&&this.triggerX!=null&&this.triggerY!=null){var i=this.getCellForPopupEvent(e);this.graph.isEnabled()&&this.isSelectOnPopup(e)&&i!=null&&!this.graph.isCellSelected(i)?this.graph.setSelectionCell(i):this.clearSelectionOnBackground&&i==null&&this.graph.clearSelection(),this.graph.tooltipHandler.hide();var n=mxUtils.getScrollOrigin();this.popup(e.getX()+n.x+1,e.getY()+n.y+1,i,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)},__mxOutput.mxPopupMenuHandler=typeof mxPopupMenuHandler<"u"?mxPopupMenuHandler:void 0;function mxCellMarker(t,e,i,n){mxEventSource.call(this),t!=null&&(this.graph=t,this.validColor=e??mxConstants.DEFAULT_VALID_COLOR,this.invalidColor=i??mxConstants.DEFAULT_INVALID_COLOR,this.hotspot=n??mxConstants.DEFAULT_HOTSPOT,this.highlight=new mxCellHighlight(t))}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 this.validState!=null},mxCellMarker.prototype.getValidState=function(){return this.validState},mxCellMarker.prototype.getMarkedState=function(){return this.markedState},mxCellMarker.prototype.reset=function(){this.validState=null,this.markedState!=null&&(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,i){var n=t!=null?this.isValidState(t):!1;i=i??this.getMarkerColor(e.getEvent(),t,n),n?this.validState=t:this.validState=null,(t!=this.markedState||i!=this.currentColor)&&(this.currentColor=i,t!=null&&this.currentColor!=null?(this.markedState=t,this.mark()):this.markedState!=null&&(this.markedState=null,this.unmark()))},mxCellMarker.prototype.markCell=function(t,e){var i=this.graph.getView().getState(t);i!=null&&(this.currentColor=e??this.validColor,this.markedState=i,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,i){return i?this.validColor:this.invalidColor},mxCellMarker.prototype.getState=function(t){var e=this.graph.getView(),i=this.getCell(t),n=this.getStateToMark(e.getState(i));return n!=null&&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):!0},mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),this.highlight.destroy()},__mxOutput.mxCellMarker=typeof mxCellMarker<"u"?mxCellMarker:void 0;function mxSelectionCellsHandler(t){mxEventSource.call(this),this.graph=t,this.handlers=new mxDictionary,this.graph.addMouseListener(this),this.refreshHandler=mxUtils.bind(this,function(e,i){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)}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 this.getHandler(t)!=null},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),i=0;ithis.graph.tolerance||Math.abs(e.getGraphY()-this.first.y)>this.graph.tolerance)&&this.updateCurrentState(e,s),this.first!=null){var l=null,a=s;this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&this.constraintHandler.currentPoint!=null?(l=this.constraintHandler.currentConstraint,a=this.constraintHandler.currentPoint.clone()):this.previous!=null&&!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&(Math.abs(this.previous.getCenterX()-s.x)0?this.waypoints[0]:a,x=this.getSourcePerimeterPoint(this.previous,f,e);x!=null&&(o=x)}}if(this.currentState==null&&this.movePreviewAway){var x=o;if(this.edgeState!=null&&this.edgeState.absolutePoints.length>=2){var g=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2];g!=null&&(x=g)}var c=a.x-x.x,v=a.y-x.y,y=Math.sqrt(c*c+v*v);if(y==0)return;this.originalPoint=a.clone(),a.x-=c*4/y,a.y-=v*4/y}else this.originalPoint=null;if(this.shape==null){var c=Math.abs(e.getGraphX()-this.first.x),v=Math.abs(e.getGraphY()-this.first.y);(c>this.graph.tolerance||v>this.graph.tolerance)&&(this.shape=this.createShape(),this.edgeState!=null&&this.shape.apply(this.edgeState),this.updateCurrentState(e,s))}if(this.shape!=null){if(this.edgeState!=null)this.shape.points=this.edgeState.absolutePoints;else{var T=[o];this.waypoints!=null&&(T=T.concat(this.waypoints)),T.push(a),this.shape.points=T}this.drawPreview()}this.cursor!=null&&(this.graph.container.style.cursor=this.cursor),mxEvent.consume(e.getEvent()),e.consume()}else!this.isEnabled()||!this.graph.isEnabled()?this.constraintHandler.reset():this.previous!=this.currentState&&this.edgeState==null?(this.destroyIcons(),this.currentState!=null&&this.error==null&&this.constraintHandler.currentConstraint==null&&(this.icons=this.createIcons(this.currentState),this.icons==null&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),e.consume())),this.previous=this.currentState):this.previous==this.currentState&&this.currentState!=null&&this.icons==null&&!this.graph.isMouseDown&&e.consume();if(!this.graph.isMouseDown&&this.currentState!=null&&this.icons!=null){for(var C=!1,S=e.getSource(),E=0;E0?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY()),l=r(n.getPerimeterBounds(t),this.edgeState,s,!1);l!=null&&(i=l)}else i=new mxPoint(t.getCenterX(),t.getCenterY());return i},mxConnectionHandler.prototype.getSourcePerimeterPoint=function(t,e,i){var n=null,r=t.view,s=r.getPerimeterFunction(t),l=new mxPoint(t.getCenterX(),t.getCenterY());if(s!=null){var a=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),o=-a*(Math.PI/180);a!=0&&(e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(o),Math.sin(o),l));var u=s(r.getPerimeterBounds(t),t,e,!1);u!=null&&(a!=0&&(u=mxUtils.getRotatedPoint(new mxPoint(u.x,u.y),Math.cos(-o),Math.sin(-o),l)),n=u)}else n=l;return n},mxConnectionHandler.prototype.updateIcons=function(t,e,i){},mxConnectionHandler.prototype.isStopEvent=function(t){return t.getState()!=null},mxConnectionHandler.prototype.addWaypointForEvent=function(t){var e=mxUtils.convertPoint(this.graph.container,t.getX(),t.getY()),i=Math.abs(e.x-this.first.x),n=Math.abs(e.y-this.first.y),r=this.waypoints!=null||this.mouseDownCounter>1&&(i>this.graph.tolerance||n>this.graph.tolerance);if(r){this.waypoints==null&&(this.waypoints=[]);var s=this.graph.view.scale,e=new mxPoint(this.graph.snap(t.getGraphX()/s)*s,this.graph.snap(t.getGraphY()/s)*s);this.waypoints.push(e)}},mxConnectionHandler.prototype.checkConstraints=function(t,e){return t==null||e==null||t.point==null||e.point==null||!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)){this.addWaypointForEvent(e),e.consume();return}var i=this.sourceConstraint,n=this.constraintHandler.currentConstraint,r=this.previous!=null?this.previous.cell:null,s=null;this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&(s=this.constraintHandler.currentFocus.cell),s==null&&this.currentState!=null&&(s=this.currentState.cell),this.error==null&&(r==null||s==null||r!=s||this.checkConstraints(i,n))?this.connect(r,s,e.getEvent(),e.getCell()):(this.previous!=null&&this.marker.validState!=null&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,e.getEvent()),this.error!=null&&this.error.length>0&&this.graph.validationAlert(this.error)),this.destroyIcons(),e.consume()}this.first!=null&&this.reset()},mxConnectionHandler.prototype.reset=function(){this.shape!=null&&(this.shape.destroy(),this.shape=null),this.cursor!=null&&this.graph.container!=null&&(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(this.error==null),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,i,n){if(e!=null||this.isCreateTarget(i)||this.graph.allowDanglingEdges){var r=this.graph.getModel(),s=!1,l=null;r.beginUpdate();try{if(t!=null&&e==null&&!this.graph.isIgnoreTerminalEvent(i)&&this.isCreateTarget(i)&&(e=this.createTargetVertex(i,t),e!=null)){if(n=this.graph.getDropTarget([e],i,n),s=!0,n==null||!this.graph.getModel().isEdge(n)){var a=this.graph.getView().getState(n);if(a!=null){var o=r.getGeometry(e);o.x-=a.origin.x,o.y-=a.origin.y}}else n=this.graph.getDefaultParent();this.graph.addCell(e,n)}var u=this.graph.getDefaultParent();t!=null&&e!=null&&r.getParent(t)==r.getParent(e)&&r.getParent(r.getParent(t))!=r.getRoot()&&(u=r.getParent(t),t.geometry!=null&&t.geometry.relative&&e.geometry!=null&&e.geometry.relative&&(u=r.getParent(u)));var p=null,m=null;if(this.edgeState!=null&&(p=this.edgeState.cell.value,m=this.edgeState.cell.style),l=this.insertEdge(u,null,p,t,e,m),l!=null){this.graph.setConnectionConstraint(l,t,!0,this.sourceConstraint),this.graph.setConnectionConstraint(l,e,!1,this.constraintHandler.currentConstraint),this.edgeState!=null&&r.setGeometry(l,this.edgeState.cell.geometry);var u=r.getParent(t);if(this.isInsertBefore(l,t,e,i,n)){for(var d=null,o=t;o.parent!=null&&o.geometry!=null&&o.geometry.relative&&o.parent!=l.parent;)o=this.graph.model.getParent(o);o!=null&&o.parent!=null&&o.parent==l.parent&&r.add(u,l,o.parent.getIndex(o))}var x=r.getGeometry(l);if(x==null&&(x=new mxGeometry,x.relative=!0,r.setGeometry(l,x)),this.waypoints!=null&&this.waypoints.length>0){var f=this.graph.view.scale,g=this.graph.view.translate;x.points=[];for(var c=0;c0){var o=this.graph.view.getState(e);if(o!=null){var u=o.x/s-r.x,p=o.y/s-r.y;Math.abs(u-n.x)<=a&&(n.x=Math.round(u)),Math.abs(p-n.y)<=a&&(n.y=Math.round(p))}}}return i},mxConnectionHandler.prototype.getAlignmentTolerance=function(t){return this.graph.isGridEnabled()?this.graph.gridSize/2:this.graph.tolerance},mxConnectionHandler.prototype.createEdge=function(t,e,i,n){var r=null;if(this.factoryMethod!=null&&(r=this.factoryMethod(e,i,n)),r==null){r=new mxCell(t||""),r.setEdge(!0),r.setStyle(n);var s=new mxGeometry;s.relative=!0,r.setGeometry(s)}return r},mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.shape!=null&&(this.shape.destroy(),this.shape=null),this.marker!=null&&(this.marker.destroy(),this.marker=null),this.constraintHandler!=null&&(this.constraintHandler.destroy(),this.constraintHandler=null),this.changeHandler!=null&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null),this.drillHandler!=null&&(this.graph.removeListener(this.drillHandler),this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null),this.escapeHandler!=null&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null)},__mxOutput.mxConnectionHandler=typeof mxConnectionHandler<"u"?mxConnectionHandler:void 0;function mxConstraintHandler(t){this.graph=t,this.resetHandler=mxUtils.bind(this,function(e,i){this.currentFocus!=null&&this.graph.view.getState(this.currentFocus.cell)==null?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)}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(this.focusIcons!=null){for(var t=0;to||Math.abs(a)>o)&&(this.div==null&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(r,s),e.consume())}},mxRubberband.prototype.createShape=function(){this.sharedDiv==null&&(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||document.documentMode>=10)&&this.fadeOut&&(this.sharedDiv=null),t},mxRubberband.prototype.isActive=function(t,e){return this.div!=null&&this.div.style.display!="none"},mxRubberband.prototype.mouseUp=function(t,e){var i=this.isActive();this.reset(),i&&(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(){if(this.div!=null)if(mxClient.IS_SVG&&(!mxClient.IS_IE||document.documentMode>=10)&&this.fadeOut){var 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)}else 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(){if(this.div!=null){var 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;var i=mxClient.IS_VML?this.graph.panDx:0,n=mxClient.IS_VML?this.graph.panDy:0;this.div.style.left=this.x+i+"px",this.div.style.top=this.y+n+"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(),this.sharedDiv!=null&&(this.sharedDiv=null))},__mxOutput.mxRubberband=typeof mxRubberband<"u"?mxRubberband:void 0;function mxHandle(t,e,i,n){this.graph=t.view.graph,this.state=t,this.cursor=e??this.cursor,this.image=i??this.image,this.shape=n??null,this.init()}mxHandle.prototype.cursor="default",mxHandle.prototype.image=null,mxHandle.prototype.ignoreGrid=!1,mxHandle.prototype.getPosition=function(t){},mxHandle.prototype.setPosition=function(t,e,i){},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,i=this.graph.view.translate,n=new mxPoint(t.getGraphX()/e-i.x,t.getGraphY()/e-i.y);this.shape!=null&&this.shape.bounds!=null&&(n.x-=this.shape.bounds.width/e/4,n.y-=this.shape.bounds.height/e/4);var r=-mxUtils.toRadians(this.getRotation()),s=-mxUtils.toRadians(this.getTotalRotation())-r;n=this.flipPoint(this.rotatePoint(this.snapPoint(this.rotatePoint(n,r),this.ignoreGrid||!this.graph.isGridEnabledEvent(t.getEvent())),s)),this.setPosition(this.state.getPaintBounds(),n,t),this.redraw()},mxHandle.prototype.positionChanged=function(){this.state.text!=null&&this.state.text.apply(this.state),this.state.shape!=null&&this.state.shape.apply(this.state),this.graph.cellRenderer.redraw(this.state,!0)},mxHandle.prototype.getRotation=function(){return this.state.shape!=null?this.state.shape.getRotation():0},mxHandle.prototype.getTotalRotation=function(){return this.state.shape!=null?this.state.shape.getShapeRotation():0},mxHandle.prototype.init=function(){var t=this.isHtmlRequired();this.image!=null?(this.shape=new mxImageShape(new mxRectangle(0,0,this.image.width,this.image.height),this.image.src),this.shape.preserveImageAspect=!1):this.shape==null&&(this.shape=this.createShape(t)),this.initShape(t)},mxHandle.prototype.createShape=function(t){var e=new mxRectangle(0,0,mxConstants.HANDLE_SIZE,mxConstants.HANDLE_SIZE);return new mxRectangleShape(e,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,this.cursor!=null&&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(){if(this.shape!=null&&this.state.shape!=null){var t=this.getPosition(this.state.getPaintBounds());if(t!=null){var e=mxUtils.toRadians(this.getTotalRotation());t=this.rotatePoint(this.flipPoint(t),e);var i=this.graph.view.scale,n=this.graph.view.translate;this.shape.bounds.x=Math.floor((t.x+n.x)*i-this.shape.bounds.width/2),this.shape.bounds.y=Math.floor((t.y+n.y)*i-this.shape.bounds.height/2),this.shape.redraw()}}},mxHandle.prototype.isHtmlRequired=function(){return this.state.text!=null&&this.state.text.node.parentNode==this.graph.container},mxHandle.prototype.rotatePoint=function(t,e){var i=this.state.getCellBounds(),n=new mxPoint(i.getCenterX(),i.getCenterY()),r=Math.cos(e),s=Math.sin(e);return mxUtils.getRotatedPoint(t,r,s,n)},mxHandle.prototype.flipPoint=function(t){if(this.state.shape!=null){var 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)}return 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){this.shape!=null&&this.shape.node!=null&&(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(){this.shape!=null&&(this.shape.destroy(),this.shape=null)},__mxOutput.mxHandle=typeof mxHandle<"u"?mxHandle:void 0;function mxVertexHandler(t){t!=null&&(this.state=t,this.init(),this.escapeHandler=mxUtils.bind(this,function(e,i){this.livePreview&&this.index!=null&&(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))}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(){if(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()=2&&this.state.height>=2){var 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++)));var i=this.graph.model.getGeometry(this.state.cell);i!=null&&!i.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))}else 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()0&&(this.minBounds=this.graph.view.getBounds(t),this.minBounds!=null)){var e=this.state.view.scale,i=this.state.view.translate;this.minBounds.x-=this.state.x,this.minBounds.y-=this.state.y,this.minBounds.x/=e,this.minBounds.y/=e,this.minBounds.width/=e,this.minBounds.height/=e,this.x0=this.state.x/e-i.x,this.y0=this.state.y/e-i.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){var e=new mxRectangleShape(mxRectangle.fromRectangle(t),null,this.getSelectionColor());return e.strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},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,i,n){i=i||mxConstants.HANDLE_SIZE;var r=new mxRectangle(0,0,i,i),s=this.createSizerShape(r,e,n);return s.isHtmlAllowed()&&this.state.text!=null&&this.state.text.node.parentNode==this.graph.container?(s.bounds.height-=1,s.bounds.width-=1,s.dialect=mxConstants.DIALECT_STRICTHTML,s.init(this.graph.container)):(s.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,s.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(s.node,this.graph,this.state),this.graph.isEnabled()&&s.setCursor(t),this.isSizerVisible(e)||(s.visible=!1),s},mxVertexHandler.prototype.isSizerVisible=function(t){return!0},mxVertexHandler.prototype.createSizerShape=function(t,e,i){if(this.handleImage!=null){t=new mxRectangle(t.x,t.y,this.handleImage.width,this.handleImage.height);var n=new mxImageShape(t,this.handleImage.src);return n.preserveImageAspect=!1,n}else return e==mxEvent.ROTATION_HANDLE?new mxEllipse(t,i||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(t,i||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxVertexHandler.prototype.moveSizerTo=function(t,e,i){t!=null&&(t.bounds.x=Math.floor(e-t.bounds.width/2),t.bounds.y=Math.floor(i-t.bounds.height/2),t.node!=null&&t.node.style.display!="none"&&t.redraw())},mxVertexHandler.prototype.getHandleForEvent=function(t){var e=mxEvent.isMouseEvent(t.getEvent())?1:this.tolerance,i=this.allowHandleBoundsCheck&&(mxClient.IS_IE||e>0)?new mxRectangle(t.getGraphX()-e,t.getGraphY()-e,2*e,2*e):null,n=mxUtils.bind(this,function(s){var l=s!=null&&s.constructor!=mxImageShape&&this.allowHandleBoundsCheck?s.strokewidth+s.svgStrokeTolerance:null,a=l!=null?new mxRectangle(t.getGraphX()-Math.floor(l/2),t.getGraphY()-Math.floor(l/2),l,l):i;return s!=null&&(t.isSource(s)||a!=null&&mxUtils.intersects(s.bounds,a)&&s.node.style.display!="none"&&s.node.style.visibility!="hidden")});if(n(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(n(this.labelShape))return mxEvent.LABEL_HANDLE;if(this.sizers!=null){for(var r=0;r=0;r--)if(n(this.customHandles[r].shape))return mxEvent.CUSTOM_HANDLE-r}return null},mxVertexHandler.prototype.isCustomHandleEvent=function(t){return!0},mxVertexHandler.prototype.mouseDown=function(t,e){if(!e.isConsumed()&&this.graph.isEnabled()){var i=this.getHandleForEvent(e);i!=null&&(this.start(e.getGraphX(),e.getGraphY(),i),e.consume())}},mxVertexHandler.prototype.isLivePreviewBorder=function(){return this.state.shape!=null&&this.state.shape.fill==null&&this.state.shape.stroke==null},mxVertexHandler.prototype.start=function(t,e,i){if(this.selectionBorder!=null)if(this.livePreviewActive=this.livePreview&&this.graph.model.getChildCount(this.state.cell)==0,this.inTolerance=!0,this.childOffsetX=0,this.childOffsetY=0,this.index=i,this.startX=t,this.startY=e,this.index<=mxEvent.CUSTOM_HANDLE&&this.isGhostPreview())this.ghostPreview=this.createGhostPreview();else{var n=this.state.view.graph.model,r=n.getParent(this.state.cell);if(this.state.view.currentRoot!=r&&(n.isVertex(r)||n.isEdge(r))&&(this.parentState=this.state.view.graph.view.getState(r)),this.selectionBorder.node.style.display=i==mxEvent.ROTATION_HANDLE?"inline":"none",(!this.livePreviewActive||this.isLivePreviewBorder())&&(this.preview=this.createSelectionShape(this.bounds),!(mxClient.IS_SVG&&Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")!=0)&&this.state.text!=null&&this.state.text.node.parentNode==this.graph.container?(this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(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()))),i==mxEvent.ROTATION_HANDLE){var s=this.getRotationHandlePosition(),l=s.x-this.state.getCenterX(),a=s.y-this.state.getCenterY();this.startAngle=l!=0?Math.atan(a/l)*180/Math.PI+90:0,this.startDist=Math.sqrt(l*l+a*a)}if(this.livePreviewActive){this.hideSizers(),i==mxEvent.ROTATION_HANDLE?this.rotationShape.node.style.display="":i==mxEvent.LABEL_HANDLE?this.labelShape.node.style.display="":this.sizers!=null&&this.sizers[i]!=null?this.sizers[i].node.style.display="":i<=mxEvent.CUSTOM_HANDLE&&this.customHandles!=null&&this.customHandles[mxEvent.CUSTOM_HANDLE-i].setVisible(!0);var o=this.graph.getEdges(this.state.cell);this.edgeHandlers=[];for(var u=0;uthis.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(t*10)/10},mxVertexHandler.prototype.roundLength=function(t){return Math.round(t*100)/100},mxVertexHandler.prototype.mouseMove=function(t,e){!e.isConsumed()&&this.index!=null?(this.checkTolerance(e),this.inTolerance||(this.index<=mxEvent.CUSTOM_HANDLE?this.customHandles!=null&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].active=!0,this.ghostPreview!=null?(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(),this.selectionBounds!=null&&(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()):!this.graph.isMouseDown&&this.getHandleForEvent(e)!=null&&e.consume(!1)},mxVertexHandler.prototype.isGhostPreview=function(){return this.state.view.graph.model.getChildCount(this.state.cell)>0},mxVertexHandler.prototype.moveLabel=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY()),i=this.graph.view.translate,n=this.graph.view.scale;this.graph.isGridEnabledEvent(t.getEvent())&&(e.x=(this.graph.snap(e.x/n-i.x)+i.x)*n,e.y=(this.graph.snap(e.y/n-i.y)+i.y)*n);var r=this.rotationShape!=null?this.sizers.length-2:this.sizers.length-1;this.moveSizerTo(this.sizers[r],e.x,e.y)},mxVertexHandler.prototype.rotateVertex=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY()),i=this.state.x+this.state.width/2-e.x,n=this.state.y+this.state.height/2-e.y;if(this.currentAlpha=i!=0?Math.atan(n/i)*180/Math.PI+90:n<0?180:0,i>0&&(this.currentAlpha-=180),this.currentAlpha-=this.startAngle,this.rotationRaster&&this.graph.isGridEnabledEvent(t.getEvent())){var i=e.x-this.state.getCenterX(),n=e.y-this.state.getCenterY(),r=Math.sqrt(i*i+n*n);r-this.startDist<2?raster=15:r-this.startDist<25?raster=5:raster=1,this.currentAlpha=Math.round(this.currentAlpha/raster)*raster}else 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()),i=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),n=new mxPoint(t.getGraphX(),t.getGraphY()),r=this.graph.view.translate,s=this.graph.view.scale,l=Math.cos(-i),a=Math.sin(-i),c=n.x-this.startX,v=n.y-this.startY,o=l*c-a*v,u=a*c+l*v;c=o,v=u;var p=this.graph.getCellGeometry(this.state.cell);if(this.unscaledBounds=this.union(p,c/s,v/s,this.index,this.graph.isGridEnabledEvent(t.getEvent()),1,new mxPoint(0,0),this.isConstrainedEvent(t),this.isCenteredEvent(this.state,t)),!p.relative){var m=this.graph.getMaximumGraphBounds();if(m!=null&&this.parentState!=null&&(m=mxRectangle.fromRectangle(m),m.x-=(this.parentState.x-r.x*s)/s,m.y-=(this.parentState.y-r.y*s)/s),this.graph.isConstrainChild(this.state.cell)){var d=this.graph.getCellContainmentArea(this.state.cell);if(d!=null){var x=this.graph.getOverlap(this.state.cell);x>0&&(d=mxRectangle.fromRectangle(d),d.x-=d.width*x,d.y-=d.height*x,d.width+=2*d.width*x,d.height+=2*d.height*x),m==null?m=d:(m=mxRectangle.fromRectangle(m),m.intersect(d))}}m!=null&&(this.unscaledBounds.xm.x+m.width&&(this.unscaledBounds.width-=this.unscaledBounds.x+this.unscaledBounds.width-m.x-m.width),this.unscaledBounds.y+this.unscaledBounds.height>m.y+m.height&&(this.unscaledBounds.height-=this.unscaledBounds.y+this.unscaledBounds.height-m.y-m.height))}var f=this.bounds;this.bounds=new mxRectangle((this.parentState!=null?this.parentState.x:r.x*s)+this.unscaledBounds.x*s,(this.parentState!=null?this.parentState.y:r.y*s)+this.unscaledBounds.y*s,this.unscaledBounds.width*s,this.unscaledBounds.height*s),p.relative&&this.parentState!=null&&(this.bounds.x+=this.state.x-this.parentState.x,this.bounds.y+=this.state.y-this.parentState.y),l=Math.cos(i),a=Math.sin(i);var g=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY()),c=g.x-e.x,v=g.y-e.y,y=l*c-a*v,T=a*c+l*v,C=y-c,S=T-v,E=this.bounds.x-this.state.x,L=this.bounds.y-this.state.y,A=l*E-a*L,M=a*E+l*L;this.bounds.x+=C,this.bounds.y+=S,this.unscaledBounds.x=this.roundLength(this.unscaledBounds.x+C/s),this.unscaledBounds.y=this.roundLength(this.unscaledBounds.y+S/s),this.unscaledBounds.width=this.roundLength(this.unscaledBounds.width),this.unscaledBounds.height=this.roundLength(this.unscaledBounds.height),!this.graph.isCellCollapsed(this.state.cell)&&(C!=0||S!=0)?(this.childOffsetX=this.state.x-this.bounds.x+A,this.childOffsetY=this.state.y-this.bounds.y+M):(this.childOffsetX=0,this.childOffsetY=0),f.equals(this.bounds)||(this.livePreviewActive&&this.updateLivePreview(t),this.preview!=null?this.drawPreview():this.updateParentHighlight())},mxVertexHandler.prototype.updateLivePreview=function(t){var e=this.graph.view.scale,i=this.graph.view.translate,n=this.state.clone();this.state.x=this.bounds.x,this.state.y=this.bounds.y,this.state.origin=new mxPoint(this.state.x/e-i.x,this.state.y/e-i.y),this.state.width=this.bounds.width,this.state.height=this.bounds.height;var r=this.state.absoluteOffset;r=new mxPoint(r.x,r.y),this.state.absoluteOffset.x=0,this.state.absoluteOffset.y=0;var s=this.graph.getCellGeometry(this.state.cell);if(s!=null){var l=s.offset||this.EMPTY_POINT;l!=null&&!s.relative&&(this.state.absoluteOffset.x=this.state.view.scale*l.x,this.state.absoluteOffset.y=this.state.view.scale*l.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(),this.state.control!=null&&this.state.control.node!=null&&(this.state.control.node.style.visibility="hidden"),this.state.setState(n)},mxVertexHandler.prototype.moveToFront=function(){(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==null||this.state.shape.node.nextSibling!=this.state.text.node))&&(this.state.shape!=null&&this.state.shape.node!=null&&this.state.shape.node.parentNode.appendChild(this.state.shape.node),this.state.text!=null&&this.state.text.node!=null&&this.state.text.node.parentNode.appendChild(this.state.text.node))},mxVertexHandler.prototype.mouseUp=function(t,e){if(this.index!=null&&this.state!=null){var i=new mxPoint(e.getGraphX(),e.getGraphY()),n=this.index;this.index=null,this.ghostPreview==null&&(this.state.view.invalidate(this.state.cell,!1,!1),this.state.view.validate()),this.graph.getModel().beginUpdate();try{if(n<=mxEvent.CUSTOM_HANDLE){if(this.customHandles!=null){var r=this.state.view.graph.getCellStyle(this.state.cell);this.customHandles[mxEvent.CUSTOM_HANDLE-n].active=!1,this.customHandles[mxEvent.CUSTOM_HANDLE-n].execute(e),this.customHandles!=null&&this.customHandles[mxEvent.CUSTOM_HANDLE-n]!=null&&(this.state.style=r,this.customHandles[mxEvent.CUSTOM_HANDLE-n].positionChanged())}}else if(n==mxEvent.ROTATION_HANDLE)if(this.currentAlpha!=null){var s=this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0);s!=0&&this.rotateCell(this.state.cell,s)}else this.rotateClick();else{var l=this.graph.isGridEnabledEvent(e.getEvent()),a=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),o=Math.cos(-a),u=Math.sin(-a),p=i.x-this.startX,m=i.y-this.startY,d=o*p-u*m,x=u*p+o*m;p=d,m=x;var f=this.graph.view.scale,g=this.isRecursiveResize(this.state,e);this.resizeCell(this.state.cell,this.roundLength(p/f),this.roundLength(m/f),n,l,this.isConstrainedEvent(e),g)}}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,i){if(e!=0){var n=this.graph.getModel();if(n.isVertex(t)||n.isEdge(t)){if(!n.isEdge(t)){var r=this.graph.getCurrentCellStyle(t),s=(r[mxConstants.STYLE_ROTATION]||0)+e;this.graph.setCellStyles(mxConstants.STYLE_ROTATION,s,[t])}var l=this.graph.getCellGeometry(t);if(l!=null){var a=this.graph.getCellGeometry(i);if(a!=null&&!n.isEdge(i)&&(l=l.clone(),l.rotate(e,new mxPoint(a.width/2,a.height/2)),n.setGeometry(t,l)),n.isVertex(t)&&!l.relative||n.isEdge(t))for(var o=n.getChildCount(t),u=0;u4?(v=v+i,r?v=this.graph.snap(v/s)*s:v=Math.round(v/s)*s):n<3&&(c=c+i,r?c=this.graph.snap(c/s)*s:c=Math.round(c/s)*s),n==0||n==3||n==5?(f+=e,r?f=this.graph.snap(f/s)*s:f=Math.round(f/s)*s):(n==2||n==4||n==7)&&(g+=e,r?g=this.graph.snap(g/s)*s:g=Math.round(g/s)*s);var C=g-f,S=v-c;if(a){var E=this.graph.getCellGeometry(this.state.cell);if(E!=null){var L=E.width/E.height;n==1||n==2||n==7||n==6?C=S*L:S=C/L,n==0&&(f=g-C,c=v-S)}}if(o){C+=C-d,S+=S-x;var A=y-(f+C/2),M=T-(c+S/2);f+=A,c+=M,g+=A,v+=M}C<0&&(f+=C,C=Math.abs(C)),S<0&&(c+=S,S=Math.abs(S));var I=new mxRectangle(f+l.x*s,c+l.y*s,C,S);return this.minBounds!=null&&(I.width=Math.max(I.width,this.minBounds.x*s+this.minBounds.width*s+Math.max(0,this.x0*s-I.x)),I.height=Math.max(I.height,this.minBounds.y*s+this.minBounds.height*s+Math.max(0,this.y0*s-I.y))),I}},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 this.sizers!=null&&this.sizers.length>0&&this.sizers[0]!=null&&(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=this.getSizerBounds(),e=this.tolerance;if(this.horizontalOffset=0,this.verticalOffset=0,this.customHandles!=null)for(var i=0;i0&&this.sizers[0]!=null){if(this.index==null&&this.manageSizers&&this.sizers.length>=8){var r=this.getHandlePadding();this.horizontalOffset=r.x,this.verticalOffset=r.y,(this.horizontalOffset!=0||this.verticalOffset!=0)&&(t=new mxRectangle(t.x,t.y,t.width,t.height),t.x-=this.horizontalOffset/2,t.width+=this.horizontalOffset,t.y-=this.verticalOffset/2,t.height+=this.verticalOffset),this.sizers.length>=8&&(t.width<2*this.sizers[0].bounds.width+2*e||t.height<2*this.sizers[0].bounds.height+2*e?(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=""))}var s=t.x+t.width,l=t.y+t.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],s,l);else{var a=t.x+t.width/2,o=t.y+t.height/2;if(this.sizers.length>=8){var u=["nw-resize","n-resize","ne-resize","e-resize","se-resize","s-resize","sw-resize","w-resize"],p=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),m=Math.cos(p),d=Math.sin(p),x=Math.round(p*4/Math.PI),f=new mxPoint(t.getCenterX(),t.getCenterY()),g=mxUtils.getRotatedPoint(new mxPoint(t.x,t.y),m,d,f);this.moveSizerTo(this.sizers[0],g.x,g.y),this.sizers[0].setCursor(u[mxUtils.mod(0+x,u.length)]),g.x=a,g.y=t.y,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[1],g.x,g.y),this.sizers[1].setCursor(u[mxUtils.mod(1+x,u.length)]),g.x=s,g.y=t.y,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[2],g.x,g.y),this.sizers[2].setCursor(u[mxUtils.mod(2+x,u.length)]),g.x=t.x,g.y=o,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[3],g.x,g.y),this.sizers[3].setCursor(u[mxUtils.mod(7+x,u.length)]),g.x=s,g.y=o,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[4],g.x,g.y),this.sizers[4].setCursor(u[mxUtils.mod(3+x,u.length)]),g.x=t.x,g.y=l,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[5],g.x,g.y),this.sizers[5].setCursor(u[mxUtils.mod(6+x,u.length)]),g.x=a,g.y=l,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[6],g.x,g.y),this.sizers[6].setCursor(u[mxUtils.mod(5+x,u.length)]),g.x=s,g.y=l,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[7],g.x,g.y),this.sizers[7].setCursor(u[mxUtils.mod(4+x,u.length)]),g.x=a+this.state.absoluteOffset.x,g.y=o+this.state.absoluteOffset.y,g=mxUtils.getRotatedPoint(g,m,d,f),this.moveSizerTo(this.sizers[8],g.x,g.y)}else this.state.width>=2&&this.state.height>=2?this.moveSizerTo(this.sizers[0],a+this.state.absoluteOffset.x,o+this.state.absoluteOffset.y):this.moveSizerTo(this.sizers[0],this.state.x,this.state.y)}}if(this.rotationShape!=null){var p=mxUtils.toRadians(this.currentAlpha!=null?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),m=Math.cos(p),d=Math.sin(p),f=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),g=mxUtils.getRotatedPoint(this.getRotationHandlePosition(),m,d,f);this.rotationShape.node!=null&&(this.moveSizerTo(this.rotationShape,g.x,g.y),this.rotationShape.node.style.visibility=this.state.view.graph.isEditing()||!this.handlesVisible?"hidden":"")}if(this.selectionBorder!=null&&(this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")),this.edgeHandlers!=null)for(var i=0;i0)?new mxRectangle(t.getGraphX()-i,t.getGraphY()-i,2*i,2*i):null,r=null;if(this.customHandles!=null&&this.isCustomHandleEvent(t)){for(var s=this.customHandles.length-1;s>=0;s--)if(l(this.customHandles[s].shape))return mxEvent.CUSTOM_HANDLE-s}if((t.isSource(this.state.text)||l(this.labelShape))&&(e=mxEvent.LABEL_HANDLE),this.bends!=null)for(var s=0;smxEvent.VIRTUAL_HANDLE&&this.customHandles!=null)for(var s=0;s0&&this.isSnapToTerminalsEvent(t)){let u=function(m){if(m!=null){var d=m.x;Math.abs(n.x-d)0&&fmxEvent.VIRTUAL_HANDLE&&(n[this.index-1]=r)}else this.graph.resetEdgesOnConnect&&(n=null);return s??n},mxEdgeHandler.prototype.isOutlineConnectEvent=function(t){var e=mxUtils.getOffset(this.graph.container),i=t.getEvent(),n=mxEvent.getClientX(i),r=mxEvent.getClientY(i),s=document.documentElement,l=(window.pageXOffset||s.scrollLeft)-(s.clientLeft||0),a=(window.pageYOffset||s.scrollTop)-(s.clientTop||0),o=this.currentPoint.x-this.graph.container.scrollLeft+e.x-l,u=this.currentPoint.y-this.graph.container.scrollTop+e.y-a;return this.outlineConnect&&!mxEvent.isShiftDown(t.getEvent())&&(t.isSource(this.marker.highlight.shape)||mxEvent.isAltDown(t.getEvent())&&t.getState()!=null||this.marker.highlight.isHighlightAt(n,r)||(o!=n||u!=r)&&t.getState()==null&&this.marker.highlight.isHighlightAt(o,u))},mxEdgeHandler.prototype.updatePreviewState=function(t,e,i,n,r){var s=this.isSource?i:this.state.getVisibleTerminalState(!0),l=this.isTarget?i:this.state.getVisibleTerminalState(!1),a=this.graph.getConnectionConstraint(t,s,!0),o=this.graph.getConnectionConstraint(t,l,!1),u=this.constraintHandler.currentConstraint;if(u==null&&r&&(i!=null?(n.isSource(this.marker.highlight.shape)&&(e=new mxPoint(n.getGraphX(),n.getGraphY())),u=this.graph.getOutlineConstraint(e,i,n),this.constraintHandler.setFocus(n,i,this.isSource),this.constraintHandler.currentConstraint=u,this.constraintHandler.currentPoint=e):u=new mxConnectionConstraint),this.outlineConnect&&this.marker.highlight!=null&&this.marker.highlight.shape!=null){var p=this.graph.view.scale;this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null?(this.marker.highlight.shape.stroke=r?mxConstants.OUTLINE_HIGHLIGHT_COLOR:"transparent",this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/p/p,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.marker.highlight.shape.stroke=this.graph.isCellConnectable(n.getCell())&&this.marker.getValidState()!=n.getState()?"transparent":mxConstants.DEFAULT_VALID_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/p/p,this.marker.highlight.repaint())}this.isSource?a=u:this.isTarget&&(o=u),(this.isSource||this.isTarget)&&(u!=null&&u.point!=null?(t.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X]=u.point.x,t.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]=u.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(s,!0),t.setVisibleTerminalState(l,!1),(!this.isSource||s!=null)&&t.view.updateFixedTerminalPoint(t,s,!0,a),(!this.isTarget||l!=null)&&t.view.updateFixedTerminalPoint(t,l,!1,o),(this.isSource||this.isTarget)&&i==null&&(t.setAbsoluteTerminalPoint(e,this.isSource),this.marker.getMarkedState()==null&&(this.error=this.graph.allowDanglingEdges?null:"")),t.view.updatePoints(t,this.points,s,l),t.view.updateFloatingTerminalPoints(t,s,l)},mxEdgeHandler.prototype.mouseMove=function(t,e){if(this.index!=null&&this.marker!=null){if(this.currentPoint=this.getPointForEvent(e),this.error=null,!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&this.snapPoint!=null&&(Math.abs(this.snapPoint.x-this.currentPoint.x)mxEvent.VIRTUAL_HANDLE)this.customHandles!=null&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged(),this.shape!=null&&this.shape.node!=null&&(this.shape.node.style.display="none"));else if(this.isLabel)this.label.x=this.currentPoint.x,this.label.y=this.currentPoint.y;else{this.points=this.getPreviewPoints(this.currentPoint,e);var i=this.isSource||this.isTarget?this.getPreviewTerminalState(e):null;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&this.constraintHandler.currentPoint!=null)this.currentPoint=this.constraintHandler.currentPoint.clone();else if(this.outlineConnect){var n=this.isSource||this.isTarget?this.isOutlineConnectEvent(e):!1;n?i=this.marker.highlight.state:i!=null&&i!=e.getState()&&this.graph.isCellConnectable(e.getCell())&&this.marker.highlight.shape!=null&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint(),i=null)}i!=null&&!this.isCellEnabled(i.cell)&&(i=null,this.marker.reset());var r=this.clonePreviewState(this.currentPoint,i!=null?i.cell:null);this.updatePreviewState(r,this.currentPoint,i,e,n);var s=this.error==null?this.marker.validColor:this.marker.invalidColor;this.setPreviewColor(s),this.abspoints=r.absolutePoints,this.active=!0,this.updateHint(e,this.currentPoint)}this.drawPreview(),mxEvent.consume(e.getEvent()),e.consume()}else mxClient.IS_IE&&this.getHandleForEvent(e)!=null&&e.consume(!1)},mxEdgeHandler.prototype.mouseUp=function(t,e){if(this.index!=null&&this.marker!=null){this.shape!=null&&this.shape.node!=null&&(this.shape.node.style.display="");var i=this.state.cell,n=this.index;if(this.index=null,e.getX()!=this.startX||e.getY()!=this.startY){var r=!this.graph.isIgnoreTerminalEvent(e.getEvent())&&this.graph.isCloneEvent(e.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable();if(this.error!=null)this.error.length>0&&this.graph.validationAlert(this.error);else if(n<=mxEvent.CUSTOM_HANDLE&&n>mxEvent.VIRTUAL_HANDLE){if(this.customHandles!=null){var s=this.graph.getModel();s.beginUpdate();try{this.customHandles[mxEvent.CUSTOM_HANDLE-n].execute(e),this.shape!=null&&this.shape.node!=null&&(this.shape.apply(this.state),this.shape.redraw())}finally{s.endUpdate()}}}else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget){var l=null;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&(l=this.constraintHandler.currentFocus.cell),l==null&&this.marker.hasValidState()&&this.marker.highlight!=null&&this.marker.highlight.shape!=null&&this.marker.highlight.shape.stroke!="transparent"&&this.marker.highlight.shape.stroke!="white"&&(l=this.marker.validState.cell),l!=null){var s=this.graph.getModel(),a=s.getParent(i);s.beginUpdate();try{if(r){var o=s.getGeometry(i),r=this.graph.cloneCell(i);s.add(a,r,s.getChildCount(a)),o!=null&&(o=o.clone(),s.setGeometry(r,o));var u=s.getTerminal(i,!this.isSource);this.graph.connectCell(r,u,!this.isSource),i=r}i=this.connect(i,l,this.isSource,r,e)}finally{s.endUpdate()}}else if(this.graph.isAllowDanglingEdges()){var p=this.abspoints[this.isSource?0:this.abspoints.length-1];p.x=this.roundLength(p.x/this.graph.view.scale-this.graph.view.translate.x),p.y=this.roundLength(p.y/this.graph.view.scale-this.graph.view.translate.y);var m=this.graph.getView().getState(this.graph.getModel().getParent(i));m!=null&&(p.x-=m.origin.x,p.y-=m.origin.y),p.x-=this.graph.panDx/this.graph.view.scale,p.y-=this.graph.panDy/this.graph.view.scale,i=this.changeTerminalPoint(i,p,this.isSource,r)}}else this.active?i=this.changePoints(i,this.points,r):(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());this.marker!=null&&(this.reset(),i!=this.state.cell&&this.graph.setSelectionCell(i)),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&&this.sizers!=null)for(var t=0;t0&&e0&&i!=null){this.points==null&&(this.points=[]);for(var n=1;n0&&this.graph.isLabelMovable(t),this.bends!=null&&this.bends.length>0){var n=this.abspoints.length-1,r=this.abspoints[0],s=r.x,l=r.y;e=this.bends[0].bounds,this.bends[0].bounds=new mxRectangle(Math.floor(s-e.width/2),Math.floor(l-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);var a=this.abspoints[n],o=a.x,u=a.y,p=this.bends.length-1;e=this.bends[p].bounds,this.bends[p].bounds=new mxRectangle(Math.floor(o-e.width/2),Math.floor(u-e.height/2),e.width,e.height),this.bends[p].fill=this.getHandleFillColor(p),this.bends[p].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[p].bounds),this.redrawInnerBends(r,a)}if(this.abspoints!=null&&this.virtualBends!=null&&this.virtualBends.length>0){for(var m=this.abspoints[0],d=0;d1?(t=n[1],e=n[n.length-2]):i.points!=null&&i.points.length>0&&(r=n[0]),r==null?r=new mxPoint(t.x+(e.x-t.x)/2,t.y+(e.y-t.y)/2):r=new mxPoint(this.graph.getView().scale*(r.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(r.y+this.graph.getView().translate.y+this.state.origin.y));var s=this.bends[1].bounds,l=s.width,a=s.height,o=new mxRectangle(Math.round(r.x-l/2),Math.round(r.y-a/2),l,a);this.manageLabelHandle?this.checkLabelHandle(o):this.handleImage==null&&this.labelShape.visible&&mxUtils.intersects(o,this.labelShape.bounds)&&(l=mxConstants.HANDLE_SIZE+3,a=mxConstants.HANDLE_SIZE+3,o=new mxRectangle(Math.floor(r.x-l/2),Math.floor(r.y-a/2),l,a)),this.bends[1].bounds=o,this.bends[1].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[1].bounds)},__mxOutput.mxElbowEdgeHandler=typeof mxElbowEdgeHandler<"u"?mxElbowEdgeHandler:void 0;function mxEdgeSegmentHandler(t){mxEdgeHandler.call(this,t)}mxUtils.extend(mxEdgeSegmentHandler,mxElbowEdgeHandler),mxEdgeSegmentHandler.prototype.getCurrentPoints=function(){var t=this.state.absolutePoints;if(t!=null){var e=Math.max(1,this.graph.view.scale);if(t.length==2||t.length==3&&(Math.abs(t[0].x-t[1].x)0){var o=this.abspoints,u=o[0],p=o[1];a=[];for(var m=2;m1){var n=!1;if(i.length==4&&Math.round(i[1].x-i[2].x)==0&&Math.round(i[1].y-i[2].y)==0)if(n=!0,Math.round(i[0].y-i[i.length-1].y)==0){var r=i[0].x+(i[i.length-1].x-i[0].x)/2;i[1]=new mxPoint(r,i[1].y),i[2]=new mxPoint(r,i[2].y)}else{var s=i[0].y+(i[i.length-1].y-i[0].y)/2;i[1]=new mxPoint(i[1].x,s),i[2]=new mxPoint(i[2].x,s)}for(var l=0;l0){this.div==null&&this.init();var n=mxUtils.getScrollOrigin();this.div.style.zIndex=this.zIndex,this.div.style.left=e+n.x+"px",this.div.style.top=i+mxConstants.TOOLTIP_VERTICAL_OFFSET+n.y+"px",mxUtils.isNode(t)?(this.div.innerHTML="",this.div.appendChild(t)):this.div.innerHTML=t.replace(/\n/g,"
"),this.div.style.visibility="",mxUtils.fit(this.div)}},mxTooltipHandler.prototype.destroy=function(){this.destroyed||(this.graph.removeMouseListener(this),mxEvent.release(this.div),this.div!=null&&this.div.parentNode!=null&&this.div.parentNode.removeChild(this.div),this.destroyed=!0,this.div=null)},__mxOutput.mxTooltipHandler=typeof mxTooltipHandler<"u"?mxTooltipHandler:void 0;function mxCellTracker(t,e,i){mxCellMarker.call(this,t,e),this.graph.addMouseListener(this),i!=null&&(this.getCell=i),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()}))}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))},__mxOutput.mxCellTracker=typeof mxCellTracker<"u"?mxCellTracker:void 0;function mxCellHighlight(t,e,i,n){t!=null&&(this.graph=t,this.highlightColor=e??mxConstants.DEFAULT_VALID_COLOR,this.strokeWidth=i??mxConstants.HIGHLIGHT_STROKEWIDTH,this.dashed=n??!1,this.opacity=mxConstants.HIGHLIGHT_OPACITY,this.repaintHandler=mxUtils.bind(this,function(){if(this.state!=null){var r=this.graph.view.getState(this.state.cell);r==null?this.hide():(this.state=r,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))}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,this.shape!=null&&(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(){this.state!=null&&this.shape!=null&&(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),this.state.shape!=null&&this.shape.setCursor(this.state.shape.getCursor()),(mxClient.IS_QUIRKS||document.documentMode==8)&&(this.shape.stroke=="transparent"?(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&&(this.shape!=null&&(this.shape.destroy(),this.shape=null),this.state=t,this.state!=null&&this.drawHighlight())},mxCellHighlight.prototype.isHighlightAt=function(t,e){var i=!1;if(this.shape!=null&&document.elementFromPoint!=null&&!mxClient.IS_QUIRKS)for(var n=document.elementFromPoint(t,e);n!=null;){if(n==this.shape.node){i=!0;break}n=n.parentNode}return i},mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getView().removeListener(this.repaintHandler),this.graph.getModel().removeListener(this.repaintHandler),this.shape!=null&&(this.shape.destroy(),this.shape=null)},__mxOutput.mxCellHighlight=typeof mxCellHighlight<"u"?mxCellHighlight:void 0;function mxDefaultKeyHandler(t){if(t!=null){this.editor=t,this.handler=new mxKeyHandler(t.graph);var e=this.handler.escape;this.handler.escape=function(i){e.apply(this,arguments),t.hideProperties(),t.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",i))}}}mxDefaultKeyHandler.prototype.editor=null,mxDefaultKeyHandler.prototype.handler=null,mxDefaultKeyHandler.prototype.bindAction=function(t,e,i){var n=mxUtils.bind(this,function(){this.editor.execute(e)});i?this.handler.bindControlKey(t,n):this.handler.bindKey(t,n)},mxDefaultKeyHandler.prototype.destroy=function(){this.handler.destroy(),this.handler=null},__mxOutput.mxDefaultKeyHandler=typeof mxDefaultKeyHandler<"u"?mxDefaultKeyHandler:void 0;function mxDefaultPopupMenu(t){this.config=t}mxDefaultPopupMenu.prototype.imageBasePath=null,mxDefaultPopupMenu.prototype.config=null,mxDefaultPopupMenu.prototype.createMenu=function(t,e,i,n){if(this.config!=null){var r=this.createConditions(t,i,n),s=this.config.firstChild;this.addItems(t,e,i,n,r,s,null)}},mxDefaultPopupMenu.prototype.addItems=function(t,e,i,n,r,s,l){for(var a=!1;s!=null;){if(s.nodeName=="add"){var o=s.getAttribute("if");if(o==null||r[o]){var u=s.getAttribute("as");u=mxResources.get(u)||u;var p=mxUtils.eval(mxUtils.getTextContent(s)),m=s.getAttribute("action"),d=s.getAttribute("icon"),x=s.getAttribute("iconCls"),f=s.getAttribute("enabled-if"),g=f==null||r[f];a&&(e.addSeparator(l),a=!1),d!=null&&this.imageBasePath&&(d=this.imageBasePath+d);var c=this.addAction(e,t,u,d,p,m,i,l,x,g);this.addItems(t,e,i,n,r,s.firstChild,c)}}else s.nodeName=="separator"&&(a=!0);s=s.nextSibling}},mxDefaultPopupMenu.prototype.addAction=function(t,e,i,n,r,s,l,a,o,u){var p=function(m){typeof r=="function"&&r.call(e,e,l,m),s!=null&&e.execute(s,l,m)};return t.addItem(i,n,p,a,o,u)},mxDefaultPopupMenu.prototype.createConditions=function(t,e,i){var n=t.graph.getModel(),r=n.getChildCount(e),s=[];s.nocell=e==null,s.ncells=t.graph.getSelectionCount()>1,s.notRoot=n.getRoot()!=n.getParent(t.graph.getDefaultParent()),s.cell=e!=null;var l=e!=null&&t.graph.getSelectionCount()==1;s.nonEmpty=l&&r>0,s.expandable=l&&t.graph.isCellFoldable(e,!1),s.collapsable=l&&t.graph.isCellFoldable(e,!0),s.validRoot=l&&t.graph.isValidRoot(e),s.emptyValidRoot=s.validRoot&&r==0,s.swimlane=l&&t.graph.isSwimlane(e);for(var a=this.config.getElementsByTagName("condition"),o=0;o0&&this.editor.execute(i)});return this.toolbar.addItem(t,e,r,n)},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,i){var n=mxUtils.bind(this,function(){this.editor.execute(i)});this.addOption(t,e,n)},mxDefaultToolbar.prototype.addOption=function(t,e,i){return this.toolbar.addOption(t,e,i)},mxDefaultToolbar.prototype.addMode=function(t,e,i,n,r){var s=mxUtils.bind(this,function(){this.editor.setMode(i),r!=null&&r(this.editor)});return this.toolbar.addSwitchMode(t,e,s,n)},mxDefaultToolbar.prototype.addPrototype=function(t,e,i,n,r,s){var l=mxUtils.bind(this,function(){return typeof i=="function"?i():i!=null?this.editor.graph.cloneCell(i):null}),a=mxUtils.bind(this,function(p,m){typeof r=="function"?r(this.editor,l(),p,m):this.drop(l(),p,m),this.toolbar.resetMode(),mxEvent.consume(p)}),o=this.toolbar.addMode(t,e,a,n,null,s),u=function(p,m,d){a(m,d)};return this.installDropHandler(o,u),o},mxDefaultToolbar.prototype.drop=function(t,e,i){var n=this.editor.graph,r=n.getModel();if(i==null||r.isEdge(i)||!this.connectOnDrop||!n.isCellConnectable(i)){for(;i!=null&&!n.isValidDropTarget(i,[t],e);)i=r.getParent(i);this.insert(t,e,i)}else this.connect(t,e,i)},mxDefaultToolbar.prototype.insert=function(t,e,i){var n=this.editor.graph;if(n.canImportCell(t)){var r=mxEvent.getClientX(e),s=mxEvent.getClientY(e),l=mxUtils.convertPoint(n.container,r,s);return n.isSplitEnabled()&&n.isSplitTarget(i,[t],e)?n.splitEdge(i,[t],null,l.x,l.y):this.editor.addVertex(i,t,l.x,l.y)}return null},mxDefaultToolbar.prototype.connect=function(t,e,i){var n=this.editor.graph,r=n.getModel();if(i!=null&&n.isCellConnectable(t)&&n.isEdgeValid(null,i,t)){var s=null;r.beginUpdate();try{var l=r.getGeometry(i),a=r.getGeometry(t).clone();a.x=l.x+(l.width-a.width)/2,a.y=l.y+(l.height-a.height)/2;var o=this.spacing*n.gridSize,u=r.getDirectedEdgeCount(i,!0)*20;this.editor.horizontalFlow?a.x+=(a.width+l.width)/2+o+u:a.y+=(a.height+l.height)/2+o+u,t.setGeometry(a);var p=r.getParent(i);if(n.addCell(t,p),n.constrainChild(t),s=this.editor.createEdge(i,t),r.getGeometry(s)==null){var m=new mxGeometry;m.relative=!0,r.setGeometry(s,m)}n.addEdge(s,p,i,t)}finally{r.endUpdate()}n.setSelectionCells([t,s]),n.scrollCellToVisible(t)}},mxDefaultToolbar.prototype.installDropHandler=function(t,e){var i=document.createElement("img");i.setAttribute("src",t.getAttribute("src"));var n=mxUtils.bind(this,function(r){i.style.width=2*t.offsetWidth+"px",i.style.height=2*t.offsetHeight+"px",mxUtils.makeDraggable(t,this.editor.graph,e,i),mxEvent.removeListener(i,"load",n)});mxClient.IS_IE?n():mxEvent.addListener(i,"load",n)},mxDefaultToolbar.prototype.destroy=function(){this.resetHandler!=null&&(this.editor.graph.removeListener("dblclick",this.resetHandler),this.editor.removeListener("escape",this.resetHandler),this.resetHandler=null),this.toolbar!=null&&(this.toolbar.destroy(),this.toolbar=null)},__mxOutput.mxDefaultToolbar=typeof mxDefaultToolbar<"u"?mxDefaultToolbar:void 0;function mxEditor(t){this.actions=[],this.addActions(),document.body!=null&&(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,this.onInit!=null&&this.onInit(),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}mxLoadResources?mxResources.add(mxClient.basePath+"/resources/editor"):mxClient.defaultBundles.push(mxClient.basePath+"/resources/editor"),mxEditor.prototype=new mxEventSource,mxEditor.prototype.constructor=mxEditor,mxEditor.prototype.askZoomResource=mxClient.language!="none"?"askZoom":"",mxEditor.prototype.lastSavedResource=mxClient.language!="none"?"lastSaved":"",mxEditor.prototype.currentFileResource=mxClient.language!="none"?"currentFile":"",mxEditor.prototype.propertiesResource=mxClient.language!="none"?"properties":"",mxEditor.prototype.tasksResource=mxClient.language!="none"?"tasks":"",mxEditor.prototype.helpResource=mxClient.language!="none"?"help":"",mxEditor.prototype.outlineResource=mxClient.language!="none"?"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=" ",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){var e=new mxPrintPreview(t.graph,1);e.open()}),this.addAction("show",function(t){mxUtils.show(t.graph,null,10,10)}),this.addAction("exportImage",function(t){var e=t.getUrlImage();if(e==null||mxClient.IS_LOCAL)t.execute("show");else{var i=mxUtils.getViewXml(t.graph,1),n=mxUtils.getXml(i,` `);mxUtils.submit(e,t.postParameterName+"="+encodeURIComponent(n),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){if(t.graph.isEnabled()){var 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){if(t.graph.isEnabled()){var 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=t.graph.getView().scale*100,i=parseFloat(mxUtils.prompt(mxResources.get(t.askZoomResource)||t.askZoomResource,e))/100;isNaN(i)||t.graph.getView().setScale(i)}),this.addAction("toggleTasks",function(t){t.tasks!=null?t.tasks.setVisible(!t.tasks.isVisible()):t.showTasks()}),this.addAction("toggleHelp",function(t){t.help!=null?t.help.setVisible(!t.help.isVisible()):t.showHelp()}),this.addAction("toggleOutline",function(t){t.outline==null?t.showOutline():t.outline.setVisible(!t.outline.isVisible())}),this.addAction("toggleConsole",function(t){mxLog.setVisible(!mxLog.isVisible())})},mxEditor.prototype.configure=function(t){if(t!=null){var e=new mxCodec(t.ownerDocument);e.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(t,e,i){var n=this.actions[t];if(n!=null)try{var r=arguments;r[0]=this,n.apply(this,r)}catch(s){throw mxUtils.error("Cannot execute "+t+": "+s.message,280,!0),s}else mxUtils.error("Cannot find action "+t,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(e,i,n){return this.createPopupMenu(e,i,n)}),t.connectionHandler.factoryMethod=mxUtils.bind(this,function(e,i){return this.createEdge(e,i)}),this.createSwimlaneManager(t),this.createLayoutManager(t),t},mxEditor.prototype.createSwimlaneManager=function(t){var e=new mxSwimlaneManager(t,!1);return e.isHorizontal=mxUtils.bind(this,function(){return this.horizontalFlow}),e.isEnabled=mxUtils.bind(this,function(){return this.maintainSwimlanes}),e},mxEditor.prototype.createLayoutManager=function(t){var e=new mxLayoutManager(t),i=this;return e.getLayout=function(n){var r=null,s=i.graph.getModel();return s.getParent(n)!=null&&(i.layoutSwimlanes&&t.isSwimlane(n)?(i.swimlaneLayout==null&&(i.swimlaneLayout=i.createSwimlaneLayout()),r=i.swimlaneLayout):i.layoutDiagram&&(t.isValidRoot(n)||s.getParent(s.getParent(n))==null)&&(i.diagramLayout==null&&(i.diagramLayout=i.createDiagramLayout()),r=i.diagramLayout)),r},e},mxEditor.prototype.setGraphContainer=function(t){this.graph.container==null&&(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(t){t.addListener(mxEvent.DOUBLE_CLICK,mxUtils.bind(this,function(e,i){var n=i.getProperty("cell");n!=null&&t.isEnabled()&&this.dblClickAction!=null&&(this.execute(this.dblClickAction,n),i.consume())}))},mxEditor.prototype.installUndoHandler=function(t){var e=mxUtils.bind(this,function(n,r){var s=r.getProperty("edit");this.undoManager.undoableEditHappened(s)});t.getModel().addListener(mxEvent.UNDO,e),t.getView().addListener(mxEvent.UNDO,e);var i=function(n,r){var s=r.getProperty("edit").changes;t.setSelectionCells(t.getSelectionCellsForChanges(s))};this.undoManager.addListener(mxEvent.UNDO,i),this.undoManager.addListener(mxEvent.REDO,i)},mxEditor.prototype.installDrillHandler=function(t){var e=mxUtils.bind(this,function(i){this.fireEvent(new mxEventObject(mxEvent.ROOT))});t.getView().addListener(mxEvent.DOWN,e),t.getView().addListener(mxEvent.UP,e)},mxEditor.prototype.installChangeHandler=function(t){var e=mxUtils.bind(this,function(i,n){this.setModified(!0),this.validating==!0&&t.validateGraph();for(var r=n.getProperty("edit").changes,s=0;s "+e.convertValueToString(i)+t),i=e.getModel().getParent(i);var n=this.getRootTitle();return n+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=this.groupBorderSize!=null?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),t)},mxEditor.prototype.createGroup=function(){var t=this.graph.getModel();return t.cloneCell(this.defaultGroup)},mxEditor.prototype.open=function(t){if(t!=null){var 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){var e=new mxCodec(t.ownerDocument);e.decode(t,this.graph.getModel()),this.resetHistory()},mxEditor.prototype.save=function(t,e){if(t=t||this.getUrlPost(),t!=null&&t.length>0){var i=this.writeGraphModel(e);this.postDiagram(t,i),this.setModified(!1)}this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",t))},mxEditor.prototype.postDiagram=function(t,e){this.escapePostData&&(e=encodeURIComponent(e)),mxUtils.post(t,this.postParameterName+"="+e,mxUtils.bind(this,function(i){this.fireEvent(new mxEventObject(mxEvent.POST,"request",i,"url",t,"data",e))}))},mxEditor.prototype.writeGraphModel=function(t){t=t??this.linefeed;var e=new mxCodec,i=e.encode(this.graph.getModel());return mxUtils.getXml(i,t)},mxEditor.prototype.getUrlPost=function(){return this.urlPost},mxEditor.prototype.getUrlImage=function(){return this.urlImage},mxEditor.prototype.swapStyles=function(t,e){var i=this.graph.getStylesheet().styles[e];this.graph.getView().getStylesheet().putCellStyle(e,this.graph.getStylesheet().styles[t]),this.graph.getStylesheet().putCellStyle(t,i),this.graph.refresh()},mxEditor.prototype.showProperties=function(t){if(t=t||this.graph.getSelectionCell(),t==null&&(t=this.graph.getCurrentRoot(),t==null&&(t=this.graph.getModel().getRoot())),t!=null){this.graph.stopEditing(!0);var e=mxUtils.getOffset(this.graph.container),i=e.x+10,n=e.y;if(this.properties!=null&&!this.movePropertiesDialog)i=this.properties.getX(),n=this.properties.getY();else{var r=this.graph.getCellBounds(t);r!=null&&(i+=r.x+Math.min(200,r.width),n+=r.y)}this.hideProperties();var s=this.createProperties(t);s!=null&&(this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,s,i,n,this.propertiesWidth,this.propertiesHeight,!1),this.properties.setVisible(!0))}},mxEditor.prototype.isPropertiesVisible=function(){return this.properties!=null},mxEditor.prototype.createProperties=function(t){var e=this.graph.getModel(),i=e.getValue(t);if(mxUtils.isNode(i)){var n=new mxForm("properties"),r=n.addText("ID",t.getId());r.setAttribute("readonly","true");var s=null,l=null,a=null,o=null,u=null;e.isVertex(t)&&(s=e.getGeometry(t),s!=null&&(l=n.addText("top",s.y),a=n.addText("left",s.x),o=n.addText("width",s.width),u=n.addText("height",s.height)));for(var p=e.getStyle(t),m=n.addText("Style",p||""),d=i.attributes,x=[],f=0;f0?e.setStyle(t,m.value):e.setStyle(t,null);for(var y=0;y0&&this.graph.isSwimlane(t)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null},mxEditor.prototype.cycleAttribute=function(t){if(this.cycleAttributeName!=null){var e=this.consumeCycleAttribute(t);e!=null&&t.setStyle(t.getStyle()+";"+this.cycleAttributeName+"="+e)}},mxEditor.prototype.addVertex=function(t,e,i,n){for(var r=this.graph.getModel();t!=null&&!this.graph.isValidDropTarget(t);)t=r.getParent(t);t=t??this.graph.getSwimlaneAt(i,n);var s=this.graph.getView().scale,l=r.getGeometry(e),a=r.getGeometry(t);if(this.graph.isSwimlane(e)&&!this.graph.swimlaneNesting)t=null;else{if(t==null&&this.swimlaneRequired)return null;if(t!=null&&a!=null){var o=this.graph.getView().getState(t);if(o!=null){if(i-=o.origin.x*s,n-=o.origin.y*s,this.graph.isConstrainedMoving){var u=l.width,p=l.height,m=o.x+o.width;i+u>m&&(i-=i+u-m),m=o.y+o.height,n+p>m&&(n-=n+p-m)}}else a!=null&&(i-=a.x*s,n-=a.y*s)}}l=l.clone(),l.x=this.graph.snap(i/s-this.graph.getView().translate.x-this.graph.gridSize/2),l.y=this.graph.snap(n/s-this.graph.getView().translate.y-this.graph.gridSize/2),e.setGeometry(l),t==null&&(t=this.graph.getDefaultParent()),this.cycleAttribute(e),this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",e,"parent",t)),r.beginUpdate();try{e=this.graph.addCell(e,t),e!=null&&(this.graph.constrainChild(e),this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",e)))}finally{r.endUpdate()}return e!=null&&(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,this.tasks!=null&&this.tasks.destroy(),this.outline!=null&&this.outline.destroy(),this.properties!=null&&this.properties.destroy(),this.keyHandler!=null&&this.keyHandler.destroy(),this.rubberband!=null&&this.rubberband.destroy(),this.toolbar!=null&&this.toolbar.destroy(),this.graph!=null&&this.graph.destroy(),this.status=null,this.templates=null)},__mxOutput.mxEditor=typeof mxEditor<"u"?mxEditor:void 0;var mxCodecRegistry={codecs:[],aliases:[],register:function(t){if(t!=null){var e=t.getName();mxCodecRegistry.codecs[e]=t;var i=mxUtils.getFunctionName(t.template.constructor);i!=e&&mxCodecRegistry.addAlias(i,e)}return t},addAlias:function(t,e){mxCodecRegistry.aliases[t]=e},getCodec:function(t){var e=null;if(t!=null){var i=mxUtils.getFunctionName(t),n=mxCodecRegistry.aliases[i];if(n!=null&&(i=n),e=mxCodecRegistry.codecs[i],e==null)try{e=new mxObjectCodec(new t),mxCodecRegistry.register(e)}catch{}}return e}};__mxOutput.mxCodecRegistry=typeof mxCodecRegistry<"u"?mxCodecRegistry:void 0;function mxCodec(t){this.document=t||mxUtils.createXmlDocument(),this.objects=[]}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,e},mxCodec.prototype.getObject=function(t){var e=null;if(t!=null&&(e=this.objects[t],e==null&&(e=this.lookup(t),e==null))){var i=this.getElementById(t);i!=null&&(e=this.decode(i))}return e},mxCodec.prototype.lookup=function(t){return null},mxCodec.prototype.getElementById=function(t){return this.updateElements(),this.elements[t]},mxCodec.prototype.updateElements=function(){this.elements==null&&(this.elements=new Object,this.document.documentElement!=null&&this.addElement(this.document.documentElement))},mxCodec.prototype.addElement=function(t){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var e=t.getAttribute("id");if(e!=null){if(this.elements[e]==null)this.elements[e]=t;else if(this.elements[e]!=t)throw new Error(e+": Duplicate ID")}}for(t=t.firstChild;t!=null;)this.addElement(t),t=t.nextSibling},mxCodec.prototype.getId=function(t){var e=null;return t!=null&&(e=this.reference(t),e==null&&t instanceof mxCell&&(e=t.getId(),e==null&&(e=mxCellPath.create(t),e.length==0&&(e="root")))),e},mxCodec.prototype.reference=function(t){return null},mxCodec.prototype.encode=function(t){var e=null;if(t!=null&&t.constructor!=null){var i=mxCodecRegistry.getCodec(t.constructor);i!=null?e=i.encode(this,t):mxUtils.isNode(t)?e=mxUtils.importNode(this.document,t,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(t.constructor))}return e},mxCodec.prototype.decode=function(t,e){this.updateElements();var i=null;if(t!=null&&t.nodeType==mxConstants.NODETYPE_ELEMENT){var n=null;try{n=window[t.nodeName]}catch{}var r=mxCodecRegistry.getCodec(n);r!=null?i=r.decode(this,t,e):(i=t.cloneNode(!0),i.removeAttribute("as"))}return i},mxCodec.prototype.encodeCell=function(t,e,i){if(e.appendChild(this.encode(t)),i==null||i)for(var n=t.getChildCount(),r=0;r=0},mxObjectCodec.prototype.isReference=function(t,e,i,n){return mxUtils.indexOf(this.idrefs,e)>=0},mxObjectCodec.prototype.encode=function(t,e){var i=t.document.createElement(this.getName());return e=this.beforeEncode(t,e,i),this.encodeObject(t,e,i),this.afterEncode(t,e,i)},mxObjectCodec.prototype.encodeObject=function(t,e,i){t.setAttribute(i,"id",t.getId(e));for(var n in e){var r=n,s=e[r];s!=null&&!this.isExcluded(e,r,s,!0)&&(mxUtils.isInteger(r)&&(r=null),this.encodeValue(t,e,r,s,i))}},mxObjectCodec.prototype.encodeValue=function(t,e,i,n,r){if(n!=null){if(this.isReference(e,i,n,!0)){var s=t.getId(n);if(s==null){mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+i+"="+n);return}n=s}var l=this.template[i];(i==null||t.encodeDefaults||l!=n)&&(i=this.getAttributeName(i),this.writeAttribute(t,e,i,n,r))}},mxObjectCodec.prototype.writeAttribute=function(t,e,i,n,r){typeof n!="object"?this.writePrimitiveAttribute(t,e,i,n,r):this.writeComplexAttribute(t,e,i,n,r)},mxObjectCodec.prototype.writePrimitiveAttribute=function(t,e,i,n,r){if(n=this.convertAttributeToXml(t,e,i,n,r),i==null){var s=t.document.createElement("add");typeof n=="function"?s.appendChild(t.document.createTextNode(n)):t.setAttribute(s,"value",n),r.appendChild(s)}else typeof n!="function"&&t.setAttribute(r,i,n)},mxObjectCodec.prototype.writeComplexAttribute=function(t,e,i,n,r){var s=t.encode(n);s!=null?(i!=null&&s.setAttribute("as",i),r.appendChild(s)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+i+": "+n)},mxObjectCodec.prototype.convertAttributeToXml=function(t,e,i,n){return this.isBooleanAttribute(t,e,i,n)&&(n=n==!0?"1":"0"),n},mxObjectCodec.prototype.isBooleanAttribute=function(t,e,i,n){return typeof n.length>"u"&&(n==!0||n==!1)},mxObjectCodec.prototype.convertAttributeFromXml=function(t,e,i){var n=e.value;return this.isNumericAttribute(t,e,i)&&(n=parseFloat(n),(isNaN(n)||!isFinite(n))&&(n=0)),n},mxObjectCodec.prototype.isNumericAttribute=function(t,e,i){var n=i.constructor==mxGeometry&&(e.name=="x"||e.name=="y"||e.name=="width"||e.name=="height")||i.constructor==mxPoint&&(e.name=="x"||e.name=="y")||mxUtils.isNumeric(e.value);return n},mxObjectCodec.prototype.beforeEncode=function(t,e,i){return e},mxObjectCodec.prototype.afterEncode=function(t,e,i){return i},mxObjectCodec.prototype.decode=function(t,e,i){var n=e.getAttribute("id"),r=t.objects[n];return r==null&&(r=i||this.cloneTemplate(),n!=null&&t.putObject(n,r)),e=this.beforeDecode(t,e,r),this.decodeNode(t,e,r),this.afterDecode(t,e,r)},mxObjectCodec.prototype.decodeNode=function(t,e,i){e!=null&&(this.decodeAttributes(t,e,i),this.decodeChildren(t,e,i))},mxObjectCodec.prototype.decodeAttributes=function(t,e,i){var n=e.attributes;if(n!=null)for(var r=0;r0&&(n=null),n},mxObjectCodec.prototype.addObjectValue=function(t,e,i,n){i!=null&&i!=n&&(e!=null&&e.length>0?t[e]=i:t.push(i))},mxObjectCodec.prototype.processInclude=function(t,e,i){if(e.nodeName=="include"){var n=e.getAttribute("name");if(n!=null)try{var r=mxUtils.load(n).getDocumentElement();r!=null&&t.decode(r,i)}catch{}return!0}return!1},mxObjectCodec.prototype.beforeDecode=function(t,e,i){return e},mxObjectCodec.prototype.afterDecode=function(t,e,i){return i},__mxOutput.mxObjectCodec=typeof mxObjectCodec<"u"?mxObjectCodec:void 0,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(e,i,n){return i.nodeName!=="value"&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)},t.isExcluded=function(e,i,n,r){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||r&&i=="value"&&n.nodeType==mxConstants.NODETYPE_ELEMENT},t.afterEncode=function(e,i,n){if(i.value!=null&&i.value.nodeType==mxConstants.NODETYPE_ELEMENT){var r=n;n=mxUtils.importNode(e.document,i.value,!0),n.appendChild(r);var s=r.getAttribute("id");n.setAttribute("id",s),r.removeAttribute("id")}return n},t.beforeDecode=function(e,i,n){var r=i.cloneNode(!0),s=this.getName();if(i.nodeName!=s){var l=i.getElementsByTagName(s)[0];l!=null&&l.parentNode==i?(mxUtils.removeWhitespace(l,!0),mxUtils.removeWhitespace(l,!1),l.parentNode.removeChild(l),r=l):r=null,n.value=i.cloneNode(!0);var a=n.value.getAttribute("id");a!=null&&(n.setId(a),n.value.removeAttribute("id"))}else n.setId(i.getAttribute("id"));if(r!=null)for(var o=0;o=0},t.isExcluded=function(e,i,n,r){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||r&&n!=null&&(i=="previous"||i=="parent")&&!e.model.contains(n)},t.afterEncode=function(e,i,n){return this.isReference(i,"child",i.child,!0)?n.setAttribute("child",e.getId(i.child)):e.encodeCell(i.child,n),n},t.beforeDecode=function(e,i,n){if(i.firstChild!=null&&i.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){i=i.cloneNode(!0);var r=i.firstChild;n.child=e.decodeCell(r,!1);var s=r.nextSibling;for(r.parentNode.removeChild(r),r=s;r!=null;){if(s=r.nextSibling,r.nodeType==mxConstants.NODETYPE_ELEMENT){var l=r.getAttribute("id");e.lookup(l)==null&&e.decodeCell(r)}r.parentNode.removeChild(r),r=s}}else{var a=i.getAttribute("child");n.child=e.getObject(a)}return i},t.afterDecode=function(e,i,n){return n.child!=null&&(n.child.parent!=null&&n.previous!=null&&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}()),__mxOutput.mxChildChangeCodec=typeof mxChildChangeCodec<"u"?mxChildChangeCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);return t.afterDecode=function(e,i,n){return n.previous=n.terminal,n},t}()),__mxOutput.mxTerminalChangeCodec=typeof mxTerminalChangeCodec<"u"?mxTerminalChangeCodec:void 0;var mxGenericChangeCodec=function(t,e){var i=new mxObjectCodec(t,["model","previous"],["cell"]);return i.afterDecode=function(n,r,s){return mxUtils.isNode(s.cell)&&(s.cell=n.decodeCell(s.cell,!1)),s.previous=s[e],s},i};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")),__mxOutput.mxGenericChangeCodec=typeof mxGenericChangeCodec<"u"?mxGenericChangeCodec:void 0,mxCodecRegistry.register(function(){return new mxObjectCodec(new mxGraph,["graphListeners","eventListeners","view","container","cellRenderer","editor","selection"])}()),__mxOutput.mxGraphCodec=typeof mxGraphCodec<"u"?mxGraphCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxGraphView);return t.encode=function(e,i){return this.encodeCell(e,i,i.graph.getModel().getRoot())},t.encodeCell=function(e,i,n){var r=i.graph.getModel(),s=i.getState(n),l=r.getParent(n);if(l==null||s!=null){var a=r.getChildCount(n),o=i.graph.getCellGeometry(n),u=null;if(l==r.getRoot()?u="layer":l==null?u="graph":r.isEdge(n)?u="edge":a>0&&o!=null?u="group":r.isVertex(n)&&(u="vertex"),u!=null){var p=e.document.createElement(u),m=i.graph.getLabel(n);if(m!=null&&(p.setAttribute("label",i.graph.getLabel(n)),i.graph.isHtmlLabel(n)&&p.setAttribute("html",!0)),l==null){var d=i.getGraphBounds();d!=null&&(p.setAttribute("x",Math.round(d.x)),p.setAttribute("y",Math.round(d.y)),p.setAttribute("width",Math.round(d.width)),p.setAttribute("height",Math.round(d.height))),p.setAttribute("scale",i.scale)}else if(s!=null&&o!=null){for(var x in s.style){var f=s.style[x];typeof f=="function"&&typeof f=="object"&&(f=mxStyleRegistry.getName(f)),f!=null&&typeof f!="function"&&typeof f!="object"&&p.setAttribute(x,f)}var g=s.absolutePoints;if(g!=null&&g.length>0){for(var c=Math.round(g[0].x)+","+Math.round(g[0].y),x=1;x0&&n.appendChild(l)}}return n},t.getStringValue=function(e,i){var n=typeof i;return n=="function"?i=mxStyleRegistry.getName(i):n=="object"&&(i=null),i},t.decode=function(e,i,n){var r=n||new this.template.constructor,s=i.getAttribute("id");for(s!=null&&(e.objects[s]=r),i=i.firstChild;i!=null;){if(!this.processInclude(e,i,r)&&i.nodeName=="add"){var l=i.getAttribute("as");if(l!=null){var a=i.getAttribute("extend"),o=a!=null?mxUtils.clone(r.styles[a]):null;o==null&&(a!=null&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+a+" not found to extend"),o=new Object);for(var u=i.firstChild;u!=null;){if(u.nodeType==mxConstants.NODETYPE_ELEMENT){var p=u.getAttribute("as");if(u.nodeName=="add"){var m=mxUtils.getTextContent(u),d=null;m!=null&&m.length>0&&mxStylesheetCodec.allowEval?d=mxUtils.eval(m):(d=u.getAttribute("value"),mxUtils.isNumeric(d)&&(d=parseFloat(d))),d!=null&&(o[p]=d)}else u.nodeName=="remove"&&delete o[p]}u=u.nextSibling}r.putCellStyle(l,o)}}i=i.nextSibling}return r},t}());mxStylesheetCodec.allowEval=!0,__mxOutput.mxStylesheetCodec=typeof mxStylesheetCodec<"u"?mxStylesheetCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultKeyHandler);return t.encode=function(e,i){return null},t.decode=function(e,i,n){if(n!=null)for(n.editor,i=i.firstChild;i!=null;){if(!this.processInclude(e,i,n)&&i.nodeName=="add"){var r=i.getAttribute("as"),s=i.getAttribute("action"),l=i.getAttribute("control");n.bindAction(r,s,l)}i=i.nextSibling}return n},t}()),__mxOutput.mxDefaultKeyHandlerCodec=typeof mxDefaultKeyHandlerCodec<"u"?mxDefaultKeyHandlerCodec:void 0;var mxDefaultToolbarCodec=mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultToolbar);return t.encode=function(e,i){return null},t.decode=function(e,i,n){if(n!=null){var r=n.editor;for(i=i.firstChild;i!=null;){if(i.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(e,i,n)){if(i.nodeName=="separator")n.addSeparator();else if(i.nodeName=="br")n.toolbar.addBreak();else if(i.nodeName=="hr")n.toolbar.addLine();else if(i.nodeName=="add"){var s=i.getAttribute("as");s=mxResources.get(s)||s;var l=i.getAttribute("icon"),a=i.getAttribute("pressedIcon"),o=i.getAttribute("action"),u=i.getAttribute("mode"),p=i.getAttribute("template"),m=i.getAttribute("toggle")!="0",d=mxUtils.getTextContent(i),x=null;if(o!=null)x=n.addItem(s,l,o,a);else if(u!=null){var f=mxDefaultToolbarCodec.allowEval?mxUtils.eval(d):null;x=n.addMode(s,l,u,a,f)}else if(p!=null||d!=null&&d.length>0){var g=r.templates[p],c=i.getAttribute("style");g!=null&&c!=null&&(g=r.graph.cloneCell(g),g.setStyle(c));var v=null;d!=null&&d.length>0&&mxDefaultToolbarCodec.allowEval&&(v=mxUtils.eval(d)),x=n.addPrototype(s,l,g,a,v,m)}else{var y=mxUtils.getChildNodes(i);if(y.length>0)if(l==null)for(var T=n.addActionCombo(s),C=0;C0&&x.setAttribute("id",O)}}}i=i.nextSibling}}return n},t}());return mxDefaultToolbarCodec.allowEval=!0,__mxOutput.mxDefaultToolbarCodec=typeof mxDefaultToolbarCodec<"u"?mxDefaultToolbarCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultPopupMenu);return t.encode=function(e,i){return null},t.decode=function(e,i,n){var r=i.getElementsByTagName("include")[0];return r!=null?this.processInclude(e,r,n):n!=null&&(n.config=i),n},t}()),__mxOutput.mxDefaultPopupMenuCodec=typeof mxDefaultPopupMenuCodec<"u"?mxDefaultPopupMenuCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxEditor,["modified","lastSnapshot","ignoredChanges","undoManager","graphContainer","toolbarContainer"]);return t.afterDecode=function(e,i,n){var r=i.getAttribute("defaultEdge");r!=null&&(i.removeAttribute("defaultEdge"),n.defaultEdge=n.templates[r]);var s=i.getAttribute("defaultGroup");return s!=null&&(i.removeAttribute("defaultGroup"),n.defaultGroup=n.templates[s]),n},t.decodeChild=function(e,i,n){if(i.nodeName=="Array"){var r=i.getAttribute("as");if(r=="templates"){this.decodeTemplates(e,i,n);return}}else if(i.nodeName=="ui"){this.decodeUi(e,i,n);return}mxObjectCodec.prototype.decodeChild.apply(this,arguments)},t.decodeUi=function(e,i,n){for(var r=i.firstChild;r!=null;){if(r.nodeName=="add"){var s=r.getAttribute("as"),l=r.getAttribute("element"),a=r.getAttribute("style"),o=null;if(l!=null)o=document.getElementById(l),o!=null&&a!=null&&(o.style.cssText+=";"+a);else{var u=parseInt(r.getAttribute("x")),p=parseInt(r.getAttribute("y")),m=r.getAttribute("width"),d=r.getAttribute("height");o=document.createElement("div"),o.style.cssText=a;var x=new mxWindow(mxResources.get(s)||s,o,u,p,m,d,!1,!0);x.setVisible(!0)}s=="graph"?n.setGraphContainer(o):s=="toolbar"?n.setToolbarContainer(o):s=="title"?n.setTitleContainer(o):s=="status"?n.setStatusContainer(o):s=="map"&&n.setMapContainer(o)}else r.nodeName=="resource"?mxResources.add(r.getAttribute("basename")):r.nodeName=="stylesheet"&&mxClient.link("stylesheet",r.getAttribute("name"));r=r.nextSibling}},t.decodeTemplates=function(e,i,n){n.templates==null&&(n.templates=[]);for(var r=mxUtils.getChildNodes(i),s=0;s